diff --git a/README.ce4100 b/README.ce4100 new file mode 100644 index 00000000..c3f101e7 --- /dev/null +++ b/README.ce4100 @@ -0,0 +1,192 @@ + +===================================================================== +How to prepare your host machine to build boxee and CE4100 SDK +===================================================================== + +Install Ubuntu Desktop. + +# sudo apt-get install wget patch flex bison gettext libtool autoconf cmake nasm gperf g++ gawk doxygen swig libsdl-image1.2-dev liblzo2-dev php5-cli + +If you are using Ubuntu 9.10 or earlier: + +# sudo apt-get install python2.4-minimal + +If you are using Ubuntu 10.04 32 bit or newer: + +# cd /tmp +# wget http://mirrors.kernel.org/ubuntu/pool/main/p/python2.4/python2.4-minimal_2.4.6-1ubuntu3.2.9.10.1_i386.deb +# sudo dpkg --install python2.4*deb + +If you are using Ubuntu 10.04 64 bit or newer: + +# cd /tmp +# wget http://mirrors.kernel.org/ubuntu/pool/main/p/python2.4/python2.4-minimal_2.4.6-1ubuntu3.2.9.10.1_amd64.deb +# sudo dpkg --install python2.4*deb + +===================================================================== +How to build the CE4100 SDK +===================================================================== + +# sudo mkdir /mnt/iso + +Go to intel's site, under Intel Media Processor 3100 +Download the tar.gz and extract it. This will create a bunch of ISO files. + +For each file (start with BASE): +# sudo mount -t iso9660 -o loop,ro .iso /mnt/iso +# cd /mnt/iso +# bash installer +# cd .. +# sudo umount /mnt/iso + +This extracted everything to $HOME/IntelCE- + +# cd $HOME/IntelCE- +# make menuconfig +# sudo make + +Wait a few hours... + +Then, setup NFS, DHCP, TFTP, etc according to the Intel docs + +===================================================================== +Setup CE4100 box +===================================================================== + +1. During boot hit CTRL-C to enter RedBoot console +2. Type: fconfig and hit enter + +load -v -r -m tftp -h 10.5.0.1 -b 0x200000 bzImage.pr13.11 +exec -b 0x200000 -l 0x300000 -c "console=ttyS0,115200 root=/dev/nfs nfsroot=10.5.0.1:/home/yuvalt/IntelCE-13.94515/project_build_i686/IntelCE/root,nolock rw mem=exactmap memmap=1M@0 memmap=639M@1M ip=dhcp" + +Hit enter until the end. Last question answer "y". + +===================================================================== +Boxee specific environment +===================================================================== + +# sudo mkdir /opt/canmore +# sudo ln -s $HOME/IntelCE-/build_i686/staging_dir /opt/canmore/IntelCE +# sudo ln -s $HOME/IntelCE-/build_i686/staging_dir/bin /opt/canmore/toolchains +# sudo ln -s $HOME/IntelCE-/project_build_i686/IntelCE/root /opt/canmore/targetfs +# sudo ln -s $HOME/IntelCE- /opt/canmore/sdk +# cd /opt/canmore +# sudo tar xvfJ $(SRC)/canmore/local.tar.xz + +Add /opt/canmore/toolcahin to PATH in ~/.bash_profile Try to run i686-cm-linux-gcc. + +Remote the config.h from Intel SDK as it's causing Boxee build problems: +# cd /opt/canmore/IntelCE/include +# mv config.h config.h.orig + +Add "DisableHWTextureUpload=1" in /etc/powervr.ini . + +edit /etc/platform_config/ce4100/platform_config.hcfg: + media_base_address = 0x28000000 //640M + +===================================================================== +Building debug/non-optimized version +===================================================================== + +./bootstrap +autoconf +# for debug build do the following: +./canmore/configure.sh -d +# for optimized build do the following: +./canmore/configure.sh +make Boxee +for 32-bit: make -C tools/TexturePacker -f Makefile.host +for 64-bit: make -C tools/TexturePacker -f Makefile.host64 +make -C skin/boxee/media nocompress + +===================================================================== +Installation +===================================================================== + +Copy the 3rd party libraries to the target filesystem. This needs to be +done once whenever the targetfs-addons.tar.xz changes: + +# mkdir /opt/canmore/targetfs/opt/local +# cd /opt/canmore/targetfs/opt/local +# tar xvfj $(SRC)/canmore/targetfs-local.tar.xz + +The following copies all the required files to /opt/canmore/targetfs/opt/boxee: + +# ./canmore/install_full.sh + +===================================================================== +Run Boxee +===================================================================== + +From the CE4100 console: + +/opt/boxee/run_boxee.sh + +Getting to a console if your box launches straight into boxee: + +Get the IP of the box from network status. telnet into that IP. +Kill the run_boxee and Boxee processes (in that order) and the console +should now be 'live'. + +Stopping boxee from launching automatically at boot: + +After doing the above, remove the /etc/rc3.d boxee script. This will +boot you to console instead of to boxee. + +Running boxee from your developer working copy: + +The easy method is to get to the console on your boxee box, mount the +working directory you use via nfs, and launch boxee from there. +On the boxee console: +mkdir /mnt/work +mount -t nfs :/opt/canmore/targetfs/opt/boxee /mnt/work -o nolock + +===================================================================== +3rd Parties +===================================================================== + +Libraries: + +zlib (http://www.zlib.net/) +zzip (http://zziplib.sourceforge.net/) +bzip2 (http://bzip.org/) +c-ares (http://c-ares.haxx.se/) +expat (http://expat.sourceforge.net/) +fribidi (http://www.fribidi.org/) +gdbm (http://www.gnu.org/software/gdbm/) +libvpx (http://www.webmproject.org/) +libxml2 (http://xmlsoft.org/) +lzo2 (http://www.oberhumer.com/opensource/lzo/) +pcre (ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/) +libpng (http://www.libpng.org/pub/png/libpng.html) +libsamplerate (http://www.mega-nerd.com/SRC/) +sdl (http://www.libsdl.org/) +openssl (http://www.openssl.org/) +libcurl (http://curl.haxx.se/) +glib (http://www.gtk.org/) +libmms (http://sourceforge.net/projects/libmms/) +jasper (http://www.ece.uvic.ca/~mdadams/jasper/) +jsoncpp (http://jsoncpp.sourceforge.net/) +tiff (http://www.libtiff.org/) +sqlite (http://www.sqlite.org/) +libmad (http://www.underbit.com/products/mad/)a +libogg (http://www.xiph.org/ogg/) +libvorbis (http://www.xiph.org/ogg/) +freetype (http://www.freetype.org/) +faad2 (http://www.audiocoding.com/faad2.html) +flac (http://flac.sourceforge.net/) +libsmbclient (http://www.samba.org/) +python 2.4 (http://www.python.org/) +libdaemon +regex + +System Tools / Processes: + +dbus (http://www.freedesktop.org/wiki/Software/dbus) +avahi (http://avahi.org) +compcache (http://code.google.com/p/compcache/) +lirc (http://www.lirc.org/) +fuse (http://fuse.sourceforge.net/) +ntfs-3g (http://www.tuxera.com/community/ntfs-3g-download/) +xmlstarlet (http://xmlstar.sourceforge.net/) +tzdata (http://www.twinsun.com/tz/tz-link.htm) diff --git a/README.win32 b/README.win32 new file mode 100644 index 00000000..e50f5125 --- /dev/null +++ b/README.win32 @@ -0,0 +1,65 @@ +TOC +1. Introduction +2. Getting the source code +3. Installing the required packages +4. How to compile +5. How to run + +----------------------------------------------------------------------------- +1. Introduction +----------------------------------------------------------------------------- + +This is Boxee client for Windows. It's target is developers and not end-users. +We currently recommend Windows 7 as a development platform. + + +----------------------------------------------------------------------------- +2. Getting the source code +----------------------------------------------------------------------------- + +You can obtain the source code from the boxee web site. + +----------------------------------------------------------------------------- +3.0 Install Visual Studio 2010 +----------------------------------------------------------------------------- + +Install Visual Studio 2010. You can download the Express edition from Microsoft's site at +(http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express). + +----------------------------------------------------------------------------- +3.1 Install DirectX SDK +----------------------------------------------------------------------------- + +Get the latest DirectX SDK, available from Microsoft's site at +(http://msdn.microsoft.com/en-us/directx/) + +----------------------------------------------------------------------------- +3.2 Install NSIS +----------------------------------------------------------------------------- + +Get the latest NSIS version, available at (http://nsis.sourceforge.net/Download) + +----------------------------------------------------------------------------- +4. How to compile +----------------------------------------------------------------------------- + +In-order to debug boxee: +Compile the VS 2010 project, project\VS2010Express\BOXEE for Windows.sln + +In-order to debug the code from the build directory, you need to copy all of +the required dlls and other files. If you have Python installed, you can do it +by running the script: project\VS2010Express\prepare_for_debug.py +from its current working directory. + +In-order to create an installation file: +Run the batch file: project\Win32BuildSetup\BuildSetup.bat +(You'd probably want to run "BuildSetup.bat noexit", to see its output.) + +Note: Currently only the DirectX releases are supported. + +----------------------------------------------------------------------------- +5. How to run +----------------------------------------------------------------------------- + +- Istall the BoxeeSetup.exe file. +- Click on the Boxee shortcut. diff --git a/UserData/profiles.xml.in b/UserData/profiles.xml.in new file mode 100644 index 00000000..3a1cb9d7 --- /dev/null +++ b/UserData/profiles.xml.in @@ -0,0 +1,46 @@ + + 1 + true + + + Master user + special://masterprofile/ + + + 0 + + + + false + false + false + false + false + false + false + true + + + yuvalt + Yuval Tal + profiles/yuvalt + http://s3.boxee.tv/thumb/200x200/4/b/db303df40a988545e80a0ca2c03ccd.png + 01/01/1970 - 5:41 AM + 3 + RhrmtQD1gC1NUrNGQ83Mbg== + RhrmtQD1gC1NUrNGQ83Mbg== + + false + false + false + false + false + false + false + true + true + true + true + true + + diff --git a/UserData/shortcuts.xml.in.embedded b/UserData/shortcuts.xml.in.embedded new file mode 100644 index 00000000..b0976e79 --- /dev/null +++ b/UserData/shortcuts.xml.in.embedded @@ -0,0 +1,31 @@ + + + MLB + http://dir.boxee.tv/apps/mlb/thumb.png + false + app://mlb/ + false + all + true + false + + + Pandora + http://dir.boxee.tv/apps/pandora/thumb.png + false + app://pandora/ + false + all + true + false + + + How I Met Your Mother + http://www.thetvdb.com/banners/_cache/posters/75760-3.jpg + false + ActivateWindow(10483,boxee://tvshows/episodes?local=true&remote=true&seriesId=304418) + all + true + false + + diff --git a/UserData/sources.xml.in.diff.embedded b/UserData/sources.xml.in.diff.embedded new file mode 100644 index 00000000..96dcf0bd --- /dev/null +++ b/UserData/sources.xml.in.diff.embedded @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/UserData/sources.xml.in.embedded b/UserData/sources.xml.in.embedded new file mode 100644 index 00000000..7404ae86 --- /dev/null +++ b/UserData/sources.xml.in.embedded @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/boxee.config.in b/boxee.config.in new file mode 100644 index 00000000..7627c404 --- /dev/null +++ b/boxee.config.in @@ -0,0 +1,118 @@ +# +# boxee-lib config file +# this file contains parameters in the form of: key=value +# which will affect the behavior of the library +# + +Boxee.Server = http://virgola.boxee.tv +Boxee.Resolver.Server = http://res.boxee.tv +Boxee.LoginUrl = http://virgola.boxee.tv/api/login +Boxee.LogoutUrl = http://virgola.boxee.tv/api/logout + +# Recommendations request parameters +Boxee.RecommendationsListFreqInMs = 30000 +Boxee.RecommendationsListUrl = http://virgola.boxee.tv/api/get_recommendations + +# Queue request parameters +Boxee.QueueListFreqInMs = 30000 +Boxee.QueueListUrl = http://virgola.boxee.tv/api/get_queue + +# Friends request parameters +Boxee.FriendsListFreqInMs = 600000 +Boxee.FriendsListUrl = http://virgola.boxee.tv/user/ + +# Applications request parameters +Boxee.ApplicationsListFreqInMs = 600000 +Boxee.ApplicationsListUrl = http://virgola.boxee.tv/api/get_applications + +# Subscriptions request parameters +Boxee.SubscriptionsListFreqInMs = 600000 +Boxee.SubscriptionsListUrl = http://virgola.boxee.tv/api/get_subscriptions +Boxee.DoSubscribeUrl = http://virgola.boxee.tv/api/subscribe +Boxee.DoUnsubscribeUrl = http://virgola.boxee.tv/api/unsubscribe + +# Sources request parameters +SourcesListFreqInMs = 600000 +Boxee.SourcesListUrl = http://virgola.boxee.tv/titles/sources + +# Excluded Sources request parameters +ExcludedSourcesFreqInMs = 600000 +Boxee.ExcludedSourcesUrl = http://virgola.boxee.tv/api/excluded_sources + +# WebFavorites parameteres +Boxee.AddWebFavoritesUrl = http://virgola.boxee.tv/api/bookmarkpost +Boxee.RemoveWebFavoriteUrl = http://virgola.boxee.tv/api/bookmarkremove + +# Entitlements request parameters +Boxee.EntitlementsListUrl = http://virgola.boxee.tv/api/getentitlements + +# Services request parameters +Boxee.ServicesListFreqInMs = 600000 +Boxee.ServicesListUrl = http://virgola.boxee.tv/api/get_services + +# Featured request parameters +Boxee.FeaturedListFreqInMs = 30000 +Boxee.FeaturedListUrl = http://virgola.boxee.tv/api/get_featured + +# AppBox request parameters +Boxee.AppBoxApplicationsListFreqInMs = 600000 +Boxee.AppBoxApplicationsPrefixUrl = http://virgola.boxee.tv/appindex +Boxee.AppBoxPopularitiesListFreqInMs = 600000 +Boxee.AppBoxPopularitiesUrl = http://virgola.boxee.tv/applications/popularity +Boxee.AppBoxRepositoriesListFreqInMs = 600000 +Boxee.AppBoxRepositoriesUrl = http://virgola.boxee.tv/api/get_repositories + +#Autocomplete request parameters +Boxee.Autocomplete = http://virgola.boxee.tv + +#Manual Resolve Request Parameters +Boxee.ManualResolve = http://virgola.boxee.tv + +#Url for artist thumbnail +Boxee.ArtistThumb = http://virgola.boxee.tv + +#For create new user +Boxee.Username.Suggestions = http://virgola.boxee.tv/api/checkid?userid= +Boxee.Create.User = https://virgola.boxee.tv/api/register +Boxee.Term.Of.Use = http://virgola.boxee.tv/api/getlegal?page=tou +Boxee.Privacy.Policy = http://virgola.boxee.tv/api/getlegal?page=privacy +Boxee.Update.User.Details = http://virgola.boxee.tv/accountapi/updatedetails + +Boxee.ReportInstallRssUrl = http://virgola.boxee.tv/rss/subscribe_multi + +Boxee.TrailerUrl = http://virgola.boxee.tv/service/trailer +Boxee.OsHashUrl = http://virgola.boxee.tv/service/gibh + +#Boxee.AddFriendUrl = http://tsella.homeip.net/add_friend.php +Boxee.AddFriendUrl = file://./dummy_add_friend.xml +Boxee.SetUserActionUrl = http://virgola.boxee.tv/action/add +Boxee.ProfileUrl = http://virgola.boxee.tv/profile +Boxee.PollFreq = 60 + +#For empty WatchLater screen +Boxee.WatchLater.GetStarted = https://virgola.boxee.tv/accountapi/tellmeabout/?about=watchlater + +WatchDog.CheckInternetConnectionLowInMs = 5000 +WatchDog.CheckInternetConnectionHiInMs = 1000 +WatchDog.PingFreqInMs = 240000 +WatchDog.TestSourcesFreqInMs = 60000 +WatchDog.ProcessSlowFreqInMs = 60000 +WatchDog.ChkupdFreqInMs = 60000 +WatchDog.ChkupdFreqOfflineInMs = 60000 +WatchDog.TestNetUrl = http://virgola.boxee.tv +WatchDog.TestServerUrl = http://virgola.boxee.tv/ + +# Scanner thread interval in milliseconds +Boxee.FileScanner.Scan.Interval = 120000 +Boxee.FileScanner.Delay.Start = 60000 +Boxee.MetadataEngine.Scan.Interval = 30000 +Boxee.MetadataEngine.Resolver.Interval = 100 +Boxee.MetadataEngine.Enabled = 1 +Boxee.UseBoxeeDB = 1 +Boxee.ResetMetadata = 0 +Boxee.FileScanner.ExtendedLog = 0 +Boxee.Resolver.UseHash = 1 + +# Minimum video file size (in MB) for library recognition +Boxee.Video.Threshold = 150 + diff --git a/canmore/3rd_party/avahi/compile.sh b/canmore/3rd_party/avahi/compile.sh new file mode 100755 index 00000000..75bc2145 --- /dev/null +++ b/canmore/3rd_party/avahi/compile.sh @@ -0,0 +1,41 @@ +#!/bin/bash +source ../common.sh +pushd avahi-0.6.28 +./configure \ + --prefix=/opt/local \ + --enable-shared \ + --enable-static \ + --disable-glib \ + --disable-gobject \ + --disable-qt3 \ + --disable-qt4 \ + --disable-gtk \ + --disable-gtk3 \ + --with-xml=expat \ + --disable-dbm \ + --enable-gdbm \ + --enable-libdaemon \ + --disable-python \ + --disable-pygtk \ + --disable-python-dbus \ + --disable-mono \ + --disable-monodoc \ + --disable-doxygen-doc \ + --disable-doxygen-dot \ + --disable-doxygen-man \ + --disable-doxygen-rtf \ + --disable-doxygen-xml \ + --disable-doxygen-chm \ + --disable-doxygen-chi \ + --disable-doxygen-html \ + --disable-doxygen-ps \ + --disable-doxygen-pdf \ + --disable-xmltoman \ + --with-distro=none \ + --with-avahi-user=nobody \ + --with-avahi-group=nobody \ + --with-autoipd-user=nobody \ + --with-autoipd-group=nobody +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/bluez/compile.sh b/canmore/3rd_party/bluez/compile.sh new file mode 100755 index 00000000..af8ec506 --- /dev/null +++ b/canmore/3rd_party/bluez/compile.sh @@ -0,0 +1,11 @@ +#!/bin/bash +source ../common.sh +pushd bluez-4.87 +ALSA_CFLAGS=-I/opt/canmore/IntelCE/usr/include \ +ALSA_LIBS="-L/opt/canmore/IntelCE/usr/lib" \ +USB_CFLAGS=-I/opt/canmore/local/include \ +USB_LIBS="-L/opt/canmore/local/lib -lusb" \ +./configure --host=${HOST} --prefix=/opt/local +#make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/bluray/compile.sh b/canmore/3rd_party/bluray/compile.sh new file mode 100755 index 00000000..88dde6e9 --- /dev/null +++ b/canmore/3rd_party/bluray/compile.sh @@ -0,0 +1,8 @@ +#!/bin/bash +source ../common.sh +pushd libbluray +./bootstrap +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/bzip2/Makefile.patch b/canmore/3rd_party/bzip2/Makefile.patch new file mode 100644 index 00000000..d4773e83 --- /dev/null +++ b/canmore/3rd_party/bzip2/Makefile.patch @@ -0,0 +1,34 @@ +--- Makefile 2008-02-14 14:39:18.000000000 +0200 ++++ ../Makefile 2009-08-30 15:59:16.000000000 +0300 +@@ -15,16 +15,16 @@ + SHELL=/bin/sh + + # To assist in cross-compiling +-CC=gcc +-AR=ar +-RANLIB=ranlib +-LDFLAGS= ++#CC=gcc ++#AR=ar ++#RANLIB=ranlib ++#LDFLAGS= + + BIGFILES=-D_FILE_OFFSET_BITS=64 +-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES) ++CFLAGS=-Wall -Winline -O2 -g $(BIGFILES) -I/opt/canmore/local/include -I/opt/canmore/IntelCE/include + + # Where you want it installed when you do 'make install' +-PREFIX=/usr/local ++PREFIX=/opt/canmore/local + + + OBJS= blocksort.o \ +@@ -35,7 +35,7 @@ + decompress.o \ + bzlib.o + +-all: libbz2.a bzip2 bzip2recover test ++all: libbz2.a bzip2 bzip2recover + + bzip2: libbz2.a bzip2.o + $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2 diff --git a/canmore/3rd_party/bzip2/compile.sh b/canmore/3rd_party/bzip2/compile.sh new file mode 100644 index 00000000..8cf29b1a --- /dev/null +++ b/canmore/3rd_party/bzip2/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd bzip2-1.0.6 +patch -p1 < ../Makefile.patch +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/c-ares/compile.sh b/canmore/3rd_party/c-ares/compile.sh new file mode 100755 index 00000000..be8ac419 --- /dev/null +++ b/canmore/3rd_party/c-ares/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd c-ares-1.7.4 +./configure --host=${HOST} --prefix=${PREFIX} +#make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/common.sh b/canmore/3rd_party/common.sh new file mode 100644 index 00000000..b0a703ce --- /dev/null +++ b/canmore/3rd_party/common.sh @@ -0,0 +1,21 @@ +export CFLAGS="-I/opt/canmore/local/include -I/opt/canmore/IntelCE/include -I/opt/canmore/IntelCE/usr/include -I/opt/canmore/IntelCE/usr/local/include" +export CXXFLAGS="$CFLAGS" +export CPPFLAGS="$CFLAGS" +export LIBS="-L/opt/canmore/local/lib -L/opt/canmore/IntelCE/lib -L/opt/canmore/IntelCE/usr/lib" +export LDFLAGS="-L/opt/canmore/local/lib -L/opt/canmore/IntelCE/lib -L/opt/canmore/IntelCE/usr/lib" +export CROSSBIN=/opt/canmore/toolchains/i686-cm-linux- +export CC=${CROSSBIN}gcc +export CXX=${CROSSBIN}g++ +export LD=${CROSSBIN}ld +export AR=${CROSSBIN}ar +export RANLIB=${CROSSBIN}ranlib +export STRIP=${CROSSBIN}strip +export OBJDUMP=${CROSSBIN}objdump +export PREFIX=/opt/canmore/local +export HOST=i686-cm-linux +export BUILD=i686-linux +export CXXCPP="$CXX -E" +export PKG_CONFIG_LIBDIR=/opt/canmore/local/lib/pkgconfig +export TARGETFS=/opt/canmore/targetfs +#export X11_INCLUDES=/opt/camore/usr/include +#export X11_LIBS=/opt/canmore/usr/lib diff --git a/canmore/3rd_party/compcache/Makefile b/canmore/3rd_party/compcache/Makefile new file mode 100644 index 00000000..0dec74de --- /dev/null +++ b/canmore/3rd_party/compcache/Makefile @@ -0,0 +1,20 @@ +KERNEL_BUILD_PATH ?= "/opt/canmore/IntelCE/kernel/linux-2.6.28" + +XVM = sub-projects/allocators/xvmalloc-kmod +EXTRA_CFLAGS := -DCONFIG_RAMZSWAP_STATS \ + -Wall + +obj-m += ramzswap.o +ramzswap-objs := ramzswap_drv.o $(XVM)/xvmalloc.o + +all: + make -C $(KERNEL_BUILD_PATH) M=$(PWD) modules + make -C sub-projects/rzscontrol + +doc: + make -C sub-projects/rzscontrol doc + +clean: + make -C $(KERNEL_BUILD_PATH) M=$(PWD) clean + make -C sub-projects/rzscontrol clean + @rm -rf *.ko diff --git a/canmore/3rd_party/compcache/compile.sh b/canmore/3rd_party/compcache/compile.sh new file mode 100755 index 00000000..1d54ea15 --- /dev/null +++ b/canmore/3rd_party/compcache/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd compcache-0.6.2 +KERNEL_BUILD_PATH=/home/yuvalt/IntelCE-18.226902/project_build_i686/IntelCE/kernel-18.3.10471.226317/linux-2.6.35 make -j6 +sudo cp ramzswap.ko /opt/canmore/local/lib/modules/2.6.35 +sudo cp sub-projects/rzscontrol/rzscontrol /opt/canmore/local/sbin +popd diff --git a/canmore/3rd_party/compile.sh b/canmore/3rd_party/compile.sh new file mode 100644 index 00000000..982fc25d --- /dev/null +++ b/canmore/3rd_party/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libmms-0.4 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/curl/compile.sh b/canmore/3rd_party/curl/compile.sh new file mode 100644 index 00000000..a843ddd7 --- /dev/null +++ b/canmore/3rd_party/curl/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd curl-7.21.3 +./configure --disable-debug --disable-ldap -disable-ldaps --disable-ipv6 --host=${HOST} --prefix=${PREFIX} --enable-ares=/opt/canmore/local --with-ca-bundle=/opt/local/share/curl/ca-bundle.crt +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/dbus/compile.sh b/canmore/3rd_party/dbus/compile.sh new file mode 100755 index 00000000..0d516f5a --- /dev/null +++ b/canmore/3rd_party/dbus/compile.sh @@ -0,0 +1,20 @@ +#!/bin/bash +source ../common.sh +pushd dbus-1.4.1 +./configure \ + --prefix=/opt/local \ + --disable-ansi \ + --disable-asserts \ + --disable-console-owner-file \ + --disable-doxygen-docs \ + --disable-gcov \ + --disable-selinux \ + --disable-tests \ + --disable-verbose-mode \ + --disable-xml-docs \ + --with-xml="expat" \ + --with-dbus-user=root \ + --without-x +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/exfat/compile.sh b/canmore/3rd_party/exfat/compile.sh new file mode 100755 index 00000000..692c0305 --- /dev/null +++ b/canmore/3rd_party/exfat/compile.sh @@ -0,0 +1,5 @@ +#!/bin/bash +source ../common.sh +pushd fuse-exfat-0.9.3 +DESTDIR=/opt/canmore/local/sbin scons CC=$CC CFLAGS="-I/opt/canmore/local/include -Wall -O2 -ggdb" LINKFLAGS="-L/opt/canmore/local/lib -liconv" install +popd diff --git a/canmore/3rd_party/faad/compile.sh b/canmore/3rd_party/faad/compile.sh new file mode 100644 index 00000000..a31af437 --- /dev/null +++ b/canmore/3rd_party/faad/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd faad2-2.7 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/ffmpeg/compile.sh b/canmore/3rd_party/ffmpeg/compile.sh new file mode 100644 index 00000000..b584bc83 --- /dev/null +++ b/canmore/3rd_party/ffmpeg/compile.sh @@ -0,0 +1,25 @@ +#!/bin/bash +source ../common.sh +pushd ffmpeg-export-2010-03-02 +./configure \ + --extra-cflags="" \ + --target-os=linux \ + --arch=i686 \ + --cpu=i686 \ + --cross-prefix=i686-cm-linux- \ + --disable-muxers \ + --disable-encoders \ + --disable-decoder=mpeg_xvmc \ + --disable-devices \ + --disable-ffplay \ + --disable-ffserver \ + --disable-ffmpeg \ + --enable-shared \ + --disable-postproc \ + --enable-gpl \ + --enable-pthreads \ + --enable-libfaad \ + --prefix=/opt/canmore/local +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/flac/compile.sh b/canmore/3rd_party/flac/compile.sh new file mode 100644 index 00000000..265e2d41 --- /dev/null +++ b/canmore/3rd_party/flac/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd flac-1.2.1 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/fontconfig/compile.sh b/canmore/3rd_party/fontconfig/compile.sh new file mode 100755 index 00000000..b2901dd0 --- /dev/null +++ b/canmore/3rd_party/fontconfig/compile.sh @@ -0,0 +1,9 @@ +#!/bin/bash +source ../common.sh +pushd fontconfig-2.7.3 +./configure --build=${BUILD} --host=${HOST} --prefix=${PREFIX} --disable-docs --without-add-fonts --with-arch=i686 --with-cache-dir=/opt/local/var/cache/fontconfig --with-confdir=/opt/local/etc/fonts + +# remove CFLAGS from fc-case fc-lang fc-glyphname fc-arch doc +#make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/freetype/compile.sh b/canmore/3rd_party/freetype/compile.sh new file mode 100755 index 00000000..49ac993b --- /dev/null +++ b/canmore/3rd_party/freetype/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd freetype-2.4.4 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/fribidi/compile.sh b/canmore/3rd_party/fribidi/compile.sh new file mode 100644 index 00000000..754b563f --- /dev/null +++ b/canmore/3rd_party/fribidi/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd fribidi-0.19.2 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/fuse/compile.sh b/canmore/3rd_party/fuse/compile.sh new file mode 100755 index 00000000..8ca54d7c --- /dev/null +++ b/canmore/3rd_party/fuse/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd fuse-2.8.5 +./configure --host=${HOST} --prefix=${PREFIX} +#make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/gdbm3/compile.sh b/canmore/3rd_party/gdbm3/compile.sh new file mode 100755 index 00000000..c546f16f --- /dev/null +++ b/canmore/3rd_party/gdbm3/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd gdbm-1.8.3 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/glib/compile.sh b/canmore/3rd_party/glib/compile.sh new file mode 100644 index 00000000..ed75efd0 --- /dev/null +++ b/canmore/3rd_party/glib/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd glib-2.26.1 +ac_cv_func_posix_getgrgid_r=yes ac_cv_func_nonposix_getpwuid_r=no ac_cv_func_posix_getpwuid_r=yes glib_cv_uscore=no glib_cv_stack_grows=no ./configure --host=${HOST} --prefix=${PREFIX} --with-libiconv=gnu +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/gnupg/compile.sh b/canmore/3rd_party/gnupg/compile.sh new file mode 100755 index 00000000..09c6b323 --- /dev/null +++ b/canmore/3rd_party/gnupg/compile.sh @@ -0,0 +1,14 @@ +#!/bin/bash +source ../common.sh +#pushd gnupg-1.4.9 +pushd gnupg-2.0.15 +./configure --host=${HOST} --prefix=${PREFIX} \ + --with-gpg-error-prefix=${PREFIX} \ + --with-libgcrypt-prefix=${PREFIX} \ + --with-ksba-prefix=${PREFIX} \ + --with-pth-prefix=${PREFIX} \ + --with-libassuan-prefix=${PREFIX} + +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/gpgme/compile.sh b/canmore/3rd_party/gpgme/compile.sh new file mode 100755 index 00000000..216babd7 --- /dev/null +++ b/canmore/3rd_party/gpgme/compile.sh @@ -0,0 +1,15 @@ +#!/bin/bash +source ../common.sh +pushd gpgme-1.3.0 +./configure --host=${HOST} --prefix=${PREFIX} \ + --with-pth=${PREFIX} \ + --with-gpg-error-prefix=${PREFIX} \ + --with-libassuan-prefix=${PREFIX} \ + --with-gpg=${PREFIX}/bin/gpg2 \ + --with-gpgsm=${PREFIX}/bin/gpgsm \ + --with-gpgconf=${PREFIX}/bin/gpgconf \ + --with-g13=${PREFIX}/bin/g13 + +#make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/harfbuzz/compile.sh b/canmore/3rd_party/harfbuzz/compile.sh new file mode 100755 index 00000000..7db8f027 --- /dev/null +++ b/canmore/3rd_party/harfbuzz/compile.sh @@ -0,0 +1,8 @@ +#!/bin/bash +source ../common.sh +pushd harfbuzz.git +#./autogen.sh +FREETYPE_CFLAGS="-I/opt/canmore/local/include/freetype2" FREETYPE_LIBS="-L/opt/canmore/local/lib -lfreetype" ac_cv_prog_have_icu=false GLIB_CFLAGS="-I/opt/canmore/local/lib/glib-2.0/include -I/opt/canmore/local/include/glib-2.0 -I/opt/canmore/local/include/glib-2.0/include" GLIB_LIBS="-L/opt/canmore/local/lib -lglib-2.0" PKG_CONFIG="" ./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/iconv/compile.sh b/canmore/3rd_party/iconv/compile.sh new file mode 100644 index 00000000..a89b67e6 --- /dev/null +++ b/canmore/3rd_party/iconv/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libiconv-1.13.1 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/iwtools/Makefile.diff b/canmore/3rd_party/iwtools/Makefile.diff new file mode 100644 index 00000000..403cb3e2 --- /dev/null +++ b/canmore/3rd_party/iwtools/Makefile.diff @@ -0,0 +1,21 @@ +--- Makefile.orig 2011-02-10 17:33:53.299236006 +0200 ++++ Makefile 2011-02-10 17:34:18.751236000 +0200 +@@ -5,14 +5,14 @@ + ## Installation directory. By default, go in /usr/local. + ## Distributions should probably use /, but they probably know better... + ifndef PREFIX +- PREFIX = /usr/local ++ PREFIX = /opt/canmore/local + endif + + ## Compiler to use (modify this for cross compile). +-CC = gcc ++CC = i686-cm-linux-gcc + ## Other tools you need to modify for cross compile (static lib only). +-AR = ar +-RANLIB = ranlib ++AR = i686-cm-linux-ar ++RANLIB = i686-cm-linux-ranlib + + ## Uncomment this to build tools using static version of the library. + ## Mostly useful for embedded platforms without ldd, or to create diff --git a/canmore/3rd_party/jasper/compile.sh b/canmore/3rd_party/jasper/compile.sh new file mode 100644 index 00000000..3e878972 --- /dev/null +++ b/canmore/3rd_party/jasper/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd jasper-1.900.1 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/jpeg/compile.sh b/canmore/3rd_party/jpeg/compile.sh new file mode 100644 index 00000000..bdb685de --- /dev/null +++ b/canmore/3rd_party/jpeg/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd jpeg-8b +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/jsoncpp/compile.sh b/canmore/3rd_party/jsoncpp/compile.sh new file mode 100755 index 00000000..e406f49c --- /dev/null +++ b/canmore/3rd_party/jsoncpp/compile.sh @@ -0,0 +1,14 @@ +#!/bin/bash -x +source ../common.sh +pushd jsoncpp-src-0.5.0 +mkdir out +$CXX -O2 -o out/json_reader.o -c -Wall -Iinclude src/lib_json/json_reader.cpp +$CXX -O2 -o out/json_writer.o -c -Wall -Iinclude src/lib_json/json_writer.cpp +$CXX -O2 -o out/json_value.o -c -Wall -Iinclude src/lib_json/json_value.cpp +cd out +$CXX -shared -o libjsoncpp.so json_reader.o json_writer.o json_value.o +$AR cru libjsoncpp.a json_reader.o json_writer.o json_value.o +sudo cp libjsoncpp.so libjsoncpp.a /opt/canmore/local/lib +cd ../include +sudo cp -R json /opt/canmore/local/include +popd diff --git a/canmore/3rd_party/libassuan/compile.sh b/canmore/3rd_party/libassuan/compile.sh new file mode 100755 index 00000000..7f516a75 --- /dev/null +++ b/canmore/3rd_party/libassuan/compile.sh @@ -0,0 +1,9 @@ +#!/bin/bash +source ../common.sh +pushd libassuan-2.0.0 +#pushd libassuan-1.0.4 +./configure --host=${HOST} --prefix=${PREFIX} +#--with-pth-prefix=${PREFIX} +#make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/libdaemon/compile.sh b/canmore/3rd_party/libdaemon/compile.sh new file mode 100755 index 00000000..724f364e --- /dev/null +++ b/canmore/3rd_party/libdaemon/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libdaemon-0.14 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/libgcrypt/compile.sh b/canmore/3rd_party/libgcrypt/compile.sh new file mode 100755 index 00000000..296fb5c2 --- /dev/null +++ b/canmore/3rd_party/libgcrypt/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libgcrypt-1.4.5 +pth_config_prefix=${PREFIX} ./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/libgpg-error/compile.sh b/canmore/3rd_party/libgpg-error/compile.sh new file mode 100755 index 00000000..4135d6ab --- /dev/null +++ b/canmore/3rd_party/libgpg-error/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libgpg-error-1.7 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/libhid/compile.sh b/canmore/3rd_party/libhid/compile.sh new file mode 100755 index 00000000..4c694497 --- /dev/null +++ b/canmore/3rd_party/libhid/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libhid-0.2.16 +./configure --prefix=${PREFIX} --disable-swig +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/libksba/compile.sh b/canmore/3rd_party/libksba/compile.sh new file mode 100755 index 00000000..c5d81d3a --- /dev/null +++ b/canmore/3rd_party/libksba/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libksba-1.0.7 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/libmicrohttpd/compile.sh b/canmore/3rd_party/libmicrohttpd/compile.sh new file mode 100755 index 00000000..722b822a --- /dev/null +++ b/canmore/3rd_party/libmicrohttpd/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libmicrohttpd +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/libusb/compile.sh b/canmore/3rd_party/libusb/compile.sh new file mode 100755 index 00000000..7d60ee71 --- /dev/null +++ b/canmore/3rd_party/libusb/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libusb-1.0.8 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/libvpx/compile.sh b/canmore/3rd_party/libvpx/compile.sh new file mode 100755 index 00000000..d6b93733 --- /dev/null +++ b/canmore/3rd_party/libvpx/compile.sh @@ -0,0 +1,12 @@ +#!/bin/bash +source ../common.sh +export CFLAGS="" +export CXXFLAGS="$CFLAGS" +export CPPFLAGS="$CFLAGS" +export LD=${CROSSBIN}gcc +pushd libvpx-v0.9.5 +make clean +./configure --target=x86-linux-gcc --enable-shared --prefix=/opt/canmore/local +make -j6 +#sudo DIST_DIR=/opt/canmore/local make install +popd diff --git a/canmore/3rd_party/libxml2/compile.sh b/canmore/3rd_party/libxml2/compile.sh new file mode 100755 index 00000000..32b80553 --- /dev/null +++ b/canmore/3rd_party/libxml2/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libxml2-2.7.6 +./configure --host=${HOST} --prefix=${PREFIX} --without-python +#make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/lirc/compile.sh b/canmore/3rd_party/lirc/compile.sh new file mode 100755 index 00000000..8ebb5450 --- /dev/null +++ b/canmore/3rd_party/lirc/compile.sh @@ -0,0 +1,20 @@ +#!/bin/bash +source ../common.sh +cd lirc-0.8.7 +./configure --host=${HOST} --prefix=${PREFIX} --with-driver=mceusb --with-kerneldir=/opt/canmore/IntelCE/kernel/linux-2.6.28 --without-x +make -j6 +cd daemons +sudo make install +cd ../tools +sudo make install +cd .. +sudo mkdir -p /opt/canmore/local/lib/modules/2.6.28 +sudo cp drivers/lirc_mceusb/lirc_mceusb.ko drivers/lirc_dev/lirc_dev.ko /opt/canmore/local/lib/modules/2.6.28 +sudo cp remotes/mceusb/lircd.conf.mceusb /opt/canmore/local/etc/lircd.conf + +# on target: +# /bin/mknod /dev/lirc c 61 0 +# ln -s /opt/local/modules/2.6.28/ /lib/modules/2.6.28 +# insmod /opt/local/lib/modules/2.6.29/lirc_dev.ko +# insmod /opt/local/lib/modules/2.6.29/lirc_mceusb2.ko +# /opt/local/sbin/lircd --device=/dev/lirc0 /opt/local/etc/lircd.conf diff --git a/canmore/3rd_party/lzo2/compile.sh b/canmore/3rd_party/lzo2/compile.sh new file mode 100644 index 00000000..a036858c --- /dev/null +++ b/canmore/3rd_party/lzo2/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd lzo-2.04 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/mad/compile.sh b/canmore/3rd_party/mad/compile.sh new file mode 100644 index 00000000..c36bc842 --- /dev/null +++ b/canmore/3rd_party/mad/compile.sh @@ -0,0 +1,9 @@ +#!/bin/bash +source ../common.sh +patch -p0 < pkg_config_support.patch +pushd libmad-0.15.1b +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +#sudo cp mad.pc /opt/canmore/local/lib/pkgconfig/ +popd diff --git a/canmore/3rd_party/mad/pkg_config_support.patch b/canmore/3rd_party/mad/pkg_config_support.patch new file mode 100644 index 00000000..ef1d3729 --- /dev/null +++ b/canmore/3rd_party/mad/pkg_config_support.patch @@ -0,0 +1,52 @@ +diff -Naur libmad-0.15.1b.old/configure.ac libmad-0.15.1b/configure.ac +--- libmad-0.15.1b.old/configure.ac 2004-01-23 10:41:32.000000000 +0100 ++++ libmad-0.15.1b/configure.ac 2004-08-07 02:25:24.633462168 +0200 +@@ -429,5 +429,5 @@ + dnl AC_SUBST(LTLIBOBJS) + + AC_CONFIG_FILES([Makefile msvc++/Makefile \ +- libmad.list]) ++ libmad.list mad.pc]) + AC_OUTPUT +diff -Naur libmad-0.15.1b.old/mad.pc.in libmad-0.15.1b/mad.pc.in +--- libmad-0.15.1b.old/mad.pc.in 1970-01-01 01:00:00.000000000 +0100 ++++ libmad-0.15.1b/mad.pc.in 2004-08-07 02:04:59.617692872 +0200 +@@ -0,0 +1,14 @@ ++# libmad pkg-config source file ++ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@ ++ ++Name: mad ++Description: MPEG Audio Decoder ++Version: @VERSION@ ++Requires: ++Conflicts: ++Libs: -L${libdir} -lmad -lm ++Cflags: -I${includedir} +diff -Naur libmad-0.15.1b.old/Makefile.am libmad-0.15.1b/Makefile.am +--- libmad-0.15.1b.old/Makefile.am 2004-02-17 03:02:03.000000000 +0100 ++++ libmad-0.15.1b/Makefile.am 2004-08-07 02:03:19.859858368 +0200 +@@ -24,6 +24,9 @@ + SUBDIRS = + DIST_SUBDIRS = msvc++ + ++pkgconfigdir = $(libdir)/pkgconfig ++pkgconfig_DATA = mad.pc ++ + lib_LTLIBRARIES = libmad.la + include_HEADERS = mad.h + +@@ -34,7 +37,8 @@ + minimad_LDADD = libmad.la + + EXTRA_DIST = mad.h.sed \ +- CHANGES COPYRIGHT CREDITS README TODO VERSION ++ CHANGES COPYRIGHT CREDITS README TODO VERSION \ ++ mad.pc.in + + exported_headers = version.h fixed.h bit.h timer.h stream.h frame.h \ + synth.h decoder.h + diff --git a/canmore/3rd_party/mms/compile.sh b/canmore/3rd_party/mms/compile.sh new file mode 100755 index 00000000..9f93fc04 --- /dev/null +++ b/canmore/3rd_party/mms/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libmms-0.6 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/nfs-utils/compile.sh b/canmore/3rd_party/nfs-utils/compile.sh new file mode 100755 index 00000000..899739a9 --- /dev/null +++ b/canmore/3rd_party/nfs-utils/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd nfs-utils-1.2.3 +./configure --host=${HOST} --prefix=${PREFIX} --disable-tirpc --without-tcp-wrappers --disable-nfsv4 --disable-uuid --disable-gss +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/nss-mdns/compile.sh b/canmore/3rd_party/nss-mdns/compile.sh new file mode 100755 index 00000000..97869bf6 --- /dev/null +++ b/canmore/3rd_party/nss-mdns/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd nss-mdns-0.10 +./configure --host=${HOST} --prefix=${PREFIX} --localstatedir=/opt/local/var --sysconfdir=/opt/local/etc +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/ntfs-3g/compile.sh b/canmore/3rd_party/ntfs-3g/compile.sh new file mode 100755 index 00000000..e1c09606 --- /dev/null +++ b/canmore/3rd_party/ntfs-3g/compile.sh @@ -0,0 +1,6 @@ +#!/bin/bash +source ../common.sh +cd ntfs-3g-2011.1.15 +./configure --host=${HOST} --prefix=${PREFIX} --with-fuse=external +make -j6 +#sudo make install diff --git a/canmore/3rd_party/ntp/compile.sh b/canmore/3rd_party/ntp/compile.sh new file mode 100644 index 00000000..d2aa805e --- /dev/null +++ b/canmore/3rd_party/ntp/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd ntp-4.2.4p7 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/ogg/compile.sh b/canmore/3rd_party/ogg/compile.sh new file mode 100644 index 00000000..2a9a60c6 --- /dev/null +++ b/canmore/3rd_party/ogg/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libogg-1.2.2 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/openssl/compile.sh b/canmore/3rd_party/openssl/compile.sh new file mode 100644 index 00000000..be1e16b9 --- /dev/null +++ b/canmore/3rd_party/openssl/compile.sh @@ -0,0 +1,6 @@ +#!/bin/bash +pushd openssl-1.0.0c +AR=i686-cm-linux-ar RANLIB=i686-cm-linux-ranlib CC=i686-cm-linux-gcc ./Configure linux-generic32 shared --prefix=/opt/canmore/local +make +#sudo make install +popd diff --git a/canmore/3rd_party/pcre/compile.sh b/canmore/3rd_party/pcre/compile.sh new file mode 100644 index 00000000..4586a364 --- /dev/null +++ b/canmore/3rd_party/pcre/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd pcre-8.12 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/png/compile.sh b/canmore/3rd_party/png/compile.sh new file mode 100644 index 00000000..95a19f73 --- /dev/null +++ b/canmore/3rd_party/png/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libpng-1.4.5 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/ppp/compile.sh b/canmore/3rd_party/ppp/compile.sh new file mode 100644 index 00000000..3f2ca442 --- /dev/null +++ b/canmore/3rd_party/ppp/compile.sh @@ -0,0 +1,5 @@ +cd ppp-2.4.5 +patch -p0 < ../configure.diff +./configure --prefix=/opt/canmore/local +make CC=i686-cm-linux-gcc +# make -n install diff --git a/canmore/3rd_party/ppp/configure.diff b/canmore/3rd_party/ppp/configure.diff new file mode 100644 index 00000000..b728f964 --- /dev/null +++ b/canmore/3rd_party/ppp/configure.diff @@ -0,0 +1,11 @@ +--- configure.orig 2010-07-16 00:31:06.308341507 +0300 ++++ configure 2010-07-16 00:31:18.372341331 +0300 +@@ -2,7 +2,7 @@ + # $Id: configure,v 1.38 2008/06/15 07:08:49 paulus Exp $ + + # Where to install stuff by default +-DESTDIR=/usr/local ++DESTDIR=/opt/canmore/local + SYSCONF=/etc + + # if [ -d /NextApps ]; then diff --git a/canmore/3rd_party/pptp/Makefile.diff b/canmore/3rd_party/pptp/Makefile.diff new file mode 100644 index 00000000..0c3eb50e --- /dev/null +++ b/canmore/3rd_party/pptp/Makefile.diff @@ -0,0 +1,22 @@ +--- Makefile.orig 2010-07-16 00:21:44.883380849 +0300 ++++ Makefile 2010-07-18 20:23:08.475597665 +0300 +@@ -4,14 +4,15 @@ + + ################################################################# + # CHANGE THIS LINE to point to the location of your pppd binary. +-PPPD = /usr/sbin/pppd ++PPPD = /opt/local/sbin/pppd + ################################################################# + +-BINDIR=$(DESTDIR)/usr/sbin +-MANDIR=$(DESTDIR)/usr/share/man/man8 ++DESTDIR=/opt/canmore/local ++BINDIR=$(DESTDIR)/sbin ++MANDIR=$(DESTDIR)/share/man/man8 + PPPDIR=$(DESTDIR)/etc/ppp + +-CC = gcc ++CC = i686-cm-linux-gcc + RM = rm -f + OPTIMIZE= -O0 + DEBUG = -g diff --git a/canmore/3rd_party/pptp/compile.sh b/canmore/3rd_party/pptp/compile.sh new file mode 100755 index 00000000..9259b7e1 --- /dev/null +++ b/canmore/3rd_party/pptp/compile.sh @@ -0,0 +1,4 @@ +cd pptp-1.7.2 +patch -p0 < ../Makefile.diff +make +# make -n install diff --git a/canmore/3rd_party/pth/compile.sh b/canmore/3rd_party/pth/compile.sh new file mode 100755 index 00000000..ba3e3aab --- /dev/null +++ b/canmore/3rd_party/pth/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd pth-2.0.7 +./configure --host=${HOST} --prefix=${PREFIX} --without-python +#make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/python/Python-2.4.6-xcompile-1.patch b/canmore/3rd_party/python/Python-2.4.6-xcompile-1.patch new file mode 100644 index 00000000..a5dcd493 --- /dev/null +++ b/canmore/3rd_party/python/Python-2.4.6-xcompile-1.patch @@ -0,0 +1,76 @@ +--- Python-2.4.6/Makefile.pre.in.orig 2010-05-24 17:18:54.158140743 +0300 ++++ Python-2.4.6/Makefile.pre.in 2010-05-24 17:27:57.816639781 +0300 +@@ -166,6 +166,7 @@ + + PYTHON= python$(EXE) + BUILDPYTHON= python$(BUILDEXE) ++HOSTPYTHON= ./$(BUILDPYTHON) + + # === Definitions added by makesetup === + +@@ -193,6 +194,8 @@ + # Parser + PGEN= Parser/pgen$(EXE) + ++HOSTPGEN= $(PGEN) ++ + POBJS= \ + Parser/acceler.o \ + Parser/grammar1.o \ +@@ -324,8 +327,8 @@ + # Build the shared modules + sharedmods: $(BUILDPYTHON) + case $$MAKEFLAGS in \ +- *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ +- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ ++ *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \ ++ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ + esac + + # buildno should really depend on something like LIBRARY_SRC +@@ -455,7 +458,7 @@ + + + $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) +- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) ++ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) + + $(PGEN): $(PGENOBJS) + $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) +@@ -748,20 +751,20 @@ + done; \ + done + $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ + -x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST) +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ + -x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ ++ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ ++ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + +@@ -856,7 +859,8 @@ + # Install the dynamically loadable modules + # This goes into $(exec_prefix) + sharedinstall: +- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ ++ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' CROSS_COMPILE='$(CROSS_COMPILE)' \ ++ $(RUNSHARED) ./$(HOSTPYTHON) -E $(srcdir)/setup.py install \ + --prefix=$(prefix) \ + --install-scripts=$(BINDIR) \ + --install-platlib=$(DESTSHARED) \ diff --git a/canmore/3rd_party/python/Python-2.4.6-xcompile-2.patch b/canmore/3rd_party/python/Python-2.4.6-xcompile-2.patch new file mode 100644 index 00000000..6b22adf5 --- /dev/null +++ b/canmore/3rd_party/python/Python-2.4.6-xcompile-2.patch @@ -0,0 +1,21 @@ +--- Python-2.4.6/setup.py.orig 2010-05-24 17:28:18.192640774 +0300 ++++ Python-2.4.6/setup.py 2010-05-24 17:29:22.276889935 +0300 +@@ -15,7 +15,7 @@ + from distutils.command.install_lib import install_lib + + # This global variable is used to hold the list of modules to be disabled. +-disabled_module_list = [] ++disabled_module_list = ['_ctypes'] + + def add_dir_to_list(dirlist, dir): + """Add the directory 'dir' to the list 'dirlist' (at the front) if +@@ -199,6 +199,9 @@ + self.announce('WARNING: skipping import check for Cygwin-based "%s"' + % ext.name) + return ++ if os.environ.get('CROSS_COMPILE_TARGET') == 'yes': ++ return ++ + ext_filename = os.path.join( + self.build_lib, + self.get_ext_filename(self.get_ext_fullname(ext.name))) diff --git a/canmore/3rd_party/python/Python-2.6.5-xcompile.patch b/canmore/3rd_party/python/Python-2.6.5-xcompile.patch new file mode 100644 index 00000000..de3699f9 --- /dev/null +++ b/canmore/3rd_party/python/Python-2.6.5-xcompile.patch @@ -0,0 +1,301 @@ +diff -uN Python-2.6.2/configure Python-2.6.2POld/configure +--- Python-2.6.2/configure 2009-03-31 03:56:14.000000000 +1000 + +@@ -24326,14 +24326,14 @@ + + { echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 + echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; } +-if test "$cross_compiling" = yes; then +- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } +-else +- cat >conftest.$ac_ext <<_ACEOF ++#if test "$cross_compiling" = yes; then ++# { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling ++#See \`config.log' for more details." >&5 ++#echo "$as_me: error: cannot run test program while cross compiling ++#See \`config.log' for more details." >&2;} ++# { (exit 1); exit 1; }; } ++#else ++cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -24411,7 +24411,7 @@ + echo "${ECHO_T}no" >&6; } + fi + rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi ++#fi + + + +diff -uN Python-2.6.2/configure.in Python-2.6.2POld/configure.in +--- Python-2.6.2/configure.in 2009-03-31 03:56:14.000000000 +1000 ++++ Python-2.6.2POld/configure.in 2009-08-17 12:19:15.000000000 +1000 +@@ -3656,48 +3656,48 @@ + AC_MSG_RESULT(no) + fi + +-AC_MSG_CHECKING(for %zd printf() format support) +-AC_TRY_RUN([#include +-#include +-#include +- +-#ifdef HAVE_SYS_TYPES_H +-#include +-#endif +- +-#ifdef HAVE_SSIZE_T +-typedef ssize_t Py_ssize_t; +-#elif SIZEOF_VOID_P == SIZEOF_LONG +-typedef long Py_ssize_t; +-#else +-typedef int Py_ssize_t; +-#endif +- +-int main() +-{ +- char buffer[256]; +- +- if(sprintf(buffer, "%zd", (size_t)123) < 0) +- return 1; +- +- if (strcmp(buffer, "123")) +- return 1; +- +- if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0) +- return 1; +- +- if (strcmp(buffer, "-123")) +- return 1; +- +- return 0; +-}], +-[AC_MSG_RESULT(yes) +- AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])], +- AC_MSG_RESULT(no)) ++#AC_MSG_CHECKING(for %zd printf() format support) ++#AC_TRY_RUN([#include ++##include ++##include ++ ++##ifdef HAVE_SYS_TYPES_H ++##include ++##endif ++ ++##ifdef HAVE_SSIZE_T ++#typedef ssize_t Py_ssize_t; ++##elif SIZEOF_VOID_P == SIZEOF_LONG ++#typedef long Py_ssize_t; ++##else ++#typedef int Py_ssize_t; ++##endif ++# ++#int main() ++#{ ++# char buffer[256]; ++# ++# if(sprintf(buffer, "%zd", (size_t)123) < 0) ++# return 1;# ++# ++# if (strcmp(buffer, "123")) ++# return 1; ++# ++# if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0) ++# return 1; ++# ++# if (strcmp(buffer, "-123")) ++# return 1; ++# ++# return 0; ++#}], ++#[AC_MSG_RESULT(yes) ++# AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])], ++# AC_MSG_RESULT(no)) + + AC_CHECK_TYPE(socklen_t,, + AC_DEFINE(socklen_t,int, +- Define to `int' if does not define.),[ ++ Define to 'int' if does not define.),[ + #ifdef HAVE_SYS_TYPES_H + #include + #endif +diff -uN Python-2.6.2/Makefile.pre.in Python-2.6.2POld/Makefile.pre.in +--- Python-2.6.2/Makefile.pre.in 2009-02-24 21:07:44.000000000 +1000 ++++ Python-2.6.2POld/Makefile.pre.in 2009-08-17 12:19:15.000000000 +1000 +@@ -175,6 +175,7 @@ + + PYTHON= python$(EXE) + BUILDPYTHON= python$(BUILDEXE) ++HOSTPYTHON= ./$(BUILDPYTHON) + + # The task to run while instrument when building the profile-opt target + PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck +@@ -206,6 +207,8 @@ + # Parser + PGEN= Parser/pgen$(EXE) + ++HOSTPGEN= $(PGEN) ++ + POBJS= \ + Parser/acceler.o \ + Parser/grammar1.o \ +@@ -394,8 +397,8 @@ + # Build the shared modules + sharedmods: $(BUILDPYTHON) + @case $$MAKEFLAGS in \ +- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ +- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ ++ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \ ++ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ + esac + + # Build static library +@@ -517,7 +520,7 @@ + + $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) + -@$(INSTALL) -d Include +- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) ++ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) + + $(PGEN): $(PGENOBJS) + $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) +@@ -886,24 +889,24 @@ + done; \ + done + $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST) +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ ++ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ + -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ ++ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ ++ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" ++ $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" + + # Create the PLATDIR source directory, if one wasn't distributed.. + $(srcdir)/Lib/$(PLATDIR): +@@ -1001,7 +1004,8 @@ + # Install the dynamically loadable modules + # This goes into $(exec_prefix) + sharedinstall: +- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ ++ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' CROSS_COMPILE='$(CROSS_COMPILE)' \ ++ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \ + --prefix=$(prefix) \ + --install-scripts=$(BINDIR) \ + --install-platlib=$(DESTSHARED) \ +diff -uN Python-2.6.2/setup.py Python-2.6.2POld/setup.py +--- Python-2.6.2/setup.py 2009-04-01 04:20:48.000000000 +1000 ++++ Python-2.6.2POld/setup.py 2009-08-17 12:19:15.000000000 +1000 +@@ -17,7 +17,7 @@ + from distutils.command.install_lib import install_lib + + # This global variable is used to hold the list of modules to be disabled. +-disabled_module_list = [] ++disabled_module_list = ['_ctypes'] + + def add_dir_to_list(dirlist, dir): + """Add the directory 'dir' to the list 'dirlist' (at the front) if +@@ -267,33 +267,40 @@ + self.announce('WARNING: skipping import check for Cygwin-based "%s"' + % ext.name) + return ++ if os.environ.get('CROSS_COMPILE_TARGET') == 'yes': ++ return ++ + ext_filename = os.path.join( + self.build_lib, + self.get_ext_filename(self.get_ext_fullname(ext.name))) + try: + imp.load_dynamic(ext.name, ext_filename) + except ImportError, why: +- self.failed.append(ext.name) +- self.announce('*** WARNING: renaming "%s" since importing it' +- ' failed: %s' % (ext.name, why), level=3) +- assert not self.inplace +- basename, tail = os.path.splitext(ext_filename) +- newname = basename + "_failed" + tail +- if os.path.exists(newname): +- os.remove(newname) +- os.rename(ext_filename, newname) +- +- # XXX -- This relies on a Vile HACK in +- # distutils.command.build_ext.build_extension(). The +- # _built_objects attribute is stored there strictly for +- # use here. +- # If there is a failure, _built_objects may not be there, +- # so catch the AttributeError and move on. +- try: +- for filename in self._built_objects: +- os.remove(filename) +- except AttributeError: +- self.announce('unable to remove files (ignored)') ++ if os.environ.get('CROSS_COMPILE_TARGET') != "yes": ++ self.announce('*** WARNING: renaming "%s" since importing it' ++ ' failed: %s' % (ext.name, why), level=3) ++ assert not self.inplace ++ basename, tail = os.path.splitext(ext_filename) ++ newname = basename + "_failed" + tail ++ if os.path.exists(newname): ++ os.remove(newname) ++ os.rename(ext_filename, newname) ++ ++ # XXX -- This relies on a Vile HACK in ++ # distutils.command.build_ext.build_extension(). The ++ # _built_objects attribute is stored there strictly for ++ # use here. ++ # If there is a failure, _built_objects may not be there, ++ # so catch the AttributeError and move on. ++ try: ++ for filename in self._built_objects: ++ os.remove(filename) ++ except AttributeError: ++ self.announce('unable to remove files (ignored)') ++ else: ++ self.announce('WARNING: "%s" failed importing, but we leave it ' ++ 'because we are cross-compiling' % ++ ext.name) + except: + exc_type, why, tb = sys.exc_info() + self.announce('*** WARNING: importing extension "%s" ' +@@ -665,7 +672,7 @@ + + if (ssl_incs is not None and + ssl_libs is not None and +- openssl_ver >= 0x00907000): ++ openssl_ver >= 0x00907000 and False): + # The _hashlib module wraps optimized implementations + # of hash functions from the OpenSSL library. + exts.append( Extension('_hashlib', ['_hashopenssl.c'], +@@ -685,7 +692,7 @@ + depends = ['md5.h']) ) + missing.append('_hashlib') + +- if (openssl_ver < 0x00908000): ++ if (True or openssl_ver < 0x00908000): + # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash + exts.append( Extension('_sha256', ['sha256module.c']) ) + exts.append( Extension('_sha512', ['sha512module.c']) ) + diff --git a/canmore/3rd_party/python/compile-2.6.5.sh b/canmore/3rd_party/python/compile-2.6.5.sh new file mode 100755 index 00000000..442b4a1c --- /dev/null +++ b/canmore/3rd_party/python/compile-2.6.5.sh @@ -0,0 +1,23 @@ +#!/bin/bash +source ../common.sh + +# look at http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html +# wget http://randomsplat.com/wp-content/uploads/2010/04/Python-2.6.5-xcompile.patch +cd Python-2.6.5 +patch -p1 < ../Python-2.6.5-xcompile.patch +./configure +python Parser/pgen +mv python hostpython +mv Parser/pgen Parser/hostpgen +make distclean + +CFLAGS='-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64' OPT="-O3 -Wall -I/opt/canmore/IntelCE/include $CFLAGS" CC=i686-cm-linux-gcc CXX=i686-cm-linux-g++ AR=i686-cm-linux-ar RANLIB=i686-cm-linux-ranlib ./configure --host=i686-cm-linux --build=i686-pc-linux-gnu --prefix=/opt/canmore/local/ + +make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="i686-cm-linux-gcc -shared -L/opt/canmore/IntelCE/lib" CROSS_COMPILE="i686-cm-linux-" CROSS_COMPILE_TARGET=yes + +make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="i686-cm-linux-gcc -shared -L/opt/canmore/IntelCE/lib" CROSS_COMPILE="i686-cm-linux-" CROSS_COMPILE_TARGET=yes libpython2.6.so + +sudo PATH=$PATH:/opt/canmore/toolchains make -n install HOSTPYTHON=./hostpython BLDSHARED="i686-cm-linux-gcc -shared -L/opt/canmore/IntelCE/lib" CROSS_COMPILE="i686-cm-linux-" CROSS_COMPILE_TARGET=yes prefix=/opt/canmore/local + +sudo cp libpython2.6.so /opt/canmore/local/lib +sudo chmod 755 /opt/canmore/local/lib/libpython2.6.so diff --git a/canmore/3rd_party/python/compile.sh b/canmore/3rd_party/python/compile.sh new file mode 100755 index 00000000..91123bbc --- /dev/null +++ b/canmore/3rd_party/python/compile.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +cd Python-2.4.6 +./configure +make python Parser/pgen +mv python hostpython +mv Parser/pgen Parser/hostpgen +make distclean + +ac_cv_lib_util_openpty=no ac_cv_func_openpty=no ac_cv_func_forkpty=no ac_cv_lib_util_forkpty=no OPT='-fno-strict-aliasing -g -Wall -I/opt/canmore/IntelCE/include -I/opt/canmore/IntelCE/include/ncurses ' CC=i686-cm-linux-gcc CXX=i686-cm-linux-g++ AR=i686-cm-linux-ar RANLIB=i686-cm-linux-ranlib ./configure --host=i686-cm-linux --build=i686-pc-linux-gnu --prefix=/opt/canmore/local/ --enable-unicode=ucs4 + +make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="i686-cm-linux-gcc -shared -L/opt/canmore/IntelCE/lib" CROSS_COMPILE="i686-cm-linux-" CROSS_COMPILE_TARGET=yes + +#make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="i686-cm-linux-gcc -shared -L/opt/canmore/IntelCE/lib" CROSS_COMPILE="i686-cm-linux-" CROSS_COMPILE_TARGET=yes libpython2.4.so + +sudo PATH=$PATH:/opt/canmore/toolchains make install HOSTPYTHON=./hostpython BLDSHARED="i686-cm-linux-gcc -shared -L/opt/canmore/IntelCE/lib" CROSS_COMPILE="i686-cm-linux-" CROSS_COMPILE_TARGET=yes prefix=/opt/canmore/local + +sudo cp libpython2.4.a /opt/canmore/local/lib +#sudo cp libpython2.4.so /opt/canmore/local/lib +#sudo chmod 755 /opt/canmore/local/lib/libpython2.4.so diff --git a/canmore/3rd_party/qt/README b/canmore/3rd_party/qt/README new file mode 100644 index 00000000..3dc3a04b --- /dev/null +++ b/canmore/3rd_party/qt/README @@ -0,0 +1,7 @@ +1. in ./src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp + + comment out all DOUBLE so it will not do double buffering + +2. in ./src/gui/embedded/directfb.pri + + uncomment DEFINES += QT_NO_DIRECTFB_WM diff --git a/canmore/3rd_party/qt/compile.sh b/canmore/3rd_party/qt/compile.sh new file mode 100644 index 00000000..47dd91c9 --- /dev/null +++ b/canmore/3rd_party/qt/compile.sh @@ -0,0 +1,10 @@ +# copy linux-x86-intelce-linux under qt-everywhere*/mkspecs/qws + +pushd qt-everywhere* +PKG_CONFIG_PATH=/opt/canmore/local/lib/pkgconfig:/opt/canmore/IntelCE/usr/local/lib/pkgconfig ./configure -embedded x86 -xplatform qws/linux-x86-intelce-g++ -force-pkg-config -opengl yes -openvg yes -plugin-gfx-directfb -qt-kbd-linuxinput -qt-mouse-linuxinput -no-gfx-linuxfb -no-gfx-multiscreen -no-kbd-tty -no-mouse-pc -no-mouse-linuxtp -no-mouse-pc -system-sqlite -no-libmng -no-webkit -no-svg -prefix /opt/local/qt -no-javascript-jit -opensource -confirm-license +# make install +cd tools/designer/src/uitools +make +# sudo make install +# cd /opt/local +# sudo tar cf - qt | ( cd /opt/canmore/local; sudo tar xvfp - ) diff --git a/canmore/3rd_party/qt/linux-x86-intelce-g++/qmake.conf b/canmore/3rd_party/qt/linux-x86-intelce-g++/qmake.conf new file mode 100644 index 00000000..c65f6e1c --- /dev/null +++ b/canmore/3rd_party/qt/linux-x86-intelce-g++/qmake.conf @@ -0,0 +1,23 @@ +# +# qmake configuration for building with avr32-linux-g++ +# + +include(../../common/g++.conf) +include(../../common/linux.conf) +include(../../common/qws.conf) + +# modifications to g++.conf +QMAKE_CC = i686-cm-linux-gcc +QMAKE_CXX = i686-cm-linux-g++ +QMAKE_LINK = i686-cm-linux-g++ +QMAKE_LINK_SHLIB = i686-cm-linux-g++ +QMAKE_CFLAGS = -I/opt/canmore/local/include -I/opt/canmore/IntelCE/include -I/opt/canmore/IntelCE/usr/include -I/opt/canmore/local/include/freetype2 -I/opt/canmore/IntelCE/include/gstreamer-0.10 +QMAKE_CXXFLAGS = -I/opt/canmore/local/include -I/opt/canmore/IntelCE/include -I/opt/canmore/IntelCE/usr/include -I/opt/canmore/local/include/freetype2 -I/opt/canmore/IntelCE/include/gstreamer-0.10 +QMAKE_LFLAGS = -L/opt/canmore/local/lib -L/opt/canmore/IntelCE/lib -L/opt/canmore/IntelCE/usr/lib -lsqlite3 -lgstreamer-0.10 -liconv + +# modifications to linux.conf +QMAKE_AR = i686-cm-linux-ar cqs +QMAKE_OBJCOPY = i686-cm-linux-objcopy +QMAKE_STRIP = i686-cm-linux-strip + +load(qt_config) diff --git a/canmore/3rd_party/qt/linux-x86-intelce-g++/qplatformdefs.h b/canmore/3rd_party/qt/linux-x86-intelce-g++/qplatformdefs.h new file mode 100644 index 00000000..12650bb4 --- /dev/null +++ b/canmore/3rd_party/qt/linux-x86-intelce-g++/qplatformdefs.h @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../linux-g++/qplatformdefs.h" diff --git a/canmore/3rd_party/qt/run.sh b/canmore/3rd_party/qt/run.sh new file mode 100644 index 00000000..b8276e80 --- /dev/null +++ b/canmore/3rd_party/qt/run.sh @@ -0,0 +1,4 @@ +# export LD_LIBRARY_PATH=/qt/lib:/usr/local/lib +# export QT_DEBUG_PLUGINS=1 +# export QWS_DISPLAY=directfb +# ./calculator -qws diff --git a/canmore/3rd_party/qtwebkit/compile-debug.sh b/canmore/3rd_party/qtwebkit/compile-debug.sh new file mode 100755 index 00000000..e8d0717f --- /dev/null +++ b/canmore/3rd_party/qtwebkit/compile-debug.sh @@ -0,0 +1,7 @@ +#!/bin/bash +cd qtwebkit +export PATH=$PATH:/opt/canmore/local/qt/bin +export QMAKESPEC=/opt/canmore/local/qt/mkspecs/qws/linux-x86-intelce-g++/ +export QTDIR=/opt/canmore/local/qt/ +export CROSS_COMPILE=i686-cm-linux- +./WebKitTools/Scripts/build-webkit --qt --qmake=/opt/canmore/local/qt/bin/qmake -spec qws/linux-x86-intelce-g++ --makeargs="-j10" --debug diff --git a/canmore/3rd_party/qtwebkit/compile.sh b/canmore/3rd_party/qtwebkit/compile.sh new file mode 100755 index 00000000..d255a979 --- /dev/null +++ b/canmore/3rd_party/qtwebkit/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +cd qtwebkit +export PATH=$PATH:/opt/canmore/local/qt/bin +export QMAKESPEC=/opt/canmore/local/qt/mkspecs/qws/linux-x86-intelce-g++/ +export QTDIR=/opt/canmore/local/qt/ +export CROSS_COMPILE=i686-cm-linux- +./WebKitTools/Scripts/build-webkit --qt --qmake=/opt/canmore/local/qt/bin/qmake -spec qws/linux-x86-intelce-g++ --makeargs="-j10" --video CONFIG+=embedded diff --git a/canmore/3rd_party/qtwebkit/qtwebkit_for_sodaville.patch b/canmore/3rd_party/qtwebkit/qtwebkit_for_sodaville.patch new file mode 100644 index 00000000..9ff9828c --- /dev/null +++ b/canmore/3rd_party/qtwebkit/qtwebkit_for_sodaville.patch @@ -0,0 +1,6282 @@ +diff --git a/JavaScriptCore/runtime/UString.cpp b/JavaScriptCore/runtime/UString.cpp +index 9da669d..4d7779d 100644 +--- a/JavaScriptCore/runtime/UString.cpp ++++ b/JavaScriptCore/runtime/UString.cpp +@@ -587,6 +587,8 @@ unsigned UString::rfind(const UString& f, unsigned pos) const + pos = sz - fsz; + if (fsz == 0) + return pos; ++ if (fsz == 1) ++ return rfind(f[0], pos); + unsigned fsizeminusone = (fsz - 1) * sizeof(UChar); + const UChar* fdata = f.data(); + for (const UChar* c = data() + pos; c >= data(); c--) { +diff --git a/JavaScriptCore/yarr/RegexJIT.h b/JavaScriptCore/yarr/RegexJIT.h +index fd765bc..8b97013 100644 +--- a/JavaScriptCore/yarr/RegexJIT.h ++++ b/JavaScriptCore/yarr/RegexJIT.h +@@ -32,7 +32,7 @@ + #include "RegexPattern.h" + #include + +-#include ++#include + struct JSRegExp; // temporary, remove when fallback is removed. + + #if CPU(X86) && !COMPILER(MSVC) +diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri +index 97ae526..402c48f 100644 +--- a/WebCore/WebCore.pri ++++ b/WebCore/WebCore.pri +@@ -86,7 +86,7 @@ greaterThan(QT_MINOR_VERSION, 5) { + + # Nescape plugins support (NPAPI) + !contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) { +- unix|win32-*:!embedded:!wince*: { ++ unix|win32-*:embedded:!wince*: { + DEFINES += ENABLE_NETSCAPE_PLUGIN_API=1 + } else { + DEFINES += ENABLE_NETSCAPE_PLUGIN_API=0 +diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro +index 981dba2..71433ba 100644 +--- a/WebCore/WebCore.pro ++++ b/WebCore/WebCore.pro +@@ -909,6 +909,7 @@ SOURCES += \ + plugins/PluginInfoStore.cpp \ + plugins/PluginPackage.cpp \ + plugins/PluginStream.cpp \ ++ plugins/PluginTimer.cpp \ + plugins/PluginView.cpp \ + rendering/AutoTableLayout.cpp \ + rendering/break_lines.cpp \ +@@ -2188,20 +2189,22 @@ contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) { + INCLUDEPATH += platform/mac + # Note: XP_MACOSX is defined in npapi.h + } else { +- !embedded { ++ embedded { ++ SOURCES += \ ++ plugins/qt/PluginPackageQt.cpp \ ++ plugins/embedded/PluginViewEmbedded.cpp ++ DEFINES += XP_EMBEDDED ++ } else { + CONFIG += x11 + LIBS += -lXrender +- } +- maemo5 { +- DEFINES += MOZ_PLATFORM_MAEMO=5 +- } +- SOURCES += \ +- plugins/qt/PluginContainerQt.cpp \ +- plugins/qt/PluginPackageQt.cpp \ +- plugins/qt/PluginViewQt.cpp +- HEADERS += \ +- plugins/qt/PluginContainerQt.h +- DEFINES += XP_UNIX ++ SOURCES += \ ++ plugins/qt/PluginContainerQt.cpp \ ++ plugins/qt/PluginPackageQt.cpp \ ++ plugins/qt/PluginViewQt.cpp ++ HEADERS += \ ++ plugins/qt/PluginContainerQt.h ++ DEFINES += XP_UNIX ++ } + } + } + +@@ -2396,18 +2399,47 @@ contains(DEFINES, ENABLE_VIDEO=1) { + + tobe|!tobe: QT += mediaservices + } else { +- HEADERS += \ +- platform/graphics/qt/MediaPlayerPrivatePhonon.h +- +- SOURCES += \ +- platform/graphics/qt/MediaPlayerPrivatePhonon.cpp +- +- # Add phonon manually to prevent it from coming first in +- # the include paths, as Phonon's path.h conflicts with +- # WebCore's Path.h on case-insensitive filesystems. +- qtAddLibrary(phonon) +- INCLUDEPATH -= $$QMAKE_INCDIR_QT/phonon +- INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon ++ embedded { ++ INCLUDEPATH += \ ++ $$PWD/platform/graphics/embedded ++ HEADERS += platform/graphics/embedded/MediaPlayerBoxee.h \ ++ platform/graphics/embedded/qjson/json_parser.hh \ ++ platform/graphics/embedded/qjson/json_scanner.h \ ++ platform/graphics/embedded/qjson/location.hh \ ++ platform/graphics/embedded/qjson/parser.h \ ++ platform/graphics/embedded/qjson/parser_p.h \ ++ platform/graphics/embedded/qjson/parserrunnable.h \ ++ platform/graphics/embedded/qjson/position.hh \ ++ platform/graphics/embedded/qjson/qjson_debug.h \ ++ platform/graphics/embedded/qjson/qjson_export.h \ ++ platform/graphics/embedded/qjson/qobjecthelper.h \ ++ platform/graphics/embedded/qjson/serializer.h \ ++ platform/graphics/embedded/qjson/serializerrunnable.h \ ++ platform/graphics/embedded/qjson/stack.hh ++ ++ SOURCES += platform/graphics/embedded/MediaPlayerBoxee.cpp \ ++ platform/graphics/embedded/qjson/json_parser.cc \ ++ platform/graphics/embedded/qjson/json_scanner.cpp \ ++ platform/graphics/embedded/qjson/parser.cpp \ ++ platform/graphics/embedded/qjson/parserrunnable.cpp \ ++ platform/graphics/embedded/qjson/qobjecthelper.cpp \ ++ platform/graphics/embedded/qjson/serializer.cpp \ ++ platform/graphics/embedded/qjson/serializerrunnable.cpp ++ } else { ++ HEADERS += \ ++ platform/graphics/qt/MediaPlayerPrivatePhonon.h ++ ++ SOURCES += \ ++ platform/graphics/qt/MediaPlayerPrivatePhonon.cpp ++ ++ # Add phonon manually to prevent it from coming first in ++ # the include paths, as Phonon's path.h conflicts with ++ # WebCore's Path.h on case-insensitive filesystems. ++ qtAddLibrary(phonon) ++ INCLUDEPATH -= $$QMAKE_INCDIR_QT/phonon ++ INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon ++ } ++ + mac { + INCLUDEPATH -= $$QMAKE_LIBDIR_QT/phonon.framework/Headers + INCLUDEPATH += $$QMAKE_LIBDIR_QT/phonon.framework/Headers +diff --git a/WebCore/platform/graphics/MediaPlayer.cpp b/WebCore/platform/graphics/MediaPlayer.cpp +index 035d1c5..5b83ae7 100644 +--- a/WebCore/platform/graphics/MediaPlayer.cpp ++++ b/WebCore/platform/graphics/MediaPlayer.cpp +@@ -49,6 +49,8 @@ + #include "MediaPlayerPrivateQuickTimeWin.h" + #elif PLATFORM(GTK) + #include "MediaPlayerPrivateGStreamer.h" ++#elif defined(XP_EMBEDDED) ++#include "MediaPlayerBoxee.h" + #elif PLATFORM(QT) + // QtMultimedia support is disabled currently. + #if 1 || (QT_VERSION < 0x040700) +diff --git a/WebCore/platform/graphics/embedded/MediaPlayerBoxee.cpp b/WebCore/platform/graphics/embedded/MediaPlayerBoxee.cpp +new file mode 100644 +index 0000000..f4d0880 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/MediaPlayerBoxee.cpp +@@ -0,0 +1,476 @@ ++/* ++ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Library General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Library General Public License ++ along with this library; see the file COPYING.LIB. If not, write to ++ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++#include "config.h" ++#include "MediaPlayerBoxee.h" ++ ++#include "CString.h" ++#include "FrameLoaderClientQt.h" ++#include "FrameView.h" ++#include "GraphicsContext.h" ++#include "HTMLMediaElement.h" ++#include "HTMLVideoElement.h" ++#include "TimeRanges.h" ++#include "Widget.h" ++#include "qwebframe.h" ++#include "qwebpage.h" ++#include "NotImplemented.h" ++ ++#include ++#include ++#include ++ ++using namespace WTF; ++ ++namespace WebCore { ++ ++QVariant MediaPlayerPrivate::RunCommand(QString command, QVariantMap parameters, bool expectedResult) const ++{ ++ Document* document = m_element->document(); ++ if (!document) ++ document = m_element->ownerDocument(); ++ ++ Frame* frame = document ? document->frame() : 0; ++ FrameLoaderClientQt* frameLoader = frame ? static_cast(frame->loader()->client()) : 0; ++ ++ QVariantMap request; ++ request.insert("command", QVariant(command)); ++ request.insert("parameters", parameters); ++ ++ QByteArray serialized = ((MediaPlayerPrivate*) this)->m_serializer.serialize(request); ++ ++ // javascript call for: boxeePlayer.handleRequest() ++ QString js; ++ if(expectedResult) ++ js = "boxee.exec2('boxee.handleBrowserCommandResponse(\\'"; ++ else ++ js = "boxee.exec('boxee.handleBrowserCommand(\\'"; ++ ++ js += QString(serialized); ++ js += "\\');')"; ++ ++// fprintf(stderr, "********************** MediaPlayerPrivate::RunCommand: %s\n", js.toLocal8Bit().constData()); ++ ++ QVariant result; ++ if (frameLoader) ++ { ++ result = frameLoader->webFrame()->evaluateJavaScript(js); ++// fprintf(stderr, "********************** MediaPlayerPrivate::RunCommand Done: %s\n", result.toString().toLocal8Bit().constData()); ++ } ++ ++ return result; ++} ++ ++MediaPlayerPrivateInterface* MediaPlayerPrivate::create(MediaPlayer* player) ++{ ++ return new MediaPlayerPrivate(player); ++} ++ ++void MediaPlayerPrivate::registerMediaEngine(MediaEngineRegistrar registrar) ++{ ++ registrar(create, getSupportedTypes, supportsType); ++} ++ ++void MediaPlayerPrivate::getSupportedTypes(HashSet &supported) ++{ ++ supported.add("video/mpeg"); ++ supported.add("video/quicktime"); ++ supported.add("video/mp4"); ++ supported.add("video/wmv"); ++ supported.add("video/3gpp"); ++ supported.add("video/3gpp2"); ++ supported.add("video/x-ms-asf"); ++ supported.add("video/x-msvideo"); ++ supported.add("video/x-ms-wmv"); ++ supported.add("video/ogg"); ++ supported.add("video/webm"); ++} ++ ++MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& mime, const String& codec) ++{ ++ if (!mime.startsWith("audio/") && !mime.startsWith("video/")) ++ return MediaPlayer::IsNotSupported; ++ ++ return MediaPlayer::IsSupported; ++} ++ ++MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player) ++ : m_player(player), ++ m_isVisible(false), ++ m_paused(true), ++ m_networkState(MediaPlayer::Empty), ++ m_readyState(MediaPlayer::HaveNothing) ++{ ++} ++ ++MediaPlayerPrivate::~MediaPlayerPrivate() ++{ ++} ++ ++bool MediaPlayerPrivate::hasVideo() const ++{ ++ return true; ++} ++ ++bool MediaPlayerPrivate::hasAudio() const ++{ ++ return true; ++} ++ ++void MediaPlayerPrivate::setloaded() ++{ ++ m_networkState = MediaPlayer::Idle; ++ m_player->networkStateChanged(); ++ m_readyState = MediaPlayer::HaveEnoughData; ++ m_player->readyStateChanged(); ++} ++ ++void MediaPlayerPrivate::load(const String& url) ++{ ++ // We are now loading ++ if (m_networkState != MediaPlayer::Loading) { ++ m_networkState = MediaPlayer::Loading; ++ m_player->networkStateChanged(); ++ } ++ ++ // And we don't have any data yet ++ if (m_readyState != MediaPlayer::HaveNothing) { ++ m_readyState = MediaPlayer::HaveNothing; ++ m_player->readyStateChanged(); ++ } ++ ++ m_duration = 0.0f; ++ m_paintedOnce = false; ++ ++ m_element = static_cast(m_player->mediaPlayerClient()); ++ QVariantMap parameters; ++ parameters.insert("url", QVariant(url)); ++ RunCommand("MEDIAPLAYER.Load", parameters); ++ ++ setVisible(true); ++ ++ m_networkState = MediaPlayer::Loading; ++ m_player->networkStateChanged(); ++ m_readyState = MediaPlayer::HaveNothing; ++ m_player->readyStateChanged(); ++ ++#if 0 ++ // We are now loading ++ if (m_networkState != MediaPlayer::Loading) { ++ m_networkState = MediaPlayer::Loading; ++ m_player->networkStateChanged(); ++ } ++ ++ // And we don't have any data yet ++ if (m_readyState != MediaPlayer::HaveNothing) { ++ m_readyState = MediaPlayer::HaveNothing; ++ m_player->readyStateChanged(); ++ } ++ ++ const QUrl rUrl = QUrl(QString(url)); ++ const QString scheme = rUrl.scheme().toLower(); ++ ++ // Grab the client media element ++ HTMLMediaElement* element = static_cast(m_player->mediaPlayerClient()); ++ ++ // Construct the media content with a network request if the resource is http[s] ++ if (scheme == "http" || scheme == "https") { ++ QNetworkRequest request = QNetworkRequest(rUrl); ++ ++ // Grab the current document ++ Document* document = element->document(); ++ if (!document) ++ document = element->ownerDocument(); ++ ++ // Grab the frame and network manager ++ Frame* frame = document ? document->frame() : 0; ++ FrameLoaderClientQt* frameLoader = frame ? static_cast(frame->loader()->client()) : 0; ++ QNetworkAccessManager* manager = frameLoader ? frameLoader->webFrame()->page()->networkAccessManager() : 0; ++ ++ if (document && manager) { ++ // Set the cookies ++ QNetworkCookieJar* jar = manager->cookieJar(); ++ QList cookies = jar->cookiesForUrl(rUrl); ++ ++ // Don't set the header if there are no cookies. ++ // This prevents a warning from being emitted. ++ if (!cookies.isEmpty()) ++ request.setHeader(QNetworkRequest::CookieHeader, qVariantFromValue(cookies)); ++cookies ++ // Set the refferer, but not when requesting insecure content from a secure page ++ QUrl documentUrl = QUrl(QString(document->documentURI())); ++ if (documentUrl.scheme().toLower() == "http" || scheme == "https") ++ request.setRawHeader("Referer", documentUrl.toEncoded()); ++ ++ // Set the user agent ++ request.setRawHeader("User-Agent", frameLoader->userAgent(rUrl).utf8().data()); ++ } ++ ++ m_mediaPlayer->setMedia(QMediaContent(request)); ++ } else { ++ // Otherwise, just use the URL ++ m_mediaPlayer->setMedia(QMediaContent(rUrl)); ++ } ++ ++ // Set the current volume and mute status ++ // We get these from the element, rather than the player, in case we have ++ // transitioned from a media engine which doesn't support muting, to a media ++ // engine which does. ++ m_mediaPlayer->setMuted(element->muted()); ++ m_mediaPlayer->setVolume(static_cast(element->volume() * 100.0)); ++#endif ++} ++ ++void MediaPlayerPrivate::cancelLoad() ++{ ++ notImplemented(); ++} ++ ++void MediaPlayerPrivate::play() ++{ ++ QVariantMap parameters; ++ RunCommand("MEDIAPLAYER.Play", parameters); ++ m_paused = false; ++} ++ ++void MediaPlayerPrivate::pause() ++{ ++ QVariantMap parameters; ++ RunCommand("MEDIAPLAYER.Pause", parameters); ++ m_paused = true; ++} ++ ++bool MediaPlayerPrivate::paused() const ++{ ++ return m_paused; ++} ++ ++void MediaPlayerPrivate::seek(float position) ++{ ++ // if (!m_mediaPlayer->isSeekable()) ++ // return; ++ ++ fprintf(stderr, "** NOT SEEKING\n"); ++#if 0 ++ QVariantMap parameters; ++ parameters.insert("position", QVariant(position)); ++ QVariant result = RunCommand("MEDIAPLAYER.Seek", parameters); ++#endif ++ ++ ++#if 0 ++ ++ ++ if (m_mediaPlayerControl && !m_mediaPlayerControl->availablePlaybackRanges().contains(position * 1000)) ++ return; ++ ++ if (m_isSeeking) ++ return; ++ ++ if (position > duration()) ++ position = duration(); ++ ++ // Seeking is most reliable when we're paused. ++ // Webkit will try to pause before seeking, but due to the asynchronous nature ++ // of the backend, the player may not actually be paused yet. ++ // In this case, we should queue the seek and wait until pausing has completed ++ // before attempting to seek. ++ if (m_mediaPlayer->state() == QMediaPlayer::PlayingState) { ++ m_mediaPlayer->pause(); ++ m_isSeeking = true; ++ m_queuedSeek = static_cast(position * 1000); ++ ++ // Set a timeout, so that in the event that we don't get a state changed ++ // signal, we still attempt the seek. ++ QTimer::singleShot(1000, this, SLOT(queuedSeekTimeout())); ++ } else { ++ m_isSeeking = true; ++ m_mediaPlayer->setPosition( QVariantMap parameters; ++ RunCommand("MEDIAPLAYER.CancelLoad", parameters);static_cast(position * 1000)); ++ ++ // Set a timeout, in case we don't get a position changed signal ++ QTimer::singleShot(10000, this, SLOT(seekTimeout())); ++ } ++#endif ++} ++ ++bool MediaPlayerPrivate::seeking() const ++{ ++ return false; ++} ++ ++float MediaPlayerPrivate::duration() const ++{ ++// if (m_readyState < MediaPlayer::HaveMetadata) ++// return 0.0f; ++ ++ if (m_duration != 0.0f) ++ return m_duration; ++ ++ QVariantMap parameters; ++ QVariant result = RunCommand("MEDIAPLAYER.Duration", parameters, true); ++ float res = result.toFloat(); ++ if (res != 0.0f) ++ { ++ MediaPlayerPrivate* tp = (MediaPlayerPrivate*)this; ++ tp->m_duration = res; ++ tp->setloaded(); ++ } ++ ++ return res; ++} ++ ++float MediaPlayerPrivate::currentTime() const ++{ ++ QVariantMap parameters; ++ QVariant result = RunCommand("MEDIAPLAYER.CurrentTime", parameters, true); ++ return result.toFloat(); ++} ++ ++PassRefPtr MediaPlayerPrivate::buffered() const ++{ ++ notImplemented(); ++ return TimeRanges::create(); ++} ++ ++float MediaPlayerPrivate::maxTimeSeekable() const ++{ ++ notImplemented(); ++ return 30.0f; ++} ++ ++unsigned MediaPlayerPrivate::bytesLoaded() const ++{ ++ const float dur = duration(); ++ ++ if (dur == 0.0) ++ return 0; ++ ++ QVariantMap parameters; ++ QVariant result = RunCommand("MEDIAPLAYER.BytesLoaded", parameters, true); ++ int res = result.toInt(); ++ ++ // boxee never gets to 100 ++ if( res == 99 ) res = 100; ++ //printf("bytes loaded giving back %d\n", res); ++ ++ return res; ++} ++ ++unsigned MediaPlayerPrivate::totalBytes() const ++{ ++ return 0; ++} ++ ++void MediaPlayerPrivate::setRate(float rate) ++{ ++ notImplemented(); ++} ++ ++void MediaPlayerPrivate::setVolume(float volume) ++{ ++ QVariantMap parameters; ++ parameters.insert("volume", QVariant(QVariant(volume).toString())); ++ RunCommand("MEDIAPLAYER.SetVolume", parameters); ++} ++ ++bool MediaPlayerPrivate::supportsMuting() const ++{ ++ return true; ++} ++ ++void MediaPlayerPrivate::setMuted(bool muted) ++{ ++ QVariantMap parameters; ++ parameters.insert("muted", QVariant(muted)); ++ RunCommand("MEDIAPLAYER.SetMuted", parameters); ++} ++ ++MediaPlayer::NetworkState MediaPlayerPrivate::networkState() const ++{ ++ return m_networkState; ++} ++ ++MediaPlayer::ReadyState MediaPlayerPrivate::readyState() const ++{ ++ return m_readyState; ++} ++ ++void MediaPlayerPrivate::setVisible(bool visible) ++{ ++ m_isVisible = visible; ++} ++ ++void MediaPlayerPrivate::setSize(const IntSize& size) ++{ ++ m_size = size; ++} ++ ++IntSize MediaPlayerPrivate::naturalSize() const ++{ ++ return m_size; ++} ++ ++void MediaPlayerPrivate::paint(GraphicsContext* context, const IntRect& rect) ++{ ++// printf("**************** paint\n"); ++ ++ if (context->paintingDisabled()) ++ return; ++ ++ if (!m_isVisible) ++ return; ++ ++ if (!m_paintedOnce) ++ { ++ m_videoRect = rect; ++ ++ QVariantMap parameters; ++ parameters.insert("x", QVariant(m_videoRect.x())); ++ parameters.insert("y", QVariant(m_videoRect.y())); ++ parameters.insert("width", QVariant(m_videoRect.width())); ++ parameters.insert("height", QVariant(m_videoRect.height())); ++ RunCommand("MEDIAPLAYER.Paint", parameters); ++ } ++ ++ m_paintedOnce = true; ++ ++ FloatRect fr(rect.x(), rect.y(), rect.width(), rect.height()); ++ context->clearRect(fr); ++} ++ ++#if USE(ACCELERATED_COMPOSITING) ++void MediaPlayerPrivate::acceleratedRenderingStateChanged() ++{ ++ bool composited = m_player->mediaPlayerClient()->mediaPlayerRenderingCanBeAccelerated(m_player); ++ if (composited == m_composited) ++ return; ++ ++ m_composited = composited; ++} ++ ++PlatformLayer* MediaPlayerPrivate::platformLayer() const ++{ ++ return 0; ++} ++#endif ++ ++} // namespace WebCore ++ ++#include "moc_MediaPlayerBoxee.cpp" +diff --git a/WebCore/platform/graphics/embedded/MediaPlayerBoxee.h b/WebCore/platform/graphics/embedded/MediaPlayerBoxee.h +new file mode 100644 +index 0000000..7c36329 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/MediaPlayerBoxee.h +@@ -0,0 +1,113 @@ ++/* ++ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Library General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Library General Public License ++ along with this library; see the file COPYING.LIB. If not, write to ++ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++#ifndef MediaPlayerPrivateBoxee_h ++#define MediaPlayerPrivateBoxee_h ++ ++#include "MediaPlayerPrivate.h" ++#include "qjson/serializer.h" ++#include "HTMLMediaElement.h" ++ ++#include ++#include ++ ++namespace WebCore { ++ ++class MediaPlayerPrivate : public QObject, public MediaPlayerPrivateInterface { ++ ++ Q_OBJECT ++ ++public: ++ static MediaPlayerPrivateInterface* create(MediaPlayer* player); ++ ~MediaPlayerPrivate(); ++ ++ static void registerMediaEngine(MediaEngineRegistrar); ++ static void getSupportedTypes(HashSet&); ++ static MediaPlayer::SupportsType supportsType(const String&, const String&); ++ static bool isAvailable() { return true; } ++ ++ bool hasVideo() const; ++ bool hasAudio() const; ++ ++ void load(const String &url); ++ void cancelLoad(); ++ ++ void play(); ++ void pause(); ++ ++ bool paused() const; ++ bool seeking() const; ++ ++ float duration() const; ++ float currentTime() const; ++ void seek(float); ++ ++ void setRate(float); ++ void setVolume(float); ++ ++ bool supportsMuting() const; ++ void setMuted(bool); ++ ++ MediaPlayer::NetworkState networkState() const; ++ MediaPlayer::ReadyState readyState() const; ++ ++ PassRefPtr buffered() const; ++ float maxTimeSeekable() const; ++ unsigned bytesLoaded() const; ++ unsigned totalBytes() const; ++ ++ void setVisible(bool); ++ ++ IntSize naturalSize() const; ++ void setSize(const IntSize&); ++ ++ void paint(GraphicsContext*, const IntRect&); ++ ++ bool supportsFullscreen() const { return false; } ++ ++#if USE(ACCELERATED_COMPOSITING) ++ // whether accelerated rendering is supported by the media engine for the current media. ++ virtual bool supportsAcceleratedRendering() const { return true; } ++ // called when the rendering system flips the into or out of accelerated rendering mode. ++ virtual void acceleratedRenderingStateChanged(); ++ // returns an object that can be directly composited via GraphicsLayerQt (essentially a QGraphicsItem*) ++ virtual PlatformLayer* platformLayer() const; ++#endif ++ ++private: ++ void setloaded(); ++ MediaPlayerPrivate(MediaPlayer*); ++ QVariant RunCommand(QString command, QVariantMap parameters, bool expectedResult = false) const; ++ ++ QJson::Serializer m_serializer; ++ MediaPlayer* m_player; ++ HTMLMediaElement* m_element; ++ bool m_composited; ++ bool m_isVisible; ++ IntRect m_videoRect; ++ bool m_paused; ++ IntSize m_size; ++ MediaPlayer::NetworkState m_networkState; ++ MediaPlayer::ReadyState m_readyState; ++ float m_duration; ++ bool m_paintedOnce; ++}; ++} ++ ++#endif // MediaPlayerPrivateQt_h +diff --git a/WebCore/platform/graphics/embedded/qjson/json_parser.cc b/WebCore/platform/graphics/embedded/qjson/json_parser.cc +new file mode 100644 +index 0000000..a99be6c +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/json_parser.cc +@@ -0,0 +1,1096 @@ ++/* A Bison parser, made by GNU Bison 2.3. */ ++ ++/* Skeleton implementation for Bison LALR(1) parsers in C++ ++ ++ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. */ ++ ++/* As a special exception, you may create a larger work that contains ++ part or all of the Bison parser skeleton and distribute that work ++ under terms of your choice, so long as that work isn't itself a ++ parser generator using the skeleton or a modified version thereof ++ as a parser skeleton. Alternatively, if you modify or redistribute ++ the parser skeleton itself, you may (at your option) remove this ++ special exception, which will cause the skeleton and the resulting ++ Bison output files to be licensed under the GNU General Public ++ License without this special exception. ++ ++ This special exception was added by the Free Software Foundation in ++ version 2.2 of Bison. */ ++ ++ ++#include "json_parser.hh" ++ ++/* User implementation prologue. */ ++ ++ ++/* Line 317 of lalr1.cc. */ ++#line 43 "json_parser.cc" ++ ++#ifndef YY_ ++# if defined YYENABLE_NLS && YYENABLE_NLS ++# if ENABLE_NLS ++# include /* FIXME: INFRINGES ON USER NAME SPACE */ ++# define YY_(msgid) dgettext ("bison-runtime", msgid) ++# endif ++# endif ++# ifndef YY_ ++# define YY_(msgid) msgid ++# endif ++#endif ++ ++/* Suppress unused-variable warnings by "using" E. */ ++#define YYUSE(e) ((void) (e)) ++ ++/* A pseudo ostream that takes yydebug_ into account. */ ++# define YYCDEBUG \ ++ for (bool yydebugcond_ = yydebug_; yydebugcond_; yydebugcond_ = false) \ ++ (*yycdebug_) ++ ++/* Enable debugging if requested. */ ++#if YYDEBUG ++ ++# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ ++do { \ ++ if (yydebug_) \ ++ { \ ++ *yycdebug_ << Title << ' '; \ ++ yy_symbol_print_ ((Type), (Value), (Location)); \ ++ *yycdebug_ << std::endl; \ ++ } \ ++} while (false) ++ ++# define YY_REDUCE_PRINT(Rule) \ ++do { \ ++ if (yydebug_) \ ++ yy_reduce_print_ (Rule); \ ++} while (false) ++ ++# define YY_STACK_PRINT() \ ++do { \ ++ if (yydebug_) \ ++ yystack_print_ (); \ ++} while (false) ++ ++#else /* !YYDEBUG */ ++ ++# define YY_SYMBOL_PRINT(Title, Type, Value, Location) ++# define YY_REDUCE_PRINT(Rule) ++# define YY_STACK_PRINT() ++ ++#endif /* !YYDEBUG */ ++ ++#define YYACCEPT goto yyacceptlab ++#define YYABORT goto yyabortlab ++#define YYERROR goto yyerrorlab ++ ++namespace yy ++{ ++#if YYERROR_VERBOSE ++ ++ /* Return YYSTR after stripping away unnecessary quotes and ++ backslashes, so that it's suitable for yyerror. The heuristic is ++ that double-quoting is unnecessary unless the string contains an ++ apostrophe, a comma, or backslash (other than backslash-backslash). ++ YYSTR is taken from yytname. */ ++ std::string ++ json_parser::yytnamerr_ (const char *yystr) ++ { ++ if (*yystr == '"') ++ { ++ std::string yyr = ""; ++ char const *yyp = yystr; ++ ++ for (;;) ++ switch (*++yyp) ++ { ++ case '\'': ++ case ',': ++ goto do_not_strip_quotes; ++ ++ case '\\': ++ if (*++yyp != '\\') ++ goto do_not_strip_quotes; ++ /* Fall through. */ ++ default: ++ yyr += *yyp; ++ break; ++ ++ case '"': ++ return yyr; ++ } ++ do_not_strip_quotes: ; ++ } ++ ++ return yystr; ++ } ++ ++#endif ++ ++ /// Build a parser object. ++ json_parser::json_parser (QJson::ParserPrivate* driver_yyarg) ++ : yydebug_ (false), ++ yycdebug_ (&std::cerr), ++ driver (driver_yyarg) ++ { ++ } ++ ++ json_parser::~json_parser () ++ { ++ } ++ ++#if YYDEBUG ++ /*--------------------------------. ++ | Print this symbol on YYOUTPUT. | ++ `--------------------------------*/ ++ ++ inline void ++ json_parser::yy_symbol_value_print_ (int yytype, ++ const semantic_type* yyvaluep, const location_type* yylocationp) ++ { ++ YYUSE (yylocationp); ++ YYUSE (yyvaluep); ++ switch (yytype) ++ { ++ default: ++ break; ++ } ++ } ++ ++ ++ void ++ json_parser::yy_symbol_print_ (int yytype, ++ const semantic_type* yyvaluep, const location_type* yylocationp) ++ { ++ *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm") ++ << ' ' << yytname_[yytype] << " (" ++ << *yylocationp << ": "; ++ yy_symbol_value_print_ (yytype, yyvaluep, yylocationp); ++ *yycdebug_ << ')'; ++ } ++#endif /* ! YYDEBUG */ ++ ++ void ++ json_parser::yydestruct_ (const char* yymsg, ++ int yytype, semantic_type* yyvaluep, location_type* yylocationp) ++ { ++ YYUSE (yylocationp); ++ YYUSE (yymsg); ++ YYUSE (yyvaluep); ++ ++ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); ++ ++ switch (yytype) ++ { ++ ++ default: ++ break; ++ } ++ } ++ ++ void ++ json_parser::yypop_ (unsigned int n) ++ { ++ yystate_stack_.pop (n); ++ yysemantic_stack_.pop (n); ++ yylocation_stack_.pop (n); ++ } ++ ++ std::ostream& ++ json_parser::debug_stream () const ++ { ++ return *yycdebug_; ++ } ++ ++ void ++ json_parser::set_debug_stream (std::ostream& o) ++ { ++ yycdebug_ = &o; ++ } ++ ++ ++ json_parser::debug_level_type ++ json_parser::debug_level () const ++ { ++ return yydebug_; ++ } ++ ++ void ++ json_parser::set_debug_level (debug_level_type l) ++ { ++ yydebug_ = l; ++ } ++ ++ ++ int ++ json_parser::parse () ++ { ++ /// Look-ahead and look-ahead in internal form. ++ int yychar = yyempty_; ++ int yytoken = 0; ++ ++ /* State. */ ++ int yyn; ++ int yylen = 0; ++ int yystate = 0; ++ ++ /* Error handling. */ ++ int yynerrs_ = 0; ++ int yyerrstatus_ = 0; ++ ++ /// Semantic value of the look-ahead. ++ semantic_type yylval; ++ /// Location of the look-ahead. ++ location_type yylloc; ++ /// The locations where the error started and ended. ++ location yyerror_range[2]; ++ ++ /// $$. ++ semantic_type yyval; ++ /// @$. ++ location_type yyloc; ++ ++ int yyresult; ++ ++ YYCDEBUG << "Starting parse" << std::endl; ++ ++ ++ /* Initialize the stacks. The initial state will be pushed in ++ yynewstate, since the latter expects the semantical and the ++ location values to have been already stored, initialize these ++ stacks with a primary value. */ ++ yystate_stack_ = state_stack_type (0); ++ yysemantic_stack_ = semantic_stack_type (0); ++ yylocation_stack_ = location_stack_type (0); ++ yysemantic_stack_.push (yylval); ++ yylocation_stack_.push (yylloc); ++ ++ /* New state. */ ++ yynewstate: ++ yystate_stack_.push (yystate); ++ YYCDEBUG << "Entering state " << yystate << std::endl; ++ goto yybackup; ++ ++ /* Backup. */ ++ yybackup: ++ ++ /* Try to take a decision without look-ahead. */ ++ yyn = yypact_[yystate]; ++ if (yyn == yypact_ninf_) ++ goto yydefault; ++ ++ /* Read a look-ahead token. */ ++ if (yychar == yyempty_) ++ { ++ YYCDEBUG << "Reading a token: "; ++ yychar = yylex (&yylval, &yylloc, driver); ++ } ++ ++ ++ /* Convert token to internal form. */ ++ if (yychar <= yyeof_) ++ { ++ yychar = yytoken = yyeof_; ++ YYCDEBUG << "Now at end of input." << std::endl; ++ } ++ else ++ { ++ yytoken = yytranslate_ (yychar); ++ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); ++ } ++ ++ /* If the proper action on seeing token YYTOKEN is to reduce or to ++ detect an error, take that action. */ ++ yyn += yytoken; ++ if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) ++ goto yydefault; ++ ++ /* Reduce or error. */ ++ yyn = yytable_[yyn]; ++ if (yyn <= 0) ++ { ++ if (yyn == 0 || yyn == yytable_ninf_) ++ goto yyerrlab; ++ yyn = -yyn; ++ goto yyreduce; ++ } ++ ++ /* Accept? */ ++ if (yyn == yyfinal_) ++ goto yyacceptlab; ++ ++ /* Shift the look-ahead token. */ ++ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); ++ ++ /* Discard the token being shifted unless it is eof. */ ++ if (yychar != yyeof_) ++ yychar = yyempty_; ++ ++ yysemantic_stack_.push (yylval); ++ yylocation_stack_.push (yylloc); ++ ++ /* Count tokens shifted since error; after three, turn off error ++ status. */ ++ if (yyerrstatus_) ++ --yyerrstatus_; ++ ++ yystate = yyn; ++ goto yynewstate; ++ ++ /*-----------------------------------------------------------. ++ | yydefault -- do the default action for the current state. | ++ `-----------------------------------------------------------*/ ++ yydefault: ++ yyn = yydefact_[yystate]; ++ if (yyn == 0) ++ goto yyerrlab; ++ goto yyreduce; ++ ++ /*-----------------------------. ++ | yyreduce -- Do a reduction. | ++ `-----------------------------*/ ++ yyreduce: ++ yylen = yyr2_[yyn]; ++ /* If YYLEN is nonzero, implement the default value of the action: ++ `$$ = $1'. Otherwise, use the top of the stack. ++ ++ Otherwise, the following line sets YYVAL to garbage. ++ This behavior is undocumented and Bison ++ users should not rely upon it. */ ++ if (yylen) ++ yyval = yysemantic_stack_[yylen - 1]; ++ else ++ yyval = yysemantic_stack_[0]; ++ ++ { ++ slice slice (yylocation_stack_, yylen); ++ YYLLOC_DEFAULT (yyloc, slice, yylen); ++ } ++ YY_REDUCE_PRINT (yyn); ++ switch (yyn) ++ { ++ case 2: ++#line 80 "json_parser.yy" ++ { ++ driver->m_result = (yysemantic_stack_[(1) - (1)]); ++ qjsonDebug() << "json_parser - parsing finished"; ++ ;} ++ break; ++ ++ case 3: ++#line 85 "json_parser.yy" ++ {(yyval) = (yysemantic_stack_[(1) - (1)]); ;} ++ break; ++ ++ case 4: ++#line 86 "json_parser.yy" ++ {(yyval) = (yysemantic_stack_[(1) - (1)]); ;} ++ break; ++ ++ case 5: ++#line 88 "json_parser.yy" ++ { ++ qCritical()<< "json_parser - syntax error found, " ++ << "forcing abort"; ++ YYABORT; ++ ;} ++ break; ++ ++ case 7: ++#line 95 "json_parser.yy" ++ { (yyval) = (yysemantic_stack_[(3) - (2)]); ;} ++ break; ++ ++ case 8: ++#line 97 "json_parser.yy" ++ { (yyval) = QVariant (QVariantMap()); ;} ++ break; ++ ++ case 9: ++#line 98 "json_parser.yy" ++ { ++ QVariantMap members = (yysemantic_stack_[(2) - (2)]).toMap(); ++ (yysemantic_stack_[(2) - (2)]) = QVariant(); // Allow reuse of map ++ (yyval) = QVariant(members.unite ((yysemantic_stack_[(2) - (1)]).toMap())); ++ ;} ++ break; ++ ++ case 10: ++#line 104 "json_parser.yy" ++ { (yyval) = QVariant (QVariantMap()); ;} ++ break; ++ ++ case 11: ++#line 105 "json_parser.yy" ++ { ++ QVariantMap members = (yysemantic_stack_[(3) - (3)]).toMap(); ++ (yysemantic_stack_[(3) - (3)]) = QVariant(); // Allow reuse of map ++ (yyval) = QVariant(members.unite ((yysemantic_stack_[(3) - (2)]).toMap())); ++ ;} ++ break; ++ ++ case 12: ++#line 111 "json_parser.yy" ++ { ++ QVariantMap pair; ++ pair.insert ((yysemantic_stack_[(3) - (1)]).toString(), QVariant((yysemantic_stack_[(3) - (3)]))); ++ (yyval) = QVariant (pair); ++ ;} ++ break; ++ ++ case 13: ++#line 117 "json_parser.yy" ++ { (yyval) = (yysemantic_stack_[(3) - (2)]); ;} ++ break; ++ ++ case 14: ++#line 119 "json_parser.yy" ++ { (yyval) = QVariant (QVariantList()); ;} ++ break; ++ ++ case 15: ++#line 120 "json_parser.yy" ++ { ++ QVariantList members = (yysemantic_stack_[(2) - (2)]).toList(); ++ (yysemantic_stack_[(2) - (2)]) = QVariant(); // Allow reuse of list ++ members.prepend ((yysemantic_stack_[(2) - (1)])); ++ (yyval) = QVariant(members); ++ ;} ++ break; ++ ++ case 16: ++#line 127 "json_parser.yy" ++ { (yyval) = QVariant (QVariantList()); ;} ++ break; ++ ++ case 17: ++#line 128 "json_parser.yy" ++ { ++ QVariantList members = (yysemantic_stack_[(3) - (3)]).toList(); ++ (yysemantic_stack_[(3) - (3)]) = QVariant(); // Allow reuse of list ++ members.prepend ((yysemantic_stack_[(3) - (2)])); ++ (yyval) = QVariant(members); ++ ;} ++ break; ++ ++ case 18: ++#line 135 "json_parser.yy" ++ { (yyval) = (yysemantic_stack_[(1) - (1)]); ;} ++ break; ++ ++ case 19: ++#line 136 "json_parser.yy" ++ { (yyval) = (yysemantic_stack_[(1) - (1)]); ;} ++ break; ++ ++ case 20: ++#line 137 "json_parser.yy" ++ { (yyval) = (yysemantic_stack_[(1) - (1)]); ;} ++ break; ++ ++ case 21: ++#line 138 "json_parser.yy" ++ { (yyval) = (yysemantic_stack_[(1) - (1)]); ;} ++ break; ++ ++ case 22: ++#line 139 "json_parser.yy" ++ { (yyval) = QVariant (true); ;} ++ break; ++ ++ case 23: ++#line 140 "json_parser.yy" ++ { (yyval) = QVariant (false); ;} ++ break; ++ ++ case 24: ++#line 141 "json_parser.yy" ++ { ++ QVariant null_variant; ++ (yyval) = null_variant; ++ ;} ++ break; ++ ++ case 25: ++#line 146 "json_parser.yy" ++ { ++ if ((yysemantic_stack_[(1) - (1)]).toByteArray().startsWith('-')) { ++ (yyval) = QVariant (QVariant::LongLong); ++ (yyval).setValue((yysemantic_stack_[(1) - (1)]).toLongLong()); ++ } ++ else { ++ (yyval) = QVariant (QVariant::ULongLong); ++ (yyval).setValue((yysemantic_stack_[(1) - (1)]).toULongLong()); ++ } ++ ;} ++ break; ++ ++ case 26: ++#line 156 "json_parser.yy" ++ { ++ const QByteArray value = (yysemantic_stack_[(2) - (1)]).toByteArray() + (yysemantic_stack_[(2) - (2)]).toByteArray(); ++ (yyval) = QVariant(QVariant::Double); ++ (yyval).setValue(value.toDouble()); ++ ;} ++ break; ++ ++ case 27: ++#line 161 "json_parser.yy" ++ { (yyval) = QVariant ((yysemantic_stack_[(2) - (1)]).toByteArray() + (yysemantic_stack_[(2) - (2)]).toByteArray()); ;} ++ break; ++ ++ case 28: ++#line 162 "json_parser.yy" ++ { ++ const QByteArray value = (yysemantic_stack_[(3) - (1)]).toByteArray() + (yysemantic_stack_[(3) - (2)]).toByteArray() + (yysemantic_stack_[(3) - (3)]).toByteArray(); ++ (yyval) = QVariant (value); ++ ;} ++ break; ++ ++ case 29: ++#line 167 "json_parser.yy" ++ { (yyval) = QVariant ((yysemantic_stack_[(2) - (1)]).toByteArray() + (yysemantic_stack_[(2) - (2)]).toByteArray()); ;} ++ break; ++ ++ case 30: ++#line 168 "json_parser.yy" ++ { (yyval) = QVariant (QByteArray("-") + (yysemantic_stack_[(3) - (2)]).toByteArray() + (yysemantic_stack_[(3) - (3)]).toByteArray()); ;} ++ break; ++ ++ case 31: ++#line 170 "json_parser.yy" ++ { (yyval) = QVariant (QByteArray("")); ;} ++ break; ++ ++ case 32: ++#line 171 "json_parser.yy" ++ { ++ (yyval) = QVariant((yysemantic_stack_[(2) - (1)]).toByteArray() + (yysemantic_stack_[(2) - (2)]).toByteArray()); ++ ;} ++ break; ++ ++ case 33: ++#line 175 "json_parser.yy" ++ { ++ (yyval) = QVariant(QByteArray(".") + (yysemantic_stack_[(2) - (2)]).toByteArray()); ++ ;} ++ break; ++ ++ case 34: ++#line 179 "json_parser.yy" ++ { (yyval) = QVariant((yysemantic_stack_[(2) - (1)]).toByteArray() + (yysemantic_stack_[(2) - (2)]).toByteArray()); ;} ++ break; ++ ++ case 35: ++#line 181 "json_parser.yy" ++ { (yyval) = (yysemantic_stack_[(3) - (2)]); ;} ++ break; ++ ++ case 36: ++#line 183 "json_parser.yy" ++ { (yyval) = QVariant (QString(QLatin1String(""))); ;} ++ break; ++ ++ case 37: ++#line 184 "json_parser.yy" ++ { ++ (yyval) = (yysemantic_stack_[(1) - (1)]); ++ ;} ++ break; ++ ++ ++ /* Line 675 of lalr1.cc. */ ++#line 618 "json_parser.cc" ++ default: break; ++ } ++ YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); ++ ++ yypop_ (yylen); ++ yylen = 0; ++ YY_STACK_PRINT (); ++ ++ yysemantic_stack_.push (yyval); ++ yylocation_stack_.push (yyloc); ++ ++ /* Shift the result of the reduction. */ ++ yyn = yyr1_[yyn]; ++ yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0]; ++ if (0 <= yystate && yystate <= yylast_ ++ && yycheck_[yystate] == yystate_stack_[0]) ++ yystate = yytable_[yystate]; ++ else ++ yystate = yydefgoto_[yyn - yyntokens_]; ++ goto yynewstate; ++ ++ /*------------------------------------. ++ | yyerrlab -- here on detecting error | ++ `------------------------------------*/ ++ yyerrlab: ++ /* If not already recovering from an error, report this error. */ ++ if (!yyerrstatus_) ++ { ++ ++yynerrs_; ++ error (yylloc, yysyntax_error_ (yystate, yytoken)); ++ } ++ ++ yyerror_range[0] = yylloc; ++ if (yyerrstatus_ == 3) ++ { ++ /* If just tried and failed to reuse look-ahead token after an ++ error, discard it. */ ++ ++ if (yychar <= yyeof_) ++ { ++ /* Return failure if at end of input. */ ++ if (yychar == yyeof_) ++ YYABORT; ++ } ++ else ++ { ++ yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); ++ yychar = yyempty_; ++ } ++ } ++ ++ /* Else will try to reuse look-ahead token after shifting the error ++ token. */ ++ goto yyerrlab1; ++ ++ ++ /*---------------------------------------------------. ++ | yyerrorlab -- error raised explicitly by YYERROR. | ++ `---------------------------------------------------*/ ++ yyerrorlab: ++ ++ /* Pacify compilers like GCC when the user code never invokes ++ YYERROR and the label yyerrorlab therefore never appears in user ++ code. */ ++ if (false) ++ goto yyerrorlab; ++ ++ yyerror_range[0] = yylocation_stack_[yylen - 1]; ++ /* Do not reclaim the symbols of the rule which action triggered ++ this YYERROR. */ ++ yypop_ (yylen); ++ yylen = 0; ++ yystate = yystate_stack_[0]; ++ goto yyerrlab1; ++ ++ /*-------------------------------------------------------------. ++ | yyerrlab1 -- common code for both syntax error and YYERROR. | ++ `-------------------------------------------------------------*/ ++ yyerrlab1: ++ yyerrstatus_ = 3; /* Each real token shifted decrements this. */ ++ ++ for (;;) ++ { ++ yyn = yypact_[yystate]; ++ if (yyn != yypact_ninf_) ++ { ++ yyn += yyterror_; ++ if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) ++ { ++ yyn = yytable_[yyn]; ++ if (0 < yyn) ++ break; ++ } ++ } ++ ++ /* Pop the current state because it cannot handle the error token. */ ++ if (yystate_stack_.height () == 1) ++ YYABORT; ++ ++ yyerror_range[0] = yylocation_stack_[0]; ++ yydestruct_ ("Error: popping", ++ yystos_[yystate], ++ &yysemantic_stack_[0], &yylocation_stack_[0]); ++ yypop_ (); ++ yystate = yystate_stack_[0]; ++ YY_STACK_PRINT (); ++ } ++ ++ if (yyn == yyfinal_) ++ goto yyacceptlab; ++ ++ yyerror_range[1] = yylloc; ++ // Using YYLLOC is tempting, but would change the location of ++ // the look-ahead. YYLOC is available though. ++ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); ++ yysemantic_stack_.push (yylval); ++ yylocation_stack_.push (yyloc); ++ ++ /* Shift the error token. */ ++ YY_SYMBOL_PRINT ("Shifting", yystos_[yyn], ++ &yysemantic_stack_[0], &yylocation_stack_[0]); ++ ++ yystate = yyn; ++ goto yynewstate; ++ ++ /* Accept. */ ++ yyacceptlab: ++ yyresult = 0; ++ goto yyreturn; ++ ++ /* Abort. */ ++ yyabortlab: ++ yyresult = 1; ++ goto yyreturn; ++ ++ yyreturn: ++ if (yychar != yyeof_ && yychar != yyempty_) ++ yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); ++ ++ /* Do not reclaim the symbols of the rule which action triggered ++ this YYABORT or YYACCEPT. */ ++ yypop_ (yylen); ++ while (yystate_stack_.height () != 1) ++ { ++ yydestruct_ ("Cleanup: popping", ++ yystos_[yystate_stack_[0]], ++ &yysemantic_stack_[0], ++ &yylocation_stack_[0]); ++ yypop_ (); ++ } ++ ++ return yyresult; ++ } ++ ++ // Generate an error message. ++ std::string ++ json_parser::yysyntax_error_ (int yystate, int tok) ++ { ++ std::string res; ++ YYUSE (yystate); ++#if YYERROR_VERBOSE ++ int yyn = yypact_[yystate]; ++ if (yypact_ninf_ < yyn && yyn <= yylast_) ++ { ++ /* Start YYX at -YYN if negative to avoid negative indexes in ++ YYCHECK. */ ++ int yyxbegin = yyn < 0 ? -yyn : 0; ++ ++ /* Stay within bounds of both yycheck and yytname. */ ++ int yychecklim = yylast_ - yyn + 1; ++ int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; ++ int count = 0; ++ for (int x = yyxbegin; x < yyxend; ++x) ++ if (yycheck_[x + yyn] == x && x != yyterror_) ++ ++count; ++ ++ // FIXME: This method of building the message is not compatible ++ // with internationalization. It should work like yacc.c does it. ++ // That is, first build a string that looks like this: ++ // "syntax error, unexpected %s or %s or %s" ++ // Then, invoke YY_ on this string. ++ // Finally, use the string as a format to output ++ // yytname_[tok], etc. ++ // Until this gets fixed, this message appears in English only. ++ res = "syntax error, unexpected "; ++ res += yytnamerr_ (yytname_[tok]); ++ if (count < 5) ++ { ++ count = 0; ++ for (int x = yyxbegin; x < yyxend; ++x) ++ if (yycheck_[x + yyn] == x && x != yyterror_) ++ { ++ res += (!count++) ? ", expecting " : " or "; ++ res += yytnamerr_ (yytname_[x]); ++ } ++ } ++ } ++ else ++#endif ++ res = YY_("syntax error"); ++ return res; ++ } ++ ++ ++ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing ++ STATE-NUM. */ ++ const signed char json_parser::yypact_ninf_ = -18; ++ const signed char ++ json_parser::yypact_[] = ++ { ++ 5, -18, -18, 1, -2, 19, -18, -18, -18, 2, ++ 20, 17, 21, 16, 18, -18, -18, -18, -18, -18, ++ 24, 23, -18, -8, -18, -18, -18, 15, -18, 1, ++ -18, -2, 18, 18, -18, -18, -2, -18, 18, 18, ++ 22, -18, -18, 17, -18, -18, -18, 23, -18, -18, ++ -18, -18, -18 ++ }; ++ ++ /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE ++ doesn't specify something else to do. Zero means the default is an ++ error. */ ++ const unsigned char ++ json_parser::yydefact_[] = ++ { ++ 0, 6, 5, 8, 14, 0, 2, 3, 4, 36, ++ 0, 10, 0, 0, 31, 22, 23, 24, 20, 21, ++ 0, 16, 19, 25, 18, 1, 37, 0, 7, 0, ++ 9, 0, 31, 31, 29, 13, 0, 15, 31, 31, ++ 26, 27, 35, 10, 12, 30, 32, 16, 33, 34, ++ 28, 11, 17 ++ }; ++ ++ /* YYPGOTO[NTERM-NUM]. */ ++ const signed char ++ json_parser::yypgoto_[] = ++ { ++ -18, -18, -18, 33, -18, -7, 6, 37, -18, -9, ++ -13, -18, -18, -17, -18, -1, -3, -18 ++ }; ++ ++ /* YYDEFGOTO[NTERM-NUM]. */ ++ const signed char ++ json_parser::yydefgoto_[] = ++ { ++ -1, 5, 6, 18, 10, 30, 11, 19, 20, 37, ++ 21, 22, 23, 34, 40, 41, 24, 27 ++ }; ++ ++ /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If ++ positive, shift that token. If negative, reduce the rule which ++ number is the opposite. If zero, do what YYDEFACT says. */ ++ const signed char json_parser::yytable_ninf_ = -1; ++ const unsigned char ++ json_parser::yytable_[] = ++ { ++ 12, 3, 38, 4, 39, 1, 2, 13, 3, 14, ++ 4, 15, 16, 17, 9, 45, 46, 9, 44, 25, ++ 26, 48, 49, 47, 28, 29, 12, 32, 31, 33, ++ 35, 36, 42, 7, 39, 43, 51, 8, 52, 50 ++ }; ++ ++ /* YYCHECK. */ ++ const unsigned char ++ json_parser::yycheck_[] = ++ { ++ 3, 3, 10, 5, 12, 0, 1, 9, 3, 11, ++ 5, 13, 14, 15, 16, 32, 33, 16, 31, 0, ++ 18, 38, 39, 36, 4, 8, 29, 11, 7, 11, ++ 6, 8, 17, 0, 12, 29, 43, 0, 47, 40 ++ }; ++ ++ /* STOS_[STATE-NUM] -- The (internal number of the) accessing ++ symbol of state STATE-NUM. */ ++ const unsigned char ++ json_parser::yystos_[] = ++ { ++ 0, 0, 1, 3, 5, 20, 21, 22, 26, 16, ++ 23, 25, 35, 9, 11, 13, 14, 15, 22, 26, ++ 27, 29, 30, 31, 35, 0, 18, 36, 4, 8, ++ 24, 7, 11, 11, 32, 6, 8, 28, 10, 12, ++ 33, 34, 17, 25, 29, 32, 32, 29, 32, 32, ++ 34, 24, 28 ++ }; ++ ++#if YYDEBUG ++ /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding ++ to YYLEX-NUM. */ ++ const unsigned short int ++ json_parser::yytoken_number_[] = ++ { ++ 0, 256, 257, 1, 2, 3, 4, 5, 6, 7, ++ 8, 9, 10, 11, 12, 13, 14, 15, 16 ++ }; ++#endif ++ ++ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ ++ const unsigned char ++ json_parser::yyr1_[] = ++ { ++ 0, 19, 20, 21, 21, 21, 21, 22, 23, 23, ++ 24, 24, 25, 26, 27, 27, 28, 28, 29, 29, ++ 29, 29, 29, 29, 29, 30, 30, 30, 30, 31, ++ 31, 32, 32, 33, 34, 35, 36, 36 ++ }; ++ ++ /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ ++ const unsigned char ++ json_parser::yyr2_[] = ++ { ++ 0, 2, 1, 1, 1, 1, 1, 3, 0, 2, ++ 0, 3, 3, 3, 0, 2, 0, 3, 1, 1, ++ 1, 1, 1, 1, 1, 1, 2, 2, 3, 2, ++ 3, 0, 2, 2, 2, 3, 0, 1 ++ }; ++ ++#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE ++ /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. ++ First, the terminals, then, starting at \a yyntokens_, nonterminals. */ ++ const char* ++ const json_parser::yytname_[] = ++ { ++ "\"end of file\"", "error", "$undefined", "\"{\"", "\"}\"", "\"[\"", ++ "\"]\"", "\":\"", "\",\"", "\"-\"", "\".\"", "\"digit\"", ++ "\"exponential\"", "\"true\"", "\"false\"", "\"null\"", ++ "\"open quotation mark\"", "\"close quotation mark\"", "\"string\"", ++ "$accept", "start", "data", "object", "members", "r_members", "pair", ++ "array", "values", "r_values", "value", "number", "int", "digits", ++ "fract", "exp", "string", "string_arg", 0 ++ }; ++#endif ++ ++#if YYDEBUG ++ /* YYRHS -- A `-1'-separated list of the rules' RHS. */ ++ const json_parser::rhs_number_type ++ json_parser::yyrhs_[] = ++ { ++ 20, 0, -1, 21, -1, 22, -1, 26, -1, 1, ++ -1, 0, -1, 3, 23, 4, -1, -1, 25, 24, ++ -1, -1, 8, 25, 24, -1, 35, 7, 29, -1, ++ 5, 27, 6, -1, -1, 29, 28, -1, -1, 8, ++ 29, 28, -1, 35, -1, 30, -1, 22, -1, 26, ++ -1, 13, -1, 14, -1, 15, -1, 31, -1, 31, ++ 33, -1, 31, 34, -1, 31, 33, 34, -1, 11, ++ 32, -1, 9, 11, 32, -1, -1, 11, 32, -1, ++ 10, 32, -1, 12, 32, -1, 16, 36, 17, -1, ++ -1, 18, -1 ++ }; ++ ++ /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in ++ YYRHS. */ ++ const unsigned char ++ json_parser::yyprhs_[] = ++ { ++ 0, 0, 3, 5, 7, 9, 11, 13, 17, 18, ++ 21, 22, 26, 30, 34, 35, 38, 39, 43, 45, ++ 47, 49, 51, 53, 55, 57, 59, 62, 65, 69, ++ 72, 76, 77, 80, 83, 86, 90, 91 ++ }; ++ ++ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ ++ const unsigned char ++ json_parser::yyrline_[] = ++ { ++ 0, 80, 80, 85, 86, 87, 93, 95, 97, 98, ++ 104, 105, 111, 117, 119, 120, 127, 128, 135, 136, ++ 137, 138, 139, 140, 141, 146, 156, 161, 162, 167, ++ 168, 170, 171, 175, 179, 181, 183, 184 ++ }; ++ ++ // Print the state stack on the debug stream. ++ void ++ json_parser::yystack_print_ () ++ { ++ *yycdebug_ << "Stack now"; ++ for (state_stack_type::const_iterator i = yystate_stack_.begin (); ++ i != yystate_stack_.end (); ++i) ++ *yycdebug_ << ' ' << *i; ++ *yycdebug_ << std::endl; ++ } ++ ++ // Report on the debug stream that the rule \a yyrule is going to be reduced. ++ void ++ json_parser::yy_reduce_print_ (int yyrule) ++ { ++ unsigned int yylno = yyrline_[yyrule]; ++ int yynrhs = yyr2_[yyrule]; ++ /* Print the symbols being reduced, and their result. */ ++ *yycdebug_ << "Reducing stack by rule " << yyrule - 1 ++ << " (line " << yylno << "), "; ++ /* The symbols being reduced. */ ++ for (int yyi = 0; yyi < yynrhs; yyi++) ++ YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", ++ yyrhs_[yyprhs_[yyrule] + yyi], ++ &(yysemantic_stack_[(yynrhs) - (yyi + 1)]), ++ &(yylocation_stack_[(yynrhs) - (yyi + 1)])); ++ } ++#endif // YYDEBUG ++ ++ /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ ++ json_parser::token_number_type ++ json_parser::yytranslate_ (int t) ++ { ++ static ++ const token_number_type ++ translate_table[] = ++ { ++ 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, ++ 12, 13, 14, 15, 16, 17, 18, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 1, 2 ++ }; ++ if ((unsigned int) t <= yyuser_token_number_max_) ++ return translate_table[t]; ++ else ++ return yyundef_token_; ++ } ++ ++ const int json_parser::yyeof_ = 0; ++ const int json_parser::yylast_ = 39; ++ const int json_parser::yynnts_ = 18; ++ const int json_parser::yyempty_ = -2; ++ const int json_parser::yyfinal_ = 25; ++ const int json_parser::yyterror_ = 1; ++ const int json_parser::yyerrcode_ = 256; ++ const int json_parser::yyntokens_ = 19; ++ ++ const unsigned int json_parser::yyuser_token_number_max_ = 257; ++ const json_parser::token_number_type json_parser::yyundef_token_ = 2; ++ ++} // namespace yy ++ ++#line 188 "json_parser.yy" ++ ++ ++int yy::yylex(YYSTYPE *yylval, yy::location *yylloc, QJson::ParserPrivate* driver) ++{ ++ JSonScanner* scanner = driver->m_scanner; ++ yylval->clear(); ++ int ret = scanner->yylex(yylval, yylloc); ++ ++ qjsonDebug() << "json_parser::yylex - calling scanner yylval==|" ++ << yylval->toByteArray() << "|, ret==|" << QString::number(ret) << "|"; ++ ++ return ret; ++} ++ ++void yy::json_parser::error (const yy::location& yyloc, ++ const std::string& error) ++{ ++ /*qjsonDebug() << yyloc.begin.line; ++ qjsonDebug() << yyloc.begin.column; ++ qjsonDebug() << yyloc.end.line; ++ qjsonDebug() << yyloc.end.column;*/ ++ qjsonDebug() << "json_parser::error [line" << yyloc.end.line << "] -" << error.c_str() ; ++ driver->setError(QString::fromLatin1(error.c_str()), yyloc.end.line); ++} ++ +diff --git a/WebCore/platform/graphics/embedded/qjson/json_parser.hh b/WebCore/platform/graphics/embedded/qjson/json_parser.hh +new file mode 100644 +index 0000000..673923d +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/json_parser.hh +@@ -0,0 +1,321 @@ ++/* A Bison parser, made by GNU Bison 2.3. */ ++ ++/* Skeleton interface for Bison LALR(1) parsers in C++ ++ ++ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. */ ++ ++/* As a special exception, you may create a larger work that contains ++ part or all of the Bison parser skeleton and distribute that work ++ under terms of your choice, so long as that work isn't itself a ++ parser generator using the skeleton or a modified version thereof ++ as a parser skeleton. Alternatively, if you modify or redistribute ++ the parser skeleton itself, you may (at your option) remove this ++ special exception, which will cause the skeleton and the resulting ++ Bison output files to be licensed under the GNU General Public ++ License without this special exception. ++ ++ This special exception was added by the Free Software Foundation in ++ version 2.2 of Bison. */ ++ ++/* C++ LALR(1) parser skeleton written by Akim Demaille. */ ++ ++#ifndef PARSER_HEADER_H ++# define PARSER_HEADER_H ++ ++#include ++#include ++#include "stack.hh" ++ ++namespace yy ++{ ++ class position; ++ class location; ++} ++ ++/* First part of user declarations. */ ++#line 25 "json_parser.yy" ++ ++ #include "parser_p.h" ++ #include "json_scanner.h" ++ #include "qjson_debug.h" ++ ++ #include ++ #include ++ #include ++ #include ++ ++ class JSonScanner; ++ ++ namespace QJson { ++ class Parser; ++ } ++ ++ #define YYERROR_VERBOSE 1 ++ ++ ++/* Line 303 of lalr1.cc. */ ++#line 73 "json_parser.hh" ++ ++#include "location.hh" ++ ++/* Enabling traces. */ ++#ifndef YYDEBUG ++# define YYDEBUG 1 ++#endif ++ ++/* Enabling verbose error messages. */ ++#ifdef YYERROR_VERBOSE ++# undef YYERROR_VERBOSE ++# define YYERROR_VERBOSE 1 ++#else ++# define YYERROR_VERBOSE 1 ++#endif ++ ++/* Enabling the token table. */ ++#ifndef YYTOKEN_TABLE ++# define YYTOKEN_TABLE 0 ++#endif ++ ++/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. ++ If N is 0, then set CURRENT to the empty location which ends ++ the previous symbol: RHS[0] (always defined). */ ++ ++#ifndef YYLLOC_DEFAULT ++# define YYLLOC_DEFAULT(Current, Rhs, N) \ ++do { \ ++ if (N) \ ++ { \ ++ (Current).begin = (Rhs)[1].begin; \ ++ (Current).end = (Rhs)[N].end; \ ++ } \ ++ else \ ++ { \ ++ (Current).begin = (Current).end = (Rhs)[0].end; \ ++ } \ ++} while (false) ++#endif ++ ++namespace yy ++{ ++ ++ /// A Bison parser. ++ class json_parser ++ { ++ public: ++ /// Symbol semantic values. ++#ifndef YYSTYPE ++ typedef int semantic_type; ++#else ++ typedef YYSTYPE semantic_type; ++#endif ++ /// Symbol locations. ++ typedef location location_type; ++ /// Tokens. ++ struct token ++ { ++ /* Tokens. */ ++ enum yytokentype { ++ END = 0, ++ CURLY_BRACKET_OPEN = 1, ++ CURLY_BRACKET_CLOSE = 2, ++ SQUARE_BRACKET_OPEN = 3, ++ SQUARE_BRACKET_CLOSE = 4, ++ COLON = 5, ++ COMMA = 6, ++ MINUS = 7, ++ DOT = 8, ++ DIGIT = 9, ++ E = 10, ++ TRUE_VAL = 11, ++ FALSE_VAL = 12, ++ NULL_VAL = 13, ++ QUOTMARKOPEN = 14, ++ QUOTMARKCLOSE = 15, ++ STRING = 16 ++ }; ++ ++ }; ++ /// Token type. ++ typedef token::yytokentype token_type; ++ ++ /// Build a parser object. ++ json_parser (QJson::ParserPrivate* driver_yyarg); ++ virtual ~json_parser (); ++ ++ /// Parse. ++ /// \returns 0 iff parsing succeeded. ++ virtual int parse (); ++ ++ /// The current debugging stream. ++ std::ostream& debug_stream () const; ++ /// Set the current debugging stream. ++ void set_debug_stream (std::ostream &); ++ ++ /// Type for debugging levels. ++ typedef int debug_level_type; ++ /// The current debugging level. ++ debug_level_type debug_level () const; ++ /// Set the current debugging level. ++ void set_debug_level (debug_level_type l); ++ ++ private: ++ /// Report a syntax error. ++ /// \param loc where the syntax error is found. ++ /// \param msg a description of the syntax error. ++ virtual void error (const location_type& loc, const std::string& msg); ++ ++ /// Generate an error message. ++ /// \param state the state where the error occurred. ++ /// \param tok the look-ahead token. ++ virtual std::string yysyntax_error_ (int yystate, int tok); ++ ++#if YYDEBUG ++ /// \brief Report a symbol value on the debug stream. ++ /// \param yytype The token type. ++ /// \param yyvaluep Its semantic value. ++ /// \param yylocationp Its location. ++ virtual void yy_symbol_value_print_ (int yytype, ++ const semantic_type* yyvaluep, ++ const location_type* yylocationp); ++ /// \brief Report a symbol on the debug stream. ++ /// \param yytype The token type. ++ /// \param yyvaluep Its semantic value. ++ /// \param yylocationp Its location. ++ virtual void yy_symbol_print_ (int yytype, ++ const semantic_type* yyvaluep, ++ const location_type* yylocationp); ++#endif /* ! YYDEBUG */ ++ ++ ++ /// State numbers. ++ typedef int state_type; ++ /// State stack type. ++ typedef stack state_stack_type; ++ /// Semantic value stack type. ++ typedef stack semantic_stack_type; ++ /// location stack type. ++ typedef stack location_stack_type; ++ ++ /// The state stack. ++ state_stack_type yystate_stack_; ++ /// The semantic value stack. ++ semantic_stack_type yysemantic_stack_; ++ /// The location stack. ++ location_stack_type yylocation_stack_; ++ ++ /// Internal symbol numbers. ++ typedef unsigned char token_number_type; ++ /* Tables. */ ++ /// For a state, the index in \a yytable_ of its portion. ++ static const signed char yypact_[]; ++ static const signed char yypact_ninf_; ++ ++ /// For a state, default rule to reduce. ++ /// Unless\a yytable_ specifies something else to do. ++ /// Zero means the default is an error. ++ static const unsigned char yydefact_[]; ++ ++ static const signed char yypgoto_[]; ++ static const signed char yydefgoto_[]; ++ ++ /// What to do in a state. ++ /// \a yytable_[yypact_[s]]: what to do in state \a s. ++ /// - if positive, shift that token. ++ /// - if negative, reduce the rule which number is the opposite. ++ /// - if zero, do what YYDEFACT says. ++ static const unsigned char yytable_[]; ++ static const signed char yytable_ninf_; ++ ++ static const unsigned char yycheck_[]; ++ ++ /// For a state, its accessing symbol. ++ static const unsigned char yystos_[]; ++ ++ /// For a rule, its LHS. ++ static const unsigned char yyr1_[]; ++ /// For a rule, its RHS length. ++ static const unsigned char yyr2_[]; ++ ++#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE ++ /// For a symbol, its name in clear. ++ static const char* const yytname_[]; ++#endif ++ ++#if YYERROR_VERBOSE ++ /// Convert the symbol name \a n to a form suitable for a diagnostic. ++ virtual std::string yytnamerr_ (const char *n); ++#endif ++ ++#if YYDEBUG ++ /// A type to store symbol numbers and -1. ++ typedef signed char rhs_number_type; ++ /// A `-1'-separated list of the rules' RHS. ++ static const rhs_number_type yyrhs_[]; ++ /// For each rule, the index of the first RHS symbol in \a yyrhs_. ++ static const unsigned char yyprhs_[]; ++ /// For each rule, its source line number. ++ static const unsigned char yyrline_[]; ++ /// For each scanner token number, its symbol number. ++ static const unsigned short int yytoken_number_[]; ++ /// Report on the debug stream that the rule \a r is going to be reduced. ++ virtual void yy_reduce_print_ (int r); ++ /// Print the state stack on the debug stream. ++ virtual void yystack_print_ (); ++#endif ++ ++ /// Convert a scanner token number \a t to a symbol number. ++ token_number_type yytranslate_ (int t); ++ ++ /// \brief Reclaim the memory associated to a symbol. ++ /// \param yymsg Why this token is reclaimed. ++ /// \param yytype The symbol type. ++ /// \param yyvaluep Its semantic value. ++ /// \param yylocationp Its location. ++ inline void yydestruct_ (const char* yymsg, ++ int yytype, ++ semantic_type* yyvaluep, ++ location_type* yylocationp); ++ ++ /// Pop \a n symbols the three stacks. ++ inline void yypop_ (unsigned int n = 1); ++ ++ /* Constants. */ ++ static const int yyeof_; ++ /* LAST_ -- Last index in TABLE_. */ ++ static const int yylast_; ++ static const int yynnts_; ++ static const int yyempty_; ++ static const int yyfinal_; ++ static const int yyterror_; ++ static const int yyerrcode_; ++ static const int yyntokens_; ++ static const unsigned int yyuser_token_number_max_; ++ static const token_number_type yyundef_token_; ++ ++ /* Debugging. */ ++ int yydebug_; ++ std::ostream* yycdebug_; ++ ++ ++ /* User arguments. */ ++ QJson::ParserPrivate* driver; ++ }; ++} ++ ++ ++#endif /* ! defined PARSER_HEADER_H */ +diff --git a/WebCore/platform/graphics/embedded/qjson/json_parser.yy b/WebCore/platform/graphics/embedded/qjson/json_parser.yy +new file mode 100644 +index 0000000..ad8e105 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/json_parser.yy +@@ -0,0 +1,211 @@ ++/* This file is part of QJSon ++ * ++ * Copyright (C) 2008 Flavio Castelli ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++%skeleton "lalr1.cc" ++%defines ++%define "parser_class_name" "json_parser" ++ ++%{ ++ #include "parser_p.h" ++ #include "json_scanner.h" ++ #include "qjson_debug.h" ++ ++ #include ++ #include ++ #include ++ #include ++ ++ class JSonScanner; ++ ++ namespace QJson { ++ class Parser; ++ } ++ ++ #define YYERROR_VERBOSE 1 ++%} ++ ++%parse-param { QJson::ParserPrivate* driver } ++%lex-param { QJson::ParserPrivate* driver } ++ ++%locations ++ ++%debug ++%error-verbose ++ ++%token END 0 "end of file" ++ ++%token CURLY_BRACKET_OPEN 1 "{" ++%token CURLY_BRACKET_CLOSE 2 "}" ++%token SQUARE_BRACKET_OPEN 3 "[" ++%token SQUARE_BRACKET_CLOSE 4 "]" ++ ++%token COLON 5 ":" ++%token COMMA 6 "," ++%token MINUS 7 "-" ++%token DOT 8 "." ++%token DIGIT 9 "digit" ++%token E 10 "exponential" ++%token TRUE_VAL 11 "true" ++%token FALSE_VAL 12 "false" ++%token NULL_VAL 13 "null" ++%token QUOTMARKOPEN 14 "open quotation mark" ++%token QUOTMARKCLOSE 15 "close quotation mark" ++ ++%token STRING 16 "string" ++ ++// define the initial token ++%start start ++ ++%% ++ ++// grammar rules ++ ++start: data { ++ driver->m_result = $1; ++ qjsonDebug() << "json_parser - parsing finished"; ++ }; ++ ++data: object {$$ = $1; } ++ | array {$$ = $1; } ++ | error ++ { ++ qCritical()<< "json_parser - syntax error found, " ++ << "forcing abort"; ++ YYABORT; ++ } ++ | END; ++ ++object: CURLY_BRACKET_OPEN members CURLY_BRACKET_CLOSE { $$ = $2; }; ++ ++members: /* empty */ { $$ = QVariant (QVariantMap()); } ++ | pair r_members { ++ QVariantMap members = $2.toMap(); ++ $2 = QVariant(); // Allow reuse of map ++ $$ = QVariant(members.unite ($1.toMap())); ++ }; ++ ++r_members: /* empty */ { $$ = QVariant (QVariantMap()); } ++ | COMMA pair r_members { ++ QVariantMap members = $3.toMap(); ++ $3 = QVariant(); // Allow reuse of map ++ $$ = QVariant(members.unite ($2.toMap())); ++ }; ++ ++pair: string COLON value { ++ QVariantMap pair; ++ pair.insert ($1.toString(), QVariant($3)); ++ $$ = QVariant (pair); ++ }; ++ ++array: SQUARE_BRACKET_OPEN values SQUARE_BRACKET_CLOSE { $$ = $2; }; ++ ++values: /* empty */ { $$ = QVariant (QVariantList()); } ++ | value r_values { ++ QVariantList members = $2.toList(); ++ $2 = QVariant(); // Allow reuse of list ++ members.prepend ($1); ++ $$ = QVariant(members); ++ }; ++ ++r_values: /* empty */ { $$ = QVariant (QVariantList()); } ++ | COMMA value r_values { ++ QVariantList members = $3.toList(); ++ $3 = QVariant(); // Allow reuse of list ++ members.prepend ($2); ++ $$ = QVariant(members); ++ }; ++ ++value: string { $$ = $1; } ++ | number { $$ = $1; } ++ | object { $$ = $1; } ++ | array { $$ = $1; } ++ | TRUE_VAL { $$ = QVariant (true); } ++ | FALSE_VAL { $$ = QVariant (false); } ++ | NULL_VAL { ++ QVariant null_variant; ++ $$ = null_variant; ++ }; ++ ++number: int { ++ if ($1.toByteArray().startsWith('-')) { ++ $$ = QVariant (QVariant::LongLong); ++ $$.setValue($1.toLongLong()); ++ } ++ else { ++ $$ = QVariant (QVariant::ULongLong); ++ $$.setValue($1.toULongLong()); ++ } ++ } ++ | int fract { ++ const QByteArray value = $1.toByteArray() + $2.toByteArray(); ++ $$ = QVariant(QVariant::Double); ++ $$.setValue(value.toDouble()); ++ } ++ | int exp { $$ = QVariant ($1.toByteArray() + $2.toByteArray()); } ++ | int fract exp { ++ const QByteArray value = $1.toByteArray() + $2.toByteArray() + $3.toByteArray(); ++ $$ = QVariant (value); ++ }; ++ ++int: DIGIT digits { $$ = QVariant ($1.toByteArray() + $2.toByteArray()); } ++ | MINUS DIGIT digits { $$ = QVariant (QByteArray("-") + $2.toByteArray() + $3.toByteArray()); }; ++ ++digits: /* empty */ { $$ = QVariant (QByteArray("")); } ++ | DIGIT digits { ++ $$ = QVariant($1.toByteArray() + $2.toByteArray()); ++ }; ++ ++fract: DOT digits { ++ $$ = QVariant(QByteArray(".") + $2.toByteArray()); ++ }; ++ ++exp: E digits { $$ = QVariant($1.toByteArray() + $2.toByteArray()); }; ++ ++string: QUOTMARKOPEN string_arg QUOTMARKCLOSE { $$ = $2; }; ++ ++string_arg: /*empty */ { $$ = QVariant (QString(QLatin1String(""))); } ++ | STRING { ++ $$ = $1; ++ }; ++ ++%% ++ ++int yy::yylex(YYSTYPE *yylval, yy::location *yylloc, QJson::ParserPrivate* driver) ++{ ++ JSonScanner* scanner = driver->m_scanner; ++ yylval->clear(); ++ int ret = scanner->yylex(yylval, yylloc); ++ ++ qjsonDebug() << "json_parser::yylex - calling scanner yylval==|" ++ << yylval->toByteArray() << "|, ret==|" << QString::number(ret) << "|"; ++ ++ return ret; ++} ++ ++void yy::json_parser::error (const yy::location& yyloc, ++ const std::string& error) ++{ ++ /*qjsonDebug() << yyloc.begin.line; ++ qjsonDebug() << yyloc.begin.column; ++ qjsonDebug() << yyloc.end.line; ++ qjsonDebug() << yyloc.end.column;*/ ++ qjsonDebug() << "json_parser::error [line" << yyloc.end.line << "] -" << error.c_str() ; ++ driver->setError(QString::fromLatin1(error.c_str()), yyloc.end.line); ++} +diff --git a/WebCore/platform/graphics/embedded/qjson/json_scanner.cpp b/WebCore/platform/graphics/embedded/qjson/json_scanner.cpp +new file mode 100644 +index 0000000..7f7b88f +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/json_scanner.cpp +@@ -0,0 +1,329 @@ ++/* This file is part of QJson ++ * ++ * Copyright (C) 2008 Flavio Castelli ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#include "qjson_debug.h" ++#include "json_scanner.h" ++#include "json_parser.hh" ++ ++#include ++ ++#include ++#include ++ ++#include ++ ++bool ishexnstring(const QString& string) { ++ for (int i = 0; i < string.length(); i++) { ++ if (isxdigit(string[i] == 0)) ++ return false; ++ } ++ return true; ++} ++ ++JSonScanner::JSonScanner(QIODevice* io) ++ : m_io (io) ++{ ++ m_quotmarkClosed = true; ++ m_quotmarkCount = 0; ++} ++ ++static QString unescape( const QByteArray& ba, bool* ok ) { ++ assert( ok ); ++ *ok = false; ++ QString res; ++ QByteArray seg; ++ bool bs = false; ++ for ( int i = 0, size = ba.size(); i < size; ++i ) { ++ const char ch = ba[i]; ++ if ( !bs ) { ++ if ( ch == '\\' ) ++ bs = true; ++ else ++ seg += ch; ++ } else { ++ bs = false; ++ switch ( ch ) { ++ case 'b': ++ seg += '\b'; ++ break; ++ case 'f': ++ seg += '\f'; ++ break; ++ case 'n': ++ seg += '\n'; ++ break; ++ case 'r': ++ seg += '\r'; ++ break; ++ case 't': ++ seg += '\t'; ++ break; ++ case 'u': ++ { ++ res += QString::fromUtf8( seg ); ++ seg.clear(); ++ ++ if ( i > size - 5 ) { ++ //error ++ return QString(); ++ } ++ ++ const QString hex_digit1 = QString::fromUtf8( ba.mid( i + 1, 2 ) ); ++ const QString hex_digit2 = QString::fromUtf8( ba.mid( i + 3, 2 ) ); ++ i += 4; ++ ++ if ( !ishexnstring( hex_digit1 ) || !ishexnstring( hex_digit2 ) ) { ++ qCritical() << "Not an hex string:" << hex_digit1 << hex_digit2; ++ return QString(); ++ } ++ bool hexOk; ++ const ushort hex_code1 = hex_digit1.toShort( &hexOk, 16 ); ++ if (!hexOk) { ++ qCritical() << "error converting hex value to short:" << hex_digit1; ++ return QString(); ++ } ++ const ushort hex_code2 = hex_digit2.toShort( &hexOk, 16 ); ++ if (!hexOk) { ++ qCritical() << "error converting hex value to short:" << hex_digit2; ++ return QString(); ++ } ++ ++ res += QChar(hex_code2, hex_code1); ++ break; ++ } ++ case '\\': ++ seg += '\\'; ++ break; ++ default: ++ seg += ch; ++ break; ++ } ++ } ++ } ++ res += QString::fromUtf8( seg ); ++ *ok = true; ++ return res; ++} ++ ++int JSonScanner::yylex(YYSTYPE* yylval, yy::location *yylloc) ++{ ++ char ch; ++ ++ if (!m_io->isOpen()) { ++ qCritical() << "JSonScanner::yylex - io device is not open"; ++ return -1; ++ } ++ ++ yylloc->step(); ++ ++ do { ++ bool ret; ++ if (m_io->atEnd()) { ++ qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::END"; ++ return yy::json_parser::token::END; ++ } ++ else ++ ret = m_io->getChar(&ch); ++ ++ if (!ret) { ++ qCritical() << "JSonScanner::yylex - error reading from io device"; ++ return -1; ++ } ++ ++ qjsonDebug() << "JSonScanner::yylex - got |" << ch << "|"; ++ ++ yylloc->columns(); ++ ++ if (ch == '\n' || ch == '\r') ++ yylloc->lines(); ++ ++ } while (m_quotmarkClosed && (isspace(ch) != 0)); ++ ++ if (m_quotmarkClosed && ((ch == 't') || (ch == 'T') ++ || (ch == 'n') || (ch == 'N'))) { ++ // check true & null value ++ const QByteArray buf = m_io->peek(3).toLower(); ++ ++ if (buf.length() == 3) { ++ if (buf == "rue") { ++ m_io->read (3); ++ yylloc->columns(3); ++ qjsonDebug() << "JSonScanner::yylex - TRUE_VAL"; ++ return yy::json_parser::token::TRUE_VAL; ++ } ++ else if (buf == "ull") { ++ m_io->read (3); ++ yylloc->columns(3); ++ qjsonDebug() << "JSonScanner::yylex - NULL_VAL"; ++ return yy::json_parser::token::NULL_VAL; ++ } ++ } ++ } ++ else if (m_quotmarkClosed && ((ch == 'f') || (ch == 'F'))) { ++ // check false value ++ const QByteArray buf = m_io->peek(4).toLower(); ++ if (buf.length() == 4) { ++ if (buf == "alse") { ++ m_io->read (4); ++ yylloc->columns(4); ++ qjsonDebug() << "JSonScanner::yylex - FALSE_VAL"; ++ return yy::json_parser::token::FALSE_VAL; ++ } ++ } ++ } ++ else if (m_quotmarkClosed && ((ch == 'e') || (ch == 'E'))) { ++ QByteArray ret(1, ch); ++ const QByteArray buf = m_io->peek(1); ++ if (!buf.isEmpty()) { ++ if ((buf[0] == '+' ) || (buf[0] == '-' )) { ++ ret += m_io->read (1); ++ yylloc->columns(); ++ } ++ } ++ *yylval = QVariant(QString::fromUtf8(ret)); ++ return yy::json_parser::token::E; ++ } ++ ++ if (ch != '"' && !m_quotmarkClosed) { ++ // we're inside a " " block ++ QByteArray raw; ++ raw += ch; ++ char prevCh = ch; ++ bool escape_on = (ch == '\\') ? true : false; ++ ++ while ( true ) { ++ char nextCh; ++ qint64 ret = m_io->peek(&nextCh, 1); ++ if (ret != 1) { ++ if (m_io->atEnd()) ++ return yy::json_parser::token::END; ++ else ++ return -1; ++ } else if ( !escape_on && nextCh == '\"' ) { ++ bool ok; ++ const QString str = unescape( raw, &ok ); ++ *yylval = ok ? str : QString(); ++ return ok ? yy::json_parser::token::STRING : -1; ++ } ++#if 0 ++ if ( prevCh == '\\' && nextCh != '"' && nextCh != '\\' && nextCh != '/' && ++ nextCh != 'b' && nextCh != 'f' && nextCh != 'n' && ++ nextCh != 'r' && nextCh != 't' && nextCh != 'u') { ++ qjsonDebug() << "Just read" << nextCh; ++ qjsonDebug() << "JSonScanner::yylex - error decoding escaped sequence"; ++ return -1; ++ } ++#endif ++ m_io->read(1); // consume ++ raw += nextCh; ++ prevCh = nextCh; ++ if (escape_on) ++ escape_on = false; ++ else ++ escape_on = (prevCh == '\\') ? true : false; ++#if 0 ++ if (nextCh == '\\') { ++ char buf; ++ if (m_io->getChar (&buf)) { ++ yylloc->columns(); ++ if (((buf != '"') && (buf != '\\') && (buf != '/') && ++ (buf != 'b') && (buf != 'f') && (buf != 'n') && ++ (buf != 'r') && (buf != 't') && (buf != 'u'))) { ++ qjsonDebug() << "Just read" << buf; ++ qjsonDebug() << "JSonScanner::yylex - error decoding escaped sequence"; ++ return -1; ++ } ++ } else { ++ qCritical() << "JSonScanner::yylex - error decoding escaped sequence : io error"; ++ return -1; ++ } ++ } ++#endif ++ } ++ } ++ else if (isdigit(ch) != 0 && m_quotmarkClosed) { ++ *yylval = QVariant(QString::fromLatin1(QByteArray(&ch,1))); ++ qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::DIGIT"; ++ return yy::json_parser::token::DIGIT; ++ } ++ else if (isalnum(ch) != 0) { ++ *yylval = QVariant(QString(QChar::fromLatin1(ch))); ++ qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::WORD (" ++ << ch << ")"; ++ return yy::json_parser::token::STRING; ++ } ++ else if (ch == ':') { ++ // set yylval ++ qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::COLON"; ++ return yy::json_parser::token::COLON; ++ } ++ else if (ch == '"') { ++ // yy::json_parser::token::QUOTMARK (") ++ ++ // set yylval ++ m_quotmarkCount++; ++ if (m_quotmarkCount %2 == 0) { ++ m_quotmarkClosed = true; ++ m_quotmarkCount = 0; ++ qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::QUOTMARKCLOSE"; ++ return yy::json_parser::token::QUOTMARKCLOSE; ++ } ++ else { ++ m_quotmarkClosed = false; ++ qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::QUOTMARKOPEN"; ++ return yy::json_parser::token::QUOTMARKOPEN; ++ } ++ } ++ else if (ch == ',') { ++ qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::COMMA"; ++ return yy::json_parser::token::COMMA; ++ } ++ else if (ch == '.') { ++ qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::DOT"; ++ return yy::json_parser::token::DOT; ++ } ++ else if (ch == '-') { ++ qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::MINUS"; ++ return yy::json_parser::token::MINUS; ++ } ++ else if (ch == '[') { ++ qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::SQUARE_BRACKET_OPEN"; ++ return yy::json_parser::token::SQUARE_BRACKET_OPEN; ++ } ++ else if (ch == ']') { ++ qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::SQUARE_BRACKET_CLOSE"; ++ return yy::json_parser::token::SQUARE_BRACKET_CLOSE; ++ } ++ else if (ch == '{') { ++ qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::CURLY_BRACKET_OPEN"; ++ return yy::json_parser::token::CURLY_BRACKET_OPEN; ++ } ++ else if (ch == '}') { ++ qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::CURLY_BRACKET_CLOSE"; ++ return yy::json_parser::token::CURLY_BRACKET_CLOSE; ++ } ++ ++ //unknown char! ++ //TODO yyerror? ++ qCritical() << "JSonScanner::yylex - unknown char, returning -1"; ++ return -1; ++} ++ ++ +diff --git a/WebCore/platform/graphics/embedded/qjson/json_scanner.h b/WebCore/platform/graphics/embedded/qjson/json_scanner.h +new file mode 100644 +index 0000000..593426b +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/json_scanner.h +@@ -0,0 +1,52 @@ ++/* This file is part of QJson ++ * ++ * Copyright (C) 2008 Flavio Castelli ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#ifndef _JSON_SCANNER ++#define _JSON_SCANNER ++ ++#include ++#include ++ ++#include ++#include ++ ++#define YYSTYPE QVariant ++ ++#include "parser_p.h" ++ ++namespace yy { ++ class location; ++ int yylex(YYSTYPE *yylval, yy::location *yylloc, QJson::ParserPrivate* driver); ++} ++ ++class JSonScanner ++{ ++ public: ++ explicit JSonScanner(QIODevice* io); ++ int yylex(YYSTYPE* yylval, yy::location *yylloc); ++ ++ protected: ++ bool m_quotmarkClosed; ++ unsigned int m_quotmarkCount; ++ QIODevice* m_io; ++}; ++ ++#endif ++ +diff --git a/WebCore/platform/graphics/embedded/qjson/location.hh b/WebCore/platform/graphics/embedded/qjson/location.hh +new file mode 100644 +index 0000000..485fd77 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/location.hh +@@ -0,0 +1,145 @@ ++/* A Bison parser, made by GNU Bison 2.3. */ ++ ++/* Locations for Bison parsers in C++ ++ ++ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. */ ++ ++/* As a special exception, you may create a larger work that contains ++ part or all of the Bison parser skeleton and distribute that work ++ under terms of your choice, so long as that work isn't itself a ++ parser generator using the skeleton or a modified version thereof ++ as a parser skeleton. Alternatively, if you modify or redistribute ++ the parser skeleton itself, you may (at your option) remove this ++ special exception, which will cause the skeleton and the resulting ++ Bison output files to be licensed under the GNU General Public ++ License without this special exception. ++ ++ This special exception was added by the Free Software Foundation in ++ version 2.2 of Bison. */ ++ ++/** ++ ** \file location.hh ++ ** Define the yy::location class. ++ */ ++ ++#ifndef BISON_LOCATION_HH ++# define BISON_LOCATION_HH ++ ++# include ++# include ++# include "position.hh" ++ ++namespace yy ++{ ++ ++ /// Abstract a location. ++ class location ++ { ++ public: ++ ++ /// Construct a location. ++ location () ++ : begin (), end () ++ { ++ } ++ ++ ++ /// Initialization. ++ inline void initialize (std::string* fn) ++ { ++ begin.initialize (fn); ++ end = begin; ++ } ++ ++ /** \name Line and Column related manipulators ++ ** \{ */ ++ public: ++ /// Reset initial location to final location. ++ inline void step () ++ { ++ begin = end; ++ } ++ ++ /// Extend the current location to the COUNT next columns. ++ inline void columns (unsigned int count = 1) ++ { ++ end += count; ++ } ++ ++ /// Extend the current location to the COUNT next lines. ++ inline void lines (unsigned int count = 1) ++ { ++ end.lines (count); ++ } ++ /** \} */ ++ ++ ++ public: ++ /// Beginning of the located region. ++ position begin; ++ /// End of the located region. ++ position end; ++ }; ++ ++ /// Join two location objects to create a location. ++ inline const location operator+ (const location& begin, const location& end) ++ { ++ location res = begin; ++ res.end = end.end; ++ return res; ++ } ++ ++ /// Add two location objects. ++ inline const location operator+ (const location& begin, unsigned int width) ++ { ++ location res = begin; ++ res.columns (width); ++ return res; ++ } ++ ++ /// Add and assign a location. ++ inline location& operator+= (location& res, unsigned int width) ++ { ++ res.columns (width); ++ return res; ++ } ++ ++ /** \brief Intercept output stream redirection. ++ ** \param ostr the destination output stream ++ ** \param loc a reference to the location to redirect ++ ** ++ ** Avoid duplicate information. ++ */ ++ inline std::ostream& operator<< (std::ostream& ostr, const location& loc) ++ { ++ position last = loc.end - 1; ++ ostr << loc.begin; ++ if (last.filename ++ && (!loc.begin.filename ++ || *loc.begin.filename != *last.filename)) ++ ostr << '-' << last; ++ else if (loc.begin.line != last.line) ++ ostr << '-' << last.line << '.' << last.column; ++ else if (loc.begin.column != last.column) ++ ostr << '-' << last.column; ++ return ostr; ++ } ++ ++} ++ ++#endif // not BISON_LOCATION_HH +diff --git a/WebCore/platform/graphics/embedded/qjson/parser.cpp b/WebCore/platform/graphics/embedded/qjson/parser.cpp +new file mode 100644 +index 0000000..3096d17 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/parser.cpp +@@ -0,0 +1,114 @@ ++/* This file is part of QJson ++ * ++ * Copyright (C) 2008 Flavio Castelli ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#include "parser.h" ++#include "parser_p.h" ++#include "json_parser.hh" ++#include "json_scanner.h" ++ ++#include ++#include ++#include ++#include ++ ++using namespace QJson; ++ ++ParserPrivate::ParserPrivate() : ++ m_scanner(0) ++ , m_negate(false) ++ , m_error(false) ++{ ++} ++ ++ParserPrivate::~ParserPrivate() ++{ ++ delete m_scanner; ++} ++ ++void ParserPrivate::setError(QString errorMsg, int errorLine) { ++ m_error = true; ++ m_errorMsg = errorMsg; ++ m_errorLine = errorLine; ++} ++ ++Parser::Parser() : ++ d(new ParserPrivate) ++{ ++} ++ ++Parser::~Parser() ++{ ++ delete d; ++} ++ ++QVariant Parser::parse (QIODevice* io, bool* ok) ++{ ++ d->m_errorMsg.clear(); ++ delete d->m_scanner; ++ d->m_scanner = 0; ++ ++ if (!io->isOpen()) { ++ if (!io->open(QIODevice::ReadOnly)) { ++ if (ok != 0) ++ *ok = false; ++ qCritical ("Error opening device"); ++ return QVariant(); ++ } ++ } ++ ++ if (!io->isReadable()) { ++ if (ok != 0) ++ *ok = false; ++ qCritical ("Device is not readable"); ++ io->close(); ++ return QVariant(); ++ } ++ ++ d->m_scanner = new JSonScanner (io); ++ yy::json_parser parser(d); ++ parser.parse(); ++ ++ delete d->m_scanner; ++ d->m_scanner = 0; ++ ++ if (ok != 0) ++ *ok = !d->m_error; ++ ++ io->close(); ++ return d->m_result; ++} ++ ++QVariant Parser::parse(const QByteArray& jsonString, bool* ok) { ++ QBuffer buffer; ++ buffer.open(QBuffer::ReadWrite); ++ buffer.write(jsonString); ++ buffer.seek(0); ++ return parse (&buffer, ok); ++} ++ ++QString Parser::errorString() const ++{ ++ return d->m_errorMsg; ++} ++ ++int Parser::errorLine() const ++{ ++ return d->m_errorLine; ++} +diff --git a/WebCore/platform/graphics/embedded/qjson/parser.h b/WebCore/platform/graphics/embedded/qjson/parser.h +new file mode 100644 +index 0000000..8d323cd +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/parser.h +@@ -0,0 +1,80 @@ ++/* This file is part of QJson ++ * ++ * Copyright (C) 2008 Flavio Castelli ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#ifndef QJSON_PARSER_H ++#define QJSON_PARSER_H ++ ++#include "qjson_export.h" ++ ++class QIODevice; ++class QVariant; ++ ++namespace QJson { ++ ++ class ParserPrivate; ++ ++ /** ++ * @brief Main class used to convert JSON data to QVariant objects ++ */ ++ class QJSON_EXPORT Parser ++ { ++ public: ++ Parser(); ++ ~Parser(); ++ ++ /** ++ * Read JSON string from the I/O Device and converts it to a QVariant object ++ * @param io Input output device ++ * @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true. ++ * @returns a QVariant object generated from the JSON string ++ */ ++ QVariant parse(QIODevice* io, bool* ok = 0); ++ ++ /** ++ * This is a method provided for convenience. ++ * @param jsonData data containing the JSON object representation ++ * @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true. ++ * @returns a QVariant object generated from the JSON string ++ * @sa errorString ++ * @sa errorLine ++ */ ++ QVariant parse(const QByteArray& jsonData, bool* ok = 0); ++ ++ /** ++ * This method returns the error message ++ * @returns a QString object containing the error message of the last parse operation ++ * @sa errorLine ++ */ ++ QString errorString() const; ++ ++ /** ++ * This method returns line number where the error occurred ++ * @returns the line number where the error occurred ++ * @sa errorString ++ */ ++ int errorLine() const; ++ ++ private: ++ Q_DISABLE_COPY(Parser) ++ ParserPrivate* const d; ++ }; ++} ++ ++#endif // QJSON_PARSER_H +diff --git a/WebCore/platform/graphics/embedded/qjson/parser_p.h b/WebCore/platform/graphics/embedded/qjson/parser_p.h +new file mode 100644 +index 0000000..e12b565 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/parser_p.h +@@ -0,0 +1,55 @@ ++/* This file is part of QJson ++ * ++ * Copyright (C) 2008 Flavio Castelli ++ * Copyright (C) 2009 Michael Leupold ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#ifndef QJSON_PARSER_P_H ++#define QJSON_PARSER_P_H ++ ++#include "parser.h" ++ ++#include ++#include ++ ++class JSonScanner; ++ ++namespace yy { ++ class json_parser; ++} ++ ++namespace QJson { ++ ++ class ParserPrivate ++ { ++ public: ++ ParserPrivate(); ++ ~ParserPrivate(); ++ ++ void setError(QString errorMsg, int line); ++ ++ JSonScanner* m_scanner; ++ bool m_negate; ++ bool m_error; ++ int m_errorLine; ++ QString m_errorMsg; ++ QVariant m_result; ++ }; ++} ++ ++#endif // QJSON_PARSER_H +diff --git a/WebCore/platform/graphics/embedded/qjson/parserrunnable.cpp b/WebCore/platform/graphics/embedded/qjson/parserrunnable.cpp +new file mode 100644 +index 0000000..d09423e +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/parserrunnable.cpp +@@ -0,0 +1,68 @@ ++/* This file is part of qjson ++ * ++ * Copyright (C) 2009 Flavio Castelli ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#include "parserrunnable.h" ++ ++#include "parser.h" ++ ++#include ++#include ++ ++using namespace QJson; ++ ++class QJson::ParserRunnable::Private ++{ ++ public: ++ QByteArray m_data; ++}; ++ ++ParserRunnable::ParserRunnable(QObject* parent) ++ : QObject(parent), ++ QRunnable(), ++ d(new Private) ++{ ++ qRegisterMetaType("QVariant"); ++} ++ ++ParserRunnable::~ParserRunnable() ++{ ++ delete d; ++} ++ ++void ParserRunnable::setData( const QByteArray& data ) { ++ d->m_data = data; ++} ++ ++void ParserRunnable::run() ++{ ++ qDebug() << Q_FUNC_INFO; ++ ++ bool ok; ++ Parser parser; ++ QVariant result = parser.parse (d->m_data, &ok); ++ if (ok) { ++ qDebug() << "successfully converted json item to QVariant object"; ++ emit parsingFinished(result, true, QString()); ++ } else { ++ const QString errorText = tr("An error occured while parsing json: %1").arg(parser.errorString()); ++ qCritical() << errorText; ++ emit parsingFinished(QVariant(), false, errorText); ++ } ++} +diff --git a/WebCore/platform/graphics/embedded/qjson/parserrunnable.h b/WebCore/platform/graphics/embedded/qjson/parserrunnable.h +new file mode 100644 +index 0000000..822e1fd +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/parserrunnable.h +@@ -0,0 +1,67 @@ ++/* This file is part of qjson ++ * ++ * Copyright (C) 2009 Flavio Castelli ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#ifndef PARSERRUNNABLE_H ++#define PARSERRUNNABLE_H ++ ++#include "qjson_export.h" ++ ++#include ++#include ++ ++class QVariant; ++ ++namespace QJson { ++ /** ++ * @brief Convenience class for converting JSON data to QVariant objects using a dedicated thread ++ */ ++ class QJSON_EXPORT ParserRunnable : public QObject, public QRunnable ++ { ++ Q_OBJECT ++ public: ++ /** ++ * This signal is emitted when the conversion process has been completed ++ * @param data contains the JSON data that has to be converted ++ * @param parent parent of the object ++ **/ ++ explicit ParserRunnable(QObject* parent = 0); ++ ~ParserRunnable(); ++ ++ void setData( const QByteArray& data ); ++ ++ void run(); ++ ++ Q_SIGNALS: ++ /** ++ * This signal is emitted when the parsing process has been completed ++ * @param json contains the result of the parsing ++ * @param ok if a parsing error occurs ok is set to false, otherwise it's set to true. ++ * @param error_msg contains a string explaining the failure reason ++ **/ ++ void parsingFinished(const QVariant& json, bool ok, const QString& error_msg); ++ ++ private: ++ Q_DISABLE_COPY(ParserRunnable) ++ class Private; ++ Private* const d; ++ }; ++} ++ ++#endif // PARSERRUNNABLE_H +diff --git a/WebCore/platform/graphics/embedded/qjson/position.hh b/WebCore/platform/graphics/embedded/qjson/position.hh +new file mode 100644 +index 0000000..27331d0 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/position.hh +@@ -0,0 +1,142 @@ ++/* A Bison parser, made by GNU Bison 2.3. */ ++ ++/* Positions for Bison parsers in C++ ++ ++ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. */ ++ ++/* As a special exception, you may create a larger work that contains ++ part or all of the Bison parser skeleton and distribute that work ++ under terms of your choice, so long as that work isn't itself a ++ parser generator using the skeleton or a modified version thereof ++ as a parser skeleton. Alternatively, if you modify or redistribute ++ the parser skeleton itself, you may (at your option) remove this ++ special exception, which will cause the skeleton and the resulting ++ Bison output files to be licensed under the GNU General Public ++ License without this special exception. ++ ++ This special exception was added by the Free Software Foundation in ++ version 2.2 of Bison. */ ++ ++/** ++ ** \file position.hh ++ ** Define the yy::position class. ++ */ ++ ++#ifndef BISON_POSITION_HH ++# define BISON_POSITION_HH ++ ++# include ++# include ++ ++namespace yy ++{ ++ /// Abstract a position. ++ class position ++ { ++ public: ++ ++ /// Construct a position. ++ position () ++ : filename (0), line (1), column (0) ++ { ++ } ++ ++ ++ /// Initialization. ++ inline void initialize (std::string* fn) ++ { ++ filename = fn; ++ line = 1; ++ column = 0; ++ } ++ ++ /** \name Line and Column related manipulators ++ ** \{ */ ++ public: ++ /// (line related) Advance to the COUNT next lines. ++ inline void lines (int count = 1) ++ { ++ column = 0; ++ line += count; ++ } ++ ++ /// (column related) Advance to the COUNT next columns. ++ inline void columns (int count = 1) ++ { ++ int leftmost = 0; ++ int current = column; ++ if (leftmost <= current + count) ++ column += count; ++ else ++ column = 0; ++ } ++ /** \} */ ++ ++ public: ++ /// File name to which this position refers. ++ std::string* filename; ++ /// Current line number. ++ unsigned int line; ++ /// Current column number. ++ unsigned int column; ++ }; ++ ++ /// Add and assign a position. ++ inline const position& ++ operator+= (position& res, const int width) ++ { ++ res.columns (width); ++ return res; ++ } ++ ++ /// Add two position objects. ++ inline const position ++ operator+ (const position& begin, const int width) ++ { ++ position res = begin; ++ return res += width; ++ } ++ ++ /// Add and assign a position. ++ inline const position& ++ operator-= (position& res, const int width) ++ { ++ return res += -width; ++ } ++ ++ /// Add two position objects. ++ inline const position ++ operator- (const position& begin, const int width) ++ { ++ return begin + -width; ++ } ++ ++ /** \brief Intercept output stream redirection. ++ ** \param ostr the destination output stream ++ ** \param pos a reference to the position to redirect ++ */ ++ inline std::ostream& ++ operator<< (std::ostream& ostr, const position& pos) ++ { ++ if (pos.filename) ++ ostr << *pos.filename << ':'; ++ return ostr << pos.line << '.' << pos.column; ++ } ++ ++} ++#endif // not BISON_POSITION_HH +diff --git a/WebCore/platform/graphics/embedded/qjson/qjson_debug.h b/WebCore/platform/graphics/embedded/qjson/qjson_debug.h +new file mode 100644 +index 0000000..5ae1da3 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/qjson_debug.h +@@ -0,0 +1,33 @@ ++/* This file is part of qjson ++ * ++ * Copyright (C) 2009 Michael Leupold ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#ifndef QJSON_DEBUG_H ++#define QJSON_DEBUG_H ++ ++#include ++ ++// define qjsonDebug() ++#ifdef QJSON_VERBOSE_DEBUG_OUTPUT ++ inline QDebug qjsonDebug() { return QDebug(QtDebugMsg); } ++#else ++ inline QNoDebug qjsonDebug() { return QNoDebug(); } ++#endif ++ ++#endif +diff --git a/WebCore/platform/graphics/embedded/qjson/qjson_export.h b/WebCore/platform/graphics/embedded/qjson/qjson_export.h +new file mode 100644 +index 0000000..c7f5325 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/qjson_export.h +@@ -0,0 +1,35 @@ ++/* This file is part of the KDE project ++ Copyright (C) 2009 Pino Toscano ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Library General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Library General Public License ++ along with this library; see the file COPYING.LIB. If not, write to ++ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++#ifndef QJSON_EXPORT_H ++#define QJSON_EXPORT_H ++ ++#include ++ ++#ifndef QJSON_EXPORT ++# if defined(QJSON_MAKEDLL) ++ /* We are building this library */ ++# define QJSON_EXPORT Q_DECL_EXPORT ++# else ++ /* We are using this library */ ++# define QJSON_EXPORT Q_DECL_IMPORT ++# endif ++#endif ++ ++#endif +diff --git a/WebCore/platform/graphics/embedded/qjson/qobjecthelper.cpp b/WebCore/platform/graphics/embedded/qjson/qobjecthelper.cpp +new file mode 100644 +index 0000000..8bba181 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/qobjecthelper.cpp +@@ -0,0 +1,81 @@ ++/* This file is part of qjson ++ * ++ * Copyright (C) 2009 Till Adam ++ * Copyright (C) 2009 Flavio Castelli ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++ ++#include "qobjecthelper.h" ++ ++#include ++#include ++#include ++ ++using namespace QJson; ++ ++class QObjectHelper::QObjectHelperPrivate { ++}; ++ ++QObjectHelper::QObjectHelper() ++ : d (new QObjectHelperPrivate) ++{ ++} ++ ++QObjectHelper::~QObjectHelper() ++{ ++ delete d; ++} ++ ++QVariantMap QObjectHelper::qobject2qvariant( const QObject* object, ++ const QStringList& ignoredProperties) ++{ ++ QVariantMap result; ++ const QMetaObject *metaobject = object->metaObject(); ++ int count = metaobject->propertyCount(); ++ for (int i=0; iproperty(i); ++ const char *name = metaproperty.name(); ++ ++ if (ignoredProperties.contains(QLatin1String(name)) || (!metaproperty.isReadable())) ++ continue; ++ ++ QVariant value = object->property(name); ++ result[QLatin1String(name)] = value; ++ } ++ return result; ++} ++ ++void QObjectHelper::qvariant2qobject(const QVariantMap& variant, QObject* object) ++{ ++ QStringList properies; ++ const QMetaObject *metaobject = object->metaObject(); ++ int count = metaobject->propertyCount(); ++ for (int i=0; iproperty(i); ++ if (metaproperty.isWritable()) { ++ properies << QLatin1String( metaproperty.name()); ++ } ++ } ++ ++ QVariantMap::const_iterator iter; ++ for (iter = variant.constBegin(); iter != variant.end(); iter++) { ++ if (properies.contains(iter.key())) { ++ object->setProperty(iter.key().toAscii(), iter.value()); ++ } ++ } ++} +diff --git a/WebCore/platform/graphics/embedded/qjson/qobjecthelper.h b/WebCore/platform/graphics/embedded/qjson/qobjecthelper.h +new file mode 100644 +index 0000000..7bf6b03 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/qobjecthelper.h +@@ -0,0 +1,143 @@ ++/* This file is part of qjson ++ * ++ * Copyright (C) 2009 Flavio Castelli ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#ifndef QOBJECTHELPER_H ++#define QOBJECTHELPER_H ++ ++#include "qjson_export.h" ++ ++#include ++#include ++#include ++ ++class QObject; ++ ++namespace QJson { ++ /** ++ * @brief Class used to convert QObject into QVariant and vivce-versa. ++ * During these operations only the class attributes defined as properties will ++ * be considered. ++ * ++ * Suppose the declaration of the Person class looks like this: ++ * \code ++ * class Person : public QObject ++ { ++ Q_OBJECT ++ ++ Q_PROPERTY(QString name READ name WRITE setName) ++ Q_PROPERTY(int phoneNumber READ phoneNumber WRITE setPhoneNumber) ++ Q_PROPERTY(Gender gender READ gender WRITE setGender) ++ Q_PROPERTY(QDate dob READ dob WRITE setDob) ++ Q_ENUMS(Gender) ++ ++ public: ++ Person(QObject* parent = 0); ++ ~Person(); ++ ++ QString name() const; ++ void setName(const QString& name); ++ ++ int phoneNumber() const; ++ void setPhoneNumber(const int phoneNumber); ++ ++ enum Gender {Male, Female}; ++ void setGender(Gender gender); ++ Gender gender() const; ++ ++ QDate dob() const; ++ void setDob(const QDate& dob); ++ ++ private: ++ QString m_name; ++ int m_phoneNumber; ++ Gender m_gender; ++ QDate m_dob; ++ }; ++ \endcode ++ ++ The following code will serialize an instance of Person to JSON : ++ ++ \code ++ Person person; ++ person.setName("Flavio"); ++ person.setPhoneNumber(123456); ++ person.setGender(Person::Male); ++ person.setDob(QDate(1982, 7, 12)); ++ ++ QVariantMap variant = QObjectHelper::qobject2qvariant(&person); ++ Serializer serializer; ++ qDebug() << serializer.serialize( variant); ++ \endcode ++ ++ The generated output will be: ++ \code ++ { "dob" : "1982-07-12", "gender" : 0, "name" : "Flavio", "phoneNumber" : 123456 } ++ \endcode ++ ++ It's also possible to initialize a QObject using the values stored inside of ++ a QVariantMap. ++ ++ Suppose you have the following JSON data stored into a QString: ++ \code ++ { "dob" : "1982-07-12", "gender" : 0, "name" : "Flavio", "phoneNumber" : 123456 } ++ \endcode ++ ++ The following code will initialize an already allocated instance of Person ++ using the JSON values: ++ \code ++ Parser parser; ++ QVariant variant = parser.parse(json); ++ ++ Person person; ++ QObjectHelper::qvariant2qobject(variant.toMap(), &person); ++ \endcode ++ ++ \sa Parser ++ \sa Serializer ++ */ ++ class QJSON_EXPORT QObjectHelper { ++ public: ++ QObjectHelper(); ++ ~QObjectHelper(); ++ ++ /** ++ * This method converts a QObject instance into a QVariantMap. ++ * ++ * @param object The QObject instance to be converted. ++ * @param ignoredProperties Properties that won't be converted. ++ */ ++ static QVariantMap qobject2qvariant( const QObject* object, ++ const QStringList& ignoredProperties = QStringList(QString(QLatin1String("objectName")))); ++ ++ /** ++ * This method converts a QVariantMap instance into a QObject ++ * ++ * @param object The QObject instance to be converted. ++ */ ++ static void qvariant2qobject(const QVariantMap& variant, QObject* object); ++ ++ private: ++ Q_DISABLE_COPY(QObjectHelper) ++ class QObjectHelperPrivate; ++ QObjectHelperPrivate* const d; ++ }; ++} ++ ++#endif // QOBJECTHELPER_H +diff --git a/WebCore/platform/graphics/embedded/qjson/serializer.cpp b/WebCore/platform/graphics/embedded/qjson/serializer.cpp +new file mode 100644 +index 0000000..f012246 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/serializer.cpp +@@ -0,0 +1,152 @@ ++/* This file is part of qjson ++ * ++ * Copyright (C) 2009 Till Adam ++ * Copyright (C) 2009 Flavio Castelli ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#include "serializer.h" ++ ++#include ++#include ++#include ++ ++using namespace QJson; ++ ++class Serializer::SerializerPrivate { ++}; ++ ++Serializer::Serializer() : d( new SerializerPrivate ) { ++} ++ ++Serializer::~Serializer() { ++ delete d; ++} ++ ++void Serializer::serialize( const QVariant& v, QIODevice* io, bool* ok ) ++{ ++ Q_ASSERT( io ); ++ if (!io->isOpen()) { ++ if (!io->open(QIODevice::WriteOnly)) { ++ if ( ok != 0 ) ++ *ok = false; ++ qCritical ("Error opening device"); ++ return; ++ } ++ } ++ ++ if (!io->isWritable()) { ++ if (ok != 0) ++ *ok = false; ++ qCritical ("Device is not readable"); ++ io->close(); ++ return; ++ } ++ ++ const QByteArray str = serialize( v ); ++ if ( !str.isNull() ) { ++ QDataStream stream( io ); ++ stream << str; ++ } else { ++ if ( ok ) ++ *ok = false; ++ } ++} ++ ++static QString sanitizeString( QString str ) ++{ ++ str.replace( QLatin1String( "\\" ), QLatin1String( "\\\\" ) ); ++ str.replace( QLatin1String( "\"" ), QLatin1String( "\\\"" ) ); ++ str.replace( QLatin1String( "\b" ), QLatin1String( "\\b" ) ); ++ str.replace( QLatin1String( "\f" ), QLatin1String( "\\f" ) ); ++ str.replace( QLatin1String( "\n" ), QLatin1String( "\\n" ) ); ++ str.replace( QLatin1String( "\r" ), QLatin1String( "\\r" ) ); ++ str.replace( QLatin1String( "\t" ), QLatin1String( "\\t" ) ); ++ return QString( QLatin1String( "\"%1\"" ) ).arg( str ); ++} ++ ++static QByteArray join( const QList& list, const QByteArray& sep ) { ++ QByteArray res; ++ Q_FOREACH( const QByteArray& i, list ) { ++ if ( !res.isEmpty() ) ++ res += sep; ++ res += i; ++ } ++ return res; ++} ++ ++QByteArray Serializer::serialize( const QVariant &v ) ++{ ++ QByteArray str; ++ bool error = false; ++ ++ if ( ! v.isValid() ) { // invalid or null? ++ str = "null"; ++ } else if ( v.type() == QVariant::List ) { // variant is a list? ++ const QVariantList list = v.toList(); ++ QList values; ++ Q_FOREACH( const QVariant& v, list ) ++ { ++ QByteArray serializedValue = serialize( v ); ++ if ( serializedValue.isNull() ) { ++ error = true; ++ break; ++ } ++ values << serializedValue; ++ } ++ str = "[ " + join( values, ", " ) + " ]"; ++ } else if ( v.type() == QVariant::Map ) { // variant is a map? ++ const QVariantMap vmap = v.toMap(); ++ QMapIterator it( vmap ); ++ str = "{ "; ++ QList pairs; ++ while ( it.hasNext() ) { ++ it.next(); ++ QByteArray serializedValue = serialize( it.value() ); ++ if ( serializedValue.isNull() ) { ++ error = true; ++ break; ++ } ++ pairs << sanitizeString( it.key() ).toUtf8() + " : " + serializedValue; ++ } ++ str += join( pairs, ", " ); ++ str += " }"; ++ } else if (( v.type() == QVariant::String ) || ( v.type() == QVariant::ByteArray )) { // a string or a byte array? ++ str = sanitizeString( v.toString() ).toUtf8(); ++ } else if ( v.type() == QVariant::Double ) { // a double? ++ str = QByteArray::number( v.toDouble() ); ++ if( ! str.contains( "." ) && ! str.contains( "e" ) ) { ++ str += ".0"; ++ } ++ } else if ( v.type() == QVariant::Bool ) { // boolean value? ++ str = ( v.toBool() ? "true" : "false" ); ++ } else if ( v.type() == QVariant::ULongLong ) { // large unsigned number? ++ str = QByteArray::number( v.value() ); ++ } else if ( v.canConvert() ) { // any signed number? ++ str = QByteArray::number( v.value() ); ++ } else if ( v.canConvert() ){ // can value be converted to string? ++ // this will catch QDate, QDateTime, QUrl, ... ++ str = sanitizeString( v.toString() ).toUtf8(); ++ //TODO: catch other values like QImage, QRect, ... ++ } else { ++ error = true; ++ } ++ if ( !error ) ++ return str; ++ else ++ return QByteArray(); ++} +diff --git a/WebCore/platform/graphics/embedded/qjson/serializer.h b/WebCore/platform/graphics/embedded/qjson/serializer.h +new file mode 100644 +index 0000000..fd301b2 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/serializer.h +@@ -0,0 +1,71 @@ ++/* This file is part of qjson ++ * ++ * Copyright (C) 2009 Till Adam ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#ifndef QJSON_SERIALIZER_H ++#define QJSON_SERIALIZER_H ++ ++#include "qjson_export.h" ++ ++class QIODevice; ++class QString; ++class QVariant; ++ ++namespace QJson { ++ /** ++ * @brief Main class used to convert QVariant objects to JSON data. ++ * ++ * QVariant objects are converted to a string containing the JSON data. ++ * If QVariant object is empty or not valid a null json object is returned. ++ */ ++ class QJSON_EXPORT Serializer { ++ public: ++ Serializer(); ++ ~Serializer(); ++ ++ /** ++ * This method generates a textual JSON representation and outputs it to the ++ * passed in I/O Device. ++ * @param variant The JSON document in its in-memory representation as generated by the ++ * parser. ++ * @param out Input output device ++ * @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true ++ */ ++ void serialize( const QVariant& variant, QIODevice* out, bool* ok = 0 ); ++ ++ /** ++ * This is a method provided for convenience. It turns the passed in in-memory ++ * representation of the JSON document into a textual one, which is returned. ++ * If the returned string is empty, the document was empty. If it was null, there ++ * was a parsing error. ++ * ++ * @param variant The JSON document in its in-memory representation as generated by the ++ * parser. ++ */ ++ ++ QByteArray serialize( const QVariant& variant ); ++ ++ private: ++ Q_DISABLE_COPY(Serializer) ++ class SerializerPrivate; ++ SerializerPrivate* const d; ++ }; ++} ++ ++#endif // QJSON_SERIALIZER_H +diff --git a/WebCore/platform/graphics/embedded/qjson/serializerrunnable.cpp b/WebCore/platform/graphics/embedded/qjson/serializerrunnable.cpp +new file mode 100644 +index 0000000..2e57c45 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/serializerrunnable.cpp +@@ -0,0 +1,60 @@ ++#include "serializerrunnable.h" ++ ++/* This file is part of qjson ++ * ++ * Copyright (C) 2009 Flavio Castelli ++ * 2009 Frank Osterfeld ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#include "parserrunnable.h" ++#include "serializer.h" ++ ++#include ++#include ++ ++using namespace QJson; ++ ++class SerializerRunnable::Private ++{ ++public: ++ QVariant json; ++}; ++ ++SerializerRunnable::SerializerRunnable(QObject* parent) ++ : QObject(parent), ++ QRunnable(), ++ d(new Private) ++{ ++ qRegisterMetaType("QVariant"); ++} ++ ++SerializerRunnable::~SerializerRunnable() ++{ ++ delete d; ++} ++ ++void SerializerRunnable::setJsonObject( const QVariant& json ) ++{ ++ d->json = json; ++} ++ ++void SerializerRunnable::run() ++{ ++ Serializer serializer; ++ emit parsingFinished( Serializer().serialize( d->json ), true, QString() ); ++} +diff --git a/WebCore/platform/graphics/embedded/qjson/serializerrunnable.h b/WebCore/platform/graphics/embedded/qjson/serializerrunnable.h +new file mode 100644 +index 0000000..c6b5fe1 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/serializerrunnable.h +@@ -0,0 +1,74 @@ ++/* This file is part of qjson ++ * ++ * Copyright (C) 2009 Frank Osterfeld ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#ifndef SERIALIZERRUNNABLE_H ++#define SERIALIZERRUNNABLE_H ++ ++#include "qjson_export.h" ++ ++#include ++#include ++ ++class QByteArray; ++class QString; ++class QVariant; ++ ++namespace QJson { ++ /** ++ * @brief Convenience class for converting JSON data to QVariant objects using a dedicated thread ++ */ ++ class QJSON_EXPORT SerializerRunnable : public QObject, public QRunnable ++ { ++ Q_OBJECT ++ public: ++ /** ++ * This signal is emitted when the conversion process has been completed ++ * @param data contains the JSON data that has to be converted ++ * @param parent parent of the object ++ **/ ++ explicit SerializerRunnable(QObject* parent = 0); ++ ~SerializerRunnable(); ++ ++ /** ++ * Sets the json object to serialize. ++ * ++ * @param json QVariant containing the json representation to be serialized ++ */ ++ void setJsonObject( const QVariant& json ); ++ ++ /* reimp */ void run(); ++ ++ Q_SIGNALS: ++ /** ++ * This signal is emitted when the serialization process has been completed ++ * @param serialized contains the result of the serialization ++ * @param ok if a serialization error occurs ok is set to false, otherwise it's set to true. ++ * @param error_msg contains a string explaining the failure reason ++ **/ ++ void parsingFinished(const QByteArray& serialized, bool ok, const QString& error_msg); ++ ++ private: ++ Q_DISABLE_COPY(SerializerRunnable) ++ class Private; ++ Private* const d; ++ }; ++} ++ ++#endif // SERIALIZERRUNNABLE_H +diff --git a/WebCore/platform/graphics/embedded/qjson/stack.hh b/WebCore/platform/graphics/embedded/qjson/stack.hh +new file mode 100644 +index 0000000..754b664 +--- /dev/null ++++ b/WebCore/platform/graphics/embedded/qjson/stack.hh +@@ -0,0 +1,129 @@ ++/* A Bison parser, made by GNU Bison 2.3. */ ++ ++/* Stack handling for Bison parsers in C++ ++ ++ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. */ ++ ++/* As a special exception, you may create a larger work that contains ++ part or all of the Bison parser skeleton and distribute that work ++ under terms of your choice, so long as that work isn't itself a ++ parser generator using the skeleton or a modified version thereof ++ as a parser skeleton. Alternatively, if you modify or redistribute ++ the parser skeleton itself, you may (at your option) remove this ++ special exception, which will cause the skeleton and the resulting ++ Bison output files to be licensed under the GNU General Public ++ License without this special exception. ++ ++ This special exception was added by the Free Software Foundation in ++ version 2.2 of Bison. */ ++ ++#ifndef BISON_STACK_HH ++# define BISON_STACK_HH ++ ++#include ++ ++namespace yy ++{ ++ template > ++ class stack ++ { ++ public: ++ ++ // Hide our reversed order. ++ typedef typename S::reverse_iterator iterator; ++ typedef typename S::const_reverse_iterator const_iterator; ++ ++ stack () : seq_ () ++ { ++ } ++ ++ stack (unsigned int n) : seq_ (n) ++ { ++ } ++ ++ inline ++ T& ++ operator [] (unsigned int i) ++ { ++ return seq_[i]; ++ } ++ ++ inline ++ const T& ++ operator [] (unsigned int i) const ++ { ++ return seq_[i]; ++ } ++ ++ inline ++ void ++ push (const T& t) ++ { ++ seq_.push_front (t); ++ } ++ ++ inline ++ void ++ pop (unsigned int n = 1) ++ { ++ for (; n; --n) ++ seq_.pop_front (); ++ } ++ ++ inline ++ unsigned int ++ height () const ++ { ++ return seq_.size (); ++ } ++ ++ inline const_iterator begin () const { return seq_.rbegin (); } ++ inline const_iterator end () const { return seq_.rend (); } ++ ++ private: ++ ++ S seq_; ++ }; ++ ++ /// Present a slice of the top of a stack. ++ template > ++ class slice ++ { ++ public: ++ ++ slice (const S& stack, ++ unsigned int range) : stack_ (stack), ++ range_ (range) ++ { ++ } ++ ++ inline ++ const T& ++ operator [] (unsigned int i) const ++ { ++ return stack_[range_ - i]; ++ } ++ ++ private: ++ ++ const S& stack_; ++ unsigned int range_; ++ }; ++} ++ ++#endif // not BISON_STACK_HH +diff --git a/WebCore/platform/network/qt/ResourceHandleQt.cpp b/WebCore/platform/network/qt/ResourceHandleQt.cpp +index aaa306a..8356ae0 100644 +--- a/WebCore/platform/network/qt/ResourceHandleQt.cpp ++++ b/WebCore/platform/network/qt/ResourceHandleQt.cpp +@@ -203,7 +203,9 @@ void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, S + d->m_frame = static_cast(frame->loader()->client())->webFrame(); + d->m_job = new QNetworkReplyHandler(&handle, QNetworkReplyHandler::LoadNormal); + +- syncLoader.waitForCompletion(); ++ // If there was no reply, don't wait for completion! ++ if (d->m_job->reply()) ++ syncLoader.waitForCompletion(); + error = syncLoader.resourceError(); + data = syncLoader.data(); + response = syncLoader.resourceResponse(); +diff --git a/WebCore/plugins/PluginDatabase.cpp b/WebCore/plugins/PluginDatabase.cpp +index b09658f..63c60d8 100644 +--- a/WebCore/plugins/PluginDatabase.cpp ++++ b/WebCore/plugins/PluginDatabase.cpp +@@ -27,8 +27,10 @@ + #include "config.h" + #include "PluginDatabase.h" + ++#include "CString.h" + #include "Frame.h" + #include "KURL.h" ++#include "Logging.h" + #include "PluginDatabaseClient.h" + #include "PluginPackage.h" + #include +@@ -331,7 +333,7 @@ Vector PluginDatabase::defaultPluginDirectories() + Vector paths; + + // Add paths specific to each platform +-#if defined(XP_UNIX) ++#if defined(XP_UNIX) || defined(XP_EMBEDDED) + String userPluginPath = homeDirectoryPath(); + userPluginPath.append(String("/.mozilla/plugins")); + paths.append(userPluginPath); +@@ -386,6 +388,10 @@ Vector PluginDatabase::defaultPluginDirectories() + paths.append(qtPaths); + #endif + ++ for(Vector::iterator it = paths.begin(); it != paths.end(); ++it) { ++ LOG(Plugins, "PluginDatabase::defaultDirectories: %s", (*it).latin1().data()); ++ } ++ + return paths; + } + +@@ -393,7 +399,7 @@ bool PluginDatabase::isPreferredPluginDirectory(const String& path) + { + String preferredPath = homeDirectoryPath(); + +-#if defined(XP_UNIX) ++#if defined(XP_UNIX) || defined(XP_EMBEDDED) + preferredPath.append(String("/.mozilla/plugins")); + #elif defined(XP_MACOSX) + preferredPath.append(String("/Library/Internet Plug-Ins")); +@@ -410,7 +416,7 @@ void PluginDatabase::getPluginPathsInDirectories(HashSet& paths) const + // FIXME: This should be a case insensitive set. + HashSet uniqueFilenames; + +-#if defined(XP_UNIX) ++#if defined(XP_UNIX) || defined(XP_EMBEDDED) + String fileNameFilter("*.so"); + #else + String fileNameFilter(""); +diff --git a/WebCore/plugins/PluginPackage.cpp b/WebCore/plugins/PluginPackage.cpp +index 3881f54..7ebbb94 100644 +--- a/WebCore/plugins/PluginPackage.cpp ++++ b/WebCore/plugins/PluginPackage.cpp +@@ -301,6 +301,11 @@ void PluginPackage::initializeBrowserFuncs() + m_browserFuncs.setexception = _NPN_SetException; + m_browserFuncs.enumerate = _NPN_Enumerate; + m_browserFuncs.construct = _NPN_Construct; ++ ++#ifdef XP_EMBEDDED ++ m_browserFuncs.scheduletimer = NPN_ScheduleTimer; ++ m_browserFuncs.unscheduletimer = NPN_UnscheduleTimer; ++#endif + } + #endif + +diff --git a/WebCore/plugins/PluginTimer.cpp b/WebCore/plugins/PluginTimer.cpp +new file mode 100644 +index 0000000..63a83ec +--- /dev/null ++++ b/WebCore/plugins/PluginTimer.cpp +@@ -0,0 +1,103 @@ ++/* ++ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY ++ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ++ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include "config.h" ++#include "PluginTimer.h" ++ ++namespace WebCore { ++ ++ static uint32 gTimerID; ++ ++ PluginTimer::PluginTimer(PluginTimer** list, NPP instance, bool repeat, void (*timerFunc)(NPP npp, uint32 timerID)) ++ : m_list(list) ++ , m_instance(instance) ++ , m_timerFunc(timerFunc) ++ , m_repeat(repeat) ++ { ++ m_timerID = ++gTimerID; ++ ++ m_next = *list; ++ if (m_next) ++ m_next->m_prev = this; ++ ++ m_prev = 0; ++ *list = this; ++ } ++ ++ PluginTimer::~PluginTimer() ++ { ++ if (m_next) ++ m_next->m_prev = m_prev; ++ ++ if (m_prev) ++ m_prev->m_next = m_next; ++ else ++ *m_list = m_next; ++ } ++ ++ void PluginTimer::fired() ++ { ++ m_timerFunc(m_instance, m_timerID); ++ if (!m_repeat) ++ delete this; ++ } ++ ++ // may return null if timerID is not found ++ PluginTimer* PluginTimer::find(PluginTimer* list, uint32 timerID) ++ { ++ PluginTimer* curr = list; ++ while (curr) { ++ if (curr->m_timerID == timerID) ++ break; ++ curr = curr->m_next; ++ } ++ return curr; ++ } ++ ++ PluginTimerList::~PluginTimerList() ++ { ++ while (m_list) ++ delete m_list; ++ } ++ ++ uint32 PluginTimerList::schedule(NPP instance, uint32 interval, bool repeat, ++ void (*proc)(NPP npp, uint32 timerID)) ++ { ++ PluginTimer* timer = new PluginTimer(&m_list, instance, repeat, proc); ++ ++ double dinterval = interval * 0.001; // milliseconds to seconds ++ if (repeat) ++ timer->startRepeating(dinterval); ++ else ++ timer->startOneShot(dinterval); ++ return timer->timerID(); ++ } ++ ++ void PluginTimerList::unschedule(NPP instance, uint32 timerID) ++ { ++ delete PluginTimer::find(m_list, timerID); ++ } ++ ++} // namespace WebCore +diff --git a/WebCore/plugins/PluginTimer.h b/WebCore/plugins/PluginTimer.h +new file mode 100644 +index 0000000..8ee44a1 +--- /dev/null ++++ b/WebCore/plugins/PluginTimer.h +@@ -0,0 +1,76 @@ ++/* ++ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY ++ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ++ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#ifndef PluginTimer_h ++#define PluginTimer_h ++ ++#include "Timer.h" ++#include "npapi.h" ++ ++namespace WebCore { ++ ++ class PluginTimerList; ++ ++ class PluginTimer : public TimerBase { ++ public: ++ PluginTimer(PluginTimer** list, NPP instance, bool repeat, void (*proc)(NPP npp, uint32 timerID)); ++ virtual ~PluginTimer(); ++ ++ uint32 timerID() const { return m_timerID; } ++ ++ static PluginTimer* find(PluginTimer* list, uint32 timerID); ++ ++ private: ++ // override from TimerBase ++ virtual void fired(); ++ ++ PluginTimer* next() const { return m_next; } ++ friend class PluginTimerList; ++ ++ PluginTimer** m_list; ++ PluginTimer* m_prev; ++ PluginTimer* m_next; ++ NPP m_instance; ++ void (*m_timerFunc)(NPP, uint32); ++ uint32 m_timerID; ++ bool m_repeat; ++ }; ++ ++ class PluginTimerList { ++ public: ++ PluginTimerList() : m_list(0) {} ++ ~PluginTimerList(); ++ ++ uint32 schedule(NPP instance, uint32 interval, bool repeat, ++ void (*proc)(NPP npp, uint32 timerID)); ++ void unschedule(NPP instance, uint32 timerID); ++ ++ private: ++ PluginTimer* m_list; ++ }; ++ ++} // namespace WebCore ++ ++#endif // PluginTimer_h +diff --git a/WebCore/plugins/PluginView.cpp b/WebCore/plugins/PluginView.cpp +index b8b2f2f..3f4fe99 100644 +--- a/WebCore/plugins/PluginView.cpp ++++ b/WebCore/plugins/PluginView.cpp +@@ -127,6 +127,7 @@ IntRect PluginView::windowClipRect() const + + void PluginView::setFrameRect(const IntRect& rect) + { ++ LOG(Plugins, "PluginView::setFrameRect(%d, %d, %d, %d)", rect.x(), rect.y(), rect.width(), rect.height()); + if (m_element->document()->printing()) + return; + +@@ -142,6 +143,8 @@ void PluginView::setFrameRect(const IntRect& rect) + // On Unix, multiple calls to setNPWindow() in windowed mode causes Flash to crash + if (m_mode == NP_FULL || !m_isWindowed) + setNPWindowRect(rect); ++#elif defined(XP_EMBEDDED) ++ setNPWindowRect(rect); + #endif + } + +@@ -217,6 +220,7 @@ bool PluginView::startOrAddToUnstartedList() + + bool PluginView::start() + { ++ LOG(Plugins, "PluginView::start()"); + if (m_isStarted) + return false; + +@@ -627,10 +631,11 @@ void PluginView::status(const char* message) + + NPError PluginView::setValue(NPPVariable variable, void* value) + { +- LOG(Plugins, "PluginView::setValue(%s): ", prettyNameForNPPVariable(variable, value).data()); ++ LOG(Plugins, "PluginView::setValue(%s): ", prettyNameForNPPVariable(variable, value).data()); + + switch (variable) { + case NPPVpluginWindowBool: ++ LOG(Plugins, " m_isWindowed = %d", (int)value); + m_isWindowed = value; + return NPERR_NO_ERROR; + case NPPVpluginTransparentBool: +@@ -685,7 +690,12 @@ NPError PluginView::setValue(NPPVariable variable, void* value) + m_renderToImage = true; + return NPERR_NO_ERROR; + #endif ++#ifdef XP_EMBEDDED ++ case NPPVpluginWindowSize: ++ return platformSetValue(variable, value); ++#endif + ++ + default: + notImplemented(); + return NPERR_GENERIC_ERROR; +@@ -712,6 +722,16 @@ void PluginView::popPopupsEnabledState() + m_popupStateStack.removeLast(); + } + ++uint32 PluginView::scheduleTimer(uint32 interval, bool repeat, void (*timerFunc)(NPP, uint32 timerID)) ++{ ++ return m_timers.schedule(instance(), interval, repeat, timerFunc); ++} ++ ++void PluginView::unscheduleTimer(uint32 timerID) ++{ ++ m_timers.unschedule(instance(), timerID); ++} ++ + bool PluginView::arePopupsAllowed() const + { + if (!m_popupStateStack.isEmpty()) +@@ -825,7 +845,7 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p + , m_paramNames(0) + , m_paramValues(0) + , m_mimeType(mimeType) +-#if defined(XP_MACOSX) ++#if 1 // defined(XP_MACOSX) + , m_isWindowed(false) + #else + , m_isWindowed(true) +@@ -867,12 +887,23 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p + , m_isJavaScriptPaused(false) + , m_isHalted(false) + , m_hasBeenHalted(false) ++ , m_isFullscreen(false) ++ , m_isFakeFullscreen(false) ++ , m_actualFullscreen(false) ++ , m_fullscreenByPlugin(false) ++ , m_sentWindowEvent(false) + { ++ LOG(Plugins, "PluginView::PluginView()"); + if (!m_plugin) { ++ LOG(Plugins, "PluginView::PluginView() CanNotFundPlugin!"); + m_status = PluginStatusCanNotFindPlugin; + return; + } + ++ // Boxee: ++ // sendinf NP_FULL causes issues with flash which expects to have a window at that point ++ m_mode = NP_EMBED; ++ + m_instance = &m_instanceStruct; + m_instance->ndata = this; + m_instance->pdata = 0; +@@ -1205,6 +1236,7 @@ NPError PluginView::handlePost(const char* url, const char* target, uint32 len, + + void PluginView::invalidateWindowlessPluginRect(const IntRect& rect) + { ++// LOG(Plugins, "PluginView::invalidateWindowlessPluginRect(%d, %d, %d, %d)", rect.x(), rect.y(), rect.width(), rect.height()); + if (!isVisible()) + return; + +@@ -1214,6 +1246,7 @@ void PluginView::invalidateWindowlessPluginRect(const IntRect& rect) + + IntRect dirtyRect = rect; + dirtyRect.move(renderer->borderLeft() + renderer->paddingLeft(), renderer->borderTop() + renderer->paddingTop()); ++// LOG(Plugins, "PluginView::invalidateWindowlessPluginRect() ACTUALLY REPAINTING"); + renderer->repaintRectangle(dirtyRect); + } + +@@ -1331,8 +1364,10 @@ NPError PluginView::getValue(NPNVariable variable, void* value) + + switch (variable) { + case NPNVWindowNPObject: { +- if (m_isJavaScriptPaused) ++ if (m_isJavaScriptPaused) { ++ LOG(Plugins, "PluginView::getValue(NPNVWindowNPObject) JAVASCRIPT IS PAUSED!"); + return NPERR_GENERIC_ERROR; ++ } + + NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject(); + +@@ -1394,4 +1429,17 @@ void PluginView::privateBrowsingStateChanged(bool privateBrowsingEnabled) + PluginView::setCurrentPluginView(0); + } + ++#ifndef XP_EMBEDDED ++void PluginView::showFullscreen(bool isFullscreen, bool fakeFullscreen, bool fullscreenByPlugin) ++{ ++ m_isFullscreen = isFullscreen; ++ m_isFakeFullscreen = fakeFullscreen; ++} ++ ++void PluginView::handleEvent(QEvent*) ++{ ++} ++#endif ++ ++ + } // namespace WebCore +diff --git a/WebCore/plugins/PluginView.h b/WebCore/plugins/PluginView.h +index f346134..a254606 100644 +--- a/WebCore/plugins/PluginView.h ++++ b/WebCore/plugins/PluginView.h +@@ -34,6 +34,7 @@ + #include "IntRect.h" + #include "MediaCanStartListener.h" + #include "PluginStream.h" ++#include "PluginTimer.h" + #include "ResourceRequest.h" + #include "Timer.h" + #include "Widget.h" +@@ -154,6 +155,8 @@ namespace WebCore { + void forceRedraw(); + void pushPopupsEnabledState(bool state); + void popPopupsEnabledState(); ++ uint32 scheduleTimer(uint32 interval, bool repeat, void (*timerFunc)(NPP instance, uint32 timerID)); ++ void unscheduleTimer(uint32 timerID); + + virtual void invalidateRect(const IntRect&); + +@@ -180,6 +183,7 @@ namespace WebCore { + IntRect windowClipRect() const; + + virtual void handleEvent(Event*); ++ virtual void handleEvent(QEvent*); + virtual void setParent(ScrollView*); + virtual void setParentVisible(bool); + +@@ -224,6 +228,12 @@ namespace WebCore { + #endif + void keepAlive(); + ++ void showFullscreen(bool isFullscreen, bool fakeFullScreen=true, bool fullscreenByPlugin = false); ++ ++#ifdef XP_EMBEDDED ++ IntRect fullScreenInvalidRect() { return m_fullScreenInvalidRect; } ++#endif ++ + private: + PluginView(Frame* parentFrame, const IntSize&, PluginPackage*, Element*, const KURL&, const Vector& paramNames, const Vector& paramValues, const String& mimeType, bool loadManually); + +@@ -254,6 +264,11 @@ namespace WebCore { + static bool platformGetValueStatic(NPNVariable variable, void* value, NPError* result); + bool platformGetValue(NPNVariable variable, void* value, NPError* result); + ++#ifdef XP_EMBEDDED ++ NPError platformSetValue(NPPVariable variable, void* value); ++ void sendFullscreenEventToPlugin(); ++#endif ++ + RefPtr m_parentFrame; + RefPtr m_plugin; + Element* m_element; +@@ -263,6 +278,11 @@ namespace WebCore { + PluginStatus m_status; + Vector m_invalidRects; + ++#ifdef XP_EMBEDDED ++ IntRect m_fullScreenInvalidRect; ++ bool m_shouldClearFullscreen; ++#endif ++ + void performRequest(PluginRequest*); + void scheduleRequest(PluginRequest*); + void requestTimerFired(Timer*); +@@ -289,6 +309,8 @@ namespace WebCore { + void handleFocusOutEvent(); + #endif + ++ bool event(QEvent*); ++ + #if OS(WINDOWS) + void paintIntoTransformedContext(HDC); + PassRefPtr snapshot(); +@@ -312,6 +334,8 @@ namespace WebCore { + HashSet > m_streams; + Vector m_requests; + ++ PluginTimerList m_timers; ++ + bool m_isWindowed; + bool m_isTransparent; + bool m_haveInitialized; +@@ -330,7 +354,7 @@ namespace WebCore { + bool m_haveUpdatedPluginWidget; + #endif + +-#if ((PLATFORM(QT) || PLATFORM(WX)) && OS(WINDOWS)) || defined(XP_MACOSX) ++#if ((PLATFORM(QT) || PLATFORM(WX)) && OS(WINDOWS)) || defined(XP_MACOSX) || defined(XP_EMBEDDED) + // On Mac OSX and Qt/Windows the plugin does not have its own native widget, + // but is using the containing window as its reference for positioning/painting. + PlatformPluginWidget m_window; +@@ -392,6 +416,12 @@ private: + bool m_isHalted; + bool m_hasBeenHalted; + ++ bool m_isFullscreen; ++ bool m_isFakeFullscreen; ++ bool m_actualFullscreen; ++ bool m_fullscreenByPlugin; ++ bool m_sentWindowEvent; ++ + static PluginView* s_currentPluginView; + }; + +diff --git a/WebCore/plugins/embedded/PluginEvents.h b/WebCore/plugins/embedded/PluginEvents.h +new file mode 100644 +index 0000000..2d41d0b +--- /dev/null ++++ b/WebCore/plugins/embedded/PluginEvents.h +@@ -0,0 +1,124 @@ ++#ifndef PluginEventsSDL_h ++#define PluginEventsSDL_h ++ ++ ++typedef enum PluginEventType_e ++{ ++ PluginMouseEventType, ++ PluginKeyEventType, ++ PluginPaintEventType ++}PluginEventType; ++ ++typedef enum PluginMouseState_e ++{ ++ PluginMouseButtonDown, ++ PluginMouseButtonUp, ++ PluginMouseButtonMove ++}PluginMouseState; ++ ++typedef enum PluginMouseButton_e ++{ ++ PluginMouseButtonLeft, ++ PluginMouseButtonCenter, ++ PluginMouseButtonRight, ++ PluginMouseButtonWheelUp, ++ PluginMouseButtonWheelDown ++}PluginMouseButton; ++ ++typedef enum PluginKeyState_e ++{ ++ PluginKeyDown, ++ PluginKeyUp ++}PluginKeyState; ++ ++typedef enum PluginModifierKey_e ++{ ++ PluginAltKey = 1 << 0, ++ PluginCtrlKey = 1 << 1, ++ PluginMetaKey = 1 << 2, ++ PluginShiftKey = 1 << 3, ++}PluginModifierKey; ++ ++ ++typedef struct PluginRect_s ++{ ++ int16_t top; ++ int16_t left; ++ int16_t bottom; ++ int16_t right; ++} PluginRect; ++ ++typedef struct ++{ ++ uint8_t type; ++ uint8_t state; ++ uint16_t x; ++ uint16_t y; ++ int16_t xrel; ++ int16_t yrel; ++ uint8_t which; ++ uint8_t button; ++} PluginMouseEvent; ++ ++typedef struct ++{ ++ uint8_t type; ++ uint8_t state; ++ uint8_t scancode; ++ uint16_t sym; ++ uint16_t mod; ++ uint16_t unicode; ++} PluginKeyEvent; ++ ++typedef struct ++{ ++ uint8_t type; ++ uint8_t bUseAccelBlit; ++ PluginRect inval; ++ uint16_t w; ++ uint16_t h; ++ uint16_t xoffset; ++ uint16_t yoffset; ++ uint16_t pitch; ++ uint8_t depth; ++ uint8_t* pixels; ++} PluginPaintEvent; ++ ++typedef union ++{ ++ uint8_t type; ++ PluginMouseEvent mouse; ++ PluginKeyEvent key; ++ PluginPaintEvent paint; ++} PluginEvent; ++ ++ ++// Extend the NPNVariable enumeration ++#define NPPVpluginDrawingFunctions 9999 ++ ++typedef void* (*CREATE_SURFACE_FUNC) (int width, int height, int depth_in_bits); ++typedef bool (*FREE_SURFACE_FUNC) (void * pSurface); ++typedef bool (*LOCK_SURFACE_FUNC) (void * pSurface); ++typedef bool (*UNLOCK_SURFACE_FUNC) (void * pSurface); ++typedef void* (*GET_PIXELS_FUNC) (void * pSurface); ++typedef int (*GET_PITCH_FUNC) (void * pSurface); ++typedef bool (*DRAW_RECT_FUNC) (void * pSurface, uint32_t color, const PluginRect* rect); ++typedef bool (*BLIT_FUNC) (void * pSurface, void* pTargetSurface, const int nTargetPitch, const PluginRect* src_rect, ++ const PluginRect* dest_rect, bool bSourceAlpha); ++ ++typedef struct GL_FuncTable_s ++{ ++ CREATE_SURFACE_FUNC pfCreateSurface; ++ FREE_SURFACE_FUNC pfFreeSurface; ++ LOCK_SURFACE_FUNC pfLockSurface; ++ UNLOCK_SURFACE_FUNC pfUnlockSurface; ++ GET_PIXELS_FUNC pfGetPixels; ++ GET_PITCH_FUNC pfGetPitch; ++ DRAW_RECT_FUNC pfDrawRect; ++ BLIT_FUNC pfBlit; ++} GL_FuncTable; ++ ++ ++ ++ ++#endif // PluginEventsSDL_h +diff --git a/WebCore/plugins/embedded/PluginViewEmbedded.cpp b/WebCore/plugins/embedded/PluginViewEmbedded.cpp +new file mode 100644 +index 0000000..c4f12c3 +--- /dev/null ++++ b/WebCore/plugins/embedded/PluginViewEmbedded.cpp +@@ -0,0 +1,931 @@ ++/* ++* Copyright (C) 2006, 2007 Apple Inc. All rights reserved. ++* Copyright (C) 2008 Collabora Ltd. All rights reserved. ++* ++* Redistribution and use in source and binary forms, with or without ++* modification, are permitted provided that the following conditions ++* are met: ++* 1. Redistributions of source code must retain the above copyright ++* notice, this list of conditions and the following disclaimer. ++* 2. Redistributions in binary form must reproduce the above copyright ++* notice, this list of conditions and the following disclaimer in the ++* documentation and/or other materials provided with the distribution. ++* ++* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY ++* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR ++* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ++* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++*/ ++ ++#include "config.h" ++#include "PluginView.h" ++#include "PluginEvents.h" ++ ++#include "Document.h" ++#include "DocumentLoader.h" ++#include "Element.h" ++#include "EventNames.h" ++#include "FocusController.h" ++#include "FrameLoader.h" ++#include "FrameLoadRequest.h" ++#include "FrameTree.h" ++#include "Frame.h" ++#include "FrameView.h" ++#include "GraphicsContext.h" ++#include "Image.h" ++#include "HTMLNames.h" ++#include "HTMLPlugInElement.h" ++#include "KeyboardEvent.h" ++#include "MouseEvent.h" ++#include "NotImplemented.h" ++#include "Page.h" ++#include "PlatformKeyboardEvent.h" ++#include "PlatformMouseEvent.h" ++#include "PluginDebug.h" ++#include "PluginPackage.h" ++#include "RenderLayer.h" ++#include "Settings.h" ++#include "JSDOMBinding.h" ++#include "ScriptController.h" ++#include "npruntime_impl.h" ++//#include "runtime.h" ++//#include "runtime_root.h" ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include ++ ++// These methods are used to detect that the plugin is ++// showing full screen because of USER INTERACTION, ++// not because of a call to BoxeePluginWidget::SetFullScreen. ++ ++//static bool s_bIsFullScreen = false; ++//static void* s_pPluginView = NULL; ++ ++//bool GetBrowserSize(int* width, int* height) ++//{ ++// *width = QScreen::instance()->width(); ++// *height = QScreen::instance()->height(); ++// return true; ++//} ++ ++//bool GetBrowserOffsets(int* offsetX, int* offsetY) ++//{ ++// *offsetX = 0; ++// *offsetY = 0; ++//} ++ ++//bool GetBrowserPluginFullscreen(void** pluginView) ++//{ ++// *pluginView = s_pPluginView; ++// return s_bIsFullScreen; ++//} ++ ++//bool SetBrowserPluginFullscreen(void* pluginView, bool isFullScreen) ++//{ ++// isFullScreen = s_bIsFullScreen; ++// pluginView = s_pPluginView; ++// return true; ++//} ++//bool GetBrowserSize(int* width, int* height) ++//{ ++// *width = QScreen::instance()->width(); ++// *height = QScreen::instance()->height(); ++// return true; ++//} ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ extern bool GetBrowserOffsets(int* offsetX, int* offsetY); ++ extern bool GetBrowserPluginFullscreen(void** pluginView); ++ extern bool SetBrowserPluginFullscreen(void* pluginView, bool isFullScreen); ++ extern bool GetBrowserSize(int* width, int* height); ++#ifdef __cplusplus ++} // extern C ++#endif ++ ++ ++#define TRACE_INFO fprintf ++#define TRACE_DEBUG(...) ++ ++ ++using JSC::ExecState; ++using JSC::Interpreter; ++using JSC::JSObject; ++using JSC::UString; ++ ++using std::min; ++ ++using namespace WTF; ++ ++ ++namespace WebCore { ++ ++// If you want to use SDL as the accellerated drawing framework, ++// here's how it could look. You could also create your own ++// version that uses DirectFB. ++#ifdef ENABLE_SDL ++static void* GLCreateSurface(int width, int height, int depth) ++{ ++ int flagsSdlWindow = SDL_HWSURFACE; ++ void* surface = 0; ++ ++ surface = (void*)SDL_CreateRGBSurface(flagsSdlWindow, width, height, depth, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); ++ if (surface) { ++ LOG(Plugins, "GLCreateSurface Unable to create screen : %s\n", SDL_GetError() ); ++ } ++ ++ printf("OWB: creating plugin backing store using GLCreateSurface surface = %X\n", (unsigned int)surface); ++ ++ return surface; ++} ++static bool GLFreeSurface(void * pSurface) ++{ ++ // printf("OWB: GLFreeSurface\n"); ++ SDL_FreeSurface((SDL_Surface*)pSurface); ++ return TRUE; ++} ++static bool GLLockSurface(void * pSurface) ++{ ++ // printf("OWB: GLLockSurface\n"); ++ SDL_LockSurface((SDL_Surface*)pSurface); ++ return TRUE; ++} ++static bool GLUnlockSurface(void * pSurface) ++{ ++ // printf("OWB: GLUnlockSurface\n"); ++ SDL_UnlockSurface((SDL_Surface*)pSurface); ++ return TRUE; ++} ++static void* GLGetPixels(void * pSurface) ++{ ++ // printf("OWB: GLGetPixels\n"); ++ return ((SDL_Surface*)pSurface)->pixels; ++} ++static int GLGetPitch(void * pSurface) ++{ ++ // printf("OWB: GLGetPitch\n"); ++ return ((SDL_Surface*)pSurface)->pitch; ++} ++static bool GLDrawRect(void * pSurface, uint32_t color, const PluginRect* rect) ++{ ++ // printf("OWB: GLDrawRect\n"); ++ return TRUE; ++} ++static bool GLBlit(void * pSurface, void* pTargetSurface, const int nTargetPitch, const PluginRect* src_rect, ++ const PluginRect* dest_rect, bool bSourceAlpha) ++{ ++ // printf("OWB: GLBlit surface = %X, target = %X\n", (uint32_t)pSurface, (uint32_t)pTargetSurface); ++ if(bSourceAlpha) { ++ SDL_SetAlpha((SDL_Surface*)pSurface, SDL_SRCALPHA, SDL_ALPHA_TRANSPARENT); ++ } ++ ++ SDL_Rect srcRect = {src_rect->left, src_rect->top, src_rect->right - src_rect->left, src_rect->bottom - src_rect->top }; ++ SDL_Rect destRect = { dest_rect->left, dest_rect->top, dest_rect->right - dest_rect->left, dest_rect->bottom - dest_rect->top }; ++ SDL_LowerBlit((SDL_Surface*)pSurface, &srcRect, (SDL_Surface*)pTargetSurface, &destRect); ++ ++ return TRUE; ++} ++bool GLGetFuncs(GL_FuncTable **table) ++{ ++ static GL_FuncTable drawingFuncs = { 0, 0, 0, 0, 0, 0, 0, 0 }; ++ ++ if(!drawingFuncs.pfCreateSurface) { ++ bool bUseAcceleratedPluginBlit = FALSE; ++ // Get the blit acceleration status from environment variable ++ String strUseBlitAccel(getenv("PLUGIN_USE_ACCEL_BLIT")); ++ if(strUseBlitAccel.contains("true")) { ++ LOG(Plugins, "PluginView::paint using acclerated blit\n"); ++ bUseAcceleratedPluginBlit = TRUE; ++ } ++ else { ++ LOG(Plugins, "PluginView::paint using memory drawing functions\n"); ++ } ++ ++ if(bUseAcceleratedPluginBlit == TRUE) { ++ drawingFuncs.pfCreateSurface = GLCreateSurface; ++ drawingFuncs.pfFreeSurface = GLFreeSurface; ++ drawingFuncs.pfLockSurface = GLLockSurface; ++ drawingFuncs.pfUnlockSurface = GLUnlockSurface; ++ drawingFuncs.pfGetPixels = GLGetPixels; ++ drawingFuncs.pfGetPitch = GLGetPitch; ++ drawingFuncs.pfDrawRect = GLDrawRect; ++ drawingFuncs.pfBlit = GLBlit; ++ } ++ } ++ if(drawingFuncs.pfCreateSurface == NULL) { ++ *table = NULL; ++ return FALSE; ++ } ++ else { ++ *table = &drawingFuncs; ++ return TRUE; ++ } ++} ++#else ++bool GLGetFuncs(GL_FuncTable** table) { return false; } ++#endif ++ ++void PluginView::updatePluginWidget() ++{ ++ // Sync state with the containing frame view ++ if (!parent() || !m_isWindowed) ++ return; ++ ++ ASSERT(parent()->isFrameView()); ++ FrameView* frameView = static_cast(parent()); ++ ++ IntRect oldWindowRect = m_windowRect; ++ IntRect oldClipRect = m_clipRect; ++ ++ m_windowRect = IntRect(frameView->contentsToWindow(frameRect().location()), frameRect().size()); ++ m_clipRect = windowClipRect(); ++ m_clipRect.move(-m_windowRect.x(), -m_windowRect.y()); ++} ++ ++void PluginView::setFocus() ++{ ++ // Nothing to do here for our platform ++ Widget::setFocus(); ++} ++ ++void PluginView::show() ++{ ++ LOG(Plugins, "PluginView::show\n"); ++ setSelfVisible(true); ++ ++ Widget::show(); ++} ++ ++void PluginView::hide() ++{ ++ LOG(Plugins, "PluginView::hide\n"); ++ setSelfVisible(false); ++ ++ Widget::hide(); ++} ++ ++void PluginView::paint(GraphicsContext* context, const IntRect& rect) ++{ ++ LOG(Plugins, "PluginView::paint %d, %d, %d, %d\n", rect.x(), rect.y(), rect.width(), rect.height()); ++ ++ if (!m_isStarted || m_status != PluginStatusLoadedSuccessfully) { ++ // Draw the "missing plugin" image ++ paintMissingPluginIcon(context, rect); ++ return; ++ } ++ ++ IntRect scrollOffset(0,0,0,0); ++ ++ PluginEvent event; ++ PluginView * pluginView = NULL; ++ memset(&event, 0, sizeof(PluginEvent)); ++ ++ // From BoxeeBrowser::requestRepaint, we know that the ++ // paint device is in fact a QImage. ++ QPainter* painter = 0; ++ QImage* image = 0; ++ ++ // Are we using accelerated GL functions hosted by the browser? ++ GL_FuncTable *table = NULL; ++ GLGetFuncs(&table); // Set the passed in surface/memory based on the result. ++ if(table != NULL) { ++ // Using internal GL functions ++ LOG(Plugins, "PluginView::paint() using internal GL functions"); ++ event.paint.bUseAccelBlit = true; ++ ++ // This can be any type of surface that is compatible with the ++ // GL_FuncTable functions. Here we're passing the QPainter*, ++ // so your GL funcs need to operate on a QPainter*. ++ event.paint.pixels = (uint8_t*)context->platformContext(); ++ } else { ++ // Passing in a memory bitmap ++ LOG(Plugins, "PluginView::paint() using memory bitmap"); ++ event.paint.bUseAccelBlit = false; ++ ++ // From BoxeeBrowser::requestRepaint, we know that the ++ // paint device is in fact a QImage. ++ painter = context->platformContext(); ++ image = static_cast(painter->device()); ++ event.paint.pixels = (uint8_t*)image->bits(); ++ } ++ ++ for (WebCore::ScrollView* p = parent(); p; p = p->parent()) { ++ int x = scrollOffset.x(); ++ int y = scrollOffset.y(); ++ scrollOffset.setX(x + p->x() - p->scrollX()); ++ scrollOffset.setY(y + p->y() - p->scrollY()); ++ } ++ ++ LOG(Plugins, "PluginView::paint scroll offset x -> %d, y -> %d\n", scrollOffset.x(), scrollOffset.y()); ++ ++ // There are three modes. ++ // 1. Normal mode, embedded in web page ++ // 2. Full screen because of user interaction ++ // 3. Full screen because of BoxeePluginWidget::ShowFullScreen. ++ ++ // Are we running full screen because of USER INTERACTION? ++ // (e.g. clicking the full screen button on youtube) ++ IntRect invalRect(0,0,0,0); ++ // At this point, we could be in normal mode or BoxeePluginWidget::SetFullScreen ++ LOG(Plugins, "PluginView::paint Normal Mode"); ++ IntRect rectWidget = frameRect(); ++ event.type = PluginPaintEventType; ++ if (m_isFullscreen) { ++ event.paint.inval.left = 0; ++ event.paint.inval.top = 0; ++ event.paint.inval.right = QScreen::instance()->width(); ++ event.paint.inval.bottom = QScreen::instance()->height(); ++ event.paint.xoffset = 0; ++ event.paint.yoffset = 0; ++ ++ if (painter && m_shouldClearFullscreen) { ++ painter->fillRect(QRect(QPoint(0, 0), QSize(image->size())), QColor(0,0,0,0)); ++ m_shouldClearFullscreen = false; ++ m_fullScreenInvalidRect = IntRect(0, 0, event.paint.w, event.paint.h); ++ } ++ } else { ++ ++ event.paint.inval.left = rect.x() + scrollOffset.x(); ++ event.paint.inval.top = rect.y() + scrollOffset.y(); ++ event.paint.inval.right = event.paint.inval.left + rect.width(); ++ event.paint.inval.bottom = event.paint.inval.top + rect.height(); ++ event.paint.xoffset = rectWidget.x() + scrollOffset.x(); ++ event.paint.yoffset = rectWidget.y() + scrollOffset.y(); ++ } ++ ++ event.paint.w = image->width(); ++ event.paint.h = image->height(); ++ ++ event.paint.pitch = image->bytesPerLine(); ++ event.paint.depth = 4; ++ ++ NPEvent pEvt = &event; // NPEvent is typedef'd as void* ++ ++ // Finally call into the plugin ++ PluginView::setCurrentPluginView(this); ++ JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); ++ setCallingPlugin(true); ++ m_plugin->pluginFuncs()->event(m_instance, pEvt); ++ setCallingPlugin(false); ++ PluginView::setCurrentPluginView(0); ++ ++ TRACE_DEBUG(stderr, "m_isFakeFullscreen %d m_actualFullscreen %d m_isFullscreen %d m_fullscreenByPlugin %d w %d h %d\n", ++ m_isFakeFullscreen, m_actualFullscreen, m_isFullscreen, m_fullscreenByPlugin, image->width(), image->height()); ++ if (!m_isFakeFullscreen && !m_fullscreenByPlugin && m_actualFullscreen != m_isFullscreen) ++ { ++ sendFullscreenEventToPlugin(); ++ } ++ else if (!m_isFakeFullscreen && m_fullscreenByPlugin && m_actualFullscreen != m_isFullscreen) ++ { ++ m_actualFullscreen = m_isFullscreen; ++ } ++} ++ ++void PluginView::sendFullscreenEventToPlugin() ++{ ++ TRACE_INFO(stderr, "m_isFakeFullscreen %d m_actualFullscreen %d m_isFullscreen %d \n", m_isFakeFullscreen, m_actualFullscreen, m_isFullscreen); ++ PluginEvent evt; ++ memset(&evt, 0, sizeof(PluginEvent)); ++ evt.type = PluginPaintEventType + 1; // hack. we dont have the constant yet... ++ NPEvent pEvt = &evt; ++ ++ LOG(Plugins, "Sending Fullscreen Event\n"); ++ TRACE_INFO(stderr, "before Sending Fullscreen Event\n"); ++ setCallingPlugin(true); ++ m_sentWindowEvent = true; ++ bool ret = m_plugin->pluginFuncs()->event(m_instance, pEvt); ++ m_sentWindowEvent = false; ++ setCallingPlugin(false); ++ TRACE_INFO(stderr, "after Sending Fullscreen Event\n"); ++ ++ m_actualFullscreen = m_isFullscreen; ++} ++ ++void PluginView::handleKeyboardEvent(KeyboardEvent* event) ++{ ++ if (m_isWindowed) ++ return; ++ ++ String key = event->keyEvent()->keyIdentifier(); ++ if (key == "F1" || key == "F2" || key == "F3" || key == "F4" || ++ key == "F5" || key == "F6" || key == "F7" || key == "F8" || ++ key == "F9" || key == "F10" || key == "F11" || key == "F12") { ++ return; ++ } ++ ++ PluginEvent evt; ++ memset(&evt, 0, sizeof(PluginEvent)); ++ evt.type = PluginKeyEventType; ++ ++ switch (event->keyEvent()->type()) { ++ case PlatformKeyboardEvent::RawKeyDown: ++ evt.key.state = PluginKeyDown; ++ break; ++ case PlatformKeyboardEvent::KeyUp: ++ evt.key.state = PluginKeyUp; ++ break; ++ default: ++ return; ++ } ++ ++ ++ QKeyEvent* qtKeyEvent = event->keyEvent()->qtEvent(); ++ TRACE_DEBUG("qt key event unicode %d\n", qtKeyEvent->text().unicode()[0].unicode()); ++ ++ int charCode = (event)->charCode(); ++ evt.key.scancode = event->keyCode(); ++ evt.key.sym = event->keyEvent()->windowsVirtualKeyCode(); ++ evt.key.mod = event->keyEvent()->modifiers(); ++ if (evt.key.sym == 0 && evt.key.scancode == 0) ++ evt.key.scancode = evt.key.sym = qtKeyEvent->text().unicode()[0].unicode(); ++ TRACE_INFO(stderr, "plugin keyboard event state %d scancode %d sym %d mod %d text '%s'' charCode %d\n", ++ (int)evt.key.state, ++ (int)evt.key.scancode, ++ (int)evt.key.sym, ++ (int)evt.key.mod, ++ ((QString)event->keyEvent()->keyIdentifier()).toAscii().data(), ++ charCode); ++ evt.key.unicode = evt.key.scancode; ++ ++ NPEvent pEvt = &evt; ++ ++ LOG(Plugins, "Sending Keyboard Event\n"); ++ PluginView::setCurrentPluginView(this); ++ JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); ++ setCallingPlugin(true); ++ bool ret = m_plugin->pluginFuncs()->event(m_instance, pEvt); ++ setCallingPlugin(false); ++ PluginView::setCurrentPluginView(0); ++ if (ret) ++ event->setDefaultHandled(); ++} ++ ++void PluginView::handleMouseEvent(MouseEvent* event) ++{ ++ PluginEvent evt; ++ memset(&evt, 0, sizeof(PluginEvent)); ++ evt.type = PluginMouseEventType; ++ ++ int state = PluginMouseButtonMove; ++ if(event->type() == eventNames().mouseoverEvent) { ++ state = PluginMouseButtonMove; ++ } ++ else if(event->type() == eventNames().mousedownEvent) { ++ state = PluginMouseButtonDown; ++ if (Page* page = m_parentFrame->page()) ++ page->focusController()->setFocusedFrame(m_parentFrame); ++ m_parentFrame->document()->setFocusedNode(m_element); ++ } ++ else if(event->type() == eventNames().mouseupEvent) { ++ state = PluginMouseButtonUp; ++ } ++ evt.mouse.state = state; ++ evt.mouse.xrel = 0; ++ evt.mouse.yrel = 0; ++ evt.mouse.which = 0; // Device index ++ evt.mouse.button = event->button(); ++ ++ IntRect scrollOffset(0,0,0,0); ++ IntPoint p(0,0); ++ ++ // ++ // Don't modify the mouse position if we're full-screen. ++ // ++ PluginView* pluginView; ++ p = static_cast(parent())->contentsToWindow(IntPoint(event->pageX(), event->pageY())); ++ for (WebCore::ScrollView* pt = parent(); ++ pt; pt = pt->parent()) { ++ int x = scrollOffset.x(); ++ int y = scrollOffset.y(); ++ scrollOffset.setX(x + pt->x() - pt->scrollX()); ++ scrollOffset.setY(y + pt->y() - pt->scrollY()); ++ } ++ evt.mouse.x = p.x() - frameRect().x() - scrollOffset.x(); ++ evt.mouse.y = p.y() - frameRect().y() - scrollOffset.y(); ++ ++ NPEvent pEvt = &evt; ++ ++ // LOG(Plugins, "Sending Mouse Event state = %d, x,y = %d, %d\n", evt.mouse.state, evt.mouse.x, evt.mouse.y); ++ PluginView::setCurrentPluginView(this); ++ JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); ++ setCallingPlugin(true); ++ bool ret = m_plugin->pluginFuncs()->event(m_instance, pEvt); ++ setCallingPlugin(false); ++ PluginView::setCurrentPluginView(0); ++ if (ret) ++ event->setDefaultHandled(); ++} ++ ++void PluginView::setParent(ScrollView* parent) ++{ ++ Widget::setParent(parent); ++ ++ if (parent) ++ init(); ++} ++ ++void PluginView::setNPWindowRect(const IntRect& rect) ++{ ++ LOG(Plugins, "PluginView::setNPWindowRect(%d, %d, %d, %d)", rect.x(), rect.y(), rect.width(), rect.height()); ++ TRACE_INFO(stderr, "PluginView::setNPWindowRect(%d, %d, %d, %d)\n", rect.x(), rect.y(), rect.width(), rect.height()); ++ if (!m_isStarted || !parent()) { ++ LOG(Plugins, "PluginView::setNPWindowRect() RETURNING WITHOUT DOING NOTHING"); ++ return; ++ } ++ ++ int offsetX = 0; ++ int offsetY = 0; ++ ++ ::GetBrowserOffsets(&offsetX, &offsetY); ++ ++ IntPoint p(0,0); ++ ++ PluginView* pluginView; ++ if (!::GetBrowserPluginFullscreen((void**)&pluginView)) { ++ TRACE_INFO(stderr, " %s %d - not in full screen, translating rect location to content\n", __FUNCTION__, __LINE__); ++ p = static_cast(parent())->contentsToWindow(rect.location()); ++ } ++ ++#if 0 ++ if(m_npWindow.x == (p.x() + offsetX) && ++ m_npWindow.y == (p.y() + offsetY) && ++ m_npWindow.width == rect.width() && ++ m_npWindow.height == rect.height()) { ++ // This is the same data as already exists ++ return; ++ } ++#endif ++ m_npWindow.x = p.x(); ++ m_npWindow.y = p.y(); ++ ++ // Add in offset for browser window from screen origin ++ m_npWindow.x += offsetX; ++ m_npWindow.y += offsetY; ++ ++ m_npWindow.width = rect.width(); ++ m_npWindow.height = rect.height(); ++ ++ m_npWindow.clipRect.left = 0; ++ m_npWindow.clipRect.top = 0; ++ m_npWindow.clipRect.right = rect.width(); ++ m_npWindow.clipRect.bottom = rect.height(); ++ ++ if (m_npWindow.width <= 0 || m_npWindow.height <= 0) ++ return; ++ ++ if (m_plugin->pluginFuncs()->setwindow) { ++ TRACE_DEBUG(stderr, "%s %d - plugin has a window size callback\n", __FUNCTION__, __LINE__); ++#if 0 ++ if (m_isFullscreen) { ++ TRACE_INFO(stderr, "%s %d - plugin was set to fullscreen\n", __FUNCTION__, __LINE__); ++ m_npWindow.x = 0; ++ m_npWindow.y = 0; ++ m_npWindow.width = QScreen::instance()->width(); ++ m_npWindow.height = QScreen::instance()->height(); ++ m_npWindow.clipRect.right = m_npWindow.width; ++ m_npWindow.clipRect.bottom = m_npWindow.height; ++ TRACE_INFO(stderr, "%s %d - set fullscreen to %d * %d\n", __FUNCTION__, __LINE__, m_npWindow.width, m_npWindow.height); ++ LOG(Plugins, "PluginView::setNPWindowRect() Going fullscreen %d, %d", m_npWindow.width, m_npWindow.height); ++ } ++#endif ++ PluginView::setCurrentPluginView(this); ++ JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); ++ setCallingPlugin(true); ++ m_plugin->pluginFuncs()->setwindow(m_instance, &m_npWindow); ++ setCallingPlugin(false); ++ PluginView::setCurrentPluginView(0); ++ } ++} ++ ++void PluginView::invalidateRegion(NPRegion) ++{ ++ notImplemented(); ++} ++ ++NPError PluginView::handlePostReadFile(Vector& buffer, uint32 len, const char* buf) ++{ ++ return NPERR_NO_ERROR; ++} ++ ++// Used before the plugin view has been initialized properly, and as a ++// fallback for variables that do not require a view to resolve. ++bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPError* out) ++{ ++ LOG(Plugins, "PluginView::platformGetValueStatic(%s)", prettyNameForNPNVariable(variable).data()); ++ ++ switch (variable) { ++ case NPNVToolkit: ++ *static_cast(value) = 0; ++ *out = NPERR_NO_ERROR; ++ return true; ++ ++ case NPNVjavascriptEnabledBool: ++ *static_cast(value) = true; ++ *out = NPERR_NO_ERROR; ++ return true; ++ ++ ++ default: ++ *out = NPERR_GENERIC_ERROR; ++ return false; ++ } ++} ++ ++bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* out) ++{ ++ return false; ++} ++ ++void PluginView::invalidateRect(const IntRect& r) ++{ ++// LOG(Plugins, "PluginView::invalidateRect(const IntRect&) %d, %d, %d, %d\n", r.x(), r.y(), r.width(), r.height()); ++ ASSERT(!m_isWindowed); // We're not gonna be windowed in this port ++ ++ // Windowless plugin ++ // No need to send an event this is generated by the invalidateWindowlessPluginRect call ++ invalidateWindowlessPluginRect(r); ++ ++ // If the plugin is in FS mode then save the invalidate rectangle ++ PluginView * pluginView = 0; ++ if(::GetBrowserPluginFullscreen((void**)&pluginView) == true && pluginView) { ++ if(pluginView == this) { ++ // This is the plugin that is currently in FS ++ m_invalidRects.append(r); ++ } ++ } ++} ++ ++void PluginView::invalidateRect(NPRect* rect) ++{ ++ if (!rect) { ++// LOG(Plugins, "PluginView::invalidateRect(NPRect*) NULL\n"); ++ invalidate(); ++ return; ++ } ++// LOG(Plugins, "PluginView::invalidateRect(NPRect*) %d, %d, %d, %d\n", rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top); ++ IntRect r(rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top); ++ invalidateRect(r); ++} ++ ++void PluginView::forceRedraw() ++{ ++ LOG(Plugins, "PluginView::forceRedraw()"); ++} ++ ++bool PluginView::platformStart() ++{ ++ LOG(Plugins, "PluginView::platformStart()"); ++ ASSERT(m_isStarted); ++ ASSERT(m_status == PluginStatusLoadedSuccessfully); ++ ++ LOG(Plugins, "PluginView::platformStart() 1"); ++ if (m_plugin->pluginFuncs()->getvalue) { ++ /*PluginView::setCurrentPluginView(this); ++ setCallingPlugin(true); ++ m_plugin->pluginFuncs()->getvalue(m_instance, NPPVpluginNeedsXEmbed, &m_needsXEmbed); ++ setCallingPlugin(false); ++ PluginView::setCurrentPluginView(0);*/ ++ } ++ ++ if (m_isWindowed) ++ m_npWindow.type = NPWindowTypeWindow; ++ else { ++ m_npWindow.type = NPWindowTypeDrawable; ++ m_npWindow.window = 0; ++ } ++ ++ LOG(Plugins, "PluginView::platformStart() 2"); ++ ++ //if (!(m_plugin->quirks().contains(PluginQuirkDeferFirstSetWindowCall))) ++ setNPWindowRect(frameRect()); ++ ++ setPlatformPluginWidget(0/*m_parentFrame->view()->hostWindow()->platformWindow()*/); ++ ++ show(); ++ ++ // Set the Browser GL Drawing Funcs ++ if (m_plugin->pluginFuncs()->setvalue) { ++ GL_FuncTable *table = 0; ++ // Get the callback table ++ GLGetFuncs(&table); ++ if(table) { ++ LOG(Plugins, "PluginView::init sending browser hosted GL function to plugin\n"); ++ m_plugin->pluginFuncs()->setvalue(m_instance, (NPNVariable)NPPVpluginDrawingFunctions, table); ++ } ++ else { ++ LOG(Plugins, "PluginView::init using plugin based memory drawing functions\n"); ++ } ++ } else { ++ LOG(Plugins, "m_plugins()->pluginFuncs()->setvalue is NULL! Unable to inject browser hosted GL functions into plugin!"); ++ } ++ ++ return true; ++} ++ ++void PluginView::platformDestroy() ++{ ++} ++ ++void PluginView::setParentVisible(bool visible) ++{ ++ if (isParentVisible() == visible) ++ return; ++ ++ Widget::setParentVisible(visible); ++} ++ ++NPError PluginView::platformSetValue(NPPVariable variable, void* value) ++{ ++ NPRect* rect = (NPRect*)value; ++ int width, height, x, y; ++ LOG(Plugins, "PluginView::setValue received NPPVpluginWindowSize event size(l,t,r,b) = %d, %d, %d, %d", ++ rect->left, rect->top, rect->right, rect->bottom); ++ TRACE_INFO(stderr, "%s %d - window size event [(l,t,r,b) = %d, %d, %d, %d] is full screen by plugin - %d\n", ++ __FUNCTION__, __LINE__, rect->left, rect->top, rect->right, rect->bottom, m_fullscreenByPlugin); ++ TRACE_INFO(stderr, "%s %d - window size event m_fullscreenByPlugin = %d, m_sentWindowEvent = %d\n", ++ __FUNCTION__, __LINE__, m_fullscreenByPlugin, m_sentWindowEvent); ++ // Is this the full screen? ++ ::GetBrowserSize(&width, &height); ++ ::GetBrowserOffsets(&x, &y); ++ ++ if (!m_sentWindowEvent && ++ width <= (rect->right - rect->left) && height <= (rect->bottom - rect->top)) { ++ LOG(Plugins, "PluginView::setValue set FULLSCREEN mode to ON\n"); ++ ::SetBrowserPluginFullscreen(this, true); ++ showFullscreen(!m_isFullscreen, false, true); ++ setNPWindowRect(IntRect(x,y,640,480)); ++ } else { ++ LOG(Plugins, "PluginView::setValue set FULLSCREEN mode to OFF"); ++ if (m_fullscreenByPlugin) ++ showFullscreen(false, false, true); ++ if (!m_sentWindowEvent) ++ ::SetBrowserPluginFullscreen(this, false); ++ setNPWindowRect(frameRect()); ++ ++ IntRect r(0, 0, width, height); ++ ScrollView* rootView = root(); ++ if (rootView) ++ rootView->invalidateRect(r); ++ } ++ ++ return NPERR_NO_ERROR; ++} ++ ++void PluginView::halt() ++{ ++} ++ ++void PluginView::restart() ++{ ++} ++ ++void PluginView::showFullscreen(bool isFullscreen, bool fakeFullscreen, bool fullscreenByPlugin) ++{ ++ ++ TRACE_INFO(stderr, "%s %d - isFullscreen = %d, fakeFullScreen = %d, fullscreenByPlugin = %d\n", ++ __FUNCTION__, __LINE__, isFullscreen, fakeFullscreen, fullscreenByPlugin); ++ ++ bool sendFullscreenEvent = false; ++ ++ if (m_isFullscreen && m_isFakeFullscreen != fakeFullscreen) ++ { ++ // if fullscreen is not fake, we can't change the state as if it's fake ++ fakeFullscreen = m_isFakeFullscreen; ++ TRACE_INFO(stderr, "%s %d - setting isFakeFullscreen to current value %d\n", ++ __FUNCTION__, __LINE__, m_isFakeFullscreen); ++ } ++ ++ if (m_isFullscreen && !isFullscreen && m_fullscreenByPlugin) ++ { ++// // if we fullscreen mode was initiated by the plugin, leaving it should be done the same ++// if (!fullscreenByPlugin) ++// sendFullscreenEvent = true; ++// fullscreenByPlugin = true; ++ TRACE_INFO(stderr, "%s %d - setting fullscreenByPlugin to current true\n", ++ __FUNCTION__, __LINE__); ++ } ++ ++ m_isFakeFullscreen = fakeFullscreen; ++ m_isFullscreen = isFullscreen; ++ m_shouldClearFullscreen = !fakeFullscreen; ++ m_fullscreenByPlugin = fullscreenByPlugin; ++ ::SetBrowserPluginFullscreen(this, isFullscreen); ++ //setNPWindowRect(frameRect()); // For fullscreen, it is going to override whatever rect we pass in. ++ if (sendFullscreenEvent) ++ { ++ sendFullscreenEventToPlugin(); // For fullscreen, it is going to override whatever rect we pass in. ++ } ++} ++ ++void PluginView::handleEvent(QEvent* event) ++{ ++ switch (event->type()) ++ { ++ case QEvent::MouseButtonDblClick: ++ case QEvent::MouseButtonPress: ++ case QEvent::MouseButtonRelease: ++ case QEvent::MouseMove: ++ { ++ QMouseEvent *mevent = static_cast(event); ++ PluginEvent evt; ++ memset(&evt, 0, sizeof(PluginEvent)); ++ evt.type = PluginMouseEventType; ++ ++ int state; ++ if (mevent->type() == QMouseEvent::MouseButtonPress) ++ state = PluginMouseButtonDown; ++ else if (mevent->type() == QMouseEvent::MouseButtonRelease) ++ state = PluginMouseButtonUp; ++ else ++ state = PluginMouseButtonMove; ++ ++ evt.mouse.state = state; ++ evt.mouse.xrel = 0; ++ evt.mouse.yrel = 0; ++ evt.mouse.which = 0; // Device index ++ evt.mouse.button = 0; // need to translate from QT::MouseButton to PluginMouseButton ++ evt.mouse.x = mevent->x(); ++ evt.mouse.y = mevent->y(); ++ ++ NPEvent pEvt = &evt; ++ ++ // LOG(Plugins, "Sending Mouse Event state = %d, x,y = %d, %d\n", evt.mouse.state, evt.mouse.x, evt.mouse.y); ++ PluginView::setCurrentPluginView(this); ++ JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); ++ setCallingPlugin(true); ++ bool ret = m_plugin->pluginFuncs()->event(m_instance, pEvt); ++ setCallingPlugin(false); ++ PluginView::setCurrentPluginView(0); ++ } ++ break; ++ ++ case QEvent::KeyPress: ++ case QEvent::KeyRelease: ++ { ++ ++ QKeyEvent *kevent = static_cast(event); ++ ++ ++ PluginEvent evt; ++ memset(&evt, 0, sizeof(PluginEvent)); ++ evt.type = PluginKeyEventType; ++ ++ switch (kevent->type()) { ++ case QEvent::KeyPress: ++ evt.key.state = PluginKeyDown; ++ break; ++ case QEvent::KeyRelease: ++ evt.key.state = PluginKeyUp; ++ break; ++ default: ++ return; ++ } ++ TRACE_INFO(stderr, "kevent->key() %d kevent->text().unicode()[0].unicode() %d\n", kevent->key(), kevent->text().unicode()[0].unicode()); ++ ++ evt.key.mod = kevent->modifiers();// event->keyEvent()->modifiers(); ++ ++ if (!kevent->key() || kevent->key() == kevent->text().unicode()[0].unicode()) ++ { ++ evt.key.unicode = kevent->text().unicode()[0].unicode(); ++ } ++ else ++ { ++ evt.key.sym = evt.key.scancode = kevent->text().unicode()[0].unicode(); ++ } ++ ++ TRACE_INFO(stderr, "handle event - keyboard event %d %d %d %d\n", (int)evt.key.state, (int)evt.key.scancode, (int)evt.key.sym, (int)evt.key.mod); ++ ++ NPEvent pEvt = &evt; ++ ++ LOG(Plugins, "Sending Keyboard Event\n"); ++ PluginView::setCurrentPluginView(this); ++ JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); ++ setCallingPlugin(true); ++ bool ret = m_plugin->pluginFuncs()->event(m_instance, pEvt); ++ setCallingPlugin(false); ++ PluginView::setCurrentPluginView(0); ++ } ++ break; ++ ++ default: ++ break; ++ } ++} ++ ++} // namespace WebCore +diff --git a/WebCore/plugins/npapi.cpp b/WebCore/plugins/npapi.cpp +index 4135b64..65d9bb1 100644 +--- a/WebCore/plugins/npapi.cpp ++++ b/WebCore/plugins/npapi.cpp +@@ -104,6 +104,10 @@ NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason) + return pluginViewForInstance(instance)->destroyStream(stream, reason); + } + ++#if defined(XP_EMBEDDED) ++extern "C" __attribute__((visibility("default"))) const char* NPN_UserAgent(NPP instance); ++#endif ++ + const char* NPN_UserAgent(NPP instance) + { + PluginView* view = pluginViewForInstance(instance); +@@ -175,3 +179,13 @@ void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userDa + { + PluginMainThreadScheduler::scheduler().scheduleCall(instance, func, userData); + } ++ ++uint32 NPN_ScheduleTimer(NPP instance, uint32 interval, NPBool repeat, void (*timerFunc)(NPP instance, uint32 timerID)) ++{ ++ return pluginViewForInstance(instance)->scheduleTimer(interval, repeat, timerFunc); ++} ++ ++void NPN_UnscheduleTimer(NPP instance, uint32 timerID) ++{ ++ pluginViewForInstance(instance)->unscheduleTimer(timerID); ++} +diff --git a/WebCore/plugins/npfunctions.h b/WebCore/plugins/npfunctions.h +index e28bf5e..9cee289 100644 +--- a/WebCore/plugins/npfunctions.h ++++ b/WebCore/plugins/npfunctions.h +@@ -199,7 +199,7 @@ typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void); + typedef NPError (*MainFuncPtr)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownProcPtr*); + #endif + +-#if defined(XP_UNIX) ++#if defined(XP_UNIX) || defined(XP_EMBEDDED) + typedef EXPORTED_CALLBACK(NPError, NP_InitializeFuncPtr)(NPNetscapeFuncs*, NPPluginFuncs*); + typedef EXPORTED_CALLBACK(char*, NP_GetMIMEDescriptionFuncPtr)(void); + #else +diff --git a/WebCore/plugins/qt/PluginPackageQt.cpp b/WebCore/plugins/qt/PluginPackageQt.cpp +index d5292fe..60d9b18 100644 +--- a/WebCore/plugins/qt/PluginPackageQt.cpp ++++ b/WebCore/plugins/qt/PluginPackageQt.cpp +@@ -37,6 +37,12 @@ namespace WebCore { + + typedef void gtkInitFunc(int *argc, char ***argv); + ++#ifdef XP_EMBEDDED ++void PluginPackage::determineQuirks(const String& mimeType) ++{ ++} ++#endif ++ + bool PluginPackage::fetchInfo() + { + if (!load()) +@@ -102,7 +108,7 @@ bool PluginPackage::load() + m_module = new QLibrary((QString)m_path); + m_module->setLoadHints(QLibrary::ResolveAllSymbolsHint); + if (!m_module->load()) { +- LOG(Plugins, "%s not loaded (%s)", m_path.utf8().data(), ++ LOG(Plugins, "%s not loaded (%s)\n", m_path.utf8().data(), + m_module->errorString().toLatin1().constData()); + return false; + } +@@ -150,7 +156,7 @@ bool PluginPackage::load() + #endif + } + +-#if defined(XP_UNIX) ++#if defined(XP_UNIX) || defined(XP_EMBEDDED) + npErr = NP_Initialize(&m_browserFuncs, &m_pluginFuncs); + #else + npErr = NP_Initialize(&m_browserFuncs); +@@ -162,6 +168,7 @@ bool PluginPackage::load() + return true; + + abort: ++ LOG(Plugins, "PluginPackage FAILD TO LOAD!"); + unloadWithoutShutdown(); + return false; + } +diff --git a/WebKit.pri b/WebKit.pri +index bb3fd71..96ee032 100644 +--- a/WebKit.pri ++++ b/WebKit.pri +@@ -52,9 +52,24 @@ BASE_DIR = $$PWD + symbian { + INCLUDEPATH += $$PWD/include/QtWebKit + } else { +- INCLUDEPATH += $$OUTPUT_DIR/include/QtWebKit ++ INCLUDEPATH += $$OUTPUT_DIR/include/QtWebKit + } + ++embedded { ++ INCLUDEPATH += /opt/canmore/local/include ++ LIBS += -L/opt/canmore/local/lib ++ QMAKE_LFLAGS_NOUNDEF = ++ QMAKE_LFLAGS_DEBUG = -L/opt/canmore/local/lib ++ QMAKE_LFLAGS_RELEASE = -L/opt/canmore/local/lib ++} ++ ++ ++ INCLUDEPATH += /opt/canmore/local/include ++ LIBS += -L/opt/canmore/local/lib ++ QMAKE_LFLAGS_NOUNDEF = ++ QMAKE_LFLAGS_DEBUG = -L/opt/canmore/local/lib ++ QMAKE_LFLAGS_RELEASE = -L/opt/canmore/local/lib ++ + CONFIG -= warn_on + *-g++*:QMAKE_CXXFLAGS += -Wall -Wreturn-type -fno-strict-aliasing -Wcast-align -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self + +diff --git a/WebKit.pro b/WebKit.pro +index c7df391..5ecefee 100644 +--- a/WebKit.pro ++++ b/WebKit.pro +@@ -2,21 +2,25 @@ TEMPLATE = subdirs + CONFIG += ordered + + include(WebKit.pri) +- ++ + SUBDIRS += \ + JavaScriptCore \ + WebCore + + # If the source exists, built it +-exists($$PWD/WebKitTools/QtTestBrowser): SUBDIRS += WebKitTools/QtTestBrowser ++!embedded { ++ exists($$PWD/WebKitTools/QtTestBrowser): SUBDIRS += WebKitTools/QtTestBrowser ++} + contains(QT_CONFIG, declarative) { + exists($$PWD/WebKit/qt/declarative): SUBDIRS += WebKit/qt/declarative + } + exists($$PWD/JavaScriptCore/jsc.pro): SUBDIRS += JavaScriptCore/jsc.pro ++!embedded { + exists($$PWD/WebKit/qt/tests): SUBDIRS += WebKit/qt/tests + exists($$PWD/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro): SUBDIRS += WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro ++} + +-!win32:!symbian { ++!win32:!symbian:!embedded { + exists($$PWD/WebKitTools/DumpRenderTree/qt/ImageDiff.pro): SUBDIRS += WebKitTools/DumpRenderTree/qt/ImageDiff.pro + exists($$PWD/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro): SUBDIRS += WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro + } +diff --git a/WebKit/qt/Api/qwebelement.cpp b/WebKit/qt/Api/qwebelement.cpp +index 69146a2..6fd6f9a 100644 +--- a/WebKit/qt/Api/qwebelement.cpp ++++ b/WebKit/qt/Api/qwebelement.cpp +@@ -36,6 +36,7 @@ + #include "JSHTMLElement.h" + #include "JSObject.h" + #include "NodeList.h" ++#include "PluginView.h" + #include "PropertyNameArray.h" + #include "RenderImage.h" + #include "StaticNodeList.h" +@@ -1461,6 +1462,22 @@ void QWebElement::render(QPainter* painter) + context.restore(); + } + ++void QWebElement::showFullscreen(bool isFullscreen, bool isFakeFullScreen, void* pluginIdentifier) ++{ ++ if (!pluginIdentifier) ++ return; ++ PluginView* pluginView = reinterpret_cast(pluginIdentifier); ++ pluginView->showFullscreen(isFullscreen, isFakeFullScreen, false); ++} ++ ++void QWebElement::handleEvent(QEvent* event, void* pluginIdentifier) ++{ ++ if (!pluginIdentifier) ++ return; ++ PluginView* pluginView = reinterpret_cast(pluginIdentifier); ++ pluginView->handleEvent(event); ++} ++ + class QWebElementCollectionPrivate : public QSharedData + { + public: +diff --git a/WebKit/qt/Api/qwebelement.h b/WebKit/qt/Api/qwebelement.h +index a87d388..dd75d75 100644 +--- a/WebKit/qt/Api/qwebelement.h ++++ b/WebKit/qt/Api/qwebelement.h +@@ -147,6 +147,8 @@ public: + void setStyleProperty(const QString& name, const QString& value); + + void render(QPainter* painter); ++ void showFullscreen(bool isFullscreen, bool isFakeFullScreen, void* pluginIdentifier); ++ void handleEvent(QEvent* event, void* pluginIdentifier); + + private: + explicit QWebElement(WebCore::Element*); +@@ -155,6 +157,7 @@ private: + static QWebElement enclosingElement(WebCore::Node*); + + friend class QWebFrame; ++ friend class QWebFramePrivate; + friend class QWebElementCollection; + friend class QWebHitTestResult; + friend class QWebHitTestResultPrivate; +diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp +index 4fe784f..49e249a 100644 +--- a/WebKit/qt/Api/qwebframe.cpp ++++ b/WebKit/qt/Api/qwebframe.cpp +@@ -523,6 +523,12 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame: + } + } + ++void QWebFramePrivate::pluginCreated(Element* element, void* pluginInstance) ++{ ++ QWebElement pluginElement(element); ++ emit q->pluginCreated(pluginElement, pluginInstance); ++} ++ + /*! + \class QWebFrame + \since 4.4 +diff --git a/WebKit/qt/Api/qwebframe.h b/WebKit/qt/Api/qwebframe.h +index ce9805b..220d134 100644 +--- a/WebKit/qt/Api/qwebframe.h ++++ b/WebKit/qt/Api/qwebframe.h +@@ -220,6 +220,8 @@ Q_SIGNALS: + + void pageChanged(); + ++ void pluginCreated(const QWebElement& pluginElement, void* pluginIdentifier); ++ + private: + friend class QGraphicsWebView; + friend class QWebPage; +diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h +index fcc37e7..c4ff8d0 100644 +--- a/WebKit/qt/Api/qwebframe_p.h ++++ b/WebKit/qt/Api/qwebframe_p.h +@@ -88,6 +88,8 @@ public: + void renderFromTiledBackingStore(WebCore::GraphicsContext*, const QRegion& clip); + #endif + ++ void pluginCreated(WebCore::Element* element, void* pluginIdentifier); ++ + QWebFrame *q; + Qt::ScrollBarPolicy horizontalScrollBarPolicy; + Qt::ScrollBarPolicy verticalScrollBarPolicy; +diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp +index d907d86..3ff315e 100644 +--- a/WebKit/qt/Api/qwebsettings.cpp ++++ b/WebKit/qt/Api/qwebsettings.cpp +@@ -28,6 +28,8 @@ + #include "CrossOriginPreflightResultCache.h" + #include "Database.h" + #include "FontCache.h" ++#include "JSDOMWindowBase.h" ++#include "JSGlobalData.h" + #include "Page.h" + #include "PageCache.h" + #include "Settings.h" +@@ -997,6 +999,17 @@ qint64 QWebSettings::offlineWebApplicationCacheQuota() + } + + /*! ++ \since Boxee ++ ++ Set the timeout for JavaScript interrupts, or 0 to disable timeout. ++*/ ++void QWebSettings::setJavaScriptInterruptTimeoutInterval(quint32 timeoutInterval) ++{ ++ WebCore::JSDOMWindowBase::commonJSGlobalData()->timeoutChecker.setTimeoutInterval(timeoutInterval); ++} ++ ++ ++/*! + \since 4.6 + + Sets the path for HTML5 local storage to \a path. +diff --git a/WebKit/qt/Api/qwebsettings.h b/WebKit/qt/Api/qwebsettings.h +index 156f633..09804e1 100644 +--- a/WebKit/qt/Api/qwebsettings.h ++++ b/WebKit/qt/Api/qwebsettings.h +@@ -141,6 +141,8 @@ public: + + static void enablePersistentStorage(const QString& path = QString()); + ++ static void setJavaScriptInterruptTimeoutInterval(quint32 timeoutInterval); ++ + inline QWebSettingsPrivate* handle() const { return d; } + + private: +diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +index dcbf614..d3e63f9 100644 +--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp ++++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +@@ -1367,14 +1367,42 @@ PassRefPtr FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, + if (wmodeIndex == -1) { + params.append("wmode"); + values.append("opaque"); +- } else ++ } else { ++#ifdef Q_WS_X11 ++ // wmode=opaque only required on X11, http://blog.forwardbias.in/2009/12 + values[wmodeIndex] = "opaque"; ++#endif ++ } ++ ++ size_t fsIndex = params.find("allowfullscreen"); ++ if (fsIndex == -1) { ++ params.append("allowfullscreen"); ++ values.append("true"); ++ } else { ++ values[fsIndex] = "true"; ++ } ++ ++ size_t saIndex = params.find("allowscriptaccess"); ++ if (saIndex == -1) { ++ params.append("allowscriptaccess"); ++ values.append("always"); ++ } else { ++ values[saIndex] = "always"; ++ } ++ ++// size_t scIndex = params.find("scalemode"); ++// if (scIndex != -1) { ++// values[scIndex] = "showAll"; ++// } + } + #endif + } + + RefPtr pluginView = PluginView::create(m_frame, pluginSize, element, url, + params, values, mimeType, loadManually); ++ ++ // Boxee API to notify of new plugin ++ m_webFrame->d->pluginCreated(element, pluginView.get()); + return pluginView; + } + diff --git a/canmore/3rd_party/regex/compile.sh b/canmore/3rd_party/regex/compile.sh new file mode 100644 index 00000000..195a5291 --- /dev/null +++ b/canmore/3rd_party/regex/compile.sh @@ -0,0 +1,4 @@ +#!/bin/bash +source ../common.sh +make -j6 +#sudo make install diff --git a/canmore/3rd_party/samba/compile.sh b/canmore/3rd_party/samba/compile.sh new file mode 100755 index 00000000..f4129251 --- /dev/null +++ b/canmore/3rd_party/samba/compile.sh @@ -0,0 +1,33 @@ +#!/bin/bash +source ../common.sh + +pushd samba-3.0.37 +#patch -p1 < ../samba-3.0.37-CVE-2010-2063.patch +#patch -p1 < ../wle-fix.patch +#patch -p1 < ../silence-receive-warning.patch + +cd source +# look at http://www.nabble.com/Tough-question:-errors-while-cross-compiling-to-MIPS-td11657205.html +#patch -p2 < ../../configure.in.patch +#patch -p2 < ../../vfs_default.c.patch + + +#./autogen.sh + +export SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes +export libreplace_cv_READDIR_GETDIRENTRIES=no +export libreplace_cv_READDIR_GETDENTS=no +export linux_getgrouplist_ok=no +export samba_cv_REPLACE_READDIR=no +export samba_cv_HAVE_WRFILE_KEYTAB=yes +export samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes +export samba_cv_HAVE_IFACE_IFCONF=yes + +./configure --host=${HOST} --target=${HOST} --prefix=/opt/local --disable-cups --enable-static --enable-shared --disable-pie --disable-fam --disable-shared-libs --without-ldap --without-ads -disable-iprint --without-automount --without-sendfile-support --with-included-popt --with-included-iniparser --without-sys-quotas --without-krb5 --without-swat + +make -j6 + +#!!!!!! IMPORTANT +# before doing make install, make sure that /usr/local is symbolic to /opt/tegra2/local +#sudo make install +popd diff --git a/canmore/3rd_party/samba/configure.in.patch b/canmore/3rd_party/samba/configure.in.patch new file mode 100644 index 00000000..3af1e125 --- /dev/null +++ b/canmore/3rd_party/samba/configure.in.patch @@ -0,0 +1,64 @@ +--- samba-3.0.25borig/source/configure.in 2007-05-23 08:29:20.000000000 -0700 ++++ samba3025bfinal/source/configure.in 2007-07-24 12:15:13.000000000 -0700 +@@ -1374,31 +1374,40 @@ + # + case "$host_os" in + *linux*) +- # glibc <= 2.3.2 has a broken getgrouplist +- AC_TRY_RUN([ ++ ++AC_CACHE_CHECK([for a broken Linux getgrouplist API], ++ linux_getgrouplist_ok, ++ [ ++ AC_TRY_RUN([ + #include + #include +-main() { +- /* glibc up to 2.3 has a broken getgrouplist */ ++ ++ int main() { ++ /* glibc up to 2.3 has a broken ++getgrouplist */ + #if defined(__GLIBC__) && defined(__GLIBC_MINOR__) +- int libc_major = __GLIBC__; +- int libc_minor = __GLIBC_MINOR__; ++ int libc_major = __GLIBC__; ++ int libc_minor = __GLIBC_MINOR__; ++ ++ if (libc_major < 2) ++ return 1; ++ if ((libc_major == 2) && (libc_minor <= 3)) ++ return 1; ++#endif ++ return 0; ++ } ++ ++ ], ++ [linux_getgrouplist_ok=yes], ++ [linux_getgrouplist_ok=no], ++ [linux_getgrouplist_ok=cross]) ++ ]) ++ ++ if test x"$linux_getgrouplist_ok" = x"yes"; then ++ AC_DEFINE(HAVE_GETGROUPLIST, 1, [Have good getgrouplist]) ++ fi ++ + +- if (libc_major < 2) +- exit(1); +- if ((libc_major == 2) && (libc_minor <= 3)) +- exit(1); +-#endif +- exit(0); +-} +-], [linux_getgrouplist_ok=yes], [linux_getgrouplist_ok=no]) +- if test x"$linux_getgrouplist_ok" = x"yes"; then +- AC_DEFINE(HAVE_GETGROUPLIST, 1, [Have good getgrouplist]) +- fi +- ;; +- *) +- AC_CHECK_FUNCS(getgrouplist) +- ;; + esac + + # diff --git a/canmore/3rd_party/samba/samba-3.0.37-CVE-2010-2063.patch b/canmore/3rd_party/samba/samba-3.0.37-CVE-2010-2063.patch new file mode 100644 index 00000000..b4657de2 --- /dev/null +++ b/canmore/3rd_party/samba/samba-3.0.37-CVE-2010-2063.patch @@ -0,0 +1,38 @@ +diff --git a/source/smbd/process.c b/source/smbd/process.c +index e861e16..6499bc7 100644 +--- a/source/smbd/process.c ++++ b/source/smbd/process.c +@@ -1159,6 +1159,7 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize) + { + static char *orig_inbuf; + static char *orig_outbuf; ++ static int orig_size; + int smb_com1, smb_com2 = CVAL(inbuf,smb_vwv0); + unsigned smb_off2 = SVAL(inbuf,smb_vwv1); + char *inbuf2, *outbuf2; +@@ -1178,6 +1179,13 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize) + /* this is the first part of the chain */ + orig_inbuf = inbuf; + orig_outbuf = outbuf; ++ orig_size = size; ++ } ++ ++ /* Validate smb_off2 */ ++ if ((smb_off2 < smb_wct - 4) || orig_size < (smb_off2 + 4 - smb_wct)) { ++ exit_server_cleanly("Bad chained packet"); ++ return -1; + } + + /* +@@ -1192,6 +1200,11 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize) + SSVAL(outbuf,smb_vwv1,smb_offset(outbuf+outsize,outbuf)); + SCVAL(outbuf,smb_vwv0,smb_com2); + ++ if (outsize <= smb_wct) { ++ exit_server_cleanly("Bad chained packet"); ++ return -1; ++ } ++ + /* remember how much the caller added to the chain, only counting stuff + after the parameter words */ + chain_size += outsize - smb_wct; diff --git a/canmore/3rd_party/samba/silence-receive-warning.patch b/canmore/3rd_party/samba/silence-receive-warning.patch new file mode 100644 index 00000000..92b84336 --- /dev/null +++ b/canmore/3rd_party/samba/silence-receive-warning.patch @@ -0,0 +1,11 @@ +--- samba-3.0.37-clean/source/libsmb/clientgen.c 2009-09-30 05:21:56.000000000 -0700 ++++ samba-3.0.37/source/libsmb/clientgen.c 2010-11-18 21:56:06.874516928 -0800 +@@ -108,7 +108,7 @@ + + /* If the server is not responding, note that now */ + if (!ret) { +- DEBUG(0, ("Receiving SMB: Server stopped responding\n")); ++ DEBUG(1, ("Receiving SMB: Server stopped responding\n")); + cli->smb_rw_error = smb_read_error; + close(cli->fd); + cli->fd = -1; diff --git a/canmore/3rd_party/samba/vfs_default.c.patch b/canmore/3rd_party/samba/vfs_default.c.patch new file mode 100644 index 00000000..7a640ecb --- /dev/null +++ b/canmore/3rd_party/samba/vfs_default.c.patch @@ -0,0 +1,16 @@ +--- samba-3.0.25borig/source/modules/vfs_default.c 2007-04-09 10:30:58.000000000 -0700 ++++ samba3025bfinal/source/modules/vfs_default.c 2007-07-24 12:18:07.000000000 -0700 +@@ -813,10 +813,11 @@ + + START_PROFILE(syscall_linux_setlease); + +-#ifdef LINUX ++#ifdef HAVE_KERNEL_OPLOCKS_LINUX + /* first set the signal handler */ +- if(linux_set_lease_sighandler(fd) == -1) ++ if(linux_set_lease_sighandler(fd) == -1) { + return -1; ++ } + + result = linux_setlease(fd, leasetype); + #else diff --git a/canmore/3rd_party/samba/wle-fix.patch b/canmore/3rd_party/samba/wle-fix.patch new file mode 100644 index 00000000..8a41f455 --- /dev/null +++ b/canmore/3rd_party/samba/wle-fix.patch @@ -0,0 +1,101 @@ +diff -r -u samba-3.0.37-clean/source/libsmb/asn1.c samba-3.0.37/source/libsmb/asn1.c +--- samba-3.0.37-clean/source/libsmb/asn1.c 2009-09-30 05:21:56.000000000 -0700 ++++ samba-3.0.37/source/libsmb/asn1.c 2010-11-18 12:40:06.981517350 -0800 +@@ -261,6 +261,36 @@ + return asn1_read(data, v, 1); + } + ++/* peek to see if a tag is present */ ++/* this was not ported from samba and may not be identical to libsmb mainline */ ++BOOL asn1_peek_tag(ASN1_DATA *data, uint8 tag) ++{ ++ uint8 curtag; ++ ++ if (data->has_error) ++ return False; ++ ++ // overflow checking ++ if (data->ofs + 1 < data->ofs || data->ofs + 1 < 1) { ++ return False; ++ } ++ ++ // boundary checking ++ if (data->ofs + 1 > data->length) { ++ return False; ++ } ++ ++ memcpy( (void*)&curtag, data->data + data->ofs, 1); ++ ++ // don't move cursor ++ // don't set error ++ ++ if( tag != curtag ) ++ return False; ++ ++ return True; ++} ++ + /* start reading a nested asn1 structure */ + BOOL asn1_start_tag(ASN1_DATA *data, uint8 tag) + { +diff -r -u samba-3.0.37-clean/source/libsmb/clispnego.c samba-3.0.37/source/libsmb/clispnego.c +--- samba-3.0.37-clean/source/libsmb/clispnego.c 2009-09-30 05:21:56.000000000 -0700 ++++ samba-3.0.37/source/libsmb/clispnego.c 2010-11-18 12:52:54.833518134 -0800 +@@ -135,9 +135,16 @@ + + asn1_start_tag(&data,ASN1_APPLICATION(0)); + asn1_check_OID(&data,OID_SPNEGO); ++ ++ /* negTokenInit [0] NegTokenInit */ + asn1_start_tag(&data,ASN1_CONTEXT(0)); + asn1_start_tag(&data,ASN1_SEQUENCE(0)); + ++ /* mechTypes [0] MechTypeList OPTIONAL */ ++ ++ /* Not really optional, we depend on this to decide ++ * what mechanisms we have to work with. */ ++ + asn1_start_tag(&data,ASN1_CONTEXT(0)); + asn1_start_tag(&data,ASN1_SEQUENCE(0)); + for (i=0; asn1_tag_remaining(&data) > 0 && i < ASN1_MAX_OIDS-1; i++) { +@@ -150,7 +157,39 @@ + asn1_end_tag(&data); + + *principal = NULL; +- if (asn1_tag_remaining(&data) > 0) { ++ ++ /* ++ Win7 + Live Sign-in Assistant attaches a mechToken ++ ASN1_CONTEXT(2) to the negTokenInit packet ++ which breaks our negotiation if we just assume ++ the next tag is ASN1_CONTEXT(3). ++ */ ++ ++ if (asn1_peek_tag(&data, ASN1_CONTEXT(1))) { ++ uint8 flags; ++ ++ /* reqFlags [1] ContextFlags OPTIONAL */ ++ asn1_start_tag(&data, ASN1_CONTEXT(1)); ++ asn1_start_tag(&data, ASN1_BITFIELD); ++ while (asn1_tag_remaining(&data) > 0) { ++ asn1_read_uint8(&data, &flags); ++ } ++ asn1_end_tag(&data); ++ asn1_end_tag(&data); ++ } ++ ++ if (asn1_peek_tag(&data, ASN1_CONTEXT(2))) { ++ /* mechToken [2] OCTET STRING OPTIONAL */ ++ DATA_BLOB token; ++ asn1_start_tag(&data, ASN1_CONTEXT(2)); ++ asn1_read_OctetString(&data, &token); ++ asn1_end_tag(&data); ++ /* Throw away the token - not used. */ ++ data_blob_free(&token); ++ } ++ ++ if (asn1_peek_tag(&data, ASN1_CONTEXT(3))) { ++ /* mechListMIC [3] OCTET STRING OPTIONAL */ + asn1_start_tag(&data, ASN1_CONTEXT(3)); + asn1_start_tag(&data, ASN1_SEQUENCE(0)); + asn1_start_tag(&data, ASN1_CONTEXT(0)); diff --git a/canmore/3rd_party/samplerate/compile.sh b/canmore/3rd_party/samplerate/compile.sh new file mode 100644 index 00000000..b284e3d6 --- /dev/null +++ b/canmore/3rd_party/samplerate/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libsamplerate-0.1.7 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/sdl/compile.sh b/canmore/3rd_party/sdl/compile.sh new file mode 100755 index 00000000..7ae4d9cc --- /dev/null +++ b/canmore/3rd_party/sdl/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd SDL-1.2.14 +./configure --host=${HOST} --prefix=${PREFIX} --disable-audio --disable-joystick --disable-cdrom --disable-video-x11 --disable-video-photon --disable-video-cocoa --disable-video-fbcon --disable-video-directfb --disable-video-ps2gs --disable-video-svga --disable-video-vgl --disable-video-wscons --disable-video-xbios --disable-video-gem --disable-osmesa-shared +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/sndfile/compile.sh b/canmore/3rd_party/sndfile/compile.sh new file mode 100755 index 00000000..ef4eae6c --- /dev/null +++ b/canmore/3rd_party/sndfile/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libsndfile-1.0.23 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/sqlite/compile.sh b/canmore/3rd_party/sqlite/compile.sh new file mode 100644 index 00000000..2a28a44c --- /dev/null +++ b/canmore/3rd_party/sqlite/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd sqlite-autoconf-3070500 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/tiff/compile.sh b/canmore/3rd_party/tiff/compile.sh new file mode 100644 index 00000000..f930106b --- /dev/null +++ b/canmore/3rd_party/tiff/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd tiff-3.9.4 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/tzdata/compile.sh b/canmore/3rd_party/tzdata/compile.sh new file mode 100755 index 00000000..469d89ef --- /dev/null +++ b/canmore/3rd_party/tzdata/compile.sh @@ -0,0 +1,13 @@ +#!/bin/bash +VERSION=tzdata2010j + +rm -rf zoneinfo +mkdir zoneinfo + +mkdir $VERSION +cd $VERSION +tar xvfz ../$VERSION.tar.gz + +zic -d ../zoneinfo africa antarctica asia australasia backward etcetera europe factory northamerica pacificnew southamerica systemv +cp *.tab ../zoneinfo + diff --git a/canmore/3rd_party/tzdata/install.sh b/canmore/3rd_party/tzdata/install.sh new file mode 100755 index 00000000..c3cc9d80 --- /dev/null +++ b/canmore/3rd_party/tzdata/install.sh @@ -0,0 +1,4 @@ +#!/bin/bash +source ../common.sh +mkdir ${PREFIX}/share +cp -R zoneinfo ${PREFIX}/share diff --git a/canmore/3rd_party/usbutils/compile.sh b/canmore/3rd_party/usbutils/compile.sh new file mode 100755 index 00000000..10443d93 --- /dev/null +++ b/canmore/3rd_party/usbutils/compile.sh @@ -0,0 +1,9 @@ +#!/bin/bash +source ../common.sh +pushd usbutils +autoreconf --install --symlink +./configure --host=${HOST} --prefix=${PREFIX} --datadir=/opt/local/share +make -j6 lsusb +sudo cp lsusb /opt/canmore/local/bin +sudo cp usb.ids /opt/canmore/local/share +popd diff --git a/canmore/3rd_party/util-linux-ng/compile.sh b/canmore/3rd_party/util-linux-ng/compile.sh new file mode 100755 index 00000000..f23a8528 --- /dev/null +++ b/canmore/3rd_party/util-linux-ng/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +cd util-linux-ng-2.18 +export CFLAGS="$CFLAGS -I/opt/canmore/IntelCE/include/ncurses" +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install diff --git a/canmore/3rd_party/v8/compile.sh b/canmore/3rd_party/v8/compile.sh new file mode 100644 index 00000000..54c6dd33 --- /dev/null +++ b/canmore/3rd_party/v8/compile.sh @@ -0,0 +1,5 @@ +#!/bin/bash +source ../common.sh +pushd v8-svn/v8 +scons -Q toolchain=gcc arch=ia32 library=static os=linux sample=shell debuggersupport=off profilingsupport=off +popd diff --git a/canmore/3rd_party/vorbis/compile.sh b/canmore/3rd_party/vorbis/compile.sh new file mode 100644 index 00000000..d2b24c99 --- /dev/null +++ b/canmore/3rd_party/vorbis/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libvorbis-1.3.2 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/webkit/compile.sh b/canmore/3rd_party/webkit/compile.sh new file mode 100644 index 00000000..90d9504f --- /dev/null +++ b/canmore/3rd_party/webkit/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +cd WebKit +export PATH=$PATH:/opt/canmore/local/qt/bin +export QMAKESPEC=/opt/canmore/local/qt/mkspecs/qws/linux-x86-intelce-g++/ +export QTDIR=/opt/canmore/local/qt/ +export CROSS_COMPILE=i686-cm-linux- +./WebKitTools/Scripts/build-webkit --qt --qmake=/opt/canmore/local/qt/bin/qmake -spec qws/linux-x86-intelce-g++ --no-video --makeargs="-j10" diff --git a/canmore/3rd_party/wireless_tools/Makefile.patch b/canmore/3rd_party/wireless_tools/Makefile.patch new file mode 100644 index 00000000..d4eaa112 --- /dev/null +++ b/canmore/3rd_party/wireless_tools/Makefile.patch @@ -0,0 +1,14 @@ +8c8 +< PREFIX = /usr/local +--- +> PREFIX = /opt/canmore/local +12c12 +< CC = gcc +--- +> CC = /opt/canmore/toolchains/i686-cm-linux-gcc +14,15c14,15 +< AR = ar +< RANLIB = ranlib +--- +> AR = /opt/canmore/toolchains/i686-cm-linux-ar +> RANLIB = /opt/canmore/toolchains/i686-cm-linux-ranlib diff --git a/canmore/3rd_party/wireless_tools/compile.sh b/canmore/3rd_party/wireless_tools/compile.sh new file mode 100755 index 00000000..3d88cd2d --- /dev/null +++ b/canmore/3rd_party/wireless_tools/compile.sh @@ -0,0 +1,6 @@ +#!/bin/bash +source ../common.sh +pushd wireless_tools.29 +make +#sudo make install +popd diff --git a/canmore/3rd_party/wpa_supplicant/compile.sh b/canmore/3rd_party/wpa_supplicant/compile.sh new file mode 100755 index 00000000..63fc539d --- /dev/null +++ b/canmore/3rd_party/wpa_supplicant/compile.sh @@ -0,0 +1,4 @@ +cp myconfig wpa_supplicant-0.6.10/wpa_supplicant/.config +cd wpa_supplicant-0.6.10/wpa_supplicant +make +# sudo BINDIR=/opt/canmore/local/sbin LIBDIR=/opt/canmore/local/lib make install diff --git a/canmore/3rd_party/wpa_supplicant/myconfig b/canmore/3rd_party/wpa_supplicant/myconfig new file mode 100644 index 00000000..88c0deb3 --- /dev/null +++ b/canmore/3rd_party/wpa_supplicant/myconfig @@ -0,0 +1,385 @@ +# Example wpa_supplicant build time configuration +# +# This file lists the configuration options that are used when building the +# hostapd binary. All lines starting with # are ignored. Configuration option +# lines must be commented out complete, if they are not to be included, i.e., +# just setting VARIABLE=n is not disabling that variable. +# +# This file is included in Makefile, so variables like CFLAGS and LIBS can also +# be modified from here. In most cases, these lines should use += in order not +# to override previous values of the variables. + + +# Uncomment following two lines and fix the paths if you have installed OpenSSL +# or GnuTLS in non-default location +CFLAGS += -I/opt/canmore/local/include +LIBS += -L/opt/canmore/local/lib + +# Some Red Hat versions seem to include kerberos header files from OpenSSL, but +# the kerberos files are not in the default include path. Following line can be +# used to fix build issues on such systems (krb5.h not found). +#CFLAGS += -I/usr/include/kerberos + +# Example configuration for various cross-compilation platforms + +#### sveasoft (e.g., for Linksys WRT54G) ###################################### +CC=i686-cm-linux-gcc +#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc +#CFLAGS += -Os +#CPPFLAGS += -I../src/include -I../../src/router/openssl/include +#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl +############################################################################### + +#### openwrt (e.g., for Linksys WRT54G) ####################################### +#CC=mipsel-uclibc-gcc +#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc +#CFLAGS += -Os +#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \ +# -I../WRT54GS/release/src/include +#LIBS = -lssl +############################################################################### + + +# Driver interface for Host AP driver +CONFIG_DRIVER_HOSTAP=y + +# Driver interface for Agere driver +#CONFIG_DRIVER_HERMES=y +# Change include directories to match with the local setup +#CFLAGS += -I../../hcf -I../../include -I../../include/hcf +#CFLAGS += -I../../include/wireless + +# Driver interface for madwifi driver +# Deprecated; use CONFIG_DRIVER_WEXT=y instead. +#CONFIG_DRIVER_MADWIFI=y +# Set include directory to the madwifi source tree +#CFLAGS += -I../../madwifi + +# Driver interface for Prism54 driver +# (Note: Prism54 is not yet supported, i.e., this will not work as-is and is +# for developers only) +#CONFIG_DRIVER_PRISM54=y + +# Driver interface for ndiswrapper +# Deprecated; use CONFIG_DRIVER_WEXT=y instead. +#CONFIG_DRIVER_NDISWRAPPER=y + +# Driver interface for Atmel driver +CONFIG_DRIVER_ATMEL=y + +# Driver interface for old Broadcom driver +# Please note that the newer Broadcom driver ("hybrid Linux driver") supports +# Linux wireless extensions and does not need (or even work) with the old +# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver. +#CONFIG_DRIVER_BROADCOM=y +# Example path for wlioctl.h; change to match your configuration +#CFLAGS += -I/opt/WRT54GS/release/src/include + +# Driver interface for Intel ipw2100/2200 driver +# Deprecated; use CONFIG_DRIVER_WEXT=y instead. +#CONFIG_DRIVER_IPW=y + +# Driver interface for Ralink driver +#CONFIG_DRIVER_RALINK=y + +# Driver interface for generic Linux wireless extensions +CONFIG_DRIVER_WEXT=y + +# Driver interface for Linux drivers using the nl80211 kernel interface +#CONFIG_DRIVER_NL80211=y + +# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) +#CONFIG_DRIVER_BSD=y +#CFLAGS += -I/usr/local/include +#LIBS += -L/usr/local/lib + +# Driver interface for Windows NDIS +#CONFIG_DRIVER_NDIS=y +#CFLAGS += -I/usr/include/w32api/ddk +#LIBS += -L/usr/local/lib +# For native build using mingw +#CONFIG_NATIVE_WINDOWS=y +# Additional directories for cross-compilation on Linux host for mingw target +#CFLAGS += -I/opt/mingw/mingw32/include/ddk +#LIBS += -L/opt/mingw/mingw32/lib +#CC=mingw32-gcc +# By default, driver_ndis uses WinPcap for low-level operations. This can be +# replaced with the following option which replaces WinPcap calls with NDISUIO. +# However, this requires that WZC is disabled (net stop wzcsvc) before starting +# wpa_supplicant. +# CONFIG_USE_NDISUIO=y + +# Driver interface for development testing +#CONFIG_DRIVER_TEST=y + +# Driver interface for wired Ethernet drivers +CONFIG_DRIVER_WIRED=y + +# Driver interface for the Broadcom RoboSwitch family +#CONFIG_DRIVER_ROBOSWITCH=y + +# Enable IEEE 802.1X Supplicant (automatically included if any EAP method is +# included) +CONFIG_IEEE8021X_EAPOL=y + +# EAP-MD5 +CONFIG_EAP_MD5=y + +# EAP-MSCHAPv2 +CONFIG_EAP_MSCHAPV2=y + +# EAP-TLS +CONFIG_EAP_TLS=y + +# EAL-PEAP +CONFIG_EAP_PEAP=y + +# EAP-TTLS +CONFIG_EAP_TTLS=y + +# EAP-FAST +# Note: Default OpenSSL package does not include support for all the +# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, +# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch) +# to add the needed functions. +#CONFIG_EAP_FAST=y + +# EAP-GTC +CONFIG_EAP_GTC=y + +# EAP-OTP +CONFIG_EAP_OTP=y + +# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used) +#CONFIG_EAP_SIM=y + +# EAP-PSK (experimental; this is _not_ needed for WPA-PSK) +#CONFIG_EAP_PSK=y + +# EAP-PAX +#CONFIG_EAP_PAX=y + +# LEAP +CONFIG_EAP_LEAP=y + +# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used) +#CONFIG_EAP_AKA=y + +# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used). +# This requires CONFIG_EAP_AKA to be enabled, too. +#CONFIG_EAP_AKA_PRIME=y + +# Enable USIM simulator (Milenage) for EAP-AKA +#CONFIG_USIM_SIMULATOR=y + +# EAP-SAKE +#CONFIG_EAP_SAKE=y + +# EAP-GPSK +#CONFIG_EAP_GPSK=y +# Include support for optional SHA256 cipher suite in EAP-GPSK +#CONFIG_EAP_GPSK_SHA256=y + +# EAP-TNC and related Trusted Network Connect support (experimental) +#CONFIG_EAP_TNC=y + +# Wi-Fi Protected Setup (WPS) +#CONFIG_WPS=y + +# EAP-IKEv2 +#CONFIG_EAP_IKEV2=y + +# PKCS#12 (PFX) support (used to read private key and certificate file from +# a file that usually has extension .p12 or .pfx) +CONFIG_PKCS12=y + +# Smartcard support (i.e., private key on a smartcard), e.g., with openssl +# engine. +CONFIG_SMARTCARD=y + +# PC/SC interface for smartcards (USIM, GSM SIM) +# Enable this if EAP-SIM or EAP-AKA is included +#CONFIG_PCSC=y + +# Development testing +#CONFIG_EAPOL_TEST=y + +# Select control interface backend for external programs, e.g, wpa_cli: +# unix = UNIX domain sockets (default for Linux/*BSD) +# udp = UDP sockets using localhost (127.0.0.1) +# named_pipe = Windows Named Pipe (default for Windows) +# y = use default (backwards compatibility) +# If this option is commented out, control interface is not included in the +# build. +CONFIG_CTRL_IFACE=y + +# Include support for GNU Readline and History Libraries in wpa_cli. +# When building a wpa_cli binary for distribution, please note that these +# libraries are licensed under GPL and as such, BSD license may not apply for +# the resulting binary. +#CONFIG_READLINE=y + +# Remove debugging code that is printing out debug message to stdout. +# This can be used to reduce the size of the wpa_supplicant considerably +# if debugging code is not needed. The size reduction can be around 35% +# (e.g., 90 kB). +#CONFIG_NO_STDOUT_DEBUG=y + +# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save +# 35-50 kB in code size. +#CONFIG_NO_WPA=y + +# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to +# save about 1 kB in code size when building only WPA-Personal (no EAP support) +# or 6 kB if building for WPA-Enterprise. +#CONFIG_NO_WPA2=y + +# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support +# This option can be used to reduce code size by removing support for +# converting ASCII passphrases into PSK. If this functionality is removed, the +# PSK can only be configured as the 64-octet hexstring (e.g., from +# wpa_passphrase). This saves about 0.5 kB in code size. +#CONFIG_NO_WPA_PASSPHRASE=y + +# Remove AES extra functions. This can be used to reduce code size by about +# 1.5 kB by removing extra AES modes that are not needed for commonly used +# client configurations (they are needed for some EAP types). +#CONFIG_NO_AES_EXTRAS=y + +# Disable scan result processing (ap_mode=1) to save code size by about 1 kB. +# This can be used if ap_scan=1 mode is never enabled. +#CONFIG_NO_SCAN_PROCESSING=y + +# Select configuration backend: +# file = text file (e.g., wpa_supplicant.conf; note: the configuration file +# path is given on command line, not here; this option is just used to +# select the backend that allows configuration files to be used) +# winreg = Windows registry (see win_example.reg for an example) +CONFIG_BACKEND=file + +# Remove configuration write functionality (i.e., to allow the configuration +# file to be updated based on runtime configuration changes). The runtime +# configuration can still be changed, the changes are just not going to be +# persistent over restarts. This option can be used to reduce code size by +# about 3.5 kB. +#CONFIG_NO_CONFIG_WRITE=y + +# Remove support for configuration blobs to reduce code size by about 1.5 kB. +#CONFIG_NO_CONFIG_BLOBS=y + +# Select program entry point implementation: +# main = UNIX/POSIX like main() function (default) +# main_winsvc = Windows service (read parameters from registry) +# main_none = Very basic example (development use only) +#CONFIG_MAIN=main + +# Select wrapper for operatins system and C library specific functions +# unix = UNIX/POSIX like systems (default) +# win32 = Windows systems +# none = Empty template +#CONFIG_OS=unix + +# Select event loop implementation +# eloop = select() loop (default) +# eloop_win = Windows events and WaitForMultipleObject() loop +# eloop_none = Empty template +#CONFIG_ELOOP=eloop + +# Select layer 2 packet implementation +# linux = Linux packet socket (default) +# pcap = libpcap/libdnet/WinPcap +# freebsd = FreeBSD libpcap +# winpcap = WinPcap with receive thread +# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y) +# none = Empty template +#CONFIG_L2_PACKET=linux + +# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) +CONFIG_PEERKEY=y + +# IEEE 802.11w (management frame protection) +# This version is an experimental implementation based on IEEE 802.11w/D1.0 +# draft and is subject to change since the standard has not yet been finalized. +# Driver support is also needed for IEEE 802.11w. +#CONFIG_IEEE80211W=y + +# Select TLS implementation +# openssl = OpenSSL (default) +# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA) +# internal = Internal TLSv1 implementation (experimental) +# none = Empty template +#CONFIG_TLS=openssl + +# Whether to enable TLS/IA support, which is required for EAP-TTLSv1. +# You need CONFIG_TLS=gnutls for this to have any effect. Please note that +# even though the core GnuTLS library is released under LGPL, this extra +# library uses GPL and as such, the terms of GPL apply to the combination +# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not +# apply for distribution of the resulting binary. +#CONFIG_GNUTLS_EXTRA=y + +# If CONFIG_TLS=internal is used, additional library and include paths are +# needed for LibTomMath. Alternatively, an integrated, minimal version of +# LibTomMath can be used. See beginning of libtommath.c for details on benefits +# and drawbacks of this option. +#CONFIG_INTERNAL_LIBTOMMATH=y +#ifndef CONFIG_INTERNAL_LIBTOMMATH +#LTM_PATH=/usr/src/libtommath-0.39 +#CFLAGS += -I$(LTM_PATH) +#LIBS += -L$(LTM_PATH) +#LIBS_p += -L$(LTM_PATH) +#endif +# At the cost of about 4 kB of additional binary size, the internal LibTomMath +# can be configured to include faster routines for exptmod, sqr, and div to +# speed up DH and RSA calculation considerably +#CONFIG_INTERNAL_LIBTOMMATH_FAST=y + +# Include NDIS event processing through WMI into wpa_supplicant/wpasvc. +# This is only for Windows builds and requires WMI-related header files and +# WbemUuid.Lib from Platform SDK even when building with MinGW. +#CONFIG_NDIS_EVENTS_INTEGRATED=y +#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib" + +# Add support for DBus control interface +#CONFIG_CTRL_IFACE_DBUS=y + +# Add support for loading EAP methods dynamically as shared libraries. +# When this option is enabled, each EAP method can be either included +# statically (CONFIG_EAP_=y) or dynamically (CONFIG_EAP_=dyn). +# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to +# be loaded in the beginning of the wpa_supplicant configuration file +# (see load_dynamic_eap parameter in the example file) before being used in +# the network blocks. +# +# Note that some shared parts of EAP methods are included in the main program +# and in order to be able to use dynamic EAP methods using these parts, the +# main program must have been build with the EAP method enabled (=y or =dyn). +# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries +# unless at least one of them was included in the main build to force inclusion +# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included +# in the main build to be able to load these methods dynamically. +# +# Please also note that using dynamic libraries will increase the total binary +# size. Thus, it may not be the best option for targets that have limited +# amount of memory/flash. +#CONFIG_DYNAMIC_EAP_METHODS=y + +# Include client MLME (management frame processing). +# This can be used to move MLME processing of Linux mac80211 stack into user +# space. Please note that this is currently only available with +# driver_nl80211.c and only with a modified version of Linux kernel and +# wpa_supplicant. +#CONFIG_CLIENT_MLME=y + +# IEEE Std 802.11r-2008 (Fast BSS Transition) +#CONFIG_IEEE80211R=y + +# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt) +#CONFIG_DEBUG_FILE=y + +# Enable privilege separation (see README 'Privilege separation' for details) +#CONFIG_PRIVSEP=y + +# Enable mitigation against certain attacks against TKIP by delaying Michael +# MIC error reports by a random amount of time between 0 and 60 seconds +#CONFIG_DELAYED_MIC_ERROR_REPORT=y diff --git a/canmore/3rd_party/xmlstarlet/compile.sh b/canmore/3rd_party/xmlstarlet/compile.sh new file mode 100755 index 00000000..1d1569fb --- /dev/null +++ b/canmore/3rd_party/xmlstarlet/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd xmlstarlet-1.0.4 +./configure --host=${HOST} --prefix=${PREFIX} --with-libxml-prefix=/opt/canmore/local --with-libxslt-prefix=/opt/canmore/local +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/xslt/compile.sh b/canmore/3rd_party/xslt/compile.sh new file mode 100755 index 00000000..80477a05 --- /dev/null +++ b/canmore/3rd_party/xslt/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libxslt-1.1.26 +./configure --host=${HOST} --prefix=${PREFIX} --without-python --without-crypto +#make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/zlib/compile.sh b/canmore/3rd_party/zlib/compile.sh new file mode 100644 index 00000000..8c46f804 --- /dev/null +++ b/canmore/3rd_party/zlib/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd zlib-1.2.5 +./configure --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/3rd_party/zzip/compile.sh b/canmore/3rd_party/zzip/compile.sh new file mode 100755 index 00000000..f13e278c --- /dev/null +++ b/canmore/3rd_party/zzip/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd zziplib-0.13.59 +./configure --host=${HOST} --prefix=${PREFIX} +#make -j6 +#sudo make install +popd diff --git a/canmore/addons-PC13.7/lib/modules/alsa_shim.ko b/canmore/addons-PC13.7/lib/modules/alsa_shim.ko new file mode 100644 index 00000000..d82b492b Binary files /dev/null and b/canmore/addons-PC13.7/lib/modules/alsa_shim.ko differ diff --git a/canmore/addons/bin/busybox b/canmore/addons/bin/busybox new file mode 100755 index 00000000..cca0eccf Binary files /dev/null and b/canmore/addons/bin/busybox differ diff --git a/canmore/addons/data/etc/boxeehal.conf b/canmore/addons/data/etc/boxeehal.conf new file mode 100644 index 00000000..93bfc232 --- /dev/null +++ b/canmore/addons/data/etc/boxeehal.conf @@ -0,0 +1,2 @@ +network.config={"auth":"","config":2,"gateway":"","ip":"","key":"","nameServer":"","netType":"ethernet","netmask":"","ssid":""} + diff --git a/canmore/addons/data/etc/localtime b/canmore/addons/data/etc/localtime new file mode 120000 index 00000000..38325eee --- /dev/null +++ b/canmore/addons/data/etc/localtime @@ -0,0 +1 @@ +/opt/local/share/zoneinfo/America/New_York \ No newline at end of file diff --git a/canmore/addons/data/etc/ppp/options.pptp b/canmore/addons/data/etc/ppp/options.pptp new file mode 100644 index 00000000..e69de29b diff --git a/canmore/addons/data/etc/ppp/peers/vpn b/canmore/addons/data/etc/ppp/peers/vpn new file mode 100644 index 00000000..e69de29b diff --git a/canmore/addons/data/etc/ppp/resolv.conf b/canmore/addons/data/etc/ppp/resolv.conf new file mode 100644 index 00000000..e69de29b diff --git a/canmore/addons/data/etc/ppp/secrets b/canmore/addons/data/etc/ppp/secrets new file mode 100644 index 00000000..e69de29b diff --git a/canmore/addons/data/etc/smb.conf b/canmore/addons/data/etc/smb.conf new file mode 100644 index 00000000..a070d49a --- /dev/null +++ b/canmore/addons/data/etc/smb.conf @@ -0,0 +1,33 @@ +; Boxee Samba server configuration template +; (c) 2010 Boxee, Inc. http://www.boxee.tv +; +; Revision History +; 20100617 - Inception + +[global] + workgroup = WORKGROUP + server string = boxeebox +; disable printing support + load printers = no + printcap name = /dev/null + printing = bsd + security = share + socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 + disable spoolss = yes + show add printer wizard = no + ntlm auth = yes + lanman auth = yes + create mask = 0777 + directory mask = 0777 + username map = /data/etc/smbusers + log file = /tmp/smb.log.%m + private dir = /data/etc/ + pid directory = /var/run/ + lock directory = /tmp/smblock/ + +[Media] + comment = Media share on boxeebox + path = /media + read only = no + public = yes + force user = guest diff --git a/canmore/addons/data/etc/smb.disabled b/canmore/addons/data/etc/smb.disabled new file mode 100644 index 00000000..e69de29b diff --git a/canmore/addons/data/etc/vpn.disabled b/canmore/addons/data/etc/vpn.disabled new file mode 100644 index 00000000..e69de29b diff --git a/canmore/addons/etc/hostname b/canmore/addons/etc/hostname new file mode 100644 index 00000000..283a5b38 --- /dev/null +++ b/canmore/addons/etc/hostname @@ -0,0 +1 @@ +boxeebox diff --git a/canmore/addons/etc/init.d/avahi b/canmore/addons/etc/init.d/avahi new file mode 100755 index 00000000..5d7e1f1b --- /dev/null +++ b/canmore/addons/etc/init.d/avahi @@ -0,0 +1,36 @@ +#!/bin/sh + +# Script name can be the called name, or something more meaningful. +SCRIPTNAME=$0 + +. /etc/init.d/init_utilities + +start_function() { + mkdir -p /opt/local/var/run/avahi-daemon + LD_LIBRARY_PATH=/opt/local/lib /opt/local/sbin/avahi-daemon -D +} + +stop_function() { + # Terminate daemons, remove modules, remove device nodes here + PID=`ps -ef | grep -v grep | grep "/opt/local/bin/avahi-daemon" | awk '{print $2}'` + if [[ "x$PID" == "x" ]]; then + echo "avahi not running; cannot kill" + else + kill $PID + fi +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/bcm4319 b/canmore/addons/etc/init.d/bcm4319 new file mode 100755 index 00000000..8773da43 --- /dev/null +++ b/canmore/addons/etc/init.d/bcm4319 @@ -0,0 +1,49 @@ +#!/bin/sh + +# Script name can be the called name, or something more meaningful. +SCRIPTNAME=bcm4319 +PATH=/usr/local/bin:/usr/bin:/bin:/sbin + +. /etc/init.d/init_utilities + +start_function() { + WIRELESS_DIR=/opt/local/etc/Wireless/BCM4319/ + + #load firmware to wireless hw + $WIRELESS_DIR/bcmdl $WIRELESS_DIR/bcm94319wlusbnp4l.nvm $WIRELESS_DIR/usb-g-cdc-full11n-reclaim-roml-wme-idsup-40m.bin.trx + sleep 2; + + #load kernel module + insmod $WIRELESS_DIR/dhd.ko + sleep 2; + + # interface up + ifconfig eth1 up + sleep 2; + + # supplicant up + /opt/local/sbin/wl -i eth1 up +} + +stop_function() { + wl -i eth1 down + + ifconfig eth1 down + + rmmod dhd +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/boxee b/canmore/addons/etc/init.d/boxee new file mode 100755 index 00000000..9ef0de54 --- /dev/null +++ b/canmore/addons/etc/init.d/boxee @@ -0,0 +1,40 @@ +#!/bin/sh + +# Script name can be the called name, or something more meaningful. +SCRIPTNAME=$0 + +. /etc/init.d/init_utilities + +start_function() { + # Start Boxee if so equipped + debug_print "Trying to start Boxee Launcher" + while [ ! -z `pidof "cl_app"` ]; do + sleep 1; + done + try_command /opt/boxee/BoxeeLauncher & +} + +stop_function() { + # Terminate daemons, remove modules, remove device nodes here + BH_PID=`ps -ef | grep -v grep | grep "/opt/boxee/BoxeeLauncher" | awk '{print $2}'` + if [[ "x$BH_PID" == "x" ]]; then + echo "Boxee Launcher not running; cannot kill" + else + kill $BH_PID + fi +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/boxee_recovery b/canmore/addons/etc/init.d/boxee_recovery new file mode 100755 index 00000000..df789689 --- /dev/null +++ b/canmore/addons/etc/init.d/boxee_recovery @@ -0,0 +1,45 @@ +#!/bin/sh + +# Script name can be the called name, or something more meaningful. +SCRIPTNAME=$0 +BIN_NAME=/opt/boxee/RecoveryConsole + +. /etc/init.d/init_utilities + +start_function() { + # Start Boxee if so equipped + debug_print "Trying to start Boxee Recovery" + for r in 480p 576p 720p 1080p 1080i + do + tvmode $r + if [ $? -eq 0 ]; then + break; + fi + done + try_command $BIN_NAME -qws & +} + +stop_function() { + # Terminate daemons, remove modules, remove device nodes here + BH_PID=`ps | grep -v grep | grep "${BIN_NAME}" | awk '{print $1}'` + if [[ "x$BH_PID" == "x" ]]; then + echo "Boxee Recovery not running; cannot kill" + else + kill $BH_PID + fi +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/boxeehal b/canmore/addons/etc/init.d/boxeehal new file mode 100755 index 00000000..c2467db3 --- /dev/null +++ b/canmore/addons/etc/init.d/boxeehal @@ -0,0 +1,48 @@ +#!/bin/sh + +# Script name can be the called name, or something more meaningful. +SCRIPTNAME=$0 +CHRONOS=/opt/local/bin/chronos + +. /etc/init.d/init_utilities + +start_function() { + # Start Boxee HAL if so equipped + hostname `cat /etc/hostname` + if [ -e ${CHRONOS} ]; then + ${CHRONOS} + else + debug_print "Chronos not found, Setting default date/time 1/1/2010 00:00" + /bin/date 010100002010 + fi + debug_print "Trying to start Boxee HAL" + # remove before final shipment + mkdir -p /tmp/corefiles + echo "/tmp/corefiles/core" > /proc/sys/kernel/core_pattern + try_command /opt/boxee/hal/BoxeeHal +} + +stop_function() { + # Terminate daemons, remove modules, remove device nodes here + BH_PID=`ps | grep -v grep | grep "/opt/boxee/hal/BoxeeHal" | awk '{print $1}'` + if [[ "x$BH_PID" == "x" ]]; then + echo "Boxee HAL not running; cannot kill" + else + kill $BH_PID + fi +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/compcache b/canmore/addons/etc/init.d/compcache new file mode 100755 index 00000000..641b0355 --- /dev/null +++ b/canmore/addons/etc/init.d/compcache @@ -0,0 +1,36 @@ +#!/bin/sh + +# Script name can be the called name, or something more meaningful. +SCRIPTNAME=$0 + +. /etc/init.d/init_utilities + +start_function() { + /sbin/insmod /lib/modules/2.6.28/lzo_compress.ko + /sbin/insmod /lib/modules/2.6.28/lzo_decompress.ko + /sbin/insmod /lib/modules/2.6.28/ramzswap.ko num_devices=1 + /opt/local/sbin/rzscontrol /dev/ramzswap0 --init + /sbin/swapon /dev/ramzswap0 +} + +stop_function() { + /sbin/swapoff /dev/ramzswap0 + /sbin/rmmod ramzswap + /sbin/rmmod lzo_decompress + /sbin/rmmod lzo_compress +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/dbus b/canmore/addons/etc/init.d/dbus new file mode 100755 index 00000000..6931a404 --- /dev/null +++ b/canmore/addons/etc/init.d/dbus @@ -0,0 +1,38 @@ +#!/bin/sh + +# Script name can be the called name, or something more meaningful. +SCRIPTNAME=$0 + +. /etc/init.d/init_utilities + +start_function() { + mkdir -p /opt/local/var/lib/dbus/ && /opt/local/bin/dbus-uuidgen --ensure + mkdir -p /opt/local/var/run/dbus + LD_LIBRARY_PATH=/opt/local/lib /opt/local/bin/dbus-daemon --system +} + +stop_function() { + # Terminate daemons, remove modules, remove device nodes here + PID=`ps -ef | grep -v grep | grep "/opt/local/bin/dbus-daemon" | awk '{print $2}'` + if [[ "x$PID" == "x" ]]; then + echo "dbus not running; cannot kill" + else + kill $PID + rm -f /opt/local/var/run/dbus/pid + fi +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/devtools b/canmore/addons/etc/init.d/devtools new file mode 100755 index 00000000..c413b574 --- /dev/null +++ b/canmore/addons/etc/init.d/devtools @@ -0,0 +1,79 @@ +#!/bin/sh + +# This file is provided under a dual BSD/GPLv2 license. When using or +# redistributing this file, you may do so under either license. +# +# GPL LICENSE SUMMARY +# +# Copyright(c) 2007-2009 Intel Corporation. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The full GNU General Public License is included in this distribution +# in the file called LICENSE.GPL. +# +# Contact Information: +# intel.com +# Intel Corporation +# 2200 Mission College Blvd. +# Santa Clara, CA 95052 +# USA +# (408) 765-8080 +# +# ========================================================================= + +# Script name can be the called name, or something more meaningful. +SCRIPTNAME=$0 +PATH=/usr/local/bin:/usr/bin:/bin:/sbin + +. /etc/init.d/init_utilities + +start_function() { + # Install modules, make device nodes, start daemons here + mkdir -p /var/lib/dhcpv6 + mkdir -p /var/run/dhcpv6 + # create supporting dirs + TMPDIRS=".adobe .macromedia .qws .smb mnt media nand smblock" + for t in $TMPDIRS + do + debug_print "Creating /tmp/$t" + mkdir /tmp/$t > /dev/null 2>&1 + done + chmod 0755 /tmp/smblock + # start udev + try_command udevd -d + try_command udevadm trigger +} + +stop_function() { + # Terminate daemons, remove modules, remove device nodes here + rm -rf /var/lib/dhcpv6 + rm -rf /var/run/dhcpv6 + # kill udev + killall udevd +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/lircd b/canmore/addons/etc/init.d/lircd new file mode 100755 index 00000000..4c08707f --- /dev/null +++ b/canmore/addons/etc/init.d/lircd @@ -0,0 +1,41 @@ +#!/bin/sh + +# Script name can be the called name, or something more meaningful. +SCRIPTNAME=$0 + +. /etc/init.d/init_utilities + +start_function() { + # Start lircd if so equipped + debug_print "Trying to start lircd" + /bin/mknod /dev/lirc c 61 0 + /sbin/insmod /lib/modules/2.6.28/lirc_dev.ko + /sbin/insmod /lib/modules/2.6.28/lirc_mceusb.ko + mkdir -p /var/run/lirc + try_command /opt/local/sbin/lircd --device=/dev/lirc0 /opt/local/etc/lircd.conf +} + +stop_function() { + # Terminate daemons, remove modules, remove device nodes here + LIRCD_PID=`ps | grep -v grep | grep "/opt/local/sbin/lircd" | awk '{print $1}'` + if [[ "x$LIRCD_PID" == "x" ]]; then + echo "lircd not running; cannot kill" + else + kill $LIRD_PID + fi +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/network b/canmore/addons/etc/init.d/network new file mode 100755 index 00000000..2f4f2a37 --- /dev/null +++ b/canmore/addons/etc/init.d/network @@ -0,0 +1,37 @@ +#!/bin/sh + +# Script name can be the called name, or something more meaningful. +SCRIPTNAME=network +PATH=/usr/local/bin:/usr/bin:/bin:/sbin + +. /etc/init.d/init_utilities + +start_function() { + ifconfig eth0 up + + # Add an entry to the routing table + route add -net 224.0.0.0 netmask 240.0.0.0 eth0 + + # Set up the local loopback device + ifconfig lo 127.0.0.1 +} + +stop_function() { + # Remove our entry from the routing table + route del -net 224.0.0.0 netmask 240.0.0.0 eth0 +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/nmbd b/canmore/addons/etc/init.d/nmbd new file mode 100755 index 00000000..020575be --- /dev/null +++ b/canmore/addons/etc/init.d/nmbd @@ -0,0 +1,38 @@ +#!/bin/sh + +# Script name can be the called name, or something more meaningful. +SCRIPTNAME=$0 + +. /etc/init.d/init_utilities + +start_function() { + # Start nmbd if so equipped + if [ ! -f /data/etc/smb.disabled ]; then + try_command /opt/local/sbin/nmbd -s /data/etc/smb.conf + fi +} + +stop_function() { + # Terminate daemons, remove modules, remove device nodes here + NMBD_PID=`ps -ef | grep -v grep | grep "/opt/local/sbin/nmbd" | awk '{print $2}'` + if [[ "x$NMBD_PID" == "x" ]]; then + echo "nmbd not running; cannot kill" + else + kill $NMBD_PID + fi +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/pppd b/canmore/addons/etc/init.d/pppd new file mode 100755 index 00000000..d64124e0 --- /dev/null +++ b/canmore/addons/etc/init.d/pppd @@ -0,0 +1,42 @@ +#!/bin/sh + +SCRIPTNAME=$0 +PATH=/usr/local/bin:/usr/bin:/bin:/sbin + +. /etc/init.d/init_utilities + +PPP_MODULES="slhc ppp_generic ppp_deflate ppp_async ppp_mppe bsd_comp" + +start_function() { + # install ppp_* and related modules + for m in ${PPP_MODULES} + do + debug_print "Installing $m module.." + insmod ${m}.ko >/dev/null 2>&1 + done +} + +stop_function() { + # remove ppp_* and related modules + R=`echo $PPP_MODULES | awk '{ for (i = NF; i > 0; --i) print $i }'` + for m in ${R} + do + debug_print "Removing $m module.." + rmmod $m >/dev/null 2>&1 + done +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/pptpd b/canmore/addons/etc/init.d/pptpd new file mode 100755 index 00000000..f805ae78 --- /dev/null +++ b/canmore/addons/etc/init.d/pptpd @@ -0,0 +1,35 @@ +#!/bin/sh + +SCRIPTNAME=$0 +PATH=/usr/local/bin:/usr/bin:/bin:/sbin + +. /etc/init.d/init_utilities + +start_function() { + if [ ! -f /tmp/vpn.up ] + then + try_command /opt/local/sbin/pppd call vpn logfd 1 updetach + else + echo "VPN already up." + exit 1 + fi +} + +stop_function() { + pkill pppd +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/ra3070 b/canmore/addons/etc/init.d/ra3070 new file mode 100755 index 00000000..e9138ef6 --- /dev/null +++ b/canmore/addons/etc/init.d/ra3070 @@ -0,0 +1,32 @@ +#!/bin/sh + +# Script name can be the called name, or something more meaningful. +SCRIPTNAME=ra3070 +PATH=/usr/local/bin:/usr/bin:/bin:/sbin + +. /etc/init.d/init_utilities + +start_function() { + insmod /lib/modules/2.6.35/rt3070sta.ko + ifconfig ra0 up +} + +stop_function() { + ifconfig ra0 down + rmmod /lib/modules/2.6.35/rt3070sta.ko +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/init.d/smbd b/canmore/addons/etc/init.d/smbd new file mode 100755 index 00000000..5f6dd1a8 --- /dev/null +++ b/canmore/addons/etc/init.d/smbd @@ -0,0 +1,41 @@ +#!/bin/sh + +# Script name can be the called name, or something more meaningful. +SCRIPTNAME=$0 + +. /etc/init.d/init_utilities + +start_function() { + # Start smbd if so equipped + if [ ! -f /data/etc/smb.disabled ]; then + debug_print "Trying to start smbd" + try_command /opt/local/sbin/smbd -s /data/etc/smb.conf + else + debug_print "Samba is disabled." + fi +} + +stop_function() { + # Terminate daemons, remove modules, remove device nodes here + SMBD_PID=`ps -ef | grep -v grep | grep "/opt/local/sbin/smbd" | awk '{print $2}'` + if [[ "x$SMBD_PID" == "x" ]]; then + echo "smbd not running; cannot kill" + else + kill $SMBD_PID + fi +} + +case $1 in + "start") + start_function + ;; + "stop") + stop_function + ;; + "restart") + stop_function + start_function + ;; + *) + echo "Usage: $0 {start|stop|restart}" +esac diff --git a/canmore/addons/etc/ppp/chap-secrets b/canmore/addons/etc/ppp/chap-secrets new file mode 120000 index 00000000..39461d00 --- /dev/null +++ b/canmore/addons/etc/ppp/chap-secrets @@ -0,0 +1 @@ +/data/etc/ppp/secrets \ No newline at end of file diff --git a/canmore/addons/etc/ppp/ip-down b/canmore/addons/etc/ppp/ip-down new file mode 100755 index 00000000..3201f57a --- /dev/null +++ b/canmore/addons/etc/ppp/ip-down @@ -0,0 +1,20 @@ +#!/bin/sh +# to get the full PATH and LD_LIBRARY_PATH +. /etc/profile +if [ -f /tmp/vpn.up ] +then + SERVER=`ip route | grep -v $4 | grep -v $3 | grep -v "0.0.0.0" | cut -f 1 -d " "` + PRIMARY=`ip route | grep -v $4 | grep -v $3 | grep -v "0.0.0.0" | cut -f 5 -d " "` + NEWGW=`ip route | grep -v $4 | grep -v $3 | grep -v "0.0.0.0" | cut -f 3 -d " "` + CONNECTION=$6 + if [ "${CONNECTION}" = "" ]; then CONNECTION=${PPP_IPPARAM}; fi + TUNNEL=$1 + if [ "${TUNNEL}" = "" ]; then TUNNEL=${PPP_IFACE}; fi + if [ "${CONNECTION}" = "vpn" ] ; then + route del -host ${SERVER} gw ${NEWGW} dev ${PRIMARY} + route del default ${TUNNEL} + route add default gw ${NEWGW} dev ${PRIMARY} + fi + rm /tmp/vpn.up + /opt/local/bin/curl "http://127.0.0.1:5700/vpn.Notify?status=disconnected" +fi diff --git a/canmore/addons/etc/ppp/ip-up b/canmore/addons/etc/ppp/ip-up new file mode 100755 index 00000000..f5315ddc --- /dev/null +++ b/canmore/addons/etc/ppp/ip-up @@ -0,0 +1,19 @@ +#!/bin/sh + +# to get PATH and LD_LIBRARY_PATH correct +. /etc/profile +PRIMARY=`ip route | grep default | grep "eth[01]" | cut -f 5 -d " "` +CURRGW=`ip route | grep default | grep "eth[01]" | cut -f 3 -d " "` +SERVER=$5 +CONNECTION=$6 +if [ "${CONNECTION}" = "" ]; then CONNECTION=${PPP_IPPARAM}; fi +TUNNEL=$1 +if [ "${TUNNEL}" = "" ]; then TUNNEL=${PPP_IFACE}; fi +if [ "${CONNECTION}" = "vpn" ] ; then +# route add -host ${SERVER} gw ${CURRGW} dev ${PRIMARY} + route del default ${PRIMARY} + route add default gw ${SERVER} dev ${TUNNEL} +fi +touch /tmp/vpn.up +/etc/ppp/usepeerdns +/opt/local/bin/curl "http://127.0.0.1:5700/vpn.Notify?status=connected" diff --git a/canmore/addons/etc/ppp/options.pptp b/canmore/addons/etc/ppp/options.pptp new file mode 120000 index 00000000..b4857764 --- /dev/null +++ b/canmore/addons/etc/ppp/options.pptp @@ -0,0 +1 @@ +/data/etc/ppp/options.pptp \ No newline at end of file diff --git a/canmore/addons/etc/ppp/options.pptp.in b/canmore/addons/etc/ppp/options.pptp.in new file mode 100644 index 00000000..df2996bc --- /dev/null +++ b/canmore/addons/etc/ppp/options.pptp.in @@ -0,0 +1,5 @@ +lock +XXXREQMPPEXXX +refuse-eap +lcp-echo-failure 15 +lcp-echo-interval 15 diff --git a/canmore/addons/etc/ppp/pap-secrets b/canmore/addons/etc/ppp/pap-secrets new file mode 120000 index 00000000..39461d00 --- /dev/null +++ b/canmore/addons/etc/ppp/pap-secrets @@ -0,0 +1 @@ +/data/etc/ppp/secrets \ No newline at end of file diff --git a/canmore/addons/etc/ppp/peers/vpn b/canmore/addons/etc/ppp/peers/vpn new file mode 120000 index 00000000..951fdbc0 --- /dev/null +++ b/canmore/addons/etc/ppp/peers/vpn @@ -0,0 +1 @@ +/data/etc/ppp/peers/vpn \ No newline at end of file diff --git a/canmore/addons/etc/ppp/peers/vpn.in b/canmore/addons/etc/ppp/peers/vpn.in new file mode 100644 index 00000000..d97eabf8 --- /dev/null +++ b/canmore/addons/etc/ppp/peers/vpn.in @@ -0,0 +1,7 @@ +remotename vpn +linkname vpn +ipparam vpn +pty "/opt/local/sbin/pptp XXXHOSTNAMEXXX --nolaunchpppd " +name XXXUSERNAMEXXX +usepeerdns +file /data/etc/ppp/options.pptp diff --git a/canmore/addons/etc/ppp/resolv.conf b/canmore/addons/etc/ppp/resolv.conf new file mode 120000 index 00000000..2910f29b --- /dev/null +++ b/canmore/addons/etc/ppp/resolv.conf @@ -0,0 +1 @@ +/data/etc/ppp/resolv.conf \ No newline at end of file diff --git a/canmore/addons/etc/ppp/usepeerdns b/canmore/addons/etc/ppp/usepeerdns new file mode 100755 index 00000000..afe79513 --- /dev/null +++ b/canmore/addons/etc/ppp/usepeerdns @@ -0,0 +1,22 @@ +#!/bin/sh -e +# this variable is only set if the usepeerdns pppd option is being used +[ "$USEPEERDNS" ] || exit 0 + +# create the file if it does not exist +if [ ! -e /etc/resolv.conf ]; then + : > /etc/resolv.conf +fi + +# follow any symlink to find the real file +REALRESOLVCONF=$(readlink -f /etc/resolv.conf) + +# merge the new nameservers with the other options from the old configuration +{ + cat /etc/ppp/resolv.conf + grep -v '^nameserver[[:space:]]' "$REALRESOLVCONF" || true +} > "$REALRESOLVCONF.tmp" + +mv -f "$REALRESOLVCONF.tmp" "$REALRESOLVCONF" + +exit 0 + diff --git a/canmore/addons/etc/rc3.d/S13lircd b/canmore/addons/etc/rc3.d/S13lircd new file mode 120000 index 00000000..0e5c7e6e --- /dev/null +++ b/canmore/addons/etc/rc3.d/S13lircd @@ -0,0 +1 @@ +../init.d/lircd \ No newline at end of file diff --git a/canmore/addons/etc/rc3.d/S16bcm4319 b/canmore/addons/etc/rc3.d/S16bcm4319 new file mode 120000 index 00000000..50f73ddd --- /dev/null +++ b/canmore/addons/etc/rc3.d/S16bcm4319 @@ -0,0 +1 @@ +../init.d/bcm4319 \ No newline at end of file diff --git a/canmore/addons/etc/rc3.d/U80dbus b/canmore/addons/etc/rc3.d/U80dbus new file mode 120000 index 00000000..05fdfc6f --- /dev/null +++ b/canmore/addons/etc/rc3.d/U80dbus @@ -0,0 +1 @@ +../init.d/dbus \ No newline at end of file diff --git a/canmore/addons/etc/rc3.d/U81avahi b/canmore/addons/etc/rc3.d/U81avahi new file mode 120000 index 00000000..cb2b87b1 --- /dev/null +++ b/canmore/addons/etc/rc3.d/U81avahi @@ -0,0 +1 @@ +../init.d/avahi \ No newline at end of file diff --git a/canmore/addons/etc/rc3.d/U94boxeehal b/canmore/addons/etc/rc3.d/U94boxeehal new file mode 120000 index 00000000..6d22d5ea --- /dev/null +++ b/canmore/addons/etc/rc3.d/U94boxeehal @@ -0,0 +1 @@ +../init.d/boxeehal \ No newline at end of file diff --git a/canmore/addons/etc/rc3.d/U95compcache b/canmore/addons/etc/rc3.d/U95compcache new file mode 120000 index 00000000..380b00e0 --- /dev/null +++ b/canmore/addons/etc/rc3.d/U95compcache @@ -0,0 +1 @@ +../init.d/compcache \ No newline at end of file diff --git a/canmore/addons/etc/rc3.d/U96pppd b/canmore/addons/etc/rc3.d/U96pppd new file mode 120000 index 00000000..3f49b335 --- /dev/null +++ b/canmore/addons/etc/rc3.d/U96pppd @@ -0,0 +1 @@ +../init.d/pppd \ No newline at end of file diff --git a/canmore/addons/etc/rc3.d/U97smbd b/canmore/addons/etc/rc3.d/U97smbd new file mode 120000 index 00000000..a691ef65 --- /dev/null +++ b/canmore/addons/etc/rc3.d/U97smbd @@ -0,0 +1 @@ +../init.d/smbd \ No newline at end of file diff --git a/canmore/addons/etc/rc3.d/U98nmbd b/canmore/addons/etc/rc3.d/U98nmbd new file mode 120000 index 00000000..1d81ff49 --- /dev/null +++ b/canmore/addons/etc/rc3.d/U98nmbd @@ -0,0 +1 @@ +../init.d/nmbd \ No newline at end of file diff --git a/canmore/addons/etc/services b/canmore/addons/etc/services new file mode 100644 index 00000000..ce82600e --- /dev/null +++ b/canmore/addons/etc/services @@ -0,0 +1,2 @@ +ntp 123/tcp +ntp 123/udp diff --git a/canmore/addons/etc/smb.conf.in b/canmore/addons/etc/smb.conf.in new file mode 100644 index 00000000..65101e64 --- /dev/null +++ b/canmore/addons/etc/smb.conf.in @@ -0,0 +1,35 @@ +; Boxee Samba server configuration template +; (c) 2010 Boxee, Inc. http://www.boxee.tv +; +; Revision History +; 20100617 - Inception +; 20100929 - Update socket options and cache size +; 20101130 - Remove [media] share + +; XXXGENTAGXXX + +[global] + workgroup = XXXWORKGROUPXXX + netbios name = XXXHOSTNAMEXXX +; disable printing support + load printers = no + printcap name = /dev/null + printing = bsd + security = share + socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 + local master = no + disable spoolss = yes + show add printer wizard = no + ntlm auth = yes + lanman auth = yes + create mask = 0777 + directory mask = 0777 + username map = /data/etc/smbusers + log file = /tmp/smb.log.%m + private dir = /data/etc/ + pid directory = /var/run/ + lock directory = /tmp/smblock/ + smb passwd file = /data/etc/smbpasswd + unix extensions = no + max stat cache size = 256 + diff --git a/canmore/addons/etc/udev/rules.d/50-udev-gen3.rules b/canmore/addons/etc/udev/rules.d/50-udev-gen3.rules new file mode 100644 index 00000000..003a531d --- /dev/null +++ b/canmore/addons/etc/udev/rules.d/50-udev-gen3.rules @@ -0,0 +1,106 @@ +# +#GPL LICENSE SUMMARY +# +# Copyright(c) 2005-2009 Intel Corporation. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The full GNU General Public License is included in this distribution +# in the file called LICENSE.GPL. +# +# Contact Information +# Intel Corporation +# 2200 Mission College Blvd. +# Santa Clara, CA 97052 +# +# This rule file originated from udev-120/etc/udev/rules.d/50-udev-default.rules +# Includes Intel Corporation's changes/modifications dated: 04/2008. +# Changed/modified portions - Copyright(c)2008, Intel Corporation. All rights reserved. +# +# do not edit this file, it will be overwritten on update +KERNEL=="ppp", MODE="0600", OPTIONS+="ignore_remove" +KERNEL=="lirc0", SYMLINK+="lirc" + +# mem +KERNEL=="null|zero|full|random|urandom", MODE="0666" +KERNEL=="null", SYMLINK+="XOR" +KERNEL=="ram0", SYMLINK+="ramdisk" +KERNEL=="ram1", SYMLINK+="ram" + +# input +KERNEL=="mouse*|mice|event*", NAME="input/%k", MODE="0640" +KERNEL=="ts[0-9]*|uinput", NAME="input/%k", MODE="0600" +KERNEL=="js[0-9]*", NAME="input/%k", MODE="0644", SYMLINK+="%k" + +# video4linux +KERNEL=="vbi0", SYMLINK+="vbi" +KERNEL=="radio0", SYMLINK+="radio" +KERNEL=="video0", SYMLINK+="video" + +# graphics +KERNEL=="agpgart", MODE="0600" +KERNEL=="card[0-9]*", NAME="dri/%k", MODE="0666" +KERNEL=="fb0", SYMLINK+="fb" + +# DVB video +SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c" + +# Firewire +KERNEL=="dv1394*", SYMLINK+="dv1394/%n" +KERNEL=="video1394*", NAME="video1394/%n" + +# firmware class requests +SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh" + +# libusb device nodes +SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644" + +# block, tapes, block-releated +SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n" +SUBSYSTEM=="block", KERNEL=="sd[a-z]*", RUN+="/etc/udev/rules.d/disk_automount.sh" +SUBSYSTEM=="mmc", KERNEL=="mmcblk[0-9]*", RUN+="/etc/udev/rules.d/disk_automount.sh" +SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="0|7|14", ATTR{timeout}="60" +SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="1", ATTR{timeout}="900" +KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k" +KERNEL=="pktcdvd", NAME="pktcdvd/control" +KERNEL=="qft0", SYMLINK+="ftape" +SUBSYSTEM=="bsg", NAME="bsg/%k" + +# network +KERNEL=="tun", NAME="net/%k", MODE="0666", OPTIONS+="ignore_remove" + +# CPU +KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid" +KERNEL=="msr[0-9]*", NAME="cpu/%n/msr" +KERNEL=="microcode", NAME="cpu/microcode", MODE="0600" + +# miscellaneous +KERNEL=="fuse", MODE="0666" +KERNEL=="rtc|rtc0", MODE="0644" +KERNEL=="rtc0", SYMLINK+="rtc" +KERNEL=="auer[0-9]*", NAME="usb/%k" +KERNEL=="hw_random", NAME="hwrng", SYMLINK+="%k" +KERNEL=="mmtimer", MODE="0644" +KERNEL=="rflash[0-9]*", MODE="0400" +KERNEL=="rrom[0-9]*", MODE="0400" +KERNEL=="sbpcd0", SYMLINK+="sbpcd" +KERNEL=="slram[0-9]*", SYMLINK+="xpram%n" +KERNEL=="sxctl", NAME="specialix_sxctl", SYMLINK+="%k" +KERNEL=="rioctl", NAME="specialix_rioctl", SYMLINK+="%k" +KERNEL=="iowarrior[0-9]*", NAME="usb/%k" + +# do not delete static device nodes +ACTION=="remove", NAME=="?*", TEST=="/lib/udev/devices/$name", OPTIONS+="ignore_remove" + +# event to be catched by udevmonitor +RUN+="socket:/org/kernel/udev/monitor" diff --git a/canmore/addons/etc/udev/rules.d/50-udev-gen3.rules.diff b/canmore/addons/etc/udev/rules.d/50-udev-gen3.rules.diff new file mode 100644 index 00000000..03c53cba --- /dev/null +++ b/canmore/addons/etc/udev/rules.d/50-udev-gen3.rules.diff @@ -0,0 +1,10 @@ +--- /opt/canmore/targetfs.13.3/etc/udev/rules.d/50-udev-gen3.rules 2010-03-01 00:55:59.000000000 +0200 ++++ etc/udev/rules.d/50-udev-gen3.rules 2010-06-13 22:48:06.564335735 +0300 +@@ -68,6 +68,7 @@ + # block, tapes, block-releated + SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n" + SUBSYSTEM=="block", KERNEL=="sd[a-z]*", RUN+="/etc/udev/rules.d/disk_automount.sh" ++SUBSYSTEM=="mmc", KERNEL=="mmcblk[0-9]*", RUN+="/etc/udev/rules.d/disk_automount.sh" + SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="0|7|14", ATTR{timeout}="60" + SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="1", ATTR{timeout}="900" + KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k" diff --git a/canmore/addons/etc/udev/rules.d/disk_automount.sh b/canmore/addons/etc/udev/rules.d/disk_automount.sh new file mode 100755 index 00000000..cf118635 --- /dev/null +++ b/canmore/addons/etc/udev/rules.d/disk_automount.sh @@ -0,0 +1,186 @@ +#!/bin/sh -x + +# Uncomment the following line to turn on debugging.MOUNTTO +#DEBUG=yes; export DEBUG + +source /etc/profile + +if [ -x /usr/bin/logger ]; then + LOGGER=/usr/bin/logger +elif [ -x /bin/logger ]; then + LOGGER=/bin/logger +fi + +mesg () +{ + $LOGGER -t $(basename $0)"[$$]" "$@" +} + +debug_mesg () +{ +# echo $@ + test "$DEBUG" = "" -o "$DEBUG" = no && return + mesg "SEQNUM:$SEQNUM $@" +} + +do_cleanup () +{ + # Cleanup any entries in /tmp/mnt which are not in /proc/partitions + for f in /tmp/mnt/* ; do + debug_mesg "Checking mount point $f" + if [ "$f" != "/tmp/mnt/*" ] ; then + MOUNTED_DEVICE=`grep "$f " /proc/mounts | cut -d " " -f 1` + FS_TYPE=`grep "$f " /proc/mounts | cut -d " " -f 3` + if [ -n "$MOUNTED_DEVICE" -a $FS_TYPE != "nfs" ] ; then + debug_mesg "checking if device $MOUNTED_DEVICE is still attached" + MOUNTED_DEVICE_SUFFIX=`basename $MOUNTED_DEVICE` + DEVICE_EXISTS=`grep -c $MOUNTED_DEVICE_SUFFIX /proc/partitions` + if [ $DEVICE_EXISTS = "0" ] ; then + debug_mesg "unmounting $MOUNTED_DEVICE since it's not in /proc/partitions" + umount $MOUNTED_DEVICE + fi + fi + fi + done + for f in /tmp/mnt/* ; do + debug_mesg "Checking mount point $f" + if [ "$f" != "/tmp/mnt/*" ] ; then + MOUNT=`grep "$f " /proc/mounts | cut -d " " -f 2` + if [ -z "$MOUNT" ] ; then + debug_mesg "Removing unused mount point: $f" + /bin/rmdir "$f" + fi + fi + done + # Cleanup any entries in /media/* which point to a stale directory + for f in /media/* ; do + if [ "$f" != "/media/*" ] ; then + MOUNT=`readlink "$f"` + if [ ! -e "$MOUNT" ] ; then + debug_mesg "Removing unused symbolic link: $f" + /bin/rm "$f" + fi + fi + done +} + +debug_mesg "arguments ($*) env (`env`)" + +if [ "$ACTION" == "add" ] ; then + # Check if this is a removable partition + do_cleanup + + REMOVABLE="/sys$DEVPATH/removable" + if [ `cat $REMOVABLE` -eq 0 ] ; then + debug_mesg "The flag in the file $REMOVABLE is 0. It is most likely not a mountable partition. Exiting." + exit 1 + else + debug_mesg "The flag in the file $REMOVABLE is 1. It is most likely a mountable partition." + fi + + eval `/opt/local/sbin/blkid -o udev -p ${DEVNAME}` + + if [ -z "$ID_FS_TYPE" ]; then + debug_mesg "Empty filesystem type. Bailing out." + exit 0 + fi + + if [ -z "$ID_FS_UUID" ]; then + debug_mesg "Empty UUID. Bailing out." + exit 0 + fi + + # Look for a mount point + MOUNTTO="/tmp/mnt/$ID_FS_UUID" + /bin/mkdir -p "${MOUNTTO}" + debug_mesg "Mounting device: $DEVNAME with label $ID_FS_UUID to $MOUNTTO($ID_FS_TYPE)" + + if [ -z "$ID_FS_LABEL" ]; then + ID_FS_LABEL="Unnamed" + fi + + LABEL=`/opt/local/sbin/blkid -o value -s LABEL -p ${DEVNAME}` + if [ -z "$LABEL" ]; then + LABEL="Unnamed" + fi + + debug_mesg "Create softlink for device: $DEVNAME with label $ID_FS_LABEL ($ID_FS_TYPE)" + + + LINKTO="/media/$LABEL" + FOUND=0 + COUNT=0 + ORIG_LINKTO=$LINKTO + while [ $FOUND -eq 0 ]; do + if [ ! -e "${LINKTO}" ]; then + /bin/ln -sf "${MOUNTTO}" "${LINKTO}" + echo "Linking to ${LINKTO}" + FOUND=1 + else + let COUNT++ + LINKTO="${ORIG_LINKTO} (${COUNT})" + fi + done + + MOUNTRC=0 + + # Perform the mount + case "$ID_FS_TYPE" in + vfat) mount -t vfat $DEVNAME "${MOUNTTO}" -o flush,uid=65534,utf8 || MOUNTRC=$? + ;; + ntfs) mount -t auto $DEVNAME "${MOUNTTO}" -o force,flush,uid=65534,locale=en_US.UTF-8 || MOUNTRC=$? + ;; + ext2) mount -t auto $DEVNAME "${MOUNTTO}" -o check=none,nosuid,noexec,nodev,errors=continue || MOUNTRC=$? + ;; + ext3|ext4) mount -t auto $DEVNAME "${MOUNTTO}" -o nosuid,noexec,nodev || MOUNTRC=$? + ;; + hfs) /opt/local/sbin/fsck.hfs -y $DEVNAME + mount -t auto $DEVNAME "${MOUNTTO}" -o nosuid,noexec,nodev || MOUNTRC=$? + ;; + hfsplus) /opt/local/sbin/fsck.hfsplus -y $DEVNAME + mount -t auto $DEVNAME "${MOUNTTO}" -o nosuid,noexec,nodev || MOUNTRC=$? + ;; + esac + + if [ $MOUNTRC -ne 0 ]; then + debug_mesg "failed to mount device $DEVNAME, removing excess garbage and bailing out" + rm "${LINKTO}" + rmdir "${MOUNTTO}" + exit 0 + fi + + # Inform HAL + /opt/local/bin/curl "http://127.0.0.1:5700/storage.OnMount?path=${MOUNTTO}" + +elif [ "$ACTION" == "remove" ] ; then + + if [ -z "$DEVNAME" ]; then + echo "Got unmount request without device name. Bailing out." + exit 1 + fi + + MOUNT=`grep "$DEVNAME " /proc/mounts | cut -d " " -f 2` + UMOUNT_SUCCEEDED=1 + if [ ! -z "$MOUNT" ] ; then + debug_mesg "Unmounting device: $DEVNAME from $MOUNT" + /bin/umount -f $MOUNT + if [ $? != "0" ]; then + debug_mesg "failed to umount $MOUNT" + UMOUNT_SUCCEEDED=0 + else + debug_mesg "umounted $MOUNT" + UMOUNT_SUCCEEDED=1 + fi + # Inform HAL + fi + + do_cleanup + + /opt/local/bin/curl "http://127.0.0.1:5700/storage.OnUnmount?path=${MOUNT}\&successful=${UMOUNT_SUCCEEDED}" + +elif [ "$ACTION" == "cleanup" ] ; then + do_cleanup +else + debug_mesg hotplug $ACTION event not supported + exit 1 +fi diff --git a/canmore/addons/lib/modules/2.6.28 b/canmore/addons/lib/modules/2.6.28 new file mode 120000 index 00000000..b97ae9a9 --- /dev/null +++ b/canmore/addons/lib/modules/2.6.28 @@ -0,0 +1 @@ +/opt/local/lib/modules/2.6.28 \ No newline at end of file diff --git a/canmore/addons/sbin/mount.exfat b/canmore/addons/sbin/mount.exfat new file mode 120000 index 00000000..775baa81 --- /dev/null +++ b/canmore/addons/sbin/mount.exfat @@ -0,0 +1 @@ +/opt/local/sbin/mount.exfat \ No newline at end of file diff --git a/canmore/boxee-ce4100-addons-vxxx.tar.xz b/canmore/boxee-ce4100-addons-vxxx.tar.xz new file mode 100644 index 00000000..62907928 Binary files /dev/null and b/canmore/boxee-ce4100-addons-vxxx.tar.xz differ diff --git a/canmore/boxee_cube/Makefile b/canmore/boxee_cube/Makefile new file mode 100644 index 00000000..10628e60 --- /dev/null +++ b/canmore/boxee_cube/Makefile @@ -0,0 +1,9 @@ +CXX=i686-cm-linux-g++ +CC=i686-cm-linux-gcc +LDFLAGS=-L/opt/canmore/local/lib -lgdl -lEGL -ljpeg -lGLESv2 +CFLAGS=-I/opt/canmore/local/include -I/opt/canmore/IntelCE/include -I/opt/canmore/IntelCE/include/linux_user -DHAS_EMBEDDED -D__STDC_CONSTANT_MACROS + +all: boxee_cube + +boxee_cube: boxee_cube.cpp cube2.o matrix.o readjpeg.o + $(CXX) $(CFLAGS) -o boxee_cube boxee_cube.cpp cube2.o matrix.o readjpeg.o $(LDFLAGS) diff --git a/canmore/boxee_cube/boxee_cube.cpp b/canmore/boxee_cube/boxee_cube.cpp new file mode 100644 index 00000000..e6cf339f --- /dev/null +++ b/canmore/boxee_cube/boxee_cube.cpp @@ -0,0 +1,194 @@ +#include +#include +#include +#include +#include + +extern "C" +{ +#include +#include +#ifdef HAS_EMBEDDED +#include +#include +#include +#include +#include +#endif +} + +extern "C" +{ +int setup_egl(gdl_plane_id_t plane, EGLDisplay* display, EGLSurface* surface, EGLContext* context); +int setup_gl(GLuint* programId, GLuint* vertexShaderId, GLuint* fragmentShaderId, int * mvp_loc); +void render(GLfloat rot_x, GLfloat rot_y, int mvp_loc); +} + +#define WIDTH 1920 +#define HEIGHT 1080 + +/** + * Initializes a plane for the graphics to be rendered to + */ +gdl_ret_t setup_plane(gdl_plane_id_t plane, bool gfx) +{ + gdl_pixel_format_t pixelFormat = GDL_PF_ARGB_32; + gdl_color_space_t colorSpace = GDL_COLOR_SPACE_RGB; + gdl_rectangle_t srcRect; + gdl_rectangle_t dstRect; + gdl_ret_t rc = GDL_SUCCESS; + + dstRect.origin.x = 0; + dstRect.origin.y = 0; + dstRect.width = WIDTH; + dstRect.height = HEIGHT; + + srcRect.origin.x = 0; + srcRect.origin.y = 0; + srcRect.width = WIDTH; + srcRect.height = HEIGHT; + + rc = gdl_plane_reset(plane); + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_config_begin(plane); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_set_attr(GDL_PLANE_SRC_COLOR_SPACE, &colorSpace); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_set_attr(GDL_PLANE_PIXEL_FORMAT, &pixelFormat); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_set_attr(GDL_PLANE_DST_RECT, &dstRect); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_set_attr(GDL_PLANE_SRC_RECT, &srcRect); + } + + if (gfx) + { + int alpha = 255; + gdl_plane_set_attr(GDL_PLANE_ALPHA_GLOBAL, &alpha); + } + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_config_end(GDL_FALSE); + } + else + { + gdl_plane_config_end(GDL_TRUE); + } + + if (GDL_SUCCESS != rc) + { + fprintf(stderr, "GDL configuration failed! GDL error code is 0x%x\n", rc); + } + + return rc; +} + +int timeval_subtract (struct timeval* result, struct timeval *x, struct timeval *y) +{ + /* Perform the carry for the later subtraction by updating y. */ + if (x->tv_usec < y->tv_usec) { + int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1; + y->tv_usec -= 1000000 * nsec; + y->tv_sec += nsec; + } + + if (x->tv_usec - y->tv_usec > 1000000) { + int nsec = (x->tv_usec - y->tv_usec) / 1000000; + y->tv_usec += 1000000 * nsec; + y->tv_sec -= nsec; + } + + /* Compute the time remaining to wait. + tv_usec is certainly positive. */ + result->tv_sec = x->tv_sec - y->tv_sec; + result->tv_usec = x->tv_usec - y->tv_usec; + + /* Return 1 if result is negative. */ + return x->tv_sec < y->tv_sec; +} + +int main(int argc, char *argv[]) +{ + EGLDisplay display = EGL_NO_DISPLAY; + EGLSurface surface = EGL_NO_SURFACE; + EGLContext context = EGL_NO_CONTEXT; + GLfloat rotation_x = 0; /* angle for rotation in x direction */ + GLfloat rotation_y = 0; /* angle for rotation in y direction */ + + GLuint vertexShaderId = 0; /* vertex shader id */ + GLuint fragmentShaderId = 0; /* fragment shader id */ + GLuint programId = 0; /* program id */ + int mvpLoc = 0; /* for the uniform varible index value of mvp matrix */ + int status; /* function call's return value */ + unsigned int frame_count = 0; + + gdl_init(0); + + setup_plane(GDL_PLANE_ID_UPP_B, true); + status = setup_egl(GDL_PLANE_ID_UPP_B, &display, &surface, &context); + if (status != GL_TRUE) + { + printf("error setting egl\n"); + return 1; + } + + status = setup_gl(&programId, &vertexShaderId, &fragmentShaderId, &mvpLoc); + if (status != GL_TRUE) + { + printf("error setting gl\n"); + return 1; + } + + int frame = 0; + + struct timeval start; + gettimeofday(&start, NULL); + struct timeval now; + struct timeval sub; + int duration; + + while (1) + { + render(rotation_x, rotation_y, mvpLoc); + eglSwapBuffers(display, surface); + frame++; + + rotation_x += 5.0f; + if (rotation_x > 360.0f) + { + rotation_x = 0.0f; + } + + rotation_y += 2.0f; + if (rotation_y > 360.0f) + { + rotation_y = 0.0f; + } + + gettimeofday(&now, NULL); + + timeval_subtract(&sub, &now, &start); + duration = (sub.tv_usec + sub.tv_sec*1000000) / 1000; + + if (duration > 5000) + { + printf("CUBE FPS = %d\n", duration / frame); + frame = 0; + start = now; + } + } +} + diff --git a/canmore/boxee_cube/cube2.c b/canmore/boxee_cube/cube2.c new file mode 100644 index 00000000..25ae87f0 --- /dev/null +++ b/canmore/boxee_cube/cube2.c @@ -0,0 +1,726 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2008-2009 Intel Corporation +// +// DISTRIBUTABLE AS SAMPLE SOURCE SOFTWARE +// +// This Distributable As Sample Source Software is subject to the terms and +// conditions of the Intel Software License Agreement provided with the Intel(R) +// Media Processor Software Development Kit. +//------------------------------------------------------------------------------ +/*------------------------------------------------------------------------------ + * This is an OpenGL ES 2.0 sample program using GDL and EGL. It shows how to set + * up GDL and EGL for OpenGL ES 2.0 program. Also it demonstrates how to + * set vertex attributes such as vertex positions, normals, color values and + * texture coordinates. Shows how to initialize uniform variables in the + * application. In addition, it shows how to use texture mapping. + -----------------------------------------------------------------------------*/ + +#include +#include +#include +#include +#include "libgdl.h" + +#include "matrix.h" +#include "image.h" + +// Plane size and position +#define ORIGIN_X 0 +#define ORIGIN_Y 0 +#define WIDTH 640 +#define HEIGHT 480 +#define ASPECT ((GLfloat)16 / (GLfloat)9) +#define SQUARE_SIZE 25 // half of the cube side length +#define MSG_LEN 1024 // error message length +#define TRUE 1 +#define FALSE 0 + +/* All the matrices are initialized to identity matrix */ +static GLfloat projection[16] = {1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}; +static GLfloat modelview[16] = {1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}; +static GLfloat mvp[16] = {1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}; + +/** + * Load an JPEG image for texture mapping + */ +GLuint read_jpeg_image(imagebuffer_st * image, char *filename, int alpha_value) +{ + GLuint ret = TRUE; + + if (image != NULL + && filename != NULL) + { + fprintf(stdout,"readjpg(%s)\n",filename); + + image->color_format = IMAGE_RGBA; + image->lines_format = IMAGE_REVERSE; + + if (read_JPEG_file(image, filename, alpha_value)) + { + fprintf(stdout,"Loaded: %s (%dx%d)\n", filename, image->width, image->height); + } + else + { + fprintf(stderr,"Cannot load %s\n", filename); + ret = FALSE; + } + } + else + { + ret = FALSE; + fprintf(stderr, "read_jpeg_image() error: null input parameters.\n"); + } + return ret; +} + + +/** + * Read the shader files + */ +char * readShaderText(const char * fileName, int * len) +{ + char *pText = NULL; + if (fileName != NULL) + { + FILE *pFile = fopen(fileName, "r"); + if (pFile == NULL) + { + fprintf(stderr, "File not found! '%s'\n", fileName); + } + else + { + fseek(pFile, 0, SEEK_END); + *len = ftell(pFile); + rewind(pFile); + + if (*len > 0 ) + { + pText = (char*)malloc(*len+1); + if (pText != NULL) + { + *len = (int)fread(pText, sizeof(char), *len, pFile); + pText[*len] = '\0'; + } + } + fclose(pFile); + } + } + else + { + fprintf(stderr,"readShaderText() error: file name can not be empty.\n"); + } + return pText; +} + +/** + * Create the shaders + */ +unsigned int createGLShader(const char * fileName, int shaderType) +{ + GLuint shaderId = 0; // vertex or fragment shader Id + char pInfoLog[MSG_LEN+1]; // error message + int shaderStatus, infoLogLength; //shader's status and error information length + int shaderTexLen = 0; // shader text length + const char* pShaderText = readShaderText(fileName, &shaderTexLen); + if (pShaderText != NULL) + { + if( 1 == shaderType ) + { + shaderId = glCreateShader(GL_VERTEX_SHADER); + } + else + { + shaderId = glCreateShader(GL_FRAGMENT_SHADER); + } + glShaderSource(shaderId, 1, (const char **)&pShaderText, &shaderTexLen); + glCompileShader(shaderId); + + free((void*)pShaderText); + glGetShaderiv( shaderId, GL_COMPILE_STATUS, &shaderStatus); + if (shaderStatus != GL_TRUE) + { + if( 1 == shaderType ) + { + fprintf(stderr,"Error: Failed to compile GL vertex Shader\n"); + } + else + { + fprintf(stderr,"Error: Failed to compile GL fragment Shader\n"); + } + glGetShaderInfoLog( shaderId, MSG_LEN, &infoLogLength, pInfoLog); + if (infoLogLength > MSG_LEN) + { + pInfoLog[MSG_LEN] = '\0'; + } + else + { + pInfoLog[infoLogLength] = '\0'; + } + fprintf(stderr, "%s",pInfoLog); + + } + } + return shaderId; +} + +/** + * Initializes a plane for the graphics to be rendered to + */ +gdl_ret_t setup_plane(gdl_plane_id_t plane) +{ + gdl_pixel_format_t pixelFormat = GDL_PF_ARGB_32; + gdl_color_space_t colorSpace = GDL_COLOR_SPACE_RGB; + gdl_rectangle_t srcRect; + gdl_rectangle_t dstRect; + gdl_ret_t rc = GDL_SUCCESS; + + dstRect.origin.x = ORIGIN_X; + dstRect.origin.y = ORIGIN_Y; + dstRect.width = WIDTH; + dstRect.height = HEIGHT; + + srcRect.origin.x = 0; + srcRect.origin.y = 0; + srcRect.width = WIDTH; + srcRect.height = HEIGHT; + + rc = gdl_plane_reset(plane); + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_config_begin(plane); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_set_attr(GDL_PLANE_SRC_COLOR_SPACE, &colorSpace); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_set_attr(GDL_PLANE_PIXEL_FORMAT, &pixelFormat); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_set_attr(GDL_PLANE_DST_RECT, &dstRect); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_set_attr(GDL_PLANE_SRC_RECT, &srcRect); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_config_end(GDL_FALSE); + } + else + { + gdl_plane_config_end(GDL_TRUE); + } + + if (GDL_SUCCESS != rc) + { + fprintf(stderr,"GDL configuration failed! GDL error code is 0x%x\n", rc); + } + + return rc; +} + + +/** + * Initializes EGL, creates a rendering context, and creates a + * window surface to render to + */ +int setup_egl(gdl_plane_id_t plane, EGLDisplay* display, EGLSurface* surface, EGLContext* context) +{ + int ret = TRUE; + + NativeWindowType window = (NativeWindowType)plane; + EGLint configAttrs[] = + { + EGL_BUFFER_SIZE, EGL_DONT_CARE, + EGL_SAMPLE_BUFFERS, 1, /* multisample is set */ + EGL_SAMPLES, 4, /* number of samples per pixel */ + EGL_DEPTH_SIZE, 16, + EGL_RED_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_BLUE_SIZE, 8, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + EGL_NONE + }; + EGLint contextAttrs[] = + { + EGL_CONTEXT_CLIENT_VERSION, 2, // Specifies to use OpenGL ES 2.0 + EGL_NONE + }; + EGLConfig config = 0; + EGLint numconfigs = 0; + EGLint major = 0, minor = 0; + EGLBoolean ok = EGL_FALSE; + + if (display != NULL + && surface != NULL + && context != NULL) + { + *display = eglGetDisplay((NativeDisplayType)EGL_DEFAULT_DISPLAY); + if (*display != EGL_NO_DISPLAY) + { + ok = eglInitialize(*display, &major, &minor); + } + else + { + ok = EGL_FALSE; + } + fprintf(stdout,"EGL %d.%d initialized\n", major, minor); + + if (ok) + { + ok = eglChooseConfig(*display, configAttrs, &config, 1, &numconfigs); + } + + if (ok && numconfigs > 0) + { + *surface = eglCreateWindowSurface(*display, config, window, NULL); + } + else if (numconfigs <= 0) + { + ok = EGL_FALSE; + } + + if (*surface != EGL_NO_SURFACE) + { + ok = eglBindAPI(EGL_OPENGL_ES_API); + } + + if (ok) + { + *context = eglCreateContext(*display, config, NULL, contextAttrs); + } + + if (*context != EGL_NO_CONTEXT) + { + ok = eglMakeCurrent(*display, *surface, *surface, *context); + } + + if (*display == EGL_NO_DISPLAY + || *surface == EGL_NO_SURFACE + || *context == EGL_NO_CONTEXT + || ok != EGL_TRUE) + { + fprintf(stderr,"EGL initialization failed!\n"); + fprintf(stderr,"display = 0x%x surface = 0x%x context = 0x%x\n", + *display, *surface, *context); + ret = FALSE; + } + } + else + { + ret = FALSE; + fprintf(stderr, "Error: pointer values should not be empty.\n"); + } + + return ret; +} + +/** + * clean up the egl + */ +void close_egl(EGLDisplay display, EGLSurface surface, EGLContext context) +{ + if (context != EGL_NO_CONTEXT) + { + eglDestroyContext(display, context); + } + if (surface != EGL_NO_SURFACE) + { + eglDestroySurface(display, surface); + } + + eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + if (display != EGL_NO_DISPLAY) + { + eglTerminate(display); + } +} + +/** + * Initializes the vertex positions, colors and texture coordinates. + * Initializes OpenGL by setting up projection matrix, enabling necessary state + * to pass positions, colors and texture coordinates to OpenGL. Get index for + * uniform variables used in vertex and fragment shaders. + */ +int setup_gl(GLuint* programId, GLuint* vertexShaderId, GLuint* fragmentShaderId, int * mvp_loc) +{ + GLuint status, ret; /* gl error status and return value for this setup */ + GLuint tex_loc; /* for the texture coordinate attribute index */ + int texture_pos = 0; /* for the texture unit id uniform variable */ + + int shaderStatus = GL_FALSE; // shader status + int infoLen; // error checking info length + char infoLog[MSG_LEN+1]; // error checking info log + + ret = TRUE; // set return value to be true + static GLfloat verts[] = // vertex position x, y and z values + { + -SQUARE_SIZE, -SQUARE_SIZE, SQUARE_SIZE, + SQUARE_SIZE, -SQUARE_SIZE, SQUARE_SIZE, + -SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE, + + SQUARE_SIZE, -SQUARE_SIZE, SQUARE_SIZE, + SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE, + -SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE, + + -SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE, + SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE, + -SQUARE_SIZE, SQUARE_SIZE, -SQUARE_SIZE, + + SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE, + SQUARE_SIZE, SQUARE_SIZE, -SQUARE_SIZE, + -SQUARE_SIZE, SQUARE_SIZE, -SQUARE_SIZE, + + -SQUARE_SIZE, SQUARE_SIZE, -SQUARE_SIZE, + SQUARE_SIZE, SQUARE_SIZE, -SQUARE_SIZE, + SQUARE_SIZE, -SQUARE_SIZE, -SQUARE_SIZE, + + SQUARE_SIZE, -SQUARE_SIZE, -SQUARE_SIZE, + -SQUARE_SIZE, -SQUARE_SIZE, -SQUARE_SIZE, + -SQUARE_SIZE, SQUARE_SIZE, -SQUARE_SIZE, + + -SQUARE_SIZE, -SQUARE_SIZE, -SQUARE_SIZE, + SQUARE_SIZE, -SQUARE_SIZE, -SQUARE_SIZE, + SQUARE_SIZE, -SQUARE_SIZE, SQUARE_SIZE, + + SQUARE_SIZE, -SQUARE_SIZE, SQUARE_SIZE, + -SQUARE_SIZE, -SQUARE_SIZE, SQUARE_SIZE, + -SQUARE_SIZE, -SQUARE_SIZE, -SQUARE_SIZE, + + SQUARE_SIZE, -SQUARE_SIZE, SQUARE_SIZE, + SQUARE_SIZE, -SQUARE_SIZE, -SQUARE_SIZE, + SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE, + + SQUARE_SIZE, -SQUARE_SIZE, -SQUARE_SIZE, + SQUARE_SIZE, SQUARE_SIZE, -SQUARE_SIZE, + SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE, + + -SQUARE_SIZE, -SQUARE_SIZE, SQUARE_SIZE, + -SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE, + -SQUARE_SIZE, -SQUARE_SIZE, -SQUARE_SIZE, + + -SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE, + -SQUARE_SIZE, SQUARE_SIZE, -SQUARE_SIZE, + -SQUARE_SIZE, -SQUARE_SIZE, -SQUARE_SIZE, + }; + + static GLfloat colors[] = // vertex color r, g, b and alpha values + { + 1.0f, 0.0f, 0.0f, 0.5f, + 1.0f, 0.0f, 0.0f, 0.5f, + 1.0f, 0.0f, 0.0f, 0.5f, + 1.0f, 0.0f, 0.0f, 0.5f, + 1.0f, 0.0f, 0.0f, 0.5f, + 1.0f, 0.0f, 0.0f, 0.5f, + + 0.0f, 1.0f, 0.0f, 0.5f, + 0.0f, 1.0f, 0.0f, 0.5f, + 0.0f, 1.0f, 0.0f, 0.5f, + 0.0f, 1.0f, 0.0f, 0.5f, + 0.0f, 1.0f, 0.0f, 0.5f, + 0.0f, 1.0f, 0.0f, 0.5f, + + 1.0f, 1.0f, 0.0f, 0.5f, + 1.0f, 1.0f, 0.0f, 0.5f, + 1.0f, 1.0f, 0.0f, 0.5f, + 1.0f, 1.0f, 0.0f, 0.5f, + 1.0f, 1.0f, 0.0f, 0.5f, + 1.0f, 1.0f, 0.0f, 0.5f, + + 0.0f, 0.0f, 1.0f, 0.5f, + 0.0f, 0.0f, 1.0f, 0.5f, + 0.0f, 0.0f, 1.0f, 0.5f, + 0.0f, 0.0f, 1.0f, 0.5f, + 0.0f, 0.0f, 1.0f, 0.5f, + 0.0f, 0.0f, 1.0f, 0.5f, + + 0.6f, 0.6f, 0.0f, 0.5f, + 0.6f, 0.6f, 0.0f, 0.5f, + 0.6f, 0.6f, 0.0f, 0.5f, + 0.6f, 0.6f, 0.0f, 0.5f, + 0.6f, 0.6f, 0.0f, 0.5f, + 0.6f, 0.6f, 0.0f, 0.5f, + + 0.0f, 0.6f, 0.6f, 0.5f, + 0.0f, 0.6f, 0.6f, 0.5f, + 0.0f, 0.6f, 0.6f, 0.5f, + 0.0f, 0.6f, 0.6f, 0.5f, + 0.0f, 0.6f, 0.6f, 0.5f, + 0.0f, 0.6f, 0.6f, 0.5f + }; + + static GLfloat texCoord[] = // texture coordinates for each vertex + { + 0,0, 1,0, 0,1, + 1,0, 1,1, 0,1, + 0,0, 1,0, 0,1, + 1,0, 1,1, 0,1, + 1,1, 0,1, 0,0, + 0,0, 1,0, 1,1, + 0,0, 1,0, 1,1, + 1,1, 0,1, 0,0, + 0,0, 1,0, 0,1, + 1,0, 1,1, 0,1, + 1,0, 1,1, 0,0, + 1,1, 0,1, 0,0 + }; + + if ( programId != NULL + && vertexShaderId != NULL + && fragmentShaderId != NULL + && mvp_loc != NULL ) + { + imagebuffer_st image; // image structure for reading jpg from JPEG file + if (read_jpeg_image(&image,"sky.jpg", 0xFF) == TRUE) + { + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width, image.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image.buffer); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + // Free the memory for the JPEG file after it was copied into texture memory + if (image.buffer) + { + free(image.buffer); + } + + // Create the Shader programs + *vertexShaderId = createGLShader("cube_vertshader.txt", 1); + *fragmentShaderId = createGLShader("cube_fragshader.txt", 2); + + if( (*vertexShaderId) && (*fragmentShaderId) ) + { + // Create Programs + *programId = glCreateProgram(); + + glAttachShader(*programId, *vertexShaderId); + glAttachShader(*programId, *fragmentShaderId); + + glBindAttribLocation(*programId, 0, "position"); + glBindAttribLocation(*programId, 1, "inputcolor"); + + glLinkProgram(*programId); + + glGetProgramiv(*programId, GL_LINK_STATUS, &shaderStatus); + if (shaderStatus != GL_TRUE) + { + fprintf(stderr,"Error: Failed to link GLSL program\n"); + glGetProgramInfoLog(*programId, MSG_LEN, &infoLen, infoLog); + if (infoLen > MSG_LEN) + { + infoLog[MSG_LEN] = '\0'; + } + fprintf(stderr,"%s\n",infoLog); + ret = FALSE; + } + else // (shaderStatus == GL_TRUE) + { + glValidateProgram(*programId); + glGetProgramiv(*programId, GL_VALIDATE_STATUS, &shaderStatus); + if (shaderStatus != GL_TRUE) + { + fprintf(stderr,"Error: Failed to validate GLSL program\n"); + glGetProgramInfoLog(*programId, MSG_LEN, &infoLen, infoLog); + if (infoLen > MSG_LEN) + { + infoLog[MSG_LEN] = '\0'; + } + fprintf(stderr,"%s\n",infoLog); + ret = FALSE; + } + } + + if (shaderStatus == GL_TRUE) + { + *mvp_loc = glGetUniformLocation(*programId, "mvp"); + texture_pos = glGetUniformLocation(*programId, "texture"); + + glUseProgram(*programId); + glUniform1i(texture_pos, 0); + + fprintf(stdout,"Vertex and fragment shaders created. \n"); + glClearColor(0.0f, 0.0f, 0.0f,0.0f); + glEnable(GL_DEPTH_TEST); + glEnableVertexAttribArray(0); + glEnableVertexAttribArray(1); + glVertexAttribPointer(0, 3, GL_FLOAT, 0, 0, verts); + glVertexAttribPointer(1, 4, GL_FLOAT, 0, 0, colors); + + tex_loc = glGetAttribLocation(*programId, "inputtexture"); + glVertexAttribPointer(tex_loc, 2, GL_FLOAT, 0, 0, texCoord); + glEnableVertexAttribArray(tex_loc); + + fprintf(stdout, "OpenGL version is : %s\n", glGetString(GL_VERSION)); + + myIdentity(projection); + + myFrustum(projection, -100*ASPECT,100*ASPECT, -100, 100, 175, 300); + + status = glGetError(); /* check openGL error */ + if (status != GL_NO_ERROR) + { + fprintf(stderr, "GL_ERROR = %x", status); + ret = FALSE; + } + + glViewport(1220, 680, 800, 500); + } + } + else + { + fprintf(stderr, "Error: Could not set up openGL properly\n"); + ret = FALSE; + } + } + else /* failed to read jpeg file successfully */ + { + ret = FALSE; + } + } + else + { + fprintf(stderr,"setup_gl() error: null input parameters.\n"); + ret = FALSE; + } + return ret; +} + +/** + *clean up OpenGL + */ +void close_gl(GLuint programId, GLuint vertexShaderId, GLuint fragmentShaderId) +{ + if (vertexShaderId) + { + glDetachShader(programId, vertexShaderId); + } + if (fragmentShaderId) + { + glDetachShader(programId, fragmentShaderId); + } + if (programId) + { + glDeleteProgram(programId); + } + if (vertexShaderId) + { + glDeleteShader(vertexShaderId); + } + if (fragmentShaderId) + { + glDeleteShader(fragmentShaderId); + } +} + +/** + * Renders the cube + */ +void render(GLfloat rot_x, GLfloat rot_y, int mvp_loc) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + myIdentity(modelview); + myTranslate(modelview, 0,0,-SQUARE_SIZE*10); + myRotate(modelview, rot_x, 1, 0, 0); + myRotate(modelview, rot_y, 0, 1, 0); + + myMultMatrix(mvp, projection, modelview); + glUniformMatrix4fv(mvp_loc, 1, GL_FALSE, mvp); + + glDrawArrays(GL_TRIANGLES, 0, 36 ); +} + +void usage(char * name) +{ + fprintf(stdout, "\nUsage: %s [ frames ]\n", name); + fprintf(stdout, "where:\n\n"); + fprintf(stdout, " frames: a positive number for the number of frames to run.\n"); +} + +#if 0 +/** + * There should be a command line argument for the number of frames + * it will run. + */ +int main(int argc, char *argv[]) +{ + EGLDisplay display = EGL_NO_DISPLAY; + EGLSurface surface = EGL_NO_SURFACE; + EGLContext context = EGL_NO_CONTEXT; + GLfloat rotation_x = 0; /* angle for rotation in x direction */ + GLfloat rotation_y = 0; /* angle for rotation in y direction */ + + GLuint vertexShaderId = 0; /* vertex shader id */ + GLuint fragmentShaderId = 0; /* fragment shader id */ + GLuint programId = 0; /* program id */ + int mvpLoc = 0; /* for the uniform varible index value of mvp matrix */ + int status; /* function call's return value */ + unsigned int frame_count = 0; + + if (argc == 2) + { + frame_count = (unsigned int)atoi(argv[1]); + if (frame_count <= 0) + { + usage(argv[0]); + return 0; + } + } + else + { + usage(argv[0]); + + return 0; + } + + gdl_plane_id_t plane = GDL_PLANE_ID_UPP_C; + + gdl_init(0); + + status = setup_plane(plane); + if (status == GDL_SUCCESS) + { + status = setup_egl(plane, &display, &surface, &context); + if (status == GL_TRUE) + { + status = setup_gl(&programId, &vertexShaderId, &fragmentShaderId, &mvpLoc); + if (status == GL_TRUE) + { + while (frame_count > 0) + { + render(rotation_x, rotation_y, mvpLoc); + eglSwapBuffers(display, surface); + + rotation_x += 1.0f; + if (rotation_x > 360.0f) + { + rotation_x = 0.0f; + } + + rotation_y += 0.1f; + if (rotation_y > 360.0f) + { + rotation_y = 0.0f; + } + + frame_count--; + } + } + close_gl(programId, vertexShaderId, fragmentShaderId); + } + close_egl(display, surface, context); + } + + gdl_close(); + + return 0; +} +#endif diff --git a/canmore/boxee_cube/cube_fragshader.txt b/canmore/boxee_cube/cube_fragshader.txt new file mode 100644 index 00000000..470d1d24 --- /dev/null +++ b/canmore/boxee_cube/cube_fragshader.txt @@ -0,0 +1,21 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2008 Intel Corporation +// +// DISTRIBUTABLE AS SAMPLE SOURCE SOFTWARE +// +// This Distributable As Sample Source Software is subject to the terms and +// conditions of the Intel Software License Agreement provided with the +// Intel(R) Media Processor Software Development Kit. +//------------------------------------------------------------------------------ +varying mediump vec4 basecolor; // color from vertex shader +varying mediump vec2 texcoord; // texture coordinate from vertex shader + +uniform sampler2D texture; // passed from application + +void main(void) +{ + mediump vec4 texcolor = texture2D(texture, texcoord); // texture lookup + + mediump vec4 tmpColor = basecolor * texcolor; + gl_FragColor = vec4(tmpColor.xyz, 1); // set the alpha value to be 1 +} diff --git a/canmore/boxee_cube/cube_vertshader.txt b/canmore/boxee_cube/cube_vertshader.txt new file mode 100644 index 00000000..e571cd98 --- /dev/null +++ b/canmore/boxee_cube/cube_vertshader.txt @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2008 Intel Corporation +// +// DISTRIBUTABLE AS SAMPLE SOURCE SOFTWARE +// +// This Distributable As Sample Source Software is subject to the terms and +// conditions of the Intel Software License Agreement provided with the +// Intel(R) Media Processor Software Development Kit. +//------------------------------------------------------------------------------ +varying mediump vec4 basecolor; // color passed to fragment shader +varying mediump vec2 texcoord; //texture coordinate passed to fragment shader + +attribute vec4 position; // vertex attribute +attribute vec4 inputcolor; +attribute vec2 inputtexture; + +uniform mat4 mvp; // modelview and projection matrix from the application + +void main(void) +{ + basecolor = inputcolor; + texcoord = inputtexture; + + gl_Position = mvp * position; +} diff --git a/canmore/boxee_cube/image.h b/canmore/boxee_cube/image.h new file mode 100644 index 00000000..296ccd49 --- /dev/null +++ b/canmore/boxee_cube/image.h @@ -0,0 +1,50 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2008 Intel Corporation +// +// DISTRIBUTABLE AS SAMPLE SOURCE SOFTWARE +// +// This Distributable As Sample Source Software is subject to the terms and +// conditions of the Intel Software License Agreement provided with the Intel(R) +// Media Processor Software Development Kit. +//------------------------------------------------------------------------------ + +#ifndef __image_h__ +#define __image_h__ + +#include + + +/* lines format */ +enum { + IMAGE_NORMAL, /* store top-to-bottom */ + IMAGE_REVERSE /* store bottom-to-top */ +}; + +/* color format */ +enum { + IMAGE_NIL = 0, /* unspecified, use default or guess */ + + IMAGE_RGB, + IMAGE_RGBA, + IMAGE_ARGB, + IMAGE_BGR, + IMAGE_BGRA, + IMAGE_ABGR +}; + +struct imagebuffer_s { + int height; + int width; + int lines_format; + int color_format; + uint8_t * buffer; +}; + +typedef struct imagebuffer_s imagebuffer_st; + +int read_JPEG_file(imagebuffer_st *image, char *filename, uint8_t alpha_value); + +void write_PPM_file(imagebuffer_st *image, char *filename); + +#endif + diff --git a/canmore/boxee_cube/matrix.c b/canmore/boxee_cube/matrix.c new file mode 100644 index 00000000..9ec85a08 --- /dev/null +++ b/canmore/boxee_cube/matrix.c @@ -0,0 +1,584 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2008 Intel Corporation +// +// DISTRIBUTABLE AS SAMPLE SOURCE SOFTWARE +// +// This Distributable As Sample Source Software is subject to the terms and +// conditions of the Intel Software License Agreement provided with the Intel(R) +// Media Processor Software Development Kit. +//------------------------------------------------------------------------------ +/*------------------------------------------------------------------------------ + * matrix.c calculates all kinds of transformation matrices for OpenGL ES 2.0. + * For most functions, the first parameter m[16] is a column major output + * matrix. The formulas used to calculate the transformation matrices and + * projection matrices are based on the OpenGL ES specifications. + -----------------------------------------------------------------------------*/ +#include +#include +#include "matrix.h" + +/** + * Normalize the vector to become a unit vector + * Input: x, y, z --- input vector's x, y and z value + * Output: fout[3] --- output vector + */ +float normalize(float fout[3], float x, float y, float z) +{ + float len = 0; + float lenSquare = 0; + + if (fout != NULL) + { + lenSquare = x*x + y*y + z*z; + + if (lenSquare == 0) + { + fprintf(stderr,"normalize() error: vector length is zero.\n"); + } + else + { + len = 1.0 / sqrt(lenSquare); + + fout[0] = x * len; + fout[1] = y * len; + fout[2] = z * len; + } + } + + return lenSquare; +} + +/** + * Set the 4x4 matrix m[16] to the identity matrix + */ +void myIdentity(float m[16]) +{ + int i; + if (m != NULL) + { + for (i=0; i<16; i++) + { + m[i] = 0; + } + + m[0] = 1.0; + m[5] = 1.0; + m[10] = 1.0; + m[15] = 1.0; + } + else + { + fprintf(stderr, "myIdentity() error: matrix pointer is null.\n"); + } +} + +/** + * Multiply two 4x4 matrices + * Input: src1[16], src2[16] --- two source matrices + * Output: m[16] --- result matrix + */ +void myMultMatrix(float m[16], float src1[16], float src2[16]) +{ + /* src1 or src2 could be the result matrix m as well, so use an intermediate + matrix tm[16] to store the result */ + float tm[16]; + int i = 0; + + if ( m != NULL + && src1 != NULL + && src2 != NULL ) + { + tm[0] = src1[0] * src2[0] + src1[4] * src2[1] + + src1[8] * src2[2] + src1[12]* src2[3]; + tm[1] = src1[1] * src2[0] + src1[5] * src2[1] + + src1[9] * src2[2] + src1[13]* src2[3]; + tm[2] = src1[2] * src2[0] + src1[6] * src2[1] + + src1[10]* src2[2] + src1[14]* src2[3]; + tm[3] = src1[3] * src2[0] + src1[7] * src2[1] + + src1[11]* src2[2] + src1[15]* src2[3]; + tm[4] = src1[0] * src2[4] + src1[4] * src2[5] + + src1[8] * src2[6] + src1[12]* src2[7]; + tm[5] = src1[1] * src2[4] + src1[5] * src2[5] + + src1[9] * src2[6] + src1[13]* src2[7]; + tm[6] = src1[2] * src2[4] + src1[6] * src2[5] + + src1[10]* src2[6] + src1[14]* src2[7]; + tm[7] = src1[3] * src2[4] + src1[7] * src2[5] + + src1[11]* src2[6] + src1[15]* src2[7]; + tm[8] = src1[0] * src2[8] + src1[4] * src2[9] + + src1[8] * src2[10]+ src1[12]* src2[11]; + tm[9] = src1[1] * src2[8] + src1[5] * src2[9] + + src1[9] * src2[10]+ src1[13]* src2[11]; + tm[10] = src1[2] * src2[8] + src1[6] * src2[9] + + src1[10]* src2[10]+ src1[14]* src2[11]; + tm[11] = src1[3] * src2[8] + src1[7] * src2[9] + + src1[11]* src2[10]+ src1[15]* src2[11]; + tm[12] = src1[0] * src2[12]+ src1[4] * src2[13] + + src1[8] * src2[14]+ src1[12]* src2[15]; + tm[13] = src1[1] * src2[12]+ src1[5] * src2[13] + + src1[9] * src2[14]+ src1[13]* src2[15]; + tm[14] = src1[2] * src2[12]+ src1[6] * src2[13] + + src1[10]* src2[14]+ src1[14]* src2[15]; + tm[15] = src1[3] * src2[12]+ src1[7] * src2[13] + + src1[11]* src2[14]+ src1[15]* src2[15]; + + for (i=0; i<16; i++) + { + m[i] = tm[i]; + } + } + else + { + fprintf(stderr, "myMultMatrix() error: matrix pointers are null.\n"); + } +} + +/** + * Translate the 3D object in the scene + * Input: tx , ty, tz --- the offset for translation in X, Y, and Z dirctions + * Output: m[16] --- the matrix after the translate + */ +void myTranslate(float m[16], float tx, float ty, float tz) +{ + if (m != NULL ) + { + m[12] = m[0] * tx + m[4] * ty + m[8] * tz + m[12]; + m[13] = m[1] * tx + m[5] * ty + m[9] * tz + m[13]; + m[14] = m[2] * tx + m[6] * ty + m[10] * tz + m[14]; + m[15] = m[3] * tx + m[7] * ty + m[11] * tz + m[15]; + } + else + { + fprintf(stderr, "myTranslate() error: matrix pointer is null.\n"); + } +} + +/** + * Scale operation for the object in the scene + * Input: sx, sy, sz --- scaling factors for X, Y and Z directions + * Output: m[16] --- the matrix after the scaling + */ +void myScale(float m[16], float sx, float sy, float sz) +{ + int i; + + if (m != NULL) + { + for (i=0; i<4; i++) + { + m[i] = m[i] * sx; + } + + for (i=4; i<8; i++) + { + m[i] = m[i] * sy; + } + + for (i=8; i<12; i++) + { + m[i] = m[i] * sz; + } + } + else + { + fprintf(stderr, "myScale() error: matrix pointer is null.\n"); + } + +} + +/** + * Rotation operation + * Input: angle, x, y, z + * Output: m[16] --- the matrix after the rotation + */ +void myRotate(float m[16], float angle, float x, float y, float z) +{ + float radians, sine, cosine, t; + // intermediate variables for matrix calculation + float vec[3], txy, tyz, txz, sx, sy, sz; + // 4x4 matrix for intermediate values + float tm[16] = {1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}; + + if (m != NULL) + { + radians = angle * M_PI / 180; + sine = sin(radians); + cosine = cos(radians); + t = 1.0 - cosine; + + if (normalize(vec, x, y, z) > 0 ) + { + txy = t * vec[0] * vec[1]; + tyz = t * vec[1] * vec[2]; + txz = t * vec[0] * vec[2]; + sx = sine * vec[0]; + sy = sine * vec[1]; + sz = sine * vec[2]; + + tm[0] = t * vec[0] * vec[0] + cosine; + tm[1] = txy + sz; + tm[2] = txy - sy; + tm[4] = txy - sz; + tm[5] = t * vec[1] * vec[1] + cosine; + tm[6] = tyz + sx; + tm[8] = txz + sy; + tm[9] = tyz - sx; + tm[10] = t * vec[2] * vec[2] + cosine; + } + + myMultMatrix(m, m, tm); + } + else + { + fprintf(stderr, "myRotate() error: matrix pointer is null.\n"); + } +} + +/** + * Perspective projection transformation + * Input: left, right, bottom, top, near, far parameters similar to glFrustum + * function + * Output: m[16] --- perspective projection matrix + */ +void myFrustum(float m[16], float left, float right, float bottom, float top, + float near, float far) +{ + // temorary 4x4 matrix for intermediate values + float tm[16] = {1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}; + if (m != NULL) + { + if (right != left + && top != bottom + && far != near) + { + tm[0] = 2 * near / (right - left); + tm[5] = 2 * near / (top - bottom); + tm[8] = (right + left) / (right - left); + tm[9] = (top + bottom) / (top - bottom); + tm[10] = (far + near) / (near - far); + tm[11] = -1; + tm[14] = 2 * far * near / (near - far); + tm[15] = 0; + + myMultMatrix(m, m, tm); + } + else + { + fprintf(stderr, "myFrustum() error: left should be different from " + "right. The same is true for top and bottom, far " + "and near.\n"); + } + } + else + { + fprintf(stderr, "myFrustum() error: matrix pointer is null.\n"); + } +} + +/** + * Orthogonal projection transformation + * Input: left, right, bottom, top, near, far parameters similar to glOrtho + * function + * Output: m[16] 4x4 projection matrix + */ +void myOrtho(float m[16], float left, float right, float bottom, float top, + float near, float far) +{ + // temporary 4x4 matrix for intermediate values + float tm[16] = {1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}; + + if (m != NULL) + { + if (right != left && top != bottom && far != near) + { + tm[0] = 2 / (right - left); + tm[5] = 2 / (top - bottom); + tm[10] = 2 / (near - far); + tm[12] = (right + left) / (right - left); + tm[13] = (top + bottom) / (top - bottom); + tm[14] = (far + near) / (far - near); + + myMultMatrix(m, m, tm); + } + else + { + fprintf(stderr,"myOrtho() error: left should be different from " + "right. The same is true for top and bottom, far " + "and near.\n"); + } + } + else + { + fprintf(stderr, "myOrtho() error: matrix pointer is null.\n"); + } +} + +/** + * Calculate the inverse tanspose matrix of a 4x4 matrix, and take the top + * left 3x3 matrix as output matrix. + * Input: src[16] 4x4 matrix + * Output: m[9] 3x3 matrix + */ +void myTransposeInvertMatrix(float m[9], float src[16]) +{ + float m11, m12, m13, m14, m21, m22, m23, m31, m32, m33;//minors of matrix + float determinent; // determinent value of matrix + + if (m != NULL + && src != NULL) + { + // Finding minors of src matrix + m11 = src[5] * (src[10] * src[15] - src[11] * src[14]) + - src[9] * (src[6] * src[15] - src[7] * src[14]) + + src[13] * (src[6] * src[11] - src[7] * src[10]); + m12 = src[1] * (src[10] * src[15] - src[11] * src[14]) + - src[9] * (src[2] * src[15] - src[3] * src[14]) + + src[13] * (src[2] * src[11] - src[3] * src[10]); + m13 = src[1] * (src[6] * src[15] - src[7] * src[14]) + - src[5] * (src[2] * src[15] - src[3] * src[14]) + + src[13] * (src[2] * src[7] - src[3] * src[6]); + m14 = src[1] * (src[6] * src[11] - src[7] * src[10]) + - src[5] * (src[2] * src[11] - src[3] * src[10]) + + src[9] * (src[2] * src[7] - src[3] * src[6]); + m21 = src[4] * (src[10] * src[15] - src[11] * src[14]) + - src[8] * (src[6] * src[15] - src[7] * src[14]) + + src[12] * (src[6] * src[11] - src[7] * src[10]); + m22 = src[0] * (src[10] * src[15] - src[11] * src[14]) + - src[8] * (src[2] * src[15] - src[3] * src[14]) + + src[12] * (src[2] * src[11] - src[3] * src[10]); + m23 = src[0] * (src[6] * src[15] - src[7] * src[14]) + - src[4] * (src[2] * src[15] - src[3] * src[14]) + + src[12] * (src[2] * src[7] - src[3] * src[6]); + m31 = src[4] * (src[9] * src[15] - src[11] * src[13]) + - src[8] * (src[5] * src[15] - src[7] * src[13]) + + src[12] * (src[5] * src[11] - src[7] * src[9]); + m32 = src[0] * (src[9] * src[15] - src[11] * src[13]) + - src[8] * (src[1] * src[15] - src[3] * src[13]) + + src[12] * (src[1] * src[11] - src[3] * src[9]); + m33 = src[0] * (src[5] * src[15] - src[7] * src[13]) + - src[4] * (src[1] * src[15] - src[3] * src[13]) + + src[12] * (src[1] * src[7] - src[3] * src[5]); + + // calculate the determinent + determinent = src[0] * m11 - src[4] * m12 + src[8] * m13 - src[12] * m14; + if (determinent != 0) + { + m[0] = m11 / determinent; + m[1] = -m21 / determinent; + m[2] = m31 / determinent; + m[3] = -m12 / determinent; + m[4] = m22 / determinent; + m[5] = -m32 / determinent; + m[6] = m13 / determinent; + m[7] = -m23 / determinent; + m[8] = m33 / determinent; + } + else + { + fprintf(stderr,"myTransposeInvertMatrix() error: no inverse matrix" + " exists.\n"); + } + } + else + { + fprintf(stderr, "myTransposeInvertMatrix() error: matrix pointers are " + "null.\n"); + } +} + +/** + * Calculate the inverse matrix of a 4x4 matrix + * Input: src[16] 4x4 matrix + * Output: m[16] 4x4 matrix + */ +void myInverseMatrix(float m[16], float src[16]) +{ + + float m11, m12, m13, m14, m21, m22, m23, m24; // minors of src matrix + float m31, m32, m33, m34, m41, m42, m43, m44; // minors of src matrix + float determinent; + + if (m != NULL + && src != NULL) + { + // Finding minors of src matrix + m11 = src[5] * (src[10] * src[15] - src[11] * src[14]) + - src[9] * (src[6] * src[15] - src[7] * src[14]) + + src[13] * (src[6] * src[11] - src[7] * src[10]); + m12 = src[1] * (src[10] * src[15] - src[11] * src[14]) + - src[9] * (src[2] * src[15] - src[3] * src[14]) + + src[13] * (src[2] * src[11] - src[3] * src[10]); + m13 = src[1] * (src[6] * src[15] - src[7] * src[14]) + - src[5] * (src[2] * src[15] - src[3] * src[14]) + + src[13] * (src[2] * src[7] - src[3] * src[6]); + m14 = src[1] * (src[6] * src[11] - src[7] * src[10]) + - src[5] * (src[2] * src[11] - src[3] * src[10]) + + src[9] * (src[2] * src[7] - src[3] * src[6]); + m21 = src[4] * (src[10] * src[15] - src[11] * src[14]) + - src[8] * (src[6] * src[15] - src[7] * src[14]) + + src[12] * (src[6] * src[11] - src[7] * src[10]); + m22 = src[0] * (src[10] * src[15] - src[11] * src[14]) + - src[8] * (src[2] * src[15] - src[3] * src[14]) + + src[12] * (src[2] * src[11] - src[3] * src[10]); + m23 = src[0] * (src[6] * src[15] - src[7] * src[14]) + - src[4] * (src[2] * src[15] - src[3] * src[14]) + + src[12] * (src[2] * src[7] - src[3] * src[6]); + m24 = src[0] * (src[6] * src[11] - src[7] * src[10]) + - src[4] * (src[2] * src[11] - src[3] * src[10]) + + src[8] * (src[2] * src[7] - src[3] * src[6]); + m31 = src[4] * (src[9] * src[15] - src[11] * src[13]) + - src[8] * (src[5] * src[15] - src[7] * src[13]) + + src[12] * (src[5] * src[11] - src[7] * src[9]); + m32 = src[0] * (src[9] * src[15] - src[11] * src[13]) + - src[8] * (src[1] * src[15] - src[3] * src[13]) + + src[12] * (src[1] * src[11] - src[3] * src[9]); + m33 = src[0] * (src[5] * src[15] - src[7] * src[13]) + - src[4] * (src[1] * src[15] - src[3] * src[13]) + + src[12] * (src[1] * src[7] - src[3] * src[5]); + m34 = src[0] * (src[5] * src[11] - src[7] * src[9]) + - src[4] * (src[1] * src[11] - src[3] * src[9]) + + src[8] * (src[1] * src[7] - src[3] * src[5]); + m41 = src[4] * (src[9] * src[14] - src[10] * src[13]) + - src[8] * (src[5] * src[14] - src[6] * src[13]) + + src[12] * (src[5] * src[10] - src[6] * src[9]); + m42 = src[0] * (src[9] * src[14] - src[10] * src[13]) + - src[8] * (src[1] * src[14] - src[2] * src[13]) + + src[12] * (src[1] * src[10] - src[2] * src[9]); + m43 = src[0] * (src[5] * src[14] - src[6] * src[13]) + - src[4] * (src[1] * src[14] - src[2] * src[13]) + + src[12] * (src[1] * src[6] - src[2] * src[5]); + m44 = src[0] * (src[5] * src[10] - src[6] * src[9]) + - src[4] * (src[1] * src[10] - src[2] * src[9]) + + src[8] * (src[1] * src[6] - src[2] * src[5]); + + // calculate the determinent + determinent = src[0] * m11 - src[4] * m12 + src[8] * m13 - src[12] * m14; + if (determinent != 0) + { + m[0] = m11 / determinent; + m[1] = -m12 / determinent; + m[2] = m13 / determinent; + m[3] = -m14 / determinent; + m[4] = -m21 / determinent; + m[5] = m22 / determinent; + m[6] = -m23 / determinent; + m[7] = m24 / determinent; + m[8] = m31 / determinent; + m[9] = -m32 / determinent; + m[10] = m33 / determinent; + m[11] = -m34 / determinent; + m[12] = -m41 / determinent; + m[13] = m42 / determinent; + m[14] = -m43 / determinent; + m[15] = m44 / determinent; + } + else + { + fprintf(stderr, "myInverseMatrix() error: no inverse matrix " + "exists.\n"); + } + } + else + { + fprintf(stderr,"myInverseMatrix() error: matrix pointer is null.\n"); + } +} + +/** + * Calculate the cross product of two input vectors + * Input: src1[3], src2[3] --- two input vectors + * Output: fout[3] --- output vector + */ +void crossProduct(float fout[3], float src1[3], float src2[3]) +{ + float tmp[3]; + if (fout != NULL + && src1 != NULL + && src2 != NULL) + { + tmp[0] = src1[1] * src2[2] - src1[2] * src2[1]; + tmp[1] = src1[2] * src2[0] - src1[0] * src2[2]; + tmp[2] = src1[0] * src2[1] - src1[1] * src2[0]; + + normalize(fout, tmp[0], tmp[1], tmp[2]); + } + else + { + fprintf(stderr, "crossProduct() error: null input pointers.\n"); + + } +} + +/** + * Calculate the dot product of two vectors + * Input: src1[3], src2[3] --- two input vectors + * return value: dot product of two input vectors + */ +float dotProduct( float src1[3], float src2[3]) +{ + float len = 0.0f; + if (src1 != NULL + && src2 != NULL) + { + len = src1[0] * src2[0] + src1[1] * src2[1] + src1[2] * src2[2]; + } + else + { + fprintf(stderr,"dotProduct() error: null input pointers.\n"); + } + return len; +} + +/** + * Similar to the gluLookAt function. + * Input: eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ + * Output: view matrix -- m[16] + */ +void myLookAt(float m[16], float eyeX, float eyeY, float eyeZ, float centerX, + float centerY, float centerZ, float upX, float upY, float upZ) +{ + float u[3], v[3], n[3]; // unit vectors for camera view coordinate system + float n1[3]; // unnormalized forward vector for camera view + float up[3]; // up vector + float rotation[16], translate[16]; // rotation matrix and tranlation matrix + + if (m != NULL) + { + // calculate the n vector -- forward vector + n1[0] = eyeX - centerX; + n1[1] = eyeY - centerY; + n1[2] = eyeZ - centerZ; + + normalize(n, n1[0], n1[1], n1[2]); + up[0] = upX; + up[1] = upY; + up[2] = upZ; + crossProduct(u, up, n); // calculate the u vector + crossProduct(v, n, u); // calculate the v vector + + myIdentity(translate); + myTranslate(translate, -eyeX, -eyeY, -eyeZ); + rotation[0] = u[0]; + rotation[1] = v[0]; + rotation[2] = n[0]; + rotation[3] = 0; + rotation[4] = u[1]; + rotation[5] = v[1]; + rotation[6] = n[1]; + rotation[7] = 0; + rotation[8] = u[2]; + rotation[9] = v[2]; + rotation[10] = n[2]; + rotation[11] = 0; + rotation[12] = 0; + rotation[13] = 0; + rotation[14] = 0; + rotation[15] = 1; + + myMultMatrix(m, rotation, translate); + } + else + { + fprintf(stderr, "myLookAt() error: matrix pointer is null.\n"); + } +} + diff --git a/canmore/boxee_cube/matrix.h b/canmore/boxee_cube/matrix.h new file mode 100644 index 00000000..fab1792d --- /dev/null +++ b/canmore/boxee_cube/matrix.h @@ -0,0 +1,107 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2008 Intel Corporation +// +// DISTRIBUTABLE AS SAMPLE SOURCE SOFTWARE +// +// This Distributable As Sample Source Software is subject to the terms and +// conditions of the Intel Software License Agreement provided with the Intel(R) +// Media Processor Software Development Kit. +//------------------------------------------------------------------------------ +/*----------------------------------------------------------------------------- +* matrix.c calculates all kinds of transformation matrices for OpenGL ES 2.0. +* For most functions, the first parameter m[16] is a column major output +* matrix. The formulas used to calculate the transformation matrices and +* projection matrices are based on the OpenGL ES specifications. +------------------------------------------------------------------------------*/ +#ifndef MATRIX_H +#define MATRIX_H + +/** + * Normalize the vector to become a unit vector + * Input: x, y, z --- input vector's x, y and z value + * Output: fout[3] --- output vector + */ +float normalize(float fout[3], float x, float y, float z); + +/** + * Calculate the cross product of two input vectors + * Input: src1[3], src2[3] --- two input vectors + * Output: fout[3] --- output vector + */ +void crossProduct(float fout[3], float src1[3], float src2[3]); + +/** + * Set the 4x4 matrix m[16] to the identity matrix + */ +void myIdentity(float m[16]); + +/** + * Multiply two 4x4 matrices + * Input: src1[16], src2[16] --- two source matrices + * Output: m[16] --- result matrix + */ +void myMultMatrix(float m[16], float src1[16], float src2[16]); + +/** + * Translate the 3D object in the scene + * Input: tx , ty, tz --- the offset for translation in X, Y, and Z dirctions + * Output: m[16] --- the matrix after the translate + */ +void myTranslate(float m[16], float tx, float ty, float tz); + +/** + * Scale operation for the object in the scene + * Input: sx, sy, sz --- scaling factors for X, Y and Z directions + * Output: m[16] --- the matrix after the scaling + */ +void myScale(float m[16], float sx, float sy, float sz); + +/** + * Rotation operation + * Input: angle, x, y, z (rotating angle and rotating axis) + * Output: m[16] --- the matrix after the rotation + */ +void myRotate(float m[16], float angle, float x, float y, float z); + +/** + * Perspective projection transformation + * Input: left, right, bottom, top, near, far parameters similar to glFrustum + * function + * Output: m[16] --- perspective projection matrix + */ +void myFrustum(float m[16], float left, float right, float bottom, float top, + float near, float far); + +/** + * Orthogonal projection transformation + * Input: left, right, bottom, top, near, far parameters similar to glOrtho + * function + * Output: m[16] 4x4 projection matrix + */ +void myOrtho(float m[16], float left, float right, float bottom, float top, + float near, float far); + +/** + * Calculate the inverse tanspose matrix of a 4x4 matrix, and take the top + * left 3x3 matrix as output matrix. + * Input: src[16] 4x4 matrix + * Output: m[9] 3x3 matrix + */ +void myTransposeInvertMatrix(float m[16], float src[16]); + +/** + * Calculate the inverse matrix of a 4x4 matrix + * Input: src[16] 4x4 matrix + * Output: m[16] 4x4 matrix + */ +void myInverseMatrix(float m[16], float src[16]); + +/** + * Similar to the gluLookAt function. + * Input: eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ + * Output: view matrix -- m[16] + */ +void myLookAt(float m[16], float eyeX, float eyeY, float eyeZ, float centerX, + float centerY, float centerZ, float upX, float upY, float upZ); + +#endif diff --git a/canmore/boxee_cube/play_mp3.cpp b/canmore/boxee_cube/play_mp3.cpp new file mode 100644 index 00000000..3d32babb --- /dev/null +++ b/canmore/boxee_cube/play_mp3.cpp @@ -0,0 +1,223 @@ +#include "osal.h" +#include "ismd_core.h" +#include "ismd_global_defs.h" +#include "ismd_audio_defs.h" +#include "ismd_audio.h" + + +#define AUDIO_SADIV_SPDIF_48KHZ 6 +#define AUDIO_SADIV_I2S 1 +#define READ_SIZE 8*1024 +#define NOT_TIMED 0 + + +static ismd_dev_t audio_dev_handle; +static ismd_audio_processor_t audio_processor; +static ismd_audio_output_t audio_output_handle; +static ismd_port_handle_t audio_input_port_handle; +static ismd_port_handle_t audio_output_port_handle; +static os_thread_t input_thread; +static int read_complete = 0; +FILE *fp; + + +ismd_result_t init_audio_driver(void); +ismd_result_t free_audio_resources(void); +void *input_feeder(void *arg); + +int main (void) { + + ismd_result_t ismd_ret; + + fp = fopen("/input.mp3", "rb"); + if (fp == 0) { + OS_INFO("could not open input"); + OS_ASSERT(0); + } + + ismd_ret = init_audio_driver(); + if (ismd_ret != ISMD_SUCCESS) { + printf("init_audio_driver failed \n"); + assert(0); + } + + os_thread_create(&input_thread, input_feeder, NULL, 0, 0, "input thread"); + + while (!read_complete) { + os_sleep(20); + } + + ismd_ret = free_audio_resources(); + if (ismd_ret != ISMD_SUCCESS) { + printf("free_audio_resources failed \n"); + assert(0); + } + + os_thread_destroy(&input_thread); + + fclose(fp); + + return 0; +} + +ismd_result_t +init_audio_driver(void) { + ismd_result_t ismd_ret; + ismd_audio_output_config_t output_config; + + ismd_ret = ismd_audio_open_processor(&audio_processor); + if (ismd_ret) { + printf("ismd_audio_open_processor failed\n"); + assert(0); + } + ismd_ret = ismd_audio_add_input_port(audio_processor, NOT_TIMED, &audio_dev_handle, +&audio_input_port_handle); + if (ismd_ret) { + printf("ismd_audio_add_input_port failed\n"); + assert(0); + } + //Example hard coded for MPEG now, example extends for other algorithms + ismd_ret = ismd_audio_input_set_data_format(audio_processor, audio_dev_handle, +ISMD_AUDIO_MEDIA_FMT_MPEG); + if (ismd_ret) { + printf("ismd_audio_input_set_data_format failed\n"); + assert(0); + } + + //if decoder specific parameters are needed, this would be a good spot for that + + ismd_ret = ismd_audio_input_enable(audio_processor, audio_dev_handle); + if (ismd_ret) { + printf("ismd_audio_input_enable failed\n"); + assert(0); + } + + output_config.ch_config = ISMD_AUDIO_STEREO; + output_config.out_mode = ISMD_AUDIO_OUTPUT_PCM; + output_config.sample_rate = 48000; + output_config.sample_size = 16; + output_config.stream_delay = 0; + + ismd_ret = ismd_audio_add_phys_output(audio_processor, GEN3_HW_OUTPUT_SPDIF, +output_config, &audio_output_port_handle); + if (ismd_ret) { + printf("ismd_audio_add_phys_output failed\n"); + assert(0); + } + +/* + ismd_ret = ismd_audio_output_set_external_bit_clock_div(audio_processor, +audio_output_port_handle, AUDIO_SADIV_I2S); +*/ + + ismd_ret = ismd_audio_configure_master_clock(audio_processor, 36864000, ISMD_AUDIO_CLK_SRC_EXTERNAL); + if (ismd_ret) { + printf("ismd_audio_add_phys_output failed\n"); + assert(0); + } + + ismd_ret = ismd_audio_output_enable(audio_processor, audio_output_handle); + if (ismd_ret) { + printf("ismd_audio_output_enable failed\n"); + assert(0); + } + + ismd_ret = ismd_dev_set_state(audio_dev_handle, ISMD_DEV_STATE_PLAY); + if (ismd_ret) { + printf("ismd_dev_set_state failed\n"); + assert(0); + } + + return ISMD_SUCCESS; +} + +ismd_result_t free_audio_resources(void) +{ + ismd_result_t ismd_ret; + + ismd_ret = ismd_dev_set_state(audio_dev_handle, ISMD_DEV_STATE_STOP); + if (ismd_ret) { + printf("ismd_dev_set_state failed\n"); + assert(0); + } + + ismd_ret = ismd_dev_flush(audio_dev_handle); + if (ismd_ret) { + printf("ismd_dev_flush failed\n"); + assert(0); + } + + ismd_ret = ismd_audio_output_disable(audio_processor, audio_output_handle); + if (ismd_ret) { + printf("ismd_audio_output_disable failed\n"); + assert(0); + } + + ismd_ret = ismd_audio_remove_output(audio_processor, audio_output_handle); + if (ismd_ret) { + printf("ismd_audio_remove_input failed\n"); + assert(0); + } + + ismd_ret = ismd_dev_close(audio_dev_handle); + if (ismd_ret) { + printf("ismd_dev_close failed\n"); + assert(0); + } + + return ISMD_SUCCESS; +} + + + +void * +input_feeder(void *arg) +{ +char buf[READ_SIZE]; + ismd_buffer_handle_t ismd_buffer_handle; + ismd_result_t smd_ret; + ismd_buffer_descriptor_t ismd_buf_desc; + uint8_t *buf_ptr; + + buf_ptr = (uint8_t*) arg; //only for compile reasons + + /* More elegant reading and writing mechanisms available, just made simple as this +is not target of this example*/ + while (fread(buf, 1, READ_SIZE, fp) == READ_SIZE) { + while (ismd_buffer_alloc(READ_SIZE, &ismd_buffer_handle) != ISMD_SUCCESS) { + OS_INFO("trying to get buffer\n"); + os_sleep(20); + } + + smd_ret = ismd_buffer_read_desc(ismd_buffer_handle, &ismd_buf_desc); + if (smd_ret != ISMD_SUCCESS) { + OS_ASSERT(0); + } + + buf_ptr = (uint8_t +*)OS_MAP_IO_TO_MEM_NOCACHE(ismd_buf_desc.phys.base,ismd_buf_desc.phys.size); + + memcpy(buf_ptr, buf, READ_SIZE); + + ismd_buf_desc.phys.level = READ_SIZE; + + smd_ret = ismd_buffer_update_desc(ismd_buffer_handle, &ismd_buf_desc); + if (smd_ret != ISMD_SUCCESS) { + OS_ASSERT(0); + } + + OS_UNMAP_IO_FROM_MEM(buf_ptr,READ_SIZE); + + while (ismd_port_write(audio_input_port_handle, ismd_buffer_handle) != +ISMD_SUCCESS) { + os_sleep(20); + } + + } + + read_complete = 1; + OS_INFO("Done writing file in\n"); + + return NULL; + +} diff --git a/canmore/boxee_cube/readjpeg.c b/canmore/boxee_cube/readjpeg.c new file mode 100644 index 00000000..390ea101 --- /dev/null +++ b/canmore/boxee_cube/readjpeg.c @@ -0,0 +1,211 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2008 Intel Corporation +// +// DISTRIBUTABLE AS SAMPLE SOURCE SOFTWARE +// +// This Distributable As Sample Source Software is subject to the terms and +// conditions of the Intel Software License Agreement provided with the Intel(R) +// Media Processor Software Development Kit. +//------------------------------------------------------------------------------ + +#include +#include +#include +#include + +#include "jpeglib.h" + +#include +#include "image.h" + +// flip image upside down after we read it +// Open GL draws from bottom to top +#define UPSIDE_DOWN + + +// extent jpeg_error_mgr structure to include setjmp info +typedef struct jpeg_error_mgr_jmp_s { + struct jpeg_error_mgr pub; /* "public" fields */ + jmp_buf setjmp_buffer; /* for return to caller */ +} jpeg_error_mgr_jmp_st; + + +/** + * jpeglib calls error_exit() on error + * override with readjpeg_error_exit() so we can recover gracefully + * this function just catches the error, prints an error message, + * and returns control to the setjmp location + * the argument to the function is actually a jpeg_error_mgr_jmp_st * + */ +void readjpeg_error_exit (j_common_ptr dinfo) +{ + jpeg_error_mgr_jmp_st * err = (jpeg_error_mgr_jmp_st *) dinfo->err; + + /* display error message */ + (*dinfo->err->output_message) (dinfo); + + /* return to setjmp */ + longjmp(err->setjmp_buffer, 1); +} + +/** + * Read the JPEG image file + */ +int read_JPEG_file (imagebuffer_st * image, char *filename, uint8_t alpha_value) +{ + struct jpeg_decompress_struct dinfo; + jpeg_error_mgr_jmp_st read_jpeg_err; + FILE * infile; + JSAMPARRAY buffer; + int row_stride; + int color_depth; + int bytes, rowbytes; + + switch (image->color_format) { + case IMAGE_RGB: color_depth = 3; break; + case IMAGE_BGR: color_depth = 3; break; + case IMAGE_RGBA: color_depth = 4; break; + case IMAGE_BGRA: color_depth = 4; break; + case IMAGE_ARGB: color_depth = 4; break; + case IMAGE_ABGR: color_depth = 4; break; + default: return 0; /* unknown color format */ + } + + /* open input file */ + if ((infile = fopen(filename, "rb")) == NULL) { + fprintf(stderr, "can't open %s\n", filename); + return 0; + } + + /* setup normal JPEG error handling */ + dinfo.err = jpeg_std_error(&read_jpeg_err.pub); + /* call readpeg_error_exit() instead of default error_exit */ + read_jpeg_err.pub.error_exit = readjpeg_error_exit; + if (setjmp(read_jpeg_err.setjmp_buffer)) { + /* readjpeg_error_exit() will jump to this point */ + /* cleanup and return failure */ + jpeg_destroy_decompress(&dinfo); + fclose(infile); + return 0; + } + + /* initialize jpeg decompression object */ + jpeg_create_decompress(&dinfo); + jpeg_stdio_src(&dinfo, infile); + + /* get image info */ + jpeg_read_header(&dinfo, TRUE); + + /* determine output height/width of jpeg file */ + jpeg_calc_output_dimensions(&dinfo); + //if (flag.verbosity>1) print_jpeg_info(resource, &dinfo); + + /* fill in resource struct and allocate buffer space */ + image->width = dinfo.output_width; + image->height = dinfo.output_height; + rowbytes = image->width * color_depth; + bytes = image->width * image->height * color_depth; + if ((image->buffer = (uint8_t *) malloc(bytes)) == NULL) + { + fprintf(stderr, "Memory allocation failed\n"); + jpeg_destroy_decompress(&dinfo); + fclose(infile); + return 0; + } + + /* we want RGB output */ + dinfo.out_color_space = JCS_RGB; + + /* prepare to read one row at a time */ + row_stride = dinfo.output_width * dinfo.output_components; + /* jpeglib will automatically deallocate buffer */ + buffer = (*dinfo.mem->alloc_sarray) + ((j_common_ptr) &dinfo, JPOOL_IMAGE, row_stride, 1); + + /* decompress jpeg data from file */ + jpeg_start_decompress(&dinfo); + while (dinfo.output_scanline < dinfo.output_height) { + int i; + uint8_t *p = NULL; /* ptr to start of line in buffer */ + + if (image->lines_format == IMAGE_REVERSE) { + /* store image lines bottom-to-top */ + int rownum = dinfo.output_scanline + 1; + int offset = bytes - rowbytes * rownum; + p = image->buffer + offset; + } + if (image->lines_format == IMAGE_NORMAL) { + /* store image lines top-to-bottom */ + int offset = rowbytes * dinfo.output_scanline; + p = image->buffer + offset; + } + + jpeg_read_scanlines(&dinfo, buffer, 1); + + if (p != NULL) + { + if (image->color_format == IMAGE_RGB) + { + memcpy(p, buffer[0], row_stride); + } + else if (image->color_format == IMAGE_RGBA) + { + for (i = 0; i < row_stride; i += 3) { + *p++ = buffer[0][i+0]; // RED + *p++ = buffer[0][i+1]; // GREEN + *p++ = buffer[0][i+2]; // BLUE + *p++ = alpha_value; // ALPHA + } + } + else if (image->color_format == IMAGE_ARGB) + { + for (i = 0; i < row_stride; i += 3) { + *p++ = alpha_value; // ALPHA + *p++ = buffer[0][i+0]; // RED + *p++ = buffer[0][i+1]; // GREEN + *p++ = buffer[0][i+2]; // BLUE + } + } + else if (image->color_format == IMAGE_BGR) + { + for (i = 0; i < row_stride; i += 3) { + *p++ = buffer[0][i+2]; // BLUE + *p++ = buffer[0][i+1]; // GREEN + *p++ = buffer[0][i+0]; // RED + } + } + else if (image->color_format == IMAGE_BGRA) + { + for (i = 0; i < row_stride; i += 3) { + *p++ = buffer[0][i+2]; // BLUE + *p++ = buffer[0][i+1]; // GREEN + *p++ = buffer[0][i+0]; // RED + *p++ = alpha_value; // ALPHA + } + } + else if (image->color_format == IMAGE_ABGR) + { + for (i = 0; i < row_stride; i += 3) { + *p++ = alpha_value; // ALPHA + *p++ = buffer[0][i+2]; // BLUE + *p++ = buffer[0][i+1]; // GREEN + *p++ = buffer[0][i+0]; // RED + } + } + else + { + fprintf(stderr,"readjpeg: unknown lines_format: %d\n", + image->lines_format); + break; /* cleanup and quit */ + } + } + } + + jpeg_finish_decompress(&dinfo); + jpeg_destroy_decompress(&dinfo); + fclose(infile); + + return 1; +} + + diff --git a/canmore/boxee_cube/sky.jpg b/canmore/boxee_cube/sky.jpg new file mode 100644 index 00000000..608c08de Binary files /dev/null and b/canmore/boxee_cube/sky.jpg differ diff --git a/canmore/canmore.config b/canmore/canmore.config new file mode 100644 index 00000000..6c1eda94 --- /dev/null +++ b/canmore/canmore.config @@ -0,0 +1,46 @@ +host_alias=i686-cm-linux +target_platform=i686-cm +INCLUDES="$INCLUDES \ + -I$CANMORE_HOME/local/include \ + -I$CANMORE_HOME/local/include/boost \ + -I$CANMORE_HOME/IntelCE/include \ + -I$CANMORE_HOME/IntelCE/idts_common \ + -I$CANMORE_HOME/IntelCE/usr/include \ + -I$CANMORE_HOME/IntelCE/include/linux_user \ + -I$CANMORE_HOME/IntelCE/usr/local/include \ + -I$CANMORE_HOME/local/include/freetype2 \ + -I$CANMORE_HOME/IntelCE/local/include/lzo" + +CFLAGS="$CFLAGS $INCLUDES" + +CXXFLAGS="$CXXFLAGS $INCLUDES" + +CPPFLAGS="$CPPFLAGS $INCLUDES" + + +LDFLAGS="$LDFLAGS \ + -L$CANMORE_HOME/local/lib \ + -L$CANMORE_HOME/IntelCE/lib \ + -L$CANMORE_HOME/IntelCE/usr/lib \ + -L$CANMORE_HOME/IntelCE/usr/local/lib" + +CROSSBIN=$CANMORE_HOME/toolchains/i686-cm-linux- + +CC=${CROSSBIN}gcc + +CXX=${CROSSBIN}g++ + +LD=${CROSSBIN}ld + +AR=${CROSSBIN}ar + +RANLIB=${CROSSBIN}ranlib + +STRIP=${CROSSBIN}strip + +OBJDUMP=${CROSSBIN}objdump + +CXXCPP="$CXX -E" + +export PKG_CONFIG_LIBDIR=$CANMORE_HOME/local/lib/pkgconfig/ + diff --git a/canmore/configure.sh b/canmore/configure.sh new file mode 100755 index 00000000..85407630 --- /dev/null +++ b/canmore/configure.sh @@ -0,0 +1,23 @@ +#!/bin/bash +DEBUG_OPTIONS="--enable-optimizations --disable-debug" +export CANMORE_HOME=/opt/canmore + +while [ "$1" ] +do + case "$1" in + -d) DEBUG_OPTIONS="--disable-optimizations" + ;; + -c) export CANMORE_HOME="$2" + shift + ;; + esac + shift +done + +export CONFIG_SITE=./canmore/canmore.config +export PKG_CONFIG_PATH=$CANMORE_HOME/local/lib/pkgconfig + +echo "export CANMORE_HOME=$CANMORE_HOME" > cross_env +chmod 755 cross_env + +./configure $DEBUG_OPTIONS --host=i686-cm-linux --disable-dvd-drive --disable-mysqlclient --disable-vdpau --disable-ss-rsxs --enable-external-python --enable-boxee-hal diff --git a/canmore/docs/Boxee_CE4100_Installation_Guide.odt b/canmore/docs/Boxee_CE4100_Installation_Guide.odt new file mode 100644 index 00000000..5c89047e Binary files /dev/null and b/canmore/docs/Boxee_CE4100_Installation_Guide.odt differ diff --git a/canmore/docs/Boxee_CE4100_Installation_Guide.pdf b/canmore/docs/Boxee_CE4100_Installation_Guide.pdf new file mode 100644 index 00000000..fcaf75bd Binary files /dev/null and b/canmore/docs/Boxee_CE4100_Installation_Guide.pdf differ diff --git a/canmore/docs/Boxee_CE4100_Plumbing.odt b/canmore/docs/Boxee_CE4100_Plumbing.odt new file mode 100644 index 00000000..ecdee0c9 Binary files /dev/null and b/canmore/docs/Boxee_CE4100_Plumbing.odt differ diff --git a/canmore/docs/Boxee_CE4100_Plumbing.pdf b/canmore/docs/Boxee_CE4100_Plumbing.pdf new file mode 100644 index 00000000..e4472705 Binary files /dev/null and b/canmore/docs/Boxee_CE4100_Plumbing.pdf differ diff --git a/canmore/docs/Boxee_CE4100_Release_Notes.odt b/canmore/docs/Boxee_CE4100_Release_Notes.odt new file mode 100644 index 00000000..2d1fab91 Binary files /dev/null and b/canmore/docs/Boxee_CE4100_Release_Notes.odt differ diff --git a/canmore/docs/Boxee_CE4100_Release_Notes.pdf b/canmore/docs/Boxee_CE4100_Release_Notes.pdf new file mode 100644 index 00000000..1826955b Binary files /dev/null and b/canmore/docs/Boxee_CE4100_Release_Notes.pdf differ diff --git a/canmore/get_boxee_resolution.sh b/canmore/get_boxee_resolution.sh new file mode 100755 index 00000000..91c69178 --- /dev/null +++ b/canmore/get_boxee_resolution.sh @@ -0,0 +1,52 @@ +#!/bin/sh +export LD_LIBRARY_PATH=/opt/local/lib + +# make sure that guisettings.xml exists +if [ ! -f /data/.boxee/UserData/guisettings.xml ]; then + exit 1 +fi + +RES=`/opt/local/bin/xmlstarlet sel -t -v //settings/videoscreen/resolution /data/.boxee/UserData/guisettings.xml` +if [ ! "$?" == "0" ]; then + exit 1 +fi + +if [ "$RES" == "" ]; then + exit 1 +fi + +RES=`expr $RES - 10` +RES=`/opt/local/bin/xmlstarlet sel -t -v "//settings/resolutions/resolution[$RES]/description" /data/.boxee/UserData/guisettings.xml` + +case $RES in + PAL) + echo 720x576i50; exit 0 + ;; + 576p) + echo 720x576p50; exit 0 + ;; + NTSC) + echo 720x480i59.94; exit 0 + ;; + 480p) + echo 720x480p59.94; exit 0 + ;; + 720p) + echo 1280x720p59.94; exit 0 + ;; + "720p 50Hz") + echo 1280x720p50; exit 0 + ;; + 1080p) + echo 1920x1080p59.94; exit 0 + ;; + "1080p 50Hz") + echo 1920x1080p50; exit 0 + ;; + 1080i) + echo 1920x1080i59.94; exit 0 + ;; + "1080i 50Hz") + echo 1920x1080i50; exit 0 + ;; +esac diff --git a/canmore/get_hdmi_native/Makefile b/canmore/get_hdmi_native/Makefile new file mode 100644 index 00000000..87b32cec --- /dev/null +++ b/canmore/get_hdmi_native/Makefile @@ -0,0 +1,2 @@ +get_hdmi_native : hdmi_edid_dump.c parse-edid.c + i686-cm-linux-g++ -o get_hdmi_native hdmi_edid_dump.c parse-edid.c -I/opt/canmore/IntelCE/include -lgdl diff --git a/canmore/get_hdmi_native/get_hdmi_native b/canmore/get_hdmi_native/get_hdmi_native new file mode 100755 index 00000000..f7812b6f Binary files /dev/null and b/canmore/get_hdmi_native/get_hdmi_native differ diff --git a/canmore/get_hdmi_native/hdmi_edid_dump.c b/canmore/get_hdmi_native/hdmi_edid_dump.c new file mode 100644 index 00000000..3f514d6b --- /dev/null +++ b/canmore/get_hdmi_native/hdmi_edid_dump.c @@ -0,0 +1,113 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2006-2010 Intel Corporation +// +// DISTRIBUTABLE AS SAMPLE SOURCE SOFTWARE +// +// This Distributable As Sample Source Software is subject to the terms and +// conditions of the Intel Software License Agreement provided with the Intel(R) +// Media Processor Software Development Kit. +// +// Decription: +// This sample demonstrates use of GDL_PD_RECV_HDMI_EDID_BLOCK command +// availalbe via gdl_port_recv interface. +//----------------------------------------------------------------------------- + +#include "libgdl.h" +#include +#include +#include + +#define TRY(rc, label, foo, args) \ + if ( (rc = foo args) != GDL_SUCCESS ) \ + { \ + printf("Failed in %s: %s\n", #foo, gdl_get_error_string(rc)); \ + goto label; \ + } + + +int parse_edid( unsigned char* edid ); + +bool read_edid(unsigned char** edid_data, int* len) +{ + gdl_ret_t rc = GDL_SUCCESS; + unsigned int n; + gdl_hdmi_edid_block_t eb; + eb.index = 0; + + *edid_data = NULL; + *len = 0; + + // Read first block + if (gdl_port_recv(GDL_PD_ID_HDMI, GDL_PD_RECV_HDMI_EDID_BLOCK, (void *) &eb, + sizeof(gdl_hdmi_edid_block_t)) != GDL_SUCCESS) + { + printf("EDID can not be read\n"); + return false; + } + + // Determine total number of blocks + n = eb.data[126] + 1; + + *edid_data = (unsigned char*) malloc(n * 128); + + // Read and print all EDID blocks + for (eb.index = 0; eb.index < n; eb.index++) + { + rc = gdl_port_recv(GDL_PD_ID_HDMI, GDL_PD_RECV_HDMI_EDID_BLOCK, + (void *) &eb, sizeof(gdl_hdmi_edid_block_t)); + + if (rc == GDL_SUCCESS) + { + memcpy(*edid_data + *len, eb.data, 128); + *len += 128; + } + + if (rc != GDL_SUCCESS) + break; + } + +// printf("\nTotal of %d EDID blocks were read successfully\n", eb.index); + + return true; +} + +//------------------------------------------------------------------------------ +// main() +//------------------------------------------------------------------------------ +int main(int argc, char** argv) +{ + gdl_ret_t rc = GDL_SUCCESS; + unsigned int j, n; + + // Validation successful, time to init GDL + TRY(rc, exit, gdl_init, (0)); + + unsigned char* edid_buffer; + int edid_len; + + if (read_edid(&edid_buffer, &edid_len)) + { +#if 0 + for (j = 0; j < edid_len; j++) + { + printf("%s", (j % 0x10) ? "" : "\n"); + printf("%02X ", edid_buffer[j]); + } + printf("\n"); +#endif + + if (parse_edid(edid_buffer) != 0) + { + TRY(rc, exit, gdl_close, ()); + exit(1); + } + } + else + { + TRY(rc, exit, gdl_close, ()); + exit(1); + } + +exit: + TRY(rc, exit, gdl_close, ()); +} diff --git a/canmore/get_hdmi_native/parse-edid.c b/canmore/get_hdmi_native/parse-edid.c new file mode 100644 index 00000000..209666e1 --- /dev/null +++ b/canmore/get_hdmi_native/parse-edid.c @@ -0,0 +1,375 @@ +#include +#include +#include + +// TODO: rewrite +// FIXME: cleanup 'static' variables + +typedef unsigned char byte; +/* byte must be 8 bits */ + +/* int must be at least 16 bits */ + +/* long must be at least 32 bits */ + + + +#define DIE_MSG( x ) \ + { MSG( x ); exit( 1 ); } + + +#define UPPER_NIBBLE( x ) \ + (((128|64|32|16) & (x)) >> 4) + +#define LOWER_NIBBLE( x ) \ + ((1|2|4|8) & (x)) + +#define COMBINE_HI_8LO( hi, lo ) \ + ( (((unsigned)hi) << 8) | (unsigned)lo ) + +#define COMBINE_HI_4LO( hi, lo ) \ + ( (((unsigned)hi) << 4) | (unsigned)lo ) + +const byte edid_v1_header[] = { 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00 }; + +const byte edid_v1_descriptor_flag[] = { 0x00, 0x00 }; + + +#define EDID_LENGTH 0x80 + +#define EDID_HEADER 0x00 +#define EDID_HEADER_END 0x07 + +#define ID_MANUFACTURER_NAME 0x08 +#define ID_MANUFACTURER_NAME_END 0x09 +#define ID_MODEL 0x0a + +#define ID_SERIAL_NUMBER 0x0c + +#define MANUFACTURE_WEEK 0x10 +#define MANUFACTURE_YEAR 0x11 + +#define EDID_STRUCT_VERSION 0x12 +#define EDID_STRUCT_REVISION 0x13 + +#define DPMS_FLAGS 0x18 +#define ESTABLISHED_TIMING_1 0x23 +#define ESTABLISHED_TIMING_2 0x24 +#define MANUFACTURERS_TIMINGS 0x25 + +#define DETAILED_TIMING_DESCRIPTIONS_START 0x36 +#define DETAILED_TIMING_DESCRIPTION_SIZE 18 +#define NO_DETAILED_TIMING_DESCRIPTIONS 4 + + + +#define DETAILED_TIMING_DESCRIPTION_1 0x36 +#define DETAILED_TIMING_DESCRIPTION_2 0x48 +#define DETAILED_TIMING_DESCRIPTION_3 0x5a +#define DETAILED_TIMING_DESCRIPTION_4 0x6c + + + +#define PIXEL_CLOCK_LO (unsigned)dtd[ 0 ] +#define PIXEL_CLOCK_HI (unsigned)dtd[ 1 ] +#define PIXEL_CLOCK (COMBINE_HI_8LO( PIXEL_CLOCK_HI,PIXEL_CLOCK_LO )*10000) + +#define H_ACTIVE_LO (unsigned)dtd[ 2 ] + +#define H_BLANKING_LO (unsigned)dtd[ 3 ] + +#define H_ACTIVE_HI UPPER_NIBBLE( (unsigned)dtd[ 4 ] ) + +#define H_ACTIVE COMBINE_HI_8LO( H_ACTIVE_HI, H_ACTIVE_LO ) + +#define H_BLANKING_HI LOWER_NIBBLE( (unsigned)dtd[ 4 ] ) + +#define H_BLANKING COMBINE_HI_8LO( H_BLANKING_HI, H_BLANKING_LO ) + + + + +#define V_ACTIVE_LO (unsigned)dtd[ 5 ] + +#define V_BLANKING_LO (unsigned)dtd[ 6 ] + +#define V_ACTIVE_HI UPPER_NIBBLE( (unsigned)dtd[ 7 ] ) + +#define V_ACTIVE COMBINE_HI_8LO( V_ACTIVE_HI, V_ACTIVE_LO ) + +#define V_BLANKING_HI LOWER_NIBBLE( (unsigned)dtd[ 7 ] ) + +#define V_BLANKING COMBINE_HI_8LO( V_BLANKING_HI, V_BLANKING_LO ) + + + +#define H_SYNC_OFFSET_LO (unsigned)dtd[ 8 ] +#define H_SYNC_WIDTH_LO (unsigned)dtd[ 9 ] + +#define V_SYNC_OFFSET_LO UPPER_NIBBLE( (unsigned)dtd[ 10 ] ) +#define V_SYNC_WIDTH_LO LOWER_NIBBLE( (unsigned)dtd[ 10 ] ) + +#define V_SYNC_WIDTH_HI ((unsigned)dtd[ 11 ] & (1|2)) +#define V_SYNC_OFFSET_HI (((unsigned)dtd[ 11 ] & (4|8)) >> 2) + +#define H_SYNC_WIDTH_HI (((unsigned)dtd[ 11 ] & (16|32)) >> 4) +#define H_SYNC_OFFSET_HI (((unsigned)dtd[ 11 ] & (64|128)) >> 6) + + +#define V_SYNC_WIDTH COMBINE_HI_4LO( V_SYNC_WIDTH_HI, V_SYNC_WIDTH_LO ) +#define V_SYNC_OFFSET COMBINE_HI_4LO( V_SYNC_OFFSET_HI, V_SYNC_OFFSET_LO ) + +#define H_SYNC_WIDTH COMBINE_HI_4LO( H_SYNC_WIDTH_HI, H_SYNC_WIDTH_LO ) +#define H_SYNC_OFFSET COMBINE_HI_4LO( H_SYNC_OFFSET_HI, H_SYNC_OFFSET_LO ) + +#define H_SIZE_LO (unsigned)dtd[ 12 ] +#define V_SIZE_LO (unsigned)dtd[ 13 ] + +#define H_SIZE_HI UPPER_NIBBLE( (unsigned)dtd[ 14 ] ) +#define V_SIZE_HI LOWER_NIBBLE( (unsigned)dtd[ 14 ] ) + +#define H_SIZE COMBINE_HI_8LO( H_SIZE_HI, H_SIZE_LO ) +#define V_SIZE COMBINE_HI_8LO( V_SIZE_HI, V_SIZE_LO ) + +#define H_BORDER (unsigned)dtd[ 15 ] +#define V_BORDER (unsigned)dtd[ 16 ] + +#define FLAGS (unsigned)dtd[ 17 ] + +#define INTERLACED (FLAGS&128) +#define SYNC_TYPE (FLAGS&3<<3) /* bits 4,3 */ +#define SYNC_SEPARATE (3<<3) +#define HSYNC_POSITIVE (FLAGS & 4) +#define VSYNC_POSITIVE (FLAGS & 2) + +#define MONITOR_NAME 0xfc +#define MONITOR_LIMITS 0xfd +#define UNKNOWN_DESCRIPTOR -1 +#define DETAILED_TIMING_BLOCK -2 + + +#define DESCRIPTOR_DATA 5 +#define V_MIN_RATE block[ 5 ] +#define V_MAX_RATE block[ 6 ] +#define H_MIN_RATE block[ 7 ] +#define H_MAX_RATE block[ 8 ] + +#define MAX_PIXEL_CLOCK (((int)block[ 9 ]) * 10) +#define GTF_SUPPORT block[10] + +#define DPMS_ACTIVE_OFF (1 << 5) +#define DPMS_SUSPEND (1 << 6) +#define DPMS_STANDBY (1 << 7) + +char* myname; + +void MSG( const char* x ) +{ + fprintf( stderr, "%s: %s\n", myname, x ); +} + + +int +parse_edid( byte* edid ); + + +int +parse_timing_description( byte* dtd ); + + +int +parse_monitor_limits( byte* block ); + +int +block_type( byte* block ); + +char* +get_monitor_name( byte const* block ); + +char* +get_vendor_sign( byte const* block ); + +int +parse_dpms_capabilities( byte flags ); + +int +parse_edid( byte* edid ) +{ + unsigned i; + byte* block; + char* monitor_name = NULL; + char monitor_alt_name[100]; + byte checksum = 0; + char *vendor_sign; + int ret = 0; + + for( i = 0; i < EDID_LENGTH; i++ ) + checksum += edid[ i ]; + + if ( checksum != 0 ) { + MSG( "EDID checksum failed - data is corrupt. Continuing anyway." ); + ret = 1; + } + + if ( strncmp( (const char*) edid+EDID_HEADER, (const char*) edid_v1_header, EDID_HEADER_END+1 ) ) + { + MSG( "first bytes don't match EDID version 1 header" ); + MSG( "do not trust output (if any)." ); + ret = 1; + } + + vendor_sign = get_vendor_sign( edid + ID_MANUFACTURER_NAME ); + + block = edid + DETAILED_TIMING_DESCRIPTIONS_START; + + for( i = 0; i < NO_DETAILED_TIMING_DESCRIPTIONS; i++, + block += DETAILED_TIMING_DESCRIPTION_SIZE ) + { + + if ( block_type( block ) == MONITOR_NAME ) + { + monitor_name = get_monitor_name( block ); + break; + } + } + + if (!monitor_name) { + /* Stupid djgpp hasn't snprintf so we have to hack something together */ + if(strlen(vendor_sign) + 10 > sizeof(monitor_alt_name)) + vendor_sign[3] = 0; + + sprintf(monitor_alt_name, "%s:%02x%02x", + vendor_sign, edid[ID_MODEL], edid[ID_MODEL+1]) ; + monitor_name = monitor_alt_name; + } + + block = edid + DETAILED_TIMING_DESCRIPTIONS_START; + + for( i = 0; i < NO_DETAILED_TIMING_DESCRIPTIONS; i++, + block += DETAILED_TIMING_DESCRIPTION_SIZE ) + { + + if ( block_type( block ) == MONITOR_LIMITS ) + parse_monitor_limits( block ); + } + + parse_dpms_capabilities(edid[DPMS_FLAGS]); + + block = edid + DETAILED_TIMING_DESCRIPTIONS_START; + + printf("\n"); + for( i = 0; i < NO_DETAILED_TIMING_DESCRIPTIONS; i++, + block += DETAILED_TIMING_DESCRIPTION_SIZE ) + { + + if ( block_type( block ) == DETAILED_TIMING_BLOCK ) + parse_timing_description( block ); + } + printf("\n"); + + + return ret; +} + + +int +parse_timing_description( byte* dtd ) +{ + int htotal, vtotal; + htotal = H_ACTIVE + H_BLANKING; + vtotal = V_ACTIVE + V_BLANKING; + + printf( "\n\t%d\n\t%d\n", H_ACTIVE, V_ACTIVE ); + printf( "\t%.0f\n\t%.0f\n", + (double)PIXEL_CLOCK/((double)vtotal*(double)htotal), + (double)PIXEL_CLOCK/(double)(htotal*1000)); + + if ( INTERLACED ) + printf( "\ttrue\n"); + else + printf( "\tfalse\n"); + + printf( "\n" ); + + return 0; +} + + +int +block_type( byte* block ) +{ + if ( !strncmp( (const char*) edid_v1_descriptor_flag, (const char*) block, 2 ) ) + { + + /* descriptor */ + + if ( block[ 2 ] != 0 ) + return UNKNOWN_DESCRIPTOR; + + + return block[ 3 ]; + } else { + + /* detailed timing block */ + + return DETAILED_TIMING_BLOCK; + } +} + +char* +get_monitor_name( byte const* block ) +{ + static char name[ 13 ]; + unsigned i; + byte const* ptr = block + DESCRIPTOR_DATA; + + + for( i = 0; i < 13; i++, ptr++ ) + { + + if ( *ptr == 0xa ) + { + name[ i ] = 0; + return name; + } + + name[ i ] = *ptr; + } + + + return name; +} + + +char* get_vendor_sign( byte const* block ) +{ + static char sign[4]; + unsigned short h; + + /* + 08h WORD big-endian manufacturer ID (see #00136) + bits 14-10: first letter (01h='A', 02h='B', etc.) + bits 9-5: second letter + bits 4-0: third letter + */ + h = COMBINE_HI_8LO(block[0], block[1]); + sign[0] = ((h>>10) & 0x1f) + 'A' - 1; + sign[1] = ((h>>5) & 0x1f) + 'A' - 1; + sign[2] = (h & 0x1f) + 'A' - 1; + sign[3] = 0; + return sign; +} + +int +parse_monitor_limits( byte* block ) +{ + return 0; +} + +int +parse_dpms_capabilities(byte flags) +{ + return 0; +} + diff --git a/canmore/install_full.sh b/canmore/install_full.sh new file mode 100755 index 00000000..7ac4d5e9 --- /dev/null +++ b/canmore/install_full.sh @@ -0,0 +1,159 @@ +#!/bin/bash +if [ ! -f VERSION ]; then + echo You forgot to do make release +# exit +fi + +. cross_env + +SRC=./ +DEST=$CANMORE_HOME/targetfs/opt/boxee +STRIP=$CANMORE_HOME/toolchains/i686-cm-linux-strip + +echo "Installing to" $DEST + +${STRIP} system/libexif-i686-linux.so +${STRIP} system/python/python24-i686-linux.so +${STRIP} system/libid3tag-i686-linux.so +${STRIP} system/players/dvdplayer/libmpeg2-i686-linux.so +${STRIP} system/players/dvdplayer/libdvdnav-i686-linux.so +${STRIP} system/players/dvdplayer/libass-i686-linux.so +${STRIP} system/players/dvdplayer/liba52-i686-linux.so +${STRIP} system/players/dvdplayer/swscale-0.6.1-i686-linux.so +${STRIP} system/players/dvdplayer/libdts-i686-linux.so +${STRIP} system/players/dvdplayer/avcodec-52-i686-linux.so +${STRIP} system/players/dvdplayer/avutil-50-i686-linux.so +${STRIP} system/players/dvdplayer/avformat-52-i686-linux.so +${STRIP} system/players/dvdplayer/avcore-0.16.1-i686-linux.so +${STRIP} system/players/dvdplayer/libfaad-i686-linux.so +${STRIP} system/players/dvdplayer/libao-i686-linux.so +${STRIP} system/players/dvdplayer/libbluray.so +${STRIP} system/players/paplayer/stsoundlibrary-i686-linux.so +${STRIP} system/players/paplayer/vgmstream-i686-linux.so +${STRIP} system/players/paplayer/wavpack-i686-linux.so +${STRIP} system/players/paplayer/adpcm-i686-linux.so +${STRIP} system/players/paplayer/ac3codec-i686-linux.so +${STRIP} system/players/paplayer/MACDll-i686-linux.so +${STRIP} system/players/paplayer/gensapu-i686-linux.so +${STRIP} system/players/paplayer/dumb-i686-linux.so +${STRIP} system/players/paplayer/libsidplay2-i686-linux.so +${STRIP} system/players/paplayer/timidity-i686-linux.so +${STRIP} system/players/paplayer/nosefart-i686-linux.so +${STRIP} system/players/paplayer/SNESAPU-i686-linux.so +${STRIP} system/players/flashplayer/libFlashLib-i686-cm-linux.so +${STRIP} system/libboxeebrowser-i686-cm-linux.so.0 +${STRIP} system/players/flashplayer/bxflplayer-i686-cm-linux +${STRIP} system/hdhomerun-i686-linux.so +${STRIP} system/ImageLib-i686-linux.so +${STRIP} Boxee +${STRIP} BoxeeLauncher/BoxeeLauncher + +rm -rf ${DEST} + +mkdir -p ${DEST}/ +mkdir -p ${DEST}/skin +mkdir -p ${DEST}/system + +mkdir -p ${DEST}/language +cp ${SRC}/VERSION ${DEST}/ +rsync -rl --exclude=.svn ${SRC}/language/{English,Italian,German,Spanish,French,Hebrew,Swedish,Danish,Dutch,Russian,Turkish,Arabic,Norwegian,Finnish,Czech,Polish,Portuguese\ \(Brazil\)} ${SRC}/language/availablelangs.xml ${DEST}/language +rsync -rl --exclude=.svn ${SRC}/media ${DEST}/ +rm ${DEST}/media/Fonts/boxee.ttf +ln -s ../../skin/boxee/Fonts/arial.ttf ${DEST}/media/Fonts/boxee.ttf +rsync -rl --exclude=.svn ${SRC}/skin/boxee ${DEST}/skin +rsync -rl --exclude=.svn ${SRC}/scripts ${DEST}/ +rm -rf ${DEST}/skin/boxee/media/* +# disable startup sound +rm -f ${DEST}/skin/boxee/sounds/startup.wav +cp ${SRC}/skin/boxee/media/{Textures.xbt,textures.xml} ${DEST}/skin/boxee/media +#rm -rf ${DEST}/skin/boxee/media/{*.gif,*.png,Apple\ Movie\ Trailers,busy,flagging,Makefile} + +# cleanup media +rm ${DEST}/media/{Boxee.ico,icon.png,test_sound.mp3,xbmc.icns,icon32x32-linux.png,icon32x32.png} + +# cleanup scripts +rm -rf ${DEST}/scripts/RTorrent +rm -rf ${DEST}/scripts/Lyrics + +mkdir ${DEST}/visualisations +cp ${SRC}/visualisations/opengl_spectrum.vis ${DEST}/visualisations/opengl_spectrum.vis +cp ${SRC}/visualisations/ProjectM.vis ${DEST}/visualisations/ProjectM.vis +mkdir ${DEST}/visualisations/projectM +cp ${SRC}/visualisations/projectM/Geiss\ -\ Tube.milk ${DEST}/visualisations/projectM/ + +# system +cp ${SRC}/system/*-i686-linux.so ${DEST}/system +cp ${SRC}/system/libboxeebrowser-i686-cm-linux.so.0 ${DEST}/system +cp ${SRC}/system/*.xml ${DEST}/system +cp ${SRC}/system/*.txt ${DEST}/system +cp ${SRC}/system/*.pem ${DEST}/system +rsync -rl --exclude=.svn ${SRC}/system/keymaps ${DEST}/system/ +rsync -rl --exclude=.svn ${SRC}/system/shaders ${DEST}/system/ + +mkdir ${DEST}/system/python +cp ${SRC}/system/python/python24-i686-linux.so ${DEST}/system/python +rsync -rl --exclude=.svn ${SRC}/system/python/local ${DEST}/system/python/ +pushd ${DEST}/system/python/local > /dev/null 2>&1 +python2.4 -O -c 'import compileall; +compileall.compile_dir("'.'", force=1, quiet=1)' +/bin/rm -rf simplejson/_speedups.so simplejson/tests +/bin/rm `find . -name "*.py"` +popd > /dev/null 2>&1 + +mkdir ${DEST}/system/players + +# dvdplayer +mkdir ${DEST}/system/players/dvdplayer +cp ${SRC}/system/players/dvdplayer/*-i686-linux.so ${DEST}/system/players/dvdplayer +cp ${SRC}/system/players/dvdplayer/libbluray.so ${DEST}/system/players/dvdplayer + +# paplayer +mkdir ${DEST}/system/players/paplayer +cp ${SRC}/system/players/paplayer/*-i686-linux.so ${DEST}/system/players/paplayer + +# flashplayer +mkdir ${DEST}/system/players/flashplayer +cp ${SRC}/system/players/flashplayer/{libFlashLib-i686-cm-linux.so,libbxoverride-i686-cm-linux.so,bxflplayer-i686-cm-linux} ${DEST}/system/players/flashplayer +cp ${SRC}/system/players/flashplayer/{boxee.jpg,loading_animation.gif,preloader.html,loading.png} ${DEST}/system/players/flashplayer +pushd ${DEST}/system/players/flashplayer > /dev/null 2>&1 +popd > /dev/null 2>&1 +mkdir ${DEST}/system/players/flashplayer/plugins +cp ${SRC}/system/players/flashplayer/libflashplayer-i686-cm-linux.so ${DEST}/system/players/flashplayer/plugins + +# scrapers +rsync -rl --exclude=.svn ${SRC}/system/scrapers ${DEST}/system/ +mkdir ${DEST}/UserData +cp ${SRC}/UserData/profiles.xml.in ${DEST}/UserData +cp ${SRC}/UserData/sources.xml.in.diff.embedded ${DEST}/UserData +cp ${SRC}/UserData/sources.xml.in.embedded ${DEST}/UserData +cp ${SRC}/UserData/shortcuts.xml.in.embedded ${DEST}/UserData + +# hal +mkdir ${DEST}/hal +cp ${SRC}/BoxeeHal/server/BoxeeHal ${DEST}/hal +cp ${SRC}/BoxeeHal/server/helper/BoxeeHelper ${DEST}/hal +rsync -rl --exclude=.svn ${SRC}/BoxeeHal/server/scripts ${DEST}/hal/ + +# launcher +cp ${SRC}/BoxeeLauncher/BoxeeLauncher ${DEST}/ + +# wrapper +cp ${SRC}/BoxeeWrapper/bxwrapper.so ${DEST}/system +cp ${SRC}/MemLeakDetector/leakdetector.so ${DEST}/system + +# binary +cp ${SRC}/Boxee ${DEST}/ +cp ${SRC}/canmore/run_boxee.sh ${DEST}/ +cp ${SRC}/canmore/run_boxee_standalone.sh ${DEST}/ +cp ${SRC}/canmore/run_boxee_local.sh ${DEST}/ +cp ${SRC}/canmore/run_boxee_memleak.sh ${DEST}/ +cp ${SRC}/canmore/get_boxee_resolution.sh ${DEST}/ +cp ${SRC}/canmore/set_preferred_tvmode.sh ${DEST}/ +cp ${SRC}/canmore/get_hdmi_native/get_hdmi_native ${DEST}/ +cp ${SRC}/xbmc/lib/w_scan/w_scan ${DEST}/ + +# license +rsync -rl --exclude=.svn ${SRC}/license ${DEST}/ + +# run as root +touch ${DEST}/.run_as_root diff --git a/canmore/install_recovery.sh b/canmore/install_recovery.sh new file mode 100755 index 00000000..828d085e --- /dev/null +++ b/canmore/install_recovery.sh @@ -0,0 +1,13 @@ +#!/bin/bash +. cross_env + +SRC=./ +DEST=$CANMORE_HOME/targetfs/opt/boxee +STRIP=$CANMORE_HOME/toolchains/i686-cm-linux-strip + +${STRIP} RecoveryConsole/RecoveryConsole + +rm -rf ${DEST} + +mkdir -p ${DEST}/ +cp ${SRC}/RecoveryConsole/{RecoveryConsole,logo86t.png} ${DEST}/ diff --git a/canmore/kill_boxee.sh b/canmore/kill_boxee.sh new file mode 100755 index 00000000..1a48e82c --- /dev/null +++ b/canmore/kill_boxee.sh @@ -0,0 +1,2 @@ +#!/bin/ash +kill -9 `/bin/ps | grep Boxee | /bin/grep -v grep | /usr/bin/awk '{ print $1 }'` diff --git a/canmore/nightly_build.sh b/canmore/nightly_build.sh new file mode 100755 index 00000000..a84b4f81 --- /dev/null +++ b/canmore/nightly_build.sh @@ -0,0 +1,31 @@ +#!/bin/bash +echo "Building @`date`" +echo `git status | head -1` +mv build-number.txt /tmp +git reset --hard +git clean -d -f -x +mv /tmp/build-number.txt . + +export CANMORE_HOME=/opt/canmore +export BUILD_DEST=$CANMORE_HOME/sdk/build_i686/i686-linux-elf/ +export DISPLAY=:0 + +./bootstrap && ./canmore/configure.sh && make -j8 && make release && make -C tools/TexturePacker -f Makefile.host && make -C skin/boxee/media nocompress + +if [ "$?" -ne "0" ]; then + echo "Build failed" + exit 1 +fi + +sudo rm -rf /opt/canmore/targetfs/opt +sudo mkdir -p /opt/canmore/targetfs/opt/local +sudo tar xvJf /opt/targetfs-local-1.2.tar.xz -C /opt/canmore/targetfs/opt/local +sudo ./canmore/install_full.sh + +if [ "$?" -ne "0" ]; then + echo "Build failed" + exit 1 +fi + +sudo tar cvjf boxee-ce4100-`cat VERSION`.tar.bz2 -C /opt/canmore/targetfs opt +echo "Successfully created version `cat VERSION`" diff --git a/canmore/package_targetfs_local-21.sh b/canmore/package_targetfs_local-21.sh new file mode 100755 index 00000000..64d7e140 --- /dev/null +++ b/canmore/package_targetfs_local-21.sh @@ -0,0 +1,72 @@ +#!/bin/sh + +FILES_TO_COPY=$(cat targetfs-local-list-21.txt | grep -v ^\# | xargs) +BASE_3RDPARTY_PATH=/opt/canmore/3rdparty +PACK_PATH=/tmp/_${0}.$$ +STRIP_BIN=/opt/canmore/IntelCE/bin/i686-cm-linux-strip +MISSING_FILES="" + +CWD=$(pwd) +OUTNAME=opt_local_$(date +"%Y%m%d-%H%M").tar.bz2 + +if [ $(id -u) -ne 0 ] +then + echo 'Must run with root privs to use.' + exit 1 +fi + +rm -rf ${PACK_PATH} +mkdir -p ${PACK_PATH} +echo "COPYING..." +for f in ${FILES_TO_COPY} +do + f=${BASE_3RDPARTY_PATH}/${f} + if [ -e ${f} ] + then + fn=$(basename ${f}) + echo -n "${fn}.. " +# echo "file ${f} exists" + pn=$(echo $(dirname ${f}) | sed " { +s_${BASE_3RDPARTY_PATH}/target/usr_opt/local_g +s_${BASE_3RDPARTY_PATH}/target_opt/local_g +s_${BASE_3RDPARTY_PATH}/staging/usr_opt/local_g +s_${BASE_3RDPARTY_PATH}/staging__g +s_${BASE_3RDPARTY_PATH}/static/usr__g +s_${BASE_3RDPARTY_PATH}/static__g +s_${BASE_3RDPARTY_PATH}__g +} ") + fp=${PACK_PATH}/${pn} + if [ ! -d ${fp} ]; + then + mkdir -p ${fp} + fi + if [ -f ${f} -o -h ${f} ]; + then +# cp -p ${f} ${fp} 2>&1 >/dev/null + rsync -a ${f} ${fp} + if [ 0 != $? ]; + then + echo "COPY FAILURE, ABORTING" + rm -rf ${PACK_PATH} 2>&1 >/dev/null + exit 1 + fi +# ${STRIP_BIN} ${fp}/${fn} 2>&1 >/dev/null + fi + else + MISSING_FILES="${f} ${MISSING_FILES}" + fi +done +echo +echo "PACKING..." +(cd ${PACK_PATH} ; tar cjf ${CWD}/${OUTNAME} . ) + +if [ 0 != $? ]; +then + echo "PACK FAILURE, ABORTING" + rm -rf ${PACK_PATH} 2>&1 >/dev/null + exit 1 +fi +rm -rf ${PACK_PATH} 2>&1 >/dev/null +echo "DONE, RESULT IN ${CWD}/${OUTNAME}" +echo "MISSING FILES:" +echo ${MISSING_FILES} | sed "s_ _\n_g" diff --git a/canmore/package_targetfs_local-25.sh b/canmore/package_targetfs_local-25.sh new file mode 100755 index 00000000..dbe8910e --- /dev/null +++ b/canmore/package_targetfs_local-25.sh @@ -0,0 +1,72 @@ +#!/bin/sh + +FILES_TO_COPY=$(cat targetfs-local-list-25.txt | grep -v ^\# | xargs) +BASE_3RDPARTY_PATH=/opt/canmore/3rdparty +PACK_PATH=/tmp/_${0}.$$ +STRIP_BIN=/opt/canmore/IntelCE/bin/i686-cm-linux-strip +MISSING_FILES="" + +CWD=$(pwd) +OUTNAME=opt_local_25_$(date +"%Y%m%d-%H%M").tar.bz2 + +if [ $(id -u) -ne 0 ] +then + echo 'Must run with root privs to use.' + exit 1 +fi + +rm -rf ${PACK_PATH} +mkdir -p ${PACK_PATH} +echo "COPYING..." +for f in ${FILES_TO_COPY} +do + f=${BASE_3RDPARTY_PATH}/${f} + if [ -e ${f} ] + then + fn=$(basename ${f}) + echo -n "${fn}.. " +# echo "file ${f} exists" + pn=$(echo $(dirname ${f}) | sed " { +s_${BASE_3RDPARTY_PATH}/target/usr_opt/local_g +s_${BASE_3RDPARTY_PATH}/target_opt/local_g +s_${BASE_3RDPARTY_PATH}/staging/usr_opt/local_g +s_${BASE_3RDPARTY_PATH}/staging__g +s_${BASE_3RDPARTY_PATH}/static/usr__g +s_${BASE_3RDPARTY_PATH}/static__g +s_${BASE_3RDPARTY_PATH}__g +} ") + fp=${PACK_PATH}/${pn} + if [ ! -d ${fp} ]; + then + mkdir -p ${fp} + fi + if [ -f ${f} -o -h ${f} ]; + then +# cp -p ${f} ${fp} 2>&1 >/dev/null + rsync -a ${f} ${fp} + if [ 0 != $? ]; + then + echo "COPY FAILURE, ABORTING" + rm -rf ${PACK_PATH} 2>&1 >/dev/null + exit 1 + fi +# ${STRIP_BIN} ${fp}/${fn} 2>&1 >/dev/null + fi + else + MISSING_FILES="${f} ${MISSING_FILES}" + fi +done +echo +echo "PACKING..." +(cd ${PACK_PATH} ; tar cjf ${CWD}/${OUTNAME} . ) + +if [ 0 != $? ]; +then + echo "PACK FAILURE, ABORTING" + rm -rf ${PACK_PATH} 2>&1 >/dev/null + exit 1 +fi +rm -rf ${PACK_PATH} 2>&1 >/dev/null +echo "DONE, RESULT IN ${CWD}/${OUTNAME}" +echo "MISSING FILES:" +echo ${MISSING_FILES} | sed "s_ _\n_g" diff --git a/canmore/package_targetfs_local.sh b/canmore/package_targetfs_local.sh new file mode 100755 index 00000000..a55b0ec6 --- /dev/null +++ b/canmore/package_targetfs_local.sh @@ -0,0 +1,17 @@ +#!/bin/bash +FILE_LIST=$PWD/targetfs-local-list.txt +rm -rf /tmp/targetfs-local +mkdir -p /tmp/targetfs-local/opt/local +pushd /opt/canmore/local 2>&1 > /dev/null +tar cf - --files-from $FILE_LIST | ( cd /tmp/targetfs-local/opt/local; tar xfp - ) +cd /tmp/targetfs-local/opt/local +find . -name "*.so" | sudo xargs /opt/canmore/toolchains/i686-cm-linux-strip +sudo chown -R root.root /tmp/targetfs-local/opt/local +cp $FILE_LIST /tmp/file_list +echo "var" >> /tmp/file_list +sudo ln -s ../../var /tmp/targetfs-local/opt/local/var +tar cvfJ /tmp/targetfs-local.tar.xz --files-from /tmp/file_list +popd 2>&1 > /dev/null +mv /tmp/targetfs-local.tar.xz . +sudo rm -rf /tmp/targetfs-local +rm /tmp/file_list diff --git a/canmore/package_targetfs_local_recovery.sh b/canmore/package_targetfs_local_recovery.sh new file mode 100755 index 00000000..e2b54e0d --- /dev/null +++ b/canmore/package_targetfs_local_recovery.sh @@ -0,0 +1,13 @@ +#!/bin/bash +FILE_LIST=$PWD/targetfs-local-recovery-list.txt +rm -rf /tmp/targetfs-local +mkdir -p /tmp/targetfs-local/opt/local +pushd /opt/canmore/local 2>&1 > /dev/null +tar cf - --files-from $FILE_LIST | ( cd /tmp/targetfs-local/opt/local; tar xfp - ) +cd /tmp/targetfs-local/opt/local +find . -name "*.so" | sudo xargs /opt/canmore/toolchains/i686-cm-linux-strip +sudo chown -R root.root /tmp/targetfs-local/opt/local +tar cvfJ /tmp/targetfs-local-recovery.tar.xz --files-from $FILE_LIST +popd 2>&1 > /dev/null +mv /tmp/targetfs-local-recovery.tar.xz . +sudo rm -rf /tmp/targetfs-local diff --git a/canmore/patches/hard_clip.patch b/canmore/patches/hard_clip.patch new file mode 100644 index 00000000..f0ac67a0 --- /dev/null +++ b/canmore/patches/hard_clip.patch @@ -0,0 +1,205 @@ +Index: src/DirectFB-1.2/gfxdrivers/IntelCE/GraphicsBlitting.c +=================================================================== +--- src/DirectFB-1.2/gfxdrivers/IntelCE/GraphicsBlitting.c (revision 111797) ++++ src/DirectFB-1.2/gfxdrivers/IntelCE/GraphicsBlitting.c (working copy) +@@ -4,7 +4,7 @@ + // + // LGPL LICENSE SUMMARY + // +-// Copyright(c) 2007-2009. Intel Corporation. All rights reserved. ++// Copyright(c) 2007-2010. Intel Corporation. All rights reserved. + // + // This program is free software; you can redistribute it and/or modify + // it under the terms of version 2.1 of the GNU Lesser General Public +@@ -67,6 +67,7 @@ + + ///////////////// Includes //////////////// + #include ++#include + + #include + #include +@@ -82,6 +83,7 @@ + ///////////////// Debug Domains //////////////// + D_DEBUG_DOMAIN( IntelCE_Gfx_Blit, "IntelCE/Gfx/Blit", "IntelCE Graphics Blit" ); + D_DEBUG_DOMAIN( OPENGL, "IntelCE/Gfx/OpenGL", "OpenGL ES Commands" ); ++D_DEBUG_DOMAIN( IntelCE_Gfx_Blit_Verbose, "IntelCE_V/Gfx/Blit", "IntelCE Graphics Blit" ); + + + //----------------------------------------------------------------------------- +@@ -200,6 +202,7 @@ + CardState* pPrevState, + DFBRectangle* pSrcRect, + DFBRectangle* pDstRect, ++ bool isStretchBlit, + bool* pUsedOpenGL ) + { + bool result = true; +@@ -291,20 +294,135 @@ + result = false; + goto exit; + } ++ ++ /* This is a workaround for the SRB hardware clip problem. If the ++ destination rectangle is partially outside the destination surface, ++ then the hardware clip in SRB will not work properly. To workaround ++ this problem, for standard blit, the source and destination ++ rectangles will be re-calculated to make the new destination inside ++ destination surface. ++ Stretch blit will fall back to software rendering if the destination ++ rectangle is outside the destination surface. */ ++ DFBRectangle finalSrcRect = *pSrcRect; ++ DFBRectangle finalDstRect = *pDstRect; ++ bool isVisible = true; ++ ++#if DIRECT_BUILD_DEBUG ++ char accelMsg[ACCEL_MASK_MIN_STRING_LEN]; ++ if ( isStretchBlit) ++ { ++ sprintf( accelMsg, "DFXL_STRETCHBLIT"); ++ } ++ else ++ { ++ sprintf( accelMsg, "DFXL_BLIT"); ++ } ++#endif ++ ++ DFBRectangle maxDstRect = ++ { ++ 0, ++ 0, ++ pDstSurface->config.size.w, ++ pDstSurface->config.size.h ++ }; ++ ++ isVisible = dfb_rectangle_intersect( &finalDstRect, &maxDstRect ); ++ ++ D_ASSERT( isVisible ); ++ ++ if (finalDstRect.w < pDstRect->w || finalDstRect.h < pDstRect->h) ++ { ++ if ( !isStretchBlit) // standard blit ++ { ++ D_ASSERT( pBlitInfo->clip_rect.origin.x >= maxDstRect.x ); ++ D_ASSERT( pBlitInfo->clip_rect.origin.y >= maxDstRect.y ); ++ D_ASSERT( pBlitInfo->clip_rect.width <= maxDstRect.w ); ++ D_ASSERT( pBlitInfo->clip_rect.height <= maxDstRect.h ); ++ ++ if ( finalDstRect.x > pDstRect->x ) ++ { ++ finalSrcRect.x += finalDstRect.x - pDstRect->x; ++ finalSrcRect.w -= finalDstRect.x - pDstRect->x; ++ } ++ ++ if ( finalDstRect.y > pDstRect->y ) ++ { ++ finalSrcRect.y += finalDstRect.y - pDstRect->y; ++ finalSrcRect.h -= finalDstRect.y - pDstRect->y; ++ } ++ ++ int dstRect_x2 = pDstRect->x + pDstRect->w - 1; ++ int dstRect_y2 = pDstRect->y + pDstRect->h - 1 ; ++ int finalDstRect_x2 = finalDstRect.x + finalDstRect.w - 1; ++ int finalDstRect_y2 = finalDstRect.y + finalDstRect.h - 1 ; ++ ++ if ( finalDstRect_x2 < dstRect_x2 ) ++ { ++ finalSrcRect.w -= dstRect_x2 - finalDstRect_x2; ++ } ++ ++ if ( finalDstRect_y2 < dstRect_y2 ) ++ { ++ finalSrcRect.h -= dstRect_y2 - finalDstRect_y2; ++ } ++ ++ D_ASSERT( finalSrcRect.w == finalDstRect.w ); ++ D_ASSERT( finalSrcRect.h == finalDstRect.h ); ++ ++ D_DEBUG_AT( IntelCE_Gfx_Blit_Verbose, ++ "Standard blit," ++ "explicitly clipping src and dest rects." ++ "PF:%s Op:%s " ++ "SrcRect(%d,%d,%d,%d) DstRect(%d,%d,%d,%d) " ++ "dstSurface(%d,%d,%d,%d) " ++ "finalSrcRect(%d,%d,%d,%d)" ++ "finalDstRect(%d,%d,%d,%d) " ++ "%s()- %s:%d\n", ++ PixelFormatDebug(pDstSurface->config.format), ++ accelMsg, ++ pSrcRect->x,pSrcRect->y,pSrcRect->w,pSrcRect->h, ++ pDstRect->x,pDstRect->y,pDstRect->w,pDstRect->h, ++ maxDstRect.x, maxDstRect.y, ++ maxDstRect.w, maxDstRect.h, ++ finalSrcRect.x, finalSrcRect.y, ++ finalSrcRect.w, finalSrcRect.h, ++ finalDstRect.x, finalDstRect.y, ++ finalDstRect.w, finalDstRect.h, ++ __FUNCTION__, __FILE__, __LINE__ ); ++ } ++ else // stretch blit ++ { ++ D_DEBUG_AT( IntelCE_Gfx_Blit, ++ "Stretch blit: " ++ "dest rect partially outside dest surface, " ++ "fallback to CPU-based rendering. " ++ "PF:%s Op:%s " ++ "%s()- %s:%d\n", ++ PixelFormatDebug(pDstSurface->config.format), ++ accelMsg, __FUNCTION__, __FILE__, __LINE__ ); ++ ++ LOG_AT("Rejected Last StretchBlit", "HW DestSurfID:%d... \n", ++ GetCoreSurfaceID(pDstSurface)); ++ ++ result = false; ++ goto exit; // exit and fall back to software ++ } ++ } + + // Setup the source and dest rectangles + gdl_rectangle_t source_rect = + { +- origin: {x: pSrcRect->x, y: pSrcRect->y}, +- width: pSrcRect->w, +- height: pSrcRect->h ++ origin: {x: finalSrcRect.x, y: finalSrcRect.y}, ++ width: finalSrcRect.w, ++ height: finalSrcRect.h + }; + + gdl_rectangle_t destination_rect = + { +- origin: {x: pDstRect->x, y: pDstRect->y}, +- width: pDstRect->w, +- height: pDstRect->h ++ origin: {x: finalDstRect.x, y: finalDstRect.y}, ++ width: finalDstRect.w, ++ height: finalDstRect.h + }; + + pBlitInfo->src_rect = source_rect; +@@ -522,7 +640,11 @@ + } + + // Perform the common blitting related operations. +- result = _GraphicsCommonBlit(pPrevState, pSrcRect, &dstRect,&usedOpenGL); ++ result = _GraphicsCommonBlit(pPrevState, ++ pSrcRect, ++ &dstRect, ++ false, // false for standard blit ++ &usedOpenGL); + + exit: + #if DIRECT_BUILD_DEBUG +@@ -603,7 +725,11 @@ + + // Peform the blit and increment the queued operations + bool usedOpenGL; +- result = _GraphicsCommonBlit(pPrevState, pSrcRect,pDstRect, &usedOpenGL); ++ result = _GraphicsCommonBlit(pPrevState, ++ pSrcRect, ++ pDstRect, ++ true, // true for stretch blit ++ &usedOpenGL); + + exit: + #if DIRECT_BUILD_DEBUG diff --git a/canmore/run_boxee.sh b/canmore/run_boxee.sh new file mode 100755 index 00000000..5eade4e7 --- /dev/null +++ b/canmore/run_boxee.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# collect crash logs +if [ -f /opt/local/bin/collect_logs ]; then + /opt/local/bin/collect_logs +fi + +export LD_LIBRARY_PATH=/opt/local/lib:/opt/local/qt-4.7/lib:/opt/local/qt/lib:/lib:/usr/lib:/usr/local/lib:/opt/boxee/system/players/flashplayer:/opt/boxee/system/players/dvdplayer +export MOZ_PLUGIN_PATH=/opt/boxee/system/players/flashplayer/plugins +export WEBKIT_PLUGIN_PATH=/opt/boxee/system/players/flashplayer/plugins +export QWS_DISPLAY=intelce:bgcolor=#00000000 +export QWS_KEYBOARD=intelceir:repeatRate=500 +export QT_QWS_FONTDIR=/opt/local/qt/lib/fonts +export QT_PLUGIN_PATH=/opt/local/qt/plugins +export PYTHON_SANDBOX=1 +export FLASH_CIRC_FILE_MAX_SIZE_MB=75 + +cd /opt/boxee +LD_PRELOAD=system/bxwrapper.so ./Boxee diff --git a/canmore/run_boxee_local.sh b/canmore/run_boxee_local.sh new file mode 100755 index 00000000..5ea40b75 --- /dev/null +++ b/canmore/run_boxee_local.sh @@ -0,0 +1,11 @@ +#!/bin/sh +export LD_LIBRARY_PATH=/opt/local/lib:/opt/local/qt-4.7/lib:/opt/local/qt/lib:/lib:/usr/lib:/usr/local/lib:system/players/flashplayer:system/players/dvdplayer +export MOZ_PLUGIN_PATH=/opt/boxee/system/players/flashplayer/plugins +export WEBKIT_PLUGIN_PATH=/opt/boxee/system/players/flashplayer/plugins +export QWS_DISPLAY=intelce:bgcolor=#00000000 +export QWS_KEYBOARD=intelceir:repeatRate=500 +export QT_QWS_FONTDIR=/opt/local/qt/lib/fonts +export QT_PLUGIN_PATH=/opt/local/qt/plugins +export PYTHON_SANDBOX=1 +export FLASH_CIRC_FILE_MAX_SIZE_MB=75 +LD_PRELOAD=system/bxwrapper.so ./Boxee $* diff --git a/canmore/run_boxee_memleak.sh b/canmore/run_boxee_memleak.sh new file mode 100755 index 00000000..65e66732 --- /dev/null +++ b/canmore/run_boxee_memleak.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# collect crash logs +if [ -f /opt/local/bin/collect_logs ]; then + /opt/local/bin/collect_logs +fi + +export LD_LIBRARY_PATH=/opt/local/lib:/opt/local/qt-4.7/lib:/opt/local/qt/lib:/lib:/usr/lib:/usr/local/lib:/opt/boxee/system/players/flashplayer:/opt/boxee/system/players/dvdplayer +export MOZ_PLUGIN_PATH=/opt/boxee/system/players/flashplayer/plugins +export WEBKIT_PLUGIN_PATH=/opt/boxee/system/players/flashplayer/plugins +export QWS_DISPLAY=intelce:bgcolor=black +export QWS_KEYBOARD=intelceir:repeatRate=500 +export QT_QWS_FONTDIR=/opt/local/qt/lib/fonts +export QT_PLUGIN_PATH=/opt/local/qt-4.7/plugins +export PYTHON_SANDBOX=1 +export NRD_IR_KEYDATA=/opt/local/etc/YFI_CecIr_KeyData.xml +cd /opt/boxee +LD_PRELOAD=system/leakdetector.so ./Boxee diff --git a/canmore/run_boxee_standalone.sh b/canmore/run_boxee_standalone.sh new file mode 100755 index 00000000..6946325e --- /dev/null +++ b/canmore/run_boxee_standalone.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +echo "nameserver 8.8.8.8" > /etc/resolv.conf +echo "ntp 123/tcp" > /etc/services +echo "ntp 123/udp" >> /etc/services +sleep 1 +/opt/local/bin/ntpdate pool.ntp.org +export LD_LIBRARY_PATH=/opt/local/lib:/opt/local/qt-4.7/lib:/opt/local/qt/lib:/lib:/usr/lib:/usr/local/lib:/opt/boxee/system/players/flashplayer:/opt/boxee/system/players/dvdplayer +export MOZ_PLUGIN_PATH=/opt/boxee/system/players/flashplayer/plugins +export WEBKIT_PLUGIN_PATH=/opt/boxee/system/players/flashplayer/plugins +export QWS_DISPLAY=intelce:bgcolor=#00000000 +export QWS_KEYBOARD=intelceir:repeatRate=500 +export QT_QWS_FONTDIR=/opt/local/qt/lib/fonts +export QT_PLUGIN_PATH=/opt/local/qt/plugins +export PYTHON_SANDBOX=1 +export FLASH_CIRC_FILE_MAX_SIZE_MB=75 +cd /opt/boxee +LD_PRELOAD=system/bxwrapper.so ./Boxee -nftu $1 diff --git a/canmore/set_preferred_tvmode.sh b/canmore/set_preferred_tvmode.sh new file mode 100755 index 00000000..66145a00 --- /dev/null +++ b/canmore/set_preferred_tvmode.sh @@ -0,0 +1,81 @@ +#!/bin/sh + +get_native_resolution () { + export LD_LIBRARY_PATH=/opt/local/lib + + /opt/boxee/get_hdmi_native > /tmp/hdmi_native_resolutions.xml + if [ $? != "0" ]; then + return $? + fi + + WIDTH=`/opt/local/bin/xmlstarlet sel -t -v //modes/mode[$1]/width /tmp/hdmi_native_resolutions.xml` + if [ -z $WIDTH ]; then + return 1 + fi + + HEIGHT=`/opt/local/bin/xmlstarlet sel -t -v //modes/mode[$1]/height /tmp/hdmi_native_resolutions.xml` + VFREQ=`/opt/local/bin/xmlstarlet sel -t -v //modes/mode[$1]/vfreq /tmp/hdmi_native_resolutions.xml` + INTERLACED=`/opt/local/bin/xmlstarlet sel -t -v //modes/mode[$1]/interlaced /tmp/hdmi_native_resolutions.xml` + + if [ "$INTERLACED" == "true" ]; then + HEIGHT=`expr $HEIGHT \* 2` + fi + + MODE=$HEIGHT + if [ "$INTERLACED" == "true" ]; then + MODE="${MODE}i" + else + MODE="${MODE}p" + fi + + if [ "$VFREQ" == "50" ]; then + MODE="${MODE}50" + fi + + rm /tmp/hdmi_native_resolutions.xml + + #echo $WIDTH + #echo $HEIGHT + #echo $INTERLACED + #echo $MODE + + return 0 +} + +MODE=`/opt/boxee/get_boxee_resolution.sh` +if [ $? == "0" ]; then + echo "Setting to boxee resolution: $MODE" + tvmode $MODE + if [ $? == "0" ]; then + exit 0 + fi + echo "tvmode failed, not giving up" +fi + +r=1 +while : +do + get_native_resolution $r + return_val=$? + + if [ $return_val == "0" ]; then + echo "Setting to HDMI native resolution: $MODE" + tvmode $MODE + if [ $? == "0" ]; then + exit 0 + fi + echo "tvmode failed, not giving up" + fi + + if [ $return_val == "1" ]; then + echo "End of native resolutions." + break; + fi + + r=$(($r+1)) +done + +echo "Fallthrough to 480p" +tvmode 480p + +exit 0 diff --git a/canmore/sndfile/compile.sh b/canmore/sndfile/compile.sh new file mode 100755 index 00000000..ef4eae6c --- /dev/null +++ b/canmore/sndfile/compile.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source ../common.sh +pushd libsndfile-1.0.23 +./configure --host=${HOST} --prefix=${PREFIX} +make -j6 +#sudo make install +popd diff --git a/canmore/targetfs-local-list-21.txt b/canmore/targetfs-local-list-21.txt new file mode 100644 index 00000000..827f5636 --- /dev/null +++ b/canmore/targetfs-local-list-21.txt @@ -0,0 +1,1336 @@ +staging/usr/lib/charset +staging/usr/lib/charset.alias +staging/usr/lib/glib-2.0 +staging/usr/lib/glib-2.0/include +staging/usr/lib/glib-2.0/include/glibconfig.h +staging/usr/lib/idmap +staging/usr/lib/lowcase.dat +staging/usr/lib/nss_info +staging/usr/lib/pdb +staging/usr/lib/rpc +staging/usr/lib/upcase.dat +staging/usr/lib/valid.dat +#staging/usr/private/secrets.tdb +static/.adobe +static/.boxee +static/data/.boxee/.emptydir +static/data/etc/boxeehal.conf +static/data/etc/hostname +static/data/etc/hosts +static/data/etc/localtime +static/data/etc/ppp/options.pptp +static/data/etc/ppp/peers/vpn +static/data/etc/ppp/resolv.conf +static/data/etc/ppp/secrets +static/data/etc/resolv.conf +static/data/etc/smb.conf +static/data/etc/smb.disabled +static/data/etc/vpn.disabled +static/data/etc/resolv.conf.dhclient +static/data/.persistent/.mrwong/.errors/err400.html +static/data/.persistent/.mrwong/.errors/err401.html +static/data/.persistent/.mrwong/.errors/err403.html +static/data/.persistent/.mrwong/.errors/err404.html +static/data/.persistent/.mrwong/.errors/err408.html +static/data/.persistent/.mrwong/.errors/err500.html +static/data/.persistent/.mrwong/.errors/err501.html +static/data/.persistent/.mrwong/.errors/err503.html +static/download/.emptydir +static/etc/dbus-1/system.conf +static/etc/dbus-1/system.d/avahi-dbus.conf +static/etc/filesystems +static/etc/group +static/etc/hostname +static/etc/hosts +static/etc/init.d/boxee_afpfsd +static/etc/init.d/boxee_avahi +static/etc/init.d/boxee_boot_video +static/etc/init.d/boxee_cifs +static/etc/init.d/boxee_compcache +static/etc/init.d/boxee_dbus +static/etc/init.d/boxee_hal +static/etc/init.d/boxee_init +static/etc/init.d/boxee_launcher +static/etc/init.d/boxee_lircd +static/etc/init.d/boxee_oem +static/etc/init.d/boxee_oem_fsinit +static/etc/init.d/boxee_ota +static/etc/init.d/boxee_pppd +static/etc/init.d/boxee_upnp +static/etc/init.d/boxee_urandom +static/etc/init.d/boxee_v4l +static/etc/init.d/boxee_wifi +static/etc/init.d/devtools +static/etc/init.d/init_man.sh +static/etc/init.d/kernel +static/etc/init.d/network +static/etc/init.d/rc.deps +static/etc/init.d/system_setup +static/etc/localtime +static/etc/nsswitch.conf +static/etc/passwd +static/etc/platform_config/ce4100.hcfg +static/etc/platform_config/ce4100/memory_layout_512M.hcfg +static/etc/powervr.ini +static/etc/ppp/chap-secrets +static/etc/ppp/ip-down +static/etc/ppp/ip-up +static/etc/ppp/options.pptp +static/etc/ppp/options.pptp.in +static/etc/ppp/pap-secrets +static/etc/ppp/peers/vpn +static/etc/ppp/peers/vpn.in +static/etc/ppp/resolv.conf +static/etc/ppp/usepeerdns +static/etc/profile +static/etc/protocols +static/etc/rc3.d/K001boxee_launcher +static/etc/rc3.d/K002boxee_oem +static/etc/rc3.d/K003boxee_oem_fsinit +static/etc/rc3.d/S016boxee_oem_fsinit +static/etc/rc3.d/S019boxee_lircd +static/etc/rc3.d/S058boxee_wifi +static/etc/rc3.d/S061boxee_dbus +static/etc/rc3.d/S062boxee_cifs +static/etc/rc3.d/S064boxee_avahi +static/etc/rc3.d/S065boxee_hal +static/etc/rc3.d/S067boxee_pppd +static/etc/rc3.d/S068boxee_upnp +static/etc/rc3.d/S070boxee_compcache +static/etc/rc3.d/S071boxee_afpfsd +static/etc/rc3.d/S085boxee_v4l +static/etc/rc3.d/S086boxee_ota +static/etc/rc3.d/S089boxee_boot_video +static/etc/rc3.d/S092boxee_oem +static/etc/rc3.d/S094boxee_urandom +static/etc/rc3.d/S999boxee_launcher +static/etc/resolv.conf +static/etc/resolv.conf.dhclient +static/etc/services +static/etc/syslog.conf +static/etc/udev/rules.d/50-udev-gen3.rules +static/etc/Wireless/BCM4319/bcm94319wlusbnp4l.nvm +static/etc/Wireless/BCM4319/bcmdl +static/etc/Wireless/BCM4319/dhd.ko +static/etc/Wireless/BCM4319/usb-g-cdc-full11n-reclaim-roml-wme-idsup-40m.bin.trx +static/etc/Wireless/BCM4319/usb-g-cdc-full11n-roml-wme-40m-idsup-noreclaim.bin.trx +static/etc/Wireless/RT2870STA/RT2870STA.dat +static/etc/Wireless/RT2870STA/rt5370sta.ko +static/etc/Wireless/RT2870STA/rtnet5370sta.ko +static/etc/Wireless/RT2870STA/rtutil5370sta.ko +static/etc/YFI_CecIr_KeyData.xml +static/lib/firmware/ota +static/lib/modules/2.6.35 +static/lib/udev/firmware.sh +static/media +static/mnt +static/opt/local/lib/firmware/ota/dvb-usb-dib0700-1.20.fw +static/opt/local/lib/firmware/ota/dvb-fe-xc5000-1.6.114.fw +static/opt/local/lib/modules/2.6.35/bsd_comp.ko +static/opt/local/lib/modules/2.6.35/card_detector.ko +static/opt/local/lib/modules/2.6.35/cifs.ko +static/opt/local/lib/modules/2.6.35/dib0070.ko +static/opt/local/lib/modules/2.6.35/au0828.ko +static/opt/local/lib/modules/2.6.35/au8522.ko +static/opt/local/lib/modules/2.6.35/tuner.ko +static/opt/local/lib/modules/2.6.35/xc5000.ko +static/opt/local/lib/modules/2.6.35/tveeprom.ko +static/opt/local/lib/modules/2.6.35/dib0090.ko +static/opt/local/lib/modules/2.6.35/dib3000mb.ko +static/opt/local/lib/modules/2.6.35/dib3000mc.ko +static/opt/local/lib/modules/2.6.35/dib7000m.ko +static/opt/local/lib/modules/2.6.35/dib7000p.ko +static/opt/local/lib/modules/2.6.35/dib8000.ko +static/opt/local/lib/modules/2.6.35/dibx000_common.ko +static/opt/local/lib/modules/2.6.35/dvb-core.ko +static/opt/local/lib/modules/2.6.35/dvb-usb-dib0700.ko +static/opt/local/lib/modules/2.6.35/dvb-usb-dibusb-common.ko +static/opt/local/lib/modules/2.6.35/dvb-usb-dibusb-mb.ko +static/opt/local/lib/modules/2.6.35/dvb-usb-dibusb-mc.ko +static/opt/local/lib/modules/2.6.35/dvb-usb.ko +static/opt/local/lib/modules/2.6.35/lzo_compress.ko +static/opt/local/lib/modules/2.6.35/ppp_async.ko +static/opt/local/lib/modules/2.6.35/ppp_deflate.ko +static/opt/local/lib/modules/2.6.35/ppp_generic.ko +static/opt/local/lib/modules/2.6.35/ppp_mppe.ko +static/opt/local/lib/modules/2.6.35/slhc.ko +static/opt/local/lib/modules/2.6.35/uvcvideo.ko +static/opt/local/lib/modules/2.6.35/v4l2-common.ko +static/opt/local/lib/modules/2.6.35/v4l2-int-device.ko +static/opt/local/lib/modules/2.6.35/videobuf-core.ko +static/opt/local/lib/modules/2.6.35/videobuf-vmalloc.ko +static/opt/local/lib/modules/2.6.35/videodev.ko +static/opt/local/qt-4.7 +static/opt/local/qt/lib/fonts/arial.ttf +static/opt/local/qt/lib/fonts/DejaVuSansMono-BoldOblique.ttf +static/opt/local/qt/lib/fonts/DejaVuSansMono-Bold.ttf +static/opt/local/qt/lib/fonts/DejaVuSansMono-Oblique.ttf +static/opt/local/qt/lib/fonts/DejaVuSansMono.ttf +static/opt/local/qt/lib/fonts/DejaVuSerif-BoldOblique.ttf +static/opt/local/qt/lib/fonts/DejaVuSerif-Bold.ttf +static/opt/local/qt/lib/fonts/DejaVuSerif-Oblique.ttf +static/opt/local/qt/lib/fonts/DejaVuSerif.ttf +static/opt/local/qt/lib/libQtCore.so +static/opt/local/qt/lib/libQtCore.so.4 +static/opt/local/qt/lib/libQtCore.so.4.7 +static/opt/local/qt/lib/libQtCore.so.4.7.2 +static/opt/local/qt/lib/libQtGui.la +static/opt/local/qt/lib/libQtGui.so +static/opt/local/qt/lib/libQtGui.so.4 +static/opt/local/qt/lib/libQtGui.so.4.7 +static/opt/local/qt/lib/libQtGui.so.4.7.2 +static/opt/local/qt/lib/libQtMultimedia.so +static/opt/local/qt/lib/libQtMultimedia.so.4 +static/opt/local/qt/lib/libQtMultimedia.so.4.7 +static/opt/local/qt/lib/libQtMultimedia.so.4.7.2 +static/opt/local/qt/lib/libQtNetwork.la +static/opt/local/qt/lib/libQtNetwork.so +static/opt/local/qt/lib/libQtNetwork.so.4 +static/opt/local/qt/lib/libQtNetwork.so.4.7 +static/opt/local/qt/lib/libQtNetwork.so.4.7.2 +static/opt/local/qt/lib/libQtOpenGL.so +static/opt/local/qt/lib/libQtOpenGL.so.4 +static/opt/local/qt/lib/libQtOpenGL.so.4.7 +static/opt/local/qt/lib/libQtOpenGL.so.4.7.2 +static/opt/local/qt/lib/libQtScript.so +static/opt/local/qt/lib/libQtScript.so.4 +static/opt/local/qt/lib/libQtScript.so.4.7 +static/opt/local/qt/lib/libQtScript.so.4.7.2 +static/opt/local/qt/lib/libQtScriptTools.so +static/opt/local/qt/lib/libQtScriptTools.so.4 +static/opt/local/qt/lib/libQtScriptTools.so.4.7 +static/opt/local/qt/lib/libQtScriptTools.so.4.7.2 +static/opt/local/qt/lib/libQtSql.so +static/opt/local/qt/lib/libQtSql.so.4 +static/opt/local/qt/lib/libQtSql.so.4.7 +static/opt/local/qt/lib/libQtSql.so.4.7.2 +static/opt/local/qt/lib/libQtTest.so +static/opt/local/qt/lib/libQtTest.so.4 +static/opt/local/qt/lib/libQtTest.so.4.7 +static/opt/local/qt/lib/libQtTest.so.4.7.2 +static/opt/local/qt/lib/libQtWebKit.so +static/opt/local/qt/lib/libQtWebKit.so.4 +static/opt/local/qt/lib/libQtWebKit.so.4.7 +static/opt/local/qt/lib/libQtWebKit.so.4.7.2 +static/opt/local/qt/lib/libQtXmlPatterns.so +static/opt/local/qt/lib/libQtXmlPatterns.so.4 +static/opt/local/qt/lib/libQtXmlPatterns.so.4.7 +static/opt/local/qt/lib/libQtXmlPatterns.so.4.7.2 +static/opt/local/qt/lib/libQtXml.so +static/opt/local/qt/lib/libQtXml.so.4 +static/opt/local/qt/lib/libQtXml.so.4.7 +static/opt/local/qt/lib/libQtXml.so.4.7.2 +static/opt/local/qt/plugins/gfxdrivers/libintelcescreen.so +static/opt/local/qt/plugins/gfxdrivers/libqdirectfbscreen.so +static/opt/local/qt/plugins/imageformats/libqgif.so +static/opt/local/qt/plugins/imageformats/libqico.so +static/opt/local/qt/plugins/imageformats/libqjpeg.so +static/opt/local/qt/plugins/imageformats/libqsvg.so +static/opt/local/qt/plugins/kbddrivers/libqintelceirkbddriver.so +static/opt/local/qt/plugins/sqldrivers/libqsqlite.so +static/opt/local/sbin/wl +static/.persistent +static/.qws +static/.smb +#static/usr/lib/locale/en_AG/LC_ADDRESS +#static/usr/lib/locale/en_AG/LC_COLLATE +#static/usr/lib/locale/en_AG/LC_CTYPE +#static/usr/lib/locale/en_AG/LC_IDENTIFICATION +#static/usr/lib/locale/en_AG/LC_MEASUREMENT +#static/usr/lib/locale/en_AG/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_AG/LC_MONETARY +#static/usr/lib/locale/en_AG/LC_NAME +#static/usr/lib/locale/en_AG/LC_NUMERIC +#static/usr/lib/locale/en_AG/LC_PAPER +#static/usr/lib/locale/en_AG/LC_TELEPHONE +#static/usr/lib/locale/en_AG/LC_TIME +#static/usr/lib/locale/en_AU.utf8/LC_ADDRESS +#static/usr/lib/locale/en_AU.utf8/LC_COLLATE +#static/usr/lib/locale/en_AU.utf8/LC_CTYPE +#static/usr/lib/locale/en_AU.utf8/LC_IDENTIFICATION +#static/usr/lib/locale/en_AU.utf8/LC_MEASUREMENT +#static/usr/lib/locale/en_AU.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_AU.utf8/LC_MONETARY +#static/usr/lib/locale/en_AU.utf8/LC_NAME +#static/usr/lib/locale/en_AU.utf8/LC_NUMERIC +#static/usr/lib/locale/en_AU.utf8/LC_PAPER +#static/usr/lib/locale/en_AU.utf8/LC_TELEPHONE +#static/usr/lib/locale/en_AU.utf8/LC_TIME +#static/usr/lib/locale/en_BW.utf8/LC_ADDRESS +#static/usr/lib/locale/en_BW.utf8/LC_COLLATE +#static/usr/lib/locale/en_BW.utf8/LC_CTYPE +#static/usr/lib/locale/en_BW.utf8/LC_IDENTIFICATION +#static/usr/lib/locale/en_BW.utf8/LC_MEASUREMENT +#static/usr/lib/locale/en_BW.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_BW.utf8/LC_MONETARY +#static/usr/lib/locale/en_BW.utf8/LC_NAME +#static/usr/lib/locale/en_BW.utf8/LC_NUMERIC +#static/usr/lib/locale/en_BW.utf8/LC_PAPER +#static/usr/lib/locale/en_BW.utf8/LC_TELEPHONE +#static/usr/lib/locale/en_BW.utf8/LC_TIME +#static/usr/lib/locale/en_CA.utf8/LC_ADDRESS +#static/usr/lib/locale/en_CA.utf8/LC_COLLATE +#static/usr/lib/locale/en_CA.utf8/LC_CTYPE +#static/usr/lib/locale/en_CA.utf8/LC_IDENTIFICATION +#static/usr/lib/locale/en_CA.utf8/LC_MEASUREMENT +#static/usr/lib/locale/en_CA.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_CA.utf8/LC_MONETARY +#static/usr/lib/locale/en_CA.utf8/LC_NAME +#static/usr/lib/locale/en_CA.utf8/LC_NUMERIC +#static/usr/lib/locale/en_CA.utf8/LC_PAPER +#static/usr/lib/locale/en_CA.utf8/LC_TELEPHONE +#static/usr/lib/locale/en_CA.utf8/LC_TIME +#static/usr/lib/locale/en_DK.utf8/LC_ADDRESS +#static/usr/lib/locale/en_DK.utf8/LC_COLLATE +#static/usr/lib/locale/en_DK.utf8/LC_CTYPE +#static/usr/lib/locale/en_DK.utf8/LC_IDENTIFICATION +#static/usr/lib/locale/en_DK.utf8/LC_MEASUREMENT +#static/usr/lib/locale/en_DK.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_DK.utf8/LC_MONETARY +#static/usr/lib/locale/en_DK.utf8/LC_NAME +#static/usr/lib/locale/en_DK.utf8/LC_NUMERIC +#static/usr/lib/locale/en_DK.utf8/LC_PAPER +#static/usr/lib/locale/en_DK.utf8/LC_TELEPHONE +#static/usr/lib/locale/en_DK.utf8/LC_TIME +#static/usr/lib/locale/en_GB.utf8/LC_ADDRESS +#static/usr/lib/locale/en_GB.utf8/LC_COLLATE +#static/usr/lib/locale/en_GB.utf8/LC_CTYPE +#static/usr/lib/locale/en_GB.utf8/LC_IDENTIFICATION +#static/usr/lib/locale/en_GB.utf8/LC_MEASUREMENT +#static/usr/lib/locale/en_GB.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_GB.utf8/LC_MONETARY +#static/usr/lib/locale/en_GB.utf8/LC_NAME +#static/usr/lib/locale/en_GB.utf8/LC_NUMERIC +#static/usr/lib/locale/en_GB.utf8/LC_PAPER +#static/usr/lib/locale/en_GB.utf8/LC_TELEPHONE +#static/usr/lib/locale/en_GB.utf8/LC_TIME +#static/usr/lib/locale/en_HK.utf8/LC_ADDRESS +#static/usr/lib/locale/en_HK.utf8/LC_COLLATE +#static/usr/lib/locale/en_HK.utf8/LC_CTYPE +#static/usr/lib/locale/en_HK.utf8/LC_IDENTIFICATION +#static/usr/lib/locale/en_HK.utf8/LC_MEASUREMENT +#static/usr/lib/locale/en_HK.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_HK.utf8/LC_MONETARY +#static/usr/lib/locale/en_HK.utf8/LC_NAME +#static/usr/lib/locale/en_HK.utf8/LC_NUMERIC +#static/usr/lib/locale/en_HK.utf8/LC_PAPER +#static/usr/lib/locale/en_HK.utf8/LC_TELEPHONE +#static/usr/lib/locale/en_HK.utf8/LC_TIME +#static/usr/lib/locale/en_IE.utf8/LC_ADDRESS +#static/usr/lib/locale/en_IE.utf8/LC_COLLATE +#static/usr/lib/locale/en_IE.utf8/LC_CTYPE +#static/usr/lib/locale/en_IE.utf8/LC_IDENTIFICATION +#static/usr/lib/locale/en_IE.utf8/LC_MEASUREMENT +#static/usr/lib/locale/en_IE.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_IE.utf8/LC_MONETARY +#static/usr/lib/locale/en_IE.utf8/LC_NAME +#static/usr/lib/locale/en_IE.utf8/LC_NUMERIC +#static/usr/lib/locale/en_IE.utf8/LC_PAPER +#static/usr/lib/locale/en_IE.utf8/LC_TELEPHONE +#static/usr/lib/locale/en_IE.utf8/LC_TIME +#static/usr/lib/locale/en_IN/LC_ADDRESS +#static/usr/lib/locale/en_IN/LC_COLLATE +#static/usr/lib/locale/en_IN/LC_CTYPE +#static/usr/lib/locale/en_IN/LC_IDENTIFICATION +#static/usr/lib/locale/en_IN/LC_MEASUREMENT +#static/usr/lib/locale/en_IN/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_IN/LC_MONETARY +#static/usr/lib/locale/en_IN/LC_NAME +#static/usr/lib/locale/en_IN/LC_NUMERIC +#static/usr/lib/locale/en_IN/LC_PAPER +#static/usr/lib/locale/en_IN/LC_TELEPHONE +#static/usr/lib/locale/en_IN/LC_TIME +#static/usr/lib/locale/en_NG/LC_ADDRESS +#static/usr/lib/locale/en_NG/LC_COLLATE +#static/usr/lib/locale/en_NG/LC_CTYPE +#static/usr/lib/locale/en_NG/LC_IDENTIFICATION +#static/usr/lib/locale/en_NG/LC_MEASUREMENT +#static/usr/lib/locale/en_NG/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_NG/LC_MONETARY +#static/usr/lib/locale/en_NG/LC_NAME +#static/usr/lib/locale/en_NG/LC_NUMERIC +#static/usr/lib/locale/en_NG/LC_PAPER +#static/usr/lib/locale/en_NG/LC_TELEPHONE +#static/usr/lib/locale/en_NG/LC_TIME +#static/usr/lib/locale/en_NZ.utf8/LC_ADDRESS +#static/usr/lib/locale/en_NZ.utf8/LC_COLLATE +#static/usr/lib/locale/en_NZ.utf8/LC_CTYPE +#static/usr/lib/locale/en_NZ.utf8/LC_IDENTIFICATION +#static/usr/lib/locale/en_NZ.utf8/LC_MEASUREMENT +#static/usr/lib/locale/en_NZ.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_NZ.utf8/LC_MONETARY +#static/usr/lib/locale/en_NZ.utf8/LC_NAME +#static/usr/lib/locale/en_NZ.utf8/LC_NUMERIC +#static/usr/lib/locale/en_NZ.utf8/LC_PAPER +#static/usr/lib/locale/en_NZ.utf8/LC_TELEPHONE +#static/usr/lib/locale/en_NZ.utf8/LC_TIME +#static/usr/lib/locale/en_PH.utf8/LC_ADDRESS +#static/usr/lib/locale/en_PH.utf8/LC_COLLATE +#static/usr/lib/locale/en_PH.utf8/LC_CTYPE +#static/usr/lib/locale/en_PH.utf8/LC_IDENTIFICATION +#static/usr/lib/locale/en_PH.utf8/LC_MEASUREMENT +#static/usr/lib/locale/en_PH.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_PH.utf8/LC_MONETARY +#static/usr/lib/locale/en_PH.utf8/LC_NAME +#static/usr/lib/locale/en_PH.utf8/LC_NUMERIC +#static/usr/lib/locale/en_PH.utf8/LC_PAPER +#static/usr/lib/locale/en_PH.utf8/LC_TELEPHONE +#static/usr/lib/locale/en_PH.utf8/LC_TIME +#static/usr/lib/locale/en_SG.utf8/LC_ADDRESS +#static/usr/lib/locale/en_SG.utf8/LC_COLLATE +#static/usr/lib/locale/en_SG.utf8/LC_CTYPE +#static/usr/lib/locale/en_SG.utf8/LC_IDENTIFICATION +#static/usr/lib/locale/en_SG.utf8/LC_MEASUREMENT +#static/usr/lib/locale/en_SG.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_SG.utf8/LC_MONETARY +#static/usr/lib/locale/en_SG.utf8/LC_NAME +#static/usr/lib/locale/en_SG.utf8/LC_NUMERIC +#static/usr/lib/locale/en_SG.utf8/LC_PAPER +#static/usr/lib/locale/en_SG.utf8/LC_TELEPHONE +#static/usr/lib/locale/en_SG.utf8/LC_TIME +#static/usr/lib/locale/en_US.utf8/LC_ADDRESS +#static/usr/lib/locale/en_US.utf8/LC_COLLATE +#static/usr/lib/locale/en_US.utf8/LC_CTYPE +#static/usr/lib/locale/en_US.utf8/LC_IDENTIFICATION +#static/usr/lib/locale/en_US.utf8/LC_MEASUREMENT +#static/usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_US.utf8/LC_MONETARY +#static/usr/lib/locale/en_US.utf8/LC_NAME +#static/usr/lib/locale/en_US.utf8/LC_NUMERIC +#static/usr/lib/locale/en_US.utf8/LC_PAPER +#static/usr/lib/locale/en_US.utf8/LC_TELEPHONE +#static/usr/lib/locale/en_US.utf8/LC_TIME +#static/usr/lib/locale/en_ZA.utf8/LC_ADDRESS +#static/usr/lib/locale/en_ZA.utf8/LC_COLLATE +#static/usr/lib/locale/en_ZA.utf8/LC_CTYPE +#static/usr/lib/locale/en_ZA.utf8/LC_IDENTIFICATION +#static/usr/lib/locale/en_ZA.utf8/LC_MEASUREMENT +#static/usr/lib/locale/en_ZA.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_ZA.utf8/LC_MONETARY +#static/usr/lib/locale/en_ZA.utf8/LC_NAME +#static/usr/lib/locale/en_ZA.utf8/LC_NUMERIC +#static/usr/lib/locale/en_ZA.utf8/LC_PAPER +#static/usr/lib/locale/en_ZA.utf8/LC_TELEPHONE +#static/usr/lib/locale/en_ZA.utf8/LC_TIME +#static/usr/lib/locale/en_ZW.utf8/LC_ADDRESS +#static/usr/lib/locale/en_ZW.utf8/LC_COLLATE +#static/usr/lib/locale/en_ZW.utf8/LC_CTYPE +#static/usr/lib/locale/en_ZW.utf8/LC_IDENTIFICATION +#static/usr/lib/locale/en_ZW.utf8/LC_MEASUREMENT +#static/usr/lib/locale/en_ZW.utf8/LC_MESSAGES/SYS_LC_MESSAGES +#static/usr/lib/locale/en_ZW.utf8/LC_MONETARY +#static/usr/lib/locale/en_ZW.utf8/LC_NAME +#static/usr/lib/locale/en_ZW.utf8/LC_NUMERIC +#static/usr/lib/locale/en_ZW.utf8/LC_PAPER +#static/usr/lib/locale/en_ZW.utf8/LC_TELEPHONE +#static/usr/lib/locale/en_ZW.utf8/LC_TIME +static/usr/sbin/fsck.hfs +static/usr/sbin/fsck.hfsplus +static/usr/share/curl/ca-bundle.crt +target/bin/lsof +target/bin/ps +target/etc/avahi/avahi-daemon.conf +target/etc/avahi/avahi-dnsconfd.action +target/etc/avahi/hosts +target/etc/fonts +target/etc/fonts/fonts.dtd +target/etc/fonts/conf.d +target/etc/fonts/conf.d/80-delicious.conf +target/etc/fonts/conf.d/30-urw-aliases.conf +target/etc/fonts/conf.d/65-fonts-persian.conf +target/etc/fonts/conf.d/30-metric-aliases.conf +target/etc/fonts/conf.d/60-latin.conf +target/etc/fonts/conf.d/49-sansserif.conf +target/etc/fonts/conf.d/README +target/etc/fonts/conf.d/51-local.conf +target/etc/fonts/conf.d/40-nonlatin.conf +target/etc/fonts/conf.d/69-unifont.conf +target/etc/fonts/conf.d/90-synthetic.conf +target/etc/fonts/conf.d/20-unhint-small-vera.conf +target/etc/fonts/conf.d/50-user.conf +target/etc/fonts/conf.d/20-fix-globaladvance.conf +target/etc/fonts/conf.d/65-nonlatin.conf +target/etc/fonts/conf.d/45-latin.conf +target/etc/fonts/conf.avail +target/etc/fonts/conf.avail/80-delicious.conf +target/etc/fonts/conf.avail/65-khmer.conf +target/etc/fonts/conf.avail/10-no-sub-pixel.conf +target/etc/fonts/conf.avail/30-urw-aliases.conf +target/etc/fonts/conf.avail/10-sub-pixel-rgb.conf +target/etc/fonts/conf.avail/65-fonts-persian.conf +target/etc/fonts/conf.avail/30-metric-aliases.conf +target/etc/fonts/conf.avail/10-sub-pixel-vrgb.conf +target/etc/fonts/conf.avail/60-latin.conf +target/etc/fonts/conf.avail/10-autohint.conf +target/etc/fonts/conf.avail/70-yes-bitmaps.conf +target/etc/fonts/conf.avail/49-sansserif.conf +target/etc/fonts/conf.avail/10-unhinted.conf +target/etc/fonts/conf.avail/70-no-bitmaps.conf +target/etc/fonts/conf.avail/51-local.conf +target/etc/fonts/conf.avail/40-nonlatin.conf +target/etc/fonts/conf.avail/25-unhint-nonlatin.conf +target/etc/fonts/conf.avail/10-sub-pixel-bgr.conf +target/etc/fonts/conf.avail/69-unifont.conf +target/etc/fonts/conf.avail/90-synthetic.conf +target/etc/fonts/conf.avail/20-unhint-small-vera.conf +target/etc/fonts/conf.avail/50-user.conf +target/etc/fonts/conf.avail/20-fix-globaladvance.conf +target/etc/fonts/conf.avail/10-sub-pixel-vbgr.conf +target/etc/fonts/conf.avail/65-nonlatin.conf +target/etc/fonts/conf.avail/45-latin.conf +target/etc/fonts/fonts.conf +#target/etc/dbus-1/session.conf +target/etc/lircd.conf +target/lib/libproc-3.2.8.so +target/lib/modules/2.6.35/lirc_dev.ko +target/lib/modules/2.6.35/lirc_mceusb.ko +target/lib/modules/2.6.35/ramzswap.ko +target/sbin/rzscontrol +target/sbin/iwlist +target/sbin/iwconfig +target/usr/bin/afp_client +target/usr/bin/afpfsd +target/usr/bin/curl +target/usr/bin/dbus-cleanup-sockets +target/usr/bin/dbus-daemon +target/usr/bin/dbus-launch +target/usr/bin/dbus-monitor +target/usr/bin/dbus-send +target/usr/bin/dbus-uuidgen +target/usr/bin/djmount +target/usr/bin/irw +target/usr/bin/mount_afp +target/usr/bin/ntfs-3g +target/usr/bin/ntfs-3g.probe +target/usr/bin/ntfs-3g.secaudit +target/usr/bin/ntfs-3g.usermap +target/usr/bin/ntpdate +target/usr/bin/smbcontrol +target/usr/bin/smbpasswd +target/usr/bin/smbstatus +target/usr/bin/strace +target/usr/bin/testparm +target/usr/bin/top +target/usr/bin/xml +target/usr/bin/xmlstarlet +target/usr/lib/libafpclient.so +target/usr/lib/libafpclient.so.0 +target/usr/lib/libafpclient.so.0.0.0 +target/usr/lib/libavahi-client.so +target/usr/lib/libavahi-client.so.3 +target/usr/lib/libavahi-client.so.3.2.9 +target/usr/lib/libavahi-common.so +target/usr/lib/libavahi-common.so.3 +target/usr/lib/libavahi-common.so.3.5.3 +target/usr/lib/libavahi-core.so +target/usr/lib/libavahi-core.so.7 +target/usr/lib/libavahi-core.so.7.0.2 +target/usr/lib/libblkid.so +target/usr/lib/libblkid.so.1 +target/usr/lib/libblkid.so.1.0 +target/usr/lib/libcares.so +target/usr/lib/libcares.so.2 +target/usr/lib/libcares.so.2.0.0 +target/usr/lib/libcharset.so +target/usr/lib/libcharset.so.1 +target/usr/lib/libcharset.so.1.0.0 +target/usr/lib/libcom_err.so +target/usr/lib/libcom_err.so.2 +target/usr/lib/libcom_err.so.2.1 +target/usr/lib/libcrypto.so +target/usr/lib/libcrypto.so.1.0.0 +target/usr/lib/libcurl.so +target/usr/lib/libcurl.so.4 +target/usr/lib/libcurl.so.4.2.0 +target/usr/lib/libdaemon.so +target/usr/lib/libdaemon.so.0 +target/usr/lib/libdaemon.so.0.5.0 +target/usr/lib/libdbus-1.so +target/usr/lib/libdbus-1.so.3 +target/usr/lib/libdbus-1.so.3.5.7 +target/usr/lib/libexpat.so +target/usr/lib/libexpat.so.1 +target/usr/lib/libexpat.so.1.5.2 +target/usr/lib/libexslt.so +target/usr/lib/libexslt.so.0 +target/usr/lib/libexslt.so.0.8.15 +target/usr/lib/libext2fs.so +target/usr/lib/libext2fs.so.2.4 +target/usr/lib/libext2fs.so.2 +target/usr/lib/libfaad.so +target/usr/lib/libfaad.so.2 +target/usr/lib/libfaad.so.2.0.0 +#target/usr/lib/libFLAC++.so +target/usr/lib/libFLAC.so +#target/usr/lib/libFLAC++.so.6 +#target/usr/lib/libFLAC++.so.6.2.0 +target/usr/lib/libFLAC.so.8 +target/usr/lib/libFLAC.so.8.2.0 +target/usr/lib/libfontconfig.so +target/usr/lib/libfontconfig.so.1 +target/usr/lib/libfontconfig.so.1.3.0 +target/usr/lib/libfreetype.so +target/usr/lib/libfreetype.so.6 +target/usr/lib/libfreetype.so.6.6.2 +target/usr/lib/libfribidi.so +target/usr/lib/libfribidi.so.0 +target/usr/lib/libfribidi.so.0.3.1 +target/usr/lib/libfuse.so +target/usr/lib/libfuse.so.2 +target/usr/lib/libfuse.so.2.8.5 +target/usr/lib/libgcrypt.so +target/usr/lib/libgcrypt.so.11 +target/usr/lib/libgcrypt.so.11.6.0 +target/usr/lib/libgdbm.so +target/usr/lib/libgdbm.so.3 +target/usr/lib/libgdbm.so.3.0.0 +target/usr/lib/libgio-2.0.so +target/usr/lib/libgio-2.0.so.0 +target/usr/lib/libgio-2.0.so.0.2800.6 +target/usr/lib/libglib-2.0.so +target/usr/lib/libglib-2.0.so.0 +target/usr/lib/libglib-2.0.so.0.2800.6 +target/usr/lib/libgmodule-2.0.so +target/usr/lib/libgmodule-2.0.so.0 +target/usr/lib/libgmodule-2.0.so.0.2800.6 +target/usr/lib/libgobject-2.0.so +target/usr/lib/libgobject-2.0.so.0 +target/usr/lib/libgobject-2.0.so.0.2800.6 +target/usr/lib/libgpg-error.so +target/usr/lib/libgpg-error.so.0 +target/usr/lib/libgpg-error.so.0.6.0 +target/usr/lib/libgthread-2.0.so +target/usr/lib/libgthread-2.0.so.0 +target/usr/lib/libgthread-2.0.so.0.2800.6 +target/usr/lib/libiconv.so.2 +target/usr/lib/libiconv.so.2.5.0 +target/usr/lib/libidn.so +target/usr/lib/libidn.so.11 +target/usr/lib/libidn.so.11.6.5 +target/usr/lib/libjpeg.so +target/usr/lib/libjpeg.so.8 +target/usr/lib/libjpeg.so.8.0.2 +target/usr/lib/liblzo2.so +target/usr/lib/liblzo2.so.2 +target/usr/lib/liblzo2.so.2.0.0 +target/usr/lib/libmad.so +target/usr/lib/libmad.so.0 +target/usr/lib/libmad.so.0.2.1 +target/usr/lib/libmms.so +target/usr/lib/libmms.so.0 +target/usr/lib/libmms.so.0.0.2 +target/usr/lib/libnss_mdns4_minimal.so.2 +target/usr/lib/libnss_mdns4.so.2 +target/usr/lib/libnss_mdns6_minimal.so.2 +target/usr/lib/libnss_mdns6.so.2 +target/usr/lib/libnss_mdns_minimal.so.2 +target/usr/lib/libnss_mdns.so.2 +target/usr/lib/libntfs-3g.so +target/usr/lib/libntfs-3g.so.80 +target/usr/lib/libntfs-3g.so.80.0.0 +target/usr/lib/libogg.so +target/usr/lib/libogg.so.0 +target/usr/lib/libogg.so.0.7.1 +target/usr/lib/libpcrecpp.so +target/usr/lib/libpcrecpp.so.0 +target/usr/lib/libpcrecpp.so.0.0.0 +target/usr/lib/libpcreposix.so +target/usr/lib/libpcreposix.so.0 +target/usr/lib/libpcreposix.so.0.0.0 +target/usr/lib/libpcre.so +target/usr/lib/libpcre.so.0 +target/usr/lib/libpcre.so.0.0.1 +target/usr/lib/libpng14.so +target/usr/lib/libpng14.so.14 +target/usr/lib/libpng14.so.14.7.0 +target/usr/lib/libreadline.so +target/usr/lib/libreadline.so.6 +target/usr/lib/libreadline.so.6.2 +target/usr/lib/libsamplerate.so +target/usr/lib/libsamplerate.so.0 +target/usr/lib/libsamplerate.so.0.1.7 +target/usr/lib/libSDL-1.2.so.0 +target/usr/lib/libSDL-1.2.so.0.11.3 +target/usr/lib/libSDL.so +#target/usr/lib/libsmbclient.so +#target/usr/lib/libsmbclient.so.0 +target/usr/lib/libsqlite3.so +target/usr/lib/libsqlite3.so.0 +target/usr/lib/libsqlite3.so.0.8.6 +target/usr/lib/libssl.so +target/usr/lib/libssl.so.1.0.0 +target/usr/lib/libthreadutil.so +target/usr/lib/libthreadutil.so.6 +target/usr/lib/libthreadutil.so.6.0.0 +target/usr/lib/libtiff.so +target/usr/lib/libtiff.so.3 +target/usr/lib/libtiff.so.3.9.4 +#target/usr/lib/libtiffxx.so +#target/usr/lib/libtiffxx.so.3 +#target/usr/lib/libtiffxx.so.3.9.4 +target/usr/lib/libuuid.so +target/usr/lib/libuuid.so.1 +target/usr/lib/libuuid.so.1.2 +target/usr/lib/libvorbisenc.so +target/usr/lib/libvorbisenc.so.2 +target/usr/lib/libvorbisenc.so.2.0.8 +target/usr/lib/libvorbisfile.so +target/usr/lib/libvorbisfile.so.3 +target/usr/lib/libvorbisfile.so.3.3.4 +target/usr/lib/libvorbis.so +target/usr/lib/libvorbis.so.0 +target/usr/lib/libvorbis.so.0.4.5 +target/usr/lib/libvpx.so +target/usr/lib/libvpx.so.0 +target/usr/lib/libvpx.so.0.9.6 +target/usr/lib/libxml2.so +target/usr/lib/libxml2.so.2 +target/usr/lib/libxml2.so.2.7.8 +target/usr/lib/libxslt.so +target/usr/lib/libxslt.so.1 +target/usr/lib/libxslt.so.1.1.26 +target/usr/lib/python2.4/lib-dynload/array.so +target/usr/lib/python2.4/lib-dynload/audioop.so +target/usr/lib/python2.4/lib-dynload/binascii.so +target/usr/lib/python2.4/lib-dynload/_bisect.so +target/usr/lib/python2.4/lib-dynload/bz2.so +target/usr/lib/python2.4/lib-dynload/cmath.so +target/usr/lib/python2.4/lib-dynload/_codecs_cn.so +target/usr/lib/python2.4/lib-dynload/_codecs_hk.so +target/usr/lib/python2.4/lib-dynload/_codecs_iso2022.so +target/usr/lib/python2.4/lib-dynload/_codecs_jp.so +target/usr/lib/python2.4/lib-dynload/_codecs_kr.so +target/usr/lib/python2.4/lib-dynload/_codecs_tw.so +target/usr/lib/python2.4/lib-dynload/collections.so +target/usr/lib/python2.4/lib-dynload/cPickle.so +target/usr/lib/python2.4/lib-dynload/crypt.so +target/usr/lib/python2.4/lib-dynload/cStringIO.so +target/usr/lib/python2.4/lib-dynload/_csv.so +target/usr/lib/python2.4/lib-dynload/datetime.so +target/usr/lib/python2.4/lib-dynload/dl.so +target/usr/lib/python2.4/lib-dynload/fcntl.so +target/usr/lib/python2.4/lib-dynload/grp.so +target/usr/lib/python2.4/lib-dynload/_heapq.so +target/usr/lib/python2.4/lib-dynload/_hotshot.so +target/usr/lib/python2.4/lib-dynload/imageop.so +target/usr/lib/python2.4/lib-dynload/itertools.so +target/usr/lib/python2.4/lib-dynload/linuxaudiodev.so +target/usr/lib/python2.4/lib-dynload/_locale.so +target/usr/lib/python2.4/lib-dynload/math.so +target/usr/lib/python2.4/lib-dynload/md5.so +target/usr/lib/python2.4/lib-dynload/mmap.so +target/usr/lib/python2.4/lib-dynload/_multibytecodec.so +target/usr/lib/python2.4/lib-dynload/nis.so +target/usr/lib/python2.4/lib-dynload/operator.so +target/usr/lib/python2.4/lib-dynload/ossaudiodev.so +target/usr/lib/python2.4/lib-dynload/parser.so +target/usr/lib/python2.4/lib-dynload/pyexpat.so +target/usr/lib/python2.4/lib-dynload/_random.so +target/usr/lib/python2.4/lib-dynload/readline.so +target/usr/lib/python2.4/lib-dynload/regex.so +target/usr/lib/python2.4/lib-dynload/resource.so +target/usr/lib/python2.4/lib-dynload/rgbimg.so +target/usr/lib/python2.4/lib-dynload/select.so +target/usr/lib/python2.4/lib-dynload/sha.so +target/usr/lib/python2.4/lib-dynload/_socket.so +target/usr/lib/python2.4/lib-dynload/_ssl.so +target/usr/lib/python2.4/lib-dynload/strop.so +target/usr/lib/python2.4/lib-dynload/struct.so +target/usr/lib/python2.4/lib-dynload/syslog.so +target/usr/lib/python2.4/lib-dynload/termios.so +target/usr/lib/python2.4/lib-dynload/_testcapi.so +target/usr/lib/python2.4/lib-dynload/time.so +target/usr/lib/python2.4/lib-dynload/timing.so +target/usr/lib/python2.4/lib-dynload/unicodedata.so +target/usr/lib/python2.4/lib-dynload/_weakref.so +target/usr/lib/python2.4/lib-dynload/zlib.so +target/usr/lib/python2.4/python24.zip +target/usr/sbin/avahi-daemon +target/usr/sbin/avahi-dnsconfd +target/usr/sbin/blkid +target/usr/sbin/lircd +target/usr/sbin/mount.cifs +target/usr/sbin/nmbd +target/usr/sbin/ntpd +target/usr/sbin/pppd +target/usr/sbin/pptp +target/usr/sbin/showmount +target/usr/sbin/smbd +target/usr/sbin/tune2fs +target/usr/sbin/umount.cifs +#target/usr/sbin/wl +target/usr/share/zoneinfo/Africa/Abidjan +target/usr/share/zoneinfo/Africa/Accra +target/usr/share/zoneinfo/Africa/Addis_Ababa +target/usr/share/zoneinfo/Africa/Algiers +target/usr/share/zoneinfo/Africa/Asmara +target/usr/share/zoneinfo/Africa/Asmera +target/usr/share/zoneinfo/Africa/Bamako +target/usr/share/zoneinfo/Africa/Bangui +target/usr/share/zoneinfo/Africa/Banjul +target/usr/share/zoneinfo/Africa/Bissau +target/usr/share/zoneinfo/Africa/Blantyre +target/usr/share/zoneinfo/Africa/Brazzaville +target/usr/share/zoneinfo/Africa/Bujumbura +target/usr/share/zoneinfo/Africa/Cairo +target/usr/share/zoneinfo/Africa/Casablanca +target/usr/share/zoneinfo/Africa/Ceuta +target/usr/share/zoneinfo/Africa/Conakry +target/usr/share/zoneinfo/Africa/Dakar +target/usr/share/zoneinfo/Africa/Dar_es_Salaam +target/usr/share/zoneinfo/Africa/Djibouti +target/usr/share/zoneinfo/Africa/Douala +target/usr/share/zoneinfo/Africa/El_Aaiun +target/usr/share/zoneinfo/Africa/Freetown +target/usr/share/zoneinfo/Africa/Gaborone +target/usr/share/zoneinfo/Africa/Harare +target/usr/share/zoneinfo/Africa/Johannesburg +target/usr/share/zoneinfo/Africa/Kampala +target/usr/share/zoneinfo/Africa/Khartoum +target/usr/share/zoneinfo/Africa/Kigali +target/usr/share/zoneinfo/Africa/Kinshasa +target/usr/share/zoneinfo/Africa/Lagos +target/usr/share/zoneinfo/Africa/Libreville +target/usr/share/zoneinfo/Africa/Lome +target/usr/share/zoneinfo/Africa/Luanda +target/usr/share/zoneinfo/Africa/Lubumbashi +target/usr/share/zoneinfo/Africa/Lusaka +target/usr/share/zoneinfo/Africa/Malabo +target/usr/share/zoneinfo/Africa/Maputo +target/usr/share/zoneinfo/Africa/Maseru +target/usr/share/zoneinfo/Africa/Mbabane +target/usr/share/zoneinfo/Africa/Mogadishu +target/usr/share/zoneinfo/Africa/Monrovia +target/usr/share/zoneinfo/Africa/Nairobi +target/usr/share/zoneinfo/Africa/Ndjamena +target/usr/share/zoneinfo/Africa/Niamey +target/usr/share/zoneinfo/Africa/Nouakchott +target/usr/share/zoneinfo/Africa/Ouagadougou +target/usr/share/zoneinfo/Africa/Porto-Novo +target/usr/share/zoneinfo/Africa/Sao_Tome +target/usr/share/zoneinfo/Africa/Timbuktu +target/usr/share/zoneinfo/Africa/Tripoli +target/usr/share/zoneinfo/Africa/Tunis +target/usr/share/zoneinfo/Africa/Windhoek +target/usr/share/zoneinfo/America/Adak +target/usr/share/zoneinfo/America/Anchorage +target/usr/share/zoneinfo/America/Anguilla +target/usr/share/zoneinfo/America/Antigua +target/usr/share/zoneinfo/America/Araguaina +target/usr/share/zoneinfo/America/Argentina/Buenos_Aires +target/usr/share/zoneinfo/America/Argentina/Catamarca +target/usr/share/zoneinfo/America/Argentina/ComodRivadavia +target/usr/share/zoneinfo/America/Argentina/Cordoba +target/usr/share/zoneinfo/America/Argentina/Jujuy +target/usr/share/zoneinfo/America/Argentina/La_Rioja +target/usr/share/zoneinfo/America/Argentina/Mendoza +target/usr/share/zoneinfo/America/Argentina/Rio_Gallegos +target/usr/share/zoneinfo/America/Argentina/Salta +target/usr/share/zoneinfo/America/Argentina/San_Juan +target/usr/share/zoneinfo/America/Argentina/San_Luis +target/usr/share/zoneinfo/America/Argentina/Tucuman +target/usr/share/zoneinfo/America/Argentina/Ushuaia +target/usr/share/zoneinfo/America/Aruba +target/usr/share/zoneinfo/America/Asuncion +target/usr/share/zoneinfo/America/Atikokan +target/usr/share/zoneinfo/America/Atka +target/usr/share/zoneinfo/America/Bahia +target/usr/share/zoneinfo/America/Bahia_Banderas +target/usr/share/zoneinfo/America/Barbados +target/usr/share/zoneinfo/America/Belem +target/usr/share/zoneinfo/America/Belize +target/usr/share/zoneinfo/America/Blanc-Sablon +target/usr/share/zoneinfo/America/Boa_Vista +target/usr/share/zoneinfo/America/Bogota +target/usr/share/zoneinfo/America/Boise +target/usr/share/zoneinfo/America/Buenos_Aires +target/usr/share/zoneinfo/America/Cambridge_Bay +target/usr/share/zoneinfo/America/Campo_Grande +target/usr/share/zoneinfo/America/Cancun +target/usr/share/zoneinfo/America/Caracas +target/usr/share/zoneinfo/America/Catamarca +target/usr/share/zoneinfo/America/Cayenne +target/usr/share/zoneinfo/America/Cayman +target/usr/share/zoneinfo/America/Chicago +target/usr/share/zoneinfo/America/Chihuahua +target/usr/share/zoneinfo/America/Coral_Harbour +target/usr/share/zoneinfo/America/Cordoba +target/usr/share/zoneinfo/America/Costa_Rica +target/usr/share/zoneinfo/America/Cuiaba +target/usr/share/zoneinfo/America/Curacao +target/usr/share/zoneinfo/America/Danmarkshavn +target/usr/share/zoneinfo/America/Dawson +target/usr/share/zoneinfo/America/Dawson_Creek +target/usr/share/zoneinfo/America/Denver +target/usr/share/zoneinfo/America/Detroit +target/usr/share/zoneinfo/America/Dominica +target/usr/share/zoneinfo/America/Edmonton +target/usr/share/zoneinfo/America/Eirunepe +target/usr/share/zoneinfo/America/El_Salvador +target/usr/share/zoneinfo/America/Ensenada +target/usr/share/zoneinfo/America/Fortaleza +target/usr/share/zoneinfo/America/Fort_Wayne +target/usr/share/zoneinfo/America/Glace_Bay +target/usr/share/zoneinfo/America/Godthab +target/usr/share/zoneinfo/America/Goose_Bay +target/usr/share/zoneinfo/America/Grand_Turk +target/usr/share/zoneinfo/America/Grenada +target/usr/share/zoneinfo/America/Guadeloupe +target/usr/share/zoneinfo/America/Guatemala +target/usr/share/zoneinfo/America/Guayaquil +target/usr/share/zoneinfo/America/Guyana +target/usr/share/zoneinfo/America/Halifax +target/usr/share/zoneinfo/America/Havana +target/usr/share/zoneinfo/America/Hermosillo +target/usr/share/zoneinfo/America/Indiana/Indianapolis +target/usr/share/zoneinfo/America/Indiana/Knox +target/usr/share/zoneinfo/America/Indiana/Marengo +target/usr/share/zoneinfo/America/Indiana/Petersburg +target/usr/share/zoneinfo/America/Indianapolis +target/usr/share/zoneinfo/America/Indiana/Tell_City +target/usr/share/zoneinfo/America/Indiana/Vevay +target/usr/share/zoneinfo/America/Indiana/Vincennes +target/usr/share/zoneinfo/America/Indiana/Winamac +target/usr/share/zoneinfo/America/Inuvik +target/usr/share/zoneinfo/America/Iqaluit +target/usr/share/zoneinfo/America/Jamaica +target/usr/share/zoneinfo/America/Jujuy +target/usr/share/zoneinfo/America/Juneau +target/usr/share/zoneinfo/America/Kentucky/Louisville +target/usr/share/zoneinfo/America/Kentucky/Monticello +target/usr/share/zoneinfo/America/Knox_IN +target/usr/share/zoneinfo/America/Kralendijk +target/usr/share/zoneinfo/America/La_Paz +target/usr/share/zoneinfo/America/Lima +target/usr/share/zoneinfo/America/Los_Angeles +target/usr/share/zoneinfo/America/Louisville +target/usr/share/zoneinfo/America/Lower_Princes +target/usr/share/zoneinfo/America/Maceio +target/usr/share/zoneinfo/America/Managua +target/usr/share/zoneinfo/America/Manaus +target/usr/share/zoneinfo/America/Marigot +target/usr/share/zoneinfo/America/Martinique +target/usr/share/zoneinfo/America/Matamoros +target/usr/share/zoneinfo/America/Mazatlan +target/usr/share/zoneinfo/America/Mendoza +target/usr/share/zoneinfo/America/Menominee +target/usr/share/zoneinfo/America/Merida +target/usr/share/zoneinfo/America/Metlakatla +target/usr/share/zoneinfo/America/Mexico_City +target/usr/share/zoneinfo/America/Miquelon +target/usr/share/zoneinfo/America/Moncton +target/usr/share/zoneinfo/America/Monterrey +target/usr/share/zoneinfo/America/Montevideo +target/usr/share/zoneinfo/America/Montreal +target/usr/share/zoneinfo/America/Montserrat +target/usr/share/zoneinfo/America/Nassau +target/usr/share/zoneinfo/America/New_York +target/usr/share/zoneinfo/America/Nipigon +target/usr/share/zoneinfo/America/Nome +target/usr/share/zoneinfo/America/Noronha +target/usr/share/zoneinfo/America/North_Dakota/Beulah +target/usr/share/zoneinfo/America/North_Dakota/Center +target/usr/share/zoneinfo/America/North_Dakota/New_Salem +target/usr/share/zoneinfo/America/Ojinaga +target/usr/share/zoneinfo/America/Panama +target/usr/share/zoneinfo/America/Pangnirtung +target/usr/share/zoneinfo/America/Paramaribo +target/usr/share/zoneinfo/America/Phoenix +target/usr/share/zoneinfo/America/Port-au-Prince +target/usr/share/zoneinfo/America/Porto_Acre +target/usr/share/zoneinfo/America/Port_of_Spain +target/usr/share/zoneinfo/America/Porto_Velho +target/usr/share/zoneinfo/America/Puerto_Rico +target/usr/share/zoneinfo/America/Rainy_River +target/usr/share/zoneinfo/America/Rankin_Inlet +target/usr/share/zoneinfo/America/Recife +target/usr/share/zoneinfo/America/Regina +target/usr/share/zoneinfo/America/Resolute +target/usr/share/zoneinfo/America/Rio_Branco +target/usr/share/zoneinfo/America/Rosario +target/usr/share/zoneinfo/America/Santa_Isabel +target/usr/share/zoneinfo/America/Santarem +target/usr/share/zoneinfo/America/Santiago +target/usr/share/zoneinfo/America/Santo_Domingo +target/usr/share/zoneinfo/America/Sao_Paulo +target/usr/share/zoneinfo/America/Scoresbysund +target/usr/share/zoneinfo/America/Shiprock +target/usr/share/zoneinfo/America/Sitka +target/usr/share/zoneinfo/America/St_Barthelemy +target/usr/share/zoneinfo/America/St_Johns +target/usr/share/zoneinfo/America/St_Kitts +target/usr/share/zoneinfo/America/St_Lucia +target/usr/share/zoneinfo/America/St_Thomas +target/usr/share/zoneinfo/America/St_Vincent +target/usr/share/zoneinfo/America/Swift_Current +target/usr/share/zoneinfo/America/Tegucigalpa +target/usr/share/zoneinfo/America/Thule +target/usr/share/zoneinfo/America/Thunder_Bay +target/usr/share/zoneinfo/America/Tijuana +target/usr/share/zoneinfo/America/Toronto +target/usr/share/zoneinfo/America/Tortola +target/usr/share/zoneinfo/America/Vancouver +target/usr/share/zoneinfo/America/Virgin +target/usr/share/zoneinfo/America/Whitehorse +target/usr/share/zoneinfo/America/Winnipeg +target/usr/share/zoneinfo/America/Yakutat +target/usr/share/zoneinfo/America/Yellowknife +target/usr/share/zoneinfo/Antarctica/Casey +target/usr/share/zoneinfo/Antarctica/Davis +target/usr/share/zoneinfo/Antarctica/DumontDUrville +target/usr/share/zoneinfo/Antarctica/Macquarie +target/usr/share/zoneinfo/Antarctica/Mawson +target/usr/share/zoneinfo/Antarctica/McMurdo +target/usr/share/zoneinfo/Antarctica/Palmer +target/usr/share/zoneinfo/Antarctica/Rothera +target/usr/share/zoneinfo/Antarctica/South_Pole +target/usr/share/zoneinfo/Antarctica/Syowa +target/usr/share/zoneinfo/Antarctica/Vostok +target/usr/share/zoneinfo/Arctic/Longyearbyen +target/usr/share/zoneinfo/Asia/Aden +target/usr/share/zoneinfo/Asia/Almaty +target/usr/share/zoneinfo/Asia/Amman +target/usr/share/zoneinfo/Asia/Anadyr +target/usr/share/zoneinfo/Asia/Aqtau +target/usr/share/zoneinfo/Asia/Aqtobe +target/usr/share/zoneinfo/Asia/Ashgabat +target/usr/share/zoneinfo/Asia/Ashkhabad +target/usr/share/zoneinfo/Asia/Baghdad +target/usr/share/zoneinfo/Asia/Bahrain +target/usr/share/zoneinfo/Asia/Baku +target/usr/share/zoneinfo/Asia/Bangkok +target/usr/share/zoneinfo/Asia/Beirut +target/usr/share/zoneinfo/Asia/Bishkek +target/usr/share/zoneinfo/Asia/Brunei +target/usr/share/zoneinfo/Asia/Calcutta +target/usr/share/zoneinfo/Asia/Choibalsan +target/usr/share/zoneinfo/Asia/Chongqing +target/usr/share/zoneinfo/Asia/Chungking +target/usr/share/zoneinfo/Asia/Colombo +target/usr/share/zoneinfo/Asia/Dacca +target/usr/share/zoneinfo/Asia/Damascus +target/usr/share/zoneinfo/Asia/Dhaka +target/usr/share/zoneinfo/Asia/Dili +target/usr/share/zoneinfo/Asia/Dubai +target/usr/share/zoneinfo/Asia/Dushanbe +target/usr/share/zoneinfo/Asia/Gaza +target/usr/share/zoneinfo/Asia/Harbin +target/usr/share/zoneinfo/Asia/Ho_Chi_Minh +target/usr/share/zoneinfo/Asia/Hong_Kong +target/usr/share/zoneinfo/Asia/Hovd +target/usr/share/zoneinfo/Asia/Irkutsk +target/usr/share/zoneinfo/Asia/Istanbul +target/usr/share/zoneinfo/Asia/Jakarta +target/usr/share/zoneinfo/Asia/Jayapura +target/usr/share/zoneinfo/Asia/Jerusalem +target/usr/share/zoneinfo/Asia/Kabul +target/usr/share/zoneinfo/Asia/Kamchatka +target/usr/share/zoneinfo/Asia/Karachi +target/usr/share/zoneinfo/Asia/Kashgar +target/usr/share/zoneinfo/Asia/Kathmandu +target/usr/share/zoneinfo/Asia/Katmandu +target/usr/share/zoneinfo/Asia/Kolkata +target/usr/share/zoneinfo/Asia/Krasnoyarsk +target/usr/share/zoneinfo/Asia/Kuala_Lumpur +target/usr/share/zoneinfo/Asia/Kuching +target/usr/share/zoneinfo/Asia/Kuwait +target/usr/share/zoneinfo/Asia/Macao +target/usr/share/zoneinfo/Asia/Macau +target/usr/share/zoneinfo/Asia/Magadan +target/usr/share/zoneinfo/Asia/Makassar +target/usr/share/zoneinfo/Asia/Manila +target/usr/share/zoneinfo/Asia/Muscat +target/usr/share/zoneinfo/Asia/Nicosia +target/usr/share/zoneinfo/Asia/Novokuznetsk +target/usr/share/zoneinfo/Asia/Novosibirsk +target/usr/share/zoneinfo/Asia/Omsk +target/usr/share/zoneinfo/Asia/Oral +target/usr/share/zoneinfo/Asia/Phnom_Penh +target/usr/share/zoneinfo/Asia/Pontianak +target/usr/share/zoneinfo/Asia/Pyongyang +target/usr/share/zoneinfo/Asia/Qatar +target/usr/share/zoneinfo/Asia/Qyzylorda +target/usr/share/zoneinfo/Asia/Rangoon +target/usr/share/zoneinfo/Asia/Riyadh +target/usr/share/zoneinfo/Asia/Saigon +target/usr/share/zoneinfo/Asia/Sakhalin +target/usr/share/zoneinfo/Asia/Samarkand +target/usr/share/zoneinfo/Asia/Seoul +target/usr/share/zoneinfo/Asia/Shanghai +target/usr/share/zoneinfo/Asia/Singapore +target/usr/share/zoneinfo/Asia/Taipei +target/usr/share/zoneinfo/Asia/Tashkent +target/usr/share/zoneinfo/Asia/Tbilisi +target/usr/share/zoneinfo/Asia/Tehran +target/usr/share/zoneinfo/Asia/Tel_Aviv +target/usr/share/zoneinfo/Asia/Thimbu +target/usr/share/zoneinfo/Asia/Thimphu +target/usr/share/zoneinfo/Asia/Tokyo +target/usr/share/zoneinfo/Asia/Ujung_Pandang +target/usr/share/zoneinfo/Asia/Ulaanbaatar +target/usr/share/zoneinfo/Asia/Ulan_Bator +target/usr/share/zoneinfo/Asia/Urumqi +target/usr/share/zoneinfo/Asia/Vientiane +target/usr/share/zoneinfo/Asia/Vladivostok +target/usr/share/zoneinfo/Asia/Yakutsk +target/usr/share/zoneinfo/Asia/Yekaterinburg +target/usr/share/zoneinfo/Asia/Yerevan +target/usr/share/zoneinfo/Atlantic/Azores +target/usr/share/zoneinfo/Atlantic/Bermuda +target/usr/share/zoneinfo/Atlantic/Canary +target/usr/share/zoneinfo/Atlantic/Cape_Verde +target/usr/share/zoneinfo/Atlantic/Faeroe +target/usr/share/zoneinfo/Atlantic/Faroe +target/usr/share/zoneinfo/Atlantic/Jan_Mayen +target/usr/share/zoneinfo/Atlantic/Madeira +target/usr/share/zoneinfo/Atlantic/Reykjavik +target/usr/share/zoneinfo/Atlantic/South_Georgia +target/usr/share/zoneinfo/Atlantic/Stanley +target/usr/share/zoneinfo/Atlantic/St_Helena +target/usr/share/zoneinfo/Australia/ACT +target/usr/share/zoneinfo/Australia/Adelaide +target/usr/share/zoneinfo/Australia/Brisbane +target/usr/share/zoneinfo/Australia/Broken_Hill +target/usr/share/zoneinfo/Australia/Canberra +target/usr/share/zoneinfo/Australia/Currie +target/usr/share/zoneinfo/Australia/Darwin +target/usr/share/zoneinfo/Australia/Eucla +target/usr/share/zoneinfo/Australia/Hobart +target/usr/share/zoneinfo/Australia/LHI +target/usr/share/zoneinfo/Australia/Lindeman +target/usr/share/zoneinfo/Australia/Lord_Howe +target/usr/share/zoneinfo/Australia/Melbourne +target/usr/share/zoneinfo/Australia/North +target/usr/share/zoneinfo/Australia/NSW +target/usr/share/zoneinfo/Australia/Perth +target/usr/share/zoneinfo/Australia/Queensland +target/usr/share/zoneinfo/Australia/South +target/usr/share/zoneinfo/Australia/Sydney +target/usr/share/zoneinfo/Australia/Tasmania +target/usr/share/zoneinfo/Australia/Victoria +target/usr/share/zoneinfo/Australia/West +target/usr/share/zoneinfo/Australia/Yancowinna +target/usr/share/zoneinfo/Brazil/Acre +target/usr/share/zoneinfo/Brazil/DeNoronha +target/usr/share/zoneinfo/Brazil/East +target/usr/share/zoneinfo/Brazil/West +target/usr/share/zoneinfo/Canada/Atlantic +target/usr/share/zoneinfo/Canada/Central +target/usr/share/zoneinfo/Canada/Eastern +target/usr/share/zoneinfo/Canada/East-Saskatchewan +target/usr/share/zoneinfo/Canada/Mountain +target/usr/share/zoneinfo/Canada/Newfoundland +target/usr/share/zoneinfo/Canada/Pacific +target/usr/share/zoneinfo/Canada/Saskatchewan +target/usr/share/zoneinfo/Canada/Yukon +target/usr/share/zoneinfo/CET +target/usr/share/zoneinfo/Chile/Continental +target/usr/share/zoneinfo/Chile/EasterIsland +target/usr/share/zoneinfo/CST6CDT +target/usr/share/zoneinfo/Cuba +target/usr/share/zoneinfo/EET +target/usr/share/zoneinfo/Egypt +target/usr/share/zoneinfo/Eire +target/usr/share/zoneinfo/EST +target/usr/share/zoneinfo/EST5EDT +target/usr/share/zoneinfo/Etc/GMT +target/usr/share/zoneinfo/Etc/GMT0 +target/usr/share/zoneinfo/Etc/GMT-0 +target/usr/share/zoneinfo/Etc/GMT+0 +target/usr/share/zoneinfo/Etc/GMT-1 +target/usr/share/zoneinfo/Etc/GMT+1 +target/usr/share/zoneinfo/Etc/GMT-10 +target/usr/share/zoneinfo/Etc/GMT+10 +target/usr/share/zoneinfo/Etc/GMT-11 +target/usr/share/zoneinfo/Etc/GMT+11 +target/usr/share/zoneinfo/Etc/GMT-12 +target/usr/share/zoneinfo/Etc/GMT+12 +target/usr/share/zoneinfo/Etc/GMT-13 +target/usr/share/zoneinfo/Etc/GMT-14 +target/usr/share/zoneinfo/Etc/GMT-2 +target/usr/share/zoneinfo/Etc/GMT+2 +target/usr/share/zoneinfo/Etc/GMT-3 +target/usr/share/zoneinfo/Etc/GMT+3 +target/usr/share/zoneinfo/Etc/GMT-4 +target/usr/share/zoneinfo/Etc/GMT+4 +target/usr/share/zoneinfo/Etc/GMT-5 +target/usr/share/zoneinfo/Etc/GMT+5 +target/usr/share/zoneinfo/Etc/GMT-6 +target/usr/share/zoneinfo/Etc/GMT+6 +target/usr/share/zoneinfo/Etc/GMT-7 +target/usr/share/zoneinfo/Etc/GMT+7 +target/usr/share/zoneinfo/Etc/GMT-8 +target/usr/share/zoneinfo/Etc/GMT+8 +target/usr/share/zoneinfo/Etc/GMT-9 +target/usr/share/zoneinfo/Etc/GMT+9 +target/usr/share/zoneinfo/Etc/Greenwich +target/usr/share/zoneinfo/Etc/UCT +target/usr/share/zoneinfo/Etc/Universal +target/usr/share/zoneinfo/Etc/UTC +target/usr/share/zoneinfo/Etc/Zulu +target/usr/share/zoneinfo/Europe/Amsterdam +target/usr/share/zoneinfo/Europe/Andorra +target/usr/share/zoneinfo/Europe/Athens +target/usr/share/zoneinfo/Europe/Belfast +target/usr/share/zoneinfo/Europe/Belgrade +target/usr/share/zoneinfo/Europe/Berlin +target/usr/share/zoneinfo/Europe/Bratislava +target/usr/share/zoneinfo/Europe/Brussels +target/usr/share/zoneinfo/Europe/Bucharest +target/usr/share/zoneinfo/Europe/Budapest +target/usr/share/zoneinfo/Europe/Chisinau +target/usr/share/zoneinfo/Europe/Copenhagen +target/usr/share/zoneinfo/Europe/Dublin +target/usr/share/zoneinfo/Europe/Gibraltar +target/usr/share/zoneinfo/Europe/Guernsey +target/usr/share/zoneinfo/Europe/Helsinki +target/usr/share/zoneinfo/Europe/Isle_of_Man +target/usr/share/zoneinfo/Europe/Istanbul +target/usr/share/zoneinfo/Europe/Jersey +target/usr/share/zoneinfo/Europe/Kaliningrad +target/usr/share/zoneinfo/Europe/Kiev +target/usr/share/zoneinfo/Europe/Lisbon +target/usr/share/zoneinfo/Europe/Ljubljana +target/usr/share/zoneinfo/Europe/London +target/usr/share/zoneinfo/Europe/Luxembourg +target/usr/share/zoneinfo/Europe/Madrid +target/usr/share/zoneinfo/Europe/Malta +target/usr/share/zoneinfo/Europe/Mariehamn +target/usr/share/zoneinfo/Europe/Minsk +target/usr/share/zoneinfo/Europe/Monaco +target/usr/share/zoneinfo/Europe/Moscow +target/usr/share/zoneinfo/Europe/Nicosia +target/usr/share/zoneinfo/Europe/Oslo +target/usr/share/zoneinfo/Europe/Paris +target/usr/share/zoneinfo/Europe/Podgorica +target/usr/share/zoneinfo/Europe/Prague +target/usr/share/zoneinfo/Europe/Riga +target/usr/share/zoneinfo/Europe/Rome +target/usr/share/zoneinfo/Europe/Samara +target/usr/share/zoneinfo/Europe/San_Marino +target/usr/share/zoneinfo/Europe/Sarajevo +target/usr/share/zoneinfo/Europe/Simferopol +target/usr/share/zoneinfo/Europe/Skopje +target/usr/share/zoneinfo/Europe/Sofia +target/usr/share/zoneinfo/Europe/Stockholm +target/usr/share/zoneinfo/Europe/Tallinn +target/usr/share/zoneinfo/Europe/Tirane +target/usr/share/zoneinfo/Europe/Tiraspol +target/usr/share/zoneinfo/Europe/Uzhgorod +target/usr/share/zoneinfo/Europe/Vaduz +target/usr/share/zoneinfo/Europe/Vatican +target/usr/share/zoneinfo/Europe/Vienna +target/usr/share/zoneinfo/Europe/Vilnius +target/usr/share/zoneinfo/Europe/Volgograd +target/usr/share/zoneinfo/Europe/Warsaw +target/usr/share/zoneinfo/Europe/Zagreb +target/usr/share/zoneinfo/Europe/Zaporozhye +target/usr/share/zoneinfo/Europe/Zurich +target/usr/share/zoneinfo/Factory +target/usr/share/zoneinfo/GB +target/usr/share/zoneinfo/GB-Eire +target/usr/share/zoneinfo/GMT +target/usr/share/zoneinfo/GMT0 +target/usr/share/zoneinfo/GMT-0 +target/usr/share/zoneinfo/GMT+0 +target/usr/share/zoneinfo/Greenwich +target/usr/share/zoneinfo/Hongkong +target/usr/share/zoneinfo/HST +target/usr/share/zoneinfo/Iceland +target/usr/share/zoneinfo/Indian/Antananarivo +target/usr/share/zoneinfo/Indian/Chagos +target/usr/share/zoneinfo/Indian/Christmas +target/usr/share/zoneinfo/Indian/Cocos +target/usr/share/zoneinfo/Indian/Comoro +target/usr/share/zoneinfo/Indian/Kerguelen +target/usr/share/zoneinfo/Indian/Mahe +target/usr/share/zoneinfo/Indian/Maldives +target/usr/share/zoneinfo/Indian/Mauritius +target/usr/share/zoneinfo/Indian/Mayotte +target/usr/share/zoneinfo/Indian/Reunion +target/usr/share/zoneinfo/Iran +target/usr/share/zoneinfo/iso3166.tab +target/usr/share/zoneinfo/Israel +target/usr/share/zoneinfo/Jamaica +target/usr/share/zoneinfo/Japan +target/usr/share/zoneinfo/Kwajalein +target/usr/share/zoneinfo/Libya +target/usr/share/zoneinfo/MET +target/usr/share/zoneinfo/Mexico/BajaNorte +target/usr/share/zoneinfo/Mexico/BajaSur +target/usr/share/zoneinfo/Mexico/General +target/usr/share/zoneinfo/MST +target/usr/share/zoneinfo/MST7MDT +target/usr/share/zoneinfo/Navajo +target/usr/share/zoneinfo/NZ +target/usr/share/zoneinfo/NZ-CHAT +target/usr/share/zoneinfo/Pacific/Apia +target/usr/share/zoneinfo/Pacific/Auckland +target/usr/share/zoneinfo/Pacific/Chatham +target/usr/share/zoneinfo/Pacific/Chuuk +target/usr/share/zoneinfo/Pacific/Easter +target/usr/share/zoneinfo/Pacific/Efate +target/usr/share/zoneinfo/Pacific/Enderbury +target/usr/share/zoneinfo/Pacific/Fakaofo +target/usr/share/zoneinfo/Pacific/Fiji +target/usr/share/zoneinfo/Pacific/Funafuti +target/usr/share/zoneinfo/Pacific/Galapagos +target/usr/share/zoneinfo/Pacific/Gambier +target/usr/share/zoneinfo/Pacific/Guadalcanal +target/usr/share/zoneinfo/Pacific/Guam +target/usr/share/zoneinfo/Pacific/Honolulu +target/usr/share/zoneinfo/Pacific/Johnston +target/usr/share/zoneinfo/Pacific/Kiritimati +target/usr/share/zoneinfo/Pacific/Kosrae +target/usr/share/zoneinfo/Pacific/Kwajalein +target/usr/share/zoneinfo/Pacific/Majuro +target/usr/share/zoneinfo/Pacific/Marquesas +target/usr/share/zoneinfo/Pacific/Midway +target/usr/share/zoneinfo/Pacific/Nauru +target/usr/share/zoneinfo/Pacific/Niue +target/usr/share/zoneinfo/Pacific/Norfolk +target/usr/share/zoneinfo/Pacific/Noumea +target/usr/share/zoneinfo/Pacific/Pago_Pago +target/usr/share/zoneinfo/Pacific/Palau +target/usr/share/zoneinfo/Pacific/Pitcairn +target/usr/share/zoneinfo/Pacific/Pohnpei +target/usr/share/zoneinfo/Pacific/Ponape +target/usr/share/zoneinfo/Pacific/Port_Moresby +target/usr/share/zoneinfo/Pacific/Rarotonga +target/usr/share/zoneinfo/Pacific/Saipan +target/usr/share/zoneinfo/Pacific/Samoa +target/usr/share/zoneinfo/Pacific/Tahiti +target/usr/share/zoneinfo/Pacific/Tarawa +target/usr/share/zoneinfo/Pacific/Tongatapu +target/usr/share/zoneinfo/Pacific/Truk +target/usr/share/zoneinfo/Pacific/Wake +target/usr/share/zoneinfo/Pacific/Wallis +target/usr/share/zoneinfo/Pacific/Yap +target/usr/share/zoneinfo/Poland +target/usr/share/zoneinfo/Portugal +target/usr/share/zoneinfo/PRC +target/usr/share/zoneinfo/PST8PDT +target/usr/share/zoneinfo/ROC +target/usr/share/zoneinfo/ROK +target/usr/share/zoneinfo/Singapore +target/usr/share/zoneinfo/Turkey +target/usr/share/zoneinfo/UCT +target/usr/share/zoneinfo/Universal +target/usr/share/zoneinfo/US/Alaska +target/usr/share/zoneinfo/US/Aleutian +target/usr/share/zoneinfo/US/Arizona +target/usr/share/zoneinfo/US/Central +target/usr/share/zoneinfo/US/Eastern +target/usr/share/zoneinfo/US/East-Indiana +target/usr/share/zoneinfo/US/Hawaii +target/usr/share/zoneinfo/US/Indiana-Starke +target/usr/share/zoneinfo/US/Michigan +target/usr/share/zoneinfo/US/Mountain +target/usr/share/zoneinfo/US/Pacific +target/usr/share/zoneinfo/US/Pacific-New +target/usr/share/zoneinfo/US/Samoa +target/usr/share/zoneinfo/UTC +target/usr/share/zoneinfo/WET +target/usr/share/zoneinfo/W-SU +target/usr/share/zoneinfo/zone.tab +target/usr/share/zoneinfo/Zulu diff --git a/canmore/targetfs-local-list-25.txt b/canmore/targetfs-local-list-25.txt new file mode 100644 index 00000000..06be8752 --- /dev/null +++ b/canmore/targetfs-local-list-25.txt @@ -0,0 +1,949 @@ +staging/usr/lib/charset +staging/usr/lib/charset.alias +staging/usr/lib/glib-2.0 +staging/usr/lib/glib-2.0/include +staging/usr/lib/glib-2.0/include/glibconfig.h +staging/usr/lib/idmap +staging/usr/lib/lowcase.dat +staging/usr/lib/nss_info +staging/usr/lib/pdb +staging/usr/lib/rpc +staging/usr/lib/upcase.dat +staging/usr/lib/valid.dat +static/opt/local/qt +static/opt/local/qt-4.7/lib/fonts/arial.ttf +static/opt/local/qt-4.7/lib/fonts/DejaVuSansMono-BoldOblique.ttf +static/opt/local/qt-4.7/lib/fonts/DejaVuSansMono-Bold.ttf +static/opt/local/qt-4.7/lib/fonts/DejaVuSansMono-Oblique.ttf +static/opt/local/qt-4.7/lib/fonts/DejaVuSansMono.ttf +static/opt/local/qt-4.7/lib/fonts/DejaVuSerif-BoldOblique.ttf +static/opt/local/qt-4.7/lib/fonts/DejaVuSerif-Bold.ttf +static/opt/local/qt-4.7/lib/fonts/DejaVuSerif-Oblique.ttf +static/opt/local/qt-4.7/lib/fonts/DejaVuSerif.ttf +static/opt/local/qt-4.7/lib/libQtCore.so +static/opt/local/qt-4.7/lib/libQtCore.so.4 +static/opt/local/qt-4.7/lib/libQtCore.so.4.7 +static/opt/local/qt-4.7/lib/libQtCore.so.4.7.2 +static/opt/local/qt-4.7/lib/libQtGui.la +static/opt/local/qt-4.7/lib/libQtGui.so +static/opt/local/qt-4.7/lib/libQtGui.so.4 +static/opt/local/qt-4.7/lib/libQtGui.so.4.7 +static/opt/local/qt-4.7/lib/libQtGui.so.4.7.2 +static/opt/local/qt-4.7/lib/libQtMultimedia.so +static/opt/local/qt-4.7/lib/libQtMultimedia.so.4 +static/opt/local/qt-4.7/lib/libQtMultimedia.so.4.7 +static/opt/local/qt-4.7/lib/libQtMultimedia.so.4.7.2 +static/opt/local/qt-4.7/lib/libQtNetwork.la +static/opt/local/qt-4.7/lib/libQtNetwork.so +static/opt/local/qt-4.7/lib/libQtNetwork.so.4 +static/opt/local/qt-4.7/lib/libQtNetwork.so.4.7 +static/opt/local/qt-4.7/lib/libQtNetwork.so.4.7.2 +static/opt/local/qt-4.7/lib/libQtOpenGL.so +static/opt/local/qt-4.7/lib/libQtOpenGL.so.4 +static/opt/local/qt-4.7/lib/libQtOpenGL.so.4.7 +static/opt/local/qt-4.7/lib/libQtOpenGL.so.4.7.2 +static/opt/local/qt-4.7/lib/libQtScript.so +static/opt/local/qt-4.7/lib/libQtScript.so.4 +static/opt/local/qt-4.7/lib/libQtScript.so.4.7 +static/opt/local/qt-4.7/lib/libQtScript.so.4.7.2 +static/opt/local/qt-4.7/lib/libQtScriptTools.so +static/opt/local/qt-4.7/lib/libQtScriptTools.so.4 +static/opt/local/qt-4.7/lib/libQtScriptTools.so.4.7 +static/opt/local/qt-4.7/lib/libQtScriptTools.so.4.7.2 +static/opt/local/qt-4.7/lib/libQtSql.so +static/opt/local/qt-4.7/lib/libQtSql.so.4 +static/opt/local/qt-4.7/lib/libQtSql.so.4.7 +static/opt/local/qt-4.7/lib/libQtSql.so.4.7.2 +static/opt/local/qt-4.7/lib/libQtTest.so +static/opt/local/qt-4.7/lib/libQtTest.so.4 +static/opt/local/qt-4.7/lib/libQtTest.so.4.7 +static/opt/local/qt-4.7/lib/libQtTest.so.4.7.2 +static/opt/local/qt-4.7/lib/libQtWebKit.so +static/opt/local/qt-4.7/lib/libQtWebKit.so.4 +static/opt/local/qt-4.7/lib/libQtWebKit.so.4.7 +static/opt/local/qt-4.7/lib/libQtWebKit.so.4.7.2 +static/opt/local/qt-4.7/lib/libQtXmlPatterns.so +static/opt/local/qt-4.7/lib/libQtXmlPatterns.so.4 +static/opt/local/qt-4.7/lib/libQtXmlPatterns.so.4.7 +static/opt/local/qt-4.7/lib/libQtXmlPatterns.so.4.7.2 +static/opt/local/qt-4.7/lib/libQtXml.so +static/opt/local/qt-4.7/lib/libQtXml.so.4 +static/opt/local/qt-4.7/lib/libQtXml.so.4.7 +static/opt/local/qt-4.7/lib/libQtXml.so.4.7.2 +static/opt/local/qt-4.7/plugins/gfxdrivers/libintelcescreen.so +static/opt/local/qt-4.7/plugins/gfxdrivers/libqdirectfbscreen.so +static/opt/local/qt-4.7/plugins/imageformats/libqgif.so +static/opt/local/qt-4.7/plugins/imageformats/libqico.so +static/opt/local/qt-4.7/plugins/imageformats/libqjpeg.so +static/opt/local/qt-4.7/plugins/imageformats/libqsvg.so +static/opt/local/qt-4.7/plugins/kbddrivers/libqintelceirkbddriver.so +static/opt/local/qt-4.7/plugins/sqldrivers/libqsqlite.so +static/opt/local/sbin/wl +static/usr/sbin/fsck.hfs +static/usr/sbin/fsck.hfsplus +target/bin/lsof +target/bin/ps +target/etc/avahi/avahi-daemon.conf +target/etc/avahi/avahi-dnsconfd.action +target/etc/avahi/hosts +target/etc/fonts +target/etc/fonts/fonts.dtd +target/etc/fonts/conf.d +target/etc/fonts/conf.d/80-delicious.conf +target/etc/fonts/conf.d/30-urw-aliases.conf +target/etc/fonts/conf.d/65-fonts-persian.conf +target/etc/fonts/conf.d/30-metric-aliases.conf +target/etc/fonts/conf.d/60-latin.conf +target/etc/fonts/conf.d/49-sansserif.conf +target/etc/fonts/conf.d/51-local.conf +target/etc/fonts/conf.d/40-nonlatin.conf +target/etc/fonts/conf.d/69-unifont.conf +target/etc/fonts/conf.d/90-synthetic.conf +target/etc/fonts/conf.d/20-unhint-small-vera.conf +target/etc/fonts/conf.d/50-user.conf +target/etc/fonts/conf.d/20-fix-globaladvance.conf +target/etc/fonts/conf.d/65-nonlatin.conf +target/etc/fonts/conf.d/45-latin.conf +target/etc/fonts/fonts.conf +target/etc/lircd.conf +target/lib/libproc-3.2.8.so +target/sbin/iwlist +target/sbin/iwconfig +target/usr/bin/afp_client +target/usr/bin/afpfsd +target/usr/bin/curl +target/usr/bin/dbus-cleanup-sockets +target/usr/bin/dbus-daemon +target/usr/bin/dbus-launch +target/usr/bin/dbus-monitor +target/usr/bin/dbus-send +target/usr/bin/dbus-uuidgen +target/usr/bin/djmount +target/usr/bin/irw +target/usr/bin/mount_afp +target/usr/bin/ntfs-3g +target/usr/bin/ntfs-3g.probe +target/usr/bin/ntfs-3g.secaudit +target/usr/bin/ntfs-3g.usermap +target/usr/bin/ntpdate +target/usr/bin/smbcontrol +target/usr/bin/smbpasswd +target/usr/bin/smbstatus +target/usr/bin/strace +target/usr/bin/testparm +target/usr/bin/top +target/usr/bin/xml +target/usr/bin/xmlstarlet +target/usr/lib/libafpclient.so +target/usr/lib/libafpclient.so.0 +target/usr/lib/libafpclient.so.0.0.0 +target/usr/lib/libavahi-client.so +target/usr/lib/libavahi-client.so.3 +target/usr/lib/libavahi-client.so.3.2.9 +target/usr/lib/libavahi-common.so +target/usr/lib/libavahi-common.so.3 +target/usr/lib/libavahi-common.so.3.5.3 +target/usr/lib/libavahi-core.so +target/usr/lib/libavahi-core.so.7 +target/usr/lib/libavahi-core.so.7.0.2 +target/usr/lib/libcares.so +target/usr/lib/libcares.so.2 +target/usr/lib/libcares.so.2.0.0 +target/usr/lib/libcharset.so +target/usr/lib/libcharset.so.1 +target/usr/lib/libcharset.so.1.0.0 +target/usr/lib/libcrypto.so +target/usr/lib/libcrypto.so.1.0.0 +target/usr/lib/libcurl.so +target/usr/lib/libcurl.so.4 +target/usr/lib/libcurl.so.4.2.0 +target/usr/lib/libdaemon.so +target/usr/lib/libdaemon.so.0 +target/usr/lib/libdaemon.so.0.5.0 +target/usr/lib/libdbus-1.so +target/usr/lib/libdbus-1.so.3 +target/usr/lib/libdbus-1.so.3.5.7 +target/usr/lib/libexpat.so +target/usr/lib/libexpat.so.1 +target/usr/lib/libexpat.so.1.5.2 +target/usr/lib/libexslt.so +target/usr/lib/libexslt.so.0 +target/usr/lib/libexslt.so.0.8.15 +target/usr/lib/libfaad.so +target/usr/lib/libfaad.so.2 +target/usr/lib/libfaad.so.2.0.0 +target/usr/lib/libFLAC.so +target/usr/lib/libFLAC.so.8 +target/usr/lib/libFLAC.so.8.2.0 +target/usr/lib/libfontconfig.so +target/usr/lib/libfontconfig.so.1 +target/usr/lib/libfontconfig.so.1.4.4 +target/usr/lib/libfreetype.so +target/usr/lib/libfreetype.so.6 +target/usr/lib/libfreetype.so.6.8.0 +target/usr/lib/libfribidi.so +target/usr/lib/libfribidi.so.0 +target/usr/lib/libfribidi.so.0.3.1 +target/usr/lib/libfuse.so +target/usr/lib/libfuse.so.2 +target/usr/lib/libfuse.so.2.8.6 +target/usr/lib/libgcrypt.so +target/usr/lib/libgcrypt.so.11 +target/usr/lib/libgcrypt.so.11.6.0 +target/usr/lib/libgdbm.so +target/usr/lib/libgdbm.so.3 +target/usr/lib/libgdbm.so.3.0.0 +target/usr/lib/libgio-2.0.so +target/usr/lib/libgio-2.0.so.0 +target/usr/lib/libgio-2.0.so.0.2800.6 +target/usr/lib/libglib-2.0.so +target/usr/lib/libglib-2.0.so.0 +target/usr/lib/libglib-2.0.so.0.2800.6 +target/usr/lib/libgmodule-2.0.so +target/usr/lib/libgmodule-2.0.so.0 +target/usr/lib/libgmodule-2.0.so.0.2800.6 +target/usr/lib/libgobject-2.0.so +target/usr/lib/libgobject-2.0.so.0 +target/usr/lib/libgobject-2.0.so.0.2800.6 +target/usr/lib/libgpg-error.so +target/usr/lib/libgpg-error.so.0 +target/usr/lib/libgpg-error.so.0.6.0 +target/usr/lib/libgthread-2.0.so +target/usr/lib/libgthread-2.0.so.0 +target/usr/lib/libgthread-2.0.so.0.2800.6 +target/usr/lib/libiconv.so.2 +target/usr/lib/libiconv.so.2.5.0 +target/usr/lib/libidn.so +target/usr/lib/libidn.so.11 +target/usr/lib/libidn.so.11.6.5 +target/usr/lib/libjpeg.so +target/usr/lib/libjpeg.so.8 +target/usr/lib/libjpeg.so.8.3.0 +target/usr/lib/liblzo2.so +target/usr/lib/liblzo2.so.2 +target/usr/lib/liblzo2.so.2.0.0 +target/usr/lib/libmad.so +target/usr/lib/libmad.so.0 +target/usr/lib/libmad.so.0.2.1 +target/usr/lib/libmms.so +target/usr/lib/libmms.so.0 +target/usr/lib/libmms.so.0.0.2 +target/usr/lib/libncurses.so +target/usr/lib/libncurses.so.5 +target/usr/lib/libncurses.so.5.7 +target/usr/lib/libnss_mdns4_minimal.so.2 +target/usr/lib/libnss_mdns4.so.2 +target/usr/lib/libnss_mdns6_minimal.so.2 +target/usr/lib/libnss_mdns6.so.2 +target/usr/lib/libnss_mdns_minimal.so.2 +target/usr/lib/libnss_mdns.so.2 +target/usr/lib/libnss_winbind.so +target/usr/lib/libnss_winbind.so.2 +target/usr/lib/libnss_wins.so +target/usr/lib/libnss_wins.so.2 +target/usr/lib/libntfs-3g.so +target/usr/lib/libntfs-3g.so.80 +target/usr/lib/libntfs-3g.so.80.0.0 +target/usr/lib/libogg.so +target/usr/lib/libogg.so.0 +target/usr/lib/libogg.so.0.7.1 +target/usr/lib/libpcrecpp.so +target/usr/lib/libpcrecpp.so.0 +target/usr/lib/libpcrecpp.so.0.0.0 +target/usr/lib/libpcreposix.so +target/usr/lib/libpcreposix.so.0 +target/usr/lib/libpcreposix.so.0.0.0 +target/usr/lib/libpcre.so +target/usr/lib/libpcre.so.0 +target/usr/lib/libpcre.so.0.0.1 +target/usr/lib/libpng14.so +target/usr/lib/libpng14.so.14 +target/usr/lib/libpng14.so.14.8.0 +target/usr/lib/libreadline.so +target/usr/lib/libreadline.so.6 +target/usr/lib/libreadline.so.6.2 +target/usr/lib/libsamplerate.so +target/usr/lib/libsamplerate.so.0 +target/usr/lib/libsamplerate.so.0.1.7 +target/usr/lib/libSDL-1.2.so.0 +target/usr/lib/libSDL-1.2.so.0.11.3 +target/usr/lib/libSDL.so +target/usr/lib/libsqlite3.so +target/usr/lib/libsqlite3.so.0 +target/usr/lib/libsqlite3.so.0.8.6 +target/usr/lib/libssl.so +target/usr/lib/libssl.so.1.0.0 +target/usr/lib/libtiff.so +target/usr/lib/libtiff.so.3 +target/usr/lib/libtiff.so.3.9.4 +target/usr/lib/libvorbisenc.so +target/usr/lib/libvorbisenc.so.2 +target/usr/lib/libvorbisenc.so.2.0.8 +target/usr/lib/libvorbisfile.so +target/usr/lib/libvorbisfile.so.3 +target/usr/lib/libvorbisfile.so.3.3.4 +target/usr/lib/libvorbis.so +target/usr/lib/libvorbis.so.0 +target/usr/lib/libvorbis.so.0.4.5 +target/usr/lib/libvpx.so +target/usr/lib/libvpx.so.0 +target/usr/lib/libvpx.so.0.9.6 +target/usr/lib/libxml2.so +target/usr/lib/libxml2.so.2 +target/usr/lib/libxml2.so.2.7.8 +target/usr/lib/libxslt.so +target/usr/lib/libxslt.so.1 +target/usr/lib/libxslt.so.1.1.26 +target/usr/lib/python2.4/lib-dynload/array.so +target/usr/lib/python2.4/lib-dynload/audioop.so +target/usr/lib/python2.4/lib-dynload/binascii.so +target/usr/lib/python2.4/lib-dynload/_bisect.so +target/usr/lib/python2.4/lib-dynload/bz2.so +target/usr/lib/python2.4/lib-dynload/cmath.so +target/usr/lib/python2.4/lib-dynload/_codecs_cn.so +target/usr/lib/python2.4/lib-dynload/_codecs_hk.so +target/usr/lib/python2.4/lib-dynload/_codecs_iso2022.so +target/usr/lib/python2.4/lib-dynload/_codecs_jp.so +target/usr/lib/python2.4/lib-dynload/_codecs_kr.so +target/usr/lib/python2.4/lib-dynload/_codecs_tw.so +target/usr/lib/python2.4/lib-dynload/collections.so +target/usr/lib/python2.4/lib-dynload/cPickle.so +target/usr/lib/python2.4/lib-dynload/crypt.so +target/usr/lib/python2.4/lib-dynload/cStringIO.so +target/usr/lib/python2.4/lib-dynload/_csv.so +target/usr/lib/python2.4/lib-dynload/datetime.so +target/usr/lib/python2.4/lib-dynload/dl.so +target/usr/lib/python2.4/lib-dynload/fcntl.so +target/usr/lib/python2.4/lib-dynload/grp.so +target/usr/lib/python2.4/lib-dynload/_heapq.so +target/usr/lib/python2.4/lib-dynload/_hotshot.so +target/usr/lib/python2.4/lib-dynload/imageop.so +target/usr/lib/python2.4/lib-dynload/itertools.so +target/usr/lib/python2.4/lib-dynload/linuxaudiodev.so +target/usr/lib/python2.4/lib-dynload/_locale.so +target/usr/lib/python2.4/lib-dynload/math.so +target/usr/lib/python2.4/lib-dynload/md5.so +target/usr/lib/python2.4/lib-dynload/mmap.so +target/usr/lib/python2.4/lib-dynload/_multibytecodec.so +target/usr/lib/python2.4/lib-dynload/nis.so +target/usr/lib/python2.4/lib-dynload/operator.so +target/usr/lib/python2.4/lib-dynload/ossaudiodev.so +target/usr/lib/python2.4/lib-dynload/parser.so +target/usr/lib/python2.4/lib-dynload/pyexpat.so +target/usr/lib/python2.4/lib-dynload/_random.so +target/usr/lib/python2.4/lib-dynload/readline.so +target/usr/lib/python2.4/lib-dynload/regex.so +target/usr/lib/python2.4/lib-dynload/resource.so +target/usr/lib/python2.4/lib-dynload/rgbimg.so +target/usr/lib/python2.4/lib-dynload/select.so +target/usr/lib/python2.4/lib-dynload/sha.so +target/usr/lib/python2.4/lib-dynload/_socket.so +target/usr/lib/python2.4/lib-dynload/_ssl.so +target/usr/lib/python2.4/lib-dynload/strop.so +target/usr/lib/python2.4/lib-dynload/struct.so +target/usr/lib/python2.4/lib-dynload/syslog.so +target/usr/lib/python2.4/lib-dynload/termios.so +target/usr/lib/python2.4/lib-dynload/_testcapi.so +target/usr/lib/python2.4/lib-dynload/time.so +target/usr/lib/python2.4/lib-dynload/timing.so +target/usr/lib/python2.4/lib-dynload/unicodedata.so +target/usr/lib/python2.4/lib-dynload/_weakref.so +target/usr/lib/python2.4/lib-dynload/zlib.so +target/usr/lib/python2.4/python24.zip +target/usr/sbin/avahi-daemon +target/usr/sbin/avahi-dnsconfd +target/usr/sbin/lircd +target/usr/sbin/mount.cifs +target/usr/sbin/nmbd +target/usr/sbin/ntpd +target/usr/sbin/pppd +target/usr/sbin/pptp +target/usr/sbin/showmount +target/usr/sbin/smbd +target/usr/sbin/umount.cifs +target/usr/sbin/winbindd +target/usr/share/curl/ca-bundle.crt +target/usr/share/terminfo/a/ansi +target/usr/share/terminfo/l/linux +target/usr/share/terminfo/v/vt100 +target/usr/share/terminfo/v/vt102 +target/usr/share/terminfo/v/vt200 +target/usr/share/terminfo/v/vt220 +target/usr/share/terminfo/x/xterm +target/usr/share/terminfo/x/xterm-color +target/usr/share/terminfo/x/xterm-xfree86 +target/usr/share/zoneinfo/Africa/Abidjan +target/usr/share/zoneinfo/Africa/Accra +target/usr/share/zoneinfo/Africa/Addis_Ababa +target/usr/share/zoneinfo/Africa/Algiers +target/usr/share/zoneinfo/Africa/Asmara +target/usr/share/zoneinfo/Africa/Asmera +target/usr/share/zoneinfo/Africa/Bamako +target/usr/share/zoneinfo/Africa/Bangui +target/usr/share/zoneinfo/Africa/Banjul +target/usr/share/zoneinfo/Africa/Bissau +target/usr/share/zoneinfo/Africa/Blantyre +target/usr/share/zoneinfo/Africa/Brazzaville +target/usr/share/zoneinfo/Africa/Bujumbura +target/usr/share/zoneinfo/Africa/Cairo +target/usr/share/zoneinfo/Africa/Casablanca +target/usr/share/zoneinfo/Africa/Ceuta +target/usr/share/zoneinfo/Africa/Conakry +target/usr/share/zoneinfo/Africa/Dakar +target/usr/share/zoneinfo/Africa/Dar_es_Salaam +target/usr/share/zoneinfo/Africa/Djibouti +target/usr/share/zoneinfo/Africa/Douala +target/usr/share/zoneinfo/Africa/El_Aaiun +target/usr/share/zoneinfo/Africa/Freetown +target/usr/share/zoneinfo/Africa/Gaborone +target/usr/share/zoneinfo/Africa/Harare +target/usr/share/zoneinfo/Africa/Johannesburg +target/usr/share/zoneinfo/Africa/Kampala +target/usr/share/zoneinfo/Africa/Khartoum +target/usr/share/zoneinfo/Africa/Kigali +target/usr/share/zoneinfo/Africa/Kinshasa +target/usr/share/zoneinfo/Africa/Lagos +target/usr/share/zoneinfo/Africa/Libreville +target/usr/share/zoneinfo/Africa/Lome +target/usr/share/zoneinfo/Africa/Luanda +target/usr/share/zoneinfo/Africa/Lubumbashi +target/usr/share/zoneinfo/Africa/Lusaka +target/usr/share/zoneinfo/Africa/Malabo +target/usr/share/zoneinfo/Africa/Maputo +target/usr/share/zoneinfo/Africa/Maseru +target/usr/share/zoneinfo/Africa/Mbabane +target/usr/share/zoneinfo/Africa/Mogadishu +target/usr/share/zoneinfo/Africa/Monrovia +target/usr/share/zoneinfo/Africa/Nairobi +target/usr/share/zoneinfo/Africa/Ndjamena +target/usr/share/zoneinfo/Africa/Niamey +target/usr/share/zoneinfo/Africa/Nouakchott +target/usr/share/zoneinfo/Africa/Ouagadougou +target/usr/share/zoneinfo/Africa/Porto-Novo +target/usr/share/zoneinfo/Africa/Sao_Tome +target/usr/share/zoneinfo/Africa/Timbuktu +target/usr/share/zoneinfo/Africa/Tripoli +target/usr/share/zoneinfo/Africa/Tunis +target/usr/share/zoneinfo/Africa/Windhoek +target/usr/share/zoneinfo/America/Adak +target/usr/share/zoneinfo/America/Anchorage +target/usr/share/zoneinfo/America/Anguilla +target/usr/share/zoneinfo/America/Antigua +target/usr/share/zoneinfo/America/Araguaina +target/usr/share/zoneinfo/America/Argentina/Buenos_Aires +target/usr/share/zoneinfo/America/Argentina/Catamarca +target/usr/share/zoneinfo/America/Argentina/ComodRivadavia +target/usr/share/zoneinfo/America/Argentina/Cordoba +target/usr/share/zoneinfo/America/Argentina/Jujuy +target/usr/share/zoneinfo/America/Argentina/La_Rioja +target/usr/share/zoneinfo/America/Argentina/Mendoza +target/usr/share/zoneinfo/America/Argentina/Rio_Gallegos +target/usr/share/zoneinfo/America/Argentina/Salta +target/usr/share/zoneinfo/America/Argentina/San_Juan +target/usr/share/zoneinfo/America/Argentina/San_Luis +target/usr/share/zoneinfo/America/Argentina/Tucuman +target/usr/share/zoneinfo/America/Argentina/Ushuaia +target/usr/share/zoneinfo/America/Aruba +target/usr/share/zoneinfo/America/Asuncion +target/usr/share/zoneinfo/America/Atikokan +target/usr/share/zoneinfo/America/Atka +target/usr/share/zoneinfo/America/Bahia +target/usr/share/zoneinfo/America/Bahia_Banderas +target/usr/share/zoneinfo/America/Barbados +target/usr/share/zoneinfo/America/Belem +target/usr/share/zoneinfo/America/Belize +target/usr/share/zoneinfo/America/Blanc-Sablon +target/usr/share/zoneinfo/America/Boa_Vista +target/usr/share/zoneinfo/America/Bogota +target/usr/share/zoneinfo/America/Boise +target/usr/share/zoneinfo/America/Buenos_Aires +target/usr/share/zoneinfo/America/Cambridge_Bay +target/usr/share/zoneinfo/America/Campo_Grande +target/usr/share/zoneinfo/America/Cancun +target/usr/share/zoneinfo/America/Caracas +target/usr/share/zoneinfo/America/Catamarca +target/usr/share/zoneinfo/America/Cayenne +target/usr/share/zoneinfo/America/Cayman +target/usr/share/zoneinfo/America/Chicago +target/usr/share/zoneinfo/America/Chihuahua +target/usr/share/zoneinfo/America/Coral_Harbour +target/usr/share/zoneinfo/America/Cordoba +target/usr/share/zoneinfo/America/Costa_Rica +target/usr/share/zoneinfo/America/Cuiaba +target/usr/share/zoneinfo/America/Curacao +target/usr/share/zoneinfo/America/Danmarkshavn +target/usr/share/zoneinfo/America/Dawson +target/usr/share/zoneinfo/America/Dawson_Creek +target/usr/share/zoneinfo/America/Denver +target/usr/share/zoneinfo/America/Detroit +target/usr/share/zoneinfo/America/Dominica +target/usr/share/zoneinfo/America/Edmonton +target/usr/share/zoneinfo/America/Eirunepe +target/usr/share/zoneinfo/America/El_Salvador +target/usr/share/zoneinfo/America/Ensenada +target/usr/share/zoneinfo/America/Fortaleza +target/usr/share/zoneinfo/America/Fort_Wayne +target/usr/share/zoneinfo/America/Glace_Bay +target/usr/share/zoneinfo/America/Godthab +target/usr/share/zoneinfo/America/Goose_Bay +target/usr/share/zoneinfo/America/Grand_Turk +target/usr/share/zoneinfo/America/Grenada +target/usr/share/zoneinfo/America/Guadeloupe +target/usr/share/zoneinfo/America/Guatemala +target/usr/share/zoneinfo/America/Guayaquil +target/usr/share/zoneinfo/America/Guyana +target/usr/share/zoneinfo/America/Halifax +target/usr/share/zoneinfo/America/Havana +target/usr/share/zoneinfo/America/Hermosillo +target/usr/share/zoneinfo/America/Indiana/Indianapolis +target/usr/share/zoneinfo/America/Indiana/Knox +target/usr/share/zoneinfo/America/Indiana/Marengo +target/usr/share/zoneinfo/America/Indiana/Petersburg +target/usr/share/zoneinfo/America/Indianapolis +target/usr/share/zoneinfo/America/Indiana/Tell_City +target/usr/share/zoneinfo/America/Indiana/Vevay +target/usr/share/zoneinfo/America/Indiana/Vincennes +target/usr/share/zoneinfo/America/Indiana/Winamac +target/usr/share/zoneinfo/America/Inuvik +target/usr/share/zoneinfo/America/Iqaluit +target/usr/share/zoneinfo/America/Jamaica +target/usr/share/zoneinfo/America/Jujuy +target/usr/share/zoneinfo/America/Juneau +target/usr/share/zoneinfo/America/Kentucky/Louisville +target/usr/share/zoneinfo/America/Kentucky/Monticello +target/usr/share/zoneinfo/America/Knox_IN +target/usr/share/zoneinfo/America/Kralendijk +target/usr/share/zoneinfo/America/La_Paz +target/usr/share/zoneinfo/America/Lima +target/usr/share/zoneinfo/America/Los_Angeles +target/usr/share/zoneinfo/America/Louisville +target/usr/share/zoneinfo/America/Lower_Princes +target/usr/share/zoneinfo/America/Maceio +target/usr/share/zoneinfo/America/Managua +target/usr/share/zoneinfo/America/Manaus +target/usr/share/zoneinfo/America/Marigot +target/usr/share/zoneinfo/America/Martinique +target/usr/share/zoneinfo/America/Matamoros +target/usr/share/zoneinfo/America/Mazatlan +target/usr/share/zoneinfo/America/Mendoza +target/usr/share/zoneinfo/America/Menominee +target/usr/share/zoneinfo/America/Merida +target/usr/share/zoneinfo/America/Metlakatla +target/usr/share/zoneinfo/America/Mexico_City +target/usr/share/zoneinfo/America/Miquelon +target/usr/share/zoneinfo/America/Moncton +target/usr/share/zoneinfo/America/Monterrey +target/usr/share/zoneinfo/America/Montevideo +target/usr/share/zoneinfo/America/Montreal +target/usr/share/zoneinfo/America/Montserrat +target/usr/share/zoneinfo/America/Nassau +target/usr/share/zoneinfo/America/New_York +target/usr/share/zoneinfo/America/Nipigon +target/usr/share/zoneinfo/America/Nome +target/usr/share/zoneinfo/America/Noronha +target/usr/share/zoneinfo/America/North_Dakota/Beulah +target/usr/share/zoneinfo/America/North_Dakota/Center +target/usr/share/zoneinfo/America/North_Dakota/New_Salem +target/usr/share/zoneinfo/America/Ojinaga +target/usr/share/zoneinfo/America/Panama +target/usr/share/zoneinfo/America/Pangnirtung +target/usr/share/zoneinfo/America/Paramaribo +target/usr/share/zoneinfo/America/Phoenix +target/usr/share/zoneinfo/America/Port-au-Prince +target/usr/share/zoneinfo/America/Porto_Acre +target/usr/share/zoneinfo/America/Port_of_Spain +target/usr/share/zoneinfo/America/Porto_Velho +target/usr/share/zoneinfo/America/Puerto_Rico +target/usr/share/zoneinfo/America/Rainy_River +target/usr/share/zoneinfo/America/Rankin_Inlet +target/usr/share/zoneinfo/America/Recife +target/usr/share/zoneinfo/America/Regina +target/usr/share/zoneinfo/America/Resolute +target/usr/share/zoneinfo/America/Rio_Branco +target/usr/share/zoneinfo/America/Rosario +target/usr/share/zoneinfo/America/Santa_Isabel +target/usr/share/zoneinfo/America/Santarem +target/usr/share/zoneinfo/America/Santiago +target/usr/share/zoneinfo/America/Santo_Domingo +target/usr/share/zoneinfo/America/Sao_Paulo +target/usr/share/zoneinfo/America/Scoresbysund +target/usr/share/zoneinfo/America/Shiprock +target/usr/share/zoneinfo/America/Sitka +target/usr/share/zoneinfo/America/St_Barthelemy +target/usr/share/zoneinfo/America/St_Johns +target/usr/share/zoneinfo/America/St_Kitts +target/usr/share/zoneinfo/America/St_Lucia +target/usr/share/zoneinfo/America/St_Thomas +target/usr/share/zoneinfo/America/St_Vincent +target/usr/share/zoneinfo/America/Swift_Current +target/usr/share/zoneinfo/America/Tegucigalpa +target/usr/share/zoneinfo/America/Thule +target/usr/share/zoneinfo/America/Thunder_Bay +target/usr/share/zoneinfo/America/Tijuana +target/usr/share/zoneinfo/America/Toronto +target/usr/share/zoneinfo/America/Tortola +target/usr/share/zoneinfo/America/Vancouver +target/usr/share/zoneinfo/America/Virgin +target/usr/share/zoneinfo/America/Whitehorse +target/usr/share/zoneinfo/America/Winnipeg +target/usr/share/zoneinfo/America/Yakutat +target/usr/share/zoneinfo/America/Yellowknife +target/usr/share/zoneinfo/Antarctica/Casey +target/usr/share/zoneinfo/Antarctica/Davis +target/usr/share/zoneinfo/Antarctica/DumontDUrville +target/usr/share/zoneinfo/Antarctica/Macquarie +target/usr/share/zoneinfo/Antarctica/Mawson +target/usr/share/zoneinfo/Antarctica/McMurdo +target/usr/share/zoneinfo/Antarctica/Palmer +target/usr/share/zoneinfo/Antarctica/Rothera +target/usr/share/zoneinfo/Antarctica/South_Pole +target/usr/share/zoneinfo/Antarctica/Syowa +target/usr/share/zoneinfo/Antarctica/Vostok +target/usr/share/zoneinfo/Arctic/Longyearbyen +target/usr/share/zoneinfo/Asia/Aden +target/usr/share/zoneinfo/Asia/Almaty +target/usr/share/zoneinfo/Asia/Amman +target/usr/share/zoneinfo/Asia/Anadyr +target/usr/share/zoneinfo/Asia/Aqtau +target/usr/share/zoneinfo/Asia/Aqtobe +target/usr/share/zoneinfo/Asia/Ashgabat +target/usr/share/zoneinfo/Asia/Ashkhabad +target/usr/share/zoneinfo/Asia/Baghdad +target/usr/share/zoneinfo/Asia/Bahrain +target/usr/share/zoneinfo/Asia/Baku +target/usr/share/zoneinfo/Asia/Bangkok +target/usr/share/zoneinfo/Asia/Beirut +target/usr/share/zoneinfo/Asia/Bishkek +target/usr/share/zoneinfo/Asia/Brunei +target/usr/share/zoneinfo/Asia/Calcutta +target/usr/share/zoneinfo/Asia/Choibalsan +target/usr/share/zoneinfo/Asia/Chongqing +target/usr/share/zoneinfo/Asia/Chungking +target/usr/share/zoneinfo/Asia/Colombo +target/usr/share/zoneinfo/Asia/Dacca +target/usr/share/zoneinfo/Asia/Damascus +target/usr/share/zoneinfo/Asia/Dhaka +target/usr/share/zoneinfo/Asia/Dili +target/usr/share/zoneinfo/Asia/Dubai +target/usr/share/zoneinfo/Asia/Dushanbe +target/usr/share/zoneinfo/Asia/Gaza +target/usr/share/zoneinfo/Asia/Harbin +target/usr/share/zoneinfo/Asia/Ho_Chi_Minh +target/usr/share/zoneinfo/Asia/Hong_Kong +target/usr/share/zoneinfo/Asia/Hovd +target/usr/share/zoneinfo/Asia/Irkutsk +target/usr/share/zoneinfo/Asia/Istanbul +target/usr/share/zoneinfo/Asia/Jakarta +target/usr/share/zoneinfo/Asia/Jayapura +target/usr/share/zoneinfo/Asia/Jerusalem +target/usr/share/zoneinfo/Asia/Kabul +target/usr/share/zoneinfo/Asia/Kamchatka +target/usr/share/zoneinfo/Asia/Karachi +target/usr/share/zoneinfo/Asia/Kashgar +target/usr/share/zoneinfo/Asia/Kathmandu +target/usr/share/zoneinfo/Asia/Katmandu +target/usr/share/zoneinfo/Asia/Kolkata +target/usr/share/zoneinfo/Asia/Krasnoyarsk +target/usr/share/zoneinfo/Asia/Kuala_Lumpur +target/usr/share/zoneinfo/Asia/Kuching +target/usr/share/zoneinfo/Asia/Kuwait +target/usr/share/zoneinfo/Asia/Macao +target/usr/share/zoneinfo/Asia/Macau +target/usr/share/zoneinfo/Asia/Magadan +target/usr/share/zoneinfo/Asia/Makassar +target/usr/share/zoneinfo/Asia/Manila +target/usr/share/zoneinfo/Asia/Muscat +target/usr/share/zoneinfo/Asia/Nicosia +target/usr/share/zoneinfo/Asia/Novokuznetsk +target/usr/share/zoneinfo/Asia/Novosibirsk +target/usr/share/zoneinfo/Asia/Omsk +target/usr/share/zoneinfo/Asia/Oral +target/usr/share/zoneinfo/Asia/Phnom_Penh +target/usr/share/zoneinfo/Asia/Pontianak +target/usr/share/zoneinfo/Asia/Pyongyang +target/usr/share/zoneinfo/Asia/Qatar +target/usr/share/zoneinfo/Asia/Qyzylorda +target/usr/share/zoneinfo/Asia/Rangoon +target/usr/share/zoneinfo/Asia/Riyadh +target/usr/share/zoneinfo/Asia/Saigon +target/usr/share/zoneinfo/Asia/Sakhalin +target/usr/share/zoneinfo/Asia/Samarkand +target/usr/share/zoneinfo/Asia/Seoul +target/usr/share/zoneinfo/Asia/Shanghai +target/usr/share/zoneinfo/Asia/Singapore +target/usr/share/zoneinfo/Asia/Taipei +target/usr/share/zoneinfo/Asia/Tashkent +target/usr/share/zoneinfo/Asia/Tbilisi +target/usr/share/zoneinfo/Asia/Tehran +target/usr/share/zoneinfo/Asia/Tel_Aviv +target/usr/share/zoneinfo/Asia/Thimbu +target/usr/share/zoneinfo/Asia/Thimphu +target/usr/share/zoneinfo/Asia/Tokyo +target/usr/share/zoneinfo/Asia/Ujung_Pandang +target/usr/share/zoneinfo/Asia/Ulaanbaatar +target/usr/share/zoneinfo/Asia/Ulan_Bator +target/usr/share/zoneinfo/Asia/Urumqi +target/usr/share/zoneinfo/Asia/Vientiane +target/usr/share/zoneinfo/Asia/Vladivostok +target/usr/share/zoneinfo/Asia/Yakutsk +target/usr/share/zoneinfo/Asia/Yekaterinburg +target/usr/share/zoneinfo/Asia/Yerevan +target/usr/share/zoneinfo/Atlantic/Azores +target/usr/share/zoneinfo/Atlantic/Bermuda +target/usr/share/zoneinfo/Atlantic/Canary +target/usr/share/zoneinfo/Atlantic/Cape_Verde +target/usr/share/zoneinfo/Atlantic/Faeroe +target/usr/share/zoneinfo/Atlantic/Faroe +target/usr/share/zoneinfo/Atlantic/Jan_Mayen +target/usr/share/zoneinfo/Atlantic/Madeira +target/usr/share/zoneinfo/Atlantic/Reykjavik +target/usr/share/zoneinfo/Atlantic/South_Georgia +target/usr/share/zoneinfo/Atlantic/Stanley +target/usr/share/zoneinfo/Atlantic/St_Helena +target/usr/share/zoneinfo/Australia/ACT +target/usr/share/zoneinfo/Australia/Adelaide +target/usr/share/zoneinfo/Australia/Brisbane +target/usr/share/zoneinfo/Australia/Broken_Hill +target/usr/share/zoneinfo/Australia/Canberra +target/usr/share/zoneinfo/Australia/Currie +target/usr/share/zoneinfo/Australia/Darwin +target/usr/share/zoneinfo/Australia/Eucla +target/usr/share/zoneinfo/Australia/Hobart +target/usr/share/zoneinfo/Australia/LHI +target/usr/share/zoneinfo/Australia/Lindeman +target/usr/share/zoneinfo/Australia/Lord_Howe +target/usr/share/zoneinfo/Australia/Melbourne +target/usr/share/zoneinfo/Australia/North +target/usr/share/zoneinfo/Australia/NSW +target/usr/share/zoneinfo/Australia/Perth +target/usr/share/zoneinfo/Australia/Queensland +target/usr/share/zoneinfo/Australia/South +target/usr/share/zoneinfo/Australia/Sydney +target/usr/share/zoneinfo/Australia/Tasmania +target/usr/share/zoneinfo/Australia/Victoria +target/usr/share/zoneinfo/Australia/West +target/usr/share/zoneinfo/Australia/Yancowinna +target/usr/share/zoneinfo/Brazil/Acre +target/usr/share/zoneinfo/Brazil/DeNoronha +target/usr/share/zoneinfo/Brazil/East +target/usr/share/zoneinfo/Brazil/West +target/usr/share/zoneinfo/Canada/Atlantic +target/usr/share/zoneinfo/Canada/Central +target/usr/share/zoneinfo/Canada/Eastern +target/usr/share/zoneinfo/Canada/East-Saskatchewan +target/usr/share/zoneinfo/Canada/Mountain +target/usr/share/zoneinfo/Canada/Newfoundland +target/usr/share/zoneinfo/Canada/Pacific +target/usr/share/zoneinfo/Canada/Saskatchewan +target/usr/share/zoneinfo/Canada/Yukon +target/usr/share/zoneinfo/CET +target/usr/share/zoneinfo/Chile/Continental +target/usr/share/zoneinfo/Chile/EasterIsland +target/usr/share/zoneinfo/CST6CDT +target/usr/share/zoneinfo/Cuba +target/usr/share/zoneinfo/EET +target/usr/share/zoneinfo/Egypt +target/usr/share/zoneinfo/Eire +target/usr/share/zoneinfo/EST +target/usr/share/zoneinfo/EST5EDT +target/usr/share/zoneinfo/Etc/GMT +target/usr/share/zoneinfo/Etc/GMT0 +target/usr/share/zoneinfo/Etc/GMT-0 +target/usr/share/zoneinfo/Etc/GMT+0 +target/usr/share/zoneinfo/Etc/GMT-1 +target/usr/share/zoneinfo/Etc/GMT+1 +target/usr/share/zoneinfo/Etc/GMT-10 +target/usr/share/zoneinfo/Etc/GMT+10 +target/usr/share/zoneinfo/Etc/GMT-11 +target/usr/share/zoneinfo/Etc/GMT+11 +target/usr/share/zoneinfo/Etc/GMT-12 +target/usr/share/zoneinfo/Etc/GMT+12 +target/usr/share/zoneinfo/Etc/GMT-13 +target/usr/share/zoneinfo/Etc/GMT-14 +target/usr/share/zoneinfo/Etc/GMT-2 +target/usr/share/zoneinfo/Etc/GMT+2 +target/usr/share/zoneinfo/Etc/GMT-3 +target/usr/share/zoneinfo/Etc/GMT+3 +target/usr/share/zoneinfo/Etc/GMT-4 +target/usr/share/zoneinfo/Etc/GMT+4 +target/usr/share/zoneinfo/Etc/GMT-5 +target/usr/share/zoneinfo/Etc/GMT+5 +target/usr/share/zoneinfo/Etc/GMT-6 +target/usr/share/zoneinfo/Etc/GMT+6 +target/usr/share/zoneinfo/Etc/GMT-7 +target/usr/share/zoneinfo/Etc/GMT+7 +target/usr/share/zoneinfo/Etc/GMT-8 +target/usr/share/zoneinfo/Etc/GMT+8 +target/usr/share/zoneinfo/Etc/GMT-9 +target/usr/share/zoneinfo/Etc/GMT+9 +target/usr/share/zoneinfo/Etc/Greenwich +target/usr/share/zoneinfo/Etc/UCT +target/usr/share/zoneinfo/Etc/Universal +target/usr/share/zoneinfo/Etc/UTC +target/usr/share/zoneinfo/Etc/Zulu +target/usr/share/zoneinfo/Europe/Amsterdam +target/usr/share/zoneinfo/Europe/Andorra +target/usr/share/zoneinfo/Europe/Athens +target/usr/share/zoneinfo/Europe/Belfast +target/usr/share/zoneinfo/Europe/Belgrade +target/usr/share/zoneinfo/Europe/Berlin +target/usr/share/zoneinfo/Europe/Bratislava +target/usr/share/zoneinfo/Europe/Brussels +target/usr/share/zoneinfo/Europe/Bucharest +target/usr/share/zoneinfo/Europe/Budapest +target/usr/share/zoneinfo/Europe/Chisinau +target/usr/share/zoneinfo/Europe/Copenhagen +target/usr/share/zoneinfo/Europe/Dublin +target/usr/share/zoneinfo/Europe/Gibraltar +target/usr/share/zoneinfo/Europe/Guernsey +target/usr/share/zoneinfo/Europe/Helsinki +target/usr/share/zoneinfo/Europe/Isle_of_Man +target/usr/share/zoneinfo/Europe/Istanbul +target/usr/share/zoneinfo/Europe/Jersey +target/usr/share/zoneinfo/Europe/Kaliningrad +target/usr/share/zoneinfo/Europe/Kiev +target/usr/share/zoneinfo/Europe/Lisbon +target/usr/share/zoneinfo/Europe/Ljubljana +target/usr/share/zoneinfo/Europe/London +target/usr/share/zoneinfo/Europe/Luxembourg +target/usr/share/zoneinfo/Europe/Madrid +target/usr/share/zoneinfo/Europe/Malta +target/usr/share/zoneinfo/Europe/Mariehamn +target/usr/share/zoneinfo/Europe/Minsk +target/usr/share/zoneinfo/Europe/Monaco +target/usr/share/zoneinfo/Europe/Moscow +target/usr/share/zoneinfo/Europe/Nicosia +target/usr/share/zoneinfo/Europe/Oslo +target/usr/share/zoneinfo/Europe/Paris +target/usr/share/zoneinfo/Europe/Podgorica +target/usr/share/zoneinfo/Europe/Prague +target/usr/share/zoneinfo/Europe/Riga +target/usr/share/zoneinfo/Europe/Rome +target/usr/share/zoneinfo/Europe/Samara +target/usr/share/zoneinfo/Europe/San_Marino +target/usr/share/zoneinfo/Europe/Sarajevo +target/usr/share/zoneinfo/Europe/Simferopol +target/usr/share/zoneinfo/Europe/Skopje +target/usr/share/zoneinfo/Europe/Sofia +target/usr/share/zoneinfo/Europe/Stockholm +target/usr/share/zoneinfo/Europe/Tallinn +target/usr/share/zoneinfo/Europe/Tirane +target/usr/share/zoneinfo/Europe/Tiraspol +target/usr/share/zoneinfo/Europe/Uzhgorod +target/usr/share/zoneinfo/Europe/Vaduz +target/usr/share/zoneinfo/Europe/Vatican +target/usr/share/zoneinfo/Europe/Vienna +target/usr/share/zoneinfo/Europe/Vilnius +target/usr/share/zoneinfo/Europe/Volgograd +target/usr/share/zoneinfo/Europe/Warsaw +target/usr/share/zoneinfo/Europe/Zagreb +target/usr/share/zoneinfo/Europe/Zaporozhye +target/usr/share/zoneinfo/Europe/Zurich +target/usr/share/zoneinfo/Factory +target/usr/share/zoneinfo/GB +target/usr/share/zoneinfo/GB-Eire +target/usr/share/zoneinfo/GMT +target/usr/share/zoneinfo/GMT0 +target/usr/share/zoneinfo/GMT-0 +target/usr/share/zoneinfo/GMT+0 +target/usr/share/zoneinfo/Greenwich +target/usr/share/zoneinfo/Hongkong +target/usr/share/zoneinfo/HST +target/usr/share/zoneinfo/Iceland +target/usr/share/zoneinfo/Indian/Antananarivo +target/usr/share/zoneinfo/Indian/Chagos +target/usr/share/zoneinfo/Indian/Christmas +target/usr/share/zoneinfo/Indian/Cocos +target/usr/share/zoneinfo/Indian/Comoro +target/usr/share/zoneinfo/Indian/Kerguelen +target/usr/share/zoneinfo/Indian/Mahe +target/usr/share/zoneinfo/Indian/Maldives +target/usr/share/zoneinfo/Indian/Mauritius +target/usr/share/zoneinfo/Indian/Mayotte +target/usr/share/zoneinfo/Indian/Reunion +target/usr/share/zoneinfo/Iran +target/usr/share/zoneinfo/iso3166.tab +target/usr/share/zoneinfo/Israel +target/usr/share/zoneinfo/Jamaica +target/usr/share/zoneinfo/Japan +target/usr/share/zoneinfo/Kwajalein +target/usr/share/zoneinfo/Libya +target/usr/share/zoneinfo/MET +target/usr/share/zoneinfo/Mexico/BajaNorte +target/usr/share/zoneinfo/Mexico/BajaSur +target/usr/share/zoneinfo/Mexico/General +target/usr/share/zoneinfo/MST +target/usr/share/zoneinfo/MST7MDT +target/usr/share/zoneinfo/Navajo +target/usr/share/zoneinfo/NZ +target/usr/share/zoneinfo/NZ-CHAT +target/usr/share/zoneinfo/Pacific/Apia +target/usr/share/zoneinfo/Pacific/Auckland +target/usr/share/zoneinfo/Pacific/Chatham +target/usr/share/zoneinfo/Pacific/Chuuk +target/usr/share/zoneinfo/Pacific/Easter +target/usr/share/zoneinfo/Pacific/Efate +target/usr/share/zoneinfo/Pacific/Enderbury +target/usr/share/zoneinfo/Pacific/Fakaofo +target/usr/share/zoneinfo/Pacific/Fiji +target/usr/share/zoneinfo/Pacific/Funafuti +target/usr/share/zoneinfo/Pacific/Galapagos +target/usr/share/zoneinfo/Pacific/Gambier +target/usr/share/zoneinfo/Pacific/Guadalcanal +target/usr/share/zoneinfo/Pacific/Guam +target/usr/share/zoneinfo/Pacific/Honolulu +target/usr/share/zoneinfo/Pacific/Johnston +target/usr/share/zoneinfo/Pacific/Kiritimati +target/usr/share/zoneinfo/Pacific/Kosrae +target/usr/share/zoneinfo/Pacific/Kwajalein +target/usr/share/zoneinfo/Pacific/Majuro +target/usr/share/zoneinfo/Pacific/Marquesas +target/usr/share/zoneinfo/Pacific/Midway +target/usr/share/zoneinfo/Pacific/Nauru +target/usr/share/zoneinfo/Pacific/Niue +target/usr/share/zoneinfo/Pacific/Norfolk +target/usr/share/zoneinfo/Pacific/Noumea +target/usr/share/zoneinfo/Pacific/Pago_Pago +target/usr/share/zoneinfo/Pacific/Palau +target/usr/share/zoneinfo/Pacific/Pitcairn +target/usr/share/zoneinfo/Pacific/Pohnpei +target/usr/share/zoneinfo/Pacific/Ponape +target/usr/share/zoneinfo/Pacific/Port_Moresby +target/usr/share/zoneinfo/Pacific/Rarotonga +target/usr/share/zoneinfo/Pacific/Saipan +target/usr/share/zoneinfo/Pacific/Samoa +target/usr/share/zoneinfo/Pacific/Tahiti +target/usr/share/zoneinfo/Pacific/Tarawa +target/usr/share/zoneinfo/Pacific/Tongatapu +target/usr/share/zoneinfo/Pacific/Truk +target/usr/share/zoneinfo/Pacific/Wake +target/usr/share/zoneinfo/Pacific/Wallis +target/usr/share/zoneinfo/Pacific/Yap +target/usr/share/zoneinfo/Poland +target/usr/share/zoneinfo/Portugal +target/usr/share/zoneinfo/PRC +target/usr/share/zoneinfo/PST8PDT +target/usr/share/zoneinfo/ROC +target/usr/share/zoneinfo/ROK +target/usr/share/zoneinfo/Singapore +target/usr/share/zoneinfo/Turkey +target/usr/share/zoneinfo/UCT +target/usr/share/zoneinfo/Universal +target/usr/share/zoneinfo/US/Alaska +target/usr/share/zoneinfo/US/Aleutian +target/usr/share/zoneinfo/US/Arizona +target/usr/share/zoneinfo/US/Central +target/usr/share/zoneinfo/US/Eastern +target/usr/share/zoneinfo/US/East-Indiana +target/usr/share/zoneinfo/US/Hawaii +target/usr/share/zoneinfo/US/Indiana-Starke +target/usr/share/zoneinfo/US/Michigan +target/usr/share/zoneinfo/US/Mountain +target/usr/share/zoneinfo/US/Pacific +target/usr/share/zoneinfo/US/Pacific-New +target/usr/share/zoneinfo/US/Samoa +target/usr/share/zoneinfo/UTC +target/usr/share/zoneinfo/WET +target/usr/share/zoneinfo/W-SU +target/usr/share/zoneinfo/zone.tab +target/usr/share/zoneinfo/Zulu diff --git a/canmore/targetfs-local-list.txt b/canmore/targetfs-local-list.txt new file mode 100644 index 00000000..f105a35c --- /dev/null +++ b/canmore/targetfs-local-list.txt @@ -0,0 +1,472 @@ +bin/smbcontrol +bin/ntpdate +bin/ntpd +bin/smbstatus +bin/smbpasswd +sbin/iwgetid +sbin/umount.cifs +sbin/nmbd +sbin/iwspy +sbin/smbd +sbin/addgnupghome +sbin/iwconfig +sbin/iwlist +sbin/applygnupgdefaults +sbin/iwevent +sbin/mount.cifs +sbin/iwpriv +sbin/ifrename +lib/libvorbisfile.so.3.3.2 +lib/libFLAC++.so.6.2.0 +lib/libfribidi.so +lib/libcharset.so +lib/libgobject-2.0.so.0 +lib/libfaad.so.2.0.0 +lib/libpcrecpp.so.0 +lib/libxml2.so.2.7.6 +lib/libogg.so.0 +lib/libogg.so.0.6.0 +lib/libxml2.so +lib/libpng.so +lib/libjpeg.so.62.0.0 +lib/libpng12.so.0 +lib/libvorbis.so.0 +lib/libfontconfig.so +lib/libgcrypt.so.11 +lib/libpng.so.3.39.0 +lib/libmad.so.0.2.1 +lib/libsqlite3.so.0.8.6 +lib/libglib-2.0.so.0 +lib/libmad.so.0 +lib/libjsoncpp.so +lib/libvorbisfile.so.3 +lib/libpcre.so.0.0.1 +lib/libksba.so.8 +lib/liboil-0.3.so.0 +lib/libvorbisenc.so +lib/libfaad.so +lib/lowcase.dat +lib/liboil-0.3.so.0.3.0 +lib/libjpeg.so.62 +lib/libpcreposix.so.0 +lib/libvorbisenc.so.2.0.6 +lib/libsamplerate.so.0 +lib/libvorbisenc.so.2 +lib/libksba.so.8.9.6 +lib/libvorbis.so.0.4.3 +lib/libgmodule-2.0.so +lib/libpng12.so.0.39.0 +lib/libcurl.so +lib/libgobject-2.0.so.0.2200.2 +lib/libfreetype.so.6.3.20 +lib/libiconv.so +lib/libgmodule-2.0.so.0 +lib/charset +lib/libFLAC.so.8.2.0 +lib/libassuan.so.0 +lib/libtiff.so +lib/libxml2.so.2 +lib/libpth.so +lib/libpcreposix.so +lib/libtiffxx.so.3 +lib/libpcre.so +lib/libgcrypt.so +lib/libgthread-2.0.so.0.2200.2 +lib/libglib-2.0.so.0.2200.2 +lib/libassuan.so.0.0.0 +lib/libiconv.so.2 +lib/libFLAC++.so.6 +lib/libgthread-2.0.so.0 +lib/nss_info +lib/libksba.so +lib/libgio-2.0.so.0 +lib/libgio-2.0.so +lib/libtiffxx.so +lib/libjpeg.so +lib/libtiffxx.so.3.9.1 +lib/pdb +lib/libsqlite3.so.0 +lib/libpth.so.20.0.27 +lib/libpcrecpp.so.0.0.0 +lib/libiconv.so.2.5.0 +lib/libmms.so.0 +lib/idmap +lib/rpc +lib/libgio-2.0.so.0.2200.2 +lib/libsamplerate.so.0.1.7 +lib/upcase.dat +lib/libfaad.so.2 +lib/libfontconfig.so.1 +lib/libglib-2.0.so +lib/libcurl.so.4 +lib/libvorbisfile.so +lib/libFLAC.so +lib/libiw.so.29 +lib/libcharset.so.1.0.0 +lib/libfribidi.so.0.3.1 +lib/smb.conf +lib/libsamplerate.so +lib/libcurl.so.4.2.0 +lib/libgcrypt.so.11.5.3 +lib/libvorbis.so +lib/glib-2.0 +lib/glib-2.0/include +lib/glib-2.0/include/glibconfig.h +lib/libpng12.so +lib/libiw.so +lib/libogg.so +lib/libfreetype.so.6 +lib/libsqlite3.so +lib/liboil-0.3.so +lib/libtiff.so.3.9.1 +lib/libfribidi.so.0 +lib/charset.alias +lib/libtiff.so.3 +lib/libgthread-2.0.so +lib/libmms.so +lib/libgmodule-2.0.so.0.2200.2 +lib/libassuan.so +lib/preloadable_libiconv.so +lib/libgobject-2.0.so +lib/libpcreposix.so.0.0.0 +lib/libFLAC.so.8 +lib/libFLAC++.so +lib/libmad.so +lib/libpcre.so.0 +lib/libmms.so.0.0.2 +lib/python2.4/python24.zip +lib/python2.4/lib-dynload/cmath.so +lib/python2.4/lib-dynload/parser.so +lib/python2.4/lib-dynload/dl.so +lib/python2.4/lib-dynload/cStringIO.so +lib/python2.4/lib-dynload/strop.so +lib/python2.4/lib-dynload/_csv.so +lib/python2.4/lib-dynload/termios.so +lib/python2.4/lib-dynload/array.so +lib/python2.4/lib-dynload/struct.so +lib/python2.4/lib-dynload/syslog.so +lib/python2.4/lib-dynload/rgbimg.so +lib/python2.4/lib-dynload/_socket.so +lib/python2.4/lib-dynload/regex.so +lib/python2.4/lib-dynload/_codecs_cn.so +lib/python2.4/lib-dynload/_codecs_jp.so +lib/python2.4/lib-dynload/unicodedata.so +lib/python2.4/lib-dynload/_codecs_tw.so +lib/python2.4/lib-dynload/resource.so +lib/python2.4/lib-dynload/_codecs_iso2022.so +lib/python2.4/lib-dynload/math.so +lib/python2.4/lib-dynload/_weakref.so +lib/python2.4/lib-dynload/_hotshot.so +lib/python2.4/lib-dynload/grp.so +lib/python2.4/lib-dynload/timing.so +lib/python2.4/lib-dynload/_ssl.so +lib/python2.4/lib-dynload/operator.so +lib/python2.4/lib-dynload/select.so +lib/python2.4/lib-dynload/zlib.so +lib/python2.4/lib-dynload/itertools.so +lib/python2.4/lib-dynload/cPickle.so +lib/python2.4/lib-dynload/time.so +lib/python2.4/lib-dynload/imageop.so +lib/python2.4/lib-dynload/linuxaudiodev.so +lib/python2.4/lib-dynload/collections.so +lib/python2.4/lib-dynload/binascii.so +lib/python2.4/lib-dynload/pyexpat.so +lib/python2.4/lib-dynload/md5.so +lib/python2.4/lib-dynload/_multibytecodec.so +lib/python2.4/lib-dynload/_codecs_hk.so +lib/python2.4/lib-dynload/_testcapi.so +lib/python2.4/lib-dynload/_random.so +lib/python2.4/lib-dynload/mmap.so +lib/python2.4/lib-dynload/datetime.so +lib/python2.4/lib-dynload/nis.so +lib/python2.4/lib-dynload/_heapq.so +lib/python2.4/lib-dynload/crypt.so +lib/python2.4/lib-dynload/_locale.so +lib/python2.4/lib-dynload/ossaudiodev.so +lib/python2.4/lib-dynload/audioop.so +lib/python2.4/lib-dynload/bz2.so +lib/python2.4/lib-dynload/sha.so +lib/python2.4/lib-dynload/_bisect.so +lib/python2.4/lib-dynload/fcntl.so +lib/python2.4/lib-dynload/_codecs_kr.so +lib/libpth.so.20 +lib/libpcrecpp.so +lib/libpng.so.3 +lib/valid.dat +lib/libfreetype.so +lib/libcharset.so.1 +lib/libfontconfig.so.1.4.3 +qt/lib/libQtScript.so.4 +qt/lib/libQtGui.so.4 +qt/lib/libQtScript.so.4.7.0 +qt/lib/libQtXml.so +qt/lib/libQtXml.so.4 +qt/lib/libQtCore.so.4.7 +qt/lib/libQtSql.so.4.7.0 +qt/lib/libQtScript.so.4.7 +qt/lib/libQtSql.so +qt/lib/libQtScriptTools.so.4.7.0 +qt/lib/libQtWebKit.so.4.7 +qt/lib/libQtXml.so.4.7.0 +qt/lib/libQtGui.so.4.7 +qt/lib/libQtNetwork.so.4 +qt/lib/libQtMultimedia.so.4 +qt/lib/libQtCore.so +qt/lib/libQtTest.so.4 +qt/lib/libQtWebKit.so +qt/lib/libQtTest.so +qt/lib/libQtScriptTools.so.4 +qt/lib/libQtMultimedia.so +qt/lib/libQtWebKit.so.4.7.0 +qt/lib/libQtScriptTools.so +qt/lib/libQtScript.so +qt/lib/libQtWebKit.so.4 +qt/lib/libQtNetwork.so +qt/lib/libQtCore.so.4 +qt/lib/libQtTest.so.4.7 +qt/lib/libQtScriptTools.so.4.7 +qt/lib/libQtCore.so.4.7.0 +qt/lib/libQtSql.so.4.7 +qt/lib/libQtGui.so.4.7.0 +qt/lib/fonts/arial.ttf +qt/lib/fonts/Vera.ttf +qt/lib/fonts/VeraIt.ttf +qt/lib/fonts/VeraMoIt.ttf +qt/lib/fonts/VeraBd.ttf +qt/lib/fonts/VeraMoBd.ttf +qt/lib/fonts/VeraBI.ttf +qt/lib/fonts/VeraMono.ttf +qt/lib/fonts/VeraSeBd.ttf +qt/lib/fonts/VeraMoBI.ttf +qt/lib/fonts/Cyberbit.ttf +qt/lib/libQtNetwork.so.4.7 +qt/lib/libQtNetwork.la +qt/lib/libQtMultimedia.so.4.7.0 +qt/lib/libQtGui.la +qt/lib/libQtTest.so.4.7.0 +qt/lib/libQtGui.so +qt/lib/libQtNetwork.so.4.7.0 +qt/lib/libQtXml.so.4.7 +qt/lib/libQtMultimedia.so.4.7 +qt/lib/libQtSql.so.4 +qt/plugins/gfxdrivers/libqdirectfbscreen.so +qt/plugins/imageformats/libqico.so +qt/plugins/imageformats/libqgif.so +qt/plugins/imageformats/libqjpeg.so +qt/plugins/imageformats/libqsvg.so +qt/plugins/sqldrivers/libqsqlite.so +qt/plugins/kbddrivers/libqintelceirkbddriver.so +qt-4.7/lib/libQtScript.so.4 +qt-4.7/lib/libQtGui.so.4 +qt-4.7/lib/libQtScript.so.4.7.2 +qt-4.7/lib/libQtXml.so +qt-4.7/lib/libQtXml.so.4 +qt-4.7/lib/libQtCore.so.4.7 +qt-4.7/lib/libQtSql.so.4.7.2 +qt-4.7/lib/libQtScript.so.4.7 +qt-4.7/lib/libQtSql.so +qt-4.7/lib/libQtScriptTools.so.4.7.2 +qt-4.7/lib/libQtWebKit.so.4.7 +qt-4.7/lib/libQtXml.so.4.7.2 +qt-4.7/lib/libQtGui.so.4.7 +qt-4.7/lib/libQtNetwork.so.4 +qt-4.7/lib/libQtMultimedia.so.4 +qt-4.7/lib/libQtCore.so +qt-4.7/lib/libQtTest.so.4 +qt-4.7/lib/libQtWebKit.so +qt-4.7/lib/libQtTest.so +qt-4.7/lib/libQtScriptTools.so.4 +qt-4.7/lib/libQtMultimedia.so +qt-4.7/lib/libQtWebKit.so.4.7.2 +qt-4.7/lib/libQtScriptTools.so +qt-4.7/lib/libQtScript.so +qt-4.7/lib/libQtWebKit.so.4 +qt-4.7/lib/libQtNetwork.so +qt-4.7/lib/libQtCore.so.4 +qt-4.7/lib/libQtTest.so.4.7 +qt-4.7/lib/libQtScriptTools.so.4.7 +qt-4.7/lib/libQtCore.so.4.7.2 +qt-4.7/lib/libQtSql.so.4.7 +qt-4.7/lib/libQtGui.so.4.7.2 +qt-4.7/lib/libQtNetwork.so.4.7 +qt-4.7/lib/libQtNetwork.la +qt-4.7/lib/libQtMultimedia.so.4.7.2 +qt-4.7/lib/libQtGui.la +qt-4.7/lib/libQtTest.so.4.7.2 +qt-4.7/lib/libQtGui.so +qt-4.7/lib/libQtNetwork.so.4.7.2 +qt-4.7/lib/libQtXml.so.4.7 +qt-4.7/lib/libQtMultimedia.so.4.7 +qt-4.7/lib/libQtSql.so.4 +qt-4.7/lib/libQtOpenGL.so +qt-4.7/lib/libQtOpenGL.so.4.7.2 +qt-4.7/lib/libQtOpenGL.la +qt-4.7/lib/libQtOpenGL.so.4.7 +qt-4.7/lib/libQtOpenGL.so.4 +qt-4.7/plugins/gfxdrivers/libqdirectfbscreen.so +qt-4.7/plugins/gfxdrivers/libintelcescreen.so +qt-4.7/plugins/imageformats/libqico.so +qt-4.7/plugins/imageformats/libqgif.so +qt-4.7/plugins/imageformats/libqjpeg.so +qt-4.7/plugins/imageformats/libqsvg.so +qt-4.7/plugins/sqldrivers/libqsqlite.so +qt-4.7/plugins/kbddrivers/libqintelceirkbddriver.so +bin/ntfs-3g +bin/ntfs-3g.probe +bin/ntfs-3g.secaudit +bin/ntfs-3g.usermap +lib/libntfs-3g.so +lib/libntfs-3g.so.80 +lib/libntfs-3g.so.80.0.0 +sbin/blkid +lib/libblkid.so +lib/libblkid.so.1 +lib/libblkid.so.1.1.0 +lib/libuuid.so +lib/libuuid.so.1 +lib/libuuid.so.1.3.0 +share/zoneinfo +private/secrets.tdb +lib/libdbus-1.so.3 +lib/libdbus-1.so +lib/libdbus-1.so.3.4.0 +lib/libpcsclite.so.1 +etc/Wireless +sbin/wl +etc/wpa_supplicant.conf +bin/curl +bin/testparm +lib/libgdbm.so +lib/libgdbm.so.3 +lib/libgdbm.so.3.0.0 +lib/modules/2.6.28/lirc_dev.ko +lib/modules/2.6.28/lirc_mceusb.ko +sbin/lircd +bin/irw +etc/lircd.conf +bin/xz +bin/fc-cache +bin/fc-cat +bin/fc-list +bin/fc-match +bin/fc-query +bin/fc-scan +share/fonts +etc/fonts +lib/libexpat.so +lib/libexpat.so.1 +lib/libexpat.so.1.5.2 +sbin/pppd +sbin/pptp +lib/modules/2.6.28/slhc.ko +lib/modules/2.6.28/ppp_generic.ko +lib/modules/2.6.28/ppp_deflate.ko +lib/modules/2.6.28/ppp_async.ko +lib/modules/2.6.28/ppp_mppe.ko +lib/modules/2.6.28/bsd_comp.ko +lib/modules/2.6.28/card_detector.ko +lib/modules/2.6.28/hfs.ko +lib/modules/2.6.28/hfsplus.ko +lib/modules/2.6.28/nls_utf8.ko +bin/strace +bin/lsof +lib/libcrypto.so +lib/libcrypto.so.1.0.0 +lib/libssl.so +lib/libssl.so.1.0.0 +share/curl/ca-bundle.crt +lib/libidn.so +lib/libidn.so.11 +lib/libcares.so +lib/libcares.so.2 +lib/libcares.so.2.0.0 +lib/libproc-3.2.8.so +bin/ps +bin/top +lib/libexslt.so +lib/libexslt.so.0 +lib/libexslt.so.0.8.15 +lib/libxslt.so +lib/libxslt.so.1 +lib/libxslt.so.1.1.26 +bin/xmlstarlet +lib/libvpx.so +lib/libvpx.so.0 +lib/libvpx.so.0.9 +lib/libvpx.so.0.9.1 +lib/libhid.so +lib/libhid.so.0 +lib/libhid.so.0.0.0 +etc/YFI_CecIr_KeyData.xml +lib/modules/2.6.28/lzo_decompress.ko +lib/modules/2.6.28/lzo_compress.ko +lib/modules/2.6.28/ramzswap.ko +sbin/rzscontrol +lib/libfuse.so +lib/libfuse.so.2 +lib/libfuse.so.2.8.5 +lib/libdaemon.so +lib/libdaemon.so.0 +lib/libdaemon.so.0.5.0 +lib/libavahi-client.so +lib/libavahi-client.so.3 +lib/libavahi-client.so.3.2.8 +lib/libavahi-common.so +lib/libavahi-common.so.3 +lib/libavahi-common.so.3.5.2 +lib/libavahi-core.so +lib/libavahi-core.so.7 +lib/libavahi-core.so.7.0.0 +sbin/avahi-daemon +sbin/avahi-dnsconfd +etc/avahi/avahi-daemon.conf +etc/avahi/avahi-dnsconfd.action +etc/avahi/hosts +lib/libdbus-1.so +lib/libdbus-1.so.3 +lib/libdbus-1.so.3.5.3 +etc/dbus-1 +bin/dbus-daemon +bin/dbus-launch +bin/dbus-uuidgen +bin/dbus-monitor +bin/dbus-send +bin/dbus-cleanup-sockets +lib/libgpg-error.so +lib/libgpg-error.so.0 +lib/libgpg-error.so.0.5.0 +lib/libSDL-1.2.so.0 +lib/libSDL-1.2.so.0.11.3 +lib/libSDL.so +bin/bxuuid +sbin/fsck.hfsplus +sbin/fsck.hfs +sbin/showmount +lib/libharfbuzz.so +lib/libharfbuzz.so.0 +lib/libharfbuzz.so.0.0.0 +lib/libafpclient.so.0.0.0 +lib/libafpclient.so.0 +lib/libafpclient.so +bin/afpfsd +bin/afp_client +bin/mount_afp +lib/libnss_mdns4_minimal.so.2 +lib/libnss_mdns4.so.2 +lib/libnss_mdns_minimal.so.2 +lib/libnss_mdns.so.2 +bin/djmount +lib/libthreadutil.so +lib/libthreadutil.so.6 +lib/libthreadutil.so.6.0.0 +lib/libixml.so +lib/libixml.so.2 +lib/libixml.so.2.0.6 +sbin/winbindd +lib/libnss_winbind.so.2 +lib/libnss_wins.so.2 +lib/libusb-1.0.so +lib/libusb-1.0.so.0 +lib/libusb-1.0.so.0.0.0 +bin/lsusb +share/usb.ids diff --git a/canmore/targetfs-local-recovery-list.txt b/canmore/targetfs-local-recovery-list.txt new file mode 100644 index 00000000..dca49c0d --- /dev/null +++ b/canmore/targetfs-local-recovery-list.txt @@ -0,0 +1,69 @@ +var/locks +lib/libxml2.so.2.7.6 +lib/libxml2.so +lib/libpng.so +lib/libjpeg.so.62.0.0 +lib/libpng12.so.0 +lib/libpng.so.3.39.0 +lib/libsqlite3.so.0.8.6 +lib/libjpeg.so.62 +lib/libpng12.so.0.39.0 +lib/libxml2.so.2 +lib/libsqlite3.so.0 +lib/libpng12.so +lib/libpng.so.3 +qt/lib/libQtScript.so.4 +qt/lib/libQtGui.so.4 +qt/lib/libQtScript.so.4.7.0 +qt/lib/libQtXml.so +qt/lib/libQtXml.so.4 +qt/lib/libQtCore.so.4.7 +qt/lib/libQtSql.so.4.7.0 +qt/lib/libQtScript.so.4.7 +qt/lib/libQtSql.so +qt/lib/libQtScriptTools.so.4.7.0 +qt/lib/libQtXml.so.4.7.0 +qt/lib/libQtGui.so.4.7 +qt/lib/libQtCore.so +qt/lib/libQtScriptTools.so.4 +qt/lib/libQtScriptTools.so +qt/lib/libQtScript.so +qt/lib/libQtCore.so.4 +qt/lib/libQtScriptTools.so.4.7 +qt/lib/libQtCore.so.4.7.0 +qt/lib/libQtSql.so.4.7 +qt/lib/libQtGui.so.4.7.0 +qt/lib/fonts/DejaVuSans.ttf +qt/lib/libQtGui.la +qt/lib/libQtGui.so +qt/lib/libQtXml.so.4.7 +qt/lib/libQtSql.so.4 +qt/lib/libQtNetwork.so +qt/lib/libQtNetwork.so.4 +qt/lib/libQtNetwork.so.4.7 +qt/lib/libQtNetwork.so.4.7.0 +qt/plugins/gfxdrivers/libqdirectfbscreen.so +qt/plugins/imageformats/libqico.so +qt/plugins/imageformats/libqgif.so +qt/plugins/imageformats/libqjpeg.so +qt/plugins/sqldrivers/libqsqlite.so +bin/ntfs-3g +bin/ntfs-3g.probe +bin/ntfs-3g.secaudit +bin/ntfs-3g.usermap +lib/libntfs-3g.so +lib/libntfs-3g.so.76 +lib/libntfs-3g.so.76.0 +lib/libntfs-3g.so.76.0.0 +sbin/blkid +lib/libblkid.so +lib/libblkid.so.1 +lib/libblkid.so.1.1.0 +lib/libuuid.so +lib/libuuid.so.1 +lib/libuuid.so.1.3.0 +bin/xz +lib/modules/2.6.28/card_detector.ko +lib/modules/2.6.28/hfs.ko +lib/modules/2.6.28/hfsplus.ko +lib/modules/2.6.28/nls_utf8.ko diff --git a/debian/build_linux.sh b/debian/build_linux.sh new file mode 100755 index 00000000..b8a0a74c --- /dev/null +++ b/debian/build_linux.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +cd .. + +git reset --hard +git clean -d -f -x -e build-number.txt + +./bootstrap +./configure +make clean +rm *.deb + +make -j8 +if [ "$?" -ne "0" ]; then + echo "***************************************************************************************************" + echo "make failed." + echo "***************************************************************************************************" + exit 1 +fi + +make release +if [ "$?" -ne "0" ]; then + echo "***************************************************************************************************" + echo "make release failed." + echo "***************************************************************************************************" + exit 2 +fi +make -C tools/TexturePacker -f Makefile.host +if [ "$?" -ne "0" ]; then + echo "***************************************************************************************************" + echo "make TexturePacker failed." + echo "***************************************************************************************************" + exit 3 +fi +make -C skin/boxee/media +if [ "$?" -ne "0" ]; then + echo "***************************************************************************************************" + echo "make textures failed." + echo "***************************************************************************************************" + exit 4 +fi + +cd debian + +sudo ./make_debian.sh +if [ "$?" -ne "0" ]; then + echo "***************************************************************************************************" + echo "DEB creation failed." + echo "***************************************************************************************************" + exit 5 +fi + diff --git a/debian/upload_deb_apt.sh b/debian/upload_deb_apt.sh new file mode 100755 index 00000000..06f54038 --- /dev/null +++ b/debian/upload_deb_apt.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +# local config to srv.boxee.tv +#http_path=10.0.0.250/apt +#scp_path=10.0.0.250:/home/distro/apt +#up_user=distro +#repo=main + +# remote config to apt.boxee.tv +http_path=apt.boxee.tv +scp_path=apt.boxee.tv:public_html +up_user=distro +repo=main + +ubuntu=`lsb_release -c | awk '{ print $2; }'` +has_dpkg_dev=`dpkg --list | grep dpkg-dev -c` + +if [ ${has_dpkg_dev} -eq 0 ]; then + echo "dpkg-dev required, please apt-get install it." + exit 1 +fi + +if [ "$1" = "" ]; then + echo "Usage: $0 <.deb file>" + exit 1 +fi + +if [ ! -r $1 ]; then + echo "File does not exist: $1" + exit 1 +fi +echo "will upload ${ubuntu} package!" +rm -rf tmp +mkdir -p tmp/dists/${ubuntu}/${repo}/binary-i386 +cd tmp +echo "Downloading Packages.gz" +wget -q http://${http_path}/dists/${ubuntu}/${repo}/binary-i386/Packages.gz +if [ "$?" != "0" ]; then + echo "Could not download Packages.gz" + exit 1 +fi +gunzip Packages.gz +cp ../$1 dists/${ubuntu}/${repo}/binary-i386 +echo "Generating Packages for the requested ${ubuntu} debian package" +dpkg-scanpackages ./dists /dev/null 2>/dev/null > new_package + +filename=`grep Filename new_package | sed 's/Filename: //'` +found=`grep $filename Packages | wc -l` + +if [ "$found" != "0" ]; then + echo "Package $1 is already uploaded to the site." + exit 1 +fi + +cat new_package >> Packages +gzip Packages + +echo "Uploading $1, please provide password" +scp ../$1 ${up_user}@${scp_path}/dists/${ubuntu}/${repo}/binary-i386 + +echo "Uploading Packages.gz, please provide password" +scp Packages.gz ${up_user}@${scp_path}/dists/${ubuntu}/${repo}/binary-i386 + +cd .. +rm -rf tmp diff --git a/debian/upload_deb_srv.sh b/debian/upload_deb_srv.sh new file mode 100755 index 00000000..1c2c0dba --- /dev/null +++ b/debian/upload_deb_srv.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# local config to srv.boxee.tv +http_path=10.0.0.250/apt +scp_path=10.0.0.250:/home/distro/apt +up_user=distro + +# remote config to apt.boxee.tv +#http_path=apt.boxee.tv +#scp_path=apt.boxee.tv:public_html +#up_user=distro + +ubuntu=`lsb_release -c | awk '{ print $2; }'` +has_dpkg_dev=`dpkg --list | grep dpkg-dev -c` + +if [ ${has_dpkg_dev} -eq 0 ]; then + echo "dpkg-dev required, please apt-get install it." + exit 1 +fi + +if [ "$1" = "" ]; then + echo "Usage: $0 <.deb file>" + exit 1 +fi + +if [ ! -r $1 ]; then + echo "File does not exist: $1" + exit 1 +fi +echo "will upload ${ubuntu} package!" +rm -rf tmp +mkdir -p tmp/dists/${ubuntu}/main/binary-i386 +cd tmp +echo "Downloading Packages.gz" +wget -q http://${http_path}/dists/${ubuntu}/main/binary-i386/Packages.gz +if [ "$?" != "0" ]; then + echo "Could not download Packages.gz" + exit 1 +fi +gunzip Packages.gz +cp ../$1 dists/${ubuntu}/main/binary-i386 +echo "Generating Packages for the requested ${ubuntu} debian package" +dpkg-scanpackages ./dists /dev/null 2>/dev/null > new_package + +filename=`grep Filename new_package | sed 's/Filename: //'` +found=`grep $filename Packages | wc -l` + +if [ "$found" != "0" ]; then + echo "Package $1 is already uploaded to the site." + exit 1 +fi + +cat new_package >> Packages +gzip Packages + +echo "Uploading $1, please provide password" +scp ../$1 ${up_user}@${scp_path}/dists/${ubuntu}/main/binary-i386 + +echo "Uploading Packages.gz, please provide password" +scp Packages.gz ${up_user}@${scp_path}/dists/${ubuntu}/main/binary-i386 + +cd .. +rm -rf tmp diff --git a/guilib/GUIMultilineEditControl.cpp b/guilib/GUIMultilineEditControl.cpp new file mode 100644 index 00000000..572a0dd7 --- /dev/null +++ b/guilib/GUIMultilineEditControl.cpp @@ -0,0 +1,215 @@ +#include "GUIMultilineEditControl.h" + +#define CHARS_IN_LINE_WIDTH 38 + +CGUIMultilineEditControl::CGUIMultilineEditControl(int parentID, int controlID, float posX, float posY, + float width, float height, const CTextureInfo &textureFocus, const CTextureInfo &textureNoFocus, + const CLabelInfo& labelInfo, const std::string &text, const CLabelInfo& emptylabelInfo, const std::string &emptyText, int maxTextSize) +:CGUIEditControl(parentID, controlID , posX, posY, width, height, textureFocus, textureNoFocus, labelInfo, text , emptylabelInfo, emptyText, maxTextSize) +{ + + m_textLayout.SetWrap(true); + m_textLayout2.SetWrap(true); +} + +unsigned int CGUIMultilineEditControl::GlobalTextCursorToLocal(unsigned int& cursor) +{ + int cursorLine=0; + + for (size_t i = 0 ; i < m_textLayout2.GetCountLines() ; i++) + { + size_t currentLineSize = m_textLayout2.GetLineSize(i); + cursorLine = i; + + if (cursor < currentLineSize) + { + //we found the line where the cursor is + break; + } + else + { + cursor -= currentLineSize; + } + } + + return cursorLine; +} + +bool CGUIMultilineEditControl::OnAction(const CAction &action) +{ + ValidateCursor(); + + if (action.id == ACTION_MOVE_UP) + { + unsigned int cursor = m_cursorPos; + unsigned int cursorLine; + + cursorLine = GlobalTextCursorToLocal(cursor); + + if (cursorLine > 0) + { + unsigned int lineBeforeLength = m_textLayout2.GetLineSize(cursorLine-1); + + m_cursorPos -= cursor; + + int cutoffPreviousLine = (lineBeforeLength-cursor); + + if (cutoffPreviousLine <= 0) + { + m_cursorPos --; + } + else + { + m_cursorPos -= cutoffPreviousLine; + } + + if ((int)m_cursorPos <= 0) + { + m_cursorPos = 0; + } + + UpdateText(false); + return true; + } + } + else if (action.id == ACTION_MOVE_DOWN) + { + if ((unsigned int) m_cursorPos < m_text2.size()) + { + unsigned int cursor = m_cursorPos; + unsigned int cursorLine; + + cursorLine = GlobalTextCursorToLocal(cursor); + + unsigned int lineAfterLength = m_textLayout2.GetLineSize(cursorLine); + m_cursorPos += cursor; + m_cursorPos += (lineAfterLength-cursor); + + if ((unsigned int) m_cursorPos > m_text2.size()) + m_cursorPos = (unsigned int)m_text2.size(); + + UpdateText(false); + return true; + } + } + + return CGUIEditControl::OnAction(action); +} + +void CGUIMultilineEditControl::RecalcLabelPosition() +{ + //unlike the GUIEditControl, here we calculate how to shit the text in the Y axis up. + if (!m_label.font) return; + + // ensure that our cursor is within our width + ValidateCursor(); + + float lineHeight = m_label.font->GetLineHeight(); + + if (lineHeight <= 0) + return; + + unsigned int cursorLine = 0; + unsigned int cursorLinePosition = m_cursorPos; // set it to global text position + + cursorLine = GlobalTextCursorToLocal(cursorLinePosition); + cursorLine++; //if its 0 we use it as 1 + + int totalLines = (int) (m_height / lineHeight); //possible lines + + float position = (float)cursorLine / totalLines; + + if (position < 1) + { + position = 0; + } + else + { + position = cursorLine - totalLines + 0.5; + } + + m_textOffset = -position*lineHeight; + +} + +void CGUIMultilineEditControl::RenderText() +{ + if (m_smsTimer.GetElapsedMilliseconds() > smsDelay) + UpdateText(); + + float leftTextWidth = m_textLayout.GetTextWidth(); + float maxTextWidth = m_width - m_label.offsetX * 2; + + // start by rendering the normal text + float posX = m_posX + m_label.offsetX; + float posY = m_posY + m_label.offsetY; + uint32_t align = m_label.align & XBFONT_CENTER_Y; + + if (m_label.align & XBFONT_CENTER_Y) + posY += m_height*0.5f; + + if (leftTextWidth > 0) + { + // render the text on the left + if (IsDisabled()) + m_textLayout.Render(posX, posY, m_label.angle, m_label.disabledColor, m_label.shadowColor, align, leftTextWidth); + else if (HasFocus() && m_label.focusedColor) + m_textLayout.Render(posX, posY, m_label.angle, m_label.focusedColor, m_label.shadowColor, align, leftTextWidth); + else + m_textLayout.Render(posX, posY, m_label.angle, m_label.textColor, m_label.shadowColor, align, leftTextWidth); + + posX += leftTextWidth + spaceWidth; + maxTextWidth -= leftTextWidth + spaceWidth; + } + + if (g_graphicsContext.SetClipRegion(posX, m_posY+m_label.offsetY, maxTextWidth, m_height-m_label.offsetY*2)) + { + if (m_textWidth < maxTextWidth) + { // align text as our text fits + if (leftTextWidth > 0) + { // right align as we have 2 labels + posX = m_posX + m_width - m_label.offsetX; + align |= XBFONT_RIGHT; + } + else + { // align by whatever the skinner requests + if (m_label.align & XBFONT_CENTER_X) + posX += 0.5f*maxTextWidth; + if (m_label.align & XBFONT_RIGHT) + posX += maxTextWidth; + align |= (m_label.align & 3); + } + } + CStdStringW text = GetDisplayedText(); + // let's render it ourselves + if (HasFocus()) + { // cursor location assumes utf16 text, so deal with that (inefficient, but it's not as if it's a high-use area + // virtual keyboard only) + CStdStringW col; + if ((SDL_GetTicks() % 800) <= 400) + col.Format(L"|"); + else + col.Format(L""); + text.Insert(m_cursorPos, col); + } + + m_textLayout2.SetText(text, maxTextWidth-m_label.offsetX); + + if (m_bInvalidated) + RecalcLabelPosition(); + + if (IsDisabled()) + m_textLayout2.Render(posX, posY + m_textOffset, m_label.angle, m_label.disabledColor, m_label.shadowColor, align, maxTextWidth); + else if (HasFocus() && m_label.focusedColor) + m_textLayout2.Render(posX, posY + m_textOffset, m_label.angle, m_label.focusedColor, m_label.shadowColor, align, maxTextWidth); + else + m_textLayout2.Render(posX, posY + m_textOffset, m_label.angle, m_label.textColor, m_label.shadowColor, align, maxTextWidth); + + /* if (m_text2.size() == 0) + { + m_emptyLayout.Render(posX + 5, posY, m_emptyLabelInfo.angle, m_emptyLabelInfo.textColor, m_emptyLabelInfo.shadowColor, align, m_emptyLayout.GetTextWidth(), true); + } +*/ + g_graphicsContext.RestoreClipRegion(); + } +} diff --git a/guilib/GUIMultilineEditControl.h b/guilib/GUIMultilineEditControl.h new file mode 100644 index 00000000..041e7cfe --- /dev/null +++ b/guilib/GUIMultilineEditControl.h @@ -0,0 +1,25 @@ +#ifndef GUILIB_GUIMultilineEditControl_H +#define GUILIB_GUIMultilineEditControl_H + +#pragma once + +#include "GUIEditControl.h" + +class CGUIMultilineEditControl : public CGUIEditControl +{ +public: + + CGUIMultilineEditControl(int parentID, int controlID, float posX, float posY, + float width, float height, const CTextureInfo &textureFocus, const CTextureInfo &textureNoFocus, + const CLabelInfo& labelInfo, const std::string &text, const CLabelInfo& emptylabelInfo, const std::string &emptyText, int maxTextSize = -1); + virtual bool OnAction(const CAction &action); + void RecalcLabelPosition(); + +protected: + virtual void RenderText(); + unsigned int GlobalTextCursorToLocal(unsigned int& cursor); +private: + +}; + +#endif diff --git a/guilib/GUIWebControl.cpp b/guilib/GUIWebControl.cpp new file mode 100644 index 00000000..3c53da32 --- /dev/null +++ b/guilib/GUIWebControl.cpp @@ -0,0 +1,131 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "GUIWebControl.h" +#ifdef HAS_EMBEDDED +#include "GUITextureGLES.h" +#endif +#include "utils/log.h" + +CGUIWebControl::CGUIWebControl(int parentID, int controlID, float posX, float posY, float width, float height, const CStdString& url) + : CGUIControl(parentID, controlID, posX, posY, width, height) + , m_url(url), m_rect(posX, posY, posX + width, posY + height), m_ended(false) +{ + ControlType = GUICONTROL_WEB; + m_browser = new CFlashVideoPlayer(*this); + float z1 = 0.0, z2 = 0.0; + g_graphicsContext.GetGuiTransform().TransformPosition(m_rect.x1, m_rect.y1, z1); + g_graphicsContext.GetGuiTransform().TransformPosition(m_rect.x2, m_rect.y2, z2); +} + +CGUIWebControl::~CGUIWebControl(void) +{ + if (m_browser) + { + delete m_browser; + m_browser = NULL; + } +} + +void CGUIWebControl::Render() +{ + if (!IsVisible()) return; + + if (!m_ended) + { + // Draw transparent area +#ifdef HAS_INTEL_SMD + g_graphicsContext.PushTransform(TransformMatrix(), true); + CGUITextureGLES::DrawQuad(m_rect, 0xff); + g_graphicsContext.PopTransform(); +#endif + } + CGUIControl::Render(); +} + +bool CGUIWebControl::OnAction(const CAction &action) +{ + switch (action.id) + { + case ACTION_MOVE_LEFT: + { + CAction a(ACTION_STEP_BACK); + return m_browser->OnAction(a); + } + case ACTION_MOVE_RIGHT: + { + CAction a(ACTION_STEP_FORWARD); + return m_browser->OnAction(a); + } + } + + if (m_browser->OnAction(action)) + return true; + + return CGUIControl::OnAction(action); +} + +bool CGUIWebControl::OnMessage(CGUIMessage& message) +{ + if (message.GetMessage() == GUI_MSG_SET_FILENAME) + { + SetURL(message.GetStringParam()); + return true; + } + + return CGUIControl::OnMessage(message); +} + +const CStdString &CGUIWebControl::GetURL() const +{ + return m_url; +} + +void CGUIWebControl::SetURL(const CStdString& url) +{ + m_url = url; +} + +void CGUIWebControl::LoadUrl(const CStdString& url/* = ""*/) +{ + if (!url.IsEmpty()) + SetURL(url); + + m_browser->LoadURL(m_url, m_rect); +} + +CStdString CGUIWebControl::GetDescription(void) const +{ + return GetURL(); +} + +bool CGUIWebControl::OnMouseOver(const CPoint &point) +{ + return true; +} + +void CGUIWebControl::OnPlayBackEnded(bool bError/* = false*/, const CStdString& error/* = ""*/) +{ + m_ended = true; + CGUIMessage playbackEnded(GUI_MSG_WINDOW_DEINIT,GetID(),0,bError,0); + playbackEnded.SetStringParam(error); + SendWindowMessage(playbackEnded); +} diff --git a/guilib/GUIWebControl.h b/guilib/GUIWebControl.h new file mode 100644 index 00000000..f7f334af --- /dev/null +++ b/guilib/GUIWebControl.h @@ -0,0 +1,69 @@ +#pragma once + +/* + * Copyright (C) 2005-2011 Team Boxee + * http://www.boxee.tv + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "GUIControl.h" +#include "cores/IPlayer.h" +#include "cores/flashplayer/FlashVideoPlayer.h" + +class CGUIWebControl : public CGUIControl, public IPlayerCallback +{ +public: + CGUIWebControl(int parentID, int controlID, float posX, float posY, float width, float height, const CStdString& url); + virtual ~CGUIWebControl(void); + virtual CGUIWebControl *Clone() const { return new CGUIWebControl(*this); }; + + virtual void Render(); + virtual bool OnAction(const CAction &action) ; + virtual bool OnMessage(CGUIMessage& message); + + virtual CStdString GetDescription() const; + + const CStdString &GetURL() const; + void SetURL(const CStdString& url); + + void LoadUrl(const CStdString& url = ""); + + virtual void OnPlayBackEnded(bool bError = false, const CStdString& error = ""); + virtual void OnPlayBackStarted() {} + virtual void OnPlayBackStopped() {} + virtual void OnQueueNextItem() {} + virtual void OnPlayBackPaused() {} + virtual void OnPlayBackResumed() {} + virtual void OnPlayBackSeek(int iTime, int seekOffset) {} + virtual void OnPlayBackSeekChapter(int iChapter) {} + virtual void OnPlayBackSpeedChanged(int iSpeed) {} + + virtual bool OnMouseOver(const CPoint &point); + + bool isLoading () { return m_browser?m_browser->IsCaching():false; } + +protected: + + CGUIInfoLabel m_info; + + CStdString m_url; + CRect m_rect; + + CFlashVideoPlayer *m_browser; + bool m_ended; +}; diff --git a/guilib/SDL_anigif.c b/guilib/SDL_anigif.c new file mode 100644 index 00000000..d756af17 --- /dev/null +++ b/guilib/SDL_anigif.c @@ -0,0 +1,801 @@ +/* + SDL_anigif: An example animated GIF image loading library for use with SDL + SDL_image Copyright (C) 1997-2006 Sam Lantinga + Animated GIF "derived work" Copyright (C) 2006 Doug McFadyen + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include "SDL_anigif.h" + + + +/* Code from here to end of file has been adapted from XPaint: */ +/* +-------------------------------------------------------------------+ */ +/* | Copyright 1990, 1991, 1993 David Koblas. | */ +/* | Copyright 1996 Torsten Martinsen. | */ +/* | Permission to use, copy, modify, and distribute this software | */ +/* | and its documentation for any purpose and without fee is hereby | */ +/* | granted, provided that the above copyright notice appear in all | */ +/* | copies and that both that copyright notice and this permission | */ +/* | notice appear in supporting documentation. This software is | */ +/* | provided "as is" without express or implied warranty. | */ +/* +-------------------------------------------------------------------+ */ +/* Adapted for use in SDL by Sam Lantinga -- 7/20/98 */ +/* Animated GIF support by Doug McFadyen -- 10/19/06 */ + +#define MAXCOLORMAPSIZE 256 + +#define TRUE 1 +#define FALSE 0 + +#define CM_RED 0 +#define CM_GREEN 1 +#define CM_BLUE 2 + +#define MAX_LWZ_BITS 12 + +#define INTERLACE 0x40 +#define LOCALCOLORMAP 0x80 +#define BitSet(byte,bit) (((byte) & (bit)) == (bit)) +#define LM_to_uint(a,b) (((b)<<8)|(a)) + +#define SDL_SetError(t) ((void)0) /* We're not SDL so ignore error reporting */ + + +typedef struct +{ + unsigned int Width; + unsigned int Height; + unsigned char ColorMap[3][MAXCOLORMAPSIZE]; + unsigned int BitPixel; + unsigned int ColorResolution; + unsigned int Background; + unsigned int AspectRatio; +} gifscreen; + +typedef struct +{ + int transparent; + int delayTime; + int inputFlag; + int disposal; +} gif89; + +typedef struct +{ + /* global data */ + SDL_RWops* src; + gifscreen gs; + gif89 g89; + int zerodatablock; + /* AG_LoadGIF_RW data */ + unsigned char localColorMap[3][MAXCOLORMAPSIZE]; + /* GetCode data */ + unsigned char buf[280]; + int curbit, lastbit, done, lastbyte; + /* LWZReadByte data */ + int fresh, code, incode; + int codesize, setcodesize; + int maxcode, maxcodesize; + int firstcode, oldcode; + int clearcode, endcode; + int table[2][(1 << MAX_LWZ_BITS)]; + int stack[(1 << (MAX_LWZ_BITS))*2], *sp; +} gifdata; + + + +static int ReadColorMap( gifdata* gd, int number, unsigned char buffer[3][MAXCOLORMAPSIZE] ); +static int DoExtension( gifdata* gd, int label ); +static int GetDataBlock( gifdata* gd, unsigned char* buf ); +static int GetCode( gifdata* gd, int code_size, int flag ); +static int LWZReadByte( gifdata* gd, int flag, int input_code_size ); +static SDL_Surface* ReadImage( gifdata* gd, int len, int height, int, unsigned char cmap[3][MAXCOLORMAPSIZE], int interlace, int ignore ); + + + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +int AG_isGIF( SDL_RWops* src ) +{ + int isGIF = FALSE; + + if ( src ) + { + int start = SDL_RWtell( src ); + char magic[6]; + + if ( SDL_RWread(src,magic,sizeof(magic),1) ) + { + if ( (strncmp(magic,"GIF",3) == 0) && ((memcmp(magic+3,"87a",3) == 0) || (memcmp(magic+3,"89a",3) == 0)) ) + { + isGIF = TRUE; + } + } + + SDL_RWseek( src, start, SEEK_SET ); + } + + return isGIF; +} + + + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +int AG_LoadGIF( const char* file, AG_Frame* frames, int size ) +{ + int n = 0; + + SDL_RWops* src = SDL_RWFromFile( file, "rb" ); + + if ( src ) + { + n = AG_LoadGIF_RW( src, frames, size ); + SDL_RWclose( src ); + } + + return n; +} + + + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +void AG_FreeSurfaces( AG_Frame* frames, int nFrames ) +{ + int i; + + if ( frames ) + { + for ( i = 0; i < nFrames; i++ ) + { + if ( frames[i].surface ) + { + SDL_FreeSurface( frames[i].surface ); + frames[i].surface = NULL; + } + } + } +} + + + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +int AG_ConvertSurfacesToDisplayFormat( AG_Frame* frames, int nFrames ) +{ + int i; + int n = 0; + + if ( frames ) + { + for ( i = 0; i < nFrames; i++ ) + { + if ( frames[i].surface ) + { + SDL_Surface* surface = (frames[i].surface->flags & SDL_SRCCOLORKEY) ? SDL_DisplayFormatAlpha(frames[i].surface) : SDL_DisplayFormat(frames[i].surface); + + if ( surface ) + { + SDL_FreeSurface( frames[i].surface ); + frames[i].surface = surface; + n++; + } + } + } + } + + return n; +} + + + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +int AG_NormalizeSurfacesToDisplayFormat( AG_Frame* frames, int nFrames ) +{ + int n = 0; + + if ( nFrames > 0 && frames && frames[0].surface ) + { + SDL_PixelFormat argbFormat; + memset(&argbFormat, 0, sizeof(SDL_PixelFormat)); + argbFormat.BitsPerPixel = 32; + argbFormat.BytesPerPixel = 4; +#if SDL_BYTEORDER == SDL_LIL_ENDIAN + argbFormat.Amask = 0xff000000; + argbFormat.Ashift = 24; + argbFormat.Rmask = 0x00ff0000; + argbFormat.Rshift = 16; + argbFormat.Gmask = 0x0000ff00; + argbFormat.Gshift = 8; + argbFormat.Bmask = 0x000000ff; + argbFormat.Bshift = 0; +#else + argbFormat.Amask = 0x000000ff; + argbFormat.Ashift = 0; + argbFormat.Rmask = 0x0000ff00; + argbFormat.Rshift = 8; + argbFormat.Gmask = 0x00ff0000; + argbFormat.Gshift = 16; + argbFormat.Bmask = 0xff000000; + argbFormat.Bshift = 24; +#endif + + SDL_Surface *mainSurface = SDL_ConvertSurface(frames[0].surface, &argbFormat, 0); + //SDL_Surface* mainSurface = (frames[0].surface->flags & SDL_SRCCOLORKEY) ? SDL_DisplayFormatAlpha(frames[0].surface) : SDL_DisplayFormat(frames[0].surface); + const int newDispose = (frames[0].surface->flags & SDL_SRCCOLORKEY) ? AG_DISPOSE_RESTORE_BACKGROUND : AG_DISPOSE_NONE; + + if ( mainSurface ) + { + int i; + int lastDispose = AG_DISPOSE_NA; + int iRestore = 0; + const Uint8 alpha = (frames[0].disposal == AG_DISPOSE_NONE) ? SDL_ALPHA_OPAQUE : SDL_ALPHA_TRANSPARENT; + + SDL_FillRect( mainSurface, NULL, SDL_MapRGBA(mainSurface->format,0,0,0,alpha) ); + + for ( i = 0; i < nFrames; i++ ) + { + if ( frames[i].surface ) + { + SDL_Surface* surface = SDL_ConvertSurface( mainSurface, mainSurface->format, mainSurface->flags ); + + if ( surface ) + { + SDL_Rect r; + + if ( lastDispose == AG_DISPOSE_NONE ) + SDL_BlitSurface( frames[i-1].surface, NULL, surface, NULL ); + + if ( lastDispose == AG_DISPOSE_RESTORE_PREVIOUS ) + SDL_BlitSurface( frames[iRestore].surface, NULL, surface, NULL ); + if ( frames[i].disposal != AG_DISPOSE_RESTORE_PREVIOUS ) + iRestore = i; + + r.x = (Sint16)frames[i].x; + r.y = (Sint16)frames[i].y; + SDL_BlitSurface( frames[i].surface, NULL, surface, &r ); + + SDL_FreeSurface( frames[i].surface ); + frames[i].surface = surface; + frames[i].x = frames[i].y = 0; + lastDispose = frames[i].disposal; + frames[i].disposal = newDispose; + n++; + } + } + } + + SDL_FreeSurface( mainSurface ); + } + } + + return n; +} + + + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +int AG_LoadGIF_RW( SDL_RWops* src, AG_Frame* frames, int maxFrames ) +{ + int start; + unsigned char buf[16]; + unsigned char c; + int useGlobalColormap; + int bitPixel; + int iFrame = 0; + char version[4]; + SDL_Surface* image = NULL; + gifdata* gd; + + if ( src == NULL ) + return 0; + + gd = (gifdata *)malloc( sizeof(*gd) ); + memset( gd, 0, sizeof(*gd) ); + gd->src = src; + + start = SDL_RWtell( src ); + + if ( !SDL_RWread(src,buf,6,1) ) + { + SDL_SetError( "error reading magic number" ); + goto done; + } + + if ( strncmp((char*)buf,"GIF",3) != 0 ) + { + SDL_SetError( "not a GIF file" ); + goto done; + } + + strncpy( version, (char*)buf+3, 3 ); + version[3] = '\0'; + + if ( (strcmp(version,"87a") != 0) && (strcmp(version,"89a") != 0) ) + { + SDL_SetError( "bad version number, not '87a' or '89a'" ); + goto done; + } + + gd->g89.transparent = -1; + gd->g89.delayTime = -1; + gd->g89.inputFlag = -1; + gd->g89.disposal = AG_DISPOSE_NA; + + if ( !SDL_RWread(src,buf,7,1) ) + { + SDL_SetError( "failed to read screen descriptor" ); + goto done; + } + + gd->gs.Width = LM_to_uint(buf[0],buf[1]); + gd->gs.Height = LM_to_uint(buf[2],buf[3]); + gd->gs.BitPixel = 2 << (buf[4] & 0x07); + gd->gs.ColorResolution = (((buf[4] & 0x70) >> 3) + 1); + gd->gs.Background = buf[5]; + gd->gs.AspectRatio = buf[6]; + + if ( BitSet(buf[4],LOCALCOLORMAP) ) /* Global Colormap */ + { + if ( ReadColorMap(gd,gd->gs.BitPixel,gd->gs.ColorMap) ) + { + SDL_SetError( "error reading global colormap" ); + goto done; + } + } + + do + { + if ( !SDL_RWread(src,&c,1,1) ) + { + SDL_SetError( "EOF / read error on image data" ); + goto done; + } + + if ( c == ';' ) /* GIF terminator */ + goto done; + + if ( c == '!' ) /* Extension */ + { + if ( !SDL_RWread(src,&c,1,1) ) + { + SDL_SetError( "EOF / read error on extention function code" ); + goto done; + } + DoExtension( gd, c ); + continue; + } + + if ( c != ',' ) /* Not a valid start character */ + continue; + + if ( !SDL_RWread(src,buf,9,1) ) + { + SDL_SetError( "couldn't read left/top/width/height" ); + goto done; + } + + useGlobalColormap = !BitSet(buf[8],LOCALCOLORMAP); + bitPixel = 1 << ((buf[8] & 0x07) + 1); + + if ( !useGlobalColormap ) + { + if ( ReadColorMap(gd,bitPixel,gd->localColorMap) ) + { + SDL_SetError( "error reading local colormap" ); + goto done; + } + image = ReadImage( gd, LM_to_uint(buf[4],buf[5]), LM_to_uint(buf[6],buf[7]), bitPixel, gd->localColorMap, BitSet(buf[8],INTERLACE), (frames==NULL) ); + } + else + { + image = ReadImage( gd, LM_to_uint(buf[4],buf[5]), LM_to_uint(buf[6],buf[7]), gd->gs.BitPixel, gd->gs.ColorMap, BitSet(buf[8],INTERLACE), (frames==NULL) ); + } + + if ( frames ) + { + if ( image == NULL ) + goto done; + + if ( gd->g89.transparent >= 0 ) + SDL_SetColorKey( image, SDL_SRCCOLORKEY, gd->g89.transparent ); + + frames[iFrame].surface = image; + frames[iFrame].x = LM_to_uint(buf[0], buf[1]); + frames[iFrame].y = LM_to_uint(buf[2], buf[3]); + frames[iFrame].disposal = gd->g89.disposal; + frames[iFrame].delay = gd->g89.delayTime*10; +/* gd->g89.transparent = -1; ** Hmmm, not sure if this should be reset for each frame? */ + } + + iFrame++; + } while ( iFrame < maxFrames || frames == NULL ); + +done: + if ( image == NULL ) + SDL_RWseek( src, start, SEEK_SET ); + + free( gd ); + + return iFrame; +} + + + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +static int ReadColorMap( gifdata* gd, int number, unsigned char buffer[3][MAXCOLORMAPSIZE] ) +{ + int i; + unsigned char rgb[3]; + int flag; + + flag = TRUE; + + for ( i = 0; i < number; ++i ) + { + if ( !SDL_RWread(gd->src,rgb,sizeof(rgb),1) ) + { + SDL_SetError( "bad colormap" ); + return 1; + } + + buffer[CM_RED][i] = rgb[0]; + buffer[CM_GREEN][i] = rgb[1]; + buffer[CM_BLUE][i] = rgb[2]; + flag &= (rgb[0] == rgb[1] && rgb[1] == rgb[2]); + } + + return FALSE; +} + + + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +static int DoExtension( gifdata* gd, int label ) +{ + unsigned char buf[256]; + + switch ( label ) + { + case 0x01: /* Plain Text Extension */ + break; + + case 0xff: /* Application Extension */ + break; + + case 0xfe: /* Comment Extension */ + while ( GetDataBlock(gd,buf) != 0 ) + ; + return FALSE; + + case 0xf9: /* Graphic Control Extension */ + (void)GetDataBlock( gd, buf ); + gd->g89.disposal = (buf[0] >> 2) & 0x7; + gd->g89.inputFlag = (buf[0] >> 1) & 0x1; + gd->g89.delayTime = LM_to_uint(buf[1],buf[2]); + if ( (buf[0] & 0x1) != 0 ) + gd->g89.transparent = buf[3]; + + while ( GetDataBlock(gd,buf) != 0 ) + ; + return FALSE; + } + + while ( GetDataBlock(gd,buf) != 0 ) + ; + + return FALSE; +} + + + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +static int GetDataBlock( gifdata* gd, unsigned char* buf ) +{ + unsigned char count; + + if ( !SDL_RWread(gd->src,&count,1,1) ) + { + /* pm_message("error in getting DataBlock size" ); */ + return -1; + } + + gd->zerodatablock = count == 0; + + if ( (count != 0) && !SDL_RWread(gd->src,buf,count,1) ) + { + /* pm_message("error in reading DataBlock" ); */ + return -1; + } + + return count; +} + + + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +static int GetCode( gifdata* gd, int code_size, int flag ) +{ + int i, j, ret; + int count; + + if ( flag ) + { + gd->curbit = 0; + gd->lastbit = 0; + gd->done = FALSE; + return 0; + } + + if ( (gd->curbit + code_size) >= gd->lastbit ) + { + if ( gd->done ) + { + if ( gd->curbit >= gd->lastbit ) + SDL_SetError( "ran off the end of my bits" ); + return -1; + } + + gd->buf[0] = gd->buf[gd->lastbyte - 2]; + gd->buf[1] = gd->buf[gd->lastbyte - 1]; + + if ( (count = GetDataBlock(gd, &gd->buf[2])) == 0 ) + gd->done = TRUE; + + gd->lastbyte = 2 + count; + gd->curbit = (gd->curbit - gd->lastbit) + 16; + gd->lastbit = (2 + count)*8; + } + + ret = 0; + for ( i = gd->curbit, j = 0; j < code_size; ++i, ++j ) + ret |= ((gd->buf[i / 8] & (1 << (i % 8))) != 0) << j; + + gd->curbit += code_size; + + return ret; +} + + + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +static int LWZReadByte( gifdata* gd, int flag, int input_code_size ) +{ + int i, code, incode; + + if ( flag ) + { + gd->setcodesize = input_code_size; + gd->codesize = gd->setcodesize + 1; + gd->clearcode = 1 << gd->setcodesize; + gd->endcode = gd->clearcode + 1; + gd->maxcodesize = gd->clearcode*2; + gd->maxcode = gd->clearcode + 2; + + GetCode( gd, 0, TRUE ); + + gd->fresh = TRUE; + + for ( i = 0; i < gd->clearcode; ++i ) + { + gd->table[0][i] = 0; + gd->table[1][i] = i; + } + + for ( ; i < (1 << MAX_LWZ_BITS); ++i ) + gd->table[0][i] = gd->table[1][0] = 0; + + gd->sp = gd->stack; + return 0; + } + else if ( gd->fresh ) + { + gd->fresh = FALSE; + do + { + gd->firstcode = gd->oldcode = GetCode( gd, gd->codesize, FALSE ); + } while ( gd->firstcode == gd->clearcode ); + return gd->firstcode; + } + + if ( gd->sp > gd->stack ) + return *--gd->sp; + + while ( (code = GetCode(gd,gd->codesize,FALSE)) >= 0 ) + { + if ( code == gd->clearcode ) + { + for ( i = 0; i < gd->clearcode; ++i ) + { + gd->table[0][i] = 0; + gd->table[1][i] = i; + } + + for ( ; i < (1 << MAX_LWZ_BITS); ++i ) + gd->table[0][i] = gd->table[1][i] = 0; + + gd->codesize = gd->setcodesize + 1; + gd->maxcodesize = gd->clearcode*2; + gd->maxcode = gd->clearcode + 2; + gd->sp = gd->stack; + gd->firstcode = gd->oldcode = GetCode( gd, gd->codesize, FALSE ); + return gd->firstcode; + } + else if ( code == gd->endcode ) + { + int count; + unsigned char buf[260]; + + if ( gd->zerodatablock ) + return -2; + + while ( (count = GetDataBlock(gd,buf)) > 0 ) + ; + + if ( count != 0 ) + { + /* pm_message("missing EOD in data stream (common occurence)"); */ + } + return -2; + } + + incode = code; + + if ( code >= gd->maxcode ) + { + *gd->sp++ = gd->firstcode; + code = gd->oldcode; + } + + while ( code >= gd->clearcode ) + { + *gd->sp++ = gd->table[1][code]; + if ( code == gd->table[0][code] ) + SDL_SetError( "circular table entry BIG ERROR" ); + code = gd->table[0][code]; + } + + *gd->sp++ = gd->firstcode = gd->table[1][code]; + + if ( (code = gd->maxcode) < (1 << MAX_LWZ_BITS) ) + { + gd->table[0][code] = gd->oldcode; + gd->table[1][code] = gd->firstcode; + ++gd->maxcode; + if ( (gd->maxcode >= gd->maxcodesize) && (gd->maxcodesize < (1 << MAX_LWZ_BITS)) ) + { + gd->maxcodesize *= 2; + ++gd->codesize; + } + } + + gd->oldcode = incode; + + if ( gd->sp > gd->stack ) + return *--gd->sp; + } + + return code; +} + + + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +static SDL_Surface* ReadImage( gifdata* gd, int len, int height, int cmapSize, unsigned char cmap[3][MAXCOLORMAPSIZE], int interlace, int ignore ) +{ + SDL_Surface* image; + unsigned char c; + int i, v; + int xpos = 0, ypos = 0, pass = 0; + + /* Initialize the compression routines */ + if ( !SDL_RWread(gd->src,&c,1,1) ) + { + SDL_SetError( "EOF / read error on image data" ); + return NULL; + } + + if ( LWZReadByte(gd,TRUE,c) < 0 ) + { + SDL_SetError( "error reading image" ); + return NULL; + } + + /* If this is an "uninteresting picture" ignore it. */ + if ( ignore ) + { + while ( LWZReadByte(gd,FALSE,c) >= 0 ) + ; + return NULL; + } + + image = SDL_AllocSurface( SDL_SWSURFACE, len, height, 8, 0, 0, 0, 0 ); + + for ( i = 0; i < cmapSize; i++ ) + { + image->format->palette->colors[i].r = cmap[CM_RED][i]; + image->format->palette->colors[i].g = cmap[CM_GREEN][i]; + image->format->palette->colors[i].b = cmap[CM_BLUE][i]; + } + + while ( (v = LWZReadByte(gd,FALSE,c)) >= 0 ) + { + ((Uint8*)image->pixels)[xpos + ypos*image->pitch] = (Uint8)v; + ++xpos; + + if ( xpos == len ) + { + xpos = 0; + if ( interlace ) + { + switch ( pass ) + { + case 0: + case 1: ypos += 8; break; + case 2: ypos += 4; break; + case 3: ypos += 2; break; + } + + if ( ypos >= height ) + { + ++pass; + switch ( pass ) + { + case 1: ypos = 4; break; + case 2: ypos = 2; break; + case 3: ypos = 1; break; + default: goto fini; + } + } + } + else + { + ++ypos; + } + } + + if ( ypos >= height ) + break; + } + +fini: + return image; +} + diff --git a/guilib/SDL_anigif.h b/guilib/SDL_anigif.h new file mode 100644 index 00000000..8635f5b7 --- /dev/null +++ b/guilib/SDL_anigif.h @@ -0,0 +1,62 @@ +/* + SDL_anigif: An example animated GIF image loading library for use with SDL + SDL_image Copyright (C) 1997-2006 Sam Lantinga + Animated GIF "derived work" Copyright (C) 2006 Doug McFadyen + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _SDL_ANIGIF_H +#define _SDL_ANIGIF_H + +#include +#include +#ifdef __cplusplus + extern "C" { +#endif + + + +typedef struct +{ + SDL_Surface* surface; /* SDL surface for this frame */ + int x, y; /* Frame offset position */ + int disposal; /* Disposal code */ + int delay; /* Frame delay in ms */ + int user; /* User data (not used by aniGIF) */ +} AG_Frame; + +#define AG_DISPOSE_NA 0 /* No disposal specified */ +#define AG_DISPOSE_NONE 1 /* Do not dispose */ +#define AG_DISPOSE_RESTORE_BACKGROUND 2 /* Restore to background */ +#define AG_DISPOSE_RESTORE_PREVIOUS 3 /* Restore to previous */ + + + +extern DECLSPEC int AG_isGIF( SDL_RWops* src ); +extern DECLSPEC int AG_LoadGIF( const char* file, AG_Frame* frames, int maxFrames ); +extern DECLSPEC void AG_FreeSurfaces( AG_Frame* frames, int nFrames ); +extern DECLSPEC int AG_ConvertSurfacesToDisplayFormat( AG_Frame* frames, int nFrames ); +extern DECLSPEC int AG_NormalizeSurfacesToDisplayFormat( AG_Frame* frames, int nFrames ); +extern DECLSPEC int AG_LoadGIF_RW( SDL_RWops* src, AG_Frame* frames, int size ); + + + +#ifdef __cplusplus + } +#endif +#include + +#endif /* _SDL_ANIGIF_H */ diff --git a/guilib/common/IntelCERemote.cpp b/guilib/common/IntelCERemote.cpp new file mode 100644 index 00000000..04bfb1ca --- /dev/null +++ b/guilib/common/IntelCERemote.cpp @@ -0,0 +1,208 @@ +#include "system.h" + +#ifdef HAS_INTELCE + +#include "IntelCERemote.h" + +#include "log.h" +#include "ButtonTranslator.h" + +CRemoteControl g_RemoteControl; + +#define RC_DEVICE_NAME "intelce" + +#define NOF_REMOTE_KEYS 46 + +struct RemoteKeyType +{ + int device; + int number; + const char* key; +} RemoteKeys[] = +{ + { 0x45, 0x12, "Power" }, + { 0x45, 0xe7, "Source" }, + { 0x38, 0x23, "Sleep" }, + { 0x45, 0xde, "Guide" }, + { 0x38, 0x0e, "VolUp" }, + { 0x38, 0x18, "Mute" }, + { 0x38, 0x21, "ChanUp" }, + { 0x38, 0x0f, "VolDown" }, + { 0x45, 0x34, "PIP" }, + { 0x38, 0x22, "ChanDown" }, + { 0x45, 0x14, "Stop" }, + { 0x45, 0x15, "Play" }, + { 0x45, 0x00, "Pause" }, + { 0x45, 0x19, "Rewind" }, + { 0x45, 0x2b, "Back" }, + { 0x45, 0x13, "Forward" }, + { 0x45, 0x23, "Replay" }, + { 0x45, 0x33, "Record" }, + { 0x45, 0x24, "Skip" }, + { 0x45, 0x80, "Up" }, + { 0x45, 0x51, "Left" }, + { 0x45, 0x21, "OK" }, + { 0x45, 0x4d, "Right" }, + { 0x45, 0x81, "Down" }, + { 0x45, 0x22, "Exit" }, + { 0x45, 0x16, "Info" }, + { 0x45, 0x30, "Keyboard" }, + { 0x45, 0x01, "One" }, + { 0x45, 0x02, "Two" }, + { 0x45, 0x03, "Three" }, + { 0x45, 0x39, "Favorite" }, + { 0x45, 0x04, "Four" }, + { 0x45, 0x05, "Five" }, + { 0x45, 0x06, "Six" }, + { 0x45, 0x2f, "Home" }, + { 0x45, 0x07, "Seven" }, + { 0x45, 0x08, "Eight" }, + { 0x45, 0x09, "Nine" }, + { 0x45, 0x32, "Setup" }, + { 0x45, 0x31, "BackSpace" }, + { 0x45, 0x0a, "Zero" }, + { 0x45, 0x25, "Enter" }, + { 0x45, 0x35, "Function1" }, + { 0x45, 0x36, "Function2" }, + { 0x45, 0x38, "Function4" }, + { 0x45, 0x37, "Function3" } +}; + +CRemoteControl::CRemoteControl() +{ + m_initialized = false; + m_newData = false; + m_pInterface = NULL; + m_isHolding = false; +} + +CRemoteControl::~CRemoteControl() +{ + Disconnect(); +} + +void CRemoteControl::setUsed(bool value) +{ +} + +void CRemoteControl::Reset() +{ +} + +void CRemoteControl::Disconnect() +{ + if (m_pInterface != NULL) + { + delete m_pInterface; + m_pInterface = NULL; + } +} + +void CRemoteControl::setDeviceName(const CStdString& value) +{ +} + +const char* CRemoteControl::TranslateToButtonName(int device, int number) +{ + for (int i = 0; i < NOF_REMOTE_KEYS; i++) + { + if (RemoteKeys[i].device == device && RemoteKeys[i].number == number) + { + return RemoteKeys[i].key; + } + } + + return "Unknown"; +} + +void CRemoteControl::SetEvent(WORD button, bool isHolding) +{ + CSingleLock lock(m_lock); + + m_button = button; + m_isHolding = isHolding; + m_newData = true; +} + +static int PICInterfaceCallBack( UINT8 type, UINT8 length, void* data, void* clientData) +{ + CRemoteControl* obj = (CRemoteControl*) clientData; + + UINT8* cdata = (UINT8*)data; + + if (type == LR_PIC_IR || type == LR_PIC_IR_REPEAT_START || type == LR_PIC_IR_REPEAT_STOP) + { + if (length != 3) + { + return 0; + } + + bool isHolding = (type == LR_PIC_IR_REPEAT_START); + PicBufferIR* pIR = PicBufferIR::unserialize( cdata ); + { + const char* buttonName = CRemoteControl::TranslateToButtonName(pIR->irDevice, pIR->irNumber); + WORD button = CButtonTranslator::GetInstance().TranslateLircRemoteString(RC_DEVICE_NAME, buttonName); + if (button != 0) + { + obj->SetEvent(button, isHolding); + } + } + delete pIR; + } + + return 0; +} + +void CRemoteControl::Initialize() +{ + int retCode; + m_pInterface = new LR_PICInterface(PICInterfaceCallBack, this); + if (m_pInterface == NULL) + { + CLog::Log(LOGERROR, "IR: problem with interface creation, exit" ); + return; + } + + retCode = m_pInterface->Init((INT8*)("/dev/ttyS1")); + if(retCode != PIC_SUCCESS) + { + CLog::Log(LOGERROR, "IR: problem with interface init" ); + return; + } +/* + * all IO Event functions are deprecated starting with SDK 21.2 + * + retCode = m_pInterface->setIOTimerValue(1); + if(retCode != PIC_SUCCESS) + { + CLog::Log(LOGERROR, "IR: problem with interface setIOTimerValue" ); + return; + } +*/ + m_initialized = true; +} + +void CRemoteControl::Update() +{ +} + +WORD CRemoteControl::GetButton() +{ + CSingleLock lock(m_lock); + + if (!m_newData) + return 0; + + if (!m_isHolding) + m_newData = false; + + return m_button; +} + +bool CRemoteControl::IsHolding() +{ + CSingleLock lock(m_lock); + return m_isHolding; +} + +#endif diff --git a/guilib/common/IntelCERemote.h b/guilib/common/IntelCERemote.h new file mode 100644 index 00000000..b5a4e781 --- /dev/null +++ b/guilib/common/IntelCERemote.h @@ -0,0 +1,55 @@ +#ifndef INTELCE_REMOTE_H +#define INTELCE_REMOTE_H + +#include "../system.h" + +#ifdef HAS_INTELCE + +#include "StdString.h" +#include "SingleLock.h" + +/* The code below is a hack so we don't get compilation errors because of weird definition in tdef.h */ +#define _NALTYPES_H_ +typedef char INT8; +typedef unsigned char UINT8; +typedef short INT16; +typedef unsigned short UINT16; +typedef int INT32; +typedef unsigned int UINT32; +typedef long long INT64; +typedef unsigned long long UINT64; +typedef int INTN; +typedef unsigned int UINTN; +typedef INT8 CHAR; +#include + +class CRemoteControl +{ +public: + CRemoteControl(); + ~CRemoteControl(); + void Initialize(); + void Disconnect(); + void Reset(); + void Update(); + WORD GetButton(); + bool IsHolding(); + void setDeviceName(const CStdString& value); + void setUsed(bool value); + static const char* TranslateToButtonName(int device, int number); + void SetEvent(WORD button, bool isHolding); + +private: + CCriticalSection m_lock; + bool m_newData; + bool m_isHolding; + WORD m_button; + bool m_initialized; + LR_PICInterface* m_pInterface; +}; + +extern CRemoteControl g_RemoteControl; + +#endif + +#endif diff --git a/guilib/common/common.pro b/guilib/common/common.pro new file mode 100644 index 00000000..a2fe4cfc --- /dev/null +++ b/guilib/common/common.pro @@ -0,0 +1,24 @@ +include(../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../ ../.. ../../xbmc ../../xbmc/linux ../../xbmc/utils +SOURCES += \ +IntelCERemote.cpp \ +LinuxInputDevices.cpp \ +LIRC.cpp \ +SDLJoystick.cpp \ + + +HEADERS += \ +IntelCERemote.h \ +LinuxInputDevices.h \ +LIRC.h \ +SDLJoystick.h \ + + diff --git a/guilib/guilib.pro b/guilib/guilib.pro new file mode 100644 index 00000000..07e3038d --- /dev/null +++ b/guilib/guilib.pro @@ -0,0 +1,181 @@ +include(../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../ common ../xbmc ../xbmc/cores ../xbmc/linux ../xbmc/utils tinyXML ../xbmc/lib/libsquish ../xbmc/cores/dvdplayer/Codecs ../xbmc/cores/dvdplayer/Codecs/ffmpeg +DEFINES += __STDC_CONSTANT_MACROS +SOURCES += \ + \ +GUIScrollBarControl.cpp \ +GUIResizeControl.cpp \ +GUIDialog.cpp \ +GUIFontTTFGL.cpp \ +Shader.cpp \ +GUIControlFactory.cpp \ +GUIMultiImage.cpp \ +TextureBundleXBT.cpp \ +GUITexture.cpp \ +GUIListLabel.cpp \ +XBTFReader.cpp \ +GUIListContainer.cpp \ +GUIIncludes.cpp \ +GUISettingsSliderControl.cpp \ +GUIFontTTF.cpp \ +SDL_anigif.c \ +GUIAudioManager.cpp \ +Texture.cpp \ +VisibleEffect.cpp \ +GUISliderControl.cpp \ +GUIWindowManager.cpp \ +GUIProgressControl.cpp \ +XBTF.cpp \ +GUIStandardWindow.cpp \ +GUIMultilineEditControl.cpp \ +GUIFont.cpp \ +GUICheckMarkControl.cpp \ +GUISpinControl.cpp \ +GUIControlGroup.cpp \ +GUISound.cpp \ +GUIVideoControl.cpp \ +TextureGL.cpp \ +GUITextureGL.cpp \ +AudioContext.cpp \ +GUITextBox.cpp \ +GUIMessage.cpp \ +GUIBaseContainer.cpp \ +GUIButtonControl.cpp \ +GUIInfoTypes.cpp \ +IWindowManagerCallback.cpp \ +GUIRadioButtonControl.cpp \ +GUIBorderedImage.cpp \ +GUIControlProfiler.cpp \ +GUIListGroup.cpp \ +GUIFontTTFGLES.cpp \ +GUIWindow.cpp \ +GUIFadeLabelControl.cpp \ +GUIToggleButtonControl.cpp \ +GUIControlGroupList.cpp \ +GUIFontManager.cpp \ +GUITextureGLES.cpp \ +GUIListItem.cpp \ +GUIButtonScroller.cpp \ +GUIVisualisationControl.cpp \ +GUITextLayout.cpp \ +GUISelectButtonControl.cpp \ +GUIPanelContainer.cpp \ +GUIRSSControl.cpp \ +TextureManager.cpp \ +GUILabelControl.cpp \ +XMLUtils.cpp \ +TextureBundle.cpp \ +GUIKeyboardControl.cpp \ +GraphicContext.cpp \ +GUIMoverControl.cpp \ +GUIEditControl.cpp \ +GUIControl.cpp \ +GUISpinControlEx.cpp \ +GUIMultiSelectText.cpp \ +Key.cpp \ +GUIFixedListContainer.cpp \ +FrameBufferObject.cpp \ +GUIWrappingListContainer.cpp \ +DDSImage.cpp \ +DirectXGraphics.cpp \ +GUIColorManager.cpp \ +SkinInfo.cpp \ +GUIListItemLayout.cpp \ +TextureBundleXPR.cpp \ +LocalizeStrings.cpp \ +GUIImage.cpp \ + + +HEADERS += \ + \ +GUIScrollBarControl.h \ +GUIResizeControl.h \ +GUIDialog.h \ +GUIFontTTFGL.h \ +Shader.h \ +GUIControlFactory.h \ +GUIMultiImage.h \ +TextureBundleXBT.h \ +GUITexture.h \ +GUIListLabel.h \ +XBTFReader.h \ +GUIListContainer.h \ +GUIIncludes.h \ +GUISettingsSliderControl.h \ +GUIFontTTF.h \ +SDL_anigif.h \ +GUIAudioManager.h \ +Texture.h \ +VisibleEffect.h \ +GUISliderControl.h \ +GUIWindowManager.h \ +GUIProgressControl.h \ +XBTF.h \ +GUIStandardWindow.h \ +GUIMultilineEditControl.h \ +GUIFont.h \ +GUICheckMarkControl.h \ +GUISpinControl.h \ +GUIControlGroup.h \ +GUISound.h \ +GUIVideoControl.h \ +TextureGL.h \ +GUITextureGL.h \ +AudioContext.h \ +GUITextBox.h \ +GUIMessage.h \ +GUIBaseContainer.h \ +GUIButtonControl.h \ +GUIInfoTypes.h \ +IWindowManagerCallback.h \ +GUIRadioButtonControl.h \ +GUIBorderedImage.h \ +GUIControlProfiler.h \ +GUIListGroup.h \ +GUIFontTTFGLES.h \ +GUIWindow.h \ +GUIFadeLabelControl.h \ +GUIToggleButtonControl.h \ +GUIControlGroupList.h \ +GUIFontManager.h \ +GUITextureGLES.h \ +GUIListItem.h \ +GUIButtonScroller.h \ +GUIVisualisationControl.h \ +GUITextLayout.h \ +GUISelectButtonControl.h \ +GUIPanelContainer.h \ +GUIRSSControl.h \ +TextureManager.h \ +GUILabelControl.h \ +XMLUtils.h \ +TextureBundle.h \ +GUIKeyboardControl.h \ +GraphicContext.h \ +GUIMoverControl.h \ +GUIEditControl.h \ +GUIControl.h \ +GUISpinControlEx.h \ +GUIMultiSelectText.h \ +Key.h \ +GUIFixedListContainer.h \ +FrameBufferObject.h \ +GUIWrappingListContainer.h \ +DDSImage.h \ +DirectXGraphics.h \ +GUIColorManager.h \ +SkinInfo.h \ +GUIListItemLayout.h \ +TextureBundleXPR.h \ +LocalizeStrings.h \ +GUIImage.h \ + + diff --git a/guilib/tinyXML/tinyXML.pro b/guilib/tinyXML/tinyXML.pro new file mode 100644 index 00000000..5af98236 --- /dev/null +++ b/guilib/tinyXML/tinyXML.pro @@ -0,0 +1,22 @@ +include(../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../ ../../xbmc ../../xbmc/linux ../../xbmc/utils +SOURCES += \ +tinyxmlparser.cpp \ +tinyxmlerror.cpp \ +tinystr.cpp \ +tinyxml.cpp \ + + +HEADERS += \ +tinystr.h \ +tinyxml.h \ + + diff --git a/language/Arabic/keyboard.xml b/language/Arabic/keyboard.xml new file mode 100755 index 00000000..74db3551 --- /dev/null +++ b/language/Arabic/keyboard.xml @@ -0,0 +1,38 @@ + + + Øī + Ų„ا + ØĪ + ŲŠ + ØŦ + ØĻ + Ų„ + ا + Ų‡ + ØŠ + Ų† + Ų… + ØĐ + Ų‰ + ØŪ + Ø­ + Øķ + Ų‚ + Øģ + Ų + Øđ + Øą + Øĩ + ØĄ + Øš + ØĶ + ØŽ + ØŊ + Ųƒ + Ø· + Øē + Øļ + Ø° + Ųˆ + + diff --git a/language/Arabic/langinfo.xml b/language/Arabic/langinfo.xml new file mode 100644 index 00000000..e0988d11 --- /dev/null +++ b/language/Arabic/langinfo.xml @@ -0,0 +1,25 @@ + + + + CP1256 + CP1256 + + + ar + + ar + + + + DD/MM/YYYY + DDDD DD MMMM YYYY + + C + kmh + + + + اŲ„ + + + diff --git a/language/Arabic/strings.xml b/language/Arabic/strings.xml new file mode 100644 index 00000000..975e04e3 --- /dev/null +++ b/language/Arabic/strings.xml @@ -0,0 +1,4177 @@ +ïŧŋ + + + ØĻاŲ„Øš + ØĩŲˆØą + Ų…ŲˆØģŲŠŲ‚Ų‰ + ŲŲŠØŊŲŠŲˆ + ØŊŲ„ŲŠŲ„ اŲ„ØŠŲ„ŲØ§Øē + ØĨØđØŊاØŊا؊ + XBMC SVN + Ų…ØŊŲŠØą اŲ„Ų…Ų„ŲØ§ØŠ + اŲ„Ø·Ų‚Øģ + Ų…ØąŲƒØē ŲˆØģاØĶØ· xbmc + + اŲ„ØĨØŦŲ†ŲŠŲ† + اŲ„ØŦŲ„اØŦØ§ØĄ + اŲ„ØĢØąØĻØđØ§ØĄ + اŲ„ØŪŲ…ŲŠØģ + اŲ„ØŽŲ…ØđØĐ + اŲ„ØģØĻØŠ + اŲ„ØĢØ­ØŊ + + ŲŠŲ†Ø§ŲŠØą + ŲØĻØąØ§ŲŠØą + Ų…Ø§ØąØģ + ØĢØĻØąŲŠŲ„ + Ų…اŲŠŲˆ + ŲŠŲˆŲ†ŲŠŲˆ + ŲŠŲˆŲ„ŲŠŲˆ + ØĢØšØģØ·Øģ + ØģØĻØŠŲ…ØĻØą + ØĢŲƒØŠŲˆØĻØą + Ų†ŲˆŲŲ…ØĻØą + ØŊŲŠØģŲ…ØĻØą + + ØĨØŦŲ†ŲŠŲ† + ØŦŲ„اØŦØ§ØĄ + ØĢØąØĻØđØ§ØĄ + ØŪŲ…ŲŠØģ + ØŽŲ…ØđØĐ + ØģØĻØŠ + ØĢØ­ØŊ + + اŲ„ØđØąØķ: ØŠŲ„Ų‚اØĶŲŠ + اŲ„ØđØąØķ: ØŠŲ„Ų‚اØĶŲŠ ŲƒØĻŲŠØą + اŲ„ØđØąØķ: اŲ„ØĢŲŠŲ‚ŲˆŲ†Ø§ØŠ + اŲ„ØđØąØķ: Ų‚اØĶŲ…ØĐ + Ų…ØģØ­ + ŲØąØē Ø­ØģØĻ: اŲ„اØģŲ… + ŲØąØē Ø­ØģØĻ: اŲ„ØŠØ§ØąŲŠØŪ + ŲØąØē Ø­ØģØĻ: اŲ„Ø­ØŽŲ… + Ų„ا + Ų†ØđŲ… + ØđØąØķ اŲ„ØīØąØ§ØĶØ­ + ØĨŲ†ØīØ§ØĄ ØĩŲˆØą Ų…ØĩØšØąØĐ + ØĨŲ†ØīØ§ØĄ ØĩŲˆØą Ų…ØĩØšØąØĐ + اØŪØŠØĩØ§ØąØ§ØŠ + ØŠŲˆŲ‚Ų Ų…ØĪŲ‚ØŠ + + + Ų†ØģØŪ + Ų†Ų‚Ų„ + حذŲ + ØĨØđاØŊØĐ ØŠØģŲ…ŲŠØĐ + Ų…ØŽŲ„ØŊ ØŽØŊŲŠØŊ + ØŠØĢŲƒŲŠØŊ Ų†ØģØŪ اŲ„Ų…Ų„Ų + ØŠØĢŲƒŲŠØŊ Ų†Ų‚Ų„ اŲ„Ų…Ų„Ų + ØŠØĢŲƒŲŠØŊ حذŲ اŲ„Ų…Ų„ŲØŸ + Ų†ØģØŪ Ų‡Ø°Ų‡ اŲ„Ų…Ų„ŲØ§ØŠØŸ + Ų†Ų‚Ų„ Ų‡Ø°Ų‡ اŲ„Ų…Ų„ŲØ§ØŠØŸ + حذŲ Ų‡Ø°Ų‡ اŲ„Ų…Ų„ŲØ§ØŠØŸ - Ų„ا ŲŠŲ…ŲƒŲ† اŲ„ØŠØąØ§ØŽØđ ØđŲ† حذŲ اŲ„Ų…Ų„ŲØ§ØŠ! + اŲ„حاŲ„ØĐ + اŲ„ŲˆØ­ØŊا؊ + ØđاŲ… + ØđØąØķ اŲ„ØīØąØ§ØĶØ­ + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„Ų†ØļاŲ… + ØđØąØķ + ØĢŲ„ØĻŲˆŲ…ا؊ + ŲŲ†Ø§Ų†ŲˆŲ† + ØĢØšŲ†ŲŠØ§ØŠ + ØĢŲ†ŲˆØ§Øđ + Ų‚ŲˆØ§ØĶŲ… اŲ„ØŠØīØšŲŠŲ„ + ØĻØ­ØŦ + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„Ų†ØļاŲ… + ØŊØąØŽØ§ØŠ اŲ„Ø­ØąØ§ØąØĐ: + ŲˆØ­ØŊØĐ Ø§Ų„Ų…ØđاŲ„ØŽØĐ Ø§Ų„Ų…ØąŲƒØēŲŠØĐ: + ŲˆØ­ØŊØĐ Ų…ØđاŲ„ØŽØĐ Ø§Ų„ØąØģŲˆŲ…ا؊: + اŲ„ŲˆŲ‚ØŠ: + اŲ„حاŲ„ŲŠ: + اŲ„ØĻŲ†Ø§ØĄ: + اŲ„ØīØĻŲƒØĐ: + اŲ„Ų†ŲˆØđ: + ØŦاØĻØŠ + DHCP + ØđŲ†ŲˆØ§Ų† MAC + ØđŲ†ŲˆØ§Ų† IP + اŲ„ØąØ§ØĻØ·: + Ų…ØēØŊŲˆØŽ Ų†ØĩŲŲŠ + Ų…ØēØŊŲˆØŽ اŲ„ا؊؎اŲ‡ + اŲ„Ų…ØŪØēŲ† + اŲ„Ų…Ø­ØąŲƒ + ØŪاŲ„ŲŠ + اŲ„ŲŲŠØŊŲŠŲˆ + ذاŲƒØąØĐ ØŪاŲ„ŲŠØĐ + ØĻŲ„ا ØąØ§ØĻØ· + ØŪاŲ„ŲŠ + ØšŲŠØą Ų…ØŠŲˆŲØą + اŲ„ØđŲ„ØĻØĐ Ų…ŲØŠŲˆØ­ØĐ + Ų‚ØąØ§ØĄØĐ + ØĻŲ„ا Ų‚ØąØĩ + ŲˆØŽŲˆØŊ اŲ„Ų‚ØąØĩ + اŲ„ØīŲƒŲ„ + ØŠŲ…ŲƒŲŠŲ† Ų…Ų„Ų‚Ų… FTP + ØŠŲ…ŲƒŲŠŲ† Ų…ØēاŲ…Ų†ØĐ ŲˆŲ‚ØŠ اŲ„ØĨŲ†ØŠØąŲ†ØŠ + Ų…ØģØŠŲˆŲ‰ اŲ„ØŊŲ‚ØĐ + Ų…طاØĻŲ‚ØĐ Ų…ØđØŊŲ„ ؊حØŊŲŠØŦ اŲ„ØīاØīØĐ Ų…Øđ اŲ„ŲŲŠØŊŲŠŲˆ + + ØŠØ§ØąŲŠØŪ اŲ„ØĨØĩØŊØ§Øą + + + حاŲ„ا؊ + ØĢŲ†Ų…اط + + + ØĢØšŲ†ŲŠØĐ + اŲ„Ų…ØŊØĐ + ؊حØŊŲŠØŊ ØĢŲ„ØĻŲˆŲ… + Ų…Ų‚اطØđ + Ų…ØąØ§ØŽØđØĐ + ؊حØŊŲŠØŦ + ØĻØ­ØŦ ØđŲ† ØĢŲ„ØĻŲˆŲ… + Ų…ŲˆØ§ŲŲ‚ + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ ØĢŲ„ØĻŲˆŲ…ا؊! + ؊حØŊŲŠØŊ اŲ„ŲƒŲ„ + Ų…ØģØ­ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ŲˆØģاØĶØ· + Ø­ŲØļ + Ų†Ų‚Ų„ + Ų…Ø­Ųˆ + Ų…ØģØ­ + ØĻØ­ØŦ... + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…ØđŲ„ŲˆŲ…ا؊! + ؊حØŊŲŠØŊ اŲ„ŲŲŠŲ„Ų…: + اŲ„اØģØŠØđŲ„اŲ… ØđŲ† Ų…ØđŲ„ŲˆŲ…ا؊ %s + ؊حŲ…ŲŠŲ„ ØŠŲØ§ØĩŲŠŲ„ اŲ„ŲŲŠŲ„Ų… + + + + ØŪØ· اŲ„ØđŲ„اŲ…ا؊ + Ų…ØŪطط اŲ„Ų…ŲˆØķŲˆØđ + + اŲ„ØŠØĩŲˆŲŠØŠØ§ØŠ: + Ų…ØŽŲ…ŲˆØđØĐ Ø§Ų„ØđŲ…Ų„ + اŲ„Ų…ŲˆØķŲˆØđ + ØŠØīØšŲŠŲ„ + اŲ„؊اŲ„ŲŠ + اŲ„ØģاØĻŲ‚ + Ų…ØđاŲŠØąØĐ ŲˆØ§ØŽŲ‡ØĐ Ø§Ų„Ų…ØģØŠØŪØŊŲ…... + ØŠŲ†ØģŲŠŲ‚ اŲ„ØīاØīØĐ ŲˆØ§Ų„Ų…ØģØ­ اŲ„ŲØ§ØĶŲ‚... + ØŠŲ„ŲŠŲŠŲ† + ŲƒŲ…ŲŠØĐ Ø§Ų„ØŠŲƒØĻŲŠØą/اŲ„ØŠØĩØšŲŠØą + Ų…ØđØŊŲ„ اŲ„ØĻŲƒØģŲ„ + Ų…Ø­ØąŲƒ ØĢŲ‚ØąØ§Øĩ DVD + ØąØŽØ§ØĄ ØĨØŊØŪاŲ„ اŲ„Ų‚ØąØĩ + Ų…ØīØ§ØąŲƒØĐ ØđŲ† ØĻŲØđØŊ + اŲ„ØīØĻŲƒØĐ ØšŲŠØą Ų…ØŠØĩŲ„ØĐ + ØĨŲ„ØšØ§ØĄ + اŲ„ØģØąØđØĐ + ŲˆŲ‚ØŠ اŲ„اŲ†ØŠŲ‚اŲ„ ØĻŲŠŲ† اŲ„ØĩŲˆØą + اØŪØŠØĻØ§Øą اŲ„ØĢŲ†Ų…اط... + ØĻØ­ØŦ ØđŲ† اØģØ·ŲˆØ§Ų†Ø§ØŠ اŲ„ØĩŲˆØŠ ØđŲ„Ų‰ اŲ„ØĨŲ†ØŠØąŲ†ØŠ + ؊حŲˆŲŠŲ„ Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ Ų‚ŲŠØŊ اŲ„؊حŲ…ŲŠŲ„ + ŲˆŲ‚ØŠ ØŠŲ†ØēŲŠŲ„ HDD + Ų…ØąØīحا؊ اŲ„ŲŲŠØŊŲŠŲˆ + Ų„ا ØīŲŠØĄ + Ų†Ų‚Ø·ØĐ + ØŪØ·ŲŠ + Ų…ØŠØĻاŲŠŲ† اŲ„ØŪŲˆØ§Øĩ + اŲ„ØŠØŪŲ…ØģŲŠØĐ + Ų…ŲƒØđØĻ ؚاŲˆØģŲŠ + ØŠØĩØšŲŠØą + ØŠŲƒØĻŲŠØą + Ų…Ø­Ųˆ Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ ØđŲ†ØŊ اŲ„اŲ†ØŠŲ‡Ø§ØĄ + ØŠØīØšŲŠŲ„ ØŠŲ„Ų‚اØĶŲŠ Ų„ŲŲŠØŊŲŠŲˆ DVD + ØŠØīØšŲŠŲ„ ØŠŲ„Ų‚اØĶŲŠ Ų„Ų€ VCD/SVCD + ØŠØīØšŲŠŲ„ ØŠŲ„Ų‚اØĶŲŠ Ų„اØģØ·ŲˆØ§Ų†ØĐ ØĩŲˆØŠ + ØŠØīØšŲŠŲ„ ØŠŲ„Ų‚اØĶŲŠ Ų„ØĢŲ„ØđاØĻ Xbox + ØŠØīØšŲŠŲ„ ØŠŲ„Ų‚اØĶŲŠ Ų„Ų…Ų„ŲØ§ØŠ اŲ„ŲŲŠØŊŲŠŲˆ + ØŠØīØšŲŠŲ„ ØŠŲ„Ų‚اØĶŲŠ Ų„Ų„Ų…ŲˆØģŲŠŲ‚Ų‰ + ØŠØīØšŲŠŲ„ ØŠŲ„Ų‚اØĶŲŠ Ų„Ų„ØĩŲˆØą + ØģŲŠŲ†Ø§ØąŲŠŲˆŲ‡Ø§ØŠ + اŲ„Ų„ØšØĐ + Ų…ŲˆØģŲŠŲ‚Ų‰ + ØŠØĩŲˆØą + ؊حØŊŲŠØŊ ØŊŲ„ŲŠŲ„ اŲ„ŲˆØŽŲ‡ØĐ + ØĨØŪØąØ§ØŽ اŲ„اØģØŠØąŲŠŲˆ ØĨŲ„Ų‰ ŲƒŲ„ Ų…ŲƒØĻØąØ§ØŠ اŲ„ØĩŲˆØŠ + ØđØŊØŊ اŲ„Ų‚Ų†ŲˆØ§ØŠ + - Ų…Ų„Ų‚Ų… Ų‚اØŊØą ØđŲ„Ų‰ DTS + CDDB + ØĨØ­ØķØ§Øą Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„اØģØ·ŲˆØ§Ų†ØĐ + ØŪØ·ØĢ + ØŠŲ…ŲƒŲŠŲ† Ų‚ØąØ§ØĄØĐ Ø§Ų„ØđŲ„اŲ…ا؊ + ŲØŠØ­ + ØŠŲƒŲ†ŲˆŲ„ŲˆØŽŲŠØ§ ØŠØŊŲŲ‚ + ŲŲŠ اŲ†ØŠØļØ§Øą اŲ„ØĻØŊØĄ... + ØĨØŪØąØ§ØŽ اŲ„ØģŲŠŲ†Ø§ØąŲŠŲˆ + ØŠŲ…ŲƒŲŠŲ† Ų…Ų„Ų‚Ų… اŲ„ŲˆŲŠØĻ + ØŠØģØŽŲŠŲ„ + ØĨŲŠŲ‚اŲ اŲ„ØŠØģØŽŲŠŲ„ + ŲØąØē Ø­ØģØĻ: اŲ„Ų…Ų‚Ø·Øđ + ŲØąØē Ø­ØģØĻ: اŲ„ŲˆŲ‚ØŠ + ŲØąØē Ø­ØģØĻ: اŲ„ØđŲ†ŲˆØ§Ų† + ŲØąØē Ø­ØģØĻ: اŲ„ŲŲ†Ø§Ų† + ŲØąØē Ø­ØģØĻ: اŲ„ØĢŲ„ØĻŲˆŲ… + ØĢŲ‡Ų… 100 + ØŠØđŲˆŲŠØķ Ų…ØģØ­ ØđŲ„ŲˆŲŠ-ØĢŲŠØģØą + ØŠØđŲˆŲŠØķ Ų…ØģØ­ ØģŲŲ„ŲŠ-ØĢŲŠŲ…Ų† + ŲˆØķØđ اŲ„ØŠØąØŽŲ…ØĐ + ØķØĻØ· Ų…ØđØŊŲ„ اŲ„ØĻŲƒØģŲ„ + ØķØĻØ· اŲ„ØģŲ‡Ų… Ų„ØŠØšŲŠŲŠØą ŲƒŲ…ŲŠØĐ Ø§Ų„Ų…ØģØ­ + ØķØĻØ· اŲ„ØīØąŲŠØ· Ų„ØŠØšŲŠŲŠØą ŲˆØķØđ اŲ„ØŠØąØŽŲ…ØĐ + ØķØĻØ· اŲ„Ų…Øģ؊طŲŠŲ„ ح؊Ų‰ ŲŠŲƒŲˆŲ† Ų…ØąØĻØđ ØĻØīŲƒŲ„ ŲƒØ§Ų…Ų„ + ØŠØđØ°Øą ؊حŲ…ŲŠŲ„ اŲ„ØĨØđØŊاØŊا؊ + اØģØŠØŪØŊاŲ… ØĨØđØŊاØŊا؊ اŲØŠØąØ§ØķŲŠØĐ + ØąØŽØ§ØĄ ŲØ­Øĩ Ų…Ų„ŲØ§ØŠ XML + ØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ %i ØđŲ†Ø§ØĩØą + Ų†ØŠØ§ØĶØŽ اŲ„ØĻØ­ØŦ + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų†ØŠØ§ØĶØŽ + Ų…ØąØīØ­ Ų…ØđاŲ„ØŽØĐ ØģاØĻŲ‚ØĐ + ؊حŲ…ŲŠŲ„ اŲ„ØŠØąØŽŲ…ا؊ + اŲ„ØŪØ· + اŲ„Ø­ØŽŲ… + Øķؚط Ų†Ø·Ø§Ų‚ ØŊŲŠŲ†Ø§Ų…ŲŠŲƒŲŠ + اŲ„ŲŲŠØŊŲŠŲˆ + اŲ„ØĩŲˆØŠ + اØģØŠØđØąØ§Øķ اŲ„ØŠØąØŽŲ…ا؊ + ØĨŲ†ØīØ§ØĄ ØđŲ„اŲ…ØĐ Ų…ØąØŽØđŲŠØĐ + Ų…Ø­Ųˆ اŲ„ØđŲ„اŲ…ا؊ اŲ„Ų…ØąØŽØđŲŠØĐ + Ų…ŲˆØ§ØēŲ†ØĐ Ø§Ų„ØĩŲˆØŠ + اŲ„ØđŲ„اŲ…ا؊ اŲ„Ų…ØąØŽØđŲŠØĐ + ؊حØŊŲŠØŊ Ų…ŲˆŲ‚Øđ اŲ„Ų…Ų‚Ø·Øđ اŲ„ØŽØŊŲŠØŊ + ؊حØŊŲŠØŊ Ų…ŲˆŲ‚Øđ اŲ„ØĩŲˆØąØĐ Ø§Ų„Ų…ØĩØšØąØĐ Ø§Ų„ØŽØŊŲŠØŊØĐ + ؊حØŊŲŠØŊ Ų…ŲˆŲ‚Øđ Ų…ØŽŲ„ØŊ اŲ„؊طØĻŲŠŲ‚ا؊ + ØŠØĢØŪŲŠØą + اŲ„Ų„ØšØĐ + Ų…Ų…ŲƒŲŽŲ‘Ų† + ØĻØŊŲˆŲ† ØĩŲØ­Ø§ØŠ ØĻŲŠŲ†ŲŠØĐ ŲØ§ØąØđØĐ + - Ų…ØđاŲ„ØŽØĐ ØģاØĻŲ‚ØĐ ØŠŲ„Ų‚اØĶŲŠØĐ + - Ų…ØąØīØ­ ØĨŲ„ØšØ§ØĄ Ų‚ŲŲ„ ØąØĢØģŲŠ + - Ų…ØąØīØ­ ØĨŲ„ØšØ§ØĄ Ų‚ŲŲ„ ØĢŲŲ‚ŲŠ + - ØģØ·ŲˆØđ/ØŠØĻاŲŠŲ† ØŠŲ„Ų‚اØĶŲŠ + - ØŠŲ‚ØģŲŠŲ… + (0=ØŠŲ„Ų‚اØĶŲŠ) + ØŠŲ†ØļŲŠŲ Ų‚اØđØŊØĐ Ø§Ų„ØĻŲŠØ§Ų†Ø§ØŠ + ؊حØķŲŠØą... + ØŪØ·ØĢ Ų‚اØđØŊØĐ Ø§Ų„ØĻŲŠØ§Ų†Ø§ØŠ + ØĻØ­ØŦ ØđŲ† ØĢØšŲ†ŲŠØ§ØŠ... + ØŠŲ… ØĻŲ†ØŽØ§Ø­ ØŠŲ†ØļŲŠŲ Ų‚اØđØŊØĐ Ø§Ų„ØĻŲŠØ§Ų†Ø§ØŠ + ØŠŲ†ØļŲŠŲ اŲ„ØĢØšŲ†ŲŠØ§ØŠ... + ØŪØ·ØĢ ØĢØŦŲ†Ø§ØĄ ØŠŲ†ØļŲŠŲ اŲ„ØĢØšŲ†ŲŠØ§ØŠ + ØŠŲ†ØļŲŠŲ اŲ„ŲŲ†Ø§Ų†ŲŠŲ†... + ØŪØ·ØĢ ŲŲŠ ØŠŲ†ØļŲŠŲ اŲ„ŲŲ†Ø§Ų†ŲŠŲ† + ØŠŲ†ØļŲŠŲ اŲ„ØĢŲ†ŲˆØ§Øđ... + ØŪØ·ØĢ ŲŲŠ ØŠŲ†ØļŲŠŲ اŲ„ØĢŲ†ŲˆØ§Øđ + ØŠŲ†ØļŲŠŲ اŲ„Ų…ØģØ§ØąØ§ØŠ... + ØŪØ·ØĢ ŲŲŠ ØŠŲ†ØļŲŠŲ اŲ„Ų…ØģØ§ØąØ§ØŠ + ØŠŲ†ØļŲŠŲ اŲ„ØĢŲ„ØĻŲˆŲ…ا؊... + ØŪØ·ØĢ ŲŲŠ ØŠŲ†ØļŲŠŲ اŲ„ØĢŲ„ØĻŲˆŲ…ا؊ + ŲƒØŠØ§ØĻØĐ Ø§Ų„ØŠØšŲŠŲŠØąØ§ØŠ... + ØŪØ·ØĢ ŲŲŠ ŲƒØŠØ§ØĻØĐ Ø§Ų„ØŠØšŲŠŲŠØąØ§ØŠ + Ų‚ØŊ ŲŠØģØŠØšØąŲ‚ Ų‡Ø°Ø§ ØĻØđØķ اŲ„ŲˆŲ‚ØŠ... + Øķؚط Ų‚اØđØŊØĐ Ø§Ų„ØĻŲŠØ§Ų†Ø§ØŠ... + ØŪØ·ØĢ ŲŲŠ Øķؚط Ų‚اØđØŊØĐ Ø§Ų„ØĻŲŠØ§Ų†Ø§ØŠ + Ų‡Ų„ ØŠØąŲŠØŊ ØŠŲ†ØļŲŠŲ اŲ„Ų…ŲƒØŠØĻØĐ؟ + ØŠŲ†ØļŲŠŲ اŲ„Ų…ŲƒØŠØĻØĐ... + ØĻØŊØĄ + ؊حŲˆŲŠŲ„ Ų…ØđØŊŲ„ اŲ„ØĨØ·Ø§Øą + ØĨØŪØąØ§ØŽ اŲ„ØĩŲˆØŠ + ØŠŲ†Ø§ØļØąŲŠ + ØąŲ‚Ų…ŲŠ (S/PDIF) + ŲŲ†Ø§Ų†ŲˆŲ† Ų…ØŠŲ†ŲˆØđŲˆŲ† + ØŠØīØšŲŠŲ„ اŲ„Ų‚ØąØĩ + ØĢŲŲ„اŲ… + ØķØĻØ· Ų…ØđØŊŲ„ اŲ„ØĨØ·Ø§Øą + Ų…Ų…ØŦŲ„ŲˆŲ† + اŲ„ØģŲ†ØĐ + اŲ„ØĻØąØ§Ų…ØŽ + ØĨŲŠŲ‚اŲ + Ų…ØđØŠŲ… + ØĢØģŲˆØŊ + Ų…Ų…ØąØ§ØŠ اŲ„Ų…ØĩŲŲˆŲØĐ + اŲ„ØĻØŊØĄ ØĻØđØŊ + ŲˆØķØđ ØīاØīØĐ Ø§Ų„ØŠŲˆŲ‚Ų + Ų…ŲˆŲ‚ØŠ ŲˆØļŲŠŲØĐ Ø§Ų„ØĨØšŲ„اŲ‚ + ŲƒŲ„ اŲ„ØĢŲ„ØĻŲˆŲ…ا؊ + اŲ„ØĢŲ„ØĻŲˆŲ…ا؊ اŲ„Ų…ØķاŲØĐ Ø­ØŊŲŠØŦاŲ‹ + ØīاØīØĐ Ø§Ų„ØŠŲˆŲ‚Ų + ØđØąØķ اŲ„ØīØąØ§ØĶØ­ R. + Ų…ØģØŠŲˆŲ‰ ØĻŲ‡ØŠØ§Ų† ØīاØīØĐ Ø§Ų„ØŠŲˆŲ‚Ų + ŲØąØē Ø­ØģØĻ: اŲ„Ų…Ų„Ų + - Ų…ØģØŠŲ‚ØĻŲ„ Ų‚اØŊØą ØđŲ„Ų‰ ØŊŲˆŲ„ØĻŲŠ ØąŲ‚Ų…ŲŠ + ŲØąØē Ø­ØģØĻ: اŲ„اØģŲ… + ŲØąØē Ø­ØģØĻ: اŲ„ØģŲ†ØĐ + ŲØąØē Ø­ØģØĻ: اŲ„ØŠŲ‚ŲŠŲ… + IMDb + اŲ„ØđŲ†ŲˆØ§Ų† + ØđŲˆØ§ØĩŲ ØąØđØŊŲŠØĐ + ØŽØēØĶŲŠ + ؚاŲ„ØĻاŲ‹ + Ų…ØīŲ…Øģ + ؚاØĶŲ… + ØŦŲ„ŲˆØŽ + Ų…Ø·Øą + ØŪŲŲŠŲ + ØĩØĻاحاŲ‹ + Ų…ØģØ§ØĄØ§Ų‹ + ØĢŲ…Ø·Ø§Øą ØīØŊŲŠØŊØĐ + Ų‚Ų„ŲŠŲ„ + Ų…ØŠØĻØđØŦØą + ØąŲŠØ§Ø­ + Ų‚ŲˆŲŠ + Ų…ØđØŠØŊŲ„ + ØĩاŲŲŠ + ØģØ­ØĻ + Ų…ØĻŲƒØąØ§Ų‹ + Ų…Ø·Øą ØīØŊŲŠØŊ + Ų‡ØĻŲˆØĻ ØąŲŠØ§Ø­ + Ų…Ų†ØŪŲØķ + Ų…ØŠŲˆØģØ· + Ų…ØąØŠŲØđ + ØķØĻاØĻ + ØķØĻاØĻ ØąŲ‚ŲŠŲ‚ + ؊حØŊŲŠØŊ اŲ„Ų…ŲˆŲ‚Øđ + ŲˆŲ‚ØŠ اŲ„؊حØŊŲŠØŦ + ŲˆØ­ØŊا؊ ØŊØąØŽØĐ Ø§Ų„Ø­ØąØ§ØąØĐ + ŲˆØ­ØŊا؊ اŲ„ØģØąØđØĐ + اŲ„Ø·Ų‚Øģ + ØŊØąØŽØĐ Ø§Ų„Ø­ØąØ§ØąØĐ + ØīØđŲˆØą ŲƒŲ€ + ŲŲ‡ØąØģ UV + ØąŲŠØ§Ø­ + Ų†Ų‚Ø·ØĐ Ø§Ų„Ų†ØŊŲ‰ + اŲ„ØąØ·ŲˆØĻØĐ + Ų…Ų† + ØđŲ†ØŊ + اŲ„اŲØŠØąØ§Øķا؊ + + اŲ„ŲˆØĩŲˆŲ„ ØĨŲ„Ų‰ ØŪØŊŲ…ØĐ Ø§Ų„Ø·Ų‚Øģ + اŲ„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ اŲ„Ø·Ų‚Øģ Ų„Ų€: + ØŠØđØ°Øą اŲ„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ ØĻŲŠØ§Ų†Ø§ØŠ اŲ„Ø·Ų‚Øģ + ŲŠØŊŲˆŲŠ + ØĻŲ„ا Ų…ØąØ§ØŽØđØĐ Ų„Ų‡Ø°Ø§ اŲ„ØĢŲ„ØĻŲˆŲ… + ØŠŲ†ØēŲŠŲ„ اŲ„ØĩŲˆØąØĐ Ø§Ų„Ų…ØĩØšØąØĐ... + ØšŲŠØą Ų…؊اح + اŲ„ØđØąØķ: ØĢŲŠŲ‚ŲˆŲ†Ø§ØŠ ŲƒØĻŲŠØąØĐ + + + + + حذŲ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØĢŲ„ØĻŲˆŲ… + حذŲ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„اØģØ·ŲˆØ§Ų†ØĐ + ؊حØŊŲŠØŊ + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØĢŲ„ØĻŲˆŲ… + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„اØģØ·ŲˆØ§Ų†ØĐ + Ų‚ØąØĩ + ØĢØŊØŪŲ„ CD/DVD ØĩØ­ŲŠØ­ + ØąØŽØ§ØĄ ØĨØŊØŪاŲ„ CD/DVD اŲ„؊اŲ„ŲŠ + ŲØąØē Ø­ØģØĻ: ØąŲ‚Ų… DVD + ØĻŲ„ا ذاŲƒØąØĐ Ø§Ø­ØŠŲŠØ§Ø·ŲŠØĐ + ØĨØēاŲ„ØĐ Ø§Ų„ŲŲŠŲ„Ų… Ų…Ų† اŲ„Ų…ŲƒØŠØĻØĐ + ØĨØēاŲ„ØĐ '%s' ØĻاŲ„ŲØđŲ„ØŸ + + + + Ų‚ØąØĩ Ų‚اØĻŲ„ Ų„Ų„ØĨØēاŲ„ØĐ + Ų…Ų„Ų Ų…ŲØŠŲˆØ­ + ذاŲƒØąØĐ Ø§Ø­ØŠŲŠØ§Ø·ŲŠØĐ + Ų‚ØąØĩ ØĩŲ„ØĻ + UDF + ØīØĻŲƒØĐ Ų…Ø­Ų„ŲŠØĐ + اŲ„ØĨŲ†ØŠØąŲ†ØŠ + اŲ„ŲŲŠØŊŲŠŲˆ + اŲ„ØĩŲˆØŠ + DVD + ØŠØīØšŲŠŲ„ ØŠŲ„Ų‚اØĶŲŠ + LCD + Ų…Ų…ŲƒŲŽŲ‘Ų† + ØĢØđŲ…ØŊØĐ + ØđŲ†ŲˆØ§Ų† اŲ„ØĩŲ 1 + ØđŲ†ŲˆØ§Ų† اŲ„ØĩŲ 2 + ØđŲ†ŲˆØ§Ų† اŲ„ØĩŲ 3 + ØđŲ†ŲˆØ§Ų† اŲ„ØĩŲ 4 + اŲ„ØĩŲŲˆŲ + اŲ„ŲˆØķØđ + ØŠØĻØŊŲŠŲ„ اŲ„ØđØąØķ + ŲØąØđŲŠØ§ØŠ + ØŠØŊŲŲ‚ اŲ„ØĩŲˆØŠ + [Ų†ØīØ·] + ØŠØąØŽŲ…ØĐ + ØķŲˆØĄ ØŪŲ„ŲŲŠ + ØģØ·ŲˆØđ + ØŠØĻاŲŠŲ† + ؎اŲ…ا + اŲ„Ų†ŲˆØđ + Ų†Ų‚Ų„ اŲ„ØīØąŲŠØ· Ų„ØŠØšŲŠŲŠØą ŲˆØķØđ OSD + ŲˆØķØđ OSD + اŲ„Ų…ØīØ§ØąŲƒŲˆŲ† + Modchip + ØĨŲŠŲ‚اŲ + Ų…ŲˆØģŲŠŲ‚Ų‰ ŲŲ‚Ø· + Ų…ŲˆØģŲŠŲ‚Ų‰ ŲˆŲŲŠØŊŲŠŲˆ + ØŠØđØ°Øą ؊حŲ…ŲŠŲ„ Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + OSD + اŲ„ØīŲƒŲ„ ŲˆØ§Ų„Ų„ØšØĐ + اŲ„Ų…ØļŲ‡Øą + ØŪŲŠØ§ØąØ§ØŠ اŲ„ØĩŲˆØŠ + Ø­ŲˆŲ„ XBMC + + + حذŲ ØĢŲ„ØĻŲˆŲ… + ØŠŲƒØąØ§Øą + ØŠŲƒØąØ§Øą ŲˆØ§Ø­ØŊ + ØŠŲƒØąØ§Øą Ų…ØŽŲ„ØŊ + ØŠØīØšŲŠŲ„ ØŠŲ„Ų‚اØĶŲŠ Ų„Ų„ØđŲ†ØĩØą اŲ„؊اŲ„ŲŠ + - اØģØŠØŪØŊاŲ… ØĢŲŠŲ‚ŲˆŲ†Ø§ØŠ ŲƒØĻŲŠØąØĐ + ØŠØšŲŠŲŠØą Ø­ØŽŲ… VobSubs + ØŪŲŠØ§ØąØ§ØŠ Ų…ØŠŲ‚ØŊŲ…ØĐ (Ų„Ų„ØŪØĻØąØ§ØĄ ŲŲ‚Ø·!) + اŲ„Ų…ØģاحØĐ Ø§Ų„ØąØĢØģŲŠØĐ Ø§Ų„ŲƒŲ„ŲŠØĐ Ų„Ų„ØĩŲˆØŠ + ØąŲØđ Ų…ØđØŊŲ„ Ų…ØđاŲŠŲ†ØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ ØĨŲ„Ų‰ Ų…ØģØŠŲˆŲ‰ ØŊŲ‚ØĐ ŲˆØ­ØŊØĐ Ų…ØđاŲ„ØŽØĐ Ø§Ų„ØąØģŲˆŲ…ا؊ + Ų…ØđاŲŠØąØĐ + ØĨØŪŲØ§ØĄ اŲ…ØŠØŊاØŊا؊ اŲ„ŲˆØģاØĶØ· + ŲØąØē Ø­ØģØĻ: اŲ„Ų†ŲˆØđ + ØŠØđØ°Øą اŲ„ا؊ØĩاŲ„ ØĻØŪØŊŲ…ØĐ Ø§Ų„ØĻØ­ØŦ ØđŲ„Ų‰ اŲ„ØĨŲ†ØŠØąŲ†ØŠ + ŲØīŲ„ ØŠŲ†ØēŲŠŲ„ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØĢŲ„ØĻŲˆŲ… + ØĻØ­ØŦ ØđŲ† ØĢØģŲ…Ø§ØĄ اŲ„ØĢŲ„ØĻŲˆŲ…ا؊... + ŲØŠØ­ + ØīؚاŲ„ + ŲØ§ØąØš + ؊حŲ…ŲŠŲ„ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ŲˆØģاØĶØ· Ų…Ų† اŲ„Ų…Ų„ŲØ§ØŠ... + ŲØąØē Ø­ØģØĻ: اŲ„اØģØŠØŪØŊاŲ… + ØŠŲ…ŲƒŲŠŲ† اŲ„ØŠØĩŲˆØąØ§ØŠ + ØŠŲ…ŲƒŲŠŲ† ØŠØĻØŊŲŠŲ„ ŲˆØķØđ اŲ„ŲŲŠØŊŲŠŲˆ + Ų†Ø§ŲØ°ØĐ ØĻØŊØĄ اŲ„ØŠØīØšŲŠŲ„ + Ų†Ø§ŲØ°ØĐ Ø§Ų„ØĩŲØ­ØĐ Ø§Ų„ØąØĶŲŠØģŲŠØĐ + ØĨØđØŊاØŊا؊ ŲŠØŊŲˆŲŠØĐ + اŲ„Ų†ŲˆØđ + ØđŲ…Ų„ ØĢØąØīŲŠŲØ§ØŠ Ų…ØŪØēŲ†ØĐ Ų…Øđ Ų…Ų„Ų ŲˆØ§Ø­ØŊ ŲˆØ§ØķØ­ + اŲ„ØĢŲ„ØĻŲˆŲ…ا؊ اŲ„Ų…ØīØšŲ„ØĐ Ø­ØŊŲŠØŦاŲ‹ + ØŠØīØšŲŠŲ„ + ØŠØīØšŲŠŲ„ ŲŲŠ... + ØŠØ­ØąŲŠØą ØđŲ†ŲˆØ§Ų† XBE + Ų†ØĩŲˆØĩ + ØĨØēاŲ„ØĐ Ø§Ų„Ų…ØĩØŊØą + ØŠØĻØŊŲŠŲ„ اŲ„ŲˆØģاØĶØ· + ؊حØŊŲŠØŊ Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + Ų‚اØĶŲ…ØĐ ØŠØīØšŲŠŲ„ ØŽØŊŲŠØŊØĐ... + ØĨØķاŲØĐ ØĨŲ„Ų‰ Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + ØĨØķاŲØĐ ŲŠØŊŲˆŲŠØĐ ØĨŲ„Ų‰ اŲ„Ų…ŲƒØŠØĻØĐ + ØĨØŊØŪاŲ„ ØđŲ†ŲˆØ§Ų† + اŲ„ØŪØ·ØĢ: ØđŲ†ŲˆØ§Ų† Ų…ŲƒØąØą + ؊حØŊŲŠØŊ اŲ„Ų†ŲˆØđ + Ų†ŲˆØđ ØŽØŊŲŠØŊ + ØĨØķاŲØĐ ŲŠØŊŲˆŲŠØĐ + ØĨØŊØŪاŲ„ اŲ„Ų†ŲˆØđ + اŲ„ØđØąØķ: %s + Ų‚اØĶŲ…ØĐ + اŲ„ØĢŲŠŲ‚ŲˆŲ†Ø§ØŠ + Ų‚اØĶŲ…ØĐ ŲƒØĻŲŠØąØĐ + ØĢŲŠŲ‚ŲˆŲ†Ø§ØŠ ŲƒØĻŲŠØąØĐ + ØđØąŲŠØķ + ØđØąØķ ŲƒØĻŲŠØą + ØĢŲŠŲ‚ŲˆŲ†Ø§ØŠ اŲ„ØĢŲ„ØĻŲˆŲ… + ØĢŲŠŲ‚ŲˆŲ†Ø§ØŠ DVD + DVD + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ŲˆØģاØĶØ· + ØŽŲ‡Ø§Øē ØĨØŪØąØ§ØŽ اŲ„ØĩŲˆØŠ + ØŽŲ‡Ø§Øē ØĨØŪØąØ§ØŽ اŲ„Ų…Ų†ŲØ° + Ų„ا ØŠŲˆØŽØŊ ØģŲŠØąØĐ Ø°Ø§ØŠŲŠØĐ Ų„Ų‡Ø°Ø§ اŲ„ŲŲ†Ø§Ų† + ØĩŲˆØŠ Ų…ØŠØđØŊØŊ اŲ„Ų‚Ų†ŲˆØ§ØŠ Downmix ØĨŲ„Ų‰ اØģØŠØąŲŠŲˆ + اŲ„؊حŲƒŲ… ŲŲŠ اŲ„Ø­ØŽŲ… اŲ„ØąØĶŲŠØģŲŠ + + ŲØąØē Ø­ØģØĻ: %s + اŲ„اØģŲ… + اŲ„ØŠØ§ØąŲŠØŪ + اŲ„Ø­ØŽŲ… + اŲ„Ų…Ų‚Ø·Øđ + اŲ„ŲˆŲ‚ØŠ + اŲ„ØđŲ†ŲˆØ§Ų† + اŲ„ŲŲ†Ø§Ų† + اŲ„ØĢŲ„ØĻŲˆŲ… + Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + اŲ„Ų…ØđØąŲ + اŲ„Ų…Ų„Ų + اŲ„ØģŲ†ØĐ + ØŠŲ… اŲ„ØŠŲ‚ŲŠŲŠŲ… + اŲ„Ų†ŲˆØđ + اŲ„اØģØŠØŪØŊاŲ… + ŲŲ†Ø§Ų† اŲ„ØĢŲ„ØĻŲˆŲ… + ØŠØīØšŲŠŲ„ اŲ„ØđØŊ + ØĒØŪØą ØŠØīØšŲŠŲ„ + اŲ„ØŠØđŲ„ŲŠŲ‚ + ØŠØ§ØąŲŠØŪ اŲ„ØĨØķاŲØĐ + اŲØŠØąØ§ØķŲŠ + اŲ„اØģØŠŲˆØŊŲŠŲˆ + اŲ„Ų…ØģØ§Øą + اŲ„ØŠØąØŽŲ…ا؊ + ØđØąØķ Ų…ØŠŲ‚ØŊŲ… + ØĨØŪŲØ§ØĄ Ų…ØŠŲ‚ØŊŲ… + + ا؊؎اŲ‡ اŲ„ŲØąØē + Ø·ØąŲŠŲ‚ØĐ Ø§Ų„ŲØąØē + ŲˆØķØđ اŲ„ØđØąØķ + ؊ذŲƒØą اŲ„ØđØąŲˆØķ Ų„Ų…ØŽŲ„ØŊا؊ Ų…ØŪØŠŲ„ŲØĐ + ØŠØĩاØđØŊŲŠ + ØŠŲ†Ø§ØēŲ„ŲŠ + ØŠØ­ØąŲŠØą Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + Ų…ØąØīØ­ + ØĨŲ„ØšØ§ØĄ ŲˆØķØđ اŲ„Ø­ŲŲ„ØĐ + ŲˆØķØđ اŲ„Ø­ŲŲ„ØĐ + ØđØīŲˆØ§ØĶŲŠ + ØĨŲŠŲ‚اŲ + ŲˆØ§Ø­ØŊ + اŲ„ŲƒŲ„ + ØĨŲŠŲ‚اŲ + ØŠŲƒØąØ§Øą: ØĨŲŠŲ‚اŲ + ØŠŲƒØąØ§Øą: ŲˆØ§Ø­ØŊ + ØŠŲƒØąØ§Øą: اŲ„ŲƒŲ„ + + ØŠŲ‚ØģŲŠŲ… اØģØ·ŲˆØ§Ų†ØĐ ØĩŲˆØŠ + Ų…ØŠŲˆØģØ· + Ų‚ŲŠØ§ØģŲŠ + ŲØ§ØĶŲ‚ + Ų…ØđØŊŲ„ ØĨØąØģاŲ„ ØĻ؊ا؊ ØŦاØĻØŠ + ØŠŲ‚ØģŲŠŲ…... + + ØĨŲ„Ų‰: + ØŠØđØ°Øą ØŠŲ‚ØģŲŠŲ… اŲ„اØģØ·ŲˆØ§Ų†ØĐ ØĢŲˆ اŲ„Ų…Ų‚Ø·Øđ + Ų„Ų… ŲŠØŠŲ… ØķØĻØ· CDDARipPath. + ØŠŲ‚ØģŲŠŲ… Ų…Ų‚Ø·Øđ ØĩŲˆØŠŲŠ + ØĨØŊØŪاŲ„ ØąŲ‚Ų… + + ØŠŲ‚ØģŲŠŲ… اŲ„اØģØ·ŲˆØ§Ų†ØĐ + Ų…ØīŲØą + اŲ„ØŽŲˆØŊØĐ + Ų…ØđØŊŲ„ ØĨØąØģاŲ„ ØĻØŠ + ØŠØķŲ…ŲŠŲ† ØąŲ‚Ų… اŲ„Ų…Ų‚Ø·Øđ + ŲƒŲ„ ØĢØšŲ†ŲŠØ§ØŠ + ŲˆØķØđ اŲ„ØđØąØķ + ØđاØŊŲŠ + ØŠŲƒØĻŲŠØą/ØŠØĩØšŲŠØą + ØŠŲ…ØŊŲŠØŊ 4:3 + ØŠŲ…ØŊŲŠØŊ 14:9 + ØŠŲ…ØŊŲŠØŊ 16:9 + اŲ„Ø­ØŽŲ… اŲ„ØĢØĩŲ„ŲŠ + Ų…ØŪØĩØĩ + ØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ + ØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ ŲˆØķØđ اŲ„اŲƒØŠØģاØĻ + اØģØŠØŪØŊاŲ… Ų…ØģØŠŲˆŲŠØ§ØŠ اŲ„Ų…Ų‚اطØđ + اØģØŠØŪØŊاŲ… Ų…ØģØŠŲˆŲŠØ§ØŠ اŲ„ØĢŲ„ØĻŲˆŲ… + Ų…ØģØŠŲˆŲ‰ PreAmp - ØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ اŲ„Ų…Ų„ŲØ§ØŠ اŲ„Ų…ŲƒØŠØģØĻØĐ + Ų…ØģØŠŲˆŲ‰ PreAmp - ØĻŲ„ا ØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ Ų„Ų„Ų…Ų„ŲØ§ØŠ اŲ„Ų…ŲƒØŠØģØĻØĐ + ØŠØŽŲ†ØĻ اŲ„ØĨØąŲØ§Ų‚ ØđŲ†ØŊ ØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ اŲ„Ų…Ų„ŲØ§ØŠ اŲ„Ų…ŲƒØŠØģØĻØĐ + ØŽŲ…Øđ اŲ„ØĢØīØąØ·ØĐ Ø§Ų„ØģŲˆØŊØ§ØĄ + ŲŲŠ حا؎ØĐ ØĨŲ„Ų‰ ŲŲƒ Ų…Ų„Ų ŲƒØĻŲŠØą. Ų…؊اØĻØđØĐ؟ + ØĨØēاŲ„ØĐ Ų…Ų† اŲ„Ų…ŲƒØŠØĻØĐ + ØŠØĩØŊŲŠØą Ų…ŲƒØŠØĻØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ + اØģØŠŲŠØąØ§ØŊ Ų…ŲƒØŠØĻØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ + اØģØŠŲŠØąØ§ØŊ + ØŠØĩØŊŲŠØą + اØģØŠØđØąØ§Øķ اŲ„Ų…ŲƒØŠØĻØĐ + ØģŲ†ŲˆØ§ØŠ + ؊حØŊŲŠØŦ اŲ„Ų…ŲƒØŠØĻØĐ + ØđØąØķ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØĨØĩŲ„اح + اØģØŠØđØąØ§Øķ اŲ„Ų‚اØĻŲ„ Ų„Ų„ØŠŲ†ŲŲŠØ° + اØģØŠØđØąØ§Øķ Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + اØģØŠØđØąØ§Øķ Ų„Ų„Ų…ØŽŲ„ØŊ + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØĢØšŲ†ŲŠØĐ + + ØŠŲƒØĻŲŠØą اŲ„Ø­ØŽŲ… + اØŪØŠØĻØ§Øą Ų…ØŽŲ„ØŊ ØŠØĩØŊŲŠØą + Ų‡Ø°Ø§ اŲ„Ų…Ų„Ų Ų„Ų… ŲŠØđØŊ Ų…ØŠŲˆŲØąØ§Ų‹. + Ų‡Ų„ ØŠØąŲŠØŊ ØĨØēاŲ„ØŠŲ‡ Ų…Ų† اŲ„Ų…ŲƒØŠØĻØĐ؟ + اØģØŠØđØąØ§Øķ اŲ„ØģŲŠŲ†Ø§ØąŲŠŲˆ + + ØŠŲ†ØļŲŠŲ اŲ„Ų…ŲƒØŠØĻØĐ + ØĨØēاŲ„ØĐ Ø§Ų„ØĢØšŲ†ŲŠØ§ØŠ اŲ„Ų‚ØŊŲŠŲ…ØĐ Ų…Ų† اŲ„Ų…ŲƒØŠØĻØĐ + ØŠŲ… Ų…ØģØ­ Ų‡Ø°Ø§ اŲ„Ų…ØģØ§Øą Ų…Ų† Ų‚ØĻŲ„ + اŲ„ØīØĻŲƒØĐ + - Ų…ØķŲŠŲ ØĻØąŲˆŲƒØģŲŠ HTTP + - Ų…Ų†ŲØ° ØĻØąŲˆŲƒØģŲŠ HTTP + ØŠŲ…ŲƒŲŠŲ† ØĻØąŲˆŲƒØģŲŠ HTTP + - اØģŲ… Ų…ØģØŠØŪØŊŲ… ØĻØąŲˆŲƒØģŲŠ HTTP + - ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą ØĻØąŲˆŲƒØģŲŠ HTTP + ØĻØąŲˆØŠŲˆŲƒŲˆŲ„ اŲ„ØĨŲ†ØŠØąŲ†ØŠ (IP) + ØŠŲ… ؊حØŊŲŠØŊ Ų…Ų†ŲØ° ØšŲŠØą ØĩاŲ„Ø­. ŲŠØŽØĻ ØĢŲ† ØŠŲƒŲˆŲ† اŲ„Ų‚ŲŠŲ…ØĐ ØĻŲŠŲ† 1 Ųˆ 65535. + ØĻØąŲˆŲƒØģŲŠ + Ų…ØķŲŠŲ ØĻØąŲˆŲƒØģŲŠ HTTP ŲØ§ØąØš[CR]ØģŲŠØŠŲ… ØŠØđØ·ŲŠŲ„ اŲ„ØĻØąŲˆŲƒØģŲŠ + - ØŠŲƒŲˆŲŠŲ† + ØŠŲ„Ų‚اØĶŲŠØ§Ų‹ (اØģØŠØŪØŊاŲ… DHCP) + ŲŠØŊŲˆŲŠØ§Ų‹ + اŲØŠØąØ§ØķŲŠ (Ų„ŲˆØ­ØĐ Ų‚ŲŠØ§Øģ) + - ØđŲ†ŲˆØ§Ų† IP + - Ų‚Ų†Ø§Øđ اŲ„ØīØĻŲƒØĐ + - ØĻŲˆØ§ØĻØĐ Ø§ŲØŠØąØ§ØķŲŠØĐ + - Ų…Ų„Ų‚Ų… DNS + Ø­ŲØļ ŲˆØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ + ØŠŲ… ؊حØŊŲŠØŊ ØđŲ†ŲˆØ§Ų† ØšŲŠØą ØĩاŲ„Ø­. ŲŠØŽØĻ ØĢŲ† ØŠŲƒŲˆŲ† اŲ„Ų‚ŲŠŲ…ØĐ AAA.BBB.CCC.DDD + Ų…Øđ ØĢØąŲ‚اŲ… ØĻŲŠŲ† 0 Ųˆ 255. + Ų„Ų… ŲŠØŠŲ… Ø­ŲØļ اŲ„ØŠØšŲŠŲŠØąØ§ØŠ. ؊اØĻØđ ØĻØŊŲˆŲ† Ø­ŲØļ؟ + Ų…Ų„Ų‚Ų… اŲ„ŲˆŲŠØĻ + Ų…Ų„Ų‚Ų… FTP + ŲˆŲ‚ØŠ اŲ„ØĨŲ†ØŠØąŲ†ØŠ + - Ų…Ų†ŲØ° Ų…Ų„Ų‚Ų… اŲ„ŲˆŲŠØĻ + Ų…ØķŲŠŲ Ų…Ų„Ų‚Ų… اŲ„ŲˆŲ‚ØŠ + Ø­ŲØļ ŲˆØŠØ·ØĻŲŠŲ‚ + - ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą Ų…Ų„Ų‚Ų… اŲ„ŲˆŲŠØĻ (اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ…: boxee) + ØĻŲ„ا Ų…ØąŲˆØą + Ų…ØŽŲ…ŲˆØđØĐ Ø§Ų„Ø­ØąŲˆŲ + اŲ„ØĢØģŲ„ŲˆØĻ + اŲ„Ų„ŲˆŲ† + ØđاØŊŲŠ + ØĢØģŲˆØŊ ØđØąŲŠØķ + Ų…اØĶŲ„ + ØĢØģŲˆØŊ ØđØąŲŠØķ Ų…اØĶŲ„ + ØĢØĻŲŠØķ + ØĢØĩŲØą + Ų…Ų„ŲØ§ØŠ + Ų„ا ØŠŲˆØŽØŊ Ų…ØđŲ„ŲˆŲ…ا؊ Ų…Ų…ØģŲˆØ­ØĐ Ų„Ų‡Ø°Ø§ اŲ„ØđØąØķ + ØąØŽØ§ØĄ ØĨŲ‚ŲØ§Ų„ ŲˆØķØđ اŲ„Ų…ŲƒØŠØĻØĐ + ØŪØ·ØĢ ØĢØŦŲ†Ø§ØĄ ؊حŲ…ŲŠŲ„ اŲ„ØĩŲˆØąØĐ + ØŠØ­ØąŲŠØą اŲ„Ų…ØģØ§Øą + ØĩŲˆØąØĐ Ų…ØąØĒØĐ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ؟ + ØĨØēاŲ„ØĐ Ø§Ų„Ų…ØĩØŊØą + + + ØĨØķاŲØĐ ØąØ§ØĻØ· ØĻØąŲ†Ø§Ų…ØŽ + ØŠØ­ØąŲŠØą Ų…ØģØ§Øą ØĻØąŲ†Ø§Ų…ØŽ + ØŠØ­ØąŲŠØą اØģŲ… ØĻØąŲ†Ø§Ų…ØŽ + ØŠØ­ØąŲŠØą ØđŲ…Ų‚ Ų…ØģØ§Øą + + اŲ„ØđØąØķ: Ų‚اØĶŲ…ØĐ ŲƒØĻŲŠØąØĐ + ØĢØĩŲØą + ØĢØĻŲŠØķ + ØĢØēØąŲ‚ + ØĢØŪØķØą ŲØ§ØŠØ­ + ØĢØŪØķØą Ų…ØĩŲØą + ØĢØēØąŲ‚ Ų…ØŪØķØą + Ų…Ø­ŲŲˆØļ + Ų…Ø­ŲŲˆØļ + Ų…Ø­ŲŲˆØļ + Ų…Ø­ŲŲˆØļ + اŲ„Ų…ØīØ§ØąŲƒØĐ ØšŲŠØą Ų…ØŠŲˆŲØąØĐ + - Ų…Ø­ØŊØŊ FATX ØŠŲ„Ų‚اØĶŲŠ + اŲ„ØĩŲˆØŠ + ØĻØ­ØŦ + Ų…ØŽŲ„ØŊ ØđØąØķ اŲ„ØīØąØ§ØĶØ­ + ŲˆØ§ØŽŲ‡ØĐ Ø§Ų„ØīØĻŲƒØĐ + - اØģŲ… ØīØĻŲƒØĐ Ų„اØģŲ„ŲƒŲŠØĐ + - ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą Ų„اØģŲ„ŲƒŲŠØĐ + - ØŪØĩŲˆØĩŲŠØĐ Ų„اØģŲ„ŲƒŲŠØĐ + Ø­ŲØļ ŲˆØŠØ·ØĻŲŠŲ‚ ØŠØšŲŠŲŠØąØ§ØŠ اŲ„ØīØĻŲƒØĐ... + ØĻŲ„ا ØŠØīŲŲŠØą + WEP + WPA + WPA2 + ؊طØĻŲŠŲ‚ ØĨØđØŊاØŊا؊ اŲ„ØīØĻŲƒØĐ ØąØŽØ§ØĄ اŲ„اŲ†ØŠØļØ§Øą. + ØŠŲ… ØĻŲ†ØŽØ§Ø­ ØŠŲƒŲˆŲŠŲ† اŲ„ØīØĻŲƒØĐ + Ų„Ų… ŲŠØŠŲ… ØŠŲƒŲˆŲŠŲ† ØĨØđØŊاØŊا؊ اŲ„ØīØĻŲƒØĐ ØĻØīŲƒŲ„ ØĩØ­ŲŠØ­ + ØŠŲ… ØŠØđØ·ŲŠŲ„ اŲ„ŲˆØ§ØŽŲ‡ØĐ + ØŠŲ… ØĻŲ†ØŽØ§Ø­ ØŠØđØ·ŲŠŲ„ ŲˆØ§ØŽŲ‡ØĐ Ø§Ų„ØīØĻŲƒØĐ + اØģŲ… ØīØĻŲƒØĐ Ų„اØģŲ„ŲƒŲŠØĐ + + Ų…Ų„Ų‚Ų… اŲ„Ø­ØŊØŦ + ØŠŲ…ŲƒŲŠŲ† Ų…Ų„Ų‚Ų… اŲ„Ø­ØŊØŦ + Ų…Ų†ŲØ° + Ų†Ø·Ø§Ų‚ اŲ„Ų…Ų†ŲØ° + اŲ„ØģŲ…اح ØĻا؊ØĩاŲ„ ØĢØŽŲ‡ØēØĐ ØĢØŪØąŲ‰ + ØŠØĢØŪŲŠØą اŲ„ØŠŲƒØąØ§Øą اŲ„ØĢŲˆŲ„ŲŠ (Ų… ØŦ) + ØŠØĢØŪŲŠØą اŲ„ØŠŲƒØąØ§Øą اŲ„Ų…ØģØŠŲ…Øą (Ų… ØŦ) + ØĢŲ‚ØĩŲ‰ ØđØŊØŊ Ų„Ų„ØđŲ…Ų„Ø§ØĄ + ØĢØĩØŊŲ‚Ø§ØĄ + ØĻاŲ„ØšŲˆŲ† + Ų…ØŽŲ…ŲˆØđØĐ Ø§Ų„Ø­ØąŲˆŲ + AirPlay + Ų…ØđاŲŠŲ†ØĐ ØīاØīØĐ Ø§Ų„ØŠŲˆŲ‚Ų... + ØŠØđØ°Øą اŲ„ا؊ØĩاŲ„ + ØŠØđØ°Øą اŲ„ا؊ØĩاŲ„ ØĻŲ…ŲˆŲ‚Øđ اŲ„ØīØĻŲƒØĐ. + Ų‚ØŊ ŲŠŲƒŲˆŲ† Ų‡Ø°Ø§ Ų†ØŠŲŠØŽØĐ Ų„ØđØŊŲ… ا؊ØĩاŲ„ اŲ„ØīØĻŲƒØĐ. + Ų‡Ų„ ØŠØąŲŠØŊ ØĨØķاŲØŠŲ‡ ØĻØĢŲŠ حاŲ„ØŸ + + ØđŲ†ŲˆØ§Ų† IP + ØĨØķاŲØĐ Ų…ŲˆŲ‚Øđ اŲ„ØīØĻŲƒØĐ + اŲ„ØĻØąŲˆØŠŲˆŲƒŲˆŲ„ + ØđŲ†ŲˆØ§Ų† اŲ„Ų…Ų„Ų‚Ų… + اØģŲ… اŲ„Ų…Ų„Ų‚Ų… + Ų…ØģØ§Øą ØđŲ† ØĻŲØđØŊ + Ų…ØŽŲ„ØŊ Ų…ØīØŠØąŲƒ + Ų…Ų†ŲØ° + اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… + اØģØŠØđØąØ§Øķ Ų…Ų„Ų‚Ų… اŲ„ØīØĻŲƒØĐ + ØĨØŊØŪاŲ„ ØđŲ†ŲˆØ§Ų† اŲ„ØīØĻŲƒØĐ Ø§Ų„ØŪاØĩ ØĻاŲ„Ų…Ų„Ų‚Ų… + ØĨØŊØŪاŲ„ اŲ„Ų…ØģØ§Øą ØđŲ„Ų‰ اŲ„Ų…Ų„Ų‚Ų… + ØĨØŊØŪاŲ„ ØąŲ‚Ų… اŲ„Ų…Ų†ŲØ° + ØĨØŊØŪاŲ„ اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… + ØĨØķاŲØĐ Ų…ØĩØŊØą %s + ØĢØŊØŪŲ„ اŲ„Ų…ØģØ§ØąØ§ØŠ ØĢŲˆ اØģØŠØđØąØķ Ų…ŲˆØ§Ų‚Øđ اŲ„ŲˆØģاØĶØ·. + ØĢØŊØŪŲ„ اØģŲ…اŲ‹ Ų„Ų…ØĩØŊØą اŲ„ŲˆØģاØĶØ· Ų‡Ø°Ø§. + اØģØŠØđØąØ§Øķ Ų„Ų…ØīØ§ØąŲƒØĐ ØŽØŊŲŠØŊØĐ + اØģØŠØđØąØ§Øķ + ØŠØđØ°Øą اØģØŠØąØŽØ§Øđ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØŊŲ„ŲŠŲ„. + ØĨØķاŲØĐ Ų…ØĩØŊØą + ØŠØ­ØąŲŠØą Ų…ØĩØŊØą + ØŠØ­ØąŲŠØą Ų…ØĩØŊØą %s + ØĨØŊØŪاŲ„ اŲ„ØđŲ„اŲ…ØĐ Ø§Ų„ØŽØŊŲŠØŊØĐ + اØģØŠØđØąØ§Øķ اŲ„ØĩŲˆØąØĐ + اØģØŠØđØąØ§Øķ Ų…ØŽŲ„ØŊ اŲ„ØĩŲˆØą + ØĨØķاŲØĐ Ų…ŲˆŲ‚Øđ اŲ„ØīØĻŲƒØĐ... + اØģØŠØđØąØ§Øķ اŲ„Ų…Ų„Ų + اŲ„Ų‚اØĶŲ…ØĐ Ø§Ų„ŲØąØđŲŠØĐ + ØŠŲ…ŲƒŲŠŲ† ØĢØēØąØ§Øą اŲ„Ų‚ŲˆØ§ØĶŲ… اŲ„ŲØąØđŲŠØĐ + ØŠŲØķŲŠŲ„ا؊ + ØŠŲˆØĩŲŠŲ„ا؊ اŲ„ŲŲŠØŊŲŠŲˆ + ØŠŲˆØĩŲŠŲ„ا؊ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + ØŠŲˆØĩŲŠŲ„ا؊ اŲ„ØĩŲˆØąØĐ + ؊حŲ…ŲŠŲ„ اŲ„ØŊŲ„ŲŠŲ„ + ØŠŲ… اØģØŠØąØŽØ§Øđ %i ØđŲ†Ø§ØĩØą + ØŠŲ… اØģØŠØąØŽØ§Øđ %i Ų…Ų† %i ØđŲ†Ø§ØĩØą + ØŠŲˆØĩŲŠŲ„ا؊ اŲ„ØĻØąŲ†Ø§Ų…ØŽ + ØķØĻØ· اŲ„ØĩŲˆØąØĐ Ø§Ų„Ų…ØĩØšØąØĐ Ų„Ų„ØŠŲˆØĩŲŠŲ„ØĐ + ØĨØđØŊاØŊا؊ اŲ„ØŠŲˆØĩŲŠŲ„ØĐ + Ų†Ų‚اط اŲ„ŲˆØĩŲˆŲ„ + ØķŲ… ØīØĻŲƒØĐ ØĢØŪØąŲ‰... + اØģŲ… Ų…ØģØŠØŪØŊŲ… Ų…Ų„Ų‚Ų… اŲ„ŲˆŲŠØĻ + ØĨØđØŊاØŊا؊ اŲ„ØģŲŠŲ†Ø§ØąŲŠŲˆ + ŲØąØ§ØŊŲ‰ + ØđØąŲˆØķ + اØģŲ… اŲ„Ų…ØķŲŠŲ + ØŠØąŲŠŲ„Øą + + ØđŲ…ŲŠŲ„ SMB + Ų…ØŽŲ…ŲˆØđØĐ Ø§Ų„ØđŲ…Ų„ + اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… اŲ„اŲØŠØąØ§ØķŲŠ + ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą اŲ„اŲØŠØąØ§ØķŲŠØĐ + Ų…ØģØ­ ØŊŲ‚ŲŠŲ‚ + + Ų…Ų„Ų‚Ų… WINS + ØąŲØđ Ų…ØīØ§ØąŲƒØ§ØŠ SMB + اØģØŠØŪØŊŲ… ا؊ØĩاŲ„ ŲˆØ§Ø­ØŊ Ų„ŲƒŲ„ Ų…Ų„Ų‚Ų… + + ØĨØēاŲ„ØĐ + Ų…ŲˆØģŲŠŲ‚Ų‰ + اŲ„ŲŲŠØŊŲŠŲˆ + ØĩŲˆØą + Ų…Ų„ŲØ§ØŠ + Ų…ŲˆØģŲŠŲ‚Ų‰ ŲˆŲŲŠØŊŲŠŲˆ + اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ ŲˆØ§Ų„ØĩŲˆØą + اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ ŲˆØ§Ų„Ų…Ų„ŲØ§ØŠ + اŲ„ŲŲŠØŊŲŠŲˆ ŲˆØ§Ų„ØĩŲˆØą + اŲ„ŲŲŠØŊŲŠŲˆ ŲˆØ§Ų„Ų…Ų„ŲØ§ØŠ + اŲ„ØĩŲˆØą ŲˆØ§Ų„Ų…Ų„ŲØ§ØŠ + اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ ŲˆØ§Ų„ŲŲŠØŊŲŠŲˆ ŲˆØ§Ų„ØĩŲˆØą + اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ ŲˆØ§Ų„ŲŲŠØŊŲŠŲˆ ŲˆØ§Ų„ØĩŲˆØą ŲˆØ§Ų„Ų…Ų„ŲØ§ØŠ + Ų…ØđØ·Ų„ + اŲ„Ų…Ų„ŲØ§ØŠ ŲˆØ§Ų„Ų…ŲˆØģŲŠŲ‚Ų‰ ŲˆØ§Ų„ŲŲŠØŊŲŠŲˆ + اŲ„Ų…Ų„ŲØ§ØŠ ŲˆØ§Ų„ØĩŲˆØą ŲˆØ§Ų„Ų…ŲˆØģŲŠŲ‚Ų‰ + اŲ„Ų…Ų„ŲØ§ØŠ ŲˆØ§Ų„ØĩŲˆØą ŲˆØ§Ų„ŲŲŠØŊŲŠŲˆ + اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ ŲˆØ§Ų„ØĻØąØ§Ų…ØŽ + اŲ„ŲŲŠØŊŲŠŲˆ ŲˆØ§Ų„ØĻØąØ§Ų…ØŽ + اŲ„ØĩŲˆØą ŲˆØ§Ų„ØĻØąØ§Ų…ØŽ + اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ ŲˆØ§Ų„ŲŲŠØŊŲŠŲˆ ŲˆØ§Ų„ØĩŲˆØą ŲˆØ§Ų„ØĻØąØ§Ų…ØŽ + اŲ„ØĻØąØ§Ų…ØŽ ŲˆØ§Ų„ŲŲŠØŊŲŠŲˆ ŲˆØ§Ų„Ų…ŲˆØģŲŠŲ‚Ų‰ + اŲ„ØĻØąØ§Ų…ØŽ ŲˆØ§Ų„ØĩŲˆØą ŲˆØ§Ų„Ų…ŲˆØģŲŠŲ‚Ų‰ + اŲ„ØĻØąØ§Ų…ØŽ ŲˆØ§Ų„ØĩŲˆØą ŲˆØ§Ų„ŲŲŠØŊŲŠŲˆ + + اØģŲ… Ų…ØģØŠØŪØŊŲ… FTP + ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą FTP + ØŠŲ… ØĻŲ†ØŽØ§Ø­ ØķØĻØ· ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą + + اŲƒØŠØīاŲ ØŠŲ„Ų‚اØĶŲŠ + اŲƒØŠØīاŲ ØŠŲ„Ų‚اØĶŲŠ Ų„Ų„Ų†ØļاŲ… + اŲ„ŲƒŲ†ŲŠØĐ + + Ø·Ų„ØĻ اŲ„ا؊ØĩاŲ„ + ØĨØąØģاŲ„ Ų…ØģØŠØŪØŊŲ… ŲˆŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą FTP + ŲØ§ØĩŲ„ اŲ„Ø·Ų†ŲŠŲ† + Ų‡Ų„ ØŠØąŲŠØŊ اŲ„ا؊ØĩاŲ„ ØĻاŲ„Ų†ØļاŲ… اŲ„Ų…ŲƒØŠØīŲ ØŠŲ„Ų‚اØĶŲŠØ§Ų‹ØŸ + + Ų†ØīØą Zeroconf + + ØŽŲ‡Ø§Øē ØĩŲˆØŠ Ų…ØŪØĩØĩ + ØŽŲ‡Ø§Øē ØĨØŪØąØ§ØŽ Ų…ØŪØĩØĩ + + ØŠØąØ§ŲƒŲ… + Ųˆ + ØŠØŽŲ…ŲŠØŊ + Ų…ØŠØĢØŪØą + Ų…Ų†ØđØēŲ„ + ŲˆØ§ØĻŲ„ ØąØđØŊŲŠ + ØąØđØŊ + ØĢØ­ØŊ + ØŦŲ‚ŲŠŲ„ + ŲŲŠ + اŲ„ + Ų…Ų†Ø·Ų‚ØĐ Ų…؎اŲˆØąØĐ + ØŦŲ„ØŽ + ØĻŲ„ŲˆØąØ§ØŠ + Ų‡Ø§ØŊØĶ + Ų…Øđ + ØđاØĩŲ + Øēذاذ + ØđاØĩŲØĐ ØąØđØŊŲŠØĐ + Øēذاذ + ØķØĻاØĻŲŠ + Ø­ØĻŲˆØĻ + ØđŲˆØ§ØĩŲ T + ØĢŲ…Ø·Ø§Øą T + + + + Ų‚Ų… ØĻØĨŲŠŲ‚اŲ ØŠØīØšŲŠŲ„ اŲ„ØīاØīØĐ ØđŲ†ØŊ اŲ„ØģØĻا؊ ØĻاŲ„Ų†ØģØĻØĐ Ų„Ų€ + + + ŲˆŲ‚ØŠ اŲ„ØŠØīØšŲŠŲ„ + + ŲØīŲ„ اŲ„ØģŲŠŲ†Ø§ØąŲŠŲˆ! : %s + + Ų†ŲˆØđ LCD + + اŲ„ØąØĶŲŠØģŲŠØĐ + اŲ„ØĻØąØ§Ų…ØŽ + ØĩŲˆØą + Ų…ØŊŲŠØą اŲ„Ų…Ų„ŲØ§ØŠ + ØĨØđØŊاØŊا؊ + Ų…ŲˆØģŲŠŲ‚Ų‰ + ŲŲŠØŊŲŠŲˆ + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„Ų†ØļاŲ… + ØđاŲ… + ØđØąØķ + ØĨØđØŊاØŊا؊ / Ų…ØļŲ‡Øą - Ų…ØđاŲŠØąØĐ ŲˆØ­ØŊØĐ Ų…ØđاŲ„ØŽØĐ Ø§Ų„ØąØģŲˆŲ…ا؊ + ØĨØđØŊاØŊا؊ / ŲŲŠØŊŲŠŲˆ - Ų…ØđاŲŠØąØĐ Ø§Ų„ØīاØīØĐ + ØĩŲˆØą + ØđŲ†Ø§ØĩØą \اŲ„؊حŲƒŲ…[CR]اŲ„ØąØĶŲŠØģŲŠØĐ + ا؎؊Ų…اØđŲŠ + Ų…ŲˆØģŲŠŲ‚Ų‰ + اŲ„Ų†ØļاŲ… + اŲ„ŲˆØģاØĶØ· + اŲ„ØīØĻŲƒØĐ + ØđاŲ… + ØģŲŠŲ†Ø§ØąŲŠŲˆŲ‡Ø§ØŠ + + + + + ŲŲŠØŊŲŠŲˆ/Ų‚اØĶŲ…ØĐ ØŠØīØšŲŠŲ„ + Ų…Ų„ŲØ§ØŠ ØŠØđØąŲŠŲ + [B]ØđŲ†Ø§ØĩØą اŲ„؊حŲƒŲ… اŲ„ØĢØģاØģŲŠØĐ[/B] + + Ų†ØđŲ…/Ų„ا Ø­ŲˆØ§Øą + Ø­ŲˆØ§Øą اŲ„ØŠŲ‚ØŊŲ… + + ØĻØ­ØŦ ØđŲ† ØŠØąØŽŲ…ا؊... + ØŠØŪØēŲŠŲ† اح؊ŲŠØ§Ø·ŲŠ ØĢŲˆ ØĻØ­ØŦ ØđŲ† ØŠØąØŽŲ…ا؊... + ØĨŲ†Ų‡Ø§ØĄ + ØŠØŪØēŲŠŲ† + ØŠØŊŲŲ‚ Ų…ŲØŠŲˆØ­ + + Ų…ŲˆØģŲŠŲ‚Ų‰/Ų‚اØĶŲ…ØĐ ØŠØīØšŲŠŲ„ + Ų…ŲˆØģŲŠŲ‚Ų‰/Ų…Ų„ŲØ§ØŠ + Ų…ŲˆØģŲŠŲ‚Ų‰/Ų…ŲƒØŠØĻØĐ + Ų…Ø­ØąØą Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + ØĢŲ‡Ų… 100 ØĢØšŲ†ŲŠØĐ + ØĢŲ‡Ų… 100 ØĢŲ„ØĻŲˆŲ… + اŲ„ØĻØąØ§Ų…ØŽ + ØŠŲƒŲˆŲŠŲ† + ØŠŲ‚ØŊŲŠØąØ§ØŠ اŲ„Ø·Ų‚Øģ + ØĢŲ„ØđاØĻ اŲ„ØīØĻŲƒØĐ + ØŠŲˆØģØđا؊ + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„Ų†ØļاŲ… + + + + + Ų…ŲˆØģŲŠŲ‚Ų‰ - Ų…ŲƒØŠØĻØĐ + ØŠØīØšŲŠŲ„ اŲ„ØĒŲ† - Ų…ŲˆØģŲŠŲ‚Ų‰ + + + + + ØŠØīØšŲŠŲ„ اŲ„ØĒŲ† - ŲŲŠØŊŲŠŲˆ + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØĢŲ„ØĻŲˆŲ… + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ŲŲŠŲ„Ų… + + ؊حØŊŲŠØŊ اŲ„Ø­ŲˆØ§Øą + Ų…ŲˆØģŲŠŲ‚Ų‰/Ų…ØđŲ„ŲˆŲ…ا؊ + ØŠŲ… اŲ„Ø­ŲˆØ§Øą + ŲŲŠØŊŲŠŲˆ/Ų…ØđŲ„ŲˆŲ…ا؊ + ØģŲŠŲ†Ø§ØąŲŠŲˆŲ‡Ø§ØŠ/Ų…ØđŲ„ŲˆŲ…ا؊ + ŲŲŠØŊŲŠŲˆ ØīاØīØĐ ŲƒØ§Ų…Ų„ØĐ + ØŠØĩŲˆØą اŲ„ØĩŲˆØŠ + + Ø­ŲˆØ§Øą ØŠØŽŲ…ŲŠØđ اŲ„Ų…Ų„ŲØ§ØŠ + ØĨØđاØŊØĐ ØĻŲ†Ø§ØĄ اŲ„ŲŲ‡ØąØģ... + ØđŲˆØŊØĐ ØĨŲ„Ų‰ Ų†Ø§ŲØ°ØĐ Ø§Ų„Ų…ŲˆØģŲŠŲ‚Ų‰ + ØđŲˆØŊØĐ ØĨŲ„Ų‰ Ų†Ø§ŲØ°ØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ + ؊حØŊŲŠØŦ Ų‚اØĶŲ…ØĐ Ø§Ų„Ų…ØŊØąØĻ + اŲ„Ų…ØŊØąØĻ + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…ØŊØąØĻŲŠŲ† + ØĨØđØŊاØŊا؊ اŲ„Ų…ØŊØąØĻ + ŲƒŲ„ اŲ„Ų…ØŊØąØĻŲŠŲ† اŲ„Ų…ØģØŽŲ„ŲŠŲ† Ų…ŲŲ‚ŲˆØŊŲŠŲ†. ؊حØŊŲŠØŦ Ų‚اØĶŲ…ØŠŲƒ + اØģØŠØĶŲ†Ø§Ų ØŠŲ„Ų‚اØĶŲŠ Ų…Ų† اŲ„ŲˆØķØđ اŲ„ØĢØŪŲŠØą + Ų„ا + Ų†ØđŲ… + Ø·Ų„ØĻ + ØĻØŊØĄ Ų…Ų† اŲ„ØĻØŊاŲŠØĐ + اØģØŠŲ†ØĶاŲ Ų…Ų† %s + اŲ„؊حŲ‚Ų‚ Ų…Ų† ØĩØ­ØĐ Ø§Ų„Ų…ØŊØąØĻŲŠŲ† اŲ„Ų…ŲˆØŽŲˆØŊŲŠŲ†... + ØĨŲ†ØīØ§ØĄ ØĩŲˆØą Ų…ØĩØšØąØĐ ØŠŲ„Ų‚اØĶŲŠØ§Ų‹ Ų„Ų„ŲŲŠØŊŲŠŲˆ ØĻØŊŲˆŲ† ØąØģŲ… ØŠŲˆØķŲŠØ­ŲŠ + Ų„ا ؊حŲ„ اŲ„ŲŲŠØŊŲŠŲˆ ؊ح؊ Ų‡Ø°Ø§ اŲ„Ø­ØŽŲ… (Ų…ŲŠØŽØ§ ØĻاŲŠØŠ) + ØŠŲˆŲ‚Ų Ų…ØĪŲ‚ØŠ Ų„Ų„ŲŲŠØŊŲŠŲˆ ØđŲ†ØŊ اŲ„ØŪØąŲˆØŽ Ų…Ų† ØīاØīØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + ؊حØŊŲŠØŊ ØŽŲˆØŊØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ + ØŠŲˆŲØą Ų…ØģØŠŲˆŲŠØ§ØŠ ØđØŊŲŠØŊØĐ Ų…Ų† اŲ„ØŽŲˆØŊØĐ + Ø­ŲØļ اŲ„ØŠŲØķŲŠŲ„ اŲ„ØŪاØĩ ØĻŲŠ + Ø­ŲØļ + 1080p + 720p + Ų‚ŲŠØ§ØģŲŠ + ØŠŲˆŲØą اŲ„ØđØŊŲŠØŊ Ų…Ų† اŲ„ØŠØąŲŠŲ„Øą + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + c + Ų…ŲˆØ§ŲŲ‚ + * + Ų…Ų‚ŲŲ„! ØĨØŊØŪاŲ„ اŲ„ŲƒŲˆØŊ... + ØĨØŊØŪاŲ„ ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą + ØĨØŊØŪاŲ„ ŲƒŲˆØŊ ØąØĶŲŠØģŲŠ + ØĨØŊØŪاŲ„ ŲƒŲˆØŊ اŲ„ŲØŠØ­ + ØĢŲˆ اŲ„Øķؚط ØđŲ„Ų‰ C Ų„Ų„ØĨŲ„ØšØ§ØĄ + ØĨØŊØŪاŲ„ Ų…ŲƒŲˆŲ† ØēØą Ų„ŲˆØ­ØĐ Ø§Ų„Ų„ØđØĻ Ųˆ + اŲ„Øķؚط ØđŲ„Ų‰ ØĻØŊØĄØŒ ØĢŲˆ ØđŲˆØŊØĐ Ų„Ų„ØĨŲ„ØšØ§ØĄ + ØķØĻØ· اŲ„Ų‚ŲŲ„ + ŲØŠØ­ + ØĨØđاØŊØĐ ØķØĻØ· اŲ„Ų‚ŲŲ„ + ØĨØēاŲ„ØĐ Ø§Ų„Ų‚ŲŲ„ + ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą ØąŲ‚Ų…ŲŠØĐ + Ų…ŲƒŲˆŲ† ØēØą Ų„ŲˆØ­ØĐ Ø§Ų„Ų„ØđØĻ + ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą ŲƒØ§Ų…Ų„ØĐ Ø§Ų„Ų†Øĩ + ØĨØŊØŪاŲ„ ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą ØŽØŊŲŠØŊØĐ + ØĨØđاØŊØĐ ØĨØŊØŪاŲ„ ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą ØŽØŊŲŠØŊØĐ + ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą ØšŲŠØą ØĩØ­ŲŠØ­ØĐ، + ØĨØđاØŊØĐ Ų…حاŲˆŲ„ Ų„Ų„ŲŠØģØ§Øą + ŲƒŲ„Ų…ا؊ اŲ„Ų…ØąŲˆØą اŲ„Ų…ØŊØŪŲ„ØĐ ØšŲŠØą Ų…؊طاØĻŲ‚ØĐ. + ØŠŲ… ØąŲØķ اŲ„ŲˆØĩŲˆŲ„. + ØŠŲ… ؊؎اŲˆØē Ø­ØŊ ØŠŲƒØąØ§Øą ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą. + ØģŲˆŲ ŲŠØŠŲ… ØĨØšŲ„اŲ‚ اŲ„Ų†ØļاŲ… اŲ„ØĒŲ†. + ØđŲ†ØĩØą Ų…Ų‚ŲŲ„ + ØĨŲ„ØšØ§ØĄ ØŠŲ†ØīŲŠØ· اŲ„Ų‚ŲŲ„ + ØŠØšŲŠŲŠØą اŲ„Ų‚ŲŲ„ + Ų‚ŲŲ„ اŲ„Ų…ØĩØŊØą + ØĨØŊØŪاŲ„ ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą ŲƒØ§Ų† ŲØ§ØąØšØ§Ų‹. حاŲˆŲ„ Ų…ØąØĐ ØĢØŪØąŲ‰. + Ų‚ŲŲ„ ØąØĶŲŠØģŲŠ + ØĨØšŲ„اŲ‚ اŲ„Ų†ØļاŲ… ØĨذا ؊؎اŲˆØē Ų…حاŲˆŲ„ا؊ Ų‚ŲŲ„ اŲ„ØąØĶŲŠØģŲŠ + ŲƒŲˆØŊ اŲ„ØąØĶŲŠØģŲŠ ØšŲŠØą ØĩاŲ„Ø­! + ØąØŽØ§ØĄ ØĨØŊØŪاŲ„ ŲƒŲˆØŊ ØąØĶŲŠØģŲŠ ØĩاŲ„Ø­! + ØĨØđØŊاØŊا؊ ŲˆŲ…ØŊŲŠØą اŲ„Ų…Ų„ŲØ§ØŠ + ØķØĻØ· ŲƒØ§ŲØŠØąØ§ØķŲŠ Ų„ŲƒŲ„ اŲ„ØĢŲŲ„اŲ… + ØģŲŠØĪØŊŲŠ Ų‡Ø°Ø§ ØĨŲ„Ų‰ ØĨØđاØŊØĐ ØķØĻØ· اŲ„Ų‚ŲŠŲ… اŲ„Ų…Ø­ŲŲˆØļØĐ Ų…ØģØĻŲ‚اŲ‹ + ØđØąØķ ŲƒŲ„ ØĩŲˆØąØĐ Ų„Ų€ + اØģØŠØŪØŊاŲ… ØŠŲˆØ§ØēŲ† ŲˆØŠŲƒØĻŲŠØą/ØŠØĩØšŲŠØą + ØŠØīØšŲŠŲ„ ŲŲŠØŊŲŠŲˆ NTSC ØĻŲ…ØđØŊŲ„ا؊ PAL + ØŠØīØšŲŠŲ„ ŲŲŠØŊŲŠŲˆ PAL ØĻŲ…ØđØŊŲ„ا؊ NTSC + ØŠØīØšŲŠŲ„ ŲŲŠØŊŲŠŲˆ NTSC ŲŲŠ PAL60 + 12 ØģاØđØĐ + 24 ØģاØđØĐ + ŲŠŲˆŲ…/ØīŲ‡Øą + ØīŲ‡Øą/ŲŠŲˆŲ… + + ŲˆŲ‚ØŠ ØđŲ…Ų„ اŲ„Ų†ØļاŲ… + ØŊŲ‚اØĶŲ‚ + ØģاØđا؊ + ØĢŲŠØ§Ų… + ŲˆŲ‚ØŠ اŲ„ØđŲ…Ų„ اŲ„ØĨØŽŲ…اŲ„ŲŠ + + اŲ„Ø·Ų‚Øģ + + ØīاØīØĐ Ø§Ų„ØŠŲˆŲ‚Ų + OSD Ų„ØīاØīØĐ ŲƒØ§Ų…Ų„ØĐ + + اŲ„Ų†ØļاŲ… + ØŠŲ†ØēŲŠŲ„ HD ŲŲˆØąŲŠ + ŲŲŠØŊŲŠŲˆ ŲŲ‚Ø· + - ØŠØĢØŪŲŠØą + - ØĢØŊŲ†Ų‰ Ų…ØŊØĐ Ų„Ų„Ų…Ų„Ų + ØĨØšŲ„اŲ‚ + Ų„ŲˆØ­ØĐ Ø§Ų„Ų‚ŲŠØ§Øģ + اØģØŠØŪØŊاŲ… Ų…ØģØ§Øą Ų„ŲˆØ­ØĐ Ų‚ŲŠØ§Øģ Ų…ØŪØĩØĩØĐ + ØĨØšŲ„اŲ‚ اŲ„ŲˆØļŲŠŲØĐ + ØŪØąŲˆØŽ + ØģØĻا؊ + ØŠŲˆŲ‚Ų + ØĨŲ†Ų‡Ø§ØĄ + ØŠŲ…Ų‡ŲŠØŊ + ØŠŲ‚Ų„ŲŠŲ„ + ØĨØŽØąØ§ØĄ ØēØą اŲ„طاŲ‚ØĐ + + Ų‡Ų„ Ų‡Ų†Ø§Ųƒ ØŽŲ„ØģØĐ ØĢØŪØąŲ‰ Ų†ØīØ·ØĐ، ØąØĻŲ…ا ØđØĻØą ssh؟ + Ų…Ø­ØąŲƒ ØĢŲ‚ØąØ§Øĩ Ų‚اØĻŲ„ Ų„Ų„ØĨØēاŲ„ØĐ Ų…Ø­Ų…ŲˆŲ„ + ØĨØēاŲ„ØĐ ØŽŲ‡Ø§Øē ØšŲŠØą ØĒŲ…Ų†ØĐ + ØŠŲ…ØŠ ØĨØēاŲ„ØĐ Ø§Ų„ØŽŲ‡Ø§Øē ØĻŲ†ØŽØ§Ø­ + ØŠŲ… ØŠŲˆØĩŲŠŲ„ Ų‚ØķŲŠØĻ اŲ„ØŠŲˆØŽŲŠŲ‡ + ØŠŲ… ŲØĩŲ„ Ų‚ØķŲŠØĻ اŲ„ØŠŲˆØŽŲŠŲ‡ + ØŠŲ… ØŠŲˆØĩŲŠŲ„ Ų‚ØąØĩ Ų‚اØĻŲ„ Ų„Ų„ØĨØēاŲ„ØĐ + ØŠŲ… ŲØĩŲ„ Ų‚ØąØĩ Ų‚اØĻŲ„ Ų„Ų„ØĨØēاŲ„ØĐ + ØŠŲ… ŲØĩŲ„ Ų‚ØąØĩ Ų‚اØĻŲ„ Ų„Ų„ØĨØēاŲ„ØĐ Ų…Øđ ŲˆØŽŲˆØŊ ØĢØŪØ·Ø§ØĄ + + Ų…ØąØīØ­ Flicker + ØŊØđ ØĻØąŲ†Ø§Ų…ØŽ اŲ„ØŠØīØšŲŠŲ„ ŲŠØŪØŠØ§Øą (Ų…Ø·Ų„ŲˆØĻ ØĨØđاØŊØĐ Ø§Ų„ØŠØīØšŲŠŲ„) + Ų…ØēاŲ…Ų†ØĐ ŲØ§ØąØšØĐ ØąØĢØģŲŠØĐ + Ų…ØđØ·Ų„ + Ų…Ų…ŲƒŲŽŲ‘Ų† ØĢØŦŲ†Ø§ØĄ ØŠØīØšŲŠŲ„ اŲ„ŲŲŠØŊŲŠŲˆ + Ų…Ų…ŲƒŲŽŲ‘Ų† ØŊاØĶŲ…اŲ‹ + اØŪØŠØĻØ§Øą ŲˆØŠØ·ØĻŲŠŲ‚ Ų…ØģØŠŲˆŲ‰ اŲ„ØŊŲ‚ØĐ... + Ø­ŲØļ Ų…ØģØŠŲˆŲ‰ اŲ„ØŊŲ‚ØĐ؟ + Ų‡Ų„ ØŠØąŲŠØŊ اŲ„اح؊ŲØ§Øļ ØĻŲ…ØģØŠŲˆŲ‰ اŲ„ØŊŲ‚ØĐ Ų‡Ø°Ø§ØŸ + + ØŠØŊØąØŽ Ų„ØĢØđŲ„Ų‰ ØĻØŽŲˆØŊØĐ ØđاŲ„ŲŠØĐ + Ų…ØđØ·Ų„ + Ų…Ų…ŲƒŲŽŲ‘Ų† Ų„Ų…ح؊ŲˆŲ‰ ØŠØđØąŲŠŲ Ų‚ŲŠØ§ØģŲŠ + Ų…Ų…ŲƒŲŽŲ‘Ų† ØŊاØĶŲ…اŲ‹ + + Ø·ØąŲŠŲ‚ØĐ Ø§Ų„ØŠØŊØąŲŠØŽ Ų„ØĢØđŲ„Ų‰ + Ų…ŲƒØđØĻ ØŦŲ†Ø§ØĶŲŠ + Ų„اŲ†ŲƒØēŲˆØģ + Ų…ØēاŲ…Ų†ØĐ + VDPAU + Ų…ØģØŠŲˆŲ‰ ØŠØŊØąŲŠØŽ Ų„ØĢØđŲ„Ų‰ VDPAU HQ + ؊حŲˆŲŠŲ„ ØĢŲ„ŲˆØ§Ų† Ų„Ų…ØģØŠŲˆŲ‰ اØģØŠŲˆØŊŲŠŲˆ VDPAU + + Ų…Ø­Ųˆ اŲ„ØīاØīØĐ + Ų…ØđØ·Ų„ + ØđØąŲˆØķ ŲØ§ØąØšØĐ + + ØŠŲ… اŲƒØŠØīاŲ ا؊ØĩاŲ„ا؊ Ų†ØīØ·ØĐ! + ØĨذا ؊اØĻØđØŠØŒ Ų„Ų† ŲŠŲƒŲˆŲ† ØĻŲ…Ų‚ØŊŲˆØąŲƒ اŲ„؊حŲƒŲ… ŲŲŠ Boxee + ØĻØđØŊ اŲ„ØĒŲ†. Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ ØĨŲŠŲ‚اŲ Ų…Ų„Ų‚Ų… اŲ„ØĢØ­ØŊاØŦ؟ + Ų†ØšŲŠŲŠØą ŲˆØķØđ Apple Remote؟ + ØŠØšŲŠŲŠØą Ų‡Ø°Ø§ اŲ„ŲˆØķØđ Ų‚ØŊ ŲŠŲˆŲ‚Ų Apple Remotes Ų…Ų† اŲ„ØđŲ…Ų„ Ų…Øđ Boxee.[CR]Ų‡Ų„ ØŠØąŲŠØŊ اŲ„Ų…؊اØĻØđØĐ؟ + Ų†ØšŲŠŲŠØą ŲˆØķØđ اŲ„؊حŲƒŲ… ØđŲ† ØĻŲØđØŊ؟ + ØąØŽØ§ØĄ ØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ Boxee Ų„ØŠŲ†ØīŲŠØ· + Ų…ŲØŠØ§Ø­ HDD: + ØŊØąØŽØĐ Ø­ØąØ§ØąØĐ HDD: + Ų…ŲˆØŊŲŠŲ„ DVD: + ØŽŲ‡Ø§Øē DVD: + Ų…ŲˆØŊŲŠŲ„ HDD: + Ų…ØģŲ„ØģŲ„ HDD: + ØŽŲ‡Ø§Øē HDD: + ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą HDD: + حاŲ„ØĐ Ų‚ŲŲ„ HDD: + Ų‚Ų†Ø§Øđ اŲ„ØīØĻŲƒØĐ Ø§Ų„ŲØąØđŲŠØĐ + ØĻŲˆØ§ØĻØĐ + DNS ØĢØģاØģŲŠ + ŲØīŲ„ØŠ اŲ„ØŠŲ‡ŲŠØĶØĐ + + Ų„ŲˆØ­ØĐ Ø§Ų„ØĢŲ„ØđاØĻ + Ų„ŲˆØ­ØĐ Ø§Ų„Ų…ŲØ§ØŠŲŠØ­ + اŲ„Ų…اŲˆØģ + ØģŲ…اØđØĐ ØąØĢØģ/Ų…ŲŠŲƒØąŲˆŲŲˆŲ† + ŲˆØ­ØŊØĐ Ø§Ų„ذاŲƒØąØĐ + IR ØđŲ† ØĻŲØđØŊ + Ų…Ų†ŲØ° اŲ„Ų…؊حŲƒŲ… + + + ØĢØĻØŊاŲ‹ + ØđŲ„Ų‰ اŲ„ŲŲˆØą + ØĻØđØŊ %i ØŦŲˆØ§Ų†ŲŠ + ØŠØ§ØąŲŠØŪ ØŠØŦØĻŲŠØŠ HDD: + Ø­ØģاØĻ ØŊاØĶØąØĐ Ø·Ø§Ų‚ØĐ HDD: + + Ų…Ų„ŲØ§ØŠ ØŠØđØąŲŠŲ + حذŲ Ų…Ų„Ų اŲ„ØŠØđØąŲŠŲ '%s'؟ + ØĒØŪØą Ų…Ų„Ų ØŠØđØąŲŠŲ Ų…Ø­Ų…Ų„: + ØšŲŠØą Ų…ØđØąŲˆŲ + اØģØŠØĻØŊاŲ„ + ØģاØđØĐ Ø§Ų„Ų…Ų†ØĻŲ‡ + ŲØ§ØĩŲ„ ØģاØđØĐ Ø§Ų„Ų…Ų†ØĻŲ‡ (ØĻاŲ„ØŊŲ‚اØĶŲ‚) + ØĻØŊØĢ، اŲ„Ų…Ų†ØĻŲ‡ ŲŲŠ %im + اŲ„Ų…Ų†ØĻŲ‡! + ØŠŲ… اŲ„ØĨŲ„ØšØ§ØĄ Ų…Øđ ØŠØąŲƒ %im% + + ØŠŲ…ŲƒŲŠŲ† Ų…Øđ اŲ„اŲØŠØąØ§ØķŲŠ + ØĻØ­ØŦ ØđŲ† ØŠØąØŽŲ…ا؊ ŲŲŠ RARs + اØģØŠØđØąØ§Øķ اŲ„ØŠØąØŽŲ…ØĐ... + Ų†Ų‚Ų„ اŲ„ØđŲ†ØĩØą + Ų†Ų‚Ų„ اŲ„ØđŲ†ØĩØą Ų‡Ų†Ø§ + ØĨŲ„ØšØ§ØĄ اŲ„Ų†Ų‚Ų„ + + اŲ„ØŽŲ‡Ø§Øē: + اØģØŠØŪØŊاŲ… CPU: + + Ų…ØŠØĩŲ„ØŒ ŲˆŲ„ŲƒŲ† Ų„ا ŲŠØŠŲˆŲØą DNS + Ų…Ø­ØąŲƒ اŲ„ØĢŲ‚ØąØ§Øĩ + DVD-ROM + اŲ„Ų…ØŪØēŲ† + اŲØŠØąØ§ØķŲŠ + اŲ„ØīØĻŲƒØĐ + اŲ„ŲŲŠØŊŲŠŲˆ + اŲ„ØŽŲ‡Ø§Øē + _ + Ų†ØļاŲ… اŲ„ØŠØīØšŲŠŲ„: + ØģØąØđØĐ CPU: + BIOS Ų…ŲƒØŠØīŲ: + Ų…ØīŲØą اŲ„ŲŲŠØŊŲŠŲˆ: + ØŊŲ‚ØĐ Ø§Ų„ØīاØīØĐ + ØĨØĩØŊØ§Øą Xbox: + ØąŲ‚Ų… Ų…ØģŲ„ØģŲ„ Xbox: + Ų…ØĩŲ†Øđ Xbox: + Modchip: + ŲƒØ§ØĻŲ„ A/V: + اŲ„ŲŲŠØŊŲŠŲˆ ŲˆŲ…Ų†Ø·Ų‚ØĐ XBE: + Ų…Ų†Ø·Ų‚ØĐ DVD: + اŲ„ØĨŲ†ØŠØąŲ†ØŠ: + Ų…ØŠØĩŲ„ + ØšŲŠØą Ų…ØŠØĩŲ„. ŲØ­Øĩ ØĨØđØŊاØŊا؊ اŲ„ØīØĻŲƒØĐ. + Ų…ŲØŠØ§Ø­ Ų…ØĻاØīØą Xbox: + ØŊØąØŽØĐ Ø­ØąØ§ØąØĐ Ø§Ų„Ų‡ØŊŲ + ØģØąØđØĐ Ø§Ų„Ų…ØąŲˆØ­ØĐ + اŲ„؊حŲƒŲ… ŲŲŠ ØŊØąØŽØĐ Ø§Ų„Ø­ØąØ§ØąØĐ ØŠŲ„Ų‚اØĶŲŠØ§Ų‹ + ؊؎اŲˆØē ØģØąØđØĐ Ø§Ų„Ų…ØąŲˆØ­ØĐ + - اŲ„ØŪØ·ŲˆØ· + ØŠŲ…ŲƒŲŠŲ† Ų‚Ų„ØĻ اŲ„ØģŲ„اØģŲ„ ØŦŲ†Ø§ØĶŲŠØĐ Ø§Ų„ا؊؎اŲ‡ + ØŠŲ…ŲƒŲŠŲ† ؊ؚذŲŠØ§ØŠ RSS + ØĨØŪŲØ§ØĄ ØđŲ†Ø§ØĩØą اŲ„Ų…ØŽŲ„ØŊ اŲ„ØĢØģاØģŲŠØĐ + ؊؊ØĻØđ Ų‚اŲ„ØĻ اŲ„ØŠØģŲ…ŲŠØĐ + ØĨØđاØŊØĐ Ø§Ų„ØŠØīØšŲŠŲ„ØŸ + ØĻØŊŲ„اŲ‹ Ų…Ų† XBMC ŲŲ‚ط؟ + ØŠØĢØŦŲŠØą اŲ„ØŠŲƒØĻŲŠØą/اŲ„ØŠØĩØšŲŠØą + ØŠØĢØŦŲŠØą اŲ„ØŠØđŲˆŲŠŲ… + ØŠŲ‚Ų„ŲŠŲ„ اŲ„ØīØąŲŠØ· اŲ„ØĢØģŲˆØŊ + ØĨØđاØŊØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + ØĻŲ‡ØŠØ§Ų† + ØĨØđاØŊØĐ ØĨŲ†ØīØ§ØĄ ØĩŲˆØą Ų…ØĩØšØąØĐ + ØĩŲˆØą Ų…ØĩØšØąØĐ Ų…ØŠŲƒØąØąØĐ + ØđØąØķ ؎اŲ†ØĻŲŠ + ØđØąØķ Ų…ØŠŲƒØąØą + ØđØīŲˆØ§ØĶŲŠ + اØģØŠØąŲŠŲˆ + ŲŠØģØ§Øą ŲŲ‚Ø· + ŲŠŲ…ŲŠŲ† ŲŲ‚Ø· + ØŠŲ…ŲƒŲŠŲ† ØŊØđŲ… اŲ„ŲƒØ§ØąŲˆŲƒŲŠ + ØīŲØ§ŲŲŠØĐ Ø§Ų„ØŪŲ„ŲŲŠØĐ + ØīŲØ§ŲŲŠØĐ Ø§Ų„ŲˆØ§ØŽŲ‡ØĐ + ØŠØĢØŪŲŠØą A/V + اŲ„ŲƒØ§ØąŲˆŲƒŲŠ + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ %s + ØŪØ·ØĢ ØĢØŦŲ†Ø§ØĄ ŲØŠØ­ %s + ØŠØđØ°Øą ؊حŲ…ŲŠŲ„ %s + اŲ„ØŪØ·ØĢ: ذاŲƒØąØĐ Ų…Ų…ØŠŲ„ØĶØĐ + Ų†Ų‚Ų„ Ų„ØĢØđŲ„Ų‰ + Ų†Ų‚Ų„ Ų„ØĢØģŲŲ„ + ØŠØ­ØąŲŠØą اŲ„ØđŲ„اŲ…ØĐ + ØđŲ…Ų„ اŲØŠØąØ§ØķŲŠ + ØēØą ØĨØēاŲ„ØĐ + LED ØĢŲ…اŲ…ŲŠ + Ų„ŲˆŲ† LED ØĢŲ…اŲ…ŲŠ + Ø§ØŠØąŲƒŲ‡ ŲƒŲ…ا Ų‡Ųˆ + ØĢØŪØķØą + ØĻØąØŠŲ‚اŲ„ŲŠ + ØĢØ­Ų…Øą + ØĢØēØąŲ‚ + ØĨŲŠŲ‚اŲ ØŠØĻØŊŲŠŲ„ LED ØđŲ†ØŊ اŲ„ØŠØīØšŲŠŲ„ + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ŲŲŠŲ„Ų… + ØđŲ†ØĩØą اŲ„ØĩŲ + ØĻØ­ØŦ ØđŲ† IMDb... + Ų…ØģØ­ Ų„Ų…ح؊ŲˆŲ‰ ØŽØŊŲŠØŊ + ØŠØīØšŲŠŲ„ اŲ„ØĒŲ†... + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØĢŲ„ØĻŲˆŲ… + ØĨØķاŲØĐ ØđŲ†ØĩØą ØĨŲ„Ų‰ اŲ„Ų…ŲƒØŠØĻØĐ + ØĨŲŠŲ‚اŲ اŲ„Ų…ØģØ­ + Ø·ØąŲŠŲ‚ØĐ Ø§Ų„ØĨØŪØąØ§ØŽ + ØļŲ„ ØĻŲƒØģŲ„ ØĻØŽŲˆØŊØĐ Ų…Ų†ØŪŲØķØĐ + ØŠØąØ§ŲƒØĻا؊ اŲ„ØŽŲ‡Ø§Øē + ØļŲ„ ØĻŲƒØģŲ„ ØĻØŽŲˆØŊØĐ ØđاŲ„ŲŠØĐ + ØŠØīØšŲŠŲ„ اŲ„ØđŲ†ØĩØą + ØķØĻØ· ØĩŲˆØąØĐ Ų…ØĩØšØąØĐ Ų„Ų„ŲŲ†Ø§Ų† + ØĨŲ†ØīØ§ØĄ ØĩŲˆØą Ų…ØĩØšØąØĐ + ØŠŲ…ŲƒŲŠŲ† اŲ„ØĩŲˆØŠ + ØŠŲ…ŲƒŲŠŲ† اŲ„ØŽŲ‡Ø§Øē + Ų…ØģØŠŲˆŲ‰ اŲ„ØĩŲˆØŠ + ŲˆØķØđ ØđØąØķ اŲØŠØąØ§ØķŲŠ + ØģØ·ŲˆØđ اŲØŠØąØ§ØķŲŠ + ØŠØĻاŲŠŲ† اŲØŠØąØ§ØķŲŠ + ؎اŲ…ا اŲØŠØąØ§ØķŲŠ + اØģØŠØđاØŊØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ + Ų‚Ų†Ø§Øđ اŲ„ØĩŲˆØŠ - اŲ„Ų…Ų†ŲØ° 1 + Ų‚Ų†Ø§Øđ اŲ„ØĩŲˆØŠ - اŲ„Ų…Ų†ŲØ° 2 + Ų‚Ų†Ø§Øđ اŲ„ØĩŲˆØŠ - اŲ„Ų…Ų†ŲØ° 3 + Ų‚Ų†Ø§Øđ اŲ„ØĩŲˆØŠ - اŲ„Ų…Ų†ŲØ° 4 + اØģØŠØŪØŊاŲ… ØĻØ­ØŦ Ø­ØģØĻ اŲ„ŲˆŲ‚ØŠ + ؊؊ØĻØđ Ų‚اŲ„ØĻ اŲ„ØŠØģŲ…ŲŠØĐ Ų„Ų„ŲŠŲ…ŲŠŲ† + ØķØĻØ· Ų…ØģØĻŲ‚ + Ų„ا ŲŠŲˆØŽØŊ ØķØĻØ· Ų…ØģØĻŲ‚ Ų…ØŠŲˆŲØą Ų„Ų‡Ø°Ø§ اŲ„ØŠØĩŲˆØą + Ų„ا ØŠŲˆØŽØŊ ØĨØđØŊاØŊا؊ Ų…ØŠŲˆŲØąØĐ Ų„Ų‡Ø°Ø§ اŲ„ØŠØĩŲˆØą + ØĨØŪØąØ§ØŽ/؊حŲ…ŲŠŲ„ + اØģØŠØŪØŊاŲ… اŲ„ØŠØĩŲˆØą ØđŲ†ØŊ ØŠØīØšŲŠŲ„ اŲ„ØĩŲˆØŠ + Ø­ØģاØĻ اŲ„Ø­ØŽŲ… + Ø­ØģاØĻ Ø­ØŽŲ… اŲ„Ų…ØŽŲ„ØŊ + ØĨØđØŊاØŊا؊ اŲ„ŲŲŠØŊŲŠŲˆ + ØĨØđØŊاØŊا؊ اŲ„ØĩŲˆØŠ ŲˆØ§Ų„ØŠØąØŽŲ…ØĐ + ØŠŲ…ŲƒŲŠŲ† اŲ„ØŠØąØŽŲ…ا؊ + اØŪØŠØĩØ§ØąØ§ØŠ + ؊؎اŲ‡Ų„ اŲ„ØąŲ…ŲˆØē ØđŲ†ØŊ اŲ„ŲØąØē + ØĻŲ‡ØŠØ§Ų† Ų…Ų‚اطØđ اŲ„ØĢŲ„ØĻŲˆŲ… + اØģØŠØđØąØ§Øķ %s + ØđØąØķ ŲˆØķØđ اŲ„Ų…Ų‚Ø·Øđ + Ų…Ø­Ųˆ اŲ„اŲØŠØąØ§ØķŲŠ + اØģØŠØđاØŊØĐ + اŲ„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ ØĩŲˆØąØĐ Ų…ØĩØšØąØĐ + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØĩŲˆØąØĐ + %s ØķØĻØ· Ų…ØģØĻŲ‚ + (ØŠŲ‚ŲŠŲŠŲ… Ų…ØģØŠØŪØŊŲ… IMDb) + ØĢŲ‡Ų… 250 + ØŠŲˆŲ„ŲŠŲ Last.fm + ØĢŲ‚Ų„ ØģØąØđØĐ Ų…ØąŲˆØ­ØĐ + + ØŠŲ†ØēŲŠŲ„ + ØĨØŪŲØ§ØĄ اŲ„ŲŲ†Ø§Ų†ŲŠŲ† اŲ„Ø°ŲŠ ŲŠØļŲ‡ØąŲˆŲ† ŲŲ‚Ø· ØđŲ„Ų‰ اŲ„Ų†ØĩŲˆØĩ + Ø·ØąŲŠŲ‚ØĐ Ø§Ų„ØĨØŪØąØ§ØŽ + اŲƒØŠØīاŲ ØŠŲ„Ų‚اØĶŲŠ + ØļŲ„اŲ„ ØĢØģاØģŲŠØĐ (ARB) + ØļŲ„اŲ„ Ų…ØŠŲ‚ØŊŲ…ØĐ (GLSL) + اŲ„ØĻØąŲ†Ø§Ų…ØŽ + ØĨØēاŲ„ØĐ ØĻØĢŲ…اŲ† + VDPAU + ØĻØŊØĄ ØđØąØķ ØīØąØ§ØĶØ­ Ų‡Ų†Ø§ + ؊طØĻŲŠŲ‚ Ų…ØŽŲ…ŲˆØđØĐ ØĢØ­ØąŲ ØŽØŊŲŠØŊØĐ + ŲØīŲ„ ŲŲŠ ØĻØŊØĄ ØŽŲ‡Ø§Øē اŲ„ØĩŲˆØŠ + ŲØ­Øĩ ØĨØđØŊاØŊا؊ اŲ„ØĩŲˆØŠ + + Ø·ØąŲŠŲ‚ØĐ Ų…ØēاŲ…Ų†ØĐ A/V + ØģاØđØĐ Ø§Ų„ØĩŲˆØŠ + ØģاØđØĐ Ø§Ų„ØĩŲˆØŠ (ØĩŲˆØŠ Ų†Ų‚Ø·ŲŠ/ŲˆŲ‡Ų…ŲŠ) + ØģاØđØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ (ØĩŲˆØŠ Ų…ØđاØŊ) + ØĢŲ‚ØĩŲ‰ Ų‚ØŊØą Ų…ØđاØŊ (%) + ØŽŲˆØŊØĐ Ø§Ų„Ų…ØđاØŊ + Ų…Ų†ØŪŲØķ(ØģØąŲŠØđ) + Ų…ØŠŲˆØģØ· + Ų…ØąØŠŲØđ + Ų…ØąØŠŲØđ ŲØđŲ„اŲ‹ (Ų…Ų†ØŪŲØķ) + ØŠØīØšŲŠŲ„ اŲ„Ų…ØēاŲ…Ų†ØĐ Ų„Ų„ØđØąØķ + + Apple ØđŲ† ØĻŲØđØŊ + ŲˆØķØđ ØđŲ† ØĻŲØđØŊ + ØŠØīØšŲŠŲ„ ØŊاØĶŲ… + ŲˆŲ‚ØŠ ØŠØĢØŪŲŠØą اŲ„ØŠØģŲ„ØģŲ„ + + Ų…ØđØ·Ų„ + Ų‚ŲŠØ§ØģŲŠ + ØŊŲˆŲ„ŲŠ ØđŲ† ØĻŲØđØŊ + Ų…ØŠØđØŊØŊ ØđŲ† ØĻŲØđØŊ (اŲ†Øģ؎اŲ…) + + ØŪØ·ØĢ Apple ØđŲ† ØĻŲØđØŊ + ØŠØđØ°Øą ØŠŲ…ŲƒŲŠŲ† ØŊØđŲ… Apple ØđŲ† ØĻŲØđØŊ + + اØģØŠØŪØŊاŲ… ØĨØŪØąØ§ØŽ ØđاŲ„ŲŠ اŲ„ØŊŲ‚ØĐ + + ØŠØŽŲ…ŲŠØđ + ŲŲƒ + ØŠŲ†ØēŲŠŲ„ Ų…Ų„Ų Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„... + ØŠŲ†ØēŲŠŲ„ Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØŊŲŲ‚ا؊... + ØŠØŊŲ‚ŲŠŲ‚ Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØŊŲŲ‚ا؊... + ŲØīŲ„ ØŠŲ†ØēŲŠŲ„ Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØŊŲŲ‚ا؊ + ŲØīŲ„ ØŠŲ†ØēŲŠŲ„ Ų…Ų„Ų Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + + ØŊŲ„ŲŠŲ„ اŲ„Ų„ØđØĻا؊ + ØŠØĻØŊŲŠŲ„ ØŠŲ„Ų‚اØĶŲŠ Ų„Ų„ØĩŲˆØą اŲ„Ų…ØĩØšØąØĐ Ø­ØģØĻ + ØŠŲ…ŲƒŲŠŲ† اŲ„ØŠØĻØŊŲŠŲ„ اŲ„ØŠŲ„Ų‚اØĶŲŠ Ų„ØđØąØķ اŲ„ØĩŲˆØą اŲ„Ų…ØĩØšØąØĐ + - اØģØŠØŪØŊاŲ… ØĢŲŠŲ‚ŲˆŲ†Ø§ØŠ ŲƒØĻŲŠØąØĐ + - ØŠØĻØŊŲŠŲ„ Ø­ØģØĻ + - Ų†ØģØĻØĐ + Ų„ا ØŠŲˆØŽØŊ Ų…Ų„ŲØ§ØŠ ŲˆØĩŲˆØąØĐ ŲˆØ§Ø­ØŊØĐ ØđŲ„Ų‰ اŲ„ØĢŲ‚Ų„ + Ų…Ų„Ų ŲˆØ§Ø­ØŊ ØđŲ„Ų‰ اŲ„ØĢŲ‚Ų„ ŲˆØĩŲˆØąØĐ Ų…ØĩØšØąØĐ + Ų†ØģØĻØĐ Ø§Ų„ØĩŲˆØą اŲ„Ų…ØĩØšØąØĐ + ØŪŲŠØ§ØąØ§ØŠ اŲ„ØđØąØķ + Ų…ŲˆŲ‚Øđ اŲ„Ø·Ų‚Øģ + ØŠØšŲŠŲŠØą ŲƒŲˆØŊ اŲ„Ų…Ų†Ø·Ų‚ØĐ 2 + ØŠØšŲŠŲŠØą ŲƒŲˆØŊ اŲ„Ų…Ų†Ø·Ų‚ØĐ 3 + اŲ„Ų…ŲƒØŠØĻØĐ + ØĻŲ„ا ØŠŲ„ŲØ§Øē + ØĢØŊØŪŲ„ اØģŲ… ØĢŲ‚ØąØĻ Ų…ØŊŲŠŲ†ØĐ + ذاŲƒØąØĐ ŲŲŠØŊŲŠŲˆ/ØĩŲˆØŠ/DVD - Ų‚ØąØĩ ØĩŲ„ØĻ + ذاŲƒØąØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ - DVD-ROM + - ØīØĻŲƒØĐ Ų…Ø­Ų„ŲŠØĐ + - اŲ„ØĨŲ†ØŠØąŲ†ØŠ + ذاŲƒØąØĐ Ø§Ų„ØĩŲˆØŠ - DVD-ROM + - ØīØĻŲƒØĐ Ų…Ø­Ų„ŲŠØĐ + - اŲ„ØĨŲ†ØŠØąŲ†ØŠ + ذاŲƒØąØĐ DVD - DVD-ROM + - ØīØĻŲƒØĐ Ų…Ø­Ų„ŲŠØĐ + Ų…Ų„Ų‚Ų…ا؊ + ØđاŲ… + ØŠŲ… ØŠØšŲŠŲŠØą ØĨØđØŊاØŊا؊ اŲ„ØīØĻŲƒØĐ + Ų…Ø·Ų„ŲˆØĻ ØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ Ų„ØŠŲØđŲŠŲ„ اŲ„ØĨØđØŊاØŊا؊ + Ų‡Ų„ ØŠØąŲŠØŊ ØĨØđاØŊØĐ Ø§Ų„ØŠØīØšŲŠŲ„ اŲ„ØĒŲ†ØŸ + Ų…ØđاŲ„ØŽØĐ Ų„احŲ‚ØĐ + + - اŲ„ØĨØšŲ„اŲ‚ ØĢØŦŲ†Ø§ØĄ اŲ„ØŠØīØšŲŠŲ„ + %i ØŊŲ‚اØĶŲ‚ + %i ØŦŲˆØ§Ų†ŲŠ + %i Ų…ŲŠŲ„ŲŠ ØŦاŲ†ŲŠØĐ + %i %% + %i ŲƒŲŠŲ„ŲˆØĻاŲŠØŠ + %i ŲƒŲŠŲ„ŲˆØĻاŲŠØŠ + %i ØŊŲŠ ØĻاŲŠØŠ + ØŠŲ†ØģŲŠŲ‚ اŲ„ŲˆŲ‚ØŠ + ØŠŲ†ØģŲŠŲ‚ اŲ„ØŠØ§ØąŲŠØŪ + Ų…ØąØīحا؊ GUI + ØŠŲ…ŲƒŲŠŲ† ØđŲ…Ų„ŲŠØ§ØŠ اŲ„ØĻØ­ØŦ ØđŲ„Ų‰ اŲ„ØĨŲ†ØŠØąŲ†ØŠ + اØģØŠØŪØŊاŲ… Ų…ØģØ­ اŲ„ØŪŲ„ŲŲŠØĐ + ØĨŲŠŲ‚اŲ اŲ„Ų…ØģØ­ + ØšŲŠØą Ų…Ų…ŲƒŲ† ØĢØŦŲ†Ø§ØĄ Ų…ØģØ­ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ŲˆØģاØĶØ· + ØŠØĢØŦŲŠØą Ø­ØĻŲŠØĻŲŠ اŲ„ŲŲŠŲ„Ų… + ØĻØ­ØŦ ØđŲ† ØĩŲˆØą Ų…ØĩØšØąØĐ ØđŲ„Ų‰ Ų…ØīØ§ØąŲƒØ§ØŠ ØđŲ† ØĻŲØđØŊ + ذاŲƒØąØĐ Ų†ŲˆØđ ØšŲŠØą Ų…ØđØąŲˆŲ - اŲ„ØĨŲ†ØŠØąŲ†ØŠ + ØŠŲ„Ų‚اØĶŲŠ + ØĢØŊØŪŲ„ اØģŲ… Ų…ØģØŠØŪØŊŲ… Ų„Ų€ + اŲ„ØŠØ§ØąŲŠØŪ ŲˆØ§Ų„ŲˆŲ‚ØŠ + ØķØĻØ· اŲ„ØŠØ§ØąŲŠØŪ + ØķØĻØ· اŲ„ŲˆŲ‚ØŠ + ØĢØŊØŪŲ„ اŲ„ŲˆŲ‚ØŠ ŲŲŠ 24 ØģاØđØĐ ØĻØŠŲ†ØģŲŠŲ‚ HH:MM + ØĢØŊØŪŲ„ اŲ„ØŠØ§ØąŲŠØŪ ØĻØŠŲ†ØģŲŠŲ‚ DD/MM/YYYY + ØĢØŊØŪŲ„ ØđŲ†ŲˆØ§Ų† IP + ؊طØĻŲŠŲ‚ Ų‡Ø°Ų‡ اŲ„ØĨØđØŊاØŊا؊ اŲ„ØĒŲ†ØŸ + ؊طØĻŲŠŲ‚ اŲ„ØŠØšŲŠŲŠØąØ§ØŠ اŲ„ØĒŲ† + اŲ„ØģŲ…اح Ų„ØĨØđاØŊØĐ ØŠØģŲ…ŲŠØĐ Ø§Ų„Ų…Ų„Ų ŲˆØ­Ø°ŲŲ‡ + + + ØķØĻØ· اŲ„ØŠŲˆŲ‚ŲŠØŠ اŲ„ØēŲ…Ų†ŲŠ + اØģØŠØŪØŊاŲ… اŲ„ØŠŲˆŲ‚ŲŠØŠ اŲ„ØĩŲŠŲŲŠ + ØŠŲØķŲŠŲ„ + ØĨØēاŲ„ØĐ + - ØĢŲ„ŲˆØ§Ų† + ØŊŲˆŲ„ØĐ Ø§Ų„ØŠŲˆŲ‚ŲŠØŠ اŲ„ØēŲ…Ų†ŲŠ + اŲ„ØŠŲˆŲ‚ŲŠØŠ اŲ„ØēŲ…Ų†ŲŠ + Ų‚ŲˆØ§ØĶŲ… اŲ„Ų…Ų„ŲØ§ØŠ + ØđØąØķ Ų…ØđŲ„ŲˆŲ…ا؊ ØĩŲˆØąØĐ EXIF + اØģØŠØŪØŊاŲ… Ų†Ø§ŲØ°ØĐ ØīاØīØĐ ŲƒØ§Ų…Ų„ØĐ ØĻØŊŲ„اŲ‹ Ų…Ų† ØīاØīØĐ ŲƒØ§Ų…Ų„ØĐ Ø­Ų‚ŲŠŲ‚ŲŠØĐ + ØĢØšŲ†ŲŠØ§ØŠ اŲ„طاØĻŲˆØą ØđŲ„Ų‰ اŲ„؊حØŊŲŠØŊ + ØŠØīØšŲŠŲ„ اØģØ·ŲˆØ§Ų†Ø§ØŠ اŲ„ØĩŲˆØŠ ØŠŲ„Ų‚اØĶŲŠØ§Ų‹ + ØŠØīØšŲŠŲ„ + DVDs + ØŠØīØšŲŠŲ„ DVDs ØŠŲ„Ų‚اØĶŲŠØ§Ų‹ + اŲ„ØŪØ· اŲ„Ų…ØģØŠØŪØŊŲ… Ų„Ų„ØŠØąØŽŲ…ا؊ اŲ„Ų†ØĩŲŠØĐ + ØŊŲˆŲ„ŲŠ + Ų…ØŽŲ…ŲˆØđØĐ Ø§Ų„Ø­ØąŲˆŲ + ØĨØĩŲ„اح + اŲ„ØģØąŲŠØĐ + ØĢØŽŲ‡ØēØĐ Ø§Ų„ØĨØŊØŪاŲ„ + ØŠŲˆŲŲŠØą اŲ„طاŲ‚ØĐ + ØŠŲ†ØģŲŠŲ‚ اŲ„ŲˆŲ‚ØŠ + Ų…Ų‚ŲŠØ§Øģ ØŊØąØŽØĐ Ø§Ų„Ø­ØąØ§ØąØĐ + + + + + + + + + + + + + + + + + ØĨØēاŲ„ØĐ + ØĢŲ„ØđاØĻ + + + ØĨØķاŲØĐ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą + + + + + + + + + + اŲ„Ų…ŲƒØŠØĻØĐ + Ų‚اØđØŊØĐ Ø§Ų„ØĻŲŠØ§Ų†Ø§ØŠ + * ŲƒŲ„ اŲ„ØĢŲ„ØĻŲˆŲ…ا؊ + * ŲƒŲ„ اŲ„ŲŲ†Ø§Ų†ŲŠŲ† + * ŲƒŲ„ اŲ„ØĢØšŲ†ŲŠØ§ØŠ + * ŲƒŲ„ اŲ„ØĢŲ†ŲˆØ§Øđ + + ØŠØŪØēŲŠŲ†... + ØĢØĩŲˆØ§ØŠ اŲ„ØŠŲ†Ų‚Ų„ + اŲØŠØąØ§ØķŲŠ + - اŲ„Ų…ŲˆØķØđ + Ų…ŲˆØķŲˆØđ اŲØŠØąØ§ØķŲŠ + + Last.fm + ØĨØąØģاŲ„ ØĢØšŲ†ŲŠØ§ØŠ ØĨŲ„Ų‰ Last.fm + اØģŲ… Ų…ØģØŠØŪØŊŲ… Last.fm + ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą Last.fm + ØŠØđØ°ØąØŠ اŲ„Ų…ØĩاŲØ­ØĐ: Ų†ŲˆŲ…... + اŲ„ØąØŽØ§ØĄ اŲ„؊حØŊŲŠØŦ XBMC + ØŠØąØŪŲŠØĩ ØģŲŠØĄ: Ø­ØŊØŊ اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… ŲˆŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą + Ų…ØŠØĩŲ„ + ØšŲŠØą Ų…ØŠØĩŲ„ + ØĨØąØģاŲ„ ŲØ§ØĩŲ„ %i + ØĢØšŲ†ŲŠØ§ØŠ %i Ų…ØŪØēŲ†ØĐ + ØĨØąØģاŲ„... + ØĨØąØģاŲ„ ŲŲŠ ØŪŲ„اŲ„ %i ØŦŲˆØ§Ų†ŲŠ + اŲ„ØŠØīØšŲŠŲ„ ØĻاØģØŠØŪØŊاŲ…... + اØģØŠØŪØŊاŲ… Ų…ØēاŲ…Ų†ØĐ A/V ØģŲ„ØģØĐ + ØĨØŪŲØ§ØĄ ØĢØģŲ…Ø§ØĄ اŲ„Ų…Ų„ŲØ§ØŠ ŲŲŠ ØđØąØķ ØĩŲˆØą Ų…ØĩØšØąØĐ + اŲ„ØŠØīØšŲŠŲ„ ŲŲŠ ŲˆØķØđ اŲ„Ø­ŲŲ„ØĐ + ØĨØąØģاŲ„ ØĢØšŲ†ŲŠØ§ØŠ ØĨŲ„Ų‰ Libre.fm + اØģŲ… Ų…ØģØŠØŪØŊŲ… Libre.fm + ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą Libre.fm + Libre.fm + Scrobbler + + ØĨØąØģاŲ„ ØąØ§ØŊŲŠŲˆ Last.fm ØĨŲ„Ų‰ Last.fm + اŲ„ا؊ØĩاŲ„ ØĻŲ€ Last.fm + ؊حØŊŲŠØŊ اŲ„Ų…حطØĐ... + ØĻØ­ØŦ ØđŲ† Ų†ŲØģ اŲ„ŲŲ†Ø§Ų†ŲŠŲ†... + ØĻØ­ØŦ ØđŲ† Ų†ŲØģ اŲ„ØđŲ„اŲ…ا؊... + Ų…Ų„Ų اŲ„ØŠØđØąŲŠŲ اŲ„ØŪاØĩ ØĻŲƒ (%name%) + ØĢŲ‡Ų… اŲ„ØđŲ„اŲ…ا؊ اŲ„ŲƒŲ„ŲŠØĐ + ØĢŲ‡Ų… ŲŲ†Ø§Ų†ŲŠŲ† Ų„Ų„ØđŲ„اŲ…ØĐ %name% + ØĢŲ‡Ų… ØĢŲ„ØĻŲˆŲ…ا؊ Ų„Ų„ØđŲ„اŲ…ØĐ %name% + ØĢŲ‡Ų… Ų…Ų‚اطØđ Ų„Ų„ØđŲ„اŲ…ØĐ %name% + اØģØŠŲ…Øđ ØĨŲ„Ų‰ ØđŲ„اŲ…ØĐ Ø§Ų„ØąØ§ØŊŲŠŲˆ %name% Last.fm + Ų†ŲØģ اŲ„ŲŲ†Ø§Ų†ŲŠŲ† ŲƒŲ€ %name% + ØĢŲ‡Ų… ØĢŲ„ØĻŲˆŲ…ا؊ %name% + ØĢŲ‡Ų… Ų…Ų‚اطØđ %name% + ØĢŲ‡Ų… ØđŲ„اŲ…ا؊ %name% + ØĢŲƒØĻØą Ų…ØąØ§ŲˆØ­ Ų„Ų€ %name% + اØģØŠŲ…Øđ ØĨŲ„Ų‰ اŲ„ØąØ§ØŊŲŠŲˆ %name% Ų„Ų„Ų…ØąØ§ŲˆØ­ Last.fm + اØģØŠŲ…Øđ ØĨŲ„Ų‰ Ų†ŲØģ اŲ„ŲŲ†Ø§Ų†ŲŠŲ† %name% Ų„ØąØ§ØŊŲŠŲˆ Last.fm + ØĢŲ‡Ų… ŲŲ†Ø§Ų†ŲŠŲ† Ų„Ų„Ų…ØģØŠØŪØŊŲ… %name% + ØĢŲ‡Ų… ØĢŲ„ØĻŲˆŲ…ا؊ Ų„Ų„Ų…ØģØŠØŪØŊŲ… %name% + ØĢŲ‡Ų… Ų…Ų‚اطØđ Ų„Ų„Ų…ØģØŠØŪØŊŲ… %name% + ØĢØĩØŊŲ‚Ø§ØĄ Ų„Ų„Ų…ØģØŠØŪØŊŲ… %name% + ØŽŲŠØąØ§Ų† اŲ„Ų…ØģØŠØŪØŊŲ… %name% + Ų…ØŪطط اŲ„ŲŲ†Ø§Ų† اŲ„ØĢØģØĻŲˆØđŲŠ Ų„Ų€ %name% + Ų…ØŪطط اŲ„ØĢŲ„ØĻŲˆŲ… اŲ„ØĢØģØĻŲˆØđŲŠ Ų„Ų€ %name% + Ų…ØŪطط اŲ„Ų…Ų‚Ø·Øđ اŲ„ØĢØģØĻŲˆØđŲŠ Ų„Ų€ %name% + اØģØŠŲ…Øđ ØĨŲ„Ų‰ ØŽŲŠØąØ§Ų† %name% Ų„Ų„ØąØ§ØŊŲŠŲˆ Last.fm + اØģØŠŲ…Øđ ØĨŲ„Ų‰ اŲ„Ų…ŲˆØļŲ %name% Ų„Ų„ØąØ§ØŊŲŠŲˆ Last.fm + اØģØŠŲ…Øđ ØĨŲ„Ų‰ Ų…Ų‚اطØđ Ų…Ø­ØĻØĻØĐ %name% Ų„Ų„ØąØ§ØŊŲŠŲˆ Last.fm + اØģØŠØąØŽØ§Øđ اŲ„Ų‚اØĶŲ…ØĐ Ų…Ų† Last.fm... + Ų„ا ŲŠŲ…ŲƒŲ† اØģØŠØąØŽØ§Øđ اŲ„Ų‚اØĶŲ…ØĐ Ų…Ų† Last.fm + ØĢØŊØŪŲ„ اØģŲ… ŲŲ†Ø§Ų† Ų„Ų„ØĻØ­ØŦ ØđŲ† ØĢØģŲ…Ø§ØĄ ذا؊ ØĩŲ„ØĐ + ØĢØŊØŪŲ„ اØģŲ… ØđŲ„اŲ…ØĐ Ų„Ų„ØĻØ­ØŦ ØđŲ† ØĢØģŲ…Ø§ØĄ Ų…Ų…اØŦŲ„ØĐ + Ų…Ų‚اطØđ ØŠŲ… اŲ„اØģØŠŲ…اØđ ØĨŲ„ŲŠŲ‡Ø§ ØĻŲˆØ§ØģØ·ØĐ %name% + اØģØŠŲ…Øđ ØĨŲ„Ų‰ ØŠŲˆØĩŲŠØ§ØŠ %name% Ų„Ų„ØąØ§ØŊŲŠŲˆ Last.fm + ØĢŲ‡Ų… ØđŲ„اŲ…ا؊ Ų„Ų„Ų…ØģØŠØŪØŊŲ… %name% + اØģØŠŲ…Øđ ØĨŲ„Ų‰ Ų‚اØĶŲ…ØĐ ØŠØīØšŲŠŲ„ %name% Ų„Ų„ØąØ§ØŊŲŠŲˆ Last.fm + Ų‡Ų„ ØŠØąŲŠØŊ ØĨØķاŲØĐ Ø§Ų„Ų…Ų‚Ø·Øđ اŲ„حاŲ„ŲŠ ØĨŲ„Ų‰ اŲ„Ų…Ų‚اطØđ اŲ„Ų…Ø­ØĻØĻØĐ Ø§Ų„ØŪاØĩØĐ ØĻŲƒ. + Ų‡Ų„ ØŠØąŲŠØŊ Ų…Ų†Øđ اŲ„Ų…Ų‚Ø·Øđ اŲ„حاŲ„ŲŠØŸ + ØŠŲ…ØŠ اŲ„ØĨØķاŲØĐ ØĨŲ„Ų‰ اŲ„Ų…Ų‚اطØđ اŲ„Ų…Ø­ØĻØĻØĐ: '%s'. + ØŠØđØ°ØąØŠ ØĨØķاŲØĐ '%s' ØĨŲ„Ų‰ اŲ„Ų…Ų‚اطØđ اŲ„Ų…Ø­ØĻØĻØĐ Ų„Ųƒ + Ų…Ų…Ų†ŲˆØđ: '%s'. + ØŠØđØ°Øą Ų…Ų†Øđ '%s'. + Ų…Ų‚اطØđ Ų…Ø­ØĻØĻØĐ Ø­ØŊŲŠØŦاŲ‹ ØĻŲˆØ§ØģØ·ØĐ %name% + Ų…Ų‚اطØđ Ų…Ų…Ų†ŲˆØđØĐ Ø­ØŊŲŠØŦاŲ‹ ØĻŲˆØ§ØģØ·ØĐ %name% + ØĨØēاŲ„ØĐ Ų…Ų† اŲ„Ų…Ų‚اطØđ اŲ„Ų…Ø­ØĻØĻØĐ + ØĨŲ„ØšØ§ØĄ اŲ„Ų…Ų†Øđ + Ų‡Ų„ ØŠØąŲŠØŊ ØĨØēاŲ„ØĐ Ų‡Ø°Ø§ اŲ„Ų…Ų‚Ø·Øđ Ų…Ų† اŲ„Ų…Ų‚اطØđ اŲ„Ų…Ø­ØĻØĻØĐ Ų„ŲƒØŸ + Ų‡Ų„ ØŠØąŲŠØŊ ØĨŲ„ØšØ§ØĄ Ų…Ų†Øđ Ų‡Ø°Ø§ اŲ„Ų…Ų‚Ø·Øđ؟ + + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ اŲ„Ų…ØģØ§Øą ØĢŲˆ ØĢŲ†Ų‡ ØšŲŠØą ØĩاŲ„Ø­ + ØŠØđØ°Øą اŲ„ا؊ØĩاŲ„ ØĻŲ…Ų„Ų‚Ų… اŲ„ØīØĻŲƒØĐ + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…Ų„Ų‚Ų…ا؊ + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…ØŽŲ…ŲˆØđØĐ Ø§Ų„ØđŲ…Ų„ + + ŲØŠØ­ Ų…ØĩØŊØą Ų…ØŠØđØŊØŊ اŲ„Ų…ØģØ§ØąØ§ØŠ + اŲ„Ų…ØģØ§Øą: + + ØđاŲ… + ØŠŲƒŲˆŲŠŲ† ØŽŲ‡Ø§Øē اŲ„ØĩŲˆØŠ... + ØĻØ­ØŦ ØđŲ„Ų‰ اŲ„ØĨŲ†ØŠØąŲ†ØŠ + اŲ„Ų…ØīØšŲ„ + ØŠØīØšŲŠŲ„ اŲ„ŲˆØģاØĶØ· Ų…Ų† اŲ„Ų‚ØąØĩ + Ų…ØŠŲ‚ØŊŲ… + + ØĢØŊØŪŲ„ ØđŲ†ŲˆØ§Ų†Ø§Ų‹ ØŽØŊŲŠØŊاŲ‹ + ØĢØŊØŪŲ„ اØģŲ… اŲ„ŲŲŠŲ„Ų… + ØĢØŊØŪŲ„ اØģŲ… Ų…Ų„Ų اŲ„ØŠØđØąŲŠŲ + ØĢØŊØŪŲ„ اØģŲ… اŲ„ØĢŲ„ØĻŲˆŲ… + ØĢØŊØŪŲ„ اØģŲ… Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + ØĢØŊØŪŲ„ اØģŲ… Ų…Ų„Ų ØŽØŊŲŠØŊ + ØĢØŊØŪŲ„ اØģŲ… Ų…ØŽŲ„ØŊ + ØĢØŊØŪŲ„ اŲ„ØŊŲ„ŲŠŲ„ + اŲ„ØŪŲŠØ§ØąØ§ØŠ اŲ„Ų…ØŠŲˆŲØąØĐ: %A, %T, %N, %B, %D, %G, %Y, %F, %S + ØĢØŊØŪŲ„ ØģŲ„ØģŲ„ØĐ Ø§Ų„ØĻØ­ØŦ + Ų„ا ØīŲŠØĄ + ؊حØŊŲŠØŊ ØŠŲ„Ų‚اØĶŲŠ + ØĨŲ„ØšØ§ØĄ اŲ„اØīØŠØĻاŲƒ + ØŠŲ…اŲŠŲ„ + ØŠŲ…اŲŠŲ„ (Ų…ØđŲƒŲˆØģ) + ØŠØđاŲ…Ų„ Ų…ØīØŠØĻŲƒ + ØĨŲ„ØšØ§ØĄ... + ØĢØŊØŪŲ„ اØģŲ… اŲ„ŲŲ†Ø§Ų† + ØŠŲ… ØĨŲŠŲ‚اŲ ØŠØīØšŲŠŲ„ Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + اŲ„ØđØŊŲŠØŊ Ų…Ų† اŲ„ØđŲ†Ø§ØĩØą اŲ„ŲØ§ØīŲ„ØĐ Ø§Ų„Ų…ØŠØđاŲ‚ØĻØĐ + ØĢØŊØŪŲ„ اŲ„Ų‚ŲŠŲ…ØĐ + + ØŠŲ… ØĨŲŠŲ‚اŲ ŲˆØķØđ اŲ„Ø­ŲŲ„ØĐ + Ų„ا ØŠŲˆØŽØŊ ØĢØšŲ†ŲŠØ§ØŠ Ų…؊طاØĻŲ‚ØĐ ŲŲŠ اŲ„Ų…ŲƒØŠØĻØĐ. + ØŠØđØ°ØąØŠ ØŠŲ‡ŲŠØĶØĐ Ų‚اØđØŊØĐ Ø§Ų„ØĻŲŠØ§Ų†Ø§ØŠ. + ØŠØđØ°Øą ŲØŠØ­ Ų‚اØđØŊØĐ Ø§Ų„ØĻŲŠØ§Ų†Ø§ØŠ. + ØŠØđØ°Øą اŲ„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ ØĢØšŲ†ŲŠØ§ØŠ Ų…Ų† Ų‚اØđØŊØĐ Ø§Ų„ØĻŲŠØ§Ų†Ø§ØŠ. + Ų‚اØĶŲ…ØĐ ØŠØīØšŲŠŲ„ ŲˆØķØđ اŲ„Ø­ŲŲ„ØĐ + + ŲƒŲ„ Ų…Ų„ŲØ§ØŠ اŲ„ŲŲŠØŊŲŠŲˆ + ØšŲŠØą Ų…ØīاŲ‡ØŊ + Ų…ØīاŲ‡ØŊ + ؊حØŊŲŠØŊ ŲƒŲ…ØīاŲ‡ØŊ + ؊حØŊŲŠØŊ ŲƒØšŲŠØą Ų…ØīاŲ‡ØŊ + ØŠØ­ØąŲŠØą اŲ„ØđŲ†ŲˆØ§Ų† + اØģØŠØŪØŊاŲ… NTSC-M & NTSC-J + اØģØŠØŪØŊاŲ… NTSC-M ŲŲ‚Ø· + اØģØŠØŪØŊاŲ… NTSC-J ŲŲ‚Ø· + اØģØŠØŪØŊاŲ… PAL-60 ŲŲ‚Ø· + Ų„Ų„ØđØĻا؊ 60 Ų‡ØąØŠØē + + ØŠŲ… ØĨŲŠŲ‚اŲ اŲ„ØđŲ…Ų„ŲŠØĐ + ŲØīŲ„ اŲ„Ų†ØģØŪ + ŲØīŲ„ ŲŲŠ Ų†ØģØŪ Ų…Ų„Ų ŲˆØ§Ø­ØŊ ØđŲ„Ų‰ اŲ„ØĢŲ‚Ų„ + ŲØīŲ„ اŲ„Ų†Ų‚Ų„ + ŲØīŲ„ ŲŲŠ Ų†Ų‚Ų„ Ų…Ų„Ų ŲˆØ§Ø­ØŊ ØđŲ„Ų‰ اŲ„ØĢŲ‚Ų„ + ŲØīŲ„ اŲ„حذŲ + ŲØīŲ„ ŲŲŠ حذŲ Ų…Ų„Ų ŲˆØ§Ø­ØŊ ØđŲ„Ų‰ اŲ„ØĢŲ‚Ų„ + + Ø·ØąŲŠŲ‚ØĐ ØŠØŊØąŲŠØŽ اŲ„ŲŲŠØŊŲŠŲˆ + ØĢŲ‚ØąØĻ ØŽØ§Øą + ØŪØ·ŲŠ Ų…ØēØŊŲˆØŽ + Ų…ŲƒØđØĻ ØŦŲ†Ø§ØĶŲŠ + Lanczos2 + Lanczos3 + Sinc8 + + Ų…ŲƒØđØĻ ØŦŲ†Ø§ØĶŲŠ (ØĻØąŲ†Ø§Ų…ØŽ) + Lanczos (ØĻØąŲ†Ø§Ų…ØŽ) + Ų…ØēاŲ…Ų†ØĐ (ØĻØąŲ†Ø§Ų…ØŽ) + + (VDPAU)Ų…ØĪŲ‚ØŠ + (VDPAU)Ų…ØĪŲ‚ØŠ/ŲØķاØĶŲŠ + (VDPAU)ØŠŲ‚Ų„ŲŠŲ„ اŲ„ØķŲˆØķØ§ØĄ + (VDPAU)Ø­ØŊØĐ + Inverse Telecine + اŲ†ØŠŲ‡Ø§ØĄ ŲˆŲ‚ØŠ ØģŲƒŲˆŲ† اŲ„ØīاØīØĐ + + ØŠØĻØŊŲŠŲ„ ØĨŲ„Ų‰ اŲ„Ų‚Ų†Ø§ØĐ + + Ų…ØŽŲ„ØŊ ØŠŲ‚ØģŲŠŲ… CDDA + اØģØŠØŪØŊاŲ… Ų…ØīØšŲ„ DVD ØŪØ§ØąØŽŲŠ + Ų…ØīØšŲ„ DVD ØŪØ§ØąØŽŲŠ + Ų…ØŽŲ„ØŊ اŲ„Ų…ØŊØąØĻŲŠŲ† + Ų…ØŽŲ„ØŊ اŲ„Ų„Ų‚Ø·ØĐ + Ų…ØŽŲ„ØŊ اŲ„ØŠØģØŽŲŠŲ„ا؊ + Ų…ØŽŲ„ØŊ Ų‚ŲˆØ§ØĶŲ… اŲ„ØŠØīØšŲŠŲ„ + ØŠØģØŽŲŠŲ„ا؊ + Ų„Ų‚طا؊ + اØģØŠØŪØŊاŲ… XBMC + + Ų‚ŲˆØ§ØĶŲ… ØŠØīØšŲŠŲ„ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + Ų‚ŲˆØ§ØĶŲ… ØŠØīØšŲŠŲ„ اŲ„ŲŲŠØŊŲŠŲˆ + Ų‡Ų„ ØŠØąŲŠØŊ ØŠØīØšŲŠŲ„ اŲ„Ų„ØđØĻØĐ؟ + ŲØąØē Ø­ØģØĻ: Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + ØĩŲˆØąØĐ Ų…ØĩØšØąØĐ ØđŲ† ØĻŲØđØŊ + اŲ„ØĩŲˆØąØĐ Ø§Ų„Ų…ØĩØšØąØĐ Ø§Ų„حاŲ„ŲŠØĐ + اŲ„ØĩŲˆØąØĐ Ø§Ų„Ų…ØĩØšØąØĐ Ø§Ų„Ų…Ø­Ų„ŲŠØĐ + ØĻŲ„ا ØĩŲˆØąØĐ Ų…ØĩØšØąØĐ + اØŪØŠŲŠØ§Øą اŲ„Ų…ŲˆØŽØē + + + + + ØŠØĻاŲŠŲ† + Ų…ØģØ­ ØŽØŊŲŠØŊ + Ų…ØģØ­ اŲ„ŲƒŲ„ + اŲ„Ų…ŲˆŲ‚Øđ + + + + Ų†Ø§ŲØ°ØĐ ØŠØĢŲ…ŲŠŲ† اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + Ų†Ø§ŲØ°ØĐ ØŠØĢŲ…ŲŠŲ† اŲ„ŲŲŠØŊŲŠŲˆ + Ų†Ø§ŲØ°ØĐ ØŠØĢŲ…ŲŠŲ† اŲ„ØĩŲˆØą + Ų†ŲˆØ§ŲØ° ØŠØĢŲ…ŲŠŲ† اŲ„ØĻØąØ§Ų…ØŽ ŲˆØ§Ų„Ø­ŲØļ ŲˆØ§Ų„ØģŲŠŲ†Ø§ØąŲŠŲˆŲ‡Ø§ØŠ + ØŠØĢŲ…ŲŠŲ† Ų…ØŊŲŠØą اŲ„Ų…Ų„ŲØ§ØŠ + ØŠØĢŲ…ŲŠŲ† اŲ„ØĨØđØŊاØŊا؊ + ØĻØŊØĄ اŲ„؊حØŊŲŠØŦ + ØĨØŊØŪاŲ„ ŲˆØķØđ ØąØĶŲŠØģŲŠ + ØŠØąŲƒ ŲˆØķØđ ØąØĶŲŠØģŲŠ + ØĨŲ†ØīØ§ØĄ Ų…Ų„Ų اŲ„ØŠØđØąŲŠŲ '%s'؟ + ØĻØŊØĄ Ų…Øđ ØĨØđØŊاØŊا؊ Ø­ØŊŲŠØŦØĐ + ØĢŲØķŲ„ ØŠŲˆŲØą + ØŠØĻØŊŲŠŲ„ ØŠŲ„Ų‚اØĶŲŠ ØĻŲŠŲ† 16x9 Ųˆ 4x3 + Ų…ØđاŲ…Ų„ØĐ Ø§Ų„Ų…Ų„ŲØ§ØŠ اŲ„Ų…ØŽŲ…ØđØĐ ŲƒŲ…Ų„Ų ŲØąØŊŲŠ + ØŠŲ†ØĻŲŠŲ‡ + ŲˆØķØđ ØąØĶŲŠØģŲŠ ØĢŲŠØģØą + ŲˆØķØđ ØąØĶŲŠØģŲŠ Ų…ØŊØŪŲ„ + ØĩŲˆØąØĐ Allmusic.com + ØŪØ·ØĢ ŲŲŠ ØŠØģØŽŲŠŲ„ اŲ„ØŊØŪŲˆŲ„ + ØĨØēاŲ„ØĐ Ø§Ų„Ų…ŲˆØŽØē + ØĨØķاŲØĐ Ų…Ų„Ų ØŠØđØąŲŠŲ... + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„اØģØŠØđŲ„اŲ… ØđŲ† ŲƒŲ„ اŲ„ØĢŲ„ØĻŲˆŲ…ا؊ + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ŲˆØģاØĶØ· + Ų…Ų†ŲØĩŲ„ + Ų…ØīØ§ØąŲƒØĐ Ų…Øđ اŲ„اŲØŠØąØ§ØķŲŠ + Ų…ØīØ§ØąŲƒØ§ØŠ Ų…Øđ اŲ„اŲØŠØąØ§ØķŲŠ (Ų‚ØąØ§ØĄØĐ ŲŲ‚Ø·) + Ų†ØģØŪ اŲ„اŲØŠØąØ§ØķŲŠ + ØĩŲˆØąØĐ Ų…Ų„Ų اŲ„ØŠØđØąŲŠŲ + ØŠØĢŲ…ŲŠŲ† اŲ„ØŠŲØķŲŠŲ„ا؊ + ØŠØ­ØąŲŠØą Ų…Ų„Ų اŲ„ØŠØđØąŲŠŲ + ØŊØŪŲˆŲ„ + ØŠØđØ°Øą ØĨŲ†ØīØ§ØĄ Ų…ØŽŲ„ØŊ + ØŊŲ„ŲŠŲ„ Ų…Ų„ŲØ§ØŠ اŲ„ØŠØđØąŲŠŲ + ØĻØŊØĄ Ų…Øđ Ų…ØĩاØŊØą ŲˆØģاØĶØ· Ø­ØŊŲŠØŦØĐ + اŲ„ØŠØĢŲƒØŊ Ų…Ų† ØĢŲ† اŲ„Ų…ØŽŲ„ØŊ اŲ„Ų…Ø­ØŊØŊ Ų‚اØĻŲ„ Ų„Ų„ŲƒØŠØ§ØĻØĐ ØđŲ„ŲŠŲ‡ + ŲˆØĢŲ† اØģŲ… اŲ„Ų…ØŽŲ„ØŊ اŲ„ØŽØŊŲŠØŊ ØĩاŲ„Ø­ + ØŠŲ‚ØŊŲŠØą اŲ„Ų…ح؊ŲˆŲ‰ + ØĨØŊØŪاŲ„ ŲƒŲˆØŊ ØŠØĢŲ…ŲŠŲ† ØąØĶŲŠØģŲŠ + Ø·Ų„ØĻ ŲƒŲˆØŊ ØŠØĢŲ…ŲŠŲ† ØąØĶŲŠØģŲŠ ØđŲ†ØŊ ØĻØŊØĄ اŲ„ØŠØīØšŲŠŲ„ + ØĨØđØŊاØŊا؊ اŲ„ØīŲƒŲ„ + - ØĻŲ„ا ØķØĻØ· ØąØ§ØĻØ· - + ØŠŲ…ŲƒŲŠŲ† اŲ„ØąØģŲˆŲ… اŲ„Ų…ØŠØ­ØąŲƒØĐ + ØŠØđØ·ŲŠŲ„ RSS ØĢØŦŲ†Ø§ØĄ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + ØŠŲ…ŲƒŲŠŲ† ØĢØēØąØ§Øą اŲ„اØŪØŠØĩØ§ØąØ§ØŠ + ØđØąØķ اŲ„ØĻØąØ§Ų…ØŽ ŲŲŠ اŲ„Ų‚اØĶŲ…ØĐ Ø§Ų„ØąØĶŲŠØģŲŠØĐ + ØđØąØķ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + ØđØąØķ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„Ø·Ų‚Øģ + ØđØąØķ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„Ų†ØļاŲ… + ØđØąØķ Ų…ØģاحØĐ Ų‚ØąØĩ Ų…ØŠŲˆŲØąØĐ C: E: F: + ØđØąØķ Ų…ØģاحØĐ Ų‚ØąØĩ Ų…ØŠŲˆŲØąØĐ E: F: G: + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„Ø·Ų‚Øģ + Ų…ØģاحØĐ Ø§Ų„Ų‚ØąØĩ اŲ„ØŪاŲ„ŲŠØĐ + ØĢØŊØŪŲ„ اØģŲ… Ų…ØīØ§ØąŲƒØĐ Ų…ŲˆØŽŲˆØŊØĐ + ŲƒŲˆØŊ ØŠØĢŲ…ŲŠŲ† + ؊حŲ…ŲŠŲ„ Ų…Ų„Ų اŲ„ØŠØđØąŲŠŲ + اØģŲ… Ų…Ų„Ų اŲ„ØŠØđØąŲŠŲ + Ų…ØĩاØŊØą اŲ„ŲˆØģاØĶØ· + ØĨØŊØŪاŲ„ ŲƒŲˆØŊ ØŠØĢŲ…ŲŠŲ† ØąØĶŲŠØģŲŠ + ØŠØģØŽŲŠŲ„ اŲ„ØŊØŪŲˆŲ„ ØĨŲ„Ų‰ اŲ„ØīاØīØĐ + ØĻØ­ØŦ ØđŲ† Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØĢŲ„ØĻŲˆŲ… + ØĻØ­ØŦ ØđŲ† Ų…ØđŲ„ŲˆŲ…ا؊ ØŪاØĩØĐ ØĻاŲ„ØĢŲ„ØĻŲˆŲ… + Ų„ا ŲŠŲ…ŲƒŲ† ØŠŲ‚ØģŲŠŲ… اŲ„اØģØ·ŲˆØ§Ų†ØĐ ØĢŲˆ اŲ„Ų…Ų‚Ø·Øđ ØĢØŦŲ†Ø§ØĄ اŲ„ØŠØīØšŲŠŲ„ Ų…Ų† اŲ„اØģØ·ŲˆØ§Ų†ØĐ + ŲƒŲˆØŊ ØŠØĢŲ…ŲŠŲ† ØąØĶŲŠØģŲŠ ŲˆØĨØđØŊاØŊا؊ + ŲŠØđŲ…Ų„ ØĨØŊØŪاŲ„ ŲƒŲˆØŊ اŲ„ØŠØĢŲ…ŲŠŲ† اŲ„ØąØĶŲŠØģŲŠ ØŊاØĶŲ…اŲ‹ ØđŲ„Ų‰ ØŠŲ…ŲƒŲŠŲ† ŲˆØķØđ ØąØĶŲŠØģŲŠ + ØĢŲˆ اŲ„Ų†ØģØŪ Ų…Ų† اŲ„اŲØŠØąØ§ØķŲŠØŸ + Ø­ŲØļ اŲ„ØŠØšŲŠŲŠØąØ§ØŠ ØđŲ„Ų‰ Ų…Ų„Ų اŲ„ØŠØđØąŲŠŲØŸ + ØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ اŲ„ØĨØđØŊاØŊا؊ اŲ„Ų‚ØŊŲŠŲ…ØĐ. + Ų‡Ų„ ØŠØąŲŠØŊ اØģØŠØŪØŊاŲ…Ų‡Ø§ØŸ + ØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…ØĩاØŊØą ŲˆØģاØĶØ· Ų‚ØŊŲŠŲ…ØĐ. + Ų…Ų†ŲØĩŲ„ (Ų…ØĪŲ…Ų†) + ØŽØ°Øą + - ØŠŲƒØĻŲŠØą/ØŠØĩØšŲŠØą + ØĨØđØŊاØŊا؊ UPnP + ØĻØŊØĄ ØŠŲ„Ų‚اØĶŲŠ Ų„ØđŲ…ŲŠŲ„ UPnP + ØĒØŪØą ØŠØģØŽŲŠŲ„ ØŊØŪŲˆŲ„: %s + Ų„Ų… ŲŠØŠŲ… ØŠØģØŽŲŠŲ„ اŲ„ØŊØŪŲˆŲ„ ØĢØĻØŊاŲ‹ + Ų…Ų„Ų اŲ„ØŠØđØąŲŠŲ %i / %i + ØŠØģØŽŲŠŲ„ ØŊØŪŲˆŲ„ اŲ„Ų…ØģØŠØŪØŊŲ… / ؊حØŊŲŠØŊ Ų…Ų„Ų ØŠØđØąŲŠŲ + اØģØŠØŪØŊاŲ… ØŠØĢŲ…ŲŠŲ† ØđŲ„Ų‰ ØīاØīØĐ ØŠØģØŽŲŠŲ„ اŲ„ØŊØŪŲˆŲ„ + اØģŲ… Ų…ØģØŠØŪØŊŲ… ØĢŲˆ ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą ØšŲŠØą ØĩØ­ŲŠØ­ØĐ، ØąØŽØ§ØĄ اŲ„ØĨØđاØŊØĐ Ø§Ų„Ų…حاŲˆŲ„ØĐ. + ŲŠØŠØ·Ų„ØĻ Ų‡Ø°Ø§ ØķØĻØ· اŲ„ØŠØĢŲ…ŲŠŲ† اŲ„ØąØĶŲŠØģŲŠ. + Ų‡Ų„ ØŠØąŲŠØŊ ØķØĻØ·Ų‡Ø§ اŲ„ØĒŲ†ØŸ + ؊حŲ…ŲŠŲ„ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØĻØąŲ†Ø§Ų…ØŽ + ØŠØīØšŲŠŲ„ اŲ„Ø­ŲŲ„ØĐ! + ØĩØ­ŲŠØ­ + Ų…ØīØąŲˆØĻا؊ Ų…ØŪØŠŲ„Ø·ØĐ + ØŠØđØĻØĶØĐ Ø§Ų„Ų†ØļØ§ØąØ§ØŠ + Ų…ØģØŽŲ„ اŲ„ØŊØŪŲˆŲ„ ŲƒŲ€ + ØŠØģØŽŲŠŲ„ اŲ„ØŪØąŲˆØŽ + ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą اŲ„ØŠŲŠ ØĢØŊØŪŲ„ØŠŲ‡Ø§ Ų„ا ؊؊ŲˆØ§ŲŲ‚ Ų…Øđ ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą اŲ„Ų…ØģØŽŲ„ØĐ ŲŲŠ Ų†ØļاŲ…Ų†Ø§. اŲ„ØąØŽØ§ØĄ ØŠŲƒØąØ§Øą اŲ„Ų…حاŲˆŲ„ØĐ. + اذŲ‡ØĻ ØĨŲ„Ų‰ اŲ„ØŽØ°Øą + ŲŠŲ†ØģØŽ + ŲŠŲ†ØģØŽ (Ų…ØđŲƒŲˆØģ) + Ų…ØēŲŠØŊ + ØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ اŲ„ŲŲŠØŊŲŠŲˆ + ØŠØ­ØąŲŠØą Ų…ŲˆŲ‚Øđ اŲ„ØīØĻŲƒØĐ + ØĨØēاŲ„ØĐ Ų…ŲˆŲ‚Øđ اŲ„ØīØĻŲƒØĐ + Ų‡Ų„ ØŠØąŲŠØŊ Ų…ØģØ­ اŲ„Ų…ØŽŲ„ØŊ؟ + ŲˆØ­ØŊØĐ Ø§Ų„ذاŲƒØąØĐ + ØŠŲ… ؊حŲ…ŲŠŲ„ ŲˆØ­ØŊØĐ Ø§Ų„ذاŲƒØąØĐ + ØŠØđØ°Øą ؊حŲ…ŲŠŲ„ ŲˆØ­ØŊØĐ Ø§Ų„ذاŲƒØąØĐ + ŲŲŠ اŲ„Ų…Ų†ŲØ° %i، اŲ„ŲØŠØ­ØĐ %i + ØŠØĢŲ…ŲŠŲ† ØīاØīØĐ Ø§Ų„ØŠŲˆŲ‚Ų + ØķØĻØ· + اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… + ØĨØŊØŪاŲ„ ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą Ų„Ų€ + Ų…ŲˆŲ‚ØŠ اŲ„ØĨØšŲ„اŲ‚ + ŲØ§ØĩŲ„ اŲ„ØĨØšŲ„اŲ‚ (ØĻاŲ„ØŊŲ‚اØĶŲ‚) + ØĻØŊØĢ، ØĨØšŲ„اŲ‚ ŲŲŠ %im + ØĨØšŲ„اŲ‚ ŲŲŠ 30 ØŊŲ‚ŲŠŲ‚ØĐ + ØĨØšŲ„اŲ‚ ŲŲŠ 60 ØŊŲ‚ŲŠŲ‚ØĐ + ØĨØšŲ„اŲ‚ ŲŲŠ 120 ØŊŲ‚ŲŠŲ‚ØĐ + Ų…ŲˆŲ‚ØŠ ØĨØšŲ„اŲ‚ Ų…ØŪØĩØĩ + ØĨŲ„ØšØ§ØĄ Ų…ŲˆŲ‚ØŠ اŲ„ØĨØšŲ„اŲ‚ + اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… ŲˆŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą Ų„Ų€ %s + اØģØŠØđØąØ§Øķ... + Ų…ØđŲ„ŲˆŲ…ا؊ ØĢØģاØģŲŠØĐ + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„Ų…ØŪØēŲ† + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„Ų‚ØąØĩ اŲ„ØĩŲ„ØĻ + Ų…ØđŲ„ŲˆŲ…ا؊ DVD-ROM + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØīØĻŲƒØĐ + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ŲŲŠØŊŲŠŲˆ + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØŽŲ‡Ø§Øē + اŲ„ØĨØŽŲ…اŲ„ŲŠ + اŲ„Ų…ØģØŠØŪØŊŲ… + Ų…Ų† + اŲ„Ų‚ŲŲ„ ØšŲŠØą Ų…ØŊØđŲ… + ØšŲŠØą Ų…Ų‚ŲŲ„ + Ų…Ų‚ŲŲ„ + Ų…ØŽŲ…ØŊ + ŲŠØŠØ·Ų„ØĻ ØĨØđاØŊØĐ Ø§Ų„ØķØĻØ· + ØĢØģØĻŲˆØđ + ØŪØ· + ØīØĻŲƒØĐ Windows (SMB) + Ų…Ų„Ų‚Ų… XBMSP + Ų…Ų„Ų‚Ų… FTP + Ų…ØīØ§ØąŲƒØĐ Ų…ŲˆØģŲŠŲ‚Ų‰ iTunes (DAAP) + Ų…Ų„Ų‚Ų… UPnP + ØđØąØķ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ŲŲŠØŊŲŠŲˆ + ØŠŲ… + ؊حŲˆŲŠŲ„ + ØŠØĢŲ…ŲŠŲ† Caps + ØąŲ…ŲˆØē + Backspace + Ų…ØģاŲØĐ + ØĨØđاØŊØĐ ØŠØ­Ų…ŲŠŲ„ اŲ„ØīŲƒŲ„ + ØŠØŊŲˆŲŠØą ØĻاØģØŠØŪØŊاŲ… Ų…ØđŲ„ŲˆŲ…ا؊ EXIF + اØģØŠØŪØŊاŲ… ØĢŲ†Ų…اط ØđØąØķ اŲ„Ų…Ų„ØĩŲ‚ Ų„ØđØąŲˆØķ اŲ„ØŠŲ„ŲØ§Øē + ØąØŽØ§ØĄ اŲ„اŲ†ØŠØļØ§Øą + Ų†ØģØŪØĐ Ø§Ø­ØŠŲŠØ§Ø·ŲŠØĐ EEPROM + Ų†ØģØŪØĐ Ø§Ø­ØŠŲŠØ§Ø·ŲŠØĐ BIOS + ØŠŲ…ŲƒŲŠŲ† اŲ„ØąŲØđ اŲ„ØŠŲ„Ų‚اØĶŲŠ Ų„Ų„Ų…ŲˆØķŲˆØđ ŲˆØ§Ų„Ų…ØđاŲŠŲ†ØĐ + Ų…ØŪØĩØĩ + ØŠŲ…ŲƒŲŠŲ† ØŠØģØŽŲŠŲ„ اŲ„ØĨØĩŲ„اح + ØŠŲ†ØēŲŠŲ„ Ų…ØđŲ„ŲˆŲ…ا؊ ØĨØķاŲŲŠØĐ ØđŲ„Ų‰ ؊حØŊŲŠØŦا؊ اŲ„Ų…ŲƒØŠØĻØĐ + + Ų…Ų…ØģØ­ØĐ Ø§ŲØŠØąØ§ØķŲŠØĐ + ØŠØšŲŠŲŠØą اŲ„Ų…Ų…ØģØ­ØĐ + ØŠØĩØŊŲŠØą Ų…ŲƒØŠØĻØĐ Ø§Ų„Ų…ŲˆØģŲŠŲ‚Ų‰ + اØģØŠŲŠØąØ§ØŊ Ų…ŲƒØŠØĻØĐ Ø§Ų„Ų…ŲˆØģŲŠŲ‚Ų‰ + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ ŲŲ†Ø§Ų†! + ŲØīŲ„ ØŠŲ†ØēŲŠŲ„ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ŲŲ†Ø§Ų† + + + + ØŠØīØšŲŠŲ„ اŲ„Ø­ŲŲ„ØĐ! (Ų…Ų„ŲØ§ØŠ اŲ„ŲŲŠØŊŲŠŲˆ) + Ų…ØīØąŲˆØĻا؊ Ų…ØŪØŠŲ„Ø·ØĐ (Ų…Ų„ŲØ§ØŠ اŲ„ŲŲŠØŊŲŠŲˆ) + ØŠØđØĻØĶØĐ Ø§Ų„Ų†ØļØ§ØąØ§ØŠ (Ų…Ų„ŲØ§ØŠ اŲ„ŲŲŠØŊŲŠŲˆ) + ØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ اŲ„ØĢŲ„ØĻŲˆŲ… + ØĨØđØŊاØŊا؊ اŲ„Ø·Ų‚Øģ... + + ØŊŲ„ŲŠŲ„ Ų…Ų„Ų‚Ų…ا؊ اŲ„ŲˆŲŠØĻ (HTTP) + ØŊŲ„ŲŠŲ„ Ų…Ų„Ų‚Ų…ا؊ اŲ„ŲˆŲŠØĻ (HTTPS) + ØŠØđØ°Øą اŲ„ŲƒØŠØ§ØĻØĐ ØđŲ„Ų‰ اŲ„Ų…ØŽŲ„ØŊ: + Ų‡Ų„ ØŠØąŲŠØŊ اŲ„؊؎اŲˆØē ŲˆØ§Ų„Ų…؊اØĻØđØĐ؟ + ؊ؚذŲŠØĐ RSS + + + ØšŲŠØą Ų…ØđØąŲˆŲ. ØąØŽØ§ØĄ ØĨØķاŲØĐ MD5 Ų…Ų† xbmc.log ØĨŲ„Ų‰ BiosIDs.ini. + DNS ØŦاŲ†ŲˆŲŠ + Ų…Ų„Ų‚Ų… DHCP: + ØđŲ…Ų„ Ų…ØŽŲ„ØŊ ØŽØŊŲŠØŊ + ØŠØđØŠŲŠŲ… LCD ØđŲ†ØŊ اŲ„ØŠØīØšŲŠŲ„ + ØšŲŠØą Ų…ØđØąŲˆŲ ØĢŲˆ Ų…Ø­Ų…Ų„ (Ų…Ø­Ų…ŲŠ) + ØŠØđØŠŲŠŲ… LCD ØđŲ†ØŊ اŲ„ØĨŲŠŲ‚اŲ اŲ„Ų…ØĪŲ‚ØŠ + ØŠØĻØŊŲŠŲ„ LED ØđŲ†ØŊ اŲ„ØĨŲŠŲ‚اŲ اŲ„Ų…ØĪŲ‚ØŠ + Ų…Ų„ŲØ§ØŠ اŲ„ŲŲŠØŊŲŠŲˆ - اŲ„Ų…ŲƒØŠØĻØĐ + Ø­ŲØļ اŲ„Ų„ØđØĻا؊ + ŲØąØē Ø­ØģØĻ: اŲ„Ų…ØđØąŲ + ØŠŲ†ØēŲŠŲ„ ØđŲ…Ų„ŲŠØ§ØŠ اŲ„Ø­ŲØļ + Ø­ŲØļ اŲ„Ų„ØđØĻØĐ Ø§Ų„Ų…ØŦØĻØŠØĐ ØđŲ„Ų‰ HDD + ŲØīŲ„ ŲŲŠ ØŠŲ†ØēŲŠŲ„ Ø­ŲØļ اŲ„Ų„ØđØĻØĐ + Ø­ØŊØŊ Ø­ŲØļ اŲ„Ų„ØđØĻØĐ Ų„Ų„ØŠŲ†ØēŲŠŲ„ ŲˆØ§Ų„ØŠØŦØĻŲŠØŠ + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ø­ŲØļ ØĢŲˆŲ†Ų„اŲŠŲ† Ų„Ų„ØđØĻØĐ Ų…Ø­ØŊØŊØĐ + اŲ†ØŠŲ‚Ų„ ØĨŲ„Ų‰ Ø­ŲØļ اŲ„Ų„ØđØĻØĐ + Ø­ŲØļ اŲ„Ų„ØđØĻا؊ + ØŠØīØšŲŠŲ„ ØŽØēØĄ... + ØĨØđاØŊØĐ ØķØĻØ· اŲ„Ų…ØđاŲŠØąØĐ + ØģŲŠØĪØŊŲŠ Ų‡Ø°Ø§ ØĨŲ„Ų‰ ØĨØđاØŊØĐ ØķØĻØ· Ų‚ŲŠŲ… اŲ„Ų…ØđاŲŠØąØĐ Ų„Ų€ %s + ØĨŲ„Ų‰ اŲ„Ų‚ŲŠŲ… اŲ„اŲØŠØąØ§ØķŲŠØĐ. + اØģØŠØđØąØ§Øķ Ų„Ų„ŲˆØŽŲ‡ØĐ + + اØģØŠØŪØŊاŲ… ØĢØģŲ…Ø§ØĄ اŲ„Ų…ØŽŲ„ØŊا؊ Ų„ØđŲ…Ų„ŲŠØ§ØŠ اŲ„ØĻØ­ØŦ + اŲ„Ų…Ų„Ų + اØģØŠØŪØŊاŲ… ØĢØģŲ…Ø§ØĄ Ų…Ų„ŲØ§ØŠ ØĢŲˆ Ų…ØŽŲ„ØŊا؊ ŲŲŠ ØđŲ…Ų„ŲŠØ§ØŠ اŲ„ØĻØ­ØŦ؟ + ØķØĻØ· اŲ„Ų…ح؊ŲˆŲ‰ + اŲ„Ų…ØŽŲ„ØŊ + ØĻØ­ØŦ ØđŲ† Ų…ح؊ŲˆŲ‰ ØĻØīŲƒŲ„ Ų…ØŠŲƒØąØąØŸ + ØĨŲ„ØšØ§ØĄ ØŠØĢŲ…ŲŠŲ† اŲ„Ų…ØĩاØŊØą + Ų…Ų…ØŦŲ„ + ŲŲŠŲ„Ų… + Ų…ØŪØąØŽ + Ų‡Ų„ ØŠØąŲŠØŊ ØĨØēاŲ„ØĐ ŲƒŲ„ اŲ„ØđŲ†Ø§ØĩØą Ų…Ų† ØŊاØŪŲ„ + Ų‡Ø°Ø§ اŲ„Ų…ØģØ§Øą Ų…Ų† اŲ„Ų…ŲƒØŠØĻØĐ؟ + ØĢŲŲ„اŲ… + ØđØąŲˆØķ + ŲŠØ­ØŠŲˆŲŠ Ų‡Ø°Ø§ اŲ„ØŊŲ„ŲŠŲ„ ØđŲ„Ų‰ + ØŠØīØšŲŠŲ„ Ų…ØģØ­ ØŠŲ„Ų‚اØĶŲŠ + Ų…ØģØ­ Ų…ØŠŲƒØąØą + ŲƒŲ€ + Ų…ØŪØąØŽŲˆŲ† + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…Ų„ŲØ§ØŠ ŲŲŠØŊŲŠŲˆ ŲŲŠ Ų‡Ø°Ø§ اŲ„Ų…ØģØ§Øą! + ØŠØĩŲˆŲŠØŠØ§ØŠ + Ų…ØđŲ„ŲˆŲ…ا؊ ØđØąØķ اŲ„ØŠŲ„ŲØ§Øē + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„Ø­ØŊØŦ + ؊حŲ…ŲŠŲ„ ØŠŲØ§ØĩŲŠŲ„ اŲ„ØđØąØķ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ + ØĻØ­ØŦ ØđŲ† ØŊŲ„ŲŠŲ„ Ø­ØŊØŦ + ؊حŲ…ŲŠŲ„ Ų…ØđŲ„ŲˆŲ…ا؊ Ų„ØĢØ­ØŊاØŦ ŲŲŠ اŲ„ØŊŲ„ŲŠŲ„ + ؊حØŊŲŠØŊ ØđØąØķ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ: + ØĨØŊØŪاŲ„ اØģŲ… اŲ„ØđØąØķ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ + اŲ„ØŽŲ„ØģØĐ %i + Ø­ØŊØŦ + ØĢØ­ØŊاØŦ + ؊حŲ…ŲŠŲ„ ØŠŲØ§ØĩŲŠŲ„ اŲ„Ø­ØŊØŦ + ØĨØēاŲ„ØĐ Ø­ØŊØŦ Ų…Ų† اŲ„Ų…ŲƒØŠØĻØĐ + ØĨØēاŲ„ØĐ ØđØąØķ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ Ų…Ų† اŲ„Ų…ŲƒØŠØĻØĐ + ØđØąØķ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ + Ų…ŲˆØķŲˆØđ اŲ„Ø­ØŊØŦ + * ŲƒŲ„ اŲ„ØŽŲ„Øģا؊ + ØĨØŪŲØ§ØĄ اŲ„Ų…ØīاŲ‡ØŊ + ŲƒŲˆØŊ اŲ„Ø­ØŊØŦ + ØĨØŪŲØ§ØĄ اŲ„Ų…ŲˆØķŲˆØđ Ų„Ų„ØđŲ†Ø§ØĩØą ØšŲŠØą اŲ„Ų…ØīاŲ‡ØŊØĐ + * Ų…ØŪŲŲŠ Ų„Ų…Ų†Øđ اŲ„Ų…ŲØģØŊŲŠŲ† * + ØķØĻØ· Ų…ŲˆØŽØē اŲ„ŲØĩŲ„ + ØĩŲˆØąØĐ Ø§Ų„ŲØĩŲ„ + ŲØĩŲ„ + ØŠŲ†ØēŲŠŲ„ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ŲŲŠŲ„Ų… + ØĨŲ„ØšØ§ØĄ ØŠØđŲŠŲŠŲ† اŲ„Ų…ح؊ŲˆŲ‰ + + ؊حØŊŲŠØŦ Ų…ØđŲ„ŲˆŲ…ا؊ ØđØąØķ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ + ؊حØŊŲŠØŦ Ų…ØđŲ„ŲˆŲ…ا؊ Ų„ŲƒŲ„ اŲ„ØĢØ­ØŊاØŦ + ŲŠØ­ØŠŲˆŲŠ اŲ„Ų…ØŽŲ„ØŊ اŲ„Ų…ح؊ŲˆŲ‰ ØđŲ„Ų‰ ØđØąØķ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ ŲØąØŊŲŠ + اØģØŠØŦŲ†Ø§ØĄ اŲ„Ų…ØŽŲ„ØŊ اŲ„Ų…Ø­ØŊØŊ Ų…Ų† ØđŲ…Ų„ŲŠØ§ØŠ اŲ„Ų…ØģØ­ + ØŪاØĩ + + ŲŠØ­ØŠŲˆŲŠ اŲ„Ų…ØŽŲ„ØŊ اŲ„Ų…Ø­ØŊØŊ ØđŲ„Ų‰ ŲŲŠØŊŲŠŲˆ ŲØąØŊŲŠ + ØąØ§ØĻØ· ØĻØđØąØķ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ + ØĨØēاŲ„ØĐ ØąØ§ØĻØ· ØĻØđØąØķ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ + ØĢŲŲ„اŲ… Ų…ØķاŲØĐ Ø­ØŊŲŠØŦاŲ‹ + ØĢØ­ØŊاØŦ Ų…ØķاŲØĐ Ø­ØŊŲŠØŦاŲ‹ + اØģØŠŲˆØŊŲŠŲˆŲ‡Ø§ØŠ + ŲŲŠØŊŲŠŲˆ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + ŲŲŠØŊŲŠŲˆ Ų…ŲˆØģŲŠŲ‚Ų‰ Ų…ØķاŲ Ø­ØŊŲŠØŦاŲ‹ + ŲŲŠØŊŲŠŲˆ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + ØĨØēاŲ„ØĐ ŲŲŠØŊŲŠŲˆ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ Ų…Ų† اŲ„Ų…ŲƒØŠØĻØĐ + Ų…ØđŲ„ŲˆŲ…ا؊ ŲŲŠØŊŲŠŲˆ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + ؊حŲ…ŲŠŲ„ Ų…ØđŲ„ŲˆŲ…ا؊ ŲŲŠØŊŲŠŲˆ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + Ų…ØŪØŠŲ„Ø· + اŲ†ØŠŲ‚Ų„ ØĨŲ„Ų‰ اŲ„ØĢŲ„ØĻŲˆŲ…ا؊ Ø­ØģØĻ اŲ„ŲŲ†Ø§Ų† + اŲ†ØŠŲ‚Ų„ ØĨŲ„Ų‰ اŲ„ØĢŲ„ØĻŲˆŲ… + ØŠØīØšŲŠŲ„ اŲ„ØĢØšŲ†ŲŠØĐ + اŲ†ØŠŲ‚Ų„ ØĨŲ„Ų‰ ŲŲŠØŊŲŠŲˆ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ Ų…Ų† اŲ„ØĢŲ„ØĻŲˆŲ… + اŲ†ØŠŲ‚Ų„ ØĨŲ„Ų‰ ŲŲŠØŊŲŠŲˆ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ Ø­ØģØĻ اŲ„ŲŲ†Ø§Ų† + ØŠØīØšŲŠŲ„ ŲŲŠØŊŲŠŲˆ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + + ØķØĻØ· Ų…ŲˆØŽØē اŲ„Ų…Ų…ØŦŲ„ + + ØĨØēاŲ„ØĐ ØđŲ„اŲ…ØĐ Ų…ØąØŽØđŲŠØĐ Ų„Ų„Ø­ØŊØŦ + ØķØĻØ· ØđŲ„اŲ…ØĐ Ų…ØąØŽØđŲŠØĐ Ų„Ų„Ø­ØŊØŦ + ØĨØđØŊاØŊا؊ اŲ„Ų…Ų…ØģØ­ØĐ + ØŠŲ†ØēŲŠŲ„ Ų…ØđŲ„ŲˆŲ…ا؊ ŲŲŠØŊŲŠŲˆ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + ØŠŲ†ØēŲŠŲ„ Ų…ØđŲ„ŲˆŲ…ا؊ ØđØąØķ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ + Ų…ØģØŠØŪØąØŽ + Ų…Øģطح + ØđØąŲˆØķ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠØĐ Ų…ØģطحØĐ + احØĩŲ„ ØđŲ„Ų‰ Fanart + ØđØąØķ Fanart ŲŲŠ Ų…ŲƒØŠØĻا؊ اŲ„ŲŲŠØŊŲŠŲˆ ŲˆØ§Ų„Ų…ŲˆØģŲŠŲ‚Ų‰ + Ų…ØģØ­ Ų„Ų…ح؊ŲˆŲ‰ ØŽØŊŲŠØŊ + ØĢŲˆŲ„ ØđØąØķ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ + اŲ„ŲƒØ§ØŠØĻ + ØŠŲ†ØļŲŠŲ ØĢØģŲ…Ø§ØĄ اŲ„Ų…Ų„ŲØ§ØŠ ŲˆØ§Ų„Ų…ØŽŲ„ØŊا؊ + + ØĢØĻØŊاŲ‹ + ØĨذا ŲƒØ§Ų†ØŠ ØŽŲ„ØģØĐ ŲˆØ§Ø­ØŊØĐ ŲŲ‚Ø· + ØŊاØĶŲ…اŲ‹ + Ų„Ų‡ اØģØŠØŪØąØ§ØŽ + ØŪØ·ØĢ + ØđØąØķ Fanart + ØŠØĩØŊŲŠØą ØĨŲ„Ų‰ Ų…Ų„Ų ŲØąØŊŲŠ ØĢŲˆ Ų…Ų†ŲØĩŲ„ + Ų…Ų„ŲØ§ØŠ Ų„ŲƒŲ„ ØĨØŊØŪاŲ„ØŸ + Ų…Ų„Ų ŲØąØŊŲŠ + Ų…Ų†ŲØĩŲ„ + ØŠØĩØŊŲŠØą اŲ„Ų…ŲˆØŽØēا؊ Ųˆfanart + اØģØŠØĻØŊاŲ„ اŲ„Ų…Ų„ŲØ§ØŠ اŲ„Ų‚ØŊŲŠŲ…ØĐ؟ + اØģØŠØŦŲ†Ø§ØĄ اŲ„Ų…ØģØ§Øą Ų…Ų† ؊حØŊŲŠØŦا؊ اŲ„Ų…ŲƒØŠØĻØĐ + اØģØŠØŪØąØ§ØŽ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØĻŲŠØ§Ų†Ø§ØŠ اŲ„ØĢØģاØģŲŠØĐ Ų„Ų„ŲˆØģاØĶØ· + Ų…ØŽŲ…ŲˆØđا؊ + ØĨØķاŲØ§ØŠ + + + + ØđØąØķ اŲ„Ų…Ų„ŲØ§ØŠ ŲˆØ§Ų„ØŊŲ„اØĶŲ„ اŲ„Ų…ØŪŲŲŠØĐ + + ØđŲ…ŲŠŲ„ TuxBox + ؊حذŲŠØą: ØŽŲ‡Ø§Øē TuxBox اŲ„Ų…ØģØŠŲ‡ØŊŲ ŲŲŠ ŲˆØķØđ اŲ„ØŠØģØŽŲŠŲ„! + ØģŲŠØŠŲ… ØĨŲŠŲ‚اŲ اŲ„ØŠØŊŲŲ‚! + Ų…Ø­Ųˆ Ų„Ų„Ų‚Ų†Ø§ØĐ: ŲØīŲ„ %s! + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ† ØŠØąŲŠØŊ ØĻØŊØĄ اŲ„ØŠØŊŲŲ‚ØŸ + اŲ„ا؊ØĩاŲ„ ØĻŲ€: %s + ØŽŲ‡Ø§Øē TuxBox + + + Ų…ŲˆØģŲŠŲ‚Ų‰ UPnP + ŲŲŠØŊŲŠŲˆ UPnP + ØĩŲˆØą UPnP + ØĨØķاŲØĐ Ų…ØīØ§ØąŲƒØĐ Ø§Ų„ŲˆØģاØĶØ·... + ØŠŲ…ŲƒŲŠŲ† Ų…Ų„Ų‚Ų… UPnP + ØĨØŊØ§ØąØĐ Ų…ØīØ§ØąŲƒØ§ØŠ Ų…ŲˆØģŲŠŲ‚Ų‰ UPnP + ØĨØŊØ§ØąØĐ Ų…ØīØ§ØąŲƒØ§ØŠ ŲŲŠØŊŲŠŲˆ UPnP + ØĨØŊØ§ØąØĐ Ų…ØīØ§ØąŲƒØ§ØŠ ØĩŲˆØą UPnP + ØŠØ­ØąŲŠØą Ų…ØīØ§ØąŲƒØĐ Ø§Ų„ŲˆØģاØĶØ· + ØĨØēاŲ„ØĐ Ų…ØīØ§ØąŲƒØĐ Ø§Ų„ŲˆØģاØĶØ· + ØŊŲ„ŲŠŲ„ ØđŲ†Ø§ŲˆŲŠŲ† ŲØąØđŲŠØĐ Ų…ØŪØĩØĩØĐ + ØŊŲ„ŲŠŲ„ اŲ„ØĢŲŲ„اŲ… ŲˆØ§Ų„ØđŲ†Ø§ŲˆŲŠŲ† اŲ„ŲØąØđŲŠØĐ Ø§Ų„ØĻØŊŲŠŲ„ØĐ + + ØŠŲ…ŲƒŲŠŲ† اŲ„Ų…اŲˆØģ + ØŠØīØšŲŠŲ„ ØĢØĩŲˆØ§ØŠ اŲ„ØŠŲ†Ų‚Ų„ ØĢØŦŲ†Ø§ØĄ ØŠØīØšŲŠŲ„ اŲ„ŲˆØģاØĶØ· + ØĩŲˆØąØĐ Ų…ØĩØšØąØĐ + Ų…Ų†Ø·Ų‚ØĐ Ų…ØīØšŲ„ DVD ØĨØŽØĻØ§ØąŲŠØĐ + ØŽŲ‡Ø§Øē اŲ„ŲŲŠØŊŲŠŲˆ + Ų…Ų†ØļØą اŲ„ŲŲŠØŊŲŠŲˆ + ØđاØŊŲŠ + ØŠŲ†ØģŲŠŲ‚ ØŠØīØšŲŠŲ„ ŲŲŠØŊŲŠŲˆ + ØīاØīØĐ ØđØąŲŠØķØĐ + ØŠŲ…ŲƒŲŠŲ† 480p + ØŠŲ…ŲƒŲŠŲ† 720p + ØŠŲ…ŲƒŲŠŲ† 1080i + ØĨØŊØŪاŲ„ اØģŲ… Ų„Ų‚اØĶŲ…ØĐ ØŠØīØšŲŠŲ„ ØŽØŊŲŠØŊØĐ + ØŠØđØ·ŲŠŲ„ ØĨØķاŲØĐ ØĢØēØąØ§Øą Ų…ØĩØŊØą ŲŲŠ Ų‚ŲˆØ§ØĶŲ… اŲ„Ų…Ų„ŲØ§ØŠ + ØŠŲ…ŲƒŲŠŲ† ØĢØīØąØ·ØĐ Ø§Ų„ØŠŲ…ØąŲŠØą + ØŦØĻØŠ ØŠØąØīŲŠØ­ اŲ„Ų…ØīاŲ‡ØŊ ŲŲŠ Ų…ŲƒØŠØĻØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ + ŲØŠØ­ + Ų…ØģØŠŲˆŲ‰ ØĨØŊØ§ØąØĐ Ø§Ų„ØĩŲˆØŠ + ØģØąŲŠØđ + Ų‡Ø§ØŊØĶ + ØŠŲ…ŲƒŲŠŲ† + Ų…ØģØŠŲˆŲ‰ ØĨØŊØ§ØąØĐ Ø§Ų„طاŲ‚ØĐ + طاŲ‚ØĐ Ų…ØąØŠŲØđØĐ + طاŲ‚ØĐ Ų…Ų†ØŪŲØķØĐ + ØĻØŊŲŠŲ„ Ų…ØąØŠŲØđ + ØĻØŊŲŠŲ„ Ų…Ų†ØŪŲØķ + ØŠØđØ°Øą ØŠØŪØēŲŠŲ† اŲ„Ų…Ų„ŲØ§ØŠ ØĢŲƒØĻØą Ų…Ų† 4 ØŽŲŠØŽØ§ØĻاŲŠØŠ + اŲ„ŲØĩŲ„ + ØļŲ„ ØĻŲƒØģŲ„ ØĻØŽŲˆØŊØĐ ØđاŲ„ŲŠØĐ v2 + ØŠŲ…ŲƒŲŠŲ† Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ ØđŲ†ØŊ ØĻØŊØĄ اŲ„ØŠØīØšŲŠŲ„ + اØģØŠØŪØŊاŲ… ØąØģŲˆŲ… Ų…ØŠØ­ØąŲƒØĐ ØĻŲŠŲ†ŲŠØĐ + ŲŠØ­ØŠŲˆŲŠ ØđŲ„Ų‰ + Ų„ا ŲŠØ­ØŠŲˆŲŠ ØđŲ„Ų‰ + ŲŠŲƒŲˆŲ† + Ų„ا ŲŠŲƒŲˆŲ† + ØĻØŊØĄ Ų…Øđ + اŲ†ØŠŲ‡Ø§ØĄ Ų…Øđ + ØĢŲƒØĻØą Ų…Ų† + ØĢŲ‚Ų„ Ų…Ų† + ØĻØđØŊ + Ų‚ØĻŲ„ + ŲŲŠ اŲ„Ų…اØķŲŠ + Ų„ŲŠØģ ŲŲŠ اŲ„Ų…اØķŲŠ + Ų…Ų…Øģحا؊ + Ų…Ų…ØģØ­ØĐ Ø§Ų„ŲŲŠŲ„Ų… اŲ„اŲØŠØąØ§ØķŲŠ + Ų…Ų…ØģØ­ØĐ Ø§Ų„ØđØąØķ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ اŲ„اŲØŠØąØ§ØķŲŠ + Ų…Ų…ØģØ­ØĐ ŲŲŠØŊŲŠŲˆ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ اŲ„اŲØŠØąØ§ØķŲŠ + ØŠŲ…ŲƒŲŠŲ† اŲ„ØąØŽŲˆØđ ØĻŲ†Ø§ØĄŲ‹ ØđŲ„Ų‰ Ų„ØšØĐ Ø§Ų„Ų…Ų…ØģØ­ØĐ + - ØĨØđØŊاØŊا؊ اŲ„Ų…Ų…ØģØ­ØĐ + Ų…ØŠØđØŊØŊ اŲ„Ų„ؚا؊ + اŲ„ŲØĩŲˆŲ„ + + اŲ„Ų‚ŲŠŲ…ØĐ Ø§Ų„Ų…طاØĻŲ‚ØĐ + Ų‚اØđØŊØĐ Ų‚اØĶŲ…ØĐ ØŠØīØšŲŠŲ„ Ø°ŲƒŲŠØĐ + Ų…طاØĻŲ‚ØĐ Ø§Ų„ØđŲ†Ø§ØĩØą ŲŲŠ + Ų‚اØđØŊØĐ ØŽØŊŲŠØŊØĐ... + ŲŠØŽØĻ Ų…طاØĻŲ‚ØĐ Ø§Ų„ØđŲ†Ø§ØĩØą + ŲƒŲ„ اŲ„Ų‚ŲˆØ§ØđØŊ + ŲˆØ§Ø­ØŊ ØĢŲˆ ØĢŲƒØŦØą Ų…Ų† اŲ„Ų…Ų„ŲØ§ØŠ + Ø­ØŊØŊ ØđŲ„Ų‰ + ØĻŲ„ا Ø­ØŊ + ØŠØąØŠŲŠØĻ Ø­ØģØĻ + ØŠØĩاØđØŊŲŠ + ØŠŲ†Ø§ØēŲ„ŲŠ + ØŠØ­ØąŲŠØą Ų‚اØĶŲ…ØĐ ØŠØīØšŲŠŲ„ Ø°ŲƒŲŠØĐ + اØģŲ… Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + ØĻØ­ØŦ ØđŲ† ØđŲ†Ø§ØĩØą ŲŲŠ + ØŠØ­ØąŲŠØą + %i ØđŲ†Ø§ØĩØą + Ų‚اØĶŲ…ØĐ ØŠØīØšŲŠŲ„ Ø°ŲƒŲŠØĐ ØŽØŊŲŠØŊØĐ... + Ų…Ø­ØąŲƒ اŲ„ØĢŲ‚ØąØ§Øĩ %c + ØŠØ­ØąŲŠØą Ų‚ŲˆØ§ØđØŊ ŲˆØķØđ اŲ„Ø­ŲŲ„ØĐ + Ų…ØŽŲ„ØŊ اŲ„ØąØĶŲŠØģŲŠØĐ + ØđØŊ اŲ„Ų…ØīاŲ‡ØŊ + ØđŲ†ŲˆØ§Ų† اŲ„Ø­ØŊØŦ + ØŊŲ‚ØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ + Ų‚Ų†ŲˆØ§ØŠ ØĩŲˆØŠ + ØŠØąŲ…ŲŠØē اŲ„ŲŲŠØŊŲŠŲˆ + ØŠØąŲ…ŲŠØē اŲ„ØĩŲˆØŠ + Ų„ØšØĐ Ø§Ų„ØĩŲˆØŠ + ØŠØąØŽŲ…ØĐ Ų„ØšØĐ + ØŽŲ‡Ø§Øē اŲ„؊حŲƒŲ… ØđŲ† ØĻØđØŊ ŲŠØąØģŲ„ ØķØšŲˆØ· Ų„ŲˆØ­ØĐ Ø§Ų„Ų…ŲØ§ØŠŲŠØ­ + اŲ„ØđŲ†Ø§ŲˆŲŠŲ† + + اØģŲ… اŲ„Ų…Ų„Ų + Ų…ØģØ§Øą اŲ„Ų…Ų„Ų + Ø­ØŽŲ… اŲ„Ų…Ų„Ų + ØŠŲˆŲ‚ŲŠØŠ/ØŠØ§ØąŲŠØŪ اŲ„Ų…Ų„Ų + Ų…ØĪØīØą اŲ„ØīØąŲŠØ­ØĐ + Ų…ØģØŠŲˆŲ‰ اŲ„ØŊŲ‚ØĐ + اŲ„ØŠØđŲ„ŲŠŲ‚ + اŲ„Ų„ŲˆŲ†/ØĢØĻŲŠØķ ŲˆØĢØģŲˆØŊ + ØđŲ…Ų„ŲŠØĐ JPEG + + اŲ„ØŠØ§ØąŲŠØŪ/اŲ„ŲˆŲ‚ØŠ + اŲ„ŲˆØĩŲ + ØđŲ…Ų„ اŲ„ŲƒØ§Ų…ŲŠØąØ§ + Ø·ØąØ§Øē اŲ„ŲƒØ§Ų…ŲŠØąØ§ + ØŠØđŲ„ŲŠŲ‚ EXIF + ØŽŲ‡Ø§Øē + ŲØŠØ­ØĐ + اŲ„ØĻØđØŊ اŲ„ØĻØĪØąŲŠ + اŲ„Ų…ØģاŲØĐ Ø§Ų„ØĻØĪØąŲŠØĐ + اŲ„ØđØąØķ + ŲˆŲ‚ØŠ اŲ„ØđØąØķ + Ų…Ų†Ø­Ų‰ اŲ„ØđØąØķ + ŲˆØķØđ اŲ„ØđØąØķ + اŲ„ŲŲ„اØī اŲ„Ų…ØģØŠØŪØŊŲ… + ØŠŲˆØ§ØēŲ† اŲ„ØĢØĻŲŠØķ + Ų…ØĩØŊØą اŲ„ØķŲˆØĄ + ŲˆØķØđ اŲ„Ų‚ŲŠØ§Øģ + ISO + اŲ„ØŠŲƒØĻŲŠØą/اŲ„ØŠØĩØšŲŠØą اŲ„ØąŲ‚Ų…ŲŠ + ØđØąØķ CCD + ØŪØ· ØđØąØķ GPS + ØŪØ· Ø·ŲˆŲ„ GPS + ØŪØ· ØđØąØķ GPS + اŲ„ØŠŲˆØŽŲŠŲ‡ + + اŲ„ŲØĶا؊ اŲ„ØŠŲƒŲ…ŲŠŲ„ŲŠØĐ + اŲ„ŲƒŲ„Ų…ا؊ اŲ„ØąØĶŲŠØģŲŠØĐ + ØŠØđŲ„ŲŠŲ‚ + اŲ„Ų…ØĪŲ„Ų + اŲ„ØđŲ†ŲˆØ§Ų† اŲ„ØąØĶŲŠØģŲŠ + ØŠØđŲ„ŲŠŲ…ا؊ ØŪاØĩØĐ + اŲ„ŲØĶØĐ + ŲØąØđŲŠ + اŲ„ØđŲ†ŲˆØ§Ų† اŲ„ŲØąØđŲŠ + ØąØĩŲŠØŊ + Ų…ØĩØŊØą + Ų…Ų„احØļØĐ Ø­Ų‚ŲˆŲ‚ اŲ„ØŠØĢŲ„ŲŠŲ ŲˆØ§Ų„Ų†ØīØą + اØģŲ… اŲ„Ų…ŲˆØķŲˆØđ + اŲ„Ų…ØŊŲŠŲ†ØĐ + اŲ„ØŊŲˆŲ„ØĐ + اŲ„ØĻŲ„ØŊ + اŲ„Ų…ØąØŽØđ Tx اŲ„ØĢØĩŲ„ŲŠ + ØŠØ§ØąŲŠØŪ اŲ„ØĨŲ†ØīØ§ØĄ + ØđŲ„Ų… Ø­Ų‚ŲˆŲ‚ اŲ„ØŠØĢŲ„ŲŠŲ ŲˆØ§Ų„Ų†ØīØą + ŲƒŲˆØŊ اŲ„ØŊŲˆŲ„ØĐ + ØŪØŊŲ…ØĐ Ø§Ų„Ų…ØąØŽØđ + ØŠŲ…ŲƒŲŠŲ† ØĨØŪØąØ§ØŽ UPnP + Ų…حاŲˆŲ„ØĐ Ų„ØŠØŪØ·ŲŠ اŲ„Ų…Ų‚ØŊŲ…ØĐ Ų‚ØĻŲ„ Ų‚اØĶŲ…ØĐ DVD + اØģØ·ŲˆØ§Ų†Ø§ØŠ اŲ„ØĩŲˆØŠ اŲ„Ų…Ų‚ØģŲ…ØĐ + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„اØģØŠØđŲ„اŲ… ØđŲ† ŲƒŲ„ اŲ„ŲŲ†Ø§Ų†ŲŠŲ† + ؊حŲ…ŲŠŲ„ ØĻŲŠØ§Ų†Ø§ØŠ اŲ„ØĢŲ„ØĻŲˆŲ… + ؊حŲ…ŲŠŲ„ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ŲŲ†Ø§Ų† + اŲ„ØģŲŠØąØĐ Ø§Ų„ذا؊ŲŠØĐ + اŲ„ØĨØĩØŊØ§ØąØ§ØŠ + اŲ„ØĻØ­ØŦ ØđŲ† اŲ„ŲŲ†Ø§Ų† + اØŪØŠŲŠØ§Øą اŲ„ŲŲ†Ø§Ų† + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ŲŲ†Ø§Ų† + اŲ„ØĢØŊŲˆØ§ØŠ + ŲˆŲ„ØŊ + ØŠØīŲƒŲ‘Ų„ + Ų…ŲˆØķŲˆØđا؊ + Ø­Ų„Ų‘ + ØŠŲˆŲŲ‰ + ØģŲ†ŲˆØ§ØŠ Ų†ØīØ·ØĐ + ØđŲ„اŲ…ØĐ + ŲˆŲ„ØŊ/ØŠØīŲƒŲ„ + + + + ؊حØŊŲŠØŦ اŲ„Ų…ŲƒØŠŲŠØĐ ØđŲ†ØŊ ØĻØŊØĄ اŲ„ØŠØīØšŲŠŲ„ + ؊حØŊŲŠØŦ اŲ„Ų…ŲƒØŠØĻØĐ ŲŲŠ اŲ„ØŪŲ„ŲŲŠØĐ ØŊاØĶŲ…ا + - DNS Ų„احŲ‚ØĐ + ØŠŲ…ŲƒŲŠŲ† ØŠØ­ØąŲŠØą ŲˆŲ‚ŲˆØ§ØĶŲ… اŲ„Ø­ŲƒŲ… + ØŠØĢØŪØą ØĻŲ†Ø­Ųˆ: %2.3fs + ØŠŲ‚ØŊŲ… ØĻŲ†Ø­Ųˆ: %2.3fs + Ų…ŲˆØ§ØēŲ†ØĐ Ø§Ų„ØŠØąØŽŲ…ØĐ + اŲØŠØ­ ØŽŲ‡ØĐ ØĻŲŠØđ GL: + اŲØŠØ­ ØŽŲ‡ØĐ ØđØąØķ GL: + اŲØŠØ­ Ų†ØģØŪØĐ GL: + ØŊØąØŽØĐ Ø­ØąØ§ØąØĐ GPU: + ØŊØąØŽØĐ Ø­ØąØ§ØąØĐ CPU: + Ų…ØŽŲ…ŲˆØđ اŲ„ذاŲƒØąØĐ + اŲ„ØĻŲŠØ§Ų†Ø§ØŠ اŲ„ØīØŪØĩŲŠØĐ + اØģØŠØŪØŊاŲ… اŲ„ØŠØđØŠŲŠŲ… ØĨذا ØŠŲˆŲ‚ŲØŠ ØĢØŦŲ†Ø§ØĄ ØŠØīØšŲŠŲ„ اŲ„ŲŲŠØŊŲŠŲˆ + ØŽŲ…ŲŠØđ اŲ„ØŠØģØŽŲŠŲ„ا؊ + Ø­ØģØĻ اŲ„ØđŲ†ŲˆØ§Ų† + Ø­ØģØĻ اŲ„Ų…ØŽŲ…ŲˆØđØĐ + Ų‚Ų†ŲˆØ§ØŠ Ø­ŲŠØĐ + ØŠØģØŽŲŠŲ„ا؊ Ø­ØģØĻ اŲ„ØđŲ†ŲˆØ§Ų† + ØŊŲ„ŲŠŲ„ + ŲŠØģŲ…Ø­ ØĻØŪØ·ØĢ ŲŲŠ Ų†ØģØĻØĐ Ø§Ų„؎اŲ†ØĻ (%) + ØĨØŊØąØ§ØŽ Ų…Ų„ŲØ§ØŠ اŲ„ŲŲŠØŊŲŠŲˆ ŲŲŠ اŲ„Ų‚ŲˆØ§ØĶŲ… + + + اŲ„ØŪØ· + ØŠØąØŽŲ…ØĐ Ø­ØŽŲ… اŲ„ØŪØ· + ØŠØąØŽŲ…ØĐ Ų„ŲˆŲ† اŲ„ØŪØ· + ØŠØąØŽŲ…ØĐ Ø§Ų„ØŪØ· charset + ØĨØŪØąØ§ØŽ اŲ„ØđŲ†Ø§ŲˆŲŠŲ† ŲƒØ§ØąŲŠŲˆŲƒŲŠ ØĻØĩŲŠØšØĐ HTML + ØĨØŪØąØ§ØŽ اŲ„ØđŲ†Ø§ŲˆŲŠŲ† ŲƒØ§ØąŲŠŲˆŲƒŲŠ ØĻØĩŲŠØšØĐ CSV + اØģØŠŲŠØąØ§ØŊ ØđŲ†Ø§ŲˆŲŠŲ† ŲƒØ§ØąŲŠŲˆŲƒŲŠ... + Ų…Ø­ØŊØŊ ØĢØšŲ†ŲŠØĐ popup اŲ„ØŠŲ„Ų‚اØĶŲŠØĐ + ØŠØĩØŊŲŠØą ØđŲ†Ø§ŲˆŲŠŲ† ŲƒØ§ØąŲŠŲˆŲƒŲŠ... + ØĢØŊØŪŲ„ ØąŲ‚Ų… اŲ„ØĢØšŲ†ŲŠØĐ + ØĢØĻŲŠØķ/ØĢØŪØķØą + ØĢØĻŲŠØķ/ØĢØ­Ų…Øą + ØĢØĻŲŠØķ/ØĢØēØąŲ‚ + ØĢØģŲˆØŊ/ØĢØĻŲŠØķ + + ØŠŲˆØĩŲŠŲ„ØĐ Ø§Ų„Ø·Ų‚Øģ + - ØĨØđØŊاØŊا؊ اŲ„ØŠŲˆØĩŲŠŲ„ØĐ + + ØŠŲØđŲŠŲ„ ØĻØąØ§Ų…ØŽ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ† + + + اŲ„Ų…ØīØšŲ„ اŲ„ØŪØ§ØąØŽŲŠ Ų†ØīØ· + اŲ†Ų‚Øą ŲŲˆŲ‚ Ų…ŲˆØ§ŲŲ‚ Ų„ØĨŲ†Ų‡Ø§ØĄ اŲ„Ų…ØīØšŲ„ + + + اŲ†Ų‚Øą ŲŲˆŲ‚ Ų…ŲˆØ§ŲŲ‚ ØđŲ†ØŊ اŲ†ØŠŲ‡Ø§ØĄ اŲ„ØŠØīØšŲŠŲ„ + + + + + ŲˆØķØđ اŲ„Ų…ŲƒØŠØĻØĐ + Ų…ŲØ§ØŠŲŠØ­ Ų„ŲˆØ­ØĐ Ø§Ų„Ų…ŲØ§ØŠŲŠØ­ + ØđØĻŲˆØą اŲ„ØĩŲˆØŠ اŲ„Ų…ØģØŠØŪØŊŲ… + + ؊طØĻŲŠŲ‚ ØŠØĩŲŲŠØĐ ŲˆØķØđ اŲ„ŲˆŲ…ŲŠØķ ØđŲ„Ų‰ اŲ„ØĢŲ„ØđاØĻ + + + + + + + ØŽŲˆØŊØĐ Ø§Ų„Ų…ØģØŠØŪØąØŽ + ØŠŲŠØ§Øą + ØŠŲ†ØēŲŠŲ„ + Ø­Ų…Ų„ ŲˆØ§Ų„ØđØĻ + Ø­Ų…Ų„ ŲˆØ­ŲØļ + اŲ„ŲŠŲˆŲ… + ØšØŊا + Ø­ŲØļ + Ų†ØģØŪ + ØķØĻØ· ØŊŲ„ŲŠŲ„ اŲ„ØŠŲ†ØēŲŠŲ„ + اŲ„ØĻØ­ØŦ ØđŲ† اŲ„Ų…ØŊØĐ + Ų‚ØĩŲŠØą + Ø·ŲˆŲŠŲ„ + اØģØŠØŪØŊاŲ… Ų…ØīØšŲ„ DVD ØĻØŊŲ„ا Ų…Ų† اŲ„Ų…ØīØšŲ„ اŲ„ØđاØŊŲŠ + اطŲ„ØĻ اŲ„؊حŲ…ŲŠŲ„ Ų‚ØĻŲ„ ØŠØīØšŲŠŲ„ اŲ„ŲŲŠØŊŲŠŲˆ + Ų„Ų‚طا؊ + ØŠŲˆØĩŲŠŲ„ØĐ ØĨØđاØŊØĐ Ø§Ų„ØŠØīØšŲŠŲ„ Ų„Ų„ØŠŲ…ŲƒŲŠŲ† + Ų‡Ø°Ų‡ اŲ„Ų„ŲŠŲ„ØĐ + Ų„ŲŠŲ„ØĐ ØšØŊا + اŲ„ØīØąØ· + اŲ„ØŠØąØģŲŠØĻ + ØŠØąØģŲŠØĻ + ØąØ·ØĻ + ØīØđŲˆØą + Ų„احØļ + اŲ„ØŪØąŲˆØŽ ØđŲ† اŲ„Ų…Øđ؊اØŊ + ØīØąŲˆŲ‚ اŲ„ØīŲ…Øģ + اŲ„ØšØąŲˆØĻ + اŲ„ØŠŲØ§ØĩŲŠŲ„ + ØĢŲˆØŠ Ų„ŲˆŲƒ + Coverflow + ØŠØąØŽŲ…ØĐ Ø§Ų„Ų†Øĩ + ŲØĶØĐ %s Ų‚اØĶŲ…ØĐ Ø§Ų„ØŪØąŲŠØ·ØĐ + 36 ØģاØđØĐ + ØŪØąØ§ØĶØ· + ŲƒŲ„ ØģاØđØĐ + Ų†Ų‡Ø§ŲŠØĐ Ø§Ų„ØĢØģØĻŲˆØđ + %s ŲŠŲˆŲ… + ØŠŲ†ØĻŲŠŲ‡ + ØŠŲ†ØĻŲŠŲ‡Ø§ØŠ + اØŪØŠØą + ŲØ­Øĩ + ØŠŲ‡ŲŠØĶØĐ + اŲ„Ų…ŲˆØ§ØģŲ… + اØģØŠØŪØŊŲ… + ØīاŲ‡ØŊ + اØģØŠŲ…Øđ ØĨŲ„Ų‰ + اŲ†ØļØą ØĨŲ„Ų‰ + ØŠŲ‡ŲŠØĶØĐ + اŲ„طاŲ‚ØĐ + اŲ„Ų‚اØĶŲ…ØĐ + ØīØšŲ„ + اŲ„ØŪŲŠØ§ØąØ§ØŠ + اŲ„Ų…Ø­ØąØą + Ø­ŲˆŲ„ + ØŠØĩŲ†ŲŠŲ اŲ„Ų†ØŽŲ… + اŲ„ØŪŲ„ŲŲŠØĐ + اŲ„ØŪŲ„ŲŲŠØ§ØŠ + ØŠØŪØĩŲŠØĩ اŲ„ØŪŲ„ŲŲŠØĐ + ØŠØŪØĩŲŠØĩ اŲ„ØŪŲ„ŲŲŠØ§ØŠ + ØđØąØķ ØŠŲ…Ų‡ŲŠØŊŲŠ + ØđØąØķ اŲ„ØŠØšŲŠŲŠØą + ŲŠØŠØ·Ų„ØĻ Ų‡Ø°Ø§ اŲ„ØĨØĩØŊØ§Øą Ų…Ų† %s + ØĨØĩØŊØ§Øą XBMC Ų„Ų€ %s ØĢŲˆ ØĢŲƒØĻØą Ų„Ų„ØŠØīØšŲŠŲ„. + اŲ„ØąØŽØ§ØĄ اŲ„؊حØŊŲŠØŦ XBMC. + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…ØđŲ„ŲˆŲ…ا؊! + اŲ„ØĩŲØ­ØĐ Ø§Ų„؊اŲ„ŲŠØĐ + + + ØĨØķاŲØĐ ØŽØŊŲŠØŊØĐ... + ØŠØđØ°Øą ØŠŲ‡ŲŠØĶØĐ ØīØĻŲƒØĐ Ø§Ų„ا؊ØĩاŲ„. + ØŠØĢŲƒØŊ Ų…Ų† ØĩØ­ØĐ ØĨØđØŊاØŊا؊Ųƒ ŲˆØ­Ø§ŲˆŲ„ Ų…ØąØĐ ØĢØŪØąŲ‰. + ØŠŲ… ØŠŲ‡ŲŠØĶØĐ ØīØĻŲƒØĐ Ø§Ų„ا؊ØĩاŲ„ ØĻŲ†ØŽØ§Ø­. + ŲˆŲ…Øđ Ø°Ų„ŲƒØŒ ŲØĨŲ† اŲ„ØĨŲ†ØŠØąŲ†ØŠ ØšŲŠØą Ų‚اØĻŲ„ Ų„Ų„ŲˆØĩŲˆŲ„ ØĨŲ„ŲŠŲ‡. + اŲ„Ų…ح؊ŲˆŲ‰ اŲ„Ų…Ø­Ų„ŲŠ + Ų„Ų… ŲŠØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ اŲ„Ų…Ų„ŲØ§ØŠ اŲ„Ų…ŲˆØŽŲˆØŊØĐ ŲŲŠ اŲ„Ų…ØĩØŊØą + Ų„Ų… ŲŠØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ ØĢØŽŲ‡ØēØĐ + ØŠŲ†ØģŲŠŲ‚ اŲ„ØīاØīØĐ ŲˆØ§Ų„Ų…ØģØ­ اŲ„ŲØ§ØĶŲ‚ + اØģØŠØđاØŊØĐ Ø§ŲØŠØąØ§Øķا؊ + اŲ„Ų…ØģØ­ + Ų†ØģØĻØĐ Ø§Ų„ŲˆØ§ØŽŲ‡ØĐ + Ų…ØŠŲ‚ØŊŲ… + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ ØĨØšŲ„اŲ‚ Boxee اŲ„ØĒŲ†ØŸ + اŲ„اØģŲ… + اŲ„ØŠØ§ØąŲŠØŪ + ŲˆØģاØĶŲ„ ØĨØđŲ„اŲ… اŲ„ØĨŲ†ØŠØąŲ†ØŠ + ØŽØ§ØąŲŠ اŲ„؊حŲ…ŲŠŲ„... + Ų…ØĩاØŊØą Ų…ŲŲ‚ŲˆØŊØĐ + Ų„Ų… ŲŠØŠŲ… ؊حØŊŲŠØŊ Ų…ØĩاØŊØą Ų„ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… اŲ„ØŪاØĩØĐ ØĻŲƒ. + Ų‡Ų„ ØŠØąŲŠØŊ ؊حØŊŲŠØŊŲ‡Ų… اŲ„ØĒŲ†ØŸ + ØąŲØķ + ŲˆŲ‚Ų + ØŠØīØšŲŠŲ„ + اØģØŠØđØąØ§Øķ + + Ų…Ø­ØąŲƒ ØĢŲ‚ØąØ§Øĩ DVD + + ØĢØĩØŊŲ‚Ø§ØĄ (اŲ„؊حŲ…ŲŠŲ„) + ØĢØĩØŊŲ‚Ø§ØĄ (%d) + ŲØīŲ„ ŲŲŠ Ų‚ØąØ§ØĄØĐ ØŠØšØ°ŲŠØĐ ØĒØą ØĨØģ ØĨØģ + ŲŠØąØŽŲ‰ اŲ„؊حŲ‚Ų‚ Ų…Ų† ا؊ØĩاŲ„ا؊ اŲ„ŲƒØĻŲ„ ŲˆØŠØĢŲƒØŊ Ų…Ų† ØĢŲ† اŲ„Ų…ØŠŲ„Ų‚ŲŠ/اŲ„ØŠŲ„ŲØēŲŠŲˆŲ† ŲŲŠ ŲˆØķØđ ØĩاŲ…ØŠ. + ØĨذا اØģØŠŲ…Øą ØđØŊŲ… ØŠŲ…ŲƒŲ†Ųƒ Ų…Ų† ØģŲ…اØđ ØĢŲŠ ØĩŲˆØŠ ŲŠØąØŽŲ‰ Ų…ØąØ§ØŽØđØĐ ØĩŲØ­ØĐ Ø­Ų„ اŲ„Ų…ØīŲƒŲ„ا؊ Ų…Ų† ØŪŲ„اŲ„ boxee.tv/troubleshooting. + ŲŠØŽØĻ ØĢŲ† ŲŠØ­ØŠŲˆŲŠ Ų…ŲØŠØ§Ø­ اŲ„ØīØĻŲƒØĐ ŲŲ‚Ø· ØđŲ„Ų‰ + ØĢØ­ØąŲ Ų†ØļاŲ… اŲ„ØđØŊ اŲ„ØģØŊاØģŲŠ ØđØīØą + Ų…ØĩاØŊØą اŲ„ŲˆØģاØĶØ· + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ حذŲ: + Ų…ØĩØŊØą اŲ„ŲŲŠØŊŲŠŲˆ + Ų…ØĩØŊØą اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + Ų…ØĩØŊØą اŲ„ØĩŲˆØą + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ حذŲ Ų‡Ø°Ø§ اŲ„Ų…ØĩØŊØąØŸ + ØĻØŊØĄ اŲ„؊حŲ…ŲŠŲ„... + ØŠŲ†ØēŲŠŲ„ + ØĢØķŲ اŲ„؊حŲ…ŲŠŲ„ ØđŲ„Ų‰ Ų‚اØĶŲ…ØĐ Ø§Ų„اŲ†ØŠØļØ§ØąØŸ + ØŪØąŲˆØŽ اŲ„؊حŲ…ŲŠŲ„ + اŲ„؊حŲ…ŲŠŲ„ ŲŲŠ Ų‚اØĶŲ…ØĐ Ø§Ų„اŲ†ØŠØļØ§Øą ØĻاŲ„ŲØđŲ„ + اØģØŠØĻØŊŲ„ اŲ„؊حŲ…ŲŠŲ„ اŲ„حاŲ„ŲŠØŸ + ؊حØŊŲŠØŊ اŲ„ŲƒŲ„ + اŲ„Ų…ØīØ§ØąŲƒØĐ... + اŲ„ØŠŲ‚ŲŠŲ…... + ŲŠŲˆØŽØŊ Ų…ØĩØŊØą ØĻŲ†ŲØģ اŲ„اØģŲ… Ų…ØģØĻŲ‚ا + ŲŠØŽØĻ ØĢŲ„ا ŲŠŲƒŲˆŲ† اØģŲ… اŲ„Ų…ØĩØŊØą ŲØ§ØąØšØ§ + Boxee Øģ؊؊ŲˆŲ„Ų‰ Ų…ØģØ­ [B]%s[/B] + ØŠŲ… ؊حØŊŲŠØŦ Ų…ØĩØŊØą ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… ØĻŲ†ØŽØ§Ø­ + ØŠŲ… حذŲ Ų…ØĩØŊØą ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… ØĻŲ†ØŽØ§Ø­ + ŲŠØŽØĻ ؊حØŊŲŠØŊ Ų†ŲˆØđ ŲˆØģاØĶØ· ØĨØđŲ„اŲ… ØđŲ„Ų‰ اŲ„ØĢŲ‚Ų„ + ŲŠØŽØĻ ØĢŲ„ا ŲŠŲƒŲˆŲ† Ų…ØģØ§Øą اŲ„Ų…ØĩØŊØą ŲØ§ØąØšØ§ + ŲŠØŽØĻ ؊حØŊŲŠØŊ Ų†ŲˆØđ اŲ„Ų…ØģØ­ [CR] ØđŲ„Ų‰ اŲ„ØĢŲ‚Ų„ + ØģŲŠØŠŲ… ØĨØđاØŊØĐ Ų…ØģØ­ Ų…ØĩØŊØą ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… + ØĢØŊØŪŲ„ ŲŠØŊŲˆŲŠØ§ ØĻØąŲˆØŠŲˆŲƒŲˆŲ„ اŲ„ØĨŲ†ØŠØąŲ†ØŠ/اŲ„اØģŲ…... + ŲŠØŠŲ… Ų…ØģØ­ اŲ„ØĢŲ„ØĻŲˆŲ…... + Boxee ŲŠŲ…ØģØ­ حاŲ„ŲŠØ§ %s + ØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…ŲˆØ§ØŊ %d ŲŲŠ %s. + [CR]Boxee ØģŲˆŲ ؊حاŲˆŲ„ اŲ„ØŠØđØąŲ ØđŲ„ŲŠŲ‡Ų…. + + ØŊØŪŲˆŲ„ + Boxee Ų„ا ŲŠŲ…ŲƒŲ† اŲ„ا؊ØĩاŲ„ ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ + ŲŠŲ…ŲƒŲ†Ųƒ اŲ„اØģØŠŲ…ØąØ§Øą ŲŲŠ اØģØŠØŪØŊاŲ… Boxee Ų„ŲƒŲ† ØĻØđØķ ØŪØĩاØĶØĩŲ‡ + Ų„Ų† ØŠŲƒŲˆŲ† Ų…؊احØĐ. + ا؊ØĩاŲ„ ØĨŲ†ØŠØąŲ†ØŠ ØšŲŠØą Ų…ØŠŲˆŲØą. + Ų„ا ŲŠŲ…ŲƒŲ† Ų„ØŠØģØŽŲŠŲ„ اŲ„ØŊØŪŲˆŲ„ ØĨØķاŲØĐ Ų…ØģØŠØŪØŊŲ… ØŽØŊŲŠØŊ... + ŲŠØąØŽŲ‰ اŲ„؊حŲ‚Ų‚ Ų…Ų† اŲ„ا؊ØĩاŲ„ اŲ„ØĨŲ†ØŠØąŲ†ØŠ. + -------------------------------------- + Ø­Ų‚Ų„ اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… ŲØ§ØąØš. + Ø­Ų‚Ų„ ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą ŲØ§ØąØš. + ØđŲˆØŊØĐ + ØŠØđØ°Øą ØŠØģØŽŲŠŲ„ اŲ„ØŊØŪŲˆŲ„. + ØŠØīØšŲŠŲ„ + Ų…ؚاŲ…ØąØĐ + اŲ„ØąØģŲˆŲ… اŲ„Ų…ØŠØ­ØąŲƒØĐ + اŲ„ØģŲŠØąØĐ Ø§Ų„ذا؊ŲŠØĐ + ŲƒŲˆŲ…ŲŠØŊŲŠØ§ + اŲ„ØŽØąŲŠŲ…ØĐ + ŲˆØŦاØĶŲ‚ŲŠ + ØŊØąØ§Ų…ا + اŲ„ØĢØģØąØĐ + ØŪŲŠØ§Ų„ + ŲŲŠŲ„Ų…-Noir + ØđØąØķ اŲ„Ų„ØđØĻØĐ + اŲ„Ų„ØđØĻ Ų…ØĪØŪØąØ§ + ØąØđØĻ + Ų…ŲˆØģŲŠŲ‚Ų‰ + Ų…ŲˆØģŲŠŲ‚ŲŠ + ØģØą + ØĢØŪØĻØ§Øą + ØŠŲ„ŲØēŲŠŲˆŲ†-ŲˆØ§Ų‚ØđŲŠ + ØąŲˆŲ…اŲ†ØģŲŠ + اŲ„ØŪŲŠØ§Ų„ اŲ„ØđŲ„Ų…ŲŠ + Ų‚ØĩŲŠØą + ØąŲŠØ§ØķŲŠ + Ø­ŲˆØ§ØąŲŠ + ØąŲˆØ§ØĶŲŠ Ų…ØŦŲŠØą + Ø­ØąŲˆØĻ + ØšØąØĻ + + 2 ØĩŲ + 3 ØĩŲ + Ų…ŲØĩŲ„ + ØŪØ· + + Ų…Ø­Ų„ŲŠ + + + + ØĨØđØŊاØŊا؊/Ų…ØĩاØŊØą ØĨØđŲ„اŲ…ŲŠØĐ/ØĨØķاŲØĐ Ų…ØĩØŊØą ØŽØŊŲŠØŊ + ØĨØđØŊاØŊا؊/Ų…ØĩاØŊØą ØĨØđŲ„اŲ…ŲŠØĐ/ØīØĻŲƒØĐ/ØĨØķاŲØĐ Ų…ØĩØŊØą ØŽØŊŲŠØŊ + اŲ„ØīØĻŲƒØĐ + ØĨØđØŊاØŊا؊/Ų…ØĩاØŊØą ØĨØđŲ„اŲ…ŲŠØĐ/؊طØĻŲŠŲ‚ا؊ اŲ„ØīØĻŲƒØĐ/ØĨØķاŲØĐ Ų…ØĩØŊØą ØŽØŊŲŠØŊ + ØĨØđØŊاØŊا؊/Ų…ØĩاØŊØą ØĨØđŲ„اŲ…ŲŠØĐ/ØĨØķاŲØĐ Ų…ØĩاØŊØą ŲŠØŊŲˆŲŠØ§/ØĨØķاŲØĐ Ų…ØĩØŊØą ØŽØŊŲŠØŊ + Ų‚اØĻŲ„ Ų„Ų„Ų†Ų‚Ų„ + اŲ„Ų…ØŽŲ„ØŊ اŲ„ØąØĶŲŠØģŲŠ + ŲŲŠØŊŲŠŲˆ Ų…ØŽŲ‡ŲˆŲ„ + Ų…ØŽŲ„ØŊا؊ Ų…Ø­Ų„ŲŠØĐ ŲˆŲ…ØīØ§ØąŲƒØ§ØŠ ØīØĻŲƒØ§ØŠ + ØšŲŠØą Ų…ØģŲ…Ų‰ + + + اŲ„ØŠŲˆØĩŲŠØ§ØŠ + Ų†Øīاط اŲ„ØĢØĩØŊŲ‚Ø§ØĄ + ØŠŲ…ØŠ اŲ„ØĨØķاŲØĐ Ų…ØĪØŪØąØ§ + Ų…ØģØŠØŪØŊŲ… Ų…ØĪØŪØąØ§ + ØĢØĩØŊŲ‚Ø§ØĄ + Ų†Øīاط + Ų…ØĩاØŊØąŲŠ + ØĢŲ„ØĻŲˆŲ…ا؊ + ŲŲ†Ø§Ų†ŲˆŲ† + اŲ„؊طØĻŲŠŲ‚ا؊/اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + ØĢØīØąØ·ØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ + اŲ„؊طØĻŲŠŲ‚ا؊/اŲ„ŲŲŠØŊŲŠŲˆ + ØĩŲˆØąŲŠ + اŲ„؊طØĻŲŠŲ‚ا؊/اŲ„ØĩŲˆØą + Ų„Ų… ؊حŲ„ ØĻØđØŊ + اŲ„؊طØĻŲŠŲ‚ا؊ + ØīاŲ‡ØŊ Ų„احŲ‚ا + Boxee + ØĻØŊØĄ اŲ„ØŠØīØšŲŠŲ„ + ØĻØŊØĄ Boxee ØđŲ†ØŊ ØŠØģØŽŲŠŲ„ اŲ„ØŊØŪŲˆŲ„ + ØŠØīØšŲŠŲ„ ØđŲ…ŲŠŲ„ RTorrent ØđŲ†ØŊŲ…ا ŲŠØĻØŊØĢ Boxee + ØŠØđØ·ŲŠŲ„ ØđŲ† ØĻØđØŊ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ ØŠØđØ·ŲŠŲ„ ØŽŲ‡Ø§Øē اŲ„؊حŲƒŲ… ØđŲ† ØĻØđØŊ اŲ„ØĢØĻŲ„ØŸ[CR]ØĨذا اØŪØŠØąØŠ Ų…ŲˆØ§ŲŲ‚ØŒ ŲØģŲˆŲ ŲŠØŠŲˆŲ‚Ų ØŽŲ‡Ø§Øē اŲ„؊حŲƒŲ… ØđŲ† اŲ„ØđŲ…Ų„. + اØķؚط ØđŲ„Ų‰ %s Ų„Ų„ØđŲˆØŊØĐ ØĨŲ„Ų‰ Ų…Ų„ØĄ اŲ„ØīاØīØĐ + ØĢØŊØŪŲ„ اØģŲ… اŲ„ŲŲŠŲ„Ų….... + ØŽØ§ØąŲŠ اŲ„Ø­Ų„... + ØĢØŊØŪŲ„ ØđŲ†ŲˆØ§Ų† اŲ„ØĢŲ„ØĻŲˆŲ… ŲˆØ§ØģŲ… اŲ„ŲŲ†Ø§Ų† Ų…ŲØĩŲˆŲ„ا ØĻŲØ§ØĩŲ„ØĐ... + ØĢØŊØŪŲ„ ØđŲ†ŲˆØ§Ų† اŲ„Ų…ØģŲ„ØģŲ„ ŲˆØ§Ų„Ų…ŲˆØģŲ… ŲˆØąŲ‚Ų… اŲ„Ø­Ų„Ų‚ØĐ Ų…ŲØĩŲˆŲ„ا ØĻŲŲˆØ§ØĩŲ„... + Ų…ØīØ§ØąŲƒØĐ ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… + Ų‡Ø°Ø§ اŲ„Ų…ØŽŲ„ØŊ Ų„ŲŠØģ ؊ح؊ Ų…ØīØ§ØąŲƒØĐ ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… + ØĢØķاŲ ØĢŲ„ØĻŲˆŲ… + ØĢØķاŲ اŲ„ŲŲŠØŊŲŠŲˆ + ØđŲ†ŲˆØ§Ų† اŲ„ŲŲŠŲ„Ų… + ØđŲ†ŲˆØ§Ų† اŲ„ØĻØąŲ†Ø§Ų…ØŽ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ ŲˆØ§Ų„Ų…ŲˆØģŲ… ŲˆØ§Ų„Ø­Ų„Ų‚ØĐ + اŲ„ØĢŲ„ØĻŲˆŲ…ØŒ اŲ„ŲŲ†Ø§Ų† + ØŪØ·ØĢ + ŲŠØŠØđØ°Øą ØĨØķاŲØĐ ŲŲŠŲ„Ų…. + ŲŠØŠØđØ°Øą اŲ„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ ØŠŲØ§ØĩŲŠŲ„ اŲ„ŲŲŠŲ„Ų…. + ØŠŲ…ŲƒŲŠŲ† اŲ„ØŊØđŲ… ØđŲ† ØĻØđØŊ Ų„ØŽŲ†Ø§Ø­ اŲ„Ų…Ų„Ų‚Ų… اŲ„ØĻØđŲŠØŊ Ų„ØĻØąŲˆØŠŲˆŲƒŲˆŲ„ اŲ„ØĨŲ†ØŠØąŲ†ØŠ + ØđØąØķ اŲ„ØŪŲŠØ§ØąØ§ØŠ اŲ„Ų…Ų†ØĻØŦŲ‚ØĐ ŲŲŠ Ų†Ų‡Ø§ŲŠØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + ØđØąØķ + ØĢØĩŲˆØ§ØŠ + ØĨŲ‚Ų„ŲŠŲ…ŲŠ ŲˆŲ„ØšØĐ + ØŠØīØšŲŠŲ„ + اŲ„ØŠØŪŲŠŲ„ اŲ„Ų…ŲˆØģŲŠŲ‚ŲŠ + ØŠØąØīŲŠØ­ اŲ„Ų…ح؊ŲˆŲ‰ + اŲ„اŲ†ØŠØļØ§Øą ØĨŲ„Ų‰ ØĢŲ† ŲŠØŠŲ… اŲ„Ų…ØģØ­ + اŲ„Ų…ØģØ­ + اŲ„Ų…ØģØ­ اŲ„ØĢØŪŲŠØą %s + [COLOR red]Ų‚Ø·Øđ[/COLOR] + ؊حØŊŲŠØŊ + ØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…Ų„Ų %d + ØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…Ų„Ų %d. %d ŲŲ‚ØŊ اŲ„؊طاØĻŲ‚ + ØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…Ų„ŲØ§ØŠ %d + ØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…Ų„ŲØ§ØŠ %d. %d ŲŲ‚ØŊ اŲ„؊طاØĻŲ‚ + + ØĨØđاØŊØĐ Ø§Ų„Ų…ØģØ­ + ŲŠØŽØąŲŠ Ų…ØģØ­ اŲ„Ų…ØĩØŊØą حاŲ„ŲŠØ§: ØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ %d، ØŠŲ… ؊حØŊŲŠØŊ Ų…ŲˆØ§ØŊ %d، Ų…ŲˆØ§ØŊ %d اŲ„Ų…ØŠØĻŲ‚ŲŠØĐ... + ØŠŲ… Ų…ØģØ­ اŲ„Ų…ØĩØŊØą Ų…ØģØĻŲ‚ا %s. ØŠŲ… ؊حØŊŲŠØŊ Ų…ŲˆØ§ØŊ %d، Ų„Ų… ØŠŲƒŲ† Ų…ŲˆØ§ØŊ %d. Ų‡Ų„ ØŠØąØšØĻ ŲŲŠ ؊حØŊŲŠØŊ Ų…ØģØ­ ØĒØŪØąØŸ + Ų„Ų… ŲŠØŠŲ… Ų…ØģØ­ اŲ„Ų…ØĩØŊØą ØĻØđØŊ. Ų‡Ų„ ØŠØąŲŠØŊ اŲ„Ų…ØģØ­ اŲ„ØĒŲ†ØŸ + + Ų‡Ų„ ØŠØąØšØĻ ŲŲŠ ؊حØŊŲŠØŊ Ų…ØģØ­ ØĒØŪØą Ų„Ų…ØĩاØŊØą ŲŲŠØŊŲŠŲˆØŸ + + ØĨØŪØąØ§ØŽ + + Ų…ØĩاØŊØą اŲ„Ų…Ų„Ų + اŲ„ŲˆØģاØĶØ· + Ø­ŲˆŲ„ + Ų‚اŲ†ŲˆŲ†ŲŠ + + %d ØŊŲ‚ŲŠŲ‚ØĐ (ØŊŲ‚اØĶŲ‚) Ų…ØķØŠ + %d ØģاØđØĐ (ØģاØđا؊) Ų…ØķØŠ + %d ŲŠŲˆŲ… (ØĢŲŠØ§Ų…) Ų…ØķØŠ + + Ų…ØđŲ„ŲˆŲ…ا؊ ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… ŲˆØ§ØķØ­ØĐ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ Ų…ØđŲ„ŲˆŲ…ا؊ ŲˆØģاØĶØ· ŲˆØ§ØķØ­ØĐ Ų…Ų† اŲ„Ų…ŲƒØŠØĻØĐ؟[CR](Ų…Ų„ŲØ§ØŠ ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… ØģØŠØĻŲ‚Ų‰ ØđŲ„Ų‰ حاŲ„Ų‡Ø§) + Ų…ØģØ­ اŲ„ØĩŲˆØąØĐ Ø§Ų„Ų…ØĩØšØąØĐ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ Ų…ØģØ­ اŲ„ØĩŲˆØą اŲ„Ų…ØĩØšØąØĐ؟[CR](Ų…Ų„ŲØ§ØŠ ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… ØģØŠØĻŲ‚Ų‰ ØđŲ„Ų‰ حاŲ„Ų‡Ø§) + [CR][COLOR red]Ų…Ų„احØļØĐ: اŲ„ØŠŲ…Ų‡ŲŠØŊ \Ų…Ø·Ų„ŲˆØĻ[/COLOR] + + Ų…Ų„ŲØ§ØŠŲŠ اŲ„ØŪاØĩØĐ + ØŠØĩŲØ­ Ų…Ų† اŲ„ŲˆŲŠØĻ + Ų„ØģØŠ Ų…ØŠØĢŲƒØŊا + ŲŠŲ…ŲƒŲ†Ųƒ ØŠØšŲŠŲŠØą Ų‡Ø°Ų‡ اŲ„ØĨØđØŊاØŊا؊ ŲŲŠ ŲˆŲ‚ØŠ Ų„احŲ‚ ØđØĻØą ØĨØđØŊاØŊا؊ ->ØđاŲ…->Ų‚اØĶŲ…ØĐ + Ų…ا اŲ„Ø°ŲŠ ØŠØīاŲ‡ØŊŲ‡ ؚاŲ„ØĻاŲ‹ØŸ + ØģŲˆŲ ØŠØŽØđŲ„ Boxee ØĢŲ†Ų‡ Ų…Ų† اŲ„ØĢØģŲ‡Ų„ ØĻاŲ„Ų†ØģØĻØĐ Ų„Ųƒ اŲ„ŲˆØĩŲˆŲ„ ØĨŲ„Ų‰ Ų…ŲˆØ§ØŊ اŲ„ŲŲŠØŊŲŠŲˆ اŲ„ØŠŲŠ ØŠØīاŲ‡ØŊŲ‡Ø§ ØĢŲƒØŦØą Ų…Ų† ØšŲŠØąŲ‡Ø§. + ØĨØđاØŊØĐ Ų…ØģØ­ Ų…ØĩاØŊØą ØĨØđŲ„اŲ…ŲŠØĐ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ ØĨØđاØŊØĐ Ų…ØģØ­ Ų…ØĩاØŊØą اŲ„ŲˆØģاØĶط؟ + + اØģØŠØđاØŊØĐ Ø§Ų„ØĨØđØŊاØŊا؊ اŲ„اŲØŠØąØ§ØķŲŠØĐ... + اØģØŠØđاØŊØĐ Ø§Ų„ØĨØđØŊاØŊا؊ اŲ„اŲØŠØąØ§ØķŲŠØĐ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ اØģØŠØđاØŊØĐ Ø§Ų„ØĨØđØŊاØŊا؊ اŲ„اŲØŠØąØ§ØķŲŠØĐ؟ + [COLOR red][B][CR]Ų…Ų„احØļØĐ: Ų…Ø·Ų„ŲˆØĻ ØĨØđاØŊØĐ Ø§Ų„ØŠØīØšŲŠŲ„[/B][/COLOR]. + ØĨØđاØŊØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + ØĨØđاØŊØĐ ØĻØŊØĄ + اŲ„ŲˆØģاØĶØ· اŲ„Ų…ØīØŠØąŲƒØĐ Ų…Øđ اŲ„ØĢØĩØŊŲ‚Ø§ØĄ + + + [B]؊حŲ…ŲŠŲ„ ØŪØ·ØĢ[/B] + ŲŠØŠØđØ°Øą اŲ„ŲˆØĩŲˆŲ„ ØĨŲ„Ų‰ اŲ„Ų…Ų„Ų ØĢŲˆ اŲ„ØŊŲ„ŲŠŲ„ ØĢŲˆ اŲ„ØŽŲ‡Ø§Øē. + اŲ„Ų…ŲˆØ§ØąØŊ ØšŲŠØą Ų…ØŠŲˆŲØąØĐ + اŲ„Ų…ØģØŠØŪØŊŲ… Ų…ŲˆØŽŲˆØŊ ØĻاŲ„ŲØđŲ„ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ Ų…Ų† ØĢŲ† Ų‡Ø°Ø§ Ų„ŲŠØģ Ų‡Ųˆ اŲ„ŲŲŠŲ„Ų… ØĩØ­ŲŠØ­ØŸ + اŲ„Ų…ØģØ§Øą ØšŲŠØą Ų…ØŠŲˆŲØą + Ų„Ų… ŲŠØ­ØŊØŊ ØĢŲŠ ØĩØŊŲŠŲ‚ + ØŠØđØ°Øą اŲ„ا؊ØĩاŲ„ ØĻŲ€ last.fm + ŲŠØąØŽŲ‰ اŲ„ØŠØĢŲƒØŊ Ų…Ų† اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… ŲˆŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą + ØŠŲ… اŲ„ØķØĻØ· ØĻØīŲƒŲ„ ØĩØ­ŲŠØ­ + ØđØŊŲ… ØŠØšŲŠŲŠØą اŲ„Ų…ØģØŠŲˆŲ‰ ØđŲ†ØŊŲ…ا ŲŠŲƒŲˆŲ† ŲŲŠ ŲˆØķØđ اŲ„ØĩŲˆØŠ اŲ„ØąŲ‚Ų…ŲŠ + اŲ„ŲˆØģاØĶØ· اŲ„Ų…ØīØŠØąŲƒØĐ Ų…Øđ اŲ„ØĢØĩØŊŲ‚Ø§ØĄ + + + اŲ„ØŠØīØšŲŠŲ„ ØšŲŠØą Ų…ØđØŠŲ…ØŊ ŲŲŠ Ų‡Ø°Ø§ اŲ„ŲŲŠØŊŲŠŲˆ + ØĨŲŠŲ‚اŲ Ų‡Ø°Ø§ اŲ„ŲŲŠØŊŲŠŲˆ ØšŲŠØą Ų…ØŊØđŲ… + اŲ„ØĻØ­ØŦ ŲŲŠ Ų‡Ø°Ø§ اŲ„ŲŲŠØŊŲŠŲˆ ØšŲŠØą Ų…ØŊØđŲ… + ØŠØšŲŠŲŠØą اŲ„ØĩŲˆØŠ ŲŲŠ Ų‡Ø°Ø§ اŲ„ŲŲŠØŊŲŠŲˆ ØšŲŠØą Ų…ØŊØđŲ… + ØĨŲ…ا ØĢŲ† ŲŠŲƒŲˆŲ† اŲ„ØŠŲ†ØģŲŠŲ‚ ØšŲŠØą Ų…ØŊØđŲ… ØĢŲˆ اŲ„Ų…Ų„Ų Ų…ØđØ·ŲˆØĻ. + Ų…ØĩØŊØą ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… ØĢŲˆ Ų…Ų„Ų ØšŲŠØą Ų‚اØĻŲ„ Ų„Ų„ŲˆØĩŲˆŲ„. + ØŪØ·ØĢ ØŠØīØšŲŠŲ„ + Ų‡Ø°Ø§ اŲ„ŲŲŠØŊŲŠŲˆ ØšŲŠØą Ų…ØŠŲˆŲØą حاŲ„ŲŠØ§. + ØŽØ§ØąŲŠ اŲ„؊حŲ…ŲŠŲ„... + + ØĨØđØŊاØŊا؊ -> Ų…ØĩاØŊØą ØĨØđŲ„اŲ…ŲŠØĐ + ŲŠØąØŽŲ‰ ؊حØŊŲŠØŊ اŲ„Ų…ŲˆØ§Ų‚Øđ اŲ„ØŠŲŠ ŲŠØŠŲ… ØŠØŪØēŲŠŲ†Ų‡Ø§ ŲŲŠ Ų…Ų„ŲØ§ØŠ اŲ„ŲŲŠØŊŲŠŲˆ ŲˆØ§Ų„Ų…ŲˆØģŲŠŲ‚Ų‰ ŲˆØ§Ų„ØĩŲˆØą. [CR] Boxee ØģŲˆŲ ØŠŲ…ØģØ­ ØŠŲ„Ų‚اØĶŲŠØ§ اŲ„Ų…ØŽŲ„ØŊا؊ اŲ„Ų…Ø­ØŊØŊØĐ Ų„ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ…. + ŲŲŠØŊŲŠŲˆ Ų…Ø­Ų„ŲŠ + Ų…ŲˆØģŲŠŲ‚Ų‰ Ų…Ø­Ų„ŲŠØĐ + ØĩŲˆØą Ų…Ø­Ų„ŲŠØĐ + + + ØŠØąØŠŲŠØĻ + ØđØąØķ + اØģØŠØđØąØ§Øķ + ŲˆØģاØĶŲ„ ØĨØđŲ„اŲ… Ų…Ø­Ų„ŲŠØĐ + ØĨØķاŲØĐ Ų…ØĩØŊØą[CR] + اŲ„ØĻØ­ØŦ ØĢŲˆ ØđŲ†ŲˆØ§Ų† + + + ØĨØķاŲØĐ/ØĨØŊØ§ØąØĐ + + + ؊حŲ…ŲŠŲ„ ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ…. ØąØŽØ§ØĄ اŲ„اŲ†ØŠØļØ§Øą. + + + ØŽØ§ØąŲŠ اŲ„ا؊ØĩاŲ„... + + + اŲ„ØŽØŊŲŠØŊ + ØĢØīØąØ·ØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ + Ų…ŲˆØ§ØŊ اŲ„ŲŲŠØŊŲŠŲˆ اŲ„ØĨŲ†ØŠØąŲ†ØŠ + اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ ØŪاØĩØŠŲŠ + Ų…ŲˆØģŲŠŲ‚Ų‰ اŲ„ØĨŲ†ØŠØąŲ†ØŠ + ØĩŲˆØąŲŠ + ØĩŲˆØą اŲ„ØĨŲ†ØŠØąŲ†ØŠ + اŲ„Ų…Ų„Ų اŲ„ØīØŪØĩŲŠ + اŲ„ØŠŲ†ØēŲŠŲ„ا؊ + CD/DVD + ØĨŲ†Ų‡Ø§ØĄ + + + ØĨØđØŊاØŊا؊ / Ų…ØĩاØŊØą ØĨØđŲ„اŲ…ŲŠØĐ + اŲ„Ų‚اØĶŲ…ØĐ + ØĨØķاŲØĐ Ų…ØĩØŊØą ØŽØŊŲŠØŊ + + + اŲ„Ų…ØēŲŠØŊ + اŲ„ØĨØŊØąØ§Ųƒ + ŲŲŠØŊŲŠŲˆ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + ŲŲŠØŊŲŠŲˆ Ų…ŲˆØģŲŠŲ‚Ų‰ MTV + اŲ„ØŠØđØąŲ ØđŲ„Ų‰ (اŲ„Ų…ØģØ§Øą ŲˆŲ„ŲŠØģ اŲ„Ų…ØĩØŊØą) + + + Ų…ŲˆØĩŲ‰ ØĻŲ‡ + اŲ‚ØąØĢ اŲ„Ų…ØēŲŠØŊ + اŲ„Ų…ØđØŊŲ„ + ØŊŲ‚ŲŠŲ‚ØĐ + + + Ø­ØŊØŊ Ų…ØŽŲ„ØŊ Ų…ØđŲŠŲ† Ų„Ų„ØąØĩØŊ. + + + ØŠŲˆØ§ŲØą Ų…ØīØ§ØąŲƒØ§ØŠ اŲ„ØīØĻŲƒØĐ ØĢŲˆ اŲ„ØĢØŽŲ‡ØēØĐ Ø§Ų„Ų…Ø­Ų„ŲŠØĐ Ø§Ų„Ų…؊احØĐ. + Ų…ØĩاØŊØą ØĨØđاØŊØĐ Ø§Ų„Ų…ØģØ­ + + + اŲ„ØąØŽØ§ØĄ اØŪØŠŲŠØ§Øą Ų…ŲˆŲ‚Øđ اŲ„ØīØĻŲƒØĐ ØĢŲˆ ØŽŲ‡Ø§Øē ØŠØŪØēŲŠŲ† اŲ„Ų…ØąŲŲ‚ Ų…Ø­Ų„ŲŠØ§. + اØģŲ… اŲ„Ų…ØīØ§ØąŲƒØĐ + Ų…ŲˆŲ‚Øđ اŲ„Ų…ØīØ§ØąŲƒØĐ + Ų†ŲˆØđ اŲ„ŲˆØģŲŠØ· + ØĢØĻØŊاŲ‹ + ØĨØķاŲØĐ/؊حØŊŲŠØŦ + ŲŠØ­ØŠØ§ØŽ Boxee ØĨŲ„Ų‰ ØĨØđاØŊØĐ Ø§Ų„ØĻØŊØĄ Ų„؊طØĻŲŠŲ‚ Ų‡Ø°Ų‡ اŲ„ØŠØšŲŠŲŠØąØ§ØŠ. + Ų†ŲˆØđ اŲ„Ų…ØģØ­ + Ų…ØąØĐ + ŲŠŲˆŲ…ŲŠ + Ų…ØŠŲƒØąØą ØŽØŊا + ŲƒŲ„ ØģاØđØĐ + (Ų„Ų† ŲŠŲ…ØģØ­) + + + ØŠØīØšŲŠŲ„ + ØŠŲˆŲ‚Ų Ų…ØĪŲ‚ØŠ + x2 + x4 + x8 + x16 + x32 + FFW + RWD + Ų…ØđŲ„ŲˆŲ…ا؊ + + + ØĨØķاŲØĐ Ų…ØĩاØŊØą + ØĨØķاŲØĐ Ų…ØĩاØŊØą اŲ„ØīØĻŲƒØĐ + ؊طØĻŲŠŲ‚ا؊[CR]اŲ„ØīØĻŲƒØĐ + ŲŠØŊŲˆŲŠØ§[CR]ØĨØķاŲØĐ Ø§Ų„Ų…ØĩØŊØą + Ų…Ų„ŲØ§ØŠ Ų…ØŽŲ‡ŲˆŲ„ØĐ + + + ØšŲ†Ø§ØĄ + + + ØŠØđØŽØĻŲ†ŲŠ! + Ų„ا + Ų„ا ØŠØđØŽØĻŲ†ŲŠ + Ų„ا ØĻØĢØģ + Ų…Ų‚ØĻŲˆŲ„ØĐ + + + اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… + ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą + ؊ذŲƒØą ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą + اØģŲ… اŲ„Ų…ØķŲŠŲ/ØĻØąŲˆØŠŲˆŲƒŲˆŲ„ اŲ„ØĨŲ†ØŠØąŲ†ØŠ + اŲ„ØĻØąŲŠØŊ اŲ„ØĨŲ„ŲƒØŠØąŲˆŲ†ŲŠ + ØŠØĢŲƒŲŠØŊ ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą + اØŪØŠŲŠØ§Øą ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą[CR] + + + اŲ„ØŪØ·ŲˆØĐ 03 + اŲ„ØŠŲ‡ŲŠØĶØĐ Ø§Ų„ŲŠØŊŲˆŲŠØĐ + ŲŠØąØŽŲ‰ Ų…Ų„ØĄ ØđŲ†Ø§ŲˆŲŠŲ† ØĻØąŲˆØŠŲˆŲƒŲˆŲ„ اŲ„ØĨŲ†ØŠØąŲ†ØŠ ŲŲŠ اŲ„Ø­Ų‚ŲˆŲ„ ØĢØŊŲ†Ø§Ų‡ + ØđŲ†ŲˆØ§Ų† IP + ØđŲ†ŲˆØ§Ų† اŲ„ØąØ§ŲˆØŠØą + ØđŲ†ŲˆØ§Ų† DNS + ØđŲˆØŊØĐ + اŲ„ØŪØ·ŲˆØĐ Ø§Ų„؊اŲ„ŲŠØĐ + + + ØĨØđØŊاØŊا؊->Ų…ØĩاØŊØą ØĨØđŲ„اŲ…ŲŠØĐ->ØĨØķاŲØĐ Ų…ØĩØŊØą-> + اŲ„ØąØŽØ§ØĄ اØŪØŠŲŠØ§Øą Ų…ŲˆŲ‚Øđ ØđŲ„Ų‰ اŲ„ØīØĻŲƒØĐ ØĢŲˆ ØŽŲ‡Ø§Øē ØŠØŪØēŲŠŲ† Ų…ØąŲŲ‚ Ų…Ø­Ų„ŲŠØ§.[CR]ØĻŲ…ØŽØąØŊ اØŪØŠŲŠØ§Øą اŲ„ØŽŲ‡Ø§Øē اŲ„ØąØŽØ§ØĄ اØŪØŠŲŠØ§Øą Ų…ØŽŲ„ØŊ Ų…ØđŲŠŲ† ØŠØąØšØĻ ŲŲŠ اŲ„ŲˆØĩŲˆŲ„ ØĨŲ„ŲŠŲ‡ ŲˆØŠØģŲ…ŲŠØŠŲ‡. + Ų…Ø­Ų„ŲŠ + + + ØđŲ†ŲˆØ§Ų† ØĻØąŲˆØŠŲˆŲƒŲˆŲ„ اŲ„ØĨŲ†ØŠØąŲ†ØŠ/اØģŲ… اŲ„Ų…ØķŲŠŲ: + + + Ų…ØđاŲ„ØŽ اŲ„ØĩŲˆØŠ + اŲ„ØŪØ·ŲˆØĐ 02 + Ų…ØģØ­ + اØŪØŠØĻØ§Øą ا؊ØĩاŲ„ا؊ اŲ„ØĩŲˆØŠ.[CR]اŲ„ØąØŽØ§ØĄ اŲ„اŲ†ØŠØļØ§Øą ح؊Ų‰ ØŠØģŲ…Øđ اŲ„Ų†ŲˆØŠØ§ØŠ اŲ„Ų…ŲˆØģŲŠŲ‚ŲŠØĐ Ø§Ų„ØđØŊŲŠØŊØĐ Ų…Ų† Ų…ŲƒØĻØąØ§ØŠ اŲ„ØĩŲˆØŠ. + Ų„ا ŲŠŲˆØŽØŊ ØĩŲˆØŠØŸ اŲ†Ų‚Øą Ų‡Ų†Ø§. + + + Ų…ØđاŲ„ØŽ اŲ„ØīØĻŲƒØĐ + اŲ„ØąØŽØ§ØĄ اØŪØŠŲŠØ§Øą ØĨØđØŊاØŊا؊ ØīØĻŲƒØĐ Ø§Ų„ا؊ØĩاŲ„ Ų„ا؊ØĩاŲ„ا؊ اŲ„ØĨŲ†ØŠØąŲ†ØŠ ŲˆØ§Ų„ØīØĻŲƒØĐ. + Ų†ŲˆØđ اŲ„Ų…ØĩاØŊŲ‚ØĐ: + ØĨŲ†Ų‡Ø§ØĄ + + + ØŊŲ‚ØĐ Ø§Ų„Ų…ØđاŲ„ØŽ + اŲ„ØŪØ·ŲˆØĐ 01 + Ų…Øđ ØĻØđØķ ØđØąŲˆØķ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ† ŲŠŲ…ŲƒŲ†Ųƒ ØķØĻØ· ØŊŲ‚ØĐ Ø§Ų„ØīاØīØĐ Ų„ØŠØļŲ‡Øą اŲ„ØĩŲˆØą ØĢŲƒØĻØą ØĢŲˆ ØĢØĩØšØą. + اŲ„ŲˆØķŲˆØ­ اŲ„Ų‚ŲŠØ§ØģŲŠ (SD) + ØđاŲ„ŲŠ اŲ„ŲˆØķŲˆØ­ (HD) + Ų…ØđاŲŠØąØĐ + + + ØŠØĢŲƒŲŠØŊ + + + [B]Ų„Ų… ŲŠØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ ØĢŲŠ Ų†ØŠØ§ØĶØŽ.[/B][CR]ŲŠØąØŽŲ‰ Ų…Ų„احØļØĐ ØĢŲ† ØĻØđØķ اŲ„Ų…ح؊ŲˆŲŠØ§ØŠ Ų‚ØŊ Ų„ا ØŠŲƒŲˆŲ† Ų…ØŠŲˆŲØąØĐ ŲŲŠ Ų…Ų†Ø·Ų‚ØŠŲƒ.[CR]ŲŠŲ…ŲƒŲ† ØĢŲ† ؊؊ؚŲŠØą اŲ„ØĨØđØŊاØŊا؊ اŲ„ØŽØšØąØ§ŲŲŠØĐ ØĻŲ…ŲˆØŽØĻ ØĨØđØŊاØŊا؊ [اŲ„Ų„ŲˆŲ† اŲ„ØĢØĩŲØą]/اŲ„Ų…ØļŲ‡Øą/ØŪŲŠØ§ØąØ§ØŠ اŲ„ØđØąØķ [/Ų„ŲˆŲ†] + Ų„Ų… ŲŠØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų†ØŠØ§ØĶØŽ[CR]ØĻØđØķ اŲ„Ų…ح؊ŲˆŲŠØ§ØŠ ØšŲŠØą Ų…ØŠŲˆŲØąØĐ ŲŲŠ ŲˆØķØđ ØđØŊŲ… اŲ„ا؊ØĩاŲ„. + + + اŲ„ØđŲˆØŊØĐ ØĨŲ„Ų‰ اŲ„ØŊŲ‚ØĐ Ø§Ų„ØĢØĩŲ„ŲŠØĐ ŲŲŠ 6 ØŦŲˆØ§Ų†ŲŠ + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų†ØŠØ§ØĶØŽ. + + + ØģŲˆŲ ŲŠØļŲ‡Øą اŲ„Ų…ح؊ŲˆŲ‰ اŲ„Ų…Ų…ŲŠØē ØđŲ†ØŊŲ…ا ŲŠØŠŲ…ŲƒŲ† Boxee Ų…Ų† اŲ„ا؊ØĩاŲ„ ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ. + + + اŲ„Ų…ØīØ§ØąŲƒŲˆŲ† + ŲŠØģØŠŲ†ØŊ Boxee ØĨŲ„Ų‰ اŲ„ØđŲ…Ų„ اŲ„Ų…Ų„Ų‡Ų… Ų„Ų„ØĢŲØąØ§ØŊ ŲˆØ§Ų„Ų…ØŽŲ…ŲˆØđا؊ اŲ„؊اŲ„ŲŠØĐ Ø§Ų„Ø°ŲŠŲ† ØŽØđŲ„ŲˆØ§ Ų…ØąŲƒØē ØĨØđŲ„اŲ… XBMC Ų…Ų…ŲƒŲ†Ø§. + + + ؊حØŊŲŠØŦ + ØĨØđاØŊØĐ ØĩØĻØ· ØĻØąŲ†Ø§Ų…ØŽ + + ØĨØđاØŊØĐ ØķØĻØ· ØŽŲ‡Ø§Øē + Ų…ØģØ­ Ų…ØđŲ„ŲˆŲ…ا؊ ØĨØđŲ„اŲ…ŲŠØĐ Ų…Ų† اŲ„Ų…ŲƒØŠØĻØĐ (Ų…Ų„ŲØ§ØŠ اŲ„ŲˆØģاØĶØ· ØģØŠØĻŲ‚Ų‰ ØđŲ„Ų‰ حاŲ„Ų‡Ø§)... + ØĨØđاØŊØĐ Ø§Ų„ØīØĻŲƒØĐ + ØķØĻØ· ØĩŲˆØąØĐ ØŪŲ„ŲŲŠØĐ + ØķØĻØ· Ų…ØŽŲ„ØŊ ØĩŲˆØą اŲ„ØŪŲ„ŲŲŠØĐ + ØĢØģŲ…Ø§ØĄ ŲˆØ§ØŽŲ‡ØĐ Ø§Ų„ØīاØīØĐ + ØŠØ§ØąŲŠØŪ اŲ„ØĨŲ†ØīØ§ØĄ + Ų…ØđŲ„ŲˆŲ…ا؊ + Ų†ØģØŪØĐ Boxee + Ų…ØŽŲ…ŲˆØđ اŲ„ذاŲƒØąØĐ + اŲ„Ų…ØŪØēŲ† + Ų…Ų† + Ų…ØģØ­ اŲ„ØĩŲˆØą اŲ„Ų…ØĩØšØąØĐ Ø§Ų„Ų‚ØŊŲŠŲ…ØĐ (ØģØŠØĻŲ‚Ų‰ Ų…Ų„ŲØ§ØŠ اŲ„ØĨØđŲ„اŲ… ØđŲ„Ų‰ حاŲ„Ų‡Ø§)... + ØĨØđاØŊØĐ ØķØĻØ· ØĩŲˆØą اŲ„ØŪŲ„ŲŲŠØĐ + ؊؎اŲ‡Ų„ اŲ„ØĻاØŊØĶا؊ Ų„Ų„Ų…ح؊ŲˆŲ‰ اŲ„Ų…Ø­Ų„ŲŠ ØđŲ„Ų‰ ØĢŲ†ŲˆØ§Øđ ØĢØĻØŽØŊŲŠØĐ + + ؊حØŊŲŠØŦ اŲ„؊حŲ…ŲŠŲ„. + Boxee ØģŲˆŲ ŲŠŲƒŲˆŲ† ØĻØ·ŲŠØĶ ح؊Ų‰ اŲ„اŲ†ØŠŲ‡Ø§ØĄ. + + + ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… Ų‚ŲŠØŊ اŲ„ØŠØīØšŲŠŲ„ حاŲ„ŲŠØ§.[CR][CR]Ų‡Ų„ ØŠØąØšØĻ ŲŲŠ ØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ØŸ + اŲ„ØŪØąŲˆØŽ + + + Ų„ŲˆØ­ØĐ Ø§Ų„Ų…ŲØ§ØŠŲŠØ­ اŲ„اŲØŠØąØ§ØķŲŠØĐ + @ + + + ŲŠØąØŽŲ‰ اŲ„؊حŲ‚Ų‚ Ų…Ų† ا؊ØĩاŲ„ا؊ اŲ„ŲƒØĻŲ„ ŲˆØŠØĢŲƒØŊ Ų…Ų† اŲ„Ų…ØŠŲ„Ų‚ŲŠ/اŲ„ØŠŲ„ŲØēŲŠŲˆŲ† Ų„ŲŠØģ ØĩاŲ…ا.[CR][CR]ØĨذا اØģØŠŲ…Øą ØŠØđØ°Øą ØģŲ…اØđ ØĢŲŠ ØĩŲˆØŠ ŲŠØąØŽŲ‰ Ų…ØąØ§ØŽØđØĐ ØĩŲØ­ØĐ Ø­Ų„ اŲ„Ų…ØīŲƒŲ„ا؊ Ų…Ų† ØŪŲ„اŲ„ boxee.tv/troubleshooting + + + ØĩاŲ…ØŠ + + + C + E + + + ØĨØđØŊاØŊا؊ اŲ„؊طØĻŲŠŲ‚ + ؊طØĻŲŠŲ‚ + + + ØŽØ§ØąŲŠ اŲ„؊حŲ…ŲŠŲ„... ØąØŽØ§ØĄ اŲ„اŲ†ØŠØļØ§Øą. + ؊حŲ…ŲŠŲ„ ØŠØđŲ„ŲŠŲ‚Ųƒ... اŲ†ØŠØļØą Ų„Ø­ØļØĐ! + ØŠŲØąŲŠØš اŲ„ØŠØđŲ„ŲŠŲ‚...ØĢØķŲ ØĻØđØķ اŲ„ØĢØĩØŊŲ‚Ø§ØĄ! + Ų‚Ø·Øđ اŲ„ØīØĻŲƒØĐ... + ØŠŲ… Ų‚Ø·Øđ اŲ„ØīØĻŲƒØĐ... + ŲŠØŠØ§Ø­ Ų…Ų„Ų‚Ų… Boxee... + Ų…ØđاŲ„ØŽ اŲ„ØĨØđØŊاØŊ + + + Ų…ØąØ­ØĻا + اŲ„ØŽØŊŲŠØŊ؟ + اŲ„ØŠŲˆØĩŲŠØ§ØŠ + Ų†Øīاط اŲ„ØĢØĩØŊŲ‚Ø§ØĄ + ØŠŲ…ØŠ اŲ„ØĨØķاŲØĐ Ų…ØĪØŪØąØ§ + Ų…ØģØŠØŪØŊŲ… Ų…ØĪØŪØąØ§ + ØŽØ§ØąŲŠ اŲ„؊حŲ…ŲŠŲ„ + ØšŲŠØą Ų…ØŠØĩŲ„ + ØđØąØķ اŲ„ŲƒŲ„ + Ų…ØŠØĩŲ„! + + + Ų…ŲˆØģŲŠŲ‚Ų‰ OSD + ØŠŲ… ØĨØķاŲØĐ Ø§Ų„؊طØĻŲŠŲ‚ ØĻŲ†ØŽØ§Ø­.[CR][CR]ŲŠŲ…ŲƒŲ†Ųƒ اŲ„ØđØŦŲˆØą ØđŲ„ŲŠŲ‡ اŲ„ØĒŲ† ŲŲŠ Ų…ŲƒØŠØĻØĐ Ø§Ų„؊طØĻŲŠŲ‚. + ØŠØđØ°Øą ØĨØķاŲØĐ[CR][اŲ„Ų„ŲˆŲ† اŲ„ØĢØŪØķØą]%s[/ Ų„ŲˆŲ†]. + ØŠØđØ°Øą ØŠØąŲ‚ŲŠØĐ Ø§Ų„؊طØĻŲŠŲ‚. + Ų‡Ų„ ØŠØąØšØĻ ŲŲŠ ØĨØēاŲ„ØĐ Ø§Ų„ØŠØđŲ„ŲŠŲ‚ اŲ„Ų…Ø­ØŊØŊ؟ + ØŠØđØ°Øą ؊حŲ…ŲŠŲ„ اŲ„ØŠØđŲ„ŲŠŲ‚. + ØđØąØķ ŲˆØŠØīØšŲŠŲ„ ØĨØđØŊاØŊا؊ اŲ„ŲŲŠØŊŲŠŲˆ + ØŠØīØšŲŠŲ„ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ ŲˆØĨØđØŊاØŊا؊ ØąØ§ØŊŲŠŲˆ اŲ„ØĨŲ†ØŠØąŲ†ØŠ + ØķØĻØ· ØđØąØķ اŲ„ØīØąØ§ØĶØ­ + ØĨØđØŊاØŊا؊ ØīØĻŲƒØĐ Ø°Ø§ØŠ ØĩŲ„ØĐ + اŲ„ØīŲƒŲ„ ŲˆØ§Ų„Ų…ØļŲ‡Øą ŲˆØ§Ų„ØĨØđØŊاØŊا؊ اŲ„ØĨŲ‚Ų„ŲŠŲ…ŲŠØĐ + اŲ„ØĢØŽŲ‡ØēØĐ ŲˆØĨØđØŊاØŊا؊ اŲ„Ų†ØļاŲ… + اŲ„ŲƒØīŲ ŲˆØ§Ų„ØŠŲˆØ§ØĩŲ„ Ų…Øđ ØĢØŽŲ‡ØēØĐ Ø§Ų„ØŠØŪØēŲŠŲ† ŲˆØ§Ų„ØīØĻŲƒØ§ØŠ اŲ„Ų…Ø­Ų„ŲŠØĐ + اØĻØŊØĢ Ų…ØđاŲ„ØŽ اŲ„ØĨØđØŊاØŊ اŲ„ØĢŲˆŲ„ŲŠ + ØŽŲ…ŲŠØđ اŲ„ØĢŲ†ŲˆØ§Øđ... + ØīاŲ‡ØŊ Ų…Ų† ŲˆØąØ§ØĄ Ų‡Ø°Ø§ اŲ„ØĻØąŲ†Ø§Ų…ØŽ اŲ„ØąØ§ØĶØđ :) + Ø­ØŊØŊ Ø·Ų„ØĻا Ų…Ų† اŲ„Ų‚اØĶŲ…ØĐ Ų„ØŠØđŲŠŲŠŲ† ØĢŲˆ ØŠØšŲŠŲŠØą ØĨØđØŊاØŊا؊Ų‡. + Ų…ØĩاØŊØą اŲ„ŲˆØģاØĶØ· + اŲ„؊طØĻŲŠŲ‚ا؊ + ØĨØŊØ§ØąØĐ Ø§Ų„؊طØĻŲŠŲ‚ا؊ اŲ„ØŪاØĩØĐ ØĻŲƒ ŲˆØĨØķاŲØĐ ØŽØŊŲŠØŊØĐ + ØĢØŊØŪŲ„ ØđŲ†ŲˆØ§Ų† اŲ„Ų…ØģØŠŲˆØŊØđ + ŲŠØŠØđØ°Øą اŲ„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„Ų…ØģØŠŲˆØŊØđ. ØŠØĢŲƒØŊ Ų…Ų† ØĩØ­ØĐ Ø§Ų„Ų…ŲˆŲ‚Øđ ŲˆØ­Ø§ŲˆŲ„ Ų…ØąØĐ ØĢØŪØąŲ‰. + Ų‡Ų„ ØŠØąØšØĻ ŲŲŠ ØĨØēاŲ„ØĐ Ų…ØģØŠŲˆØŊØđ[CR][اŲ„Ų„ŲˆŲ† اŲ„ØĢØŪØķØą]%s[/Ų„ŲˆŲ†]؟ + Ų‡Ų„ ØŠØąØšØĻ ŲŲŠ ØĨØķاŲØĐ ØŠØ·ØĻŲŠŲ‚[CR][اŲ„Ų„ŲˆŲ† اŲ„ØĢØŪØķØą]%s[/Ų„ŲˆŲ†]؟ + ØĨØķاŲØĐ Ų…ØąØĻØđ + + + + + Ų…ØĩاØŊØą اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + Ų…ØĩاØŊØą اŲ„ŲŲŠØŊŲŠŲˆ + Ų…ØĩاØŊØą اŲ„ØĩŲˆØą + اŲ„ØĢØŽŲ‡ØēØĐ + اŲ„Ų…ØĩاØŊØą + + + ØđŲ…Ų„ اŲ„Ų…ØīØšŲ„ ØšŲŠØą Ų…ØŊØđŲ… حاŲ„ŲŠØ§ + + ؊طØĻŲŠŲ‚[CR][اŲ„Ų„ŲˆŲ† اŲ„ØĢØŪØķØą]%s[/ Ų„ŲˆŲ†] Ų…ØŦØĻØŠ ØĻاŲ„ŲØđŲ„ + + Ų…ØĩاØŊØą اŲ„Ų…Ų„Ų + ØŠŲˆØ§ŲØą Ų…ØīØ§ØąŲƒØ§ØŠ اŲ„ØīØĻŲƒØĐ ØĢŲˆ اŲ„ØĢØŽŲ‡ØēØĐ Ø§Ų„Ų…Ø­Ų„ŲŠØĐ Ø§Ų„Ų…؊احØĐ. + Ų…ØĩاØŊØą ØĨØđاØŊØĐ Ø§Ų„Ų…ØģØ­ + + Ų„ا ØŠŲˆØŽØŊ Ų…ŲˆØ§Ų‚Øđ ŲˆŲŠØĻ Ų…ØđŲ„Ų…ØĐ ŲƒŲ…ŲØķŲ„ØĐ + Ų…Ø­Ųˆ اŲ„ØŠØ§ØąŲŠØŪ... + ØŠŲ… + ØŠØ­ØąŲŠØą + اŲ„Ų…ØģØŠØđØąØķ + اŲ„ØŠØ§ØąŲŠØŪ + ØŠØīØšŲŠŲ„ اŲ„ØĒŲ† + ØŠŲØķŲŠŲ„ا؊ + اŲ„ØĻŲˆØŊŲƒØ§ØģØŠ + ØĨØķاŲØĐ ØĢØŽØēØ§ØĄ + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų†ØŠØ§ØĶØŽ + ØĢØŊØŪŲ„ ØđŲ†ŲˆØ§Ų† ŲŲŠŲ„Ų… ØĢŲˆ ØđØąØķ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ + حاŲˆŲ„ ؊طØĻŲŠŲ‚ ØŠŲØ§ØĩŲŠŲ„ اŲ„Ų…ŲˆØģŲ… Ų„ØŽŲ…ŲŠØđ اŲ„Ų…Ų„ŲØ§ØŠ ŲŲŠ Ų…ØŽŲ„ØŊ + ØĨØēاŲ„ØĐ + ŲŲŠŲ„Ų…ØŸ + ØđØąØķ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠØŸ + اŲ„ØĢŲ„ØĻŲˆŲ…ØŸ + ØĨØēاŲ„ØĐ؟ + ؊طØĻŲŠŲ‚ ØģŲ„ØģŲ„ØĐ + ØĨŲ„Ų‰ اŲ„Ų…ØŽŲ„ØŊ ŲƒØ§Ų…Ų„ا + ؊حØŊŲŠØŊ + Ų„ا ØīŲŠØĄ Ų…Ų…ا ØģØĻŲ‚ØŒ ŲŠØŠØąŲƒ ØŊŲˆŲ† Ø­Ų„ + Ų„ا ØīŲŠØĄ Ų…Ų…ا ØģØĻŲ‚ØŒ ØŠŲ… اŲ„ØĨØēاŲ„ØĐ Ų…Ų† اŲ„Ų…ŲƒØŠØĻØĐ + ØĨØēاŲ„ØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ Ų…Ų† اŲ„Ų…ŲƒØŠØĻØĐ + ؊حØŊŲŠØŊ + ØĨØĩØŊØ§Øą + اŲ„ØđŲ„اŲ…ا؊ + اŲ„ØŠŲ‚Ø·Ų‡Ø§ + ØŠØ§ØąŲŠØŪ اŲ„اŲ„ØŠŲ‚اط + اŲ„ŲƒØ§Ų…ŲŠØąØ§ + اŲ„Ų†Ų…ŲˆØ°ØŽ + ŲØŠØ­ØĐ + ØŠŲ… ØĨØķاŲØĐ Ø§Ų„ØŠØđŲ„ŲŠŲ‚ ØĻŲ†ØŽØ§Ø­.[CR][CR]ŲŠŲ…ŲƒŲ†Ųƒ اŲ„ØđØŦŲˆØą ØđŲ„ŲŠŲ‡ اŲ„ØĒŲ† ŲŲŠ Ų…ŲƒØŠØĻØĐ Ø§Ų„؊طØĻŲŠŲ‚. + اŲ„ØąØŽØ§ØĄ اØŪØŠŲŠØ§Øą Ų…Ų† ØĻŲŠŲ† اŲ„ØŪŲŠØ§ØąØ§ØŠ اŲ„؊اŲ„ŲŠØĐ Ų„ØĨØķاŲØĐ Ų…ØĩاØŊØą ØŽØŊŲŠØŊØĐ ØĨŲ„Ų‰ Boxee. + اŲ„؊طØĻŲŠŲ‚ا؊ + ŲŠØŊŲˆŲŠØ§Ų‹ + ØĨØķاŲØĐ Ų…ØĩØŊØą ØŽØŊŲŠØŊ + ØĻŲˆØ§ØģØ·ØĐ + اŲ„Ų‚Ų†Ø§ØĐ + اŲ„ØĻŲˆŲ… ØŪاطØĶ؟ + ØĢØŊØŪŲ„ ØđŲ†ŲˆØ§Ų† اŲ„ØĢŲ„ØĻŲˆŲ… + ØĻŲˆØ§ØģØ·ØĐ + ØĢØŊØŪŲ„ ØąŲ‚Ų… Ų…ŲˆØģŲ… + ØĢØŊØŪŲ„ ØąŲ‚Ų… Ø­ØŊØŦ + ØĨØēاŲ„ØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ Ų…Ų†[CR]اŲ„Ų…ŲƒØŠØĻØĐ + + + اŲ„Ų‚Ų†Ø§ØĐ + + + ŲŠŲ…ŲƒŲ† ØĢŲ† ؊ذŲ‡ØĻ Ų„ŲØŠØ­[CR]اŲ„Ų‚اØĶŲ…ØĐ Ø§Ų„ØąØĶŲŠØģŲŠØĐ + ŲŠŲ…ŲƒŲ† ØĢŲ† ؊ذŲ‡ØĻ Ų…ØĻاØīØąØĐ Ų„ŲØŠØ­[CR]Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØĩŲØ­ + اŲ†Ų‚Øą Ų‡Ų†Ø§ Ų„Ų„ØŠØĻØŊŲŠŲ„ ØĨŲ„Ų‰[CR]حاŲ„ŲŠØ§ Ų„ØŠØīØšŲŠŲ„ ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… + + + QWERT + ABCD + + + ØŊŲ„ŲŠŲ„ اŲ„Ų…ØģØŠØŪØŊŲ… + + اŲ„ØŠŲ†Ų‚Ų„ + اŲ„ØŠØīØšŲŠŲ„ + ØŽŲ‡Ø§Øē ؊حŲƒŲ… ØđŲ† ØĻØđØŊ + Ų„ŲˆØ­ØĐ Ø§Ų„Ų…ŲØ§ØŠŲŠØ­ + اŲ„ØŠŲ†Ų‚Ų„ Ų„ØĢØđŲ„Ų‰ ŲˆØĢØģŲŲ„ ŲˆŲŠŲ…ŲŠŲ†Ø§ ŲˆŲŠØģØ§ØąØ§. + اŲ„اØŪØŠŲŠØ§Øą ØĻاØģØŠØŪØŊاŲ… ØŠØīØšŲŠŲ„/ØĨŲŠŲ‚اŲ Ų…ØĪŲ‚ØŠ. + اŲ„ØđŲˆØŊØĐ ØĨŲ„Ų‰ اŲ„ØīاØīØĐ Ø§Ų„ØģاØĻŲ‚ØĐ ØĻاØģØŠØŪØŊاŲ… اŲ„Ų‚اØĶŲ…ØĐ. + اŲ„ØŠŲ†Ų‚Ų„ ØĻاØģØŠØŪØŊاŲ… Ų…ŲØ§ØŠŲŠØ­ اŲ„ØĢØģŲ‡Ų…. + اŲ„؊حØŊŲŠØŊ ØĻاØģØŠØŪØŊاŲ… Ų…ŲØŠØ§Ø­ اŲ„ØŊØŪŲˆŲ„. + اØģØŠØŪØŊاŲ… ''\'' Ų„Ų„ØŠØĻØŊŲŠŲ„ ØĻŲŠŲ† Ų…Ų„ØĄ اŲ„ØīاØīØĐ ŲˆØ§Ų„Ų†Ø§ŲØ°ØĐ. + ØĨŲ†Ų‡Ø§ØĄ ØĢŲˆ ØŠØđŲ„ŲŠŲ‚ ØĻاŲ„Ų†Ų‚Øą ŲŲˆŲ‚ S. + اŲ†Ų‚Øą ŲŲˆŲ‚ ØŪØąŲˆØŽ Ų„Ų„ØđŲˆØŊØĐ ØĨŲ„Ų‰ اŲ„ØīاØīØĐ Ø§Ų„ØģاØĻŲ‚ØĐ. + اŲ†Ų‚Øą ŲŲˆŲ‚ H Ų„Ų„اŲ†ØŠŲ‚اŲ„ ØĨŲ„Ų‰ اŲ„ØīاØīØĐ Ø§Ų„ØąØĶŲŠØģŲŠØĐ. + Ų…ØģØŠŲˆŲ‰ اŲ„؊حŲƒŲ… ØĻاŲ„ØĩŲˆØŠ ØĻاØģØŠØŪØŊاŲ… -/+ + ØĨØļŲ‡Ø§Øą اŲ„ØđØąØķ ØđŲ„Ų‰ اŲ„ØīاØīØĐ ŲˆØ§Ų„اØŪØŠŲŠØ§ØąØ§ØŠ ØĻاØģØŠØŪØŊاŲ… ØŠØīØšŲŠŲ„/ØĨŲŠŲ‚اŲ Ų…ØĪŲ‚ØŠ. + ØŠØŪØ·ŲŠ ØĻاØģØŠØŪØŊاŲ… اŲ„ØĢØēØąØ§Øą Ų„Ų„ØŪŲ„Ų ŲˆŲ„Ų„ØĢŲ…اŲ…. + ØĨØŪŲØ§ØĄ اŲ„ØđØąØķ ØđŲ„Ų‰ اŲ„ØīاØīØĐ ØĻاØģØŠØŪØŊاŲ… اŲ„Ų‚اØĶŲ…ØĐ. + ØĨØļŲ‡Ø§Øą اŲ„ØđØąØķ ØđŲ„Ų‰ اŲ„ØīاØīØĐ ŲˆØ§Ų„اØŪØŠŲŠØ§ØąØ§ØŠ ØĻاØģØŠØŪØŊاŲ… ØĨØŊØŪاŲ„. + اØķؚط ØđŲ„Ų‰ X Ų„ŲˆŲ‚Ų اŲ„ØŠØīØšŲŠŲ„. + ØŠØīØšŲŠŲ„ ØĢŲˆ ØĨŲŠŲ‚اŲ Ų…ØĪŲ‚ØŠ ØĻاØģØŠØŪØŊاŲ… ØīØąŲŠØ· اŲ„Ų…ØģاŲØĐ. + ØŠØŪØ·ŲŠ ØĻاØģØŠØŪØŊاŲ… Ų…ŲØ§ØŠŲŠØ­ اŲ„ØĢØģŲ‡Ų… Ų„Ų„ŲŠØģØ§Øą/اŲ„ŲŠŲ…ŲŠŲ†. + ØĨØŪŲØ§ØĄ اŲ„ØđØąØķ ØđŲ„Ų‰ اŲ„ØīاØīØĐ ØĻاŲ„Ų†Ų‚Øą ŲŲˆŲ‚ ØŪØąŲˆØŽ. + Ų‡Ø°Ø§ Ų‡Ųˆ Ų…ØŽØąØŊ Ų‚اØĶŲ…ØĐ ØĢØģاØģŲŠØĐ Ų„اØŪØŠØĩØ§ØąØ§ØŠ Ų„ŲˆØ­ØĐ Ø§Ų„Ų…ŲØ§ØŠŲŠØ­. Ų„Ų„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ Ų‚اØĶŲ…ØĐ ŲƒØ§Ų…Ų„ØĐ، ؊حŲ‚Ų‚ Ų…Ų† اŲ„ØĢØģØĶŲ„ØĐ Ø§Ų„ØīاØĶØđØĐ Ø­ŲˆŲ„ http://www.boxee.tv + + ØĩŲˆØąØĐ Ø§Ų„ØŪŲ„ŲŲŠØĐ + ŲŠØąØŽŲ‰ Ų…Ų„احØļØĐ ØĢŲ†Ų‡ ŲŠŲ†ØĩØ­ ØĻØĩŲˆØą اŲ„Ų…Ų†Ø§ØļØą اŲ„Ø·ØĻŲŠØđŲŠØĐ. + + ØŊŲ„ŲŠŲ„ اŲ„Ų…ØģØŠØŪØŊŲ…/اŲ„ØŠŲ†Ų‚Ų„ + ØŊŲ„ŲŠŲ„ اŲ„Ų…ØģØŠØŪØŊŲ…/اŲ„ØŠØīØšŲŠŲ„ + + حاŲ„ØĐ Ø§Ų„Ų…ŲƒØŠØĻØĐ + اŲ„Ų…ØģØ­ اŲ„ØĒŲ†: + ØģاŲƒŲ† + Ų…Ų„ØŪØĩ اŲ„Ų…ØŽŲ„ØŊ + Ų„ا ØŠØšŲŠŲŠØą + اŲ„Ø­Ų„: + Ų…Ų„ØŪØĩ اŲ„Ų…ØīØ§ØąŲƒØĐ + اŲ„ØĨØŽŲ…اŲ„ŲŠ: + ØŠŲ… اŲ„Ø­Ų„: + Ų„Ų… ؊حŲ„ ØĻØđØŊ: + ØŽØŊŲŠØŊ: + Ų…ØđŲ„Ų‚: + ØŠŲ… اŲ„ØĨŲŠŲ‚اŲ: + ØšŲŠØą Ų…ØŠŲˆŲØą: + ØŠØđØąŲŠŲ: + اŲ„Ų…ŲØķŲ„ØĐ + + ØģاŲƒŲ†... + Ų…ØģØ­: + ØŠØđØąŲŠŲ: + + + Ø­Ų„ ŲŠØŊŲˆŲŠ + Ų„ا ØŠŲˆØŽØŊ ØŠŲØ§ØĩŲŠŲ„ Ų…ØŠŲˆŲØąØĐ Ų„Ų‡Ø°Ø§ اŲ„ØđŲ†ŲˆØ§Ų†. + Ų‡Ų„ ØŠØąŲŠØŊ اŲ„ØŠØđØąŲŠŲ ØĻاØģØŠØŪØŊاŲ… Ų…Ų„Ų اŲ„Ų…ØđŲ„ŲˆŲ…ا؊ (NFO) اŲ„Ų…ŲˆØŽŲˆØŊ ŲŲŠ اŲ„Ų…ØŽŲ„ØŊ ØĢŲˆ اŲ„ØĻØ­ØŦ ØđŲ† اŲ„ØŠŲØ§ØĩŲŠŲ„ ØĻØīŲƒŲ„ ŲŠØŊŲˆŲŠØŸ + ØŠØđØąŲŠŲ اŲ„ŲˆØģاØĶØ· + NFO + ŲŠØŊŲˆŲŠ + ØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…Ų„Ų NFO ŲˆŲ„ŲƒŲ† ØŠØđØ°Øą ŲØŠØ­Ų‡ØŒ ØĻØąØŽØ§ØĄ Ų…ØąØ§ØŽØđØĐ Ų‡ŲŠŲƒŲ„ اŲ„Ų…Ų„Ų. + + + اŲ„ØąØŽØ§ØĄ ØĨØŊØŪاŲ„ ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą OS + ØŽØ§ØąŲŠ اŲ„؊حØŊŲŠØŦ... + ØŽØ§ØąŲŠ اŲ„ØŠØīØšŲŠŲ„... + ØŪØ·ØĢ ØšŲŠØą Ų…ØđØąŲˆŲ. + + اŲ„؊حŲ‚Ų‚ Ų…Ų† ØĩØ­ØĐ ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą... + ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą ØĩاŲ„Ø­ØĐ. + ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą ØšŲŠØą ØĩاŲ„Ø­ØĐ. + ØŽØ§ØąŲŠ ØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ Boxee.... + Ų‡Ų†Ø§Ųƒ ØĻاŲ„ŲØđŲ„ ØŠØŦØĻŲŠØŠ Boxee Ų…ØąŲŲ‚ ØĢØģŲŲ„ /Ų…ØŽŲ„ØŊا؊. + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…Ų„Ų اŲ„ØŠØŦØĻŲŠØŠ. + ØŠØđØ°Øą ØĨØąŲØ§Ų‚ Ų…Ų„Ų اŲ„ØŠØŦØĻŲŠØŠ. + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…Ų„Ų اŲ„ØŠØŦØĻŲŠØŠ اŲ„Ų…ØąŲŲ‚ ØĢØģŲŲ„ /Ų…ØŽŲ„ØŊا؊. + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų…Ų„Ų اŲ„ØŠØŦØĻŲŠØŠ اŲ„Ų…ØąŲŲ‚ MPKG ØĢØģŲŲ„ /Ų…ØŽŲ„ØŊا؊. + ØŠŲˆØĩŲŠ Boxee ØĻاŲ„ØŠØąŲ‚ŲŠØĐ Ø§Ų„ØĒŲ† - ØĨŲ†Ų‡ Ų„ØīŲŠØĄ ØŽŲŠØŊ ØĻاŲ„Ų†ØģØĻØĐ Ų„Ųƒ! + [COLOR red]Ų…Ø·Ų„ŲˆØĻ Ų‡Ø°Ø§ اŲ„؊حØŊŲŠØŦ. ŲŠŲ…ŲƒŲ†Ųƒ ØĨŲ…ا اŲ„؊حØŊŲŠØŦ ØĢŲˆ اŲ„ØĨØšŲ„اŲ‚ اŲ„ØĒŲ†.[/COLOR] + [COLOR red]Ų…Ø·Ų„ŲˆØĻ Ų‡Ø°Ø§ اŲ„؊حØŊŲŠØŦ.[/COLOR] + ØŠŲØ§ØĩŲŠŲ„ ØĢŲ‚Ų„ + Ų„احŲ‚ا + ؊حØŊŲŠØŦ Boxee + ØŠØđØ°Øą اŲ„؊حØŊŲŠØŦ. + اŲ„ØŪØ·ØĢ: + [CR]Boxee ŲŠØŠØ§Ø­ ؊حØŊŲŠØŦ اŲ„ØĻØąŲ†Ø§Ų…ØŽ.[CR]Ų‡Ų„ ØŠØąŲŠØŊ ØŠØŦØĻŲŠØŠŲ‡ اŲ„ØĒŲ†ØŸ + [COLOR red]* ØĨذا اØŪØŠØąØŠ ØĨŲ„ØšØ§ØĄ ØģŲŠØ·Ų„ØĻ Ų…Ų†Ųƒ اŲ„ØŠØŦØĻŲŠØŠ ØđŲ†ØŊ ØŠØģØŽŲŠŲ„ اŲ„ØŊØŪŲˆŲ„ اŲ„ØŪاØĩ ØĻŲƒ.[/COLOR] + [CR]؊حØŊŲŠØŦ ØĻØąŲ†Ø§Ų…ØŽ Boxee Ų…؊اح.[CR]اŲ„ØąØŽØ§ØĄ اŲ„ØŪØąŲˆØŽ Ų…Ų† Boxee ŲˆØ§Ų„؊حØŊŲŠØŦ Ų…Ų† Ų…ØŊŲŠØą ؊حØŊŲŠØŦ ØĢŲˆØĻŲˆŲ†ØŠŲˆ. + [CR]؊حØŊŲŠØŦ ØĻØąŲ†Ø§Ų…ØŽ Boxee Ų…؊اح.[CR]اŲ„ØąØŽØ§ØĄ اŲ„ØŪØąŲˆØŽ Ų…Ų† Boxee ŲˆØ§Ų„؊حØŊŲŠØŦ Ų…Ų† Ų‚اØĶŲ…ØĐ ØŠŲ„ŲØēŲŠŲˆŲ† ØĢØĻŲ„. + ŲŠØŠØ§Ø­ ؊حØŊŲŠØŦ ØĻØąŲ†Ø§Ų…ØŽ Boxee. + ŲŠØŠØ§Ø­ ؊حØŊŲŠØŦ ØĻØąŲ†Ø§Ų…ØŽ Boxee. + Ų„Ų‚ØŊ ØŦØĻØŠ ØĻاŲ„ŲØđŲ„ ØĢØ­ØŊØŦ Ų†ØģØŪØĐ Ų…Ų† Boxee. + 0.9.8.4881 + ؊حØŊŲŠØŦ + اŲ„؊حØŊŲŠØŦ اŲ„ØĢØŪŲŠØą + اŲ„؊حŲ‚Ų‚ Ų…Ų† ŲˆØŽŲˆØŊ Ų†ØģØŪØĐ ØŽØŊŲŠØŊØĐ Ų…Ų† Boxee... + [CR]Boxee ŲŠØŠØ§Ø­ Ų†ØģØŪØĐ ØŽØŊŲŠØŊØĐ Ų…Ų† اŲ„ØĻØąŲ†Ø§Ų…ØŽ.[CR]Ų‡Ų„ ØŠØąŲŠØŊ ØŠŲ†ØēŲŠŲ„Ų‡ اŲ„ØĒŲ†ØŸ + ؊حØŊŲŠØŦ Boxee Ų…ØŠŲˆŲØą! + Ø­ØŊØŊ "%s" Ų„ØĻØŊØĄ اŲ„؊حØŊŲŠØŦ ØĨŲ„Ų‰ ØĢØ­ØŊØŦ Ų†ØģØŪØĐ Ų…Ų† Boxee.[CR][CR]ØģŲŠØđاØŊ ØŠØīØšŲŠŲ„ Boxee ØĻØđØŊ ØŠØŦØĻŲŠØŠ اŲ„؊حØŊŲŠØŦ. + ؊حØŊŲŠØŦ Boxee + ŲƒŲ† ØđŲ„Ų‰ Ų…Ų‚ØąØĻØĐ! ŲŠØĻØ­ØŦ Boxee اŲ„ØĒŲ† ØđŲ† اŲ„ØĢØ­ØŊØŦ ŲˆØ§Ų„ØĢŲØķŲ„.[CR]ØģŲŠŲ‚ŲˆŲ… ØŽŲ‡Ø§Øē Boxee ØĻØĨØđاØŊØĐ Ø§Ų„ØŠØīØšŲŠŲ„ ØđŲ†ØŊ اŲ„اŲ†ØŠŲ‡Ø§ØĄ. + ØŠŲ†ØēŲŠŲ„ اŲ„ØĻØąŲ†Ø§Ų…ØŽ: + اŲ„؊حØŊŲŠØŦ اŲ„ØĒŲ† + Ų†ØģØŪØĐ ØŽØŊŲŠØŊØĐ Ų…ØŠŲˆŲØąØĐ. اŲ†Ų‚Øą Ų‡Ų†Ø§. + Ų„Ų„ØŠŲØ§ØĩŲŠŲ„ + ØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ ŲˆØŠØąŲ‚ŲŠØĐ + ØŽØ§ØąŲŠ ØŠŲ†ØēŲŠŲ„ Ų†ØģØŪØĐ ØŽØŊŲŠØŊØĐ... + ØĨØķاŲØĐ ØŠØđŲ„ŲŠŲ‚ ØĒØą ØĨØģ ØĨØģ + اŲ„Ų…ŲƒØŠØĻØĐ Ø§Ų„ØĩŲˆØŠŲŠØĐ + ØĩŲˆØŠ ØĨØķاŲŲŠ + ALSA + + + ØŠŲ…ŲƒŲŠŲ† اŲ„ØĢØŽŲ‡ØēØĐ Ø§Ų„Ų…ØģاØđØŊØĐ ØđŲ„Ų‰ ŲŲƒ اŲ„ØīŲØąØĐ Ų…ا ŲŠŲƒŲˆŲ† Ø°Ų„Ųƒ Ų…Ų…ŲƒŲ†Ø§ + + + Ų…ØąØĻØđ اŲ„؊طØĻŲŠŲ‚/؊طØĻŲŠŲ‚ا؊ ØŽØŊŲŠØŊØĐ + ؊طØĻŲŠŲ‚ا؊ ØŽØŊŲŠØŊØĐ + ؊طØĻŲŠŲ‚ا؊ŲŠ + ØŠØđŲ„ŲŠŲ‚ا؊ŲŠ + اŲ„Ų…ØŪØēŲ† + Ų„ا ؊؊اح ؊طØĻŲŠŲ‚ا؊ ØŽØŊŲŠØŊØĐ Ø­Ø§Ų„ŲŠØ§. + Ų„ا ؊؊اح ؊طØĻŲŠŲ‚ا؊. + ŲŠØŠØ§Ø­ ØŠØąŲ‚ŲŠØĐ Ø§Ų„؊طØĻŲŠŲ‚ + Ų„Ų„؊طØĻŲŠŲ‚ ØĨØđØŊاØŊا؊ + ØĨØķاŲØĐ Ų…ØŪØēŲ† + ØĨØķاŲØĐ ØŠØđŲ„ŲŠŲ‚ ØŽØŊŲŠØŊ + ØđØŊŲ… ØĨ؊احØĐ ØŠØđŲ„ŲŠŲ‚ + + ØŠØąŲ‚ŲŠØĐ Ø§Ų„؊طØĻŲŠŲ‚ + ØŠØšŲŠŲŠØą اŲ„ØĨØđØŊاØŊا؊ + ØĨØēاŲ„ØĐ Ø§Ų„؊طØĻŲŠŲ‚ + + اŲ„Ų…ŲˆŲ‚Øđ: + اŲ„Ų†ŲˆØđ: + ØŽØ§ØąŲŠ ؊حØŊŲŠØŦ Boxee... + Boxee ØŠØŦØĻØŠ اŲ„؊حØŊŲŠØŦا؊. Ų‚ØŊ ŲŠØģØŠØšØąŲ‚ Ø°Ų„Ųƒ ØĻØķØđ ØŊŲ‚اØĶŲ‚. + اŲ„؊حØŊŲŠØŦ: + + ØĨØŪŲØ§ØĄ ØŠØđŲ„ŲŠŲ‚ا؊ اŲ„ØĻاŲ„ØšŲŠŲ† ŲˆØ§Ų„؊طØĻŲŠŲ‚ا؊ + ŲŠŲ…ŲƒŲ†Ųƒ ŲŲ‚Ø· اŲ„ŲˆØĩŲˆŲ„ ØĨŲ„Ų‰ Ų…ح؊ŲˆŲ‰ اŲ„ØĻاŲ„ØšŲŠŲ† ØĨذا ŲƒØ§Ų† ØđŲ…ØąŲƒ ØđŲ„Ų‰ اŲ„ØĢŲ‚Ų„ Ų‚ØŊ ŲˆØĩŲ„ ØĨŲ„Ų‰ ØģŲ† اŲ„ØąØīØŊ Ø­ØģØĻ اŲ„Ų…ŲƒØ§Ų† اŲ„Ø°ŲŠ ØŠŲ‚ŲŠŲ… ŲŲŠŲ‡ ØĢŲˆ اŲ„Ø°ŲŠ ŲŠŲ…ŲƒŲ†Ųƒ اŲ„ŲˆØĩŲˆŲ„ ØĨŲ„Ų‰ اŲ„Ų…ح؊ŲˆŲ‰. + ؊حØŊŲŠØŊ ؚاŲ„Ų‚ Ų…ح؊ŲˆŲ‰ اŲ„ØĻاŲ„ØšŲŠŲ†... + ØĨØŪŲØ§ØĄ اŲ„ØŠØđŲ„ŲŠŲ‚ا؊ ŲˆØ§Ų„؊طØĻŲŠŲ‚ا؊ اŲ„ØŠŲŠ ŲŠØŠØđØ°Øą ØŠØīØšŲŠŲ„Ų‡Ø§ ŲŲŠ Ų…ŲˆŲ‚ØđŲƒ + ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą اŲ„ØŠŲŠ ØĢØŊØŪŲ„ØŠŲ‡Ø§ ØšŲŠØą ØĩØ­ŲŠØ­ØĐ. + ؊حذŲŠØą + + ØŠŲØ§ØĩŲŠŲ„ ØĢŲ‚Ų„ + Ų„Ų† ŲŠØŠŲ… ØđØąØķ ØĻØđØķ اŲ„Ų…ح؊ŲˆŲŠØ§ØŠ اŲ„Ų…ŲˆØŽŲˆØŊØĐ ŲŲŠ اŲ„Ų…ŲƒØŠØĻا؊ ŲˆØ§Ų„؊طØĻŲŠŲ‚ا؊ ŲŲŠ Ų…ŲˆŲ‚ØđŲƒØŒ Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ ØŠŲ…ŲƒŲŠŲ†Ų‡ØŸ + Ų‚ØĻŲˆŲ„ ؊حØŊŲŠØŦا؊ اŲ„اØŪØŠØĻØ§Øą/اŲ„ØĻŲŠØŠØ§ (اŲ„Ų…ØģØŠØŪØŊŲ…ŲˆŲ† اŲ„Ų…ØŠŲ‚ØŊŲ…ŲˆŲ† ŲŲ‚Ø·)؟ + + ØīŲƒŲ„ اŲ„ØīاØīØĐ + Ø·ØĻŲŠØđŲŠ (4:3) + ØīاØīØĐ ØđØąŲŠØķØĐ ØĻŲ„اØēŲ…ا / LCD TV + ØīاØīØĐ ŲƒŲ…ØĻŲŠŲˆØŠØą ØđØąŲŠØķØĐ LCD (16:10) + ØīاØīØĐ ØđØąŲŠØķØĐ Ø§Ų„ØŠØąØ§ (21:9) + Ø­ØŽŲ… اŲ„Ų…ØģØ­ + 3% + 4% + 5% + 6% + ØĨØēاŲ„ØĐ Ø§Ų„اØŪØŠØĩØ§Øą اŲ„Ų…Ø­ØŊØŊ؟ + Ų‡Ø°Ø§ اŲ„اØŪØŠØĩØ§Øą Ų…ŲˆØŽŲˆØŊ ØĻاŲ„ŲØđŲ„ + Ų…ØđاŲŠØąØĐ Ø§Ų„ØīاØīØĐ + Ų‡Ų„ ØŠØąØšØĻ ŲŲŠ ØķØĻØ· Ų…ØđاŲŠØąØĐ Ø§Ų„ØīاØīØĐ ØĢŲˆŲ„ا؟[CR][COLOR green]Ų…Ų„احØļØĐ:[/COLOR] ŲŠŲ…ŲƒŲ†Ųƒ ØĢŲ† ؊حØŊØŊ ØŊاØĶŲ…ا ŲŲŠ ŲˆŲ‚ØŠ Ų„احŲ‚ ØĢØģŲŲ„ ØĨØđØŊاØŊا؊-> اŲ„ØīŲƒŲ„ ŲˆØ§Ų„ØīØđŲˆØą->اŲ„ØīاØīØĐ + حذŲ + Ų…ØąØ­ØĻا ØĻŲƒŲ… ŲŲŠ Boxee! + ØĨØķاŲØĐ Ų…ØģØŠØŪØŊŲ… + ØĨØēاŲ„ØĐ + ØĨØēاŲ„ØĐ Ų…ØģØŠØŪØŊŲ… [COLOR green]'%s'[/COLOR]؟ + + اŲ„Ų…ØģØŠØŪØŊŲ… اŲ„حاŲ„ŲŠ + اŲ„Ų…ØģØŠØŪØŊŲ… اŲ„ØŽØŊŲŠØŊ + + ØĨØēاŲ„ØĐ + ØĨØķاŲØĐ Ų…ØģØŠØŪØŊŲ… + ØŊŲ„ŲŠŲ„ + اŲ„ØīØĻŲƒØĐ + ØĨØšŲ„اŲ‚ + ŲŠØąØŽŲ‰ اŲ„ØŠØĢŲƒŲŠØŊ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ Ų…Ø­Ųˆ اŲ„ØŠØ§ØąŲŠØŪ؟ + Ų„ا ŲŠŲ…ŲƒŲ† اŲ„ØŠØąØ§ØŽØđ ØđŲ† Ų‡Ø°Ø§ اŲ„ØĨØŽØąØ§ØĄ + ØŠØŪØ·Ų‰ + + ØŠŲ… + + ØŽØ§ØąŲŠ ØŠØģØŽŲŠŲ„ اŲ„ØŊØŪŲˆŲ„... + + ØŠØđØ°Øą اŲ„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ ØīØąŲˆØ· اŲ„اØģØŠØŪØŊاŲ… + ØŠØđØ°Øą اŲ„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ ØģŲŠØ§ØģØĐ Ø§Ų„ØŪØĩŲˆØĩŲŠØĐ + + ØĻاŲ„Ų†Ų‚Øą ŲŲˆŲ‚ "ØŠŲ…" ØŠŲ‚ØĻŲ„ اŲ„ØĒØŠŲŠ: + ØĻاŲ„Ų†Ų‚Øą ŲŲˆŲ‚ '%s' ØŠŲ‚ØĻŲ„ اŲ„ØĒØŠŲŠ + ØīØąŲˆØ· اŲ„اØģØŠØŪØŊاŲ… + Ųˆ + ØģŲŠØ§ØģØĐ Ø§Ų„ØŪØĩŲˆØĩŲŠØĐ + Ų„اØģØŠØŪØŊاŲ… Boxee. + + Ų…اذا ØŠØąŲŠØŊ ØĢŲ† ØŠŲØđŲ„ØŸ + + ØŠØģØŽŲŠŲ„ اŲ„ØŊØŪŲˆŲ„ ØĨŲ„Ų‰ Boxee + ØĨŲ†ØīØ§ØĄ Ų…ØģØŠØŪØŊŲ… Boxee ØŽØŊŲŠØŊ + اŲ„ØŪاØĩ ØĻŲƒ... + اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… [COLOR green] %s [/COLOR] ØšŲŠØą ØĩاŲ„Ø­. اØģØŠØŪØŊاŲ… ØĢØ­ØąŲ ŲŲ‚Ø· (Ų…Ų† اŲ„ØĢŲ„Ų ØĨŲ„Ų‰ اŲ„ŲŠØ§ØĄ)، ŲˆØĢØąŲ‚اŲ… (0-9)، ŲˆŲ†Ų‚Ø·ØĐ (.) ØĢŲˆ ØīØąØ·ØĐ ØģŲŲ„ŲŠØĐ (_). + اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… [COLOR green] %s [/COLOR] ØšŲŠØą Ų…؊اح. اØŪØŠØą اØģŲ… ØĒØŪØą ŲˆØ­Ø§ŲˆŲ„ Ų…ØąØĐ ØĢØŪØąŲ‰. + ØŠØđØ°Øą Ų„Ų„؊حŲ‚Ų‚ Ų…Ų† اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… [COLOR green] %s [/COLOR] ,اŲ„ØĨ؊احØĐ + ØŠŲ… + + ØŽŲŠØŊ + ØšŲŠØą ØĩاŲ„Ø­ + اØŪØŠØą اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… + ØŠŲ… ØĨŲ†ØīØ§ØĄ Ø­ØģاØĻ + ØŠŲ… اŲ„ØĢŲ…Øą! Ų„Ų‚ØŊ ØĢØąØģŲ„Ų†Ø§ ØĨŲ„ŲŠŲƒ Ų„Ų„ØŠŲˆ ØĻØąŲŠØŊاŲ‹ ØĨŲ„ŲƒØŠØąŲˆŲ†ŲŠØ§Ų‹ Ų„Ų„ØŠØĢŲƒŲŠØŊ – ا؊ØĻØđ اŲ„ØąØ§ØĻØ· Ų„ØŠŲ†ØīŲŠØ· Ø­ØģاØĻŲƒ ŲˆØĨØŊØ§ØąØĐ Ø§Ų„ØŠŲØ§ØĩŲŠŲ„ Ų…ØŦŲ„ اŲ„ØŪØŊŲ…ا؊ اŲ„ØŠØīØŽŲŠØđŲŠØĐ، ؊ؚذŲŠØ§ØŠ RSS، ØĩŲˆØąØĐ Ų…Ų„Ų اŲ„ØŠØđØąŲŠŲØŒ ŲˆØ§Ų„Ų…ØēŲŠØŊ. + ØŠØđØ°Øą ØĨŲ†ØīØ§ØĄ Ų…ØģØŠØŪØŊŲ… ØŽØŊŲŠØŊ + ØŠØđØ°Øą ØĨŲ†ØīØ§ØĄ Ų…Ų„Ų Ų…ØģØŠØŪØŊŲ… ØŽØŊŲŠØŊ + ØĢØđØŊ ŲƒØŠØ§ØĻØĐ ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą[CR] + ØŽŲŠØŊ + ØĻŲ„ا ØŠŲˆØ§ŲŲ‚ + ŲØīŲ„ ŲŲŠ ؊حØŊŲŠØŦ ØŠŲØ§ØĩŲŠŲ„ اŲ„Ų…ØģØŠØŪØŊŲ… اŲ„ØŽØŊŲŠØŊ + %s %s ŲŲŠ Boxee + ØąØģاŲ„ØŠŲƒ: + Ų…ØīØ§ØąŲƒØĐ + Ų…Ø­ØĻŲˆØĻ + Ų†Øĩ Ų…ØŪØĩØĩ + ØĢØķŲ ØŠØđŲ„ŲŠŲ‚Ųƒ: + (ØđØĻØą Boxee) + + ØđŲ†ŲˆØ§Ų† اŲ„ØĻØąŲŠØŊ اŲ„ØĨŲ„ŲƒØŠØąŲˆŲ†ŲŠ Ų‚ŲŠØŊ اŲ„اØģØŠØŪØŊاŲ… ØĻاŲ„ŲØđŲ„ + ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą Ų‚ØĩŲŠØąØĐ Ų„Ų„ؚاŲŠØĐ + ØŠŲ… ؚاŲ„ØĻاŲ‹! + Ų„ØĨŲ†Ų‡Ø§ØĄ ØĨØđØŊاØŊ Ø­ØģاØĻ Boxee اŲ„ØŪاØĩ ØĻŲƒØŒ ØģŲˆŲ ؊ح؊ا؎ ØĨŲ„Ų‰ Ų‚ØĻŲˆŲ„ ... + (ØđØĻØą اŲ„ØŠŲ„ŲØ§Øē اŲ„Ų…ØĻاØīØą Ų…Ų† Boxee) + ŲØīŲ„ ŲŲŠ ؊حØŊŲŠØŦ ØŪØŊŲ…ا؊ اŲ„Ų…ØģØŠØŪØŊŲ… اŲ„ØŽØŊŲŠØŊØĐ + ØŠØđØ°Øą ØŠØģØŽŲŠŲ„ اŲ„ØŊØŪŲˆŲ„ ØĻØđØŊ اØģØŠØđاØŊØĐ Ø§ØŠØĩاŲ„ ØĨŲ†ØŠØąŲ†ØŠ[CR] + Ų…ØīاŲ‡ØŊØĐ + + + ØĨŲ†ØŠØąŲ†ØŠ ŲˆŲ…Ø­Ų„ŲŠ + ŲˆØģاØĶŲ„ ØĨØđŲ„اŲ… اŲ„ØĨŲ†ØŠØąŲ†ØŠ + ŲˆØģاØĶŲ„ ØĨØđŲ„اŲ… Ų…Ø­Ų„ŲŠØĐ + + اŲ„ØĢŲƒØŦØą ØīŲŠŲˆØđا + Ų…Ų† اŲ„ØĢŲ„Ų ØĨŲ„Ų‰ اŲ„ŲŠØ§ØĄ + ØŠŲ…ØŠ اŲ„ØĨØķاŲØĐ Ų…ØĪØŪØąØ§ + اŲ„ØĢŲƒØŦØą اØģØŠØŪØŊاŲ…ا + + ØŽŲ…ŲŠØđ اŲ„Ų…ŲˆØ§ØģŲ… + + اŲ„ŲƒŲ„ + + اŲ„Ų…ŲˆØ§ØģŲ… + + ØŽŲ…ŲŠØđ اŲ„ØĢŲ†ŲˆØ§Øđ + ØŽŲ…ŲŠØđ اŲ„Ų…ØĩاØŊØą + ØŽŲ…ŲŠØđ ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… + اŲ„ŲŲŠØŊŲŠŲˆ + Ų…ŲˆØģŲŠŲ‚Ų‰ + ØĩŲˆØą + Ų‚اØĶŲ…ØĐ Ø§Ų„اŲ†ØŠØļØ§Øą + اŲƒØŠØīاŲ + ØĩŲˆØą + اŲ„Ų„ØđØĻ Ų…ØĪØŪØąØ§ + ØĢØķŲ ØĨŲ„Ų‰ ØđØąŲˆØķŲŠ[CR][LOWERCASE](Ø­Ų„Ų‚ا؊ Ų‚اØĶŲ…ØĐ Ø§Ų„اŲ†ØŠØļØ§Øą اŲ„ØŽØŊŲŠØŊØĐ)[/LOWERCASE] + ØĨØēاŲ„ØĐ Ų…Ų† ØđØąŲˆØķŲŠ[CR] + ØĨØķاŲØĐ ØĨŲ„Ų‰ اŲ„Ų…ŲØķŲ„ØĐ + ØĨØēاŲ„ØĐ Ų…Ų† اŲ„Ų…ŲØķŲ„ØĐ + ØŪاŲ„ŲŠ + ØšŲŠØą Ų…ØīاŲ‡ØŊ + ØĨØĩØŊØ§Øą ØŽØŊŲŠØŊ + اŲ„ØĢŲ‚ØŊŲ… ØĢŲˆŲ„ا + اŲ„ØĢØ­ØŊØŦ ØĢŲˆŲ„ا + اŲ„ØŠØ§ØąŲŠØŪ + ØĢØĻØŽØŊŲŠ + ØŠØ§ØąŲŠØŪ اŲ„ØŠØđØŊŲŠŲ„ + اŲ„ØĢŲ‚ØŊŲ… + اŲ„ØĢØ­ØŊØŦ + + ØĢ-ŲŠ + ŲŠ-ØĢ + اŲ„ØĢØ­ØŊØŦ ØĢŲˆŲ„ا + اŲ„ØĢŲ‚ØŊŲ… ØĢŲˆŲ„ا + اŲ„ØĢØ­ØŊØŦ ØĢŲˆŲ„ا + + + ØŠØąØŠŲŠØĻ + ØĢŲ†ŲˆØ§Øđ + اŲ„Ų…ŲˆØ§ØģŲ… + اŲ„ØĢŲ†ŲˆØ§Øđ + اØģŲ… اŲ„Ų…ØģØŠØŪØŊŲ… + + + ŲŲ„ØŠØą اŲ„Ų‚Ų†ŲˆØ§ØŠ + ØŠØīØŽŲŠØđŲŠ + Ų…؎اŲ†ŲŠ + + + Ų…Ų„احØļØĐ + Ų…ØģØŠŲˆØŊØđ [COLOR green] Boxee [/COLOR] ŲŠØŠØđØ°Øą ØĨØēاŲ„ØŠŲ‡ + Ų…ØŪØēŲ†ŲŠ + ØĨØēاŲ„ØĐ Ų…ØŪØēŲ† + ØĨØķاŲØ§ØŠ + ØĨØķاŲØĐ Ų…ØŪØēŲ† + ØĨØēاŲ„ØĐ Ų…ØŪØēŲ† + ØĨŲ„ØšØ§ØĄ اŲ„Ų†Ų‚Ų„ + + + ØŠØ­ØąŲŠØą ØĨØđØŊاØŊا؊ ØīØĻŲƒØĐ Ø§Ų„ا؊ØĩاŲ„ + + + Ų…Ų„احØļØĐ + ØŪØ·ØĢ + [B]Ų…ØģØ­ اŲ„Ų„ØđØĻ Ų…ØĪØŪØąØ§[/B] + Ų…ØđŲ„ŲˆŲ…ا؊ اŲ„ØŠŲ‚Ų†ŲŠØĐ + Ų…ØđŲ„ŲˆŲ…ا؊ + ØīاŲ‡ØŊ Ų„احŲ‚ا + ØĨØēاŲ„ØĐ + Ų…ØīاŲ‡ØŊ + ØšŲŠØą Ų…ØīاŲ‡ØŊ + ØĨØķاŲØĐ Ø§ØŪØŠØĩØ§Øą + ØĨØēاŲ„ØĐ Ø§ØŪØŠØĩØ§Øą + اŲ„Ų…ØēŲŠØŊ... + Ų…ØģØŠØŪØąØŽ + Ų…ØīØ§ØąŲƒØĐ + ØĨØēاŲ„ØĐ Ų…Ų† اŲ„ØģØŽŲ„ + ØąŲØķ + اØģØŠØđØąØ§Øķ + ØĨØđاØŊØĐ Ų…ØģØ­ اŲ„ØĢŲ„ØĻŲˆŲ… + ØŽØ§ØąŲŠ ØĨØđاØŊØĐ Ų…ØģØ­ اŲ„ØĢŲ„ØĻŲˆŲ… + Ų„ŲŠØģ Ų‡Ø°Ø§ اŲ„ØĢŲ„ØĻŲˆŲ…ØŸ + ØĨØķاŲØĐ Ø§Ų„Ų…ØģØ§Øą + ؊حØŊŲŠØŊ اŲ„ØĩŲˆØąØĐ Ø§Ų„ØĩØšŲŠØąØĐ + ØđŲˆØŊØĐ + ØŠŲØķŲŠŲ„ + ØĨØēاŲ„ØĐ + + ØĢØķŲŠŲ اŲ„ØđŲ†ØĩØą ØĨŲ„Ų‰ اŲ„Ų…ØīاŲ‡ØŊØĐ ŲŲŠ ŲˆŲ‚ØŠ Ų„احŲ‚ + ØŠŲ… ØĨØēاŲ„ØĐ Ø§Ų„ØđŲ†ØĩØą ØĻŲ†ØŽØ§Ø­ + ØŠŲ… ؊حØŊŲŠØŊ اŲ„ØđŲ†ØĩØą ØđŲ„Ų‰ ØĢŲ† ØŠŲ… Ų…ØīاŲ‡ØŊØŠŲ‡ + ØŠŲ… ؊حØŊŲŠØŊ اŲ„ØđŲ†ØĩØą ØđŲ„Ų‰ ØĢŲ†Ų‡ Ų„Ų… ŲŠØŠŲ… Ų…ØīاŲ‡ØŊØŠŲ‡ + ØŠØđØ°Øą ØĨØķاŲØĐ Ø§Ų„ØđŲ†ØĩØą ØĨŲ„Ų‰ Ų‚اØĶŲ…ØĐ Ø§Ų„Ų…ØīاŲ‡ØŊØĐ ŲŲŠ ŲˆŲ‚ØŠ Ų„احŲ‚ + ØŠØđØ°Øą حذŲ اŲ„ØđŲ†ØĩØą Ų…Ų† Ų‚اØĶŲ…ØĐ Ø§Ų„Ų…ØīاŲ‡ØŊØĐ ŲŲŠ ŲˆŲ‚ØŠ Ų„احŲ‚ + ØŠŲ… ØĨØķاŲØĐ Ų…ØŪØŠØĩØą اŲ„ØđŲ†ØĩØą ØĨŲ„Ų‰ اŲ„Ų‚اØĶŲ…ØĐ Ø§Ų„Ų…Ų†ØĻØŦŲ‚ØĐ + ØŠØđØ°Øą ØĨØķاŲØĐ Ų…ØŪØŠØĩØą اŲ„ØđŲ†ØĩØą... + ØŠŲ… ØĨØēاŲ„ØĐ Ų…ØŪØŠØĩØą اŲ„ØđŲ†ØĩØą + ØŠØđØ°Øą اŲ„ØĨØēاŲ„ØĐ Ų…Ų† اŲ„ØģØŽŲ„... + Ų…ØģØ­ اŲ„Ų…ØĩØŊØą + Ų„Ų… ŲŠØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ ØĢØŽŲ‡ØēØĐ Ų…Ø­Ų„ŲŠØĐ + + Boxee ŲŲŠ ŲˆØķØđ ØšŲŠØą Ų…ØŠØĩŲ„ ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ + Ų„ا ŲŠŲ…ŲƒŲ† ØĢŲ† ØŠØŽØđŲ„ Boxee Ų‡Ø°Ø§ ŲŠØ­ØŊØŦ[CR]Ų„ØĢŲ†Ųƒ Ų„Ų… ØŠŲƒŲ† Ų…ØŠØĩŲ„ا ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ. + Boxee ŲŠØ­ØŠØ§ØŽ ØĨŲ„Ų‰ اŲ„ا؊ØĩاŲ„ ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ Ų„Ų„ØđØĻ[CR]Ų…Ų† ØĢØŽŲ„Ųƒ. + Boxee ŲŠØ­ØŠØ§ØŽ ØĨŲ„Ų‰ اŲ„ا؊ØĩاŲ„ ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ Ų„Ų„ØđØĻ[CR]Ų…Ų† ØĢØŽŲ„Ųƒ. + ØŠØđØ°Øą اŲ„Ų…ØīØ§ØąŲƒØĐ ØĻØģØĻØĻ ØđØŊŲ… ØĨ؊احØĐ Ø§Ų„ØĨŲ†ØŠØąŲ†ØŠ[CR] + ŲŠØŠØđØ°Øą ØđŲ„Ų‰ Boxee ØĨØķاŲØĐ Ų‡Ø°Ø§ ØĨŲ„Ų‰ Ų‚اØĶŲ…ØĐ Ø§Ų„ØđØąØķ ŲŲŠ ŲˆŲ‚ØŠ Ų„احŲ‚[CR]ØŊŲˆŲ† ا؊ØĩاŲ„ ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ. + ŲŠØŠØđØ°Øą ØđŲ„Ų‰ Boxee حذŲ Ų‡Ø°Ø§ Ų…Ų† Ų‚اØĶŲ…ØĐ Ø§Ų„ØđØąØķ ŲŲŠ ŲˆŲ‚ØŠ Ų„احŲ‚[CR]ØŊŲˆŲ† ا؊ØĩاŲ„ ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ. + ØŠØīØšŲŠŲ„ + Ų…Ų„Ų Ų…Ø­Ų„ŲŠ + + Ų…Ø­Ų„ŲŠ + اØģØŠØđØąØ§Øķ + Ų„ا ŲŠŲ…ŲƒŲ† ØĢŲ† ØŠØŊŲŠØą Boxee ØŠØđŲ„ŲŠŲ‚ا؊Ųƒ Ų„ØĢŲ†Ųƒ Ų„Ų… ØŠŲƒŲ† Ų…ØŠØĩŲ„ا ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ. + ØĻØŊØĄ + ØĢØķŲ ØĨŲ„Ų‰ ؊طØĻŲŠŲ‚ا؊ŲŠ + ØĨØēاŲ„ØĐ Ų…Ų† ؊طØĻŲŠŲ‚ا؊ŲŠ + ØŠØđØ°Øą ØĨØ·Ų„اŲ‚ اŲ„؊طØĻŲŠŲ‚ [COLOR green]%s[/COLOR] + [COLOR green]%s[/COLOR][CR]ŲŠØ­ØŠØ§ØŽ ØĨŲ„Ų‰ ا؊ØĩاŲ„ ØĨŲ†ØŠØąŲ†ØŠ Ų„Ų„ØĻØŊØĄ. + ØŊØđŲ… اŲ„ØĨØđŲ„اŲ†Ø§ØŠ + اŲ„ŲƒŲ„ŲŠØĻ + Ų…ØģØŠØŪØąØŽ + اŲ„اØīØŠØąØ§Ųƒ + اŲ„اØīØŠØąØ§Ųƒ Ų…Ø·Ų„ŲˆØĻ + ØŠØđØ°Øą Ų…ØģØ­ Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ Ų…ØĪØŪØąØ§. + ØģŲŠØĪØŊŲŠ Ų‡Ø°Ø§ ØĨŲ„Ų‰ Ų…Ø­Ųˆ Ų‚اØĶŲ…ØĐ Ø§Ų„ØŠØīØšŲŠŲ„ اŲ„Ø­ØŊŲŠØŦØĐ Ø§Ų„ØŪاØĩØĐ ØĻŲƒ. Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ؟ + Ų…ØģØŠØŪØąØŽ + + + اŲ„ŲƒŲ„ + اŲ„ŲŲŠØŊŲŠŲˆ + Ų…ŲˆØģŲŠŲ‚Ų‰ + ØĩŲˆØą + اŲ„ØąŲŠØ§ØķØĐ + ØĻاŲ„Øš + اŲ„ØĨØĩŲ„اح + ŲŠŲ…ŲƒŲ† ØĨØēاŲ„ØĐ Ø§ØŪØŠØĻØ§Øą اŲ„؊طØĻŲŠŲ‚ [COLOR green] %s [/COLOR] ŲŠØŊŲˆŲŠØ§ + ØĨØēاŲ„ØĐ [COLOR green]%s[/COLOR] Ų…Ų† ؊طØĻŲŠŲ‚ا؊ŲŠ اŲ„Ų…ŲØķŲ„ØĐ ØŸ + ØŠØđØ°Øą ØĨØēاŲ„ØĐ Ø§Ų„؊طØĻŲŠŲ‚ [COLOR green]%s[/COLOR] + ØŠŲ… ØĨØķاŲØĐ ØŠØ·ØĻŲŠŲ‚ ØĨŲ„Ų‰ اŲ„Ų…ŲØķŲ„ØĐ + ØŠŲØķŲŠŲ„ + اŲ„ŲƒŲ„ + اŲ„ŲØĶا؊ + + ؊طØĻŲŠŲ‚ا؊ŲŠ + Ų…ŲƒØŠØĻØĐ Ø§Ų„؊طØĻŲŠŲ‚ا؊ + ؊طØĻŲŠŲ‚ا؊ ØŪØ§ØąØŽŲŠØĐ + + ØŠŲ†ØēŲŠŲ„ ØĢØ­ØŊØŦ ؊طØĻŲŠŲ‚ %s. ØąØŽØ§ØĄ اŲ„اŲ†ØŠØļØ§Øą... + ØŪØ·ØĢ ŲŲŠ ؊حŲ…ŲŠŲ„ اŲ„؊طØĻŲŠŲ‚ + ØŠØŦØĻŲŠØŠ اŲ„؊طØĻŲŠŲ‚. + ØŪØ·ØĢ ŲŲŠ ØŠØŦØĻŲŠØŠ اŲ„؊طØĻŲŠŲ‚ + ØŠØŦØĻŲŠØŠ اŲ„؊طØĻŲŠŲ‚ ØĻŲ†ØŽØ§Ø­ + اŲ„؊حŲ‚Ų‚ Ų…Ų† اŲ„ØŠŲˆŲ‚ŲŠØđ%s + ØŠØđØ°Øą اŲ„؊حŲ‚Ų‚ Ų…Ų† اŲ„ØŠŲˆŲ‚ŲŠØđ %s + %s؊حŲ‚Ų‚ Ų…Ų† اŲ„ØŠŲˆŲ‚ŲŠØđ + ØŠŲ†ØēŲŠŲ„. ØąØŽØ§ØĄ اŲ„اŲ†ØŠØļØ§Øą... + + + + ØđØąØķ اŲ„ŲƒŲ„ + ØđØąØķ اŲ„ŲƒŲ„ + + + ØīاŲ‡ØŊ Ų„احŲ‚ا + ØĢØĩØŊŲ‚Ø§ØĄ + ØđØąŲˆØķ + ØĢŲŲ„اŲ… + ؊طØĻŲŠŲ‚ا؊ + Ų…Ų„ŲØ§ØŠ + اŲ„ŲˆŲŠØĻ + ØīاŲ‡ØŊ[CR]Ų„احŲ‚اŲ‹ + + اŲ„ØĢŲŲ„اŲ… (اŲ„Ų…Ų„ŲØ§ØŠ) + اŲ„ØđØąŲˆØķ (اŲ„Ų…Ų„ŲØ§ØŠ) + + + + 3 + Ų†ØŠØ§ØĶØŽ اŲ„ØĻØ­ØŦ + اŲ„ØĻØ­ØŦ ØđŲ†: + Ų…ØīاŲ‡ØŊØĐ + [B][COLOR orange]ØĻØ­ØŦ ØđŲ„Ų‰ اŲ„ŲˆŲŠØĻ ØđŲ† "%s"[/COLOR][/B] + + + Ų…ØīØ§ØąŲƒØĐ + ŲŠØąØ§ØđŲ‰ اŲ„Ų…ØīØ§ØąŲƒØĐ.[CR]اŲ„ØąØŽØ§ØĄ ØĨØŊØŪاŲ„ اŲ„ØąØģاŲ„ØĐ. + + + ØĻØ­ØŦ + اŲ„ØđŲ†ŲˆØ§Ų† ØĢŲˆ ŲƒŲ„Ų…ØĐ + ØĢØąŲ†ŲŠ + ØŠØąØŠŲŠØĻ + اŲ„Ų…ØąØīحا؊ + ØđØąØķ + Ų…ØĩØšØą + Ų‚اØĶŲ…ØĐ + ØĨØķاŲØ§ØŠ + اŲ„Ų…ØŪØēŲ† + ØŽØ§ØąŲŠ اŲ„؊حŲ…ŲŠŲ„ + ØĢØĩØŊŲ‚Ø§ØĄ + اŲ„Ų„ØđØĻ Ų…ØĪØŪØąØ§ + ØŠØĩŲØ­ اŲ„Ų…Ų„Ų + ØĨØķاŲØĐ Ų…ØīØ§ØąŲƒØĐ Ø§Ų„ŲˆØģاØĶØ· + Ų…ØģØ­ Ų„ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… + ØĢŲŲ„اŲ…ŲŠ + اØģØŠØđØąØ§Øķ اŲ„Ų…ØĩاØŊØą + Ų…ØģØ­ Ų…ØŽŲ„ØŊا؊ ŲˆØģاØĶŲ„ اŲ„ØĨØđŲ„اŲ… + Ų…؎اŲ†Ø§ ŲŲ‚Ø· + ØšŲŠØą Ų…ØīاŲ‡ØŊ ŲŲ‚Ø· + اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ ØŪاØĩØŠŲŠ + ØšŲŠØą Ų…ØīاŲ‡ØŊ ŲŲ‚Ø· + ؊طØĻŲŠŲ‚ا؊ŲŠ + Ų…ŲƒØŠØĻØĐ Ø§Ų„؊طØĻŲŠŲ‚ا؊ + ØĨØĩØŊØ§Øą + Ų…ØīØ§ØąŲƒØĐ + ØĩŲˆØąŲŠ + ØīاŲ‡ØŊ Ų„احŲ‚ا + ØĻØąØ§Ų…ØŽ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ† ØŪاØĩØŠŲŠ + Ų…ŲƒØŠØĻØĐ ØĻØąØ§Ų…ØŽ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ† + اŲ„Ų…Ų†ØŠØŽ + ØĻØ·ŲˆŲ„ØĐ + ØđاŲ… اŲ„ØĨØĩØŊØ§Øą + ØŠØ§ØąŲŠØŪ اŲ„ØĻØŦ + ØĨØŪØąØ§ØŽ + Ų…Ų† + اŲ„ØŠØīØšŲŠŲ„[CR]اŲ„ØĒŲ† + ؊طØĻŲŠŲ‚ا؊ + ØđŲˆØŊØĐ + اŲ„Ų…ØĩØŊØą اŲ„Ų…ŲˆØĩŲ‰ ØĻŲ‡ + Ų…ØĩاØŊØą ØĢØŪØąŲ‰ + Ų…ØīØ§ØąŲƒØĐ + Ų‚اØĶŲ…ØĐ Ø§Ų„Ų…ØģØ§Øą + اŲ†ØŠŲ‡Ų‰ اŲ„ØĒŲ† + Ų…اذا ØĻØđØŊ؟ + ØŠØīØšŲŠŲ„ اŲ„؊اŲ„ŲŠ + ØĨØēاŲ„ØĐ[CR]Ų…Ų† Ų‚اØĶŲ…ØĐ Ø§Ų„اŲ†ØŠØļØ§Øą + اذŲ‡ØĻ + اŲ„ØđŲ†Ø§ØĩØą + ØĨØšŲ„اŲ‚ + ØŠØģØŽŲŠŲ„ اŲ„ØŪØąŲˆØŽ + اŲ„Ų†ŲˆŲ… + اŲ„ØŪØĩاØĶØĩ + ØĨØŊØ§ØąØĐ Ø§Ų„Ų…ØĩاØŊØą + اŲ„Ų…ØģØ­ حاŲ„ŲŠØ§ + اŲ„Ų…Ų„ŲØ§ØŠ اŲ„Ų…Ø­Ų„ŲŠØĐ + اŲ„ØđØŦŲˆØą %d ØđŲ„Ų‰ Ų…Ų„ŲØ§ØŠ + ؊حØŊŲŠØŊŲ‡Ø§ اŲ„ØĒŲ† + ØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ اŲ„Ų…Ų„ŲØ§ØŠ[CR]، ŲˆØŠØ­ØŊŲŠØŊŲ‡Ø§ + + Ų„ا ØīŲŠØĄ + Ų„ŲˆØ­ØĐ Ų…ŲØ§ØŠŲŠØ­ ØĨØķاŲŲŠØĐ 1 + Ų„ŲˆØ­ØĐ Ų…ŲØ§ØŠŲŠØ­ ØĨØķاŲŲŠØĐ 2 + Ų„ŲˆØ­ØĐ Ų…ŲØ§ØŠŲŠØ­ ØĨØķاŲŲŠØĐ 3 + + ØŠØĩŲØ­ ØđŲ† اŲ„؊طØĻŲŠŲ‚ا؊ + + اŲ„Ų‚Ų†ŲˆØ§ØŠ + + ØĨØĩØŊØ§Øą + ØŠŲ… اŲ„ØŠŲ‚ŲŠŲŠŲ… + + ØŠŲ…ŲƒŲŠŲ† ØŠØģØŽŲŠŲ„ Curl + - ØđŲ†ŲˆØ§Ų† ØŽŲ‡ØĐ Ø§Ų„ŲˆØĩŲˆŲ„ Syslog + ØŠŲ…ŲƒŲŠŲ† ØĨØĻŲ„اؚ Syslog + + Boxee ؊؊ŲˆŲ„Ų‰ Ų…ØģØ­ اŲ„Ų…ØŽŲ„ØŊ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ ØđŲ„Ų‰ ØŽŲ‡Ø§Øē اŲ„ŲƒŲ…ØĻŲŠŲˆØŠØą اŲ„ØŪاØĩ ØĻŲƒ. Ų‚ØŊ ŲŠØģØŠØšØąŲ‚ اŲ„ØĢŲ…Øą ØĻØđØķ اŲ„ŲˆŲ‚ØŠ Ų„ØŠØļŲ‡Øą اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰[CR]ŲˆŲŲŠ ØšØķŲˆŲ† Ø°Ų„Ųƒ ŲŠŲ…ŲƒŲ†Ųƒ: + 2. اŲ„اØģØŠŲ…اØđ ØĨŲ„Ų‰ ؊طØĻŲŠŲ‚ا؊ Ų…ŲˆØģŲŠŲ‚Ų‰ اŲ„ØĨŲ†ØŠØąŲ†ØŠ اŲ„؊اØĻØđØĐ Ų„Ų€ Boxee + Boxee ؊؊ŲˆŲ„Ų‰ Ų…ØģØ­ Ų…ØŽŲ„ØŊ ØĻØąØ§Ų…ØŽ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ† ØđŲ„Ų‰ ØŽŲ‡Ø§Øē اŲ„ŲƒŲ…ØĻŲŠŲˆØŠØą اŲ„ØŪاØĩ ØĻŲƒ. Ų‚ØŊ ŲŠØģØŠØšØąŲ‚ اŲ„ØĢŲ…Øą ØĻØđØķ اŲ„ŲˆŲ‚ØŠ Ų„ØĻØąŲ…ا؎ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ†[CR]ŲˆŲŲŠ ØšØķŲˆŲ† Ø°Ų„Ųƒ ŲŠŲ…ŲƒŲ†Ųƒ: + 1. ØŠØĩŲØ­ Ų…ŲƒØŠØĻØĐ ØĻØąŲ†Ø§Ų…ØŽ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ† + Ų…ØģØ­ اŲ„Ų…ØŽŲ„ØŊا؊ اŲ„ØĢØŪØąŲ‰ اŲ„Ų…ŲˆØŽŲˆØŊØĐ ØđŲ„Ų‰ اŲ„ŲƒŲ…ØĻŲŠŲˆØŠØą ØĢŲˆ اŲ„ØīØĻŲƒØĐ + اŲ„ØđŲ†Ø§ŲˆŲŠŲ†! Ų„Ų… ŲŠØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ اŲ„ØĻØąŲ†Ø§Ų…ØŽ اŲ„Ų…ØģاØđØŊ Ų„Ų„ŲŲ„اØī. + ØŠØŽØŊØą اŲ„ØĨØīØ§ØąØĐ ØĨŲ„Ų‰ ØĢŲ†Ų‡ Ų…Ų† ØĢØŽŲ„ ØŠØīØšŲŠŲ„ Ų…ØđØļŲ… اŲ„Ų…ح؊ŲˆŲ‰[CR]ØđŲ„Ų‰ اŲ„اŲ†ØŠØąŲ†ØŠØŒ ŲŠØ·Ų„ØĻ Ų…ØģاØđØŊØĐ Ø§Ų„ŲŲ„اØī.[CR]Ų„Ø­Ų„ Ų‡Ø°Ų‡ اŲ„Ų…ØīŲƒŲ„ØĐ، ŲŠØąØŽŲ‰ ØēŲŠØ§ØąØĐ [COLOR yellow][B]http://www.boxee.tv/flash[/B][/COLOR] + ŲƒØīŲØŠ Boxee ØđŲ† ØĢŲ† Ų„ØŊŲŠŲƒ ØĢŲ‚Ų„ Ų…Ų† 128MB Ų…Ų† ذاŲƒØąØĐ Ø§Ų„ŲŲŠØŊŲŠŲˆ.[CR]Ų‚ØŊ ØŠŲˆØ§ØŽŲ‡ Ų…ØīاŲƒŲ„ ŲŲŠ ØŠØīØšŲŠŲ„ Boxee. + ØđŲ†ŲˆØ§Ų† Ų…Ų„Ų‚Ų… ŲˆØ§ØŽŲ‡ØĐ Syslog ØšŲŠØą ØĩاŲ„Ø­ + + - Ų…ØģØŠŲ‚ØĻŲ„ Ų‚اØŊØą ØđŲ„Ų‰ ØŊŲˆŲ„ØĻŲŠ ØąŲ‚Ų…ŲŠ ØĒØŪØą + - Ų…ØģØŠŲ‚ØĻŲ„ Ų‚اØŊØą ØđŲ„Ų‰ ØŊŲˆŲ„ØĻŲŠ TrueHD + - Ų…Ų„Ų‚Ų… Ų‚اØŊØą ØđŲ„Ų‰ DTS-HD + ØąŲ‚Ų…ŲŠ (HDMI) + - Ų…ØģØŠŲ‚ØĻŲ„ Ų‚اØŊØą ØđŲ„Ų‰ LPCM 7.1 + ؊حذŲŠØą: ØŽŲ‡Ø§Øē اŲ„اØģØŠŲ‚ØĻاŲ„ اŲ„ØŪاØĩ ØĻŲƒ ŲŠØīŲŠØą ØĨŲ„Ų‰ ØĢŲ†Ų‡ Ų„ا ŲŠØŊØđŲ… bitstreaming ØŊŲˆŲ„ØĻŲŠ ØąŲ‚Ų…ŲŠ + ؊حذŲŠØą: ØŽŲ‡Ø§Øē اŲ„اØģØŠŲ‚ØĻاŲ„ اŲ„ØŪاØĩ ØĻŲƒ ŲŠØīŲŠØą ØĨŲ„Ų‰ ØĢŲ†Ų‡ Ų„ا ŲŠØŊØđŲ… bitstreaming ØŊŲˆŲ„ØĻŲŠ ØąŲ‚Ų…ŲŠ ØĒØŪØą + ؊حذŲŠØą: ØŽŲ‡Ø§Øē اŲ„اØģØŠŲ‚ØĻاŲ„ اŲ„ØŪاØĩ ØĻŲƒ ŲŠØīŲŠØą ØĨŲ„Ų‰ ØĢŲ†Ų‡ Ų„ا ŲŠØŊØđŲ… bitstreaming ØŊŲˆŲ„ØĻŲŠ TrueHD + ؊حذŲŠØą: ØŽŲ‡Ø§Øē اŲ„اØģØŠŲ‚ØĻاŲ„ اŲ„ØŪاØĩ ØĻŲƒ ŲŠØīŲŠØą ØĨŲ„Ų‰ ØĢŲ†Ų‡ Ų„ا ŲŠØŊØđŲ… bitstreaming ØŊŲˆŲ„ØĻŲŠ DTS + ؊حذŲŠØą: ØŽŲ‡Ø§Øē اŲ„اØģØŠŲ‚ØĻاŲ„ اŲ„ØŪاØĩ ØĻŲƒ ŲŠØīŲŠØą ØĨŲ„Ų‰ ØĢŲ†Ų‡ Ų„ا ŲŠØŊØđŲ… bitstreaming ØŊŲˆŲ„ØĻŲŠ DTS-HD + ØŽŲ…ŲŠØđ اŲ„Ų…ØŪØąØŽØ§ØŠ + اŲ„؊حŲƒŲ… ŲŲŠ Ų…ØģØŠŲˆŲ‰ اŲ„ØĩŲˆØŠ ØĢØŦŲ†Ø§ØĄ اŲ„ØŠØīØšŲŠŲ„ (ØĨذا ØĢŲ…ŲƒŲ†) + + ØŠŲ„Ų‚اØĶŲŠ + ØĨŲŠŲ‚اŲ + ØŠØīØšŲŠŲ„ + Ų†ØģØĻØĐ Dolby TrueHD DRC + ØŠŲ…ŲƒŲŠŲ† ØŠØĢØŪØą اŲ„Ų…ØŪØąØŽ + + + + Ų…ŲˆØ§ŲŲ‚ + ØĨØķاŲØĐ + ØĨØķاŲØĐ Ų‡Ø°Ø§ اŲ„ØŊŲ„ŲŠŲ„ + + + Ų…ØģØŠØŪØŊŲ… Ų…ØĪØŪØąØ§ + + + 12Øģ + 24Øģ + h:mm:ss xx + H:mm:ss + اØŪØŠØą ØīØĻŲƒØĐ Ų…Ų† اŲ„Ų‚اØĶŲ…ØĐ، ØĢŲˆ اØŊŲ…ØŽ ØīØĻŲƒØĐ ØĢØŪØąŲ‰. + ØŊŲ…ØŽ ØīØĻŲƒØĐ + ØģŲˆŲ Ų†Ø­ØŠØ§ØŽ ØĨŲ„Ų‰ ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą ØģØąŲŠØĐ Ø­ØŠŲ‰ ؊؊Ų…ŲƒŲ† Ų…Ų† اŲ„ا؊ØĩاŲ„. + ØŊŲ…ØŽ ØīØĻŲƒØĐ ØĢØŪØąŲ‰ + Ų†Ø­ØŠØ§ØŽ ØĨŲ„Ų‰ اØģŲ… اŲ„ØīØĻŲƒØĐ Ø§Ų„ØŠŲŠ ØŠØąŲŠØŊ ØŊŲ…ØŽŲ‡Ø§. + Ų„Ų… ŲŠØŠŲ… ØĨŲ†ØīØ§ØĄ ŲƒŲ„ اŲ„ØīØĻŲƒØ§ØŠ ØĻاŲ„ØŠØģاŲˆŲŠØŒ Ų„ذا Ų†Ø­ØŠØ§ØŽ ØĨŲ„Ų‰ Ų…ØđØąŲØĐ Ų†ŲˆØđ اŲ„ØģØąŲŠØĐ Ø§Ų„ØŠŲŠ ØŠØģØŠØŪØŊŲ…Ų‡Ø§. + ØĨŲ†Ų‡Ø§ Ų†ØģØŪØĐ ØŠØŽØąŲŠØĻŲŠØĐ! ØŠØđØąŲ Ų…ا Ų†Ø­ØŠØ§ØŽ ØĨŲ„ŲŠŲ‡ Ų…Ų†Ųƒ Ų‡Ų†Ø§. ØĨذا Ų„Ų… ØŠŲƒŲ† ØŠØđØąŲØŒ اØģØĢŲ„ ØĢØ­ØŊ ØĢØĩØŊŲ‚اØĶŲƒ اŲ„ØĢØ°ŲƒŲŠØ§ØĄ. + ؊حØŊŲŠØŦ Boxee Ų…ØŠŲˆŲØą + اŲ„ØĒŲ† ŲˆŲ†Ø­Ų† ŲŠŲ…ŲƒŲ†Ų†Ø§ اŲ„ŲˆØĩŲˆŲ„ ØĨŲ„Ų‰ اŲ„ØĨŲ†ØŠØąŲ†ØŠØŒ ØŊØđŲ†Ø§ Ų†ØŠØĢŲƒØŊ Ų…Ų† ØŠŲˆŲØą ØĢØ­ØŊØŦ Ų†ØģØŪØĐ Ų„ØŊŲŠŲƒ Ų…Ų† ØĻØąŲ†Ø§Ų…ØŽ Boxee. + Ų†ØŽØ§Ø­! + Boxee Ų…ØŠØĩŲ„ ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ. اØģØŠŲ…ØŠØđ اŲ„ØĒŲ†. + + + ØĻØąŲ†Ø§Ų…ØŽ Boxee Ų…ØŠØĩŲ„ اŲ„ØĒŲ† ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ.[CR][CR]اŲ„ØĒŲ† Ų…Øđ ØĨŲ…ŲƒØ§Ų†ŲŠØĐ Ø§Ų„ŲˆØĩŲˆŲ„ ØĨŲ„Ų‰ اŲ„ØĨŲ†ØŠØąŲ†ØŠØŒ ØŊØđŲ†Ø§ Ų†ØŠØĢŲƒØŊ Ų…Ų† اŲ„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ ØĢØ­ØŊØŦ Ų†ØģØŪØĐ Ų…Ų† Boxee. + ØŠŲ… اŲ„ا؊ØĩاŲ„ ØĻŲ†ØŽØ§Ø­ + Ų…Ų„احØļا؊ اŲ„ØĨØĩØŊØ§Øą + Ų‡Ų…Ų…ØŒ Ų„ا ŲŠŲ…ŲƒŲ†Ų†Ø§ اŲ„ا؊ØĩاŲ„ ØĻاŲ„ØąØ§ŲˆØŠØą اŲ„ØŪاØĩ ØĻŲƒ. حاŲˆŲ„ ØĨØŊØŪاŲ„ ØĨØđØŊاØŊا؊ ØīØĻŲƒØŠŲƒ ØĻØ·ØąŲŠŲ‚ØĐ ŲŠØŊŲˆŲŠØĐ. + Ų‡Ų…Ų…ØŒ ØĨŲ†ØŠØąŲ†ØŠ اŲ„ØąØ§ŲˆØŠØą Ų„ا ŲŠØđŲ…Ų„. حاŲˆŲ„ اŲ„ا؊ØĩاŲ„ ØđØĻØą اŲ„ŲƒŲ…ØĻŲŠŲˆØŠØą اŲ„ØŪاØĩ ØĻŲƒ Ų„ŲØ­Øĩ اŲ„ا؊ØĩاŲ„. + اØģ؊طاØđ ØĻØąŲ†Ø§Ų…ØŽ Boxee اŲ„ا؊ØĩاŲ„ ØĻØīØĻŲƒØŠŲƒØŒ ŲˆŲ„ŲƒŲ† Ų„ا ŲŠŲ…ŲƒŲ† اŲ„ŲˆØĩŲˆŲ„ ØĨŲ„Ų‰ اŲ„ØĨŲ†ØŠØąŲ†ØŠ. + ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą ØšŲŠØą ØĩØ­ŲŠØ­ØĐ، حاŲˆŲ„ ØŦاŲ†ŲŠØĐ. + ØĢŲ…Ų† اŲ„ØīØĻŲƒØĐ + ØĢØŊØŪŲ„ اØģŲ… اŲ„ØīØĻŲƒØĐ + Ø­ØŊØŊ اŲ„ØīØĻŲƒØĐ Ø§Ų„Ų„اØģŲ„ŲƒŲŠØĐ + ØģŲŠŲ‚ŲˆŲ… ØĻØąŲ†Ø§Ų…ØŽ Boxee ØĻاŲ„ا؊ØĩاŲ„ ØĻØīØĻŲƒØĐ Ų„اØģŲ„ŲƒŲŠØĐ + Boxee Ų…ØŠØĩŲ„ ØĻØąØ§ŲˆØŠØą Ų…Ų† ØŪŲ„اŲ„ ŲƒØ§ØĻŲ„ ØĨŲŠØŦØąŲ†ØŠ + ŲƒŲŠŲ ØŠØąŲŠØŊ ØĢŲ† ŲŠØŠØĩŲ„ Boxee ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠØŸ + ØķØĻØ· ØīاØīØŠŲƒ + Ų‚Ų… اŲ„ØĒŲ† ØĻŲ…حاذاØĐ [B][COLOR blue]ØģŲ‡Ų… [/COLOR][/B]2 ØĻاŲ„ØŽØēØĄ اŲ„ØģŲŲ„ŲŠ اŲ„ØĢŲŠŲ…Ų† Ų…Ų† ØīاØīØŠŲƒ.[CR][CR]ØđŲ†ØŊ اŲ„اŲ†ØŠŲ‡Ø§ØĄØŒ اØķؚط ØđŲ„Ų‰ اŲ„ØēØą [B][COLOR boxeegreenheidi]center[/COLOR][/B]. + اØģØŠØŪØŊŲ… اŲ„Ų„ŲˆØ­ØĐ Ø§Ų„ا؊؎اŲ‡ŲŠØĐ ØđŲ„Ų‰ اŲ„Ų…ŲˆØŊŲŠŲ„ اŲ„ØŪاØĩ ØĻŲƒ Ų„Ų…حاذاØĐ [B][COLOR blue]اŲ„ØģŲ‡Ų… 1[/COLOR][/B] ØĻاŲ„؎اŲ†ØĻ اŲ„ØđŲ„ŲˆŲŠ اŲ„ØĢŲŠØģØą Ų…Ų† ØīاØīØŠŲƒ.[CR][CR]ØđŲ†ØŊ اŲ„اŲ†ØŠŲ‡Ø§ØĄØŒ اØķؚط ØđŲ„Ų‰ اŲ„ØēØą [B][COLOR boxeegreenheidi]center[/COLOR][/B]. + ØķØĻØ· ØīاØīØĐ Ø§Ų„ØđØąØķ + Ų‡Ų„ ŲŠŲ…ŲƒŲ†Ųƒ ØąØĪŲŠØĐ Ø§Ų„Ø­ØŊ [B][UPPERCASE][COLOR boxeegreenheidi]green[/COLOR][/UPPERCASE][/B] Ø­ŲˆŲ„ حاŲØĐ ØīاØīØŠŲƒØŸ + ŲØ­Øĩ ØīاØīØĐ Ø§Ų„ØđØąØķ + Ø­ØŊØŊ Ų…ØģØŠŲˆŲ‰ ØŊŲ‚ØĐ Ø§Ų„ØŠŲ„ŲØ§Øē + Ø­ØŊØŊ Ų…ØģØŠŲˆŲ‰ ØŊŲ‚ØĐ Ø§Ų„ØŠŲ„ŲØ§Øē Ų„Ų„ØŠØĢŲƒØŊ Ų…Ų† ØĢŲ† Boxee ŲŠŲ‚ØŊŲ… ØĢŲØķŲ„ ØĩŲˆØąØĐ Ų…Ų…ŲƒŲ†ØĐ. + ØĨØđØŊاØŊ ØīاØīØĐ Ø§Ų„ØđØąØķ + ŲŠØ­ØŠØ§ØŽ Boxee ØĨŲ„Ų‰ اŲ„ا؊ØĩاŲ„ ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ ح؊Ų‰ ؊؊Ų…ŲƒŲ† Ų…Ų† ØĨØđØŊاØŊŲ‡. + [B][UPPERCASE]Ų…ØąØ­ØĻاŲ‹[/UPPERCASE] ŲŲŠ[/B] + اŲ†ØķŲ… + اŲ„Ų„ØšØĐ + Ø­ØŊØŊ Ų„ØšØĐ Ø§Ų„ŲˆØ§ØŽŲ‡ØĐ: + ŲŠØĻØŊŲˆ ØŽŲŠØŊا؟ + Ų…ØąØ­ØĻا! + ŲŲŠ ØšØķŲˆŲ† ØŊŲ‚ŲŠŲ‚ØĐ ŲˆØ§Ø­ØŊØĐ، ØģŲŠŲƒŲˆŲ† ØĻŲ…Ų‚ØŊŲˆØąŲƒ ØŠØīØšŲŠŲ„ ØĒŲ„اŲ اŲ„ØĢŲŲ„اŲ…ØŒ اŲ„ØđØąŲˆØķ ŲˆØ§Ų„Ų…Ų‚اطØđ Ų…Ų† اŲ„ØĨŲ†ØŠØąŲ†ØŠ ŲˆØ§Ų„ØīØĻŲƒØĐ Ø§Ų„ØąØĶØģŲŠØģØĐ Ø§Ų„ØŪاØĩØĐ ØĻŲƒ.[CR][CR]اØķؚط ØđŲ„Ų‰ ØēØą Ų…ØąŲƒØē [UPPERCASE][COLOR boxeegreenheidi][B] [/UPPERCASE][/COLOR][/B] ØđŲ„Ų‰ اŲ„ØąŲŠŲ…ŲˆØŠ اŲ„ØŪاØĩ ØĻŲƒ Ų„ØĻØŊØĄ اŲ„ØŠØīØšŲŠŲ„. + ØĻØŊØĄ + [UPPERCASE]اŲ„Ų„ØšØĐ[/UPPERCASE] + ØđŲ„ŲŠŲƒ ØĢŲ† ØŠØŪØŠØ§Øą Ų„ØšØĐ + ØŠØđØ°Øą ØķØĻØ· اŲ„Ų„ØšØĐ + [COLOR green]%s[/COLOR] ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą + اŲ„ØīØĻŲƒØĐ ØŠØŠØ·Ų„ØĻ ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą + Ų…ØģØŠŲˆŲ‰ اŲ„ØŊŲ‚ØĐ + اØŪØŠØą ØŊŲ‚ØĐ Ø§Ų„ØđØąØķ: + Ų‡Ų„ ØŠØąŲ‰ Ų‡Ø°Ø§ اŲ„ØđØąØķ ØĻØīŲƒŲ„ ØĩØ­ŲŠØ­ØŸ + ØđŲ„ŲŠŲƒ ØĢŲ† ØŠØŪØŠØ§Øą اŲ„ØŊŲ‚ØĐ + ØĢŲØķŲ„ ØĻØķØĻØ· اŲ„ØīاØīØĐ ØĻØīŲƒŲ„ ØĩØ­ŲŠØ­. ØĻØģŲŠØ·ØĐ: + اØģØŠØŪØŊاŲ… ØŽŲ‡Ø§Øē اŲ„؊حŲƒŲ… ØđŲ† ØĻØđØŊ Ų„Ų…حاذاØĐ Ø§Ų„ØģŲ‡Ų… # 1 ØĨŲ„Ų‰ اŲ„ØēاŲˆŲŠØĐ Ø§Ų„ŲŠØģØąŲ‰ ØĢØđŲ„Ų‰ اŲ„ØīاØīØĐ. + اØķؚط ØđŲ„Ų‰ ؊حØŊŲŠØŊ ØĻØŽŲ‡Ø§Øē اŲ„؊حŲƒŲ… ØđŲ† ØĻØđØŊ ØđŲ†ØŊŲ…ا ŲŠŲƒŲˆŲ† ØŽŲŠØŊا. + ŲƒØąØą ØĻاŲ„ØģŲ‡Ų… # 2 ŲŲŠ ØĢØģŲŲ„ اŲ„ŲŠŲ…ŲŠŲ†. + ŲŠØĻØŊŲˆ ØŽŲŠØŊا! + [UPPERCASE]اŲ„ØŊŲ‚ØĐ[/UPPERCASE] + ØķØĻØ· اŲ„ØĩŲˆØŠ + اØŪØŠØą ØŪØąØŽ اŲ„ØĩŲˆØŠ اŲ„ØŪاØĩ ØĻŲƒ: + HDMI + ØĻØĩØąŲŠ + ØĢØģØŠØąŲŠŲˆ Ų‚ŲŠØ§ØģŲŠ + ØŠŲ… اŲ„ا؊ØĩاŲ„ ØĻŲ†ØŽØ§Ø­ ØĨŲ„Ų‰ اŲ„ØīØĻŲƒØĐ + ØŠŲ… اŲ„ا؊ØĩاŲ„ ØĻŲ†ØŽØ§Ø­ ØĨŲ„Ų‰ اŲ„ØīØĻŲƒØĐ Ø§Ų„Ų„اØģŲ„ŲƒŲŠØĐ + ØģŲ„Ųƒ ØĨŲŠØŦØąŲ†ØŠ ØšŲŠØą Ų…ŲˆØĩŲ„. + ØģŲ„Ųƒ اŲ„ØĨŲŠØŦØąŲ†ØŠ Ų…ØŠØĩŲ„ØŒ ŲˆŲ„ŲƒŲ† Ų„ا ŲŠŲ…ŲƒŲ† اŲ„ا؊ØĩاŲ„ ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ. + ØŠØđØ°Øą ØŠŲ‡ŲŠØĶØĐ Ø§Ų„ØīØĻŲƒØĐ Ø§Ų„Ų„اØģŲ„ŲƒŲŠØĐ + حاŲˆŲ„ Ų…ØąØĐ ØĢØŪØąŲ‰ + + Ų‡Ų„ Ų„ØŊŲŠŲƒ ØŽŲ‡Ø§Øē اŲ„اØģØŠŲ‚ØĻاŲ„ ØŊŲˆŲ„ØĻŲŠ ØąŲ‚Ų…ŲŠ ŲˆDTS؟ + Ų†ØđŲ… + Ų„ا + Ų„ØģØŠ Ų…ØŠØĢŲƒØŊا + [UPPERCASE]ØĨØđØŊاØŊا؊ اŲ„ØĩŲˆØŠ[/UPPERCASE] + ØđŲ„ŲŠŲƒ ØĢŲ† ØŠØŪØŠØ§Øą ØŪØąØŽ اŲ„ØĩŲˆØŠ + ØđŲ„ŲŠŲƒ ØĢŲ† ؊حØŊØŊ ØŪŲŠØ§Øą DTS ŲˆØŊŲˆŲ„ØĻŲŠ اŲ„ØąŲ‚Ų…ŲŠ + [UPPERCASE]اØŪØŠØĻØ§Øą اŲ„ØĩŲˆØŠ[/UPPERCASE] + Ų‡Ų„ ØŠØģŲ…Øđ Ų…ŲˆØģŲŠŲ‚Ų‰ Ų„ØĒŲ† Ų…Ų† اŲ„Ų…ŲƒØĻØą[CR]؟ + + ØŠØĻØŊŲŠŲ„ ØĨŲ„Ų‰ اŲ„ØĨŲŠØŦØąŲ†ØŠ + + ØŠŲ… ؊حØŊŲŠØŊ ØđŲ†ŲˆØ§Ų† ØĻØąŲˆØŠŲˆŲƒŲˆŲ„ ØĨŲ†ØŠØąŲ†ØŠ ØšŲŠØą ØĩاŲ„Ø­. + + ØŽØ§ØąŲŠ اŲ„؊حŲ‚Ų‚... + اŲ„؊اŲ„ŲŠ + ØŠØđØ°Øą ØŠØąŲ‚ŲŠØĐ Ø§Ų„؊حŲ…ŲŠŲ„. + Ų†ØŽØ­ ØŠØąŲ‚ŲŠØĐ Ø§Ų„؊حŲ…ŲŠŲ„.[CR]Ų…Ø·Ų„ŲˆØĻ ØĨØđاØŊØĐ Ø§Ų„ØŠØīØšŲŠŲ„ + ØŠŲ…Ų‡ŲŠØŊ + ØĨØđاØŊØĐ Ø§Ų„ØŠØīØšŲŠŲ„... + + ØģŲ„ŲƒŲŠ + ØŠŲ… اŲ„ا؊ØĩاŲ„ ØĻاŲ„ØīØĻŲƒØĐ[CR]ØĻاØģØŠØŪØŊاŲ… ŲƒØ§ØĻŲ„ ØĨŲŠØŦØąŲ†ØŠ ØģŲ„ŲƒŲŠ. + ŲƒŲŠŲ ØŠØąØšØĻ ŲŲŠ ØŠŲ‡ŲŠØĶØĐ ØīØĻŲƒØĐ[CR]؟ + ØŠŲ„Ų‚اØĶŲŠØ§ + ŲŠØŊŲˆŲŠØ§Ų‹ + اŲ„ØŠØĻØŊŲŠŲ„ ØĨŲ„Ų‰ اŲ„Ų„اØģŲ„ŲƒŲŠ + ØŠØđØ°Øą اŲ„ØŠŲˆØĩŲŠŲ„ ØđØĻØąØ§Ų„ØĨŲŠØŦØąŲ†ØŠ + ŲŠØŽØĻ ØđŲ„ŲŠŲƒ ؊حØŊŲŠØŊ ØŪŲŠØ§Øą + [UPPERCASE]ØģŲ„ŲƒŲŠ[/UPPERCASE] + Ų„اØģŲ„ŲƒŲŠ + اØŪØŠŲŠØ§Øą ØīØĻŲƒØĐ Ų„اØģŲ„ŲƒŲŠØĐ Ų„Ų„اŲ†ØķŲ…اŲ… + ŲŠØŽØĻ ØđŲ„ŲŠŲƒ اØŪØŠŲŠØ§Øą ØīØĻŲƒØĐ Ø§ØŠØĩاŲ„ Ų„اØģŲ„ŲƒŲŠØĐ + ØĢŲˆ + ØķŲ… ØīØĻŲƒØĐ ØĢØŪØąŲ‰... + Ų…ØŠŲ‚ØŊŲ… + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ ØīØĻŲƒØ§ØŠ Ų„اØģŲ„ŲƒŲŠØĐ + ØĻØ­ØŦ ØđŲ† ØīØĻŲƒØ§ØŠ... + ØŠØđØ°Øą اŲ„ØŠŲˆØĩŲŠŲ„ ØđØĻØą اŲ„Ų„اØģŲ„ŲƒŲŠ + [UPPERCASE]Ų„اØģŲ„ŲƒŲŠ[/UPPERCASE] + ØĨØđØŊاØŊ ØīØĻŲƒØĐ Ø§Ų„ا؊ØĩاŲ„ + ØđŲ†ŲˆØ§Ų† IP + Ų‚Ų†Ø§Øđ اŲ„ØīØĻŲƒØĐ + ØĻŲˆØ§ØĻØĐ Ø§ŲØŠØąØ§ØķŲŠØĐ + Ų…Ų„Ų‚Ų… DNS + HTTP ØĻØąŲˆŲƒØģŲŠ + ØīØĻŲƒØ§ØŠ Ų„اØģŲ„ŲƒŲŠØĐ + ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą Ų„اØģŲ„ŲƒŲŠØĐ + ØŪØĩŲˆØĩŲŠØĐ Ų„اØģŲ„ŲƒŲŠØĐ + ØŠØĢŲƒŲŠØŊ + [COLOR green]%s[/COLOR] ؊؊طŲ„ØĻ ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą + ØĨØļŲ‡Ø§Øą ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą + ŲŠØĻØŊØĢ + Ų…Ų†Ø° ØŠØīŲŠŲŠØŊ اŲ„Ų…ØąØĻØđ اŲ„ØŪاØĩ ØĻŲƒØŒ ØŠŲ… ØŠŲ‚ØŊŲŠŲ… Ų†ØģØŪØĐ ØŽØŊŲŠØŊØĐ Ų…Ų† ØĻØąŲ†Ø§Ų…ØŽ Boxee.[CR]ŲŲ„Ų†ØąŲ‚ŲŠ! + اØŪØŠØą ØĢŲ…Ų† اŲ„ØīØĻŲƒØĐ Ø§Ų„Ų„اØģŲ„ŲƒŲŠØĐ + Ų…ØđاŲ„ØŽ + ØģŲ„Ųƒ اŲ„ØĨŲŠØŦØąŲ†ØŠ Ų…ØŠØĩŲ„ØŒ Ų„ŲƒŲ† ØŠØđØ°Øą ŲŲŠ اŲ„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ ا؊ØĩاŲ„ ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ. + ØŠŲ… ØŠŲˆØĩŲŠŲ„ ØīØĻŲƒØĐ Ų„اØģŲ„ŲƒŲŠØĐ، ŲˆŲ„ŲƒŲ† ØŠØđØ°Øą اŲ„ŲˆØĩŲˆŲ„ ØĨŲ„Ų‰ ا؊ØĩاŲ„ ØĨŲ†ØŠØąŲ†ØŠ. + حاŲˆŲ„ Ų…ØąØĐ ØĢØŪØąŲ‰ + اŲ„ØŠØĻØŊŲŠŲ„ ØĨŲ„Ų‰ اŲ„Ų„اØģŲ„ŲƒŲŠ + + + Ų…Ų„Ų‚Ų… SMB + ØŠŲ…ŲƒŲŠŲ† Ų…ØīØ§ØąŲƒØĐ Ų…Ų„Ų ŲˆŲŠŲ†ØŊŲˆØē + - Ų…ØīØ§ØąŲƒØĐ ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą (اØģŲ… اŲ„Ų…ØŠØģØŪØŊŲ…: اŲ„ØķŲŠŲ) + -Ų…ØīØ§ØąŲƒØĐ Ų…ØŽŲ…ŲˆØđØĐ Ø§Ų„ØđŲ…Ų„ + - اØģŲ… اŲ„Ų…ØķŲŠŲ + اŲ„ØŠŲˆŲ‚ŲŠØŠ اŲ„ØēŲ…Ų†ŲŠ + ØŊŲˆŲ„ØĐ Ø§Ų„ØŠŲˆŲ‚ŲŠØŠ اŲ„ØēŲ…Ų†ŲŠ + Ų…ØŊŲŠŲ†ØĐ Ø§Ų„ØŠŲˆŲ‚ŲŠØŠ اŲ„ØēŲ…Ų†ŲŠ + ØđŲ†ŲˆØ§Ų† WiFi MAC + ØđŲ†ŲˆØ§Ų† MAC ØĨŲŠØŦØąŲ†ØŠ + اŲ„ØŽŲ‡Ø§Øē + اŲ„ØąŲ‚Ų… اŲ„ØŠØģŲ„ØģŲ„ŲŠ Ų„Ų„ØŽŲ‡Ø§Øē + ØĨØĩØŊØ§Øą اŲ„ØŽŲ‡Ø§Øē + + ØŠØĻØŊŲŠŲ„ ØĨŲ„Ų‰ اŲ„ØĨŲŠØŦØąŲ†ØŠ + ØķØĻØ· اŲ„ØĨØđØŊاØŊا؊... + ØŠŲ†ØēŲŠŲ„ اŲ„ØĒŲ† + %d ØŊŲ‚ŲŠŲ‚ØĐ Ų…ØŠØĻŲ‚ŲŠØĐ + ØĢŲ‚Ų„ Ų…Ų† ØŊŲ‚ŲŠŲ‚ØĐ Ų…ØŠØĻŲ‚ŲŠØĐ + ØģŲˆŲ ŲŠØĻØŊØĢ اŲ„؊حØŊŲŠØŦ اŲ„ØĒŲ†ØŒ ØŪŲ„اŲ„ Ø°Ų„Ųƒ[CR]ØģŲˆŲ ŲŠŲ‚ŲˆŲ… Box اŲ„ØŪاØĩ ØĻŲƒ ØĻØŠŲ…Ų‡ŲŠØŊ اŲ„ØđØŊŲŠØŊ Ų…Ų† اŲ„ØĢŲˆŲ‚ا؊. + ØŽØ§ØąŲŠ اŲ„Ø­ØģاØĻ... + + VPN + Ų†ŲˆØđ اŲ„ا؊ØĩاŲ„ + PPTP + اŲ„Ų…Ų„Ų‚Ų… + اŲ„Ø­ØģاØĻ + ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą + اŲ„ØŠØīŲŲŠØą Ų…Ø·Ų„ŲˆØĻ + ØŽØ§ØąŲŠ اŲ„ا؊ØĩاŲ„... + Ų‚Ø·Øđ اŲ„ا؊ØĩاŲ„... + %s + اŲ„ا؊ØĩاŲ„ ØĻŲ€ VPN.... + Ų‚Ø·Øđ اŲ„ا؊ØĩاŲ„ ØđŲ† VPN؟ + ØŠØđØ°Øą اŲ„ا؊ØĩاŲ„ ØĻŲ€ VPN. + اŲ„ØĻØ·Ø§ØąŲŠØĐ ØŪاØĩØŠŲƒ ØđŲ† ØĻØđØŊ Ų‚ŲŠØŊ اŲ„ØŠØīØšŲŠŲ„ اŲ„ØĒŲ†. + + ØĻØŊØĄ Ų…ØđاŲ„ØŽ ØĨØđØŊاØŊا؊ اŲ„ØīØĻŲƒØĐ... + Ų…ØŠŲ‚ØŊŲ… + + ØąŲØķ اŲ„ØŽŲ‡Ø§Øē + ØŠŲ…ŲƒŲŠŲ† ØŠØŊŲŲ‚ اŲ„ŲŲŠØŊŲŠŲˆ Ų…Ų† ØĢØŽŲ‡ØēØĐ iOS + اŲ„ØģŲ…اح ØĻŲ…ØąØ§Ų‚ØĻØĐ Boxee ØđØĻØą ØīØĻŲƒØĐ Ų…Ø­Ų„ŲŠØĐ + ØŠØīØšŲŠŲ„ + ØŠØŪØĩŲŠØĩ Boxee + + Ų…Ø·Ų„ŲˆØĻ ØĨØđاØŊØĐ Ø§Ų„ØŠØīØšŲŠŲ„ Ų„ØŠŲØđŲŠŲ„ اŲ„ØĨØđØŊاØŊا؊.[CR]Ų‡Ų„ ØŠØąØšØĻ ŲŲŠ ØĨØđاØŊØĐ Ø§Ų„ØŠØīØšŲŠŲ„ اŲ„ØĒŲ†ØŸ + + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ ØŠØąŲƒ Ų‡Ø°Ø§ اŲ„ŲŲŠØŊŲŠŲˆØŸ ØąØĻŲ…ا ØŠŲ… ŲŲ‚ØŊ ØŠŲ‚ØŊŲ…Ųƒ. + Ų„ا ØŠØđØąØķ Ų‡Ø°Ų‡ اŲ„ØąØģاŲ„ØĐ Ų…ØąØĐ ØĢØŪØąŲ‰ + ØĢØŪØĻØąŲ†ŲŠ Ų‚ØĻŲ„ ØĨØšŲ„اŲ‚ اŲ„ŲŲŠØŊŲŠŲˆ + ØĻŲ‚Ø§ØĄ + ØŠØąŲƒ + اذŲ‡ØĻ ØĨŲ„Ų‰ اŲ„Ų…ØģØŠØđØąØķ + Ų…Ø­Ųˆ Ų…ŲˆØ§ØŊ Ų…ØīØŠØąŲƒØĐ Ų…Øđ Adobe Flash... + Ų…Ø­Ųˆ Ų…ŲˆØ§ØŊ Ų…ØīØŠØąŲƒØĐ Ų…Øđ Adobe Flash؟ + + + + [B]ØĻاŲ„Øš[/B] + ا؎؊Ų…اØđŲŠ + Ų…ŲˆØģŲŠŲ‚Ų‰ + [B]اŲ„Ų†ØļاŲ…[/B] + [B]اŲ„ŲˆØģاØĶØ·[/B] + [B]اŲ„ØīØĻŲƒØĐ[/B] + [B]ØđاŲ…[/B] + Ų…ØŠŲ‚ØŊŲ… + اŲ„ØĢØŽŲ‡ØēØĐ + ØąØĶŲŠØģŲŠ + + + اŲ„ØđØąØĻŲŠØĐ + اŲ„ØĻŲ„Ø·ŲŠŲ‚ŲŠØĐ + ØĢŲˆØąŲˆØĻا اŲ„ŲˆØģØ·Ų‰ + اŲ„ØĩŲŠŲ†ŲŠØĐ Ø§Ų„Ų…ØĻØģØ·ØĐ (GBK) + اŲ„ØĩŲŠŲ†ŲŠØĐ Ø§Ų„ØŠŲ‚Ų„ŲŠØŊŲŠØĐ (Big5) + اŲ„ØģŲŠØąŲŠŲ„ŲŠØĐ + اŲ„ŲŠŲˆŲ†Ø§Ų†ŲŠØĐ + اŲ„ØđØĻØąŲŠØĐ + اŲ„ŲƒØ§Ų†ØŠŲˆŲ†ŲŠØĐ (Big5 HKSCS) + اŲ„ŲŠØ§ØĻاŲ†ŲŠØĐ (Shift JIS) + اŲ„ŲƒŲˆØąŲŠØĐ + اŲ„؊اŲŠŲ„اŲ†ØŊŲŠØĐ + اŲ„ØŠØąŲƒŲŠØĐ + اŲ„ŲŲŠØŠŲ†Ø§Ų…ŲŠØĐ + ØĢŲˆØąŲˆØĻا اŲ„ØšØąØĻŲŠØĐ + Unicode (UTF-8) + + اŲ„Ų‚اØĶŲ…ØĐ + ØđØąØķ اŲØŠØąØ§ØķŲŠ Ų„Ų„ØđØąŲˆØķ + ØđØąØķ اŲØŠØąØ§ØķŲŠ Ų„Ų„ØĢŲŲ„اŲ… + ØđØąØķ اŲØŠØąØ§ØķŲŠ Ų„Ų„؊طØĻŲŠŲ‚ا؊ + ØŠŲØķŲŠŲ„ا؊ + Ų…Ų„ŲØ§ØŠ + اŲ„ŲƒŲ„ + + + ŲØ­Øĩ اŲ„ØĻŲƒØģŲ„ا؊ اŲ„Ų…ØđŲŠØĻØĐ... + ŲØ­Øĩ اŲ„ØĻŲƒØģŲ„ا؊ اŲ„Ų…ØđŲŠØĻØĐ + ؊حØŊŲŠØŊ ØđØąØķ اŲ„Ų„ŲˆŲ†: + ØĢØ­Ų…Øą + ØĢØŪØķØą + ØĢØēØąŲ‚ + ØĢØĻŲŠØķ + ØĢØģŲˆØŊ + ØŊŲˆØąŲŠ... + ØģŲ„ŲˆŲƒ ØēØą ØĢØđŲ„Ų‰ ØđŲ† ØĻØđØŊ + ØŠØīØšŲŠŲ„/ØĨŲŠŲ‚اŲ Ų…ØĪŲ‚ØŠ + + + Ų…ØģØŠŲˆŲ‰ ØĢØģŲˆØŊ + PC [0..255] + VIDEO [16..235] + + + - ŲˆØķØđ ØŦŲ„اØŦŲŠ اŲ„ØĢØĻØđاØŊ Ų†ØīØ· حاŲ„ŲŠØ§Ų‹ + Ų„ا ØīŲŠØĄ + ؎اŲ†ØĻ/؎اŲ†ØĻ + ØĢØđŲ„Ų‰/؊ح؊ + ØŠŲ„ŲØ§Øē Ų…ØŠŲˆØ§ŲŲ‚ Ų…Øđ ØĨØ·Ø§Øą ØŦŲ„اØŦŲŠ اŲ„ØĢØĻØđاØŊ (؎اŲ†ØĻ/؎اŲ†ØĻ ØĢŲˆ ØĢØđŲ„Ų‰/؊ح؊) + + + Ų…Ø­Ųˆ ØĻŲŠØ§Ų†Ø§ØŠ Netflix... + ØĨŲ„ØšØ§ØĄ ØŠŲ†ØīŲŠØ· VUDU... + اŲ„ØŪØŊŲ…ا؊ + Ų„ا ØŠŲˆØŽØŊ ØŪØŊŲ…ا؊ Ų„ØŠŲƒŲˆŲŠŲ†Ų‡Ø§. + Ų…Ø­Ųˆ ØĻŲŠØ§Ų†Ø§ØŠ اŲ„ØŪØŊŲ…ØĐ؟ + ESN Ų„ØŽŲ‡Ø§Øē Netflix + + + Ų†ØĢØģŲØŒ ØŠØđØ°Øą ØđŲ„ŲŠŲ†Ø§ اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ اŲ„ØĩŲØ­ØĐ Ø§Ų„ØŠŲŠ ŲƒŲ†ØŠ ØŠØĻØ­ØŦ ØđŲ†Ų‡Ø§. + Ų…ŲØķŲ„ØĐ ŲØ§ØąØšØĐ + Ų…Ø­Ųˆ Ų…Ų„ŲØ§ØŠ اŲ„Ø§ØąØŠØĻاط... + Ų…Ø­Ųˆ اŲ„ذاŲƒØąØĐ Ø§Ų„Ų…ØĪŲ‚ØŠØĐ... + اŲ„Ų…ØģØŠØđØąØķ + Ų…Ø­Ųˆ Ų…Ų„ŲØ§ØŠ Ø§ØąØŠØĻاط اŲ„Ų…ØģØŠØđØąØķ؟ + Ų…Ø­Ųˆ اŲ„ذاŲƒØąØĐ Ø§Ų„Ų…ØĪŲ‚ØŠØĐ Ų„Ų„Ų…ØģØŠØđØąØķ؟ + + + ؎اŲ‡Øē Ų„Ų„Ų…ØīاŲ‡ØŊØĐ + اŲ„ŲƒŲ„ + ØŠŲØķŲŠŲ„ا؊ + Ų…Ø­Ų„ŲŠ + اØīØŠØąØ§ŲƒØ§ØŠ + + + Ų…ØŪØēŲ† اŲ„ØĢŲŲ„اŲ… + اŲ„ŲƒŲ„ + + + Ų…ØŪØēŲ† اŲ„ØđØąŲˆØķ + اŲ„ŲƒŲ„ + Ų…ØŪØēŲ† اŲ„؊طØĻŲŠŲ‚ا؊ + + ØđØąØķ + ØđŲ†Ø§ŲˆŲŠŲ† + ØŊŲ‚اØĶŲ‚ + Ų…Ų„ŲØ§ØŠ اŲ„ŲŲŠØŊŲŠŲˆ اŲ„Ų…ØīØŠØąŲƒØĐ + Ų…Ų„ŲØ§ØŠ اŲ„ŲŲŠØŊŲŠŲˆ + ØŠØđØ°Øą اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų†ØŠØ§ØĶØŽ + + + ØīØąØ§ØĄ + [COLOR green]%s[/COLOR] Ų…ØŠŲˆŲØą[CR]ŲƒØŽØēØĄ Ų…Ų† Ų‡Ø°Ų‡ اŲ„Ø­ØēŲ… Ų…Ų† %s: + اŲ†Ų‚Øą Ų„Ų…ØēŲŠØŊ Ų…Ų† اŲ„Ų…ØđŲ„ŲˆŲ…ا؊ + ŲØīŲ„ ŲŲŠ اŲ„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ ØĻŲŠØ§Ų†Ø§ØŠ Ų…Ų† اŲ„Ų…Ų„Ų‚Ų…. + ØđŲˆØŊØĐ + اŲ„Ø­ØēŲ…ØĐ + Ų‡Ų„ ØŠŲ‚ØĻŲ„ اŲ„ØīØąŲˆØ·ØŸ + ØģŲŠØŠŲ… ؊حŲ…ŲŠŲ„Ųƒ %s Ų„ŲƒŲ„ %s. ŲŠŲ…ŲƒŲ†Ųƒ اŲ„ØĨŲ„ØšØ§ØĄ ŲŲŠ[CR]ØĢŲŠ ŲˆŲ‚ØŠ ØđŲ† Ø·ØąŲŠŲ‚ ØĨØŊØ§ØąØĐ Ø§ØīØŠØąØ§ŲƒŲƒ ØđŲ„Ų‰ Ų…ŲˆŲ‚Øđ اŲ„ŲˆŲŠØĻ اŲ„ØŪاØĩ ØĻŲ†Ø§[CR]www.boxee.tv + Ų„Ų‚ØŊ Ų‚ØąØĢØŠ اŲ„ØĢØ­ŲƒØ§Ų… ŲˆØ§Ų„ØīØąŲˆØ· + اŲ„ØĢØ­ŲƒØ§Ų… ŲˆØ§Ų„ØīØąŲˆØ· + ŲŠØŽØĻ ØđŲ„ŲŠŲƒ Ų‚ØĻŲˆŲ„ اŲ„ØĢØ­ŲƒØ§Ų… ŲˆØ§Ų„ØīØąŲˆØ· Ų„Ų„Ų…؊اØĻØđØĐ. + ØĢŲ‚ØĻŲ„ + ØĢØąŲØķ + اŲ„ØąØŽØ§ØĄ ØĨØŊØŪاŲ„ ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą Boxee + ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą + Ø­Ų‚Ų„ ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą Boxee ŲØ§ØąØš. + ØĨØļŲ‡Ø§Øą ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą + اØģØŠŲ…Øą + ØŠØđØ°Øą ØĨØŠŲ…اŲ… ØđŲ…Ų„ŲŠØĐ Ø§Ų„ØīØąØ§ØĄ + Boxee Ų„ŲŠØģ Ų„ØŊŲŠŲ‡Ø§ ØĻŲŠØ§Ų†Ø§ØŠ اŲ„ØŊŲØđ. + ŲŠØąØŽŲ‰ اŲ„اŲ†ØŠØļØ§Øą... + ØģØĢŲØđŲ„ Ų‡Ø°Ø§ Ų„احŲ‚ا + ØĢØąØģŲ„ØŠ Boxee ØąØ§ØĻØ· ØĨŲ„Ų‰ %s Ų„ØĨØŠŲ…اŲ… اŲ„Ų…ØđاŲ…Ų„ا؊ ØđŲ„Ų‰ اŲ„اŲ†ØŠØąŲ†ØŠ. + Ų„Ų‚ØŊ Ø­ØŊØŊØŠ ŲƒŲ„ ØīŲŠØĄ! + ØīاŲ‡ØŊ اŲ„ØĒŲ† + ØŠØđØ°Øą ØŠŲ†ŲŲŠØ° Ų‡Ø°Ø§ اŲ„ØđŲ…Ų„ + Ų„ا ŲŠŲˆØŽØŊ ا؊ØĩاŲ„ ØĨŲ†ØŠØąŲ†ØŠ.[CR]Boxee ØšŲŠØą Ų…ØŠØĩŲ„ اŲ„ØĒŲ†. + ØŠŲ… اØģØŠØđاØŊØĐ Ø§ØŠØĩاŲ„ اŲ„ØĨŲ†ØŠØąŲ†ØŠ.[CR]Boxee Ų…ØŠØĩŲ„ اŲ„ØĒŲ†. + Ų„ا ŲŠŲˆØŽØŊ ا؊ØĩاŲ„ ØĨŲ†ØŠØąŲ†ØŠ + + Ų…ØđŲ„ŲˆŲ…ا؊ ØģØąŲŠØđØĐ + اŲ†Ų‚Øą ŲŲˆŲ‚ ØēØą "اŲ„Ų‚اØĶŲ…ØĐ" Ų„Ų„اŲ†ØŠŲ‚اŲ„ ØĨŲ„Ų‰ اŲ„ŲˆØąØ§ØĄØŒ ŲˆØĨØ·Ų„اŲ‚ Ų‚اØĶŲ…ØĐ Boxee. + اØķؚط ØđŲ„ŲŠŲ‡Ø§ اŲ„ØĒŲ† Ų„ØĨØšŲ„اŲ‚ Ų‡Ø°Ų‡ اŲ„Ų†Ø§ŲØ°ØĐ. + ŲŠŲ…ŲƒŲ† اØģØŠØŪØŊاŲ… ØēØą "Ų‚اØĶŲ…ØĐ" Ų„Ų„ØŠŲ†Ų‚Ų„ Ų„Ų„ØŪŲ„Ų ŲˆØĢŲŠØķاŲ‹ Ų„ØŠØīØšŲŠŲ„ Ų‚اØĶŲ…ØĐ Boxee. [CR][CR][B][COLOR blue]اØķؚط ØđŲ„ŲŠŲ‡ اŲ„ØĒŲ† Ų„ØĨØšŲ„اŲ‚ Ų‡Ø°Ų‡ اŲ„Ų†Ø§ŲØ°ØĐ. اØķؚط ØđŲ„ŲŠŲ‡ Ų…ØąØĐ ØĢØŪØąŲ‰ Ų„ØŠØīØšŲŠŲ„ Ų‚اØĶŲ…ØĐ Boxee. [/COLOR][/B] + Boxee Ų‡Ųˆ AirPlay Ų…Ų…ŲƒŲ†!اŲ„ØĒŲ† ŲŠŲ…ŲƒŲ†Ųƒ ØĨŲ„Ų‚Ø§ØĄ اŲ„ŲŲŠØŊŲŠŲˆ ŲˆØ§Ų„Ų…ŲˆØģŲŠŲ‚Ų‰ Ų…Ų† iPhone ØĢŲˆ iPad ØĨŲ„Ų‰ ØŽŲ‡Ø§Øē Boxee اŲ„ØŪاØĩ ØĻŲƒ ŲˆØ§Ų„اØģØŠŲ…؊اØđ ØĻŲ‡ Ų…Øđ ŲƒŲ„ ØīØŪØĩ. + + + + اØŪØŠŲŠØ§Øą اŲ„ØŠØąØŽŲ…ا؊ + اŲ„ØŠØąØŽŲ…ا؊... + اØŪØŠØĻØ§Øą ØŠØŊŲŲ‚ اŲ„ØĩŲˆØŠ + ØŠØŊŲŲ‚ اŲ„ØĩŲˆØŠ... + اØŪØŠŲŠØ§Øą Ų…ØŽŲ…ŲˆØđØĐ ØĢØ­ØąŲ اŲ„ØđŲ†ŲˆØ§Ų† اŲ„ŲØąØđŲŠ + Ų…ØŽŲ…ŲˆØđØĐ Ø§Ų„Ø­ØąŲˆŲ... + + + ØĢØŊØŪŲ„ ØđŲ†ŲˆØ§Ų† اŲ„Ų…ŲˆŲ‚Øđ ØĢŲˆ Ų…ØĩØ·Ų„Ø­ اŲ„ØĻØ­ØŦ + Ø§ØŠØąŲƒ اŲ„Ų…ØŠØĩŲØ­ + اØķؚط ØđŲ„Ų‰ "اŲ„Ų‚اØĶŲ…ØĐ" Ų„Ų„ØŪŲŠØ§ØąØ§ØŠ + اŲ„Ų…ØģØŠØđØąØķ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ اŲ„ØŪØąŲˆØŽ Ų…Ų† اŲ„Ų…ØģØŠØđØąØķ؟ + ØđŲˆØŊØĐ + ØĨŲ†Ų‡Ø§ØĄ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ ØĨØēاŲ„ØĐ + ØĨØķاŲØĐ Ų…ŲØķŲ„ØĐ + ŲŠŲ…ŲƒŲ† ØĢŲ† ŲŠŲƒŲˆŲ† Ų„ØŊŲŠŲƒ 12 Ų…ŲØķŲ„ØĐ ŲŲ‚Ø· ŲŲŠ boxee اŲ„ØŪاØĩ ØĻŲƒ. + ØĻØąØŽØ§ØĄ ØĨØēاŲ„ØĐ Ų…ŲØķŲ„ØĐ Ų‚ØĻŲ„ ØĨØķاŲØĐ Ų…ŲØķŲ„ØĐ ØŽØŊŲŠØŊØĐ. + ŲØīŲ„ ŲŲŠ ØĨØēاŲ„ØĐ Ø§Ų„Ų…ŲØķŲ„ØĐ. + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ اŲ„ØŪØąŲˆØŽ Ų…Ų† Ų‡Ø°Ø§ اŲ„؊طØĻŲŠŲ‚ØŸ + Ų†ØĢØģŲ! + + اŲ„؊حŲƒŲ… ŲŲŠ اŲ„ØīاØīا؊ اŲ„Ų…Ų†ØĻØŦŲ‚ØĐ + اŲ„Ų…ŲˆŲ‚Øđ Ų…Ø·Ų„ŲˆØĻ Ų„ŲØŠØ­ '%s' + ØģŲ…اح + ØąŲØķ + + + ØąŲ…Øē اŲ„Ų…ØąŲˆØą + ØĢØŊØŪŲ„ ØąŲ…Øē اŲ„Ų…ØąŲˆØą ØĢØđŲ„اŲ‡ ØđŲ„Ų‰ '%s' Ų„اŲ‚ØŠØąØ§Ų† اŲ„ØŽŲ‡Ø§Øē Ų…Øđ Boxee + [COLOR red]ØąŲ…Øē اŲ„Ų…ØąŲˆØą اŲ„Ø°ŲŠ ØĢØŊØŪŲ„ØŠŲ‡ ØšŲŠØą ØĩØ­ŲŠØ­.[CR]ØĻØąØŽØ§ØĄ ØŠŲƒØąØ§Øą اŲ„Ų…حاŲˆŲ„ØĐ.[/COLOR] + [COLOR green]Ų†ØŽØ§Ø­![CR]ØŠŲ…ØŠ ØĨØķاŲØĐ Ø§Ų„ØŽŲ‡Ø§Øē ØĨŲ„Ų‰ اŲ„ØĢØŽŲ‡ØēØĐ Ø§Ų„Ų…Ų‚ØŠØąŲ†ØĐ Ø§Ų„ØŪاØĩØĐ ØĻŲƒ.[/COLOR] + اŲ„ØĢØŽŲ‡ØēØĐ Ø§Ų„Ų…Ų‚ØŠØąŲ†ØĐ + اŲ„ØĢØŽŲ‡ØēØĐ + ØĨØēاŲ„ØĐ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ ØĨŲ„ØšØ§ØĄ اŲ‚ØŠØąØ§Ų† \اŲ„ØŽŲ‡Ø§Øē؟[CR]ØģŲˆŲ ؊ح؊ا؎ ØĨŲ„Ų‰ ØĨØđاØŊØĐ ØŠØąØŪŲŠØĩ '%s' ØĨذا ŲƒŲ†ØŠ ØŠØąŲŠØŊ اØģØŠØŪØŊاŲ…Ų‡ Ų…Øđ Boxee Ų‡Ø°Ø§ Ų…ØąØĐ ØĢØŪØąŲ‰. + ŲØīŲ„ ŲŲŠ ØĨŲ„ØšØ§ØĄ اŲ‚ØŠØąØ§Ų† اŲ„ØŽŲ‡Ø§Øē '%s' + Ų„ا ØŠŲˆØŽØŊ ØĢØŽŲ‡ØēØĐ Ų…Ų‚ØŠØąŲ†ØĐ Ø­Ø§Ų„ŲŠØ§Ų‹ Ų…Øđ Boxee... + + + اØĻØŊØĢ Ų…Øđ Boxee Ų…Ų† ØŪŲ„اŲ„ ØĨŲ†ØīØ§ØĄ Ø­ØģاØĻ ØŽØŊŲŠØŊ ØĢŲˆ ØŠØģØŽŲŠŲ„ اŲ„ØŊØŪŲˆŲ„ Ų…ØģØŠØŪØŊŲ…اŲ‹ Ø­ØģاØĻ Boxee اŲ„حاŲ„ŲŠ اŲ„ØŪاØĩ ØĻŲƒ. + ØŠØģØŽŲŠŲ„ اŲ„ØŊØŪŲˆŲ„ ØĨŲ„Ų‰ Ø­ØģاØĻ Boxee + اŲ„ØĻØąŲŠØŊ اŲ„ØĨŲ„ŲƒØŠØąŲˆŲ†ŲŠ + ØĢØ­ØąŲ ØšŲŠØą ØĩاŲ„Ø­ØĐ + ا؊ØĩŲ„ ØĻØĻØąŲ†Ø§Ų…ØŽ Boxee Ų…Ų† ØŪŲ„اŲ„ Facebook Ų„ØĨŲ†ØīØ§ØĄ Ø­ØģاØĻ ØŽØŊŲŠØŊ ØĻØģØąØđØĐ ŲˆØ§Ø­ØĩŲ„ ØđŲ„Ų‰ ØŠŲˆØĩŲŠØ§ØŠ ØĻŲŲŠØŊŲŠŲˆ Ų…Ų† ØĢØĩØŊŲ‚اØĶŲƒ ŲˆØ§Ų„ØŠŲŠ ŲŠØŠŲ… ØĨØąØģاŲ„Ų‡Ø§ ØŠŲ„Ų‚اØĶŲŠØ§Ų‹ ØĨŲ„Ų‰ ØŠŲ„ŲØ§ØēŲƒ. ŲˆØĨŲ„ا، اŲ…Ų„ØĢ Ø­Ų‚ŲˆŲ„ اŲ„اØīØŠØąØ§Ųƒ ŲˆØ§Øķؚط ØđŲ„Ų‰ اŲ„؊اŲ„ŲŠ. + اŲ„Ų†ŲˆØđ + ØŠØ§ØąŲŠØŪ اŲ„Ų…ŲŠŲ„اØŊ + ØŠŲ‚ØŊŲŠŲ… + Ø­ØŊØŊ اŲ„Ų†ŲˆØđ + Ø°ŲƒØą + ØĢŲ†ØŦŲ‰ + ØĢŲƒØŦØą Ų…Ų† اŲ„ŲƒŲ„اŲ…... + Ų…ØđŲ„ŲˆŲ…ا؊ ØĨØķاŲŲŠØĐ + Ų„Ų‚ØŊ ØĢŲˆØīŲƒØŠ ØđŲ„Ų‰ اŲ„اŲ†ØŠŲ‡Ø§ØĄ. ØŠØģاØđØŊŲƒ Ų‡Ø°Ų‡ اŲ„ØĢØīŲŠØ§ØĄ ØđŲ„Ų‰ ؊حŲ‚ŲŠŲ‚ ŲŲ‡Ų… ØĢŲØķŲ„. Ų„ذا Ų†Ø­Ø§ŲØļ ØđŲ„ŲŠŲ‡ ŲŲŠ ØĢŲ…اŲ† ŲˆŲ„ا Ų†ØīØ§ØąŲƒŲ‡ Ų…Øđ ØĢØ­ØŊ. + اŲ„Ų†ŲˆØđ + اŲ„ØģŲ†ØĐ + اŲ„ØīŲ‡Øą + اŲ„ŲŠŲˆŲ… + اŲ„Ų‚اŲ†ŲˆŲ†ŲŠ...[CR]Ų…Ø·ŲˆŲ„ + Ų„ØĨŲ†Ų‡Ø§ØĄ ØĨØđØŊاØŊ Ø­ØģاØĻ Boxee اŲ„ØŪاØĩ ØĻŲƒØŒ Ų‚Ų… ØĻŲ‚ØĻŲˆŲ„ ØīØąŲˆØ· اŲ„اØģØŠØŪØŊاŲ… ŲˆØģŲŠØ§ØģØĐ Ø§Ų„ØŪØĩŲˆØĩŲŠØĐ. + ØŽØđŲ„ Boxee ا؎؊Ų…اØđŲŠØ§Ų‹ + احØĩŲ„ ØđŲ„Ų‰ ØŠŲˆØĩŲŠØ§ØŠ ØĻŲŲŠØŊŲŠŲˆ Ų…Ų† ØĢØĩØŊŲ‚اØĶŲƒ ŲˆØ§Ų„ØŠŲŠ ŲŠØŠŲ… ØĨØąØģاŲ„Ų‡Ø§ Ų…ØĻاØīØąØĐ ØĨŲ„Ų‰ ØŠŲ„ŲØ§ØēŲƒØŒ ŲˆŲ„ا ŲŠŲŲˆØŠŲƒ ØĢØ­ØŊØŦ ŲŲŠØŊŲŠŲˆ ŲŲŠØąŲˆØģŲŠØŒ ŲˆØīØ§ØąŲƒ ØŠŲØķŲŠŲ„ا؊Ųƒ! + ŲŠØŠØđŲŠŲ† Ų…Ų„ØĄ ŲƒŲ„ اŲ„Ø­Ų‚ŲˆŲ„ Ų„Ų„Ų…؊اØĻØđØĐ. + Ų†ØĢØģŲØŒ ŲŠØŽØĻ ØĢŲ† ŲŠŲƒŲˆŲ† ØđŲ…ØąŲƒ 13 ØđاŲ…اŲ‹ ØđŲ„Ų‰ اŲ„ØĢŲ‚Ų„ ح؊Ų‰ ؊؊Ų…ŲƒŲ† Ų…Ų† ØĨŲ†ØīØ§ØĄ Ø­ØģاØĻ Boxee. ØģŲˆŲ Ų†Ų†ØŠØļØąŲƒ! + ØĨØēاŲ„ØĐ Ø§Ų„Ø­ØģاØĻ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ ØĨØēاŲ„ØĐ [COLOR white]%s[/COLOR] Ų…Ų† Ų‡Ø°Ø§ اŲ„ØŽŲ‡Ø§Øē؟[CR][CR]Ų…Ų„احØļØĐ: Ų„Ų† ŲŠØĪØŊŲŠ Ų‡Ø°Ø§ ØĨŲ„Ų‰ حذŲ اŲ„Ø­ØģاØĻ.ŲŠŲ…ŲƒŲ†Ųƒ ØĨØķاŲØŠŲ‡ ŲŲŠ ØĢŲŠ ŲˆŲ‚ØŠ. + ØķØĻØ· Boxee Ų„ØŊŲŠŲƒ + ØĢØŪØĻØą Boxee ØđŲ…ا ØģŲˆŲ ØŠØīاŲ‡ØŊŲ‡ ŲŲŠ اŲ„ؚاŲ„ØĻ، ŲˆØģŲˆŲ Ų†Ų‚ŲˆŲ… ØĻØŠØŪØĩŲŠØĩ ØŠØŽØąØĻØŠŲƒ ØđŲ† Ø·ØąŲŠŲ‚ ØđØąØķ Ų…Ų‚اطØđ اŲ„ŲŲŠØŊŲŠŲˆ Ų‡Ø°Ų‡ ŲŲŠ Ų…ŲƒØŠØĻا؊ اŲ„ØđØąØķ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ ŲˆØ§Ų„ØĢŲŲ„اŲ….[CR][CR]Ų…Ų„احØļØĐ: ŲŠŲ…ŲƒŲ†Ųƒ ØŊاØĶŲ…اŲ‹ ØŠØšŲŠŲŠØą Ų‡Ø°Ø§ اŲ„ØŠŲØķŲŠŲ„ Ų„احŲ‚اŲ‹ ŲŲŠ Ų‚اØĶŲ…ØĐ "ØĨØđØŊاØŊا؊". + ØĻØŊØĄ اØģØŠØŪØŊاŲ… Boxee + + + + Ų‚اØĶŲ…ØĐ ØīاŲ‡ØŊ Ų„احŲ‚اŲ‹ ØŪاØĩŲƒ ŲØ§ØąØšØĐ. + ØģŲˆŲ ØŠØļŲ‡Øą ØĢØ­ØŊاØŦ ØŽØŊŲŠØŊØĐ Ų…Ų† اŲ„ØđØąŲˆØķ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠØĐ Ø§Ų„ØŠŲŠ ؊حØŊØŊŲ‡Ø§ ŲƒŲ…ŲØķŲ„ØĐ Ų‡Ų†Ø§ØŒ ØĢŲˆ ŲŠŲ…ŲƒŲ†Ųƒ ØĨØķاŲØĐ ØĢŲŠ ŲŲŠØŊŲŠŲˆ ØĻØ·ØąŲŠŲ‚ØĐ ŲŠØŊŲˆŲŠØĐ ØđŲ† Ø·ØąŲŠŲ‚ اŲ„Ų†Ų‚Øą ŲŲˆŲ‚ ØĢŲŠŲ‚ŲˆŲ†ØĐ "ØīاŲ‡ØŊ Ų„احŲ‚اŲ‹". + ŲŠŲ…ŲƒŲ†Ųƒ ØĢŲŠØķاŲ‹ ØĨØķاŲØĐ Ų…Ų„ŲØ§ØŠ ŲŲŠØŊŲŠŲˆ Ų…Ų† اŲ„ŲˆŲŠØĻ. ØŠŲØķŲ„ ØĻØēŲŠØ§ØąØĐ [COLOR yellow]http://www.boxee.tv/watchlater[/COLOR] Ų„Ų„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ ØŠØđŲ„ŲŠŲ…ا؊. + Ų‚Ų… ØĻØĨØķاŲØĐ ØĢØĩØŊŲ‚Ø§ØĄ. + ŲŠŲ…ŲƒŲ†Ųƒ Ų…ØīاŲ‡ØŊØĐ Ų…Ų„ŲØ§ØŠ ŲŲŠØŊŲŠŲˆ ØĻاŲ„اØīØŠØąØ§Ųƒ Ų…Øđ ØĢØĩØŊŲ‚اØĶŲƒ ØđŲ„Ų‰ Facebook Ųˆ Twitter. [CR]Ų‚Ų… ØĻØŠŲ†ØīŲŠØ· Ų‡Ø°Ų‡ اŲ„ØŪاØĩŲŠØĐ Ų…Ų† ØŪŲ„اŲ„ ا؊ØĩاŲ„ Ø­ØģاØĻا؊ Facebook Ųˆ Twitter ØĻŲ€ Boxee. + ØĨØķاŲØĐ ØŠØ·ØĻŲŠŲ‚ Ų…ŲØķŲ„ Ų„ØŊŲŠŲƒ + اŲ†Ų‚Øą ŲŲˆŲ‚ ØĢŲŠŲ‚ŲˆŲ†ØĐ "Ų…ŲØķŲ„ØĐ" Ų‚ØĻŲ„ ØŠØīØšŲŠŲ„ ØĢŲŠ ؊طØĻŲŠŲ‚ Ų„ØĨØķاŲØŠŲ‡ ØĨŲ„Ų‰ Ų…ŲØķŲ„ا؊Ųƒ. + Ų„Ų… ŲŠØļŲ‡Øą ØĢŲŠ ØŠØ§ØąŲŠØŪ ØĻØđØŊ + ØģŲˆŲ ØŠØļŲ‡Øą اŲ„ØđŲ†Ø§ØĩØą اŲ„ØŠŲŠ ØŠØīØšŲ„Ų‡Ø§ ŲŲŠ Ų‡Ø°Ų‡ اŲ„Ų‚اØĶŲ…ØĐ ØĻØ­ŲŠØŦ ŲŠØģŲ‡Ų„ اŲ„ØđØŦŲˆØą ØđŲ„ŲŠŲ‡Ø§ ØđŲ†ØŊŲ…ا ØŠØąŲŠØŊ ØŠØīØšŲŠŲ„Ų‡Ø§ Ų…ØąØĐ ØĢØŪØąŲ‰ Ų„احŲ‚اŲ‹. + Ų„ا ØŠŲˆØŽØŊ ØĩŲˆØą Ų…Ø­Ų„ŲŠØĐ ØĻØđØŊ + Ų„ØđØąØķ اŲ„ØĩŲˆØą اŲ„ØŪاØĩØĐ ØĻŲƒ ØđŲ„Ų‰ Boxee، ØĢØķŲ Ų…ØŽŲ„ØŊاŲ‹ Ų…ØđŲŠŲ†Ø§Ų‹ Ų…Ų† Ų…Ø­ØąŲƒ اŲ„ØĢŲ‚ØąØ§Øĩ اŲ„ØĩŲ„ØĻØĐ ØĢŲˆ Ų…ØĩØŊØą اŲ„ØīØĻŲƒØĐ. + اØģØŠØđØąØ§Øķ ؊طØĻŲŠŲ‚ اŲ„ØĩŲˆØą + ØĨØķاŲØĐ ØđØąØķ Ų…ŲØķŲ„ Ų„ØŊŲŠŲƒ + اŲ†Ų‚Øą ŲŲˆŲ‚ اŲ„ØĢŲŠŲ‚ŲˆŲ†ØĐ "Ų…ŲØķŲ„ØĐ" ØđŲ„Ų‰ ØīاØīØĐ Ø§Ų„ØĢØ­ØŊاØŦ Ų„ØĢŲŠ ØđØąØķ ؊حØĻŲ‡ Ų„ØĨØķاŲØŠŲ‡ ØĨŲ„Ų‰ ØŠŲØķŲŠŲ„ا؊Ųƒ. + Ų„ا ØŠŲˆØŽØŊ Ų…ŲˆØģŲŠŲ‚Ų‰ Ų…Ø­Ų„ŲŠØĐ ØĻØđØŊ + Ų„Ų„اØģØŠŲ…اØđ ØĨŲ„Ų‰ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ اŲ„ØŪاØĩØĐ ØĻŲƒ ØđŲ„Ų‰[CR]Boxee، ØĢØķŲ Ų…ØŽŲ„ØŊاŲ‹ Ų…ØđŲŠŲ†Ø§Ų‹ Ų…Ų† Ų…Ø­ØąŲƒ اŲ„ØĢŲ‚ØąØ§Øĩ[CR]اŲ„ØĩŲ„ØĻØĐ ØĢŲˆ Ų…ØĩØŊØą اŲ„ØīØĻŲƒØĐ. + ØĢŲˆ... + اØģØŠØđØąØ§Øķ اŲ„Ų…ØĩاØŊØą + اØģØŠØđØąØ§Øķ ؊طØĻŲŠŲ‚ا؊ اŲ„Ų…ŲˆØģŲŠŲ‚Ų‰ + Ų„ا ØīŲŠØĄ ØŠØąØ§Ų‡ + ØŠØđØ°Øą ØđŲ„Ų‰ Boxee اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ ØĢŲŠ Ų…Ų„ŲØ§ØŠ ŲŲŠØŊŲŠŲˆ ŲŲŠ Ų‡Ø°Ų‡ اŲ„ŲØĶØĐ ŲˆØ§Ų„ØŠŲŠ ŲŠŲ…ŲƒŲ† ØŠØīØšŲŠŲ„Ų‡Ø§ ŲŲŠ Ų…Ų†Ø·Ų‚ØŠŲƒ. + Ų„ا ØŠŲˆØŽØŊ Ų…Ų„ŲØ§ØŠ ØĻØđØŊ + Ų„Ų„ŲˆØĩŲˆŲ„ ØĨŲ„Ų‰ اŲ„Ų…Ų„ŲØ§ØŠ اŲ„Ų…Ø­Ų„ŲŠØĐ ØđŲ„Ų‰ Boxee، ØĢØķŲ Ų…ØŽŲ„ØŊاŲ‹ Ų…ØđŲŠŲ†Ø§Ų‹ Ų…Ų† Ų…Ø­ØąŲƒ اŲ„ØĢŲ‚ØąØ§Øĩ اŲ„ØĩŲ„ØĻØĐ ØĢŲˆ Ų…ØĩØŊØą اŲ„ØīØĻŲƒØĐ. + Ų„ا ØŠŲˆØŽØŊ ŲˆØģاØĶØ· Ų…Ø­Ų„ŲŠØĐ ØĻØđØŊ + Ų„ØŠØīØšŲŠŲ„ اŲ„ŲˆØģاØĶØ· اŲ„Ų…Ø­Ų„ŲŠØĐ ØđŲ„Ų‰ Boxee، ØĢØķŲ Ų…ØŽŲ„ØŊاŲ‹ Ų…ØđŲŠŲ†Ø§Ų‹ Ų…Ų† Ų…Ø­ØąŲƒ اŲ„ØĢŲ‚ØąØ§Øĩ اŲ„ØĩŲ„ØĻØĐ ØĢŲˆ Ų…ØĩØŊØą اŲ„ØīØĻŲƒØĐ. + PS. ŲˆŲŲ‚اŲ‹ Ų„Ø­ØŽŲ… اŲ„Ų…ØĩØŊØąØŒ Ų‚ØŊ ØŠØģØŠØšØąŲ‚ Boxee ØĻØđØķ اŲ„ŲˆŲ‚ØŠ Ų„Ų…ØģØ­Ų‡ ØĻاŲ„ŲƒØ§Ų…Ų„. + Ų„ا ØŠŲˆØŽØŊ Ų…ØŪاØēŲ† ØĻØđØŊ + اŲ„Ų…ØŪاØēŲ† ØđØĻØ§ØąØĐ ØđŲ† Ų…ŲƒØŠØĻا؊ Ų…Ų† اŲ„؊طØĻŲŠŲ‚ا؊ اŲ„Ų…ØŠŲˆŲØąØĐ Ų…Ų† اŲ„ØĢØ·ØąØ§Ų اŲ„ØŦاŲ„ØŦØĐ. ŲŠŲ…ŲƒŲ†Ųƒ اŲ„ØđØŦŲˆØą ØđŲ„ŲŠŲ‡Ø§ ØđŲ† Ø·ØąŲŠŲ‚ اŲ„ØĻØ­ØŦ ØđŲ„Ų‰ اŲ„ØĨŲ†ØŠØąŲ†ØŠ. + ØĨØķاŲØĐ Ų…ØŪØēŲ† + Ų„ا ŲŠŲˆØŽØŊ Ų…ØĩØŊØą ŲˆØģاØĶØ· Ų…Ø­Ų„ŲŠØĐ ØĻØđØŊ. + Ų„ØŠØīØšŲŠŲ„ اŲ„ŲˆØģاØĶØ· اŲ„Ų…Ø­Ų„ŲŠØĐ ØđŲ„Ų‰ Boxee، ØĢØķŲ Ų…ØŽŲ„ØŊاŲ‹ Ų…ØđŲŠŲ†Ø§Ų‹ Ų…Ų† Ų…Ø­ØąŲƒ اŲ„ØĢŲ‚ØąØ§Øĩ اŲ„ØĩŲ„ØĻØĐ ØĢŲˆ Ų…ØĩØŊØą اŲ„ØīØĻŲƒØĐ. + ØĻŲ…ØŽØąØŊ ØĢŲ† ØŠŲƒŲˆŲ† ؎اŲ‡ØēاŲ‹ Ų„ØĨØķاŲØĐ ŲˆØ§Ø­ØŊ، اŲ†Ų‚Øą ŲŲˆŲ‚ اŲ„ØēØą اŲ„ØģŲŲ„ŲŠ Ų„ØĨØķاŲØĐ URL اŲ„ØŪاØĩ ØĻŲ‡. + ØąØŽØ§ØĄ ØēŲŠØ§ØąØĐ [COLOR yellow]www.boxee.tv/services[/COLOR]. + Boxee ØšŲŠØą Ų…ØŠØĩŲ„... + اŲ„Ų…ح؊ŲˆŲŠ اŲ„Ø°ŲŠ ØŠØąŲŠØŊ ØąØĪŲŠØŠŲ‡ ØšŲŠØą Ų…ØŠŲˆŲØą Ų„ØĢŲ† Boxee ØšŲŠØą Ų…ØŠØĩŲ„ ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ. + Ų…ØđاŲ„ØŽ اŲ„ØīØĻŲƒØĐ + Ų„ا ØŠŲˆØŽØŊ ØĢØ­ØŊاØŦ Ų„Ų„ØđØąØķ. + ØĻŲ„ا ØŠŲØķŲŠŲ„ا؊. + اŲ„Ų…ØģØŠŲˆØŊØđ ŲØ§ØąØš. + Ų„ا ØŠŲˆØŽØŊ ؊طØĻŲŠŲ‚ا؊ Ų…ØŠŲˆŲØąØĐ Ø­Ø§Ų„ŲŠØ§Ų‹ ŲŲŠ Ų‡Ø°Ø§ اŲ„Ų…ØģØŠŲˆØŊØđ. + Ų„ا ØŠŲˆØŽØŊ ØĢŲŲ„اŲ… Ų…ØŠŲˆŲØąØĐ Ų„Ų„Ų…ØąØīØ­ اŲ„حاŲ„ŲŠ. + Ų„ا ؊؊ŲˆŲØą ØŠØąŲŠŲ„Øą ŲŲŠ حاŲ„ØĐ ØđØŊŲ… ا؊ØĩاŲ„ Boxee ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ. + Ų„ا ŲŠŲ…ŲƒŲ† Ų„Ų€ Boxee اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ ØĢŲŠ ØŠØąŲŠŲ„Øą Ų„ØŠØīØšŲŠŲ„Ų‡. + Ų‚Ų… ØĻØđŲ…Ų„ Ų‚اØĶŲ…ØĐ ØŠØīØšŲŠŲ„ Ų„Ų„ØĢŲŲ„اŲ…ØŒ اŲ„ØđØąŲˆØķ ŲˆŲ…Ų„ŲØ§ØŠ ŲŲŠØŊŲŠŲˆ اŲ„ŲˆŲŠØĻ Ų„Ų…ØīاŲ‡ØŊØŠŲ‡Ø§ ŲŲŠ ŲˆŲ‚ØŠ Ų„احŲ‚.[CR][CR]احŲØļ Ų…Ų„ŲØ§ØŠ اŲ„ŲŲŠØŊŲŠŲˆ Ų…Ų† YouTube، ŲˆVimeo ŲˆØ§Ų„ØđØŊŲŠØŊ Ų…Ų† اŲ„Ų…ŲˆØ§Ų‚Øđ اŲ„ØĢØŪØąŲ‰ ØĻاØģØŠØŪØŊاŲ… Boxee Bookmarklet.[CR][CR]Ų‚Ų… ØĻØđŲ…Ų„ Ų…ŲØķŲ„ØĐ Ų„Ų„ØđØąØķ ØĻاØģØŠØŪØŊاŲ… ØēØą Ų†ØŽŲ…ØĐ Ų„ŲŠØŠŲ… ØĨØķاŲØĐ ØĢŲŠ Ø­ØŊØŦ ØŽØŊŲŠØŊ ØŠŲ„Ų‚اØĶŲŠØ§Ų‹ ØĨŲ„Ų‰ اŲ„طاØĻŲˆØą اŲ„ØŪاØĩ ØĻŲƒ. + ØŠØđŲ„Ų… اŲ„Ų…ØēŲŠØŊ ØđŲ† + اØĻØŊØĢ + ØąØ§ØĶØđ! + Ų„Ų‚ØŊ ØĢØąØģŲ„Ų†Ø§ ØŠŲˆØ§Ų‹ ØĻØąŲŠØŊاŲ‹ ØĨŲ„ŲƒØŠØąŲˆŲ†ŲŠØ§Ų‹ ØĨŲ„Ų‰ [COLOR green]%s[/COLOR] Ų…ØŠØķŲ…Ų†Ø§Ų‹ ØĨØąØīاØŊا؊ Ø­ŲˆŲ„ ŲƒŲŠŲŲŠØĐ Ø§Ų„ØĻØŊØĄ. + Ų„ا ØŠŲˆØŽØŊ Ų…ØĩاØŊØą Ų…Ø­Ų„ŲŠØĐ ØĻØđØŊ + Ų„اØģØŠØđØąØ§Øķ اŲ„Ų…ØĩاØŊØą اŲ„Ų…Ø­Ų„ŲŠØĐ ØđŲ„Ų‰ Boxee، ØĢØķŲ Ų…ØŽŲ„ØŊاŲ‹ Ų…ØđŲŠŲ†Ø§Ų‹ Ų…Ų† Ų…Ø­ØąŲƒ اŲ„ØĢŲ‚ØąØ§Øĩ اŲ„ØĩŲ„ØĻØĐ ØĢŲˆ Ų…ØĩØŊØą اŲ„ØīØĻŲƒØĐ. + ØģŲˆŲ ØŠØļŲ‡Øą ØĢØ­ØŊاØŦ ØŽØŊŲŠØŊØĐ Ų…Ų† اŲ„ØđØąŲˆØķ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠØĐ Ø§Ų„ØŠŲŠ ؊حØŊØŊŲ‡Ø§ ŲƒŲ…ŲØķŲ„ØĐ Ų‡Ų†Ø§ØŒ ØĢŲˆ ŲŠŲ…ŲƒŲ†Ųƒ ØĨØķاŲØĐ ØĢŲŠ ŲŲŠØŊŲŠŲˆ ØĻØ·ØąŲŠŲ‚ØĐ ŲŠØŊŲˆŲŠØĐ ØđŲ† Ø·ØąŲŠŲ‚ اŲ„Ų†Ų‚Øą ŲŲˆŲ‚ ØĢŲŠŲ‚ŲˆŲ†ØĐ "ØīاŲ‡ØŊ Ų„احŲ‚اŲ‹".[CR]ŲŠŲ…ŲƒŲ†Ųƒ ØĢŲŠØķاŲ‹ ØĨØķاŲØĐ Ų…Ų„ŲØ§ØŠ ŲŲŠØŊŲŠŲˆ Ų…Ų† اŲ„ŲˆŲŠØĻ. ØŠŲØķŲ„ ØĻØēŲŠØ§ØąØĐ [COLOR yellow]http://www.boxee.tv/watchlater[/COLOR] Ų„Ų„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ ØŠØđŲ„ŲŠŲ…ا؊. + + Ų„ا ØŠŲˆØŽØŊ Ų…ØĩاØŊØą Ų…Ø­Ų„ŲŠØĐ... + Ų„ا ØŠŲˆØŽØŊ ØđŲ†Ø§ØĩØą... + Ų„ا ØŠŲˆØŽØŊ Ų…ØĩاØŊØą ØĻØđØŊ... + اŲ„ŲˆØĩŲˆŲ„ ØĨŲ„Ų‰ Ų…Ų‚اطØđ اŲ„ŲŲŠØŊŲŠŲˆØŒ اŲ„ØĢØšŲ†ŲŠØ§ØŠØŒ ØĢŲˆ اŲ„ØĩŲˆØą Ų…Ų† ØĢØŽŲ‡ØēØĐ Ø§Ų„ŲƒŲ…ØĻŲŠŲˆØŠØą ØĢŲˆ ØĻØąØ§Ų…ØŽ ØŠØīØšŲŠŲ„ اŲ„ØīØĻŲƒØĐ.[CR][CR]Ų„ØĨØķاŲØĐ Ų…ØĩØŊØąØŒ اØģØŠØđØąØķ Ų…Ų„ŲØ§ØŠŲƒ ŲˆØŠŲ†Ų‚Ų„ ØĨŲ„Ų‰ ØŊŲ„ŲŠŲ„ ŲŠØ­ØŠŲˆŲŠ ØđŲ„Ų‰ اŲ„ŲˆØģاØĶØ· اŲ„ØŪاØĩØĐ ØĻŲƒ. ØŦŲ… Ø­ØŊØŊ اŲ„ØēØą [COLOR boxeegreenheidi]+ [/COLOR] Ų…Ų† ØĢØđŲ„Ų‰ ŲŠŲ…ŲŠŲ† اŲ„ØīاØīØĐ. + اŲ„ØĻØ­ØŦ ØđŲ† Ų…Ų‚اطØđ ŲŲŠØŊŲŠŲˆ Ų…ØīØŠØąŲƒØĐ Ų…Øđ اŲ„ØĢØĩØŊŲ‚Ø§ØĄ... + Ų‚ØŊ ŲŠØģØŠØšØąŲ‚ Ų‡Ø°Ø§ ØĻØđØķ اŲ„ŲˆŲ‚ØŠØŒ Ų„ذا ØĻØąØŽØ§ØĄ اŲ„ØĩØĻØą ح؊Ų‰ ŲŠØđŲ…Ų„ Boxee. + ØđŲˆØŊØĐ ØĨŲ„Ų‰ اŲ„ØīاØīØĐ Ø§Ų„ØąØĶŲŠØģŲŠØĐ + + + + ØĢØķŲŠŲ Ų…Ų† + اŲ„ŲˆŲŠØĻ + اŲ„Ų…ŲƒØŠØĻØĐ + اŲ„ŲŠŲˆŲ… + Ų…Ų†Ø° ŲŠŲˆŲ… + Ų…Ų†Ø° ØĢŲŠØ§Ų… + ØđØąØķ اŲ„Ų…ŲØķŲ„ØĐ + اŲ„ØĢŲ…Øģ + اŲ„ØĢŲ‚ØŊŲ… + ØīاŲ‡ØŊ Ų„احŲ‚اŲ‹ + + + Ų…ØīاŲ‡ØŊ + Ų…ØīØšŲ„ + + ØŠØđØ°Øą ØĨØđØŊاØŊ اŲ„ØīØĻŲƒØĐ Ø§Ų„Ų„اØģŲ„ŲƒŲŠØĐ.[CR]ØąØŽØ§ØĄ اŲ„؊حŲ‚Ų‚ Ų…Ų† ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØąŲƒ ŲˆØŠŲƒØąØ§Øą اŲ„Ų…حاŲˆŲ„ØĐ. + ØŠØđØ°Øą اŲ„؊حŲ‚Ų‚ Ų…Ų† ØĩØ­ØĐ ØīŲ‡Ø§ØŊØĐ SSL اŲ„ØŪاØĩØĐ ØĻاŲ„Ų…ŲˆŲ‚Øđ + + + ŲŠŲ†Ø§ŲŠØą + ŲØĻØąØ§ŲŠØą + Ų…Ø§ØąØģ + ØĢØĻØąŲŠŲ„ + Ų…اŲŠŲˆ + ŲŠŲˆŲ†ŲŠŲˆ + ŲŠŲˆŲ„ŲŠŲˆ + ØĢØšØģØ·Øģ + ØģØĻØŠŲ…ØĻØą + ØĢŲƒØŠŲˆØĻØą + Ų†ŲˆŲŲ…ØĻØą + ØŊŲŠØģŲ…ØĻØą + + + اŲØŠØąØ§ØķŲŠ + 57235 + اŲ„ØđØąØĻŲŠØĐ،ara + اŲ„ŲƒØ§ØŠØ§Ų„اŲ†ŲŠØĐ،cat + اŲ„ØĩŲŠŲ†ŲŠØĐ (اŲ„Ų…ØĻØģØ·ØĐ)،chi + اŲ„ØĩŲŠŲ†ŲŠØĐ (اŲ„ØŠŲ‚Ų„ŲŠØŊŲŠØĐ)،zho + اŲ„ŲƒØąŲˆØ§ØŠŲŠØĐ،cos + اŲ„ØŠØīŲŠŲƒŲŠØĐ،ces + اŲ„ØŊاŲ†Ų…ØąŲƒŲŠØĐ،dan + اŲ„ØĢŲ„Ų…اŲ†ŲŠØĐ،deu + اŲ„Ų‡ŲˆŲ„Ų†ØŊŲŠØĐ,dut + اŲ„ØĨŲŠØģØŠŲˆŲ†ŲŠØĐ،est + اŲ„ØĨŲ†ØŽŲ„ŲŠØēŲŠØĐ،eng + اŲ„ŲŲ†Ų„Ų†ØŊŲŠØĐ،fin + اŲ„ŲØąŲ†ØģŲŠØĐ,fra + اŲ„ŲŠŲˆŲ†Ø§Ų†ŲŠØĐ،gre + اŲ„ØđØĻØąŲŠØĐ،heb + اŲ„Ų…ØŽØąŲŠØĐ،hun + اŲ„ØĨŲ†ØŊŲˆŲ†ŲŠØģŲŠØĐ،ind + اŲ„ØĨŲŠØ·Ø§Ų„ŲŠØĐ،ita + اŲ„ŲŠØ§ØĻاŲ†ŲŠØĐ،jpn + اŲ„ŲƒŲˆØąŲŠØĐ،kor + اŲ„Ų„ŲŠØŠŲˆØ§Ų†ŲŠØĐ،lit + اŲ„Ų†ØąŲˆŲŠØŽŲŠØĐ،nor + اŲ„ŲØ§ØąØģŲŠØĐ،fas + اŲ„ØĻŲˆŲ„Ų†ØŊŲŠØĐ،pol + اŲ„ØĻØąØŠØšØ§Ų„ŲŠØĐ،por + اŲ„ØĻØąØŠØšØ§Ų„ŲŠØĐ (اŲ„ØĻØąØ§ØēŲŠŲ„)،por + اŲ„ØąŲˆØģŲŠØĐ،rus + اŲ„ØĩØąØĻŲŠØĐ،srp + اŲ„ØģŲ„ŲˆŲØ§ŲƒŲŠØĐ،slk + اŲ„ØģŲ„ŲˆŲŲŠŲ†ŲŠØĐ،slv + اŲ„ØĢØģØĻاŲ†ŲŠØĐ،spa + اŲ„ØģŲˆŲŠØŊŲŠØĐ،swe + اŲ„ØŠØąŲƒŲŠØĐ،tur + اŲ„ØĢŲˆŲƒØąØ§Ų†ŲŠØĐ،ukr + + اŲ„Ų„ØšØĐ Ø§Ų„Ų…ŲØķŲ„ØĐ + + ØģŲŠØ§ØģØĐ Ø§Ų„؊حŲˆŲŠŲ„ + ØŠŲ„Ų‚اØĶŲŠ + اŲ„ŲŲŠØŊŲŠŲˆ + ŲŲŠŲ„Ų… + Ų…ŲƒØ§Ų†ŲŠ ŲŲ‚Ø· + ØĢŲ‡Ų… Ø­Ų‚Ų„ ŲŲ‚Ø· + ØĢØĻØŊاŲ‹ØŒ ØĨŲ„ا ŲŲŠ حاŲ„ØĐ Ø§Ų„ØŠØŊØąŲŠØŽ + ØĢØĻØŊاŲ‹ + + ØĨŲ„ØšØ§ØĄ ØŠØŊŲˆŲŠØą اŲ„Ų…ØąØīØ­ + Ų…ØąØīØ­ ؚاŲˆØģŲŠ + + اŲ„Ų„ØšØĐ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ ØŠØšŲŠŲŠØą Ų„ؚ؊Ųƒ ØĨŲ„Ų‰ %s?[CR]Ų…Ø·Ų„ŲˆØĻ ØĨØđاØŊØĐ ØŠØīØšŲŠŲ„ Ų„ØŠŲØđŲŠŲ„ اŲ„ØŠØšŲŠŲŠØą. + + + ØđŲ…ŲŠŲ„ AFP + + + + طاØĻŲˆØąŲŠ + Ų…ŲƒØŠØĻØĐ Ø§Ų„ØĢŲŲ„اŲ… + Ų…ŲƒØŠØĻØĐ Ø§Ų„ØđØąŲˆØķ + ØđØąŲˆØķŲŠ + ØšŲŠØą Ų…ØđØąŲ + + + ØŠŲ„ŲØ§Øē Ų…ØĻاØīØą + Ų…ØģØ­ اŲ„Ų‚Ų†ŲˆØ§ØŠ + اŲƒØŠŲ…Ų„ اŲ„Ų…ØģØ­.[CR]ØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ %d Ų‚Ų†ŲˆØ§ØŠ. + اŲƒØŠŲ…Ų„ اŲ„Ų…ØģØ­.[CR]Ų„Ų… ŲŠØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų‚Ų†ŲˆØ§ØŠ. + ŲƒŲ„ اŲ„Ų‚Ų†ŲˆØ§ØŠ + ØŠŲ„ŲØ§Øē Ų…ØĻاØīØą Ų…Ų† Boxee + ØŪŲ„اŲ„ ØŊŲ‚اØĶŲ‚ Ų…ØđØŊŲˆØŊØĐ، ØģŲˆŲ ØŠØģØŠŲ…ØŠØđ ØĻŲ…حطا؊ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠØĐ ŲˆØĨذاØđŲŠØĐ Ų…ŲØķŲ„ØĐ Ų„ØŊŲŠŲƒ Ų…Ų† ØŪŲ„اŲ„ اŲ„ŲˆØ§ØŽŲ‡ØĐ Ø§Ų„ا؎؊Ų…اØđŲŠØĐ Ø§Ų„ŲØąŲŠØŊØĐ Ų„Ų€ Boxee.[CR][CR]ØĻØąØŽØ§ØĄ ØŠŲˆØĩŲŠŲ„ Ų…Ų†ŲØ° Ų‡ŲˆØ§ØĶŲŠ ØĢŲˆ ŲƒØ§ØĻŲ„ ØĻŲ…Ø­ŲˆŲ„ ØŠŲ„ŲØ§Øē Ų…ØĻاØīØą "ØŊŲˆŲ†ØŽŲ„" ØŦŲ… Ø­ØŊØŊ [COLOR boxeegreenheidi]اŲ„؊اŲ„ŲŠ[/COLOR]. + اŲ„ØąØŽØ§ØĄ ØŠŲˆØĩŲŠŲ„ ŲƒØ§ØĻŲ„ Ų‡ŲˆØ§ØĶŲŠ ØĢŲˆ ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠ ØĻØŊŲˆŲ†Ø­Ų„ ØŠŲ„ŲØ§Øē Ų…ØĻاØīØą. + Ų‡Ų„ ØĢŲ†ØŠ حاŲ„ŲŠØ§Ų‹ ŲŲŠ + ØŊŲ„ŲŠŲ„ اŲ„ØĻØąŲ†Ø§Ų…ØŽ + Ų„Ų„ØđØŦŲˆØą ØđŲ„Ų‰ ØŊŲ„ŲŠŲ„ اŲ„ØĻØąŲ†Ø§Ų…ØŽ اŲ„ØĩØ­ŲŠØ­ Ų„Ų…Ų†Ø·Ų‚ØŠŲƒØŒ Ų†Ø­ØŠØ§ØŽ ØĨŲ„Ų‰ ؊حØŊŲŠØŊ Ų…ŲˆŲ‚ØđŲƒ. + Ø­ØŊØŊ ØŊŲˆŲ„ØŠŲƒ + Ø­ØŊØŊ Ų…ØŊŲŠŲ†ØŠŲƒ + Ų‚اØĶŲ…ØĐ Ø§Ų„Ų‚Ų†ŲˆØ§ØŠ + ØģŲŠŲ‚ŲˆŲ… ØĻØąŲ†Ø§Ų…ØŽ Boxee ØĻاŲ„ØĻØ­ØŦ ØđŲ„Ų‰ Ų‚ŲˆØ§ØĶŲ… اŲ„Ų‚Ų†ŲˆØ§ØŠ ØđŲ† Ų…ŲˆŲ‚ØđŲƒ اŲ„Ø°ŲŠ Ø­ØŊØŊØŠŲ‡.[CR][CR]ØĢØŪØĻØą Boxee ØđŲ† Ų…ØĩØŊØą اŲ„ØĨØīØ§ØąØ§ØŠ اŲ„ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠØĐ Ø§Ų„ØŪاØĩØĐ ØĻŲƒØŒ ح؊Ų‰ Ų†ØŠŲ…ŲƒŲ† Ų…Ų† اŲ„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ Ų‚ŲˆØ§ØĶŲ… اŲ„Ų‚Ų†ŲˆØ§ØŠ اŲ„ØĩØ­ŲŠØ­ØĐ. + Ø­ØŊØŊ ŲˆŲ„اŲŠØŠŲƒ + اŲ„Ų‡ŲˆØ§ØĶŲŠ + ØĢØđØŊ Ų…ØģØ­ ØŊŲ„ŲŠŲ„ اŲ„Ų‚Ų†ŲˆØ§ØŠ. ØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ %s Ų‚Ų†ŲˆØ§ØŠ حاŲ„ŲŠØ§Ų‹... + Ų…ØīØ§ØąŲƒØĐ Ø§Ų„Ų…ØīاŲ‡ØŊŲŠŲ† Ų…Øđ اŲ„ØĢØĩØŊŲ‚Ø§ØĄ + ØĨØđاØŊØĐ ØŠŲƒŲˆŲŠŲ† ØĨØđØŊاØŊ اŲ„ØŠŲ„ŲØ§Øē اŲ„Ų…ØĻاØīØą... + ØĻØŊØĄ ØĨØđاØŊØĐ Ø§Ų„Ų…ØģØ­ + ØŠØīØšŲŠŲ„ اŲ„ØĨØđØŊاØŊ + اŲ„حاŲ„ØĐ + Ų…ØŠØĩŲ„ + Ų‚Ø·Øđ اŲ„ا؊ØĩاŲ„ + اŲ„ØŽŲ‡Ø§Øē + اŲ„Ų…ŲˆŲ‚Øđ + اŲ„ŲƒØ§ØĻŲ„ + ØąŲ…Øē ØĻØąŲŠØŊŲŠ ØšŲŠØą ØĩاŲ„Ø­ØŒ ØĻØąØŽØ§ØĄ ØŠŲƒØąØ§Øą اŲ„Ų…حاŲˆŲ„ØĐ + ؊حŲ…ŲŠŲ„[CR]ØŠŲ„ŲØ§Øē Ų…ØĻاØīØą... + ØŽØŊŲŠØŊ + Ų…ØĻاØīØą + ا؊ØĻØđ اŲ„ØđØąŲˆØķ اŲ„Ų…ŲØķŲ„ØĐ Ų„ØŊŲŠŲƒ + Ø­ØŊØŊ اŲ„ØđØąŲˆØķ اŲ„ØŠŲŠ ؊حØĻŲ‡Ø§ Ų„Ų„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ ØĢØ­ØŊاØŦ ØŽØŊŲŠØŊØĐ ŲŠØŠŲ… [CR]ØŠŲˆØĩŲŠŲ„Ų‡Ø§ ØŠŲ„Ų‚اØĶŲŠØ§Ų‹ ØĨŲ„ŲŠŲƒ ØđŲ†ØŊ ØŠŲˆŲØąŲ‡Ø§. + Ų‚ØŊŲ… Boxee Ø·ØąŲŠŲ‚ØĐ ØŽØŊŲŠØŊØĐ Ų„Ų…ØīØ§ØąŲƒØĐ Ų…ا ØŠØīاŲ‡ØŊŲ‡ Ų…Øđ اŲ„ØĢØĩØŊŲ‚Ø§ØĄ & اŲ„ØđاØĶŲ„ØĐ ØđŲ„Ų‰ Facebook Timeline. [CR][CR]ŲŠŲ…ŲƒŲ†Ųƒ ØĨŲŠŲ‚اŲ ØŠØīØšŲŠŲ„Ų‡ ŲŲŠ ØĢŲŠ ŲˆŲ‚ØŠ ŲŲŠ ØĨØđØŊاØŊا؊ > ØŠŲ„ŲØ§Øē Ų…ØĻاØīØą. + ا؎ØđŲ„[CR]Boxee ا؎؊Ų…اØđŲŠØ§Ų‹ + ؊؎اŲˆØē + ØĨØīØđØ§ØąØ§ØŠ + ØąØ§ØĶØđ – Ų„Ų‚ØŊ Ų‚Ų…Ų†Ø§ ØĻØ­ŲØļ ŲƒŲ„ اŲ„ØŠŲØķŲŠŲ„ا؊.[CR][CR]ØģŲŠŲ‚ŲˆŲ… Boxee اŲ„ØĒŲ† ØĻØĨØķاŲØĐ ØĢØ­ØŊاØŦ ØŽØŊŲŠØŊØĐ ØđØĻØą اŲ„ØĨŲ†ØŠØąŲ†ØŠ Ų„ØŠŲØķŲŠŲ„ا؊Ųƒ ØđŲ„Ų‰ طاØĻŲˆØą اŲ„ØŠŲ„ŲØ§Øē ŲˆØģŲ†ØąØģŲ„ Ų„Ųƒ ØĻØąŲŠØŊاŲ‹ ØĨŲ„ŲƒØŠØąŲˆŲ†ŲŠØ§Ų‹ ØĢØģØĻŲˆØđŲŠØ§Ų‹ ŲŠØŠØķŲ…Ų† Ų…ا ŲŠØŠŲ… ØŠØīØšŲŠŲ„Ų‡ ØđŲ„Ų‰ اŲ„ØŠŲ„ŲØ§Øē اŲ„Ų…ØĻاØīØą ØŪŲ„اŲ„ Ų‡Ø°Ø§ اŲ„ØĢØģØĻŲˆØđ. + ØĢØąØģŲ„ Ų„ŲŠ ØĻØąŲŠØŊاŲ‹ ØĨŲ„ŲƒØŠØąŲˆŲ†ŲŠØ§Ų‹ Ø­ŲˆŲ„: + ØĢØ­ØŊاØŦ ØŽØŊŲŠØŊØĐ + ŲƒŲ„ اŲ„ØĢØ­ØŊاØŦ + [B]ØŠŲ„ŲØ§Øē Ų…ØĻاØīØą[/B] + [B]ØķØđŲŠŲØĐ ØĢŲˆ Ų„ا ØŠŲˆØŽØŊ ØĨØīØ§ØąØĐ[B] + ØĻŲ„ا ØĨØīØ§ØąØĐ + ØĻŲ„ا Ų‚Ų†ŲˆØ§ØŠ + Ų…ØģØ­ + %d Ų‚Ų†ŲˆØ§ØŠ + ØŊŲ„ŲŠŲ„ + احŲØļ Ų†ØģØĻØĐ ØĢØĻØđاØŊ ØīاØīØĐ 4:3 + ØīØ§ØąŲƒ Ų…ا ØŠØīاŲ‡ØŊŲ‡ Ų…Øđ اŲ„ØĢØĩØŊŲ‚Ø§ØĄ & اŲ„ØđاØĶŲ„ØĐ ØđŲ„Ų‰ Facebook Timeline.[CR][CR]ŲƒŲ„ Ų…ا ؊ح؊ا؎ ØĨŲ„ŲŠŲ‡ Ų‡Ųˆ Ų…Ų†Ø­ Boxee اŲ„ØĨØ°Ų† Ų„Ų†ØīØą ØĢØ­ØŊاØŦ اŲ„ŲŲŠØŊŲŠŲˆ.[CR][CR]ŲŠŲ…ŲƒŲ†Ųƒ ØĨŲŠŲ‚اŲ ØŠØīØšŲŠŲ„Ų‡ ŲŲŠ ØĨØđØŊاØŊا؊ > ØŠŲ„ŲØ§Øē Ų…ØĻاØīØą. + ؊حØŊŲŠØŦ اŲ„ØĨØ°ŲˆŲ†Ø§ØŠ + + + ØķØĻØ· Ø­ØŊ ØŠŲ‚ŲŠŲŠŲ… اŲ„ØŠŲ„ŲØ§Øē... + ؊حØŊŲŠØŊ Ø­ØŊ ØŠŲ‚ŲŠŲŠŲ… اŲ„ØŠŲ„ŲØ§Øē + Ø­ØŊØŊ Ø­ØŊ اŲ„ØĢŲŲ„اŲ… اŲ„ØŠŲ„ŲØēŲŠŲˆŲ†ŲŠØĐ Ų„Ų…Ų†Øđ Ų…ØīاŲ‡ØŊØŠŲ‡Ø§ ŲŲŠ Ų…ŲƒØŠØĻا؊ ØđŲ†ØŊ اŲ„Ø·Ų„ØĻ، Ų…ŲƒØŠØĻا؊ Ų…Ø­Ų„ŲŠØĐ ŲˆŲ…ŲƒØŠØĻا؊ ØđŲ„Ų‰ اŲ„ØĨŲ†ØŠØąŲ†ØŠ.[CR]ØĨذا ŲƒØ§Ų† Ų„ØŊŲŠŲƒ ØŠŲ„ŲØ§Øē Ų…ØĻاØīØą Ų…Ų† Boxee، ØģŲˆŲ ØŠØļŲ‡Øą اŲ„ØĢŲŲ„اŲ… ŲŲŠ اŲ„Ų‚ŲˆØ§ØĶŲ…ØŒ ŲˆŲ„ŲƒŲ†Ų‡Ø§ Øģ؊؊طŲ„ØĻ ØĨØŊØŪاŲ„ ØąŲ…Øē Ų…ØąŲˆØą Ų„ØđØąØķŲ‡Ø§.[CR]Ų„ا ŲŠŲ…ŲƒŲ† ØŠØąØīŲŠØ­ اŲ„Ų…Ų„ŲØ§ØŠ اŲ„Ų…Ø­Ų„ŲŠØĐ ØšŲŠØą اŲ„Ų…ØŠŲ…اØŦŲ„ØĐ. + ؊حØŊŲŠØŊ Ø­ØŊ ØŠŲ‚ŲŠŲŠŲ… اŲ„ŲŲŠŲ„Ų… + Ø­ØŊØŊ Ø­ØŊ اŲ„ØĢŲŲ„اŲ… Ų„Ų…Ų†Øđ Ų…ØīاŲ‡ØŊØŠŲ‡Ø§ ŲŲŠ Ų…ŲƒØŠØĻا؊ ØđŲ†ØŊ اŲ„Ø·Ų„ØĻ، Ų…ŲƒØŠØĻا؊ Ų…Ø­Ų„ŲŠØĐ ŲˆŲ…ŲƒØŠØĻا؊ ØđŲ„Ų‰ اŲ„ØĨŲ†ØŠØąŲ†ØŠ.[CR]ØĨذا ŲƒØ§Ų† Ų„ØŊŲŠŲƒ ØŠŲ„ŲØ§Øē Ų…ØĻاØīØą Ų…Ų† Boxee، ØģŲˆŲ ØŠØļŲ‡Øą اŲ„ØđØąŲˆØķ ŲŲŠ اŲ„Ų‚ŲˆØ§ØĶŲ…ØŒ ŲˆŲ„ŲƒŲ†Ų‡Ø§ Øģ؊؊طŲ„ØĻ ØĨØŊØŪاŲ„ ØąŲ…Øē Ų…ØąŲˆØą Ų„ØđØąØķŲ‡Ø§.[CR]Ų„ا ŲŠŲ…ŲƒŲ† ØŠØąØīŲŠØ­ اŲ„Ų…Ų„ŲØ§ØŠ اŲ„Ų…Ø­Ų„ŲŠØĐ ØšŲŠØą اŲ„Ų…ØŠŲ…اØŦŲ„ØĐ. + ØķØĻØ· ŲƒŲ„Ų…ØĐ Ø§Ų„Ų…ØąŲˆØą + ØģŲˆŲ ؊ح؊ا؎ ØĨŲ„Ų‰ ØĨØŊØŪاŲ„ ØąŲ…Øē اŲ„Ų…ØąŲˆØą Ų‡Ø°Ø§ Ų„ØđØąØķ Ų…ØŽŲ…ŲˆØđØĐ Ø§Ų„Ų…ح؊ŲˆŲ‰ ØĢØđŲ„Ų‰ Ø­ØŊ اŲ„ØŠŲ‚ŲŠŲŠŲ…ØŒ ØĻاŲ„ØĨØķاŲØĐ ØĨŲ„Ų‰ ØĨØŽØąØ§ØĄ ØŠØšŲŠŲŠØąØ§ØŠ ØđŲ„Ų‰ ØĢØŊŲˆØ§ØŠ اŲ„؊حŲƒŲ… اŲ„ØąØĶŲŠØģŲŠØĐ. + Ų…ح؊ŲˆŲ‰ Ų…Ų‚ŲŠØŊ + ؊ح؊ا؎ ØĨŲ„Ų‰ ØąŲ…Øē Ų…ØąŲˆØą Ų„ØđØąØķ Ų‡Ø°Ø§ اŲ„ŲŲŠØŊŲŠŲˆ... + Ų…Ų…Ų…... Ų„ŲŠØģ Ų‡Ø°Ø§ ØĻŲƒŲ„ ØīŲŠØĄ. ŲƒØąØą اŲ„Ų…حاŲˆŲ„ØĐ. + ØķØĻØ· Ø­ØŊ ØŠŲ‚ŲŠŲŠŲ… اŲ„ŲŲŠŲ„Ų…... + ØķØĻØ· ØąŲ…Øē اŲ„Ų…ØąŲˆØą Ų„Ų…ح؊ŲˆŲ‰ Ų…Øģ؊حŲ‚... + ØŠØšŲŠŲŠØą ØąŲ…Øē اŲ„Ų…ØąŲˆØą Ų„Ų…ح؊ŲˆŲ‰ Ų…Øģ؊حŲ‚... + ØŠØšŲŠŲŠØą ØąŲ…Øē اŲ„Ų…ØąŲˆØą + ØĢØŊØŪŲ„ ØąŲ…Øē اŲ„Ų…ØąŲˆØą اŲ„حاŲ„ŲŠ Ų„Ų„Ų…؊اØĻØđØĐ... + ØŠŲ… اŲ„؊حŲ‚Ų‚ØŒ ØĢØŊØŪŲ„ اŲ„ØĒŲ† ØąŲ…Øē اŲ„Ų…ØąŲˆØą اŲ„ØŽØŊŲŠØŊ اŲ„ØŪاØĩ ØĻŲƒ. + ØŊŲ‚Ų‚ ØĢØŦŲ†Ø§ØĄ اŲ„ØĻØ­ØŦ ØđŲ† اŲ„Ų‚Ų†ŲˆØ§ØŠ اŲ„Ų…؊احØĐ ŲŲŠ Ų…Ų†Ø·Ų‚ØŠŲƒ. + اŲ†ØŠŲ‚Ų„ ØĨŲ„Ų‰ اŲ„ØŠŲ„ŲØ§Øē اŲ„Ų…ØĻاØīØą + Ų‡Ų…Ų…Ų…ØŒ Ų„Ų… ŲŠØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų‚Ų†ŲˆØ§ØŠ... ŲƒØąØą اŲ„Ų…حاŲˆŲ„ØĐ ØĢŲˆ اØķؚط ØđŲ„Ų‰ ØđŲˆØŊØĐ Ų„Ų„ØĨŲ„ØšØ§ØĄ. + ØĨŲ„ØšØ§ØĄ اŲ„Ų…Øģح؟ + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ ØĨŲŠŲ‚اŲ Ų…ØģØ­ اŲ„Ų‚Ų†ŲˆØ§ØŠØŸ + ØĻŲ„ا ØĨŲ†ØŠØąŲ†ØŠ + Ų…Ø·Ų„ŲˆØĻ ا؊ØĩاŲ„ ØĻاŲ„ØĨŲ†ØŠØąŲ†ØŠ Ų„Ų…ØģØ­ اŲ„Ų‚Ų†ŲˆØ§ØŠ. + ØĨØšŲ„اŲ‚ + ØĨŲ„ØšØ§ØĄ اŲ„Ų…ØģØ­ + Ø­Ø°ØąŲ†ŲŠ Ų‚ØĻŲ„ ØĨØšŲ„اŲ‚ اŲ„ØŠŲ„ŲØ§Øē اŲ„Ų…ØĻاØīØą + Ų„Ų… ŲŠØŠŲ… اŲ„ØđØŦŲˆØą ØđŲ„Ų‰ Ų‚Ų†ŲˆØ§ØŠ + حاŲˆŲ„ Ų†Ų‚Ų„ اŲ„Ų‡ŲˆØ§ØĶŲŠ اŲ„ØŪاØĩ ØĻŲƒ ØĨŲ„Ų‰ Ų…ŲƒØ§Ų† Ų…ØŪØŠŲ„Ų. ØŠØĢŲƒØŊ Ų…Ų† ØŠŲˆØĩŲŠŲ„Ų‡ ØĻØ·ØąŲŠŲ‚ØĐ ØĩØ­ŲŠØ­ØĐ.[CR][CR]ŲŠŲ…ŲƒŲ†Ųƒ ØĢŲŠØķاŲ‹ ØŠŲˆØĩŲŠŲ„ ŲƒØ§ØĻŲ„ Ų…؊حØŊ اŲ„Ų…Ø­ŲˆØą Ų…Ų† Ų…ØēŲˆØŊ اŲ„ØĨŲ†ØŠØąŲ†ØŠ/اŲ„ŲƒØ§Ų„ØĻا؊ Ų„Ų„Ø­ØĩŲˆŲ„ ØđŲ„Ų‰ Ų‚Ų†ŲˆØ§ØŠ QAM Ų…؎اŲ†ŲŠØĐ. + ØŠØĢŲƒØŊ Ų…Ų† ا؊ØĩاŲ„ اŲ„ŲƒØ§ØĻŲ„ ØĻØ·ØąŲŠŲ‚ØĐ ØĩØ­ŲŠØ­ØĐ ØĻŲ…ŲˆØ§Ų„Ų USB، ŲˆØĢŲ†Ų‡ Ų„ا ŲŠØŪØąØŽ Ų…Ų† اŲ„ØĩŲ†ØŊŲˆŲ‚ اŲ„ØđŲ„ŲˆŲŠ Ų„Ų„ØķØĻØ· (اØģØŠØŪØŊŲ… اØģØĻŲ„ŲŠØŠØą). [CR][CR]ŲŠŲ…ŲƒŲ†Ųƒ ØĢŲŠØķاŲ‹ ØŠŲˆØĩŲŠŲ„ Ų‡ŲˆØ§ØĶŲŠ Ų…ØąŲŲ‚ ØĻŲ…ŲˆØ§Ų„Ų USB (ØĢŲˆ اŲ„ØŪاØĩ ØĻŲƒ). + اØģØŠØŪØŊاŲ… ŲƒØ§ØĻŲ„ + اØģØŠØŪØŊاŲ… Ų‡ŲˆØ§ØĶŲŠ + ØĨØđاØŊØĐ ØŠŲƒŲˆŲŠŲ†[CR]ØŠŲ„ŲØ§Øē Ų…ØĻاØīØą + ØŠØĢŲƒØŊ Ų…Ų† ا؊ØĩاŲ„ اŲ„Ų‡ŲˆØ§ØĶŲŠ ØĢŲˆ ØģŲ„Ųƒ اŲ„ŲƒØ§ØĻŲ„ ØĻŲ…ŲˆØ§Ų„Ų USB.[CR][CR]ØģŲŠØŠŲ… ŲŲ‚ØŊ اŲ„ØŠØđØŊŲŠŲ„ا؊ اŲ„ØŠŲŠ ØĢØŽØąŲŠØŠŲ‡Ø§ ØđŲ„Ų‰ Ų…ØŪطط اŲ„Ų‚Ų†ŲˆØ§ØŠ اŲ„حاŲ„ŲŠ اŲ„ØŪاØĩ ØĻŲƒ. + + + + + اØģØŠŲŠØąØ§ØŊ Ų…Ų† + اŲ†ØŠŲ‚Ų„ ØĨŲ„Ų‰ Ų‡Ų†Ø§ Ų„Ų„ØŠŲ†ØīŲŠØ·: + Ø­ØŊØŊ اŲ„Ų…Ų„Ų‚Ų…ا؊ اŲ„ØŠŲŠ ØŠØąŲŠØŊ ØŠØķŲ…ŲŠŲ†Ų‡Ø§ ŲŲŠ ؊ؚذŲŠØ§ØŠ اŲ„ŲŲŠØŊŲŠŲˆ اŲ„ØŪاØĩØĐ ØĻŲƒ + ŲŠŲ…ŲƒŲ† Ų„Ų„؊ؚذŲŠØĐ Ø§Ų„ØŪاØĩØĐ ØĻŲƒ ØđØąØķ Ų…Ų„ŲØ§ØŠ اŲ„ŲŲŠØŊŲŠŲˆ Ų…Ų† Facebook، ŲˆTwitter ŲˆGoogle[CR]ØŠØŊŲŲ‚ا؊ ØąŲ†ŲŠŲ†.[CR][CR]Ų„ØŠØīØšŲŠŲ„ Ų‡Ø°Ų‡ اŲ„ØŪاØĩŲŠØĐ، ŲŠØŽØĻ ØđŲ„ŲŠŲƒ ØēŲŠØ§ØąØĐ Ų…ŲˆŲ‚Øđ اŲ„ŲˆŲŠØĻ اŲ„ØŪاØĩ ØĻŲ†Ø§ Ų„ØŠŲ†ØīŲŠØ· Ø­ØģاØĻا؊Ųƒ: [CR] + ØŠŲ… ØŠØđØ·ŲŠŲ„ ا؊ØĩاŲ„ Facebook + + + Ų„ا ŲŠŲ…ŲƒŲ† ØĨØŠŲ…اŲ… اŲ„ØĨØŽØąØ§ØĄ Ų†ØļØąØ§Ų‹ Ų„ŲˆØŽŲˆØŊ ØŪØ·ØĢ ŲŲŠ اŲ„Ų…Ų„Ų‚Ų…. + ŲƒŲ„Ų…ØĐ Ų…ØąŲˆØą ØšŲŠØą ØĩØ­ŲŠØ­ØĐ. + Ų…Ø·Ų„ŲˆØĻ اŲ„ØŊŲØđ + Ų…حاŲˆŲ„ØĐ Ø§Ų„اØīØŠØąØ§Ųƒ ŲŲŠ Ų…Ų†ØŠØŽØ§ØŠ ØšŲŠØą Ų†ØīØ·ØĐ + ØĢŲ†ØŠ Ų…ØīØŠØąŲƒ ØĻاŲ„ŲØđŲ„ ŲŲŠ Ų‡Ø°Ø§ اŲ„Ų…Ų†ØŠØŽ + ØŪØ·ØĢ اŲ„؊حŲ‚Ų‚ Ų…Ų† اŲ„ØĩØ­ØĐ. حاŲˆŲ„ اØģØŠØŪØŊاŲ… ØĻطاŲ‚ØĐ Ø§ØĶØŠŲ…اŲ† ØĢØŪØąŲ‰. + ØĢŲ†ØŠ ØšŲŠØą Ų…ØīØŠØąŲƒ حاŲ„ŲŠØ§Ų‹ ŲŲŠ Ų‡Ø°Ø§ اŲ„Ų…Ų†ØŠØŽ + + + + ØŠŲ… اŲ„ØŠØąØīŲŠØ­ ØĻŲˆØ§ØģØ·ØĐ + ØŠŲ… اŲ„ŲØąØē ØĻŲˆØ§ØģØ·ØĐ + Ų…Ų† Ų†ŲˆØđ + ØĢŲ„ØĻŲˆŲ…ا؊ Ų…Ų† + ØŠŲ‚ØŊŲŠŲ… ØĻŲˆØ§ØģØ·ØĐ + Ų…ŲˆØģŲŠŲ‚Ų‰ Ø­ØģØĻ اŲ„ŲŲ†Ø§Ų† + Ų…ŲˆØģŲŠŲ‚Ų‰ Ø­ØģØĻ اŲ„ØĢŲ„ØĻŲˆŲ… + + + + %media%%sort%%filter%%source% + %media%%sort%%channel%%filter%%source% + %media%%sort%%channel%%filter%%source% + %media%sort%%filter%% + %media%sort% + %media%sort% + + + %media%%sort%%channel%%filter%%source% + + + ؊طØĻŲŠŲ‚ا؊ + ØĢŲŲ„اŲ… + ØđØąŲˆØķ + ØĢŲ„ØĻŲˆŲ…ا؊ + ØĩŲˆØą + ØŠØąŲŠŲ„Øą + ŲŲ†Ø§Ų†ŲˆŲ† + ŲŲŠØŊŲŠŲˆ + ØĢØ­ØŊاØŦ + ŲŲŠØŊŲŠŲˆ Ų…ØŽŲ‡ŲˆŲ„ + اŲ„ØđŲ†Ø§ØĩØą + اŲ„ØđŲ†ØĩØą + + + ØĻŲŠØĶØĐ Ø§Ų„Ų…Ų„Ų‚Ų… + ØŠØĩŲ†ŲŠŲ + ØĨŲ†ØŠØ§ØŽ + ؊حØŊŲŠØŊ ØĻŲŠØĶØĐ Ø§Ų„Ų…Ų„Ų‚Ų…: + ØĻŲŠØĶØĐ Ø§Ų„Ų…Ų„Ų‚Ų… + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ ØŠØšŲŠŲŠØą ØĻŲŠØĶØĐ Ø§Ų„Ų…Ų„Ų‚Ų…ØŸ + + + [B]ØĩØĻاحاŲ‹[/B] + [B]ØļŲ‡ØąØ§Ų‹[/B] + [B]Ų…ØģØ§ØĄØ§Ų‹[/B] + [B]Ų„ŲŠŲ„اŲ‹[/B] + اŲ„ŲŠŲˆŲ… + ØšØŊاŲ‹ + Ųˆ + %d ØĒØŪØąŲˆŲ† ŲŠØīاŲ‡ØŊŲˆŲ†. + + + Ų…Ø­Ųˆ اŲ„Ų…ØŪØēŲ† اŲ„Ų…Ø­Ų„ŲŠ... + Ų…Ø­Ųˆ اŲ„Ų…ØŪØēŲ† اŲ„Ų…Ø­Ų„ŲŠ Ų„Ų„Ų…ØŠØĩŲØ­ØŸ + + + ØĨØđØŊاØŊا؊ Ų…ØŠŲ‚ØŊŲ…ØĐ + ØĨŲ†Ų‡Ø§ØĄ اŲ„ŲŲŠØŊŲŠŲˆ + ØĨŲŠŲ‚اŲ + ØđŲˆØŊØĐ ØĨŲ„Ų‰ اŲ„Ų…ØŽŲ„ØŊ اŲ„ØĢØģاØģŲŠ + اØģØŠØđØąØ§Øķ Ų…Ø­Ų„ŲŠ... + اØģØŠØđØąØ§Øķ ØđŲ„Ų‰ اŲ„ØĨŲ†ØŠØąŲ†ØŠ... + Ų‡Ø°Ø§ اŲ„ŲŲŠØŊŲŠŲˆ Ų„ا ŲŠØŊØđŲ… اŲ„ØĻØ­ØŦ + + + ØđŲˆØŊØĐ ØĨŲ„Ų‰ اŲ„ØŠŲ„ŲØ§Øē اŲ„Ų…ØĻاØīØą + ØŠØ­ØąŲŠØą اŲ„Ų‚Ų†ŲˆØ§ØŠ + ØŠØđØ·ŲŠŲ„ اŲ„Ų…ØīØ§ØąŲƒØĐ + ØŠŲ…ŲƒŲŠŲ† اŲ„Ų…ØīØ§ØąŲƒØĐ + ØĨØŪŲØ§ØĄ ØĢŲˆ ØĨØđاØŊØĐ ØŠØģŲ…ŲŠØĐ Ø§Ų„Ų‚Ų†ŲˆØ§ØŠ Ų„ØŠØŪØĩŲŠØĩ اŲ„Ų…ØŪطط. + اŲ„ØŪØąŲˆØŽ Ų…Ų† اŲ„ØŠŲ„ŲØ§Øē اŲ„Ų…ØĻاØīØą + Ų‡Ų„ ØĢŲ†ØŠ Ų…ØŠØĢŲƒØŊ ØĢŲ†Ųƒ ØŠØąŲŠØŊ Ų…ؚاØŊØąØĐ Ø§Ų„ØŠŲ„ŲØ§Øē اŲ„Ų…ØĻاØīØąØŸ + اØģŲ… اŲ„Ų‚Ų†Ø§ØĐ + Ų„ا ŲŠŲˆØŽØŊ Ų„ØŊŲŠŲ†Ø§ Ų‚اØĶŲ…ØĐ ØŽØŊŲˆŲ„ØĐ Ų„Ų…Ų†Ø·Ų‚ØŠŲƒ. + ؊حØŊŲŠØŊ ØŽØŊŲˆŲ„ Ų…طاØĻŲ‚: + ØĻŲ„ا ØŽØŊŲˆŲ„ + + + اØĻØŊØĢ ŲŲŠ اŲ„ŲƒØŠØ§ØĻØĐ ŲŲŠ [B] ØĻØ­ØŦ[/B] + + + ؊طØĻŲŠŲ‚ + ØđØąØķ + Ų†ØļØąØĐ ØđاŲ…ØĐ + اŲ„ØīØŪØĩŲŠØ§ØŠ ŲˆØ§Ų„طاŲ‚Ų… + Ų…ØąØŠØĻØ· + + + ØĨØđØŊاØŊا؊ اŲ„ØīØĻŲƒØĐ + + diff --git a/language/Czech/keyboard.xml b/language/Czech/keyboard.xml new file mode 100755 index 00000000..d8cc9f3e --- /dev/null +++ b/language/Czech/keyboard.xml @@ -0,0 +1,88 @@ + + + a + ÃĄ + b + c + č + d + ď + e + ÃĐ + ě + f + g + h + i + í + j + k + l + m + n + ň + o + Ãģ + p + q + r + ř + s + ÅĄ + t + ÅĨ + u + Ú + ÅŊ + v + w + x + y + Ã― + z + Åū + + + A + Á + B + C + Č + D + Ď + E + É + Ě + F + G + H + I + Í + J + K + L + M + N + Ň + O + Ó + P + Q + R + Ř + S + Å  + T + ÅĪ + U + Ú + ÅŪ + V + W + X + Y + Ý + Z + Å― + + diff --git a/language/Danish/keyboard.xml b/language/Danish/keyboard.xml new file mode 100755 index 00000000..6d8890b1 --- /dev/null +++ b/language/Danish/keyboard.xml @@ -0,0 +1,63 @@ + + + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + x + y + z + ÃĶ + Ãļ + ÃĨ + + A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z + Æ + Ø + Å + + diff --git a/language/Dutch/keyboard.xml b/language/Dutch/keyboard.xml new file mode 100644 index 00000000..d30bf3dd --- /dev/null +++ b/language/Dutch/keyboard.xml @@ -0,0 +1,57 @@ + + + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + x + y + z + + A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z + + diff --git a/language/Finnish/keyboard.xml b/language/Finnish/keyboard.xml new file mode 100755 index 00000000..1a204d44 --- /dev/null +++ b/language/Finnish/keyboard.xml @@ -0,0 +1,63 @@ + + + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + x + y + z + ÃĨ + ÃĪ + Ãķ + + A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z + Å + Ä + Ö + + diff --git a/language/French/keyboard.xml b/language/French/keyboard.xml new file mode 100644 index 00000000..d7fbeb2b --- /dev/null +++ b/language/French/keyboard.xml @@ -0,0 +1,71 @@ + + + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + x + y + z + à + ÃĒ + ç + ÃĐ + ÃĻ + Ê + ÃŦ + ÃŪ + ÃŊ + Ãī + Ãđ + Ãŧ + Þ + Ãŋ + + A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z + + diff --git a/language/German/keyboard.xml b/language/German/keyboard.xml new file mode 100755 index 00000000..1c73a14d --- /dev/null +++ b/language/German/keyboard.xml @@ -0,0 +1,64 @@ + + + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + x + y + z + ÃĪ + Ãķ + Þ + ß + + A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z + Ä + Ö + Ü + + diff --git a/language/Norwegian/keyboard.xml b/language/Norwegian/keyboard.xml new file mode 100755 index 00000000..c0226d2e --- /dev/null +++ b/language/Norwegian/keyboard.xml @@ -0,0 +1,63 @@ + + + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + x + y + z + ÃĶ + Ãļ + ÃĨ + + A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z + Æ + Ø + Å + + diff --git a/language/Polish/keyboard.xml b/language/Polish/keyboard.xml new file mode 100644 index 00000000..967931f4 --- /dev/null +++ b/language/Polish/keyboard.xml @@ -0,0 +1,76 @@ + + + a + ą + b + c + ć + d + e + ę + f + g + h + i + j + k + l + m + n + ń + o + Ãģ + p + q + r + s + ś + t + u + v + w + x + y + Ã― + z + Åš + Åž + + + A + Ą + B + C + Ć + D + E + Ę + F + G + H + I + J + K + L + M + N + Ń + O + Ó + P + Q + R + S + Ś + T + U + Ú + V + W + X + Y + Z + Åđ + Åŧ + + diff --git a/language/Portuguese (Brazil)/keyboard.xml b/language/Portuguese (Brazil)/keyboard.xml new file mode 100755 index 00000000..80fd94a4 --- /dev/null +++ b/language/Portuguese (Brazil)/keyboard.xml @@ -0,0 +1,68 @@ + + + a + ÃĄ + ÃĒ + ÃĢ + à + b + c + d + e + ÃĐ + Ê + f + g + h + i + í + j + k + l + m + n + o + Ãģ + Ãī + Ãĩ + p + q + r + s + t + u + Ú + v + w + x + y + z + + A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z + + diff --git a/language/Swedish/keyboard.xml b/language/Swedish/keyboard.xml new file mode 100644 index 00000000..1a204d44 --- /dev/null +++ b/language/Swedish/keyboard.xml @@ -0,0 +1,63 @@ + + + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + x + y + z + ÃĨ + ÃĪ + Ãķ + + A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z + Å + Ä + Ö + + diff --git a/language/Turkish/keyboard.xml b/language/Turkish/keyboard.xml new file mode 100755 index 00000000..4478b708 --- /dev/null +++ b/language/Turkish/keyboard.xml @@ -0,0 +1,63 @@ + + + a + b + c + ç + d + e + f + g + ğ + h + Äą + i + j + k + l + m + n + o + Ãķ + p + r + s + ş + t + u + Þ + v + y + z + + A + B + C + Ç + D + E + F + G + Ğ + H + I + Ä° + J + K + L + M + N + O + Ö + P + R + S + Ş + T + U + Ü + V + Y + Z + + diff --git a/language/availablelangs.xml b/language/availablelangs.xml new file mode 100644 index 00000000..7d6a83f2 --- /dev/null +++ b/language/availablelangs.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/media/Splash.jpg b/media/Splash.jpg new file mode 100644 index 00000000..7cd87180 Binary files /dev/null and b/media/Splash.jpg differ diff --git a/media/boxee_screen_saver/01.png b/media/boxee_screen_saver/01.png new file mode 100644 index 00000000..7182814b Binary files /dev/null and b/media/boxee_screen_saver/01.png differ diff --git a/media/boxee_screen_saver/02.png b/media/boxee_screen_saver/02.png new file mode 100644 index 00000000..2c56ebd4 Binary files /dev/null and b/media/boxee_screen_saver/02.png differ diff --git a/media/boxee_screen_saver/03.png b/media/boxee_screen_saver/03.png new file mode 100644 index 00000000..50b5f36a Binary files /dev/null and b/media/boxee_screen_saver/03.png differ diff --git a/media/boxee_screen_saver/04.png b/media/boxee_screen_saver/04.png new file mode 100644 index 00000000..69464895 Binary files /dev/null and b/media/boxee_screen_saver/04.png differ diff --git a/media/boxee_screen_saver/05.png b/media/boxee_screen_saver/05.png new file mode 100644 index 00000000..d5d8e2b4 Binary files /dev/null and b/media/boxee_screen_saver/05.png differ diff --git a/media/boxee_screen_saver/06.png b/media/boxee_screen_saver/06.png new file mode 100644 index 00000000..20d21bf6 Binary files /dev/null and b/media/boxee_screen_saver/06.png differ diff --git a/media/boxee_screen_saver/07.png b/media/boxee_screen_saver/07.png new file mode 100644 index 00000000..0df91017 Binary files /dev/null and b/media/boxee_screen_saver/07.png differ diff --git a/media/boxee_screen_saver/08.png b/media/boxee_screen_saver/08.png new file mode 100644 index 00000000..473ada2d Binary files /dev/null and b/media/boxee_screen_saver/08.png differ diff --git a/media/boxee_screen_saver/09.png b/media/boxee_screen_saver/09.png new file mode 100644 index 00000000..7853b0c8 Binary files /dev/null and b/media/boxee_screen_saver/09.png differ diff --git a/media/boxee_screen_saver/10.png b/media/boxee_screen_saver/10.png new file mode 100644 index 00000000..d73b737c Binary files /dev/null and b/media/boxee_screen_saver/10.png differ diff --git a/media/boxee_screen_saver/11.png b/media/boxee_screen_saver/11.png new file mode 100644 index 00000000..51731d82 Binary files /dev/null and b/media/boxee_screen_saver/11.png differ diff --git a/media/boxee_screen_saver/12.png b/media/boxee_screen_saver/12.png new file mode 100644 index 00000000..a4384df4 Binary files /dev/null and b/media/boxee_screen_saver/12.png differ diff --git a/media/boxee_screen_saver/13.png b/media/boxee_screen_saver/13.png new file mode 100644 index 00000000..dbe9c9b8 Binary files /dev/null and b/media/boxee_screen_saver/13.png differ diff --git a/media/boxee_screen_saver/14.png b/media/boxee_screen_saver/14.png new file mode 100644 index 00000000..fdef3f4f Binary files /dev/null and b/media/boxee_screen_saver/14.png differ diff --git a/media/boxee_screen_saver/15.png b/media/boxee_screen_saver/15.png new file mode 100644 index 00000000..5b5c390c Binary files /dev/null and b/media/boxee_screen_saver/15.png differ diff --git a/media/test_sound.mp3 b/media/test_sound.mp3 new file mode 100755 index 00000000..f21223c2 Binary files /dev/null and b/media/test_sound.mp3 differ diff --git a/osx-distro/.gitignore b/osx-distro/.gitignore new file mode 100644 index 00000000..23ada7a3 --- /dev/null +++ b/osx-distro/.gitignore @@ -0,0 +1,4 @@ +boxee.pmdoc/01boxee.xml +boxee.pmdoc/index.xml +info.rtf +welcome-gen.rtf diff --git a/osx-distro/build_osx.sh b/osx-distro/build_osx.sh new file mode 100755 index 00000000..e285d56e --- /dev/null +++ b/osx-distro/build_osx.sh @@ -0,0 +1,85 @@ +#!/bin/sh + +cd .. + +export PATH=/usr/local/bin:/opt/local/bin:$PATH +echo "PATH is:" +echo $PATH + +git reset --hard +git clean -d -f -x -e build-number.txt + +./bootstrap +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "bootstrap failed" + echo "************************************************************************************" + exit 1 +fi +./configure --enable-optimizations --disable-debug +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "configure failed" + echo "************************************************************************************" + exit 2 +fi + + +make clean +rm -Rf ./boxee.mpkg +rm -Rf ./Boxee.app +rm *.dmg + +make -j4 +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "make failed" + echo "************************************************************************************" + exit 3 +fi +make release +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "make release failed" + echo "************************************************************************************" + exit 4 +fi +make -C tools/TexturePacker -f Makefile.host_osx +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "make TexturePacker failed" + echo "************************************************************************************" + exit 5 +fi +make -C skin/boxee/media nocompress +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "make textures failed" + echo "************************************************************************************" + exit 6 +fi + +osx-distro/package.sh +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "Building CreateBoxeeInstaller failed" + echo "************************************************************************************" + exit 7 +fi + +/Developer/usr/bin/packagemaker --no-relocate -d osx-distro/boxee.pmdoc/ +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "packagemaker failed" + echo "************************************************************************************" + exit 8 +fi + +VER=`cat ./VERSION` +hdiutil create -srcfolder boxee.mpkg/ boxee-$VER.dmg +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "DMG creation failed" + echo "************************************************************************************" + exit 9 +fi diff --git a/osx-distro/build_osx_fast.sh b/osx-distro/build_osx_fast.sh new file mode 100755 index 00000000..b6f95be7 --- /dev/null +++ b/osx-distro/build_osx_fast.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +cd .. + +./bootstrap +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "bootstrap failed" + echo "************************************************************************************" + exit 1 +fi +./configure --enable-optimizations --disable-debug +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "configure failed" + echo "************************************************************************************" + exit 2 +fi + + +make clean +rm -Rf ./boxee.mpkg +rm -Rf ./Boxee.app +rm *.dmg + +make -j4 +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "make failed" + echo "************************************************************************************" + exit 3 +fi +make release +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "make release failed" + echo "************************************************************************************" + exit 4 +fi +make -C tools/TexturePacker -f Makefile.host_osx +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "make TexturePacker failed" + echo "************************************************************************************" + exit 5 +fi +make -C skin/boxee/media +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "make textures failed" + echo "************************************************************************************" + exit 6 +fi + +xcodebuild -target CreateBoxeeInstaller +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "Building CreateBoxeeInstaller failed" + echo "************************************************************************************" + exit 7 +fi +/Developer/usr/bin/packagemaker --no-relocate -d osx-distro/boxee.pmdoc/ +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "packagemaker failed" + echo "************************************************************************************" + exit 8 +fi +VER=`cat ./VERSION` +hdiutil create -srcfolder boxee.mpkg/ boxee-$VER.dmg +if [ "$?" -ne "0" ]; then + echo "************************************************************************************" + echo "DMG creation failed" + echo "************************************************************************************" + exit 9 +fi diff --git a/osx-distro/package.sh b/osx-distro/package.sh new file mode 100755 index 00000000..7dcbc364 --- /dev/null +++ b/osx-distro/package.sh @@ -0,0 +1,228 @@ +#!/bin/sh + +function compile_python +{ + pushd $1 2>&1 > /dev/null + python2.4 -O > /dev/null << EOF +import compileall +compileall.compile_dir(".", force=1) +EOF + popd 2>&1 > /dev/null +} + +SRC=. +DEST=./Boxee.app + +echo "Installing to" $DEST + +if [ ! -f $SRC/VERSION ]; then + echo You forgot to do make release +# exit +fi + +rm -rf $DEST +mkdir $DEST + +# turn to absolute +pushd $SRC > /dev/null 2>&1 +SRC=`pwd` +popd > /dev/null 2>&1 + +pushd $DEST > /dev/null 2>&1 +DEST=`pwd` +popd > /dev/null 2>&1 + +boxee_ver=`awk -F'"' ' /BOXEE_VERSION/ { print $2 } ' $SRC/xbmc/lib/libBoxee/bxversion.h` + +#################################### +# Create the Application structure # +#################################### + +mkdir $DEST/Contents +mkdir $DEST/Contents/Frameworks +mkdir $DEST/Contents/Resources +mkdir $DEST/Contents/MacOS + +cp $SRC/osx-distro/Info.plist $DEST/Contents +sed -i"" -e 's/${VERSION}/'$boxee_ver'.'$ver'/g' ${DEST}/Contents/Info.plist +cp $SRC/osx-distro/PkgInfo $DEST/Contents +cp $SRC/osx-distro/version.plist $DEST/Contents +sed -i"" -e 's/${VERSION}/'$boxee_ver'.'$ver'/g' ${DEST}/Contents/version.plist +sed -i"" -e 's/${VER}/'$ver'/g' ${DEST}/Contents/version.plist + +############################# +# Copy the Boxee executable # +############################# + +cp $SRC/Boxee $DEST/Contents/MacOS +cp $SRC/bin-osx/Dcp* $DEST/Contents/MacOS + +############################ +# Copy the Boxee Resources # +############################ + +cp $SRC/osx-distro/BOXEE.icns $DEST/Contents/Resources/Boxee.icns +cp $SRC/osx-distro/BOXEE.rsrc $DEST/Contents/Resources/Boxee.rsrc + +BOXEE_RES=$DEST/Contents/Resources/Boxee + +mkdir $BOXEE_RES + +# license +mkdir $BOXEE_RES/license +cp $SRC/license/*.txt $BOXEE_RES/license +cp $SRC/license/boxee.txt $BOXEE_RES/license/LICENSE.TXT + +# bin +mkdir $BOXEE_RES/bin +cp $SRC/bin-osx/boxeeservice $BOXEE_RES/bin +cp $SRC/xbmc/osx/install_SCR $BOXEE_RES/bin + +# config +mkdir $BOXEE_RES/config +cp $SRC/osx-distro/launch-agent.template $BOXEE_RES/config +cp $SRC/osx-distro/pre-install.sh $BOXEE_RES/config +cp $SRC/osx-distro/post-install.sh $BOXEE_RES/config +cp $SRC/osx-distro/launch-service.sh $BOXEE_RES/config +cp $SRC/boxee-manage-sources $BOXEE_RES/config + +# language +mkdir $BOXEE_RES/language +rsync -rl ${SRC}/language/{English,Italian,German,Spanish,French,Hebrew,Swedish,Danish,Dutch,Russian,Turkish,Arabic,Norwegian,Finnish,Czech,Polish,Portuguese\ \(Brazil\)} ${SRC}/language/availablelangs.xml $BOXEE_RES/language + +# media +rsync -rl ${SRC}/media $BOXEE_RES/ + +# skin +mkdir $BOXEE_RES/skin +rsync -rl ${SRC}/skin/boxee $BOXEE_RES/skin +rm -rf $BOXEE_RES/skin/boxee/media/* +rm $BOXEE_RES/skin/boxee/sounds/startup.wav +cp ${SRC}/skin/boxee/media/{Textures.xbt,textures.xml} $BOXEE_RES/skin/boxee/media + +# scripts +rsync -rl ${SRC}/scripts $BOXEE_RES/ +rm -rf $BOXEE_RES/scripts/RTorrent +rm -rf $BOXEE_RES/scripts/Lyrics +compile_python $BOXEE_RES/scripts + +# visualizations +mkdir $BOXEE_RES/visualisations +cp ${SRC}/visualisations/opengl_spectrum.vis $BOXEE_RES/visualisations/Spectrum.vis +cp ${SRC}/visualisations/ProjectM.vis $BOXEE_RES/visualisations/ProjectM.vis +cp ${SRC}/visualisations/Waveform.vis $BOXEE_RES/visualisations/Waveform.vis + +mkdir $BOXEE_RES/visualisations/projectM +cp ${SRC}/visualisations/projectM/* $BOXEE_RES/visualisations/projectM/ + +# system +mkdir -p ${BOXEE_RES}/system +mkdir ${BOXEE_RES}/system/players + +cp ${SRC}/system/*osx*.so* ${BOXEE_RES}/system +cp ${SRC}/system/libboxeebrowser-x86-osx.0.dylib ${BOXEE_RES}/system +cp ${SRC}/system/*.xml ${BOXEE_RES}/system +cp ${SRC}/system/*.txt ${BOXEE_RES}/system +cp ${SRC}/system/*.pem ${BOXEE_RES}/system +rsync -rl ${SRC}/system/keymaps ${BOXEE_RES}/system/ +rsync -rl ${SRC}/system/shaders ${BOXEE_RES}/system/ + +# qt +mkdir -p ${BOXEE_RES}/system/qt +rsync -rl ${SRC}/system/qt/osx ${BOXEE_RES}/system/qt + +# dvdplayer +mkdir ${BOXEE_RES}/system/players/dvdplayer +cp ${SRC}/system/players/dvdplayer/*-osx.so ${BOXEE_RES}/system/players/dvdplayer +cp ${SRC}/system/players/dvdplayer/libbluray.so ${BOXEE_RES}/system/players/dvdplayer + +# paplayer +mkdir ${BOXEE_RES}/system/players/paplayer +cp ${SRC}/system/players/paplayer/*-osx*.so* ${BOXEE_RES}/system/players/paplayer + +# flashplayer +mkdir ${BOXEE_RES}/system/players/flashplayer +cp ${SRC}/system/players/flashplayer/{libFlashLib-x86_64-osx.dylib,bxflplayer-x86-osx} ${BOXEE_RES}/system/players/flashplayer + +# scrapers +rsync -rl ${SRC}/system/scrapers ${BOXEE_RES}/system/ + +# Userdata +mkdir ${BOXEE_RES}/UserData +cp ${SRC}/UserData/profiles.xml.in ${BOXEE_RES}/UserData +cp ${SRC}/UserData/sources.xml.in.diff.osx ${BOXEE_RES}/UserData +cp ${SRC}/UserData/sources.xml.in.osx ${BOXEE_RES}/UserData +cp ${SRC}/UserData/shortcuts.xml.in.osx $BOXEE_RES/UserData + +# scrapers +rsync -rl ${SRC}/system/scrapers ${BOXEE_RES}/system/ + +# python +mkdir ${BOXEE_RES}/system/python +rsync -rl ${SRC}/system/python/local $BOXEE_RES/system/python/ +rsync -rl ${SRC}/system/python/spyce $BOXEE_RES/system/python/ +rsync -rl ${SRC}/system/python/Lib $BOXEE_RES/system/python/ +compile_python $BOXEE_RES/system/python +/bin/rm -rf ${BOXEE_RES}/system/python/local/simplejson/tests +/bin/rm ${BOXEE_RES}/system/python/local/_bxappsec.so +find $BOXEE_RES/system/python -name \*.py -exec rm {} \; + +# +# copy all required frameworks from /opt/local +# +FILES=`find $DEST/Contents/MacOS/*` +FILES=$FILES" "`find $DEST/Contents/Resources/Boxee/bin/*` +FILES=$FILES" "`find $DEST -name "*.so"` +FILES=$FILES" "`find $DEST -name "*.so.*"` +FILES=$FILES" "`find $DEST -name "*.dylib" | grep -v Qt | grep -v plugins` +FILES=$FILES" "`find $DEST -name "*.dylib.*" | grep -v Qt | grep -v plugins` + +for F in $FILES +do +# echo "Processing $F..." + + LIBS=`otool -L $F | grep opt | awk '{print $1}'` + + for L in $LIBS + do + SL=`basename $L` + + if [ ! -e $DEST/Contents/Frameworks/$SL ] + then +# echo "Copying $SL..." + cp $L $DEST/Contents/Frameworks/ + chmod 755 $DEST/Contents/Frameworks/$SL + fi + done +done + +# +# Rename all the dependencies in the binaries +# +FILES=`find $DEST/Contents/MacOS/*` +FILES=$FILES" "`find $DEST/Contents/Resources/Boxee/bin/*` +FILES=$FILES" "`find $DEST -name "*.so"` +FILES=$FILES" "`find $DEST -name "*.so.*"` +FILES=$FILES" "`find $DEST -name "*.dylib" | grep -v Qt` +FILES=$FILES" "`find $DEST -name "*.dylib.*" | grep -v Qt` + +for F in $FILES +do + LIBS=`otool -L $F | grep opt | awk '{print $1}'` + + for L in $LIBS + do +# echo "Fixing $L in $F..." + SL=`basename $L` + install_name_tool -change "$L" @executable_path/../Frameworks/$SL "$F" + done +done + +# +# Prepare all the info files for the setup tool +# +sed -e 's/\$VERSION/'$boxee_ver'.'$ver'/g' $SRC/osx-distro/welcome.rtf > $SRC/osx-distro/welcome-gen.rtf +sed -e 's/\$VERSION/'$boxee_ver'.'$ver'/g' $SRC/osx-distro/info-orig.rtf > $SRC/osx-distro/info.rtf +sed -e 's/${VERSION}/'$boxee_ver'.'$ver'/g' $SRC/osx-distro/boxee.pmdoc/index.xml.in > $SRC/osx-distro/boxee.pmdoc/index.xml +sed -i"" -e 's/${VER}/'$ver'/g' $SRC/osx-distro/boxee.pmdoc/index.xml +sed -e 's/${VERSION}/'$boxee_ver'.'$ver'/g' $SRC/osx-distro/boxee.pmdoc/01boxee.xml.in > $SRC/osx-distro/boxee.pmdoc/01boxee.xml diff --git a/osx-distro/strip_depends.py b/osx-distro/strip_depends.py new file mode 100644 index 00000000..f16e5245 --- /dev/null +++ b/osx-distro/strip_depends.py @@ -0,0 +1,28 @@ +import subprocess +import sys +import os +import sys + + +def my_popen(cmd): + proc = subprocess.Popen(cmd, shell=True, stdin= subprocess.PIPE, stdout= subprocess.PIPE, stderr= subprocess.PIPE) + return proc + +def strip_depends(strip_path): + output = my_popen("otool -L %s" % (strip_path,)).stdout.read() # Find all the dependencies + for line in output.split('\n'): + if '/opt/local' in line: # Need to strip local dependencies + lib_path=line.split()[0] + lib_file_name = os.path.basename(lib_path) + if lib_file_name != os.path.basename(strip_path): # Don't strip one-self, to prevent infinite recursion. + os.system("cp %s ../Frameworks" % (lib_path,)) + print "Copying", lib_path + os.system("install_name_tool -change %s @executable_path/../Frameworks/%s %s" % (lib_path, lib_file_name, strip_path)) + os.system("install_name_tool -id @executable_path/../Frameworks/%s %s" % (lib_file_name, strip_path)) + strip_depends("../Frameworks/%s" % (lib_file_name,)) + +if __name__ == '__main__': + if len(sys.argv) != 2: + print "Usage: %s " % (sys.argv[0],) + sys.exit(1) + strip_depends(sys.argv[1]) \ No newline at end of file diff --git a/project/VS2010Express/BOXEE for Windows.sln b/project/VS2010Express/BOXEE for Windows.sln new file mode 100644 index 00000000..795a4c3d --- /dev/null +++ b/project/VS2010Express/BOXEE for Windows.sln @@ -0,0 +1,133 @@ +ïŧŋ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "guilib", "guilib.vcxproj", "{510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libPlatinum", "libPlatinum.vcxproj", "{B2975495-FBE4-4F94-AAC5-B21A9842BF50}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnrarXLib", "UnrarXLib.vcxproj", "{FE0A91C0-E30A-47CD-8A92-A508C9292452}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libhts", "..\..\xbmc\lib\libhts\Win32\libhts_2008.vcxproj", "{00700E12-A63B-4E54-B962-4011A90584BD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmms", "..\..\xbmc\lib\libmms\libmms_win32\msvc++\libmms.vcxproj", "{3A575CF0-45B3-41CC-85E2-9F9CE8C56B38}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glib", "..\..\xbmc\lib\libmms\glib-2.20.4\build\win32\vs9\glib.vcxproj", "{12BCA020-EABF-429E-876A-A476BC9C10C0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BOXEE", "BOXEE.vcxproj", "{3A68081D-E8F9-4523-9436-530DE9E5530A}" + ProjectSection(ProjectDependencies) = postProject + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "..\..\lib\freetype\builds\win32\vc2010\freetype.vcxproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug (DirectX)|Win32 = Debug (DirectX)|Win32 + Debug (OpenGL)|Win32 = Debug (OpenGL)|Win32 + Debug (OpenGLES)|Win32 = Debug (OpenGLES)|Win32 + Release (DirectX)|Win32 = Release (DirectX)|Win32 + Release (OpenGL)|Win32 = Release (OpenGL)|Win32 + Release (OpenGLES)|Win32 = Release (OpenGLES)|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}.Debug (DirectX)|Win32.ActiveCfg = Debug (DirectX)|Win32 + {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}.Debug (DirectX)|Win32.Build.0 = Debug (DirectX)|Win32 + {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}.Debug (OpenGL)|Win32.ActiveCfg = Debug (OpenGL)|Win32 + {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}.Debug (OpenGL)|Win32.Build.0 = Debug (OpenGL)|Win32 + {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}.Debug (OpenGLES)|Win32.ActiveCfg = Debug (OpenGLES)|Win32 + {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}.Debug (OpenGLES)|Win32.Build.0 = Debug (OpenGLES)|Win32 + {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}.Release (DirectX)|Win32.ActiveCfg = Release (DirectX)|Win32 + {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}.Release (DirectX)|Win32.Build.0 = Release (DirectX)|Win32 + {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}.Release (OpenGL)|Win32.ActiveCfg = Release (OpenGL)|Win32 + {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}.Release (OpenGL)|Win32.Build.0 = Release (OpenGL)|Win32 + {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}.Release (OpenGLES)|Win32.ActiveCfg = Release (OpenGLES)|Win32 + {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}.Release (OpenGLES)|Win32.Build.0 = Release (OpenGLES)|Win32 + {B2975495-FBE4-4F94-AAC5-B21A9842BF50}.Debug (DirectX)|Win32.ActiveCfg = Debug|Win32 + {B2975495-FBE4-4F94-AAC5-B21A9842BF50}.Debug (DirectX)|Win32.Build.0 = Debug|Win32 + {B2975495-FBE4-4F94-AAC5-B21A9842BF50}.Debug (OpenGL)|Win32.ActiveCfg = Debug|Win32 + {B2975495-FBE4-4F94-AAC5-B21A9842BF50}.Debug (OpenGL)|Win32.Build.0 = Debug|Win32 + {B2975495-FBE4-4F94-AAC5-B21A9842BF50}.Debug (OpenGLES)|Win32.ActiveCfg = Debug|Win32 + {B2975495-FBE4-4F94-AAC5-B21A9842BF50}.Debug (OpenGLES)|Win32.Build.0 = Debug|Win32 + {B2975495-FBE4-4F94-AAC5-B21A9842BF50}.Release (DirectX)|Win32.ActiveCfg = Release|Win32 + {B2975495-FBE4-4F94-AAC5-B21A9842BF50}.Release (DirectX)|Win32.Build.0 = Release|Win32 + {B2975495-FBE4-4F94-AAC5-B21A9842BF50}.Release (OpenGL)|Win32.ActiveCfg = Release|Win32 + {B2975495-FBE4-4F94-AAC5-B21A9842BF50}.Release (OpenGL)|Win32.Build.0 = Release|Win32 + {B2975495-FBE4-4F94-AAC5-B21A9842BF50}.Release (OpenGLES)|Win32.ActiveCfg = Release|Win32 + {B2975495-FBE4-4F94-AAC5-B21A9842BF50}.Release (OpenGLES)|Win32.Build.0 = Release|Win32 + {FE0A91C0-E30A-47CD-8A92-A508C9292452}.Debug (DirectX)|Win32.ActiveCfg = Debug (DirectX)|Win32 + {FE0A91C0-E30A-47CD-8A92-A508C9292452}.Debug (DirectX)|Win32.Build.0 = Debug (DirectX)|Win32 + {FE0A91C0-E30A-47CD-8A92-A508C9292452}.Debug (OpenGL)|Win32.ActiveCfg = Debug (OpenGL)|Win32 + {FE0A91C0-E30A-47CD-8A92-A508C9292452}.Debug (OpenGL)|Win32.Build.0 = Debug (OpenGL)|Win32 + {FE0A91C0-E30A-47CD-8A92-A508C9292452}.Debug (OpenGLES)|Win32.ActiveCfg = Debug (OpenGLES)|Win32 + {FE0A91C0-E30A-47CD-8A92-A508C9292452}.Debug (OpenGLES)|Win32.Build.0 = Debug (OpenGLES)|Win32 + {FE0A91C0-E30A-47CD-8A92-A508C9292452}.Release (DirectX)|Win32.ActiveCfg = Release (DirectX)|Win32 + {FE0A91C0-E30A-47CD-8A92-A508C9292452}.Release (DirectX)|Win32.Build.0 = Release (DirectX)|Win32 + {FE0A91C0-E30A-47CD-8A92-A508C9292452}.Release (OpenGL)|Win32.ActiveCfg = Release (OpenGL)|Win32 + {FE0A91C0-E30A-47CD-8A92-A508C9292452}.Release (OpenGL)|Win32.Build.0 = Release (OpenGL)|Win32 + {FE0A91C0-E30A-47CD-8A92-A508C9292452}.Release (OpenGLES)|Win32.ActiveCfg = Release (OpenGLES)|Win32 + {FE0A91C0-E30A-47CD-8A92-A508C9292452}.Release (OpenGLES)|Win32.Build.0 = Release (OpenGLES)|Win32 + {00700E12-A63B-4E54-B962-4011A90584BD}.Debug (DirectX)|Win32.ActiveCfg = Debug|Win32 + {00700E12-A63B-4E54-B962-4011A90584BD}.Debug (DirectX)|Win32.Build.0 = Debug|Win32 + {00700E12-A63B-4E54-B962-4011A90584BD}.Debug (OpenGL)|Win32.ActiveCfg = Debug|Win32 + {00700E12-A63B-4E54-B962-4011A90584BD}.Debug (OpenGL)|Win32.Build.0 = Debug|Win32 + {00700E12-A63B-4E54-B962-4011A90584BD}.Debug (OpenGLES)|Win32.ActiveCfg = Debug|Win32 + {00700E12-A63B-4E54-B962-4011A90584BD}.Debug (OpenGLES)|Win32.Build.0 = Debug|Win32 + {00700E12-A63B-4E54-B962-4011A90584BD}.Release (DirectX)|Win32.ActiveCfg = Release|Win32 + {00700E12-A63B-4E54-B962-4011A90584BD}.Release (DirectX)|Win32.Build.0 = Release|Win32 + {00700E12-A63B-4E54-B962-4011A90584BD}.Release (OpenGL)|Win32.ActiveCfg = Release|Win32 + {00700E12-A63B-4E54-B962-4011A90584BD}.Release (OpenGL)|Win32.Build.0 = Release|Win32 + {00700E12-A63B-4E54-B962-4011A90584BD}.Release (OpenGLES)|Win32.ActiveCfg = Release|Win32 + {00700E12-A63B-4E54-B962-4011A90584BD}.Release (OpenGLES)|Win32.Build.0 = Release|Win32 + {3A575CF0-45B3-41CC-85E2-9F9CE8C56B38}.Debug (DirectX)|Win32.ActiveCfg = Debug|Win32 + {3A575CF0-45B3-41CC-85E2-9F9CE8C56B38}.Debug (DirectX)|Win32.Build.0 = Debug|Win32 + {3A575CF0-45B3-41CC-85E2-9F9CE8C56B38}.Debug (OpenGL)|Win32.ActiveCfg = Debug|Win32 + {3A575CF0-45B3-41CC-85E2-9F9CE8C56B38}.Debug (OpenGL)|Win32.Build.0 = Debug|Win32 + {3A575CF0-45B3-41CC-85E2-9F9CE8C56B38}.Debug (OpenGLES)|Win32.ActiveCfg = Debug|Win32 + {3A575CF0-45B3-41CC-85E2-9F9CE8C56B38}.Debug (OpenGLES)|Win32.Build.0 = Debug|Win32 + {3A575CF0-45B3-41CC-85E2-9F9CE8C56B38}.Release (DirectX)|Win32.ActiveCfg = Release|Win32 + {3A575CF0-45B3-41CC-85E2-9F9CE8C56B38}.Release (DirectX)|Win32.Build.0 = Release|Win32 + {3A575CF0-45B3-41CC-85E2-9F9CE8C56B38}.Release (OpenGL)|Win32.ActiveCfg = Release|Win32 + {3A575CF0-45B3-41CC-85E2-9F9CE8C56B38}.Release (OpenGL)|Win32.Build.0 = Release|Win32 + {3A575CF0-45B3-41CC-85E2-9F9CE8C56B38}.Release (OpenGLES)|Win32.ActiveCfg = Release|Win32 + {3A575CF0-45B3-41CC-85E2-9F9CE8C56B38}.Release (OpenGLES)|Win32.Build.0 = Release|Win32 + {12BCA020-EABF-429E-876A-A476BC9C10C0}.Debug (DirectX)|Win32.ActiveCfg = Debug|Win32 + {12BCA020-EABF-429E-876A-A476BC9C10C0}.Debug (DirectX)|Win32.Build.0 = Debug|Win32 + {12BCA020-EABF-429E-876A-A476BC9C10C0}.Debug (OpenGL)|Win32.ActiveCfg = Debug|Win32 + {12BCA020-EABF-429E-876A-A476BC9C10C0}.Debug (OpenGL)|Win32.Build.0 = Debug|Win32 + {12BCA020-EABF-429E-876A-A476BC9C10C0}.Debug (OpenGLES)|Win32.ActiveCfg = Debug|Win32 + {12BCA020-EABF-429E-876A-A476BC9C10C0}.Debug (OpenGLES)|Win32.Build.0 = Debug|Win32 + {12BCA020-EABF-429E-876A-A476BC9C10C0}.Release (DirectX)|Win32.ActiveCfg = Release|Win32 + {12BCA020-EABF-429E-876A-A476BC9C10C0}.Release (DirectX)|Win32.Build.0 = Release|Win32 + {12BCA020-EABF-429E-876A-A476BC9C10C0}.Release (OpenGL)|Win32.ActiveCfg = Release|Win32 + {12BCA020-EABF-429E-876A-A476BC9C10C0}.Release (OpenGL)|Win32.Build.0 = Release|Win32 + {12BCA020-EABF-429E-876A-A476BC9C10C0}.Release (OpenGLES)|Win32.ActiveCfg = Release|Win32 + {12BCA020-EABF-429E-876A-A476BC9C10C0}.Release (OpenGLES)|Win32.Build.0 = Release|Win32 + {3A68081D-E8F9-4523-9436-530DE9E5530A}.Debug (DirectX)|Win32.ActiveCfg = Debug (DirectX)|Win32 + {3A68081D-E8F9-4523-9436-530DE9E5530A}.Debug (DirectX)|Win32.Build.0 = Debug (DirectX)|Win32 + {3A68081D-E8F9-4523-9436-530DE9E5530A}.Debug (OpenGL)|Win32.ActiveCfg = Debug (OpenGL)|Win32 + {3A68081D-E8F9-4523-9436-530DE9E5530A}.Debug (OpenGL)|Win32.Build.0 = Debug (OpenGL)|Win32 + {3A68081D-E8F9-4523-9436-530DE9E5530A}.Debug (OpenGLES)|Win32.ActiveCfg = Debug (OpenGLES)|Win32 + {3A68081D-E8F9-4523-9436-530DE9E5530A}.Debug (OpenGLES)|Win32.Build.0 = Debug (OpenGLES)|Win32 + {3A68081D-E8F9-4523-9436-530DE9E5530A}.Release (DirectX)|Win32.ActiveCfg = Release (DirectX)|Win32 + {3A68081D-E8F9-4523-9436-530DE9E5530A}.Release (DirectX)|Win32.Build.0 = Release (DirectX)|Win32 + {3A68081D-E8F9-4523-9436-530DE9E5530A}.Release (OpenGL)|Win32.ActiveCfg = Release (OpenGL)|Win32 + {3A68081D-E8F9-4523-9436-530DE9E5530A}.Release (OpenGL)|Win32.Build.0 = Release (OpenGL)|Win32 + {3A68081D-E8F9-4523-9436-530DE9E5530A}.Release (OpenGLES)|Win32.ActiveCfg = Release (OpenGLES)|Win32 + {3A68081D-E8F9-4523-9436-530DE9E5530A}.Release (OpenGLES)|Win32.Build.0 = Release (OpenGLES)|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug (DirectX)|Win32.ActiveCfg = Debug Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug (DirectX)|Win32.Build.0 = Debug Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug (OpenGL)|Win32.ActiveCfg = Debug Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug (OpenGL)|Win32.Build.0 = Debug Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug (OpenGLES)|Win32.ActiveCfg = Debug Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug (OpenGLES)|Win32.Build.0 = Debug Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release (DirectX)|Win32.ActiveCfg = Release Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release (DirectX)|Win32.Build.0 = Release Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release (OpenGL)|Win32.ActiveCfg = Release Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release (OpenGL)|Win32.Build.0 = Release Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release (OpenGLES)|Win32.ActiveCfg = Release Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release (OpenGLES)|Win32.Build.0 = Release Multithreaded|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/project/VS2010Express/BOXEE for Windows.userprefs b/project/VS2010Express/BOXEE for Windows.userprefs new file mode 100644 index 00000000..2827e44d --- /dev/null +++ b/project/VS2010Express/BOXEE for Windows.userprefs @@ -0,0 +1,8 @@ +ïŧŋ + + + + + + + \ No newline at end of file diff --git a/project/VS2010Express/BOXEE.vcxproj b/project/VS2010Express/BOXEE.vcxproj new file mode 100644 index 00000000..f53b46fc --- /dev/null +++ b/project/VS2010Express/BOXEE.vcxproj @@ -0,0 +1,2887 @@ +ïŧŋ + + + + Debug (DirectX) + Win32 + + + Debug (OpenGL) + Win32 + + + Debug (OpenGLES) + Win32 + + + Release (DirectX) + Win32 + + + Release (OpenGL) + Win32 + + + Release (OpenGLES) + Win32 + + + Template + Win32 + + + + {3A68081D-E8F9-4523-9436-530DE9E5530A} + XBMC_PC + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + BOXEE\$(Configuration)\ + BOXEE\$(Configuration)\ + true + BOXEE\$(Configuration)\ + BOXEE\$(Configuration)\ + true + false + false + BOXEE\$(Configuration)\ + BOXEE\$(Configuration)\ + true + BOXEE\$(Configuration)\ + BOXEE\$(Configuration)\ + false + false + false + BOXEE\$(Configuration)\ + BOXEE\$(Configuration)\ + true + BOXEE\$(Configuration)\ + BOXEE\$(Configuration)\ + false + false + false + $(DXSDK_DIR)Include;$(IncludePath) + $(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(DXSDK_DIR)Include;$(IncludePath) + $(DXSDK_DIR)Include;$(IncludePath) + $(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(MSBuildToolsPath32);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib; + $(DXSDK_DIR)Include;$(IncludePath) + $(DXSDK_DIR)Lib\x86;$(LibraryPath) + + + + /EHa %(AdditionalOptions) + Disabled + ..\..\xbmc\lib\libcurl\yassl-1.9.2\include;..\..\xbmc\lib\libBoxee\libpcre;..\..\xbmc\lib\libBoxee;..\..\xbmc\cores\dvdplayer;..\..\xbmc\win32;..\..\xbmc\cores;..\..\xbmc\;..\..\xbmc\utils;..\..\guilib\;..\..\;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\xbmc\lib\libUPnP\Platinum\Source\Platinum;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\xbmc\lib\libUPnP\Platinum\Source\Core;..\..\xbmc\lib\libUPnP\Neptune\Source\Core;..\..\xbmc\lib\libUPnP\Neptune\Source\System\Win32;..\..\xbmc\cores\dvdplayer\DVDCodecs\Overlay;..\..\xbmc\FileSystem;..\..\xbmc\lib\libRTMP;..\..\xbmc\lib\boost;..\..\xbmc\lib\libPython\Python\PC;..\..\lib\libSDL-WIN32\include;..\..\xbmc\lib\libsamplerate\src;..\..\xbmc\lib;..\..\xbmc\lib\BugTrap\;..\..\\guilib\tinyXML;..\..\lib\freetype\include;..\..\lib\libgdbm;..\..\xbmc\cores\dvdplayer\Codecs;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg\include;..\..\xbmc\lib\libhts\Win32\include;..\..\xbmc\lib\libjson\include;..\..\xbmc\lib\libiconv;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg\include-xbmc-win32;..\..\xbmc\lib\libbluray\src;%(AdditionalIncludeDirectories) + _WINDOWS;_MSVC;WIN32;_DEBUG;_WIN32_WINNT=0x0501;NTDDI_VERSION=0x05010300;NOMINMAX;_USE_32BIT_TIME_T;TIXML_USE_STL;D3D_DEBUG_INFO;HAS_DX;USE_GDBM_DLL;USE_PYTHON_DLL;CURL_STATICLIB;HAS_DVD_LIBA52_CODEC;HAS_DVD_LIBDTS_CODEC;HAS_AUDIO_HDMI;%(PreprocessorDefinitions) + false + Async + Default + MultiThreadedDebug + Use + pch.h + $(IntDir)/%(RelativeDir)/ + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + pch.h;%(ForcedIncludeFiles) + true + + + /MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions) + SDL.lib;D3D9.lib;D3dx9.lib;DSound.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;libz.a;ssleay32.lib;libeay32.lib;libpcre.lib;SetupAPI.lib;libgdbm.lib;libcurl.lib;openldap.lib;%(AdditionalDependencies) + $(OutDir)BOXEE.exe + ../../xbmc/lib/libpcre/;../../xbmc/lib/libPython;../../xbmc/FileSystem/curl/;..\..\lib\libSDL-WIN32\lib;..\..\xbmc\cores\ffmpeg;..\..\xbmc\lib\libgdbm;..\..\lib\freetype\objs\win32\vc2008;%(AdditionalLibraryDirectories) + libc;msvcrt;libcmt;%(IgnoreSpecificDefaultLibraries) + + + true + $(OutDir)BOXEE.pdb + Windows + true + + + false + + + MachineX86 + false + + + DeclareDPIAware.manifest;VC90.CRT.x86.manifest;%(AdditionalManifestFiles) + + + + + + + + + + + + + + + + + Updating version number... + + + + + /EHa /MP %(AdditionalOptions) + MaxSpeed + Default + Speed + true + ..\..\xbmc\lib\libcurl\yassl-1.9.2\include;..\..\xbmc\lib\libBoxee\libpcre;..\..\xbmc\lib\libBoxee;..\..\xbmc\cores\dvdplayer;..\..\xbmc\win32;..\..\\guilib\tinyXML;..\..\xbmc\cores;..\..\xbmc\;..\..\xbmc\utils;..\..\guilib\;..\..\;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\xbmc\lib\libUPnP\Platinum\Source\Platinum;..\..\xbmc\lib\libUPnP\Platinum\Source\Core;..\..\xbmc\lib\libUPnP\Neptune\Source\Core;..\..\xbmc\lib\libUPnP\Neptune\Source\System\Win32;..\..\xbmc\cores\dvdplayer\DVDCodecs\Overlay;..\..\xbmc\FileSystem;..\..\xbmc\lib\libRTMP;..\..\xbmc\lib\boost;..\..\xbmc\lib\libPython\Python\PC;..\..\xbmc\cores\flashplayer;..\..\lib\libSDL-WIN32\include;..\..\xbmc\lib\libsamplerate\src;..\..\xbmc\lib\BugTrap\;..\..\xbmc\lib;..\..\lib\freetype\include;..\..\lib\libgdbm;..\..\xbmc\cores\dvdplayer\Codecs;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg\include;..\..\xbmc\lib\libhts\Win32\include;..\..\xbmc\lib\libjson\include;..\..\xbmc\lib\libiconv;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg\include-xbmc-win32;..\..\xbmc\lib\libbluray\src;%(AdditionalIncludeDirectories) + _WINDOWS;_MSVC;WIN32;NDEBUG;_WIN32_WINNT=0x0501;NTDDI_VERSION=0x05010300;NOMINMAX;_USE_32BIT_TIME_T;TIXML_USE_STL;CURL_STATICLIB;HAS_DX;USE_GDBM_DLL;USE_PYTHON_DLL;HAS_DVD_LIBA52_CODEC;HAS_DVD_LIBDTS_CODEC;HAS_AUDIO_HDMI;%(PreprocessorDefinitions) + false + false + Async + MultiThreaded + false + false + StreamingSIMDExtensions + Use + pch.h + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + pch.h;%(ForcedIncludeFiles) + $(IntDir)/%(RelativeDir)/ + + + /MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions) + SDL.lib;D3D9.lib;D3dx9.lib;DSound.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;libcurl.lib;libz.a;ssleay32.lib;libeay32.lib;libpcre.lib;SetupAPI.lib;libgdbm.lib;openldap.lib;%(AdditionalDependencies) + $(OutDir)BOXEE.exe + ../../xbmc/lib/libpcre/;../../xbmc/FileSystem/curl/;..\..\lib\libSDL-WIN32\lib;../../xbmc/lib/libscrobbler/;../../xbmc/lib/BugTrap;..\..\xbmc\cores\ffmpeg;..\..\xbmc\lib\libgdbm;..\..\lib\freetype\objs\win32\vc2008;%(AdditionalLibraryDirectories) + libc;msvcrt;libci;%(IgnoreSpecificDefaultLibraries) + true + $(OutDir)XBMC.pdb + Windows + true + true + true + false + + + MachineX86 + + + DeclareDPIAware.manifest;VC90.CRT.x86.manifest;%(AdditionalManifestFiles) + + + + + + + + + + + + + /EHa %(AdditionalOptions) + Disabled + ..\..\xbmc\lib\libcurl\yassl-1.9.2\include;..\..\xbmc\lib\libBoxee\libpcre;..\..\xbmc\lib\libBoxee;..\..\xbmc\cores\dvdplayer;..\..\xbmc\win32;..\..\xbmc\cores;..\..\xbmc\;..\..\xbmc\utils;..\..\guilib\;..\..\;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\xbmc\lib\libUPnP\Platinum\Source\Platinum;..\..\xbmc\lib\libUPnP\Platinum\Source\Core;..\..\xbmc\lib\libUPnP\Neptune\Source\Core;..\..\xbmc\lib\libUPnP\Neptune\Source\System\Win32;..\..\xbmc\cores\dvdplayer\DVDCodecs\Overlay;..\..\xbmc\FileSystem;..\..\xbmc\lib\libRTMP;..\..\xbmc\lib\boost;..\..\xbmc\lib\libPython\Python\PC;..\..\lib\libSDL-WIN32\include;..\..\xbmc\lib\libsamplerate\src;..\..\xbmc\lib;..\..\xbmc\lib\BugTrap\;..\..\\guilib\tinyXML;..\..\lib\freetype\include;..\..\xbmc\lib\libglew\;..\..\xbmc\cores\dvdplayer\Codecs;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg\include;..\..\xbmc\lib\libhts\Win32\include;..\..\xbmc\lib\libjson\include;..\..\xbmc\lib\libiconv;..\..\xbmc\lib\libcdio;..\..\xbmc\lib\libbluray\src;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg\include-xbmc-win32;%(AdditionalIncludeDirectories) + _WINDOWS;_MSVC;WIN32;_DEBUG;NOMINMAX;_WIN32_WINNT=0x0501;NTDDI_VERSION=0x05010300;_USE_32BIT_TIME_T;TIXML_USE_STL;CURL_STATICLIB;HAVE_FFMPEG_AVUTIL_H;HAVE_FFMPEG_SWSCALE_H;HAVE_FFMPEG_RGB2RGB_H;HAVE_POSTPROC_POSTPROCESS_H;HAS_GL;HAS_GLEW;HAS_GL2;USE_GDBM_DLL;USE_PYTHON_DLL;HAS_DVD_LIBA52_CODEC;HAS_DVD_LIBDTS_CODEC;HAS_AUDIO_HDMI;%(PreprocessorDefinitions) + true + Async + Default + MultiThreadedDebug + Use + pch.h + $(IntDir)/%(RelativeDir)/ + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + pch.h;%(ForcedIncludeFiles) + false + true + + + /MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions) + SDL.lib;opengl32.lib;DSound.lib;glew32.lib;glu32.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;libcurl.lib;libz.a;ssleay32.lib;libeay32.lib;libpcre.lib;SetupAPI.lib;libgdbm.lib;openldap.lib;%(AdditionalDependencies) + $(OutDir)BOXEE.exe + ../../xbmc/lib/libpcre/;../../xbmc/lib/libPython;../../xbmc/FileSystem/curl/;..\..\lib\libSDL-WIN32\lib;..\..\xbmc\cores\ffmpeg;..\..\xbmc\lib\libgdbm;../../xbmc/lib/libglew;..\..\lib\freetype\objs\win32\vc2008;%(AdditionalLibraryDirectories) + libc;msvcrt;libcmt;%(IgnoreSpecificDefaultLibraries) + + + true + $(OutDir)XBMC.pdb + Windows + true + + + false + + + MachineX86 + false + + + DeclareDPIAware.manifest;VC90.CRT.x86.manifest;%(AdditionalManifestFiles) + + + + + + + + + + + + + + + + + Updating version number... + + + + + /EHa /MP %(AdditionalOptions) + Full + Default + Speed + true + ..\..\xbmc\lib\libcurl\yassl-1.9.2\include;..\..\xbmc\lib\libBoxee\libpcre;..\..\xbmc\lib\libBoxee;..\..\xbmc\cores\dvdplayer;..\..\xbmc\win32;..\..\\guilib\tinyXML;..\..\xbmc\cores;..\..\xbmc\;..\..\xbmc\utils;..\..\guilib\;..\..\;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\xbmc\lib\libUPnP\Platinum\Source\Platinum;..\..\xbmc\lib\libUPnP\Platinum\Source\Core;..\..\xbmc\lib\libUPnP\Neptune\Source\Core;..\..\xbmc\lib\libUPnP\Platinum\Neptune\Source\Core;..\..\xbmc\lib\libUPnP\Platinum\Neptune\Source\System\Win32;..\..\xbmc\cores\dvdplayer\DVDCodecs\Overlay;..\..\xbmc\FileSystem;..\..\xbmc\lib\libRTMP;..\..\xbmc\lib\boost;..\..\xbmc\lib\libPython\Python\PC;..\..\xbmc\cores\flashplayer;..\..\lib\libSDL-WIN32\include;..\..\xbmc\lib\libsamplerate\src;..\..\xbmc\lib\BugTrap\;..\..\xbmc\lib;..\..\lib\freetype\include;..\..\xbmc\lib\libglew\;..\..\xbmc\cores\dvdplayer\Codecs;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg\include;..\..\xbmc\lib\libhts\Win32\include;..\..\xbmc\lib\libjson\include;..\..\xbmc\lib\libiconv;..\..\xbmc\lib\libbluray\src;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg\include-xbmc-win32;%(AdditionalIncludeDirectories) + _WINDOWS;_MSVC;WIN32;NDEBUG;_WIN32_WINNT=0x0501;NTDDI_VERSION=0x05010300;NOMINMAX;_USE_32BIT_TIME_T;TIXML_USE_STL;CURL_STATICLIB;HAVE_FFMPEG_AVUTIL_H;HAVE_FFMPEG_SWSCALE_H;HAVE_FFMPEG_RGB2RGB_H;HAVE_POSTPROC_POSTPROCESS_H;HAS_GL;HAS_GLEW;HAS_GL2;USE_GDBM_DLL;USE_PYTHON_DLL;HAS_DVD_LIBA52_CODEC;HAS_DVD_LIBDTS_CODEC;HAS_AUDIO_HDMI;%(PreprocessorDefinitions) + false + false + Async + MultiThreaded + false + false + StreamingSIMDExtensions + Use + pch.h + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + pch.h;%(ForcedIncludeFiles) + $(IntDir)/%(RelativeDir)/ + true + + + /MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions) + SDL.lib;opengl32.lib;DSound.lib;glew32.lib;glu32.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;libcurl.lib;libz.a;ssleay32.lib;libeay32.lib;libpcre.lib;SetupAPI.lib;libgdbm.lib;openldap.lib;%(AdditionalDependencies) + $(OutDir)BOXEE.exe + ../../xbmc/lib/libpcre/;../../xbmc/lib/libPython;../../xbmc/FileSystem/curl/;..\..\lib\libSDL-WIN32\lib;..\..\xbmc\cores\ffmpeg;..\..\xbmc\lib\libgdbm;../../xbmc/lib/libglew;..\..\lib\freetype\objs\win32\vc2008;%(AdditionalLibraryDirectories) + libc;msvcrt;libci;%(IgnoreSpecificDefaultLibraries) + true + $(OutDir)XBMC.pdb + Windows + true + true + true + false + + + MachineX86 + + + DeclareDPIAware.manifest;VC90.CRT.x86.manifest;%(AdditionalManifestFiles) + + + + + + + + + + + + + /EHa %(AdditionalOptions) + Disabled + ..\..\xbmc\lib\libcurl\yassl-1.9.2\include;..\..\xbmc\lib\libBoxee\libpcre;..\..\xbmc\lib\libBoxee;..\..\xbmc\cores\dvdplayer;..\..\xbmc\win32;..\..\xbmc\cores;..\..\xbmc\;..\..\xbmc\utils;..\..\guilib\;..\..\;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\xbmc\lib\libUPnP\Platinum\Source\Platinum;..\..\xbmc\lib\libUPnP\Platinum\Source\Core;..\..\xbmc\lib\libUPnP\Neptune\Source\Core;..\..\xbmc\lib\libUPnP\Neptune\Source\System\Win32;..\..\xbmc\lib\libUPnP\Platinum\Thirdparty\Neptune\Source\Core;..\..\xbmc\lib\libUPnP\Platinum\Thirdparty\Neptune\Source\System\Win32;..\..\xbmc\cores\dvdplayer\DVDCodecs\Overlay;..\..\xbmc\FileSystem;..\..\xbmc\lib\libRTMP;..\..\xbmc\lib\boost;..\..\xbmc\lib\libPython\Python\PC;..\..\lib\libSDL-WIN32\include;..\..\xbmc\lib\libsamplerate\src;..\..\xbmc\lib;..\..\xbmc\lib\BugTrap\;..\..\\guilib\tinyXML;..\..\lib\freetype\include\freetype2;..\..\lib\freetype\include;..\..\xbmc\lib\libglew\;%(AdditionalIncludeDirectories) + _WINDOWS;_MSVC;WIN32;_DEBUG;_WIN32_WINNT=0x0501;WINVER=0x0500;NOMINMAX;_USE_32BIT_TIME_T;TIXML_USE_STL;CURL_STATICLIB;USE_EXTERNAL_FFMPEG;HAVE_FFMPEG_AVUTIL_H;HAVE_FFMPEG_SWSCALE_H;HAVE_FFMPEG_RGB2RGB_H;HAVE_POSTPROC_POSTPROCESS_H;HAS_GLES=2;HAS_EGL;%(PreprocessorDefinitions) + true + Async + Default + MultiThreadedDebug + Use + pch.h + $(IntDir)/%(RelativeDir)/ + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + pch.h;%(ForcedIncludeFiles) + + + /MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions) + SDL.lib;opengl32.lib;DSound.lib;glew32.lib;glu32.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;libcurl.lib;libz.a;ssleay32.lib;libeay32.lib;libpcre.lib;SetupAPI.lib;libgdbm.lib;%(AdditionalDependencies) + $(OutDir)BOXEE.exe + ../../xbmc/lib/libpcre/;../../xbmc/lib/libPython;../../xbmc/FileSystem/curl/;..\..\lib\libSDL-WIN32\lib;..\..\xbmc\cores\ffmpeg;..\..\xbmc\lib\libgdbm;%(AdditionalLibraryDirectories) + libc;msvcrt;libcmt;%(IgnoreSpecificDefaultLibraries) + + + true + $(OutDir)XBMC.pdb + Windows + true + + + false + + + MachineX86 + false + + + + + + + + + + + + + + + + + Updating version number... + + + + + /EHa /MP %(AdditionalOptions) + Full + Default + Speed + true + ..\..\xbmc\lib\libcurl\yassl-1.9.2\include;..\..\xbmc\lib\libBoxee\libpcre;..\..\xbmc\lib\libBoxee;..\..\xbmc\cores\dvdplayer;..\..\xbmc\win32;..\..\xbmc\cores;..\..\xbmc\;..\..\xbmc\utils;..\..\guilib\;..\..\;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\xbmc\lib\libUPnP\Platinum\Source\Platinum;..\..\xbmc\lib\libUPnP\Platinum\Source\Core;..\..\xbmc\lib\libUPnP\Neptune\Source\Core;..\..\xbmc\lib\libUPnP\Neptune\Source\System\Win32;..\..\xbmc\lib\libUPnP\Platinum\Thirdparty\Neptune\Source\Core;..\..\xbmc\lib\libUPnP\Platinum\Thirdparty\Neptune\Source\System\Win32;..\..\xbmc\cores\dvdplayer\DVDCodecs\Overlay;..\..\xbmc\FileSystem;..\..\xbmc\lib\libRTMP;..\..\xbmc\lib\boost;..\..\xbmc\lib\libPython\Python\PC;..\..\lib\libSDL-WIN32\include;..\..\xbmc\lib\libsamplerate\src;..\..\xbmc\lib;..\..\xbmc\lib\BugTrap\;..\..\\guilib\tinyXML;..\..\lib\freetype\include\freetype2;..\..\lib\freetype\include;..\..\xbmc\lib\libglew\;%(AdditionalIncludeDirectories) + _WINDOWS;_MSVC;WIN32;NDEBUG;_WIN32_WINNT=0x0501;WINVER=0x0500;NOMINMAX;_USE_32BIT_TIME_T;TIXML_USE_STL;CURL_STATICLIB;USE_EXTERNAL_FFMPEG;HAVE_FFMPEG_AVUTIL_H;HAVE_FFMPEG_SWSCALE_H;HAVE_FFMPEG_RGB2RGB_H;HAVE_POSTPROC_POSTPROCESS_H;HAS_GLES=2;HAS_EGL;%(PreprocessorDefinitions) + false + false + Async + MultiThreaded + false + false + StreamingSIMDExtensions + Use + pch.h + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + pch.h;%(ForcedIncludeFiles) + $(IntDir)/%(RelativeDir)/ + + + /MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions) + SDL.lib;opengl32.lib;DSound.lib;glew32.lib;glu32.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;libcurl.lib;libz.a;ssleay32.lib;libeay32.lib;libpcre.lib;SetupAPI.lib;libgdbm.lib;%(AdditionalDependencies) + $(OutDir)BOXEE.exe + ../../xbmc/lib/libpcre/;../../xbmc/lib/libPython;../../xbmc/FileSystem/curl/;..\..\lib\libSDL-WIN32\lib;..\..\xbmc\cores\ffmpeg;..\..\xbmc\lib\libgdbm;%(AdditionalLibraryDirectories) + libc;msvcrt;libci;%(IgnoreSpecificDefaultLibraries) + true + $(OutDir)XBMC.pdb + Windows + true + true + true + false + + + MachineX86 + + + + + + + + + + + + + + + + + + + + + $(IntDir)/%(RelativeDir)/ + ProgramDatabase + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + CompileAsCpp + true + + + CompileAsCpp + true + + + CompileAsCpp + true + + + CompileAsCpp + true + + + CompileAsCpp + true + + + CompileAsCpp + + + true + + + true + + + true + + + true + + + true + + + true + + + + + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + + + + + + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + CompileAsCpp + + + + + + + + + {00700e12-a63b-4e54-b962-4011a90584bd} + false + + + {12bca020-eabf-429e-876a-a476bc9c10c0} + false + + + {3a575cf0-45b3-41cc-85e2-9f9ce8c56b38} + false + + + {510441ac-b9e1-4b31-9c0c-eb3ad39d90c4} + false + + + {b2975495-fbe4-4f94-aac5-b21a9842bf50} + false + + + {fe0a91c0-e30a-47cd-8a92-a508c9292452} + false + + + + + + + + + + + \ No newline at end of file diff --git a/project/VS2010Express/BOXEE.vcxproj.filters b/project/VS2010Express/BOXEE.vcxproj.filters new file mode 100644 index 00000000..c8997b95 --- /dev/null +++ b/project/VS2010Express/BOXEE.vcxproj.filters @@ -0,0 +1,6526 @@ +ïŧŋ + + + + {3d3a14bc-5f3c-4068-a0bf-310a30db8be8} + + + {20e040d8-082a-46ed-9f92-8f2320e25bbc} + + + {4e39b90f-823a-4959-b71a-11e5302402a5} + + + {1a925132-fb6e-4d9e-8a05-4c2d54476267} + + + {5bac9485-6537-475b-968a-b898e4281428} + + + {b9d9a1e9-965e-43b5-97d2-d530b57b2d3b} + + + {113c6626-8864-4b2c-a094-5187619501d5} + + + {4853d74a-c912-4a2f-9a4d-d024a66e5dd7} + + + {1c943684-7ee0-400c-bb37-acf787f20e30} + + + {b9be2e96-10c7-4060-8778-a4acb98a02a7} + + + {21108aaf-07a9-4ccd-918c-afc7f7d58555} + + + {17aa07fc-f530-46e2-8012-2094e844ec5d} + + + {bd28bba2-73f8-4eaf-a2e6-7e8df1c822f1} + + + {90b647f2-27bf-4572-a730-f552f9e9a558} + + + {0317336b-c1b0-4704-a165-c8b06a6065cc} + + + {73517725-daff-45c3-9fa0-6c43d762e477} + + + {1fa4cedc-cd38-4897-bedf-de5e57d77c94} + + + {8aff9873-d222-43bd-815c-5ca8a8d071db} + + + {7954ecce-953d-4c0e-bf77-9a18e3789b6c} + + + {7054ae2a-0c42-47a7-8bea-4e1fe5e1293b} + + + {5a2a0a2b-f5c4-4ad4-9aa6-35559f86f4ff} + + + {72188e03-706f-480d-8a70-b2cf3d89ac59} + + + {21f6b0a1-9c77-4857-9337-373207843e3f} + + + {789a3eaa-c24c-4ed4-b3b2-0b216700a693} + + + {8f7e7721-d44c-4517-9448-b3e44f70b5fb} + + + {c4fff507-bee6-4d96-a7de-2c06748a0e67} + + + {24347080-c10b-44a2-b1af-976993b86f83} + + + {8991c8a6-8612-4198-a29e-0ea043eb33a1} + + + {b986401c-1a21-4947-b6f3-3d6eca2aa790} + + + {815b4ed3-62dd-42c3-81c8-a87a0580a91e} + + + {f3377521-1cd1-4f70-816e-3866040cf949} + + + {3ffa8caf-6e0e-4f21-b680-9246227290c6} + + + {7ac6b0c0-1548-464d-9b24-6782ee4d84ab} + + + {4edc8279-e143-457c-95d9-0ad3b34ad3e8} + + + {c679adae-ec79-4135-b781-897df5f4dc54} + + + {9c65ba4c-c388-49c9-91d2-edede5d83278} + + + {7458c6d2-aed3-404f-91f8-f43c3d1e88ee} + + + {d6470c5e-e0a6-4368-9eb4-34faf1adab82} + + + {b475c3f7-3a2b-490b-be6b-b0fa2ebbdc3e} + + + {43c1c055-aca3-461b-bd01-922542aba5d8} + + + {358fccb2-743e-4bd6-8780-b57dc4aceca4} + + + {4401862e-0ac7-4fa3-a5f0-36f000f1b9f2} + + + {58ccc37b-9a07-497e-abd3-a69ac570abbd} + + + {09107ac8-a817-41cf-8f88-8e7f0e2031f7} + + + {16ed64c4-4c02-48c4-860d-97e6db73e7fd} + + + {9b922b9d-5546-47a6-a4c5-205abfbdc6d3} + + + {08cdec47-0b18-4836-bb1e-2cecdc5ada81} + + + {7e33e0be-50d2-428e-bcc6-1200f0f8e70d} + + + {306b03b3-c996-4579-a381-d4c4b1698fff} + + + {a870d585-1ad5-405b-83d9-c3e55a6ababe} + + + {4f234f1d-6d1e-4b99-82d6-790b0b48015c} + + + {fb8f4948-101c-4c2a-8d29-2ae967774267} + + + {197c3ee9-4b7a-4e9b-b2f9-b4212171e884} + + + {8d9b1b9e-53a2-4d9c-a26c-c7988b2e8aaf} + + + {37568fbd-48f4-4668-94f4-6070bb07f22f} + + + {4aeb4dc3-2f95-49a9-89f0-430f7a375a7c} + + + {fd7b6254-b032-4243-bcb0-0ecbf9f46977} + + + {5da4cf05-425d-45a3-b276-556b42606d37} + + + {62f409c6-c75e-47e3-856f-8aa156b51a99} + + + {ea0c311a-ba9f-4fe0-bfd5-2e1650b1eae7} + + + {ac267e8d-ee46-4511-8747-38bc026a9fae} + + + {f8aa8d22-8b79-44c6-9191-352870777b54} + + + {4ede2667-9012-4a2f-b457-6edbf8157929} + + + {fc0cae8e-0f5a-41cc-b39b-a57188f3c3a1} + + + {5b0b92e6-12d3-4f56-b516-b517f0d48dc0} + + + {89f74bb2-3972-4316-a337-6265dcf2c2cd} + + + {0867b13a-a823-41b6-a14d-1053ff93f82f} + + + {d5c0206d-d75b-4cd4-87b8-30ce1816e543} + + + {508f4985-3f51-4365-9fbb-f567abb05900} + + + + + win32 + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + + + win32 + + + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + cores + + + cores + + + cores + + + cores + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer\DVDCodecs + + + cores\dvdplayer\DVDCodecs + + + cores\dvdplayer\DVDCodecs + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Video + + + cores\dvdplayer\DVDCodecs\Video + + + cores\dvdplayer\DVDCodecs\Video + + + cores\dvdplayer\DVDCodecs\Video + + + cores\dvdplayer\DVDCodecs\Video + + + cores\dvdplayer\DVDCodecs\Video + + + cores\dvdplayer\DVDCodecs\Video + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay\libspucc + + + cores\dvdplayer\DVDDemuxers + + + cores\dvdplayer\DVDDemuxers + + + cores\dvdplayer\DVDDemuxers + + + cores\dvdplayer\DVDDemuxers + + + cores\dvdplayer\DVDDemuxers + + + cores\dvdplayer\DVDDemuxers + + + cores\dvdplayer\DVDDemuxers + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDHeaders + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader\exports + + + cores\DllLoader\exports + + + cores\DllLoader\exports + + + cores\DllLoader\exports\emu_socket + + + cores\DllLoader\exports\emu_socket + + + cores\DllLoader\exports\emu_socket + + + cores\DllLoader\exports\emu_socket + + + cores\DllLoader\exports\emu_socket + + + cores\DllLoader\exports\util + + + cores\Visualisations + + + cores\Visualisations + + + cores\Visualisations + + + cores\Visualisations + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers\Shaders + + + cores\VideoRenderers\Shaders + + + cores\VideoRenderers\Shaders + + + cores\VideoRenderers\Shaders + + + cores\flashplayer + + + cores\flashplayer + + + cores\flashplayer + + + cores\flashplayer + + + cores\Screensavers + + + cores\Screensavers + + + cores\Screensavers + + + cores\Screensavers + + + cores\AudioRenderers + + + cores\AudioRenderers + + + cores\AudioRenderers + + + cores\AudioRenderers + + + cores\AudioRenderers + + + cores\AudioRenderers + + + cores\ExternalPlayer + + + cores\PlayerCoreFactory + + + cores\PlayerCoreFactory + + + cores\PlayerCoreFactory + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Video + + + Source Files\GUI Video + + + Source Files\GUI Video + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders\Pictures + + + Source Files\infoTagReaders\Pictures + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Database + + + Source Files\Database + + + Source Files\Database + + + Source Files\Database + + + Source Files\Database + + + Source Files\Database + + + Source Files\Database + + + Source Files\Database + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\BackgroundLoaders + + + Source Files\BackgroundLoaders + + + Source Files\BackgroundLoaders + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\common + + + Source Files\UPnP + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee Apps + + + Source Files\Boxee Apps + + + Source Files\Boxee Apps + + + Source Files\Boxee Apps + + + Source Files\Boxee Apps + + + Source Files\Boxee Apps + + + Source Files\Boxee Apps\Native Apps + + + Source Files\Boxee Apps\Native Apps + + + Source Files\Boxee Apps\Native Apps + + + Source Files\Boxee Apps\Native Apps + + + Source Files\Boxee Apps\Native Apps + + + Source Files\Python Wrapper + + + Source Files\Windowing\Events + + + Source Files\Windowing\Events + + + Source Files\Windowing\Events + + + Source Files\Windowing\Keyboard + + + Source Files\Windowing\Keyboard + + + Source Files\Windowing\Mouse + + + Source Files\Windowing\Render System + + + Source Files\Windowing\Render System + + + Source Files\Windowing\Render System + + + Source Files\Windowing\Render System + + + Source Files\Windowing\Window System + + + Source Files\Windowing\Window System + + + Source Files\Windowing\Window System + + + Source Files\Windowing\Window System + + + Source Files\Windowing\Window System + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + libraries\libPython + + + libraries\libPython + + + libraries\libPython + + + libraries\libPython + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libPython\python + + + libraries\libGoAhead + + + libraries\libGoAhead + + + libraries\libGoAhead + + + libraries\libGoAhead + + + libraries\libGoAhead + + + libraries\libGoAhead + + + libraries\sqlite + + + libraries\sqlite + + + libraries\sqlite + + + libraries\sqlite + + + libraries\libScrobbler + + + libraries\libScrobbler + + + libraries\libScrobbler + + + libraries\cdrip + + + libraries\cdrip + + + libraries\cdrip + + + libraries\cdrip + + + libraries\cdrip + + + libraries\cdrip + + + libraries\cdrip + + + libraries\cdrip + + + libraries\cdrip + + + libraries\cdrip + + + libraries\libRTMP + + + libraries\libRTMP + + + libraries\libRTMP + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\nbtscan + + + libraries\nbtscan + + + libraries\nbtscan + + + libraries\nbtscan + + + libraries\nbtscan + + + libraries\nbtscan + + + cores\dvdplayer\DVDInputStreams + + + cores\VideoRenderers\Shaders + + + Source Files\Utils + + + Source Files\Filesystem + + + cores\dvdplayer\DVDCodecs\Overlay + + + Source Files\Python Wrapper + + + Source Files\Filesystem + + + Source Files\GUI Boxee + + + Source Files + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + win32 + + + Source Files + + + Source Files + + + Source Files\GUI Dialog + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\Boxee + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files + + + Source Files + + + Source Files + + + win32 + + + Source Files + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + win32 + + + cores + + + cores + + + cores + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer + + + cores\dvdplayer\DVDCodecs + + + cores\dvdplayer\DVDCodecs + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Audio + + + cores\dvdplayer\DVDCodecs\Video + + + cores\dvdplayer\DVDCodecs\Video + + + cores\dvdplayer\DVDCodecs\Video + + + cores\dvdplayer\DVDCodecs\Video + + + cores\dvdplayer\DVDCodecs\Video + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay + + + cores\dvdplayer\DVDCodecs\Overlay\libspucc + + + cores\dvdplayer\DVDDemuxers + + + cores\dvdplayer\DVDDemuxers + + + cores\dvdplayer\DVDDemuxers + + + cores\dvdplayer\DVDDemuxers + + + cores\dvdplayer\DVDDemuxers + + + cores\dvdplayer\DVDDemuxers + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDInputStreams + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\dvdplayer\DVDSubtitles + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\paplayer + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader + + + cores\DllLoader\exports + + + cores\DllLoader\exports + + + cores\DllLoader\exports + + + cores\DllLoader\exports + + + cores\DllLoader\exports\emu_socket + + + cores\DllLoader\exports\emu_socket + + + cores\DllLoader\exports\emu_socket + + + cores\DllLoader\exports\emu_socket + + + cores\DllLoader\exports\emu_socket + + + cores\DllLoader\exports\util + + + cores\Visualisations + + + cores\Visualisations + + + cores\Visualisations + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers + + + cores\VideoRenderers\Shaders + + + cores\VideoRenderers\Shaders + + + cores\VideoRenderers\Shaders + + + cores\flashplayer + + + cores\Screensavers + + + cores\Screensavers + + + cores\AudioRenderers + + + cores\AudioRenderers + + + cores\AudioRenderers + + + cores\AudioRenderers + + + cores\AudioRenderers + + + cores\AudioRenderers + + + cores\ExternalPlayer + + + cores\PlayerCoreFactory + + + cores\PlayerCoreFactory + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\Settings + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Music + + + Source Files\GUI Video + + + Source Files\GUI Video + + + Source Files\GUI Video + + + Source Files\GUI Video + + + Source Files\GUI Video + + + Source Files\GUI Video + + + Source Files\Playlist + + + Source Files\Playlist + + + Source Files\Playlist + + + Source Files\Playlist + + + Source Files\Playlist + + + Source Files\Playlist + + + Source Files\Playlist + + + Source Files\Playlist + + + Source Files\Playlist + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders + + + Source Files\infoTagReaders\Pictures + + + Source Files\infoTagReaders\Pictures + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Utils + + + Source Files\Database + + + Source Files\Database + + + Source Files\Database + + + Source Files\Database + + + Source Files\Database + + + Source Files\Database + + + Source Files\Database + + + Source Files\Database + + + Source Files\Database + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\GUI Other + + + Source Files\BackgroundLoaders + + + Source Files\BackgroundLoaders + + + Source Files\BackgroundLoaders + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\MusicDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\Filesystem\VideoDatabaseDirectory + + + Source Files\common + + + Source Files\common + + + Source Files\common + + + Source Files\UPnP + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Karaoke + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee + + + Source Files\Boxee Apps + + + Source Files\Boxee Apps + + + Source Files\Boxee Apps + + + Source Files\Boxee Apps + + + Source Files\Boxee Apps + + + Source Files\Boxee Apps + + + Source Files\Boxee Apps\Native Apps + + + Source Files\Boxee Apps\Native Apps + + + Source Files\Boxee Apps\Native Apps + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Python Wrapper + + + Source Files\Windowing\Events + + + Source Files\Windowing\Events + + + Source Files\Windowing\Keyboard + + + Source Files\Windowing\Mouse + + + Source Files\Windowing\Render System + + + Source Files\Windowing\Render System + + + Source Files\Windowing\Render System + + + Source Files\Windowing\Render System + + + Source Files\Windowing\Window System + + + Source Files\Windowing\Window System + + + Source Files\Windowing\Window System + + + Source Files\Windowing\Window System + + + libraries\libPython + + + libraries\libPython + + + libraries\libPython + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libPython\xbmcmodule + + + libraries\libGoAhead + + + libraries\libGoAhead + + + libraries\libGoAhead + + + libraries\libGoAhead + + + libraries\libGoAhead + + + libraries\sqlite + + + libraries\sqlite + + + libraries\sqlite + + + libraries\libScrobbler + + + libraries\libScrobbler + + + libraries\libScrobbler + + + libraries\cdrip + + + libraries\cdrip + + + libraries\cdrip + + + libraries\cdrip + + + libraries\cdrip + + + libraries\cdrip + + + libraries\libRTMP + + + libraries\libRTMP + + + libraries\libRTMP + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee + + + libraries\libBoxee\TinyXpath + + + libraries\libBoxee\TinyXpath + + + libraries\libBoxee\TinyXpath + + + libraries\libBoxee\TinyXpath + + + libraries\libBoxee\TinyXpath + + + libraries\libBoxee\TinyXpath + + + libraries\libBoxee\TinyXpath + + + libraries\libBoxee\TinyXpath + + + libraries\libBoxee\TinyXpath + + + libraries\libBoxee\TinyXpath + + + libraries\libBoxee\TinyXpath + + + libraries\libBoxee\TinyXpath + + + libraries\nbtscan + + + libraries\nbtscan + + + libraries\nbtscan + + + libraries\nbtscan + + + libraries\libjson + + + libraries\libjson + + + libraries\libjson + + + cores\dvdplayer\DVDInputStreams + + + cores\VideoRenderers\Shaders + + + Source Files\Utils + + + cores\paplayer + + + Source Files\GUI Boxee + + + Source Files\Boxee + + + Source Files\Filesystem + + + cores\dvdplayer\DVDCodecs\Overlay + + + Source Files\Python Wrapper + + + Source Files\Filesystem + + + cores + + + Source Files + + + Source Files\GUI Boxee + + + Source Files + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files + + + Source Files + + + Source Files\GUI Dialog + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\Boxee + + + Source Files\GUI Dialog + + + Source Files\GUI Dialog + + + Source Files + + + Source Files + + + Source Files + + + win32 + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + Source Files\GUI Boxee + + + \ No newline at end of file diff --git a/project/VS2010Express/DeclareDPIAware.manifest b/project/VS2010Express/DeclareDPIAware.manifest new file mode 100644 index 00000000..44071bea --- /dev/null +++ b/project/VS2010Express/DeclareDPIAware.manifest @@ -0,0 +1,7 @@ + + + + true + + + diff --git a/project/VS2010Express/UnrarXLib.vcxproj b/project/VS2010Express/UnrarXLib.vcxproj new file mode 100644 index 00000000..7cd9bb63 --- /dev/null +++ b/project/VS2010Express/UnrarXLib.vcxproj @@ -0,0 +1,395 @@ +ïŧŋ + + + + Debug (DirectX) + Win32 + + + Debug (OpenGL) + Win32 + + + Debug (OpenGLES) + Win32 + + + Release (DirectX) + Win32 + + + Release (OpenGL) + Win32 + + + Release (OpenGLES) + Win32 + + + + {FE0A91C0-E30A-47CD-8A92-A508C9292452} + UnrarXLib + Win32Proj + + + + StaticLibrary + MultiByte + + + StaticLibrary + MultiByte + + + StaticLibrary + MultiByte + + + StaticLibrary + MultiByte + + + StaticLibrary + MultiByte + + + StaticLibrary + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + UnrarXLib\$(Configuration)\ + UnrarXLib\$(Configuration)\ + UnrarXLib\$(Configuration)\ + UnrarXLib\$(Configuration)\ + UnrarXLib\$(Configuration)\ + UnrarXLib\$(Configuration)\ + UnrarXLib\$(Configuration)\ + UnrarXLib\$(Configuration)\ + UnrarXLib\$(Configuration)\ + UnrarXLib\$(Configuration)\ + UnrarXLib\$(Configuration)\ + UnrarXLib\$(Configuration)\ + $(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(DXSDK_DIR)Include;$(IncludePath) + $(DXSDK_DIR)Include;$(IncludePath) + $(DXSDK_DIR)Include;$(IncludePath) + $(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(DXSDK_DIR)Include;$(IncludePath) + $(DXSDK_DIR)Lib\x86;$(LibraryPath) + + + + /MP %(AdditionalOptions) + Full + true + ..\..\guilib;..\..\xbmc;..\..\xbmc\win32\;..\..\xbmc\lib\boost;..\..\lib\libSDL-WIN32\include;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;_XBMC;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + MultiThreaded + true + StreamingSIMDExtensions + Use + rar.hpp + $(OutDir)$(ProjectName).pch + Level3 + + + 4800;4018;4146;4996;%(DisableSpecificWarnings) + + + $(OutDir)$(ProjectName).lib + + + + + Disabled + ..\..\guilib;..\..\xbmc;..\..\xbmc\win32;..\..\xbmc\lib\boost;..\..\lib\libSDL-WIN32\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;_XBMC;_USE_32BIT_TIME_T;HAS_DX;%(PreprocessorDefinitions) + true + false + Default + MultiThreadedDebug + true + true + StreamingSIMDExtensions + Use + rar.hpp + $(OutDir)$(ProjectName).pch + Level3 + ProgramDatabase + 4800;4018;4146;4996;%(DisableSpecificWarnings) + + + $(OutDir)$(ProjectName)d.lib + + + + + /MP %(AdditionalOptions) + Full + true + ..\..\guilib;..\..\xbmc;..\..\xbmc\win32\;..\..\xbmc\lib\boost;..\..\lib\libSDL-WIN32\include;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;_XBMC;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + MultiThreaded + true + StreamingSIMDExtensions + Use + rar.hpp + $(OutDir)$(ProjectName).pch + Level3 + + + 4800;4018;4146;4996;%(DisableSpecificWarnings) + + + $(OutDir)$(ProjectName).lib + + + + + Disabled + ..\..\guilib;..\..\xbmc;..\..\xbmc\win32;..\..\xbmc\lib\boost;..\..\lib\libSDL-WIN32\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;_XBMC;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + false + Default + MultiThreadedDebug + true + true + StreamingSIMDExtensions + Use + rar.hpp + $(OutDir)$(ProjectName).pch + Level3 + ProgramDatabase + 4800;4018;4146;4996;%(DisableSpecificWarnings) + + + $(OutDir)$(ProjectName)d.lib + + + + + Disabled + ..\..\guilib;..\..\xbmc;..\..\xbmc\win32;..\..\xbmc\lib\boost;..\..\lib\libSDL-WIN32\include;..\..\xbmc\utils;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;_XBMC;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + false + Default + MultiThreadedDebug + true + true + StreamingSIMDExtensions + Use + rar.hpp + $(OutDir)$(ProjectName).pch + Level3 + ProgramDatabase + 4800;4018;4146;4996;%(DisableSpecificWarnings) + + + $(OutDir)$(ProjectName)d.lib + + + + + /MP %(AdditionalOptions) + Full + true + ..\..\guilib;..\..\xbmc;..\..\xbmc\win32;..\..\xbmc\lib\boost;..\..\lib\libSDL-WIN32\include;..\..\xbmc\utils;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;_XBMC;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + MultiThreaded + true + StreamingSIMDExtensions + Use + rar.hpp + $(OutDir)$(ProjectName).pch + Level3 + + + 4800;4018;4146;4996;%(DisableSpecificWarnings) + + + $(OutDir)$(ProjectName).lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {510441ac-b9e1-4b31-9c0c-eb3ad39d90c4} + false + + + + + + \ No newline at end of file diff --git a/project/VS2010Express/UnrarXLib.vcxproj.filters b/project/VS2010Express/UnrarXLib.vcxproj.filters new file mode 100644 index 00000000..cedfffd6 --- /dev/null +++ b/project/VS2010Express/UnrarXLib.vcxproj.filters @@ -0,0 +1,314 @@ +ïŧŋ + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/project/VS2010Express/VC90.CRT.x86.manifest b/project/VS2010Express/VC90.CRT.x86.manifest new file mode 100644 index 00000000..061705c5 --- /dev/null +++ b/project/VS2010Express/VC90.CRT.x86.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/project/VS2010Express/guilib.vcxproj b/project/VS2010Express/guilib.vcxproj new file mode 100644 index 00000000..61a96f4f --- /dev/null +++ b/project/VS2010Express/guilib.vcxproj @@ -0,0 +1,562 @@ +ïŧŋ + + + + Debug (DirectX) + Win32 + + + Debug (OpenGL) + Win32 + + + Debug (OpenGLES) + Win32 + + + Release (DirectX) + Win32 + + + Release (OpenGL) + Win32 + + + Release (OpenGLES) + Win32 + + + + {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4} + guilib + Win32Proj + + + + StaticLibrary + MultiByte + + + StaticLibrary + MultiByte + + + StaticLibrary + MultiByte + + + StaticLibrary + MultiByte + + + StaticLibrary + MultiByte + + + StaticLibrary + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + guilib\$(Configuration)\ + guilib\$(Configuration)\ + guilib\$(Configuration)\ + guilib\$(Configuration)\ + guilib\$(Configuration)\ + guilib\$(Configuration)\ + guilib\$(Configuration)\ + guilib\$(Configuration)\ + guilib\$(Configuration)\ + guilib\$(Configuration)\ + guilib\$(Configuration)\ + guilib\$(Configuration)\ + $(DXSDK_DIR)Include;$(IncludePath) + $(DXSDK_DIR)Include;$(IncludePath) + $(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(DXSDK_DIR)Include;$(IncludePath) + $(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(DXSDK_DIR)Include;$(IncludePath) + $(DXSDK_DIR)Lib\x86;$(LibraryPath) + false + false + + + + /MP %(AdditionalOptions) + Speed + ..\..\lib\libSDL-WIN32\include;..\..\xbmc\Win32;..\..\xbmc\;..\..\lib\freetype\include;..\..\lib\freetype\include\freetype2;..\..\xbmc\lib\boost;..\..\guilib;..\..\xbmc\utils;..\..\guilib\common\;..\..\xbmc\lib\libglew\;..\..\xbmc\Cores\dvdplayer\codecs;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg\include;..\..\xbmc\cores\dvdplayer\codecs\ffmpeg;..\..\;..\..\xbmc\cores;..\..\xbmc\lib\libsamplerate\src;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;_MSVC;NOMINMAX;_USE_32BIT_TIME_T;HAS_GL;HAS_GLEW;HAS_GL2;%(PreprocessorDefinitions) + false + MultiThreaded + StreamingSIMDExtensions + Use + pch.h + Level3 + + + 4996;%(DisableSpecificWarnings) + pch.h;%(ForcedIncludeFiles) + true + + + $(OutDir)guilib.lib + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + + + + + + + + + /EHa %(AdditionalOptions) + Disabled + ..\..\lib\libSDL-WIN32\include;..\..\xbmc\Win32;..\..\xbmc\;..\..\lib\freetype\include\freetype2;..\..\lib\freetype\include;..\..\xbmc\lib\boost;..\..\guilib;..\..\xbmc\utils;..\..\guilib\common\;..\..\xbmc\cores\dvdplayer\Codecs;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg\include;..\..;..\..\xbmc\cores;..\..\xbmc\lib\libsamplerate\src;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;_MSVC;NOMINMAX;_USE_32BIT_TIME_T;HAS_DX;%(PreprocessorDefinitions) + false + false + + + EnableFastChecks + MultiThreadedDebug + NotSet + Use + pch.h + Level3 + EditAndContinue + 4996;%(DisableSpecificWarnings) + pch.h;%(ForcedIncludeFiles) + true + + + $(OutDir)guilib.lib + %(AdditionalLibraryDirectories) + + + + + /MP %(AdditionalOptions) + Speed + ..\..\lib\libSDL-WIN32\include;..\..\xbmc\Win32;..\..\xbmc\;..\..\lib\freetype\include;..\..\lib\freetype\include\freetype2;..\..\xbmc\lib\boost;..\..\guilib;..\..\xbmc\utils;..\..\guilib\common\;..\..\xbmc\cores\dvdplayer\Codecs;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg\include;..\..;..\..\xbmc\cores;..\..\xbmc\lib\libsamplerate\src;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;_MSVC;NOMINMAX;_USE_32BIT_TIME_T;HAS_DX;%(PreprocessorDefinitions) + false + MultiThreaded + StreamingSIMDExtensions + Use + pch.h + Level3 + + + 4996;%(DisableSpecificWarnings) + pch.h;%(ForcedIncludeFiles) + + + $(OutDir)guilib.lib + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + + + Performing Custom Build Tools... + + + + + + + + + /EHa %(AdditionalOptions) + Disabled + ..\..\lib\libSDL-WIN32\include;..\..\xbmc\Win32;..\..\xbmc\;..\..\lib\freetype\include;..\..\lib\freetype\include\freetype2;..\..\xbmc\lib\boost;..\..\guilib;..\..\xbmc\utils;..\..\guilib\common\;..\..\xbmc\lib\libglew\;..\..\xbmc\Cores\dvdplayer\codecs;..\..\xbmc\cores\dvdplayer\Codecs\ffmpeg\include;..\..\xbmc\cores\dvdplayer\codecs\ffmpeg;..\..\;..\..\xbmc\cores;..\..\xbmc\lib\libsamplerate\src;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;_MSVC;NOMINMAX;_USE_32BIT_TIME_T;HAS_GL;HAS_GLEW;HAS_GL2;%(PreprocessorDefinitions) + false + true + + + EnableFastChecks + MultiThreadedDebug + NotSet + Use + pch.h + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + pch.h;%(ForcedIncludeFiles) + false + true + + + $(OutDir)guilib.lib + %(AdditionalLibraryDirectories) + + + + + + + + + /EHa %(AdditionalOptions) + Disabled + ..\..\lib\libSDL-WIN32\include;..\..\xbmc\Win32;..\..\xbmc\;..\..\lib\freetype\include;..\..\lib\freetype\include\freetype2;..\..\xbmc\lib\boost;..\..\guilib;..\..\xbmc\utils;..\..\guilib\common\;..\..\xbmc\lib\libglew\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;_MSVC;NOMINMAX;_USE_32BIT_TIME_T;HAS_GLES=2;HAS_EGL;%(PreprocessorDefinitions) + false + true + + + EnableFastChecks + MultiThreadedDebug + NotSet + Use + pch.h + Level3 + EditAndContinue + 4996;%(DisableSpecificWarnings) + pch.h;%(ForcedIncludeFiles) + + + $(OutDir)guilib.lib + %(AdditionalLibraryDirectories) + + + + + /MP %(AdditionalOptions) + Speed + ..\..\lib\libSDL-WIN32\include;..\..\xbmc\Win32;..\..\xbmc\;..\..\lib\freetype\include;..\..\lib\freetype\include\freetype2;..\..\xbmc\lib\boost;..\..\guilib;..\..\xbmc\utils;..\..\guilib\common\;..\..\xbmc\lib\libglew\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;_MSVC;NOMINMAX;_USE_32BIT_TIME_T;HAS_GLES=2;HAS_EGL;%(PreprocessorDefinitions) + false + MultiThreaded + StreamingSIMDExtensions + Use + pch.h + Level3 + + + 4996;%(DisableSpecificWarnings) + pch.h;%(ForcedIncludeFiles) + + + $(OutDir)guilib.lib + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CompileAsCpp + Use + CompileAsCpp + CompileAsCpp + CompileAsCpp + CompileAsCpp + CompileAsCpp + + + Create + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + + + true + true + + + true + true + + + true + true + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/project/VS2010Express/guilib.vcxproj.filters b/project/VS2010Express/guilib.vcxproj.filters new file mode 100644 index 00000000..45d0455b --- /dev/null +++ b/project/VS2010Express/guilib.vcxproj.filters @@ -0,0 +1,630 @@ +ïŧŋ + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx + + + {25c54a52-a947-4507-b96d-2502b65e78cf} + + + {2b3f6178-423c-47df-a981-affe21205b99} + + + {09b0cfe8-7745-468a-9ed4-8b23183e7275} + + + {9ba63abd-5b79-44cf-b9f3-70847176a21c} + + + {44d0d1e2-a742-4ea7-baf8-dee4fce46ef1} + + + {08e3f3b8-7727-4414-9ddc-2768610811dc} + + + {45d1d92e-c633-4d67-a623-124028f844cc} + + + {67014e72-2ac4-441f-9cc3-cb92d06d5bdb} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + tinyxml + + + tinyxml + + + tinyxml + + + common + + + common\IRServerSuite + + + common\IRServerSuite + + + Rendering\Base + + + Rendering\Base + + + Rendering\Base + + + Rendering\Base + + + Rendering\Base + + + Rendering\DX + + + Rendering\DX + + + Rendering\DX + + + Rendering\GL + + + Rendering\GL + + + Rendering\GL + + + Rendering\GLES + + + Rendering\GLES + + + Source Files + + + Source Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + tinyxml + + + tinyxml + + + common + + + common\IRServerSuite + + + common\IRServerSuite + + + Rendering\Base + + + Rendering\Base + + + Rendering\Base + + + Rendering\Base + + + Rendering\Base + + + Rendering\DX + + + Rendering\DX + + + Rendering\DX + + + Rendering\GL + + + Rendering\GL + + + Rendering\GL + + + Rendering\GLES + + + Rendering\GLES + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/project/VS2010Express/libPlatinum.vcxproj b/project/VS2010Express/libPlatinum.vcxproj new file mode 100644 index 00000000..e2a0745b --- /dev/null +++ b/project/VS2010Express/libPlatinum.vcxproj @@ -0,0 +1,255 @@ +ïŧŋ + + + + Debug + Win32 + + + Release + Win32 + + + + {B2975495-FBE4-4F94-AAC5-B21A9842BF50} + libPlatinum + Win32Proj + + + + StaticLibrary + MultiByte + + + StaticLibrary + MultiByte + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + libPlatinum\$(Configuration)\ + libPlatinum\$(Configuration)\ + libPlatinum\$(Configuration)\ + libPlatinum\$(Configuration)\ + + + + Disabled + ..\..\xbmc\lib\libUPnP\Platinum\Source\Platinum;..\..\xbmc\lib\libUPnP\Platinum\Source\Core;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\xbmc\lib\libUPnP\Neptune\Source\Core;..\..\xbmc\lib\libUPnP\Neptune\Source\System\Win32;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;NPT_CONFIG_ENABLE_LOGGING;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + + + $(OutDir)$(ProjectName).lib + + + + + ..\..\xbmc\lib\libUPnP\Platinum\Source\Platinum;..\..\xbmc\lib\libUPnP\Platinum\Source\Core;..\..\xbmc\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\xbmc\lib\libUPnP\Neptune\Source\Core;..\..\xbmc\lib\libUPnP\Neptune\Source\System\Win32;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;NPT_CONFIG_ENABLE_LOGGING;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + + + $(OutDir)libPlatinum.lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/project/VS2010Express/libPlatinum.vcxproj.filters b/project/VS2010Express/libPlatinum.vcxproj.filters new file mode 100644 index 00000000..52da8ca3 --- /dev/null +++ b/project/VS2010Express/libPlatinum.vcxproj.filters @@ -0,0 +1,506 @@ +ïŧŋ + + + + {4c12e3b2-bb36-4059-b69d-4728e730788d} + + + {5a9eb38d-6bd1-4d92-b5fe-30809e287b21} + + + {86dfd12b-dfb6-45bb-9610-e3b05a77fbdd} + + + {045bf0b3-c50d-4829-9c9d-2166005332a6} + + + {b24a42e1-dbf3-4fb8-80e3-e24b7d1cea91} + + + {9f005bf5-8a94-499e-a900-f4c489684c61} + + + {0447305f-94b4-4671-88b0-d36ebc25d302} + + + {dfab6e12-3f13-4a89-b962-47df48afbbb6} + + + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\MediaConnect + + + Platinum\MediaRenderer + + + Platinum\MediaRenderer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\System + + + Neptune\System + + + Neptune\System + + + + + + + + + + + + Platinum\MediaServer + + + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\Core + + + Platinum\MediaConnect + + + Platinum\MediaConnect + + + Platinum\MediaRenderer + + + Platinum\MediaRenderer + + + Platinum\MediaRenderer + + + Platinum\MediaRenderer + + + Platinum\MediaRenderer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Platinum\MediaServer + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\Core + + + Neptune\System + + + Neptune\System + + + Neptune\System + + + Neptune\System + + + Neptune\System + + + Neptune\System + + + Neptune\System + + + Neptune\System + + + + + + + + + + + Platinum\MediaServer + + + Platinum\MediaServer + + + \ No newline at end of file diff --git a/project/VS2010Express/prepare_for_debug.py b/project/VS2010Express/prepare_for_debug.py new file mode 100644 index 00000000..582c95d1 --- /dev/null +++ b/project/VS2010Express/prepare_for_debug.py @@ -0,0 +1,67 @@ +import sys +import os +import shutil + +def copy_required_files(exe_dir_path, project_root_path="../.."): + def new_or_modified_file_callback_for_depends(src_file_path): + new_dst_dir_path = os.path.dirname(src_file_path).replace(depends_path, exe_dir_path) # Notice that depends_path and exe_dir_path are context-dependent. + print "Copying: %s -> %s" % (src_file_path, new_dst_dir_path) + shutil.copy2(src_file_path, new_dst_dir_path) # Use copy2() to preserve the modification time. + + def new_or_modified_file_callback_for_subdirs(src_file_path): + new_dst_dir_path = os.path.dirname(src_file_path).replace(project_root_path, exe_dir_path) # Notice that project_root_path and exe_dir_path are context-dependent. + print "Copying: %s -> %s" % (src_file_path, new_dst_dir_path) + shutil.copy2(src_file_path, new_dst_dir_path) # Use copy2() to preserve the modification time. + + def new_or_modified_file_callback_for_qt(src_file_path): + new_dst_dir_path = os.path.dirname(src_file_path).replace(project_root_path, exe_dir_path).replace("qt", "players").replace("win32_release", "flashplayer") # Notice that project_root_path and exe_dir_path are context-dependent. + print "Copying: %s -> %s" % (src_file_path, new_dst_dir_path) + shutil.copy2(src_file_path, new_dst_dir_path) # Use copy2() to preserve the modification time. + + def new_or_modified_file_callback_for_qt_plugins(src_file_path): + new_dst_dir_path = os.path.dirname(src_file_path).replace(project_root_path, exe_dir_path).replace("win32_release", "win32") # Notice that project_root_path and exe_dir_path are context-dependent. + print "Copying: %s -> %s" % (src_file_path, new_dst_dir_path) + shutil.copy2(src_file_path, new_dst_dir_path) # Use copy2() to preserve the modification time. + + project_root_path = os.path.abspath(project_root_path) + exe_dir_path = os.path.abspath(exe_dir_path) + + check_files_module_path = os.path.join(project_root_path, "misc") + sys.path.append(check_files_module_path) + from check_files import find_changes + + dirs_to_copy = ("language", "media", "scripts", "skin", "system", "visualisations") + for dir_to_copy in dirs_to_copy: + src_dir_path = os.path.join(project_root_path, dir_to_copy) + dst_dir_path = os.path.join(exe_dir_path, dir_to_copy) + if not os.path.exists(dst_dir_path): + print "Copying: %s -> %s" % (src_dir_path, dst_dir_path) + shutil.copytree(src_dir_path, dst_dir_path) + else: + find_changes(src_dir_path, new_or_modified_file_callback_for_subdirs, new_or_modified_file_callback_for_subdirs, None) + if dir_to_copy == "system": + src_dir_path = os.path.join(src_dir_path, "qt/win32_release") + dst_dir_path = src_dir_path.replace(project_root_path, exe_dir_path).replace("qt", "players").replace("win32_release", "flashplayer") + if not os.path.exists(dst_dir_path): + print "Copying: %s -> %s" % (src_dir_path, dst_dir_path) + shutil.copytree(src_dir_path, dst_dir_path) + else: + find_changes(src_dir_path, new_or_modified_file_callback_for_qt, new_or_modified_file_callback_for_qt, None) + src_dir_path = os.path.join(src_dir_path, "plugins") + dst_dir_path = src_dir_path.replace(project_root_path, exe_dir_path).replace("win32_release", "win32") + if not os.path.exists(os.path.join(dst_dir_path,"..")): + os.mkdir(os.path.join(dst_dir_path,"..")) + if not os.path.exists(dst_dir_path): + print "Copying: %s -> %s" % (src_dir_path, dst_dir_path) + shutil.copytree(src_dir_path, dst_dir_path) + else: + find_changes(src_dir_path, new_or_modified_file_callback_for_qt_plugins, new_or_modified_file_callback_for_qt_plugins, None) + depends_path = os.path.abspath(os.path.join(project_root_path, "project/Win32BuildSetup/dependencies")) + find_changes(depends_path, new_or_modified_file_callback_for_depends, new_or_modified_file_callback_for_depends, None) + + +if __name__ == '__main__': + if len(sys.argv) < 2: + print "Usage: %s []" % (sys.argv[0],) + sys.exit(1) + copy_required_files(*sys.argv[1:]) diff --git a/project/Win32BuildSetup/BuildSetupAuto.bat b/project/Win32BuildSetup/BuildSetupAuto.bat new file mode 100644 index 00000000..1f5bb917 --- /dev/null +++ b/project/Win32BuildSetup/BuildSetupAuto.bat @@ -0,0 +1 @@ +BuildSetup.bat exit diff --git a/project/Win32BuildSetup/dependencies/SDL_image.dll b/project/Win32BuildSetup/dependencies/SDL_image.dll new file mode 100644 index 00000000..19603531 Binary files /dev/null and b/project/Win32BuildSetup/dependencies/SDL_image.dll differ diff --git a/project/Win32BuildSetup/dependencies/d3dx9_43.dll b/project/Win32BuildSetup/dependencies/d3dx9_43.dll new file mode 100644 index 00000000..96cfbe22 Binary files /dev/null and b/project/Win32BuildSetup/dependencies/d3dx9_43.dll differ diff --git a/project/Win32BuildSetup/dependencies/gdbm3.dll b/project/Win32BuildSetup/dependencies/gdbm3.dll new file mode 100644 index 00000000..32342a2a Binary files /dev/null and b/project/Win32BuildSetup/dependencies/gdbm3.dll differ diff --git a/project/Win32BuildSetup/dependencies/jpeg.dll b/project/Win32BuildSetup/dependencies/jpeg.dll new file mode 100644 index 00000000..12dfb0d2 Binary files /dev/null and b/project/Win32BuildSetup/dependencies/jpeg.dll differ diff --git a/project/Win32BuildSetup/dependencies/libpng12-0.dll b/project/Win32BuildSetup/dependencies/libpng12-0.dll new file mode 100644 index 00000000..060fca96 Binary files /dev/null and b/project/Win32BuildSetup/dependencies/libpng12-0.dll differ diff --git a/project/Win32BuildSetup/dependencies/libsasl.dll b/project/Win32BuildSetup/dependencies/libsasl.dll new file mode 100644 index 00000000..23d4f7fe Binary files /dev/null and b/project/Win32BuildSetup/dependencies/libsasl.dll differ diff --git a/project/Win32BuildSetup/dependencies/libtiff-3.dll b/project/Win32BuildSetup/dependencies/libtiff-3.dll new file mode 100644 index 00000000..737e0d03 Binary files /dev/null and b/project/Win32BuildSetup/dependencies/libtiff-3.dll differ diff --git a/project/Win32BuildSetup/dependencies/openldap.dll b/project/Win32BuildSetup/dependencies/openldap.dll new file mode 100644 index 00000000..14e1beec Binary files /dev/null and b/project/Win32BuildSetup/dependencies/openldap.dll differ diff --git a/project/Win32BuildSetup/excluded_files.txt b/project/Win32BuildSetup/excluded_files.txt new file mode 100644 index 00000000..d3c1edd8 --- /dev/null +++ b/project/Win32BuildSetup/excluded_files.txt @@ -0,0 +1,5 @@ +.pdb +.so +-linux +.dylib +-osx \ No newline at end of file diff --git a/project/Win32BuildSetup/get_version.sh b/project/Win32BuildSetup/get_version.sh new file mode 100644 index 00000000..f7cee928 --- /dev/null +++ b/project/Win32BuildSetup/get_version.sh @@ -0,0 +1,7 @@ +expr `git log --pretty=oneline | wc -l` + 15012 | tr -d '\n' > REVISION +echo -n '-' >> REVISION +echo -n `git rev-parse --short HEAD` >> REVISION +cat ../../xbmc/linux/svn_rev.h.in | sed 's/WCREV/'`cat REVISION`/ > ../../xbmc/linux/svn_rev.h +echo -n `cat ../../xbmc/lib/libBoxee/bxversion.h | grep BOXEE_VERSION | awk '{print $3}' | sed 's/"//g'` > VERSION +echo -n . >> VERSION +cat REVISION >> VERSION \ No newline at end of file diff --git a/scripts/OpenSubtitles/resources/skins/Boxee/includes.xml b/scripts/OpenSubtitles/resources/skins/Boxee/includes.xml new file mode 100644 index 00000000..f90b3044 --- /dev/null +++ b/scripts/OpenSubtitles/resources/skins/Boxee/includes.xml @@ -0,0 +1,2 @@ + + diff --git a/scripts/OpenSubtitles/resources/skins/Boxee/media/graphic-opensubtitles.png b/scripts/OpenSubtitles/resources/skins/Boxee/media/graphic-opensubtitles.png new file mode 100644 index 00000000..f563dcfd Binary files /dev/null and b/scripts/OpenSubtitles/resources/skins/Boxee/media/graphic-opensubtitles.png differ diff --git a/skin/boxee/720p/DialogQuickTip.xml b/skin/boxee/720p/DialogQuickTip.xml new file mode 100644 index 00000000..90c461f3 --- /dev/null +++ b/skin/boxee/720p/DialogQuickTip.xml @@ -0,0 +1,47 @@ + + + 250 + + Common_Background + + FTUDialog_Heidi + + + 62 + 52 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 20 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + 478 + 82 + 295 + 400 + ftu/graphic-ftu-tip-remote.png + + + + diff --git a/skin/boxee/720p/DialogWeb.xml b/skin/boxee/720p/DialogWeb.xml new file mode 100644 index 00000000..b6aa6edd --- /dev/null +++ b/skin/boxee/720p/DialogWeb.xml @@ -0,0 +1,27 @@ + + + 10 + + Dialog_Popup_Background + + Dialog_Popup_Animation + + 70 + 20 + 1140 + 680 + dialog_bg.png + + + 100 + 50 + 1080 + 620 + + + + true + Window(webdialog).Property(loading) + Loading_Animation + + + diff --git a/skin/boxee/720p/DialogWirelessAuthentication.xml b/skin/boxee/720p/DialogWirelessAuthentication.xml new file mode 100644 index 00000000..6d6dcf02 --- /dev/null +++ b/skin/boxee/720p/DialogWirelessAuthentication.xml @@ -0,0 +1,84 @@ + + 3 + + + + Dialog_Popup_Animation + 430 + 102 + + 8 + 8 + 402 + 496 + dialog_bg_3.png + + + heading label + 54 + 60 + 28 + 312 + center + center + whiteheidi + font26b + + + + Conditional + 3 + 0 + 94 + 420 + 366 + - + 255 + 60 + 200 + + + 212 + 0 + 280 + 48 + font24b + center + center + ListItem.Label + mediumgreyheidi + + + + + 54 + 0 + 312 + 48 + button-focused.png + + + 212 + 0 + 280 + 48 + font24b + center + center + ListItem.Label + whiteheidi + true + + + + + + + diff --git a/skin/boxee/720p/boxee_battery_low.xml b/skin/boxee/720p/boxee_battery_low.xml new file mode 100644 index 00000000..90452715 --- /dev/null +++ b/skin/boxee/720p/boxee_battery_low.xml @@ -0,0 +1,55 @@ +ïŧŋ + + + 10 + + Dialog_Popup_Background + + Dialog_Popup_Animation + 340 + 182 + + 0 + 0 + 600 + 302 + browse_menu_dialog_background.png + FF212121 + + + 216 + 34 + 168 + 108 + icons/icon_battery_low_large.png + + + 26 + 156 + 550 + 24 + + center + top + font24 + white + + + + 220 + 208 + 160 + 60 + FTU_Button_Properties + font28b + + + - + - + 10 + 10 + - + + + + diff --git a/skin/boxee/720p/boxee_browse_empty_screens.xml b/skin/boxee/720p/boxee_browse_empty_screens.xml new file mode 100644 index 00000000..bf5408e4 --- /dev/null +++ b/skin/boxee/720p/boxee_browse_empty_screens.xml @@ -0,0 +1,983 @@ + + + + 240 + 104 + + + + 0 + 0 + 800 + 456 + browse_menu_dialog_background.png + FF212121 + + + + 65 + 416 + 56 + button-focused.png + universal/button-unfocused.png + font24b + lightgreyheidi + whiteheidi + lightgreyheidi + center + center + + + 50 + 50 + 30 + 25 + + + 50 + 50 + 30 + 60 + + + + 64 + 406 + 200 + left + top + font22ls + lightgreyheidi + true + + + 107 + 60 + 950 + 150 + left + top + font40b + white + + + + true + Window.Property(empty) + true + !Window.Property(loading) + + 300 + 128 + 890 + 52 + font30 + left + center + lightgreyheidi + + + + + + + true + Window.Property(empty)+ !Window.Property(paired) + true + !Window.Property(loading) + + 100 + 128 + 890 + 52 + font30 + left + center + lightgreyheidi + + + + + true + Window.Property(empty) + Window.Property(paired) + true + !Window.Property(loading) + + 544 + 151 + 192 + 140 + keep + graphic-friends-fetching.png + + + 200 + 310 + 934 + 64 + Header_Heidi + center + center + + + + 64 + 370 + 1122 + 78 + font30 + center + center + lightgreyheidi + + true + + + 366 + + 498 + EmptyStateButton + + - + - + - + - + ActivateWindow(Home) + + + + + + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + true + !Window.Property(loading) + background image overlay + + + + + + + 0 + 0 + 1280 + 720 + black.png + 88FFFFFF + + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + true + !Window.Property(loading) + !window(10480).property(is-category-local) + !boxee.HasInternetConnection + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + 421 + EmptyStateButton + + - + - + - + - + ActivateWindow(10480,boxeeui://shows/?category=local) + + + + true + window(10480).property(is-category-favorites) + boxee.HasInternetConnection + true + !Window.Property(loading) + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + 421 + EmptyStateButton + + - + - + - + - + ActivateWindow(10480,boxeeui://shows/?category=all) + + + + true + window(10480).property(is-category-local) + true + !Window.Property(loading) + boxee.HasInternetConnection + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + 353 + EmptyStateButton + + - + 7091 + - + - + ActivateWindow(10460) + + + 421 + EmptyStateButton + + 7092 + - + - + - + ActivateWindow(10480,boxeeui://shows/?category=all) + + + + + true + window(10480).property(is-category-default) + true + !Window.Property(loading) + boxee.HasInternetConnection + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + true + !Window.Property(loading) + true + !Window.Property(FilteredOut) + true + window(10481).property(is-category-default) + !boxee.HasInternetConnection + background image overlay + + + + + + + 0 + 0 + 1280 + 720 + black.png + 88FFFFFF + + + Window.Property(FilteredOut) + + 300 + 128 + 890 + 52 + font30 + left + center + lightgreyheidi + + true + + + + true + window(10481).property(is-category-local) + true + !Window.Property(loading) + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + !Window.Property(FilteredOut) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + 353 + EmptyStateButton + + - + 7091 + - + - + ActivateWindow(10460) + + + 421 + EmptyStateButton + + 7092 + - + - + - + ActivateWindow(10481,boxeeui://movies/?category=all) + + + + + true + window(10481).property(is-category-default) + true + !Window.Property(loading) + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + !boxee.HasInternetConnection + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + true + window(10481).property(is-category-default) + true + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + true + !Window.Property(loading) + boxee.HasInternetConnection + + 300 + 128 + 890 + 52 + font30 + left + center + lightgreyheidi + + + + + + + true + !Window.Property(loading) + Window.Property(empty) + 300 + 128 + 890 + 52 + font30 + left + center + lightgreyheidi + + + + + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + true + !Window.Property(loading) + background image overlay + + + + + + + 0 + 0 + 1280 + 720 + black.png + 88FFFFFF + + + + true + !Window.Property(loading) + boxee.HasInternetConnection + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + true + !Window.Property(loading) + !boxee.HasInternetConnection + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + + + true + Window.Property(is-browse-root) + + true + Window.Property(empty) + true + !Window.Property(loading) + background image overlay + + + + + + + 0 + 0 + 1280 + 720 + black.png + 88FFFFFF + + + true + !Window.Property(loading) + true + Window.Property(empty) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + 349 + EmptyStateButton + + - + 7091 + - + - + ActivateWindow(10460) + + + 421 + EmptyStateButton + + 7092 + - + - + - + ActivateWindow(10479,boxeeui://files/?path=network://protocols) + + + + + + true + !Window.Property(is-browse-root) + true + Window.Property(empty) + true + !Window.Property(loading) + + 300 + 128 + 890 + 52 + font30 + left + center + lightgreyheidi + + + + + + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + true + !Window.Property(loading) + background image overlay + + + + + + + 0 + 0 + 1280 + 720 + black.png + 88FFFFFF + + + empty favorites + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + boxee.HasInternetConnection + true + !window.property(installed-apps) + true + !window.property(repositories-flag) + true + !Window.Property(loading) + + 300 + 128 + 890 + 252 + font30 + left + top + lightgreyheidi + + true + + + + empty favorites + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + boxee.HasInternetConnection + true + window.property(installed-apps) + true + !window.property(repositories-flag) + true + !Window.Property(loading) + + 300 + 128 + 890 + 252 + font30 + left + top + lightgreyheidi + + true + + + + no internet + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + !boxee.HasInternetConnection + true + !Window.Property(loading) + true + !window.property(repositories-flag) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + 421 + EmptyStateButton + + - + - + - + - + ActivateWindow(10423) + + + + empty repository + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + boxee.HasInternetConnection + true + !Window.Property(loading) + true + window.property(repositories-flag) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + true + !Window.Property(loading) + background image overlay + + + + + + + 0 + 0 + 1280 + 720 + black.png + 88FFFFFF + + + + boxee.HasInternetConnection + true + !Window.Property(loading) + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + !boxee.HasInternetConnection + true + !Window.Property(loading) + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + true + !Window.Property(loading) + background image overlay + + + + + + + 0 + 0 + 1280 + 720 + black.png + 88FFFFFF + + + + Window.Property(empty) + Window.Property(search-set) + boxee.HasInternetConnection + 54 + 160 + 1102 + 80 + left + top + font22b + + true + + + Window.Property(empty) + Window.Property(search-set) + boxee.OfflineMode + 54 + 160 + 1102 + 80 + left + top + font22b + + true + + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + !Window.Property(loading) + !Window.Property(search-set) + true + !Window.Property(loading) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + 349 + EmptyStateButton + + - + 7091 + - + - + ActivateWindow(10460) + + + 421 + EmptyStateButton + + 7092 + - + - + - + ActivateWindow(10479,boxeeui://files/?path=network://protocols/) + + + + + + + true + Window.Property(is-base-path) + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + true + !Window.Property(loading) + background image overlay + + + + + + + 0 + 0 + 1280 + 720 + black.png + 88FFFFFF + + + Window.Property(empty) + Window.Property(search-set) + boxee.HasInternetConnection + 54 + 160 + 1102 + 80 + left + top + font22b + + true + + + Window.Property(empty) + Window.Property(search-set) + boxee.OfflineMode + 54 + 160 + 1102 + 80 + left + top + font22b + + true + + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + !Window.Property(loading) + !Window.Property(search-set) + true + !Window.Property(loading) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + 349 + EmptyStateButton + + - + 7091 + - + - + ActivateWindow(10460) + + + 421 + EmptyStateButton + + 7092 + - + - + - + ActivateWindow(10479,boxeeui://files/?path=network://protocols/) + + + + + + !Window.Property(is-base-path) + Window.Property(empty) + !Window.Property(loading) + + 300 + 128 + 890 + 52 + font30 + left + center + lightgreyheidi + + + + + + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + true + !Window.Property(loading) + background image overlay + + + + + + + 0 + 0 + 1280 + 720 + black.png + 88FFFFFF + + + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + boxee.HasInternetConnection + true + !Window.Property(loading) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + 353 + EmptyStateButton + + - + 7092 + - + - + ActivateWindow(10482,boxeeui://apps/?category=all) + + + 421 + EmptyStateButton + + 7091 + 131 + - + - + + + + + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + !boxee.HasInternetConnection + true + !Window.Property(loading) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + + + Window.Property(empty) + !Window.IsActive(boxee_search.xml) + true + !Window.Property(loading) + background image overlay + + + + + + + 0 + 0 + 1280 + 720 + black.png + 88FFFFFF + + + + -98 + + !control.isenabled(56) + boxee.HasInternetConnection + true + !Window.Property(loading) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + !control.isenabled(56) + !boxee.HasInternetConnection + true + !Window.Property(loading) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + + + diff --git a/skin/boxee/720p/boxee_browse_menu.xml b/skin/boxee/720p/boxee_browse_menu.xml new file mode 100644 index 00000000..b68ca3dd --- /dev/null +++ b/skin/boxee/720p/boxee_browse_menu.xml @@ -0,0 +1,474 @@ + + + 1823 + no + + Dialog_Popup_Background + + + + + + + 74 + 98 + 1132 + 384 + dialog_bg.png + + + + 84 + 108 + 1112 + 92 + mainmenu/graphic-gradient-top.png + 50FFFFFF + + + 96 + 186 + 1092 + 24 + mainmenu/graphic-divider-top.png + + + 344 + 376 + 572 + 24 + mainmenu/graphic-divider-bot.png + + + + -118 + + right + 435r + 133 + horizontal + 20 + true + + + boxee.HasInternetConnection + Weather.IsFetched + horizontal + 6 + true + + Weather image + 0 + 7 + 24 + 24 + keep + Weather.Conditions + mediumgreyheidi + + + 0 + 0 + auto + 36 + + font26b + left + center + mediumgreyheidi + + + + + horizontal + 0 + true + + + 30 + + 0 + 8 + 21 + 21 + graphic-clock.png + mediumgreyheidi + + + + 0 + 0 + auto + 36 + font26b + mediumgreyheidi + left + center + + + + SubString(System.Time#AM,Right) + 0 + 6 + auto + 36 + font20b + mediumgreyheidi + left + top + false + + + + SubString(System.Time#PM,Right) + 0 + 6 + auto + 36 + font20b + mediumgreyheidi + left + top + false + + + + + + + + - + 1823 + - + - + + 451 + 123 + 385 + 56 + text-field-focused.png + - + font28b + mediumgreyheidi + mediumgreyheidi + mediumgreyheidi + left + center + 48 + $LOCALIZE[90400] + mediumgreyheidi + + + 466 + 138 + 28 + 28 + mainmenu/graphic-icon-search.png + mediumgreyheidi + + + + + + + 130 + 228 + 1100 + 200 + 11011 + - + - + 1824 + horizontal + 200 + + + 8 + 8 + 80 + 80 + $INFO[ListItem.ActualIcon] + mediumgreyheidi + + + 50 + 95 + 132 + 60 + font20bls + mediumgreyheidi + center + top + true + + + + + + Control.HasFocus(1823) + + 0 + 0 + 96 + 96 + button-focused.png + + + 8 + 8 + 80 + 80 + $INFO[ListItem.ActualIcon] + whiteheidi + + + 50 + 95 + 132 + 60 + font20bls + whiteheidi + center + top + true + + + + + !Control.HasFocus(1823) + + 8 + 8 + 80 + 80 + $INFO[ListItem.ActualIcon] + mediumgreyheidi + + + 50 + 95 + 132 + 60 + font20bls + mediumgreyheidi + center + top + true + + + + + + + 1831 + DVB.IsTunerReady + + icons/icon-home-live-tv.png + - + + + 1832 + + icons/icon-home-friends.png + - + + + 1833 + + icons/icon-home-watch-later.png + - + + + 1834 + + icons/icon-home-shows.png + ActivateWindow(10480,boxeeui://shows/) + + + 1835 + + icons/icon-home-movies.png + ActivateWindow(10481,boxeeui://movies/) + + + 1837 + + icons/icon-home-apps.png + ActivateWindow(10482,boxeeui://apps/) + + + 1836 + + icons/icon-home-files.png + - + + + 1838 + + icons/icon-home-web.png + - + + + + + + 534 + 396 + 212 + 56 + 12 + 200 + horizontal + true + 1823 + - + 5 + 1824 + + + 10 + 10 + 36 + 36 + $INFO[ListItem.Thumb] + + + + + Control.HasFocus(1824) + + 0 + 0 + 56 + 56 + button-focused.png + + + 10 + 10 + 36 + 36 + $INFO[ListItem.Thumb] + + + + !Control.HasFocus(1824) + 10 + 10 + 36 + 36 + $INFO[ListItem.Thumb] + + + + + mainmenu/graphic-icon-home.png + ActivateWindow(Home) + + + mainmenu/graphic-icon-history.png + ActivateWindow(10493) + + + mainmenu/graphic-icon-settings.png + ActivateWindow(Settings) + + + mainmenu/graphic-icon-exit.png + ActivateWindow(111) + + + + + + Player.HasAudio + + 1823 + - + 1824 + - + 816 + 406 + 348 + 40 + mainmenu/now-playing-off.png + mainmenu/now-playing-on.png + ActivateWindow(2006) + + + Player.HasAudio + 870 + 425 + 260 + true + left + center + + font20 + black + false + true + 50 + + + + !Control.HasFocus(5) + 816 + 406 + 348 + 40 + mainmenu/now-playing-mask.png + FFF4BA1A + + + Control.HasFocus(5) + 816 + 406 + 348 + 40 + mainmenu/now-playing-mask.png + blue + + + 818 + 406 + 40 + 40 + mainmenu/now-playing-play-icon.png + + + + 120 + 408 + horizontal + 16 + true + + + boxee.newversion + 32 + 32 + icons/boxee-update.png + + + !boxee.HasInternetConnection + 32 + 32 + icons/boxee-offline.png + + + + true + network.isvpnconnected + boxee.HasInternetConnection + 32 + 32 + mainmenu/graphic-vpn.png + + + + + diff --git a/skin/boxee/720p/boxee_browse_menu_tree.xml b/skin/boxee/720p/boxee_browse_menu_tree.xml new file mode 100644 index 00000000..c3021b3b --- /dev/null +++ b/skin/boxee/720p/boxee_browse_menu_tree.xml @@ -0,0 +1,340 @@ + + + + + + + + + + + + + + + + + + browsemenu://movies/genres/?type=all + mn_library_movies + + + + browsemenu://movies/providers + mn_library_movies + + + + + + + + + + + + + browsemenu://movies/genres/?type=local + mn_local_movies + + + browsemenu://movies/sources + mn_local_movies + + + + + browsemenu://movies/trailers + + + + + + + + + + + + + + + + + + browsemenu://shows/genres/?type=all + mn_library_shows + + + browsemenu://shows/providers + mn_library_shows + + + + + + + + + + + browsemenu://shows/genres?type=local + mn_local_shows + + + + + + + + + + + + + + + mn_local_files + + + + + + + + + + + + + + + + + + browsemenu://apps/categories/?type=all + 10482 + mn_library_apps + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/skin/boxee/720p/boxee_browse_product.xml b/skin/boxee/720p/boxee_browse_product.xml new file mode 100644 index 00000000..1d3c8041 --- /dev/null +++ b/skin/boxee/720p/boxee_browse_product.xml @@ -0,0 +1,7 @@ + + + 50 + yes + + + diff --git a/skin/boxee/720p/boxee_browse_simple_app.xml b/skin/boxee/720p/boxee_browse_simple_app.xml new file mode 100644 index 00000000..cdb3a6cc --- /dev/null +++ b/skin/boxee/720p/boxee_browse_simple_app.xml @@ -0,0 +1,33 @@ + + + 9050 + yes + + Common_Background + + + 35 + 44 + 925 + font40b + whiteheidi + left + + + + true + !Window.Property(empty) + 35 + 25 + 925 + font21b + boxeegreenheidi + left + + + + + Conditional + BrowseSimpleAppView + + + diff --git a/skin/boxee/720p/boxee_browse_subtitles_settings.xml b/skin/boxee/720p/boxee_browse_subtitles_settings.xml new file mode 100644 index 00000000..7f5b3d5d --- /dev/null +++ b/skin/boxee/720p/boxee_browse_subtitles_settings.xml @@ -0,0 +1,134 @@ + + + 51 + no + + + + + info + 0 + 0 + 0 + 0 + false + + + + + + + + + + + + + 166 + 126 + + 0 + 0 + 948 + 412 + background/window-bg-transparent.png + + + + 68 + 30 + 844 + 20 + center + top + font24b + whiteheidi + + + + Browse locally... + 42 + 70 + 860 + 56 + button-focused.png + - + font24b + lightgreyheidi + whiteheidi + lightgreyheidi + center + center + + - + 52 + + + + Browse online... + !IsEmpty(container(5000).ListItem.TVShowTitle) + !IsEmpty(container(5000).ListItem.FileNameAndPath) + !container(5000).ListItem.property(IsInternetStream) + !container(5000).ListItem.property(DontShowSubtitles) + 42 + 126 + 860 + 56 + button-focused.png + - + font24b + lightgreyheidi + whiteheidi + lightgreyheidi + center + center + + RunScript(special://xbmc/scripts/OpenSubtitles/default.py, [TV]$INFO[container(5000).ListItem.Season] $INFO[container(5000).ListItem.Episode] $INFO[container(5000).ListItem.TVshowtitle][/TV][PATH]$INFO[container(5000).ListItem.filenameandpath][/PATH]) + Dialog.Close(10520) + 51 + - + + + Browse online... + !IsEmpty(container(5000).ListItem.Title) + IsEmpty(container(5000).ListItem.TVShowTitle) + !IsEmpty(container(5000).ListItem.FileNameAndPath) + !container(5000).ListItem.property(IsInternetStream) + !container(5000).ListItem.property(IsTrailer) + !container(5000).ListItem.property(DontShowSubtitles) + 42 + 126 + 860 + 56 + button-focused.png + - + font24b + lightgreyheidi + whiteheidi + lightgreyheidi + center + center + + RunScript(special://xbmc/scripts/OpenSubtitles/default.py, [MOVIE]$INFO[container(5000).ListItem.title][/MOVIE][PATH]$INFO[container(5000).ListItem.filenameandpath][/PATH]) + Dialog.Close(10520) + 51 + - + + + Browse online... + IsEmpty(container(5000).ListItem.Title) + IsEmpty(container(5000).ListItem.TVShowTitle) + !IsEmpty(container(5000).ListItem.FileNameAndPath) + !container(5000).ListItem.property(IsInternetStream) + !container(5000).ListItem.property(IsTrailer) + !container(5000).ListItem.property(DontShowSubtitles) + 42 + 126 + 860 + 56 + button-focused.png + - + font24b + lightgreyheidi + whiteheidi + lightgreyheidi + center + center + + RunScript(special://xbmc/scripts/OpenSubtitles/default.py, [PATH]$INFO[container(5000).ListItem.filenameandpath][/PATH]) + Dialog.Close(10520) + 51 + - + + + + + + diff --git a/skin/boxee/720p/boxee_browse_trailers.xml b/skin/boxee/720p/boxee_browse_trailers.xml new file mode 100644 index 00000000..a307cd1b --- /dev/null +++ b/skin/boxee/720p/boxee_browse_trailers.xml @@ -0,0 +1,20 @@ + + + 9050 + yes + + + Conditional + + BrowseThumbViewTrailers + BrowseLineViewTrailers + + LogoTitleAndItemCountTrailers + BrowseByLetterThumbs + BrowseByLetterList + BrowseTrailersEmptyList + BrowseLoadingAnimation + + + + diff --git a/skin/boxee/720p/boxee_browser_context.xml b/skin/boxee/720p/boxee_browser_context.xml new file mode 100644 index 00000000..bbe9ef53 --- /dev/null +++ b/skin/boxee/720p/boxee_browser_context.xml @@ -0,0 +1,329 @@ + + + 9004 + + + + 0 + 0 + 100 + 100 + black.png + + + + + + info + 0 + 0 + 0 + 0 + false + + + + + + + window(10362).property(browser-page-load-failed) + Common_Background + + 20 + 326 + 1280 + 36 + font46b + lightgreyheidi + + center + + + 0 + 388 + 1280 + 36 + font32b + mediumgreyheidi + + center + + + + + 0 + 0 + 1280 + 132 + browser/graphic-browser-bg.png + + OSD (upper + lower) + TopGradient + + upper OSD + 32 + 32 + upper OSD - NO thumb + + + false + 0 + 0 + 56 + 56 + icons/icon_browser_osd_exit_on.png + icons/icon_browser_osd_exit_off.png + icons/icon_browser_osd_exit_on.png + - + 50 + - + 9203 + + + 0 + 0 + 64 + 64 + browser/button-action-history-on.png + browser/button-action-history-off.png + browser/button-action-history-on.png + - + 50 + 9029 + 9201 + + + !container(5000).ListItem.property(browserHasPrevUrl) + 76 + 0 + 64 + 64 + browser/button-action-nav-back-off.png + + + !container(5000).ListItem.property(browserfullscreen) + container(5000).ListItem.property(browserHasPrevUrl) + container(5000).ListItem.property(browserHasPrevUrl) + 76 + 0 + 64 + 64 + BrowserBack + browser/button-action-nav-back-on.png + browser/button-action-nav-back-off.png + browser/button-action-nav-back-on.png + - + 50 + 9203 + 9202 + + + !Control.IsEnabled(9201) + 76 + 0 + 64 + 64 + browser/button-action-disabled-overlay.png + scale + + + !container(5000).ListItem.property(browserHasNextUrl) + 152 + 0 + 64 + 64 + browser/button-action-nav-back-off.png + + + + !container(5000).ListItem.property(browserfullscreen) + container(5000).ListItem.property(browserHasNextUrl) + container(5000).ListItem.property(browserHasNextUrl) + 152 + 0 + 64 + 64 + BrowserForward + browser/button-action-nav-back-on.png + browser/button-action-nav-back-off.png + browser/button-action-nav-back-on.png + - + 50 + 9201 + 9004 + + + + !Control.IsEnabled(9202) + 152 + 0 + 64 + 64 + browser/button-action-disabled-overlay.png + scale + + + true + 228 + 0 + 760 + 64 + font30 + 50 + 9028 + 9202 + black + black + black + blue + $LOCALIZE[55400] + opaquegrey + left + center + 16 + text-field-unfocused.png + text-field-focused.png + + + false + 980 + 5 + 45 + 45 + ap-lock.png + DDBBBBBB + + + + 1000 + 0 + 64 + 64 + browser/button-action-bookmarks-on.png + browser/button-action-bookmarks-off.png + browser/button-action-bookmarks-on.png + - + 50 + 9004 + 9007 + + + true + !Player.PageIsLoading + !window(10362).property(browser-page-load-failed) + !Container(5000).ListItem.Property(disable-recommend) + browser/button-action-favorite-share-on.png + browser/button-action-favorite-share-off.png + browser/button-action-favorite-share-on.png + 9028 + 9025 + 50 + - + 1076 + 0 + 64 + 64 + + + !Control.IsEnabled(9007) + 1076 + 0 + 64 + 64 + browser/button-action-disabled-overlay.png + scale + + + true + !Player.PageIsLoading + !window(10362).property(is-favorite) + + !Player.PageIsLoading + !window(10362).property(browser-page-load-failed) + true + !window(10362).property(is-favorite) + browser/button-action-favorite-add-on.png + browser/button-action-favorite-add-off.png + browser/button-action-favorite-add-on.png + 9007 + 9027 + 50 + - + 1152 + 0 + 64 + 64 + + + !window(10362).property(browser-page-load-failed) + !Player.PageIsLoading + true + window(10362).property(is-favorite) + browser/button-action-favorite-remove-on.png + browser/button-action-favorite-remove-off.png + browser/button-action-favorite-remove-on.png + 9025 + - + 50 + - + 1152 + 0 + 64 + 64 + + + + !Control.IsEnabled(9025) | !Control.IsEnabled(9025) + 1152 + 0 + 64 + 64 + browser/button-action-disabled-overlay.png + scale + + + + + + Home Screen + Common_Background + + 0 + 0 + 1280 + 132 + browser/graphic-browser-bg.png + + + + BrowseBrowserFavoritesView + BrowseBrowserHistoryView + + BrowseLoadingAnimation + + + + diff --git a/skin/boxee/720p/boxee_channel_filter.xml b/skin/boxee/720p/boxee_channel_filter.xml new file mode 100644 index 00000000..a99a0b2d --- /dev/null +++ b/skin/boxee/720p/boxee_channel_filter.xml @@ -0,0 +1,124 @@ + + + 500 + no + + + 953 + 32 + 0 + false + + 0 + 0 + 292 + 656 + button-on.png + + + dialog title - Channel Filter + 27 + 10 + 260 + 44 + font20b + left + center + + white + + + channel section + !Control.IsEmpty(7025) + 0 + 10 + + + premium list + 2 + 12 + + 46 + 260 + 580 + - + - + - + 7035 + 200 + 60 + vertical + 6 + + ChannelFilterItemLayout + + ListItem.Property(isseparator) + + + 15 + 52 + 140 + 28 + font18b + left + center + + lightgreyheidi + + + + + + !Control.HasFocus(7025) + ChannelFilterFocusLayoutNotFocus + + + Control.HasFocus(7025) + ChannelFilterFocusLayoutFocus + + + + + + 233 + 5 + 54 + 54 + icons/icon_filter.png + + + + diff --git a/skin/boxee/720p/boxee_chapters.xml b/skin/boxee/720p/boxee_chapters.xml new file mode 100644 index 00000000..f314c0f1 --- /dev/null +++ b/skin/boxee/720p/boxee_chapters.xml @@ -0,0 +1,78 @@ + + + 500 + no + + + + + + + + + + 286 + 90 + + 0 + 0 + 708 + 544 + background/window-bg-transparent.png + + + 66 + 66 + 720 + 412 + Dialog.Close(406) + Dialog.Close(406) + 100 + 100 + 200 + 60 + vertical + + + IsEmpty(ListItem.Thumb) + 19 + -1 + 576 + 56 + font28b + left + center + + lightgreyheidi + + + + + 0 + 0 + 576 + 56 + button-focused.png + + + IsEmpty(ListItem.Thumb) + 19 + -1 + 576 + 56 + font28b + left + center + + whiteheidi + true + true + 100 + 100 + + + + + + + diff --git a/skin/boxee/720p/boxee_dialog_eject.xml b/skin/boxee/720p/boxee_dialog_eject.xml new file mode 100644 index 00000000..55233727 --- /dev/null +++ b/skin/boxee/720p/boxee_dialog_eject.xml @@ -0,0 +1,120 @@ + + + 341 + no + + Dialog_Popup_Background + + Dialog_Popup_Animation + 366 + 144 + + 0 + 0 + 548 + 434 + dialog_bg.png + + + 64 + 60 + 380 + 40 + Header_Heidi + left + center + + + + 66 + 118 + 480 + 260 + - + - + - + - + - + 200 + + + 44 + 0 + 356 + 56 + font28 + mediumgreyheidi + left + center + + + + ListItem.Property(IsSD) + 10 + 14 + 26 + 26 + mediumgreyheidi + icons/icon_browse_menu_sd.png + + + ListItem.Property(IsUSB) + 9 + 14 + 28 + 28 + mediumgreyheidi + icons/icon_browse_menu_usb.png + + + + + 0 + 0 + 416 + 56 + button-focused.png + + + 44 + 0 + 356 + 56 + font28 + whiteheidi + left + center + + true + + + ListItem.Property(IsSD) + 10 + 14 + 26 + 26 + whiteheidi + icons/icon_browse_menu_sd.png + + + ListItem.Property(IsUSB) + 9 + 14 + 28 + 28 + whiteheidi + icons/icon_browse_menu_usb.png + + + + + + + \ No newline at end of file diff --git a/skin/boxee/720p/boxee_dropdown_browser.xml b/skin/boxee/720p/boxee_dropdown_browser.xml new file mode 100644 index 00000000..86899229 --- /dev/null +++ b/skin/boxee/720p/boxee_dropdown_browser.xml @@ -0,0 +1,205 @@ + + + 500 + no + + + + info + 0 + 0 + 0 + 0 + false + + + + + + Dialog_Popup_Background + + Dialog_Popup_Animation + 340 + 112 + + dialog background + 0 + 0 + 600 + 442 + button_16_pixel.png + dialogbg + + + 11 + 11 + 578 + 420 + Dialog.Close(406) + Dialog.Close(406) + 100 + 100 + 200 + 601 + vertical + + + ListItem.IsFirst + !ListItem.IsLast + 0 + 0 + 578 + 60 + 33F8F8F8 + button_16_pixel_T.png + + + ListItem.IsFirst + ListItem.IsLast + 0 + 0 + 578 + 60 + 33F8F8F8 + button_16_pixel.png + + + !ListItem.IsFirst + !ListItem.IsLast + 0 + 0 + 578 + 60 + 33F8F8F8 + white.png + + + !ListItem.IsFirst + ListItem.IsLast + 0 + 0 + 578 + 60 + 33F8F8F8 + button_16_pixel_B.png + + + IsEmpty(ListItem.Thumb) + ListItem.Property(isseparator) + 15 + 0 + 558 + 60 + font30 + left + center + ListItem.Label + offwhite + offwhite + + + IsEmpty(ListItem.Thumb) + !ListItem.Property(isseparator) + 30 + 0 + 558 + 60 + font30 + left + center + ListItem.Label + offwhite + offwhite + + + !IsEmpty(ListItem.Thumb) + 10 + 0 + 195 + 60 + $INFO[ListItem.Thumb] + + + + + ListItem.IsFirst + !ListItem.IsLast + 0 + 0 + 578 + 60 + blue + button_16_pixel_T.png + + + ListItem.IsFirst + ListItem.IsLast + 0 + 0 + 578 + 60 + blue + button_16_pixel.png + + + !ListItem.IsFirst + !ListItem.IsLast + 0 + 0 + 578 + 60 + blue + white.png + + + !ListItem.IsFirst + ListItem.IsLast + 0 + 0 + 578 + 60 + blue + button_16_pixel_B.png + + + IsEmpty(ListItem.Thumb) + ListItem.Property(isseparator) + 15 + 0 + 558 + 60 + font30 + left + center + ListItem.Label + black + black + true + + + IsEmpty(ListItem.Thumb) + !ListItem.Property(isseparator) + 30 + 0 + 558 + 60 + font30 + left + center + ListItem.Label + black + black + true + + + !IsEmpty(ListItem.Thumb) + 10 + 0 + 195 + 60 + black + $INFO[ListItem.Thumb] + + + + + false + scroll bar indicator for lists + Control.IsVisible(600) + 454 + 16 + 12 + 340 + ScrollBarCommonProperties + + + + diff --git a/skin/boxee/720p/boxee_exit_video.xml b/skin/boxee/720p/boxee_exit_video.xml new file mode 100644 index 00000000..f7acd4b3 --- /dev/null +++ b/skin/boxee/720p/boxee_exit_video.xml @@ -0,0 +1,125 @@ + + + 27 + + Dialog_Popup_Background + + Popup_Heidi + + !player.islivetv + + 64 + 55 + 300 + 40 + font40b + left + top + whiteheidi + + + + message + 64 + 106 + 420 + 130 + left + top + font26ls + lightgreyheidi + + true + + + + player.islivetv + + 64 + 55 + 300 + 40 + font40b + left + top + whiteheidi + + + + message + 64 + 106 + 420 + 130 + left + top + font26ls + lightgreyheidi + + true + + + + !player.isbrowser + 64 + 283 + 420 + 48 + - + 25 + - + - + RadioButton_Heidi + + + + + Conditional + 64 + 364 + 420 + 56 + Button_Heidi + + + 20 + 27 + - + - + - + + + Conditional + 64 + 432 + 420 + 56 + Button_Heidi + + + 26 + 28 + - + - + - + + + player.isbrowser + 64 + 432 + 420 + 56 + Button_Heidi + + + 27 + - + - + - + BrowserFullScreen(false) + close + + + + + diff --git a/skin/boxee/720p/boxee_get_facebook_extra_cred.xml b/skin/boxee/720p/boxee_get_facebook_extra_cred.xml new file mode 100644 index 00000000..8fe19f33 --- /dev/null +++ b/skin/boxee/720p/boxee_get_facebook_extra_cred.xml @@ -0,0 +1,70 @@ + + + 11 + + + 0 + 0 + 1280 + 720 + black.png + AAFFFFFF + + + Popup_Heidi + + heading label + 62 + 52 + 445 + 70 + left + top + font40bls + whiteheidi + + + + dialog line 1 + 63 + 124 + 425 + 226 + + top + font26ls + lightgreyheidi + + true + + + 66 + 422 + 416 + 56 + Button_Heidi + + + 10 + - + - + - + - + + + 66 + 354 + 416 + 56 + Button_Heidi + + + - + 11 + - + - + - + + + + diff --git a/skin/boxee/720p/boxee_livetv_context.xml b/skin/boxee/720p/boxee_livetv_context.xml new file mode 100644 index 00000000..190f67ac --- /dev/null +++ b/skin/boxee/720p/boxee_livetv_context.xml @@ -0,0 +1,682 @@ + + + 50 + no + + + 0 + 0 + 1280 + 720 + black.png + C8FFFFFF + + + OSD_Clock + + + + 0 + 0 + 32 + 720 + graphic-scanline-48.png + + + + Conditional + Conditional + + 0 + 0 + 32 + 720 + colors/color-black.png + 77FFFFFF + + + + 32 + 0 + 512 + 720 + colors/color-black.png + 99FFFFFF + + + 32 + 72 + 512 + 648 + vertical + 50 + 50 + 47 + - + + + ListItem.Property(IsActive) + 0 + 0 + 512 + 152 + colors/color-black.png + + + !ListItem.Property(issubitem) + !ListItem.IsFirst + -4 + -8 + 516 + 16 + livetv/graphic-divider-768.png + + + ListItem.Property(issubitem) + 130 + -8 + 368 + 16 + livetv/graphic-divider-588.png + + + + !ListItem.Property(isactive) + !ListItem.Property(issubitem) + + 16 + 21 + 108 + 20 + mediumgreyheidi + font20b + + + + !IsEmpty(ListItem.Property(ChannelName)) + 16 + 45 + 84 + 20 + mediumgreyheidi + font20b + + + + IsEmpty(ListItem.Property(ChannelName)) + 16 + 21 + 84 + 20 + mediumgreyheidi + font20b + + + + + ListItem.Property(isactive) + !ListItem.Property(issubitem) + + 16 + 21 + 108 + 20 + boxeegreenheidi + font20b + + + + !IsEmpty(ListItem.Property(ChannelName)) + 16 + 45 + 84 + 20 + boxeegreenheidi + font20b + + + + IsEmpty(ListItem.Property(ChannelName)) + 16 + 21 + 84 + 20 + boxeegreenheidi + font20b + + + + + + ListItem.Property(isactive) + 130 + 12 + 368 + 128 + button-on.png + + + ListItem.Property(HasEpg) + 144 + 18 + 338 + 20 + whiteheidi + font28b + + + + !ListItem.Property(HasEpg) + 144 + 18 + 338 + 20 + mediumgreyheidi + font28b + + + + 145 + 54 + 308 + 20 + mediumgreyheidi + font20b + + + + + ListItem.Property(isnew) + 448 + 62 + 36 + 16 + livetv/icon-new.png + + + + + ListItem.Property(friendswatching) + IsEmpty(ListItem.Property(userthumb-1)) + IsEmpty(ListItem.Property(userthumb-2)) + + 146 + 86 + 220 + 60 + mediumgreyheidi + font16 + + true + + + + + ListItem.Property(friendswatching) + !IsEmpty(ListItem.Property(userthumb-1)) + IsEmpty(ListItem.Property(userthumb-2)) + + 146 + 92 + 32 + 32 + $INFO[ListItem.Property(userthumb-1)] + + + 185 + 86 + 220 + 60 + mediumgreyheidi + font16 + + true + + + + + ListItem.Property(friendswatching) + !IsEmpty(ListItem.Property(userthumb-1)) + !IsEmpty(ListItem.Property(userthumb-2)) + + 146 + 92 + 32 + 32 + $INFO[ListItem.Property(userthumb-1)] + + + 182 + 92 + 32 + 32 + $INFO[ListItem.Property(userthumb-2)] + + + 222 + 86 + 220 + 60 + mediumgreyheidi + font16 + + true + + + + + + ListItem.Property(otherswatching) + + 144 + 86 + 220 + 60 + lightgreyheidi + font16 + + true + + + + ListItem.Property(isactive) + [ [ListItem.Property(isnow) + ListItem.Property(HasEpg) ] | !ListItem.Property(HasEpg) ] + 448 + 100 + 35 + 26 + livetv/icon-tune-in.png + + + + + ListItem.Property(IsActive) + 0 + 0 + 512 + 152 + colors/color-black.png + + + !ListItem.Property(issubitem) + !ListItem.IsFirst + -4 + -8 + 516 + 16 + livetv/graphic-divider-768.png + + + ListItem.Property(issubitem) + 130 + -8 + 368 + 16 + livetv/graphic-divider-588.png + + + + !ListItem.Property(isactive) + !ListItem.Property(issubitem) + + 16 + 21 + 108 + 20 + mediumgreyheidi + font20b + + + + !IsEmpty(ListItem.Property(ChannelName)) + 16 + 45 + 84 + 20 + mediumgreyheidi + font20b + + + + IsEmpty(ListItem.Property(ChannelName)) + 16 + 21 + 84 + 20 + mediumgreyheidi + font20b + + + + + ListItem.Property(isactive) + !ListItem.Property(issubitem) + + 16 + 21 + 108 + 20 + boxeegreenheidi + font20b + + + + !IsEmpty(ListItem.Property(ChannelName)) + 16 + 45 + 84 + 20 + boxeegreenheidi + font20b + + + + IsEmpty(ListItem.Property(ChannelName)) + 16 + 21 + 84 + 20 + boxeegreenheidi + font20b + + + + + + ListItem.Property(isactive) + 130 + 12 + 368 + 128 + button-on.png + + + Control.HasFocus(50) + + 130 + 12 + 368 + 128 + button-focused.png + + + ListItem.Property(HasEpg) + 144 + 18 + 338 + 20 + whiteheidi + font28b + + + + !ListItem.Property(HasEpg) + 144 + 18 + 338 + 20 + whiteheidi + font28b + + + + 145 + 54 + 308 + 20 + lightgreyheidi + font20b + + + + + !Control.HasFocus(50) + + 144 + 18 + 308 + 20 + whiteheidi + font28b + + + + 145 + 54 + 308 + 20 + mediumgreyheidi + font20b + + + + + + ListItem.Property(isnew) + 448 + 62 + 36 + 16 + livetv/icon-new.png + + + + + ListItem.Property(friendswatching) + IsEmpty(ListItem.Property(userthumb-1)) + IsEmpty(ListItem.Property(userthumb-2)) + + 146 + 86 + 220 + 60 + mediumgreyheidi + font16 + + true + + + + + ListItem.Property(friendswatching) + !IsEmpty(ListItem.Property(userthumb-1)) + IsEmpty(ListItem.Property(userthumb-2)) + + 146 + 92 + 32 + 32 + $INFO[ListItem.Property(userthumb-1)] + + + 185 + 86 + 220 + 60 + mediumgreyheidi + font16 + + true + + + + + ListItem.Property(friendswatching) + !IsEmpty(ListItem.Property(userthumb-1)) + !IsEmpty(ListItem.Property(userthumb-2)) + + 146 + 92 + 32 + 32 + $INFO[ListItem.Property(userthumb-1)] + + + 182 + 92 + 32 + 32 + $INFO[ListItem.Property(userthumb-2)] + + + 222 + 86 + 220 + 60 + mediumgreyheidi + font16 + + true + + + + + ListItem.Property(isactive) + [ [ListItem.Property(isnow) + ListItem.Property(HasEpg) ] | !ListItem.Property(HasEpg) ] + 448 + 100 + 35 + 26 + livetv/icon-tune-in.png + + + + !ListItem.Property(isnow) + ListItem.Property(hasepg) + 451 + 98 + 30 + 30 + livetv/icon-info-large.png + + + + + + + 0 + 26 + 32 + 32 + livetv/graphic-arrow-left.png + + + Window(10518).Property(HasNext) + 499 + 26 + 32 + 32 + livetv/graphic-arrow-left.png + + + 48 + 24 + 300 + 40 + boxeegreenheidi + font26b + + + + 32 + 64 + 512 + 16 + livetv/graphic-divider-768.png + + + + + + Conditional + + -96 + 0 + 70 + 720 + black.png + + + true + -82 + 33 + 207 + 650 + - + - + - + 50 + vertical + - + 200 + + + 4 + 4 + 44 + 44 + $INFO[ListItem.ActualIcon] + + + + + Control.HasFocus(47) + + 0 + 0 + 207 + 52 + button-focused.png + - + + + 4 + 4 + 44 + 44 + $INFO[ListItem.ActualIcon] + + + 51 + 11 + 296 + 80 + font20b + top + left + true + whiteheidi + + + + + !Control.HasFocus(47) + + 0 + 0 + 52 + 52 + button-on.png + button-on.png + + + 4 + 4 + 44 + 44 + $INFO[ListItem.ActualIcon] + + + + + + 12 + + - + livetv/icon-channels.png + - + + + Dvb.SharingEnabled + 13 + + - + livetv/icon-sharing-disabled.png + - + + + !Dvb.SharingEnabled + 14 + + - + livetv/icon-sharing-enabled.png + - + + + + + + diff --git a/skin/boxee/720p/boxee_livetv_edit_channels.xml b/skin/boxee/720p/boxee_livetv_edit_channels.xml new file mode 100644 index 00000000..93b54cdc --- /dev/null +++ b/skin/boxee/720p/boxee_livetv_edit_channels.xml @@ -0,0 +1,358 @@ + + + 46 + no + + + 375 + 70 + + 0 + 0 + 532 + 560 + dialog_bg.png + + + + 54 + 42 + 424 + 40 + whiteheidi + font40b + + + + 54 + 96 + 424 + 100 + lightgreyheidi + font20 + + true + + + 6 + 159 + 508 + 40 + osd/graphic-divider-horz.png + + + + 38 + 195 + 452 + 337 + - + - + 46 + 61 + 3 + vertical + - + 200 + + + 20 + 18 + 25 + 25 + graphic-check-54px.png + ListItem.Property(ChannelEnabled) + + + 20 + 18 + 25 + 25 + graphic-check-empty-54px.png + !ListItem.Property(ChannelEnabled) + + + 57 + 0 + 310 + 60 + left + center + + font28b + + + + + !Control.HasFocus(61) + 0 + 0 + 376 + 60 + button-focused.png + + + Control.HasFocus(61) + 0 + 0 + 376 + 60 + button-on.png + + + 20 + 18 + 25 + 25 + graphic-check-54px.png + ListItem.Property(ChannelEnabled) + + + !Control.HasFocus(61) + 390 + 0 + 60 + 60 + actionbuttons/button-action-settings-unfocused.png + + + Control.HasFocus(61) + 390 + 0 + 60 + 60 + actionbuttons/button-action-settings-focused.png + + + 57 + 0 + 310 + 60 + left + center + + font28b + + + + + + edit button + 120 + 210 + 1040 + 60 + - + - + - + 46 + - + - + - + - + + + + false + + 60 + 42 + 424 + 40 + whiteheidi + font26b + + + + + 60 + 88 + 412 + 56 + Edit_Heidi + left + 14 + $LOCALIZE[90318] + lightgreyheidi + - + - + - + - + 22 + + + + + 60 + 160 + 424 + 40 + whiteheidi + font26b + + + + + 45 + 206 + 452 + 337 + 21 + - + - + - + 3 + vertical + - + 200 + + + 20 + 18 + 25 + 25 + universal/graphic-radio-dot.png + ListItem.IsSelected + + + 20 + 18 + 25 + 25 + universal/graphic-radio-blank.png + !ListItem.IsSelected + + + 57 + 0 + 377 + 60 + left + center + + font28b + + + + + Control.HasFocus(22) + 0 + 0 + 376 + 60 + button-focused.png + + + 20 + 18 + 25 + 25 + universal/graphic-radio-dot.png + ListItem.IsSelected + + + 20 + 18 + 25 + 25 + universal/graphic-radio-blank.png + !ListItem.IsSelected + + + 57 + 0 + 377 + 60 + left + center + + font28b + + + + + + + Control.IsVisible(22) + !Container(22).ListItem.IsLast + 50 + 500 + 370 + 26 + osd_gradient.png + + + + + diff --git a/skin/boxee/720p/boxee_livetv_info.xml b/skin/boxee/720p/boxee_livetv_info.xml new file mode 100644 index 00000000..fae9c97e --- /dev/null +++ b/skin/boxee/720p/boxee_livetv_info.xml @@ -0,0 +1,112 @@ + + + 3333 + no + + + info + 0 + 0 + 0 + 0 + false + + + + + + + + 0 + 0 + 1280 + 720 + black.png + 88FFFFFF + + + + 281 + 109 + + 0 + 0 + 710 + 491 + dialog_bg.png + + + 64 + 47 + 588 + 20 + font20b + boxeegreenheidi + left + top + + + + 64 + 67 + 570 + + font40 + left + white + + + 64 + 116 + horizontal + true + + auto + font22b + darkgreyheidi + + left + + + Container(5000).ListItem.Property(IsNew) + auto + + font22b + left + darkgreyheidi + + + + 10 + 160 + 690 + 33 + feather_divider.png + + + 64 + 184 + vertical + true + + 570 + auto + font22b + whiteheidi + + left + + + + 570 + auto + + font22 + left + darkgreyheidi + true + + + + + diff --git a/skin/boxee/720p/boxee_livetv_no_channels.xml b/skin/boxee/720p/boxee_livetv_no_channels.xml new file mode 100644 index 00000000..386304e1 --- /dev/null +++ b/skin/boxee/720p/boxee_livetv_no_channels.xml @@ -0,0 +1,58 @@ + + + 2 + no + + + DialogNoAnim_Heidi + + + + Header + 63 + 95 + 345 + left + center + + true + Header_Heidi + + + + 64 + 139 + 306 + left + top + + true + LargeText_Heidi + + + + + 3 + - + 474 + 210 + Button_Heidi + + 312 + 56 + + + + 474 + 278 + 312 + 56 + Button_Heidi + + - + 2 + - + + + + diff --git a/skin/boxee/720p/boxee_livetv_scan.xml b/skin/boxee/720p/boxee_livetv_scan.xml new file mode 100644 index 00000000..f6fc0ff3 --- /dev/null +++ b/skin/boxee/720p/boxee_livetv_scan.xml @@ -0,0 +1,208 @@ + + + 3333 + no + + + 0 + 0 + 1280 + 720 + black.png + C8FFFFFF + + + + 215 + 119 + + 0 + 0 + 850 + 291 + dialog_bg.png + + + + + true + + 62 + 50 + 588 + 20 + font40b + white + left + top + + + + 62 + 104 + 760 + 20 + font24b + mediumgreyheidi + left + top + + + + 64 + 162 + 720 + 64 + true + false + livetv/graphic-scanning-progress-bg.png + livetv/graphic-scanning-progress-left.png + livetv/graphic-scanning-progress-center.png + livetv/graphic-scanning-progress-right.png + - + DVB.ScanProgress + + + + + + false + + 62 + 50 + 588 + 20 + font40b + white + left + top + + + + 62 + 104 + 760 + 20 + font24b + mediumgreyheidi + left + top + + + + 64 + 162 + 720 + 60 + Button_Heidi + + + + + + + false + + 62 + 50 + 588 + 20 + font40b + white + left + top + + + + 62 + 104 + 760 + 20 + font24b + mediumgreyheidi + left + top + + + + 64 + 162 + 720 + 60 + Button_Heidi + + + + + + + false + + 62 + 50 + 588 + 20 + font40b + white + left + top + + + + 62 + 104 + 760 + 20 + font24b + mediumgreyheidi + left + top + + + + 64 + 162 + 720 + 60 + Button_Heidi + + + + + + + false + + 62 + 50 + 588 + 20 + font40b + white + left + top + + + + 62 + 104 + 760 + 20 + font24b + mediumgreyheidi + left + top + + + + 64 + 162 + 720 + 60 + Button_Heidi + + + + + + diff --git a/skin/boxee/720p/boxee_livetv_window.xml b/skin/boxee/720p/boxee_livetv_window.xml new file mode 100644 index 00000000..5ca067e3 --- /dev/null +++ b/skin/boxee/720p/boxee_livetv_window.xml @@ -0,0 +1,550 @@ + + + 50 + no + + + + + !Dvb.IsTuned + 0 + 0 + 1280 + 720 + black.png + + + + + Dvb.IsTuned + Dvb.IsSignalOk + 0 + 0 + 1280 + 720 + + + + + [ Dvb.IsTuned + !Dvb.IsSignalOk ] | Dvb.IsTuningFailed + 0 + 0 + 1280 + 720 + black.png + + + + [ Dvb.IsTuned + !Dvb.IsSignalOk ] | Dvb.IsTuningFailed + 510 + 225 + livetv/graphic-no-signal.png + + + + [ Dvb.IsTuned + !Dvb.IsSignalOk ] | Dvb.IsTuningFailed + 300 + 420 + 700 + + font40b + center + mediumgreyheidi + + + + + + + !Control.IsVisible(50) + TopGradient + BottomGradient + + + false + + + + Dvb.HasEpg + 24 + 16 + 1066 + + font46 + left + whiteheidi + + + + + Dvb.HasEpg + 24 + 76 + horizontal + true + + DVB.ShowIsNew + auto + + font26b + left + darkgreyheidi + + + DVB.ShowIsNew + [ !IsEmpty(DVB.ShowSeason) | !IsEmpty(DVB.ShowEpisode) ] + auto + + font26b + left + darkgreyheidi + + + !IsEmpty(DVB.ShowSeason) + auto + + font26b + left + darkgreyheidi + + + !IsEmpty(DVB.ShowEpisode) + auto + + font26b + left + darkgreyheidi + + + !IsEmpty(DVB.ShowEpisodeTitle) + [ !IsEmpty(DVB.ShowSeason) | !IsEmpty(DVB.ShowEpisode) | [ IsEmpty(DVB.ShowSeason) + IsEmpty(DVB.ShowEpisode) + Dvb.ShowIsNew ] ] + auto + + font26b + left + darkgreyheidi + + + !IsEmpty(DVB.ShowEpisodeTitle) + auto + 20 + darkgreyheidi + font26b + + + + + + + Dvb.HasEpg + [ DVB.ShowIsNew | !IsEmpty(DVB.ShowSeason) | !IsEmpty(DVB.ShowEpisode) | !IsEmpty(DVB.ShowEpisodeTitle) ] + 24 + 112 + horizontal + true + + !IsEmpty(Dvb.ChannelNumber) + auto + + font26b + left + darkgreyheidi + + + auto + + font26b + left + darkgreyheidi + + + auto + 20 + darkgreyheidi + font26b + left + + + + !IsEmpty(Dvb.ShowRating) + 500 + + font26b + left + darkgreyheidi + + + + + + Dvb.HasEpg + !DVB.ShowIsNew + IsEmpty(DVB.ShowSeason) + IsEmpty(DVB.ShowEpisode) + IsEmpty(DVB.ShowEpisodeTitle) + 24 + 76 + horizontal + true + + !IsEmpty(Dvb.ChannelNumber) + auto + + font26b + left + darkgreyheidi + + + auto + + font26b + left + darkgreyheidi + + + auto + 20 + darkgreyheidi + font26b + + + + !IsEmpty(Dvb.ShowRating) + 500 + + font26b + left + darkgreyheidi + + + + + + !Dvb.HasEpg + 24 + 24 + horizontal + true + + !IsEmpty(Dvb.ChannelNumber) + auto + + font26b + left + darkgreyheidi + + + auto + + font26b + left + darkgreyheidi + + + + OSD_Clock + + + + !Control.IsVisible(40) + 930 + 645 + + 0 + 15 + 40 + 40 + $INFO[DVB.FriendThumb2] + + + 49 + 15 + 40 + 40 + $INFO[DVB.FriendThumb1] + + + 100 + 9 + 220 + 60 + mediumgreyheidi + font20 + + true + + + + + + false + 0 + 580 + + + 32 + 0 + 600 + 100 + 9000 + 9011 + 9100 + 8100 + 200 + - + horizontal + + + 0 + 0 + 64 + 64 + $INFO[ListItem.Thumb]-off.png + + + + + !Control.HasFocus(9150) + 0 + 0 + 64 + 64 + $INFO[ListItem.Thumb]-off.png + + + Control.HasFocus(9150) + 0 + 0 + 64 + 64 + $INFO[ListItem.Thumb]-on.png + + + + + 9001 + - + buttons/button-osd-guide + + + + 9002 + Dvb.HasEPG + - + buttons/button-osd-info + + + + 9003 + !boxee.OfflineMode + Dvb.HasEPG + - + buttons/button-osd-share + + + + + + + + + 930 + 24 + 40 + 40 + $INFO[DVB.FriendThumb2] + + + 979 + 24 + 40 + 40 + $INFO[DVB.FriendThumb1] + + + 1030 + 18 + 220 + 60 + mediumgreyheidi + font20 + + true + + + + + + Dvb.HasEpg + 0 + 96 + + 0 + 0 + 1280 + 44 + black.png + + + 132 + 0 + 1016 + 44 + Dvb.ShowProgress + osd/osd-progressbar.png + - + osd/osd-progressbar-played.png + - + - + + + 0 + 1 + 132 + 44 + font28b + whiteheidi + + center + center + + + 1148 + 1 + 132 + 44 + font28b + whiteheidi + + center + center + + + + + + false + 0 + 0 + + 0 + 0 + 1280 + 720 + black.png + C8FFFFFF + + + 281 + 109 + + 0 + 0 + 710 + 491 + dialog_bg.png + + + 64 + 45 + 570 + + font40 + left + white + + + 64 + 96 + horizontal + true + + auto + font22b + darkgreyheidi + + left + + + DVB.ShowIsNew + auto + + font22b + left + darkgreyheidi + + + + 10 + 140 + 690 + 33 + feather_divider.png + + + + 64 + 162 + vertical + true + + 570 + auto + font22b + whiteheidi + + left + + + + 570 + auto + + font22 + left + darkgreyheidi + true + + + + + + + + VisibleChange + 36 + 36 + + false + 0 + 0 + 1208 + 163 + menu_dialog_background.png + F3212121 + + + false + row 1 label + 25 + 10 + 1158 + + font18b + left + + + false + row 2 label + 25 + 45 + 1158 + + font18b + left + + + false + row 3 label + 25 + 80 + 1158 + + font18b + left + + + + + diff --git a/skin/boxee/720p/boxee_login_edit_existing_user.xml b/skin/boxee/720p/boxee_login_edit_existing_user.xml new file mode 100644 index 00000000..40ab757a --- /dev/null +++ b/skin/boxee/720p/boxee_login_edit_existing_user.xml @@ -0,0 +1,175 @@ + + + 8602 + no + + Common_Background + BoxeeLogoLogin + + FTUDialog_Heidi + + + Password + 474 + 66 + 312 + 56 + Edit_Heidi + left + 14 + $LOCALIZE[15052] + opaquegrey + true + - + - + - + 8601 + 8603 + 8603 + + + 474 + 134 + 312 + 48 + - + - + 8602 + 8602 + 8607 + 8607 + + + RadioButton_Heidi + + + 474 + 194 + 312 + 48 + - + - + 8603 + 8603 + 8604 + 8604 + + + RadioButton_Heidi + + + 474 + 374 + 312 + 56 + Button_Heidi + + + 8607 + 8606 + - + - + - + + + 474 + 442 + 312 + 36 + button-focused.png + - + font20b + lightgreyheidi + whiteheidi + lightgreyheidi + center + center + + + 8604 + - + - + - + - + + + + + + 110 + 66 + 224 + 224 + thumbnail-bg-focused.png + + + 110 + 66 + 224 + 224 + scale + - + + + + Username + 85 + 304 + 200 + 270 + center + top + white + font40bls + + true + + + + + + OnDialogOpen_HideItem + 1032 + 32 + + 0 + 0 + 64 + 64 + actionbuttons/button-action-plus-focused.png + actionbuttons/button-action-plus-unfocused.png + - + - + 7000 + 7000 + 9003 + + + 76 + 0 + 64 + 64 + actionbuttons/button-action-wifi-focused.png + actionbuttons/button-action-wifi-unfocused.png + ActivateWindow(NetworkSettings) + - + 7000 + 9004 + + + 152 + 0 + 64 + 64 + actionbuttons/button-action-shutdown-focused.png + actionbuttons/button-action-shutdown-unfocused.png + XBMC.ShutDown() + - + 7000 + 9003 + - + + + + + diff --git a/skin/boxee/720p/boxee_login_screen.xml b/skin/boxee/720p/boxee_login_screen.xml new file mode 100644 index 00000000..f5a09fa4 --- /dev/null +++ b/skin/boxee/720p/boxee_login_screen.xml @@ -0,0 +1,250 @@ + + + 62 + no + + Common_Background + + BoxeeLogoLogin + + + + 224 + -142 + + + + + + + + + + + 236 + 0 + 1100 + 400 + - + - + 9010 + 61 + - + horizontal + 1 + + + + !IsEmpty(ListItem.Thumb) + 0 + 0 + 240 + 240 + scale + $INFO[ListItem.Thumb] + thumbnail-bg-unfocused.png + 8 + + + + IsEmpty(ListItem.Thumb) + 0 + 0 + 240 + 240 + scale + default_user.png + thumbnail-bg-unfocused.png + 8 + + + + 120 + 249 + 210 + 28 + + font28b + center + center + FFB3B8BB + + + + + + + !Control.HasFocus(62) + + !IsEmpty(ListItem.Thumb) + 0 + 0 + 240 + 240 + scale + $INFO[ListItem.Thumb] + thumbnail-bg-unfocused.png + 8 + + + + IsEmpty(ListItem.Thumb) + 0 + 0 + 240 + 240 + scale + default_user.png + thumbnail-bg-unfocused.png + 8 + + + + 120 + 249 + 210 + 28 + + font28b + center + center + FFB3B8BB + + + + Control.HasFocus(62) + + + !IsEmpty(ListItem.Thumb) + 0 + 0 + 240 + 240 + scale + 200 + $INFO[ListItem.Thumb] + thumbnail-bg-focused.png + 8 + + + + IsEmpty(ListItem.Thumb) + 0 + 0 + 240 + 240 + scale + 200 + default_user.png + thumbnail-bg-focused.png + 8 + + + + 120 + 249 + 210 + 28 + + font28b + center + center + FFB3B8BB + false + + + + !Control.HasFocus(61) + 88 + 308 + 64 + 64 + actionbuttons/button-action-settings-unfocused.png + + + Control.HasFocus(61) + 88 + 308 + 64 + 64 + actionbuttons/button-action-settings-focused.png + + + + + + edit button + 120 + 210 + 1040 + 60 + 62 + - + 62 + 62 + - + - + - + - + + + + + + 1032 + 32 + + 0 + 0 + 64 + 64 + actionbuttons/button-action-plus-focused.png + actionbuttons/button-action-plus-unfocused.png + - + - + 7000 + 7000 + 9013 + + + 76 + 0 + 64 + 64 + actionbuttons/button-action-wifi-focused.png + actionbuttons/button-action-wifi-unfocused.png + ActivateWindow(NetworkSettings) + - + 7000 + 9011 + 9014 + + + 152 + 0 + 64 + 64 + actionbuttons/button-action-shutdown-focused.png + actionbuttons/button-action-shutdown-unfocused.png + XBMC.ShutDown() + - + 7000 + 9013 + - + + + + + diff --git a/skin/boxee/720p/boxee_login_wizard_add_existing_user.xml b/skin/boxee/720p/boxee_login_wizard_add_existing_user.xml new file mode 100644 index 00000000..2363985f --- /dev/null +++ b/skin/boxee/720p/boxee_login_wizard_add_existing_user.xml @@ -0,0 +1,138 @@ + + + 8605 + no + + Common_Background + BoxeeLogoLogin + + FTUDialog_Heidi + + + Username + 474 + 66 + 312 + 56 + Edit_Heidi + left + 14 + $LOCALIZE[1014] + lightgreyheidi + - + - + 9003 + - + 8602 + 8602 + + + Password + 474 + 134 + 312 + 56 + Edit_Heidi + left + 14 + $LOCALIZE[15052] + lightgreyheidi + true + - + - + 8605 + 8605 + 8603 + 8603 + + + 474 + 202 + 312 + 48 + - + - + 8602 + 8602 + 8607 + 8607 + + + RadioButton_Heidi + + + 474 + 262 + 312 + 48 + - + - + 8603 + 8603 + 1 + 1 + + + RadioButton_Heidi + + + 474 + 422 + 312 + 56 + Button_Heidi + + + 8607 + 8606 + - + - + - + + + + + 63 + 57 + 400 + 320 + left + top + Header_Heidi + + true + + + + + + + diff --git a/skin/boxee/720p/boxee_login_wizard_add_new_user.xml b/skin/boxee/720p/boxee_login_wizard_add_new_user.xml new file mode 100644 index 00000000..c5a2cf5f --- /dev/null +++ b/skin/boxee/720p/boxee_login_wizard_add_new_user.xml @@ -0,0 +1,261 @@ + + + 8700 + no + + Common_Background + BoxeeLogoLogin + + FTUDialog_Heidi + + + FacebookConnect_Heidi + 474 + 66 + - + - + 9003 + - + 8701 + 8701 + + + 474 + 132 + 312 + 20 + + + font20b + lightgreyheidi + center + center + + + UserName + 474 + 162 + 312 + 56 + Edit_Heidi + left + 14 + $LOCALIZE[51891] + lightgreyheidi + - + - + 8700 + 8700 + 8702 + 8702 + + + window(10282).property(name-is-valid) + !Control.IsEmpty(8701) + 798 + 176 + 24 + 24 + graphic-check.png + + + !window(10282).property(name-is-valid) + !Control.IsEmpty(8701) + 798 + 176 + 24 + 24 + graphic-error.png + + + + + Email + window(10282).property(name-is-valid) + 474 + 230 + 312 + 56 + Edit_Heidi + left + 14 + $LOCALIZE[55620] + lightgreyheidi + - + - + 8701 + 8701 + 8703 + 8703 + + + window(10282).property(email-is-valid) + !Control.IsEmpty(8702) + 798 + 244 + 24 + 24 + graphic-check.png + + + !window(10282).property(email-is-valid) + !Control.IsEmpty(8702) + 798 + 244 + 24 + 24 + graphic-error.png + + + + + Password + window(10282).property(name-is-valid) + window(10282).property(email-is-valid) + 474 + 298 + 312 + 56 + Edit_Heidi + left + 14 + $LOCALIZE[51892] + lightgreyheidi + true + - + - + 8702 + 8702 + 1 + 1 + + + window(10282).property(password-is-valid) + !Control.IsEmpty(8703) + 798 + 312 + 24 + 24 + graphic-check.png + + + !window(10282).property(password-is-valid) + !Control.IsEmpty(8703) + 798 + 312 + 24 + 24 + graphic-error.png + + + + + !window(10282).property(name-is-valid) + !Control.IsEmpty(8701) + 474 + 367 + 312 + 20 + + font20b + errorredheidi + center + center + + + !window(10282).property(email-is-valid) + !Control.IsEmpty(8702) + 474 + 367 + 312 + 20 + + font20b + errorredheidi + center + center + + + !window(10282).property(password-is-valid) + !Control.IsEmpty(8703) + 474 + 367 + 312 + 20 + + font20b + errorredheidi + center + center + + + + window(10282).property(name-is-valid) + window(10282).property(email-is-valid) + window(10282).property(password-is-valid) + !Control.IsEmpty(8701) + !Control.IsEmpty(8702) + !Control.IsEmpty(8703) + 474 + 422 + 312 + 56 + Button_Heidi + + + 8703 + - + - + - + + + + + + 66 + 66 + 12 + 12 + graphic_steps_circle.png + + + 82 + 66 + 12 + 12 + graphic_steps_dot.png + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + 114 + 66 + 12 + 12 + graphic_steps_dot.png + + + 130 + 66 + 12 + 12 + graphic_steps_dot.png + + + + Header + 63 + 97 + 320 + 200 + left + top + + Header_Heidi + true + + + + 64 + 203 + 336 + left + top + + true + LargeText_Heidi + + + + + diff --git a/skin/boxee/720p/boxee_login_wizard_choose_user_to_add_type.xml b/skin/boxee/720p/boxee_login_wizard_choose_user_to_add_type.xml new file mode 100644 index 00000000..c234c732 --- /dev/null +++ b/skin/boxee/720p/boxee_login_wizard_choose_user_to_add_type.xml @@ -0,0 +1,103 @@ + + + 1 + no + + Common_Background + BoxeeLogoLogin + + Popup_Heidi + + 65 + 70 + 408 + 24 + + Header_Heidi + left + center + + + 65 + 105 + 408 + 220 + + font24 + left + top + lightgreyheidi + true + + + 66 + 354 + 415 + 56 + Button_Heidi + + + 9003 + 8902 + - + - + + + 66 + 422 + 415 + 56 + Button_Heidi + + + 8901 + - + - + - + + + + + diff --git a/skin/boxee/720p/boxee_login_wizard_confirmation.xml b/skin/boxee/720p/boxee_login_wizard_confirmation.xml new file mode 100644 index 00000000..b6f18e64 --- /dev/null +++ b/skin/boxee/720p/boxee_login_wizard_confirmation.xml @@ -0,0 +1,47 @@ + + + 1 + no + + Common_Background + BoxeeLogoLogin + + Popup_Heidi + + 63 + 47 + 550 + 28 + font40b + whiteheidi + left + top + + + + 63 + 103 + 416 + 260 + + top + font26ls + lightgreyheidi + true + + + 66 + 422 + 416 + 56 + Button_Heidi + + - + - + 10 + 10 + - + + + + diff --git a/skin/boxee/720p/boxee_login_wizard_connect_social_services.xml b/skin/boxee/720p/boxee_login_wizard_connect_social_services.xml new file mode 100644 index 00000000..6aaac91a --- /dev/null +++ b/skin/boxee/720p/boxee_login_wizard_connect_social_services.xml @@ -0,0 +1,168 @@ + + + 8700 + no + + Common_Background + BoxeeLogoLogin + + FTUDialog_Heidi + + + FacebookConnect_Heidi + 474 + 66 + - + - + 9003 + - + 8701 + 8701 + + + true + window.property(facebook-connected) + 798 + 79 + 24 + 24 + graphic-check.png + + + + TwitterConnect_Heidi + 474 + 136 + - + - + 8700 + - + 8702 + 8702 + + + true + window.property(twitter-connected) + 798 + 152 + 24 + 24 + graphic-check.png + + + + TumblrConnect_Heidi + 474 + 203 + - + - + 8701 + - + 8704 + 8704 + + + true + window.property(tumblr-connected) + 798 + 216 + 24 + 24 + graphic-check.png + + + + + 474 + 422 + 312 + 56 + Button_Heidi + + + SetFocus(8702) + - + 2 + - + - + Window.Property(facebook-connected) | Window.Property(twitter-connected) | Window.Property(tumblr-connected) + + + + 474 + 422 + 312 + 56 + Button_Heidi + + + SetFocus(8702) + - + 2 + - + - + !Window.Property(facebook-connected) + !Window.Property(twitter-connected) + !Window.Property(tumblr-connected) + + + + + + 66 + 66 + 12 + 12 + graphic_steps_dot.png + + + 82 + 66 + 12 + 12 + graphic_steps_dot.png + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + 114 + 66 + 12 + 12 + graphic_steps_circle.png + + + 130 + 66 + 12 + 12 + graphic_steps_dot.png + + + Header + 63 + 97 + 320 + 200 + left + top + + Header_Heidi + true + + + + 64 + 203 + 336 + left + top + + true + LargeText_Heidi + + + + + + diff --git a/skin/boxee/720p/boxee_login_wizard_menu_cust.xml b/skin/boxee/720p/boxee_login_wizard_menu_cust.xml new file mode 100644 index 00000000..23133f3c --- /dev/null +++ b/skin/boxee/720p/boxee_login_wizard_menu_cust.xml @@ -0,0 +1,96 @@ + + + 8700 + no + + Common_Background + BoxeeLogoLogin + + FTUDialog_Heidi + + + 474 + 66 + 320 + 300 + vertical + 12 + false + + 312 + auto + center + top + + true + font24b + whiteheidi + + + Stuff from the web + 312 + 56 + Button_Heidi + + + - + 8701 + - + - + - + + + My own files + 312 + 56 + Button_Heidi + + + 8700 + 8702 + - + - + - + + + I'm not sure + 312 + 56 + Button_Heidi + + + 8701 + - + - + - + - + + + + + + Header + 63 + 56 + 320 + 200 + left + top + + Header_Heidi + true + + + 64 + 203 + 336 + left + top + + true + LargeText_Heidi + + + + + diff --git a/skin/boxee/720p/boxee_login_wizard_new_user_details.xml b/skin/boxee/720p/boxee_login_wizard_new_user_details.xml new file mode 100644 index 00000000..26454aac --- /dev/null +++ b/skin/boxee/720p/boxee_login_wizard_new_user_details.xml @@ -0,0 +1,306 @@ + + + 8801 + no + + Common_Background + BoxeeLogoLogin + + FTUDialog_Heidi + + + + + 473 + 64 + 312 + 20 + + font20b + lightgreyheidi + left + center + + + + + 474 + 90 + 312 + 56 + ToggleButton_Heidi + left + 14 + + 9003 + 8802 + - + + + Control.HasFocus(8801) + 751 + 106 + 24 + 24 + graphic-more-focused.png + + + !Control.HasFocus(8801) + 751 + 106 + 24 + 24 + graphic-more-unfocused.png + + + + 473 + 156 + 312 + 20 + + + font20b + lightgreyheidi + left + center + + + + + 474 + 182 + 312 + 56 + ToggleButton_Heidi + left + 14 + + 8801 + 8810 + + + Control.HasFocus(8802) + 751 + 198 + 24 + 24 + graphic-more-focused.png + + + !Control.HasFocus(8802) + 751 + 198 + 24 + 24 + graphic-more-unfocused.png + + + + + + 474 + 249 + 148 + 56 + ToggleButton_Heidi + left + 14 + + 8804 + 8802 + 8805 + + + Control.HasFocus(8803) + 587 + 265 + 24 + 24 + graphic-more-focused.png + + + !Control.HasFocus(8803) + 587 + 265 + 24 + 24 + graphic-more-unfocused.png + + + + + 638 + 249 + 148 + 56 + ToggleButton_Heidi + left + 14 + + 8803 + 8802 + 8805 + + + Control.HasFocus(8804) + 751 + 265 + 24 + 24 + graphic-more-focused.png + + + !Control.HasFocus(8804) + 751 + 265 + 24 + 24 + graphic-more-unfocused.png + + + + + 474 + 354 + 312 + 56 + Button_Heidi + + + 8810 + 8806 + - + - + - + + + + 474 + 422 + 312 + 56 + Button_Heidi + + + 8805 + - + - + - + - + + + + + + Gender list + 474 + 64 + 312 + 400 + vertical + 200 + + + 156 + 0 + 310 + 56 + font24b + mediumgreyheidi + center + center + + + + + + 0 + 0 + 312 + 56 + button-focused.png + + + 156 + 0 + font24b + whiteheidi + 312 + 56 + center + center + + + + + + + + 66 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 82 + 66 + 12 + 12 + graphic_steps_circle.png + + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 114 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 130 + 66 + 12 + 12 + graphic_steps_dot.png + + + + Header + 63 + 97 + 320 + 200 + left + top + + Header_Heidi + true + + + + 64 + 203 + 336 + left + top + + true + LargeText_Heidi + + + + + + diff --git a/skin/boxee/720p/boxee_login_wizard_quick_tip.xml b/skin/boxee/720p/boxee_login_wizard_quick_tip.xml new file mode 100644 index 00000000..9ff16512 --- /dev/null +++ b/skin/boxee/720p/boxee_login_wizard_quick_tip.xml @@ -0,0 +1,47 @@ + + + 250 + + Common_Background + + FTUDialog_Heidi + + + 62 + 56 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 20 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + 478 + 82 + 295 + 400 + ftu/graphic-ftu-tip-remote.png + + + + diff --git a/skin/boxee/720p/boxee_login_wizard_quick_tip_airplay.xml b/skin/boxee/720p/boxee_login_wizard_quick_tip_airplay.xml new file mode 100644 index 00000000..b2c4eeb5 --- /dev/null +++ b/skin/boxee/720p/boxee_login_wizard_quick_tip_airplay.xml @@ -0,0 +1,59 @@ + + + 1 + + Common_Background + + FTUDialog_Heidi + + + 518 + 92 + 215 + 210 + ftu/graphic-ftu-tip-airplay.png + scale + + + Next + 474 + 422 + 312 + 56 + Button_Heidi + + + + + + 62 + 56 + 330 + 412 + vertical + 0 + true + + 330 + auto + left + top + + Header_Heidi + true + + + 10 + 330 + auto + left + top + + true + LargeText_Heidi + + + + + + diff --git a/skin/boxee/720p/boxee_login_wizard_tou.xml b/skin/boxee/720p/boxee_login_wizard_tou.xml new file mode 100644 index 00000000..828dfc29 --- /dev/null +++ b/skin/boxee/720p/boxee_login_wizard_tou.xml @@ -0,0 +1,186 @@ + + + 1 + no + + + info + 0 + 0 + 0 + 0 + false + + + + + + Common_Background + BoxeeLogoLogin + + FTUDialog_Heidi + + + + 474 + 162 + 312 + 56 + Button_Heidi + + + 9003 + 8702 + - + - + Control.SetFocus(8801) + + + + 474 + 230 + 312 + 56 + Button_Heidi + + + 8701 + 1 + - + - + Control.SetFocus(8901) + + + + 474 + 422 + 312 + 56 + Button_Heidi + + + 8702 + - + - + - + - + + + + + + 474 + 66 + 312 + 411 + text-field-no-stroke.png + FFEEEEEE + + + title + 485 + 80 + 271 + 15 + 14b + FF000000 + + + + 485 + 107 + 271 + 358 + font12 + FF000000 + left + top + black + true + 8801 + + + + 767 + 77 + 10 + 390 + true + graphic-scrollbar-bg.png + graphic-scrollbar-slider.png + graphic-scrollbar-slider.png + vertical + false + - + - + - + - + + + + + + + 66 + 66 + 12 + 12 + graphic_steps_dot.png + + + 82 + 66 + 12 + 12 + graphic_steps_dot.png + + + 98 + 66 + 12 + 12 + graphic_steps_circle.png + + + 114 + 66 + 12 + 12 + graphic_steps_dot.png + + + 130 + 66 + 12 + 12 + graphic_steps_dot.png + + + + Header + 63 + 97 + 320 + 200 + left + top + + Header_Heidi + true + + + + 64 + 203 + 336 + left + top + + true + LargeText_Heidi + + + + + + diff --git a/skin/boxee/720p/boxee_make_social.xml b/skin/boxee/720p/boxee_make_social.xml new file mode 100644 index 00000000..45de1c8b --- /dev/null +++ b/skin/boxee/720p/boxee_make_social.xml @@ -0,0 +1,110 @@ + + + + + background image overlay + + + + + + + 0 + 0 + 1280 + 720 + black.png + 88FFFFFF + + + boxee.HasInternetConnection + Dialog_Heidi + + + FacebookConnect_Heidi + 474 + 66 + - + - + 251 + + + TwitterConnect_Heidi + 474 + 136 + - + 250 + 252 + + + TumblrConnect_Heidi + 474 + 204 + - + 251 + 7092 + + + Done + 474 + 422 + 312 + 56 + Button_Heidi + + - + 252 + - + + + + + 62 + 56 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + !boxee.HasInternetConnection + true + !Window.Property(loading) + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + 421 + EmptyStateButton + + + + + \ No newline at end of file diff --git a/skin/boxee/720p/boxee_manual_resolve_album.xml b/skin/boxee/720p/boxee_manual_resolve_album.xml new file mode 100644 index 00000000..c811d301 --- /dev/null +++ b/skin/boxee/720p/boxee_manual_resolve_album.xml @@ -0,0 +1,155 @@ + + + 9010 + no + + + + info + 0 + 0 + 0 + 0 + false + + + + + + Dialog_Popup_Background + Window_Fade_Animation + + 30 + 152 + Conditional + + false + file path label + 36 + 78 + 1150 + 24 + + center + font24 + white + true + + + 26 + 26 + 302 + 350 + $INFO[container(5000).ListItem.Thumb] + keep + masks/thumb_background.png + 12 + + + 344 + 36 + 840 + 430 + 10 + vertical + false + + 840 + 32 + font32b + left + center + + white + + + !IsEmpty(container(5000).ListItem.Year) + 0 + 0 + 840 + 22 + font20b + left + center + white + + + + !IsEmpty(container(5000).ListItem.albumartist) + 0 + 0 + 840 + 22 + font20b + left + center + white + + + + !IsEmpty(container(5000).ListItem.Genre) + 0 + 0 + 840 + 22 + font20b + left + center + white + + + + !IsEmpty(container(5000).ListItem.Comment) + 840 + 200 + font22 + left + top + white + + true + + + + 36 + 378 + 140 + 56 + center + center + grey + white + - + button_action_menu_source_on.png + button_action_menu_source_click.png + font22b + + - + - + - + 9020 + - + + + 176 + 378 + 140 + 56 + center + center + grey + white + - + button_action_menu_source_on.png + button_action_menu_source_click.png + font22b + + - + - + 9010 + 9030 + - + + + + diff --git a/skin/boxee/720p/boxee_manual_resolve_audio.xml b/skin/boxee/720p/boxee_manual_resolve_audio.xml new file mode 100644 index 00000000..4fa2a1d0 --- /dev/null +++ b/skin/boxee/720p/boxee_manual_resolve_audio.xml @@ -0,0 +1,168 @@ + + + 5010 + no + + + + info + 0 + 0 + 0 + 0 + false + + + + + + Dialog_Popup_Background + + Dialog_Popup_Close_Animation + + 30 + 152 + 1220 + 460 + menu_dialog_background.png + FF212121 + + + !Window.IsVisible(boxee_manual_resolve_album.xml) + 30 + 152 + Conditional + + 36 + 36 + 840 + 32 + font32b + left + center + + white + + + file path label + 36 + 78 + 1150 + 24 + + center + font20b + white + true + + + 36 + 112 + 978 + 40 + font24b + white + white + left + center + 14 + search_text_box.png + search_text_box_focus.png + search_text_box_click.png + - + 5020 + - + 5030 + + + + + 1024 + 104 + 160 + 56 + center + center + grey + white + - + button_action_menu_source_on.png + button_action_menu_source_click.png + font22b + + - + 5025 + 5010 + - + - + + + true + suggestion list of album names + 20 + 156 + 1000 + 275 + - + 5020 + 5010 + - + 200 + 60 + vertical + 6 + 5 + + + 36 + 0 + 1000 + 40 + font22 + left + center + + grey + + + + + Control.HasFocus(5030) + 0 + -19 + 1010 + 78 + line_view_on.png + + + !Control.HasFocus(5030) + 36 + 0 + 1000 + 40 + font22 + left + center + + grey + true + + + Control.HasFocus(5030) + 36 + 0 + 1000 + 40 + font22b + left + center + + white + true + + + + + + + diff --git a/skin/boxee/720p/boxee_osd_audio_settings.xml b/skin/boxee/720p/boxee_osd_audio_settings.xml new file mode 100644 index 00000000..c1ef92c9 --- /dev/null +++ b/skin/boxee/720p/boxee_osd_audio_settings.xml @@ -0,0 +1,233 @@ + + + 30 + no + + + + + + + + + + 166 + 126 + + 0 + 0 + 948 + 412 + background/window-bg-transparent.png + + + + Control.HasFocus(30) + 132 + 30 + 232 + 20 + center + top + font24b + whiteheidi + + + + !Control.HasFocus(30) + 132 + 30 + 232 + 20 + center + top + font24b + mediumgreyheidi + + + + 42 + 70 + 408 + 280 + vertical + - + - + 31 + - + + + ListItem.Property(IsSelected) + 15 + 16 + 24 + 24 + universal/graphic-radio-dot.png + + + 54 + 0 + 339 + 56 + left + center + font24 + mediumgreyheidi + + + + + + Control.HasFocus(30) + 0 + 0 + 408 + 56 + button-focused.png + + + ListItem.Property(IsSelected) + 15 + 16 + 24 + 24 + universal/graphic-radio-dot.png + + + Control.HasFocus(30) + 54 + 0 + 339 + 56 + left + center + font24 + whiteheidi + true + + + + !Control.HasFocus(30) + 54 + 0 + 339 + 56 + left + center + font24 + mediumgreyheidi + + + + + + 444 + 18 + 60 + 376 + graphic_divider_vert.png + + + + Control.HasFocus(31) + 588 + 30 + 232 + 20 + center + top + font24b + whiteheidi + + + + !Control.HasFocus(31) + 588 + 30 + 232 + 20 + center + top + font24b + mediumgreyheidi + + + + 498 + 70 + 408 + 280 + vertical + 30 + - + - + - + + + ListItem.Property(IsSelected) + 15 + 16 + 24 + 24 + universal/graphic-radio-dot.png + + + 54 + 0 + 339 + 56 + left + center + font24 + mediumgreyheidi + + + + + + Control.HasFocus(31) + 0 + 0 + 408 + 56 + button-focused.png + + + ListItem.Property(IsSelected) + 15 + 16 + 24 + 24 + universal/graphic-radio-dot.png + + + Control.HasFocus(31) + 54 + 0 + 339 + 56 + left + center + font24 + whiteheidi + true + + + + !Control.HasFocus(31) + 54 + 0 + 339 + 56 + left + center + font24 + mediumgreyheidi + + + + + + + + \ No newline at end of file diff --git a/skin/boxee/720p/boxee_osd_browse_local_subtitles_settings.xml b/skin/boxee/720p/boxee_osd_browse_local_subtitles_settings.xml new file mode 100644 index 00000000..81c32053 --- /dev/null +++ b/skin/boxee/720p/boxee_osd_browse_local_subtitles_settings.xml @@ -0,0 +1,89 @@ + + + 50 + no + + + + + + + + + + 166 + 126 + + 0 + 0 + 948 + 412 + background/window-bg-transparent.png + + + + 68 + 30 + 844 + 20 + center + top + font24b + whiteheidi + + + + 68 + 60 + 844 + 20 + center + top + font24 + boxeegreenheidi + + + 32 + 104 + 882 + 300 + vertical + + + 440 + 0 + 854 + 56 + center + center + font24 + + mediumgreyheidi + + + + + 0 + 0 + 882 + 56 + button-focused.png + + + 440 + 0 + 854 + 56 + center + center + font24 + + whiteheidi + true + + + + + + + diff --git a/skin/boxee/720p/boxee_ota_connection_configuration.xml b/skin/boxee/720p/boxee_ota_connection_configuration.xml new file mode 100644 index 00000000..51748dd1 --- /dev/null +++ b/skin/boxee/720p/boxee_ota_connection_configuration.xml @@ -0,0 +1,101 @@ + + + 1 + no + + + DialogNoAnim_Heidi + + + + 0 + 0 + 852 + 544 + dialog_bg.png + 80FFFFFF + + + + 66 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 82 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 98 + 66 + 12 + 12 + graphic_steps_circle.png + + + + 114 + 66 + 12 + 12 + graphic_steps_dot.png + + + + Header + 63 + 125 + 400 + left + center + + Header_Heidi + + + + 64 + 153 + 306 + left + top + + true + LargeText_Heidi + + + + + Live TV - Step 2 + 474 + 210 + 312 + 56 + Button_Heidi + + + 2 + 2 + + + + Live TV - Step 2 + 474 + 278 + 312 + 56 + Button_Heidi + + + 1 + 1 + + + + diff --git a/skin/boxee/720p/boxee_ota_countries_configuration.xml b/skin/boxee/720p/boxee_ota_countries_configuration.xml new file mode 100644 index 00000000..3f37f24b --- /dev/null +++ b/skin/boxee/720p/boxee_ota_countries_configuration.xml @@ -0,0 +1,160 @@ + + + 80 + no + + + + + DialogNoAnim_Heidi + + + + 0 + 0 + 852 + 544 + dialog_bg.png + + + + 66 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 82 + 66 + 12 + 12 + graphic_steps_circle.png + + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 114 + 66 + 12 + 12 + graphic_steps_dot.png + + + + Header + 63 + 125 + 400 + left + center + + Header_Heidi + + + + 64 + 153 + 310 + left + top + + true + LargeText_Heidi + + + + + 463 + 59 + 336 + center + top + + true + font24b + FFEFEFEF + + + + 618 + 117 + 24 + 16 + graphic-arrow.png + + + + 474 + 149 + 800 + 300 + true + vertical + 200 + + + + + 158 + 300 + 48 + center + center + font22 + FFB3B8BB + + + + + + + + + 0 + 2 + 312 + 48 + button-focused.png + + + + 158 + 300 + 48 + center + center + font22 + white + + + + + + + + 618 + 456 + 24 + 16 + graphic-arrow.png + + + + + + \ No newline at end of file diff --git a/skin/boxee/720p/boxee_ota_facebook_connect.xml b/skin/boxee/720p/boxee_ota_facebook_connect.xml new file mode 100644 index 00000000..0ee4c4e9 --- /dev/null +++ b/skin/boxee/720p/boxee_ota_facebook_connect.xml @@ -0,0 +1,101 @@ + + + 1 + no + + + DialogNoAnim_Heidi + + + + 66 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 82 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 114 + 66 + 12 + 12 + graphic_steps_circle.png + + + + Header + 63 + 125 + 305 + left + center + + true + Header_Heidi + + + + 64 + 169 + 306 + left + top + + true + LargeText_Heidi + + + + + + 2 + - + 474 + 210 + FacebookConnect_Heidi + + + + false + 2 + - + 474 + 210 + Button_Heidi + + 312 + 56 + + + + + 474 + 278 + 312 + 56 + Button_Heidi + + - + 50 + - + + + + diff --git a/skin/boxee/720p/boxee_ota_location_confirmation.xml b/skin/boxee/720p/boxee_ota_location_confirmation.xml new file mode 100644 index 00000000..57fc1cc3 --- /dev/null +++ b/skin/boxee/720p/boxee_ota_location_confirmation.xml @@ -0,0 +1,119 @@ + + + 1 + no + + + + DialogNoAnim_Heidi + + + + 66 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 82 + 66 + 12 + 12 + graphic_steps_circle.png + + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 114 + 66 + 12 + 12 + graphic_steps_dot.png + + + + Header + 63 + 125 + 400 + left + center + + Header_Heidi + + + + 64 + 153 + 310 + left + top + + true + LargeText_Heidi + + + + + 462 + 153 + 336 + center + top + + true + LargeText_Heidi + + + + 467 + 182 + 336 + center + top + font24b + FF8CC544 + + true + font24 + + + + YES + 474 + 354 + 312 + 56 + Button_Heidi + + - + 3 + 3 + + + + NO + 474 + 422 + 312 + 56 + Button_Heidi + + + 1 + 1 + + + + + + diff --git a/skin/boxee/720p/boxee_ota_welcome_configuration.xml b/skin/boxee/720p/boxee_ota_welcome_configuration.xml new file mode 100644 index 00000000..606c178c --- /dev/null +++ b/skin/boxee/720p/boxee_ota_welcome_configuration.xml @@ -0,0 +1,97 @@ + + + 1 + no + + + + DialogNoAnim_Heidi + + + + 66 + 66 + 12 + 12 + graphic_steps_circle.png + + + + 82 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 114 + 66 + 12 + 12 + graphic_steps_dot.png + + + + Header + 63 + 125 + 400 + left + center + + Header_Heidi + + + + 64 + 173 + 336 + left + top + + true + LargeText_Heidi + + + + + 515 + 99 + 220 + 240 + livetv/graphic_dongle_antenna.png + + + + Live TV - Step 2 + 474 + 365 + 312 + 56 + Button_Heidi + + + + + Live TV - Step 2 + 474 + 435 + 312 + 56 + Button_Heidi + + + + + + + diff --git a/skin/boxee/720p/boxee_ota_zipcode_configuration.xml b/skin/boxee/720p/boxee_ota_zipcode_configuration.xml new file mode 100644 index 00000000..3a235efd --- /dev/null +++ b/skin/boxee/720p/boxee_ota_zipcode_configuration.xml @@ -0,0 +1,120 @@ + + + 15001 + no + + + DialogNoAnim_Heidi + + + + 66 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 82 + 66 + 12 + 12 + graphic_steps_circle.png + + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 114 + 66 + 12 + 12 + graphic_steps_dot.png + + + + Header + 63 + 125 + 400 + left + center + + Header_Heidi + + + + 64 + 153 + 310 + left + top + + true + LargeText_Heidi + + + + + 462 + 155 + 336 + center + top + + true + font24b + FFB3B8BB + + + + ZIP CODE + 474 + 198 + 312 + 56 + Edit_Heidi + ZIP Code + FF000000 + center + 2 + 2 + + + + false + true + 462 + 263 + 336 + center + top + + true + font24b + FF8CC544 + + + + 474 + 422 + 312 + 56 + Button_Heidi + + XBMC.ActivateWindow(ota.country.configure) + 15001 + 15001 + + + + + + diff --git a/skin/boxee/720p/boxee_pair.xml b/skin/boxee/720p/boxee_pair.xml new file mode 100644 index 00000000..27d4aae3 --- /dev/null +++ b/skin/boxee/720p/boxee_pair.xml @@ -0,0 +1,99 @@ + + + 10 + + Dialog_Popup_Background + + Dialog_Popup_Animation + 340 + 210 + 600 + 300 + + 0 + 0 + 600 + 300 + browse_menu_dialog_background.png + FF212121 + + + heading label + 32 + 24 + 536 + 28 + font28b + center + center + + white + + + 211 + 76 + 178 + 51 + + 0 + 0 + 40 + 51 + $INFO[Window.Property(pair-digit-0)] + + + 46 + 0 + 40 + 51 + $INFO[Window.Property(pair-digit-1)] + + + 92 + 0 + 40 + 51 + $INFO[Window.Property(pair-digit-2)] + + + 138 + 0 + 40 + 51 + $INFO[Window.Property(pair-digit-3)] + + + + 24 + 140 + 550 + 78 + + center + font26 + white + true + + + 228 + 230 + 144 + 43 + center + center + white + black + button_8_pixel.png + button_8_pixel.png + button_8_pixel.png + font28b + + - + - + - + - + - + + + + diff --git a/skin/boxee/720p/boxee_payment_ok_play.xml b/skin/boxee/720p/boxee_payment_ok_play.xml new file mode 100644 index 00000000..7fa275d7 --- /dev/null +++ b/skin/boxee/720p/boxee_payment_ok_play.xml @@ -0,0 +1,47 @@ + + + 240 + no + + + 160 + 162 + PaymentDialogBG + + 385 + 120 + 600 + 80 + font28b + left + center + + white + + + + + 360 + 200 + 280 + 80 + - + - + - + - + font28b + center + center + + white + black + 35 + - + button_action_menu_source_on.png + button_action_menu_source.png + + + + + + diff --git a/skin/boxee/720p/boxee_payment_products.xml b/skin/boxee/720p/boxee_payment_products.xml new file mode 100644 index 00000000..f89f56fe --- /dev/null +++ b/skin/boxee/720p/boxee_payment_products.xml @@ -0,0 +1,260 @@ + + + 240 + no + + + + info + 0 + 0 + 0 + 0 + false + + + + + + + 160 + 162 + PaymentDialogBG + + !IsEmpty(container(5000).ListItem.Property(link-providerthumb)) + 30 + 0 + 128 + 128 + $INFO[container(5000).ListItem.Property(link-providerthumb)] + + + 30 + 100 + 600 + 80 + font24b + left + center + + white + + + 30 + 180 + 740 + 200 + - + 6150 + - + - + - + 200 + vertical + + + 0 + 0 + 740 + 100 + button_action_menu_source.png + + + + 20 + 22 + 410 + 25 + font22b + left + center + + white + + + !IsEmpty(ListItem.Property(currency_symbol)) + 720 + 22 + 340 + 55 + font32b + right + center + + white + + + IsEmpty(ListItem.Property(currency_symbol)) + 720 + 22 + 340 + 55 + font32b + right + center + + white + + + 20 + 52 + 410 + 25 + font18 + left + center + + white + + + + + + !Control.HasFocus(6110) + 0 + 0 + 740 + 100 + button_action_menu_source.png + + + Control.HasFocus(6110) + 0 + 0 + 740 + 100 + button_action_menu_source_on.png + + + + 20 + 22 + 410 + 25 + font22b + left + center + + white + + + !IsEmpty(ListItem.Property(currency_symbol)) + 720 + 22 + 340 + 55 + font32b + right + center + + white + + + IsEmpty(ListItem.Property(currency_symbol)) + 720 + 22 + 340 + 55 + font32b + right + center + + white + + + 20 + 52 + 410 + 25 + font18 + left + center + + white + + + + + + 770 + 180 + 180 + 200 + 6110 + - + - + - + 65 + 200 + vertical + + + 0 + 0 + 185 + 100 + button_action_menu_source.png + + + + 90 + 38 + 410 + 25 + font28b + center + center + + white + + + + + + !Control.HasFocus(6150) + 0 + 0 + 185 + 100 + button_action_menu_source.png + + + Control.HasFocus(6150) + 0 + 0 + 185 + 100 + button_action_menu_source_on.png + + + + 90 + 38 + 410 + 25 + font28b + center + center + + white + + + + + + scroll bar indicator for lists + 950 + 184 + 28 + 190 + scrollbar_bg.png + scrollbar_slider.png + scrollbar_slider.png + - + - + vertical + false + + + + diff --git a/skin/boxee/720p/boxee_payment_tou.xml b/skin/boxee/720p/boxee_payment_tou.xml new file mode 100644 index 00000000..12baefa8 --- /dev/null +++ b/skin/boxee/720p/boxee_payment_tou.xml @@ -0,0 +1,153 @@ + + + 240 + no + + + + info + 0 + 0 + 0 + 0 + false + + + + + + + 160 + 162 + PaymentDialogBG + + 30 + 10 + 600 + 80 + font28b + left + center + + white + + + 30 + 60 + 650 + 120 + font24b + left + center + + white + + + 30 + 180 + 745 + 85 + white.png + + + 35 + 180 + 600 + 80 + font22 + left + top + black + + true + 6221 + + + 750 + 180 + 28 + 90 + scrollbar_bg.png + scrollbar_vertical_nib.png + scrollbar_vertical_nib_on.png + - + - + vertical + false + 6222 + + + 30 + 270 + 375 + 40 + 6221 + 6230 + - + - + - + font20b + center + white + white + disabled + 40 + - + button_option_menu_on.png + icons/icon_checkbox_full.png + icons/icon_checkbox_empty.png + false + 10 + 10 + 20 + 20 + + + + + + 20 + 310 + 250 + 110 + - + 6232 + 6222 + - + font28b + center + center + + white + black + 35 + - + button_action_menu_source_on.png + button_action_menu_source.png + + + + 300 + 310 + 250 + 110 + 6231 + - + 6221 + - + font28b + center + center + + white + black + 35 + - + button_action_menu_source_on.png + button_action_menu_source.png + + + + + + diff --git a/skin/boxee/720p/boxee_payment_userdata.xml b/skin/boxee/720p/boxee_payment_userdata.xml new file mode 100644 index 00000000..a04c64a2 --- /dev/null +++ b/skin/boxee/720p/boxee_payment_userdata.xml @@ -0,0 +1,94 @@ + + + 240 + no + + + 160 + 162 + PaymentDialogBG + + 30 + 10 + 600 + 80 + font28b + left + center + + white + + + Password + 30 + 90 + 570 + 40 + font24b + left + center + white + darkgrey + 14 + search_text_box.png + search_text_box_on.png + search_text_box_click.png + true + - + - + - + 6230 + + + + + + 20 + 310 + 250 + 110 + - + - + 6320 + - + font28b + center + center + + white + black + 35 + - + button_action_menu_source_on.png + button_action_menu_source.png + + + + + diff --git a/skin/boxee/720p/boxee_payment_wait_for_server_approval.xml b/skin/boxee/720p/boxee_payment_wait_for_server_approval.xml new file mode 100644 index 00000000..0be739a6 --- /dev/null +++ b/skin/boxee/720p/boxee_payment_wait_for_server_approval.xml @@ -0,0 +1,84 @@ + + + 240 + no + + + + info + 0 + 0 + 0 + 0 + false + + + + + + + 160 + 162 + PaymentDialogBG + + 30 + 10 + 600 + 80 + font28b + left + center + + white + + + 30 + 15 + 850 + 220 + font24b + left + center + + white + true + + + conditional + 30 + 160 + 650 + 120 + font24b + left + center + + yellow + + + + + 20 + 310 + 280 + 110 + - + - + - + - + font28b + center + center + + white + black + 35 + - + button_action_menu_source_on.png + button_action_menu_source.png + + + + + + diff --git a/skin/boxee/720p/boxee_search_results.xml b/skin/boxee/720p/boxee_search_results.xml new file mode 100644 index 00000000..9194d5ad --- /dev/null +++ b/skin/boxee/720p/boxee_search_results.xml @@ -0,0 +1,7 @@ + + + 9050 + no + + + diff --git a/skin/boxee/720p/boxee_seek_bar.xml b/skin/boxee/720p/boxee_seek_bar.xml new file mode 100644 index 00000000..2e30dcd2 --- /dev/null +++ b/skin/boxee/720p/boxee_seek_bar.xml @@ -0,0 +1,29 @@ + + + 8100 + no + + 0 + 0 + + !Window.IsVisible(boxee_video_context.xml) + BottomGradient + OSD_Progress + + + 667 + 22 + 17 + seeker_arrow.png + + + 678 + 198 + 35 + progress/progress-bar-seeker.png + center + black + Dialog.Close(10366) + + + diff --git a/skin/boxee/720p/boxee_selection_list.xml b/skin/boxee/720p/boxee_selection_list.xml new file mode 100644 index 00000000..b3d85c08 --- /dev/null +++ b/skin/boxee/720p/boxee_selection_list.xml @@ -0,0 +1,101 @@ +ïŧŋ + + no + + + + true + 530 + 245 + + dialog background + 0 + 0 + 400 + 258 + menu_dialog_background.png + FF212121 + + + 0 + 10 + 400 + 22 + font22 + left + center + grey + + + 0 + 30 + 400 + 258 + - + 3 + - + 60 + 200 + 10 + + + 0 + 14 + 400 + 72 + FF464646 + action_menu_button.png + + + 14 + 14 + 276 + 72 + font32b + left + center + ListItem.Label + grey + + + ListItem.Property(is-hd) + 324 + 22 + 56 + 56 + icons/boxee-icon-HD.png + + + + + 0 + 14 + 400 + 72 + FF10B9F2 + action_menu_button.png + + + 14 + 14 + 276 + 72 + font32b + left + center + ListItem.Label + black + + + ListItem.Property(is-hd) + 324 + 22 + 56 + 56 + icons/boxee-icon-HD.png + + + + + + diff --git a/skin/boxee/720p/boxee_settings_devices.xml b/skin/boxee/720p/boxee_settings_devices.xml new file mode 100644 index 00000000..ae3b5747 --- /dev/null +++ b/skin/boxee/720p/boxee_settings_devices.xml @@ -0,0 +1,178 @@ +ïŧŋ + + 51 + no + + Common_Settings_Background + + + BoxeeLogo + + PageTitleProperties + + + + PageSubtitleProperties + + + + + 26 + 139 + 340 + 54 + + font30 + 10 + left + center + black + black + button_8_pixel.png + button_8_pixel.png + + + control.IsEmpty(56) + + 426 + 159 + 700 + 32 + font32 + left + center + + white + + + + !control.IsEmpty(56) + 392 + 140 + 1220 + 660 + + + 0 + 0 + 950 + 480 + - + - + - + - + 60 + 200 + vertical + 4 + + + 650 + BrowseLongLineUnfocus + + + !IsEmpty(ListItem.Property(deviceicon)) + BrowseLineSmallIconPropertiesUnfocus + icons/icon_$INFO[ListItem.Property(deviceicon)].png + + + 56 + 420 + BrowseLongLineLabelProperties + + white + white + + + 710 + 0 + 360 + 52 + font30 + left + center + white + white + + + + + + !Control.HasFocus(56) + + 950 + BrowseLongLineUnfocus + + + !IsEmpty(ListItem.Property(deviceicon)) + BrowseLineSmallIconPropertiesUnfocus + icons/icon_$INFO[ListItem.Property(deviceicon)].png + + + 56 + 420 + BrowseLongLineLabelProperties + + white + white + + + 710 + 0 + 360 + 52 + font30 + left + center + white + white + + + + + Control.HasFocus(56) + + 850 + BrowseLongLineFocus + + + !IsEmpty(ListItem.Property(deviceicon)) + BrowseLineSmallIconPropertiesFocus + icons/icon_$INFO[ListItem.Property(deviceicon)].png + black + + + 56 + 420 + BrowseLongLineLabelProperties + + black + black + + + 710 + 0 + 360 + 52 + font30 + left + center + black + + + + + + + Control.IsVisible(56) + 888 + 2 + 12 + 560 + ScrollBarCommonProperties + + + + + + diff --git a/skin/boxee/720p/boxee_sort_dropdown.xml b/skin/boxee/720p/boxee_sort_dropdown.xml new file mode 100644 index 00000000..5e1d93c8 --- /dev/null +++ b/skin/boxee/720p/boxee_sort_dropdown.xml @@ -0,0 +1,87 @@ + + + 500 + no + + 0 + 0 + + 862 + 32 + 222 + 275 + button-on.png + + + 1000 + 948 + 32 + 0 + true + + 60 + 0 + 320 + 270 + - + - + 200 + - + vertical + + + 106 + 2 + 172 + 44 + font20b + left + center + + lightgreyheidi + + + + + 92 + 0 + 200 + 48 + button-focused.png + + + 106 + 2 + 172 + 44 + font20b + left + center + + whiteheidi + + + + + + ViewButton2 + actionbuttons/button-action-sort-active.png + Dialog.Close(10147) + + + 84 + 12 + + 0 + 36 + 260 + 44 + font20b + left + center + + whiteheidi + + + + diff --git a/skin/boxee/720p/boxee_video_resume.xml b/skin/boxee/720p/boxee_video_resume.xml new file mode 100644 index 00000000..4d9db209 --- /dev/null +++ b/skin/boxee/720p/boxee_video_resume.xml @@ -0,0 +1,65 @@ + + + 11 + no + + + Dialog_Popup_Background + + Dialog_Popup_Animation + 382 + 250 + + 0 + 0 + 516 + 220 + dialog_bg.png + + + 48 + 48 + 420 + 276 + - + - + - + 60 + 200 + + + 210 + -1 + 420 + 56 + font24b + mediumgreyheidi + center + center + + + + + + 0 + 0 + 420 + 56 + button-focused.png + + + 210 + -1 + 420 + 56 + font24b + whiteheidi + center + center + + + + + + + diff --git a/skin/boxee/720p/boxee_watch_later_get_started.xml b/skin/boxee/720p/boxee_watch_later_get_started.xml new file mode 100644 index 00000000..10264df0 --- /dev/null +++ b/skin/boxee/720p/boxee_watch_later_get_started.xml @@ -0,0 +1,105 @@ + + + + + background image overlay + + + + + + + 0 + 0 + 1280 + 720 + black.png + 88FFFFFF + + + boxee.HasInternetConnection + Dialog_Heidi + + + 452 + 40 + 340 + 348 + browse/graphic-watch-later-screenshot.png + + + Get Started + 474 + 422 + 312 + 56 + Button_Heidi + + + 250 + - + + + + + 52 + 56 + 330 + 436 + vertical + 0 + true + + 330 + auto + left + top + + Header_Heidi + true + + + 10 + 330 + auto + left + top + + true + LargeText_Heidi + + + 10 + 330 + auto + left + top + + true + font20b + lightgreyheidi + + + + + case of offline mode + !Window.IsActive(boxee_search.xml) + !boxee.HasInternetConnection + Popup_Heidi + + Popup_Title + + + + 111 + EmptyStateTextProperties + + + + 421 + EmptyStateButton + + + + + diff --git a/skin/boxee/720p/browse_menu_tree.xml b/skin/boxee/720p/browse_menu_tree.xml new file mode 100644 index 00000000..b5ec69a2 --- /dev/null +++ b/skin/boxee/720p/browse_menu_tree.xml @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + boxee://movies/genres + + + boxee://movies/local/genres + + + boxee://movies/local/sources + + + boxee://movies/providers + + + boxee://movies/trailers + + + + + + + + + + + + + + + + + + + + boxee://shows/genres + + + boxee://shows/local/genres + + + boxee://shows/providers + + + + + + + + + + + + + + + + + + boxee://apps/categories + + + + + + + + + + + + + + + diff --git a/skin/boxee/720p/custom_FTU_CheckOverscan.xml b/skin/boxee/720p/custom_FTU_CheckOverscan.xml new file mode 100644 index 00000000..937c868a --- /dev/null +++ b/skin/boxee/720p/custom_FTU_CheckOverscan.xml @@ -0,0 +1,109 @@ + + + 250 + + Common_Background + + OnDialogOpen_ShowItem + 0 + 0 + 1280 + 720 + ftu/graphic-screen-calibration-frame.png + + + FTUDialogNoAnim_Heidi + + + 506 + 98 + 248 + 184 + ftu/graphic-calibrate-tv.png + + + 530 + 124 + 200 + 120 + ftu/graphic-calibrate-tv-frame.png + + + YES + 474 + 354 + 312 + 56 + Button_Heidi + + - + - + 251 + + + NO + 474 + 422 + 312 + 56 + Button_Heidi + + + 250 + - + + + + + 66 + 66 + 12 + 12 + graphic_steps_circle.png + + + 82 + 66 + 12 + 12 + graphic_steps_dot.png + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + 62 + 97 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + + \ No newline at end of file diff --git a/skin/boxee/720p/custom_FTU_ChooseConnection.xml b/skin/boxee/720p/custom_FTU_ChooseConnection.xml new file mode 100644 index 00000000..72638c8f --- /dev/null +++ b/skin/boxee/720p/custom_FTU_ChooseConnection.xml @@ -0,0 +1,129 @@ + + + 250 + + Common_Background + + FTUDialogNoAnim_Heidi + + + Control.HasFocus(250) + 550 + 106 + 160 + 80 + ftu/graphic-ftu-ethernet.png + + + Control.HasFocus(250) + 474 + 234 + 312 + 108 + center + top + font24bls + whiteheidi + + true + + + Control.HasFocus(251) + 550 + 106 + 160 + 80 + ftu/graphic-ftu-wifi.png + + + Control.HasFocus(251) + 474 + 234 + 312 + 108 + center + top + font24bls + whiteheidi + + true + + + Wired + 474 + 354 + 312 + 56 + Button_Heidi + + - + - + 251 + + + Wireless + 474 + 422 + 312 + 56 + Button_Heidi + + + 250 + - + + + + + 66 + 66 + 12 + 12 + graphic_steps_dot.png + + + 82 + 66 + 12 + 12 + graphic_steps_circle.png + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + 62 + 97 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + + \ No newline at end of file diff --git a/skin/boxee/720p/custom_FTU_ChooseResolution.xml b/skin/boxee/720p/custom_FTU_ChooseResolution.xml new file mode 100644 index 00000000..e97708aa --- /dev/null +++ b/skin/boxee/720p/custom_FTU_ChooseResolution.xml @@ -0,0 +1,127 @@ + + + 30 + + Common_Background + + FTUDialogNoAnim_Heidi + + + 474 + 56 + 312 + center + top + + true + font24b + whiteheidi + + + 474 + 106 + 312 + 372 + 200 + vertical + + + 156 + -1 + 312 + 48 + center + center + font20 + mediumgreyheidi + + + + + + 312 + 48 + button-focused.png + + + 156 + -1 + 312 + 48 + center + center + font20 + whiteheidi + + + + + + + - + + + + - + + + + - + + + + + + + 66 + 66 + 12 + 12 + graphic_steps_circle.png + + + 82 + 66 + 12 + 12 + graphic_steps_dot.png + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + 62 + 97 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + + \ No newline at end of file diff --git a/skin/boxee/720p/custom_Login_AddUser.xml b/skin/boxee/720p/custom_Login_AddUser.xml new file mode 100644 index 00000000..a1feb1d3 --- /dev/null +++ b/skin/boxee/720p/custom_Login_AddUser.xml @@ -0,0 +1,105 @@ + + + 8051 + no + + Common_Background + BoxeeLogo + + Popup_Heidi + + 65 + 70 + 408 + 24 + + Header_Heidi + left + center + + + 65 + 105 + 408 + 220 + + font24 + left + top + lightgreyheidi + true + + + 66 + 354 + 415 + 56 + Button_Heidi + + + 9003 + 8052 + - + - + - + + + 66 + 422 + 415 + 56 + Button_Heidi + + + 8051 + - + - + - + - + + + + 1032 + 32 + + OnDialogOpen_HideItem + 0 + 0 + 64 + 64 + actionbuttons/button-action-plus-focused.png + actionbuttons/button-action-plus-unfocused.png + - + - + 7000 + 7000 + 9003 + + + 76 + 0 + 64 + 64 + actionbuttons/button-action-wifi-focused.png + actionbuttons/button-action-wifi-unfocused.png + ActivateWindow(NetworkSettings) + - + 7000 + 9004 + + + 152 + 0 + 64 + 64 + actionbuttons/button-action-shutdown-focused.png + actionbuttons/button-action-shutdown-unfocused.png + XBMC.ShutDown() + - + 7000 + 9003 + - + + + + diff --git a/skin/boxee/720p/custom_Login_ExistingUserLogin.xml b/skin/boxee/720p/custom_Login_ExistingUserLogin.xml new file mode 100644 index 00000000..845023f5 --- /dev/null +++ b/skin/boxee/720p/custom_Login_ExistingUserLogin.xml @@ -0,0 +1,170 @@ + + + 8605 + no + + Common_Background + + BoxeeLogo + + Dialog_Heidi + + + Username + 474 + 66 + 312 + 56 + Edit_Heidi + left + 14 + $LOCALIZE[1014] + lightgreyheidi + - + - + 9003 + - + 8602 + 8602 + + + Password + 474 + 134 + 312 + 56 + Edit_Heidi + left + 14 + $LOCALIZE[15052] + lightgreyheidi + true + - + - + 8605 + 8605 + 8603 + 8603 + + + 474 + 202 + 312 + 48 + - + - + 8602 + 8602 + 8607 + 8607 + + + RadioButton_Heidi + + + 474 + 262 + 312 + 48 + - + - + 8603 + 8603 + 8604 + 8604 + + + RadioButton_Heidi + + + 474 + 422 + 312 + 56 + Button_Heidi + + + 8607 + 8606 + - + - + - + + + + + 63 + 57 + 400 + 320 + left + top + Header_Heidi + + true + + + + + + 1032 + 32 + + 76 + 0 + 64 + 64 + actionbuttons/button-action-wifi-focused.png + actionbuttons/button-action-wifi-unfocused.png + ActivateWindow(NetworkSettings) + - + 7000 + 9004 + + + 152 + 0 + 64 + 64 + actionbuttons/button-action-shutdown-focused.png + actionbuttons/button-action-shutdown-unfocused.png + XBMC.ShutDown() + - + 7000 + 9003 + - + + + + + + + 32 + 652 + 36 + 36 + graphic-back-button.png + + + Back + 75 + 653 + 36 + 300 + left + center + FFEFEFEF + font21b + + true + + + + + diff --git a/skin/boxee/720p/custom_Login_Menu.xml b/skin/boxee/720p/custom_Login_Menu.xml new file mode 100644 index 00000000..52e141c5 --- /dev/null +++ b/skin/boxee/720p/custom_Login_Menu.xml @@ -0,0 +1,183 @@ + + + 8700 + no + + Common_Background + BoxeeLogo + + DialogNoAnim_Heidi + + + 474 + 134 + 312 + left + top + + true + font24b + whiteheidi + + + 474 + 186 + 312 + 56 + Button_Heidi + + + - + 8701 + - + - + - + + + 474 + 254 + 312 + 56 + Button_Heidi + + + 8700 + 8702 + - + - + - + + + 474 + 322 + 312 + 56 + Button_Heidi + + + 8701 + - + - + - + - + + + + + 66 + 66 + 12 + 12 + graphic_steps_dot.png + + + 82 + 66 + 12 + 12 + graphic_steps_dot.png + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + 114 + 66 + 12 + 12 + graphic_steps_dot.png + + + 130 + 66 + 12 + 12 + graphic_steps_circle.png + + + + Header + 63 + 97 + 320 + 200 + left + top + + Header_Heidi + true + + + + 64 + 203 + 336 + left + top + + true + LargeText_Heidi + + + + + + 1032 + 32 + + 76 + 0 + 64 + 64 + actionbuttons/button-action-wifi-focused.png + actionbuttons/button-action-wifi-unfocused.png + ActivateWindow(NetworkSettings) + - + 7000 + 9004 + + + 152 + 0 + 64 + 64 + actionbuttons/button-action-shutdown-focused.png + actionbuttons/button-action-shutdown-unfocused.png + XBMC.ShutDown() + - + 7000 + 9003 + - + + + + + + + 32 + 652 + 36 + 36 + graphic-back-button.png + + + Back + 75 + 653 + 36 + 300 + left + center + FFEFEFEF + font21b + + true + + + + + diff --git a/skin/boxee/720p/custom_Login_NewUser.xml b/skin/boxee/720p/custom_Login_NewUser.xml new file mode 100644 index 00000000..719ee1f1 --- /dev/null +++ b/skin/boxee/720p/custom_Login_NewUser.xml @@ -0,0 +1,330 @@ + + + 8700 + no + + Common_Background + + BoxeeLogo + + Dialog_Heidi + + + FacebookConnect_Heidi + 474 + 66 + - + - + 9003 + - + 8701 + 8701 + + + 474 + 132 + 312 + 20 + + + font20b + lightgreyheidi + center + center + + + Name + 474 + 162 + 312 + 56 + Edit_Heidi + left + 14 + Name + lightgreyheidi + - + - + 8700 + 8700 + 8702 + 8702 + + + + 798 + 176 + 24 + 24 + graphic-check.png + + + + 798 + 176 + 24 + 24 + graphic-error.png + + + + + Email + + 474 + 230 + 312 + 56 + Edit_Heidi + left + 14 + Email + lightgreyheidi + - + - + 8701 + 8701 + 8703 + 8703 + + + + 798 + 244 + 24 + 24 + graphic-check.png + + + + 798 + 244 + 24 + 24 + graphic-error.png + + + + + Password + + 474 + 298 + 312 + 56 + Edit_Heidi + left + 14 + Password + lightgreyheidi + true + - + - + 8702 + 8702 + 8704 + 8704 + + + + 798 + 312 + 24 + 24 + graphic-check.png + + + + 798 + 312 + 24 + 24 + graphic-error.png + + + + + + 474 + 367 + 312 + 20 + + + font20b + errorredheidi + center + center + + + + 474 + 367 + 312 + 20 + + + font20b + errorredheidi + center + center + + + + 474 + 367 + 312 + 20 + + + font20b + errorredheidi + center + center + + + + + 474 + 422 + 312 + 56 + Button_Heidi + + + 8703 + - + - + - + ActivateWindow(4583) + + + + + 66 + 66 + 12 + 12 + graphic_steps_circle.png + + + + 82 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 114 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 130 + 66 + 12 + 12 + graphic_steps_dot.png + + + + Header + 63 + 97 + 320 + 200 + left + top + + Header_Heidi + true + + + + 64 + 203 + 336 + left + top + + true + LargeText_Heidi + + + + + + 1032 + 32 + + 76 + 0 + 64 + 64 + actionbuttons/button-action-wifi-focused.png + actionbuttons/button-action-wifi-unfocused.png + ActivateWindow(NetworkSettings) + - + 7000 + 9004 + + + 152 + 0 + 64 + 64 + actionbuttons/button-action-shutdown-focused.png + actionbuttons/button-action-shutdown-unfocused.png + XBMC.ShutDown() + - + 7000 + 9003 + - + + + + + + + 32 + 652 + 36 + 36 + graphic-back-button.png + + + Back + 75 + 653 + 36 + 300 + left + center + FFEFEFEF + font21b + + true + + + + + diff --git a/skin/boxee/720p/custom_Login_NewUserDetails.xml b/skin/boxee/720p/custom_Login_NewUserDetails.xml new file mode 100644 index 00000000..e52f36fd --- /dev/null +++ b/skin/boxee/720p/custom_Login_NewUserDetails.xml @@ -0,0 +1,373 @@ + + + 8801 + no + + Common_Background + + BoxeeLogo + + DialogNoAnim_Heidi + + !Control.HasFocus(8900) + !Control.HasFocus(9000) + !Control.HasFocus(9100) + !Control.HasFocus(9200) + + + 473 + 64 + 312 + 20 + + + font20b + lightgreyheidi + left + center + + + + + 474 + 90 + 312 + 56 + ToggleButton_Heidi + left + 14 + + 9003 + 8802 + Control.SetFocus(8900) + + + Control.HasFocus(8801) + 751 + 106 + 24 + 24 + graphic-more-focused.png + + + !Control.HasFocus(8801) + 751 + 106 + 24 + 24 + graphic-more-unfocused.png + + + + 473 + 156 + 312 + 20 + + + font20b + lightgreyheidi + left + center + + + + + 474 + 182 + 312 + 56 + ToggleButton_Heidi + left + 14 + + 8801 + 8803 + + + Control.HasFocus(8802) + 751 + 198 + 24 + 24 + graphic-more-focused.png + + + !Control.HasFocus(8802) + 751 + 198 + 24 + 24 + graphic-more-unfocused.png + + + + + 474 + 249 + 148 + 56 + ToggleButton_Heidi + left + 14 + + 8802 + 8804 + + + Control.HasFocus(8803) + 587 + 265 + 24 + 24 + graphic-more-focused.png + + + !Control.HasFocus(8803) + 587 + 265 + 24 + 24 + graphic-more-unfocused.png + + + + + 638 + 249 + 148 + 56 + ToggleButton_Heidi + left + 14 + + 8803 + 8805 + + + Control.HasFocus(8804) + 751 + 265 + 24 + 24 + graphic-more-focused.png + + + !Control.HasFocus(8804) + 751 + 265 + 24 + 24 + graphic-more-unfocused.png + + + + 474 + 354 + 312 + 56 + Button_Heidi + + + 8804 + 8806 + - + - + - + + + + 474 + 422 + 312 + 56 + Button_Heidi + + + 8805 + - + - + - + - + + + + + + Control.HasFocus(8900) + 474 + 64 + 312 + 800 + + + 156 + 0 + 310 + 56 + font24b + FFB3B8BB + center + center + + + + + + 0 + 0 + 312 + 56 + button-focused.png + + + 156 + 0 + font24b + FFEFEFEF + 312 + 56 + center + center + + + + + + + + + + + + + + + + + + + 66 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 82 + 66 + 12 + 12 + graphic_steps_circle.png + + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 114 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 130 + 66 + 12 + 12 + graphic_steps_dot.png + + + + Header + 63 + 97 + 320 + 200 + left + top + + Header_Heidi + true + + + + 64 + 203 + 336 + left + top + + true + LargeText_Heidi + + + + + + 1032 + 32 + + 76 + 0 + 64 + 64 + actionbuttons/button-action-wifi-focused.png + actionbuttons/button-action-wifi-unfocused.png + ActivateWindow(NetworkSettings) + - + 7000 + 9004 + + + 152 + 0 + 64 + 64 + actionbuttons/button-action-shutdown-focused.png + actionbuttons/button-action-shutdown-unfocused.png + XBMC.ShutDown() + - + 7000 + 9003 + - + + + + + + + 32 + 652 + 36 + 36 + graphic-back-button.png + + + Back + 75 + 653 + 36 + 300 + left + center + FFEFEFEF + font21b + + true + + + + + diff --git a/skin/boxee/720p/custom_Login_SocialServices.xml b/skin/boxee/720p/custom_Login_SocialServices.xml new file mode 100644 index 00000000..4bb08933 --- /dev/null +++ b/skin/boxee/720p/custom_Login_SocialServices.xml @@ -0,0 +1,234 @@ + + + 8700 + no + + Common_Background + + BoxeeLogo + + DialogNoAnim_Heidi + + + FacebookConnect_Heidi + 474 + 66 + - + - + 9003 + - + 8701 + 8701 + + + + 798 + 79 + 24 + 24 + graphic-check.png + + + + TwitterConnect_Heidi + 474 + 136 + - + - + 8700 + - + 8702 + 8702 + + + + 798 + 152 + 24 + 24 + graphic-check.png + + + + TumblrConnect_Heidi + 474 + 203 + - + - + 8701 + - + 8704 + 8704 + + + + 798 + 216 + 24 + 24 + graphic-check.png + + + + + 474 + 422 + 312 + 56 + Button_Heidi + + + SetFocus(8702) + - + - + - + ActivateWindow(4586) + window(4585).property(facebook-connected) | window(4585).property(twitter-connected) | window(4585).property(tumblr-connected) + + + + 474 + 422 + 312 + 56 + Button_Heidi + + + SetFocus(8702) + - + - + - + ActivateWindow(4586) + !window(4585).property(facebook-connected) + !window(4585).property(twitter-connected) + !window(4585).property(tumblr-connected) + + + + + + 66 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 82 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 98 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 114 + 66 + 12 + 12 + graphic_steps_circle.png + + + + 130 + 66 + 12 + 12 + graphic_steps_dot.png + + + + Header + 63 + 97 + 320 + 200 + left + top + + Header_Heidi + true + + + + 64 + 203 + 336 + left + top + + true + LargeText_Heidi + + + + + + 1032 + 32 + + 76 + 0 + 64 + 64 + actionbuttons/button-action-wifi-focused.png + actionbuttons/button-action-wifi-unfocused.png + ActivateWindow(NetworkSettings) + - + 7000 + 9004 + + + 152 + 0 + 64 + 64 + actionbuttons/button-action-shutdown-focused.png + actionbuttons/button-action-shutdown-unfocused.png + XBMC.ShutDown() + - + 7000 + 9003 + - + + + + + + + 32 + 652 + 36 + 36 + graphic-back-button.png + + + Back + 75 + 653 + 36 + 300 + left + center + FFEFEFEF + font21b + + true + + + + + diff --git a/skin/boxee/720p/custom_Login_TermsOfUse.xml b/skin/boxee/720p/custom_Login_TermsOfUse.xml new file mode 100644 index 00000000..ecff851c --- /dev/null +++ b/skin/boxee/720p/custom_Login_TermsOfUse.xml @@ -0,0 +1,302 @@ + + + 8701 + no + + Common_Background + + BoxeeLogo + + DialogNoAnim_Heidi + + + !Control.HasFocus(8801) + !Control.HasFocus(8901) + + 474 + 162 + 312 + 56 + Button_Heidi + + + 9003 + 8702 + - + - + Control.SetFocus(8801) + + + + 474 + 230 + 312 + 56 + Button_Heidi + + + 8701 + 8703 + - + - + Control.SetFocus(8901) + + + + 474 + 422 + 312 + 56 + Button_Heidi + + + 8702 + - + - + - + ActivateWindow(4585) + + + + + + 474 + 66 + 312 + 411 + text-field-no-stroke.png + FFEEEEEE + + + 485 + 80 + 271 + 15 + 14b + FF000000 + + + + 485 + 107 + 271 + 358 + font12 + FF000000 + + 8801 + false + + + + 767 + 77 + 10 + 390 + true + graphic-scrollbar-bg.png + graphic-scrollbar-slider.png + graphic-scrollbar-slider.png + vertical + false + - + - + - + - + + Control.HasFocus(8801) + + + + + 474 + 66 + 312 + 411 + text-field-no-stroke.png + FFEEEEEE + + + 485 + 80 + 271 + 15 + 14b + FF000000 + + + + 485 + 107 + 271 + 358 + font12 + FF000000 + + 8901 + false + + + + 767 + 77 + 10 + 390 + true + graphic-scrollbar-bg.png + graphic-scrollbar-slider.png + graphic-scrollbar-slider.png + vertical + false + - + - + - + - + + Control.HasFocus(8901) + + + + + 66 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 82 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 98 + 66 + 12 + 12 + graphic_steps_circle.png + + + + 114 + 66 + 12 + 12 + graphic_steps_dot.png + + + + 130 + 66 + 12 + 12 + graphic_steps_dot.png + + + + Header + 63 + 97 + 320 + 200 + left + top + + Header_Heidi + true + + + + 64 + 203 + 336 + left + top + + true + LargeText_Heidi + + + + + + 1032 + 32 + + 76 + 0 + 64 + 64 + actionbuttons/button-action-wifi-focused.png + actionbuttons/button-action-wifi-unfocused.png + ActivateWindow(NetworkSettings) + - + 7000 + 9004 + + + 152 + 0 + 64 + 64 + actionbuttons/button-action-shutdown-focused.png + actionbuttons/button-action-shutdown-unfocused.png + XBMC.ShutDown() + - + 7000 + 9003 + - + + + + + + + 32 + 652 + 36 + 36 + graphic-back-button.png + + + Back + 75 + 653 + 36 + 300 + left + center + FFEFEFEF + font21b + + true + + + + + diff --git a/skin/boxee/720p/custom_Login_UserLoginDialog.xml b/skin/boxee/720p/custom_Login_UserLoginDialog.xml new file mode 100644 index 00000000..70eb6579 --- /dev/null +++ b/skin/boxee/720p/custom_Login_UserLoginDialog.xml @@ -0,0 +1,173 @@ + + + 8602 + no + + Common_Background + BoxeeLogo + + Dialog_Heidi + + + Password + 474 + 66 + 312 + 56 + Edit_Heidi + left + 14 + $LOCALIZE[15052] + opaquegrey + true + - + - + 9003 + 8601 + 8603 + 8603 + + + 474 + 134 + 312 + 48 + - + - + 8602 + 8602 + 8607 + 8607 + + + RadioButton_Heidi + + + 474 + 194 + 312 + 48 + - + - + 8603 + 8603 + 8604 + 8604 + + + RadioButton_Heidi + + + 474 + 374 + 312 + 56 + Button_Heidi + + + 8607 + 8606 + - + - + - + + + 474 + 442 + 312 + 36 + button-focused.png + - + font16b + FFB3B8BB + FFEFEFEF + FFB3B8BB + center + center + + + 8604 + - + - + - + - + + + + + 110 + 66 + 224 + 224 + thumbnail-bg-focused.png + + + 110 + 66 + 224 + 224 + scale + $INFO[ListItem.Thumb] + + + + Username + 105 + 254 + 200 + 230 + center + center + white + font44b + + true + + + + + + 1032 + 32 + + OnDialogOpen_HideItem + 0 + 0 + 64 + 64 + actionbuttons/button-action-plus-focused.png + actionbuttons/button-action-plus-unfocused.png + - + - + 7000 + 7000 + 9003 + + + 76 + 0 + 64 + 64 + actionbuttons/button-action-wifi-focused.png + actionbuttons/button-action-wifi-unfocused.png + ActivateWindow(NetworkSettings) + - + 7000 + 9004 + + + 152 + 0 + 64 + 64 + actionbuttons/button-action-shutdown-focused.png + actionbuttons/button-action-shutdown-unfocused.png + XBMC.ShutDown() + - + 7000 + 9003 + - + + + + diff --git a/skin/boxee/720p/custom_boxee_osd_advanced.xml b/skin/boxee/720p/custom_boxee_osd_advanced.xml new file mode 100644 index 00000000..d757a481 --- /dev/null +++ b/skin/boxee/720p/custom_boxee_osd_advanced.xml @@ -0,0 +1,163 @@ + + + 5 + no + + + + + + + + + + 342 + 126 + + 0 + 0 + 600 + 412 + background/window-bg-transparent.png + + + + 18 + 30 + 564 + 20 + center + top + font24b + whiteheidi + + + + + + + No Settings Label + 25 + 34 + 550 + 22 + font24b + top + left + + white + + + control area + 42 + 70 + 516 + 300 + vertical + false + 0 + 90 + - + - + - + - + + + Default Button + 0 + 0 + 56 + font24 + lightgreyheidi + lightgreyheidi + whiteheidi + whiteheidi + mediumgreyheidi + 20 + button-focused.png + - + false + + + Default RadioButton + 0 + 0 + 40 + font22 + lightgreyheidi + whiteheidi + mediumgreyheidi + 20 + button-focused.png + - + graphic-radio-on.png + graphic-radio-off.png + false + 476 + 8 + 24 + 24 + + + + Default SpinControlex + 0 + 0 + 40 + font22 + white + black + disabled + 20 + center + button_settings_line_divider.png + browse_line_focus.png + icons/icon_settings_arrow_up.png + icons/icon_settings_arrow_down.png + icons/icon_settings_arrow_up_on.png + icons/icon_settings_arrow_down_on.png + yes + false + + + + Default Slider + 0 + 0 + 516 + 56 + font24 + lightgreyheidi + whiteheidi + mediumgreyheidi + 20 + center + button-focused.png + - + 124 + 12 + osd-slider-bg.png + universal/graphic-circle-18px.png + universal/graphic-circle-18px.png + false + + + + false + scroll bar indicator for lists + 1062 + 63 + 12 + 354 + ScrollBarCommonProperties + + + + + + + diff --git a/skin/boxee/720p/ftu_audio.xml b/skin/boxee/720p/ftu_audio.xml new file mode 100644 index 00000000..361a3600 --- /dev/null +++ b/skin/boxee/720p/ftu_audio.xml @@ -0,0 +1,6 @@ +ïŧŋ + + 261 + + + diff --git a/skin/boxee/720p/ftu_calibration.xml b/skin/boxee/720p/ftu_calibration.xml new file mode 100644 index 00000000..34a24ef0 --- /dev/null +++ b/skin/boxee/720p/ftu_calibration.xml @@ -0,0 +1,137 @@ + + + 81 + + Common_Background + + FTUDialogNoAnim_Heidi + + + 506 + 98 + 248 + 184 + ftu/graphic-calibrate-tv.png + + + calibrate top-left + Window.CheckIntProperty(setting-state,1)) + 530 + 124 + 200 + 120 + ftu/graphic-calibrate-tv-1.png + + + calibrate bottom-right + Window.CheckIntProperty(setting-state,2)) + 530 + 124 + 200 + 120 + ftu/graphic-calibrate-tv-2.png + + + Window.CheckIntProperty(setting-state,3)) + YES + 474 + 354 + 312 + 56 + Button_Heidi + + - + - + 251 + + + Window.CheckIntProperty(setting-state,3)) + NO + 474 + 422 + 312 + 56 + Button_Heidi + + + 250 + - + + + + + 62 + 56 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + calibrate top-left + Window.CheckIntProperty(setting-state,1)) + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + calibrate bottom-right + Window.CheckIntProperty(setting-state,2)) + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + calibrate bottom-right + Window.CheckIntProperty(setting-state,3)) + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + + top left mover + 28 + 28 + 208 + 208 + ftu/graphic-calibrate-arrow-1-on.png + ftu/graphic-calibrate-arrow-1-off.png + + + right bottom mover + 1044 + 484 + 208 + 208 + ftu/graphic-calibrate-arrow-2-on.png + ftu/graphic-calibrate-arrow-2-off.png + + + diff --git a/skin/boxee/720p/ftu_conf_network.xml b/skin/boxee/720p/ftu_conf_network.xml new file mode 100644 index 00000000..bf426891 --- /dev/null +++ b/skin/boxee/720p/ftu_conf_network.xml @@ -0,0 +1,103 @@ + + + 51 + + Common_Background + + FTUDialogNoAnim_Heidi + + + 474 + 74 + vertical + true + false + 8 + 250 + + 312 + 56 + Edit_Heidi + $LOCALIZE[54681] + - + 511 + - + - + + + 312 + 56 + Edit_Heidi + $LOCALIZE[54682] + 501 + 521 + - + - + + + 312 + 56 + Edit_Heidi + $LOCALIZE[54683] + 511 + 531 + - + - + + + 312 + 56 + Edit_Heidi + $LOCALIZE[54684] + 521 + 250 + - + - + + + + Confirm + 474 + 422 + 312 + 56 + Button_Heidi + + + 51 + - + + + + + 62 + 56 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + + diff --git a/skin/boxee/720p/ftu_conf_wireless_password.xml b/skin/boxee/720p/ftu_conf_wireless_password.xml new file mode 100644 index 00000000..b20c6e13 --- /dev/null +++ b/skin/boxee/720p/ftu_conf_wireless_password.xml @@ -0,0 +1,92 @@ + + + 51 + + Common_Background + + FTUDialogNoAnim_Heidi + + + 474 + 66 + 312 + 108 + center + top + font24bls + whiteheidi + + true + + + 474 + 120 + 312 + 56 + Edit_Heidi + true + $LOCALIZE[15052] + - + 52 + + + Conditional + RadioButton_Heidi + 474 + 188 + 312 + 48 + 51 + 250 + - + - + + + + Next + true + !Control.IsEmpty(51) + 474 + 422 + 312 + 56 + Button_Heidi + + + 52 + - + + + + + 62 + 56 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + + + diff --git a/skin/boxee/720p/ftu_conf_wireless_security.xml b/skin/boxee/720p/ftu_conf_wireless_security.xml new file mode 100644 index 00000000..f8f4f4bd --- /dev/null +++ b/skin/boxee/720p/ftu_conf_wireless_security.xml @@ -0,0 +1,93 @@ + + + 240 + + Common_Background + + FTUDialogNoAnim_Heidi + + + 474 + 66 + 312 + center + top + + true + font24b + whiteheidi + + + Conditional + 474 + 116 + 312 + 372 + 200 + vertical + + + 156 + -1 + 312 + 48 + center + center + font20 + mediumgreyheidi + + + + + + 312 + 48 + button-focused.png + + + 156 + -1 + 312 + 48 + center + center + font20 + whiteheidi + + + + + + + + 62 + 56 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + + diff --git a/skin/boxee/720p/ftu_conf_wireless_ssid.xml b/skin/boxee/720p/ftu_conf_wireless_ssid.xml new file mode 100644 index 00000000..d082a8c1 --- /dev/null +++ b/skin/boxee/720p/ftu_conf_wireless_ssid.xml @@ -0,0 +1,76 @@ + + + 51 + + Common_Background + + FTUDialogNoAnim_Heidi + + + 474 + 66 + 312 + 108 + center + top + font24bls + whiteheidi + + true + + + 474 + 120 + 312 + 56 + Edit_Heidi + - + 250 + + + Next + true + !Control.IsEmpty(51) + 474 + 422 + 312 + 56 + Button_Heidi + + + 51 + - + + + + + 62 + 56 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + + diff --git a/skin/boxee/720p/ftu_ethernet.xml b/skin/boxee/720p/ftu_ethernet.xml new file mode 100644 index 00000000..b828f843 --- /dev/null +++ b/skin/boxee/720p/ftu_ethernet.xml @@ -0,0 +1,190 @@ +ïŧŋ + + 281 + + Dialog_Popup_Background + + Dialog_Popup_Animation + 250 + 60 + + 0 + 0 + 800 + 600 + new_skin/dialog4_background.png + + + 30 + 140 + 48 + 100 + left + center + white + font16b + + + Init_Box_Boxee_Icon_Left + + heading label + 40 + 60 + 550 + 28 + font28b + left + center + + FF3B2D06 + + + 250 + 150 + 550 + 48 + font20b + left + center + + + + 250 + 250 + 550 + 48 + font20b + left + center + + + + 240 + 350 + + 0 + 0 + 350 + 40 + - + 282 + 250 + 251 + SetFocus(250) + font20b + center + white + white + disabled + 40 + - + button_option_menu_on.png + icons/icon_checkbox_full.png + icons/icon_checkbox_empty.png + false + 10 + 10 + 20 + 20 + + + + 0 + 40 + 350 + 40 + 281 + 283 + 250 + 251 + SetFocus(250) + font20b + center + white + white + disabled + 40 + - + button_option_menu_on.png + icons/icon_checkbox_full.png + icons/icon_checkbox_empty.png + false + 10 + 10 + 20 + 20 + + + + 0 + 80 + 350 + 40 + 282 + 250 + 250 + 251 + SetFocus(250) + font20b + center + white + white + disabled + 40 + - + button_option_menu_on.png + icons/icon_checkbox_full.png + icons/icon_checkbox_empty.png + false + 10 + 10 + 20 + 20 + + + + + + 866 + 578 + 160 + 54 + center + center + grey + white + - + button_action_menu_source_on.png + button_action_menu_source_click.png + font22b + + + 280 + - + 251 + - + - + + + 276 + 578 + 160 + 54 + center + center + grey + white + - + button_action_menu_source_on.png + button_action_menu_source_click.png + font22b + + + 280 + - + - + 250 + - + + + diff --git a/skin/boxee/720p/ftu_lang.xml b/skin/boxee/720p/ftu_lang.xml new file mode 100644 index 00000000..dd4e7eab --- /dev/null +++ b/skin/boxee/720p/ftu_lang.xml @@ -0,0 +1,73 @@ + + + 240 + + Common_Background + + Dialog_Popup_Animation + 366 + 88 + + 0 + 0 + 548 + 492 + dialog_bg.png + + + 48 + 48 + 452 + 400 + - + - + - + - + - + 200 + + + 226 + -1 + 452 + 56 + font24b + mediumgreyheidi + center + center + + + + + + 0 + 0 + 452 + 56 + button-focused.png + + + 226 + -1 + 452 + 56 + font24b + whiteheidi + center + center + + true + + + + + + + diff --git a/skin/boxee/720p/ftu_menu_cust.xml b/skin/boxee/720p/ftu_menu_cust.xml new file mode 100644 index 00000000..c6701923 --- /dev/null +++ b/skin/boxee/720p/ftu_menu_cust.xml @@ -0,0 +1,119 @@ +ïŧŋ + + 220 + no + + Common_Background + + 330 + 80 + + 0 + 0 + 620 + 560 + browse_menu_dialog_background.png + FF212121 + + + + 40 + 30 + 540 + 80 + font40b + center + center + + white + true + + + 60 + 97 + 500 + 90 + center + center + font26 + + true + + + 120 + 200 + + 0 + 0 + 380 + 70 + center + center + white + black + button_8_pixel.png + button_8_pixel.png + - + font26 + + - + 210 + - + - + + + 0 + 80 + 380 + 70 + center + center + white + black + button_8_pixel.png + button_8_pixel.png + - + font26 + + 220 + 230 + - + - + + + 0 + 160 + 380 + 70 + center + center + white + black + button_8_pixel.png + button_8_pixel.png + - + font26 + Control.IsVisible(90) + + 210 + - + - + - + + + + 60 + 450 + 500 + 90 + center + center + font24 + + grey + true + + + + + diff --git a/skin/boxee/720p/ftu_network_message.xml b/skin/boxee/720p/ftu_network_message.xml new file mode 100644 index 00000000..7ddf2085 --- /dev/null +++ b/skin/boxee/720p/ftu_network_message.xml @@ -0,0 +1,99 @@ + + + 300 + + Common_Background + + FTUDialogNoAnim_Heidi + + + 550 + 72 + 160 + 80 + ftu/graphic-ftu-ethernet.png + + + no internet + 466 + 176 + 340 + 118 + top + font24bls + errorredheidi + true + + + 474 + 310 + 312 + 56 + Button_Heidi + 300 + 400 + - + - + - + + + + 474 + 378 + 312 + 56 + Button_Heidi + 300 + 500 + - + - + - + + + + 474 + 446 + 312 + 56 + Button_Heidi + 400 + 500 + - + - + - + + + + + + 62 + 56 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + + diff --git a/skin/boxee/720p/ftu_res.xml b/skin/boxee/720p/ftu_res.xml new file mode 100644 index 00000000..601af1d2 --- /dev/null +++ b/skin/boxee/720p/ftu_res.xml @@ -0,0 +1,6 @@ +ïŧŋ + + 240 + + + diff --git a/skin/boxee/720p/ftu_simple_message.xml b/skin/boxee/720p/ftu_simple_message.xml new file mode 100644 index 00000000..358dde33 --- /dev/null +++ b/skin/boxee/720p/ftu_simple_message.xml @@ -0,0 +1,36 @@ + + + 250 + + Common_Background + + Popup_Heidi + + -58 + + dialog line 1 + Popup_OK_Body_Properties + + top + font26ls + lightgreyheidi + true + + + + 66 + 422 + 416 + 56 + Button_Heidi + + + - + - + 10 + 10 + - + + + + diff --git a/skin/boxee/720p/ftu_update_message.xml b/skin/boxee/720p/ftu_update_message.xml new file mode 100644 index 00000000..aac666c9 --- /dev/null +++ b/skin/boxee/720p/ftu_update_message.xml @@ -0,0 +1,63 @@ + + + 250 + + Common_Background + + FTUDialogNoAnim_Heidi + + + 474 + 66 + 312 + 268 + top + font24bls + whiteheidi + true + + + Update + 474 + 422 + 312 + 56 + Button_Heidi + + 51 + - + + + + + 62 + 56 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + + diff --git a/skin/boxee/720p/ftu_update_progress.xml b/skin/boxee/720p/ftu_update_progress.xml new file mode 100644 index 00000000..a2f3a909 --- /dev/null +++ b/skin/boxee/720p/ftu_update_progress.xml @@ -0,0 +1,72 @@ + + + 250 + + Common_Background + + 214 + 88 + + 0 + 0 + 852 + 544 + dialog_bg.png + + + 62 + 52 + 720 + 60 + left + top + font40bls + whiteheidi + + + + 62 + 110 + 720 + 140 + left + top + font24bls + lightgreyheidi + + true + + + 62 + 324 + 720 + 140 + center + top + font24bls + lightgreyheidi + + + 62 + 262 + 720 + 56 + ftu/graphic-download-bg.png + ftu/graphic-download-progress-cap.png + ftu/graphic-download-progress.png + ftu/graphic-download-progress-cap.png + - + + + 62 + 278 + 24 + 720 + center + center + white + font24 + + + + diff --git a/skin/boxee/720p/ftu_welcome.xml b/skin/boxee/720p/ftu_welcome.xml new file mode 100644 index 00000000..a921197e --- /dev/null +++ b/skin/boxee/720p/ftu_welcome.xml @@ -0,0 +1,71 @@ + + + 250 + + Common_Background + + FTUDialog_Heidi + + + 62 + 52 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 288 + 60 + ftu/graphic-welcome-boxee-logotype.png + + + 20 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + + true + stringcompare(skin.string(IsDlink),1) + 582 + 102 + 192 + 268 + ftu/graphic-remote-get-started-dlink.png + + + true + stringcompare(skin.string(IsDlink),0) + 582 + 102 + 192 + 268 + ftu/graphic-remote-get-started-iomega.png + + + 474 + 422 + 312 + 56 + Button_Heidi + + + + + + diff --git a/skin/boxee/720p/ftu_window_background.xml b/skin/boxee/720p/ftu_window_background.xml new file mode 100644 index 00000000..601af1d2 --- /dev/null +++ b/skin/boxee/720p/ftu_window_background.xml @@ -0,0 +1,6 @@ +ïŧŋ + + 240 + + + diff --git a/skin/boxee/720p/ftu_wireless.xml b/skin/boxee/720p/ftu_wireless.xml new file mode 100644 index 00000000..daa8fb39 --- /dev/null +++ b/skin/boxee/720p/ftu_wireless.xml @@ -0,0 +1,249 @@ + + + 240 + + Common_Background + + FTUDialogNoAnim_Heidi + + + true + window(10445).property(show-list) + Select wireless network + 474 + 56 + 322 + center + top + + false + font24b + whiteheidi + + + true + !window(10445).property(show-list) + No wireless network found + 474 + 56 + 322 + center + top + + false + font24b + whiteheidi + + + Conditional + true + window(10445).property(show-list) + 1 + 474 + 106 + 312 + 176 + 200 + vertical + 255 + + + 160 + -1 + 202 + 48 + center + center + font20 + mediumgreyheidi + + + + 8 + 6 + 38 + 38 + ListItem.property(signalstrength) + + + 272 + 6 + 38 + 38 + ListItem.property(secure) + + + + + !Control.HasFocus(240) + + 160 + -1 + 202 + 48 + center + center + font20 + mediumgreyheidi + + + + 8 + 6 + 38 + 38 + ListItem.property(signalstrength) + + + 272 + 6 + 38 + 38 + ListItem.property(secure) + + + + Control.HasFocus(240) + + 312 + 48 + button-focused.png + + + 160 + -1 + 202 + 48 + center + center + font20 + whiteheidi + + true + + + 8 + 6 + 38 + 38 + ListItem.property(signalstrength) + + + 272 + 6 + 38 + 38 + ListItem.property(secure) + + + + + + 470 + 288 + 320 + 40 + graphic-divider-480.png + + + + 470 + 340 + 320 + 54 + center + center + lightgreyheidi + whiteheidi + universal/button-unfocused.png + button-focused.png + 240 + 275 + - + - + - + font22b + + + + 470 + 406 + 320 + 54 + center + center + lightgreyheidi + whiteheidi + universal/button-unfocused.png + button-focused.png + 255 + - + - + - + - + font22b + + + + + true + window(10445).property(is-searching) + VisibleChange + 470 + 470 + 40 + 40 + loading_small + 2 + 2 + 0 + false + yes + keep + + + true + window(10445).property(is-searching) + VisibleChange + 520 + 470 + 40 + 300 + left + center + white + font20 + + + + + + + + 62 + 56 + 320 + 412 + vertical + 0 + true + + 320 + auto + left + top + + Header_Heidi + true + + + 10 + 320 + auto + left + top + + true + LargeText_Heidi + + + + + + + diff --git a/skin/boxee/720p/test_bad_pixels_manager.xml b/skin/boxee/720p/test_bad_pixels_manager.xml new file mode 100755 index 00000000..9aaab8d2 --- /dev/null +++ b/skin/boxee/720p/test_bad_pixels_manager.xml @@ -0,0 +1,93 @@ +ïŧŋ + + 240 + + Common_Background + + 326 + 50 + + 0 + 0 + 628 + 643 + browse_menu_dialog_background.png + FF212121 + + + 0 + 50 + 628 + 90 + font32b + center + center + white + + + + 156 + 150 + 300 + 90 + font24b + left + center + white + + + + 146 + 230 + 340 + 360 + - + - + - + - + 200 + vertical + + + 0 + 0 + 340 + 70 + button_action_menu_source.png + + + 170 + 22 + 320 + 25 + font24b + center + center + ListItem.Label + white + + + + + 0 + 0 + 340 + 70 + button_action_menu_source_on.png + + + 170 + 22 + 320 + 25 + font24b + center + center + ListItem.Label + black + + + + + + diff --git a/skin/boxee/Fonts/DejaVuSansMono.ttf b/skin/boxee/Fonts/DejaVuSansMono.ttf new file mode 100644 index 00000000..7260bd65 Binary files /dev/null and b/skin/boxee/Fonts/DejaVuSansMono.ttf differ diff --git a/skin/boxee/Fonts/DejaVuSerif.ttf b/skin/boxee/Fonts/DejaVuSerif.ttf new file mode 100644 index 00000000..ed53a296 Binary files /dev/null and b/skin/boxee/Fonts/DejaVuSerif.ttf differ diff --git a/skin/boxee/Fonts/arial.ttf b/skin/boxee/Fonts/arial.ttf new file mode 100644 index 00000000..73244ac5 Binary files /dev/null and b/skin/boxee/Fonts/arial.ttf differ diff --git a/skin/boxee/media/ButtonActive.png b/skin/boxee/media/ButtonActive.png new file mode 100644 index 00000000..87b4309a Binary files /dev/null and b/skin/boxee/media/ButtonActive.png differ diff --git a/skin/boxee/media/ButtonDown.png b/skin/boxee/media/ButtonDown.png new file mode 100644 index 00000000..1411dd7a Binary files /dev/null and b/skin/boxee/media/ButtonDown.png differ diff --git a/skin/boxee/media/ButtonInactive.png b/skin/boxee/media/ButtonInactive.png new file mode 100644 index 00000000..dad40132 Binary files /dev/null and b/skin/boxee/media/ButtonInactive.png differ diff --git a/skin/boxee/media/SubMenu.png b/skin/boxee/media/SubMenu.png new file mode 100644 index 00000000..fbb4c765 Binary files /dev/null and b/skin/boxee/media/SubMenu.png differ diff --git a/skin/boxee/media/SubMenuFlat.png b/skin/boxee/media/SubMenuFlat.png new file mode 100644 index 00000000..6855c647 Binary files /dev/null and b/skin/boxee/media/SubMenuFlat.png differ diff --git a/skin/boxee/media/action_menu_button.png b/skin/boxee/media/action_menu_button.png new file mode 100644 index 00000000..6f857422 Binary files /dev/null and b/skin/boxee/media/action_menu_button.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-channels-active.png b/skin/boxee/media/actionbuttons/button-action-channels-active.png new file mode 100644 index 00000000..282c2a5c Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-channels-active.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-channels-off.png b/skin/boxee/media/actionbuttons/button-action-channels-off.png new file mode 100644 index 00000000..3dc3b013 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-channels-off.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-channels-on.png b/skin/boxee/media/actionbuttons/button-action-channels-on.png new file mode 100644 index 00000000..51cd2c74 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-channels-on.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-eject-off.png b/skin/boxee/media/actionbuttons/button-action-eject-off.png new file mode 100644 index 00000000..dea76c38 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-eject-off.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-eject-on.png b/skin/boxee/media/actionbuttons/button-action-eject-on.png new file mode 100644 index 00000000..668ef88d Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-eject-on.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-grid-off.png b/skin/boxee/media/actionbuttons/button-action-grid-off.png new file mode 100644 index 00000000..6a837c7a Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-grid-off.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-grid-on.png b/skin/boxee/media/actionbuttons/button-action-grid-on.png new file mode 100644 index 00000000..29ba7a38 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-grid-on.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-list-off.png b/skin/boxee/media/actionbuttons/button-action-list-off.png new file mode 100644 index 00000000..345308fe Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-list-off.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-list-on.png b/skin/boxee/media/actionbuttons/button-action-list-on.png new file mode 100644 index 00000000..a3145d78 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-list-on.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-minus-active.png b/skin/boxee/media/actionbuttons/button-action-minus-active.png new file mode 100644 index 00000000..e49589e2 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-minus-active.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-minus-focused.png b/skin/boxee/media/actionbuttons/button-action-minus-focused.png new file mode 100644 index 00000000..f24073aa Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-minus-focused.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-minus-off.png b/skin/boxee/media/actionbuttons/button-action-minus-off.png new file mode 100644 index 00000000..44305170 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-minus-off.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-minus-on.png b/skin/boxee/media/actionbuttons/button-action-minus-on.png new file mode 100644 index 00000000..f24073aa Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-minus-on.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-minus-unfocused.png b/skin/boxee/media/actionbuttons/button-action-minus-unfocused.png new file mode 100644 index 00000000..44305170 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-minus-unfocused.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-plus-active.png b/skin/boxee/media/actionbuttons/button-action-plus-active.png new file mode 100644 index 00000000..c3055522 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-plus-active.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-plus-focused.png b/skin/boxee/media/actionbuttons/button-action-plus-focused.png new file mode 100644 index 00000000..64a779ca Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-plus-focused.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-plus-off.png b/skin/boxee/media/actionbuttons/button-action-plus-off.png new file mode 100644 index 00000000..646746fd Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-plus-off.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-plus-on.png b/skin/boxee/media/actionbuttons/button-action-plus-on.png new file mode 100644 index 00000000..64a779ca Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-plus-on.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-plus-unfocused.png b/skin/boxee/media/actionbuttons/button-action-plus-unfocused.png new file mode 100644 index 00000000..646746fd Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-plus-unfocused.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-scan-off.png b/skin/boxee/media/actionbuttons/button-action-scan-off.png new file mode 100644 index 00000000..0ad33ede Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-scan-off.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-scan-on.png b/skin/boxee/media/actionbuttons/button-action-scan-on.png new file mode 100644 index 00000000..60307b78 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-scan-on.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-settings-active.png b/skin/boxee/media/actionbuttons/button-action-settings-active.png new file mode 100644 index 00000000..9e043781 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-settings-active.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-settings-focused.png b/skin/boxee/media/actionbuttons/button-action-settings-focused.png new file mode 100644 index 00000000..a53dfaba Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-settings-focused.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-settings-off.png b/skin/boxee/media/actionbuttons/button-action-settings-off.png new file mode 100644 index 00000000..b9b9c909 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-settings-off.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-settings-on.png b/skin/boxee/media/actionbuttons/button-action-settings-on.png new file mode 100644 index 00000000..a53dfaba Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-settings-on.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-settings-unfocused.png b/skin/boxee/media/actionbuttons/button-action-settings-unfocused.png new file mode 100644 index 00000000..b9b9c909 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-settings-unfocused.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-shutdown-focused.png b/skin/boxee/media/actionbuttons/button-action-shutdown-focused.png new file mode 100644 index 00000000..23b94148 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-shutdown-focused.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-shutdown-off.png b/skin/boxee/media/actionbuttons/button-action-shutdown-off.png new file mode 100644 index 00000000..1b7a5d14 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-shutdown-off.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-shutdown-on.png b/skin/boxee/media/actionbuttons/button-action-shutdown-on.png new file mode 100644 index 00000000..23b94148 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-shutdown-on.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-shutdown-unfocused.png b/skin/boxee/media/actionbuttons/button-action-shutdown-unfocused.png new file mode 100644 index 00000000..1b7a5d14 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-shutdown-unfocused.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-sort-active.png b/skin/boxee/media/actionbuttons/button-action-sort-active.png new file mode 100644 index 00000000..ccb46079 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-sort-active.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-sort-off.png b/skin/boxee/media/actionbuttons/button-action-sort-off.png new file mode 100644 index 00000000..83d6e5f3 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-sort-off.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-sort-on.png b/skin/boxee/media/actionbuttons/button-action-sort-on.png new file mode 100644 index 00000000..69a01ed0 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-sort-on.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-wifi-active.png b/skin/boxee/media/actionbuttons/button-action-wifi-active.png new file mode 100644 index 00000000..60f07788 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-wifi-active.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-wifi-focused.png b/skin/boxee/media/actionbuttons/button-action-wifi-focused.png new file mode 100644 index 00000000..060f6950 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-wifi-focused.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-wifi-off.png b/skin/boxee/media/actionbuttons/button-action-wifi-off.png new file mode 100644 index 00000000..64f4f651 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-wifi-off.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-wifi-on.png b/skin/boxee/media/actionbuttons/button-action-wifi-on.png new file mode 100644 index 00000000..060f6950 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-wifi-on.png differ diff --git a/skin/boxee/media/actionbuttons/button-action-wifi-unfocused.png b/skin/boxee/media/actionbuttons/button-action-wifi-unfocused.png new file mode 100644 index 00000000..64f4f651 Binary files /dev/null and b/skin/boxee/media/actionbuttons/button-action-wifi-unfocused.png differ diff --git a/skin/boxee/media/ap-lock-on.png b/skin/boxee/media/ap-lock-on.png new file mode 100644 index 00000000..b414902d Binary files /dev/null and b/skin/boxee/media/ap-lock-on.png differ diff --git a/skin/boxee/media/ap-lock.png b/skin/boxee/media/ap-lock.png new file mode 100644 index 00000000..b414902d Binary files /dev/null and b/skin/boxee/media/ap-lock.png differ diff --git a/skin/boxee/media/ap-signal1-on.png b/skin/boxee/media/ap-signal1-on.png new file mode 100644 index 00000000..2a32ffdd Binary files /dev/null and b/skin/boxee/media/ap-signal1-on.png differ diff --git a/skin/boxee/media/ap-signal1.png b/skin/boxee/media/ap-signal1.png new file mode 100644 index 00000000..2a32ffdd Binary files /dev/null and b/skin/boxee/media/ap-signal1.png differ diff --git a/skin/boxee/media/ap-signal2-on.png b/skin/boxee/media/ap-signal2-on.png new file mode 100644 index 00000000..3755f615 Binary files /dev/null and b/skin/boxee/media/ap-signal2-on.png differ diff --git a/skin/boxee/media/ap-signal2.png b/skin/boxee/media/ap-signal2.png new file mode 100644 index 00000000..3755f615 Binary files /dev/null and b/skin/boxee/media/ap-signal2.png differ diff --git a/skin/boxee/media/ap-signal3-on.png b/skin/boxee/media/ap-signal3-on.png new file mode 100644 index 00000000..6b5c0706 Binary files /dev/null and b/skin/boxee/media/ap-signal3-on.png differ diff --git a/skin/boxee/media/ap-signal3.png b/skin/boxee/media/ap-signal3.png new file mode 100644 index 00000000..6b5c0706 Binary files /dev/null and b/skin/boxee/media/ap-signal3.png differ diff --git a/skin/boxee/media/background/background-mask-episodes.png b/skin/boxee/media/background/background-mask-episodes.png new file mode 100644 index 00000000..43e97600 Binary files /dev/null and b/skin/boxee/media/background/background-mask-episodes.png differ diff --git a/skin/boxee/media/background/background.jpg b/skin/boxee/media/background/background.jpg new file mode 100644 index 00000000..89d515a9 Binary files /dev/null and b/skin/boxee/media/background/background.jpg differ diff --git a/skin/boxee/media/background/bg-browse.jpg b/skin/boxee/media/background/bg-browse.jpg new file mode 100644 index 00000000..bbd8f672 Binary files /dev/null and b/skin/boxee/media/background/bg-browse.jpg differ diff --git a/skin/boxee/media/background/window-bg-transparent.png b/skin/boxee/media/background/window-bg-transparent.png new file mode 100644 index 00000000..a4bf885a Binary files /dev/null and b/skin/boxee/media/background/window-bg-transparent.png differ diff --git a/skin/boxee/media/blue.png b/skin/boxee/media/blue.png new file mode 100644 index 00000000..9debe6ab Binary files /dev/null and b/skin/boxee/media/blue.png differ diff --git a/skin/boxee/media/boxee_logo_icon_only.png b/skin/boxee/media/boxee_logo_icon_only.png new file mode 100644 index 00000000..d8eab2c9 Binary files /dev/null and b/skin/boxee/media/boxee_logo_icon_only.png differ diff --git a/skin/boxee/media/boxeelogo96x96.png b/skin/boxee/media/boxeelogo96x96.png new file mode 100644 index 00000000..566597a9 Binary files /dev/null and b/skin/boxee/media/boxeelogo96x96.png differ diff --git a/skin/boxee/media/browse/bg-dropshadow-2.png b/skin/boxee/media/browse/bg-dropshadow-2.png new file mode 100644 index 00000000..b63f9184 Binary files /dev/null and b/skin/boxee/media/browse/bg-dropshadow-2.png differ diff --git a/skin/boxee/media/browse/graphic-az-bg.png b/skin/boxee/media/browse/graphic-az-bg.png new file mode 100644 index 00000000..6c6b95f6 Binary files /dev/null and b/skin/boxee/media/browse/graphic-az-bg.png differ diff --git a/skin/boxee/media/browse/graphic-az-tab.png b/skin/boxee/media/browse/graphic-az-tab.png new file mode 100644 index 00000000..59827479 Binary files /dev/null and b/skin/boxee/media/browse/graphic-az-tab.png differ diff --git a/skin/boxee/media/browse/graphic-browse-line-mask-bottom-full.png b/skin/boxee/media/browse/graphic-browse-line-mask-bottom-full.png new file mode 100644 index 00000000..1d98a37a Binary files /dev/null and b/skin/boxee/media/browse/graphic-browse-line-mask-bottom-full.png differ diff --git a/skin/boxee/media/browse/graphic-browse-line-mask-bottom.png b/skin/boxee/media/browse/graphic-browse-line-mask-bottom.png new file mode 100644 index 00000000..f51eeb08 Binary files /dev/null and b/skin/boxee/media/browse/graphic-browse-line-mask-bottom.png differ diff --git a/skin/boxee/media/browse/graphic-browse-mask-bottom.png b/skin/boxee/media/browse/graphic-browse-mask-bottom.png new file mode 100644 index 00000000..fd8aecb1 Binary files /dev/null and b/skin/boxee/media/browse/graphic-browse-mask-bottom.png differ diff --git a/skin/boxee/media/browse/graphic-browse-mask-top.png b/skin/boxee/media/browse/graphic-browse-mask-top.png new file mode 100644 index 00000000..76085204 Binary files /dev/null and b/skin/boxee/media/browse/graphic-browse-mask-top.png differ diff --git a/skin/boxee/media/browse/graphic-divider-horz-232.png b/skin/boxee/media/browse/graphic-divider-horz-232.png new file mode 100644 index 00000000..4b5c81aa Binary files /dev/null and b/skin/boxee/media/browse/graphic-divider-horz-232.png differ diff --git a/skin/boxee/media/browse/graphic-divider-vert.png b/skin/boxee/media/browse/graphic-divider-vert.png new file mode 100644 index 00000000..0a6d9245 Binary files /dev/null and b/skin/boxee/media/browse/graphic-divider-vert.png differ diff --git a/skin/boxee/media/browse/graphic-imdb.png b/skin/boxee/media/browse/graphic-imdb.png new file mode 100644 index 00000000..9a8722b4 Binary files /dev/null and b/skin/boxee/media/browse/graphic-imdb.png differ diff --git a/skin/boxee/media/browse/graphic-rotten-bad.png b/skin/boxee/media/browse/graphic-rotten-bad.png new file mode 100644 index 00000000..097b1b14 Binary files /dev/null and b/skin/boxee/media/browse/graphic-rotten-bad.png differ diff --git a/skin/boxee/media/browse/graphic-rotten-good.png b/skin/boxee/media/browse/graphic-rotten-good.png new file mode 100644 index 00000000..e1abea13 Binary files /dev/null and b/skin/boxee/media/browse/graphic-rotten-good.png differ diff --git a/skin/boxee/media/browse/graphic-thumbnail-watched-check.png b/skin/boxee/media/browse/graphic-thumbnail-watched-check.png new file mode 100644 index 00000000..ee6a9235 Binary files /dev/null and b/skin/boxee/media/browse/graphic-thumbnail-watched-check.png differ diff --git a/skin/boxee/media/browse/graphic-watch-later-screenshot.png b/skin/boxee/media/browse/graphic-watch-later-screenshot.png new file mode 100644 index 00000000..4f48e7af Binary files /dev/null and b/skin/boxee/media/browse/graphic-watch-later-screenshot.png differ diff --git a/skin/boxee/media/browse/thumbnail-bg-off.png b/skin/boxee/media/browse/thumbnail-bg-off.png new file mode 100644 index 00000000..d4347cd6 Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-bg-off.png differ diff --git a/skin/boxee/media/browse/thumbnail-bg-on.png b/skin/boxee/media/browse/thumbnail-bg-on.png new file mode 100644 index 00000000..fb6899d7 Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-bg-on.png differ diff --git a/skin/boxee/media/browse/thumbnail-default-app.png b/skin/boxee/media/browse/thumbnail-default-app.png new file mode 100644 index 00000000..e36b3834 Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-default-app.png differ diff --git a/skin/boxee/media/browse/thumbnail-default-channel.png b/skin/boxee/media/browse/thumbnail-default-channel.png new file mode 100644 index 00000000..796f11f6 Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-default-channel.png differ diff --git a/skin/boxee/media/browse/thumbnail-default-episode.png b/skin/boxee/media/browse/thumbnail-default-episode.png new file mode 100644 index 00000000..5e61b4f0 Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-default-episode.png differ diff --git a/skin/boxee/media/browse/thumbnail-default-friend-avatar.png b/skin/boxee/media/browse/thumbnail-default-friend-avatar.png new file mode 100644 index 00000000..5fabcb3e Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-default-friend-avatar.png differ diff --git a/skin/boxee/media/browse/thumbnail-default-landscape.png b/skin/boxee/media/browse/thumbnail-default-landscape.png new file mode 100644 index 00000000..6c5dbba2 Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-default-landscape.png differ diff --git a/skin/boxee/media/browse/thumbnail-default-movie.png b/skin/boxee/media/browse/thumbnail-default-movie.png new file mode 100644 index 00000000..58a32c3a Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-default-movie.png differ diff --git a/skin/boxee/media/browse/thumbnail-default-music.png b/skin/boxee/media/browse/thumbnail-default-music.png new file mode 100644 index 00000000..3bb54a51 Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-default-music.png differ diff --git a/skin/boxee/media/browse/thumbnail-default-photo.png b/skin/boxee/media/browse/thumbnail-default-photo.png new file mode 100644 index 00000000..85b7ab16 Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-default-photo.png differ diff --git a/skin/boxee/media/browse/thumbnail-default-show.png b/skin/boxee/media/browse/thumbnail-default-show.png new file mode 100644 index 00000000..25223565 Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-default-show.png differ diff --git a/skin/boxee/media/browse/thumbnail-movie-watched-grid-scanlines.png b/skin/boxee/media/browse/thumbnail-movie-watched-grid-scanlines.png new file mode 100644 index 00000000..8d173518 Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-movie-watched-grid-scanlines.png differ diff --git a/skin/boxee/media/browse/thumbnail-movie-watched-list-scanlines.png b/skin/boxee/media/browse/thumbnail-movie-watched-list-scanlines.png new file mode 100644 index 00000000..5439592b Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-movie-watched-list-scanlines.png differ diff --git a/skin/boxee/media/browse/thumbnail-watched-episode-scanlines.png b/skin/boxee/media/browse/thumbnail-watched-episode-scanlines.png new file mode 100644 index 00000000..a2cfa08d Binary files /dev/null and b/skin/boxee/media/browse/thumbnail-watched-episode-scanlines.png differ diff --git a/skin/boxee/media/browse_line_feather.png b/skin/boxee/media/browse_line_feather.png new file mode 100644 index 00000000..87770554 Binary files /dev/null and b/skin/boxee/media/browse_line_feather.png differ diff --git a/skin/boxee/media/browse_line_focus.png b/skin/boxee/media/browse_line_focus.png new file mode 100644 index 00000000..eedeed5b Binary files /dev/null and b/skin/boxee/media/browse_line_focus.png differ diff --git a/skin/boxee/media/browse_menu_dialog_background.png b/skin/boxee/media/browse_menu_dialog_background.png new file mode 100644 index 00000000..eedeed5b Binary files /dev/null and b/skin/boxee/media/browse_menu_dialog_background.png differ diff --git a/skin/boxee/media/browse_menu_dialog_button.png b/skin/boxee/media/browse_menu_dialog_button.png new file mode 100644 index 00000000..8bf28891 Binary files /dev/null and b/skin/boxee/media/browse_menu_dialog_button.png differ diff --git a/skin/boxee/media/browse_menu_dialog_button_focus.png b/skin/boxee/media/browse_menu_dialog_button_focus.png new file mode 100644 index 00000000..d4ae0fca Binary files /dev/null and b/skin/boxee/media/browse_menu_dialog_button_focus.png differ diff --git a/skin/boxee/media/browse_menu_dialog_button_focus2.png b/skin/boxee/media/browse_menu_dialog_button_focus2.png new file mode 100644 index 00000000..8bef90f2 Binary files /dev/null and b/skin/boxee/media/browse_menu_dialog_button_focus2.png differ diff --git a/skin/boxee/media/browse_menu_dialog_edit.png b/skin/boxee/media/browse_menu_dialog_edit.png new file mode 100644 index 00000000..d45a0ee9 Binary files /dev/null and b/skin/boxee/media/browse_menu_dialog_edit.png differ diff --git a/skin/boxee/media/browse_menu_dialog_edit_focus.png b/skin/boxee/media/browse_menu_dialog_edit_focus.png new file mode 100644 index 00000000..f74a6429 Binary files /dev/null and b/skin/boxee/media/browse_menu_dialog_edit_focus.png differ diff --git a/skin/boxee/media/browser/browser-bookmark-thumbnail-bg.png b/skin/boxee/media/browser/browser-bookmark-thumbnail-bg.png new file mode 100644 index 00000000..a54a6d62 Binary files /dev/null and b/skin/boxee/media/browser/browser-bookmark-thumbnail-bg.png differ diff --git a/skin/boxee/media/browser/button-action-bg-destructive.png b/skin/boxee/media/browser/button-action-bg-destructive.png new file mode 100644 index 00000000..69b3ab16 Binary files /dev/null and b/skin/boxee/media/browser/button-action-bg-destructive.png differ diff --git a/skin/boxee/media/browser/button-action-bookmarks-off.png b/skin/boxee/media/browser/button-action-bookmarks-off.png new file mode 100644 index 00000000..fa632a40 Binary files /dev/null and b/skin/boxee/media/browser/button-action-bookmarks-off.png differ diff --git a/skin/boxee/media/browser/button-action-bookmarks-on.png b/skin/boxee/media/browser/button-action-bookmarks-on.png new file mode 100644 index 00000000..aa439171 Binary files /dev/null and b/skin/boxee/media/browser/button-action-bookmarks-on.png differ diff --git a/skin/boxee/media/browser/button-action-disabled-overlay.png b/skin/boxee/media/browser/button-action-disabled-overlay.png new file mode 100644 index 00000000..7eb8b33f Binary files /dev/null and b/skin/boxee/media/browser/button-action-disabled-overlay.png differ diff --git a/skin/boxee/media/browser/button-action-favorite-add-off.png b/skin/boxee/media/browser/button-action-favorite-add-off.png new file mode 100644 index 00000000..de4692cc Binary files /dev/null and b/skin/boxee/media/browser/button-action-favorite-add-off.png differ diff --git a/skin/boxee/media/browser/button-action-favorite-add-on.png b/skin/boxee/media/browser/button-action-favorite-add-on.png new file mode 100644 index 00000000..474b3bca Binary files /dev/null and b/skin/boxee/media/browser/button-action-favorite-add-on.png differ diff --git a/skin/boxee/media/browser/button-action-favorite-edit-active.png b/skin/boxee/media/browser/button-action-favorite-edit-active.png new file mode 100644 index 00000000..7cf6c49b Binary files /dev/null and b/skin/boxee/media/browser/button-action-favorite-edit-active.png differ diff --git a/skin/boxee/media/browser/button-action-favorite-edit-off.png b/skin/boxee/media/browser/button-action-favorite-edit-off.png new file mode 100644 index 00000000..f34cacc4 Binary files /dev/null and b/skin/boxee/media/browser/button-action-favorite-edit-off.png differ diff --git a/skin/boxee/media/browser/button-action-favorite-edit-on.png b/skin/boxee/media/browser/button-action-favorite-edit-on.png new file mode 100644 index 00000000..f24073aa Binary files /dev/null and b/skin/boxee/media/browser/button-action-favorite-edit-on.png differ diff --git a/skin/boxee/media/browser/button-action-favorite-remove-off.png b/skin/boxee/media/browser/button-action-favorite-remove-off.png new file mode 100644 index 00000000..cda339d7 Binary files /dev/null and b/skin/boxee/media/browser/button-action-favorite-remove-off.png differ diff --git a/skin/boxee/media/browser/button-action-favorite-remove-on.png b/skin/boxee/media/browser/button-action-favorite-remove-on.png new file mode 100644 index 00000000..fa5187f0 Binary files /dev/null and b/skin/boxee/media/browser/button-action-favorite-remove-on.png differ diff --git a/skin/boxee/media/browser/button-action-favorite-share-off.png b/skin/boxee/media/browser/button-action-favorite-share-off.png new file mode 100644 index 00000000..cca638e6 Binary files /dev/null and b/skin/boxee/media/browser/button-action-favorite-share-off.png differ diff --git a/skin/boxee/media/browser/button-action-favorite-share-on.png b/skin/boxee/media/browser/button-action-favorite-share-on.png new file mode 100644 index 00000000..1916d03e Binary files /dev/null and b/skin/boxee/media/browser/button-action-favorite-share-on.png differ diff --git a/skin/boxee/media/browser/button-action-history-off.png b/skin/boxee/media/browser/button-action-history-off.png new file mode 100644 index 00000000..5415553d Binary files /dev/null and b/skin/boxee/media/browser/button-action-history-off.png differ diff --git a/skin/boxee/media/browser/button-action-history-on.png b/skin/boxee/media/browser/button-action-history-on.png new file mode 100644 index 00000000..5d04b623 Binary files /dev/null and b/skin/boxee/media/browser/button-action-history-on.png differ diff --git a/skin/boxee/media/browser/button-action-nav-back-off.png b/skin/boxee/media/browser/button-action-nav-back-off.png new file mode 100644 index 00000000..30321d82 Binary files /dev/null and b/skin/boxee/media/browser/button-action-nav-back-off.png differ diff --git a/skin/boxee/media/browser/button-action-nav-back-on.png b/skin/boxee/media/browser/button-action-nav-back-on.png new file mode 100644 index 00000000..39c51826 Binary files /dev/null and b/skin/boxee/media/browser/button-action-nav-back-on.png differ diff --git a/skin/boxee/media/browser/button-action-nav-forward-off.png b/skin/boxee/media/browser/button-action-nav-forward-off.png new file mode 100644 index 00000000..698cee25 Binary files /dev/null and b/skin/boxee/media/browser/button-action-nav-forward-off.png differ diff --git a/skin/boxee/media/browser/button-action-nav-forward-on.png b/skin/boxee/media/browser/button-action-nav-forward-on.png new file mode 100644 index 00000000..bd08366b Binary files /dev/null and b/skin/boxee/media/browser/button-action-nav-forward-on.png differ diff --git a/skin/boxee/media/browser/default_portrait_bookmark.png b/skin/boxee/media/browser/default_portrait_bookmark.png new file mode 100644 index 00000000..8a1b0128 Binary files /dev/null and b/skin/boxee/media/browser/default_portrait_bookmark.png differ diff --git a/skin/boxee/media/browser/graphic-browser-bg.png b/skin/boxee/media/browser/graphic-browser-bg.png new file mode 100644 index 00000000..7f69b6fe Binary files /dev/null and b/skin/boxee/media/browser/graphic-browser-bg.png differ diff --git a/skin/boxee/media/browser/graphic-bullet.png b/skin/boxee/media/browser/graphic-bullet.png new file mode 100644 index 00000000..7f580d07 Binary files /dev/null and b/skin/boxee/media/browser/graphic-bullet.png differ diff --git a/skin/boxee/media/browser/graphic-scrollbar.png b/skin/boxee/media/browser/graphic-scrollbar.png new file mode 100644 index 00000000..6f0e8b94 Binary files /dev/null and b/skin/boxee/media/browser/graphic-scrollbar.png differ diff --git a/skin/boxee/media/button-facebook-connect-focused.png b/skin/boxee/media/button-facebook-connect-focused.png new file mode 100644 index 00000000..d917a8a6 Binary files /dev/null and b/skin/boxee/media/button-facebook-connect-focused.png differ diff --git a/skin/boxee/media/button-facebook-connect-unfocused.png b/skin/boxee/media/button-facebook-connect-unfocused.png new file mode 100644 index 00000000..6fcbc624 Binary files /dev/null and b/skin/boxee/media/button-facebook-connect-unfocused.png differ diff --git a/skin/boxee/media/button-facebook-sign-in-focused.png b/skin/boxee/media/button-facebook-sign-in-focused.png new file mode 100644 index 00000000..6a204985 Binary files /dev/null and b/skin/boxee/media/button-facebook-sign-in-focused.png differ diff --git a/skin/boxee/media/button-facebook-sign-in-unfocused.png b/skin/boxee/media/button-facebook-sign-in-unfocused.png new file mode 100644 index 00000000..065e8add Binary files /dev/null and b/skin/boxee/media/button-facebook-sign-in-unfocused.png differ diff --git a/skin/boxee/media/button-focused.png b/skin/boxee/media/button-focused.png new file mode 100644 index 00000000..1a563123 Binary files /dev/null and b/skin/boxee/media/button-focused.png differ diff --git a/skin/boxee/media/button-on.png b/skin/boxee/media/button-on.png new file mode 100644 index 00000000..91594359 Binary files /dev/null and b/skin/boxee/media/button-on.png differ diff --git a/skin/boxee/media/button-star-off-focused.png b/skin/boxee/media/button-star-off-focused.png new file mode 100644 index 00000000..474b3bca Binary files /dev/null and b/skin/boxee/media/button-star-off-focused.png differ diff --git a/skin/boxee/media/button-star-off-unfocused.png b/skin/boxee/media/button-star-off-unfocused.png new file mode 100644 index 00000000..de4692cc Binary files /dev/null and b/skin/boxee/media/button-star-off-unfocused.png differ diff --git a/skin/boxee/media/button-star-on-focused.png b/skin/boxee/media/button-star-on-focused.png new file mode 100644 index 00000000..a4dbca81 Binary files /dev/null and b/skin/boxee/media/button-star-on-focused.png differ diff --git a/skin/boxee/media/button-star-on-unfocused.png b/skin/boxee/media/button-star-on-unfocused.png new file mode 100644 index 00000000..1102caa0 Binary files /dev/null and b/skin/boxee/media/button-star-on-unfocused.png differ diff --git a/skin/boxee/media/button-tumblr-connect-focused.png b/skin/boxee/media/button-tumblr-connect-focused.png new file mode 100644 index 00000000..5ebaa95f Binary files /dev/null and b/skin/boxee/media/button-tumblr-connect-focused.png differ diff --git a/skin/boxee/media/button-tumblr-connect-unfocused.png b/skin/boxee/media/button-tumblr-connect-unfocused.png new file mode 100644 index 00000000..b151d2a0 Binary files /dev/null and b/skin/boxee/media/button-tumblr-connect-unfocused.png differ diff --git a/skin/boxee/media/button-twitter-connect-focused.png b/skin/boxee/media/button-twitter-connect-focused.png new file mode 100644 index 00000000..fee1f8a1 Binary files /dev/null and b/skin/boxee/media/button-twitter-connect-focused.png differ diff --git a/skin/boxee/media/button-twitter-connect-unfocused.png b/skin/boxee/media/button-twitter-connect-unfocused.png new file mode 100644 index 00000000..cb7b7e46 Binary files /dev/null and b/skin/boxee/media/button-twitter-connect-unfocused.png differ diff --git a/skin/boxee/media/button-unfocused.png b/skin/boxee/media/button-unfocused.png new file mode 100644 index 00000000..29aeb6d2 Binary files /dev/null and b/skin/boxee/media/button-unfocused.png differ diff --git a/skin/boxee/media/button_16_pixel.png b/skin/boxee/media/button_16_pixel.png new file mode 100644 index 00000000..a5ba5699 Binary files /dev/null and b/skin/boxee/media/button_16_pixel.png differ diff --git a/skin/boxee/media/button_16_pixel_B.png b/skin/boxee/media/button_16_pixel_B.png new file mode 100644 index 00000000..e2f41b2d Binary files /dev/null and b/skin/boxee/media/button_16_pixel_B.png differ diff --git a/skin/boxee/media/button_16_pixel_BL.png b/skin/boxee/media/button_16_pixel_BL.png new file mode 100644 index 00000000..ad42eb33 Binary files /dev/null and b/skin/boxee/media/button_16_pixel_BL.png differ diff --git a/skin/boxee/media/button_16_pixel_BR.png b/skin/boxee/media/button_16_pixel_BR.png new file mode 100644 index 00000000..ab92cb4d Binary files /dev/null and b/skin/boxee/media/button_16_pixel_BR.png differ diff --git a/skin/boxee/media/button_16_pixel_L.png b/skin/boxee/media/button_16_pixel_L.png new file mode 100644 index 00000000..8ac3302b Binary files /dev/null and b/skin/boxee/media/button_16_pixel_L.png differ diff --git a/skin/boxee/media/button_16_pixel_R.png b/skin/boxee/media/button_16_pixel_R.png new file mode 100644 index 00000000..3a8eb9c6 Binary files /dev/null and b/skin/boxee/media/button_16_pixel_R.png differ diff --git a/skin/boxee/media/button_16_pixel_T.png b/skin/boxee/media/button_16_pixel_T.png new file mode 100644 index 00000000..3c575eb1 Binary files /dev/null and b/skin/boxee/media/button_16_pixel_T.png differ diff --git a/skin/boxee/media/button_16_pixel_TL.png b/skin/boxee/media/button_16_pixel_TL.png new file mode 100644 index 00000000..a224aab0 Binary files /dev/null and b/skin/boxee/media/button_16_pixel_TL.png differ diff --git a/skin/boxee/media/button_16_pixel_TR.png b/skin/boxee/media/button_16_pixel_TR.png new file mode 100644 index 00000000..24844277 Binary files /dev/null and b/skin/boxee/media/button_16_pixel_TR.png differ diff --git a/skin/boxee/media/button_250x98_BL.png b/skin/boxee/media/button_250x98_BL.png new file mode 100644 index 00000000..06085214 Binary files /dev/null and b/skin/boxee/media/button_250x98_BL.png differ diff --git a/skin/boxee/media/button_250x98_L.png b/skin/boxee/media/button_250x98_L.png new file mode 100644 index 00000000..e672498d Binary files /dev/null and b/skin/boxee/media/button_250x98_L.png differ diff --git a/skin/boxee/media/button_250x98_TL.png b/skin/boxee/media/button_250x98_TL.png new file mode 100644 index 00000000..1119197a Binary files /dev/null and b/skin/boxee/media/button_250x98_TL.png differ diff --git a/skin/boxee/media/button_4_pixel.png b/skin/boxee/media/button_4_pixel.png new file mode 100644 index 00000000..f457b74c Binary files /dev/null and b/skin/boxee/media/button_4_pixel.png differ diff --git a/skin/boxee/media/button_8_pixel.png b/skin/boxee/media/button_8_pixel.png new file mode 100644 index 00000000..70f1aa79 Binary files /dev/null and b/skin/boxee/media/button_8_pixel.png differ diff --git a/skin/boxee/media/button_blank.png b/skin/boxee/media/button_blank.png new file mode 100644 index 00000000..ffbc0c4c Binary files /dev/null and b/skin/boxee/media/button_blank.png differ diff --git a/skin/boxee/media/button_blank_bottom.png b/skin/boxee/media/button_blank_bottom.png new file mode 100644 index 00000000..79ec7ba5 Binary files /dev/null and b/skin/boxee/media/button_blank_bottom.png differ diff --git a/skin/boxee/media/button_blank_center.png b/skin/boxee/media/button_blank_center.png new file mode 100644 index 00000000..f9294b89 Binary files /dev/null and b/skin/boxee/media/button_blank_center.png differ diff --git a/skin/boxee/media/button_blank_center_white.png b/skin/boxee/media/button_blank_center_white.png new file mode 100644 index 00000000..931ffb6b Binary files /dev/null and b/skin/boxee/media/button_blank_center_white.png differ diff --git a/skin/boxee/media/button_blank_top.png b/skin/boxee/media/button_blank_top.png new file mode 100644 index 00000000..0b9815fb Binary files /dev/null and b/skin/boxee/media/button_blank_top.png differ diff --git a/skin/boxee/media/button_clickable.png b/skin/boxee/media/button_clickable.png new file mode 100644 index 00000000..0766559b Binary files /dev/null and b/skin/boxee/media/button_clickable.png differ diff --git a/skin/boxee/media/button_clickable_on.png b/skin/boxee/media/button_clickable_on.png new file mode 100644 index 00000000..e20e1cc8 Binary files /dev/null and b/skin/boxee/media/button_clickable_on.png differ diff --git a/skin/boxee/media/button_keyboard.png b/skin/boxee/media/button_keyboard.png new file mode 100644 index 00000000..49c9d9fa Binary files /dev/null and b/skin/boxee/media/button_keyboard.png differ diff --git a/skin/boxee/media/button_keyboard_off_black.png b/skin/boxee/media/button_keyboard_off_black.png new file mode 100644 index 00000000..68341903 Binary files /dev/null and b/skin/boxee/media/button_keyboard_off_black.png differ diff --git a/skin/boxee/media/button_keyboard_toggle_off.png b/skin/boxee/media/button_keyboard_toggle_off.png new file mode 100644 index 00000000..9beaab97 Binary files /dev/null and b/skin/boxee/media/button_keyboard_toggle_off.png differ diff --git a/skin/boxee/media/button_keyboard_toggle_on.png b/skin/boxee/media/button_keyboard_toggle_on.png new file mode 100644 index 00000000..9beaab97 Binary files /dev/null and b/skin/boxee/media/button_keyboard_toggle_on.png differ diff --git a/skin/boxee/media/button_social_share_selection.png b/skin/boxee/media/button_social_share_selection.png new file mode 100644 index 00000000..7799975c Binary files /dev/null and b/skin/boxee/media/button_social_share_selection.png differ diff --git a/skin/boxee/media/buttons/button-osd-bookmarks-off.png b/skin/boxee/media/buttons/button-osd-bookmarks-off.png new file mode 100644 index 00000000..329d011f Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-bookmarks-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-bookmarks-on.png b/skin/boxee/media/buttons/button-osd-bookmarks-on.png new file mode 100644 index 00000000..b1185d41 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-bookmarks-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-cc-off.png b/skin/boxee/media/buttons/button-osd-cc-off.png new file mode 100644 index 00000000..65d95f54 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-cc-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-cc-on.png b/skin/boxee/media/buttons/button-osd-cc-on.png new file mode 100644 index 00000000..ad0028b4 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-cc-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-cursor-off.png b/skin/boxee/media/buttons/button-osd-cursor-off.png new file mode 100644 index 00000000..84dcebeb Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-cursor-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-cursor-on.png b/skin/boxee/media/buttons/button-osd-cursor-on.png new file mode 100644 index 00000000..983ed871 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-cursor-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-guide-off.png b/skin/boxee/media/buttons/button-osd-guide-off.png new file mode 100644 index 00000000..617f5e52 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-guide-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-guide-on.png b/skin/boxee/media/buttons/button-osd-guide-on.png new file mode 100644 index 00000000..e7821c45 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-guide-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-info-off.png b/skin/boxee/media/buttons/button-osd-info-off.png new file mode 100644 index 00000000..733b585c Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-info-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-info-on.png b/skin/boxee/media/buttons/button-osd-info-on.png new file mode 100644 index 00000000..31d34a0d Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-info-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-minimize-off.png b/skin/boxee/media/buttons/button-osd-minimize-off.png new file mode 100644 index 00000000..00ff8316 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-minimize-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-minimize-on.png b/skin/boxee/media/buttons/button-osd-minimize-on.png new file mode 100644 index 00000000..513f11ad Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-minimize-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-next-off.png b/skin/boxee/media/buttons/button-osd-next-off.png new file mode 100644 index 00000000..3d8b9185 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-next-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-next-on.png b/skin/boxee/media/buttons/button-osd-next-on.png new file mode 100644 index 00000000..9269e0f1 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-next-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-pause-off.png b/skin/boxee/media/buttons/button-osd-pause-off.png new file mode 100644 index 00000000..a6cd6257 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-pause-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-pause-on.png b/skin/boxee/media/buttons/button-osd-pause-on.png new file mode 100644 index 00000000..f3f222eb Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-pause-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-play-off.png b/skin/boxee/media/buttons/button-osd-play-off.png new file mode 100644 index 00000000..f2b80502 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-play-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-play-on.png b/skin/boxee/media/buttons/button-osd-play-on.png new file mode 100644 index 00000000..3439c94b Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-play-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-previous-off.png b/skin/boxee/media/buttons/button-osd-previous-off.png new file mode 100644 index 00000000..bf560664 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-previous-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-previous-on.png b/skin/boxee/media/buttons/button-osd-previous-on.png new file mode 100644 index 00000000..5208cf7c Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-previous-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-quality-hd-off.png b/skin/boxee/media/buttons/button-osd-quality-hd-off.png new file mode 100644 index 00000000..d510a2e4 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-quality-hd-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-quality-hd-on-off.png b/skin/boxee/media/buttons/button-osd-quality-hd-on-off.png new file mode 100644 index 00000000..3e978683 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-quality-hd-on-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-quality-hd-on-on.png b/skin/boxee/media/buttons/button-osd-quality-hd-on-on.png new file mode 100644 index 00000000..66e3439d Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-quality-hd-on-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-quality-hd-on.png b/skin/boxee/media/buttons/button-osd-quality-hd-on.png new file mode 100644 index 00000000..e0843f8a Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-quality-hd-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-repeat-all-off.png b/skin/boxee/media/buttons/button-osd-repeat-all-off.png new file mode 100644 index 00000000..08defbcf Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-repeat-all-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-repeat-all-on.png b/skin/boxee/media/buttons/button-osd-repeat-all-on.png new file mode 100644 index 00000000..7b4080f9 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-repeat-all-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-repeat-none-off.png b/skin/boxee/media/buttons/button-osd-repeat-none-off.png new file mode 100644 index 00000000..21345258 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-repeat-none-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-repeat-none-on.png b/skin/boxee/media/buttons/button-osd-repeat-none-on.png new file mode 100644 index 00000000..3a9b3209 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-repeat-none-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-repeat-one-off.png b/skin/boxee/media/buttons/button-osd-repeat-one-off.png new file mode 100644 index 00000000..404f6382 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-repeat-one-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-repeat-one-on.png b/skin/boxee/media/buttons/button-osd-repeat-one-on.png new file mode 100644 index 00000000..c1f9af1d Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-repeat-one-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-rotate-off.png b/skin/boxee/media/buttons/button-osd-rotate-off.png new file mode 100644 index 00000000..d607e4f3 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-rotate-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-rotate-on.png b/skin/boxee/media/buttons/button-osd-rotate-on.png new file mode 100644 index 00000000..3ff26f34 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-rotate-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-settings-off.png b/skin/boxee/media/buttons/button-osd-settings-off.png new file mode 100644 index 00000000..b9b9c909 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-settings-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-settings-on.png b/skin/boxee/media/buttons/button-osd-settings-on.png new file mode 100644 index 00000000..a53dfaba Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-settings-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-share-off.png b/skin/boxee/media/buttons/button-osd-share-off.png new file mode 100644 index 00000000..cca638e6 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-share-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-share-on.png b/skin/boxee/media/buttons/button-osd-share-on.png new file mode 100644 index 00000000..1916d03e Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-share-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-shuffle-off.png b/skin/boxee/media/buttons/button-osd-shuffle-off.png new file mode 100644 index 00000000..f99742c2 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-shuffle-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-shuffle-on.png b/skin/boxee/media/buttons/button-osd-shuffle-on.png new file mode 100644 index 00000000..70544dce Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-shuffle-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-stop-off.png b/skin/boxee/media/buttons/button-osd-stop-off.png new file mode 100644 index 00000000..9b819d77 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-stop-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-stop-on.png b/skin/boxee/media/buttons/button-osd-stop-on.png new file mode 100644 index 00000000..307a3690 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-stop-on.png differ diff --git a/skin/boxee/media/buttons/button-osd-unshuffle-off.png b/skin/boxee/media/buttons/button-osd-unshuffle-off.png new file mode 100644 index 00000000..6311b229 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-unshuffle-off.png differ diff --git a/skin/boxee/media/buttons/button-osd-unshuffle-on.png b/skin/boxee/media/buttons/button-osd-unshuffle-on.png new file mode 100644 index 00000000..b33366e5 Binary files /dev/null and b/skin/boxee/media/buttons/button-osd-unshuffle-on.png differ diff --git a/skin/boxee/media/buttons/button-share-check-off.png b/skin/boxee/media/buttons/button-share-check-off.png new file mode 100644 index 00000000..ddfae2cc Binary files /dev/null and b/skin/boxee/media/buttons/button-share-check-off.png differ diff --git a/skin/boxee/media/buttons/button-share-check-on.png b/skin/boxee/media/buttons/button-share-check-on.png new file mode 100644 index 00000000..a6e697f2 Binary files /dev/null and b/skin/boxee/media/buttons/button-share-check-on.png differ diff --git a/skin/boxee/media/buttons/button-share-facebook-off.png b/skin/boxee/media/buttons/button-share-facebook-off.png new file mode 100644 index 00000000..b452c020 Binary files /dev/null and b/skin/boxee/media/buttons/button-share-facebook-off.png differ diff --git a/skin/boxee/media/buttons/button-share-facebook-on.png b/skin/boxee/media/buttons/button-share-facebook-on.png new file mode 100644 index 00000000..1306e705 Binary files /dev/null and b/skin/boxee/media/buttons/button-share-facebook-on.png differ diff --git a/skin/boxee/media/buttons/button-share-tumblr-off.png b/skin/boxee/media/buttons/button-share-tumblr-off.png new file mode 100644 index 00000000..db2a1170 Binary files /dev/null and b/skin/boxee/media/buttons/button-share-tumblr-off.png differ diff --git a/skin/boxee/media/buttons/button-share-tumblr-on.png b/skin/boxee/media/buttons/button-share-tumblr-on.png new file mode 100644 index 00000000..5bd3d224 Binary files /dev/null and b/skin/boxee/media/buttons/button-share-tumblr-on.png differ diff --git a/skin/boxee/media/buttons/button-share-twitter-off.png b/skin/boxee/media/buttons/button-share-twitter-off.png new file mode 100644 index 00000000..41c07c2e Binary files /dev/null and b/skin/boxee/media/buttons/button-share-twitter-off.png differ diff --git a/skin/boxee/media/buttons/button-share-twitter-on.png b/skin/boxee/media/buttons/button-share-twitter-on.png new file mode 100644 index 00000000..52d60a4a Binary files /dev/null and b/skin/boxee/media/buttons/button-share-twitter-on.png differ diff --git a/skin/boxee/media/buttons/display-focused-off.png b/skin/boxee/media/buttons/display-focused-off.png new file mode 100644 index 00000000..a8c7a49d Binary files /dev/null and b/skin/boxee/media/buttons/display-focused-off.png differ diff --git a/skin/boxee/media/buttons/display-focused-on.png b/skin/boxee/media/buttons/display-focused-on.png new file mode 100644 index 00000000..694f27a6 Binary files /dev/null and b/skin/boxee/media/buttons/display-focused-on.png differ diff --git a/skin/boxee/media/buttons/display-unfocused-off.png b/skin/boxee/media/buttons/display-unfocused-off.png new file mode 100644 index 00000000..abb53ac5 Binary files /dev/null and b/skin/boxee/media/buttons/display-unfocused-off.png differ diff --git a/skin/boxee/media/buttons/display-unfocused-on.png b/skin/boxee/media/buttons/display-unfocused-on.png new file mode 100644 index 00000000..966458cc Binary files /dev/null and b/skin/boxee/media/buttons/display-unfocused-on.png differ diff --git a/skin/boxee/media/calibrate-bottomright-image.png b/skin/boxee/media/calibrate-bottomright-image.png new file mode 100644 index 00000000..61cdc9e9 Binary files /dev/null and b/skin/boxee/media/calibrate-bottomright-image.png differ diff --git a/skin/boxee/media/calibrate-topleft-image.png b/skin/boxee/media/calibrate-topleft-image.png new file mode 100644 index 00000000..afe0f5d5 Binary files /dev/null and b/skin/boxee/media/calibrate-topleft-image.png differ diff --git a/skin/boxee/media/calibrate-validate-image.png b/skin/boxee/media/calibrate-validate-image.png new file mode 100644 index 00000000..a4444ad2 Binary files /dev/null and b/skin/boxee/media/calibrate-validate-image.png differ diff --git a/skin/boxee/media/check.png b/skin/boxee/media/check.png new file mode 100644 index 00000000..efe23852 Binary files /dev/null and b/skin/boxee/media/check.png differ diff --git a/skin/boxee/media/colors/color-black.png b/skin/boxee/media/colors/color-black.png new file mode 100644 index 00000000..08ad23b4 Binary files /dev/null and b/skin/boxee/media/colors/color-black.png differ diff --git a/skin/boxee/media/colors/color-blue.png b/skin/boxee/media/colors/color-blue.png new file mode 100644 index 00000000..c917d7a2 Binary files /dev/null and b/skin/boxee/media/colors/color-blue.png differ diff --git a/skin/boxee/media/colors/color-green.png b/skin/boxee/media/colors/color-green.png new file mode 100644 index 00000000..9b73a9a6 Binary files /dev/null and b/skin/boxee/media/colors/color-green.png differ diff --git a/skin/boxee/media/colors/color-grey.png b/skin/boxee/media/colors/color-grey.png new file mode 100644 index 00000000..a80ca313 Binary files /dev/null and b/skin/boxee/media/colors/color-grey.png differ diff --git a/skin/boxee/media/colors/color-keyboard.png b/skin/boxee/media/colors/color-keyboard.png new file mode 100644 index 00000000..b358472f Binary files /dev/null and b/skin/boxee/media/colors/color-keyboard.png differ diff --git a/skin/boxee/media/colors/color-orange.png b/skin/boxee/media/colors/color-orange.png new file mode 100644 index 00000000..aeb89344 Binary files /dev/null and b/skin/boxee/media/colors/color-orange.png differ diff --git a/skin/boxee/media/colors/color-red.png b/skin/boxee/media/colors/color-red.png new file mode 100644 index 00000000..21036b0b Binary files /dev/null and b/skin/boxee/media/colors/color-red.png differ diff --git a/skin/boxee/media/colors/color-white.png b/skin/boxee/media/colors/color-white.png new file mode 100644 index 00000000..d959f328 Binary files /dev/null and b/skin/boxee/media/colors/color-white.png differ diff --git a/skin/boxee/media/default_file.png b/skin/boxee/media/default_file.png new file mode 100644 index 00000000..162d22de Binary files /dev/null and b/skin/boxee/media/default_file.png differ diff --git a/skin/boxee/media/default_music_sq.png b/skin/boxee/media/default_music_sq.png new file mode 100644 index 00000000..af6b15b2 Binary files /dev/null and b/skin/boxee/media/default_music_sq.png differ diff --git a/skin/boxee/media/default_user.png b/skin/boxee/media/default_user.png new file mode 100644 index 00000000..55eaccff Binary files /dev/null and b/skin/boxee/media/default_user.png differ diff --git a/skin/boxee/media/device_pairing_code_0.png b/skin/boxee/media/device_pairing_code_0.png new file mode 100644 index 00000000..7b6eda38 Binary files /dev/null and b/skin/boxee/media/device_pairing_code_0.png differ diff --git a/skin/boxee/media/device_pairing_code_1.png b/skin/boxee/media/device_pairing_code_1.png new file mode 100644 index 00000000..2624fc9b Binary files /dev/null and b/skin/boxee/media/device_pairing_code_1.png differ diff --git a/skin/boxee/media/device_pairing_code_2.png b/skin/boxee/media/device_pairing_code_2.png new file mode 100644 index 00000000..346c674e Binary files /dev/null and b/skin/boxee/media/device_pairing_code_2.png differ diff --git a/skin/boxee/media/device_pairing_code_3.png b/skin/boxee/media/device_pairing_code_3.png new file mode 100644 index 00000000..cde81c37 Binary files /dev/null and b/skin/boxee/media/device_pairing_code_3.png differ diff --git a/skin/boxee/media/device_pairing_code_4.png b/skin/boxee/media/device_pairing_code_4.png new file mode 100644 index 00000000..a141bcf5 Binary files /dev/null and b/skin/boxee/media/device_pairing_code_4.png differ diff --git a/skin/boxee/media/device_pairing_code_5.png b/skin/boxee/media/device_pairing_code_5.png new file mode 100644 index 00000000..bb2da8fc Binary files /dev/null and b/skin/boxee/media/device_pairing_code_5.png differ diff --git a/skin/boxee/media/device_pairing_code_6.png b/skin/boxee/media/device_pairing_code_6.png new file mode 100644 index 00000000..6b12abca Binary files /dev/null and b/skin/boxee/media/device_pairing_code_6.png differ diff --git a/skin/boxee/media/device_pairing_code_7.png b/skin/boxee/media/device_pairing_code_7.png new file mode 100644 index 00000000..86881b9f Binary files /dev/null and b/skin/boxee/media/device_pairing_code_7.png differ diff --git a/skin/boxee/media/device_pairing_code_8.png b/skin/boxee/media/device_pairing_code_8.png new file mode 100644 index 00000000..841b452b Binary files /dev/null and b/skin/boxee/media/device_pairing_code_8.png differ diff --git a/skin/boxee/media/device_pairing_code_9.png b/skin/boxee/media/device_pairing_code_9.png new file mode 100644 index 00000000..04e75b92 Binary files /dev/null and b/skin/boxee/media/device_pairing_code_9.png differ diff --git a/skin/boxee/media/dialog_bg.png b/skin/boxee/media/dialog_bg.png new file mode 100644 index 00000000..b5be00ee Binary files /dev/null and b/skin/boxee/media/dialog_bg.png differ diff --git a/skin/boxee/media/dialog_bg_3.png b/skin/boxee/media/dialog_bg_3.png new file mode 100644 index 00000000..0610cc1d Binary files /dev/null and b/skin/boxee/media/dialog_bg_3.png differ diff --git a/skin/boxee/media/dialog_overlay.png b/skin/boxee/media/dialog_overlay.png new file mode 100644 index 00000000..17d4ef9c Binary files /dev/null and b/skin/boxee/media/dialog_overlay.png differ diff --git a/skin/boxee/media/dropdown_sort_bottom.png b/skin/boxee/media/dropdown_sort_bottom.png new file mode 100644 index 00000000..d00edeba Binary files /dev/null and b/skin/boxee/media/dropdown_sort_bottom.png differ diff --git a/skin/boxee/media/dropdown_sort_top.png b/skin/boxee/media/dropdown_sort_top.png new file mode 100644 index 00000000..ea2c22dd Binary files /dev/null and b/skin/boxee/media/dropdown_sort_top.png differ diff --git a/skin/boxee/media/error.png b/skin/boxee/media/error.png new file mode 100644 index 00000000..ec253bbc Binary files /dev/null and b/skin/boxee/media/error.png differ diff --git a/skin/boxee/media/ftu/graphic-calibrate-arrow-1-off.png b/skin/boxee/media/ftu/graphic-calibrate-arrow-1-off.png new file mode 100644 index 00000000..0dc0f45e Binary files /dev/null and b/skin/boxee/media/ftu/graphic-calibrate-arrow-1-off.png differ diff --git a/skin/boxee/media/ftu/graphic-calibrate-arrow-1-on.png b/skin/boxee/media/ftu/graphic-calibrate-arrow-1-on.png new file mode 100644 index 00000000..a17be515 Binary files /dev/null and b/skin/boxee/media/ftu/graphic-calibrate-arrow-1-on.png differ diff --git a/skin/boxee/media/ftu/graphic-calibrate-arrow-2-off.png b/skin/boxee/media/ftu/graphic-calibrate-arrow-2-off.png new file mode 100644 index 00000000..ddb020ac Binary files /dev/null and b/skin/boxee/media/ftu/graphic-calibrate-arrow-2-off.png differ diff --git a/skin/boxee/media/ftu/graphic-calibrate-arrow-2-on.png b/skin/boxee/media/ftu/graphic-calibrate-arrow-2-on.png new file mode 100644 index 00000000..7dcac0b2 Binary files /dev/null and b/skin/boxee/media/ftu/graphic-calibrate-arrow-2-on.png differ diff --git a/skin/boxee/media/ftu/graphic-calibrate-tv-1.png b/skin/boxee/media/ftu/graphic-calibrate-tv-1.png new file mode 100644 index 00000000..91094ca1 Binary files /dev/null and b/skin/boxee/media/ftu/graphic-calibrate-tv-1.png differ diff --git a/skin/boxee/media/ftu/graphic-calibrate-tv-2.png b/skin/boxee/media/ftu/graphic-calibrate-tv-2.png new file mode 100644 index 00000000..4dfd98f1 Binary files /dev/null and b/skin/boxee/media/ftu/graphic-calibrate-tv-2.png differ diff --git a/skin/boxee/media/ftu/graphic-calibrate-tv-frame.png b/skin/boxee/media/ftu/graphic-calibrate-tv-frame.png new file mode 100644 index 00000000..b5b17b8d Binary files /dev/null and b/skin/boxee/media/ftu/graphic-calibrate-tv-frame.png differ diff --git a/skin/boxee/media/ftu/graphic-calibrate-tv.png b/skin/boxee/media/ftu/graphic-calibrate-tv.png new file mode 100644 index 00000000..9204e84d Binary files /dev/null and b/skin/boxee/media/ftu/graphic-calibrate-tv.png differ diff --git a/skin/boxee/media/ftu/graphic-download-bg.png b/skin/boxee/media/ftu/graphic-download-bg.png new file mode 100644 index 00000000..bb2801e2 Binary files /dev/null and b/skin/boxee/media/ftu/graphic-download-bg.png differ diff --git a/skin/boxee/media/ftu/graphic-download-progress-cap.png b/skin/boxee/media/ftu/graphic-download-progress-cap.png new file mode 100644 index 00000000..a31d6bc0 Binary files /dev/null and b/skin/boxee/media/ftu/graphic-download-progress-cap.png differ diff --git a/skin/boxee/media/ftu/graphic-download-progress.png b/skin/boxee/media/ftu/graphic-download-progress.png new file mode 100644 index 00000000..ac128b2a Binary files /dev/null and b/skin/boxee/media/ftu/graphic-download-progress.png differ diff --git a/skin/boxee/media/ftu/graphic-ftu-ethernet.png b/skin/boxee/media/ftu/graphic-ftu-ethernet.png new file mode 100644 index 00000000..43224c89 Binary files /dev/null and b/skin/boxee/media/ftu/graphic-ftu-ethernet.png differ diff --git a/skin/boxee/media/ftu/graphic-ftu-tip-airplay.png b/skin/boxee/media/ftu/graphic-ftu-tip-airplay.png new file mode 100644 index 00000000..a9257569 Binary files /dev/null and b/skin/boxee/media/ftu/graphic-ftu-tip-airplay.png differ diff --git a/skin/boxee/media/ftu/graphic-ftu-tip-remote.png b/skin/boxee/media/ftu/graphic-ftu-tip-remote.png new file mode 100644 index 00000000..6893811b Binary files /dev/null and b/skin/boxee/media/ftu/graphic-ftu-tip-remote.png differ diff --git a/skin/boxee/media/ftu/graphic-ftu-wifi.png b/skin/boxee/media/ftu/graphic-ftu-wifi.png new file mode 100644 index 00000000..780eccc2 Binary files /dev/null and b/skin/boxee/media/ftu/graphic-ftu-wifi.png differ diff --git a/skin/boxee/media/ftu/graphic-networks-lock.png b/skin/boxee/media/ftu/graphic-networks-lock.png new file mode 100644 index 00000000..36af900d Binary files /dev/null and b/skin/boxee/media/ftu/graphic-networks-lock.png differ diff --git a/skin/boxee/media/ftu/graphic-networks-wifi-ok.png b/skin/boxee/media/ftu/graphic-networks-wifi-ok.png new file mode 100644 index 00000000..bec20931 Binary files /dev/null and b/skin/boxee/media/ftu/graphic-networks-wifi-ok.png differ diff --git a/skin/boxee/media/ftu/graphic-networks-wifi-strong.png b/skin/boxee/media/ftu/graphic-networks-wifi-strong.png new file mode 100644 index 00000000..ef315a95 Binary files /dev/null and b/skin/boxee/media/ftu/graphic-networks-wifi-strong.png differ diff --git a/skin/boxee/media/ftu/graphic-networks-wifi-weak.png b/skin/boxee/media/ftu/graphic-networks-wifi-weak.png new file mode 100644 index 00000000..79a393ff Binary files /dev/null and b/skin/boxee/media/ftu/graphic-networks-wifi-weak.png differ diff --git a/skin/boxee/media/ftu/graphic-remote-get-started-dlink.png b/skin/boxee/media/ftu/graphic-remote-get-started-dlink.png new file mode 100644 index 00000000..244fc20a Binary files /dev/null and b/skin/boxee/media/ftu/graphic-remote-get-started-dlink.png differ diff --git a/skin/boxee/media/ftu/graphic-remote-get-started-iomega.png b/skin/boxee/media/ftu/graphic-remote-get-started-iomega.png new file mode 100644 index 00000000..5d968225 Binary files /dev/null and b/skin/boxee/media/ftu/graphic-remote-get-started-iomega.png differ diff --git a/skin/boxee/media/ftu/graphic-screen-calibration-frame.png b/skin/boxee/media/ftu/graphic-screen-calibration-frame.png new file mode 100644 index 00000000..f717a56d Binary files /dev/null and b/skin/boxee/media/ftu/graphic-screen-calibration-frame.png differ diff --git a/skin/boxee/media/ftu/graphic-welcome-boxee-logotype.png b/skin/boxee/media/ftu/graphic-welcome-boxee-logotype.png new file mode 100644 index 00000000..9fecb179 Binary files /dev/null and b/skin/boxee/media/ftu/graphic-welcome-boxee-logotype.png differ diff --git a/skin/boxee/media/graphic-arrow-left.png b/skin/boxee/media/graphic-arrow-left.png new file mode 100644 index 00000000..54539e08 Binary files /dev/null and b/skin/boxee/media/graphic-arrow-left.png differ diff --git a/skin/boxee/media/graphic-arrow.png b/skin/boxee/media/graphic-arrow.png new file mode 100644 index 00000000..ea546a17 Binary files /dev/null and b/skin/boxee/media/graphic-arrow.png differ diff --git a/skin/boxee/media/graphic-back-button.png b/skin/boxee/media/graphic-back-button.png new file mode 100644 index 00000000..4ed4f527 Binary files /dev/null and b/skin/boxee/media/graphic-back-button.png differ diff --git a/skin/boxee/media/graphic-browse-arrow.png b/skin/boxee/media/graphic-browse-arrow.png new file mode 100644 index 00000000..1e72f5ce Binary files /dev/null and b/skin/boxee/media/graphic-browse-arrow.png differ diff --git a/skin/boxee/media/graphic-bullet.png b/skin/boxee/media/graphic-bullet.png new file mode 100644 index 00000000..711da5c7 Binary files /dev/null and b/skin/boxee/media/graphic-bullet.png differ diff --git a/skin/boxee/media/graphic-cc.png b/skin/boxee/media/graphic-cc.png new file mode 100644 index 00000000..34263163 Binary files /dev/null and b/skin/boxee/media/graphic-cc.png differ diff --git a/skin/boxee/media/graphic-check-54px.png b/skin/boxee/media/graphic-check-54px.png new file mode 100644 index 00000000..9c9de3a7 Binary files /dev/null and b/skin/boxee/media/graphic-check-54px.png differ diff --git a/skin/boxee/media/graphic-check-empty-54px.png b/skin/boxee/media/graphic-check-empty-54px.png new file mode 100644 index 00000000..dfa3dbc4 Binary files /dev/null and b/skin/boxee/media/graphic-check-empty-54px.png differ diff --git a/skin/boxee/media/graphic-check.png b/skin/boxee/media/graphic-check.png new file mode 100644 index 00000000..c37f0dfe Binary files /dev/null and b/skin/boxee/media/graphic-check.png differ diff --git a/skin/boxee/media/graphic-clock-bg.png b/skin/boxee/media/graphic-clock-bg.png new file mode 100644 index 00000000..db54a2fd Binary files /dev/null and b/skin/boxee/media/graphic-clock-bg.png differ diff --git a/skin/boxee/media/graphic-clock.png b/skin/boxee/media/graphic-clock.png new file mode 100644 index 00000000..4a0d623c Binary files /dev/null and b/skin/boxee/media/graphic-clock.png differ diff --git a/skin/boxee/media/graphic-divider-480.png b/skin/boxee/media/graphic-divider-480.png new file mode 100644 index 00000000..f0819dad Binary files /dev/null and b/skin/boxee/media/graphic-divider-480.png differ diff --git a/skin/boxee/media/graphic-error.png b/skin/boxee/media/graphic-error.png new file mode 100644 index 00000000..740cfc94 Binary files /dev/null and b/skin/boxee/media/graphic-error.png differ diff --git a/skin/boxee/media/graphic-friends-fetching.png b/skin/boxee/media/graphic-friends-fetching.png new file mode 100644 index 00000000..5bcbea6c Binary files /dev/null and b/skin/boxee/media/graphic-friends-fetching.png differ diff --git a/skin/boxee/media/graphic-hd.png b/skin/boxee/media/graphic-hd.png new file mode 100644 index 00000000..5a1d6a92 Binary files /dev/null and b/skin/boxee/media/graphic-hd.png differ diff --git a/skin/boxee/media/graphic-more-focused.png b/skin/boxee/media/graphic-more-focused.png new file mode 100644 index 00000000..3e0a1a00 Binary files /dev/null and b/skin/boxee/media/graphic-more-focused.png differ diff --git a/skin/boxee/media/graphic-more-unfocused.png b/skin/boxee/media/graphic-more-unfocused.png new file mode 100644 index 00000000..716ecdb5 Binary files /dev/null and b/skin/boxee/media/graphic-more-unfocused.png differ diff --git a/skin/boxee/media/graphic-radio-off.png b/skin/boxee/media/graphic-radio-off.png new file mode 100644 index 00000000..30a0a76c Binary files /dev/null and b/skin/boxee/media/graphic-radio-off.png differ diff --git a/skin/boxee/media/graphic-radio-on.png b/skin/boxee/media/graphic-radio-on.png new file mode 100644 index 00000000..18734c40 Binary files /dev/null and b/skin/boxee/media/graphic-radio-on.png differ diff --git a/skin/boxee/media/graphic-scanline-12.png b/skin/boxee/media/graphic-scanline-12.png new file mode 100644 index 00000000..e4aec5d1 Binary files /dev/null and b/skin/boxee/media/graphic-scanline-12.png differ diff --git a/skin/boxee/media/graphic-scanline-48.png b/skin/boxee/media/graphic-scanline-48.png new file mode 100644 index 00000000..708f3d51 Binary files /dev/null and b/skin/boxee/media/graphic-scanline-48.png differ diff --git a/skin/boxee/media/graphic-scanline-88.png b/skin/boxee/media/graphic-scanline-88.png new file mode 100644 index 00000000..0a44ecda Binary files /dev/null and b/skin/boxee/media/graphic-scanline-88.png differ diff --git a/skin/boxee/media/graphic-scrollbar-bg.png b/skin/boxee/media/graphic-scrollbar-bg.png new file mode 100644 index 00000000..c65e8c16 Binary files /dev/null and b/skin/boxee/media/graphic-scrollbar-bg.png differ diff --git a/skin/boxee/media/graphic-scrollbar-slider.png b/skin/boxee/media/graphic-scrollbar-slider.png new file mode 100644 index 00000000..074cf2be Binary files /dev/null and b/skin/boxee/media/graphic-scrollbar-slider.png differ diff --git a/skin/boxee/media/graphic-star.png b/skin/boxee/media/graphic-star.png new file mode 100644 index 00000000..831dc688 Binary files /dev/null and b/skin/boxee/media/graphic-star.png differ diff --git a/skin/boxee/media/graphic_divider_vert.png b/skin/boxee/media/graphic_divider_vert.png new file mode 100644 index 00000000..c4ac42e8 Binary files /dev/null and b/skin/boxee/media/graphic_divider_vert.png differ diff --git a/skin/boxee/media/graphic_steps_circle.png b/skin/boxee/media/graphic_steps_circle.png new file mode 100644 index 00000000..9e5ef3e5 Binary files /dev/null and b/skin/boxee/media/graphic_steps_circle.png differ diff --git a/skin/boxee/media/graphic_steps_dot.png b/skin/boxee/media/graphic_steps_dot.png new file mode 100644 index 00000000..ce521c90 Binary files /dev/null and b/skin/boxee/media/graphic_steps_dot.png differ diff --git a/skin/boxee/media/grey_button.png b/skin/boxee/media/grey_button.png new file mode 100644 index 00000000..4d898fe4 Binary files /dev/null and b/skin/boxee/media/grey_button.png differ diff --git a/skin/boxee/media/home_screen_feather.png b/skin/boxee/media/home_screen_feather.png new file mode 100644 index 00000000..7ea2411e Binary files /dev/null and b/skin/boxee/media/home_screen_feather.png differ diff --git a/skin/boxee/media/homescreen/graphic-boxee-logotype.png b/skin/boxee/media/homescreen/graphic-boxee-logotype.png new file mode 100644 index 00000000..c37b8c68 Binary files /dev/null and b/skin/boxee/media/homescreen/graphic-boxee-logotype.png differ diff --git a/skin/boxee/media/homescreen/graphic-home-divider.png b/skin/boxee/media/homescreen/graphic-home-divider.png new file mode 100644 index 00000000..bde6b286 Binary files /dev/null and b/skin/boxee/media/homescreen/graphic-home-divider.png differ diff --git a/skin/boxee/media/icon-info.png b/skin/boxee/media/icon-info.png new file mode 100644 index 00000000..13945b53 Binary files /dev/null and b/skin/boxee/media/icon-info.png differ diff --git a/skin/boxee/media/icon-scan.png b/skin/boxee/media/icon-scan.png new file mode 100644 index 00000000..183b7bf9 Binary files /dev/null and b/skin/boxee/media/icon-scan.png differ diff --git a/skin/boxee/media/icon-share.png b/skin/boxee/media/icon-share.png new file mode 100644 index 00000000..57196f3f Binary files /dev/null and b/skin/boxee/media/icon-share.png differ diff --git a/skin/boxee/media/icons/Icon_Minus.png b/skin/boxee/media/icons/Icon_Minus.png new file mode 100644 index 00000000..9a948d27 Binary files /dev/null and b/skin/boxee/media/icons/Icon_Minus.png differ diff --git a/skin/boxee/media/icons/Icon_Minus_selected.png b/skin/boxee/media/icons/Icon_Minus_selected.png new file mode 100644 index 00000000..3a148978 Binary files /dev/null and b/skin/boxee/media/icons/Icon_Minus_selected.png differ diff --git a/skin/boxee/media/icons/Icon_Minus_selected_on.png b/skin/boxee/media/icons/Icon_Minus_selected_on.png new file mode 100644 index 00000000..b2739753 Binary files /dev/null and b/skin/boxee/media/icons/Icon_Minus_selected_on.png differ diff --git a/skin/boxee/media/icons/Icon_Plus.png b/skin/boxee/media/icons/Icon_Plus.png new file mode 100644 index 00000000..9ef14bdb Binary files /dev/null and b/skin/boxee/media/icons/Icon_Plus.png differ diff --git a/skin/boxee/media/icons/MenuIcon.png b/skin/boxee/media/icons/MenuIcon.png new file mode 100644 index 00000000..930c23fd Binary files /dev/null and b/skin/boxee/media/icons/MenuIcon.png differ diff --git a/skin/boxee/media/icons/SubMenu.png b/skin/boxee/media/icons/SubMenu.png new file mode 100644 index 00000000..fbb4c765 Binary files /dev/null and b/skin/boxee/media/icons/SubMenu.png differ diff --git a/skin/boxee/media/icons/boxee-icon-clear-all-history.png b/skin/boxee/media/icons/boxee-icon-clear-all-history.png new file mode 100644 index 00000000..d58482c7 Binary files /dev/null and b/skin/boxee/media/icons/boxee-icon-clear-all-history.png differ diff --git a/skin/boxee/media/icons/boxee-offline.png b/skin/boxee/media/icons/boxee-offline.png new file mode 100644 index 00000000..578ad084 Binary files /dev/null and b/skin/boxee/media/icons/boxee-offline.png differ diff --git a/skin/boxee/media/icons/boxee-online.png b/skin/boxee/media/icons/boxee-online.png new file mode 100644 index 00000000..e692d726 Binary files /dev/null and b/skin/boxee/media/icons/boxee-online.png differ diff --git a/skin/boxee/media/icons/boxee-update.png b/skin/boxee/media/icons/boxee-update.png new file mode 100644 index 00000000..620869b1 Binary files /dev/null and b/skin/boxee/media/icons/boxee-update.png differ diff --git a/skin/boxee/media/icons/graphic-bookmark-star.png b/skin/boxee/media/icons/graphic-bookmark-star.png new file mode 100644 index 00000000..6b9b46e5 Binary files /dev/null and b/skin/boxee/media/icons/graphic-bookmark-star.png differ diff --git a/skin/boxee/media/icons/icon-home-apps.png b/skin/boxee/media/icons/icon-home-apps.png new file mode 100644 index 00000000..09d15589 Binary files /dev/null and b/skin/boxee/media/icons/icon-home-apps.png differ diff --git a/skin/boxee/media/icons/icon-home-files.png b/skin/boxee/media/icons/icon-home-files.png new file mode 100644 index 00000000..ef7046d8 Binary files /dev/null and b/skin/boxee/media/icons/icon-home-files.png differ diff --git a/skin/boxee/media/icons/icon-home-friends.png b/skin/boxee/media/icons/icon-home-friends.png new file mode 100644 index 00000000..f3b729bd Binary files /dev/null and b/skin/boxee/media/icons/icon-home-friends.png differ diff --git a/skin/boxee/media/icons/icon-home-live-tv.png b/skin/boxee/media/icons/icon-home-live-tv.png new file mode 100644 index 00000000..b7f9e21b Binary files /dev/null and b/skin/boxee/media/icons/icon-home-live-tv.png differ diff --git a/skin/boxee/media/icons/icon-home-movies.png b/skin/boxee/media/icons/icon-home-movies.png new file mode 100644 index 00000000..c4889c9a Binary files /dev/null and b/skin/boxee/media/icons/icon-home-movies.png differ diff --git a/skin/boxee/media/icons/icon-home-shows.png b/skin/boxee/media/icons/icon-home-shows.png new file mode 100644 index 00000000..91e32e80 Binary files /dev/null and b/skin/boxee/media/icons/icon-home-shows.png differ diff --git a/skin/boxee/media/icons/icon-home-watch-later.png b/skin/boxee/media/icons/icon-home-watch-later.png new file mode 100644 index 00000000..0784d294 Binary files /dev/null and b/skin/boxee/media/icons/icon-home-watch-later.png differ diff --git a/skin/boxee/media/icons/icon-home-web.png b/skin/boxee/media/icons/icon-home-web.png new file mode 100644 index 00000000..6187653a Binary files /dev/null and b/skin/boxee/media/icons/icon-home-web.png differ diff --git a/skin/boxee/media/icons/icon-settings-about.png b/skin/boxee/media/icons/icon-settings-about.png new file mode 100644 index 00000000..7b2d689b Binary files /dev/null and b/skin/boxee/media/icons/icon-settings-about.png differ diff --git a/skin/boxee/media/icons/icon-settings-file-sources.png b/skin/boxee/media/icons/icon-settings-file-sources.png new file mode 100644 index 00000000..ddfe55e5 Binary files /dev/null and b/skin/boxee/media/icons/icon-settings-file-sources.png differ diff --git a/skin/boxee/media/icons/icon-settings-general.png b/skin/boxee/media/icons/icon-settings-general.png new file mode 100644 index 00000000..b3c55a01 Binary files /dev/null and b/skin/boxee/media/icons/icon-settings-general.png differ diff --git a/skin/boxee/media/icons/icon-settings-legal.png b/skin/boxee/media/icons/icon-settings-legal.png new file mode 100644 index 00000000..cea1d331 Binary files /dev/null and b/skin/boxee/media/icons/icon-settings-legal.png differ diff --git a/skin/boxee/media/icons/icon-settings-live-tv.png b/skin/boxee/media/icons/icon-settings-live-tv.png new file mode 100644 index 00000000..1859cd3b Binary files /dev/null and b/skin/boxee/media/icons/icon-settings-live-tv.png differ diff --git a/skin/boxee/media/icons/icon-settings-media.png b/skin/boxee/media/icons/icon-settings-media.png new file mode 100644 index 00000000..9f4a3a17 Binary files /dev/null and b/skin/boxee/media/icons/icon-settings-media.png differ diff --git a/skin/boxee/media/icons/icon-settings-network.png b/skin/boxee/media/icons/icon-settings-network.png new file mode 100644 index 00000000..97fb88c7 Binary files /dev/null and b/skin/boxee/media/icons/icon-settings-network.png differ diff --git a/skin/boxee/media/icons/icon-settings-parental-controls.png b/skin/boxee/media/icons/icon-settings-parental-controls.png new file mode 100644 index 00000000..93f8e235 Binary files /dev/null and b/skin/boxee/media/icons/icon-settings-parental-controls.png differ diff --git a/skin/boxee/media/icons/icon-settings-system.png b/skin/boxee/media/icons/icon-settings-system.png new file mode 100644 index 00000000..b897e23f Binary files /dev/null and b/skin/boxee/media/icons/icon-settings-system.png differ diff --git a/skin/boxee/media/icons/icon-shutdown-logout.png b/skin/boxee/media/icons/icon-shutdown-logout.png new file mode 100644 index 00000000..b95ab95e Binary files /dev/null and b/skin/boxee/media/icons/icon-shutdown-logout.png differ diff --git a/skin/boxee/media/icons/icon-shutdown-shutdown.png b/skin/boxee/media/icons/icon-shutdown-shutdown.png new file mode 100644 index 00000000..60ef59b2 Binary files /dev/null and b/skin/boxee/media/icons/icon-shutdown-shutdown.png differ diff --git a/skin/boxee/media/icons/icon-shutdown-sleep.png b/skin/boxee/media/icons/icon-shutdown-sleep.png new file mode 100644 index 00000000..c964c51c Binary files /dev/null and b/skin/boxee/media/icons/icon-shutdown-sleep.png differ diff --git a/skin/boxee/media/icons/icon-shutdown-update.png b/skin/boxee/media/icons/icon-shutdown-update.png new file mode 100644 index 00000000..5f844856 Binary files /dev/null and b/skin/boxee/media/icons/icon-shutdown-update.png differ diff --git a/skin/boxee/media/icons/icon_action_add_off.png b/skin/boxee/media/icons/icon_action_add_off.png new file mode 100644 index 00000000..b1bf867f Binary files /dev/null and b/skin/boxee/media/icons/icon_action_add_off.png differ diff --git a/skin/boxee/media/icons/icon_action_add_on.png b/skin/boxee/media/icons/icon_action_add_on.png new file mode 100644 index 00000000..bbccc732 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_add_on.png differ diff --git a/skin/boxee/media/icons/icon_action_clear_history_off.png b/skin/boxee/media/icons/icon_action_clear_history_off.png new file mode 100644 index 00000000..af397cc1 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_clear_history_off.png differ diff --git a/skin/boxee/media/icons/icon_action_clear_history_on.png b/skin/boxee/media/icons/icon_action_clear_history_on.png new file mode 100644 index 00000000..cbce4901 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_clear_history_on.png differ diff --git a/skin/boxee/media/icons/icon_action_eject_off.png b/skin/boxee/media/icons/icon_action_eject_off.png new file mode 100644 index 00000000..c2c0095d Binary files /dev/null and b/skin/boxee/media/icons/icon_action_eject_off.png differ diff --git a/skin/boxee/media/icons/icon_action_eject_on.png b/skin/boxee/media/icons/icon_action_eject_on.png new file mode 100644 index 00000000..ee07c9a7 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_eject_on.png differ diff --git a/skin/boxee/media/icons/icon_action_favorite_off_off.png b/skin/boxee/media/icons/icon_action_favorite_off_off.png new file mode 100644 index 00000000..38b8f3f4 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_favorite_off_off.png differ diff --git a/skin/boxee/media/icons/icon_action_favorite_off_on.png b/skin/boxee/media/icons/icon_action_favorite_off_on.png new file mode 100644 index 00000000..f9268826 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_favorite_off_on.png differ diff --git a/skin/boxee/media/icons/icon_action_favorite_on_off.png b/skin/boxee/media/icons/icon_action_favorite_on_off.png new file mode 100644 index 00000000..2568ad64 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_favorite_on_off.png differ diff --git a/skin/boxee/media/icons/icon_action_favorite_on_on.png b/skin/boxee/media/icons/icon_action_favorite_on_on.png new file mode 100644 index 00000000..0919ba72 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_favorite_on_on.png differ diff --git a/skin/boxee/media/icons/icon_action_list_off.png b/skin/boxee/media/icons/icon_action_list_off.png new file mode 100644 index 00000000..2f42e9c9 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_list_off.png differ diff --git a/skin/boxee/media/icons/icon_action_list_on.png b/skin/boxee/media/icons/icon_action_list_on.png new file mode 100644 index 00000000..95ac2b2f Binary files /dev/null and b/skin/boxee/media/icons/icon_action_list_on.png differ diff --git a/skin/boxee/media/icons/icon_action_menu_favorite_add.png b/skin/boxee/media/icons/icon_action_menu_favorite_add.png new file mode 100644 index 00000000..ca64517b Binary files /dev/null and b/skin/boxee/media/icons/icon_action_menu_favorite_add.png differ diff --git a/skin/boxee/media/icons/icon_action_menu_favorite_remove.png b/skin/boxee/media/icons/icon_action_menu_favorite_remove.png new file mode 100644 index 00000000..27d1af75 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_menu_favorite_remove.png differ diff --git a/skin/boxee/media/icons/icon_action_menu_favorite_remove_active_off.png b/skin/boxee/media/icons/icon_action_menu_favorite_remove_active_off.png new file mode 100644 index 00000000..7cb7f4ad Binary files /dev/null and b/skin/boxee/media/icons/icon_action_menu_favorite_remove_active_off.png differ diff --git a/skin/boxee/media/icons/icon_action_menu_favorite_remove_active_on.png b/skin/boxee/media/icons/icon_action_menu_favorite_remove_active_on.png new file mode 100644 index 00000000..933cb64a Binary files /dev/null and b/skin/boxee/media/icons/icon_action_menu_favorite_remove_active_on.png differ diff --git a/skin/boxee/media/icons/icon_action_menu_favorite_remove_off.png b/skin/boxee/media/icons/icon_action_menu_favorite_remove_off.png new file mode 100644 index 00000000..4b3f85a9 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_menu_favorite_remove_off.png differ diff --git a/skin/boxee/media/icons/icon_action_menu_favorite_remove_on.png b/skin/boxee/media/icons/icon_action_menu_favorite_remove_on.png new file mode 100644 index 00000000..4de459ea Binary files /dev/null and b/skin/boxee/media/icons/icon_action_menu_favorite_remove_on.png differ diff --git a/skin/boxee/media/icons/icon_action_menu_favorite_selected.png b/skin/boxee/media/icons/icon_action_menu_favorite_selected.png new file mode 100644 index 00000000..2bc3ded0 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_menu_favorite_selected.png differ diff --git a/skin/boxee/media/icons/icon_action_menu_sort.png b/skin/boxee/media/icons/icon_action_menu_sort.png new file mode 100644 index 00000000..ea6b2e8b Binary files /dev/null and b/skin/boxee/media/icons/icon_action_menu_sort.png differ diff --git a/skin/boxee/media/icons/icon_action_menu_unwatched.png b/skin/boxee/media/icons/icon_action_menu_unwatched.png new file mode 100644 index 00000000..6ad60907 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_menu_unwatched.png differ diff --git a/skin/boxee/media/icons/icon_action_menu_watched.png b/skin/boxee/media/icons/icon_action_menu_watched.png new file mode 100644 index 00000000..2ec399cb Binary files /dev/null and b/skin/boxee/media/icons/icon_action_menu_watched.png differ diff --git a/skin/boxee/media/icons/icon_action_remove_off.png b/skin/boxee/media/icons/icon_action_remove_off.png new file mode 100644 index 00000000..65010dc5 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_remove_off.png differ diff --git a/skin/boxee/media/icons/icon_action_remove_on.png b/skin/boxee/media/icons/icon_action_remove_on.png new file mode 100644 index 00000000..bb2767d8 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_remove_on.png differ diff --git a/skin/boxee/media/icons/icon_action_scan_off.png b/skin/boxee/media/icons/icon_action_scan_off.png new file mode 100644 index 00000000..d2756cf2 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_scan_off.png differ diff --git a/skin/boxee/media/icons/icon_action_scan_on.png b/skin/boxee/media/icons/icon_action_scan_on.png new file mode 100644 index 00000000..c9b87f4c Binary files /dev/null and b/skin/boxee/media/icons/icon_action_scan_on.png differ diff --git a/skin/boxee/media/icons/icon_action_sort_active.png b/skin/boxee/media/icons/icon_action_sort_active.png new file mode 100644 index 00000000..f214dbd4 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_sort_active.png differ diff --git a/skin/boxee/media/icons/icon_action_sort_off.png b/skin/boxee/media/icons/icon_action_sort_off.png new file mode 100644 index 00000000..726c0d60 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_sort_off.png differ diff --git a/skin/boxee/media/icons/icon_action_sort_on.png b/skin/boxee/media/icons/icon_action_sort_on.png new file mode 100644 index 00000000..0599fcef Binary files /dev/null and b/skin/boxee/media/icons/icon_action_sort_on.png differ diff --git a/skin/boxee/media/icons/icon_action_thumbs_off.png b/skin/boxee/media/icons/icon_action_thumbs_off.png new file mode 100644 index 00000000..a230a643 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_thumbs_off.png differ diff --git a/skin/boxee/media/icons/icon_action_thumbs_on.png b/skin/boxee/media/icons/icon_action_thumbs_on.png new file mode 100644 index 00000000..6829e108 Binary files /dev/null and b/skin/boxee/media/icons/icon_action_thumbs_on.png differ diff --git a/skin/boxee/media/icons/icon_add_user_off.png b/skin/boxee/media/icons/icon_add_user_off.png new file mode 100644 index 00000000..7593add5 Binary files /dev/null and b/skin/boxee/media/icons/icon_add_user_off.png differ diff --git a/skin/boxee/media/icons/icon_add_user_on.png b/skin/boxee/media/icons/icon_add_user_on.png new file mode 100644 index 00000000..e53e47b5 Binary files /dev/null and b/skin/boxee/media/icons/icon_add_user_on.png differ diff --git a/skin/boxee/media/icons/icon_backspace.png b/skin/boxee/media/icons/icon_backspace.png new file mode 100644 index 00000000..06449b3c Binary files /dev/null and b/skin/boxee/media/icons/icon_backspace.png differ diff --git a/skin/boxee/media/icons/icon_battery_low_large.png b/skin/boxee/media/icons/icon_battery_low_large.png new file mode 100644 index 00000000..ffb96ad0 Binary files /dev/null and b/skin/boxee/media/icons/icon_battery_low_large.png differ diff --git a/skin/boxee/media/icons/icon_battery_low_small.png b/skin/boxee/media/icons/icon_battery_low_small.png new file mode 100644 index 00000000..9c5a664c Binary files /dev/null and b/skin/boxee/media/icons/icon_battery_low_small.png differ diff --git a/skin/boxee/media/icons/icon_browse_eject.png b/skin/boxee/media/icons/icon_browse_eject.png new file mode 100644 index 00000000..fd104468 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_eject.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_apps.png b/skin/boxee/media/icons/icon_browse_menu_apps.png new file mode 100644 index 00000000..4f37ba1b Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_apps.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_clip.png b/skin/boxee/media/icons/icon_browse_menu_clip.png new file mode 100644 index 00000000..db93e9fd Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_clip.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_clock.png b/skin/boxee/media/icons/icon_browse_menu_clock.png new file mode 100644 index 00000000..5cfdabf2 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_clock.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_exit.png b/skin/boxee/media/icons/icon_browse_menu_exit.png new file mode 100644 index 00000000..b72cbfe5 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_exit.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_file.png b/skin/boxee/media/icons/icon_browse_menu_file.png new file mode 100644 index 00000000..d2209da9 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_file.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_files.png b/skin/boxee/media/icons/icon_browse_menu_files.png new file mode 100644 index 00000000..5725a128 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_files.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_home.png b/skin/boxee/media/icons/icon_browse_menu_home.png new file mode 100644 index 00000000..bc11093c Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_home.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_movies.png b/skin/boxee/media/icons/icon_browse_menu_movies.png new file mode 100644 index 00000000..811ce4db Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_movies.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_music.png b/skin/boxee/media/icons/icon_browse_menu_music.png new file mode 100644 index 00000000..eaa68536 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_music.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_network.png b/skin/boxee/media/icons/icon_browse_menu_network.png new file mode 100644 index 00000000..c3ec07de Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_network.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_photos.png b/skin/boxee/media/icons/icon_browse_menu_photos.png new file mode 100644 index 00000000..4718bb01 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_photos.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_sd.png b/skin/boxee/media/icons/icon_browse_menu_sd.png new file mode 100644 index 00000000..bfbfc87e Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_sd.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_search.png b/skin/boxee/media/icons/icon_browse_menu_search.png new file mode 100644 index 00000000..284c1173 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_search.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_settings.png b/skin/boxee/media/icons/icon_browse_menu_settings.png new file mode 100644 index 00000000..026563a4 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_settings.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_shows.png b/skin/boxee/media/icons/icon_browse_menu_shows.png new file mode 100644 index 00000000..696b84b0 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_shows.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_usb.png b/skin/boxee/media/icons/icon_browse_menu_usb.png new file mode 100644 index 00000000..de628674 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_usb.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_video.png b/skin/boxee/media/icons/icon_browse_menu_video.png new file mode 100644 index 00000000..3ac276dd Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_video.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_vpn.png b/skin/boxee/media/icons/icon_browse_menu_vpn.png new file mode 100644 index 00000000..48cd8521 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_vpn.png differ diff --git a/skin/boxee/media/icons/icon_browse_menu_wifi.png b/skin/boxee/media/icons/icon_browse_menu_wifi.png new file mode 100644 index 00000000..a2c62d31 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_menu_wifi.png differ diff --git a/skin/boxee/media/icons/icon_browse_minus.png b/skin/boxee/media/icons/icon_browse_minus.png new file mode 100644 index 00000000..9a948d27 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_minus.png differ diff --git a/skin/boxee/media/icons/icon_browse_plus.png b/skin/boxee/media/icons/icon_browse_plus.png new file mode 100644 index 00000000..9ef14bdb Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_plus.png differ diff --git a/skin/boxee/media/icons/icon_browse_scan.png b/skin/boxee/media/icons/icon_browse_scan.png new file mode 100644 index 00000000..ef7707c0 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_scan.png differ diff --git a/skin/boxee/media/icons/icon_browse_scan_off.png b/skin/boxee/media/icons/icon_browse_scan_off.png new file mode 100644 index 00000000..0dae60c5 Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_scan_off.png differ diff --git a/skin/boxee/media/icons/icon_browse_scan_on.png b/skin/boxee/media/icons/icon_browse_scan_on.png new file mode 100644 index 00000000..f6b4c59a Binary files /dev/null and b/skin/boxee/media/icons/icon_browse_scan_on.png differ diff --git a/skin/boxee/media/icons/icon_browser_no_favorite.png b/skin/boxee/media/icons/icon_browser_no_favorite.png new file mode 100644 index 00000000..86e46175 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_no_favorite.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_big_skip_bwd.png b/skin/boxee/media/icons/icon_browser_osd_big_skip_bwd.png new file mode 100644 index 00000000..e5193848 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_big_skip_bwd.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_big_skip_fwd.png b/skin/boxee/media/icons/icon_browser_osd_big_skip_fwd.png new file mode 100644 index 00000000..12f8b75d Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_big_skip_fwd.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_cancel.png b/skin/boxee/media/icons/icon_browser_osd_cancel.png new file mode 100644 index 00000000..ada29f4c Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_cancel.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_cursor.png b/skin/boxee/media/icons/icon_browser_osd_cursor.png new file mode 100644 index 00000000..c5f6a830 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_cursor.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_cursor2.png b/skin/boxee/media/icons/icon_browser_osd_cursor2.png new file mode 100644 index 00000000..7e153798 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_cursor2.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_cursor_black.png b/skin/boxee/media/icons/icon_browser_osd_cursor_black.png new file mode 100644 index 00000000..08401a30 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_cursor_black.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_cursor_hand_black.png b/skin/boxee/media/icons/icon_browser_osd_cursor_hand_black.png new file mode 100644 index 00000000..8b8de67f Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_cursor_hand_black.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_exit_off.png b/skin/boxee/media/icons/icon_browser_osd_exit_off.png new file mode 100644 index 00000000..e43e36bd Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_exit_off.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_exit_on.png b/skin/boxee/media/icons/icon_browser_osd_exit_on.png new file mode 100644 index 00000000..080133f0 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_exit_on.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_favorite_off_off.png b/skin/boxee/media/icons/icon_browser_osd_favorite_off_off.png new file mode 100644 index 00000000..f7a368e8 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_favorite_off_off.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_favorite_off_on.png b/skin/boxee/media/icons/icon_browser_osd_favorite_off_on.png new file mode 100644 index 00000000..7776cddb Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_favorite_off_on.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_favorite_on_off.png b/skin/boxee/media/icons/icon_browser_osd_favorite_on_off.png new file mode 100644 index 00000000..468b5abe Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_favorite_on_off.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_favorite_on_on.png b/skin/boxee/media/icons/icon_browser_osd_favorite_on_on.png new file mode 100644 index 00000000..de3a6f08 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_favorite_on_on.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_favorites_off.png b/skin/boxee/media/icons/icon_browser_osd_favorites_off.png new file mode 100644 index 00000000..e05894fc Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_favorites_off.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_favorites_on.png b/skin/boxee/media/icons/icon_browser_osd_favorites_on.png new file mode 100644 index 00000000..858f4078 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_favorites_on.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_fullscreen_off.png b/skin/boxee/media/icons/icon_browser_osd_fullscreen_off.png new file mode 100644 index 00000000..6f85cfaf Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_fullscreen_off.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_fullscreen_on.png b/skin/boxee/media/icons/icon_browser_osd_fullscreen_on.png new file mode 100644 index 00000000..a612d7dc Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_fullscreen_on.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_history_back.png b/skin/boxee/media/icons/icon_browser_osd_history_back.png new file mode 100644 index 00000000..0bd3f394 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_history_back.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_history_back_disabled.png b/skin/boxee/media/icons/icon_browser_osd_history_back_disabled.png new file mode 100644 index 00000000..561924e6 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_history_back_disabled.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_history_back_off.png b/skin/boxee/media/icons/icon_browser_osd_history_back_off.png new file mode 100644 index 00000000..c09c2658 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_history_back_off.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_history_back_on.png b/skin/boxee/media/icons/icon_browser_osd_history_back_on.png new file mode 100644 index 00000000..9369bdc1 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_history_back_on.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_history_forward.png b/skin/boxee/media/icons/icon_browser_osd_history_forward.png new file mode 100644 index 00000000..c3a3477f Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_history_forward.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_history_off.png b/skin/boxee/media/icons/icon_browser_osd_history_off.png new file mode 100644 index 00000000..a81c2aa9 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_history_off.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_history_on.png b/skin/boxee/media/icons/icon_browser_osd_history_on.png new file mode 100644 index 00000000..9e2ddde1 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_history_on.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_lock.png b/skin/boxee/media/icons/icon_browser_osd_lock.png new file mode 100644 index 00000000..86293a91 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_lock.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_pause.png b/skin/boxee/media/icons/icon_browser_osd_pause.png new file mode 100644 index 00000000..203298b0 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_pause.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_play.png b/skin/boxee/media/icons/icon_browser_osd_play.png new file mode 100644 index 00000000..54eebd4b Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_play.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_share_off.png b/skin/boxee/media/icons/icon_browser_osd_share_off.png new file mode 100644 index 00000000..7cbaf4e7 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_share_off.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_share_on.png b/skin/boxee/media/icons/icon_browser_osd_share_on.png new file mode 100644 index 00000000..50765c44 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_share_on.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_small_skip_bwd.png b/skin/boxee/media/icons/icon_browser_osd_small_skip_bwd.png new file mode 100644 index 00000000..bdfe52be Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_small_skip_bwd.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_small_skip_fwd.png b/skin/boxee/media/icons/icon_browser_osd_small_skip_fwd.png new file mode 100644 index 00000000..c963b500 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_small_skip_fwd.png differ diff --git a/skin/boxee/media/icons/icon_browser_osd_stop.png b/skin/boxee/media/icons/icon_browser_osd_stop.png new file mode 100644 index 00000000..c6274716 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_osd_stop.png differ diff --git a/skin/boxee/media/icons/icon_browser_reload.png b/skin/boxee/media/icons/icon_browser_reload.png new file mode 100644 index 00000000..5f41a384 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_reload.png differ diff --git a/skin/boxee/media/icons/icon_browser_stop.png b/skin/boxee/media/icons/icon_browser_stop.png new file mode 100644 index 00000000..364d7572 Binary files /dev/null and b/skin/boxee/media/icons/icon_browser_stop.png differ diff --git a/skin/boxee/media/icons/icon_chapters.png b/skin/boxee/media/icons/icon_chapters.png new file mode 100644 index 00000000..385cd17b Binary files /dev/null and b/skin/boxee/media/icons/icon_chapters.png differ diff --git a/skin/boxee/media/icons/icon_dialog_upgrade.png b/skin/boxee/media/icons/icon_dialog_upgrade.png new file mode 100644 index 00000000..3d0b90ec Binary files /dev/null and b/skin/boxee/media/icons/icon_dialog_upgrade.png differ diff --git a/skin/boxee/media/icons/icon_download_update.png b/skin/boxee/media/icons/icon_download_update.png new file mode 100644 index 00000000..c78e0851 Binary files /dev/null and b/skin/boxee/media/icons/icon_download_update.png differ diff --git a/skin/boxee/media/icons/icon_empty_clock.png b/skin/boxee/media/icons/icon_empty_clock.png new file mode 100644 index 00000000..dcf36dcb Binary files /dev/null and b/skin/boxee/media/icons/icon_empty_clock.png differ diff --git a/skin/boxee/media/icons/icon_favorite.png b/skin/boxee/media/icons/icon_favorite.png new file mode 100644 index 00000000..272d32ff Binary files /dev/null and b/skin/boxee/media/icons/icon_favorite.png differ diff --git a/skin/boxee/media/icons/icon_filter.png b/skin/boxee/media/icons/icon_filter.png new file mode 100644 index 00000000..4cf2b94f Binary files /dev/null and b/skin/boxee/media/icons/icon_filter.png differ diff --git a/skin/boxee/media/icons/icon_filter_off.png b/skin/boxee/media/icons/icon_filter_off.png new file mode 100644 index 00000000..4e294d16 Binary files /dev/null and b/skin/boxee/media/icons/icon_filter_off.png differ diff --git a/skin/boxee/media/icons/icon_filter_on.png b/skin/boxee/media/icons/icon_filter_on.png new file mode 100644 index 00000000..e079bef6 Binary files /dev/null and b/skin/boxee/media/icons/icon_filter_on.png differ diff --git a/skin/boxee/media/icons/icon_ipad.png b/skin/boxee/media/icons/icon_ipad.png new file mode 100644 index 00000000..0be8f079 Binary files /dev/null and b/skin/boxee/media/icons/icon_ipad.png differ diff --git a/skin/boxee/media/icons/icon_keyboard.png b/skin/boxee/media/icons/icon_keyboard.png new file mode 100644 index 00000000..d0192516 Binary files /dev/null and b/skin/boxee/media/icons/icon_keyboard.png differ diff --git a/skin/boxee/media/icons/icon_keyboard_backspace.png b/skin/boxee/media/icons/icon_keyboard_backspace.png new file mode 100644 index 00000000..fc10a050 Binary files /dev/null and b/skin/boxee/media/icons/icon_keyboard_backspace.png differ diff --git a/skin/boxee/media/icons/icon_keyboard_caps.png b/skin/boxee/media/icons/icon_keyboard_caps.png new file mode 100644 index 00000000..0cb2d285 Binary files /dev/null and b/skin/boxee/media/icons/icon_keyboard_caps.png differ diff --git a/skin/boxee/media/icons/icon_keyboard_globe.png b/skin/boxee/media/icons/icon_keyboard_globe.png new file mode 100644 index 00000000..ee1725bf Binary files /dev/null and b/skin/boxee/media/icons/icon_keyboard_globe.png differ diff --git a/skin/boxee/media/icons/icon_list_view.png b/skin/boxee/media/icons/icon_list_view.png new file mode 100644 index 00000000..01c99d4f Binary files /dev/null and b/skin/boxee/media/icons/icon_list_view.png differ diff --git a/skin/boxee/media/icons/icon_magnify_off.png b/skin/boxee/media/icons/icon_magnify_off.png new file mode 100644 index 00000000..f563b050 Binary files /dev/null and b/skin/boxee/media/icons/icon_magnify_off.png differ diff --git a/skin/boxee/media/icons/icon_magnify_on.png b/skin/boxee/media/icons/icon_magnify_on.png new file mode 100644 index 00000000..3c58251e Binary files /dev/null and b/skin/boxee/media/icons/icon_magnify_on.png differ diff --git a/skin/boxee/media/icons/icon_magnify_over.png b/skin/boxee/media/icons/icon_magnify_over.png new file mode 100644 index 00000000..a19c0af3 Binary files /dev/null and b/skin/boxee/media/icons/icon_magnify_over.png differ diff --git a/skin/boxee/media/icons/icon_media_action_browse_dvd_off.png b/skin/boxee/media/icons/icon_media_action_browse_dvd_off.png new file mode 100644 index 00000000..d20c79eb Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_browse_dvd_off.png differ diff --git a/skin/boxee/media/icons/icon_media_action_browse_dvd_on.png b/skin/boxee/media/icons/icon_media_action_browse_dvd_on.png new file mode 100644 index 00000000..08c77887 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_browse_dvd_on.png differ diff --git a/skin/boxee/media/icons/icon_media_action_eject_off.png b/skin/boxee/media/icons/icon_media_action_eject_off.png new file mode 100644 index 00000000..c2c0095d Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_eject_off.png differ diff --git a/skin/boxee/media/icons/icon_media_action_eject_on.png b/skin/boxee/media/icons/icon_media_action_eject_on.png new file mode 100644 index 00000000..ee07c9a7 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_eject_on.png differ diff --git a/skin/boxee/media/icons/icon_media_action_favorite_off_off.png b/skin/boxee/media/icons/icon_media_action_favorite_off_off.png new file mode 100644 index 00000000..38b8f3f4 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_favorite_off_off.png differ diff --git a/skin/boxee/media/icons/icon_media_action_favorite_off_on.png b/skin/boxee/media/icons/icon_media_action_favorite_off_on.png new file mode 100644 index 00000000..f9268826 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_favorite_off_on.png differ diff --git a/skin/boxee/media/icons/icon_media_action_favorite_on_off.png b/skin/boxee/media/icons/icon_media_action_favorite_on_off.png new file mode 100644 index 00000000..2568ad64 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_favorite_on_off.png differ diff --git a/skin/boxee/media/icons/icon_media_action_favorite_on_on.png b/skin/boxee/media/icons/icon_media_action_favorite_on_on.png new file mode 100644 index 00000000..483ce689 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_favorite_on_on.png differ diff --git a/skin/boxee/media/icons/icon_media_action_goto_show_off.png b/skin/boxee/media/icons/icon_media_action_goto_show_off.png new file mode 100644 index 00000000..e0cfbe7c Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_goto_show_off.png differ diff --git a/skin/boxee/media/icons/icon_media_action_goto_show_on.png b/skin/boxee/media/icons/icon_media_action_goto_show_on.png new file mode 100644 index 00000000..c3cb6312 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_goto_show_on.png differ diff --git a/skin/boxee/media/icons/icon_media_action_identify_off.png b/skin/boxee/media/icons/icon_media_action_identify_off.png new file mode 100644 index 00000000..945144b3 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_identify_off.png differ diff --git a/skin/boxee/media/icons/icon_media_action_identify_on.png b/skin/boxee/media/icons/icon_media_action_identify_on.png new file mode 100644 index 00000000..50845648 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_identify_on.png differ diff --git a/skin/boxee/media/icons/icon_media_action_info_off.png b/skin/boxee/media/icons/icon_media_action_info_off.png new file mode 100644 index 00000000..281735f3 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_info_off.png differ diff --git a/skin/boxee/media/icons/icon_media_action_info_on.png b/skin/boxee/media/icons/icon_media_action_info_on.png new file mode 100644 index 00000000..d5c456eb Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_info_on.png differ diff --git a/skin/boxee/media/icons/icon_media_action_share_off.png b/skin/boxee/media/icons/icon_media_action_share_off.png new file mode 100644 index 00000000..bdccad07 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_share_off.png differ diff --git a/skin/boxee/media/icons/icon_media_action_share_on.png b/skin/boxee/media/icons/icon_media_action_share_on.png new file mode 100644 index 00000000..2a4a5d81 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_share_on.png differ diff --git a/skin/boxee/media/icons/icon_media_action_trailer_off.png b/skin/boxee/media/icons/icon_media_action_trailer_off.png new file mode 100644 index 00000000..db6c3619 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_trailer_off.png differ diff --git a/skin/boxee/media/icons/icon_media_action_trailer_on.png b/skin/boxee/media/icons/icon_media_action_trailer_on.png new file mode 100644 index 00000000..edcc4f04 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_trailer_on.png differ diff --git a/skin/boxee/media/icons/icon_media_action_unwatched_off.png b/skin/boxee/media/icons/icon_media_action_unwatched_off.png new file mode 100644 index 00000000..d776c0e9 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_unwatched_off.png differ diff --git a/skin/boxee/media/icons/icon_media_action_unwatched_on.png b/skin/boxee/media/icons/icon_media_action_unwatched_on.png new file mode 100644 index 00000000..ac8cc4d1 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_unwatched_on.png differ diff --git a/skin/boxee/media/icons/icon_media_action_watch_later_off.png b/skin/boxee/media/icons/icon_media_action_watch_later_off.png new file mode 100644 index 00000000..a3446f6f Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_watch_later_off.png differ diff --git a/skin/boxee/media/icons/icon_media_action_watch_later_on.png b/skin/boxee/media/icons/icon_media_action_watch_later_on.png new file mode 100644 index 00000000..86cfe01e Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_watch_later_on.png differ diff --git a/skin/boxee/media/icons/icon_media_action_watch_later_remove_off.png b/skin/boxee/media/icons/icon_media_action_watch_later_remove_off.png new file mode 100644 index 00000000..4a4cdf32 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_watch_later_remove_off.png differ diff --git a/skin/boxee/media/icons/icon_media_action_watch_later_remove_on.png b/skin/boxee/media/icons/icon_media_action_watch_later_remove_on.png new file mode 100644 index 00000000..df92e1ab Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_watch_later_remove_on.png differ diff --git a/skin/boxee/media/icons/icon_media_action_watched_off.png b/skin/boxee/media/icons/icon_media_action_watched_off.png new file mode 100644 index 00000000..47314780 Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_watched_off.png differ diff --git a/skin/boxee/media/icons/icon_media_action_watched_on.png b/skin/boxee/media/icons/icon_media_action_watched_on.png new file mode 100644 index 00000000..8a84d87a Binary files /dev/null and b/skin/boxee/media/icons/icon_media_action_watched_on.png differ diff --git a/skin/boxee/media/icons/icon_network_off.png b/skin/boxee/media/icons/icon_network_off.png new file mode 100644 index 00000000..27bd368d Binary files /dev/null and b/skin/boxee/media/icons/icon_network_off.png differ diff --git a/skin/boxee/media/icons/icon_network_on.png b/skin/boxee/media/icons/icon_network_on.png new file mode 100644 index 00000000..48ca2720 Binary files /dev/null and b/skin/boxee/media/icons/icon_network_on.png differ diff --git a/skin/boxee/media/icons/icon_nomedia_apps.png b/skin/boxee/media/icons/icon_nomedia_apps.png new file mode 100644 index 00000000..bc5649bc Binary files /dev/null and b/skin/boxee/media/icons/icon_nomedia_apps.png differ diff --git a/skin/boxee/media/icons/icon_nomedia_files.png b/skin/boxee/media/icons/icon_nomedia_files.png new file mode 100644 index 00000000..04ca635f Binary files /dev/null and b/skin/boxee/media/icons/icon_nomedia_files.png differ diff --git a/skin/boxee/media/icons/icon_nomedia_geo.png b/skin/boxee/media/icons/icon_nomedia_geo.png new file mode 100644 index 00000000..bec44c15 Binary files /dev/null and b/skin/boxee/media/icons/icon_nomedia_geo.png differ diff --git a/skin/boxee/media/icons/icon_nomedia_history.png b/skin/boxee/media/icons/icon_nomedia_history.png new file mode 100644 index 00000000..277b8899 Binary files /dev/null and b/skin/boxee/media/icons/icon_nomedia_history.png differ diff --git a/skin/boxee/media/icons/icon_nomedia_watchlater.png b/skin/boxee/media/icons/icon_nomedia_watchlater.png new file mode 100644 index 00000000..dcf36dcb Binary files /dev/null and b/skin/boxee/media/icons/icon_nomedia_watchlater.png differ diff --git a/skin/boxee/media/icons/icon_osd_bwd_off.png b/skin/boxee/media/icons/icon_osd_bwd_off.png new file mode 100644 index 00000000..fc46ba7e Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_bwd_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_bwd_on.png b/skin/boxee/media/icons/icon_osd_bwd_on.png new file mode 100644 index 00000000..a1fd9bb5 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_bwd_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_chapters_off.png b/skin/boxee/media/icons/icon_osd_chapters_off.png new file mode 100644 index 00000000..2c497529 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_chapters_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_chapters_on.png b/skin/boxee/media/icons/icon_osd_chapters_on.png new file mode 100644 index 00000000..7b90ff1c Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_chapters_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_cursor_off.png b/skin/boxee/media/icons/icon_osd_cursor_off.png new file mode 100644 index 00000000..baf1623c Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_cursor_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_cursor_on.png b/skin/boxee/media/icons/icon_osd_cursor_on.png new file mode 100644 index 00000000..d465e800 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_cursor_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_favorite_off.png b/skin/boxee/media/icons/icon_osd_favorite_off.png new file mode 100644 index 00000000..22230ebd Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_favorite_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_favorite_on.png b/skin/boxee/media/icons/icon_osd_favorite_on.png new file mode 100644 index 00000000..320cc06a Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_favorite_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_fullscreen_exit_off.png b/skin/boxee/media/icons/icon_osd_fullscreen_exit_off.png new file mode 100644 index 00000000..49f2cf82 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_fullscreen_exit_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_fullscreen_exit_on.png b/skin/boxee/media/icons/icon_osd_fullscreen_exit_on.png new file mode 100644 index 00000000..db5a137b Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_fullscreen_exit_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_fwd_off.png b/skin/boxee/media/icons/icon_osd_fwd_off.png new file mode 100644 index 00000000..656e26cb Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_fwd_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_fwd_on.png b/skin/boxee/media/icons/icon_osd_fwd_on.png new file mode 100644 index 00000000..797cd94b Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_fwd_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_hd_off.png b/skin/boxee/media/icons/icon_osd_hd_off.png new file mode 100644 index 00000000..46cf7340 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_hd_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_hd_off_off.png b/skin/boxee/media/icons/icon_osd_hd_off_off.png new file mode 100644 index 00000000..5eb2f3a5 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_hd_off_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_hd_off_on.png b/skin/boxee/media/icons/icon_osd_hd_off_on.png new file mode 100644 index 00000000..8472200f Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_hd_off_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_hd_on.png b/skin/boxee/media/icons/icon_osd_hd_on.png new file mode 100644 index 00000000..3f80f260 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_hd_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_hd_on_off.png b/skin/boxee/media/icons/icon_osd_hd_on_off.png new file mode 100644 index 00000000..dd7d8fef Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_hd_on_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_hd_on_on.png b/skin/boxee/media/icons/icon_osd_hd_on_on.png new file mode 100644 index 00000000..cf56e26b Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_hd_on_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_info_off.png b/skin/boxee/media/icons/icon_osd_info_off.png new file mode 100644 index 00000000..281735f3 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_info_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_info_on.png b/skin/boxee/media/icons/icon_osd_info_on.png new file mode 100644 index 00000000..d5c456eb Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_info_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_minus_off_off.png b/skin/boxee/media/icons/icon_osd_minus_off_off.png new file mode 100644 index 00000000..65010dc5 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_minus_off_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_minus_off_on.png b/skin/boxee/media/icons/icon_osd_minus_off_on.png new file mode 100644 index 00000000..bb2767d8 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_minus_off_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_minus_on_off.png b/skin/boxee/media/icons/icon_osd_minus_on_off.png new file mode 100644 index 00000000..756f5179 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_minus_on_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_minus_on_on.png b/skin/boxee/media/icons/icon_osd_minus_on_on.png new file mode 100644 index 00000000..98e64e34 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_minus_on_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_next_off.png b/skin/boxee/media/icons/icon_osd_next_off.png new file mode 100644 index 00000000..3bcb1759 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_next_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_next_on.png b/skin/boxee/media/icons/icon_osd_next_on.png new file mode 100644 index 00000000..e4118073 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_next_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_no_repeat_off.png b/skin/boxee/media/icons/icon_osd_no_repeat_off.png new file mode 100644 index 00000000..7a0b6a75 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_no_repeat_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_no_repeat_on.png b/skin/boxee/media/icons/icon_osd_no_repeat_on.png new file mode 100644 index 00000000..a6b934b5 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_no_repeat_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_pan_focus.png b/skin/boxee/media/icons/icon_osd_pan_focus.png new file mode 100644 index 00000000..643d1d3e Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_pan_focus.png differ diff --git a/skin/boxee/media/icons/icon_osd_pan_off.png b/skin/boxee/media/icons/icon_osd_pan_off.png new file mode 100644 index 00000000..c01dff56 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_pan_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_pan_on.png b/skin/boxee/media/icons/icon_osd_pan_on.png new file mode 100644 index 00000000..991a809d Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_pan_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_pause_off.png b/skin/boxee/media/icons/icon_osd_pause_off.png new file mode 100644 index 00000000..5b2211d0 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_pause_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_pause_on.png b/skin/boxee/media/icons/icon_osd_pause_on.png new file mode 100644 index 00000000..23b0c0e9 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_pause_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_play_off.png b/skin/boxee/media/icons/icon_osd_play_off.png new file mode 100644 index 00000000..e9773c3b Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_play_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_play_on.png b/skin/boxee/media/icons/icon_osd_play_on.png new file mode 100644 index 00000000..0a24decf Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_play_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_previous_off.png b/skin/boxee/media/icons/icon_osd_previous_off.png new file mode 100644 index 00000000..023a5514 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_previous_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_previous_on.png b/skin/boxee/media/icons/icon_osd_previous_on.png new file mode 100644 index 00000000..d6709d6f Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_previous_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_repeat_off.png b/skin/boxee/media/icons/icon_osd_repeat_off.png new file mode 100644 index 00000000..33fc5c4f Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_repeat_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_repeat_on.png b/skin/boxee/media/icons/icon_osd_repeat_on.png new file mode 100644 index 00000000..be0eef73 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_repeat_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_repeat_one_off.png b/skin/boxee/media/icons/icon_osd_repeat_one_off.png new file mode 100644 index 00000000..b45c38e9 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_repeat_one_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_repeat_one_on.png b/skin/boxee/media/icons/icon_osd_repeat_one_on.png new file mode 100644 index 00000000..da690169 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_repeat_one_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_rotate_off.png b/skin/boxee/media/icons/icon_osd_rotate_off.png new file mode 100644 index 00000000..aed03045 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_rotate_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_rotate_on.png b/skin/boxee/media/icons/icon_osd_rotate_on.png new file mode 100644 index 00000000..198351d0 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_rotate_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_settings_off.png b/skin/boxee/media/icons/icon_osd_settings_off.png new file mode 100644 index 00000000..1b2b15c4 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_settings_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_settings_on.png b/skin/boxee/media/icons/icon_osd_settings_on.png new file mode 100644 index 00000000..06c727f5 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_settings_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_share_off.png b/skin/boxee/media/icons/icon_osd_share_off.png new file mode 100644 index 00000000..bdccad07 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_share_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_share_on.png b/skin/boxee/media/icons/icon_osd_share_on.png new file mode 100644 index 00000000..2a4a5d81 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_share_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_shuffle_off.png b/skin/boxee/media/icons/icon_osd_shuffle_off.png new file mode 100644 index 00000000..a00bf3bb Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_shuffle_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_shuffle_on.png b/skin/boxee/media/icons/icon_osd_shuffle_on.png new file mode 100644 index 00000000..13391957 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_shuffle_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_stop_off.png b/skin/boxee/media/icons/icon_osd_stop_off.png new file mode 100644 index 00000000..28d3309f Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_stop_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_stop_on.png b/skin/boxee/media/icons/icon_osd_stop_on.png new file mode 100644 index 00000000..852b1b17 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_stop_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_subtitles_off.png b/skin/boxee/media/icons/icon_osd_subtitles_off.png new file mode 100644 index 00000000..faa318ad Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_subtitles_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_subtitles_on.png b/skin/boxee/media/icons/icon_osd_subtitles_on.png new file mode 100644 index 00000000..b66f1e18 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_subtitles_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_tech_info.png b/skin/boxee/media/icons/icon_osd_tech_info.png new file mode 100644 index 00000000..92cdd904 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_tech_info.png differ diff --git a/skin/boxee/media/icons/icon_osd_unshuffle_off.png b/skin/boxee/media/icons/icon_osd_unshuffle_off.png new file mode 100644 index 00000000..3e64a023 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_unshuffle_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_unshuffle_on.png b/skin/boxee/media/icons/icon_osd_unshuffle_on.png new file mode 100644 index 00000000..9d9a8b1c Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_unshuffle_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_zoom_in_off.png b/skin/boxee/media/icons/icon_osd_zoom_in_off.png new file mode 100644 index 00000000..8fad2a6f Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_zoom_in_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_zoom_in_on.png b/skin/boxee/media/icons/icon_osd_zoom_in_on.png new file mode 100644 index 00000000..2a44d498 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_zoom_in_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_zoom_off.png b/skin/boxee/media/icons/icon_osd_zoom_off.png new file mode 100644 index 00000000..3dc09dbb Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_zoom_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_zoom_on.png b/skin/boxee/media/icons/icon_osd_zoom_on.png new file mode 100644 index 00000000..53d8ad29 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_zoom_on.png differ diff --git a/skin/boxee/media/icons/icon_osd_zoom_out_off.png b/skin/boxee/media/icons/icon_osd_zoom_out_off.png new file mode 100644 index 00000000..ae032058 Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_zoom_out_off.png differ diff --git a/skin/boxee/media/icons/icon_osd_zoom_out_on.png b/skin/boxee/media/icons/icon_osd_zoom_out_on.png new file mode 100644 index 00000000..baf30afd Binary files /dev/null and b/skin/boxee/media/icons/icon_osd_zoom_out_on.png differ diff --git a/skin/boxee/media/icons/icon_quality_HD.png b/skin/boxee/media/icons/icon_quality_HD.png new file mode 100644 index 00000000..04a837e0 Binary files /dev/null and b/skin/boxee/media/icons/icon_quality_HD.png differ diff --git a/skin/boxee/media/icons/icon_quality_SD.png b/skin/boxee/media/icons/icon_quality_SD.png new file mode 100644 index 00000000..34f6fb28 Binary files /dev/null and b/skin/boxee/media/icons/icon_quality_SD.png differ diff --git a/skin/boxee/media/icons/icon_radiobutton_empty.png b/skin/boxee/media/icons/icon_radiobutton_empty.png new file mode 100755 index 00000000..a313995c Binary files /dev/null and b/skin/boxee/media/icons/icon_radiobutton_empty.png differ diff --git a/skin/boxee/media/icons/icon_radiobutton_full.png b/skin/boxee/media/icons/icon_radiobutton_full.png new file mode 100755 index 00000000..67fc6732 Binary files /dev/null and b/skin/boxee/media/icons/icon_radiobutton_full.png differ diff --git a/skin/boxee/media/icons/icon_rating_star_0.png b/skin/boxee/media/icons/icon_rating_star_0.png new file mode 100644 index 00000000..5b7051a3 Binary files /dev/null and b/skin/boxee/media/icons/icon_rating_star_0.png differ diff --git a/skin/boxee/media/icons/icon_remove_favorite_off.png b/skin/boxee/media/icons/icon_remove_favorite_off.png new file mode 100644 index 00000000..681f124a Binary files /dev/null and b/skin/boxee/media/icons/icon_remove_favorite_off.png differ diff --git a/skin/boxee/media/icons/icon_remove_favorite_on.png b/skin/boxee/media/icons/icon_remove_favorite_on.png new file mode 100644 index 00000000..2bf9926e Binary files /dev/null and b/skin/boxee/media/icons/icon_remove_favorite_on.png differ diff --git a/skin/boxee/media/icons/icon_sd.png b/skin/boxee/media/icons/icon_sd.png new file mode 100644 index 00000000..bfbfc87e Binary files /dev/null and b/skin/boxee/media/icons/icon_sd.png differ diff --git a/skin/boxee/media/icons/icon_selected.png b/skin/boxee/media/icons/icon_selected.png new file mode 100644 index 00000000..050c4db1 Binary files /dev/null and b/skin/boxee/media/icons/icon_selected.png differ diff --git a/skin/boxee/media/icons/icon_settings_about.png b/skin/boxee/media/icons/icon_settings_about.png new file mode 100644 index 00000000..83845939 Binary files /dev/null and b/skin/boxee/media/icons/icon_settings_about.png differ diff --git a/skin/boxee/media/icons/icon_settings_devices.png b/skin/boxee/media/icons/icon_settings_devices.png new file mode 100644 index 00000000..8e06a0d0 Binary files /dev/null and b/skin/boxee/media/icons/icon_settings_devices.png differ diff --git a/skin/boxee/media/icons/icon_settings_off.png b/skin/boxee/media/icons/icon_settings_off.png new file mode 100644 index 00000000..d0d7f030 Binary files /dev/null and b/skin/boxee/media/icons/icon_settings_off.png differ diff --git a/skin/boxee/media/icons/icon_settings_on.png b/skin/boxee/media/icons/icon_settings_on.png new file mode 100644 index 00000000..eb508d59 Binary files /dev/null and b/skin/boxee/media/icons/icon_settings_on.png differ diff --git a/skin/boxee/media/icons/icon_show_genres.png b/skin/boxee/media/icons/icon_show_genres.png new file mode 100644 index 00000000..c5773817 Binary files /dev/null and b/skin/boxee/media/icons/icon_show_genres.png differ diff --git a/skin/boxee/media/icons/icon_show_genres_off.png b/skin/boxee/media/icons/icon_show_genres_off.png new file mode 100644 index 00000000..c31e250a Binary files /dev/null and b/skin/boxee/media/icons/icon_show_genres_off.png differ diff --git a/skin/boxee/media/icons/icon_show_genres_on.png b/skin/boxee/media/icons/icon_show_genres_on.png new file mode 100644 index 00000000..1399158c Binary files /dev/null and b/skin/boxee/media/icons/icon_show_genres_on.png differ diff --git a/skin/boxee/media/icons/icon_show_genres_over.png b/skin/boxee/media/icons/icon_show_genres_over.png new file mode 100644 index 00000000..13b5f222 Binary files /dev/null and b/skin/boxee/media/icons/icon_show_genres_over.png differ diff --git a/skin/boxee/media/icons/icon_shutdown_off.png b/skin/boxee/media/icons/icon_shutdown_off.png new file mode 100644 index 00000000..ffad7833 Binary files /dev/null and b/skin/boxee/media/icons/icon_shutdown_off.png differ diff --git a/skin/boxee/media/icons/icon_shutdown_on.png b/skin/boxee/media/icons/icon_shutdown_on.png new file mode 100644 index 00000000..9de868af Binary files /dev/null and b/skin/boxee/media/icons/icon_shutdown_on.png differ diff --git a/skin/boxee/media/icons/icon_shutdown_shutdown.png b/skin/boxee/media/icons/icon_shutdown_shutdown.png new file mode 100644 index 00000000..976baa2d Binary files /dev/null and b/skin/boxee/media/icons/icon_shutdown_shutdown.png differ diff --git a/skin/boxee/media/icons/icon_shutdown_sleep.png b/skin/boxee/media/icons/icon_shutdown_sleep.png new file mode 100644 index 00000000..8c18a4c2 Binary files /dev/null and b/skin/boxee/media/icons/icon_shutdown_sleep.png differ diff --git a/skin/boxee/media/icons/icon_shutdown_switch_user.png b/skin/boxee/media/icons/icon_shutdown_switch_user.png new file mode 100644 index 00000000..f218af46 Binary files /dev/null and b/skin/boxee/media/icons/icon_shutdown_switch_user.png differ diff --git a/skin/boxee/media/icons/icon_shutdown_upgrade.png b/skin/boxee/media/icons/icon_shutdown_upgrade.png new file mode 100644 index 00000000..3b4b6ca0 Binary files /dev/null and b/skin/boxee/media/icons/icon_shutdown_upgrade.png differ diff --git a/skin/boxee/media/icons/icon_sort.png b/skin/boxee/media/icons/icon_sort.png new file mode 100644 index 00000000..e6a0f7c5 Binary files /dev/null and b/skin/boxee/media/icons/icon_sort.png differ diff --git a/skin/boxee/media/icons/icon_star.png b/skin/boxee/media/icons/icon_star.png new file mode 100644 index 00000000..4e243321 Binary files /dev/null and b/skin/boxee/media/icons/icon_star.png differ diff --git a/skin/boxee/media/icons/icon_tablet.png b/skin/boxee/media/icons/icon_tablet.png new file mode 100644 index 00000000..0be8f079 Binary files /dev/null and b/skin/boxee/media/icons/icon_tablet.png differ diff --git a/skin/boxee/media/icons/icon_thumb_view.png b/skin/boxee/media/icons/icon_thumb_view.png new file mode 100644 index 00000000..25cee6e7 Binary files /dev/null and b/skin/boxee/media/icons/icon_thumb_view.png differ diff --git a/skin/boxee/media/icons/info.png b/skin/boxee/media/icons/info.png new file mode 100644 index 00000000..27f7e768 Binary files /dev/null and b/skin/boxee/media/icons/info.png differ diff --git a/skin/boxee/media/icons/logo-ac3.png b/skin/boxee/media/icons/logo-ac3.png new file mode 100644 index 00000000..1d472bba Binary files /dev/null and b/skin/boxee/media/icons/logo-ac3.png differ diff --git a/skin/boxee/media/icons/logo-dca.png b/skin/boxee/media/icons/logo-dca.png new file mode 100644 index 00000000..94e06ec6 Binary files /dev/null and b/skin/boxee/media/icons/logo-dca.png differ diff --git a/skin/boxee/media/icons/share.png b/skin/boxee/media/icons/share.png new file mode 100644 index 00000000..d2a50bec Binary files /dev/null and b/skin/boxee/media/icons/share.png differ diff --git a/skin/boxee/media/icons/share_kai.png b/skin/boxee/media/icons/share_kai.png new file mode 100644 index 00000000..99dd3fc5 Binary files /dev/null and b/skin/boxee/media/icons/share_kai.png differ diff --git a/skin/boxee/media/icons/trailer.png b/skin/boxee/media/icons/trailer.png new file mode 100644 index 00000000..fac5a3f5 Binary files /dev/null and b/skin/boxee/media/icons/trailer.png differ diff --git a/skin/boxee/media/icons/watch-later.png b/skin/boxee/media/icons/watch-later.png new file mode 100644 index 00000000..7366ac62 Binary files /dev/null and b/skin/boxee/media/icons/watch-later.png differ diff --git a/skin/boxee/media/kaidialog/kai-alert.png b/skin/boxee/media/kaidialog/kai-alert.png new file mode 100644 index 00000000..00ae25de Binary files /dev/null and b/skin/boxee/media/kaidialog/kai-alert.png differ diff --git a/skin/boxee/media/kaidialog/kai-check.png b/skin/boxee/media/kaidialog/kai-check.png new file mode 100644 index 00000000..a3b5d9ba Binary files /dev/null and b/skin/boxee/media/kaidialog/kai-check.png differ diff --git a/skin/boxee/media/kaidialog/kai-dialog.png b/skin/boxee/media/kaidialog/kai-dialog.png new file mode 100644 index 00000000..a4a245d7 Binary files /dev/null and b/skin/boxee/media/kaidialog/kai-dialog.png differ diff --git a/skin/boxee/media/kaidialog/kai-download.png b/skin/boxee/media/kaidialog/kai-download.png new file mode 100644 index 00000000..48819cf8 Binary files /dev/null and b/skin/boxee/media/kaidialog/kai-download.png differ diff --git a/skin/boxee/media/kaidialog/kai-heart.png b/skin/boxee/media/kaidialog/kai-heart.png new file mode 100644 index 00000000..fc681d8d Binary files /dev/null and b/skin/boxee/media/kaidialog/kai-heart.png differ diff --git a/skin/boxee/media/kaidialog/kai-minus.png b/skin/boxee/media/kaidialog/kai-minus.png new file mode 100644 index 00000000..6e519c17 Binary files /dev/null and b/skin/boxee/media/kaidialog/kai-minus.png differ diff --git a/skin/boxee/media/kaidialog/kai-plus.png b/skin/boxee/media/kaidialog/kai-plus.png new file mode 100644 index 00000000..e51e3a7f Binary files /dev/null and b/skin/boxee/media/kaidialog/kai-plus.png differ diff --git a/skin/boxee/media/kaidialog/kai-scan.png b/skin/boxee/media/kaidialog/kai-scan.png new file mode 100644 index 00000000..a879da81 Binary files /dev/null and b/skin/boxee/media/kaidialog/kai-scan.png differ diff --git a/skin/boxee/media/kaidialog/kai-search.png b/skin/boxee/media/kaidialog/kai-search.png new file mode 100644 index 00000000..c411c233 Binary files /dev/null and b/skin/boxee/media/kaidialog/kai-search.png differ diff --git a/skin/boxee/media/kaidialog/kai-star.png b/skin/boxee/media/kaidialog/kai-star.png new file mode 100644 index 00000000..c9829ad6 Binary files /dev/null and b/skin/boxee/media/kaidialog/kai-star.png differ diff --git a/skin/boxee/media/kaidialog/kai-update.png b/skin/boxee/media/kaidialog/kai-update.png new file mode 100644 index 00000000..cb78f6e2 Binary files /dev/null and b/skin/boxee/media/kaidialog/kai-update.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-bl-active.png b/skin/boxee/media/keyboard/keyboard-rounded-bl-active.png new file mode 100644 index 00000000..b6f1c74b Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-bl-active.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-bl-base.png b/skin/boxee/media/keyboard/keyboard-rounded-bl-base.png new file mode 100644 index 00000000..3b0aec59 Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-bl-base.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-bl-on.png b/skin/boxee/media/keyboard/keyboard-rounded-bl-on.png new file mode 100644 index 00000000..9c07ce68 Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-bl-on.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-br-active.png b/skin/boxee/media/keyboard/keyboard-rounded-br-active.png new file mode 100644 index 00000000..c0aa7d6b Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-br-active.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-br-base.png b/skin/boxee/media/keyboard/keyboard-rounded-br-base.png new file mode 100644 index 00000000..646a86d3 Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-br-base.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-br-on.png b/skin/boxee/media/keyboard/keyboard-rounded-br-on.png new file mode 100644 index 00000000..c5c2230a Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-br-on.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-t-active.png b/skin/boxee/media/keyboard/keyboard-rounded-t-active.png new file mode 100644 index 00000000..afd98c05 Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-t-active.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-t-base.png b/skin/boxee/media/keyboard/keyboard-rounded-t-base.png new file mode 100644 index 00000000..8f2de7f1 Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-t-base.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-t-on.png b/skin/boxee/media/keyboard/keyboard-rounded-t-on.png new file mode 100644 index 00000000..3c37d3ec Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-t-on.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-tl-active.png b/skin/boxee/media/keyboard/keyboard-rounded-tl-active.png new file mode 100644 index 00000000..c66c78c8 Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-tl-active.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-tl-base.png b/skin/boxee/media/keyboard/keyboard-rounded-tl-base.png new file mode 100644 index 00000000..e7b0375c Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-tl-base.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-tl-on.png b/skin/boxee/media/keyboard/keyboard-rounded-tl-on.png new file mode 100644 index 00000000..48cfdc2b Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-tl-on.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-tr-active.png b/skin/boxee/media/keyboard/keyboard-rounded-tr-active.png new file mode 100644 index 00000000..a8f4dbe0 Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-tr-active.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-tr-base.png b/skin/boxee/media/keyboard/keyboard-rounded-tr-base.png new file mode 100644 index 00000000..e0cf515c Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-tr-base.png differ diff --git a/skin/boxee/media/keyboard/keyboard-rounded-tr-on.png b/skin/boxee/media/keyboard/keyboard-rounded-tr-on.png new file mode 100644 index 00000000..c2527d5c Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-rounded-tr-on.png differ diff --git a/skin/boxee/media/keyboard/keyboard-square-active.png b/skin/boxee/media/keyboard/keyboard-square-active.png new file mode 100644 index 00000000..ffef2b30 Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-square-active.png differ diff --git a/skin/boxee/media/keyboard/keyboard-square-base.png b/skin/boxee/media/keyboard/keyboard-square-base.png new file mode 100644 index 00000000..d6b48302 Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-square-base.png differ diff --git a/skin/boxee/media/keyboard/keyboard-square-on.png b/skin/boxee/media/keyboard/keyboard-square-on.png new file mode 100644 index 00000000..8d0817c4 Binary files /dev/null and b/skin/boxee/media/keyboard/keyboard-square-on.png differ diff --git a/skin/boxee/media/keyboard_backspace_icon_on.png b/skin/boxee/media/keyboard_backspace_icon_on.png new file mode 100644 index 00000000..6aa8cc2b Binary files /dev/null and b/skin/boxee/media/keyboard_backspace_icon_on.png differ diff --git a/skin/boxee/media/keyboard_button.png b/skin/boxee/media/keyboard_button.png new file mode 100644 index 00000000..35d9525c Binary files /dev/null and b/skin/boxee/media/keyboard_button.png differ diff --git a/skin/boxee/media/keyboard_button_bottom_left.png b/skin/boxee/media/keyboard_button_bottom_left.png new file mode 100644 index 00000000..f9990d2d Binary files /dev/null and b/skin/boxee/media/keyboard_button_bottom_left.png differ diff --git a/skin/boxee/media/keyboard_button_bottom_left_on.png b/skin/boxee/media/keyboard_button_bottom_left_on.png new file mode 100644 index 00000000..9c079997 Binary files /dev/null and b/skin/boxee/media/keyboard_button_bottom_left_on.png differ diff --git a/skin/boxee/media/keyboard_button_bottom_right.png b/skin/boxee/media/keyboard_button_bottom_right.png new file mode 100644 index 00000000..ca95bf33 Binary files /dev/null and b/skin/boxee/media/keyboard_button_bottom_right.png differ diff --git a/skin/boxee/media/keyboard_button_http.png b/skin/boxee/media/keyboard_button_http.png new file mode 100644 index 00000000..d0d718cb Binary files /dev/null and b/skin/boxee/media/keyboard_button_http.png differ diff --git a/skin/boxee/media/keyboard_button_top_left.png b/skin/boxee/media/keyboard_button_top_left.png new file mode 100644 index 00000000..c85cc01a Binary files /dev/null and b/skin/boxee/media/keyboard_button_top_left.png differ diff --git a/skin/boxee/media/keyboard_button_top_right.png b/skin/boxee/media/keyboard_button_top_right.png new file mode 100644 index 00000000..f0646816 Binary files /dev/null and b/skin/boxee/media/keyboard_button_top_right.png differ diff --git a/skin/boxee/media/keyboard_caps_icon_on.png b/skin/boxee/media/keyboard_caps_icon_on.png new file mode 100644 index 00000000..f1e919a3 Binary files /dev/null and b/skin/boxee/media/keyboard_caps_icon_on.png differ diff --git a/skin/boxee/media/left_menu_tab.png b/skin/boxee/media/left_menu_tab.png new file mode 100644 index 00000000..5d44745c Binary files /dev/null and b/skin/boxee/media/left_menu_tab.png differ diff --git a/skin/boxee/media/letters_scroll_bg.png b/skin/boxee/media/letters_scroll_bg.png new file mode 100644 index 00000000..90b599f5 Binary files /dev/null and b/skin/boxee/media/letters_scroll_bg.png differ diff --git a/skin/boxee/media/line_view_on2.png b/skin/boxee/media/line_view_on2.png new file mode 100644 index 00000000..85bbbf30 Binary files /dev/null and b/skin/boxee/media/line_view_on2.png differ diff --git a/skin/boxee/media/line_view_on3.png b/skin/boxee/media/line_view_on3.png new file mode 100644 index 00000000..b612173c Binary files /dev/null and b/skin/boxee/media/line_view_on3.png differ diff --git a/skin/boxee/media/livetv/button-radio-off-focused.png b/skin/boxee/media/livetv/button-radio-off-focused.png new file mode 100644 index 00000000..a34e3897 Binary files /dev/null and b/skin/boxee/media/livetv/button-radio-off-focused.png differ diff --git a/skin/boxee/media/livetv/button-radio-off-unfocused.png b/skin/boxee/media/livetv/button-radio-off-unfocused.png new file mode 100644 index 00000000..01a58c09 Binary files /dev/null and b/skin/boxee/media/livetv/button-radio-off-unfocused.png differ diff --git a/skin/boxee/media/livetv/button-radio-on-focused.png b/skin/boxee/media/livetv/button-radio-on-focused.png new file mode 100644 index 00000000..5a0b77d9 Binary files /dev/null and b/skin/boxee/media/livetv/button-radio-on-focused.png differ diff --git a/skin/boxee/media/livetv/button-radio-on-unfocused.png b/skin/boxee/media/livetv/button-radio-on-unfocused.png new file mode 100644 index 00000000..010917b2 Binary files /dev/null and b/skin/boxee/media/livetv/button-radio-on-unfocused.png differ diff --git a/skin/boxee/media/livetv/graphic-arrow-left.png b/skin/boxee/media/livetv/graphic-arrow-left.png new file mode 100644 index 00000000..b4864a5c Binary files /dev/null and b/skin/boxee/media/livetv/graphic-arrow-left.png differ diff --git a/skin/boxee/media/livetv/graphic-divider-588.png b/skin/boxee/media/livetv/graphic-divider-588.png new file mode 100644 index 00000000..80f0d22c Binary files /dev/null and b/skin/boxee/media/livetv/graphic-divider-588.png differ diff --git a/skin/boxee/media/livetv/graphic-divider-768.png b/skin/boxee/media/livetv/graphic-divider-768.png new file mode 100644 index 00000000..08c4a521 Binary files /dev/null and b/skin/boxee/media/livetv/graphic-divider-768.png differ diff --git a/skin/boxee/media/livetv/graphic-no-signal.png b/skin/boxee/media/livetv/graphic-no-signal.png new file mode 100644 index 00000000..fb91780d Binary files /dev/null and b/skin/boxee/media/livetv/graphic-no-signal.png differ diff --git a/skin/boxee/media/livetv/graphic-scanning-progress-bg.png b/skin/boxee/media/livetv/graphic-scanning-progress-bg.png new file mode 100644 index 00000000..b13671ab Binary files /dev/null and b/skin/boxee/media/livetv/graphic-scanning-progress-bg.png differ diff --git a/skin/boxee/media/livetv/graphic-scanning-progress-center.png b/skin/boxee/media/livetv/graphic-scanning-progress-center.png new file mode 100644 index 00000000..61b7fae5 Binary files /dev/null and b/skin/boxee/media/livetv/graphic-scanning-progress-center.png differ diff --git a/skin/boxee/media/livetv/graphic-scanning-progress-left.png b/skin/boxee/media/livetv/graphic-scanning-progress-left.png new file mode 100644 index 00000000..5b4cf7b8 Binary files /dev/null and b/skin/boxee/media/livetv/graphic-scanning-progress-left.png differ diff --git a/skin/boxee/media/livetv/graphic-scanning-progress-right.png b/skin/boxee/media/livetv/graphic-scanning-progress-right.png new file mode 100644 index 00000000..d74cb4f7 Binary files /dev/null and b/skin/boxee/media/livetv/graphic-scanning-progress-right.png differ diff --git a/skin/boxee/media/livetv/graphic-scanning.png b/skin/boxee/media/livetv/graphic-scanning.png new file mode 100644 index 00000000..0f468c69 Binary files /dev/null and b/skin/boxee/media/livetv/graphic-scanning.png differ diff --git a/skin/boxee/media/livetv/graphic_dongle_antenna.png b/skin/boxee/media/livetv/graphic_dongle_antenna.png new file mode 100644 index 00000000..f02a0b3e Binary files /dev/null and b/skin/boxee/media/livetv/graphic_dongle_antenna.png differ diff --git a/skin/boxee/media/livetv/icon-channels.png b/skin/boxee/media/livetv/icon-channels.png new file mode 100644 index 00000000..c099ba55 Binary files /dev/null and b/skin/boxee/media/livetv/icon-channels.png differ diff --git a/skin/boxee/media/livetv/icon-follow.png b/skin/boxee/media/livetv/icon-follow.png new file mode 100644 index 00000000..74857cd1 Binary files /dev/null and b/skin/boxee/media/livetv/icon-follow.png differ diff --git a/skin/boxee/media/livetv/icon-info-large.png b/skin/boxee/media/livetv/icon-info-large.png new file mode 100644 index 00000000..00a07783 Binary files /dev/null and b/skin/boxee/media/livetv/icon-info-large.png differ diff --git a/skin/boxee/media/livetv/icon-live.png b/skin/boxee/media/livetv/icon-live.png new file mode 100644 index 00000000..d89c2de1 Binary files /dev/null and b/skin/boxee/media/livetv/icon-live.png differ diff --git a/skin/boxee/media/livetv/icon-new.png b/skin/boxee/media/livetv/icon-new.png new file mode 100644 index 00000000..7a292e6b Binary files /dev/null and b/skin/boxee/media/livetv/icon-new.png differ diff --git a/skin/boxee/media/livetv/icon-sharing-disabled.png b/skin/boxee/media/livetv/icon-sharing-disabled.png new file mode 100644 index 00000000..f0cc3776 Binary files /dev/null and b/skin/boxee/media/livetv/icon-sharing-disabled.png differ diff --git a/skin/boxee/media/livetv/icon-sharing-enabled.png b/skin/boxee/media/livetv/icon-sharing-enabled.png new file mode 100644 index 00000000..d3f78ce0 Binary files /dev/null and b/skin/boxee/media/livetv/icon-sharing-enabled.png differ diff --git a/skin/boxee/media/livetv/icon-tune-in.png b/skin/boxee/media/livetv/icon-tune-in.png new file mode 100644 index 00000000..1dd75d18 Binary files /dev/null and b/skin/boxee/media/livetv/icon-tune-in.png differ diff --git a/skin/boxee/media/livetv/skirt-left.png b/skin/boxee/media/livetv/skirt-left.png new file mode 100644 index 00000000..242e4bb4 Binary files /dev/null and b/skin/boxee/media/livetv/skirt-left.png differ diff --git a/skin/boxee/media/livetv/skirt-right.png b/skin/boxee/media/livetv/skirt-right.png new file mode 100644 index 00000000..54058f1d Binary files /dev/null and b/skin/boxee/media/livetv/skirt-right.png differ diff --git a/skin/boxee/media/loading_small/010039.png b/skin/boxee/media/loading_small/010039.png new file mode 100644 index 00000000..edf4c576 Binary files /dev/null and b/skin/boxee/media/loading_small/010039.png differ diff --git a/skin/boxee/media/loading_small/010040.png b/skin/boxee/media/loading_small/010040.png new file mode 100644 index 00000000..2f5b37a2 Binary files /dev/null and b/skin/boxee/media/loading_small/010040.png differ diff --git a/skin/boxee/media/loading_small/010041.png b/skin/boxee/media/loading_small/010041.png new file mode 100644 index 00000000..df58b30f Binary files /dev/null and b/skin/boxee/media/loading_small/010041.png differ diff --git a/skin/boxee/media/loading_small/010042.png b/skin/boxee/media/loading_small/010042.png new file mode 100644 index 00000000..1d5cc082 Binary files /dev/null and b/skin/boxee/media/loading_small/010042.png differ diff --git a/skin/boxee/media/loading_small/010043.png b/skin/boxee/media/loading_small/010043.png new file mode 100644 index 00000000..67102262 Binary files /dev/null and b/skin/boxee/media/loading_small/010043.png differ diff --git a/skin/boxee/media/loading_small/010044.png b/skin/boxee/media/loading_small/010044.png new file mode 100644 index 00000000..6ca4ebfc Binary files /dev/null and b/skin/boxee/media/loading_small/010044.png differ diff --git a/skin/boxee/media/loading_small/010045.png b/skin/boxee/media/loading_small/010045.png new file mode 100644 index 00000000..b7275df2 Binary files /dev/null and b/skin/boxee/media/loading_small/010045.png differ diff --git a/skin/boxee/media/loading_small/010046.png b/skin/boxee/media/loading_small/010046.png new file mode 100644 index 00000000..8910a076 Binary files /dev/null and b/skin/boxee/media/loading_small/010046.png differ diff --git a/skin/boxee/media/loading_small/010047.png b/skin/boxee/media/loading_small/010047.png new file mode 100644 index 00000000..95fb65ae Binary files /dev/null and b/skin/boxee/media/loading_small/010047.png differ diff --git a/skin/boxee/media/loading_small/010048.png b/skin/boxee/media/loading_small/010048.png new file mode 100644 index 00000000..d97feac4 Binary files /dev/null and b/skin/boxee/media/loading_small/010048.png differ diff --git a/skin/boxee/media/loading_small/010049.png b/skin/boxee/media/loading_small/010049.png new file mode 100644 index 00000000..c2167edf Binary files /dev/null and b/skin/boxee/media/loading_small/010049.png differ diff --git a/skin/boxee/media/loading_small/010050.png b/skin/boxee/media/loading_small/010050.png new file mode 100644 index 00000000..c829b030 Binary files /dev/null and b/skin/boxee/media/loading_small/010050.png differ diff --git a/skin/boxee/media/loading_small/010051.png b/skin/boxee/media/loading_small/010051.png new file mode 100644 index 00000000..e4c04165 Binary files /dev/null and b/skin/boxee/media/loading_small/010051.png differ diff --git a/skin/boxee/media/loading_small/010052.png b/skin/boxee/media/loading_small/010052.png new file mode 100644 index 00000000..4ed01f2a Binary files /dev/null and b/skin/boxee/media/loading_small/010052.png differ diff --git a/skin/boxee/media/loading_small/010053.png b/skin/boxee/media/loading_small/010053.png new file mode 100644 index 00000000..c1dc1eb5 Binary files /dev/null and b/skin/boxee/media/loading_small/010053.png differ diff --git a/skin/boxee/media/loading_small/010054.png b/skin/boxee/media/loading_small/010054.png new file mode 100644 index 00000000..532f8838 Binary files /dev/null and b/skin/boxee/media/loading_small/010054.png differ diff --git a/skin/boxee/media/loading_small/010055.png b/skin/boxee/media/loading_small/010055.png new file mode 100644 index 00000000..c5d4d1e8 Binary files /dev/null and b/skin/boxee/media/loading_small/010055.png differ diff --git a/skin/boxee/media/loading_small/010056.png b/skin/boxee/media/loading_small/010056.png new file mode 100644 index 00000000..1b3581b3 Binary files /dev/null and b/skin/boxee/media/loading_small/010056.png differ diff --git a/skin/boxee/media/loading_small/010057.png b/skin/boxee/media/loading_small/010057.png new file mode 100644 index 00000000..f2350800 Binary files /dev/null and b/skin/boxee/media/loading_small/010057.png differ diff --git a/skin/boxee/media/loading_small/010058.png b/skin/boxee/media/loading_small/010058.png new file mode 100644 index 00000000..73e5cbbc Binary files /dev/null and b/skin/boxee/media/loading_small/010058.png differ diff --git a/skin/boxee/media/loading_small/010059.png b/skin/boxee/media/loading_small/010059.png new file mode 100644 index 00000000..44220e78 Binary files /dev/null and b/skin/boxee/media/loading_small/010059.png differ diff --git a/skin/boxee/media/loading_small/010060.png b/skin/boxee/media/loading_small/010060.png new file mode 100644 index 00000000..153e10de Binary files /dev/null and b/skin/boxee/media/loading_small/010060.png differ diff --git a/skin/boxee/media/login_icons/add_user.png b/skin/boxee/media/login_icons/add_user.png new file mode 100644 index 00000000..a32f5f05 Binary files /dev/null and b/skin/boxee/media/login_icons/add_user.png differ diff --git a/skin/boxee/media/login_icons/exit.png b/skin/boxee/media/login_icons/exit.png new file mode 100644 index 00000000..a52c46a9 Binary files /dev/null and b/skin/boxee/media/login_icons/exit.png differ diff --git a/skin/boxee/media/login_icons/icon_settings_off.png b/skin/boxee/media/login_icons/icon_settings_off.png new file mode 100644 index 00000000..d0d7f030 Binary files /dev/null and b/skin/boxee/media/login_icons/icon_settings_off.png differ diff --git a/skin/boxee/media/login_icons/icon_settings_on.png b/skin/boxee/media/login_icons/icon_settings_on.png new file mode 100644 index 00000000..eb508d59 Binary files /dev/null and b/skin/boxee/media/login_icons/icon_settings_on.png differ diff --git a/skin/boxee/media/login_icons/network.png b/skin/boxee/media/login_icons/network.png new file mode 100644 index 00000000..7a062bfa Binary files /dev/null and b/skin/boxee/media/login_icons/network.png differ diff --git a/skin/boxee/media/login_icons/settings.png b/skin/boxee/media/login_icons/settings.png new file mode 100644 index 00000000..c6e8f8c8 Binary files /dev/null and b/skin/boxee/media/login_icons/settings.png differ diff --git a/skin/boxee/media/logo86t.png b/skin/boxee/media/logo86t.png new file mode 100644 index 00000000..1455a29b Binary files /dev/null and b/skin/boxee/media/logo86t.png differ diff --git a/skin/boxee/media/mainmenu/graphic-battery.png b/skin/boxee/media/mainmenu/graphic-battery.png new file mode 100644 index 00000000..2039345b Binary files /dev/null and b/skin/boxee/media/mainmenu/graphic-battery.png differ diff --git a/skin/boxee/media/mainmenu/graphic-divider-bot.png b/skin/boxee/media/mainmenu/graphic-divider-bot.png new file mode 100644 index 00000000..2c09556b Binary files /dev/null and b/skin/boxee/media/mainmenu/graphic-divider-bot.png differ diff --git a/skin/boxee/media/mainmenu/graphic-divider-top.png b/skin/boxee/media/mainmenu/graphic-divider-top.png new file mode 100644 index 00000000..553dbe86 Binary files /dev/null and b/skin/boxee/media/mainmenu/graphic-divider-top.png differ diff --git a/skin/boxee/media/mainmenu/graphic-gradient-top.png b/skin/boxee/media/mainmenu/graphic-gradient-top.png new file mode 100644 index 00000000..7b511526 Binary files /dev/null and b/skin/boxee/media/mainmenu/graphic-gradient-top.png differ diff --git a/skin/boxee/media/mainmenu/graphic-icon-exit.png b/skin/boxee/media/mainmenu/graphic-icon-exit.png new file mode 100644 index 00000000..33918ccf Binary files /dev/null and b/skin/boxee/media/mainmenu/graphic-icon-exit.png differ diff --git a/skin/boxee/media/mainmenu/graphic-icon-history.png b/skin/boxee/media/mainmenu/graphic-icon-history.png new file mode 100644 index 00000000..7d691565 Binary files /dev/null and b/skin/boxee/media/mainmenu/graphic-icon-history.png differ diff --git a/skin/boxee/media/mainmenu/graphic-icon-home.png b/skin/boxee/media/mainmenu/graphic-icon-home.png new file mode 100644 index 00000000..078f5cde Binary files /dev/null and b/skin/boxee/media/mainmenu/graphic-icon-home.png differ diff --git a/skin/boxee/media/mainmenu/graphic-icon-search.png b/skin/boxee/media/mainmenu/graphic-icon-search.png new file mode 100644 index 00000000..c58022e7 Binary files /dev/null and b/skin/boxee/media/mainmenu/graphic-icon-search.png differ diff --git a/skin/boxee/media/mainmenu/graphic-icon-settings.png b/skin/boxee/media/mainmenu/graphic-icon-settings.png new file mode 100644 index 00000000..3f6f205e Binary files /dev/null and b/skin/boxee/media/mainmenu/graphic-icon-settings.png differ diff --git a/skin/boxee/media/mainmenu/graphic-vpn.png b/skin/boxee/media/mainmenu/graphic-vpn.png new file mode 100644 index 00000000..46a69278 Binary files /dev/null and b/skin/boxee/media/mainmenu/graphic-vpn.png differ diff --git a/skin/boxee/media/mainmenu/now-playing-mask.png b/skin/boxee/media/mainmenu/now-playing-mask.png new file mode 100644 index 00000000..ce958106 Binary files /dev/null and b/skin/boxee/media/mainmenu/now-playing-mask.png differ diff --git a/skin/boxee/media/mainmenu/now-playing-off.png b/skin/boxee/media/mainmenu/now-playing-off.png new file mode 100644 index 00000000..32b8d481 Binary files /dev/null and b/skin/boxee/media/mainmenu/now-playing-off.png differ diff --git a/skin/boxee/media/mainmenu/now-playing-on.png b/skin/boxee/media/mainmenu/now-playing-on.png new file mode 100644 index 00000000..294469e7 Binary files /dev/null and b/skin/boxee/media/mainmenu/now-playing-on.png differ diff --git a/skin/boxee/media/mainmenu/now-playing-play-icon.png b/skin/boxee/media/mainmenu/now-playing-play-icon.png new file mode 100644 index 00000000..d9c94e2f Binary files /dev/null and b/skin/boxee/media/mainmenu/now-playing-play-icon.png differ diff --git a/skin/boxee/media/masks/10b9f2.png b/skin/boxee/media/masks/10b9f2.png new file mode 100644 index 00000000..3c71a5fe Binary files /dev/null and b/skin/boxee/media/masks/10b9f2.png differ diff --git a/skin/boxee/media/masks/1c8aaf.png b/skin/boxee/media/masks/1c8aaf.png new file mode 100644 index 00000000..142b7643 Binary files /dev/null and b/skin/boxee/media/masks/1c8aaf.png differ diff --git a/skin/boxee/media/masks/464646.png b/skin/boxee/media/masks/464646.png new file mode 100644 index 00000000..c6868923 Binary files /dev/null and b/skin/boxee/media/masks/464646.png differ diff --git a/skin/boxee/media/masks/4c4c4c.png b/skin/boxee/media/masks/4c4c4c.png new file mode 100644 index 00000000..569e0cd4 Binary files /dev/null and b/skin/boxee/media/masks/4c4c4c.png differ diff --git a/skin/boxee/media/masks/565a57.png b/skin/boxee/media/masks/565a57.png new file mode 100644 index 00000000..3a128061 Binary files /dev/null and b/skin/boxee/media/masks/565a57.png differ diff --git a/skin/boxee/media/masks/686c69.png b/skin/boxee/media/masks/686c69.png new file mode 100644 index 00000000..607e133b Binary files /dev/null and b/skin/boxee/media/masks/686c69.png differ diff --git a/skin/boxee/media/masks/777d79.png b/skin/boxee/media/masks/777d79.png new file mode 100644 index 00000000..7e6e7077 Binary files /dev/null and b/skin/boxee/media/masks/777d79.png differ diff --git a/skin/boxee/media/masks/868d89.png b/skin/boxee/media/masks/868d89.png new file mode 100644 index 00000000..07f64f0c Binary files /dev/null and b/skin/boxee/media/masks/868d89.png differ diff --git a/skin/boxee/media/masks/f1f1f1.png b/skin/boxee/media/masks/f1f1f1.png new file mode 100644 index 00000000..41d5ce08 Binary files /dev/null and b/skin/boxee/media/masks/f1f1f1.png differ diff --git a/skin/boxee/media/masks/mask-18-54px-b.png b/skin/boxee/media/masks/mask-18-54px-b.png new file mode 100644 index 00000000..6102f33c Binary files /dev/null and b/skin/boxee/media/masks/mask-18-54px-b.png differ diff --git a/skin/boxee/media/masks/mask-18-54px-bl.png b/skin/boxee/media/masks/mask-18-54px-bl.png new file mode 100644 index 00000000..3fae6cbc Binary files /dev/null and b/skin/boxee/media/masks/mask-18-54px-bl.png differ diff --git a/skin/boxee/media/masks/mask-18-54px-br.png b/skin/boxee/media/masks/mask-18-54px-br.png new file mode 100644 index 00000000..dada3c52 Binary files /dev/null and b/skin/boxee/media/masks/mask-18-54px-br.png differ diff --git a/skin/boxee/media/masks/mask-18-54px-t.png b/skin/boxee/media/masks/mask-18-54px-t.png new file mode 100644 index 00000000..42ec7f80 Binary files /dev/null and b/skin/boxee/media/masks/mask-18-54px-t.png differ diff --git a/skin/boxee/media/masks/mask-18-54px-tl.png b/skin/boxee/media/masks/mask-18-54px-tl.png new file mode 100644 index 00000000..b2238a67 Binary files /dev/null and b/skin/boxee/media/masks/mask-18-54px-tl.png differ diff --git a/skin/boxee/media/masks/mask-18-54px-tr.png b/skin/boxee/media/masks/mask-18-54px-tr.png new file mode 100644 index 00000000..355580d0 Binary files /dev/null and b/skin/boxee/media/masks/mask-18-54px-tr.png differ diff --git a/skin/boxee/media/masks/mask-18-54px.png b/skin/boxee/media/masks/mask-18-54px.png new file mode 100644 index 00000000..b4367220 Binary files /dev/null and b/skin/boxee/media/masks/mask-18-54px.png differ diff --git a/skin/boxee/media/masks/mask-6-36px.png b/skin/boxee/media/masks/mask-6-36px.png new file mode 100644 index 00000000..621ee841 Binary files /dev/null and b/skin/boxee/media/masks/mask-6-36px.png differ diff --git a/skin/boxee/media/masks/mask-action-button-long.png b/skin/boxee/media/masks/mask-action-button-long.png new file mode 100644 index 00000000..cfba23a8 Binary files /dev/null and b/skin/boxee/media/masks/mask-action-button-long.png differ diff --git a/skin/boxee/media/masks/mask-action-button.png b/skin/boxee/media/masks/mask-action-button.png new file mode 100644 index 00000000..2c553b49 Binary files /dev/null and b/skin/boxee/media/masks/mask-action-button.png differ diff --git a/skin/boxee/media/masks/mask-channel-logo.png b/skin/boxee/media/masks/mask-channel-logo.png new file mode 100644 index 00000000..248bfdbb Binary files /dev/null and b/skin/boxee/media/masks/mask-channel-logo.png differ diff --git a/skin/boxee/media/masks/mask-osd-album-cover.png b/skin/boxee/media/masks/mask-osd-album-cover.png new file mode 100644 index 00000000..08f30443 Binary files /dev/null and b/skin/boxee/media/masks/mask-osd-album-cover.png differ diff --git a/skin/boxee/media/masks/mask-share-user-icon-b.png b/skin/boxee/media/masks/mask-share-user-icon-b.png new file mode 100644 index 00000000..4fad4ec0 Binary files /dev/null and b/skin/boxee/media/masks/mask-share-user-icon-b.png differ diff --git a/skin/boxee/media/masks/mask-share-user-icon-t.png b/skin/boxee/media/masks/mask-share-user-icon-t.png new file mode 100644 index 00000000..8d2d497d Binary files /dev/null and b/skin/boxee/media/masks/mask-share-user-icon-t.png differ diff --git a/skin/boxee/media/masks/mask-share-user-icon.png b/skin/boxee/media/masks/mask-share-user-icon.png new file mode 100644 index 00000000..40a8db20 Binary files /dev/null and b/skin/boxee/media/masks/mask-share-user-icon.png differ diff --git a/skin/boxee/media/masks/mask_browse_menu.png b/skin/boxee/media/masks/mask_browse_menu.png new file mode 100644 index 00000000..f524aab7 Binary files /dev/null and b/skin/boxee/media/masks/mask_browse_menu.png differ diff --git a/skin/boxee/media/masks/mask_browse_menu_button.png b/skin/boxee/media/masks/mask_browse_menu_button.png new file mode 100644 index 00000000..312b6e0b Binary files /dev/null and b/skin/boxee/media/masks/mask_browse_menu_button.png differ diff --git a/skin/boxee/media/masks/mask_browse_menu_tab.png b/skin/boxee/media/masks/mask_browse_menu_tab.png new file mode 100644 index 00000000..3a9a70da Binary files /dev/null and b/skin/boxee/media/masks/mask_browse_menu_tab.png differ diff --git a/skin/boxee/media/masks/provider_mask.png b/skin/boxee/media/masks/provider_mask.png new file mode 100644 index 00000000..9cb93bd9 Binary files /dev/null and b/skin/boxee/media/masks/provider_mask.png differ diff --git a/skin/boxee/media/masks/thumb_background_on2.png b/skin/boxee/media/masks/thumb_background_on2.png new file mode 100644 index 00000000..4e67c67f Binary files /dev/null and b/skin/boxee/media/masks/thumb_background_on2.png differ diff --git a/skin/boxee/media/masks/thumb_border.png b/skin/boxee/media/masks/thumb_border.png new file mode 100644 index 00000000..fd1ed160 Binary files /dev/null and b/skin/boxee/media/masks/thumb_border.png differ diff --git a/skin/boxee/media/masks/thumb_border_20.png b/skin/boxee/media/masks/thumb_border_20.png new file mode 100644 index 00000000..1af0091f Binary files /dev/null and b/skin/boxee/media/masks/thumb_border_20.png differ diff --git a/skin/boxee/media/masks/thumb_border_bottom.png b/skin/boxee/media/masks/thumb_border_bottom.png new file mode 100644 index 00000000..0ef8b71c Binary files /dev/null and b/skin/boxee/media/masks/thumb_border_bottom.png differ diff --git a/skin/boxee/media/masks/thumb_border_focus.png b/skin/boxee/media/masks/thumb_border_focus.png new file mode 100644 index 00000000..8ac6f05f Binary files /dev/null and b/skin/boxee/media/masks/thumb_border_focus.png differ diff --git a/skin/boxee/media/mediaaction/button-media-action-play.png b/skin/boxee/media/mediaaction/button-media-action-play.png new file mode 100644 index 00000000..deac5604 Binary files /dev/null and b/skin/boxee/media/mediaaction/button-media-action-play.png differ diff --git a/skin/boxee/media/mediaaction/graphic-divider-left.png b/skin/boxee/media/mediaaction/graphic-divider-left.png new file mode 100644 index 00000000..c89be27d Binary files /dev/null and b/skin/boxee/media/mediaaction/graphic-divider-left.png differ diff --git a/skin/boxee/media/mediaaction/graphic-divider-quick-vert.png b/skin/boxee/media/mediaaction/graphic-divider-quick-vert.png new file mode 100644 index 00000000..43ba0a91 Binary files /dev/null and b/skin/boxee/media/mediaaction/graphic-divider-quick-vert.png differ diff --git a/skin/boxee/media/mediaaction/graphic-divider-right.png b/skin/boxee/media/mediaaction/graphic-divider-right.png new file mode 100644 index 00000000..fa1a8714 Binary files /dev/null and b/skin/boxee/media/mediaaction/graphic-divider-right.png differ diff --git a/skin/boxee/media/mediaaction/graphic-scanlines.png b/skin/boxee/media/mediaaction/graphic-scanlines.png new file mode 100644 index 00000000..0a44ecda Binary files /dev/null and b/skin/boxee/media/mediaaction/graphic-scanlines.png differ diff --git a/skin/boxee/media/mediaaction/graphic-source-arrow.png b/skin/boxee/media/mediaaction/graphic-source-arrow.png new file mode 100644 index 00000000..0e38d79b Binary files /dev/null and b/skin/boxee/media/mediaaction/graphic-source-arrow.png differ diff --git a/skin/boxee/media/mediaaction/graphic-thumbnail-watched-check.png b/skin/boxee/media/mediaaction/graphic-thumbnail-watched-check.png new file mode 100644 index 00000000..7510664e Binary files /dev/null and b/skin/boxee/media/mediaaction/graphic-thumbnail-watched-check.png differ diff --git a/skin/boxee/media/mediaaction/icon-browse.png b/skin/boxee/media/mediaaction/icon-browse.png new file mode 100644 index 00000000..e3be17ec Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-browse.png differ diff --git a/skin/boxee/media/mediaaction/icon-favorite-add-off.png b/skin/boxee/media/mediaaction/icon-favorite-add-off.png new file mode 100644 index 00000000..9a047904 Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-favorite-add-off.png differ diff --git a/skin/boxee/media/mediaaction/icon-favorite-add-on.png b/skin/boxee/media/mediaaction/icon-favorite-add-on.png new file mode 100644 index 00000000..d7a4c520 Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-favorite-add-on.png differ diff --git a/skin/boxee/media/mediaaction/icon-favorite-add.png b/skin/boxee/media/mediaaction/icon-favorite-add.png new file mode 100644 index 00000000..d7a4c520 Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-favorite-add.png differ diff --git a/skin/boxee/media/mediaaction/icon-favorite-remove-off.png b/skin/boxee/media/mediaaction/icon-favorite-remove-off.png new file mode 100644 index 00000000..2214329d Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-favorite-remove-off.png differ diff --git a/skin/boxee/media/mediaaction/icon-favorite-remove-on.png b/skin/boxee/media/mediaaction/icon-favorite-remove-on.png new file mode 100644 index 00000000..59f9132c Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-favorite-remove-on.png differ diff --git a/skin/boxee/media/mediaaction/icon-favorite-remove.png b/skin/boxee/media/mediaaction/icon-favorite-remove.png new file mode 100644 index 00000000..59f9132c Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-favorite-remove.png differ diff --git a/skin/boxee/media/mediaaction/icon-go-to-show.png b/skin/boxee/media/mediaaction/icon-go-to-show.png new file mode 100644 index 00000000..d0048e8f Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-go-to-show.png differ diff --git a/skin/boxee/media/mediaaction/icon-identify.png b/skin/boxee/media/mediaaction/icon-identify.png new file mode 100644 index 00000000..29c10ab8 Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-identify.png differ diff --git a/skin/boxee/media/mediaaction/icon-mark-unwatched.png b/skin/boxee/media/mediaaction/icon-mark-unwatched.png new file mode 100644 index 00000000..b07d55e1 Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-mark-unwatched.png differ diff --git a/skin/boxee/media/mediaaction/icon-mark-watched.png b/skin/boxee/media/mediaaction/icon-mark-watched.png new file mode 100644 index 00000000..9142d1dc Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-mark-watched.png differ diff --git a/skin/boxee/media/mediaaction/icon-share-off.png b/skin/boxee/media/mediaaction/icon-share-off.png new file mode 100644 index 00000000..7a29b949 Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-share-off.png differ diff --git a/skin/boxee/media/mediaaction/icon-share.png b/skin/boxee/media/mediaaction/icon-share.png new file mode 100644 index 00000000..672666f9 Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-share.png differ diff --git a/skin/boxee/media/mediaaction/icon-watch-later-remove.png b/skin/boxee/media/mediaaction/icon-watch-later-remove.png new file mode 100644 index 00000000..4725ca4c Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-watch-later-remove.png differ diff --git a/skin/boxee/media/mediaaction/icon-watch-later.png b/skin/boxee/media/mediaaction/icon-watch-later.png new file mode 100644 index 00000000..b5e5f490 Binary files /dev/null and b/skin/boxee/media/mediaaction/icon-watch-later.png differ diff --git a/skin/boxee/media/mediaaction/mask-provider.png b/skin/boxee/media/mediaaction/mask-provider.png new file mode 100644 index 00000000..6c986a44 Binary files /dev/null and b/skin/boxee/media/mediaaction/mask-provider.png differ diff --git a/skin/boxee/media/mediaaction/thumbnail-default-trailer.png b/skin/boxee/media/mediaaction/thumbnail-default-trailer.png new file mode 100644 index 00000000..a92e471a Binary files /dev/null and b/skin/boxee/media/mediaaction/thumbnail-default-trailer.png differ diff --git a/skin/boxee/media/mediaaction/thumbnail-watched-scanlines.png b/skin/boxee/media/mediaaction/thumbnail-watched-scanlines.png new file mode 100644 index 00000000..40c34698 Binary files /dev/null and b/skin/boxee/media/mediaaction/thumbnail-watched-scanlines.png differ diff --git a/skin/boxee/media/mediaaction/watch-gradient-background.png b/skin/boxee/media/mediaaction/watch-gradient-background.png new file mode 100644 index 00000000..7f801d68 Binary files /dev/null and b/skin/boxee/media/mediaaction/watch-gradient-background.png differ diff --git a/skin/boxee/media/menu_dialog_background.png b/skin/boxee/media/menu_dialog_background.png new file mode 100644 index 00000000..eedeed5b Binary files /dev/null and b/skin/boxee/media/menu_dialog_background.png differ diff --git a/skin/boxee/media/menu_dialog_background_bottom.png b/skin/boxee/media/menu_dialog_background_bottom.png new file mode 100644 index 00000000..8bf28891 Binary files /dev/null and b/skin/boxee/media/menu_dialog_background_bottom.png differ diff --git a/skin/boxee/media/menu_dialog_background_corner.png b/skin/boxee/media/menu_dialog_background_corner.png new file mode 100644 index 00000000..23513a91 Binary files /dev/null and b/skin/boxee/media/menu_dialog_background_corner.png differ diff --git a/skin/boxee/media/menu_dialog_background_top.png b/skin/boxee/media/menu_dialog_background_top.png new file mode 100644 index 00000000..030e97c0 Binary files /dev/null and b/skin/boxee/media/menu_dialog_background_top.png differ diff --git a/skin/boxee/media/menu_dialog_button_focus.png b/skin/boxee/media/menu_dialog_button_focus.png new file mode 100644 index 00000000..d4ae0fca Binary files /dev/null and b/skin/boxee/media/menu_dialog_button_focus.png differ diff --git a/skin/boxee/media/menu_dialog_button_tab.png b/skin/boxee/media/menu_dialog_button_tab.png new file mode 100644 index 00000000..429dfdfb Binary files /dev/null and b/skin/boxee/media/menu_dialog_button_tab.png differ diff --git a/skin/boxee/media/new_side_bar4.png b/skin/boxee/media/new_side_bar4.png new file mode 100644 index 00000000..648f8bf9 Binary files /dev/null and b/skin/boxee/media/new_side_bar4.png differ diff --git a/skin/boxee/media/oem.png b/skin/boxee/media/oem.png new file mode 100644 index 00000000..d3b8681f Binary files /dev/null and b/skin/boxee/media/oem.png differ diff --git a/skin/boxee/media/osd-slider-bg.png b/skin/boxee/media/osd-slider-bg.png new file mode 100644 index 00000000..d9db49c5 Binary files /dev/null and b/skin/boxee/media/osd-slider-bg.png differ diff --git a/skin/boxee/media/osd/graphic-divider-horz.png b/skin/boxee/media/osd/graphic-divider-horz.png new file mode 100644 index 00000000..6a3d9878 Binary files /dev/null and b/skin/boxee/media/osd/graphic-divider-horz.png differ diff --git a/skin/boxee/media/osd/graphic-divider-vert.png b/skin/boxee/media/osd/graphic-divider-vert.png new file mode 100644 index 00000000..c4ac42e8 Binary files /dev/null and b/skin/boxee/media/osd/graphic-divider-vert.png differ diff --git a/skin/boxee/media/osd/mask-18-54px.png b/skin/boxee/media/osd/mask-18-54px.png new file mode 100644 index 00000000..b4367220 Binary files /dev/null and b/skin/boxee/media/osd/mask-18-54px.png differ diff --git a/skin/boxee/media/osd/mask-6-36px.png b/skin/boxee/media/osd/mask-6-36px.png new file mode 100644 index 00000000..621ee841 Binary files /dev/null and b/skin/boxee/media/osd/mask-6-36px.png differ diff --git a/skin/boxee/media/osd/mask-osd-album-cover.png b/skin/boxee/media/osd/mask-osd-album-cover.png new file mode 100644 index 00000000..08f30443 Binary files /dev/null and b/skin/boxee/media/osd/mask-osd-album-cover.png differ diff --git a/skin/boxee/media/osd/osd-bg-18-54px-b.png b/skin/boxee/media/osd/osd-bg-18-54px-b.png new file mode 100644 index 00000000..042cbd74 Binary files /dev/null and b/skin/boxee/media/osd/osd-bg-18-54px-b.png differ diff --git a/skin/boxee/media/osd/osd-bg-18-54px-t.png b/skin/boxee/media/osd/osd-bg-18-54px-t.png new file mode 100644 index 00000000..b92be671 Binary files /dev/null and b/skin/boxee/media/osd/osd-bg-18-54px-t.png differ diff --git a/skin/boxee/media/osd/osd-bg-mask-black.png b/skin/boxee/media/osd/osd-bg-mask-black.png new file mode 100644 index 00000000..2d41bd43 Binary files /dev/null and b/skin/boxee/media/osd/osd-bg-mask-black.png differ diff --git a/skin/boxee/media/osd/osd-buffer-progressbar.png b/skin/boxee/media/osd/osd-buffer-progressbar.png new file mode 100644 index 00000000..c6e2052f Binary files /dev/null and b/skin/boxee/media/osd/osd-buffer-progressbar.png differ diff --git a/skin/boxee/media/osd/osd-dts-logo.png b/skin/boxee/media/osd/osd-dts-logo.png new file mode 100644 index 00000000..cffb688a Binary files /dev/null and b/skin/boxee/media/osd/osd-dts-logo.png differ diff --git a/skin/boxee/media/osd/osd-paused.png b/skin/boxee/media/osd/osd-paused.png new file mode 100644 index 00000000..53b180e4 Binary files /dev/null and b/skin/boxee/media/osd/osd-paused.png differ diff --git a/skin/boxee/media/osd/osd-progressbar-browser.png b/skin/boxee/media/osd/osd-progressbar-browser.png new file mode 100644 index 00000000..f5ba9ab0 Binary files /dev/null and b/skin/boxee/media/osd/osd-progressbar-browser.png differ diff --git a/skin/boxee/media/osd/osd-progressbar-buffered.png b/skin/boxee/media/osd/osd-progressbar-buffered.png new file mode 100644 index 00000000..6293f889 Binary files /dev/null and b/skin/boxee/media/osd/osd-progressbar-buffered.png differ diff --git a/skin/boxee/media/osd/osd-progressbar-gradient.png b/skin/boxee/media/osd/osd-progressbar-gradient.png new file mode 100644 index 00000000..9367da9d Binary files /dev/null and b/skin/boxee/media/osd/osd-progressbar-gradient.png differ diff --git a/skin/boxee/media/osd/osd-progressbar-played.png b/skin/boxee/media/osd/osd-progressbar-played.png new file mode 100644 index 00000000..66e75204 Binary files /dev/null and b/skin/boxee/media/osd/osd-progressbar-played.png differ diff --git a/skin/boxee/media/osd/osd-progressbar.png b/skin/boxee/media/osd/osd-progressbar.png new file mode 100644 index 00000000..a940c4dc Binary files /dev/null and b/skin/boxee/media/osd/osd-progressbar.png differ diff --git a/skin/boxee/media/osd/osd-scrubber-pause-off.png b/skin/boxee/media/osd/osd-scrubber-pause-off.png new file mode 100644 index 00000000..3d6f47aa Binary files /dev/null and b/skin/boxee/media/osd/osd-scrubber-pause-off.png differ diff --git a/skin/boxee/media/osd/osd-scrubber-pause-on.png b/skin/boxee/media/osd/osd-scrubber-pause-on.png new file mode 100644 index 00000000..d4ccf37c Binary files /dev/null and b/skin/boxee/media/osd/osd-scrubber-pause-on.png differ diff --git a/skin/boxee/media/osd/osd-scrubber-play-off.png b/skin/boxee/media/osd/osd-scrubber-play-off.png new file mode 100644 index 00000000..c5f21e61 Binary files /dev/null and b/skin/boxee/media/osd/osd-scrubber-play-off.png differ diff --git a/skin/boxee/media/osd/osd-scrubber-play-on.png b/skin/boxee/media/osd/osd-scrubber-play-on.png new file mode 100644 index 00000000..ab100b21 Binary files /dev/null and b/skin/boxee/media/osd/osd-scrubber-play-on.png differ diff --git a/skin/boxee/media/osd/osd-settings-options-bottom-border.png b/skin/boxee/media/osd/osd-settings-options-bottom-border.png new file mode 100644 index 00000000..56a7b5d9 Binary files /dev/null and b/skin/boxee/media/osd/osd-settings-options-bottom-border.png differ diff --git a/skin/boxee/media/osd/osd-volume-bar-center.png b/skin/boxee/media/osd/osd-volume-bar-center.png new file mode 100644 index 00000000..598bdf95 Binary files /dev/null and b/skin/boxee/media/osd/osd-volume-bar-center.png differ diff --git a/skin/boxee/media/osd/osd-volume-bar-left.png b/skin/boxee/media/osd/osd-volume-bar-left.png new file mode 100644 index 00000000..f7f3f60d Binary files /dev/null and b/skin/boxee/media/osd/osd-volume-bar-left.png differ diff --git a/skin/boxee/media/osd/osd-volume-bar-right.png b/skin/boxee/media/osd/osd-volume-bar-right.png new file mode 100644 index 00000000..99fedbb2 Binary files /dev/null and b/skin/boxee/media/osd/osd-volume-bar-right.png differ diff --git a/skin/boxee/media/osd/osd-volume-bg.png b/skin/boxee/media/osd/osd-volume-bg.png new file mode 100644 index 00000000..e16a308b Binary files /dev/null and b/skin/boxee/media/osd/osd-volume-bg.png differ diff --git a/skin/boxee/media/osd/osd-volume-icon.png b/skin/boxee/media/osd/osd-volume-icon.png new file mode 100644 index 00000000..33553665 Binary files /dev/null and b/skin/boxee/media/osd/osd-volume-icon.png differ diff --git a/skin/boxee/media/osd_dropup.png b/skin/boxee/media/osd_dropup.png new file mode 100644 index 00000000..9238d10d Binary files /dev/null and b/skin/boxee/media/osd_dropup.png differ diff --git a/skin/boxee/media/osd_dropup_on.png b/skin/boxee/media/osd_dropup_on.png new file mode 100644 index 00000000..6f372aec Binary files /dev/null and b/skin/boxee/media/osd_dropup_on.png differ diff --git a/skin/boxee/media/osd_gradient.png b/skin/boxee/media/osd_gradient.png new file mode 100644 index 00000000..0c996194 Binary files /dev/null and b/skin/boxee/media/osd_gradient.png differ diff --git a/skin/boxee/media/progress/browser_progress_background.png b/skin/boxee/media/progress/browser_progress_background.png new file mode 100644 index 00000000..0d0a3083 Binary files /dev/null and b/skin/boxee/media/progress/browser_progress_background.png differ diff --git a/skin/boxee/media/progress/browser_progress_loaded_center.png b/skin/boxee/media/progress/browser_progress_loaded_center.png new file mode 100644 index 00000000..1f7d164c Binary files /dev/null and b/skin/boxee/media/progress/browser_progress_loaded_center.png differ diff --git a/skin/boxee/media/progress/download_progress_background.png b/skin/boxee/media/progress/download_progress_background.png new file mode 100644 index 00000000..a3548211 Binary files /dev/null and b/skin/boxee/media/progress/download_progress_background.png differ diff --git a/skin/boxee/media/progress/download_progress_center.png b/skin/boxee/media/progress/download_progress_center.png new file mode 100644 index 00000000..ba623028 Binary files /dev/null and b/skin/boxee/media/progress/download_progress_center.png differ diff --git a/skin/boxee/media/progress/download_progress_left.png b/skin/boxee/media/progress/download_progress_left.png new file mode 100644 index 00000000..0363b09f Binary files /dev/null and b/skin/boxee/media/progress/download_progress_left.png differ diff --git a/skin/boxee/media/progress/download_progress_right.png b/skin/boxee/media/progress/download_progress_right.png new file mode 100644 index 00000000..b8fcb78e Binary files /dev/null and b/skin/boxee/media/progress/download_progress_right.png differ diff --git a/skin/boxee/media/progress/osd_progress_play_center.png b/skin/boxee/media/progress/osd_progress_play_center.png new file mode 100644 index 00000000..8775bbec Binary files /dev/null and b/skin/boxee/media/progress/osd_progress_play_center.png differ diff --git a/skin/boxee/media/progress/progress_bar_seek.png b/skin/boxee/media/progress/progress_bar_seek.png new file mode 100644 index 00000000..096c9450 Binary files /dev/null and b/skin/boxee/media/progress/progress_bar_seek.png differ diff --git a/skin/boxee/media/progress/progress_bar_seek_focused.png b/skin/boxee/media/progress/progress_bar_seek_focused.png new file mode 100644 index 00000000..5b568abc Binary files /dev/null and b/skin/boxee/media/progress/progress_bar_seek_focused.png differ diff --git a/skin/boxee/media/progress/progress_bar_seek_unfocused.png b/skin/boxee/media/progress/progress_bar_seek_unfocused.png new file mode 100644 index 00000000..05bdccc1 Binary files /dev/null and b/skin/boxee/media/progress/progress_bar_seek_unfocused.png differ diff --git a/skin/boxee/media/quick_tip_remote.png b/skin/boxee/media/quick_tip_remote.png new file mode 100644 index 00000000..91f37052 Binary files /dev/null and b/skin/boxee/media/quick_tip_remote.png differ diff --git a/skin/boxee/media/radio_button_quality.png b/skin/boxee/media/radio_button_quality.png new file mode 100644 index 00000000..8a16a9d1 Binary files /dev/null and b/skin/boxee/media/radio_button_quality.png differ diff --git a/skin/boxee/media/radio_button_quality_check.png b/skin/boxee/media/radio_button_quality_check.png new file mode 100644 index 00000000..6c6c77f0 Binary files /dev/null and b/skin/boxee/media/radio_button_quality_check.png differ diff --git a/skin/boxee/media/radio_button_quality_check2.png b/skin/boxee/media/radio_button_quality_check2.png new file mode 100644 index 00000000..11170c68 Binary files /dev/null and b/skin/boxee/media/radio_button_quality_check2.png differ diff --git a/skin/boxee/media/radio_button_quality_check3.png b/skin/boxee/media/radio_button_quality_check3.png new file mode 100644 index 00000000..79eeefda Binary files /dev/null and b/skin/boxee/media/radio_button_quality_check3.png differ diff --git a/skin/boxee/media/radio_button_quality_dot.png b/skin/boxee/media/radio_button_quality_dot.png new file mode 100644 index 00000000..959bca98 Binary files /dev/null and b/skin/boxee/media/radio_button_quality_dot.png differ diff --git a/skin/boxee/media/radio_button_quality_off.png b/skin/boxee/media/radio_button_quality_off.png new file mode 100644 index 00000000..3c0c4c6b Binary files /dev/null and b/skin/boxee/media/radio_button_quality_off.png differ diff --git a/skin/boxee/media/radio_button_quality_on.png b/skin/boxee/media/radio_button_quality_on.png new file mode 100644 index 00000000..2c2253f4 Binary files /dev/null and b/skin/boxee/media/radio_button_quality_on.png differ diff --git a/skin/boxee/media/rating-imdb-10.png b/skin/boxee/media/rating-imdb-10.png new file mode 100644 index 00000000..b831190f Binary files /dev/null and b/skin/boxee/media/rating-imdb-10.png differ diff --git a/skin/boxee/media/scrollbar_bg_dark.png b/skin/boxee/media/scrollbar_bg_dark.png new file mode 100644 index 00000000..7dab1996 Binary files /dev/null and b/skin/boxee/media/scrollbar_bg_dark.png differ diff --git a/skin/boxee/media/scrollbar_slider_dark.png b/skin/boxee/media/scrollbar_slider_dark.png new file mode 100644 index 00000000..bdb8b297 Binary files /dev/null and b/skin/boxee/media/scrollbar_slider_dark.png differ diff --git a/skin/boxee/media/seeker_arrow.png b/skin/boxee/media/seeker_arrow.png new file mode 100644 index 00000000..77bdef02 Binary files /dev/null and b/skin/boxee/media/seeker_arrow.png differ diff --git a/skin/boxee/media/seeker_bg.png b/skin/boxee/media/seeker_bg.png new file mode 100644 index 00000000..411770a2 Binary files /dev/null and b/skin/boxee/media/seeker_bg.png differ diff --git a/skin/boxee/media/sleepy_boxee.png b/skin/boxee/media/sleepy_boxee.png new file mode 100644 index 00000000..2d3c2dfe Binary files /dev/null and b/skin/boxee/media/sleepy_boxee.png differ diff --git a/skin/boxee/media/social/button-connect-facebook-focused.png b/skin/boxee/media/social/button-connect-facebook-focused.png new file mode 100644 index 00000000..89c1b483 Binary files /dev/null and b/skin/boxee/media/social/button-connect-facebook-focused.png differ diff --git a/skin/boxee/media/social/button-connect-facebook-unfocused.png b/skin/boxee/media/social/button-connect-facebook-unfocused.png new file mode 100644 index 00000000..c37b94dd Binary files /dev/null and b/skin/boxee/media/social/button-connect-facebook-unfocused.png differ diff --git a/skin/boxee/media/social/button-connect-tumblr-focused.png b/skin/boxee/media/social/button-connect-tumblr-focused.png new file mode 100644 index 00000000..e06d4924 Binary files /dev/null and b/skin/boxee/media/social/button-connect-tumblr-focused.png differ diff --git a/skin/boxee/media/social/button-connect-tumblr-unfocused.png b/skin/boxee/media/social/button-connect-tumblr-unfocused.png new file mode 100644 index 00000000..b151d2a0 Binary files /dev/null and b/skin/boxee/media/social/button-connect-tumblr-unfocused.png differ diff --git a/skin/boxee/media/social/button-connect-twitter-focused.png b/skin/boxee/media/social/button-connect-twitter-focused.png new file mode 100644 index 00000000..70498fef Binary files /dev/null and b/skin/boxee/media/social/button-connect-twitter-focused.png differ diff --git a/skin/boxee/media/social/button-connect-twitter-unfocused.png b/skin/boxee/media/social/button-connect-twitter-unfocused.png new file mode 100644 index 00000000..cb7b7e46 Binary files /dev/null and b/skin/boxee/media/social/button-connect-twitter-unfocused.png differ diff --git a/skin/boxee/media/social_service_check.png b/skin/boxee/media/social_service_check.png new file mode 100644 index 00000000..7d83bf5b Binary files /dev/null and b/skin/boxee/media/social_service_check.png differ diff --git a/skin/boxee/media/splash135.png b/skin/boxee/media/splash135.png new file mode 100644 index 00000000..b78ed5f3 Binary files /dev/null and b/skin/boxee/media/splash135.png differ diff --git a/skin/boxee/media/text-field-focused.png b/skin/boxee/media/text-field-focused.png new file mode 100644 index 00000000..19379b1a Binary files /dev/null and b/skin/boxee/media/text-field-focused.png differ diff --git a/skin/boxee/media/text-field-no-stroke.png b/skin/boxee/media/text-field-no-stroke.png new file mode 100644 index 00000000..c846437f Binary files /dev/null and b/skin/boxee/media/text-field-no-stroke.png differ diff --git a/skin/boxee/media/text-field-unfocused.png b/skin/boxee/media/text-field-unfocused.png new file mode 100644 index 00000000..fb569d1c Binary files /dev/null and b/skin/boxee/media/text-field-unfocused.png differ diff --git a/skin/boxee/media/text_gradient.png b/skin/boxee/media/text_gradient.png new file mode 100644 index 00000000..83805e7f Binary files /dev/null and b/skin/boxee/media/text_gradient.png differ diff --git a/skin/boxee/media/thumbnail-bg-focused.png b/skin/boxee/media/thumbnail-bg-focused.png new file mode 100644 index 00000000..c341f692 Binary files /dev/null and b/skin/boxee/media/thumbnail-bg-focused.png differ diff --git a/skin/boxee/media/thumbnail-bg-unfocused.png b/skin/boxee/media/thumbnail-bg-unfocused.png new file mode 100644 index 00000000..52c896c5 Binary files /dev/null and b/skin/boxee/media/thumbnail-bg-unfocused.png differ diff --git a/skin/boxee/media/universal/button-unfocused.png b/skin/boxee/media/universal/button-unfocused.png new file mode 100644 index 00000000..5343f567 Binary files /dev/null and b/skin/boxee/media/universal/button-unfocused.png differ diff --git a/skin/boxee/media/universal/cursor-link.png b/skin/boxee/media/universal/cursor-link.png new file mode 100644 index 00000000..6e3b12a4 Binary files /dev/null and b/skin/boxee/media/universal/cursor-link.png differ diff --git a/skin/boxee/media/universal/cursor.png b/skin/boxee/media/universal/cursor.png new file mode 100644 index 00000000..0d5d6363 Binary files /dev/null and b/skin/boxee/media/universal/cursor.png differ diff --git a/skin/boxee/media/universal/graphic-circle-18px.png b/skin/boxee/media/universal/graphic-circle-18px.png new file mode 100644 index 00000000..33bf4be3 Binary files /dev/null and b/skin/boxee/media/universal/graphic-circle-18px.png differ diff --git a/skin/boxee/media/universal/graphic-circle-30px.png b/skin/boxee/media/universal/graphic-circle-30px.png new file mode 100644 index 00000000..22ec96f5 Binary files /dev/null and b/skin/boxee/media/universal/graphic-circle-30px.png differ diff --git a/skin/boxee/media/universal/graphic-parts-minus.png b/skin/boxee/media/universal/graphic-parts-minus.png new file mode 100644 index 00000000..aa041f9b Binary files /dev/null and b/skin/boxee/media/universal/graphic-parts-minus.png differ diff --git a/skin/boxee/media/universal/graphic-parts-moveup.png b/skin/boxee/media/universal/graphic-parts-moveup.png new file mode 100644 index 00000000..d6dc765b Binary files /dev/null and b/skin/boxee/media/universal/graphic-parts-moveup.png differ diff --git a/skin/boxee/media/universal/graphic-radio-blank.png b/skin/boxee/media/universal/graphic-radio-blank.png new file mode 100644 index 00000000..1847c677 Binary files /dev/null and b/skin/boxee/media/universal/graphic-radio-blank.png differ diff --git a/skin/boxee/media/universal/graphic-radio-check.png b/skin/boxee/media/universal/graphic-radio-check.png new file mode 100644 index 00000000..2e2f0edf Binary files /dev/null and b/skin/boxee/media/universal/graphic-radio-check.png differ diff --git a/skin/boxee/media/universal/graphic-radio-dot.png b/skin/boxee/media/universal/graphic-radio-dot.png new file mode 100644 index 00000000..0513b6a2 Binary files /dev/null and b/skin/boxee/media/universal/graphic-radio-dot.png differ diff --git a/skin/boxee/media/universal/graphic-spin-control-off.png b/skin/boxee/media/universal/graphic-spin-control-off.png new file mode 100644 index 00000000..639bd86e Binary files /dev/null and b/skin/boxee/media/universal/graphic-spin-control-off.png differ diff --git a/skin/boxee/media/universal/graphic-spin-control-on.png b/skin/boxee/media/universal/graphic-spin-control-on.png new file mode 100644 index 00000000..1ac31caa Binary files /dev/null and b/skin/boxee/media/universal/graphic-spin-control-on.png differ diff --git a/skin/boxee/media/universal/graphic-steps-circle.png b/skin/boxee/media/universal/graphic-steps-circle.png new file mode 100644 index 00000000..cf9ed4a9 Binary files /dev/null and b/skin/boxee/media/universal/graphic-steps-circle.png differ diff --git a/skin/boxee/media/universal/graphic-steps-dot.png b/skin/boxee/media/universal/graphic-steps-dot.png new file mode 100644 index 00000000..f82f0bf3 Binary files /dev/null and b/skin/boxee/media/universal/graphic-steps-dot.png differ diff --git a/skin/boxee/media/weather/01.png b/skin/boxee/media/weather/01.png new file mode 100755 index 00000000..7adb1773 Binary files /dev/null and b/skin/boxee/media/weather/01.png differ diff --git a/skin/boxee/media/weather/02.png b/skin/boxee/media/weather/02.png new file mode 100755 index 00000000..881b2695 Binary files /dev/null and b/skin/boxee/media/weather/02.png differ diff --git a/skin/boxee/media/weather/03.png b/skin/boxee/media/weather/03.png new file mode 100755 index 00000000..cb288c63 Binary files /dev/null and b/skin/boxee/media/weather/03.png differ diff --git a/skin/boxee/media/weather/04.png b/skin/boxee/media/weather/04.png new file mode 100755 index 00000000..3b6085d4 Binary files /dev/null and b/skin/boxee/media/weather/04.png differ diff --git a/skin/boxee/media/weather/05.png b/skin/boxee/media/weather/05.png new file mode 100755 index 00000000..1ad931da Binary files /dev/null and b/skin/boxee/media/weather/05.png differ diff --git a/skin/boxee/media/weather/06.png b/skin/boxee/media/weather/06.png new file mode 100755 index 00000000..70835cce Binary files /dev/null and b/skin/boxee/media/weather/06.png differ diff --git a/skin/boxee/media/weather/07.png b/skin/boxee/media/weather/07.png new file mode 100755 index 00000000..b426089b Binary files /dev/null and b/skin/boxee/media/weather/07.png differ diff --git a/skin/boxee/media/weather/08.png b/skin/boxee/media/weather/08.png new file mode 100755 index 00000000..a8e32c22 Binary files /dev/null and b/skin/boxee/media/weather/08.png differ diff --git a/skin/boxee/media/weather/11.png b/skin/boxee/media/weather/11.png new file mode 100755 index 00000000..a8e32c22 Binary files /dev/null and b/skin/boxee/media/weather/11.png differ diff --git a/skin/boxee/media/weather/12.png b/skin/boxee/media/weather/12.png new file mode 100755 index 00000000..ed7a8471 Binary files /dev/null and b/skin/boxee/media/weather/12.png differ diff --git a/skin/boxee/media/weather/13.png b/skin/boxee/media/weather/13.png new file mode 100755 index 00000000..948282b2 Binary files /dev/null and b/skin/boxee/media/weather/13.png differ diff --git a/skin/boxee/media/weather/14.png b/skin/boxee/media/weather/14.png new file mode 100755 index 00000000..a681cb4e Binary files /dev/null and b/skin/boxee/media/weather/14.png differ diff --git a/skin/boxee/media/weather/15.png b/skin/boxee/media/weather/15.png new file mode 100755 index 00000000..02a46fb5 Binary files /dev/null and b/skin/boxee/media/weather/15.png differ diff --git a/skin/boxee/media/weather/16.png b/skin/boxee/media/weather/16.png new file mode 100755 index 00000000..992a9d34 Binary files /dev/null and b/skin/boxee/media/weather/16.png differ diff --git a/skin/boxee/media/weather/17.png b/skin/boxee/media/weather/17.png new file mode 100755 index 00000000..304983a1 Binary files /dev/null and b/skin/boxee/media/weather/17.png differ diff --git a/skin/boxee/media/weather/18.png b/skin/boxee/media/weather/18.png new file mode 100755 index 00000000..9a360ec9 Binary files /dev/null and b/skin/boxee/media/weather/18.png differ diff --git a/skin/boxee/media/weather/19.png b/skin/boxee/media/weather/19.png new file mode 100755 index 00000000..245c380a Binary files /dev/null and b/skin/boxee/media/weather/19.png differ diff --git a/skin/boxee/media/weather/20.png b/skin/boxee/media/weather/20.png new file mode 100755 index 00000000..7ef1c2ac Binary files /dev/null and b/skin/boxee/media/weather/20.png differ diff --git a/skin/boxee/media/weather/21.png b/skin/boxee/media/weather/21.png new file mode 100755 index 00000000..6654d1ff Binary files /dev/null and b/skin/boxee/media/weather/21.png differ diff --git a/skin/boxee/media/weather/22.png b/skin/boxee/media/weather/22.png new file mode 100755 index 00000000..cf190ac3 Binary files /dev/null and b/skin/boxee/media/weather/22.png differ diff --git a/skin/boxee/media/weather/23.png b/skin/boxee/media/weather/23.png new file mode 100755 index 00000000..fee250e1 Binary files /dev/null and b/skin/boxee/media/weather/23.png differ diff --git a/skin/boxee/media/weather/24.png b/skin/boxee/media/weather/24.png new file mode 100755 index 00000000..2b281576 Binary files /dev/null and b/skin/boxee/media/weather/24.png differ diff --git a/skin/boxee/media/weather/25.png b/skin/boxee/media/weather/25.png new file mode 100755 index 00000000..b379cb5a Binary files /dev/null and b/skin/boxee/media/weather/25.png differ diff --git a/skin/boxee/media/weather/26.png b/skin/boxee/media/weather/26.png new file mode 100755 index 00000000..9238b190 Binary files /dev/null and b/skin/boxee/media/weather/26.png differ diff --git a/skin/boxee/media/weather/29.png b/skin/boxee/media/weather/29.png new file mode 100755 index 00000000..38c5dc23 Binary files /dev/null and b/skin/boxee/media/weather/29.png differ diff --git a/skin/boxee/media/weather/30.png b/skin/boxee/media/weather/30.png new file mode 100755 index 00000000..7adb1773 Binary files /dev/null and b/skin/boxee/media/weather/30.png differ diff --git a/skin/boxee/media/weather/31.png b/skin/boxee/media/weather/31.png new file mode 100755 index 00000000..4dec334c Binary files /dev/null and b/skin/boxee/media/weather/31.png differ diff --git a/skin/boxee/media/weather/32.png b/skin/boxee/media/weather/32.png new file mode 100755 index 00000000..21d3ca92 Binary files /dev/null and b/skin/boxee/media/weather/32.png differ diff --git a/skin/boxee/media/weather/33.png b/skin/boxee/media/weather/33.png new file mode 100755 index 00000000..64e3f360 Binary files /dev/null and b/skin/boxee/media/weather/33.png differ diff --git a/skin/boxee/media/weather/34.png b/skin/boxee/media/weather/34.png new file mode 100755 index 00000000..46b16859 Binary files /dev/null and b/skin/boxee/media/weather/34.png differ diff --git a/skin/boxee/media/weather/35.png b/skin/boxee/media/weather/35.png new file mode 100755 index 00000000..6fa07012 Binary files /dev/null and b/skin/boxee/media/weather/35.png differ diff --git a/skin/boxee/media/weather/36.png b/skin/boxee/media/weather/36.png new file mode 100755 index 00000000..f99ad7f8 Binary files /dev/null and b/skin/boxee/media/weather/36.png differ diff --git a/skin/boxee/media/weather/37.png b/skin/boxee/media/weather/37.png new file mode 100755 index 00000000..eda14266 Binary files /dev/null and b/skin/boxee/media/weather/37.png differ diff --git a/skin/boxee/media/weather/38.png b/skin/boxee/media/weather/38.png new file mode 100755 index 00000000..70835cce Binary files /dev/null and b/skin/boxee/media/weather/38.png differ diff --git a/skin/boxee/media/weather/39.png b/skin/boxee/media/weather/39.png new file mode 100755 index 00000000..50989f68 Binary files /dev/null and b/skin/boxee/media/weather/39.png differ diff --git a/skin/boxee/media/weather/40.png b/skin/boxee/media/weather/40.png new file mode 100755 index 00000000..948282b2 Binary files /dev/null and b/skin/boxee/media/weather/40.png differ diff --git a/skin/boxee/media/weather/41.png b/skin/boxee/media/weather/41.png new file mode 100755 index 00000000..352ec979 Binary files /dev/null and b/skin/boxee/media/weather/41.png differ diff --git a/skin/boxee/media/weather/42.png b/skin/boxee/media/weather/42.png new file mode 100755 index 00000000..6cf03efa Binary files /dev/null and b/skin/boxee/media/weather/42.png differ diff --git a/skin/boxee/media/weather/43.png b/skin/boxee/media/weather/43.png new file mode 100755 index 00000000..aa33bb49 Binary files /dev/null and b/skin/boxee/media/weather/43.png differ diff --git a/skin/boxee/media/weather/44.png b/skin/boxee/media/weather/44.png new file mode 100755 index 00000000..607454a4 Binary files /dev/null and b/skin/boxee/media/weather/44.png differ diff --git a/system/BoxeeBrowser0.dll b/system/BoxeeBrowser0.dll new file mode 100644 index 00000000..2fb78c02 Binary files /dev/null and b/system/BoxeeBrowser0.dll differ diff --git a/system/charsets.xml b/system/charsets.xml new file mode 100644 index 00000000..b97c51a2 --- /dev/null +++ b/system/charsets.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/system/countries.txt b/system/countries.txt new file mode 100644 index 00000000..eb9e5340 --- /dev/null +++ b/system/countries.txt @@ -0,0 +1,245 @@ +AD,"Andorra" +AE,"United Arab Emirates" +AF,"Afghanistan" +AG,"Antigua and Barbuda" +AI,"Anguilla" +AL,"Albania" +AM,"Armenia" +AN,"Netherlands Antilles" +AO,"Angola" +AP,"Asia/Pacific Region" +AQ,"Antarctica" +AR,"Argentina" +AS,"American Samoa" +AT,"Austria" +AU,"Australia" +AW,"Aruba" +AX,"Aland Islands" +AZ,"Azerbaijan" +BA,"Bosnia and Herzegovina" +BB,"Barbados" +BD,"Bangladesh" +BE,"Belgium" +BF,"Burkina Faso" +BG,"Bulgaria" +BH,"Bahrain" +BI,"Burundi" +BJ,"Benin" +BM,"Bermuda" +BN,"Brunei Darussalam" +BO,"Bolivia" +BR,"Brazil" +BS,"Bahamas" +BT,"Bhutan" +BV,"Bouvet Island" +BW,"Botswana" +BY,"Belarus" +BZ,"Belize" +CA,"Canada" +CC,"Cocos (Keeling) Islands" +CD,"Congo, The Democratic Republic of the" +CF,"Central African Republic" +CG,"Congo" +CH,"Switzerland" +CI,"Cote d'Ivoire" +CK,"Cook Islands" +CL,"Chile" +CM,"Cameroon" +CN,"China" +CO,"Colombia" +CR,"Costa Rica" +CU,"Cuba" +CV,"Cape Verde" +CX,"Christmas Island" +CY,"Cyprus" +CZ,"Czech Republic" +DE,"Germany" +DJ,"Djibouti" +DK,"Denmark" +DM,"Dominica" +DO,"Dominican Republic" +DZ,"Algeria" +EC,"Ecuador" +EE,"Estonia" +EG,"Egypt" +EH,"Western Sahara" +ER,"Eritrea" +ES,"Spain" +ET,"Ethiopia" +EU,"Europe" +FI,"Finland" +FJ,"Fiji" +FK,"Falkland Islands (Malvinas)" +FM,"Micronesia, Federated States of" +FO,"Faroe Islands" +FR,"France" +GA,"Gabon" +GB,"United Kingdom" +GD,"Grenada" +GE,"Georgia" +GF,"French Guiana" +GG,"Guernsey" +GH,"Ghana" +GI,"Gibraltar" +GL,"Greenland" +GM,"Gambia" +GN,"Guinea" +GP,"Guadeloupe" +GQ,"Equatorial Guinea" +GR,"Greece" +GS,"South Georgia and the South Sandwich Islands" +GT,"Guatemala" +GU,"Guam" +GW,"Guinea-Bissau" +GY,"Guyana" +HK,"Hong Kong" +HN,"Honduras" +HR,"Croatia" +HT,"Haiti" +HU,"Hungary" +ID,"Indonesia" +IE,"Ireland" +IL,"Israel" +IM,"Isle of Man" +IN,"India" +IO,"British Indian Ocean Territory" +IQ,"Iraq" +IR,"Iran, Islamic Republic of" +IS,"Iceland" +IT,"Italy" +JE,"Jersey" +JM,"Jamaica" +JO,"Jordan" +JP,"Japan" +KE,"Kenya" +KG,"Kyrgyzstan" +KH,"Cambodia" +KI,"Kiribati" +KM,"Comoros" +KN,"Saint Kitts and Nevis" +KP,"Korea, Democratic People's Republic of" +KR,"Korea, Republic of" +KW,"Kuwait" +KY,"Cayman Islands" +KZ,"Kazakhstan" +LA,"Lao People's Democratic Republic" +LB,"Lebanon" +LC,"Saint Lucia" +LI,"Liechtenstein" +LK,"Sri Lanka" +LR,"Liberia" +LS,"Lesotho" +LT,"Lithuania" +LU,"Luxembourg" +LV,"Latvia" +LY,"Libyan Arab Jamahiriya" +MA,"Morocco" +MC,"Monaco" +MD,"Moldova, Republic of" +ME,"Montenegro" +MG,"Madagascar" +MH,"Marshall Islands" +MK,"Macedonia" +ML,"Mali" +MM,"Myanmar" +MN,"Mongolia" +MO,"Macao" +MP,"Northern Mariana Islands" +MQ,"Martinique" +MR,"Mauritania" +MS,"Montserrat" +MT,"Malta" +MU,"Mauritius" +MV,"Maldives" +MW,"Malawi" +MX,"Mexico" +MY,"Malaysia" +MZ,"Mozambique" +NA,"Namibia" +NC,"New Caledonia" +NE,"Niger" +NF,"Norfolk Island" +NG,"Nigeria" +NI,"Nicaragua" +NL,"Netherlands" +NO,"Norway" +NP,"Nepal" +NR,"Nauru" +NU,"Niue" +NZ,"New Zealand" +OM,"Oman" +PA,"Panama" +PE,"Peru" +PF,"French Polynesia" +PG,"Papua New Guinea" +PH,"Philippines" +PK,"Pakistan" +PL,"Poland" +PM,"Saint Pierre and Miquelon" +PN,"Pitcairn" +PR,"Puerto Rico" +PS,"Palestinian Territory" +PT,"Portugal" +PW,"Palau" +PY,"Paraguay" +QA,"Qatar" +RE,"Reunion" +RO,"Romania" +RS,"Serbia" +RU,"Russian Federation" +RW,"Rwanda" +SA,"Saudi Arabia" +SB,"Solomon Islands" +SC,"Seychelles" +SD,"Sudan" +SE,"Sweden" +SG,"Singapore" +SH,"Saint Helena" +SI,"Slovenia" +SJ,"Svalbard and Jan Mayen" +SK,"Slovakia" +SL,"Sierra Leone" +SM,"San Marino" +SN,"Senegal" +SO,"Somalia" +SR,"Suriname" +ST,"Sao Tome and Principe" +SV,"El Salvador" +SY,"Syrian Arab Republic" +SZ,"Swaziland" +TC,"Turks and Caicos Islands" +TD,"Chad" +TF,"French Southern Territories" +TG,"Togo" +TH,"Thailand" +TJ,"Tajikistan" +TK,"Tokelau" +TL,"Timor-Leste" +TM,"Turkmenistan" +TN,"Tunisia" +TO,"Tonga" +TR,"Turkey" +TT,"Trinidad and Tobago" +TV,"Tuvalu" +TW,"Taiwan" +TZ,"Tanzania, United Republic of" +UA,"Ukraine" +UG,"Uganda" +UM,"United States Minor Outlying Islands" +US,"United States" +UY,"Uruguay" +UZ,"Uzbekistan" +VA,"Holy See (Vatican City State)" +VC,"Saint Vincent and the Grenadines" +VE,"Venezuela" +VG,"Virgin Islands, British" +VI,"Virgin Islands, U.S." +VN,"Vietnam" +VU,"Vanuatu" +WF,"Wallis and Futuna" +WS,"Samoa" +YE,"Yemen" +YT,"Mayotte" +ZA,"South Africa" +ZM,"Zambia" +ZW,"Zimbabwe" diff --git a/system/libboxeebrowser-i486-linux.so.0 b/system/libboxeebrowser-i486-linux.so.0 new file mode 100755 index 00000000..19f9075e Binary files /dev/null and b/system/libboxeebrowser-i486-linux.so.0 differ diff --git a/system/libboxeebrowser-i686-cm-linux.so.0 b/system/libboxeebrowser-i686-cm-linux.so.0 new file mode 100755 index 00000000..5a7a8753 Binary files /dev/null and b/system/libboxeebrowser-i686-cm-linux.so.0 differ diff --git a/system/libboxeebrowser-x86-osx.0.dylib b/system/libboxeebrowser-x86-osx.0.dylib new file mode 100755 index 00000000..697ad548 Binary files /dev/null and b/system/libboxeebrowser-x86-osx.0.dylib differ diff --git a/system/libidn-11.dll b/system/libidn-11.dll new file mode 100644 index 00000000..fdab609d Binary files /dev/null and b/system/libidn-11.dll differ diff --git a/system/oem.config b/system/oem.config new file mode 100755 index 00000000..28ba19e5 --- /dev/null +++ b/system/oem.config @@ -0,0 +1,28 @@ +#Boxee.Device.Name=dlink.dsm380 + +# Device HostName +#Boxee.Device.Hostname=boxeebox + +# Enable/disable showing the volume up/down control (default: 0) +Boxee.Audio.AnalogVolumeControlEnabled=0 + +# Enable/disable encoding PCM channels into DOLBY/DTS (default: NONE) +Boxee.Audio.PreferredEncoding=NONE + +# Maximum PCM channels to decode if Dolby is not available (default: -1 - all) +Boxee.Audio.Dolby.MaxPCMChannelsDecode=2 + +# Maximum PCM channels to encode into Dolby is that is the PreferredEncoding (default: -1 - all) +Boxee.Audio.Dolby.MaxChannelsEncode=-1 + +# Maximum PCM channels to decode if DTS is not available (default: -1 - all) +Boxee.Audio.DTS.MaxPCMChannelsDecode=-1 + +# Maximum PCM channels to encode into DTS is that is the PreferredEncoding (default: -1 - all) +Boxee.Audio.DTS.MaxChannelsEncode=-1 + +# Enable/disable Dolby software decoder. Under most circumstances, this should be disabled, as hardware decoder is used. (default: 0) +Boxee.Audio.Dolby.SoftwareDecoder=0 + +# Enable/disable DTS software decoder. Under most circumstances, this should be disabled, as hardware decoder is used. (default: 0) +Boxee.Audio.DTS.SoftwareDecoder=1 diff --git a/system/phonon4.dll b/system/phonon4.dll new file mode 100644 index 00000000..15f34034 Binary files /dev/null and b/system/phonon4.dll differ diff --git a/system/players/dvdplayer/avcodec-52.dll b/system/players/dvdplayer/avcodec-52.dll new file mode 100644 index 00000000..26c3c9c2 Binary files /dev/null and b/system/players/dvdplayer/avcodec-52.dll differ diff --git a/system/players/dvdplayer/avcore-0.dll b/system/players/dvdplayer/avcore-0.dll new file mode 100644 index 00000000..e63ab6c6 Binary files /dev/null and b/system/players/dvdplayer/avcore-0.dll differ diff --git a/system/players/dvdplayer/avformat-52.dll b/system/players/dvdplayer/avformat-52.dll new file mode 100644 index 00000000..c98e9129 Binary files /dev/null and b/system/players/dvdplayer/avformat-52.dll differ diff --git a/system/players/dvdplayer/avutil-50.dll b/system/players/dvdplayer/avutil-50.dll new file mode 100644 index 00000000..7e9eaa87 Binary files /dev/null and b/system/players/dvdplayer/avutil-50.dll differ diff --git a/system/players/dvdplayer/libbluray.dll b/system/players/dvdplayer/libbluray.dll new file mode 100644 index 00000000..a7aed59d Binary files /dev/null and b/system/players/dvdplayer/libbluray.dll differ diff --git a/system/players/dvdplayer/libdvdcss-2.dll b/system/players/dvdplayer/libdvdcss-2.dll new file mode 100644 index 00000000..9fde9658 Binary files /dev/null and b/system/players/dvdplayer/libdvdcss-2.dll differ diff --git a/system/players/dvdplayer/libmpeg2-0.dll b/system/players/dvdplayer/libmpeg2-0.dll new file mode 100644 index 00000000..ea93a492 Binary files /dev/null and b/system/players/dvdplayer/libmpeg2-0.dll differ diff --git a/system/players/dvdplayer/librtmp.dll b/system/players/dvdplayer/librtmp.dll new file mode 100644 index 00000000..fa2995b2 Binary files /dev/null and b/system/players/dvdplayer/librtmp.dll differ diff --git a/system/players/dvdplayer/swscale-0.6.1.dll b/system/players/dvdplayer/swscale-0.6.1.dll new file mode 100644 index 00000000..e316cebb Binary files /dev/null and b/system/players/dvdplayer/swscale-0.6.1.dll differ diff --git a/system/players/flashplayer/FlashLib-win32.dll.manifest b/system/players/flashplayer/FlashLib-win32.dll.manifest new file mode 100644 index 00000000..bfec5059 --- /dev/null +++ b/system/players/flashplayer/FlashLib-win32.dll.manifest @@ -0,0 +1,15 @@ +ïŧŋ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/system/players/flashplayer/FlashLib-win32.pdb b/system/players/flashplayer/FlashLib-win32.pdb new file mode 100644 index 00000000..4c3559c8 Binary files /dev/null and b/system/players/flashplayer/FlashLib-win32.pdb differ diff --git a/system/players/flashplayer/Info.plist b/system/players/flashplayer/Info.plist new file mode 100644 index 00000000..292a7d29 --- /dev/null +++ b/system/players/flashplayer/Info.plist @@ -0,0 +1,18 @@ + + + + + CFBundleExecutable + bxflplayer-osx + CFBundleGetInfoString + boxee browser + CFBundleIdentifier + tv.boxee.boxeebrowser + CFBundlePackageType + APPL + CFBundleSignature + BXBR + LSUIElement + 1 + + diff --git a/system/players/flashplayer/boxeebrowser-win32.dll b/system/players/flashplayer/boxeebrowser-win32.dll new file mode 100644 index 00000000..a5cf3485 Binary files /dev/null and b/system/players/flashplayer/boxeebrowser-win32.dll differ diff --git a/system/players/flashplayer/boxeebrowser-win32.pdb b/system/players/flashplayer/boxeebrowser-win32.pdb new file mode 100644 index 00000000..236f7e42 Binary files /dev/null and b/system/players/flashplayer/boxeebrowser-win32.pdb differ diff --git a/system/players/flashplayer/bxflplayer-i686-cm-linux b/system/players/flashplayer/bxflplayer-i686-cm-linux new file mode 100755 index 00000000..4318f8d0 Binary files /dev/null and b/system/players/flashplayer/bxflplayer-i686-cm-linux differ diff --git a/system/players/flashplayer/bxflplayer-win32.pdb b/system/players/flashplayer/bxflplayer-win32.pdb new file mode 100644 index 00000000..85c4bd4f Binary files /dev/null and b/system/players/flashplayer/bxflplayer-win32.pdb differ diff --git a/system/players/flashplayer/bxflplayer-x86-osx b/system/players/flashplayer/bxflplayer-x86-osx new file mode 100755 index 00000000..bc4bc45a Binary files /dev/null and b/system/players/flashplayer/bxflplayer-x86-osx differ diff --git a/system/players/flashplayer/bxoverride-i686-cm-linux.so b/system/players/flashplayer/bxoverride-i686-cm-linux.so new file mode 100755 index 00000000..08a2f2f1 Binary files /dev/null and b/system/players/flashplayer/bxoverride-i686-cm-linux.so differ diff --git a/system/players/flashplayer/copy_qt_dlls_debug.bat b/system/players/flashplayer/copy_qt_dlls_debug.bat new file mode 100644 index 00000000..a77603f9 --- /dev/null +++ b/system/players/flashplayer/copy_qt_dlls_debug.bat @@ -0,0 +1,7 @@ +cls +rem @echo off + +copy /y ..\..\qt\win32_debug\QtWebKitd4.dll +copy /y ..\..\qt\win32_debug\QtGuid4.dll +copy /y ..\..\qt\win32_debug\QtCored4.dll +copy /y ..\..\qt\win32_debug\QtNetworkd4.dll \ No newline at end of file diff --git a/system/players/flashplayer/copy_qt_dlls_release.bat b/system/players/flashplayer/copy_qt_dlls_release.bat new file mode 100644 index 00000000..03458f9f --- /dev/null +++ b/system/players/flashplayer/copy_qt_dlls_release.bat @@ -0,0 +1,7 @@ +cls +rem @echo off + +copy /y ..\..\qt\win32_release\QtWebKit4.dll +copy /y ..\..\qt\win32_release\QtGui4.dll +copy /y ..\..\qt\win32_release\QtCore4.dll +copy /y ..\..\qt\win32_release\QtNetwork4.dll \ No newline at end of file diff --git a/system/players/flashplayer/curllib.dll b/system/players/flashplayer/curllib.dll new file mode 100644 index 00000000..827c1821 Binary files /dev/null and b/system/players/flashplayer/curllib.dll differ diff --git a/system/players/flashplayer/libFlashLib-i486-linux.so b/system/players/flashplayer/libFlashLib-i486-linux.so new file mode 100755 index 00000000..a2a8bb78 Binary files /dev/null and b/system/players/flashplayer/libFlashLib-i486-linux.so differ diff --git a/system/players/flashplayer/libFlashLib-i686-cm-linux.so b/system/players/flashplayer/libFlashLib-i686-cm-linux.so new file mode 100755 index 00000000..0bde873f Binary files /dev/null and b/system/players/flashplayer/libFlashLib-i686-cm-linux.so differ diff --git a/system/players/flashplayer/libFlashLib-x86_64-osx.dylib b/system/players/flashplayer/libFlashLib-x86_64-osx.dylib new file mode 100755 index 00000000..d5c96000 Binary files /dev/null and b/system/players/flashplayer/libFlashLib-x86_64-osx.dylib differ diff --git a/system/players/flashplayer/libbxoverride-i686-cm-linux.so b/system/players/flashplayer/libbxoverride-i686-cm-linux.so new file mode 100755 index 00000000..088df71d Binary files /dev/null and b/system/players/flashplayer/libbxoverride-i686-cm-linux.so differ diff --git a/system/players/flashplayer/libeay32.dll b/system/players/flashplayer/libeay32.dll new file mode 100644 index 00000000..da64c75b Binary files /dev/null and b/system/players/flashplayer/libeay32.dll differ diff --git a/system/players/flashplayer/libflashplayer-i686-cm-linux.so b/system/players/flashplayer/libflashplayer-i686-cm-linux.so new file mode 100755 index 00000000..45d40f94 Binary files /dev/null and b/system/players/flashplayer/libflashplayer-i686-cm-linux.so differ diff --git a/system/players/flashplayer/libsasl.dll b/system/players/flashplayer/libsasl.dll new file mode 100644 index 00000000..f2509cd0 Binary files /dev/null and b/system/players/flashplayer/libsasl.dll differ diff --git a/system/players/flashplayer/msvcr90.dll b/system/players/flashplayer/msvcr90.dll new file mode 100644 index 00000000..a68249aa Binary files /dev/null and b/system/players/flashplayer/msvcr90.dll differ diff --git a/system/players/flashplayer/openldap.dll b/system/players/flashplayer/openldap.dll new file mode 100644 index 00000000..14e1beec Binary files /dev/null and b/system/players/flashplayer/openldap.dll differ diff --git a/system/players/flashplayer/plugins/imageformats/libqgif.dylib b/system/players/flashplayer/plugins/imageformats/libqgif.dylib new file mode 100755 index 00000000..ff18e797 Binary files /dev/null and b/system/players/flashplayer/plugins/imageformats/libqgif.dylib differ diff --git a/system/players/flashplayer/plugins/imageformats/libqico.dylib b/system/players/flashplayer/plugins/imageformats/libqico.dylib new file mode 100755 index 00000000..30ad9600 Binary files /dev/null and b/system/players/flashplayer/plugins/imageformats/libqico.dylib differ diff --git a/system/players/flashplayer/plugins/imageformats/libqjpeg.dylib b/system/players/flashplayer/plugins/imageformats/libqjpeg.dylib new file mode 100755 index 00000000..ef1c9279 Binary files /dev/null and b/system/players/flashplayer/plugins/imageformats/libqjpeg.dylib differ diff --git a/system/players/flashplayer/plugins/imageformats/libqmng.dylib b/system/players/flashplayer/plugins/imageformats/libqmng.dylib new file mode 100755 index 00000000..272dae65 Binary files /dev/null and b/system/players/flashplayer/plugins/imageformats/libqmng.dylib differ diff --git a/system/players/flashplayer/plugins/imageformats/libqsvg.dylib b/system/players/flashplayer/plugins/imageformats/libqsvg.dylib new file mode 100755 index 00000000..22511951 Binary files /dev/null and b/system/players/flashplayer/plugins/imageformats/libqsvg.dylib differ diff --git a/system/players/flashplayer/plugins/imageformats/libqtiff.dylib b/system/players/flashplayer/plugins/imageformats/libqtiff.dylib new file mode 100755 index 00000000..6289b1b1 Binary files /dev/null and b/system/players/flashplayer/plugins/imageformats/libqtiff.dylib differ diff --git a/system/players/flashplayer/plugins/sqldrivers/libqsqlite.dylib b/system/players/flashplayer/plugins/sqldrivers/libqsqlite.dylib new file mode 100755 index 00000000..0c91af4d Binary files /dev/null and b/system/players/flashplayer/plugins/sqldrivers/libqsqlite.dylib differ diff --git a/system/players/flashplayer/plugins/sqldrivers/libqsqlodbc.dylib b/system/players/flashplayer/plugins/sqldrivers/libqsqlodbc.dylib new file mode 100755 index 00000000..64d81f5a Binary files /dev/null and b/system/players/flashplayer/plugins/sqldrivers/libqsqlodbc.dylib differ diff --git a/system/players/flashplayer/ssleay32.dll b/system/players/flashplayer/ssleay32.dll new file mode 100644 index 00000000..637904c5 Binary files /dev/null and b/system/players/flashplayer/ssleay32.dll differ diff --git a/system/python-apps-public.pem b/system/python-apps-public.pem new file mode 100644 index 00000000..3f325682 --- /dev/null +++ b/system/python-apps-public.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvBdk2m7jBXgbHrbN7H/k +AJ3puZdeS65htfPccvsrLt3tEmLTTdOHOWwFf1wjgC+aghG5sOJL1+rzZNudY6YV +44mCYzmhFyMqAmOSB4iWrztu4d1KZOFTfVOPdUkwDb25fSWUrRaePlAulO3Njgta +JFucwYfUyDGQTboQ8VCA6RtjqtMkhlsI/yNWzimKFBh9FO1eFr+IY81PZZc/SUfJ +FWBWM6NR3ycC5ScmrHJCYu2CIwaLP+LeZWikVThwONquhN8lTI0xvsWpcWyF6XVv +AcSB3inGRJ+iPhBMqnVvfESA6aJl0p1ocUWSF5U9+evJwnoGnXicRa+pYCBFaj1I +nwIDAQAB +-----END PUBLIC KEY----- diff --git a/system/python/local/_bxappsec.so b/system/python/local/_bxappsec.so new file mode 100755 index 00000000..ca5edc09 Binary files /dev/null and b/system/python/local/_bxappsec.so differ diff --git a/system/python/local/bxappsec.py b/system/python/local/bxappsec.py new file mode 100644 index 00000000..374961d0 --- /dev/null +++ b/system/python/local/bxappsec.py @@ -0,0 +1,94 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 1.3.40 +# +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. +# This file is compatible with both classic and new-style classes. + +from sys import version_info +if version_info >= (2,6,0): + def swig_import_helper(): + from os.path import dirname + import imp + fp = None + try: + fp, pathname, description = imp.find_module('_bxappsec', [dirname(__file__)]) + except ImportError: + import _bxappsec + return _bxappsec + if fp is not None: + try: + _mod = imp.load_module('_bxappsec', fp, pathname, description) + finally: + fp.close() + return _mod + _bxappsec = swig_import_helper() + del swig_import_helper +else: + import _bxappsec +del version_info +try: + _swig_property = property +except NameError: + pass # Python < 2.2 doesn't have 'property'. +def _swig_setattr_nondynamic(self,class_type,name,value,static=1): + if (name == "thisown"): return self.this.own(value) + if (name == "this"): + if type(value).__name__ == 'SwigPyObject': + self.__dict__[name] = value + return + method = class_type.__swig_setmethods__.get(name,None) + if method: return method(self,value) + if (not static) or hasattr(self,name): + self.__dict__[name] = value + else: + raise AttributeError("You cannot add attributes to %s" % self) + +def _swig_setattr(self,class_type,name,value): + return _swig_setattr_nondynamic(self,class_type,name,value,0) + +def _swig_getattr(self,class_type,name): + if (name == "thisown"): return self.this.own() + method = class_type.__swig_getmethods__.get(name,None) + if method: return method(self) + raise AttributeError(name) + +def _swig_repr(self): + try: strthis = "proxy of " + self.this.__repr__() + except: strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + +try: + _object = object + _newclass = 1 +except AttributeError: + class _object : pass + _newclass = 0 + + + +def initbxappsec(): + return _bxappsec.initbxappsec() +initbxappsec = _bxappsec.initbxappsec + +def Init(*args): + return _bxappsec.Init(*args) +Init = _bxappsec.Init + +def Encrypt(*args): + return _bxappsec.Encrypt(*args) +Encrypt = _bxappsec.Encrypt + +def Decrypt(*args): + return _bxappsec.Decrypt(*args) +Decrypt = _bxappsec.Decrypt + +def Close(*args): + return _bxappsec.Close(*args) +Close = _bxappsec.Close + +def GetMachineID(*args): + return _bxappsec.GetMachineID(*args) +GetMachineID = _bxappsec.GetMachineID + + diff --git a/system/shaders/convolution-4x4.glsl b/system/shaders/convolution-4x4.glsl new file mode 100644 index 00000000..e7f0dd62 --- /dev/null +++ b/system/shaders/convolution-4x4.glsl @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +uniform sampler2D img; +uniform vec2 stepxy; +uniform float m_stretch; +varying vec2 cord; + +#if (USE1DTEXTURE) + uniform sampler1D kernelTex; +#else + uniform sampler2D kernelTex; +#endif + +//nvidia's half is a 16 bit float and can bring some speed improvements +//without affecting quality +#ifndef __GLSL_CG_DATA_TYPES + #define half float + #define half3 vec3 + #define half4 vec4 +#endif + +half4 weight(float pos) +{ +#if (HAS_FLOAT_TEXTURE) + #if (USE1DTEXTURE) + return texture1D(kernelTex, pos); + #else + return texture2D(kernelTex, vec2(pos, 0.5)); + #endif +#else + #if (USE1DTEXTURE) + return texture1D(kernelTex, pos) * 2.0 - 1.0; + #else + return texture2D(kernelTex, vec2(pos, 0.5)) * 2.0 - 1.0; + #endif +#endif +} + +vec2 stretch(vec2 pos) +{ +#if (XBMC_STRETCH) + // our transform should map [0..1] to itself, with f(0) = 0, f(1) = 1, f(0.5) = 0.5, and f'(0.5) = b. + // a simple curve to do this is g(x) = b(x-0.5) + (1-b)2^(n-1)(x-0.5)^n + 0.5 + // where the power preserves sign. n = 2 is the simplest non-linear case (required when b != 1) + float x = pos.x - 0.5; + return vec2(mix(x * abs(x) * 2.0, x, m_stretch) + 0.5, pos.y); +#else + return pos; +#endif +} + +half3 pixel(float xpos, float ypos) +{ + return texture2D(img, vec2(xpos, ypos)).rgb; +} + +half3 line (float ypos, vec4 xpos, half4 linetaps) +{ + return + pixel(xpos.r, ypos) * linetaps.r + + pixel(xpos.g, ypos) * linetaps.g + + pixel(xpos.b, ypos) * linetaps.b + + pixel(xpos.a, ypos) * linetaps.a; +} + +void main() +{ + vec2 pos = stretch(cord) + stepxy * 0.5; + vec2 f = fract(pos / stepxy); + + half4 linetaps = weight(1.0 - f.x); + half4 columntaps = weight(1.0 - f.y); + + //make sure all taps added together is exactly 1.0, otherwise some (very small) distortion can occur + linetaps /= linetaps.r + linetaps.g + linetaps.b + linetaps.a; + columntaps /= columntaps.r + columntaps.g + columntaps.b + columntaps.a; + + vec2 xystart = (-1.5 - f) * stepxy + pos; + vec4 xpos = vec4(xystart.x, xystart.x + stepxy.x, xystart.x + stepxy.x * 2.0, xystart.x + stepxy.x * 3.0); + + gl_FragColor.rgb = + line(xystart.y , xpos, linetaps) * columntaps.r + + line(xystart.y + stepxy.y , xpos, linetaps) * columntaps.g + + line(xystart.y + stepxy.y * 2.0, xpos, linetaps) * columntaps.b + + line(xystart.y + stepxy.y * 3.0, xpos, linetaps) * columntaps.a; + + gl_FragColor.a = gl_Color.a; +} + diff --git a/system/shaders/convolution-4x4_d3d.fx b/system/shaders/convolution-4x4_d3d.fx new file mode 100644 index 00000000..84cc784e --- /dev/null +++ b/system/shaders/convolution-4x4_d3d.fx @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2005-2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +texture g_Texture; +texture g_KernelTexture; +float2 g_StepXY; + +sampler RGBSampler = + sampler_state { + Texture = ; + AddressU = CLAMP; + AddressV = CLAMP; + MinFilter = POINT; + MagFilter = POINT; + }; + +sampler KernelSampler = + sampler_state + { + Texture = ; + AddressU = CLAMP; + AddressV = CLAMP; + MinFilter = LINEAR; + MagFilter = LINEAR; + }; + +struct VS_OUTPUT +{ + float4 Position : POSITION; + float2 TextureUV : TEXCOORD0; +}; + +struct PS_OUTPUT +{ + float4 RGBColor : COLOR0; +}; + +half4 weight(float pos) +{ + half4 w; +#ifdef HAS_RGBA + w = tex1D(KernelSampler, pos); +#else + w = tex1D(KernelSampler, pos).bgra; +#endif + +#ifdef HAS_FLOAT_TEXTURE + return w; +#else + return w * 2.0 - 1.0; +#endif +} + +half3 pixel(float xpos, float ypos) +{ + return tex2D(RGBSampler, float2(xpos, ypos)).rgb; +} + +half3 getLine(float ypos, float4 xpos, half4 linetaps) +{ + return + pixel(xpos.r, ypos) * linetaps.r + + pixel(xpos.g, ypos) * linetaps.g + + pixel(xpos.b, ypos) * linetaps.b + + pixel(xpos.a, ypos) * linetaps.a; +} + +PS_OUTPUT CONVOLUTION4x4(VS_OUTPUT In) +{ + PS_OUTPUT OUT; + + float2 pos = In.TextureUV + g_StepXY * 0.5; + float2 f = frac(pos / g_StepXY); + + half4 linetaps = weight(1.0 - f.x); + half4 columntaps = weight(1.0 - f.y); + + // kernel generation code made sure taps add up to 1, no need to adjust here. + + float2 xystart = (-1.0 - f) * g_StepXY + In.TextureUV; + float4 xpos = float4( + xystart.x, + xystart.x + g_StepXY.x, + xystart.x + g_StepXY.x * 2.0, + xystart.x + g_StepXY.x * 3.0); + + OUT.RGBColor.rgb = + getLine(xystart.y , xpos, linetaps) * columntaps.r + + getLine(xystart.y + g_StepXY.y , xpos, linetaps) * columntaps.g + + getLine(xystart.y + g_StepXY.y * 2.0, xpos, linetaps) * columntaps.b + + getLine(xystart.y + g_StepXY.y * 3.0, xpos, linetaps) * columntaps.a; + + OUT.RGBColor.a = 1.0; + return OUT; +} + +technique SCALER_T +{ + pass P0 + { + PixelShader = compile ps_3_0 CONVOLUTION4x4(); + ZEnable = False; + FillMode = Solid; + FogEnable = False; + } +}; diff --git a/system/shaders/convolution-6x6.glsl b/system/shaders/convolution-6x6.glsl new file mode 100644 index 00000000..196c5ee0 --- /dev/null +++ b/system/shaders/convolution-6x6.glsl @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +uniform sampler2D img; +uniform vec2 stepxy; +uniform float m_stretch; +varying vec2 cord; + +#if (USE1DTEXTURE) + uniform sampler1D kernelTex; +#else + uniform sampler2D kernelTex; +#endif + +//nvidia's half is a 16 bit float and can bring some speed improvements +//without affecting quality +#ifndef __GLSL_CG_DATA_TYPES + #define half float + #define half3 vec3 + #define half4 vec4 +#endif + +half3 weight(float pos) +{ +#if (HAS_FLOAT_TEXTURE) + #if (USE1DTEXTURE) + return texture1D(kernelTex, pos).rgb; + #else + return texture2D(kernelTex, vec2(pos, 0.5)).rgb; + #endif +#else + #if (USE1DTEXTURE) + return texture1D(kernelTex, pos).rgb * 2.0 - 1.0; + #else + return texture2D(kernelTex, vec2(pos, 0.5)).rgb * 2.0 - 1.0; + #endif +#endif +} + +vec2 stretch(vec2 pos) +{ +#if (XBMC_STRETCH) + // our transform should map [0..1] to itself, with f(0) = 0, f(1) = 1, f(0.5) = 0.5, and f'(0.5) = b. + // a simple curve to do this is g(x) = b(x-0.5) + (1-b)2^(n-1)(x-0.5)^n + 0.5 + // where the power preserves sign. n = 2 is the simplest non-linear case (required when b != 1) + float x = pos.x - 0.5; + return vec2(mix(x * abs(x) * 2.0, x, m_stretch) + 0.5, pos.y); +#else + return pos; +#endif +} + +half3 pixel(float xpos, float ypos) +{ + return texture2D(img, vec2(xpos, ypos)).rgb; +} + +half3 line (float ypos, vec3 xpos1, vec3 xpos2, half3 linetaps1, half3 linetaps2) +{ + return + pixel(xpos1.r, ypos) * linetaps1.r + + pixel(xpos1.g, ypos) * linetaps2.r + + pixel(xpos1.b, ypos) * linetaps1.g + + pixel(xpos2.r, ypos) * linetaps2.g + + pixel(xpos2.g, ypos) * linetaps1.b + + pixel(xpos2.b, ypos) * linetaps2.b; +} + +void main() +{ + vec2 pos = stretch(cord) + stepxy * 0.5; + vec2 f = fract(pos / stepxy); + + half3 linetaps1 = weight((1.0 - f.x) / 2.0); + half3 linetaps2 = weight((1.0 - f.x) / 2.0 + 0.5); + half3 columntaps1 = weight((1.0 - f.y) / 2.0); + half3 columntaps2 = weight((1.0 - f.y) / 2.0 + 0.5); + + //make sure all taps added together is exactly 1.0, otherwise some (very small) distortion can occur + half sum = linetaps1.r + linetaps1.g + linetaps1.b + linetaps2.r + linetaps2.g + linetaps2.b; + linetaps1 /= sum; + linetaps2 /= sum; + sum = columntaps1.r + columntaps1.g + columntaps1.b + columntaps2.r + columntaps2.g + columntaps2.b; + columntaps1 /= sum; + columntaps2 /= sum; + + vec2 xystart = (-2.5 - f) * stepxy + pos; + vec3 xpos1 = vec3(xystart.x, xystart.x + stepxy.x, xystart.x + stepxy.x * 2.0); + vec3 xpos2 = vec3(xystart.x + stepxy.x * 3.0, xystart.x + stepxy.x * 4.0, xystart.x + stepxy.x * 5.0); + + gl_FragColor.rgb = + line(xystart.y , xpos1, xpos2, linetaps1, linetaps2) * columntaps1.r + + line(xystart.y + stepxy.y , xpos1, xpos2, linetaps1, linetaps2) * columntaps2.r + + line(xystart.y + stepxy.y * 2.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps1.g + + line(xystart.y + stepxy.y * 3.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps2.g + + line(xystart.y + stepxy.y * 4.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps1.b + + line(xystart.y + stepxy.y * 5.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps2.b; + + gl_FragColor.a = gl_Color.a; +} + diff --git a/system/shaders/convolution-6x6_d3d.fx b/system/shaders/convolution-6x6_d3d.fx new file mode 100644 index 00000000..d3422740 --- /dev/null +++ b/system/shaders/convolution-6x6_d3d.fx @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2005-2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +texture g_Texture; +texture g_KernelTexture; +float2 g_StepXY; + +sampler RGBSampler = + sampler_state { + Texture = ; + AddressU = CLAMP; + AddressV = CLAMP; + MinFilter = POINT; + MagFilter = POINT; + }; + +sampler KernelSampler = + sampler_state + { + Texture = ; + AddressU = CLAMP; + AddressV = CLAMP; + MinFilter = LINEAR; + MagFilter = LINEAR; + }; + +struct VS_OUTPUT +{ + float4 Position : POSITION; + float2 TextureUV : TEXCOORD0; +}; + +struct PS_OUTPUT +{ + float4 RGBColor : COLOR0; +}; + +half3 weight(float pos) +{ + half3 w; +#ifdef HAS_RGBA + w = tex1D(KernelSampler, pos).rgb; +#else + w = tex1D(KernelSampler, pos).bgr; +#endif + +#ifdef HAS_FLOAT_TEXTURE + return w; +#else + return w * 2.0 - 1.0; +#endif +} + +half3 pixel(float xpos, float ypos) +{ + return tex2D(RGBSampler, float2(xpos, ypos)).rgb; +} + +half3 getLine(float ypos, float3 xpos1, float3 xpos2, half3 linetaps1, half3 linetaps2) +{ + return + pixel(xpos1.r, ypos) * linetaps1.r + + pixel(xpos1.g, ypos) * linetaps2.r + + pixel(xpos1.b, ypos) * linetaps1.g + + pixel(xpos2.r, ypos) * linetaps2.g + + pixel(xpos2.g, ypos) * linetaps1.b + + pixel(xpos2.b, ypos) * linetaps2.b; +} + +PS_OUTPUT CONVOLUTION6x6(VS_OUTPUT In) +{ + PS_OUTPUT OUT; + + float2 pos = In.TextureUV + g_StepXY * 0.5; + float2 f = frac(pos / g_StepXY); + + half3 linetaps1 = weight((1.0 - f.x) / 2.0); + half3 linetaps2 = weight((1.0 - f.x) / 2.0 + 0.5); + half3 columntaps1 = weight((1.0 - f.y) / 2.0); + half3 columntaps2 = weight((1.0 - f.y) / 2.0 + 0.5); + + // kernel generation code made sure taps add up to 1, no need to adjust here. + + float2 xystart = (-2.0 - f) * g_StepXY + In.TextureUV; + float3 xpos1 = float3( + xystart.x, + xystart.x + g_StepXY.x, + xystart.x + g_StepXY.x * 2.0); + float3 xpos2 = half3( + xystart.x + g_StepXY.x * 3.0, + xystart.x + g_StepXY.x * 4.0, + xystart.x + g_StepXY.x * 5.0); + + OUT.RGBColor.rgb = getLine(xystart.y , xpos1, xpos2, linetaps1, linetaps2) * columntaps1.r + + getLine(xystart.y + g_StepXY.y , xpos1, xpos2, linetaps1, linetaps2) * columntaps2.r + + getLine(xystart.y + g_StepXY.y * 2.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps1.g + + getLine(xystart.y + g_StepXY.y * 3.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps2.g + + getLine(xystart.y + g_StepXY.y * 4.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps1.b + + getLine(xystart.y + g_StepXY.y * 5.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps2.b; + + OUT.RGBColor.a = 1.0; + return OUT; +} + +technique SCALER_T +{ + pass P0 + { + PixelShader = compile ps_3_0 CONVOLUTION6x6(); + ZEnable = False; + FillMode = Solid; + FogEnable = False; + } +}; diff --git a/system/shaders/guishader_frag_default.glsl b/system/shaders/guishader_frag_default.glsl new file mode 100644 index 00000000..4311a6ca --- /dev/null +++ b/system/shaders/guishader_frag_default.glsl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +precision mediump float; +varying lowp vec4 m_colour; + +// SM_DEFAULT shader +void main () +{ + gl_FragColor = m_colour; +} diff --git a/system/shaders/guishader_frag_fonts.glsl b/system/shaders/guishader_frag_fonts.glsl new file mode 100644 index 00000000..5628dd3d --- /dev/null +++ b/system/shaders/guishader_frag_fonts.glsl @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +precision mediump float; +uniform sampler2D m_samp0; +varying vec4 m_cord0; +varying lowp vec4 m_colour; + +// SM_FONTS shader +void main () +{ + gl_FragColor.r = m_colour.r; + gl_FragColor.g = m_colour.g; + gl_FragColor.b = m_colour.b; + gl_FragColor.a = m_colour.a * texture2D(m_samp0, m_cord0.xy).a; +} diff --git a/system/shaders/guishader_frag_multi.glsl b/system/shaders/guishader_frag_multi.glsl new file mode 100644 index 00000000..c712e3c2 --- /dev/null +++ b/system/shaders/guishader_frag_multi.glsl @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +precision mediump float; +uniform sampler2D m_samp0; +uniform sampler2D m_samp1; +varying vec4 m_cord0; +varying vec4 m_cord1; + +// SM_MULTI shader +void main () +{ + gl_FragColor.rgba = (texture2D(m_samp0, m_cord0.xy) * texture2D(m_samp1, m_cord1.xy)).bgra; +} diff --git a/system/shaders/guishader_frag_multi_blendcolor.glsl b/system/shaders/guishader_frag_multi_blendcolor.glsl new file mode 100644 index 00000000..e012a6bf --- /dev/null +++ b/system/shaders/guishader_frag_multi_blendcolor.glsl @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +precision mediump float; +uniform sampler2D m_samp0; +uniform sampler2D m_samp1; +varying vec4 m_cord0; +varying vec4 m_cord1; +varying lowp vec4 m_colour; + +// SM_MULTI shader +void main () +{ + gl_FragColor.rgba = (texture2D(m_samp0, m_cord0.xy) * texture2D(m_samp1, m_cord1.xy)).bgra * m_colour; +} diff --git a/system/shaders/guishader_frag_rgba.glsl b/system/shaders/guishader_frag_rgba.glsl new file mode 100644 index 00000000..743323a3 --- /dev/null +++ b/system/shaders/guishader_frag_rgba.glsl @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +precision mediump float; +uniform sampler2D m_samp0; +uniform sampler2D m_samp1; +varying vec4 m_cord0; +varying vec4 m_cord1; +varying lowp vec4 m_colour; +uniform int m_method; + +// SM_TEXTURE_NOBLEND +void main () +{ + gl_FragColor.rgba = texture2D(m_samp0, m_cord0.xy).rgba; +} diff --git a/system/shaders/guishader_frag_rgba_blendcolor.glsl b/system/shaders/guishader_frag_rgba_blendcolor.glsl new file mode 100644 index 00000000..ec20991e --- /dev/null +++ b/system/shaders/guishader_frag_rgba_blendcolor.glsl @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +precision mediump float; +uniform sampler2D m_samp0; +uniform sampler2D m_samp1; +varying vec4 m_cord0; +varying vec4 m_cord1; +varying lowp vec4 m_colour; +uniform int m_method; + +// SM_TEXTURE +void main () +{ + gl_FragColor.rgba = vec4(texture2D(m_samp0, m_cord0.xy).rgba * m_colour); +} diff --git a/system/shaders/guishader_frag_texture.glsl b/system/shaders/guishader_frag_texture.glsl new file mode 100644 index 00000000..826369fe --- /dev/null +++ b/system/shaders/guishader_frag_texture.glsl @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +precision mediump float; +uniform sampler2D m_samp0; +varying vec4 m_cord0; +varying lowp vec4 m_colour; + +// SM_TEXTURE shader +void main () +{ + gl_FragColor.rgba = vec4(texture2D(m_samp0, m_cord0.xy).bgra * m_colour); +} diff --git a/system/shaders/guishader_frag_texture_noblend.glsl b/system/shaders/guishader_frag_texture_noblend.glsl new file mode 100644 index 00000000..16438a38 --- /dev/null +++ b/system/shaders/guishader_frag_texture_noblend.glsl @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +precision mediump float; +uniform sampler2D m_samp0; +varying vec4 m_cord0; + +// SM_TEXTURE_NOBLEND shader +void main () +{ + gl_FragColor.rgba = vec4(texture2D(m_samp0, m_cord0.xy).bgra); +} diff --git a/system/shaders/guishader_vert.glsl b/system/shaders/guishader_vert.glsl new file mode 100644 index 00000000..471abd8d --- /dev/null +++ b/system/shaders/guishader_vert.glsl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +attribute vec4 m_attrpos; +attribute vec4 m_attrcol; +attribute vec4 m_attrcord0; +attribute vec4 m_attrcord1; +varying vec4 m_cord0; +varying vec4 m_cord1; +varying lowp vec4 m_colour; +uniform mat4 m_proj; +uniform mat4 m_model; + +void main () +{ + mat4 mvp = m_proj * m_model; + gl_Position = mvp * m_attrpos; + m_colour = m_attrcol; + m_cord0 = m_attrcord0; + m_cord1 = m_attrcord1; +} diff --git a/system/shaders/stretch.glsl b/system/shaders/stretch.glsl new file mode 100644 index 00000000..4080ff05 --- /dev/null +++ b/system/shaders/stretch.glsl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +uniform sampler2D img; +uniform float m_stretch; +varying vec2 cord; + +vec2 stretch(vec2 pos) +{ + // our transform should map [0..1] to itself, with f(0) = 0, f(1) = 1, f(0.5) = 0.5, and f'(0.5) = b. + // a simple curve to do this is g(x) = b(x-0.5) + (1-b)2^(n-1)(x-0.5)^n + 0.5 + // where the power preserves sign. n = 2 is the simplest non-linear case (required when b != 1) + float x = pos.x - 0.5; + return vec2(mix(x * abs(x) * 2.0, x, m_stretch) + 0.5, pos.y); +} + +void main() +{ + gl_FragColor.rgb = texture2D(img, stretch(cord)).rgb; + gl_FragColor.a = gl_Color.a; +} + diff --git a/system/shaders/testshader.fx b/system/shaders/testshader.fx new file mode 100644 index 00000000..945d6e93 --- /dev/null +++ b/system/shaders/testshader.fx @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +float4 TEST() : COLOR +{ + return float4(0.0, 0.0, 0.0, 0.0); +} + +technique TEST_T +{ + pass P0 + { + PixelShader = compile ps_2_0 TEST(); + } +}; diff --git a/system/shaders/yuv2rgb_basic_2d_UYVY.arb b/system/shaders/yuv2rgb_basic_2d_UYVY.arb new file mode 100644 index 00000000..4b30560b --- /dev/null +++ b/system/shaders/yuv2rgb_basic_2d_UYVY.arb @@ -0,0 +1,69 @@ +!!ARBfp1.0 + +# +# Copyright (C) 2010 Team XBMC +# http://www.xbmc.org +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with XBMC; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +# +# + +PARAM yuvmat[4] = { program.local[0..3] }; +#stepx, stepy, width, height +PARAM dims[1] = { program.local[4] }; +TEMP f; +TEMP pos; +MAD pos.x , dims[0].x, -0.25, fragment.texcoord[0].x; +MOV pos.y , fragment.texcoord[0].y; +MUL f.x , dims[0].z, pos.x; +MUL f.y , dims[0].w, pos.y; +FRC f , f; + +TEMP c1pos; +TEMP c2pos; +SUB c1pos.x, 0.5, f.x; +SUB c2pos.x, 1.5, f.x; +MAD c1pos.x, c1pos.x, dims[0].x, pos.x; +MAD c2pos.x, c2pos.x, dims[0].x, pos.x; +MOV c1pos.y, pos.y; +MOV c2pos.y, pos.y; + +TEMP c1; +TEMP c2; +TEX c1, c1pos, texture[0], 2D; +TEX c2, c2pos, texture[0], 2D; + +TEMP cint; +MUL cint.x, f.x, 2.0; +MAD cint.y, f.x, 2.0, -1.0; +SGE cint.z, f.x, 0.5; + +TEMP yuv; +LRP yuv.g, cint.x, c1.a , c1.g; +LRP yuv.b, cint.y, c2.g , c1.a; +LRP yuv.r, cint.z, yuv.b, yuv.g; + +LRP yuv.g, f.x , c2.b , c1.b; +LRP yuv.b, f.x , c2.r , c1.r; + +TEMP rgb; +DPH rgb.r, yuv, yuvmat[0]; +DPH rgb.g, yuv, yuvmat[1]; +DPH rgb.b, yuv, yuvmat[2]; +MOV rgb.a, fragment.color.a; +MOV result.color, rgb; + +END diff --git a/system/shaders/yuv2rgb_basic_2d_YUY2.arb b/system/shaders/yuv2rgb_basic_2d_YUY2.arb new file mode 100644 index 00000000..2b13fcfc --- /dev/null +++ b/system/shaders/yuv2rgb_basic_2d_YUY2.arb @@ -0,0 +1,69 @@ +!!ARBfp1.0 + +# +# Copyright (C) 2010 Team XBMC +# http://www.xbmc.org +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with XBMC; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +# +# + +PARAM yuvmat[4] = { program.local[0..3] }; +#stepx, stepy, width, height +PARAM dims[1] = { program.local[4] }; +TEMP f; +TEMP pos; +MAD pos.x , dims[0].x, -0.25, fragment.texcoord[0].x; +MOV pos.y , fragment.texcoord[0].y; +MUL f.x , dims[0].z, pos.x; +MUL f.y , dims[0].w, pos.y; +FRC f , f; + +TEMP c1pos; +TEMP c2pos; +SUB c1pos.x, 0.5, f.x; +SUB c2pos.x, 1.5, f.x; +MAD c1pos.x, c1pos.x, dims[0].x, pos.x; +MAD c2pos.x, c2pos.x, dims[0].x, pos.x; +MOV c1pos.y, pos.y; +MOV c2pos.y, pos.y; + +TEMP c1; +TEMP c2; +TEX c1, c1pos, texture[0], 2D; +TEX c2, c2pos, texture[0], 2D; + +TEMP cint; +MUL cint.x, f.x, 2.0; +MAD cint.y, f.x, 2.0, -1.0; +SGE cint.z, f.x, 0.5; + +TEMP yuv; +LRP yuv.g, cint.x, c1.r , c1.b; +LRP yuv.b, cint.y, c2.b , c1.r; +LRP yuv.r, cint.z, yuv.b, yuv.g; + +LRP yuv.g, f.x , c2.g , c1.g; +LRP yuv.b, f.x , c2.a , c1.a; + +TEMP rgb; +DPH rgb.r, yuv, yuvmat[0]; +DPH rgb.g, yuv, yuvmat[1]; +DPH rgb.b, yuv, yuvmat[2]; +MOV rgb.a, fragment.color.a; +MOV result.color, rgb; + +END diff --git a/system/shaders/yuv2rgb_basic_gles.glsl b/system/shaders/yuv2rgb_basic_gles.glsl new file mode 100644 index 00000000..ee8f3271 --- /dev/null +++ b/system/shaders/yuv2rgb_basic_gles.glsl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +precision mediump float; +uniform sampler2D m_sampY; +uniform sampler2D m_sampU; +uniform sampler2D m_sampV; +varying vec2 m_cordY; +varying vec2 m_cordU; +varying vec2 m_cordV; +uniform float m_alpha; +uniform mat4 m_yuvmat; + +void main() +{ + vec4 yuv, rgb; + yuv.rgba = vec4(texture2D(m_sampY, m_cordY).r, texture2D(m_sampU, m_cordU).r, texture2D(m_sampV, m_cordV).r, 1.0); + + rgb = m_yuvmat * yuv; + rgb.a = m_alpha; + gl_FragColor = rgb; +} diff --git a/system/shaders/yuv2rgb_basic_rect_UYVY.arb b/system/shaders/yuv2rgb_basic_rect_UYVY.arb new file mode 100644 index 00000000..2100914e --- /dev/null +++ b/system/shaders/yuv2rgb_basic_rect_UYVY.arb @@ -0,0 +1,65 @@ +!!ARBfp1.0 + +# +# Copyright (C) 2010 Team XBMC +# http://www.xbmc.org +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with XBMC; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +# +# + +PARAM yuvmat[4] = { program.local[0..3] }; +TEMP f; +TEMP pos; +ADD pos.x , fragment.texcoord[0].x, -0.25; +MOV pos.y , fragment.texcoord[0].y; +FRC f , pos; + +TEMP c1pos; +TEMP c2pos; +SUB c1pos.x, 0.5, f.x; +SUB c2pos.x, 1.5, f.x; +ADD c1pos.x, c1pos.x, pos.x; +ADD c2pos.x, c2pos.x, pos.x; +MOV c1pos.y, pos.y; +MOV c2pos.y, pos.y; + +TEMP c1; +TEMP c2; +TEX c1, c1pos, texture[0], RECT; +TEX c2, c2pos, texture[0], RECT; + +TEMP cint; +MUL cint.x, f.x, 2.0; +MAD cint.y, f.x, 2.0, -1.0; +SGE cint.z, f.x, 0.5; + +TEMP yuv; +LRP yuv.g, cint.x, c1.a , c1.g; +LRP yuv.b, cint.y, c2.g , c1.a; +LRP yuv.r, cint.z, yuv.b, yuv.g; + +LRP yuv.g, f.x , c2.b , c1.b; +LRP yuv.b, f.x , c2.r , c1.r; + +TEMP rgb; +DPH rgb.r, yuv, yuvmat[0]; +DPH rgb.g, yuv, yuvmat[1]; +DPH rgb.b, yuv, yuvmat[2]; +MOV rgb.a, fragment.color.a; +MOV result.color, rgb; + +END diff --git a/system/shaders/yuv2rgb_basic_rect_YUY2.arb b/system/shaders/yuv2rgb_basic_rect_YUY2.arb new file mode 100644 index 00000000..2063c266 --- /dev/null +++ b/system/shaders/yuv2rgb_basic_rect_YUY2.arb @@ -0,0 +1,65 @@ +!!ARBfp1.0 + +# +# Copyright (C) 2010 Team XBMC +# http://www.xbmc.org +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with XBMC; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +# +# + +PARAM yuvmat[4] = { program.local[0..3] }; +TEMP f; +TEMP pos; +ADD pos.x , fragment.texcoord[0].x, -0.25; +MOV pos.y , fragment.texcoord[0].y; +FRC f , pos; + +TEMP c1pos; +TEMP c2pos; +SUB c1pos.x, 0.5, f.x; +SUB c2pos.x, 1.5, f.x; +ADD c1pos.x, c1pos.x, pos.x; +ADD c2pos.x, c2pos.x, pos.x; +MOV c1pos.y, pos.y; +MOV c2pos.y, pos.y; + +TEMP c1; +TEMP c2; +TEX c1, c1pos, texture[0], RECT; +TEX c2, c2pos, texture[0], RECT; + +TEMP cint; +MUL cint.x, f.x, 2.0; +MAD cint.y, f.x, 2.0, -1.0; +SGE cint.z, f.x, 0.5; + +TEMP yuv; +LRP yuv.g, cint.x, c1.r , c1.b; +LRP yuv.b, cint.y, c2.b , c1.r; +LRP yuv.r, cint.z, yuv.b, yuv.g; + +LRP yuv.g, f.x , c2.g , c1.g; +LRP yuv.b, f.x , c2.a , c1.a; + +TEMP rgb; +DPH rgb.r, yuv, yuvmat[0]; +DPH rgb.g, yuv, yuvmat[1]; +DPH rgb.b, yuv, yuvmat[2]; +MOV rgb.a, fragment.color.a; +MOV result.color, rgb; + +END diff --git a/system/shaders/yuv2rgb_bob_gles.glsl b/system/shaders/yuv2rgb_bob_gles.glsl new file mode 100644 index 00000000..ad71ab64 --- /dev/null +++ b/system/shaders/yuv2rgb_bob_gles.glsl @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +precision mediump float; +uniform sampler2D m_sampY; +uniform sampler2D m_sampU; +uniform sampler2D m_sampV; +varying vec2 m_cordY; +varying vec2 m_cordU; +varying vec2 m_cordV; +uniform float m_alpha; +uniform mat4 m_yuvmat; +uniform float m_stepX; +uniform float m_stepY; +uniform int m_field; + +void main() +{ + vec4 yuv, rgb; + + vec2 offsetY; + vec2 offsetU; + vec2 offsetV; + float temp1 = mod(m_cordY.y, 2*m_stepY); + + offsetY = m_cordY; + offsetU = m_cordU; + offsetV = m_cordV; + + offsetY.y -= (temp1 - m_stepY/2 + float(m_field)*m_stepY); + offsetU.y -= (temp1 - m_stepY/2 + float(m_field)*m_stepY)/2; + offsetV.y -= (temp1 - m_stepY/2 + float(m_field)*m_stepY)/2; + + yuv.rgba = vec4(texture2D(m_sampY, offsetY).r, texture2D(m_sampU, offsetU).r, texture2D(m_sampV, offsetV).r, 1.0); + rgb = m_yuvmat * yuv; + rgb.a = m_alpha; + gl_FragColor = rgb; +} diff --git a/system/shaders/yuv2rgb_pixelGL.glsl b/system/shaders/yuv2rgb_pixelGL.glsl new file mode 100644 index 00000000..d6b7f25a --- /dev/null +++ b/system/shaders/yuv2rgb_pixelGL.glsl @@ -0,0 +1,23 @@ +precision mediump float; +uniform sampler2D m_sampY; +uniform sampler2D m_sampU; +uniform sampler2D m_sampV; + +varying vec2 m_cordY; +varying vec2 m_cordU; +varying vec2 m_cordV; + +uniform mat4 m_yuvmat; + +void main() +{ + vec4 yuv, rgb; + yuv.rgba = vec4( texture2D(m_sampY, m_cordY).r + , texture2D(m_sampU, m_cordU).r + , texture2D(m_sampV, m_cordV).r + , 1.0 ); + + rgb = m_yuvmat * yuv; + rgb.a = 1.0; + gl_FragColor = rgb; +} diff --git a/system/shaders/yuv2rgb_vertexGL.glsl b/system/shaders/yuv2rgb_vertexGL.glsl new file mode 100644 index 00000000..be59cc9b --- /dev/null +++ b/system/shaders/yuv2rgb_vertexGL.glsl @@ -0,0 +1,20 @@ +uniform mat4 u_mat; + +varying vec2 m_cordY; +varying vec2 m_cordU; +varying vec2 m_cordV; + +attribute vec2 a_texCoordY; +attribute vec2 a_texCoordU; +attribute vec2 a_texCoordV; + +attribute vec3 a_vertex; + +void main() +{ + m_cordY = a_texCoordY; + m_cordU = a_texCoordU; + m_cordV = a_texCoordV; + + gl_Position = u_mat * vec4(a_vertex,1.0); +} \ No newline at end of file diff --git a/system/shaders/yuv2rgb_vertex_gles.glsl b/system/shaders/yuv2rgb_vertex_gles.glsl new file mode 100644 index 00000000..f70e1895 --- /dev/null +++ b/system/shaders/yuv2rgb_vertex_gles.glsl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +attribute vec4 m_attrpos; +attribute vec2 m_attrcordY; +attribute vec2 m_attrcordU; +attribute vec2 m_attrcordV; +varying vec2 m_cordY; +varying vec2 m_cordU; +varying vec2 m_cordV; +uniform mat4 m_proj; +uniform mat4 m_model; + +void main () +{ + mat4 mvp = m_proj * m_model; + gl_Position = mvp * m_attrpos; + m_cordY = m_attrcordY; + m_cordU = m_attrcordU; + m_cordV = m_attrcordV; +} diff --git a/system/timezones.txt b/system/timezones.txt new file mode 100644 index 00000000..91c13393 --- /dev/null +++ b/system/timezones.txt @@ -0,0 +1,333 @@ +AD,Andorra,Europe/Andorra +AE,Dubai,Asia/Dubai +AF,Kabul,Asia/Kabul +AG,Antigua,America/Antigua +AI,Anguilla,America/Anguilla +AL,Tirane,Europe/Tirane +AM,Yerevan,Asia/Yerevan +AN,Curacao,America/Curacao +AO,Luanda,Africa/Luanda +AR,Buenos_Aires,America/Argentina/Buenos_Aires +AR,Catamarca,America/Argentina/Catamarca +AR,Cordoba,America/Argentina/Cordoba +AR,Jujuy,America/Argentina/Jujuy +AR,La_Rioja,America/Argentina/La_Rioja +AR,Mendoza,America/Argentina/Mendoza +AR,Rio_Gallegos,America/Argentina/Rio_Gallegos +AR,Salta,America/Argentina/Salta +AR,San_Juan,America/Argentina/San_Juan +AR,San_Luis,America/Argentina/San_Luis +AR,Tucuman,America/Argentina/Tucuman +AR,Ushuaia,America/Argentina/Ushuaia +AS,Samoa,US/Samoa +AT,Vienna,Europe/Vienna +AU,Canberra,Australia/Canberra +AU,North,Australia/North +AU,NSW,Australia/NSW +AU,Queensland,Australia/Queensland +AU,South,Australia/South +AU,Tasmania,Australia/Tasmania +AU,Victoria,Australia/Victoria +AU,West,Australia/West +AW,uba,America/Aruba +AX,Mariehamn,Europe/Mariehamn +AZ,Baku,Asia/Baku +BA,Sarajevo,Europe/Sarajevo +BB,Barbados,America/Barbados +BD,Dhaka,Asia/Dhaka +BE,Brussels,Europe/Brussels +BF,Ouagadougou,Africa/Ouagadougou +BG,Sofia,Europe/Sofia +BH,Bahrain,Asia/Bahrain +BI,Bujumbura,Africa/Bujumbura +BJ,Porto-Novo,Africa/Porto-Novo +BL,St_Barthelemy,America/St_Barthelemy +BM,Bermuda,Atlantic/Bermuda +BN,Brunei,Asia/Brunei +BO,La_Paz,America/La_Paz +BR,Araguaina,America/Araguaina +BR,Bahia,America/Bahia +BR,Belem,America/Belem +BR,Boa_Vista,America/Boa_Vista +BR,Campo_Grande,America/Campo_Grande +BR,Cuiaba,America/Cuiaba +BR,Fortaleza,America/Fortaleza +BR,Maceio,America/Maceio +BR,Manaus,America/Manaus +BR,Porto_Velho,America/Porto_Velho +BR,Recife,America/Recife +BR,Rio_Branco,America/Rio_Branco +BR,Sao_Paulo,America/Sao_Paulo +BS,Nassau,America/Nassau +BT,Thimphu,Asia/Thimphu +BW,Gaborone,Africa/Gaborone +BY,Minsk,Europe/Minsk +BZ,Belize,America/Belize +CA,Edmonton,America/Edmonton +CA,Halifax,America/Halifax +CA,Montreal,America/Montreal +CA,Rainy_River,America/Rainy_River +CA,Rankin_Inlet,America/Rankin_Inlet +CA,Regina,America/Regina +CA,St_Johns,America/St_Johns +CA,Vancouver,America/Vancouver +CA,Whitehorse,America/Whitehorse +CA,Winnipeg,America/Winnipeg +CA,Yellowknife,America/Yellowknife +CC,Cocos,Indian/Cocos +CD,Kinshasa,Africa/Kinshasa +CD,Lubumbashi,Africa/Lubumbashi +CF,Bangui,Africa/Bangui +CG,Brazzaville,Africa/Brazzaville +CH,Zurich,Europe/Zurich +CI,Abidjan,Africa/Abidjan +CK,Rarotonga,Pacific/Rarotonga +CL,Continental,Chile/Continental +CM,Lagos,Africa/Lagos +CN,Chongqing,Asia/Chongqing +CN,Harbin,Asia/Harbin +CN,Shanghai,Asia/Shanghai +CN,Urumqi,Asia/Urumqi +CO,Bogota,America/Bogota +CR,Costa_Rica,America/Costa_Rica +CU,Havana,America/Havana +CV,Cape_Verde,Atlantic/Cape_Verde +CX,Christmas,Indian/Christmas +CY,Nicosia,Asia/Nicosia +CZ,Prague,Europe/Prague +DE,Berlin,Europe/Berlin +DJ,Djibouti,Africa/Djibouti +DK,Copenhagen,Europe/Copenhagen +DM,Dominica,America/Dominica +DO,Santo_Domingo,America/Santo_Domingo +DZ,Algiers,Africa/Algiers +EC,Guayaquil,America/Guayaquil +EC,Galapagos,Pacific/Galapagos +EE,Tallinn,Europe/Tallinn +EG,Cairo,Africa/Cairo +EH,El_Aaiun,Africa/El_Aaiun +ER,Asmera,Africa/Asmera +ES,Ceuta,Africa/Ceuta +ES,Canary,Atlantic/Canary +ES,Madrid,Europe/Madrid +ET,Addis_Ababa,Africa/Addis_Ababa +FI,Helsinki,Europe/Helsinki +FJ,Fiji,Pacific/Fiji +FK,Stanley,Atlantic/Stanley +FO,Faeroe,Atlantic/Faeroe +FR,Paris,Europe/Paris +FX,Paris,Europe/Paris +GA,Libreville,Africa/Libreville +GB,London,Europe/London +GD,Grenada,America/Grenada +GE,Tbilisi,Asia/Tbilisi +GF,Cayenne,America/Cayenne +GG,Guernsey,Europe/Guernsey +GH,Accra,Africa/Accra +GI,Gibraltar,Europe/Gibraltar +GL,Godthab,America/Godthab +GL,Thule,America/Thule +GM,Banjul,Africa/Banjul +GN,Conakry,Africa/Conakry +GP,Guadeloupe,America/Guadeloupe +GQ,Malabo,Africa/Malabo +GR,Athens,Europe/Athens +GS,South_Georgia,Atlantic/South_Georgia +GT,Guatemala,America/Guatemala +GU,Guam,Pacific/Guam +GW,Bissau,Africa/Bissau +GY,Guyana,America/Guyana +HK,Hong_Kong,Asia/Hong_Kong +HN,Tegucigalpa,America/Tegucigalpa +HR,Zagreb,Europe/Zagreb +HT,Port-au-Prince,America/Port-au-Prince +HU,Budapest,Europe/Budapest +ID,Jakarta,Asia/Jakarta +ID,Jayapura,Asia/Jayapura +ID,Makassar,Asia/Makassar +ID,Pontianak,Asia/Pontianak +IE,Dublin,Europe/Dublin +IL,Jerusalem,Asia/Jerusalem +IM,Isle_of_Man,Europe/Isle_of_Man +IN,Calcutta,Asia/Calcutta +IO,Chagos,Indian/Chagos +IQ,Baghdad,Asia/Baghdad +IR,Tehran,Asia/Tehran +IS,Reykjavik,Atlantic/Reykjavik +IT,Rome,Europe/Rome +JE,Jersey,Europe/Jersey +JM,Jamaica,America/Jamaica +JO,Amman,Asia/Amman +JP,Tokyo,Asia/Tokyo +KE,Nairobi,Africa/Nairobi +KG,Bishkek,Asia/Bishkek +KH,Phnom_Penh,Asia/Phnom_Penh +KI,Tarawa,Pacific/Tarawa +KM,Comoro,Indian/Comoro +KN,St_Kitts,America/St_Kitts +KP,Pyongyang,Asia/Pyongyang +KR,Seoul,Asia/Seoul +KW,Kuwait,Asia/Kuwait +KY,Cayman,America/Cayman +KZ,Almaty,Asia/Almaty +KZ,Aqtau,Asia/Aqtau +KZ,Aqtobe,Asia/Aqtobe +KZ,Oral,Asia/Oral +KZ,Qyzylorda,Asia/Qyzylorda +LA,Vientiane,Asia/Vientiane +LB,Beirut,Asia/Beirut +LC,St_Lucia,America/St_Lucia +LI,Vaduz,Europe/Vaduz +LK,Colombo,Asia/Colombo +LR,Monrovia,Africa/Monrovia +LS,Maseru,Africa/Maseru +LT,Vilnius,Europe/Vilnius +LU,Luxembourg,Europe/Luxembourg +LV,Riga,Europe/Riga +LY,Tripoli,Africa/Tripoli +MA,Casablanca,Africa/Casablanca +MC,Monaco,Europe/Monaco +MD,Chisinau,Europe/Chisinau +ME,Podgorica,Europe/Podgorica +MF,Marigot,America/Marigot +MG,Antananarivo,Indian/Antananarivo +MK,Skopje,Europe/Skopje +ML,Bamako,Africa/Bamako +MM,Rangoon,Asia/Rangoon +MN,Choibalsan,Asia/Choibalsan +MO,Macao,Asia/Macao +MP,Saipan,Pacific/Saipan +MQ,Martinique,America/Martinique +MR,Nouakchott,Africa/Nouakchott +MS,Montserrat,America/Montserrat +MT,Malta,Europe/Malta +MU,Mauritius,Indian/Mauritius +MV,Maldives,Indian/Maldives +MW,Blantyre,Africa/Blantyre +MX,Cancun,America/Cancun +MX,Chihuahua,America/Chihuahua +MX,Hermosillo,America/Hermosillo +MX,Mazatlan,America/Mazatlan +MX,Merida,America/Merida +MX,Mexico_City,America/Mexico_City +MX,Monterrey,America/Monterrey +MX,Tijuana,America/Tijuana +MY,Kuala_Lumpur,Asia/Kuala_Lumpur +MY,Kuching,Asia/Kuching +MZ,Maputo,Africa/Maputo +NA,Windhoek,Africa/Windhoek +NC,Noumea,Pacific/Noumea +NE,Niamey,Africa/Niamey +NF,Norfolk,Pacific/Norfolk +NG,Lagos,Africa/Lagos +NI,Managua,America/Managua +NL,Amsterdam,Europe/Amsterdam +NO,Oslo,Europe/Oslo +NP,Katmandu,Asia/Katmandu +NR,Nauru,Pacific/Nauru +NU,Niue,Pacific/Niue +NZ,Auckland,Pacific/Auckland +NZ,Chatham,Pacific/Chatham +OM,Muscat,Asia/Muscat +PA,Panama,America/Panama +PE,Lima,America/Lima +PF,Marquesas,Pacific/Marquesas +PG,Port_Moresby,Pacific/Port_Moresby +PH,Manila,Asia/Manila +PK,Karachi,Asia/Karachi +PL,Warsaw,Europe/Warsaw +PM,Miquelon,America/Miquelon +PN,Pitcairn,Pacific/Pitcairn +PR,Puerto_Rico,America/Puerto_Rico +PS,Gaza,Asia/Gaza +PT,Madeira,Atlantic/Madeira +PT,Lisbon,Europe/Lisbon +PW,Palau,Pacific/Palau +PY,Asuncion,America/Asuncion +QA,Qatar,Asia/Qatar +RE,Reunion,Indian/Reunion +RO,Bucharest,Europe/Bucharest +RS,Belgrade,Europe/Belgrade +RU,Anadyr,Asia/Anadyr +RU,Irkutsk,Asia/Irkutsk +RU,Kamchatka,Asia/Kamchatka +RU,Krasnoyarsk,Asia/Krasnoyarsk +RU,Magadan,Asia/Magadan +RU,Novokuznetsk,Asia/Novokuznetsk +RU,Novosibirsk,Asia/Novosibirsk +RU,Omsk,Asia/Omsk +RU,Sakhalin,Asia/Sakhalin +RU,Vladivostok,Asia/Vladivostok +RU,Yakutsk,Asia/Yakutsk +RU,Yekaterinburg,Asia/Yekaterinburg +RU,Kaliningrad,Europe/Kaliningrad +RU,Moscow,Europe/Moscow +RU,Samara,Europe/Samara +RU,Volgograd,Europe/Volgograd +RW,Kigali,Africa/Kigali +SA,Riyadh,Asia/Riyadh +SB,Guadalcanal,Pacific/Guadalcanal +SC,Mahe,Indian/Mahe +SD,Khartoum,Africa/Khartoum +SE,Stockholm,Europe/Stockholm +SG,Singapore,Asia/Singapore +SH,St_Helena,Atlantic/St_Helena +SI,Ljubljana,Europe/Ljubljana +SJ,Longyearbyen,Arctic/Longyearbyen +SK,Bratislava,Europe/Bratislava +SL,Freetown,Africa/Freetown +SM,San_Marino,Europe/San_Marino +SN,Dakar,Africa/Dakar +SO,Mogadishu,Africa/Mogadishu +SR,Paramaribo,America/Paramaribo +ST,Sao_Tome,Africa/Sao_Tome +SV,El_Salvador,America/El_Salvador +SY,Damascus,Asia/Damascus +SZ,Mbabane,Africa/Mbabane +TC,Grand_Turk,America/Grand_Turk +TD,Ndjamena,Africa/Ndjamena +TF,Kerguelen,Indian/Kerguelen +TG,Lome,Africa/Lome +TH,Bangkok,Asia/Bangkok +TJ,Dushanbe,Asia/Dushanbe +TK,Fakaofo,Pacific/Fakaofo +TL,Dili,Asia/Dili +TM,Ashgabat,Asia/Ashgabat +TN,Tunis,Africa/Tunis +TO,Tongatapu,Pacific/Tongatapu +TR,Istanbul,Asia/Istanbul +TT,Port_of_Spain,America/Port_of_Spain +TV,Funafuti,Pacific/Funafuti +TW,Taipei,Asia/Taipei +TZ,Dar_es_Salaam,Africa/Dar_es_Salaam +UA,Kiev,Europe/Kiev +UA,Simferopol,Europe/Simferopol +UA,Uzhgorod,Europe/Uzhgorod +UA,Zaporozhye,Europe/Zaporozhye +UG,Kampala,Africa/Kampala +US,Anchorage,America/Anchorage +US,Chicago,America/Chicago +US,Denver,America/Denver +US,Honolulu,Pacific/Honolulu +US,Indianapolis,America/Indianapolis +US,Los_Angeles,America/Los_Angeles +US,New_York,America/New_York +US,Phoenix,America/Phoenix +UY,Montevideo,America/Montevideo +UZ,Samarkand,Asia/Samarkand +UZ,Tashkent,Asia/Tashkent +VA,Vatican,Europe/Vatican +VC,St_Vincent,America/St_Vincent +VE,Caracas,America/Caracas +VG,Tortola,America/Tortola +VI,St_Thomas,America/St_Thomas +VN,Phnom_Penh,Asia/Phnom_Penh +VU,Efate,Pacific/Efate +WF,Wallis,Pacific/Wallis +WS,Samoa,Pacific/Samoa +YE,Aden,Asia/Aden +YT,Mayotte,Indian/Mayotte +YU,Belgrade,Europe/Belgrade +ZA,Johannesburg,Africa/Johannesburg +ZM,Lusaka,Africa/Lusaka +ZW,Harare,Africa/Harare diff --git a/system/wpmkpub.pem b/system/wpmkpub.pem new file mode 100644 index 00000000..44e43ecf --- /dev/null +++ b/system/wpmkpub.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8fcXWDXW5YJZk1IQW9mu +P5quhUcK9pnD3rgPYucaCQaWiskD4bCfWL0hyk+vwfDT32iyB29ylcv+/PsmKYE+ +GP2L6LMcluB0BDjBTvhdyvWetMnBEA0sCA8RpKRartn5+DVmVKVISpsvxnebFOaF +/R407i1uVMKx7SAqIwQC7/OTjBI+HDxI+zQ1ZWGjxOyzF1WuNLS6eeimltozcUBU +yLIfMpkemANIAwd+ZoenVnc4/Cw4GKrD/jeiE+6EfIFy9ozL3prFW5ASx44Mj1ra +/u2A6PEITjqcF0agUMZcrD975YXnDKJhDkRi4MRENVSUCyu3+k1XYkGMFB2e7/01 +hQIDAQAB +-----END PUBLIC KEY----- diff --git a/tools/TexturePacker/Makefile.host64 b/tools/TexturePacker/Makefile.host64 new file mode 100644 index 00000000..22021bc4 --- /dev/null +++ b/tools/TexturePacker/Makefile.host64 @@ -0,0 +1,20 @@ +INCLUDES =-I../../xbmc/utils -I../../guilib -I../../xbmc/linux -I../../xbmc/lib/libsquish -I./PVRTexLib/ +DEFINES = -D_LINUX + +OBJS = \ + SDL_anigif.o \ + XBTFWriter.o \ + XBMCTex.o \ + XBTF.o + +TARGET = TexturePacker +CLEAN_FILES=$(TARGET) + +$(TARGET) : $(OBJS) + g++ -o $(TARGET) $(OBJS) libsquish-i686_x64-linux.a -llzo2 -lSDL -lSDL_image PVRTexLib/Linux/libPVRTexLib.a + +.cpp.o: + g++ -c $(DEFINES) $(INCLUDES) $< -o $@ -g + +clean: + rm -f $(TARGET) $(OBJS) diff --git a/tools/TexturePacker/Makefile.host_osx b/tools/TexturePacker/Makefile.host_osx new file mode 100644 index 00000000..e5406b80 --- /dev/null +++ b/tools/TexturePacker/Makefile.host_osx @@ -0,0 +1,23 @@ +INCLUDES =-I../../xbmc/utils -I../../guilib -I../../xbmc/linux -I../../xbmc/lib/libsquish -I/opt/local/include +DEFINES = -D_LINUX + +OBJS = \ + SDL_anigif.o \ + XBTFWriter.o \ + XBMCTex.o \ + XBTF.o + +TARGET = TexturePacker +CLEAN_FILES=$(TARGET) + +$(TARGET) : $(OBJS) + g++ -o $(TARGET) $(OBJS) ../../xbmc/lib/libsquish/libsquish-x86-osx.a -llzo2 -lSDL -lSDL_image -L/opt/local/lib + +.cpp.o: + g++ -c $(DEFINES) $(INCLUDES) $< -o $@ -g + +.c.o: + gcc -c $(DEFINES) $(INCLUDES) $< -o $@ -g + +clean: + rm -f $(TARGET) $(OBJS) diff --git a/tools/TexturePacker/PVRTexLib/CPVRTexture.h b/tools/TexturePacker/PVRTexLib/CPVRTexture.h new file mode 100644 index 00000000..68b32dfa --- /dev/null +++ b/tools/TexturePacker/PVRTexLib/CPVRTexture.h @@ -0,0 +1,205 @@ +/****************************************************************************** + + @File CPVRTexture.h + + @Title Console Log + +@Version + + @Copyright Copyright (C) Imagination Technologies Limited. All Rights Reserved. Strictly Confidential. + + @Platform ANSI + + @Description Class that holds data and descriptive information for PVR textures. + +******************************************************************************/ +#ifndef CPVRTEXTURE_H +#define CPVRTEXTURE_H + +#include "CPVRTextureHeader.h" +#include "CPVRTextureData.h" + +namespace pvrtexlib +{ + +#ifdef __APPLE__ + /* The classes below are exported */ +#pragma GCC visibility push(default) +#endif + +class PVR_DLL CPVRTexture +{ +public: + /******************************************************************************* + * Function Name : CPVRTexture Constructors + * Description : default + * from CPVRTextureHeader but no data + * from CPVRTextureHeader/CPVRTextureData pair + * from Header with blank data + * create Header for raw data + * from file + * from PVR data with embedded header (contents of PVR file) + *******************************************************************************/ + CPVRTexture(); // default constructor + CPVRTexture(CPVRTextureHeader& sHeader); // from CPVRTextureHeader but no data + CPVRTexture(CPVRTextureHeader& sHeader, // from CPVRTextureHeader/CPVRTextureData pair + CPVRTextureData& sData); + CPVRTexture(const unsigned int u32Width, // create header info with no data + const unsigned int u32Height, + const unsigned int u32MipMapCount, + const unsigned int u32NumSurfaces, + const bool bBorder, + const bool bTwiddled, + const bool bCubeMap, + const bool bVolume, + const bool bFalseMips, + const bool bAlpha, + const bool bFlipped, + const PixelType ePixelType, + const float fNormalMap); + CPVRTexture(const unsigned int u32Width, // create header info for raw data + const unsigned int u32Height, + const unsigned int u32MipMapCount, + const unsigned int u32NumSurfaces, + const bool bBorder, + const bool bTwiddled, + const bool bCubeMap, + const bool bVolume, + const bool bFalseMips, + const bool bAlpha, + const bool bFlipped, + const PixelType ePixelType, + const float fNormalMap, + uint8 *pPixelData); + CPVRTexture(const char* const pszFilename); // from .pvr, .dds or .ngt file depending on extension passed + CPVRTexture(const uint8* const pPVRData); // from PVR data with embedded header (contents of PVR file) + + /******************************************************************************* + * Function Name : getHeader + * Description : returns the CPVRTextureHeader instance from this instance + * note this returns a reference + *******************************************************************************/ + CPVRTextureHeader& getHeader(); + /******************************************************************************* + * Function Name : getData + * Description : returns the CPVRTextureData instance from this instance + * note this returns a reference + *******************************************************************************/ + CPVRTextureData& getData(); + /******************************************************************************* + * : Accessor functions for header values + * Description : Correspond to the values held in a pvr texture file. + * : PixelType is the actual texture format + * : Width is the width of the top image of the texture + * : Height is the height of the top image of the texture + * : MipMapCount is the number of MIP-maps present: 0 = top level + *******************************************************************************/ + void setData(uint8* pData); + PixelType getPixelType(); + void setPixelType(PixelType ePixelType); + unsigned int getPrecMode() const; + unsigned int getWidth() const; + void setWidth(unsigned int u32Width); + unsigned int getHeight() const; + void setHeight(unsigned int u32Height); + unsigned int getMipMapCount() const; + void setMipMapCount(unsigned int u32MipMapCount); + bool hasMips() const; + unsigned int getNumSurfaces() const; + void setNumSurfaces(unsigned int u32NumSurfaces); + + /******************************************************************************* + * : Accessor functions for flag values + * Description : Border: a border around the texture + * in order to avoid artifacts. See the PVRTC document for more info + * Twiddled: Morton order for the texture + * CubeMap: does the texture constitute 6 surfaces facing a cube + * Volume: is this a volume texture + * NormalMap: a value of 0.0f indicates not a Normal map texture + * a non-zero value is taken as the height factor + * when calculating the normal vectors + * FalseMips: artificially coloured MIP-map levels + *******************************************************************************/ + bool isBordered() const; + void setBorder(bool bBorder); + bool isTwiddled() const; + void setTwiddled(bool bTwiddled); + bool isCubeMap() const; + void setCubeMap(bool bCubeMap); + bool isVolume() const; + void setVolume(const bool bVolume); + float getNormalMap() const; + void setNormalMap(const float fNormalMap); + bool isNormalMap() const; + bool hasFalseMips() const; + void setFalseMips(const bool bFalseMips); + bool hasAlpha() const; + void setAlpha(const bool bAlpha); + bool isFlipped() const; + void setFlipped(const bool bFlipped); + + /******************************************************************************* + * Function Name : convertToPrecMode + * Description : Converts the data to float/uint16/uint8 from uint8/uint16/float + * expanding/contracting the buffer. + * If the data is not uint8/uint16/float PVRTHROWs + *******************************************************************************/ + void convertToPrecMode(const E_PRECMODE ePrecMode); + /******************************************************************************* + * Function Name : SwapChannels + * Description : Swaps the two specified channels. + * If the data is not uint8/uint16/float PVRTHROWs + *******************************************************************************/ + void SwapChannels(const E_COLOUR_CHANNEL e32ChannelA, const E_COLOUR_CHANNEL e32ChannelB); + /******************************************************************************* + * Function Name : getSurfaceData + * Description : Returns a pointer to the surface specified, NULL if it doesn't exist + *******************************************************************************/ + uint8* getSurfaceData(unsigned int u32SurfaceNum); + /******************************************************************************* + * Function Name : Append + * Description : Appends a texture to the current one if possible. If the current + * texture has no surfaces then acts like a copy assignment + *******************************************************************************/ + void append(CPVRTexture& sTexture); + /******************************************************************************* + * Function Name : RGBToAlpha + * Description : Adds alpha to a texture from the RGB data of the other texture + *******************************************************************************/ + void RGBToAlpha( CPVRTexture& sAlphaTexture, + const unsigned int u32DestSurfaceNum = 0, + const unsigned int u32SourceSurfaceNum = 0 ); + + /******************************************************************************* + * Function Name : writeToFile + * Description : writes to a file as a .pvr or .dds depending on the extension + * of the file path passed. + *******************************************************************************/ + size_t writeToFile(const char* const strFilename, + const unsigned int u32TextureVersion = CPVRTextureHeader::u32CURRENT_VERSION)const ; + + /******************************************************************************* + * Function Name : writeIncludeFile32Bits + * Description : writes to a C++ compatible header file (u32TextureVersion is currently unimplemented) + *******************************************************************************/ + size_t writeIncludeFile32Bits(const char* const pszFilename, + const char* const pszVarName, + const unsigned int u32TextureVersion = CPVRTextureHeader::u32CURRENT_VERSION)const ; + + private: + CPVRTextureHeader m_sHeader; + CPVRTextureData m_sData; + +}; + +#ifdef __APPLE__ +#pragma GCC visibility pop +#endif + + +} +#endif // CPVRTEXTURE_H + +/***************************************************************************** + End of file (PVRTexture.h) +*****************************************************************************/ diff --git a/tools/TexturePacker/PVRTexLib/CPVRTextureData.h b/tools/TexturePacker/PVRTexLib/CPVRTextureData.h new file mode 100644 index 00000000..95973103 --- /dev/null +++ b/tools/TexturePacker/PVRTexLib/CPVRTextureData.h @@ -0,0 +1,192 @@ +/****************************************************************************** + + @File CPVRTextureData.h + + @Title Console Log + +@Version + + @Copyright Copyright (C) Imagination Technologies Limited. All Rights Reserved. Strictly Confidential. + + @Platform ANSI + + @Description Class to hold the data part of a PVR texture. + +******************************************************************************/ +#ifndef CPVRTEXTUREDATA_H +#define CPVRTEXTUREDATA_H + +#include +#include "PVRTexLibGlobals.h" +#include "PVRTGlobal.h" +#include "Pixel.h" + +namespace pvrtexlib +{ + +#ifdef __APPLE__ + /* The classes below are exported */ +#pragma GCC visibility push(default) +#endif + +class PVR_DLL CPVRTextureHeader; + +class PVR_DLL CPVRTextureData +{ +public: + + + // channel enums + enum{ + CHAN_A=0, + CHAN_R, + CHAN_G, + CHAN_B, + CHAN_RGB, + CHAN_ARGB + }; + + + /******************************************************************************* + * Constructor + * Description : Blank constructor that allows the creation of a + * valid but empty CPVRTextureData instance + *******************************************************************************/ + CPVRTextureData(); + /******************************************************************************* + * Constructor + * Description : Constructor that initialises an empty buffer to the size passed + *******************************************************************************/ + CPVRTextureData(size_t stDataSize); + /******************************************************************************* + * Constructor + * Description : Constructor initialised to the data and size of data passed + *******************************************************************************/ + CPVRTextureData(uint8 *pTextureData, size_t stDataSize); + + /******************************************************************************* + * Constructor + * Description : Copy constructor + *******************************************************************************/ + CPVRTextureData(const CPVRTextureData& original); + /******************************************************************************* + * Constructor + * Description : Assignment operator + *******************************************************************************/ + CPVRTextureData& operator=(const CPVRTextureData& sData); + + /******************************************************************************* + * Destructor + *******************************************************************************/ + ~CPVRTextureData(); + + /******************************************************************************* + * Function Name : getData + * In/Outputs : + * Description : returns pointer to the data buffer in this instance + *******************************************************************************/ + uint8* getData() const; + + /******************************************************************************* + * Function Name : getDataSize + * In/Outputs : + * Description : returns the recorded size of the data buffer in this instance + *******************************************************************************/ + size_t getDataSize() const; + + /******************************************************************************* + * Function Name : clear + * In/Outputs : + * Description : releases any data stored and sets size to 0 + *******************************************************************************/ + void clear(); + + /******************************************************************************* + * Function Name : ResizeBuffer + * In/Outputs : stNewSize: new size for the buffer + * Description : Resizes the buffer held by this texture. Copies across + * existing data to the new buffer, truncating it if the new + * buffer is smaller than the last. + *******************************************************************************/ + void resizeBuffer(size_t stNewSize); + /******************************************************************************* + * Function Name : convertToPrecMode + * Description : Converts the data held by the buffer to the new precision + * expanding the buffer. + * If the data is not a standard data type PVRTHROWS + *******************************************************************************/ + void convertToPrecMode(const E_PRECMODE ePrecMode, CPVRTextureHeader& sHeader); + + /******************************************************************************* + * Function Name : WriteToFile + * Description : Writes the data in this instance to the passed file. Returns + * the number of bytes written. + *******************************************************************************/ + size_t writeToFile(FILE* const fFile)const; + /******************************************************************************* + * Function Name : writeToIncludeFile + * Description : Writes the data in this instance to the passed file as a series + * of unsigned integers compatible with a C++ header. Returns + * the number of bytes written. + *******************************************************************************/ + size_t writeToIncludeFile(FILE* const fFile)const; + /******************************************************************************* + * Function Name : append + * Description : will append the data from newData to the existing data in this + * CPVRTextureData instance. It may be wise to check if the + * pixel types of these two instances match. PVRTHROWs if + * unsuccessful. + *******************************************************************************/ + void append(const CPVRTextureData& newData); + + /******************************************************************************* + * Function Name : RGBToAlpha + * Description : Dumps the maximum value of the RGB values in the current data + into the alpha channel. Leaves the other channels untouched. + Needs uint8 or PVRTHROWs + *******************************************************************************/ + void maxRGBToAlpha( const unsigned int u32SurfaceNum, + const CPVRTextureHeader& psInputHeader, + const CPVRTextureData& sAlphaData); + + /******************************************************************************* + * Function Name : SwapChannels + * Description : Swaps the two specified channels. + * Data should be in a standard format + *******************************************************************************/ + template + void SwapChannels(const E_COLOUR_CHANNEL eChannelA, const E_COLOUR_CHANNEL eChannelB) + { + Pixel* pixelData = (Pixel*)m_pData; + unsigned int numPixels = m_stDataSize/(4*sizeof(tType)); + for(unsigned int i=0 ; i < numPixels ;++i) + { + PVRTswap((*pixelData)[eChannelA],(*pixelData)[eChannelB]); + ++pixelData; + } + } + + /******************************************************************************* + * Function Name : ClearChannel + * Description : Clears the specified channel to white + *******************************************************************************/ + void ClearChannel(const CPVRTextureHeader& sHeader,const unsigned int u32Channel); + + private: + uint8 *m_pData; // pointer to image data + size_t m_stDataSize; // size of data in bytes + +}; + +#ifdef __APPLE__ +#pragma GCC visibility pop +#endif + +} + +#endif // CPVRTEXTUREDATA_H + +/***************************************************************************** + End of file (CPVRTextureData.h) +*****************************************************************************/ + diff --git a/tools/TexturePacker/PVRTexLib/CPVRTextureHeader.h b/tools/TexturePacker/PVRTexLib/CPVRTextureHeader.h new file mode 100644 index 00000000..83209e3d --- /dev/null +++ b/tools/TexturePacker/PVRTexLib/CPVRTextureHeader.h @@ -0,0 +1,244 @@ +/****************************************************************************** + + @File CPVRTextureHeader.h + + @Title Console Log + +@Version + + @Copyright Copyright (C) Imagination Technologies Limited. All Rights Reserved. Strictly Confidential. + + @Platform ANSI + + @Description Class to represent header information of a pvr texture file. + Typically associated with a CPVRTextureData instance or part of a + CPVRTexture instance + +******************************************************************************/ +#ifndef CPVRTEXTUREHEADER_H +#define CPVRTEXTUREHEADER_H + +#include +#include "PVRTexLibGlobals.h" +struct PVR_Texture_Header; + +namespace pvrtexlib +{ + +#ifdef __APPLE__ + /* The classes below are exported */ +#pragma GCC visibility push(default) +#endif + +class PVR_DLL PVRTextureUtilities; + +class PVR_DLL CPVRTextureHeader +{ +public: + + /******************************************************************************* + * Constructor + * Description : Blank constructor that allows the creation of a + * valid but blank CPVRHeader + *******************************************************************************/ + CPVRTextureHeader(); + + + /******************************************************************************* + * Constructor + * In + : u32Width : width of topmost image in pixels + : u32Height : height of topmost image + : u32MipMapCount : count of MIP-map levels + : u32NumSurfaces : number of surfaces present in texture + : bBorder : does the texture have an added border (se PVRTC compression documentation) + : bTwiddled : is the texture twiddled (use morton order) + : bCubeMap : is the texture a cube map + : bVolume : is the texture a volume texture (little support right now) + : bFalseMips : are false-coloured MIP-map levels encoded + : ePixelType : which pixel format is used for the data + : fNormalMap : multiplier when used in normal map creation for this texture. + : 0.0f implies that this is not a normal map texture + * Description : Manual constructor that allows the creation of a CPVRHeader + *******************************************************************************/ + CPVRTextureHeader(const unsigned int u32Width, + const unsigned int u32Height, + const unsigned int u32MipMapCount, + const unsigned int u32NumSurfaces, + const bool bBorder, + const bool bTwiddled, + const bool bCubeMap, + const bool bVolume, + const bool bFalseMips, + const bool bAlpha, + const bool bFlipped, + const PixelType ePixelType, + const float fNormalMap); + + /******************************************************************************* + * Constructor + * In + : fFile : open FILE pointer to PVR header data (beginning of a .pvr file) + * Description : Reads a header from the passed FILE pointer leaving this + * at the beginning of any data following the header. + *******************************************************************************/ + CPVRTextureHeader(FILE *const fFile); + /******************************************************************************* + * Constructor + * In + : fFile : pointer to PVR header data (beginning of a .pvr file) + * Description : Reads a header from the passed pointer. + *******************************************************************************/ + CPVRTextureHeader(const uint8* const pPVRData); + + + /******************************************************************************* + * Accessor Methods for basic properties + *******************************************************************************/ + unsigned int getWidth() const; + void setWidth(unsigned int u32Width); + unsigned int getHeight() const; + void setHeight(unsigned int u32Height); + void getDimensions(unsigned int& width, unsigned int& height) const; + void setDimensions(const unsigned int u32Width, const unsigned int u32Height); + unsigned int getMipMapCount() const; + void setMipMapCount(unsigned int u32MipMapCount); + PixelType getPixelType() const; + void setPixelType(const PixelType ePixelType); + unsigned int getNumSurfaces() const; + void setNumSurfaces(unsigned int u32NumSurfaces); + + /******************************************************************************* + * sets to the standard pixel type for the passed prcision mode + *******************************************************************************/ + void setPixelType(const E_PRECMODE ePrecMode); + + /******************************************************************************* + * Accessor Methods for preprocessing properties etc. + *******************************************************************************/ + bool isBordered() const; + void setBorder(bool bBorder); + bool isTwiddled() const; + void setTwiddled(bool bTwiddled); + bool isCubeMap() const; + void setCubeMap(bool bCubeMap); + bool isVolume() const; + void setVolume(const bool bVolume); + float getNormalMap() const; + void setNormalMap(const float fNormalMap); + bool isNormalMap() const; + bool hasMips() const; + bool hasFalseMips() const; + void setFalseMips(const bool bFalseMips); + bool hasAlpha() const; + void setAlpha(const bool bAlpha); + void setFlipped(const bool bFlipped); + bool isFlipped() const; + + + /******************************************************************************* + * Other Accessor Methods + *******************************************************************************/ + unsigned int getOriginalVersionNumber(); // only relevant for files loaded from disk + unsigned int getCurrentVersionNumber(); + /******************************************************************************* + * Function Name : getSurfaceSize + * Returns : size of an individual surface (including MIP-map levels) + * described by the header in bytes + *******************************************************************************/ + size_t getSurfaceSize() const; + /******************************************************************************* + * Function Name : getSurfaceSizeInPixels + * Returns : the number of pixels described by a surface in this texture + *******************************************************************************/ + unsigned int getSurfaceSizeInPixels() const; + /******************************************************************************* + * Function Name : getTotalTextureSize + * Returns : sum of the size of all individual surfaces (including MIP-map + * levels) described by the header + *******************************************************************************/ + size_t getTotalTextureSize() const; + /******************************************************************************* + * Function Name : getFileHeaderSize + * Returns : returns file size from original header version + *******************************************************************************/ + size_t getFileHeaderSize(); + /******************************************************************************* + * Function Name : getFileHeaderSize + * Returns : returns file size from passed header version (if possible) + * otherwise PVRTHROWs + *******************************************************************************/ + size_t getFileHeaderSize(int u32HeaderVersion); + /******************************************************************************* + * Function Name : getPrecMode + * Returns : returns the precision mode of the pixel type of this header + *******************************************************************************/ + E_PRECMODE getPrecMode() const; + /******************************************************************************* + * Function Name : isStandardFormat + * Returns : returns the precision mode of the pixel type of this header + *******************************************************************************/ + bool isStandardPixelType() const; + /******************************************************************************* + * Function Name : getBitsPerPixel + * Returns : returns the number of bits of data per pixel required by the + * pixel type of this header + *******************************************************************************/ + unsigned int getBitsPerPixel() const; + /******************************************************************************* + * Function Name : hasSurfaceCompatibleWith + * Returns : returns whether this header describes a texture with surfaces + that are compatible for appending etc with the ones described + in the passed header. + *******************************************************************************/ + bool hasSurfaceCompatibleWith(const CPVRTextureHeader & sHeader); + /******************************************************************************* + * Function Name : writeToFile + * Returns : writes this pvr header to the FILE* passed leaving the FILE + pointer at the end of the header data. Returns the size + of data written + *******************************************************************************/ + size_t writeToFile(FILE* const fFile)const; + /******************************************************************************* + * Function Name : writeToPointer + * Returns : writes this pvr header to the pointer passed. Returns the size + of the data written + *******************************************************************************/ + size_t writeToPointer(uint8 * const pPointer)const; + /******************************************************************************* + * Function Name : writeToIncludeFile + * Returns : writes this pvr header to the FILE* passed leaving the FILE + pointer at the end of the header data. Writes this as the + beginning of a c++ compatible header file. Returns the size + of data written + *******************************************************************************/ + size_t writeToIncludeFile(FILE* const fFile)const; + + const static unsigned int u32CURRENT_VERSION = 2; // currentlt v2 of .pvr files is used + +private: + PVRTextureUtilities *PVRTU; // note this is a singleton + unsigned int m_u32Height, m_u32Width, m_u32MipMapCount,m_u32NumSurfaces; + unsigned int m_u32OriginalVersionNumber; // the file header version on the disk from which this class was constructed + bool m_bTwiddled, m_bCubeMap, m_bVolume, m_bFalseMips, m_bBorder, m_bAlpha, m_bFlipped; + PixelType m_ePixelType; + float m_fNormalMap; + + void InitBlank(); + void InitFromPointer(const uint8* const pData); + + void DoBitMasks(PVR_Texture_Header *phPVR, bool bAlpha) const; + +}; + +#ifdef __APPLE__ +#pragma GCC visibility pop +#endif + +} + +#endif // CPVRTEXTUREHEADER_H + +/***************************************************************************** + End of file (PVRTexture.h) +*****************************************************************************/ diff --git a/tools/TexturePacker/PVRTexLib/Documentation/PVRTC Texture Compression.Usage Guide.1.4f.External.pdf b/tools/TexturePacker/PVRTexLib/Documentation/PVRTC Texture Compression.Usage Guide.1.4f.External.pdf new file mode 100755 index 00000000..bd132ee8 Binary files /dev/null and b/tools/TexturePacker/PVRTexLib/Documentation/PVRTC Texture Compression.Usage Guide.1.4f.External.pdf differ diff --git a/tools/TexturePacker/PVRTexLib/Documentation/PVRTexLib.User Manual.1.7f.External.pdf b/tools/TexturePacker/PVRTexLib/Documentation/PVRTexLib.User Manual.1.7f.External.pdf new file mode 100755 index 00000000..586fc86c Binary files /dev/null and b/tools/TexturePacker/PVRTexLib/Documentation/PVRTexLib.User Manual.1.7f.External.pdf differ diff --git a/tools/TexturePacker/PVRTexLib/Linux/libPVRTexLib.a b/tools/TexturePacker/PVRTexLib/Linux/libPVRTexLib.a new file mode 100755 index 00000000..357b7e00 Binary files /dev/null and b/tools/TexturePacker/PVRTexLib/Linux/libPVRTexLib.a differ diff --git a/tools/TexturePacker/PVRTexLib/MacOS/libPVRTexLib.a b/tools/TexturePacker/PVRTexLib/MacOS/libPVRTexLib.a new file mode 100755 index 00000000..5bb59a35 Binary files /dev/null and b/tools/TexturePacker/PVRTexLib/MacOS/libPVRTexLib.a differ diff --git a/tools/TexturePacker/PVRTexLib/PVRException.h b/tools/TexturePacker/PVRTexLib/PVRException.h new file mode 100644 index 00000000..b42e25a4 --- /dev/null +++ b/tools/TexturePacker/PVRTexLib/PVRException.h @@ -0,0 +1,54 @@ +/****************************************************************************** + + @File PVRException.h + + @Title + +@Version + + @Copyright Copyright (C) Imagination Technologies Limited. All Rights Reserved. Strictly Confidential. + + @Platform ANSI + + @Description Exception class and macros. + +******************************************************************************/ +#ifndef _PVREXCEPTION_H_ +#define _PVREXCEPTION_H_ + +#ifndef PVR_DLL +#ifdef _WINDLL_EXPORT +#define PVR_DLL __declspec(dllexport) +#elif _WINDLL_IMPORT +#define PVR_DLL __declspec(dllimport) +#else +#define PVR_DLL +#endif +#endif + +/***************************************************************************** +* Exception class and macros +* Use char* literals only for m_what. +*****************************************************************************/ +class PVR_DLL PVRException +{ +public: + PVRException(const char* const what)throw(); + const char * const what() const; + ~PVRException() throw(); +private: + const char* const m_what; +}; + +#define PVRTRY try +#define PVRLOGTHROW(A) {PVRException myException(A); PVRTextureUtilities::getPointer()->log(A) ; throw(myException);} +#define PVRLOG PVRTextureUtilities::getPointer()->log +#define PVRTHROW(A) {PVRException myException(A); throw(myException);} +#define PVRCATCH(A) catch(PVRException& A) +#define PVRCATCHALL catch(...) + +#endif // _PVREXCEPTION_H_ + +/***************************************************************************** +* end of file +******************************************************************************/ diff --git a/tools/TexturePacker/PVRTexLib/PVRTGlobal.h b/tools/TexturePacker/PVRTexLib/PVRTGlobal.h new file mode 100644 index 00000000..e5b7b35e --- /dev/null +++ b/tools/TexturePacker/PVRTexLib/PVRTGlobal.h @@ -0,0 +1,233 @@ +/****************************************************************************** + + @File PVRTGlobal.h + + @Title PVRTGlobal + +@Version + + @Copyright Copyright (C) Imagination Technologies Limited. All Rights Reserved. Strictly Confidential. + + @Platform ANSI compatible + + @Description Global defines and typedefs for PVRTools + +******************************************************************************/ +#ifndef _PVRTGLOBAL_H_ +#define _PVRTGLOBAL_H_ + +/*!*************************************************************************** + Macros +*****************************************************************************/ +#define PVRT_MIN(a,b) (((a) < (b)) ? (a) : (b)) +#define PVRT_MAX(a,b) (((a) > (b)) ? (a) : (b)) +#define PVRT_CLAMP(x, l, h) (PVRT_MIN((h), PVRT_MAX((x), (l)))) + +#if defined(_WIN32) && !defined(UNDER_CE) && !defined(__SYMBIAN32__) /* Windows desktop */ + #define _CRTDBG_MAP_ALLOC + #include + #include + #include +#endif + +#if defined(UNDER_CE) + #include + +#ifndef _ASSERT + #ifdef _DEBUG + #define _ASSERT(X) { (X) ? 0 : DebugBreak(); } + #else + #define _ASSERT(X) + #endif +#endif + +#ifndef _ASSERTE + #ifdef _DEBUG + #define _ASSERTE _ASSERT + #else + #define _ASSERTE(X) + #endif +#endif + #define _RPT0(a,b) + #define _RPT1(a,b,c) + #define _RPT2(a,b,c,d) + #define _RPT3(a,b,c,d,e) + #define _RPT4(a,b,c,d,e,f) +#else + +#ifdef _WIN32 + +#else +#if defined(__linux__) || defined(__APPLE__) + #define _ASSERT(a)((void)0) + #define _ASSERTE(a)((void)0) + #ifdef _DEBUG + #ifndef _RPT0 + #define _RPT0(a,b) printf(b) + #endif + #ifndef _RPT1 + #define _RPT1(a,b,c) printf(b,c) + #endif + #else + #ifndef _RPT0 + #define _RPT0(a,b)((void)0) + #endif + #ifndef _RPT1 + #define _RPT1(a,b,c)((void)0) + #endif + #endif + #define _RPT2(a,b,c,d)((void)0) + #define _RPT3(a,b,c,d,e)((void)0) + #define _RPT4(a,b,c,d,e,f)((void)0) + #include + #include + #define BYTE unsigned char + #define WORD unsigned short + #define DWORD unsigned long + typedef struct tagRGBQUAD { + BYTE rgbBlue; + BYTE rgbGreen; + BYTE rgbRed; + BYTE rgbReserved; + } RGBQUAD; + #define BOOL int + #define TRUE 1 + #define FALSE 0 +#else + #define _CRT_WARN 0 + #define _RPT0(a,b) + #define _RPT1(a,b,c) + #define _RPT2(a,b,c,d) + #define _RPT3(a,b,c,d,e) + #define _RPT4(a,b,c,d,e,f) + #define _ASSERT(X) + #define _ASSERTE(X) +#endif +#endif +#endif + +#include + +#define FREE(X) { if(X) { free(X); (X) = 0; } } + +// This macro is used to check at compile time that types are of a certain size +// If the size does not equal the expected size, this typedefs an array of size 0 +// which causes a compile error +#define PVRTSIZEASSERT(T, size) typedef int (sizeof_##T)[sizeof(T) == (size)] + + +/**************************************************************************** +** Integer types +****************************************************************************/ + +typedef signed char PVRTint8; +typedef signed short PVRTint16; +typedef signed int PVRTint32; +typedef unsigned char PVRTuint8; +typedef unsigned short PVRTuint16; +typedef unsigned int PVRTuint32; + +#if defined(__int64) || defined(_WIN32) +typedef signed __int64 PVRTint64; +typedef unsigned __int64 PVRTuint64; +#elif defined(TInt64) +typedef TInt64 PVRTint64; +typedef TUInt64 PVRTuint64; +#else +typedef signed long long PVRTint64; +typedef unsigned long long PVRTuint64; +#endif + +PVRTSIZEASSERT(PVRTint8, 1); +PVRTSIZEASSERT(PVRTuint8, 1); +PVRTSIZEASSERT(PVRTint16, 2); +PVRTSIZEASSERT(PVRTuint16, 2); +PVRTSIZEASSERT(PVRTint32, 4); +PVRTSIZEASSERT(PVRTuint32, 4); +PVRTSIZEASSERT(PVRTint64, 8); +PVRTSIZEASSERT(PVRTuint64, 8); + +/**************************************************************************** +** swap template function +****************************************************************************/ +/*!*************************************************************************** + @Function PVRTswap + @Input a Type a + @Input b Type b + @Description A swap template function that swaps a and b +*****************************************************************************/ + +template +inline void PVRTswap(T& a, T& b) +{ + T temp = a; + a = b; + b = temp; +} + +#ifdef _UITRON_ +template void PVRTswap(unsigned char& a, unsigned char& b); +#endif + +/*!*************************************************************************** + @Function PVRTByteSwap + @Input pBytes A number + @Input i32ByteNo Number of bytes in pBytes + @Description Swaps the endianness of pBytes in place +*****************************************************************************/ +inline void PVRTByteSwap(unsigned char* pBytes, int i32ByteNo) +{ + int i = 0, j = i32ByteNo - 1; + + while(i < j) + PVRTswap(pBytes[i++], pBytes[j--]); +} + +/*!*************************************************************************** + @Function PVRTByteSwap32 + @Input ui32Long A number + @Returns ui32Long with its endianness changed + @Description Converts the endianness of an unsigned long +*****************************************************************************/ +inline unsigned long PVRTByteSwap32(unsigned long ui32Long) +{ + return ((ui32Long&0x000000FF)<<24) + ((ui32Long&0x0000FF00)<<8) + ((ui32Long&0x00FF0000)>>8) + ((ui32Long&0xFF000000) >> 24); +} + +/*!*************************************************************************** + @Function PVRTByteSwap16 + @Input ui16Short A number + @Returns ui16Short with its endianness changed + @Description Converts the endianness of a unsigned short +*****************************************************************************/ +inline unsigned short PVRTByteSwap16(unsigned short ui16Short) +{ + return (ui16Short>>8) | (ui16Short<<8); +} + +/*!*************************************************************************** + @Function PVRTIsLittleEndian + @Returns True if the platform the code is ran on is little endian + @Description Returns true if the platform the code is ran on is little endian +*****************************************************************************/ +inline bool PVRTIsLittleEndian() +{ + static bool bLittleEndian; + static bool bIsInit = false; + + if(!bIsInit) + { + short int word = 0x0001; + char *byte = (char*) &word; + bLittleEndian = byte[0] ? true : false; + bIsInit = true; + } + + return bLittleEndian; +} + +#endif // _PVRTGLOBAL_H_ + +/***************************************************************************** + End of file (Tools.h) +*****************************************************************************/ diff --git a/tools/TexturePacker/PVRTexLib/PVRTexLib.h b/tools/TexturePacker/PVRTexLib/PVRTexLib.h new file mode 100644 index 00000000..68770b4d --- /dev/null +++ b/tools/TexturePacker/PVRTexLib/PVRTexLib.h @@ -0,0 +1,152 @@ +/****************************************************************************** + + @File PVRTexLib.h + + @Title Console Log + +@Version Name : etc_conversion.cpp + + @Copyright Copyright (C) Imagination Technologies Limited. All Rights Reserved. Strictly Confidential. + + @Platform ANSI + + @Description Texture processing utility class. This is a singleton do not + instantiate - use getPointer() instead. + +******************************************************************************/ +#ifndef PVRTEXLIB_H +#define PVRTEXLIB_H + +/***************************************************************************** +* Includes +*****************************************************************************/ +#include "PVRTexLibGlobals.h" +#include "PVRException.h" +#include "CPVRTextureData.h" +#include "CPVRTextureHeader.h" +#include "CPVRTexture.h" + +namespace pvrtexlib +{ +#ifdef __APPLE__ + /* The classes below are exported */ +#pragma GCC visibility push(default) +#endif + + class PVR_DLL PVRTextureUtilities + { + + public: + /******************************************************************************* + * Function Name : getPointer + * Returns : Pointer to the PVRTextureUtilities singleton + * Description : The main method of accessing the PVRTextureUtilities class. + *******************************************************************************/ + static PVRTextureUtilities* getPointer(); + + /******************************************************************************* + * Function Name : CompressPVR + * In/Outputs + : sCompressedTexture : Output CPVRTexture + : sDecompressedTexture : Input CPVRTexture needs to be in a standard format + : nMode : Parameter value for specific image compressor - eg ETC + * Description : Takes a CPVRTexture in one of the standard formats + * : and compresses to the pixel type specified in the destination + * : PVRTexture. nMode specifies the quality mode. + *******************************************************************************/ + void CompressPVR( CPVRTexture& sDecompressedTexture, + CPVRTexture& sCompressedTexture, const int nMode=0); + /******************************************************************************* + * Function Name : CompressPVR + * In/Outputs + : sDecompressedHeader : Input CPVRTexture needs to be in a standard format + : sDecompressedData : Input CPVRTexture needs to be in a standard format + : sCompressedHeader : Output CPVRTextureHeader with output format set + : sCompressedData : Output CPVRTextureData + : nMode : Parameter value for specific image compressor - i.e. ETC + * Description : Takes a CPVRTextureHeader/CPVRTextureData pair in one of the + * : standard formats + * : and compresses to the pixel type specified in the destination + * : CPVRTextureHeader, the data goes in the destination CPVRTextureData. + * : nMode specifies the quality mode. + *******************************************************************************/ + void CompressPVR( CPVRTextureHeader &sDecompressedHeader, + CPVRTextureData &sDecompressedData, + CPVRTextureHeader &sCompHeader, + CPVRTextureData &sCompData, + const int nMode=0); + + /******************************************************************************* + * Function Name : DecompressPVR + * In/Outputs + : sCompressedTexture : Input CPVRTexture + : sDecompressedTexture : Output CPVRTexture will be in a standard format + * Description : Takes a CPVRTexture and decompresses it into a + * : standard format. + *******************************************************************************/ + void DecompressPVR(CPVRTexture& sCompressedTexture, + CPVRTexture& sDecompressedTexture, + const int nMode=0); + /******************************************************************************* + * Function Name : DecompressPVR + * In/Outputs + : sCompressedHeader : Input CPVRTextureHeader + : sCompressedData : Input CPVRTextureData + : sDecompressedHeader : Output CPVRTextureHeader will be in a standard format + : sDecompressedData : Output CPVRTextureData will be in a standard format + * Description : Takes a CPVRTextureHeader/Data pair and decompresses it into a + * : standard format. + *******************************************************************************/ + void DecompressPVR( CPVRTextureHeader & sCompressedHeader, + const CPVRTextureData & sCompressedData, + CPVRTextureHeader & sDecompressedHeader, + CPVRTextureData & sDecompressedData, + const int nMode=0); + + /******************************************************************************* + * Function Name : ProcessRawPVR + * In/Outputs + : sInputTexture : Input CPVRTexture needs to be in a standard format + : sOutputTexture : Output CPVRTexture will be in a standard format (not necessarily the same) + * Description : Takes a CPVRTexture and processes it according to the differences in the passed + * : output CPVRTexture and the passed parameters. Requires the input texture + * : to be in a standard format. + *******************************************************************************/ + bool ProcessRawPVR( CPVRTexture& sInputTexture, + CPVRTextureHeader& sProcessHeader, + const bool bDoBleeding=false, + const float fBleedRed=0.0f, + const float fBleedGreen=0.0f, + const float fBleedBlue=0.0f, + E_RESIZE_MODE eResizeMode=eRESIZE_BICUBIC ); + /******************************************************************************* + * Function Name : ProcessRawPVR + * In/Outputs + : sInputTexture : Input CPVRTexture needs to be in a standard format. + : sOutputTexture : Output CPVRTexture + * Description : Takes a CPVRTexture and decompresses it into one of the standard + * : data formats. + *******************************************************************************/ + bool ProcessRawPVR( CPVRTextureHeader& sInputHeader, + CPVRTextureData& sInputData, + CPVRTextureHeader& sProcessHeader, + const bool bDoBleeding=false, + const float fBleedRed=0.0f, + const float fBleedGreen=0.0f, + const float fBleedBlue=0.0f, + E_RESIZE_MODE eResizeMode=eRESIZE_BICUBIC ); + + }; + + +#ifdef __APPLE__ +#pragma GCC visibility pop +#endif + +} + + +#endif +/***************************************************************************** +End of file (pvr_utils.h) +*****************************************************************************/ diff --git a/tools/TexturePacker/PVRTexLib/PVRTexLibGlobals.h b/tools/TexturePacker/PVRTexLib/PVRTexLibGlobals.h new file mode 100644 index 00000000..b850a378 --- /dev/null +++ b/tools/TexturePacker/PVRTexLib/PVRTexLibGlobals.h @@ -0,0 +1,524 @@ +/****************************************************************************** + + @File PVRTexLibGlobals.h + + @Title Console Log + +@Version Name : etc_conversion.cpp + + @Copyright Copyright (C) Imagination Technologies Limited. All Rights Reserved. Strictly Confidential. + + @Platform ANSI + + @Description Macros, enums and constants for PVRTexLib. + +******************************************************************************/ +#ifndef PVRTEXLIBGLOBALS_H +#define PVRTEXLIBGLOBALS_H + +/***************************************************************************** +* Includes +*****************************************************************************/ + +namespace pvrtexlib +{ + +#ifdef __APPLE__ + /* The classes below are exported */ +#pragma GCC visibility push(default) +#endif + + // DLL defines. Define _WINDLL_IMPORT to use the PVRTexLib dll under Windows + +#ifndef PVR_DLL +#ifdef _WINDLL_EXPORT +#define PVR_DLL __declspec(dllexport) +#elif _WINDLL_IMPORT +#define PVR_DLL __declspec(dllimport) +#else +#define PVR_DLL +#endif +#endif + + + /***************************************************************************** + * PVRTexLib Version + *****************************************************************************/ + +const int TEXTOOLVERSION_MAJOR = 3; +const int TEXTOOLVERSION_MINOR = 10; +const char* const TEXTOOLVERSION_STRING = ""; + + /***************************************************************************** + * Arithmetic Macros + *****************************************************************************/ + +#define _CLAMP_(X,Xmin,Xmax) ( (X)<(Xmax) ? ( (X)<(Xmin)?(Xmin):(X) ) : (Xmax) ) + + /***************************************************************************** + * Memory Macros + *****************************************************************************/ +#ifndef PVRFREE +#define PVRFREE(A) { if(A) {free(A); A=NULL;} } +#endif +#ifndef PVRDELETE +#define PVRDELETE(A) { if(A) {delete(A); A=NULL;}} +#endif +#ifndef PVRDELETEARRAY +#define PVRDELETEARRAY(A) { if(A) {delete[](A); A=NULL;}} +#endif + +// This macro is used to check at compile time that types are of a certain size +// If the size does not equal the expected size, this typedefs an array of size 0 +// which causes a compile error +#define PVRTSIZEASSERT(T, size) typedef int (sizeof_##T)[sizeof(T) == (size)] + + /***************************************************************************** + * typedefs for standard pixel type channels + *****************************************************************************/ + typedef signed char int8; + typedef signed short int16; + typedef signed int int32; + typedef signed long long int64; + typedef unsigned char uint8; + typedef unsigned short uint16; + typedef unsigned int uint32; + typedef unsigned long long uint64; + typedef float float32; + typedef double float64; + + // check_standard_type is a struct where only the specialisations have a standard declaration (complete type) + // if this struct is instantiated with a different type then the compiler will choke on it + // Place a line like: " check_standard_type(); " in a template function + // to ensure it won't be called using an non-standard type. + template struct check_standard_type; + template<> struct check_standard_type {}; + template<> struct check_standard_type {}; + template<> struct check_standard_type {}; + template<> struct check_standard_type {}; + template<> struct check_standard_type {}; + + // simple float16 class + class float16 + { + uint16 fVal; + public: + + float16(){} + + // direct constructor + template + float16(const t& F) + { + fVal = F; + } + + // conversion to float32 is special + float16(const float32& F) + { + + unsigned long uF = *((unsigned long*)&F); + unsigned long uSign = (uF & 0x10000000) >> 31; + unsigned long uExponent = (uF & 0x7F800000) >> 23; + unsigned long uMantissa = (uF & 0x007FFFFF); + + int uExp = uExponent - 127 + 15; + if(uExp < 1) uExp = 1; + if(uExp > 30) uExp = 30; + fVal = (unsigned short)((uSign << 15) |((unsigned int)uExp << 10) | (uMantissa >> 13)); + } + + operator float32() const + { + unsigned long uL = ((fVal & 0x1000) << 16) | //sign + (( (fVal & 0x7C00) >> 10) - 15 + 127 ) << 23| //5 bit exponent. + (fVal & 0x03FF) << 13 ; //10 bit mantissa. + return *((float*)&uL); + } + }; + + // check type sizes + PVRTSIZEASSERT(uint8,1); + PVRTSIZEASSERT(uint16,2); + PVRTSIZEASSERT(uint32,4); + PVRTSIZEASSERT(uint64,8); + PVRTSIZEASSERT(int8,1); + PVRTSIZEASSERT(int16,2); + PVRTSIZEASSERT(int32,4); + PVRTSIZEASSERT(int64,8); + PVRTSIZEASSERT(float16,2); + PVRTSIZEASSERT(float32,4); + PVRTSIZEASSERT(float64,8); + + // default working type for combining channels (to avoid overflows) + template struct combine_type + { + typedef float64 type; + }; + + // specialisation for uint32 to avoid overflows + template<> struct combine_type + { + typedef float64 type; + }; + + // specialisation for float32 to avoid overflows + template<> struct combine_type + { + typedef float64 type; + }; + + // specialisation for float32 to avoid overflows + template<> struct combine_type + { + typedef float64 type; + }; + + + // Returns the maximum value before overflow for these types (in the context of texture channels) + template + tType getMaximumValue(); + + template<> + inline float64 getMaximumValue(){return 1.0;} + template<> + inline float32 getMaximumValue(){return 1.0f;} + template<> + inline float16 getMaximumValue(){return 1.0f;} + template<> + inline uint64 getMaximumValue(){return 0xffffffffffffffffULL;} + template<> + inline uint32 getMaximumValue(){return 0xffffffff;} + template<> + inline uint16 getMaximumValue(){return 0xffff;} + template<> + inline uint8 getMaximumValue(){return 0xff;} + template<> + inline int64 getMaximumValue(){return 0x7fffffffffffffffLL;} + template<> + inline int32 getMaximumValue(){return 0x7fffffff;} + template<> + inline int16 getMaximumValue(){return 0x7fff;} + template<> + inline int8 getMaximumValue(){return 0x7f;} + + /***************************************************************************** + * PixelType - corresponds to all pixel formats understood by PVRTexLib + *****************************************************************************/ + enum PixelType + { + MGLPT_ARGB_4444 = 0x00, + MGLPT_ARGB_1555, + MGLPT_RGB_565, + MGLPT_RGB_555, + MGLPT_RGB_888, + MGLPT_ARGB_8888, + MGLPT_ARGB_8332, + MGLPT_I_8, + MGLPT_AI_88, + MGLPT_1_BPP, + MGLPT_VY1UY0, + MGLPT_Y1VY0U, + MGLPT_PVRTC2, + MGLPT_PVRTC4, + + // OpenGL version of pixel types + OGL_RGBA_4444= 0x10, + OGL_RGBA_5551, + OGL_RGBA_8888, + OGL_RGB_565, + OGL_RGB_555, + OGL_RGB_888, + OGL_I_8, + OGL_AI_88, + OGL_PVRTC2, + OGL_PVRTC4, + // OGL_BGRA_8888 extension + OGL_BGRA_8888, + OGL_A_8, + + // S3TC + D3D_DXT1 = 0x20, + D3D_DXT2, + D3D_DXT3, + D3D_DXT4, + D3D_DXT5, + + D3D_RGB_332, + D3D_AI_44, + D3D_LVU_655, + D3D_XLVU_8888, + D3D_QWVU_8888, + + //10 bits per channel + D3D_ABGR_2101010, + D3D_ARGB_2101010, + D3D_AWVU_2101010, + + //16 bits per channel + D3D_GR_1616, + D3D_VU_1616, + D3D_ABGR_16161616, + + //HDR formats + D3D_R16F, + D3D_GR_1616F, + D3D_ABGR_16161616F, + + //32 bits per channel + D3D_R32F, + D3D_GR_3232F, + D3D_ABGR_32323232F, + + // Ericsson + ETC_RGB_4BPP, + ETC_RGBA_EXPLICIT, // unimplemented + ETC_RGBA_INTERPOLATED, // unimplemented + + // additional pre-DX10 + D3D_A8 = 0x40, + D3D_V8U8, + D3D_I16, + + // DX10 + + + DX10_R32G32B32A32_FLOAT= 0x50, + DX10_R32G32B32A32_UINT , + DX10_R32G32B32A32_SINT, + + DX10_R32G32B32_FLOAT, + DX10_R32G32B32_UINT, + DX10_R32G32B32_SINT, + + DX10_R16G16B16A16_FLOAT , + DX10_R16G16B16A16_UNORM, + DX10_R16G16B16A16_UINT , + DX10_R16G16B16A16_SNORM , + DX10_R16G16B16A16_SINT , + + DX10_R32G32_FLOAT , + DX10_R32G32_UINT , + DX10_R32G32_SINT , + + DX10_R10G10B10A2_UNORM , + DX10_R10G10B10A2_UINT , + + DX10_R11G11B10_FLOAT , // unimplemented + + DX10_R8G8B8A8_UNORM , + DX10_R8G8B8A8_UNORM_SRGB , + DX10_R8G8B8A8_UINT , + DX10_R8G8B8A8_SNORM , + DX10_R8G8B8A8_SINT , + + DX10_R16G16_FLOAT , + DX10_R16G16_UNORM , + DX10_R16G16_UINT , + DX10_R16G16_SNORM , + DX10_R16G16_SINT , + + DX10_R32_FLOAT , + DX10_R32_UINT , + DX10_R32_SINT , + + DX10_R8G8_UNORM , + DX10_R8G8_UINT , + DX10_R8G8_SNORM , + DX10_R8G8_SINT , + + DX10_R16_FLOAT , + DX10_R16_UNORM , + DX10_R16_UINT , + DX10_R16_SNORM , + DX10_R16_SINT , + + DX10_R8_UNORM, + DX10_R8_UINT, + DX10_R8_SNORM, + DX10_R8_SINT, + + DX10_A8_UNORM, + DX10_R1_UNORM, + DX10_R9G9B9E5_SHAREDEXP, // unimplemented + DX10_R8G8_B8G8_UNORM, // unimplemented + DX10_G8R8_G8B8_UNORM, // unimplemented + + DX10_BC1_UNORM, + DX10_BC1_UNORM_SRGB, + + DX10_BC2_UNORM, + DX10_BC2_UNORM_SRGB, + + DX10_BC3_UNORM, + DX10_BC3_UNORM_SRGB, + + DX10_BC4_UNORM, // unimplemented + DX10_BC4_SNORM, // unimplemented + + DX10_BC5_UNORM, // unimplemented + DX10_BC5_SNORM, // unimplemented + + // OpenVG + + /* RGB{A,X} channel ordering */ + ePT_VG_sRGBX_8888 = 0x90, + ePT_VG_sRGBA_8888, + ePT_VG_sRGBA_8888_PRE, + ePT_VG_sRGB_565, + ePT_VG_sRGBA_5551, + ePT_VG_sRGBA_4444, + ePT_VG_sL_8, + ePT_VG_lRGBX_8888, + ePT_VG_lRGBA_8888, + ePT_VG_lRGBA_8888_PRE, + ePT_VG_lL_8, + ePT_VG_A_8, + ePT_VG_BW_1, + + /* {A,X}RGB channel ordering */ + ePT_VG_sXRGB_8888, + ePT_VG_sARGB_8888, + ePT_VG_sARGB_8888_PRE, + ePT_VG_sARGB_1555, + ePT_VG_sARGB_4444, + ePT_VG_lXRGB_8888, + ePT_VG_lARGB_8888, + ePT_VG_lARGB_8888_PRE, + + /* BGR{A,X} channel ordering */ + ePT_VG_sBGRX_8888, + ePT_VG_sBGRA_8888, + ePT_VG_sBGRA_8888_PRE, + ePT_VG_sBGR_565, + ePT_VG_sBGRA_5551, + ePT_VG_sBGRA_4444, + ePT_VG_lBGRX_8888, + ePT_VG_lBGRA_8888, + ePT_VG_lBGRA_8888_PRE, + + /* {A,X}BGR channel ordering */ + ePT_VG_sXBGR_8888, + ePT_VG_sABGR_8888 , + ePT_VG_sABGR_8888_PRE, + ePT_VG_sABGR_1555, + ePT_VG_sABGR_4444, + ePT_VG_lXBGR_8888, + ePT_VG_lABGR_8888, + ePT_VG_lABGR_8888_PRE, + + // max cap for iterating + END_OF_PIXEL_TYPES, + + + + + MGLPT_NOTYPE = 0xffffffff + + }; + + // Standard pixel types for each precision of library + // These are the formats that the lib actually works on + const PixelType eInt8StandardPixelType = DX10_R8G8B8A8_UNORM, + eInt16StandardPixelType = D3D_ABGR_16161616, + eInt32StandardPixelType = DX10_R32G32B32A32_UINT, + eFloatStandardPixelType = D3D_ABGR_32323232F; + + // The number of APIs supported by the library + // enums for each of these APIs + enum E_API + { + eALL_API=0, + eOGLES, + eOGLES2, + eD3DM, + eOGL2, + eDX9, + eDX10, + eOVG, + eMGL, + NUM_APIS, + }; + + // human readable names for APIs + const char ppszAPINames[NUM_APIS][16] = + { + "All APIs","OpenGL ES 1.x","OpenGL ES 2.0","Direct3D Mobile","OpenGL","DirectX 9","DirectX 10","OpenVG","MGL" + }; + + // names for cube map faces + const char g_pszCubeFaceNames[6][6] = + { + "FRONT","BACK","RIGHT","LEFT","TOP","BASE" + }; + + enum E_PRECMODE + { // precision modes - correspond to standard pixel types + ePREC_INT8=0, + ePREC_INT16, + ePREC_INT32, + ePREC_FLOAT, + ePREC_NONE + }; + + enum E_RESIZE_MODE + { // scaling modes + eRESIZE_NEAREST=0, + eRESIZE_BILINEAR, + eRESIZE_BICUBIC, + eNumResizeModes + }; + const E_RESIZE_MODE keResizeModeDefault = eRESIZE_BICUBIC; + + enum E_PVRTC_ENCODING_MODE + { + ePVRTC_NORMAL=0, + ePVRTC_ALT, + ePVRTC_ALT2, + eNumPVRTCModes + }; + const E_PVRTC_ENCODING_MODE kePVRTCEncodingModeDefault = ePVRTC_NORMAL; + + const int kiPVRTCIterationsDefault = 8; + + enum E_ETC_ENCODING_MODE + { + eFast=0, + eMedium, + eSlow, + eFastPerceptual, + eMediumPerceptual, + eSlowPerceptual, + eNumETCModes + }; + const E_ETC_ENCODING_MODE keETCEncodingModeDefault = eFastPerceptual; + + const char kstrETCEncodingMode[][18] = + { + "Fast", + "Medium", + "Slow", + "Fast Perceptual", + "Medium Perceptual", + "Slow Perceptual", + }; + + enum E_BORDER_TYPE + { + eBORDER_PVRTC4=0, + eBORDER_PVRTC2 + }; + const E_BORDER_TYPE keBorderTypeDefault = eBORDER_PVRTC4; + +#ifdef __APPLE__ +#pragma GCC visibility pop +#endif + +} + +#endif + + +/***************************************************************************** +End of file (PVRTexLibGlobals.h) +*****************************************************************************/ diff --git a/tools/TexturePacker/PVRTexLib/Pixel.h b/tools/TexturePacker/PVRTexLib/Pixel.h new file mode 100644 index 00000000..b1310b92 --- /dev/null +++ b/tools/TexturePacker/PVRTexLib/Pixel.h @@ -0,0 +1,256 @@ +/****************************************************************************** + + @File Pixel.h + + @Title Console Log + +@Version Name : etc_conversion.cpp + + @Copyright Copyright (C) Imagination Technologies Limited. All Rights Reserved. Strictly Confidential. + + @Platform ANSI + + @Description Pixel structs. + +******************************************************************************/ +#ifndef PIXEL_H +#define PIXEL_H + +#include + +namespace pvrtexlib +{ + +#ifdef __APPLE__ + /* The classes below are exported */ +#pragma GCC visibility push(default) +#endif + + // note order of enums reflecta order of members of Pixel struct + enum E_COLOUR_CHANNEL + { + ePIXEL_Red=0, + ePIXEL_Green, + ePIXEL_Blue, + ePIXEL_Alpha, + ePIXEL_None + }; + + // Pixel structures for standard pixel types + template struct Pixel + { + typedef channelType chanType; + channelType Red, Green, Blue, Alpha; + + Pixel(){} + Pixel(unsigned int u32Colour); + + Pixel(channelType nRed, channelType nGreen, channelType nBlue, channelType nAlpha) + :Red(nRed),Green(nGreen),Blue(nBlue),Alpha(nAlpha){} + + unsigned int toUnsignedInt(); + inline channelType getMaxChannelValue() const; + inline int getSizeInBytes() const; + + channelType& operator[](const unsigned int channel) + { + assert(channel<4); + return ((channelType*)(&Red))[channel]; + } + + bool operator==(const Pixel& b) + { + return Red==b.Red && Green==b.Green && Blue==b.Blue && Alpha==b.Alpha; + } + + + Pixel operator+(const Pixel& b) + { + return Pixel(Red+b.Red,Green+b.Green,Blue+b.Blue,Alpha+b.Alpha); + } + Pixel& operator+=(const Pixel& b) + { + Red +=b.Red;Green+=b.Green;Blue+=b.Blue;Alpha+=b.Alpha; + return *this; + } + Pixel& operator+=(const channelType b) + { + Red +=b;Green+=b;Blue+=b;Alpha+=b; + return *this; + } + + Pixel operator-(const Pixel& b) + { + return Pixel(Red-b.Red,Green-b.Green,Blue-b.Blue,Alpha-b.Alpha); + } + + Pixel operator*(const Pixel& b) + { + return Pixel(Red*b.Red,Green*b.Green,Blue*b.Blue,Alpha*b.Alpha); + } + Pixel operator*(const channelType b) + { + return Pixel(Red*b,Green*b,Blue*b,Alpha*b); + } + + Pixel& operator*=(const channelType b) + { + Red *=b;Green*=b;Blue*=b;Alpha*=b; + return *this; + } + + Pixel operator/(const Pixel& b) + { + return Pixel(Red/b.Red,Green/b.Green,Blue/b.Blue,Alpha/b.Alpha); + } + + friend inline Pixel operator*(const float f,const Pixel& b) + { + return Pixel((channelType)(f*(float)b.Red), + (channelType)(f*(float)b.Green), + (channelType)(f*(float)b.Blue), + (channelType)(f*(float)b.Alpha)); + } + + /******************************************************************************* + * Constructor + * Description : Copy constructor + *******************************************************************************/ + template + Pixel(const Pixel& original) + { + Red = (channelType)original.Red; + Green = (channelType)original.Green; + Blue = (channelType)original.Blue; + Alpha = (channelType)original.Alpha; + } + /******************************************************************************* + * Constructor + * Description : Assignment operator + *******************************************************************************/ + template + Pixel& operator=(const Pixel& sRHS) + { + Red = (channelType)sRHS.Red; + Green = (channelType)sRHS.Green; + Blue = (channelType)sRHS.Blue; + Alpha = (channelType)sRHS.Alpha; + return *this; + } + + }; + + template + inline int Pixel::getSizeInBytes() const + { + return sizeof(channelType)*4; + } + + + // specialisations for uint8 + template<> + inline Pixel::Pixel(const unsigned int u32Colour) + { + Alpha = uint8(u32Colour>>24); + Blue = uint8((u32Colour>>16)&0xff); + Green = uint8((u32Colour>>8)&0xff); + Red = uint8(u32Colour&0xff); + } + template<> + inline unsigned int Pixel::toUnsignedInt() + { + return ((unsigned int)(Alpha)<<24) + |((unsigned int) (Blue)<<16) + |((unsigned int) (Green)<<8) + |(unsigned int) (Red); + } + + template<> + inline uint8 Pixel::getMaxChannelValue() const + { + return 0xFF; + } + + // specialisations for uint16 + template<> + inline uint16 Pixel::getMaxChannelValue() const + { + return 0xFFFF; + } + template<> + inline unsigned int Pixel::toUnsignedInt() + { + return ((unsigned int)(Alpha>>8)<<24) + |((unsigned int) (Blue>>8)<<16) + |((unsigned int) (Green>>8)<<8) + |(unsigned int) (Red>>8); + } + + // specialisations for uint32 + template<> + inline uint32 Pixel::getMaxChannelValue() const + { + return 0xFFFFFFFF; + } + template<> + inline unsigned int Pixel::toUnsignedInt() + { + return ((unsigned int)(Alpha>>24)<<24) + |((unsigned int) (Blue>>24)<<16) + |((unsigned int) (Green>>24)<<8) + |(unsigned int) (Red>>24); + } + + // specialisations for float + template<> + inline float32 Pixel::getMaxChannelValue() const + { + return 1.0f; + } + template<> + inline unsigned int Pixel::toUnsignedInt() + { + return ((unsigned int)(Alpha*255.f)<<24) + |((unsigned int) (Blue*255.f)<<16) + |((unsigned int) (Green*255.f)<<8) + |(unsigned int) (Red*255.f); + } + + // convenience struct for PixelFormats + template struct PixelRGB + { + channelType Red; + channelType Green; + channelType Blue; + + // constructors + PixelRGB(){} + PixelRGB(const channelType tRed, + const channelType tGreen, + const channelType tBlue): + Red(tRed), + Green(tGreen), + Blue(tBlue){} + }; + + // convenience struct for PixelFormats + template struct PixelRG + { + channelType Red; + channelType Green; + PixelRG(){} + PixelRG(const channelType tRed, + const channelType tGreen): + Red(tRed), + Green(tGreen){} + }; + +#ifdef __APPLE__ +#pragma GCC visibility pop +#endif +} +#endif // PIXEL_H + +/***************************************************************************** +End of file (Pixel.h) +*****************************************************************************/ diff --git a/tools/TexturePacker/PVRTexLib/Win32/PVRTexLib.dll b/tools/TexturePacker/PVRTexLib/Win32/PVRTexLib.dll new file mode 100755 index 00000000..cc340d16 Binary files /dev/null and b/tools/TexturePacker/PVRTexLib/Win32/PVRTexLib.dll differ diff --git a/tools/TexturePacker/PVRTexLib/Win32/PVRTexLib.lib b/tools/TexturePacker/PVRTexLib/Win32/PVRTexLib.lib new file mode 100755 index 00000000..9b0a6c49 Binary files /dev/null and b/tools/TexturePacker/PVRTexLib/Win32/PVRTexLib.lib differ diff --git a/tools/TexturePacker/Win32/MakeDDS.vcxproj b/tools/TexturePacker/Win32/MakeDDS.vcxproj new file mode 100644 index 00000000..b3c2ca76 --- /dev/null +++ b/tools/TexturePacker/Win32/MakeDDS.vcxproj @@ -0,0 +1,102 @@ +ïŧŋ + + + + Debug + Win32 + + + Release + Win32 + + + + {E85454A0-D9CF-4480-A9AE-AE2A7C3FBAD6} + MakeDDS + Win32Proj + + + + Application + NotSet + true + + + Application + NotSet + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + + + + Disabled + ..;..\..\..\xbmc\win32;..\..\..\guilib;..\..\..\xbmc\lib\libsquish;..\..\..\lib\libSDL-WIN32\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;NO_XBMC_FILESYSTEM;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + ..\..\..\lib\libSDL-WIN32\lib\SDL.lib;..\..\..\xbmc\lib\libsquish\lib\squishd.lib;..\..\..\lib\libSDL-WIN32\lib\SDL_image.lib;%(AdditionalDependencies) + true + Console + MachineX86 + + + + + MaxSpeed + true + ..;..\..\..\xbmc\win32;..\..\..\guilib;..\..\..\xbmc\lib\libsquish;..\..\..\lib\libSDL-WIN32\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;NO_XBMC_FILESYSTEM;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + ..\..\..\lib\libSDL-WIN32\lib\SDL.lib;..\..\..\lib\libSDL-WIN32\lib\SDL_image.lib;..\..\..\xbmc\lib\libsquish\lib\squish.lib;%(AdditionalDependencies) + true + Console + true + true + MachineX86 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/TexturePacker/Win32/MakeDDS.vcxproj.filters b/tools/TexturePacker/Win32/MakeDDS.vcxproj.filters new file mode 100644 index 00000000..b5ac0058 --- /dev/null +++ b/tools/TexturePacker/Win32/MakeDDS.vcxproj.filters @@ -0,0 +1,33 @@ +ïŧŋ + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + + + Header Files + + + + + + \ No newline at end of file diff --git a/tools/TexturePacker/Win32/TexturePacker.vcxproj b/tools/TexturePacker/Win32/TexturePacker.vcxproj new file mode 100644 index 00000000..80c10925 --- /dev/null +++ b/tools/TexturePacker/Win32/TexturePacker.vcxproj @@ -0,0 +1,114 @@ +ïŧŋ + + + + Debug + Win32 + + + Release + Win32 + + + + {57EC0A84-7E0C-4EEA-9E63-BB4EBF2310D7} + TexturePacker + Win32Proj + + + + Application + NotSet + true + + + Application + NotSet + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + + + + Disabled + .;..\..\..\xbmc\win32;..\..\..\guilib;..\..\..\xbmc\utils;..\..\..\xbmc\lib\libsquish;..\..\..\lib\libSDL-WIN32\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + ..\..\..\lib\libSDL-WIN32\lib\SDL.lib;..\..\..\xbmc\lib\libsquish\lib\squishd.lib;..\..\..\xbmc\lib\liblzo\lzo.lib;..\..\..\lib\libSDL-WIN32\lib\SDL_image.lib;%(AdditionalDependencies) + libc.lib;%(IgnoreSpecificDefaultLibraries) + true + Console + MachineX86 + + + + + MaxSpeed + true + .;..\..\..\xbmc\win32;..\..\..\guilib;..\..\..\xbmc\utils;..\..\..\xbmc\lib\libsquish;..\..\..\lib\libSDL-WIN32\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + ..\..\..\lib\libSDL-WIN32\lib\SDL.lib;..\..\..\xbmc\lib\libsquish\lib\squish.lib;..\..\..\xbmc\lib\liblzo\lzo.lib;..\..\..\lib\libSDL-WIN32\lib\SDL_image.lib;%(AdditionalDependencies) + libc.lib;%(IgnoreSpecificDefaultLibraries) + true + Console + true + true + MachineX86 + + + + + + CompileAsCpp + CompileAsCpp + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/TexturePacker/Win32/TexturePacker.vcxproj.filters b/tools/TexturePacker/Win32/TexturePacker.vcxproj.filters new file mode 100644 index 00000000..76867a4c --- /dev/null +++ b/tools/TexturePacker/Win32/TexturePacker.vcxproj.filters @@ -0,0 +1,54 @@ +ïŧŋ + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/tools/TexturePacker/XBTF.cpp b/tools/TexturePacker/XBTF.cpp new file mode 100644 index 00000000..e783d150 --- /dev/null +++ b/tools/TexturePacker/XBTF.cpp @@ -0,0 +1,224 @@ +/* + * Copyright (C) 2005-2009 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +#include +#include "XBTF.h" + +CXBTFFrame::CXBTFFrame() +{ + m_width = 0; + m_height = 0; + m_packedSize = 0; + m_unpackedSize = 0; + m_offset = 0; + m_format = XB_FMT_UNKNOWN; + m_initialWidth = 0; + m_initialHeight = 0; + +} + +uint32_t CXBTFFrame::GetWidth() const +{ + return m_width; +} + +uint32_t CXBTFFrame::GetInitialWidth() const +{ + return m_initialWidth; +} + +void CXBTFFrame::SetWidth(uint32_t width) +{ + m_width = width; +} + +void CXBTFFrame::SetInitialWidth(uint32_t initialWidth) +{ + m_initialWidth= initialWidth; +} + +uint32_t CXBTFFrame::GetHeight() const +{ + return m_height; +} + +uint32_t CXBTFFrame::GetInitialHeight() const +{ + return m_initialHeight; +} + +void CXBTFFrame::SetHeight(uint32_t height) +{ + m_height = height; +} + +void CXBTFFrame::SetInitialHeight(uint32_t initialHeight) +{ + m_initialHeight = initialHeight; +} + +uint64_t CXBTFFrame::GetPackedSize() const +{ + return m_packedSize; +} + +void CXBTFFrame::SetPackedSize(uint64_t size) +{ + m_packedSize = size; +} + +bool CXBTFFrame::IsPacked() const +{ + return m_unpackedSize != m_packedSize; +} + +uint64_t CXBTFFrame::GetUnpackedSize() const +{ + return m_unpackedSize; +} + +void CXBTFFrame::SetUnpackedSize(uint64_t size) +{ + m_unpackedSize = size; +} + +void CXBTFFrame::SetFormat(uint32_t format) +{ + m_format = format; +} + +uint32_t CXBTFFrame::GetFormat() const +{ + return m_format; +} + +uint64_t CXBTFFrame::GetOffset() const +{ + return m_offset; +} + +void CXBTFFrame::SetOffset(uint64_t offset) +{ + m_offset = offset; +} + +uint32_t CXBTFFrame::GetDuration() const +{ + return m_duration; +} + +void CXBTFFrame::SetDuration(uint32_t duration) +{ + m_duration = duration; +} + +uint64_t CXBTFFrame::GetHeaderSize() const +{ + uint64_t result = + sizeof(m_width) + + sizeof(m_height) + + sizeof(m_format) + + sizeof(m_packedSize) + + sizeof(m_unpackedSize) + + sizeof(m_offset) + + sizeof(m_duration) + + sizeof(m_initialWidth) + + sizeof(m_initialHeight); + + return result; +} + +CXBTFFile::CXBTFFile() +{ + memset(m_path, 0, sizeof(m_path)); + m_loop = 0; +} + +CXBTFFile::CXBTFFile(const CXBTFFile& ref) +{ + strcpy(m_path, ref.m_path); + m_loop = ref.m_loop; + m_frames = ref.m_frames; +} + +char* CXBTFFile::GetPath() +{ + return m_path; +} + +void CXBTFFile::SetPath(const std::string& path) +{ + memset(m_path, 0, sizeof(m_path)); + strncpy(m_path, path.c_str(), sizeof(m_path) - 1); +} + +uint32_t CXBTFFile::GetLoop() const +{ + return m_loop; +} + +void CXBTFFile::SetLoop(uint32_t loop) +{ + m_loop = loop; +} + +std::vector& CXBTFFile::GetFrames() +{ + return m_frames; +} + +uint64_t CXBTFFile::GetHeaderSize() const +{ + uint64_t result = + sizeof(m_path) + + sizeof(m_loop) + + sizeof(uint32_t); /* Number of frames */ + + for (size_t i = 0; i < m_frames.size(); i++) + { + result += m_frames[i].GetHeaderSize(); + } + + return result; +} + +CXBTF::CXBTF() +{ +} + +uint64_t CXBTF::GetHeaderSize() const +{ + uint64_t result = + 4 /* Magic */ + + 1 /* Vesion */ + + sizeof(uint32_t) /* Number of Files */; + + for (size_t i = 0; i < m_files.size(); i++) + { + result += m_files[i].GetHeaderSize(); + } + + return result; +} + +std::vector& CXBTF::GetFiles() +{ + return m_files; +} diff --git a/tools/TexturePacker/libsquish-i486-linux.a b/tools/TexturePacker/libsquish-i486-linux.a new file mode 100644 index 00000000..ee85eb58 Binary files /dev/null and b/tools/TexturePacker/libsquish-i486-linux.a differ diff --git a/tools/TexturePacker/libsquish-i686_x64-linux.a b/tools/TexturePacker/libsquish-i686_x64-linux.a new file mode 100644 index 00000000..fc4b5b70 Binary files /dev/null and b/tools/TexturePacker/libsquish-i686_x64-linux.a differ diff --git a/xbmc/AppSecurity.cpp b/xbmc/AppSecurity.cpp new file mode 100644 index 00000000..09040f19 --- /dev/null +++ b/xbmc/AppSecurity.cpp @@ -0,0 +1,737 @@ +#include "system.h" + +#ifdef HAS_EMBEDDED + +#include "SpecialProtocol.h" +#include "utils/log.h" +#include "Util.h" +#include "bxxmldocument.h" +#include "File.h" +#include "HalServices.h" +#include "BoxeeUtils.h" +#include "AppSecurity.h" + +#ifdef DEVICE_PLATFORM +#include "bxoemconfiguration.h" +#endif + +#include +#include +#include +#include +#include "utils/Base64.h" + +#define PUBLIC_KEY_LEN 272 +#define SIGNATURE_LEN_BASE64 175 +#define SIGNATURE_LEN 128 + +//#define DEBUG + +//#define SERVER_URL "http://staging.boxee.tv/api/" +//#define PYTHON_APPS_PUBLIC "/download/boxee/python-apps-public.pem" +#define PYTHON_APPS_PUBLIC "special://xbmc/system/python-apps-public.pem" +#define SERVER_URL "https://app.boxee.tv/api/" + +typedef struct AppInfo +{ + CStdString signature; + CStdString authority; + + CStdString appId; + CStdString appVersion; +} AppInfo; + +typedef struct AuthorityInfo +{ + CStdString publicKey; + CStdString signature; + +} AuthorityInfo; + +typedef struct DeviceInfo +{ + CStdString type; + CStdString serial; + CStdString mac; + +} DeviceInfo; + +CAppSecurity::CAppSecurity(const CStdString& appFilename, const CStdString& appSecurityManifest, const CStdString& appId, const CStdString& appVersion) + : m_appFilename(appFilename), + m_appSecurityManifest(appSecurityManifest), + m_appId(appId), + m_appVersion(appVersion) +{ +} + +CAppSecurity::~CAppSecurity() +{ +} + +#if 0 +static char twitTestAuthManifest[] = {"\ +\n\ +\ +-----BEGIN PUBLIC KEY-----\n\ +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCxVsibE8x6XTJd0pj3xSEnZKhs\n\ +BfHSCBXJcN2wz8kqBt3ueRm65GUneCy1l3L4dBHMCj2bvZMNpylGfdMsCAli6LKi\n\ +7tBY7IU+SXVzdkcK+F/JG6362sk5L7MMUp6f9Ak+vwC/KtmU+9odA59brobQHe5m\n\ +YXV0oiBZAPhgBVqhSwIDAQAB\n\ +-----END PUBLIC KEY-----\n\ +\n\ +\ +Awm2eqbL8U5JFka4FCNz8DEDbtK7w3CPcWEc7uj6nuJ75NzOPnqwVJZX1x4GJRe/\n\ +KzLsK/Y2YZ40xHizqwsFtGWFI4IcEbyThx16VeOFdor5x8LkWG73BqzECpY6ic+0\n\ +BrPGxdtT+g3uyLtO+LJTxbOD6cpuBToUnzPQlwxqWPs=\n\ +\n\ +\n\ +open\n\ +\n\ +" +}; +#endif + +#if 0 +static void dump_sha1(unsigned char hash[SHA_DIGEST_LENGTH]) +{ + char outputBuffer[65]; + for(int i = 0; i < SHA_DIGEST_LENGTH; i++) + { + sprintf(outputBuffer + (i * 2), "%02x", hash[i]); + } + outputBuffer[64] = 0; + printf("%s\n", outputBuffer); +} +#endif + +static bool ReadDeviceCertificate(const CStdString& deviceCertificate, AppInfo* appInfo) +{ + TiXmlDocument xmlDoc; + + if(!xmlDoc.LoadFile(deviceCertificate)) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - Failed to load %s", __func__, deviceCertificate.c_str()); + return false; + } + + TiXmlElement* root = xmlDoc.RootElement(); + if(!root) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Failed to get root from BXXMLDocument of %s", __func__, deviceCertificate.c_str()); + return false; + } + + CStdString type, serial, mac; + while (root) + { + if(strcmp(root->Value(),"device") == 0) + { + type = root->Attribute("type"); + serial = root->Attribute("sn"); + mac = root->Attribute("mac"); + + root = root->FirstChildElement(); + continue; + } + else if(strcmp(root->Value(),"signature") == 0) + { + appInfo->signature = root->FirstChild()->Value(); + } + + root = root->NextSiblingElement(); + } + + bool bVerified = false; + do + { + if(appInfo->signature.IsEmpty()) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Device signature is empty", __func__); + break; + } + + bVerified = true; + + } while(false); + + return bVerified; +} + +static bool ReadAppSecurityManifest(const CStdString& appSecurityManifestFile, bool bTestApp, AppInfo* appInfo) +{ + if(bTestApp) + { + if(ReadDeviceCertificate(appSecurityManifestFile, appInfo)) + return true; + } + + TiXmlDocument xmlDoc; + + if(!xmlDoc.LoadFile(appSecurityManifestFile)) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - Failed to load %s", __func__, appSecurityManifestFile.c_str()); + return false; + } + + TiXmlElement* root = xmlDoc.RootElement(); + if(!root) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Failed to get root from BXXMLDocument of %s", __func__, appSecurityManifestFile.c_str()); + return false; + } + + CStdString appId, appVersion, authority, signature; + while (root) + { + if(strcmp(root->Value(),"app") == 0) + { + appId = root->Attribute("id"); + appVersion = root->Attribute("version"); + + root = root->FirstChildElement(); + continue; + } + else if(strcmp(root->Value(),"signature") == 0) + { + appInfo->signature = root->FirstChild()->Value(); + } + else if(strcmp(root->Value(),"authority") == 0) + { + appInfo->authority = root->FirstChild()->Value(); + } + + root = root->NextSiblingElement(); + } + + bool bVerified = false; + + do + { + if(appId != appInfo->appId) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - App id doesn't match [%s]![%s]", __func__, appId.c_str(), appInfo->appVersion.c_str()); + break; + } + + if(appVersion != appInfo->appVersion) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - App version doesn't match [%s]![%s]", __func__, appVersion.c_str(), appInfo->appVersion.c_str()); + break; + } + + + if(appInfo->signature.IsEmpty()) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - App signature is empty, app id [%s]", __func__, appId.c_str()); + break; + } + + if(appInfo->authority.IsEmpty()) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - App authority is empty, app id [%s]", __func__, appId.c_str()); + break; + } + + bVerified = true; + + } while(false); + + return bVerified; +} + +static bool ReadAuthorityInfo(const AppInfo& appInfo, AuthorityInfo* authoritySecurityInfo) +{ + if(appInfo.authority.IsEmpty()) + return false; + + CStdString authorityManifestURL = SERVER_URL; + + authorityManifestURL += "getappinfo/?"; + authorityManifestURL += "authorityid=" + appInfo.authority; + authorityManifestURL += "&"; + authorityManifestURL += "appid=" + appInfo.appId; + authorityManifestURL += "&"; + authorityManifestURL += "ver=" + appInfo.appVersion; + + BOXEE::BXCurl curl; + std::string strResp = curl.HttpGetString(authorityManifestURL, false); + + TiXmlDocument xmlDoc; + BOXEE::BXXMLDocument reader; + + if (strResp.empty()) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Not handling server response to [authorityManifestURL=%s] because it is empty", __func__, authorityManifestURL.c_str()); + return false; + } + + if(!reader.LoadFromString(strResp)) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Not handling server response to [authorityManifestURL=%s] because failed to load it to BXXMLDocument", __func__, authorityManifestURL.c_str()); + return false; + } + + TiXmlElement* root = reader.GetRoot(); + if(!root) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Failed to get root from BXXMLDocument of %s", __func__, authorityManifestURL.c_str()); + return false; + } + + CStdString authorityid, appId, appVersion, status; + + while (root) + { + if(strcmp(root->Value(),"authority") == 0) + { + authorityid = root->Attribute("id"); + + root = root->FirstChildElement(); + continue; + } + else if(strcmp(root->Value(),"app") == 0) + { + appId = root->Attribute("id"); + appVersion = root->Attribute("ver"); + + root = root->FirstChildElement(); + continue; + } + else if(strcmp(root->Value(), "publickey") == 0) + { + authoritySecurityInfo->publicKey = root->FirstChild()->Value(); + authoritySecurityInfo->publicKey += "\n"; + } + else if(strcmp(root->Value(), "signature") == 0) + { + authoritySecurityInfo->signature = root->FirstChild()->Value(); + } + else if(strcmp(root->Value(), "status") == 0) + { + status = root->FirstChild()->Value(); + } + + root = root->NextSiblingElement(); + } + + bool bVerified = false; + + do + { + // Verify that we've got correct info + if(authoritySecurityInfo->publicKey.IsEmpty()) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - Invalid manifest file for autority [%s], public element not found", __func__, appInfo.authority.c_str()); + break; + } + + if(authoritySecurityInfo->signature.IsEmpty()) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - Invalid manifest file for autority [%s], singature element not found", __func__, appInfo.authority.c_str()); + break; + } + + if(authorityid != appInfo.authority) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Authority id doesn't match [%s]![%s]", __func__, authorityid.c_str(), appInfo.authority.c_str()); + break; + } + + if(appId != appInfo.appId) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - App id doesn't match [%s]![%s]", __func__, appId.c_str(), appInfo.appId.c_str()); + break; + } + + if(appVersion != appInfo.appVersion) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - App version doesn't match [%s]![%s]", __func__, appVersion.c_str(), appInfo.appVersion.c_str()); + break; + } + + if(status == "blocked") + { + CLog::Log(LOGERROR,"CAppSecurity::%s - App %s is blocked", __func__, appId.c_str()); + break; + } + + bVerified = true; + + } while(false); + + return bVerified; +} + +static bool GetDeviceInfo(DeviceInfo* deviceInfo) +{ + IHalServices& client = CHalServicesFactory::GetInstance(); + + CHalHardwareInfo hwInfo; + if(!client.GetHardwareInfo(hwInfo)) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to fetch hardware info", __func__); + return false; + } + + CHalEthernetInfo ethInfo; + if(!client.GetEthernetInfo(0,ethInfo)) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to fetch ethernet info", __func__); + return false; + } + + deviceInfo->type = BoxeeUtils::GetPlatformStr(); + deviceInfo->serial = hwInfo.serialNumber; + deviceInfo->mac = ethInfo.mac_address; + + deviceInfo->mac.Replace(":", "-"); + + return true; +} + +static int unbase64(unsigned char *input, int length, unsigned char **output) +{ + BIO *b64, *bmem; + int bytesRead = 0; + + unsigned char *buffer = (unsigned char *)malloc(length); + memset(buffer, 0, length); + + b64 = BIO_new(BIO_f_base64()); + bmem = BIO_new_mem_buf((void*)input, length); + bmem = BIO_push(b64, bmem); + + bytesRead = BIO_read(bmem, buffer, length); + + BIO_free_all(bmem); + + *output = buffer; + + return bytesRead; +} + +static bool VerifyBuffer(const unsigned char* buffer, const unsigned int bufferLen, + const unsigned char* signatureEncoded, const unsigned int signatureEncodedLen, const CStdString& appsPublicKeyFile) +{ + unsigned char hash[SHA_DIGEST_LENGTH]; + SHA_CTX context; + FILE *fkey = NULL; + RSA *rsa = NULL; + bool bSuccedded = false; + unsigned char* signature = NULL; + int signatureLen = 0; + + SHA1_Init(&context); + SHA1_Update(&context, buffer, bufferLen); + SHA1_Final(hash, &context); + +#ifdef DEBUG + dump_sha1(hash); +#endif + + do + { + + signatureLen = unbase64((unsigned char*)signatureEncoded, signatureEncodedLen, &signature); + if(!signatureLen) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to decode signature [%s]", __func__, signatureEncoded); + break; + } + + fkey = fopen(_P(appsPublicKeyFile), "r"); + if (!fkey) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to open publickey file [%s]", __func__, appsPublicKeyFile.c_str()); + break; + } + + PEM_read_RSA_PUBKEY(fkey, &rsa, NULL, NULL); + if (!rsa) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to load rsa key from file [%s]", __func__, appsPublicKeyFile.c_str()); + break; + } + + bSuccedded = RSA_verify(NID_sha1, hash, SHA_DIGEST_LENGTH, signature, signatureLen, rsa); + + + } while(false); + + if (rsa) RSA_free(rsa); + if (fkey) fclose(fkey); + if (signature) free(signature); + + return bSuccedded; +} + +static bool VerifyAuthoritySignature(const AuthorityInfo& authorityInfo, const CStdString& appsPublicKeyFile) +{ + unsigned char* buffer = (unsigned char*)authorityInfo.publicKey.data(); + unsigned int bufferLen = authorityInfo.publicKey.size(); + unsigned char* signatureEncoded = (unsigned char*)authorityInfo.signature.c_str(); + unsigned int signatureEncodedLen = authorityInfo.signature.size(); + + return VerifyBuffer(buffer, bufferLen, signatureEncoded, signatureEncodedLen, appsPublicKeyFile); +} + +static bool VerifyDeviceSignature(const AppInfo& securityInfo, const CStdString& appsPublicKeyFile) +{ + DeviceInfo deviceInfo; + if(!GetDeviceInfo(&deviceInfo)) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to build device descriptor", __func__); + return false; + } + + CStdString deviceDescriptor; + deviceDescriptor = deviceInfo.type; + deviceDescriptor += "&"; + deviceDescriptor += deviceInfo.serial; + deviceDescriptor += "&"; + deviceDescriptor += deviceInfo.mac; + deviceDescriptor += "\n"; + + unsigned char* buffer = (unsigned char*)deviceDescriptor.c_str(); + unsigned int bufferLen = deviceDescriptor.size(); + unsigned char* signature = (unsigned char*)securityInfo.signature.c_str(); + unsigned int signatureLen = securityInfo.signature.size(); + + bool bVerified = VerifyBuffer(buffer, bufferLen, signature, signatureLen, appsPublicKeyFile); + + if(!bVerified) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - FAILED to verify device signature", __func__); + return false; + } + + // now verify the device with server + CStdString deviceInfoRequest = SERVER_URL; + + deviceInfoRequest += "getdeviceinfo/?"; + deviceInfoRequest += "type=" + deviceInfo.type; + deviceInfoRequest += "&"; + deviceInfoRequest += "sn=" + deviceInfo.serial; + deviceInfoRequest += "&"; + deviceInfoRequest += "mac=" + deviceInfo.mac; + + BOXEE::BXCurl curl; + std::string strResp = curl.HttpGetString(deviceInfoRequest, false); + + TiXmlDocument xmlDoc; + BOXEE::BXXMLDocument reader; + + if (strResp.empty()) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Not handling server response to [deviceInfoRequest=%s] because it is empty", __func__, deviceInfoRequest.c_str()); + return false; + } + + if(!reader.LoadFromString(strResp)) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Not handling server response to [authorityManifestURL=%s] because failed to load it to BXXMLDocument", __func__, deviceInfoRequest.c_str()); + return false; + } + + TiXmlElement* root = reader.GetRoot(); + if(!root) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Failed to get root from BXXMLDocument of %s", __func__, deviceInfoRequest.c_str()); + return false; + } + + CStdString type, serial, mac, status; + + while (root) + { + if(strcmp(root->Value(),"device") == 0) + { + type = root->Attribute("type"); + serial = root->Attribute("sn"); + mac = root->Attribute("mac"); + + root = root->FirstChildElement(); + continue; + } + else if(strcmp(root->Value(),"status") == 0) + { + status = root->FirstChild()->Value(); + } + + root = root->NextSiblingElement(); + } + + bVerified = false; + + do + { + if(type != deviceInfo.type) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Device type doesn't match [%s]![%s]", __func__, type.c_str(), deviceInfo.type.c_str()); + break; + } + + if(serial != deviceInfo.serial) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Device serial doesn't match [%s]![%s]", __func__, serial.c_str(), deviceInfo.serial.c_str()); + break; + } + + if(mac != deviceInfo.mac) + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Device mac doesn't match [%s]![%s]", __func__, mac.c_str(), deviceInfo.mac.c_str()); + break; + } + + if(status != "open") + { + CLog::Log(LOGERROR,"CAppSecurity::%s - Device %s is locked", __func__, deviceInfo.serial.c_str()); + break; + } + + bVerified = true; + + } while(false); + + return bVerified; +} + +static bool VerifyAppSignature(const CStdString& appFile, const AppInfo& securityInfo, const AuthorityInfo& authorityInfo) +{ + unsigned char hash[SHA_DIGEST_LENGTH]; + SHA_CTX context; + RSA *rsa = NULL; + BIO *bio = NULL; + bool bSuccedded = false; + unsigned char buffer[4096]; + unsigned char* signature = (unsigned char*)securityInfo.signature.c_str(); + int signatureLen = securityInfo.signature.size(); + XFILE::CFile file; + unsigned int bytesRead = 0; + + if(!file.Open(appFile)) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to open file [%s]", __func__, appFile.c_str()); + return false; + } + + SHA1_Init(&context); + + while((bytesRead = file.Read(buffer, sizeof buffer))) + { + SHA1_Update(&context, buffer, bytesRead); + } + + SHA1_Final(hash, &context); + file.Close(); + +#ifdef DEBUG + dump_sha1(hash); +#endif + + do + { + + signatureLen = unbase64((unsigned char*)securityInfo.signature.c_str(), securityInfo.signature.size(), &signature); + if(!signatureLen) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to decode signature [%s]", __func__, securityInfo.signature.c_str()); + break; + } + + bio = BIO_new_mem_buf((void*)authorityInfo.publicKey.data(), authorityInfo.publicKey.size()); + if(!bio) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to create BIO from public key[%s]", __func__, authorityInfo.publicKey.c_str()); + break; + } + + PEM_read_bio_RSA_PUBKEY(bio, &rsa, NULL, NULL); + if(!rsa) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to create RSA public key from BIO", __func__); + break; + } + + bSuccedded = RSA_verify(NID_sha1, hash, SHA_DIGEST_LENGTH, signature, signatureLen, rsa); + + + } while(false); + + + if (rsa) RSA_free(rsa); + if (bio) BIO_free(bio); + if (signature) free(signature); + + return bSuccedded; +} + +bool CAppSecurity::VerifySignature(int flags) +{ + if( (!(flags & FLAG_VERIFY_APP_STATUS_ONLY) && !XFILE::CFile::Exists(m_appFilename)) || + !XFILE::CFile::Exists(m_appSecurityManifest)) + { + CLog::Log(LOGERROR, "CAppSecurity::%s Invalid manifest or app file", __func__); + return false; + } + + bool bVerified = false; + bool bTestApp = flags & FLAG_TEST_APP; + do + { + + AppInfo appInfo; + + appInfo.appId = m_appId; + appInfo.appVersion = m_appVersion; + + if(!ReadAppSecurityManifest(m_appSecurityManifest, bTestApp, &appInfo)) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to read app security manifest", __func__); + break; + } + + if(bTestApp) + { + bVerified = VerifyDeviceSignature(appInfo, PYTHON_APPS_PUBLIC); + break; + } + + AuthorityInfo authorityInfo; + if(!ReadAuthorityInfo(appInfo, &authorityInfo)) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to read authority manifest", __func__); + break; + } + + if(flags & FLAG_VERIFY_APP_STATUS_ONLY) + { + bVerified = true; + break; + } + + if(!VerifyAuthoritySignature(authorityInfo, PYTHON_APPS_PUBLIC)) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to verify authority public key", __func__); + break; + } + + if(!VerifyAppSignature(m_appFilename, appInfo, authorityInfo)) + { + CLog::Log(LOGERROR, "CAppSecurity::%s - failed to verify signature app [%s]", __func__, m_appFilename.c_str()); + break; + } + + bVerified = true; + + } while(false); + + if(bVerified) + { + CLog::Log(LOGINFO, "CAppSecurity::%s - Succesfully verified signature for %s app [%s]", __func__, bTestApp ? "test" : "", m_appId ? m_appId.c_str() : m_appFilename.c_str()); + } + + return bVerified; +} + +#endif diff --git a/xbmc/AppSecurity.h b/xbmc/AppSecurity.h new file mode 100644 index 00000000..e718e436 --- /dev/null +++ b/xbmc/AppSecurity.h @@ -0,0 +1,21 @@ +#ifndef _APPSECURITY_H +#define _APPSECURITY_H + +#define FLAG_VERIFY_ALL 0x0 +#define FLAG_TEST_APP 0x1 +#define FLAG_VERIFY_APP_STATUS_ONLY 0x2 + +class CAppSecurity +{ +public: + CAppSecurity(const CStdString& appFilename, const CStdString& appSecurityManifest, const CStdString& appId="", const CStdString& appVersion=""); + ~CAppSecurity(); + + bool VerifySignature(int flags = FLAG_VERIFY_ALL); +private: + CStdString m_appFilename; + CStdString m_appSecurityManifest; + CStdString m_appId; + CStdString m_appVersion; +}; +#endif diff --git a/xbmc/BoxeeBrowseMenuManager.cpp b/xbmc/BoxeeBrowseMenuManager.cpp new file mode 100644 index 00000000..41a29456 --- /dev/null +++ b/xbmc/BoxeeBrowseMenuManager.cpp @@ -0,0 +1,539 @@ +#include "BoxeeBrowseMenuManager.h" +#include "utils/log.h" +#include "LocalizeStrings.h" +#include "FileItem.h" +#include "Resolution.h" +#include "SkinInfo.h" +#include "StringUtils.h" +#include "lib/libBoxee/bxgenresmanager.h" +#include "FileSystem/Directory.h" +#include "FileSystem/DirectoryCache.h" + +#include + +using namespace BOXEE; + +#define BOXEE_BROWSE_MENU_TREE_FILE_NAME "boxee_browse_menu_tree.xml" + +CBoxeeBrowseMenuManager::CBoxeeBrowseMenuManager() +{ + m_strPath = ""; + m_isInit = false; +} + +CBoxeeBrowseMenuManager::~CBoxeeBrowseMenuManager() +{ + +} + +CBoxeeBrowseMenuManager& CBoxeeBrowseMenuManager::GetInstance() +{ + static CBoxeeBrowseMenuManager boxeeBrowseMenuManager; + return boxeeBrowseMenuManager; +} + +bool CBoxeeBrowseMenuManager::Init(bool allowRebuild) +{ + if (!allowRebuild && m_isInit) + { + CLog::Log(LOGWARNING,"CBoxeeBrowseMenuManager::Init - [allowRebuild=%d=FALSE] and [isInit=%d=TRUE] therefore CAN'T build the menu. [MenuMapSize=%zu] (bm)",allowRebuild,m_isInit,m_menuMap.size()); + return false; + } + + if (allowRebuild) + { + m_isInit = false; + } + + if (!m_isInit) + { + m_isInit = BuildMenus(); + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuManager::Init - after init [path=%s][NumOfMunus=%zu] (bm)",m_strPath.c_str(),m_menuMap.size()); + } + + return m_isInit; +} + +bool CBoxeeBrowseMenuManager::BuildMenus() +{ + CSingleLock lock(m_menuMapLock); + + m_strPath = ""; + TiXmlDocument xmlDoc; + + RESOLUTION resToUse = RES_INVALID; + m_strPath = g_SkinInfo.GetSkinPath(BOXEE_BROWSE_MENU_TREE_FILE_NAME,&resToUse); + + if (!xmlDoc.LoadFile(m_strPath)) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::BuildMenus - FAILED to load XMl file [path=%s] (bm)",m_strPath.c_str()); + return false; + } + + TiXmlElement* pRootElement = xmlDoc.RootElement(); + if (strcmp(pRootElement->Value(),"browse_menu")) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::BuildMenus - XMl file [path=%s] root element ISN'T but <%s> (bm)",pRootElement->Value(),m_strPath.c_str()); + return false; + } + + const TiXmlElement* pMenuElement = pRootElement->FirstChildElement("menu"); + if (!pMenuElement) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::BuildMenus - FAILED to find element. [path=%s] (bm)",m_strPath.c_str()); + return false; + } + + m_menuMap.clear(); + + while (pMenuElement) + { + if (strcmp(pMenuElement->Value(),"menu")) + { + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuManager::BuildMenus - <%s> ISN'T element. continue to next element (bm)",pMenuElement->Value()); + pMenuElement = pMenuElement->NextSiblingElement("menu"); + continue; + } + + if (!BuildMenu(*pMenuElement)) + { + // ERROR log will be written from BuildMenu function + } + + pMenuElement = pMenuElement->NextSiblingElement("menu"); + } + + return true; +} + +bool CBoxeeBrowseMenuManager::BuildMenu(const TiXmlElement& pMenuElement) +{ + CStdString strMenuId = pMenuElement.Attribute("id"); + + if (strMenuId.IsEmpty()) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::BuildMenus - element DOESN'T has \"id\" attribute. [path=%s] (bm)",m_strPath.c_str()); + return false; + } + + if (m_menuMap.find(strMenuId) != m_menuMap.end()) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::BuildMenus - with [id=%s] already exist. [path=%s] (bm)",strMenuId.c_str(),m_strPath.c_str()); + return false; + } + + CStdString strMenuLevel = pMenuElement.Attribute("level"); + + /* + if (strMenuLevel.IsEmpty()) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::BuildMenus - element with [id=%s] DOESN'T has \"level\" attribute. [path=%s] (bm)",strMenuId.c_str(),m_strPath.c_str()); + //return false; + } + */ + + CStdString strMenuTitle = pMenuElement.Attribute("title"); + + if (strMenuTitle.IsEmpty()) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::BuildMenus - element with [id=%s] DOESN'T has \"title\" attribute. [path=%s] (bm)",strMenuId.c_str(),m_strPath.c_str()); + //return false; + } + + if (!StringUtils::IsNaturalNumber(strMenuTitle)) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::BuildMenus - value of \"title\" attribute [%s] ISN'T numeric for element with [id=%s]. [path=%s] (bm)",strMenuTitle.c_str(),strMenuId.c_str(),m_strPath.c_str()); + } + + CFileItemPtr menuList = CFileItemPtr(new CFileItemList()); + int counter = 0; + + const TiXmlElement* pButtonElement = pMenuElement.FirstChildElement("button"); + while (pButtonElement) + { + CFileItemPtr buttonItem(new CFileItem()); + + CStdString strButtonId = pButtonElement->Attribute("id"); + + const TiXmlElement* pElement = pButtonElement->FirstChildElement(); + while (pElement) + { + const TiXmlNode* pValue = NULL; + if (pElement->ValueStr() == "label") + { + pValue = pElement->FirstChild(); + if (pValue) + { + CStdString strLabel = pValue->ValueStr(); + if (StringUtils::IsNaturalNumber(pValue->ValueStr())) + { + strLabel = g_localizeStrings.Get(atoi(pValue->Value())); + } + + buttonItem->SetLabel(strLabel); + } + } + else if (pElement->ValueStr() == "command") + { + pValue = pElement->FirstChild(); + if (pValue) + { + buttonItem->m_strPath = pValue->ValueStr(); + } + } + else if (pElement->ValueStr() == "child") + { + pValue = pElement->FirstChild(); + if (pValue) + { + buttonItem->SetProperty("child",pValue->ValueStr()); + } + } + else if (pElement->ValueStr() == "clickable") + { + pValue = pElement->FirstChild(); + if (pValue) + { + buttonItem->SetProperty("isClickable",(strcmp(pValue->ValueStr().c_str(),"true") == 0) ? true : false); + } + } + else if (pElement->ValueStr() == "window") + { + AddOpenInWindow(pElement,buttonItem); + } + else if (pElement->ValueStr() == "menu") + { + pValue = pElement->FirstChild(); + if (pValue) + { + buttonItem->SetProperty("updateMenu",true); + } + } + + pElement = pElement->NextSiblingElement(); + } + + buttonItem->SetProperty("id",strButtonId); + buttonItem->SetProperty("isseparator",(strButtonId == "bt_separator")); + + if (!buttonItem->HasProperty("isClickable") && !buttonItem->m_strPath.IsEmpty()) + { + buttonItem->SetProperty("isClickable",true); + } + + counter++; + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuManager::BuildMenu - [%d] - adding button [label=%s][path=%s][id=%s][isseparator=%d] to menu [%s] (bm)",counter,buttonItem->GetLabel().c_str(),buttonItem->m_strPath.c_str(),buttonItem->GetProperty("id").c_str(),buttonItem->GetPropertyBOOL("isseparator"),strMenuId.c_str()); + ((CFileItemList*)menuList.get())->Add(buttonItem); + + pButtonElement = pButtonElement->NextSiblingElement("button"); + } + + const TiXmlElement* pPathElement = pMenuElement.FirstChildElement("path"); + + if (((CFileItemList*)menuList.get())->IsEmpty() && (!pPathElement || pPathElement->ValueStr().empty())) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::BuildMenus - FAILED to add with [id=%s] since [numOfButtons=%d=0] and no element. [path=%s] (bm)",strMenuId.c_str(),((CFileItemList*)menuList.get())->Size(),m_strPath.c_str()); + return false; + } + + menuList->SetProperty("id",strMenuId); + menuList->SetProperty("level",strMenuLevel); + menuList->SetProperty("title",g_localizeStrings.Get(atoi(strMenuTitle))); + + if (pPathElement && pPathElement->FirstChild()) + { + menuList->m_strPath = pPathElement->FirstChild()->ValueStr(); + } + + const TiXmlElement* pParentElement = pMenuElement.FirstChildElement("parent"); + if (pParentElement && pParentElement->FirstChild()) + { + menuList->SetProperty("parent",pParentElement->FirstChild()->ValueStr()); + } + + const TiXmlElement* pWindowElement = pMenuElement.FirstChildElement("window"); + if (pWindowElement && pWindowElement->FirstChild()) + { + AddOpenInWindow(pWindowElement,menuList); + } + + m_menuMap[strMenuId] = menuList; + + return true; +} + +void CBoxeeBrowseMenuManager::ClearDynamicMenuButtons(const CStdString& strMenuId) +{ + CSingleLock lock(m_menuMapLock); + + std::map::iterator it; + CFileItemPtr menu; + + if (strMenuId.IsEmpty()) + { + for(it=m_menuMap.begin();it != m_menuMap.end();++it) + { + menu = it->second; + CStdString path = ((CFileItemList*)(menu.get()))->m_strPath; + + if (!path.IsEmpty()) + { + // TMP LIMITATION: removing only buttons above the separator + for (int i=0; i<((CFileItemList*)(menu.get()))->Size();i++) + { + if (((CFileItemList*)(menu.get()))->Get(i)->GetPropertyBOOL("isseparator")) + { + break; + } + + ((CFileItemList*)(menu.get()))->Remove(i); + i--; + } + + ((CFileItemList*)(menu.get()))->SetProperty("IsFullyInitialized",false); + + CStdString menuContentPath = ((CFileItemList*)menu.get())->GetProperty("menuContentPath"); + + if (!menuContentPath.IsEmpty()) + { + g_directoryCache.ClearDirectory(menuContentPath); + } + } + } + + return; + } + + it = m_menuMap.find(strMenuId); + + if (it == m_menuMap.end()) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::ClearMenu - FAILED to find menu [id=%s] in MenuMap. [path=%s] (bm)",strMenuId.c_str(),m_strPath.c_str()); + return; + } + + menu = it->second; + + if (!menu.get()) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::ClearMenu - got NULL menu for [id=%s]. [path=%s] (bm)",strMenuId.c_str(),m_strPath.c_str()); + return; + } + + CStdString path = ((CFileItemList*)(menu.get()))->m_strPath; + + if (!path.IsEmpty()) + { + // TMP LIMITATION: removing only buttons above the separator + for (int i=0; i<((CFileItemList*)(menu.get()))->Size();i++) + { + if (((CFileItemList*)(menu.get()))->Get(i)->GetPropertyBOOL("isseparator")) + { + break; + } + + ((CFileItemList*)(menu.get()))->Remove(i); + i--; + } + + ((CFileItemList*)(menu.get()))->SetProperty("IsFullyInitialized",false); + + CStdString menuContentPath = ((CFileItemList*)menu.get())->GetProperty("menuContentPath"); + + if (!menuContentPath.IsEmpty()) + { + g_directoryCache.ClearDirectory(menuContentPath); + } + } +} + +CFileItemList* CBoxeeBrowseMenuManager::GetMenu(const CStdString& strMenuId) +{ + if (strMenuId.IsEmpty()) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::GetMenu - FAILED to get menu EMPTY [id=%s]. [path=%s] (bm)",strMenuId.c_str(),m_strPath.c_str()); + return NULL; + } + + CSingleLock lock(m_menuMapLock); + + CFileItemPtr menu; + CStdString menuByPath = strMenuId; + + std::map::iterator it = m_menuMap.find(strMenuId); + + if (it != m_menuMap.end()) + { + //////////////////////////////////////// + // going to get menu items by mennuId // + //////////////////////////////////////// + + menu = it->second; + + if (!menu.get()) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::GetMenu - got NULL menu for [id=%s]. [path=%s] (bm)",strMenuId.c_str(),m_strPath.c_str()); + return NULL; + } + + if (((CFileItemList*)(menu.get()))->IsEmpty()) + //if (!menu->m_strPath.IsEmpty() || ((CFileItemList*)(menu.get()))->IsEmpty()) + { + //////////////////////////////////////////////// + // menu has NO items -> try get items by path // + //////////////////////////////////////////////// + menuByPath = menu->m_strPath; + } + else + { + //////////////////// + // menu has items // + //////////////////// + + if (menu->m_strPath.IsEmpty() || menu->GetPropertyBOOL("IsFullyInitialized")) + { + ////////////////////////////////////////////////////// + // menu has items and there is NO path -> return it // + ////////////////////////////////////////////////////// + + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuManager::GetMenu - got menu with [size=%d] for [id=%s]. [path=%s] (bm)",((CFileItemList*)menu.get())->Size(),strMenuId.c_str(),m_strPath.c_str()); + return ((CFileItemList*)menu.get()); + } + else + { + //////////////////////////////////////////////////////// + // menu has items and also path -> try add path items // + //////////////////////////////////////////////////////// + + menuByPath = menu->m_strPath; + } + } + } + else + { + menuByPath = strMenuId; + } + + if (menuByPath.IsEmpty()) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::GetMenu - FAILED to get menu with EMPTY path [%s]. [path=%s] (bm)",menuByPath.c_str(),m_strPath.c_str()); + return NULL; + } + + ///////////////////////////////////// + // going to get menu items by path // + ///////////////////////////////////// + + CFileItemList items; + CStdString openInWindow = menu.get() ? menu->GetProperty("openInWindow") : ""; + GetMenuItemsByPath(menuByPath,items,openInWindow); + + if (items.IsEmpty()) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::GetMenu - got NO items [size=%d=0] for [path=%s]. [path=%s] (bm)",items.Size(),menuByPath.c_str(),m_strPath.c_str()); + return NULL; + } + + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuManager::GetMenu - going to append [%d] items from [path=%s] to menu. [path=%s] (bm)",items.Size(),menuByPath.c_str(),m_strPath.c_str()); + + if (!menu.get()) + { + menu = CFileItemPtr(new CFileItemList()); + + menu->SetProperty("id",menuByPath); + //menu->SetProperty("title",g_localizeStrings.Get(atoi(strMenuTitle))); + } + + if (((CFileItemList*)menu.get())->IsEmpty()) + { + ((CFileItemList*)menu.get())->Append(items); + } + else + { + for (int i=0; iAddFront(items.Get(i),i); + } + } + + menu->SetProperty("IsFullyInitialized",true); + menu->m_strPath = menuByPath; + menu->SetProperty("menuContentPath",items.m_strPath); + + m_menuMap[strMenuId] = menu; + + return ((CFileItemList*)menu.get()); +} + +bool CBoxeeBrowseMenuManager::GetFullMenuStructure(const CStdString& startMenuId,std::list& fullMenuStaructList) +{ + bool haveFullStructure = false; + CStdString menuId = startMenuId; + + while (!haveFullStructure) + { + CFileItemList* menu = GetMenu(menuId); + + if (!menu) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::GetFullMenuStructure - FAILED to get menu for [id=%s] (bm)",menuId.c_str()); + haveFullStructure = true; + } + else + { + fullMenuStaructList.push_front(*menu); + + CStdString parentMenuId = menu->GetProperty("parent"); + if (parentMenuId.IsEmpty()) + { + haveFullStructure = true; + } + else + { + menuId = parentMenuId; + } + } + } + + return true; +} + +bool CBoxeeBrowseMenuManager::AddOpenInWindow(const TiXmlElement* pElement,CFileItemPtr item) +{ + bool retVal = false; + + const TiXmlNode* pValue = pElement->FirstChild(); + + if (pValue) + { + if (!StringUtils::IsNaturalNumber(pValue->ValueStr())) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuManager::AddOpenInWindow - value of element [%s] for [label=%s] ISN'T numeric. [path=%s] (bm)",pValue->ValueStr().c_str(),item->GetLabel().c_str(),item->m_strPath.c_str()); + } + else + { + item->SetProperty("openInWindow",pValue->ValueStr()); + retVal = true; + } + } + + return retVal; +} + +bool CBoxeeBrowseMenuManager::GetMenuItemsByPath(const CStdString& path, CFileItemList& items, const CStdString& openInWindow) +{ + bool retVal = false; + + retVal = DIRECTORY::CDirectory::GetDirectory(path, items); + + if (retVal && !openInWindow.IsEmpty()) + { + for (int i=0; iSetProperty("openInWindow",openInWindow); + } + } + + return retVal; +} + diff --git a/xbmc/BoxeeBrowseMenuManager.h b/xbmc/BoxeeBrowseMenuManager.h new file mode 100644 index 00000000..ec7efb15 --- /dev/null +++ b/xbmc/BoxeeBrowseMenuManager.h @@ -0,0 +1,42 @@ +#ifndef BOXEEBROWSEMENUMANAGER_H_ +#define BOXEEBROWSEMENUMANAGER_H_ + +#include "../guilib/tinyXML/tinyxml.h" +#include "StdString.h" +#include "FileItem.h" + +#include +#include + +class CBoxeeBrowseMenuManager +{ +public: + + CBoxeeBrowseMenuManager(); + virtual ~CBoxeeBrowseMenuManager(); + + static CBoxeeBrowseMenuManager& GetInstance(); + + bool Init(bool allowRebuild = false); + + CFileItemList* GetMenu(const CStdString& strMenuId); + void ClearDynamicMenuButtons(const CStdString& strMenuId = ""); + bool GetFullMenuStructure(const CStdString& startMenuId,std::list& fullMenuStaructList); + +private: + + bool BuildMenus(); + bool BuildMenu(const TiXmlElement& pMenuElement); + bool GetMenuItemsByPath(const CStdString& path, CFileItemList& items, const CStdString& openInWindow); + + bool AddOpenInWindow(const TiXmlElement* pElement,CFileItemPtr buttonItem); + + CStdString m_strPath; + + std::map m_menuMap; + CCriticalSection m_menuMapLock; + + bool m_isInit; +}; + +#endif diff --git a/xbmc/BoxeeDeviceManager.cpp b/xbmc/BoxeeDeviceManager.cpp new file mode 100644 index 00000000..87ee1da8 --- /dev/null +++ b/xbmc/BoxeeDeviceManager.cpp @@ -0,0 +1,378 @@ +#include "BoxeeDeviceManager.h" +#include "log.h" +#include "utils/SingleLock.h" +#include "SpecialProtocol.h" +#include "File.h" + +#define DEVICES_FILE "special://home/devices.xml" + +#define DEVICE_TYPE_PHONE "phone" +#define DEVICE_TYPE_TABLET "tablet" +#define DEVICE_TYPE_REMOTE "remote" +#define DEVICE_TYPE_OTHER "other" + +CBoxeeDeviceManager::CBoxeeDeviceManager() +{ + +} + +CBoxeeDeviceManager::~CBoxeeDeviceManager() +{ + +} + +bool CBoxeeDeviceManager::Initialize() +{ + m_pairedDeviceMap.clear(); + + CStdString strPath = _P(DEVICES_FILE); + + if (!XFILE::CFile::Exists(strPath)) + { + return true; + } + + TiXmlDocument xmlDoc; + if (!xmlDoc.LoadFile(strPath)) + { + CLog::Log(LOGERROR, "%s Error loading %s: Line %d, %s", __FUNCTION__, strPath.c_str(), xmlDoc.ErrorRow(), xmlDoc.ErrorDesc()); + return false; + } + + TiXmlElement *pRootElement = xmlDoc.RootElement(); + if (!pRootElement) + { + CLog::Log(LOGERROR, "%s devices.xml file does not have root element", __FUNCTION__); + return false; + } + + CStdString strValue = pRootElement->Value(); + if (strValue != "devices") + { + CLog::Log(LOGERROR, "%s devices.xml file does not contain ", __FUNCTION__); + return false; + } + + const TiXmlElement* pChild = pRootElement->FirstChildElement("device"); + while (pChild) + { + CBoxeeDeviceItem device; + if (device.FromXML(pChild)) + { + PairDeviceInternal(device); + } + + pChild = pChild->NextSiblingElement(); + } + + return true; +} + +bool CBoxeeDeviceManager::PairDeviceInternal(const CBoxeeDeviceItem& deviceItem) +{ + CLog::Log(LOGDEBUG,"CBoxeeDeviceManager::PairDevice - enter function with DeviceItem [DeviceId=%s][DeviceLabel=%s][DeviceType=%s=%d][DeviceIcon=%s][DeviceApplicationId=%s] (bdm)",deviceItem.GetDeviceId().c_str(),deviceItem.GetDeviceLabel().c_str(),deviceItem.GetDeviceTypeAsString().c_str(),deviceItem.GetDeviceTypeAsEnum(),deviceItem.GetDeviceIcon().c_str(),deviceItem.GetApplicationId().c_str()); + + CSingleLock lock(m_deviceMaplock); + + // check if DeviceId already exist + + CStdString newDeviceId = deviceItem.GetDeviceId(); + + std::map::iterator it; + it = m_pairedDeviceMap.find(newDeviceId); + + if(it != m_pairedDeviceMap.end()) + { + CLog::Log(LOGDEBUG,"CBoxeeDeviceManager::PairDevice - FAILED to pair device with [DeviceId=%s]. Id already exist (bdm)",newDeviceId.c_str()); + return false; + } + + m_pairedDeviceMap[newDeviceId] = deviceItem; + + return true; +} + +bool CBoxeeDeviceManager::PairDevice(const CBoxeeDeviceItem& deviceItem) +{ + if (!PairDeviceInternal(deviceItem)) + return false; + + return Save(); +} + +bool CBoxeeDeviceManager::UnPairDevice(const CStdString& deviceId) +{ + CLog::Log(LOGDEBUG,"CBoxeeDeviceManager::UnPairDevice - enter function with [DeviceId=%s] (bdm)",deviceId.c_str()); + + CSingleLock lock(m_deviceMaplock); + + std::map::iterator it; + it = m_pairedDeviceMap.find(deviceId); + + if(it == m_pairedDeviceMap.end()) + { + CLog::Log(LOGDEBUG,"CBoxeeDeviceManager::UnPairDevice - FAILED to unpair device with [DeviceId=%s]. Id DOESN'T exist (bdm)",deviceId.c_str()); + return false; + } + + m_pairedDeviceMap.erase(it); + + return Save(); +} + +bool CBoxeeDeviceManager::IsPairDevice(const CStdString& deviceId) +{ + CSingleLock lock(m_deviceMaplock); + + if(m_pairedDeviceMap.find(deviceId) == m_pairedDeviceMap.end()) + { + return false; + } + + return true; +} + +CStdString CBoxeeDeviceManager::GetDeviceTypeAsString(CDeviceTypes::DeviceTypesEnums deviceTypeEnum) +{ + switch(deviceTypeEnum) + { + case CDeviceTypes::BDT_PHONE: + return DEVICE_TYPE_PHONE; + break; + case CDeviceTypes::BDT_TABLET: + return DEVICE_TYPE_TABLET; + break; + case CDeviceTypes::BDT_REMOTE: + return DEVICE_TYPE_REMOTE; + break; + case CDeviceTypes::BDT_OTHER: + return DEVICE_TYPE_OTHER; + break; + default: + CLog::Log(LOGDEBUG,"CBoxeeDeviceManager::GetDeviceTypeAsString - Invalid DeviceTypes enum [%d]. Going to return [UNKNOWN] as type (bdm)",deviceTypeEnum); + return "UNKNOWN"; + break; + } +} + +CDeviceTypes::DeviceTypesEnums CBoxeeDeviceManager::GetDeviceTypeAsEnum(CStdString deviceTypeStr) +{ + CStdString deviceTypeStrLower = deviceTypeStr; + deviceTypeStrLower.ToLower(); + + if(deviceTypeStrLower == DEVICE_TYPE_PHONE) + { + return CDeviceTypes::BDT_PHONE; + } + else if(deviceTypeStrLower == DEVICE_TYPE_TABLET) + { + return CDeviceTypes::BDT_TABLET; + } + else if(deviceTypeStrLower == DEVICE_TYPE_REMOTE) + { + return CDeviceTypes::BDT_REMOTE; + } + else if(deviceTypeStrLower == DEVICE_TYPE_OTHER) + { + return CDeviceTypes::BDT_OTHER; + } + else + { + CLog::Log(LOGDEBUG,"CBoxeeDeviceManager::GetDeviceTypeAsEnum - Failed to convert [deviceTypeStr=%s] to ENUM. Going to return [UNKNOWN] (bdm)",deviceTypeStr.c_str()); + return CDeviceTypes::BDT_UNKNOWN; + } +} + +const std::map& CBoxeeDeviceManager::GetPairedDeviceMap() +{ + return m_pairedDeviceMap; +} + +bool CBoxeeDeviceManager::Save() +{ + TiXmlDocument xmlDoc; + TiXmlElement xmlRootElement("devices"); + TiXmlNode *pRoot = xmlDoc.InsertEndChild(xmlRootElement); + if (!pRoot) return false; + + std::map::iterator it; + + for (it = m_pairedDeviceMap.begin(); it != m_pairedDeviceMap.end(); ++it) + { + TiXmlElement deviceElement("device"); + it->second.ToXML(deviceElement); + pRoot->InsertEndChild(deviceElement); + } + + CStdString strPath = _P(DEVICES_FILE); + return xmlDoc.SaveFile(strPath); +} + +CBoxeeDeviceItem::CBoxeeDeviceItem() +{ + Reset(); +} + +CBoxeeDeviceItem::~CBoxeeDeviceItem() +{ + +} + +bool CBoxeeDeviceItem::Initialize(const CStdString& deviceId, const CStdString& deviceLabel, const CStdString& deviceType, const CStdString& deviceIcon, const CStdString& applicationId) +{ + m_isInitialize = false; + + SetDeviceId(deviceId); + SetDeviceLabel(deviceLabel); + + if (!SetDeviceType(deviceType)) + { + CLog::Log(LOGERROR,"CBoxeeDeviceItem::initialize - FAILED to set DeviceType with unknown [DeviceType=%s] (bdm)",deviceType.c_str()); + return false; + } + + SetDeviceIcon(deviceIcon); + + if (!SetApplicationId(applicationId)) + { + CLog::Log(LOGERROR,"CBoxeeDeviceItem::initialize - FAILED to set ApplicationId with unknown [ApplicationId=%s] (bdm)",applicationId.c_str()); + return false; + } + + m_isInitialize = true; + + return true; +} + +bool CBoxeeDeviceItem::FromXML(const TiXmlElement* deviceElement) +{ + const char* id = deviceElement->Attribute("id"); + if (!id) + { + CLog::Log(LOGERROR,"CBoxeeDeviceItem::initialize - FAILED to get attr id (bdm)"); + return false; + } + + const char* label = deviceElement->Attribute("label"); + if (!label) + { + CLog::Log(LOGERROR,"CBoxeeDeviceItem::initialize - FAILED to get attr label (bdm)"); + return false; + } + + const char* type = deviceElement->Attribute("type"); + if (!type) + { + CLog::Log(LOGERROR,"CBoxeeDeviceItem::initialize - FAILED to get attr type (bdm)"); + return false; + } + + const char* icon = deviceElement->Attribute("icon"); + if (!icon) + { + CLog::Log(LOGERROR,"CBoxeeDeviceItem::initialize - FAILED to get attr icon (bdm)"); + return false; + } + + const char* applicationId = deviceElement->Attribute("application-id"); + if (!applicationId) + { + CLog::Log(LOGERROR,"CBoxeeDeviceItem::initialize - FAILED to get attr applicationId (bdm)"); + return false; + } + + return Initialize(id, label, type, icon, applicationId); +} + +bool CBoxeeDeviceItem::ToXML(TiXmlElement& deviceElement) +{ + deviceElement.SetAttribute("id", GetDeviceId().c_str()); + deviceElement.SetAttribute("label", GetDeviceLabel().c_str()); + deviceElement.SetAttribute("type", GetDeviceTypeAsString().c_str()); + deviceElement.SetAttribute("icon", GetDeviceIcon().c_str()); + deviceElement.SetAttribute("application-id", GetApplicationId().c_str()); + + return true; +} + +bool CBoxeeDeviceItem::Reset() +{ + m_deviceId = ""; + m_deviceLabel = ""; + m_deviceType = CDeviceTypes::BDT_UNKNOWN; + m_deviceIcon = ""; + m_applicationId = ""; + + m_isInitialize = false; + + return true; +} + +bool CBoxeeDeviceItem::IsInitialize() +{ + return m_isInitialize; +} + +void CBoxeeDeviceItem::SetDeviceId(const CStdString& deviceId) +{ + m_deviceId = deviceId; +} + +CStdString CBoxeeDeviceItem::GetDeviceId() const +{ + return m_deviceId; +} + +void CBoxeeDeviceItem::SetDeviceLabel(const CStdString& deviceLabel) +{ + m_deviceLabel = deviceLabel; +} + +CStdString CBoxeeDeviceItem::GetDeviceLabel() const +{ + return m_deviceLabel; +} + +bool CBoxeeDeviceItem::SetDeviceType(const CStdString& deviceType) +{ + m_deviceType = CBoxeeDeviceManager::GetDeviceTypeAsEnum(deviceType); + + if (m_deviceType == CDeviceTypes::BDT_UNKNOWN) + { + return false; + } + + return true; +} + +CDeviceTypes::DeviceTypesEnums CBoxeeDeviceItem::GetDeviceTypeAsEnum() const +{ + return m_deviceType; +} + +CStdString CBoxeeDeviceItem::GetDeviceTypeAsString() const +{ + return CBoxeeDeviceManager::GetDeviceTypeAsString(m_deviceType); +} + +void CBoxeeDeviceItem::SetDeviceIcon(const CStdString& deviceIcon) +{ + m_deviceIcon = deviceIcon; +} + +CStdString CBoxeeDeviceItem::GetDeviceIcon() const +{ + return m_deviceIcon; +} + +bool CBoxeeDeviceItem::SetApplicationId(const CStdString& applicationId) +{ + m_applicationId = applicationId; + return true; +} + +CStdString CBoxeeDeviceItem::GetApplicationId() const +{ + return m_applicationId; +} + diff --git a/xbmc/BoxeeDeviceManager.h b/xbmc/BoxeeDeviceManager.h new file mode 100644 index 00000000..75ef7d69 --- /dev/null +++ b/xbmc/BoxeeDeviceManager.h @@ -0,0 +1,85 @@ +#pragma once + +#include "StdString.h" +#include "utils/CriticalSection.h" +#include +#include "tinyXML/tinyxml.h" + +class CDeviceTypes +{ +public: + enum DeviceTypesEnums + { + BDT_UNKNOWN = 0, + BDT_TABLET = 1, + BDT_PHONE = 2, + BDT_REMOTE = 3, + BDT_OTHER = 4 + }; +}; + +class CBoxeeDeviceItem +{ +public: + + CBoxeeDeviceItem(); + virtual ~CBoxeeDeviceItem(); + + bool FromXML(const TiXmlElement* deviceElement); + bool ToXML(TiXmlElement& deviceElement); + + bool Initialize(const CStdString& deviceId, const CStdString& deviceLabel, const CStdString& deviceType, const CStdString& deviceIcon, const CStdString& applicationId); + bool Reset(); + + void SetDeviceId(const CStdString& deviceId); + CStdString GetDeviceId() const; + + void SetDeviceLabel(const CStdString& deviceLabel); + CStdString GetDeviceLabel() const; + + bool SetDeviceType(const CStdString& deviceType); + CDeviceTypes::DeviceTypesEnums GetDeviceTypeAsEnum() const; + CStdString GetDeviceTypeAsString() const; + + void SetDeviceIcon(const CStdString& deviceIcon); + CStdString GetDeviceIcon() const; + + bool SetApplicationId(const CStdString& applicationId); + CStdString GetApplicationId() const; + + bool IsInitialize(); + +protected: + + bool m_isInitialize; + + CStdString m_deviceId; + CStdString m_deviceLabel; + CDeviceTypes::DeviceTypesEnums m_deviceType; + CStdString m_deviceIcon; + CStdString m_applicationId; +}; + +class CBoxeeDeviceManager +{ +public: + CBoxeeDeviceManager(); + virtual ~CBoxeeDeviceManager(); + + bool Initialize(); + + bool PairDevice(const CBoxeeDeviceItem& deviceItem); + bool UnPairDevice(const CStdString& deviceId); + bool IsPairDevice(const CStdString& deviceId); + + const std::map& GetPairedDeviceMap(); + + static CStdString GetDeviceTypeAsString(CDeviceTypes::DeviceTypesEnums deviceTypeEnum); + static CDeviceTypes::DeviceTypesEnums GetDeviceTypeAsEnum(CStdString deviceTypeStr); + +protected: + bool PairDeviceInternal(const CBoxeeDeviceItem& deviceItem); + bool Save(); + std::map m_pairedDeviceMap; + CCriticalSection m_deviceMaplock; +}; diff --git a/xbmc/BoxeeHalServices.cpp b/xbmc/BoxeeHalServices.cpp new file mode 100644 index 00000000..2d9f1eed --- /dev/null +++ b/xbmc/BoxeeHalServices.cpp @@ -0,0 +1,964 @@ +#include "system.h" + +#ifdef HAS_BOXEE_HAL + +#include "BoxeeHalServices.h" +#include "json/reader.h" +#include "log.h" + +CBoxeeHalServices::CBoxeeHalServices() +{ + m_pRequest = new CBoxeeHalClient(); + m_pRequest->AddListener(this); +}; + +bool CBoxeeHalServices::GetJson(const std::string &strResponse, Json::Value &rootValue) +{ + Json::Reader reader; + + if (!reader.parse(strResponse, rootValue, false)) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + return true; +} + +bool CBoxeeHalServices::GetEthernetConfig(unsigned int nInstance, CHalEthernetConfig ðernetConfig) +{ + StringMap params; + std::string strRequest, strResponse; + + params.AddIntParameter("instance", nInstance); + if (!m_pRequest->SendRequest("ethernet", "GetConfig", ¶ms, strResponse)) + return false; + + Json::Reader reader; + Json::Value rootValue; + + if (!reader.parse(strResponse, rootValue, false)) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + ethernetConfig.addr_type = GetAddrType(rootValue["config"].asString()); + + if (ethernetConfig.addr_type != ADDR_STATIC) + return true; + + ethernetConfig.ip_address = rootValue["ipAddress"].asString(); + ethernetConfig.netmask = rootValue["netmask"].asString(); + ethernetConfig.gateway = rootValue["gateway"].asString(); + ethernetConfig.dns = rootValue["dns"].asString(); + return true; +} + +bool CBoxeeHalServices::SetEthernetConfig(unsigned int nInstance, const CHalEthernetConfig ðernetConfig) +{ + StringMap params; + std::string strRequest, strResponse; + + params.AddIntParameter("instance", nInstance); + params["config"] = GetAddrTypeStr(ethernetConfig.addr_type); + + if(ethernetConfig.addr_type == ADDR_STATIC) + { + params["ipAddress"] = ethernetConfig.ip_address; + params["netmask" ] = ethernetConfig.netmask; + params["gateway"] = ethernetConfig.gateway; + params["dns"] = ethernetConfig.dns; + } + + std::string response; + return m_pRequest->SendRequest("ethernet", "SetConfig", ¶ms, response); +} + +bool CBoxeeHalServices::EthernetInfoMapTranslate (const Json::Value &rootValue, CHalEthernetInfo ðernetInfo) +{ + ethernetInfo.addr_type = GetAddrType(rootValue["config"].asString()); + ethernetInfo.running= (rootValue["running"].asString() == "true"); + ethernetInfo.link_up = (rootValue["link-up"].asString() == "true"); + ethernetInfo.ip_address = rootValue["ipAddress"].asString(); + ethernetInfo.netmask = rootValue["netmask"].asString(); + ethernetInfo.gateway = rootValue["gateway"].asString(); + ethernetInfo.dns = rootValue["dns"].asString(); + ethernetInfo.mac_address = rootValue["macAddress"].asString(); + return true; +} + +bool CBoxeeHalServices::GetEthernetInfo(unsigned int nInstance, CHalEthernetInfo ðernetInfo) +{ + + StringMap params; + std::string strRequest, strResponse; + + params.AddIntParameter("instance", nInstance); + if (!m_pRequest->SendRequest("ethernet", "GetInfo", ¶ms, strResponse)) + return false; + Json::Reader reader; + Json::Value rootValue; + + if (!reader.parse(strResponse, rootValue, false)) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + return EthernetInfoMapTranslate(rootValue, ethernetInfo); +} + +// wireless +bool CBoxeeHalServices::GetWirelessConfig(unsigned int nInstance, CHalWirelessConfig& wirelessConfig) +{ + StringMap params; + std::string strRequest, strResponse; + + params.AddIntParameter("instance", nInstance); + if (!m_pRequest->SendRequest("wireless", "GetConfig", ¶ms, strResponse)) + return false; + + StringMap wirelessConfigMap; + + Json::Reader reader; + Json::Value rootValue; + + if (!reader.parse(strResponse, rootValue, false)) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + wirelessConfig.addr_type = GetAddrType(rootValue["config"].asString()); + wirelessConfig.ssid = rootValue["ssid"].asString(); + wirelessConfig.password = rootValue["key"].asString(); + + if (rootValue["auth"].asString() == "none") + wirelessConfig.authType = AUTH_NONE; + if (rootValue["auth"].asString() == "dontcare") + wirelessConfig.authType = AUTH_DONTCARE; + if (rootValue["auth"].asString() == "wep-key") + wirelessConfig.authType = AUTH_WEP_KEY; + if (rootValue["auth"].asString() == "wep-passphrase") + wirelessConfig.authType = AUTH_WEP_PASSPHRASE; + if (rootValue["auth"].asString() == "wpa-psk") + wirelessConfig.authType = AUTH_WPAPSK; + if (rootValue["auth"].asString() == "wpa2-psk") + wirelessConfig.authType = AUTH_WPA2PSK; + + if (wirelessConfig.addr_type != ADDR_STATIC) + return true; + + wirelessConfig.ip_address = rootValue["ipAddress"].asString(); + wirelessConfig.netmask = rootValue["netmask"].asString(); + wirelessConfig.gateway = rootValue["gateway"].asString(); + wirelessConfig.dns = rootValue["dns"].asString(); + + return true; +} + +std::string CBoxeeHalServices::GetAddrTypeStr (CHalAddrType AddrType) +{ + if (AddrType == ADDR_STATIC) + return "static"; + else if (AddrType == ADDR_DYNAMIC) + return "dhcp"; + else + return "none"; +} + +CHalAddrType CBoxeeHalServices::GetAddrType (const std::string &AddrTypeStr) +{ + if (AddrTypeStr == "static") + return ADDR_STATIC; + else if (AddrTypeStr == "dhcp") + return ADDR_DYNAMIC; + else + return ADDR_NONE; +} + +bool CBoxeeHalServices::SetWirelessConfig(unsigned int nInstance, CHalWirelessConfig& wirelessConfig) +{ + StringMap params; + std::string strRequest, strResponse; + + params.AddIntParameter("instance", nInstance); + params["config"] = GetAddrTypeStr(wirelessConfig.addr_type); + if (wirelessConfig.addr_type != ADDR_NONE) + { + params["ssid"] = wirelessConfig.ssid; + params["key"] = wirelessConfig.password; + switch (wirelessConfig.authType) + { + case AUTH_NONE: + params["auth"] = "none"; + break; + case AUTH_DONTCARE: + params["auth"] = "dontcare"; + break; + case AUTH_WEP_KEY: + params["auth"] = "wep-key"; + break; + case AUTH_WEP_PASSPHRASE: + params["auth"] = "wep-passphrase"; + break; + case AUTH_WPAPSK: + params["auth"] = "wpa-psk"; + break; + case AUTH_WPA2PSK: + params["auth"] = "wpa2-psk"; + break; + default: + return false; + } + + if (wirelessConfig.addr_type == ADDR_STATIC) + { + params["ipAddress"] = wirelessConfig.ip_address; + params["netmask" ] = wirelessConfig.netmask; + params["gateway"] = wirelessConfig.gateway; + params["dns"] = wirelessConfig.dns; + } + } + + return m_pRequest->SendRequest("wireless", "SetConfig", ¶ms , strResponse); +} + +bool CBoxeeHalServices::WirelessInfoMapTranslate (const Json::Value &rootValue, CHalWirelessInfo &wirelessInfo) +{ + wirelessInfo.ssid = rootValue["ssid"].asString(); + wirelessInfo.mac_address = rootValue["macAddress"].asString(); + wirelessInfo.connected = (rootValue["associated"].asString() == "true"); + wirelessInfo.addr_type = GetAddrType(rootValue["config"].asString()); + wirelessInfo.ip_address = rootValue["ipAddress"].asString(); + wirelessInfo.netmask = rootValue["netmask"].asString(); + wirelessInfo.gateway = rootValue["gateway"].asString(); + wirelessInfo.dns = rootValue["dns"].asString(); + return true; +} + +bool CBoxeeHalServices::GetWirelessInfo(unsigned int nInstance, CHalWirelessInfo& wirelessInfo) +{ + StringMap params; + std::string strRequest, strResponse; + + params.AddIntParameter("instance", nInstance); + if (!m_pRequest->SendRequest("wireless", "GetInfo", ¶ms ,strResponse)) + return false; + Json::Reader reader; + Json::Value rootValue; + + if (!reader.parse(strResponse, rootValue, false)) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + return WirelessInfoMapTranslate(rootValue, wirelessInfo); +} + +bool CBoxeeHalServices::SearchWireless(unsigned int nInstance, std::vector& vecWirelessNetworks) +{ + StringMap params; + std::string strRequest, strResponse; + + params.AddIntParameter("instance", nInstance); + if (!m_pRequest->SendRequest("wireless", "Scan", ¶ms ,strResponse)) + return false; + + Json::Reader reader; + Json::Value rootValue; + + if (!reader.parse(strResponse, rootValue, false)) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + if (!rootValue["networks"].isArray()) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + std::vector myVecWirelessNetworks; + + for (size_t i = 0; i < rootValue["networks"].size(); i++) + { + CHalWirelessNetwork wNetwork; + wNetwork.ssid = rootValue["networks"][i]["ssid"].asString(); + wNetwork.secure = rootValue["networks"][i]["secure"].asString() == "true"? true : false; + wNetwork.signal_strength = rootValue["networks"][i]["signal"].asInt(); + myVecWirelessNetworks.push_back(wNetwork); + CLog::Log(LOGDEBUG,"CBoxeeHalServices::SearchWireless - [%d/%d] - going to add [label=%s][secure=%d][signal=%lu] (ap)",i+1,rootValue["networks"].size(),wNetwork.ssid.c_str(),wNetwork.secure,wNetwork.signal_strength); + } + + vecWirelessNetworks = myVecWirelessNetworks; + + return true; +} + + // clock +bool CBoxeeHalServices::SetTimezone(const std::string& strTimezone) +{ + StringMap params; + std::string strRequest, strResponse; + + params["timezone"] = strTimezone; + return m_pRequest->SendRequest("clock", "SetTimezone", ¶ms, strResponse); +} + +bool CBoxeeHalServices::GetTimezone(std::string& strTimezone) +{ + StringMap params, storageShareMap; + std::string strRequest, strResponse; + + if (!m_pRequest->SendRequest("clock", "GetTimeZone", ¶ms, strResponse)) + return false; + + Json::Value rootValue; + if (!GetJson(strResponse, rootValue)) + return false; + + strTimezone = rootValue["timezone"].asString(); + + return true; +} + +bool CBoxeeHalServices::SetTime(const std::string& strTime) +{ + StringMap params; + std::string strRequest, strResponse; + + params["time"] = strTime; + return m_pRequest->SendRequest("clock", "SetTime", ¶ms, strResponse); +} + +// power +bool CBoxeeHalServices::StandBy() +{ + std::string strRequest, strResponse; + + return m_pRequest->SendRequest("power", "Standby", NULL, strResponse); +} + +bool CBoxeeHalServices::Resume() +{ + std::string strRequest, strResponse; + + return m_pRequest->SendRequest("power", "Resume", NULL, strResponse); +} + +bool CBoxeeHalServices::Shutdown() +{ + std::string strRequest, strResponse; + + return m_pRequest->SendRequest("power", "Shutdown", NULL, strResponse); +} + +bool CBoxeeHalServices::Reboot() +{ + std::string strRequest, strResponse; + + return m_pRequest->SendRequest("power", "Reboot", NULL, strResponse); +} + +// input +bool CBoxeeHalServices::GetAllInputDevices(std::vector& inputDevices) +{ + std::string strResponse; + + if (!m_pRequest->SendRequest("input", "GetAllDevices", NULL, strResponse)) + return false; + + Json::Reader reader; + Json::Value rootValue; + + if (!reader.parse(strResponse, rootValue, false)) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + if (!rootValue["devices"].isArray()) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + inputDevices.clear(); + + for (size_t i = 0; i < rootValue["devices"].size(); i++) + { + CHalInputDevice inputDevice; + + inputDevice.instance = rootValue["devices"][i]["instance"].asInt(); + inputDevice.path = rootValue["devices"][i]["path"].asString(); + inputDevice.label = rootValue["devices"][i]["label"].asString(); + inputDevices.push_back(inputDevice); + } + + return true; +} + +// dvb +bool CBoxeeHalServices::GetAllDvbDevices(std::vector& dvbDevices) +{ + std::string strResponse; + + if (!m_pRequest->SendRequest("dvb", "GetAllDevices", NULL, strResponse)) + return false; + + Json::Reader reader; + Json::Value rootValue; + + if (!reader.parse(strResponse, rootValue, false)) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + if (!rootValue["devices"].isArray()) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + dvbDevices.clear(); + + for (size_t i = 0; i < rootValue["devices"].size(); i++) + { + CHalDvbDevice dvbDevice; + + dvbDevice.instance = rootValue["devices"][i]["instance"].asInt(); + dvbDevice.path = rootValue["devices"][i]["path"].asString(); + dvbDevice.ready = rootValue["devices"][i]["ready"].asBool(); + dvbDevice.connected = rootValue["devices"][i]["connected"].asBool(); + + dvbDevices.push_back(dvbDevice); + } + + return true; +} +// storage +bool CBoxeeHalServices::GetAllStorageDevices(std::vector & storageDevices) +{ + std::string strRequest, strResponse; + StringMapVector devicesMap ; + + if (!m_pRequest->SendRequest("storage", "GetAllDevices", NULL, strResponse)) + return false; + +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGINFO, "reply for storage.GetAllDevices - %s\n", strResponse.c_str()); +#endif + Json::Reader reader; + Json::Value rootValue; + + if (!reader.parse(strResponse, rootValue, false)) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + if (!rootValue["devices"].isArray()) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + storageDevices.clear(); + + for (size_t i = 0; i < rootValue["devices"].size(); i++) + { + CHalStorageDeviceInfo storageDevice; + + storageDevice.fs_type = rootValue["devices"][i]["fstype"].asString(); + storageDevice.path = rootValue["devices"][i]["path"].asString(); + storageDevice.label = rootValue["devices"][i]["label"].asString(); + storageDevices.push_back(storageDevice); + } + + return true; +} + +bool CBoxeeHalServices::EnableSambaShares(const std::string password, const std::string username, const std::string workgroup, const std::string hostname) +{ + StringMap params; + std::string strRequest, strResponse; + + params["password"] = password; + + if(!username.empty()) + params["username" ] = username; + + if(!workgroup.empty()) + params["workgroup" ] = workgroup; + + if(!hostname.empty()) + params["hostname" ] = hostname; + + return m_pRequest->SendRequest("storage", "EnableSambaShares", ¶ms, strResponse); +} + +bool CBoxeeHalServices::DisableSambaShares() +{ + StringMap params, storageShareMap; + std::string strResponse; + + return m_pRequest->SendRequest("storage", "DisableSambaShares", ¶ms, strResponse); +} + +bool CBoxeeHalServices::GetSambaConfig(bool &status, std::string &password, std::string &workgroup, std::string &hostname) +{ + StringMap params, storageShareMap; + std::string strRequest, strResponse; + + if (!m_pRequest->SendRequest("storage", "GetSambaConfig", ¶ms, strResponse)) + return false; + + Json::Value rootValue; + if (!GetJson(strResponse, rootValue)) + return false; + + password = rootValue["password"].asString(); + workgroup = rootValue["workgroup"].asString(); + hostname= rootValue["hostname"].asString(); + status = rootValue["status"].asUInt(); + + return true; +} + +bool CBoxeeHalServices::EjectStorage(const std::string& path) +{ + StringMap params; + std::string strRequest, strResponse; + + params["path"] = path; + return m_pRequest->SendRequest("storage", "Eject", ¶ms, strResponse); +} + +// host +bool CBoxeeHalServices::SetHostName(const std::string& strHostname) +{ + StringMap params; + std::string strRequest, strResponse; + + params["hostname"] = strHostname; + return m_pRequest->SendRequest("host", "SetHostName", ¶ms, strResponse); +} + +bool CBoxeeHalServices::GetHostName(std::string& strHostname) +{ + StringMap params, storageShareMap; + std::string strRequest, strResponse; + + if (!m_pRequest->SendRequest("host", "GetHostName", ¶ms, strResponse)) + return false; + + Json::Value rootValue; + if (!GetJson(strResponse, rootValue)) + return false; + + strHostname = rootValue["hostname"].asString(); + + return true; +} + +bool CBoxeeHalServices::SetLEDState(bool isPlaying, bool isConnectedToInternet, bool isPowerSaving) +{ + StringMap params; + std::string strRequest, strResponse; + + params.AddIntParameter("playing", isPlaying); + params.AddIntParameter("connected", isConnectedToInternet); + params.AddIntParameter("powersaving", isPowerSaving); + + return m_pRequest->SendRequest("led", "SetState", ¶ms, strResponse); +} + +// led +bool CBoxeeHalServices::SetLEDBrightness(int instance, int startBrightness, int endBrightness) +{ + StringMap params; + std::string strRequest, strResponse; + + params.AddIntParameter("instance", instance); + params.AddIntParameter("startBrightness", startBrightness); + params.AddIntParameter("endBrightness", endBrightness); + + return m_pRequest->SendRequest("led", "SetBrightness", ¶ms, strResponse); +} + +// thermals +bool CBoxeeHalServices::GetCPUTemperature(int& temperature) +{ + StringMap params, storageShareMap; + std::string strRequest, strResponse; + + if (!m_pRequest->SendRequest("system", "GetCPUTemperature", ¶ms, strResponse)) + return false; + + Json::Value rootValue; + if (!GetJson(strResponse, rootValue)) + return false; + + temperature = rootValue["temperature"].asInt(); + + return true; +} + +bool CBoxeeHalServices::GetCPUFanSpeed(int& speed) +{ + StringMap params, storageShareMap; + std::string strRequest, strResponse; + + if (!m_pRequest->SendRequest("system", "GetCPUFanSpeed", ¶ms, strResponse)) + return false; + + Json::Value rootValue; + if (!GetJson(strResponse, rootValue)) + return false; + + speed = rootValue["speed"].asInt(); + + return true; +} + +CBoxeeHalServices& CBoxeeHalServices::GetInstance() +{ + static CBoxeeHalServices halServices; + + return halServices; +} + +bool CBoxeeHalServices::Notify(const std::string& notificationStr) +{ + Json::Reader reader; + Json::Value rootValue; + + if (!reader.parse(notificationStr, rootValue, false)) + { +#ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); +#endif + return false; + } + + NOTIFICATION_TYPE type = NO_NOTIFICATION; + CLog::Log(LOGINFO, "notification string '%s'\n", notificationStr.c_str()); + if (rootValue["class"] == "ethernet" && (rootValue["notification"] == "LinkUp" || rootValue["notification"] == "LinkDown")) + return NotifyEthernetLinkState (rootValue); + if (rootValue["class"] == "ethernet" && rootValue["notification"] == "AddressChange") + return NotifyEthernetAddress (rootValue); + if (rootValue["class"] == "wireless" && (rootValue["notification"] == "LinkUp" || rootValue["notification"] == "LinkDown")) + return NotifyWirelessLinkState (rootValue); + if (rootValue["class"] == "wireless" && rootValue["notification"] == "AddressChange") + return NotifyWirelessAddress (rootValue); + else if (rootValue["class"] == "power") + type = NOTIFY_POWER; + else if (rootValue["class"] == "input") + { + std::string label = rootValue["label"].asString(); + std::string path = rootValue["path"].asString(); + CHalInputNotification halInputNotification(rootValue["notification"].asString() == "Connect", + atoi(rootValue["instance"].asString().c_str()), label, path); + + for (size_t i = 0; i < m_halListeners.size(); i++) + m_halListeners[i]->HandleNotification(halInputNotification); + } + else if (rootValue["class"] == "storage") + { + std::string path = rootValue["path"].asString(); + bool successfully = true; + if (!rootValue["successfully"].isNull()) + successfully = rootValue["successfully"].asUInt(); + CHalStorageNotification halStorageNotification(rootValue["notification"].asString() == "Mount", path, successfully); + for (size_t i = 0; i < m_halListeners.size(); i++) + m_halListeners[i]->HandleNotification(halStorageNotification); + } + else if (rootValue["class"] == "vpn") + { + CHalVpnNotification halVpnNotification(rootValue["status"].asInt()); + for (size_t i = 0; i < m_halListeners.size(); i++) + m_halListeners[i]->HandleNotification(halVpnNotification); + } + else if (rootValue["class"] == "dvb") + { + CHalDvbNotification halDvbNotification( + rootValue["notification"].asString() == "Connect" || rootValue["notification"].asString() == "Ready", + rootValue["notification"].asString() == "Ready", + rootValue["adapter"].asInt(), rootValue["path"].asString()); + for (size_t i = 0; i < m_halListeners.size(); i++) + m_halListeners[i]->HandleNotification(halDvbNotification); + } + + return true; +} + +bool CBoxeeHalServices::NotifyEthernetLinkState(const Json::Value &rootValue) +{ + bool linkUp = rootValue["notification"].asString() == "LinkUp" ? true : false; + CHalEthernetLinkStateNotification eNotify(linkUp); + for (size_t i = 0; i < m_halListeners.size(); i++) + m_halListeners[i]->HandleNotification(eNotify); + return true; +} + +bool CBoxeeHalServices::NotifyEthernetAddress(const Json::Value &rootValue) +{ + CHalEthernetInfo ethernetInfo; +// EthernetInfoMapTranslate (map, ethernetInfo); + CHalEthernetAddressNotification eNotify(ethernetInfo); + for (size_t i = 0; i < m_halListeners.size(); i++) + m_halListeners[i]->HandleNotification(eNotify); + return true; +} + +bool CBoxeeHalServices::NotifyWirelessLinkState(const Json::Value &rootValue) +{ + bool linkUp = rootValue["notification"].asString() == "LinkUp" ? true : false; + CHalEthernetLinkStateNotification wNotify(linkUp); + for (size_t i = 0; i < m_halListeners.size(); i++) + m_halListeners[i]->HandleNotification(wNotify); + return true; +} + +bool CBoxeeHalServices::NotifyWirelessAddress(const Json::Value &rootValue) +{ + CHalWirelessInfo wirelessInfo; + WirelessInfoMapTranslate (rootValue, wirelessInfo); + CHalWirelessAddressNotification wNotify(wirelessInfo); + for (size_t i = 0; i < m_halListeners.size(); i++) + m_halListeners[i]->HandleNotification(wNotify); + return true; +} + +// system +bool CBoxeeHalServices::GetHardwareInfo(CHalHardwareInfo& hardwareInfo) +{ + StringMap params, storageShareMap; + std::string strRequest, strResponse; + + if (!m_pRequest->SendRequest("system", "GetHardwareInfo", ¶ms, strResponse)) + return false; + + Json::Value rootValue; + if (!GetJson(strResponse, rootValue)) + return false; + + hardwareInfo.model = rootValue["model"].asString(); + hardwareInfo.vendor = rootValue["vendor"].asString(); + hardwareInfo.revision = rootValue["revision"].asString(); + hardwareInfo.serialNumber = rootValue["serialNumber"].asString(); + hardwareInfo.uniqueId = rootValue["uniqueId"].asString(); + + return true; +} + +bool CBoxeeHalServices::GetSoftwareInfo(CHalSoftwareInfo& softwareInfo) +{ + StringMap params, storageShareMap; + std::string strRequest, strResponse; + + if (!m_pRequest->SendRequest("system", "GetSoftwareInfo", ¶ms, strResponse)) + return false; + + Json::Value rootValue; + if (!GetJson(strResponse, rootValue)) + return false; + + softwareInfo.version = rootValue["version"].asString(); + softwareInfo.regionSKU = rootValue["regionSKU"].asString(); + softwareInfo.language = rootValue["language"].asString(); + if (rootValue["compositeVideo"].isNull()) + { + softwareInfo.compositeVideo = "none"; + } + else + { + softwareInfo.compositeVideo = rootValue["compositeVideo"].asString(); + } + + return true; +} + +bool CBoxeeHalServices::RequestUpgrade() +{ + StringMap params; + std::string strRequest, strResponse; + + return m_pRequest->SendRequest("system", "RequestUpgrade", ¶ms, strResponse); +} + +bool CBoxeeHalServices::SetAudioDACState(bool mute) +{ + StringMap params; + std::string strRequest, strResponse; + + params["mute"] = mute ? "true" : "false"; + return m_pRequest->SendRequest("system", "SetAudioDACState", ¶ms, strResponse); +} + +bool CBoxeeHalServices::AvahiDaemonRestart() +{ + StringMap params; + std::string strRequest, strResponse; + + return m_pRequest->SendRequest("system", "AvahiDaemonRestart", ¶ms, strResponse); +} + +bool CBoxeeHalServices::DjmountRestart() +{ + StringMap params; + std::string strRequest, strResponse; + + return m_pRequest->SendRequest("system", "DjmountRestart", ¶ms, strResponse); +} + +//vpn +bool CBoxeeHalServices::VpnSetConfig(const CHALVpnConfig &vpnConfig) +{ + StringMap params; + std::string strRequest, strResponse; + + params["host"] = vpnConfig.host; + params["username"] = vpnConfig.username; + params["password"] = vpnConfig.password; + if (vpnConfig.encType == CHalVpnMppeAuto) + params["encryption"] = "auto"; + else if (vpnConfig.encType == CHalVpnMppeForce) + params["encryption"] = "force"; + return m_pRequest->SendRequest("vpn", "Config", ¶ms, strResponse); +} + +bool CBoxeeHalServices::VpnDial() +{ + StringMap params; + std::string strRequest, strResponse; + if (!m_pRequest->SendRequest("vpn", "Dial", ¶ms, strResponse)) + { + CLog::Log(LOGERROR, "CBoxeeHalServices::VpnDial failed to send request"); + return false; + } + + Json::Reader reader; + Json::Value rootValue; + + if (!reader.parse(strResponse, rootValue, false)) + { + #ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); + #endif + return false; + } + + if (!rootValue["errorCode"].empty() && + rootValue["errorCode"].asString() != "0") { + CLog::Log(LOGERROR, "CBoxeeHalServices::VpnDial failed with error code %s", rootValue["errorCode"].asString().c_str()); + return false; + } + CLog::Log(LOGDEBUG, "CBoxeeHalServices::VpnDial succeeded"); + return true; + + +} + +bool CBoxeeHalServices::VpnHangup() +{ + StringMap params; + std::string strRequest, strResponse; + if (!m_pRequest->SendRequest("vpn", "Hangup", ¶ms, strResponse)) + { + CLog::Log(LOGERROR, "CBoxeeHalServices::VpnHangup failed to send request"); + return false; + } + + Json::Reader reader; + Json::Value rootValue; + + if (!reader.parse(strResponse, rootValue, false)) + { + #ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); + #endif + return false; + } + + if (!rootValue["errorCode"].empty() && + rootValue["errorCode"].asString() != "0") { + CLog::Log(LOGERROR, "CBoxeeHalServices::VpnHangup failed with error code %s", rootValue["errorCode"].asString().c_str()); + return false; + } + CLog::Log(LOGDEBUG, "CBoxeeHalServices::VpnHangup succeeded"); + return true; +} + +bool CBoxeeHalServices::VpnGetInfo(CHALVpnInfo &vpnInfo) +{ + StringMap params; + std::string strRequest, strResponse; + if (!m_pRequest->SendRequest("vpn", "GetInfo", ¶ms, strResponse)) + return false; + + Json::Reader reader; + Json::Value rootValue; + + if (!reader.parse(strResponse, rootValue, false)) + { + #ifndef BOXEE_STANDALONE_HAL_CLIENT + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); + #endif + return false; + } + + vpnInfo.host = rootValue["host"].asString(); + vpnInfo.username = rootValue["username"].asString(); + vpnInfo.password = rootValue["password"].asString(); + vpnInfo.encType = (rootValue["encryption"].asString() == "force"? CHalVpnMppeForce : CHalVpnMppeAuto); + vpnInfo.tunnelType = CHalVpnPPTP; + if (rootValue["vpnStatus"].asString() == "Connected") + vpnInfo.status = CHalVpnConnected; + else if (rootValue["vpnStatus"].asString() == "Disconnected") + vpnInfo.status = CHalVpnDisconnected; + else if (rootValue["vpnStatus"].asString() == "Disabled") + vpnInfo.status = CHalVpnDisabled; + else + return false; + + return true; +} + +bool CBoxeeHalServices::VpnGetConfig(CHALVpnConfig &vpnConfig) +{ + return true; +} + +#endif diff --git a/xbmc/BoxeeHalServices.h b/xbmc/BoxeeHalServices.h new file mode 100644 index 00000000..692fd745 --- /dev/null +++ b/xbmc/BoxeeHalServices.h @@ -0,0 +1,104 @@ +#ifndef BOXEE_HAL_SERVICES +#define BOXEE_HAL_SERVICES + +#include "system.h" + +#ifdef HAS_BOXEE_HAL + +#include "xbmc/lib/libBoxeeHalClient/BoxeeHalClient.h" +#include "HalServices.h" +#include +#include +#include "json/reader.h" + +class CBoxeeHalServices : public IHalServices, CBoxeeHalClientListener +{ +public: + static CBoxeeHalServices &GetInstance(); + virtual bool GetEthernetConfig(unsigned int nInstance, CHalEthernetConfig ðernetConfig); + virtual bool SetEthernetConfig(unsigned int nInstance, const CHalEthernetConfig ðernetDevice); + virtual bool GetEthernetInfo(unsigned int nInstance, CHalEthernetInfo ðDevice); + + // wireless + virtual bool GetWirelessConfig(unsigned int nInstance, CHalWirelessConfig& wirelessDevice); + virtual bool SetWirelessConfig(unsigned int nInstance, CHalWirelessConfig& wirelessDevice); + virtual bool GetWirelessInfo(unsigned int nInstance, CHalWirelessInfo& wirelessDevice); + virtual bool SearchWireless(unsigned int nInstance, std::vector& wirelessNetworks); + + // clock + virtual bool SetTimezone(const std::string& strTimezone); + virtual bool GetTimezone(std::string& strTimezone); + virtual bool SetTime(const std::string& strTime); + + // power + virtual bool StandBy(); + virtual bool Shutdown(); + virtual bool Reboot(); + virtual bool Resume(); + + // input + virtual bool GetAllInputDevices(std::vector& inputDevices); + + // dvb + virtual bool GetAllDvbDevices(std::vector& dvbDevices); + + // storage + virtual bool GetAllStorageDevices(std::vector & storageDevicesInfo); + virtual bool EnableSambaShares(const std::string password, const std::string username = "", const std::string workgroup = "", const std::string hostname = ""); + virtual bool DisableSambaShares(); + virtual bool GetSambaConfig(bool &status, std::string &password, std::string &workgroup, std::string &hostname); + virtual bool EjectStorage(const std::string& path); + + // host + virtual bool SetHostName(const std::string& strHostname); + virtual bool GetHostName(std::string& strHostname); + + // led + virtual bool SetLEDBrightness(int instance, int startBrightness, int endBrightness); + virtual bool SetLEDState(bool isPlaying, bool isConnectedToInternet, bool isPowerSaving); + + // thermals + virtual bool GetCPUTemperature(int& temperature); + virtual bool GetCPUFanSpeed(int& speed); + + virtual void AddListener(IHalListener *listener) { m_halListeners.push_back(listener); } + + // system + virtual bool GetHardwareInfo(CHalHardwareInfo& hardwareInfo); + virtual bool GetSoftwareInfo(CHalSoftwareInfo& softwareInfo); + virtual bool RequestUpgrade(); + virtual bool SetAudioDACState(bool mute); + virtual bool Notify(const std::string& notificationStr); + virtual bool AvahiDaemonRestart(); + virtual bool DjmountRestart(); + + //vpn + virtual bool VpnSetConfig(const CHALVpnConfig &vpnConfig); + virtual bool VpnDial(); + virtual bool VpnHangup(); + virtual bool VpnGetInfo(CHALVpnInfo &vpnInfo); + virtual bool VpnGetConfig(CHALVpnConfig &vpnConfig); + +private: + std::vector m_halListeners; + + CBoxeeHalServices(); + CHalAddrType GetAddrType (const std::string &AddrTypeStr); + + std::string GetAddrTypeStr (CHalAddrType addrType); + CBoxeeHalClient* m_pRequest; + + bool NotifyEthernetLinkState (const Json::Value &rootValue); + bool NotifyEthernetAddress (const Json::Value &rootValue); + bool NotifyWirelessLinkState (const Json::Value &rootValue); + bool NotifyWirelessAddress (const Json::Value &rootValue); + + bool EthernetInfoMapTranslate (const Json::Value &rootValue, CHalEthernetInfo ðernetInfo); + bool WirelessInfoMapTranslate (const Json::Value &rootValue, CHalWirelessInfo &wirelessInfo); + + bool GetJson(const std::string &strResponse, Json::Value &rootValue); +}; + +#endif + +#endif diff --git a/xbmc/BoxeeHalStorageProvider.cpp b/xbmc/BoxeeHalStorageProvider.cpp new file mode 100644 index 00000000..10a05c31 --- /dev/null +++ b/xbmc/BoxeeHalStorageProvider.cpp @@ -0,0 +1,95 @@ +#include "system.h" +#include "Application.h" +#include "guilib/LocalizeStrings.h" + +#ifdef HAS_BOXEE_HAL + +#include "BoxeeHalStorageProvider.h" +#include "HalServices.h" + +CBoxeeHalStorageProvider::CBoxeeHalStorageProvider() +{ + m_isDirty = true; + CHalServicesFactory::GetInstance().AddListener(this); + PumpDriveChangeEvents(); + m_changeOccured = false; +} + +void CBoxeeHalStorageProvider::GetDrives(VECSOURCES &drives) +{ + std::vector result; + + if (m_isDirty) + { + GetDrivesFromHal(m_drives); + m_isDirty = false; + } + + drives.insert(drives.end(), m_drives.begin(), m_drives.end()); +} + +void CBoxeeHalStorageProvider::GetDrivesFromHal(VECSOURCES &drives) +{ + std::vector devices; + CHalServicesFactory::GetInstance().GetAllStorageDevices(devices); + + drives.clear(); + for (size_t i = 0; i < devices.size(); i++) + { + CMediaSource share; + share.strPath = devices[i].path; + if (devices[i].label == "") + share.strName = g_localizeStrings.Get(51363); + else + share.strName = devices[i].label; + share.m_ignore = true; + if (devices[i].dev_type == "usb") + share.m_localSourceType = CMediaSource::LOCAL_SOURCE_TYPE_USB; + else if (devices[i].dev_type == "sd") + share.m_localSourceType = CMediaSource::LOCAL_SOURCE_TYPE_SD; + else if (devices[i].dev_type == "internal_hd") + share.m_localSourceType = CMediaSource::LOCAL_SOURCE_TYPE_INTERNAL_HD; + drives.push_back(share); + } +} + +std::vector CBoxeeHalStorageProvider::GetDiskUsage() +{ + std::vector result; + return result; +} + +bool CBoxeeHalStorageProvider::PumpDriveChangeEvents() +{ + bool result = m_changeOccured; + m_changeOccured = false; + return result; +} + +void CBoxeeHalStorageProvider::GetRemovableDrives(VECSOURCES &removableDrives) +{ + GetDrives(removableDrives); +} + +void CBoxeeHalStorageProvider::HandleNotification(CHalNotification ¬ification) +{ + if (notification.GetType() == HAL_NOTIFY_STORAGE) + { + m_changeOccured = true; + CHalStorageNotification storageNotification = (CHalStorageNotification &)notification; + uint32_t dwCode; + if (storageNotification.IsMounted()) + dwCode = 13026; + else { + if (storageNotification.IsSuccessful()) + dwCode = 13027; + else + dwCode = 13028; + } + g_application.m_guiDialogKaiToast.QueueNotification("", "", g_localizeStrings.Get(dwCode), 5000); + + m_isDirty = true; + } +} + +#endif diff --git a/xbmc/BoxeeHalStorageProvider.h b/xbmc/BoxeeHalStorageProvider.h new file mode 100644 index 00000000..94815534 --- /dev/null +++ b/xbmc/BoxeeHalStorageProvider.h @@ -0,0 +1,34 @@ +#pragma once + +#include "system.h" + +#ifdef HAS_BOXEE_HAL + +#include "IStorageProvider.h" +#include "HalServices.h" + +class CBoxeeHalStorageProvider: public IStorageProvider, public IHalListener +{ +public: + CBoxeeHalStorageProvider(); + virtual ~CBoxeeHalStorageProvider() { } + + virtual void GetLocalDrives(VECSOURCES &localDrives) { GetDrives(localDrives); } + virtual void GetRemovableDrives(VECSOURCES &removableDrives); + + virtual std::vector GetDiskUsage(); + + virtual bool PumpDriveChangeEvents(); + + virtual void HandleNotification(CHalNotification ¬ification); + +private: + void GetDrives(VECSOURCES &drives); + void GetDrivesFromHal(VECSOURCES &drives); + bool m_changeOccured; + bool m_isDirty; + VECSOURCES m_drives; +}; + +#endif + diff --git a/xbmc/BoxeeLoginWizardManager.cpp b/xbmc/BoxeeLoginWizardManager.cpp new file mode 100644 index 00000000..81ca1297 --- /dev/null +++ b/xbmc/BoxeeLoginWizardManager.cpp @@ -0,0 +1,433 @@ +#include "BoxeeLoginWizardManager.h" +#include "GUIWindowManager.h" +#include "GUIDialogBoxeeWizardBase.h" +#include "utils/log.h" +#include "BoxeeUtils.h" +#include "LocalizeStrings.h" +#include "GUIDialogBoxeeLoggingIn.h" +#include "BoxeeLoginManager.h" +#include "Application.h" +#include "GUIDialogOK2.h" +#include "GUIDialogYesNo2.h" +#include "GUIWindowSettingsScreenSimpleCalibration.h" +#include "FileCurl.h" +#include "GUIDialogBoxeeLoginWizardChooseUserToAddType.h" +#include "GUIDialogBoxeeLoginWizardAddExistingUser.h" +#include "GUIDialogBoxeeLoginWizardAddNewUser.h" +#include "GUIDialogBoxeeLoginWizardNewUserDetails.h" + +CBoxeeLoginWizardManager::CBoxeeLoginWizardManager() : CBoxeeSimpleDialogWizardManager() +{ + +} + +CBoxeeLoginWizardManager::~CBoxeeLoginWizardManager() +{ + +} + +CBoxeeLoginWizardManager& CBoxeeLoginWizardManager::GetInstance() +{ + static CBoxeeLoginWizardManager boxeeLoginWizardManager; + return boxeeLoginWizardManager; +} + +bool CBoxeeLoginWizardManager::RunWizard(bool shouldEndWizardOnEmptyStack) +{ + m_serverUserInfo.Reset(); + m_isAddingNewUser = false; + + if (Run(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_CHOOSE_USER_TO_ADD, shouldEndWizardOnEmptyStack)) + { + return true; + } + + return false; +} + +CGUIDialogBoxeeWizardBase* CBoxeeLoginWizardManager::HandleNextAction(CGUIDialogBoxeeWizardBase* pDialog, bool& addCurrentDlgToStack) +{ + if (!pDialog) + { + CLog::Log(LOGERROR,"CBoxeeLoginWizardManager::HandleNextAction - Enter function with a NULL pointer (blw)(digwiz)"); + return NULL; + } + + int id = pDialog->GetID(); + + CLog::Log(LOGDEBUG,"CBoxeeLoginWizardManager::HandleNextAction - Enter function with [id=%d] (blw)(digwiz)",id); + + CGUIDialogBoxeeWizardBase* pNextDialog = NULL; + + switch(id) + { + case WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_CHOOSE_USER_TO_ADD: + { + CGUIDialogBoxeeLoginWizardChooseUserToAddType* pAddUserDlg = (CGUIDialogBoxeeLoginWizardChooseUserToAddType*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_CHOOSE_USER_TO_ADD); + if (!pAddUserDlg) + { + CLog::Log(LOGERROR,"CBoxeeLoginWizardManager::HandleNextAction - FAILED to get DialogBoxeeLoginWizardAddUser (blw)(digwiz)"); + break; + } + + m_isAddingNewUser = pAddUserDlg->IsAddingNewUser(); + + if (m_isAddingNewUser) + { + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_ADD_NEW_USER); + CLog::Log(LOGDEBUG,"CBoxeeLoginWizardManager::HandleNextAction - IsAddingNewUser returned TRUE. Set next dialog to ADD_NEW_USER. [isAddingNewUser=%d=TRUE] (blw)(digwiz)",m_isAddingNewUser); + } + else + { + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_ADD_EXISTING_USER); + CLog::Log(LOGDEBUG,"CBoxeeLoginWizardManager::HandleNextAction - IsAddingNewUser returned FALSE. Set next dialog to ADD_EXISTING_USER. [isAddingNewUser=%d=FALSE] (blw)(digwiz)",m_isAddingNewUser); + } + + IsAddingDialogToStack(pNextDialog,addCurrentDlgToStack); + } + break; + case WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_ADD_EXISTING_USER: + { + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_MENU_CUST); + } + break; + case WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_ADD_NEW_USER: + { + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_NEW_USER_DETAILS); + } + break; + case WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_NEW_USER_DETAILS: + { + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_TOU); + } + break; + case WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_TOU: + { +#ifdef HAS_EMBEDDED + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_CONNECT_SOCIAL_SERVICES); +#else + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_MENU_CUST); +#endif + } + break; + case WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_CONNECT_SOCIAL_SERVICES: + { + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_MENU_CUST); + } + break; + case WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_MENU_CUST: + { + if (m_isAddingNewUser) + { + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_CONFIRMATION); + } + else + { +#ifdef HAS_EMBEDDED + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_QUICK_TIP_AIRPLAY); +#else + SetWizardComplete(true); +#endif + } + } + break; + case WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_CONFIRMATION: + { +#ifdef HAS_EMBEDDED + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_QUICK_TIP_AIRPLAY); +#else + SetWizardComplete(true); +#endif + } + break; + case WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_QUICK_TIP_AIRPLAY: + { + if (strcmpi(BoxeeUtils::GetPlatformStr(),"dlink.dsm380") == 0) + { + CLog::Log(LOGDEBUG,"CBoxeeLoginWizardManager::HandleNextAction - [platform=%s] -> show RemoteQuickTip (blw)(digwiz)",BoxeeUtils::GetPlatformStr()); + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_QUICK_TIP); + } + else + { + SetWizardComplete(true); + } + } + break; + case WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_QUICK_TIP: + { + SetWizardComplete(true); + } + break; + default: + { + CLog::Log(LOGERROR,"CBoxeeLoginWizardManager::HandleNextAction - FAILED to handle WindowId [%d] (blw)(digwiz)",id); + } + break; + } + + if (addCurrentDlgToStack) + { + AddToStack(id); + } + else + { + CLog::Log(LOGDEBUG,"CBoxeeLoginWizardManager::HandleNextAction - Not adding [id=%d] to stack. [addCurrentDlgToStack=%d][DialogStackSize=%d] (blw)(digwiz)",id,addCurrentDlgToStack,GetStackSize()); + } + + CLog::Log(LOGDEBUG,"CBoxeeLoginWizardManager::HandleNextAction - Exit function and return [NextDialog=%p] for [id=%d] (blw)(digwiz)",pNextDialog,id); + + return pNextDialog; +} + +bool CBoxeeLoginWizardManager::OnWizardComplete() +{ + size_t numOfProfiles = g_settings.m_vecProfiles.size(); + +#ifndef HAS_EMBEDDED + + CLog::Log(LOGDEBUG,"CBoxeeLoginWizardManager::OnWizardComplete - Case of new user [numOfProfiles=%zu] (login)",numOfProfiles); + + if (numOfProfiles == 2) + { + CLog::Log(LOGDEBUG,"CBoxeeLoginWizardManager::OnWizardComplete - Case of first user [numOfProfiles=%zu] -> Propose to the user to set Screen Calibration (login)",numOfProfiles); + + if(CGUIDialogYesNo2::ShowAndGetInput(53400,53401,53420)) + { + CGUIWindowSettingsScreenSimpleCalibration* pSimpleCalibration = (CGUIWindowSettingsScreenSimpleCalibration*)g_windowManager.GetWindow(WINDOW_SCREEN_SIMPLE_CALIBRATION); + if (pSimpleCalibration) + { + pSimpleCalibration->SetLaunchFromLogin(true); + } + else + { + CLog::Log(LOGERROR,"CBoxeeLoginWizardManager::OnWizardComplete - FAILED to get CGUIWindowSettingsScreenSimpleCalibration object (login)"); + } + + CLog::Log(LOGDEBUG,"CBoxeeLoginWizardManager::OnWizardComplete - Because first user [numOfProfiles=%zu] and YES was hit -> Going to WINDOW_SCREEN_SIMPLE_CALIBRATION (login)",numOfProfiles); + g_windowManager.ChangeActiveWindow(WINDOW_SCREEN_SIMPLE_CALIBRATION); + } + else + { + g_windowManager.ChangeActiveWindow(WINDOW_HOME); + CLog::Log(LOGDEBUG,"CBoxeeLoginWizardManager::OnWizardComplete - Because first user [numOfProfiles=%zu] and NO was hit -> Going to WINDOW_HOME (login)",numOfProfiles); + } + } + else + { + CLog::Log(LOGDEBUG,"CBoxeeLoginWizardManager::OnWizardComplete - [numOfProfiles=%zu] -> Going to WINDOW_HOME (login)",numOfProfiles); + g_windowManager.ChangeActiveWindow(WINDOW_HOME); + } +#else + + CLog::Log(LOGDEBUG,"CBoxeeLoginWizardManager::OnWizardComplete - [numOfProfiles=%zu] -> Going to WINDOW_HOME (login)",numOfProfiles); + g_windowManager.ChangeActiveWindow(WINDOW_HOME); + +#endif + + return true; +} + +void CBoxeeLoginWizardManager::IsAddingDialogToStack(CGUIDialogBoxeeWizardBase* pNextDialog,bool& addCurrentDlgToStack) +{ + addCurrentDlgToStack = (pNextDialog != NULL); +} + +CServerUserInfo CBoxeeLoginWizardManager::GetServerUserInfo() +{ + return m_serverUserInfo; +} + +CServerUserInfo& CBoxeeLoginWizardManager::GetServerUserInfoByRef() +{ + return m_serverUserInfo; +} + +void CServerUserInfo::Reset() +{ + CLog::Log(LOGDEBUG,"CServerUserInfo::Reset - enter function (blw)(cnu)(login)"); + + m_id = ""; + m_name = ""; + m_firstName = ""; + m_lastName = ""; + m_link = ""; + m_username = ""; + m_birthday = ""; + m_gender = ""; + m_email = ""; + m_timezone = 0; + m_locale = ""; + m_verified = false; + m_updatedTime = ""; + m_accessToken = ""; + m_code = ""; + + m_serviceId = ""; + + m_isInitialize = false; +} + +bool CServerUserInfo::InitializeByJson(const Json::Value& jResponse) +{ + if (!jResponse.isMember("id")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + //return false; + } + else + { + m_id = jResponse["id"].asString(); + } + + if (!jResponse.isMember("name")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + return false; + } + else + { + m_name = jResponse["name"].asString(); + m_name.Replace(' ','.'); + m_name.Replace('-','.'); + } + + if (!jResponse.isMember("first_name")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + //return false; + } + else + { + m_firstName = jResponse["first_name"].asString(); + } + + if (!jResponse.isMember("last_name")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + //return false; + } + else + { + m_lastName = jResponse["last_name"].asString(); + } + + if (!jResponse.isMember("link")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + //return false; + } + else + { + m_link = jResponse["link"].asString(); + } + + if (!jResponse.isMember("username")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + //return false; + } + else + { + m_username = jResponse["username"].asString(); + } + + if (!jResponse.isMember("birthday")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + //return false; + } + else + { + m_birthday = jResponse["birthday"].asString(); + } + + if (!jResponse.isMember("gender")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + //return false; + } + else + { + m_gender = jResponse["gender"].asString(); + } + + if (!jResponse.isMember("email")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + //return false; + } + else + { + m_email = jResponse["email"].asString(); + } + + if (!jResponse.isMember("timezone")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + //return false; + } + else + { + m_timezone = jResponse["timezone"].asInt(); + } + + if (!jResponse.isMember("locale")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + //return false; + } + else + { + m_locale = jResponse["locale"].asString(); + } + + if (!jResponse.isMember("verified")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + //return false; + } + else + { + m_verified = jResponse["verified"].asBool(); + } + + if (!jResponse.isMember("updated_time")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + //return false; + } + else + { + m_updatedTime = jResponse["updated_time"].asString(); + } + + if (!jResponse.isMember("access_token")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + return false; + } + else + { + m_accessToken = jResponse["access_token"].asString(); + } + + if (!jResponse.isMember("code")) + { + CLog::Log(LOGERROR,"CServerUserInfo::InitializeByJson - FAILED to get parameter from jResponse (blw)(cnu)(login)"); + return false; + } + else + { + m_code = jResponse["code"].asString(); + } + + m_isInitialize = true; + + return m_isInitialize; +} + +bool CServerUserInfo::IsInitialize() +{ + return m_isInitialize; +} + diff --git a/xbmc/BoxeeLoginWizardManager.h b/xbmc/BoxeeLoginWizardManager.h new file mode 100644 index 00000000..33e7f59e --- /dev/null +++ b/xbmc/BoxeeLoginWizardManager.h @@ -0,0 +1,69 @@ +#pragma once + +#include "BoxeeSimpleDialogWizardManager.h" +#include "lib/libBoxee/boxee.h" + +#define FACEBOOK_SERVICE_ID "311" +#define TWITTER_SERVICE_ID "413" +#define TUMBLR_SERVICE_ID "323" + +class CGUIDialogBoxeeWizardBase; + +class CServerUserInfo +{ +public: + + void Reset(); + bool InitializeByJson(const Json::Value& jResponse); + + bool IsInitialize(); + + CStdString m_id; + CStdString m_name; + CStdString m_firstName; + CStdString m_lastName; + CStdString m_link; + CStdString m_username; + CStdString m_birthday; + CStdString m_gender; + CStdString m_email; + int m_timezone; + CStdString m_locale; + bool m_verified; + CStdString m_updatedTime; + CStdString m_accessToken; + CStdString m_code; + + CStdString m_serviceId; + + bool m_isInitialize; +}; + +class CBoxeeLoginWizardManager : public CBoxeeSimpleDialogWizardManager +{ +public: + + static CBoxeeLoginWizardManager& GetInstance(); + virtual ~CBoxeeLoginWizardManager(); + + bool RunWizard(bool shouldEndWizardOnEmptyStack); + + CServerUserInfo GetServerUserInfo(); + CServerUserInfo& GetServerUserInfoByRef(); + +protected: + + virtual CGUIDialogBoxeeWizardBase* HandleNextAction(CGUIDialogBoxeeWizardBase* pDialog, bool& addCurrentDlgToStack); + + virtual bool OnWizardComplete(); + +private: + + CBoxeeLoginWizardManager(); + + void IsAddingDialogToStack(CGUIDialogBoxeeWizardBase* pNextDialog,bool& addCurrentDlgToStack); + + bool m_isAddingNewUser; + + CServerUserInfo m_serverUserInfo; +}; diff --git a/xbmc/BoxeeOTAConfigurationData.cpp b/xbmc/BoxeeOTAConfigurationData.cpp new file mode 100644 index 00000000..ca171c9b --- /dev/null +++ b/xbmc/BoxeeOTAConfigurationData.cpp @@ -0,0 +1,54 @@ +#include "BoxeeOTAConfigurationData.h" +#include "GUISettings.h" +#include "lib/libBoxee/bxcurrentlocation.h" + +CBoxeeOTAConfigurationData::CBoxeeOTAConfigurationData() +{ + m_isCable = g_guiSettings.GetBool("ota.selectedcable"); + m_strCountryCode = g_guiSettings.GetString("ota.countrycode"); + m_strZipCode = g_guiSettings.GetString("ota.zipcode"); +} + +CBoxeeOTAConfigurationData::~CBoxeeOTAConfigurationData() +{ +} + +void CBoxeeOTAConfigurationData::ClearData() +{ + m_strCountryCode = ""; + m_strZipCode = ""; + m_isCable = false; +} + +void CBoxeeOTAConfigurationData::DetectLocation() +{ + BOXEE::BXCurrentLocation& location = BOXEE::BXCurrentLocation::GetInstance(); + + if (location.IsLocationDetected()) + { + m_strCountryCode = location.GetCountryCode(); + m_strZipCode = location.GetPostalCode(); + } +} + +void CBoxeeOTAConfigurationData::SaveData() +{ + g_guiSettings.SetBool("ota.selectedcable", m_isCable); + g_guiSettings.SetString("ota.countrycode", m_strCountryCode); + g_guiSettings.SetString("ota.zipcode", m_strZipCode); +} + +void CBoxeeOTAConfigurationData::SetCountryCode(const CStdString& strCountryCode) +{ + m_strCountryCode = strCountryCode; +} + +void CBoxeeOTAConfigurationData::SetZipCode(const CStdString& strZipCode) +{ + m_strZipCode = strZipCode; +} + +void CBoxeeOTAConfigurationData::SetIsCable(bool isCable) +{ + m_isCable = isCable; +} diff --git a/xbmc/BoxeeOTAConfigurationData.h b/xbmc/BoxeeOTAConfigurationData.h new file mode 100644 index 00000000..12ea62cb --- /dev/null +++ b/xbmc/BoxeeOTAConfigurationData.h @@ -0,0 +1,29 @@ +#pragma once + +#include "StdString.h" + +class CBoxeeOTAConfigurationData +{ +public: + CBoxeeOTAConfigurationData(); + ~CBoxeeOTAConfigurationData(); + + CStdString GetCountryCode() { return m_strCountryCode; } + CStdString GetZipCode() { return m_strZipCode; } + bool GetIsCable() { return m_isCable; } + + bool IsInNorthAmerica() { return (m_strCountryCode == "US" || m_strCountryCode == "CA"); } + + void SetCountryCode(const CStdString& strCountryCode); + void SetZipCode(const CStdString& strZipCode); + void SetIsCable(bool isCable); + + void DetectLocation(); + void ClearData(); + void SaveData(); + +private: + CStdString m_strCountryCode; + CStdString m_strZipCode; + bool m_isCable; +}; diff --git a/xbmc/BoxeeOTAConfigurationManager.cpp b/xbmc/BoxeeOTAConfigurationManager.cpp new file mode 100644 index 00000000..8595bc18 --- /dev/null +++ b/xbmc/BoxeeOTAConfigurationManager.cpp @@ -0,0 +1,163 @@ +#include "BoxeeOTAConfigurationManager.h" +#include "GUIDialogBoxeeOTALocationConfiguration.h" +#include "GUIDialogBoxeeOTAfavouriteShows.h" +#include "GUIDialogBoxeeOTAfavouriteShowsNotification.h" +#include "BoxeeOTAConfigurationData.h" +#include "GUIWindowManager.h" +#include "GUIDialogBoxeeWizardBase.h" +#include "utils/log.h" +#include "GUIDialogBoxeeOTAConfiguration.h" +#include "Settings.h" +#include "GUISettings.h" +#include "lib/libBoxee/bxcurrentlocation.h" +#include "Application.h" + + +CBoxeeOTAConfigurationManager::CBoxeeOTAConfigurationManager() : CBoxeeSimpleDialogWizardManager() +{ +} + +CBoxeeOTAConfigurationManager::~CBoxeeOTAConfigurationManager() +{ +} + +CBoxeeOTAConfigurationManager& CBoxeeOTAConfigurationManager::GetInstance() +{ + static CBoxeeOTAConfigurationManager boxeeOtaConfigurationManager; + return boxeeOtaConfigurationManager; +} + +bool CBoxeeOTAConfigurationManager::RunWizard(bool rescan) +{ + m_rescan = rescan; + m_isConnectedToFacebook = g_application.GetBoxeeSocialUtilsManager().IsConnected(FACEBOOK_SERVICE_ID) && + !g_application.GetBoxeeSocialUtilsManager().RequiresReconnect(FACEBOOK_SERVICE_ID); + + if (Run(WINDOW_OTA_WELCOME_CONFIGURATION, true)) + { + m_data.SaveData(); + g_guiSettings.SetBool("ota.run", true); + g_settings.Save(); + return true; + } + + return false; +} + +CGUIDialogBoxeeWizardBase* CBoxeeOTAConfigurationManager::HandleNextAction(CGUIDialogBoxeeWizardBase* pDialog, bool& addCurrentDlgToStack) +{ + if (!pDialog) + { + CLog::Log(LOGERROR,"CBoxeeOTAConfigurationManager::HandleNextAction - Enter function with a NULL pointer (digwiz)"); + return NULL; + } + + int id = pDialog->GetID(); + + CLog::Log(LOGDEBUG,"CBoxeeOTAConfigurationManager::HandleNextAction - Enter function with [id=%d] (digwiz)",id); + + CGUIDialogBoxeeWizardBase* pNextDialog = NULL; + + switch(id) + { + case WINDOW_OTA_WELCOME_CONFIGURATION: + { + m_data.ClearData(); + m_data.DetectLocation(); + + // If we know the country, ask the user to confirm, otherwise let the user select the location + BOXEE::BXCurrentLocation& location = BOXEE::BXCurrentLocation::GetInstance(); + if (location.IsLocationDetected()) + pNextDialog = (CGUIDialogBoxeeOTAConfirmLocation*)g_windowManager.GetWindow(WINDOW_OTA_LOCATION_CONFIRMATION); + else + pNextDialog = (CGUIDialogBoxeeOTACountriesLocationConfiguration*)g_windowManager.GetWindow(WINDOW_OTA_COUNTRIES_CONFIGURATION); + + if (pNextDialog) + addCurrentDlgToStack = true; + } + break; + + case WINDOW_OTA_LOCATION_CONFIRMATION: + { + CGUIDialogBoxeeOTAConfirmLocation* pLocationDialog = (CGUIDialogBoxeeOTAConfirmLocation*)g_windowManager.GetWindow(WINDOW_OTA_LOCATION_CONFIRMATION); + if (!pLocationDialog) + break; + + if (pLocationDialog->GetYesButtonPressed() && m_data.IsInNorthAmerica()) + pNextDialog = (CGUIDialogBoxeeOTAZipcodeLocationConfiguration*)g_windowManager.GetWindow(WINDOW_OTA_ZIPCODE_CONFIGURATION); + else if (pLocationDialog->GetYesButtonPressed() && !m_data.IsInNorthAmerica() && !m_isConnectedToFacebook) + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_OTA_FACEBOOK_CONNECT); + else if (pLocationDialog->GetYesButtonPressed() && !m_data.IsInNorthAmerica() && m_isConnectedToFacebook) + SetWizardComplete(true); + else + pNextDialog = (CGUIDialogBoxeeOTACountriesLocationConfiguration*)g_windowManager.GetWindow(WINDOW_OTA_COUNTRIES_CONFIGURATION); + + if (pNextDialog) + addCurrentDlgToStack = true; + } + break; + + case WINDOW_OTA_COUNTRIES_CONFIGURATION: + { + if (m_data.IsInNorthAmerica()) + pNextDialog = (CGUIDialogBoxeeOTAZipcodeLocationConfiguration*)g_windowManager.GetWindow(WINDOW_OTA_ZIPCODE_CONFIGURATION); + else if (!m_isConnectedToFacebook) + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_OTA_FACEBOOK_CONNECT); + else + SetWizardComplete(true); + + if (pNextDialog) + addCurrentDlgToStack = true; + } + break; + + case WINDOW_OTA_ZIPCODE_CONFIGURATION: + { + pNextDialog = (CGUIDialogBoxeeOTAConnectionConfiguration*)g_windowManager.GetWindow(WINDOW_OTA_CONNECTION_CONFIGURATION); + if (pNextDialog) + { + addCurrentDlgToStack = true; + } + } + break; + + case WINDOW_OTA_CONNECTION_CONFIGURATION: + { + if (!m_isConnectedToFacebook) + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(WINDOW_OTA_FACEBOOK_CONNECT); + else + SetWizardComplete(true); + + if (pNextDialog) + { + addCurrentDlgToStack = true; + } + } + break; + + case WINDOW_OTA_FACEBOOK_CONNECT: + { + SetWizardComplete(true); + } + break; + + default: + { + CLog::Log(LOGERROR,"CBoxeeOTAConfigurationManager::HandleNextAction - FAILED to handle WindowId [%d] (digwiz)",id); + } + break; + } + + if (addCurrentDlgToStack) + { + AddToStack(id); + } + else + { + CLog::Log(LOGDEBUG,"CBoxeeOTAConfigurationManager::HandleNextAction - Not adding [id=%d] to stack. [addCurrentDlgToStack=%d][DialogStackSize=%d] (digwiz)",id,addCurrentDlgToStack,GetStackSize()); + } + + CLog::Log(LOGDEBUG,"CBoxeeOTAConfigurationManager::HandleNextAction - Exit function and return [NextDialog=%p] for [id=%d] (digwiz)",pNextDialog,id); + + return pNextDialog; +} diff --git a/xbmc/BoxeeOTAConfigurationManager.h b/xbmc/BoxeeOTAConfigurationManager.h new file mode 100644 index 00000000..c624b545 --- /dev/null +++ b/xbmc/BoxeeOTAConfigurationManager.h @@ -0,0 +1,26 @@ +#pragma once + +#include "BoxeeSimpleDialogWizardManager.h" +#include "BoxeeOTAConfigurationData.h" + +class CGUIDialogBoxeeWizardBase; + +class CBoxeeOTAConfigurationManager : public CBoxeeSimpleDialogWizardManager +{ +public: + static CBoxeeOTAConfigurationManager& GetInstance(); + virtual ~CBoxeeOTAConfigurationManager(); + + CBoxeeOTAConfigurationData& GetConfigurationData() { return m_data; } + bool RunWizard(bool rescan); + +protected: + virtual CGUIDialogBoxeeWizardBase* HandleNextAction(CGUIDialogBoxeeWizardBase* pDialog, bool& addCurrentDlgToStack); + +private: + CBoxeeOTAConfigurationManager(); + + CBoxeeOTAConfigurationData m_data; + bool m_isConnectedToFacebook; + bool m_rescan; +}; diff --git a/xbmc/BoxeeSimpleDialogWizardManager.cpp b/xbmc/BoxeeSimpleDialogWizardManager.cpp new file mode 100644 index 00000000..2d0bc317 --- /dev/null +++ b/xbmc/BoxeeSimpleDialogWizardManager.cpp @@ -0,0 +1,221 @@ +#include "BoxeeSimpleDialogWizardManager.h" +#include "GUIWindowManager.h" +#include "GUIDialogBoxeeWizardBase.h" +#include "utils/log.h" + +CBoxeeSimpleDialogWizardManager::CBoxeeSimpleDialogWizardManager() +{ + m_isWizardComplited = false; + m_shouldEndWizardOnEmptyStack = false; +} + +CBoxeeSimpleDialogWizardManager::~CBoxeeSimpleDialogWizardManager() +{ + +} + +bool CBoxeeSimpleDialogWizardManager::Run(int startDialogId, bool shouldEndWizardOnEmptyStack) +{ + m_wizardCancelled = false; + + CLog::Log(LOGDEBUG,"CBoxeeSimpleDialogWizardManager::Run - ENTER wizard (digwiz)"); + + CGUIDialogBoxeeWizardBase* pDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(startDialogId); + if (!pDialog) + { + CLog::Log(LOGERROR,"CBoxeeSimpleDialogWizardManager::Run - FAILED to get start dialog (digwiz)"); + return false; + } + + ClearStack(); + + m_shouldEndWizardOnEmptyStack = shouldEndWizardOnEmptyStack; + m_isWizardComplited = false; + + CLog::Log(LOGDEBUG,"CBoxeeSimpleDialogWizardManager::Run - going to START wizard. [EndWizardOnEmptyStack=%d][isWizardComplited=%d][StackSize=%zu] (digwiz)",m_shouldEndWizardOnEmptyStack,m_isWizardComplited,m_dialogStack.size()); + + while (!m_isWizardComplited) + { + if (!pDialog) + { + CLog::Log(LOGERROR,"CBoxeeSimpleDialogWizardManager::Run - FAILED to get next dialog -> Break (digwiz)"); + break; + } + + pDialog->DoModal(); + + pDialog = GetNextDialog(pDialog); + } + + CLog::Log(LOGDEBUG,"CBoxeeSimpleDialogWizardManager::Run - going to STOP wizard. [EndWizardOnEmptyStack=%d][isWizardComplited=%d][StackSize=%zu] (digwiz)",m_shouldEndWizardOnEmptyStack,m_isWizardComplited,m_dialogStack.size()); + + if (m_isWizardComplited) + { + CLog::Log(LOGDEBUG,"CBoxeeSimpleDialogWizardManager::Run - since [isWizardComplited=%d=TRUE] going to call OnWizardComplete (digwiz)",m_isWizardComplited); + OnWizardComplete(); + } + + CLog::Log(LOGDEBUG,"CBoxeeSimpleDialogWizardManager::Run - EXIT wizard (digwiz)"); + + //g_windowManager.PreviousWindow(); + + return !m_wizardCancelled; +} + +CGUIDialogBoxeeWizardBase* CBoxeeSimpleDialogWizardManager::GetNextDialog(CGUIDialogBoxeeWizardBase* pDialog) +{ + if (!pDialog) + { + CLog::Log(LOGERROR,"CBoxeeSimpleDialogWizardManager::GetNextDialog - Enter function with a NULL pointer (digwiz)"); + return NULL; + } + + int id = pDialog->GetID(); + + CActionChoose::ActionChooseEnums actionChose = pDialog->GetActionChose(); + if (actionChose == CActionChoose::ACTION_ERROR) + { + CLog::Log(LOGERROR,"CBoxeeSimpleDialogWizardManager::GetNextDialog - Action chose enum is ERROR (digwiz)"); + return NULL; + } + + CGUIDialogBoxeeWizardBase* pNextWindow = NULL; + bool addCurrentDlgToStack = true; + + switch(actionChose) + { + case CActionChoose::NEXT: + { + CLog::Log(LOGDEBUG,"CBoxeeSimpleDialogWizardManager::GetNextDialog - For [windowId=%d] handling [ActionChose=%d=NEXT] (digwiz)",pDialog->GetID(),actionChose); + + pNextWindow = HandleNextAction(pDialog,addCurrentDlgToStack); + + if (addCurrentDlgToStack && (m_dialogStack.empty() || m_dialogStack.top() != id)) + { + m_dialogStack.push(id); + } + else + { + CLog::Log(LOGDEBUG,"CBoxeeSimpleDialogWizardManager::GetNextDialog - Not adding [id=%d] to stack. [addCurrentDlgToStack=%d][DialogStackSize=%d] (digwiz)",id,addCurrentDlgToStack,(int)m_dialogStack.size()); + } + } + break; + case CActionChoose::BACK: + { + CLog::Log(LOGDEBUG,"CBoxeeSimpleDialogWizardManager::GetNextDialog - For [windowId=%d] handling [ActionChose=%d=BACK] (digwiz)",pDialog->GetID(),actionChose); + + pNextWindow = HandleBackAction(pDialog); + } + break; + default: + { + CLog::Log(LOGERROR,"CBoxeeSimpleDialogWizardManager::GetNextDialog - FAILED to handle ActionChoseEnum [%d] (digwiz)",actionChose); + } + break; + } + + return pNextWindow; +} + +CGUIDialogBoxeeWizardBase* CBoxeeSimpleDialogWizardManager::HandleBackAction(CGUIDialogBoxeeWizardBase* pDialog) +{ + if (!pDialog) + { + CLog::Log(LOGERROR,"CBoxeeSimpleDialogWizardManager::HandleBackAction - Enter function with a NULL pointer (digwiz)"); + return NULL; + } + + CGUIDialogBoxeeWizardBase* pNextDialog = NULL; + + if ((int)m_dialogStack.size() < 1) + { + if (m_shouldEndWizardOnEmptyStack) + { + CLog::Log(LOGWARNING,"CBoxeeSimpleDialogWizardManager::HandleBackAction - Size of dialogStack is [%d] (initbox)",(int)m_dialogStack.size()); + m_wizardCancelled = true; + return NULL; + } + else + { + pNextDialog = pDialog; + } + } + else + { + bool foundBackWindow = false; + int nextDialogId; + + while (!foundBackWindow) + { + nextDialogId = m_dialogStack.top(); + m_dialogStack.pop(); + + if (nextDialogId != pDialog->GetID() || ((int)m_dialogStack.size()) < 1) + { + // not the same id OR no more id's in the stack -> break + foundBackWindow = true; + } + } + + pNextDialog = (CGUIDialogBoxeeWizardBase*)g_windowManager.GetWindow(nextDialogId); + + if (!pNextDialog) + { + CLog::Log(LOGERROR,"CBoxeeSimpleDialogWizardManager::HandleBackAction - FAILED to get dialog for [id=%d] (digwiz)",nextDialogId); + } + } + + return pNextDialog; +} + +bool CBoxeeSimpleDialogWizardManager::IsWizardComplited() +{ + return m_isWizardComplited; +} + +void CBoxeeSimpleDialogWizardManager::SetWizardComplete(bool isWizardComplited) +{ + m_isWizardComplited = isWizardComplited; +} + +bool CBoxeeSimpleDialogWizardManager::IsShouldEndWizardOnEmptyStack() +{ + return m_shouldEndWizardOnEmptyStack; +} + +void CBoxeeSimpleDialogWizardManager::SetIsShouldEndWizardOnEmptyStack(bool isShouldEndWizardOnEmptyStack) +{ + m_shouldEndWizardOnEmptyStack = isShouldEndWizardOnEmptyStack; +} + +bool CBoxeeSimpleDialogWizardManager::AddToStack(int id) +{ + CLog::Log(LOGDEBUG,"CBoxeeSimpleDialogWizardManager::AddToStack - enter function [stackSize=%d][idOnTop=%d] (digwiz)",(int)m_dialogStack.size(),m_dialogStack.empty() ? -1 : m_dialogStack.top()); + + if (m_dialogStack.empty() || m_dialogStack.top() != id) + { + m_dialogStack.push(id); + } + else + { + CLog::Log(LOGDEBUG,"CBoxeeSimpleDialogWizardManager::AddToStack - NOT adding [id=%d] to stack. [stackSize=%d] (digwiz)",id,(int)m_dialogStack.size()); + } + + CLog::Log(LOGDEBUG,"CBoxeeSimpleDialogWizardManager::AddToStack - exit function [stackSize=%d][idOnTop=%d] (digwiz)",(int)m_dialogStack.size(),m_dialogStack.empty() ? -1 : m_dialogStack.top()); + + return true; +} + +void CBoxeeSimpleDialogWizardManager::ClearStack() +{ + // clear dialog stack + while(!m_dialogStack.empty()) + { + m_dialogStack.pop(); + } +} + +int CBoxeeSimpleDialogWizardManager::GetStackSize() +{ + return (int)m_dialogStack.size(); +} diff --git a/xbmc/BoxeeSimpleDialogWizardManager.h b/xbmc/BoxeeSimpleDialogWizardManager.h new file mode 100644 index 00000000..e0cbaa9f --- /dev/null +++ b/xbmc/BoxeeSimpleDialogWizardManager.h @@ -0,0 +1,45 @@ +#ifndef BOXEESIMPLEDIALOGWIZARD_H_ +#define BOXEESIMPLEDIALOGWIZARD_H_ + +#include + +class CGUIDialogBoxeeWizardBase; + +class CBoxeeSimpleDialogWizardManager +{ +public: + CBoxeeSimpleDialogWizardManager(); + virtual ~CBoxeeSimpleDialogWizardManager(); + + bool Run(int startDialogId, bool shouldEndWizardOnEmptyStack = false); + + bool IsWizardComplited(); + void SetWizardComplete(bool isWizardComplited); + + bool IsShouldEndWizardOnEmptyStack(); + void SetIsShouldEndWizardOnEmptyStack(bool isShouldEndWizardOnEmptyStack); + + void ClearStack(); + bool AddToStack(int id); + int GetStackSize(); + + bool IsWizardCancelled() { return m_wizardCancelled; } + +protected: + virtual CGUIDialogBoxeeWizardBase* HandleNextAction(CGUIDialogBoxeeWizardBase* pDialog, bool& addCurrentDlgToStack) = 0; + + virtual bool OnWizardComplete() { return true; } + +private: + CGUIDialogBoxeeWizardBase* GetNextDialog(CGUIDialogBoxeeWizardBase* pDialog); + CGUIDialogBoxeeWizardBase* HandleBackAction(CGUIDialogBoxeeWizardBase* pDialog); + + std::stack m_dialogStack; + bool m_shouldEndWizardOnEmptyStack; + bool m_isWizardComplited; + + bool m_wizardCancelled; +}; + +#endif /*IBOXEESIMPLEDIALOGWIZARD_H_*/ + diff --git a/xbmc/BoxeeSocialUtilsManager.cpp b/xbmc/BoxeeSocialUtilsManager.cpp new file mode 100644 index 00000000..5ca39c52 --- /dev/null +++ b/xbmc/BoxeeSocialUtilsManager.cpp @@ -0,0 +1,146 @@ + +#include "BoxeeSocialUtilsManager.h" +#include "utils/log.h" +#include "BoxeeUtils.h" + +using namespace BOXEE; +using namespace DIRECTORY; + +CBoxeeSocialUtilsManager::CBoxeeSocialUtilsManager() +{ + Reset(); +} + +CBoxeeSocialUtilsManager::~CBoxeeSocialUtilsManager() +{ +} + +bool CBoxeeSocialUtilsManager::Initialize() +{ + if (m_bIsInit) + { + CLog::Log(LOGWARNING,"CBoxeeSocialUtilsManager::InitBoxeeSocialUtilsManager - reset BoxeeSocialUtilsManager didn't occur"); + } + + Reset(); + + if (!GetStatusFromServer()) + { + CLog::Log(LOGERROR,"CBoxeeSocialUtilsManager::InitBoxeeSocialUtilsManager() - FAILED to get social services status from server."); + return false; + } + + m_bIsInit = true; + + return true; +} + +void CBoxeeSocialUtilsManager::Reset() +{ + m_bIsInit = false; + + m_serviceMap.clear(); + m_serviceMap[FACEBOOK_SERVICE_ID] = SocialServiceInfo(); + m_serviceMap[TWITTER_SERVICE_ID] = SocialServiceInfo(); + m_serviceMap[TUMBLR_SERVICE_ID] = SocialServiceInfo(); +} + +bool CBoxeeSocialUtilsManager::IsInitialized() +{ + return m_bIsInit; +} + +CStdString CBoxeeSocialUtilsManager::GetConnectLink(const CStdString& serviceId) +{ +#ifdef CANMORE + return m_serviceMap[serviceId].link; +#else + return m_serviceMap[serviceId].externalLink; +#endif +} + +CStdString CBoxeeSocialUtilsManager::GetDisconnectLink(const CStdString& serviceId) +{ + return m_serviceMap[serviceId].disconnectLink; +} + +bool CBoxeeSocialUtilsManager::GetStatusFromServer() +{ + int retCode; + Job_Result jobResult = BoxeeUtils::GetShareServicesJson(m_jsonServiceList, retCode); + + CLog::Log(LOGDEBUG,"CBoxeeSocialUtilsManager::GetSocialServicesStatus - call to get SocialServices status from server returned [jobResult=%d] ",jobResult); + + if (jobResult != JOB_SUCCEEDED) + { + CLog::Log(LOGERROR,"CBoxeeSocialUtilsManager::GetSocialServicesStatus - FAILED to get SocialServices status from server. [jobResult=%d]",jobResult); + return false; + } + + m_servicesList.Clear(); + m_serviceMap.clear(); + + BoxeeUtils::ParseJsonShareServicesToFileItems(m_jsonServiceList,m_servicesList); + + CLog::Log(LOGDEBUG,"CBoxeeSocialUtilsManager::GetSocialServicesStatus - after parse SocialServices to FIleItemList. [NumOfSocialServices=%d]",m_servicesList.Size()); + + for (int i = 0; i < m_servicesList.Size(); i++) + { + CFileItemPtr item = m_servicesList.Get(i); + + CStdString currentServiceId = item->GetProperty("serviceId"); + + if (currentServiceId == FACEBOOK_SERVICE_ID || + currentServiceId == TWITTER_SERVICE_ID || + currentServiceId == TUMBLR_SERVICE_ID) + { + m_serviceMap[currentServiceId].isConnected = item->GetPropertyBOOL("enable"); + m_serviceMap[currentServiceId].requiresUpdate = item->GetPropertyBOOL("refresh"); + m_serviceMap[currentServiceId].link = item->GetProperty("connect"); + m_serviceMap[currentServiceId].disconnectLink = item->GetProperty("disconnect"); + m_serviceMap[currentServiceId].externalLink = item->GetProperty("link"); + } + } + + return true; +} + +bool CBoxeeSocialUtilsManager::IsConnected(const CStdString& serviceId, bool getDataFromServer) +{ + if (getDataFromServer) + { + GetStatusFromServer(); + } + + return m_serviceMap[serviceId].isConnected; +} + +bool CBoxeeSocialUtilsManager::RequiresReconnect(const CStdString& serviceId, bool getDataFromServer) +{ + if (getDataFromServer) + { + GetStatusFromServer(); + } + + return m_serviceMap[serviceId].requiresUpdate; +} + +bool CBoxeeSocialUtilsManager::IsAnyConnected(bool getDataFromServer) +{ + bool connected = true; + + if(!IsConnected(FACEBOOK_SERVICE_ID, getDataFromServer) && + !IsConnected(TWITTER_SERVICE_ID, getDataFromServer) && + !IsConnected(TUMBLR_SERVICE_ID, getDataFromServer)) + { + connected = false; + } + + return connected; +} + +void CBoxeeSocialUtilsManager::SetIsConnected(const CStdString& serviceId, bool isConnected) +{ + m_serviceMap[serviceId].isConnected = isConnected; +} + diff --git a/xbmc/BoxeeSocialUtilsManager.h b/xbmc/BoxeeSocialUtilsManager.h new file mode 100644 index 00000000..f5c6520e --- /dev/null +++ b/xbmc/BoxeeSocialUtilsManager.h @@ -0,0 +1,55 @@ + +#ifndef BOXEESOCIALUTILSMANAGER_H +#define BOXEESOCIALUTILSMANAGER_H + +#include +#include "GUIWindow.h" +#include "FileItem.h" +#include "lib/libjson/include/json/value.h" + +#define FACEBOOK_SERVICE_ID "311" +#define TWITTER_SERVICE_ID "413" +#define TUMBLR_SERVICE_ID "323" + +class CBoxeeSocialUtilsManager +{ +public: + CBoxeeSocialUtilsManager(); + virtual ~CBoxeeSocialUtilsManager(); + bool Initialize(); + void Reset(); + bool IsInitialized(); + + CStdString GetConnectLink(const CStdString& serviceId); + CStdString GetDisconnectLink(const CStdString& serviceId); + + bool IsConnected(const CStdString& serviceId, bool getDataFromServer = false); + bool RequiresReconnect(const CStdString& serviceId, bool getDataFromServer = false); + + bool IsAnyConnected(bool getDataFromServer = false); + + void SetIsConnected(const CStdString& serviceId, bool isConnected); + +private: + struct SocialServiceInfo + { + SocialServiceInfo() { isConnected = false; requiresUpdate = false; } + + bool isConnected; + bool requiresUpdate; + std::string link; + std::string externalLink; + std::string disconnectLink; + }; + + bool GetStatusFromServer(); + + CFileItemList m_servicesList; + Json::Value m_jsonServiceList; + + std::map m_serviceMap; + + bool m_bIsInit; +}; + +#endif diff --git a/xbmc/BoxeeSocialUtilsUIManager.cpp b/xbmc/BoxeeSocialUtilsUIManager.cpp new file mode 100644 index 00000000..4706c886 --- /dev/null +++ b/xbmc/BoxeeSocialUtilsUIManager.cpp @@ -0,0 +1,82 @@ + +#include "BoxeeSocialUtilsUIManager.h" +#include "utils/log.h" +#include "BoxeeUtils.h" +#include "GUIWebDialog.h" +#include "Application.h" +#include "GUIDialogOK2.h" +#include "LocalizeStrings.h" +#include "lib/libBoxee/bxutils.h" + +using namespace BOXEE; +using namespace DIRECTORY; + +CBoxeeSocialUtilsUIManager::CBoxeeSocialUtilsUIManager() +{ +} + +CBoxeeSocialUtilsUIManager::~CBoxeeSocialUtilsUIManager() +{ +} + +bool CBoxeeSocialUtilsUIManager::ConnectUISocialService(const CStdString& serviceId) +{ + CStdString url = g_application.GetBoxeeSocialUtilsManager().GetConnectLink(serviceId); +#ifdef CANMORE + if (url == "") + { + CLog::Log(LOGERROR,"CBoxeeSocialUtilsUIManager::ConnectUISocialService - url is empty return FALSE"); + return false; + } + + CLog::Log(LOGDEBUG,"CBoxeeSocialUtilsUIManager::ConnectUISocialService - open GUIWebDialog with [url=%s]", url.c_str()); + + return CGUIWebDialog::ShowAndGetInput(url); +#else + CStdString text = g_localizeStrings.Get(80001); + text += " " + url; + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(10014),text); + return false; +#endif +} + +bool CBoxeeSocialUtilsUIManager::HandleUISocialUtilDisconnect(const CStdString& serviceId) +{ + CLog::Log(LOGDEBUG,"CBoxeeSocialUtilsUIManager::HandleUISocialUtilDisconnect - disconnecting [%s]", serviceId.c_str()); + + Json::Value jResponse; + int returnCode; + CStdString url = g_application.GetBoxeeSocialUtilsManager().GetDisconnectLink(serviceId); + + if (BOXEE::BXUtils::PerformJSONGetRequestInBG(url, jResponse, returnCode) != JOB_SUCCEEDED) + { + CLog::Log(LOGERROR,"CBoxeeSocialUtilsUIManager::HandleUISocialUtilDisconnect: failed calling the server. serviceId=%s RC=%d", serviceId.c_str(), returnCode); + return false; + } + + return true; +} + +bool CBoxeeSocialUtilsUIManager::HandleUISocialUtilConnect(const CStdString& serviceId) +{ + if (g_application.GetBoxeeSocialUtilsManager().IsConnected(serviceId, true) && + !g_application.GetBoxeeSocialUtilsManager().RequiresReconnect(serviceId, true)) + { + CLog::Log(LOGDEBUG,"CBoxeeSocialUtilsUIManager::HandleUISocialUtilConnect - [%s] is already enable ",serviceId.c_str()); + return true; + } + + // The server instructed us that a refresh is needed, so we need to disconnect before we connect + if (g_application.GetBoxeeSocialUtilsManager().RequiresReconnect(serviceId)) + { + HandleUISocialUtilDisconnect(serviceId); + } + + if (!ConnectUISocialService(serviceId)) + { + CLog::Log(LOGERROR,"CBoxeeSocialUtilsUIManager::HandleUISocialUtilConnect - FAILED to connect [%s]",serviceId.c_str()); + return false; + } + + return true; +} diff --git a/xbmc/BoxeeSocialUtilsUIManager.h b/xbmc/BoxeeSocialUtilsUIManager.h new file mode 100644 index 00000000..9bd38832 --- /dev/null +++ b/xbmc/BoxeeSocialUtilsUIManager.h @@ -0,0 +1,21 @@ +#ifndef BOXEESOCIALUTILSUIMANAGER_H +#define BOXEESOCIALUTILSUIMANAGER_H + +#include +#include "GUIWindow.h" + +class CBoxeeSocialUtilsUIManager +{ +public: + CBoxeeSocialUtilsUIManager(); + virtual ~CBoxeeSocialUtilsUIManager(); + + bool HandleUISocialUtilConnect(const CStdString& serviceId); + bool HandleUISocialUtilDisconnect(const CStdString& serviceId); + +private: + bool ConnectUISocialService(const CStdString& serviceId); + +}; + +#endif diff --git a/xbmc/ErrorHandler.h b/xbmc/ErrorHandler.h new file mode 100644 index 00000000..8e136bec --- /dev/null +++ b/xbmc/ErrorHandler.h @@ -0,0 +1,88 @@ +#include +#include +#include +#include "utils/log.h" + +#ifdef _WIN32_ALREADY_IN_WIN32EXCEPTION +#include "StackWalker.h" +#include + +class BoxeeStackWalker : public StackWalker +{ +public: + BoxeeStackWalker() : StackWalker() {} + BoxeeStackWalker(DWORD dwProcessId, HANDLE hProcess) : StackWalker(dwProcessId, hProcess) {} + virtual void OnOutput(LPCSTR szText) { + CLog::Log(LOGFATAL, "An exception occured. Stack Trace is:\n%s", szText); + } +}; + +void boxee_se_translator(unsigned int u, EXCEPTION_POINTERS* pExp) +{ + BoxeeStackWalker sw; + sw.ShowCallstack(GetCurrentThread(), pExp->ContextRecord); + throw std::exception("SE Exception"); +} + +#endif + +void boxee_new_handler() { + //CLog::Log(LOGFATAL, "New handler called (no memory on the heap)"); // Causes stack-overflow in the call to new-handler, since the log function is trying to allocate additional memory. + //abort(); + exit(1); +} + +void boxee_terminate_handler() { + CLog::Log(LOGFATAL, "Terminate handler called (abnormal termination)"); + //abort(); // forces abnormal termination + exit(2); +} + +void boxee_pure_call_handler() +{ + CLog::Log(LOGFATAL, "Pure call handler called (pure virtual function was called)"); + //abort(); + exit(3); +} + +class StaticErrorHandler { +public: + + StaticErrorHandler() { +#ifdef _WIN32 + //m_prev_se_func = _set_se_translator(boxee_se_translator); // Already in Win32Exception.cpp + m_purecall_handler = _set_purecall_handler(boxee_pure_call_handler); +#endif + m_prev_terminate_handler = std::set_terminate(boxee_terminate_handler); + m_prev_new_handler = std::set_new_handler(boxee_new_handler); + } + + ~StaticErrorHandler() { +#ifdef _WIN32 + //_set_se_translator( m_prev_se_func ); + _set_purecall_handler(m_purecall_handler); +#endif + std::set_terminate(m_prev_terminate_handler); + std::set_new_handler(m_prev_new_handler); + } + +private: + +#ifdef _WIN32 + //_se_translator_function m_prev_se_func; + _purecall_handler m_purecall_handler; +#endif + std::terminate_handler m_prev_terminate_handler; + std::new_handler m_prev_new_handler; +}; + +class GlobalErrorHandler { +public: + static StaticErrorHandler& get_instance() { + static StaticErrorHandler s_err_handlr; + return s_err_handlr; + } + GlobalErrorHandler() { + (void) get_instance(); // Force the static constructor. + } +}; diff --git a/xbmc/FileSystem/AfpDirectory.cpp b/xbmc/FileSystem/AfpDirectory.cpp new file mode 100644 index 00000000..339a0ff2 --- /dev/null +++ b/xbmc/FileSystem/AfpDirectory.cpp @@ -0,0 +1,576 @@ +#include "system.h" + +#ifdef HAS_NFS +#include "Util.h" +#include "URL.h" +#include "FileItem.h" +#include "Directory.h" +#include "AfpDirectory.h" +#include "BrowserService.h" +#include "DirectoryCache.h" +#include "Application.h" +#include "utils/log.h" +#include "bxutils.h" +#include "../Util.h" +#include "Util.h" +#include "ZeroconfAvahi.h" +#include "ZeroconfBrowser.h" +#include "GUISettings.h" +#include "GUIPassword.h" +#include "StringUtils.h" + +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +using namespace DIRECTORY; +using namespace std; + +#define MOUNT_ROOT "/tmp/mnt/" + +#ifndef AFP_SUPER_MAGIC +#define AFP_SUPER_MAGIC 0x65735546 +#endif + + +static bool ScanAfpShares(CFileItemList &items) +{ + CFileItemList shares; + + CDirectory::GetDirectory("zeroconf://", shares); + + for(int i=0; iGetProperty("protocol"); + + if(protocol.ToLower() == "afp") + { + CFileItemPtr pItem(new CFileItem()); + CStdString name = shares[i]->GetProperty("name"); + + pItem->SetLabel(name); + pItem->m_bIsFolder = true; + pItem->SetProperty("isNetwork",true); + + pItem->m_strPath.Format("afp://%s", shares[i]->GetProperty("hostName")); + CUtil::AddSlashAtEnd(pItem->m_strPath); + + items.Add(pItem); + } + } + + return items.Size() != 0; +} + + +/* Converts an integer value to its hex character*/ +static char to_hex(char code) +{ + static char hex[] = "0123456789abcdef"; + return hex[code & 15]; +} + +static CStdString url_encode(char *str) +{ + char *pstr = str, *buf = (char*)malloc(strlen(str) * 3 + 1), *pbuf = buf; + CStdString strResult; + + while (*pstr) { + if (isalnum(*pstr) || *pstr == '-' || *pstr == '_' || *pstr == '.' || *pstr == '~') + *pbuf++ = *pstr; + else if (*pstr == ' ') + *pbuf++ = '+'; + else + *pbuf++ = '%', *pbuf++ = to_hex(*pstr >> 4), *pbuf++ = to_hex(*pstr & 15); + pstr++; + } + *pbuf = '\0'; + + strResult = buf; + free(buf); + + return strResult; +} + +static void RunCommand(const CStdString& command, int& status, CStdString& strOutput) +{ + char fullPathCommand[2048]; + + strcpy(fullPathCommand, command.c_str()); + + + status = -1; + strOutput = ""; + + FILE* f = popen(fullPathCommand, "r"); + if (!f) + { + return; + } + + char szBuffer[1024]; + ssize_t nBytes = 0; + + while (!feof(f)) + { + memset(&szBuffer[0], 0, 1024); + nBytes = fread(&szBuffer[0], 1, 1024, f); + if (nBytes > 0) + { + strOutput.append(&szBuffer[0]); + } + } + + status = pclose(f); +} + +static int UnMountShare(const CStdString &strMountPoint) +{ + return umount(strMountPoint.c_str()); +} + +static bool MountShare(const CStdString &afpPath, const CStdString &strMountPoint) +{ + CStdString cmd; + + if(CUtil::IsMountpoint(strMountPoint)) + { + UnMountShare(strMountPoint); + } + + ::CreateDirectory(strMountPoint, NULL); + + cmd = "afp_client mount " + afpPath + CStdString(" ") + strMountPoint; + + system(cmd.c_str()); + + // test for mountpoint + if(!CUtil::IsMountpoint(strMountPoint)) + { + CLog::Log(LOGERROR, "%s - Failed to mount [%s]", __func__, strMountPoint.c_str()); + return false; + } + + return true; +} + +static CStdString GetMountPoint(const CStdString &strType, const CStdString &strHost, const CStdString &strVolume) +{ + CStdString v; + for (int i = 0; i < (int)strVolume.size(); ++i) + { + int kar = (unsigned char)strVolume[i]; + if (isalnum(kar)) v += kar; + else + { + CStdString strTmp; + strTmp.Format("%d", kar); + v += strTmp; + } + } + + CStdString strPath = strType + "_" + strHost + "_" + v; + + return MOUNT_ROOT + strPath; +} + + +static bool BuildAfpUrl(const CURI& url, struct afp_url* afp_url) +{ + struct passwd * passwd; + CStdString strUserName = url.GetUserName(); + CStdString strPassword = url.GetPassWord(); + + afp_default_url(afp_url); + + if (afp_parse_url(afp_url, url.Get().c_str(),0) != 0) + { + CLog::Log(LOGERROR, "CAfpDirectory::%s - failed to parse url %s", __func__, url.Get().c_str()); + return false; + } + + if (strUserName.IsEmpty() && strlen(afp_url->uamname) == 0) + { + CStdString strUamName = "No User Authent"; + + strncpy(afp_url->uamname, strUamName.c_str(),strUamName.length()); + passwd = getpwuid(getuid()); + strncpy(afp_url->username, passwd->pw_name,AFP_MAX_USERNAME_LEN); + } + + return true; +} + +static bool HasReadPermissions(const CStdString& path, bool bGuest) +{ + struct __stat64 stat; + bool bResult = true; + + if (_stat64(path.c_str(),&stat) == 0) + { + bResult = bGuest ? stat.st_mode & S_IROTH : stat.st_mode & S_IRUSR; + } + + return bResult; +} + +bool CAfpDirectory::GetResource(const CURI& path, CFileItem &item) +{ + if(path.GetProtocol() != "afp") + { + CLog::Log(LOGERROR, "CAfpDirectory::%s - invalid protocol [%s]", __func__, path.GetProtocol().c_str()); + return false; + } + + struct afp_url afp_url; + + if (!BuildAfpUrl(path, &afp_url)) + { + return false; + } + + CStdString strMountpoint = GetMountPoint("afp", afp_url.servername, afp_url.volumename); + CStdString strFileName = afp_url.path; + + // path is not mounted - need to mount it + if(!CUtil::IsMountpoint(strMountpoint) && CUtil::GetFsMagic(strMountpoint+strFileName) != AFP_SUPER_MAGIC) + { + CStdString afpPath; + + if(strlen(afp_url.username) != 0) + afpPath += CStdString(" -u ") + CStdString(afp_url.username) + CStdString(" "); + + if(strlen(afp_url.uamname) != 0) + afpPath += CStdString("-a ") + CStdString("\"") + CStdString(afp_url.uamname) + CStdString("\"") + CStdString(" "); + + if(strlen(afp_url.password) != 0) + afpPath += "-p " + CStdString(afp_url.password) + CStdString(" "); + + afpPath += CStdString(afp_url.servername) + CStdString(":") + url_encode(afp_url.volumename); + + CLog::Log(LOGDEBUG, "CAfpDirectory::%s - mounting AFP share [%s:%s] ==> [%s]", __func__, afp_url.servername, afp_url.volumename, strMountpoint.c_str()); + + if(MountShare(afpPath, strMountpoint) == false) + { + UnMountShare(strMountpoint); + CLog::Log(LOGERROR, "CAfpDirectory::%s - failed to mount AFP share [%s:%s]", __func__, afp_url.servername, afp_url.volumename); + return false; + } + } + + CStdString strHddPath = strMountpoint + strFileName; + + item.m_strPath = strHddPath; + item.SetLabel(path.Get()); + + item.SetProperty("filename", strFileName); + + struct stat st; + if (stat(strHddPath.c_str(),&st) == 0) + { + item.m_bIsFolder = S_ISDIR(st.st_mode); + item.m_dateTime = st.st_mtime; + } + + if(item.m_bIsFolder) + { + item.SetProperty("isNetwork",true); + } + + return true; +} + +bool CAfpDirectory::GetVolumes(const CURI& url, CFileItemList &items) +{ + CStdString strVolumesCommand, strOutput; + int status; + struct afp_url afp_url; + + if (!BuildAfpUrl(url, &afp_url)) + { + return false; + } + + strVolumesCommand = "afp_client volumes"; + + if (strlen(afp_url.username) != 0) + strVolumesCommand += " -u " + CStdString(afp_url.username); + + if (strlen(afp_url.password) != 0) + strVolumesCommand += " -p " + CStdString(afp_url.password); + + if (strlen(afp_url.uamname) != 0) + strVolumesCommand += " -a " + CStdString("\"") + CStdString(afp_url.uamname) + CStdString("\""); + + strVolumesCommand += " " + CStdString(afp_url.servername); + + RunCommand(strVolumesCommand, status, strOutput); + + if(strOutput.Find("Login error:") != -1 || strOutput.Find("Could not pick a matching UAM") != -1 || strOutput.Find("Connection timed out") != -1 || strOutput.IsEmpty()) + { + EjectUser(url.Get()); + return false; + } + + if (strOutput.Find(';') == -1) + { + EjectUser(url.Get()); + CLog::Log(LOGERROR, "CAfpDirectory::%s - failed to read volumes, server [%s], error [%s]", __func__, afp_url.servername, strOutput.c_str()); + return false; + } + + CStdStringArray arr; + StringUtils::SplitString(strOutput, ";", arr); + + for(size_t i=0; im_bIsFolder = true; + pItem->m_strPath.Format("%s%s", url.Get(), arr[i]); + CUtil::AddSlashAtEnd(pItem->m_strPath); + pItem->SetProperty("isNetwork",true); + + items.Add(pItem); + } + + return true; +} + +CAfpDirectory::CAfpDirectory(void) +{} + +CAfpDirectory::~CAfpDirectory(void) +{} + +void CAfpDirectory::EjectUser(const CStdString& strPath) +{ + CURI url(strPath); + CStdString hostName = url.GetHostName(); + + CStdString cmd = "afp_client logout " + hostName; + + system(cmd.c_str()); + + hostName = url.GetHostName(); + + IMAPUSERNAMEPASSWORDS it = g_passwordManager.m_mapAFPPasswordCache.find(hostName); + if(it != g_passwordManager.m_mapAFPPasswordCache.end()) + { + g_passwordManager.m_mapAFPPasswordCache.erase(it); + } +} + +CStdString CAfpDirectory::HandlePath(const CStdString& strPath , bool dontUseGuestCredentials) +{ + if(strPath.Equals("afp://") || strPath.Equals("afp://all")) + { + return strPath; + } + + CStdString resultPath; + CURI urlIn(strPath); + + IMAPUSERNAMEPASSWORDS it = g_passwordManager.m_mapAFPPasswordCache.find(urlIn.GetHostName()); + if(!dontUseGuestCredentials && it == g_passwordManager.m_mapAFPPasswordCache.end()) + { + CStdString compName = urlIn.GetHostName(); + CStdString userName = urlIn.GetUserName(); + CStdString userPassword = urlIn.GetPassWord(); + + if(userName.IsEmpty()) + { + userName = "guest"; + userPassword = ""; + urlIn.SetPassword(""); + } + + //insert to map + g_passwordManager.m_mapAFPPasswordCache[compName] = make_pair(userName, userPassword); + + resultPath = urlIn.Get(); + + return resultPath; + } + + //test if share has password in map + it = g_passwordManager.m_mapAFPPasswordCache.find(urlIn.GetHostName()); + if(it != g_passwordManager.m_mapAFPPasswordCache.end()) + { + CStdString strPassword = g_passwordManager.m_mapAFPPasswordCache[urlIn.GetHostName()].second; + CStdString strUserName = g_passwordManager.m_mapAFPPasswordCache[urlIn.GetHostName()].first; + + //if enter as guest previously + if(strUserName.Equals("guest")) + { + resultPath = strPath; + } + else + { + urlIn.SetPassword(strPassword); + urlIn.SetUserName(strUserName); + resultPath = urlIn.Get(); + } + } + //pop enter userName and password dialog + else + { + EjectUser(strPath); + g_passwordManager.SetAFPShare(strPath); + if(g_passwordManager.GetAFPShareUserPassword()) + { + CURI urlnew( g_passwordManager.GetAFPShare()); + CStdString compName = urlnew.GetHostName(); + CStdString userName = urlnew.GetUserName(); + CStdString userPassword = urlnew.GetPassWord(); + + if(userName.Equals("guest") || userName.Equals("GUEST") || userName.Equals("Guest") ) + { + userName = "guest"; + userPassword = ""; + resultPath = strPath; + } + else + { + resultPath = urlnew.Get(); + } + //insert to map + g_passwordManager.m_mapAFPPasswordCache[compName] = make_pair(userName, userPassword); + } + } + + return resultPath; +} + +bool CAfpDirectory::GetDirectory(const CStdString& _strPath, CFileItemList &items) +{ + CStdString strPath; + CURI tempUrl(_strPath); + + if(!items.GetPropertyBOOL("notOpenPassword") && tempUrl.GetUserName().IsEmpty()) + { + + if(items.GetPropertyBOOL("dontUseGuestCredentials")) + { + strPath = HandlePath(_strPath, true); + } + else + { + strPath = HandlePath(_strPath); + } + if(strPath.IsEmpty()) + { + items.SetProperty("NotErrorDontShowErrorDialog",true); + return false; + } + } + else + { + strPath = _strPath; + } + + CURI url(strPath); + bool bResult = false; + + if(url.GetProtocol() != "afp") + { + CLog::Log(LOGERROR, "CAfpDirectory::%s - invalid protocol [%s]", __func__, url.GetProtocol().c_str()); + return false; + } + + CBrowserService* pBrowser = g_application.GetBrowserService(); + + if( strPath == "afp://" && pBrowser ) + { + pBrowser->GetShare( CBrowserService::AFP_SHARE, items ); + return true; + } + + // If we have the items in the cache, return them + if (g_directoryCache.GetDirectory(strPath, items)) + { + return true; + } + + if(strPath == "afp://all") + { + return ScanAfpShares(items); + } + + CStdString fileName = url.GetFileName(); + + if(fileName.IsEmpty()) + { + bResult = GetVolumes(url, items); + } + else + { + CUtil::RemoveSlashAtEnd(fileName); + url.SetFileName(fileName); + CFileItem item; + + if(false == GetResource(url, item)) + { + CLog::Log(LOGERROR, "CAfpDirectory::%s - failed to get resource for path [%s]", __func__, url.Get().c_str()); + return false; + } + + if(false == HasReadPermissions(item.m_strPath, url.GetUserName().IsEmpty())) + { + CLog::Log(LOGERROR, "CAfpDirectory::%s - no read permissions for path [%s]", __func__, item.m_strPath.c_str()); + return false; + } + + bResult = CDirectory::GetDirectory(item.m_strPath, items); + + for(int i=0; im_bIsFolder) + { + items[i]->SetProperty("isNetwork",true); + } + // build afp path + CStdString afpPath = items[i]->m_strPath; + afpPath.Replace(item.m_strPath, strPath); + + if (afpPath.length() >= strPath.length()) + { + CStdString strNewFilename = afpPath.substr(strPath.length()); + + CStdString strAfpFileName; + CStdString strFileName = item.GetProperty("filename"); + + strAfpFileName = strNewFilename; + + if(strAfpFileName.Left(1).Equals("/") && CUtil::HasSlashAtEnd(strPath)) + { + CUtil::RemoveSlashAtEnd(strPath); + } + + items[i]->m_strPath.Format("%s%s", strPath, strAfpFileName); + } + } + } + + return bResult; +} + +bool CAfpDirectory::Exists(const char* strPath) +{ + CFileItemList items; + if (GetDirectory(strPath,items)) + return true; + + return false; +} +#endif diff --git a/xbmc/FileSystem/AfpDirectory.h b/xbmc/FileSystem/AfpDirectory.h new file mode 100644 index 00000000..576e707b --- /dev/null +++ b/xbmc/FileSystem/AfpDirectory.h @@ -0,0 +1,43 @@ +#ifndef AFP_DIRECTORY_H +#define AFP_DIRECTORY_H + +#include "system.h" + +#ifdef HAS_AFP +#include "IDirectory.h" + +class CAFP +{ +public: + CAFP(){m_initialized = false;}; + virtual ~CAFP(){}; + void Init(); + void Deinit(); +private: + bool m_initialized; +}; + +struct afp_url; + +namespace DIRECTORY +{ +class CAfpDirectory : public IDirectory +{ +public: + CAfpDirectory(void); + virtual ~CAfpDirectory(void); + virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items); + virtual bool Exists(const char* strPath); + + static void EjectUser(const CStdString& strPath); + static bool GetResource(const CURI& path, CFileItem &item); + +private: + bool GetVolumes(const CURI& url, CFileItemList &items); + static CStdString HandlePath(const CStdString& strPath, bool dontUseGuestCredentials = false); + +}; +} +#endif + +#endif diff --git a/xbmc/FileSystem/BMSDirectory.cpp b/xbmc/FileSystem/BMSDirectory.cpp new file mode 100644 index 00000000..02bf7c2e --- /dev/null +++ b/xbmc/FileSystem/BMSDirectory.cpp @@ -0,0 +1,241 @@ +#include "system.h" + +#ifdef HAS_BMS +#include "Util.h" +#include "URL.h" +#include "FileItem.h" +#include "Directory.h" +#include "AfpDirectory.h" +#include "BrowserService.h" +#include "DirectoryCache.h" +#include "Application.h" +#include "utils/log.h" +#include "bxutils.h" +#include "Util.h" +#include "ZeroconfAvahi.h" +#include "ZeroconfBrowser.h" +#include "RSSDirectory.h" +#include "BMSDirectory.h" + + + +using namespace DIRECTORY; + +#define DEFAULT_PORT "8088" + + + +static bool ScanBmsShares(CFileItemList &items) +{ + CFileItemList shares; + + CDirectory::GetDirectory("zeroconf://", shares); + + for(int i=0; iGetProperty("protocol"); + + if(protocol.ToLower() == "bms") + { + CFileItemPtr pItem(new CFileItem()); + CStdString name = shares[i]->GetProperty("name"); + CStdString domain = shares[i]->GetProperty("domain"); + + if(pItem->m_bIsFolder) + { + pItem->SetProperty("isNetwork",true); + } + pItem->SetLabel(name); + pItem->m_bIsFolder = true; + + pItem->m_strPath.Format("bms://%s.%s", name, domain); + CUtil::AddSlashAtEnd(pItem->m_strPath); + + items.Add(pItem); + } + } + + return items.Size() != 0; +} + +static bool +GetHostAddress(const CStdString& strHostName, CStdString& strHostIp, CStdString& strHostPort) +{ + CStdString domain = "local"; + CStdString name; + int iPos = -1; + + iPos = strHostName.ReverseFind('.'); + if(iPos != -1) + { + name = strHostName.substr(0, iPos); + domain = strHostName.substr(iPos + 1, strHostName.length()); + } + + CZeroconfBrowser::ZeroconfService service(name, BOXEE_SERVICE_NAME, domain); + + if(!CZeroconfBrowser::GetInstance()->ResolveService(service)) + return false; + + strHostIp = service.GetIP(); + strHostPort.Format("%d", service.GetPort()); + + return true; +} + +bool CBmsDirectory::GetResource(const CURI& path, CFileItem &item) +{ + CStdString strFilename, strHostname, strHostIp; + CStdString strPath = path.Get(); + CStdString strPort; + + if(CUtil::HasSlashAtEnd(strPath)) + CUtil::RemoveSlashAtEnd(strPath); + + strHostname = path.GetHostName(); + strFilename = path.GetFileName(); + + if (CUtil::ValidateIpAddress(strHostname)) + { + strHostIp = strHostname; + } + else if (false == GetHostAddress(strHostname, strHostIp, strPort)) + { + CLog::Log(LOGERROR, "CBmsDirectory::%s - failed to found host address [%s]", __func__, strHostname.c_str()); + return false; + + } + if(item.m_bIsFolder) + { + item.SetProperty("isNetwork",true); + } + item.m_strPath.Format("http://%s:%s/%s", strHostIp, strPort, strFilename); + + return true; +} + + +CBmsDirectory::CBmsDirectory(void) +{} + +CBmsDirectory::~CBmsDirectory(void) +{} + + +bool CBmsDirectory::ReadDir(const CStdString& strPath, CFileItemList &items) +{ + CURI url(strPath); + CStdString strRssUrl, strHostIp; + CStdString strHostName = url.GetHostName(); + CStdString strFileName = url.GetFileName(); + CStdString strPort; + + if (!strFileName.IsEmpty()) + { + if (strFileName.c_str()[0] != '/') + strFileName = "/" + strFileName; + + CUtil::URLEncode(strFileName); + } + + if (CUtil::ValidateIpAddress(strHostName)) + { + strHostIp = strHostName; + } + else if (false == GetHostAddress(strHostName, strHostIp, strPort)) + { + CLog::Log(LOGERROR, "CBmsDirectory::%s - failed to found host address [%s]", __func__, strHostName.c_str()); + return false; + + } + + if(strPort == "") + { + strPort = DEFAULT_PORT; + } + strRssUrl.Format("rss://%s:%s/rss?path=%s", strHostIp, strPort, strFileName); + + CDirectory::GetDirectory(strRssUrl, items); + + for(int i=0; im_strPath); + CStdString strPath; + + // hack for playlist files + if (items[i]->IsPlayList() && items[i]->m_bIsFolder) + { + items[i]->m_bIsFolder = false; + } + + items[i]->ClearProperty("isinternetstream"); + items[i]->ClearProperty("isrss"); + + if(items[i]->m_bIsFolder) + { + std::map optionMap = u.GetOptionsAsMap(); + + strPath = optionMap["path"]; + CUtil::UrlDecode(strPath); + } + else + { + strPath = u.GetFileName(); + if (strPath.c_str()[0] != '/') + strPath = "/" + strPath; + } + + CStdString strSlash; + + if(items[i]->m_bIsFolder && !CUtil::HasSlashAtEnd(strPath)) + CUtil::AddSlashAtEnd(strPath); + + items[i]->m_strPath.Format("bms://%s%s", strHostName, strPath); + } + + return true; +} + +bool CBmsDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items) +{ + CURI url(strPath); + + m_cacheDirectory = DIR_CACHE_ALWAYS; + + if(url.GetProtocol() != "bms") + { + CLog::Log(LOGERROR, "CBmsDirectory::%s - invalid protocol [%s]", __func__, url.GetProtocol().c_str()); + return false; + } + + CBrowserService* pBrowser = g_application.GetBrowserService(); + + if( strPath == "bms://" && pBrowser ) + { + pBrowser->GetShare( CBrowserService::BMS_SHARE, items ); + return true; + } + + // If we have the items in the cache, return them + if (g_directoryCache.GetDirectory(strPath, items)) + { + return true; + } + + if(strPath == "bms://all") + { + return ScanBmsShares(items); + } + + return ReadDir(strPath, items); +} + +bool CBmsDirectory::Exists(const char* strPath) +{ + CFileItemList items; + if (GetDirectory(strPath,items)) + return true; + + return false; +} +#endif diff --git a/xbmc/FileSystem/BMSDirectory.h b/xbmc/FileSystem/BMSDirectory.h new file mode 100644 index 00000000..81ff0afd --- /dev/null +++ b/xbmc/FileSystem/BMSDirectory.h @@ -0,0 +1,26 @@ +#ifndef BMS_DIRECTORY_H +#define BMS_DIRECTORY_H + +#include "system.h" + +#ifdef HAS_BMS +#include "IDirectory.h" + +namespace DIRECTORY +{ +class CBmsDirectory : + public IDirectory +{ + bool ReadDir(const CStdString& strPath, CFileItemList &items); +public: + CBmsDirectory(void); + virtual ~CBmsDirectory(void); + virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items); + virtual bool Exists(const char* strPath); + + static bool GetResource(const CURI& path, CFileItem &item); +}; +} +#endif + +#endif diff --git a/xbmc/FileSystem/BoxeeBrowseMenuDirectory.cpp b/xbmc/FileSystem/BoxeeBrowseMenuDirectory.cpp new file mode 100644 index 00000000..736258e0 --- /dev/null +++ b/xbmc/FileSystem/BoxeeBrowseMenuDirectory.cpp @@ -0,0 +1,438 @@ + +#include "BoxeeBrowseMenuDirectory.h" +#include "utils/log.h" +#include "BoxeeUtils.h" +#include "lib/libBoxee/boxee.h" +#include "Directory.h" +#include "BoxeeDatabaseDirectory.h" +#include "MetadataResolverVideo.h" +#include "lib/libBoxee/bxutils.h" + +using namespace BOXEE; + +namespace DIRECTORY +{ + +CBoxeeBrowseMenuDirectory::CBoxeeBrowseMenuDirectory() +{ + +} + +CBoxeeBrowseMenuDirectory::~CBoxeeBrowseMenuDirectory() +{ + +} + +bool CBoxeeBrowseMenuDirectory::GetDirectory(const CStdString& strPath, CFileItemList &itemsList) +{ + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::GetDirectory - Enter function with [path=%s] (bmd)",strPath.c_str()); + + CURI url(strPath); + CStdString strProtocol = url.GetProtocol(); + + // Check if request if for "browsemenu" protocol + if (strProtocol.CompareNoCase("browsemenu") != 0) + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuDirectory::GetDirectory - Trying to retrieve files with invalid path [%s] - (bmd)",strPath.c_str()); + return false; + } + + CStdString strMediaType = url.GetHostName(); + CStdString strSection = url.GetShareName(); + std::map mapParams = url.GetOptionsAsMap(); + + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::GetDirectory - [strPath=%s] was parsed to [strMediaType=%s][section=%s] (bmd)",strPath.c_str(),strMediaType.c_str(), strSection.c_str()); + + if (strMediaType == "movies") + { + return HandleMoviesRequest(strPath,strMediaType,strSection,mapParams,itemsList); + } + else if (strMediaType == "shows") + { + return HandleShowsRequest(strPath,strMediaType,strSection,mapParams,itemsList); + } + else if (strMediaType == "apps") + { + return HandleAppsRequest(strPath,strMediaType,strSection,mapParams,itemsList); + } + else if (strMediaType == "trailers") + { + return HandleTrailersRequest(strPath,strMediaType,strSection,mapParams,itemsList); + } + + CLog::Log(LOGERROR,"CBoxeeBrowseMenuDirectory::GetDirectory - FAILED to handle [path=%s] (bmd)",strPath.c_str()); + + return true; +} + +bool CBoxeeBrowseMenuDirectory::HandleMoviesRequest(const CStdString& strPath,const CStdString& strMediaType,const CStdString& strSection,std::map& mapParams,CFileItemList &itemsList) +{ + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleMoviesRequest - enter function with [strPath=%s][strMediaType=%s][section=%s][numOfParams=%zu] (bmd)",strPath.c_str(),strMediaType.c_str(),strSection.c_str(),mapParams.size()); + + if (strSection == "genres") + { + return HandleGenresRequest("movies",strPath,mapParams,itemsList); + } + else if (strSection == "trailers") + { + return HandleTrailersSectionRequest(strPath,mapParams,itemsList); + } + else if (strSection == "providers") + { + return HandleProvidersRequest("movies",strPath,mapParams,itemsList); + } + else if (strSection == "sources") + { + return HandleSourcesRequest(strPath,mapParams,itemsList); + } + + CLog::Log(LOGERROR,"CBoxeeBrowseMenuDirectory::HandleMoviesRequest - FAILED to handle [strSection=%s]. [strPath=%s][dir=%s][section=%s][numOfParams=%zu] (bmd)",strSection.c_str(),strPath.c_str(),strMediaType.c_str(),strSection.c_str(),mapParams.size()); + return false; +} + +bool CBoxeeBrowseMenuDirectory::HandleShowsRequest(const CStdString& strPath,const CStdString& strMediaType,const CStdString& strSection,std::map& mapParams,CFileItemList &itemsList) +{ + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleShowsRequest - enter function with [strPath=%s][strMediaType=%s][section=%s][numOfParams=%zu] (bmd)",strPath.c_str(),strMediaType.c_str(),strSection.c_str(),mapParams.size()); + + if (strSection == "genres") + { + return HandleGenresRequest("shows",strPath,mapParams,itemsList); + } + else if (strSection == "providers") + { + return HandleProvidersRequest("shows",strPath,mapParams,itemsList); + } + + CLog::Log(LOGERROR,"CBoxeeBrowseMenuDirectory::HandleShowsRequest - FAILED to handle [strSection=%s]. [strPath=%s][strMediaType=%s][section=%s][numOfParams=%zu] (bmd)",strSection.c_str(),strPath.c_str(),strMediaType.c_str(),strSection.c_str(),mapParams.size()); + return false; +} + +bool CBoxeeBrowseMenuDirectory::HandleAppsRequest(const CStdString& strPath,const CStdString& strMediaType,const CStdString& strSection,std::map& mapParams,CFileItemList &itemsList) +{ + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleAppsRequest - enter function with [strPath=%s][strMediaType=%s][section=%s][numOfParams=%zu] (bmd)",strPath.c_str(),strMediaType.c_str(),strSection.c_str(),mapParams.size()); + + if (strSection == "categories") + { + return HandleAppsCategoriesRequest(strPath,mapParams,itemsList); + } + + CLog::Log(LOGERROR,"CBoxeeBrowseMenuDirectory::HandleAppsRequest - FAILED to handle [strSection=%s]. [strPath=%s][strMediaType=%s][section=%s][numOfParams=%zu] (bmd)",strSection.c_str(),strPath.c_str(),strMediaType.c_str(),strSection.c_str(),mapParams.size()); + return false; +} + +bool CBoxeeBrowseMenuDirectory::HandleTrailersRequest(const CStdString& strPath,const CStdString& strMediaType,const CStdString& strSection,std::map& mapParams,CFileItemList &itemsList) +{ + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleTrailersRequest - enter function with [strPath=%s][strMediaType=%s][section=%s][numOfParams=%zu] (bmd)",strPath.c_str(),strMediaType.c_str(),strSection.c_str(),mapParams.size()); + + if (strSection == "genres") + { + return HandleGenresRequest("trailers",strPath,mapParams,itemsList); + } + + CLog::Log(LOGERROR,"CBoxeeBrowseMenuDirectory::HandleTrailersRequest - FAILED to handle [strSection=%s]. [strPath=%s][strMediaType=%s][section=%s][numOfParams=%zu] (bmd)",strSection.c_str(),strPath.c_str(),strMediaType.c_str(),strSection.c_str(),mapParams.size()); + return false; +} + +//////////// +// Genres // +//////////// + +bool CBoxeeBrowseMenuDirectory::HandleGenresRequest(const CStdString& strMedia,const CStdString& strPath,std::map& mapParams,CFileItemList &itemsList) +{ + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleGenresRequest - enter function with [strMedia=%s][strPath=%s][numOfParams=%zu] (bmd)",strMedia.c_str(),strPath.c_str(),mapParams.size()); + + if (strMedia == "movies") + { + return HandleMoviesGenresRequest(strPath,mapParams,itemsList); + } + else if (strMedia == "shows") + { + return HandleShowsGenresRequest(strPath,mapParams,itemsList); + } + else if (strMedia == "trailers") + { + return HandleTrailersGenresRequest(strPath,mapParams,itemsList); + } + + CLog::Log(LOGERROR,"CBoxeeBrowseMenuDirectory::HandleGenresRequest - FAILED to handle [strMedia=%s]. [strPath=%s][numOfParams=%zu] (bmd)",strMedia.c_str(),strPath.c_str(),mapParams.size()); + return false; +} + +bool CBoxeeBrowseMenuDirectory::HandleMoviesGenresRequest(const CStdString& strPath, std::map& mapParams,CFileItemList &itemsList) +{ + std::vector vecGenres; + + const CStdString genreType = mapParams["type"]; + if (genreType == "all") + { + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleMoviesGenresRequest - handle request for library genres [genreType=%s]. [strPath=%s][numOfParams=%zu] (bmd)",genreType.c_str(),strPath.c_str(),mapParams.size()); + BOXEE::Boxee::GetInstance().GetBoxeeClientServerComManager().GetMovieGenres(vecGenres); + } + else if (genreType == "local") + { + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleMoviesGenresRequest - handle request for local genres [genreType=%s]. [strPath=%s][numOfParams=%zu] (bmd)",genreType.c_str(),strPath.c_str(),mapParams.size()); + CreateMoviesLocalGenres(vecGenres); + } + else + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuDirectory::HandleMoviesGenresRequest - FAILED to handle request for genres type [%s] (bmd)",genreType.c_str()); + return false; + } + + mapParams["category"] = genreType; + ConvertGenresItemVecToFileItemList(vecGenres,itemsList,"movies",mapParams); + return true; +} + +bool CBoxeeBrowseMenuDirectory::HandleShowsGenresRequest(const CStdString& strPath,std::map& mapParams,CFileItemList &itemsList) +{ + std::vector vecGenres; + + CStdString genreType = mapParams["type"]; + if (genreType == "all") + { + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleShowsGenresRequest - handle request for library genres [genreType=%s]. [strPath=%s][numOfParams=%zu] (bmd)",genreType.c_str(),strPath.c_str(),mapParams.size()); + BOXEE::Boxee::GetInstance().GetBoxeeClientServerComManager().GetTvGenres(vecGenres); + } + else if (genreType == "local") + { + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleShowsGenresRequest - handle request for local genres [genreType=%s]. [strPath=%s][numOfParams=%zu] (bmd)",genreType.c_str(),strPath.c_str(),mapParams.size()); + CreateShowsLocalGenres(vecGenres); + } + else + { + CLog::Log(LOGERROR,"CBoxeeBrowseMenuDirectory::HandleShowsGenresRequest - FAILED to handle request for genres type [%s] (bmd)",genreType.c_str()); + return false; + } + + mapParams["category"] = genreType; + ConvertGenresItemVecToFileItemList(vecGenres,itemsList,"shows",mapParams); + return true; +} + +bool CBoxeeBrowseMenuDirectory::HandleTrailersGenresRequest(const CStdString& strPath,std::map& mapParams,CFileItemList &itemsList) +{ + std::vector vecGenres; + BOXEE::Boxee::GetInstance().GetBoxeeClientServerComManager().GetMovieGenres(vecGenres); + + mapParams["category"] = "trailers"; + mapParams["section"] = GENRE_SECTION; + + ConvertGenresItemVecToFileItemList(vecGenres,itemsList,"trailers",mapParams); + return true; +} + +void CBoxeeBrowseMenuDirectory::ConvertGenresItemVecToFileItemList(const std::vector& vecGenres, CFileItemList& itemsList, const CStdString& strMedia, std::map& mapParams) +{ + for (size_t i = 0; iSetLabel(vecGenres[i].m_genreText); + genreItem->SetProperty("genre_label",vecGenres[i].m_genreText); + genreItem->SetProperty("genre_id",vecGenres[i].m_genreId); + genreItem->SetProperty("isClickable",true); + genreItem->m_strPath = "boxeeui://"; + genreItem->m_strPath += strMedia; + + mapParams["genre"] = vecGenres[i].m_genreId; + + genreItem->m_strPath += BoxeeUtils::BuildParameterString(mapParams); + + itemsList.Add(genreItem); + } +} + +void CBoxeeBrowseMenuDirectory::CreateMoviesLocalGenres(std::vector& outputGenres) +{ + std::set setGenres; + std::vector vecGenres; + + CMetadataResolverVideo::GetLocalMoviesGenres(setGenres); + BOXEE::Boxee::GetInstance().GetBoxeeClientServerComManager().GetMovieGenres(vecGenres); + CreateLocalGenres(setGenres,vecGenres, outputGenres); +} + +void CBoxeeBrowseMenuDirectory::CreateShowsLocalGenres(std::vector& outputGenres) +{ + std::set setGenres; + std::vector vecGenres; + + CMetadataResolverVideo::GetLocalShowsGenres(setGenres); + BOXEE::Boxee::GetInstance().GetBoxeeClientServerComManager().GetTvGenres(vecGenres); + CreateLocalGenres(setGenres,vecGenres, outputGenres); +} + +void CBoxeeBrowseMenuDirectory::CreateLocalGenres(const std::set& setGenres,const std::vector& vecGenres, std::vector& outputGenres) +{ + for (std::set::const_iterator it = setGenres.begin(); it != setGenres.end() ; it++) + { + std::string strCurrent = (*it); + BOXEE::BXUtils::StringToUpper(strCurrent); + + for (std::vector::const_iterator it2 = vecGenres.begin() ; it2 != vecGenres.end() ; it2++) + { + // we need to compare the genre ids we read in the db to those we got from the server + if (it2->m_genreId.compare(strCurrent) == 0) + { + //insert it into the output set + outputGenres.push_back((*it2)); + } + } + } +} + +////////// +// Apps // +////////// + +bool CBoxeeBrowseMenuDirectory::HandleAppsCategoriesRequest(const CStdString& strPath,const std::map& mapParams,CFileItemList &itemsList) +{ + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleAppsCategoriesRequest - enter function with [strPath=%s][numOfParams=%zu] (bmd)",strPath.c_str(),mapParams.size()); + + std::vector vecAppCategories; + BOXEE::Boxee::GetInstance().GetBoxeeClientServerComManager().GetAppsCategories(vecAppCategories); + CreateAppsCategoriesButtons(vecAppCategories, itemsList); + return true; +} + +void CBoxeeBrowseMenuDirectory::CreateAppsCategoriesButtons(std::vector& vecAppCategories, CFileItemList& itemsList) +{ + for (size_t i = 0; iSetLabel(vecAppCategories[i].m_Text); + appCategoryItem->m_strPath = "boxeeui://apps/?category=all&categoryfilter="; + appCategoryItem->m_strPath += vecAppCategories[i].m_Id; + appCategoryItem->SetProperty("isClickable",true); + itemsList.Add(appCategoryItem); + } +} + +////////////// +// Trailers // +////////////// + +bool CBoxeeBrowseMenuDirectory::HandleTrailersSectionRequest(const CStdString& strPath,const std::map& mapParams,CFileItemList &itemsList) +{ + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleTrailersSectionRequest - enter function with [strPath=%s][numOfParams=%zu] (bmd)",strPath.c_str(),mapParams.size()); + + std::vector outputTrailers; + BOXEE::Boxee::GetInstance().GetBoxeeClientServerComManager().GetMovieTrailerSections(outputTrailers); + CreateTrailerSectionButtons(outputTrailers, itemsList); + return true; +} + +void CBoxeeBrowseMenuDirectory::CreateTrailerSectionButtons(std::vector& vecTrailer, CFileItemList& itemsList) +{ + for (size_t i = 0; iSetLabel(vecTrailer[i].m_Text); + + if (!vecTrailer[i].m_strPath.empty()) + { + trailerCategoryItem->SetProperty("isClickable",false); + + CStdString path = vecTrailer[i].m_strPath; + path.Replace("boxee://movies","browsemenu://trailers"); + trailerCategoryItem->SetProperty("child",path); + } + else + { + trailerCategoryItem->m_strPath.Format("boxeeui://movies/?category=trailers§ion=%s",vecTrailer[i].m_Id.c_str()); + trailerCategoryItem->SetProperty("isClickable",true); + trailerCategoryItem->SetProperty("openInWindow",WINDOW_BOXEE_BROWSE_MOVIES); + } + + itemsList.Add(trailerCategoryItem); + } +} + +//////////////////////// +// Providers/channels // +//////////////////////// + +bool CBoxeeBrowseMenuDirectory::HandleProvidersRequest(const CStdString& strMedia,const CStdString& strPath,std::map& mapParams,CFileItemList &itemsList) +{ + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleProvidersRequest - enter function with [strMedia=%s][strPath=%s][numOfParams=%zu] (bmd)",strMedia.c_str(),strPath.c_str(),mapParams.size()); + + if (strMedia == "movies") + { + return HandleMovieProvidersRequest(strPath,mapParams,itemsList); + } + else if (strMedia == "shows") + { + return HandleShowsProvidersRequest(strPath,mapParams,itemsList); + } + + CLog::Log(LOGERROR,"CBoxeeBrowseMenuDirectory::HandleProvidersRequest - FAILED to handle [strMedia=%s]. [strPath=%s][numOfParams=%zu] (bmd)",strMedia.c_str(),strPath.c_str(),mapParams.size()); + return false; +} + +bool CBoxeeBrowseMenuDirectory::HandleMovieProvidersRequest(const CStdString& strPath,const std::map& mapParams,CFileItemList &itemsList) +{ + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleProvidersRequest - enter function with [strPath=%s][numOfParams=%zu] (bmd)",strPath.c_str(),mapParams.size()); + + CFileItemList sourceList; + DIRECTORY::CDirectory::GetDirectory("boxee://sources/movies",sourceList); + CreateProvidersButtons(sourceList, itemsList); + itemsList.m_strPath = sourceList.m_strPath; + return true; +} + +bool CBoxeeBrowseMenuDirectory::HandleShowsProvidersRequest(const CStdString& strPath,const std::map& mapParams,CFileItemList &itemsList) +{ + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleProvidersRequest - enter function with [strPath=%s][numOfParams=%zu] (bmd)",strPath.c_str(),mapParams.size()); + + CFileItemList sourceList; + DIRECTORY::CDirectory::GetDirectory("boxee://sources/shows",sourceList); + CreateProvidersButtons(sourceList, itemsList); + itemsList.m_strPath = sourceList.m_strPath; + return true; +} + +void CBoxeeBrowseMenuDirectory::CreateProvidersButtons(const CFileItemList& sourceList, CFileItemList& itemsList) +{ + for (int i=0; iSetLabel(sourceList.Get(i)->GetLabel()); + sourceItem->m_strPath = "boxeeui://movies/?category=store&provider="; + sourceItem->m_strPath += sourceList.Get(i)->GetProperty("sourceid"); + sourceItem->SetProperty("isClickable",true); + itemsList.Add(sourceItem); + } +} + +///////////// +// Sources // +///////////// + +bool CBoxeeBrowseMenuDirectory::HandleSourcesRequest(const CStdString& strPath,const std::map& mapParams,CFileItemList &itemsList) +{ + CLog::Log(LOGDEBUG,"CBoxeeBrowseMenuDirectory::HandleSourcesRequest - enter function with [strPath=%s][numOfParams=%zu] (bmd)",strPath.c_str(),mapParams.size()); + + // NOTE: currently handling only "video" sources + VECSOURCES* videoSources = g_settings.GetSourcesFromType("video"); + CreateSourcesButtons(*videoSources,itemsList); + return true; +} + +void CBoxeeBrowseMenuDirectory::CreateSourcesButtons(const VECSOURCES& Sources, CFileItemList& itemsList) +{ + // NOTE: currently handling only "video" sources + + for (VECSOURCES::const_iterator it = Sources.begin(); it != Sources.end(); it++) + { + CFileItemPtr sourceItem(new CFileItem()); + sourceItem->SetLabel(it->strName); + sourceItem->m_strPath = "boxeeui://movies/?category=local&source="; + sourceItem->m_strPath += it->strPath; + sourceItem->SetProperty("isClickable",true); + itemsList.Add(sourceItem); + } +} + +} // namespace + + diff --git a/xbmc/FileSystem/BoxeeBrowseMenuDirectory.h b/xbmc/FileSystem/BoxeeBrowseMenuDirectory.h new file mode 100644 index 00000000..4be3d9bc --- /dev/null +++ b/xbmc/FileSystem/BoxeeBrowseMenuDirectory.h @@ -0,0 +1,80 @@ +#ifndef BOXEEBROWSEMENUDIRECTORY_H_ +#define BOXEEBROWSEMENUDIRECTORY_H_ + +#include "IDirectory.h" +#include "MediaSource.h" +#include "lib/libBoxee/bxgenresmanager.h" +#include "lib/libBoxee/bxappboxmanager.h" +#include "lib/libBoxee/bxtrailersmanager.h" + +#include +#include + +using namespace BOXEE; + +namespace DIRECTORY +{ + +class CBoxeeBrowseMenuDirectory : public IDirectory +{ +public: + + CBoxeeBrowseMenuDirectory(); + virtual ~CBoxeeBrowseMenuDirectory(); + virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items); + +private: + + bool HandleMoviesRequest(const CStdString& strPath,const CStdString& strDir,const CStdString& strFile,std::map& mapParams,CFileItemList &itemsList); + bool HandleShowsRequest(const CStdString& strPath,const CStdString& strDir,const CStdString& strFile,std::map& mapParams,CFileItemList &itemsList); + bool HandleAppsRequest(const CStdString& strPath,const CStdString& strDir,const CStdString& strFile,std::map& mapParams,CFileItemList &itemsList); + bool HandleTrailersRequest(const CStdString& strPath,const CStdString& strMediaType,const CStdString& strSection,std::map& mapParams,CFileItemList &itemsList); + + //////////// + // genres // + //////////// + + bool HandleGenresRequest(const CStdString& strMedia,const CStdString& strPath,std::map& mapParams,CFileItemList &itemsList); + bool HandleMoviesGenresRequest(const CStdString& strPath,std::map& mapParams,CFileItemList &itemsList); + bool HandleShowsGenresRequest(const CStdString& strPath,std::map& mapParams,CFileItemList &itemsList); + bool HandleTrailersGenresRequest(const CStdString& strPath,std::map& mapParams,CFileItemList &itemsList); + void ConvertGenresItemVecToFileItemList(const std::vector& vecGenres, CFileItemList& itemsList, const CStdString& strMedia, std::map& mapParams); + void CreateMoviesLocalGenres(std::vector& outputGenres); + void CreateShowsLocalGenres(std::vector& outputGenres); + void CreateLocalGenres(const std::set& setGenres,const std::vector& vecGenres, std::vector& outputGenres); + + ////////////// + // trailers // + ////////////// + + bool HandleTrailersSectionRequest(const CStdString& strPath,const std::map& mapParams,CFileItemList &itemsList); + void CreateTrailerSectionButtons(std::vector& vecTrailer, CFileItemList& itemsList); + + //////////////////////// + // providers/channels // + //////////////////////// + + bool HandleProvidersRequest(const CStdString& strMedia,const CStdString& strPath,std::map& mapParams,CFileItemList &itemsList); + bool HandleMovieProvidersRequest(const CStdString& strPath,const std::map& mapParams,CFileItemList &itemsList); + bool HandleShowsProvidersRequest(const CStdString& strPath,const std::map& mapParams,CFileItemList &itemsList); + void CreateProvidersButtons(const CFileItemList& sourceList, CFileItemList& itemsList); + + ///////////// + // sources // + ///////////// + + bool HandleSourcesRequest(const CStdString& strPath,const std::map& mapParams,CFileItemList &itemsList); + void CreateSourcesButtons(const VECSOURCES& Sources,CFileItemList& itemsList); + + ////////// + // apps // + ////////// + + bool HandleAppsCategoriesRequest(const CStdString& strPath,const std::map& mapParams,CFileItemList &itemsList); + void CreateAppsCategoriesButtons(std::vector& vecCategories, CFileItemList& itemsList); + +}; + +} + +#endif /*BOXEEBROWSEMENUDIRECTORY_H_*/ diff --git a/xbmc/FileSystem/BoxeeServerOTADirectory.cpp b/xbmc/FileSystem/BoxeeServerOTADirectory.cpp new file mode 100644 index 00000000..a446666d --- /dev/null +++ b/xbmc/FileSystem/BoxeeServerOTADirectory.cpp @@ -0,0 +1,245 @@ + +#include "StdString.h" +#include +#include "PlatformDefs.h" +#include "BoxeeServerOTADirectory.h" +#include "Application.h" +#include "json/value.h" +#include "json/reader.h" +#include "../../lib/libBoxee/boxee.h" +#include "../../lib/libBoxee/bxconfiguration.h" +#include "../BoxeeUtils.h" +#include "FileSystem/DirectoryCache.h" +#include "SpecialProtocol.h" +#include "URL.h" +#include "FileSystem/FileCurl.h" +#include "Util.h" +#include "GUISettings.h" +#include "../cores/dvb/dvbmanager.h" + + +using namespace BOXEE; +using namespace XFILE; + +namespace DIRECTORY +{ + +CBoxeeServerOTADirectory::CBoxeeServerOTADirectory() +{ + m_cacheDirectory = DIR_CACHE_ALWAYS; // by default, caching is done. +} + +CBoxeeServerOTADirectory::~CBoxeeServerOTADirectory() +{ + +} + +bool CBoxeeServerOTADirectory::GetDirectory(const CStdString& strPath, CFileItemList &items) +{ + CLog::Log(LOGDEBUG, "CBoxeeServerOTADirectory::GetDirectory - enter function with [path=%s] (ota)", strPath.c_str()); + + m_cacheDirectory = DIR_CACHE_ALWAYS; + + CURI url(strPath); + CStdString strProtocol = url.GetProtocol(); + std::map mapOptions = url.GetOptionsAsMap(); // NOTICE: the URL options are decoded here + + if (strProtocol.CompareNoCase("ota") != 0) + return false; + + CLog::Log(LOGDEBUG, "CBoxeeServerOTADirectory::GetDirectory - [HostName=%s][ShareName=%s][Domain=%s][FileName=%s][Options=%s] (ota)", url.GetHostName().c_str(), url.GetShareName().c_str(), url.GetDomain().c_str(), url.GetFileName().c_str(), url.GetOptions().c_str()); + + // The type of the request movies or tvshows + CStdString strType = url.GetHostName(); + // The actual request + CStdString strRequest = url.GetShareName(); + + if (strType == "location") + { + return HandleLocationRequest(strRequest, mapOptions, items); + } + else if(strType == "epg" && !mapOptions.empty()) + { + return HandleEPGRequest(strRequest, mapOptions, items); + } + else + { + CLog::Log(LOGERROR, "CBoxeeServerOTADirectory::GetDirectory - unrecognized url [%s] or not enough parameters (ota)", strPath.c_str()); + return false; + } + + return true; +} + +bool CBoxeeServerOTADirectory::HandleEPGRequest(const CStdString& strRequest, std::map& mapOptions, CFileItemList &items) +{ + Json::Value response; + CStdString strUrl; + + if (strRequest == "channels") + { + //use http://app.boxee.tv/epg/channel?dvb_triplets=CSV + //use http://app.boxee.tv/epg/channel?provider_gn_id=CSV + strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.ApiGetChannels","http://app.boxee.tv/epg/channel"); + } + else if (strRequest == "programs") + { + //use it with http://app.boxee.tv/epg/program?channel_gn_ids=CSV + strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.ApiGetPrograms","http://app.boxee.tv/epg/program"); + } + + strUrl += BoxeeUtils::BuildParameterString(mapOptions); + long retCode = HandleJsonRequest(strUrl,response); + + if (retCode == 200) + { + if (ParseJsonResponse(response, items) > 0) + return true; + } + + return false; +} + +bool CBoxeeServerOTADirectory::HandleLocationRequest(const CStdString& strRequest, std::map& mapOptions, CFileItemList &items) +{ + Json::Value response; + CStdString strUrl; + + if (strRequest == "zipcode") + { + //http://app.boxee.tv/user/location + strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.ApiDetermineLocation","http://app.boxee.tv/user/location"); + } + else if (strRequest == "countries") + { + //http://app.boxee.tv/location/countries + strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.ApiGetCountries","http://app.boxee.tv/location/countries"); + } + else if(strRequest == "cities") + { + //http://app.boxee.tv/location/city?country=US + strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.ApiGetCities","http://app.boxee.tv/location/city"); + } +/* //http://app.boxee.tv/user/location + strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.ApiDetermineLocation","http://app.boxee.tv/user/location"); + break; + //http://app.boxee.tv/location/city?postal_code=10001 //need to ask server team*/ + + strUrl += BoxeeUtils::BuildParameterString(mapOptions); + long retCode = HandleJsonRequest(strUrl,response); + + if (retCode == 200) + { + if (ParseJsonResponse(response, items) > 0) + return true; + } + + return false; +} + +int CBoxeeServerOTADirectory::ParseJsonResponse(const Json::Value& jsonValue, CFileItemList& outputList) +{ + outputList.Clear(); + + if (jsonValue.isArray()) + { + for (size_t j = 0; j < jsonValue.size(); j++) + { + Json::Value m = jsonValue[(int) j]; + Json::Value::Members keys = m.getMemberNames(); + + CFileItemPtr jsonItem(new CFileItem("jsonObject")); + + for (size_t i = 0; i < keys.size(); i++) + { + jsonItem->SetProperty(keys[i], m[keys[i]].asString()); + } + outputList.Add(jsonItem); + } + } + + return outputList.Size(); +} + + + +bool CBoxeeServerOTADirectory::HasOption(const std::map& mapOptions, const CStdString& optionName, CStdString& optionValue) +{ + std::map::const_iterator lb = mapOptions.lower_bound(optionName); + if(lb != mapOptions.end() && !(mapOptions.key_comp()(optionName, lb->first))) + { + optionValue = lb->second; + return true; + } + return false; +} + +bool CBoxeeServerOTADirectory::Exists(const char* strPath) +{ + // NOT IMPLEMENTED + return true; + +} + +void CBoxeeServerOTADirectory::AddParametersToRemoteRequest(std::map& mapRemoteOptions) +{ + if (!CUtil::IsAdultAllowed()) + { + mapRemoteOptions["adult"] = "no"; + } + else + { + mapRemoteOptions["adult"] = "yes"; + } + + if (g_guiSettings.GetBool("filelists.filtergeoip2")) + { + CStdString countryCode = g_application.GetCountryCode(); + + if (!countryCode.IsEmpty()) + { + mapRemoteOptions["geo"] = countryCode; + } + } +} + +long CBoxeeServerOTADirectory::HandleJsonRequest(const std::string& url, Json::Value& response) +{ + if (url.empty()) + return -1; + + std::string strUrl = url; + + BXCurl curl; + + curl.SetVerbose(BOXEE::Boxee::GetInstance().IsVerbose()); + curl.SetCredentials(BOXEE::Boxee::GetInstance().GetCredentials()); + + ListHttpHeaders headers; + headers.push_back("Connection: keep-alive"); + curl.HttpSetHeaders(headers); + + CStdString strJson = curl.HttpGetString(strUrl.c_str()); + + Json::Reader reader; + + long returnCode = curl.GetLastRetCode(); + + if (returnCode==200 && !strJson.IsEmpty()) + { + if (!reader.parse(strJson,response)) + { + return -1; + } + } + + return returnCode; +} + +DIR_CACHE_TYPE CBoxeeServerOTADirectory::GetCacheType(const CStdString& strPath) const +{ + return m_cacheDirectory; +} + +} + diff --git a/xbmc/FileSystem/BoxeeServerOTADirectory.h b/xbmc/FileSystem/BoxeeServerOTADirectory.h new file mode 100644 index 00000000..8a71c8f9 --- /dev/null +++ b/xbmc/FileSystem/BoxeeServerOTADirectory.h @@ -0,0 +1,31 @@ +#ifndef CBOXEESERVEROTADIRECTORY_H_ +#define CBOXEESERVEROTADIRECTORY_H_ + +#include "IDirectory.h" +#include "../../lib/libjson/include/json/value.h" +#include + +namespace DIRECTORY +{ + +class CBoxeeServerOTADirectory : public IDirectory +{ +public: + CBoxeeServerOTADirectory(); + virtual ~CBoxeeServerOTADirectory(); + virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items); + virtual bool Exists(const char* strPath); + virtual DIR_CACHE_TYPE GetCacheType(const CStdString& strPath) const; + static bool HasOption(const std::map& mapOptions, const CStdString& optionName, CStdString& optionValue); + static void AddParametersToRemoteRequest(std::map& mapRemoteOptions); + +private: + bool HandleLocationRequest(const CStdString& strRequest, std::map& mapOptions, CFileItemList &items); + bool HandleEPGRequest(const CStdString& strRequest, std::map& mapOptions, CFileItemList &items); + long HandleJsonRequest(const std::string& url, Json::Value& response); + int ParseJsonResponse(const Json::Value& jsonValue, CFileItemList& outputList); +}; + +} + +#endif /*CBOXEESERVEROTADIRECTORY_H_*/ diff --git a/xbmc/FileSystem/CIFSDirectory.cpp b/xbmc/FileSystem/CIFSDirectory.cpp new file mode 100644 index 00000000..16ab618d --- /dev/null +++ b/xbmc/FileSystem/CIFSDirectory.cpp @@ -0,0 +1,550 @@ +#include "system.h" + +#ifdef HAS_CIFS +#include "Util.h" +#include "URL.h" +#include "FileItem.h" +#include "Directory.h" +#include "CIFSDirectory.h" +#include "SMBUtils.h" +#include "BrowserService.h" +#include "SMBDirectory.h" +#include "DirectoryCache.h" +#include "Application.h" +#include "utils/log.h" +#include "bxutils.h" +#include "GUISettings.h" +#include "TimeUtils.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace DIRECTORY; + + +#define MOUNT_ROOT "/tmp/mnt/" + +#ifndef CIFS_SUPER_MAGIC +#define CIFS_SUPER_MAGIC 0xFF534D42 +#endif + + +static CStdString GetMountPoint(const CStdString &strType, const CStdString &strHost, const CStdString &volumesName) +{ + CStdString strPath = strType + "_" + strHost + "_" + volumesName; + CUtil::URLEncode(strPath); + + return MOUNT_ROOT + strPath + "/"; +} + +static int UnMountShare(const CStdString &strMountPoint) +{ + return umount(strMountPoint.c_str()); +} + +static int MountShare(const CStdString &strShareName, const CStdString &strMountPoint, const CStdString& strOptions) +{ + int status; + + if(CUtil::IsMountpoint(strMountPoint)) + { + UnMountShare(strMountPoint); + } + + ::CreateDirectory(strMountPoint, NULL); + + status = mount(strShareName.c_str(), strMountPoint.c_str(), "cifs", MS_RDONLY, strOptions.c_str()); + + + if(status) + { + if (errno) + status = errno; + return status; + } + + // test for mountpoint + if(!CUtil::IsMountpoint(strMountPoint)) + { + CLog::Log(LOGERROR, "%s - Failed to mount [%s]", __func__, strMountPoint.c_str()); + return -1; + } + + return status; +} + +static bool GetHostAddress(const CStdString& strHostName, CStdString& strHostIp, CStdString& strWorkgroup) +{ + CBrowserService* pBrowser = g_application.GetBrowserService(); + bool bSuccess = false; + + if( pBrowser ) + { + bSuccess = pBrowser->GetHostAddress(strHostName, strHostIp, strWorkgroup); + } + + if(!bSuccess) + { + bSuccess = CUtil::GetHostByName(strHostName, strHostIp); + if(!bSuccess) + { + CStdString strHostNameDomain = strHostName + ".local"; + + bSuccess = CUtil::GetHostByName(strHostNameDomain, strHostIp); + } + + } + + return bSuccess; +} + +CCifsDirectory::CCifsDirectory(void) +{} + +CCifsDirectory::~CCifsDirectory(void) +{} + +int CCifsDirectory::GetResource(const CURI& path, CFileItem &item) +{ + if(path.GetProtocol() != "smb") + { + CLog::Log(LOGERROR, "CCifsDirectory::%s - invalid protocol [%s]", __func__, path.GetProtocol().c_str()); + return false; + } + + CStdString strHostName = path.GetHostName(); + CStdString strFullPath = path.GetFileName(); + CStdString strVolumeName, strFileName; + int status; + const char * cifsAuthMethods[] = {"ntlmssp","ntlmsspi","ntlm","ntlmi"}; // ntlmsspi, ntlmssp, ntlmv2i, ntlmv2, ntlmi, ntlm, nontlm + + if (strFullPath.IsEmpty()) + { + CLog::Log(LOGERROR, "CCifsDirectory::%s - invalid volume name in path [%s]", __func__, path.Get().c_str()); + return -1; + } + + int iPos = strFullPath.Find("/", 1); + if (iPos != -1) + { + strVolumeName = strFullPath.substr(0, iPos); + strFileName = strFullPath.substr(iPos + 1, strFullPath.length()); + } + else + { + strVolumeName = strFullPath; + } + + CStdString strMountpoint = GetMountPoint("smb", strHostName, strVolumeName); + + // path is not mounted - need to mount it + if(!CUtil::IsMountpoint(strMountpoint) && CUtil::GetFsMagic(strMountpoint+strFileName) != CIFS_SUPER_MAGIC) + { + CStdString strOptions, strShareName, strHostIp, strWorkgroup; + + if (CUtil::ValidateIpAddress(strHostName)) + { + strHostIp = strHostName; + } + + GetHostAddress(strHostName, strHostIp, strWorkgroup); + + if (!path.GetUserName().IsEmpty()) + strOptions += ",user=" + path.GetUserName(); + else + strOptions += ",user=guest"; + + if(!strWorkgroup.IsEmpty()) + strOptions += ",domain=" + strWorkgroup; + + if (!path.GetPassWord().IsEmpty()) + { + CStdString pass = path.GetPassWord(); + if(pass.Find(",") != -1) + { + pass.Replace(",",",,"); + } + CUtil::UrlDecode(pass); + strOptions += ",pass=" + pass; + } + if(!strHostIp.IsEmpty()) + strOptions += ",ip=" + strHostIp; + + strOptions += ",iocharset=utf8"; + + strShareName.Format("//%s/%s", strHostIp.IsEmpty() ? strHostName : strHostIp, strVolumeName); + + CLog::Log(LOGDEBUG, "CCifsDirectory::%s - mounting CIFS share [%s] ==> [%s]", __func__, strShareName.c_str(), strMountpoint.c_str()); + + bool eacces = false; + + status = MountShare(strShareName, strMountpoint, strOptions); + + for(int i=0; ((status == EINVAL) || (status == EOPNOTSUPP) || (status == EACCES)) && im_strPath); + CFileItemList l; + + nTries = 3; + while(nTries--) + { + smbDir.GetDirectory(list[i]->m_strPath, l); + if(!l.IsEmpty()) + break; + + Sleep(1000); + } + + // loop over all computers in the workgroup + for(int j=0; jm_strPath); + + if(l.IsEmpty()) + { + CLog::Log(LOGERROR, "CCifsDirectory::%s - workgroup [%s] seems to be empty", __func__, wg.GetHostName().c_str()); + continue; + } + + l[j]->SetProperty("Workgroup", wg.GetHostName()); + l[j]->SetProperty("HostName", u.GetHostName()); + } + + items.Append(l); + } + + CLog::Log(LOGDEBUG, "CifsDirectory::ScanShares - took %d ms, found %d computers", CTimeUtils::GetTimeMS() - nStartTime, items.Size()); + + return true; +} + +bool CCifsDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items) +{ + CURI url(strPath); + bool bResult = false; + + if(url.GetProtocol() != "smb") + { + CLog::Log(LOGERROR, "CCifsDirectory::%s - invalid protocol [%s]", __func__, url.GetProtocol().c_str()); + return false; + } + + if(SMBUtils::ProcessPath(strPath, items)) + { + return true; + } + + CBrowserService* pBrowser = g_application.GetBrowserService(); + + if( strPath == "smb://" && pBrowser ) + { + pBrowser->GetShare( CBrowserService::SMB_SHARE, items ); + return true; + } + + if (strPath == "smb://all") + { + return ScanShares(items); + } + + // If we have the items in the cache, return them + if (g_directoryCache.GetDirectory(strPath, items)) + { + return true; + } + + CStdString fileName = url.GetFileName(); + + if (fileName.IsEmpty()) + { + CSMBDirectory smbDir; + + bResult = smbDir.GetDirectory(strPath, items); + + CURI url(strPath); + if(url.GetUserName() != "" && bResult == 1) + { + g_passwordManager.m_mapCIFSPasswordCache[url.GetHostName()].first = url.GetUserName(); + g_passwordManager.m_mapCIFSPasswordCache[url.GetHostName()].second = url.GetPassWord(); + } + } + else + { + CFileItem item; + int status = EACCES; + + status = HandlePath(strPath, item, items.GetPropertyBOOL("notOpenPassword")); + + + if(item.GetPropertyBOOL("NotErrorDontShowErrorDialog")) + { + items.SetProperty("NotErrorDontShowErrorDialog",true); + return false; + } + + if (status && status != EACCES) + { + CLog::Log(LOGERROR, "CCifsDirectory::%s - failed to get resource for path [%s]", __func__, url.Get().c_str()); + return false; + } + + // due a bug in scandir(), CHDDDirectory::GetDirectory sometimes fails to read cifs mountpoints + bResult = CUtil::GetHDDDirectory(item.m_strPath, items); + + for(int i=0; im_bIsFolder) + { + items[i]->SetProperty("isNetwork",true); + } + CStdString smbPath = items[i]->m_strPath; + smbPath.Replace(item.m_strPath, strPath); + + if (smbPath.length() >= strPath.length()) + { + CStdString strNewFilename = smbPath.substr(strPath.length()); + + CStdString strSmbFileName; + CStdString strFileName = item.GetProperty("filename"); + + strSmbFileName = strNewFilename; + + if (CUtil::HasSlashAtEnd(strPath)) + items[i]->m_strPath.Format("%s%s", strPath, strSmbFileName); + else + items[i]->m_strPath.Format("%s/%s", strPath, strSmbFileName); + } + } + } + + return bResult; +} + +bool CCifsDirectory::Exists(const char* strPath) +{ + CFileItemList items; + if (GetDirectory(strPath,items)) + return true; + + return false; +} +#endif diff --git a/xbmc/FileSystem/CIFSDirectory.h b/xbmc/FileSystem/CIFSDirectory.h new file mode 100644 index 00000000..2d90ad8d --- /dev/null +++ b/xbmc/FileSystem/CIFSDirectory.h @@ -0,0 +1,30 @@ +#ifndef _CIFS_DIRECTORY_H +#define _CIFS_DIRECTORY_H + +#include "system.h" + +#ifdef HAS_CIFS +#include "IDirectory.h" + +namespace DIRECTORY +{ +class CCifsDirectory : + public IDirectory +{ +public: + CCifsDirectory(void); + virtual ~CCifsDirectory(void); + virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items); + virtual bool Exists(const char* strPath); + + static int GetResource(const CURI& path, CFileItem &item); + +private: + int HandlePath(const CStdString& strPath, CFileItem &item, bool dontOpenPasswordDialog = false); + bool ScanShares(CFileItemList &items); + +}; +} +#endif + +#endif diff --git a/xbmc/FileSystem/DVBFile.cpp b/xbmc/FileSystem/DVBFile.cpp new file mode 100755 index 00000000..2737c45e --- /dev/null +++ b/xbmc/FileSystem/DVBFile.cpp @@ -0,0 +1,154 @@ +#include "system.h" + +#ifdef HAS_DVB + +#include "DVBFile.h" +#include "Util.h" +#include "URL.h" +#include "FileFactory.h" +#include "utils/log.h" +#include "Application.h" +#include + +using namespace XFILE; +using namespace std; + +CDVBFile::CDVBFile() +{ + m_bOpened = false; +} + +CDVBFile::~CDVBFile() +{ + Close(); +} +void CDVBFile::Close() +{ + std::vector tuners = DVBManager::GetInstance().GetTuners(); + if (tuners.size() == 0) + { + CLog::Log(LOGERROR, "CDVBFile::Close no tuners found"); + return; + } + + DvbTunerPtr tuner = tuners[0]; + tuner->Untune(); + + m_bOpened = false; +} + +bool CDVBFile::Open(const CURI& url) +{ + if (m_bOpened) + Close(); + + if (url.GetProtocol() != "dvb") + { + CLog::Log(LOGERROR, "CDVBFile::Open - invalid protocol %s", url.GetProtocol().c_str()); + return false; + } + + std::vector tuners = DVBManager::GetInstance().GetTuners(); + if (tuners.size() == 0) + { + CLog::Log(LOGERROR, "CDVBFile::Open no tuners found"); + return false; + } + + DvbTunerPtr tuner = tuners[0]; + + DvbChannelPtr channel = DVBManager::GetInstance().GetCurrentChannel(); + if (channel.get() == NULL) + { + CLog::Log(LOGERROR, "CDVBFile::Open - failed to get channel from DVB manager"); + return false; + } + + tuner->Tune(*channel); + + m_bOpened = true; + + return true; +} + +unsigned int CDVBFile::Read(void* buffer, int64_t size) +{ + if (!m_bOpened) return -1; + + std::vector tuners = DVBManager::GetInstance().GetTuners(); + if (tuners.size() == 0) + { + CLog::Log(LOGERROR, "CDVBFile::Open no tuners found"); + return false; + } + + DvbTunerPtr tuner = tuners[0]; + + return tuner->Read((char *)buffer, size); +} + +int64_t CDVBFile::Seek(int64_t pos, int whence) +{ + return -1; +} + +bool CDVBFile::NextChannel() +{ + return true; +} + +bool CDVBFile::PrevChannel() +{ + return true; +} + +bool CDVBFile::SelectChannel(unsigned int channelIndex) +{ + DvbChannels& channels = DVBManager::GetInstance().GetChannels(); + if (channelIndex > channels.Size() - 1 ) + { + CLog::Log(LOGERROR, "CDVBFile::SelectChannel no such channel %d", channelIndex); + return false; + } + + DvbChannelPtr channelPtr = channels.GetChannelByIndex(channelIndex); + if (channelPtr.get() == NULL) + { + CLog::Log(LOGERROR, "CDVBFile::SelectChannel - failed to get channel info for %d", channelIndex); + return false; + } + + std::vector tuners = DVBManager::GetInstance().GetTuners(); + if (tuners.size() == 0) + { + CLog::Log(LOGERROR, "CDVBFile::SelectChannel no tuners found"); + return false; + } + + DvbTunerPtr tuner = tuners[0]; + + if (!tuner->Tune(*channelPtr)) + { + CLog::Log(LOGERROR, "CDVBFile::SelectChannel - failed to tune to %d", channelIndex); + return false; + } + + return true; +} + +int CDVBFile::GetProgramId() +{ + std::vector tuners = DVBManager::GetInstance().GetTuners(); + if (tuners.size() == 0) + { + CLog::Log(LOGERROR, "CDVBFile::GetProgramId no tuners found"); + return 0; + } + + DvbTunerPtr tuner = tuners[0]; + + DvbChannelPtr curChannel = DVBManager::GetInstance().GetCurrentChannel(); + return curChannel->GetIndex(); +} + +#endif diff --git a/xbmc/FileSystem/DVBFile.h b/xbmc/FileSystem/DVBFile.h new file mode 100755 index 00000000..c58f7c12 --- /dev/null +++ b/xbmc/FileSystem/DVBFile.h @@ -0,0 +1,74 @@ +#pragma once +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "system.h" + +#ifdef HAS_DVB + +#include "IFile.h" +#include "ILiveTV.h" +#include "VideoInfoTag.h" +#include "dvb/dvbmanager.h" + +namespace XFILE { + +class CDVBFile + : public IFile + , ILiveTVInterface +{ +public: + CDVBFile(); + virtual ~CDVBFile(); + virtual bool Open(const CURI& url); + virtual int64_t Seek(int64_t pos, int whence=SEEK_SET); + virtual int64_t GetPosition() { return -1; } + virtual int64_t GetLength() { return -1; } + virtual int Stat(const CURI& url, struct __stat64* buffer) { return -1; } + virtual void Close(); + virtual unsigned int Read(void* buffer, int64_t size); + virtual CStdString GetContent() { return "video/x-mpegts"; } + + virtual bool Delete(const CURI& url) { return false; } + virtual bool Exists(const CURI& url) { return false; } + + virtual ILiveTVInterface* GetLiveTV() {return (ILiveTVInterface*)this;} + + virtual bool NextChannel(); + virtual bool PrevChannel(); + virtual bool SelectChannel(unsigned int channel); + + virtual int GetTotalTime() { return 0; } + virtual int GetStartTime() { return 0; } + virtual bool UpdateItem(CFileItem& item) { return false; } + + virtual bool SkipNext(){return true;} + + virtual int GetProgramId(); + +protected: + + bool m_bOpened; +}; + +} + +#endif diff --git a/xbmc/FileSystem/FileAfp.cpp b/xbmc/FileSystem/FileAfp.cpp new file mode 100644 index 00000000..fe98487b --- /dev/null +++ b/xbmc/FileSystem/FileAfp.cpp @@ -0,0 +1,137 @@ + +#include "system.h" + +#ifdef HAS_AFP + +#include "FileItem.h" +#include "FileFactory.h" +#include "FileAfp.h" +#include "URL.h" +#include "Util.h" +#include "utils/log.h" +#include "AfpDirectory.h" +#include "File.h" + + +using namespace XFILE; +using namespace DIRECTORY; + +CFileAfp::CFileAfp() +{ + m_file = NULL; + m_bOpened = false; +} + +CFileAfp::~CFileAfp() +{ + Close(); + + if( m_file ) + delete m_file; + + m_file = NULL; +} + + +int64_t CFileAfp::GetPosition() +{ + if (!m_bOpened) return -1; + return m_file->GetPosition(); +} + +int64_t CFileAfp::GetLength() +{ + if (!m_bOpened) return -1; + return m_file->GetLength(); +} + +bool CFileAfp::Open(const CURI& url) +{ + if(url.GetProtocol() != "afp") + { + CLog::Log(LOGERROR, "CFileAfp::Open - invalid protocol"); + return false; + } + + CFileItem item; + CAfpDirectory dir; + + if(dir.GetResource(url, item)) + { + m_bOpened = true; + m_file = CFileFactory::CreateLoader(item.m_strPath); + if( m_file ) + { + CLog::Log(LOGDEBUG, "CFileAfp::Open on stream (%s)", item.m_strPath.c_str()); + return m_file->Open( item.m_strPath ); + } + } + + CLog::Log(LOGERROR, "CFileAfp::Open - failed to get resource for file %s", url.Get().c_str()); + + return false; +} + +bool CFileAfp::Exists(const CURI& url) +{ + CFileItem item; + CAfpDirectory dir; + + if(dir.GetResource(url, item)) + { + return CFile::Exists(item.m_strPath); + } + + return false; +} + +int CFileAfp::Stat(const CURI& url, struct __stat64* buffer) +{ + int res = -1; + CFileItem item; + CAfpDirectory dir; + + if(url.GetProtocol() != "afp") + { + CLog::Log(LOGERROR, "CFileAfp::Stat - invalid protocol"); + return -1; + } + + if(dir.GetResource(url, item)) + { + IFile* file; + + file = CFileFactory::CreateLoader(item.m_strPath); + if(file) + { + CURI u(item.m_strPath); + res = file->Stat(u,buffer); + delete file; + } + } + + return res; +} + +unsigned int CFileAfp::Read(void* lpBuf, int64_t uiBufSize) +{ + if (!m_bOpened) return -1; + return m_file->Read(lpBuf, uiBufSize); +} + +int64_t CFileAfp::Seek(int64_t iFilePosition, int iWhence) +{ + if (!m_bOpened) return -1; + return m_file->Seek(iFilePosition, iWhence); +} + +void CFileAfp::Close() +{ + if( m_file ) + m_file->Close(); + + m_bOpened = false; +} + +#endif // HAS_AFP + diff --git a/xbmc/FileSystem/FileAfp.h b/xbmc/FileSystem/FileAfp.h new file mode 100644 index 00000000..1531286b --- /dev/null +++ b/xbmc/FileSystem/FileAfp.h @@ -0,0 +1,39 @@ +#ifndef _FILEAFP_H +#define _FILEAFP_H + +#include "system.h" + +#ifdef HAS_AFP + +#include "IFile.h" + +extern "C" { +#include +} + +namespace XFILE +{ + +class CFileAfp : public IFile +{ +public: + CFileAfp(); + virtual ~CFileAfp(); + virtual int64_t GetPosition(); + virtual int64_t GetLength(); + virtual bool Open(const CURI& url); + virtual bool Exists(const CURI& url); + virtual int Stat(const CURI& url, struct __stat64* buffer); + virtual unsigned int Read(void* lpBuf, int64_t uiBufSize); + virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET); + virtual void Close(); + +protected: + bool m_bOpened; + IFile *m_file; +}; +} + +#endif + +#endif diff --git a/xbmc/FileSystem/FileBms.cpp b/xbmc/FileSystem/FileBms.cpp new file mode 100644 index 00000000..dd4fe842 --- /dev/null +++ b/xbmc/FileSystem/FileBms.cpp @@ -0,0 +1,148 @@ + +#include "system.h" + +#ifdef HAS_BMS + +#include "FileItem.h" +#include "FileFactory.h" +#include "FileBms.h" +#include "URL.h" +#include "Util.h" +#include "utils/log.h" +#include "BMSDirectory.h" +#include "File.h" + + +using namespace XFILE; +using namespace DIRECTORY; + +CFileBms::CFileBms() +{ + m_file = NULL; + m_bOpened = false; +} + +CFileBms::~CFileBms() +{ + Close(); + + if( m_file ) + delete m_file; + + m_file = NULL; +} + + +int64_t CFileBms::GetPosition() +{ + if (!m_bOpened) return -1; + return m_file->GetPosition(); +} + +int64_t CFileBms::GetLength() +{ + if (!m_bOpened) return -1; + return m_file->GetLength(); +} + +bool CFileBms::Open(const CURI& url) +{ + if(url.GetProtocol() != "bms") + { + CLog::Log(LOGERROR, "CFileBms::Open - invalid protocol"); + return false; + } + + CFileItem item; + CBmsDirectory dir; + + if(dir.GetResource(url, item)) + { + m_bOpened = true; + m_file = CFileFactory::CreateLoader(item.m_strPath); + if( m_file ) + { + CLog::Log(LOGDEBUG, "CFileBms::Open on stream (%s)", item.m_strPath.c_str()); + return m_file->Open( item.m_strPath );; + } + } + + CLog::Log(LOGERROR, "CFileBms::Open - failed to get resource for file %s", url.Get().c_str()); + + return false; +} + +bool CFileBms::Exists(const CURI& url) +{ + CFileItem item; + CBmsDirectory dir; + + if(dir.GetResource(url, item)) + { + return CFile::Exists(item.m_strPath); + } + + return false; +} + +int CFileBms::Stat(const CURI& url, struct __stat64* buffer) +{ + int res = -1; + CFileItem item; + CBmsDirectory dir; + CFileItemList items; + + if(url.GetProtocol() != "bms") + { + CLog::Log(LOGERROR, "CFileBms::Stat - invalid protocol"); + return -1; + } + + dir.GetDirectory(url.Get(), items); + + // test for folder + if(items.Size() != 0 ) + { + buffer->st_mode = 0; + buffer->st_mode |= S_IFDIR; + return 0; + } + + if(dir.GetResource(url, item)) + { + IFile* file; + + file = CFileFactory::CreateLoader(item.m_strPath); + if(file) + { + CURI u(item.m_strPath); + res = file->Stat(u,buffer); + delete file; + } + } + + return res; +} + +unsigned int CFileBms::Read(void* lpBuf, int64_t uiBufSize) +{ + if (!m_bOpened) return -1; + return m_file->Read(lpBuf, uiBufSize); +} + +int64_t CFileBms::Seek(int64_t iFilePosition, int iWhence) +{ + if (!m_bOpened) return -1; + return m_file->Seek(iFilePosition, iWhence); +} + +void CFileBms::Close() +{ + if( m_file ) + m_file->Close(); + + m_bOpened = false; +} + +#endif // HAS_BMS + diff --git a/xbmc/FileSystem/FileBms.h b/xbmc/FileSystem/FileBms.h new file mode 100644 index 00000000..82b6cb1a --- /dev/null +++ b/xbmc/FileSystem/FileBms.h @@ -0,0 +1,35 @@ +#ifndef _FILEBMS_H +#define _FILEBMS_H + +#include "system.h" + +#ifdef HAS_BMS + +#include "IFile.h" + +namespace XFILE +{ + +class CFileBms : public IFile +{ +public: + CFileBms(); + virtual ~CFileBms(); + virtual int64_t GetPosition(); + virtual int64_t GetLength(); + virtual bool Open(const CURI& url); + virtual bool Exists(const CURI& url); + virtual int Stat(const CURI& url, struct __stat64* buffer); + virtual unsigned int Read(void* lpBuf, int64_t uiBufSize); + virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET); + virtual void Close(); + +protected: + bool m_bOpened; + IFile *m_file; +}; +} + +#endif + +#endif diff --git a/xbmc/FileSystem/FileCifs.cpp b/xbmc/FileSystem/FileCifs.cpp new file mode 100644 index 00000000..9256926c --- /dev/null +++ b/xbmc/FileSystem/FileCifs.cpp @@ -0,0 +1,144 @@ + +#include "system.h" + +#ifdef HAS_CIFS + +#include "FileItem.h" +#include "FileFactory.h" +#include "FileCifs.h" +#include "URL.h" +#include "Util.h" +#include "utils/log.h" +#include "CIFSDirectory.h" +#include "File.h" + + +using namespace XFILE; +using namespace DIRECTORY; + +CFileCifs::CFileCifs() +{ + m_file = NULL; + m_bOpened = false; +} + +CFileCifs::~CFileCifs() +{ + Close(); + + if( m_file ) + delete m_file; + + m_file = NULL; +} + + +int64_t CFileCifs::GetPosition() +{ + if (!m_bOpened) return -1; + return m_file->GetPosition(); +} + +int64_t CFileCifs::GetLength() +{ + if (!m_bOpened) return -1; + return m_file->GetLength(); +} + +bool CFileCifs::Open(const CURI& url) +{ + if(url.GetProtocol() != "smb") + { + CLog::Log(LOGERROR, "CFileCifs::Open - invalid protocol"); + return false; + } + + CFileItem item; + CCifsDirectory dir; + int status; + + status = dir.GetResource(url, item); + + if(status == 0) + { + m_file = CFileFactory::CreateLoader(item.m_strPath); + if( m_file ) + { + m_bOpened = true; + + CLog::Log(LOGDEBUG, "CFileCifs::Open on stream (%s)", item.m_strPath.c_str()); + return m_file->Open( item.m_strPath ); + } + } + + CLog::Log(LOGERROR, "CFileCifs::Open - failed to get resource for file %s", url.Get().c_str()); + + return false; +} + +bool CFileCifs::Exists(const CURI& url) +{ + CFileItem item; + CCifsDirectory dir; + int status; + + status = dir.GetResource(url, item); + + if(status == 0) + { + return CFile::Exists(item.m_strPath); + } + + return false; +} + +int CFileCifs::Stat(const CURI& url, struct __stat64* buffer) +{ + int res = -1; + CFileItem item; + CCifsDirectory dir; + + if(url.GetProtocol() != "smb") + { + CLog::Log(LOGERROR, "CFileCifs::Stat - invalid protocol"); + return -1; + } + + if(dir.GetResource(url, item) == 0) + { + IFile* file; + + file = CFileFactory::CreateLoader(item.m_strPath); + if(file) + { + CURI u(item.m_strPath); + res = file->Stat(u,buffer); + delete file; + } + } + + return res; +} + +unsigned int CFileCifs::Read(void* lpBuf, int64_t uiBufSize) +{ + if (!m_bOpened) return -1; + return m_file->Read(lpBuf, uiBufSize); +} + +int64_t CFileCifs::Seek(int64_t iFilePosition, int iWhence) +{ + if (!m_bOpened) return -1; + return m_file->Seek(iFilePosition, iWhence); +} + +void CFileCifs::Close() +{ + if( m_file ) + m_file->Close(); + + m_bOpened = false; +} + +#endif // HAS_CIFS + diff --git a/xbmc/FileSystem/FileCifs.h b/xbmc/FileSystem/FileCifs.h new file mode 100644 index 00000000..bb4b3978 --- /dev/null +++ b/xbmc/FileSystem/FileCifs.h @@ -0,0 +1,35 @@ +#ifndef _FILECifs_H +#define _FILECifs_H + +#include "system.h" + +#ifdef HAS_CIFS + +#include "IFile.h" + +namespace XFILE +{ + +class CFileCifs : public IFile +{ +public: + CFileCifs(); + virtual ~CFileCifs(); + virtual int64_t GetPosition(); + virtual int64_t GetLength(); + virtual bool Open(const CURI& url); + virtual bool Exists(const CURI& url); + virtual int Stat(const CURI& url, struct __stat64* buffer); + virtual unsigned int Read(void* lpBuf, int64_t uiBufSize); + virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET); + virtual void Close(); + +protected: + bool m_bOpened; + IFile *m_file; +}; +} + +#endif + +#endif diff --git a/xbmc/FileSystem/FileNfs.cpp b/xbmc/FileSystem/FileNfs.cpp new file mode 100644 index 00000000..8e309019 --- /dev/null +++ b/xbmc/FileSystem/FileNfs.cpp @@ -0,0 +1,133 @@ + +#include "system.h" + +#ifdef HAS_NFS + +#include "FileItem.h" +#include "FileFactory.h" +#include "FileNfs.h" +#include "URL.h" +#include "utils/log.h" +#include "NfsDirectory.h" +#include "File.h" +using namespace XFILE; +using namespace DIRECTORY; + +CFileNfs::CFileNfs() +{ + m_file = NULL; + m_bOpened = false; +} + +CFileNfs::~CFileNfs() +{ + Close(); + + if( m_file ) + delete m_file; + + m_file = NULL; +} + +int64_t CFileNfs::GetPosition() +{ + if (!m_bOpened) return -1; + return m_file->GetPosition(); +} + +int64_t CFileNfs::GetLength() +{ + if (!m_bOpened) return -1; + return m_file->GetLength(); +} + +bool CFileNfs::Open(const CURI& url) +{ + if(url.GetProtocol() != "nfs") + { + CLog::Log(LOGERROR, "CFileNfs::Open - invalid protocol"); + return false; + } + + CFileItem item; + CNfsDirectory dir; + + if(dir.GetResource(url, item)) + { + m_bOpened = true; + m_file = CFileFactory::CreateLoader(item.m_strPath); + if( m_file ) + { + CLog::Log(LOGDEBUG, "CFileNfs::Open on stream (%s)", item.m_strPath.c_str()); + return m_file->Open( item.m_strPath ); + } + } + + CLog::Log(LOGERROR, "CFileNfs::Open - failed to get resource for file %s", url.Get().c_str()); + + return false; +} + +bool CFileNfs::Exists(const CURI& url) +{ + CFileItem item; + CNfsDirectory dir; + + if(dir.GetResource(url, item)) + { + return CFile::Exists(item.m_strPath); + } + + return false; +} + +int CFileNfs::Stat(const CURI& url, struct __stat64* buffer) +{ + int res = -1; + CFileItem item; + CNfsDirectory dir; + + if(url.GetProtocol() != "nfs") + { + CLog::Log(LOGERROR, "CFileNfs::Stat - invalid protocol"); + return -1; + } + + if(dir.GetResource(url, item)) + { + IFile* file; + + file = CFileFactory::CreateLoader(item.m_strPath); + if(file) + { + CURI u(item.m_strPath); + res = file->Stat(u,buffer); + delete file; + } + } + + return res; +} + +unsigned int CFileNfs::Read(void* lpBuf, int64_t uiBufSize) +{ + if (!m_bOpened) return -1; + return m_file->Read(lpBuf, uiBufSize); +} + +int64_t CFileNfs::Seek(int64_t iFilePosition, int iWhence) +{ + if (!m_bOpened) return -1; + return m_file->Seek(iFilePosition, iWhence); +} + +void CFileNfs::Close() +{ + if( m_file ) + m_file->Close(); + + m_bOpened = false; +} + +#endif // HAS_NFS + diff --git a/xbmc/FileSystem/FileNfs.h b/xbmc/FileSystem/FileNfs.h new file mode 100644 index 00000000..b2161aea --- /dev/null +++ b/xbmc/FileSystem/FileNfs.h @@ -0,0 +1,34 @@ +#ifndef _FILENFS_H +#define _FILENFS_H + +#include "system.h" + +#ifdef HAS_NFS + +#include "IFile.h" + +namespace XFILE +{ + +class CFileNfs : public IFile +{ +public: + CFileNfs(); + virtual ~CFileNfs(); + virtual int64_t GetPosition(); + virtual int64_t GetLength(); + virtual bool Open(const CURI& url); + virtual bool Exists(const CURI& url); + virtual int Stat(const CURI& url, struct __stat64* buffer); + virtual unsigned int Read(void* lpBuf, int64_t uiBufSize); + virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET); + virtual void Close(); +protected: + bool m_bOpened; + IFile *m_file; +}; +} + +#endif + +#endif diff --git a/xbmc/FileSystem/FileSystem.pro b/xbmc/FileSystem/FileSystem.pro new file mode 100644 index 00000000..0f67bc95 --- /dev/null +++ b/xbmc/FileSystem/FileSystem.pro @@ -0,0 +1,235 @@ +include(../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../ ../cores ../linux ../../guilib ../lib/UnrarXLib ../utils +INCLUDEPATH += ../lib/libcdio/libcdio/include +INCLUDEPATH += ../lib/libBoxee +INCLUDEPATH += ../lib/libUPnP/Platinum/Source/Core \ +DEFINES += __STDC_FORMAT_MACROS \ +SOURCES += \ +UPnPVirtualPathDirectory.cpp \ +HTSPDirectory.cpp \ + \ +UDFDirectory.cpp \ +FileHD.cpp \ +HTTPDirectory.cpp \ +FileSmb.cpp \ +DllLibCurl.cpp \ +iso9660.cpp \ +AppBoxDirectory.cpp \ +FileFileReader.cpp \ +DirectoryHistory.cpp \ +PlaylistFileDirectory.cpp \ +NptXbmcFile.cpp \ +CMythSession.cpp \ +DirectoryTuxBox.cpp \ +VirtualDirectory.cpp \ +SpecialProtocolDirectory.cpp \ +MusicFileDirectory.cpp \ +SmartPlaylistDirectory.cpp \ +DAAPDirectory.cpp \ +RarManager.cpp \ +FileTuxBox.cpp \ +FileRar.cpp \ +VTPDirectory.cpp \ +FileFactory.cpp \ +MusicSearchDirectory.cpp \ +FTPParse.cpp \ +CDDADirectory.cpp \ +FileCDDA.cpp \ +ScriptDirectory.cpp \ +PipesManager.cpp \ +FileUDF.cpp \ +cddb.cpp \ +BoxeeUserActionsDirectory.cpp \ +HTSPSession.cpp \ +RTVDirectory.cpp \ +PlaylistDirectory.cpp \ +RingBuffer.cpp \ +VideoDatabaseDirectory.cpp \ +RepositoriesDirectory.cpp \ +FileCurl.cpp \ +BoxeeFriendsDirectory.cpp \ +FactoryDirectory.cpp \ +PluginDirectory.cpp \ +MusicDatabaseDirectory.cpp \ +SAPFile.cpp \ +udf25.cpp \ +BoxeeItemsHistoryDirectory.cpp \ +IDirectory.cpp \ +BoxeeShortcutsDirectory.cpp \ +SpecialProtocol.cpp \ +CacheStrategy.cpp \ +FileRTV.cpp \ +BoxeeFeedDirectory.cpp \ +FileSpecialProtocol.cpp \ +BoxeeDatabaseDirectory.cpp \ +Directory.cpp \ +MultiPathDirectory.cpp \ +LastFMDirectory.cpp \ +DirectoryCache.cpp \ +FileDAAP.cpp \ +SMBDirectory.cpp \ +XBMSDirectory.cpp \ +SAPDirectory.cpp \ +FTPDirectory.cpp \ +FileXBMSP.cpp \ +HDHomeRun.cpp \ +CMythDirectory.cpp \ +ZeroconfDirectory.cpp \ +FileLastFM.cpp \ +FilePipe.cpp \ +ShoutcastDirectory.cpp \ +StackDirectory.cpp \ +CacheMemBuffer.cpp \ +AppsDirectory.cpp \ +ASAPFileDirectory.cpp \ +FileISO.cpp \ +NSFFileDirectory.cpp \ +BoxeeServerDirectory.cpp \ +File.cpp \ +FactoryFileDirectory.cpp \ +SourcesDirectory.cpp \ +ZipDirectory.cpp \ +HDDirectory.cpp \ +RSSDirectory.cpp \ +FileCache.cpp \ +VTPFile.cpp \ +ShoutcastRipFile.cpp \ +VTPSession.cpp \ +ISO9660Directory.cpp \ +FilePlaylist.cpp \ +cdioSupport.cpp \ +ZipManager.cpp \ +UPnPDirectory.cpp \ +RarDirectory.cpp \ +NetworkDirectory.cpp \ +OGGFileDirectory.cpp \ +CMythFile.cpp \ +SIDFileDirectory.cpp \ +FileMusicDatabase.cpp \ +FileZip.cpp \ +FileUPnP.cpp \ +IFile.cpp \ +MultiPathFile.cpp \ +FileShoutcast.cpp \ +VirtualPathDirectory.cpp \ + + +HEADERS += \ +UPnPVirtualPathDirectory.h \ +HTSPDirectory.h \ + \ +UDFDirectory.h \ +FileHD.h \ +HTTPDirectory.h \ +FileSmb.h \ +DllLibCurl.h \ +iso9660.h \ +AppBoxDirectory.h \ +FileFileReader.h \ +DirectoryHistory.h \ +PlaylistFileDirectory.h \ +NptXbmcFile.h \ +CMythSession.h \ +DirectoryTuxBox.h \ +VirtualDirectory.h \ +SpecialProtocolDirectory.h \ +MusicFileDirectory.h \ +SmartPlaylistDirectory.h \ +DAAPDirectory.h \ +RarManager.h \ +FileTuxBox.h \ +FileRar.h \ +VTPDirectory.h \ +FileFactory.h \ +MusicSearchDirectory.h \ +FTPParse.h \ +CDDADirectory.h \ +FileCDDA.h \ +ScriptDirectory.h \ +PipesManager.h \ +FileUDF.h \ +cddb.h \ +BoxeeUserActionsDirectory.h \ +HTSPSession.h \ +RTVDirectory.h \ +PlaylistDirectory.h \ +RingBuffer.h \ +VideoDatabaseDirectory.h \ +RepositoriesDirectory.h \ +FileCurl.h \ +BoxeeFriendsDirectory.h \ +FactoryDirectory.h \ +PluginDirectory.h \ +MusicDatabaseDirectory.h \ +SAPFile.h \ +udf25.h \ +BoxeeItemsHistoryDirectory.h \ +IDirectory.h \ +BoxeeShortcutsDirectory.h \ +SpecialProtocol.h \ +CacheStrategy.h \ +FileRTV.h \ +BoxeeFeedDirectory.h \ +FileSpecialProtocol.h \ +BoxeeDatabaseDirectory.h \ +Directory.h \ +MultiPathDirectory.h \ +LastFMDirectory.h \ +DirectoryCache.h \ +FileDAAP.h \ +SMBDirectory.h \ +XBMSDirectory.h \ +SAPDirectory.h \ +FTPDirectory.h \ +FileXBMSP.h \ +HDHomeRun.h \ +CMythDirectory.h \ +ZeroconfDirectory.h \ +FileLastFM.h \ +FilePipe.h \ +ShoutcastDirectory.h \ +StackDirectory.h \ +CacheMemBuffer.h \ +AppsDirectory.h \ +ASAPFileDirectory.h \ +FileISO.h \ +NSFFileDirectory.h \ +BoxeeServerDirectory.h \ +File.h \ +FactoryFileDirectory.h \ +SourcesDirectory.h \ +ZipDirectory.h \ +HDDirectory.h \ +RSSDirectory.h \ +FileCache.h \ +VTPFile.h \ +ShoutcastRipFile.h \ +VTPSession.h \ +ISO9660Directory.h \ +FilePlaylist.h \ +cdioSupport.h \ +ZipManager.h \ +UPnPDirectory.h \ +RarDirectory.h \ +NetworkDirectory.h \ +OGGFileDirectory.h \ +CMythFile.h \ +SIDFileDirectory.h \ +FileMusicDatabase.h \ +FileZip.h \ +FileUPnP.h \ +IFile.h \ +MultiPathFile.h \ +FileShoutcast.h \ +VirtualPathDirectory.h \ + + +INCLUDEPATH += ../../ diff --git a/xbmc/FileSystem/FileUDF.cpp b/xbmc/FileSystem/FileUDF.cpp new file mode 100644 index 00000000..0b404914 --- /dev/null +++ b/xbmc/FileSystem/FileUDF.cpp @@ -0,0 +1,150 @@ +#include "FileUDF.h" +#include "URL.h" +#include "Util.h" + +#include +#include + +using namespace std; +using namespace XFILE; + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// +//********************************************************************************************* +CFileUDF::CFileUDF() +{ + m_bOpened = false; +} + +//********************************************************************************************* +CFileUDF::~CFileUDF() +{ + if (m_bOpened) + { + Close(); + } +} +//********************************************************************************************* +bool CFileUDF::Open(const CURI& url) +{ + CStdString strFName = url.GetHostName(); + + CUtil::UrlDecode(strFName); + + m_hFile = m_udfIsoReaderLocal.OpenFile((char*)strFName.c_str()); + if (m_hFile == INVALID_HANDLE_VALUE) + { + m_bOpened = false; + return false; + } + + m_bOpened = true; + return true; +} + +//********************************************************************************************* +unsigned int CFileUDF::Read(void *lpBuf, int64_t uiBufSize) +{ + if (!m_bOpened) return 0; + char *pData = (char *)lpBuf; + + if (m_cache.getSize() > 0) + { + long lTotalBytesRead = 0; + while (uiBufSize > 0) + { + if (m_cache.GetMaxReadSize() ) + { + long lBytes2Read = m_cache.GetMaxReadSize(); + if (lBytes2Read > uiBufSize) lBytes2Read = (long)uiBufSize; + m_cache.ReadData(pData, lBytes2Read ); + uiBufSize -= lBytes2Read ; + pData += lBytes2Read; + lTotalBytesRead += lBytes2Read ; + } + + if (m_cache.GetMaxWriteSize() > 5000) + { + unsigned char buffer[5000]; + long lBytesRead = m_udfIsoReaderLocal.ReadFile( m_hFile, buffer, sizeof(buffer)); + if (lBytesRead > 0) + m_cache.WriteData((char*)buffer, lBytesRead); + else + return 0; + } + } + return lTotalBytesRead; + } + int iResult = m_udfIsoReaderLocal.ReadFile( m_hFile, (unsigned char*)pData, (long)uiBufSize); + if (iResult == -1) + return 0; + return iResult; +} + +//********************************************************************************************* +void CFileUDF::Close() +{ + if (!m_bOpened) return ; + m_udfIsoReaderLocal.CloseFile( m_hFile); +} + +//********************************************************************************************* +int64_t CFileUDF::Seek(int64_t iFilePosition, int iWhence) +{ + if (!m_bOpened) return -1; + int64_t lNewPos = m_udfIsoReaderLocal.Seek(m_hFile, iFilePosition, iWhence); + if(lNewPos >= 0) + m_cache.Clear(); + return lNewPos; +} + +//********************************************************************************************* +int64_t CFileUDF::GetLength() +{ + if (!m_bOpened) return -1; + return m_udfIsoReaderLocal.GetFileSize(m_hFile); +} + +//********************************************************************************************* +int64_t CFileUDF::GetPosition() +{ + if (!m_bOpened) return -1; + return m_udfIsoReaderLocal.GetFilePosition(m_hFile); +} + +bool CFileUDF::Exists(const CURI& url) +{ + string strFName = "\\"; + strFName += url.GetFileName(); + for (int i = 0; i < (int)strFName.size(); ++i ) + { + if (strFName[i] == '/') strFName[i] = '\\'; + } + m_hFile = m_udfIsoReaderLocal.OpenFile((char*)strFName.c_str()); + if (m_hFile == INVALID_HANDLE_VALUE) + return false; + + m_udfIsoReaderLocal.CloseFile(m_hFile); + return true; +} + +int CFileUDF::Stat(const CURI& url, struct __stat64* buffer) +{ + string strFName = "\\"; + strFName += url.GetFileName(); + for (int i = 0; i < (int)strFName.size(); ++i ) + { + if (strFName[i] == '/') strFName[i] = '\\'; + } + m_hFile = m_udfIsoReaderLocal.OpenFile((char*)strFName.c_str()); + if (m_hFile != INVALID_HANDLE_VALUE) + { + buffer->st_size = m_udfIsoReaderLocal.GetFileSize(m_hFile); + buffer->st_mode = _S_IFREG; + m_udfIsoReaderLocal.CloseFile(m_hFile); + return 0; + } + errno = ENOENT; + return -1; +} diff --git a/xbmc/FileSystem/FileUDF.h b/xbmc/FileSystem/FileUDF.h new file mode 100644 index 00000000..5c295f9d --- /dev/null +++ b/xbmc/FileSystem/FileUDF.h @@ -0,0 +1,32 @@ +#ifndef _FILEUDF_H +#define _FILEUDF_H + +#include "IFile.h" +#include "udf25.h" +#include "RingBuffer.h" + +namespace XFILE +{ + +class CFileUDF : public IFile +{ +public: + CFileUDF(); + virtual ~CFileUDF(); + virtual int64_t GetPosition(); + virtual int64_t GetLength(); + virtual bool Open(const CURI& url); + virtual bool Exists(const CURI& url); + virtual int Stat(const CURI& url, struct __stat64* buffer); + virtual unsigned int Read(void* lpBuf, int64_t uiBufSize); + virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET); + virtual void Close(); +protected: + bool m_bOpened; + HANDLE m_hFile; + CRingBuffer m_cache; + udf25 m_udfIsoReaderLocal; +}; +} + +#endif diff --git a/xbmc/FileSystem/FileUPnP.cpp b/xbmc/FileSystem/FileUPnP.cpp new file mode 100644 index 00000000..361d3ee9 --- /dev/null +++ b/xbmc/FileSystem/FileUPnP.cpp @@ -0,0 +1,142 @@ +/* + * UPnP Support for XBMC + * Based on CFileDAAP +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "FileUPnP.h" +#include "UPnPDirectory.h" +#include "FileItem.h" +#include "SectionLoader.h" +#include "FileFactory.h" +#include + +using namespace XFILE; +using namespace DIRECTORY; + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CFileUPnP::CFileUPnP() +{ + m_file = NULL; + m_bOpened = false; +} + +CFileUPnP::~CFileUPnP() +{ + Close(); + + if( m_file ) + delete m_file; +} + + + +//********************************************************************************************* +bool CFileUPnP::Open(const CURI& url) +{ + // When we get an open request, we pull the underlying resource from the virtual url + // and feed the resource paths back to the file factory until we get something we can + // work with... + + if (m_bOpened) Close(); + + CLog::Log(LOGDEBUG, "CFileUPnP::Open(%s)", url.GetFileName().c_str()); + + CUPnPDirectory dir; + CFileItem item; + + // query the upnp directory to determine the resource URLs for this virtual URL + if( dir.GetResource( url, item ) ) + { + // This loads the first resource string which is hopefully best; we could be more + // articulate here as to what specific resource we want + m_bOpened = true; + m_file = CFileFactory::CreateLoader( item.m_strPath ); + if( m_file ) + { + CLog::Log(LOGDEBUG, "CFileUPnP::Open on stream (%s)", item.m_strPath.c_str()); + return m_file->Open( item.m_strPath ); + } + } + return false; +} + + +//********************************************************************************************* +unsigned int CFileUPnP::Read(void *lpBuf, int64_t uiBufSize) +{ + return m_file->Read(lpBuf, uiBufSize); +} + +//********************************************************************************************* +void CFileUPnP::Close() +{ + if( m_file ) + m_file->Close(); + + m_bOpened = false; +} + +//********************************************************************************************* +int64_t CFileUPnP::Seek(int64_t iFilePosition, int iWhence) +{ + return m_file->Seek(iFilePosition, iWhence); +} + +//********************************************************************************************* +int64_t CFileUPnP::GetLength() +{ + return m_file->GetLength(); +} + +//********************************************************************************************* +int64_t CFileUPnP::GetPosition() +{ + return m_file->GetPosition(); +} + +bool CFileUPnP::Exists(const CURI& url) +{ + return false; +} + +int CFileUPnP::Stat(const CURI& url, struct __stat64* buffer) +{ + int res = -1; + CUPnPDirectory dir; + CFileItem item; + IFile* file; + + // query the upnp directory to determine the resource URLs for this virtual URL + if( dir.GetResource( url, item ) ) + { + // This loads the first resource string which is hopefully best; we could be more + // articulate here as to what specific resource we want + m_bOpened = true; + file = CFileFactory::CreateLoader( item.m_strPath ); + if( file ) + { + CURI pUrl( item.m_strPath ); + CLog::Log(LOGDEBUG, "CFileUPnP::Stat on stream (%s)", item.m_strPath.c_str()); + res = file->Stat( pUrl, buffer ); + delete file; + } + } + return res; +} diff --git a/xbmc/FileSystem/FileUPnP.h b/xbmc/FileSystem/FileUPnP.h new file mode 100644 index 00000000..352f6f12 --- /dev/null +++ b/xbmc/FileSystem/FileUPnP.h @@ -0,0 +1,62 @@ +/* +* UPnP Support for XBMC +* Based on CFileDAAP +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +// +////////////////////////////////////////////////////////////////////// + +#ifndef __FILEUPNP_H__ +#define __FILEUPNP_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "FileCurl.h" +#include "URL.h" +#include "IFile.h" + +namespace XFILE +{ +class CFileUPnP : public IFile +{ +public: + CFileUPnP(); + virtual ~CFileUPnP(); + virtual int64_t GetPosition(); + virtual int64_t GetLength(); + virtual bool Open(const CURI& url); + virtual bool Exists(const CURI& url); + virtual int Stat(const CURI& url, struct __stat64* buffer); + virtual unsigned int Read(void* lpBuf, int64_t uiBufSize); + virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET); + virtual void Close(); + +protected: + + bool StartStreaming(); + bool StopStreaming(); + + bool m_bOpened; + + IFile* m_file; // the underlying resource file +}; +} + +#endif // __FILEUPNP_H__ + + diff --git a/xbmc/FileSystem/FileUPnPAv.cpp b/xbmc/FileSystem/FileUPnPAv.cpp new file mode 100644 index 00000000..5dec1788 --- /dev/null +++ b/xbmc/FileSystem/FileUPnPAv.cpp @@ -0,0 +1,137 @@ + +#include "system.h" + +#ifdef HAS_UPNP_AV + +#include "FileItem.h" +#include "FileFactory.h" +#include "FileUPnPAv.h" +#include "URL.h" +#include "Util.h" +#include "utils/log.h" +#include "UPnPAvDirectory.h" +#include "File.h" + + +using namespace XFILE; +using namespace DIRECTORY; + +CFileUPnPAv::CFileUPnPAv() +{ + m_file = NULL; + m_bOpened = false; +} + +CFileUPnPAv::~CFileUPnPAv() +{ + Close(); + + if( m_file ) + delete m_file; + + m_file = NULL; +} + + +int64_t CFileUPnPAv::GetPosition() +{ + if (!m_bOpened) return -1; + return m_file->GetPosition(); +} + +int64_t CFileUPnPAv::GetLength() +{ + if (!m_bOpened) return -1; + return m_file->GetLength(); +} + +bool CFileUPnPAv::Open(const CURI& url) +{ + if(url.GetProtocol() != "upnp") + { + CLog::Log(LOGERROR, "CFileUPnPAv::Open - invalid protocol"); + return false; + } + + CFileItem item; + CUPnPAvDirectory dir; + + if(dir.GetResource(url, item)) + { + m_bOpened = true; + m_file = CFileFactory::CreateLoader(item.m_strPath); + if( m_file ) + { + CLog::Log(LOGDEBUG, "CFileUPnPAv::Open on stream (%s)", item.m_strPath.c_str()); + return m_file->Open( item.m_strPath ); + } + } + + CLog::Log(LOGERROR, "CFileUPnPAv::Open - failed to get resource for file %s", url.Get().c_str()); + + return false; +} + +bool CFileUPnPAv::Exists(const CURI& url) +{ + CFileItem item; + CUPnPAvDirectory dir; + + if(dir.GetResource(url, item)) + { + return CFile::Exists(item.m_strPath); + } + + return false; +} + +int CFileUPnPAv::Stat(const CURI& url, struct __stat64* buffer) +{ + int res = -1; + CFileItem item; + CUPnPAvDirectory dir; + + if(url.GetProtocol() != "upnp") + { + CLog::Log(LOGERROR, "CFileUPnPAv::Stat - invalid protocol"); + return -1; + } + + if(dir.GetResource(url, item)) + { + IFile* file; + + file = CFileFactory::CreateLoader(item.m_strPath); + if(file) + { + CURI u(item.m_strPath); + res = file->Stat(u,buffer); + delete file; + } + } + + return res; +} + +unsigned int CFileUPnPAv::Read(void* lpBuf, int64_t uiBufSize) +{ + if (!m_bOpened) return -1; + return m_file->Read(lpBuf, uiBufSize); +} + +int64_t CFileUPnPAv::Seek(int64_t iFilePosition, int iWhence) +{ + if (!m_bOpened) return -1; + return m_file->Seek(iFilePosition, iWhence); +} + +void CFileUPnPAv::Close() +{ + if( m_file ) + m_file->Close(); + + m_bOpened = false; +} + +#endif // HAS_UPNP_AV + diff --git a/xbmc/FileSystem/FileUPnPAv.h b/xbmc/FileSystem/FileUPnPAv.h new file mode 100644 index 00000000..4e889356 --- /dev/null +++ b/xbmc/FileSystem/FileUPnPAv.h @@ -0,0 +1,35 @@ +#ifndef _FILEUPNP_AV_H +#define _FILEUPNP_AV_H + +#include "system.h" + +#ifdef HAS_UPNP_AV + +#include "IFile.h" + +namespace XFILE +{ + +class CFileUPnPAv : public IFile +{ +public: + CFileUPnPAv(); + virtual ~CFileUPnPAv(); + virtual int64_t GetPosition(); + virtual int64_t GetLength(); + virtual bool Open(const CURI& url); + virtual bool Exists(const CURI& url); + virtual int Stat(const CURI& url, struct __stat64* buffer); + virtual unsigned int Read(void* lpBuf, int64_t uiBufSize); + virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET); + virtual void Close(); + +protected: + bool m_bOpened; + IFile *m_file; +}; +} + +#endif + +#endif diff --git a/xbmc/FileSystem/MusicDatabaseDirectory/MusicDatabaseDirectory.pro b/xbmc/FileSystem/MusicDatabaseDirectory/MusicDatabaseDirectory.pro new file mode 100644 index 00000000..8d93d4b9 --- /dev/null +++ b/xbmc/FileSystem/MusicDatabaseDirectory/MusicDatabaseDirectory.pro @@ -0,0 +1,61 @@ +include(../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../../ ../../linux ../../../guilib +SOURCES += \ +DirectoryNodeAlbumCompilations.cpp \ +DirectoryNodeRoot.cpp \ +DirectoryNodeArtist.cpp \ +DirectoryNodeAlbumRecentlyPlayedSong.cpp \ +DirectoryNodeAlbum.cpp \ +DirectoryNodeAlbumCompilationsSongs.cpp \ +DirectoryNodeAlbumRecentlyPlayed.cpp \ +DirectoryNodeOverview.cpp \ +DirectoryNodeAlbumRecentlyAdded.cpp \ +DirectoryNodeGenre.cpp \ +DirectoryNodeAlbumTop100.cpp \ +DirectoryNodeSongTop100.cpp \ +DirectoryNodeSingles.cpp \ +DirectoryNodeAlbumTop100Song.cpp \ +DirectoryNodeAlbumRecentlyAddedSong.cpp \ +QueryParams.cpp \ +DirectoryNodeYearSong.cpp \ +DirectoryNode.cpp \ +DirectoryNodeTop100.cpp \ +DirectoryNodeYear.cpp \ +DirectoryNodeYearAlbum.cpp \ +DirectoryNodeSong.cpp \ + + +HEADERS += \ +DirectoryNodeAlbumCompilations.h \ +DirectoryNodeRoot.h \ +DirectoryNodeArtist.h \ +DirectoryNodeAlbumRecentlyPlayedSong.h \ +DirectoryNodeAlbum.h \ +DirectoryNodeAlbumCompilationsSongs.h \ +DirectoryNodeAlbumRecentlyPlayed.h \ +DirectoryNodeOverview.h \ +DirectoryNodeAlbumRecentlyAdded.h \ +DirectoryNodeGenre.h \ +DirectoryNodeAlbumTop100.h \ +DirectoryNodeSongTop100.h \ +DirectoryNodeSingles.h \ +DirectoryNodeAlbumTop100Song.h \ +DirectoryNodeAlbumRecentlyAddedSong.h \ +QueryParams.h \ +DirectoryNodeYearSong.h \ +DirectoryNode.h \ +DirectoryNodeTop100.h \ +DirectoryNodeYear.h \ +DirectoryNodeYearAlbum.h \ +DirectoryNodeSong.h \ + + +INCLUDEPATH += ../../../ diff --git a/xbmc/FileSystem/NfsDirectory.cpp b/xbmc/FileSystem/NfsDirectory.cpp new file mode 100644 index 00000000..9e73c225 --- /dev/null +++ b/xbmc/FileSystem/NfsDirectory.cpp @@ -0,0 +1,496 @@ +#include "system.h" + +#ifdef HAS_NFS +#include "Util.h" +#include "URL.h" +#include "FileItem.h" +#include "Directory.h" +#include "NfsDirectory.h" +#include "BrowserService.h" +#include "DirectoryCache.h" +#include "Application.h" +#include "utils/log.h" +#include "bxutils.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace DIRECTORY; + +#define MOUNT_PROGNUM 100005 +#define MOUNT_VERSNUM 1 +#define MOUNTPROC_EXPORT 5 +#define RPCMNT_NAMELEN 255 +#define RPCMNT_PATHLEN 1024 + +#define MOUNT_ROOT "/tmp/mnt/" + +#ifndef NFS_SUPER_MAGIC +#define NFS_SUPER_MAGIC 0x6969 +#endif + +typedef struct NfsShare +{ + CStdString ipAddr; + CStdString hostName; +} NfsShare; + + +typedef struct groupnode { + char gr_name[RPCMNT_NAMELEN+1]; + groupnode *gr_next; +} groupnode; + + +typedef struct exportnode { + char ex_dir[RPCMNT_PATHLEN+1]; + groupnode* ex_groups; + exportnode *ex_next; +} exportnode; + +std::vector g_vecMountpoints; + +#ifdef _LINUX +static int +xdr_broadcast(void* out, struct sockaddr_in *who) +{ + register struct hostent *hp; + std::vector* pNfsShares = (std::vector*) out; + NfsShare share; + + hp = gethostbyaddr ((char *) &who->sin_addr, sizeof who->sin_addr, + AF_INET); + + share.ipAddr = inet_ntoa (who->sin_addr); + share.hostName = (hp == NULL) ? ("") : hp->h_name; + + std::vector::iterator it = pNfsShares->begin(); + bool bDuplicate = false; + while (it != pNfsShares->end()) + { + const NfsShare& sh = *it; + if(sh.ipAddr == share.ipAddr) + { + bDuplicate = true; + break; + } + it++; + } + + if(!bDuplicate) + pNfsShares->push_back(share); + + return bDuplicate; +} + +static int +xdr_exports(XDR *xdrsp, struct exportnode **exp) +{ + struct exportnode *ep = NULL; + struct groupnode *gp = NULL; + int b, grpbool; + char *strp; + + *exp = (struct exportnode *)0; + if (!xdr_bool(xdrsp, &b)) + return (0); + + while (b) + { + ep = (struct exportnode *)malloc(sizeof(struct exportnode)); + if (ep == NULL) + return (0); + + ep->ex_groups = (struct groupnode *)0; + strp = ep->ex_dir; + if (!xdr_string(xdrsp, &strp, RPCMNT_PATHLEN)) + return (0); + + if (!xdr_bool(xdrsp, &grpbool)) + return (0); + + while (grpbool) { + gp = (struct groupnode *)malloc(sizeof(struct groupnode)); + if (gp == NULL) + return (0); + + strp = gp->gr_name; + if (!xdr_string(xdrsp, &strp, RPCMNT_NAMELEN)) + return (0); + + gp->gr_next = ep->ex_groups; + ep->ex_groups = gp; + + if (!xdr_bool(xdrsp, &grpbool)) + return (0); + } + ep->ex_next = *exp; + *exp = ep; + + if (!xdr_bool(xdrsp, &b)) + return (0); + } + + return (1); +} + +static CStdString +GetMountPoint(const CStdString &strType, const CStdString &strHost, const CStdString &exportDirName) +{ + CStdString strPath = strType + "_" + strHost + "_" + exportDirName; + CUtil::URLEncode(strPath); + + return MOUNT_ROOT + strPath; +} + +static int +UnMountShare(const CStdString &strMountPoint) +{ + return umount(strMountPoint.c_str()); +} + +static bool +MountShare(const CStdString &nfsPath, const CStdString &strMountPoint) +{ + CStdString cmd; + + if(CUtil::IsMountpoint(strMountPoint)) + { + UnMountShare(strMountPoint); + } + + ::CreateDirectory(strMountPoint, NULL); + + cmd = "mount -o nolock -t nfs " + CStdString("\"") + nfsPath + CStdString("\"") + " " + strMountPoint; + + system(cmd.c_str()); + + // test for mountpoint + if(!CUtil::IsMountpoint(strMountPoint)) + { + CLog::Log(LOGERROR, "%s - Failed to mount [%s]", __func__, strMountPoint.c_str()); + return false; + } + + return true; +} + +static AUTH* +nfs_authsys_create(void) +{ + char machname[MAXHOSTNAMELEN + 1]; + uid_t uid = geteuid(); + gid_t gid = getegid(); + + if (gethostname(machname, sizeof(machname)) == -1) + return NULL; + + return authunix_create(machname, uid, gid, 1, &gid); +} + +static bool +GetExports(const char* hostname, std::vector& exports) +{ + CLIENT *client = NULL; + struct timeval total_timeout; + exportnode* exportlist; + enum clnt_stat clnt_stat; + bool result = false; + + do + { + client = clnt_create(hostname, MOUNT_PROGNUM, MOUNT_VERSNUM, "tcp"); + if (!client) + { + client = clnt_create(hostname, MOUNT_PROGNUM, MOUNT_VERSNUM, "udp"); + } + + if(!client) + { + CLog::Log(LOGERROR, "%s - clnt_create failed, errno[%d][%s]", __func__, errno, strerror(errno)); + break; + } + + client->cl_auth = nfs_authsys_create(); + if (client->cl_auth == NULL) + { + CLog::Log(LOGERROR, "%s - unable to create RPC auth handle", __func__); + break; + } + + total_timeout.tv_sec = 20; + total_timeout.tv_usec = 0; + + memset(&exportlist, '\0', sizeof(exportlist)); + + clnt_stat = clnt_call(client, MOUNTPROC_EXPORT, + (xdrproc_t) xdr_void, NULL, + (xdrproc_t) xdr_exports, (caddr_t) &exportlist, + total_timeout); + + if (clnt_stat == RPC_PROGVERSMISMATCH) + { + CLog::Log(LOGERROR, "%s - invalid RPC version", __func__); + break; + } + + if (clnt_stat != RPC_SUCCESS) + { + CLog::Log(LOGERROR, "%s - failed with errro [%d]", __func__, clnt_stat); + break; + } + + while (exportlist) + { + exportnode* node = exportlist; + + exports.push_back(node->ex_dir); + exportlist = exportlist->ex_next; + + free(node->ex_groups); + free(node); + + } + + result = true; + + } while(false); + + + if(client) + { + if(client->cl_auth) + auth_destroy(client->cl_auth); + + clnt_destroy(client); + } + return result; +} +#endif + +static bool +ScanNfsShares(std::vector& shares) +{ + bool bResult = true; +#ifdef _LINUX + enum clnt_stat rpc_stat; + rpc_stat = clnt_broadcast (MOUNT_PROGNUM, MOUNT_VERSNUM, NULLPROC, (xdrproc_t) xdr_void, + NULL, (xdrproc_t) xdr_void, (char*)&shares, + (resultproc_t) xdr_broadcast); + + if ((rpc_stat != RPC_SUCCESS) && (rpc_stat != RPC_TIMEDOUT)) + { + CLog::Log(LOGERROR, "%s - failed, rpc error [%s]", __func__, clnt_sperrno (rpc_stat)); + bResult = false; + } +#endif + + return bResult; +} + +CNfsDirectory::CNfsDirectory(void) +{} + +CNfsDirectory::~CNfsDirectory(void) +{} + +bool CNfsDirectory::GetResource(const CURI& path, CFileItem &item) +{ + if(path.GetProtocol() != "nfs") + { + CLog::Log(LOGERROR, "CNfsDirectory::%s - invalid protocol [%s]", __func__, path.GetProtocol().c_str()); + return false; + } + + CStdString strHostName = path.GetHostName(); + CStdString strFullPath = path.GetFileName(); + CStdString strFileName, strExportDir; + + int iPos = strFullPath.Find(":", 0); + if (iPos != -1) + { + strExportDir = strFullPath.substr(0, iPos); + strFileName = strFullPath.substr(iPos + 1, strFullPath.length()); + } + else + { + strExportDir = strFullPath; + } + + CStdString strMountPoint = GetMountPoint("nfs", strHostName, strExportDir); + + // path is not mounted - need to mount it + if(!CUtil::IsMountpoint(strMountPoint) && CUtil::GetFsMagic(strMountPoint+strFileName) != NFS_SUPER_MAGIC) + { + CStdString nfsPath = strHostName + ":" + "/" + strExportDir; + + CLog::Log(LOGDEBUG, "CNfsDirectory::%s - mounting NFS share [%s] ==> [%s]", __func__, nfsPath.c_str(), strMountPoint.c_str()); + + if(MountShare(nfsPath, strMountPoint) == false) + { + CLog::Log(LOGERROR, "CNfsDirectory::%s - failed to mount NFS share [%s]", __func__, nfsPath.c_str()); + return false; + } + } + + CStdString strHddPath = strMountPoint + strFileName; + + item.m_strPath = strHddPath; + item.SetLabel(path.Get()); + + item.SetProperty("filename", strFileName); + item.SetProperty("mountpoint", strMountPoint); + + struct stat st; + if (stat(strHddPath.c_str(),&st) == 0) + { + item.m_bIsFolder = S_ISDIR(st.st_mode); + } + + return true; +} + +bool CNfsDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items) +{ + CURI url(strPath); + bool bResult = false; + + if(url.GetProtocol() != "nfs") + { + CLog::Log(LOGERROR, "CNfsDirectory::%s - invalid protocol [%s]", __func__, url.GetProtocol().c_str()); + return false; + } + + CBrowserService* pBrowser = g_application.GetBrowserService(); + + if( strPath == "nfs://" && pBrowser ) + { + pBrowser->GetShare( CBrowserService::NFS_SHARE, items ); + return true; + } + + // If we have the items in the cache, return them + if (g_directoryCache.GetDirectory(strPath, items)) + { + return true; + } + + if(strPath == "nfs://all") + { + std::vector shares; + + bool succedded = ScanNfsShares(shares); + if(!succedded) + { + CLog::Log(LOGERROR, "CNfsDirectory::%s - failed to scan NFS shares", __func__); + return false; + } + + for(size_t i=0; im_strTitle = hostName; + pItem->m_bIsFolder = true; + pItem->m_strPath.Format("nfs://%s", hostName); + pItem->SetProperty("isNetwork",true); + + items.Add(pItem); + } + + CLog::Log(LOGDEBUG, "CNfsDirectory::%s - found %d NFS devices", __func__, shares.size()); + return true; + } + + CStdString hostName = url.GetHostName(); + CStdString fileName = url.GetFileName(); + + if(fileName.IsEmpty()) + { + std::vector exports; + + if(false == GetExports(hostName.c_str(), exports)) + { + CLog::Log(LOGERROR, "CNfsDirectory::%s - failed to get export for host [%s]", __func__, hostName.c_str()); + return false; + } + + CLog::Log(LOGDEBUG, "CNfsDirectory::%s - found [%d] exports for [%s] ", __func__, exports.size(), hostName.c_str()); + + for(size_t i=0; im_strTitle = title; + pItem->m_bIsFolder = true; + pItem->SetProperty("isNetwork",true); + + pItem->m_strPath.Format("nfs://%s%s", hostName, exports[i]); + + items.Add(pItem); + } + + bResult = true; + } + else + { + CFileItem item; + + if(false == GetResource(url, item)) + { + CLog::Log(LOGERROR, "CNfsDirectory::%s - failed to get resource for path [%s]", __func__, url.Get().c_str()); + return false; + } + + bResult = CUtil::GetHDDDirectory(item.m_strPath,items); + + for(int i=0; im_bIsFolder) + { + items[i]->SetProperty("isNetwork",true); + } + // build nfs path + CStdString nfsPath = items[i]->m_strPath; + nfsPath.Replace(item.m_strPath, strPath); + + if (nfsPath.length() >= strPath.length()) + { + CStdString strNewFilename = nfsPath.substr(strPath.length()); + + CStdString strNfsFileName; + CStdString strFileName = item.GetProperty("filename"); + if (strFileName.IsEmpty()) + strNfsFileName = ":" + strNewFilename; + else + strNfsFileName = strNewFilename; + + items[i]->m_strPath.Format("%s%s", strPath.c_str(), strNfsFileName.c_str()); + + } + } + } + + return bResult; +} + +bool CNfsDirectory::Exists(const char* strPath) +{ + CFileItemList items; + if (GetDirectory(strPath,items)) + return true; + + return false; +} +#endif diff --git a/xbmc/FileSystem/NfsDirectory.h b/xbmc/FileSystem/NfsDirectory.h new file mode 100644 index 00000000..7987098c --- /dev/null +++ b/xbmc/FileSystem/NfsDirectory.h @@ -0,0 +1,25 @@ +#ifndef NFS_DIRECTORY_H +#define NFS_DIRECTORY_H + +#include "system.h" + +#ifdef HAS_NFS +#include "IDirectory.h" + +namespace DIRECTORY +{ +class CNfsDirectory : + public IDirectory +{ +public: + CNfsDirectory(void); + virtual ~CNfsDirectory(void); + virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items); + virtual bool Exists(const char* strPath); + + static bool GetResource(const CURI& path, CFileItem &item); +}; +} +#endif + +#endif diff --git a/xbmc/FileSystem/SMBUtils.cpp b/xbmc/FileSystem/SMBUtils.cpp new file mode 100644 index 00000000..25178903 --- /dev/null +++ b/xbmc/FileSystem/SMBUtils.cpp @@ -0,0 +1,202 @@ +#include "SMBUtils.h" +#include "BoxeeUtils.h" +#include "Directory.h" +#include "URL.h" +#include "log.h" +#include "Application.h" +#include "BrowserService.h" +#include "GUIWindowManager.h" +#include "GUIDialogProgress.h" + +namespace DIRECTORY +{ +CStdString SMBUtils::GetComputerSMBName(const CStdString& computer) +{ + CStdString compName; + int index = computer.Find('/'); + + if(index > 0) + { + compName = computer.substr(0,index - 1); + } + else + { + compName = computer; + } + return compName; +} + +bool SMBUtils::GetComputers(CFileItemList &items) +{ + const CStdString strPath = "smb://"; + + CDirectory::GetDirectory(strPath, items); + + bool bInsert; + std::set Computers; + + int i = 0; + while(i < items.Size()) + { + CStdString compName = GetComputerSMBName(items[i]->GetLabel()); + bInsert = Computers.insert(compName).second; + + if(bInsert) + { + items[i]->SetProperty("isNetwork",true); + items[i]->SetLabel(compName); + items[i]->m_strPath = "smb://computers/?name=" + compName; + i++; + } + else + { + items.Remove(i); + } + } + + return true; +} + +bool SMBUtils::GetComputerDevices(const CStdString& strSmbPath,const CStdString& selectedComp, CFileItemList &items, bool allow_prompt/*=false*/) +{ + CBrowserService* pBrowser = g_application.GetBrowserService(); + + if(!pBrowser->IsSmbAgressiveScan()) + { + + CGUIDialogProgress* progress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); + if (progress) + { + CStdString strId; + strId.Format("%s-get-computer-devices", selectedComp); + progress->StartModal(strId); + progress->Progress(); + } + + CDirectory::GetDirectory("smb://" + selectedComp, items, "", true, allow_prompt); + + progress->Close(); + return true; + } + + const CStdString strPathTmp = "smb://"; + CDirectory::GetDirectory(strPathTmp, items); + + size_t index; + int length, i = 0; + int indexToBeDeleted = -1; + CStdString label; + + while(i < items.Size()) + { + items[i]->SetProperty("isNetwork",true); + CStdString compName = GetComputerSMBName(items[i]->GetLabel()); + + if(!selectedComp.Equals(compName)) + { + items.Remove(i); + } + else + { + //remove the computer from list displayed + if(selectedComp.Equals(items[i]->GetLabel())) + { + indexToBeDeleted = i; + } + + //remove computer name + label = items[i]->GetLabel(); + index = label.find_first_of("//"); + if (index != std::string::npos) + { + length = label.length() - (index + 1); + label = label.substr(index + 2,length); + items[i]->SetLabel(label); + } + + i++; + } + } + + if(items.Size() > 1 && indexToBeDeleted != -1) + { + items.Remove(indexToBeDeleted); + } + + return true; +} + +bool SMBUtils::ProcessPath(const CStdString& strPath, CFileItemList &items, bool allow_prompt/*=false*/) +{ + CURI url(strPath); + + if(url.GetProtocol() != "smb") + { + CLog::Log(LOGERROR, "CSMBDirectory::ProcessPath - invalid protocol [%s]", url.GetProtocol().c_str()); + return false; + } + + CStdString strComp; + CStdString strDevices; + std::map mapParams; + + // Parse boxeedb url + if (!BoxeeUtils::ParseBoxeeDbUrl(strPath, strComp, strDevices, mapParams)) + { + return false; + } + + if(strComp.Equals("computers") && mapParams["name"].empty()) + { + GetComputers(items); + return true; + } + + if(strComp.Equals("computers") && !mapParams["name"].empty()) + { + CStdString selectedComp = mapParams["name"]; + if(selectedComp.IsEmpty()) + { + return false; + } + GetComputerDevices(strPath, selectedComp, items, allow_prompt); + return true; + } + + return false; +} + +CStdString SMBUtils::TranslatePath(const CStdString& strPath) +{ + CStdString translatedPath = strPath; + + if (CUtil::IsSmb(translatedPath)) + { + if(translatedPath.Find("smb://computers/?name=") != -1) + { + int index = translatedPath.Find("="); + int length = translatedPath.size() - index; + if(index > -1) + { + CStdString compName = translatedPath.substr(index + 1,length); + translatedPath = "smb://" + compName; + } + else + { + translatedPath = "smb://"; + } + } + if(translatedPath.Find("smb://computers") != -1) + { + translatedPath = "smb://"; + } + else if(translatedPath.Find("/devices") != -1) + { + translatedPath = translatedPath.substr(0,translatedPath.length() - 9); + } + } + + return translatedPath; +} + +} // namespace DIRECTORY diff --git a/xbmc/FileSystem/SMBUtils.h b/xbmc/FileSystem/SMBUtils.h new file mode 100644 index 00000000..8b1ab1c5 --- /dev/null +++ b/xbmc/FileSystem/SMBUtils.h @@ -0,0 +1,19 @@ +#ifndef SMBUTILS_H +#define SMBUTILS_H + +#include "../../guilib/StdString.h" +#include "../FileItem.h" + +namespace DIRECTORY +{ +class SMBUtils { +public: + static bool ProcessPath(const CStdString& strPath, CFileItemList &items, bool allow_prompt=false); + static CStdString TranslatePath(const CStdString& strPath); +private: + static CStdString GetComputerSMBName(const CStdString& computer); + static bool GetComputers(CFileItemList &items); + static bool GetComputerDevices(const CStdString& strSmbPath,const CStdString& selectedComp, CFileItemList &items, bool allow_prompt=false); +}; +} +#endif // #ifndef SMBUTILS_H diff --git a/xbmc/FileSystem/UDFDirectory.cpp b/xbmc/FileSystem/UDFDirectory.cpp new file mode 100644 index 00000000..41f2de32 --- /dev/null +++ b/xbmc/FileSystem/UDFDirectory.cpp @@ -0,0 +1,73 @@ +#include "UDFDirectory.h" +#include "udf25.h" +#include "Util.h" +#include "URL.h" +#include "FileItem.h" + +using namespace DIRECTORY; + +CUDFDirectory::CUDFDirectory(void) +{} + +CUDFDirectory::~CUDFDirectory(void) +{} + +bool CUDFDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items) +{ + CStdString strRoot = strPath; + CUtil::AddSlashAtEnd(strRoot); + + CURI url(strPath); + + CStdString strDirectory = url.GetHostName(); + CUtil::UrlDecode(strDirectory); + + udf25 udfIsoReader; + udf_dir_t *dirp = udfIsoReader.OpenDir(strDirectory); + + if(dirp == NULL) + return false; + + udf_dirent_t *dp = NULL; + while((dp = udfIsoReader.ReadDir(dirp)) != NULL) + { + if(dp->d_type == DVD_DT_DIR) + { + CStdString strDir = (char*)dp->d_name; + if (strDir != "." && strDir != "..") + { + CFileItemPtr pItem(new CFileItem((char*)dp->d_name)); + pItem->m_strPath = strRoot; + pItem->m_strPath += (char*)dp->d_name; + pItem->m_bIsFolder = true; + CUtil::AddSlashAtEnd(pItem->m_strPath); + + items.Add(pItem); + } + } + else + { + CFileItemPtr pItem(new CFileItem((char*)dp->d_name)); + pItem->m_strPath = strRoot; + pItem->m_strPath += (char*)dp->d_name; + pItem->m_bIsFolder = false; + pItem->m_dwSize = dp->d_filesize; + + items.Add(pItem); + } + } + + + udfIsoReader.CloseDir(dirp); + + return true; +} + +bool CUDFDirectory::Exists(const char* strPath) +{ + CFileItemList items; + if (GetDirectory(strPath,items)) + return true; + + return false; +} diff --git a/xbmc/FileSystem/UDFDirectory.h b/xbmc/FileSystem/UDFDirectory.h new file mode 100644 index 00000000..85dd4de5 --- /dev/null +++ b/xbmc/FileSystem/UDFDirectory.h @@ -0,0 +1,20 @@ +#ifndef UDF_DIRECTORY_H +#define UDF_DIRECTORY_H + +#include "IDirectory.h" + +namespace DIRECTORY +{ +class CUDFDirectory : + public IDirectory +{ +public: + CUDFDirectory(void); + virtual ~CUDFDirectory(void); + virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items); + virtual bool Exists(const char* strPath); +}; +} + +#endif + diff --git a/xbmc/FileSystem/UPnPAvDirectory.cpp b/xbmc/FileSystem/UPnPAvDirectory.cpp new file mode 100644 index 00000000..8f01aaf2 --- /dev/null +++ b/xbmc/FileSystem/UPnPAvDirectory.cpp @@ -0,0 +1,228 @@ +#include "system.h" + +#ifdef HAS_UPNP_AV +#include "Util.h" +#include "URL.h" +#include "FileItem.h" +#include "Directory.h" +#include "BrowserService.h" +#include "DirectoryCache.h" +#include "Application.h" +#include "utils/log.h" +#include "bxutils.h" +#include "Util.h" +#include "File.h" +#include "RSSDirectory.h" +#include "UPnPAvDirectory.h" +#include "GUIWindowManager.h" +#include "GUIDialogProgress.h" + +#include +#include +#include +#include + +#ifdef HAS_EMBEDDED +#include "HalServices.h" +#endif + +#define UPNP_MNT "/tmp/mnt/upnp" + +using namespace DIRECTORY; +using namespace XFILE; + + +static bool +ScanUPnPShares(CFileItemList &items) +{ + bool bMounted = false; + CStdString strDevicesFile = CStdString(UPNP_MNT) + "/devices"; + + bMounted = CUtil::IsMountpoint(UPNP_MNT) && CFile::Exists(strDevicesFile); + + if(!bMounted) + { + CLog::Log(LOGERROR, "CUPnPAvDirectory:%s - UPnP mountpoint doesnt exist", __func__); + return false; + } + + CFile fDevices; + char szDevice[1024] = {0}; + + + if (!fDevices.Open(strDevicesFile)) + { + CLog::Log(LOGERROR, "CUPnPAvDirectory:%s - Failed to open [%s]", __func__, strDevicesFile.c_str()); + return false; + } + + items.Clear(); + + while(fDevices.ReadString(szDevice, sizeof(szDevice))) + { + CFileItemPtr pItem(new CFileItem(szDevice)); + CStdString strDevice = szDevice; + + CUtil::URLEncode(strDevice); + + pItem->m_bIsFolder = true; + pItem->m_strPath.Format("upnp://%s", strDevice); + + items.Add(pItem); + } + + fDevices.Close(); + + return items.Size() != 0; +} + +bool +CUPnPAvDirectory::ReadDir(const CURI& url, CFileItemList &items) +{ + CStdString strFileName = url.GetFileName(); + CStdString strHostName = url.GetHostName(); + CStdString strHddPath; + + CUtil::UrlDecode(strHostName); + + strHddPath.Format("%s/%s/%s", UPNP_MNT, strHostName, strFileName); + + // on UPnP GetHDDDirectory works much faster than CDirectory::GetHDDDirectory + bool bResult = CUtil::GetHDDDirectory(strHddPath, items); + + for(int i=0; im_strPath); + + CStdString strName = CUtil::GetFileName(items[i]->m_strPath); + + if(!CUtil::HasSlashAtEnd(url.Get())) + items[i]->m_strPath.Format("%s/%s", url.Get(),strName); + else + items[i]->m_strPath.Format("%s%s", url.Get(),strName); + + if(items[i]->m_bIsFolder) + CUtil::AddSlashAtEnd(items[i]->m_strPath); + } + + return bResult; +} + +void +CUPnPAvDirectory::GetFriendlyPath(CStdString& path) +{ + CURI url(path); + CStdString strHostName = url.GetHostName(); + CStdString strHostNameDecoded = strHostName; + + CUtil::UrlDecode(strHostNameDecoded); + + path.Replace(strHostName, strHostNameDecoded); +} + +bool +CUPnPAvDirectory::GetResource(const CURI& path, CFileItem &item) +{ + CStdString strFileName = path.GetFileName(); + CStdString strHostName = path.GetHostName(); + CStdString strHddPath; + + CUtil::UrlDecode(strHostName); + + strHddPath.Format("%s/%s/%s", UPNP_MNT, strHostName, strFileName); + + if(!CFile::Exists(strHddPath)) + { + CLog::Log(LOGERROR, "CUPnPAvDirectory::%s - upnp node [%s] for [%s] doesnt exists", __func__, strHddPath.c_str(), path.Get().c_str()); + return false; + } + + item.m_strPath = strHddPath; + item.SetLabel(path.Get()); + + struct stat st; + if (stat(strHddPath.c_str(),&st) == 0) + { + item.m_bIsFolder = S_ISDIR(st.st_mode); + } + + return true; +} + + +CUPnPAvDirectory::CUPnPAvDirectory(void) +{} + +CUPnPAvDirectory::~CUPnPAvDirectory(void) +{} + + + +bool CUPnPAvDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items) +{ + CURI url(strPath); + + m_cacheDirectory = DIR_CACHE_ALWAYS; + + if(url.GetProtocol() != "upnp") + { + CLog::Log(LOGERROR, "CUPnPAvDirectory::%s - invalid protocol [%s]", __func__, url.GetProtocol().c_str()); + return false; + } + + CBrowserService* pBrowser = g_application.GetBrowserService(); + + if( strPath == "upnp://" && pBrowser ) + { + pBrowser->GetShare( CBrowserService::UPNP_SHARE, items ); + return true; + } + + // If we have the items in the cache, return them + if (g_directoryCache.GetDirectory(strPath, items)) + { + return true; + } + + if(strPath == "upnp://all") + { + bool bSuccess = ScanUPnPShares(items); + if(!bSuccess) + { + IHalServices& client = CHalServicesFactory::GetInstance(); + client.DjmountRestart(); + + CLog::Log(LOGWARNING, "CUPnPAvDirectory::%s - failed to scan UPnP shares, retrying...", __func__); + + CGUIDialogProgress* progress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); + if (progress) + { + CStdString strId; + strId.Format("%d-upnp-scan-retry", CThread::GetCurrentThreadId()); + progress->StartModal(strId); + progress->Progress(); + } + + // hopefully djmount will be able to find all shares + Sleep(5000); + + bSuccess = ScanUPnPShares(items); + + progress->Close(); + } + + return bSuccess; + } + + return ReadDir(url, items); +} + +bool CUPnPAvDirectory::Exists(const char* strPath) +{ + CFileItemList items; + if (GetDirectory(strPath,items)) + return true; + + return false; +} +#endif diff --git a/xbmc/FileSystem/UPnPAvDirectory.h b/xbmc/FileSystem/UPnPAvDirectory.h new file mode 100644 index 00000000..5d702b21 --- /dev/null +++ b/xbmc/FileSystem/UPnPAvDirectory.h @@ -0,0 +1,27 @@ +#ifndef UPNP_AV_DIRECTORY_H +#define UPNP_AV_DIRECTORY_H + +#include "system.h" + +#ifdef HAS_UPNP_AV +#include "IDirectory.h" + +namespace DIRECTORY +{ +class CUPnPAvDirectory : + public IDirectory +{ + bool ReadDir(const CURI& url, CFileItemList &items); +public: + CUPnPAvDirectory(void); + virtual ~CUPnPAvDirectory(void); + virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items); + virtual bool Exists(const char* strPath); + + static bool GetResource(const CURI& path, CFileItem &item); + static void GetFriendlyPath(CStdString& path); +}; +} +#endif + +#endif diff --git a/xbmc/FileSystem/VideoDatabaseDirectory/VideoDatabaseDirectory.pro b/xbmc/FileSystem/VideoDatabaseDirectory/VideoDatabaseDirectory.pro new file mode 100644 index 00000000..1bcf9adf --- /dev/null +++ b/xbmc/FileSystem/VideoDatabaseDirectory/VideoDatabaseDirectory.pro @@ -0,0 +1,63 @@ +include(../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../../ ../../linux ../../../guilib +SOURCES += \ +DirectoryNodeMusicVideosOverview.cpp \ +DirectoryNodeRoot.cpp \ +DirectoryNodeEpisodes.cpp \ + \ +DirectoryNodeDirector.cpp \ +DirectoryNodeRecentlyAddedEpisodes.cpp \ +DirectoryNodeTitleMovies.cpp \ +DirectoryNodeOverview.cpp \ +DirectoryNodeGenre.cpp \ +QueryParams.cpp \ +DirectoryNodeTitleTvShows.cpp \ +DirectoryNodeActor.cpp \ +DirectoryNodeSeasons.cpp \ +DirectoryNodeSets.cpp \ +DirectoryNodeTitleMusicVideos.cpp \ +DirectoryNode.cpp \ +DirectoryNodeMoviesOverview.cpp \ +DirectoryNodeRecentlyAddedMovies.cpp \ +DirectoryNodeYear.cpp \ +DirectoryNodeRecentlyAddedMusicVideos.cpp \ +DirectoryNodeStudio.cpp \ +DirectoryNodeMusicVideoAlbum.cpp \ +DirectoryNodeTvShowsOverview.cpp \ + + +HEADERS += \ +DirectoryNodeMusicVideosOverview.h \ +DirectoryNodeRoot.h \ +DirectoryNodeEpisodes.h \ + \ +DirectoryNodeDirector.h \ +DirectoryNodeRecentlyAddedEpisodes.h \ +DirectoryNodeTitleMovies.h \ +DirectoryNodeOverview.h \ +DirectoryNodeGenre.h \ +QueryParams.h \ +DirectoryNodeTitleTvShows.h \ +DirectoryNodeActor.h \ +DirectoryNodeSeasons.h \ +DirectoryNodeSets.h \ +DirectoryNodeTitleMusicVideos.h \ +DirectoryNode.h \ +DirectoryNodeMoviesOverview.h \ +DirectoryNodeRecentlyAddedMovies.h \ +DirectoryNodeYear.h \ +DirectoryNodeRecentlyAddedMusicVideos.h \ +DirectoryNodeStudio.h \ +DirectoryNodeMusicVideoAlbum.h \ +DirectoryNodeTvShowsOverview.h \ + + +INCLUDEPATH += ../../../ diff --git a/xbmc/FileSystem/curl/libidn-x86-osx.a b/xbmc/FileSystem/curl/libidn-x86-osx.a new file mode 100644 index 00000000..f170600a Binary files /dev/null and b/xbmc/FileSystem/curl/libidn-x86-osx.a differ diff --git a/xbmc/FileSystem/curl/openldap.lib b/xbmc/FileSystem/curl/openldap.lib new file mode 100644 index 00000000..8488d334 Binary files /dev/null and b/xbmc/FileSystem/curl/openldap.lib differ diff --git a/xbmc/FileSystem/udf25.cpp b/xbmc/FileSystem/udf25.cpp new file mode 100644 index 00000000..6fdd3096 --- /dev/null +++ b/xbmc/FileSystem/udf25.cpp @@ -0,0 +1,1429 @@ +#include +#include +#include +#include "system.h" +#include "utils/log.h" +#include "udf25.h" +#include "File.h" + +/* For direct data access, LSB first */ +#define GETN1(p) ((uint8_t)data[p]) +#define GETN2(p) ((uint16_t)data[p] | ((uint16_t)data[(p) + 1] << 8)) +#define GETN3(p) ((uint32_t)data[p] | ((uint32_t)data[(p) + 1] << 8) \ + | ((uint32_t)data[(p) + 2] << 16)) +#define GETN4(p) ((uint32_t)data[p] \ + | ((uint32_t)data[(p) + 1] << 8) \ + | ((uint32_t)data[(p) + 2] << 16) \ + | ((uint32_t)data[(p) + 3] << 24)) +#define GETN8(p) ((uint64_t)data[p] \ + | ((uint64_t)data[(p) + 1] << 8) \ + | ((uint64_t)data[(p) + 2] << 16) \ + | ((uint64_t)data[(p) + 3] << 24) \ + | ((uint64_t)data[(p) + 4] << 32) \ + | ((uint64_t)data[(p) + 5] << 40) \ + | ((uint64_t)data[(p) + 6] << 48) \ + | ((uint64_t)data[(p) + 7] << 56)) + +/* This is wrong with regard to endianess */ +#define GETN(p, n, target) memcpy(target, &data[p], n) + + +static CRITICAL_SECTION m_critSection; +class udf25 m_udfIsoReader; +using namespace XFILE; + +#ifdef WIN32 + +#include +#include +#include + +template +CHAR_TYPE *strcasestr // TODO: Have not been tested!!! +( + CHAR_TYPE * szStringToBeSearched, + CHAR_TYPE * szSubstringToSearchFor +) +{ + CHAR_TYPE * pPos = NULL; + CHAR_TYPE * szCopy1 = NULL; + CHAR_TYPE * szCopy2 = NULL; + + // verify parameters + if ( szStringToBeSearched == NULL || + szSubstringToSearchFor == NULL ) + { + return szStringToBeSearched; + } + + // empty substring - return input (consistent with strstr) + if ( _tcslen(szSubstringToSearchFor) == 0 ) { + return szStringToBeSearched; + } + + szCopy1 = _tcslwr(_tcsdup(szStringToBeSearched)); + szCopy2 = _tcslwr(_tcsdup(szSubstringToSearchFor)); + + if ( szCopy1 == NULL || szCopy2 == NULL ) { + // another option is to raise an exception here + free((void*)szCopy1); + free((void*)szCopy2); + return NULL; + } + + pPos = strstr(szCopy1, szCopy2); + + if ( pPos != NULL ) { + // map to the original string + pPos = szStringToBeSearched + (pPos - szCopy1); + } + + free((void*)szCopy1); + free((void*)szCopy2); + + return pPos; +} // stristr(...) + +#endif + +static int Unicodedecode( uint8_t *data, int len, char *target ) +{ + int p = 1, i = 0; + + if( ( data[ 0 ] == 8 ) || ( data[ 0 ] == 16 ) ) do { + if( data[ 0 ] == 16 ) p++; /* Ignore MSB of unicode16 */ + if( p < len ) { + target[ i++ ] = data[ p++ ]; + } + } while( p < len ); + + target[ i ] = '\0'; + return 0; +} + +static int UDFExtentAD( uint8_t *data, uint32_t *Length, uint32_t *Location ) +{ + *Length = GETN4(0); + *Location = GETN4(4); + return 0; +} + +static int UDFShortAD( uint8_t *data, struct AD *ad, + struct Partition *partition ) +{ + ad->Length = GETN4(0); + ad->Flags = ad->Length >> 30; + ad->Length &= 0x3FFFFFFF; + ad->Location = GETN4(4); + ad->Partition = partition->Number; /* use number of current partition */ + return 0; +} + +static int UDFLongAD( uint8_t *data, struct AD *ad ) +{ + ad->Length = GETN4(0); + ad->Flags = ad->Length >> 30; + ad->Length &= 0x3FFFFFFF; + ad->Location = GETN4(4); + ad->Partition = GETN2(8); + /* GETN(10, 6, Use); */ + return 0; +} + +static int UDFExtAD( uint8_t *data, struct AD *ad ) +{ + ad->Length = GETN4(0); + ad->Flags = ad->Length >> 30; + ad->Length &= 0x3FFFFFFF; + ad->Location = GETN4(12); + ad->Partition = GETN2(16); + /* GETN(10, 6, Use); */ + return 0; +} + + +static int UDFICB( uint8_t *data, uint8_t *FileType, uint16_t *Flags ) +{ + *FileType = GETN1(11); + *Flags = GETN2(18); + return 0; +} + +static int UDFPartition( uint8_t *data, uint16_t *Flags, uint16_t *Number, + char *Contents, uint32_t *Start, uint32_t *Length ) +{ + *Flags = GETN2(20); + *Number = GETN2(22); + GETN(24, 32, Contents); + *Start = GETN4(188); + *Length = GETN4(192); + return 0; +} + +static int UDFLogVolume( uint8_t *data, char *VolumeDescriptor ) +{ + uint32_t lbsize, MT_L, N_PM; + Unicodedecode(&data[84], 128, VolumeDescriptor); + lbsize = GETN4(212); /* should be 2048 */ + MT_L = GETN4(264); /* should be 6 */ + N_PM = GETN4(268); /* should be 1 */ + if (lbsize != DVD_VIDEO_LB_LEN) return 1; + return 0; +} + +static int UDFExtFileEntry( uint8_t *data, uint8_t *FileType, + struct Partition *partition, struct FileAD *fad ) +{ + uint16_t flags; + uint32_t L_EA, L_AD; + unsigned int p; + + UDFICB( &data[ 16 ], FileType, &flags ); + + /* Init ad for an empty file (i.e. there isn't a AD, L_AD == 0 ) */ + fad->Length = GETN8(56); // 64-bit. + + L_EA = GETN4( 208); + L_AD = GETN4( 212); + p = 216 + L_EA; + fad->num_AD = 0; + while( p < 216 + L_EA + L_AD ) { + struct AD *ad; + + if (fad->num_AD >= UDF_MAX_AD_CHAINS) return 0; + + ad = &fad->AD_chain[fad->num_AD]; + ad->Partition = partition->Number; + ad->Flags = 0; + fad->num_AD++; + + switch( flags & 0x0007 ) { + case 0: + UDFShortAD( &data[ p ], ad, partition ); + p += 8; + break; + case 1: + UDFLongAD( &data[ p ], ad ); + p += 16; + break; + case 2: + UDFExtAD( &data[ p ], ad ); + p += 20; + break; + case 3: + switch( L_AD ) { + case 8: + UDFShortAD( &data[ p ], ad, partition ); + break; + case 16: + UDFLongAD( &data[ p ], ad ); + break; + case 20: + UDFExtAD( &data[ p ], ad ); + break; + } + p += L_AD; + break; + default: + p += L_AD; + break; + } + } + return 0; + +} + +/* TagID 266 + * The differences in ExtFile are indicated below: + * struct extfile_entry { + * struct desc_tag tag; + * struct icb_tag icbtag; + * uint32_t uid; + * uint32_t gid; + * uint32_t perm; + * uint16_t link_cnt; + * uint8_t rec_format; + * uint8_t rec_disp_attr; + * uint32_t rec_len; + * uint64_t inf_len; + * uint64_t obj_size; // NEW + * uint64_t logblks_rec; + * struct timestamp atime; + * struct timestamp mtime; + * struct timestamp ctime; // NEW + * struct timestamp attrtime; + * uint32_t ckpoint; + * uint32_t reserved1; // NEW + * struct long_ad ex_attr_icb; + * struct long_ad streamdir_icb; // NEW + * struct regid imp_id; + * uint64_t unique_id; + * uint32_t l_ea; + * uint32_t l_ad; + * uint8_t data[1]; + * } __packed; + * + * So old "l_ea" is now +216 + * + * Lund + */ + +static int UDFFileEntry( uint8_t *data, uint8_t *FileType, + struct Partition *partition, struct FileAD *fad ) +{ + uint16_t flags; + uint32_t L_EA, L_AD; + unsigned int p; + unsigned int curr_ad; + + UDFICB( &data[ 16 ], FileType, &flags ); + + fad->Length = GETN8( 56 ); /* Was 4 bytes at 60, changed for 64bit. */ + + L_EA = GETN4( 168 ); + L_AD = GETN4( 172 ); + + if (176 + L_EA + L_AD > DVD_VIDEO_LB_LEN) + return 0; + + p = 176 + L_EA; + curr_ad = 0; + + /* Function changed to record all AD chains, not just the last one! */ + while( p < 176 + L_EA + L_AD ) { + struct AD *ad; + + if (curr_ad >= UDF_MAX_AD_CHAINS) return 0; + + ad = &fad->AD_chain[curr_ad]; + ad->Partition = partition->Number; + ad->Flags = 0; + // Increase AD chain ptr + curr_ad++; + + switch( flags & 0x0007 ) { + case 0: + UDFShortAD( &data[ p ], ad, partition ); + p += 8; + break; + case 1: + UDFLongAD( &data[ p ], ad ); + p += 16; + break; + case 2: + UDFExtAD( &data[ p ], ad ); + p += 20; + break; + case 3: + switch( L_AD ) { + case 8: + UDFShortAD( &data[ p ], ad, partition ); + break; + case 16: + UDFLongAD( &data[ p ], ad ); + break; + case 20: + UDFExtAD( &data[ p ], ad ); + break; + } + p += L_AD; + break; + default: + p += L_AD; + break; + } + } + return 0; +} + + +// The API users will refer to block 0 as start of file and going up +// we need to convert that to actual disk block; +// partition_start + file_start + offset +// but keep in mind that file_start is chained, and not contiguous. +// +// We return "0" as error, since a File can not start at physical block 0 +// +// Who made Location be blocks, but Length be bytes? Can bytes be uneven +// blocksize in the middle of a chain? +// +uint32_t UDFFileBlockPos(struct FileAD *File, uint32_t file_block) +{ + uint32_t result, i, offset; + + if (!File) return 0; + + // Look through the chain to see where this block would belong. + for (i = 0, offset = 0; i < File->num_AD; i++) { + + // Is "file_block" inside this chain? Then use this chain. + if (file_block < (offset + (File->AD_chain[i].Length / DVD_VIDEO_LB_LEN))) + break; + + offset += (File->AD_chain[i].Length / DVD_VIDEO_LB_LEN); + + } + + if (i >= File->num_AD) + i = 0; // This was the default behavior before I fixed things. + + //if(offset == 0) + // offset = 32; + + result = File->Partition_Start + File->AD_chain[i].Location + file_block - offset; + return result; +} + +static int UDFFileIdentifier( uint8_t *data, uint8_t *FileCharacteristics, + char *FileName, struct AD *FileICB ) +{ + uint8_t L_FI; + uint16_t L_IU; + + *FileCharacteristics = GETN1(18); + L_FI = GETN1(19); + UDFLongAD(&data[20], FileICB); + L_IU = GETN2(36); + if (L_FI) Unicodedecode(&data[38 + L_IU], L_FI, FileName); + else FileName[0] = '\0'; + return 4 * ((38 + L_FI + L_IU + 3) / 4); +} + +static int UDFDescriptor( uint8_t *data, uint16_t *TagID ) +{ + *TagID = GETN2(0); + /* TODO: check CRC 'n stuff */ + return 0; +} + +/** + * initialize and open a DVD device or file. + */ +static CFile* file_open(const char *target) +{ + CFile* fp = new CFile(); + + if(!fp->Open(target)) + { + CLog::Log(LOGERROR,"file_open - Could not open input"); + delete fp; + return NULL; + } + + return fp; +} + + +/** + * seek into the device. + */ +static int file_seek(CFile* fp, int blocks) +{ + off64_t pos; + + pos = fp->Seek((off64_t)blocks * (off64_t)DVD_VIDEO_LB_LEN, SEEK_SET); + + if(pos < 0) { + return pos; + } + /* assert pos % DVD_VIDEO_LB_LEN == 0 */ + return (int) (pos / DVD_VIDEO_LB_LEN); +} + +/** + * read data from the device. + */ +static int file_read(CFile* fp, void *buffer, int blocks, int flags) +{ + size_t len; + ssize_t ret; + + len = (size_t)blocks * DVD_VIDEO_LB_LEN; + + while(len > 0) { + + ret = fp->Read(buffer, len); + + if(ret < 0) { + /* One of the reads failed, too bad. We won't even bother + * returning the reads that went OK, and as in the POSIX spec + * the file position is left unspecified after a failure. */ + return ret; + } + + if(ret == 0) { + /* Nothing more to read. Return all of the whole blocks, if any. + * Adjust the file position back to the previous block boundary. */ + size_t bytes = (size_t)blocks * DVD_VIDEO_LB_LEN - len; + off_t over_read = -(bytes % DVD_VIDEO_LB_LEN); + /*off_t pos =*/ fp->Seek(over_read, SEEK_CUR); + /* should have pos % 2048 == 0 */ + return (int) (bytes / DVD_VIDEO_LB_LEN); + } + + len -= ret; + } + + return blocks; +} + +/** + * close the DVD device and clean up. + */ +static int file_close(CFile* fp) +{ + fp->Close(); + + return 0; +} + +// offset is in bytes, force_size is in sectors +uint64_t DVDFileSeekForce(BD_FILE bdfile, uint64_t offset, int64_t force_size) +{ + /* Check arguments. */ + if( bdfile == NULL || offset <= 0 ) + return -1; + + // if -1 then round up to the next block + if( force_size < 0 ) + force_size = (offset + DVD_VIDEO_LB_LEN) - (offset % DVD_VIDEO_LB_LEN); + + if(bdfile->filesize < (uint64_t)force_size ) { + bdfile->filesize = force_size; + CLog::Log(LOGERROR, "DVDFileSeekForce - ignored size of file indicated in UDF"); + } + + if( offset > bdfile->filesize ) + return -1; + + bdfile->seek_pos = offset; + return offset; +} + +int UDFSplitIsoFile(const char *fullFilename, char* iso, char* file) +{ + const char* filename = strcasestr(fullFilename, ".iso"); + if(!filename) + return -1; + + filename += strlen(".iso"); + if(*filename != '/') + return -1; + + size_t size = strlen(filename); + memcpy(file, filename, size); + file[size] = 0; + + size = filename - fullFilename; + memcpy(iso, fullFilename, filename - fullFilename); + iso[size] = 0; + + return 0; +} + + +int udf25::UDFScanDirX( udf_dir_t *dirp ) +{ + char filename[ MAX_UDF_FILE_NAME_LEN ]; + uint8_t directory_base[ 2 * DVD_VIDEO_LB_LEN + 2048]; + uint8_t *directory = (uint8_t *)(((uintptr_t)directory_base & ~((uintptr_t)2047)) + 2048); + uint32_t lbnum; + uint16_t TagID; + uint8_t filechar; + unsigned int p; + struct AD FileICB; + struct FileAD File; + struct Partition partition; + uint8_t filetype; + + if(!(GetUDFCache(PartitionCache, 0, &partition))) + return 0; + + /* Scan dir for ICB of file */ + lbnum = dirp->dir_current; + + // I have cut out the caching part of the original UDFScanDir() function + // one day we should probably bring it back. + memset(&File, 0, sizeof(File)); + + if( DVDReadLBUDF( lbnum, 2, directory, 0 ) <= 0 ) { + return 0; + } + + + p = dirp->current_p; + while( p < dirp->dir_length ) { + if( p > DVD_VIDEO_LB_LEN ) { + ++lbnum; + p -= DVD_VIDEO_LB_LEN; + + //Dir.Length -= DVD_VIDEO_LB_LEN; + if (dirp->dir_length >= DVD_VIDEO_LB_LEN) + dirp->dir_length -= DVD_VIDEO_LB_LEN; + else + dirp->dir_length = 0; + + if( DVDReadLBUDF( lbnum, 2, directory, 0 ) <= 0 ) { + return 0; + } + } + UDFDescriptor( &directory[ p ], &TagID ); + + if( TagID == 257 ) { + + p += UDFFileIdentifier( &directory[ p ], &filechar, + filename, &FileICB ); + + dirp->current_p = p; + dirp->dir_current = lbnum; + + if (!*filename) // No filename, simulate "." dirname + strcpy((char *)dirp->entry.d_name, "."); + else { + // Bah, MSVC don't have strlcpy() + strncpy((char *)dirp->entry.d_name, filename, + sizeof(dirp->entry.d_name)-1); + dirp->entry.d_name[ sizeof(dirp->entry.d_name) - 1 ] = 0; + } + + + // Look up the Filedata + if( !UDFMapICB( FileICB, &filetype, &partition, &File)) + return 0; + if (filetype == 4) + dirp->entry.d_type = DVD_DT_DIR; + else + dirp->entry.d_type = DVD_DT_REG; // Add more types? + + dirp->entry.d_filesize = File.Length; + + return 1; + + } else { + // Not TagID 257 + return 0; + } + } + // End of DIR + return 0; +} + +int udf25::SetUDFCache(UDFCacheType type, uint32_t nr, void *data) +{ + int n; + struct udf_cache *c; + void *tmp; + + if(DVDUDFCacheLevel(-1) <= 0) + return 0; + + c = (struct udf_cache *)GetUDFCacheHandle(); + + if(c == NULL) { + c = (struct udf_cache *)calloc(1, sizeof(struct udf_cache)); + /* fprintf(stderr, "calloc: %d\n", sizeof(struct udf_cache)); */ + if(c == NULL) + return 0; + SetUDFCacheHandle(c); + } + + + switch(type) { + case AVDPCache: + c->avdp = *(struct avdp_t *)data; + c->avdp_valid = 1; + break; + case PVDCache: + c->pvd = *(struct pvd_t *)data; + c->pvd_valid = 1; + break; + case PartitionCache: + c->partition = *(struct Partition *)data; + c->partition_valid = 1; + break; + case RootICBCache: + c->rooticb = *(struct AD *)data; + c->rooticb_valid = 1; + break; + case LBUDFCache: + for(n = 0; n < c->lb_num; n++) { + if(c->lbs[n].lb == nr) { + /* replace with new data */ + c->lbs[n].data_base = ((uint8_t **)data)[0]; + c->lbs[n].data = ((uint8_t **)data)[1]; + c->lbs[n].lb = nr; + return 1; + } + } + c->lb_num++; + tmp = realloc(c->lbs, c->lb_num * sizeof(struct lbudf)); + /* + fprintf(stderr, "realloc lb: %d * %d = %d\n", + c->lb_num, sizeof(struct lbudf), + c->lb_num * sizeof(struct lbudf)); + */ + if(tmp == NULL) { + if(c->lbs) free(c->lbs); + c->lb_num = 0; + return 0; + } + c->lbs = (struct lbudf *)tmp; + c->lbs[n].data_base = ((uint8_t **)data)[0]; + c->lbs[n].data = ((uint8_t **)data)[1]; + c->lbs[n].lb = nr; + break; + case MapCache: + for(n = 0; n < c->map_num; n++) { + if(c->maps[n].lbn == nr) { + /* replace with new data */ + c->maps[n] = *(struct icbmap *)data; + c->maps[n].lbn = nr; + return 1; + } + } + c->map_num++; + tmp = realloc(c->maps, c->map_num * sizeof(struct icbmap)); + /* + fprintf(stderr, "realloc maps: %d * %d = %d\n", + c->map_num, sizeof(struct icbmap), + c->map_num * sizeof(struct icbmap)); + */ + if(tmp == NULL) { + if(c->maps) free(c->maps); + c->map_num = 0; + return 0; + } + c->maps = (struct icbmap *)tmp; + c->maps[n] = *(struct icbmap *)data; + c->maps[n].lbn = nr; + break; + default: + return 0; + } + + return 1; +} + +int udf25::DVDUDFCacheLevel(int level) +{ + if(level > 0) { + level = 1; + } else if(level < 0) { + return m_udfcache_level; + } + + m_udfcache_level = level; + + return level; +} + +void *udf25::GetUDFCacheHandle() +{ + return m_udfcache; +} + +void udf25::SetUDFCacheHandle(void *cache) +{ + m_udfcache = cache; +} + +int udf25::GetUDFCache(UDFCacheType type, uint32_t nr, void *data) +{ + int n; + struct udf_cache *c; + + if(DVDUDFCacheLevel(-1) <= 0) + return 0; + + c = (struct udf_cache *)GetUDFCacheHandle(); + + if(c == NULL) + return 0; + + switch(type) { + case AVDPCache: + if(c->avdp_valid) { + *(struct avdp_t *)data = c->avdp; + return 1; + } + break; + case PVDCache: + if(c->pvd_valid) { + *(struct pvd_t *)data = c->pvd; + return 1; + } + break; + case PartitionCache: + if(c->partition_valid) { + *(struct Partition *)data = c->partition; + return 1; + } + break; + case RootICBCache: + if(c->rooticb_valid) { + *(struct AD *)data = c->rooticb; + return 1; + } + break; + case LBUDFCache: + for(n = 0; n < c->lb_num; n++) { + if(c->lbs[n].lb == nr) { + *(uint8_t **)data = c->lbs[n].data; + return 1; + } + } + break; + case MapCache: + for(n = 0; n < c->map_num; n++) { + if(c->maps[n].lbn == nr) { + *(struct icbmap *)data = c->maps[n]; + return 1; + } + } + break; + default: + break; + } + + return 0; +} + +int udf25::UDFReadBlocksRaw( uint32_t lb_number, size_t block_count, unsigned char *data, int encrypted ) +{ + int ret; + + ret = file_seek( m_fp, (int) lb_number ); + if( ret != (int) lb_number ) { + CLog::Log(LOGERROR, "udf25::UDFReadBlocksRaw - Can't seek to block %u (got %u)", lb_number, ret ); + return 0; + } + + ret = file_read( m_fp, (char *) data, (int) block_count, encrypted ); + return ret; +} + +int udf25::DVDReadLBUDF( uint32_t lb_number, size_t block_count, unsigned char *data, int encrypted ) +{ + int ret; + size_t count = block_count; + + while(count > 0) { + + ret = UDFReadBlocksRaw(lb_number, count, data, encrypted); + + if(ret <= 0) { + /* One of the reads failed or nothing more to read, too bad. + * We won't even bother returning the reads that went ok. */ + return ret; + } + + count -= (size_t)ret; + lb_number += (uint32_t)ret; + } + + return block_count; +} + +int udf25::UDFGetAVDP( struct avdp_t *avdp) +{ + uint8_t Anchor_base[ DVD_VIDEO_LB_LEN + 2048 ]; + uint8_t *Anchor = (uint8_t *)(((uintptr_t)Anchor_base & ~((uintptr_t)2047)) + 2048); + uint32_t lbnum, MVDS_location, MVDS_length; + uint16_t TagID; + uint32_t lastsector; + int terminate; + struct avdp_t; + + if(GetUDFCache(AVDPCache, 0, avdp)) + return 1; + + /* Find Anchor */ + lastsector = 0; + lbnum = 256; /* Try #1, prime anchor */ + terminate = 0; + + for(;;) { + if( DVDReadLBUDF( lbnum, 1, Anchor, 0 ) > 0 ) { + UDFDescriptor( Anchor, &TagID ); + } else { + TagID = 0; + } + if (TagID != 2) { + /* Not an anchor */ + if( terminate ) return 0; /* Final try failed */ + + if( lastsector ) { + /* We already found the last sector. Try #3, alternative + * backup anchor. If that fails, don't try again. + */ + lbnum = lastsector; + terminate = 1; + } else { + /* TODO: Find last sector of the disc (this is optional). */ + if( lastsector ) + /* Try #2, backup anchor */ + lbnum = lastsector - 256; + else + /* Unable to find last sector */ + return 0; + } + } else + /* It's an anchor! We can leave */ + break; + } + /* Main volume descriptor */ + UDFExtentAD( &Anchor[ 16 ], &MVDS_length, &MVDS_location ); + avdp->mvds.location = MVDS_location; + avdp->mvds.length = MVDS_length; + + /* Backup volume descriptor */ + UDFExtentAD( &Anchor[ 24 ], &MVDS_length, &MVDS_location ); + avdp->rvds.location = MVDS_location; + avdp->rvds.length = MVDS_length; + + SetUDFCache(AVDPCache, 0, avdp); + + return 1; +} + +int udf25::UDFFindPartition( int partnum, struct Partition *part ) +{ + uint8_t LogBlock_base[ DVD_VIDEO_LB_LEN + 2048 ]; + uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~((uintptr_t)2047)) + 2048); + uint32_t lbnum, MVDS_location, MVDS_length; + uint16_t TagID; + int i, volvalid; + struct avdp_t avdp; + + if(!UDFGetAVDP(&avdp)) + return 0; + + /* Main volume descriptor */ + MVDS_location = avdp.mvds.location; + MVDS_length = avdp.mvds.length; + + part->valid = 0; + volvalid = 0; + part->VolumeDesc[ 0 ] = '\0'; + i = 1; + do { + /* Find Volume Descriptor */ + lbnum = MVDS_location; + do { + + if( DVDReadLBUDF( lbnum++, 1, LogBlock, 0 ) <= 0 ) + TagID = 0; + else + UDFDescriptor( LogBlock, &TagID ); + + if( ( TagID == 5 ) && ( !part->valid ) ) { + /* Partition Descriptor */ + UDFPartition( LogBlock, &part->Flags, &part->Number, + part->Contents, &part->Start, &part->Length ); + part->valid = ( partnum == part->Number ); + } else if( ( TagID == 6 ) && ( !volvalid ) ) { + /* Logical Volume Descriptor */ + if( UDFLogVolume( LogBlock, part->VolumeDesc ) ) { + /* TODO: sector size wrong! */ + } else + volvalid = 1; + } + + } while( ( lbnum <= MVDS_location + ( MVDS_length - 1 ) + / DVD_VIDEO_LB_LEN ) && ( TagID != 8 ) + && ( ( !part->valid ) || ( !volvalid ) ) ); + + if( ( !part->valid) || ( !volvalid ) ) { + /* Backup volume descriptor */ + MVDS_location = avdp.mvds.location; + MVDS_length = avdp.mvds.length; + } + } while( i-- && ( ( !part->valid ) || ( !volvalid ) ) ); + + /* We only care for the partition, not the volume */ + return part->valid; +} + +int udf25::UDFMapICB( struct AD ICB, uint8_t *FileType, struct Partition *partition, struct FileAD *File ) +{ + uint8_t LogBlock_base[DVD_VIDEO_LB_LEN + 2048]; + uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~((uintptr_t)2047)) + 2048); + uint32_t lbnum; + uint16_t TagID; + struct icbmap tmpmap; + + lbnum = partition->Start + ICB.Location; + tmpmap.lbn = lbnum; + if(GetUDFCache(MapCache, lbnum, &tmpmap)) { + *FileType = tmpmap.filetype; + memcpy(File, &tmpmap.file, sizeof(tmpmap.file)); + return 1; + } + + do { + if( DVDReadLBUDF( lbnum++, 1, LogBlock, 0 ) <= 0 ) + TagID = 0; + else + UDFDescriptor( LogBlock, &TagID ); + + if( TagID == 261 ) { + UDFFileEntry( LogBlock, FileType, partition, File ); + memcpy(&tmpmap.file, File, sizeof(tmpmap.file)); + tmpmap.filetype = *FileType; + SetUDFCache(MapCache, tmpmap.lbn, &tmpmap); + return 1; + }; + + /* ExtendedFileInfo */ + if( TagID == 266 ) { + UDFExtFileEntry( LogBlock, FileType, partition, File ); + memcpy(&tmpmap.file, File, sizeof(tmpmap.file)); + tmpmap.filetype = *FileType; + SetUDFCache(MapCache, tmpmap.lbn, &tmpmap); + return 1; + } + + + } while( ( lbnum <= partition->Start + ICB.Location + ( ICB.Length - 1 ) + / DVD_VIDEO_LB_LEN ) && ( TagID != 261 ) && (TagID != 266) ); + + return 0; +} +void udf25::UDFFreeFile(UDF_FILE file) +{ + free(file); +} + +int udf25::UDFScanDir( struct FileAD Dir, char *FileName, struct Partition *partition, struct AD *FileICB, int cache_file_info) +{ + char filename[ MAX_UDF_FILE_NAME_LEN ]; + uint8_t directory_base[ 2 * DVD_VIDEO_LB_LEN + 2048]; + uint8_t *directory = (uint8_t *)(((uintptr_t)directory_base & ~((uintptr_t)2047)) + 2048); + uint32_t lbnum; + uint16_t TagID; + uint8_t filechar; + unsigned int p; + uint8_t *cached_dir_base = NULL, *cached_dir; + uint32_t dir_lba; + struct AD tmpICB; + int found = 0; + int in_cache = 0; + + /* Scan dir for ICB of file */ + lbnum = partition->Start + Dir.AD_chain[0].Location; + + if(DVDUDFCacheLevel(-1) > 0) { + /* caching */ + + if(!GetUDFCache(LBUDFCache, lbnum, &cached_dir)) { + dir_lba = (Dir.AD_chain[0].Length + DVD_VIDEO_LB_LEN) / DVD_VIDEO_LB_LEN; + if((cached_dir_base = (uint8_t *)malloc(dir_lba * DVD_VIDEO_LB_LEN + 2048)) == NULL) + return 0; + cached_dir = (uint8_t *)(((uintptr_t)cached_dir_base & ~((uintptr_t)2047)) + 2048); + if( DVDReadLBUDF( lbnum, dir_lba, cached_dir, 0) <= 0 ) { + free(cached_dir_base); + cached_dir_base = NULL; + cached_dir = NULL; + } + /* + if(cached_dir) { + fprintf(stderr, "malloc dir: %d\n", dir_lba * DVD_VIDEO_LB_LEN); + } + */ + { + uint8_t *data[2]; + data[0] = cached_dir_base; + data[1] = cached_dir; + SetUDFCache(LBUDFCache, lbnum, data); + } + } else + in_cache = 1; + + if(cached_dir == NULL) + return 0; + + p = 0; + + while( p < Dir.AD_chain[0].Length ) { /* Assuming dirs don't use chains? */ + UDFDescriptor( &cached_dir[ p ], &TagID ); + if( TagID == 257 ) { + p += UDFFileIdentifier( &cached_dir[ p ], &filechar, + filename, &tmpICB ); + if(cache_file_info && !in_cache) { + uint8_t tmpFiletype; + struct FileAD tmpFile; + + memset(&tmpFile, 0, sizeof(tmpFile)); + + if( !strcasecmp( FileName, filename ) ) { + memcpy(FileICB, &tmpICB, sizeof(tmpICB)); + found = 1; + } + UDFMapICB(tmpICB, &tmpFiletype, partition, &tmpFile); + } else { + if( !strcasecmp( FileName, filename ) ) { + memcpy(FileICB, &tmpICB, sizeof(tmpICB)); + return 1; + } + } + } else { + if(cache_file_info && (!in_cache) && found) + return 1; + return 0; + } + } + if(cache_file_info && (!in_cache) && found) + return 1; + return 0; + } + + if( DVDReadLBUDF( lbnum, 2, directory, 0 ) <= 0 ) + return 0; + + p = 0; + while( p < Dir.AD_chain[0].Length ) { + if( p > DVD_VIDEO_LB_LEN ) { + ++lbnum; + p -= DVD_VIDEO_LB_LEN; + Dir.AD_chain[0].Length -= DVD_VIDEO_LB_LEN; + if( DVDReadLBUDF( lbnum, 2, directory, 0 ) <= 0 ) { + return 0; + } + } + UDFDescriptor( &directory[ p ], &TagID ); + if( TagID == 257 ) { + p += UDFFileIdentifier( &directory[ p ], &filechar, + filename, FileICB ); + if( !strcasecmp( FileName, filename ) ) { + return 1; + } + } else + return 0; + } + + return 0; +} + +udf25::udf25( ) +{ + m_fp = NULL; + m_udfcache_level = 1; + m_udfcache = NULL; +} + +udf25::~udf25( ) +{ + if(m_fp) + m_fp->Close(); +} + +UDF_FILE udf25::UDFFindFile( const char* filename, uint64_t *filesize ) +{ + uint8_t LogBlock_base[ DVD_VIDEO_LB_LEN + 2048 ]; + uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~((uintptr_t)2047)) + 2048); + uint32_t lbnum; + uint16_t TagID; + struct Partition partition; + struct AD RootICB, ICB; + struct FileAD File; + char tokenline[ MAX_UDF_FILE_NAME_LEN ]; + char *token; + uint8_t filetype; + struct FileAD *result; + + *filesize = 0; + tokenline[0] = '\0'; + strncat(tokenline, filename, MAX_UDF_FILE_NAME_LEN - 1); + memset(&ICB, 0, sizeof(ICB)); + memset(&File, 0, sizeof(File)); + + if(!(GetUDFCache(PartitionCache, 0, &partition) && + GetUDFCache(RootICBCache, 0, &RootICB))) { + /* Find partition, 0 is the standard location for DVD Video.*/ + if( !UDFFindPartition(0, &partition ) ) return 0; + SetUDFCache(PartitionCache, 0, &partition); + + /* Find root dir ICB */ + lbnum = partition.Start; + do { + if( DVDReadLBUDF( lbnum++, 1, LogBlock, 0 ) <= 0 ) + TagID = 0; + else + UDFDescriptor( LogBlock, &TagID ); + + /* + * It seems that someone added a FileType of 250, which seems to be + * a "redirect" style file entry. If we discover such an entry, we + * add on the "location" to partition->Start, and try again. + * Who added this? Is there any official guide somewhere? + * 2008/09/17 lundman + * Should we handle 261(250) as well? FileEntry+redirect + */ + if( TagID == 266 ) { + UDFExtFileEntry( LogBlock, &filetype, &partition, &File ); + if (filetype == 250) { + partition.Start += File.AD_chain[0].Location; + lbnum = partition.Start; + SetUDFCache(PartitionCache, 0, &partition); + continue; + } + } + + /* File Set Descriptor */ + if( TagID == 256 ) /* File Set Descriptor */ + UDFLongAD( &LogBlock[ 400 ], &RootICB ); + } while( ( lbnum < partition.Start + partition.Length ) + && ( TagID != 8 ) && ( TagID != 256 ) ); + + /* Sanity checks. */ + if( TagID != 256 ) + return NULL; + /* This following test will fail under UDF2.50 images, as it is no longer + * valid */ + /*if( RootICB.Partition != 0 ) + return 0;*/ + SetUDFCache(RootICBCache, 0, &RootICB); + } + + /* Find root dir */ + if( !UDFMapICB( RootICB, &filetype, &partition, &File ) ) + return NULL; + if( filetype != 4 ) + return NULL; /* Root dir should be dir */ + { + int cache_file_info = 0; + /* Tokenize filepath */ + token = strtok(tokenline, "/"); + + while( token != NULL ) { + if( !UDFScanDir( File, token, &partition, &ICB, + cache_file_info)) + return NULL; + if( !UDFMapICB( ICB, &filetype, &partition, &File ) ) + return NULL; + if(!strcmp(token, "index.bdmv")) + cache_file_info = 1; + token = strtok( NULL, "/" ); + } + } + + /* Sanity check. */ + if( File.AD_chain[0].Partition != 0 ) + return 0; + *filesize = File.Length; + /* Hack to not return partition.Start for empty files. */ + if( !File.AD_chain[0].Location ) + return NULL; + + /* Allocate a new UDF_FILE and return it. */ + result = (struct FileAD *) malloc(sizeof(*result)); + if (!result) return NULL; + + memcpy(result, &File, sizeof(*result)); + + result->Partition_Start = partition.Start; + + return result; +} + +HANDLE udf25::OpenFile( const char* fullFilename ) +{ + uint64_t filesize; + UDF_FILE file = NULL; + BD_FILE bdfile = NULL; + char isoname[256], filename[256]; + + if(UDFSplitIsoFile(fullFilename, isoname, filename) !=0 ) + return INVALID_HANDLE_VALUE; + + m_fp = file_open(isoname); + if(m_fp) + { + file = UDFFindFile(filename, &filesize); + if(file) + { + bdfile = (BD_FILE)malloc(sizeof(*bdfile)); + memset(bdfile, 0, sizeof(*bdfile)); + + bdfile->file = file; + bdfile->filesize = filesize; + } + else + { + CloseFile(NULL); + } + } + + return bdfile ? (HANDLE)bdfile : INVALID_HANDLE_VALUE; +} + + +long udf25::ReadFile(HANDLE hFile, unsigned char *pBuffer, long lSize) +{ + BD_FILE bdfile = (BD_FILE)hFile; + unsigned char *secbuf_base, *secbuf; + unsigned int numsec, seek_sector, seek_byte, fileoff; + int ret; + + /* Check arguments. */ + if( bdfile == NULL || pBuffer == NULL ) + return -1; + + seek_sector = bdfile->seek_pos / DVD_VIDEO_LB_LEN; + seek_byte = bdfile->seek_pos % DVD_VIDEO_LB_LEN; + + numsec = ( ( seek_byte + lSize ) / DVD_VIDEO_LB_LEN ) + + ( ( ( seek_byte + lSize ) % DVD_VIDEO_LB_LEN ) ? 1 : 0 ); + + secbuf_base = (unsigned char *) malloc( numsec * DVD_VIDEO_LB_LEN + 2048 ); + secbuf = (unsigned char *)(((uintptr_t)secbuf_base & ~((uintptr_t)2047)) + 2048); + if( !secbuf_base ) { + CLog::Log(LOGERROR, "udf25::ReadFile - Can't allocate memory for file read!" ); + return 0; + } + + fileoff = UDFFileBlockPos(bdfile->file, seek_sector); + fileoff -= 32; + + ret = UDFReadBlocksRaw( fileoff, (size_t) numsec, secbuf, 0 ); + + if( ret != (int) numsec ) { + free( secbuf_base ); + return ret < 0 ? ret : 0; + } + + memcpy( pBuffer, &(secbuf[ seek_byte ]), lSize ); + free( secbuf_base ); + + DVDFileSeekForce(bdfile, bdfile->seek_pos + lSize, -1); + + return lSize; +} + +void udf25::CloseFile(HANDLE hFile) +{ + BD_FILE bdfile = (BD_FILE)hFile; + if(bdfile) + { + free(bdfile->file); + free(bdfile); + } + + if(m_udfcache) + { + free(m_udfcache); + m_udfcache = NULL; + } + + if(m_fp) + { + file_close(m_fp); + delete(m_fp); + m_fp = NULL; + } +} + +int64_t udf25::Seek(HANDLE hFile, int64_t lOffset, int whence) +{ + BD_FILE bdfile = (BD_FILE)hFile; + + if(bdfile == NULL) + return -1; + + int64_t seek_pos = bdfile->seek_pos; + switch (whence) + { + case SEEK_SET: + // cur = pos + bdfile->seek_pos = lOffset; + break; + + case SEEK_CUR: + // cur += pos + bdfile->seek_pos += lOffset; + break; + case SEEK_END: + // end += pos + bdfile->seek_pos = bdfile->filesize + lOffset; + break; + } + + if (bdfile->seek_pos > bdfile->filesize) + { + bdfile->seek_pos = seek_pos; + return bdfile->seek_pos; + } + + return bdfile->seek_pos; +} + +int64_t udf25::GetFileSize(HANDLE hFile) +{ + BD_FILE bdfile = (BD_FILE)hFile; + + if(bdfile == NULL) + return -1; + + return bdfile->filesize; +} + +int64_t udf25::GetFilePosition(HANDLE hFile) +{ + BD_FILE bdfile = (BD_FILE)hFile; + + if(bdfile == NULL) + return -1; + + return bdfile->seek_pos; +} + +udf_dir_t *udf25::OpenDir( const char *subdir ) +{ + udf_dir_t *result; + BD_FILE bd_file; + + bd_file = (BD_FILE)OpenFile(subdir); + + if (bd_file == (BD_FILE)INVALID_HANDLE_VALUE) + { + return NULL; + } + result = (udf_dir_t *)malloc(sizeof(*result)); + if (!result) { + UDFFreeFile(bd_file->file); + free(bd_file); + return NULL; + } + + memset(result, 0, sizeof(*result)); + + result->dir_location = UDFFileBlockPos(bd_file->file, 0); + result->dir_current = UDFFileBlockPos(bd_file->file, 0); + result->dir_length = bd_file->filesize; + UDFFreeFile(bd_file->file); + free(bd_file); + + return result; +} + +udf_dirent_t *udf25::ReadDir( udf_dir_t *dirp ) +{ + if (!UDFScanDirX(dirp)) { + dirp->current_p = 0; + dirp->dir_current = dirp->dir_location; // this is a rewind, wanted? + return NULL; + } + + return &dirp->entry; +} + +int udf25::CloseDir( udf_dir_t *dirp ) +{ + if (!dirp) return 0; + + free(dirp); + + CloseFile(NULL); + + return 0; +} diff --git a/xbmc/FileSystem/udf25.h b/xbmc/FileSystem/udf25.h new file mode 100644 index 00000000..7622c43e --- /dev/null +++ b/xbmc/FileSystem/udf25.h @@ -0,0 +1,199 @@ +#ifndef UDF25_H +#define UDF25_H + +#include "File.h" + +/** + * The length of one Logical Block of a DVD. + */ +#define DVD_VIDEO_LB_LEN 2048 + +/** + * Maximum length of filenames allowed in UDF. + */ +#define MAX_UDF_FILE_NAME_LEN 2048 + +struct Partition { + int valid; + char VolumeDesc[128]; + uint16_t Flags; + uint16_t Number; + char Contents[32]; + uint32_t AccessType; + uint32_t Start; + uint32_t Length; +}; + +struct AD { + uint32_t Location; + uint32_t Length; + uint8_t Flags; + uint16_t Partition; +}; + +/* Previously dvdread would assume files only had one AD chain, and since they + * are 1GB or less, this is most problably true. However, now we handle chains + * for large files. ECMA_167 does not specify the maximum number of chains, is + * it as many as can fit in a 2048 block (minus ID 266 size), or some other + * limit. For now, I have assumed that; + * a 4.4GB file uses 5 AD chains. A BluRay disk can store 50GB of data, so the + * largest file should be 50 GB. So the maximum number of chains should be + * around 62. + */ + +#define UDF_MAX_AD_CHAINS 50 + +struct FileAD { + uint64_t Length; + uint32_t num_AD; + uint32_t Partition_Start; + struct AD AD_chain[UDF_MAX_AD_CHAINS]; +}; + +struct extent_ad { + uint32_t location; + uint32_t length; +}; + +struct avdp_t { + struct extent_ad mvds; + struct extent_ad rvds; +}; + +struct pvd_t { + uint8_t VolumeIdentifier[32]; + uint8_t VolumeSetIdentifier[128]; +}; + +struct lbudf { + uint32_t lb; + uint8_t *data; + /* needed for proper freeing */ + uint8_t *data_base; +}; + +struct icbmap { + uint32_t lbn; + struct FileAD file; + uint8_t filetype; +}; + +struct udf_cache { + int avdp_valid; + struct avdp_t avdp; + int pvd_valid; + struct pvd_t pvd; + int partition_valid; + struct Partition partition; + int rooticb_valid; + struct AD rooticb; + int lb_num; + struct lbudf *lbs; + int map_num; + struct icbmap *maps; +}; + +typedef enum { + PartitionCache, RootICBCache, LBUDFCache, MapCache, AVDPCache, PVDCache +} UDFCacheType; + +/* + * DVDReaddir entry types. + */ +typedef enum { + DVD_DT_UNKNOWN = 0, + DVD_DT_FIFO, + DVD_DT_CHR, + DVD_DT_DIR, + DVD_DT_BLK, + DVD_DT_REG, + DVD_DT_LNK, + DVD_DT_SOCK, + DVD_DT_WHT +} udf_dir_type_t; + +/* + * DVDReaddir structure. + * Extended a little from POSIX to also return filesize. + */ +typedef struct { + unsigned char d_name[MAX_UDF_FILE_NAME_LEN]; + // "Shall not exceed 1023; Ecma-167 page 123" + udf_dir_type_t d_type; // DT_REG, DT_DIR + unsigned int d_namlen; + uint64_t d_filesize; +} udf_dirent_t; + + +/* + * DVDOpendir DIR* structure + */ +typedef struct { + uint32_t dir_location; + uint32_t dir_length; + uint32_t dir_current; // Separate to _location should we one day want to + // implement dir_rewind() + unsigned int current_p; // Internal implementation specific. UDFScanDirX + udf_dirent_t entry; +} udf_dir_t; + + + +typedef struct FileAD *UDF_FILE; + +typedef struct _BD_FILE +{ + UDF_FILE file; + uint64_t seek_pos; // in bytes + uint64_t filesize; // in bytes + +} *BD_FILE; + + +class udf25 +{ + +public: + udf25( ); + virtual ~udf25( ); + + DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod ); + int64_t GetFileSize(HANDLE hFile); + int64_t GetFilePosition(HANDLE hFile); + int64_t Seek(HANDLE hFile, int64_t lOffset, int whence); + HANDLE OpenFile( const char* filename ); + long ReadFile(HANDLE fd, unsigned char *pBuffer, long lSize); + void CloseFile(HANDLE hFile); + + udf_dir_t *OpenDir( const char *subdir ); + udf_dirent_t *ReadDir( udf_dir_t *dirp ); + int CloseDir( udf_dir_t *dirp ); + + void Reset(); + void Scan(); + bool IsScanned(); + +private: + UDF_FILE UDFFindFile( const char* filename, uint64_t *filesize ); + int UDFScanDirX( udf_dir_t *dirp ); + void UDFFreeFile(UDF_FILE file); + int DVDUDFCacheLevel(int level); + void* GetUDFCacheHandle(); + void SetUDFCacheHandle(void *cache); + int GetUDFCache(UDFCacheType type,uint32_t nr, void *data); + int UDFFindPartition( int partnum, struct Partition *part ); + int UDFGetAVDP( struct avdp_t *avdp); + int DVDReadLBUDF( uint32_t lb_number, size_t block_count, unsigned char *data, int encrypted ); + int UDFReadBlocksRaw( uint32_t lb_number, size_t block_count, unsigned char *data, int encrypted ); + int UDFMapICB( struct AD ICB, uint8_t *FileType, struct Partition *partition, struct FileAD *File ); + int UDFScanDir( struct FileAD Dir, char *FileName, struct Partition *partition, struct AD *FileICB, int cache_file_info); + int SetUDFCache(UDFCacheType type, uint32_t nr, void *data); +protected: + /* Filesystem cache */ + int m_udfcache_level; /* 0 - turned off, 1 - on */ + void *m_udfcache; + XFILE::CFile* m_fp; +}; + +extern class udf25 m_udfIsoReader; +#endif diff --git a/xbmc/GUIDialogBoxeeBrowseLocalSubtitleSettings.cpp b/xbmc/GUIDialogBoxeeBrowseLocalSubtitleSettings.cpp new file mode 100644 index 00000000..3c23aac5 --- /dev/null +++ b/xbmc/GUIDialogBoxeeBrowseLocalSubtitleSettings.cpp @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "system.h" +#include "GUIDialogBoxeeBrowseLocalSubtitleSettings.h" +#include "GUIDialogBoxeeBrowseSubtitleSettings.h" +#include "GUIDialogFileBrowser.h" +#include "GUIPassword.h" +#include "Util.h" +#include "Application.h" +#include "VideoDatabase.h" +#include "XBAudioConfig.h" +#include "GUIDialogYesNo.h" +#include "GUIDialogSelect.h" +#include "GUIWindowManager.h" +#include "GUILabelControl.h" +#include "FileSystem/Directory.h" +#include "FileSystem/File.h" +#include "URL.h" +#include "FileItem.h" +#include "SkinInfo.h" +#include "Settings.h" +#include "AdvancedSettings.h" +#include "GUISettings.h" +#include "LocalizeStrings.h" +#include "LangCodeExpander.h" + +using namespace std; +using namespace XFILE; +using namespace DIRECTORY; + +#define SOURCES_CONTROL_LIST 450 +#define CURRENT_LOCATION_LABEL 412 + +CGUIDialogBoxeeBrowseLocalSubtitleSettings::CGUIDialogBoxeeBrowseLocalSubtitleSettings(void) + : CGUIDialogFileBrowser(WINDOW_DIALOG_BOXEE_BROWSE_LOCAL_SUBTITLES_SETTINGS, "boxee_osd_browse_local_subtitles_settings.xml") +{ +} + +CGUIDialogBoxeeBrowseLocalSubtitleSettings::~CGUIDialogBoxeeBrowseLocalSubtitleSettings(void) +{ +} + +bool CGUIDialogBoxeeBrowseLocalSubtitleSettings::ShowAndGetFile(const VECSOURCES &shares, const CStdString &mask, const CStdString &heading, CStdString &path, bool useThumbs /* = false */, bool useFileDirectories /* = false */, bool allowNonLocalSources /* = true */) +{ + CGUIDialogBoxeeBrowseLocalSubtitleSettings *browser = new CGUIDialogBoxeeBrowseLocalSubtitleSettings(); + if (!browser) + return false; + g_windowManager.AddUniqueInstance(browser); + + browser->m_useFileDirectories = useFileDirectories; + + browser->m_browsingForImages = useThumbs; + browser->SetHeading(heading); + browser->SetSources(shares); + CStdString strMask = mask; + if (mask == "/") + browser->m_browsingForFolders=1; + else + if (mask == "/w") + { + browser->m_browsingForFolders=2; + strMask = "/"; + } + else + browser->m_browsingForFolders = 0; + + browser->m_rootDir.SetMask(strMask); + browser->m_selectedPath = path; + browser->m_addNetworkShareEnabled = false; + browser->m_rootDir.AllowNonLocalSources(allowNonLocalSources); + browser->DoModal(); + bool confirmed(browser->IsConfirmed()); + if (confirmed) + path = browser->m_selectedPath; + g_windowManager.Remove(browser->GetID()); + delete browser; + return confirmed; +} + + +bool CGUIDialogBoxeeBrowseLocalSubtitleSettings::OnMessage(CGUIMessage& message) +{ + return CGUIDialogFileBrowser::OnMessage(message); +} + +bool CGUIDialogBoxeeBrowseLocalSubtitleSettings::OnAction(const CAction& action) +{ + if(action.id == ACTION_PREVIOUS_MENU || action.id == ACTION_PARENT_DIR) + { + CGUIDialogBoxeeBrowseSubtitleSettings* pDlg = (CGUIDialogBoxeeBrowseSubtitleSettings*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_BROWSE_SUBTITLES_SETTINGS); + if(pDlg) + { + Close(); + pDlg->DoModal(); + } + } + return CGUIDialogFileBrowser::OnAction(action); +} diff --git a/xbmc/GUIDialogBoxeeBrowseLocalSubtitleSettings.h b/xbmc/GUIDialogBoxeeBrowseLocalSubtitleSettings.h new file mode 100644 index 00000000..72ec303c --- /dev/null +++ b/xbmc/GUIDialogBoxeeBrowseLocalSubtitleSettings.h @@ -0,0 +1,39 @@ +#pragma once + +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "GUIDialogFileBrowser.h" +#include "FileItem.h" + +class CGUIDialogBoxeeBrowseLocalSubtitleSettings : +public CGUIDialogFileBrowser +{ +public: + CGUIDialogBoxeeBrowseLocalSubtitleSettings(void); + virtual ~CGUIDialogBoxeeBrowseLocalSubtitleSettings(void); + + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + static bool ShowAndGetFile(const VECSOURCES &shares, const CStdString &mask, const CStdString &heading, CStdString &path, bool useThumbs = false, bool useFileDirectories = false, bool allowNonLocalSources = true); +}; + diff --git a/xbmc/GUIDialogBoxeeBrowseMenu.cpp b/xbmc/GUIDialogBoxeeBrowseMenu.cpp new file mode 100644 index 00000000..73ba2fed --- /dev/null +++ b/xbmc/GUIDialogBoxeeBrowseMenu.cpp @@ -0,0 +1,488 @@ + +#include "GUIDialogBoxeeBrowseMenu.h" +#include "Application.h" +#include "GUIWindowManager.h" +#include "GUIWindowBoxeeBrowse.h" +#include "GUIDialogBoxeeMediaAction.h" +#include "utils/log.h" +#include "GUIDialogBoxeeShortcutAction.h" +#include "GUIDialogYesNo2.h" +#include "BoxeeShortcut.h" +#include "GUIDialogBoxeeGlobalSearch.h" +#include "ButtonTranslator.h" +#include "LocalizeStrings.h" +#include "guilib/GUIButtonControl.h" +#include "guilib/GUIToggleButtonControl.h" +#include "guilib/GUIControlGroupList.h" +#include "guilib/GUIEditControl.h" +#include "GUIFontManager.h" +#include "SkinInfo.h" +#include "FileSystem/SpecialProtocol.h" +#include "GUIControlFactory.h" +#include "BoxeeUtils.h" +#include "URL.h" +#include "Builtins.h" +#include "FileSystem/BoxeeDatabaseDirectory.h" +#include "FileSystem/Directory.h" +#include "FileSystem/DirectoryCache.h" +#include "GUIDialogButtonMenu.h" +#include "GUIDialogBoxeeSearch.h" +#include "GUIUserMessages.h" +#include "BoxeeVersionUpdateManager.h" +#include "GUILabelControl.h" +#include "utils/GUIInfoManager.h" +#include "GUIWindowBoxeeMain.h" +#include "GUIWindowBoxeeBrowseQueue.h" +#include "GUIWindowBoxeeBrowseDiscover.h" + +#ifdef _WIN32 +#include "GUISettings.h" +#endif + +using namespace BOXEE; + +// Static buttons for the top level of the browse menu +#define MENU_BUTTONS_LIST 1823 + +#define BROWSE_MENU_BUTTON_LIVETV 1831 +#define BROWSE_MENU_BUTTON_FRIENDS 1832 +#define BROWSE_MENU_BUTTON_WATCH_LATER 1833 +#define BROWSE_MENU_BUTTON_TV 1834 +#define BROWSE_MENU_BUTTON_MOVIES 1835 +#define BROWSE_MENU_BUTTON_FILES 1836 +#define BROWSE_MENU_BUTTON_APPS 1837 +#define BROWSE_MENU_BUTTON_WEB 1838 + +#define BTN_LOGOUT 121 +#define BTN_SETTINGS 122 +#define BTN_NOW_PLAYING 102 +#define BTN_DVB 1831 +#define BTN_HOME 120 +#define BTN_HISTORY 123 +#define BTN_PLAYBACK 125 + +#define DOWNLOADING_LABEL 7111 + +CGUIDialogBoxeeBrowseMenu::CGUIDialogBoxeeBrowseMenu(void) : CGUIDialog(WINDOW_DIALOG_BOXEE_BROWSE_MENU, "boxee_browse_menu.xml") +{ + m_bInitialized = false; + + ResetCurrentParameters(); + + ResetAction(); +} + +CGUIDialogBoxeeBrowseMenu::~CGUIDialogBoxeeBrowseMenu() +{ +} + +void CGUIDialogBoxeeBrowseMenu::OnInitWindow() +{ + if (!CanOpenBrowseMenu()) + { + Close(true); + return; + } + + CGUIDialog::OnInitWindow(); + + m_downloadCounter = 0; + + //CLog::Log(LOGDEBUG, "CGUIDialogBoxeeBrowseMenu::OnInitWindow - [CurrentRow=%d][CurrentButton=%d][StartActionId=%d] (browsemenu)", m_iCurrentRowIndex, m_iCurrentButtonId,m_startAction.id); + +// if (!g_application.IsPlaying() && m_iCurrentButtonId == 102) +// { +// m_iCurrentButtonId = BROWSE_MENU_BUTTON_HOME; +// CGUIMessage msg(GUI_MSG_SETFOCUS, GetID(), m_iCurrentButtonId); +// OnMessage(msg); +// m_iCurrentRowIndex = 0; +// SetSelectedButtonInRow(0); +// } + + if (m_openInSearch) + { + CGUIMessage msg(GUI_MSG_SETFOCUS, GetID(), BROWSE_MENU_BUTTON_SEARCH); + OnMessage(msg); + + m_iCurrentButtonId = BROWSE_MENU_BUTTON_SEARCH; + return; + } + + if (m_startAction.id != 0) + { + CGUIMessage msg(GUI_MSG_SETFOCUS, GetID(), BROWSE_MENU_BUTTON_SEARCH); + OnMessage(msg); + + m_iCurrentButtonId = BROWSE_MENU_BUTTON_SEARCH; + + CGUIEditControl* pSearchControl = (CGUIEditControl*)GetControl(BROWSE_MENU_BUTTON_SEARCH); + if (pSearchControl) + { + pSearchControl->OnAction(m_startAction); + } + + ResetAction(); + } + + int iCurrentWindow = g_windowManager.GetActiveWindow(); + bool setFocusOnButton = false; + if ((m_iCurrentWindowId != iCurrentWindow) || (!g_application.IsPlaying() && m_iCurrentButtonId == BTN_NOW_PLAYING)) + { + m_iCurrentWindowId = iCurrentWindow; + setFocusOnButton = true; + switch(iCurrentWindow) + { + case WINDOW_BOXEE_BROWSE_MOVIES: + { + m_iCurrentButtonId = BROWSE_MENU_BUTTON_MOVIES; + } + break; + case WINDOW_BOXEE_BROWSE_TVSHOWS: + { + m_iCurrentButtonId = BROWSE_MENU_BUTTON_TV; + } + break; + case WINDOW_BOXEE_BROWSE_APPS: + { + m_iCurrentButtonId = BROWSE_MENU_BUTTON_APPS; + } + break; + case WINDOW_BOXEE_BROWSE_LOCAL: + case WINDOW_BOXEE_BROWSE_ALBUMS: + case WINDOW_BOXEE_BROWSE_PHOTOS: + case WINDOW_BOXEE_BROWSE_TRACKS: + { + m_iCurrentButtonId = BROWSE_MENU_BUTTON_FILES; + } + break; + case WINDOW_BOXEE_BROWSE_DISCOVER: + { + m_iCurrentButtonId = BROWSE_MENU_BUTTON_FRIENDS; + } + break; + case WINDOW_BOXEE_BROWSE_QUEUE: + { + m_iCurrentButtonId = BROWSE_MENU_BUTTON_WATCH_LATER; + } + break; + case WINDOW_BOXEE_LIVETV: + { + m_iCurrentButtonId = BROWSE_MENU_BUTTON_LIVETV; + } + break; + default: + { + setFocusOnButton = false; + } + break; + } + + if (setFocusOnButton) + { + CGUIMessage msg(GUI_MSG_SETFOCUS, GetID(), MENU_BUTTONS_LIST,m_iCurrentButtonId); + OnMessage(msg); + } + } + +} + +bool CGUIDialogBoxeeBrowseMenu::OnAction(const CAction &action) +{ + switch (action.id) + { + case ACTION_PARENT_DIR: + case ACTION_PREVIOUS_MENU: + { + Close(); + return true; + } + break; + case ACTION_MOUSE: + case ACTION_MOVE_LEFT: + case ACTION_MOVE_RIGHT: + case ACTION_MOVE_UP: + case ACTION_MOVE_DOWN: + { + // Call parent to perform the actual action + bool bResult = CGUIDialog::OnAction(action); + + return bResult; + } + break; + default: + { + // do nothing + } + break; + } + + // Pass along all key presses to the edit control + if (action.id >= KEY_ASCII) + { + CGUIMessage msg(GUI_MSG_SETFOCUS, GetID(), BROWSE_MENU_BUTTON_SEARCH); + OnMessage(msg); + + m_iCurrentButtonId = BROWSE_MENU_BUTTON_SEARCH; + + CGUIEditControl* pSearchControl = (CGUIEditControl*)GetControl(BROWSE_MENU_BUTTON_SEARCH); + if (pSearchControl) + { + pSearchControl->OnAction(action); + } + + return true; + } + + return CGUIDialog::OnAction(action); +} + +void CGUIDialogBoxeeBrowseMenu::Render() +{ +#ifdef HAS_EMBEDDED + + if (m_downloadCounter % 60 == 0) + { + m_downloadCounter = 0; + + if (g_boxeeVersionUpdateManager.GetBoxeeVerUpdateJob().GetVersionUpdateDownloadStatus() == VUDS_DOWNLOADING) + { + CDownloadInfo downloadnfo; + g_boxeeVersionUpdateManager.GetDownloadInfo(downloadnfo); + + double percent = downloadnfo.m_CurrentDownloadProgress; + + CGUILabelControl* pControl = (CGUILabelControl*) GetControl(DOWNLOADING_LABEL); + if (pControl) + { + CStdString percentStr = "%d%%"; + CStdString percentLabel; + percentLabel.Format(percentStr.c_str(),(int)percent); + pControl->SetLabel(percentLabel); + } + } + } + m_downloadCounter++; +#endif + + CGUIDialog::Render(); +} + +void CGUIDialogBoxeeBrowseMenu::OnClick(int iClickedButton) +{ + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeBrowseMenu::OnClick - Enter function with [ClickedButton=%d] (browsemenu)",iClickedButton); + + switch(iClickedButton) + { + case BTN_LOGOUT: + { + CGUIDialogButtonMenu* pDialog = (CGUIDialogButtonMenu*)g_windowManager.GetWindow(WINDOW_DIALOG_BUTTON_MENU); + if (pDialog) + { + pDialog->DoModal(); + + if (!pDialog->IsCanceled()) + { + ResetCurrentParameters(); + m_iCurrentWindowId = WINDOW_LOGIN_SCREEN; + } + } + + return; + } + break; + case BTN_SETTINGS: + { + ActivateWindow(WINDOW_SETTINGS_MENU); + ResetCurrentParameters(); + return; + } + break; + case BTN_NOW_PLAYING: + { + return; + } + break; + case BROWSE_MENU_BUTTON_WEB: + { + BoxeeUtils::LaunchBrowser(); + } + break; + case BROWSE_MENU_BUTTON_FRIENDS: + { + m_iCurrentWindowId = WINDOW_BOXEE_BROWSE_DISCOVER; + CGUIWindowBoxeeBrowseDiscover::LaunchFriends(); + } + break; + case BROWSE_MENU_BUTTON_WATCH_LATER: + { + m_iCurrentWindowId = WINDOW_BOXEE_BROWSE_QUEUE; + CGUIWindowBoxeeBrowseQueue::LaunchWatchLater(); + } + break; + case BROWSE_MENU_BUTTON_TV: + { + m_iCurrentWindowId = WINDOW_BOXEE_BROWSE_TVSHOWS; + } + break; + + case BROWSE_MENU_BUTTON_MOVIES: + { + m_iCurrentWindowId = WINDOW_BOXEE_BROWSE_MOVIES; + } + break; + case BROWSE_MENU_BUTTON_FILES: + { + m_iCurrentWindowId = WINDOW_BOXEE_BROWSE_LOCAL; + g_windowManager.ActivateWindow(m_iCurrentWindowId,BoxeeUtils::GetFilesButtonPathToExecute()); + } + break; + case BROWSE_MENU_BUTTON_APPS: + { + m_iCurrentWindowId = WINDOW_BOXEE_BROWSE_APPS; + } + break; + case BTN_HOME: + { + m_iCurrentWindowId = WINDOW_HOME; + } + break; +#ifdef HAS_DVB + case BTN_DVB: + { + if (CGUIWindowBoxeeMain::RunOnBoardingWizardIfNeeded(false)) + { + m_iCurrentWindowId = WINDOW_BOXEE_LIVETV; + g_windowManager.ActivateWindow(WINDOW_BOXEE_LIVETV); + } + else + { + CLog::Log(LOGERROR, "CGUIWindowBoxeeMain::OnMessage - GUI_MSG_CLICKED - BTN_DVB - RunOnBoardingWizard FAILED"); + } + } + break; +#endif + default: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeBrowseMenu::OnClick - No case for [ClickedButton=%d] -> continue (browsemenu)",iClickedButton); + } + break; + } +} + +bool CGUIDialogBoxeeBrowseMenu::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_WINDOW_INIT: + { + CStdString param = message.GetStringParam(0); + m_openInSearch = (param == "openinsearch"); + } + break; + case GUI_MSG_LABEL2_SET: + { + CGUIDialogBoxeeSearch *pSearchDialog = (CGUIDialogBoxeeSearch*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_SEARCH); + if (pSearchDialog && pSearchDialog->ClosedByMovingRightFromTextBox()) + { + CAction action; + action.id = ACTION_MOVE_RIGHT; + OnAction(action); + } + } + break; + case GUI_MSG_CLICKED: + { + int iControl = message.GetSenderId(); + + if (iControl == BROWSE_MENU_BUTTON_SEARCH) + { + // Get the keystroke that was pressed + bool bResult = CGUIDialog::OnMessage(message); + + SET_CONTROL_FOCUS(BROWSE_MENU_BUTTON_SEARCH,0); + + CGUIEditControl* pSearchControl = (CGUIEditControl*)GetControl(BROWSE_MENU_BUTTON_SEARCH); + if (pSearchControl) + { + CStdString strSearchTerm = pSearchControl->GetLabel2(); + //pSearchControl->SetLabel2(""); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeBrowseMenu::OnMessage - [term=%s] (search)", strSearchTerm.c_str()); + + ThreadMessage tMsg(TMSG_GUI_ACTIVATE_WINDOW , WINDOW_DIALOG_BOXEE_SEARCH , false); + std::vector params; + params.push_back(strSearchTerm); + tMsg.params = params; + g_application.getApplicationMessenger().SendMessage(tMsg,false); + } + + return bResult; + } + + OnClick(iControl); + } + break; + } + + return CGUIDialog::OnMessage(message); +} + +CStdString CGUIDialogBoxeeBrowseMenu::GetSearchTerm() +{ + CGUIEditControl* pSearchControl = (CGUIEditControl*)GetControl(BROWSE_MENU_BUTTON_SEARCH); + return pSearchControl->GetLabel2(); +} + +void CGUIDialogBoxeeBrowseMenu::ActivateWindow(unsigned int windowId, const CStdString& path, bool closeDialog) +{ + if (closeDialog) + { + g_windowManager.CloseDialogs(true); + } + + m_iCurrentWindowId = windowId; + g_windowManager.ActivateWindow(windowId,path); +} + +void CGUIDialogBoxeeBrowseMenu::ResetCurrentParameters() +{ + m_iCurrentButtonId = BROWSE_MENU_BUTTON_TV; +} + +void CGUIDialogBoxeeBrowseMenu::ResetAction() +{ + m_startAction.id = 0; +} + +void CGUIDialogBoxeeBrowseMenu::SetAction(const CAction &action) +{ + m_startAction = action; +} + +void CGUIDialogBoxeeBrowseMenu::OpenSearchWithAction(const CAction &action) +{ + CGUIDialogBoxeeBrowseMenu *pWindow = (CGUIDialogBoxeeBrowseMenu*) g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_BROWSE_MENU); + if (pWindow) + { + pWindow->SetAction(action); + pWindow->DoModal(); + } +} + +void CGUIDialogBoxeeBrowseMenu::Close(bool forceClose) +{ + return CGUIDialog::Close(forceClose); +} + +bool CGUIDialogBoxeeBrowseMenu::CanOpenBrowseMenu() +{ + int activeWindow = g_windowManager.GetActiveWindow(); + + if ((activeWindow == WINDOW_FULLSCREEN_VIDEO)/*during video*/ || (activeWindow == WINDOW_VISUALISATION)/*during music*/ || (activeWindow >= 10436 && activeWindow <= 10449)/*during FTU*/) + { + CLog::Log(LOGERROR, "CGUIDialogBoxeeBrowseMenu::CanOpenBrowseMenu - return FALSE since [activeWindow=%d] (browsemenu)",activeWindow); + return false; + } + + return true; +} diff --git a/xbmc/GUIDialogBoxeeBrowseMenu.h b/xbmc/GUIDialogBoxeeBrowseMenu.h new file mode 100644 index 00000000..55792bd8 --- /dev/null +++ b/xbmc/GUIDialogBoxeeBrowseMenu.h @@ -0,0 +1,75 @@ +#ifndef GUIDIALOGBOXEEBROWSEMENU_H_ +#define GUIDIALOGBOXEEBROWSEMENU_H_ + +#include "GUILoaderDialog.h" +#include "FileItem.h" +#include "lib/libBoxee/bxgenresmanager.h" +#include "lib/libBoxee/bxsourcesmanager.h" +#include "WatchDog.h" +#include "utils/SingleLock.h" +#include "lib/libBoxee/bxtrailersmanager.h" +#include "lib/libBoxee/bxappboxmanager.h" + +class CGUIButtonControl; + +#define BROWSE_MENU_BUTTON_SEARCH 11011 + +class CGUIDialogBoxeeBrowseMenu : public CGUIDialog +{ +public: + CGUIDialogBoxeeBrowseMenu(void); + virtual ~CGUIDialogBoxeeBrowseMenu(); + + virtual bool OnMessage(CGUIMessage &message); + bool OnAction(const CAction &action); + + virtual void Render(); + + virtual void Close(bool forceClose = false); + + static void OpenSearchWithAction(const CAction &action); + + void ReloadControl (CStdString strControlId); + + CStdString GetSearchTerm(); + +protected: + + virtual void OnInitWindow(); + + void UpdateMenu(bool bRebuild); + + void OnClick(int iClickedButton); + +private: + + bool ReloadDynamicRows(); + bool AdjustButtonsAndSearchBar(); + + void ActivateWindow(unsigned int windowId, const CStdString& path = "", bool closeDialog = true); + + void ResetCurrentParameters(); + + bool CanOpenBrowseMenu(); + + void ResetAction(); + void SetAction(const CAction &action); + + CAction m_startAction; + + static int s_buttonId; + bool m_bInitialized; + unsigned int m_downloadCounter; + + // The following members are used to track the current state of the menu + + // Index of the currently selected row + int m_iCurrentButtonId; + int m_iCurrentWindowId; + + CCriticalSection m_initCriticalSection; + + bool m_openInSearch; +}; + +#endif diff --git a/xbmc/GUIDialogBoxeeBrowseSubtitleSettings.cpp b/xbmc/GUIDialogBoxeeBrowseSubtitleSettings.cpp new file mode 100644 index 00000000..2d012aa8 --- /dev/null +++ b/xbmc/GUIDialogBoxeeBrowseSubtitleSettings.cpp @@ -0,0 +1,238 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "system.h" +#include "GUIDialogBoxeeBrowseSubtitleSettings.h" +#include "GUIDialogAudioSubtitleSettings.h" +#include "GUIDialogBoxeeBrowseLocalSubtitleSettings.h" +#include "GUIDialogFileBrowser.h" +#include "GUIPassword.h" +#include "Util.h" +#include "Application.h" +#include "VideoDatabase.h" +#include "XBAudioConfig.h" +#include "GUIDialogYesNo.h" +#include "GUIDialogSelect.h" +#include "GUIWindowManager.h" +#include "GUILabelControl.h" +#include "FileSystem/Directory.h" +#include "FileSystem/File.h" +#include "URL.h" +#include "FileItem.h" +#include "SkinInfo.h" +#include "Settings.h" +#include "AdvancedSettings.h" +#include "GUISettings.h" +#include "LocalizeStrings.h" +#include "LangCodeExpander.h" +#include "ItemLoader.h" + +using namespace std; +using namespace XFILE; +using namespace DIRECTORY; + +CGUIDialogBoxeeBrowseSubtitleSettings::CGUIDialogBoxeeBrowseSubtitleSettings(void) + : CGUIDialog(WINDOW_DIALOG_BOXEE_BROWSE_SUBTITLES_SETTINGS, "boxee_browse_subtitles_settings.xml") +{ +} + +CGUIDialogBoxeeBrowseSubtitleSettings::~CGUIDialogBoxeeBrowseSubtitleSettings(void) +{ +} + +#define BROWSE_LOCAL_BUTTON 51 +#define BROWSE_ONLINE_BUTTON 52 +#define BROWSE_ONLINE_LIST 5000 + +void CGUIDialogBoxeeBrowseSubtitleSettings::OnInitWindow() +{ + CFileItem item = g_application.CurrentFileItem(); + + if ((item.IsHD() || item.IsSmb()) && !item.m_bIsFolder && !item.m_bIsShareOrDrive && + !item.m_strPath.IsEmpty() && !item.GetPropertyBOOL("MetaDataExtracted") && + g_application.IsPathAvailable(item.m_strPath), false) + { + g_application.GetItemLoader().LoadFileMetadata(GetID(), BROWSE_ONLINE_LIST, &item); + } + else + { + CFileItemPtr pItem (new CFileItem(item)); + CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), BROWSE_ONLINE_LIST, 0); + OnMessage(msg); + CGUIMessage winmsg(GUI_MSG_LABEL_ADD, GetID(), BROWSE_ONLINE_LIST, 0, 0, pItem); + OnMessage(winmsg); + } + CGUIDialog::OnInitWindow(); +} + +bool CGUIDialogBoxeeBrowseSubtitleSettings::OnMessage(CGUIMessage& message) +{ + return CGUIDialog::OnMessage(message); +} + +bool CGUIDialogBoxeeBrowseSubtitleSettings::OnAction(const CAction& action) +{ + int iControl = GetFocusedControlID(); + + if (action.id == ACTION_SELECT_ITEM) + { + if(iControl == BROWSE_LOCAL_BUTTON) + { + Close(); + OnBrowseLocal(); + return true; + } + } + if(action.id == ACTION_PREVIOUS_MENU || action.id == ACTION_PARENT_DIR) + { + CGUIDialogAudioSubtitleSettings* pDlg = (CGUIDialogAudioSubtitleSettings*)g_windowManager.GetWindow(WINDOW_DIALOG_AUDIO_OSD_SETTINGS); + if(pDlg) + { + Close(); + pDlg->DoModal(); + } + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeeBrowseSubtitleSettings::OnBrowseLocal() +{ + CStdString strPath;// = "sources://all/"; + + if (CUtil::IsInRAR(g_application.CurrentFileItem().m_strPath) || CUtil::IsInZIP(g_application.CurrentFileItem().m_strPath)) + { + CURI url(g_application.CurrentFileItem().m_strPath); + strPath = url.GetHostName(); + } + else + { + strPath = g_application.CurrentFileItem().m_strPath; + } + + CStdString strMask = ".utf|.utf8|.utf-8|.sub|.srt|.smi|.rt|.txt|.ssa|.aqt|.jss|.ass|.idx|.rar|.zip"; + if (g_application.GetCurrentPlayer() == EPC_DVDPLAYER) + strMask = ".srt|.rar|.zip|.ifo|.smi|.sub|.idx|.ass|.ssa|.txt"; + + VECSOURCES locations; + CFileItemList sourceList; + DIRECTORY::CDirectory::GetDirectory("sources://all/",sourceList); + + CFileItemPtr pNetworkItem(new CFileItem("Network")); + pNetworkItem->m_strPath = "network://protocols"; + sourceList.Add(pNetworkItem); + + for (int i = 0 ; i < sourceList.Size() ; i++) + { + CMediaSource share; + CURI url(sourceList[i]->m_strPath); + + share.strName = sourceList[i]->GetLabel(); + share.strPath = sourceList[i]->m_strPath; + +#ifdef HAS_EMBEDDED + if (share.strPath.IsEmpty() || share.strPath == "boxeedb://unresolvedVideoFiles") + { + continue; + } +#endif + + locations.push_back(share); + } + if (CGUIDialogBoxeeBrowseLocalSubtitleSettings::ShowAndGetFile(locations,strMask,g_localizeStrings.Get(293),strPath,false,true,false)) + { + int subtitleStream; + CStdString strExt; + CUtil::GetExtension(strPath,strExt); + if (strExt.CompareNoCase(".idx") == 0 || strExt.CompareNoCase(".sub") == 0) + { + // Playback could end and delete m_pPlayer while dialog is up so make sure it's valid + if (g_application.m_pPlayer) + { + if (CFile::Cache(strPath,"special://temp/subtitle"+strExt)) + { + CStdString strPath2; + CStdString strPath3; + if (strExt.CompareNoCase(".idx") == 0) + { + CUtil::ReplaceExtension(strPath,".sub",strPath2); + strPath3 = "special://temp/subtitle.sub"; + } + else + { + CUtil::ReplaceExtension(strPath,".idx",strPath2); + if (!CFile::Exists(strPath2) && (CUtil::IsInRAR(strPath2) || CUtil::IsInZIP(strPath2))) + { + CStdString strFileName = CUtil::GetFileName(strPath); + CUtil::GetDirectory(strPath,strPath3); + CUtil::GetParentPath(strPath3,strPath2); + CUtil::AddFileToFolder(strPath2,strFileName,strPath2); + CUtil::ReplaceExtension(strPath2,".idx",strPath2); + } + strPath3 = "special://temp/subtitle.idx"; + } + if (CFile::Exists(strPath2)) + CFile::Cache(strPath2,strPath3); + else + { + CFileItemList items; + CStdString strDir,strFileNameNoExtNoCase; + CUtil::Split(strPath,strDir,strPath3); + CUtil::ReplaceExtension(strPath3,".",strFileNameNoExtNoCase); + strFileNameNoExtNoCase.ToLower(); + CUtil::GetDirectory(strPath,strDir); + CDirectory::GetDirectory(strDir,items,".rar|.zip",false); + vector vecExts; + for (int i=0;im_strPath,strFileNameNoExtNoCase,""); + } + g_stSettings.m_currentVideoSettings.m_SubtitleOn = true; + + if(g_application.m_pPlayer->AddSubtitle("special://temp/subtitle.idx")) + { + subtitleStream = g_application.m_pPlayer->GetSubtitleCount() - 1; + g_application.m_pPlayer->SetSubtitle(subtitleStream); + g_application.m_pPlayer->SetSubtitleVisible(true); + } + + Close(); + } + } + } + else + { + subtitleStream = g_application.m_pPlayer->GetSubtitleCount(); + CStdString strExt; + CUtil::GetExtension(strPath,strExt); + if (CFile::Cache(strPath,"special://temp/subtitle.browsed"+strExt)) + { + g_stSettings.m_currentVideoSettings.m_SubtitleOn = true; + g_application.m_pPlayer->SetSubtitleVisible(true); + g_application.m_pPlayer->AddSubtitle("special://temp/subtitle.browsed"+strExt); + g_application.m_pPlayer->SetSubtitle(subtitleStream); + } + } + g_stSettings.m_currentVideoSettings.m_SubtitleCached = true; + return true; + } + + return false; +} diff --git a/xbmc/GUIDialogBoxeeBrowseSubtitleSettings.h b/xbmc/GUIDialogBoxeeBrowseSubtitleSettings.h new file mode 100644 index 00000000..f555ac17 --- /dev/null +++ b/xbmc/GUIDialogBoxeeBrowseSubtitleSettings.h @@ -0,0 +1,40 @@ +#pragma once + +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "GUIDialogSettings.h" + +class CGUIDialogBoxeeBrowseSubtitleSettings : +public CGUIDialog +{ +public: + CGUIDialogBoxeeBrowseSubtitleSettings(void); + virtual ~CGUIDialogBoxeeBrowseSubtitleSettings(void); + + virtual void OnInitWindow(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + bool OnBrowseLocal(); + +}; + diff --git a/xbmc/GUIDialogBoxeeBrowserCtx.cpp b/xbmc/GUIDialogBoxeeBrowserCtx.cpp new file mode 100644 index 00000000..afc2b063 --- /dev/null +++ b/xbmc/GUIDialogBoxeeBrowserCtx.cpp @@ -0,0 +1,737 @@ +/* +* All Rights Reserved, Boxee.tv +*/ + +#include "GUIDialogBoxeeBrowserCtx.h" +#include "GUIWindowBoxeeMediaInfo.h" +#include "BoxeeUtils.h" +#include "GUIWindowManager.h" +#include "Application.h" +#include "GUIUserMessages.h" +#include "MouseStat.h" +#include "GUIEditControl.h" +#include "GUIWindowPointer.h" +#include "GUIListContainer.h" +#include "FileItem.h" +#include "GUIPanelContainer.h" +#include "utils/log.h" +#include "GUIDialogYesNo.h" +#include "GUIDialogYesNo2.h" +#include "ItemLoader.h" +#include "lib/libBoxee/bxwebfavoritesmanager.h" +#include "lib/libBoxee/boxee.h" +#include "LocalizeStrings.h" +#include "GUIDialogOK.h" +#include "GUIDialogOK2.h" +#include "SpecialProtocol.h" + +#define NOTIFICATION_APPEARANCE_IN_SEC 5000 + +#define HIDDEN_ITEM_ID 5000 + +#define CONTROLS_LIST 9000 + +#define BTN_PAUSE_ID 9105 +#define BTN_STOP_ID 9104 + +#define ADDRESS_BAR_EDIT 9004 +#define ADDRESS_BAR_EDIT_FAVORITES 19004 +#define ADDRESS_BAR_EDIT_HISTORY 29004 + +#define LOCK_ICON 9009 +#define BTN_BACK_ID 9005 +#define BTN_FORWARD_ID 9006 + +#define BTN_VOLUME_DOWN 9119 +#define BTN_HISTORY 9203 +#define BTN_HISTORY_FAVORITES 19203 +#define BTN_RELOAD 9024 +#define BTN_ADD_FAVORITE 9025 +#define BTN_STOP 9026 +#define BTN_FAVORITE_ON 9027 +#define BTN_FAVORITES 9028 +#define BTN_FAVORITES_HISTORY 29028 +#define BTN_EXIT 9029 + +#define FAVORITES_INFO 9060 +#define REMOVE_FAVORITES_GROUP 8010 +#define BTN_REMOVE_FAVORITES 8011 +#define BTN_DONE 8012 +#define BTN_CLEAR_HISTORY 8013 +#define HOME_SCREEN 7500 +#define FAVORITES_LABEL 7501 +#define HISTORY_LABEL 7502 +#define TOP_OSD 7000 +#define PAGE_LOAD_FAILURE 7600 + +#define BTN_EXIT 9029 + +#define FAVORITES_CONTAINER 50 +#define HISTORY_CONTAINER 51 +#define FAVORITES_BG_CONTAINER 52 + +#define MAX_FAVORITES 12 + +#define CONTROL_VIEW_START 50 +#define CONTROL_VIEW_END 59 + +#define REMOVE_FAVORITES_MODE "remove-favorites" +#define IS_FAVORITE_PROPERTY "is-favorite" +#define HISTORY_EMPTY "history-empty" + +void WebFavoriteJob::Run() +{ + if (m_bWebFavorite) + { + m_bJobResult = BoxeeUtils::AddWebFavorite(m_url, m_urlTitle, true); + if (!m_bJobResult) + CGUIDialogOK2::ShowAndGetInput(257, 55195); + } + else + { + m_bJobResult = BoxeeUtils::RemoveWebFavorite(m_id); + if (!m_bJobResult) + CGUIDialogOK2::ShowAndGetInput(257, 55195); + } +} + +CGUIDialogBoxeeBrowserCtx::CGUIDialogBoxeeBrowserCtx() : CGUIDialogBoxeeCtx(WINDOW_DIALOG_BOXEE_BROWSER_CTX, "boxee_browser_context.xml") +{ + m_itemsFavorites = new CFileItemList(); + m_itemsHistory = new CFileItemList(); + m_bMouseEnabled = true; + m_bBrowserClosed = false; +} + +void CGUIDialogBoxeeBrowserCtx::Update() +{ + CGUIDialogBoxeeCtx::Update(); +} + +bool CGUIDialogBoxeeBrowserCtx::OnAction(const CAction &action) +{ + switch (action.id) + { + case ACTION_SELECT_ITEM: + { + if (BrowseToAddressBarUrl()) + { + return true; + } + } + break; + case ACTION_MOVE_DOWN: + { + CGUIControlGroup *c = (CGUIControlGroup *)GetControl(TOP_OSD); + if (!m_item.GetPropertyBOOL("load-failed") && c && c->IsVisible()) + { + Close(); + } + } + break; + case ACTION_PREVIOUS_MENU: + { + + CGUIControlGroup *c = (CGUIControlGroup*) GetControl(TOP_OSD); + if (c->IsVisible()) + { + bool cancelled = false; + if (CGUIDialogYesNo2::ShowAndGetInput(54897,55404,54775,55406,cancelled,0,1)) + { + g_application.StopPlaying(); + m_bBrowserClosed = true; + return true; + } + + if (m_item.GetPropertyBOOL("load-failed")) + { + return true; + } + + Close(); + } + else + { + CGUIControlGroup *ctrlHome = (CGUIControlGroup*) GetControl(HOME_SCREEN); + if (ctrlHome->IsVisible()) + { + SET_CONTROL_HIDDEN(HOME_SCREEN); + SET_CONTROL_VISIBLE(TOP_OSD); + SET_CONTROL_FOCUS(TOP_OSD, 0); + } + + return true; + } + } + break; + } + + return CGUIDialogBoxeeCtx::OnAction(action); +} + +bool CGUIDialogBoxeeBrowserCtx::OnMessage(CGUIMessage &message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_VISIBLE: + { + if (message.GetControlId() == TOP_OSD) + { + ManipulateAddressBar(m_item.m_strPath, true); + } + } + break; + case GUI_MSG_SETFOCUS: + { + if (message.GetControlId() == ADDRESS_BAR_EDIT) + { + CGUIEditControl *c = (CGUIEditControl *)GetControl(ADDRESS_BAR_EDIT); + if (c) + { + c->SetHighlighted(true); + } + } + } + break; + case GUI_MSG_CLICKED: + { + if (message.GetControlId() == WINDOW_DIALOG_BOXEE_BROWSER_CTX) + { + switch(message.GetSenderId()) + { + case ADDRESS_BAR_EDIT: + { + // place holder + } + break; + case BTN_EXIT: + { + g_application.StopPlaying(); + m_bBrowserClosed = true; + return true; + } + break; + case FAVORITES_CONTAINER: + { + CGUIListItemPtr ptrListItem = ((CGUIPanelContainer*) GetControl(FAVORITES_CONTAINER))->GetSelectedItemPtr(); + + if (g_windowManager.GetWindow(g_windowManager.GetActiveWindow())->GetPropertyBOOL(REMOVE_FAVORITES_MODE)) + { + OnRemoveWebFavorite(ptrListItem); + SetEmptyForFavorites(); + SetFavoriteProperty(); + } + else + { + OnGoToURL(ptrListItem); + } + } + break; + case HISTORY_CONTAINER: + { + CGUIListItemPtr ptrListItem = ((CGUIPanelContainer*) GetControl(HISTORY_CONTAINER))->GetSelectedItemPtr(); + OnGoToURL(ptrListItem); + } + break; + case BTN_FAVORITES: + case BTN_FAVORITES_HISTORY: + { + OnGoToFavorites(); + } + break; + case BTN_HISTORY: + case BTN_HISTORY_FAVORITES: + { + OnGoToHistory(); + } + break; + case BTN_REMOVE_FAVORITES: + { + g_windowManager.GetWindow(g_windowManager.GetActiveWindow())->SetProperty(REMOVE_FAVORITES_MODE, true); + SET_CONTROL_HIDDEN(BTN_REMOVE_FAVORITES); + SET_CONTROL_VISIBLE(BTN_DONE); + SET_CONTROL_FOCUS(FAVORITES_CONTAINER,0); + } + break; + case BTN_DONE: + { + g_windowManager.GetWindow(g_windowManager.GetActiveWindow())->SetProperty(REMOVE_FAVORITES_MODE, false); + SET_CONTROL_HIDDEN(BTN_DONE); + SET_CONTROL_VISIBLE(BTN_REMOVE_FAVORITES); + SET_CONTROL_FOCUS(BTN_REMOVE_FAVORITES,0); + } + break; + case BTN_ADD_FAVORITE: + { + OnAddWebFavorite(); + } + break; + case BTN_RELOAD: + { + CAction action; + action.id = ACTION_BROWSER_RELOAD; + + if (g_application.m_pPlayer) + { + g_application.m_pPlayer->OnAction(action); + Close(); + } + } + break; + case BTN_STOP: + { + CAction action; + action.id = ACTION_BROWSER_STOP_LOADING; + + if (g_application.m_pPlayer) + { + g_application.m_pPlayer->OnAction(action); + Close(); + } + } + break; + case BTN_CLEAR_HISTORY: + { + CGUIDialogYesNo* dlgYesNo = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO); + + if (dlgYesNo) + { + dlgYesNo->SetHeading(55403); + dlgYesNo->SetLine(0, 53415); + dlgYesNo->DoModal(); + + if (dlgYesNo->IsConfirmed()) + { + m_itemsHistory->Clear(); + g_application.GetBoxeeBrowseHistoryList().ClearAllHistory(); + + CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), HISTORY_CONTAINER, 1, 0, m_itemsHistory); + g_windowManager.SendMessage(msg); + SetEmptyForHistory(); + } + } + LoadHistory(); + } + } + } + } + break; + case GUI_MSG_WINDOW_DEINIT: + { + if (m_bBrowserClosed) + { + g_Mouse.SetEnabled(g_Mouse.IsEnabledInSettings()); + } + else + { + g_Mouse.SetEnabled(m_bMouseEnabled); + } + } + break; + } + return CGUIDialogBoxeeCtx::OnMessage(message); +} + +void CGUIDialogBoxeeBrowserCtx::Render() +{ + CGUIDialogBoxeeCtx::Render(); +} + +void CGUIDialogBoxeeBrowserCtx::OnInitWindow() +{ + m_bBrowserClosed = false; + CFileItemPtr pItem (new CFileItem(m_item)); + CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), HIDDEN_ITEM_ID, 0); + OnMessage(msg); + CGUIMessage winmsg(GUI_MSG_LABEL_ADD, GetID(), HIDDEN_ITEM_ID, 0, 0, pItem); + OnMessage(winmsg); + + m_bMouseEnabled = g_Mouse.IsEnabled(); + + CGUIDialogBoxeeCtx::OnInitWindow(); + + g_Mouse.SetEnabled(false); + g_Mouse.SetActive(false); + SetProperty("PassthroughKeys", true); + m_autoClosing = false; + + CGUIMessage msgreset(GUI_MSG_LABEL_RESET, GetID(), CONTROLS_LIST, 0); + OnMessage(msgreset); + + if (g_application.m_pPlayer && g_application.CurrentFileItem().GetPropertyBOOL("browsercansetfullscreen")) + { + SET_CONTROL_VISIBLE(CONTROLS_LIST); + SET_CONTROL_FOCUS(CONTROLS_LIST, 0); + } + else + { + SET_CONTROL_VISIBLE(ADDRESS_BAR_EDIT); + SET_CONTROL_FOCUS(ADDRESS_BAR_EDIT, 0); + } + + LoadFavorites(); + + SET_CONTROL_HIDDEN(HOME_SCREEN); + SET_CONTROL_VISIBLE(TOP_OSD); + + SET_CONTROL_VISIBLE(FAVORITES_CONTAINER); + SET_CONTROL_HIDDEN(HISTORY_CONTAINER); + + SET_CONTROL_HIDDEN(HISTORY_LABEL); + SET_CONTROL_VISIBLE(FAVORITES_LABEL); + + SetFavoriteProperty(); + + if (pItem->GetPropertyBOOL("launch-as-app")) + { + // launch as app -> open in favorites screen + OnGoToFavorites(); + } +} + +bool CGUIDialogBoxeeBrowserCtx::BrowseToAddressBarUrl() +{ + int focusedControlId = GetFocusedControlID(); + CStdString url; + + CGUIEditControl* c = NULL; + + switch (focusedControlId) + { + case ADDRESS_BAR_EDIT: + { + c = (CGUIEditControl*)GetControl(ADDRESS_BAR_EDIT); + } + break; + case ADDRESS_BAR_EDIT_FAVORITES: + { + c = (CGUIEditControl*)GetControl(ADDRESS_BAR_EDIT_FAVORITES); + } + break; + case ADDRESS_BAR_EDIT_HISTORY: + { + c = (CGUIEditControl*)GetControl(ADDRESS_BAR_EDIT_HISTORY); + } + break; + default: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeBrowserCtx::BrowseToAddressBarUrl - focused control ISN'T editbox -> return FALSE. [%d]\n",focusedControlId); + return false; + } + } + + if (!c) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeBrowserCtx::BrowseToAddressBarUrl - FAILED to get EditControl -> return FALSE."); + return false; + } + + url = c->GetLabel2(); + + if (url.IsEmpty()) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeBrowserCtx::BrowseToAddressBarUrl - url is EMPTY [%s] -> return FALSE.",url.c_str()); + return false; + } + + CGUIListItemPtr pItem(new CFileItem(url,false)); + OnGoToURL(pItem); + + return true; +} + +void CGUIDialogBoxeeBrowserCtx::LoadFavorites() +{ + m_itemsFavorites->Clear(); + + std::vector webFavoritesVec; + + BOXEE::Boxee::GetInstance().GetBoxeeClientServerComManager().GetWebFavorites(webFavoritesVec); + + std::vector::iterator it; + + for( it = webFavoritesVec.begin(); it != webFavoritesVec.end(); it++ ) + { + CStdString url = it->GetValue(MSG_KEY_URL); + CStdString urlTitle = it->GetValue(MSG_KEY_TITLE); + CUtil::UrlDecode(url); + CUtil::UrlDecode(urlTitle); + + CFileItemPtr pItem(new CFileItem(urlTitle)); + pItem->SetLabel2(url); + pItem->m_strPath = url; + pItem->SetProperty(MSG_KEY_BOOKMARK_INDEX, it->GetValue(MSG_KEY_BOOKMARK_INDEX)); + pItem->SetThumbnailImage(pItem->GetCachedVideoThumb().c_str()); + + m_itemsFavorites->Add(pItem); + } + + CGUIMessage msg2(GUI_MSG_LABEL_BIND, GetID(), FAVORITES_CONTAINER, 1, 0, m_itemsFavorites); + g_windowManager.SendMessage(msg2); + +} + +void CGUIDialogBoxeeBrowserCtx::LoadHistory() +{ + m_itemsHistory->Clear(); + g_application.GetBoxeeBrowseHistoryList().GetFilesHistory(*m_itemsHistory); + CGUIMessage msg3(GUI_MSG_LABEL_BIND, GetID(), HISTORY_CONTAINER, 1, 0, m_itemsHistory); + g_windowManager.SendMessage(msg3); +} + +void CGUIDialogBoxeeBrowserCtx::OnAddWebFavorite() +{ + std::vector webFavoritesVec; + + BOXEE::Boxee::GetInstance().GetBoxeeClientServerComManager().GetWebFavorites(webFavoritesVec); + + if (m_itemsFavorites->Size() < MAX_FAVORITES) + { + CStdString urlTitle = m_item.GetLabel(); + CStdString url = m_item.m_strPath; + + CAction action; + action.id = ACTION_BROWSER_THUMBNAIL_GENERATE; + action.amount1 = 320; + action.amount2 = 180; + action.strAction = _P(m_item.GetCachedVideoThumb().c_str()).c_str(); + + if (g_application.m_pPlayer) + g_application.m_pPlayer->OnAction(action); + + CUtil::URLEncode(urlTitle); + CUtil::URLEncode(url); + + CFileItemPtr pItem(new CFileItem(urlTitle)); + pItem->m_strPath = url; + pItem->SetThumbnailImage(m_item.GetCachedVideoThumb().c_str()); + + WebFavoriteJob* job = new WebFavoriteJob(url, urlTitle, true); + + CUtil::RunInBG(job); + m_itemsFavorites->Add(pItem); + CGUIMessage msg2(GUI_MSG_LABEL_BIND, GetID(), FAVORITES_CONTAINER, 1, 0, m_itemsFavorites); + g_windowManager.SendMessage(msg2); + } + else + { + CStdString titleStr = g_localizeStrings.Get(55408); + CStdString textStr = g_localizeStrings.Get(55409) + "[CR]" + g_localizeStrings.Get(55410); + CGUIDialogOK2::ShowAndGetInput(titleStr, textStr); + } + + LoadFavorites(); + + SetFavoriteProperty(); + + SET_CONTROL_VISIBLE(BTN_FAVORITE_ON); + SET_CONTROL_FOCUS(BTN_FAVORITE_ON,0); +} + +void CGUIDialogBoxeeBrowserCtx::SetFavoriteProperty() +{ + if (m_itemsFavorites->Contains(m_item.m_strPath)) + { + SetProperty(IS_FAVORITE_PROPERTY, true); + } + else + { + SetProperty(IS_FAVORITE_PROPERTY, false); + } +} + +void CGUIDialogBoxeeBrowserCtx::OnRemoveWebFavorite(CGUIListItemPtr ptrListItem) +{ + CGUIDialogYesNo2* dlgYesNo = (CGUIDialogYesNo2*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO); + + if (dlgYesNo) + { + unsigned long bookmarkIndex; + CFileItem* selectedFileItem; + + if (ptrListItem->IsFileItem()) + { + selectedFileItem = (CFileItem*) ptrListItem.get(); + bookmarkIndex = selectedFileItem->GetPropertyULong(MSG_KEY_BOOKMARK_INDEX); + } + else + { + CGUIDialogOK::ShowAndGetInput(257,55411,20022,20022); + return; + } + + CStdString urlTitle = selectedFileItem->GetLabel(); + CStdString url = selectedFileItem->m_strPath; + + CStdString strHeading = g_localizeStrings.Get(55403); + CStdString strText = g_localizeStrings.Get(55407) + "[CR]" + urlTitle + "?"; + + if (dlgYesNo->ShowAndGetInput(strHeading, strText)) + { + WebFavoriteJob* job = new WebFavoriteJob(url, urlTitle, false, bookmarkIndex); + CUtil::RunInBG(job); + + BOXEE::Boxee::GetInstance().GetBoxeeClientServerComManager().UpdateWebFavoritesListNow(); + + m_itemsFavorites->Remove(selectedFileItem); + CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), FAVORITES_CONTAINER, 1, 0, m_itemsFavorites); + g_windowManager.SendMessage(msg); + } + } + else + return; +} + +void CGUIDialogBoxeeBrowserCtx::OnMoreInfo() +{ + g_windowManager.CloseDialogs(true); + CGUIWindowBoxeeMediaInfo::Show(&m_item); +} + +void CGUIDialogBoxeeBrowserCtx::OnGoToURL(CGUIListItemPtr ptrListItem) +{ + CAction action; + action.id = ACTION_BROWSER_NAVIGATE; + CStdString url; + if (ptrListItem->IsFileItem()) + { + CFileItem* selectedFileItem = (CFileItem*) ptrListItem.get(); + url = selectedFileItem->m_strPath; + } + action.strAction = url; + if (g_application.m_pPlayer) + { + g_application.m_pPlayer->OnAction(action); + Close(); + } +} + +void CGUIDialogBoxeeBrowserCtx::SetItem(const CFileItem &item) +{ + m_item = item; + + CFileItemPtr pItem (new CFileItem(m_item)); + + CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), HIDDEN_ITEM_ID, 0); + OnMessage(msg); + + CGUIMessage winmsg(GUI_MSG_LABEL_ADD, GetID(), HIDDEN_ITEM_ID, 0, 0, pItem); + OnMessage(winmsg); + + ManipulateAddressBar(m_item.m_strPath, true); + + if (m_item.GetPropertyBOOL("load-failed")) + { + SetProperty("browser-page-load-failed", true); + CONTROL_DISABLE(BTN_ADD_FAVORITE); + } + else + { + SetProperty("browser-page-load-failed", false); + CONTROL_ENABLE(BTN_ADD_FAVORITE); + } + + SetState(); +} + +void CGUIDialogBoxeeBrowserCtx::OnGoToHistory() +{ + LoadHistory(); + + SET_CONTROL_VISIBLE(HOME_SCREEN); + SET_CONTROL_HIDDEN(TOP_OSD); + SET_CONTROL_HIDDEN(FAVORITES_CONTAINER); + SET_CONTROL_VISIBLE(HISTORY_CONTAINER); + SET_CONTROL_HIDDEN(REMOVE_FAVORITES_GROUP); + SET_CONTROL_HIDDEN(FAVORITES_INFO); + SET_CONTROL_VISIBLE(HISTORY_LABEL); + SET_CONTROL_HIDDEN(FAVORITES_LABEL); + SET_CONTROL_VISIBLE(BTN_CLEAR_HISTORY); + SET_CONTROL_HIDDEN(FAVORITES_BG_CONTAINER); + + SetEmptyForHistory(); +} + +void CGUIDialogBoxeeBrowserCtx::OnGoToFavorites() +{ + LoadFavorites(); + + g_windowManager.GetWindow(g_windowManager.GetActiveWindow())->SetProperty(REMOVE_FAVORITES_MODE, false); + + SET_CONTROL_HIDDEN(BTN_DONE); + SET_CONTROL_VISIBLE(HOME_SCREEN); + SET_CONTROL_HIDDEN(TOP_OSD); + SET_CONTROL_HIDDEN(HISTORY_CONTAINER); + SET_CONTROL_VISIBLE(FAVORITES_CONTAINER); + SET_CONTROL_VISIBLE(REMOVE_FAVORITES_GROUP); + SET_CONTROL_VISIBLE(FAVORITES_INFO); + SET_CONTROL_HIDDEN(HISTORY_LABEL); + SET_CONTROL_VISIBLE(FAVORITES_LABEL); + SET_CONTROL_HIDDEN(BTN_CLEAR_HISTORY); + SET_CONTROL_VISIBLE(BTN_REMOVE_FAVORITES); + SET_CONTROL_VISIBLE(FAVORITES_BG_CONTAINER); + + SetEmptyForFavorites(); +} + +void CGUIDialogBoxeeBrowserCtx::SetEmptyForFavorites() +{ + CGUIWindow* activeWindow = g_windowManager.GetWindow(g_windowManager.GetActiveWindow()); + if (m_itemsFavorites->Size()>0) + { + activeWindow->SetProperty("empty", false); + SET_CONTROL_FOCUS(FAVORITES_CONTAINER, 0); + } + else + { + activeWindow->SetProperty("empty", true); + SET_CONTROL_FOCUS(ADDRESS_BAR_EDIT_FAVORITES, 0); + } +} + +void CGUIDialogBoxeeBrowserCtx::SetEmptyForHistory() +{ + CGUIWindow* activeWindow = g_windowManager.GetWindow(g_windowManager.GetActiveWindow()); + if (m_itemsHistory->Size()>0) + { + activeWindow->SetProperty("empty", false); + SET_CONTROL_FOCUS(HISTORY_CONTAINER, 0); + } + else + { + activeWindow->SetProperty("empty", true); + SET_CONTROL_FOCUS(ADDRESS_BAR_EDIT_HISTORY, 0); + } +} + +bool CGUIDialogBoxeeBrowserCtx::ManipulateAddressBar(const CStdString &label, bool SetHighlighted) +{ + SET_CONTROL_HIDDEN(LOCK_ICON); + CGUIEditControl *c = (CGUIEditControl *)GetControl(ADDRESS_BAR_EDIT); + if(c) + { + CStdString strPath = label; + c->SetHighlighted(SetHighlighted); + //remove "http://" + if(strPath.Left(7) == "http://") + { + strPath = strPath.substr(7); + } + //remove "https://" + if(strPath.Left(8) == "https://") + { + SET_CONTROL_VISIBLE(LOCK_ICON); + strPath = strPath.substr(8); + //shorten path + int end = strPath.Find("/"); + strPath = strPath.substr(0,end); + } + c->SetLabel2(strPath); + return true; + } + return false; +} + +void CGUIDialogBoxeeBrowserCtx::SetState() +{ +} diff --git a/xbmc/GUIDialogBoxeeBrowserCtx.h b/xbmc/GUIDialogBoxeeBrowserCtx.h new file mode 100644 index 00000000..3f9d6135 --- /dev/null +++ b/xbmc/GUIDialogBoxeeBrowserCtx.h @@ -0,0 +1,82 @@ +/* +* All Rights Reserved, Boxee.tv +*/ + +#ifndef GUIDIALOGBOXEEBROWSERCTX_H +#define GUIDIALOGBOXEEBROWSERCTX_H + +#include "GUIDialogBoxeeCtx.h" +#include "GUIViewControl.h" +#include "GUILoaderDialog.h" +#include "Util.h" + +class WebFavoriteJob : public IRunnable +{ +public: + WebFavoriteJob(const CStdString& url, const CStdString& urlTitle, bool bWebFavorite) + { + m_url = url; + m_urlTitle = urlTitle; + m_bWebFavorite = bWebFavorite; + m_bJobResult = false; + } + + WebFavoriteJob(const CStdString& url, const CStdString& urlTitle, bool bWebFavorite, unsigned long id) + { + m_url = url; + m_urlTitle = urlTitle; + m_bWebFavorite = bWebFavorite; + m_bJobResult = false; + m_id = id; + } + + virtual ~WebFavoriteJob() { } + virtual void Run(); + CStdString m_url; + CStdString m_urlTitle; + unsigned long m_id; + bool m_bWebFavorite; +}; + + + +class CGUIDialogBoxeeBrowserCtx : public CGUIDialogBoxeeCtx +{ +public: + CGUIDialogBoxeeBrowserCtx(); + virtual bool OnMessage(CGUIMessage &message); + virtual bool OnAction(const CAction &action); + virtual void Update(); + virtual void Render(); + + virtual void OnMoreInfo() ; + + virtual void SetItem(const CFileItem &item); + + void SetState(); + +protected: + virtual void OnInitWindow(); + virtual void LoadFavorites(); + virtual void LoadHistory(); + virtual void OnAddWebFavorite(); + virtual void OnRemoveWebFavorite(CGUIListItemPtr ptrListItem); + virtual void OnGoToURL(CGUIListItemPtr ptrListItem); + + virtual void OnGoToHistory(); + virtual void OnGoToFavorites(); + virtual void SetEmptyForFavorites(); + virtual void SetEmptyForHistory(); + virtual void SetFavoriteProperty(); + + bool BrowseToAddressBarUrl(); + + bool ManipulateAddressBar(const CStdString &strPath, bool SetHighlighted = false); + + bool m_bMouseEnabled; + bool m_bBrowserClosed; + CFileItemList* m_itemsFavorites; + CFileItemList* m_itemsHistory; +}; + +#endif // GUIDIALOGBOXEEBROWSERCTX_H diff --git a/xbmc/GUIDialogBoxeeChannelFilter.cpp b/xbmc/GUIDialogBoxeeChannelFilter.cpp new file mode 100644 index 00000000..79c9dfae --- /dev/null +++ b/xbmc/GUIDialogBoxeeChannelFilter.cpp @@ -0,0 +1,298 @@ + +#include "GUIDialogBoxeeChannelFilter.h" +#include "GUIWindowManager.h" +#include "Util.h" +#include "BoxeeUtils.h" +#include "log.h" +#include "lib/libBoxee/boxee.h" +#include "lib/libBoxee/bxsourcesmanager.h" +#include "bxcscmanager.h" +#include "bxconfiguration.h" +#include "GUIWindowManager.h" +#include "GUIUserMessages.h" +#include "FileSystem/Directory.h" +#include "LocalizeStrings.h" +#include "GUIControlGroup.h" +#include "GUIFixedListContainer.h" + +#define CHANNEL_LIST 7025 + +#define OFFER_DELIMITER "," +#define FREE_OFFER_STRING "free" + +using namespace BOXEE; + +CGUIDialogBoxeeChannelFilter::CGUIDialogBoxeeChannelFilter() : CGUIDialog(WINDOW_DIALOG_BOXEE_CHANNEL_FILTER, "boxee_channel_filter.xml") +{ + +} + +CGUIDialogBoxeeChannelFilter::~CGUIDialogBoxeeChannelFilter() +{ + +} + +void CGUIDialogBoxeeChannelFilter::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + CStdString sourcesUrl = "boxee://sources/"; + int activeWindow = g_windowManager.GetActiveWindow(); + + if (activeWindow == WINDOW_BOXEE_BROWSE_MOVIES) + { + sourcesUrl += "movies"; + } + else + { + sourcesUrl += "shows"; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeChannelFilter::OnInitWindow - build source list for [url=%s] (cf)",sourcesUrl.c_str()); + + CFileItemList sourceList; + DIRECTORY::CDirectory::GetDirectory(sourcesUrl,sourceList); + + if (sourceList.Size() < 1) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeChannelFilter::OnInitWindow - FAILED to get sources. [size=%d] (cf)",sourceList.Size()); + Close(); + return; + } + + if (!LoadExcludedChannels()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeChannelFilter::OnInitWindow - FAILED to load excluded sources (cf)"); + Close(); + return; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeChannelFilter::OnInitWindow - [NumOfSources=%d][NumOfExcludedSources=%zu] (cf)",sourceList.Size(),m_excludedChannels.size()); + + CGUIMessage winmsgResetPremium(GUI_MSG_LABEL_RESET, GetID(), CHANNEL_LIST); + OnMessage(winmsgResetPremium); + + CFileItemList channelItemList; + CFileItemList freeChannelItemList; + + for (int i=0; iGetProperty("sourceid"); + std::string sourceOffer = sourceItem->GetProperty("sourceoffer"); + + if (sourceOffer.empty()) + { + CLog::Log(LOGWARNING,"CGUIDialogBoxeeChannelFilter::OnInitWindow - [%d/%d] - for sources [id=%s] the attribute offer is EMPTY. [offer=%s] (cf)",i+1,sourceList.Size(),sourceId.c_str(),sourceOffer.c_str()); + continue; + } + + CFileItemPtr source(new CFileItem(*(sourceItem.get()))); + source->SetProperty("channelthumb",source->GetProperty("sourcethumb")); + source->Select(m_excludedChannels.find(sourceId) == m_excludedChannels.end()); + + if (stricmp(sourceOffer.c_str(),FREE_OFFER_STRING)) + { + if (channelItemList.IsEmpty()) + { + // add PREMIUM separator + CFileItemPtr seperator(new CFileItem(g_localizeStrings.Get(53581))); + seperator->SetProperty("isseparator",true); + channelItemList.Add(seperator); + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeChannelFilter::OnInitWindow - [%d/%d] - [sourceoffer=%s] -> adding PREMIUM source [id=%s] (cf)",i+1,sourceList.Size(),sourceOffer.c_str(),sourceId.c_str()); + channelItemList.Add(source); + } + else + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeChannelFilter::OnInitWindow - [%d/%d] - [sourceoffer=%s] -> adding FREE source [id=%s] (cf)",i+1,sourceList.Size(),sourceOffer.c_str(),sourceId.c_str()); + freeChannelItemList.Add(source); + } + } + + for (int i=0; iSetProperty("isseparator",true); + channelItemList.Add(seperator); + } + + CFileItemPtr source(new CFileItem(*(freeChannelItemList.Get(i)))); + source->SetProperty("channelthumb",source->GetProperty("sourcethumb")); + channelItemList.Add(source); + } + + CGUIMessage msgBindToChannelList(GUI_MSG_LABEL_BIND, GetID(), CHANNEL_LIST, 0, 0, &channelItemList); + OnMessage(msgBindToChannelList); + + SET_CONTROL_FOCUS(CHANNEL_LIST, 0); + + m_dirty = false; +} + +void CGUIDialogBoxeeChannelFilter::OnDeinitWindow(int nextWindowID) +{ + CGUIDialog::OnDeinitWindow(nextWindowID); + + if (!m_dirty) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeChannelFilter::OnDeinitWindow - [dirty=%d] -> no need to update (cf)",m_dirty); + return; + } + + std::string excludedChannelsStr; + std::set::iterator it = m_excludedChannels.begin(); + while(it != m_excludedChannels.end()) + { + if (it != m_excludedChannels.begin()) + { + excludedChannelsStr += OFFER_DELIMITER; + } + + excludedChannelsStr += (*it); + it++; + } + + CPostExcludedSorcesRequestJob* postRequest = new CPostExcludedSorcesRequestJob(excludedChannelsStr); + + if (!postRequest) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeChannelFilter::OnDeinitWindow - FAILED to allocate CPostExcludedSorcesRequestJob object. [postData=%s] (cf)",excludedChannelsStr.c_str()); + return; + } + + if (CUtil::RunInBG(postRequest) != JOB_SUCCEEDED) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeChannelFilter::OnDeinitWindow - FAILED to execute CPostExcludedSorcesRequestJob. [postData=%s] (cf)",excludedChannelsStr.c_str()); + return; + } +} + +bool CGUIDialogBoxeeChannelFilter::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_CLICKED: + { + return OnClick(message); + } + break; + } + + return CGUIDialog::OnMessage(message); +} + +bool CGUIDialogBoxeeChannelFilter::OnAction(const CAction& action) +{ + if (action.id == ACTION_PREVIOUS_MENU) + { + Close(); + return true; + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeeChannelFilter::Show() +{ + CGUIDialogBoxeeChannelFilter* dlg = (CGUIDialogBoxeeChannelFilter*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_CHANNEL_FILTER); + if (!dlg) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeChannelFilter::Show - FAILED to get WINDOW_DIALOG_BOXEE_CHANNEL_FILTER (cf)"); + return false; + } + + dlg->DoModal(); + + return true; +} + +bool CGUIDialogBoxeeChannelFilter::OnClick(CGUIMessage& message) +{ + int controlId = message.GetSenderId(); + CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), controlId); + g_windowManager.SendMessage(msg); + int itemIndex = msg.GetParam1(); + + CGUIMessage msg1(GUI_MSG_GET_ITEM, GetID(), controlId, itemIndex); + OnMessage(msg1); + + CFileItemPtr clickedLinkFileItem = boost::static_pointer_cast(msg1.GetItem()); + clickedLinkFileItem->Select(!clickedLinkFileItem->IsSelected()); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeChannelFilter::OnClick - after update item [label=%s][IsSelected=%d]. [index=%d][controlId=%d] (cf)",clickedLinkFileItem->GetLabel().c_str(),clickedLinkFileItem->IsSelected(),itemIndex,controlId); + + CStdString sourceid = clickedLinkFileItem->GetProperty("sourceid"); + bool isChannelInExcluded = (m_excludedChannels.find(sourceid) != m_excludedChannels.end()); + + if (isChannelInExcluded) + { + // channel WAS excluded + if (clickedLinkFileItem->IsSelected()) + { + // set to show -> remove from excluded set + m_excludedChannels.erase(sourceid); + } + } + else + { + // channel WASN'T excluded + if (!clickedLinkFileItem->IsSelected()) + { + // set to NOT show -> insert to excluded set + m_excludedChannels.insert(sourceid); + } + } + + m_dirty = true; + + return true; +} + +bool CGUIDialogBoxeeChannelFilter::LoadExcludedChannels() +{ + m_excludedChannels.clear(); + + std::string excludedChannels = BOXEE::Boxee::GetInstance().GetBoxeeClientServerComManager().GetExcludedSources(); + + std::vector excludedChannelsVec; + CUtil::Tokenize(excludedChannels,excludedChannelsVec,OFFER_DELIMITER); + + for (size_t i=0;i + +class CGUIDialogBoxeeChannelFilter : public CGUIDialog +{ +public: + + CGUIDialogBoxeeChannelFilter(); + virtual ~CGUIDialogBoxeeChannelFilter(); + + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + static bool Show(); + +protected: + +private: + + bool LoadExcludedChannels(); + bool OnClick(CGUIMessage& message); + + std::set m_excludedChannels; + + bool m_dirty; + + class CPostExcludedSorcesRequestJob : public IRunnable + { + public: + + CPostExcludedSorcesRequestJob(const std::string& excludedChannelsStr); + virtual void Run(); + + private: + + CStdString m_excludedChannelsStr; + }; +}; + +#endif /* CGUIDIALOGBOXEECHANNELFILTER_H_ */ + diff --git a/xbmc/GUIDialogBoxeeChapters.cpp b/xbmc/GUIDialogBoxeeChapters.cpp new file mode 100644 index 00000000..ce431502 --- /dev/null +++ b/xbmc/GUIDialogBoxeeChapters.cpp @@ -0,0 +1,212 @@ +#include "GUIDialogBoxeeChapters.h" +#include "GUIWindowManager.h" +#include "GUIBaseContainer.h" +#include "utils/log.h" +#include "FileItem.h" +#include "LocalizeStrings.h" +#include "StringUtils.h" + +#define ITEMS_LIST 500 + +CGUIDialogBoxeeChapters::CGUIDialogBoxeeChapters() +: CGUIDialog(WINDOW_DIALOG_BOXEE_CHAPTERS, "boxee_chapters.xml") +{ + m_bConfirmed = true; + m_initSelection = -1; +} + + +CGUIDialogBoxeeChapters::~CGUIDialogBoxeeChapters() +{ +} + +void CGUIDialogBoxeeChapters::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + LoadItems(); + m_bConfirmed = true; +} + +bool CGUIDialogBoxeeChapters::OnAction(const CAction& action) +{ + if (action.id == ACTION_PREVIOUS_MENU || action.id == ACTION_PARENT_DIR) + { + m_bConfirmed = false; + Close(); + return true; + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeeChapters::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_CLICKED: + { + return OnClick(message); + } + } + + return CGUIDialog::OnMessage(message); +} + +bool CGUIDialogBoxeeChapters::OnClick(CGUIMessage& message) +{ + int iControl = message.GetSenderId(); + switch(iControl) + { + case ITEMS_LIST: + { + CGUIBaseContainer* subMenuList = (CGUIBaseContainer*) GetControl(ITEMS_LIST); + CGUIListItemPtr selectedListItem = subMenuList->GetSelectedItemPtr(); + if (selectedListItem.get()) + { + m_selectionId = selectedListItem->GetPropertyInt("value"); + } + } + break; + } + + Close(); + + return true; +} + +//static +bool CGUIDialogBoxeeChapters::Show(const std::vector& chapters, int& selectedChapterId, int currentSelection) +{ + CGUIDialogBoxeeChapters *dialog = (CGUIDialogBoxeeChapters*) g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_CHAPTERS); + if (!dialog) + { + return false; + } + + dialog->m_chapters = chapters; + dialog->m_titles.clear(); + dialog->m_bAddBrowse = false; + dialog->m_initSelection = currentSelection; + dialog->DoModal(); + + if( dialog->m_bConfirmed ) + selectedChapterId = dialog->m_selectionId; + + return dialog->m_bConfirmed; +} +//static +bool CGUIDialogBoxeeChapters::Show(const std::vector& titles, int& selectedTitleId, bool bCanBrowse /*= false*/) +{ + CGUIDialogBoxeeChapters *dialog = (CGUIDialogBoxeeChapters*) g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_CHAPTERS); + if (!dialog) + { + return false; + } + + dialog->m_titles = titles; + dialog->m_chapters.clear(); + dialog->m_bAddBrowse = bCanBrowse; + dialog->m_initSelection = 0; + dialog->DoModal(); + + if( dialog->m_bConfirmed ) + selectedTitleId = dialog->m_selectionId; + + return dialog->m_bConfirmed; +} + +void CGUIDialogBoxeeChapters::LoadItems() +{ + CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), ITEMS_LIST, 0); + OnMessage(msg); + + if( m_chapters.size() > 0 ) + { + CGUIMessage label(GUI_MSG_LABEL_SET, GetID(), 610); + label.SetLabel(21419); + OnMessage(label); + + // We are in chapter display mode + for (size_t i = 0; i< m_chapters.size(); i++) + { + CStdString title; + bool showStartTime = true; + + if( m_chapters[i].startSecond == 0 && m_chapters[i].endSecond == 0) + showStartTime = false; + + CStdString startTimeStr; + StringUtils::SecondsToTimeString(m_chapters[i].startSecond, startTimeStr, TIME_FORMAT_HH_MM_SS); + + if (!m_chapters[i].title.IsEmpty()) + { + if(showStartTime) + title.Format("%d %s (%s)", i + 1, m_chapters[i].title, startTimeStr.c_str()); + else + title.Format("%d %s", i + 1, m_chapters[i].title); + } + else + { + if(showStartTime) + title.Format("%d %s %d (%s)", i + 1, g_localizeStrings.Get(21396).c_str(), i + 1, startTimeStr.c_str()); + else + title.Format("%d %s %d", i + 1, g_localizeStrings.Get(21396).c_str(), i + 1); + } + + CFileItemPtr item(new CFileItem(title)); + item->SetProperty("value", m_chapters[i].id); + + CGUIMessage winmsg(GUI_MSG_LABEL_ADD, GetID(), ITEMS_LIST, 0, 0, item); + OnMessage(winmsg); + } + } + else + { + CGUIMessage label(GUI_MSG_LABEL_SET, GetID(), 610); + label.SetLabel(21450); + OnMessage(label); + + // We are in title display mode + CStdString line; + + // Add a 'browse...' item at the top for browsing the folder/disc + if( m_bAddBrowse ) + { + line.Format("%s", g_localizeStrings.Get(20153)); + CFileItemPtr item(new CFileItem(line)); + item->SetProperty("value", -1); + + CGUIMessage winmsg(GUI_MSG_LABEL_ADD, GetID(), ITEMS_LIST, 0, 0, item); + OnMessage(winmsg); + } + + // add the titles + for (size_t i = 0; i < m_titles.size(); i++) + { + CStdString durStr; + StringUtils::SecondsToTimeString(m_titles[i].duration, durStr, TIME_FORMAT_HH_MM_SS); + + if( !m_titles[i].title.IsEmpty() ) + { + line.Format("%d. %s (%s)", i+1, m_titles[i].title, durStr.c_str()); + } + else + { + line.Format("%d. %s %d (%s)", i+1, g_localizeStrings.Get(369).c_str(), i+1, durStr.c_str()); + } + + CFileItemPtr item(new CFileItem(line)); + item->SetProperty("value",m_titles[i].id); + + CGUIMessage wmsg(GUI_MSG_LABEL_ADD, GetID(), ITEMS_LIST, 0, 0, item); + OnMessage(wmsg); + } + + if(m_bAddBrowse) + m_initSelection = 1; + } + + if(m_initSelection != -1) + CONTROL_SELECT_ITEM(ITEMS_LIST, m_initSelection); +} diff --git a/xbmc/GUIDialogBoxeeChapters.h b/xbmc/GUIDialogBoxeeChapters.h new file mode 100644 index 00000000..384ac406 --- /dev/null +++ b/xbmc/GUIDialogBoxeeChapters.h @@ -0,0 +1,31 @@ +#ifndef GUIDIALOGBOXEECHAPTERS_H +#define GUIDIALOGBOXEECHAPTERS_H + +#include "GUIDialog.h" +#include "cores/dvdplayer/DVDDemuxers/DVDDemux.h" + +class CGUIDialogBoxeeChapters : public CGUIDialog +{ +public: + CGUIDialogBoxeeChapters(); + virtual ~CGUIDialogBoxeeChapters(); + + static bool Show(const std::vector& chapters, int& selectedChapterId, int currentSelection = -1); + static bool Show(const std::vector& titles, int& selectedTitleId, bool bCanBrowse = false); + virtual void OnInitWindow(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + +private: + bool OnClick(CGUIMessage& message); + void LoadItems(); + + bool m_bConfirmed; + int m_selectionId; + int m_initSelection; + std::vector m_chapters; + std::vector m_titles; + bool m_bAddBrowse; +}; + +#endif //GUIDIALOGBOXECHAPTERS_H diff --git a/xbmc/GUIDialogBoxeeEject.cpp b/xbmc/GUIDialogBoxeeEject.cpp new file mode 100644 index 00000000..60e0597d --- /dev/null +++ b/xbmc/GUIDialogBoxeeEject.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "GUIDialogBoxeeEject.h" +#define CONTROL_HEADING 340 +#define CONTROL_LIST 341 + +CGUIDialogBoxeeEject::CGUIDialogBoxeeEject(void) + : CGUIDialogSelect(WINDOW_DIALOG_BOXEE_EJECT,"boxee_dialog_eject.xml") +{ + m_bWasSelected = false; +} + +CGUIDialogBoxeeEject::~CGUIDialogBoxeeEject(void) +{ +} + +bool CGUIDialogBoxeeEject::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_CLICKED: + { + int iControl = message.GetSenderId(); + if (CONTROL_LIST == iControl) + { + m_bWasSelected = true; + } + } + break; + } + + return CGUIDialogSelect::OnMessage(message); +} diff --git a/xbmc/GUIDialogBoxeeEject.h b/xbmc/GUIDialogBoxeeEject.h new file mode 100644 index 00000000..fea71bf1 --- /dev/null +++ b/xbmc/GUIDialogBoxeeEject.h @@ -0,0 +1,39 @@ +#pragma once + +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "GUIDialogSelect.h" + + +class CGUIDialogBoxeeEject : +public CGUIDialogSelect +{ +public: + CGUIDialogBoxeeEject(void); + virtual ~CGUIDialogBoxeeEject(void); + virtual bool OnMessage(CGUIMessage& message); + + bool GetWasItemSelected(){return m_bWasSelected;} + +private: + bool m_bWasSelected; +}; diff --git a/xbmc/GUIDialogBoxeeExitVideo.cpp b/xbmc/GUIDialogBoxeeExitVideo.cpp new file mode 100644 index 00000000..bb2325c9 --- /dev/null +++ b/xbmc/GUIDialogBoxeeExitVideo.cpp @@ -0,0 +1,144 @@ + +#include "GUIDialogBoxeeExitVideo.h" +#include "GUIWindowManager.h" +#include "GUIRadioButtonControl.h" +#include "Settings.h" +#include "GUISettings.h" +#include "log.h" +#include "Application.h" +#include "MouseStat.h" + +#define SAVE_CHOICE_RADIO_BUTTON 20 +#define STAY_BUTTON 26 +#define LEAVE_BUTTON 27 +#define BACK_TO_BROWSER_BUTTON 28 + +CGUIDialogBoxeeExitVideo::CGUIDialogBoxeeExitVideo() : CGUIDialogBoxBase(WINDOW_DIALOG_BOXEE_EXIT_VIDEO, "boxee_exit_video.xml") +{ + m_stopVideo = true; + m_dontShowDialog = false; +} + +CGUIDialogBoxeeExitVideo::~CGUIDialogBoxeeExitVideo() +{ + +} + +void CGUIDialogBoxeeExitVideo::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + if (g_application.IsPlayingLiveTV()) + m_settingsStr = "ota.showmessagewhenexit"; + else + m_settingsStr = "myvideos.showmessagewhenexit"; + + m_stopVideo = false; + m_dontShowDialog = !g_guiSettings.GetBool(m_settingsStr); + + CGUIRadioButtonControl* pControl = (CGUIRadioButtonControl*)GetControl(SAVE_CHOICE_RADIO_BUTTON); + if (pControl) + { + pControl->SetSelected(m_dontShowDialog); + } + + SET_CONTROL_FOCUS(LEAVE_BUTTON,0); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeExitVideo::OnInitWindow - [StopVideo=%d][saveChoice=%d][ShowMessageWhenExit=%d] (ev)",m_stopVideo,m_dontShowDialog,g_guiSettings.GetBool(m_settingsStr)); +} + +void CGUIDialogBoxeeExitVideo::OnDeinitWindow(int nextWindowID) +{ + if (g_guiSettings.GetBool(m_settingsStr) != !m_dontShowDialog) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeExitVideo::OnDeinitWindow - going to update [ShowMessageWhenExit=%d] to [DontShowDialog=%d] (ev)",g_guiSettings.GetBool(m_settingsStr), m_dontShowDialog); + g_guiSettings.SetBool(m_settingsStr, !m_dontShowDialog); + g_settings.Save(); + } + + CGUIDialogBoxBase::OnDeinitWindow(nextWindowID); +} + +bool CGUIDialogBoxeeExitVideo::OnMessage(CGUIMessage& message) +{ + if (message.GetMessage() != GUI_MSG_CLICKED) + { + return CGUIDialogBoxBase::OnMessage(message); + } + + switch(message.GetSenderId()) + { + case SAVE_CHOICE_RADIO_BUTTON: + { + CGUIRadioButtonControl* pControl = (CGUIRadioButtonControl*)GetControl(SAVE_CHOICE_RADIO_BUTTON); + if (pControl) + { + m_dontShowDialog = pControl->IsSelected(); + } + else + { + m_dontShowDialog = false; + CLog::Log(LOGERROR,"CGUIDialogBoxeeExitVideo::OnMessage - SAVE_CHOICE_RADIO_BUTTON - FAILED to get SAVE_CHOICE_RADIO_BUTTON. [DontShowDialog=%d] (ev)",m_dontShowDialog); + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeExitVideo::OnMessage - SAVE_CHOICE_RADIO_BUTTON - [DontShowDialog=%d]. [StopVideo=%d] (ev)",m_dontShowDialog,m_stopVideo); + return true; + } + break; + + case STAY_BUTTON: + { + m_stopVideo = false; + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeExitVideo::OnMessage - STAY_BUTTON - [StopVideo=%d] (ev)",m_stopVideo); + Close(); + return true; + } + break; + + case LEAVE_BUTTON: + { + m_stopVideo = true; + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeExitVideo::OnMessage - LEAVE_BUTTON - [StopVideo=%d] (ev)",m_stopVideo); + Close(); + return true; + } + break; + } + + return CGUIDialogBoxBase::OnMessage(message); +} + +bool CGUIDialogBoxeeExitVideo::OnAction(const CAction& action) +{ + if (action.id == ACTION_PREVIOUS_MENU) + { + m_stopVideo = false; + m_dontShowDialog = false; + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeExitVideo::OnAction - ACTION_PREVIOUS_MENU - [StopVideo=%d] (ev)",m_stopVideo); + Close(); + return true; + } + + return CGUIDialogBoxBase::OnAction(action); +} + +bool CGUIDialogBoxeeExitVideo::ShowAndGetInput() +{ + bool bMouseEnabled = g_Mouse.IsEnabledInSettings(); + g_Mouse.SetEnabled(false); + + CGUIDialogBoxeeExitVideo* dialog = (CGUIDialogBoxeeExitVideo*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_EXIT_VIDEO); + if (!dialog) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeExitVideo::ShowAndGetInput - FAILED to get WINDOW_DIALOG_BOXEE_EXIT_VIDEO. Return TRUE (ev)"); + g_Mouse.SetEnabled(bMouseEnabled); + return true; + } + + dialog->DoModal(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeExitVideo::ShowAndGetInput - Exit function. [StopVideo=%d][DontShowDialog=%d][ShowMessageWhenExit=%d] (ev)",dialog->m_stopVideo,dialog->m_dontShowDialog,g_guiSettings.GetBool(dialog->m_settingsStr)); + + g_Mouse.SetEnabled(bMouseEnabled); + return dialog->m_stopVideo; +} diff --git a/xbmc/GUIDialogBoxeeExitVideo.h b/xbmc/GUIDialogBoxeeExitVideo.h new file mode 100644 index 00000000..e0179994 --- /dev/null +++ b/xbmc/GUIDialogBoxeeExitVideo.h @@ -0,0 +1,21 @@ +#pragma once + +#include "GUIDialogBoxBase.h" + +class CGUIDialogBoxeeExitVideo : public CGUIDialogBoxBase +{ +public: + CGUIDialogBoxeeExitVideo(); + virtual ~CGUIDialogBoxeeExitVideo(); + + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + static bool ShowAndGetInput(); + +private: + bool m_stopVideo; + bool m_dontShowDialog; + CStdString m_settingsStr; +}; diff --git a/xbmc/GUIDialogBoxeeGetFacebookExtraCredential.cpp b/xbmc/GUIDialogBoxeeGetFacebookExtraCredential.cpp new file mode 100644 index 00000000..3246bc2b --- /dev/null +++ b/xbmc/GUIDialogBoxeeGetFacebookExtraCredential.cpp @@ -0,0 +1,59 @@ + +#include "GUIDialogBoxeeGetFacebookExtraCredential.h" + +#define CONTROL_BUTTON_YES 11 +#define CONTROL_BUTTON_NO 10 + + +CGUIDialogBoxeeGetFacebookExtraCredential::CGUIDialogBoxeeGetFacebookExtraCredential(void) + : CGUIDialogBoxBase(WINDOW_DIALOG_BOXEE_GET_FACEBOOK_EXTRA_CRED, "boxee_get_facebook_extra_cred.xml") +{ +} + +CGUIDialogBoxeeGetFacebookExtraCredential::~CGUIDialogBoxeeGetFacebookExtraCredential() +{ +} + +void CGUIDialogBoxeeGetFacebookExtraCredential::OnInitWindow() +{ + m_bConfirmed = false; + CGUIDialogBoxBase::OnInitWindow(); +} + +bool CGUIDialogBoxeeGetFacebookExtraCredential::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_CLICKED: + { + if (message.GetSenderId() == CONTROL_BUTTON_YES) + { + m_bConfirmed = true; + Close(); + return true; + } + if (message.GetSenderId() == CONTROL_BUTTON_NO) + { + m_bConfirmed = false; + Close(); + return true; + } + + } + break; + } + return CGUIDialogBoxBase::OnMessage(message); +} + +bool CGUIDialogBoxeeGetFacebookExtraCredential::OnAction(const CAction& action) +{ + return CGUIDialogBoxBase::OnAction(action); +} + +void CGUIDialogBoxeeGetFacebookExtraCredential::SetDialogText(const CStdString& heading, const CStdString& line, const CStdString& yesLabel, const CStdString& noLabel) +{ + SetHeading(heading); + SetLine(0,line); + SetChoice(1,yesLabel); + SetChoice(0,noLabel); +} diff --git a/xbmc/GUIDialogBoxeeGetFacebookExtraCredential.h b/xbmc/GUIDialogBoxeeGetFacebookExtraCredential.h new file mode 100644 index 00000000..07939644 --- /dev/null +++ b/xbmc/GUIDialogBoxeeGetFacebookExtraCredential.h @@ -0,0 +1,20 @@ +#pragma once + +#include "GUIDialogBoxBase.h" + +class CGUIDialogBoxeeGetFacebookExtraCredential: +public CGUIDialogBoxBase +{ +public: + CGUIDialogBoxeeGetFacebookExtraCredential(void); + virtual ~CGUIDialogBoxeeGetFacebookExtraCredential(void); + + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + virtual void OnInitWindow(); + + void SetDialogText(const CStdString& heading, const CStdString& line, const CStdString& yesLabel, const CStdString& noLabel); + +}; + + diff --git a/xbmc/GUIDialogBoxeeLiveTvCtx.cpp b/xbmc/GUIDialogBoxeeLiveTvCtx.cpp new file mode 100755 index 00000000..12555cfc --- /dev/null +++ b/xbmc/GUIDialogBoxeeLiveTvCtx.cpp @@ -0,0 +1,394 @@ +#include "GUIDialogBoxeeLiveTvCtx.h" + +#ifdef HAS_DVB + +#include +#include "BoxeeUtils.h" +#include "GUIWindowManager.h" +#include "GUIInfoManager.h" +#include "cores/dvb/dvbmanager.h" +#include "cores/dvb/epgstore.h" +#include "GUISettings.h" +#include "utils/log.h" +#include "GUIWindowBoxeeLiveTv.h" +#include "GUIDialogBoxeeLiveTvEditChannels.h" +#include "GUIDialogBoxeeLiveTvInfo.h" + +#define CONTROL_LIST_EPG 50 +#define CONTROL_LABEL_EPG 49 +#define CONTROL_LIST_ACTIONS 47 +#define CONTROL_BUTTON_ACTION 461 +#define CONTROL_BUTTON_EDIT_CHANNELS 12 +#define CONTROL_BUTTON_ENABLE_SHARE 13 +#define CONTROL_BUTTON_DISABLE_SHARE 14 + +CGUIDialogBoxeeLiveTvCtx::CGUIDialogBoxeeLiveTvCtx() : CGUIDialog(WINDOW_DIALOG_BOXEE_LIVETV_CTX, "boxee_livetv_context.xml") +{ +} + +CGUIDialogBoxeeLiveTvCtx::~CGUIDialogBoxeeLiveTvCtx() +{ +} + +void CGUIDialogBoxeeLiveTvCtx::OnInitWindow() +{ + g_infoManager.SetShowCodec(false); + g_infoManager.SetShowInfo(false); + + CGUIDialog::OnInitWindow(); + + // initialize visibility + DVBManager::GetInstance().GetEpgServerLoader().NotifyEpgVisibilityChange(true); + + LoadTimeSlot(); + + int selectedItem = LoadEPG(); + SET_CONTROL_FOCUS(CONTROL_LIST_EPG, selectedItem); +} + +void CGUIDialogBoxeeLiveTvCtx::OnDeinitWindow(int nextWindowID) +{ + DVBManager::GetInstance().GetEpgServerLoader().NotifyEpgVisibilityChange(false); + + m_model.SetCurrentTimeSlot(0); + + SET_CONTROL_FOCUS(CONTROL_LIST_EPG,0); + + CGUIDialog::OnDeinitWindow(nextWindowID); +} + +void CGUIDialogBoxeeLiveTvCtx::LoadTimeSlot() +{ + time_t startTime; + time_t endTime; + struct tm *loctime; + + m_model.GetCurrentTimeSlot(startTime, endTime); + + CStdString timeSlotStr = "[B]"; + if (startTime == 0) + { + timeSlotStr += "NOW"; + } + else + { + loctime = localtime(&startTime); + CDateTime startDateTime(*loctime); + timeSlotStr += startDateTime.GetAsLocalizedTime("", false); + } + + timeSlotStr += " - "; + + loctime = localtime(&endTime); + CDateTime endDateTime(*loctime); + timeSlotStr += endDateTime.GetAsLocalizedTime("", false); + + timeSlotStr += "[/B]"; + + SET_CONTROL_LABEL(CONTROL_LABEL_EPG,timeSlotStr); +} + +int CGUIDialogBoxeeLiveTvCtx::LoadEPG() +{ + LiveTvModelChannelsType channels = m_model.GetChannels(); + LiveTvModelProgramsType programs = m_model.GetPrograms(); + + int currentChannelIndex = DVBManager::GetInstance().GetCurrentChannel()->GetIndex(); + + time_t startSlotTime; + time_t endSlotTime; + m_model.GetCurrentTimeSlot(startSlotTime, endSlotTime); + + m_listEPG.Clear(); + + int selectedItem = 0; + + for (int channelIndex = 0; channelIndex < (int) channels.size(); channelIndex++) + { + LiveTvModelChannel& channelInfo = channels[channelIndex]; + + if (!channelInfo.enabled) + continue; + + bool isActive = (currentChannelIndex == channelIndex); + + std::vector& programsForChannel = programs[channelIndex]; + + if (programsForChannel.size() > 0) + { + bool firstProgram = true; + foreach (LiveTvModelProgram program, programsForChannel) + { + time_t startTime = (time_t) program.info.start; + struct tm* startLocaltime = localtime(&startTime); + CDateTime startDateTime(*startLocaltime); + + time_t endTime = (time_t) program.info.end; + struct tm* endLocaltime = localtime(&endTime); + CDateTime endDateTime(*endLocaltime); + + CFileItemPtr channelItem(new CFileItem(program.info.title)); + channelItem->SetProperty("ChannelName", channelInfo.label); + channelItem->SetProperty("ChannelNumber", channelInfo.number); + channelItem->SetProperty("channel-id", channelInfo.id); + channelItem->SetProperty("hasepg", true); + channelItem->SetProperty("rating", program.info.rating); + channelItem->SetProperty("hasrating", program.info.rating.length() > 0); + channelItem->SetProperty("issubitem", !firstProgram); + channelItem->SetProperty("program-id", program.info.id); + + channelItem->SetProperty("starttime", startDateTime.GetAsLocalizedTime("", false)); + channelItem->SetProperty("endtime", endDateTime.GetAsLocalizedTime("", false)); + channelItem->SetProperty("isnow", program.isNow); + channelItem->SetProperty("isnew", program.info.isNew); + channelItem->SetProperty("isactive", isActive); + + channelItem->SetProperty("show-synopsis", program.info.synopsis); + channelItem->SetProperty("show-title", program.info.title); + channelItem->SetProperty("episode-title", program.info.episodeTitle); + channelItem->SetProperty("episode-number", program.info.episodeNumber); + channelItem->SetProperty("season-number", program.info.seasonNumber); + + // In case there are multiple shows on the selected channels, we only want + // the first one to be active + if (isActive) + { + selectedItem = m_listEPG.Size(); + isActive = false; + } + + if (program.isNow && program.social.watching) + { + int numOfFriendsWatching = program.social.friends.size(); + + channelItem->SetProperty("friendswatching", true); + channelItem->SetProperty("watching-label", program.social.label); + + if (numOfFriendsWatching == 1) + { + channelItem->SetProperty("userthumb-1", program.social.friends[0].thumbSmallUrl); + } + else if (numOfFriendsWatching == 2) + { + channelItem->SetProperty("userthumb-1", program.social.friends[0].thumbSmallUrl); + channelItem->SetProperty("userthumb-2", program.social.friends[1].thumbSmallUrl); + } + } + + m_listEPG.Add(channelItem); + + firstProgram = false; + } + } + else + { + // Sorry, no programs for this channel + CFileItemPtr channelItem(new CFileItem(channelInfo.label)); + channelItem->SetProperty("ChannelName", channelInfo.label); + channelItem->SetProperty("ChannelNumber", channelInfo.number); + channelItem->SetProperty("channel-id", channelInfo.id); + channelItem->SetProperty("hasepg", false); + channelItem->SetProperty("isactive", isActive); + + if (isActive) + { + selectedItem = m_listEPG.Size(); + isActive = false; + } + + m_listEPG.Add(channelItem); + } + } + + CGUIMessage msgBind(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LIST_EPG, 0, 0, &m_listEPG); + OnMessage(msgBind); + + SetProperty("HasNext", m_model.HasNextTimeSlot()); + SetProperty("HasPrev", m_model.HasPrevTimeSlot()); + + return selectedItem; +} + +void CGUIDialogBoxeeLiveTvCtx::HandleClickedChannel() +{ + int selectedItem; + CONTROL_GET_SELECTED_ITEM(GetID(), CONTROL_LIST_EPG, selectedItem); + + CFileItemPtr pSelectedItem = m_listEPG.Get(selectedItem); + + // Show info if it's a future show and has epg + if (pSelectedItem->GetPropertyBOOL("hasepg") && !pSelectedItem->GetPropertyBOOL("isnow")) + { + CGUIDialogBoxeeLiveTvInfo* pInfo = (CGUIDialogBoxeeLiveTvInfo*) g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LIVETV_INFO); + pInfo->SetProgram(pSelectedItem); + pInfo->DoModal(); + return; + } + + // Switch channel if it's not the active one. + if (!pSelectedItem->GetPropertyBOOL("isactive")) + { + CGUIWindowBoxeeLiveTv::SwitchChannel(pSelectedItem->GetPropertyInt("channel-id")); + } + + // Close the dialog + Close(); +} + +bool CGUIDialogBoxeeLiveTvCtx::HandleClick(CGUIMessage& message) +{ + //see what was clicked and decide what to do with it + switch (message.GetSenderId()) + { + case CONTROL_LIST_EPG: + { + HandleClickedChannel(); + return true; + } + break; + + case CONTROL_BUTTON_EDIT_CHANNELS: + { + CGUIDialogBoxeeLiveTvEditChannels* pDlgLTEC = (CGUIDialogBoxeeLiveTvEditChannels*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LIVETV_EDIT_CHANNELS); + if (!pDlgLTEC) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLiveTvCtx::HandleClick - CONTROL_BUTTON_EDIT_CHANNELS - FAILED to get LIVETV_EDIT_CHANNELS object (ltvc)"); + return true; + } + + pDlgLTEC->DoModal(); + + RefreshEPG(0); + + return true; + } + break; + + case CONTROL_BUTTON_ENABLE_SHARE: + case CONTROL_BUTTON_DISABLE_SHARE: + { + g_guiSettings.SetBool("ota.share", !g_guiSettings.GetBool("ota.share")); + g_settings.Save(); + return true; + } + break; + + default: + { + // do nothing + } + break; + } + + return false; +} + +bool CGUIDialogBoxeeLiveTvCtx::RefreshEPG(int direction) +{ + bool hasSlot = true; + if (direction > 0) + hasSlot = m_model.SetNextTimeSlot(); + else if (direction < 0) + hasSlot = m_model.SetPrevTimeSlot(); + + if (!hasSlot) + return false; + + // Remember the channel that we are on + int selectedItem; + CONTROL_GET_SELECTED_ITEM(GetID(), CONTROL_LIST_EPG, selectedItem); + CFileItemPtr pSelectedItem = m_listEPG.Get(selectedItem); + CStdString currentCHannel = pSelectedItem->GetProperty("ChannelName"); + + LoadEPG(); + LoadTimeSlot(); + + for (int i = 0; i < m_listEPG.Size(); i++) + { + if (m_listEPG[i]->GetProperty("ChannelName") == currentCHannel) + { + selectedItem = i; + break; + } + } + + SET_CONTROL_FOCUS(CONTROL_LIST_EPG, selectedItem); + + return true; +} + +bool CGUIDialogBoxeeLiveTvCtx::OnAction(const CAction& action) +{ + switch (action.id) + { + case ACTION_MOVE_RIGHT: + { + if (!GetControl(CONTROL_LIST_ACTIONS)->HasFocus()) + { + return RefreshEPG(1); + } + } + break; + + case ACTION_MOVE_LEFT: + { + if (RefreshEPG(-1)) + { + return true; + } + } + break; + }; + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeeLiveTvCtx::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_LABEL_BIND: + { + if (message.GetPointer() && message.GetControlId() == 0) + { + CFileItemList *items = (CFileItemList *)message.GetPointer(); + delete items; + return true; + } + } + break; + + case GUI_MSG_CLICKED: + { + if (HandleClick(message)) + { + return true; + } + } + break; + + default: + break; + } + + return CGUIDialog::OnMessage(message); +} + +void CGUIDialogBoxeeLiveTvCtx::Render() +{ + CGUIDialog::Render(); + + time_t now = time(NULL); + time_t startSlot; + time_t endSlot; + m_model.GetCurrentTimeSlot(startSlot, endSlot); + + if (now > endSlot) + { + m_model.SetCurrentTimeSlot(0); + RefreshEPG(0); + } +} + +#endif + diff --git a/xbmc/GUIDialogBoxeeLiveTvCtx.h b/xbmc/GUIDialogBoxeeLiveTvCtx.h new file mode 100755 index 00000000..3df6c968 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLiveTvCtx.h @@ -0,0 +1,47 @@ +#ifndef GUIDIALOGBOXEELIVETVCTX_H +#define GUIDIALOGBOXEELIVETVCTX_H + +#include "system.h" + +#ifdef HAS_DVB + +#include "LiveTvModel.h" +#include "GUIDialog.h" +#include "FileItem.h" + +class CGUIDialogBoxeeLiveTvCtx : public CGUIDialog +{ +public: + CGUIDialogBoxeeLiveTvCtx(); + virtual ~CGUIDialogBoxeeLiveTvCtx(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + virtual void Render(); + +protected: + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + +private: + int LoadEPG(); + bool HandleClick(CGUIMessage& message); + void HandleClickedChannel(); + bool RefreshEPG(int direction); + + void SwitchChannel(int channel_id); + + void LoadTimeSlot(); + + CFileItemList m_listEPG; + CFileItemPtr m_selectedChannel; + + CStopWatch m_programWatchedTimer; + + LiveTvModel m_model; +}; + + +#endif + +#endif // GUIDIALOGBOXEELIVETVCTX_H + diff --git a/xbmc/GUIDialogBoxeeLiveTvEditChannels.cpp b/xbmc/GUIDialogBoxeeLiveTvEditChannels.cpp new file mode 100755 index 00000000..11bb5e1d --- /dev/null +++ b/xbmc/GUIDialogBoxeeLiveTvEditChannels.cpp @@ -0,0 +1,380 @@ +#include "GUIDialogBoxeeLiveTvEditChannels.h" + +#ifdef HAS_DVB +#include "Util.h" +#include +#include "Application.h" +#include "GUIWindowManager.h" +#include "cores/dvb/dvbmanager.h" +#include "utils/log.h" +#include "GUIListContainer.h" +#include "LiveTvModel.h" +#include "FileItem.h" +#include "GUIDialogProgress.h" +#include "lib/libBoxee/bxconfiguration.h" +#include "lib/libBoxee/bxutils.h" +#include "LocalizeStrings.h" +#include "GUIEditControl.h" + +using namespace BOXEE; + +#define GROUP_CHANNEL_LINEUP 1 +#define GROUP_EDIT_CHANNEL 2 +#define CONTROL_LIST_CHANNELS 46 +#define CONTROL_BUTTON_EDIT 61 + +#define CONTROL_EDIT_CHANNEL_NAME 21 +#define CONTROL_LIST_SCHEDULES 22 + +CGUIDialogBoxeeLiveTvEditChannels::CGUIDialogBoxeeLiveTvEditChannels() : CGUIDialog(WINDOW_DIALOG_BOXEE_LIVETV_EDIT_CHANNELS, "boxee_livetv_edit_channels.xml") +{ + m_scheduleLoaded = false; + m_selectedChannelItem = 0; +} + +CGUIDialogBoxeeLiveTvEditChannels::~CGUIDialogBoxeeLiveTvEditChannels() +{ +} + +void CGUIDialogBoxeeLiveTvEditChannels::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + if (!LoadChannelsList()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLiveTvEditChannels::OnInitWindow - FAILED to load channels (ltvc)"); + Close(); + return; + } + + m_dirty = false; +} + +void CGUIDialogBoxeeLiveTvEditChannels::OnDeinitWindow(int nextWindowID) +{ + if (m_dirty) + { +#ifdef HAS_SERVER_OTA + CGUIDialogProgress* progress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); + progress->StartModal(); + progress->Progress(); + + if (!DVBManager::GetInstance().GetChannels().SaveChannelsToServer()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLiveTvEditChannels::OnDeinitWindow - failed to save channels to server"); + } + + // Reload the EPG, in case the user changed channel info + DVBManager::GetInstance().GetEpgServerLoader().RequestLoad(); + + progress->Close(); +#endif + } + + CGUIDialog::OnDeinitWindow(nextWindowID); +} + +bool CGUIDialogBoxeeLiveTvEditChannels::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_LABEL_BIND: + { + if (message.GetPointer() && message.GetControlId() == 0) + { + CFileItemList* items = (CFileItemList*)message.GetPointer(); + delete items; + return true; + } + } + break; + + case GUI_MSG_CLICKED: + { + if (message.GetSenderId() == CONTROL_LIST_CHANNELS) + { + return HandleClickedChannel(); + } + else if (message.GetSenderId() == CONTROL_BUTTON_EDIT) + { + return HandleClickedEditChannelButton(); + } + else if (message.GetSenderId() == CONTROL_LIST_SCHEDULES) + { + return HandleClickedEditChannelList(); + } + } + break; + + default: + break; + } + + return CGUIDialog::OnMessage(message); +} + +bool CGUIDialogBoxeeLiveTvEditChannels::OnAction(const CAction& action) +{ + switch (action.id) + { + case ACTION_PARENT_DIR: + case ACTION_PREVIOUS_MENU: + { + CGUIBaseContainer* pControl = (CGUIBaseContainer*)GetControl(GROUP_CHANNEL_LINEUP); + if (pControl && pControl->IsVisible()) + { + Close(); + } + else + { + CloseScheduleList(); + } + + return true; + } + break; + + default: + break; + } + + return CGUIDialog::OnAction(action); +} + +void CGUIDialogBoxeeLiveTvEditChannels::CloseScheduleList() +{ + // Get the channel that was selected in the first screen + CGUIBaseContainer* pContainer = (CGUIBaseContainer*)GetControl(CONTROL_LIST_CHANNELS); + CGUIListItemPtr clickedChannel = pContainer->GetSelectedItemPtr(); + DvbChannelPtr channel = DVBManager::GetInstance().GetChannels().GetChannelByIndex(clickedChannel->GetPropertyInt("channel-id")); + CStdString oldChannelName = channel->GetChannelLabel().Trim(); + + // Get the channel information as the user typed or selected it + pContainer = (CGUIBaseContainer*)GetControl(CONTROL_LIST_SCHEDULES); + clickedChannel = pContainer->GetSelectedItemPtr(); + CStdString newChannelNumber = clickedChannel->GetProperty("ChannelNumber"); + CStdString newChannelName = ((CGUIEditControl*)GetControl(CONTROL_EDIT_CHANNEL_NAME))->GetLabel2(); + +// printf("****** NUMBER: |%s| |%s|\n", channel->GetChannelNumber().c_str(), newChannelNumber.c_str()); +// printf("****** NAME: |%s| |%s|\n", oldChannelName.c_str(), newChannelName.c_str()); + + bool somethingChanged = false; + if (channel->GetChannelNumber() != newChannelNumber) + { + // If the user clicked on the "Unknown schedule", revert to original values + if (clickedChannel->HasProperty("OriginalChannelInfo")) + { + newChannelNumber = ""; + } + + channel->SetChannelManualNumber(newChannelNumber); + channel->SetChannelManualName(newChannelName); + + somethingChanged = true; + } + else if (oldChannelName != newChannelName) + { + channel->SetChannelManualName(newChannelName); + somethingChanged = true; + } + + if (somethingChanged) + { + m_dirty = true; + LoadChannelsList(); + } + + SET_CONTROL_HIDDEN(GROUP_EDIT_CHANNEL); + SET_CONTROL_VISIBLE(GROUP_CHANNEL_LINEUP); + SET_CONTROL_FOCUS(CONTROL_LIST_CHANNELS, m_selectedChannelItem); +} + +bool CGUIDialogBoxeeLiveTvEditChannels::LoadChannelsList() +{ + LiveTvModel model; + LiveTvModelChannelsType channels = model.GetChannels(); + + CFileItemList channelsList; + + CStdString currentChannelNumber = DVBManager::GetInstance().GetCurrentChannel()->GetChannelNumber(); + int selectedItem = 0; + + foreach (LiveTvModelChannel channel, channels) + { + CStdString label = channel.number; + if (!label.IsEmpty()) + label += " "; + label += channel.label; + + CFileItemPtr channelItem(new CFileItem(label)); + channelItem->SetProperty("ChannelName", channel.label); + channelItem->SetProperty("ChannelEnabled", channel.enabled); + channelItem->SetProperty("channel-id", channel.id); + + if (channel.number == currentChannelNumber) + selectedItem = channelsList.Size(); + + channelsList.Add(channelItem); + } + + CGUIMessage msgBind(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LIST_CHANNELS, 0,0, &channelsList); + OnMessage(msgBind); + + SET_CONTROL_FOCUS(CONTROL_LIST_CHANNELS, selectedItem); + + return true; +} + +bool CGUIDialogBoxeeLiveTvEditChannels::HandleClickedChannel() +{ + CGUIBaseContainer* pContainer = (CGUIBaseContainer*)GetControl(CONTROL_LIST_CHANNELS); + if (!pContainer) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLiveTvEditChannels::HandleClickedChannel - FAILED to get CONTROL_LIST_CHANNELS object (ltvc)"); + return true; + } + + CGUIListItemPtr clickedChannel = pContainer->GetSelectedItemPtr(); + clickedChannel->SetProperty("ChannelEnabled", !clickedChannel->GetPropertyBOOL("ChannelEnabled")); + + DvbChannelPtr channel = DVBManager::GetInstance().GetChannels().GetChannelByIndex(clickedChannel->GetPropertyInt("channel-id")); + channel->SetEnabled(!channel->IsEnabled()); + + m_dirty = true; + + return true; +} + +bool CGUIDialogBoxeeLiveTvEditChannels::HandleClickedEditChannelButton() +{ + m_scheduleLoaded = LoadAvailableChannelList(); + if (!m_scheduleLoaded) + { + // TBD ERROR MSG + return false; + } + + CGUIBaseContainer* pContainer = (CGUIBaseContainer*)GetControl(CONTROL_LIST_CHANNELS); + if (!pContainer) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLiveTvEditChannels::HandleClickedChannel - FAILED to get CONTROL_LIST_CHANNELS object (ltvc)"); + return true; + } + + m_selectedChannelItem = pContainer->GetSelectedItem(); + CGUIListItemPtr clickedChannel = pContainer->GetSelectedItemPtr(); + DvbChannelPtr channel = DVBManager::GetInstance().GetChannels().GetChannelByIndex(clickedChannel->GetPropertyInt("channel-id")); + if (channel) + { + SET_CONTROL_LABEL2(CONTROL_EDIT_CHANNEL_NAME, channel->GetChannelLabel().Trim()); + } + + CFileItemList schedulesList; + int selectedItem = 0; + + CFileItemPtr unknownSchedule(new CFileItem(g_localizeStrings.Get(90321))); + unknownSchedule->SetProperty("ChannelNumber", channel->GetVirtualChannel()); + unknownSchedule->SetProperty("ChannelName", channel->GetServiceName()); + unknownSchedule->SetProperty("OriginalChannelInfo", true); + schedulesList.Add(unknownSchedule); + + foreach (Schedule schedule, m_schedules) + { + CStdString label; + label.Format("%s %s", schedule.first.c_str(), schedule.second.c_str()); + CFileItemPtr scheduleItem(new CFileItem(label)); + scheduleItem->SetProperty("ChannelNumber", schedule.first); + scheduleItem->SetProperty("ChannelName", schedule.second); + + if (schedule.first == channel->GetChannelNumber()) + selectedItem = schedulesList.Size(); + + schedulesList.Add(scheduleItem); + } + + CGUIMessage msgBind(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LIST_SCHEDULES, 0,0, &schedulesList); + OnMessage(msgBind); + + CGUIMessage winmsg(GUI_MSG_UNMARK_ALL_ITEMS, GetID(), CONTROL_LIST_SCHEDULES); + OnMessage(winmsg); + + CGUIMessage winmsg1(GUI_MSG_MARK_ITEM, GetID(),CONTROL_LIST_SCHEDULES, selectedItem); + OnMessage(winmsg1); + + SET_CONTROL_FOCUS(CONTROL_LIST_SCHEDULES, selectedItem); + + SET_CONTROL_HIDDEN(GROUP_CHANNEL_LINEUP); + SET_CONTROL_VISIBLE(GROUP_EDIT_CHANNEL); + SET_CONTROL_FOCUS(CONTROL_EDIT_CHANNEL_NAME, 0); + + return true; +} + +bool CGUIDialogBoxeeLiveTvEditChannels::HandleClickedEditChannelList() +{ + CGUIBaseContainer* pContainer = (CGUIBaseContainer*)GetControl(CONTROL_LIST_SCHEDULES); + if (!pContainer) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLiveTvEditChannels::HandleClickedEditChannelList - FAILED to get CONTROL_LIST_CHANNELS object (ltvc)"); + return true; + } + + CGUIListItemPtr clickedChannel = pContainer->GetSelectedItemPtr(); + int selctedItemIndex = pContainer->GetSelectedItem(); + + CGUIMessage winmsg(GUI_MSG_UNMARK_ALL_ITEMS, GetID(), CONTROL_LIST_SCHEDULES); + OnMessage(winmsg); + + CGUIMessage winmsg1(GUI_MSG_MARK_ITEM, GetID(),CONTROL_LIST_SCHEDULES,selctedItemIndex); + OnMessage(winmsg1); + + SET_CONTROL_LABEL2(CONTROL_EDIT_CHANNEL_NAME, clickedChannel->GetProperty("ChannelName")); + + return true; +} + +bool CGUIDialogBoxeeLiveTvEditChannels::ScheduleComparator(const Schedule &left, const Schedule &right) +{ + return (CUtil::VersionCompare(left.first, right.first) < 0); +} + +bool CGUIDialogBoxeeLiveTvEditChannels::LoadAvailableChannelList() +{ + if (m_scheduleLoaded) + return true; + + CStdString strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.ApiGetAvailableChannels", "http://app.boxee.tv/epg/channels/"); + Json::Value jResponse; + int returnCode; + + if(BOXEE::BXUtils::PerformJSONGetRequestInBG(strUrl,jResponse,returnCode) != JOB_SUCCEEDED) + { + return false; + } + + Json::Value jStations = jResponse["stations"]; + + if (!jStations.isArray()) + { + return false; + } + + if (jStations.size() == 0) + { + return false; + } + + for (size_t j = 0; j < jStations.size(); j++) + { + Json::Value station = jStations[(int) j]; + m_schedules.push_back(Schedule(station["channel"].asString(), station["call_sign"].asString())); + } + + std::sort(m_schedules.begin(), m_schedules.end(), CGUIDialogBoxeeLiveTvEditChannels::ScheduleComparator); + + return true; + +} + +#endif + diff --git a/xbmc/GUIDialogBoxeeLiveTvEditChannels.h b/xbmc/GUIDialogBoxeeLiveTvEditChannels.h new file mode 100755 index 00000000..cb85c7c1 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLiveTvEditChannels.h @@ -0,0 +1,45 @@ +#ifndef GUIDIALOGBOXEELIVETVEDITCHANNELS_H +#define GUIDIALOGBOXEELIVETVEDITCHANNELS_H + +#include "system.h" + +#ifdef HAS_DVB + +#include "GUIDialog.h" +#include + +class CGUIDialogBoxeeLiveTvEditChannels : public CGUIDialog +{ +public: + + CGUIDialogBoxeeLiveTvEditChannels(); + virtual ~CGUIDialogBoxeeLiveTvEditChannels(); + virtual bool OnMessage(CGUIMessage& message); + +protected: + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + bool OnAction(const CAction& action); + +private: + bool LoadChannelsList(); + bool HandleClickedChannel(); + bool HandleClickedEditChannelButton(); + bool HandleClickedEditChannelList(); + bool LoadAvailableChannelList(); + void CloseScheduleList(); + + bool m_dirty; + bool m_scheduleLoaded; + int m_selectedChannelItem; + + typedef std::pair Schedule; + static bool ScheduleComparator(const Schedule &left, const Schedule &right); + std::vector m_schedules; +}; + + +#endif + +#endif // GUIDIALOGBOXEELIVETVEDITCHANNELS_H + diff --git a/xbmc/GUIDialogBoxeeLiveTvInfo.cpp b/xbmc/GUIDialogBoxeeLiveTvInfo.cpp new file mode 100755 index 00000000..bf674d6d --- /dev/null +++ b/xbmc/GUIDialogBoxeeLiveTvInfo.cpp @@ -0,0 +1,83 @@ +#include "GUIDialogBoxeeLiveTvInfo.h" + +#ifdef HAS_DVB + +#include +#include "BoxeeUtils.h" +#include "GUIWindowManager.h" +#include "GUIInfoManager.h" +#include "cores/dvb/dvbmanager.h" +#include "cores/dvb/epgstore.h" +#include "GUISettings.h" +#include "utils/log.h" +#include "GUIWindowBoxeeLiveTv.h" +#include "GUIDialogBoxeeLiveTvEditChannels.h" + +#define CONTROL_FAKE_LIST 5000 +#define CONTROL_BUTTON_LIST 3333 +#define CONTROL_TUNE_BUTTON 3330 + +CGUIDialogBoxeeLiveTvInfo::CGUIDialogBoxeeLiveTvInfo() : CGUIDialog(WINDOW_DIALOG_BOXEE_LIVETV_INFO, "boxee_livetv_info.xml") +{ + m_requestTune = false; +} + +CGUIDialogBoxeeLiveTvInfo::~CGUIDialogBoxeeLiveTvInfo() +{ +} + +void CGUIDialogBoxeeLiveTvInfo::SetProgram(CFileItemPtr item) +{ + m_item = item; +} + +void CGUIDialogBoxeeLiveTvInfo::OnInitWindow() +{ + CFileItemList list; + list.Add(m_item); + + CGUIMessage msgBind(GUI_MSG_LABEL_BIND, GetID(), CONTROL_FAKE_LIST, 0, 0, &list); + OnMessage(msgBind); + + SET_CONTROL_FOCUS(CONTROL_BUTTON_LIST, 0); +} + +bool CGUIDialogBoxeeLiveTvInfo::OnAction(const CAction& action) +{ + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeeLiveTvInfo::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_LABEL_BIND: + { + if (message.GetPointer() && message.GetControlId() == 0) + { + CFileItemList *items = (CFileItemList *)message.GetPointer(); + delete items; + return true; + } + } + break; + + case GUI_MSG_CLICKED: + { + if (message.GetSenderId() == CONTROL_TUNE_BUTTON) + { + m_requestTune = true; + Close(); + } + } + break; + + default: + break; + } + + return CGUIDialog::OnMessage(message); +} + +#endif + diff --git a/xbmc/GUIDialogBoxeeLiveTvInfo.h b/xbmc/GUIDialogBoxeeLiveTvInfo.h new file mode 100755 index 00000000..6a47541f --- /dev/null +++ b/xbmc/GUIDialogBoxeeLiveTvInfo.h @@ -0,0 +1,33 @@ +#ifndef GUIDIALOGBOXEELIVETVINFO_H +#define GUIDIALOGBOXEELIVETVINFO_H + +#include "system.h" + +#ifdef HAS_DVB + +#include "LiveTvModel.h" +#include "GUIDialog.h" +#include "FileItem.h" + +class CGUIDialogBoxeeLiveTvInfo : public CGUIDialog +{ +public: + CGUIDialogBoxeeLiveTvInfo(); + void SetProgram(CFileItemPtr item); + + virtual ~CGUIDialogBoxeeLiveTvInfo(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + bool IsRequestTune() { return m_requestTune; } + +protected: + virtual void OnInitWindow(); + + CFileItemPtr m_item; + bool m_requestTune; +}; + + +#endif + +#endif // GUIDIALOGBOXEELIVETVINFO_H diff --git a/xbmc/GUIDialogBoxeeLiveTvScan.cpp b/xbmc/GUIDialogBoxeeLiveTvScan.cpp new file mode 100644 index 00000000..3f177a01 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLiveTvScan.cpp @@ -0,0 +1,296 @@ +#include "GUIDialogBoxeeLiveTvScan.h" + +#ifdef HAS_DVB + +#include "GUIWindowManager.h" +#include "GUIDialogProgress.h" +#include "utils/log.h" +#include "LocalizeStrings.h" +#include "dvbmanager.h" +#include "GUISettings.h" +#include "Settings.h" +#include "Application.h" + +#define CONTROL_GROUP_SCANNING 50 +#define CONTROL_LABEL_SCANNING 51 +#define CONTROL_PROGRESS_SCANNING 52 +#define CONTROL_GROUP_SCAN_OK 60 +#define CONTROL_LABEL_CHANNEL_COUNT 61 +#define CONTROL_BUTTON_GO_TO_LIVETV 62 +#define CONTROL_GROUP_SCAN_NO_CHANNELS 70 +#define CONTROL_BUTTON_TRY_AGAIN 71 +#define CONTROL_GROUP_CANCEL_SCAN 80 +#define CONTROL_BUTTON_CONFIRM_CANCEL 81 +#define CONTROL_GROUP_NO_INTERNET 90 +#define CONTROL_BUTTON_CLOSE 91 + +CGUIDialogBoxeeLiveTvScan::CGUIDialogBoxeeLiveTvScan() : CGUIDialog(WINDOW_OTA_SCANNING, "boxee_livetv_scan.xml") +{ +} + +CGUIDialogBoxeeLiveTvScan::~CGUIDialogBoxeeLiveTvScan() +{ +} + +void CGUIDialogBoxeeLiveTvScan::OnInitWindow() +{ + g_guiSettings.SetBool("ota.scanned", false); + g_settings.Save(); + + m_requestGoToLiveTv = false; + m_scanStarted = false; + m_noChannelsFound = false; + + CGUIDialog::OnInitWindow(); + + if (!g_application.IsConnectedToInternet()) + { + ShowNoInternet(); + } +} + +bool CGUIDialogBoxeeLiveTvScan::OnAction(const CAction& action) +{ + if (action.id != ACTION_PREVIOUS_MENU) + { + return CGUIDialog::OnAction(action); + } + + // Cancel scan? + if (GetControl(CONTROL_GROUP_SCANNING)->IsVisible()) + { + ConfirmCancel(); + return true; + } + // Don't cancel, show scanning progress + else if (GetControl(CONTROL_GROUP_CANCEL_SCAN)->IsVisible()) + { + ShowScanning(); + return true; + } + else + { + Close(); + return true; + } + + return CGUIDialog::OnAction(action); +} + + +bool CGUIDialogBoxeeLiveTvScan::OnMessage(CGUIMessage& message) +{ + if (message.GetMessage() != GUI_MSG_CLICKED) + return CGUIDialog::OnMessage(message); + + switch (message.GetSenderId()) + { + case CONTROL_BUTTON_CONFIRM_CANCEL: + CancelScan(); + return true; + break; + + case CONTROL_BUTTON_GO_TO_LIVETV: + Close(); + m_requestGoToLiveTv = true; + return true; + break; + + case CONTROL_BUTTON_TRY_AGAIN: + StartScan(); + return true; + break; + + case CONTROL_BUTTON_CLOSE: + Close(); + return true; + break; + } + + return CGUIDialog::OnMessage(message); +} + +void CGUIDialogBoxeeLiveTvScan::HideAll() +{ + SET_CONTROL_HIDDEN(CONTROL_GROUP_SCANNING); + SET_CONTROL_HIDDEN(CONTROL_GROUP_CANCEL_SCAN); + SET_CONTROL_HIDDEN(CONTROL_GROUP_SCAN_NO_CHANNELS); + SET_CONTROL_HIDDEN(CONTROL_GROUP_SCAN_OK); + SET_CONTROL_HIDDEN(CONTROL_GROUP_NO_INTERNET); +} + +void CGUIDialogBoxeeLiveTvScan::CancelScan() +{ + CGUIDialogProgress* progress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); + progress->StartModal(); + progress->Progress(); + + if (!DVBManager::GetInstance().CancelScan()) + { + CLog::Log(LOGERROR, "CGUIDialogBoxeeLiveTvScan::CancelScan failed to cancel scan"); + return; + } +} + +void CGUIDialogBoxeeLiveTvScan::StartScan() +{ + ShowScanning(); + + if (!DVBManager::GetInstance().StartScan()) + { + CLog::Log(LOGERROR, "CGUIDialogBoxeeLiveTvScan::StartScan failed to start scan"); + return; + } +} + +void CGUIDialogBoxeeLiveTvScan::ConfirmCancel() +{ + HideAll(); + SET_CONTROL_VISIBLE(CONTROL_GROUP_CANCEL_SCAN); + SET_CONTROL_FOCUS(CONTROL_BUTTON_CONFIRM_CANCEL, 0); +} + +void CGUIDialogBoxeeLiveTvScan::ShowScanning() +{ + HideAll(); + SET_CONTROL_VISIBLE(CONTROL_GROUP_SCANNING); + SET_CONTROL_FOCUS(CONTROL_PROGRESS_SCANNING, 0); +} + +void CGUIDialogBoxeeLiveTvScan::ShowNoChannels() +{ + m_noChannelsFound = true; + Close(); +} + +void CGUIDialogBoxeeLiveTvScan::ShowNoInternet() +{ + HideAll(); + SET_CONTROL_VISIBLE(CONTROL_GROUP_NO_INTERNET); + SET_CONTROL_FOCUS(CONTROL_BUTTON_CLOSE, 0); +} + +void CGUIDialogBoxeeLiveTvScan::ShowDone() +{ + DVBManager::GetInstance().ClearScanner(); + + int channelCount = DVBManager::GetInstance().GetChannels().Size(); + + if (channelCount > 0) + { + HideAll(); + SET_CONTROL_VISIBLE(CONTROL_GROUP_SCAN_OK); + + CStdString str; + str.Format(g_localizeStrings.Get(58003), channelCount); + SET_CONTROL_LABEL(CONTROL_LABEL_CHANNEL_COUNT, str); + + SET_CONTROL_FOCUS(CONTROL_BUTTON_GO_TO_LIVETV, 0); + } + else + { + ShowNoChannels(); + } +} + +void CGUIDialogBoxeeLiveTvScan::Render() +{ + if (!g_application.IsConnectedToInternet()) + { + CGUIDialog::Render(); + return; + } + + // No screen saver should appear when in this dialog + g_application.ResetScreenSaver(); + + static Uint32 lastCheck1 = SDL_GetTicks(); + static Uint32 lastCheck2 = SDL_GetTicks(); + static DvbScanner::ScanState lastScanState = DvbScanner::SCAN_NOT_RUNNING; + + Uint32 now = SDL_GetTicks(); + + if (now - lastCheck1 < 500) + { + CGUIDialog::Render(); + return; + } + + lastCheck1 = now; + + // Animate the ellipsis + static int nofDots = 3; + static const char* dotsStr[] = { "", ".", "..", "..." }; + + if (GetControl(CONTROL_LABEL_SCANNING)->IsVisible()) + { + CStdString label; + nofDots = (nofDots + 1) % 4; + label.Format("[B]%s%s[/B]", g_localizeStrings.Get(58001).c_str(), dotsStr[nofDots]); + SET_CONTROL_LABEL(CONTROL_LABEL_SCANNING, label); + } + + if (now - lastCheck2 < 2000) + { + CGUIDialog::Render(); + return; + } + + lastCheck2 = now; + + if (!m_scanStarted) + { + m_scanStarted = true; + StartScan(); + } + + + DvbScanner::ScanState scanState = DVBManager::GetInstance().GetScanState(); + if (lastScanState == scanState) + { + CGUIDialog::Render(); + return; + } + + lastScanState = scanState; + + CLog::Log(LOGDEBUG, "CGUIDialogBoxeeLiveTvScan::Render switched to scan state=%d", lastScanState); + + switch (scanState) + { + case DvbScanner::SCAN_STARTING: + case DvbScanner::SCAN_RUNNING: + { + if (!GetControl(CONTROL_GROUP_CANCEL_SCAN)) + ShowScanning(); + } + break; + case DvbScanner::SCAN_FAILED: + { + ShowNoChannels(); + } + break; + case DvbScanner::SCAN_CANCELED: + { + DVBManager::GetInstance().ClearScanner(); + g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS)->Close(); + Close(); + return; + } + break; + case DvbScanner::SCAN_DONE: + { + ShowDone(); + } + break; + default: + { + // do nothing + } + break; + } + + CGUIDialog::Render(); +} + +#endif diff --git a/xbmc/GUIDialogBoxeeLiveTvScan.h b/xbmc/GUIDialogBoxeeLiveTvScan.h new file mode 100644 index 00000000..4a04db5c --- /dev/null +++ b/xbmc/GUIDialogBoxeeLiveTvScan.h @@ -0,0 +1,38 @@ +#pragma once + +#include "system.h" + +#ifdef HAS_DVB + +#include "GUIDialog.h" + +class CGUIDialogBoxeeLiveTvScan : public CGUIDialog +{ +public: + CGUIDialogBoxeeLiveTvScan(); + virtual ~CGUIDialogBoxeeLiveTvScan(); + virtual void OnInitWindow(); + virtual bool OnAction(const CAction& action); + virtual bool OnMessage(CGUIMessage& message); + virtual void Render(); + + bool RequestedGoToLiveTv() { return m_requestGoToLiveTv; } + bool NoChannelsFound() { return m_noChannelsFound; } + + +private: + void HideAll(); + void StartScan(); + void CancelScan(); + void ShowScanning(); + void ShowNoChannels(); + void ShowNoInternet(); + void ShowDone(); + void ConfirmCancel(); + + bool m_requestGoToLiveTv; + bool m_noChannelsFound; + bool m_scanStarted; +}; + +#endif diff --git a/xbmc/GUIDialogBoxeeLoginEditExistingUser.cpp b/xbmc/GUIDialogBoxeeLoginEditExistingUser.cpp new file mode 100644 index 00000000..ad7badbe --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginEditExistingUser.cpp @@ -0,0 +1,359 @@ +#include "GUIDialogBoxeeLoginEditExistingUser.h" +#include "GUIWindowManager.h" +#include "BoxeeLoginManager.h" +#include "utils/log.h" +#include "GUIRadioButtonControl.h" +#include "GUIEditControl.h" +#include "GUIImage.h" +#include "Application.h" +#include "GUIDialogOK2.h" +#include "BoxeeLoginWizardManager.h" +#include "GUIUserMessages.h" +#include "lib/libBoxee/bxcredentials.h" +#include "lib/libBoxee/boxee.h" + +#define PASSWORD_EDIT_CONTROL_ID 8602 +#define REMEMBER_PASSWORD_CONTROL_ID 8603 +#define LOGIN_BUTTON_CONTROL_ID 8604 +#define REMOVE_BUTTON_CONTROL_ID 8606 +#define SHOW_PASSWORD_CONTROL_ID 8607 + +#define USERNAME_LABEL_CONTROL_ID 8610 +#define USERNAME_THUMB_CONTROL_ID 8650 + +#define CHECK_DIALOG_PASSWORD_FILED_DELAY 15 + +CGUIDialogBoxeeLoginEditExistingUser::CGUIDialogBoxeeLoginEditExistingUser() : CGUIDialog(WINDOW_DIALOG_BOXEE_LOGIN_EDIT_EXISTING_USER,"boxee_login_edit_existing_user.xml") +{ + m_checkPasswordFieldDelay = 0; +} + +CGUIDialogBoxeeLoginEditExistingUser::~CGUIDialogBoxeeLoginEditExistingUser() +{ + +} + +void CGUIDialogBoxeeLoginEditExistingUser::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + m_checkPasswordFieldDelay = 0; + m_needToCheckEmptyPassword = true; + + SET_CONTROL_LABEL(USERNAME_LABEL_CONTROL_ID,m_username); + ((CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID))->SetLabel2(m_password); + ((CGUIRadioButtonControl*)GetControl(REMEMBER_PASSWORD_CONTROL_ID))->SetSelected(m_rememberPassword); + ((CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID))->SetInputType(CGUIEditControl::INPUT_TYPE_PASSWORD,0); + ((CGUIImage*)GetControl(USERNAME_THUMB_CONTROL_ID))->SetFileName(m_thumb); + + if (!m_password.IsEmpty()) + { + SET_CONTROL_HIDDEN(SHOW_PASSWORD_CONTROL_ID); + } + else + { + SET_CONTROL_VISIBLE(SHOW_PASSWORD_CONTROL_ID); + m_needToCheckEmptyPassword = false; + } + + SET_CONTROL_FOCUS(PASSWORD_EDIT_CONTROL_ID,0); +} + +bool CGUIDialogBoxeeLoginEditExistingUser::OnAction(const CAction& action) +{ + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeeLoginEditExistingUser::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + if (HandleClick(message)) + { + // continue to stay in this screen + return true; + } + } + break; + } + + return CGUIDialog::OnMessage(message); +} + +void CGUIDialogBoxeeLoginEditExistingUser::Render() +{ + m_checkPasswordFieldDelay++; + + if (m_needToCheckEmptyPassword && (m_checkPasswordFieldDelay > CHECK_DIALOG_PASSWORD_FILED_DELAY)) + { + m_checkPasswordFieldDelay = 0; + + if (IsPasswordFiledEmpty()) + { + SET_CONTROL_VISIBLE(SHOW_PASSWORD_CONTROL_ID); + m_needToCheckEmptyPassword = false; + } + } + + CGUIDialog::Render(); +} + +bool CGUIDialogBoxeeLoginEditExistingUser::IsPasswordFiledEmpty() +{ + CGUIEditControl* pPasswordEditControl = (CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID); + if (!pPasswordEditControl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginEditExistingUser::IsPasswordFiledEmpty - FAILED to PASSWORD_EDIT_CONTROL (login)"); + return false; + } + + CStdString password = pPasswordEditControl->GetLabel2(); + + return password.IsEmpty(); +} + +bool CGUIDialogBoxeeLoginEditExistingUser::HandleClick(CGUIMessage& message) +{ + int iControl = message.GetSenderId(); + + switch(iControl) + { + case REMEMBER_PASSWORD_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginEditExistingUser::HandleClick - handling click on [Control=%d=REMEMBER_PASSWORD] (login)",iControl); + m_rememberPassword = ((CGUIRadioButtonControl*)GetControl(REMEMBER_PASSWORD_CONTROL_ID))->IsSelected(); + return true; + } + break; + case SHOW_PASSWORD_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginEditExistingUser::HandleClick - handling click on [Control=%d=SHOW_PASSWORD] (login)",iControl); + + CGUIRadioButtonControl* pControl = (CGUIRadioButtonControl*)GetControl(SHOW_PASSWORD_CONTROL_ID); + if (pControl) + { + if (pControl->IsSelected()) + { + ((CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID))->SetInputType(CGUIEditControl::INPUT_TYPE_TEXT,0); + } + else + { + ((CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID))->SetInputType(CGUIEditControl::INPUT_TYPE_PASSWORD,0); + } + } + + return true; + } + break; + case LOGIN_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginEditExistingUser::HandleClick - handling click on [Control=%d=LOGIN_BUTTON_CONTROL_ID] (login)",iControl); + + if (OnLoginButton()) + { + Close(); + } + + return true; + } + break; + case REMOVE_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginEditExistingUser::HandleClick - handling click on [Control=%d=REMOVE_BUTTON_CONTROL_ID] (login)",iControl); + + if (OnRemoveButton()) + { + Close(); + } + + // stay in the dialog + return true; + } + break; + } + + return false; +} + +bool CGUIDialogBoxeeLoginEditExistingUser::OnLoginButton() +{ + if (!CanExecuteLogin()) + { + // Error logs was written in CanExecuteLogin() + return false; + } + + CStdString password = ((CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID))->GetLabel2(); + if(password != m_password) + { + // user changed the password in the editbox -> need to encode and save it + password = CBoxeeLoginManager::EncodePassword(password); + m_password = password; + } + + BOXEE::BXLoginStatus loginStatus = CBoxeeLoginManager::DoLogin(m_userId,m_password,m_rememberPassword,m_userProfileIndex); + + if (loginStatus == BOXEE::LOGIN_SUCCESS) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginEditExistingUser::OnLoginButton - Login Succeeded [loginStatus=%d=LOGIN_SUCCESS] -> Going to call FinishSuccessfulLogin(true) (login)",loginStatus); + g_application.GetBoxeeLoginManager().FinishSuccessfulLogin(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginEditExistingUser::OnLoginButton - Going to WINDOW_HOME (login)"); + g_windowManager.ChangeActiveWindow(WINDOW_HOME); + + return true; + } + + ((CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID))->SetLabel2(""); + SET_CONTROL_FOCUS(PASSWORD_EDIT_CONTROL_ID,0); + + return false; +} + +bool CGUIDialogBoxeeLoginEditExistingUser::CanExecuteLogin() +{ + bool isConnectedToInternet = g_application.IsConnectedToInternet(); + if(!isConnectedToInternet) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginEditExistingUser::CanExecuteLogin - can't add user since [isConnectedToInternet=%d] (login)",isConnectedToInternet); + CGUIDialogOK2::ShowAndGetInput(53743, 53744); + return false; + } + + CStdString password = ((CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID))->GetLabel2(); + + if(password.IsEmpty()) + { + // Case of empty Password field + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginEditExistingUser::CanExecuteLogin - [password=%s] is empty (login)",password.c_str()); + CGUIDialogOK2::ShowAndGetInput(20068,51059); + SET_CONTROL_FOCUS(PASSWORD_EDIT_CONTROL_ID,0); + return false; + } + + return true; +} + +bool CGUIDialogBoxeeLoginEditExistingUser::OnRemoveButton() +{ + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginEditExistingUser::OnRemoveButton - Enter function. [m_userSelectedIndex=%d][username=%s] (login)",m_userProfileIndex,m_username.c_str()); + + bool succeeded = g_settings.DeleteProfile(m_userProfileIndex); + + if (succeeded) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginEditExistingUser::OnRemoveButton - User [username=%s] was successfully removed (login)",m_username.c_str()); + } + else + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginEditExistingUser::OnRemoveButton - FAILED to remove user [username=%s] (login)",m_username.c_str()); + } + + CGUIMessage msg(GUI_MSG_UPDATE, WINDOW_LOGIN_SCREEN, 0); + g_windowManager.SendThreadMessage(msg); + + return succeeded; + +} + +bool CGUIDialogBoxeeLoginEditExistingUser::HandleClickNext() +{ + return true; +} + +bool CGUIDialogBoxeeLoginEditExistingUser::HandleClickBack() +{ + return true; +} + +void CGUIDialogBoxeeLoginEditExistingUser::SetUsername(const CStdString& username) +{ + m_username = username; +} + +CStdString CGUIDialogBoxeeLoginEditExistingUser::GetUsername() +{ + return m_username; +} + +void CGUIDialogBoxeeLoginEditExistingUser::SetUserId(const CStdString& userId) +{ + m_userId = userId; +} + +CStdString CGUIDialogBoxeeLoginEditExistingUser::GetUserId() +{ + return m_userId; +} + +void CGUIDialogBoxeeLoginEditExistingUser::SetPassword(const CStdString& password) +{ + m_password = password; +} + +CStdString CGUIDialogBoxeeLoginEditExistingUser::GetPassword() +{ + return m_password; +} + +void CGUIDialogBoxeeLoginEditExistingUser::SetRememberPassword(bool rememberPassword) +{ + m_rememberPassword = rememberPassword; +} + +bool CGUIDialogBoxeeLoginEditExistingUser::IsRememberPassword() +{ + return m_rememberPassword; +} + +void CGUIDialogBoxeeLoginEditExistingUser::SetUserProfileIndex(int userProfileIndex) +{ + m_userProfileIndex = userProfileIndex; +} + +int CGUIDialogBoxeeLoginEditExistingUser::GetUserProfileIndex() +{ + return m_userProfileIndex; +} + +void CGUIDialogBoxeeLoginEditExistingUser::SetThumb(const CStdString& thumb) +{ + m_thumb = thumb; +} + +CStdString CGUIDialogBoxeeLoginEditExistingUser::GetThumb() +{ + return m_thumb; +} + +bool CGUIDialogBoxeeLoginEditExistingUser::Show(int userProfileIndex, const CStdString& username, const CStdString& userId, CStdString& password, bool& rememberPassword, const CStdString& thumb) +{ + if(userProfileIndex >= (int)g_settings.m_vecProfiles.size()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginEditExistingUser::Show - Could not find profile for [m_userSelectedIndex=%d]. [VecProfilesSize=%zu] (login)",userProfileIndex,g_settings.m_vecProfiles.size()); + return false; + } + + CGUIDialogBoxeeLoginEditExistingUser* pDlg = (CGUIDialogBoxeeLoginEditExistingUser*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_EDIT_EXISTING_USER); + if (!pDlg) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginEditExistingUser::Show - FAILED to get GUIDialogBoxeeLoginEditExistingUser object (login)"); + return false; + } + + pDlg->SetUsername(username); + pDlg->SetUserId(userId); + pDlg->SetPassword(password); + pDlg->SetRememberPassword(rememberPassword); + pDlg->SetUserProfileIndex(userProfileIndex); + pDlg->SetThumb(thumb); + + pDlg->DoModal(); + + password = pDlg->GetPassword(); + rememberPassword = pDlg->IsRememberPassword(); + + return true; +} diff --git a/xbmc/GUIDialogBoxeeLoginEditExistingUser.h b/xbmc/GUIDialogBoxeeLoginEditExistingUser.h new file mode 100644 index 00000000..c4b2b59e --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginEditExistingUser.h @@ -0,0 +1,63 @@ +#pragma once + +#include "GUIDialog.h" + +class CGUIDialogBoxeeLoginEditExistingUser : public CGUIDialog +{ +public: + + CGUIDialogBoxeeLoginEditExistingUser(); + virtual ~CGUIDialogBoxeeLoginEditExistingUser(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + virtual void Render(); + + void SetUsername(const CStdString& username); + CStdString GetUsername(); + + void SetUserId(const CStdString& userId); + CStdString GetUserId(); + + void SetPassword(const CStdString& password); + CStdString GetPassword(); + + void SetRememberPassword(bool rememberPassword); + bool IsRememberPassword(); + + void SetUserProfileIndex(int userProfileIndex); + int GetUserProfileIndex(); + + void SetThumb(const CStdString& thumb); + CStdString GetThumb(); + + static bool Show(int userProfileIndex, const CStdString& username, const CStdString& userId, CStdString& password, bool& rememberPassword, const CStdString& thumb); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + +private: + + bool HandleClick(CGUIMessage& message); + + bool CanExecuteLogin(); + bool OnLoginButton(); + + bool OnRemoveButton(); + + bool IsPasswordFiledEmpty(); + + int m_checkPasswordFieldDelay; + bool m_needToCheckEmptyPassword; + + CStdString m_username; + CStdString m_userId; + CStdString m_password; + int m_userProfileIndex; + bool m_rememberPassword; + CStdString m_thumb; +}; diff --git a/xbmc/GUIDialogBoxeeLoginWizardAddExistingUser.cpp b/xbmc/GUIDialogBoxeeLoginWizardAddExistingUser.cpp new file mode 100644 index 00000000..f09c5725 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardAddExistingUser.cpp @@ -0,0 +1,204 @@ +#include "GUIDialogBoxeeLoginWizardAddExistingUser.h" +#include "GUIWindowManager.h" +#include "BoxeeLoginManager.h" +#include "utils/log.h" +#include "GUIRadioButtonControl.h" +#include "GUIEditControl.h" +#include "Application.h" +#include "GUIDialogOK2.h" +#include "BoxeeLoginWizardManager.h" +#include "lib/libBoxee/bxcredentials.h" +#include "lib/libBoxee/boxee.h" + +#define USERNAME_EDIT_CONTROL_ID 8605 +#define PASSWORD_EDIT_CONTROL_ID 8602 +#define REMEMBER_PASSWORD_CONTROL_ID 8603 +#define SHOW_PASSWORD_CONTROL_ID 8607 + +CGUIDialogBoxeeLoginWizardAddExistingUser::CGUIDialogBoxeeLoginWizardAddExistingUser() : CGUIDialogBoxeeWizardBase(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_ADD_EXISTING_USER,"boxee_login_wizard_add_existing_user.xml","CGUIDialogBoxeeLoginWizardAddExistingUser") +{ + m_rememberPassword = false; +} + +CGUIDialogBoxeeLoginWizardAddExistingUser::~CGUIDialogBoxeeLoginWizardAddExistingUser() +{ + +} + +void CGUIDialogBoxeeLoginWizardAddExistingUser::OnInitWindow() +{ + CGUIDialogBoxeeWizardBase::OnInitWindow(); + + m_rememberPassword = true; + ((CGUIRadioButtonControl*)GetControl(REMEMBER_PASSWORD_CONTROL_ID))->SetSelected(m_rememberPassword); + + SET_CONTROL_FOCUS(USERNAME_EDIT_CONTROL_ID,0); +} + +bool CGUIDialogBoxeeLoginWizardAddExistingUser::OnAction(const CAction& action) +{ + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +bool CGUIDialogBoxeeLoginWizardAddExistingUser::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + if (HandleClick(message)) + { + // continue to stay in this screen + return true; + } + } + break; + } + + return CGUIDialogBoxeeWizardBase::OnMessage(message); +} + +bool CGUIDialogBoxeeLoginWizardAddExistingUser::HandleClick(CGUIMessage& message) +{ + int iControl = message.GetSenderId(); + + switch(iControl) + { + case REMEMBER_PASSWORD_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddExistingUser::HandleClick - handling click on [Control=%d=REMEMBER_PASSWORD] (blw)(digwiz)",iControl); + m_rememberPassword = ((CGUIRadioButtonControl*)GetControl(REMEMBER_PASSWORD_CONTROL_ID))->IsSelected(); + return true; + } + break; + case SHOW_PASSWORD_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddExistingUser::HandleClick - handling click on [Control=%d=SHOW_PASSWORD] (blw)(digwiz)",iControl); + + CGUIRadioButtonControl* pControl = (CGUIRadioButtonControl*)GetControl(SHOW_PASSWORD_CONTROL_ID); + if (pControl) + { + if (pControl->IsSelected()) + { + ((CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID))->SetInputType(CGUIEditControl::INPUT_TYPE_TEXT,0); + } + else + { + ((CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID))->SetInputType(CGUIEditControl::INPUT_TYPE_PASSWORD,0); + } + } + + return true; + } + break; + case DIALOG_WIZARD_BUTTON_NEXT: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddExistingUser::HandleClick - handling click on [Control=%d=LOGIN=BUTTON_NEXT] (blw)(digwiz)",iControl); + + if (!OnLoginButton()) + { + // stay in the dialog + return true; + } + } + break; + } + + return false; +} + +bool CGUIDialogBoxeeLoginWizardAddExistingUser::OnLoginButton() +{ + if (!CanExecuteLogin()) + { + // Error logs was written in CanExecuteLogin() + return false; + } + + CStdString username = ((CGUIEditControl*)GetControl(USERNAME_EDIT_CONTROL_ID))->GetLabel2(); + CStdString password = ((CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID))->GetLabel2(); + password = CBoxeeLoginManager::EncodePassword(password); + BOXEE::BXLoginStatus loginStatus = CBoxeeLoginManager::DoLogin(username,password,m_rememberPassword); + + if (loginStatus == BOXEE::LOGIN_SUCCESS) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddExistingUser::OnLoginButton - Login Succeeded [loginStatus=%d=LOGIN_SUCCESS] -> Going to call FinishSuccessfulLogin(true) (blw)",loginStatus); + g_application.GetBoxeeLoginManager().FinishSuccessfulLogin(); + + return true; + } + + ((CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID))->SetLabel2(""); + SET_CONTROL_FOCUS(PASSWORD_EDIT_CONTROL_ID,0); + + return false; +} + +bool CGUIDialogBoxeeLoginWizardAddExistingUser::CanExecuteLogin() +{ + if(IsThereEmptyFieldsForLogin()) + { + // Error logs was written in IsThereEmptyfieldsForLogin() + return false; + } + + const CStdString username = ((CGUIEditControl*)GetControl(USERNAME_EDIT_CONTROL_ID))->GetLabel2(); + if (CBoxeeLoginManager::DoesThisUserAlreadyExist(username)) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddExistingUser::CanExecuteLogin - user [%s] already exist on this machine (blw)",username.c_str()); + CGUIDialogOK2::ShowAndGetInput(20068,51603); + return false; + } + + bool isConnectedToInternet = g_application.IsConnectedToInternet(); + if(!isConnectedToInternet) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddExistingUser::CanExecuteLogin - can't add user since [isConnectedToInternet=%d] (blw)",isConnectedToInternet); + CGUIDialogOK2::ShowAndGetInput(53743, 53744); + return false; + } + + return true; +} + +bool CGUIDialogBoxeeLoginWizardAddExistingUser::IsThereEmptyFieldsForLogin() +{ + CStdString username = ((CGUIEditControl*)GetControl(USERNAME_EDIT_CONTROL_ID))->GetLabel2(); + + if(username.IsEmpty()) + { + // Case of empty UserName field + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddExistingUser::IsThereEmptyfieldsForLogin - [username=%s] is empty (blw)",username.c_str()); + CGUIDialogOK2::ShowAndGetInput(20068,51058); + SET_CONTROL_FOCUS(USERNAME_EDIT_CONTROL_ID,0); + return true; + } + + CStdString password = ((CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID))->GetLabel2(); + + if(password.IsEmpty()) + { + // Case of empty Password field + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddExistingUser::IsThereEmptyfieldsForLogin - [password=%s] is empty (blw)",password.c_str()); + CGUIDialogOK2::ShowAndGetInput(20068,51059); + SET_CONTROL_FOCUS(PASSWORD_EDIT_CONTROL_ID,0); + return true; + } + + return false; +} + +bool CGUIDialogBoxeeLoginWizardAddExistingUser::HandleClickNext() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardAddExistingUser::HandleClickBack() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardAddExistingUser::GetIsRememberPassword() +{ + return m_rememberPassword; +} diff --git a/xbmc/GUIDialogBoxeeLoginWizardAddExistingUser.h b/xbmc/GUIDialogBoxeeLoginWizardAddExistingUser.h new file mode 100644 index 00000000..08e3b22b --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardAddExistingUser.h @@ -0,0 +1,34 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" + +class CGUIDialogBoxeeLoginWizardAddExistingUser : public CGUIDialogBoxeeWizardBase +{ +public: + + CGUIDialogBoxeeLoginWizardAddExistingUser(); + virtual ~CGUIDialogBoxeeLoginWizardAddExistingUser(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + bool GetIsRememberPassword(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + +private: + + bool HandleClick(CGUIMessage& message); + bool OnLoginButton(); + bool CanExecuteLogin(); + bool IsThereEmptyFieldsForLogin(); + + bool DoLogin(); + + bool m_rememberPassword; + +}; diff --git a/xbmc/GUIDialogBoxeeLoginWizardAddNewUser.cpp b/xbmc/GUIDialogBoxeeLoginWizardAddNewUser.cpp new file mode 100644 index 00000000..7e1a9e26 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardAddNewUser.cpp @@ -0,0 +1,945 @@ +#include "GUIDialogBoxeeLoginWizardAddNewUser.h" +#include "GUIWindowManager.h" +#include "BoxeeLoginManager.h" +#include "utils/log.h" +#include "GUIRadioButtonControl.h" +#include "GUIEditControl.h" +#include "Application.h" +#include "GUIDialogOK2.h" +#include "BoxeeLoginWizardManager.h" +#include "GUIWebDialog.h" +#include "GUIDialogProgress.h" +#include "RegExp.h" +#include "LocalizeStrings.h" +#include "md5.h" +#include "utils/Base64.h" +#include "lib/libBoxee/bxcredentials.h" +#include "lib/libBoxee/boxee.h" +#include "lib/libBoxee/bxconfiguration.h" +#include "lib/libBoxee/bxutils.h" + +#ifdef _WIN32 +#include "tools/XBMCTex/XTimeUtils.h" +#else +#include "XTimeUtils.h" +#endif + +using namespace BOXEE; + +#define FACEBOOK_CONNECT_BUTTON_CONTROL_ID 8700 +#define NAME_EDIT_CONTROL_ID 8701 +#define EMAIL_EDIT_CONTROL_ID 8702 +#define PASSWORD_EDIT_CONTROL_ID 8703 + +#define CHECK_DIALOG_FILEDS_DELAY 15 + +#define USER_NAME_VALID_REGEXP_PATTERN "^[a-zA-Z0-9_\\.]+$" +#define MIN_USER_NAME_LENGTH 1 +#define MAX_USER_NAME_LENGTH 45 + +#define EMAIL_VALID_REGEXP_PATTERN "^[^@]{1,64}@[\\w\\.-]{1,255}\\.[a-zA-Z]{2,}$" + +#define MIN_PASSWORD_LENGTH 6 +#define MAX_PASSWORD_LENGTH 45 + +#define BOXEE_XML_ELEMENT "boxee" +#define SUCCESS_XML_ELEMENT "success" +#define LOGIN_XML_ELEMENT "login" +#define OBJECT_XML_ELEMENT "object" +#define ERRORS_XML_ELEMENT "errors" + +#define FACEBOOK_CONNECT_URL "http://app.boxee.tv/accountapi/connectservice?id=311" +#define FACEBOOK_CONNECT_GET_PARAMS_NUM_OF_RETRIES 1 + +#define FACEBOOK_PROBLE "FACEBOOK_PROBLE" +#define NO_SERVICE "NO_SERVICE" +#define USER_UNKNOWN "USER_UNKNOWN" + +CGUIDialogBoxeeLoginWizardAddNewUser::CGUIDialogBoxeeLoginWizardAddNewUser() : CGUIDialogBoxeeWizardBase(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_ADD_NEW_USER,"boxee_login_wizard_add_new_user.xml","CGUIDialogBoxeeLoginWizardAddNewUser") +{ + m_checkNameFieldDelay = 0; + m_checkEmailDelay = 0; + m_checkPasswordDelay = 0; + + m_validNameStr = ""; + m_isNameValid = false; + + m_validEmailStr = ""; + m_isEmailValid = false; + + m_validPasswordStr = ""; + m_isPasswordValid = false; +} + +CGUIDialogBoxeeLoginWizardAddNewUser::~CGUIDialogBoxeeLoginWizardAddNewUser() +{ + +} + +void CGUIDialogBoxeeLoginWizardAddNewUser::OnInitWindow() +{ + CGUIDialogBoxeeWizardBase::OnInitWindow(); + + SetProperty("name-is-valid", false); + SetProperty("email-is-valid", false); + SetProperty("password-is-valid", false); + + m_checkNameFieldDelay = 0; + m_checkEmailDelay = 0; + m_checkPasswordDelay = 0; + + m_validNameStr = ""; + m_isNameValid = false; + + m_validEmailStr = ""; + m_isEmailValid = false; + + m_validPasswordStr = ""; + m_isPasswordValid = false; +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::OnAction(const CAction& action) +{ + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + if (HandleClick(message)) + { + // continue to stay in this screen + return true; + } + } + break; + } + + return CGUIDialogBoxeeWizardBase::OnMessage(message); +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::HandleClick(CGUIMessage& message) +{ + int iControl = message.GetSenderId(); + + switch(iControl) + { + case FACEBOOK_CONNECT_BUTTON_CONTROL_ID: + { +#ifdef CANMORE + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::HandleClick - handling click on [Control=%d=FACEBOOK_CONNECT_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + if (!OnCreateUserThruFacebook()) + { + // ERROR log will be written in OnCreateUser + return true; + } +#else + CStdString text = g_localizeStrings.Get(80004); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(10014),text); +#endif + } + break; + case DIALOG_WIZARD_BUTTON_NEXT: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::HandleClick - handling click on [Control=%d=DIALOG_WIZARD_BUTTON_NEXT] (blw)(digwiz)",iControl); + if (!OnCreateUser()) + { + // ERROR log will be written in OnCreateUser + return true; + } + } + break; + } + + return false; +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUserThruFacebook() +{ + //CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUserThruFacebook - NOT IMPLEMENTED (blw)(cnu)"); + //return false; + + /* + // erez - FOR TESTING !!! // + { + CStdString strJson = "{\"error_code\":400,\"error_msg\":\"USER_UNKNOWN\"}"; + Json::Reader reader; + Json::Value jResponse; + + CStdString errorCode; + CStdString errorMsg; + + if (!reader.parse(strJson, jResponse)) + { + printf("OnCreateUserThruFacebook - FAILED to parse json"); + return false; + } + + Json::Value::Members keys = jResponse.getMemberNames(); + for (size_t i = 0; i < keys.size(); i++) + { + printf("[%zu/%zu] - [%s=%s]\n",i+1,keys.size(),keys[i].c_str(),jResponse.get(keys[i],"WTF").asString().c_str()); + } + + if (!jResponse.isMember("error_code")) + { + printf("FAILED to find [error_code] in request\n"); + } + else + { + Json::Value val(jResponse.get("error_code","")); + int errorCode = jResponse["error_code"].asInt(); + } + + if (!jResponse.isMember("error_msg")) + { + printf("FAILED to find [error_msg] in request\n"); + } + else + { + errorMsg = jResponse["error_msg"].asString(); + } + + printf("[error_code=%s][error_msg=%s]\n",errorCode.c_str(),errorMsg.c_str()); + + return false; + } + ///////////////////////////// + */ + + CBoxeeLoginWizardManager::GetInstance().GetServerUserInfoByRef().Reset(); + + if (!CGUIWebDialog::ShowAndGetInput(FACEBOOK_CONNECT_URL)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUserThruFacebook - FAILED to create new user thru facebook (blw)(cnu)"); + CGUIDialogOK2::ShowAndGetInput(53701, 53455); + return false; + } + + if (!GetSocialServiceParams(FACEBOOK_SERVICE_ID)) + { + // ERROR log will be written in GetFacebookServiceParams + CGUIDialogOK2::ShowAndGetInput(53701, 53455); + return false; + } + + //////////////////////////////////////////////////// + // got user data from server -> set dialog fields // + //////////////////////////////////////////////////// + + CServerUserInfo serverUserInfo = CBoxeeLoginWizardManager::GetInstance().GetServerUserInfo(); + + CGUIEditControl* pNameEditControl = (CGUIEditControl*)GetControl(NAME_EDIT_CONTROL_ID); + if (!pNameEditControl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUserThruFacebook - FAILED to get NAME control (blw)(cnu)"); + CGUIDialogOK2::ShowAndGetInput(53701, 53455); + return false; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUserThruFacebook - going to set [name=%s] (blw)(cnu)",serverUserInfo.m_name.c_str()); + pNameEditControl->SetLabel2(serverUserInfo.m_name); + + CGUIEditControl* pEmailEditControl = (CGUIEditControl*)GetControl(EMAIL_EDIT_CONTROL_ID); + if (!pEmailEditControl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUserThruFacebook - FAILED to get EMAIL control (blw)(cnu)"); + CGUIDialogOK2::ShowAndGetInput(53701, 53455); + return false; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUserThruFacebook - going to set [email=%s] (blw)(cnu)",serverUserInfo.m_email.c_str()); + pEmailEditControl->SetLabel2(serverUserInfo.m_email); + + // tmp !!! + CBoxeeLoginWizardManager::GetInstance().GetServerUserInfoByRef().m_serviceId = FACEBOOK_SERVICE_ID; + + return true; +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::GetSocialServiceParams(const CStdString& serviceId) +{ + CStdString strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.GetServiceParams","http://app.boxee.tv/accountapi/getserviceparams"); + strUrl += "?id="; + strUrl += serviceId; + + Json::Value jResponse; + int returnCode; + + int numOfRetries = FACEBOOK_CONNECT_GET_PARAMS_NUM_OF_RETRIES; + bool isSucceeded = BOXEE::BXUtils::PerformJSONGetRequest(strUrl,jResponse,returnCode); + + /* + // erez - FOR TESTING !!! // + CStdString strJson = "{\"id\": \"100000358208233\",\"name\":\"Cookie Monro\",\"first_name\":\"Cookie\",\"last_name\":\"Monro\",\"link\":\"http:\\/\\/www.facebook.com\\/cookie.monro\",\"username\":\"cookie.monro\",\"birthday\":\"01\\/01\\/1981\",\"gender\":\"male\",\"email\":\"liel@boxee.tv\",\"timezone\":-4,\"locale\":\"en_US\",\"verified\":true,\"updated_time\":\"2011-10-03T15:46:24+0000\",\"access_token\":\"AAAAAKROdCKMBAOhxTZCDv1UeYU6ypWNQBni4K0YXuVWJQSxuuBLJo0psrkHuLtUOYwMynZBdH8TZCTU0FH47WmKRNyevpHEH2EHTMeLogZDZD\",\"code\":\"AQBGjcz-34WbyiN8CVVVd9twgg7JWbofgzdiUrGRHRY_-WTLA2EHcOktxsCiMtd8fn4vljSW13wSUt7zMlukrYL4CzEhH0DVtnIxSyFuxn-M7qtZaTmvf4KTGhN1212YrhDK3RARRc-4SeE7R9LbKiAksViRlPPvCGoSH6eM9PYMcQ9u0Jqwt74yQIv6euI1jfc\"}"; + Json::Reader reader; + + if (!reader.parse(strJson, jResponse)) + { + printf("OnCreateUserThruFacebook - FAILED to parse json"); + return false; + } + + bool isSucceeded = true; + ///////////////////////////// + */ + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::GetSocialServiceParams - call PerformJSONGetRequest returned [isSucceeded=%d][returnCode=%d] . [serviceId=%s] (blw)(cnu)",isSucceeded,returnCode,serviceId.c_str()); + + while (!isSucceeded) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::GetSocialServiceParams - FAILED to get service params. [serviceId=%s] (blw)(cnu)",serviceId.c_str()); + + if (!jResponse.isMember("error_code")) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::GetSocialServiceParams - FAILED to get [error_code] parameter from json response. [serviceId=%s] (blw)(cnu)",serviceId.c_str()); + return false; + } + + int errorCode = jResponse["error_code"].asInt(); + + if (errorCode != 400) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::GetSocialServiceParams - FAILED to handle [error_code=%d]. [serviceId=%s] (blw)(cnu)",errorCode,serviceId.c_str()); + return false; + } + + if (!jResponse.isMember("error_msg")) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::GetSocialServiceParams - FAILED to get [error_msg] parameter from json response. [serviceId=%s] (blw)(cnu)",serviceId.c_str()); + return false; + } + + CStdString errorMsg = jResponse["error_msg"].asString(); + + if (errorMsg != FACEBOOK_PROBLE || (numOfRetries == 0)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::GetSocialServiceParams - FAILED to get service params [error_msg=%s]. [serviceId=%s] (blw)(cnu)",errorMsg.c_str(),serviceId.c_str()); + return false; + } + + ///////////////////////////////////////////////////////// + // received errorMsg FACEBOOK_PROBLE -> do another try // + ///////////////////////////////////////////////////////// + + numOfRetries--; + isSucceeded = BOXEE::BXUtils::PerformJSONGetRequest(strUrl,jResponse,returnCode); + } + + if (!ParseSocialServiceParams(serviceId,jResponse)) + { + // ERROR log will be written in ParseSocialServiceParams + return false; + } + + return true; +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::ParseSocialServiceParams(const CStdString& serviceId, const Json::Value& jResponse) +{ + Json::Value::Members keys = jResponse.getMemberNames(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseSocialServiceParams - enter function. going to parse jResponse with [keysSize=%zu]. [serviceId=%s] (blw)(cnu)",keys.size(),serviceId.c_str()); + + if (!CBoxeeLoginWizardManager::GetInstance().GetServerUserInfoByRef().InitializeByJson(jResponse)) + { + // ERROR log will be written in InitializeByJson + return false; + } + + return true; +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::SetDialogFields() +{ + + + return true; +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUser() +{ + if (!CanExecuteLogin()) + { + // ERROR log will be written in CanExecuteLogin + return false; + } + + CGUIDialogProgress* progress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); + if (progress) + { + progress->StartModal(); + progress->Progress(); + } + + int profileId = -1; + bool isLogin = false; + + CStdString strUrl = BXConfiguration::GetInstance().GetStringParam("Boxee.Create.User","https://secure.boxee.tv/api/register"); + + ListHttpHeaders headers; + headers.push_back("Content-Type: text/xml"); + + BXXMLDocument doc; + doc.SetCredentials(BOXEE::Boxee::GetInstance().GetCredentials()); + + CStdString postData; + BuildCreateNewUserOnLoginPostData(postData); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUser - Going to create new user. [postData=%s] (blw)(cnu)",postData.c_str()); + + bool isSucceeded = false; + isSucceeded = doc.LoadFromURL(strUrl,headers,postData); + + if (progress) + { + progress->Close(); + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUser - Create new user returned [isSucceeded=%d][RetCode=%ld] (blw)(cnu)",isSucceeded,doc.GetLastRetCode()); + + if (!isSucceeded) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUser - FAILED to create new user [username=%s]. Request from server returned FALSE (blw)(cnu)",m_validNameStr.c_str()); + CGUIDialogOK2::ShowAndGetInput(53701, 53455); + return false; + } + + BXObject newUserObj(false); + CStdString errorMessage = ""; + + if (!ParseServerCreatedNewUserResponse(doc, isLogin, newUserObj, errorMessage)) + { + if (errorMessage.IsEmpty()) + { + CGUIDialogOK2::ShowAndGetInput(53701, 53456); + } + else + { + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701), errorMessage); + } + + return false; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUser - New user [username=%s] was created on server. create local profile (blw)(cnu)",m_validNameStr.c_str()); + + if (CBoxeeLoginWizardManager::GetInstance().GetServerUserInfoByRef().IsInitialize()) + { + CServerUserInfo serverUserInfo = CBoxeeLoginWizardManager::GetInstance().GetServerUserInfo(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUser - New user [username=%s] was created thru social service [%s] -> update service (blw)(cnu)",m_validNameStr.c_str(),serverUserInfo.m_serviceId.c_str()); + + CStdString strUrl = BXConfiguration::GetInstance().GetStringParam("Boxee.Update.Service.User","http://app.boxee.tv/accountapi/updateService"); + + ListHttpHeaders headers; + //headers.push_back("Content-Type: text/xml"); + + BXXMLDocument doc; + doc.SetCredentials(BOXEE::Boxee::GetInstance().GetCredentials()); + + CStdString postData = "bx_action=upd&service="; + postData += serverUserInfo.m_serviceId; + postData += "&format=json&access_token="; + postData += serverUserInfo.m_accessToken; + postData += "&user_id="; + postData += serverUserInfo.m_username; + postData += "&secret_skip="; + postData += "S0M3S3c437"; + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUser - going to update new user service [id=%s]. [postData=%s] (blw)(cnu)",serverUserInfo.m_serviceId.c_str(),postData.c_str()); + + bool isSucceeded = false; + isSucceeded = doc.LoadFromURL(strUrl,headers,postData); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUser - update new user service [id=%s] returned [isSucceeded=%d][RetCode=%ld] (blw)(cnu)",serverUserInfo.m_serviceId.c_str(),isSucceeded,doc.GetLastRetCode()); + + if (!isSucceeded) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUser - FAILED to update new user [username=%s] with service [%s]. Request from server returned FALSE (blw)(cnu)",m_validNameStr.c_str(),serverUserInfo.m_serviceId.c_str()); + //CGUIDialogOK2::ShowAndGetInput(53701, 53472); + //return false; + } + } + + if (!CreateNewUserProfile(newUserObj, profileId)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::OnCreateUser - FAILED to create profile for new user [username=%s] (blw)(cnu)",m_validNameStr.c_str()); + CGUIDialogOK2::ShowAndGetInput(53701, 53456); + return false; + } + + CProfile& p = g_settings.m_vecProfiles[profileId]; + + BXCredentials credentials; + credentials.SetUserName(p.getName()); + credentials.SetPassword(p.getLastLockCode()); + + BOXEE::Boxee::GetInstance().PostLoginInitializations(credentials,newUserObj); + + if (isLogin) + { + g_application.SetOfflineMode(false); + } + + g_application.GetBoxeeLoginManager().FinishSuccessfulLogin(); + + return true; +} + +void CGUIDialogBoxeeLoginWizardAddNewUser::BuildCreateNewUserOnLoginPostData(CStdString& postData) +{ + postData = ""; + postData += ""; + postData += m_validEmailStr; + postData += ""; + + postData += ""; + CStdString validPasswordStr = m_validPasswordStr; + validPasswordStr.Replace("&","&"); + validPasswordStr.Replace("\"","""); + validPasswordStr.Replace("'","'"); + validPasswordStr.Replace(">",">"); + validPasswordStr.Replace("<","<"); + validPasswordStr.Replace(" "," "); + postData += validPasswordStr; + postData += ""; + + postData += ""; + postData += m_validNameStr; + postData += ""; + + CStdString firstName = m_validNameStr; + CStdString lastName = ""; + + size_t spacePos = m_validNameStr.find(" "); + if (spacePos != std::string::npos) + { + firstName = m_validNameStr.substr(0,spacePos); + lastName = m_validNameStr.substr(spacePos+1); + } + + postData += ""; + postData += firstName; + postData += ""; + + postData += ""; + postData += lastName; + postData += ""; + + postData += ""; +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse(BOXEE::BXXMLDocument& doc, bool& isLogin, BOXEE::BXObject& newUserObj, CStdString& errorMessage) +{ + const TiXmlElement* pRootElement = doc.GetDocument().RootElement(); + if (!pRootElement) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse - FAILED to get root element (blw)(cnu)"); + return false; + } + + if (strcmp(pRootElement->Value(),BOXEE_XML_ELEMENT) != 0) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse - Root element isn't . <%s> (blw)(cnu)",pRootElement->Value()); + return false; + } + + bool foundSucceessElement = false; + bool isSucceess = false; + + const TiXmlNode* pTag = NULL; + while ((pTag = pRootElement->IterateChildren(pTag))) + { + CStdString elementName = pTag->ValueStr(); + + if (elementName == SUCCESS_XML_ELEMENT) + { + /////////////////////// + // case of // + /////////////////////// + + foundSucceessElement = true; + + const TiXmlNode* pValue = pTag->FirstChild(); + + if (pValue) + { + CStdString succeessValue = pValue->ValueStr(); + + if (succeessValue.Equals("1")) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse - Server returned for [SelectedUsername=%s] (blw)(cnu)",succeessValue.c_str(),m_validNameStr.c_str()); + isSucceess = true; + } + else + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse - Server returned for [SelectedUsername=%s] (blw)(cnu)",succeessValue.c_str(),m_validNameStr.c_str()); + } + } + else + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse - FAILED to get element value. [SelectedUsername=%s] (blw)(cnu)",m_validNameStr.c_str()); + } + } + else if (elementName == LOGIN_XML_ELEMENT) + { + ///////////////////// + // case of // + ///////////////////// + + if (!foundSucceessElement) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse - There wasn't before for [SelectedUsername=%s] (blw)(cnu)",m_validNameStr.c_str()); + return false; + } + + const TiXmlNode* pValue = pTag->FirstChild(); + + if (pValue) + { + CStdString loginValue = pValue->ValueStr(); + + if (loginValue.Equals("1")) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse - Server returned for [SelectedUsername=%s] (blw)(cnu)",loginValue.c_str(),m_validNameStr.c_str()); + isLogin = true; + } + else + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse - Server returned for [SelectedUsername=%s] (blw)(cnu)",loginValue.c_str(),m_validNameStr.c_str()); + } + } + else + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse - FAILED to get element value. [SelectedUsername=%s] (blw)(cnu)",m_validNameStr.c_str()); + return false; + } + } + else if (elementName == OBJECT_XML_ELEMENT) + { + /////////////////////// + // case of // + /////////////////////// + + if (!isSucceess) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse - element won't be parse because server FAILED to create new user. [SelectedUsername=%s] (blw)(cnu)",m_validNameStr.c_str()); + return false; + } + + newUserObj.FromXML(pTag); + newUserObj.SetValid(true); + } + else if (elementName == ERRORS_XML_ELEMENT) + { + /////////////////////// + // case of // + /////////////////////// + + if (isSucceess) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse - Received element while . [SelectedUsername=%s] (blw)(cnu)",isSucceess,m_validNameStr.c_str()); + return false; + } + + const TiXmlNode* pErrorTag = NULL; + while ((pErrorTag = pTag->IterateChildren(pErrorTag))) + { + const TiXmlNode* pErrorValue = pErrorTag->FirstChild(); + + if (pErrorValue) + { + errorMessage = pErrorValue->ValueStr(); + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse - Parse error message [%s]. [SelectedUsername=%s] (blw)(cnu)",errorMessage.c_str(),m_validNameStr.c_str()); + return false; + } + } + + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::ParseServerCreatedNewUserResponse - FAILED to parse any error message [%s]. [SelectedUsername=%s] (blw)(cnu)",errorMessage.c_str(),m_validNameStr.c_str()); + return false; + } + } + + return true; +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::CreateNewUserProfile(const BXObject& newUserObj, int& profileId) +{ + if (!newUserObj.IsValid()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::CreateNewUserProfile - Enter function with a INVALID user object. [username=%s] (cnu)",m_validNameStr.c_str()); + return false; + } + + profileId = g_application.GetBoxeeLoginManager().CreateProfile(newUserObj.GetID(), newUserObj); + + if (profileId > 0) + { + g_settings.LoadProfile(profileId); + + CStdString password = m_validPasswordStr; + password = CBoxeeLoginManager::EncodePassword(password); + g_application.GetBoxeeLoginManager().UpdateProfile(profileId,password,true); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::CreateNewUserProfile - After create profile for [username=%s]. [profileId=%d] (cnu)",m_validNameStr.c_str(),profileId); + + return true; + } + else + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::CreateNewUserProfile - FAILED to create profile for [username=%s]. [profileId=%d] (cnu)",m_validNameStr.c_str(),profileId); + return false; + } +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::CanExecuteLogin() +{ + const CStdString username = ((CGUIEditControl*)GetControl(NAME_EDIT_CONTROL_ID))->GetLabel2(); + if (CBoxeeLoginManager::DoesThisUserAlreadyExist(username)) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardAddNewUser::CanExecuteLogin - user [%s] already exist on this machine (blw)",username.c_str()); + CGUIDialogOK2::ShowAndGetInput(20068,51603); + return false; + } + + bool isConnectedToInternet = g_application.IsConnectedToInternet(); + if(!isConnectedToInternet) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardAddNewUser::CanExecuteLogin - can't add user since [isConnectedToInternet=%d] (blw)",isConnectedToInternet); + CGUIDialogOK2::ShowAndGetInput(53743, 53744); + return false; + } + + return true; +} + +void CGUIDialogBoxeeLoginWizardAddNewUser::Render() +{ + checkDialogFields(); + + CGUIDialogBoxeeWizardBase::Render(); +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::HandleClickNext() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::HandleClickBack() +{ + return true; +} + +void CGUIDialogBoxeeLoginWizardAddNewUser::checkDialogFields() +{ + checkNameField(); + checkEmailField(); + checkPasswordField(); +} + +void CGUIDialogBoxeeLoginWizardAddNewUser::checkNameField() +{ + m_checkNameFieldDelay++; + + if (m_checkNameFieldDelay > CHECK_DIALOG_FILEDS_DELAY) + { + m_checkNameFieldDelay = 0; + + CGUIEditControl* pNameEditControl = (CGUIEditControl*)GetControl(NAME_EDIT_CONTROL_ID); + if (pNameEditControl) + { + CStdString name = pNameEditControl->GetLabel2(); + + if (!m_validNameStr.Equals(name)) + { + if (!name.IsEmpty() && IsNameValid(name)) + { + m_validNameStr = name; + m_isNameValid = true; + SetProperty("name-is-valid", true); + + /* + if (m_isNameValid && m_isEmailValid && m_isPasswordValid) + { + CONTROL_ENABLE(DIALOG_WIZARD_BUTTON_NEXT); + } + */ + } + else + { + if (m_isNameValid) + { + // name valid status was change + + m_validNameStr = ""; + m_isNameValid = false; + SetProperty("name-is-valid", false); + } + } + } + } + } +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::IsNameValid(const CStdString& username) +{ + if (username.length() > MAX_USER_NAME_LENGTH) + { + return false; + } + + CStdString strToCheck = username; + strToCheck.ToLower(); + + CStdString strRegExpr = USER_NAME_VALID_REGEXP_PATTERN; + + CRegExp reg; + reg.RegComp(strRegExpr); + int pos = reg.RegFind(strToCheck); + + if (pos != -1) + { + return true; + } + else + { + return false; + } +} + +void CGUIDialogBoxeeLoginWizardAddNewUser::checkEmailField() +{ + if (m_isNameValid) + { + m_checkEmailDelay++; + + if (m_checkEmailDelay > CHECK_DIALOG_FILEDS_DELAY) + { + m_checkEmailDelay = 0; + + CGUIEditControl* pEmailEditControl = (CGUIEditControl*)GetControl(EMAIL_EDIT_CONTROL_ID); + if (pEmailEditControl) + { + CStdString email = pEmailEditControl->GetLabel2(); + + if (!m_validEmailStr.Equals(email)) + { + if (!email.IsEmpty() && IsEmailValid(email)) + { + m_validEmailStr = email; + m_isEmailValid = true; + SetProperty("email-is-valid", true); + + /* + if (m_isNameValid && m_isEmailValid && m_isPasswordValid) + { + CONTROL_ENABLE(DIALOG_WIZARD_BUTTON_NEXT); + } + */ + } + else + { + if (m_isEmailValid) + { + // email valid status was change + + m_validEmailStr = ""; + m_isEmailValid = false; + SetProperty("email-is-valid", false); + } + } + } + } + } + } +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::IsEmailValid(const CStdString& email) +{ + if (email.length() > 45) + { + return false; + } + + //CStdString strToCheck = "*" + email + "*"; + CStdString strToCheck = email; + strToCheck.ToLower(); + + CStdString strRegExpr = EMAIL_VALID_REGEXP_PATTERN; + + CRegExp reg; + reg.RegComp(strRegExpr); + int pos = reg.RegFind(strToCheck); + + if (pos != -1) + { + return true; + } + else + { + return false; + } +} + +void CGUIDialogBoxeeLoginWizardAddNewUser::checkPasswordField() +{ + if (m_isNameValid && m_isEmailValid) + { + m_checkPasswordDelay++; + + if (m_checkPasswordDelay > CHECK_DIALOG_FILEDS_DELAY) + { + m_checkPasswordDelay = 0; + + CGUIEditControl* pPasswordEditControl = (CGUIEditControl*)GetControl(PASSWORD_EDIT_CONTROL_ID); + if (pPasswordEditControl) + { + CStdString password = pPasswordEditControl->GetLabel2(); + + if (!m_validPasswordStr.Equals(password)) + { + if (!password.IsEmpty() && IsPasswordValid(password)) + { + m_validPasswordStr = password; + m_isPasswordValid = true; + SetProperty("password-is-valid", true); + } + else + { + if (m_isPasswordValid) + { + m_validPasswordStr = ""; + m_isPasswordValid = false; + SetProperty("password-is-valid", false); + } + } + } + } + } + } +} + +bool CGUIDialogBoxeeLoginWizardAddNewUser::IsPasswordValid(const CStdString& password) +{ + if (password.length() < MIN_PASSWORD_LENGTH || password.length() > MAX_PASSWORD_LENGTH) + { + return false; + } + + return true; +} + +CStdString CGUIDialogBoxeeLoginWizardAddNewUser::GetUserName() +{ + return m_validNameStr; +} + +CStdString CGUIDialogBoxeeLoginWizardAddNewUser::GetEmail() +{ + return m_validEmailStr; +} + diff --git a/xbmc/GUIDialogBoxeeLoginWizardAddNewUser.h b/xbmc/GUIDialogBoxeeLoginWizardAddNewUser.h new file mode 100644 index 00000000..de47abc4 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardAddNewUser.h @@ -0,0 +1,68 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" +#include "lib/libBoxee/bxxmldocument.h" +#include "lib/libBoxee/bxobject.h" +#include "../lib/libjson/include/json/value.h" + +class CGUIDialogBoxeeLoginWizardAddNewUser : public CGUIDialogBoxeeWizardBase +{ +public: + + CGUIDialogBoxeeLoginWizardAddNewUser(); + virtual ~CGUIDialogBoxeeLoginWizardAddNewUser(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + virtual void Render(); + + CStdString GetUserName(); + CStdString GetEmail(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + +private: + + bool HandleClick(CGUIMessage& message); + + bool OnCreateUserThruFacebook(); + bool GetSocialServiceParams(const CStdString& serviceId); + bool ParseSocialServiceParams(const CStdString& serviceId, const Json::Value& jResponse); + bool OnCreateUser(); + void BuildCreateNewUserOnLoginPostData(CStdString& postData); + void BuildNewUserUpdateServiceDataOnLoginPostData(CStdString& postData); + bool ParseServerCreatedNewUserResponse(BOXEE::BXXMLDocument& doc, bool& isLogin, BOXEE::BXObject& newUserObj, CStdString& errorMessage); + bool CreateNewUserProfile(const BOXEE::BXObject& newUserObj, int& profileId); + CStdString EncodePassword(CStdString password); + + bool SetDialogFields(); + + bool OnLoginButton(); + bool CanExecuteLogin(); + void checkDialogFields(); + + bool DoLogin(); + + CStdString m_validNameStr; + bool m_isNameValid; + int m_checkNameFieldDelay; + void checkNameField(); + bool IsNameValid(const CStdString& username); + + CStdString m_validEmailStr; + bool m_isEmailValid; + int m_checkEmailDelay; + void checkEmailField(); + bool IsEmailValid(const CStdString& email); + + CStdString m_validPasswordStr; + bool m_isPasswordValid; + int m_checkPasswordDelay; + void checkPasswordField(); + bool IsPasswordValid(const CStdString& password); +}; diff --git a/xbmc/GUIDialogBoxeeLoginWizardChooseUserToAddType.cpp b/xbmc/GUIDialogBoxeeLoginWizardChooseUserToAddType.cpp new file mode 100644 index 00000000..8bb9ba89 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardChooseUserToAddType.cpp @@ -0,0 +1,66 @@ +#include "GUIDialogBoxeeLoginWizardChooseUserToAddType.h" +#include "GUIWindowManager.h" +#include "utils/log.h" + +#define NEW_USER_BUTTON_CONTROL_ID 8901 +#define EXISTING_USER_BUTTON_CONTROL_ID 8902 + +CGUIDialogBoxeeLoginWizardChooseUserToAddType::CGUIDialogBoxeeLoginWizardChooseUserToAddType() : CGUIDialogBoxeeWizardBase(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_CHOOSE_USER_TO_ADD,"boxee_login_wizard_choose_user_to_add_type.xml","CGUIDialogBoxeeLoginWizardChooseUserToAddType") +{ + m_addingNewUser = false; +} + +CGUIDialogBoxeeLoginWizardChooseUserToAddType::~CGUIDialogBoxeeLoginWizardChooseUserToAddType() +{ + +} + +void CGUIDialogBoxeeLoginWizardChooseUserToAddType::OnInitWindow() +{ + CGUIDialogBoxeeWizardBase::OnInitWindow(); + + m_addingNewUser = false; + SET_CONTROL_FOCUS(NEW_USER_BUTTON_CONTROL_ID,0); +} + +bool CGUIDialogBoxeeLoginWizardChooseUserToAddType::OnAction(const CAction& action) +{ + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +bool CGUIDialogBoxeeLoginWizardChooseUserToAddType::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int iControl = message.GetSenderId(); + int iAction = message.GetParam1(); + + m_addingNewUser = (iControl == NEW_USER_BUTTON_CONTROL_ID); + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardChooseUserToAddType::OnMessage - GUI_MSG_CLICKED - after set [addingNewUser=%d]. [Control=%d][iAction=%d] (blw)(digwiz)",m_addingNewUser,iControl,iAction); + + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + return true; + } + break; + } + + return CGUIDialogBoxeeWizardBase::OnMessage(message); +} + +bool CGUIDialogBoxeeLoginWizardChooseUserToAddType::HandleClickNext() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardChooseUserToAddType::HandleClickBack() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardChooseUserToAddType::IsAddingNewUser() +{ + return m_addingNewUser; +} diff --git a/xbmc/GUIDialogBoxeeLoginWizardChooseUserToAddType.h b/xbmc/GUIDialogBoxeeLoginWizardChooseUserToAddType.h new file mode 100644 index 00000000..56971aa5 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardChooseUserToAddType.h @@ -0,0 +1,27 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" + +class CGUIDialogBoxeeLoginWizardChooseUserToAddType : public CGUIDialogBoxeeWizardBase +{ +public: + + CGUIDialogBoxeeLoginWizardChooseUserToAddType(); + virtual ~CGUIDialogBoxeeLoginWizardChooseUserToAddType(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + bool IsAddingNewUser(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + +private: + + bool m_addingNewUser; + +}; diff --git a/xbmc/GUIDialogBoxeeLoginWizardConfirmation.cpp b/xbmc/GUIDialogBoxeeLoginWizardConfirmation.cpp new file mode 100644 index 00000000..613d881b --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardConfirmation.cpp @@ -0,0 +1,43 @@ +#include "GUIDialogBoxeeLoginWizardConfirmation.h" +#include "utils/log.h" + +CGUIDialogBoxeeLoginWizardConfirmation::CGUIDialogBoxeeLoginWizardConfirmation() : CGUIDialogBoxeeWizardBase(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_CONFIRMATION,"boxee_login_wizard_confirmation.xml","CGUIDialogBoxeeLoginWizardConfirmation") +{ + +} + +CGUIDialogBoxeeLoginWizardConfirmation::~CGUIDialogBoxeeLoginWizardConfirmation() +{ + +} + +void CGUIDialogBoxeeLoginWizardConfirmation::OnInitWindow() +{ + CGUIDialogBoxeeWizardBase::OnInitWindow(); +} + +bool CGUIDialogBoxeeLoginWizardConfirmation::OnAction(const CAction& action) +{ + if (action.id == ACTION_PREVIOUS_MENU) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConfirmation::OnAction - ACTION_PREVIOUS_MENU - can't go back from here (blw)(digwiz)"); + return true; + } + + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +bool CGUIDialogBoxeeLoginWizardConfirmation::OnMessage(CGUIMessage& message) +{ + return CGUIDialogBoxeeWizardBase::OnMessage(message); +} + +bool CGUIDialogBoxeeLoginWizardConfirmation::HandleClickNext() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardConfirmation::HandleClickBack() +{ + return true; +} diff --git a/xbmc/GUIDialogBoxeeLoginWizardConfirmation.h b/xbmc/GUIDialogBoxeeLoginWizardConfirmation.h new file mode 100644 index 00000000..2fdb8198 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardConfirmation.h @@ -0,0 +1,25 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" + +class CGUIDialogBoxeeLoginWizardConfirmation : public CGUIDialogBoxeeWizardBase +{ +public: + + CGUIDialogBoxeeLoginWizardConfirmation(); + virtual ~CGUIDialogBoxeeLoginWizardConfirmation(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + void SetUserMenuCust(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + +private: + +}; diff --git a/xbmc/GUIDialogBoxeeLoginWizardConnectSocialServices.cpp b/xbmc/GUIDialogBoxeeLoginWizardConnectSocialServices.cpp new file mode 100644 index 00000000..a014e6b6 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardConnectSocialServices.cpp @@ -0,0 +1,291 @@ +#include "GUIDialogBoxeeLoginWizardConnectSocialServices.h" +#include "utils/log.h" +#include "LocalizeStrings.h" +#include "GUIWindowManager.h" +#include "GUIWebDialog.h" +#include "BoxeeUtils.h" +#include "BoxeeLoginWizardManager.h" +#include "LocalizeStrings.h" +#include "GUIDialogOK2.h" + +#define SOCIAL_BUTTONS_GROUP_CONTROL_ID 7000 +#define FACEBOOK_BUTTON_CONTROL_ID 8700 +#define TWITTER_BUTTON_CONTROL_ID 8701 +#define TUMBLR_BUTTON_CONTROL_ID 8702 + +#define ACTION_BUTTONS_GROUP_CONTROL_ID 8704 +#define NEXT_BUTTON_CONTROL_ID 8705 +#define SKIP_BUTTON_CONTROL_ID 8706 + + + +#define FACEBOOK_CONNECTED_WINDOW_PROPERTY "facebook-connected" +#define TWITTER_CONNECTED_WINDOW_PROPERTY "twitter-connected" +#define TUMBLR_CONNECTED_WINDOW_PROPERTY "tumblr-connected" + +CGUIDialogBoxeeLoginWizardConnectSocialServices::CGUIDialogBoxeeLoginWizardConnectSocialServices() : CGUIDialogBoxeeWizardBase(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_CONNECT_SOCIAL_SERVICES,"boxee_login_wizard_connect_social_services.xml","CGUIDialogBoxeeLoginWizardConnectSocialServices") +{ + m_isFacebookConnected = false; + m_isTwitterConnected = false; + m_isTumblrConnected = false; + +} + +CGUIDialogBoxeeLoginWizardConnectSocialServices::~CGUIDialogBoxeeLoginWizardConnectSocialServices() +{ + +} + +void CGUIDialogBoxeeLoginWizardConnectSocialServices::OnInitWindow() +{ + CGUIDialogBoxeeWizardBase::OnInitWindow(); + + if (!GetSocialServicesStatus()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardConnectSocialServices::OnInitWindow - FAILED to get social services status from server. going to set action to NEXT and close dialog (blw)(digwiz)"); + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + return; + } + + m_activeWindow = g_windowManager.GetWindow(g_windowManager.GetActiveWindow()); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::OnInitWindow - after getting social services status from server [isFacebookConnected=%d][isTwitterConnected=%d][isTumblrConnected=%d] (blw)(digwiz)",m_isFacebookConnected,m_isTwitterConnected,m_isTumblrConnected); + + m_activeWindow->SetProperty(FACEBOOK_CONNECTED_WINDOW_PROPERTY,m_isFacebookConnected); + m_activeWindow->SetProperty(TWITTER_CONNECTED_WINDOW_PROPERTY,m_isTwitterConnected); + m_activeWindow->SetProperty(TUMBLR_CONNECTED_WINDOW_PROPERTY,m_isTumblrConnected); +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::OnAction(const CAction& action) +{ + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + if (HandleClick(message)) + { + // continue to stay in this screen + return true; + } + } + break; + } + + return CGUIDialogBoxeeWizardBase::OnMessage(message); +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClick(CGUIMessage& message) +{ + int iControl = message.GetSenderId(); + + switch(iControl) + { + case FACEBOOK_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClick - handling click on [Control=%d=FACEBOOK_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnFacebookButton(); + } + break; + case TWITTER_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClick - handling click on [Control=%d=TWITTER_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnTwitterButton(); + } + break; + case TUMBLR_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClick - handling click on [Control=%d=TUMBLR_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnTumblrButton(); + } + break; + case NEXT_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClick - handling click on [Control=%d=NEXT_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnNextButton(); + } + break; + case SKIP_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClick - handling click on [Control=%d=SKIP_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnSkipButton(); + } + break; + } + + return false; +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickOnFacebookButton() +{ + if (IsFacebookConnected()) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickOnFacebookButton - FACEBOOK is already enable (blw)(digwiz)"); + return true; + } + + if (!ConnectSocialService(FACEBOOK_BUTTON_CONTROL_ID)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickOnFacebookButton - FAILED to connect FACEBOOK (blw)(digwiz)"); + return true; + } + + m_isFacebookConnected = true; + m_activeWindow->SetProperty(FACEBOOK_CONNECTED_WINDOW_PROPERTY,m_isFacebookConnected); + + return true; +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickOnTwitterButton() +{ + if (IsTwitterConnected()) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickOnTwitterButton - TWITTER is already enable (blw)(digwiz)"); + return true; + } + + if (!ConnectSocialService(TWITTER_BUTTON_CONTROL_ID)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickOnTwitterButton - FAILED to connect TWITTER (blw)(digwiz)"); + return true; + } + + m_isTwitterConnected = true; + m_activeWindow->SetProperty(TWITTER_CONNECTED_WINDOW_PROPERTY,m_isTwitterConnected); + + return true; +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickOnTumblrButton() +{ + if (IsTumblrConnected()) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickOnTumblrButton - TUMBLR is already enable (blw)(digwiz)"); + return true; + } + + if (!ConnectSocialService(TUMBLR_BUTTON_CONTROL_ID)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickOnTumblrButton - FAILED to connect TUMBLR (blw)(digwiz)"); + return true; + } + + m_isTumblrConnected = true; + m_activeWindow->SetProperty(TUMBLR_CONNECTED_WINDOW_PROPERTY,m_isTumblrConnected); + + return true; +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::ConnectSocialService(int serviceButtonId) +{ +#ifdef CANMORE + CStdString url = m_servButtonToLinkMap[serviceButtonId]; + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::ConnectSocialService - open GUIWebDialog with [url=%s] (blw)(digwiz)",url.c_str()); + + return CGUIWebDialog::ShowAndGetInput(url); +#else + CStdString url = m_servButtonToExternalLinkMap[serviceButtonId]; + CStdString text = g_localizeStrings.Get(80001); + text += " " + url; + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(10014),text); + return false; +#endif +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickOnNextButton() +{ + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickOnNextButton - enter function (blw)"); + + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + return true; +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickOnSkipButton() +{ + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickOnSkipButton - enter function (blw)"); + + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + return true; +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::GetSocialServicesStatus() +{ + int retCode; + Job_Result jobResult = BoxeeUtils::GetShareServicesJson(m_jsonServiceList,retCode); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::GetSocialServicesStatus - call to get SocialServices status from server returned [jobResult=%d] (blw)(digwiz)",jobResult); + + if (jobResult != JOB_SUCCEEDED) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardConnectSocialServices::GetSocialServicesStatus - FAILED to get SocialServices status from server. [jobResult=%d] (blw)(digwiz)",jobResult); + return false; + } + + m_servicesList.Clear(); + m_servButtonToLinkMap.clear(); + m_servButtonToExternalLinkMap.clear(); + BoxeeUtils::ParseJsonShareServicesToFileItems(m_jsonServiceList,m_servicesList); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardConnectSocialServices::GetSocialServicesStatus - after parse SocialServices to FIleItemList. [NumOfSocialServices=%d] (blw)(digwiz)",m_servicesList.Size()); + + for (int i=0; iGetProperty("serviceId"); + + if (serviceId == FACEBOOK_SERVICE_ID) + { + m_isFacebookConnected = item->GetPropertyBOOL("enable"); + m_servButtonToLinkMap[FACEBOOK_BUTTON_CONTROL_ID] = item->GetProperty("connect"); + m_servButtonToExternalLinkMap[FACEBOOK_BUTTON_CONTROL_ID] = item->GetProperty("link"); + } + else if (serviceId == TWITTER_SERVICE_ID) + { + m_isTwitterConnected = item->GetPropertyBOOL("enable"); + m_servButtonToLinkMap[TWITTER_BUTTON_CONTROL_ID] = item->GetProperty("connect"); + m_servButtonToExternalLinkMap[TWITTER_BUTTON_CONTROL_ID] = item->GetProperty("link"); + } + else if (serviceId == TUMBLR_SERVICE_ID) + { + m_isTumblrConnected = item->GetPropertyBOOL("enable"); + m_servButtonToLinkMap[TUMBLR_BUTTON_CONTROL_ID] = item->GetProperty("connect"); + m_servButtonToExternalLinkMap[TUMBLR_BUTTON_CONTROL_ID] = item->GetProperty("link"); + } + } + + return true; +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickNext() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::HandleClickBack() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::IsFacebookConnected() +{ + return m_isFacebookConnected; +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::IsTwitterConnected() +{ + return m_isTwitterConnected; +} + +bool CGUIDialogBoxeeLoginWizardConnectSocialServices::IsTumblrConnected() +{ + return m_isTumblrConnected; +} + diff --git a/xbmc/GUIDialogBoxeeLoginWizardConnectSocialServices.h b/xbmc/GUIDialogBoxeeLoginWizardConnectSocialServices.h new file mode 100644 index 00000000..1880ecaf --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardConnectSocialServices.h @@ -0,0 +1,53 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" +#include "FileItem.h" +#include "lib/libjson/include/json/value.h" + +class CGUIDialogBoxeeLoginWizardConnectSocialServices : public CGUIDialogBoxeeWizardBase +{ +public: + + CGUIDialogBoxeeLoginWizardConnectSocialServices(); + virtual ~CGUIDialogBoxeeLoginWizardConnectSocialServices(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + bool IsFacebookConnected(); + bool IsTwitterConnected(); + bool IsTumblrConnected(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + +private: + + bool HandleClick(CGUIMessage& message); + + bool HandleClickOnFacebookButton(); + bool HandleClickOnTwitterButton(); + bool HandleClickOnTumblrButton(); + + bool HandleClickOnNextButton(); + bool HandleClickOnSkipButton(); + + bool GetSocialServicesStatus(); + + bool ConnectSocialService(int serviceButtonId); + + CFileItemList m_servicesList; + Json::Value m_jsonServiceList; + + bool m_isFacebookConnected; + bool m_isTwitterConnected; + bool m_isTumblrConnected; + + CGUIWindow* m_activeWindow; + + std::map m_servButtonToLinkMap; + std::map m_servButtonToExternalLinkMap; +}; diff --git a/xbmc/GUIDialogBoxeeLoginWizardMenuCust.cpp b/xbmc/GUIDialogBoxeeLoginWizardMenuCust.cpp new file mode 100644 index 00000000..be58e778 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardMenuCust.cpp @@ -0,0 +1,112 @@ +#include "GUIDialogBoxeeLoginWizardMenuCust.h" +#include "utils/log.h" +#include "GUIDialogProgress.h" +#include "lib/libBoxee/bxconfiguration.h" +#include "lib/libBoxee/bxcurl.h" +#include "GUIDialogOK2.h" +#include "LocalizeStrings.h" +#include "GUITextBox.h" +#include "GUIWindowManager.h" +#include "GUIWindowStateDatabase.h" + +#define WEB_BUTTON_CONTROL_ID 8700 +#define OWN_BUTTON_CONTROL_ID 8701 +#define DONT_KNOW_BUTTON_CONTROL_ID 8702 + +#define CATEGORY_LOCAL "local" +#define CATEGORY_FAVORITES "favorite" +#define CATEGORY_ALL "all" + +CGUIDialogBoxeeLoginWizardMenuCust::CGUIDialogBoxeeLoginWizardMenuCust() : CGUIDialogBoxeeWizardBase(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_MENU_CUST,"boxee_login_wizard_menu_cust.xml","CGUIDialogBoxeeLoginWizardMenuCust") +{ + +} + +CGUIDialogBoxeeLoginWizardMenuCust::~CGUIDialogBoxeeLoginWizardMenuCust() +{ + +} + +void CGUIDialogBoxeeLoginWizardMenuCust::OnInitWindow() +{ + CGUIDialogBoxeeWizardBase::OnInitWindow(); + + m_tvShowMenuCategory = CATEGORY_ALL; + m_movieMenuCategory = CATEGORY_ALL; + m_appMenuCategory = CATEGORY_ALL; +} + +bool CGUIDialogBoxeeLoginWizardMenuCust::OnAction(const CAction& action) +{ + if (action.id == ACTION_PREVIOUS_MENU) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardMenuCust::OnAction - ACTION_PREVIOUS_MENU - can't go back from here (blw)(digwiz)"); + return true; + } + + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +bool CGUIDialogBoxeeLoginWizardMenuCust::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + HandleClick(message); + + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + return true; + } + break; + } + + return CGUIDialogBoxeeWizardBase::OnMessage(message); +} + +bool CGUIDialogBoxeeLoginWizardMenuCust::HandleClick(CGUIMessage& message) +{ + int iControl = message.GetSenderId(); + + switch(iControl) + { + case OWN_BUTTON_CONTROL_ID: + { + m_tvShowMenuCategory = CATEGORY_LOCAL; + m_movieMenuCategory = CATEGORY_LOCAL; + m_appMenuCategory = CATEGORY_FAVORITES; + } + break; + case WEB_BUTTON_CONTROL_ID: + case DONT_KNOW_BUTTON_CONTROL_ID: + { + m_tvShowMenuCategory = CATEGORY_ALL; + m_movieMenuCategory = CATEGORY_ALL; + m_appMenuCategory = CATEGORY_ALL; + } + break; + } + + SetUserMenuCust(); + + return true; +} + +bool CGUIDialogBoxeeLoginWizardMenuCust::HandleClickNext() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardMenuCust::HandleClickBack() +{ + return true; +} + +void CGUIDialogBoxeeLoginWizardMenuCust::SetUserMenuCust() +{ + CGUIWindowStateDatabase stateDB; + stateDB.SetDefaultCategory(WINDOW_BOXEE_BROWSE_TVSHOWS, m_tvShowMenuCategory); + stateDB.SetDefaultCategory(WINDOW_BOXEE_BROWSE_MOVIES, m_movieMenuCategory); + stateDB.SetDefaultCategory(WINDOW_BOXEE_BROWSE_APPS, m_appMenuCategory); +} diff --git a/xbmc/GUIDialogBoxeeLoginWizardMenuCust.h b/xbmc/GUIDialogBoxeeLoginWizardMenuCust.h new file mode 100644 index 00000000..77bab59c --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardMenuCust.h @@ -0,0 +1,30 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" + +class CGUIDialogBoxeeLoginWizardMenuCust : public CGUIDialogBoxeeWizardBase +{ +public: + + CGUIDialogBoxeeLoginWizardMenuCust(); + virtual ~CGUIDialogBoxeeLoginWizardMenuCust(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + void SetUserMenuCust(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + +private: + + bool HandleClick(CGUIMessage& message); + + CStdString m_tvShowMenuCategory; + CStdString m_movieMenuCategory; + CStdString m_appMenuCategory; +}; diff --git a/xbmc/GUIDialogBoxeeLoginWizardNewUserDetails.cpp b/xbmc/GUIDialogBoxeeLoginWizardNewUserDetails.cpp new file mode 100644 index 00000000..97053bf8 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardNewUserDetails.cpp @@ -0,0 +1,679 @@ +#include "GUIDialogBoxeeLoginWizardNewUserDetails.h" +#include "GUIWindowManager.h" +#include "BoxeeLoginManager.h" +#include "GUIDialogBoxeeLoginWizardAddNewUser.h" +#include "utils/log.h" +#include "LocalizeStrings.h" +#include "GUIRadioButtonControl.h" +#include "GUIEditControl.h" +#include "Application.h" +#include "GUIDialogOK2.h" +#include "BoxeeLoginWizardManager.h" +#include "RegExp.h" +#include "GUIBaseContainer.h" +#include "Util.h" +#include "lib/libBoxee/bxcredentials.h" +#include "lib/libBoxee/boxee.h" +#include "lib/libBoxee/bxconfiguration.h" +#include "lib/libBoxee/bxxmldocument.h" +#include "lib/libBoxee/bxutils.h" + +#define BUTTONS_GROUP_CONTROL_ID 8800 +#define CHOOSE_LIST_CONTROL_ID 8900 + +#define GENDER_BUTTON_CONTROL_ID 8801 +#define MONTH_BUTTON_CONTROL_ID 8802 +#define DAYS_BUTTON_CONTROL_ID 8803 +#define YEAR_BUTTON_CONTROL_ID 8804 + +#define SUBMIT_BUTTON_CONTROL_ID 8805 +#define SKIP_BUTTON_CONTROL_ID 8806 + +#define GENDER_LIST_ITEM_START_ID 55636 +#define GENDER_LIST_ITEM_END_ID 55638 + +#define BIRTH_YEAR_RANGE 100 +#define BIRTH_YEAR_AGE_TO_FOCUS_INIT 25 + +#define MONTH_LIST_ITEM_START_ID 21 +#define MONTH_LIST_ITEM_END_ID 32 + +#define NEW_USER_MIN_AGE 13.00 + +#define CHOOSE_LIST_TYPE_PROPERTY_NAME "choose-list-type" + +#define SELECTED_GENDER_WINDOW_PROPERTY "chosen-gender" +#define SELECTED_YEAR_WINDOW_PROPERTY "chosen-year" +#define SELECTED_MONTH_WINDOW_PROPERTY "chosen-month" +#define SELECTED_DAY_WINDOW_PROPERTY "chosen-day" + +CGUIDialogBoxeeLoginWizardNewUserDetails::CGUIDialogBoxeeLoginWizardNewUserDetails() : CGUIDialogBoxeeWizardBase(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_NEW_USER_DETAILS,"boxee_login_wizard_new_user_details.xml","CGUIDialogBoxeeLoginWizardNewUserDetails") +{ + initGenderList(); + initYearList(); + initMonthList(); + initDaysList(); + + Reset(); +} + +CGUIDialogBoxeeLoginWizardNewUserDetails::~CGUIDialogBoxeeLoginWizardNewUserDetails() +{ + +} + +void CGUIDialogBoxeeLoginWizardNewUserDetails::OnInitWindow() +{ + CGUIDialogBoxeeWizardBase::OnInitWindow(); + + Reset(); + + m_activeWindow = g_windowManager.GetWindow(g_windowManager.GetActiveWindow()); + + m_activeWindow->SetProperty(SELECTED_GENDER_WINDOW_PROPERTY,m_selectedGender); + m_activeWindow->SetProperty(SELECTED_YEAR_WINDOW_PROPERTY,m_selectedYear); + m_activeWindow->SetProperty(SELECTED_MONTH_WINDOW_PROPERTY,m_selectedMonth); + m_activeWindow->SetProperty(SELECTED_DAY_WINDOW_PROPERTY,m_selectedDay); + + m_activeListType = NONE_LIST; + m_saveFocusedControlId = 0; + + SET_CONTROL_HIDDEN(CHOOSE_LIST_CONTROL_ID); + SET_CONTROL_VISIBLE(BUTTONS_GROUP_CONTROL_ID); +} + +bool CGUIDialogBoxeeLoginWizardNewUserDetails::OnAction(const CAction& action) +{ + if (action.id == ACTION_PREVIOUS_MENU) + { + const CGUIControl* pButtons = GetControl(BUTTONS_GROUP_CONTROL_ID); + if (!pButtons || pButtons->IsVisible()) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardNewUserDetails::OnAction - ACTION_PREVIOUS_MENU - can't go back from here (blw)(digwiz)"); + return true; + } + else + { + SET_CONTROL_HIDDEN(CHOOSE_LIST_CONTROL_ID); + SET_CONTROL_VISIBLE(BUTTONS_GROUP_CONTROL_ID); + SET_CONTROL_FOCUS(m_saveFocusedControlId,0); + m_saveFocusedControlId = 0; + + return true; + } + } + + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +bool CGUIDialogBoxeeLoginWizardNewUserDetails::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + if (HandleClick(message)) + { + // continue to stay in this screen + return true; + } + } + break; + } + + return CGUIDialogBoxeeWizardBase::OnMessage(message); +} + +bool CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClick(CGUIMessage& message) +{ + int iControl = message.GetSenderId(); + + switch(iControl) + { + case GENDER_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClick - handling click on [Control=%d=GENDER_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnButton(m_genderList); + } + break; + case YEAR_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClick - handling click on [Control=%d=YEAR_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnButton(m_yearList); + } + break; + case MONTH_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClick - handling click on [Control=%d=MONTH_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnButton(m_monthList); + } + break; + case DAYS_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClick - handling click on [Control=%d=DAY_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnButton(m_daysList); + } + break; + case CHOOSE_LIST_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClick - handling click on [Control=%d=CHOOSE_LIST_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnChooseListItem(); + } + break; + case SUBMIT_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClick - handling click on [Control=%d=SUBMIT_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnSubmitButton(); + } + break; + case SKIP_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClick - handling click on [Control=%d=SKIP_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnSkipButton(); + } + break; + + + } + + return false; +} + +bool CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickNext() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickBack() +{ + return true; +} + +int CGUIDialogBoxeeLoginWizardNewUserDetails::GetFocusItemIndex() +{ + int focusedItemIndex = 0; + + switch(m_activeListType) + { + case GENDER_LIST: + { + if(m_selectedGender == g_localizeStrings.Get(55637)) //female + { + focusedItemIndex = 1; + } + } + break; + case YEAR_LIST: + { + if(m_selectedYear != "") + { + time_t now = time(NULL); + struct tm *tmNow = localtime(&now); + int currYear = tmNow->tm_year + 1900; + int selectedYear = BOXEE::BXUtils::StringToInt(m_selectedYear); + focusedItemIndex = BIRTH_YEAR_RANGE - (currYear - selectedYear); + } + else + { + focusedItemIndex = BIRTH_YEAR_RANGE - BIRTH_YEAR_AGE_TO_FOCUS_INIT - 1; + } + } + break; + case MONTH_LIST: + { + if(m_selectedMonth != "") + { + for (int i=MONTH_LIST_ITEM_START_ID; i<=MONTH_LIST_ITEM_END_ID; i++) + { + if (m_selectedMonth == g_localizeStrings.Get(i)) + { + focusedItemIndex = i - MONTH_LIST_ITEM_START_ID; + break; + } + } + } + } + break; + case DAYS_LIST: + { + if(m_selectedDay != "") + { + focusedItemIndex = BOXEE::BXUtils::StringToInt(m_selectedDay) - 1; + } + } + break; + default: + { + focusedItemIndex = 0; + } + break; + } + + return focusedItemIndex; +} + +bool CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnButton(CFileItemList& list) +{ + CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), CHOOSE_LIST_CONTROL_ID); + OnMessage(msg); + + CGUIMessage msg2(GUI_MSG_LABEL_BIND, GetID(), CHOOSE_LIST_CONTROL_ID, 0, 0, &list); + OnMessage(msg2); + + m_activeListType = (CHOOSE_LIST_TYPE)list.GetPropertyInt(CHOOSE_LIST_TYPE_PROPERTY_NAME); + + m_saveFocusedControlId = GetFocusedControlID(); + + SET_CONTROL_HIDDEN(BUTTONS_GROUP_CONTROL_ID); + SET_CONTROL_VISIBLE(CHOOSE_LIST_CONTROL_ID); + + int focusedItemIndex = GetFocusItemIndex(); + SET_CONTROL_FOCUS(CHOOSE_LIST_CONTROL_ID,focusedItemIndex); + + return true; +} + +bool CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnChooseListItem() +{ + CGUIBaseContainer* pList = (CGUIBaseContainer*)GetControl(CHOOSE_LIST_CONTROL_ID); + + if (!pList) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnChooseListItem - FAILED to get container [%d=CHOOSE_LIST_CONTROL_ID] container (blw)",CHOOSE_LIST_CONTROL_ID); + return false; + } + + CGUIListItemPtr selectedButton = pList->GetSelectedItemPtr(); + + if (!selectedButton.get()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnChooseListItem - FAILED to get selected FileItem from [%d=CHOOSE_LIST_CONTROL_ID] container (blw)",CHOOSE_LIST_CONTROL_ID); + return false; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnChooseListItem - selected item is [label=%s][choose-property=%d] (blw)",selectedButton->GetLabel().c_str(),selectedButton->GetPropertyInt(CHOOSE_LIST_TYPE_PROPERTY_NAME)); + + CStdString selectedLabel = selectedButton->GetLabel(); + + switch (m_activeListType) + { + case GENDER_LIST: + { + m_selectedGender = selectedLabel; + m_activeWindow->SetProperty(SELECTED_GENDER_WINDOW_PROPERTY,m_selectedGender); + } + break; + case YEAR_LIST: + { + m_selectedYear = selectedLabel; + m_activeWindow->SetProperty(SELECTED_YEAR_WINDOW_PROPERTY,m_selectedYear); + } + break; + case MONTH_LIST: + { + m_selectedMonth = selectedLabel; + m_activeWindow->SetProperty(SELECTED_MONTH_WINDOW_PROPERTY,m_selectedMonth); + } + break; + case DAYS_LIST: + { + m_selectedDay = selectedLabel; + m_activeWindow->SetProperty(SELECTED_DAY_WINDOW_PROPERTY,m_selectedDay); + } + break; + case NONE_LIST: + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnChooseListItem - FAILED to handle NONE_LIST type (blw)"); + return false; + } + break; + } + + SET_CONTROL_HIDDEN(CHOOSE_LIST_CONTROL_ID); + SET_CONTROL_VISIBLE(BUTTONS_GROUP_CONTROL_ID); + SET_CONTROL_FOCUS(m_saveFocusedControlId,0); + + m_saveFocusedControlId = 0; + + return true; +} + +bool CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnSubmitButton() +{ + if(!CanSubmit()) + { + return false; + } + + CStdString strUrl = BOXEE::BXConfiguration::GetInstance().GetStringParam("Boxee.Update.User.Details","http://app.boxee.tv/accountapi/updatedetails"); + + BOXEE::ListHttpHeaders headers; + //headers.push_back("Content-Type: text/xml"); + + BOXEE::BXXMLDocument doc; + //doc.SetCredentials(BOXEE::Boxee::GetInstance().GetCredentials()); + + CStdString postData = "dob="; + + CStdString monthAsNumberStr; + for (int i=MONTH_LIST_ITEM_START_ID; i<=MONTH_LIST_ITEM_END_ID; i++) + { + if (m_selectedMonth == g_localizeStrings.Get(i)) + { + monthAsNumberStr = BOXEE::BXUtils::IntToString(i - MONTH_LIST_ITEM_START_ID + 1); + if (i < (MONTH_LIST_ITEM_END_ID - 2)) + { + monthAsNumberStr = "0" + monthAsNumberStr; + } + + break; + } + } + + postData += m_selectedYear + "-" + monthAsNumberStr + "-" + m_selectedDay; + + CGUIDialogBoxeeLoginWizardAddNewUser* pDialog = (CGUIDialogBoxeeLoginWizardAddNewUser*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_ADD_NEW_USER); + if (!pDialog) + { + CLog::Log(LOGWARNING,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnSubmitButton - FAILED to get LOGIN_WIZARD_ADD_NEW_USER window. continue as skip (blw)"); + //return CloseDialog(CActionChoose::NEXT); + } + else + { + CStdString email = pDialog->GetEmail(); + if (email.IsEmpty()) + { + CLog::Log(LOGWARNING,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnSubmitButton - FAILED to get email. continue as NEXT (blw)"); + //return CloseDialog(CActionChoose::NEXT); + } + else + { + postData += "&email="; + postData += email; + } + + CStdString username = pDialog->GetUserName(); + if (username.IsEmpty()) + { + CLog::Log(LOGWARNING,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnSubmitButton - FAILED to get username. continue as NEXT (blw)"); + //return CloseDialog(CActionChoose::NEXT); + } + else + { + CStdString firstName = username; + CStdString lastName = ""; + + size_t spacePos = username.find(" "); + if (spacePos != std::string::npos) + { + firstName = username.substr(0,spacePos); + lastName = username.substr(spacePos+1); + } + + if (!firstName.IsEmpty()) + { + postData += "&fname="; + postData += firstName; + } + + if (!lastName.IsEmpty()) + { + postData += "&lname="; + postData += lastName; + } + } + } + + CStdString gender = ""; + if (m_selectedGender == g_localizeStrings.Get(55636)) + { + gender = "1"; + } + else if (m_selectedGender == g_localizeStrings.Get(55637)) + { + gender = "2"; + } + + if (!gender.IsEmpty()) + { + postData += "&gender="; + postData += gender; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnSubmitButton - going to update user details. postData is [%s] (blw)(cnu)",postData.c_str()); + + bool isSucceeded = false; + isSucceeded = doc.LoadFromURL(strUrl,headers,postData); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnSubmitButton - update user details returned [isSucceeded=%d][RetCode=%ld] (blw)(cnu)",isSucceeded,doc.GetLastRetCode()); + + if (!isSucceeded) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnSubmitButton - FAILED to update user details. continue as NEXT (blw)"); + CGUIDialogOK2::ShowAndGetInput(53701, 53473); + } + + return CloseDialog(CActionChoose::NEXT); +} + +bool CGUIDialogBoxeeLoginWizardNewUserDetails::IsAllFieldsWereChosen() +{ + if (m_selectedGender == g_localizeStrings.Get(55630) || + m_selectedYear == g_localizeStrings.Get(55651) || + m_selectedMonth == g_localizeStrings.Get(55652) || + m_selectedDay == g_localizeStrings.Get(55653)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardNewUserDetails::IsAllFieldsWereChosen - NOT all field was chosen (blw)"); + return false; + } + + return true; +} + +bool CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnSkipButton() +{ + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardNewUserDetails::HandleClickOnSkipButton - enter HandleClickOnSkipButton function (blw)"); + + return CloseDialog(CActionChoose::NEXT); +} + +bool CGUIDialogBoxeeLoginWizardNewUserDetails::CloseDialog(CActionChoose::ActionChooseEnums actionChoseEnum) +{ + m_actionChoseEnum = actionChoseEnum; + Close(); + return true; +} + +void CGUIDialogBoxeeLoginWizardNewUserDetails::initGenderList() +{ + m_genderList.Clear(); + + m_genderList.SetProperty(CHOOSE_LIST_TYPE_PROPERTY_NAME,GENDER_LIST); + for (int i=GENDER_LIST_ITEM_START_ID; i<=GENDER_LIST_ITEM_END_ID; i++) + { + CFileItemPtr item(new CFileItem(g_localizeStrings.Get(i))); + m_genderList.Add(item); + } +} + +void CGUIDialogBoxeeLoginWizardNewUserDetails::initYearList() +{ + m_yearList.Clear(); + + m_yearList.SetProperty(CHOOSE_LIST_TYPE_PROPERTY_NAME,YEAR_LIST); + + time_t now = time(NULL); + struct tm *tmNow = localtime(&now); + int currYear = tmNow->tm_year + 1900; + int startYear = currYear - BIRTH_YEAR_RANGE; + + for (int i=startYear; i <= currYear; i++) + { + char year[5]; + itoa(i,year,10); + CFileItemPtr item(new CFileItem(year)); + m_yearList.Add(item); + } +} + +void CGUIDialogBoxeeLoginWizardNewUserDetails::initMonthList() +{ + m_monthList.Clear(); + + m_monthList.SetProperty(CHOOSE_LIST_TYPE_PROPERTY_NAME,MONTH_LIST); + + for (int i=MONTH_LIST_ITEM_START_ID; i<=MONTH_LIST_ITEM_END_ID; i++) + { + CFileItemPtr item(new CFileItem(g_localizeStrings.Get(i))); + m_monthList.Add(item); + } +} + +void CGUIDialogBoxeeLoginWizardNewUserDetails::initDaysList() +{ + m_daysList.Clear(); + + m_daysList.SetProperty(CHOOSE_LIST_TYPE_PROPERTY_NAME,DAYS_LIST); + for (int i=1; i<=31; i++) + { + char day[5]; + itoa(i,day,10); + CFileItemPtr item(new CFileItem()); + + CStdString dayLabel(day); + if (i < 10) + { + dayLabel.Insert(0,'0'); + } + + item->SetLabel(dayLabel); + m_daysList.Add(item); + } +} + +bool CGUIDialogBoxeeLoginWizardNewUserDetails::CanSubmit() +{ + if (!IsAllFieldsWereChosen()) + { + CGUIDialogOK2::ShowAndGetInput(20068,55672); + return false; + } + + if(!GetIsAgeValid()) + { + CGUIDialogOK2::ShowAndGetInput(20068,55673); + return false; + } + + return true; +} + +bool CGUIDialogBoxeeLoginWizardNewUserDetails::GetIsAgeValid() +{ + bool isAgeValid = false; + // get current time + time_t tmNow = time(NULL); + + //init current time + struct tm currTime; + localtime_r(&tmNow, &currTime); + + // init birthday time + int birthdayYear = BOXEE::BXUtils::StringToInt(m_selectedYear); + int birthdayMonth = 0; + for (int i=MONTH_LIST_ITEM_START_ID; i<=MONTH_LIST_ITEM_END_ID; i++) + { + if (m_selectedMonth == g_localizeStrings.Get(i)) + { + birthdayMonth = i - MONTH_LIST_ITEM_START_ID + 1; + break; + } + } + int birthdayDay = BOXEE::BXUtils::StringToInt(m_selectedDay); + + struct tm birthdayTime; + localtime_r(&tmNow, &birthdayTime); + + birthdayTime.tm_mday = birthdayDay; + birthdayTime.tm_mon = birthdayMonth - 1; + birthdayTime.tm_year = birthdayYear - 1900; + + // calculate the diff + double diff = difftime(mktime(&currTime),mktime(&birthdayTime)); + + // compare the diff to the number of second of age 13 + if (diff > 410227200.0) + { + isAgeValid = true; + } + + return isAgeValid; +} + +CStdString CGUIDialogBoxeeLoginWizardNewUserDetails::GetGender() +{ + return m_selectedGender; +} + +CStdString CGUIDialogBoxeeLoginWizardNewUserDetails::GetYear() +{ + return m_selectedYear; +} + +CStdString CGUIDialogBoxeeLoginWizardNewUserDetails::GetMonth() +{ + return m_selectedMonth; +} + +CStdString CGUIDialogBoxeeLoginWizardNewUserDetails::GetDay() +{ + return m_selectedDay; +} + +void CGUIDialogBoxeeLoginWizardNewUserDetails::Reset() +{ + m_selectedGender = g_localizeStrings.Get(55630); + m_selectedYear = g_localizeStrings.Get(55651); + m_selectedMonth = g_localizeStrings.Get(55652); + m_selectedDay = g_localizeStrings.Get(55653); + + if (CBoxeeLoginWizardManager::GetInstance().GetServerUserInfoByRef().IsInitialize()) + { + CServerUserInfo serverUserInfo = CBoxeeLoginWizardManager::GetInstance().GetServerUserInfo(); + + CStdString gender = serverUserInfo.m_gender; + if (!gender.IsEmpty()) + { + gender.ToLower(); + m_selectedGender = (gender == "male") ? g_localizeStrings.Get(55636) : g_localizeStrings.Get(55637); + } + + if (!serverUserInfo.m_birthday.IsEmpty()) + { + std::vector birthdayTokens; + CUtil::Tokenize(serverUserInfo.m_birthday,birthdayTokens,"/"); + + if (birthdayTokens.size() > 2) + { + if (StringUtils::IsNaturalNumber(birthdayTokens[0])) + { + int month = BOXEE::BXUtils::StringToInt(birthdayTokens[0]); + m_selectedMonth = g_localizeStrings.Get(MONTH_LIST_ITEM_START_ID + month - 1); + } + + if (StringUtils::IsNaturalNumber(birthdayTokens[1])) + { + m_selectedDay = birthdayTokens[1]; + } + + if (StringUtils::IsNaturalNumber(birthdayTokens[2])) + { + m_selectedYear = birthdayTokens[2]; + } + } + } + } + + m_activeListType = NONE_LIST; +} + diff --git a/xbmc/GUIDialogBoxeeLoginWizardNewUserDetails.h b/xbmc/GUIDialogBoxeeLoginWizardNewUserDetails.h new file mode 100644 index 00000000..bc7a0904 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardNewUserDetails.h @@ -0,0 +1,67 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" +#include "FileItem.h" + +class CGUIDialogBoxeeLoginWizardNewUserDetails : public CGUIDialogBoxeeWizardBase +{ +public: + + CGUIDialogBoxeeLoginWizardNewUserDetails(); + virtual ~CGUIDialogBoxeeLoginWizardNewUserDetails(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + CStdString GetGender(); + CStdString GetYear(); + CStdString GetMonth(); + CStdString GetDay(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + +private: + + enum CHOOSE_LIST_TYPE {NONE_LIST=0,GENDER_LIST=1,YEAR_LIST=2,MONTH_LIST=3,DAYS_LIST=4}; + + bool HandleClick(CGUIMessage& message); + + bool HandleClickOnButton(CFileItemList& list); + bool HandleClickOnChooseListItem(); + bool HandleClickOnSubmitButton(); + bool HandleClickOnSkipButton(); + + int GetFocusItemIndex(); + + bool IsAllFieldsWereChosen(); + bool GetIsAgeValid(); + bool CanSubmit(); + + void Reset(); + + bool CloseDialog(CActionChoose::ActionChooseEnums actionChoseEnum); + + void initGenderList(); + void initYearList(); + void initMonthList(); + void initDaysList(); + + CFileItemList m_genderList; + CFileItemList m_yearList; + CFileItemList m_monthList; + CFileItemList m_daysList; + + CStdString m_selectedGender; + CStdString m_selectedYear; + CStdString m_selectedMonth; + CStdString m_selectedDay; + + CHOOSE_LIST_TYPE m_activeListType; + + int m_saveFocusedControlId; + CGUIWindow* m_activeWindow; +}; diff --git a/xbmc/GUIDialogBoxeeLoginWizardQuickTip.cpp b/xbmc/GUIDialogBoxeeLoginWizardQuickTip.cpp new file mode 100644 index 00000000..7b5d28e1 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardQuickTip.cpp @@ -0,0 +1,47 @@ +#include "GUIDialogBoxeeLoginWizardQuickTip.h" +#include "GUIWindowManager.h" +#include "BoxeeUtils.h" +#include "log.h" + +CGUIDialogBoxeeLoginWizardQuickTip::CGUIDialogBoxeeLoginWizardQuickTip() : CGUIDialogBoxeeWizardBase(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_QUICK_TIP, "boxee_login_wizard_quick_tip.xml", "CGUIDialogBoxeeLoginWizardQuickTip") +{ + +} + + +CGUIDialogBoxeeLoginWizardQuickTip::~CGUIDialogBoxeeLoginWizardQuickTip() +{ + +} + +bool CGUIDialogBoxeeLoginWizardQuickTip::OnAction(const CAction& action) +{ + if (action.id == ACTION_PREVIOUS_MENU) + { + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + return true; + } + + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +bool CGUIDialogBoxeeLoginWizardQuickTip::OnMessage(CGUIMessage& message) +{ + return CGUIDialogBoxeeWizardBase::OnMessage(message); +} + +void CGUIDialogBoxeeLoginWizardQuickTip::OnInitWindow() +{ + CGUIDialogBoxeeWizardBase::OnInitWindow(); +} + +bool CGUIDialogBoxeeLoginWizardQuickTip::HandleClickNext() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardQuickTip::HandleClickBack() +{ + return true; +} diff --git a/xbmc/GUIDialogBoxeeLoginWizardQuickTip.h b/xbmc/GUIDialogBoxeeLoginWizardQuickTip.h new file mode 100644 index 00000000..6cb9392d --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardQuickTip.h @@ -0,0 +1,21 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" + +class CGUIDialogBoxeeLoginWizardQuickTip : public CGUIDialogBoxeeWizardBase +{ +public: + CGUIDialogBoxeeLoginWizardQuickTip(); + virtual ~CGUIDialogBoxeeLoginWizardQuickTip(); + + virtual bool OnAction(const CAction& action); + virtual bool OnMessage(CGUIMessage &message); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); +}; + diff --git a/xbmc/GUIDialogBoxeeLoginWizardQuickTipAirPlay.cpp b/xbmc/GUIDialogBoxeeLoginWizardQuickTipAirPlay.cpp new file mode 100644 index 00000000..f3428fce --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardQuickTipAirPlay.cpp @@ -0,0 +1,45 @@ +#include "GUIDialogBoxeeLoginWizardQuickTipAirPlay.h" +#include "log.h" + +CGUIDialogBoxeeLoginWizardQuickTipAirPlay::CGUIDialogBoxeeLoginWizardQuickTipAirPlay() : CGUIDialogBoxeeWizardBase(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_QUICK_TIP_AIRPLAY, "boxee_login_wizard_quick_tip_airplay.xml", "CGUIDialogBoxeeLoginWizardQuickTipAirPlay") +{ + +} + + +CGUIDialogBoxeeLoginWizardQuickTipAirPlay::~CGUIDialogBoxeeLoginWizardQuickTipAirPlay() +{ + +} + +bool CGUIDialogBoxeeLoginWizardQuickTipAirPlay::OnAction(const CAction& action) +{ + if (action.id == ACTION_PREVIOUS_MENU) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardQuickTipAirPlay::OnAction - ACTION_PREVIOUS_MENU - can't go back from here (blw)(digwiz)"); + return true; + } + + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +bool CGUIDialogBoxeeLoginWizardQuickTipAirPlay::OnMessage(CGUIMessage& message) +{ + return CGUIDialogBoxeeWizardBase::OnMessage(message); +} + +void CGUIDialogBoxeeLoginWizardQuickTipAirPlay::OnInitWindow() +{ + CGUIDialogBoxeeWizardBase::OnInitWindow(); +} + +bool CGUIDialogBoxeeLoginWizardQuickTipAirPlay::HandleClickNext() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardQuickTipAirPlay::HandleClickBack() +{ + return true; +} + diff --git a/xbmc/GUIDialogBoxeeLoginWizardQuickTipAirPlay.h b/xbmc/GUIDialogBoxeeLoginWizardQuickTipAirPlay.h new file mode 100644 index 00000000..8346692f --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardQuickTipAirPlay.h @@ -0,0 +1,21 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" + +class CGUIDialogBoxeeLoginWizardQuickTipAirPlay : public CGUIDialogBoxeeWizardBase +{ +public: + CGUIDialogBoxeeLoginWizardQuickTipAirPlay(); + virtual ~CGUIDialogBoxeeLoginWizardQuickTipAirPlay(); + + virtual bool OnAction(const CAction& action); + virtual bool OnMessage(CGUIMessage &message); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); +}; + diff --git a/xbmc/GUIDialogBoxeeLoginWizardTOU.cpp b/xbmc/GUIDialogBoxeeLoginWizardTOU.cpp new file mode 100644 index 00000000..f482529b --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardTOU.cpp @@ -0,0 +1,205 @@ +#include "GUIDialogBoxeeLoginWizardTOU.h" +#include "utils/log.h" +#include "GUIDialogProgress.h" +#include "lib/libBoxee/bxconfiguration.h" +#include "lib/libBoxee/bxcurl.h" +#include "GUIDialogOK2.h" +#include "LocalizeStrings.h" +#include "GUITextBox.h" +#include "GUIWindowManager.h" +#include "FileItem.h" + +#define HIDDEN_CONTAINER 5000 + +#define BUTTONS_GROUP_CONTROL_ID 8700 +#define TEXTBOX_GROUP_CONTROL_ID 8800 + +#define TOU_BUTTON_CONTROL_ID 8701 +#define PP_BUTTON_CONTROL_ID 8702 + +#define SCROLL_CONTROL_ID 8801 +#define TEXTBOX_CONTROL_ID 8802 +#define TEXTBOX_TITLE_CONTROL_ID 8803 + +CGUIDialogBoxeeLoginWizardTOU::CGUIDialogBoxeeLoginWizardTOU() : CGUIDialogBoxeeWizardBase(WINDOW_DIALOG_BOXEE_LOGIN_WIZARD_TOU,"boxee_login_wizard_tou.xml","CGUIDialogBoxeeLoginWizardTOU") +{ + +} + +CGUIDialogBoxeeLoginWizardTOU::~CGUIDialogBoxeeLoginWizardTOU() +{ + +} + +void CGUIDialogBoxeeLoginWizardTOU::OnInitWindow() +{ + CGUIDialogBoxeeWizardBase::OnInitWindow(); + + SET_CONTROL_HIDDEN(TEXTBOX_GROUP_CONTROL_ID); + SET_CONTROL_VISIBLE(BUTTONS_GROUP_CONTROL_ID); +} + +bool CGUIDialogBoxeeLoginWizardTOU::OnAction(const CAction& action) +{ + if (action.id == ACTION_PREVIOUS_MENU) + { + int focusedControlId = GetFocusedControlID(); + if (focusedControlId == SCROLL_CONTROL_ID) + { + SET_CONTROL_HIDDEN(TEXTBOX_GROUP_CONTROL_ID); + SET_CONTROL_VISIBLE(BUTTONS_GROUP_CONTROL_ID); + SET_CONTROL_FOCUS(BUTTONS_GROUP_CONTROL_ID,0); + return true; + } + } + + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +bool CGUIDialogBoxeeLoginWizardTOU::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + if (HandleClick(message)) + { + // continue to stay in this screen + return true; + } + } + break; + } + + return CGUIDialogBoxeeWizardBase::OnMessage(message); +} + +bool CGUIDialogBoxeeLoginWizardTOU::HandleClick(CGUIMessage& message) +{ + int iControl = message.GetSenderId(); + + switch(iControl) + { + case TOU_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardTOU::HandleClick - handling click on [Control=%d=TOU_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnTouButton(); + } + break; + case PP_BUTTON_CONTROL_ID: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeLoginWizardTOU::HandleClick - handling click on [Control=%d=PP_BUTTON_CONTROL_ID] (blw)(digwiz)",iControl); + return HandleClickOnPpButton(); + } + break; + } + + return false; +} + +bool CGUIDialogBoxeeLoginWizardTOU::HandleClickNext() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardTOU::HandleClickBack() +{ + return true; +} + +bool CGUIDialogBoxeeLoginWizardTOU::HandleClickOnTouButton() +{ + if (m_touStr.IsEmpty()) + { + CGUIDialogProgress* progress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); + if (progress) + { + progress->StartModal(); + progress->Progress(); + } + + // verify the username is available + CStdString strUrl = BOXEE::BXConfiguration::GetInstance().GetStringParam("Boxee.Term.Of.Use","http://app.boxee.tv/api/getlegal?page=tou"); + BOXEE::BXCurl curl; + + m_touStr = curl.HttpGetString(strUrl, false); + + if (progress) + { + progress->Close(); + } + + if (m_touStr.IsEmpty()) + { + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(53432)); + return true; + } + } + + if (!InitContainerText(m_touStr)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardTOU::HandleClickOnTouButton - FAILED to get TextBox container. [id=%d] (blw)(digwiz)",TEXTBOX_CONTROL_ID); + return true; + } + + SET_CONTROL_HIDDEN(BUTTONS_GROUP_CONTROL_ID); + SET_CONTROL_VISIBLE(TEXTBOX_GROUP_CONTROL_ID); + SET_CONTROL_LABEL(TEXTBOX_TITLE_CONTROL_ID,g_localizeStrings.Get(53436)); + SET_CONTROL_FOCUS(SCROLL_CONTROL_ID,0); + + return true; +} + +bool CGUIDialogBoxeeLoginWizardTOU::HandleClickOnPpButton() +{ + if (m_ppStr.IsEmpty()) + { + CGUIDialogProgress* progress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); + if (progress) + { + progress->StartModal(); + progress->Progress(); + } + + CStdString strUrl = BOXEE::BXConfiguration::GetInstance().GetStringParam("Boxee.Privacy.Policy","http://app.boxee.tv/api/getlegal?page=privacy"); + BOXEE::BXCurl curl; + + m_ppStr = curl.HttpGetString(strUrl, false); + + if (progress) + { + progress->Close(); + } + + if (m_ppStr.IsEmpty()) + { + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(53433)); + return true; + } + } + + if (!InitContainerText(m_ppStr)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeLoginWizardTOU::HandleClickOnPpButton - FAILED to get TextBox container. [id=%d] (blw)(digwiz)",TEXTBOX_CONTROL_ID); + return true; + } + + SET_CONTROL_HIDDEN(BUTTONS_GROUP_CONTROL_ID); + SET_CONTROL_VISIBLE(TEXTBOX_GROUP_CONTROL_ID); + SET_CONTROL_LABEL(TEXTBOX_TITLE_CONTROL_ID,g_localizeStrings.Get(53438)); + SET_CONTROL_FOCUS(SCROLL_CONTROL_ID,0); + + return true; +} + +bool CGUIDialogBoxeeLoginWizardTOU::InitContainerText(const CStdString& text) +{ + CGUIMessage winmsg1(GUI_MSG_LABEL_RESET, GetID(), HIDDEN_CONTAINER); + OnMessage(winmsg1); + + CFileItemPtr itemPtr(new CFileItem(text)); + CGUIMessage winmsg2(GUI_MSG_LABEL_ADD, GetID(), HIDDEN_CONTAINER, 0, 0, itemPtr); + OnMessage(winmsg2); + + return true; +} diff --git a/xbmc/GUIDialogBoxeeLoginWizardTOU.h b/xbmc/GUIDialogBoxeeLoginWizardTOU.h new file mode 100644 index 00000000..a3842528 --- /dev/null +++ b/xbmc/GUIDialogBoxeeLoginWizardTOU.h @@ -0,0 +1,32 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" + +class CGUIDialogBoxeeLoginWizardTOU : public CGUIDialogBoxeeWizardBase +{ +public: + + CGUIDialogBoxeeLoginWizardTOU(); + virtual ~CGUIDialogBoxeeLoginWizardTOU(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + +private: + + bool HandleClick(CGUIMessage& message); + + bool HandleClickOnTouButton(); + bool HandleClickOnPpButton(); + + bool InitContainerText(const CStdString& text); + + CStdString m_touStr; + CStdString m_ppStr; +}; diff --git a/xbmc/GUIDialogBoxeeMakeBoxeeSocial.cpp b/xbmc/GUIDialogBoxeeMakeBoxeeSocial.cpp new file mode 100644 index 00000000..61607d6e --- /dev/null +++ b/xbmc/GUIDialogBoxeeMakeBoxeeSocial.cpp @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "GUIDialogBoxeeMakeBoxeeSocial.h" +#include "FileSystem/BoxeeServerDirectory.h" +#include "lib/libBoxee/bxconfiguration.h" +#include "utils/log.h" +#include "LocalizeStrings.h" +#include "GUIDialogOK2.h" +#include "bxutils.h" +#include "Application.h" + +using namespace std; +using namespace BOXEE; + +#define FACEBOOK_BUTTON 250 +#define TWITTER_BUTTON 251 +#define TUMBLR_BUTTON 252 +#define DONE_BUTTON 7092 +#define OFFLINE_DONE_BUTTON 7192 + +CGUIDialogBoxeeMakeBoxeeSocial::CGUIDialogBoxeeMakeBoxeeSocial(void) + : CGUIDialog(WINDOW_DIALOG_BOXEE_MAKE_SOCIAL,"boxee_make_social.xml") +{ +} + +CGUIDialogBoxeeMakeBoxeeSocial::~CGUIDialogBoxeeMakeBoxeeSocial(void) +{ +} + +void CGUIDialogBoxeeMakeBoxeeSocial::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + if (g_application.IsConnectedToInternet()) + { + SET_CONTROL_FOCUS(FACEBOOK_BUTTON, 0); + } + else + { + SET_CONTROL_FOCUS(OFFLINE_DONE_BUTTON, 0); + } + + m_bIsConfirmed = false; +} + +bool CGUIDialogBoxeeMakeBoxeeSocial::OnAction(const CAction &action) +{ + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeeMakeBoxeeSocial::OnMessage(CGUIMessage& message) +{ + if(message.GetMessage() == GUI_MSG_CLICKED) + { + m_bIsConfirmed = true; + if(message.GetSenderId() == FACEBOOK_BUTTON) + { + g_application.GetBoxeeSocialUtilsUIManager().HandleUISocialUtilConnect(FACEBOOK_SERVICE_ID); + return true; + } + if(message.GetSenderId() == TWITTER_BUTTON) + { + g_application.GetBoxeeSocialUtilsUIManager().HandleUISocialUtilConnect(TWITTER_SERVICE_ID); + return true; + } + if(message.GetSenderId() == TUMBLR_BUTTON) + { + g_application.GetBoxeeSocialUtilsUIManager().HandleUISocialUtilConnect(TUMBLR_SERVICE_ID); + return true; + } + if(message.GetSenderId() == DONE_BUTTON || (message.GetSenderId() == OFFLINE_DONE_BUTTON && !g_application.IsConnectedToInternet())) + { + Close(); + return true; + } + } + + return CGUIDialog::OnMessage(message); +} diff --git a/xbmc/GUIDialogBoxeeMakeBoxeeSocial.h b/xbmc/GUIDialogBoxeeMakeBoxeeSocial.h new file mode 100644 index 00000000..91bc3ac5 --- /dev/null +++ b/xbmc/GUIDialogBoxeeMakeBoxeeSocial.h @@ -0,0 +1,39 @@ +#pragma once + +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "GUIDialog.h" + + +class CGUIDialogBoxeeMakeBoxeeSocial : +public CGUIDialog +{ +public: + CGUIDialogBoxeeMakeBoxeeSocial(void); + virtual ~CGUIDialogBoxeeMakeBoxeeSocial(void); + virtual void OnInitWindow(); + + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction &action); + + bool m_bIsConfirmed; +}; diff --git a/xbmc/GUIDialogBoxeeManualResolveAlbum.cpp b/xbmc/GUIDialogBoxeeManualResolveAlbum.cpp new file mode 100644 index 00000000..a15af87e --- /dev/null +++ b/xbmc/GUIDialogBoxeeManualResolveAlbum.cpp @@ -0,0 +1,87 @@ + +#include "GUIDialogBoxeeManualResolveAlbum.h" +#include "GUIDialogBoxeeManualResolveResults.h" +#include "GUIWindowManager.h" +#include "Util.h" +#include "utils/log.h" +#include "LocalizeStrings.h" +#include "GUIEditControl.h" +#include "GUIImage.h" + +using namespace BOXEE; + +#define ALBUM_COVER 5015 +#define BUTTON_DONE 9010 +#define BUTTON_PREV 9020 + +CGUIDialogBoxeeManualResolveAlbum::CGUIDialogBoxeeManualResolveAlbum() : + CGUIDialog(WINDOW_DIALOG_BOXEE_MANUAL_RESOLVE_ALBUM, "boxee_manual_resolve_album.xml") + { + m_bConfirmed = false; + } + +CGUIDialogBoxeeManualResolveAlbum::~CGUIDialogBoxeeManualResolveAlbum() { +} + +bool CGUIDialogBoxeeManualResolveAlbum::Show(CFileItemPtr pItem) +{ + CGUIDialogBoxeeManualResolveAlbum *pDialog = (CGUIDialogBoxeeManualResolveAlbum*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_MANUAL_RESOLVE_ALBUM); + if (!pDialog) + { + return false; + } + + // Copy the item into the dialog + pItem->Dump(); + pDialog->m_albumItem = pItem; + pDialog->DoModal(); + + return pDialog->m_bConfirmed; +} + +void CGUIDialogBoxeeManualResolveAlbum::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + // Send the item to the special container to allow skin acceess + CFileItemPtr itemPtr(new CFileItem(*m_albumItem.get())); + CGUIMessage winmsg(GUI_MSG_LABEL_ADD, GetID(), 5000, 0, 0, itemPtr); + g_windowManager.SendThreadMessage(winmsg); + + m_albumItem->Dump(); + + CLog::Log(LOGDEBUG, "CGUIDialogBoxeeManualResolveAlbum::OnInitWindow, confirm album, thumb path = %s (manual)", m_albumItem->GetThumbnailImage().c_str()); +} + +void CGUIDialogBoxeeManualResolveAlbum::OnDeinitWindow(int nextWindowID) +{ + CGUIDialog::OnDeinitWindow(nextWindowID); + + CGUIImage* pImage = (CGUIImage*)GetControl(ALBUM_COVER); + pImage->FreeResources(); +} + +bool CGUIDialogBoxeeManualResolveAlbum::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_CLICKED: + { + int iControl = message.GetSenderId(); + if (iControl == BUTTON_PREV) + { + m_bConfirmed = false; + Close(); + return true; + } + else if (iControl == BUTTON_DONE) + { + m_bConfirmed = true; + Close(); + return true; + } + } + break; + } // switch + return CGUIDialog::OnMessage(message); +} diff --git a/xbmc/GUIDialogBoxeeManualResolveAlbum.h b/xbmc/GUIDialogBoxeeManualResolveAlbum.h new file mode 100644 index 00000000..786ee535 --- /dev/null +++ b/xbmc/GUIDialogBoxeeManualResolveAlbum.h @@ -0,0 +1,35 @@ +#pragma once + +#ifndef GUIDIALOGBOXEEMANUALRESOLVEALBUM_H_ +#define GUIDIALOGBOXEEMANUALRESOLVEALBUM_H_ + +#include "GUIDialog.h" +#include "FileItem.h" +#include "FileSystem/FileCurl.h" +#include "GUIDialogBoxBase.h" +#include "Thread.h" + +class CGUIDialogBoxeeManualResolveAlbum : public CGUIDialog +{ + +public: + CGUIDialogBoxeeManualResolveAlbum(); + virtual ~CGUIDialogBoxeeManualResolveAlbum(); + + static bool Show(CFileItemPtr pItem); + + virtual bool OnMessage(CGUIMessage &message); + //bool OnAction(const CAction& action); + +protected: + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + +private: + + CFileItemPtr m_albumItem; + bool m_bConfirmed; + +}; + +#endif /* GUIDIALOGBOXEEMANUALRESOLVEALBUM_H_ */ diff --git a/xbmc/GUIDialogBoxeeManualResolveAudio.cpp b/xbmc/GUIDialogBoxeeManualResolveAudio.cpp new file mode 100644 index 00000000..ea0656e4 --- /dev/null +++ b/xbmc/GUIDialogBoxeeManualResolveAudio.cpp @@ -0,0 +1,291 @@ + +#include "GUIDialogBoxeeManualResolveAudio.h" +#include "GUIWindowManager.h" +#include "Util.h" +#include "utils/log.h" +#include "LocalizeStrings.h" +#include "BoxeeUtils.h" +#include "lib/libBoxee/bxmetadataengine.h" +#include "lib/libBoxee/boxee.h" +#include "GUIEditControl.h" +#include "MetadataResolver.h" +#include "SpecialProtocol.h" +#include "FileSystem/Directory.h" +#include "FileSystem/BoxeeDatabaseDirectory.h" +#include "Picture.h" +#include "FileSystem/File.h" +#include "GUIDialogBoxeeManualResolveAlbum.h" +#include "MusicInfoTag.h" + +using namespace BOXEE; + +#define TITLE_EDIT 5010 +#define BTN_SEARCH 5020 +#define BTN_DROP 5025 +#define RESULT_LIST 5030 + +CGetAlbumResultListBG::CGetAlbumResultListBG(const CStdString& strTitle, CFileItemList* fileList) +{ + m_strTitle = strTitle; + m_pFileList = fileList; +} + +void CGetAlbumResultListBG::Run() +{ + BXXMLDocument doc; + bool bRetVal = false; + + //establish the connection and query the server + bRetVal = CMetadataResolverMusic::GetResultsFromServer(m_strTitle,"",5,doc); + + if (bRetVal) //read the data from the xml + bRetVal = CMetadataResolverMusic::LoadAlbumsInfo(doc,m_vectorAlbums); + + //cast to CFileItemPtr and add it to the list + for (unsigned int i = 0 ; i < m_vectorAlbums.size() ; ++i) + { + BXAlbum* pAlbum = (BXAlbum*)m_vectorAlbums[i].GetDetail(MEDIA_DETAIL_ALBUM); + + CFileItemPtr resultItem (new CFileItem(pAlbum->m_strTitle)); + + DIRECTORY::CBoxeeDatabaseDirectory::CreateAlbumItem(&m_vectorAlbums[i], resultItem.get()); + + //cache the album thumb for results + CStdString strCachedThumb = CUtil::GetCachedAlbumThumb(pAlbum->m_strTitle,pAlbum->m_strArtist); + + // TODO: Move image loading to a separate job, in case for some reason the image is not avaialble + if (CPicture::CreateThumbnail(resultItem->GetThumbnailImage(), strCachedThumb, false)) + { + CUtil::ThumbCacheAdd(strCachedThumb,true); + resultItem->SetThumbnailImage(strCachedThumb); + } + + m_pFileList->Add(resultItem); + } +} + +CGUIDialogBoxeeManualResolveAudio::CGUIDialogBoxeeManualResolveAudio() : + CGUIDialog(WINDOW_DIALOG_BOXEE_MANUAL_RESOLVE_AUDIO, "boxee_manual_resolve_audio.xml"), m_resolvedMetadata(MEDIA_ITEM_TYPE_AUDIO) + { + m_bConfirmed = false; + } + +CGUIDialogBoxeeManualResolveAudio::~CGUIDialogBoxeeManualResolveAudio() { +} + +bool CGUIDialogBoxeeManualResolveAudio::Show(CFileItemPtr pItem) +{ + if (!pItem) return false; + + CGUIDialogBoxeeManualResolveAudio *pDialog = (CGUIDialogBoxeeManualResolveAudio*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_MANUAL_RESOLVE_AUDIO); + if (pDialog) + { + // Copy the item into the dialog + pDialog->Reset(); + pDialog->m_unresolvedItem = pItem; + pDialog->DoModal(); + + return pDialog->m_bConfirmed; + } + + return false; +} + +void CGUIDialogBoxeeManualResolveAudio::Reset() +{ + m_resolvedMetadata.Reset(); + m_resultListItems.Clear(); +} + +void CGUIDialogBoxeeManualResolveAudio::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + m_bConfirmed = false; + + m_resultListItems.Clear(); + + m_unresolvedItem->Dump(); + + // Send the item to the special container to allow skin acceess + CFileItemPtr itemPtr(new CFileItem(*m_unresolvedItem.get())); + CGUIMessage winmsg(GUI_MSG_LABEL_ADD, GetID(), 5000, 0, 0, itemPtr); + g_windowManager.SendThreadMessage(winmsg); + + CLog::Log(LOGERROR, "CGUIDialogBoxeeManualResolve::OnInitWindow, initialized manual resolve video, path = %s (manual)", m_unresolvedItem->m_strPath.c_str()); + + // Set extracted name as a starting point for manual resolving + ((CGUIEditControl*)GetControl(TITLE_EDIT))->SetLabel2(m_unresolvedItem->GetLabel()); + +} + +void CGUIDialogBoxeeManualResolveAudio::OnDeinitWindow(int nextWindowID) +{ + CGUIDialog::OnDeinitWindow(nextWindowID); +} + +bool CGUIDialogBoxeeManualResolveAudio::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_CLICKED: + { + int iControl = message.GetSenderId(); + if (iControl == BTN_SEARCH) + { + GetList(); + return true; + } + else if (iControl == RESULT_LIST) + { + // Get selected item from the list and open matching details dialog + CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), RESULT_LIST); + OnMessage(msg); + + int iSelectedItem = msg.GetParam1(); + + if (iSelectedItem < 0 || iSelectedItem > m_resultListItems.Size() -1) + return true; + + m_selectedItem = m_resultListItems.Get(iSelectedItem); + + if (m_selectedItem->HasProperty("listerror")) + { + return true; + } + + m_bConfirmed = CGUIDialogBoxeeManualResolveAlbum::Show(m_selectedItem); + + if (m_bConfirmed) + { + AddAlbum(m_selectedItem); + Close(); + return true; + //TODO: change items properties + } + } + } + break; + } // switch + return CGUIDialog::OnMessage(message); +} + +bool CGUIDialogBoxeeManualResolveAudio::AddAlbum(CFileItemPtr _selectedItem) +{ + BOXEE::BXMetadataEngine& MDE = BOXEE::Boxee::GetInstance().GetMetadataEngine(); + std::vector vectorAlbumTracks; + BOXEE::BXAlbum album; + CStdString folderPath = m_unresolvedItem->GetProperty("AlbumFolderPath"); + int iAlbumId; + + if (MDE.GetAlbumByPath(folderPath,&album) != MEDIA_DATABASE_ERROR) + { + //read all track in the current album + if (MDE.GetSongsFromAlbum(album.m_iId,vectorAlbumTracks) == MEDIA_DATABASE_ERROR) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeManualResolveAudio::AddAlbum, Could not get album track list for album id: %d",album.m_iId); + return false; + } + + //delete the old album + if (MDE.RemoveAlbumById(album.m_iId) == MEDIA_DATABASE_ERROR) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeManualResolveAudio::AddAlbum, could not remove album id: %d , does it exist?",album.m_iId); + return false; + } + + //delete the old tracks related to that album + if (MDE.RemoveAudioByPath(folderPath) == MEDIA_DATABASE_ERROR) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeManualResolveAudio::AddAlbum, could not find audio tracks with this path %s",folderPath.c_str()); + return false; + } + + album.m_strArtwork = _selectedItem->GetThumbnailImage(); + album.m_strTitle = _selectedItem->GetMusicInfoTag()->GetAlbum(); + album.m_strGenre = _selectedItem->GetMusicInfoTag()->GetGenre(); + album.m_strDescription = _selectedItem->GetMusicInfoTag()->GetComment(); + + // if its a totally different artist + if (album.m_strArtist != _selectedItem->GetMusicInfoTag()->GetArtist()) + { + BOXEE::BXArtist artist; + int iArtistId; + artist.m_strName = _selectedItem->GetMusicInfoTag()->GetArtist(); + //add the new artist to our db + iArtistId = MDE.AddArtist(&artist); + + if (iArtistId == MEDIA_DATABASE_ERROR) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeManualResolveAudio::AddAlbum, could not add the artist.."); + artist.Dump(); + return false; + } + + //set the value of this album to the corresponding artist + album.m_strArtist = _selectedItem->GetMusicInfoTag()->GetArtist(); + album.m_iArtistId = iArtistId; + + std::vector::iterator it = vectorAlbumTracks.begin(); + for (; it != vectorAlbumTracks.end(); it++) + { + BXAudio* pAudio = (BXAudio*) (*it)->GetDetail(MEDIA_DETAIL_AUDIO); + pAudio->m_iArtistId = iArtistId; + } + } + + //add the new album to the database + iAlbumId = MDE.AddAlbum(&album); + if (iAlbumId == MEDIA_DATABASE_ERROR) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeManualResolveAudio::AddAlbum, could not add the album.."); + album.Dump(); + return false; + } + + m_unresolvedItem->SetProperty("BoxeeDBAlbumId",iAlbumId); + //set the files to be related to the new album id + for (std::vector::iterator it = vectorAlbumTracks.begin() ; + it != vectorAlbumTracks.end(); it++) + { + BXAudio* pAudio = (BXAudio*) (*it)->GetDetail(MEDIA_DETAIL_AUDIO); + pAudio->m_iAlbumId = iAlbumId; + MDE.AddAudio(pAudio); + } + + + //update the its resolved already. + MDE.UpdateAudioFileStatus(folderPath,STATUS_RESOLVED); + } + + return true; +} + +bool CGUIDialogBoxeeManualResolveAudio::GetList() +{ + // Get the name with which we should resolve + CStdString title = ((CGUIEditControl*)GetControl(TITLE_EDIT))->GetLabel2(); + + m_resultListItems.Clear(); + + CLog::Log(LOGDEBUG, "CGUIDialogBoxeeManualResolveAudio::GetList, get all results for title = %s (manual)", title.c_str()); + CGetAlbumResultListBG* pJob = new CGetAlbumResultListBG(title , &m_resultListItems); + bool bResult = (CUtil::RunInBG(pJob) == JOB_SUCCEEDED); + if (!bResult) + { + CLog::Log(LOGERROR, "CGUIDialogBoxeeManualResolveAudio::GetList, could not get list for title = %s (manual)", title.c_str()); + CFileItemPtr itemPtr(new CFileItem(g_localizeStrings.Get(52116))); + itemPtr->SetProperty("listerror", true); + + m_resultListItems.Add(itemPtr); + } + + CGUIMessage message(GUI_MSG_LABEL_RESET, GetID(), RESULT_LIST); + OnMessage(message); + + // Populate the list with results + CGUIMessage message2(GUI_MSG_LABEL_BIND, GetID(), RESULT_LIST, 0, 0, &m_resultListItems); + OnMessage(message2); + + return bResult; +} diff --git a/xbmc/GUIDialogBoxeeManualResolveAudio.h b/xbmc/GUIDialogBoxeeManualResolveAudio.h new file mode 100644 index 00000000..ef12675d --- /dev/null +++ b/xbmc/GUIDialogBoxeeManualResolveAudio.h @@ -0,0 +1,61 @@ +#pragma once + +#ifndef GUIDIALOGBOXEEMANUALRESOLVEAUDIO_H_ +#define GUIDIALOGBOXEEMANUALRESOLVEAUDIO_H_ + +#include "GUIDialog.h" +#include "FileItem.h" +#include "Thread.h" +#include "GUIDialogBoxBase.h" +#include "MetadataResolverMusic.h" + +class CGetAlbumResultListBG : public IRunnable +{ +public: + CGetAlbumResultListBG(const CStdString& strTitle , CFileItemList* fileList); + virtual ~CGetAlbumResultListBG() {} + + virtual void Run(); + + CStdString m_strTitle; + vectorMetadata m_vectorAlbums; + CFileItemList* m_pFileList; +}; + +class CGUIDialogBoxeeManualResolveAudio : public CGUIDialog +{ + +public: + CGUIDialogBoxeeManualResolveAudio(); + virtual ~CGUIDialogBoxeeManualResolveAudio(); + + static bool Show(CFileItemPtr pItem); + + virtual bool OnMessage(CGUIMessage &message); + +protected: + void Reset(); + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + + bool GetList(); + bool AddAlbum(CFileItemPtr _selectedItem); + +private: + + CFileItemPtr m_unresolvedItem; + CFileItemPtr m_resolvedItem; + + BOXEE::BXMetadata m_resolvedMetadata; + + // Items returned as a result list from the server + CFileItemList m_resultListItems; + + // Item that the user has selected + CFileItemPtr m_selectedItem; + + bool m_bConfirmed; + +}; + +#endif /* GUIDIALOGBOXEEMANUALRESOLVEAUDIO_H_ */ diff --git a/xbmc/GUIDialogBoxeeOTAConfiguration.cpp b/xbmc/GUIDialogBoxeeOTAConfiguration.cpp new file mode 100644 index 00000000..c882ac05 --- /dev/null +++ b/xbmc/GUIDialogBoxeeOTAConfiguration.cpp @@ -0,0 +1,66 @@ +/* CGUIDialogBoxeeOTAConfiguration .cpp + * + */ +#include "GUIDialogBoxeeOTAConfiguration.h" +#include "GUIWindowManager.h" +#include "BoxeeOTAConfigurationManager.h" +#include "GUIDialogBoxeeOTALocationConfiguration.h" +#include "utils/log.h" +#include "LocalizeStrings.h" + +/////////////////////////////////////////////////////////////////////////////////////////////////////// + +CGUIDialogBoxeeOTAConnectionConfiguration::CGUIDialogBoxeeOTAConnectionConfiguration() + : CGUIDialogBoxeeWizardBase(WINDOW_OTA_CONNECTION_CONFIGURATION,"boxee_ota_connection_configuration.xml","CGUIDialogBoxeeOTAConnectionConfiguration") +{ +} + +CGUIDialogBoxeeOTAConnectionConfiguration::~CGUIDialogBoxeeOTAConnectionConfiguration() +{ +} + +bool CGUIDialogBoxeeOTAConnectionConfiguration::OnAction(const CAction& action) +{ + if (action.id == ACTION_SELECT_ITEM) + { + int iControl = GetFocusedControlID(); + + if(iControl == DIALOG_WIZARD_BUTTON_NEXT) + { + CBoxeeOTAConfigurationManager::GetInstance().GetConfigurationData().SetIsCable(false); + } + if(iControl == DIALOG_WIZARD_BUTTON_BACK) + { + CBoxeeOTAConfigurationManager::GetInstance().GetConfigurationData().SetIsCable(true); + } + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + return true; + } + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////// + +#define CONTROL_LABEL_HEADING 1 +#define CONTROL_LABEL_TEXT 2 + +CGUIDialogBoxeeOTAWelcome::CGUIDialogBoxeeOTAWelcome() : CGUIDialogBoxeeWizardBase(WINDOW_OTA_WELCOME_CONFIGURATION, "boxee_ota_welcome_configuration.xml", "CGUIDialogBoxeeOTAConfiguration") +{ + m_rescan = false; +} + +CGUIDialogBoxeeOTAWelcome::~CGUIDialogBoxeeOTAWelcome() +{ +} + +void CGUIDialogBoxeeOTAWelcome::OnInitWindow() +{ + CGUIDialogBoxeeWizardBase::OnInitWindow(); + + if (m_rescan) + { + SET_CONTROL_LABEL(CONTROL_LABEL_HEADING, g_localizeStrings.Get(58095)); + SET_CONTROL_LABEL(CONTROL_LABEL_TEXT, g_localizeStrings.Get(58096)); + } +} diff --git a/xbmc/GUIDialogBoxeeOTAConfiguration.h b/xbmc/GUIDialogBoxeeOTAConfiguration.h new file mode 100644 index 00000000..ddb527c1 --- /dev/null +++ b/xbmc/GUIDialogBoxeeOTAConfiguration.h @@ -0,0 +1,40 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" +#include "GUIDialogBoxeeOTALocationConfiguration.h" + +class CGUIDialogBoxeeOTAProviderConfiguration : public CGUIDialogBoxeeWizardBase +{ +public: + + CGUIDialogBoxeeOTAProviderConfiguration(); + virtual ~CGUIDialogBoxeeOTAProviderConfiguration(); + void OnInitWindow(); + virtual bool OnAction(const CAction& action); + +private: + bool GetProvidersFromServer(); + bool HandleSelectProvider(); + CFileItemList m_providers; +}; + +class CGUIDialogBoxeeOTAConnectionConfiguration : public CGUIDialogBoxeeWizardBase +{ +public: + + CGUIDialogBoxeeOTAConnectionConfiguration(); + virtual ~CGUIDialogBoxeeOTAConnectionConfiguration(); + virtual bool OnAction(const CAction& action); +}; + +class CGUIDialogBoxeeOTAWelcome : public CGUIDialogBoxeeWizardBase +{ +public: + CGUIDialogBoxeeOTAWelcome(); + virtual ~CGUIDialogBoxeeOTAWelcome(); + void setRescan(bool rescan) { m_rescan = rescan; } + +private: + virtual void OnInitWindow(); + bool m_rescan; +}; diff --git a/xbmc/GUIDialogBoxeeOTAFacebookConnect.cpp b/xbmc/GUIDialogBoxeeOTAFacebookConnect.cpp new file mode 100644 index 00000000..b4f4cb82 --- /dev/null +++ b/xbmc/GUIDialogBoxeeOTAFacebookConnect.cpp @@ -0,0 +1,60 @@ +#include "GUIDialogBoxeeOTAFacebookConnect.h" +#include "GUIWindowManager.h" +#include "BoxeeOTAConfigurationManager.h" +#include "GUIDialogBoxeeOTALocationConfiguration.h" +#include "utils/log.h" +#include "Application.h" +#include "LocalizeStrings.h" + +#define FACEBOOK_BUTTON1 1 +#define FACEBOOK_BUTTON2 4 +#define LEFT_SIDE_LABEL 3 + +/////////////////////////////////////////////////////////////////////////////////////////////////////// + +CGUIDialogBoxeeOTAFacebookConnect::CGUIDialogBoxeeOTAFacebookConnect() + : CGUIDialogBoxeeWizardBase(WINDOW_OTA_FACEBOOK_CONNECT, "boxee_ota_facebook_connect.xml", "CGUIDialogBoxeeOTAFacebookConnect") +{ +} + +CGUIDialogBoxeeOTAFacebookConnect::~CGUIDialogBoxeeOTAFacebookConnect() +{ +} + +void CGUIDialogBoxeeOTAFacebookConnect::OnInitWindow() +{ + CGUIDialogBoxeeWizardBase::OnInitWindow(); + + if (g_application.GetBoxeeSocialUtilsManager().IsConnected(FACEBOOK_SERVICE_ID, true) && + g_application.GetBoxeeSocialUtilsManager().RequiresReconnect(FACEBOOK_SERVICE_ID)) + { + SET_CONTROL_LABEL(LEFT_SIDE_LABEL, g_localizeStrings.Get(58058)); + SET_CONTROL_HIDDEN(FACEBOOK_BUTTON1); + SET_CONTROL_VISIBLE(FACEBOOK_BUTTON2); + SET_CONTROL_FOCUS(FACEBOOK_BUTTON2, 0); + } +} + +void CGUIDialogBoxeeOTAFacebookConnect::OnDeinitWindow(int nextWindowID) +{ + CGUIWindow::OnDeinitWindow(nextWindowID); +} + +bool CGUIDialogBoxeeOTAFacebookConnect::OnAction(const CAction& action) +{ + if (action.id == ACTION_SELECT_ITEM) + { + int iControl = GetFocusedControlID(); + + if (iControl == FACEBOOK_BUTTON1 || iControl == FACEBOOK_BUTTON2) + { + g_application.GetBoxeeSocialUtilsUIManager().HandleUISocialUtilConnect(FACEBOOK_SERVICE_ID); + } + + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + return true; + } + + return CGUIDialogBoxeeWizardBase::OnAction(action); +} diff --git a/xbmc/GUIDialogBoxeeOTAFacebookConnect.h b/xbmc/GUIDialogBoxeeOTAFacebookConnect.h new file mode 100644 index 00000000..a20e0e34 --- /dev/null +++ b/xbmc/GUIDialogBoxeeOTAFacebookConnect.h @@ -0,0 +1,15 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" + +class CGUIDialogBoxeeOTAFacebookConnect : public CGUIDialogBoxeeWizardBase +{ +public: + CGUIDialogBoxeeOTAFacebookConnect(); + virtual ~CGUIDialogBoxeeOTAFacebookConnect(); + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + virtual bool OnAction(const CAction& action); + +private: +}; diff --git a/xbmc/GUIDialogBoxeeOTALocationConfiguration.cpp b/xbmc/GUIDialogBoxeeOTALocationConfiguration.cpp new file mode 100644 index 00000000..85477e77 --- /dev/null +++ b/xbmc/GUIDialogBoxeeOTALocationConfiguration.cpp @@ -0,0 +1,238 @@ +/* CGUIDialogBoxeeOTAConfiguration .cpp + * + */ +#include "GUIDialogBoxeeOTALocationConfiguration.h" +#include "GUIWindowManager.h" +#include "BoxeeOTAConfigurationManager.h" +#include "utils/log.h" +#include "FileSystem/FactoryDirectory.h" +#include "FileSystem/Directory.h" +#include "GUISettings.h" +#include "bxconfiguration.h" +#include "bxutils.h" +#include "json/value.h" +#include "json/reader.h" +#include "GUIEditControl.h" +#include "GUIDialogOK2.h" +#include "LocalizeStrings.h" +#include "lib/libBoxee/bxcurrentlocation.h" + +#define CONTROL_LOCATION_LIST 80 +#define CONTROL_ZIP_CODE_EDIT 15001 +#define CONTROL_LOCATION_LABEL 15000 +#define CONTROL_BUTTON_NO 3 // YES is button NEXT + +CGUIDialogBoxeeOTAConfirmLocation::CGUIDialogBoxeeOTAConfirmLocation() : + CGUIDialogBoxeeWizardBase(WINDOW_OTA_LOCATION_CONFIRMATION, "boxee_ota_location_confirmation.xml", "CGUIDialogBoxeeOTALocationConfirmation") +{ +} + +void CGUIDialogBoxeeOTAConfirmLocation::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + BOXEE::BXCurrentLocation& location = BOXEE::BXCurrentLocation::GetInstance(); + + CStdString locationStr; + if (location.IsLocationDetected()) + { + locationStr = location.GetCountry(); + locationStr += "?"; + } + + SET_CONTROL_LABEL(CONTROL_LOCATION_LABEL , locationStr); +} + +CGUIDialogBoxeeOTAConfirmLocation::~CGUIDialogBoxeeOTAConfirmLocation() +{ +} + +bool CGUIDialogBoxeeOTAConfirmLocation::GetYesButtonPressed() +{ + return m_bYesButtonPressed; +} + +bool CGUIDialogBoxeeOTAConfirmLocation::HandleClickNext() +{ + m_bYesButtonPressed = true; + return true; +} + +bool CGUIDialogBoxeeOTAConfirmLocation::HandleClickBack() +{ + return true; +} + +bool CGUIDialogBoxeeOTAConfirmLocation::OnMessage(CGUIMessage& message) +{ + if (message.GetMessage() == GUI_MSG_CLICKED && message.GetSenderId() == CONTROL_BUTTON_NO) + { + m_bYesButtonPressed = false; + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + return true; + } + + return CGUIDialogBoxeeWizardBase::OnMessage(message); +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +CGUIDialogBoxeeOTACountriesLocationConfiguration::CGUIDialogBoxeeOTACountriesLocationConfiguration() : + CGUIDialogBoxeeWizardBase(WINDOW_OTA_COUNTRIES_CONFIGURATION, "boxee_ota_countries_configuration.xml", "CGUIDialogBoxeeOTACountriesLocationConfiguration") +{ +} + +CGUIDialogBoxeeOTACountriesLocationConfiguration::~CGUIDialogBoxeeOTACountriesLocationConfiguration() +{ +} + +void CGUIDialogBoxeeOTACountriesLocationConfiguration::OnInitWindow() +{ + if (m_countries.IsEmpty()) + { + GetCountriesFromServer(); + } + + CGUIDialog::OnInitWindow(); + + CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), CONTROL_LOCATION_LIST); + OnMessage(msg); + + CGUIMessage msg2(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LOCATION_LIST, 0, 0, &m_countries); + OnMessage(msg2); +} + +bool CGUIDialogBoxeeOTACountriesLocationConfiguration::GetCountriesFromServer() +{ + + CStdString strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.ApiGetCountries", "http://app.boxee.tv/location/countries?service=livetv"); + Json::Value jResponse; + int returnCode; + + if(BOXEE::BXUtils::PerformJSONGetRequestInBG(strUrl,jResponse,returnCode) != JOB_SUCCEEDED) + { + return false; + } + + if (jResponse.isArray()) + { + if (jResponse.size() == 0) + { + return false; + } + + for (size_t j = 0; j < jResponse.size(); j++) + { + Json::Value m = jResponse[(int) j]; + + CFileItemPtr jsonItem(new CFileItem("country")); + jsonItem->SetLabel(m["title"].asString()); + jsonItem->SetProperty("country_code", m["code"].asString()); + m_countries.Add(jsonItem); + } + } + + return true; +} + +bool CGUIDialogBoxeeOTACountriesLocationConfiguration::OnAction(const CAction& action) +{ + if (action.id == ACTION_SELECT_ITEM) + { + if (HandleSelectCountry()) + { + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + return true; + } + else + { + m_actionChoseEnum = CActionChoose::BACK; + Close(); + return false; + } + } + + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +bool CGUIDialogBoxeeOTACountriesLocationConfiguration::HandleSelectCountry() +{ + CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_LOCATION_LIST); + OnMessage(msg); + int iCountry = msg.GetParam1(); + + if (iCountry < m_countries.Size() && iCountry > -1) + CBoxeeOTAConfigurationManager::GetInstance().GetConfigurationData().SetCountryCode(m_countries[iCountry]->GetProperty("country_code")); + else + return false; + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +CGUIDialogBoxeeOTAZipcodeLocationConfiguration::CGUIDialogBoxeeOTAZipcodeLocationConfiguration() : + CGUIDialogBoxeeWizardBase(WINDOW_OTA_ZIPCODE_CONFIGURATION, "boxee_ota_zipcode_configuration.xml", "CGUIDialogBoxeeOTAZipcodeLocationConfiguration") +{ + +} + +CGUIDialogBoxeeOTAZipcodeLocationConfiguration::~CGUIDialogBoxeeOTAZipcodeLocationConfiguration() +{ +} + +void CGUIDialogBoxeeOTAZipcodeLocationConfiguration::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + CGUIEditControl *editControl = (CGUIEditControl *)GetControl(CONTROL_ZIP_CODE_EDIT); + if (editControl) + editControl->SetLabel2(CBoxeeOTAConfigurationManager::GetInstance().GetConfigurationData().GetZipCode()); + + SET_CONTROL_FOCUS(CONTROL_ZIP_CODE_EDIT, 0); +} + +bool CGUIDialogBoxeeOTAZipcodeLocationConfiguration::OnAction(const CAction& action) +{ + if (action.id == ACTION_SELECT_ITEM) + { + if (!HandleSelectZipCode()) + { + HandleInvalidZipCode(); + return true; + } + + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + return true; + } + + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +bool CGUIDialogBoxeeOTAZipcodeLocationConfiguration::HandleSelectZipCode() +{ + CGUIEditControl *editControl = (CGUIEditControl *)GetControl(CONTROL_ZIP_CODE_EDIT); + if (!editControl) + { + return false; + } + + CStdString zipCode = editControl->GetLabel2(); + CBoxeeOTAConfigurationManager::GetInstance().GetConfigurationData().SetZipCode(zipCode); + + return true; +} + +void CGUIDialogBoxeeOTAZipcodeLocationConfiguration::HandleInvalidZipCode() +{ + CGUIDialogOK2 *dialog = (CGUIDialogOK2 *)g_windowManager.GetWindow(WINDOW_DIALOG_OK_2); + if(dialog) + { + dialog->SetHeading(g_localizeStrings.Get(257)); + dialog->SetLine(0,g_localizeStrings.Get(58031)); + dialog->DoModal(); + } + + SET_CONTROL_FOCUS(CONTROL_ZIP_CODE_EDIT, 0); +} diff --git a/xbmc/GUIDialogBoxeeOTALocationConfiguration.h b/xbmc/GUIDialogBoxeeOTALocationConfiguration.h new file mode 100644 index 00000000..18d37d91 --- /dev/null +++ b/xbmc/GUIDialogBoxeeOTALocationConfiguration.h @@ -0,0 +1,50 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" +#include "FileItem.h" + +class CGUIDialogBoxeeOTAConfirmLocation : public CGUIDialogBoxeeWizardBase +{ +public: + CGUIDialogBoxeeOTAConfirmLocation(); + virtual ~CGUIDialogBoxeeOTAConfirmLocation(); + bool GetYesButtonPressed(); + void OnInitWindow(); + virtual bool OnMessage(CGUIMessage& message); + +protected: + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + +private: + bool m_bYesButtonPressed; +}; + +class CGUIDialogBoxeeOTACountriesLocationConfiguration : public CGUIDialogBoxeeWizardBase +{ +public: + CGUIDialogBoxeeOTACountriesLocationConfiguration(); + virtual ~CGUIDialogBoxeeOTACountriesLocationConfiguration(); + virtual bool OnAction(const CAction& action); + void OnInitWindow(); + +private: + bool GetCountriesFromServer(); + bool HandleSelectCountry(); + bool OnInit(); + + CFileItemList m_countries; +}; + +class CGUIDialogBoxeeOTAZipcodeLocationConfiguration : public CGUIDialogBoxeeWizardBase +{ +public: + CGUIDialogBoxeeOTAZipcodeLocationConfiguration(); + virtual ~CGUIDialogBoxeeOTAZipcodeLocationConfiguration(); + virtual bool OnAction(const CAction& action); + void OnInitWindow(); + +private: + bool HandleSelectZipCode(); + void HandleInvalidZipCode(); +}; diff --git a/xbmc/GUIDialogBoxeeOTANoChannels.cpp b/xbmc/GUIDialogBoxeeOTANoChannels.cpp new file mode 100644 index 00000000..a296cce1 --- /dev/null +++ b/xbmc/GUIDialogBoxeeOTANoChannels.cpp @@ -0,0 +1,61 @@ +#include "GUIDialogBoxeeOTANoChannels.h" +#include "utils/log.h" +#include "LocalizeStrings.h" +#include "GUISettings.h" + +#define LEFT_SIDE_LABEL 1 +#define RESCAN_BUTTON 2 +#define SWITCH_BUTTON 3 + +CGUIDialogBoxeeOTANoChannels::CGUIDialogBoxeeOTANoChannels() + : CGUIDialog(WINDOW_OTA_NO_CHANNELS, "boxee_livetv_no_channels.xml") +{ +} + +CGUIDialogBoxeeOTANoChannels::~CGUIDialogBoxeeOTANoChannels() +{ +} + +void CGUIDialogBoxeeOTANoChannels::OnInitWindow() +{ + m_isSwitchConnection = false; + m_isRescan = false; + + CGUIDialog::OnInitWindow(); + + bool isCable = g_guiSettings.GetBool("ota.selectedcable"); + + if (isCable) + { + SET_CONTROL_LABEL(LEFT_SIDE_LABEL, g_localizeStrings.Get(58092)); + SET_CONTROL_LABEL(SWITCH_BUTTON, g_localizeStrings.Get(58094)); + } +} + +bool CGUIDialogBoxeeOTANoChannels::OnAction(const CAction& action) +{ + if (action.id == ACTION_SELECT_ITEM) + { + int iControl = GetFocusedControlID(); + + if (iControl == SWITCH_BUTTON) + { + m_isSwitchConnection = true; + Close(); + return true ; + } + else if (iControl == RESCAN_BUTTON) + { + m_isRescan = true; + Close(); + return true; + } + } + else if (action.id == ACTION_PARENT_DIR || action.id == ACTION_PREVIOUS_MENU) + { + Close(); + return true; + } + + return CGUIDialog::OnAction(action); +} diff --git a/xbmc/GUIDialogBoxeeOTANoChannels.h b/xbmc/GUIDialogBoxeeOTANoChannels.h new file mode 100644 index 00000000..82a8ff82 --- /dev/null +++ b/xbmc/GUIDialogBoxeeOTANoChannels.h @@ -0,0 +1,19 @@ +#pragma once + +#include "GUIDialog.h" + +class CGUIDialogBoxeeOTANoChannels : public CGUIDialog +{ +public: + CGUIDialogBoxeeOTANoChannels(); + virtual ~CGUIDialogBoxeeOTANoChannels(); + virtual void OnInitWindow(); + virtual bool OnAction(const CAction& action); + + bool IsSwitchConnection() { return m_isSwitchConnection; } + bool IsRescan() { return m_isRescan; } + +private: + bool m_isSwitchConnection; + bool m_isRescan; +}; diff --git a/xbmc/GUIDialogBoxeeOTAfavouriteShows.cpp b/xbmc/GUIDialogBoxeeOTAfavouriteShows.cpp new file mode 100644 index 00000000..ad6d5998 --- /dev/null +++ b/xbmc/GUIDialogBoxeeOTAfavouriteShows.cpp @@ -0,0 +1,175 @@ +/* CGUIDialogBoxeeOTAFavoriteShows .cpp + * + */ +#include "GUIDialogBoxeeOTAfavouriteShows.h" +#include "GUIWindowBoxeeBrowseTvEpisodes.h" +#include "GUIWindowManager.h" +#include "BoxeeOTAConfigurationManager.h" +#include "GUIDialogBoxeeOTALocationConfiguration.h" +#include "utils/log.h" +#include "bxconfiguration.h" +#include "bxutils.h" +#include "RssSourceManager.h" +#include "BoxeeUtils.h" + + +#define FAVOURITE_SUGGESTIONS_CONTROL_LIST 81 +#define NEXT_CONTROL_BUTTON 1 +#define CANCEL_CONTROL_BUTTON 2 + + +CGUIDialogBoxeeOTAfavouriteShows::CGUIDialogBoxeeOTAfavouriteShows() : +CGUIDialogBoxeeWizardBase(WINDOW_OTA_FAVOURITE_SHOWES,"custom_boxee_livetv_setup_6a.xml","CGUIDialogBoxeeOTAfavouriteShows") +{ +} + +CGUIDialogBoxeeOTAfavouriteShows::~CGUIDialogBoxeeOTAfavouriteShows() +{ + +} + +void CGUIDialogBoxeeOTAfavouriteShows::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + if(m_favoriteShowsSuggestions.IsEmpty()) + { + if(!GetFavoriteShowsFromServer()) + { + return; + } + } + + CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), FAVOURITE_SUGGESTIONS_CONTROL_LIST); + OnMessage(msgReset); + + CGUIMessage msgBind(GUI_MSG_LABEL_BIND, GetID(), FAVOURITE_SUGGESTIONS_CONTROL_LIST, 0, 0, &m_favoriteShowsSuggestions); + OnMessage(msgBind); +} + +bool CGUIDialogBoxeeOTAfavouriteShows::OnAction(const CAction& action) +{ + if (action.id == ACTION_SELECT_ITEM) + { + int iControl = GetFocusedControlID(); + + if(iControl == FAVOURITE_SUGGESTIONS_CONTROL_LIST) + { + if(HandleSelectShow()) + { + //mark the show as favourite in ui + } + else + { + //pop a msg or unmark the show + } + return true; + } + + if(iControl == CANCEL_CONTROL_BUTTON) + { + m_bIsDirty = false; + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + return true; + } + + if(iControl == NEXT_CONTROL_BUTTON) + { + SetFavoriteShowsToServer(); + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + return true; + } + } + + return CGUIDialogBoxeeWizardBase::OnAction(action); +} + +bool CGUIDialogBoxeeOTAfavouriteShows::OnMessage(CGUIMessage& message) +{ + return CGUIDialogBoxeeWizardBase::OnMessage(message); +} + +//adds and removes from favourite +bool CGUIDialogBoxeeOTAfavouriteShows::HandleSelectShow() +{ + CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), FAVOURITE_SUGGESTIONS_CONTROL_LIST); + OnMessage(msg); + + int iShow = msg.GetParam1(); + + if(iShow > 0 && iShow < m_favoriteShowsSuggestions.Size()) + { + bool isSelected = m_favoriteShowsSuggestions[iShow]->GetPropertyBOOL("selectedAsFavourite"); + m_favoriteShowsSuggestions[iShow]->SetProperty("selectedAsFavourite",isSelected); + + bool changed = m_favoriteShowsSuggestions[iShow]->GetPropertyBOOL("selectAsFavouriteChanged"); + m_favoriteShowsSuggestions[iShow]->SetProperty("selectAsFavouriteChanged",!changed); + m_bIsDirty = true; + return true; + } + + return false; +} + +bool CGUIDialogBoxeeOTAfavouriteShows::GetFavoriteShowsFromServer() +{ + CStdString strUrl = "http://app.boxee.tv/title/suggestions"; //"http://app.boxee.tv/title/suggestions"; + CRssFeed feed; + feed.Init(strUrl,strUrl); + feed.ReadFeed(); + feed.GetItemList(m_favoriteShowsSuggestions); + + if(m_favoriteShowsSuggestions.Size() == 0) + { + return false; + } + + CStdString label; + bool isSubscribed = false; + + for(int i = 0; i < m_favoriteShowsSuggestions.Size(); i++) + { + label = m_favoriteShowsSuggestions[i]->GetProperty("title"); + m_favoriteShowsSuggestions[i]->SetLabel(label); + isSubscribed = BoxeeUtils::IsSubscribe(label); + m_favoriteShowsSuggestions[i]->SetProperty("selectedAsFavourite",isSubscribed); + m_favoriteShowsSuggestions[i]->SetProperty("selectAsFavouriteChanged",false); + } + + return true; +} + +void CGUIDialogBoxeeOTAfavouriteShows::SetFavoriteShowsToServer() +{ + if (!m_bIsDirty) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeOTAfavouriteShows::OnDeinitWindow - [dirty=%d] -> no need to update (cf)",m_bIsDirty); + return; + } + + CStdString strShowId; + CStdString strShowTitle; + bool subscribe; + bool changed; + for(int i = 0; i < m_favoriteShowsSuggestions.Size(); i++) + { + subscribe = m_favoriteShowsSuggestions[i]->GetPropertyBOOL("selectedAsFavourite"); + changed = m_favoriteShowsSuggestions[i]->GetPropertyBOOL("selectAsFavouriteChanged"); + + if(changed) + { + strShowId = m_favoriteShowsSuggestions[i]->GetProperty("boxeeid"); + strShowTitle = m_favoriteShowsSuggestions[i]->GetLabel(); + + SubscribeJob* job = new SubscribeJob(BOXEE::CSubscriptionType::TVSHOW_SUBSCRIPTION, strShowId, strShowTitle, subscribe); + + if (CUtil::RunInBG(job) != JOB_SUCCEEDED) + { + m_favoriteShowsSuggestions[i]->SetProperty("selectedAsFavourite",!subscribe); + continue; + } + } + } +} diff --git a/xbmc/GUIDialogBoxeeOTAfavouriteShows.h b/xbmc/GUIDialogBoxeeOTAfavouriteShows.h new file mode 100644 index 00000000..0266619c --- /dev/null +++ b/xbmc/GUIDialogBoxeeOTAfavouriteShows.h @@ -0,0 +1,22 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" +#include "FileItem.h" + +class CGUIDialogBoxeeOTAfavouriteShows : public CGUIDialogBoxeeWizardBase +{ +public: + + CGUIDialogBoxeeOTAfavouriteShows(); + virtual ~CGUIDialogBoxeeOTAfavouriteShows(); + void OnInitWindow(); + virtual bool OnAction(const CAction& action); + virtual bool OnMessage(CGUIMessage& message); + +private: + bool m_bIsDirty; + bool GetFavoriteShowsFromServer(); + void SetFavoriteShowsToServer(); + bool HandleSelectShow(); + CFileItemList m_favoriteShowsSuggestions; +}; diff --git a/xbmc/GUIDialogBoxeeOTAfavouriteShowsNotification.cpp b/xbmc/GUIDialogBoxeeOTAfavouriteShowsNotification.cpp new file mode 100644 index 00000000..dae46aa1 --- /dev/null +++ b/xbmc/GUIDialogBoxeeOTAfavouriteShowsNotification.cpp @@ -0,0 +1,35 @@ +/* GUIDialogBoxeeOTAfavouriteShowsNotification.cpp + * + */ +#include "GUIDialogBoxeeOTAfavouriteShowsNotification.h" +#include "GUIWindowManager.h" +#include "BoxeeOTAConfigurationManager.h" +#include "GUIDialogBoxeeOTALocationConfiguration.h" +#include "utils/log.h" +#include "bxconfiguration.h" +#include "bxutils.h" +#include "RssSourceManager.h" + +CGUIDialogBoxeeOTAfavouriteShowsNotification::CGUIDialogBoxeeOTAfavouriteShowsNotification() : +CGUIDialogBoxeeWizardBase(WINDOW_OTA_NOTIFICATION_CONFIG,"custom_boxee_livetv_setup_7.xml","CGUIDialogBoxeeOTAfavouriteShowsNotification") +{ + +} + +CGUIDialogBoxeeOTAfavouriteShowsNotification::~CGUIDialogBoxeeOTAfavouriteShowsNotification() +{ + +} + +void CGUIDialogBoxeeOTAfavouriteShowsNotification::OnInitWindow() +{ + +} + + + +bool CGUIDialogBoxeeOTAfavouriteShowsNotification::OnAction(const CAction& action) +{ + + return CGUIDialogBoxeeWizardBase::OnAction(action); +} diff --git a/xbmc/GUIDialogBoxeeOTAfavouriteShowsNotification.h b/xbmc/GUIDialogBoxeeOTAfavouriteShowsNotification.h new file mode 100644 index 00000000..d19ddf06 --- /dev/null +++ b/xbmc/GUIDialogBoxeeOTAfavouriteShowsNotification.h @@ -0,0 +1,14 @@ +#pragma once + +#include "GUIDialogBoxeeWizardBase.h" +#include "FileItem.h" + +class CGUIDialogBoxeeOTAfavouriteShowsNotification : public CGUIDialogBoxeeWizardBase +{ +public: + + CGUIDialogBoxeeOTAfavouriteShowsNotification(); + virtual ~CGUIDialogBoxeeOTAfavouriteShowsNotification(); + void OnInitWindow(); + virtual bool OnAction(const CAction& action); +}; diff --git a/xbmc/GUIDialogBoxeePair.cpp b/xbmc/GUIDialogBoxeePair.cpp new file mode 100644 index 00000000..af347805 --- /dev/null +++ b/xbmc/GUIDialogBoxeePair.cpp @@ -0,0 +1,185 @@ +#include "GUIDialogBoxeePair.h" +#include "GUIWindowManager.h" +#include "log.h" +#include "bxutils.h" +#include "Application.h" +#include "LocalizeStrings.h" + +#define CONTROL_BUTTON 10 +#define CONTROL_LABEL 43 + +#define BASE_PAIR_DIGIT_ICON "device_pairing_code_" +#define BASE_PAIR_DIGIT_PROPERY "pair-digit-" + +CGUIDialogBoxeePair::CGUIDialogBoxeePair() : CGUIDialog(WINDOW_DIALOG_BOXEE_PAIR, "boxee_pair.xml") +{ + +} + +CGUIDialogBoxeePair::~CGUIDialogBoxeePair() +{ + +} + +void CGUIDialogBoxeePair::OnInitWindow() +{ + if (!m_deviceItem.IsInitialize()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePair::OnInitWindow - FAILED to initialize dialog. DeviceItem ISN'T initialize (bdm)"); + Close(); + return; + } + + CGUIDialog::OnInitWindow(); + + SET_CONTROL_LABEL(CONTROL_BUTTON,222); + + CStdString label; + CStdString labelStr = g_localizeStrings.Get(55501); + label.Format(labelStr.c_str(),m_deviceItem.GetDeviceLabel()); + SET_CONTROL_LABEL(CONTROL_LABEL,label); + + int passcode; + srand((unsigned)time(0)); + passcode = rand() % 9000 + 1000; + + m_passcodeStr = BOXEE::BXUtils::IntToString(passcode); + + CGUIWindow* activeWindow = g_windowManager.GetWindow(g_windowManager.GetActiveWindow()); + if (!activeWindow) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePair::OnInitWindow - FAILED to initialize dialog. [activeWindow=%p] (bdm)",activeWindow); + Close(); + return; + } + + for (unsigned int i=0; iSetProperty(pairDigitWindowProperty,pairDigitIcon); + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePair::OnInitWindow - after set [passcode=%s] (bdm)",m_passcodeStr.c_str()); +} + +bool CGUIDialogBoxeePair::OnAction(const CAction& action) +{ + switch (action.id) + { + case ACTION_PARENT_DIR: + case ACTION_PREVIOUS_MENU: + { + Close(); + return true; + } + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeePair::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_CLICKED: + { + int iControl = message.GetSenderId(); + if (iControl == CONTROL_BUTTON) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePair::OnMessage - GUI_MSG_CLICKED - going to close dialog (bdm)"); + Close(); + return true; + } + } + break; + } + + return CGUIDialog::OnMessage(message); +} + +void CGUIDialogBoxeePair::Render() +{ + return CGUIDialog::Render(); +} + +void CGUIDialogBoxeePair::SetDeviceItem(CBoxeeDeviceItem* deviceItem) +{ + if (deviceItem) + { + m_deviceItem = *deviceItem; + } + else + { + m_deviceItem.Reset(); + } +} + +CBoxeeDeviceItem CGUIDialogBoxeePair::GetDeviceItem() +{ + return m_deviceItem; +} + +void CGUIDialogBoxeePair::Reset() +{ + m_deviceItem.Reset(); + m_passcodeStr = ""; +} + +bool CGUIDialogBoxeePair::PairDevice(const CStdString& deviceId, const CStdString& code) +{ + if (!m_deviceItem.IsInitialize()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePair::PairDevice - DeviceItem ISN'T initialize. [deviceId=%s][code=%s] (bdm)",deviceId.c_str(),code.c_str()); + return false; + } + + CStdString deviceIdToMatch = m_deviceItem.GetDeviceId(); + if (deviceId != deviceIdToMatch) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePair::PairDevice - [DeviceId=%s] DOESN'T match [%s=DeviceItemId]. [deviceId=%s][code=%s] (bdm)",deviceId.c_str(),deviceIdToMatch.c_str(),deviceId.c_str(),code.c_str()); + return false; + } + + if (code != m_passcodeStr) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePair::PairDevice - [code=%s] DOESN'T match [%s=passcode]. [deviceId=%s][code=%s] (bdm)",code.c_str(),m_passcodeStr.c_str(),deviceId.c_str(),code.c_str()); + + CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), CONTROL_LABEL); + msg.SetLabel(55502); + g_windowManager.SendThreadMessage(msg); + + return false; + } + + if (!g_application.GetBoxeeDeviceManager().PairDevice(m_deviceItem)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePair::PairDevice - FAILED to pair device. [deviceId=%s][code=%s] (bdm)",deviceId.c_str(),code.c_str()); + + CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), CONTROL_LABEL); + msg.SetLabel(55502); + g_windowManager.SendThreadMessage(msg); + + return false; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePair::PairDevice - SUCCEEDED to pair device. [deviceId=%s][code=%s] (bdm)",deviceId.c_str(),code.c_str()); + + CGUIMessage msgLabel(GUI_MSG_LABEL_SET, GetID(), CONTROL_LABEL); + msgLabel.SetLabel(55503); + g_windowManager.SendThreadMessage(msgLabel); + + CGUIMessage msgButton(GUI_MSG_LABEL_SET, GetID(), CONTROL_BUTTON); + msgButton.SetLabel(20177); + g_windowManager.SendThreadMessage(msgButton); + + return true; +} + diff --git a/xbmc/GUIDialogBoxeePair.h b/xbmc/GUIDialogBoxeePair.h new file mode 100644 index 00000000..69083242 --- /dev/null +++ b/xbmc/GUIDialogBoxeePair.h @@ -0,0 +1,35 @@ +#ifndef CGUIDIALOGBOXEEPAIR_H_ +#define CGUIDIALOGBOXEEPAIR_H_ + +#include "GUIDialog.h" +#include "BoxeeDeviceManager.h" + +class CGUIDialogBoxeePair : public CGUIDialog +{ +public: + + CGUIDialogBoxeePair(void); + virtual ~CGUIDialogBoxeePair(void); + + virtual void OnInitWindow(); + + virtual bool OnAction(const CAction& action); + virtual bool OnMessage(CGUIMessage& message); + + virtual void Render(); + + void SetDeviceItem(CBoxeeDeviceItem* deviceItem); + CBoxeeDeviceItem GetDeviceItem(); + + bool PairDevice(const CStdString& deviceId, const CStdString& code); + + void Reset(); + +protected: + + CStdString m_pairStr; + CBoxeeDeviceItem m_deviceItem; + CStdString m_passcodeStr; +}; + +#endif /* CGUIDIALOGBOXEEPAIR_H_ */ diff --git a/xbmc/GUIDialogBoxeePaymentOkPlay.cpp b/xbmc/GUIDialogBoxeePaymentOkPlay.cpp new file mode 100644 index 00000000..6e155027 --- /dev/null +++ b/xbmc/GUIDialogBoxeePaymentOkPlay.cpp @@ -0,0 +1,113 @@ + +#include "GUIDialogBoxeePaymentOkPlay.h" +#include "GUIWindowManager.h" +#include "log.h" + +#define OK_PLAY_BUTTON 6531 + +CGUIDialogBoxeePaymentOkPlay::CGUIDialogBoxeePaymentOkPlay() : CGUIDialog(WINDOW_DIALOG_BOXEE_PAYMENT_OK_PLAY, "boxee_payment_ok_play.xml") +{ + m_bConfirmed = true; +} + +CGUIDialogBoxeePaymentOkPlay::~CGUIDialogBoxeePaymentOkPlay() +{ + +} + +void CGUIDialogBoxeePaymentOkPlay::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + SET_CONTROL_FOCUS(OK_PLAY_BUTTON, 0); +} + +void CGUIDialogBoxeePaymentOkPlay::OnDeinitWindow(int nextWindowID) +{ + CGUIDialog::OnDeinitWindow(nextWindowID); +} + +bool CGUIDialogBoxeePaymentOkPlay::OnAction(const CAction& action) +{ + switch (action.id) + { + case ACTION_PARENT_DIR: + case ACTION_PREVIOUS_MENU: + { + m_bConfirmed = false; + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentOkPlay::OnAction - Handling action [%d]. After set [Confirmed=%d] and going to call Close() (pay)",action.id,m_bConfirmed); + Close(); + return true; + } + break; + default: + { + // do nothing + } + break; + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeePaymentOkPlay::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_CLICKED: + { + return OnClick(message); + } + break; + default: + { + // do nothing + } + break; + } + + return CGUIDialog::OnMessage(message); +} + +bool CGUIDialogBoxeePaymentOkPlay::OnClick(CGUIMessage& message) +{ + bool succeeded = false; + + int iControl = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentOkPlay::OnClick - Enter function with [iControl=%d] (pay)",iControl); + + switch(iControl) + { + case OK_PLAY_BUTTON: + { + m_bConfirmed = true; + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentOkPlay::OnClick - Handling click on [%d=OK_PLAY_BUTTON] - going to call Close(). [Confirmed=%d] (pay)",iControl,m_bConfirmed); + Close(); + return true; + } + break; + default: + { + CLog::Log(LOGWARNING,"CGUIDialogBoxeePaymentOkPlay::OnClick - UNKNOWN control [%d] was click (pay)",iControl); + } + break; + } + + return succeeded; +} + +bool CGUIDialogBoxeePaymentOkPlay::Show() +{ + CGUIDialogBoxeePaymentOkPlay* dialog = (CGUIDialogBoxeePaymentOkPlay*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_PAYMENT_OK_PLAY); + if (!dialog) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentOkPlay::Show - FAILED to get dialog to show (pay)"); + return false; + } + + dialog->DoModal(); + + return dialog->m_bConfirmed; +} + diff --git a/xbmc/GUIDialogBoxeePaymentOkPlay.h b/xbmc/GUIDialogBoxeePaymentOkPlay.h new file mode 100644 index 00000000..0debb117 --- /dev/null +++ b/xbmc/GUIDialogBoxeePaymentOkPlay.h @@ -0,0 +1,27 @@ + +#ifndef CGUIDIALOGBOXEEPAYMENTOKPLAY_H_ +#define CGUIDIALOGBOXEEPAYMENTOKPLAY_H_ + +#include "GUIDialog.h" + +class CGUIDialogBoxeePaymentOkPlay : public CGUIDialog +{ +public: + CGUIDialogBoxeePaymentOkPlay(void); + virtual ~CGUIDialogBoxeePaymentOkPlay(void); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + + static bool Show(); + +private: + + bool OnClick(CGUIMessage& message); + + bool m_bConfirmed; +}; + +#endif /* CGUIDIALOGBOXEEPAYMENTOKPLAY_H_ */ diff --git a/xbmc/GUIDialogBoxeePaymentProducts.cpp b/xbmc/GUIDialogBoxeePaymentProducts.cpp new file mode 100644 index 00000000..0c2d0811 --- /dev/null +++ b/xbmc/GUIDialogBoxeePaymentProducts.cpp @@ -0,0 +1,522 @@ + +#include "GUIDialogBoxeePaymentProducts.h" +#include "GUIWindowManager.h" +#include "log.h" +#include "lib/libBoxee/bxconfiguration.h" +#include "lib/libBoxee/boxee.h" +#include "GUIDialogProgress.h" +#include "LocalizeStrings.h" +#include "GUIBaseContainer.h" +#include "GUIDialogBoxeePaymentTou.h" +#include "GUIDialogOK2.h" +#include "GUIListContainer.h" +#include "Util.h" + +#define HIDDEN_CONTAINER 5000 +#define CONTROL_HEADER_LABEL 6010 +#define PRODUCTS_LIST 6110 +#define BACK_BUTTON 6130 +#define PURCHASE_LIST 6150 + +CGUIDialogBoxeePaymentProducts::CGUIDialogBoxeePaymentProducts(void) : CGUIDialog(WINDOW_DIALOG_BOXEE_PAYMENT_PRODUCTS, "boxee_payment_products.xml") +{ + m_bConfirmed = false; +} + +CGUIDialogBoxeePaymentProducts::~CGUIDialogBoxeePaymentProducts() +{ + +} + +void CGUIDialogBoxeePaymentProducts::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentProducts::OnInitWindow - Handling item [label=%s][path=%s][thumb=%s]. [link-title=%s][link-url=%s][link-boxeetype=%s][link-boxeeoffer=%s][link-type=%s][link-provider=%s][link-providername=%s][link-providerthumb=%s][link-countrycodes=%s][link-countryrel=%d][quality-lbl=%s][quality=%d][is-hd=%s][productsList=%s] (pay)",m_item.GetLabel().c_str(),m_item.m_strPath.c_str(),m_item.GetThumbnailImage().c_str(),m_item.GetProperty("link-title").c_str(),m_item.GetProperty("link-url").c_str(),m_item.GetProperty("link-boxeetype").c_str(),m_item.GetProperty("link-boxeeoffer").c_str(),m_item.GetProperty("link-type").c_str(),m_item.GetProperty("link-provider").c_str(),m_item.GetProperty("link-providername").c_str(),m_item.GetProperty("link-providerthumb").c_str(),m_item.GetProperty("link-countrycodes").c_str(),m_item.GetPropertyBOOL("link-countryrel"),m_item.GetProperty("quality-lbl").c_str(),m_item.GetPropertyInt("quality"),m_item.GetProperty("is-hd").c_str(),m_item.GetProperty("link-productslist").c_str()); + + // Send the item to the special container to allow skin access + CFileItemPtr itemPtr(new CFileItem(m_item)); + CGUIMessage winmsg(GUI_MSG_LABEL_ADD, GetID(), HIDDEN_CONTAINER, 0, 0, itemPtr); + g_windowManager.SendThreadMessage(winmsg); + + m_bConfirmed = false; + + CGUIMessage resetProductsListMsg(GUI_MSG_LABEL_RESET, GetID(), PRODUCTS_LIST); + OnMessage(resetProductsListMsg); + + CGUIMessage resetPurchaseListMsg(GUI_MSG_LABEL_RESET, GetID(), PURCHASE_LIST); + OnMessage(resetPurchaseListMsg); + + CFileItemList productsList; + + if (!GetProductsListFromServer(productsList)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentProducts::OnInitWindow - FAILED to get products from server (pay)"); + m_bConfirmed = false; + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55105)); + Close(); + return; + } + + CFileItemList purchaseList; + + for (int i=0; iOnUp(); + } + } + else if (GetFocusedControlID() == PURCHASE_LIST) + { + CGUIListContainer* productListControl = (CGUIListContainer*)GetControl(PRODUCTS_LIST); + if (productListControl) + { + productListControl->OnUp(); + } + } + } + break; + case ACTION_MOVE_DOWN: + { + if (GetFocusedControlID() == PRODUCTS_LIST) + { + CGUIListContainer* purchaseListControl = (CGUIListContainer*)GetControl(PURCHASE_LIST); + if (purchaseListControl) + { + purchaseListControl->OnDown(); + } + } + else if (GetFocusedControlID() == PURCHASE_LIST) + { + CGUIListContainer* productListControl = (CGUIListContainer*)GetControl(PRODUCTS_LIST); + if (productListControl) + { + productListControl->OnDown(); + } + } + } + break; + default: + { + // do nothing + } + break; + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeePaymentProducts::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_CLICKED: + { + return OnClick(message); + } + break; + default: + { + // do nothing + } + break; + } + + return CGUIDialog::OnMessage(message); +} + +bool CGUIDialogBoxeePaymentProducts::OnClick(CGUIMessage& message) +{ + bool succeeded = false; + + int iControl = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentProducts::OnClick - Enter function with [iControl=%d] (pay)",iControl); + + switch(iControl) + { + case PRODUCTS_LIST: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentProducts::OnClick - Handling click on [%d=PRODUCTS_LIST] (pay)",iControl); + + succeeded = HandleClickOnProductsList(); + } + break; + case PURCHASE_LIST: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentProducts::OnClick - Handling click on [%d=PURCHASE_LIST] (pay)",iControl); + + succeeded = HandleClickOnPurchaseList(); + } + break; + default: + { + CLog::Log(LOGWARNING,"CGUIDialogBoxeePaymentProducts::OnClick - UNKNOWN control [%d] was click (pay)",iControl); + } + break; + } + + return succeeded; +} + +bool CGUIDialogBoxeePaymentProducts::HandleClickOnProductsList() +{ + CGUIListContainer* productListControl = (CGUIListContainer*)GetControl(PRODUCTS_LIST); + + if (!productListControl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentProducts::HandleClickOnProductsList - FAILED to get container [%d=PRODUCTS_LIST] container (pay)",PRODUCTS_LIST); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55195)); + return false; +} + + CGUIListItemPtr selectedButton = productListControl->GetSelectedItemPtr(); + if (!selectedButton.get()) +{ + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentProducts::HandleClickOnProductsList - FAILED to get the SelectedItem from container [%d=PRODUCTS_LIST] container (pay)",PRODUCTS_LIST); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55195)); + return false; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentProducts::HandleClickOnProductsList - Click on item [product_id=%s][seller_id=%s][source_index=%s][vindicia_id=%s][name=%s][description=%s][price=%s][currency=%s][currency_symbol=%s][billing_cycle=%s][billing_type=%s][active=%s] (pay)",selectedButton->GetProperty("product_id").c_str(),selectedButton->GetProperty("seller_id").c_str(),selectedButton->GetProperty("source_index").c_str(),selectedButton->GetProperty("vindicia_id").c_str(),selectedButton->GetProperty("name").c_str(),selectedButton->GetProperty("description").c_str(),selectedButton->GetProperty("price").c_str(),selectedButton->GetProperty("currency").c_str(),selectedButton->GetProperty("currency_symbol").c_str(),selectedButton->GetProperty("billing_cycle").c_str(),selectedButton->GetProperty("billing_type").c_str(),selectedButton->GetProperty("active").c_str()); + + if (selectedButton->GetProperty("product_id").IsEmpty()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentProducts::HandleClickOnProductsList - Clicked item in [%d=PRODUCTS_LIST] doesn't have [product_id] property (pay)",PRODUCTS_LIST); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55195)); + return false; + } + + CStdString productId = selectedButton->GetProperty("product_id"); + CStdString productName = selectedButton->GetLabel(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentProducts::HandleClickOnProductsList - Going to close dialog and open WINDOW_BOXEE_BROWSE_PRODUCT with params [ProductId=%s][ProductName=%s] (pay)",productId.c_str(),productName.c_str()); + + std::vector params; + params.push_back(productId); + params.push_back(productName); + + Close(); + + g_windowManager.ActivateWindow(WINDOW_BOXEE_BROWSE_PRODUCT,params); + + return true; + } + +bool CGUIDialogBoxeePaymentProducts::HandleClickOnPurchaseList() + { + CGUIListContainer* purchaseListControl = (CGUIListContainer*)GetControl(PURCHASE_LIST); + + if (!purchaseListControl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentProducts::HandleClickOnPurchaseList - FAILED to get container [%d=PURCHASE_LIST] container (pay)",PURCHASE_LIST); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55195)); + return false; + } + + CGUIListContainer* productListControl = (CGUIListContainer*)GetControl(PRODUCTS_LIST); + + if (!productListControl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentProducts::HandleClickOnPurchaseList - FAILED to get container [%d=PRODUCTS_LIST] container (pay)",PRODUCTS_LIST); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55195)); + return false; +} + + int clickedItemIndex = purchaseListControl->GetSelectedItem(); + + std::vector& productListItemsVec = productListControl->GetItemsByRef(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentProducts::HandleClickOnPurchaseList - Click on [index=%d]. [ProductListSize=%d] (pay)",clickedItemIndex,(int)productListItemsVec.size()); + + CGUIListItemPtr selectedButton; + + if (clickedItemIndex <= (int)productListItemsVec.size()-1) +{ + CGUIListItemPtr selectedButton = productListItemsVec[clickedItemIndex]; + if (!selectedButton.get()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentProducts::HandleClickOnPurchaseList - FAILED to get the SelectedItem from container [%d=PRODUCTS_LIST] container (pay)",PRODUCTS_LIST); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55195)); + return false; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentProducts::HandleClickOnPurchaseList - For [index=%d] got product item [product_id=%s][seller_id=%s][source_index=%s][vindicia_id=%s][name=%s][description=%s][price=%s][currency=%s][currency_symbol=%s][billing_cycle=%s][billing_type=%s][active=%s] (pay)",clickedItemIndex,selectedButton->GetProperty("product_id").c_str(),selectedButton->GetProperty("seller_id").c_str(),selectedButton->GetProperty("source_index").c_str(),selectedButton->GetProperty("vindicia_id").c_str(),selectedButton->GetProperty("name").c_str(),selectedButton->GetProperty("description").c_str(),selectedButton->GetProperty("price").c_str(),selectedButton->GetProperty("currency").c_str(),selectedButton->GetProperty("currency_symbol").c_str(),selectedButton->GetProperty("billing_cycle").c_str(),selectedButton->GetProperty("billing_type").c_str(),selectedButton->GetProperty("active").c_str()); + + bool quitPaymentProcess = false; + if (CGUIDialogBoxeePaymentTou::Show(selectedButton,quitPaymentProcess)) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentProducts::HandleClickOnPurchaseList - dialog PaymentTou returned TRUE -> going to close dialog. [quitPaymentProcess=%d] (pay)",quitPaymentProcess); + m_bConfirmed = !quitPaymentProcess; + Close(); + return true; +} + else + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentProducts::HandleClickOnPurchaseList - dialog PaymentTou returned FALSE. [quitPaymentProcess=%d] (pay)",quitPaymentProcess); + return false; + } + } + else + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentProducts::HandleClickOnPurchaseList - FAILED to get the SelectedItem from container [%d=PRODUCTS_LIST] container. [clickedItemIndex=%d][ProductListSize=%d] (pay)",PRODUCTS_LIST,clickedItemIndex,(int)productListItemsVec.size()); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55195)); + return false; + } +} + +void CGUIDialogBoxeePaymentProducts::SetItem(CFileItemPtr item) +{ + m_item.Reset(); + m_item = *((CFileItem*)item.get()); + + m_item.Dump(); + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentProducts::SetItem - After set item [label=%s][path=%s][thumb=%s]. [link-title=%s][link-url=%s][link-boxeetype=%s][link-boxeeoffer=%s][link-type=%s][link-provider=%s][link-providername=%s][link-providerthumb=%s][link-countrycodes=%s][link-countryrel=%d][quality-lbl=%s][quality=%d][is-hd=%s][productsList=%s] (pay)",m_item.GetLabel().c_str(),m_item.m_strPath.c_str(),m_item.GetThumbnailImage().c_str(),m_item.GetProperty("link-title").c_str(),m_item.GetProperty("link-url").c_str(),m_item.GetProperty("link-boxeetype").c_str(),m_item.GetProperty("link-boxeeoffer").c_str(),m_item.GetProperty("link-type").c_str(),m_item.GetProperty("link-provider").c_str(),m_item.GetProperty("link-providername").c_str(),m_item.GetProperty("link-providerthumb").c_str(),m_item.GetProperty("link-countrycodes").c_str(),m_item.GetPropertyBOOL("link-countryrel"),m_item.GetProperty("quality-lbl").c_str(),m_item.GetPropertyInt("quality"),m_item.GetProperty("is-hd").c_str(),m_item.GetProperty("link-productslist").c_str()); +} + +bool CGUIDialogBoxeePaymentProducts::GetProductsListFromServer(CFileItemList& productsList) +{ + CStdString productsListProp = m_item.GetProperty("link-productslist"); + + if (productsListProp.IsEmpty()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentProducts::GetProductsFromServer - FAILED to find ProductsList property in item [label=%s][path=%s][thumb=%s]. [link-title=%s][link-url=%s][link-boxeetype=%s][link-boxeeoffer=%s][link-type=%s][link-provider=%s][link-providername=%s][link-providerthumb=%s][link-countrycodes=%s][link-countryrel=%d][quality-lbl=%s][quality=%d][is-hd=%s][productsList=%s] (pay)",m_item.GetLabel().c_str(),m_item.m_strPath.c_str(),m_item.GetThumbnailImage().c_str(),m_item.GetProperty("link-title").c_str(),m_item.GetProperty("link-url").c_str(),m_item.GetProperty("link-boxeetype").c_str(),m_item.GetProperty("link-boxeeoffer").c_str(),m_item.GetProperty("link-type").c_str(),m_item.GetProperty("link-provider").c_str(),m_item.GetProperty("link-providername").c_str(),m_item.GetProperty("link-providerthumb").c_str(),m_item.GetProperty("link-countrycodes").c_str(),m_item.GetPropertyBOOL("link-countryrel"),m_item.GetProperty("quality-lbl").c_str(),m_item.GetPropertyInt("quality"),m_item.GetProperty("is-hd").c_str(),m_item.GetProperty("link-productslist").c_str()); + return false; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentProducts::GetProductsFromServer - Going to get from server ProductsList for [ProductsList=%s] (pay)",productsListProp.c_str()); + + GetProductsListJob* pJob = new GetProductsListJob(productsListProp); + if (CUtil::RunInBG(pJob,false) != JOB_SUCCEEDED) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentProducts::GetProductsFromServer - FAILED to get ProductList from server. Job returned FALSE (pay)"); + return false; + } + + productsList = pJob->GetProductsList(); + + delete pJob; + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentProducts::GetProductsFromServer - Exit function with [NumOfItems=%d] for [ProductsList=%s] (pay)",productsList.Size(),productsListProp.c_str()); + + return true; +} + +bool CGUIDialogBoxeePaymentProducts::Show(CFileItemPtr item) +{ + if (!item.get()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentProducts::Show - Enter function with a NULL item (pay)"); + return false; + } + + CGUIDialogBoxeePaymentProducts *dialog = (CGUIDialogBoxeePaymentProducts *)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_PAYMENT_PRODUCTS); + if (!dialog) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentProducts::Show - FAILED to get dialog to show (pay)"); + return false; + } + + dialog->SetItem(item); + dialog->DoModal(); + + return dialog->m_bConfirmed; +} + +GetProductsListJob::GetProductsListJob(const CStdString& productsListIds) +{ + m_productsListIds = productsListIds; +} + +GetProductsListJob::~GetProductsListJob() +{ + +} + +void GetProductsListJob::Run() +{ + CStdString strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.ProductsListUrl","http://app.boxee.tv/api/products?product_ids="); + strUrl += m_productsListIds; + + BOXEE::BXXMLDocument xmlDoc; + + xmlDoc.SetCredentials(BOXEE::Boxee::GetInstance().GetCredentials()); + xmlDoc.SetVerbose(BOXEE::Boxee::GetInstance().IsVerbose()); + + if (!xmlDoc.LoadFromURL(strUrl)) + { + CLog::Log(LOGERROR,"GetProductsListJob::Run - FAILED to get products from [strUrl=%s] (pay)",strUrl.c_str()); + return; + } + + TiXmlElement* pRootElement = xmlDoc.GetDocument().RootElement(); + if (!pRootElement || strcmpi(pRootElement->Value(),"products") != 0) + { + CLog::Log(LOGERROR,"GetProductsListJob::Run - could not parse . [pRootElement=%p][strUrl=%s] (pay)",pRootElement,strUrl.c_str()); + return; + } + + TiXmlElement* productsChildElem = NULL; + productsChildElem = pRootElement->FirstChildElement(); + + while (productsChildElem) + { + if (strcmp(productsChildElem->Value(),"product") == 0) + { + CFileItemPtr productItem(new CFileItem()); + + if (InitProductItem(productsChildElem,productItem)) + { + CLog::Log(LOGDEBUG,"GetProductsListJob::Run - Adding item [product_id=%s][seller_id=%s][source_index=%s][vindicia_id=%s][name=%s][description=%s][price=%s][currency=%s][currency_symbol=%s][billing_cycle=%s][billing_type=%s][active=%s] (pay)",productItem->GetProperty("product_id").c_str(),productItem->GetProperty("seller_id").c_str(),productItem->GetProperty("source_index").c_str(),productItem->GetProperty("vindicia_id").c_str(),productItem->GetProperty("name").c_str(),productItem->GetProperty("description").c_str(),productItem->GetProperty("price").c_str(),productItem->GetProperty("currency").c_str(),productItem->GetProperty("currency_symbol").c_str(),productItem->GetProperty("billing_cycle").c_str(),productItem->GetProperty("billing_type").c_str(),productItem->GetProperty("active").c_str()); + + m_productsList.Add(productItem); + } + } + + productsChildElem = productsChildElem->NextSiblingElement(); + } + + m_bJobResult = true; +} + +bool GetProductsListJob::InitProductItem(TiXmlElement* productElem, CFileItemPtr productItem) +{ + if (!productElem) + { + CLog::Log(LOGERROR,"GetProductsListJob::GetProductsFromServer - Enter function with a NULL element (pay)"); + return false; + } + + bool foundTouElement = false; + TiXmlElement* productChildElem = NULL; + productChildElem = productElem->FirstChildElement(); + + while (productChildElem) + { + if (strcmp(productChildElem->Value(),"product_id") == 0) + { + productItem->SetProperty("product_id",productChildElem->GetText()); + } + else if (strcmp(productChildElem->Value(),"seller_id") == 0) + { + productItem->SetProperty("seller_id",productChildElem->GetText()); + } + else if (strcmp(productChildElem->Value(),"source_index") == 0) + { + productItem->SetProperty("source_index",productChildElem->GetText()); + } + else if (strcmp(productChildElem->Value(),"vindicia_id") == 0) + { + productItem->SetProperty("vindicia_id",productChildElem->GetText()); + } + else if (strcmp(productChildElem->Value(),"name") == 0) + { + productItem->SetProperty("name",productChildElem->GetText()); + productItem->SetLabel(productChildElem->GetText()); + } + else if (strcmp(productChildElem->Value(),"description") == 0) + { + productItem->SetProperty("description",productChildElem->GetText()); + } + else if (strcmp(productChildElem->Value(),"price") == 0) + { + productItem->SetProperty("price",productChildElem->GetText()); + } + else if (strcmp(productChildElem->Value(),"currency") == 0) + { + productItem->SetProperty("currency",productChildElem->GetText()); + } + else if (strcmp(productChildElem->Value(),"currency_symbol") == 0) + { + productItem->SetProperty("currency_symbol",productChildElem->GetText()); + } + else if (strcmp(productChildElem->Value(),"billing_cycle") == 0) + { + productItem->SetProperty("billing_cycle",productChildElem->GetText()); + } + else if (strcmp(productChildElem->Value(),"billing_type") == 0) + { + productItem->SetProperty("billing_type",productChildElem->GetText()); + } + else if (strcmp(productChildElem->Value(),"active") == 0) + { + productItem->SetProperty("active",productChildElem->GetText()); + } + else if (strcmp(productChildElem->Value(),"source") == 0) + { + TiXmlElement* sourceChildElem = NULL; + sourceChildElem = productChildElem->FirstChildElement(); + + while (sourceChildElem) + { + if (strcmp(sourceChildElem->Value(),"terms") == 0) + { + foundTouElement = true; + productItem->SetProperty("terms",sourceChildElem->GetText()); + } + + sourceChildElem = sourceChildElem->NextSiblingElement(); + } + } + + productChildElem = productChildElem->NextSiblingElement(); + } + + if (!foundTouElement) + { + CLog::Log(LOGERROR,"GetProductsListJob::GetProductsFromServer - Product DOESN'T have a element. [name=%s][product_id=%s][foundTouElement=%d] (pay)",productItem->GetProperty("name").c_str(),productItem->GetProperty("product_id").c_str(),foundTouElement); + return false; + } + + return true; +} + +CFileItemList GetProductsListJob::GetProductsList() +{ + return m_productsList; + } + diff --git a/xbmc/GUIDialogBoxeePaymentProducts.h b/xbmc/GUIDialogBoxeePaymentProducts.h new file mode 100644 index 00000000..d5d18a3e --- /dev/null +++ b/xbmc/GUIDialogBoxeePaymentProducts.h @@ -0,0 +1,55 @@ + +#ifndef CGUIDIALOGBOXEEPAYMENTPRODUCTS_H_ +#define CGUIDIALOGBOXEEPAYMENTPRODUCTS_H_ + +#include "GUIDialog.h" +#include "FileItem.h" +#include "Thread.h" + +class GetProductsListJob : public IRunnable +{ +public: + GetProductsListJob(const CStdString& productsListIds); + virtual ~GetProductsListJob(); + + virtual void Run(); + + CFileItemList GetProductsList(); + +private: + + bool InitProductItem(TiXmlElement* productChildElem, CFileItemPtr productItem); + + CStdString m_productsListIds; + CFileItemList m_productsList; +}; + +class CGUIDialogBoxeePaymentProducts : public CGUIDialog +{ +public: + CGUIDialogBoxeePaymentProducts(void); + virtual ~CGUIDialogBoxeePaymentProducts(void); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + + void SetItem(CFileItemPtr item); + + static bool Show(CFileItemPtr item); + +private: + + bool OnClick(CGUIMessage& message); + bool HandleClickOnProductsList(); + bool HandleClickOnPurchaseList(); + + bool GetProductsListFromServer(CFileItemList& productsList); + + bool m_bConfirmed; + + CFileItem m_item; +}; + +#endif /* CGUIDIALOGBOXEEPAYMENTPRODUCTS_H_ */ diff --git a/xbmc/GUIDialogBoxeePaymentTou.cpp b/xbmc/GUIDialogBoxeePaymentTou.cpp new file mode 100644 index 00000000..a9f28574 --- /dev/null +++ b/xbmc/GUIDialogBoxeePaymentTou.cpp @@ -0,0 +1,326 @@ + +#include "GUIDialogBoxeePaymentTou.h" +#include "GUIWindowManager.h" +#include "log.h" +#include "lib/libBoxee/bxconfiguration.h" +#include "lib/libBoxee/boxee.h" +#include "GUIDialogProgress.h" +#include "LocalizeStrings.h" +#include "GUIBaseContainer.h" +#include "GUIDialogOK2.h" +#include "GUIDialogBoxeePaymentUserData.h" +#include "GUITextBox.h" +#include "GUIInfoTypes.h" + +#define HIDDEN_CONTAINER 5000 +#define BACK_BUTTON 6130 +#define CONTROL_TITLE_LABEL 6210 +#define CONTROL_TEXT_LABEL 6211 +#define CONTROL_TOU_TEXTBOX 6220 +#define CONTROL_TOU_TEXTBOX_SCROLL 6221 +#define CONTROL_TERMS_RADIO_BUTTON 6222 +#define ACCEPT_BUTTON 6231 +#define DECLINE_BUTTON 6232 + +CGUIDialogBoxeePaymentTou::CGUIDialogBoxeePaymentTou(void) : CGUIDialog(WINDOW_DIALOG_BOXEE_PAYMENT_TOU, "boxee_payment_tou.xml") +{ + m_bConfirmed = false; + m_quitPaymentProcess = false; + m_bTermsAccepted = false; +} + +CGUIDialogBoxeePaymentTou::~CGUIDialogBoxeePaymentTou() +{ + +} + +void CGUIDialogBoxeePaymentTou::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + if (!m_item.HasProperty("terms")) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentTou::OnInitWindow - FAILED to find TOU property in item (pay)"); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55195)); + Close(); + return; + } + + CStdString priceStr; + if (!GetPriceLabel(priceStr)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentTou::OnInitWindow - FAILED to get build PriceLabel (pay)"); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55195)); + Close(); + return; + } + + CStdString billingTypeStr; + if (!GetBillingTypeLabel(billingTypeStr)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentTou::OnInitWindow - FAILED to build BillingType (pay)"); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55195)); + Close(); + return; + } + + CStdString text; + text.Format(g_localizeStrings.Get(55121).c_str(), priceStr.c_str(),billingTypeStr.c_str()); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentTou::OnInitWindow - Going to set [%s] as header (pay)",text.c_str()); + + SET_CONTROL_LABEL(CONTROL_TEXT_LABEL,text); + + if (!m_item.GetProperty("terms").IsEmpty()) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentTou::OnInitWindow - Going to set TextBox [terms=%s] (pay)",m_item.GetProperty("terms").c_str()); + + CGUITextBox* textbox = (CGUITextBox*)GetControl(CONTROL_TOU_TEXTBOX); + if (!textbox) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentTou::OnInitWindow - FAILED to get TextBox control (pay)"); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55195)); + Close(); + return; + } + + textbox->SetInfo(CGUIInfoLabel(m_item.GetProperty("terms"))); + + CONTROL_ENABLE(CONTROL_TOU_TEXTBOX); + CONTROL_ENABLE(CONTROL_TOU_TEXTBOX_SCROLL); + } + else + { + CONTROL_DISABLE(CONTROL_TOU_TEXTBOX); + CONTROL_DISABLE(CONTROL_TOU_TEXTBOX_SCROLL); + } + + m_bTermsAccepted = false; + m_quitPaymentProcess = false; + + SET_CONTROL_SELECTED(GetID(), CONTROL_TERMS_RADIO_BUTTON, m_bTermsAccepted); + + SET_CONTROL_FOCUS(ACCEPT_BUTTON, 0); +} + +void CGUIDialogBoxeePaymentTou::OnDeinitWindow(int nextWindowID) +{ + CGUIDialog::OnDeinitWindow(nextWindowID); +} + +bool CGUIDialogBoxeePaymentTou::OnAction(const CAction& action) +{ + switch (action.id) + { + case ACTION_PARENT_DIR: + case ACTION_PREVIOUS_MENU: + { + + m_bConfirmed = false; + Close(); + return true; + } + break; + default: + { + // do nothing + } + break; + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeePaymentTou::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_CLICKED: + { + return OnClick(message); + } + break; + default: + { + // do nothing + } + break; + } + + return CGUIDialog::OnMessage(message); +} + +bool CGUIDialogBoxeePaymentTou::OnClick(CGUIMessage& message) +{ + bool succeeded = false; + + int iControl = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentTou::OnClick - Enter function with [iControl=%d] (pay)",iControl); + + switch(iControl) + { + case CONTROL_TERMS_RADIO_BUTTON: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentTou::OnClick - Handling click on [%d=CONTROL_TERMS_RADIO_BUTTON] (pay)",iControl); + + succeeded = HandleClickOnAcceptTerms(); + } + break; + case ACCEPT_BUTTON: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentTou::OnClick - Handling click on [%d=ACCEPT_BUTTON] (pay)",iControl); + + succeeded = HandleClickOnAcceptButton(); + } + break; + case DECLINE_BUTTON: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentTou::OnClick - Handling click on [%d=DECLINE_BUTTON] (pay)",iControl); + + succeeded = HandleClickOnDeclineButton(); + } + break; + default: + { + CLog::Log(LOGWARNING,"CGUIDialogBoxeePaymentTou::OnClick - UNKNOWN control [%d] was click (pay)",iControl); + } + break; + } + + return succeeded; +} + +bool CGUIDialogBoxeePaymentTou::HandleClickOnAcceptTerms() +{ + m_bTermsAccepted = !m_bTermsAccepted; + SET_CONTROL_SELECTED(GetID(), CONTROL_TERMS_RADIO_BUTTON, m_bTermsAccepted); + return true; +} + +bool CGUIDialogBoxeePaymentTou::HandleClickOnAcceptButton() +{ + if (!m_bTermsAccepted) + { + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(55123),g_localizeStrings.Get(55124)); + return false; + } + else + { + if (CGUIDialogBoxeePaymentUserData::Show(m_item.GetProperty("product_id"),m_quitPaymentProcess)) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentTou::OnClick - dialog PaymentUserData returned TRUE -> going to close dialog. [quitPaymentProcess=%d] (pay)",m_quitPaymentProcess); + m_bConfirmed = true; + Close(); + return true; + } + else + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentTou::OnClick - dialog PaymentUserData returned FALSE. [quitPaymentProcess=%d] (pay)",m_quitPaymentProcess); + return false; + } + } +} + +bool CGUIDialogBoxeePaymentTou::HandleClickOnDeclineButton() +{ + m_bConfirmed = false; + Close(); + return true; +} + +bool CGUIDialogBoxeePaymentTou::IsQuitPaymentProcess() +{ + return m_quitPaymentProcess; +} + +void CGUIDialogBoxeePaymentTou::SetItem(CGUIListItemPtr item) +{ + m_item.Reset(); + m_item = *((CGUIListItem*)item.get()); + //CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentsProducts::SetItem - After set item [label=%s][path=%s][thumb=%s]. [link-title=%s][link-url=%s][link-boxeetype=%s][link-boxeeoffer=%s][link-type=%s][link-provider=%s][link-providername=%s][link-providerthumb=%s][link-countrycodes=%s][link-countryrel=%d][quality-lbl=%s][quality=%d][is-hd=%s][productsList=%s] (pay)",m_item.GetLabel().c_str(),m_item.m_strPath.c_str(),m_item.GetThumbnailImage().c_str(),m_item.GetProperty("link-title").c_str(),m_item.GetProperty("link-url").c_str(),m_item.GetProperty("link-boxeetype").c_str(),m_item.GetProperty("link-boxeeoffer").c_str(),m_item.GetProperty("link-type").c_str(),m_item.GetProperty("link-provider").c_str(),m_item.GetProperty("link-providername").c_str(),m_item.GetProperty("link-providerthumb").c_str(),m_item.GetProperty("link-countrycodes").c_str(),m_item.GetPropertyBOOL("link-countryrel"),m_item.GetProperty("quality-lbl").c_str(),m_item.GetPropertyInt("quality"),m_item.GetProperty("is-hd").c_str(),m_item.GetProperty("link-productslist").c_str()); +} + +bool CGUIDialogBoxeePaymentTou::Show(CGUIListItemPtr item, bool& quitPaymentProcess) +{ + if (!item.get()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentTou::Show - Enter function with a NULL item (pay)"); + return false; + } + + CGUIDialogBoxeePaymentTou *dialog = (CGUIDialogBoxeePaymentTou *)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_PAYMENT_TOU); + if (!dialog) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentTou::Show - FAILED to get dialog to show (pay)"); + return false; + } + + dialog->SetItem(item); + dialog->DoModal(); + + quitPaymentProcess = dialog->IsQuitPaymentProcess(); + + return dialog->m_bConfirmed; +} + +bool CGUIDialogBoxeePaymentTou::GetPriceLabel(CStdString& priceStr) +{ + priceStr = ""; + + if (!m_item.GetProperty("currency_symbol").IsEmpty()) + { + priceStr = m_item.GetProperty("currency_symbol"); + } + else if (m_item.GetProperty("currency").IsEmpty()) + { + priceStr = m_item.GetProperty("currency"); + } + else + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentTou::Show - FAILED to get [currency] or [currency_symbol] property from item (pay)"); + return false; + } + + if (!m_item.GetProperty("price").IsEmpty()) + { + priceStr += m_item.GetProperty("price"); + } + else + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentTou::Show - FAILED to get [price] property from item (pay)"); + return false; + } + + return true; +} + +bool CGUIDialogBoxeePaymentTou::GetBillingTypeLabel(CStdString& billingTypeStr) +{ + if (!m_item.GetProperty("billing_type").IsEmpty()) + { + billingTypeStr = m_item.GetProperty("billing_type"); + return true; + } + + return false; +} + +void CGUIDialogBoxeePaymentTou::StartProgressDialog() +{ + m_progress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); + + if (m_progress) + { + m_progress->StartModal(); + m_progress->Progress(); + } +} + +void CGUIDialogBoxeePaymentTou::StopProgressDialog() +{ + if (m_progress) + { + m_progress->Close(); + } +} diff --git a/xbmc/GUIDialogBoxeePaymentTou.h b/xbmc/GUIDialogBoxeePaymentTou.h new file mode 100644 index 00000000..255f2147 --- /dev/null +++ b/xbmc/GUIDialogBoxeePaymentTou.h @@ -0,0 +1,50 @@ + +#ifndef CGUIDIALOGBOXEEPAYMENTTOU_H_ +#define CGUIDIALOGBOXEEPAYMENTTOU_H_ + +#include "GUIDialog.h" +#include "FileItem.h" + +class CGUIDialogProgress; + +class CGUIDialogBoxeePaymentTou : public CGUIDialog +{ +public: + CGUIDialogBoxeePaymentTou(void); + virtual ~CGUIDialogBoxeePaymentTou(void); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + + bool IsQuitPaymentProcess(); + + static bool Show(CGUIListItemPtr item, bool& quitPaymentProcess); + +private: + + void SetItem(CGUIListItemPtr item); + + bool OnClick(CGUIMessage& message); + bool HandleClickOnAcceptTerms(); + bool HandleClickOnAcceptButton(); + bool HandleClickOnDeclineButton(); + + bool GetPriceLabel(CStdString& priceStr); + bool GetBillingTypeLabel(CStdString& billingTypeStr); + + void StartProgressDialog(); + void StopProgressDialog(); + + bool m_bConfirmed; + + CFileItem m_item; + + CGUIDialogProgress* m_progress; + + bool m_bTermsAccepted; + bool m_quitPaymentProcess; +}; + +#endif /* CGUIDIALOGBOXEEPAYMENTTOU_H_ */ diff --git a/xbmc/GUIDialogBoxeePaymentUserData.cpp b/xbmc/GUIDialogBoxeePaymentUserData.cpp new file mode 100644 index 00000000..b6c591bf --- /dev/null +++ b/xbmc/GUIDialogBoxeePaymentUserData.cpp @@ -0,0 +1,516 @@ + +#include "GUIDialogBoxeePaymentUserData.h" +#include "GUIWindowManager.h" +#include "log.h" +#include "lib/libBoxee/bxconfiguration.h" +#include "lib/libBoxee/boxee.h" +#include "LocalizeStrings.h" +#include "GUIEditControl.h" +#include "GUIRadioButtonControl.h" +#include "GUIDialogOK2.h" +#include "lib/libBoxee/boxee.h" +#include "FileCurl.h" +#include "GUIDialogBoxeePaymentWaitForServerApproval.h" +#include "utils/md5.h" +#include "Util.h" + +#define HIDDEN_CONTAINER 5000 +#define CONTROL_TITLE_LABEL 6310 +#define CONTROL_PASSWORD_EDIT 6320 +#define GO_ON_BUTTON 6331 + +#define MIN_PAYMENT_SERVER_ERROR_CODE 81000 +#define MAX_PAYMENT_SERVER_ERROR_CODE 81099 + +CGUIDialogBoxeePaymentUserData::CGUIDialogBoxeePaymentUserData(void) : CGUIDialog(WINDOW_DIALOG_BOXEE_PAYMENT_USERDATA, "boxee_payment_userdata.xml") +{ + m_bConfirmed = false; + m_password = ""; + m_quitPaymentProcess = false; +} + +CGUIDialogBoxeePaymentUserData::~CGUIDialogBoxeePaymentUserData() +{ + +} + +void CGUIDialogBoxeePaymentUserData::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + m_quitPaymentProcess = false; + + m_password = ""; + m_nonceStr = ""; + + CGUIEditControl* passwordControl = (CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT); + if (!passwordControl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::OnInitWindow - FAILED to get password control (pay)"); + Close(); + return; + } + + passwordControl->SetLabel2(m_password); + + SET_CONTROL_FOCUS(CONTROL_PASSWORD_EDIT, 0); +} + +void CGUIDialogBoxeePaymentUserData::OnDeinitWindow(int nextWindowID) +{ + CGUIDialog::OnDeinitWindow(nextWindowID); +} + +bool CGUIDialogBoxeePaymentUserData::OnAction(const CAction& action) +{ + switch (action.id) + { + case ACTION_PARENT_DIR: + case ACTION_PREVIOUS_MENU: + { + + m_bConfirmed = false; + Close(); + return true; + } + break; + default: + { + // do nothing + } + break; + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeePaymentUserData::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_CLICKED: + { + return OnClick(message); + } + break; + default: + { + // do nothing + } + break; + } + + return CGUIDialog::OnMessage(message); +} + +bool CGUIDialogBoxeePaymentUserData::OnClick(CGUIMessage& message) +{ + int iControl = message.GetSenderId(); + + //CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::OnClick - Enter function with [iControl=%d] (pay)",iControl); + + switch(iControl) + { + case GO_ON_BUTTON: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::OnClick - Handling click on [%d=GO_ON_BUTTON] (pay)",iControl); + if (HandleClickOnGoOn()) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::OnClick - Call to HandleClickOnGoOn() returned TRUE -> going to close dialog (pay)"); + m_bConfirmed = true; + Close(); + return true; + } + else + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::OnClick - Call to HandleClickOnGoOn() returned FALSE (pay)"); + return true; + } + } + break; + case CONTROL_PASSWORD_EDIT: + { + return true; + } + break; + default: + { + CLog::Log(LOGWARNING,"CGUIDialogBoxeePaymentUserData::OnClick - UNKNOWN control [%d] was click (pay)",iControl); + return true; + } + break; + } +} + +bool CGUIDialogBoxeePaymentUserData::HandleClickOnGoOn() +{ + CGUIEditControl* passwordControl = (CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT); + if (!passwordControl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleClickOnGoOn - FAILED to get password control (pay)"); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55195)); + return false; + } + + m_password = passwordControl->GetLabel2(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::HandleClickOnGoOn - After set [password=%s] (pay)",m_password.c_str()); + + if (m_password.IsEmpty()) + { + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(55131),g_localizeStrings.Get(55132)); + return false; + } + else + { + bool transactionSucceeded = HandleTransactionWithServer(); + if (transactionSucceeded || m_quitPaymentProcess) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::HandleClickOnGoOn - Call to HandleTransactionWithServer() returned [%d]. Return TRUE. [quitPaymentProcess=%d] (pay)",transactionSucceeded,m_quitPaymentProcess); + return true; + } + else + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleClickOnGoOn - Call to HandleTransactionWithServer() returned [%d]. Return FALSE. [quitPaymentProcess=%d] (pay)",transactionSucceeded,m_quitPaymentProcess); + return false; + } + } +} + +bool CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer() +{ + CStdString url = "http://app.boxee.tv/product/"; + url += m_productId; + url += "/subscribe"; + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - Call GetNonceFromServer() with [url=%s] (pay)",url.c_str()); + + if (!GetNonceFromServer(url)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - FAILED to get nonce from server (pay)"); + + if (!m_quitPaymentProcess) + { + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55195)); + } + + return false; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - Call GetNonceFromServer() with [url=%s] returned TRUE (pay)",url.c_str()); + + CStdString signature = m_productId; + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - 1 - [signature=%s]. [productId=%s] (pay)",signature.c_str(),m_productId.c_str()); + + signature += m_nonceStr; + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - 2 - [signature=%s]. [nonceStr=%s] (pay)",signature.c_str(),m_nonceStr.c_str()); + + CStdString temp = BOXEE::Boxee::GetInstance().GetCredentials().GetUserName(); + temp += ":boxee:"; + temp += m_password; + CStdString passwordMD5; + XBMC::MD5 md5ForPassword; + md5ForPassword.append(temp); + md5ForPassword.getDigest(passwordMD5); + passwordMD5.ToLower(); + signature += passwordMD5; + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - 3 - [signature=%s]. [password=%s][passwordMD5=%s] (pay)",signature.c_str(),m_password.c_str(),passwordMD5.c_str()); + + CStdString signatureMD5; + XBMC::MD5 md5ForSignature; + md5ForSignature.append(signature); + md5ForSignature.getDigest(signatureMD5); + signatureMD5.ToLower(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - 4 - [signature=%s][signatureMD5=%s] (pay)",signature.c_str(),signatureMD5.c_str()); + + CStdString strPostData = "signature="; + strPostData += signatureMD5; + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - Going to do transaction to url [%s] with data [%s] (pay)",url.c_str(),strPostData.c_str()); + + PostRequestJob* pJob = new PostRequestJob(url,strPostData); + if (CUtil::RunInBG(pJob,false) != JOB_SUCCEEDED) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - FAILED to finish transaction action. Job returned FALSE (pay)"); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55135)); + return false; + } + + CStdString strResp = pJob->GetRespose(); + long retCode = pJob->GetRetCode(); + + delete pJob; + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - For [%s] got response length [%d]. [RetCode=%ld] (pay)",url.c_str(),(int)strResp.size(),retCode); + + if (retCode != 200) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - FAILED to finish transaction action (pay)"); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55135)); + return false; + } + else + { + BOXEE::BXXMLDocument xmlDoc; + if (!xmlDoc.LoadFromString(strResp)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - FAILED to load server response [%s]. [url=%s][IsRespEmpty=%d] (pay)",strResp.c_str(),url.c_str(),strResp.IsEmpty()); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55135)); + return false; + } + + TiXmlElement* pRootElement = xmlDoc.GetDocument().RootElement(); + if (!pRootElement) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - FAILED to get RootElement. [url=%s] (pay)",url.c_str()); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55135)); + return false; + } + + if (strcmpi(pRootElement->Value(),"response") != 0) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - Root element is NOT . [<%s>][url=%s] (pay)",pRootElement->Value(),url.c_str()); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),g_localizeStrings.Get(55135)); + return false; +} + + TiXmlElement* pErrorCodeElement = pRootElement->FirstChildElement("errorCode"); + if (pErrorCodeElement) + { + CStdString errorCode = pErrorCodeElement->GetText(); + + CStdString errorMsg = ""; + TiXmlElement* pErrorMsgElement = pRootElement->FirstChildElement("errorMsg"); + if (pErrorMsgElement) + { + errorMsg = pErrorMsgElement->GetText(); + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - Server response contain an ERROR. [ErrorCode=%s][ErrorMsg=%s] (pay)",errorCode.c_str(),errorMsg.c_str()); + } + else + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - Server response contain an ERROR. [ErrorCode=%s] (pay)",errorCode.c_str()); + } + + CStdString errorCodeStr = g_localizeStrings.Get(81000); + + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - Set to general error [errorCodeStr=%s]. [ErrorCode=%s][ErrorMsg=%s] (pay)",errorCodeStr.c_str(),errorCode.c_str(),errorMsg.c_str()); + + long lErrorCode = atol(errorCode.c_str()); + + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - [str=%s] -> [long=%ld]. [errorCodeStr=%s][ErrorCode=%s][ErrorMsg=%s] (pay)",errorCode.c_str(),lErrorCode,errorCodeStr.c_str(),errorCode.c_str(),errorMsg.c_str()); + + if (lErrorCode >= MIN_PAYMENT_SERVER_ERROR_CODE || lErrorCode <= MAX_PAYMENT_SERVER_ERROR_CODE) + { + errorCodeStr = g_localizeStrings.Get(lErrorCode); + + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - [str=%s] -> [long=%ld]. [errorCodeStr=%s][ErrorCode=%s][ErrorMsg=%s] (pay)",errorCode.c_str(),lErrorCode,errorCodeStr.c_str(),errorCode.c_str(),errorMsg.c_str()); + } + + if (errorCodeStr.IsEmpty()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::HandleTransactionWithServer - FAILED to get string error for [ErrorCode=%s]. Set a general error (pay)",errorCode.c_str()); + CStdString errorCodeStr = g_localizeStrings.Get(81000); + } + + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701),errorCodeStr); + return false; + } + else + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - Transaction action succeeded. Update user EntitlementsList (pay)"); + BOXEE::Boxee::GetInstance().GetBoxeeClientServerComManager().UpdateUserEntitlementsNow(); + return true; + } + } +} + +bool CGUIDialogBoxeePaymentUserData::GetNonceFromServer(const CStdString& url) +{ + // set PostData to NOT be empty in order for action to be POST + CStdString strPostData = "submit=subscribe"; + + PostRequestJob* pJob = new PostRequestJob(url,strPostData); + if (CUtil::RunInBG(pJob,false) != JOB_SUCCEEDED) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - FAILED to nonce from server. Job returned FALSE (pay)"); + return false; + } + + CStdString strResp = pJob->GetRespose(); + long retCode = pJob->GetRetCode(); + + delete pJob; + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - For [%s] got response length [%d]. [RetCode=%ld] (pay)",url.c_str(),(int)strResp.size(),retCode); + + if (retCode != 200) + { + m_quitPaymentProcess = true; + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - Got [RetCode=%ld] from server. After set [quitPaymentProcess=%d]. [url=%s] (pay)",retCode,m_quitPaymentProcess,url.c_str()); + return false; + } + + BOXEE::BXXMLDocument xmlDoc; + if (!xmlDoc.LoadFromString(strResp)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - FAILED to load server response [%s]. [url=%s][IsRespEmpty=%d] (pay)",strResp.c_str(),url.c_str(),strResp.IsEmpty()); + return false; + } + + TiXmlElement* pRootElement = xmlDoc.GetDocument().RootElement(); + if (!pRootElement) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - FAILED to get RootElement. [url=%s] (pay)",url.c_str()); + return false; + } + + if (strcmpi(pRootElement->Value(),"response") != 0) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - Root element is NOT . [<%s>][url=%s] (pay)",pRootElement->Value(),url.c_str()); + return false; + } + + TiXmlElement* pNonceElement = pRootElement->FirstChildElement("nonce"); + if (!pNonceElement) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - Server response doesn't include (pay)"); + + TiXmlElement* pEmailElement = pRootElement->FirstChildElement("email"); + if (!pEmailElement) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - Server response doesn't include (pay)"); + return false; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - parse from server response (pay)"); + + CStdString email = pEmailElement->GetText(); + + if (!WaitForNonceFromServer(url,email,m_nonceStr)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - FAILED to wait for from server (pay)"); + return false; + } + } + else + { + m_nonceStr = pNonceElement->GetText(); + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - parse from server response. [nonce=%s] (pay)",m_nonceStr.c_str()); + } + + if (m_nonceStr.IsEmpty()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - FAILED to get nonce [nonceStr=%s]. [url=%s] (pay)",m_nonceStr.c_str(),url.c_str()); + return false; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::GetNonceFromServer - After set [nonceStr=%s] (pay)",m_nonceStr.c_str()); + + return true; +} + +bool CGUIDialogBoxeePaymentUserData::WaitForNonceFromServer(const CStdString& url, const CStdString& email, CStdString& nonceStr) +{ + if (email.IsEmpty()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::WaitForNonceFromServer - Enter function with an empty email. [email=%s] (pay)",email.c_str()); + return false; + } + + CGUIDialogBoxeePaymentWaitForServerApproval *dialog = (CGUIDialogBoxeePaymentWaitForServerApproval *)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_PAYMENT_WAIT_FOR_SERVER_APPROVAL); + if (!dialog) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::WaitForNonceFromServer - FAILED to get dialog to show (pay)"); + return false; + } + + dialog->SetEmail(email); + dialog->SetUrl(url); + dialog->DoModal(); + + m_quitPaymentProcess = dialog->IsQuitTransaction(); + + if (dialog->IsConfirmed()) + { + dialog->GetNonceStr(nonceStr); + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::WaitForNonceFromServer - dialog PaymentWaitForServerApproval returned TRUE and set [nonce=%s]. [quitPaymentProcess=%d] (pay)",nonceStr.c_str(),m_quitPaymentProcess); + return true; + } + else + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentUserData::WaitForNonceFromServer - dialog PaymentWaitForServerApproval returned FALSE. [quitPaymentProcess=%d] (pay)",m_quitPaymentProcess); + return false; + } +} + +bool CGUIDialogBoxeePaymentUserData::IsQuitPaymentProcess() +{ + return m_quitPaymentProcess; +} + +void CGUIDialogBoxeePaymentUserData::SetProductId(const CStdString& productId) +{ + m_productId = productId; +} + +bool CGUIDialogBoxeePaymentUserData::Show(const CStdString& productId, bool& quitPaymentProcess) +{ + CGUIDialogBoxeePaymentUserData *dialog = (CGUIDialogBoxeePaymentUserData *)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_PAYMENT_USERDATA); + if (!dialog) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::Show - FAILED to get dialog to show (pay)"); + return false; + } + + if (productId.IsEmpty()) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentUserData::Show - Enter function with EMPTY ProductId. [productId=%s] (pay)",productId.c_str()); + return false; + } + + dialog->SetProductId(productId); + dialog->DoModal(); + + quitPaymentProcess = dialog->IsQuitPaymentProcess(); + + return dialog->m_bConfirmed; +} + +PostRequestJob::PostRequestJob(const CStdString& url, const CStdString& strPostData) +{ + m_url = url; + m_strPostData = strPostData; + m_strResp = ""; + m_retCode = 0; +} + +PostRequestJob::~PostRequestJob() +{ + +} + +void PostRequestJob::Run() +{ + m_strResp = ""; + m_retCode = 0; + + m_strResp = m_curl.HttpPostString(m_url.c_str(),m_strPostData); + m_retCode = m_curl.GetLastRetCode(); + + m_bJobResult = true; +} + +CStdString PostRequestJob::GetRespose() +{ + return m_strResp; +} + +long PostRequestJob::GetRetCode() +{ + return m_retCode; +} + diff --git a/xbmc/GUIDialogBoxeePaymentUserData.h b/xbmc/GUIDialogBoxeePaymentUserData.h new file mode 100644 index 00000000..8df983ab --- /dev/null +++ b/xbmc/GUIDialogBoxeePaymentUserData.h @@ -0,0 +1,66 @@ + +#ifndef CGUIDIALOGBOXEEPAYMENTUSERDATA_H_ +#define CGUIDIALOGBOXEEPAYMENTUSERDATA_H_ + +#include "GUIDialog.h" +#include "Thread.h" +#include "lib/libBoxee/bxcurl.h" + +class PostRequestJob : public IRunnable +{ +public: + PostRequestJob(const CStdString& url, const CStdString& strPostData); + virtual ~PostRequestJob(); + + virtual void Run(); + + CStdString GetRespose(); + long GetRetCode(); + +private: + + BOXEE::BXCurl m_curl; + CStdString m_url; + CStdString m_strPostData; + CStdString m_strResp; + long m_retCode; +}; + +class CGUIDialogBoxeePaymentUserData : public CGUIDialog +{ +public: + CGUIDialogBoxeePaymentUserData(void); + virtual ~CGUIDialogBoxeePaymentUserData(void); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + + bool IsTransactionSucceeded(); + bool IsQuitPaymentProcess(); + + static bool Show(const CStdString& productId, bool& quitPaymentProcess); + +private: + + bool OnClick(CGUIMessage& message); + bool HandleClickOnGoOn(); + + bool HandleTransactionWithServer(); + bool GetNonceFromServer(const CStdString& url); + + bool WaitForNonceFromServer(const CStdString& url, const CStdString& message, CStdString& nonceStr); + + void SetProductId(const CStdString& productId); + + bool m_bConfirmed; + bool m_transactionSucceeded; + bool m_quitPaymentProcess; + + CStdString m_productId; + CStdString m_password; + CStdString m_nonceStr; +}; + +#endif /* CGUIDIALOGBOXEEPAYMENTUSERDATA_H_ */ diff --git a/xbmc/GUIDialogBoxeePaymentWaitForServerApproval.cpp b/xbmc/GUIDialogBoxeePaymentWaitForServerApproval.cpp new file mode 100644 index 00000000..a26fa513 --- /dev/null +++ b/xbmc/GUIDialogBoxeePaymentWaitForServerApproval.cpp @@ -0,0 +1,344 @@ + +#include "GUIDialogBoxeePaymentWaitForServerApproval.h" +#include "GUIWindowManager.h" +#include "log.h" +#include "lib/libBoxee/bxconfiguration.h" +#include "lib/libBoxee/boxee.h" +#include "LocalizeStrings.h" +#include "GUIEditControl.h" +#include "GUIRadioButtonControl.h" +#include "GUIDialogOK2.h" +#include "lib/libBoxee/bxcurl.h" +#include "lib/libBoxee/boxee.h" +#include "GUIDialogProgress.h" +#include "FileCurl.h" +#include "bxutils.h" + +#define HIDDEN_CONTAINER 5000 +#define CONTROL_TITLE_LABEL 6410 +#define CONTROL_MESSAGE_LABEL 6411 +#define DO_LATER_BUTTON 6431 + +#define CHECK_NONCE_IN_SEC 5 +#define MAX_WAIT_FOR_NONCE_IN_SEC 600 // 10 min + +CGUIDialogBoxeePaymentWaitForServerApproval::CGUIDialogBoxeePaymentWaitForServerApproval(void) : CGUIDialog(WINDOW_DIALOG_BOXEE_PAYMENT_WAIT_FOR_SERVER_APPROVAL, "boxee_payment_wait_for_server_approval.xml") +{ + m_bConfirmed = true; + m_quitTransaction = false; + m_email = ""; + m_nonceStr = ""; + m_getNonceJob = NULL; +} + +CGUIDialogBoxeePaymentWaitForServerApproval::~CGUIDialogBoxeePaymentWaitForServerApproval() +{ + +} + +void CGUIDialogBoxeePaymentWaitForServerApproval::OnInitWindow() +{ + if (m_email.IsEmpty()) + { + m_bConfirmed = false; + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentWaitForServerApproval::OnInitWindow - Enter function with EMPTY email [%s]. After set [Confirmed=%d] (pay)",m_email.c_str(),m_bConfirmed); + Close(); + return; + } + + if (m_url.IsEmpty()) + { + m_bConfirmed = false; + CLog::Log(LOGERROR,"CGUIDialogBoxeePaymentWaitForServerApproval::OnInitWindow - Enter function with EMPTY url [%s]. After set [Confirmed=%d] (pay)",m_url.c_str(),m_bConfirmed); + Close(); + return; + } + + CGUIDialog::OnInitWindow(); + + m_nonceStr = ""; + m_quitTransaction = false; + + m_getNonceJob = new CGetNonceJob(m_url); + + m_processor.Start(1); + m_processor.QueueJob(m_getNonceJob); + + CStdString message; + CStdString email = "[COLOR green]"; + email += m_email; + email += "[/COLOR]"; + message.Format(g_localizeStrings.Get(55143).c_str(), email.c_str()); + + SET_CONTROL_LABEL(CONTROL_MESSAGE_LABEL,message); + + SET_CONTROL_FOCUS(DO_LATER_BUTTON, 0); +} + +void CGUIDialogBoxeePaymentWaitForServerApproval::OnDeinitWindow(int nextWindowID) +{ + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentWaitForServerApproval::OnDeinitWindow - Enter function. [nextWindowID=%d] (pay)",nextWindowID); + + m_getNonceJob->Stop(); + m_processor.Stop(); + + m_getNonceJob->GetNonceStr(m_nonceStr); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentWaitForServerApproval::OnDeinitWindow - After set [nonceStr=%s]. [JobIsNonceSet=%d] (pay)",m_nonceStr.c_str(),m_getNonceJob->IsNonceSet()); + + delete m_getNonceJob; + + CGUIDialog::OnDeinitWindow(nextWindowID); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentWaitForServerApproval::OnDeinitWindow - Exit function. [nextWindowID=%d] (pay)",nextWindowID); +} + +bool CGUIDialogBoxeePaymentWaitForServerApproval::OnAction(const CAction& action) +{ + switch (action.id) + { + case ACTION_PARENT_DIR: + case ACTION_PREVIOUS_MENU: + { + m_bConfirmed = false; + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentWaitForServerApproval::OnAction - Handling action [%d]. After set [Confirmed=%d] and going to call Close() (pay)",action.id,m_bConfirmed); + Close(); + return true; + } + break; + default: + { + // do nothing + } + break; + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeePaymentWaitForServerApproval::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_CLICKED: + { + return OnClick(message); + } + break; + default: + { + // do nothing + } + break; + } + + return CGUIDialog::OnMessage(message); +} + +bool CGUIDialogBoxeePaymentWaitForServerApproval::OnClick(CGUIMessage& message) +{ + bool succeeded = false; + + int iControl = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentWaitForServerApproval::OnClick - Enter function with [iControl=%d] (pay)",iControl); + + switch(iControl) + { + case DO_LATER_BUTTON: + { + m_bConfirmed = false; + m_quitTransaction = true; + CLog::Log(LOGDEBUG,"CGUIDialogBoxeePaymentWaitForServerApproval::OnClick - Handling click on [%d=DO_LATER_BUTTON] - going to call Close(). [Confirmed=%d][quitTransaction=%d] (pay)",DO_LATER_BUTTON,m_bConfirmed,m_quitTransaction); + Close(); + return true; + } + break; + default: + { + CLog::Log(LOGWARNING,"CGUIDialogBoxeePaymentWaitForServerApproval::OnClick - UNKNOWN control [%d] was click (pay)",iControl); + } + break; + } + + return succeeded; +} + +void CGUIDialogBoxeePaymentWaitForServerApproval::Render() +{ + if (!m_getNonceJob->IsRuning()) + { + m_bConfirmed = m_getNonceJob->IsNonceSet(); + Close(); + return; + } + + CGUIDialog::Render(); +} + +bool CGUIDialogBoxeePaymentWaitForServerApproval::IsQuitTransaction() +{ + return m_quitTransaction; +} + +bool CGUIDialogBoxeePaymentWaitForServerApproval::IsConfirmed() +{ + return m_bConfirmed; +} + +void CGUIDialogBoxeePaymentWaitForServerApproval::SetEmail(const CStdString& email) +{ + m_email = email; +} + +void CGUIDialogBoxeePaymentWaitForServerApproval::SetUrl(const CStdString& url) +{ + m_url = url; +} + +void CGUIDialogBoxeePaymentWaitForServerApproval::GetNonceStr(CStdString& nonceStr) +{ + nonceStr = m_nonceStr; +} + +////////////////// +// CGetNonceJob // +////////////////// + +CGUIDialogBoxeePaymentWaitForServerApproval::CGetNonceJob::CGetNonceJob(const CStdString& url) : BXBGJob("CGetNonceJob",false) +{ + m_url = url; + m_nonceStr = ""; + m_nonceWasSet = false; + m_isRunning = false; + m_stop = false; +} + +CGUIDialogBoxeePaymentWaitForServerApproval::CGetNonceJob::~CGetNonceJob() +{ + +} + +void CGUIDialogBoxeePaymentWaitForServerApproval::CGetNonceJob::DoWork() +{ + m_isRunning = true; + m_nonceWasSet = false; + + CLog::Log(LOGDEBUG,"CGetNonceJob::DoWork - Enter function (pay)"); + + long retCode; + + BOXEE::BXCurl curl; + CStdString strResp; + + // set PostData to NOT be empty in order for action to be POST + CStdString strPostData = "submit=subscribe"; + + CStdString url = m_url; + url += "?retry="; + + CLog::Log(LOGDEBUG,"CGetNonceJob::DoWork - Going to check for . [url=%s][stop=%d] (pay)",url.c_str(),m_stop); + + int loopCounter = -1; + int requestCounter = -1; + + while (!m_stop) + { + loopCounter++; + + if (loopCounter % CHECK_NONCE_IN_SEC == 0) + { + requestCounter++; + CStdString requestCounterStr = BOXEE::BXUtils::IntToString(requestCounter); + url += requestCounterStr; + + strResp = curl.HttpPostString(url.c_str(),strPostData); + + retCode = curl.GetLastRetCode(); + + CLog::Log(LOGDEBUG,"CGetNonceJob::DoWork - [%d] - For [%s] got response length [%d]. [RetCode=%ld][requestCounter=%d][requestCounterStr=%s][stop=%d] (pay)",loopCounter,url.c_str(),(int)strResp.size(),retCode,requestCounter,requestCounterStr.c_str(),m_stop); + + if (m_stop) + { + continue; + } + + if (retCode == 200 && (int)strResp.size() > 0) + { + BOXEE::BXXMLDocument xmlDoc; + if (!xmlDoc.LoadFromString(strResp)) + { + CLog::Log(LOGERROR,"CGetNonceJob::DoWork - [%d] - FAILED to load server response. [url=%s][IsRespEmpty=%d][stop=%d] (pay)",loopCounter,url.c_str(),strResp.IsEmpty(),m_stop); + } + else + { + TiXmlElement* pRootElement = xmlDoc.GetDocument().RootElement(); + if (!pRootElement) + { + CLog::Log(LOGERROR,"CGetNonceJob::DoWork - [%d] - FAILED to get RootElement. [url=%s][stop=%d] (pay)",loopCounter,url.c_str(),m_stop); + } + else + { + if (strcmpi(pRootElement->Value(),"response") != 0) + { + CLog::Log(LOGERROR,"CGetNonceJob::DoWork - [%d] - Root element is NOT . [<%s>][url=%s][stop=%d] (pay)",loopCounter,pRootElement->Value(),url.c_str(),m_stop); + } + else + { + TiXmlElement* pNonceElement = pRootElement->FirstChildElement("nonce"); + if (pNonceElement) + { + m_nonceStr = pNonceElement->GetText(); + m_nonceWasSet = true; + m_stop = true; + CLog::Log(LOGDEBUG,"CGetNonceJob::DoWork - [%d] - After get [nonceStr=%s]. [stop=%d] (pay)",loopCounter,m_nonceStr.c_str(),m_stop); + continue; + } + else + { + CLog::Log(LOGDEBUG,"CGetNonceJob::DoWork - [%d] - Server response doesn't include . [stop=%d] (pay)",loopCounter,m_stop); + } + } + } + } + } + } + + if (loopCounter > MAX_WAIT_FOR_NONCE_IN_SEC) + { + CLog::Log(LOGDEBUG,"CGetNonceJob::DoWork - [%d] - Wait for more the %dsec. Going to exit (pay)",loopCounter,MAX_WAIT_FOR_NONCE_IN_SEC); + m_stop = true; + continue; + } + + if (!m_stop) + { + Sleep(1000); + } + } + + CLog::Log(LOGDEBUG,"CGetNonceJob::DoWork - [%d] - Exit function. [nonceStr=%s][stop=%d] (pay)",loopCounter,m_nonceStr.c_str(),m_stop); + + m_isRunning = false; + } + +void CGUIDialogBoxeePaymentWaitForServerApproval::CGetNonceJob::GetNonceStr(CStdString& nonceStr) +{ + nonceStr = m_nonceStr; +} + +bool CGUIDialogBoxeePaymentWaitForServerApproval::CGetNonceJob::IsNonceSet() +{ + return m_nonceWasSet; +} + +bool CGUIDialogBoxeePaymentWaitForServerApproval::CGetNonceJob::IsRuning() + { + return m_isRunning; + } + +void CGUIDialogBoxeePaymentWaitForServerApproval::CGetNonceJob::Stop() +{ + m_stop = true; + } + diff --git a/xbmc/GUIDialogBoxeePaymentWaitForServerApproval.h b/xbmc/GUIDialogBoxeePaymentWaitForServerApproval.h new file mode 100644 index 00000000..7e2c122c --- /dev/null +++ b/xbmc/GUIDialogBoxeePaymentWaitForServerApproval.h @@ -0,0 +1,71 @@ + +#ifndef CGUIDIALOGBOXEEPAYMENTWAITFORSEVERAPPROVAL_H_ +#define CGUIDIALOGBOXEEPAYMENTWAITFORSEVERAPPROVAL_H_ + +#include "GUIDialog.h" +#include "lib/libBoxee/bxbgprocess.h" +#include "FileCurl.h" + +class CGUIDialogProgress; + +class CGUIDialogBoxeePaymentWaitForServerApproval : public CGUIDialog +{ +public: + CGUIDialogBoxeePaymentWaitForServerApproval(void); + virtual ~CGUIDialogBoxeePaymentWaitForServerApproval(void); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + + virtual void Render(); + + bool IsQuitTransaction(); + bool IsConfirmed(); + + void SetEmail(const CStdString& email); + void SetUrl(const CStdString& url); + + void GetNonceStr(CStdString& nonceStr); + +private: + + bool OnClick(CGUIMessage& message); + + bool m_bConfirmed; + + bool m_quitTransaction; + + CStdString m_email; + CStdString m_url; + CStdString m_nonceStr; + + class CGetNonceJob : public BOXEE::BXBGJob + { + public: + CGetNonceJob(const CStdString& url); + virtual ~CGetNonceJob(); + virtual void DoWork(); + + void GetNonceStr(CStdString& nonceStr); + bool IsNonceSet(); + + bool IsRuning(); + + void Stop(); + + private: + + CStdString m_url; + CStdString m_nonceStr; + bool m_nonceWasSet; + bool m_isRunning; + bool m_stop; + }; + + CGetNonceJob* m_getNonceJob; + BOXEE::BXBGProcess m_processor; +}; + +#endif /* CGUIDIALOGBOXEEPAYMENTWAITFORSEVERAPPROVAL_H_ */ diff --git a/xbmc/GUIDialogBoxeeQuickTip.cpp b/xbmc/GUIDialogBoxeeQuickTip.cpp new file mode 100644 index 00000000..f36174c2 --- /dev/null +++ b/xbmc/GUIDialogBoxeeQuickTip.cpp @@ -0,0 +1,43 @@ +#include "GUIDialogBoxeeQuickTip.h" +#include "GUIWindowManager.h" +#include "BoxeeUtils.h" +#include "log.h" + +CGUIDialogBoxeeQuickTip::CGUIDialogBoxeeQuickTip() : CGUIDialog(WINDOW_DIALOG_BOXEE_QUICK_TIP, "DialogQuickTip.xml") +{ + +} + + +CGUIDialogBoxeeQuickTip::~CGUIDialogBoxeeQuickTip() +{ + +} + +bool CGUIDialogBoxeeQuickTip::OnMessage(CGUIMessage &message) +{ + return CGUIDialog::OnMessage(message); +} + +void CGUIDialogBoxeeQuickTip::OnInitWindow() +{ + CGUIWindow::OnInitWindow(); +} + +void CGUIDialogBoxeeQuickTip::ShowAndGetInput() +{ + CGUIDialogBoxeeQuickTip* dialog = (CGUIDialogBoxeeQuickTip*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_QUICK_TIP); + if (!dialog) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeQuickTip::ShowAndGetInput - FAILED to get WINDOW_DIALOG_BOXEE_QUICK_TIP (login)"); + return; + } + + if (strcmpi(BoxeeUtils::GetPlatformStr(),"dlink.dsm380") != 0) + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeQuickTip::ShowAndGetInput - [platform=%s] -> return (login)",BoxeeUtils::GetPlatformStr()); + return; + } + + dialog->DoModal(); +} diff --git a/xbmc/GUIDialogBoxeeQuickTip.h b/xbmc/GUIDialogBoxeeQuickTip.h new file mode 100644 index 00000000..ace90369 --- /dev/null +++ b/xbmc/GUIDialogBoxeeQuickTip.h @@ -0,0 +1,31 @@ +// +// C++ Interface: GUIDialogBoxeeShare +// +// Description: +// +// +// Author: Team XBMC <>, (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef GUIDIALOGBOXEEQUICKTIP_H +#define GUIDIALOGBOXEEQUICKTIP_H + +#include "GUIDialog.h" + +/** +*/ +class CGUIDialogBoxeeQuickTip : public CGUIDialog +{ +public: + CGUIDialogBoxeeQuickTip(); + virtual ~CGUIDialogBoxeeQuickTip(); + + virtual bool OnMessage(CGUIMessage &message); + virtual void OnInitWindow(); + + static void ShowAndGetInput(); +}; + +#endif // GUIDIALOGBOXEEQUICKTIP_H diff --git a/xbmc/GUIDialogBoxeeSeekBar.cpp b/xbmc/GUIDialogBoxeeSeekBar.cpp new file mode 100644 index 00000000..56ad0a56 --- /dev/null +++ b/xbmc/GUIDialogBoxeeSeekBar.cpp @@ -0,0 +1,260 @@ +#include "GUIDialogBoxeeSeekBar.h" +#include "GUIWindowManager.h" +#include "log.h" +#include "Application.h" +#include "utils/GUIInfoManager.h" +#include "GUIButtonControl.h" +#include "GUIImage.h" +#include "TimeUtils.h" + +#define CONTROL_SEEK_BUTTON 8100 +#define CONTROL_SEEK_ARROW_IMAGE 8200 + +#define MIN_SEEK_OFFSET_FARWARD 10 +#define MIN_SEEK_OFFSET_BACKWARD 5 +#define MIN_PROGRESS_POS_X 0 +#define MAX_PROGRESS_POS_X 1280 + +CGUIDialogBoxeeSeekBar::CGUIDialogBoxeeSeekBar() : CGUIDialog(WINDOW_DIALOG_BOXEE_SEEK_BAR, "boxee_seek_bar.xml") +{ + +} + +CGUIDialogBoxeeSeekBar::~CGUIDialogBoxeeSeekBar() +{ + +} + +void CGUIDialogBoxeeSeekBar::OnInitWindow() +{ + if (!g_application.m_pPlayer->CanSeek()) + { + CLog::Log(LOGWARNING,"CGUIDialogBoxeeSeekBar::OnInitWindow - player can't seek. Close dialog (osds)"); + Close(); + return; + } + + CGUIDialog::OnInitWindow(); + + m_buttonCtrl = (CGUIButtonControl*)GetControl(CONTROL_SEEK_BUTTON); + if (!m_buttonCtrl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeSeekBar::OnInitWindow - FAILED to get CGUIButtonControl (osds)"); + Close(); + return; + } + + m_arrowImageCtrl = (CGUIImage*)GetControl(CONTROL_SEEK_ARROW_IMAGE); + if (!m_arrowImageCtrl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeSeekBar::OnInitWindow - FAILED to get CGUIImage (osds)"); + Close(); + return; + } + + m_onUserMove = false; + m_totalTime = g_application.GetTotalTime(); + + if (m_totalTime < 3600) + { + m_labelTimeFormt = TIME_FORMAT_MM_SS; + } + else + { + m_labelTimeFormt = TIME_FORMAT_HH_MM_SS; + } + + m_currentTime = g_application.GetTime(); + m_seekTimeLabel = g_infoManager.GetCurrentPlayTime(m_labelTimeFormt); + m_seekHoldTime = 0; + m_lastSeekEvent = 0; + m_seekForward = true; + + float playbackPosX = (MAX_PROGRESS_POS_X) * m_currentTime / m_totalTime; + + if (!SetSeekControlPos(playbackPosX)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeSeekBar::OnInitWindow - FAILED to set SeekControlPos (osds)"); + Close(); + return; + } + + SET_CONTROL_VISIBLE(CONTROL_SEEK_BUTTON); + SET_CONTROL_VISIBLE(CONTROL_SEEK_ARROW_IMAGE); + SET_CONTROL_LABEL(CONTROL_SEEK_BUTTON,m_seekTimeLabel); + SET_CONTROL_FOCUS(CONTROL_SEEK_BUTTON, 0); +} + +bool CGUIDialogBoxeeSeekBar::OnAction(const CAction &action) +{ + switch (action.id) + { + case ACTION_PARENT_DIR: + case ACTION_PREVIOUS_MENU: + { + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeSeekBar::OnAction - ACTION_PARENT_DIR - ACTION_PREVIOUS_MENU (osds)"); + Close(); + return true; + } + case ACTION_MOVE_LEFT: + case ACTION_MOVE_RIGHT: + { + m_onUserMove = true; + if (m_autoClosing) SetAutoClose(3000); + m_seekHoldTime = action.holdTime; + ChangeSeek(action.id == ACTION_MOVE_LEFT); + g_infoManager.m_performingSeek = true; + g_application.SeekTime(m_currentTime); + m_lastSeekEvent = CTimeUtils::GetTimeMS(); + return true; + } + default: + break; + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeeSeekBar::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + //CLog::Log(LOGDEBUG,"CGUIDialogBoxeeSeekBar::OnMessage - GUI_MSG_CLICKED - seek to [seekPercentage=%f] (osds)",m_seekPercentage); + + //g_application.SeekPercentage(m_seekPercentage); + m_onUserMove = true; + Close(); + return true; + } + break; + } + + return CGUIDialog::OnMessage(message); +} + +void CGUIDialogBoxeeSeekBar::Render() +{ + if (!m_onUserMove && !g_infoManager.m_performingSeek) + { + m_seekTimeLabel = g_infoManager.GetCurrentPlayTime(m_labelTimeFormt); + m_currentTime = g_application.GetTime(); + } + else + { + StringUtils::SecondsToTimeString((int)m_currentTime, m_seekTimeLabel, m_labelTimeFormt); + } + + if (!SetSeekControlPos((MAX_PROGRESS_POS_X)*m_currentTime/m_totalTime)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeSeekBar::Render - FAILED to set SeekControlPos (osds)"); + Close(); + } + + SET_CONTROL_LABEL(CONTROL_SEEK_BUTTON,m_seekTimeLabel); + + if (m_lastSeekEvent && (CTimeUtils::GetTimeMS() - m_lastSeekEvent > 500)) + { + m_onUserMove = false; + m_lastSeekEvent = 0; + } + + CGUIDialog::Render(); +} + +bool CGUIDialogBoxeeSeekBar::SetSeekControlPos(float playbackPosX) +{ + if (!m_buttonCtrl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeSeekBar::SetSeekButtonPos - FAILED to get CGUIButtonControl (osds)"); + return false; + } + + float seekButtonWidth = m_buttonCtrl->GetWidth(); + float seekArrowWidth = m_arrowImageCtrl->GetWidth(); + + float seekButtonPosX = 0; + float seekArrowPosX = 0; + bool needToFindArrowPosX = true; + + if (playbackPosX < (seekButtonWidth/2)) + { + seekButtonPosX = 0; + } + else if (playbackPosX > (MAX_PROGRESS_POS_X - (seekButtonWidth/2))) + { + seekButtonPosX = (MAX_PROGRESS_POS_X - seekButtonWidth); + } + else + { + seekButtonPosX = (playbackPosX - (seekButtonWidth/2)); + seekArrowPosX = (playbackPosX - (seekArrowWidth/2)); + needToFindArrowPosX = false; + } + + float seekButtonPosY = m_buttonCtrl->GetYPosition(); + + m_buttonCtrl->SetPosition(seekButtonPosX,seekButtonPosY); + + if (!m_arrowImageCtrl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeSeekBar::SetSeekControlPos - FAILED to get CGUIImage (osds)"); + return false; + } + + if (needToFindArrowPosX) + { + if (seekButtonPosX <= MIN_PROGRESS_POS_X) + { + seekArrowPosX = ((playbackPosX - (seekArrowWidth/2)) > 0) ? (playbackPosX - (seekArrowWidth/2)) : 0 ; + } + else if (seekButtonPosX >= (MAX_PROGRESS_POS_X - seekButtonWidth)) + { + seekArrowPosX = ((playbackPosX - (seekArrowWidth/2)) < (MAX_PROGRESS_POS_X - (seekArrowWidth))) ? (playbackPosX - (seekArrowWidth/2)) : (MAX_PROGRESS_POS_X - (seekArrowWidth)) ; + } + } + + float seekArrowPosY = m_arrowImageCtrl->GetYPosition(); + m_arrowImageCtrl->SetPosition(seekArrowPosX,seekArrowPosY); + + return true; +} + +void CGUIDialogBoxeeSeekBar::ChangeSeek(bool back) +{ + unsigned int seekDelta = 0; + unsigned int seekSpeed = 0; + + if(back) + seekDelta = MIN_SEEK_OFFSET_BACKWARD; + else + seekDelta = MIN_SEEK_OFFSET_FARWARD; + + seekSpeed = seekDelta; + + if(m_seekHoldTime > 500) + { + float ratio; + ratio = (m_seekHoldTime / 3000.0); + if(ratio > 1.5) ratio = 1.5; + seekSpeed = (unsigned int) (m_totalTime * (ratio / 100)); + } + + if(seekSpeed < seekDelta) + seekSpeed = seekDelta; + + m_seekForward = !back; + + if(!back) + m_currentTime += seekSpeed; + else + m_currentTime -= seekSpeed; + + if(m_currentTime < 0) + m_currentTime = 0; + + if (m_currentTime > m_totalTime) + m_currentTime = m_totalTime; +} + diff --git a/xbmc/GUIDialogBoxeeSeekBar.h b/xbmc/GUIDialogBoxeeSeekBar.h new file mode 100644 index 00000000..c1263d81 --- /dev/null +++ b/xbmc/GUIDialogBoxeeSeekBar.h @@ -0,0 +1,40 @@ +#pragma once + +#include "GUIDialog.h" +#include "DateTime.h" + +class CGUIButtonControl; +class CGUIImage; + +class CGUIDialogBoxeeSeekBar : public CGUIDialog +{ +public: + + CGUIDialogBoxeeSeekBar(); + virtual ~CGUIDialogBoxeeSeekBar(void); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction &action); + + virtual void OnInitWindow(); + virtual void Render(); + +protected: + + void ChangeSeek(bool back); + + bool SetSeekControlPos(float playbackPosX); + double m_totalTime; + double m_currentTime; + unsigned int m_seekHoldTime; + long m_lastSeekEvent; + bool m_seekForward; + + CStdString m_seekTimeLabel; + bool m_onUserMove; + + TIME_FORMAT m_labelTimeFormt; + + CGUIButtonControl* m_buttonCtrl; + CGUIImage* m_arrowImageCtrl; +}; + diff --git a/xbmc/GUIDialogBoxeeSeekableCtx.cpp b/xbmc/GUIDialogBoxeeSeekableCtx.cpp new file mode 100644 index 00000000..cbe32870 --- /dev/null +++ b/xbmc/GUIDialogBoxeeSeekableCtx.cpp @@ -0,0 +1,292 @@ +#include "GUIDialogBoxeeSeekableCtx.h" +#include "GUIWindowManager.h" +#include "log.h" +#include "Application.h" +#include "utils/GUIInfoManager.h" +#include "GUIButtonControl.h" +#include "GUIImage.h" +#include "TimeUtils.h" + +#define MIN_SEEK_OFFSET_FARWARD 10 +#define MIN_SEEK_OFFSET_BACKWARD 5 +#define MIN_PROGRESS_POS_X 0 +#define MAX_PROGRESS_POS_X 1280 +#define START_PROGRESS_BUTTON_POS_X 132 +#define END_PROGRESS_BUTTON_POS_X (1148 - 104) + +CGUIDialogBoxeeSeekableCtx::CGUIDialogBoxeeSeekableCtx(DWORD dwID, const CStdString &xmlFile) : CGUIDialogBoxeeCtx(dwID, xmlFile) +{ + m_seekDirectionOnOpen = CSeekDirection::NONE; + m_showPlayTimeRemaining = false; + m_needToAdjustPlaybackPosX = false; +} + +CGUIDialogBoxeeSeekableCtx::~CGUIDialogBoxeeSeekableCtx() +{ + +} + +void CGUIDialogBoxeeSeekableCtx::OnInitWindow() +{ + CGUIDialogBoxeeCtx::OnInitWindow(); + + if (g_application.m_pPlayer && g_application.m_pPlayer->GetTotalTime() <= 0) + { + m_showPlayTimeRemaining = false; + } + + m_buttonCtrl = (CGUIButtonControl*)GetControl(CONTROL_SEEK_BUTTON); + if (!m_buttonCtrl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeSeekableCtx::OnInitWindow - FAILED to get CGUIButtonControl (osds)"); + Close(); + return; + } + + m_totalTime = g_application.GetTotalTime(); + + if (m_totalTime < 3600) + { + m_labelTimeFormt = TIME_FORMAT_MM_SS; + } + else + { + m_labelTimeFormt = TIME_FORMAT_HH_MM_SS; + } + + m_needToAdjustPlaybackPosX = false; + if ((MIN_PROGRESS_POS_X != START_PROGRESS_BUTTON_POS_X) || (MAX_PROGRESS_POS_X != END_PROGRESS_BUTTON_POS_X)) + { + m_needToAdjustPlaybackPosX = true; + } + + if (g_application.m_pPlayer->CanSeek()) + { + if (!g_application.m_pPlayer->CanSeekToTime()) + { + CLog::Log(LOGWARNING,"CGUIDialogBoxeeSeekableCtx::OnInitWindow - player can't seek. Close dialog (osds)"); + //SET_CONTROL_HIDDEN(CONTROL_SEEK_ARROW_IMAGE); + + float seekButtonPosX = (MAX_PROGRESS_POS_X/2) - (m_buttonCtrl->GetWidth()/2); + float seekButtonPosY = m_buttonCtrl->GetYPosition(); + m_buttonCtrl->SetPosition(seekButtonPosX,seekButtonPosY); + } + else + { + m_onUserMove = false; + m_currentTime = g_application.GetTime(); + m_seekTimeLabel = g_infoManager.GetCurrentPlayTime(m_labelTimeFormt); + m_seekHoldTime = 0; + m_lastSeekEvent = 0; + m_seekForward = true; + + float playbackPosX = (MAX_PROGRESS_POS_X) * m_currentTime / m_totalTime; + + if (!SetSeekControlPos(playbackPosX)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeSeekableCtx::OnInitWindow - FAILED to set SeekControlPos (osds)"); + Close(); + return; + } + + SET_CONTROL_VISIBLE(CONTROL_SEEK_BUTTON); + //SET_CONTROL_VISIBLE(CONTROL_SEEK_ARROW_IMAGE); + SET_CONTROL_FOCUS(CONTROL_SEEK_BUTTON, 0); + } + } +} + +bool CGUIDialogBoxeeSeekableCtx::OnAction(const CAction &action) +{ + switch (action.id) + { + case ACTION_MOVE_LEFT: + case ACTION_MOVE_RIGHT: + { + if (GetFocusedControlID() == CONTROL_SEEK_BUTTON) + { + if(m_currentTime != m_totalTime) + { + if (g_application.m_pPlayer->CanSeek()) + { + if (m_autoClosing) SetAutoClose(3000); + + if (!g_application.m_pPlayer->CanSeekToTime()) + { + g_application.m_pPlayer->Seek(action.id == ACTION_MOVE_RIGHT,false); + } + else + { + m_onUserMove = true; + m_seekHoldTime = action.holdTime; + ChangeSeek(action.id == ACTION_MOVE_LEFT); + g_infoManager.m_performingSeek = true; + g_application.SeekTime(m_currentTime); + m_lastSeekEvent = CTimeUtils::GetTimeMS(); + } + + return true; + } + } + } + } + break; + case ACTION_MOVE_DOWN: + { + if (GetFocusedControlID() == CONTROL_SEEK_BUTTON) + { + if (g_application.m_pPlayer && g_application.m_pPlayer->GetTotalTime() > 0) + { + m_showPlayTimeRemaining = !m_showPlayTimeRemaining; + g_settings.SetSkinString(g_settings.TranslateSkinString("showPlayTimeRemaining"),m_showPlayTimeRemaining ? "1" : "0"); + } + + return true; + } + } + break; + default: + { + // nothing to do + } + break; + } + + return CGUIDialogBoxeeCtx::OnAction(action); +} + +bool CGUIDialogBoxeeSeekableCtx::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + if (GetFocusedControlID() == CONTROL_SEEK_BUTTON) + { + g_application.m_pPlayer->Pause(); + return true; + } + } + break; + } + + return CGUIDialogBoxeeCtx::OnMessage(message); +} + +void CGUIDialogBoxeeSeekableCtx::Close(bool forceClose) +{ + m_seekDirectionOnOpen = CSeekDirection::NONE; + CGUIDialogBoxeeCtx::Close(forceClose); +} + +void CGUIDialogBoxeeSeekableCtx::Render() +{ + if (g_application.m_pPlayer->CanSeek()) + { + if (!g_application.m_pPlayer->CanSeekToTime()) + { + m_seekTimeLabel = m_showPlayTimeRemaining ? g_infoManager.GetCurrentPlayTimeRemaining(m_labelTimeFormt) : g_infoManager.GetCurrentPlayTime(m_labelTimeFormt); + //SET_CONTROL_LABEL(CONTROL_SEEK_BUTTON,m_seekTimeLabel); + } + else + { + if (!m_onUserMove && !g_infoManager.m_performingSeek) + { + m_seekTimeLabel = m_showPlayTimeRemaining ? g_infoManager.GetCurrentPlayTimeRemaining(m_labelTimeFormt) : g_infoManager.GetCurrentPlayTime(m_labelTimeFormt); + m_currentTime = g_application.GetTime(); + } + else + { + double timeToShow = m_showPlayTimeRemaining ? (g_application.GetTotalTime() - m_currentTime) : m_currentTime; + StringUtils::SecondsToTimeString((int)timeToShow, m_seekTimeLabel, m_labelTimeFormt); + } + + if (!SetSeekControlPos((MAX_PROGRESS_POS_X)*m_currentTime/m_totalTime)) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeSeekableCtx::Render - FAILED to set SeekControlPos (osds)"); + Close(); + } + + //SET_CONTROL_LABEL(CONTROL_SEEK_BUTTON,m_seekTimeLabel); + + if (m_lastSeekEvent && (CTimeUtils::GetTimeMS() - m_lastSeekEvent > 500)) + { + m_onUserMove = false; + m_lastSeekEvent = 0; + } + } + } + + CGUIDialogBoxeeCtx::Render(); +} + +bool CGUIDialogBoxeeSeekableCtx::SetSeekControlPos(float playbackPosX) +{ + if (!m_buttonCtrl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeSeekableCtx::SetSeekButtonPos - FAILED to get CGUIButtonControl (osds)"); + return false; + } + + if (m_needToAdjustPlaybackPosX) + { + adjustPlaybackPosX(playbackPosX); + } + + float seekButtonPosX = playbackPosX; + float seekButtonPosY = m_buttonCtrl->GetYPosition(); + + m_buttonCtrl->SetPosition(seekButtonPosX,seekButtonPosY); + + return true; +} + +void CGUIDialogBoxeeSeekableCtx::ChangeSeek(bool back) +{ + unsigned int seekDelta = 0; + unsigned int seekSpeed = 0; + + if (back) + seekDelta = MIN_SEEK_OFFSET_BACKWARD; + else + seekDelta = MIN_SEEK_OFFSET_FARWARD; + + seekSpeed = seekDelta; + + if (m_seekHoldTime > 500) + { + float ratio; + ratio = (m_seekHoldTime / 3000.0); + if (ratio > 1.5) + ratio = 1.5; + seekSpeed = (unsigned int) (m_totalTime * (ratio / 100)); + } + + if (seekSpeed < seekDelta) + seekSpeed = seekDelta; + + m_seekForward = !back; + + if (!back) + m_currentTime += seekSpeed; + else + m_currentTime -= seekSpeed; + + if (m_currentTime < 0) + m_currentTime = 0; + + if (m_currentTime > m_totalTime) + m_currentTime = m_totalTime; + +} + +void CGUIDialogBoxeeSeekableCtx::SetSeekDirectionOnOpen(CSeekDirection::SeekDirectionEnums seekDirection) +{ + m_seekDirectionOnOpen = seekDirection; +} + +void CGUIDialogBoxeeSeekableCtx::adjustPlaybackPosX(float& seekButtonPosX) +{ + seekButtonPosX = ((seekButtonPosX / MAX_PROGRESS_POS_X) * (END_PROGRESS_BUTTON_POS_X - START_PROGRESS_BUTTON_POS_X)) + START_PROGRESS_BUTTON_POS_X; +} + diff --git a/xbmc/GUIDialogBoxeeSeekableCtx.h b/xbmc/GUIDialogBoxeeSeekableCtx.h new file mode 100644 index 00000000..fdb442df --- /dev/null +++ b/xbmc/GUIDialogBoxeeSeekableCtx.h @@ -0,0 +1,67 @@ +#pragma once + +#include "GUIDialogBoxeeCtx.h" +#include "DateTime.h" + +#define CONTROL_SEEK_BUTTON 8100 +//#define CONTROL_SEEK_ARROW_IMAGE 8200 + +class CGUIButtonControl; +class CGUIImage; + +class CSeekDirection +{ +public: + enum SeekDirectionEnums + { + NONE=0, + BACKWARD=1, + FORWARD=2 + }; +}; + +class CGUIDialogBoxeeSeekableCtx : public CGUIDialogBoxeeCtx +{ +public: + + CGUIDialogBoxeeSeekableCtx(DWORD dwID, const CStdString &xmlFile); + virtual ~CGUIDialogBoxeeSeekableCtx(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction &action); + + virtual void Render(); + + virtual void Close(bool forceClose = false); + + virtual void SetSeekDirectionOnOpen(CSeekDirection::SeekDirectionEnums seekDirection); + +protected: + + virtual void OnInitWindow(); + + void ChangeSeek(bool back); + + bool SetSeekControlPos(float playbackPosX); + void adjustPlaybackPosX(float& seekButtonPosX); + + double m_totalTime; + double m_currentTime; + unsigned int m_seekHoldTime; + long m_lastSeekEvent; + bool m_seekForward; + + CStdString m_seekTimeLabel; + bool m_onUserMove; + + TIME_FORMAT m_labelTimeFormt; + + CGUIButtonControl* m_buttonCtrl; + //CGUIImage* m_arrowImageCtrl; + + CSeekDirection::SeekDirectionEnums m_seekDirectionOnOpen; + + bool m_showPlayTimeRemaining; + + bool m_needToAdjustPlaybackPosX; +}; + diff --git a/xbmc/GUIDialogBoxeeSelectionList.cpp b/xbmc/GUIDialogBoxeeSelectionList.cpp new file mode 100644 index 00000000..5870fafa --- /dev/null +++ b/xbmc/GUIDialogBoxeeSelectionList.cpp @@ -0,0 +1,103 @@ +/* + * CGUIDialogBoxeeSelectionList.cpp + * + */ +#include "GUIDialogBoxeeSelectionList.h" +#include "GUIRadioButtonControl.h" +#include "GUIListContainer.h" +#include "GUIWindowManager.h" +#include "GUIImage.h" +#include "utils/log.h" +#include "LocalizeStrings.h" + +#define CONTROL_LIST_ACTION_DIALOG 11 +#define DIALOG_TITLE 9001 + +CGUIDialogBoxeeSelectionList::CGUIDialogBoxeeSelectionList(void) : CGUIDialog(WINDOW_DIALOG_BOXEE_SELECTION_LIST, "boxee_selection_list.xml"), m_focusedItemPos (0) +{ + +} + +CGUIDialogBoxeeSelectionList::~CGUIDialogBoxeeSelectionList(void) +{ +} + +bool CGUIDialogBoxeeSelectionList::OnMessage(CGUIMessage &message) +{ + if (message.GetMessage() == GUI_MSG_CLICKED) + { + if (message.GetParam1() != ACTION_BUILT_IN_FUNCTION) + { + ProccessItemSelected(); + Close(); + return true; + } + } + + return CGUIDialog::OnMessage(message); +} + +void CGUIDialogBoxeeSelectionList::OnInitWindow() +{ + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeSelectionList::OnInitWindow - Enter function (cvq)"); + + SET_CONTROL_LABEL(DIALOG_TITLE, m_strDialogTitle.c_str()); + m_canceled = true; + CGUIDialog::OnInitWindow(); + LoadList(); +} + +void CGUIDialogBoxeeSelectionList::Close(bool forceClose) +{ + CGUIDialog::Close(forceClose); +} + +void CGUIDialogBoxeeSelectionList::Reset() +{ + m_vecList.Clear(); + m_focusedItemPos = 0; + m_strDialogTitle = ""; +} + +void CGUIDialogBoxeeSelectionList::LoadList() +{ + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeSelectionList::LoadList"); + + CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_LIST_ACTION_DIALOG); + OnMessage(msgReset); + + for (int i = 0 ; i < m_vecList.Size(); i++ ) + { + CFileItemPtr listNode (new CFileItem((*m_vecList[i]))); + listNode->SetLabel(listNode->GetProperty("link-title")); + + CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_LIST_ACTION_DIALOG, 0, 0, listNode); + OnMessage(msg); + } + + if (m_focusedItemPos < m_vecList.Size()) + { + SET_CONTROL_FOCUS(CONTROL_LIST_ACTION_DIALOG, m_focusedItemPos); + } + else + { + SET_CONTROL_FOCUS(CONTROL_LIST_ACTION_DIALOG,0); + } +} + +void CGUIDialogBoxeeSelectionList::ProccessItemSelected() +{ + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeSelectionList::ProccessItemSelected"); + + CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_LIST_ACTION_DIALOG); + OnMessage(msg); + + m_selectedItemPos = msg.GetParam1(); + m_canceled = false; +} + +int CGUIDialogBoxeeSelectionList::GetSelectedItemPos() +{ + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeSelectionList::GetItemSelected"); + return m_selectedItemPos; +} diff --git a/xbmc/GUIDialogBoxeeSelectionList.h b/xbmc/GUIDialogBoxeeSelectionList.h new file mode 100644 index 00000000..d3d08578 --- /dev/null +++ b/xbmc/GUIDialogBoxeeSelectionList.h @@ -0,0 +1,40 @@ +/* + * CGUIDialogBoxeeBoxeeSelectionList.h + * + * The purpose of this dialog is to be an abstraction for other dialogs for selecting items from a list + */ + +#ifndef CGUIDIALOGBOXEESELECTIONLST_H_ +#define CGUIDIALOGBOXEESELECTIONLST_H_ + +#include "GUIDialog.h" +#include "FileItem.h" + +class CGUIDialogBoxeeSelectionList : public CGUIDialog +{ +public: + CGUIDialogBoxeeSelectionList(void); + virtual ~CGUIDialogBoxeeSelectionList(void); + virtual bool OnMessage(CGUIMessage &message); + virtual void OnInitWindow(); + virtual void Close(bool forceClose = false); + + bool IsCanceled(void) { return m_canceled; } + void Reset(); + void Set(const CFileItemList& item) { m_vecList = item; } + void SetTitle (const CStdString& title) { m_strDialogTitle = title;} + void SetFocusedItem(int pos) {m_focusedItemPos = pos; } + void LoadList(); + void ProccessItemSelected(); + int GetSelectedItemPos(); + +protected: + bool m_canceled; + + int m_selectedItemPos; + int m_focusedItemPos; + CFileItemList m_vecList; + CStdString m_strDialogTitle; +}; + +#endif /* CGUIDIALOGBOXEESELECTIONLST_H_ */ diff --git a/xbmc/GUIDialogBoxeeSortDropdown.cpp b/xbmc/GUIDialogBoxeeSortDropdown.cpp new file mode 100644 index 00000000..7bf03d6e --- /dev/null +++ b/xbmc/GUIDialogBoxeeSortDropdown.cpp @@ -0,0 +1,217 @@ +/* + * GUIDialogBoxeeSortDropdown.cpp + * + * Created on: Nov 24, 2010 + * Author: shayyizhak + */ + +#include "GUIDialogBoxeeSortDropdown.h" +#include "GUIWindowManager.h" +#include "GUIBaseContainer.h" +#include "utils/log.h" +#include "GUIListContainer.h" +#include "GUIControlGroupList.h" +#include "GUIToggleButtonControl.h" +#include "GUILabelControl.h" + +#define ITEMS_LIST 600 +#define GROUP_LIST 500 + +#define TOGGLE_BUTTON_CONTROL 8020 +#define TOGGLE_BUTTON_POSX_OFFSET 0 +#define TOGGLE_BUTTON_POSY_OFFSET 0 + +#define BACKGROUND_IMAGE_CONTROL 8021 +#define BACKGROUND_IMAGE_POSX_OFFSET -158 +#define BACKGROUND_IMAGE_POSY_OFFSET 0 + +#define CONTROL_SORT_LABEL 9001 +#define LABEL_POSX_OFFSET -228 +#define LABEL_POSY_OFFSET 0 + +#define LIST_ITEM_HEIGHT 54 +#define LIST_HEIGHT_OFFSET 0 +#define LIST_POSX_OFFSET -240 +#define LIST_POSY_OFFSET -3 + +CGUIDialogBoxeeSortDropdown::CGUIDialogBoxeeSortDropdown() : CGUIDialog(WINDOW_DIALOG_BOXEE_SORT_DROPDOWN, "boxee_sort_dropdown.xml") +{ + m_bConfirmed = true; +} + + +CGUIDialogBoxeeSortDropdown::~CGUIDialogBoxeeSortDropdown() +{ + +} + +void CGUIDialogBoxeeSortDropdown::OnInitWindow() +{ + if (!LoadItems()) + { + Close(); + return; + } + + CGUIDialog::OnInitWindow(); + + m_bConfirmed = true; + + SET_CONTROL_FOCUS(ITEMS_LIST,m_selectedSort); +} + +bool CGUIDialogBoxeeSortDropdown::OnAction(const CAction& action) +{ + if (action.id == ACTION_PREVIOUS_MENU || action.id == ACTION_PARENT_DIR) + { + m_bConfirmed = false; + Close(); + return true; + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeeSortDropdown::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_CLICKED: + { + return OnClick(message); + } + } //switch + + return CGUIDialog::OnMessage(message); +} + +bool CGUIDialogBoxeeSortDropdown::OnClick(CGUIMessage& message) +{ + int iControl = message.GetSenderId(); + switch(iControl) + { + case ITEMS_LIST: + { + CGUIBaseContainer* subMenuList = (CGUIBaseContainer*)GetControl(ITEMS_LIST); + GetClickedLabel(subMenuList); + } + break; + } // switch + + Close(); + + return true; +} + +bool CGUIDialogBoxeeSortDropdown::Show(CFileItemList& items, CStdString& value, float posX, float posY) +{ + CGUIDialogBoxeeSortDropdown* dialog = (CGUIDialogBoxeeSortDropdown *)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_SORT_DROPDOWN); + + if (!dialog) + { + return false; + } + + dialog->m_selectedSort = items.GetPropertyInt("selectedSort"); + + dialog->m_items.Clear(); + dialog->m_items.Append(items); + dialog->m_value = value; + + dialog->AllocResources(); + + dialog->SetControlPos((CGUIControl*)dialog->GetControl(GROUP_LIST),(posX + LIST_POSX_OFFSET),(posY + LIST_POSY_OFFSET)); + dialog->SetControlPos((CGUIControl*)dialog->GetControl(TOGGLE_BUTTON_CONTROL),(posX + TOGGLE_BUTTON_POSX_OFFSET),(posY + TOGGLE_BUTTON_POSY_OFFSET)); + dialog->SetControlPos((CGUIControl*)dialog->GetControl(CONTROL_SORT_LABEL),(posX + LABEL_POSX_OFFSET),(posY + LABEL_POSY_OFFSET)); + dialog->SetControlPos((CGUIControl*)dialog->GetControl(BACKGROUND_IMAGE_CONTROL),(posX + BACKGROUND_IMAGE_POSX_OFFSET),(posY + BACKGROUND_IMAGE_POSY_OFFSET)); + + dialog->DoModal(); + + value = dialog->m_value; + + return dialog->m_bConfirmed; +} + + +bool CGUIDialogBoxeeSortDropdown::Show(CFileItemList& items, CStdString& value) +{ + CGUIDialogBoxeeSortDropdown *dialog = (CGUIDialogBoxeeSortDropdown *)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_SORT_DROPDOWN); + + if (!dialog) + { + return false; + } + + dialog->m_items.Clear(); + dialog->m_items.Append(items); + dialog->m_value = value; + + dialog->DoModal(); + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeSortDropdown::Show, set genre = %s (browse)", dialog->m_value.c_str()); + value = dialog->m_value; + + return dialog->m_bConfirmed; +} + +bool CGUIDialogBoxeeSortDropdown::LoadItems() +{ + bool succeeded = false; + + CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), ITEMS_LIST, 0); + OnMessage(msg); + + for (int i=0; i< m_items.Size(); i++) + { + CFileItemPtr item = m_items.Get(i); + CGUIMessage winmsg(GUI_MSG_LABEL_ADD, GetID(), ITEMS_LIST, 0, 0, m_items.Get(i)); + OnMessage(winmsg); + } + + CGUIListContainer* pList = (CGUIListContainer*)GetControl(ITEMS_LIST); + float listHeight = (pList->GetNumItems() * LIST_ITEM_HEIGHT) + LIST_HEIGHT_OFFSET; + if (pList) + { + pList->SetHeight(listHeight); + AllocResources(); + succeeded = true; + } + else + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeSortDropdown::LoadItems - FAILED to get ListContainer for [%d]",ITEMS_LIST); + } + + return succeeded; +} + +bool CGUIDialogBoxeeSortDropdown::GetClickedLabel(CGUIBaseContainer* subMenuList) +{ + if (!subMenuList) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeSortDropdown::GetClickedLabel - Enter function with a NULL CGUIBaseContainer object"); + return false; + } + + CGUIListItemPtr selectedListItem = subMenuList->GetSelectedItemPtr(); + if (selectedListItem.get()) + { + m_value = selectedListItem->GetProperty("value"); + } + + return true; +} + +bool CGUIDialogBoxeeSortDropdown::SetControlPos(CGUIControl* pControl, float posX, float posY) +{ + if (!pControl) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeSortDropdown::SetControlPos - enter function with NULL control (sdd)"); + return false; + } + + pControl->SetPosition(posX,posY); + pControl->AllocResources(); + + return true; +} + diff --git a/xbmc/GUIDialogBoxeeSortDropdown.h b/xbmc/GUIDialogBoxeeSortDropdown.h new file mode 100644 index 00000000..378ed2c0 --- /dev/null +++ b/xbmc/GUIDialogBoxeeSortDropdown.h @@ -0,0 +1,46 @@ +/* + * GUIDialogBoxeeSortDropdown.h + * + * Created on: Nov 24, 2010 + * Author: shayyizhak + */ + +#ifndef GUIDIALOGBOXEESORTDROPDOWN_H_ +#define GUIDIALOGBOXEESORTDROPDOWN_H_ + +#include "GUIDialog.h" +#include "FileItem.h" +#include "GUIDialogBoxeeDropdown.h" + +class CGUIDialogBoxeeSortDropdown : public CGUIDialog +{ +public: + CGUIDialogBoxeeSortDropdown(); + virtual ~CGUIDialogBoxeeSortDropdown(); + + static bool Show(CFileItemList& items, CStdString& value, float posX, float posY); + static bool Show(CFileItemList& items, CStdString& value); + + virtual void OnInitWindow(); + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction& action); + +private: + + bool OnClick(CGUIMessage& message); + bool GetClickedLabel(CGUIBaseContainer* subMenuList); + + bool SetControlPos(CGUIControl* pControl,float posX,float posY); + + CFileItemList m_items; + bool m_bConfirmed; + CStdString m_value; + int m_type; + bool LoadItems(); + int m_selectedSort; + + ICustomDropdownLabelCallback* m_getDropdownLabelCallback; +}; + + +#endif /* GUIDIALOGBOXEESORTDROPDOWN_H_ */ diff --git a/xbmc/GUIDialogBoxeeTechInfo.cpp b/xbmc/GUIDialogBoxeeTechInfo.cpp new file mode 100644 index 00000000..2f17aa48 --- /dev/null +++ b/xbmc/GUIDialogBoxeeTechInfo.cpp @@ -0,0 +1,390 @@ +/* + * GUIDialogBoxeeVideoInfo.cpp + * + * Created on: Jan 17, 2011 + * Author: shayyizhak + */ + +#include "GUIDialogBoxeeTechInfo.h" +#include "GUIWindowManager.h" +#include "GUIBaseContainer.h" +#include "utils/log.h" +#include "GUIControlGroupList.h" +#include "GUIToggleButtonControl.h" +#include "GUIListContainer.h" +#include "Application.h" +#include "GUIInfoManager.h" +#include "CPUInfo.h" +#include "VideoReferenceClock.h" +#include "utils/TimeUtils.h" +#include "LocalizeStrings.h" +#ifdef HAS_VIDEO_PLAYBACK +#include "cores/VideoRenderers/RenderManager.h" +#endif +#ifdef HAS_INTEL_SMD +#include "cores/IntelSMDGlobals.h" +#endif + +#define ITEMS_LIST 600 +#define GROUP_LIST 500 +#define TOGGLE_BUTTON_CONTROL 8020 +#define BOTTOM_IMAGE_CONTROL 8021 +#define LIST_ITEM_HEIGHT 54 +#define LIST_POSY_OFFSET -8 +#define LIST_POSX_OFFSET -196 +#define TOGGLE_BUTTON_POSY_OFFSET 0 +#define TOGGLE_BUTTON_POSX_OFFSET 0 +#define LIST_HEIGHT_OFFSET 0 +#define LABEL1 9101 +#define LABEL2 9102 +#define LABEL3 9103 + + + +CGUIDialogBoxeeTechInfo::CGUIDialogBoxeeTechInfo() +: CGUIDialog(WINDOW_DIALOG_TECH_INFO, "boxee_tech_info.xml") +{ +} + + +CGUIDialogBoxeeTechInfo::~CGUIDialogBoxeeTechInfo() +{ +} + +void CGUIDialogBoxeeTechInfo::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); +} + +bool CGUIDialogBoxeeTechInfo::OnAction(const CAction& action) +{ + if (action.id == ACTION_PREVIOUS_MENU || action.id == ACTION_PARENT_DIR) + { + Close(); + return true; + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeeTechInfo::OnMessage(CGUIMessage& message) +{ + return CGUIDialog::OnMessage(message); +} + +void CGUIDialogBoxeeTechInfo::Show() +{ + CGUIDialogBoxeeTechInfo *dialog = (CGUIDialogBoxeeTechInfo *)g_windowManager.GetWindow(WINDOW_DIALOG_TECH_INFO); + + if (dialog) + { + dialog->DoModal(); + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeTechInfo::Show"); + } +} + + +void CGUIDialogBoxeeTechInfo::Render() +{ + if (!LoadItems()) + { + Close(); + return; + } + CGUIDialog::Render(); + +} + +bool CGUIDialogBoxeeTechInfo::LoadItems() +{ + if (g_application.GetPlaySpeed() != 1) + g_infoManager.SetDisplayAfterSeek(); + //if (m_bShowCurrentTime) + // g_infoManager.SetDisplayAfterSeek(); + + //m_bLastRender = true; + if (!g_application.m_pPlayer) return false; + + /* + if( g_application.m_pPlayer->IsCaching() ) + { + g_infoManager.SetDisplayAfterSeek(0); //Make sure these stuff aren't visible now + SET_CONTROL_VISIBLE(LABEL_BUFFERING); + } + else + { + SET_CONTROL_HIDDEN(LABEL_BUFFERING); + } + */ + + // show audio codec info + CStdString strAudio, strVideo, strGeneral; + g_application.m_pPlayer->GetAudioInfo(strAudio); + strAudio = FormatAudioInfo(strAudio); + { + CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL1); + msg.SetLabel(strAudio); + OnMessage(msg); + } + // show video codec info + g_application.m_pPlayer->GetVideoInfo(strVideo); + strVideo = FormatVideoInfo(strVideo); + { + CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL2); + msg.SetLabel(strVideo); + OnMessage(msg); + } + // show general info + g_application.m_pPlayer->GetGeneralInfo(strGeneral); + { + CStdString strGeneralFPS; +/* +#ifdef __APPLE__ + // We show CPU usage for the entire process, as it's arguably more useful. + double dCPU = m_resourceCounter.GetCPUUsage(); + CStdString strCores; + strCores.Format("cpu: %.0f%%", dCPU); +#else +*/ + CStdString strCores = g_cpuInfo.GetCoresUsageString(); +//#endif + int missedvblanks; + int refreshrate; + double clockspeed; + CStdString strClock; + + if (g_VideoReferenceClock.GetClockInfo(missedvblanks, clockspeed, refreshrate)) + strClock.Format("S( refresh:%i missed:%i speed:%+.3f%% %s )" + , refreshrate + , missedvblanks + , clockspeed - 100.0 + , g_renderManager.GetVSyncState().c_str()); + + strGeneralFPS.Format("%s\nW( fps:%02.2f %s ) %s" + , strGeneral.c_str() + , g_infoManager.GetFPS() + , strCores.c_str(), strClock.c_str() ); +#ifdef HAS_INTEL_SMD + unsigned int videoCur, videoMax, audioCur, audioMax; + videoCur = videoMax = audioCur = audioMax = 0; + + ismd_port_handle_t audio_input; + audio_input = g_IntelSMDGlobals.GetAudioDevicePort(g_IntelSMDGlobals.GetPrimaryAudioDevice()); + + g_IntelSMDGlobals.GetPortStatus(g_IntelSMDGlobals.GetVidDecInput(), videoCur, videoMax); + g_IntelSMDGlobals.GetPortStatus(audio_input, audioCur, audioMax); + + strGeneralFPS.Format("%s\nW( DVDPlayer: %.2f SMD Audio: %.2f %d/%d SMD Video %.2f %d/%d %s ) %s" + , strGeneral.c_str() + , (float)(g_application.m_pPlayer->GetTime() / 1000.0) + , g_IntelSMDGlobals.IsmdToDvdPts(g_IntelSMDGlobals.GetAudioCurrentTime())/1000000 + , audioCur, audioMax + , g_IntelSMDGlobals.IsmdToDvdPts(g_IntelSMDGlobals.GetVideoCurrentTime())/1000000 + , videoCur, videoMax + , strCores.c_str() + , strClock.c_str() ); +#endif + + strGeneralFPS = FormatGeneralInfo(strGeneralFPS); + CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL3); + msg.SetLabel(strGeneralFPS); + OnMessage(msg); + } + //---------------------- + // ViewMode Information + //---------------------- + /* + if (m_bShowViewModeInfo && CTimeUtils::GetTimeMS() - m_dwShowViewModeTimeout > 2500) + { + m_bShowViewModeInfo = false; + } + if (m_bShowViewModeInfo) + { + { + // get the "View Mode" string + CStdString strTitle = g_localizeStrings.Get(629); + CStdString strMode = g_localizeStrings.Get(630 + g_stSettings.m_currentVideoSettings.m_ViewMode); + CStdString strInfo; + strInfo.Format("%s : %s", strTitle.c_str(), strMode.c_str()); + CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL1); + msg.SetLabel(strInfo); + OnMessage(msg); + } + // show sizing information + CRect SrcRect, DestRect; + float fAR; + g_application.m_pPlayer->GetVideoRect(SrcRect, DestRect); + g_application.m_pPlayer->GetVideoAspectRatio(fAR); + { + CStdString strSizing; + strSizing.Format("Sizing: (%i,%i)->(%i,%i) (Zoom x%2.2f) AR:%2.2f:1 (Pixels: %2.2f:1)", + (int)SrcRect.Width(), (int)SrcRect.Height(), + (int)DestRect.Width(), (int)DestRect.Height(), g_stSettings.m_fZoomAmount, fAR*g_stSettings.m_fPixelRatio, g_stSettings.m_fPixelRatio); + CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL2); + msg.SetLabel(strSizing); + OnMessage(msg); + } + // show resolution information + int iResolution = g_graphicsContext.GetVideoResolution(); + { + CStdString strStatus; + strStatus.Format("%s %ix%i@%.2fHz %s", + g_localizeStrings.Get(13287), g_settings.m_ResInfo[iResolution].iWidth, + g_settings.m_ResInfo[iResolution].iHeight, g_settings.m_ResInfo[iResolution].fRefreshRate, + g_settings.m_ResInfo[iResolution].strMode.c_str()); + CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL3); + msg.SetLabel(strStatus); + OnMessage(msg); + } + } + + // TTF subs should render 1:1 + TransformMatrix m; + g_graphicsContext.PushTransform(m, true); + //RenderTTFSubtitles(); + g_graphicsContext.PopTransform(); + + g_graphicsContext.ApplyGuiTransform(); + + if (m_timeCodeShow && m_timeCodePosition != 0) + { + if ( (CTimeUtils::GetTimeMS() - m_timeCodeTimeout) >= 2500) + { + m_timeCodeShow = false; + m_timeCodePosition = 0; + } + CStdString strDispTime = "hh:mm"; + + CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL1); + for (int count = 0; count < m_timeCodePosition; count++) + { + if (m_timeCodeStamp[count] == -1) + strDispTime[count] = ':'; + else + strDispTime[count] = (char)m_timeCodeStamp[count] + 48; + } + strDispTime += "/" + g_infoManager.GetLabel(PLAYER_DURATION) + " [" + g_infoManager.GetLabel(PLAYER_TIME) + "]"; // duration [ time ] + msg.SetLabel(strDispTime); + OnMessage(msg); + } + */ + + //CGUIWindow::Render(); + + g_graphicsContext.RestoreGuiTransform(); + + return true; +} + +CStdString CGUIDialogBoxeeTechInfo::FormatAudioInfo (CStdString strAudio) +{ + size_t pos; + pos = strAudio.find("(") + 2; + strAudio = strAudio.substr (pos); + pos = strAudio.find(")"); + strAudio = strAudio.substr (0, pos) + strAudio.substr (pos+1); + pos = strAudio.find("P(") + 3; + strAudio = strAudio.substr (0, pos-3) + strAudio.substr (pos); + pos = strAudio.find(")"); + strAudio = strAudio.substr (0, pos); + + // Remove "audio" tag" + pos = strAudio.find(":") + 2; + strAudio = strAudio.substr (pos); + + // Replace \n with "," + pos = strAudio.find("\n"); + strAudio = strAudio.substr(0, pos-1) + ", " + strAudio.substr(pos+2); + + // Remove 4th tag + strAudio = removeNItem(4, strAudio); + + // Remove 5th tag + strAudio = removeNItem(4, strAudio); + + // Remove 6th tag + strAudio = removeNItem(4, strAudio); + + return strAudio; +} + +CStdString CGUIDialogBoxeeTechInfo::FormatVideoInfo (CStdString strVideo) +{ + size_t pos; + pos = strVideo.find("(") + 2; + strVideo = strVideo.substr (pos); + pos = strVideo.find(")"); + strVideo = strVideo.substr (0, pos) + strVideo.substr (pos+1); + pos = strVideo.find("P(") + 3; + strVideo = strVideo.substr (0, pos-3) + strVideo.substr (pos); + pos = strVideo.find(")"); + strVideo = strVideo.substr (0, pos); + + // Remove "video" tag" + pos = strVideo.find(":") + 2; + strVideo = strVideo.substr (pos); + + // Replace \n with ",\n" + pos = strVideo.find("\n"); + strVideo = strVideo.substr(0, pos-1) + ",\n" + strVideo.substr(pos+2); + + // Remove 1st tag + strVideo = removeNItem(1, strVideo); + + // strVideo 2nd tag + strVideo = removeNItem(1, strVideo); + + // Remove 4th tag + strVideo = removeNItem(2, strVideo); + + return strVideo; +} + +CStdString CGUIDialogBoxeeTechInfo::FormatGeneralInfo (CStdString strGeneral) +{ + size_t pos; + pos = strGeneral.find("(") + 2; + strGeneral = strGeneral.substr (pos); + pos = strGeneral.find(")"); + strGeneral = strGeneral.substr (0, pos) + strGeneral.substr (pos+1); + pos = strGeneral.find("W(") + 3; + strGeneral = strGeneral.substr (0, pos-3) + strGeneral.substr (pos); + pos = strGeneral.find(")"); + strGeneral = strGeneral.substr (0, pos); + + // Remove "aq" tag" + pos = strGeneral.find(":") + 2; + strGeneral = strGeneral.substr (pos); + + // Replace \n with ",\n" + pos = strGeneral.find("\n"); + strGeneral = strGeneral.substr(0, pos-1) + ",\n" + strGeneral.substr(pos+2); + + // Remove 1st tag + strGeneral = removeNItem(1, strGeneral); + + // strVideo 3nd tag + strGeneral = removeNItem(2, strGeneral); + + return strGeneral; +} + +CStdString CGUIDialogBoxeeTechInfo::removeNItem(int n, CStdString str) +{ + size_t pos; + CStdString tempStr; + for (int i=1; i= (int)m_choices.size())) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeVideoResume::OnMessage - GUI_MSG_CLICKED - Index of item clicked is [%d] while [NumOfChoices=%d] (resume)",m_choiceIndex,(int)m_choices.size()); + m_choiceIndex = -1; + Close(); + return false; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeVideoResume::OnMessage - GUI_MSG_CLICKED - set [choiceIndex=%d]. [NumOfChoices=%d] (resume)",m_choiceIndex,(int)m_choices.size()); + + Close(); + return true; + } + } + + return CGUIDialog::OnMessage(message); +} + +void CGUIDialogBoxeeVideoResume::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + m_choiceIndex = -1; + + if ((int)m_choices.size() < 1) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeVideoResume::OnInitWindow - There are no label to add. [NumOfChoices=%d] (resume)",(int)m_choices.size()); + Close(); + return; + } + + CLog::Log(LOGDEBUG,"CGUIDialogBoxeeVideoResume::OnInitWindow - going to add [NumOfChoices=%d] (resume)",(int)m_choices.size()); + + for (int i=0; i<(int)m_choices.size(); i++) + { + CFileItemPtr choice(new CFileItem(m_choices[i])); + CGUIMessage winmsg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_LIST, 0, 0, choice); + OnMessage(winmsg); + } + + SET_CONTROL_FOCUS(CONTROL_LIST, 0); +} + +int CGUIDialogBoxeeVideoResume::ShowAndGetInput(const std::vector& choices) +{ + CGUIDialogBoxeeVideoResume *dialog = (CGUIDialogBoxeeVideoResume*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_VIDEO_RESUME); + if (!dialog) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeVideoResume::ShowAndGetInput - FAILED to get WINDOW_DIALOG_BOXEE_VIDEO_RESUME (resume)"); + return false; + } + + dialog->m_choices = choices; + + dialog->DoModal(); + + return dialog->m_choiceIndex; +} diff --git a/xbmc/GUIDialogBoxeeVideoResume.h b/xbmc/GUIDialogBoxeeVideoResume.h new file mode 100644 index 00000000..4e55e2a3 --- /dev/null +++ b/xbmc/GUIDialogBoxeeVideoResume.h @@ -0,0 +1,30 @@ +/* + * CGUIDialogBoxeeVideoResume.h + * + * The purpose of this dialog is to present a notification that a Boxee update is available + */ + +#ifndef CGUIDIALOGBOXEEVIDERESUME_H_ +#define CGUIDIALOGBOXEEVIDERESUME_H_ + +#include "GUIDialog.h" + +class CGUIDialogBoxeeVideoResume : public CGUIDialog +{ +public: + CGUIDialogBoxeeVideoResume(); + virtual ~CGUIDialogBoxeeVideoResume(); + virtual bool OnAction(const CAction& action); + virtual bool OnMessage(CGUIMessage &message); + virtual void OnInitWindow(); + + static int ShowAndGetInput(const std::vector& choices); + +protected: + + int m_choiceIndex; + + std::vector m_choices; +}; + +#endif /* CGUIDIALOGBOXEEVIDERESUME_H_ */ diff --git a/xbmc/GUIDialogBoxeeWatchLaterGetStarted.cpp b/xbmc/GUIDialogBoxeeWatchLaterGetStarted.cpp new file mode 100644 index 00000000..67a908eb --- /dev/null +++ b/xbmc/GUIDialogBoxeeWatchLaterGetStarted.cpp @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "GUIDialogBoxeeWatchLaterGetStarted.h" +#include "FileSystem/BoxeeServerDirectory.h" +#include "lib/libBoxee/bxconfiguration.h" +#include "utils/log.h" +#include "LocalizeStrings.h" +#include "GUIDialogOK2.h" +#include "bxutils.h" +#include "Application.h" + +using namespace std; +using namespace BOXEE; + +#define BTN_GET_STARTED 7092 +#define BTN_OFFLINE_DONE 7192 + +CGUIDialogBoxeeWatchLaterGetStarted::CGUIDialogBoxeeWatchLaterGetStarted(void) + : CGUIDialog(WINDOW_DIALOG_BOXEE_GET_STARTED,"boxee_watch_later_get_started.xml") +{ +} + +CGUIDialogBoxeeWatchLaterGetStarted::~CGUIDialogBoxeeWatchLaterGetStarted(void) +{ +} + +void CGUIDialogBoxeeWatchLaterGetStarted::OnInitWindow() +{ + CGUIDialog::OnInitWindow(); + + if (g_application.IsConnectedToInternet()) + { + SET_CONTROL_FOCUS(BTN_GET_STARTED, 0); + } + else + { + SET_CONTROL_FOCUS(BTN_OFFLINE_DONE, 0); + } + + m_bIsConfirmed = false; +} + +bool CGUIDialogBoxeeWatchLaterGetStarted::OnAction(const CAction &action) +{ + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeeWatchLaterGetStarted::OnMessage(CGUIMessage& message) +{ + int controlId = message.GetSenderId(); + + if (message.GetMessage() == GUI_MSG_CLICKED) + { + if (controlId == BTN_GET_STARTED) + { + if (!HandleClickOnGetStartedButton()) + { + // ERROR log will be written from HandleClickOnGetStartedButton() + } + m_bIsConfirmed = true; + Close(); + return true; + } + + if (controlId == BTN_OFFLINE_DONE && !g_application.IsConnectedToInternet()) + { + m_bIsConfirmed = true; + Close(); + return true; + } + } + + return CGUIDialog::OnMessage(message); +} + +bool CGUIDialogBoxeeWatchLaterGetStarted::HandleClickOnGetStartedButton() +{ + CStdString strUrl = BXConfiguration::GetInstance().GetURLParam("Boxee.WatchLater.GetStarted","https://app.boxee.tv/accountapi/tellmeabout/?about=watchlater"); + + Json::Value jResponse; + int retCode; + + /* + //////////////////////////// + // erez - FOR TESTING !!! // + { + CStdString strJson = "{\"success\":\"false\",\"message\":\"bla bla bla\"}"; + + Json::Reader reader; + + if (!reader.parse(strJson, jResponse)) + { + printf("OnCreateUserThruFacebook - FAILED to parse json"); + return false; + } + + Json::Value::Members keys = jResponse.getMemberNames(); + for (size_t i = 0; i < keys.size(); i++) + { + printf("[%zu/%zu] - [%s=%s]\n",i+1,keys.size(),keys[i].c_str(),jResponse.get(keys[i],"WTF").asString().c_str()); + } + } + //////////////////////////// + */ + + Job_Result result = BOXEE::BXUtils::PerformJSONGetRequestInBG(strUrl,jResponse,retCode); + + if (result != JOB_SUCCEEDED) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeWatchLaterGetStarted::HandleClickOnGetStartedButton - call to server returned FAILED. [result=%d][retCode=%d] (queue)(browse)",result,retCode); + return false; + } + + CStdString successStr = ""; + if (!jResponse.isMember("success")) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeWatchLaterGetStarted::HandleClickOnGetStartedButton - FAILED to get parameter from jResponse (queue)(browse)"); + return false; + } + else + { + successStr = jResponse["success"].asString(); + } + + CStdString messageStr = ""; + if (!jResponse.isMember("message")) + { + CLog::Log(LOGERROR,"CGUIDialogBoxeeWatchLaterGetStarted::HandleClickOnGetStartedButton - FAILED to get parameter from jResponse (queue)(browse)"); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(257),g_localizeStrings.Get(81000)); + return false; + } + else + { + messageStr = jResponse["message"].asString(); + } + + successStr.ToLower(); + if (successStr == "true") + { + CStdString messageStruct = g_localizeStrings.Get(56048); + CStdString messageDesc = ""; + messageDesc.Format(messageStruct.c_str(), messageStr); + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(56047),messageDesc); + return true; + } + else + { + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(257),g_localizeStrings.Get(81000)); + return false; + } +} diff --git a/xbmc/GUIDialogBoxeeWatchLaterGetStarted.h b/xbmc/GUIDialogBoxeeWatchLaterGetStarted.h new file mode 100644 index 00000000..a017cff6 --- /dev/null +++ b/xbmc/GUIDialogBoxeeWatchLaterGetStarted.h @@ -0,0 +1,42 @@ +#pragma once + +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "GUIDialog.h" + + +class CGUIDialogBoxeeWatchLaterGetStarted : +public CGUIDialog +{ +public: + CGUIDialogBoxeeWatchLaterGetStarted(void); + virtual ~CGUIDialogBoxeeWatchLaterGetStarted(void); + virtual void OnInitWindow(); + + virtual bool OnMessage(CGUIMessage& message); + virtual bool OnAction(const CAction &action); + + bool m_bIsConfirmed; + +private: + bool HandleClickOnGetStartedButton(); +}; diff --git a/xbmc/GUIDialogBoxeeWizardBase.cpp b/xbmc/GUIDialogBoxeeWizardBase.cpp new file mode 100644 index 00000000..1d532b44 --- /dev/null +++ b/xbmc/GUIDialogBoxeeWizardBase.cpp @@ -0,0 +1,83 @@ +#include "GUIDialogBoxeeWizardBase.h" +#include "log.h" + +CGUIDialogBoxeeWizardBase::CGUIDialogBoxeeWizardBase(int id, const CStdString& xmlFile, const CStdString& name) : CGUIDialog(id, xmlFile) +{ + m_name = name; +} + +CGUIDialogBoxeeWizardBase::~CGUIDialogBoxeeWizardBase() +{ + +} + +bool CGUIDialogBoxeeWizardBase::OnAction(const CAction &action) +{ + if (action.id == ACTION_PREVIOUS_MENU || action.id == ACTION_PARENT_DIR) + { + m_actionChoseEnum = CActionChoose::BACK; + Close(); + return true; + } + else if (action.id == ACTION_BUILT_IN_FUNCTION) + { + // don't allow during FTU + CLog::Log(LOGDEBUG,"%s::OnAction - ACTION_BUILT_IN_FUNCTION is not allow (digwiz)",m_name.c_str()); + return true; + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogBoxeeWizardBase::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int senderId = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"%s::OnMessage - GUI_MSG_CLICKED - [buttonId=%d] (digwiz)",m_name.c_str(),senderId); + + switch (senderId) + { + case DIALOG_WIZARD_BUTTON_NEXT: + { + if (HandleClickNext()) + { + m_actionChoseEnum = CActionChoose::NEXT; + Close(); + } + + return true; + } + break; + case DIALOG_WIZARD_BUTTON_BACK: + { + if (HandleClickBack()) + { + m_actionChoseEnum = CActionChoose::BACK; + Close(); + } + + return true; + } + break; + } + } + break; + } + + return CGUIDialog::OnMessage(message); +} + +CActionChoose::ActionChooseEnums CGUIDialogBoxeeWizardBase::GetActionChose() +{ + return m_actionChoseEnum; +} + +void CGUIDialogBoxeeWizardBase::SetActionChose(CActionChoose::ActionChooseEnums actionChoseEnum) +{ + m_actionChoseEnum = actionChoseEnum; +} + diff --git a/xbmc/GUIDialogBoxeeWizardBase.h b/xbmc/GUIDialogBoxeeWizardBase.h new file mode 100644 index 00000000..fd1dac34 --- /dev/null +++ b/xbmc/GUIDialogBoxeeWizardBase.h @@ -0,0 +1,41 @@ +#ifndef GUIDIALOGBOXEEWIZARDBASE_H_ +#define GUIDIALOGBOXEEWIZARDBASE_H_ + +#include "GUIDialog.h" + +#define DIALOG_WIZARD_BUTTON_NEXT 1 +#define DIALOG_WIZARD_BUTTON_BACK 2 + +class CActionChoose +{ +public: + enum ActionChooseEnums + { + ACTION_ERROR=0, + NEXT=1, + BACK=2, + NUM_OF_NEXT_ACTIONS=3 + }; +}; + +class CGUIDialogBoxeeWizardBase : public CGUIDialog +{ +public: + CGUIDialogBoxeeWizardBase(int id, const CStdString& xmlFile, const CStdString& derivedClassStr); + virtual ~CGUIDialogBoxeeWizardBase(); + + virtual bool OnAction(const CAction &action); + virtual bool OnMessage(CGUIMessage &message); + + virtual CActionChoose::ActionChooseEnums GetActionChose(); + virtual void SetActionChose(CActionChoose::ActionChooseEnums actionChoseEnum); + +protected: + virtual bool HandleClickNext() { return true; } + virtual bool HandleClickBack() { return true; } + + CActionChoose::ActionChooseEnums m_actionChoseEnum; + CStdString m_name; +}; + +#endif // GUIDIALOGBOXEEWIZARDBASE_H_ diff --git a/xbmc/GUIDialogFirstTimeUseAudio.cpp b/xbmc/GUIDialogFirstTimeUseAudio.cpp new file mode 100644 index 00000000..204d667b --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseAudio.cpp @@ -0,0 +1,236 @@ +#include "GUIDialogFirstTimeUseAudio.h" + +#ifdef HAS_EMBEDDED + +#include "GUIWindowManager.h" +#include "GUIDialogOK2.h" +#include "GUIDialogYesNo2.h" +#include "log.h" + +#define HAS_HDMI 261 +#define HAS_OPTICAL 262 +#define HAS_ANALOG_STEREO 263 +#define HAS_DDD 271 +#define NO_DDD 272 +#define DONT_KNOW_DDD 273 + +CGUIDialogFirstTimeUseAudio::CGUIDialogFirstTimeUseAudio() : CGUIDialogFirstTimeUseBase(WINDOW_DIALOG_FTU_AUDIO,"ftu_audio.xml","CGUIDialogFirstTimeUseAudio") +{ + m_finishSetAudio = false; + m_audioOutputType = CAudioOutputType::NONE; + m_hasDolbyDigitalDts = 0; +} + +CGUIDialogFirstTimeUseAudio::~CGUIDialogFirstTimeUseAudio() +{ + +} + +void CGUIDialogFirstTimeUseAudio::OnInitWindow() +{ + CGUIDialogFirstTimeUseBase::OnInitWindow(); + + m_finishSetAudio = false; + + if (m_audioOutputType != CAudioOutputType::NONE) + { + switch(m_audioOutputType) + { + case CAudioOutputType::HDMI: + { + SetSelectHDMI(); + } + break; + case CAudioOutputType::OPTICAL: + { + SetSelectOPTICAL(); + } + break; + case CAudioOutputType::ANALOG_STEREO: + { + SetSelectANALOG_STEREO(); + } + break; + } + } + + if (m_hasDolbyDigitalDts != 0) + { + switch(m_hasDolbyDigitalDts) + { + case HAS_DDD: + { + SetSelectHAS_DDD(); + } + break; + case NO_DDD: + { + SetSelectNO_DDD(); + } + break; + case DONT_KNOW_DDD: + { + SetSelectDONT_KNOW_DDD(); + } + break; + } + } +} + +bool CGUIDialogFirstTimeUseAudio::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int senderId = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseAudio::OnMessage - GUI_MSG_CLICKED - [buttonId=%d] (initbox)",senderId); + + switch (senderId) + { + case HAS_HDMI: + { + SetSelectHDMI(); + return true; + } + break; + case HAS_OPTICAL: + { + SetSelectOPTICAL(); + return true; + } + break; + case HAS_ANALOG_STEREO: + { + SetSelectANALOG_STEREO(); + return true; + } + break; + case HAS_DDD: + { + SetSelectHAS_DDD(); + return true; + } + break; + case NO_DDD: + { + SetSelectNO_DDD(); + return true; + } + break; + case DONT_KNOW_DDD: + { + SetSelectDONT_KNOW_DDD(); + return true; + } + break; + } + } + break; + } + + return CGUIDialogFirstTimeUseBase::OnMessage(message); +} + +bool CGUIDialogFirstTimeUseAudio::IsFinishSetAudio() +{ + return m_finishSetAudio; +} + +bool CGUIDialogFirstTimeUseAudio::HandleClickNext() +{ + if (m_audioOutputType == CAudioOutputType::NONE) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseAudio::HandleClickNext - [AudioOutputType=%d] wasn't set (initbox)",m_audioOutputType); + + CGUIDialogOK2::ShowAndGetInput(54647,54648); + + SET_CONTROL_FOCUS(HAS_HDMI, 0); + + return false; + } + + if (m_hasDolbyDigitalDts == 0) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseAudio::HandleClickNext - [HasDolbyDigitalDts=%d] wasn't set (initbox)",m_hasDolbyDigitalDts); + + CGUIDialogOK2::ShowAndGetInput(54647,54649); + + SET_CONTROL_FOCUS(HAS_DDD, 0); + + return false; + } + + // TODO: run audio test + + if (CGUIDialogYesNo2::ShowAndGetInput(54647,54651,106,107)) + { + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseAudio::HandleClickNext - Res is OK (initbox)"); + m_finishSetAudio = true; + } + else + { + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseAudio::HandleClickNext - Res NOT OK. Show dialog again (initbox)"); + m_finishSetAudio = false; + } + + return m_finishSetAudio; +} + +bool CGUIDialogFirstTimeUseAudio::HandleClickBack() +{ + // nothing to do + + return true; +} + +void CGUIDialogFirstTimeUseAudio::SetSelectHDMI() +{ + SET_CONTROL_SELECTED(GetID(), HAS_HDMI, true); + SET_CONTROL_SELECTED(GetID(), HAS_OPTICAL, false); + SET_CONTROL_SELECTED(GetID(), HAS_ANALOG_STEREO, false); + m_audioOutputType = CAudioOutputType::HDMI; +} + +void CGUIDialogFirstTimeUseAudio::SetSelectOPTICAL() +{ + SET_CONTROL_SELECTED(GetID(), HAS_HDMI, false); + SET_CONTROL_SELECTED(GetID(), HAS_OPTICAL, true); + SET_CONTROL_SELECTED(GetID(), HAS_ANALOG_STEREO, false); + m_audioOutputType = CAudioOutputType::OPTICAL; +} + +void CGUIDialogFirstTimeUseAudio::SetSelectANALOG_STEREO() +{ + SET_CONTROL_SELECTED(GetID(), HAS_HDMI, false); + SET_CONTROL_SELECTED(GetID(), HAS_OPTICAL, false); + SET_CONTROL_SELECTED(GetID(), HAS_ANALOG_STEREO, true); + m_audioOutputType = CAudioOutputType::ANALOG_STEREO; +} + +void CGUIDialogFirstTimeUseAudio::SetSelectHAS_DDD() +{ + SET_CONTROL_SELECTED(GetID(), HAS_DDD, true); + SET_CONTROL_SELECTED(GetID(), NO_DDD, false); + SET_CONTROL_SELECTED(GetID(), DONT_KNOW_DDD, false); + m_hasDolbyDigitalDts = HAS_DDD; +} + +void CGUIDialogFirstTimeUseAudio::SetSelectNO_DDD() +{ + SET_CONTROL_SELECTED(GetID(), HAS_DDD, false); + SET_CONTROL_SELECTED(GetID(), NO_DDD, true); + SET_CONTROL_SELECTED(GetID(), DONT_KNOW_DDD, false); + m_hasDolbyDigitalDts = NO_DDD; +} + +void CGUIDialogFirstTimeUseAudio::SetSelectDONT_KNOW_DDD() +{ + SET_CONTROL_SELECTED(GetID(), HAS_DDD, false); + SET_CONTROL_SELECTED(GetID(), NO_DDD, false); + SET_CONTROL_SELECTED(GetID(), DONT_KNOW_DDD, true); + m_hasDolbyDigitalDts = DONT_KNOW_DDD; +} + +#endif diff --git a/xbmc/GUIDialogFirstTimeUseAudio.h b/xbmc/GUIDialogFirstTimeUseAudio.h new file mode 100644 index 00000000..7744e1c4 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseAudio.h @@ -0,0 +1,52 @@ +#pragma once + +#include "GUIDialogFirstTimeUseBase.h" + +#ifdef HAS_EMBEDDED + +class CAudioOutputType +{ +public: + enum AudioOutputTypeEnums + { + NONE=0, + HDMI=1, + OPTICAL=2, + ANALOG_STEREO=3, + NUM_OF_AUDIO_OUTPUT_TYPES=4 + }; +}; + +class CGUIDialogFirstTimeUseAudio : public CGUIDialogFirstTimeUseBase +{ +public: + + CGUIDialogFirstTimeUseAudio(); + virtual ~CGUIDialogFirstTimeUseAudio(); + + virtual bool OnMessage(CGUIMessage &message); + + bool IsFinishSetAudio(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + + void SetSelectHDMI(); + void SetSelectOPTICAL(); + void SetSelectANALOG_STEREO(); + void SetSelectHAS_DDD(); + void SetSelectNO_DDD(); + void SetSelectDONT_KNOW_DDD(); + + bool m_finishSetAudio; + CAudioOutputType::AudioOutputTypeEnums m_audioOutputType; + int m_hasDolbyDigitalDts; + +}; + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseBase.cpp b/xbmc/GUIDialogFirstTimeUseBase.cpp new file mode 100644 index 00000000..2be18345 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseBase.cpp @@ -0,0 +1,87 @@ +#include "GUIDialogFirstTimeUseBase.h" + +#ifdef HAS_EMBEDDED + +#include "log.h" + +CGUIDialogFirstTimeUseBase::CGUIDialogFirstTimeUseBase(int id, const CStdString& xmlFile, const CStdString& name) : CGUIDialog(id, xmlFile) +{ + m_name = name; +} + +CGUIDialogFirstTimeUseBase::~CGUIDialogFirstTimeUseBase() +{ + +} + +bool CGUIDialogFirstTimeUseBase::OnAction(const CAction &action) +{ + if (action.id == ACTION_PREVIOUS_MENU || action.id == ACTION_PARENT_DIR) + { + m_actionChoseEnum = CActionChose::BACK; + Close(); + return true; + } + else if (action.id == ACTION_BUILT_IN_FUNCTION) + { + // don't allow during FTU + CLog::Log(LOGDEBUG,"%s::OnAction - ACTION_BUILT_IN_FUNCTION is not allow (ftu)",m_name.c_str()); + return true; + } + + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogFirstTimeUseBase::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int senderId = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"%s::OnMessage - GUI_MSG_CLICKED - [buttonId=%d] (initbox)",m_name.c_str(),senderId); + + switch (senderId) + { + case BUTTON_NEXT: + { + if (HandleClickNext()) + { + m_actionChoseEnum = CActionChose::NEXT; + Close(); + } + + return true; + } + break; + case BUTTON_BACK: + { + if (HandleClickBack()) + { + m_actionChoseEnum = CActionChose::BACK; + Close(); + } + + return true; + } + break; + } + } + } + + return CGUIDialog::OnMessage(message); +} + +CActionChose::ActionChoseEnums CGUIDialogFirstTimeUseBase::GetActionChose() +{ + return m_actionChoseEnum; +} + +void CGUIDialogFirstTimeUseBase::SetActionChose(CActionChose::ActionChoseEnums actionChoseEnum) +{ + m_actionChoseEnum = actionChoseEnum; +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseBase.h b/xbmc/GUIDialogFirstTimeUseBase.h new file mode 100644 index 00000000..2c860c7b --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseBase.h @@ -0,0 +1,46 @@ +#pragma once + +#include "system.h" + +#ifdef HAS_EMBEDDED + +#include "GUIDialog.h" + +#define BUTTON_NEXT 250 +#define BUTTON_BACK 251 + +class CActionChose +{ +public: + enum ActionChoseEnums + { + ERROR=0, + NEXT=1, + BACK=2, + NUM_OF_NEXT_ACTIONS=3 + }; +}; + +class CGUIDialogFirstTimeUseBase : public CGUIDialog +{ +public: + + CGUIDialogFirstTimeUseBase(int id, const CStdString& xmlFile, const CStdString& derivedClassStr); + virtual ~CGUIDialogFirstTimeUseBase(); + + virtual bool OnAction(const CAction &action); + virtual bool OnMessage(CGUIMessage &message); + + virtual CActionChose::ActionChoseEnums GetActionChose(); + virtual void SetActionChose(CActionChose::ActionChoseEnums actionChoseEnum); + +protected: + + virtual bool HandleClickNext() = 0; + virtual bool HandleClickBack() = 0; + + CActionChose::ActionChoseEnums m_actionChoseEnum; + CStdString m_name; +}; + +#endif diff --git a/xbmc/GUIDialogFirstTimeUseConfNetwork.cpp b/xbmc/GUIDialogFirstTimeUseConfNetwork.cpp new file mode 100644 index 00000000..2fde28a3 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseConfNetwork.cpp @@ -0,0 +1,171 @@ +#include "GUIDialogFirstTimeUseConfNetwork.h" + +#ifdef HAS_EMBEDDED + +#include "GUIEditControl.h" +#include "GUIDialogOK2.h" +#include "utils/RegExp.h" +#include "log.h" + +#define DEFAULT_IP_ADDRESS "" +#define DEFAULT_NETMASK "" +#define DEFAULT_GATEWAY "" +#define DEFAULTL_DNS "" + +#define IP_REGEXP "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" +#define CONTROL_IP_ADDRESS_EDIT 501 +#define CONTROL_NETMASK_EDIT 511 +#define CONTROL_GATEWAY_EDIT 521 +#define CONTROL_DNS_EDIT 531 + +CGUIDialogFirstTimeUseConfNetwork::CGUIDialogFirstTimeUseConfNetwork() : CGUIDialogFirstTimeUseBase(WINDOW_DIALOG_FTU_CONF_NETWORK,"ftu_conf_network.xml","CGUIDialogFirstTimeUseConfNetwork") +{ + m_ipAddress = DEFAULT_IP_ADDRESS; + m_netmask = DEFAULT_NETMASK; + m_gateway = DEFAULT_GATEWAY; + m_dns = DEFAULTL_DNS; +} + +CGUIDialogFirstTimeUseConfNetwork::~CGUIDialogFirstTimeUseConfNetwork() +{ + +} + +void CGUIDialogFirstTimeUseConfNetwork::OnInitWindow() +{ + CGUIDialogFirstTimeUseBase::OnInitWindow(); + + ((CGUIEditControl*)GetControl(CONTROL_IP_ADDRESS_EDIT))->SetInputType(CGUIEditControl::INPUT_TYPE_IPADDRESS,0); + ((CGUIEditControl*)GetControl(CONTROL_IP_ADDRESS_EDIT))->SetLabel2(m_ipAddress); + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfNetwork::OnInitWindow - After set control with [IpAddress=%s] (initbox)",m_ipAddress.c_str()); + + ((CGUIEditControl*)GetControl(CONTROL_NETMASK_EDIT))->SetInputType(CGUIEditControl::INPUT_TYPE_IPADDRESS,0); + ((CGUIEditControl*)GetControl(CONTROL_NETMASK_EDIT))->SetLabel2(m_netmask); + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfNetwork::OnInitWindow - After set control with [Netmask=%s] (initbox)",m_netmask.c_str()); + + ((CGUIEditControl*)GetControl(CONTROL_GATEWAY_EDIT))->SetInputType(CGUIEditControl::INPUT_TYPE_IPADDRESS,0); + ((CGUIEditControl*)GetControl(CONTROL_GATEWAY_EDIT))->SetLabel2(m_gateway); + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfNetwork::OnInitWindow - After set control with [Gateway=%s] (initbox)",m_gateway.c_str()); + + ((CGUIEditControl*)GetControl(CONTROL_DNS_EDIT))->SetInputType(CGUIEditControl::INPUT_TYPE_IPADDRESS,0); + ((CGUIEditControl*)GetControl(CONTROL_DNS_EDIT))->SetLabel2(m_dns); + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfNetwork::OnInitWindow - After set control with [DNS=%s] (initbox)",m_dns.c_str()); + + SET_CONTROL_FOCUS(CONTROL_IP_ADDRESS_EDIT, 0); +} + +bool CGUIDialogFirstTimeUseConfNetwork::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int senderId = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfNetwork::OnMessage - GUI_MSG_CLICKED - [buttonId=%d] (initbox)",senderId); + + switch (senderId) + { + case BUTTON_NEXT: + { + if (!ValidateFields()) + { + CGUIDialogOK2::ShowAndGetInput(257,54653); + return true; + } + } + break; + } + } + } + + return CGUIDialogFirstTimeUseBase::OnMessage(message); +} + +bool CGUIDialogFirstTimeUseConfNetwork::ValidateFields() +{ + CRegExp reg; + reg.RegComp(IP_REGEXP); + CStdString editStr = ""; + + // check IpAddress value + editStr = ((CGUIEditControl*)GetControl(CONTROL_IP_ADDRESS_EDIT))->GetLabel2(); + if (reg.RegFind(editStr.c_str()) == -1) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseConfNetwork::ValidateFields - [ipaddress=%s] is NOT valid (initbox)",editStr.c_str()); + return false; + } + + // check IpAddress value + editStr = ((CGUIEditControl*)GetControl(CONTROL_NETMASK_EDIT))->GetLabel2(); + if (reg.RegFind(editStr.c_str()) == -1) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseConfNetwork::ValidateFields - [netmask=%s] is NOT valid (initbox)",editStr.c_str()); + return false; + } + + // check IpAddress value + editStr = ((CGUIEditControl*)GetControl(CONTROL_GATEWAY_EDIT))->GetLabel2(); + if (reg.RegFind(editStr.c_str()) == -1) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseConfNetwork::ValidateFields - [gateway=%s] is NOT valid (initbox)",editStr.c_str()); + return false; + } + + // check IpAddress value + editStr = ((CGUIEditControl*)GetControl(CONTROL_DNS_EDIT))->GetLabel2(); + if (reg.RegFind(editStr.c_str()) == -1) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseConfNetwork::ValidateFields - [dns=%s] is NOT valid (initbox)",editStr.c_str()); + return false; + } + + return true; +} + +bool CGUIDialogFirstTimeUseConfNetwork::HandleClickNext() +{ + m_ipAddress = ((CGUIEditControl*)GetControl(CONTROL_IP_ADDRESS_EDIT))->GetLabel2(); + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfNetwork::HandleHitNextButton - After set [IpAddress=%s] (initbox)",m_ipAddress.c_str()); + + m_netmask = ((CGUIEditControl*)GetControl(CONTROL_NETMASK_EDIT))->GetLabel2(); + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfNetwork::HandleHitNextButton - After set [Netmask=%s] (initbox)",m_netmask.c_str()); + + m_gateway = ((CGUIEditControl*)GetControl(CONTROL_GATEWAY_EDIT))->GetLabel2(); + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfNetwork::HandleHitNextButton - After set [Gateway=%s] (initbox)",m_gateway.c_str()); + + m_dns = ((CGUIEditControl*)GetControl(CONTROL_DNS_EDIT))->GetLabel2(); + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfNetwork::HandleHitNextButton - After set [DNS=%s] (initbox)",m_dns.c_str()); + + return true; +} + +bool CGUIDialogFirstTimeUseConfNetwork::HandleClickBack() +{ + // nothing to do + + return true; +} + +CStdString CGUIDialogFirstTimeUseConfNetwork::GetIpAddress() +{ + return m_ipAddress; +} + +CStdString CGUIDialogFirstTimeUseConfNetwork::GetNetmask() +{ + return m_netmask; +} + +CStdString CGUIDialogFirstTimeUseConfNetwork::GetGateway() +{ + return m_gateway; +} + +CStdString CGUIDialogFirstTimeUseConfNetwork::GetDNS() +{ + return m_dns; +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseConfNetwork.h b/xbmc/GUIDialogFirstTimeUseConfNetwork.h new file mode 100644 index 00000000..6f972cb8 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseConfNetwork.h @@ -0,0 +1,36 @@ +#pragma once + +#include "GUIDialogFirstTimeUseBase.h" + +#ifdef HAS_EMBEDDED + +class CGUIDialogFirstTimeUseConfNetwork : public CGUIDialogFirstTimeUseBase +{ +public: + + CGUIDialogFirstTimeUseConfNetwork(); + virtual ~CGUIDialogFirstTimeUseConfNetwork(); + + virtual bool OnMessage(CGUIMessage &message); + + CStdString GetIpAddress(); + CStdString GetNetmask(); + CStdString GetGateway(); + CStdString GetDNS(); + +protected: + + virtual void OnInitWindow(); + + bool ValidateFields(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + + CStdString m_ipAddress; + CStdString m_netmask; + CStdString m_gateway; + CStdString m_dns; +}; + +#endif diff --git a/xbmc/GUIDialogFirstTimeUseConfWireless.cpp b/xbmc/GUIDialogFirstTimeUseConfWireless.cpp new file mode 100644 index 00000000..61371b42 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseConfWireless.cpp @@ -0,0 +1,170 @@ +#include "GUIDialogFirstTimeUseConfWireless.h" +#include "GUIDialogFirstTimeUseWireless.h" +#include "GUIWindowManager.h" +#include "LocalizeStrings.h" +#include "GUILabelControl.h" +#include "GUIEditControl.h" +#include "GUIRadioButtonControl.h" +#include "GUIDialogOK2.h" +#include "log.h" + +#define CONTROL_PASSWORD_LABEL 50 +#define CONTROL_PASSWORD_EDIT 51 +#define CONTROL_PASSWORD_SHOW 52 +#define AUTOMATIC_CONF 281 +#define MANUALLY_CONF 282 + +CGUIDialogFirstTimeUseConfWireless::CGUIDialogFirstTimeUseConfWireless() : CGUIDialogFirstTimeUseBase(WINDOW_DIALOG_FTU_CONF_WIRELESS_PASSWORD,"ftu_conf_wireless.xml","CGUIDialogFirstTimeUseConfWireless") +{ + m_buttonSelected = 0; + m_password = ""; +} + +CGUIDialogFirstTimeUseConfWireless::~CGUIDialogFirstTimeUseConfWireless() +{ + +} + +void CGUIDialogFirstTimeUseConfWireless::OnInitWindow() +{ + CGUIDialogFirstTimeUseBase::OnInitWindow(); + + if (m_buttonSelected != 0) + { + switch(m_buttonSelected) + { + case AUTOMATIC_CONF: + { + SetSelectAUTOMATIC(); + } + break; + case MANUALLY_CONF: + { + SetSelectMANUALLY(); + } + break; + } + } + + // TODO: check if need to show password + + CStdString wirelessNetworkName = ""; + CGUIDialogFirstTimeUseWireless* pWirelessDialog = (CGUIDialogFirstTimeUseWireless*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_WIRELESS); + if (pWirelessDialog) + { + wirelessNetworkName = pWirelessDialog->GetSelectedWirelessName(); + } + + CStdString label; + CStdString str = g_localizeStrings.Get(54690); + + label.Format(str.c_str(), wirelessNetworkName); + + ((CGUILabelControl*)GetControl(CONTROL_PASSWORD_LABEL))->SetLabel(label); + + if (!m_password.IsEmpty()) + { + ((CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT))->SetLabel2(m_password); + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfWireless::OnInitWindow - After set control with [m_password=%s] (initbox)",m_password.c_str()); + } +} + +bool CGUIDialogFirstTimeUseConfWireless::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int senderId = message.GetSenderId(); + + switch (senderId) + { + case CONTROL_PASSWORD_SHOW: + { + CGUIRadioButtonControl* pControl = (CGUIRadioButtonControl*)GetControl(CONTROL_PASSWORD_SHOW); + if (pControl) + { + //((CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT))-> + if (pControl->IsSelected()) + { + ((CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT))->SetInputType(CGUIEditControl::INPUT_TYPE_TEXT,0); + } + else + { + ((CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT))->SetInputType(CGUIEditControl::INPUT_TYPE_PASSWORD,0); + } + } + + return true; + } + break; + case AUTOMATIC_CONF: + { + SetSelectAUTOMATIC(); + return true; + } + break; + case MANUALLY_CONF: + { + SetSelectMANUALLY(); + return true; + } + break; + } + } + break; + } + + return CGUIDialogFirstTimeUseBase::OnMessage(message); +} + +bool CGUIDialogFirstTimeUseConfWireless::HandleClickNext() +{ + if (m_buttonSelected == 0) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseConfWireless::HandleHitNextButton - No buton was chose (initbox)"); + + CGUIDialogOK2::ShowAndGetInput(54679,54668); + + SET_CONTROL_FOCUS(AUTOMATIC_CONF, 0); + + return false; + } + + m_password = ((CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT))->GetLabel2(); + + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfWireless::HandleHitNextButton - After set [Password=%s] (initbox)",m_password.c_str()); + + return true; +} + +bool CGUIDialogFirstTimeUseConfWireless::HandleClickBack() +{ + // nothing to do + + return true; +} + +void CGUIDialogFirstTimeUseConfWireless::SetSelectAUTOMATIC() +{ + SET_CONTROL_SELECTED(GetID(), AUTOMATIC_CONF, true); + SET_CONTROL_SELECTED(GetID(), MANUALLY_CONF, false); + m_buttonSelected = AUTOMATIC_CONF; +} + +void CGUIDialogFirstTimeUseConfWireless::SetSelectMANUALLY() +{ + SET_CONTROL_SELECTED(GetID(), AUTOMATIC_CONF, false); + SET_CONTROL_SELECTED(GetID(), MANUALLY_CONF, true); + m_buttonSelected = MANUALLY_CONF; +} + +int CGUIDialogFirstTimeUseConfWireless::GetChoiceSelected() +{ + return m_buttonSelected; +} + +CStdString CGUIDialogFirstTimeUseConfWireless::GetPassword() +{ + return m_password; +} diff --git a/xbmc/GUIDialogFirstTimeUseConfWireless.h b/xbmc/GUIDialogFirstTimeUseConfWireless.h new file mode 100644 index 00000000..987281fa --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseConfWireless.h @@ -0,0 +1,36 @@ +#pragma once + +#include "GUIDialogFirstTimeUseBase.h" + +#ifdef HAS_EMBEDDED + +class CGUIDialogFirstTimeUseConfWireless : public CGUIDialogFirstTimeUseBase +{ +public: + + CGUIDialogFirstTimeUseConfWireless(); + virtual ~CGUIDialogFirstTimeUseConfWireless(); + + virtual bool OnMessage(CGUIMessage &message); + + int GetChoiceSelected(); + + CStdString GetPassword(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + + void SetSelectAUTOMATIC(); + void SetSelectMANUALLY(); + + int m_buttonSelected; + + CStdString m_password; +}; + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseConfWirelessPassword.cpp b/xbmc/GUIDialogFirstTimeUseConfWirelessPassword.cpp new file mode 100644 index 00000000..59b5c7e3 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseConfWirelessPassword.cpp @@ -0,0 +1,137 @@ +#include "GUIDialogFirstTimeUseConfWirelessPassword.h" + +#ifdef HAS_EMBEDDED + +#include "GUIDialogFirstTimeUseWireless.h" +#include "GUIWindowManager.h" +#include "LocalizeStrings.h" +#include "GUILabelControl.h" +#include "GUIEditControl.h" +#include "GUIRadioButtonControl.h" +#include "GUIDialogOK2.h" +#include "log.h" + +#define CONTROL_PASSWORD_LABEL 50 +#define CONTROL_PASSWORD_EDIT 51 +#define CONTROL_PASSWORD_SHOW 52 + +CGUIDialogFirstTimeUseConfWirelessPassword::CGUIDialogFirstTimeUseConfWirelessPassword() : CGUIDialogFirstTimeUseBase(WINDOW_DIALOG_FTU_CONF_WIRELESS_PASSWORD,"ftu_conf_wireless_password.xml","CGUIDialogFirstTimeUseConfWirelessPassword") +{ + m_password = ""; +} + +CGUIDialogFirstTimeUseConfWirelessPassword::~CGUIDialogFirstTimeUseConfWirelessPassword() +{ + +} + +void CGUIDialogFirstTimeUseConfWirelessPassword::OnInitWindow() +{ + CGUIDialogFirstTimeUseBase::OnInitWindow(); + + CGUILabelControl* passwordLabelCtrl = (CGUILabelControl*)GetControl(CONTROL_PASSWORD_LABEL); + if (passwordLabelCtrl) + { + CStdString label; + + // if (m_networkName.IsEmpty()) + // { + // label = g_localizeStrings.Get(54619); + // } + // else + // { + // if (!m_isNetworkRequiresPassword) + // { + // CStdString str = g_localizeStrings.Get(54618); + // label.Format(str.c_str(), m_networkName); + // } + // else + // { + // CStdString str = g_localizeStrings.Get(54690); + // label.Format(str.c_str(), m_networkName); + // } + // } + + label = g_localizeStrings.Get(54619); + passwordLabelCtrl->SetLabel(label); + } + + m_password = ""; + ((CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT))->SetLabel2(m_password); +} + +bool CGUIDialogFirstTimeUseConfWirelessPassword::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int senderId = message.GetSenderId(); + + switch (senderId) + { + case CONTROL_PASSWORD_SHOW: + { + CGUIRadioButtonControl* pControl = (CGUIRadioButtonControl*)GetControl(CONTROL_PASSWORD_SHOW); + if (pControl) + { + if (pControl->IsSelected()) + { + ((CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT))->SetInputType(CGUIEditControl::INPUT_TYPE_TEXT,0); + } + else + { + ((CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT))->SetInputType(CGUIEditControl::INPUT_TYPE_PASSWORD,0); + } + } + + return true; + } + break; + } + } + break; + } + + return CGUIDialogFirstTimeUseBase::OnMessage(message); +} + +bool CGUIDialogFirstTimeUseConfWirelessPassword::HandleClickNext() +{ + m_password = ((CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT))->GetLabel2(); + + //CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfWirelessPassword::HandleHitNextButton - After set [Password=%s] (initbox)",m_password.c_str()); + + return true; +} + +bool CGUIDialogFirstTimeUseConfWirelessPassword::HandleClickBack() +{ + // nothing to do + + return true; +} + +CStdString CGUIDialogFirstTimeUseConfWirelessPassword::GetNetworkName() +{ + return m_networkName; +} + +void CGUIDialogFirstTimeUseConfWirelessPassword::SetNetworkName(const CStdString& networkName, bool isNetworkRequiresPassword) +{ + m_networkName = networkName; + m_isNetworkRequiresPassword = isNetworkRequiresPassword; +} + +CStdString CGUIDialogFirstTimeUseConfWirelessPassword::GetPassword() +{ + return m_password; +} + +void CGUIDialogFirstTimeUseConfWirelessPassword::SetPassword(const CStdString& password) +{ + m_password = password; +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseConfWirelessPassword.h b/xbmc/GUIDialogFirstTimeUseConfWirelessPassword.h new file mode 100644 index 00000000..3fad7fdd --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseConfWirelessPassword.h @@ -0,0 +1,35 @@ +#pragma once + +#include "GUIDialogFirstTimeUseBase.h" + +#ifdef HAS_EMBEDDED + +class CGUIDialogFirstTimeUseConfWirelessPassword : public CGUIDialogFirstTimeUseBase +{ +public: + + CGUIDialogFirstTimeUseConfWirelessPassword(); + virtual ~CGUIDialogFirstTimeUseConfWirelessPassword(); + + virtual bool OnMessage(CGUIMessage &message); + + CStdString GetNetworkName(); + void SetNetworkName(const CStdString& networkName, bool isNetworkRequiresPassword = false); + + CStdString GetPassword(); + void SetPassword(const CStdString& password); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + + CStdString m_networkName; + bool m_isNetworkRequiresPassword; + CStdString m_password; +}; + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseConfWirelessSSID.cpp b/xbmc/GUIDialogFirstTimeUseConfWirelessSSID.cpp new file mode 100644 index 00000000..fc0cc727 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseConfWirelessSSID.cpp @@ -0,0 +1,62 @@ +#include "GUIDialogFirstTimeUseConfWirelessSSID.h" + +#ifdef HAS_EMBEDDED + +#include "GUIEditControl.h" +#include "log.h" + +#define CONTROL_SSID_EDIT 51 + +CGUIDialogFirstTimeUseConfWirelessSSID::CGUIDialogFirstTimeUseConfWirelessSSID() : CGUIDialogFirstTimeUseBase(WINDOW_DIALOG_FTU_CONF_WIRELESS_SSID, "ftu_conf_wireless_ssid.xml","CGUIDialogFirstTimeUseConfWirelessSSID") +{ + m_ssid = ""; +} + +CGUIDialogFirstTimeUseConfWirelessSSID::~CGUIDialogFirstTimeUseConfWirelessSSID() +{ +} + +void CGUIDialogFirstTimeUseConfWirelessSSID::OnInitWindow() +{ + CGUIDialogFirstTimeUseBase::OnInitWindow(); + + if (!m_ssid.IsEmpty()) + { + ((CGUIEditControl*)GetControl(CONTROL_SSID_EDIT))->SetLabel2(m_ssid); + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfWireless::OnInitWindow - After set control with [m_ssid=%s] (initbox)",m_ssid.c_str()); + } +} + +bool CGUIDialogFirstTimeUseConfWirelessSSID::OnMessage(CGUIMessage& message) +{ + return CGUIDialogFirstTimeUseBase::OnMessage(message); +} + +bool CGUIDialogFirstTimeUseConfWirelessSSID::HandleClickNext() +{ + m_ssid = ((CGUIEditControl*)GetControl(CONTROL_SSID_EDIT))->GetLabel2(); + + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfWirelessSSID::HandleClickNext - After set [m_ssid=%s] (initbox)",m_ssid.c_str()); + + return true; +} + +bool CGUIDialogFirstTimeUseConfWirelessSSID::HandleClickBack() +{ + // nothing to do + + return true; +} + +CStdString CGUIDialogFirstTimeUseConfWirelessSSID::GetSSID() +{ + return m_ssid; +} + +void CGUIDialogFirstTimeUseConfWirelessSSID::SetSSID(const CStdString& ssid) +{ + m_ssid = ssid; +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseConfWirelessSSID.h b/xbmc/GUIDialogFirstTimeUseConfWirelessSSID.h new file mode 100644 index 00000000..5a8f4f50 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseConfWirelessSSID.h @@ -0,0 +1,30 @@ +#pragma once + +#include "GUIDialogFirstTimeUseBase.h" + +#ifdef HAS_EMBEDDED + +class CGUIDialogFirstTimeUseConfWirelessSSID : public CGUIDialogFirstTimeUseBase +{ +public: + + CGUIDialogFirstTimeUseConfWirelessSSID(); + virtual ~CGUIDialogFirstTimeUseConfWirelessSSID(); + + virtual bool OnMessage(CGUIMessage &message); + + CStdString GetSSID(); + void SetSSID(const CStdString& ssid); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + + CStdString m_ssid; +}; + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseConfWirelessSecurity.cpp b/xbmc/GUIDialogFirstTimeUseConfWirelessSecurity.cpp new file mode 100644 index 00000000..3a49592c --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseConfWirelessSecurity.cpp @@ -0,0 +1,161 @@ +#include "GUIDialogFirstTimeUseConfWirelessSecurity.h" + +#ifdef HAS_EMBEDDED + +#include "HalServices.h" +#include "FileItem.h" +#include "log.h" + +#define AUTH_NONE_LABEL "None" +#define AUTH_WEP_PASSPHRASE_LABEL "WEP 128-bit passphrase" +#define AUTH_WEP_KEY_LABEL "WEP 40-bit key" +#define AUTH_WPAPSK_LABEL "WPA Personal" +#define AUTH_WPA2PSK_LABEL "WPA2 Personal" + + + +static int nofAuths = 5; +static const char* authStrs[] = { AUTH_NONE_LABEL, AUTH_WEP_PASSPHRASE_LABEL, AUTH_WEP_KEY_LABEL, AUTH_WPAPSK_LABEL, AUTH_WPA2PSK_LABEL }; + +#define LIST_CTRL 240 + +CGUIDialogFirstTimeUseConfWirelessSecurity::CGUIDialogFirstTimeUseConfWirelessSecurity() : CGUIDialogFirstTimeUseWithList(WINDOW_DIALOG_FTU_CONF_WIRELESS_SECURITY,"ftu_conf_wireless_security.xml","CGUIDialogFirstTimeUseConfWirelessSecurity") +{ + +} + +CGUIDialogFirstTimeUseConfWirelessSecurity::~CGUIDialogFirstTimeUseConfWirelessSecurity() +{ + +} + +void CGUIDialogFirstTimeUseConfWirelessSecurity::OnInitWindow() +{ + CGUIDialogFirstTimeUseWithList::OnInitWindow(); + + SetAuth(AUTH_NONE); +} + +bool CGUIDialogFirstTimeUseConfWirelessSecurity::FillListOnInit() +{ + CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), LIST_CTRL); + OnMessage(msgReset); + + for (int i = 0; i < nofAuths; i++) + { + CFileItemPtr item(new CFileItem(authStrs[i])); + m_listItems.Add(item); + } + + // bind new items + CGUIMessage messageBind(GUI_MSG_LABEL_BIND, GetID(), LIST_CTRL, 0, 0, &m_listItems); + OnMessage(messageBind); + + return true; +} + +bool CGUIDialogFirstTimeUseConfWirelessSecurity::HandleListChoice() +{ + SetAuth(CGUIDialogFirstTimeUseConfWirelessSecurity::GetAuthLabelAsEnum(m_selectedItem->GetLabel())); + return true; +} + +bool CGUIDialogFirstTimeUseConfWirelessSecurity::OnMessage(CGUIMessage& message) +{ + return CGUIDialogFirstTimeUseWithList::OnMessage(message); +} + +void CGUIDialogFirstTimeUseConfWirelessSecurity::SetAuth(CHalWirelessAuthType auth) +{ + m_auth = auth; +} + +CHalWirelessAuthType CGUIDialogFirstTimeUseConfWirelessSecurity::GetAuth() +{ + return m_auth; +} + +bool CGUIDialogFirstTimeUseConfWirelessSecurity::HandleClickNext() +{ + return true; +} + +bool CGUIDialogFirstTimeUseConfWirelessSecurity::HandleClickBack() +{ + // nothing to do + + return true; +} + +CHalWirelessAuthType CGUIDialogFirstTimeUseConfWirelessSecurity::GetAuthLabelAsEnum(const CStdString& authLabel) +{ + if (authLabel == AUTH_NONE_LABEL) + { + return AUTH_NONE; + } + else if (authLabel == AUTH_WEP_PASSPHRASE_LABEL) + { + return AUTH_WEP_PASSPHRASE; + } + else if (authLabel == AUTH_WEP_KEY_LABEL) + { + return AUTH_WEP_KEY; + } + else if (authLabel == AUTH_WPAPSK_LABEL) + { + return AUTH_WPAPSK; + } + else if (authLabel == AUTH_WPA2PSK_LABEL) + { + return AUTH_WPA2PSK; + } + else + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseConfWirelessSecurity::GetAuthLabelAsEnum - FAILED to parse auth label [%s]. Return [AUthEnum=%d=AUTH_DONTCARE] (initbox)",authLabel.c_str(),AUTH_DONTCARE); + return AUTH_DONTCARE; + } +} + +CStdString CGUIDialogFirstTimeUseConfWirelessSecurity::GetAuthAsString(CHalWirelessAuthType auth) +{ + switch(auth) + { + case AUTH_NONE: + { + return "AUTH_NONE"; + } + break; + case AUTH_DONTCARE: + { + return "AUTH_DONTCARE"; + } + break; + case AUTH_WEP_PASSPHRASE: + { + return "AUTH_WEP_PASSPHRASE"; + } + break; + case AUTH_WEP_KEY: + { + return "AUTH_WEP_KEY"; + } + break; + case AUTH_WPAPSK: + { + return "AUTH_WPAPSK"; + } + break; + case AUTH_WPA2PSK: + { + return "AUTH_WPA2PSK"; + } + break; + default: + { + return "UNKNOWN"; + } + break; + } +} + +#endif diff --git a/xbmc/GUIDialogFirstTimeUseConfWirelessSecurity.h b/xbmc/GUIDialogFirstTimeUseConfWirelessSecurity.h new file mode 100644 index 00000000..576a9e23 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseConfWirelessSecurity.h @@ -0,0 +1,37 @@ +#pragma once + +#include "GUIDialogFirstTimeUseWithList.h" + +#ifdef HAS_EMBEDDED + +#include "HalServices.h" + +class CGUIDialogFirstTimeUseConfWirelessSecurity : public CGUIDialogFirstTimeUseWithList +{ +public: + + CGUIDialogFirstTimeUseConfWirelessSecurity(); + virtual ~CGUIDialogFirstTimeUseConfWirelessSecurity(); + + virtual bool OnMessage(CGUIMessage &message); + + CHalWirelessAuthType GetAuth(); + void SetAuth(CHalWirelessAuthType auth); + + static CStdString GetAuthAsString(CHalWirelessAuthType auth); + static CHalWirelessAuthType GetAuthLabelAsEnum(const CStdString& authLabel); + +protected: + + virtual void OnInitWindow(); + + virtual bool FillListOnInit(); + virtual bool HandleListChoice(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + + CHalWirelessAuthType m_auth; +}; + +#endif diff --git a/xbmc/GUIDialogFirstTimeUseEthernet.cpp b/xbmc/GUIDialogFirstTimeUseEthernet.cpp new file mode 100644 index 00000000..0b85a758 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseEthernet.cpp @@ -0,0 +1,136 @@ +#include "GUIDialogFirstTimeUseEthernet.h" + +#ifdef HAS_EMBEDDED + +#include "GUIDialogOK2.h" +#include "log.h" + +CGUIDialogFirstTimeUseEthernet::CGUIDialogFirstTimeUseEthernet() : CGUIDialogFirstTimeUseBase(WINDOW_DIALOG_FTU_ETHERNET,"ftu_ethernet.xml","CGUIDialogFirstTimeUseEthernet") +{ + m_buttonSelected = 0; +} + +CGUIDialogFirstTimeUseEthernet::~CGUIDialogFirstTimeUseEthernet() +{ + +} + +void CGUIDialogFirstTimeUseEthernet::OnInitWindow() +{ + CGUIDialogFirstTimeUseBase::OnInitWindow(); + + if (m_buttonSelected != 0) + { + switch(m_buttonSelected) + { + case AUTOMATIC_CONF: + { + SetSelectAUTOMATIC(); + } + break; + case MANUALLY_CONF: + { + SetSelectMANUALLY(); + } + break; + case SWITCH_TO_WIRELESS: + { + SetSelectSWITCH_TO_WIRELESS(); + } + break; + } + } +} + +bool CGUIDialogFirstTimeUseEthernet::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int senderId = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseEthernet::OnMessage - GUI_MSG_CLICKED - [buttonId=%d] (initbox)",senderId); + + switch (senderId) + { + case AUTOMATIC_CONF: + { + SetSelectAUTOMATIC(); + return true; + } + break; + case MANUALLY_CONF: + { + SetSelectMANUALLY(); + return true; + } + break; + case SWITCH_TO_WIRELESS: + { + SetSelectSWITCH_TO_WIRELESS(); + return true; + } + break; + } + } + break; + } + + return CGUIDialogFirstTimeUseBase::OnMessage(message); +} + +bool CGUIDialogFirstTimeUseEthernet::HandleClickNext() +{ + if (m_buttonSelected == 0) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseEthernet::HandleClickNext - No buton was chose (initbox)"); + + CGUIDialogOK2::ShowAndGetInput(54669,54668); + + SET_CONTROL_FOCUS(AUTOMATIC_CONF, 0); + + return false; + } + + return true; +} + +bool CGUIDialogFirstTimeUseEthernet::HandleClickBack() +{ + // nothing to do + + return true; +} + +void CGUIDialogFirstTimeUseEthernet::SetSelectAUTOMATIC() +{ + SET_CONTROL_SELECTED(GetID(), AUTOMATIC_CONF, true); + SET_CONTROL_SELECTED(GetID(), MANUALLY_CONF, false); + SET_CONTROL_SELECTED(GetID(), SWITCH_TO_WIRELESS, false); + m_buttonSelected = AUTOMATIC_CONF; +} + +void CGUIDialogFirstTimeUseEthernet::SetSelectMANUALLY() +{ + SET_CONTROL_SELECTED(GetID(), AUTOMATIC_CONF, false); + SET_CONTROL_SELECTED(GetID(), MANUALLY_CONF, true); + SET_CONTROL_SELECTED(GetID(), SWITCH_TO_WIRELESS, false); + m_buttonSelected = MANUALLY_CONF; +} + +void CGUIDialogFirstTimeUseEthernet::SetSelectSWITCH_TO_WIRELESS() +{ + SET_CONTROL_SELECTED(GetID(), AUTOMATIC_CONF, false); + SET_CONTROL_SELECTED(GetID(), MANUALLY_CONF, false); + SET_CONTROL_SELECTED(GetID(), SWITCH_TO_WIRELESS, true); + m_buttonSelected = SWITCH_TO_WIRELESS; +} + +int CGUIDialogFirstTimeUseEthernet::GetChoiceSelected() +{ + return m_buttonSelected; +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseEthernet.h b/xbmc/GUIDialogFirstTimeUseEthernet.h new file mode 100644 index 00000000..75ff459a --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseEthernet.h @@ -0,0 +1,38 @@ +#pragma once + +#include "GUIDialogFirstTimeUseBase.h" + +#ifdef HAS_EMBEDDED + +#define AUTOMATIC_CONF 281 +#define MANUALLY_CONF 282 +#define SWITCH_TO_WIRELESS 283 + +class CGUIDialogFirstTimeUseEthernet : public CGUIDialogFirstTimeUseBase +{ +public: + + CGUIDialogFirstTimeUseEthernet(); + virtual ~CGUIDialogFirstTimeUseEthernet(); + + virtual bool OnMessage(CGUIMessage &message); + + int GetChoiceSelected(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + + void SetSelectAUTOMATIC(); + void SetSelectMANUALLY(); + void SetSelectSWITCH_TO_WIRELESS(); + + int m_buttonSelected; + +}; + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseLang.cpp b/xbmc/GUIDialogFirstTimeUseLang.cpp new file mode 100644 index 00000000..a42a941a --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseLang.cpp @@ -0,0 +1,150 @@ +#include "GUIDialogFirstTimeUseLang.h" + +#ifdef HAS_EMBEDDED + +#include "GUIWindowManager.h" +#include "GUISettings.h" +#include "GUIWindowSettingsCategory.h" +#include "Application.h" +#include "GUIDialogOK2.h" +#include "FileItem.h" +#include "BoxeeUtils.h" +#include "log.h" +#include "SpecialProtocol.h" +#include "tinyXML/tinyxml.h" + +#define AVAILABLE_LANG_FILE_PATH "special://xbmc/language/availablelangs.xml" + +CGUIDialogFirstTimeUseLang::CGUIDialogFirstTimeUseLang() : CGUIDialogFirstTimeUseWithList(WINDOW_DIALOG_FTU_LANG,"ftu_lang.xml","CGUIDialogFirstTimeUseLang") +{ + +} + +CGUIDialogFirstTimeUseLang::~CGUIDialogFirstTimeUseLang() +{ + +} + +bool CGUIDialogFirstTimeUseLang::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int iControl = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"%s::OnMessage - GUI_MSG_CLICKED - [iControl=%d] (initbox)",m_name.c_str(),iControl); + + switch (iControl) + { + case LIST_CTRL: + { + // set the selected lang + if (!CGUIDialogFirstTimeUseWithList::OnMessage(message)) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseLang::OnMessage - LIST_CTRL - Call to CGUIDialogFirstTimeUseWithList::OnMessage returned FALSE (initbox)"); + return true; + } + + if (UpdateLanguage()) + { + m_actionChoseEnum = CActionChose::NEXT; + Close(); + } + } + break; + } + } + break; + } + + return CGUIDialogFirstTimeUseWithList::OnMessage(message); +} + +bool CGUIDialogFirstTimeUseLang::HandleClickNext() +{ + return UpdateLanguage(); +} + +bool CGUIDialogFirstTimeUseLang::HandleClickBack() +{ + // nothing to do + + return true; +} + +bool CGUIDialogFirstTimeUseLang::HandleListChoice() +{ + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseLang::HandleListChoice - SelectedLang is [id=%s][displayName=%s][dirName=%s] (initbox)",m_selectedItem->GetProperty("lang_id").c_str(),m_selectedItem->GetProperty("lang_displayName").c_str(),m_selectedItem->GetProperty("lang_dirName").c_str()); + return true; +} + +bool CGUIDialogFirstTimeUseLang::FillListOnInit() +{ + m_listItems.Clear(); + + if (!BoxeeUtils::GetAvailableLanguages(m_listItems)) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseLang::FillList - FAILED to get available languages (initbox)"); + return false; + } + + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseLang::FillList - Get available Languages. [NumOfLanguages=%d] (initbox)",m_listItems.Size()); + + CGUIMessage message(GUI_MSG_LABEL_BIND, GetID(), LIST_CTRL, 0, 0, &m_listItems); + OnMessage(message); + + return true; +} + +bool CGUIDialogFirstTimeUseLang::UpdateLanguage() +{ + /////////////////////////////// + // update to chosen language // + /////////////////////////////// + + bool succeeded = true; + + if (!m_selectedItem.get()) + { + // no language was chosen + CGUIDialogOK2::ShowAndGetInput(54615,54616); + SET_CONTROL_FOCUS(LIST_CTRL, 0); + succeeded = false; + } + else + { + CStdString currentLang = g_guiSettings.GetString("locale.language"); + CStdString choosenLang = m_selectedItem->GetProperty("lang_dirName"); + + if (stricmp(currentLang.c_str(),choosenLang.c_str()) != 0) + { + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseLang::UpdateLanguage - [currentLang=%s != %s=choosenLang] -> going to reload skin (initbox)",currentLang.c_str(),choosenLang.c_str()); + + CGUIWindowSettingsCategory* pWindow = (CGUIWindowSettingsCategory*)g_windowManager.GetWindow(WINDOW_SETTINGS_MYPICTURES); + if (pWindow) + { + pWindow->SetNewLanguage(choosenLang); + if (!pWindow->LoadNewLanguage()) + { + CGUIDialogOK2::ShowAndGetInput(54615,54617); + succeeded = false; + } + } + else + { + CGUIDialogOK2::ShowAndGetInput(54615,54617); + succeeded = false; + } + } + else + { + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseLang::UpdateLanguage - [choosenLang=%s] is the [currentLang=%s] -> no need to reload (initbox)",choosenLang.c_str(),currentLang.c_str()); + } + } + + return succeeded; +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseLang.h b/xbmc/GUIDialogFirstTimeUseLang.h new file mode 100644 index 00000000..d255ffaa --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseLang.h @@ -0,0 +1,28 @@ +#pragma once + +#include "GUIDialogFirstTimeUseWithList.h" + +#ifdef HAS_EMBEDDED + +class CGUIDialogFirstTimeUseLang : public CGUIDialogFirstTimeUseWithList +{ +public: + + CGUIDialogFirstTimeUseLang(); + virtual ~CGUIDialogFirstTimeUseLang(); + + virtual bool OnMessage(CGUIMessage &message); + +protected: + + bool UpdateLanguage(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + + virtual bool FillListOnInit(); + virtual bool HandleListChoice(); +}; + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseMenuCust.cpp b/xbmc/GUIDialogFirstTimeUseMenuCust.cpp new file mode 100644 index 00000000..fd3f8782 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseMenuCust.cpp @@ -0,0 +1,91 @@ +/* + * GUIDialogFirstTimeUseMenuCust.cpp + * + * Created on: Nov 29, 2010 + * Author: shayyizhak + */ + +#include "GUIDialogFirstTimeUseMenuCust.h" +#include "log.h" +#include "GUISettings.h" +#include "Key.h" +#include "GUIWindowStateDatabase.h" + +#define BUTTON_FILES 210 +#define BUTTON_WEB 220 +#define BUTTON_NOT_SURE 230 +#define CATEGORY_LOCAL "local" +#define CATEGORY_FAVORITES "favorite" +#define CATEGORY_ALL "all" + + +CGUIDialogFirstTimeUseMenuCust::CGUIDialogFirstTimeUseMenuCust() : CGUIDialog(WINDOW_DIALOG_MENU_CUSTOMIZATION,"ftu_menu_cust.xml") +{ + +} + +CGUIDialogFirstTimeUseMenuCust::~CGUIDialogFirstTimeUseMenuCust() +{ + +} + +void CGUIDialogFirstTimeUseMenuCust::OnInitWindow() +{ + return CGUIDialog::OnInitWindow(); +} + +bool CGUIDialogFirstTimeUseMenuCust::OnAction(const CAction &action) +{ + if (action.id == ACTION_PREVIOUS_MENU || action.id == ACTION_PARENT_DIR) + { + //User must choose a default, so he can't close the dialog using "back". + return true; + } + return CGUIDialog::OnAction(action); +} + +bool CGUIDialogFirstTimeUseMenuCust::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int senderId = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseMenuCust::OnMessage - GUI_MSG_CLICKED - [buttonId=%d]",senderId); + + switch (senderId) + { + case BUTTON_FILES: + { + CGUIWindowStateDatabase stateDB; + stateDB.SetDefaultCategory(WINDOW_BOXEE_BROWSE_TVSHOWS, CATEGORY_LOCAL); + stateDB.SetDefaultCategory(WINDOW_BOXEE_BROWSE_MOVIES, CATEGORY_LOCAL); + stateDB.SetDefaultCategory(WINDOW_BOXEE_BROWSE_APPS, CATEGORY_FAVORITES); + } + break; + case BUTTON_WEB: + { + CGUIWindowStateDatabase stateDB; + stateDB.SetDefaultCategory(WINDOW_BOXEE_BROWSE_TVSHOWS, CATEGORY_ALL); + stateDB.SetDefaultCategory(WINDOW_BOXEE_BROWSE_MOVIES, CATEGORY_ALL); + stateDB.SetDefaultCategory(WINDOW_BOXEE_BROWSE_APPS, CATEGORY_ALL); + } + break; + case BUTTON_NOT_SURE: + { + CGUIWindowStateDatabase stateDB; + stateDB.SetDefaultCategory(WINDOW_BOXEE_BROWSE_TVSHOWS, CATEGORY_ALL); + stateDB.SetDefaultCategory(WINDOW_BOXEE_BROWSE_MOVIES, CATEGORY_ALL); + stateDB.SetDefaultCategory(WINDOW_BOXEE_BROWSE_APPS, CATEGORY_ALL); + } + break; + } + + this->Close(true); + } + } + + + return CGUIDialog::OnMessage(message); +} diff --git a/xbmc/GUIDialogFirstTimeUseMenuCust.h b/xbmc/GUIDialogFirstTimeUseMenuCust.h new file mode 100644 index 00000000..74c7cee1 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseMenuCust.h @@ -0,0 +1,24 @@ +/* + * GUIDialogFirstTimeUseMenuCust.h + * + * Created on: Nov 29, 2010 + * Author: shayyizhak + */ + +#ifndef GUIDIALOGFIRSTTIMEUSEMENUCUST_H_ +#define GUIDIALOGFIRSTTIMEUSEMENUCUST_H_ + +#include "GUIDialog.h" + +class CGUIDialogFirstTimeUseMenuCust : public CGUIDialog +{ +public: + CGUIDialogFirstTimeUseMenuCust(void); + virtual ~CGUIDialogFirstTimeUseMenuCust(void); + virtual bool OnMessage(CGUIMessage &message); + virtual bool OnAction(const CAction &action); + virtual void OnInitWindow(); + +}; + +#endif /* GUIDIALOGFIRSTTIMEUSEMENUCUST_H_ */ diff --git a/xbmc/GUIDialogFirstTimeUseNetworkMessage.cpp b/xbmc/GUIDialogFirstTimeUseNetworkMessage.cpp new file mode 100644 index 00000000..71770f98 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseNetworkMessage.cpp @@ -0,0 +1,133 @@ +#include "GUIDialogFirstTimeUseNetworkMessage.h" + +#ifdef HAS_EMBEDDED + +#include "GUILabelControl.h" +#include "GUIButtonControl.h" +#include "Application.h" +#include "LocalizeStrings.h" +#include "log.h" +#include "InitializeBoxManager.h" + +CGUIDialogFirstTimeUseNetworkMessage::CGUIDialogFirstTimeUseNetworkMessage() : CGUIDialogFirstTimeUseBase(WINDOW_DIALOG_FTU_NETWORK_MESSAGE,"ftu_network_message.xml","CGUIDialogFirstTimeUseNetworkMessage") +{ + m_buttonClicked = 0; +} + +CGUIDialogFirstTimeUseNetworkMessage::~CGUIDialogFirstTimeUseNetworkMessage() +{ + +} + +void CGUIDialogFirstTimeUseNetworkMessage::OnInitWindow() +{ + CGUIDialogFirstTimeUseBase::OnInitWindow(); + + CGUILabelControl* labelControl = ((CGUILabelControl*)GetControl(NETWORK_MESSAGE_LABEL_CONTROL)); + + if (labelControl) + { + labelControl->SetLabel(m_message); + } + + m_buttonClicked = 0; + + if (CInitializeBoxManager::GetInstance().IsConnectViaEthernet()) + { + m_switchButtonLabel = g_localizeStrings.Get(54699); + m_switchToType = SWITCH_TO_WIRELESS_BUTTON; + SET_CONTROL_VISIBLE(ADJUST_NETWORK_SETTINGS_BUTTON_CONTROL); + } + else + { + m_switchButtonLabel = g_localizeStrings.Get(54729); + m_switchToType = SWITCH_TO_ETHETNET_BUTTON; + SET_CONTROL_HIDDEN(ADJUST_NETWORK_SETTINGS_BUTTON_CONTROL); + } + + CGUIButtonControl* buttonControl = ((CGUIButtonControl*)GetControl(SWITCH_CONNECTION_TYPE_BUTTON_CONTROL)); + + if (buttonControl) + { + CStdString label = "[B]" + m_switchButtonLabel + "[/B]"; + buttonControl->SetLabel(label); + } +} + +bool CGUIDialogFirstTimeUseNetworkMessage::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int senderId = message.GetSenderId(); + + switch (senderId) + { + case TRY_AGAIN_BUTTON_CONTROL: + { + m_buttonClicked = TRY_AGAIN_BUTTON_CONTROL; + m_actionChoseEnum = CActionChose::NEXT; + Close(); + return true; + } + break; + case SWITCH_CONNECTION_TYPE_BUTTON_CONTROL: + { + m_buttonClicked = SWITCH_CONNECTION_TYPE_BUTTON_CONTROL; + m_actionChoseEnum = CActionChose::NEXT; + Close(); + return true; + } + break; + case ADJUST_NETWORK_SETTINGS_BUTTON_CONTROL: + { + m_buttonClicked = ADJUST_NETWORK_SETTINGS_BUTTON_CONTROL; + m_actionChoseEnum = CActionChose::NEXT; + Close(); + return true; + } + break; + default: + { + // do nothing + } + break; + } + } + } + + return CGUIDialogFirstTimeUseBase::OnMessage(message); +} + +bool CGUIDialogFirstTimeUseNetworkMessage::HandleClickNext() +{ + // nothing to do + + return true; +} + +bool CGUIDialogFirstTimeUseNetworkMessage::HandleClickBack() +{ + // nothing to do + + return true; +} + +void CGUIDialogFirstTimeUseNetworkMessage::SetMessage(const CStdString& message) +{ + m_message = message; +} + +int CGUIDialogFirstTimeUseNetworkMessage::GetButtonClicked() +{ + return m_buttonClicked; +} + +int CGUIDialogFirstTimeUseNetworkMessage::GetSwitchToType() +{ + return m_switchToType; +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseNetworkMessage.h b/xbmc/GUIDialogFirstTimeUseNetworkMessage.h new file mode 100644 index 00000000..4a59266e --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseNetworkMessage.h @@ -0,0 +1,46 @@ +#pragma once + +#include "GUIDialogFirstTimeUseBase.h" + +#ifdef HAS_EMBEDDED + +#define NETWORK_MESSAGE_LABEL_CONTROL 310 +#define TRY_AGAIN_BUTTON_CONTROL 300 +#define SWITCH_CONNECTION_TYPE_BUTTON_CONTROL 400 +#define SWITCH_LABEL_CONTROL 401 +#define ADJUST_NETWORK_SETTINGS_BUTTON_CONTROL 500 + +#define SWITCH_TO_ETHETNET_BUTTON 1 +#define SWITCH_TO_WIRELESS_BUTTON 2 + +class CGUIDialogFirstTimeUseNetworkMessage : public CGUIDialogFirstTimeUseBase +{ +public: + + CGUIDialogFirstTimeUseNetworkMessage(); + virtual ~CGUIDialogFirstTimeUseNetworkMessage(); + + virtual bool OnMessage(CGUIMessage &message); + + void SetMessage(const CStdString& m_message); + + int GetSwitchToType(); + + int GetButtonClicked(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + + CStdString m_message; + CStdString m_switchButtonLabel; + int m_switchToType; + + int m_buttonClicked; +}; + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseResolution.cpp b/xbmc/GUIDialogFirstTimeUseResolution.cpp new file mode 100644 index 00000000..454cf1db --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseResolution.cpp @@ -0,0 +1,131 @@ +#include "GUIDialogFirstTimeUseResolution.h" + +#ifdef HAS_EMBEDDED + +#include "GUIWindowManager.h" +#include "GUIWindowSettingsCategory.h" +#include "Settings.h" +#include "GUIDialogYesNo2.h" +#include "GUIDialogOK2.h" +#include "log.h" + +CGUIDialogFirstTimeUseResolution::CGUIDialogFirstTimeUseResolution() : CGUIDialogFirstTimeUseWithList(WINDOW_DIALOG_FTU_RES,"ftu_res.xml","CGUIDialogFirstTimeUseResolution") +{ + +} + +CGUIDialogFirstTimeUseResolution::~CGUIDialogFirstTimeUseResolution() +{ + +} + +void CGUIDialogFirstTimeUseResolution::OnInitWindow() +{ + CGUIDialogFirstTimeUseWithList::OnInitWindow(); +} + +/* +bool CGUIDialogFirstTimeUseResolution::IsFinishSetRes() +{ + return m_finishSetRes; +} +*/ + +/* +CStdString CGUIDialogFirstTimeUseResolution::GetSelectedResStr() +{ + return m_selectedResStr; +} +*/ + +bool CGUIDialogFirstTimeUseResolution::HandleClickNext() +{ + if (!m_selectedItem.get()) + { + // no res was chosen + + CGUIDialogOK2::ShowAndGetInput(54628,54623); + + SET_CONTROL_FOCUS(LIST_CTRL, 0); + + return false; + } + + bool okSelectedRes = TestNewRes(); + + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseResolution::HandleClickNext - Trying to set new res [label=%s][enum=%d] return [%d] (initbox)",m_selectedItem->GetLabel().c_str(),GetSelectedResolutionEnum()); + + return okSelectedRes; +} + +bool CGUIDialogFirstTimeUseResolution::HandleClickBack() +{ + // nothing to do + + return true; +} + +bool CGUIDialogFirstTimeUseResolution::HandleListChoice() +{ + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseResolution::HandleListChoice - Selected resolution is [%s] (initbox)",m_selectedItem->GetLabel().c_str()); + + return true; +} + +bool CGUIDialogFirstTimeUseResolution::FillListOnInit() +{ + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseResolution::FillListOnInit - Enter function. [ResInfoSize=%d] (initbox)",(int)g_settings.m_ResInfo.size()); + + int counter = 0; + int NumOfRes = (int)g_settings.m_ResInfo.size() - RES_DESKTOP; + std::vector::iterator it = g_settings.m_ResInfo.begin()+RES_DESKTOP; + + while(it != g_settings.m_ResInfo.end()) + { + counter++; + RESOLUTION_INFO resInfo = *it; + + CFileItemPtr resItem(new CFileItem(resInfo.strMode)); + + m_listItems.Add(resItem); + + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseResolution::FillListOnInit - [%d/%d] - After adding item [label=%s] for resInfo [id=%s][mode=%s][output=%s] (initbox)",counter,NumOfRes,resItem->GetLabel().c_str(),resInfo.strId.c_str(),resInfo.strMode.c_str(),resInfo.strOutput.c_str()); + + it++; + } + + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseResolution::FillListOnInit - Exit function. [ResListSize=%d] (initbox)",m_listItems.Size()); + + return true; +} + +bool CGUIDialogFirstTimeUseResolution::TestNewRes() +{ + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseResolution::TestNewRes - Handling selectedRes [label=%s][chooseIndex=%d] (initbox)",m_selectedItem->GetLabel().c_str(),m_selectedIndex); + + int NumOfRes = (int)g_settings.m_ResInfo.size() - RES_DESKTOP; + if (m_selectedIndex < 0 || m_selectedIndex > (int)g_settings.m_ResInfo.size()-RES_DESKTOP) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseResolution::TestNewRes - FAILED to handle [SelectedIndex=%d] because it is out of bounds. [NumOfRes=%d] (initbox)",m_selectedIndex,NumOfRes); + return false; + } + + RESOLUTION selectedRes = GetSelectedResolutionEnum(); + + CGUIWindowSettingsCategory* pWindow = (CGUIWindowSettingsCategory*)g_windowManager.GetWindow(WINDOW_SETTINGS_MYPICTURES); + if (!pWindow) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseResolution::TestNewRes - FAILED to get GUIWindowSettingsCategory (initbox)"); + return false; + } + + return (pWindow->TestAndSetNewResolution(selectedRes)); +} + +RESOLUTION CGUIDialogFirstTimeUseResolution::GetSelectedResolutionEnum() +{ + return (RESOLUTION)(RES_DESKTOP + m_selectedIndex); +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseResolution.h b/xbmc/GUIDialogFirstTimeUseResolution.h new file mode 100644 index 00000000..e46eafb9 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseResolution.h @@ -0,0 +1,34 @@ +#pragma once + +#include "GUIDialogFirstTimeUseWithList.h" + +#ifdef HAS_EMBEDDED + +#include "Resolution.h" + +class CGUIDialogFirstTimeUseResolution : public CGUIDialogFirstTimeUseWithList +{ +public: + + CGUIDialogFirstTimeUseResolution(); + virtual ~CGUIDialogFirstTimeUseResolution(); + + CStdString GetSelectedResStr(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + + virtual bool FillListOnInit(); + virtual bool HandleListChoice(); + + RESOLUTION GetSelectedResolutionEnum(); + + bool TestNewRes(); +}; + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseSimpleMessage.cpp b/xbmc/GUIDialogFirstTimeUseSimpleMessage.cpp new file mode 100644 index 00000000..8457e93b --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseSimpleMessage.cpp @@ -0,0 +1,67 @@ +#include "GUIDialogFirstTimeUseSimpleMessage.h" + +#ifdef HAS_EMBEDDED + +#include "GUILabelControl.h" +#include "Application.h" +#include "LocalizeStrings.h" +#include "log.h" +#include "InitializeBoxManager.h" + +#define SIMPLE_MESSAGE_LABEL_CONTROL 259 + +CGUIDialogFirstTimeUseSimpleMessage::CGUIDialogFirstTimeUseSimpleMessage() : CGUIDialogFirstTimeUseBase(WINDOW_DIALOG_FTU_SIMPLE_MESSAGE,"ftu_simple_message.xml","CGUIDialogFirstTimeUseSimpleMessage") +{ + +} + +CGUIDialogFirstTimeUseSimpleMessage::~CGUIDialogFirstTimeUseSimpleMessage() +{ + +} + +void CGUIDialogFirstTimeUseSimpleMessage::OnInitWindow() +{ + CGUIDialogFirstTimeUseBase::OnInitWindow(); + + ((CGUILabelControl*)GetControl(SIMPLE_MESSAGE_LABEL_CONTROL))->SetLabel(m_message); +} + +bool CGUIDialogFirstTimeUseSimpleMessage::OnAction(const CAction &action) +{ + if (action.id == ACTION_PREVIOUS_MENU || action.id == ACTION_PARENT_DIR) + { + // don't allow back in this dialog + + return true; + } + + return CGUIDialogFirstTimeUseBase::OnAction(action); +} + +bool CGUIDialogFirstTimeUseSimpleMessage::OnMessage(CGUIMessage& message) +{ + return CGUIDialogFirstTimeUseBase::OnMessage(message); +} + +bool CGUIDialogFirstTimeUseSimpleMessage::HandleClickNext() +{ + // nothing to do + + return true; +} + +bool CGUIDialogFirstTimeUseSimpleMessage::HandleClickBack() +{ + // nothing to do + + return true; +} + +void CGUIDialogFirstTimeUseSimpleMessage::SetMessage(const CStdString& message) +{ + m_message = message; +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseSimpleMessage.h b/xbmc/GUIDialogFirstTimeUseSimpleMessage.h new file mode 100644 index 00000000..d09a540d --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseSimpleMessage.h @@ -0,0 +1,30 @@ +#pragma once + +#include "GUIDialogFirstTimeUseBase.h" + +#ifdef HAS_EMBEDDED + +class CGUIDialogFirstTimeUseSimpleMessage : public CGUIDialogFirstTimeUseBase +{ +public: + + CGUIDialogFirstTimeUseSimpleMessage(); + virtual ~CGUIDialogFirstTimeUseSimpleMessage(); + + virtual bool OnAction(const CAction &action); + virtual bool OnMessage(CGUIMessage &message); + + void SetMessage(const CStdString& m_message); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + + CStdString m_message; +}; + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseUpdateMessage.cpp b/xbmc/GUIDialogFirstTimeUseUpdateMessage.cpp new file mode 100644 index 00000000..0be703c7 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseUpdateMessage.cpp @@ -0,0 +1,159 @@ +#include "GUIDialogFirstTimeUseUpdateMessage.h" + +#ifdef HAS_EMBEDDED + +#include "InitializeBoxManager.h" +#include "GUILabelControl.h" +#include "GUIButtonControl.h" +#include "LocalizeStrings.h" +#include "log.h" +#include "Settings.h" + +#define UPDATE_MESSAGE_LABEL_CONTROL 258 +#define UPDATE_BUTTON_CONTROL 250 + +CGUIDialogFirstTimeUseUpdateMessage::CGUIDialogFirstTimeUseUpdateMessage() : CGUIDialogFirstTimeUseBase(WINDOW_DIALOG_FTU_UPDATE_MESSAGE,"ftu_update_message.xml","CGUIDialogFirstTimeUseUpdateMessage") +{ + m_message = ""; + m_buttonLabel = ""; +} + +CGUIDialogFirstTimeUseUpdateMessage::~CGUIDialogFirstTimeUseUpdateMessage() +{ + +} + +void CGUIDialogFirstTimeUseUpdateMessage::OnInitWindow() +{ + CGUIDialogFirstTimeUseBase::OnInitWindow(); + + m_message = ""; + m_buttonLabel = ""; + + CUpdateVersionStatus::UpdateVersionStatusEnums updateVersionStatus = CInitializeBoxManager::GetInstance().GetUpdateStatus(); + + switch(updateVersionStatus) + { + case CUpdateVersionStatus::NO_UPDATE: + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseUpdateMessage::OnInitWindow - Update status is [%d=NO_UPDATE] -> Not handling (initbox)",(int)updateVersionStatus); + } + break; + case CUpdateVersionStatus::HAS_UPDATE: + { + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseUpdateMessage::OnInitWindow - Update status is [%d=HAS_UPDATE] (initbox)",(int)updateVersionStatus); + m_message = g_localizeStrings.Get(54693); + m_buttonLabel = g_localizeStrings.Get(54692); + } + break; + case CUpdateVersionStatus::UPDATING: + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseUpdateMessage::OnInitWindow - Update status is [%d=UPDATING] -> Not handling (initbox)",(int)updateVersionStatus); + } + break; + case CUpdateVersionStatus::UPDATE_SUCCEEDED: + { + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseUpdateMessage::OnInitWindow - Update status is [%d=UPDATE_SUCCEEDED] (initbox)",(int)updateVersionStatus); + m_message = g_localizeStrings.Get(54657); + m_buttonLabel = g_localizeStrings.Get(54658); + } + break; + case CUpdateVersionStatus::UPDATE_FAILED: + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseUpdateMessage::OnInitWindow - Update status is [%d=UPDATE_FAILED] (initbox)",(int)updateVersionStatus); + m_message = g_localizeStrings.Get(54656); + m_buttonLabel = g_localizeStrings.Get(54655); + } + break; + case CUpdateVersionStatus::REQUEST_UPGRADE: + { + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseUpdateMessage::OnInitWindow - Update status is [%d=REQUEST_UPGRADE] (initbox)",(int)updateVersionStatus); + m_message = g_localizeStrings.Get(54659); + SET_CONTROL_HIDDEN(UPDATE_BUTTON_CONTROL); + SET_CONTROL_FOCUS(UPDATE_MESSAGE_LABEL_CONTROL,0); + + // mark that FTU was finished OK + g_stSettings.m_doneFTU = true; + g_settings.Save(); + + CInitializeBoxManager::GetInstance().RequestUpgrade(); + } + break; + default: + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseUpdateMessage::OnInitWindow - UNKNOWN Update status [%d] -> Not handling (initbox)",(int)updateVersionStatus); + } + break; + } + + ((CGUILabelControl*)GetControl(UPDATE_MESSAGE_LABEL_CONTROL))->SetLabel(m_message); + ((CGUIButtonControl*)GetControl(UPDATE_BUTTON_CONTROL))->SetLabel(m_buttonLabel); +} + +bool CGUIDialogFirstTimeUseUpdateMessage::OnAction(const CAction &action) +{ + if (action.id == ACTION_PREVIOUS_MENU || action.id == ACTION_PARENT_DIR) + { + // don't allow back in this dialog + + return true; + } + + return CGUIDialogFirstTimeUseBase::OnAction(action); +} + +bool CGUIDialogFirstTimeUseUpdateMessage::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int senderId = message.GetSenderId(); + + switch (senderId) + { + case UPDATE_BUTTON_CONTROL: + { + m_actionChoseEnum = CActionChose::NEXT; + Close(); + return true; + } + break; + default: + { + // do nothing + } + break; + } + } + } + + return CGUIDialogFirstTimeUseBase::OnMessage(message); +} + +void CGUIDialogFirstTimeUseUpdateMessage::SetMessage(const CStdString& message) +{ + m_message = message; +} + +void CGUIDialogFirstTimeUseUpdateMessage::SetButtonLabel(const CStdString& buttonLabel) +{ + m_buttonLabel = buttonLabel; +} + +bool CGUIDialogFirstTimeUseUpdateMessage::HandleClickNext() +{ + // nothing to do + + return true; +} + +bool CGUIDialogFirstTimeUseUpdateMessage::HandleClickBack() +{ + // nothing to do + + return true; +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseUpdateMessage.h b/xbmc/GUIDialogFirstTimeUseUpdateMessage.h new file mode 100644 index 00000000..bb4df8a2 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseUpdateMessage.h @@ -0,0 +1,32 @@ +#pragma once + +#include "GUIDialogFirstTimeUseBase.h" + +#ifdef HAS_EMBEDDED + +class CGUIDialogFirstTimeUseUpdateMessage : public CGUIDialogFirstTimeUseBase +{ +public: + + CGUIDialogFirstTimeUseUpdateMessage(); + virtual ~CGUIDialogFirstTimeUseUpdateMessage(); + + virtual bool OnAction(const CAction &action); + virtual bool OnMessage(CGUIMessage &message); + + void SetMessage(const CStdString& message); + void SetButtonLabel(const CStdString& buttonLabel); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + + CStdString m_message; + CStdString m_buttonLabel; +}; + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseUpdateProgress.cpp b/xbmc/GUIDialogFirstTimeUseUpdateProgress.cpp new file mode 100644 index 00000000..365084b8 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseUpdateProgress.cpp @@ -0,0 +1,191 @@ +#include "GUIDialogFirstTimeUseUpdateProgress.h" + +#ifdef HAS_EMBEDDED + +#include "GUILabelControl.h" +#include "GUIProgressControl.h" +#include "LocalizeStrings.h" +#include "log.h" + +#define CONTROL_TIME_LABEL 267 +#define CONTROL_PROGRESS 268 +#define CONTROL_PROGRESS_LABEL 269 + +CGUIDialogFirstTimeUseUpdateProgress::CGUIDialogFirstTimeUseUpdateProgress() : CGUIDialogFirstTimeUseBase(WINDOW_DIALOG_FTU_UPDATE_PROGRESS,"ftu_update_progress.xml","CGUIDialogFirstTimeUseUpdateProgress") +{ + m_Status = VUDS_IDLE; + m_downloadCounter = 0; +} + +CGUIDialogFirstTimeUseUpdateProgress::~CGUIDialogFirstTimeUseUpdateProgress() +{ + +} + +void CGUIDialogFirstTimeUseUpdateProgress::OnInitWindow() +{ + CGUIDialogFirstTimeUseBase::OnInitWindow(); + + m_Status = VUDS_IDLE; + UpdateDialog(); + + m_downloadCounter = 0; +} + +bool CGUIDialogFirstTimeUseUpdateProgress::OnAction(const CAction &action) +{ + if (action.id == ACTION_PREVIOUS_MENU || action.id == ACTION_PARENT_DIR) + { + // don't allow back in this dialog + + return true; + } + + return CGUIDialogFirstTimeUseBase::OnAction(action); +} + +void CGUIDialogFirstTimeUseUpdateProgress::Render() +{ + m_downloadCounter++; + if (m_downloadCounter % 60 == 0) + { + m_downloadCounter = 0; + + //////////////////////////////////////// + // check download status every second // + //////////////////////////////////////// + + UpdateDialog(); + } + + CGUIDialogFirstTimeUseBase::Render(); +} + +void CGUIDialogFirstTimeUseUpdateProgress::UpdateDialog() +{ + CDownloadInfo downloadnfo; + g_boxeeVersionUpdateManager.GetDownloadInfo(downloadnfo); + + CStdString label; + double percent = downloadnfo.m_CurrentDownloadProgress; + + m_Status = downloadnfo.m_Status; + switch(m_Status) + { + case VUDS_IDLE: + case VUDS_PRE_DOWNLOADING: + { + label = g_localizeStrings.Get(54735); + } + break; + case VUDS_DOWNLOADING: + { + if ((int)percent == 0) + { + label = g_localizeStrings.Get(54735); + } + else if ((downloadnfo.m_EstimatedTimeLeftMS / (60*1000)) > 1) + { + // more then a minutes + + CStdString str = g_localizeStrings.Get(54732); + label.Format(str.c_str(), downloadnfo.m_EstimatedTimeLeftMS / (60*1000)); + } + else + { + // less then a minutes + label = g_localizeStrings.Get(54733); + } + } + break; + case VUDS_POST_DOWNLOADING: + { + label = g_localizeStrings.Get(54654); + } + break; + case VUDS_FINISHED: + { + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseUpdateProgress::UpdateDialog - [downloadCounter=%ld] - [status=%d=VUDS_FINISHED] -> Close (initbox)",m_downloadCounter,(int)m_Status); + CGUIProgressControl* progressCtrl = (CGUIProgressControl*)GetControl(CONTROL_PROGRESS); + if (progressCtrl) + { + progressCtrl->SetPercentage(percent); + } + else + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseUpdateProgress::UpdateDialog - [downloadCounter=%ld] - [status=%d=VUDS_FINISHED] - FAILED to get CONTROL_PROGRESS in order to update [percent=%f%%] (initbox)",m_downloadCounter,(int)m_Status,percent); + } + + m_actionChoseEnum = CActionChose::NEXT; + Close(); + } + break; + case VUDS_FAILED: + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseUpdateProgress::UpdateDialog - [downloadCounter=%ld] - [status=%d=VUDS_FAILED] -> Close (initbox)",m_downloadCounter,(int)m_Status); + m_actionChoseEnum = CActionChose::NEXT; + Close(); + } + break; + default: + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseUpdateProgress::UpdateDialog - [downloadCounter=%ld] - UNKNOWN [status=%d] -> not handling (initbox)",m_downloadCounter,(int)m_Status); + } + break; + } + + CGUILabelControl* timeLabelCtrl = (CGUILabelControl*)GetControl(CONTROL_TIME_LABEL); + if (timeLabelCtrl) + { + timeLabelCtrl->SetLabel(label); + } + else + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseUpdateProgress::UpdateDialog - FAILED to get CONTROL_TIME_LABEL in order to update [label=%s] (initbox)",label.c_str()); + } + + CGUIProgressControl* progressCtrl = (CGUIProgressControl*)GetControl(CONTROL_PROGRESS); + if (progressCtrl) + { + progressCtrl->SetPercentage(percent); + } + else + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseUpdateProgress::UpdateDialog - FAILED to get CONTROL_PROGRESS in order to update [percent=%f%%] (initbox)",percent); + } + + CStdString percentStr = "%d%%"; + CStdString percentLabel; + percentLabel.Format(percentStr.c_str(),(int)percent); + CGUILabelControl* percentLabelCtrl = (CGUILabelControl*)GetControl(CONTROL_PROGRESS_LABEL); + if (percentLabelCtrl) + { + percentLabelCtrl->SetLabel(percentLabel); + } + else + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseUpdateProgress::UpdateDialog - FAILED to get CONTROL_PROGRESS_LABEL in order to update [percent=%s] (initbox)",percentLabel.c_str()); + } +} + +bool CGUIDialogFirstTimeUseUpdateProgress::HandleClickNext() +{ + // nothing to do + + return true; +} + +bool CGUIDialogFirstTimeUseUpdateProgress::HandleClickBack() +{ + // nothing to do + + return true; +} + +VERSION_UPDATE_DOWNLOAD_STATUS CGUIDialogFirstTimeUseUpdateProgress::GetDownloadStatus() +{ + return m_Status; +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseUpdateProgress.h b/xbmc/GUIDialogFirstTimeUseUpdateProgress.h new file mode 100644 index 00000000..5fbea679 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseUpdateProgress.h @@ -0,0 +1,37 @@ +#pragma once + +#include "GUIDialogFirstTimeUseBase.h" + +#ifdef HAS_EMBEDDED + +#include "BoxeeVersionUpdateManager.h" + +class CGUIDialogFirstTimeUseUpdateProgress : public CGUIDialogFirstTimeUseBase +{ +public: + + CGUIDialogFirstTimeUseUpdateProgress(); + virtual ~CGUIDialogFirstTimeUseUpdateProgress(); + + virtual bool OnAction(const CAction &action); + virtual void Render(); + + VERSION_UPDATE_DOWNLOAD_STATUS GetDownloadStatus(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + +private: + + void UpdateDialog(); + + VERSION_UPDATE_DOWNLOAD_STATUS m_Status; + unsigned long m_downloadCounter; + +}; + +#endif diff --git a/xbmc/GUIDialogFirstTimeUseWelcome.cpp b/xbmc/GUIDialogFirstTimeUseWelcome.cpp new file mode 100644 index 00000000..dcb6b41d --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseWelcome.cpp @@ -0,0 +1,40 @@ +#include "GUIDialogFirstTimeUseWelcome.h" +#include "BoxeeUtils.h" + +#ifdef HAS_EMBEDDED + +CGUIDialogFirstTimeUseWelcome::CGUIDialogFirstTimeUseWelcome() : CGUIDialogFirstTimeUseBase(WINDOW_DIALOG_FTU_WELCOME,"ftu_welcome.xml","CGUIDialogFirstTimeUseWelcome") +{ + +} + +CGUIDialogFirstTimeUseWelcome::~CGUIDialogFirstTimeUseWelcome() +{ + +} + +void CGUIDialogFirstTimeUseWelcome::OnInitWindow() +{ + CGUIDialogFirstTimeUseBase::OnInitWindow(); + + g_settings.SetSkinString(g_settings.TranslateSkinString("IsDlink"),strcmpi(BoxeeUtils::GetPlatformStr(),"dlink.dsm380") == 0 ? "1" : "0"); + + return; +} + +bool CGUIDialogFirstTimeUseWelcome::HandleClickNext() +{ + // nothing to do + + return true; +} + +bool CGUIDialogFirstTimeUseWelcome::HandleClickBack() +{ + // nothing to do + + return true; +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseWelcome.h b/xbmc/GUIDialogFirstTimeUseWelcome.h new file mode 100644 index 00000000..1ed6be18 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseWelcome.h @@ -0,0 +1,23 @@ +#pragma once + +#include "GUIDialogFirstTimeUseBase.h" + +#ifdef HAS_EMBEDDED + +class CGUIDialogFirstTimeUseWelcome : public CGUIDialogFirstTimeUseBase +{ +public: + + CGUIDialogFirstTimeUseWelcome(); + virtual ~CGUIDialogFirstTimeUseWelcome(); + +protected: + + virtual void OnInitWindow(); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + +}; + +#endif diff --git a/xbmc/GUIDialogFirstTimeUseWireless.cpp b/xbmc/GUIDialogFirstTimeUseWireless.cpp new file mode 100644 index 00000000..bb3d8a7b --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseWireless.cpp @@ -0,0 +1,394 @@ +#include "GUIDialogFirstTimeUseWireless.h" + +#ifdef HAS_EMBEDDED + +#include "GUIDialogAccessPoints.h" +#include "GUIWindowManager.h" +#include "Settings.h" +#include "GUIDialogYesNo2.h" +#include "GUIDialogOK2.h" +#include "LocalizeStrings.h" +#include "Util.h" +#include "log.h" +#include "SingleLock.h" + +#define CHECK_WIRELESS_NETWORKS_INTERVAL_IN_MS 5000 // 5 sec +#define SHOW_SEARCHING_LABEL_MIN_TIME_IN_SEC 2 // 2 sec + +CGUIDialogFirstTimeUseWireless::CGUIDialogFirstTimeUseWireless() : CGUIDialogFirstTimeUseWithList(WINDOW_DIALOG_FTU_WIRELESS,"ftu_wireless.xml","CGUIDialogFirstTimeUseWireless") +{ + m_bgprocess.SetName("ftu_searchwireless"); + m_bgprocess.Start(1); + m_wirelessNetworksVec.clear(); + m_currentNetworksLabelsSet.clear(); + m_needToLoadWirelessNetworksVec = false; + m_buttonSelected = 0; +} + +CGUIDialogFirstTimeUseWireless::~CGUIDialogFirstTimeUseWireless() +{ + m_bgprocess.Stop(); + + // note: scanBgJob is deleted by m_bgprocess +} + +void CGUIDialogFirstTimeUseWireless::OnInitWindow() +{ + SetProperty("show-list",true); + + CGUIDialogFirstTimeUseWithList::OnInitWindow(); + + // run background job for search wireless networks + scanBgJob = new CScanWirelessNetworksBG(this); + m_bgprocess.QueueJob(scanBgJob); + + m_buttonSelected = 0; +} + +void CGUIDialogFirstTimeUseWireless::OnDeinitWindow(int nextWindowID) +{ + if (scanBgJob) + { + scanBgJob->SignalStop(); + scanBgJob = NULL; + } +} + +bool CGUIDialogFirstTimeUseWireless::OnAction(const CAction &action) +{ + if (action.id == ACTION_PREVIOUS_MENU || action.id == ACTION_PARENT_DIR) + { + if (scanBgJob) + { + scanBgJob->SignalStop(); + scanBgJob = NULL; + } + } + + return CGUIDialogFirstTimeUseWithList::OnAction(action); +} + +bool CGUIDialogFirstTimeUseWireless::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int senderId = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseWireless::OnMessage - GUI_MSG_CLICKED - [buttonId=%d] (initbox)",senderId); + + switch (senderId) + { + case JOIN_OTHER_NETWORKS_BUTTON: + { + m_actionChoseEnum = CActionChose::NEXT; + m_buttonSelected = JOIN_OTHER_NETWORKS_BUTTON; + Close(); + return true; + } + break; + case SWITCH_TO_ETHERNET_BUTTON: + { + m_actionChoseEnum = CActionChose::NEXT; + m_buttonSelected = SWITCH_TO_ETHERNET_BUTTON; + Close(); + return true; + } + break; + } + } + } + + return CGUIDialogFirstTimeUseWithList::OnMessage(message); +} + +int CGUIDialogFirstTimeUseWireless::GetChoiceSelected() +{ + return m_buttonSelected; +} + +void CGUIDialogFirstTimeUseWireless::Render() +{ + if (m_needToLoadWirelessNetworksVec) + { + m_needToLoadWirelessNetworksVec = false; + LoadList(); + } + + CGUIDialogFirstTimeUseWithList::Render(); +} + +CStdString CGUIDialogFirstTimeUseWireless::GetSelectedWirelessName() +{ + CStdString SelectedWirelessName = ""; + + if (m_selectedItem.get()) + { + SelectedWirelessName = m_selectedItem->GetLabel(); + } + else + { + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseWireless::GetSelectedWirelessName - SelectedItem is EMPTY (initbox)"); + } + + return SelectedWirelessName; +} + +bool CGUIDialogFirstTimeUseWireless::HandleClickNext() +{ + // nothing to do + + return true; +} + +bool CGUIDialogFirstTimeUseWireless::HandleClickBack() +{ + // nothing to do + + return true; +} + +bool CGUIDialogFirstTimeUseWireless::HandleListChoice() +{ + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseWireless::HandleListChoice - [SelectedItem=%s] (initbox)",m_selectedItem->GetLabel().c_str()); + + return true; +} + +bool CGUIDialogFirstTimeUseWireless::FillListOnInit() +{ + m_wirelessNetworksVec.clear(); + m_currentNetworksLabelsSet.clear(); + m_needToLoadWirelessNetworksVec = false; + + // get the current wireless networks + // this variable is static because this object could be deleted + // before the the bg scan job is done + static std::vector wirelessNetworksVec; + wirelessNetworksVec.clear(); + + CWirelessScanBG* pJob = new CWirelessScanBG(wirelessNetworksVec); + CUtil::RunInBG(pJob); + + SetWirelessNetworksVec(wirelessNetworksVec); + LoadList(); + m_needToLoadWirelessNetworksVec = false; + + return true; +} + +bool CGUIDialogFirstTimeUseWireless::LoadList() +{ + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseWireless::LoadList - Enter function (initbox)"); + + // get the current selected item label + CStdString selectedLabel = ""; + CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), LIST_CTRL); + OnMessage(msg); + int index = msg.GetParam1(); + + if (index >= 0 && index < m_listItems.Size()) + { + selectedLabel = m_listItems.Get(index)->GetLabel(); + } + + // clear list before bind new items + CGUIMessage message1(GUI_MSG_LABEL_RESET, GetID(), LIST_CTRL); + OnMessage(message1); + m_listItems.Clear(); + m_selectedIndex = -1; + + std::vector wirelessNetworksVec; + GetWirelessNetworksVec(wirelessNetworksVec); + + if ((int)wirelessNetworksVec.size() < 1) + { + SetProperty("show-list",false); + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseWireless::LoadList - Got [%d] wireless networks (initbox)",(int)wirelessNetworksVec.size()); + + SET_CONTROL_FOCUS(255,0); + } + else + { + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseWireless::FillList - Succeeded to find wireless networks. [NumOfWirelessNetworks=%d] (initbox)",(int)wirelessNetworksVec.size()); + + for (int i=0; i<(int)wirelessNetworksVec.size(); i++) + { + CHalWirelessNetwork wn = wirelessNetworksVec[i]; + CFileItemPtr wnItem(new CFileItem(wn.ssid)); + + wnItem->SetProperty("wln-ssid",wn.ssid); + wnItem->SetProperty("wln-secure",wn.secure); + wnItem->SetProperty("wln-signal_strength",wn.signal_strength); + + int signalStrength = wn.signal_strength; + if (signalStrength <= 33) + { + wnItem->SetProperty("signalstrength","ap-signal1.png"); + wnItem->SetProperty("signalstrength-on","ap-signal1-on.png"); + } + else if (signalStrength <= 66) + { + wnItem->SetProperty("signalstrength","ap-signal2.png"); + wnItem->SetProperty("signalstrength-on","ap-signal2-on.png"); + } + else + { + wnItem->SetProperty("signalstrength","ap-signal3.png"); + wnItem->SetProperty("signalstrength-on","ap-signal3-on.png"); + } + + if (wn.secure) + { + wnItem->SetProperty("secure","ap-lock.png"); + wnItem->SetProperty("secure-on","ap-lock-on.png"); + } + + m_listItems.Add(wnItem); + } + + SetProperty("show-list",true); + + // bind new items + CGUIMessage message2(GUI_MSG_LABEL_BIND, GetID(), LIST_CTRL, 0, 0, &m_listItems); + OnMessage(message2); + + // set last focused item + if (!selectedLabel.IsEmpty()) + { + for (int i=0; iGetLabel()) + { + CGUIMessage message(GUI_MSG_ITEM_SELECT, GetID(), LIST_CTRL, i); + OnMessage(message); + break; + } + } + } + } + + CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseWireless::LoadList - Exit function. [NumOfWirelessNetworks=%d] (initbox)",m_listItems.Size()); + + return true; +} + +void CGUIDialogFirstTimeUseWireless::SetWirelessNetworksVec(const std::vector& wirelessNetworksVec) +{ + bool updateNetworks = m_currentNetworksLabelsSet.empty() ? true : false; + + for (int i=0; !updateNetworks && i<(int)wirelessNetworksVec.size(); i++) + { + if (m_currentNetworksLabelsSet.find(wirelessNetworksVec[i].ssid) == m_currentNetworksLabelsSet.end()) + { + updateNetworks = true; + } + } + + if (updateNetworks) + { + CSingleLock lock(m_lock); + m_wirelessNetworksVec = wirelessNetworksVec; + m_needToLoadWirelessNetworksVec = true; + + m_currentNetworksLabelsSet.clear(); + for (int i=0; i<(int)wirelessNetworksVec.size(); i++) + { + m_currentNetworksLabelsSet.insert(m_wirelessNetworksVec[i].ssid); + } + } +} + +void CGUIDialogFirstTimeUseWireless::GetWirelessNetworksVec(std::vector& wirelessNetworksVec) +{ + CSingleLock lock(m_lock); + wirelessNetworksVec = m_wirelessNetworksVec; +} + +CGUIDialogFirstTimeUseWireless::CScanWirelessNetworksBG::CScanWirelessNetworksBG(CGUIDialogFirstTimeUseWireless* pHandler) : BXBGJob("ScanWirelessNetworksJob") +{ + m_pLock = SDL_CreateMutex(); + m_pSleepCond = SDL_CreateCond(); + + m_pHandler = pHandler; + m_shouldStop = false; +} + +CGUIDialogFirstTimeUseWireless::CScanWirelessNetworksBG::~CScanWirelessNetworksBG() +{ + if (m_pSleepCond) + { + SDL_DestroyCond(m_pSleepCond); + } + + if (m_pLock) + { + SDL_DestroyMutex(m_pLock); + } +} + +void CGUIDialogFirstTimeUseWireless::CScanWirelessNetworksBG::SignalStop() +{ + m_shouldStop = true; + SDL_CondSignal(m_pSleepCond); +} + +void CGUIDialogFirstTimeUseWireless::CScanWirelessNetworksBG::DoWork() +{ + if (!m_pHandler) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseWireless::CScanWirelessNetworksBG::Run - FAILED to execute because pHandler is NULL (wireless)"); + m_shouldStop = true; + return; + } + + while (1) + { + SDL_LockMutex(m_pLock); + if (SDL_CondWaitTimeout(m_pSleepCond, m_pLock, CHECK_WIRELESS_NETWORKS_INTERVAL_IN_MS) == -1) + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseWireless::CScanWirelessNetworksBG::Run - Woke up with an error (wireless)"); + } + + if (m_shouldStop) + { + break; + } + + time_t startScan = time(NULL); + + m_pHandler->SetProperty("is-searching",true); + + std::vector wirelessNetworksVec; + bool succeeded = CHalServicesFactory::GetInstance().SearchWireless(0, wirelessNetworksVec); + + time_t stopScan = time(NULL); + + // show the searching label for SHOW_SEARCHING_LABEL_MIN_TIME_IN_SEC + long diffTime = stopScan - startScan; + if (diffTime < SHOW_SEARCHING_LABEL_MIN_TIME_IN_SEC) + { + sleep(SHOW_SEARCHING_LABEL_MIN_TIME_IN_SEC - diffTime); + } + + m_pHandler->SetProperty("is-searching",false); + + if (m_shouldStop) + { + break; + } + + if (succeeded) + { + m_pHandler->SetWirelessNetworksVec(wirelessNetworksVec); + } + else + { + CLog::Log(LOGERROR,"CGUIDialogFirstTimeUseWireless::CScanWirelessNetworksBG::Run - FAILED to get wireless networks (wireless)"); + } + } +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseWireless.h b/xbmc/GUIDialogFirstTimeUseWireless.h new file mode 100644 index 00000000..561c8862 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseWireless.h @@ -0,0 +1,79 @@ +#pragma once + +#include "GUIDialogFirstTimeUseWithList.h" + +#ifdef HAS_EMBEDDED + +#include "HalServices.h" +#include "lib/libBoxee/bxbgprocess.h" + +#include + +#define JOIN_OTHER_NETWORKS_BUTTON 255 +#define SWITCH_TO_ETHERNET_BUTTON 275 + +class CGUIDialogFirstTimeUseWireless : public CGUIDialogFirstTimeUseWithList +{ +public: + + CGUIDialogFirstTimeUseWireless(); + virtual ~CGUIDialogFirstTimeUseWireless(); + + virtual bool OnMessage(CGUIMessage &message); + + virtual void Render(); + + CStdString GetSelectedWirelessName(); + + int GetChoiceSelected(); + +protected: + + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + + virtual bool OnAction(const CAction &action); + + virtual bool HandleClickNext(); + virtual bool HandleClickBack(); + + virtual bool FillListOnInit(); + virtual bool LoadList(); + virtual bool HandleListChoice(); + + void SetWirelessNetworksVec(const std::vector& wirelessNetworksVec); + void GetWirelessNetworksVec(std::vector& wirelessNetworksVec); + +private: + + class CScanWirelessNetworksBG : public BOXEE::BXBGJob + { + public: + CScanWirelessNetworksBG(CGUIDialogFirstTimeUseWireless* pHandler); + virtual ~CScanWirelessNetworksBG(); + virtual void DoWork(); + + void SignalStop(); + + private: + + SDL_cond* m_pSleepCond; + SDL_mutex* m_pLock; + + bool m_shouldStop; + CGUIDialogFirstTimeUseWireless* m_pHandler; + }; + + int m_buttonSelected; + + CCriticalSection m_lock; + CScanWirelessNetworksBG* scanBgJob; + + std::vector m_wirelessNetworksVec; + std::set m_currentNetworksLabelsSet; + bool m_needToLoadWirelessNetworksVec; + BOXEE::BXBGProcess m_bgprocess; +}; + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseWithList.cpp b/xbmc/GUIDialogFirstTimeUseWithList.cpp new file mode 100644 index 00000000..520c26a5 --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseWithList.cpp @@ -0,0 +1,119 @@ +#include "GUIDialogFirstTimeUseWithList.h" + +#ifdef HAS_EMBEDDED + +#include "log.h" + +CGUIDialogFirstTimeUseWithList::CGUIDialogFirstTimeUseWithList(int id, const CStdString &xmlFile, const CStdString& name) : CGUIDialogFirstTimeUseBase(id,xmlFile,name) +{ + m_selectedIndex = -1; +} + +CGUIDialogFirstTimeUseWithList::~CGUIDialogFirstTimeUseWithList() +{ + +} + +void CGUIDialogFirstTimeUseWithList::OnInitWindow() +{ + CGUIDialogFirstTimeUseBase::OnInitWindow(); + + CGUIMessage message(GUI_MSG_LABEL_RESET, GetID(), LIST_CTRL); + OnMessage(message); + + m_selectedItem.reset(); + m_listItems.Clear(); + + if (FillListOnInit()) + { + CLog::Log(LOGDEBUG,"%s::OnInitWindow - After adding [NumOfItems=%d] to list (initbox)",m_name.c_str(),m_listItems.Size()); + } + else + { + // TODO: handle this case !!! + } + + if (m_selectedIndex >= 0 && m_selectedIndex < m_listItems.Size()) + { + m_selectedItem = m_listItems.Get(m_selectedIndex); + m_selectedItem->Select(true); + } +} + +bool CGUIDialogFirstTimeUseWithList::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int iControl = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"%s::OnMessage - GUI_MSG_CLICKED - [iControl=%d] (initbox)",m_name.c_str(),iControl); + + switch (iControl) + { + case LIST_CTRL: + { + // Get selected index from the list + CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), LIST_CTRL); + OnMessage(msg); + + m_selectedIndex = msg.GetParam1(); + + CLog::Log(LOGDEBUG,"%s::OnMessage - GUI_MSG_CLICKED - [ChoiceIndex=%d] (initbox)",m_name.c_str(),m_selectedIndex); + + if (m_selectedIndex < 0 || m_selectedIndex > m_listItems.Size() - 1) + { + CLog::Log(LOGERROR,"%s::OnMessage - GUI_MSG_CLICKED - FAILED to get [ChoiceIndex=%d]. [ListSize=%d] (initbox)",m_name.c_str(),m_selectedIndex,m_listItems.Size()); + return true; + } + + if (m_selectedItem.get()) + { + m_selectedItem->Select(false); + } + + m_selectedItem = m_listItems.Get(m_selectedIndex); + m_selectedItem->Select(true); + + if (!HandleListChoice()) + { + CLog::Log(LOGERROR,"%s::OnMessage - GUI_MSG_CLICKED - FAILED to handle list choice [ChoiceIndex=%d]. (initbox)",m_name.c_str(),m_selectedIndex); + return true; + } + + m_actionChoseEnum = CActionChose::NEXT; + Close(); + return true; + } + break; + } + } + break; + } + + return CGUIDialogFirstTimeUseBase::OnMessage(message); +} + +bool CGUIDialogFirstTimeUseWithList::HasSelectedItem() +{ + if (m_selectedItem.get()) + { + return true; + } + + return false; +} + +CFileItemPtr CGUIDialogFirstTimeUseWithList::GetSelectedItem() +{ + return m_selectedItem; +} + +int CGUIDialogFirstTimeUseWithList::GetSelectedIndex() +{ + return m_selectedIndex; +} + +#endif + diff --git a/xbmc/GUIDialogFirstTimeUseWithList.h b/xbmc/GUIDialogFirstTimeUseWithList.h new file mode 100644 index 00000000..07bd74aa --- /dev/null +++ b/xbmc/GUIDialogFirstTimeUseWithList.h @@ -0,0 +1,38 @@ +#pragma once + +#include "GUIDialogFirstTimeUseBase.h" + +#ifdef HAS_EMBEDDED + +#include "FileItem.h" + +#define LIST_CTRL 240 + +class CGUIDialogFirstTimeUseWithList : public CGUIDialogFirstTimeUseBase +{ +public: + + CGUIDialogFirstTimeUseWithList(int id, const CStdString& xmlFile, const CStdString& derivedClassStr); + virtual ~CGUIDialogFirstTimeUseWithList(); + + virtual bool OnMessage(CGUIMessage &message); + + bool HasSelectedItem(); + CFileItemPtr GetSelectedItem(); + int GetSelectedIndex(); + +protected: + + virtual void OnInitWindow(); + + virtual bool FillListOnInit() = 0; + virtual bool HandleListChoice() = 0; + + CFileItemPtr m_selectedItem; + CFileItemList m_listItems; + int m_selectedIndex; + +}; + +#endif + diff --git a/xbmc/GUIDialogWirelessAuthentication.cpp b/xbmc/GUIDialogWirelessAuthentication.cpp new file mode 100644 index 00000000..84dafb5a --- /dev/null +++ b/xbmc/GUIDialogWirelessAuthentication.cpp @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "GUIDialogWirelessAuthentication.h" + +#ifdef HAS_BOXEE_HAL + +#include "Application.h" +#include "FileItem.h" +#include "LocalizeStrings.h" + +#define CONTROL_AUTHS 3 + +static int nofAuths = 5; +static CHalWirelessAuthType auths[] = { AUTH_NONE, AUTH_WEP_PASSPHRASE, AUTH_WEP_KEY, AUTH_WPAPSK, AUTH_WPA2PSK }; +static const char* authStrs[] = { "None", "WEP 128-bit passphrase", "WEP 40-bit key", "WPA Personal", "WPA2 Personal" }; + +CGUIDialogWirelessAuthentication::CGUIDialogWirelessAuthentication(void) + : CGUIDialog(WINDOW_DIALOG_WIRELESS_AUTHENTICATION, "DialogWirelessAuthentication.xml") +{ +} + +CGUIDialogWirelessAuthentication::~CGUIDialogWirelessAuthentication(void) +{} + +bool CGUIDialogWirelessAuthentication::OnAction(const CAction &action) +{ + if (action.id == ACTION_SELECT_ITEM) + { + CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_AUTHS); + OnMessage(msg); + int iItem = msg.GetParam1(); + m_auth = auths[iItem]; + m_wasItemSelected = true; + + Close(); + + return true; + } + + return CGUIDialog::OnAction(action); +} + +void CGUIDialogWirelessAuthentication::OnInitWindow() +{ + m_wasItemSelected = false; + + CGUIDialog::OnInitWindow(); + + CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_AUTHS); + OnMessage(msgReset); + + int select = -1; + for (int i = 0; i < nofAuths; i++) + { + CFileItemPtr item(new CFileItem(authStrs[i])); + + CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_AUTHS, 0, 0, item); + OnMessage(msg); + + if (auths[i] == (int) m_auth) + { + select = i; + } + } + + if (select != -1) + { + CGUIMessage msg2(GUI_MSG_ITEM_SELECT, GetID(), CONTROL_AUTHS, select); + OnMessage(msg2); + } +} + +bool CGUIDialogWirelessAuthentication::WasItemSelected() +{ + return m_wasItemSelected; +} + +void CGUIDialogWirelessAuthentication::SetAuth(CHalWirelessAuthType auth) +{ + m_auth = auth; +} + +CHalWirelessAuthType CGUIDialogWirelessAuthentication::GetAuth() +{ + return m_auth; +} + +#endif + diff --git a/xbmc/GUIDialogWirelessAuthentication.h b/xbmc/GUIDialogWirelessAuthentication.h new file mode 100644 index 00000000..cee52e00 --- /dev/null +++ b/xbmc/GUIDialogWirelessAuthentication.h @@ -0,0 +1,56 @@ +#ifndef GUI_DIALOG_WIRELESS_AUTHENTICATION +#define GUI_DIALOG_WIRELESS_AUTHENTICATION + +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#pragma once + +#include "system.h" + +#ifdef HAS_BOXEE_HAL + +#include +#include "GUIDialog.h" +#include "HalServices.h" + +class CGUIDialogWirelessAuthentication : public CGUIDialog +{ +public: + CGUIDialogWirelessAuthentication(void); + virtual ~CGUIDialogWirelessAuthentication(void); + virtual void OnInitWindow(); + virtual bool OnAction(const CAction &action); + + bool WasItemSelected(); + + CHalWirelessAuthType GetAuth(); + void SetAuth(CHalWirelessAuthType auth); + +private: + CHalWirelessAuthType m_auth; + bool m_wasItemSelected; +}; + +#endif + +#endif + diff --git a/xbmc/GUIWebDialog.cpp b/xbmc/GUIWebDialog.cpp new file mode 100644 index 00000000..157232dc --- /dev/null +++ b/xbmc/GUIWebDialog.cpp @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + + +#include "GUIWebDialog.h" +#include "GUIWindowManager.h" +#include "guilib/GUIWebControl.h" + +#define WEB_CONTROL 1000 + +CGUIWebDialog::CGUIWebDialog(void) + : CGUIDialogBoxBase(WINDOW_DIALOG_WEB, "DialogWeb.xml") +{ +} + +CGUIWebDialog::~CGUIWebDialog(void) +{} + +bool CGUIWebDialog::OnAction(const CAction &action) +{ + if (action.id == ACTION_CLOSE_DIALOG || action.id == ACTION_PREVIOUS_MENU) + { + m_bConfirmed = false; + Close(); + return true; + } + + if (m_webControl->OnAction(action)) + return true; + + return CGUIDialogBoxBase::OnAction(action); +} + +void CGUIWebDialog::OnInitWindow() +{ + CGUIDialogBoxBase::OnInitWindow(); + + SetProperty("PassthroughKeys",true); + + m_webControl = (CGUIWebControl*) GetControl(WEB_CONTROL); + + if (m_webControl) + { + m_bLoading = true; + SetProperty("loading",m_bLoading); + m_webControl->LoadUrl(m_url); + m_webControl->SetVisible(false); + } + else + { + CLog::Log(LOGERROR,"CGUIWebDialog::OnInitWindow, there's no webcontrol [id=%d] defined in the skin. closing.",WEB_CONTROL); + Close(); + } +} + +void CGUIWebDialog::OnDeinitWindow(int nextWindowID) +{ + CGUIWindow::OnDeinitWindow(nextWindowID); +} + +void CGUIWebDialog::Render() +{ + if (m_webControl && m_webControl->isLoading() != m_bLoading) + { + m_bLoading = m_webControl->isLoading(); + SetProperty("loading",m_bLoading); + + if (!m_bLoading) + { + m_webControl->SetVisible(true); + } + } + + CGUIDialog::Render(); +} + +bool CGUIWebDialog::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_WINDOW_DEINIT: + { + if (message.GetSenderId() == WEB_CONTROL && message.GetParam1() == 0) + { + m_bConfirmed = true; + Close(); + return true; + } + } + break; + case GUI_MSG_SET_FILENAME: + { + SetURL(message.GetStringParam()); + return true; + } + break; + } + return CGUIDialogBoxBase::OnMessage(message); +} + +void CGUIWebDialog::SetURL(const CStdString& url) +{ + m_url = url; +} + +bool CGUIWebDialog::ShowAndGetInput(const CStdString& url) +{ + CLog::Log(LOGDEBUG,"CGUIWebDialog::ShowAndGetInput, going to open up the browsers at %s (wip)",url.c_str()); + CGUIWebDialog *dialog = (CGUIWebDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_WEB); + if (!dialog) + return false; + + dialog->SetURL(url); + dialog->DoModal(); + + return dialog->IsConfirmed(); +} diff --git a/xbmc/GUIWebDialog.h b/xbmc/GUIWebDialog.h new file mode 100644 index 00000000..821e5dd0 --- /dev/null +++ b/xbmc/GUIWebDialog.h @@ -0,0 +1,46 @@ +#pragma once + +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "GUIDialogBoxBase.h" +#include "GUIWebControl.h" + +class CGUIWebDialog : public CGUIDialogBoxBase +{ +public: + CGUIWebDialog(void); + virtual ~CGUIWebDialog(void); + virtual bool OnAction(const CAction &action); + virtual bool OnMessage(CGUIMessage& message); + static bool ShowAndGetInput(const CStdString& url); + virtual void Render(); + void SetURL(const CStdString &url); + virtual void OnInitWindow(); + +protected: + virtual void OnDeinitWindow(int nextWindowID); + +private: + CStdString m_url; + CGUIWebControl* m_webControl; + bool m_bLoading; +}; diff --git a/xbmc/GUIWindowBoxeeBrowseProduct.cpp b/xbmc/GUIWindowBoxeeBrowseProduct.cpp new file mode 100644 index 00000000..8c09513c --- /dev/null +++ b/xbmc/GUIWindowBoxeeBrowseProduct.cpp @@ -0,0 +1,175 @@ + +#include "GUIWindowBoxeeBrowseProduct.h" +#include "utils/log.h" +#include "GUIWindowManager.h" +#include "Util.h" +#include "LocalizeStrings.h" + +using namespace std; +using namespace BOXEE; + +//////////////////// +// CProductSource // +//////////////////// + +CProductSource::CProductSource(const CStdString& strName, const CStdString& strBasePath, int iWindowID) : CBrowseWindowSource(strName, strBasePath, iWindowID) +{ + +} + +CProductSource::~CProductSource() +{ + +} + +void CProductSource::AddStateParameters(std::map & mapOptions) +{ + mapOptions["remote"] = "true"; + mapOptions["product"] = m_productId; + + CBrowseWindowSource::AddStateParameters(mapOptions); +} + +void CProductSource::BindItems(CFileItemList& items) +{ + CLog::Log(LOGDEBUG,"CProductSource::BindItems - [SourceType=%d] - Enter function with [ItemListSize=%d] (pay)",GetProductSourceType(),items.Size()); + + items.Sort(SORT_METHOD_LABEL, SORT_ORDER_DESC); + return CBrowseWindowSource::BindItems(items); +} + +void CProductSource::SetProductId(const CStdString& productId) +{ + m_productId = productId; +} + +CStdString CProductSource::GetProductId() +{ + return m_productId; +} + +CProductSourceMovie::CProductSourceMovie(int iWindowID) : CProductSource("ProductSourceMovie", "boxee://movies/movies/", iWindowID) +{ + +} + +CProductSourceMovie::~CProductSourceMovie() +{ + +} + +CProductSourceType::ProductSourceTypeEnums CProductSourceMovie::GetProductSourceType() +{ + return CProductSourceType::MOVIE; +} + +CProductSourceTvShow::CProductSourceTvShow(int iWindowID) : CProductSource("ProductSourceMovie", "boxee://tvshows/tv/", iWindowID) +{ + +} + +CProductSourceTvShow::~CProductSourceTvShow() +{ + +} + +CProductSourceType::ProductSourceTypeEnums CProductSourceTvShow::GetProductSourceType() +{ + return CProductSourceType::TV_SHOW; +} + +///////////////////////// +// CProductWindowState // +///////////////////////// + +CProductWindowState::CProductWindowState(CGUIWindowBoxeeBrowse* pWindow) : CTvShowsWindowState(pWindow) +{ + m_sourceController.RemoveAllSources(); + m_sourceController.AddSource(new CProductSourceMovie(m_pWindow->GetID())); +} + +void CProductWindowState::SetCategory(const CStdString& strCategory) +{ + +} + +bool CProductWindowState::OnBack() +{ + CLog::Log(LOGDEBUG,"CProductWindowState::OnBack - Enter function (pay)"); + g_windowManager.PreviousWindow(); + return true; +} + +////////////////////////////////// +// CGUIWindowBoxeeBrowseProduct // +////////////////////////////////// + +CGUIWindowBoxeeBrowseProduct::CGUIWindowBoxeeBrowseProduct() : CGUIWindowBoxeeBrowseTvShows(WINDOW_BOXEE_BROWSE_PRODUCT, "boxee_browse_product.xml") +{ + SetWindowState(new CProductWindowState(this)); +} + +CGUIWindowBoxeeBrowseProduct::~CGUIWindowBoxeeBrowseProduct() +{ + +} + +void CGUIWindowBoxeeBrowseProduct::OnInitWindow() +{ + CLog::Log(LOGDEBUG,"CGUIWindowBoxeeBrowseProduct::OnInitWindow - Enter function (pay)"); + + g_windowManager.CloseDialogs(true); + + return CGUIWindowBoxeeBrowseTvShows::OnInitWindow(); +} + +bool CGUIWindowBoxeeBrowseProduct::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_WINDOW_INIT: + { + CLog::Log(LOGDEBUG,"CGUIWindowBoxeeBrowseProduct::OnMessage - GUI_MSG_WINDOW_INIT - Enter function. [NumOfStringParam=%d] (pay)",(int)message.GetNumStringParams()); + + // ProductBrowse screen has only one source + SourcesMap mapSources = ((CProductWindowState*)m_windowState)->GetSources(); + + CProductSource* productSource = (CProductSource*)mapSources.begin()->second; + if (!productSource) + { + CLog::Log(LOGERROR,"CGUIWindowBoxeeBrowseProduct::OnInitWindow - FAILED to get the ProductSource (pay)"); + Close(); + return false; + } + + CStdString productId = message.GetStringParam(0); + if (productId.IsEmpty()) + { + CLog::Log(LOGERROR,"CGUIWindowBoxeeBrowseProduct::OnInitWindow - FAILED to get productId from message. [ProductId=%s] (pay)",productId.c_str()); + Close(); + return false; + } + + productSource->SetProductId(productId); + + CStdString productName = message.GetStringParam(1); + if (productName.IsEmpty()) + { + CLog::Log(LOGERROR,"CGUIWindowBoxeeBrowseProduct::OnInitWindow - FAILED to get productName from message. [ProductName=%s] (pay)",productName.c_str()); + Close(); + return false; + } + + CStdString packageName = productName; + packageName += " "; + packageName += g_localizeStrings.Get(55111); + SetProperty("package-name",packageName); + + CLog::Log(LOGDEBUG,"CGUIWindowBoxeeBrowseProduct::OnMessage - GUI_MSG_WINDOW_INIT - After set source ProductId to [%s] (pay)",productSource->GetProductId().c_str()); + } + break; + } + + return CGUIWindowBoxeeBrowseTvShows::OnMessage(message); +} + diff --git a/xbmc/GUIWindowBoxeeBrowseProduct.h b/xbmc/GUIWindowBoxeeBrowseProduct.h new file mode 100644 index 00000000..a18dd846 --- /dev/null +++ b/xbmc/GUIWindowBoxeeBrowseProduct.h @@ -0,0 +1,90 @@ +#ifndef GUIWINDOWBOXEEBROWSEPRODUCT_H_ +#define GUIWINDOWBOXEEBROWSEPRODUCT_H_ + +#include "GUIWindowBoxeeBrowseTvShows.h" +#include "BoxeeServerDirectory.h" + +using namespace BOXEE; + +//////////////////// +// CProductSource // +//////////////////// + +class CProductSourceType +{ +public: + enum ProductSourceTypeEnums + { + TV_SHOW=0, + MOVIE=1, + NUM_OF_PRODUCT_SOURCE_TYPES=2, + UNKNOWN=3 + }; +}; + +class CProductSource : public CBrowseWindowSource +{ +public: + CProductSource(const CStdString& name, const CStdString& strBasePath, int iWindowID); + virtual ~CProductSource(); + virtual void AddStateParameters(std::map & mapOptions); + + virtual void BindItems(CFileItemList& items); + + void SetProductId(const CStdString& productId); + CStdString GetProductId(); + + virtual CProductSourceType::ProductSourceTypeEnums GetProductSourceType() = 0; + +protected: + + CStdString m_productId; +}; + +class CProductSourceMovie : public CProductSource +{ +public: + CProductSourceMovie(int iWindowID); + virtual ~CProductSourceMovie(); + + virtual CProductSourceType::ProductSourceTypeEnums GetProductSourceType(); +}; + +class CProductSourceTvShow : public CProductSource +{ +public: + CProductSourceTvShow(int iWindowID); + virtual ~CProductSourceTvShow(); + + virtual CProductSourceType::ProductSourceTypeEnums GetProductSourceType(); +}; + +///////////////////////// +// CProductWindowState // +///////////////////////// + +class CProductWindowState : public CTvShowsWindowState +{ +public: + CProductWindowState(CGUIWindowBoxeeBrowse* pWindow); + virtual ~CProductWindowState() {} + virtual void SetCategory(const CStdString& strCategory); + + virtual bool OnBack(); +}; + +////////////////////////////////// +// CGUIWindowBoxeeBrowseProduct // +////////////////////////////////// + +class CGUIWindowBoxeeBrowseProduct : public CGUIWindowBoxeeBrowseTvShows +{ +public: + CGUIWindowBoxeeBrowseProduct(); + virtual ~CGUIWindowBoxeeBrowseProduct(); + + virtual void OnInitWindow(); + virtual bool OnMessage(CGUIMessage& message); +}; + +#endif /*GUIWINDOWBOXEEBROWSEPRODUCT_H_*/ diff --git a/xbmc/GUIWindowBoxeeBrowseSimpleApp.cpp b/xbmc/GUIWindowBoxeeBrowseSimpleApp.cpp new file mode 100644 index 00000000..e572b7b6 --- /dev/null +++ b/xbmc/GUIWindowBoxeeBrowseSimpleApp.cpp @@ -0,0 +1,195 @@ +#include "GUIWindowBoxeeBrowseSimpleApp.h" +#include "utils/log.h" +#include "GUIWindowManager.h" +#include "GUIUserMessages.h" +#include "GUIDialogBoxeeMainMenu.h" +#include "Application.h" +#include "ItemLoader.h" + + +#define ITEM_SUMMARY 9018 +#define ITEM_SUMMARY_FLAG "item-summary" + + +CGUIBrowseSimpleAppState::CGUIBrowseSimpleAppState(CGUIWindowBoxeeBrowse *pWindow) : CBrowseWindowStateWithHistory(pWindow) +{ + +} + +CGUIBrowseSimpleAppState::~CGUIBrowseSimpleAppState() +{ + +} + +CBrowseWindowStateWithHistory* CGUIBrowseSimpleAppState::Clone() +{ + return (new CGUIBrowseSimpleAppState(m_pWindow)); +} + +bool CGUIBrowseSimpleAppState::OnBack() +{ + if (!CBrowseWindowStateWithHistory::OnBack()) + { + g_windowManager.PreviousWindow(); + return true; + } + return false; +} + +void CGUIBrowseSimpleAppState::SetStartingPath(const CStdString& strStartingPath) +{ + m_sourceController.SetNewSource(new CBrowseWindowSource("simpleappsource", strStartingPath, m_pWindow->GetID())); + CBrowseWindowStateHistory::ResetHistory(m_pWindow->GetID()); +} + +CStdString CGUIBrowseSimpleAppState::GetItemSummary() +{ + return m_strLabel; +} + +void CGUIBrowseSimpleAppState::Refresh(bool bResetSelected) +{ + CBrowseWindowStateWithHistory::Refresh(bResetSelected); + + m_pWindow->SetProperty( ITEM_SUMMARY_FLAG , GetItemSummary()); +} + +void CGUIBrowseSimpleAppState::OnPathChanged(CStdString strPath, bool bResetSelected) +{ + CBrowseWindowSource* source = new CBrowseWindowSource("simpleappsource", strPath, m_pWindow->GetID()); + + source->SetSortMethod(m_sourceController.GetSortMethod()); + + m_sourceController.SetNewSource(source); + + CBrowseWindowStateWithHistory::OnPathChanged(strPath,bResetSelected); +} + +////////////////////////////////////////////////////////////////////////////////////// + + + +CGUIWindowBoxeeBrowseSimpleApp::CGUIWindowBoxeeBrowseSimpleApp() : CGUIWindowBoxeeBrowse(WINDOW_BOXEE_BROWSE_SIMPLE_APP,"boxee_browse_simple_app.xml") +{ + SetWindowState(new CGUIBrowseSimpleAppState(this)); +} + +CGUIWindowBoxeeBrowseSimpleApp::~CGUIWindowBoxeeBrowseSimpleApp() +{ + +} + +void CGUIWindowBoxeeBrowseSimpleApp::Show(const CStdString &strPath, const CStdString &strLabel, const CStdString &strBackgroundImage, bool bResetHistory, const CStdString &strAppId) +{ + CLog::Log(LOGDEBUG,"CGUIWindowBoxeeBrowseSimpleApp::Show - enter function with [path=%s] (sapp)", strPath.c_str()); + + CGUIWindowBoxeeBrowseSimpleApp* pWindow = (CGUIWindowBoxeeBrowseSimpleApp*)g_windowManager.GetWindow(WINDOW_BOXEE_BROWSE_SIMPLE_APP); + + if (pWindow) + { + pWindow->ResetWindowState(strPath, strLabel, strBackgroundImage, bResetHistory); + pWindow->SetAppData(strAppId, strLabel); + g_windowManager.ActivateWindow(WINDOW_BOXEE_BROWSE_SIMPLE_APP); + } +} + + +void CGUIWindowBoxeeBrowseSimpleApp::SetAppData(const CStdString& strAppId, const CStdString& strAppName) +{ + m_strAppId = strAppId; + m_strAppName = strAppName; +} + +bool CGUIWindowBoxeeBrowseSimpleApp::HasAppData() +{ + return (!m_strAppId.IsEmpty()); +} + +void CGUIWindowBoxeeBrowseSimpleApp::SetItemWithAppData(CFileItem& item) +{ + item.SetProperty("appid",m_strAppId); + item.SetProperty("provider",m_strAppName); +} + +void CGUIWindowBoxeeBrowseSimpleApp::ResetAppData() +{ + m_strAppId.clear(); + m_strAppName.clear(); +} + +bool CGUIWindowBoxeeBrowseSimpleApp::OnBind(CGUIMessage& message) +{ + CLog::Log(LOGDEBUG,"CGUIWindowBoxeeBrowseSimpleApp::OnBind, sender = %d, control = %d (browse)", message.GetSenderId(), message.GetControlId()); + + SetProperty("loading", false); + + // Check if control id is 0, meaning that this message is from the item loader + // Otherwise this message is destined for the specific view control + if (message.GetPointer() && message.GetControlId() == 0) + { + CFileItemList *items = (CFileItemList *)message.GetPointer(); + + if (HasAppData()) + { + for (int i=0; iSize(); i++) + { + SetItemWithAppData(*((*items)[i])); + } + } + } + + return false; +} + +bool CGUIWindowBoxeeBrowseSimpleApp::OnMessage(CGUIMessage& message) +{ + switch ( message.GetMessage() ) + { + case GUI_MSG_SET_CONTAINER_PATH: + { + // Path was set by external source + CFileItem *pItem = (CFileItem *)message.GetPointer(); + message.SetPointer(NULL); + if (!pItem) + return true; + + if (!pItem->GetProperty("appid").IsEmpty()) + { + SetAppData(pItem->GetProperty("appid"), pItem->GetProperty("provider")); + } + else + { + ResetAppData(); + } + + //Handle the background image + if (pItem->HasProperty("BrowseBackgroundImage")) + { + CStdString strBackgroundImage = pItem->GetProperty("BrowseBackgroundImage"); + g_application.GetItemLoader().LoadBackgroundImage(GetID(), strBackgroundImage); + } + + //m_windowState->SetInitialPath(pItem->m_strPath); + m_windowState->InitState(); + + return true; + } + } + + //default + return CGUIWindowBoxeeBrowse::OnMessage(message); +} + +void CGUIWindowBoxeeBrowseSimpleApp::ResetWindowState(const CStdString &strPath, const CStdString &strLabel, const CStdString &strBackgroundImage, bool bResetHistory) +{ + ClearFileItems(); + if (bResetHistory) + ((CBrowseWindowStateWithHistory*)m_windowState)->ResetHistory(); + else + ((CBrowseWindowStateWithHistory*)m_windowState)->UpdateHistory(); + + // Configuration of the browse window is initialized using specific type string such as "video", "music", or "pictures" + ((CGUIBrowseSimpleAppState*)m_windowState)->SetStartingPath(strPath); + + m_windowState->SetLabel(strLabel); +} diff --git a/xbmc/GUIWindowBoxeeBrowseSimpleApp.h b/xbmc/GUIWindowBoxeeBrowseSimpleApp.h new file mode 100644 index 00000000..cef87b9f --- /dev/null +++ b/xbmc/GUIWindowBoxeeBrowseSimpleApp.h @@ -0,0 +1,56 @@ +#ifndef _GUIWINDOWBOXEEBROWSESIMPLEAPP_H +#define _GUIWINDOWBOXEEBROWSESIMPLEAPP_H + +#include "GUIWindowBoxeeBrowse.h" + +class CGUIBrowseSimpleAppState : public CBrowseWindowStateWithHistory +{ +public: + CGUIBrowseSimpleAppState(CGUIWindowBoxeeBrowse* pWindow); + virtual ~CGUIBrowseSimpleAppState(); + + //virtual CStdString CreatePath(); + virtual CBrowseWindowStateWithHistory* Clone(); + virtual bool OnBack(); + + // Function is responsible for setting the starting path + // that is provided during window activation + void SetStartingPath(const CStdString& strStartingPath); + virtual CStdString GetItemSummary(); + virtual void Refresh(bool bResetSelected = false); + + void OnPathChanged(CStdString strPath, bool bResetSelected); +}; + + +/////////////////////////////////////////////////////////////////////////////////////// + + +class CGUIWindowBoxeeBrowseSimpleApp : public CGUIWindowBoxeeBrowse +{ +public: + CGUIWindowBoxeeBrowseSimpleApp(); + virtual ~CGUIWindowBoxeeBrowseSimpleApp(); + + static void Show(const CStdString &strPath, const CStdString &strLabel = "", const CStdString &strBackgroundImage = "",bool bResetHistory = true, const CStdString &strAppId = ""); + void SetAppData(const CStdString& strAppId, const CStdString& strAppName); + virtual bool OnMessage(CGUIMessage& message); + + void ResetWindowState(const CStdString &strPath, const CStdString &strLabel, const CStdString &strBackgroundImage, bool bResetHistory); + +protected: + virtual bool OnBind(CGUIMessage& message); + +private: + + bool HasAppData(); + void ResetAppData(); + + void SetItemWithAppData(CFileItem& item); + + // if m_strAppId is set - then the browse screen was activated from an app. + CStdString m_strAppId; + CStdString m_strAppName; +}; + +#endif diff --git a/xbmc/GUIWindowBoxeeLiveTv.cpp b/xbmc/GUIWindowBoxeeLiveTv.cpp new file mode 100755 index 00000000..79c8b8b9 --- /dev/null +++ b/xbmc/GUIWindowBoxeeLiveTv.cpp @@ -0,0 +1,469 @@ +#include "GUIWindowBoxeeLiveTv.h" + +#ifdef HAS_DVB + +#include +#include "GUIWindowManager.h" +#include "Application.h" +#include "GUIInfoManager.h" +#include "cores/dvb/dvbmanager.h" +#include "cores/dvb/epgstore.h" +#include "LocalizeStrings.h" +#include "GUISettings.h" +#include "utils/log.h" +#include "guilib/GUIListContainer.h" +#include "utils/TimeUtils.h" +#include "CPUInfo.h" +#include "VideoReferenceClock.h" +#include "GUIDialogBoxeeLiveTvCtx.h" +#include "GUIDialogBoxeeShare.h" +#include "GUIDialogBoxeeExitVideo.h" + +#ifdef HAS_INTEL_SMD +#include "IntelSMDGlobals.h" +#endif +#ifdef HAS_VIDEO_PLAYBACK +#include "cores/VideoRenderers/RenderManager.h" +#endif +#ifdef __APPLE__ +static CLinuxResourceCounter m_resourceCounter; +#endif + +using namespace BOXEE; + +#define REPORT_PROGRAM_WATCHED (3 * 60 * 1000) +#define SHOW_INFO_DURATION (5) + +#define BLUE_BAR 9 +#define LABEL_ROW1 10 +#define LABEL_ROW2 11 +#define LABEL_ROW3 12 +#define GROUP_QUICK_OSD 30 +#define GROUP_OSD 40 +#define GROUP_INFO 50 +#define LIST_OSD_BUTTONS 9150 +#define BUTTON_GUIDE 9001 +#define BUTTON_INFO 9002 +#define BUTTON_SHARE 9003 + +//#define ENABLE_AUTO_CHANNEL_SWITCH // switch channels every AUTO_SWITCH_INTERVAL ms +#define AUTO_SWITCH_INTERVAL 10000 // ms + +CGUIWindowBoxeeLiveTv::CGUIWindowBoxeeLiveTv() : CGUIWindow(WINDOW_BOXEE_LIVETV, "boxee_livetv_window.xml") +{ +} + +CGUIWindowBoxeeLiveTv::~CGUIWindowBoxeeLiveTv() +{ +} + +void CGUIWindowBoxeeLiveTv::OnInitWindow() +{ + CGUIWindow::OnInitWindow(); + + CFileItem urlItem("start dvb"); + urlItem.SetProperty("FastPlayerStart", true); + urlItem.SetProperty("DisableBoxeeUI", true); + urlItem.m_strPath += "dvb://"; + g_application.PlayMedia(urlItem); + + g_graphicsContext.SetFullScreenVideo(true); + g_Windowing.ClearBuffers(0, 0, 0, 1.0); + + m_reportToServer = g_guiSettings.GetBool("ota.share"); + if (m_reportToServer) + m_programWatchedTimer.StartZero(); + else + m_programWatchedTimer.Stop(); + + m_osdTimer.StartZero(); +#ifdef ENABLE_AUTO_CHANNEL_SWITCH + m_autoChannelSwitch.StartZero(); +#endif + + ShowQuickOSD(); +} + +void CGUIWindowBoxeeLiveTv::OnDeinitWindow(int nextWindowID) +{ + g_application.StopPlaying(); + g_graphicsContext.SetFullScreenVideo(false); + + g_windowManager.CloseDialogs(true); + + CGUIWindow::OnDeinitWindow(nextWindowID); +} + +bool CGUIWindowBoxeeLiveTv::SwitchChannel(int channelId) +{ + DvbChannelPtr ch = DVBManager::GetInstance().GetChannels().GetChannelByIndex(channelId); + if (ch.get() == NULL) + { + CLog::Log(LOGERROR, "CGUIWindowBoxeeLiveTv::SwitchChannel - invalid channel id [%d] (ltvc)", channelId); + return false; + } + + // save the selected channel inside the manager + DVBManager::GetInstance().SetCurrentChannel(ch); + + CAction action; + action.id = ACTION_CHANNEL_SWITCH; + action.amount1 = channelId; + + if(g_application.m_pPlayer) + g_application.m_pPlayer->OnAction(action); + + g_windowManager.GetWindow(g_windowManager.GetActiveWindow())->OnAction(action); + + return true; +} + +bool CGUIWindowBoxeeLiveTv::SwitchRelativeChannel(int direction) +{ + DvbChannels& channels = DVBManager::GetInstance().GetChannels(); + int currentPlayingId = DVBManager::GetInstance().GetCurrentChannel()->GetIndex(); + int nextPlayingId = currentPlayingId; + + do + { + nextPlayingId += direction; + + if (nextPlayingId == (int) channels.Size()) + nextPlayingId = 0; + + if (nextPlayingId == -1) + nextPlayingId = channels.Size() - 1; + } while (!channels.GetChannelByIndex(nextPlayingId)->IsEnabled() && nextPlayingId != currentPlayingId); + + return SwitchChannel(nextPlayingId); +} + +void CGUIWindowBoxeeLiveTv::Render() +{ + CGUIWindow::Render(); + + // If the elapsed time has passed and a channel is watched, notify the server + if (m_reportToServer && m_programWatchedTimer.IsRunning() && m_programWatchedTimer.GetElapsedMilliseconds() > REPORT_PROGRAM_WATCHED) + { + // Notify the server + DVBManager::GetInstance().ReportCurrentChannelToServerInBG(); + + // Reset the timer, report back again in a few minutes + m_programWatchedTimer.Reset(); + } + + if (m_osdTimer.IsRunning() && m_osdTimer.GetElapsedSeconds() > SHOW_INFO_DURATION) + { + SET_CONTROL_HIDDEN(GROUP_QUICK_OSD); + SET_CONTROL_HIDDEN(GROUP_OSD); + m_osdTimer.Stop(); + } + +#ifdef ENABLE_AUTO_CHANNEL_SWITCH + if(m_autoChannelSwitch.GetElapsedMilliseconds() > AUTO_SWITCH_INTERVAL) + { + SwitchRelativeChannel(1); + m_autoChannelSwitch.StartZero(); + } +#endif + + if (!DVBManager::GetInstance().IsDongleInserted()) + { + CLog::Log(LOGINFO, "CGUIWindowBoxeeLiveTv::Render: dongle disconnected. stopping playback"); + + g_application.StopPlaying(); + Close(); + } +} + +bool CGUIWindowBoxeeLiveTv::OnAction(const CAction &action) +{ + switch (action.id) + { + case ACTION_PREVIOUS_MENU: + { + if (GetControl(GROUP_INFO)->IsVisible()) + { + SET_CONTROL_HIDDEN(GROUP_INFO); + } + else if (GetControl(GROUP_OSD)->IsVisible()) + { + SET_CONTROL_HIDDEN(GROUP_OSD); + SET_CONTROL_HIDDEN(GROUP_QUICK_OSD); + } + else + { + bool shouldClose = true; + bool showExitDialog = g_guiSettings.GetBool("ota.showmessagewhenexit"); + if (showExitDialog && !CGUIDialogBoxeeExitVideo::ShowAndGetInput()) + { + shouldClose = false; + } + + if (shouldClose) + { + g_application.StopPlaying(); + g_windowManager.PreviousWindow(); + } + } + return true; + } + break; + + case ACTION_MOVE_UP: + { + if (GetControl(GROUP_INFO)->IsVisible()) + { + return true; + } + else if (!GetControl(GROUP_OSD)->IsVisible()) + { + return SwitchRelativeChannel(1); + } + } + break; + + case ACTION_MOVE_DOWN: + { + if (GetControl(GROUP_INFO)->IsVisible()) + { + return true; + } + else if (!GetControl(GROUP_OSD)->IsVisible()) + { + return SwitchRelativeChannel(-1); + } + } + break; + + case ACTION_MOVE_LEFT: + case ACTION_MOVE_RIGHT: + { + if (GetControl(GROUP_INFO)->IsVisible()) + { + return true; + } + else if (!GetControl(GROUP_OSD)->IsVisible()) + { + ShowEPG(); + return true; + } + } + break; + + case ACTION_SELECT_ITEM: + { + if (GetControl(GROUP_INFO)->IsVisible()) + { + return true; + } + else if (!GetControl(GROUP_OSD)->IsVisible()) + { + ShowOSD(); + return true; + } + } + break; + + case ACTION_CHANNEL_SWITCH: + { + ShowQuickOSD(); + return true; + } + break; + + default: + break; + }; + + return CGUIWindow::OnAction(action); +} + +bool CGUIWindowBoxeeLiveTv::OnMessage(CGUIMessage &message) +{ + if (message.GetMessage() != GUI_MSG_CLICKED || message.GetParam1() != ACTION_SELECT_ITEM) + return CGUIWindow::OnMessage(message);; + + switch (message.GetSenderId()) + { + case BUTTON_GUIDE: + ShowEPG(); + return true; + break; + + case BUTTON_INFO: + ShowInfo(); + return true; + break; + + case BUTTON_SHARE: + ShowShare(); + return true; + break; + } + + return CGUIWindow::OnMessage(message); +} + +void CGUIWindowBoxeeLiveTv::ShowEPG() +{ + SET_CONTROL_HIDDEN(GROUP_QUICK_OSD); + SET_CONTROL_HIDDEN(GROUP_OSD); + m_osdTimer.Stop(); + + CGUIDialogBoxeeLiveTvCtx* pDlgLiveTvCtx = (CGUIDialogBoxeeLiveTvCtx*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_LIVETV_CTX); + if (!pDlgLiveTvCtx) + { + CLog::Log(LOGERROR,"CGUIWindowBoxeeLiveTv::ShowOSD - FAILED to get BOXEE_LIVETV_CTX object (ltvc)"); + return; + } + + pDlgLiveTvCtx->DoModal(); +} + +void CGUIWindowBoxeeLiveTv::ShowQuickOSD() +{ + SET_CONTROL_VISIBLE(GROUP_QUICK_OSD); + m_osdTimer.StartZero(); +} + +void CGUIWindowBoxeeLiveTv::ShowOSD() +{ + SET_CONTROL_VISIBLE(GROUP_QUICK_OSD); + SET_CONTROL_VISIBLE(GROUP_OSD); + SET_CONTROL_FOCUS(LIST_OSD_BUTTONS, 0); + m_osdTimer.StartZero(); +} + +void CGUIWindowBoxeeLiveTv::ShowInfo() +{ + SET_CONTROL_VISIBLE(GROUP_INFO); +} + +void CGUIWindowBoxeeLiveTv::ShowShare() +{ + CGUIDialogBoxeeShare *pShare = (CGUIDialogBoxeeShare *)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_SHARE); + + if (pShare) + { + LiveTvModelProgram currentProgram = DVBManager::GetInstance().GetCurrentProgram(); + CStdString shareLabel = currentProgram.info.title; + if (currentProgram.info.episodeTitle.length()) + { + shareLabel += ": "; + shareLabel += currentProgram.info.episodeTitle; + } + + CFileItem shareItem(shareLabel); + shareItem.SetProperty("livetv", true); + if (currentProgram.info.IsInfoFromServer()) + shareItem.SetProperty("program_id", currentProgram.info.id); + pShare->SetItem(&shareItem); + pShare->DoModal(); + } +} + +void CGUIWindowBoxeeLiveTv::RenderFullScreen() +{ + g_graphicsContext.Clear(); + + g_graphicsContext.ApplyGuiTransform(); + Render(); + RenderCodecInfo(); + + g_graphicsContext.RestoreGuiTransform(); +} + +void CGUIWindowBoxeeLiveTv::RenderCodecInfo() +{ + bool bShowCodec = g_infoManager.GetBool(PLAYER_SHOWCODEC); + + if (bShowCodec) + { + SET_CONTROL_VISIBLE(LABEL_ROW1); + SET_CONTROL_VISIBLE(LABEL_ROW2); + SET_CONTROL_VISIBLE(LABEL_ROW3); + SET_CONTROL_VISIBLE(BLUE_BAR); + } + else + { + SET_CONTROL_HIDDEN(LABEL_ROW1); + SET_CONTROL_HIDDEN(LABEL_ROW2); + SET_CONTROL_HIDDEN(LABEL_ROW3); + SET_CONTROL_HIDDEN(BLUE_BAR); + } + + if (bShowCodec && g_application.m_pPlayer) + { + // show audio codec info + CStdString strAudio, strVideo, strGeneral; + g_application.m_pPlayer->GetAudioInfo(strAudio); + { + CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW1); + msg.SetLabel(strAudio); + OnMessage(msg); + } + // show video codec info + g_application.m_pPlayer->GetVideoInfo(strVideo); + { + CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW2); + msg.SetLabel(strVideo); + OnMessage(msg); + } + // show general info + g_application.m_pPlayer->GetGeneralInfo(strGeneral); + { + CStdString strGeneralFPS; + CStdString strCores = g_cpuInfo.GetCoresUsageString(); + + int missedvblanks; + int refreshrate; + double clockspeed; + CStdString strClock; + + if (g_VideoReferenceClock.GetClockInfo(missedvblanks, clockspeed, refreshrate)) + strClock.Format("S( refresh:%i missed:%i speed:%+.3f%% %s )" + , refreshrate + , missedvblanks + , clockspeed - 100.0 + , g_renderManager.GetVSyncState().c_str()); + + strGeneralFPS.Format("%s\nW( fps:%02.2f %s ) %s" + , strGeneral.c_str() + , g_infoManager.GetFPS() + , strCores.c_str(), strClock.c_str() ); + + CStdString playerTimeStr; + __int64 playerTime = g_application.m_pPlayer->GetTime(); + StringUtils::MilisecondsToTimeString((int)playerTime, playerTimeStr); + + static CStdString strDvb; + static Uint32 lastCheck = 0; + static DvbTunerTechnicalInfo info; + + Uint32 now = SDL_GetTicks(); + if (now - lastCheck > 1000) + { + lastCheck = now; + + std::vector tuners = DVBManager::GetInstance().GetTuners(); + if (tuners.size()) + info = tuners[0]->GetTechnicalInfo(); + } + + strDvb.Format("Status: 0x%x Signal: %lu SNR: %lu BER: %lu UCB: %lu", + info.fe_status, info.signal, info.snr, info.ber, info.ucb); + + strGeneralFPS.Format("LiveTV: %s %s %s" + , playerTimeStr.c_str() + , strCores.c_str() + , strDvb.c_str()); + + CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW3); + msg.SetLabel(strGeneralFPS); + OnMessage(msg); + } + } +} +#endif + diff --git a/xbmc/GUIWindowBoxeeLiveTv.h b/xbmc/GUIWindowBoxeeLiveTv.h new file mode 100755 index 00000000..bdba9250 --- /dev/null +++ b/xbmc/GUIWindowBoxeeLiveTv.h @@ -0,0 +1,50 @@ +#ifndef GUIWINDOWBOXEELIVETV_H +#define GUIWINDOWBOXEELIVETV_H + +#include "system.h" + +#ifdef HAS_DVB + +#include "LiveTvModel.h" +#include "GUIWindow.h" +#include "FileItem.h" + +class CGUIWindowBoxeeLiveTv : public CGUIWindow +{ +public: + CGUIWindowBoxeeLiveTv(); + virtual ~CGUIWindowBoxeeLiveTv(); + virtual bool OnAction(const CAction &action); + virtual bool OnMessage(CGUIMessage &message); + virtual void Render(); + void RenderFullScreen(); + + static bool SwitchChannel(int channel_id); + +protected: + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + bool SwitchRelativeChannel(int direction); + +private: + void ShowQuickOSD(); // upper part + void ShowOSD(); // lower part + void ShowEPG(); + void ShowInfo(); + void ShowShare(); + void RenderCodecInfo(); + + CStopWatch m_programWatchedTimer; + CStopWatch m_osdTimer; +#ifdef ENABLE_AUTO_CHANNEL_SWITCH + CStopWatch m_autoChannelSwitch; +#endif + + bool m_reportToServer; +}; + + +#endif + +#endif // GUIWINDOWBOXEELIVETV_H + diff --git a/xbmc/GUIWindowBoxeeSettingsDevices.cpp b/xbmc/GUIWindowBoxeeSettingsDevices.cpp new file mode 100644 index 00000000..b45c8ebb --- /dev/null +++ b/xbmc/GUIWindowBoxeeSettingsDevices.cpp @@ -0,0 +1,161 @@ +#include "GUIWindowBoxeeSettingsDevices.h" +#include "LocalizeStrings.h" +#include "log.h" +#include "Application.h" +#include "BoxeeDeviceManager.h" +#include "GUIDialogOK2.h" +#include "GUIDialogYesNo2.h" +#include "GUIUserMessages.h" + +#define CONTROL_DEVICE_BUTTON 51 +#define CONTROL_DEVICE_LIST 56 + +#define DEVICE_ICON_PROPERTY_NAME "deviceicon" + +CGUIWindowBoxeeSettingsDevices::CGUIWindowBoxeeSettingsDevices() : CGUIDialog(WINDOW_BOXEE_SETTINGS_DEVICES, "boxee_settings_devices.xml") +{ + +} + +CGUIWindowBoxeeSettingsDevices::~CGUIWindowBoxeeSettingsDevices() +{ + +} + +void CGUIWindowBoxeeSettingsDevices::OnInitWindow() +{ + CGUIWindow::OnInitWindow(); + + SET_CONTROL_FOCUS(CONTROL_DEVICE_BUTTON,0); + + LoadPairedDevicesList(); +} + +bool CGUIWindowBoxeeSettingsDevices::OnAction(const CAction &action) +{ + switch (action.id) + { + case ACTION_PREVIOUS_MENU: + case ACTION_PARENT_DIR: + { + Close(); + return true; + } + } + + return CGUIWindow::OnAction(action); +} + +bool CGUIWindowBoxeeSettingsDevices::OnMessage(CGUIMessage &message) +{ + switch(message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int iControl = message.GetSenderId(); + + if(iControl == CONTROL_DEVICE_LIST) + { + return HandleClickOnPairedDeviceList(); + } + } + break; + case GUI_MSG_UPDATE: + { + LoadPairedDevicesList(); + } + break; + } + + return CGUIDialog::OnMessage(message); +} + +bool CGUIWindowBoxeeSettingsDevices::HandleClickOnPairedDeviceList() +{ + // Get selected index from the list + CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_DEVICE_LIST); + OnMessage(msg); + + int selectedIndex = msg.GetParam1(); + + if (selectedIndex < 0 || selectedIndex > m_pairedDeviceList.Size() - 1) + { + CLog::Log(LOGERROR,"CGUIWindowBoxeeSettingsDevices::HandleClickOnPairedDeviceList - GUI_MSG_CLICKED - FAILED to get [selectedIndex=%d]. [ListSize=%d] (bspd)",selectedIndex,m_pairedDeviceList.Size()); + return true; + } + + CFileItemPtr m_selectedItem = m_pairedDeviceList.Get(selectedIndex); + CStdString deviceLabel = m_selectedItem->GetLabel(); + CStdString deviceId = m_selectedItem->GetProperty("deviceid"); + + CLog::Log(LOGDEBUG,"CGUIWindowBoxeeSettingsDevices::HandleClickOnPairedDeviceList - GUI_MSG_CLICKED - clicked on device [label=%s][id=%s] in CONTROL_DEVICE_LIST (bspd)",deviceLabel.c_str(),deviceId.c_str()); + + if (deviceId.IsEmpty()) + { + CLog::Log(LOGERROR,"CGUIWindowBoxeeSettingsDevices::HandleClickOnPairedDeviceList - GUI_MSG_CLICKED - got device with an EMPTY deviceId. [label=%s][id=%s] (bspd)",deviceLabel.c_str(),deviceId.c_str()); + return true; + } + + CStdString message; + CStdString messageStr = g_localizeStrings.Get(55515); + message.Format(messageStr.c_str(),deviceLabel); + + if (CGUIDialogYesNo2::ShowAndGetInput(g_localizeStrings.Get(55510), message, g_localizeStrings.Get(222), g_localizeStrings.Get(53405))) + { + if (!g_application.GetBoxeeDeviceManager().UnPairDevice(deviceId)) + { + CStdString message; + CStdString messageStr = g_localizeStrings.Get(55516); + message.Format(messageStr.c_str(),deviceLabel); + + CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(55510), message); + } + else + { + LoadPairedDevicesList(); + } + } + + return true; +} + +void CGUIWindowBoxeeSettingsDevices::LoadPairedDevicesList() +{ + m_pairedDeviceList.Clear(); + CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_DEVICE_LIST); + OnMessage(msgReset); + + const std::map& pairedDeviceMap = g_application.GetBoxeeDeviceManager().GetPairedDeviceMap(); + size_t numOfPairedDevices = pairedDeviceMap.size(); + + CLog::Log(LOGDEBUG,"CGUIWindowBoxeeSettingsDevices::OnInitWindow - got [NumOfPairedDevice=%zu] (bspd)",numOfPairedDevices); + + int counter = 0; + std::map::const_iterator it = pairedDeviceMap.begin(); + while (it != pairedDeviceMap.end()) + { + const CBoxeeDeviceItem& deviceItem = it->second; + CFileItemPtr item(new CFileItem()); + item->SetLabel(deviceItem.GetDeviceLabel()); + item->SetProperty("deviceid",deviceItem.GetDeviceId()); + item->SetProperty(DEVICE_ICON_PROPERTY_NAME,deviceItem.GetDeviceTypeAsString()); + + counter++; + CLog::Log(LOGDEBUG,"CGUIWindowBoxeeSettingsDevices::OnInitWindow - [%d/%zu] - adding device [label=%s] (bspd)",counter,numOfPairedDevices,item->GetLabel().c_str()); + + m_pairedDeviceList.Add(item); + + it++; + } + + if (m_pairedDeviceList.Size() > 0) + { + m_pairedDeviceList.Sort(SORT_METHOD_LABEL, SORT_ORDER_ASC); + + // bind paired devices + CGUIMessage message2(GUI_MSG_LABEL_BIND, GetID(), CONTROL_DEVICE_LIST, 0, 0, &m_pairedDeviceList); + OnMessage(message2); + + SET_CONTROL_FOCUS(CONTROL_DEVICE_LIST,0); + } +} diff --git a/xbmc/GUIWindowBoxeeSettingsDevices.h b/xbmc/GUIWindowBoxeeSettingsDevices.h new file mode 100644 index 00000000..6fc36593 --- /dev/null +++ b/xbmc/GUIWindowBoxeeSettingsDevices.h @@ -0,0 +1,25 @@ +#ifndef GUI_WINDOW_BOXEE_SETTINGS_DEVICES +#define GUI_WINDOW_BOXEE_SETTINGS_DEVICES + +#include "GUIDialog.h" +#include "FileItem.h" + +class CGUIWindowBoxeeSettingsDevices : public CGUIDialog +{ +public: + CGUIWindowBoxeeSettingsDevices(); + virtual ~CGUIWindowBoxeeSettingsDevices(); + virtual void OnInitWindow(); + virtual bool OnAction(const CAction &action); + virtual bool OnMessage(CGUIMessage &message); + +protected: + + void LoadPairedDevicesList(); + bool HandleClickOnPairedDeviceList(); + + CFileItemList m_pairedDeviceList; +}; + + +#endif // GUI_WINDOW_BOXEE_SETTINGS_DEVICES diff --git a/xbmc/GUIWindowFirstTimeUseBackground.cpp b/xbmc/GUIWindowFirstTimeUseBackground.cpp new file mode 100644 index 00000000..5c08fb1f --- /dev/null +++ b/xbmc/GUIWindowFirstTimeUseBackground.cpp @@ -0,0 +1,37 @@ +#include "GUIWindowFirstTimeUseBackground.h" +#include "Key.h" +#include "log.h" + +CGUIWindowFirstTimeUseBackground::CGUIWindowFirstTimeUseBackground(void) : CGUIWindow(WINDOW_FTU_BACKGROUND, "ftu_window_background.xml") +{ + +} + +CGUIWindowFirstTimeUseBackground::~CGUIWindowFirstTimeUseBackground(void) +{ + +} + +bool CGUIWindowFirstTimeUseBackground::OnAction(const CAction &action) +{ + switch (action.id) + { + case ACTION_PREVIOUS_MENU: + case ACTION_PARENT_DIR: + { + CLog::Log(LOGDEBUG,"CGUIWindowFirstTimeUseBackground::OnAction - ACTION_PREVIOUS_MENU or ACTION_PARENT_DIR is not allow (ftu)"); + return true; + } + break; + case ACTION_BUILT_IN_FUNCTION: + { + // don't allow during FTU + CLog::Log(LOGDEBUG,"CGUIWindowFirstTimeUseBackground::OnAction - ACTION_BUILT_IN_FUNCTION is not allow (ftu)"); + return true; + } + break; + } + + return CGUIWindow::OnAction(action); +} + diff --git a/xbmc/GUIWindowFirstTimeUseBackground.h b/xbmc/GUIWindowFirstTimeUseBackground.h new file mode 100644 index 00000000..7c131852 --- /dev/null +++ b/xbmc/GUIWindowFirstTimeUseBackground.h @@ -0,0 +1,18 @@ +#ifndef BOXEEWINDOWFTUBACKGROUND_H +#define BOXEEWINDOWFTUBACKGROUND_H + +#include "GUIWindow.h" + +class CGUIWindowFirstTimeUseBackground : public CGUIWindow +{ +public: + CGUIWindowFirstTimeUseBackground(void); + virtual ~CGUIWindowFirstTimeUseBackground(void); + + virtual bool OnAction(const CAction &action); + +protected: + +}; + +#endif diff --git a/xbmc/GUIWindowFirstTimeUseCalibration.cpp b/xbmc/GUIWindowFirstTimeUseCalibration.cpp new file mode 100644 index 00000000..c0f93088 --- /dev/null +++ b/xbmc/GUIWindowFirstTimeUseCalibration.cpp @@ -0,0 +1,129 @@ + +#include "GUIWindowFirstTimeUseCalibration.h" + +#ifdef HAS_EMBEDDED + +#include "GUIWindowManager.h" +#include "LocalizeStrings.h" +#include "GUILabelControl.h" +#include "GUIEditControl.h" +#include "GUIRadioButtonControl.h" +#include "GUIDialogOK2.h" +#include "log.h" +#include "Settings.h" +#include "Application.h" + +#define TOP_LEFT_MOVER 8 +#define BOTTOM_RIGHT_MOVER 9 + +#define SETTING_TOP_LEFT 1 +#define SETTING_BOTTOM_RIGHT 2 +#define VALIDATE_STATE 3 + +#define DONE_BUTTON 250 +#define TRY_AGAIN_BUTTON 251 + +CGUIWindowFirstTimeUseCalibration::CGUIWindowFirstTimeUseCalibration() +{ + SetID(WINDOW_FTU_CALIBRATION); + SetXMLFile("ftu_calibration.xml"); +} + +CGUIWindowFirstTimeUseCalibration::~CGUIWindowFirstTimeUseCalibration() +{ + +} + + +void CGUIWindowFirstTimeUseCalibration::OnInitWindow() +{ + CGUIWindowSettingsScreenCalibration::OnInitWindow(); + + SET_CONTROL_FOCUS(TOP_LEFT_MOVER,0); + SetProperty("setting-state",SETTING_TOP_LEFT); + + CLog::Log(LOGDEBUG,"CGUIWindowFirstTimeUseCalibration::OnInitWindow - Exit function. [setting-state=%d=SETTING_TOP_LEFT] (ftu)",GetPropertyInt("setting-state")); +} + +bool CGUIWindowFirstTimeUseCalibration::OnAction(const CAction &action) +{ + switch (action.id) + { + case ACTION_PREVIOUS_MENU: + case ACTION_PARENT_DIR: + { + CLog::Log(LOGDEBUG,"CGUIWindowFirstTimeUseCalibration::OnAction - ACTION_PREVIOUS_MENU or ACTION_PARENT_DIR is not allow (ftu)"); + return true; + } + break; + case ACTION_BUILT_IN_FUNCTION: + { + // don't allow during FTU + CLog::Log(LOGDEBUG,"CGUIWindowFirstTimeUseCalibration::OnAction - ACTION_BUILT_IN_FUNCTION is not allow (ftu)"); + return true; + } + break; + } + + return CGUIWindowSettingsScreenCalibration::OnAction(action); +} + +bool CGUIWindowFirstTimeUseCalibration::OnMessage(CGUIMessage& message) +{ + bool retVal = CGUIWindowSettingsScreenCalibration::OnMessage(message); + + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + switch(message.GetSenderId()) + { + case TOP_LEFT_MOVER: + { + SetProperty("setting-state",SETTING_BOTTOM_RIGHT); + CLog::Log(LOGDEBUG,"CGUIWindowFirstTimeUseCalibration::OnMessage - GUI_MSG_CLICKED - Finish set TOP_LEFT_MOVER. Set property [setting-state=%d=SETTING_BOTTOM_RIGHT] (ftu)",GetPropertyInt("setting-state")); + SET_CONTROL_FOCUS(BOTTOM_RIGHT_MOVER,0); + } + break; + case BOTTOM_RIGHT_MOVER: + { + SetProperty("setting-state",VALIDATE_STATE); + CLog::Log(LOGDEBUG,"CGUIWindowFirstTimeUseCalibration::OnMessage - GUI_MSG_CLICKED - Finish set BOTTOM_RIGHT_MOVER. Set property [setting-state=%d=VALIDATE_STATE] (ftu)",GetPropertyInt("setting-state")); + + SET_CONTROL_VISIBLE(TRY_AGAIN_BUTTON); + SET_CONTROL_VISIBLE(DONE_BUTTON); + SET_CONTROL_FOCUS(DONE_BUTTON,0); + } + break; + case TRY_AGAIN_BUTTON: + { + SET_CONTROL_FOCUS(TOP_LEFT_MOVER,0); + SetProperty("setting-state",SETTING_TOP_LEFT); + CLog::Log(LOGDEBUG,"CGUIWindowFirstTimeUseCalibration::OnMessage - GUI_MSG_CLICKED - click on TRY_AGAIN_BUTTON. Set property [setting-state=%d=SETTING_TOP_LEFT] (ftu)",GetPropertyInt("setting-state")); + } + break; + case DONE_BUTTON: + { + CLog::Log(LOGDEBUG,"CGUIWindowFirstTimeUseCalibration::OnMessage - GUI_MSG_CLICKED - click on DONE_BUTTON. Call Login() (ftu)"); + + g_stSettings.m_doneFTU2 = true; + g_settings.Save(); + + ///////////////////////////////////////////// + // DONE_BUTTON was clicked -> call Login() // + ///////////////////////////////////////////// + + bool loginWasDone = g_application.GetBoxeeLoginManager().Login(); + return loginWasDone; + } + break; + } + } + break; + } + + return retVal; +} + +#endif + diff --git a/xbmc/GUIWindowFirstTimeUseCalibration.h b/xbmc/GUIWindowFirstTimeUseCalibration.h new file mode 100644 index 00000000..94184e49 --- /dev/null +++ b/xbmc/GUIWindowFirstTimeUseCalibration.h @@ -0,0 +1,26 @@ +#pragma once + +#include "GUIWindowSettingsScreenCalibration.h" + +#ifdef HAS_EMBEDDED + +class CGUIWindowFirstTimeUseCalibration : public CGUIWindowSettingsScreenCalibration +{ +public: + + CGUIWindowFirstTimeUseCalibration(); + virtual ~CGUIWindowFirstTimeUseCalibration(); + + virtual bool OnAction(const CAction& action); + virtual bool OnMessage(CGUIMessage &message); + +protected: + + virtual void OnInitWindow(); + +private: + +}; + +#endif + diff --git a/xbmc/GUIWindowStateDatabase.cpp b/xbmc/GUIWindowStateDatabase.cpp new file mode 100644 index 00000000..8cbb9efe --- /dev/null +++ b/xbmc/GUIWindowStateDatabase.cpp @@ -0,0 +1,497 @@ +#include "GUIWindowStateDatabase.h" +#include "SpecialProtocol.h" +#include "logger.h" +#include "utils/log.h" + +using namespace dbiplus; + +CGUIWindowStateDatabase::CGUIWindowStateDatabase() +{ + mDatabaseFilePath = _P("special://profile/Database/") + "boxee_window_state.db"; + Open(); +} + +CGUIWindowStateDatabase::~CGUIWindowStateDatabase() +{ + Close(); +} + + +bool CGUIWindowStateDatabase::Init() +{ + if (!TablesExist()) + return CreateTables(); + else + return UpdateTables(); +} + +bool CGUIWindowStateDatabase::DropTables() +{ + LOG(LOG_LEVEL_DEBUG, "LIBRARY: deleting windowstate table (windowstate)"); + + bool retVal = Create("DROP table windowstate;"); + + return retVal; +} + +bool CGUIWindowStateDatabase::TablesExist() +{ + bool bExists = BXDatabase::TablesExist(); + + if (bExists) + { + LOG(LOG_LEVEL_DEBUG, "File exists, check if tables are created"); + + // Check if the version table can be accessed + Dataset* pDS = Query("select distinct 1 from sqlite_master where tbl_name='windowstate'"); + + if (pDS && pDS->num_rows() > 0) + bExists = true; + else + bExists = false; + + if (pDS) + delete pDS; + } + return bExists; +} + +bool CGUIWindowStateDatabase::CreateTables() +{ + bool result = BXDatabase::CreateTables(); + + if (result) + { + try + { + result = DropTables(); + if (result) + { + LOG(LOG_LEVEL_DEBUG, "LIBRARY: Creating windowstate table (windowstate)"); + result = Create("CREATE TABLE windowstate ( idWindow integer unsigned NOT NULL, strCategory varchar(20) NOT NULL, idView smallint unsigned , strSort varchar(20), iSelectedItem integer unsigned, PRIMARY KEY(idWindow, strCategory) )"); + + result = Create("CREATE TABLE windowdefaults (idWindow integer unsigned primary key, strDefaultCategory varchar(20) NOT NULL)"); + + LOG(LOG_LEVEL_DEBUG, "LIBRARY: Creating userdefaults table (userdefaults)"); + result = Create("CREATE TABLE userdefaults (id integer primary key AUTOINCREMENT, key varchar(20) NOT NULL, value varchar(20) NOT NULL)"); + + LOG(LOG_LEVEL_DEBUG, "LIBRARY: Creating userServices table (userServices)"); + result = Create("CREATE TABLE userServices(id integer primary key AUTOINCREMENT, serviceId varchar(20) NOT NULL, serviceName varchar(20) NOT NULL, sendShare integer NOT NULL, unique (serviceId)) "); + + Dataset* pDS = Exec("update version set iVersion=11"); + if (pDS) + { + delete pDS; + } + } + } + catch(dbiplus::DbErrors& e) + { + LOG(LOG_LEVEL_ERROR, e.getMsg()); + result = false; + } + catch(...) + { + LOG(LOG_LEVEL_ERROR, "Could not create tables, exception was caught during operation"); + result = false; + } + } + + return result; +} + +bool CGUIWindowStateDatabase::SaveState(int iWindow, const std::string& strSelectedCategory, int iView, const std::string& strSortMethod, int iSelectedItem) +{ + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::SaveState, iWindow=%d , iView=%d , strSortMethod=%s , iSelectedItem=%d, iSelectedCategory=%s",iWindow,iView,strSortMethod.c_str(),iSelectedItem,strSelectedCategory.c_str()); + + //lets check if there is such record + Dataset* pDS = Query("select 1 from windowstate where (idWindow='%d' AND strCategory='%s')", iWindow , strSelectedCategory.c_str()); + if (pDS) + {//query succeeded + if (pDS->num_rows() != 0) + { + //a record found + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::SaveState, state found, idWindow='%d', strCategory='%s'", iWindow, strSelectedCategory.c_str()); + //update that record + Dataset* pDS2 = Exec("update windowstate set idView='%d', strSort='%s', iSelectedItem='%d' where (idWindow='%d' AND strCategory='%s')", + iView, strSortMethod.c_str(), iSelectedItem, iWindow, strSelectedCategory.c_str());\ + if (pDS2) + { + delete pDS2; + } + else + { + LOG(LOG_LEVEL_DEBUG,"GUIWindowStateDatabase error: %s",GetLastErrorMessage()); + } + } + else + { + //no such record, create new + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::SaveState, add new state, idWindow='%d', strCategory='%s'", iWindow, strSelectedCategory.c_str()); + + Insert("insert into windowstate (idWindow, strCategory, idView, strSort, iSelectedItem) " + "values ('%d', '%s', %d, '%s', '%d')", iWindow, strSelectedCategory.c_str(), iView, strSortMethod.c_str(), iSelectedItem); + } + delete pDS; + return true; + } + + return false; + +} + +bool CGUIWindowStateDatabase::LoadState(int iWindow , const std::string& strSelectedCategory, int& iView, std::string& strSortMethod, int& iSelectedItem) +{ + bool bRetVal = false; + + //lets check if there is such record + Dataset* pDS = Query("select * from windowstate where (idWindow='%d' AND strCategory='%s')", iWindow , strSelectedCategory.c_str()); + + if (pDS) + { + if (pDS->num_rows() != 0) + { + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::LoadState, loading state for idWindow='%d', strCategory='%s'", iWindow, strSelectedCategory.c_str()); + + iView = pDS->fv("idView").get_asInt(); + strSortMethod = pDS->fv("strSort").get_asString(); + iSelectedItem = pDS->fv("iSelectedItem").get_asInt(); + + bRetVal = true; + } + else + { + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::LoadState, no state found for idWindow='%d', strCategory='%s'", iWindow, strSelectedCategory.c_str()); + } + + delete pDS; + } + + if (bRetVal) + { + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::LoadState, iWindow=%d , iView=%d , strSortMethod=%s, iSelectedItem=%d , strSelectedCategory=%s",iWindow,iView,strSortMethod.c_str(),iSelectedItem,strSelectedCategory.c_str()); + } + + return bRetVal; +} + + +bool CGUIWindowStateDatabase::SetDefaultCategory(int iWindow, const std::string& strSelectedCategory) +{ + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::SetDefaultCategory, iWindow=%d , strSelectedCategory=%s",iWindow,strSelectedCategory.c_str()); + + //lets check if there is such record + Dataset* pDS = Query("select 1 from windowdefaults where idWindow='%d'", iWindow); + if (pDS) + {//query succeeded + if (pDS->num_rows() != 0) + { + //a record found + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::SetDefaultCategory, state found, idWindow='%d', strCategory='%s'", iWindow, strSelectedCategory.c_str()); + //update that record + Dataset* pDS2 = Exec("update windowdefaults set strDefaultCategory='%s' where (idWindow='%d')", strSelectedCategory.c_str(), iWindow); + if (pDS2) + { + delete pDS2; + } + } + else + { + //no such record, create new + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::SetDefaultCategory, add new state, idWindow='%d', strCategory='%s'", iWindow, strSelectedCategory.c_str()); + + Insert("insert into windowdefaults (idWindow, strDefaultCategory) values ('%d', '%s')", iWindow, strSelectedCategory.c_str()); + } + delete pDS; + return true; + } + + return false; + +} + +bool CGUIWindowStateDatabase::GetDefaultCategory(int iWindow, std::string& strSelectedCategory) +{ + bool bRetVal = false; + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::GetDefaultCategory, iWindow=%d",iWindow); + + //lets check if there is such record + Dataset* pDS = Query("select * from windowdefaults where (idWindow=%d)", iWindow); + + if (pDS) + { + if (pDS->num_rows() != 0) + { + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::GetDefaultCategory, state found, idWindow='%d' , strCategory='%s'", iWindow, strSelectedCategory.c_str()); + + strSelectedCategory = pDS->fv("strDefaultCategory").get_asString(); + + bRetVal = true; + } + else + { + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::GetDefaultCategory, state not found, idWindow='%d', strCategory='%s'", iWindow, strSelectedCategory.c_str()); + } + + delete pDS; + } + + return bRetVal; +} + +bool CGUIWindowStateDatabase::GetUserEnabledServices(std::vector& vecEnabledServices) +{ + Dataset* pDS = Query("select serviceId from userServices where sendShare='1'"); + + if (pDS) + { + while(!pDS->eof()) + { + std::string serviceId = pDS->fv(0).get_asString(); + + vecEnabledServices.push_back(serviceId); + + pDS->next(); + } + + LOG(LOG_LEVEL_DEBUG, "CGUIWindowStateDatabase::GetUserEnabledServices, returned %d records.",pDS->num_rows()); + + delete pDS; + return true; + } + + LOG(LOG_LEVEL_DEBUG, "CGUIWindowStateDatabase::GetUserEnabledServices, failed.",pDS->num_rows()); + + return false; +} + +bool CGUIWindowStateDatabase::GetUserService(const std::string& serviceId, std::string& serviceName, bool& sendShare) +{ + LOG(LOG_LEVEL_DEBUG, "CGUIWindowStateDatabase::GetUserService, [serviceId=%s]",serviceId.c_str()); + + Dataset* pDS = Query("select * from userServices where serviceId='%s'", serviceId.c_str()); + if (pDS) + {//query succeeded + if (pDS->num_rows() != 0) + { + serviceName = pDS->fv("serviceName").get_asString(); + sendShare = pDS->fv("sendShare").get_asBool(); + LOG(LOG_LEVEL_DEBUG, "CGUIWindowStateDatabase::GetUserService, [serviceId=%s][serviceName=%s][sendShare=%d]",serviceId.c_str(),serviceName.c_str(),(int)sendShare); + return true; + } + delete pDS; + return false; + } + + return false; +} + +bool CGUIWindowStateDatabase::SetUserServiceState(const std::string& serviceId, bool sendShare) +{ + LOG(LOG_LEVEL_DEBUG, "CGUIWindowStateDatabase::SetUserServiceState, [serviceId=%s][sendShare=%d]",serviceId.c_str(),(int)sendShare); + Dataset* pDS2 = Exec("update userServices set sendShare='%d' where serviceId='%s'", (int)sendShare, serviceId.c_str() ); + + if (pDS2) + { + delete pDS2; + LOG(LOG_LEVEL_DEBUG, "CGUIWindowStateDatabase::SetUserServiceState, succeeded[serviceId=%s]",serviceId.c_str()); + return true; + } + + LOG(LOG_LEVEL_DEBUG, "CGUIWindowStateDatabase::SetUserServiceState, failed[serviceId=%s]",serviceId.c_str()); + return false; +} + +bool CGUIWindowStateDatabase::RemoveUserService(const std::string& serviceId) +{ + LOG(LOG_LEVEL_DEBUG, "CGUIWindowStateDatabase::RemoveUserService, [serviceId=%s]",serviceId.c_str()); + + Dataset* pDS2 = Exec("delete from userServices where serviceId='%s'", serviceId.c_str() ); + + if (pDS2) + { + delete pDS2; + LOG(LOG_LEVEL_DEBUG, "CGUIWindowStateDatabase::RemoveUserService, succeeded[serviceId=%s]",serviceId.c_str()); + return true; + } + + LOG(LOG_LEVEL_DEBUG, "CGUIWindowStateDatabase::RemoveUserService, failed[serviceId=%s]",serviceId.c_str()); + return false; +} + +bool CGUIWindowStateDatabase::AddUserService(const std::string& serviceId, const std::string& serviceName, bool sendShare) +{ + LOG(LOG_LEVEL_DEBUG, "CGUIWindowStateDatabase::AddUserService, [serviceId=%s][serviceName=%s][sendShare=%d]",serviceId.c_str(),serviceName.c_str(),(int)sendShare); + + int iId = Insert("insert into userServices(id, serviceId, serviceName, sendShare) values (NULL, '%s','%s','%d')",serviceId.c_str(),serviceName.c_str(),(int)sendShare); + + if (iId != MEDIA_DATABASE_ERROR) + {//query succeeded + return true; + } + + return false; +} + +bool CGUIWindowStateDatabase::SetUserSetting(const std::string& strKey, const std::string& strValue) +{ + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::SetUserSetting, strKey=%s , strValue=%s",strKey.c_str(),strValue.c_str()); + + //lets check if there is such record + Dataset* pDS = Query("select * from userdefaults where key='%s'", strKey.c_str()); + if (pDS) + {//query succeeded + if (pDS->num_rows() != 0) + { + //a record found + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::SetUserSetting, change setting strKey='%s' to strValue='%s'", strKey.c_str(), strValue.c_str()); + //update that record + Dataset* pDS2 = Exec("update userdefaults set value='%s' where key='%s'", strValue.c_str(), strKey.c_str()); + if (pDS2) + { + delete pDS2; + } + } + else + { + //no such record, create new + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::SetUserSetting, add new setting strKey='%s' == strValue='%s'", strKey.c_str(), strValue.c_str()); + + Insert("insert into userdefaults ('key', 'value') values ('%s', '%s')", strKey.c_str(), strValue.c_str()); + } + delete pDS; + return true; + } + + return false; + +} + +bool CGUIWindowStateDatabase::GetUserSetting(const std::string& strKey, std::string& strValue) +{ + bool bRetVal = false; + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::GetUserSetting, strKey =",strKey.c_str()); + + //lets check if there is such record + Dataset* pDS = Query("select * from userdefaults where key='%s'", strKey.c_str()); + + if (pDS) + { + if (pDS->num_rows() != 0) + { + strValue = pDS->fv("value").get_asString(); + + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::GetUserSetting, setting found, strKey='%s', strValue='%s'", strKey.c_str(), strValue.c_str()); + + bRetVal = true; + } + else + { + LOG(LOG_LEVEL_DEBUG, "GUIWindowStateDatabase::GetUserSetting, setting not found, strKey='%s'", strKey.c_str()); + } + + delete pDS; + } + + return bRetVal; +} + + +bool CGUIWindowStateDatabase::UpdateTables() +{ + bool bRetVal = false; + + Dataset* pDS = Query ("select * from version"); + + if (!pDS) + {//that means its the first pre mature version of the db - we should delete all tables (because they are still unused) and recreate them properly + CreateTables(); + } + else + { + if (pDS->num_rows() > 0) + { + int iVersion = pDS->fv("iVersion").get_asInt(); + + if (iVersion <= 7) + { + bRetVal = Create("CREATE TABLE windowdefaults (idWindow integer unsigned primary key, strDefaultCategory varchar(20) NOT NULL)"); + + if (bRetVal) + { + Dataset* pDS2 = Exec("update version set iVersion=8"); + if (pDS2) + { + delete pDS2; + } + } + } + if (iVersion <= 8) + { + CLog::Log(LOGDEBUG,"CGUIWindowStateDatabase, %s is in version %d.", mDatabaseFilePath.c_str(), iVersion); + + bRetVal = Create("CREATE TABLE userdefaults (id integer primary key AUTOINCREMENT, key varchar(20) NOT NULL, value varchar(20) NOT NULL)"); + + if (bRetVal) + { + CLog::Log(LOGDEBUG,"CGUIWindowStateDatabase, Advancing to 10 because of previous error with version 9"); + Dataset* pDS2 = Exec("update version set iVersion=10"); + if (pDS2) + { + delete pDS2; + } + } + } + if (iVersion <= 9) + { + + CLog::Log(LOGDEBUG,"CGUIWindowStateDatabase, %s is in version %d", mDatabaseFilePath.c_str(), iVersion); + + Dataset* pDS3 = Query ("select * from userdefaults"); + + if(!pDS3) + { + bRetVal = Create("CREATE TABLE userdefaults (id integer primary key AUTOINCREMENT, key varchar(20) NOT NULL, value varchar(20) NOT NULL)"); + + if (bRetVal) + { + Dataset* pDS2 = Exec("update version set iVersion=10"); + if (pDS2) + { + delete pDS2; + } + } + } + else + { + Dataset* pDS2 = Exec("update version set iVersion=10"); + if (pDS2) + { + delete pDS2; + } + delete pDS3; + } + } + if (iVersion <= 10) + { + bRetVal = Create("CREATE TABLE userServices(id integer primary key AUTOINCREMENT, serviceId varchar(20) NOT NULL, serviceName varchar(20) NOT NULL, sendShare integer NOT NULL, unique (serviceId)) "); + + if (bRetVal) + { + Dataset* pDS2 = Exec("update version set iVersion=11"); + if (pDS2) + { + delete pDS2; + } + } + } + if (iVersion == 11) + { + CLog::Log(LOGDEBUG,"CGUIWindowStateDatabase, %s is in version %d", mDatabaseFilePath.c_str(), iVersion); + } + } + delete pDS; + } + + return bRetVal; +} diff --git a/xbmc/GUIWindowStateDatabase.h b/xbmc/GUIWindowStateDatabase.h new file mode 100644 index 00000000..49ff07d0 --- /dev/null +++ b/xbmc/GUIWindowStateDatabase.h @@ -0,0 +1,38 @@ +#ifndef GUIWINDOWSTATEDATABASE_H_ +#define GUIWINDOWSTATEDATABASE_H_ + +#include "bxdatabase.h" + +class CGUIWindowStateDatabase : public BOXEE::BXDatabase +{ +public: + CGUIWindowStateDatabase(); + virtual ~CGUIWindowStateDatabase(); + + bool SaveState(int iWindow, const std::string& strSelectedCategory, int iView, const std::string& strSortMethod, int iSelectedItem); + bool LoadState(int iWindow, const std::string& strSelectedCategory, int& iView, std::string& strSortMethod, int& iSelectedItem); + + bool SetDefaultCategory(int iWindow, const std::string& strSelectedCategory); + bool GetDefaultCategory(int iWindow, std::string& strSelectedCategory); + bool SetUserSetting(const std::string& strKey, const std::string& strValue); + bool GetUserSetting(const std::string& strKey, std::string& strValue); + + bool GetUserEnabledServices(std::vector& vecEnabledServices); + bool GetUserService(const std::string& serviceId, std::string& serviceName, bool& sendShare); + bool AddUserService(const std::string& serviceId, const std::string& serviceName, bool sendShare); + bool SetUserServiceState(const std::string& serviceId, bool sendShare); + bool RemoveUserService(const std::string& serviceId); + + bool Init(); + + virtual bool TablesExist(); + virtual bool CreateTables(); + virtual bool UpdateTables(); + bool DropTables(); + +private: + +}; + +#endif + diff --git a/xbmc/GUIWindowTestBadPixels.cpp b/xbmc/GUIWindowTestBadPixels.cpp new file mode 100755 index 00000000..d71d0ce9 --- /dev/null +++ b/xbmc/GUIWindowTestBadPixels.cpp @@ -0,0 +1,217 @@ +#include "GUIWindowTestBadPixels.h" +#include "GUIWindowTestBadPixelsManager.h" +#include "Settings.h" +#include "GUIWindowManager.h" +#include "Key.h" +#include "GUITexture.h" +#include "log.h" +#ifdef HAS_GLES +#include "GUITextureGLES.h" +#endif + +#define SHOW_COLOR_IN_SEC 8 + +CGUIWindowTestBadPixels::CGUIWindowTestBadPixels() : CGUIWindow(WINDOW_TEST_BAD_PIXELS, "") +{ + m_top = 0; + m_bottom = 0; + m_left = 0; + m_right = 0; + + m_color = 0; +} + +CGUIWindowTestBadPixels::~CGUIWindowTestBadPixels() +{ + +} + +void CGUIWindowTestBadPixels::OnInitWindow() +{ + CGUIWindow::OnInitWindow(); + + m_top = g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].Overscan.top; + m_bottom = g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].Overscan.bottom; + m_left = g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].Overscan.left; + m_right = g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].Overscan.right; + + if (!m_colorItem.get()) + { + CLog::Log(LOGERROR,"CGUIWindowTestBadPixels::OnInitWindow - Color item WASN'T initialized (tbp)"); + Close(); + } + + m_colorIndex = -1; + m_rotateColors = false; + + if (!SetInitializeColor()) + { + CLog::Log(LOGERROR,"CGUIWindowTestBadPixels::OnInitWindow - FAILED to set color (tbp)"); + Close(); + } + + m_renderCounter = 0; +} + +void CGUIWindowTestBadPixels::OnDeinitWindow(int nextWindowID) +{ + CGUIWindow::OnDeinitWindow(nextWindowID); + + m_colorItem.reset(); + m_colorIndex = -1; + m_rotateColors = false; + m_renderCounter = 0; +} + +bool CGUIWindowTestBadPixels::OnAction(const CAction &action) +{ + switch (action.id) + { + case ACTION_PREVIOUS_MENU: + case ACTION_PARENT_DIR: + { + g_windowManager.PreviousWindow(); + return true; + } + break; + } + + return CGUIWindow::OnAction(action); // base class to handle basic movement etc. +} + +void CGUIWindowTestBadPixels::Render() +{ + if (m_rotateColors) + { + m_renderCounter++; + + if (m_renderCounter % (SHOW_COLOR_IN_SEC*60) == 0) + { + m_renderCounter = 0; + + ////////////////////////////////////////// + // update color every SHOW_COLOR_IN_SEC // + ////////////////////////////////////////// + + m_colorIndex++; + if (m_colorIndex >= CGUIWindowTestBadPixelsManager::GetNumOfColors()) + { + m_colorIndex = 0; + } + + m_color = CGUIWindowTestBadPixelsManager::GetColor(m_colorIndex); + } + } + + DrawBadPixelsTest(); + + CGUIWindow::Render(); +} + +void CGUIWindowTestBadPixels::SetColorItem(CFileItemPtr colorItem) +{ + m_colorItem = colorItem; +} + +bool CGUIWindowTestBadPixels::SetInitializeColor() +{ + bool succeeded = false; + + if (m_colorItem->HasProperty("color-index")) + { + int colorIndex = m_colorItem->GetPropertyInt("color-index"); + if (colorIndex < CGUIWindowTestBadPixelsManager::GetNumOfColors()) + { + m_colorIndex = colorIndex; + m_color = CGUIWindowTestBadPixelsManager::GetColor(m_colorIndex); + succeeded = true; + } + } + else if (CGUIWindowTestBadPixelsManager::GetNumOfColors() > 0) + { + m_rotateColors = true; + m_colorIndex = 0; + m_color = CGUIWindowTestBadPixelsManager::GetColor(m_colorIndex); + succeeded = true; + } + + return succeeded; +} + +#ifdef HAS_GL +/////////////////////////////// +// CGUIWindowTestBadPixelsGL // +/////////////////////////////// + +CGUIWindowTestBadPixelsGL::CGUIWindowTestBadPixelsGL() : CGUIWindowTestBadPixels() +{ + +} + +CGUIWindowTestBadPixelsGL::~CGUIWindowTestBadPixelsGL() +{ + +} + +void CGUIWindowTestBadPixelsGL::DrawBadPixelsTest() +{ + glDisable(GL_TEXTURE_2D); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + CRect rect(m_left, m_top, m_right, m_bottom); + CGUITexture::DrawQuad(rect, m_color); + + glEnable(GL_TEXTURE_2D); +} + +#endif + +#ifdef HAS_GLES +///////////////////////////////// +// CGUIWindowTestBadPixelsGLES // +///////////////////////////////// + +CGUIWindowTestBadPixelsGLES::CGUIWindowTestBadPixelsGLES() : CGUIWindowTestBadPixels() +{ + +} + +CGUIWindowTestBadPixelsGLES::~CGUIWindowTestBadPixelsGLES() +{ + +} + +void CGUIWindowTestBadPixelsGLES::DrawBadPixelsTest() +{ + glClearColor(0, 0, 0, 255); + glClear(GL_COLOR_BUFFER_BIT); + + g_graphicsContext.PushTransform(TransformMatrix(), true); + + CRect rect(m_left, m_top, m_right, m_bottom); + CGUITextureGLES::DrawQuad(rect, m_color); + + glEnable(GL_TEXTURE_2D); +} +#endif + +#ifdef HAS_DX +/////////////////////////////// +// CGUIWindowTestBadPixelsDX // +/////////////////////////////// + +CGUIWindowTestBadPixelsDX::CGUIWindowTestBadPixelsDX() : CGUIWindowTestBadPixels() +{ + +} + +CGUIWindowTestBadPixelsDX::~CGUIWindowTestBadPixelsDX() +{ + +} + +void CGUIWindowTestBadPixelsDX::DrawBadPixelsTest() +{ + // TODO: write dx code +} +#endif diff --git a/xbmc/GUIWindowTestBadPixels.h b/xbmc/GUIWindowTestBadPixels.h new file mode 100755 index 00000000..ad0d9ee2 --- /dev/null +++ b/xbmc/GUIWindowTestBadPixels.h @@ -0,0 +1,74 @@ +#pragma once + +#include "GUIWindow.h" + +class CGUIWindowTestBadPixels : public CGUIWindow +{ +public: + + CGUIWindowTestBadPixels(); + virtual ~CGUIWindowTestBadPixels(); + + virtual bool OnAction(const CAction &action); + + virtual void Render(); + + void SetColorItem(CFileItemPtr colorItem); + +protected: + + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + + virtual void DrawBadPixelsTest() = 0; + + bool SetInitializeColor(); + + int m_colorIndex; + CFileItemPtr m_colorItem; + bool m_rotateColors; + color_t m_color; + int m_top; + int m_bottom; + int m_left; + int m_right; + + unsigned long m_renderCounter; +}; + +class CGUIWindowTestBadPixelsGL : public CGUIWindowTestBadPixels +{ +public: + + CGUIWindowTestBadPixelsGL(); + virtual ~CGUIWindowTestBadPixelsGL(); + +protected: + + virtual void DrawBadPixelsTest(); +}; + +class CGUIWindowTestBadPixelsGLES : public CGUIWindowTestBadPixels +{ +public: + + CGUIWindowTestBadPixelsGLES(); + virtual ~CGUIWindowTestBadPixelsGLES(); + +protected: + + virtual void DrawBadPixelsTest(); +}; + +class CGUIWindowTestBadPixelsDX : public CGUIWindowTestBadPixels +{ +public: + + CGUIWindowTestBadPixelsDX(); + virtual ~CGUIWindowTestBadPixelsDX(); + +protected: + + virtual void DrawBadPixelsTest(); +}; + diff --git a/xbmc/GUIWindowTestBadPixelsManager.cpp b/xbmc/GUIWindowTestBadPixelsManager.cpp new file mode 100755 index 00000000..2943da56 --- /dev/null +++ b/xbmc/GUIWindowTestBadPixelsManager.cpp @@ -0,0 +1,203 @@ +#include "GUIWindowTestBadPixelsManager.h" +#include "Key.h" +#include "LocalizeStrings.h" +#include "GUIWindowManager.h" +#include "GUIWindowTestBadPixels.h" +#include "log.h" + +#define LIST_CTRL 240 + +//#define YELLOW_COLOR_VALUE 0xFFFFFF00 +#define RED_COLOR_VALUE 0xFFFF0000 +#define GREEN_COLOR_VALUE 0xFF00FF00 +#define BLUE_COLOR_VALUE 0xFF0000FF +#define WHITE_COLOR_VALUE 0xFFFFFFFF +#define BLACK_COLOR_VALUE 0xFF000000 + +#define LOOP_ALL_COLOR_INDEX -1 +#define RED_COLOR_INDEX 0 +#define GREEN_COLOR_INDEX 1 +#define BLUE_COLOR_INDEX 2 +#define WHITE_COLOR_INDEX 3 +#define BLACK_COLOR_INDEX 4 + +std::vector CGUIWindowTestBadPixelsManager::m_testBadPixelsColorsVec; + +CGUIWindowTestBadPixelsManager::CGUIWindowTestBadPixelsManager() : CGUIWindow(WINDOW_TEST_BAD_PIXELS_MANAGER,"test_bad_pixels_manager.xml") +{ + m_colorsListItems.Clear(); + m_selectedColorIndex = 0; + + m_testBadPixelsColorsVec.clear(); + m_testBadPixelsColorsVec.push_back(RED_COLOR_VALUE); + m_testBadPixelsColorsVec.push_back(GREEN_COLOR_VALUE); + m_testBadPixelsColorsVec.push_back(BLUE_COLOR_VALUE); + m_testBadPixelsColorsVec.push_back(WHITE_COLOR_VALUE); + m_testBadPixelsColorsVec.push_back(BLACK_COLOR_VALUE); +} + +CGUIWindowTestBadPixelsManager::~CGUIWindowTestBadPixelsManager() +{ + +} + +void CGUIWindowTestBadPixelsManager::OnInitWindow() +{ + CGUIWindow::OnInitWindow(); + + if (FillColorsList()) + { + CLog::Log(LOGDEBUG,"CGUIWindowTestBadPixelsManager::OnInitWindow - After adding [NumOfColors=%d] to list (tbp)",m_colorsListItems.Size()); + } + else + { + CLog::Log(LOGERROR,"CGUIWindowTestBadPixelsManager::OnInitWindow - FAILED to add colors to the list. [NumOfColors=%d] (tbp)",m_colorsListItems.Size()); + Close(); + } + + if (m_selectedColorIndex >= 0 && m_selectedColorIndex < m_colorsListItems.Size()) + { + CONTROL_SELECT_ITEM(LIST_CTRL,m_selectedColorIndex); + } +} + +void CGUIWindowTestBadPixelsManager::OnDeinitWindow(int nextWindowID) +{ + CGUIWindow::OnDeinitWindow(nextWindowID); + + if (nextWindowID != WINDOW_TEST_BAD_PIXELS) + { + m_selectedColorIndex = 0; + } +} + +bool CGUIWindowTestBadPixelsManager::OnAction(const CAction &action) +{ + switch (action.id) + { + case ACTION_PREVIOUS_MENU: + case ACTION_PARENT_DIR: + { + g_windowManager.PreviousWindow(); + return true; + } + break; + } + + return CGUIWindow::OnAction(action); // base class to handle basic movement etc. +} + +bool CGUIWindowTestBadPixelsManager::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + int iControl = message.GetSenderId(); + + CLog::Log(LOGDEBUG,"CGUIWindowTestBadPixelsManager::OnMessage - GUI_MSG_CLICKED - [iControl=%d] (tbp)",iControl); + + switch (iControl) + { + case LIST_CTRL: + { + // Get selected index from the list + CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), LIST_CTRL); + OnMessage(msg); + + m_selectedColorIndex = msg.GetParam1(); + + if (m_selectedColorIndex < 0 || m_selectedColorIndex > m_colorsListItems.Size() - 1) + { + CLog::Log(LOGERROR,"CGUIWindowTestBadPixelsManager::OnMessage - GUI_MSG_CLICKED - FAILED to get [ChoiceIndex=%d]. [colorsListItems=%d] (tbp)",m_selectedColorIndex,m_colorsListItems.Size()); + return true; + } + + CFileItemPtr selectedColorItem = m_colorsListItems.Get(m_selectedColorIndex); + + if (!selectedColorItem.get()) + { + CLog::Log(LOGERROR,"CGUIWindowTestBadPixelsManager::OnMessage - LIST_CTRL - FAILED to get selected list item (tbp)"); + return true; + } + + // show window with the selected color + + CGUIWindowTestBadPixels* tbpWin = (CGUIWindowTestBadPixels*)g_windowManager.GetWindow(WINDOW_TEST_BAD_PIXELS); + if (!tbpWin) + { + CLog::Log(LOGERROR,"CGUIWindowTestBadPixelsManager::OnMessage - LIST_CTRL - FAILED to get CGUIWindowTestBadPixels (tbp)"); + return true; + } + + tbpWin->SetColorItem(selectedColorItem); + g_windowManager.ActivateWindow(WINDOW_TEST_BAD_PIXELS); + return true; + } + break; + } + } + break; + } + + return CGUIWindow::OnMessage(message); +} + +bool CGUIWindowTestBadPixelsManager::FillColorsList() +{ + CGUIMessage messageReset(GUI_MSG_LABEL_RESET, GetID(), LIST_CTRL); + OnMessage(messageReset); + + m_colorsListItems.Clear(); + + // add RED + CFileItemPtr colorItemRed(new CFileItem(g_localizeStrings.Get(54855))); + colorItemRed->SetProperty("color-index",RED_COLOR_INDEX); + m_colorsListItems.Add(colorItemRed); + + // add Green + CFileItemPtr colorItemGreen(new CFileItem(g_localizeStrings.Get(54856))); + colorItemGreen->SetProperty("color-index",GREEN_COLOR_INDEX); + m_colorsListItems.Add(colorItemGreen); + + // add Blue + CFileItemPtr colorItemBlue(new CFileItem(g_localizeStrings.Get(54857))); + colorItemBlue->SetProperty("color-index",BLUE_COLOR_INDEX); + m_colorsListItems.Add(colorItemBlue); + + // add White + CFileItemPtr colorItemWhite(new CFileItem(g_localizeStrings.Get(54858))); + colorItemWhite->SetProperty("color-index",WHITE_COLOR_INDEX); + m_colorsListItems.Add(colorItemWhite); + + // add Black + CFileItemPtr colorItemBlack(new CFileItem(g_localizeStrings.Get(54859))); + colorItemBlack->SetProperty("color-index",BLACK_COLOR_INDEX); + m_colorsListItems.Add(colorItemBlack); + + // add loop all + CFileItemPtr colorItemLoopAll(new CFileItem(g_localizeStrings.Get(54860))); + m_colorsListItems.Add(colorItemLoopAll); + + CGUIMessage messageBind(GUI_MSG_LABEL_BIND, GetID(), LIST_CTRL, 0, 0, &m_colorsListItems); + OnMessage(messageBind); + + return true; +} + +color_t CGUIWindowTestBadPixelsManager::GetColor(int index) +{ + if (index < 0 || index > (int)m_testBadPixelsColorsVec.size() - 1) + { + CLog::Log(LOGERROR,"CGUIWindowTestBadPixelsManager::GetColor - Enter function with a bad [index=%d]. return color WHITE. [SizeOfColorsVec=%d] (tbp)",index,(int)m_testBadPixelsColorsVec.size()); + return WHITE_COLOR_VALUE; + } + + return m_testBadPixelsColorsVec[index]; +} + +int CGUIWindowTestBadPixelsManager::GetNumOfColors() +{ + return (int)m_testBadPixelsColorsVec.size(); +} + diff --git a/xbmc/GUIWindowTestBadPixelsManager.h b/xbmc/GUIWindowTestBadPixelsManager.h new file mode 100755 index 00000000..a04ddf89 --- /dev/null +++ b/xbmc/GUIWindowTestBadPixelsManager.h @@ -0,0 +1,33 @@ +#pragma once + +#include "GUIWindow.h" +#include "FileItem.h" + +class CGUIWindowTestBadPixelsManager : public CGUIWindow +{ +public: + + CGUIWindowTestBadPixelsManager(); + virtual ~CGUIWindowTestBadPixelsManager(); + + virtual bool OnAction(const CAction &action); + virtual bool OnMessage(CGUIMessage &message); + + static color_t GetColor(int index); + static int GetNumOfColors(); + +protected: + + virtual void OnInitWindow(); + virtual void OnDeinitWindow(int nextWindowID); + +private: + + bool FillColorsList(); + + CFileItemList m_colorsListItems; + int m_selectedColorIndex; + + static std::vector m_testBadPixelsColorsVec; +}; + diff --git a/xbmc/GUIWindowTestPatternGLES.cpp b/xbmc/GUIWindowTestPatternGLES.cpp new file mode 100644 index 00000000..fc1af445 --- /dev/null +++ b/xbmc/GUIWindowTestPatternGLES.cpp @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * Test patterns designed by Ofer LaOr - hometheater.co.il + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "system.h" +#include "GUIWindowTestPatternGLES.h" +#include "GUITextureGLES.h" + +#ifdef HAS_GLES + +CGUIWindowTestPatternGLES::CGUIWindowTestPatternGLES(void) : CGUIWindowTestPattern() +{ +} + +CGUIWindowTestPatternGLES::~CGUIWindowTestPatternGLES(void) +{ +} + +void CGUIWindowTestPatternGLES::DrawVerticalLines(int top, int left, int bottom, int right) +{ + for (int i = left; i <= right; i += 2) + { + CGUITextureGLES::DrawLine(CRect(i, top, i, bottom), 0xffffffff); + } +} + +void CGUIWindowTestPatternGLES::DrawHorizontalLines(int top, int left, int bottom, int right) +{ + for (int i = top; i <= bottom; i += 2) + { + CGUITextureGLES::DrawLine(CRect(left, i, right, i), 0xffffffff); + } +} + +void CGUIWindowTestPatternGLES::DrawCheckers(int top, int left, int bottom, int right) +{ +} + +void CGUIWindowTestPatternGLES::DrawBouncingRectangle(int top, int left, int bottom, int right) +{ + m_bounceX += m_bounceDirectionX; + m_bounceY += m_bounceDirectionY; + + if ((m_bounceDirectionX == 1 && m_bounceX + TEST_PATTERNS_BOUNCE_SQUARE_SIZE == right) || (m_bounceDirectionX == -1 && m_bounceX == left)) + m_bounceDirectionX = -m_bounceDirectionX; + + if ((m_bounceDirectionY == 1 && m_bounceY + TEST_PATTERNS_BOUNCE_SQUARE_SIZE == bottom) || (m_bounceDirectionY == -1 && m_bounceY == top)) + m_bounceDirectionY = -m_bounceDirectionY; + + CGUITextureGLES::DrawQuad(CRect(m_bounceX, m_bounceY, m_bounceX + TEST_PATTERNS_BOUNCE_SQUARE_SIZE, m_bounceY + TEST_PATTERNS_BOUNCE_SQUARE_SIZE), 0xffffffff); +} + +static DWORD circleColor = 0; + +void CGUIWindowTestPatternGLES::DrawContrastBrightnessPattern(int top, int left, int bottom, int right) +{ + int x5p = (int) (left + (0.05f * (right - left))); + int y5p = (int) (top + (0.05f * (bottom - top))); + int x12p = (int) (left + (0.125f * (right - left))); + int y12p = (int) (top + (0.125f * (bottom - top))); + int x25p = (int) (left + (0.25f * (right - left))); + int y25p = (int) (top + (0.25f * (bottom - top))); + int x37p = (int) (left + (0.375f * (right - left))); + int y37p = (int) (top + (0.375f * (bottom - top))); + int x50p = left + (right - left) / 2; + int y50p = top + (bottom - top) / 2; + int x62p = (int) (left + (0.625f * (right - left))); + int y62p = (int) (top + (0.625f * (bottom - top))); + int x75p = (int) (left + (0.75f * (right - left))); + int y75p = (int) (top + (0.75f * (bottom - top))); + int x87p = (int) (left + (0.875f * (right - left))); + int y87p = (int) (top + (0.875f * (bottom - top))); + int x95p = (int) (left + (0.95f * (right - left))); + int y95p = (int) (top + (0.95f * (bottom - top))); + + m_blinkFrame = (m_blinkFrame + 1) % TEST_PATTERNS_BLINK_CYCLE; + + // draw main quadrants + CGUITextureGLES::DrawQuad(CRect(x50p, top, right, y50p), 0xffffffff); + CGUITextureGLES::DrawQuad(CRect(left, y50p, x50p, bottom), 0xffffffff); + + // draw border lines + CGUITextureGLES::DrawLine(CRect(left, y5p, x50p, y5p), 0xffffffff); + CGUITextureGLES::DrawLine(CRect(x5p, top,x5p, y50p), 0xffffffff); + CGUITextureGLES::DrawLine(CRect(x50p, y95p, right, y95p), 0xffffffff); + CGUITextureGLES::DrawLine(CRect(x95p, y50p, x95p, bottom), 0xffffffff); + + CGUITextureGLES::DrawLine(CRect(x50p, y5p, right, y5p), 0xff000000); + CGUITextureGLES::DrawLine(CRect(x5p, y50p, x5p, bottom), 0xff000000); + CGUITextureGLES::DrawLine(CRect(left, y95p, x50p, y95p), 0xff000000); + CGUITextureGLES::DrawLine(CRect(x95p, top, x95p, y50p), 0xff000000); + + // draw inner rectangles + CGUITextureGLES::DrawQuad(CRect(x12p, y12p, x37p, y37p), 0xffffffff); + CGUITextureGLES::DrawQuad(CRect(x62p, y62p, x87p, y87p), 0xffffffff); + + CGUITextureGLES::DrawQuad(CRect(x62p, y12p, x87p, y37p), 0xff000000); + CGUITextureGLES::DrawQuad(CRect(x12p, y62p, x37p, y87p), 0xff000000); + + // draw inner circles + if (m_blinkFrame < TEST_PATTERNS_BLINK_CYCLE / 2) + circleColor = 0xff050505; + else + circleColor = 0xff000000; + + int radius = (y37p - y12p) / 3; + CGUITextureGLES::DrawQuad(CRect(x25p - radius, y75p - radius, x25p + radius, y75p + radius), circleColor); + CGUITextureGLES::DrawQuad(CRect(x75p - radius, y25p - radius, x75p + radius, y25p + radius), circleColor); + + if (m_blinkFrame < TEST_PATTERNS_BLINK_CYCLE / 2) + circleColor = 0xfffafafa; + else + circleColor = 0xffffffff; + CGUITextureGLES::DrawQuad(CRect(x25p - radius, y25p - radius, x25p + radius, y25p + radius), circleColor); + CGUITextureGLES::DrawQuad(CRect(x75p - radius, y75p - radius, x75p + radius, y75p + radius), circleColor); +} + +void CGUIWindowTestPatternGLES::BeginRender() +{ + glClearColor(0, 0, 0, 255); + glClear(GL_COLOR_BUFFER_BIT); + + g_graphicsContext.PushTransform(TransformMatrix(), true); +} + +void CGUIWindowTestPatternGLES::EndRender() +{ + g_graphicsContext.PopTransform(); +} + +#endif diff --git a/xbmc/GUIWindowTestPatternGLES.h b/xbmc/GUIWindowTestPatternGLES.h new file mode 100644 index 00000000..988fad05 --- /dev/null +++ b/xbmc/GUIWindowTestPatternGLES.h @@ -0,0 +1,43 @@ +#pragma once + +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * Test patterns designed by Ofer LaOr - hometheater.co.il + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "GUIWindowTestPattern.h" + +class CGUIWindowTestPatternGLES : public CGUIWindowTestPattern +{ +public: + CGUIWindowTestPatternGLES(void); + virtual ~CGUIWindowTestPatternGLES(void); + +private: + virtual void DrawVerticalLines(int top, int left, int bottom, int right); + virtual void DrawHorizontalLines(int top, int left, int bottom, int right); + virtual void DrawCheckers(int top, int left, int bottom, int right); + virtual void DrawBouncingRectangle(int top, int left, int bottom, int right); + virtual void DrawContrastBrightnessPattern(int top, int left, int bottom, int right); + virtual void BeginRender(); + virtual void EndRender(); +}; + diff --git a/xbmc/HalListenerImpl.cpp b/xbmc/HalListenerImpl.cpp new file mode 100644 index 00000000..13f476e5 --- /dev/null +++ b/xbmc/HalListenerImpl.cpp @@ -0,0 +1,101 @@ +#include "HalListenerImpl.h" + +#ifdef HAS_BOXEE_HAL + +#include "Application.h" +#include "log.h" +#include "guilib/common/LinuxInputDevices.h" +#include "WinEvents.h" +#include "GUIWindowManager.h" +#include "GUIWindowSettingsCategory.h" +#include "cores/dvb/dvbmanager.h" +#include "Util.h" +#include + +HalListenerImpl g_halListener; + +HalListenerImpl::HalListenerImpl() +{ + CHALVpnInfo vpnInfo; + m_vpnConnected = false; + if (CHalServicesFactory::GetInstance().VpnGetInfo(vpnInfo)) + { + if (vpnInfo.status == CHalVpnConnected) + m_vpnConnected = true; + } + + CLog::Log(LOGINFO, "Hal Listener: vpn is %s", (m_vpnConnected ? "connected" : "disconnected")); +} + +void HalListenerImpl::HandleNotification(CHalNotification ¬ification) +{ + CLog::Log(LOGINFO, "HalListenerImpl::HandleNotification notification type %d", notification.GetType()); + if (notification.GetType() == HAL_NOTIFY_INPUT) + { + CHalInputNotification& inputNotification = (CHalInputNotification&) notification; + CLog::Log(LOGINFO, "HAL Input notification: connect=%d label=%s path=%s", inputNotification.IsConnected(), + inputNotification.GetLabel().c_str(), inputNotification.GetPath().c_str()); +#ifdef HAS_INTELCE + // Sleep a few seconds to let the files to be created by udev + Sleep(3000); + CWinEvents::RefreshDevices(); +#endif + } + + else if (notification.GetType() == HAL_NOTIFY_STORAGE) + { + CHalStorageNotification& storageNotification = (CHalStorageNotification&) notification; + CLog::Log(LOGINFO, "HAL Storage notification: path=%s", storageNotification.GetPath().c_str()); + } + + else if (notification.GetType() == HAL_NOTIFY_VPN) + { + CHalVpnNotification& vpnNotification = (CHalVpnNotification&) notification; + SetVpnConnected(vpnNotification.IsConnected()); + g_application.SetConnectionToInternetChanged(); + CLog::Log(LOGINFO, "HAL vpn notification: %s", (vpnNotification.IsConnected() ? "connected" : "disconnected")); + } + else if (notification.GetType() == HAL_NOTIFY_ETHERNET_LINK_STATE) + { + CHalEthernetLinkStateNotification ethNotification = (CHalEthernetLinkStateNotification&) notification; + CLog::Log(LOGINFO, "Ethernet link notification: link %s", (ethNotification.IsLinkUp() ? "up" : "down")); + if (ethNotification.IsLinkUp()) + g_application.SetConnectionToInternetChanged(); + else + g_application.SetIsConnectedToInternet(false); + } +#ifdef HAS_DVB + else if (notification.GetType() == HAL_NOTIFY_DVB) + { + CHalDvbNotification& dvbNotification = (CHalDvbNotification&) notification; + + if (dvbNotification.IsReady()) + { + DVBManager::GetInstance().OnDvbDongleReady(dvbNotification.GetInstance()); + } + else if (dvbNotification.IsConnected()) + { + DVBManager::GetInstance().OnDvbDongleInserted(); + } + else + { + DVBManager::GetInstance().OnDvbDongleRemoved(dvbNotification.GetInstance()); + } + + CLog::Log(LOGINFO, "HAL dvb notification: %s", (dvbNotification.IsConnected() ? "connected" : "disconnected")); + } +#endif +} + +void HalListenerImpl::SetVpnConnected(bool connected) +{ + m_vpnConnected = connected; +} + +bool HalListenerImpl::GetVpnConnected() +{ + return m_vpnConnected; +} + +#endif + diff --git a/xbmc/HalListenerImpl.h b/xbmc/HalListenerImpl.h new file mode 100644 index 00000000..161c14e3 --- /dev/null +++ b/xbmc/HalListenerImpl.h @@ -0,0 +1,30 @@ +#ifndef HAL_LISTENER_IMPL +#define HAL_LISTENER_IMPL + +#include "system.h" + +#ifdef HAS_BOXEE_HAL + +#include "HalServices.h" + +class HalListenerImpl : public IHalListener +{ +public: + HalListenerImpl(); + virtual void HandleNotification(CHalNotification ¬ification); + + void SetVpnConnected(bool connected); + bool GetVpnConnected(); + + bool IsDvbConnected(); + +private: + bool m_vpnConnected; +}; + +extern HalListenerImpl g_halListener; + +#endif + +#endif + diff --git a/xbmc/HalServices.cpp b/xbmc/HalServices.cpp new file mode 100644 index 00000000..fe6c0bb3 --- /dev/null +++ b/xbmc/HalServices.cpp @@ -0,0 +1,19 @@ +#include "HalServices.h" + +#ifdef HAS_BOXEE_HAL + +#ifndef _WIN32 +#include "BoxeeHalServices.h" +#endif +#include "NullHalServices.h" + +IHalServices& CHalServicesFactory::GetInstance() +{ +#ifdef _WIN32 + return CNullHalServices::GetInstance(); +#else + return CBoxeeHalServices::GetInstance(); +#endif +}; + +#endif diff --git a/xbmc/HalServices.h b/xbmc/HalServices.h new file mode 100644 index 00000000..802a7c98 --- /dev/null +++ b/xbmc/HalServices.h @@ -0,0 +1,413 @@ +/* + * HalServices.h + * + * Created on: Jun 7, 2010 + * Author: shay + */ + +#ifndef HALSERVICES_H_ +#define HALSERVICES_H_ + +#include "system.h" + +#ifdef HAS_BOXEE_HAL + +#include +#include + +enum CHalNotificationType +{ + HAL_NO_NOTIFICATION = 0, + HAL_NOTIFY_ETHERNET_LINK_STATE, + HAL_NOTIFY_ETHERNET_ADDR_CHANGE, + HAL_NOTIFY_WIRELESS_LINK_STATE, + HAL_NOTIFY_WIRELESS_ADDR_CHANGE, + HAL_NOTIFY_POWER, + HAL_NOTIFY_INPUT, + HAL_NOTIFY_STORAGE, + HAL_NOTIFY_VPN, + HAL_NOTIFY_DVB, + HAL_NOTIFY_ALL +}; + +enum CHalAddrType +{ + ADDR_NONE, + ADDR_STATIC, + ADDR_DYNAMIC +}; + +struct CHalInputDevice +{ + int instance; + std::string label; + std::string path; + bool connected; +}; + +struct CHalDvbDevice +{ + int instance; + std::string path; + bool connected; + bool ready; +}; + +class CHalNotification +{ +public: + CHalNotificationType GetType() { return m_nType; } + +protected: + CHalNotificationType m_nType; +}; + +class CHalInputNotification : public CHalNotification +{ +public: + CHalInputNotification( bool connected, int instance, std::string &label, std::string &path) + { + m_halInputDevice.instance = instance; + m_halInputDevice.label = label; + m_halInputDevice.path = path; + m_halInputDevice.connected = connected; + m_nType = HAL_NOTIFY_INPUT; + } + bool IsConnected() {return m_halInputDevice.connected;} + std::string GetPath() {return m_halInputDevice.path;} + std::string GetLabel() {return m_halInputDevice.label;} + int GetInstance() {return m_halInputDevice.instance;} + +private: + CHalInputDevice m_halInputDevice; +}; + +class CHalDvbNotification : public CHalNotification +{ +public: + CHalDvbNotification(bool connected, bool ready, int instance, std::string path) + { + m_halDvbDevice.instance = instance; + m_halDvbDevice.path = path; + m_halDvbDevice.connected = connected; + m_halDvbDevice.ready = ready; + m_nType = HAL_NOTIFY_DVB; + } + std::string GetPath() {return m_halDvbDevice.path;} + int GetInstance() {return m_halDvbDevice.instance;} + bool IsConnected() {return m_halDvbDevice.connected;} + bool IsReady() {return m_halDvbDevice.ready;} + +private: + CHalDvbDevice m_halDvbDevice; +}; + +struct CHalEthernetInfo +{ + CHalAddrType addr_type; + bool link_up; + bool running; + std::string ip_address; + std::string netmask; + std::string gateway; + std::string dns; + std::string mac_address; +}; + +struct CHalEthernetConfig +{ + CHalAddrType addr_type; + // relevant only for dynamic address + std::string ip_address; + std::string netmask; + std::string gateway; + std::string dns; +}; + +class CHalEthernetLinkStateNotification : public CHalNotification +{ +public: + CHalEthernetLinkStateNotification (bool linkUp):m_linkUp(linkUp) {m_nType = HAL_NOTIFY_ETHERNET_LINK_STATE;} + bool IsLinkUp() {return m_linkUp;} + +private: + bool m_linkUp; +}; + +class CHalEthernetAddressNotification : public CHalNotification +{ +public: + CHalEthernetAddressNotification (const CHalEthernetInfo ðInfo) {m_ethInfo = ethInfo;} + void GetLinkInfo (CHalEthernetInfo ðInfo) const {ethInfo = m_ethInfo;} + +private: + CHalEthernetInfo m_ethInfo; +}; + +enum CHalWirelessAuthType +{ + AUTH_NONE, + AUTH_DONTCARE, + AUTH_WEP_KEY, + AUTH_WEP_PASSPHRASE, + AUTH_WPAPSK, + AUTH_WPA2PSK +}; + +struct CHalWirelessInfo +{ + std::string ssid; + std::string mac_address; + CHalAddrType addr_type; + bool connected; + std::string ip_address; + std::string netmask; + std::string gateway; + std::string dns; +}; + +struct CHalWirelessConfig +{ + CHalAddrType addr_type; + std::string ssid; + CHalWirelessAuthType authType; + std::string password; + std::string ip_address; + std::string netmask; + std::string gateway; + std::string dns; +}; + +struct CHalWirelessNetwork +{ + CHalWirelessNetwork() {} + + CHalWirelessNetwork(const CHalWirelessNetwork& rhs) + { + *this = rhs; + } + + const CHalWirelessNetwork& operator=(const CHalWirelessNetwork& rhs) + { + ssid = rhs.ssid; + signal_strength = rhs.signal_strength; + secure = rhs.secure; + + return *this; + } + + std::string ssid; + unsigned long signal_strength; + bool secure; +}; + +class CHalWirelessStateNotification : public CHalNotification +{ +public: + CHalWirelessStateNotification (bool linkUp):m_linkUp(linkUp) { m_nType = HAL_NOTIFY_WIRELESS_LINK_STATE;} + bool IsUp() {return m_linkUp;} + +private: + bool m_linkUp; +}; + +class CHalWirelessAddressNotification : public CHalNotification +{ +public: + CHalWirelessAddressNotification (const CHalWirelessInfo &linkInfo) {m_linkInfo = linkInfo;} + void GetLinkInfo (CHalWirelessInfo &linkInfo) const {linkInfo = m_linkInfo;} + +private: + CHalWirelessInfo m_linkInfo; +}; + +#define HAL_MOUNT_POINT "/tmp/mnt/" + +struct CHalStorageDeviceInfo +{ + std::string dev_type; /* usb, sd, internal_hd */ + std::string fs_type; + std::string path; + std::string label; + bool mounted; +}; + +struct CHalShareInfo +{ + bool enabled; + std::string path; + std::string username; +}; + +class CHalStorageNotification : public CHalNotification +{ +public: + CHalStorageNotification(bool mounted, std::string &path, bool successfully) + { + m_halStorageDevice.path = path; + m_halStorageDevice.mounted = mounted; + m_nType = HAL_NOTIFY_STORAGE; + m_bSuccessfulMount = successfully; + } + bool IsMounted() {return m_halStorageDevice.mounted;}; + bool IsSuccessful() {return m_bSuccessfulMount;}; + std::string GetPath() {return m_halStorageDevice.path;}; + +private: + CHalStorageDeviceInfo m_halStorageDevice; + bool m_bSuccessfulMount; +}; + +struct CHalSoftwareInfo +{ + std::string version; + std::string regionSKU; + std::string language; + std::string compositeVideo; // "PAL" or "NTSC" +}; + +struct CHalHardwareInfo +{ + std::string vendor; + std::string model; + std::string revision; + std::string serialNumber; + std::string uniqueId; +}; + +enum CHalVpnMppeSetting +{ + CHalVpnMppeAuto, + CHalVpnMppeForce +}; + +enum CHalVpnTunnelType +{ + CHalVpnPPTP +}; + +enum CHalVpnStatus +{ + CHalVpnConnected, + CHalVpnDisconnected, + CHalVpnDisabled +}; + +struct CHALVpnConfig +{ + CHalVpnTunnelType tunnelType; + std::string host; + std::string username; + std::string password; + CHalVpnMppeSetting encType; +}; + +struct CHALVpnInfo +{ + CHalVpnTunnelType tunnelType; + std::string host; + std::string username; + std::string password; + CHalVpnMppeSetting encType; + CHalVpnStatus status; +}; + +class CHalVpnNotification : public CHalNotification +{ +public: + CHalVpnNotification(bool connected) + { + m_connected = connected; + m_nType = HAL_NOTIFY_VPN; + } + bool IsConnected() {return m_connected;}; + +private: + bool m_connected; +}; + + +class IHalListener +{ +public: + virtual ~IHalListener() {} + virtual void HandleNotification(CHalNotification ¬ification) = 0; +}; + +class IHalServices +{ +public: + virtual ~IHalServices() {} + virtual bool GetEthernetConfig(unsigned int nInstance, CHalEthernetConfig ðernetConfig ) = 0; + virtual bool SetEthernetConfig(unsigned int nInstance, const CHalEthernetConfig ðernetDevice) = 0; + virtual bool GetEthernetInfo(unsigned int nInstance, CHalEthernetInfo ðDevice) = 0; + + // wireless + virtual bool GetWirelessConfig(unsigned int nInstance, CHalWirelessConfig& wirelessDevice) = 0; + virtual bool SetWirelessConfig(unsigned int nInstance, CHalWirelessConfig& wirelessDevice) = 0; + virtual bool GetWirelessInfo(unsigned int nInstance, CHalWirelessInfo& wirelessDevice) = 0; + virtual bool SearchWireless(unsigned int nInstance, std::vector& wirelessNetworks) = 0; + + // clock + virtual bool SetTimezone(const std::string& strTimezone) = 0; + virtual bool GetTimezone(std::string& strTimezone) = 0; + virtual bool SetTime(const std::string& strTime) = 0; + + // power + virtual bool StandBy() = 0; + virtual bool Shutdown() = 0; + virtual bool Reboot() = 0; + virtual bool Resume() = 0; + + // input + virtual bool GetAllInputDevices(std::vector& inputDevices) = 0; + + // dvb + virtual bool GetAllDvbDevices(std::vector& dvbDevices) = 0; + + // storage + virtual bool GetAllStorageDevices(std::vector & storageDevicesInfo) = 0; + virtual bool EnableSambaShares(const std::string password, const std::string username = "", const std::string workgroup = "", const std::string hostname = "") = 0; + virtual bool DisableSambaShares() = 0; + virtual bool GetSambaConfig(bool &status, std::string &password, std::string &workgroup, std::string &hostname) = 0; + virtual bool EjectStorage(const std::string& path) = 0; + + // host + virtual bool SetHostName(const std::string& strHostname) = 0; + virtual bool GetHostName(std::string& strHostname) = 0; + + // led + virtual bool SetLEDBrightness(int instance, int startBrightness, int endBrightness) = 0; + virtual bool SetLEDState(bool isPlaying, bool isConnectedToInternet, bool isPowerSaving) = 0; + // thermals + virtual bool GetCPUTemperature(int& temperature) = 0; + virtual bool GetCPUFanSpeed(int& speed) = 0; + + // system + virtual bool GetHardwareInfo(CHalHardwareInfo& hardwareInfo) = 0; + virtual bool GetSoftwareInfo(CHalSoftwareInfo& softwareInfo) = 0; + virtual bool RequestUpgrade() = 0; + virtual bool SetAudioDACState(bool mute) = 0; + virtual bool AvahiDaemonRestart() = 0; + virtual bool DjmountRestart() = 0; + + //vpn + virtual bool VpnSetConfig(const CHALVpnConfig &vpnConfig) = 0; + virtual bool VpnDial() = 0; + virtual bool VpnHangup() = 0; + virtual bool VpnGetInfo(CHALVpnInfo &vpnInfo) = 0; + virtual bool VpnGetConfig(CHALVpnConfig &vpnConfig) = 0; + + // listener + virtual void AddListener(IHalListener *listener) = 0; +}; + +class CHalServicesFactory +{ +public: + static IHalServices& GetInstance(); +}; + +#endif + +#endif /* HALSERVICES_H_ */ diff --git a/xbmc/InitializeBoxManager.cpp b/xbmc/InitializeBoxManager.cpp new file mode 100644 index 00000000..704713aa --- /dev/null +++ b/xbmc/InitializeBoxManager.cpp @@ -0,0 +1,1494 @@ +#include "InitializeBoxManager.h" + +#ifdef HAS_EMBEDDED + +#include "GUIWindowManager.h" +#include "Application.h" +#include "log.h" +#include "GUIDialogFirstTimeUseBase.h" +#include "GUIDialogFirstTimeUseEthernet.h" +#include "GUIDialogFirstTimeUseWireless.h" +#include "GUIDialogFirstTimeUseConfWirelessPassword.h" +#include "GUIDialogFirstTimeUseConfWirelessSecurity.h" +#include "GUIDialogFirstTimeUseConfWirelessSSID.h" +#include "GUIDialogFirstTimeUseConfNetwork.h" +#include "GUIDialogFirstTimeUseNetworkMessage.h" +#include "GUIDialogFirstTimeUseUpdateMessage.h" +#include "GUIDialogFirstTimeUseUpdateProgress.h" +#include "GUIDialogFirstTimeUseSimpleMessage.h" +#include "GUIDialogProgress.h" +#include "GUIDialogOK2.h" +#include "Resolution.h" +#include "LocalizeStrings.h" +#include "GUILabelControl.h" +#include "Util.h" +#include "GUIInfoManager.h" +#include "GUIWindowSettingsCategory.h" +#include "BoxeeUtils.h" +#include "utils/Weather.h" +#include "BoxeeVersionUpdateManager.h" + +#define CHECK_INTERNET_WIRELESS_CONNECTION_IN_SEC 20 +#define CHECK_INTERNET_WIRED_CONNECTION_IN_SEC 8 +#define SUCCEEDED 0 + +CInitializeBoxManager::CInitializeBoxManager() +{ + m_isConnectViaEthernet = true; + m_hal = &(CHalServicesFactory::GetInstance()); + m_loginViaCustomWirelessNetwork = false; + m_initCompleted = false; + m_updateCompleted = false; + m_runFromSettings = false; + m_updateVersionStatus = CUpdateVersionStatus::NO_UPDATE; +} + +CInitializeBoxManager::~CInitializeBoxManager() +{ + +} + +CInitializeBoxManager& CInitializeBoxManager::GetInstance() +{ + static CInitializeBoxManager initializeBoxManager; + + return initializeBoxManager; +} + +bool CInitializeBoxManager::Run(bool runFromSettings) +{ + CLog::Log(LOGDEBUG,"CInitializeBoxManager::Initialize - Enter function. [runFromSettings=%d] (initbox)",runFromSettings); + + m_runFromSettings = runFromSettings; + + m_isConnectViaEthernet = true; + m_loginViaCustomWirelessNetwork = false; + m_initCompleted = false; + m_updateCompleted = false; + m_updateVersionStatus = CUpdateVersionStatus::NO_UPDATE; + + CGUIDialogFirstTimeUseBase* pDialog = NULL; + + if (m_runFromSettings) + { + pDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_WELCOME); + pDialog->SetActionChose(CActionChose::NEXT); + + // if we entered from settings -> start with the action performed on exit WINDOW_DIALOG_FTU_WELCOME dialog + pDialog = GetNextDialog(pDialog); + } + else + { + pDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_LANG); + } + + if (!m_initCompleted && !pDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::Run - FAILED to get first FTU dialog (initbox)"); + return false; + } + + // clear dialog stack + while(!m_dialogStack.empty()) + { + m_dialogStack.pop(); + } + + g_windowManager.ActivateWindow(WINDOW_FTU_BACKGROUND); + + while (!m_initCompleted) + { + if (!pDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::Run - init - FAILED to get next dialog -> Break (initbox)"); + break; + } + + pDialog->DoModal(); + + pDialog = GetNextDialog(pDialog); + } + + if (m_initCompleted) + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::Run - Initializing box was completed. [InitCompleted=%d] (initbox)",m_initCompleted); + + if (m_runFromSettings) + { + bool retVal = PostFtuFromSettings(); + g_windowManager.PreviousWindow(); + return retVal; + } + } + else + { + CLog::Log(LOGERROR,"CInitializeBoxManager::Run - FAILED to Initialize the box -> Finish. [InitCompleted=%d][runFromSettings=%d] (initbox)",m_initCompleted,m_runFromSettings); + g_windowManager.PreviousWindow(); + return false; + } + + PostFtuInitialization(); + + if (m_initCompleted) + { + if (CheckForNewVersion()) + { + m_updateVersionStatus = CUpdateVersionStatus::HAS_UPDATE; + + pDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_UPDATE_MESSAGE); + + while (!m_updateCompleted) + { + if (!pDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::Run - update - FAILED to get next dialog. Break (initbox)"); + break; + } + + pDialog->DoModal(); + + pDialog = GetNextDialog(pDialog); + } + + if (m_updateCompleted) + { + m_updateVersionStatus = CUpdateVersionStatus::UPDATE_SUCCEEDED; + CLog::Log(LOGDEBUG,"CInitializeBoxManager::Run - Downloading updating box was completed. Going to reboot box [m_updateCompleted=%d][InitCompleted=%d] (initbox)",m_updateCompleted,m_initCompleted); + } + else + { + m_updateVersionStatus = CUpdateVersionStatus::UPDATE_FAILED; + CLog::Log(LOGERROR,"CInitializeBoxManager::Run - FAILED to update the box. [m_updateCompleted=%d][InitCompleted=%d] (initbox)",m_updateCompleted,m_initCompleted); + } + } + else + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::Run - There is no new update -> continue. [m_updateCompleted=%d][InitCompleted=%d] (initbox)",m_updateCompleted,m_initCompleted); + } + } + + g_windowManager.PreviousWindow(); + + return true; +} + +CGUIDialogFirstTimeUseBase* CInitializeBoxManager::GetNextDialog(CGUIDialogFirstTimeUseBase* pDialog) +{ + if (!pDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::GetNextDialog - Enter function with a NULL pointer (initbox)"); + return NULL; + } + + CActionChose::ActionChoseEnums actionChose = pDialog->GetActionChose(); + if (actionChose == CActionChose::ERROR) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::GetNextDialog - Action chose enum is ERROR (initbox)"); + return NULL; + } + + CGUIDialogFirstTimeUseBase* pNextWindow = NULL; + + switch(actionChose) + { + case CActionChose::NEXT: + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::GetNextDialog - For [windowId=%d] handling [ActionChose=%d=NEXT] (initbox)",pDialog->GetID(),actionChose); + + pNextWindow = HandleNextAction(pDialog); + } + break; + case CActionChose::BACK: + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::GetNextDialog - For [windowId=%d] handling [ActionChose=%d=BACK] (initbox)",pDialog->GetID(),actionChose); + + pNextWindow = HandleBackAction(pDialog); + } + break; + default: + { + CLog::Log(LOGERROR,"CInitializeBoxManager::GetNextDialog - FAILED to handle ActionChoseEnum [%d] (initbox)",actionChose); + } + break; + } + + return pNextWindow; +} + +CGUIDialogFirstTimeUseBase* CInitializeBoxManager::HandleNextAction(CGUIDialogFirstTimeUseBase* pDialog) +{ + if (!pDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextAction - Enter function with a NULL pointer (initbox)"); + return NULL; + } + + int id = pDialog->GetID(); + + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - Enter function with [id=%d] (initbox)",id); + + CGUIDialogFirstTimeUseBase* pNextDialog = NULL; + bool addToStack = false; + + switch(id) + { + case WINDOW_DIALOG_FTU_LANG: + { + pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_WELCOME); + + if (pNextDialog) + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - For [id=%d=WINDOW_DIALOG_FTU_LANG] got next window [id=%d=WINDOW_DIALOG_FTU_WELCOME] (initbox)",id,WINDOW_DIALOG_FTU_WELCOME); + addToStack = true; + } + } + break; + case WINDOW_DIALOG_FTU_WELCOME: + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - For [id=%d=WINDOW_DIALOG_FTU_WELCOME] going to call HandleNextWellcomeDialog() (initbox)",id); + addToStack = HandleNextWellcomeDialog(&pNextDialog,ADDR_DYNAMIC); + } + break; + case WINDOW_DIALOG_FTU_NETWORK_MESSAGE: + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - For [id=%d=WINDOW_DIALOG_FTU_NETWORK_MESSAGE] going to call HandleNextNetworkMessageDialog() (initbox)",id); + HandleNextNetworkMessageDialog(&pNextDialog); + } + break; + case WINDOW_DIALOG_FTU_WIRELESS: + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - For [id=%d=WINDOW_DIALOG_FTU_AUDIO] going to call HandleNextAudioDialog() (initbox)",id); + addToStack = HandleNextWirelessDialog(&pNextDialog); + } + break; + case WINDOW_DIALOG_FTU_CONF_WIRELESS_PASSWORD: + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - For [id=%d=WINDOW_DIALOG_FTU_CONF_WIRELESS_PASSWORD] going to call HandleNextConfWirelessPasswordDialog() (initbox)",id); + HandleNextConfWirelessPasswordDialog(&pNextDialog); + } + break; + case WINDOW_DIALOG_FTU_CONF_WIRELESS_SSID: + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - For [id=%d=WINDOW_DIALOG_FTU_CONF_WIRELESS_SSID] going to call HandleNextConfWirelessSsidDialog() (initbox)",id); + HandleNextConfWirelessSsidDialog(&pNextDialog); + } + break; + case WINDOW_DIALOG_FTU_CONF_WIRELESS_SECURITY: + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - For [id=%d=WINDOW_DIALOG_FTU_CONF_WIRELESS_SECURITY] going to call HandleNextConfWirelessSecurityDialog() (initbox)",id); + HandleNextConfWirelessSecurityDialog(&pNextDialog); + } + break; + case WINDOW_DIALOG_FTU_CONF_NETWORK: + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - For [id=%d=WINDOW_DIALOG_FTU_CONF_NETWORK] going to call HandleNextConfNetworkDialog() (initbox)",id); + HandleNextConfNetworkDialog(&pNextDialog); + } + break; + case WINDOW_DIALOG_FTU_UPDATE_MESSAGE: + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - For [id=%d=WINDOW_DIALOG_FTU_UPDATE_MESSAGE] going to call HandleNextUpdateMessageDialog() (initbox)",id); + HandleNextUpdateMessageDialog(&pNextDialog); + } + break; + case WINDOW_DIALOG_FTU_UPDATE_PROGRESS: + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - For [id=%d=WINDOW_DIALOG_FTU_UPDATE_PROGRESS] going to call HandleNextUpdateProgressDialog() (initbox)",id); + HandleNextUpdateProgressDialog(&pNextDialog); + } + break; + case WINDOW_DIALOG_FTU_SIMPLE_MESSAGE: + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - For [id=%d=WINDOW_DIALOG_FTU_SIMPLE_MESSAGE] going to call HandleNextSimpleMessageDialog() (initbox)",id); + HandleNextSimpleMessageDialog(&pNextDialog); + } + default: + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextAction - FAILED to handle WindowId [%d] (initbox)",id); + } + break; + } + + if (addToStack && (m_dialogStack.empty() || m_dialogStack.top() != id)) + { + m_dialogStack.push(id); + } + else + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - Not adding [id=%d] to stack. [addToStack=%d][DialogStackSize=%d] (initbox)",id,addToStack,(int)m_dialogStack.size()); + } + + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextAction - Exit function and return [NextDialog=%p] for [id=%d] (initbox)",pNextDialog,id); + + return pNextDialog; +} + +bool CInitializeBoxManager::HandleNextWellcomeDialog(CGUIDialogFirstTimeUseBase** pNextDialog, CHalAddrType addrType, bool onRetry) +{ + m_isConnectViaEthernet = true; + + if (!IsEthernetConnected()) + { + if (onRetry) + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextWellcomeDialog - Not connect via Ethernet. Show error message. [onRetry=%d] (initbox)",onRetry); + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_NETWORK_MESSAGE); + + if (*pNextDialog) + { + ((CGUIDialogFirstTimeUseNetworkMessage*)(*pNextDialog))->SetMessage(g_localizeStrings.Get(54637)); + } + else + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextWellcomeDialog - 1 - FAILED to get WINDOW_DIALOG_FTU_NETWORK_MESSAGE in order to set the correct message. [onRetry=%d] (initbox)",onRetry); + } + } + else + { + m_isConnectViaEthernet = false; + + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextWellcomeDialog - Not connect via Ethernet. Set next window [WINDOW_DIALOG_FTU_WIRELESS=%d]. [onRetry=%d] (initbox)",WINDOW_DIALOG_FTU_WIRELESS,onRetry); + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_WIRELESS); + } + + return true; + } + + if (!ConnectToEthernet(0,addrType/*ADDR_DYNAMIC*/)) + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextWellcomeDialog - Has Ethernet connection but FAILED to connect. Set next window [WINDOW_DIALOG_FTU_NETWORK_MESSAGE=%d] (initbox)",WINDOW_DIALOG_FTU_NETWORK_MESSAGE); + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_NETWORK_MESSAGE); + + if (*pNextDialog) + { + ((CGUIDialogFirstTimeUseNetworkMessage*)(*pNextDialog))->SetMessage(g_localizeStrings.Get(54638)); + } + else + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextWellcomeDialog - 2 - FAILED to get WINDOW_DIALOG_FTU_NETWORK_MESSAGE in order to set the correct message (initbox)"); + } + + return true; + } + + // check internet for wired connection + if (HasInternetConnection(WIRED_INTERFACE_ID, CHECK_INTERNET_WIRED_CONNECTION_IN_SEC) != CONNECTED_TO_INTERNET) + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextLangDialog - Test internet connection FAILED. Set next window [WINDOW_DIALOG_FTU_NETWORK_MESSAGE=%d] (initbox)",WINDOW_DIALOG_FTU_NETWORK_MESSAGE); + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_NETWORK_MESSAGE); + + if (*pNextDialog) + { + ((CGUIDialogFirstTimeUseNetworkMessage*)(*pNextDialog))->SetMessage(g_localizeStrings.Get(54696)); + } + else + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextWellcomeDialog - 3 - FAILED to get WINDOW_DIALOG_FTU_NETWORK_MESSAGE in order to set the correct message (initbox)"); + } + + return true; + } + + // Internet is OK -> done with FTU + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextLangDialog - SUCCEEDED to connect via Ethernet. [runFromSettings=%d] (initbox)",m_runFromSettings); + + m_initCompleted = true; + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextLangDialog - After Set [InitCompleted=%d] (initbox)",m_initCompleted); + + return true; +} + +bool CInitializeBoxManager::HandleNextNetworkMessageDialog(CGUIDialogFirstTimeUseBase** pNextDialog) +{ + CGUIDialogFirstTimeUseNetworkMessage* pDialog = (CGUIDialogFirstTimeUseNetworkMessage*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_NETWORK_MESSAGE); + if (!pDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextNetworkMessageDialog - FAILED to get WINDOW_DIALOG_FTU_NETWORK_MESSAGE (initbox)"); + return false; + } + + int buttonClicked = pDialog->GetButtonClicked(); + + switch (buttonClicked) + { + case TRY_AGAIN_BUTTON_CONTROL: + { + if (m_isConnectViaEthernet) + { + return HandleNextWellcomeDialog(pNextDialog,ADDR_DYNAMIC,true); + } + else + { + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_WIRELESS); + return true; + + //return HandleNextWirelessDialog(pNextDialog); + } + } + break; + case SWITCH_CONNECTION_TYPE_BUTTON_CONTROL: + { + int switchTo = pDialog->GetSwitchToType(); + + if (switchTo == SWITCH_TO_ETHETNET_BUTTON) + { + m_isConnectViaEthernet = true; + return HandleNextWellcomeDialog(pNextDialog,ADDR_DYNAMIC,true); + } + else if (switchTo == SWITCH_TO_WIRELESS_BUTTON) + { + m_isConnectViaEthernet = false; + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextNetworkMessageDialog - [buttonId=%d=SWITCH_TO_WIRELESS_CONTROL] -> Set next window [WINDOW_DIALOG_FTU_WIRELESS=%d] (initbox)",buttonClicked,WINDOW_DIALOG_FTU_WIRELESS); + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_WIRELESS); + return true; + } + else + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextNetworkMessageDialog - FAILED to handle button with switch type of [%d] (initbox)",switchTo); + return false; + } + } + break; + case ADJUST_NETWORK_SETTINGS_BUTTON_CONTROL: + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextNetworkMessageDialog - [buttonId=%d=ADJUST_NETWORK_SETTINGS_BUTTON_CONTROL] -> Set next window [WINDOW_DIALOG_FTU_CONF_NETWORK=%d] (initbox)",buttonClicked,WINDOW_DIALOG_FTU_CONF_NETWORK); + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_NETWORK); + return true; + } + break; + default: + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextNetworkMessageDialog - FAILED to handle [buttonId=%d] (initbox)",buttonClicked); + return false; + } + break; + } + + return false; +} + +bool CInitializeBoxManager::HandleNextWirelessDialog(CGUIDialogFirstTimeUseBase** pNextDialog) +{ + CGUIDialogFirstTimeUseWireless* pDialog = (CGUIDialogFirstTimeUseWireless*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_WIRELESS); + if (!pDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextWirelessDialog - FAILED to get WINDOW_DIALOG_FTU_WIRELESS (initbox)"); + return false; + } + + m_isConnectViaEthernet = false; + + if (!pDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextWirelessDialog - Enter function with [pDialog=NULL] (initbox)"); + return false; + } + + if (pDialog->HasSelectedItem()) + { + // item was selected from the list + + m_loginViaCustomWirelessNetwork = false; + CFileItemPtr wlItem = pDialog->GetSelectedItem(); + if (wlItem->GetPropertyBOOL("wln-secure")) + { + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_WIRELESS_PASSWORD); + + if (*pNextDialog) + { + ((CGUIDialogFirstTimeUseConfWirelessPassword*)(*pNextDialog))->SetNetworkName(wlItem->GetProperty("wln-ssid"),true); + } + + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextWirelessDialog - For [id=%d=WINDOW_DIALOG_FTU_WIRELESS] got next window [id=%d=WINDOW_DIALOG_FTU_CONF_WIRELESS_PASSWORD] (initbox)",WINDOW_DIALOG_FTU_WIRELESS,WINDOW_DIALOG_FTU_CONF_WIRELESS_PASSWORD); + return true; + } + else + { + CStdString errorMessage = ""; + if (!ConnectToWireless(0,ADDR_DYNAMIC,"",errorMessage)) + { + // error log will be written from ConnectToWireless + + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_NETWORK_MESSAGE); + if (*pNextDialog) + { + ((CGUIDialogFirstTimeUseNetworkMessage*)(*pNextDialog))->SetMessage(errorMessage); + } + else + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextWirelessDialog - FAILED to get WINDOW_DIALOG_FTU_NETWORK_MESSAGE in order to set the correct message (initbox)"); + } + + return false; + } + + // Internet is OK -> done with FTU + m_initCompleted = true; + return true; + } + } + else + { + switch(pDialog->GetChoiceSelected()) + { + case JOIN_OTHER_NETWORKS_BUTTON: + { + m_loginViaCustomWirelessNetwork = true; + + // reset old data in CGUIDialogFirstTimeUseConfWirelessSSID and CGUIDialogFirstTimeUseConfWirelessPassword + CGUIDialogFirstTimeUseConfWirelessSSID* pSsidWireless = (CGUIDialogFirstTimeUseConfWirelessSSID*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_WIRELESS_SSID); + if (pSsidWireless) + { + pSsidWireless->SetSSID(""); + } + + CGUIDialogFirstTimeUseConfWirelessPassword* pPasswordDialog = (CGUIDialogFirstTimeUseConfWirelessPassword*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_WIRELESS_PASSWORD); + if (pPasswordDialog) + { + pPasswordDialog->SetPassword(""); + } + + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_WIRELESS_SSID); + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextWirelessDialog - For [id=%d=WINDOW_DIALOG_FTU_WIRELESS] got next window [id=%d=WINDOW_DIALOG_FTU_CONF_WIRELESS_SSID] (initbox)",WINDOW_DIALOG_FTU_WIRELESS,WINDOW_DIALOG_FTU_CONF_WIRELESS_SSID); + return true; + } + break; + case SWITCH_TO_ETHERNET_BUTTON: + { + m_isConnectViaEthernet = true; + return HandleNextWellcomeDialog(pNextDialog,ADDR_DYNAMIC,true); + } + break; + } + + return true; + } +} + +bool CInitializeBoxManager::HandleNextConfWirelessPasswordDialog(CGUIDialogFirstTimeUseBase** pNextDialog) +{ + CGUIDialogFirstTimeUseConfWirelessPassword* pConfWirelessDialog = (CGUIDialogFirstTimeUseConfWirelessPassword*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_WIRELESS_PASSWORD); + if (!pConfWirelessDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextConfWirelessPasswordDialog - FAILED to get WINDOW_DIALOG_FTU_CONF_WIRELESS_PASSWORD (initbox)"); + return false; + } + + // try to connect via wireless + CStdString errorMessage = ""; + if (!ConnectToWireless(0,ADDR_DYNAMIC,pConfWirelessDialog->GetPassword(),errorMessage)) + { + // error log will be written from ConnectToWireless + + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_NETWORK_MESSAGE); + if (*pNextDialog) + { + ((CGUIDialogFirstTimeUseNetworkMessage*)(*pNextDialog))->SetMessage(errorMessage); + } + else + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextConfWirelessPasswordDialog - FAILED to get WINDOW_DIALOG_FTU_NETWORK_MESSAGE in order to set the correct message (initbox)"); + } + + return false; + } + + // Internet is OK -> done with FTU + m_initCompleted = true; + return true; +} + +bool CInitializeBoxManager::HandleNextConfWirelessSsidDialog(CGUIDialogFirstTimeUseBase** pNextDialog) +{ + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_WIRELESS_SECURITY); + if (!(*pNextDialog)) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextConfWirelessSsidDialog - FAILED to get WINDOW_DIALOG_FTU_CONF_WIRELESS_SECURITY (initbox)"); + } + + return true; +} + +bool CInitializeBoxManager::HandleNextConfWirelessSecurityDialog(CGUIDialogFirstTimeUseBase** pNextDialog) +{ + CGUIDialogFirstTimeUseConfWirelessSecurity* pDialog = (CGUIDialogFirstTimeUseConfWirelessSecurity*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_WIRELESS_SECURITY); + if (!pDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextConfWirelessSecurityDialog - FAILED to get WINDOW_DIALOG_FTU_CONF_WIRELESS_SECURITY (initbox)"); + return false; + } + + if (pDialog->GetAuth() != AUTH_NONE) + { + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_WIRELESS_PASSWORD); + if (!(*pNextDialog)) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextConfWirelessSecurityDialog - FAILED to get WINDOW_DIALOG_FTU_CONF_WIRELESS_PASSWORD (initbox)"); + } + else + { + CGUIDialogFirstTimeUseConfWirelessSSID* pSsidWireless = (CGUIDialogFirstTimeUseConfWirelessSSID*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_WIRELESS_SSID); + if (pSsidWireless) + { + ((CGUIDialogFirstTimeUseConfWirelessPassword*)(*pNextDialog))->SetNetworkName(pSsidWireless->GetSSID(), true); + } + } + + return true; + } + else + { + CStdString errorMessage = ""; + if (!ConnectToWireless(0,ADDR_DYNAMIC,"",errorMessage)) + { + // error log will be written from ConnectToWireless + + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_NETWORK_MESSAGE); + if (*pNextDialog) + { + ((CGUIDialogFirstTimeUseNetworkMessage*)(*pNextDialog))->SetMessage(errorMessage); + } + else + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextWirelessDialog - FAILED to get WINDOW_DIALOG_FTU_NETWORK_MESSAGE in order to set the correct message (initbox)"); + } + + return false; + } + + // Internet is OK -> done with FTU + m_initCompleted = true; + return true; + } +} + +bool CInitializeBoxManager::HandleNextConfNetworkDialog(CGUIDialogFirstTimeUseBase** pNextDialog) +{ + if (m_isConnectViaEthernet) + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextConfNetworkDialog - Try to connect via Ethernet (initbox)"); + return HandleNextWellcomeDialog(pNextDialog,ADDR_STATIC,true); + } + else + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextConfNetworkDialog - Try to connect via Wireless (initbox)"); + + CStdString errorMessage = ""; + if (!ConnectToWireless(0,ADDR_STATIC,"",errorMessage)) + { + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_NETWORK_MESSAGE); + if (*pNextDialog) + { + ((CGUIDialogFirstTimeUseNetworkMessage*)(*pNextDialog))->SetMessage(errorMessage); + } + else + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextConfNetworkDialog - FAILED to get WINDOW_DIALOG_FTU_NETWORK_MESSAGE in order to set the correct message (initbox)"); + } + + return false; + } + } + + // connect -> done with FTU + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextConfNetworkDialog - SUCCEEDED to connect. Set [m_initCompleted=%d] (initbox)",m_initCompleted); + m_initCompleted = true; + return true; +} + +bool CInitializeBoxManager::HandleNextUpdateMessageDialog(CGUIDialogFirstTimeUseBase** pNextDialog) +{ + CGUIDialogFirstTimeUseUpdateMessage* pDialog = (CGUIDialogFirstTimeUseUpdateMessage*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_UPDATE_MESSAGE); + if (!pDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextUpdateMessageDialog - FAILED to get WINDOW_DIALOG_FTU_UPDATE_MESSAGE (initbox)"); + return false; + } + + switch(m_updateVersionStatus) + { + case CUpdateVersionStatus::NO_UPDATE: + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextUpdateMessageDialog - Update status is [%d=NO_UPDATE] -> Not handling (initbox)",(int)m_updateVersionStatus); + } + break; + case CUpdateVersionStatus::HAS_UPDATE: + { +#ifdef HAS_EMBEDDED + g_boxeeVersionUpdateManager.StartUpdate(); +#endif + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_UPDATE_PROGRESS); + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextUpdateMessageDialog - Update status is [%d=HAS_UPDATE]. got next window [id=%d=WINDOW_DIALOG_FTU_UPDATE_PROGRESS] (initbox)",(int)m_updateVersionStatus,WINDOW_DIALOG_FTU_UPDATE_PROGRESS); + } + break; + case CUpdateVersionStatus::UPDATING: + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextUpdateMessageDialog - Update status is [%d=UPDATING] -> Not handling (initbox)",(int)m_updateVersionStatus); + } + break; + case CUpdateVersionStatus::UPDATE_SUCCEEDED: + { + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_UPDATE_MESSAGE); + m_updateVersionStatus = CUpdateVersionStatus::REQUEST_UPGRADE; + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextUpdateMessageDialog - Update status is [%d=UPDATE_SUCCEEDED]. Set it to [REQUEST_UPGRADE]. [m_updateCompleted=%d] (initbox)",(int)m_updateVersionStatus,m_updateCompleted); + } + break; + case CUpdateVersionStatus::UPDATE_FAILED: + { + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_UPDATE_MESSAGE); + m_updateVersionStatus = CUpdateVersionStatus::HAS_UPDATE; + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextUpdateMessageDialog - Update status is [%d=UPDATE_FAILED]. Set it to [HAS_UPDATE]. [m_updateCompleted=%d] (initbox)",(int)m_updateVersionStatus,m_updateCompleted); + } + break; + default: + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextUpdateMessageDialog - UNKNOWN Update status [%d] -> Not handling (initbox)",(int)m_updateVersionStatus); + } + break; + } + + return true; +} + +bool CInitializeBoxManager::HandleNextUpdateProgressDialog(CGUIDialogFirstTimeUseBase** pNextDialog) +{ + CGUIDialogFirstTimeUseUpdateProgress* pDialog = (CGUIDialogFirstTimeUseUpdateProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_UPDATE_PROGRESS); + if (!pDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextUpdateProgressDialog - FAILED to get WINDOW_DIALOG_FTU_UPDATE_PROGRESS (initbox)"); + return false; + } + + VERSION_UPDATE_DOWNLOAD_STATUS downloadStatus = pDialog->GetDownloadStatus(); + switch(downloadStatus) + { + case VUDS_FINISHED: + { + m_updateVersionStatus = CUpdateVersionStatus::UPDATE_SUCCEEDED; + + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_UPDATE_MESSAGE); + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextUpdateProgressDialog - Update finished successfully. Set status to [%d=UPDATE_SUCCEEDED]. got next window [id=%d=WINDOW_DIALOG_FTU_UPDATE_MESSAGE] (initbox)",(int)m_updateVersionStatus,WINDOW_DIALOG_FTU_UPDATE_MESSAGE); + } + break; + case VUDS_FAILED: + { + m_updateVersionStatus = CUpdateVersionStatus::UPDATE_FAILED; + + *pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_UPDATE_MESSAGE); + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextUpdateProgressDialog - Update FAILED. Set status to [%d=UPDATE_FAILED]. got next window [id=%d=WINDOW_DIALOG_FTU_UPDATE_MESSAGE] (initbox)",(int)m_updateVersionStatus,WINDOW_DIALOG_FTU_UPDATE_MESSAGE); + } + break; + default: + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleNextUpdateProgressDialog - UNKNOWN download status [%d] -> Not handling (initbox)",(int)downloadStatus); + } + break; + } + + return true; +} + +bool CInitializeBoxManager::HandleNextSimpleMessageDialog(CGUIDialogFirstTimeUseBase** pNextDialog) +{ + m_initCompleted = true; + CLog::Log(LOGDEBUG,"CInitializeBoxManager::HandleNextSimpleMessageDialog - Enter function. After set [InitCompleted=%d]. [runFromSettings=%d] (initbox)",m_initCompleted,m_runFromSettings); + return true; +} + +CGUIDialogFirstTimeUseBase* CInitializeBoxManager::HandleBackAction(CGUIDialogFirstTimeUseBase* pDialog) +{ + if (!pDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleBackAction - Enter function with a NULL pointer (initbox)"); + return NULL; + } + + CGUIDialogFirstTimeUseBase* pNextDialog = NULL; + + if ((int)m_dialogStack.size() < 1) + { + if (g_stSettings.m_doneFTU) + { + CLog::Log(LOGWARNING,"CInitializeBoxManager::HandleBackAction - Size of dialogStack is [%d] (initbox)",(int)m_dialogStack.size()); + return NULL; + } + else + { + pNextDialog = pDialog; + } + } + else + { + bool foundBackWindow = false; + int nextDialogId; + + while (!foundBackWindow) + { + nextDialogId = m_dialogStack.top(); + m_dialogStack.pop(); + + if (nextDialogId != pDialog->GetID() || ((int)m_dialogStack.size()) < 1) + { + // not the same id OR no more id's in the stack -> break + foundBackWindow = true; + } + } + + pNextDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(nextDialogId); + + if (!pNextDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::HandleBackAction - FAILED to get dialog for [id=%d] (initbox)",nextDialogId); + } + } + + return pNextDialog; +} + +bool CInitializeBoxManager::IsEthernetConnected() +{ + CHalEthernetInfo heInfo; + + if (!m_hal->GetEthernetInfo(0,heInfo)) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::IsEthernetConnected - FAILED to get EthernetInfo. Return FALSE for HasEthernet (initbox)"); + return false; + } + + bool hasEthernet = (heInfo.link_up && heInfo.running); + + if (hasEthernet) + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::IsEthernetConnected - [hasEthernet=%d] -> Return TRUE (initbox)",hasEthernet); + return true; + } + else + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::IsEthernetConnected - [hasEthernet=%d] -> Return FALSE (initbox)",hasEthernet); + return false; + } +} + +bool CInitializeBoxManager::ConnectToEthernet(unsigned int instance, CHalAddrType addrType) +{ + CGUIDialogProgress* pDialogProgress = NULL; + StartDialogProgress(&pDialogProgress); + + CHalEthernetConfig heConfig; + + switch(addrType) + { + case ADDR_DYNAMIC: + { + heConfig.addr_type = addrType; + } + break; + case ADDR_STATIC: + { + CGUIDialogFirstTimeUseConfNetwork* pConfNetworkDialog = (CGUIDialogFirstTimeUseConfNetwork*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_NETWORK); + + if (!pConfNetworkDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::ConnectToEthernet - FAILED to get CGUIDialogFirstTimeUseConfNetwork object (initbox)"); + StopDialogProgress(pDialogProgress); + return false; + } + + heConfig.addr_type = addrType; + heConfig.dns = pConfNetworkDialog->GetDNS(); + heConfig.gateway = pConfNetworkDialog->GetGateway(); + heConfig.ip_address = pConfNetworkDialog->GetIpAddress(); + heConfig.netmask = pConfNetworkDialog->GetNetmask(); + } + break; + default: + { + CLog::Log(LOGERROR,"CInitializeBoxManager::ConnectToEthernet - UNKNOWN [addrType=%d] to handle (initbox)",addrType); + StopDialogProgress(pDialogProgress); + return false; + } + break; + } + + bool retVal; + + if (!m_hal->SetEthernetConfig(instance,heConfig)) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::ConnectToEthernet - FAILED to connect via Ethernet. [instance=%d][AddrType=%d] (initbox)",instance,heConfig.addr_type); + retVal = false; + } + else + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::ConnectToEthernet - SUCCEEDED to connect via Ethernet. [instance=%d][AddrType=%d] (initbox)",instance,heConfig.addr_type); + + // succeeded to connect via Ethernet -> check Internet connection + if (HasInternetConnection(WIRED_INTERFACE_ID, CHECK_INTERNET_WIRED_CONNECTION_IN_SEC) != CONNECTED_TO_INTERNET) + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::ConnectToEthernet - Has Ethernet connection but check Internet connection FAILED (initbox)"); + retVal = false; + } + else + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::ConnectToEthernet - Has Ethernet connection and check Internet connection SUCCEEDED (initbox)"); + g_application.NetworkConfigurationChanged(); + retVal = true; + } + } + + StopDialogProgress(pDialogProgress); + + return retVal; +} + +bool CInitializeBoxManager::ConnectToWireless(unsigned int instance, CHalAddrType addrType, const CStdString& password, CStdString& errorMessage) +{ + CFileItem wlItem; + if (!GetWirelessNetworkToConnectItem(wlItem,password)) + { + errorMessage = g_localizeStrings.Get(54639); + CLog::Log(LOGERROR,"CInitializeBoxManager::ConnectToWireless - FAILED to get selected wireless network item (initbox)"); + return false; + } + + CGUIDialogProgress* pDialogProgress = NULL; + StartDialogProgress(&pDialogProgress); + + CHalWirelessConfig hwConfig; + + switch(addrType) + { + case ADDR_DYNAMIC: + { + hwConfig.addr_type = addrType; + hwConfig.ssid = wlItem.GetProperty("wln-ssid"); + hwConfig.password = wlItem.GetProperty("wln-password"); + hwConfig.authType = (CHalWirelessAuthType)wlItem.GetPropertyInt("wln-auth"); + } + break; + case ADDR_STATIC: + { + + CGUIDialogFirstTimeUseConfNetwork* pConfNetworkDialog = (CGUIDialogFirstTimeUseConfNetwork*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_NETWORK); + + if (!pConfNetworkDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::ConnectToWireless - FAILED to get CGUIDialogFirstTimeUseConfNetwork object (initbox)"); + StopDialogProgress(pDialogProgress); + return false; + } + + hwConfig.addr_type = addrType; + hwConfig.ssid = wlItem.GetProperty("wln-ssid"); + hwConfig.password = wlItem.GetProperty("wln-password"); + hwConfig.dns = pConfNetworkDialog->GetDNS(); + hwConfig.gateway = pConfNetworkDialog->GetGateway(); + hwConfig.ip_address = pConfNetworkDialog->GetIpAddress(); + hwConfig.netmask = pConfNetworkDialog->GetNetmask(); + } + break; + default: + { + errorMessage = g_localizeStrings.Get(54639); + CLog::Log(LOGERROR,"CInitializeBoxManager::ConnectToWireless - UNKNOWN [addrType=%d] to handle (initbox)",addrType); + StopDialogProgress(pDialogProgress); + return false; + } + break; + } + + bool retVal; + + if (!m_hal->SetWirelessConfig(instance,hwConfig)) + { + errorMessage = g_localizeStrings.Get(54639); + CLog::Log(LOGERROR,"CInitializeBoxManager::ConnectToWireless - FAILED to connect via Wireless. [instance=%d][ssid=%s][AddrType=%d] (initbox)",instance,hwConfig.ssid.c_str(),hwConfig.addr_type); + retVal = false; + } + else + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::ConnectToWireless - SUCCEEDED to connect via Wireless [instance=%d][ssid=%s][AddrType=%d] (initbox)",instance,hwConfig.ssid.c_str(),hwConfig.addr_type); + + NetworkConnectionStatus netStatus = HasInternetConnection(WIRELESS_INTERFACE_ID, CHECK_INTERNET_WIRELESS_CONNECTION_IN_SEC); + // succeeded to connect via Wireless -> check Internet connection + if (netStatus == NETWORK_DOWN) + { + errorMessage = g_localizeStrings.Get(57100); + CLog::Log(LOGERROR,"CInitializeBoxManager::ConnectToWireless - Has Wireless connection [%s] but check Internet connection FAILED (initbox)",hwConfig.ssid.c_str()); + retVal = false; + } + else if (netStatus == NO_INTERNET_CONNECTION) + { + errorMessage = g_localizeStrings.Get(54697); + CLog::Log(LOGERROR,"CInitializeBoxManager::ConnectToWireless - Has Wireless connection [%s] but check Internet connection FAILED (initbox)",hwConfig.ssid.c_str()); + retVal = false; + } + else + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::ConnectToWireless - Has Wireless connection [%s] and check Internet connection SUCCEEDED (initbox)",hwConfig.ssid.c_str()); + retVal = true; + + g_application.NetworkConfigurationChanged(); + } + } + + StopDialogProgress(pDialogProgress); + + return retVal; +} + +bool CInitializeBoxManager::GetWirelessNetworkToConnectItem(CFileItem& wlItem, const CStdString& password) +{ + if (!m_loginViaCustomWirelessNetwork) + { + CGUIDialogFirstTimeUseWireless* pWirelessDialog = (CGUIDialogFirstTimeUseWireless*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_WIRELESS); + if (!pWirelessDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::GetWirelessNetworkToConnectItem - FAILED to get CGUIDialogFirstTimeUseWireless object (initbox)"); + return false; + } + + wlItem.SetProperty("wln-ssid",pWirelessDialog->GetSelectedItem()->GetProperty("wln-ssid")); + wlItem.SetProperty("wln-password",""); + wlItem.SetProperty("wln-auth",AUTH_DONTCARE); + } + else + { + CGUIDialogFirstTimeUseConfWirelessSSID* pSsidWireless = (CGUIDialogFirstTimeUseConfWirelessSSID*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_WIRELESS_SSID); + CGUIDialogFirstTimeUseConfWirelessSecurity* pSecurityDialog = (CGUIDialogFirstTimeUseConfWirelessSecurity*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_CONF_WIRELESS_SECURITY); + + if (!pSsidWireless || !pSecurityDialog) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::GetWirelessNetworkToConnectItem - FAILED to get object (initbox)"); + return false; + } + + wlItem.SetProperty("wln-ssid",pSsidWireless->GetSSID()); + wlItem.SetProperty("wln-password",""); + wlItem.SetProperty("wln-auth",(int)pSecurityDialog->GetAuth()); + } + + if (!password.IsEmpty()) + { + wlItem.SetProperty("wln-password",password); + } + + return true; +} + +bool CInitializeBoxManager::StartDialogProgress(CGUIDialogProgress** pDialogProgress) +{ + *pDialogProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); + + if (*pDialogProgress) + { + (*pDialogProgress)->StartModal(); + (*pDialogProgress)->Progress(); + return true; + } + + return false; +} + +bool CInitializeBoxManager::StopDialogProgress(CGUIDialogProgress* pDialogProgress) +{ + if (pDialogProgress) + { + pDialogProgress->Close(); + return true; + } + + return false; +} + +CInitializeBoxManager::NetworkConnectionStatus CInitializeBoxManager::HasInternetConnection(int connectionType, int numOfIntervals) +{ + class CheckInternetConnectionJob : public IRunnable + { + public: + CheckInternetConnectionJob(int connectionType, int numOfIntervals) + { + m_connectionType = connectionType; + m_numOfIntervals = numOfIntervals; + m_hasConnectToInternet = false; + m_isNetworkUp = false; + } + + bool IsNetworkUp() + { + return CWaitNetworkUpBG::IsNetworkUp(m_connectionType); + } + + virtual void Run() + { + int interval = 0; + while (interval < m_numOfIntervals) + { + sleep(1); + + interval++; + CLog::Log(LOGDEBUG, "before IsNetworkUp()\n"); + if ((m_isNetworkUp = IsNetworkUp())) + { + break; + } + CLog::Log(LOGDEBUG, "after IsNetworkUp()\n"); + } + CLog::Log(LOGDEBUG, "isNetworkUp = %d\n", m_isNetworkUp); + + if (m_isNetworkUp) { + CLog::Log(LOGDEBUG, "before g_application.IsConnectedToInternet(true)\n"); + m_hasConnectToInternet = g_application.IsConnectedToInternet(true); + CLog::Log(LOGDEBUG, "after g_application.IsConnectedToInternet(true). m_hasConnectToInternet = %d\n", m_hasConnectToInternet); + } + + } + + int m_connectionType; + int m_numOfIntervals; + bool m_hasConnectToInternet; + bool m_isNetworkUp; + }; + + CheckInternetConnectionJob* cicJob = new CheckInternetConnectionJob(connectionType,numOfIntervals); + if (CUtil::RunInBG(cicJob,false) == JOB_SUCCEEDED) + { + CInitializeBoxManager::NetworkConnectionStatus status; + + if (!cicJob->m_isNetworkUp) + { + status = NETWORK_DOWN; + } + else if (!cicJob->m_hasConnectToInternet) + { + status = NO_INTERNET_CONNECTION; + } + else + { + status = CONNECTED_TO_INTERNET; + } + + delete cicJob; + return status; + } + else + { + return NETWORK_DOWN; + } +} + +bool CInitializeBoxManager::IsConnectViaEthernet() +{ + return m_isConnectViaEthernet; +} + +void CInitializeBoxManager::Reboot() +{ + m_hal->Reboot(); +} + +void CInitializeBoxManager::RequestUpgrade() +{ + m_hal->RequestUpgrade(); +} + +CUpdateVersionStatus::UpdateVersionStatusEnums CInitializeBoxManager::GetUpdateStatus() +{ + return m_updateVersionStatus; +} + +bool CInitializeBoxManager::PostFtuFromSettings() +{ + // in case FTU was run from settings -> show summary + + CGUIDialogFirstTimeUseBase* pDialog = NULL; + pDialog = (CGUIDialogFirstTimeUseBase*)g_windowManager.GetWindow(WINDOW_DIALOG_FTU_SIMPLE_MESSAGE); + + if (pDialog) + { + if (m_isConnectViaEthernet) + { + ((CGUIDialogFirstTimeUseSimpleMessage*)pDialog)->SetMessage(g_localizeStrings.Get(54635)); + } + else + { + ((CGUIDialogFirstTimeUseSimpleMessage*)pDialog)->SetMessage(g_localizeStrings.Get(54636)); + } + + pDialog->DoModal(); + } + else + { + CLog::Log(LOGERROR,"CInitializeBoxManager::Run - FAILED to get WINDOW_DIALOG_FTU_SIMPLE_MESSAGE in order to set the correct message (initbox)"); + } + + CLog::Log(LOGDEBUG,"CInitializeBoxManager::Run - Enter from settings -> Finish. [runFromSettings=%d] (initbox)",m_runFromSettings); + return true; +} + +bool CInitializeBoxManager::PostFtuInitialization() +{ + bool retVal = true; + + CLog::Log(LOGDEBUG,"CInitializeBoxManager::PostFtuInitialization - going to get data from server (ftu)"); + + if (!GetDataFromServer()) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::PostFtuInitialization - Call to GetDataFromServer return FALSE (ftu)"); + retVal = false; + } + + return retVal; +} + +bool CInitializeBoxManager::CheckForNewVersion() +{ + ///////////////////////////////////// + // check if there is a new version // + ///////////////////////////////////// + + bool hasNewUpdate = false; + CStdString newVersionBuildNumStr = ""; + +#ifdef HAS_EMBEDDED + if (g_boxeeVersionUpdateManager.CheckForUpdate(hasNewUpdate,newVersionBuildNumStr) == SUCCEEDED) + { + if (hasNewUpdate) + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::CheckForNewVersion - There is a new update (ftu)"); + } + else + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::CheckForNewVersion - There is no new update -> continue (ftu)"); + } + } + else + { + CLog::Log(LOGERROR,"CInitializeBoxManager::CheckForNewVersion - Call to CheckForUpdate FAILED. [hasNewUpdate=%d][newVersionBuildNum=%s]\n",hasNewUpdate,newVersionBuildNumStr.c_str()); + } +#endif + + return hasNewUpdate; +} + +bool CInitializeBoxManager::GetDataFromServer() +{ + if (g_stSettings.m_doneFTU) + { + CLog::Log(LOGDEBUG,"CInitializeBoxManager::GetDataFromServer - FTU already made at first login. No need to get data from server (ftu)"); + return true; + } + + CReadDataFromServer* rdfsJob = new CReadDataFromServer(); + bool result = (CUtil::RunInBG(rdfsJob) == JOB_SUCCEEDED); + + CLog::Log(LOGDEBUG,"CInitializeBoxManager::GetDataFromServer - going to return [%d] (ftu)",rdfsJob->m_bJobResult); + + return result; +} + +void CInitializeBoxManager::CReadDataFromServer::Run() +{ + m_bJobResult = false; + + CStdString url = "http://app.boxee.tv/api/regiondefaults"; + + CLog::Log(LOGDEBUG,"CInitializeBoxManager::GetDataFromServer - before getting data from server. [url=%s] (ftu)",url.c_str()); + + BOXEE::BXCurl curl; + CStdString strResp = curl.HttpGetString(url, false); + + CLog::Log(LOGDEBUG,"CInitializeBoxManager::GetDataFromServer - after getting data from server. [url=%s][respLen=%d] (ftu)",url.c_str(),(int)strResp.length()); + + BOXEE::BXXMLDocument reader; + if (strResp.empty()) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::GetDataFromServer - Not handling server response to [url=%s] because it is empty (ftu)",url.c_str()); + return; + } + + if(!reader.LoadFromString(strResp)) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::GetDataFromServer - Not handling server response to [url=%s] because failed to load it to BXXMLDocument (ftu)",url.c_str()); + return; + } + + TiXmlElement* root = reader.GetRoot(); + + if(!root) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::GetDataFromServer - Failed to get root from BXXMLDocument of the ping response (ftu)"); + return; + } + + if((strcmp(root->Value(),"boxee") != 0)) + { + CLog::Log(LOGERROR,"CInitializeBoxManager::GetDataFromServer - Failed to parse ping response because the root tag ISN'T (ftu)"); + return; + } + + TiXmlElement* pingChildElem = NULL; + pingChildElem = root->FirstChildElement(); + + CStdString countryCode = ""; + CStdString region = ""; + CStdString timezone = ""; + CStdString tempUnit = ""; + CStdString timeFormat = ""; + + CGUIWindowSettingsCategory* pSettingsWindow = (CGUIWindowSettingsCategory*)g_windowManager.GetWindow(WINDOW_SETTINGS_MYPICTURES); + + while (pingChildElem) + { + if (strcmp(pingChildElem->Value(),"country_code") == 0) + { + if (pingChildElem && pingChildElem->FirstChild()) + { + countryCode = pingChildElem->FirstChild()->Value(); + } + else + { + CLog::Log(LOGERROR,"CGUIWindowSettingsCategory::CheckTimezoneSettings - FAILED to read element (tz)"); + } + } +// else if (strcmp(pingChildElem->Value(),"region") == 0) +// { +// if (pingChildElem && pingChildElem->FirstChild()) +// { +// region = pingChildElem->FirstChild()->Value(); +// } +// else +// { +// CLog::Log(LOGERROR,"CGUIWindowSettingsCategory::CheckTimezoneSettings - FAILED to read element (tz)"); +// } +// } + else if (strcmp(pingChildElem->Value(),"time_zone") == 0) + { + if (pingChildElem && pingChildElem->FirstChild()) + { + timezone = pingChildElem->FirstChild()->Value(); + + if (!CHalServicesFactory::GetInstance().SetTimezone(timezone)) + { + CLog::Log(LOGERROR,"CGUIWindowSettingsCategory::CheckTimezoneSettings - FAILED to set Timezone to [timezonePath=%s] (tz)",timezone.c_str()); + } + } + else + { + CLog::Log(LOGERROR,"CGUIWindowSettingsCategory::CheckTimezoneSettings - FAILED to read element (tz)"); + } + } + else if (strcmp(pingChildElem->Value(),"temperature_symbol") == 0) + { + if (pingChildElem && pingChildElem->FirstChild()) + { + tempUnit = pingChildElem->FirstChild()->Value(); + + if (pSettingsWindow) + { + pSettingsWindow->SetTempUnit(tempUnit); + } + else + { + CLog::Log(LOGERROR,"CGUIWindowSettingsCategory::CheckTimezoneSettings - FAILED to set TemperatureSymbol because SettingsWindow is NULL (tz)"); + } + } + else + { + CLog::Log(LOGERROR,"CGUIWindowSettingsCategory::CheckTimezoneSettings - FAILED to read element (tz)"); + } + } + else if (strcmp(pingChildElem->Value(),"clock_time") == 0) + { + if (pingChildElem && pingChildElem->FirstChild()) + { + timeFormat = pingChildElem->FirstChild()->Value(); + + if (pSettingsWindow) + { + pSettingsWindow->SetTimeFormat(timeFormat); + } + else + { + CLog::Log(LOGERROR,"CGUIWindowSettingsCategory::CheckTimezoneSettings - FAILED to set ClockTime because SettingsWindow is NULL (tz)"); + } + } + else + { + CLog::Log(LOGERROR,"CGUIWindowSettingsCategory::CheckTimezoneSettings - FAILED to read element (tz)"); + } + } + + pingChildElem = pingChildElem->NextSiblingElement(); + } + + CLog::Log(LOGDEBUG,"CInitializeBoxManager::GetDataFromServer - after parse server data. [countryCode=%s][region=%s][timezone=%s][tempUnit=%s][timeFormat=%s] (ftu)",countryCode.c_str(),region.c_str(),timezone.c_str(),tempUnit.c_str(),timeFormat.c_str()); + +#ifdef HAS_EMBEDDED + /////////////////////////////////// + // set timezone country and city // + /////////////////////////////////// + + CStdString countryName = ""; + CStdString cityName = ""; + + if (pSettingsWindow) + { + countryName = pSettingsWindow->GetCountryByCode(countryCode); + + if (!countryName.IsEmpty()) + { + g_guiSettings.SetString("timezone.country",countryName); + } + else + { + CLog::Log(LOGERROR,"CGUIWindowSettingsCategory::CheckTimezoneSettings - FAILED to set timezone.country because CountryName is EMPTY. [countryName=%s][countryCode=%s] (tz)",countryName.c_str(),countryCode.c_str()); + } + + int pos = timezone.Find("/"); + if (pos != -1) + { + cityName = timezone.substr(pos+1); + + if (!cityName.IsEmpty() && pSettingsWindow->IsTimezoneCityExist(cityName)) + { + g_guiSettings.SetString("timezone.city",cityName); + } + else + { + CLog::Log(LOGERROR,"CGUIWindowSettingsCategory::CheckTimezoneSettings - FAILED to set timezone.city because CityName is EMPTY or NOT-VALID. [cityName=%s] (tz)",cityName.c_str()); + } + } + } + else + { + CLog::Log(LOGERROR,"CGUIWindowSettingsCategory::CheckTimezoneSettings - FAILED to set timezone country and city because SettingsWindow is NULL (tz)"); + } + + ////////////////////// + // set weather city // + ////////////////////// + + if (!countryCode.IsEmpty() && !cityName.IsEmpty()) + { + CLog::Log(LOGDEBUG,"CGUIWindowSettingsCategory::CheckTimezoneSettings - going to set weather location for [cityName=%s][countryCode=%s] (tz)(wl)",cityName.c_str(),countryCode.c_str()); + + if (!BoxeeUtils::SetWeatherLocation(cityName,countryCode)) + { + CLog::Log(LOGERROR,"CGUIWindowSettingsCategory::CheckTimezoneSettings - FAILED to set weather location for [cityName=%s][countryCode=%s] (tz)(wl)",cityName.c_str(),countryCode.c_str()); + } + } + else + { + CLog::Log(LOGERROR,"CGUIWindowSettingsCategory::CheckTimezoneSettings - FAILED to set weather city because of an EMPTY data. [cityName=%s][countryCode=%s] (tz)(wl)",cityName.c_str(),countryCode.c_str()); + } +#endif + + g_settings.Save(); + + m_bJobResult = true; + + return; +} + +#endif + diff --git a/xbmc/InitializeBoxManager.h b/xbmc/InitializeBoxManager.h new file mode 100644 index 00000000..a2f19b53 --- /dev/null +++ b/xbmc/InitializeBoxManager.h @@ -0,0 +1,136 @@ +#ifndef INITIALIZEBOXMANAGER_H_ +#define INITIALIZEBOXMANAGER_H_ + +#include "system.h" + +#ifdef HAS_EMBEDDED + +#include "HalServices.h" +#include "FileItem.h" +#include "Thread.h" +#include + +class CGUIDialogFirstTimeUseBase; +class CGUIDialogFirstTimeUseResolution; +class CGUIDialogFirstTimeUseEthernet; +class CGUIDialogFirstTimeUseWireless; +class CGUIDialogFirstTimeUseConfWirelessPassword; +class CGUIDialogFirstTimeUseNetworkMessage; +class CGUIDialogProgress; + +class CUpdateVersionStatus +{ +public: + enum UpdateVersionStatusEnums + { + NO_UPDATE=0, + HAS_UPDATE=1, + UPDATING=2, + UPDATE_SUCCEEDED=3, + UPDATE_FAILED=4, + REQUEST_UPGRADE=5, + NUM_OF_SERVICE_IDENTIFIER_TYPES=6 + }; +}; + +class CInitializeBoxManager +{ +public: + + CInitializeBoxManager(); + virtual ~CInitializeBoxManager(); + + static CInitializeBoxManager& GetInstance(); + + bool Run(bool runFromSettings = false); + + bool IsConnectViaEthernet(); + + CUpdateVersionStatus::UpdateVersionStatusEnums GetUpdateStatus(); + + void Reboot(); + void RequestUpgrade(); + +protected: + + CGUIDialogFirstTimeUseBase* GetNextDialog(CGUIDialogFirstTimeUseBase* pDialog); + CGUIDialogFirstTimeUseBase* HandleNextAction(CGUIDialogFirstTimeUseBase* pDialog); + CGUIDialogFirstTimeUseBase* HandleBackAction(CGUIDialogFirstTimeUseBase* pDialog); + + // wellcome dialog + bool HandleNextWellcomeDialog(CGUIDialogFirstTimeUseBase** pNextDialog, CHalAddrType addrType, bool onRetry = false); + + // network message dialog + bool HandleNextNetworkMessageDialog(CGUIDialogFirstTimeUseBase** pNextDialog); + + // wireless dialog + bool HandleNextWirelessDialog(CGUIDialogFirstTimeUseBase** pNextDialog); + + // conf wireless dialog + bool HandleNextConfWirelessPasswordDialog(CGUIDialogFirstTimeUseBase** pNextDialog); + + bool HandleNextConfWirelessSsidDialog(CGUIDialogFirstTimeUseBase** pNextDialog); + + bool HandleNextConfWirelessSecurityDialog(CGUIDialogFirstTimeUseBase** pNextDialog); + + bool HandleNextConfNetworkDialog(CGUIDialogFirstTimeUseBase** pNextDialog); + + // update message dialog + bool HandleNextUpdateMessageDialog(CGUIDialogFirstTimeUseBase** pNextDialog); + + // update progress dialog + bool HandleNextUpdateProgressDialog(CGUIDialogFirstTimeUseBase** pNextDialog); + + // simple message dialog + bool HandleNextSimpleMessageDialog(CGUIDialogFirstTimeUseBase** pNextDialog); + + bool IsEthernetConnected(); + bool ConnectToEthernet(unsigned int instance, CHalAddrType addrType); + bool ConnectToWireless(unsigned int instance, CHalAddrType addrType, const CStdString& password, CStdString& errorMessage); + + IHalServices* m_hal; + bool m_isConnectViaEthernet; + std::stack m_dialogStack; + +private: + + bool CheckForNewVersion(); + + bool GetWirelessNetworkToConnectItem(CFileItem& wlItem, const CStdString& password); + + bool PostFtuFromSettings(); + + bool PostFtuInitialization(); + bool GetDataFromServer(); + + enum NetworkConnectionStatus + { + NETWORK_DOWN = 0, + NO_INTERNET_CONNECTION, + CONNECTED_TO_INTERNET + }; + + NetworkConnectionStatus HasInternetConnection(int connectionType, int numOfIntervals = 0); + bool StartDialogProgress(CGUIDialogProgress** pDialogProgress); + bool StopDialogProgress(CGUIDialogProgress* pDialogProgress); + + bool m_loginViaCustomWirelessNetwork; + bool m_initCompleted; + bool m_updateCompleted; + + bool m_runFromSettings; + + CUpdateVersionStatus::UpdateVersionStatusEnums m_updateVersionStatus; + + class CReadDataFromServer : public IRunnable + { + public: + CReadDataFromServer(){} + virtual void Run(); + }; +}; + +#endif + +#endif /*INITIALIZEBOXMANAGER_H_*/ + diff --git a/xbmc/LicenseConfig.cpp b/xbmc/LicenseConfig.cpp new file mode 100644 index 00000000..a8af5a67 --- /dev/null +++ b/xbmc/LicenseConfig.cpp @@ -0,0 +1,140 @@ +#include + +#include "LicenseConfig.h" + +#ifdef HAS_EMBEDDED + +#include "lib/libBoxee/bxoemconfiguration.h" + +const int DEF_MAX_PCM_CHANNELS_DECODE = -1; +const int DEF_MAX_CHANNELS_ENCODE = -1; +const AUDIO_CODEC_VENDOR DEF_PREFERRED_ENCODING = AUDIO_VENDOR_NONE; +const int DEF_IS_DOLBY_SW_DECODE_ALLOWED = 0; +const int DEF_IS_DTS_SW_DECODE_ALLOWED = 0; + +void CLicenseSettings::Load() +{ + CVendorLicense free_license = {-1, -1}; + m_vendor_licenses[AUDIO_VENDOR_NONE] = free_license; + CVendorLicense dolby_license = { + BOXEE::BXOEMConfiguration::GetInstance().GetIntParam("Boxee.Audio.Dolby.MaxPCMChannelsDecode",DEF_MAX_PCM_CHANNELS_DECODE),\ + BOXEE::BXOEMConfiguration::GetInstance().GetIntParam("Boxee.Audio.Dolby.MaxChannelsEncode",DEF_MAX_CHANNELS_ENCODE)}; + m_vendor_licenses[AUDIO_VENDOR_DOLBY] = dolby_license; + CVendorLicense dts_license = { + BOXEE::BXOEMConfiguration::GetInstance().GetIntParam("Boxee.Audio.DTS.MaxPCMChannelsDecode",DEF_MAX_PCM_CHANNELS_DECODE),\ + BOXEE::BXOEMConfiguration::GetInstance().GetIntParam("Boxee.Audio.DTS.MaxChannelsEncode",DEF_MAX_CHANNELS_ENCODE)}; + m_vendor_licenses[AUDIO_VENDOR_DTS] = dts_license; + + m_is_dolby_sw_decode_allowed = (bool) BOXEE::BXOEMConfiguration::GetInstance().GetIntParam("Boxee.Audio.Dolby.SoftwareDecoder", DEF_IS_DOLBY_SW_DECODE_ALLOWED); + m_is_dts_sw_decode_allowed = (bool) BOXEE::BXOEMConfiguration::GetInstance().GetIntParam("Boxee.Audio.DTS.SoftwareDecoder", DEF_IS_DTS_SW_DECODE_ALLOWED); + + std::string preferred_encoding = BOXEE::BXOEMConfiguration::GetInstance().GetStringParam("Boxee.Audio.PreferredEncoding"); + if(preferred_encoding == "DOLBY") + m_preferred_encoding = AUDIO_VENDOR_DOLBY; + else if(preferred_encoding == "DTS") + m_preferred_encoding = AUDIO_VENDOR_DTS; + else + { + if(preferred_encoding != "NONE") + CLog::Log(LOGERROR, "Invalid preferred encoding value: %s", preferred_encoding.c_str()); + m_preferred_encoding = AUDIO_VENDOR_NONE; + } + m_is_initialized = true; +} + +int CLicenseSettings::get_max_channels_decode(AUDIO_CODEC_VENDOR vendor) const +{ + if(!m_is_initialized) + { + CLog::Log(LOGERROR, "Must call CLicenseSettings::Load() before using the CLicenseSettings class"); + return DEF_MAX_CHANNELS_ENCODE; + } +#ifdef HAS_EMBEDDED + return m_vendor_licenses.at(vendor).m_max_channels_decode; +#else + std::map::const_iterator it = m_vendor_licenses.find(vendor); + if (it != m_vendor_licenses.end()) + { + return (it->second).m_max_channels_decode; + } + + return DEF_MAX_CHANNELS_ENCODE; +#endif +} + +int CLicenseSettings::get_max_channels_encode(AUDIO_CODEC_VENDOR vendor) const +{ + if(!m_is_initialized) + { + CLog::Log(LOGERROR, "Must call CLicenseSettings::Load() before using the CLicenseSettings class"); + return DEF_MAX_PCM_CHANNELS_DECODE; + } +#ifdef HAS_EMBEDDED + return m_vendor_licenses.at(vendor).m_max_channels_encode; +#else + std::map::const_iterator it = m_vendor_licenses.find(vendor); + if (it != m_vendor_licenses.end()) + { + return (it->second).m_max_channels_encode; + } + + return DEF_MAX_PCM_CHANNELS_DECODE; +#endif +} + +AUDIO_CODEC_VENDOR CLicenseSettings::get_preferred_encoding() const +{ + if(!m_is_initialized) + { + CLog::Log(LOGERROR, "Must call CLicenseSettings::Load() before using the CLicenseSettings class"); + return DEF_PREFERRED_ENCODING; + } + return m_preferred_encoding; +} + +bool CLicenseSettings::is_dolby_sw_decode_allowed() const +{ + if(!m_is_initialized) + { + CLog::Log(LOGERROR, "Must call CLicenseSettings::Load() before using the CLicenseSettings class"); + return false; + } + return m_is_dolby_sw_decode_allowed; +} + +bool CLicenseSettings::is_dts_sw_decode_allowed() const +{ + if(!m_is_initialized) + { + CLog::Log(LOGERROR, "Must call CLicenseSettings::Load() before using the CLicenseSettings class"); + return false; + } + return m_is_dts_sw_decode_allowed; +} + +void CLicenseSettings::dump_audio_licnense_file() +{ + CLog::Log(LOGINFO, "Audio Licenses:\n"); + CLog::Log(LOGINFO, "get_max_channels_decode dolby %d\n", g_lic_settings.get_max_channels_decode(AUDIO_VENDOR_DOLBY)); + CLog::Log(LOGINFO, "get_max_channels_encode dolby %d\n", g_lic_settings.get_max_channels_encode(AUDIO_VENDOR_DOLBY)); + CLog::Log(LOGINFO, "get_max_channels_decode DTS %d\n", g_lic_settings.get_max_channels_decode(AUDIO_VENDOR_DTS)); + CLog::Log(LOGINFO, "get_max_channels_encode DTS %d\n", g_lic_settings.get_max_channels_encode(AUDIO_VENDOR_DTS)); + + CLog::Log(LOGINFO, "is_dolby_sw_decode_allowed %d\n", g_lic_settings.is_dolby_sw_decode_allowed()); + CLog::Log(LOGINFO, "is_dts_sw_decode_allowed %d\n", g_lic_settings.is_dts_sw_decode_allowed()); + CLog::Log(LOGINFO, "get_preferred_encoding "); + if(g_lic_settings.get_preferred_encoding() == AUDIO_VENDOR_DOLBY) CLog::Log(LOGINFO, "Dolby\n"); + else if(g_lic_settings.get_preferred_encoding() == AUDIO_VENDOR_DTS) CLog::Log(LOGINFO, "DTS\n"); + else CLog::Log(LOGINFO, "NONE\n"); +} + +void CLicenseSettings::ModifyAudioChannelsByLicense(int& iChannels, AUDIO_CODEC_VENDOR vendor) +{ + if((g_lic_settings.get_max_channels_decode(vendor)>-1) && (iChannels > g_lic_settings.get_max_channels_decode(vendor))) + { + iChannels = g_lic_settings.get_max_channels_decode(vendor); + } +} + +CLicenseSettings g_lic_settings; +#endif diff --git a/xbmc/LicenseConfig.h b/xbmc/LicenseConfig.h new file mode 100644 index 00000000..1fdb3385 --- /dev/null +++ b/xbmc/LicenseConfig.h @@ -0,0 +1,56 @@ +/* + * File: LicenseConfig.h + * Author: ishai + * + * Created on March 21, 2011, 4:28 PM + */ + +#ifndef LICENSECONFIG_H +#define LICENSECONFIG_H + +#include "system.h" + +#ifdef HAS_EMBEDDED + +#include + +#include "utils/log.h" + +enum AUDIO_CODEC_VENDOR { + AUDIO_VENDOR_NONE, + AUDIO_VENDOR_DOLBY, + AUDIO_VENDOR_DTS, + NUM_OF_VENDOR_VALS +}; + +extern const int DEF_MAX_PCM_CHANNELS_DECODE; +extern const int DEF_MAX_CHANNELS_ENCODE; +extern const AUDIO_CODEC_VENDOR DEF_PREFERRED_ENCODING; + +struct CVendorLicense { + int m_max_channels_decode; + int m_max_channels_encode; +}; +class CLicenseSettings { + std::map m_vendor_licenses; + AUDIO_CODEC_VENDOR m_preferred_encoding; + bool m_is_initialized; + bool m_is_dolby_sw_decode_allowed; + bool m_is_dts_sw_decode_allowed; +public: + void Load(); + int get_max_channels_decode(AUDIO_CODEC_VENDOR vendor) const; + int get_max_channels_encode(AUDIO_CODEC_VENDOR vendor) const; + bool is_dolby_sw_decode_allowed() const; + bool is_dts_sw_decode_allowed() const; + AUDIO_CODEC_VENDOR get_preferred_encoding() const; + CLicenseSettings() {m_is_initialized=false;} + void dump_audio_licnense_file(); + void ModifyAudioChannelsByLicense(int& iChannels, AUDIO_CODEC_VENDOR vendor); +}; + +extern CLicenseSettings g_lic_settings; +#endif + +#endif /* LICENSECONFIG_H */ + diff --git a/xbmc/LiveTvModel.cpp b/xbmc/LiveTvModel.cpp new file mode 100644 index 00000000..ef9455fc --- /dev/null +++ b/xbmc/LiveTvModel.cpp @@ -0,0 +1,218 @@ +#include "LiveTvModel.h" + +#ifdef HAS_DVB + +#include "dvbmanager.h" +#include "dvbchannels.h" +#include "dvbchannel.h" +#include "epgstore.h" +#include "FileItem.h" +#include "utils/log.h" + +#include +#include "Util.h" +#include "../guilib/LocalizeStrings.h" + +// Time slot is 30 minutes +#define TIME_SLOT_DURATION 30 + +LiveTvModel::LiveTvModel() +{ + SetCurrentTimeSlot(0); +} + +LiveTvModelChannelsType LiveTvModel::GetChannels() +{ + LiveTvModelChannelsType result; + DvbChannels& channels = DVBManager::GetInstance().GetChannels(); + channels.Lock(); + + for (size_t i = 0; i < channels.Size(); i++) + { + DvbChannelPtr dvbChannel = channels.GetChannelByIndex(i); + + LiveTvModelChannel channel; + channel.id = i; + channel.enabled = dvbChannel->IsEnabled(); + channel.label = dvbChannel->GetChannelLabel(); + channel.number = dvbChannel->GetChannelNumber(); + result.push_back(channel); + } + + channels.Unlock(); + + return result; +} + +LiveTvModelProgramsType LiveTvModel::GetPrograms() +{ + return GetProgramsForSlot(m_currentStartTimeSlot); +} + +LiveTvModelProgramsType LiveTvModel::GetProgramsForSlot(time_t slot) +{ + time_t currentTime = time(NULL); + + time_t realTimeSlot = slot; + if (realTimeSlot == 0) + realTimeSlot = currentTime; + time_t endTimeSlot = CalculateEndTimeSlot(slot); + + LiveTvModelProgramsType result; + for (size_t i = 0; i < DVBManager::GetInstance().GetChannels().Size(); i++) + { + std::vector pgms; + result.push_back(pgms); + } + + std::vector epgInfo = EpgStore::GetInstance().QueryAllChannelsForPrograms(realTimeSlot, endTimeSlot); + + foreach (EpgProgramInfo epgProgram, epgInfo) + { + DvbChannelPtr channel = DVBManager::GetInstance().GetChannels().GetChannel(epgProgram.channelId); + if (channel.get() == 0) + continue; + + LiveTvModelProgram program; + program.info = epgProgram; + program.isNow = (program.info.start <= currentTime); + +// printf("loading program: serverid=[%s] channel=[%s] title=[%s] isNow=[%d] start=[%lu] end=[%lu] slot=[%lu]\n", +// channel->GetChannelId().c_str(), channel->GetChannelLabel().c_str(), epgProgram.title.c_str(), program.isNow, +// program.start, program.end, realTimeSlot); + + if (program.isNow) + { + EpgStore::GetInstance().GetChannelSocialInfo(epgProgram.id, channel->GetServiceName(), program.social); + } + + result[channel->GetIndex()].push_back(program); + } + + return result; +} + +void LiveTvModel::GetCurrentTimeSlot(time_t& startSlot, time_t& endSlot) +{ + startSlot = m_currentStartTimeSlot; + endSlot = m_currentEndTimeSlot; +} + +bool LiveTvModel::IsCurrentTimeSlotFirst() +{ + return (m_currentStartTimeSlot == 0); +} + +void LiveTvModel::SetCurrentTimeSlot(const time_t& slot) +{ + m_currentStartTimeSlot = slot; + m_currentEndTimeSlot = CalculateEndTimeSlot(m_currentStartTimeSlot); +} + +time_t LiveTvModel::CalculateEndTimeSlot(time_t& startSlot) +{ + time_t realTimeSlot = startSlot; + if (realTimeSlot == 0) + realTimeSlot = time(NULL); + + CDateTimeSpan nextSlotSpan(0, 0, TIME_SLOT_DURATION, 0); + CDateTime endDateTime(realTimeSlot); + endDateTime += nextSlotSpan; + + // Zero the seconds, if needed + if (endDateTime.GetSecond()) + { + CDateTimeSpan removeSecondsTimeSpan(0, 0, 0, endDateTime.GetSecond()); + endDateTime -= removeSecondsTimeSpan; + } + + if (endDateTime.GetMinute() != 0 && endDateTime.GetMinute() != 30) + { + int minutesToReduce = endDateTime.GetMinute(); + if (minutesToReduce > 30) + minutesToReduce -= 30; + CDateTimeSpan removeSecondsTimeSpan(0, 0, minutesToReduce, 0); + endDateTime -= removeSecondsTimeSpan; + } + + time_t result; + endDateTime.GetAsTime(result); + + return result; +} + +bool LiveTvModel::SetNextTimeSlot() +{ + time_t startSlot, endSlot; + GetCurrentTimeSlot(startSlot, endSlot); + + if (endSlot >= time(NULL) + (24 * 60 * 60)) + return false; + + LiveTvModelProgramsType programs = GetProgramsForSlot(endSlot); + for (size_t i = 0; i < programs.size(); i++) + { + // Make sure we have at least 1 program in the list + if (programs[i].size() > 0) + { + SetCurrentTimeSlot(endSlot); + return true; + } + } + + return false; +} + +bool LiveTvModel::HasNextTimeSlot() +{ + time_t startSlot, endSlot; + GetCurrentTimeSlot(startSlot, endSlot); + + if (endSlot >= time(NULL) + (24 * 60 * 60)) + return false; + + LiveTvModelProgramsType programs = GetProgramsForSlot(endSlot); + for (size_t i = 0; i < programs.size(); i++) + { + // Make sure we have at least 1 program in the list + if (programs[i].size() > 0) + { + return true; + } + } + + return false; +} + +bool LiveTvModel::SetPrevTimeSlot() +{ + if (IsCurrentTimeSlotFirst()) + return false; + + time_t prevSlot; + CDateTimeSpan prevSlotSpan(0, 0, TIME_SLOT_DURATION, 0); + CDateTime dateTime(m_currentStartTimeSlot); + dateTime -= prevSlotSpan; + dateTime.GetAsTime(prevSlot); + + if (prevSlot < time(NULL)) + { + SetCurrentTimeSlot(0); + } + else + { + SetCurrentTimeSlot(prevSlot); + } + + return true; +} + +bool LiveTvModel::HasPrevTimeSlot() +{ + if (IsCurrentTimeSlotFirst()) + return false; + + return true; +} + +#endif diff --git a/xbmc/LiveTvModel.h b/xbmc/LiveTvModel.h new file mode 100644 index 00000000..1f1d7bd0 --- /dev/null +++ b/xbmc/LiveTvModel.h @@ -0,0 +1,68 @@ +#pragma once + +#include "system.h" + +#ifdef HAS_DVB + +#include "StdString.h" +#include +#include +#include +#include "StringUtils.h" +#include "xbmc/cores/dvb/epgstore.h" + +struct LiveTvModelChannel +{ + LiveTvModelChannel() { enabled = true; } + int id; + CStdString number; + CStdString label; + bool enabled; +}; + +struct LiveTvModelProgram +{ + LiveTvModelProgram() { Clear(); } + + void Clear() + { + isNow = false; + info.Clear(); + social.Clear(); + } + + EpgProgramInfo info; + bool isNow; + EpgSocialInfo social; +}; + +typedef std::vector > LiveTvModelProgramsType; +typedef std::vector LiveTvModelChannelsType; + +class CFileItem; + +class LiveTvModel +{ +public: + LiveTvModel(); + + LiveTvModelProgramsType GetPrograms(); + LiveTvModelChannelsType GetChannels(); + + void SetCurrentTimeSlot(const time_t& slot); + void GetCurrentTimeSlot(time_t& startSlot, time_t& endSlot); + bool HasNextTimeSlot(); + bool SetNextTimeSlot(); + bool HasPrevTimeSlot(); + bool SetPrevTimeSlot(); + bool IsCurrentTimeSlotFirst(); + +private: + LiveTvModelProgramsType GetProgramsForSlot(time_t slot); + time_t CalculateEndTimeSlot(time_t& startSlot); + + time_t m_currentStartTimeSlot; + time_t m_currentEndTimeSlot; +}; + +#endif diff --git a/xbmc/MusicInfoTagLoaderUPnP.cpp b/xbmc/MusicInfoTagLoaderUPnP.cpp new file mode 100644 index 00000000..ff4b3a14 --- /dev/null +++ b/xbmc/MusicInfoTagLoaderUPnP.cpp @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010 BOXEE + */ + +#include "MusicInfoTagLoaderUPnP.h" +#include "MusicInfoTag.h" +#include "Settings.h" +#include "UPnPDirectory.h" +#include "utils/log.h" + +using namespace MUSIC_INFO; + +CMusicInfoTagLoaderUPnP::CMusicInfoTagLoaderUPnP(void) +{ +} + +CMusicInfoTagLoaderUPnP::~CMusicInfoTagLoaderUPnP() +{ +} + +bool CMusicInfoTagLoaderUPnP::Load(const CStdString& strFileName, CMusicInfoTag& tag) +{ + DIRECTORY::CUPnPDirectory dir; + CFileItemList list; + if( dir.GetDirectory( strFileName, list ) ) + { + CMusicInfoTag* t = list[0]->GetMusicInfoTag(); + tag = *t; + return (t != NULL); + } + + return false; +} diff --git a/xbmc/MusicInfoTagLoaderUPnP.h b/xbmc/MusicInfoTagLoaderUPnP.h new file mode 100644 index 00000000..c89bb987 --- /dev/null +++ b/xbmc/MusicInfoTagLoaderUPnP.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2010 BOXEE + */ + +#pragma once + +#include "ImusicInfoTagLoader.h" + +namespace MUSIC_INFO +{ + +class CMusicInfoTagLoaderUPnP: public IMusicInfoTagLoader +{ + public: + CMusicInfoTagLoaderUPnP(void); + virtual ~CMusicInfoTagLoaderUPnP(); + + virtual bool Load(const CStdString& strFileName, CMusicInfoTag& tag); +}; + +} diff --git a/xbmc/NullHalServices.cpp b/xbmc/NullHalServices.cpp new file mode 100644 index 00000000..5e79f822 --- /dev/null +++ b/xbmc/NullHalServices.cpp @@ -0,0 +1,283 @@ +/* + * NullHalServices.cpp + * + * Created on: Jun 13, 2010 + * Author: shay + */ + +#include "NullHalServices.h" + +#ifdef HAS_BOXEE_HAL + +CNullHalServices::CNullHalServices() +{ +} + +bool CNullHalServices::GetEthernetConfig(unsigned int nInstance, CHalEthernetConfig ðernetConfig ) +{ + ethernetConfig.addr_type = ADDR_NONE; + return true; +} + + +bool CNullHalServices::SetEthernetConfig(unsigned int nInstance, const CHalEthernetConfig ðernetConfig) +{ + sleep(5); + return true; +} + +bool CNullHalServices::GetEthernetInfo(unsigned int nInstance, CHalEthernetInfo ðernetInfo) +{ + ethernetInfo.addr_type = ADDR_NONE; + ethernetInfo.link_up = false; + ethernetInfo.running = true; + return true; +} + +// wireless +bool CNullHalServices::GetWirelessConfig(unsigned int nInstance, CHalWirelessConfig& wirelessConfig) +{ + wirelessConfig.addr_type = ADDR_STATIC; + + return true; +} + +bool CNullHalServices::SetWirelessConfig(unsigned int nInstance, CHalWirelessConfig& wirelessConfig) +{ + sleep(4); + return true; +} + +bool CNullHalServices::GetWirelessInfo(unsigned int nInstance, CHalWirelessInfo& wirelessInfo) +{ + return true; +} + +bool CNullHalServices::SearchWireless(unsigned int nInstance, std::vector& wirelessNetworks) +{ + if (wirelessNetworks.size()== 0) + { + CHalWirelessNetwork wn; + wn.signal_strength = 100; + wn.ssid = "my-network"; + wn.secure = true; + wirelessNetworks.push_back(wn); + + wn.signal_strength = 50; + wn.secure = true; + wn.ssid = "erez-home"; + wirelessNetworks.push_back(wn); + + wn.signal_strength = 73; + wn.secure = false; + wn.ssid = "dikla-home"; + wirelessNetworks.push_back(wn); + + wn.signal_strength = 73; + wn.secure = true; + wn.ssid = "yuval-home"; + wirelessNetworks.push_back(wn); + + wn.signal_strength = 73; + wn.secure = false; + wn.ssid = "shay-home"; + wirelessNetworks.push_back(wn); + } + + return true; +} + + // clock +bool CNullHalServices::SetTimezone(const std::string& strTimezone) +{ + return true; +} + +bool CNullHalServices::GetTimezone(std::string& strTimezone) +{ + return true; +} + +bool CNullHalServices::SetTime(const std::string& strTime) +{ + return true; +} + +// power +bool CNullHalServices::StandBy() +{ + return true; +} + +bool CNullHalServices::Resume() +{ + return true; +} + +bool CNullHalServices::Shutdown() +{ + return true; +} + +bool CNullHalServices::Reboot() +{ + return true; +} + +// input +bool CNullHalServices::GetAllInputDevices(std::vector& inputDevices) +{ + return true; +} + +// dvb +bool CNullHalServices::GetAllDvbDevices(std::vector& dvbDevices) +{ + return true; +} + +// storage +bool CNullHalServices::GetAllStorageDevices(std::vector & storageDevices) +{ + CHalStorageDeviceInfo dev; + dev.dev_type = "sd"; + dev.path = "/media/an_sd"; + dev.label = "An SD"; + storageDevices.push_back(dev); + + dev.dev_type = "usb"; + dev.path = "/media/dok"; + dev.label = "DOK"; + storageDevices.push_back(dev); + + return true; +} + +bool CNullHalServices::EnableSambaShares(const std::string password, const std::string username, const std::string workgroup, const std::string hostname) +{ + return true; +} + +bool CNullHalServices::DisableSambaShares() +{ + return true; +} + +bool CNullHalServices::GetSambaConfig(bool &status, std::string &password, std::string &workgroup, std::string &hostname) +{ + return true; +} + +bool CNullHalServices::EjectStorage(const std::string &path) +{ + return true; +} + +// host +bool CNullHalServices::SetHostName(const std::string& strHostname) +{ + return true; +} + +bool CNullHalServices::GetHostName(std::string& strHostname) +{ + return true; +} + +CNullHalServices& CNullHalServices::GetInstance() +{ + static CNullHalServices halServices; + + return halServices; +} + +// system +bool CNullHalServices::GetHardwareInfo(CHalHardwareInfo& hardwareInfo) +{ + hardwareInfo.model = "SIMAN3"; + hardwareInfo.revision = "R1.2"; + hardwareInfo.serialNumber = "12345678"; + hardwareInfo.uniqueId = "uniqui"; + hardwareInfo.vendor = "ACME"; + + return true; +} + +bool CNullHalServices::GetSoftwareInfo(CHalSoftwareInfo& softwareInfo) +{ + softwareInfo.language = "EN"; + softwareInfo.regionSKU = "IL"; + softwareInfo.version = "0.9.21"; + + return true; +} + +bool CNullHalServices::RequestUpgrade() +{ + return true; +} + +bool CNullHalServices::SetAudioDACState(bool mute) +{ + return true; +} + +bool AvahiDaemonRestart() +{ + return true; +} + +bool DjmountRestart() +{ + return true; +} + +// led +bool CNullHalServices::SetLEDBrightness(int instance, int startBrightness, int endBrightness) +{ + return true; +} + +bool CNullHalServices::SetLEDState(bool isPlaying, bool isConnectedToInternet, bool isPowerSaving) +{ + return true; +} + +// thermals +bool CNullHalServices::GetCPUTemperature(int& temperature) +{ + return true; +} + +bool CNullHalServices::GetCPUFanSpeed(int& speed) +{ + return true; +} + +//vpn +bool CNullHalServices::VpnSetConfig(const CHALVpnConfig &vpnConfig) +{ + return true; +} + +bool CNullHalServices::VpnDial() +{ + return true; +} + +bool CNullHalServices::VpnHangup() +{ + return true; +} + +bool CNullHalServices::VpnGetInfo(CHALVpnInfo &vpnInfo) +{ + return true; +} + +bool CNullHalServices::VpnGetConfig(CHALVpnConfig &vpnConfig) +{ + return true; +} + +#endif diff --git a/xbmc/NullHalServices.h b/xbmc/NullHalServices.h new file mode 100644 index 00000000..330acbd6 --- /dev/null +++ b/xbmc/NullHalServices.h @@ -0,0 +1,101 @@ +/* + * NullHalServices.h + * + * Created on: Jun 13, 2010 + * Author: shay + */ + +#ifndef NULLHALSERVICES_H_ +#define NULLHALSERVICES_H_ + +#include "system.h" + +#ifdef HAS_BOXEE_HAL + +#include "xbmc/lib/libBoxeeHalClient/BoxeeHalClient.h" +#include "HalServices.h" +#include +#include + +class CNullHalServices : public IHalServices +{ +public: + static CNullHalServices &GetInstance(); + virtual bool GetEthernetConfig(unsigned int nInstance, CHalEthernetConfig ðernetConfig); + virtual bool SetEthernetConfig(unsigned int nInstance, const CHalEthernetConfig ðernetDevice); + virtual bool GetEthernetInfo(unsigned int nInstance, CHalEthernetInfo ðDevice); + + // wireless + virtual bool GetWirelessConfig(unsigned int nInstance, CHalWirelessConfig& wirelessDevice); + virtual bool SetWirelessConfig(unsigned int nInstance, CHalWirelessConfig& wirelessDevice); + virtual bool GetWirelessInfo(unsigned int nInstance, CHalWirelessInfo& wirelessDevice); + virtual bool SearchWireless(unsigned int nInstance, std::vector& wirelessNetworks); + + // clock + virtual bool SetTimezone(const std::string& strTimezone); + virtual bool GetTimezone(std::string& strTimezone); + virtual bool SetTime(const std::string& strTime); + + // power + virtual bool StandBy(); + virtual bool Shutdown(); + virtual bool Reboot(); + virtual bool Resume(); + + // input + virtual bool GetAllInputDevices(std::vector& inputDevices); + + // dvb + virtual bool GetAllDvbDevices(std::vector& dvbDevices); + + // storage + virtual bool GetAllStorageDevices(std::vector& storageDevicesInfo); + virtual bool EnableSambaShares(const std::string password, const std::string username = "", const std::string workgroup = "", const std::string hostname = ""); + virtual bool GetSambaConfig(bool &status, std::string &password, std::string &workgroup, std::string &hostname); + virtual bool DisableSambaShares(); + virtual bool EjectStorage(const std::string& path); + + // host + virtual bool SetHostName(const std::string& strHostname); + virtual bool GetHostName(std::string& strHostname); + + // led + virtual bool SetLEDBrightness(int instance, int startBrightness, int endBrightness); + virtual bool SetLEDState(bool isPlaying, bool isConnectedToInternet, bool isPowerSaving); + + // thermals + virtual bool GetCPUTemperature(int& temperature); + virtual bool GetCPUFanSpeed(int& speed); + + // system + virtual bool GetHardwareInfo(CHalHardwareInfo& hardwareInfo); + virtual bool GetSoftwareInfo(CHalSoftwareInfo& softwareInfo); + virtual bool RequestUpgrade(); + virtual bool SetAudioDACState(bool mute); + virtual bool AvahiDaemonRestart(); + virtual bool DjmountRestart(); + + //vpn + virtual bool VpnSetConfig(const CHALVpnConfig &vpnConfig); + virtual bool VpnDial(); + virtual bool VpnHangup(); + virtual bool VpnGetInfo(CHALVpnInfo &vpnInfo); + virtual bool VpnGetConfig(CHALVpnConfig &vpnConfig); + + + // listener + virtual void AddListener (IHalListener *listener) { } + +private: + CNullHalServices(); + CHalAddrType GetAddrType (const std::string &AddrTypeStr); + + std::string GetAddrTypeStr (CHalAddrType addrType); + CBoxeeHalClient* m_pRequest; + + +}; + +#endif + +#endif /* NULLHALSERVICES_H_ */ diff --git a/xbmc/RenderSystemGLES.cpp b/xbmc/RenderSystemGLES.cpp new file mode 100644 index 00000000..4598629c --- /dev/null +++ b/xbmc/RenderSystemGLES.cpp @@ -0,0 +1,526 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "system.h" + +#if defined(HAS_GLES) + +#include "GraphicContext.h" +#include "Settings.h" +#include "RenderSystemGLES.h" +#include "AdvancedSettings.h" +#include "TimeUtils.h" +#include "log.h" +#include "Application.h" +#include "TextureGL.h" +#include "GUITextureGLES.h" + +using namespace Shaders; + +CRenderSystemGLES::CRenderSystemGLES() : CRenderSystemBase() +{ + m_enumRenderingSystem = RENDERING_SYSTEM_OPENGLES; +} + +CRenderSystemGLES::~CRenderSystemGLES() +{ + DestroyRenderSystem(); +} + +bool CRenderSystemGLES::InitRenderSystem() +{ + m_bVSync = false; + m_iVSyncMode = 0; + m_iSwapStamp = 0; + m_iSwapTime = 0; + m_iSwapRate = 0; + m_bVsyncInit = false; + m_maxTextureSize = 2048; + + + // Get the GL version number + m_RenderVersionMajor = 0; + m_RenderVersionMinor = 0; + + const char* ver = (const char*)glGetString(GL_VERSION); + if (ver != 0) + sscanf(ver, "%d.%d", &m_RenderVersionMajor, &m_RenderVersionMinor); + + // Get our driver vendor and renderer + m_RenderVendor = (const char*) glGetString(GL_VENDOR); + m_RenderRenderer = (const char*) glGetString(GL_RENDERER); + m_renderCaps = RENDER_CAPS_DXT | RENDER_CAPS_NPOT | RENDER_CAPS_DXT_NPOT; +#if defined(HAS_GLEW) + // init glew library + GLenum err = glewInit(); + if (GLEW_OK != err) + { + // Problem: glewInit failed, something is seriously wrong + return false; + } +#endif + + // set matrix identity + m_matModelView.Reset(); + m_matProjection.Reset(); + + LogGraphicsInfo(); + + m_bRenderCreated = true; + + return true; +} + +bool CRenderSystemGLES::ResetRenderSystem(int width, int height, bool fullScreen, float refreshRate) +{ + CRenderSystemBase::ResetRenderSystem(width, height, fullScreen, refreshRate); + + glClearColor( 0.0f, 0.0f, 0.0f, 0.0f ); + + CalculateMaxTexturesize(); + + glViewport(0, 0, width, height); + glScissor(0, 0, width, height); + + glEnable(GL_TEXTURE_2D); + glDisable(GL_SCISSOR_TEST); + + glDisable(GL_DEPTH_TEST); + + return true; +} + +bool CRenderSystemGLES::DestroyRenderSystem() +{ + m_bRenderCreated = false; + + return true; +} + +bool CRenderSystemGLES::BeginRender() +{ + if (!m_bRenderCreated) + return false; + + return CRenderSystemBase::BeginRender(); +} + +bool CRenderSystemGLES::EndRender() +{ + if (!m_bRenderCreated) + return false; + + return CRenderSystemBase::EndRender(); +} + +bool CRenderSystemGLES::ClearBuffers(color_t color) +{ + if (!m_bRenderCreated) + return false; + + float r = (GLfloat)GET_R(color) / 255.0f; + float g = (GLfloat)GET_G(color) / 255.0f; + float b = (GLfloat)GET_B(color) / 255.0f; + float a = (GLfloat)GET_A(color) / 255.0f; + + ClearBuffers(r, g, b, a); + + return true; +} + +bool CRenderSystemGLES::ClearBuffers(float r, float g, float b, float a) +{ + if (!m_bRenderCreated) + return false; + + glClearColor(r, g, b, a); + glClear(GL_COLOR_BUFFER_BIT); + + return true; +} + +void CRenderSystemGLES::ClearStencilBuffer(int val) +{ + glClearStencil(val); + glClear(GL_STENCIL_BUFFER_BIT); +} + +bool CRenderSystemGLES::IsExtSupported(const char* extension) +{ + return true; +} + +bool CRenderSystemGLES::PresentRender() +{ + if (!m_bRenderCreated) + return false; + +#ifdef HAS_FRAMELIMITER + if (m_iVSyncMode != 0 && m_iSwapRate != 0) + { + int64_t curr, diff, freq; + curr = CurrentHostCounter(); + freq = CurrentHostFrequency(); + + if(m_iSwapStamp == 0) + m_iSwapStamp = curr; + + /* calculate our next swap timestamp */ + diff = curr - m_iSwapStamp; + diff = m_iSwapRate - diff % m_iSwapRate; + m_iSwapStamp = curr + diff; + + /* sleep as close as we can before, assume 1ms precision of sleep * + * this should always awake so that we are guaranteed the given * + * m_iSwapTime to do our swap */ + diff = (diff - m_iSwapTime) * 1000 / freq; + if (diff > 0) + Sleep((DWORD)diff); + } +#endif + + bool result = PresentRenderImpl(); + +#ifdef HAS_FRAMELIMITER + if (m_iVSyncMode && m_iSwapRate != 0) + { + int64_t curr, diff; + curr = CurrentHostCounter(); + + diff = curr - m_iSwapStamp; + m_iSwapStamp = curr; + + /* + if (fabs(diff - m_iSwapRate) < fabs(diff)) + CLog::Log(LOGDEBUG, "%s - missed requested swap",__FUNCTION__); + */ + } +#endif + + return result; +} + +void CRenderSystemGLES::SetVSync(bool enable) +{ +#ifdef HAS_EMBEDDED + return; +#endif + + if (m_bVSync==enable && m_bVsyncInit == true) + return; + + if (!m_bRenderCreated) + return; + + if (enable) + CLog::Log(LOGDEBUG, "GL: Enabling VSYNC"); + else + CLog::Log(LOGDEBUG, "GL: Disabling VSYNC"); + + m_iVSyncMode = 0; + m_iVSyncErrors = 0; + m_iSwapRate = 0; + m_bVSync = enable; + m_bVsyncInit = true; + + SetVSyncImpl(enable); + +#ifdef HAS_FRAMELIMITER + if (g_advancedSettings.m_ForcedSwapTime != 0.0) + { + /* some hardware busy wait on swap/glfinish, so we must manually sleep to avoid 100% cpu */ + double rate = g_graphicsContext.GetFPS(); + if (rate <= 0.0 || rate > 1000.0) + { + CLog::Log(LOGWARNING, "Unable to determine a valid horizontal refresh rate, vsync workaround disabled %.2g", rate); + m_iSwapRate = 0; + } + else + { + int64_t freq; + freq = CurrentHostFrequency(); + m_iSwapRate = (__int64)((double)freq / rate); + m_iSwapTime = (__int64)(0.001 * g_advancedSettings.m_ForcedSwapTime * freq); + m_iSwapStamp = 0; + CLog::Log(LOGDEBUG, "GL: Using artificial vsync sleep with rate %f", rate); + if(!m_iVSyncMode) + m_iVSyncMode = 1; + } + } +#endif + + if (!m_iVSyncMode) + CLog::Log(LOGERROR, "GL: Vertical Blank Syncing unsupported"); + else + CLog::Log(LOGDEBUG, "GL: Selected vsync mode %d", m_iVSyncMode); +} + +void CRenderSystemGLES::CaptureStateBlock() +{ + return; +} + +void CRenderSystemGLES::ApplyStateBlock() +{ + return; +} + +bool CRenderSystemGLES::TestRender() +{ + GLfloat vVertices[] = {0.0f, 0.5f, 0.0f, + -0.5f, -0.5f, 0.0f, + 0.5f, -0.5f, 0.0f}; + // Set the viewport + glViewport(0, 0, m_width, m_height); + // Clear the color buffer + glClear(GL_COLOR_BUFFER_BIT); + + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, vVertices); + glEnableVertexAttribArray(0); + glDrawArrays(GL_TRIANGLES, 0, 3); + return true; +} + +void CRenderSystemGLES::CalculateMaxTexturesize() +{ + CLog::Log(LOGDEBUG, "GL: Maximum texture width: %u", m_maxTextureSize); +} + +void CRenderSystemGLES::GetViewPort(CRect& viewPort) +{ + if (!m_bRenderCreated) + return; + + GLint glvp[4]; + glGetIntegerv(GL_VIEWPORT, glvp); + + viewPort.x1 = (float)glvp[0]; + viewPort.y1 = (float)(m_height - glvp[1] - glvp[3]); + viewPort.x2 = (float)(glvp[0] + glvp[2]); + viewPort.y2 = (float)(viewPort.y1 + glvp[3]); +} + +void CRenderSystemGLES::SetViewPort(CRect& viewPort) +{ + if (!m_bRenderCreated) + return; + + glScissor((GLint) viewPort.x1, (GLint) (m_height - viewPort.y1 - viewPort.Height()), (GLsizei) viewPort.Width(), (GLsizei) viewPort.Height()); + glViewport((GLint) viewPort.x1, (GLint) (m_height - viewPort.y1 - viewPort.Height()), (GLsizei) viewPort.Width(), (GLsizei) viewPort.Height()); +} + +void CRenderSystemGLES::EnableClipping(bool bEnable) +{ + if(bEnable) + glEnable(GL_SCISSOR_TEST); + else + glDisable(GL_SCISSOR_TEST); +} + +void CRenderSystemGLES::ApplyClippingRect(CRect& clipRect) +{ + glScissor((GLint) clipRect.x1, (GLint) (m_height - clipRect.y1 - clipRect.Height()), (GLsizei) clipRect.Width(), (GLsizei) clipRect.Height()); + glEnable(GL_SCISSOR_TEST); +} + +void CRenderSystemGLES::GetClipRect(CRect& clipRect) +{ + GLint box[4]; + glGetIntegerv(GL_SCISSOR_BOX, box); + + clipRect.x1 = box[0]; + clipRect.y1 = box[1]; + clipRect.x2 = box[0] + box[2]; + clipRect.y2 = box[1] + box[3]; +} + +void CRenderSystemGLES::EnableTexture(bool bEnable) +{ + if(bEnable) + glEnable(GL_TEXTURE_2D); + else + glDisable(GL_TEXTURE_2D); +} + +void CRenderSystemGLES::EnableBlending(bool bEnableRGB, bool bEnableAlpha) +{ + GLenum srcRGB = GL_SRC_ALPHA; + GLenum dstRGB = bEnableRGB ? GL_ONE_MINUS_SRC_ALPHA : GL_DST_ALPHA; + GLenum srcAlpha = GL_SRC_ALPHA; + GLenum dstAlpha = bEnableAlpha ? GL_SRC_ALPHA : GL_ONE; + +#ifdef HAS_GLEW + if (GLEW_EXT_blend_func_separate) + glBlendFuncSeparateEXT(srcRGB, dstRGB, srcAlpha, dstAlpha); + else + glBlendFunc(srcRGB, dstRGB); +#else + glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); +#endif + + if(bEnableRGB || bEnableAlpha) + glEnable(GL_BLEND); + else + glDisable(GL_BLEND); +} + +void CRenderSystemGLES::EnableStencil(bool bEnable) +{ + if(bEnable) + glEnable(GL_STENCIL_TEST); + else + glDisable(GL_STENCIL_TEST); +} + +void CRenderSystemGLES::EnableDepthTest(bool bEnable) +{ + if(bEnable) + glEnable(GL_DEPTH_TEST); + else + glDisable(GL_DEPTH_TEST); +} + +void CRenderSystemGLES::SetStencilFunc(StencilFunc func, int ref, unsigned int mask) +{ + GLenum glFunc = 0; + + switch(func) + { + case STENCIL_FUNC_NEVER: + glFunc = GL_NEVER; + break; + case STENCIL_FUNC_LESS: + glFunc = GL_LESS; + break; + case STENCIL_FUNC_EQUAL: + glFunc = GL_EQUAL; + break; + case STENCIL_FUNC_LEQUAL: + glFunc = GL_LEQUAL; + break; + case STENCIL_FUNC_GREATER: + glFunc = GL_GREATER; + break; + case STENCIL_FUNC_NOTEQUAL: + glFunc = GL_NOTEQUAL; + break; + case STENCIL_FUNC_GEQUAL: + glFunc = GL_GEQUAL; + break; + case STENCIL_FUNC_ALWAYS: + glFunc = GL_ALWAYS; + break; + } + + glStencilFunc(glFunc, ref, mask); +}; + +void CRenderSystemGLES::SetStencilOp (StencilOp fail_op, StencilOp fail, StencilOp pass) +{ + GLenum glFail_op = 0; + GLenum glFail = 0; + GLenum glPass = 0; + + switch(fail_op) + { + case STENCIL_OP_KEEP: + glFail_op = GL_KEEP; + break; + case STENCIL_OP_REPLACE: + glFail_op = GL_REPLACE; + break; + case STENCIL_OP_INCR: + glFail_op = GL_INCR; + break; + case STENCIL_OP_DECR: + glFail_op = GL_DECR; + break; + case STENCIL_OP_INVERT: + glFail_op = GL_INVERT; + break; + case STENCIL_OP_INCR_WRAP: + glFail_op = GL_INCR_WRAP; + break; + case STENCIL_OP_DECR_WRAP: + glFail_op = GL_DECR_WRAP; + break; + } + + switch(fail) + { + case STENCIL_OP_KEEP: + glFail = GL_KEEP; + break; + case STENCIL_OP_REPLACE: + glFail = GL_REPLACE; + break; + case STENCIL_OP_INCR: + glFail = GL_INCR; + break; + case STENCIL_OP_DECR: + glFail = GL_DECR; + break; + case STENCIL_OP_INVERT: + glFail = GL_INVERT; + break; + case STENCIL_OP_INCR_WRAP: + glFail = GL_INCR_WRAP; + break; + case STENCIL_OP_DECR_WRAP: + glFail = GL_DECR_WRAP; + break; + } + + switch(pass) + { + case STENCIL_OP_KEEP: + glPass = GL_KEEP; + break; + case STENCIL_OP_REPLACE: + glPass = GL_REPLACE; + break; + case STENCIL_OP_INCR: + glPass = GL_INCR; + break; + case STENCIL_OP_DECR: + glPass = GL_DECR; + break; + case STENCIL_OP_INVERT: + glPass = GL_INVERT; + break; + case STENCIL_OP_INCR_WRAP: + glPass = GL_INCR_WRAP; + break; + case STENCIL_OP_DECR_WRAP: + glPass = GL_DECR_WRAP; + break; + } + + + glStencilOp(glFail_op, glFail, glPass); +} + +void CRenderSystemGLES::SetColorMask(bool r, bool g, bool b, bool a) +{ + glColorMask(r, g, b, a); +} + +#endif diff --git a/xbmc/RenderSystemGLES.h b/xbmc/RenderSystemGLES.h new file mode 100644 index 00000000..20eeb5bc --- /dev/null +++ b/xbmc/RenderSystemGLES.h @@ -0,0 +1,87 @@ +/* +* Copyright (C) 2005-2008 Team XBMC +* http://www.xbmc.org +* +* This Program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This Program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XBMC; see the file COPYING. If not, write to +* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +* http://www.gnu.org/copyleft/gpl.html +* +*/ + +#ifndef RENDER_SYSTEM_GLES_H +#define RENDER_SYSTEM_GLES_H + +#pragma once + +#include "RenderSystem.h" + +class CRenderSystemGLES : public CRenderSystemBase +{ +public: + CRenderSystemGLES(); + virtual ~CRenderSystemGLES(); + + virtual bool InitRenderSystem(); + virtual bool DestroyRenderSystem(); + virtual bool ResetRenderSystem(int width, int height, bool fullScreen, float refreshRate); + + virtual bool BeginRender(); + virtual bool EndRender(); + virtual bool PresentRender(); + virtual bool ClearBuffers(color_t color); + virtual bool ClearBuffers(float r, float g, float b, float a); + virtual void ClearStencilBuffer(int val); + virtual bool IsExtSupported(const char* extension); + + virtual void SetVSync(bool vsync); + + virtual void SetViewPort(CRect& viewPort); + virtual void GetViewPort(CRect& viewPort); + + virtual void CaptureStateBlock(); + virtual void ApplyStateBlock(); + + virtual void EnableClipping(bool bEnable); + virtual void ApplyClippingRect(CRect& clipRect); + virtual void GetClipRect(CRect& clipRect); + + bool IsDeviceReady() const { return true; }; + + virtual bool TestRender(); + + virtual void EnableTexture(bool bEnable); + virtual void EnableBlending(bool bEnableRGB, bool bEnableAlpha = false); + virtual void EnableStencil(bool bEnable); + virtual void EnableDepthTest(bool bEnable); + virtual void SetStencilFunc(StencilFunc func, int ref, unsigned int mask); + virtual void SetStencilOp(StencilOp fail_op, StencilOp fail, StencilOp pass); + virtual void SetColorMask(bool r, bool g, bool b, bool a); + +protected: + virtual void SetVSyncImpl(bool enable) = 0; + virtual bool PresentRenderImpl() = 0; + void CalculateMaxTexturesize(); + + int m_iVSyncMode; + int m_iVSyncErrors; + int64_t m_iSwapStamp; + int64_t m_iSwapRate; + int64_t m_iSwapTime; + bool m_bVsyncInit; + + CStdString m_RenderExtensions; +}; + + +#endif // RENDER_SYSTEM_GLES_H diff --git a/xbmc/ThumbnailsManager.cpp b/xbmc/ThumbnailsManager.cpp new file mode 100644 index 00000000..9629045a --- /dev/null +++ b/xbmc/ThumbnailsManager.cpp @@ -0,0 +1,554 @@ +#include "ThumbnailsManager.h" +#include "utils/log.h" +#include "Util.h" +#include "utils/SingleLock.h" +#include "SpecialProtocol.h" +#include "AdvancedSettings.h" +#include +#include "Directory.h" +#include "FileItem.h" +#include +#include "Settings.h" + +#ifdef WIN32 +#define F_OK 0 +#include +#endif + +class GdbmFatalError : public std::exception +{ +public: + GdbmFatalError(const char* msg) + { + m_msg = msg; + } + + virtual ~GdbmFatalError() throw() + { + + } + + virtual const char* what() const throw() + { + return m_msg.c_str(); + } + +private: + std::string m_msg; +}; + +#if GDBM_VERSION_MAJOR >= 1 && GDBM_VERSION_MINOR >= 9 +static void gdbmFatalErrorHandler(const char *msg) +{ + throw GdbmFatalError(msg); +} +#else +static void gdbmFatalErrorHandler() +{ + throw GdbmFatalError(""); +} +#endif + +CThumbnailManager::CThumbnailManager(): m_file(NULL), m_thumbNum(0) +{ + m_path = NULL; +} + +CThumbnailManager::~CThumbnailManager() +{ + if (m_path != NULL) + { + free(m_path); + m_path = NULL; + } +} + +bool CThumbnailManager::IsExternalThumbFile(const std::string &strThumb) +{ + CStdString strMasterProfile = _P("special://masterprofile/Thumbnails"); + CStdString strProfile = _P("special://profile/Thumbnails"); + CStdString strThumbFile = _P(strThumb); + + if(strThumbFile.Find(strMasterProfile) == -1 && + strThumbFile.Find(strProfile) == -1) + { + return true; + } + + return false; +} + +bool CThumbnailManager::Initialize(const std::string &strLocalThumbPath) +{ + std::string strTranslatedPath = PTH_IC(strLocalThumbPath); + std::string fullName = CUtil::AddFileToFolder(strTranslatedPath, "thumb_files.gdbm"); + + m_path = (char*)malloc(fullName.size() + 1); + memset(m_path,0, fullName.size() + 1); + strcpy(m_path, fullName.c_str()); + + // if the file doesn't exist - create it. + try + { + CSingleLock lock(m_lock); + + if (!OpenFile(GDBM_WRCREAT)) + { + return false; + } + + CloseFile(); + + Reorganize(); + } + catch (GdbmFatalError& e) + { + CLog::Log(LOGINFO, "Got gdbm fatal exception, cleaning up: %s", e.what()); + HardReset(); + } + + CLog::Log(LOGDEBUG,"%s initialized Thumbnails manager. contains %d files, average time %lu", __FUNCTION__, m_thumbNum, m_averageTime); + return true; +} + +void CThumbnailManager::Deinitialize() +{ + try + { + CloseFile(); + } + catch (GdbmFatalError& e) + { + CLog::Log(LOGINFO, "Got gdbm fatal exception, cleaning up: %s", e.what()); + HardReset(); + } + + if (m_path != NULL) + { + free(m_path); + m_path = NULL; + } +} + +void CThumbnailManager::TouchThumbnailFile(const std::string &strLocalThumbFile, int64_t newFileSize) +{ + if (IsExternalThumbFile(strLocalThumbFile)) + { + CLog::Log(LOGDEBUG,"%s invalid or external thumbnail %s (thm)", __FUNCTION__, strLocalThumbFile.c_str()); + return; + } + + CLog::Log(LOGDEBUG,"%s touch thumbnail file %s size %lld (thm)", __FUNCTION__, strLocalThumbFile.c_str(), newFileSize); + + try + { + CSingleLock lock(m_lock); + + if (!OpenFile(GDBM_READER)) + { + return; + } + + datum thumbKey, thumbData; + time_t now = time(NULL); + + if (!SetThumKey(thumbKey,strLocalThumbFile)) + { + return; + } + + // update the thumbnails file number and average access time (in case that the file was already exist) + thumbData.dptr = NULL; + thumbData.dsize = 0; + thumbData = gdbm_fetch(m_file, thumbKey); + + CloseFile(); + + ThumbObjRecord *thumbRec = NULL; + bool foundKey = false; + + if (thumbData.dptr == NULL) + { + EnsureThumnailsQuota(newFileSize); + + m_thumbNum ++; + m_averageTime = ((uint64_t)m_averageTime * (m_thumbNum -1) + now ) / m_thumbNum; + CLog::Log(LOGDEBUG,"%s touch thumbnail file %s doesn't exist - add new total %d files average time %lu (thm)", + __FUNCTION__, strLocalThumbFile.c_str(), m_thumbNum, m_averageTime); + + // prepare the new record + thumbRec = (ThumbObjRecord *)malloc(sizeof(ThumbObjRecord)); + memset(thumbRec,0,sizeof(ThumbObjRecord)); + if (thumbRec == NULL) + { + CLog::Log(LOGERROR,"%s SEVERE ERROR malloc failed (thm)", __FUNCTION__); + return; + } + memset(thumbRec,0, sizeof(ThumbObjRecord)); // set + thumbRec->m_size = 0; + } + else + { + foundKey = true; + thumbRec = (ThumbObjRecord *)thumbData.dptr; + m_averageTime = (((uint64_t)m_averageTime * m_thumbNum) + (now - thumbRec->m_accessTime) ) / m_thumbNum; + CLog::Log(LOGDEBUG,"%s touch thumbnail file %s already exist - update the average time total %d files average time %lu(thm)", __FUNCTION__, strLocalThumbFile.c_str(), m_thumbNum, m_averageTime); + } + + if (OpenFile(GDBM_WRITER)) + { + thumbRec->m_accessTime = now; + if (newFileSize != 0 ) + { + thumbRec->m_size = newFileSize; + } + + // the data is the last access time + thumbData.dptr = (char *)thumbRec; + thumbData.dsize = sizeof(ThumbObjRecord); + + // check if the url is already exist - if it is just update its access time + if (gdbm_store(m_file, thumbKey, thumbData, GDBM_REPLACE) != 0) + { + CLog::Log(LOGERROR,"%s Can not insert/replace tnumbnail file %s to the gdbm file (thm)", __FUNCTION__, strLocalThumbFile.c_str()); + } + } + else + { + CLog::Log(LOGERROR,"%s Can not open tnumbnail gdbm file for write(thm)", __FUNCTION__); + } + + // clear all the pre allocated data + if (thumbKey.dptr != NULL) + { + free(thumbKey.dptr); + } + + if (foundKey) + { + FreeDatum(thumbData); + } + else + { + if (thumbRec != NULL) + { + free(thumbRec); + } + } + + CloseFile(); + } + catch (GdbmFatalError& e) + { + CLog::Log(LOGINFO, "Got gdbm fatal exception, cleaning up: %s", e.what()); + HardReset(); + } +} + +void CThumbnailManager::CloseFile() +{ + // make sure that the file is close + if (m_file != NULL) + { + gdbm_close(m_file); + m_file = NULL; + } +} + +bool CThumbnailManager::OpenFile(int permission) +{ + if (!m_path) + { + CLog::Log(LOGERROR,"CThumbnailManager::OpenFile - FAILED to open ThumbnailManager file, path is empty [permission=%d] (thm)",permission); + return false; + } + + m_file = gdbm_open(m_path, 1024, permission, 0644, gdbmFatalErrorHandler); + + if (m_file == NULL) + { + CLog::Log(LOGERROR,"CThumbnailManager::OpenFile - FAILED to open ThumbnailManager file. [path=%s][permission=%d] (thm)", m_path,permission); + return false; + } + + return true; +} + +void CThumbnailManager::FreeDatum(datum &thumbData) +{ +#ifndef _WIN32 + if (thumbData.dptr != NULL) + { + free(thumbData.dptr); + thumbData.dptr = NULL; + } +#else + + // an ugly patch + // gdbm_fetch allocate a memory for thumbdata.dptr, and the user is responsible to release it. + // since we use a gdbm3.dll it compiled with a differnt malloc then ours, so we cant use the resular + // free methond (for windows only) + // so when ever we enter gdbm_fetch it first release the thumbData (its a static global variable) + // and try to fetch the new key. + // in order to free the memory we shold access fetch with a non existing key + datum thumKey; + SetThumKey(thumKey,"NON-EXISTING-KEY"); + thumbData = gdbm_fetch(m_file, thumKey); + + if (thumbData.dptr != NULL) + { + CLog::Log(LOGERROR, "Failed to release thumb Data PTR (thm)"); + } +#endif + +} + +bool CThumbnailManager::SetThumKey(datum &thumbKey, const std::string &keyStr) +{ + // the key is the file name + char *tmpPath = NULL; + int pathSize = keyStr.size() + 1; + tmpPath = (char*)malloc(pathSize); + if (tmpPath == NULL) + { + CLog::Log(LOGERROR,"%s SEVERE ERROR malloc failed (thm)", __FUNCTION__); + return false; + } + memset(tmpPath,0, pathSize); + strcpy(tmpPath, keyStr.c_str()); + + thumbKey.dptr = tmpPath; + thumbKey.dsize = pathSize; + + return true; +} + + +void CThumbnailManager::EnsureThumnailsQuota(int64_t newFileSize) +{ + CFileItemList items; + CStdString profilesDir = _P("special://home/profiles"); + unsigned int totalSize = 0; + + DIRECTORY::CDirectory::GetDirectory(profilesDir, items); + + for(int i=0; im_strPath, "Thumbnails", thumbDir); + + totalSize += CUtil::GetDirSize(thumbDir); + } + + if (totalSize > g_advancedSettings.m_thumbsMaxSize / 1024) + { + CLog::Log(LOGDEBUG,"%s Thumbnails dir size %u exceeded max size %"PRIu64" clear oldest thumbnails (thm)",__FUNCTION__, totalSize, g_advancedSettings.m_thumbsMaxSize); + ClearThumnails(m_averageTime, (uint64_t) (g_advancedSettings.m_thumbsMaxSize * 0.35f), true); + } + +} + +struct ErasedThumbT +{ + public: + std::string m_path; + uint64_t m_size; +}; + +bool LessByTime (time_t time1, time_t time2) +{ + return time1 fileByTime(LessByTime); + std::multimap fileToDelete; + bool needToReorg = false; + + CSingleLock lock(m_lock); + + if (!OpenFile(GDBM_READER)) + { + return; + } + + CLog::Log(LOGDEBUG,"%s files that are older then %lu will be erased (thm)", __FUNCTION__, byDate); + thumbKey = gdbm_firstkey(m_file); + while(thumbKey.dptr != NULL) + { + thumbData = gdbm_fetch(m_file, thumbKey); + + ThumbObjRecord *thumbRec = (ThumbObjRecord *)thumbData.dptr; + if (bEnsureThumnailsQuota || (thumbRec->m_accessTime <= byDate)) + { + ThumbObjRecord *thumbRec = (ThumbObjRecord *)thumbData.dptr; + ErasedThumbT eraseThum; + eraseThum.m_path = thumbKey.dptr; + eraseThum.m_size = thumbRec->m_size; + + CLog::Log(LOGDEBUG,"%s files %s was last accessed on %lu might be erased during cleanup (thm)", __FUNCTION__, thumbKey.dptr, *(time_t *)thumbData.dptr); + fileByTime.insert(thumbRec->m_accessTime); + fileToDelete.insert(std::make_pair(thumbRec->m_accessTime, eraseThum)); + } + + FreeDatum(thumbData); + thumbKey = gdbm_nextkey(m_file, thumbKey); + } + CloseFile(); + + + if (!OpenFile(GDBM_WRITER)) + { + return; + } + + uint64_t deletedSize = 0; + std::set::iterator it = fileByTime.begin(); + while (it != fileByTime.end() && deletedSize < sizeToDelete) + { + + std::multimap::iterator fileIt = fileToDelete.find(*it); + + while (deletedSize < sizeToDelete && fileIt != fileToDelete.end() ) + { + ErasedThumbT fileToErase = fileIt->second; + if (!SetThumKey(thumbKey,fileToErase.m_path)) + { + return; + } + CLog::Log(LOGDEBUG,"%s erase files %s access time %lu (thm)", __FUNCTION__, fileToErase.m_path.c_str(), fileIt->first); + + CStdString translatedPath = _P(fileToErase.m_path); + bool fileExists = access(translatedPath.c_str(), F_OK) !=-1; + + if (fileExists && !IsExternalThumbFile(fileToErase.m_path)) + { + bool fileDeleted = DeleteFile(translatedPath); + + if (gdbm_delete(m_file, thumbKey) != -1) + { + deletedSize += fileToErase.m_size; + needToReorg = true; + } + else + { + CLog::Log(LOGERROR,"%s couldn't delete rec %s from gdbm file (thm)", __FUNCTION__, thumbKey.dptr); + } + + if(!fileDeleted) + { + CLog::Log(LOGERROR,"%s couldn't delete file %s (thm)", __FUNCTION__, translatedPath.c_str()); + } + } + + if (thumbKey.dptr) + { + free(thumbKey.dptr); + } + + fileToDelete.erase(fileIt); + fileIt = fileToDelete.find(*it); + } + + it++; + } + + CloseFile(); + + // clear the containers + fileToDelete.clear(); + fileByTime.clear(); + + if (needToReorg) + { + Reorganize(); + } + } + catch (GdbmFatalError& e) + { + CLog::Log(LOGINFO, "Got gdbm fatal exception, cleaning up: %s", e.what()); + HardReset(); + } +} + +void CThumbnailManager::Reorganize() +{ + datum thumbKey, thumbData; + uint64_t timeAcc = 0; + + m_thumbNum = 0; + m_averageTime = 0; + + // open the gdbm file for write so we can reorganized it, + // calculate the files number and the average size + if (!OpenFile(GDBM_WRITER)) + { + return; + } + gdbm_reorganize(m_file); + + m_averageTime = 0 ; + m_thumbNum = 0; + thumbKey = gdbm_firstkey(m_file); + + int i = 1; + while(thumbKey.dptr != NULL) + { + m_averageTime = 0 ; + m_thumbNum = 0; + thumbData = gdbm_fetch(m_file, thumbKey); + + ThumbObjRecord *thumbRec = (ThumbObjRecord *)thumbData.dptr; + //CLog::Log(LOGDEBUG,"%s %d. %s - %lu size %"PRIu64" (thm)", __FUNCTION__, i, thumbKey.dptr, thumbRec->m_accessTime, thumbRec->m_size); + + timeAcc += thumbRec->m_accessTime; + thumbKey = gdbm_nextkey(m_file, thumbKey); + m_thumbNum ++; + + FreeDatum(thumbData); + i++; + } + + if (m_thumbNum != 0) + { + m_averageTime = timeAcc / m_thumbNum; + } + + CloseFile(); + //CLog::Log(LOGDEBUG,"%s thumbs file num %d average size %lu",__FUNCTION__, m_thumbNum, m_averageTime); +} + +bool CThumbnailManager::HardReset() +{ + CSingleLock lock(m_lock); + + try + { + CloseFile(); + + CUtil::WipeDir(g_settings.GetThumbnailsFolder()); + g_settings.CreateThumbnailsFolders(); + + ::DeleteFile(m_path); + + if (!OpenFile(GDBM_WRCREAT)) + { + return false; + } + + CloseFile(); + } + catch (GdbmFatalError& e) + { + CLog::Log(LOGINFO, "Got gdbm fatal exception: %s", e.what()); + return false; + } + + return true; +} + + diff --git a/xbmc/ThumbnailsManager.h b/xbmc/ThumbnailsManager.h new file mode 100644 index 00000000..c356c6b3 --- /dev/null +++ b/xbmc/ThumbnailsManager.h @@ -0,0 +1,82 @@ +#pragma once +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "utils/CriticalSection.h" + +#include + +#ifdef _WIN32 +#include "lib/libgdbm/gdbm.h" +#else +#include +#endif +// +// The reference count and progress information for the cache objects +// +struct ThumbObjRecord + { + public: + time_t m_accessTime; + uint64_t m_size; + }; + +class CThumbnailManager +{ +public: + CThumbnailManager(); + ~CThumbnailManager(); + + bool Initialize(const std::string &strLocalThumbFile); + void Deinitialize(); + + void TouchThumbnailFile(const std::string &strLocalThumbFile, int64_t newFileSize); + + // you can clear the thumbnails by two criterias: + // 1. byDate - use for clearOldThumbnails - older then a specific date - then the sizeToDelete sould be equal + // to the whole quota (and only the older file will be deleted) + // 2. by Size + // you can the size and time can be the avergae time or even now - the files will be deleted till + // the specific sizez was erased + void ClearThumnails(time_t byDate , uint64_t sizeToDelete, bool bEnsureThumnailsQuota=false); + + // Deletes all the thumbnails, the gdbm file and starts fresh + bool HardReset(); + +protected: + + bool OpenFile(int permission); + void CloseFile(); + void EnsureThumnailsQuota(int64_t newFileSize); + void Reorganize(); + void FreeDatum(datum &thumbData); + + // allocate memeory for the key.dptr - need to be freed after use + bool SetThumKey(datum &thumbKey, const std::string &keyStr); + bool IsExternalThumbFile(const std::string &strThumbFile); + + char* m_path; + + CCriticalSection m_lock; + GDBM_FILE m_file; + uint32_t m_thumbNum; + time_t m_averageTime; +}; diff --git a/xbmc/WinBindingEGL.cpp b/xbmc/WinBindingEGL.cpp new file mode 100644 index 00000000..c797f7df --- /dev/null +++ b/xbmc/WinBindingEGL.cpp @@ -0,0 +1,221 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "system.h" + +#ifdef HAS_EGL + +#include "WinBindingEGL.h" +#include "log.h" + +CWinBindingEGL::CWinBindingEGL() +{ + m_surface = EGL_NO_SURFACE; + m_context = EGL_NO_CONTEXT; + m_display = EGL_NO_DISPLAY; +} + +CWinBindingEGL::~CWinBindingEGL() +{ + DestroyWindow(); +} + +bool CWinBindingEGL::ReleaseSurface() +{ + EGLBoolean eglStatus; + + if (m_surface == EGL_NO_SURFACE) + { + return true; + } + + eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + + eglStatus = eglDestroySurface(m_display, m_surface); + if (!eglStatus) + { + CLog::Log(LOGERROR, "Error destroying EGL surface"); + return false; + } + + m_surface = EGL_NO_SURFACE; + + return true; +} + +bool CWinBindingEGL::CreateWindow(EGLNativeDisplayType nativeDisplay, EGLNativeWindowType nativeWindow) +{ + EGLBoolean eglStatus; + EGLint configCount; + EGLConfig* configList = NULL; + + m_nativeDisplay = nativeDisplay; + m_nativeWindow = nativeWindow; + + m_display = eglGetDisplay(nativeDisplay); + if (m_display == EGL_NO_DISPLAY) + { + CLog::Log(LOGERROR, "EGL failed to obtain display"); + return false; + } + + if (!eglInitialize(m_display, 0, 0)) + { + CLog::Log(LOGERROR, "EGL failed to initialize"); + return false; + } + + EGLint configAttrs[] = { + EGL_RED_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_BLUE_SIZE, 8, + EGL_DEPTH_SIZE, 0, + EGL_STENCIL_SIZE, 0, + EGL_SAMPLE_BUFFERS, 0, + EGL_SAMPLES, 0, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + EGL_NONE + }; + + // Find out how many configurations suit our needs + eglStatus = eglChooseConfig(m_display, configAttrs, NULL, 0, &configCount); + if (!eglStatus || !configCount) + { + CLog::Log(LOGERROR, "EGL failed to return any matching configurations: %d", eglStatus); + return false; + } + + // Allocate room for the list of matching configurations + configList = (EGLConfig*)malloc(configCount * sizeof(EGLConfig)); + if (!configList) + { + CLog::Log(LOGERROR, "kdMalloc failure obtaining configuration list"); + return false; + } + + // Obtain the configuration list from EGL + eglStatus = eglChooseConfig(m_display, configAttrs, + configList, configCount, &configCount); + if (!eglStatus || !configCount) + { + CLog::Log(LOGERROR, "EGL failed to populate configuration list: %d", eglStatus); + return false; + } + + // Select an EGL configuration that matches the native window + m_config = configList[0]; + + EGLint* attribList = NULL; +#ifdef EMPOWER + EGLint windowAttrs[3]; + int windowIndex = 0; + windowAttrs[windowIndex++] = EGL_RENDER_BUFFER; + windowAttrs[windowIndex++] = EGL_BACK_BUFFER; + windowAttrs[windowIndex++] = EGL_NONE; + attribList = windowAttrs; +#endif + + if (m_surface != EGL_NO_SURFACE) + { + ReleaseSurface(); + } + + m_surface = eglCreateWindowSurface(m_display, m_config, m_nativeWindow, attribList); + if (!m_surface) + { + CLog::Log(LOGERROR, "EGL couldn't create window surface"); + return false; + } + + eglStatus = eglBindAPI(EGL_OPENGL_ES_API); + if (!eglStatus) + { + CLog::Log(LOGERROR, "EGL failed to bind API: %d", eglStatus); + return false; + } + + EGLint contextAttrs[] = + { + EGL_CONTEXT_CLIENT_VERSION, 2, + EGL_NONE + }; + + // Create an EGL context + if (m_context == EGL_NO_CONTEXT) + { + m_context = eglCreateContext(m_display, m_config, NULL, contextAttrs); + if (!m_context) + { + CLog::Log(LOGERROR, "EGL couldn't create context"); + return false; + } + } + + // Make the context and surface current for rendering + eglStatus = eglMakeCurrent(m_display, m_surface, m_surface, m_context); + if (!eglStatus) + { + CLog::Log(LOGERROR, "EGL couldn't make context/surface current: %d", eglStatus); + return false; + } + + free(configList); + + eglSwapInterval(m_display, 0); + + CLog::Log(LOGINFO, "EGL window and context creation complete"); + + return true; +} + +bool CWinBindingEGL::DestroyWindow() +{ + EGLBoolean eglStatus; + if (m_context != EGL_NO_CONTEXT) + { + eglStatus = eglDestroyContext(m_display, m_context); + if (!eglStatus) + CLog::Log(LOGERROR, "Error destroying EGL context"); + m_context = EGL_NO_CONTEXT; + } + + if (m_surface != EGL_NO_SURFACE) + { + eglStatus = eglDestroySurface(m_display, m_surface); + if (!eglStatus) + CLog::Log(LOGERROR, "Error destroying EGL surface"); + m_surface = EGL_NO_SURFACE; + } + + if (m_display != EGL_NO_DISPLAY) + { + eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + + eglStatus = eglTerminate(m_display); + if (!eglStatus) + CLog::Log(LOGERROR, "Error terminating EGL"); + m_display = EGL_NO_DISPLAY; + } + + return true; +} + +#endif diff --git a/xbmc/WinBindingEGL.h b/xbmc/WinBindingEGL.h new file mode 100644 index 00000000..9ffa5dee --- /dev/null +++ b/xbmc/WinBindingEGL.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#ifndef WINDOW_BINDING_EGL_H +#define WINDOW_BINDING_EGL_H + +#include +#ifndef _WIN32 +#include +#endif + +class CWinBindingEGL +{ +public: + CWinBindingEGL(); + ~CWinBindingEGL(); + + bool CreateWindow(EGLNativeDisplayType nativeDisplay, EGLNativeWindowType nativeWindow); + bool DestroyWindow(); + bool ReleaseSurface(); + + EGLNativeWindowType GetNativeWindow() { return m_nativeWindow; } + EGLNativeDisplayType GetNativeDisplay() { return m_nativeDisplay; } + EGLDisplay GetDisplay() { return m_display; } + EGLSurface GetSurface() { return m_surface; } + EGLContext GetContext() { return m_context; } + +protected: + EGLNativeWindowType m_nativeWindow; + EGLNativeDisplayType m_nativeDisplay; + EGLDisplay m_display; + EGLSurface m_surface; + EGLConfig m_config; + EGLContext m_context; +}; + +#endif // WINDOW_BINDING_EGL_H + diff --git a/xbmc/WinEventsBoxeeBox.cpp b/xbmc/WinEventsBoxeeBox.cpp new file mode 100644 index 00000000..b16163f5 --- /dev/null +++ b/xbmc/WinEventsBoxeeBox.cpp @@ -0,0 +1,74 @@ +/* +* Copyright (C) 2005-2008 Team XBMC +* http://www.xbmc.org +* +* This Program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This Program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XBMC; see the file COPYING. If not, write to +* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +* http://www.gnu.org/copyleft/gpl.html +* +*/ +#include "system.h" + +#if defined(_LINUX) && !defined(__APPLE__) && defined(HAS_EMBEDDED) + +#include "WinEventsBoxeeBox.h" +#include "WinEvents.h" +#include "XBMC_events.h" +#include "XBMC_keysym.h" +#include "Application.h" +#include "MouseStat.h" +#include "log.h" +#include "common/LinuxInputDevices.h" + +PHANDLE_EVENT_FUNC CWinEventsBase::m_pEventFunc = NULL; + +bool m_initialized = false; +CLinuxInputDevices m_devices; + +CWinEventsBoxeeBox::CWinEventsBoxeeBox() +{ +} + +static void InitLinuxDevices() +{ + if (m_initialized) return; + + m_devices.InitAvailable(); + + m_initialized = true; +} + +bool CWinEventsBoxeeBox::MessagePump() +{ + InitLinuxDevices(); + + bool ret = false; + XBMC_Event event; + while (1) + { + event = m_devices.ReadEvent(); + if (event.type != XBMC_NOEVENT) + { + ret |= g_application.OnEvent(event); + } + else + { + break; + } + } + + return ret; +} + +#endif diff --git a/xbmc/WinEventsBoxeeBox.h b/xbmc/WinEventsBoxeeBox.h new file mode 100644 index 00000000..95de4690 --- /dev/null +++ b/xbmc/WinEventsBoxeeBox.h @@ -0,0 +1,36 @@ +/* +* Copyright (C) 2005-2008 Team XBMC +* http://www.xbmc.org +* +* This Program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This Program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XBMC; see the file COPYING. If not, write to +* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +* http://www.gnu.org/copyleft/gpl.html +* +*/ + +#ifndef WINDOW_EVENTS_OPENKODE_H +#define WINDOW_EVENTS_OPENKODE_H + +#pragma once +#include "WinEvents.h" + +class CWinEventsBoxeeBox : public CWinEventsBase +{ +public: + CWinEventsBoxeeBox(); + static bool MessagePump(); + +}; + +#endif diff --git a/xbmc/WinEventsIntelCE.cpp b/xbmc/WinEventsIntelCE.cpp new file mode 100644 index 00000000..f20076ae --- /dev/null +++ b/xbmc/WinEventsIntelCE.cpp @@ -0,0 +1,145 @@ +/* +* Copyright (C) 2005-2008 Team XBMC +* http://www.xbmc.org +* +* This Program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This Program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XBMC; see the file COPYING. If not, write to +* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +* http://www.gnu.org/copyleft/gpl.html +* +*/ +#include "system.h" + +#if defined(HAS_INTELCE) + +#include "WinEventsIntelCE.h" +#include "WinEvents.h" +#include "XBMC_events.h" +#include "XBMC_keysym.h" +#include "Application.h" +#include "MouseStat.h" +#include "log.h" +#include "PowerManager.h" + +PHANDLE_EVENT_FUNC CWinEventsBase::m_pEventFunc = NULL; + +bool CWinEventsIntelCE::m_initialized = false; +CLinuxInputDevices CWinEventsIntelCE::m_devices; +std::map CWinEventsIntelCE::m_altMap; +std::map CWinEventsIntelCE::m_keyPadMap; + +CWinEventsIntelCE::CWinEventsIntelCE() +{ + +} + +void CWinEventsIntelCE::RefreshDevices() +{ + m_devices.InitAvailable(); +} + +bool CWinEventsIntelCE::IsRemoteLowBattery() +{ + return m_devices.IsRemoteLowBattery(); +} + +bool CWinEventsIntelCE::MessagePump() +{ + static int number; + static bool accumlate; + + if (!m_initialized) + { + m_devices.InitAvailable(); + + // Mapping of ALT-XXX of codepage 437 to unicode + m_altMap[130] = 0x00E9; + m_altMap[225] = 0x00DF; + m_altMap[135] = 0x00E7; + m_altMap[138] = 0x00E8; + m_altMap[149] = 0x00F2; + m_altMap[133] = 0x00E0; + m_altMap[151] = 0x00F9; + m_altMap[129] = 0x00FC; + m_altMap[134] = 0x00E5; + m_altMap[148] = 0x00F6; + m_altMap[162] = 0x00F3; + m_altMap[164] = 0x00F1; + m_altMap[145] = 0x00E6; + m_altMap[132] = 0x00E4; + + // Mapping of keypad scancodes to their numeric values + m_keyPadMap[82] = 0; + m_keyPadMap[79] = 1; + m_keyPadMap[80] = 2; + m_keyPadMap[81] = 3; + m_keyPadMap[75] = 4; + m_keyPadMap[76] = 5; + m_keyPadMap[77] = 6; + m_keyPadMap[71] = 7; + m_keyPadMap[72] = 8; + m_keyPadMap[73] = 9; + + m_initialized = true; + } + + bool ret = false; + XBMC_Event event; + while (1) + { + event = m_devices.ReadEvent(); + + // Wait for first left ALT press, then capture numbers pressed, then wait for left ALT release. + // Translate the number into a unicode value. This is to support latin characters. + if (event.key.keysym.sym == XBMCK_LALT && event.type == XBMC_KEYDOWN) + { + accumlate = true; + number = 0; + } + + if (accumlate && (event.type == XBMC_KEYDOWN)) + { + int keyPad = m_keyPadMap.at(event.key.keysym.scancode); + number = number * 10 + keyPad; + } + + if (accumlate && event.key.keysym.sym == XBMCK_LALT && event.type == XBMC_KEYUP) + { + accumlate = false; + event.type = XBMC_KEYDOWN; + event.key.keysym.sym = XBMCK_UNKNOWN;; + + if (m_altMap.find(number) != m_altMap.end()) + { + event.key.keysym.unicode = m_altMap[number]; + } + else + { + event.key.keysym.unicode = number; + } + } + + if ((event.type != XBMC_NOEVENT) && !accumlate) + { + ret |= g_application.OnEvent(event); + } + else + { + break; + } + } + + return ret; +} + +#endif diff --git a/xbmc/WinEventsIntelCE.h b/xbmc/WinEventsIntelCE.h new file mode 100644 index 00000000..97a6e894 --- /dev/null +++ b/xbmc/WinEventsIntelCE.h @@ -0,0 +1,45 @@ +/* +* Copyright (C) 2005-2008 Team XBMC +* http://www.xbmc.org +* +* This Program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This Program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XBMC; see the file COPYING. If not, write to +* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +* http://www.gnu.org/copyleft/gpl.html +* +*/ + +#ifndef WINDOW_EVENTS_OPENKODE_H +#define WINDOW_EVENTS_OPENKODE_H + +#pragma once +#include +#include "WinEvents.h" +#include "common/LinuxInputDevices.h" + +class CWinEventsIntelCE : public CWinEventsBase +{ +public: + CWinEventsIntelCE(); + static bool MessagePump(); + static void RefreshDevices(); + static bool IsRemoteLowBattery(); + +private: + static bool m_initialized; + static CLinuxInputDevices m_devices; + static std::map m_altMap; + static std::map m_keyPadMap; +}; + +#endif diff --git a/xbmc/WinEventsX11.cpp b/xbmc/WinEventsX11.cpp new file mode 100644 index 00000000..4c8a1508 --- /dev/null +++ b/xbmc/WinEventsX11.cpp @@ -0,0 +1,220 @@ +/* +* Copyright (C) 2005-2008 Team XBMC +* http://www.xbmc.org +* +* This Program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This Program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XBMC; see the file COPYING. If not, write to +* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +* http://www.gnu.org/copyleft/gpl.html +* +*/ + +#include "system.h" +#include "WinEvents.h" +#include "Application.h" +#include "XBMC_vkeys.h" +#include "MouseStat.h" +#include "WindowingFactory.h" + +#ifdef HAS_X11 + +PHANDLE_EVENT_FUNC CWinEventsBase::m_pEventFunc = NULL; + +static bool GetKeyboardEvent(XEvent event, XBMC_Event& xbmcEvent) +{ + KeySym keySym = XLookupKeysym(&event.xkey, 0); + + if (keySym > 127) + { + switch (keySym) + { + case XK_Escape: xbmcEvent.key.keysym.sym = XBMCK_ESCAPE; break; + case XK_BackSpace: xbmcEvent.key.keysym.sym = XBMCK_BACKSPACE; break; + case XK_KP_Tab: case XK_Tab: xbmcEvent.key.keysym.sym = XBMCK_TAB; break; + case XK_Return: xbmcEvent.key.keysym.sym = XBMCK_RETURN; break; + case XK_Delete: xbmcEvent.key.keysym.sym = XBMCK_DELETE; break; + case XK_KP_Home: case XK_Home: xbmcEvent.key.keysym.sym = XBMCK_HOME; break; + case XK_KP_Left: case XK_Left: xbmcEvent.key.keysym.sym = XBMCK_LEFT; break; + case XK_KP_Up: case XK_Up: xbmcEvent.key.keysym.sym = XBMCK_UP; break; + case XK_KP_Right: case XK_Right: xbmcEvent.key.keysym.sym = XBMCK_RIGHT; break; + case XK_KP_Page_Up: case XK_Page_Up: xbmcEvent.key.keysym.sym = XBMCK_PAGEUP; break; + case XK_KP_Page_Down: case XK_Page_Down: xbmcEvent.key.keysym.sym = XBMCK_PAGEDOWN; break; + case XK_KP_Down: case XK_Down: xbmcEvent.key.keysym.sym = XBMCK_DOWN; break; + case XK_KP_End: case XK_End: xbmcEvent.key.keysym.sym = XBMCK_END; break; + case XK_KP_Enter: xbmcEvent.key.keysym.sym = XBMCK_KP_ENTER; break; + case XK_KP_Equal: xbmcEvent.key.keysym.sym = XBMCK_KP_EQUALS; break; + case XK_KP_Multiply: xbmcEvent.key.keysym.sym = XBMCK_KP_MULTIPLY; break; + case XK_KP_Add: xbmcEvent.key.keysym.sym = XBMCK_KP_PLUS; break; + case XK_KP_Subtract: xbmcEvent.key.keysym.sym = XBMCK_KP_MINUS; break; + case XK_KP_Divide: xbmcEvent.key.keysym.sym = XBMCK_KP_DIVIDE; break; + case XK_F1: xbmcEvent.key.keysym.sym = XBMCK_F1; break; + case XK_F2: xbmcEvent.key.keysym.sym = XBMCK_F2; break; + case XK_F3: xbmcEvent.key.keysym.sym = XBMCK_F3; break; + case XK_F4: xbmcEvent.key.keysym.sym = XBMCK_F4; break; + case XK_F5: xbmcEvent.key.keysym.sym = XBMCK_F5; break; + case XK_F6: xbmcEvent.key.keysym.sym = XBMCK_F6; break; + case XK_F7: xbmcEvent.key.keysym.sym = XBMCK_F7; break; + case XK_F8: xbmcEvent.key.keysym.sym = XBMCK_F8; break; + case XK_F9: xbmcEvent.key.keysym.sym = XBMCK_F9; break; + case XK_F10: xbmcEvent.key.keysym.sym = XBMCK_F10; break; + case XK_F11: xbmcEvent.key.keysym.sym = XBMCK_F11; break; + case XK_F12: xbmcEvent.key.keysym.sym = XBMCK_F12; break; + case XK_Menu: xbmcEvent.key.keysym.sym = XBMCK_MENU; break; + case XK_Control_L: xbmcEvent.key.keysym.sym = XBMCK_LCTRL; break; + case XK_Control_R: xbmcEvent.key.keysym.sym = XBMCK_RCTRL; break; + case XK_Shift_L: xbmcEvent.key.keysym.sym = XBMCK_LSHIFT; break; + case XK_Shift_R: xbmcEvent.key.keysym.sym = XBMCK_RSHIFT; break; + case XK_Meta_L: xbmcEvent.key.keysym.sym = XBMCK_LMETA; break; + case XK_Meta_R: xbmcEvent.key.keysym.sym = XBMCK_RMETA; break; + case XK_Alt_L: xbmcEvent.key.keysym.sym = XBMCK_LALT; break; + case XK_Alt_R: xbmcEvent.key.keysym.sym = XBMCK_RALT; break; + default: xbmcEvent.key.keysym.sym = XBMCK_UNKNOWN; break; + } + } + else + { + xbmcEvent.key.keysym.sym = (XBMCKey) keySym; + xbmcEvent.key.keysym.unicode = keySym; + } + + return true; +} + +static bool GetMouseButtonEvent(XEvent event, XBMC_Event& xbmcEvent) +{ + xbmcEvent.button.x = event.xbutton.x; + xbmcEvent.button.y = event.xbutton.y; + xbmcEvent.button.button = event.xbutton.button; + + return true; +} + +static bool GetMouseMotionEvent(XEvent event, XBMC_Event& xbmcEvent) +{ + xbmcEvent.motion.x = event.xmotion.x; + xbmcEvent.motion.y = event.xmotion.y; + xbmcEvent.motion.state = 0; + return true; +} + +bool CWinEventsX11::MessagePump() +{ + Display* display = g_Windowing.GetDisplay(); + XEvent event; + bool ret = false; + + while (XPending(display) > 0) + { + XNextEvent(display, &event); + switch(event.type) + { + case ClientMessage: + if (event.xclient.data.l[0] == XInternAtom(display, "WM_DELETE_WINDOW", False)) + { + if (!g_application.m_bStop) g_application.getApplicationMessenger().Quit(); + } + break; + + case FocusIn: + g_application.m_AppFocused = false; + g_Windowing.NotifyAppFocusChange(g_application.m_AppFocused); + break; + + case FocusOut: + g_application.m_AppFocused = true; + g_Windowing.NotifyAppFocusChange(g_application.m_AppFocused); + break; + + case VisibilityNotify: + g_application.m_AppActive = (event.xvisibility.state != VisibilityFullyObscured); + g_Windowing.NotifyAppActiveChange(g_application.m_AppActive); + break; + + case KeyPress: + { + // process any platform specific shortcuts before handing off to XBMC + XBMC_Event newEvent; + memset(&newEvent, 0, sizeof(XBMC_Event)); + if (!GetKeyboardEvent(event, newEvent)) + continue; //newEvent.resize.type = event.resize.type; + newEvent.type = XBMC_KEYDOWN; + + // don't handle any more messages in the queue until we've handled keydown, + // if a keyup is in the queue it will reset the keypress before it is handled. + ret |= g_application.OnEvent(newEvent); + break; + } + + case KeyRelease: + { + XBMC_Event newEvent; + memset(&newEvent, 0, sizeof(XBMC_Event)); + if (!GetKeyboardEvent(event, newEvent)) + continue; + newEvent.type = XBMC_KEYUP; + + ret |= g_application.OnEvent(newEvent); + break; + } + + case ButtonPress: + { + XBMC_Event newEvent; + memset(&newEvent, 0, sizeof(XBMC_Event)); + if (!GetMouseButtonEvent(event, newEvent)) + continue; + newEvent.button.state = XBMC_PRESSED; + newEvent.type = XBMC_MOUSEBUTTONDOWN; + ret |= g_application.OnEvent(newEvent); + break; + } + + case ButtonRelease: + { + XBMC_Event newEvent; + memset(&newEvent, 0, sizeof(XBMC_Event)); + if (!GetMouseButtonEvent(event, newEvent)) + continue; + newEvent.button.state = XBMC_RELEASED; + newEvent.type = XBMC_MOUSEBUTTONUP; + ret |= g_application.OnEvent(newEvent); + break; + } + + case MotionNotify: + { + XBMC_Event newEvent; + memset(&newEvent, 0, sizeof(XBMC_Event)); + if (!GetMouseMotionEvent(event, newEvent)) + continue; + newEvent.type = XBMC_MOUSEMOTION; + ret |= g_application.OnEvent(newEvent); + break; + } + + case ConfigureNotify: + { + XBMC_Event newEvent; + newEvent.type = XBMC_VIDEORESIZE; + newEvent.resize.w = event.xconfigure.width; + newEvent.resize.h = event.xconfigure.height; + ret |= g_application.OnEvent(newEvent); + break; + } + } + } + + return ret; +} + +#endif diff --git a/xbmc/WinEventsX11.h b/xbmc/WinEventsX11.h new file mode 100644 index 00000000..adfd9da6 --- /dev/null +++ b/xbmc/WinEventsX11.h @@ -0,0 +1,35 @@ +/* +* Copyright (C) 2005-2008 Team XBMC +* http://www.xbmc.org +* +* This Program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This Program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XBMC; see the file COPYING. If not, write to +* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +* http://www.gnu.org/copyleft/gpl.html +* +*/ + +#ifndef WINDOW_EVENTS_X11_H +#define WINDOW_EVENTS_X11_H + +#pragma once + +#include "WinEvents.h" + +class CWinEventsX11 : public CWinEventsBase +{ +public: + static bool MessagePump(); +}; + +#endif // WINDOW_EVENTS_X11_H diff --git a/xbmc/WinSystemEGL.cpp b/xbmc/WinSystemEGL.cpp new file mode 100644 index 00000000..f34cb983 --- /dev/null +++ b/xbmc/WinSystemEGL.cpp @@ -0,0 +1,503 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "system.h" + +#ifdef HAS_EGL + +#if defined(EMPOWER) && defined(HAS_OPENKODE) +// kd.h uses st_mtime which we override (for reasons I can't remember) +#undef st_mtime +#include +#include +#include +#endif + +#include "WinSystemEGL.h" +#include "SpecialProtocol.h" +#include "Settings.h" +#include "Texture.h" +#include "log.h" + +#ifdef HAS_GDL +#include "WinSystemGDL.h" +#endif + +CWinSystemEGL::CWinSystemEGL() : EGL_BASE_CLASS() +{ + m_eWindowSystem = WINDOW_SYSTEM_OPENKODE; + m_surface = EGL_NO_SURFACE; + m_context = EGL_NO_CONTEXT; + m_display = EGL_NO_DISPLAY; +#if defined(EMPOWER) && defined(HAS_OPENKODE) + m_kdWindow = KD_NULL; + m_kdDesktop = KD_NULL; + m_kdDisplay = KD_NULL; +#endif +} + +CWinSystemEGL::~CWinSystemEGL() +{ + DestroyWindowSystem(); +}; + +bool CWinSystemEGL::InitWindowSystem() +{ + if (!EGL_BASE_CLASS::InitWindowSystem()) + return false; + +#if defined(EMPOWER) && defined(HAS_OPENKODE) + kdInitializeNV(); +#endif + + return true; +} + +bool CWinSystemEGL::DestroyWindowSystem() +{ +#if defined(EMPOWER) && defined(HAS_OPENKODE) + kdTerminateNV(); +#endif + + return true; +} + +#ifdef HAS_X11 +static int ApplicationErrorHandler(Display *display, XErrorEvent *theEvent) +{ + CLog::Log(LOGERROR, + "Ignoring Xlib error: error code %d request code %d\n", + theEvent->error_code, + theEvent->request_code) ; + + /* No exit! - but keep lint happy */ + + return 0 ; +} +#endif + +bool CWinSystemEGL::CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction) +{ +#if defined(EMPOWER) && defined(HAS_OPENKODE) + KDboolean b; + KDDisplayModeNV mode; + KDint desktopSize[2] = { res.iWidth, res.iHeight }; +#endif +#ifdef _WIN32 + EGL_BASE_CLASS::CreateNewWindow(name, fullScreen, res, userFunction); +#endif + + m_nWidth = res.iWidth; + m_nHeight = res.iHeight; + m_bFullScreen = fullScreen; + + EGLBoolean eglStatus; + EGLint configCount; + EGLConfig* configList = NULL; + +#if defined(EMPOWER) && defined(HAS_OPENKODE) + //CLog::Log(LOGDEBUG, "NV: GetDisplay"); + m_kdDisplay = kdGetDisplayNV(KD_DEFAULT_DISPLAY_NV, KD_NULL); + if (!m_kdDisplay) + { + CLog::Log(LOGERROR, "Could not obtain KDDisplayNV pointer"); + return false; + } + b = KD_FALSE; + //CLog::Log(LOGDEBUG, "NV: SetDisplayProperty"); + kdSetDisplayPropertybvNV(m_kdDisplay, KD_DISPLAYPROPERTY_ENABLED_NV, &b); + kdReleaseDisplayNV(m_kdDisplay); + + // MZL: enable HDMI display + //CLog::Log(LOGDEBUG, "NV: SetDisplayPropertybyNV"); + kdSetDisplayPropertybvNV(m_kdDisplay, KD_DISPLAYPROPERTY_ENABLED_NV, &b); + m_kdDisplay = kdGetDisplayNV("Tegra:HDMI0", KD_NULL); + if (!m_kdDisplay) + { + CLog::Log(LOGERROR, "Could not obtain KDDisplayNV pointer"); + return false; + } + b = KD_TRUE; + kdSetDisplayPropertybvNV(m_kdDisplay, KD_DISPLAYPROPERTY_ENABLED_NV, &b); + kdSetDisplayPropertycvNV(m_kdDisplay, KD_DISPLAYPROPERTY_DESKTOP_NAME_NV, KD_DEFAULT_DESKTOP_NV); + + mode.width = res.iWidth; + mode.height = res.iHeight; + mode.refresh = 60; + //CLog::Log(LOGDEBUG, "NV: SetDisplayPropertyNV"); + if (kdSetDisplayModeNV(m_kdDisplay, &mode, KD_DISPLAY_PROTOCOL_AUTOMATIC_NV)) + { + CLog::Log(LOGERROR, "Could not set display mode\n"); + return false; + } + + //CLog::Log(LOGDEBUG, "NV: GetDesktopNV"); + m_kdDesktop = kdGetDesktopNV(KD_DEFAULT_DESKTOP_NV, KD_NULL); + if (!m_kdDesktop) + { + CLog::Log(LOGERROR, "Could not obtain KDDesktopNV pointer"); + return false; + } + + //CLog::Log(LOGDEBUG, "NV: SetDesktopivNV"); + if (kdSetDesktopPropertyivNV(m_kdDesktop, KD_DESKTOPPROPERTY_SIZE_NV, desktopSize)) + { + CLog::Log(LOGERROR, "Could not set desktop size"); + return false; + } +#endif + +#ifdef HAS_X11 + m_x11Display = XOpenDisplay(NULL); + if (!m_x11Display) + { + CLog::Log(LOGERROR, "Could not open X11"); + return false; + } + + XSetErrorHandler(ApplicationErrorHandler) ; +#endif + + //CLog::Log(LOGDEBUG, "eglGetDisplay"); +#if defined(HAS_OPENKODE) || defined(HAS_GDL) + m_display = eglGetDisplay(EGL_DEFAULT_DISPLAY); +#elif defined(_WIN32) + m_display = eglGetDisplay(m_hDC); +#elif defined(HAS_X11) + m_display = eglGetDisplay((EGLNativeDisplayType) m_x11Display); +#endif + if (m_display == EGL_NO_DISPLAY) + { + CLog::Log(LOGERROR, "EGL failed to obtain display"); + return false; + } + + //CLog::Log(LOGDEBUG, "eglInitialize"); + if (!eglInitialize(m_display, 0, 0)) + { + CLog::Log(LOGERROR, "EGL failed to initialize"); + return false; + } + + EGLint configAttrs[] = { + EGL_RED_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_BLUE_SIZE, 8, + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 8, + EGL_SAMPLE_BUFFERS, 0, + EGL_SAMPLES, 0, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + EGL_NONE + }; + + // Find out how many configurations suit our needs + //CLog::Log(LOGDEBUG, "eglChooseConfig"); + eglStatus = eglChooseConfig(m_display, configAttrs, NULL, 0, &configCount); + if (!eglStatus || !configCount) + { + CLog::Log(LOGERROR, "EGL failed to return any matching configurations"); + return false; + } + + // Allocate room for the list of matching configurations + configList = (EGLConfig*)malloc(configCount * sizeof(EGLConfig)); + if (!configList) + { + CLog::Log(LOGERROR, "kdMalloc failure obtaining configuration list"); + return false; + } + + // Obtain the configuration list from EGL + eglStatus = eglChooseConfig(m_display, configAttrs, + configList, configCount, &configCount); + if (!eglStatus || !configCount) + { + CLog::Log(LOGERROR, "EGL failed to populate configuration list"); + return false; + } + + // Select an EGL configuration that matches the native window + m_config = configList[0]; + + EGLint* attribList = NULL; + +#ifdef EMPOWER + EGLint windowAttrs[3]; + int windowIndex = 0; + windowAttrs[windowIndex++] = EGL_RENDER_BUFFER; + windowAttrs[windowIndex++] = EGL_BACK_BUFFER; + windowAttrs[windowIndex++] = EGL_NONE; + attribList = windowAttrs; +#endif + +#ifdef HAS_OPENKODE + //CLog::Log(LOGDEBUG, "KD: kdCreateWindow"); + m_kdWindow = kdCreateWindow(m_display, m_config, KD_NULL); + if (!m_kdWindow) + { + CLog::Log(LOGERROR, "Error creating native window"); + return false; + } + + //CLog::Log(LOGDEBUG, "KD: kdRealizeWindow"); + if (kdRealizeWindow(m_kdWindow, &m_nativeWindow)) + { + CLog::Log(LOGERROR, "Could not realize native window"); + return false; + } + +#elif defined HAS_X11 + int screen = DefaultScreen(m_x11Display); + + XSetWindowAttributes windowAttributes; + windowAttributes.colormap = DefaultColormap(m_x11Display, screen); + windowAttributes.border_pixel = 0; + windowAttributes.event_mask = ExposureMask | + VisibilityChangeMask | + KeyPressMask | + KeyReleaseMask | + ButtonPressMask | + ButtonReleaseMask | + PointerMotionMask | + StructureNotifyMask | + SubstructureNotifyMask | + FocusChangeMask; + + m_nativeWindow = (NativeWindowType) XCreateWindow( m_x11Display, + RootWindow(m_x11Display, screen), + 0, 0, // x/y position of top-left outside corner of the window + res.iWidth, res.iHeight, // Width and height of window + 0, // Border width + DefaultDepth(m_x11Display, screen), + InputOutput, + DefaultVisual(m_x11Display, screen), + CWBorderPixel | CWColormap | CWEventMask, + &windowAttributes ); + + XSetStandardProperties(m_x11Display, (Window) m_nativeWindow, name, name, None, NULL, 0, NULL); + + Atom wmDeleteMessage = XInternAtom(m_x11Display, "WM_DELETE_WINDOW", False); + XSetWMProtocols(m_x11Display, (Window) m_nativeWindow, &wmDeleteMessage, 1); + + if (fullScreen && !SetFullScreen(fullScreen, res, false)) + { + return false; + } + + XMapRaised(m_x11Display, (Window) m_nativeWindow); +#endif + +#ifdef _WIN32 + m_nativeWindow = m_hWnd; + + DEVMODE dm; + ZeroMemory(&dm, sizeof(dm)); + dm.dmSize = sizeof(dm); + EnumDisplaySettingsEx(NULL, ENUM_CURRENT_SETTINGS, &dm, 0); + + m_nLeft = (dm.dmPelsWidth / 2) - (m_nWidth / 2); + m_nTop = (dm.dmPelsHeight / 2) - (m_nHeight / 2); + + RECT rc; + rc.left = m_nLeft; + rc.top = m_nTop; + rc.right = rc.left + m_nWidth; + rc.bottom = rc.top + m_nHeight; + AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, false ); + SetWindowPos(m_hWnd, 0, rc.left, rc.top, 0, 0, SWP_NOSIZE); +#endif + +#if defined(HAS_GDL) + m_nativeWindow = (NativeWindowType)GDL_GRAPHICS_PLANE; +#endif + + m_surface = eglCreateWindowSurface(m_display, m_config, m_nativeWindow, attribList); + if (!m_surface) + { + CLog::Log(LOGERROR, "EGL couldn't create window"); + return false; + } + +#ifdef CANMORE + eglStatus = eglBindAPI(EGL_OPENGL_ES_API); + if (!eglStatus) + { + CLog::Log(LOGERROR, "EGL failed to bind API"); + return false; + } +#endif + + EGLint contextAttrs[] = + { + EGL_CONTEXT_CLIENT_VERSION, 2, + EGL_NONE + }; + + // Create an EGL context + //CLog::Log(LOGDEBUG, "eglCreateContext"); + m_context = eglCreateContext(m_display, m_config, NULL, contextAttrs); + if (!m_context) + { + CLog::Log(LOGERROR, "EGL couldn't create context"); + return false; + } + + // Make the context and surface current for rendering + eglStatus = eglMakeCurrent(m_display, m_surface, m_surface, m_context); + if (!eglStatus) + { + CLog::Log(LOGERROR, "EGL couldn't make context/surface current"); + return false; + } + + free(configList); + + eglSwapInterval(m_display, 0); + + m_bWindowCreated = true; + + CLog::Log(LOGINFO, "Window creation complete"); + return true; +} + +bool CWinSystemEGL::DestroyWindow() +{ + EGLBoolean eglStatus; + if (m_context != EGL_NO_CONTEXT) + { + eglStatus = eglDestroyContext(m_display, m_context); + if (!eglStatus) + CLog::Log(LOGERROR, "Error destroying EGL context"); + m_context = EGL_NO_CONTEXT; + } + + if (m_surface != EGL_NO_SURFACE) + { + eglStatus = eglDestroySurface(m_display, m_surface); + if (!eglStatus) + CLog::Log(LOGERROR, "Error destroying EGL surface"); + m_surface = EGL_NO_SURFACE; + } + + if (m_display != EGL_NO_DISPLAY) + { + eglStatus = eglTerminate(m_display); + if (!eglStatus) + CLog::Log(LOGERROR, "Error terminating EGL"); + m_display = EGL_NO_DISPLAY; + } + +#ifdef HAS_OPENKODE + if (m_kdWindow) + { + if (kdDestroyWindow(m_kdWindow)) + CLog::Log(LOGERROR, "Error destroying native window"); + + m_kdWindow = KD_NULL; + m_nativeWindow = (NativeWindowType)0; + } + + // Release display + if (m_kdDisplay) + { + if (kdReleaseDisplayNV(m_kdDisplay)) + CLog::Log(LOGERROR, "Error destroying native display"); + m_kdDisplay = KD_NULL; + } +#endif + + return true; +} + +bool CWinSystemEGL::ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop) +{ + if (m_nWidth == newWidth && m_nHeight == newHeight) return true; + + m_nWidth = newWidth; + m_nHeight = newHeight; + +#ifdef HAS_X11 + XResizeWindow(m_x11Display, (Window) m_nativeWindow, m_nWidth, m_nHeight); +#endif + + return true; +} + +bool CWinSystemEGL::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) +{ + m_nWidth = res.iWidth; + m_nHeight = res.iHeight; + m_bFullScreen = fullScreen; + +#if defined(HAS_XRANDR) + if(m_bFullScreen) + { + XOutput out; + XMode mode; + out.name = res.strOutput; + mode.w = res.iWidth; + mode.h = res.iHeight; + mode.hz = res.fRefreshRate; + mode.id = res.strId; + g_xrandr.SetMode(out, mode); + } + else + g_xrandr.RestoreState(); +#endif + +#ifdef HAS_X11 + XClientMessageEvent xMessage; + xMessage.type = ClientMessage; + xMessage.serial = 0; + xMessage.send_event = True; + xMessage.window = (Window) m_nativeWindow; + xMessage.message_type = XInternAtom(m_x11Display, "_NET_WM_STATE", True); + xMessage.format = 32; + xMessage.data.l[0] = (fullScreen ? 1 : 0); + xMessage.data.l[1] = XInternAtom(m_x11Display, "_NET_WM_STATE_FULLSCREEN", True); + xMessage.data.l[2] = 0; + + XSendEvent(m_x11Display, DefaultRootWindow(m_x11Display), False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent*)&xMessage); +#endif + return true; +} + +// TODO: Fix me +void CWinSystemEGL::UpdateResolutions() +{ + CWinSystemBase::UpdateResolutions(); + + // Add desktop resolution +#ifdef _WIN32 + DEVMODE dm; + ZeroMemory(&dm, sizeof(dm)); + dm.dmSize = sizeof(dm); + EnumDisplaySettingsEx(NULL, ENUM_CURRENT_SETTINGS, &dm, 0); + + UpdateDesktopResolution(g_settings.m_ResInfo[RES_DESKTOP], 0, dm.dmPelsWidth, dm.dmPelsHeight, 60); +#else + UpdateDesktopResolution(g_settings.m_ResInfo[RES_DESKTOP], 0, 1920, 1080, 60); +#endif + +} + +#endif diff --git a/xbmc/WinSystemEGL.h b/xbmc/WinSystemEGL.h new file mode 100644 index 00000000..d1de293f --- /dev/null +++ b/xbmc/WinSystemEGL.h @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#ifndef WINDOW_SYSTEM_EGL_H +#define WINDOW_SYSTEM_EGL_H + +#include +#ifndef _WIN32 +#include +#include "WinSystem.h" +#define EGL_BASE_CLASS CWinSystemBase +#else +#include "WinSystemWin32.h" +#define EGL_BASE_CLASS CWinSystemWin32 +#endif + +#if defined(EMPOWER) && defined(HAS_OPENKODE) +struct KDWindow; +struct KDDesktopNV; +struct KDDisplayNV; +#endif + +#ifdef HAS_X11 +#include +#endif + +#if defined(HAS_GDL) +#include +#endif + +class CWinSystemEGL : public EGL_BASE_CLASS +{ +public: + CWinSystemEGL(); + virtual ~CWinSystemEGL(); + + // CWinSystemBase + virtual bool InitWindowSystem(); + virtual bool DestroyWindowSystem(); + virtual bool CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction); + virtual bool DestroyWindow(); + virtual bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop); + virtual bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays); + virtual void UpdateResolutions(); + +#ifdef HAS_X11 + Display* GetDisplay() { return m_x11Display; } +#endif + EGLDisplay GetEGLDisplay() { return m_display; } + +protected: + NativeWindowType m_nativeWindow; + EGLDisplay m_display; + EGLSurface m_surface; + EGLConfig m_config; + EGLContext m_context; + EGLint buffering; +#if defined(EMPOWER) && defined(HAS_OPENKODE) + KDWindow* m_kdWindow; + KDDesktopNV* m_kdDesktop; + KDDisplayNV* m_kdDisplay; +#endif +#if defined(HAS_X11) + Display* m_x11Display; +#endif +}; + +#endif // WINDOW_SYSTEM_H + diff --git a/xbmc/WinSystemEGLGLES.cpp b/xbmc/WinSystemEGLGLES.cpp new file mode 100644 index 00000000..e13160b2 --- /dev/null +++ b/xbmc/WinSystemEGLGLES.cpp @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +#include "system.h" + +#if defined(HAS_EGL) && defined(HAS_GLES) + +#if defined(_WIN32) +#pragma comment (lib,"libEGL.lib") +#pragma comment (lib,"libGLESv2.lib") +#endif + +#include "WinSystemEGLGLES.h" + +CWinSystemEGLGLES g_Windowing; + +CWinSystemEGLGLES::CWinSystemEGLGLES() +{ +} + +CWinSystemEGLGLES::~CWinSystemEGLGLES() +{ +} + +bool CWinSystemEGLGLES::PresentRenderImpl() +{ + eglSwapBuffers(m_display, m_surface); + return true; +} + +void CWinSystemEGLGLES::SetVSyncImpl(bool enable) +{ + eglSwapInterval(m_display, 0); +} + +bool CWinSystemEGLGLES::ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop) +{ + CWinSystemEGL::ResizeWindow(newWidth, newHeight, newLeft, newTop); + CRenderSystemGLES::ResetRenderSystem(newWidth, newHeight, true, 0); + + return true; +} + +bool CWinSystemEGLGLES::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) +{ + CWinSystemEGL::SetFullScreen(fullScreen, res, blankOtherDisplays); + CRenderSystemGLES::ResetRenderSystem(res.iWidth, res.iHeight, true, 0); + + return true; +} + +#endif diff --git a/xbmc/WinSystemEGLGLES.h b/xbmc/WinSystemEGLGLES.h new file mode 100755 index 00000000..6df66777 --- /dev/null +++ b/xbmc/WinSystemEGLGLES.h @@ -0,0 +1,42 @@ +#ifndef WINDOW_SYSTEM_EGL_GLES_H +#define WINDOW_SYSTEM_EGL_GLES_H + +#pragma once + +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +#include "WinSystemEGL.h" +#include "RenderSystemGLES.h" + +class CWinSystemEGLGLES : public CWinSystemEGL, public CRenderSystemGLES +{ +public: + CWinSystemEGLGLES(); + virtual ~CWinSystemEGLGLES(); + virtual bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop); + virtual bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays); + +protected: + virtual bool PresentRenderImpl(); + virtual void SetVSyncImpl(bool enable); +}; + +#endif // WINDOW_SYSTEM_EGL_GLES_H diff --git a/xbmc/WinSystemGDL.cpp b/xbmc/WinSystemGDL.cpp new file mode 100644 index 00000000..89a96ffd --- /dev/null +++ b/xbmc/WinSystemGDL.cpp @@ -0,0 +1,1145 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "system.h" + +#ifdef HAS_GDL + +#define DEFAULT_OVERSCAN 0.03f + +#include "WinSystemGDL.h" +#include "log.h" +#include "Settings.h" +#include "IntelSMDGlobals.h" +#include "GraphicContext.h" +#include "GUISettings.h" +#include "cores/AudioRenderers/IntelSMDAudioRenderer.h" + + +#ifdef HAS_BOXEE_HAL +#include "HalServices.h" +#include "HalListenerImpl.h" +#endif + + +//------------------------------------------------------------------------------ +// __yes_no() +//------------------------------------------------------------------------------ +static void __yes_no(const char * s, gdl_boolean_t cond) +{ + CLog::Log(LOGINFO, "%s %s\n", s, cond ? "yes" : "no"); +} + +static gdl_boolean_t __sample_size_available(gdl_hdmi_audio_fmt_t fmt) +{ + return (gdl_boolean_t)(fmt == GDL_HDMI_AUDIO_FORMAT_PCM); +} + +static gdl_boolean_t __bitrate_available(gdl_hdmi_audio_fmt_t fmt) +{ + return (gdl_boolean_t)(fmt >= GDL_HDMI_AUDIO_FORMAT_AC3 && fmt <= GDL_HDMI_AUDIO_FORMAT_ATRAC); +} + +//------------------------------------------------------------------------------ +// query_generic_info() +//------------------------------------------------------------------------------ +void query_generic_info(gdl_pd_id_t port) +{ + gdl_pd_recv_t cmd = GDL_PD_RECV_HDMI_SINK_INFO; + gdl_hdmi_sink_info_t si; + int i, map; + + if (gdl_port_recv(port, cmd, &si, sizeof(si)) == GDL_SUCCESS) + { + CLog::Log(LOGINFO, " - Manufacturer ID : 0x%.4x\n", si.manufac_id ); + CLog::Log(LOGINFO, " - Product code : 0x%.4x\n", si.product_code); + + __yes_no(" - HDMI :", si.hdmi ); + __yes_no(" - YCbCr444 :", si.ycbcr444 ); + __yes_no(" - YCbCr422 :", si.ycbcr422 ); + __yes_no(" - 30 bit color :", si.dc_30 ); + __yes_no(" - 36 bit color :", si.dc_36 ); + __yes_no(" - YCbCr444 in deep color :", si.dc_y444 ); + __yes_no(" - xvycc601 colorimetry :", si.xvycc601 ); + __yes_no(" - xvycc709 colorimetry :", si.xvycc709 ); + __yes_no(" - Supports AI :", si.supports_ai); + + CLog::Log(LOGINFO, " - Max TMDS clock : %d\n", si.max_tmds_clock); + + __yes_no(" - Latency valid :", si.latency_present); + __yes_no(" - Latency int valid :", si.latency_int_present); + if(si.latency_present) + { + CLog::Log(LOGINFO, " - Video latency : %d\n", si.latency_video); + CLog::Log(LOGINFO, " - Audio latency : %d\n", si.latency_audio); + } + if(si.latency_int_present) + { + CLog::Log(LOGINFO, " - Video latency int : %d\n", si.latency_video_interlaced); + CLog::Log(LOGINFO, " - Audio latency int : %d\n", si.latency_audio_interlaced); + } + if(si.hdmi_video_present) + { + __yes_no(" - hdmi_video :", si.hdmi_video_present); + __yes_no(" - hdmi_video 3D :", si.enabled_3d); + CLog::Log(LOGINFO, " - Number of 3D modes : %d\n", si.num_modes_3d); + } + + CLog::Log(LOGINFO, " - Source Physical Address: %d.%d.%d.%d\n", + si.spa.a, si.spa.b, si.spa.c, si.spa.d ); + + CLog::Log(LOGINFO, " - Speaker map :"); + map = si.speaker_map; + for (i = 0; i < 11; i++) + { + //printf(" %s", (map & (1<= 79 + di.tvmode.stereo_type = GDL_STEREO_NONE; +#endif + + // Set the video output format according to HAL + int videoOutput = RES_NTSC_4x3; + +#ifdef HAS_BOXEE_HAL + CHalSoftwareInfo softwareInfo; + CHalServicesFactory::GetInstance().GetSoftwareInfo(softwareInfo); + if(softwareInfo.compositeVideo.compare("PAL") == 0) + videoOutput = RES_PAL_4x3; + else if(softwareInfo.compositeVideo.compare("NTSC") == 0) + videoOutput = RES_NTSC_4x3; +#endif + + switch (videoOutput) + { + case RES_PAL_4x3: + di.tvmode.width = 720; + di.tvmode.height = 576; + di.tvmode.refresh = GDL_REFRESH_50; + break; + case RES_NTSC_4x3: + di.tvmode.width = 720; + di.tvmode.height = 480; + di.tvmode.refresh = GDL_REFRESH_59_94; + break; + } + g_IntelSMDGlobals.DisableAudioOutput(g_IntelSMDGlobals.GetHDMIOutput()); + rc = gdl_set_display_info(&di); + g_IntelSMDGlobals.EnableAudioOutput(g_IntelSMDGlobals.GetHDMIOutput()); + + if(rc != GDL_SUCCESS) + { + CLog::Log(LOGINFO, "Could not set display mode for display 1"); + } + + if(!ConfigureHDMIOutput()) + { + CLog::Log(LOGERROR, "WinSystemGDL ConfigureHDMIOutput failed"); + return false; + } + + m_nWidth = res.iWidth; + m_nHeight = res.iHeight; + m_bFullScreen = fullScreen; + + dstRect.origin.x = 0; + dstRect.origin.y = 0; + dstRect.width = res.iWidth; + dstRect.height = res.iHeight; + + srcRect.origin.x = 0; + srcRect.origin.y = 0; + srcRect.width = res.iWidth; + srcRect.height = res.iHeight; + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_config_begin(m_gdlPlane); + } + + rc = gdl_plane_reset(m_gdlPlane); + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_config_begin(m_gdlPlane); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_set_attr(GDL_PLANE_SRC_COLOR_SPACE, &colorSpace); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_set_attr(GDL_PLANE_PIXEL_FORMAT, &pixelFormat); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_set_attr(GDL_PLANE_DST_RECT, &dstRect); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_set_attr(GDL_PLANE_SRC_RECT, &srcRect); + } + + if(GDL_SUCCESS == rc) + { + gdl_boolean_t scalineEnabled = GDL_FALSE; + rc = gdl_plane_set_attr(GDL_PLANE_SCALE, &scalineEnabled); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_config_end(GDL_FALSE); + } + else + { + gdl_plane_config_end(GDL_TRUE); + } + + if (GDL_SUCCESS != rc) + { + CLog::Log(LOGINFO, "GDL configuration failed! GDL error code is 0x%x\n", rc); + return false; + } + + CLog::Log(LOGINFO, "GDL plane setup complete"); + + if (!m_eglBinding.CreateWindow(EGL_DEFAULT_DISPLAY, (NativeWindowType) m_gdlPlane)) + { + return false; + } + + + gdl_flip(GDL_PLANE_ID_UPP_A, GDL_SURFACE_INVALID, GDL_FLIP_ASYNC); + gdl_flip(GDL_PLANE_ID_UPP_B, GDL_SURFACE_INVALID, GDL_FLIP_ASYNC); + gdl_flip(GDL_PLANE_ID_UPP_C, GDL_SURFACE_INVALID, GDL_FLIP_ASYNC); + gdl_flip(GDL_PLANE_ID_UPP_D, GDL_SURFACE_INVALID, GDL_FLIP_ASYNC); + + CLog::Log(LOGINFO, "GDL plane attach to EGL complete"); + + g_graphicsContext.UpdateGraphicsRects(); + + return true; +} + +bool CWinSystemGDL::DestroyWindow() +{ + if (!m_eglBinding.DestroyWindow()) + { + return false; + } + + return true; +} + +bool CWinSystemGDL::ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop) +{ + return true; +} + +bool CWinSystemGDL::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) +{ + // check if we're trying to create the same window +#ifdef HAS_EMBEDDED + if (m_Res == res) + { + CLog::Log(LOGINFO, "CWinSystemGDL::SetFullScreen same window, ignoring request.\n"); + return true; + } +#endif + + m_nWidth = res.iWidth; + m_nHeight = res.iHeight; + m_bFullScreen = fullScreen; + + m_eglBinding.ReleaseSurface(); + CreateNewWindow("", fullScreen, res, NULL); + + return true; +} + +bool CWinSystemGDL::EnableHDMIClamp(bool bEnable) +{ + gdl_boolean_t hdmiClamp = bEnable ? GDL_TRUE : GDL_FALSE; + + if(gdl_port_set_attr(GDL_PD_ID_HDMI, GDL_PD_ATTR_ID_OUTPUT_CLAMP, &hdmiClamp) != GDL_SUCCESS) + { + CLog::Log(LOGERROR, "Could not set gdl output clamp"); + return false; + } + + gdl_pd_attribute_t test; + gdl_port_get_attr(GDL_PD_ID_HDMI, GDL_PD_ATTR_ID_OUTPUT_CLAMP, &test); + + if(test.content._bool.value == GDL_TRUE) + CLog::Log(LOGINFO, "HDMI Clamp enabled\n"); + else + CLog::Log(LOGINFO, "HDMI Clamp disabled\n"); + + return true; +} + +bool CWinSystemGDL::ConfigureHDMIOutput() +{ + g_IntelSMDGlobals.DisableAudioOutput(g_IntelSMDGlobals.GetHDMIOutput()); + + gdl_display_info_t di; + gdl_pd_output_pixel_format_t pixelformat = GDL_PD_OPF_RGB444; + gdl_color_space_t color_space = GDL_COLOR_SPACE_RGB; + gdl_gamma_t gamma = GDL_GAMMA_LINEAR; + gdl_refresh_t refresh = GDL_REFRESH_59_94; + gdl_pd_output_pixel_depth_t pixel_depth = GDL_PD_OPD_24BIT; + gdl_boolean_t hdcpControlEnabled = GDL_FALSE; + int use_edid = false; + + memset(&di, 0, sizeof (gdl_display_info_t)); + + HDMIOutputType hdmi_output = (HDMIOutputType)g_guiSettings.GetInt("videoscreen.hdmioutput"); + HDMIPixelDepth hdmi_pixel_depth = (HDMIPixelDepth)g_guiSettings.GetInt("videoscreen.hdmipixeldepth"); + use_edid = g_guiSettings.GetBool("videoscreen.forceedid"); + + CLog::Log(LOGINFO, "CWinSystemGDL::ConfigureHDMIOutput use_edid %d\n", use_edid); + + if (m_Res.fRefreshRate < 23.99f && m_Res.fRefreshRate > 23.97) + refresh = GDL_REFRESH_23_98; + else if (m_Res.fRefreshRate < 24.01f && m_Res.fRefreshRate > 23.99) + refresh = GDL_REFRESH_24; + else if (m_Res.fRefreshRate < 25.01f && m_Res.fRefreshRate > 24.99) + refresh = GDL_REFRESH_25; + else if (m_Res.fRefreshRate < 29.98f && m_Res.fRefreshRate > 29.96) + refresh = GDL_REFRESH_29_97; + else if (m_Res.fRefreshRate < 30.01f && m_Res.fRefreshRate > 29.99) + refresh = GDL_REFRESH_30; + else if (m_Res.fRefreshRate < 50.01f && m_Res.fRefreshRate > 49.99) + refresh = GDL_REFRESH_50; + else if (m_Res.fRefreshRate < 59.95f && m_Res.fRefreshRate > 59.93) + refresh = GDL_REFRESH_59_94; + else if (m_Res.fRefreshRate < 60.01f && m_Res.fRefreshRate > 59.99) + refresh = GDL_REFRESH_60; + else if (m_Res.fRefreshRate < 48.01f && m_Res.fRefreshRate > 47.99) + refresh = GDL_REFRESH_48; + else if (m_Res.fRefreshRate < 47.97f && m_Res.fRefreshRate > 47.95) + refresh = GDL_REFRESH_47_96; + else + { + CLog::Log(LOGERROR, "Unsupported refresh rate: %f. Using 59_94 instead", m_Res.fRefreshRate); + refresh = GDL_REFRESH_59_94; + } + + switch (hdmi_output) + { + case HDMI_OUTPUT_RGB_HI: + case HDMI_OUTPUT_RGB_LOW: + pixelformat = GDL_PD_OPF_RGB444; + color_space = GDL_COLOR_SPACE_RGB; + break; + case HDMI_OUTPUT_YUV_422: + pixelformat = GDL_PD_OPF_YUV422; + color_space = GDL_COLOR_SPACE_BT709; + break; + case HDMI_OUTPUT_YUV_444: + pixelformat = GDL_PD_OPF_YUV444; + color_space = GDL_COLOR_SPACE_BT709; + break; + case HDMI_OUTPUT_COUNT: + // unhandled? + break; + } + + switch (hdmi_pixel_depth) + { + case HDMI_PIXEL_DEPTH_24: + pixel_depth = GDL_PD_OPD_24BIT; + break; + case HDMI_PIXEL_DEPTH_30: + pixel_depth = GDL_PD_OPD_30BIT; + break; + case HDMI_PIXEL_DEPTH_36: + pixel_depth = GDL_PD_OPD_36BIT; + break; + case HDMI_PIXEL_DEPTH_COUNT: + // unhandled? + break; + } + + + // set display info + di.id = GDL_DISPLAY_ID_0; // hdmi + di.flags = 0; + di.bg_color = 0; + di.color_space = color_space; + di.gamma = gamma; + di.tvmode.width = m_Res.iWidth; + di.tvmode.height = m_Res.iHeight; + di.tvmode.refresh = refresh; + di.tvmode.interlaced = (m_Res.dwFlags & D3DPRESENTFLAG_INTERLACED ? GDL_TRUE + : GDL_FALSE); +#if GDL_HEADER_VERSION_MAJOR >= 79 + di.tvmode.stereo_type = GDL_STEREO_NONE; +#endif + + // if we got any bad parameter, reset to 720p60 + if(di.tvmode.width == 0 || di.tvmode.height == 0) + { + di.tvmode.width = 1280; + di.tvmode.height = 720; + } + + if (gdl_set_display_info(&di) != GDL_SUCCESS) + { + CLog::Log(LOGINFO, "Could not set display mode for display 0"); + goto fail; + } + + query_generic_info(GDL_PD_ID_HDMI); + query_hdcp_info(GDL_PD_ID_HDMI); + + if (gdl_port_set_attr(GDL_PD_ID_HDMI, GDL_PD_ATTR_ID_HDCP, &hdcpControlEnabled) != GDL_SUCCESS) + { + CLog::Log(LOGINFO, "Could not enable HDCP control"); + } + + if (gdl_port_set_attr(GDL_PD_ID_HDMI, GDL_PD_ATTR_ID_USE_EDID, &use_edid) != GDL_SUCCESS) + { + CLog::Log(LOGINFO, "Could not enable EDID control"); + } + + // pixel format + if (gdl_port_set_attr(GDL_PD_ID_HDMI, GDL_PD_ATTR_ID_PIXEL_FORMAT_OUTPUT, &pixelformat) == GDL_SUCCESS) + { + CLog::Log(LOGINFO, "CWinSystemGDL::SetHDMIOutput setting GDL_PD_ATTR_ID_PIXEL_FORMAT_OUTPUT %d", pixelformat); + } + else + CLog::Log(LOGINFO, "CWinSystemGDL::SetHDMIOutput setting GDL_PD_ATTR_ID_PIXEL_FORMAT_OUTPUT failed"); + + gdl_pd_attribute_t test; + if (gdl_port_get_attr(GDL_PD_ID_HDMI, GDL_PD_ATTR_ID_PIXEL_FORMAT_OUTPUT, &test) == GDL_SUCCESS) + { + CLog::Log(LOGINFO, "CWinSystemGDL::SetHDMIOutput reading GDL_PD_ATTR_ID_PIXEL_FORMAT_OUTPUT %d", test.content._uint.value); + } + else + CLog::Log(LOGINFO, "CWinSystemGDL::SetHDMIOutput reading GDL_PD_ATTR_ID_PIXEL_FORMAT_OUTPUT failed"); + + + + // pixel depth + if (gdl_port_set_attr(GDL_PD_ID_HDMI, GDL_PD_ATTR_ID_PIXEL_DEPTH, &pixel_depth) == GDL_SUCCESS) + { + CLog::Log(LOGINFO, "CWinSystemGDL::SetHDMIOutput setting GDL_PD_ATTR_ID_PIXEL_DEPTH %d", pixel_depth); + } + else + CLog::Log(LOGINFO, "CWinSystemGDL::SetHDMIOutput setting GDL_PD_ATTR_ID_PIXEL_DEPTH failed"); + + if (gdl_port_get_attr(GDL_PD_ID_HDMI, GDL_PD_ATTR_ID_PIXEL_DEPTH, &test) == GDL_SUCCESS) + { + CLog::Log(LOGINFO, "CWinSystemGDL::SetHDMIOutput reading GDL_PD_ATTR_ID_PIXEL_DEPTH %d\n", test.content._uint.value); + } + else + CLog::Log(LOGINFO, "CWinSystemGDL::SetHDMIOutput reading GDL_PD_ATTR_ID_PIXEL_DEPTH failed"); + + + if(hdmi_output == HDMI_OUTPUT_RGB_HI) + EnableHDMIClamp(false); + else if(hdmi_output == HDMI_OUTPUT_RGB_LOW) + EnableHDMIClamp(true); + + g_IntelSMDGlobals.EnableAudioOutput(g_IntelSMDGlobals.GetHDMIOutput()); + + return true; + + fail: + g_IntelSMDGlobals.EnableAudioOutput(g_IntelSMDGlobals.GetHDMIOutput()); + return false; +} + +bool CWinSystemGDL::EnableHardwareScaler(bool bEnable, CRect srcRect, CRect dstRect, gdl_plane_id_t plane) +{ + gdl_ret_t rc; + gdl_boolean_t scaleEnabled; + gdl_rectangle_t rect; + + //printf("CWinSystemGDL::EnableHardwareScaler plane %d set to %d\n", plane, bEnable); + + if(g_graphicsContext.GetHeight() <= 720 && bEnable) + { + /* + printf("CWinSystemGDL::EnableHardwareScaler: screen height %d <= 720. Ignoring\n", + g_graphicsContext.GetHeight()); + */ + return true; + } + + if(srcRect.Width() > 1280 && bEnable) + { + //printf("CWinSystemGDL::EnableHardwareScaler: src width %d > 1280. Ignoring\n", srcRect.Width()); + return true; + } + + /* + printf("CWinSystemGDL::EnableHardwareScaler src %.0f %.0f %.0f %.0f dst %.0f %.0f %.0f %.0f\n", + srcRect.x1, srcRect.y1, srcRect.x2, srcRect.y2, + dstRect.x1, dstRect.y1, dstRect.x2, dstRect.y2); + */ + + if (bEnable) + { + // reset any leftovers from plance C which is used for the browser + gdl_rectangle_t rect; + gdl_boolean_t scale = GDL_FALSE; + rect.origin.x = rect.origin.y = 0; + rect.width=1280; + rect.height=720; + gdl_plane_config_begin(GDL_PLANE_ID_UPP_C); + gdl_plane_set_attr(GDL_PLANE_SCALE, &scale); + gdl_plane_set_rect(GDL_PLANE_DST_RECT, &rect); + gdl_plane_set_rect(GDL_PLANE_SRC_RECT, &rect); + gdl_plane_config_end(GDL_FALSE); + } + + rc = gdl_plane_config_begin(plane); + + rect.origin.x = (gdl_int32)srcRect.x1; + rect.origin.y = (gdl_int32)srcRect.y1; + rect.width = (gdl_int32)(srcRect.x2 - srcRect.x1); + rect.height = (gdl_int32)(srcRect.y2 - srcRect.y1); + + if (GDL_SUCCESS == rc) + rc = gdl_plane_set_attr(GDL_PLANE_SRC_RECT, &rect); + + + rect.origin.x = (gdl_int32)dstRect.x1; + rect.origin.y = (gdl_int32)dstRect.y1; + rect.width = (gdl_int32)(dstRect.x2 - dstRect.x1); + rect.height = (gdl_int32)(dstRect.y2 - dstRect.y1); + + if(GDL_SUCCESS == rc) + rc = gdl_plane_set_attr(GDL_PLANE_DST_RECT, &rect); + + if(GDL_SUCCESS == rc) + { + scaleEnabled = (gdl_boolean_t)bEnable; + rc = gdl_plane_set_attr(GDL_PLANE_SCALE, &scaleEnabled); + } + + if (GDL_SUCCESS == rc) + gdl_plane_config_end(GDL_FALSE); + else + gdl_plane_config_end(GDL_TRUE); + + if (GDL_SUCCESS != rc) + { + CLog::Log(LOGERROR, "CWinSystemGDL::EnableHardwareScaler failed. GDL error code is 0x%x\n", rc); + return false; + } + + return true; +} + +bool CWinSystemGDL::IsHardwareScalerEnabled(gdl_plane_id_t plane) +{ + gdl_ret_t rc; + gdl_boolean_t scaleEnabled = GDL_FALSE; + + rc = gdl_plane_get_attr(plane, GDL_PLANE_SCALE, &scaleEnabled); + if(rc != GDL_SUCCESS) + { + CLog::Log(LOGERROR, "CWinSystemGDL::IsHardwareScalerEnabled failed. GDL error code is 0x%x\n", rc); + return false; + } + + //printf("CWinSystemGDL::IsHardwareScalerEnabled %d\n", (bool)scalineEnabled); + + return (bool)scaleEnabled; +} + +bool CWinSystemGDL::GetPlaneRect(gdl_plane_id_t plane, CRect& myRect, gdl_plane_attr_t attrib) +{ + gdl_ret_t rc; + gdl_rectangle_t rect; + + if(attrib != GDL_PLANE_DST_RECT && attrib != GDL_PLANE_SRC_RECT) + return false; + + rc = gdl_plane_get_attr(plane, attrib, &rect); + if(rc != GDL_SUCCESS) + { + CLog::Log(LOGERROR, "CWinSystemGDL::GetPlaneDstRect failed. GDL error code is 0x%x\n", rc); + return false; + } + + myRect.x1 = (float)(rect.origin.x); + myRect.y1 = (float)(rect.origin.y); + myRect.x2 = (float)(rect.origin.x + rect.width); + myRect.y2 = (float)(rect.origin.y + rect.height); + + return true; +} + +void CWinSystemGDL::UpdateResolutions() +{ + gdl_display_id_t display_id = GDL_DISPLAY_ID_0; + gdl_pd_id_t pd_id = GDL_PD_MIN_SUPPORTED_DRIVERS; + gdl_pd_attribute_t attr; + gdl_ret_t rc; + gdl_tvmode_t m; + int i = 0; + RESOLUTION boxeeResolution = RES_DESKTOP; + RESOLUTION Res720p = RES_INVALID; + + CLog::Log(LOGINFO, "Display <%d> supports the following modes:", display_id); + + // Traverse through all ports + while (pd_id < GDL_PD_MAX_SUPPORTED_DRIVERS) + { + // Find any port on given display + rc = gdl_port_get_attr(pd_id, GDL_PD_ATTR_ID_DISPLAY_PIPE, &attr); + if ((rc == GDL_SUCCESS) && (attr.content._uint.value == (gdl_uint32) display_id)) + { + // Get modes supported by given port, 1 by 1 + while (gdl_get_port_tvmode_by_index(pd_id, i++, &m) == GDL_SUCCESS) + { + bool ignored = true; + + // Check if given mode is supported on given display + if (gdl_check_tvmode(display_id, &m) == GDL_SUCCESS) + { + // We only care about 23.98, 59.94 or 50 Hz resolutions + if (m.refresh == GDL_REFRESH_23_98 || m.refresh == GDL_REFRESH_59_94 || + m.refresh == GDL_REFRESH_50) + { + ignored = false; + } + + /* + if(m.refresh == GDL_REFRESH_24) + { + m_bSupportTrue24p = true; + printf("Device supports True 24p\n"); + } + */ + + CLog::Log(LOGINFO, "Resolution: %dx%d%c%s - %s\n", + m.width, + m.height, + m.interlaced ? 'i' : 'p', + gdl_dbg_string_refresh(m.refresh), + (ignored ? "ignored" : "added")); + + if (ignored) + continue; + + float refresh; + switch (m.refresh) + { + case GDL_REFRESH_23_98: refresh = 23.98; break; + case GDL_REFRESH_24: refresh = 24.00; break; + case GDL_REFRESH_25: refresh = 25.00; break; + case GDL_REFRESH_29_97: refresh = 29.97; break; + case GDL_REFRESH_30: refresh = 30.00; break; + case GDL_REFRESH_50: refresh = 50.00; break; + case GDL_REFRESH_59_94: refresh = 59.94; break; + case GDL_REFRESH_60: refresh = 60.00; break; + case GDL_REFRESH_48: refresh = 48.00; break; + case GDL_REFRESH_47_96: refresh = 47.96; break; + default: refresh = 0.0; break; + } + + if (g_settings.m_ResInfo.size() <= (unsigned int) boxeeResolution) + { + RESOLUTION_INFO res; + g_settings.m_ResInfo.push_back(res); + } + + UpdateDesktopResolution(g_settings.m_ResInfo[boxeeResolution], 0, m.width, m.height, refresh, m.interlaced); + + // Update default overscan + if (DEFAULT_OVERSCAN > 0) + { + g_settings.m_ResInfo[boxeeResolution].Overscan.left = (int) ((float) m.width * DEFAULT_OVERSCAN); + g_settings.m_ResInfo[boxeeResolution].Overscan.top = (int) ((float) m.height * DEFAULT_OVERSCAN); + g_settings.m_ResInfo[boxeeResolution].Overscan.right = m.width - (int) ((float) m.width * DEFAULT_OVERSCAN); + g_settings.m_ResInfo[boxeeResolution].Overscan.bottom = m.height - (int) ((float) m.height * DEFAULT_OVERSCAN); + } + + if(m.width == 1280 && m.height == 720 && !m.interlaced && m.refresh == GDL_REFRESH_59_94) + Res720p = boxeeResolution; + + boxeeResolution = (RESOLUTION) (((int) boxeeResolution) + 1); + } + } + + // We are done + break; + } + + pd_id = (gdl_pd_id_t) (((int) pd_id) + 1); + } + + // swap desktop for 720p if available + if(Res720p != RES_INVALID) + { + CLog::Log(LOGINFO, "Found 720p at %d, setting to desktop", (int)Res720p); + + RESOLUTION_INFO desktop = g_settings.m_ResInfo[RES_DESKTOP]; + g_settings.m_ResInfo[RES_DESKTOP] = g_settings.m_ResInfo[Res720p]; + g_settings.m_ResInfo[Res720p] = desktop; + } + else + { + CLog::Log(LOGINFO, "Warning: 720p not supported, desktop not changed"); + } +} + +#define LOWER_NIBBLE( x ) \ + ((1|2|4|8) & (x)) + +#define UPPER_NIBBLE( x ) \ + (((128|64|32|16) & (x)) >> 4) + +#define DETAILED_TIMING_DESCRIPTIONS_START 0x36 +#define DETAILED_TIMING_DESCRIPTION_SIZE 18 +#define NO_DETAILED_TIMING_DESCRIPTIONS 4 + +#define UNKNOWN_DESCRIPTOR -1 +#define DETAILED_TIMING_BLOCK -2 + +#define COMBINE_HI_8LO( hi, lo ) \ + ( (((unsigned)hi) << 8) | (unsigned)lo ) + +#define PIXEL_CLOCK_LO (unsigned)block[ 0 ] +#define PIXEL_CLOCK_HI (unsigned)block[ 1 ] +#define PIXEL_CLOCK (COMBINE_HI_8LO( PIXEL_CLOCK_HI,PIXEL_CLOCK_LO )*10000) + +#define H_BLANKING_LO (unsigned)block[ 3 ] +#define H_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 4 ] ) +#define H_BLANKING COMBINE_HI_8LO( H_BLANKING_HI, H_BLANKING_LO ) + +#define V_BLANKING_LO (unsigned)block[ 6 ] +#define V_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 7 ] ) +#define V_BLANKING COMBINE_HI_8LO( V_BLANKING_HI, V_BLANKING_LO ) + +#define V_ACTIVE_LO (unsigned)block[ 5 ] +#define V_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 7 ] ) +#define V_ACTIVE COMBINE_HI_8LO( V_ACTIVE_HI, V_ACTIVE_LO ) + +#define H_ACTIVE_LO (unsigned)block[ 2 ] +#define H_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 4 ] ) +#define H_ACTIVE COMBINE_HI_8LO( H_ACTIVE_HI, H_ACTIVE_LO ) + +#define FLAGS (unsigned)block[ 17 ] +#define INTERLACED (FLAGS&128) + +const unsigned char edid_v1_descriptor_flag[] = { 0x00, 0x00 }; + +void CWinSystemGDL::GetNativeDisplayResolution(std::vector& resolutions) +{ + unsigned char* edid_buffer; + int edid_len; + + if (ReadEDID(&edid_buffer, &edid_len)) + { + GetNativeResolutionFromEDID(edid_buffer, edid_len, resolutions); + } + + if (resolutions.size() == 0) + { + RESOLUTION_INFO fallthrough; + fallthrough.iWidth = 1280; + fallthrough.iHeight = 720; + fallthrough.fRefreshRate = 59.94f; + resolutions.push_back(fallthrough); + } +} + +bool ResolutionSortPredicate(const RESOLUTION_INFO& d1, const RESOLUTION_INFO& d2) +{ + return (d1.iWidth * d1.iHeight) > (d2.iWidth * d2.iHeight); +} + +bool CWinSystemGDL::GetNativeResolutionFromEDID(unsigned char* edid_data, int edid_len, std::vector& resolutions) +{ + std::vector interlacedResolutions; + + unsigned char* block = edid_data + DETAILED_TIMING_DESCRIPTIONS_START; + + for (int i = 0; i < NO_DETAILED_TIMING_DESCRIPTIONS; i++, block += DETAILED_TIMING_DESCRIPTION_SIZE) + { + if (GetEDIDBlockType( block ) == DETAILED_TIMING_BLOCK) + { + RESOLUTION_INFO resolution; + + int htotal, vtotal; + htotal = H_ACTIVE + H_BLANKING; + vtotal = V_ACTIVE + V_BLANKING; + float vfreq = (float)PIXEL_CLOCK/((float)vtotal*(float)htotal); + + resolution.iWidth = H_ACTIVE; + resolution.iHeight = V_ACTIVE; + resolution.fRefreshRate = vfreq; + resolution.dwFlags = 0; + if (INTERLACED) + { + resolution.dwFlags |= D3DPRESENTFLAG_INTERLACED; + resolution.iHeight *= 2; + interlacedResolutions.push_back(resolution); + } + else + { + resolutions.push_back(resolution); + } + } + } + + // sort resolutions according to size + std::sort(resolutions.begin(), resolutions.end(), ResolutionSortPredicate); + std::sort(interlacedResolutions.begin(), interlacedResolutions.end(), ResolutionSortPredicate); + + // append interlaced resolution at the end + resolutions.insert(resolutions.end(), interlacedResolutions.begin(), interlacedResolutions.end()); + + return true; +} + +int CWinSystemGDL::GetEDIDBlockType( unsigned char* block ) +{ + if (!strncmp( (const char*) edid_v1_descriptor_flag, (const char*) block, 2)) + { + if (block[2] != 0) + return UNKNOWN_DESCRIPTOR; + return block[ 3 ]; + } + else + { + /* detailed timing block */ + return DETAILED_TIMING_BLOCK; + } +} + + +bool CWinSystemGDL::ReadEDID(unsigned char** edid_data, int* len) +{ + gdl_ret_t rc = GDL_SUCCESS; + unsigned int n; + gdl_hdmi_edid_block_t eb; + eb.index = 0; + + *edid_data = NULL; + *len = 0; + + // Read first block + if (gdl_port_recv(GDL_PD_ID_HDMI, GDL_PD_RECV_HDMI_EDID_BLOCK, (void *) &eb, + sizeof(gdl_hdmi_edid_block_t)) != GDL_SUCCESS) + { + return false; + } + + // Determine total number of blocks + n = eb.data[126] + 1; + + *edid_data = (unsigned char*) malloc(n * 128); + + // Read and print all EDID blocks + for (eb.index = 0; eb.index < n; eb.index++) + { + rc = gdl_port_recv(GDL_PD_ID_HDMI, GDL_PD_RECV_HDMI_EDID_BLOCK, + (void *) &eb, sizeof(gdl_hdmi_edid_block_t)); + + if (rc == GDL_SUCCESS) + { + memcpy(*edid_data + *len, eb.data, 128); + *len += 128; + } + + if (rc != GDL_SUCCESS) + break; + } + + return true; +} + +void CWinSystemGDL::NotifyAppActiveChange(bool bActivated) +{ +} + +bool CWinSystemGDL::Minimize() +{ + return true; +} + +bool CWinSystemGDL::Restore() +{ + return true; +} + +bool CWinSystemGDL::Hide() +{ + return true; +} + +bool CWinSystemGDL::Show(bool raise) +{ + return true; +} + +EGLDisplay CWinSystemGDL::GetEGLDisplay() +{ + return m_eglBinding.GetDisplay(); +} + +gdl_gamma_t GetGDLGamma(GAMMA gamma) +{ + switch(gamma) + { + case GAMMA_LINEAR: + return GDL_GAMMA_LINEAR; + case GAMMA_2_2: + return GDL_GAMMA_2_2; + case GAMMA_2_8: + return GDL_GAMMA_2_8; + } + + return GDL_GAMMA_LINEAR; +} + +#endif diff --git a/xbmc/WinSystemGDL.h b/xbmc/WinSystemGDL.h new file mode 100644 index 00000000..7413832f --- /dev/null +++ b/xbmc/WinSystemGDL.h @@ -0,0 +1,81 @@ +#ifndef WINDOW_SYSTEM_GDL_H +#define WINDOW_SYSTEM_GDL_H + +#pragma once + +/* + * Copyright (C) 2008-2010 Boxee + * http://www.boxee.tv + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +#include "WinSystem.h" +#include "WinBindingEGL.h" +#include "Geometry.h" + +#include +#include + +#define GDL_VIDEO_PLANE GDL_PLANE_ID_UPP_B // bottom +#define GDL_GRAPHICS_PLANE GDL_PLANE_ID_UPP_D // on top for overlays +#define GDL_FLASH_GRAPHICS_PLANE GDL_PLANE_ID_UPP_C // middle for pages with embedded video + +class CWinSystemGDL : public CWinSystemBase +{ +public: + CWinSystemGDL(); + virtual ~CWinSystemGDL(); + + // CWinSystemBase + virtual bool InitWindowSystem(); + virtual bool DestroyWindowSystem(); + virtual bool CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction); + virtual bool DestroyWindow(); + virtual bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop); + virtual bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays); + virtual void UpdateResolutions(); + + virtual void NotifyAppActiveChange(bool bActivated); + + virtual bool Minimize(); + virtual bool Restore() ; + virtual bool Hide(); + virtual bool Show(bool raise = true); + virtual void* GetRenderContext(); + + bool EnableHardwareScaler(bool bEnable, CRect src, CRect dst, gdl_plane_id_t plane = GDL_GRAPHICS_PLANE); + bool IsHardwareScalerEnabled(gdl_plane_id_t plane = GDL_GRAPHICS_PLANE); + bool GetPlaneRect(gdl_plane_id_t plane, CRect& rect, gdl_plane_attr_t attrib); + bool EnableHDMIClamp(bool enable); + bool EnableHDCP(bool enable); + bool ConfigureHDMIOutput(); + + EGLDisplay GetEGLDisplay(); + +protected: + void GetNativeDisplayResolution(std::vector& resolutions); + bool ReadEDID(unsigned char** edid_data, int* len); + int GetEDIDBlockType(unsigned char* block); + bool GetNativeResolutionFromEDID(unsigned char* edid_data, int edid_len, std::vector& resolutions); + gdl_gamma_t GetGDLGamma(GAMMA gamma); + + CWinBindingEGL m_eglBinding; + gdl_plane_id_t m_gdlPlane; +}; + +#endif // WINDOW_SYSTEM_GDL_H + diff --git a/xbmc/WinSystemGDLGLES.cpp b/xbmc/WinSystemGDLGLES.cpp new file mode 100644 index 00000000..91225d54 --- /dev/null +++ b/xbmc/WinSystemGDLGLES.cpp @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +#include "system.h" + +#if defined(HAS_GDL) && defined(HAS_GLES) + +#include "WinSystemGDLGLES.h" + +CWinSystemGDLGLES g_Windowing; + +CWinSystemGDLGLES::CWinSystemGDLGLES() +{ +} + +CWinSystemGDLGLES::~CWinSystemGDLGLES() +{ +} + +bool CWinSystemGDLGLES::PresentRenderImpl() +{ + eglSwapBuffers(m_eglBinding.GetDisplay(), m_eglBinding.GetSurface()); + return true; +} + +void CWinSystemGDLGLES::SetVSyncImpl(bool enable) +{ + eglSwapInterval(m_eglBinding.GetDisplay(), 0); +} + +bool CWinSystemGDLGLES::ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop) +{ + CWinSystemGDL::ResizeWindow(newWidth, newHeight, newLeft, newTop); + CRenderSystemGLES::ResetRenderSystem(newWidth, newHeight, true, 0); + + return true; +} + +bool CWinSystemGDLGLES::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) +{ + CWinSystemGDL::SetFullScreen(fullScreen, res, blankOtherDisplays); + CRenderSystemGLES::ResetRenderSystem(res.iWidth, res.iHeight, true, 0); + + return true; +} + +void* CWinSystemGDLGLES::GetRenderContext() +{ + return CWinSystemGDL::GetRenderContext(); +} + +#endif diff --git a/xbmc/WinSystemGDLGLES.h b/xbmc/WinSystemGDLGLES.h new file mode 100755 index 00000000..13351fa7 --- /dev/null +++ b/xbmc/WinSystemGDLGLES.h @@ -0,0 +1,43 @@ +#ifndef WINDOW_SYSTEM_GDL_GLES_H +#define WINDOW_SYSTEM_GDL_GLES_H + +#pragma once + +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +#include "WinSystemGDL.h" +#include "RenderSystemGLES.h" + +class CWinSystemGDLGLES : public CWinSystemGDL, public CRenderSystemGLES +{ +public: + CWinSystemGDLGLES(); + virtual ~CWinSystemGDLGLES(); + virtual bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop); + virtual bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays); + virtual void* GetRenderContext(); + +protected: + virtual bool PresentRenderImpl(); + virtual void SetVSyncImpl(bool enable); +}; + +#endif // WINDOW_SYSTEM_GDL_GLES_H diff --git a/xbmc/app/DllSkinNativeApp.h b/xbmc/app/DllSkinNativeApp.h new file mode 100644 index 00000000..6b026c3c --- /dev/null +++ b/xbmc/app/DllSkinNativeApp.h @@ -0,0 +1,43 @@ + +#ifndef _DLL_SKIN_NATIVE_APP__H__ +#define _DLL_SKIN_NATIVE_APP__H__ + +/* native applications - framework for boxee native applications + * Copyright (C) 2010 Boxee.tv. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "app/XAPP_Native.h" +#include "DynamicDll.h" + +class DllSkinNativeAppInterface +{ +public: + virtual bool xapp_initialize(XAPP::NativeApp** app) = 0; + + DllSkinNativeAppInterface() {} + virtual ~DllSkinNativeAppInterface() {} +}; + +class DllSkinNativeApp : public DllDynamic, DllSkinNativeAppInterface +{ + DEFINE_METHOD1(bool, xapp_initialize, (XAPP::NativeApp** p1)) + BEGIN_METHOD_RESOLVE() + RESOLVE_METHOD(xapp_initialize) + END_METHOD_RESOLVE() +}; + +#endif diff --git a/xbmc/app/XAPP_Native.cpp b/xbmc/app/XAPP_Native.cpp new file mode 100644 index 00000000..55922e4e --- /dev/null +++ b/xbmc/app/XAPP_Native.cpp @@ -0,0 +1,11 @@ +#include "XAPP_Native.h" +#include + +XAPP::NativeApp::NativeApp(std::string name) +{ +} + +XAPP::NativeApp::~NativeApp() +{ +} + diff --git a/xbmc/app/XAPP_Native.h b/xbmc/app/XAPP_Native.h new file mode 100644 index 00000000..056b0e4a --- /dev/null +++ b/xbmc/app/XAPP_Native.h @@ -0,0 +1,22 @@ +#ifndef XAPP_NATIVE_H_ +#define XAPP_NATIVE_H_ + +#include +#include + +namespace XAPP +{ + +class NativeApp +{ +public: + NativeApp(std::string name); + virtual ~NativeApp(); + virtual bool Start(int argc, char** argv) = 0; + virtual void Process() = 0; + virtual bool Call(std::string function, std::map args) = 0; +}; + +} + +#endif diff --git a/xbmc/app/XAPP_Textbox.cpp b/xbmc/app/XAPP_Textbox.cpp new file mode 100644 index 00000000..25e5e9bc --- /dev/null +++ b/xbmc/app/XAPP_Textbox.cpp @@ -0,0 +1,34 @@ +/* + * XAPP_Textbox.cpp + * + * Created on: Aug 4, 2011 + * Author: shay + */ + +#include "XAPP_Textbox.h" +#include "Application.h" +#include "GUIWindowManager.h" + +namespace XAPP +{ + +Textbox::Textbox(int windowId, int controlId) throw (AppException) : Control(windowId, controlId) +{ + CGUIMessage msg(GUI_MSG_GET_TYPE, m_windowId, m_controlId); + g_application.getApplicationMessenger().SendGUIMessageToWindow(msg, m_windowId, true); + + CGUIControl::GUICONTROLTYPES type = (CGUIControl::GUICONTROLTYPES)msg.GetParam1(); + + if (type != CGUIControl::GUICONTROL_TEXTBOX) + throw AppException("Control is not a Textbox"); +} + + +void Textbox::SetText(const std::string& text) +{ + std::vector vec; + ThreadMessage tMsg ( TMSG_SET_CONTROL_LABEL, m_windowId, m_controlId, text, vec, "", NULL, NULL ); + g_application.getApplicationMessenger().SendMessage(tMsg, false); +} + +} diff --git a/xbmc/app/XAPP_Textbox.h b/xbmc/app/XAPP_Textbox.h new file mode 100644 index 00000000..16a44e62 --- /dev/null +++ b/xbmc/app/XAPP_Textbox.h @@ -0,0 +1,26 @@ +/* + * XAPP_Textbox.h + * + * Created on: Aug 4, 2011 + * Author: shay + */ + +#ifndef XAPP_TEXTBOX_H_ +#define XAPP_TEXTBOX_H_ +#include "XAPP_Control.h" + +namespace XAPP +{ + +class Textbox: public Control +{ +public: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + Textbox(int windowId, int controlId) throw (XAPP::AppException); +#endif + + void SetText(const std::string& text); +}; + +} +#endif /* XAPP_TEXTBOX_H_ */ diff --git a/xbmc/app/app.pro b/xbmc/app/app.pro new file mode 100644 index 00000000..3715892b --- /dev/null +++ b/xbmc/app/app.pro @@ -0,0 +1,49 @@ +include(../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../ ../.. ../linux ../../guilib ../cores ../utils ../lib/libBoxee ../FileSystem ../lib/libPython + +SOURCES += App_Python_Wrapper.cpp XAPP_App.cpp XAPP_Button.cpp XAPP_Control.cpp XAPP_Image.cpp XAPP_Label.cpp XAPP_List.cpp XAPP_ListItem.cpp XAPP_LocalConfig.cpp XAPP_MC.cpp XAPP_Player.cpp XAPP_PlayList.cpp XAPP_ToggleButton.cpp XAPP_Window.cpp XAPP_Edit.cpp XAPP_Http.cpp + +HEADERS += XAPP_App.h XAPP_Button.h XAPP_Control.h XAPP_Image.h XAPP_Label.h XAPP_List.h XAPP_ListItem.h XAPP_LocalConfig.h XAPP_ToggleButton.h XAPP_Window.h XAPP_MC.h XAPP_Player.h XAPP_PlayList.h AppException.h + +# add a build command +defineReplace( nc ) { + return( $$escape_expand(\n\t)$$1 ) +} + +# add a silent build command +defineReplace( snc ) { + return( $$escape_expand(\n\t)"@"$$1 ) +} + +# add end of line +defineReplace( nl ) { + return( $$escape_expand(\n) ) +} + +wrapper.target=App_Python_Wrapper.cpp +wrapper.commands = swig -Wall -c++ -python mc.i +wrapper.commands +=$$nc( ./fix_wrapper.sh ) +wrapper.commands +=$$nc( -rm mc_wrap.cxx ) +wrapper.commands +=$$nc( mv mc.py ../../system/python/local ) +wrapper.commands +=$$nc( patch -p0 < remove_loop.patch ) +wrapper.commands +=$$nc( patch -p0 < reduce_exceptions.patch ) +wrapper.depends = $$HEADERS mc.i mc_doc.i fix_wrapper.sh + +mc_doc.target = mc_doc.i +mc_doc.depends = $$HEADERS doxygen.conf doxygen2boxeedoc.php +mc_doc.commands = doxygen doxygen.conf +mc_doc.commands += $$nc(python ../../tools/doxygen/doxy2swig.py xml/index.xml mc_doc.i) +mc_doc.commands += $$nc(xsltproc xml/combine.xslt xml/index.xml > all.xml) +mc_doc.commands += $$nc(php doxygen2boxeedoc.php > reference_doc.html) + +QMAKE_EXTRA_TARGETS += wrapper mc_doc + + diff --git a/xbmc/app/reduce_exceptions.patch b/xbmc/app/reduce_exceptions.patch new file mode 100644 index 00000000..277801df --- /dev/null +++ b/xbmc/app/reduce_exceptions.patch @@ -0,0 +1,96 @@ +Index: App_Python_Wrapper.cpp +=================================================================== +--- App_Python_Wrapper.cpp (revision 16251) ++++ App_Python_Wrapper.cpp (working copy) +@@ -2925,6 +2925,9 @@ + throw stop_iteration(); + } + ++ virtual bool atEnd() const { return false; } ++ virtual bool atStart() const { return false; } ++ + // Random access iterator methods, but not required in Python + virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const + { +@@ -2941,7 +2944,7 @@ + + PyObject *next() + { +- SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads ++ SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads + PyObject *obj = value(); + incr(); + SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads +@@ -3737,7 +3740,6 @@ + return current; + } + +- + bool equal (const SwigPyIterator &iter) const + { + const self_type *iters = dynamic_cast(&iter); +@@ -3846,6 +3848,15 @@ + return new self_type(*this); + } + ++ virtual bool atEnd() const ++ { ++ return (base::current == end); ++ } ++ virtual bool atStart() const ++ { ++ return (base::current == begin); ++ } ++ + SwigPyIterator *incr(size_t n = 1) + { + while (n--) { +@@ -5079,6 +5090,11 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_value" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); + } + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ++ if ( (arg1)->atEnd() ) { ++ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); ++ SWIG_fail; ++ } ++ + try { + result = (PyObject *)((swig::SwigPyIterator const *)arg1)->value(); + } +@@ -5447,6 +5463,12 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_next" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); + } + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ++ ++ if ( (arg1)->atEnd() ) { ++ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); ++ SWIG_fail; ++ } ++ + try { + result = (PyObject *)(arg1)->next(); + } +@@ -5479,6 +5501,11 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___next__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); + } + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ++ if ( (arg1)->atEnd() ) { ++ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); ++ SWIG_fail; ++ } ++ + try { + result = (PyObject *)(arg1)->__next__(); + } +@@ -5511,6 +5538,11 @@ + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_previous" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); + } + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ++ if ( (arg1)->atStart() ) { ++ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); ++ SWIG_fail; ++ } ++ + try { + result = (PyObject *)(arg1)->previous(); + } diff --git a/xbmc/app/remove_loop.patch b/xbmc/app/remove_loop.patch new file mode 100644 index 00000000..58b99e12 --- /dev/null +++ b/xbmc/app/remove_loop.patch @@ -0,0 +1,48 @@ +Index: App_Python_Wrapper.cpp +=================================================================== +--- App_Python_Wrapper.cpp (revision 15341) ++++ App_Python_Wrapper.cpp (revision 15358) +@@ -346,6 +346,7 @@ + + + #include ++#include + + #ifdef __cplusplus + extern "C" { +@@ -555,16 +556,33 @@ + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; +- ++ ++ // FIX: Check if endless loop exists in the list and mark its position ++ std::map castMap; ++ ++ + while (cast) { ++ // FIX: check if this address is already in the map ++ std::map::iterator it = castMap.find(cast); ++ if (it != castMap.end()) ++ { ++ break; ++ } ++ else ++ { ++ castMap.insert(it, std::map::value_type(cast, -1)); ++ } ++ + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { +- SWIG_TypeClientData(tc, clientdata); ++ SWIG_TypeClientData(tc, clientdata); ++ + } + } + cast = cast->next; + } ++ + } + SWIGRUNTIME void + SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { diff --git a/xbmc/app/showdialogselect_fix.patch b/xbmc/app/showdialogselect_fix.patch new file mode 100644 index 00000000..7b9ce8d6 --- /dev/null +++ b/xbmc/app/showdialogselect_fix.patch @@ -0,0 +1,46 @@ +Index: App_Python_Wrapper.cpp +=================================================================== +--- App_Python_Wrapper.cpp (revision 18073) ++++ App_Python_Wrapper.cpp (working copy) +@@ -15091,7 +15091,7 @@ + SWIGINTERN PyObject *_wrap_MC_ShowDialogSelect(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::string *arg1 = 0 ; +- std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ; ++ std::vector< std::string,std::allocator< std::string > > list; + int res1 = SWIG_OLDOBJ ; + void *argp2 = 0 ; + int res2 = 0 ; +@@ -15111,15 +15111,25 @@ + } + arg1 = ptr; + } +- res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0); +- if (!SWIG_IsOK(res2)) { +- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MC_ShowDialogSelect" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); ++ ++ if (!PyList_Check(obj1)) { ++ SWIG_exception_fail(SWIG_ValueError, "in method '" "MC_ShowDialogSelect" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); + } +- if (!argp2) { +- SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MC_ShowDialogSelect" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); ++ ++ for (int i=0; i > const &""'"); ++ } ++ list.push_back(*ptr1); ++ delete ptr1; + } +- arg2 = reinterpret_cast< std::vector< std::string,std::allocator< std::string > > * >(argp2); +- result = (int)XAPP::MC::ShowDialogSelect((std::string const &)*arg1,(std::vector< std::string,std::allocator< std::string > > const &)*arg2); ++ ++ result = (int)XAPP::MC::ShowDialogSelect((std::string const &)*arg1, list); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj; diff --git a/xbmc/cdrip/cdrip.pro b/xbmc/cdrip/cdrip.pro new file mode 100644 index 00000000..f924ac41 --- /dev/null +++ b/xbmc/cdrip/cdrip.pro @@ -0,0 +1,31 @@ +include(../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../ ../.. ../linux ../../guilib +SOURCES += \ + \ +EncoderVorbis.cpp \ +CDDAReader.cpp \ +EncoderWav.cpp \ +CDDARipper.cpp \ +Encoder.cpp \ +EncoderLame.cpp \ + + +HEADERS += \ + \ +EncoderVorbis.h \ +CDDAReader.h \ +EncoderWav.h \ +CDDARipper.h \ +Encoder.h \ +EncoderLame.h \ + + +INCLUDEPATH += ../../ diff --git a/xbmc/cores/AudioRenderers/AudioRenderers.pro b/xbmc/cores/AudioRenderers/AudioRenderers.pro new file mode 100644 index 00000000..a54ee3a1 --- /dev/null +++ b/xbmc/cores/AudioRenderers/AudioRenderers.pro @@ -0,0 +1,37 @@ +include(../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../../ ../../linux ../../../guilib ../../utils ../dvdplayer .. ../dvdplayer/Codecs ../dvdplayer/Codecs/ffmpeg +SOURCES += \ +ALSADirectSound.cpp \ +IntelSMDAudioRenderer.cpp \ +AudioRendererFactory.cpp \ +AudioUtils.cpp \ +CoreAudioRenderer.cpp \ +NullDirectSound.cpp \ + +HEADERS += \ +ALSADirectSound.h \ +IntelSMDAudioRenderer.h \ +AudioRendererFactory.h \ +AudioUtils.h \ +CoreAudioRenderer.h \ +NullDirectSound.h \ + +mac { +SOURCES += AudioUtilsHelperApple.cpp +HEADERS += AudioUtilsHelperApple.h +} + +unix:!mac { +SOURCES += AudioUtilsHelperLinux.cpp +HEADERS += AudioUtilsHelperLinux.h +} + +INCLUDEPATH += ../../../ diff --git a/xbmc/cores/AudioRenderers/AudioUtils.cpp b/xbmc/cores/AudioRenderers/AudioUtils.cpp new file mode 100644 index 00000000..cf5f138d --- /dev/null +++ b/xbmc/cores/AudioRenderers/AudioUtils.cpp @@ -0,0 +1,35 @@ +#include "AudioUtils.h" +#include "GUISettings.h" +#include "log.h" +#include +#include "../../guilib/GUIAudioManager.h" + +CAudioUtils::CAudioUtils(void) +{ +} + +CAudioUtils::~CAudioUtils(void) +{ +} + +unsigned int CAudioUtils::UpdateAppVolume() +{ + if (!g_guiSettings.GetBool("audiooutput.controlmastervolume")) + return g_stSettings.m_nVolumeLevel; + + long nAppVolume; + nAppVolume = m_SystemMasterVolume.GetMasterVolume(); + + g_stSettings.m_nVolumeLevel = (long)((float)nAppVolume * 0.01f * (VOLUME_MAXIMUM - VOLUME_MINIMUM) + VOLUME_MINIMUM); + g_application.m_guiDialogVolumeBar.Show(); + + return g_stSettings.m_nVolumeLevel; +} + +bool CAudioUtils::SetMasterVolume(long masterVolume) +{ + bool bOk = m_SystemMasterVolume.SetMasterVolume(masterVolume); + if (bOk) + g_stSettings.m_nVolumeLevel = masterVolume; + return bOk; +} diff --git a/xbmc/cores/AudioRenderers/AudioUtils.h b/xbmc/cores/AudioRenderers/AudioUtils.h new file mode 100644 index 00000000..ce0d4449 --- /dev/null +++ b/xbmc/cores/AudioRenderers/AudioUtils.h @@ -0,0 +1,35 @@ +#ifndef __AUDIOUTILS_H__ +#define __AUTIOUTILS_H__ + +#include "../../Settings.h" +#include "Application.h" + +#ifdef _WIN32 +#include "AudioUtilsHelperWin32.h" +#elif defined(_LINUX) && !defined(__APPLE__) +#include "AudioUtilsHelperLinux.h" +#elif defined(__APPLE__) +#include "AudioUtilsHelperApple.h" +#endif + +class CAudioUtils +{ +public: + static CAudioUtils& GetInstance() + { + static CAudioUtils sAudioUtil; + return sAudioUtil; + } + + bool SetMasterVolume(long masterVolume); + unsigned int UpdateAppVolume(); + + virtual ~CAudioUtils(void); +private: + + CAudioUtilsHelper m_SystemMasterVolume; + + CAudioUtils(void); +}; + +#endif diff --git a/xbmc/cores/AudioRenderers/AudioUtilsHelperApple.cpp b/xbmc/cores/AudioRenderers/AudioUtilsHelperApple.cpp new file mode 100644 index 00000000..b00cfc57 --- /dev/null +++ b/xbmc/cores/AudioRenderers/AudioUtilsHelperApple.cpp @@ -0,0 +1,187 @@ +#include "AudioUtilsHelperApple.h" +#include "AudioUtils.h" +#include "GUISettings.h" +#include "CoreAudio.h" +#include "utils/log.h" + +CAudioUtilsHelper::CAudioUtilsHelper(void) +{ + Init(); +} + +CAudioUtilsHelper::~CAudioUtilsHelper(void) +{ + Deinit(); +} + +bool CAudioUtilsHelper::Init() +{ + // TODO: need to set AppVolume + m_lAppVolumeDiff = abs(VOLUME_MINIMUM - VOLUME_MAXIMUM); + m_lAppBaseVolume = (VOLUME_MINIMUM < VOLUME_MAXIMUM)? VOLUME_MINIMUM : VOLUME_MAXIMUM; + + m_lSysVolumeDiff = 100; + m_lSysBaseVolume = 1; + + return true; +} + +bool CAudioUtilsHelper::Deinit() +{ + return true; +} + +bool CAudioUtilsHelper::SetMasterVolume(long masterVolume) +{ + OSStatus err; + UInt32 size; + AudioDeviceID deviceId = 0; + + float volume = GetAppRelativeVolume(masterVolume); + + CLog::Log(LOGDEBUG,"CAudioUtilsHelper::SetMasterVolume - Convert [masterVolume=%ld] to [volume=%4.2f] (au)",masterVolume,volume); + + deviceId = CCoreAudioHardware::GetDefaultOutputDevice(); + + if (!deviceId) + { + CLog::Log(LOGERROR,"CAudioUtilsHelper::SetMasterVolume - FAILED to get default output device. [masterVolume=%ld] (au)",masterVolume); + return false; + } + + CCoreAudioDevice device(deviceId); + CStdString deviceName; + device.GetName(deviceName, device.GetId()); + + // try set master-channel + Boolean canSetMasterChannel = false; + size = sizeof canSetMasterChannel; + err = AudioDeviceGetPropertyInfo(deviceId, 0, false, kAudioDevicePropertyVolumeScalar, &size, &canSetMasterChannel); + + CLog::Log(LOGDEBUG,"CAudioUtilsHelper::SetMasterVolume - Check MasterChannel for device [id=0x%04x][name=%s] returned [err=%d][canSet=%d]. [masterVolume=%ld] (au)",(unsigned int)device.GetId(),deviceName.c_str(),(bool)err,canSetMasterChannel,masterVolume); + + if(!err && canSetMasterChannel) + { + size = sizeof volume; + err = AudioDeviceSetProperty(deviceId, 0, 0, false, kAudioDevicePropertyVolumeScalar, size, &volume); + + if (!err) + { + CLog::Log(LOGDEBUG,"CAudioUtilsHelper::SetMasterVolume - Set new volume to device [id=0x%04x][name=%s] MasterChannel (au)",(unsigned int)device.GetId(),deviceName.c_str()); + return true; + } + } + + UInt32 totalNumOfChannels = CCoreAudioDevice::GetTotalOutputChannels(deviceId); + + CLog::Log(LOGDEBUG,"CAudioUtilsHelper::SetMasterVolume - Device [id=0x%04x][name=%s] has [TotalNumOfChannels=%u]. [masterVolume=%ld] (au)",(unsigned int)device.GetId(),deviceName.c_str(),totalNumOfChannels,masterVolume); + + if (totalNumOfChannels < 1) + { + CLog::Log(LOGERROR,"CAudioUtilsHelper::SetMasterVolume - FAILED to set volume because [TotalNumOfChannels=%u]. [masterVolume=%ld] (au)",totalNumOfChannels,masterVolume); + return false; + } + + CLog::Log(LOGDEBUG,"CAudioUtilsHelper::SetMasterVolume - Going to set new volume to device [id=0x%04x][name=%s] channels. [TotalNumOfChannels=%u] (au)",(unsigned int)device.GetId(),deviceName.c_str(),totalNumOfChannels); + + for (UInt32 iChannel=1; iChannel<=totalNumOfChannels; iChannel++) + { + size = sizeof(volume); + err = AudioDeviceSetProperty(deviceId, 0, iChannel, false, kAudioDevicePropertyVolumeScalar, size, &volume); + + if (err) + { + CLog::Log(LOGERROR,"CAudioUtilsHelper::SetMasterVolume - FAILED to set volume for channel [%u/%u]. [volume=%4.2f] (au)",iChannel,totalNumOfChannels,volume); + } + } + + return true; +} + +long CAudioUtilsHelper::GetMasterVolume() +{ + long AppVolume=0; + OSStatus err; + UInt32 size; + AudioDeviceID deviceId = 0; + + deviceId = CCoreAudioHardware::GetDefaultOutputDevice(); + + if (!deviceId) + { + CLog::Log(LOGERROR,"CAudioUtilsHelper::UpdateAppVolume - FAILED to get default output device (au)"); + return 0; + } + + CCoreAudioDevice device(deviceId); + CStdString deviceName; + device.GetName(deviceName, device.GetId()); + + UInt32 totalNumOfChannels = CCoreAudioDevice::GetTotalOutputChannels(deviceId); + + CLog::Log(LOGDEBUG,"CAudioUtilsHelper::UpdateAppVolume - Device [id=0x%04x][name=%s] has [TotalNumOfChannels=%u] (au)",(unsigned int)device.GetId(),deviceName.c_str(),totalNumOfChannels); + + float volume = 0.0; + float chVolume = 0.0; + + for (UInt32 iChannel=1; iChannel<=totalNumOfChannels; iChannel++) + { + size = sizeof(chVolume); + err = AudioDeviceGetProperty(deviceId, iChannel, false, kAudioDevicePropertyVolumeScalar, &size, &chVolume); + + if (!err) + { + if (chVolume > volume) + { + volume = chVolume; + } + } + } + + long sysVolume = volume * 100; + + int nCurrVol = g_application.GetVolume(); + if (abs(nCurrVol - sysVolume) < 3) + { + return nCurrVol; + } + + AppVolume = sysVolume; + + CLog::Log(LOGDEBUG,"CAudioUtilsHelper::UpdateAppVolume - After set [AppVolume=%ld] from device [id=0x%04x][name=%s]. [volume=%4.2f][sysVolume=%ld] (au)",AppVolume,(unsigned int)device.GetId(),deviceName.c_str(),volume,sysVolume); + + return AppVolume; +} + +long CAudioUtilsHelper::CastToSystemVolume(long AppVolume) +{ + long retVal=0; + + //should be generic for all OSs + float relativeValue = GetAppRelativeVolume(AppVolume); + retVal = (m_lSysVolumeDiff * relativeValue) + m_lSysBaseVolume; + + return retVal; +} + +float CAudioUtilsHelper::GetSysRelativeVolume(long SysVolume) +{ + return (float)(abs(SysVolume - m_lSysBaseVolume) / (float) m_lSysVolumeDiff); +} + +long CAudioUtilsHelper::CastToAppVolume(long SysVolume) +{ + long retVal=0; + + //should be generic for all OSs + + float relativeValue = GetSysRelativeVolume(SysVolume); + retVal = (m_lAppVolumeDiff * relativeValue) + m_lAppBaseVolume; + + return retVal; +} + +float CAudioUtilsHelper::GetAppRelativeVolume(long AppVolume) +{ + return (float)(abs(AppVolume - m_lAppBaseVolume) / (float)m_lAppVolumeDiff); //should be between 0 to 1 +} diff --git a/xbmc/cores/AudioRenderers/AudioUtilsHelperApple.h b/xbmc/cores/AudioRenderers/AudioUtilsHelperApple.h new file mode 100644 index 00000000..b43e5dfb --- /dev/null +++ b/xbmc/cores/AudioRenderers/AudioUtilsHelperApple.h @@ -0,0 +1,30 @@ +#ifndef AUDIOUTILSHELPER_H +#define AUDIOUTILSHELPER_H + +class CAudioUtilsHelper +{ +public: + bool Init(); + bool Deinit(); + bool SetMasterVolume(long masterVolume); + long GetMasterVolume(); + + CAudioUtilsHelper(void); + virtual ~CAudioUtilsHelper(void); + + long CastToSystemVolume(long AppVolume); + float GetSysRelativeVolume(long SysVolume); + + float GetAppRelativeVolume(long AppVolume); + long CastToAppVolume(long SysVolume); + +private: + + long m_lSysVolumeDiff; + long m_lSysBaseVolume; + + long m_lAppVolumeDiff; + long m_lAppBaseVolume; +}; + +#endif \ No newline at end of file diff --git a/xbmc/cores/AudioRenderers/AudioUtilsHelperLinux.cpp b/xbmc/cores/AudioRenderers/AudioUtilsHelperLinux.cpp new file mode 100644 index 00000000..345f6f0a --- /dev/null +++ b/xbmc/cores/AudioRenderers/AudioUtilsHelperLinux.cpp @@ -0,0 +1,111 @@ +#include "AudioUtilsHelperLinux.h" +#include "AudioUtils.h" +#include +#include "GUISettings.h" + +CAudioUtilsHelper::CAudioUtilsHelper(void) +{ + Init(); +} + +CAudioUtilsHelper::~CAudioUtilsHelper(void) +{ + Deinit(); +} + +bool CAudioUtilsHelper::Init() +{ + m_lAppVolumeDiff = abs(VOLUME_MINIMUM - VOLUME_MAXIMUM); + m_lAppBaseVolume = (VOLUME_MINIMUM < VOLUME_MAXIMUM)? VOLUME_MINIMUM : VOLUME_MAXIMUM; + + m_mixer_fd = -1; + + if((m_mixer_fd = open("/dev/mixer", O_RDWR, 0)) == -1) + { + return false; + } + + m_lSysVolumeDiff = 100; + m_lSysBaseVolume = 1; + + return true; + +} + +bool CAudioUtilsHelper::Deinit() +{ + if (m_mixer_fd != -1) + { + close(m_mixer_fd); + return true; + } + return false; +} + +bool CAudioUtilsHelper::SetMasterVolume(long masterVolume) +{ + int setVol=-1; + int newVolume=0; + int rightVol=0,leftVol=0; + + newVolume = CastToSystemVolume(masterVolume); //check this + + rightVol = newVolume; + leftVol = rightVol; + + setVol = (rightVol << 8) | leftVol; + + if(ioctl(m_mixer_fd, MIXER_WRITE(SOUND_MIXER_VOLUME), &setVol) == -1) + { + return false; + } + + return true; +} + +long CAudioUtilsHelper::GetMasterVolume() +{ + long AppVolume=0; + + int getVol=-1; + + if(ioctl(m_mixer_fd, MIXER_READ(SOUND_MIXER_VOLUME), &getVol) != -1) + { + AppVolume = (getVol >> 8); + } + + return AppVolume; +} + +long CAudioUtilsHelper::CastToSystemVolume(long AppVolume) +{ + long retVal=0; + + //should be generic for all OSs + float relativeValue = GetAppRelativeVolume(AppVolume); + retVal = (long) ((m_lSysVolumeDiff * relativeValue) + m_lSysBaseVolume); + + return retVal; +} + +float CAudioUtilsHelper::GetSysRelativeVolume(long SysVolume) +{ + return (float)(abs(SysVolume - m_lSysBaseVolume) / (float) m_lSysVolumeDiff); +} + +long CAudioUtilsHelper::CastToAppVolume(long SysVolume) +{ + long retVal=0; + + //should be generic for all OSs + + float relativeValue = GetSysRelativeVolume(SysVolume); + retVal = (long) ((m_lAppVolumeDiff * relativeValue) + m_lAppBaseVolume); + + return retVal; +} + +float CAudioUtilsHelper::GetAppRelativeVolume(long AppVolume) +{ + return (float)(abs(AppVolume - m_lAppBaseVolume) / (float)m_lAppVolumeDiff); //should be between 0 to 1 +} diff --git a/xbmc/cores/AudioRenderers/AudioUtilsHelperLinux.h b/xbmc/cores/AudioRenderers/AudioUtilsHelperLinux.h new file mode 100644 index 00000000..a09664d3 --- /dev/null +++ b/xbmc/cores/AudioRenderers/AudioUtilsHelperLinux.h @@ -0,0 +1,38 @@ +#ifndef AUDIOUTILSHELPER_H +#define AUDIOUTILSHELPER_H + +#include //open +#if !defined(__APPLE__) +#include //mixer stuff +#endif +#include + +class CAudioUtilsHelper +{ +public: + bool Init(); + bool Deinit(); + bool SetMasterVolume(long masterVolume); + long GetMasterVolume(); + + CAudioUtilsHelper(void); + virtual ~CAudioUtilsHelper(void); + + long CastToSystemVolume(long AppVolume); + float GetSysRelativeVolume(long SysVolume); + + float GetAppRelativeVolume(long AppVolume); + long CastToAppVolume(long SysVolume); + +private: + int m_mixer_fd; + + long m_lSysVolumeDiff; + long m_lSysBaseVolume; + + long m_lAppVolumeDiff; + long m_lAppBaseVolume; +}; + +#endif + diff --git a/xbmc/cores/AudioRenderers/AudioUtilsHelperWin32.cpp b/xbmc/cores/AudioRenderers/AudioUtilsHelperWin32.cpp new file mode 100644 index 00000000..e429ebef --- /dev/null +++ b/xbmc/cores/AudioRenderers/AudioUtilsHelperWin32.cpp @@ -0,0 +1,408 @@ +#include "AudioUtilsHelperWin32.h" +#include "AudioUtils.h" +#include "GUISettings.h" +#include +#include + + +#ifndef _XBOX +extern HWND g_hWnd; +#endif + + +CAudioUtilsHelper::CAudioUtilsHelper(void) +{ + Init(); +} + +CAudioUtilsHelper::~CAudioUtilsHelper(void) +{ + Deinit(); +} + +bool CAudioUtilsHelper::Init() +{ +//general usage + HRESULT hr=S_OK; + OSVERSIONINFO osvi; +//used for winver > 6 control + IMMDevice* defaultDevice; + IMMDeviceEnumerator* deviceEnumerator = NULL; + IMMDeviceCollection* deviceCollection = NULL; + IPropertyStore * pProps = NULL; + LPWSTR pwszID = NULL; + std::string friendlyName; + bool found = false; + + m_lAppVolumeDiff = abs(VOLUME_MINIMUM - VOLUME_MAXIMUM); + m_lAppBaseVolume = (VOLUME_MINIMUM < VOLUME_MAXIMUM)? VOLUME_MINIMUM : VOLUME_MAXIMUM; + + + bool retVal = true; + +//init for winver > 6 control + m_endpointVolume = NULL; + + ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + GetVersionEx(&osvi); + + m_bIsWinVer6 = (osvi.dwMajorVersion >= 6); + + if (m_bIsWinVer6) + { + if (hr == S_OK) + { + deviceEnumerator = NULL; + hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL, CLSCTX_INPROC_SERVER, __uuidof(IMMDeviceEnumerator), (LPVOID *)&deviceEnumerator); + defaultDevice = NULL; + + if (hr == S_OK) + { + deviceEnumerator->EnumAudioEndpoints(eRender,DEVICE_STATEMASK_ALL,&deviceCollection); + UINT count; + hr = deviceCollection->GetCount(&count); + + // Each loop prints the name of an endpoint device. + for (ULONG i = 0; i < count; i++) + { + // Get pointer to endpoint number i. + hr = deviceCollection->Item(i, &defaultDevice); + + // Get the endpoint ID string. + hr = defaultDevice->GetId(&pwszID); + + hr = defaultDevice->OpenPropertyStore(STGM_READ, &pProps); + + PROPVARIANT varName; + // Initialize container for property value. + PropVariantInit(&varName); + + // Get the endpoint's friendly-name property. + hr = pProps->GetValue(PKEY_Device_FriendlyName, &varName); + + friendlyName.clear(); + + convertLPWtoStdString(friendlyName,varName.pwszVal); + + // Print endpoint friendly name and endpoint ID. + + if (g_guiSettings.GetString("audiooutput.audiodevice") == friendlyName) + found = true; + + CoTaskMemFree(pwszID); + pwszID = NULL; + PropVariantClear(&varName); + SAFE_RELEASE(pProps) + + if (found) + break; + else + SAFE_RELEASE(defaultDevice) + } + + if (hr != S_OK || !found)//if getting the device specified in the UI didn't work + hr = deviceEnumerator->GetDefaultAudioEndpoint(eRender, eConsole, &defaultDevice); + + if (hr == S_OK) + { + deviceEnumerator->Release(); + deviceEnumerator = NULL; + + hr = defaultDevice->Activate(__uuidof(IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, (LPVOID *)&m_endpointVolume); + + if (hr == S_OK) + { + m_lSysBaseVolume = 0; + m_lSysVolumeDiff = 1; + defaultDevice->Release(); + defaultDevice = NULL; + } + } + } + } + } + else + { + //used for all the other + int lMinimum = 0; + int lMaximum = 0; + UINT NumMixers = 0; + MIXERCAPS mxcaps; + + ASSERT(m_hMixer == NULL); + + // get the number of mixer devices present in the system + NumMixers = ::mixerGetNumDevs(); + + m_hMixer = NULL; + ::ZeroMemory(&mxcaps, sizeof(MIXERCAPS)); + + // open the first mixer + // A "mapper" for audio mixer devices does not currently exist. + DWORD_PTR cb = reinterpret_cast(g_hWnd); + + //if (NumMixers != 0) + for (int i = 0 ; i < NumMixers || retVal ; i++) + { + if (retVal && ::mixerOpen(&m_hMixer, + i, + cb, + NULL, + MIXER_OBJECTF_MIXER | CALLBACK_WINDOW) + != MMSYSERR_NOERROR) + { + retVal = false; + } + + if (retVal && ::mixerGetDevCaps(reinterpret_cast(m_hMixer),&mxcaps, sizeof(MIXERCAPS))!= MMSYSERR_NOERROR) + { + retVal = false; + } + + if (g_guiSettings.GetString("audiooutput.audiodevice").Equals(mxcaps.szPname))//check if this is the device we want + { + break; //we found our device. + } + else if (NumMixers == 1) //the device strings does not match. + { // its the only device anyway - no need to search, take whatever you can + break; + } + } + + if (retVal && m_hMixer == NULL) + { + retVal = false; + } + + if (retVal) + { + //after init lets find the master volume + + // get dwLineID + MIXERLINE mxl; + mxl.cbStruct = sizeof(MIXERLINE); + mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS; + if (::mixerGetLineInfo(reinterpret_cast(m_hMixer), + &mxl, + MIXER_OBJECTF_HMIXER | + MIXER_GETLINEINFOF_COMPONENTTYPE) + != MMSYSERR_NOERROR) + { + retVal = false; + } + + if (retVal) + { + // get dwControlID + MIXERCONTROL mxc; + MIXERLINECONTROLS mxlc; + mxlc.cbStruct = sizeof(MIXERLINECONTROLS); + mxlc.dwLineID = mxl.dwLineID; + mxlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME; + mxlc.cControls = 1; + mxlc.cbmxctrl = sizeof(MIXERCONTROL); + mxlc.pamxctrl = &mxc; + + + if (::mixerGetLineControls(reinterpret_cast(m_hMixer), + &mxlc, + MIXER_OBJECTF_HMIXER | + MIXER_GETLINECONTROLSF_ONEBYTYPE) + != MMSYSERR_NOERROR) + { + retVal = false; + } + + if (retVal) + { + // store dwControlID + lMinimum = mxc.Bounds.lMinimum; + lMaximum = mxc.Bounds.lMaximum; + m_dwVolumeControlID = mxc.dwControlID; + + m_lSysVolumeDiff = abs(lMinimum - lMaximum); + m_lSysBaseVolume = (lMinimum < lMaximum)? lMinimum : lMaximum; + } + } + } + } + + return retVal; +} + +bool CAudioUtilsHelper::Deinit() +{ + bool retVal = true; + + if (m_bIsWinVer6) + { + SAFE_RELEASE(m_endpointVolume); + } + else + { + if (m_hMixer != NULL) + { + retVal = (::mixerClose(m_hMixer) == MMSYSERR_NOERROR); + m_hMixer = NULL; + } + } + return retVal; +} + +bool CAudioUtilsHelper::SetMasterVolume(long masterVolume) +{ + bool retVal=true; + float currentVolume = 0; + + if (m_bIsWinVer6 && m_endpointVolume) + { + m_endpointVolume->SetMasterVolumeLevelScalar(GetAppRelativeVolume(masterVolume), NULL); + retVal = true; + } + else + { + if (m_hMixer != NULL) + { + long lVal = CastToSystemVolume(masterVolume); + + MIXERCONTROLDETAILS_SIGNED mxcdVolume = { lVal }; + MIXERCONTROLDETAILS mxcd; + mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS); + mxcd.dwControlID = m_dwVolumeControlID; + mxcd.cChannels = 1; + mxcd.cMultipleItems = 0; + mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_SIGNED); + mxcd.paDetails = &mxcdVolume; + + if (::mixerSetControlDetails(reinterpret_cast(m_hMixer), + &mxcd, + MIXER_OBJECTF_HMIXER | + MIXER_SETCONTROLDETAILSF_VALUE) + != MMSYSERR_NOERROR) + { + retVal = false; + } + } + else + { + retVal = false; + } + } + + return retVal; +} + +long CAudioUtilsHelper::GetMasterVolume() +{ + long AppVolume=0; + + MIXERCONTROLDETAILS_SIGNED mxcdVolume; + MIXERCONTROLDETAILS mxcd; + MMRESULT retVal=NO_ERROR; + long SysVolume=0; + float fAppVolume; + + if (!m_bIsWinVer6) + { + if (m_hMixer != NULL) + {//read the mixer values + + mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS); + mxcd.dwControlID = m_dwVolumeControlID; + mxcd.cChannels = 1; + mxcd.cMultipleItems = 0; + mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_SIGNED); + mxcd.paDetails = &mxcdVolume; + + retVal = ::mixerGetControlDetails(reinterpret_cast(m_hMixer), + &mxcd, + MIXER_OBJECTF_HMIXER | + MIXER_SETCONTROLDETAILSF_VALUE); + + SysVolume = mxcdVolume.lValue; + + fAppVolume = GetSysRelativeVolume(SysVolume)*100; + } + } + else + { + m_endpointVolume->GetMasterVolumeLevelScalar(&fAppVolume); //returns values between 0 to 1 + fAppVolume *= 100; + } + + //we don't want to get stuck in mute situation.. + if (fAppVolume < 1) + { + if (fAppVolume > 0.5) + AppVolume = 1; + else + AppVolume = 0; + } + else + AppVolume = fAppVolume; + + return AppVolume; +} + +long CAudioUtilsHelper::CastToSystemVolume(long AppVolume) +{ + long retVal=0; + + //should be generic for all OSs + float relativeValue = GetAppRelativeVolume(AppVolume); + retVal = (m_lSysVolumeDiff * relativeValue) + m_lSysBaseVolume; + + return retVal; +} + +float CAudioUtilsHelper::GetSysRelativeVolume(long SysVolume) +{ + return (float)(abs(SysVolume - m_lSysBaseVolume) / (float) m_lSysVolumeDiff); +} + +long CAudioUtilsHelper::CastToAppVolume(long SysVolume) +{ + long retVal=0; + + //should be generic for all OSs + + float relativeValue = GetSysRelativeVolume(SysVolume); + retVal = (m_lAppVolumeDiff * relativeValue) + m_lAppBaseVolume; + + return retVal; +} + +float CAudioUtilsHelper::GetAppRelativeVolume(long AppVolume) +{ + return (float)(abs(AppVolume - m_lAppBaseVolume) / (float)m_lAppVolumeDiff); //should be between 0 to 1 +} + +bool CAudioUtilsHelper::convertLPWtoStdString(std::string& s, const LPWSTR pw, UINT codepage) +{ + bool res = false; + char* p = 0; + int bsz; + + bsz = WideCharToMultiByte(codepage, + 0, + pw,-1, + 0,0, + 0,0); + if (bsz > 0) { + p = new char[bsz]; + int rc = WideCharToMultiByte(codepage, + 0, + pw,-1, + p,bsz, + 0,0); + if (rc != 0) { + p[bsz-1] = 0; + s = p; + res = true; + } + } + delete [] p; + return res; +} \ No newline at end of file diff --git a/xbmc/cores/AudioRenderers/AudioUtilsHelperWin32.h b/xbmc/cores/AudioRenderers/AudioUtilsHelperWin32.h new file mode 100644 index 00000000..3808d004 --- /dev/null +++ b/xbmc/cores/AudioRenderers/AudioUtilsHelperWin32.h @@ -0,0 +1,47 @@ +#ifndef AUDIOUTILSHELPER_H +#define AUDIOUTILSHELPER_H + + +#include "system.h" +#include +#include +#include +#include + +#include + +class CAudioUtilsHelper +{ +public: + bool Init(); + bool Deinit(); + bool SetMasterVolume(long masterVolume); + long GetMasterVolume(); + + CAudioUtilsHelper(void); + virtual ~CAudioUtilsHelper(void); + + long CastToSystemVolume(long AppVolume); + float GetSysRelativeVolume(long SysVolume); + + float GetAppRelativeVolume(long AppVolume); + long CastToAppVolume(long SysVolume); + +private: + static bool convertLPWtoStdString(std::string& s, const LPWSTR pw, UINT codepage = CP_ACP); + + IAudioEndpointVolume* m_endpointVolume; //used for winver > 6 + + HMIXER m_hMixer; //used for winver < 6 + DWORD m_dwVolumeControlID; + + bool m_bIsWinVer6; //if true, winver > 6 + + long m_lSysVolumeDiff; + long m_lSysBaseVolume; + + long m_lAppVolumeDiff; + long m_lAppBaseVolume; +}; + +#endif \ No newline at end of file diff --git a/xbmc/cores/AudioRenderers/IntelSMDAudioRenderer.cpp b/xbmc/cores/AudioRenderers/IntelSMDAudioRenderer.cpp new file mode 100644 index 00000000..e60b0de3 --- /dev/null +++ b/xbmc/cores/AudioRenderers/IntelSMDAudioRenderer.cpp @@ -0,0 +1,1825 @@ +#include "system.h" +#include "Settings.h" +#include "GUISettings.h" +#include "IntelSMDAudioRenderer.h" +#include + +#ifdef HAS_INTEL_SMD + +/* + * Boxee + * Copyright (c) 2009, Boxee Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "IntelSMDGlobals.h" +#include "AudioContext.h" +#include "cores/dvdplayer/DVDClock.h" +#include "FileSystem/SpecialProtocol.h" +#include "utils/SingleLock.h" +#include "utils/log.h" +#include "AdvancedSettings.h" +#include "Application.h" + + +extern "C" +{ +#include +#include +#include +#include +#include +#include +#include +} +#ifndef UINT64_C +#define UINT64_C(x) (const unsigned long long)(x) +#endif + +extern "C" { +#if (defined USE_EXTERNAL_FFMPEG) + #if (defined HAVE_LIBAVCODEC_AVCODEC_H) + #include + #elif (defined HAVE_FFMPEG_AVCODEC_H) + #include + #endif +#else + #include "ffmpeg/libavcodec/avcodec.h" +#endif +} + +using namespace std; + +CCriticalSection CIntelSMDAudioRenderer::m_SMDAudioLock; + +static const unsigned int s_edidRates[] = {32000,44100,48000,88200,96000,176400,192000}; +static const unsigned int s_edidSampleSizes[] = {16,20,24,32}; +CIntelSMDAudioRenderer::edidHint* CIntelSMDAudioRenderer::m_edidTable = NULL; + +ismd_dev_t tmpDevice = -1; + +CIntelSMDAudioRenderer::CIntelSMDAudioRenderer() +{ + m_bIsAllocated = false; + m_bFlushFlag = true; + m_dwChunkSize = 0; + m_dwBufferLen = 0; + m_lastPts = ISMD_NO_PTS; + m_lastSync = ISMD_NO_PTS; + + m_channelMap = NULL; + m_uiBitsPerSample = 0; + m_uiChannels = 0; + m_audioMediaFormat = AUDIO_MEDIA_FMT_PCM; + m_uiSamplesPerSec = 0; + m_bTimed = false; + m_bDisablePtsCorrection = false; + m_pChunksCollected = NULL; + + m_audioDevice = -1; + m_audioDeviceInput = -1; + + m_bIsHDMI = false; + m_bIsSPDIF = false; + m_bIsAnalog = false; + m_bIsAllOutputs = false; + m_nCurrentVolume = 0; +} + + + + +bool CIntelSMDAudioRenderer::Initialize(IAudioCallback* pCallback, + int iChannels, + enum PCMChannels* channelMap, + unsigned int uiSamplesPerSec, + unsigned int uiBitsPerSample, + bool bResample, + const char* strAudioCodec, + bool bIsMusic, + bool bPassthrough, + bool bTimed, + AudioMediaFormat audioMediaFormat) +{ + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer Initialize name %s iChannels %d uiSamplesPerSec %d uiBitsPerSample %d audioMediaFormat %d bPassthrough %d bTimed %d\n", + strAudioCodec, iChannels, uiSamplesPerSec, uiBitsPerSample, audioMediaFormat, bPassthrough, bTimed); + + CSingleLock lock(m_SMDAudioLock); + + ismd_result_t result; + + g_lic_settings.Load(); + g_lic_settings.dump_audio_licnense_file(); + + CStdString strName(strAudioCodec); + + ismd_audio_processor_t audioProcessor = -1; + ismd_audio_format_t ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_INVALID; + AUDIO_CODEC_VENDOR decoding_vendor = AUDIO_VENDOR_NONE; + + m_dwChunkSize = 8192; + m_dwBufferLen = 8192; + + bool bAC3pass = g_guiSettings.GetBool("audiooutput.ac3passthrough"); + bool bEAC3pass = g_guiSettings.GetBool("audiooutput.eac3passthrough"); + bool bTruehdPass = g_guiSettings.GetBool("audiooutput.truehdpassthrough"); + bool bDTSPass = g_guiSettings.GetBool("audiooutput.dtspassthrough"); + bool bDTSHDPass = g_guiSettings.GetBool("audiooutput.dtshdpassthrough"); + bool bUseEDID = g_guiSettings.GetBool("videoscreen.forceedid"); + + bool bHDMIPassthrough = false; + bool bSPDIFPassthrough = false; + + int audioOutputMode = g_guiSettings.GetInt("audiooutput.mode"); + bool bCanDDEncode = false; + int inputChannelConfig = AUDIO_CHAN_CONFIG_INVALID; + + m_bIsHDMI = (AUDIO_DIGITAL_HDMI == audioOutputMode); + m_bIsSPDIF = (AUDIO_DIGITAL_SPDIF == audioOutputMode); + m_bIsAnalog = (AUDIO_ANALOG == audioOutputMode); + m_bIsAllOutputs = (audioOutputMode == AUDIO_ALL_OUTPUTS); + m_bAC3Encode = false; + + bool bIsUIAudio = strName.Equals("gui", false); + bool bIsDVB = strName.Equals("dvb", false); + bool bHardwareDecoder = false; + + if(bIsUIAudio) + bIsMusic = false; + + if(m_bIsAllOutputs) + m_bIsHDMI = m_bIsSPDIF = m_bIsAnalog = true; + + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize DVB %d UI %d Music %d", bIsDVB, bIsUIAudio, bIsMusic); + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize Outputs: HDMI %d SPDIF %d I2C %d", m_bIsHDMI, m_bIsSPDIF, m_bIsAnalog); + + audioProcessor = g_IntelSMDGlobals.GetAudioProcessor(); + if(audioProcessor == -1) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize audioProcessor is not valid"); + return false; + } + + // disable all outputs + if(m_bIsHDMI) + g_IntelSMDGlobals.DisableAudioOutput(g_IntelSMDGlobals.GetHDMIOutput()); + if(m_bIsSPDIF) + g_IntelSMDGlobals.DisableAudioOutput(g_IntelSMDGlobals.GetSPDIFOutput()); + if(m_bIsAnalog) + g_IntelSMDGlobals.DisableAudioOutput(g_IntelSMDGlobals.GetI2SOutput()); + + if(bUseEDID) + { + UnloadEDID(); + (void)LoadEDID(); + } + + m_bTimed = bTimed; + + m_audioDevice = g_IntelSMDGlobals.CreateAudioInput(m_bTimed); + if(m_audioDevice == -1) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize failed to create audio input"); + return false; + } + + if(!bIsUIAudio) + g_IntelSMDGlobals.SetPrimaryAudioDevice(m_audioDevice); + + m_audioDeviceInput = g_IntelSMDGlobals.GetAudioDevicePort(m_audioDevice); + if(m_audioDeviceInput == -1) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize failed to create audio input port"); + return false; + } + + // This function will prevent bad PTS packets from dropping. + // The tradeoff is AV sync. + if (m_bTimed && !bIsDVB) + { + int ahead = 40; + int behind = 80; + result = ismd_audio_input_set_timing_accuracy(audioProcessor, m_audioDevice, + ahead, behind); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGWARNING, "CIntelSMDGlobals::InitAudio ismd_audio_input_set_timing_accuracy failed %d", result); + } + } + + // Can we do DD+ -> DD? + if (ISMD_SUCCESS == ismd_audio_codec_available((ismd_audio_format_t) ISMD_AUDIO_ENCODE_FMT_AC3)) + bCanDDEncode = true; + + ismdAudioInputFormat = GetISMDFormat(audioMediaFormat); + decoding_vendor = GetAudioCodecVendor(audioMediaFormat); + + // Can we do hardware decode? + bHardwareDecoder = (ismd_audio_codec_available(ismdAudioInputFormat) == ISMD_SUCCESS); + if(ismdAudioInputFormat == ISMD_AUDIO_MEDIA_FMT_PCM) + bHardwareDecoder = false; + + // sets some defaults + if(uiBitsPerSample == 0) + uiBitsPerSample = 16; + if (iChannels == 0) + iChannels = 2; + + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize ismdAudioInputFormat %d Hardware decoding (non PCM) %d\n", + ismdAudioInputFormat, bHardwareDecoder); + + int counter = 0; + while(counter < 5) + { + result = ismd_audio_input_set_data_format(audioProcessor, m_audioDevice, ismdAudioInputFormat); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_audio_input_set_data_format failed. retrying %d %d", counter, result); + counter++; + Sleep(100); + } + else + break; + } + + // Configure modes for CODECS + switch( audioMediaFormat ) + { + case AUDIO_MEDIA_FMT_DD: + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize DD detected"); + bHDMIPassthrough = bSPDIFPassthrough = bAC3pass; + ConfigureDolbyModes(g_IntelSMDGlobals.GetAudioProcessor(), m_audioDevice); + break; + case AUDIO_MEDIA_FMT_DD_PLUS: + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize DD Plus detected"); + + // check special case for DD+->DD using DDCO + bHDMIPassthrough = m_bIsHDMI && bEAC3pass; + if(!bEAC3pass && bAC3pass) + { + m_bAC3Encode = true; + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize EAC3->AC3 transcoding is on"); + if( iChannels > 6 ) + iChannels = 6; + bHDMIPassthrough = false; + } + ConfigureDolbyPlusModes(g_IntelSMDGlobals.GetAudioProcessor(), m_audioDevice, m_bAC3Encode); + break; + case AUDIO_MEDIA_FMT_DTS: + case AUDIO_MEDIA_FMT_DTS_LBR: + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize DTS detected"); + bHDMIPassthrough = bSPDIFPassthrough = bDTSPass; + ConfigureDTSModes(g_IntelSMDGlobals.GetAudioProcessor(), m_audioDevice); + break; + case AUDIO_MEDIA_FMT_DTS_HD: + case AUDIO_MEDIA_FMT_DTS_HD_MA: + case AUDIO_MEDIA_FMT_DTS_HD_HRA: + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize DTS-HD detected"); + bHDMIPassthrough = m_bIsHDMI && bDTSHDPass; + break; + case AUDIO_MEDIA_FMT_TRUE_HD: + CLog::Log(LOGDEBUG, "CIntelSMDAudioRenderer::Initialize TrueHD detected"); + bHDMIPassthrough = m_bIsHDMI && bTruehdPass; + ConfigureDolbyTrueHDModes(g_IntelSMDGlobals.GetAudioProcessor(), m_audioDevice); + break; + case AUDIO_MEDIA_FMT_PCM: + switch( iChannels ) + { + case 0: + case 1: + case 2: + case 4: + case 8: + m_dwChunkSize = 8 * 1024; + break; + case 3: + case 5: + case 6: + case 7: + m_dwChunkSize = iChannels * 1024; + break; + }; + if(!m_bTimed) // for music + m_dwChunkSize = 0; + inputChannelConfig = BuildChannelConfig( channelMap, iChannels ); + break; + default: + break; + } + + if (ismdAudioInputFormat == ISMD_AUDIO_MEDIA_FMT_PCM) + { + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize PCM sample size %d sample rate %d channel config 0x%8x", + uiBitsPerSample, uiSamplesPerSec, inputChannelConfig); + result = ismd_audio_input_set_pcm_format(audioProcessor, m_audioDevice, uiBitsPerSample, uiSamplesPerSec, inputChannelConfig); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize - ismd_audio_input_set_pcm_format: %d", result); + return false; + } + + + // when playing 1 channel PCM, we want to upmix this to 2 channels + if(iChannels == 1) + { + unsigned int input_channel; + unsigned int output_channel; + ismd_audio_channel_mix_config_t mix_config; + + // mute all outputs on all inputs + for(input_channel = 0; input_channel < AUDIO_MAX_INPUT_CHANNELS; input_channel++) + { + mix_config.input_channels_map[input_channel].input_channel_id = input_channel; + for(output_channel = 0; output_channel < AUDIO_MAX_OUTPUT_CHANNELS; output_channel++) + mix_config.input_channels_map[input_channel].output_channels_gain[output_channel] = -1450; // mute + } + + // unmute 0->0 and 0->2 (L and R) + mix_config.input_channels_map[0].output_channels_gain[0] = 0; + mix_config.input_channels_map[0].output_channels_gain[2] = 0; + + ismd_audio_input_set_channel_mix(audioProcessor, m_audioDevice, mix_config); + } + } + + if(m_bIsAllOutputs) + { + bHDMIPassthrough = bSPDIFPassthrough = false; + + if(audioMediaFormat == AUDIO_MEDIA_FMT_DD && bAC3pass) + bSPDIFPassthrough = true; + } + + if(bHDMIPassthrough || bSPDIFPassthrough) + { + m_dwBufferLen = 8 * 1024; + m_dwChunkSize = 0; + } + + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize HDMI passthrough %d SPDIF passthrough %d buffer size %d chunk size %d", + bHDMIPassthrough, bSPDIFPassthrough, m_dwBufferLen, m_dwChunkSize); + + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize testing audio license: channels %d vendor %d", iChannels, decoding_vendor); + g_lic_settings.ModifyAudioChannelsByLicense(iChannels, decoding_vendor); + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize after license test: channels %d", iChannels); + + // Configure output ports + if(bIsUIAudio) + { + uiBitsPerSample = 16; + uiSamplesPerSec = 48000; + } + + unsigned int outputFreq = 48000; + + // I2S. Nothing to touch here. we always use defaults + + // SPDIF + if(m_bIsSPDIF) + { + ismd_audio_output_t OutputSPDIF = g_IntelSMDGlobals.GetSPDIFOutput(); + ismd_audio_output_config_t spdif_output_config; + unsigned int samplesPerSec = uiSamplesPerSec; + unsigned int bitsPerSec = uiBitsPerSample; + if(m_bIsAllOutputs) + { + samplesPerSec = 48000; + bitsPerSec = 16; + } + + ConfigureAudioOutputParams(spdif_output_config, AUDIO_DIGITAL_SPDIF, bitsPerSec, + samplesPerSec, iChannels, ismdAudioInputFormat, bSPDIFPassthrough); + if(!g_IntelSMDGlobals.ConfigureAudioOutput(OutputSPDIF, spdif_output_config)) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize ConfigureAudioOutput SPDIF failed %d", result); + return false; + } + outputFreq = spdif_output_config.sample_rate; + } + + // HDMI + if(m_bIsHDMI && !m_bIsAllOutputs) + { + ismd_audio_output_t OutputHDMI = g_IntelSMDGlobals.GetHDMIOutput(); + ismd_audio_output_config_t hdmi_output_config; + ConfigureAudioOutputParams(hdmi_output_config, AUDIO_DIGITAL_HDMI, uiBitsPerSample, + uiSamplesPerSec, iChannels, ismdAudioInputFormat, bHDMIPassthrough); + if(!g_IntelSMDGlobals.ConfigureAudioOutput(OutputHDMI, hdmi_output_config)) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize ConfigureAudioOutput HDMI failed %d", result); + return false; + } + outputFreq = hdmi_output_config.sample_rate; + } + + // Configure the master clock frequency + + if(m_bIsAllOutputs) + outputFreq = 48000; + + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize ConfigureMasterClock %d", outputFreq); + g_IntelSMDGlobals.ConfigureMasterClock(outputFreq); + + if(bIsUIAudio) + ismd_audio_input_set_as_secondary(audioProcessor, m_audioDevice); + else if(!bIsMusic || (bIsMusic && (bHDMIPassthrough || bSPDIFPassthrough))) + { + ismd_audio_input_pass_through_config_t passthrough_config; + if (bHDMIPassthrough || bSPDIFPassthrough) + passthrough_config.is_pass_through = true; + else + passthrough_config.is_pass_through = false; + passthrough_config.dts_or_dolby_convert = false; + passthrough_config.supported_format_count = 1; + passthrough_config.supported_formats[0] = ismdAudioInputFormat; + + result = ismd_audio_input_set_as_primary(audioProcessor, m_audioDevice, passthrough_config); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize ismd_audio_input_set_as_primary failed %d", result); + return false; + } + } + + if(!g_IntelSMDGlobals.EnableAudioInput(m_audioDevice)) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize EnableAudioInput"); + return false; + } + + // enable outputs + if (m_bIsHDMI) + { + if(!g_IntelSMDGlobals.EnableAudioOutput(g_IntelSMDGlobals.GetHDMIOutput())) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize EnableAudioOutput HDMI failed"); + return false; + } + } + + if (m_bIsSPDIF) + { + if(!g_IntelSMDGlobals.EnableAudioOutput(g_IntelSMDGlobals.GetSPDIFOutput())) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize EnableAudioOutput SPDIF failed"); + return false; + } + } + + if (m_bIsAnalog) + { + if(!g_IntelSMDGlobals.EnableAudioOutput(g_IntelSMDGlobals.GetI2SOutput())) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize EnableAudioOutput I2S failed"); + return false; + } + } + + if(!m_bTimed) + { + g_IntelSMDGlobals.SetBaseTime(0); + g_IntelSMDGlobals.SetAudioDeviceState(ISMD_DEV_STATE_PLAY, m_audioDevice); + m_bFlushFlag = false; + } + else + { + //g_IntelSMDGlobals.SetAudioDeviceBaseTime(g_IntelSMDGlobals.GetBaseTime(), m_audioDevice); + g_IntelSMDGlobals.SetAudioDeviceState(ISMD_DEV_STATE_PAUSE, m_audioDevice); + m_bFlushFlag = true; + } + + m_nCurrentVolume = g_stSettings.m_nVolumeLevel; + g_IntelSMDGlobals.SetMasterVolume(m_nCurrentVolume); + + if(m_pChunksCollected) + delete m_pChunksCollected; + + m_bPause = false; + m_pChunksCollected = new unsigned char[m_dwBufferLen]; + m_first_pts = ISMD_NO_PTS; + m_lastPts = ISMD_NO_PTS; + m_ChunksCollectedSize = 0; + + m_bIsAllocated = true; + + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Initialize done"); + + return true; +} + +CIntelSMDAudioRenderer::~CIntelSMDAudioRenderer() +{ + Deinitialize(); +} + +static const int _default_channel_layouts[] = + { AUDIO_CHAN_CONFIG_2_CH, // if channel count is 0, assume stereo + AUDIO_CHAN_CONFIG_1_CH, // for PCM 1 channel we map to 2 channels + AUDIO_CHAN_CONFIG_2_CH, + 0xFFFFF210, // 3CH: Left, Center, Right + 0xFFFF4320, // 4CH: Left, Right, Left Sur, Right Sur + 0xFFF43210, // 5CH: Left, Center, Right, Left Sur, Right Sur + AUDIO_CHAN_CONFIG_6_CH, + 0xF6543210, // 7CH: Left, Center, Right, Left Sur, Right Sur, Left Rear Sur, Right Rear Sur + AUDIO_CHAN_CONFIG_8_CH + }; +//static +int CIntelSMDAudioRenderer::BuildChannelConfig( enum PCMChannels* channelMap, int iChannels ) +{ + int res = 0; + + // SMD will have major issues should this ever occur. + if( iChannels > 8 ) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::BuildChannelConfig received more than 8 channels? (%d)", iChannels); + return 0; + } + + if( !channelMap ) + { + // if we don't have a mapping, it's guesswork. how do 4ch or 5ch streams work? who knows. + // use some defaults from intel and try some other things here + // mono and stereo are probably always right, though AUDIO_CHAN_CONFIG_1_CH is configured as center-only + + res = _default_channel_layouts[iChannels]; + + if( iChannels > 2 ) + CLog::Log(LOGWARNING, "CIntelSMDAudioRenderer::BuildChannelConfig - using a default configuration for %d channels; your channel mapping may be wrong\n", iChannels); + } + else + { + int i; + bool bBackToSur = false; // if we are outputing 5.1 we may have to remap the back channels to surround + bool bUsingSides = false; // if we use the side channels this is true + bool bUsingOffC = false; // if we use left/right of center channels this is true + for( i = 0; i < iChannels; i++ ) + { + int val = -1; + + // PCM remap - we assume side channels are surrounds, but also support left/right of center being surrounds + // we can't, however, handle both channel sets being present in a stream. + switch( channelMap[i] ) + { + case PCM_FRONT_LEFT: val = ISMD_AUDIO_CHANNEL_LEFT; break; + case PCM_FRONT_RIGHT: val = ISMD_AUDIO_CHANNEL_RIGHT; break; + case PCM_FRONT_CENTER: val = (iChannels > 1) ? ISMD_AUDIO_CHANNEL_CENTER : ISMD_AUDIO_CHANNEL_LEFT; break; + case PCM_LOW_FREQUENCY: val = ISMD_AUDIO_CHANNEL_LFE; break; + case PCM_BACK_LEFT: + { + if( iChannels == 8 ) + val = ISMD_AUDIO_CHANNEL_LEFT_REAR_SUR; + else + { + val = ISMD_AUDIO_CHANNEL_LEFT_SUR; + bBackToSur = true; + } + break; + } + case PCM_BACK_RIGHT: + { + if( iChannels == 8 ) + val = ISMD_AUDIO_CHANNEL_RIGHT_REAR_SUR; + else + { + val = ISMD_AUDIO_CHANNEL_RIGHT_SUR; + bBackToSur = true; + } + break; + } + case PCM_FRONT_LEFT_OF_CENTER: val = ISMD_AUDIO_CHANNEL_LEFT_SUR; bUsingOffC = true; break; + case PCM_FRONT_RIGHT_OF_CENTER: val = ISMD_AUDIO_CHANNEL_RIGHT_SUR; bUsingOffC = true; break; + case PCM_BACK_CENTER: break; // not supported + case PCM_SIDE_LEFT: val = ISMD_AUDIO_CHANNEL_LEFT_SUR; bUsingSides = true; break; + case PCM_SIDE_RIGHT: val = ISMD_AUDIO_CHANNEL_RIGHT_SUR; bUsingSides = true; break; + case PCM_TOP_FRONT_LEFT: break; // not supported + case PCM_TOP_FRONT_RIGHT: break; // not supported + case PCM_TOP_FRONT_CENTER: break; // not supported + case PCM_TOP_CENTER: break; // not supported + case PCM_TOP_BACK_LEFT: break; // not supported + case PCM_TOP_BACK_RIGHT: break; // not supported + case PCM_TOP_BACK_CENTER: break; // not supported + default: break; + }; + + if( val == -1 ) + { + CLog::Log(LOGWARNING, "CIntelSMDAudioRenderer::BuildChannelConfig - invalid channel %d\n", channelMap[i] ); + break; + } + + if( bUsingSides && bUsingOffC ) + { + CLog::Log(LOGWARNING, "CIntelSMDAudioRenderer::BuildChannelConfig - given both side and off center channels - aborting"); + break; + } + + res |= (val << (4*i)); + } + + if( i < iChannels ) + { + // Here we have a problem. The source content has a channel layout that we couldn't convert, so at this point we are better off using a + // default channel layout. We'll never get the layout to be accurate anyways, and at least this way SMD is seeing the right amount of PCM... + CLog::Log(LOGWARNING, "CIntelSMDAudioRenderer::BuildChannelConfig - switching back to default channel layout since not all channels were found"); + res = _default_channel_layouts[iChannels]; + } + else + { + if( bBackToSur ) + { + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::BuildChannelConfig - remapping back channels to surround speakers for 5.1 audio out"); + } + // mark the remaining slots invalid + for( int i = iChannels; i < 8; i++ ) + { + res |= (ISMD_AUDIO_CHANNEL_INVALID << (i*4)); + } + } + } + + CLog::Log(LOGDEBUG, "CIntelSMDAudioRenderer::BuildChannelConfig - %d channels layed out as 0x%08x\n", iChannels, res); + return res; +} + +bool CIntelSMDAudioRenderer::Deinitialize() +{ + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Deinitialize"); + + if(!m_bIsAllocated) + return true; + + g_IntelSMDGlobals.BuildAudioOutputs(); + g_IntelSMDGlobals.ConfigureMasterClock(48000); + + g_IntelSMDGlobals.SetAudioDeviceState(ISMD_DEV_STATE_STOP, m_audioDevice); + g_IntelSMDGlobals.DisableAudioInput(m_audioDevice); + g_IntelSMDGlobals.RemoveAudioInput(m_audioDevice); + + g_IntelSMDGlobals.SetPrimaryAudioDevice(-1); + + m_audioDevice = -1; + m_audioDeviceInput = -1; + + // enable outputs + if (m_bIsHDMI) + g_IntelSMDGlobals.EnableAudioOutput(g_IntelSMDGlobals.GetHDMIOutput()); + if (m_bIsSPDIF) + g_IntelSMDGlobals.EnableAudioOutput(g_IntelSMDGlobals.GetSPDIFOutput()); + if (m_bIsAnalog) + g_IntelSMDGlobals.EnableAudioOutput(g_IntelSMDGlobals.GetI2SOutput()); + + m_bIsAllocated = false; + + return true; +} + +void CIntelSMDAudioRenderer::Flush() +{ + CLog::Log(LOGDEBUG, "CIntelSMDAudioRenderer %s", __FUNCTION__); + + g_IntelSMDGlobals.FlushAudioDevice(m_audioDevice); + + if(m_bTimed) + m_bFlushFlag = true; + + m_lastPts = ISMD_NO_PTS; + m_lastSync = ISMD_NO_PTS; +} + +void CIntelSMDAudioRenderer::Resync(double pts) +{ + +} + +bool CIntelSMDAudioRenderer::Pause() +{ + CLog::Log(LOGDEBUG, "CIntelSMDAudioRenderer %s\n", __FUNCTION__); + + // We need to wait until we're done with our packets + CSingleLock lock(m_SMDAudioLock); + + if (!m_bIsAllocated) + return false; + + if (m_bPause) + return true; + + g_IntelSMDGlobals.SetAudioDeviceState(ISMD_DEV_STATE_PAUSE, m_audioDevice); + + m_bPause = true; + + return true; +} + +//*********************************************************************************************** +bool CIntelSMDAudioRenderer::Resume() +{ + CLog::Log(LOGDEBUG, "CIntelSMDAudioRenderer %s\n", __FUNCTION__); + + if (!m_bIsAllocated) + return false; + + if(!m_bFlushFlag) + { + g_IntelSMDGlobals.SetAudioDeviceBaseTime(g_IntelSMDGlobals.GetBaseTime(), m_audioDevice); + g_IntelSMDGlobals.SetAudioDeviceState(ISMD_DEV_STATE_PLAY, m_audioDevice); + } + else + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::Resume flush flag is set, ignoring request\n"); + + m_bPause = false; + + return true; +} + +//*********************************************************************************************** +bool CIntelSMDAudioRenderer::Stop() +{ + CLog::Log(LOGDEBUG, "CIntelSMDAudioRenderer %s\n", __FUNCTION__); + + if(m_audioDevice == -1) + return true; + + g_IntelSMDGlobals.SetAudioDeviceState(ISMD_DEV_STATE_STOP, m_audioDevice); + g_IntelSMDGlobals.FlushAudioDevice(m_audioDevice); + + return true; +} + +//*********************************************************************************************** +long CIntelSMDAudioRenderer::GetCurrentVolume() const +{ + return m_nCurrentVolume; +} + +//*********************************************************************************************** +void CIntelSMDAudioRenderer::Mute(bool bMute) +{ + g_IntelSMDGlobals.Mute(bMute); +} + +//*********************************************************************************************** +bool CIntelSMDAudioRenderer::SetCurrentVolume(long nVolume) +{ + // If we fail or if we are doing passthrough, don't set + if (!m_bIsAllocated ) + return false; + + m_nCurrentVolume = nVolume; + return g_IntelSMDGlobals.SetMasterVolume(nVolume); +} + + +//*********************************************************************************************** +unsigned int CIntelSMDAudioRenderer::GetSpace() +{ + unsigned int curDepth = 0; + unsigned int maxDepth = 0; + + if (!m_bIsAllocated) + { + return 0; + } + + CSingleLock lock(m_SMDAudioLock); + + if(m_audioDeviceInput == -1) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::GetSpace - inputPort == -1"); + return 0; + } + + ismd_result_t smd_ret = g_IntelSMDGlobals.GetPortStatus(m_audioDeviceInput, curDepth, maxDepth); + + if (smd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::GetSpace - error getting port status: %d", smd_ret); + return 0; + } + + //printf("max depth = %d cur depth = %d\n", portStatus.max_depth, portStatus.cur_depth); + unsigned int result = (maxDepth - curDepth) * m_dwBufferLen; + return result; +} + +unsigned int CIntelSMDAudioRenderer::SendDataToInput(unsigned char* buffer_data, unsigned int buffer_size, ismd_pts_t local_pts) +{ + ismd_result_t smd_ret; + ismd_buffer_handle_t ismdBuffer; + ismd_es_buf_attr_t *buf_attrs; + ismd_buffer_descriptor_t ismdBufferDesc; + + //printf("audio packet size %d\n", buffer_size); + + if(m_dwBufferLen < buffer_size) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::SendDataToInput data size %d is bigger that smd buffer size %d\n", + buffer_size, m_dwBufferLen); + return 0; + } + + if(m_audioDeviceInput == -1) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::SendDataToInput - inputPort == -1"); + return 0; + } + + smd_ret = ismd_buffer_alloc(m_dwBufferLen, &ismdBuffer); + if (smd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::SendDataToInput - error allocating buffer: %d", smd_ret); + return 0; + } + + smd_ret = ismd_buffer_read_desc(ismdBuffer, &ismdBufferDesc); + if (smd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::SendDataToInput - error reading descriptor: %d", smd_ret); + ismd_buffer_dereference(ismdBuffer); + return 0; + } + + unsigned char* buf_ptr = (uint8_t *) OS_MAP_IO_TO_MEM_NOCACHE(ismdBufferDesc.phys.base, buffer_size); + if(buf_ptr == NULL) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::SendDataToInput - unable to mmap buffer %d", ismdBufferDesc.phys.base); + ismd_buffer_dereference(ismdBuffer); + return 0; + } + + memcpy(buf_ptr, buffer_data, buffer_size); + OS_UNMAP_IO_FROM_MEM(buf_ptr, buffer_size); + + ismdBufferDesc.phys.level = buffer_size; + + buf_attrs = (ismd_es_buf_attr_t *) ismdBufferDesc.attributes; + buf_attrs->original_pts = local_pts; + buf_attrs->local_pts = local_pts; + buf_attrs->discontinuity = false; + + smd_ret = ismd_buffer_update_desc(ismdBuffer, &ismdBufferDesc); + if (smd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::SendDataToInput - error updating descriptor: %d", smd_ret); + ismd_buffer_dereference(ismdBuffer); + return 0; + } + + int counter = 0; + while (counter < 20) + { + smd_ret = ismd_port_write(m_audioDeviceInput, ismdBuffer); + if (smd_ret != ISMD_SUCCESS) + { + if(g_IntelSMDGlobals.GetAudioDeviceState(m_audioDevice) != ISMD_DEV_STATE_STOP) + { + counter++; + Sleep(100); + } + else + { + break; + } + } + else + break; + } + + if(smd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::SendDataToInput failed to write buffer %d\n", smd_ret); + ismd_buffer_dereference(ismdBuffer); + buffer_size = 0; + } + + return buffer_size; +} + +//*********************************************************************************************** +unsigned int CIntelSMDAudioRenderer::AddPackets(const void* data, unsigned int len, double pts, double duration) +{ + CSingleLock lock(m_SMDAudioLock); + + ismd_pts_t local_pts = ISMD_NO_PTS; + unsigned char* pBuffer = NULL; + unsigned int total = 0; + unsigned int dataSent = 0; + if (!m_bIsAllocated) + { + CLog::Log(LOGERROR,"CIntelSMDAudioRenderer::AddPackets - sanity failed. no valid play handle!"); + return len; + } + + // don't do anything if demuxer is connected directly to decoder + if(g_IntelSMDGlobals.IsDemuxToAudio()) + return len; + + if (m_bTimed) + { + local_pts = g_IntelSMDGlobals.DvdToIsmdPts(pts); + } + + if(m_bFlushFlag && m_bTimed) + { + ismd_pts_t startPTS; + + if(g_IntelSMDGlobals.GetAudioStartPts() != ISMD_NO_PTS) + startPTS = g_IntelSMDGlobals.GetAudioStartPts(); + else + startPTS = local_pts; + + if(g_IntelSMDGlobals.GetFlushFlag()) + { + g_IntelSMDGlobals.SetBaseTime(g_IntelSMDGlobals.GetCurrentTime()); + g_IntelSMDGlobals.SetFlushFlag(false); + } + + g_IntelSMDGlobals.SetAudioStartPts(startPTS); + g_IntelSMDGlobals.SetAudioDeviceBaseTime(g_IntelSMDGlobals.GetBaseTime(), m_audioDevice); + g_IntelSMDGlobals.SendStartPacket(startPTS, m_audioDeviceInput); + g_IntelSMDGlobals.SetAudioDeviceState(ISMD_DEV_STATE_PLAY, m_audioDevice); + + // data for small chunks collection + m_ChunksCollectedSize = 0; + m_bFlushFlag = false; + } + + pBuffer = (unsigned char*)data; + total = len; + + // What's the maximal write size - either a chunk if provided, or the full buffer + unsigned int block_size = (m_dwChunkSize ? m_dwChunkSize : m_dwBufferLen); + + //printf("len %d chunksize %d m_bTimed %d\n", len, m_dwChunkSize, m_bTimed); + + while (len && len >= m_dwChunkSize) // We want to write at least one chunk at a time + { + unsigned int bytes_to_copy = len > block_size ? block_size : len; + + //printf("bytes_to_copy %d block size %d m_ChunksCollectedSize %d\n", bytes_to_copy, block_size, m_ChunksCollectedSize); + + // If we've written a frame with this pts, don't write another + if(local_pts == m_lastPts) + { + local_pts = ISMD_NO_PTS; + } + + if(m_ChunksCollectedSize == 0) + m_first_pts = local_pts; + + // collect data to avoid small chunks + if (m_bTimed) + { + if (m_ChunksCollectedSize + bytes_to_copy <= m_dwBufferLen) + { + memcpy(m_pChunksCollected + m_ChunksCollectedSize, pBuffer, + bytes_to_copy); + } + else + { + //printf("Audio Packet: PTS %lld (0x%09lx) size %d\n", m_first_pts, m_first_pts, m_ChunksCollectedSize); + SendDataToInput(m_pChunksCollected, m_ChunksCollectedSize, m_first_pts); + memcpy(m_pChunksCollected, pBuffer, bytes_to_copy); + m_ChunksCollectedSize = 0; + m_first_pts = local_pts; + } + m_ChunksCollectedSize += bytes_to_copy; + dataSent = bytes_to_copy; + } + else + { + dataSent = SendDataToInput(pBuffer, bytes_to_copy, local_pts); + } + + if(dataSent != bytes_to_copy) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::AddPackets SendDataToInput failed. req %d actual %d", len, dataSent); + return 0; + } + + pBuffer += dataSent; // Update buffer pointer + len -= dataSent; // Update remaining data len + + if( local_pts != ISMD_NO_PTS ) + m_lastPts = local_pts; + } + + return total - len; // Bytes used +} + +//*********************************************************************************************** +float CIntelSMDAudioRenderer::GetDelay() +{ + return 0.0f; +} + +float CIntelSMDAudioRenderer::GetCacheTime() +{ + unsigned int curDepth = 0; + unsigned int maxDepth = 0; + + if (!m_bIsAllocated) + { + return 0.0f; + } + + if(m_audioDeviceInput == -1) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::GetCacheTime - inputPort == -1"); + return 0; + } + + CSingleLock lock(m_SMDAudioLock); + + ismd_result_t smd_ret = g_IntelSMDGlobals.GetPortStatus(m_audioDeviceInput, curDepth, maxDepth); + + if (smd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::GetCacheTime - error getting port status: %d", smd_ret); + return 0; + } + + float result = ((float) (curDepth * m_dwBufferLen)); + + return result; +} + +unsigned int CIntelSMDAudioRenderer::GetChunkLen() +{ + return m_dwChunkSize; +} + +int CIntelSMDAudioRenderer::SetPlaySpeed(int iSpeed) +{ + return 0; +} + +void CIntelSMDAudioRenderer::RegisterAudioCallback(IAudioCallback *pCallback) +{ + m_pCallback = pCallback; +} + +void CIntelSMDAudioRenderer::UnRegisterAudioCallback() +{ + m_pCallback = NULL; +} + +void CIntelSMDAudioRenderer::WaitCompletion() +{ + unsigned int curDepth = 0; + unsigned int maxDepth = 0; + + if (!m_bIsAllocated || m_bPause) + return; + + if(m_audioDeviceInput == -1) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::GetSpace - inputPort == -1"); + return; + } + + CSingleLock lock(m_SMDAudioLock); + + ismd_result_t smd_ret = g_IntelSMDGlobals.GetPortStatus(m_audioDeviceInput, curDepth, maxDepth); + if (smd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::WaitCompletion - error getting port status: %d", smd_ret); + return; + } + + while (curDepth != 0) + { + usleep(5000); + + ismd_result_t smd_ret = g_IntelSMDGlobals.GetPortStatus(m_audioDeviceInput, curDepth, maxDepth); + if (smd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::WaitCompletion - error getting port status: %d", smd_ret); + return; + } + } +} + +void CIntelSMDAudioRenderer::SwitchChannels(int iAudioStream, bool bAudioOnAllSpeakers) +{ + return; +} + +// Based on ismd examples +bool CIntelSMDAudioRenderer::LoadEDID() +{ + bool ret = false; + gdl_hdmi_audio_ctrl_t ctrl; + edidHint** cur = &m_edidTable; + + // Set up our control + ctrl.cmd_id = GDL_HDMI_AUDIO_GET_CAPS; + ctrl.data._get_caps.index = 0; + + while( gdl_port_recv(GDL_PD_ID_HDMI, GDL_PD_RECV_HDMI_AUDIO_CTRL, &ctrl, sizeof(ctrl)) == GDL_SUCCESS ) + { + edidHint* hint = new edidHint; + if( !hint ) return false; + + ret = true; + + hint->format = MapGDLAudioFormat( (gdl_hdmi_audio_fmt_t)ctrl.data._get_caps.cap.format ); + if( ISMD_AUDIO_MEDIA_FMT_INVALID == hint->format ) + { + delete hint; + ctrl.data._get_caps.index++; + continue; + } + else + { + // For any formats we support bitstreaming on, flag them in the smdglobals here + switch( hint->format ) + { + case ISMD_AUDIO_MEDIA_FMT_DD: + //g_IntelSMDGlobals.SetCodecHDMIBitstream( CODEC_ID_AC3, true); + break; + case ISMD_AUDIO_MEDIA_FMT_DD_PLUS: + //g_IntelSMDGlobals.SetCodecHDMIBitstream( CODEC_ID_EAC3, true ); + break; + case ISMD_AUDIO_MEDIA_FMT_TRUE_HD: + //g_IntelSMDGlobals.SetCodecHDMIBitstream( CODEC_ID_TRUEHD, true ); + break; + case ISMD_AUDIO_MEDIA_FMT_DTS: + //g_IntelSMDGlobals.SetCodecHDMIBitstream( CODEC_ID_DTS, true ); + break; + case ISMD_AUDIO_MEDIA_FMT_DTS_HD_MA: + //g_IntelSMDGlobals.SetCodecHDMIBitstream( SMD_CODEC_DTSHD, true ); + break; + default: + break; + }; + } + + hint->channels = (int)ctrl.data._get_caps.cap.max_channels; + hint->sample_rates = (unsigned char) (ctrl.data._get_caps.cap.fs & 0x7f); + if( ISMD_AUDIO_MEDIA_FMT_PCM == hint->format ) + { + hint->sample_sizes = (ctrl.data._get_caps.cap.ss_bitrate & 0x07); + if( hint->sample_sizes & 0x04 ) + hint->sample_sizes |= 0x08; // if we support 24, we support 32. + } + else + hint->sample_sizes = 0; + + *cur = hint; + cur = &( hint->next ); + + // get the next block + ctrl.data._get_caps.index++; + } + + *cur = NULL; + + DumpEDID(); + + return ret; +} +void CIntelSMDAudioRenderer::UnloadEDID() +{ + while( m_edidTable ) + { + edidHint* nxt = m_edidTable->next; + delete[] m_edidTable; + m_edidTable = nxt; + } +} +void CIntelSMDAudioRenderer::DumpEDID() +{ + char* formats[] = {"invalid","LPCM","DVDPCM","BRPCM","MPEG","AAC","AACLOAS","DD","DD+","TrueHD","DTS-HD","DTS-HD-HRA","DTS-HD-MA","DTS","DTS-LBR","WM9"}; + CLog::Log(LOGINFO,"HDMI Audio sink supports the following formats:\n"); + for( edidHint* cur = m_edidTable; cur; cur = cur->next ) + { + CStdString line; + line.Format("* Format: %s Max channels: %d Samplerates: ", formats[cur->format], cur->channels); + + for( int z = 0; z < sizeof(s_edidRates); z++ ) + { + if( cur->sample_rates & (1<format ) + { + line.AppendFormat("Sample Sizes: "); + for( int z = 0; z< sizeof(s_edidSampleSizes); z++ ) + { + if( cur->sample_sizes & (1<next ) + { + bool bSuggested = false; + + // Check by format and channels + if( cur->format != format ) + continue; + + bFormatSupported = true; + + // Right format. See if the proper channel count is reflected + // if not, we'll suggest a resample + // if so, we update our suggestions to reflect this format entry + if( cur->channels < iChannels ) + { + suggChannels = cur->channels; + bSuggested = true; + } + else + { + suggChannels = iChannels; + suggSampleRate = uiSampleRate; + suggSampleSize = uiSampleSize; + } + + // Next, see if the sample rate is supported + for( int z = 0; z < sizeof(s_edidRates); z++ ) + { + if( s_edidRates[z] == uiSampleRate ) + { + if( !(cur->sample_rates & (1<sample_rates & 4) ) + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize - your audio sink indicates it doesn't support 48khz"); + suggSampleRate = 48000; + bSuggested = true; + } + break; + } + } + + // Last, see if the sample size is supported for PCM + if( ISMD_AUDIO_MEDIA_FMT_PCM == format ) + { + for( int y = 0; y < sizeof(s_edidSampleSizes); y++ ) + { + if( s_edidSampleSizes[y] == uiSampleSize ) + { + if( !(cur->sample_sizes & (1<sample_rates & 1) ) + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize - your audio sink indicates it doesn't support 16bit/sample"); + suggSampleSize = 16; + bSuggested = true; + } + break; + } + } + } + + // If we didn't make any suggestions, then this was a match; exit out + if( !bSuggested ) + { + bFullMatch = true; + break; + } + } + + if( bFormatSupported ) + { + if( bFullMatch ) + { + return true; + } + else + { + uiSampleRate = suggSampleRate; + uiSampleSize = suggSampleSize; + iChannels = suggChannels; + } + } + return false; +} + +//static +ismd_audio_format_t CIntelSMDAudioRenderer::MapGDLAudioFormat( gdl_hdmi_audio_fmt_t f ) +{ + ismd_audio_format_t result = ISMD_AUDIO_MEDIA_FMT_INVALID; + switch(f) + { + case GDL_HDMI_AUDIO_FORMAT_PCM: + result = ISMD_AUDIO_MEDIA_FMT_PCM; + break; + case GDL_HDMI_AUDIO_FORMAT_MPEG1: + case GDL_HDMI_AUDIO_FORMAT_MPEG2: + case GDL_HDMI_AUDIO_FORMAT_MP3: + result = ISMD_AUDIO_MEDIA_FMT_MPEG; + break; + case GDL_HDMI_AUDIO_FORMAT_AAC: + result = ISMD_AUDIO_MEDIA_FMT_AAC; + break; + case GDL_HDMI_AUDIO_FORMAT_DTS: + result = ISMD_AUDIO_MEDIA_FMT_DTS; + break; + case GDL_HDMI_AUDIO_FORMAT_AC3: + result = ISMD_AUDIO_MEDIA_FMT_DD; + break; + case GDL_HDMI_AUDIO_FORMAT_DDP: + result = ISMD_AUDIO_MEDIA_FMT_DD_PLUS; + break; + case GDL_HDMI_AUDIO_FORMAT_DTSHD: + result = ISMD_AUDIO_MEDIA_FMT_DTS_HD_MA; + break; + case GDL_HDMI_AUDIO_FORMAT_MLP: + result = ISMD_AUDIO_MEDIA_FMT_TRUE_HD; + break; + case GDL_HDMI_AUDIO_FORMAT_WMA_PRO: + result = ISMD_AUDIO_MEDIA_FMT_WM9; + break; + default: + break; + + }; + return result; +} + +void CIntelSMDAudioRenderer::ConfigureDolbyModes(ismd_audio_processor_t proc_handle, ismd_dev_t input_handle) +{ + ismd_result_t result; + ismd_audio_decoder_param_t param; + + // Dolby DD is downmix to Lt/Rt and not Lo/Ro + ismd_audio_ac3_stereo_output_mode_t *stereo_mode_dd = (ismd_audio_ac3_stereo_output_mode_t *)¶m; + *stereo_mode_dd = ISMD_AUDIO_AC3_STEREO_OUTPUT_MODE_SURROUND_COMPATIBLE; + CLog::Log(LOGNONE, "ConfigureDolbyModes ISMD_AUDIO_AC3_STEREO_OUTPUT_MODE %d", *stereo_mode_dd); + result = ismd_audio_input_set_decoder_param( proc_handle, input_handle, + ISMD_AUDIO_AC3_STEREO_OUTPUT_MODE, ¶m ); + + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConfigureDolbyModes ISMD_AUDIO_AC3_STEREO_OUTPUT_MODE_SURROUND_COMPATIBLE failed %d", + result); + } + + // DD works in 2 channels output mode + ismd_audio_ac3_num_output_channels_t *num_of_ch = (ismd_audio_ac3_num_output_channels_t *) ¶m; + *num_of_ch = 2; + CLog::Log(LOGNONE, "ConfigureDolbyModes ISMD_AUDIO_AC3_NUM_OUTPUT_CHANNELS %d", *num_of_ch); + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, ISMD_AUDIO_AC3_NUM_OUTPUT_CHANNELS, ¶m); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConfigureDolbyModes ISMD_AUDIO_AC3_NUM_OUTPUT_CHANNELS failed %d", result); + } + + // Output configuration for DD + ismd_audio_ac3_output_configuration_t *output_config = (ismd_audio_ac3_output_configuration_t *) ¶m; + *output_config = ISMD_AUDIO_AC3_OUTPUT_CONFIGURATION_2_0_LR; + CLog::Log(LOGNONE, "ConfigureDolbyModes ISMD_AUDIO_AC3_OUTPUT_CONFIGURATION_2_0_LR %d", *output_config); + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, ISMD_AUDIO_AC3_OUTPUT_CONFIGURATION, ¶m); + if (result != ISMD_SUCCESS) + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConfigureDolbyModes ISMD_AUDIO_AC3_NUM_OUTPUT_CHANNELS failed %d", result); + + // Configure DD channels layout + ismd_audio_ac3_channel_route_t *channel_route = (ismd_audio_ac3_channel_route_t *) ¶m; + result = ISMD_SUCCESS; + + *channel_route = 0; + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, ISMD_AUDIO_AC3_CHANNEL_ROUTE_L, ¶m); + *channel_route = 1; + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, ISMD_AUDIO_AC3_CHANNEL_ROUTE_R, ¶m); + *channel_route = -1; + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, ISMD_AUDIO_AC3_CHANNEL_ROUTE_Ls, ¶m); + *channel_route = -1; + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, ISMD_AUDIO_AC3_CHANNEL_ROUTE_Rs, ¶m); + *channel_route = -1; + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, ISMD_AUDIO_AC3_CHANNEL_ROUTE_C, ¶m); + *channel_route = -1; + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, ISMD_AUDIO_AC3_CHANNEL_ROUTE_LFE, ¶m); + + if(result != ISMD_SUCCESS) + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConfigureDolbyModes ISMD_AUDIO_AC3_CHANNEL_ROUTE_* failed %d", result); +} + +void CIntelSMDAudioRenderer::ConfigureDolbyPlusModes(ismd_audio_processor_t proc_handle, ismd_dev_t input_handle, bool bAC3Encode) +{ + ismd_result_t result; + ismd_audio_decoder_param_t param; + + //DD+ we need to operate in 5.1 decoding mode and avoid decoding extension channels. + ismd_audio_ddplus_num_output_channels_t *num_of_ch = (ismd_audio_ddplus_num_output_channels_t *) ¶m; + if(bAC3Encode) + *num_of_ch = ISMD_AUDIO_DDPLUS_MAX_NUM_OUTPUT_CHANNELS; + else + *num_of_ch = 6; + CLog::Log(LOGNONE, "ConfigureDolbyPlusModes ISMD_AUDIO_DDPLUS_NUM_OUTPUT_CHANNELS %d", *num_of_ch); + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, ISMD_AUDIO_DDPLUS_NUM_OUTPUT_CHANNELS, ¶m); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConfigureDolbyPlusModes ISMD_AUDIO_DDPLUS_NUM_OUTPUT_CHANNELS failed %d", result); + } + + ismd_audio_ddplus_lfe_channel_output_t *lfe_control = (ismd_audio_ddplus_lfe_channel_output_t *) ¶m; + if(bAC3Encode) + *lfe_control = ISMD_AUDIO_DDPLUS_LFE_CHANNEL_OUTPUT_ENABLED; + else + *lfe_control = (ismd_audio_ddplus_lfe_channel_output_t)g_guiSettings.GetInt("audiooutput.ddplus_lfe_channel_config"); + CLog::Log(LOGNONE, "ConfigureDolbyPlusModes ISMD_AUDIO_DDPLUS_LFE_CHANNEL_OUTPUT %d", *lfe_control); + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, ISMD_AUDIO_DDPLUS_LFE_CHANNEL_OUTPUT, ¶m); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConfigureDolbyPlusModes ISMD_AUDIO_DDPLUS_LFE_CHANNEL_OUTPUT failed %d", result); + } + + // Dolby DD+ is downmix to Lt/Rt and not Lo/Ro + ismd_audio_ddplus_stereo_output_mode_t *stereo_mode_ddplus = (ismd_audio_ddplus_stereo_output_mode_t *) ¶m; + *stereo_mode_ddplus = ISMD_AUDIO_DDPLUS_STEREO_OUTPUT_MODE_SURROUND_COMPATIBLE; + CLog::Log(LOGNONE, "ConfigureDolbyPlusModes ISMD_AUDIO_DDPLUS_STEREO_OUTPUT_MODE_SURROUND_COMPATIBLE %d", *stereo_mode_ddplus); + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, ISMD_AUDIO_DDPLUS_STEREO_OUTPUT_MODE, ¶m); + + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConfigureDolbyPlusModes ISMD_AUDIO_DDPLUS_STEREO_OUTPUT_MODE_SURROUND_COMPATIBLE failed %d", result); + } + + ismd_audio_ddplus_output_configuration_t *output_config_ddplus = (ismd_audio_ddplus_output_configuration_t *) ¶m; + *output_config_ddplus = (ismd_audio_ddplus_output_configuration_t)g_guiSettings.GetInt("audiooutput.ddplus_output_config"); + if(bAC3Encode) // if the output will be rencode to AC3, output all 5 channels + *output_config_ddplus = ISMD_AUDIO_DDPLUS_OUTPUT_CONFIGURATION_3_2_1_LCRlrTs; + CLog::Log(LOGNONE, "ConfigureDolbyPlusModes ISMD_AUDIO_DDPLUS_OUTPUT_CONFIGURATION %d", *output_config_ddplus); + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, ISMD_AUDIO_DDPLUS_OUTPUT_CONFIGURATION, ¶m); + + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConfigureDolbyPlusModes ISMD_AUDIO_DDPLUS_OUTPUT_CONFIGURATION failed %d", result); + } +} + +void CIntelSMDAudioRenderer::ConfigureDolbyTrueHDModes(ismd_audio_processor_t proc_handle, ismd_dev_t input_handle) +{ + ismd_result_t result; + ismd_audio_decoder_param_t param; + + int drcmode = g_guiSettings.GetInt("audiooutput.dd_truehd_drc"); + int drc_percent = g_guiSettings.GetInt("audiooutput.dd_truehd_drc_percentage"); + + //Dolby TrueHD DRC is on by default. We require the ability to set it off and auto mode. + // This command sets the DRC mode: 0 off, 1 auto (default), 2 forced. + ismd_audio_truehd_drc_enable_t *drc_control = + (ismd_audio_truehd_drc_enable_t *) ¶m; + + if (drcmode == DD_TRUEHD_DRC_AUTO) + *drc_control = 1; // Set to auto + else if (drcmode == DD_TRUEHD_DRC_OFF) + *drc_control = 0; + else if (drcmode == DD_TRUEHD_DRC_ON) + *drc_control = 2; + CLog::Log(LOGNONE, "ConfigureDolbyTrueHDModes ISMD_AUDIO_TRUEHD_DRC_ENABLE %d", *drc_control); + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, + ISMD_AUDIO_TRUEHD_DRC_ENABLE, ¶m); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConfigureDolbyTrueHDModes ISMD_AUDIO_TRUEHD_DRC_ENABLE failed %d", result); + } + + if (drcmode == DD_TRUEHD_DRC_ON) + { + ismd_audio_truehd_drc_boost_t *dobly_drc_percent = (ismd_audio_truehd_drc_enable_t *) ¶m; + *dobly_drc_percent = drc_percent; + + CLog::Log(LOGNONE, "ConfigureDolbyTrueHDModes ISMD_AUDIO_TRUEHD_DRC_BOOST %d", *dobly_drc_percent); + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, + ISMD_AUDIO_TRUEHD_DRC_BOOST, ¶m); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConfigureDolbyTrueHDModes ISMD_AUDIO_TRUEHD_DRC_BOOST failed %d", result); + } + } + + //Dolby TrueHD 2 channels presentation decoding. We need to decode this properly. + //Instead we decode the multi-channel presentation and downmix to 2 channels. + + /* This command sets the decode_mode and configures the decoder as a two-, six- or eight-channel decoder. Valid values are 2, 6, and 8 (default)*/ + ismd_audio_truehd_decode_mode_t *decode_control = + (ismd_audio_truehd_decode_mode_t *) ¶m; + *decode_control = 2; // Set to 2 channel + CLog::Log(LOGNONE, "ConfigureDolbyTrueHDModes ISMD_AUDIO_TRUEHD_DECODE_MODE %d", *decode_control); + result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, + ISMD_AUDIO_TRUEHD_DECODE_MODE, ¶m); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConfigureDolbyTrueHDModes ISMD_AUDIO_TRUEHD_DECODE_MODE failed %d", result); + } + +} + +void CIntelSMDAudioRenderer::ConfigureDTSModes( + ismd_audio_processor_t proc_handle, ismd_dev_t input_handle) +{ + ismd_result_t result; + ismd_audio_decoder_param_t dec_param; + + + //please set downmix_mode as ISMD_AUDIO_DTS_DOWNMIX_MODE_INTERNAL + /* Valid values: "ISMD_AUDIO_DTS_DOWNMIX_MODE_EXTERNAL" | "ISMD_AUDIO_DTS_DOWNMIX_MODE_INTERNAL" */ + { + /* Set the downmix mode parameter for DTS core decoder. */ + ismd_audio_dts_downmix_mode_t *param = (ismd_audio_dts_downmix_mode_t *) &dec_param; + *param = ISMD_AUDIO_DTS_DOWNMIX_MODE_INTERNAL; + CLog::Log(LOGNONE, "ConfigureDTSModes ISMD_AUDIO_DTS_DOWNMIXMODE %d", *param); + if ((result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, + ISMD_AUDIO_DTS_DOWNMIXMODE, &dec_param)) != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "Setting the downmix mode on DTS CORE decoder failed %d", result); + } + } + + //please set speaker_out as 2 /* Please see ismd_audio_dts for acceptable values.(0 = default spkr out)*/ + { + /* Set the Speaker output configuration of the DTS core decoder. */ + ismd_audio_dts_speaker_output_configuration_t *param = (ismd_audio_dts_speaker_output_configuration_t *) &dec_param; + *param = 2; + CLog::Log(LOGNONE, "ConfigureDTSModes ISMD_AUDIO_DTS_SPKROUT %d", *param); + if ((result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, + ISMD_AUDIO_DTS_SPKROUT, &dec_param)) != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "Setting the speaker output mode on DTS CORE decoder failed %d", result); + } + } + // please set dynamic_range_percent as 0 /* Valid values: 0 - 100*/ + { + /* Set the DRC percent of the DTS core decoder. */ + ismd_audio_dts_dynamic_range_compression_percent_t *param = (ismd_audio_dts_dynamic_range_compression_percent_t *) &dec_param; + *param = 0; + CLog::Log(LOGNONE, "ConfigureDTSModes ISMD_AUDIO_DTS_DRCPERCENT %d", *param); + if ((result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, + ISMD_AUDIO_DTS_DRCPERCENT, &dec_param)) != ISMD_SUCCESS) + { + CLog::Log(LOGERROR,"Setting the DRC percent on DTS CORE decoder failed %d", result); + } + } + + // please set number_output_channels as 2 /* Valid values: Specify number of output channels 1 - 6.*/ + { + /* Set the number of output channels of the DTS core decoder. */ + ismd_audio_dts_num_output_channels_t *param = (ismd_audio_dts_num_output_channels_t *) &dec_param; + *param = 2; + CLog::Log(LOGNONE, "ConfigureDTSModes ISMD_AUDIO_DTS_NUM_OUTPUT_CHANNELS %d", *param); + if ((result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, + ISMD_AUDIO_DTS_NUM_OUTPUT_CHANNELS, &dec_param)) != ISMD_SUCCESS) + { + CLog::Log(LOGERROR,"Setting the num output channels on DTS CORE decoder failed %d", result); + } + } + // please set lfe_downmix as ISMD_AUDIO_DTS_LFE_DOWNMIX_NONE + /* Valid values: "ISMD_AUDIO_DTS_LFE_DOWNMIX_NONE" | "ISMD_AUDIO_DTS_LFE_DOWNMIX_10DB" */ + { + /* Set the LFE downmix setting of the DTS core decoder. */ + int *param = (int *) &dec_param; + *param = ISMD_AUDIO_DTS_LFE_DOWNMIX_NONE; + CLog::Log(LOGNONE, "ConfigureDTSModes ISMD_AUDIO_DTS_LFEDNMX %d", *param); + if ((result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, + ISMD_AUDIO_DTS_LFEDNMX, &dec_param)) != ISMD_SUCCESS) + { + CLog::Log(LOGERROR,"Setting the LFE downmix on DTS CORE decoder failed %d", result); + } + } + + // please set sec_audio_scale as 0 /* Valid values: 0 | 1 */ + { + /* Set the LFE downmix setting of the DTS core decoder. */ + ismd_audio_dts_secondary_audio_scale_t *param = (ismd_audio_dts_secondary_audio_scale_t *) &dec_param; + *param = 0; + CLog::Log(LOGNONE, "ConfigureDTSModes ISMD_AUDIO_DTS_SEC_AUD_SCALING %d", *param); + if ((result = ismd_audio_input_set_decoder_param(proc_handle, input_handle, + ISMD_AUDIO_DTS_SEC_AUD_SCALING, &dec_param)) != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "Setting the secondary audio scaling on DTS CORE decoder failed %d", result); + } + } +} + + +ismd_audio_format_t CIntelSMDAudioRenderer::GetISMDFormat(AudioMediaFormat audioMediaFormat) +{ + ismd_audio_format_t ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_INVALID; + + switch (audioMediaFormat) + { + case AUDIO_MEDIA_FMT_PCM: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_PCM; + break; + case AUDIO_MEDIA_FMT_DVD_PCM: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_DVD_PCM; + break; + case AUDIO_MEDIA_FMT_BLURAY_PCM: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_BLURAY_PCM; + break; + case AUDIO_MEDIA_FMT_MPEG: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_MPEG; + break; + case AUDIO_MEDIA_FMT_AAC: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_AAC; + break; + case AUDIO_MEDIA_FMT_AAC_LOAS: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_AAC_LOAS; + break; + case AUDIO_MEDIA_FMT_AAC_LATM: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_AAC_LOAS; + break; + case AUDIO_MEDIA_FMT_DD: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_DD; + break; + case AUDIO_MEDIA_FMT_DD_PLUS: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_DD_PLUS; + break; + case AUDIO_MEDIA_FMT_TRUE_HD: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_TRUE_HD; + break; + case AUDIO_MEDIA_FMT_DTS_HD: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_DTS_HD; + break; + case AUDIO_MEDIA_FMT_DTS_HD_HRA: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_DTS_HD_HRA; + break; + case AUDIO_MEDIA_FMT_DTS_HD_MA: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_DTS_HD_MA; + break; + case AUDIO_MEDIA_FMT_DTS: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_DTS; + break; + case AUDIO_MEDIA_FMT_DTS_LBR: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_DTS_LBR; + break; + case AUDIO_MEDIA_FMT_WM9: + ismdAudioInputFormat = ISMD_AUDIO_MEDIA_FMT_WM9; + break; + default: + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::GetISMDFormat - unknown audio media format requested"); + return ISMD_AUDIO_MEDIA_FMT_INVALID; + } + + return ismdAudioInputFormat; +} + +AUDIO_CODEC_VENDOR CIntelSMDAudioRenderer::GetAudioCodecVendor(AudioMediaFormat format) +{ + AUDIO_CODEC_VENDOR decoding_vendor = AUDIO_VENDOR_NONE; + + switch(format) + { + case AUDIO_MEDIA_FMT_DD: + decoding_vendor = AUDIO_VENDOR_DOLBY; + break; + case AUDIO_MEDIA_FMT_DD_PLUS: + decoding_vendor = AUDIO_VENDOR_DOLBY; + break; + case AUDIO_MEDIA_FMT_TRUE_HD: + decoding_vendor = AUDIO_VENDOR_DOLBY; + break; + case AUDIO_MEDIA_FMT_DTS_HD: + decoding_vendor = AUDIO_VENDOR_DTS; + break; + case AUDIO_MEDIA_FMT_DTS_HD_HRA: + decoding_vendor = AUDIO_VENDOR_DTS; + break; + case AUDIO_MEDIA_FMT_DTS_HD_MA: + decoding_vendor = AUDIO_VENDOR_DTS; + break; + case AUDIO_MEDIA_FMT_DTS: + decoding_vendor = AUDIO_VENDOR_DTS; + break; + case AUDIO_MEDIA_FMT_DTS_LBR: + decoding_vendor = AUDIO_VENDOR_DTS; + break; + default: + break; + } + + return decoding_vendor; +} + +void CIntelSMDAudioRenderer::ConfigureAudioOutputParams(ismd_audio_output_config_t& output_config, int output, + int sampleSize, int sampleRate, int channels, ismd_audio_format_t format, bool bPassthrough) +{ + bool bUseEDID = g_guiSettings.GetBool("videoscreen.forceedid"); + bool bLPCMMode = g_guiSettings.GetBool("audiooutput.lpcm71passthrough"); + + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::ConfigureAudioOutputParams %s sample size %d sample rate %d channels %d format %d", + output == AUDIO_DIGITAL_HDMI ? "HDMI" : "SPDIF", sampleSize, sampleRate, channels, format); + + SetDefaultOutputConfig(output_config); + + if(sampleRate == 24000) + sampleRate = 48000; + + if (bPassthrough) + { + output_config.out_mode = ISMD_AUDIO_OUTPUT_PASSTHROUGH; + } + else if (m_bAC3Encode) + { + output_config.out_mode = ISMD_AUDIO_OUTPUT_ENCODED_DOLBY_DIGITAL; + } + + if(output == AUDIO_DIGITAL_HDMI) + { + // We need to match input to output freq on HDMI + // We only do this if we have edid info + // Last item - if we have audio data from EDID and are on HDMI, then validate the output + unsigned int suggSampleRate = sampleRate; + unsigned int suggSampleSize = sampleSize; + int suggChannels = channels; + + if (bUseEDID) + { + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::ConfigureAudioOutputParams Testing EDID for sample rate %d sample size %d", suggSampleRate, suggSampleSize); + if (CheckEDIDSupport(bPassthrough ? format : ISMD_AUDIO_MEDIA_FMT_PCM, suggChannels, suggSampleRate, suggSampleSize)) + { + output_config.sample_rate = suggSampleRate; + output_config.sample_size = suggSampleSize; + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::ConfigureAudioOutputParams EDID results sample rate %d sample size %d", suggSampleRate, suggSampleSize); + } else + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::ConfigureAudioOutputParams no EDID support found"); + } + else + { + sampleRate = 48000; + sampleSize = 16; + } + if(bLPCMMode && !m_bIsAllOutputs) + { + if(channels == 8) + output_config.ch_config = ISMD_AUDIO_7_1; + else if(channels == 6) + output_config.ch_config = ISMD_AUDIO_5_1; + } + + if(sampleRate == 48000 || sampleRate == 96000 || sampleRate == 32000 || sampleRate == 44100 + || sampleRate == 88200 || sampleRate == 176400 || sampleRate == 192000) + output_config.sample_rate = sampleRate; + if(sampleSize == 16 || sampleSize == 20 || sampleSize == 24 || sampleSize == 32) + output_config.sample_size = sampleSize; + } // HDMI + + + if(output == AUDIO_DIGITAL_SPDIF) + { + if(sampleRate == 48000 || sampleRate == 96000 || sampleRate == 32000 || sampleRate == 44100 || sampleRate == 88200) + output_config.sample_rate = sampleRate; + if(sampleSize == 16 || sampleSize == 20 || sampleSize == 24) + output_config.sample_size = sampleSize; + } // SPDIF + + CLog::Log(LOGINFO, "CIntelSMDAudioRenderer::ConfigureAudioOutputParams stream_delay %d sample_size %d \ +ch_config %d out_mode %d sample_rate %d ch_map %d", + output_config.stream_delay, output_config.sample_size, output_config.ch_config, + output_config.out_mode, output_config.sample_rate, output_config.ch_map); +} + +void CIntelSMDAudioRenderer::SetDefaultOutputConfig(ismd_audio_output_config_t& output_config) +{ + output_config.ch_config = ISMD_AUDIO_STEREO; + output_config.ch_map = 0; + output_config.out_mode = ISMD_AUDIO_OUTPUT_PCM; + output_config.sample_rate = 48000; + output_config.sample_size = 16; + output_config.stream_delay = 0; +} + +#endif diff --git a/xbmc/cores/AudioRenderers/IntelSMDAudioRenderer.h b/xbmc/cores/AudioRenderers/IntelSMDAudioRenderer.h new file mode 100644 index 00000000..e479431a --- /dev/null +++ b/xbmc/cores/AudioRenderers/IntelSMDAudioRenderer.h @@ -0,0 +1,168 @@ +/* +* Boxee +* Copyright (c) 2009, Boxee Inc. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef __INTEL_SMD_AUDIO_RENDERER_H__ +#define __INTEL_SMD_AUDIO_RENDERER_H__ + +#include "system.h" + +#ifdef HAS_INTEL_SMD + +#include "IAudioRenderer.h" +#include "IAudioCallback.h" +#include "../ssrc.h" +#include "utils/SingleLock.h" +#include +#include +#include + +#include "LicenseConfig.h" + +extern void RegisterAudioCallback(IAudioCallback* pCallback); +extern void UnRegisterAudioCallback(); + + +class CIntelSMDAudioRenderer : public IAudioRenderer +{ +public: + virtual void UnRegisterAudioCallback(); + virtual void RegisterAudioCallback(IAudioCallback* pCallback); + virtual unsigned int GetChunkLen(); + virtual float GetDelay(); + virtual float GetCacheTime(); + CIntelSMDAudioRenderer(); + virtual bool Initialize(IAudioCallback* pCallback, int iChannels, enum PCMChannels* channelMap, + unsigned int uiSamplesPerSec, unsigned int uiBitsPerSample, + bool bResample, const char* strAudioCodec = "", bool bIsMusic=false, + bool bPassthrough = false, bool bTimed = AUDIO_NOT_TIMED, + AudioMediaFormat audioMediaFormat = AUDIO_MEDIA_FMT_PCM); + virtual ~CIntelSMDAudioRenderer(); + + virtual unsigned int AddPackets(const void* data, unsigned int len, double pts = DVD_NOPTS_VALUE, double duration = 0); + virtual unsigned int GetSpace(); + virtual bool Deinitialize(); + virtual bool Pause(); + virtual bool Stop(); + virtual bool Resume(); + + virtual long GetCurrentVolume() const; + virtual void Mute(bool bMute); + virtual bool SetCurrentVolume(long nVolume); + virtual int SetPlaySpeed(int iSpeed); + virtual void WaitCompletion(); + virtual void SwitchChannels(int iAudioStream, bool bAudioOnAllSpeakers); + + virtual void Flush(); + virtual void Resync(double pts); + virtual bool IsTimed() { return m_bTimed; } + virtual void DisablePtsCorrection(bool bDisable) { m_bDisablePtsCorrection = bDisable; } + + static CCriticalSection m_SMDAudioLock; + +private: + static int BuildChannelConfig( enum PCMChannels* channelMap, int iChannels ); + unsigned int SendDataToInput(unsigned char* buffer_data, unsigned int buffer_size, ismd_pts_t pts = ISMD_NO_PTS); + + void ConfigureDolbyModes(ismd_audio_processor_t proc_handle, ismd_dev_t input_handle); + void ConfigureDolbyPlusModes(ismd_audio_processor_t proc_handle, ismd_dev_t input_handle, bool bAC3Encode); + void ConfigureDolbyTrueHDModes(ismd_audio_processor_t proc_handle, ismd_dev_t input_handle); + void ConfigureDTSModes(ismd_audio_processor_t proc_handle, ismd_dev_t input_handle); + + ismd_audio_format_t GetISMDFormat(AudioMediaFormat format); + AUDIO_CODEC_VENDOR GetAudioCodecVendor(AudioMediaFormat format); + + void SetDefaultOutputConfig(ismd_audio_output_config_t& output_config); + void ConfigureAudioOutputParams(ismd_audio_output_config_t& output_config, + int output, int sampleSize, int sampleRate, int channels, ismd_audio_format_t format, bool bPassthrough); + + IAudioCallback* m_pCallback; + long m_nCurrentVolume; + bool m_bPause; + bool m_bIsAllocated; + + bool m_bAC3Encode; + + bool m_bIsHDMI; + bool m_bIsSPDIF; + bool m_bIsAnalog; + bool m_bIsAllOutputs; + + ismd_dev_t m_audioDevice; + ismd_dev_handle_t m_audioDeviceInput; + + enum PCMChannels* m_channelMap; + unsigned int m_uiBitsPerSample; + unsigned int m_uiChannels; + AudioMediaFormat m_audioMediaFormat; + unsigned int m_uiSamplesPerSec; + bool m_bTimed; + bool m_bFlushFlag; + unsigned int m_dwChunkSize; + unsigned int m_dwBufferLen; + + ismd_pts_t m_lastPts; + ismd_pts_t m_lastSync; + bool m_bDisablePtsCorrection; + + // data for small chunks collection + ismd_pts_t m_first_pts; + unsigned int m_ChunksCollectedSize; + unsigned char *m_pChunksCollected; + + + /* + static ismd_audio_format_t m_inputActualFormat; + static ismd_audio_format_t m_inputAudioFormat; + static int m_ioBitsPerSample; + static int m_inputSamplesPerSec; + static unsigned int m_uiBytesPerSecond; + static int m_inputChannelConfig; + static ismd_audio_channel_config_t m_outputChannelConfig; + static int m_outputChannelMap; + static ismd_audio_output_mode_t m_outputOutMode; + static unsigned int m_outputSampleRate; + static bool m_bAllOutputs; + static bool m_bIsInit; + static ismd_audio_downmix_mode_t m_DownmixMode; + static int m_nSampleRate; + */ + + static CIntelSMDAudioRenderer* m_owner; + + bool LoadEDID(); + void UnloadEDID(); + bool CheckEDIDSupport( ismd_audio_format_t format, int& iChannels, unsigned int& uiSampleRate, unsigned int& uiSampleSize ); + void DumpEDID(); + static ismd_audio_format_t MapGDLAudioFormat( gdl_hdmi_audio_fmt_t f ); + + typedef struct _edidCaps + { + ismd_audio_format_t format; + int channels; + unsigned char sample_rates; // 7 bit field corresponding to m_edidRates + unsigned char sample_sizes; // 4 bit field corresponding to m_edidSampleSizes, PCM only + struct _edidCaps* next; + } edidHint; + static edidHint* m_edidTable; +}; + +#endif + +#endif + diff --git a/xbmc/cores/AudioRenderers/Win32WASAPI.cpp b/xbmc/cores/AudioRenderers/Win32WASAPI.cpp new file mode 100644 index 00000000..5f333479 --- /dev/null +++ b/xbmc/cores/AudioRenderers/Win32WASAPI.cpp @@ -0,0 +1,761 @@ +/* + * Copyright (C) 2005-2009 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "system.h" // WIN32INCLUDES needed for the WASAPI stuff below + +#include +#include +#include +#include +#include +#include +#include "Win32WASAPI.h" +#include "AudioContext.h" +#include "Settings.h" +#include "SingleLock.h" +#include "SystemInfo.h" +#include "utils/log.h" +#include "utils/TimeUtils.h" +#include "utils/PCMRemap.h" +#include "CharsetConverter.h" +#include "GUISettings.h" + +#pragma comment(lib, "Avrt.lib") + +const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator); +const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator); +const IID IID_IAudioClient = __uuidof(IAudioClient); +const IID IID_IAudioRenderClient = __uuidof(IAudioRenderClient); + +DEFINE_GUID( _KSDATAFORMAT_SUBTYPE_PCM, WAVE_FORMAT_PCM, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); +DEFINE_GUID( _KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF, WAVE_FORMAT_DOLBY_AC3_SPDIF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); + +const enum PCMChannels wasapi_default_channel_layout[][8] = +{ + {PCM_FRONT_CENTER}, + {PCM_FRONT_LEFT, PCM_FRONT_RIGHT}, + {PCM_FRONT_LEFT, PCM_FRONT_RIGHT, PCM_LOW_FREQUENCY}, + {PCM_FRONT_LEFT, PCM_FRONT_RIGHT, PCM_BACK_LEFT, PCM_BACK_RIGHT}, + {PCM_FRONT_LEFT, PCM_FRONT_RIGHT, PCM_LOW_FREQUENCY, PCM_BACK_LEFT, PCM_BACK_RIGHT}, + {PCM_FRONT_LEFT, PCM_FRONT_RIGHT, PCM_FRONT_CENTER, PCM_LOW_FREQUENCY, PCM_BACK_LEFT, PCM_BACK_RIGHT}, + {PCM_FRONT_LEFT, PCM_FRONT_RIGHT, PCM_FRONT_CENTER, PCM_LOW_FREQUENCY, PCM_BACK_CENTER, PCM_BACK_LEFT, PCM_BACK_RIGHT}, + {PCM_FRONT_LEFT, PCM_FRONT_RIGHT, PCM_FRONT_CENTER, PCM_LOW_FREQUENCY, PCM_BACK_LEFT, PCM_BACK_RIGHT, PCM_SIDE_LEFT, PCM_SIDE_RIGHT} +}; + +const enum PCMChannels wasapi_channel_order[] = {PCM_FRONT_LEFT, PCM_FRONT_RIGHT, PCM_FRONT_CENTER, PCM_LOW_FREQUENCY, PCM_BACK_LEFT, PCM_BACK_RIGHT, PCM_FRONT_LEFT_OF_CENTER, PCM_FRONT_RIGHT_OF_CENTER, PCM_BACK_CENTER, PCM_SIDE_LEFT, PCM_SIDE_RIGHT}; + +#define WASAPI_TOTAL_CHANNELS 11 + +#define EXIT_ON_FAILURE(hr, reason, ...) if(FAILED(hr)) {CLog::Log(LOGERROR, reason, __VA_ARGS__); goto failed;} + +//This needs to be static since only one exclusive stream can exist at one time. +bool CWin32WASAPI::m_bIsAllocated = false; + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// +//*********************************************************************************************** +CWin32WASAPI::CWin32WASAPI() : + m_bPassthrough(false), + m_uiAvgBytesPerSec(0), + m_CacheLen(0), + m_uiChunkSize(0), + m_uiSrcChunkSize(0), + m_uiBufferLen(0), + m_PreCacheSize(0), + m_LastCacheCheck(0), + m_pAudioClient(NULL), + m_pRenderClient(NULL), + m_pDevice(NULL) +{ +} + + +//bool CWin32WASAPI::Initialize(IAudioCallback* pCallback, const CStdString& device, int iChannels, enum PCMChannels *channelMap, unsigned int uiSamplesPerSec, unsigned int uiBitsPerSample, bool bResample, bool bIsMusic, bool bAudioPassthrough) +bool CWin32WASAPI::Initialize(IAudioCallback* pCallback, int iChannels, unsigned int uiSamplesPerSec, unsigned int uiBitsPerSample, bool bResample, const char* strAudioCodec, bool bIsMusic, bool bPassthrough) +{ + //First check if the version of Windows we are running on even supports WASAPI. + OSVERSIONINFO osvi; + enum PCMChannels *channelMap = NULL; + CStdString device = g_guiSettings.GetString("audiooutput.audiodevice"); + + ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + GetVersionEx(&osvi); + + if (osvi.dwMajorVersion < 6) + { + CLog::Log(LOGERROR, __FUNCTION__": WASAPI output requires Vista or higher."); + return false; + } + + //Only one exclusive stream may be initialized at one time. + if(m_bIsAllocated) + { + CLog::Log(LOGERROR, __FUNCTION__": Cannot create more then one WASAPI stream at one time."); + return false; + } + + int layoutChannels = 0; + + if(!bPassthrough) + { + //if(!channelMap) + channelMap = (PCMChannels *)wasapi_default_channel_layout[iChannels - 1]; //use the default. + + PCMChannels *outLayout = m_remap.SetInputFormat(iChannels, channelMap, uiBitsPerSample / 8); + + for(PCMChannels *channel = outLayout; *channel != PCM_INVALID; channel++) + ++layoutChannels; + + //Expand monural to stereo as most devices don't seem to like 1 channel PCM streams. + //Stereo sources should be sent explicitly as two channels so that the external hardware + //can apply ProLogic/5CH Stereo/etc processing on it. + if(iChannels <= 2) + { + BuildChannelMapping(2, (PCMChannels *)wasapi_default_channel_layout[1]); + + layoutChannels = 2; + m_remap.SetOutputFormat(2, m_SpeakerOrder, false); + } + else //Do the standard remapping. + { + BuildChannelMapping(layoutChannels, outLayout); + m_remap.SetOutputFormat(layoutChannels, m_SpeakerOrder, false); + } + } + + m_bPlaying = false; + m_bPause = false; + m_bMuting = false; + m_uiChannels = iChannels; + m_uiBitsPerSample = uiBitsPerSample; + m_bPassthrough = bPassthrough; + + m_nCurrentVolume = g_stSettings.m_nVolumeLevel; + m_pcmAmplifier.SetVolume(m_nCurrentVolume); + + WAVEFORMATEXTENSIBLE wfxex = {0}; + + //fill waveformatex + ZeroMemory(&wfxex, sizeof(WAVEFORMATEXTENSIBLE)); + wfxex.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); + wfxex.Format.nChannels = layoutChannels; + wfxex.Format.nSamplesPerSec = uiSamplesPerSec; + if (bPassthrough == true) + { + wfxex.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; + wfxex.Format.wFormatTag = WAVE_FORMAT_DOLBY_AC3_SPDIF; + wfxex.SubFormat = _KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF; + wfxex.Format.wBitsPerSample = 16; + wfxex.Format.nChannels = 2; + } + else + { + wfxex.dwChannelMask = m_uiSpeakerMask; + wfxex.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + wfxex.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + wfxex.Format.wBitsPerSample = uiBitsPerSample; + } + + wfxex.Samples.wValidBitsPerSample = uiBitsPerSample == 32 ? 24 : uiBitsPerSample; + wfxex.Format.nBlockAlign = wfxex.Format.nChannels * (wfxex.Format.wBitsPerSample >> 3); + wfxex.Format.nAvgBytesPerSec = wfxex.Format.nSamplesPerSec * wfxex.Format.nBlockAlign; + + m_uiAvgBytesPerSec = wfxex.Format.nAvgBytesPerSec; + + m_uiBytesPerFrame = wfxex.Format.nBlockAlign; + m_uiBytesPerSrcFrame = bPassthrough ? m_uiBytesPerFrame : iChannels * wfxex.Format.wBitsPerSample >> 3; + + IMMDeviceEnumerator* pEnumerator = NULL; + IMMDeviceCollection* pEnumDevices = NULL; + + //Shut down Directsound. + g_audioContext.SetActiveDevice(CAudioContext::NONE); + + HRESULT hr = CoCreateInstance(CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, IID_IMMDeviceEnumerator, (void**)&pEnumerator); + EXIT_ON_FAILURE(hr, __FUNCTION__": Could not allocate WASAPI device enumerator. CoCreateInstance error code: %i", hr) + + //Get our device. + //First try to find the named device. + UINT uiCount = 0; + + hr = pEnumerator->EnumAudioEndpoints(eRender, DEVICE_STATE_ACTIVE, &pEnumDevices); + EXIT_ON_FAILURE(hr, __FUNCTION__": Retrieval of audio endpoint enumeration failed.") + + hr = pEnumDevices->GetCount(&uiCount); + EXIT_ON_FAILURE(hr, __FUNCTION__": Retrieval of audio endpoint count failed.") + + for(UINT i = 0; i < uiCount; i++) + { + IPropertyStore *pProperty = NULL; + PROPVARIANT varName; + + hr = pEnumDevices->Item(i, &m_pDevice); + EXIT_ON_FAILURE(hr, __FUNCTION__": Retrieval of WASAPI endpoint failed.") + + hr = m_pDevice->OpenPropertyStore(STGM_READ, &pProperty); + EXIT_ON_FAILURE(hr, __FUNCTION__": Retrieval of WASAPI endpoint properties failed.") + + hr = pProperty->GetValue(PKEY_Device_FriendlyName, &varName); + if(FAILED(hr)) + { + CLog::Log(LOGERROR, __FUNCTION__": Retrieval of WASAPI endpoint device name failed."); + SAFE_RELEASE(pProperty); + goto failed; + } + + CStdStringW strRawDevName(varName.pwszVal); + CStdString strDevName; + g_charsetConverter.ucs2CharsetToStringCharset(strRawDevName, strDevName); + + if(device == strDevName) + i = uiCount; + else + SAFE_RELEASE(m_pDevice); + + PropVariantClear(&varName); + SAFE_RELEASE(pProperty); + } + + SAFE_RELEASE(pEnumDevices); + + if(!m_pDevice) + { + CLog::Log(LOGDEBUG, __FUNCTION__": Could not locate the device named \"%s\" in the list of WASAPI endpoint devices. Trying the default device...", device.c_str()); + hr = pEnumerator->GetDefaultAudioEndpoint(eRender, eConsole, &m_pDevice); + EXIT_ON_FAILURE(hr, __FUNCTION__": Could not retrieve the default WASAPI audio endpoint.") + } + + //We are done with the enumerator. + SAFE_RELEASE(pEnumerator); + + hr = m_pDevice->Activate(IID_IAudioClient, CLSCTX_ALL, NULL, (void**)&m_pAudioClient); + EXIT_ON_FAILURE(hr, __FUNCTION__": Activating the WASAPI endpoint device failed.") + + hr = m_pAudioClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, &wfxex.Format, NULL); + EXIT_ON_FAILURE(hr, __FUNCTION__": Audio format not supported by the WASAPI device. Channels: %i, Rate: %i, Bits/sample: %i.", iChannels, uiSamplesPerSec, uiBitsPerSample) + + REFERENCE_TIME hnsRequestedDuration, hnsPeriodicity; + hr = m_pAudioClient->GetDevicePeriod(NULL, &hnsPeriodicity); + EXIT_ON_FAILURE(hr, __FUNCTION__": Could not retrieve the WASAPI endpoint device period."); + + //The default periods of some devices are VERY low (less than 3ms). + //For audio stability make sure we have at least an 8ms buffer. + if(hnsPeriodicity < 80000) hnsPeriodicity = 80000; + + hnsRequestedDuration = hnsPeriodicity * 16; + + // now create the stream buffer + hr = m_pAudioClient->Initialize(AUDCLNT_SHAREMODE_EXCLUSIVE, 0, hnsRequestedDuration, hnsPeriodicity, &wfxex.Format, NULL); + EXIT_ON_FAILURE(hr, __FUNCTION__": Could not initialize the WASAPI endpoint device.") + + hr = m_pAudioClient->GetBufferSize(&m_uiBufferLen); + m_uiBufferLen *= m_uiBytesPerFrame; + + //Chunk sizes are 1/16 the buffer size. + //WASAPI chunk sizes need to be evenly divisable into the buffer size or pops and clicks will result. + m_uiChunkSize = m_uiBufferLen / 16; + m_uiSrcChunkSize = (m_uiChunkSize / m_uiBytesPerFrame) * m_uiBytesPerSrcFrame; + + m_PreCacheSize = m_uiChunkSize; + + CLog::Log(LOGDEBUG, __FUNCTION__": Packet Size = %d. Avg Bytes Per Second = %d.", m_uiChunkSize, m_uiAvgBytesPerSec); + + hr = m_pAudioClient->GetService(IID_IAudioRenderClient, (void**)&m_pRenderClient); + EXIT_ON_FAILURE(hr, __FUNCTION__": Could not initialize the WASAPI render client interface.") + + m_bIsAllocated = true; + m_CacheLen = 0; + m_LastCacheCheck = CTimeUtils::GetTimeMS(); + + CLog::Log(LOGINFO, __FUNCTION__": WASAPI initialized."); + + return m_bIsAllocated; + +failed: + CLog::Log(LOGERROR, __FUNCTION__": WASAPI initialization failed."); + SAFE_RELEASE(pEnumDevices); + SAFE_RELEASE(pEnumerator); + SAFE_RELEASE(m_pRenderClient); + SAFE_RELEASE(m_pAudioClient); + SAFE_RELEASE(m_pDevice); + + //Restart Directsound + g_audioContext.SetActiveDevice(CAudioContext::DEFAULT_DEVICE); + + return false; +} + +//*********************************************************************************************** +CWin32WASAPI::~CWin32WASAPI() +{ + Deinitialize(); +} + +//*********************************************************************************************** +bool CWin32WASAPI::Deinitialize() +{ + if (m_bIsAllocated) + { + CLog::Log(LOGDEBUG, __FUNCTION__": WASAPI - Cleaning up"); + + m_pAudioClient->Stop(); + + SAFE_RELEASE(m_pRenderClient) + SAFE_RELEASE(m_pAudioClient) + SAFE_RELEASE(m_pDevice) + + m_CacheLen = 0; + m_uiChunkSize = 0; + m_uiBufferLen = 0; + + m_bIsAllocated = false; + + //Restart Directsound for the interface sounds. + g_audioContext.SetActiveDevice(CAudioContext::DEFAULT_DEVICE); + } + return true; +} + +//*********************************************************************************************** +bool CWin32WASAPI::Pause() +{ + CSingleLock lock (m_critSection); + + if (!m_bIsAllocated) + return false; + + if (m_bPause) // Already paused + return true; + + m_bPause = true; + m_pAudioClient->Stop(); + + return true; +} + +//*********************************************************************************************** +bool CWin32WASAPI::Resume() +{ + CSingleLock lock (m_critSection); + + if (!m_bIsAllocated) + return false; + + if(!m_bPause) // Already playing + return true; + + m_bPause = false; + + UpdateCacheStatus(); + if(m_CacheLen >= m_PreCacheSize) // Make sure we have some data to play (if not, playback will start when we add some) + m_pAudioClient->Start(); + else + m_bPlaying = false; // Trigger playback restart the next time data is added to the buffer. + + return true; +} + +//*********************************************************************************************** +bool CWin32WASAPI::Stop() +{ + CSingleLock lock (m_critSection); + + if (!m_bIsAllocated) + return false; + + // Stop and reset WASAPI buffer + m_pAudioClient->Stop(); + m_pAudioClient->Reset(); + + // Reset buffer management members + m_CacheLen = 0; + m_bPause = false; + m_bPlaying = false; + + return true; +} + +//*********************************************************************************************** +long CWin32WASAPI::GetCurrentVolume() const +{ + return m_nCurrentVolume; +} + +//*********************************************************************************************** +void CWin32WASAPI::Mute(bool bMute) +{ + CSingleLock lock (m_critSection); + + m_bMuting = bMute; +} + +//*********************************************************************************************** +bool CWin32WASAPI::SetCurrentVolume(long nVolume) +{ + CSingleLock lock (m_critSection); + + if (!m_bIsAllocated) + return false; + + m_nCurrentVolume = nVolume; + m_pcmAmplifier.SetVolume(m_nCurrentVolume); + return true; +} + +//*********************************************************************************************** +unsigned int CWin32WASAPI::AddPackets(const void* data, unsigned int len) +{ + CSingleLock lock (m_critSection); + + if (!m_bIsAllocated) + return 0; + + DWORD dwFlags = m_bMuting || m_nCurrentVolume == VOLUME_MINIMUM ? AUDCLNT_BUFFERFLAGS_SILENT : 0; + + unsigned int uiBytesToWrite, uiSrcBytesToWrite; + BYTE* pBuffer = NULL; + + UpdateCacheStatus(); + + uiBytesToWrite = std::min(m_uiBufferLen - m_CacheLen, (len / m_uiBytesPerSrcFrame) * m_uiBytesPerFrame); + uiBytesToWrite /= m_uiChunkSize; + + uiSrcBytesToWrite = uiBytesToWrite * m_uiSrcChunkSize; + + uiBytesToWrite *= m_uiChunkSize; + + if(uiBytesToWrite == 0) + return 0; + + // Get the buffer + m_pRenderClient->GetBuffer(uiBytesToWrite/m_uiBytesPerFrame, &pBuffer); + + // Write data into the buffer + AddDataToBuffer((unsigned char*)data, uiSrcBytesToWrite, pBuffer); + + //Adjust the volume if necessary. + if(!m_bPassthrough) + m_pcmAmplifier.DeAmplify((short*)pBuffer, uiBytesToWrite / 2); + + // Release the buffer + m_pRenderClient->ReleaseBuffer(uiBytesToWrite/m_uiBytesPerFrame, dwFlags); + + m_CacheLen += uiBytesToWrite; + + CheckPlayStatus(); + + return uiSrcBytesToWrite; // Bytes used +} + +void CWin32WASAPI::UpdateCacheStatus() +{ + unsigned int time = CTimeUtils::GetTimeMS(); + if (time == m_LastCacheCheck) + return; // Don't recalc more frequently than once/ms (that is our max resolution anyway) + + m_LastCacheCheck = time; + + m_pAudioClient->GetCurrentPadding(&m_CacheLen); + m_CacheLen *= m_uiBytesPerFrame; +} + +void CWin32WASAPI::CheckPlayStatus() +{ + if(!m_bPause && !m_bPlaying && m_CacheLen >= m_PreCacheSize) // If we have some data, see if we can start playback + { + m_pAudioClient->Start(); + m_bPlaying = true; + } +} + +unsigned int CWin32WASAPI::GetSpace() +{ + CSingleLock lock (m_critSection); + + if (!m_bIsAllocated) + return 0; + + // Make sure we know how much data is in the cache + UpdateCacheStatus(); + + return ((m_uiBufferLen - m_CacheLen) / m_uiBytesPerFrame) * m_uiBytesPerSrcFrame; +} + +//*********************************************************************************************** +float CWin32WASAPI::GetDelay() +{ + CSingleLock lock (m_critSection); + + if (!m_bIsAllocated) + return 0.0f; + + // Make sure we know how much data is in the cache + UpdateCacheStatus(); + + return (float)m_CacheLen / (float)m_uiAvgBytesPerSec; +} + +//*********************************************************************************************** +float CWin32WASAPI::GetCacheTime() +{ + CSingleLock lock (m_critSection); + + if (!m_bIsAllocated) + return 0.0f; + + // Make sure we know how much data is in the cache + UpdateCacheStatus(); + + return (float)m_CacheLen / (float)m_uiAvgBytesPerSec; +} + +//*********************************************************************************************** +float CWin32WASAPI::GetCacheTotal() +{ + CSingleLock lock (m_critSection); + + if (!m_bIsAllocated) + return 0.0f; + + return (float)m_uiBufferLen / (float)m_uiAvgBytesPerSec; +} + +//*********************************************************************************************** +unsigned int CWin32WASAPI::GetChunkLen() +{ + return m_uiSrcChunkSize; +} + +//*********************************************************************************************** +int CWin32WASAPI::SetPlaySpeed(int iSpeed) +{ + return 0; +} + +//*********************************************************************************************** +void CWin32WASAPI::RegisterAudioCallback(IAudioCallback *pCallback) +{ + m_pCallback = pCallback; +} + +//*********************************************************************************************** +void CWin32WASAPI::UnRegisterAudioCallback() +{ + m_pCallback = NULL; +} + +//*********************************************************************************************** +/* +void CWin32WASAPI::EnumerateAudioSinks(AudioSinkList &vAudioSinks, bool passthrough) +{ + //First check if the version of Windows we are running on even supports WASAPI. + if (!g_sysinfo.IsVistaOrHigher()) + { + CLog::Log(LOGDEBUG, __FUNCTION__": WASAPI enumeration requires Vista or higher."); + return; + } + + IMMDeviceEnumerator* pEnumerator = NULL; + IMMDeviceCollection* pEnumDevices = NULL; + + HRESULT hr = CoCreateInstance(CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, IID_IMMDeviceEnumerator, (void**)&pEnumerator); + EXIT_ON_FAILURE(hr, __FUNCTION__": Could not allocate WASAPI device enumerator. CoCreateInstance error code: %i", hr) + + UINT uiCount = 0; + + hr = pEnumerator->EnumAudioEndpoints(eRender, DEVICE_STATE_ACTIVE, &pEnumDevices); + EXIT_ON_FAILURE(hr, __FUNCTION__": Retrieval of audio endpoint enumeration failed.") + + hr = pEnumDevices->GetCount(&uiCount); + EXIT_ON_FAILURE(hr, __FUNCTION__": Retrieval of audio endpoint count failed.") + + for(UINT i = 0; i < uiCount; i++) + { + IMMDevice *pDevice = NULL; + IPropertyStore *pProperty = NULL; + PROPVARIANT varName; + + pEnumDevices->Item(i, &pDevice); + if(FAILED(hr)) + { + CLog::Log(LOGERROR, __FUNCTION__": Retrieval of WASAPI endpoint failed."); + + goto failed; + } + + hr = pDevice->OpenPropertyStore(STGM_READ, &pProperty); + if(FAILED(hr)) + { + CLog::Log(LOGERROR, __FUNCTION__": Retrieval of WASAPI endpoint properties failed."); + SAFE_RELEASE(pDevice) + + goto failed; + } + + hr = pProperty->GetValue(PKEY_Device_FriendlyName, &varName); + if(FAILED(hr)) + { + CLog::Log(LOGERROR, __FUNCTION__": Retrieval of WASAPI endpoint device name failed."); + SAFE_RELEASE(pDevice) + SAFE_RELEASE(pProperty) + + goto failed; + } + + CStdStringW strRawDevName(varName.pwszVal); + CStdString strDevName; + g_charsetConverter.wToUTF8(strRawDevName, strDevName); + + vAudioSinks.push_back(AudioSink(CStdString("WASAPI: ").append(strDevName), CStdString("wasapi:").append(strDevName))); + + SAFE_RELEASE(pDevice) + + PropVariantClear(&varName); + SAFE_RELEASE(pProperty) + } + +failed: + + if(FAILED(hr)) + CLog::Log(LOGERROR, __FUNCTION__": Failed to enumerate WASAPI endpoint devices."); + + SAFE_RELEASE(pEnumDevices); + SAFE_RELEASE(pEnumerator); +}*/ + +//*********************************************************************************************** +void CWin32WASAPI::WaitCompletion() +{ + CSingleLock lock (m_critSection); + + if (!m_bIsAllocated) + return; + + DWORD dwTimeRemaining; + + if(!m_bPlaying) + return; // We weren't playing anyway + + //Calculate the remaining cache time and wait for it to finish. + dwTimeRemaining = (DWORD)(1000 * GetDelay()); + Sleep(dwTimeRemaining); + + m_pAudioClient->Stop(); + m_pAudioClient->Reset(); + + m_CacheLen = 0; + m_bPause = false; + m_bPlaying = false; +} + +//*********************************************************************************************** +void CWin32WASAPI::AddDataToBuffer(unsigned char* pData, unsigned int len, unsigned char* pOut) +{ + // Remap the data to the correct channels + if(m_remap.CanRemap() && !m_bPassthrough) + m_remap.Remap((void*)pData, pOut, len / m_uiBytesPerSrcFrame); + else + memcpy(pOut, pData, len); +} + +//*********************************************************************************************** +void CWin32WASAPI::SwitchChannels(int iAudioStream, bool bAudioOnAllSpeakers) +{ + return; +} + +//*********************************************************************************************** +void CWin32WASAPI::BuildChannelMapping(int channels, enum PCMChannels* map) +{ + bool usedChannels[WASAPI_TOTAL_CHANNELS]; + + memset(usedChannels, false, sizeof(usedChannels)); + + m_uiSpeakerMask = 0; + + if(!map) + map = (PCMChannels *)wasapi_default_channel_layout[channels - 1]; + + //Build the speaker mask and note which are used. + for(int i = 0; i < channels; i++) + { + switch(map[i]) + { + case PCM_FRONT_LEFT: + usedChannels[map[i]] = true; + m_uiSpeakerMask |= SPEAKER_FRONT_LEFT; + break; + case PCM_FRONT_RIGHT: + usedChannels[map[i]] = true; + m_uiSpeakerMask |= SPEAKER_FRONT_RIGHT; + break; + case PCM_FRONT_CENTER: + usedChannels[map[i]] = true; + m_uiSpeakerMask |= SPEAKER_FRONT_CENTER; + break; + case PCM_LOW_FREQUENCY: + usedChannels[map[i]] = true; + m_uiSpeakerMask |= SPEAKER_LOW_FREQUENCY; + break; + case PCM_BACK_LEFT: + usedChannels[map[i]] = true; + m_uiSpeakerMask |= SPEAKER_BACK_LEFT; + break; + case PCM_BACK_RIGHT: + usedChannels[map[i]] = true; + m_uiSpeakerMask |= SPEAKER_BACK_RIGHT; + break; + case PCM_FRONT_LEFT_OF_CENTER: + usedChannels[map[i]] = true; + m_uiSpeakerMask |= SPEAKER_FRONT_LEFT_OF_CENTER; + break; + case PCM_FRONT_RIGHT_OF_CENTER: + usedChannels[map[i]] = true; + m_uiSpeakerMask |= SPEAKER_FRONT_RIGHT_OF_CENTER; + break; + case PCM_BACK_CENTER: + usedChannels[map[i]] = true; + m_uiSpeakerMask |= SPEAKER_BACK_CENTER; + break; + case PCM_SIDE_LEFT: + usedChannels[map[i]] = true; + m_uiSpeakerMask |= SPEAKER_SIDE_LEFT; + break; + case PCM_SIDE_RIGHT: + usedChannels[map[i]] = true; + m_uiSpeakerMask |= SPEAKER_SIDE_RIGHT; + break; + } + } + + //Assemble a compacted channel set. + for(int i = 0, j = 0; i < WASAPI_TOTAL_CHANNELS; i++) + { + if(usedChannels[i]) + { + m_SpeakerOrder[j] = wasapi_channel_order[i]; + j++; + } + } +} diff --git a/xbmc/cores/AudioRenderers/Win32WASAPI.h b/xbmc/cores/AudioRenderers/Win32WASAPI.h new file mode 100644 index 00000000..21113e24 --- /dev/null +++ b/xbmc/cores/AudioRenderers/Win32WASAPI.h @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2005-2009 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#ifndef __WIN32WASAPI_H__ +#define __WIN32WASAPI_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + +#include "IAudioRenderer.h" +#include "utils/CriticalSection.h" +#include "utils/PCMAmplifier.h" +#include "utils/PCMRemap.h" +#include +#include + + +extern void RegisterAudioCallback(IAudioCallback* pCallback); +extern void UnRegisterAudioCallback(); + +class CWin32WASAPI : public IAudioRenderer +{ +public: + CWin32WASAPI(); + virtual ~CWin32WASAPI(); + virtual void UnRegisterAudioCallback(); + virtual void RegisterAudioCallback(IAudioCallback* pCallback); + virtual unsigned int GetChunkLen(); + virtual float GetDelay(); + virtual float GetCacheTime(); + virtual float GetCacheTotal(); + virtual bool Initialize(IAudioCallback* pCallback, int iChannels, unsigned int uiSamplesPerSec, unsigned int uiBitsPerSample, bool bResample, const char* strAudioCodec, bool bIsMusic, bool bPassthrough); + + virtual unsigned int AddPackets(const void* data, unsigned int len); + virtual unsigned int GetSpace(); + virtual bool Deinitialize(); + virtual bool Pause(); + virtual bool Stop(); + virtual bool Resume(); + + virtual long GetCurrentVolume() const; + virtual void Mute(bool bMute); + virtual bool SetCurrentVolume(long nVolume); + virtual int SetPlaySpeed(int iSpeed); + virtual void WaitCompletion(); + virtual void SwitchChannels(int iAudioStream, bool bAudioOnAllSpeakers); + + //static void EnumerateAudioSinks(AudioSinkList& vAudioSinks, bool passthrough); + +private: + void AddDataToBuffer(unsigned char* pData, unsigned int len, unsigned char* pOut); + void UpdateCacheStatus(); + void CheckPlayStatus(); + void BuildChannelMapping(int channels, enum PCMChannels* map); + + IMMDevice* m_pDevice; + IAudioClient* m_pAudioClient; + IAudioRenderClient* m_pRenderClient; + + IAudioCallback* m_pCallback; + + CPCMRemap m_remap; + + long m_nCurrentVolume; + float m_fVolAdjustFactor; + + unsigned int m_uiChunkSize; + unsigned int m_uiSrcChunkSize; + unsigned int m_uiBufferLen; + unsigned int m_uiBytesPerFrame; + unsigned int m_uiBytesPerSrcFrame; + unsigned int m_uiBitsPerSample; + unsigned int m_uiChannels; + unsigned int m_uiAvgBytesPerSec; + unsigned int m_uiSpeakerMask; + enum PCMChannels m_SpeakerOrder[8]; + + static bool m_bIsAllocated; + bool m_bPlaying; + bool m_bPause; + bool m_bMuting; + bool m_bPassthrough; + + unsigned int m_CacheLen; + unsigned int m_LastCacheCheck; + size_t m_PreCacheSize; + + CPCMAmplifier m_pcmAmplifier; + CCriticalSection m_critSection; +}; + +#endif //__WIN32WASAPI_H__ diff --git a/xbmc/cores/DllLoader/DllLoader.pro b/xbmc/cores/DllLoader/DllLoader.pro new file mode 100644 index 00000000..b10d42bb --- /dev/null +++ b/xbmc/cores/DllLoader/DllLoader.pro @@ -0,0 +1,44 @@ +include(../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../../ ../../linux ../../../guilib ../../../xbmc ../../utils +DEFINES += API_DEBUG +SOURCES += \ + \ +dll_tracker.cpp \ +ldt_keeper.c \ +mmap_anon.c \ +SoLoader.cpp \ +dll_util.cpp \ +dll.cpp \ +LibraryLoader.cpp \ +DllLoader.cpp \ +DllLoaderContainer.cpp \ +dll_tracker_library.cpp \ +coff.cpp \ +dll_tracker_file.cpp \ + + +HEADERS += \ + \ +dll_tracker.h \ +ldt_keeper.c \ +mmap_anon.c \ +SoLoader.h \ +dll_util.h \ +dll.h \ +LibraryLoader.h \ +DllLoader.h \ +DllLoaderContainer.h \ +dll_tracker_library.h \ +coff.h \ +dll_tracker_file.h \ + + +INCLUDEPATH += ../../../ diff --git a/xbmc/cores/DllLoader/exports/exports.pro b/xbmc/cores/DllLoader/exports/exports.pro new file mode 100644 index 00000000..ff5656d9 --- /dev/null +++ b/xbmc/cores/DllLoader/exports/exports.pro @@ -0,0 +1,29 @@ +include(../../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../../../ ../../../linux ../../../utils ../../../../guilib +SOURCES += \ + emu_kernel32.cpp \ + exports_python_linux.o \ + wrapper.c \ + exports_python_linux.cpp \ + emu_msvcrt.cpp \ + emu_dummy.cpp \ + + +HEADERS += \ + emu_kernel32.h \ + exports_python_linux.o \ + wrapper.c \ + exports_python_linux.h \ + emu_msvcrt.h \ + emu_dummy.h \ + + +INCLUDEPATH += ../../../../ diff --git a/xbmc/cores/DllLoader/exports/util/util.pro b/xbmc/cores/DllLoader/exports/util/util.pro new file mode 100644 index 00000000..608b70fb --- /dev/null +++ b/xbmc/cores/DllLoader/exports/util/util.pro @@ -0,0 +1,19 @@ +include(../../../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../../../../ ../../../../linux ../../../../../guilib +SOURCES += \ +EmuFileWrapper.cpp \ + + +HEADERS += \ +EmuFileWrapper.h \ + + +INCLUDEPATH += ../../../../../ diff --git a/xbmc/cores/DllLoader/exports/wrapper_mach_alias b/xbmc/cores/DllLoader/exports/wrapper_mach_alias new file mode 100644 index 00000000..256cf84a --- /dev/null +++ b/xbmc/cores/DllLoader/exports/wrapper_mach_alias @@ -0,0 +1,53 @@ +# List of wrapper aliases for Mach-O +___wrap_clearerr _clearerr +___wrap_close _close +___wrap_fclose _fclose +___wrap_fdopen _fdopen +___wrap_feof _feof +___wrap_ferror _ferror +___wrap_fflush _fflush +___wrap_fgetc _fgetc +___wrap_fgetpos _fgetpos +___wrap_fgets _fgets +___wrap_fileno _fileno +___wrap_flockfile _flockfile +___wrap_fopen _fopen +___wrap_fopen64 _fopen64 +___wrap_fprintf _fprintf +___wrap_fputc _fputc +___wrap_fputs _fputs +___wrap_fread _fread +___wrap_freopen _freopen +___wrap_fseek _fseek +___wrap_fsetpos _fsetpos +___wrap_fstatvfs64 _fstatvfs64 +___wrap_ftell _ftell +___wrap_ftrylockfile _ftrylockfile +___wrap_funlockfile _funlockfile +___wrap_fwrite _fwrite +___wrap_ioctl _ioctl +___wrap_lseek _lseek +___wrap_lseek64 _lseek64 +___wrap_open _open +___wrap_open64 _open64 +___wrap_popen _popen +___wrap_printf _printf +___wrap_read _read +___wrap_opendir _opendir +___wrap_readdir _readdir +___wrap_closedir _closedir +___wrap_rewinddir _rewinddir +___wrap_rewind _rewind +___wrap_stat _stat +___wrap_fstat _fstat +___wrap_ungetc _ungetc +___wrap_vfprintf _vfprintf +___wrap_write _write +___wrap__IO_putc _putc +___wrap__IO_getc _getc +___wrap__IO_getc_unlocked _getc_unlocked +___wrap_fwrite _fwrite$UNIX2003 +___wrap_close _close$UNIX2003 +#___wrap_fcntl _fcntl$UNIX2003 +___wrap_open _open$UNIX2003 + diff --git a/xbmc/cores/ExternalPlayer/ExternalPlayer.pro b/xbmc/cores/ExternalPlayer/ExternalPlayer.pro new file mode 100644 index 00000000..e3dd1d06 --- /dev/null +++ b/xbmc/cores/ExternalPlayer/ExternalPlayer.pro @@ -0,0 +1,21 @@ +include(../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . .. ../../ ../../linux ../../utils ../../../guilib +SOURCES += \ + \ +ExternalPlayer.cpp \ + + +HEADERS += \ + \ +ExternalPlayer.h \ + + +INCLUDEPATH += ../../../ diff --git a/xbmc/cores/IntelSMDGlobals.cpp b/xbmc/cores/IntelSMDGlobals.cpp new file mode 100644 index 00000000..d76622e2 --- /dev/null +++ b/xbmc/cores/IntelSMDGlobals.cpp @@ -0,0 +1,2180 @@ +#include "system.h" + +#ifdef HAS_INTEL_SMD + +/* + * Boxee + * Copyright (c) 2009, Boxee Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "Settings.h" +#include "GUISettings.h" // for AUDIO_* +#include "IntelSMDGlobals.h" +#include +#include "utils/log.h" +#include "HalServices.h" +#include "lib/libBoxee/bxoemconfiguration.h" + +#ifndef UINT64_C +#define UINT64_C(x) (const unsigned long long)(x) +#endif + +extern "C" { +#if (defined USE_EXTERNAL_FFMPEG) + #if (defined HAVE_LIBAVCODEC_AVCODEC_H) + #include + #elif (defined HAVE_FFMPEG_AVCODEC_H) + #include + #endif +#else + #include "libavcodec/avcodec.h" +#endif +} + +#ifndef DVD_TIME_BASE +#define DVD_TIME_BASE 1000000 +#endif +#ifndef DVD_NOPTS_VALUE +#define DVD_NOPTS_VALUE (-1LL<<52) // should be possible to represent in both double and __int64 +#endif + +#define AUDIO_OUTPUT_DELAY 39 // requested by dolby cert + +CIntelSMDGlobals g_IntelSMDGlobals; + +CIntelSMDGlobals::CIntelSMDGlobals() +{ + CLog::Log(LOGDEBUG, "CIntelSMDGlobals::CIntelSMDGlobals"); + + m_main_clock = -1; + m_demux = -1; + m_demux_input_port = -1; + m_demux_video_port = -1; + m_demux_audio_port = -1; + m_demux_ves_filter_handle = -1; + m_demux_aes_filter_handle = -1; + m_audioProcessor = -1; + m_viddec = -1; + m_viddec_input_port = -1; + m_viddec_output_port = -1; + m_viddec_user_data_port = -1; + m_video_proc = -1; + m_video_render = -1; + m_video_input_port_proc = -1; + m_video_input_port_renderer = -1; + m_video_output_port_renderer = -1; + m_video_output_port_proc = -1; + m_video_codec = ISMD_CODEC_TYPE_INVALID; + m_viddec_user_data_event = -1; + + m_base_time = 0; + m_pause_base_time = 0; + m_RenderState = ISMD_DEV_STATE_INVALID; + m_audio_start_pts = ISMD_NO_PTS; + m_video_start_pts = ISMD_NO_PTS; + + m_bFlushFlag = false; + + m_bDemuxToVideo = false; + m_bDemuxToAudio = false; + + m_audioOutputHDMI = -1; + m_audioOutputSPDIF = -1; + m_audioOutputI2S0 = -1; + + m_primaryAudioInput = -1; + + ResetClock(); +} + +CIntelSMDGlobals::~CIntelSMDGlobals() +{ + CLog::Log(LOGDEBUG, "CIntelSMDGlobals::~CIntelSMDGlobals"); + + DestroyMainClock(); +} + +bool CIntelSMDGlobals::CreateMainClock() +{ + CLog::Log(LOGDEBUG, "CIntelSMDGlobals::CreateMainClock"); + + ismd_result_t ret; + + CSingleLock lock(m_Lock); + + if (m_main_clock != -1) + return true; + + ret = ismd_clock_alloc(ISMD_CLOCK_TYPE_FIXED, &m_main_clock); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "ERROR: CIntelSMDGlobals::CreateMainClock CLOCK ALLOC FAIL ....."); + return false; + } + + if (!SetClockPrimary()) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::CreateMainClock SetClockPrimary failed"); + return false; + } + + return true; +} + +void CIntelSMDGlobals::DestroyMainClock() +{ + CLog::Log(LOGDEBUG, "CIntelSMDGlobals::DestroyMainClock"); + + CSingleLock lock(m_Lock); + + if (m_main_clock != -1) + ismd_clock_free(m_main_clock); + + m_main_clock = -1; +} + +bool CIntelSMDGlobals::SetClockPrimary() +{ + CLog::Log(LOGDEBUG, "CIntelSMDGlobals::SetClockPrimary"); + + ismd_result_t ret; + + if (m_main_clock == -1) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::SetClockPrimary m_main_clock == -1"); + return false; + } + + ret = ismd_clock_make_primary(m_main_clock); + if (ret != ISMD_SUCCESS) + { + CLog::Log( + LOGERROR, + "ERROR: CIntelSMDGlobals::SetClockPrimary ismd_clock_make_primary failed %d", + ret); + return false; + } + + return true; +} + +ismd_time_t CIntelSMDGlobals::GetCurrentTime() +{ + ismd_result_t ret; + ismd_time_t current; + + CSingleLock lock(m_Lock); + + if (m_main_clock == -1) + { + CLog::Log(LOGWARNING, "CIntelSMDGlobals::GetCurrentTime main clock = -1"); + return 0; + } + + ret = ismd_clock_get_time(m_main_clock, ¤t); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::GetCurrentTime ismd_clock_get_time failed %d", + ret); + return 0; + } + + return current; +} + +void CIntelSMDGlobals::SetBaseTime(ismd_time_t time) +{ + CLog::Log(LOGINFO, "Setting base time %.2f", IsmdToDvdPts(time) / 1000000); + m_base_time = time + 45000; +} + +bool CIntelSMDGlobals::SetCurrentTime(ismd_time_t time) +{ + ismd_result_t ret; + + CSingleLock lock(m_Lock); + + CLog::Log(LOGDEBUG, "CIntelSMDGlobals::SetCurrentTime"); + + if (m_main_clock == -1) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::SetCurrentTime main clock = -1"); + return false; + } + + ret = ismd_clock_set_time(m_main_clock, time); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::SetCurrentTime ismd_clock_set_time failed %d", ret); + return false; + } + + return true; +} + +void CIntelSMDGlobals::PauseClock() +{ + CSingleLock lock(m_Lock); + + m_pause_base_time = GetBaseTime(); + m_pause_cur_time = GetCurrentTime(); +} + +void CIntelSMDGlobals::ResumeClock() +{ + CSingleLock lock(m_Lock); + + if (m_pause_base_time == 0) + { + if (m_base_time != 0) + m_pause_base_time = GetBaseTime(); + else + m_pause_base_time = GetCurrentTime(); + } + if (m_pause_cur_time == 0) + m_pause_cur_time = GetCurrentTime(); + + ismd_time_t offset = GetCurrentTime() - m_pause_cur_time; + m_base_time = m_pause_base_time + offset; + + m_pause_base_time = 0; + m_pause_cur_time = 0; +} + +void CIntelSMDGlobals::ResetClock() +{ + CLog::Log(LOGDEBUG, "CIntelSMDGlobals::ResetClock"); + + m_base_time = 0; + m_pause_base_time = 0; + m_pause_cur_time = 0; + m_audio_start_pts = ISMD_NO_PTS; + m_video_start_pts = ISMD_NO_PTS; + m_bFlushFlag = false; +} + +ismd_pts_t CIntelSMDGlobals::DvdToIsmdPts(double pts) +{ + ismd_pts_t ismd_pts = ISMD_NO_PTS; + + if (pts != DVD_NOPTS_VALUE + ) + ismd_pts = (ismd_pts_t) (pts / DVD_TIME_BASE * SMD_CLOCK_FREQ); + + return ismd_pts; +} + +double CIntelSMDGlobals::IsmdToDvdPts(ismd_pts_t pts) +{ + double dvd_pts = DVD_NOPTS_VALUE; + + if (pts != ISMD_NO_PTS) + dvd_pts = (double) ((double) pts / SMD_CLOCK_FREQ * DVD_TIME_BASE); + + return dvd_pts; +} + +bool CIntelSMDGlobals::InitAudio() +{ + ismd_result_t result; + + CLog::Log(LOGINFO, "CIntelSMDGlobals::InitAudio"); + + if(!CreateAudioProcessor()) + return false; + + // Configure audio outputs according to settings + BuildAudioOutputs(); + + return true; +} + +bool CIntelSMDGlobals::BuildAudioOutputs() +{ + ismd_result_t result; + + int audioOutputMode = g_guiSettings.GetInt("audiooutput.mode"); + + bool bIsHDMI = (AUDIO_DIGITAL_HDMI == audioOutputMode); + bool bIsSPDIF = (AUDIO_DIGITAL_SPDIF == audioOutputMode); + bool bIsAnalog = (AUDIO_ANALOG == audioOutputMode); + bool bIsAllOutputs = (audioOutputMode == AUDIO_ALL_OUTPUTS); + if (bIsAllOutputs) + bIsHDMI = bIsSPDIF = bIsAnalog = true; + + CLog::Log(LOGINFO, "CIntelSMDGlobals::BuildAudioOutputs: HDMI %d SPDIF %d Analog %d", bIsHDMI, bIsSPDIF, bIsAnalog); + + RemoveAllAudioOutput(); + + if (bIsHDMI) + { + m_audioOutputHDMI = AddAudioOutput(AUDIO_DIGITAL_HDMI); + EnableAudioOutput(m_audioOutputHDMI); + } + if (bIsSPDIF) + { + m_audioOutputSPDIF = AddAudioOutput(AUDIO_DIGITAL_SPDIF); + EnableAudioOutput(m_audioOutputSPDIF); + } + if (bIsAnalog) + { + m_audioOutputI2S0 = AddAudioOutput(AUDIO_ANALOG); + EnableAudioOutput(m_audioOutputI2S0); + } +} + +ismd_audio_output_t CIntelSMDGlobals::AddAudioOutput(int output) +{ + ismd_result_t result; + int hwId = 0; + CStdString name; + + ismd_audio_output_t audio_output = -1; + + // Use defaults + ismd_audio_output_config_t output_config; + output_config.stream_delay = 0; + output_config.sample_size = 16; + output_config.ch_config = ISMD_AUDIO_STEREO; + output_config.out_mode = ISMD_AUDIO_OUTPUT_PCM; + output_config.ch_map = 0; + output_config.sample_rate = 48000; + + switch(output) + { + case AUDIO_DIGITAL_HDMI: + hwId = GEN3_HW_OUTPUT_HDMI; + name = "HDMI"; + break; + case AUDIO_DIGITAL_SPDIF: + hwId = GEN3_HW_OUTPUT_SPDIF; + name = "SPDIF"; + break; + case AUDIO_ANALOG: + hwId = GEN3_HW_OUTPUT_I2S0; + name = "I2S0"; + break; + default: + CLog::Log(LOGERROR, "CIntelSMDGlobals::AddAudioOutput - Unkown output"); + return -1; + } + + result = ismd_audio_add_phys_output(m_audioProcessor, hwId, output_config, &audio_output); + + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::AddAudioOutput - error add output %s %d", name.c_str(), result); + return -1; + } + + if(g_guiSettings.GetBool("audiooutput.enable_audio_output_delay")) + { + result = ismd_audio_output_set_delay(m_audioProcessor, hwId, AUDIO_OUTPUT_DELAY); + if (result != ISMD_SUCCESS) + CLog::Log(LOGWARNING, "CIntelSMDGlobals::AddAudioOutput - ismd_audio_output_set_delay %s %d failed %d", name.c_str(), AUDIO_OUTPUT_DELAY, result); + + CLog::Log(LOGINFO, "CIntelSMDGlobals::AddAudioOutput - Output Added %s", name.c_str()); + } + + CLog::Log(LOGINFO, "CIntelSMDGlobals::AddAudioOutput %s", name.c_str()); + + return audio_output; +} + + +bool CIntelSMDGlobals::RemoveAllAudioOutput() +{ + CLog::Log(LOGINFO, "CIntelSMDGlobals::RemoveAllAudioOutput"); + + if (m_audioOutputHDMI != -1) + { + DisableAudioOutput(m_audioOutputHDMI); + RemoveAudioOutput(m_audioOutputHDMI); + m_audioOutputHDMI = -1; + } + + if (m_audioOutputSPDIF != -1) + { + DisableAudioOutput(m_audioOutputSPDIF); + RemoveAudioOutput(m_audioOutputSPDIF); + m_audioOutputSPDIF = -1; + } + + if (m_audioOutputI2S0 != -1) + { + DisableAudioOutput(m_audioOutputI2S0); + RemoveAudioOutput(m_audioOutputI2S0); + m_audioOutputI2S0 = -1; + } + + return true; +} + +bool CIntelSMDGlobals::RemoveAudioOutput(ismd_audio_output_t output) +{ + ismd_result_t result; + CStdString name; + + if(output == m_audioOutputHDMI) + name = "HDMI"; + else if(output == m_audioOutputSPDIF) + name = "SPDIF"; + else if(output == m_audioOutputI2S0) + name = "I2S0"; + else + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::RemoveAudioOutput - Unknown output"); + return false; + } + + result = ismd_audio_remove_output(m_audioProcessor, output); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::RemoveAudioOutput - error remove output %s %d",name.c_str(), result); + return false; + } + + CLog::Log(LOGINFO, "CIntelSMDGlobals::RemoveAudioOutput %s", name.c_str()); + + return true; +} + +bool CIntelSMDGlobals::DeInitAudio() +{ + CLog::Log(LOGINFO, "CIntelSMDGlobals::DeInitAudio"); + + RemoveAllAudioOutput(); + + DeleteAudioProcessor(); + + return true; +} + +ismd_port_handle_t CIntelSMDGlobals::GetAudioDevicePort(ismd_dev_t device) +{ + ismd_result_t result; + ismd_port_handle_t input_port; + + result = ismd_audio_input_get_port(m_audioProcessor, device, &input_port); + if(result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::GetAudioDevicePort failed to get audio input port %d", result); + return -1; + } + + return input_port; +} + +ismd_dev_t CIntelSMDGlobals::CreateAudioInput(bool timed) +{ + ismd_dev_t device; + ismd_port_handle_t input_port; + ismd_result_t result; + + // Create audio inputs + + result = ismd_audio_add_input_port(m_audioProcessor, timed, &device, &input_port); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::CreateAudioInput failed (timed %d) %d", timed, result); + return -1; + } + + result = ismd_dev_set_clock(device, m_main_clock); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::CreateAudioInput ismd_dev_set_clock failed (timed %d) %d", timed, result); + return -1; + } + + return device; +} + + +bool CIntelSMDGlobals::RemoveAudioInput(ismd_dev_t device) +{ + ismd_result_t result; + + SetAudioDeviceState(ISMD_DEV_STATE_STOP, device); + FlushAudioDevice(device); + + result = ismd_audio_remove_input(m_audioProcessor, device); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::RemoveAudioInput - error closing device: %d", result); + return false; + } + + return true; +} + +bool CIntelSMDGlobals::SetAudioStartPts(ismd_pts_t pts) +{ + CSingleLock lock(m_Lock); + + if (pts == ISMD_NO_PTS) + { + CLog::Log(LOGWARNING, "CIntelSMDGlobals::SetAudioStartPts got ISMD_NO_PTS"); + return false; + } + + if (pts < 0 && pts != ISMD_NO_PTS) + pts = 0; + + CLog::Log(LOGINFO, "CIntelSMDGlobals::SetAudioStartPts %.2f ", + IsmdToDvdPts(pts) / 1000000.0); + + m_audio_start_pts = pts; + + return true; +} + +bool CIntelSMDGlobals::SetVideoStartPts(ismd_pts_t pts) +{ + CSingleLock lock(m_Lock); + + if (pts == ISMD_NO_PTS) + { + CLog::Log(LOGWARNING, "CIntelSMDGlobals::SetVideoStartPts got ISMD_NO_PTS"); + return false; + } + + if (pts < 0 && pts != ISMD_NO_PTS) + pts = 0; + + CLog::Log(LOGINFO, "CIntelSMDGlobals::SetVideoStartPts %.2f ", + IsmdToDvdPts(pts) / 1000000.0); + + m_video_start_pts = pts; + + return true; +} + +ismd_pts_t CIntelSMDGlobals::GetAudioCurrentTime() +{ + ismd_pts_t start = GetAudioStartPts(); + + if (start == ISMD_NO_PTS || (GetCurrentTime() < GetBaseTime())) + return ISMD_NO_PTS; + + return start + GetCurrentTime() - GetBaseTime(); +} + +ismd_pts_t CIntelSMDGlobals::GetVideoCurrentTime() +{ + ismd_pts_t start = GetVideoStartPts(); + + if (start == ISMD_NO_PTS || (GetCurrentTime() < GetBaseTime())) + return ISMD_NO_PTS; + + return start + GetCurrentTime() - GetBaseTime(); +} + +ismd_pts_t CIntelSMDGlobals::GetAudioPauseCurrentTime() +{ + ismd_pts_t start = GetAudioStartPts(); + + if (start == ISMD_NO_PTS || (GetCurrentTime() < GetBaseTime())) + return ISMD_NO_PTS; + + return start + GetPauseCurrentTime() - GetBaseTime(); +} + +ismd_pts_t CIntelSMDGlobals::GetVideoPauseCurrentTime() +{ + ismd_pts_t start = GetVideoStartPts(); + + if (start == ISMD_NO_PTS || (GetCurrentTime() < GetBaseTime())) + return ISMD_NO_PTS; + + return start + GetPauseCurrentTime() - GetBaseTime(); +} + +ismd_pts_t CIntelSMDGlobals::Resync(bool bDisablePtsCorrection) +{ + ismd_pts_t audioStart; + ismd_pts_t videoStart; + ismd_pts_t deltaPTS; + ismd_pts_t eps = 10000; + ismd_pts_t newPTS; + + audioStart = GetAudioStartPts(); + videoStart = GetVideoStartPts(); + + if (audioStart == ISMD_NO_PTS) + return ISMD_NO_PTS; + + if (videoStart == ISMD_NO_PTS) + return audioStart; + + deltaPTS = abs(videoStart - audioStart); + + if (deltaPTS == 0) + return videoStart; + + if (bDisablePtsCorrection) + CLog::Log(LOGINFO, "CIntelSMDGlobals::Resync no pts correction"); + + if (deltaPTS > eps && deltaPTS < 90000 * 15 && !bDisablePtsCorrection) + { + if (videoStart < audioStart) + newPTS = videoStart + deltaPTS / 4; + else + newPTS = videoStart - deltaPTS / 4; + } + else + { + newPTS = audioStart; + } + + return newPTS; +} + +void CIntelSMDGlobals::CreateStartPacket(ismd_pts_t start_pts, + ismd_buffer_handle_t buffer_handle) +{ + CSingleLock lock(m_Lock); + + ismd_newsegment_tag_t newsegment_data; + ismd_result_t ismd_ret; + + if (buffer_handle == 0) + { + CLog::Log(LOGWARNING, "CIntelSMDGlobals::CreateStartPacket buffer_handle = NULL"); + return; + } + + //printf("***Create start packet to Video renderer. pts = %.2f", IsmdToDvdPts(start_pts) / 1000000); + + newsegment_data.linear_start = 0; + newsegment_data.start = start_pts; + newsegment_data.stop = ISMD_NO_PTS; + newsegment_data.requested_rate = ISMD_NORMAL_PLAY_RATE; + newsegment_data.applied_rate = ISMD_NORMAL_PLAY_RATE; + newsegment_data.rate_valid = true; + newsegment_data.segment_position = ISMD_NO_PTS; + + ismd_ret = ismd_tag_set_newsegment_position(buffer_handle, newsegment_data); + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::SendStartPacket ismd_tag_set_newsegment failed"); + return; + } +} + +void CIntelSMDGlobals::SendStartPacket(ismd_pts_t start_pts, + ismd_port_handle_t port, ismd_buffer_handle_t buffer) +{ + CSingleLock lock(m_Lock); + + ismd_newsegment_tag_t newsegment_data; + ismd_buffer_handle_t buffer_handle; + ismd_result_t ismd_ret; + //create a carrier buffer for the new segment + if (buffer != 0) + buffer_handle = buffer; + else + { + ismd_ret = ismd_buffer_alloc(0, &buffer_handle); + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::SendStartPacket ismd_buffer_alloc failed"); + return; + } + } + + /* + printf("***Sending start packet to "); + if(port == m_viddec_input_port) + printf("Video decoder. pts = %.2f", IsmdToDvdPts(start_pts) / 1000000); + else if(port == m_video_input_port_proc) + printf("Video proc. pts = %.2f", IsmdToDvdPts(start_pts) / 1000000); + else if(port == m_audio_inputPort) + printf("Audio device. pts = %.2f", IsmdToDvdPts(start_pts) / 1000000); + else + printf("Unknown input. pts = %.2f", IsmdToDvdPts(start_pts) / 1000000); + */ + + newsegment_data.linear_start = 0; + newsegment_data.start = start_pts; + newsegment_data.stop = ISMD_NO_PTS; + newsegment_data.requested_rate = ISMD_NORMAL_PLAY_RATE; + newsegment_data.applied_rate = ISMD_NORMAL_PLAY_RATE; + newsegment_data.rate_valid = true; + newsegment_data.segment_position = ISMD_NO_PTS; + + ismd_ret = ismd_tag_set_newsegment_position(buffer_handle, newsegment_data); + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::SendStartPacket ismd_tag_set_newsegment failed"); + return; + } + + ismd_ret = ismd_port_write(port, buffer_handle); + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::SendStartPacket ismd_port_write failed"); + return; + } +} + +bool CIntelSMDGlobals::CreateDemuxer() +{ + ismd_result_t ismd_ret; + unsigned output_buf_size = 0; + + if(m_demux != -1) + { + CLog::Log(LOGWARNING, "CIntelSMDGlobals::CreateDemuxer demux is already open, closing"); + DeleteDemuxer(); + } + + ismd_ret = ismd_demux_stream_open( + ISMD_DEMUX_STREAM_TYPE_MPEG2_TRANSPORT_STREAM, &m_demux, + &m_demux_input_port); + + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::CreateDemuxer ismd_demux_stream_open failed %d", ismd_ret); + return false; + } + + // create the video filter + output_buf_size = 32 * 1024; + ismd_ret = ismd_demux_filter_open(m_demux, ISMD_DEMUX_OUTPUT_ES, + output_buf_size, &m_demux_ves_filter_handle, &m_demux_video_port); + + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::CreateDemuxer failed at ismd_demux_filter_open %d", ismd_ret); + return false; + } + + // create the audio filter + output_buf_size = 8 * 1024; + ismd_ret = ismd_demux_filter_open(m_demux, ISMD_DEMUX_OUTPUT_ES, + output_buf_size, &m_demux_aes_filter_handle, &m_demux_audio_port); + + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::CreateDemuxer failed at ismd_demux_filter_open %d", ismd_ret); + return false; + } + + // Clock + ismd_ret = ismd_dev_set_clock(m_demux, m_main_clock); + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::CreateDemuxer: failed at ismd_dev_set_clock %d", ismd_ret); + return false; + } + + ismd_ret = ismd_demux_stream_use_arrival_time(m_demux, true); + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::CreateDemuxer: failed at ismd_demux_stream_use_arrival_time %d", ismd_ret); + return false; + } + + ismd_ret = ismd_dev_set_state(m_demux, ISMD_DEV_STATE_PAUSE); + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::CreateDemuxer:failed at ismd_dev_set_state %d", ismd_ret); + return false; + } + + ismd_ret = ismd_demux_enable_leaky_filters(m_demux); + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::CreateDemuxer:failed at ismd_demux_enable_leaky_filters %d", ismd_ret); + return false; + } + + return true; +} + +bool CIntelSMDGlobals::DeleteDemuxer() +{ + ismd_result_t res = ISMD_ERROR_UNSPECIFIED; + + if (m_demux == -1) + return true; + + SetDemuxDeviceState(ISMD_DEV_STATE_STOP); + FlushDemuxer(); + + if (m_demux_ves_filter_handle != -1) + ismd_demux_filter_close(m_demux, m_demux_ves_filter_handle); + + if (m_demux_aes_filter_handle != -1) + ismd_demux_filter_close(m_demux, m_demux_aes_filter_handle); + + ismd_dev_close(m_demux); + + m_demux = -1; + m_demux_ves_filter_handle = -1; + m_demux_aes_filter_handle = -1; + m_demux_input_port = -1; + + m_demux_video_port = -1; + m_demux_audio_port = -1; + + m_bDemuxToAudio = false; + m_bDemuxToVideo = false; + + return true; +} + +bool CIntelSMDGlobals::FlushDemuxer() +{ + CSingleLock lock(m_Lock); + ismd_result_t ret = ISMD_ERROR_UNSPECIFIED; + + SetDemuxDeviceState(ISMD_DEV_STATE_PAUSE); + + if (m_demux != -1) + ret = ismd_dev_flush(m_demux); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::FlushDemuxer ismd_dev_flush failed %d", ret); + return false; + } + + return true; +} + +bool CIntelSMDGlobals::SetDemuxDeviceState(ismd_dev_state_t state) +{ + ismd_result_t ret; + + if (state == ISMD_DEV_STATE_INVALID) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::SetDemuxDeviceState setting device to invalid"); + return true; + } + + CSingleLock lock(m_Lock); + + if (m_demux == -1) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::SetDemuxDeviceState device = -1"); + return false; + } + + ret = ismd_dev_set_state(m_demux, state); + if (ret != ISMD_SUCCESS) + CLog::Log( + LOGWARNING, + "CIntelSMDGlobals::SetDemuxDeviceState ismd_dev_set_state %d on demux device failed %d", + state, ret); + + CLog::Log(LOGDEBUG, "SetDemuxDeviceState state %d ret %d", state, ret); + + return true; +} + +bool CIntelSMDGlobals::ConnectDemuxerToAudio(ismd_dev_t audio_device) +{ + ismd_result_t ismd_ret; + ismd_port_handle_t demux_output_port; + ismd_port_handle_t audio_input; + + CLog::Log(LOGDEBUG, "ConnectDemuxerToAudio"); + + ismd_ret = ismd_demux_filter_get_output_port(m_demux, m_demux_aes_filter_handle, &demux_output_port); + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConnectDemuxerToAudio failed at ismd_demux_filter_get_output_port %d", ismd_ret); + return false; + } + + ismd_ret = ismd_audio_input_get_port(m_audioProcessor, audio_device, &audio_input); + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConnectDemuxerToAudio failed at ismd_audio_input_get_port, %d", ismd_ret); + return false; + } + + ismd_ret = ismd_port_connect(demux_output_port, audio_input); + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "failed at ismd_port_connect, ts_aud to audio"); + return false; + } + + m_bDemuxToAudio = true; + + return true; +} + +bool CIntelSMDGlobals::ConnectDemuxerToVideo() +{ + ismd_result_t ismd_ret; + ismd_port_handle_t demux_output_port; + + CLog::Log(LOGDEBUG, "ConnectDemuxerToVideo"); + + if(GetVidDecInput() == -1) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConnectDemuxerToVideo failed GetVidDecInput is -1\n"); + return false; + } + + ismd_ret = ismd_demux_filter_get_output_port(m_demux, m_demux_ves_filter_handle, &demux_output_port); + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConnectDemuxerToVideo failed at ismd_port_connect, ts_vid to viddec %d", ismd_ret); + return false; + } + + ismd_ret = ismd_port_connect(demux_output_port, GetVidDecInput()); + if (ismd_ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConnectDemuxerToVideo failed at ismd_port_connect, ts_vid to viddec\n"); + return false; + } + + m_bDemuxToVideo = true; + + return true; +} + +bool CIntelSMDGlobals::SetDemuxDeviceBaseTime(ismd_time_t time) +{ + //printf("%s", __FUNCTION__); + CLog::Log(LOGDEBUG, "SetDemuxDeviceBaseTime base time %.2f", + IsmdToDvdPts(time) / 1000000); + + ismd_result_t ret; + ismd_dev_state_t state = ISMD_DEV_STATE_INVALID; + + CSingleLock lock(m_Lock); + + if (m_demux != -1) + { + ismd_dev_get_state(m_demux, &state); + if (state == ISMD_DEV_STATE_PLAY) + { + CLog::Log(LOGWARNING, + "CIntelSMDGlobals::SetDemuxDeviceBaseTime device is running. Ignoring request"); + return true; + } + + ret = ismd_dev_set_stream_base_time(m_demux, time); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::SetDemuxDeviceBaseTime ismd_dev_set_stream_base_time for demux device failed"); + } + } + + return true; +} + +bool CIntelSMDGlobals::CreateVideoDecoder(ismd_codec_type_t codec_type) +{ + CLog::Log(LOGDEBUG, "%s", __FUNCTION__); + + ismd_result_t res; + + CSingleLock lock(m_Lock); + + if (m_viddec != -1) + return true; + + // open decoder + res = ismd_viddec_open(codec_type, &m_viddec); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "viddec open failed <%d>", res); + return false; + } + + res = ismd_viddec_get_input_port(m_viddec, &m_viddec_input_port); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "viddec get input port failed <%d>", res); + return false; + } + + res = ismd_viddec_get_output_port(m_viddec, &m_viddec_output_port); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "viddec get output port failed <%d>", res); + return false; + } + + res = ismd_viddec_set_pts_interpolation_policy(m_viddec, + ISMD_VIDDEC_INTERPOLATE_MISSING_PTS, 0); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_viddec_set_pts_interpolation_policy failed <%d>", + res); + return false; + } + + res = ismd_viddec_set_max_frames_to_decode(m_viddec, ISMD_VIDDEC_ALL_FRAMES); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_viddec_set_max_frames_to_decode failed <%d>", + res); + return false; + } + + // set default fps + /* + res = ismd_viddec_set_frame_rate(m_viddec, 30000, 1001, false); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_viddec_set_frame_rate failed <%d>", res); + return false; + } + */ + + /* + res = ismd_viddec_set_frame_output_policy(m_viddec, ISMD_VIDDEC_DECODE_ORDER); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_viddec_set_frame_output_policy failed <%d>", res); + return false; + } + */ + SetVideoDecoderState(ISMD_DEV_STATE_PAUSE); + + m_video_codec = codec_type; + + return true; +} + +bool CIntelSMDGlobals::CreateVidDecUserDataPort() +{ + ismd_result_t res; + + res = ismd_viddec_get_user_data_port(m_viddec, &m_viddec_user_data_port); + if (res != ISMD_SUCCESS) + { + CLog::Log( + LOGERROR, + "CIntelSMDGlobals::CreateVidDecUserDataPort ismd_viddec_get_user_data_port failed <%d>", + res); + return false; + } + + res = ismd_event_alloc(&m_viddec_user_data_event); + if (res != ISMD_SUCCESS) + { + CLog::Log( + LOGERROR, + "CIntelSMDGlobals::CreateVidDecUserDataPort ismd_event_alloc failed <%d>", + res); + return false; + } + + res = ismd_port_attach(m_viddec_user_data_port, m_viddec_user_data_event, + ISMD_QUEUE_EVENT_NOT_EMPTY, ISMD_QUEUE_WATERMARK_NONE); + if (res != ISMD_SUCCESS) + { + CLog::Log( + LOGERROR, + "CIntelSMDGlobals::CreateVidDecUserDataPort ismd_port_attach failed <%d>", + res); + return false; + } + + return true; +} + +bool CIntelSMDGlobals::DeleteVideoDecoder() +{ + CLog::Log(LOGDEBUG, "%s", __FUNCTION__); + + ismd_result_t res; + + if (m_viddec == -1) + return true; + + SetVideoDecoderState(ISMD_DEV_STATE_STOP); + FlushVideoDecoder(); + + ismd_dev_close(m_viddec); + + m_viddec = -1; + m_viddec_input_port = -1; + m_viddec_output_port = -1; + m_viddec_user_data_port = -1; + m_viddec_user_data_event = -1; + m_bDemuxToVideo = false; + + return true; +} + +bool CIntelSMDGlobals::PrintVideoStreamStats() +{ + ismd_result_t result; + ismd_viddec_stream_statistics_t stat; + + result = ismd_viddec_get_stream_statistics(m_viddec, &stat); + + if (result == ISMD_SUCCESS) + CLog::Log(LOGDEBUG, + "current_bit_rate %lu \ + total_bytes %lu \ + frames_decoded %lu \ + frames_dropped %lu \ + error_frames %lu \ + invalid_bitstream_syntax_errors %lu \ + unsupported_profile_errors %lu \ + unsupported_level_errors %lu \ + unsupported_feature_errors %lu \ + unsupported_resolution_errors %lu ", + + stat.current_bit_rate, stat.total_bytes, stat.frames_decoded, + stat.frames_dropped, stat.error_frames, + stat.invalid_bitstream_syntax_errors, stat.unsupported_profile_errors, + stat.unsupported_level_errors, stat.unsupported_feature_errors, + stat.unsupported_resolution_errors); + else + CLog::Log(LOGERROR, "CIntelSMDGlobals::PrintVideoStreamStats failed"); + + return (result == ISMD_SUCCESS); +} + +bool CIntelSMDGlobals::PrintVideoStreaProp() +{ + ismd_result_t result; + + ismd_viddec_stream_properties_t prop; + + result = ismd_viddec_get_stream_properties(m_viddec, &prop); + + if (result == ISMD_SUCCESS) + CLog::Log(LOGDEBUG, + "codec_type %lu \ + nom_bit_rate %lu \ + frame_rate_num %lu \ + frame_rate_den %lu \ + coded_height %lu \ + coded_width %lu \ + display_height %lu \ + display_width %lu \ + profile %lu \ + level %lu \ + is_stream_interlaced %lu \ + sample_aspect_ratio %lu ", + prop.codec_type, prop.nom_bit_rate, prop.frame_rate_num, + prop.frame_rate_den, prop.coded_height, prop.coded_width, + prop.display_height, prop.display_width, prop.profile, prop.level, + prop.is_stream_interlaced, prop.sample_aspect_ratio); + else + CLog::Log(LOGERROR, "CIntelSMDGlobals::PrintVideoStreaProp failed"); + + return (result == ISMD_SUCCESS); +} + +bool CIntelSMDGlobals::CreateVideoRender(gdl_plane_id_t plane) +{ + CLog::Log(LOGDEBUG, "%s", __FUNCTION__); + + ismd_result_t res; + + CSingleLock lock(m_Lock); + + if (m_video_proc == -1) + { + //Open and initialize DPE + res = ismd_vidpproc_open(&m_video_proc); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_vidpproc_open failed. %d", res); + return false; + } + + // We use SCALE_TO_FIT here for the scaling policy because it is easier for + // us to create the dest rect based on baserenderer and tell SMD to scale that way, + // than to reconcile the aspect ratio calculations and convoluded scaling policies + // in SMD which appear to have many edge cases where it 'gives up' + res = ismd_vidpproc_set_scaling_policy(m_video_proc, SCALE_TO_FIT); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_vidpproc_set_scaling_policy failed. %d", res); + return false; + } + + res = ismd_vidpproc_get_input_port(m_video_proc, &m_video_input_port_proc); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_vidpproc_get_input_port failed. %d", res); + return false; + } + + res = ismd_vidpproc_get_output_port(m_video_proc, + &m_video_output_port_proc); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_vidpproc_get_output_port failed. %d", res); + return false; + } + + res = ismd_vidpproc_pan_scan_disable(m_video_proc); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_vidpproc_pan_scan_disable failed. %d", res); + return false; + } + + res = ismd_vidpproc_gaussian_enable(m_video_proc); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_vidpproc_gaussian_enable failed. %d", res); + return false; + } + + res = ismd_vidpproc_deringing_enable(m_video_proc); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_vidpproc_deringing_enable failed. %d", res); + return false; + } + } + + if (m_video_render == -1) + { + //Open and initialize Render + res = ismd_vidrend_open(&m_video_render); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ERROR: FAIL TO OPEN VIDEO RENDERER ....."); + return false; + } + + res = ismd_vidrend_get_input_port(m_video_render, + &m_video_input_port_renderer); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ERROR: FAIL TO GET INPUT PORT FOR RENDERER ....."); + return false; + } + + res = ismd_dev_set_clock(m_video_render, m_main_clock); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ERROR: FAIL TO SET CLOCK FOR RENDERER ....."); + return false; + } + + res = ismd_clock_set_vsync_pipe(m_main_clock, 0); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ERROR: ismd_clock_set_vsync_pipe ....."); + return false; + } + + res = ismd_vidrend_set_video_plane(m_video_render, plane); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, " ERROR: FAIL TO SET GDL UPP FOR THIS RENDERER ....."); + return false; + } + + res = ismd_vidrend_set_flush_policy(m_video_render, + ISMD_VIDREND_FLUSH_POLICY_REPEAT_FRAME); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::CreateVideoRender ismd_vidrend_set_flush_policy failed"); + return false; + } + + res = ismd_vidrend_set_stop_policy(m_video_render, + ISMD_VIDREND_STOP_POLICY_DISPLAY_BLACK); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::CreateVideoRender ismd_vidrend_set_stop_policy failed"); + return false; + } + + res = ismd_vidrend_enable_max_hold_time(m_video_render, 30, 1); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::CreateVideoRender ismd_vidrend_enable_max_hold_time failed"); + return false; + } + } + + //Connect DPE and Render + if (m_video_output_port_proc != -1 && m_video_input_port_renderer != -1) + { + res = ismd_port_connect(m_video_output_port_proc, + m_video_input_port_renderer); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "IntelSMDGlobals::CreateVideoRender ismd_port_connect failed"); + return false; + } + } + else + { + CLog::Log(LOGERROR, "IntelSMDGlobals::CreateVideoRender failed"); + return false; + } + + SetVideoRenderState(ISMD_DEV_STATE_PAUSE); + m_RenderState = ISMD_DEV_STATE_PAUSE; + + return true; +} + +bool CIntelSMDGlobals::MuteVideoRender(bool mute) +{ + ismd_result_t res; + + if (m_video_render == -1) + return false; + + res = ismd_vidrend_mute(m_video_render, mute ? ISMD_VIDREND_MUTE_DISPLAY_BLACK_FRAME : ISMD_VIDREND_MUTE_NONE); + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::MuteVideoRender with %d failed. %d", mute, res); + return false; + } + + return true; +} + +float CIntelSMDGlobals::GetRenderFPS() +{ + ismd_result_t res; + float fps = 0; + ismd_vidrend_status_t status; + ismd_vidrend_stats_t stat; + + if (m_video_render == -1) + return 0; + + res = ismd_vidrend_get_status(m_video_render, &status); + if (res == ISMD_SUCCESS) + res = ismd_vidrend_get_stats(m_video_render, &stat); + + if (res == ISMD_SUCCESS) + // we want to make sure some frames were actually rendered + if (stat.frames_displayed > 30) + fps = 90000.0f / status.content_pts_interval; + + return fps; +} + +float CIntelSMDGlobals::GetDecoderFPS() +{ + float fps = 0; + + // check some frames were actually rendered + if (GetRenderFPS() == 0) + return 0; + + ismd_viddec_stream_properties_t prop; + ismd_result_t res = ismd_viddec_get_stream_properties(GetVidDec(), &prop); + if (res == ISMD_SUCCESS) + { + int num = prop.frame_rate_num; + int den = prop.frame_rate_den; + if (num != 0 && den != 0) + { + fps = (float) num / (float) den; + //printf("SMD fps %f", fps); + } + } + + return fps; +} + +ismd_result_t CIntelSMDGlobals::GetPortStatus(ismd_port_handle_t port, + unsigned int& curDepth, unsigned int& maxDepth) +{ + ismd_result_t ret; + ismd_port_status_t portStatus; + + ret = ismd_port_get_status(port, &portStatus); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::GetPortStatus ismd_port_get_status failed %d", ret); + curDepth = -1; + maxDepth = -1; + return ret; + } + + curDepth = portStatus.cur_depth; + maxDepth = portStatus.max_depth; + + return ret; +} + +double CIntelSMDGlobals::GetFrameDuration() +{ + ismd_result_t res; + float duration = 0; + ismd_vidrend_status_t status; + ismd_vidrend_stats_t stat; + + if (m_video_render == -1) + return 0; + + res = ismd_vidrend_get_status(m_video_render, &status); + if (res == ISMD_SUCCESS) + res = ismd_vidrend_get_stats(m_video_render, &stat); + + if (res == ISMD_SUCCESS) + // we want to make sure some frames were actually rendered + if (stat.frames_displayed > 30) + duration = IsmdToDvdPts(status.content_pts_interval); + + return duration; +} + +bool CIntelSMDGlobals::DeleteVideoRender() +{ + CLog::Log(LOGDEBUG, "%s", __FUNCTION__); + + SetVideoRenderState(ISMD_DEV_STATE_STOP); + FlushVideoRender(); + + if (m_video_proc != 1) + ismd_dev_close(m_video_proc); + if (m_video_render != -1) + ismd_dev_close(m_video_render); + + m_video_proc = -1; + m_video_input_port_proc = 0; + m_video_output_port_proc = 0; + + m_video_render = -1; + m_video_input_port_renderer = -1; + m_video_output_port_renderer = -1; + + return true; +} + +bool CIntelSMDGlobals::ConnectDecoderToRenderer() +{ + CLog::Log(LOGDEBUG, "%s", __FUNCTION__); + + ismd_result_t ret; + + if (m_viddec_output_port != -1 && m_video_input_port_proc != -1) + { + ret = ismd_port_connect(m_viddec_output_port, m_video_input_port_proc); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "IntelSMDGlobals::ConnectDecoderToRenderer ismd_port_connect failed"); + return false; + } + } + else + { + CLog::Log(LOGERROR, "IntelSMDGlobals::ConnectDecoderToRenderer failed"); + return false; + } + + return true; +} + +bool CIntelSMDGlobals::PrintRenderStats() +{ + ismd_result_t result; + ismd_vidrend_stats_t stat; + + result = ismd_vidrend_get_stats(m_video_render, &stat); + + if (result == ISMD_SUCCESS) + CLog::Log(LOGDEBUG, + "vsyncs_frame_received %d\ + vsyncs_frame_skipped %d\ + vsyncs_top_received %d\ + vsyncs_top_skipped %d\ + vsyncs_bottom_received %d\ + vsyncs_bottom_skipped %d\ + frames_input %d\ + frames_displayed %d\ + frames_released %d\ + frames_dropped %d\ + frames_repeated %d\ + frames_late %d\ + frames_out_of_order %d\ + frames_out_of_segment %d\ + late_flips %d", + + stat.vsyncs_frame_received, stat.vsyncs_frame_skipped, + stat.vsyncs_top_received, stat.vsyncs_top_skipped, + stat.vsyncs_bottom_received, stat.vsyncs_bottom_skipped, + stat.frames_input, stat.frames_displayed, stat.frames_released, + stat.frames_dropped, stat.frames_repeated, stat.frames_late, + stat.frames_out_of_order, stat.frames_out_of_segment, stat.late_flips); + else + CLog::Log(LOGERROR, "CIntelSMDGlobals::PrintRenderStats failed"); + + return result == ISMD_SUCCESS; +} + +bool CIntelSMDGlobals::CreateAudioProcessor() +{ + CLog::Log(LOGDEBUG, "CIntelSMDGlobals::CreateAudioProcessor"); + + ismd_result_t result; + + if (m_audioProcessor != -1) + return true; + + result = ismd_audio_open_global_processor(&m_audioProcessor); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDAudioRenderer::Initialize - error open global processor: %d", result); + return false; + } + + // Configure the master clock frequency + ConfigureMasterClock(48000); + + return true; +} + +bool CIntelSMDGlobals::DeleteAudioProcessor() +{ + CLog::Log(LOGDEBUG, "%s", __FUNCTION__); + + ismd_result_t result; + + if (m_audioProcessor == -1) + return true; + + CHalServicesFactory::GetInstance().SetAudioDACState(false); + + result = ismd_audio_close_processor(m_audioProcessor); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::DestroyAudioProcessor - error closing device: %d", result); + CHalServicesFactory::GetInstance().SetAudioDACState(true); + return false; + } + + m_audioProcessor = -1; + + // This should invalidate all devices + m_bDemuxToAudio = false; + + CHalServicesFactory::GetInstance().SetAudioDACState(true); + + return true; +} + +bool CIntelSMDGlobals::ConfigureMasterClock(unsigned int frequency) +{ + ismd_result_t result; + + // Set clock source (EXTERNAL for CE4100) + ismd_audio_clk_src_t clockSource = ISMD_AUDIO_CLK_SRC_EXTERNAL; + + unsigned int clockrate = 0; + switch (frequency) + { + case 12000: + case 32000: + case 48000: + case 96000: + case 192000: + clockrate = 36864000; + break; + case 44100: + case 88200: + case 176400: + clockrate = 33868800; + break; + default: + break; + } + + if(clockrate == 0) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConfigureMasterClock - unknown frequency %d", frequency); + return false; + } + + result = ismd_audio_configure_master_clock(m_audioProcessor, clockrate, clockSource); + + if(result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::ConfigureMasterClock - configure_audio_master_clock %d failed (%d)!", clockrate, result); + return false; + } + + return true; +} + +bool CIntelSMDGlobals::EnableAudioInput(ismd_dev_t audioDev) +{ + ismd_result_t result; + + if (audioDev == -1 || m_audioProcessor == -1) + return true; + + result = ismd_audio_input_enable(m_audioProcessor, audioDev); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::EnableAudioInput failed %d", result); + return false; + } + + return true; +} + +bool CIntelSMDGlobals::DisableAudioInput(ismd_dev_t audioDev) +{ + ismd_result_t result; + + if (audioDev == -1 || m_audioProcessor == -1) + return true; + + result = ismd_audio_input_disable(m_audioProcessor, audioDev); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::DisableAudioInput failed %d", result); + return false; + } + + return true; +} + + +bool CIntelSMDGlobals::EnableAudioOutput(ismd_audio_output_t audio_output) +{ + ismd_result_t result; + + if (m_audioProcessor == -1) + return true; + + result = ismd_audio_output_enable(m_audioProcessor, audio_output); + + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::EnableAudioOutput failed - %d", result); + return false; + } + + return true; +} + +bool CIntelSMDGlobals::DisableAudioOutput(ismd_audio_output_t audio_output) +{ + ismd_result_t result; + + if (m_audioProcessor == -1) + return true; + + result = ismd_audio_output_disable(m_audioProcessor, audio_output); + + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::DisableAudioOutput failed - %d", result); + return false; + } + + return true; +} + +bool CIntelSMDGlobals::ConfigureAudioOutput(ismd_audio_output_t output, ismd_audio_output_config_t output_config) +{ + ismd_result_t result; + + result = ismd_audio_output_set_delay(m_audioProcessor, output, output_config.stream_delay); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGWARNING, "CIntelSMDGlobals::ConfigureAudioOutput ismd_audio_output_set_delay failed %d", result); + return false; + } + + result = ismd_audio_output_set_sample_size(m_audioProcessor, output, output_config.sample_size); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGWARNING, "CIntelSMDGlobals::ConfigureAudioOutput ismd_audio_output_set_sample_size failed %d", result); + return false; + } + + result = ismd_audio_output_set_channel_config(m_audioProcessor, output, output_config.ch_config); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGWARNING, "CIntelSMDGlobals::ConfigureAudioOutput ismd_audio_output_set_sample_size failed %d", result); + return false; + } + + result = ismd_audio_output_set_mode(m_audioProcessor, output, output_config.out_mode); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGWARNING, "CIntelSMDGlobals::ConfigureAudioOutput ismd_audio_output_set_sample_size failed %d", result); + return false; + } + + result = ismd_audio_output_set_sample_rate(m_audioProcessor, output, output_config.sample_rate); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGWARNING, "CIntelSMDGlobals::ConfigureAudioOutput ismd_audio_output_set_sample_size failed %d", result); + return false; + } + + return true; +} + +bool CIntelSMDGlobals::SetAudioDeviceState(ismd_dev_state_t state, ismd_dev_t device) +{ + ismd_result_t ret; + + if (state == ISMD_DEV_STATE_INVALID) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::SetAudioDeviceState setting device to invalid"); + return true; + } + + if (device == -1) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::SetAudioDeviceState device = -1"); + return false; + } + + CSingleLock lock(m_Lock); + + ret = ismd_dev_set_state(device, state); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGWARNING, "CIntelSMDGlobals::SetAudioDeviceState ismd_dev_set_state %d on audio device %d failed %d", + state, device, ret); + } + + return true; +} + +ismd_dev_state_t CIntelSMDGlobals::GetAudioDeviceState(ismd_dev_t audioDev) +{ + //printf("CIntelSMDGlobals::GetAudioDeviceState"); + + CSingleLock lock(m_Lock); + + ismd_result_t ret; + ismd_dev_state_t state; + + if (audioDev == -1) + { + //printf("CIntelSMDGlobals::GetAudioDeviceState audioDev = -1"); + return ISMD_DEV_STATE_INVALID; + } + + ret = ismd_dev_get_state(audioDev, &state); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::GetAudioDeviceState ismd_dev_get_state failed %d", + ret); + return ISMD_DEV_STATE_INVALID; + } + + return state; +} + +bool CIntelSMDGlobals::SetVideoDecoderState(ismd_dev_state_t state) +{ + //printf("%s Video Decoder State: %d", __FUNCTION__, state); + CSingleLock lock(m_Lock); + + ismd_result_t ret; + + if (state == ISMD_DEV_STATE_INVALID) + { + CLog::Log(LOGWARNING, + "CIntelSMDGlobals::SetVideoDecoderState setting device to invalid"); + return true; + } + + if (m_viddec != -1) + { + ret = ismd_dev_set_state(m_viddec, state); + if (ret != ISMD_SUCCESS) + { + CLog::Log( + LOGWARNING, + "CIntelSMDGlobals::SetVideoDecoderState ismd_dev_set_state on video decoder failed %d", + ret); + return true; + } + } + + CLog::Log(LOGDEBUG, "SetVideoDecoderState state %d ret %d", state, ret); + + return true; +} + +bool CIntelSMDGlobals::SetVideoRenderState(ismd_dev_state_t state) +{ + //printf("%s Video Render State: %d", __FUNCTION__, state); + + CSingleLock lock(m_Lock); + + ismd_result_t ret; + + if (state == ISMD_DEV_STATE_INVALID) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::SetVideoRenderState setting device to invalid"); + return true; + } + + if (m_video_proc != -1) + { + ret = ismd_dev_set_state(m_video_proc, state); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::SetVideoRenderState ismd_dev_set_state on video proc failed %d", + ret); + return false; + } + } + + /* + if(state == ISMD_DEV_STATE_PLAY) + { + ret = ismd_vidrend_set_flush_policy(m_video_render, ISMD_VIDREND_FLUSH_POLICY_DISPLAY_BLACK); + if (ret != ISMD_SUCCESS) + { + printf("CIntelSMDGlobals::SetVideoRenderState ismd_vidrend_set_flush_policy failed before play"); + return false; + } + } + */ + + if (m_video_render != -1) + { + ret = ismd_dev_set_state(m_video_render, state); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::SetVideoRenderState ismd_dev_set_state on video render failed %d", + ret); + return false; + } + } + + /* + if(state == ISMD_DEV_STATE_PAUSE) + { + ret = ismd_vidrend_set_flush_policy(m_video_render, ISMD_VIDREND_FLUSH_POLICY_REPEAT_FRAME); + if (ret != ISMD_SUCCESS) + { + printf("CIntelSMDGlobals::SetVideoRenderState ismd_vidrend_set_flush_policy failed after pause"); + return false; + } + } + */ + + m_RenderState = state; + + CLog::Log(LOGDEBUG, "SetRenderrState state %d ret %d", state, ret); + + return true; +} + +bool CIntelSMDGlobals::FlushAudioDevice(ismd_dev_t audioDev) +{ + //printf("CIntelSMDGlobals::FlushAudioDevice", __FUNCTION__); + + CSingleLock lock(m_Lock); + ismd_result_t ret = ISMD_ERROR_UNSPECIFIED; + + SetAudioDeviceState(ISMD_DEV_STATE_PAUSE, audioDev); + + if (audioDev != -1) + { + ret = ismd_dev_flush(audioDev); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGDEBUG, "CIntelSMDGlobals::FlushAudioDevice ismd_dev_flush timed failed %d", ret); + return false; + } + } + + return true; +} + +bool CIntelSMDGlobals::FlushVideoDecoder() +{ + CSingleLock lock(m_Lock); + ismd_result_t ret = ISMD_ERROR_UNSPECIFIED; + + if(m_viddec == -1) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::FlushVideoDecoder m_viddec == -1"); + return false; + } + + SetVideoDecoderState(ISMD_DEV_STATE_PAUSE); + + if (m_viddec != -1) + ret = ismd_dev_flush(m_viddec); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::FlushVideoDecoder ismd_dev_flush failed %d", ret); + return false; + } + + return true; +} + +bool CIntelSMDGlobals::FlushVideoRender() +{ + //printf("CIntelSMDGlobals::FlushVideoRender"); + + CSingleLock lock(m_Lock); + ismd_result_t ret; + + if(m_video_render == -1) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::FlushVideoDecoder m_video_render == -1"); + return false; + } + + if (m_video_render != -1) + ret = ismd_vidrend_set_flush_policy(m_video_render, + ISMD_VIDREND_FLUSH_POLICY_REPEAT_FRAME); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::CreateVideoRender ismd_vidrend_set_flush_policy failed after pause"); + return false; + } + + SetVideoRenderState(ISMD_DEV_STATE_PAUSE); + + if (m_video_proc != -1) + ret = ismd_dev_flush(m_video_proc); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::FlushVideoRender ismd_dev_flush video proc failed %d", + ret); + return false; + } + + if (m_video_render != -1) + ret = ismd_dev_flush(m_video_render); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::FlushVideoRender ismd_dev_flush failed %d", + ret); + return false; + } + + return true; +} + +bool CIntelSMDGlobals::SetVideoRenderBaseTime(ismd_time_t time) +{ + //printf("%s", __FUNCTION__); + CLog::Log(LOGINFO, "SetVideoRenderBaseTime base time %.2f", + IsmdToDvdPts(time) / 1000000); + + ismd_result_t ret; + ismd_dev_state_t state = ISMD_DEV_STATE_INVALID; + + CSingleLock lock(m_Lock); + + if (m_RenderState == ISMD_DEV_STATE_PLAY) + { + //printf("Warning - Trying to set base time on renderer while in play mode. Ignoring"); + return true; + } + + if (m_video_render != -1) + { +// printf("CIntelSMDGlobals::SetVideoRenderBaseTime current state %d setting time to %.2f", state, IsmdToDvdPts(time) / 1000000.0f); + ret = ismd_dev_get_state(m_video_render, &state); + if (ret != ISMD_SUCCESS) + { + // Currently SDK always return error when trying to get renderer state + //printf("CIntelSMDGlobals::SetVideoRenderBaseTime ismd_dev_get_state failed %d", ret); + } + else if (state == ISMD_DEV_STATE_PLAY) + { + CLog::Log(LOGDEBUG, "CIntelSMDGlobals::SetVideoRenderBaseTime device is running/n"); + return true; + } + + //printf("CIntelSMDGlobals::SetVideoRenderBaseTime current state %d setting time to %.2f", state, IsmdToDvdPts(time) / 1000000.0f); + + ret = ismd_dev_set_stream_base_time(m_video_render, time); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::SetVideoRenderBaseTime ismd_dev_set_stream_base_time for video render failed %d", + ret); + return false; + } + } + + return true; +} + +bool CIntelSMDGlobals::SetAudioDeviceBaseTime(ismd_time_t time, ismd_dev_t device) +{ + //printf("%s", __FUNCTION__); + CLog::Log(LOGINFO, "SetAudioDeviceBaseTime base time %.2f", + IsmdToDvdPts(time) / 1000000); + + ismd_result_t ret; + ismd_dev_state_t state = ISMD_DEV_STATE_INVALID; + + CSingleLock lock(m_Lock); + + if (device != -1) + { + ret = ismd_dev_get_state(device, &state); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::SetAudioDeviceState ismd_dev_get_state for audio device %d failed %d", device, ret); + } + if (state == ISMD_DEV_STATE_PLAY) + { + CLog::Log(LOGDEBUG, "CIntelSMDGlobals::SetAudioDeviceBaseTime device is running. Ignoring request"); + return true; + } + + ret = ismd_dev_set_stream_base_time(device, time); + if (ret != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::SetAudioDeviceState ismd_dev_set_stream_base_time for audio device %d failed %d", device, ret); + } + } + + return true; +} + +void CIntelSMDGlobals::Mute(bool bMute) +{ + ismd_audio_processor_t audioProcessor = g_IntelSMDGlobals.GetAudioProcessor(); + if (audioProcessor == -1) + { + CLog::Log(LOGERROR, "CIntelSMDGlobals::%s - audioProcessor == -1", + __FUNCTION__); + return; + } + ismd_audio_mute(audioProcessor, bMute); +} + +bool CIntelSMDGlobals::SetMasterVolume(int nVolume) +{ + ismd_audio_processor_t audioProcessor = g_IntelSMDGlobals.GetAudioProcessor(); + if (audioProcessor == -1) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::SetMasterVolume - audioProcessor == -1"); + return false; + } + + bool muted = false; + ismd_result_t result = ismd_audio_is_muted(audioProcessor, &muted); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDGlobals::CIntelSMDGlobals - ismd_audio_is_muted failed. %d", + result); + return false; + } + + if (nVolume == VOLUME_MINIMUM) + { + if (!muted) + result = ismd_audio_mute(audioProcessor, true); + } + else + { + if (muted) + result = ismd_audio_mute(audioProcessor, false); + + if (result == ISMD_SUCCESS) + { + // SMD volume scales from +18.0dB to -145.0dB with values of +180 to -1450 + // anything over 0dB will cause audio degradation + // in practice -50dB is extremely quiet, so we scale our standard volume from MAX_VOLUME to -30dB + long smdVolume = (long) (((float) nVolume) * 300.0f / 6000.0f); + result = ismd_audio_set_master_volume(audioProcessor, smdVolume); + } + + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, + "CIntelSMDAudioRenderer::Resume - ismd_audio_set_master_volume: %d", + result); + } + } + + return (result == ISMD_SUCCESS); +} + +bool CIntelSMDGlobals::CheckCodecHWDecode(int Codec) +{ + switch(Codec) + { + case CODEC_ID_AC3: + return (ISMD_SUCCESS == ismd_audio_codec_available(ISMD_AUDIO_MEDIA_FMT_DD)); + case CODEC_ID_EAC3: + return (ISMD_SUCCESS == ismd_audio_codec_available(ISMD_AUDIO_MEDIA_FMT_DD_PLUS)); + case CODEC_ID_TRUEHD: + return (ISMD_SUCCESS == ismd_audio_codec_available(ISMD_AUDIO_MEDIA_FMT_TRUE_HD)); + case CODEC_ID_DTS: + return (ISMD_SUCCESS == ismd_audio_codec_available(ISMD_AUDIO_MEDIA_FMT_DTS)); + case SMD_CODEC_DTSHD: + return (ISMD_SUCCESS == ismd_audio_codec_available(ISMD_AUDIO_MEDIA_FMT_DTS_HD)); + case CODEC_ID_AAC_LATM: + return (ISMD_SUCCESS == ismd_audio_codec_available(ISMD_AUDIO_MEDIA_FMT_AAC_LOAS)); + default: + return false; + } +} + +ismd_dev_state_t CIntelSMDGlobals::DVDSpeedToSMD(int dvdSpeed) +{ + switch (dvdSpeed) + { + case DVD_PLAYSPEED_PAUSE: + return ISMD_DEV_STATE_PAUSE; + case DVD_PLAYSPEED_NORMAL: + return ISMD_DEV_STATE_PLAY; + case DVD_PLAYSPEED_STOP: + return ISMD_DEV_STATE_STOP; + default: + return ISMD_DEV_STATE_PLAY; + } +} + +#endif diff --git a/xbmc/cores/IntelSMDGlobals.h b/xbmc/cores/IntelSMDGlobals.h new file mode 100644 index 00000000..7e6199d4 --- /dev/null +++ b/xbmc/cores/IntelSMDGlobals.h @@ -0,0 +1,257 @@ + +/* + * Boxee + * Copyright (c) 2009, Boxee Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#pragma once + +extern "C" +{ +#include +#include +#include +#include +#include +#include +#include +} + +#include "xbmc/utils/SingleLock.h" +#include "dvdplayer/DVDClock.h" + +#define SMD_CLOCK_FREQ 90000 +#define SMD_TO_DVD(time) (double)(((double)(time) / SMD_CLOCK_FREQ) * DVD_TIME_BASE) +#define DVD_TO_SMD(time) (ismd_time_t)(((double)(time) / DVD_TIME_BASE) * SMD_CLOCK_FREQ) +#define HW_AUDIO_DECODING_NUM 9 + +#define MAX_SECTION_SIZE 4096 // Size of largest section that can exist +#define DEMUX_FILTER_SIZE MAX_SECTION_SIZE + +enum InterlaceMode +{ + INTERLACE_MODE_AUTO = 0, + INTERLACE_MODE_VIDEO, + INTERLACE_MODE_FILM, + INTERLACE_MODE_SPATIAL_ONLY, + INTERLACE_MODE_TOP_FIELD_ONLY, + INTERLACE_MODE_SCALE_ONLY, + INTERLACE_MODE_NEVER, +}; + +// arbitrary value to allow communication of DTSHD support +#define SMD_CODEC_DTSHD 0xf0f0f0f0 + +class CIntelSMDGlobals +{ +public: + CIntelSMDGlobals(); + virtual ~CIntelSMDGlobals(); + + ismd_clock_t GetSMDClock() { return m_main_clock; } + ismd_dev_t GetVidDec() { return m_viddec; } + ismd_dev_t GetVidProc() { return m_video_proc; } + ismd_dev_t GetVidRender() { return m_video_render; } + ismd_port_handle_t GetVidDecInput() { return m_viddec_input_port; } + ismd_port_handle_t GetVidDecOutput() { return m_viddec_output_port; } + ismd_port_handle_t GetVideDecUserDataPort() { return m_viddec_user_data_port; } + ismd_port_handle_t GetVidProcInput() { return m_video_input_port_proc; } + ismd_port_handle_t GetVidProcOutput() { return m_video_output_port_proc; } + ismd_port_handle_t GetVidRenderInput() { return m_video_input_port_renderer; } + ismd_port_handle_t GetVidRenderOutput() { return m_video_output_port_renderer; } + ismd_event_t GetVideoDecUserEvent() { return m_viddec_user_data_event; } + bool SetVideoRenderBaseTime(ismd_time_t time); + + bool InitAudio(); + bool DeInitAudio(); + bool CreateAudioProcessor(); + bool DeleteAudioProcessor(); + ismd_audio_processor_t GetAudioProcessor() { return m_audioProcessor; } + bool ConfigureMasterClock(unsigned int frequency); + + ismd_audio_output_t GetHDMIOutput() { return m_audioOutputHDMI; } + ismd_audio_output_t GetSPDIFOutput() { return m_audioOutputSPDIF; } + ismd_audio_output_t GetI2SOutput() { return m_audioOutputI2S0; } + + bool BuildAudioOutputs(); + bool DisableAudioOutput(ismd_audio_output_t audio_output); + bool EnableAudioOutput(ismd_audio_output_t audio_output); + bool ConfigureAudioOutput(ismd_audio_output_t output, ismd_audio_output_config_t output_config); + + bool EnableAudioInput(ismd_dev_t input); + bool DisableAudioInput(ismd_dev_t input); + + bool SetAudioDeviceBaseTime(ismd_time_t time, ismd_dev_t device); + + ismd_dev_t CreateAudioInput(bool timed); + bool RemoveAudioInput(ismd_dev_t device); + + ismd_dev_t GetPrimaryAudioDevice() { return m_primaryAudioInput; } + void SetPrimaryAudioDevice(ismd_dev_t device) { m_primaryAudioInput = device; } + + ismd_port_handle_t GetAudioDevicePort(ismd_dev_t device); + + ismd_time_t GetCurrentTime(); + bool SetCurrentTime(ismd_time_t time); + ismd_time_t GetPauseCurrentTime() { return m_pause_cur_time; } + void SetBaseTime(ismd_time_t time); + ismd_time_t GetBaseTime() { CSingleLock lock(m_Lock); return m_base_time; } + + ismd_result_t GetPortStatus(ismd_port_handle_t port, unsigned int& curDepth, unsigned int& maxDepth); + ismd_dev_state_t GetRenderState() { return m_RenderState; } + bool SetStartPts(ismd_pts_t pts); + bool SetAudioStartPts(ismd_pts_t pts); + bool SetVideoStartPts(ismd_pts_t pts); + ismd_pts_t GetAudioStartPts() { return m_audio_start_pts; } + ismd_pts_t GetVideoStartPts() { return m_video_start_pts; } + ismd_pts_t GetAudioCurrentTime(); + ismd_pts_t GetAudioPauseCurrentTime(); + ismd_pts_t GetVideoCurrentTime(); + ismd_pts_t GetVideoPauseCurrentTime(); + ismd_pts_t Resync(bool bDisablePtsCorrection = false); + + void SetFlushFlag(bool flag) { CSingleLock lock(m_Lock); m_bFlushFlag = flag; } + bool GetFlushFlag() { CSingleLock lock(m_Lock); return m_bFlushFlag; } + + bool CreateMainClock(); + void DestroyMainClock(); + + void PauseClock(); + void ResumeClock(); + void ResetClock(); + + void CreateStartPacket(ismd_pts_t start_pts, ismd_buffer_handle_t buffer_handle); + void SendStartPacket(ismd_pts_t start_pts, ismd_port_handle_t port, ismd_buffer_handle_t buffer = 0); + ismd_pts_t DvdToIsmdPts(double pts); + double IsmdToDvdPts(ismd_pts_t pts); + + bool CreateDemuxer(); + bool DeleteDemuxer(); + ismd_dev_t GetDemuxer() { return m_demux; } + bool FlushDemuxer(); + bool ConnectDemuxerToVideo(); + bool ConnectDemuxerToAudio(ismd_dev_t device); + bool SetDemuxDeviceState(ismd_dev_state_t state); + ismd_port_handle_t GetDemuxInput() { return m_demux_input_port; } + ismd_port_handle_t GetDemuxAudioPort() { return m_demux_audio_port; } + ismd_port_handle_t GetDemuxVideoPort() { return m_demux_video_port; } + ismd_demux_filter_handle_t GetDemuxVideoFilter() { return m_demux_ves_filter_handle; } + ismd_demux_filter_handle_t GetDemuxAudioFilter() { return m_demux_aes_filter_handle; } + + bool SetDemuxDeviceBaseTime(ismd_time_t time); + + bool CreateVideoRender(gdl_plane_id_t plane); + bool DeleteVideoRender(); + bool CreateVideoDecoder(ismd_codec_type_t codec_type); + bool DeleteVideoDecoder(); + bool ConnectDecoderToRenderer(); + bool CreateVidDecUserDataPort(); + + bool MuteVideoRender(bool mute); + + bool SetAudioDeviceState(ismd_dev_state_t state, ismd_dev_t device); + bool SetVideoDecoderState(ismd_dev_state_t state); + bool SetVideoRenderState(ismd_dev_state_t state); + + ismd_dev_state_t GetVideoRenderState() { return m_RenderState; } + ismd_dev_state_t GetAudioDeviceState(ismd_dev_t device); + + ismd_codec_type_t GetVideoCodec() { return m_video_codec; } + + bool FlushAudioDevice(ismd_dev_t device); + bool FlushVideoDecoder(); + bool FlushVideoRender(); + + float GetRenderFPS(); + double GetFrameDuration(); + float GetDecoderFPS(); + + bool PrintVideoStreamStats(); + bool PrintVideoStreaProp(); + bool PrintRenderStats(); + + bool CheckCodecHWDecode( int Codec ); + + static bool SetMasterVolume(int nVolume); + static void Mute(bool bMute); + + ismd_dev_state_t DVDSpeedToSMD(int dvdSpeed); + + bool IsDemuxToVideo() { return m_bDemuxToVideo; } + bool IsDemuxToAudio() { return m_bDemuxToAudio; } + +protected: + + bool SetClockPrimary(); + + ismd_audio_output_t AddAudioOutput(int output); + bool RemoveAudioOutput(ismd_audio_output_t output); + bool RemoveAllAudioOutput(); + + // clock + ismd_clock_t m_main_clock; + ismd_time_t m_base_time; + ismd_time_t m_pause_base_time; + ismd_time_t m_pause_cur_time; + + // demuxer + ismd_dev_t m_demux; + ismd_port_handle_t m_demux_input_port; + ismd_port_handle_t m_demux_video_port; + ismd_port_handle_t m_demux_audio_port; + ismd_demux_filter_handle_t m_demux_ves_filter_handle; + ismd_demux_filter_handle_t m_demux_aes_filter_handle; + + // Video + ismd_dev_t m_viddec; + ismd_dev_t m_video_proc; + ismd_dev_t m_video_render; + ismd_port_handle_t m_viddec_input_port; + ismd_port_handle_t m_viddec_output_port; + ismd_port_handle_t m_viddec_user_data_port; + ismd_port_handle_t m_video_input_port_proc; + ismd_port_handle_t m_video_output_port_proc; + ismd_port_handle_t m_video_input_port_renderer; + ismd_port_handle_t m_video_output_port_renderer; + ismd_event_t m_viddec_user_data_event; + ismd_codec_type_t m_video_codec; + + ismd_dev_state_t m_RenderState; + + ismd_pts_t m_audio_start_pts; + ismd_pts_t m_video_start_pts; + + ismd_audio_processor_t m_audioProcessor; + + ismd_dev_t m_primaryAudioInput; // for AV main playback + + // Audio outputs + ismd_audio_output_t m_audioOutputHDMI; + ismd_audio_output_t m_audioOutputSPDIF; + ismd_audio_output_t m_audioOutputI2S0; + + bool m_bFlushFlag; + bool m_bDemuxToVideo; + bool m_bDemuxToAudio; + + + CCriticalSection m_Lock; +}; + + +extern CIntelSMDGlobals g_IntelSMDGlobals; + diff --git a/xbmc/cores/VideoRenderers/IntelSMDRenderer.cpp b/xbmc/cores/VideoRenderers/IntelSMDRenderer.cpp new file mode 100644 index 00000000..4ccf11d3 --- /dev/null +++ b/xbmc/cores/VideoRenderers/IntelSMDRenderer.cpp @@ -0,0 +1,1073 @@ +/* + * XBMC Media Center + * Linux OpenGL Renderer + * Copyright (c) 2007 Frodo/jcmarshall/vulkanr/d4rk + * + * Based on XBoxRenderer by Frodo/jcmarshall + * Portions Copyright (c) by the authors of ffmpeg / xvid /mplayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include "system.h" + +#ifdef HAS_INTEL_SMD + +#include "IntelSMDRenderer.h" +#include "IntelSMDGlobals.h" +#include "Settings.h" +#include "log.h" +#include "SingleLock.h" +#include "../dvdplayer/DVDClock.h" +#include "GUITexture.h" +#include "TransformMatrix.h" +#include "GUISettings.h" +#include "Application.h" + +#include +#include +#include +#include + + +#define ROUND_UP(num, amt) ((num%amt) ? (num+amt) - (num%amt) : num) +#define ROUND_DOWN(num, amt) ((num%amt) ? num - (num%amt): num) +#define CACHE_LINE_SIZE 64 + +union pts_union +{ + double pts_d; + int64_t pts_i; +}; + +#if 0 +static int64_t pts_dtoi(double pts) +{ + pts_union u; + u.pts_d = pts; + return u.pts_i; +} + +static double pts_itod(int64_t pts) +{ + pts_union u; + u.pts_i = pts; + return u.pts_d; +} +#endif + +static void cpy_I420_to_NV12(uint8_t *I420_Y, int strid_I420_Y, + uint8_t *I420_U, int strid_I420_U, uint8_t *I420_V, int strid_I420_V, + uint8_t *NV12_Y, int strid_NV12_Y, uint8_t *NV12_UV, int strid_NV12_UV, + int w, int h, int x) +{ + int i, src_offset, dst_offset, src_v_offset; + //copy Y plane + src_offset = dst_offset = x; + for (i = 0; i < h; i++) + { + memcpy(&NV12_Y[dst_offset], &I420_Y[src_offset], w); + dst_offset += strid_NV12_Y; + src_offset += strid_I420_Y; + } + + //copy U/V plane interleaved: 420 pseudo-planar + //new UV copy implementation to use fast memcpy + //TODO: test and handle the case that the address may not cache size aligned + { + unsigned int Width = (unsigned int) w; + unsigned char temp_line[Width]; + unsigned int word_num; + unsigned int u_word, v_word, uv_word1, uv_word2; + unsigned char *u_ptr, *v_ptr, *out_data_uv; + w = w >> 1; + h = h >> 1; + src_v_offset = src_offset = dst_offset = (x >> 1); + out_data_uv = NV12_UV + dst_offset; + u_ptr = I420_U + src_offset; + v_ptr = I420_V + src_offset; + for (i = 0; i < h; i++) + { + for (word_num = 0; word_num < Width >> 3; word_num++) + { + u_word = *(unsigned int *) (u_ptr + (word_num * 4)); + v_word = *(unsigned int *) (v_ptr + (word_num * 4)); + uv_word1 = (((u_word >> 0) & 0xFF) << 0) + | (((v_word >> 0) & 0xFF) << 8) | (((u_word >> 8) & 0xFF) << 16) + | (((v_word >> 8) & 0xFF) << 24); + uv_word2 = (((u_word >> 16) & 0xFF) << 0) | (((v_word >> 16) & 0xFF) + << 8) | (((u_word >> 24) & 0xFF) << 16) | (((v_word >> 24) & 0xFF) + << 24); + *(unsigned int *) (temp_line + (8 * word_num)) = uv_word1; + *(unsigned int *) (temp_line + ((8 * word_num) + 4)) = uv_word2; + } + memcpy(out_data_uv, temp_line, Width); + out_data_uv += strid_NV12_UV; + u_ptr += strid_I420_U; + v_ptr += strid_I420_V; + } + } + + return; +} + +#if 0 +static void uv_to_nv12(void *dest_uv, int dest_uv_stride, + +void *src_u, void *src_v, int src_u_stride, int src_v_stride, + +int width, /* number of u bytes per row */ +int height) +{ + int row; + int round_bytes_to_copy; + uintptr_t dest_row; + uintptr_t src_u_row; + uintptr_t src_v_row; + + assert((uintptr_t)dest_uv % 32 == 0); + assert(dest_uv_stride % 32 == 0); + assert(src_u_stride == src_v_stride); + assert(width >= 16); + + //printf("\t %d: %d %d %d\n", __LINE__, dest_uv_stride, src_u_stride, src_v_stride ); + //write_buffer_to_file("u_uv_to_nv12",src_u, src_u_stride, height, width); + //write_buffer_to_file("v_uv_to_nv12",src_v, src_v_stride, height, width); + + round_bytes_to_copy = (width / 16) * 16; + + dest_row = (uintptr_t)dest_uv; + src_u_row = (uintptr_t)src_u; + src_v_row = (uintptr_t)src_v; + + for (row = 0; row < height; row++) { + + /* process the row */ + asm ( + "movl %0, %%edi # dest_row\n\t" + "movl %1, %%eax # src_u_row\n\t" + "movl %2, %%ebx # src_v_row\n\t" + "movl %3, %%ecx # round bytes to copy\n\t" + "movl %4, %%edx # total bytes to copy\n\t" + "movl %%ecx, %%esi\n\t" + + "next_chunk:\n\t" + /* read the next 16 U/V bytes */ + "movdqu -16(%%eax, %%ecx, 1), %%xmm1\n\t" + "movdqu -16(%%ebx, %%ecx, 1), %%xmm2\n\t" + + /* generate the next 16 UV pairs */ + "movdqa %%xmm1, %%xmm3\n\t" + "movdqa %%xmm2, %%xmm4\n\t" + + "punpckhbw %%xmm2, %%xmm1\n\t" + "punpcklbw %%xmm4, %%xmm3\n\t" + + /* store the results */ + "movntdq %%xmm1, -16(%%edi, %%ecx, 2)\n\t" + "movntdq %%xmm3, -32(%%edi, %%ecx, 2)\n\t" + + "subl $16, %%ecx\n\t" + "jz done_with_chunks\n\t" + + "jmp next_chunk\n\t" + "done_with_chunks:\n\t" + + "sfence\n\t" + + /* if width == chunked_bytes, we're done */ + "cmpl %%edx, %%esi\n\t" + "je done_uv\n\t" + /* else, we need to handle the remaining few bytes */ + + /* read the last 16 U/V bytes */ + "movdqu -16(%%eax, %%edx, 1), %%xmm1\n\t" + "movdqu -16(%%ebx, %%edx, 1), %%xmm2\n\t" + + /* generate the last 16 UV pairs */ + "movdqa %%xmm1, %%xmm3\n\t" + "movdqa %%xmm2, %%xmm4\n\t" + + "punpckhbw %%xmm2, %%xmm1\n\t" + "punpcklbw %%xmm4, %%xmm3\n\t" + + /* store the results */ + "movdqu %%xmm1, -16(%%edi, %%edx, 2)\n\t" + "movdqu %%xmm3, -32(%%edi, %%edx, 2)\n\t" + "clflush -1(%%edi, %%edx, 2)\n\t" + "clflush -32(%%edi, %%edx, 2)\n\t" + + "done_uv:\n\t" + + : + : "g"(dest_row), + "g"(src_u_row), + "g"(src_v_row), + "g"(round_bytes_to_copy), + "g"(width) + : "eax", "ebx", "ecx", "edx", "edi", "esi" + ); + + dest_row += dest_uv_stride; + src_u_row += src_u_stride; + src_v_row += src_v_stride; + } +} + +static void uv_to_nv12_2( + void *dest_uv, + int dest_uv_stride, + + void *src_u, + void *src_v, + int src_u_stride, + int src_v_stride, + + int width, /* number of u bytes per row */ + int height) +{ + int row; + int round_bytes_to_copy; + unsigned char* dest_row; + unsigned char* src_u_row; + unsigned char* src_v_row; + + assert((uintptr_t)dest_uv % 32 == 0); + assert(dest_uv_stride % 32 == 0); + assert(src_u_stride == src_v_stride); + assert(width >= 16); + + round_bytes_to_copy = (width / 16) * 16; + + dest_row = (unsigned char*)dest_uv; + src_u_row = (unsigned char*)src_u; + src_v_row = (unsigned char*)src_v; + + for (row = 0; row < height; row++) + { + for(int i = 0; i < width / 2; i++) + { + *(dest_row + 2 * i + 0) = src_u_row[i]; + *(dest_row + 2 * i + 1) = src_v_row[i]; + } + + dest_row += dest_uv_stride; + src_u_row += src_u_stride; + src_v_row += src_v_stride; + } +} +#endif + +CIntelSMDRenderer::CIntelSMDRenderer() +{ + printf("%s\n", __FUNCTION__); + + SetDefaults(); +} + +CIntelSMDRenderer::~CIntelSMDRenderer() +{ + printf("%s\n", __FUNCTION__); + + UnInit(); +} + +void CIntelSMDRenderer::SetDefaults() +{ + //printf("%s\n", __FUNCTION__); + + m_bConfigured = false; + + m_sourceWidth = 0; + m_sourceHeight = 0; + m_destWidth = 0; + m_destHeight = 0; + m_fps = 0; + + m_startTime = 0; + m_iYV12RenderBuffer = 0; + m_NumYV12Buffers = NUM_BUFFERS; + m_PTS = DVD_NOPTS_VALUE; + m_bCropping = false; + m_bFlushFlag = true; + m_bRunning = false; + + m_bUsingSMDecoder = true; + m_bNullRendering = false; + + for(int b = 0; b < NUM_BUFFERS; b++) + for (int p = 0; p < MAX_PLANES; p++) + m_YUVMemoryTexture[b][p] = NULL; + + m_resolution = g_guiSettings.m_LookAndFeelResolution; + + m_lastAspectNum = 0; + m_lastAspectDenom = 0; + m_aspectTransition = 0; + +} + +unsigned int CIntelSMDRenderer::PreInit() +{ + printf("%s\n", __FUNCTION__); + + UnInit(); + + return true; +} + +void CIntelSMDRenderer::UnInit() +{ + //printf("%s\n", __FUNCTION__); + + if(!m_bUsingSMDecoder && !m_bNullRendering) + { + ReleaseYUVBuffers(); + g_IntelSMDGlobals.DeleteVideoRender(); + g_IntelSMDGlobals.ResetClock(); + } + + // clear video plane to remove any video leftovers + gdl_flip(GDL_PLANE_ID_UPP_B, GDL_SURFACE_INVALID, GDL_FLIP_ASYNC); + + SetDefaults(); +} + +void CIntelSMDRenderer::SetSpeed(int speed) +{ + if(m_bUsingSMDecoder) + return; + + printf("CIntelSMDRenderer::SetSpeed %d\n", speed); + + if(speed == DVD_PLAYSPEED_PAUSE) + { + g_IntelSMDGlobals.SetVideoRenderState(ISMD_DEV_STATE_PAUSE); + } + else + { + if(!m_bFlushFlag) + { + g_IntelSMDGlobals.SetVideoRenderBaseTime(g_IntelSMDGlobals.GetBaseTime()); + g_IntelSMDGlobals.SetVideoRenderState(ISMD_DEV_STATE_PLAY); + } + else + printf("CIntelSMDRenderer::SetSpeed flush flag is set, ignoring request\n"); + } +} + +void CIntelSMDRenderer::Flush() +{ + printf("CIntelSMDRenderer::Flush\n"); + + m_bRunning = false; + m_bFlushFlag = true; +} + +void CIntelSMDRenderer::AllocateYUVBuffers() +{ + printf("%s\n", __FUNCTION__); + + ReleaseYUVBuffers(); + + + // Initialize the video to black (in yuv values) + for(int b = 0; b < NUM_BUFFERS; b++) + for (int p = 0; p < MAX_PLANES; p++) + { + if(p == 0) + { + m_YUVMemoryTexture[b][p] = new unsigned char[m_sourceWidth * m_sourceHeight]; + memset(m_YUVMemoryTexture[b][p], 16, m_sourceWidth * m_sourceHeight); + } + else + { + m_YUVMemoryTexture[b][p] = new unsigned char[m_sourceWidth / 2 * m_sourceHeight / 2]; + memset(m_YUVMemoryTexture[b][p], 128, m_sourceWidth / 2 * m_sourceHeight / 2); + } + } +} + +void CIntelSMDRenderer::ReleaseYUVBuffers() +{ + printf("%s\n", __FUNCTION__); + + for(int b = 0; b < NUM_BUFFERS; b++) + for (int p = 0; p < MAX_PLANES; p++) + { + delete [] m_YUVMemoryTexture[b][p]; + m_YUVMemoryTexture[b][p] = NULL; + } +} + +bool CIntelSMDRenderer::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, CRect &rect) +{ + CLog::Log(LOGINFO, "CIntelSMDRenderer::Configure width %d height %d d_width %d d_height %d fps %f flags %d\n", + width, height, d_width, d_height, fps, flags); + + if(width == 0 || height == 0 || d_width == 0 || d_height == 0) + return true; + + // print overscan values + RESOLUTION iRes = g_graphicsContext.GetVideoResolution(); + int left = g_settings.m_ResInfo[iRes].Overscan.left; + int top = g_settings.m_ResInfo[iRes].Overscan.top; + int right = g_settings.m_ResInfo[iRes].Overscan.right; + int bottom = g_settings.m_ResInfo[iRes].Overscan.bottom; + CLog::Log(LOGINFO, "CIntelSMDRenderer configure overscan values left %d top %d right %d bottom %d", left, top, right, bottom); + + // if only fps change, no need to reconfigure everything + if(m_sourceWidth == width && + m_sourceHeight == height && + m_destWidth == d_width && + m_destHeight == d_height && + m_iFlags == flags) + { + if(m_fps != fps && fps > 20) + { + m_fps = fps; + ChooseBestResolution(m_fps); + } + return true; + } + + m_sourceWidth = width; + m_sourceHeight = height; + m_destWidth = d_width; + m_destHeight = d_height; + m_iFlags = flags; + m_fps = fps; + + if (flags & CONF_FLAGS_EXTERN_IMAGE) + m_bNullRendering = true; + else + m_bNullRendering = false; + + if (flags & CONF_FLAGS_SMD_DECODING) + m_bUsingSMDecoder = true; + else + m_bUsingSMDecoder = false; + + if (!m_bUsingSMDecoder && !m_bNullRendering) + { + AllocateYUVBuffers(); + g_IntelSMDGlobals.CreateVideoRender(GDL_VIDEO_PLANE); + } + + if (m_bUsingSMDecoder) + CLog::Log(LOGINFO, "Video rendering using SMD decoder"); + else if (m_bNullRendering) + CLog::Log(LOGINFO, "Video rendering using NULL renderer"); + else + CLog::Log(LOGINFO, "Video rendering using software decoder"); + + bool keep43ar = g_guiSettings.GetBool("ota.keep43ar"); + + if (g_application.IsPlayingLiveTV() && !keep43ar) + { + g_stSettings.m_currentVideoSettings.m_ViewMode = VIEW_MODE_STRETCH_16x9; + } + + // Calculate the input frame aspect ratio. + CalculateFrameAspectRatio(d_width, d_height); + if(!m_bNullRendering && (flags & CONF_FLAGS_FULLSCREEN)) + ChooseBestResolution(fps); + SetViewMode(g_stSettings.m_currentVideoSettings.m_ViewMode); + ManageDisplay(); + + if (!m_bNullRendering && !m_bConfigured) + { + ConfigureGDLPlane(GDL_VIDEO_PLANE); + ConfigureVideoProc(); + ConfigureDeinterlace(); + ConfigureVideoFilters(); + } + + m_bConfigured = true; + + return true; +} + +int CIntelSMDRenderer::GetImage(YV12Image *image, double pts, int source, bool readonly) +{ + if (!image) + return -1; + + //printf("Get Image PTS = %f Configure %d\n", pts, m_bConfigured); + + if (!m_bConfigured) + return -1; + + if(m_bUsingSMDecoder || m_bNullRendering) + { + return 0; + } + + m_PTS = pts; + + /* take next available buffer */ + if( source == AUTOSOURCE ) + source = NextYV12Texture(); + + if( source < 0 ) + return -1; + + YUVMEMORYPLANES &planes = m_YUVMemoryTexture[source]; + + image->cshift_x = 1; + image->cshift_y = 1; + image->height = m_sourceHeight; + image->width = m_sourceWidth; + image->flags = 0; + + for(int i = 0; i < MAX_PLANES; i++) + { + if(i == 0) + image->stride[i] = m_sourceWidth; + else + image->stride[i] = m_sourceWidth / 2; + image->plane[i] = planes[i]; + } + + return source; +} + +void CIntelSMDRenderer::ReleaseImage(int source, bool preserve) +{ + if(!m_bUsingSMDecoder) + { + RenderYUVBUffer(m_YUVMemoryTexture[m_iYV12RenderBuffer]); + } + + m_iYV12RenderBuffer = NextYV12Texture(); +} + +void CIntelSMDRenderer::Reset() +{ + //printf("%s\n", __FUNCTION__); + + UnInit(); +} + +void CIntelSMDRenderer::Update(bool bPauseDrawing) +{ + //printf("%s\n", __FUNCTION__); + if (!m_bConfigured) + return; + + ManageDisplay(); +} + +void CIntelSMDRenderer::RenderYUVBUffer(YUVMEMORYPLANES plane) +{ + ismd_result_t result; + ismd_pts_t ismd_pts; + ismd_buffer_handle_t renderBuf = ISMD_ERROR_INVALID_HANDLE; + + ismd_port_handle_t video_input_port_proc; + video_input_port_proc = g_IntelSMDGlobals.GetVidProcInput(); + + if(video_input_port_proc == -1) + { + CLog::Log(LOGERROR, "CIntelSMDRenderer::RenderYUVBUffer video_input_port_proc == -1"); + return; + } + + if(plane[0] == NULL || plane[1] == NULL || plane[2] == NULL) + { + CLog::Log(LOGERROR, "CIntelSMDRenderer::RenderYUVBUffer invalid plane data"); + return; + } + + ismd_pts = g_IntelSMDGlobals.DvdToIsmdPts(m_PTS); + + unsigned int destHeight = ROUND_DOWN(m_sourceHeight, 16); + unsigned int destWidth = ROUND_DOWN(m_sourceWidth, 16); + + int height_to_alloc = (destHeight * 2); + + result = ismd_frame_buffer_alloc(ROUND_UP(destWidth, CACHE_LINE_SIZE), height_to_alloc, &renderBuf); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_gst_element: request for downstream allocation: ismd buffer allocation failed"); + return; + } + + ismd_buffer_descriptor_t desc; + result = ismd_buffer_read_desc(renderBuf, &desc); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismdismd_buffer_read_desc failed"); + ismd_buffer_dereference(renderBuf); + return; + } + + unsigned int systemStride = SYSTEM_STRIDE; + unsigned char* ptr = (unsigned char*) OS_MAP_IO_TO_MEM_NOCACHE (desc.phys.base, height_to_alloc * systemStride); + + if(ptr == NULL) + { + CLog::Log(LOGERROR, "IntelSMDRenderer::RenderYUVBUffer OS_MAP_IO_TO_MEM_NOCACHE return null"); + return; + } + + // new method to copy I420 to NV12, doesn't crash on 720p + cpy_I420_to_NV12(plane[0], m_sourceWidth, plane[1], m_sourceWidth / 2, plane[2], m_sourceWidth / 2, + ptr, systemStride, ptr + (destHeight * systemStride), systemStride, destWidth, destHeight, 0); + +#if 0 + // Copy Y data + for (int line = 0; line < m_sourceHeight; line++) + { + OS_MEMCPY(ptr + (line * SYSTEM_STRIDE), plane[0] + (line * m_sourceWidth), m_sourceWidth); + } + + uv_to_nv12(ptr + (m_sourceHeight * SYSTEM_STRIDE), SYSTEM_STRIDE, plane[1], plane[2], m_sourceWidth / 2, m_sourceWidth / 2, + m_sourceWidth, m_sourceHeight); +#endif + + + OS_UNMAP_IO_FROM_MEM(ptr, height_to_alloc * systemStride); + + ismd_frame_attributes_t *attr = (ismd_frame_attributes_t *) (desc.attributes); + attr->discontinuity = false; + attr->cont_rate = 0; + attr->cont_size.width = destWidth; + attr->cont_size.height = destHeight; + attr->dest_size.width = destWidth; + attr->dest_size.height = destHeight; + attr->pixel_format = ISMD_PF_NV12; + attr->color_space = ISMD_SRC_COLOR_SPACE_BT601; + attr->polarity = ISMD_POLARITY_FRAME; // FIXME: can we tell if it's interlaced? + attr->gamma_type = ISMD_GAMMA_HDTV; // default as per as per ISO/IEC 13818-2 + attr->repeated = 0; + attr->y = 0; + attr->u = attr->y + (systemStride * destHeight); + attr->v = attr->y + (systemStride * destHeight); + attr->original_pts = ismd_pts; + attr->local_pts = ismd_pts; + + //printf("PTS = %.2f\n", g_IntelSMDGlobals.IsmdToDvdPts(ismd_pts) / 1000000); + + // commit the changes to the descriptor + result = ismd_buffer_update_desc (renderBuf, &desc); + if (result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "failed to update ISMD descriptor!"); + ismd_buffer_dereference(renderBuf); + return; + } + + if(m_bFlushFlag) + { + ismd_pts_t start = ismd_pts; + + if(start == ISMD_NO_PTS && g_IntelSMDGlobals.GetAudioStartPts() != ISMD_NO_PTS) + start = g_IntelSMDGlobals.GetAudioStartPts(); + + if (!m_bUsingSMDecoder) + { + g_IntelSMDGlobals.FlushVideoRender(); + + if (g_IntelSMDGlobals.GetFlushFlag()) + { + //printf("Setting base time from renderer\n"); + g_IntelSMDGlobals.SetBaseTime(g_IntelSMDGlobals.GetCurrentTime()); + g_IntelSMDGlobals.SetFlushFlag(false); + } + } + + // Add a new_segment buffer to the next video buffer + g_IntelSMDGlobals.SetVideoStartPts(start); + g_IntelSMDGlobals.SetVideoRenderBaseTime(g_IntelSMDGlobals.GetBaseTime()); + g_IntelSMDGlobals.CreateStartPacket(start, renderBuf); + g_IntelSMDGlobals.SetVideoRenderState(ISMD_DEV_STATE_PLAY); + m_bFlushFlag = false; + m_bRunning = true; + } + + ismd_pts_t syncPTS = g_IntelSMDGlobals.Resync(); + if(syncPTS != ISMD_NO_PTS) + { + if(syncPTS != g_IntelSMDGlobals.GetVideoStartPts()) + { + g_IntelSMDGlobals.SetVideoStartPts(syncPTS); + g_IntelSMDGlobals.CreateStartPacket(syncPTS, renderBuf); + } + } + + result = ISMD_ERROR_UNSPECIFIED; + + int retry = 0; + + while(m_bRunning && retry < 5) + { + result = ismd_port_write(video_input_port_proc, renderBuf); + + if(result == ISMD_SUCCESS) + break; + + if(g_IntelSMDGlobals.GetVideoRenderState() != ISMD_DEV_STATE_STOP) + { + retry++; + Sleep(100); + } else + break; + } + + if(result != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "CIntelSMDRenderer::RenderYUVBUffer failed. %d", result); + ismd_buffer_dereference(renderBuf); + } + + return; +} + +void CIntelSMDRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +{ + if (!m_bConfigured) + { + if(g_application.GetCurrentPlayer() == EPC_FLASHPLAYER) + g_graphicsContext.Clear(); + + return; + } + + if(m_bNullRendering) + { + g_graphicsContext.Clear(); + Render(flags); + return; + } + + if(clear) + g_graphicsContext.Clear(); + else if (g_application.GetCurrentPlayer() == EPC_FLASHPLAYER) + g_graphicsContext.Clear(); + + ManageDisplay(); + + if(!clear) + { + g_graphicsContext.PushTransform(TransformMatrix(), true); + CGUITextureGLES::DrawQuad(m_destRect, alpha); + g_graphicsContext.PopTransform(); + } + + ConfigureVideoProc(); + + Render(flags); +} + +int CIntelSMDRenderer::NextYV12Texture() +{ + if(m_NumYV12Buffers) + return (m_iYV12RenderBuffer + 1) % m_NumYV12Buffers; + else + return -1; +} + +unsigned int CIntelSMDRenderer::DrawSlice(unsigned char *src[], int stride[], int w, int h, int x, int y) +{ + printf("%s\n", __FUNCTION__); + return 0; +} + +void CIntelSMDRenderer::Render(DWORD flags) +{ + return; +} + +bool CIntelSMDRenderer::SupportsBrightness() +{ + return false; +} + +bool CIntelSMDRenderer::SupportsContrast() +{ + return false; +} + +bool CIntelSMDRenderer::SupportsGamma() +{ + return false; +} + +int CIntelSMDRenderer::ConfigureGDLPlane(gdl_plane_id_t plane) +{ + CLog::Log(LOGINFO, "CIntelSMDRenderer::ConfigureGDLPlane %d", plane); + + gdl_ret_t rc = GDL_SUCCESS; + + rc = gdl_plane_reset(plane); + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_config_begin(plane); + } + + gdl_vid_policy_t policy = GDL_VID_POLICY_RESIZE; + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_set_attr(GDL_PLANE_VID_MISMATCH_POLICY, &policy); + } + + if (GDL_SUCCESS == rc) + { + rc = gdl_plane_config_end(GDL_FALSE); + } + else + { + gdl_plane_config_end(GDL_TRUE); + } + + if (GDL_SUCCESS != rc) + { + fprintf(stderr, "GDL configuration failed! GDL error code is 0x%x\n", rc); + } + + return rc; +} + +int CIntelSMDRenderer::ConfigureVideoFilters() +{ + ismd_result_t res; + + ismd_dev_t video_proc = g_IntelSMDGlobals.GetVidProc(); + + bool deringing_filter = g_guiSettings.GetBool("videoplayback.deringing"); + bool gaussian_filter = g_guiSettings.GetBool("videoplayback.gaussian"); + + if (deringing_filter) + res = ismd_vidpproc_deringing_enable(video_proc); + else + res = ismd_vidpproc_deringing_disable(video_proc); + + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_vidpproc_gaussian_enable failed. %d", res); + return 0; + } + + if (gaussian_filter) + res = ismd_vidpproc_gaussian_enable(video_proc); + else + res = ismd_vidpproc_gaussian_disable(video_proc); + + if (res != ISMD_SUCCESS) + { + CLog::Log(LOGERROR, "ismd_vidpproc_gaussian_enable failed. %d", res); + return 0; + } + + CLog::Log(LOGINFO, "CIntelSMDRenderer Setting deringing_filter %d\n", deringing_filter); + CLog::Log(LOGINFO, "CIntelSMDRenderer Setting gaussian filter %d\n", gaussian_filter); + + return 1; +} + +int CIntelSMDRenderer::ConfigureDeinterlace() +{ + ismd_result_t ret; + + int iResolution = g_graphicsContext.GetVideoResolution(); + ismd_dev_t video_proc = g_IntelSMDGlobals.GetVidProc(); + int deinterlace_policy = g_guiSettings.GetInt("videoplayback.interlacemode"); + bool interlace_display = g_settings.m_ResInfo[iResolution].dwFlags & D3DPRESENTFLAG_INTERLACED; + ismd_vidpproc_deinterlace_policy_t smd_policy = NONE; + + switch(deinterlace_policy) + { + case INTERLACE_MODE_AUTO: + smd_policy = AUTO; + break; + case INTERLACE_MODE_VIDEO: + smd_policy = VIDEO; + break; + case INTERLACE_MODE_FILM: + smd_policy = FILM; + break; + case INTERLACE_MODE_SPATIAL_ONLY: + smd_policy = SPATIAL_ONLY; + break; + case INTERLACE_MODE_TOP_FIELD_ONLY: + smd_policy = TOP_FIELD_ONLY; + break; + case INTERLACE_MODE_SCALE_ONLY: + smd_policy = NONE; + break; + case INTERLACE_MODE_NEVER: + smd_policy = NEVER; + break; + } + + if(g_application.IsPlayingLiveTV()) + { + smd_policy = VIDEO; + } + + if(interlace_display) + { + if(deinterlace_policy == INTERLACE_MODE_AUTO) + smd_policy = NONE; + } + + CLog::Log(LOGINFO, "Setting Interlace mode: screen %d user %d smd %d", interlace_display, deinterlace_policy, smd_policy); + + ret = ismd_vidpproc_set_deinterlace_policy(video_proc, smd_policy); + + if (ret != ISMD_SUCCESS) + { + printf("ismd_vidpproc_set_deinterlace_policy failed\n"); + } + + return 1; +} + +int CIntelSMDRenderer::ConfigureVideoProc() +{ + ismd_result_t ret = ISMD_ERROR_NO_RESOURCES; + + int screenWidth = g_graphicsContext.GetWidth(); + int screenHeight = g_graphicsContext.GetHeight(); + const CRect& viewWindow = g_graphicsContext.GetViewWindow(); + + // ok, get the dest rect + int destx = (int)m_destRect.x1; + int desty = (int)m_destRect.y1; + unsigned int width = (unsigned int)m_destRect.Width(); + unsigned int height = (unsigned int)m_destRect.Height(); + + int aspect_ratio_num = 100; + int aspect_ratio_denom = 100; + + ismd_dev_t video_proc = g_IntelSMDGlobals.GetVidProc(); + + if(video_proc == -1) + { + CLog::Log(LOGERROR, "CIntelSMDRenderer::ConfigureVideoProc failed to retrieve video proc"); + return 0; + } + + // now, see if we need to crop. basically if the destination window + // for video is outside of the viewWindow (which is the overscan adjusted screen) + // then cropping is required + if( destx < viewWindow.x1 || + desty < viewWindow.y1 || + width > viewWindow.Width()|| + height > viewWindow.Height() ) + { + int croppedX1 = (int)m_sourceRect.x1, + croppedY1 = (int)m_sourceRect.y1, + croppedWidth = (int)m_sourceRect.Width(), + croppedHeight = (int)m_sourceRect.Height(); + + // core image from the source rect is being blown out of the viewing area + // usually this happens due to zoom or overscan adjustments + // what we do here is calculate any scaling ratio applied to the source rect, so + // we can crop accordingly + + // adjust the destination window + if( destx < viewWindow.x1 || width > viewWindow.Width() ) + { + float scale = m_destRect.Width() / m_sourceRect.Width(); + croppedWidth = (int) (viewWindow.Width() / scale); + croppedX1 += (int)((m_sourceRect.Width() - croppedWidth) / 2); + + width = (unsigned int)viewWindow.Width(); + destx = (int)viewWindow.x1; + } + if( desty < viewWindow.y1 || height > viewWindow.Height() ) + { + float scale = m_destRect.Height() / m_sourceRect.Height(); + croppedHeight = (int)(viewWindow.Height() / scale); + croppedY1 += (int)((m_sourceRect.Height() - croppedHeight) / 2); + + height = (unsigned int)viewWindow.Height(); + desty = (int)viewWindow.y1; + } + + /* + printf("croppedX1 %d croppedY1 %d croppedWidth %d croppedHeight %d sW %d sH %d\n", + croppedX1, croppedY1, croppedWidth, croppedHeight, screenWidth, screenHeight); + */ + + if( croppedX1 < 0 ) croppedX1 = 0; + if( croppedY1 < 0 ) croppedY1 = 0; + if( croppedX1 + croppedWidth > m_sourceRect.Width() ) + croppedWidth = (int)m_sourceRect.Width() - croppedX1; + if( croppedY1 + croppedHeight > m_sourceRect.Height() ) + croppedHeight = (int)m_sourceRect.Height() - croppedY1; + + ret = ismd_vidpproc_set_crop_input(video_proc, + (unsigned int)croppedX1, + (unsigned int)croppedY1, + (unsigned int)croppedWidth, + (unsigned int)croppedHeight); + if (ret != ISMD_SUCCESS) + { + printf("ismd_vidpproc_set_crop_input failed\n"); + return 0; + } + + m_bCropping = true; + } + else if (m_bCropping) + { + ismd_vidpproc_disable_crop_input( video_proc ); + m_bCropping = false; + } + + if( destx < 0 ) destx = 0; + if( desty < 0 ) desty = 0; + if( destx + width > (unsigned int) screenWidth ) width = screenWidth - destx; + if( desty + height > (unsigned int) screenHeight ) height = screenHeight - desty; + + if( desty & 1 && height & 1) + { + desty--; + height++; + } + else if( height & 1 ) height--; + else if( desty & 1 ) desty--; + + /* + printf("width = %d height = %d aspect ratio = %dx%d, destx = %d desty = %d\n", + width, height, aspect_ratio_num, aspect_ratio_denom, destx, desty ); + + printf("source (%f,%f) (%f,%f), dest (%f,%f) (%f,%f)\n", + m_sourceRect.x1, m_sourceRect.y1, m_sourceRect.x2, m_sourceRect.y2, + m_destRect.x1, m_destRect.y1, m_destRect.x2, m_destRect.y2); + */ + + ret = ismd_vidpproc_set_dest_params2(video_proc, + width, + height, + aspect_ratio_num, + aspect_ratio_denom, + (unsigned int)destx, + (unsigned int)desty); + if(ret != ISMD_SUCCESS) + { + printf("ismd_vidpproc_set_dest_params2 failed\n"); + return 0; + } + + return 1; +} + +#endif + diff --git a/xbmc/cores/VideoRenderers/IntelSMDRenderer.h b/xbmc/cores/VideoRenderers/IntelSMDRenderer.h new file mode 100644 index 00000000..8abb6859 --- /dev/null +++ b/xbmc/cores/VideoRenderers/IntelSMDRenderer.h @@ -0,0 +1,148 @@ +#pragma once + +#include "../../settings/VideoSettings.h" +#include "RenderFlags.h" +#include "GraphicContext.h" +#include "BaseRenderer.h" +#include "utils/Thread.h" + +#include +#include "gdl_types.h" + +#define NUM_BUFFERS 2 + +#define MAX_PLANES 3 +#define MAX_FIELDS 3 + +#undef ALIGN +#define ALIGN(value, alignment) (((value)+((alignment)-1))&~((alignment)-1)) +#define CLAMP(a, min, max) ((a) > (max) ? (max) : ( (a) < (min) ? (min) : a )) + +#define IMAGE_FLAG_WRITING 0x01 /* image is in use after a call to GetImage, caller may be reading or writing */ +#define IMAGE_FLAG_READING 0x02 /* image is in use after a call to GetImage, caller is only reading */ +#define IMAGE_FLAG_DYNAMIC 0x04 /* image was allocated due to a call to GetImage */ +#define IMAGE_FLAG_RESERVED 0x08 /* image is reserved, must be asked for specifically used to preserve images */ +#define IMAGE_FLAG_READY 0x16 /* image is ready to be uploaded to texture memory */ +#define IMAGE_FLAG_INUSE (IMAGE_FLAG_WRITING | IMAGE_FLAG_READING | IMAGE_FLAG_RESERVED) + +enum EFIELDSYNC +{ + FS_NONE, + FS_TOP, + FS_BOT +}; + +struct DRAWRECT +{ + float left; + float top; + float right; + float bottom; +}; + +struct VideoVertex +{ + float x, y, z; + float y1, y2; + float u1, u2; + float v1, v2; +}; + +#define PLANE_Y 0 +#define PLANE_U 1 +#define PLANE_V 2 + +#define FIELD_FULL 0 +#define FIELD_ODD 1 +#define FIELD_EVEN 2 + +typedef unsigned char* YUVMEMORYPLANES[MAX_PLANES]; +typedef YUVMEMORYPLANES YUVMEMORYBUFFERS[NUM_BUFFERS]; + +class CRenderCapture; + +class CIntelSMDRenderer : public CBaseRenderer +{ +public: + CIntelSMDRenderer(); + virtual ~CIntelSMDRenderer(); + + virtual void Update(bool bPauseDrawing); + virtual void SetupScreenshot() {}; + + // Player functions + virtual bool Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, CRect &rect); + virtual bool IsConfigured() { return m_bConfigured; } + virtual int GetImage(YV12Image *image, double pts, int source = AUTOSOURCE, bool readonly = false); + virtual void ReleaseImage(int source, bool preserve = false); + virtual unsigned int DrawSlice(unsigned char *src[], int stride[], int w, int h, int x, int y); + virtual void FlipPage(int source) { } + virtual unsigned int PreInit(); + virtual void UnInit(); + virtual void Reset(); /* resets renderer after seek for example */ + virtual void SetSpeed(int speed); + virtual void Flush(); + + virtual void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255); + + // Feature support + virtual bool SupportsBrightness(); + virtual bool SupportsContrast(); + virtual bool SupportsGamma(); + + // Feature support + virtual bool SupportsMultiPassRendering() { return false; } + virtual bool Supports(ERENDERFEATURE feature) { return false; } + virtual bool Supports(EINTERLACEMETHOD method) { return false; } + virtual bool Supports(ESCALINGMETHOD method) { return false; } + bool RenderCapture(CRenderCapture* capture) { return false; } + bool IsTimed() { return true; } + + +protected: + virtual void SetDefaults(); + virtual void Render(DWORD flags); + virtual int ConfigureGDLPlane(gdl_plane_id_t plane); + virtual int ConfigureVideoProc(); + virtual int ConfigureDeinterlace(); + virtual int ConfigureVideoFilters(); + + virtual void AllocateYUVBuffers(); + virtual void ReleaseYUVBuffers(); + + virtual void RenderYUVBUffer(YUVMEMORYPLANES plane); + + virtual int NextYV12Texture(); + + bool m_bConfigured; + bool m_bValidated; + bool m_bImageReady; + unsigned m_iFlags; + unsigned int m_flipindex; // just a counter to keep track of if a image has been uploaded + + float m_clearColour; + CRect m_crop; + float m_aspecterror; + + YUVMEMORYBUFFERS m_YUVMemoryTexture; + int m_iYV12RenderBuffer; + int m_NumYV12Buffers; + bool m_bUsingSMDecoder; + bool m_bNullRendering; + bool m_bCropping; + + ismd_time_t m_startTime; + double m_PTS; + double m_FirstPTS; + + bool m_bFlushFlag; + bool m_bRunning; + + unsigned int m_destWidth; + unsigned int m_destHeight; + unsigned int m_lastAspectNum; + unsigned int m_lastAspectDenom; + unsigned int m_aspectTransition; + + CCriticalSection m_renderBufLock; +}; diff --git a/xbmc/cores/VideoRenderers/LinuxRendererOMX.cpp b/xbmc/cores/VideoRenderers/LinuxRendererOMX.cpp new file mode 100644 index 00000000..a884b473 --- /dev/null +++ b/xbmc/cores/VideoRenderers/LinuxRendererOMX.cpp @@ -0,0 +1,1345 @@ +/* +* XBMC Media Center +* Linux OpenGL Renderer +* Copyright (c) 2007 Frodo/jcmarshall/vulkanr/d4rk +* +* Based on XBoxRenderer by Frodo/jcmarshall +* Portions Copyright (c) by the authors of ffmpeg / xvid /mplayer +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#include "system.h" +#if (defined HAVE_CONFIG_H) && (!defined WIN32) +#include "config.h" +#endif + +// This define enables the App thread to do the OMX Overlay (Renderer) Flip. If not defined, the OMX flip is done by the decoder + + +#if defined(HAS_OPENMAX) // this is defined in guilib/system.h +#include +#include "LinuxRendererOMX.h" +#include "Application.h" +#include "MathUtils.h" +#include "Settings.h" +#include "AdvancedSettings.h" +#include "GUISettings.h" +#include "FrameBufferObject.h" +#include "WindowingFactory.h" +#include "Texture.h" + +#include +#include +#include +#include +#include +#include + + +#define INIT_PARAM(_X_) (memset(&(_X_), 0, sizeof(_X_)), ((_X_).nSize = sizeof (_X_)), (_X_).nVersion = m_vOMX) + +using namespace Shaders; + +static const char *pszOmxYuvOverlayComponentsName[] = +{ + "OMX.Nvidia.render.hdmi.overlay.yuv420", + "OMX.Nvidia.std.iv_renderer.overlay.yuv420", +}; + + +static OMX_ERRORTYPE OmxRendererEventHandler( + OMX_OUT OMX_HANDLETYPE hComponent, + OMX_OUT OMX_PTR pAppData, + OMX_OUT OMX_EVENTTYPE eEvent, + OMX_OUT OMX_U32 Data1, + OMX_OUT OMX_U32 Data2, + OMX_OUT OMX_PTR pEventData); +static OMX_ERRORTYPE OmxRendererEmptyBufferDone( + OMX_OUT OMX_HANDLETYPE hComponent, + OMX_OUT OMX_PTR pAppData, + OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer); +static OMX_ERRORTYPE OmxRendererFillBufferDone( + OMX_OUT OMX_HANDLETYPE hComponent, + OMX_OUT OMX_PTR pAppData, + OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer); + +OMX_CALLBACKTYPE OmxRendererCallbacks = { + OmxRendererEventHandler, + OmxRendererEmptyBufferDone, + OmxRendererFillBufferDone +}; + + +static OMX_ERRORTYPE OmxRendererEventHandler( + OMX_OUT OMX_HANDLETYPE hComponent, + OMX_OUT OMX_PTR pAppData, + OMX_OUT OMX_EVENTTYPE eEvent, + OMX_OUT OMX_U32 Data1, + OMX_OUT OMX_U32 Data2, + OMX_OUT OMX_PTR pEventData) +{ + EOMXRendererEvent eOmxEvent = eOMXRendererEventUndefined; + + CLog::Log(LOGDEBUG, "OMXRENDER OmxRendererEventHandler() %x called\n", eEvent); + + switch(eEvent) { + case OMX_EventCmdComplete: + CLog::Log(LOGDEBUG, "OMXRENDER Event: OMX_EventCmdComplete nData1: %lu nData2: %lu\n", Data1, Data2); + switch(Data1) { + case OMX_CommandStateSet: + eOmxEvent = eOMXRendererEventStateChanged; + CLog::Log(LOGDEBUG, "OMXRENDER State Reached: "); + switch ((int)Data2) { + case OMX_StateInvalid: + CLog::Log(LOGDEBUG, "OMXRENDER OMX_StateInvalid\n"); + break; + case OMX_StateLoaded: + CLog::Log(LOGDEBUG, "OMXRENDER OMX_StateLoaded\n"); + break; + case OMX_StateIdle: + CLog::Log(LOGDEBUG, "OMXRENDER OMX_StateIdle\n"); + break; + case OMX_StateExecuting: + CLog::Log(LOGDEBUG, "OMXRENDER OMX_StateExecuting\n"); + break; + case OMX_StatePause: + CLog::Log(LOGDEBUG, "OMXRENDER OMX_StatePause\n"); + break; + case OMX_StateWaitForResources: + CLog::Log(LOGDEBUG, "OMXRENDER OMX_StateWaitForResources\n"); + break; + default: + CLog::Log(LOGDEBUG, "OMXRENDER Invalid State\n"); + break; + } + break; + case OMX_CommandFlush: + eOmxEvent = eOMXRendererEventFlush; + break; + case OMX_CommandPortDisable: + eOmxEvent = eOMXRendererEventPortDisable; + default: + break; + } + break; + case OMX_EventError: + CLog::Log(LOGDEBUG, "OMXRENDER Event: OMX_EventError Error code: %lx Port:%lu\n", Data1, Data2); + break; + case OMX_EventMark: + CLog::Log(LOGDEBUG, "OMXRENDER Event: OMX_EventMark\n"); + break; + case OMX_EventPortSettingsChanged: + CLog::Log(LOGDEBUG, "OMXRENDER Event: OMX_EventPortSettingsChanged Port: %lu\n", Data1); + eOmxEvent = eOMXRendererEventPortSettingsChanged ; + break; + case OMX_EventBufferFlag: + eOmxEvent = eOMXRendererEventEndOfStream; + CLog::Log(LOGDEBUG, "OMXRENDER Event: OMX_EventBufferFlag Port: %lu nFlags: %lx\n", Data1, Data2); + break; + case OMX_EventResourcesAcquired: + CLog::Log(LOGDEBUG, "OMXRENDER Event: OMX_EventResourcesAcquired\n"); + break; + case OMX_EventComponentResumed: + CLog::Log(LOGDEBUG, "OMXRENDER Event: OMX_EventComponentResumed\n"); + break; + case OMX_EventDynamicResourcesAvailable: + CLog::Log(LOGDEBUG, "OMXRENDER Event: OMX_EventDynamicResourcesAvailable\n"); + break; + case OMX_EventPortFormatDetected: + CLog::Log(LOGDEBUG, "OMXRENDER Event: OMX_EventPortFormatDetected\n"); + break; + case NVX_EventFirstFrameDisplayed: + CLog::Log(LOGDEBUG, "OMXRENDER Event: NVX_EventFirstFrameDisplayed\n"); + eOmxEvent = eOMXRendererEventFirstFrameDisplayed; + break; + default: + CLog::Log(LOGDEBUG, "OMXRENDER Event: Unknown\n"); + break; + } + + ((OmxRendererState *)pAppData)->pCallBacks->OnOmxRendererEventCompletion(((OmxRendererState *)pAppData)->pClientThis, (OmxRendererState *)pAppData, eOmxEvent, Data1, Data2); + return OMX_ErrorNone; +} + +static OMX_ERRORTYPE OmxRendererEmptyBufferDone( + OMX_OUT OMX_HANDLETYPE hComponent, + OMX_OUT OMX_PTR pAppData, + OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer) +{ + CLog::Log(LOGDEBUG, "OMXRENDER OmxRendererEmptyBufferDone appdata:%p client:%p callbacks:%p callback:%p buff:%p databuff:%p comp:%p\n", + pAppData, + ((OmxRendererState *)pAppData)->pClientThis, + ((OmxRendererState *)pAppData)->pCallBacks, + ((OmxRendererState *)pAppData)->pCallBacks->OnOmxRendererEmptyBufferDone, + pBuffer, + pBuffer->pBuffer, + hComponent); + + ((OmxRendererState *)pAppData)->pCallBacks->OnOmxRendererEmptyBufferDone(((OmxRendererState *)pAppData)->pClientThis, pBuffer); + return OMX_ErrorNone; +} + +static OMX_ERRORTYPE OmxRendererFillBufferDone( + OMX_OUT OMX_HANDLETYPE hComponent, + OMX_OUT OMX_PTR pAppData, + OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer) +{ + CLog::Log(LOGDEBUG, "OMXRENDER OmxRendererFillBufferDone\n"); + + return OMX_ErrorNone; +} + +void CLinuxRendererOMX::OnOmxRendererEmptyBufferDone(void *pClientThis, OMX_BUFFERHEADERTYPE *pBuffer) +{ + static unsigned int k; + CLog::Log(LOGDEBUG, "OMXRENDER CLinuxRendererOMX::OnOmxRendererEmptyBufferDone start\n"); + if(!pBuffer) { + CLog::Log(LOGDEBUG, "OMXRENDER CLinuxRendererOMX::OnOmxRendererEmptyBufferDone (%u) pBuffer NULL\n", k++); + return; + } + CLinuxRendererOMX *pThis = reinterpret_cast(pClientThis); + + /* Signal Empty Buffer Done */ + pThis->m_oEventOmxEmptyBufferDone.Set(); + + CLog::Log(LOGDEBUG, "OMXRENDER OnOmxRendererEmptyBufferDone (%u) pAppPrivate: %p\n", k++, pBuffer->pAppPrivate); +} + +void CLinuxRendererOMX::OnOmxRendererEventCompletion(void *pClientThis, OmxRendererState *pOmxRendererState, EOMXRendererEvent eOmxEvent, unsigned int uData1, unsigned int uData2) +{ + CLinuxRendererOMX *pThis = reinterpret_cast(pClientThis); + OMX_VERSIONTYPE omxVersion; + OMX_PARAM_PORTDEFINITIONTYPE oRendererInputPortDef; + OMX_ERRORTYPE err; + CLog::Log(LOGDEBUG, "OMXRENDER OnOmxRendererEventCompletion Event: %d\n", eOmxEvent); + switch(eOmxEvent) { + case eOMXRendererEventStateChanged: + pThis->m_oEventOmxSetStateDone.Set(); + break; + case eOMXRendererEventFlush: + CLog::Log(LOGDEBUG, "OMXRENDER OnOmxRendererEventCompletion eOMXEventFlush: %d\n", eOmxEvent); + break; + case eOMXRendererEventEndOfStream: + break; + case eOMXRendererEventPortSettingsChanged: + // Required OMX version + omxVersion.s.nVersionMajor = 1; + omxVersion.s.nVersionMinor = 1; + omxVersion.s.nRevision = 2; + omxVersion.s.nStep = 0; + memset((void *)&oRendererInputPortDef, sizeof(oRendererInputPortDef), 0); + oRendererInputPortDef.nSize = sizeof(oRendererInputPortDef); + oRendererInputPortDef.nVersion.nVersion = omxVersion.nVersion; + oRendererInputPortDef.nPortIndex = 0; + err = OMX_GetParameter(pThis->m_hComponentHandle, OMX_IndexParamPortDefinition, &oRendererInputPortDef); + if(err != OMX_ErrorNone) { + CLog::Log(LOGDEBUG, "OMXRENDER OMX_GetParameter() failed = %X\n", err); + return; + } + break; + case eOMXRendererEventPortDisable: + CLog::Log(LOGDEBUG, "OMXRENDER OnOmxRendererEventCompletion eOMXRendererEventPortDisable: %d\n", eOmxEvent); + pThis->m_oEventOmxSetStateDone.Set(); + break; + case eOMXRendererEventFirstFrameDisplayed: + pThis->m_oEventOmxEmptyBufferDone.Set(); + break; + case eOMXRendererEventUndefined: + break; + } +} + +CLinuxRendererOMX::CLinuxRendererOMX() +{ + for (int i = 0; i < NUM_BUFFERS; i++) + { + m_eventTexturesDone[i] = CreateEvent(NULL,FALSE,TRUE,NULL); + m_RenderBufferQueue[i] = -1; + } + + m_iYV12RenderBuffer = 0; + m_flipindex = 0; + m_currentField = FIELD_FULL; + + m_upscalingWidth = 0; + m_upscalingHeight = 0; + memset(&m_imScaled, 0, sizeof(m_imScaled)); + + memset(m_buffers, 0, sizeof(m_buffers)); + + CLog::Log(LOGDEBUG, "OMXRENDER CLinuxRendererOMX()\n"); + + m_bOmxInitialized = false; + m_bOmxTunnelMode = false; + m_hComponentHandle=NULL; + + m_uOmxRendererBufferCount = 0; + m_uOmxRendererBufSize = 0; + +} + +CLinuxRendererOMX::~CLinuxRendererOMX() +{ + CLog::Log(LOGDEBUG, "OMXRENDER CLinuxRendererOMX::~CLinuxRendererOMX()\n"); + UnInit(); + for (int i = 0; i < NUM_BUFFERS; i++) + CloseHandle(m_eventTexturesDone[i]); + + for (int i=0; i<3; i++) + { + if (m_imScaled.plane[i]) + { + delete [] m_imScaled.plane[i]; + m_imScaled.plane[i] = 0; + } + } + + CLog::Log(LOGDEBUG, "OMXRENDER ~CLinuxRendererOMX()\n"); +} + +void CLinuxRendererOMX::ManageTextures() +{ + CLog::Log(LOGDEBUG, "OMXRENDER CLinuxRendererOMX::~ManageTextures()\n"); + m_NumYV12Buffers = 2; + //m_iYV12RenderBuffer = 0; + return; +} + +bool CLinuxRendererOMX::ValidateRenderTarget() +{ + CLog::Log(LOGDEBUG, "OMXRENDER CLinuxRendererOMX::ValidateRenderTarget()\n"); + if (!m_bValidated) + { + for (int i = 0 ; i < m_NumYV12Buffers ; i++) + { + CreateYV12Texture(i); + } + m_bValidated = true; + return true; + } + return false; +} + +bool CLinuxRendererOMX::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags) +{ + m_sourceWidth = width; + m_sourceHeight = height; + + CLog::Log(LOGDEBUG, "OMXRENDER CLinuxRendererOMX::Configure( width:%d, height:%d, d_width:%d, d_height:%d, fps:%f, flags:0X%x )\n", width, height, d_width, d_height, fps, flags); + // Save the flags. + m_iFlags = flags; + + if(m_iFlags & CONF_FLAGS_OMX_TUNNELING) + { + m_bOmxTunnelMode = true; + } + + // Calculate the input frame aspect ratio. + CalculateFrameAspectRatio(d_width, d_height); + ChooseBestResolution(fps); + SetViewMode(g_stSettings.m_currentVideoSettings.m_ViewMode); + ManageDisplay(); + + ChooseUpscalingMethod(); + + m_bConfigured = true; + m_bImageReady = false; + + // Ensure that textures are recreated and rendering starts only after the 1st + // frame is loaded after every call to Configure(). + m_bValidated = false; + + for (int i = 0 ; iplane[p] = im.plane[p]; + image->stride[p] = im.stride[p]; + } + image->width = im.width; + image->height = im.height; + image->flags = im.flags; + image->cshift_x = im.cshift_x; + image->cshift_y = im.cshift_y; + + CLog::Log(LOGDEBUG, "CLinuxRenderer::GetImage %d source >> ", source); + return source; +} + +void CLinuxRendererOMX::ReleaseImage(int source, bool preserve) +{ + YV12Image &im = m_buffers[source].image; + + CLog::Log(LOGDEBUG, "OMXRENDER CLinuxRendererOMX::ReleaseImage()\n"); + CLog::Log(LOGDEBUG, "<< CLinuxRenderer::ReleaseImage %d source ", source); + + + im.flags &= ~IMAGE_FLAG_INUSE; + im.flags |= IMAGE_FLAG_READY; + /* if image should be preserved reserve it so it's not auto seleceted */ + + if( preserve ) + im.flags |= IMAGE_FLAG_RESERVED; + + m_iLastReleasedBuffer = source; + m_bImageReady = true; + + CLog::Log(LOGDEBUG, "CLinuxRenderer::ReleaseImage >> "); +} + +void CLinuxRendererOMX::LoadTextures(int source) +{ + YUVBUFFER& buf = m_buffers[source]; + YV12Image* im = &buf.image; + + if (!(im->flags&IMAGE_FLAG_READY)) + { + CLog::Log(LOGDEBUG, " OMXRENDER CLinuxRendererOMX::LoadTextures(A) source:%d, im->flags:0x%x\n", source, im->flags); + SetEvent(m_eventTexturesDone[source]); + return; + } + + bool deinterlacing; + if (m_currentField == FIELD_FULL) + deinterlacing = false; + else + deinterlacing = true; + + + if(m_bRenderFromAppThread) + { + if(!m_bOmxTunnelMode) + { + OMX_BUFFERHEADERTYPE *pOmxBuffer = m_buffers[source].pOmxBuffer; + + CLog::Log(LOGDEBUG, "CLinuxRendererOMX::FlipPage buff:%p pBuffer:%p", pOmxBuffer, pOmxBuffer->pBuffer); + + #if 0 + unsigned char *pB = pOmxBuffer->pBuffer; + printf("Buffer Data: "); + for(int i = 0; i < 32; i++) + printf("%02X ", pB[i]); + printf("\n"); + #endif + pOmxBuffer->nFilledLen = m_uOmxRendererBufSize; + pOmxBuffer->nOffset = 0; + OMX_ERRORTYPE err = OMX_EmptyThisBuffer(m_hComponentHandle, pOmxBuffer); + if(err != OMX_ErrorNone) + { + CLog::Log(LOGERROR, "OMX_EmptyThisBuffer() failed = %X\n", err); + return; + } + // Wait for Empty Buffer is completed + m_oEventOmxEmptyBufferDone.Wait(); + CLog::Log(LOGDEBUG, " OMXRENDER CLinuxRendererOMX::LoadTextures(B) source:%d, im->flags:0x%x queue[%d,%d,%d]\n", source, im->flags, + m_RenderBufferQueue[0], m_RenderBufferQueue[1], m_RenderBufferQueue[2]); + + //clear the flags and advance the queue before setting the done event + im->flags = 0; + for(int i=0; i < m_NumYV12Buffers-1; i++) + m_RenderBufferQueue[i] = m_RenderBufferQueue[i+1]; + + m_RenderBufferQueue[m_NumYV12Buffers-1] = -1; + } + } + + SetEvent(m_eventTexturesDone[source]); +} + +void CLinuxRendererOMX::Reset() +{ + CLog::Log(LOGDEBUG, "<< CLinuxRendererOMX::Reset"); + for(int i=0; i>"); +} + +void CLinuxRendererOMX::Update(bool bPauseDrawing) +{ + if (!m_bConfigured) return; + ManageDisplay(); + ManageTextures(); +} + +void CLinuxRendererOMX::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +{ + CLog::Log(LOGDEBUG, "<< CLinuxRendererOMX::RenderUpdate"); + if (!m_bConfigured) return; + + // if its first pass, just init textures and return + if (ValidateRenderTarget()) + return; + + // this needs to be checked after texture validation + if (!m_bImageReady) return; + + ManageDisplay(); + ManageTextures(); + + // grab the index from the front of the queue + int index; + if(m_bRenderFromAppThread) + { + index = m_RenderBufferQueue[0]; + if(index < 0) return; + } + else + { + // If we're flipping from the decoder there is no need go proceed further + return; + } + + m_iLastRenderBuffer = index; + Render(flags, index); + + CLog::Log(LOGDEBUG, "CLinuxRendererOMX::RenderUpdate >>"); +} + +void CLinuxRendererOMX::FlipPage(int source) +{ + if(m_bRenderFromAppThread) + { + if(m_iLastReleasedBuffer > -1) + { + for(int i=0; i < m_NumYV12Buffers; i++) + { + if (m_RenderBufferQueue[i] < 0) + { + m_RenderBufferQueue[i] = m_iLastReleasedBuffer; + CLog::Log(LOGDEBUG, "CLinuxRendererOMX::FlipPage() LastReleasedBuffer:%d, queue_index:%d", m_iLastReleasedBuffer, i); + break; + } + } + } + } + else + { + if(!m_bOmxTunnelMode) + { + OMX_BUFFERHEADERTYPE *pOmxBuffer = m_buffers[m_iLastReleasedBuffer].pOmxBuffer; + CLog::Log(LOGDEBUG, "CLinuxRendererOMX::FlipPage buff:%p pBuffer:%p", pOmxBuffer, pOmxBuffer->pBuffer); + + #if 0 + unsigned char *pB = pOmxBuffer->pBuffer; + printf("Buffer Data: "); + for(int i = 0; i < 32; i++) + printf("%02X ", pB[i]); + printf("\n"); + #endif + pOmxBuffer->nFilledLen = m_uOmxRendererBufSize; + pOmxBuffer->nOffset = 0; + OMX_ERRORTYPE err = OMX_EmptyThisBuffer(m_hComponentHandle, pOmxBuffer); + if(err != OMX_ErrorNone) + { + CLog::Log(LOGERROR, "OMX_EmptyThisBuffer() failed = %X\n", err); + return; + } + // Wait for Empty Buffer is completed + m_oEventOmxEmptyBufferDone.Wait(); + + SetEvent(m_eventTexturesDone[m_iLastReleasedBuffer]); + + CLog::Log(LOGDEBUG, "CLinuxRendererOMX::FlipPage() empty_buffer:%d, im.flags:0x%x >>", m_iLastReleasedBuffer, m_buffers[m_iLastReleasedBuffer].image.flags); + } + } + + CLog::Log(LOGDEBUG, "<< CLinuxRendererOMX::FlipPage %d source", source); + if( source >= 0 && source < m_NumYV12Buffers ) + m_iYV12RenderBuffer = source; + else + m_iYV12RenderBuffer = NextYV12Texture(); + + CLog::Log(LOGDEBUG, "CLinuxRendererOMX::FlipPage %d m_iYV12RenderBuffer", m_iYV12RenderBuffer); + m_buffers[m_iYV12RenderBuffer].flipindex = ++m_flipindex; + + return; +} + + +unsigned int CLinuxRendererOMX::DrawSlice(unsigned char *src[], int stride[], int w, int h, int x, int y) +{ + BYTE *s; + BYTE *d; + int i, p; + + CLog::Log(LOGDEBUG, "<< CLinuxRendererOMX::DrawSlice"); + + int index = NextYV12Texture(); + if( index < 0 ) + return -1; + + YV12Image &im = m_buffers[index].image; + // copy Y + p = 0; + d = (BYTE*)im.plane[p] + im.stride[p] * y + x; + s = src[p]; + for (i = 0;i < h;i++) + { + memcpy(d, s, w); + s += stride[p]; + d += im.stride[p]; + } + + w >>= im.cshift_x; h >>= im.cshift_y; + x >>= im.cshift_x; y >>= im.cshift_y; + + // copy U + p = 1; + d = (BYTE*)im.plane[p] + im.stride[p] * y + x; + s = src[p]; + for (i = 0;i < h;i++) + { + memcpy(d, s, w); + s += stride[p]; + d += im.stride[p]; + } + + // copy V + p = 2; + d = (BYTE*)im.plane[p] + im.stride[p] * y + x; + s = src[p]; + for (i = 0;i < h;i++) + { + memcpy(d, s, w); + s += stride[p]; + d += im.stride[p]; + } + + SetEvent(m_eventTexturesDone[index]); + CLog::Log(LOGDEBUG, "CLinuxRendererOMX::DrawSlice >>"); + return 0; +} + +unsigned int CLinuxRendererOMX::PreInit() +{ + CSingleLock lock(g_graphicsContext); + + CLog::Log(LOGDEBUG, "OMXRENDER CLinuxRendererOMX::PreInit()\n"); + + m_bConfigured = false; + m_bValidated = false; + UnInit(); + m_resolution = RES_PAL_4x3; + m_bRenderFromAppThread = false; + + m_iYV12RenderBuffer = 0; + m_NumYV12Buffers = 2; + + m_vOMX.s.nVersionMajor = 1; + m_vOMX.s.nVersionMinor = 1; + m_vOMX.s.nRevision = 0;//2; + m_vOMX.s.nStep = 0; + + // setup the background colour + m_clearColour = (float)(g_advancedSettings.m_videoBlackBarColour & 0xff) / 0xff; + m_aspecterror = g_guiSettings.GetFloat("videoplayer.aspecterror") * 0.01; + + CLog::Log(LOGDEBUG, "OMXRENDER PreInit DONE\n"); + + return true; +} + +void CLinuxRendererOMX::UnInit() +{ + CLog::Log(LOGDEBUG, "LinuxRendererGL: Cleaning up GL resources"); + CSingleLock lock(g_graphicsContext); + + CLog::Log(LOGDEBUG,"OMXRENDER OMXRENDER UnInit()"); + + if(m_bOmxInitialized) + { + if(!m_bOmxTunnelMode) + { + OMX_ERRORTYPE err = OMX_SendCommand(m_hComponentHandle, OMX_CommandStateSet, OMX_StateIdle, NULL); + if(err != OMX_ErrorNone) { + CLog::Log(LOGERROR, "OMXRENDER OMX_SendCommand() failed = %X\n", err); + return; + } + + // Wait for Idle State notification + m_oEventOmxSetStateDone.Wait(); + + err = OMX_SendCommand(m_hComponentHandle, OMX_CommandStateSet, OMX_StateLoaded, NULL); + if(err != OMX_ErrorNone) { + CLog::Log(LOGERROR, "OMXRENDER OMX_SendCommand() failed = %X\n", err); + return; + } + + for(unsigned int i = 0; i < m_uOmxRendererBufferCount; i++) { + err = OMX_FreeBuffer(m_hComponentHandle, 0, m_pOmxRendererBuffers[i]); + if(err != OMX_ErrorNone) { + CLog::Log(LOGERROR, "OMXRENDER OMX_FreeBuffer() seq:%u failed = %X\n", i, err); + return; + } + } + + // Wait for Loaded State notification + m_oEventOmxSetStateDone.Wait(); + + err = OMX_FreeHandle(m_hComponentHandle); + if(err != OMX_ErrorNone) { + CLog::Log(LOGERROR, "OMXRENDER OMX_SendCommand() failed = %X\n", err); + return; + } + + err = OMX_Deinit(); + if(err != OMX_ErrorNone) { + CLog::Log(LOGDEBUG, "OMXRENDER OMX_Deinit() failed = %X\n", err); + return; + } + } + m_bOmxInitialized = false; + } + + // YV12 textures + for (int i = 0; i < NUM_BUFFERS; ++i) + { + m_RenderBufferQueue[i] = -1; + DeleteYV12Texture(i); + } + + // cleanup framebuffer object if it was in use + m_bValidated = false; + m_bImageReady = false; + m_bConfigured = false; + return; +} + +void CLinuxRendererOMX::Render(DWORD flags, int renderBuffer) +{ + CLog::Log(LOGDEBUG, "OMXRENDER CLinuxRendererOMX::Render( %d, %d )\n", flags, renderBuffer); + // obtain current field, if interlaced + if( flags & RENDER_FLAG_ODD) + m_currentField = FIELD_ODD; + + else if (flags & RENDER_FLAG_EVEN) + m_currentField = FIELD_EVEN; + + else if (flags & RENDER_FLAG_LAST) + { + switch(m_currentField) + { + case FIELD_ODD: + flags = RENDER_FLAG_ODD; + break; + + case FIELD_EVEN: + flags = RENDER_FLAG_EVEN; + break; + } + } + else + m_currentField = FIELD_FULL; + + LoadTextures(renderBuffer); + RenderSinglePass(renderBuffer, m_currentField); +} + +void CLinuxRendererOMX::AutoCrop(bool bCrop) +{ + RECT crop; + + CLog::Log(LOGDEBUG, "OMXRENDER CLinuxRendererOMX::AutoCrop( %d)\n", bCrop); + + if(!m_bValidated) return; + + if (bCrop) + { + YV12Image &im = m_buffers[m_iYV12RenderBuffer].image; + crop.left = g_stSettings.m_currentVideoSettings.m_CropLeft; + crop.right = g_stSettings.m_currentVideoSettings.m_CropRight; + crop.top = g_stSettings.m_currentVideoSettings.m_CropTop; + crop.bottom = g_stSettings.m_currentVideoSettings.m_CropBottom; + + int black = 16; // what is black in the image + int level = 8; // how high above this should we detect + int multi = 4; // what multiple of last line should failing line be to accept + BYTE *s; + int last, detect, black2; + + // top and bottom levels + black2 = black * im.width; + detect = level * im.width + black2; + + // Crop top + s = im.plane[0]; + last = black2; + for (unsigned int y = 0; y < im.height/2; y++) + { + int total = 0; + for (unsigned int x = 0; x < im.width; x++) + total += s[x]; + s += im.stride[0]; + + if (total > detect) + { + if (total - black2 > (last - black2) * multi) + crop.top = y; + break; + } + last = total; + } + + // Crop bottom + s = im.plane[0] + (im.height-1)*im.stride[0]; + last = black2; + for (unsigned int y = (int)im.height; y > im.height/2; y--) + { + int total = 0; + for (unsigned int x = 0; x < im.width; x++) + total += s[x]; + s -= im.stride[0]; + + if (total > detect) + { + if (total - black2 > (last - black2) * multi) + crop.bottom = im.height - y; + break; + } + last = total; + } + + // left and right levels + black2 = black * im.height; + detect = level * im.height + black2; + + + // Crop left + s = im.plane[0]; + last = black2; + for (unsigned int x = 0; x < im.width/2; x++) + { + int total = 0; + for (unsigned int y = 0; y < im.height; y++) + total += s[y * im.stride[0]]; + s++; + if (total > detect) + { + if (total - black2 > (last - black2) * multi) + crop.left = x; + break; + } + last = total; + } + + // Crop right + s = im.plane[0] + (im.width-1); + last = black2; + for (unsigned int x = (int)im.width-1; x > im.width/2; x--) + { + int total = 0; + for (unsigned int y = 0; y < im.height; y++) + total += s[y * im.stride[0]]; + s--; + + if (total > detect) + { + if (total - black2 > (last - black2) * multi) + crop.right = im.width - x; + break; + } + last = total; + } + + // We always crop equally on each side to get zoom + // effect intead of moving the image. Aslong as the + // max crop isn't much larger than the min crop + // use that. + int min, max; + + min = std::min(crop.left, crop.right); + max = std::max(crop.left, crop.right); + if(10 * (max - min) / im.width < 1) + crop.left = crop.right = max; + else + crop.left = crop.right = min; + + min = std::min(crop.top, crop.bottom); + max = std::max(crop.top, crop.bottom); + if(10 * (max - min) / im.height < 1) + crop.top = crop.bottom = max; + else + crop.top = crop.bottom = min; + } + else + { // reset to defaults + crop.left = 0; + crop.right = 0; + crop.top = 0; + crop.bottom = 0; + } + + m_crop.x1 += ((float)crop.left - m_crop.x1) * 0.1; + m_crop.x2 += ((float)crop.right - m_crop.x2) * 0.1; + m_crop.y1 += ((float)crop.top - m_crop.y1) * 0.1; + m_crop.y2 += ((float)crop.bottom - m_crop.y2) * 0.1; + + crop.left = MathUtils::round_int(m_crop.x1); + crop.right = MathUtils::round_int(m_crop.x2); + crop.top = MathUtils::round_int(m_crop.y1); + crop.bottom = MathUtils::round_int(m_crop.y2); + + //compare with hysteresis +# define HYST(n, o) ((n) > (o) || (n) + 1 < (o)) + if(HYST(g_stSettings.m_currentVideoSettings.m_CropLeft , crop.left) + || HYST(g_stSettings.m_currentVideoSettings.m_CropRight , crop.right) + || HYST(g_stSettings.m_currentVideoSettings.m_CropTop , crop.top) + || HYST(g_stSettings.m_currentVideoSettings.m_CropBottom, crop.bottom)) + { + g_stSettings.m_currentVideoSettings.m_CropLeft = crop.left; + g_stSettings.m_currentVideoSettings.m_CropRight = crop.right; + g_stSettings.m_currentVideoSettings.m_CropTop = crop.top; + g_stSettings.m_currentVideoSettings.m_CropBottom = crop.bottom; + SetViewMode(g_stSettings.m_currentVideoSettings.m_ViewMode); + } +# undef HYST +} + +void CLinuxRendererOMX::RenderSinglePass(int index, int field) +{ +} + +void CLinuxRendererOMX::CreateThumbnail(CBaseTexture* texture, unsigned int width, unsigned int height) +{ +} + +//******************************************************************************************************** +// YV12 Texture creation, deletion, copying + clearing +//******************************************************************************************************** +void CLinuxRendererOMX::DeleteYV12Texture(int index) +{ + + CLog::Log(LOGDEBUG, "OMXRENDER CLinuxRendererOMX::DeleteYV12TextureA()\n"); + CLog::Log(LOGDEBUG, "Deleted YV12 texture %i", index); + + YV12Image &im = m_buffers[index].image; + + if(m_bOmxTunnelMode) + { +#if 1 + for(int p = 0;p> im.cshift_x; + im.stride[2] = im.width >> im.cshift_x; + if(m_bOmxTunnelMode) + { + im.plane[0] = new BYTE[im.stride[0] * im.height]; + im.plane[1] = new BYTE[im.stride[1] * ( im.height >> im.cshift_y )]; + im.plane[2] = new BYTE[im.stride[2] * ( im.height >> im.cshift_y )]; + } + else + { + im.plane[0] = m_pOmxRendererBuffers[index]->pBuffer ; + im.plane[1] = im.plane[0] + (m_sourceWidth * m_sourceHeight); + im.plane[2] = im.plane[1] + m_sourceWidth * m_sourceHeight / 4; + } + m_buffers[index].pOmxBuffer = m_pOmxRendererBuffers[index]; + } + + CLog::Log(LOGDEBUG, "OMXRENDER CLinuxRendererOMX::CreateYV12Texture() im.plane[0] = %p \n", im.plane[0]); + + SetEvent(m_eventTexturesDone[index]); + return true; +} + +bool CLinuxRendererOMX::SupportsBrightness() +{ + return false; +} + +bool CLinuxRendererOMX::SupportsContrast() +{ + return false; +} + +bool CLinuxRendererOMX::SupportsGamma() +{ + return false; +} + +bool CLinuxRendererOMX::SupportsMultiPassRendering() +{ + return false; +} + +int CLinuxRendererOMX::SetProfileMode(OMX_HANDLETYPE hComp,int bFlip) +{ + + CLog::Log(LOGDEBUG, "CLinuxRendererOMX::SetProfileMode() called with flip = %d\n", (int)bFlip); + + OMX_INDEXTYPE eIndexConfigProfile; + NVX_CONFIG_PROFILE oProf; + OMX_ERRORTYPE eError; + + INIT_PARAM(oProf); + + eError = OMX_GetExtensionIndex(hComp, NVX_INDEX_CONFIG_PROFILE, + &eIndexConfigProfile); + + if(eError != OMX_ErrorNone) + { + CLog::Log(LOGDEBUG, "ERROR! OMX_GetExtensionIndex() failed with %x\n", eError); + return eError; + } + + oProf.nPortIndex = 0; + oProf.bProfile = OMX_FALSE; + oProf.bVerbose = OMX_TRUE; + oProf.bStubOutput = OMX_TRUE; + oProf.nForceLocale = 0; + oProf.nNvMMProfile = 0; + oProf.bNoAVSync = OMX_TRUE; + oProf.nAVSyncOffset = 0; + oProf.bFlip = (OMX_BOOL)bFlip; + oProf.nFrameDrop = 0; + oProf.bSanity = OMX_FALSE; + eError = OMX_SetConfig(hComp, eIndexConfigProfile, &oProf); + + if(eError != OMX_ErrorNone) + { + CLog::Log(LOGDEBUG, "ERROR! OMX_SetConfig() failed with %x\n", eError); + return eError; + } + + return eError; +} + +bool CLinuxRendererOMX::Supports(EINTERLACEMETHOD method) +{ + return false; +} + +bool CLinuxRendererOMX::Supports(ESCALINGMETHOD method) +{ + return false; +} + +#endif //HAS_OPENMAX diff --git a/xbmc/cores/VideoRenderers/LinuxRendererOMX.h b/xbmc/cores/VideoRenderers/LinuxRendererOMX.h new file mode 100644 index 00000000..0e8e9eed --- /dev/null +++ b/xbmc/cores/VideoRenderers/LinuxRendererOMX.h @@ -0,0 +1,321 @@ +#ifndef LINUXRENDERERGL_RENDERER +#define LINUXRENDERERGL_RENDERER + +#include "system.h" + +#if defined(HAS_OPENMAX) + +#include "../../../guilib/FrameBufferObject.h" +#include "../../../guilib/Shader.h" +#include "../ffmpeg/DllSwScale.h" +#include "../ffmpeg/DllAvCodec.h" +#include "../../settings/VideoSettings.h" +#include "RenderFlags.h" +#include "GraphicContext.h" +#include "BaseRenderer.h" +#include "utils/Event.h" + +#include + +class CBaseTexture; + +#define NUM_BUFFERS 3 + +#define MAX_PLANES 3 +#define MAX_FIELDS 3 + +#undef ALIGN +#define ALIGN(value, alignment) (((value)+((alignment)-1))&~((alignment)-1)) +#define CLAMP(a, min, max) ((a) > (max) ? (max) : ( (a) < (min) ? (min) : a )) + +#if 0 +typedef struct YV12Image +{ + BYTE * plane[MAX_PLANES]; + unsigned stride[MAX_PLANES]; + unsigned width; + unsigned height; + unsigned flags; + + unsigned cshift_x; /* this is the chroma shift used */ + unsigned cshift_y; +} YV12Image; + +#endif + +#define AUTOSOURCE -1 + +#define IMAGE_FLAG_WRITING 0x01 /* image is in use after a call to GetImage, caller may be reading or writing */ +#define IMAGE_FLAG_READING 0x02 /* image is in use after a call to GetImage, caller is only reading */ +#define IMAGE_FLAG_DYNAMIC 0x04 /* image was allocated due to a call to GetImage */ +#define IMAGE_FLAG_RESERVED 0x08 /* image is reserved, must be asked for specifically used to preserve images */ +#define IMAGE_FLAG_READY 0x10 /* image is ready to be uploaded to texture memory */ +#define IMAGE_FLAG_INUSE (IMAGE_FLAG_WRITING | IMAGE_FLAG_READING | IMAGE_FLAG_RESERVED) + +struct DRAWRECT +{ + float left; + float top; + float right; + float bottom; +}; + +enum EFIELDSYNC +{ + FS_NONE, + FS_ODD, + FS_EVEN +}; + +struct YUVRANGE +{ + int y_min, y_max; + int u_min, u_max; + int v_min, v_max; +}; + +struct YUVCOEF +{ + float r_up, r_vp; + float g_up, g_vp; + float b_up, b_vp; +}; + +enum RenderMethod +{ + RENDER_GLSL=0x01, + RENDER_ARB=0x02, + RENDER_SW=0x04, + RENDER_VDPAU=0x08, + RENDER_POT=0x10 +}; + +enum RenderQuality +{ + RQ_LOW=1, + RQ_SINGLEPASS, + RQ_MULTIPASS, + RQ_SOFTWARE +}; + +#define PLANE_Y 0 +#define PLANE_U 1 +#define PLANE_V 2 + +#define FIELD_FULL 0 +#define FIELD_ODD 1 +#define FIELD_EVEN 2 + +extern YUVRANGE yuv_range_lim; +extern YUVRANGE yuv_range_full; +extern YUVCOEF yuv_coef_bt601; +extern YUVCOEF yuv_coef_bt709; +extern YUVCOEF yuv_coef_ebu; +extern YUVCOEF yuv_coef_smtp240m; + +#define OMX_OVRLAY_MAX_BUFFER_CNT 20 + +struct OMX_BUFFERHEADERTYPE; +struct OmxRendererState; + +enum EOMXRendererEvent { + eOMXRendererEventStateChanged, + eOMXRendererEventFlush, + eOMXRendererEventPortDisable, + eOMXRendererEventEndOfStream, + eOMXRendererEventPortSettingsChanged, + eOMXRendererEventFirstFrameDisplayed, + eOMXRendererEventUndefined +}; + +typedef void (*ON_OMX_RENDERER_EMPTY_BUFFER_DONE)(void *pClientThis, OMX_BUFFERHEADERTYPE *pBuffer); +typedef void (*ON_OMX_RENDERER_FILL_BUFFER_DONE)(void *pClientThis, OMX_BUFFERHEADERTYPE *pBuffer); +typedef void (*ON_OMX_RENDERER_EVENT_COMPLETION)(void *pClientThis, OmxRendererState *pOmxRendererState, EOMXRendererEvent eOmxEvent, unsigned int uData1, unsigned int uData2); + +struct OmxRendererCallBacks { + ON_OMX_RENDERER_EMPTY_BUFFER_DONE OnOmxRendererEmptyBufferDone; + ON_OMX_RENDERER_FILL_BUFFER_DONE OnOmxRendererFillBufferDone; + ON_OMX_RENDERER_EVENT_COMPLETION OnOmxRendererEventCompletion; +}; + +struct OmxRendererState { + OmxRendererCallBacks *pCallBacks; + void *pClientThis; + void *pNvEvent; +}; + +class CLinuxRendererOMX : public CBaseRenderer +{ +public: + CLinuxRendererOMX(); + virtual ~CLinuxRendererOMX(); + + virtual void Update(bool bPauseDrawing); + virtual void SetupScreenshot() {}; + + void CreateThumbnail(CBaseTexture *texture, unsigned int width, unsigned int height); + + // Player functions + virtual bool Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags); + virtual bool IsConfigured() { return m_bConfigured; } + virtual int GetImage(YV12Image *image, int source = AUTOSOURCE, bool readonly = false); + virtual void ReleaseImage(int source, bool preserve = false); + virtual unsigned int DrawSlice(unsigned char *src[], int stride[], int w, int h, int x, int y); + virtual void FlipPage(int source); + virtual unsigned int PreInit(); + virtual void UnInit(); + virtual void Reset(); /* resets renderer after seek for example */ + + virtual void AutoCrop(bool bCrop); + virtual void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255); + + // Feature support + virtual bool SupportsBrightness(); + virtual bool SupportsContrast(); + virtual bool SupportsGamma(); + virtual bool SupportsMultiPassRendering(); + virtual bool Supports(EINTERLACEMETHOD method); + virtual bool Supports(ESCALINGMETHOD method); + + inline void SetRGB32Image(const char *image, int nHeight, int nWidth, int nPitch) + { + } + +protected: + virtual void Render(DWORD flags, int renderBuffer); + + void ChooseUpscalingMethod(); + bool IsSoftwareUpscaling(); + void InitializeSoftwareUpscaling(); + + virtual void ManageTextures(); + void DeleteYV12Texture(int index); + void ClearYV12Texture(int index); + virtual bool CreateYV12Texture(int index, bool clear=true); + void CopyYV12Texture(int dest); + int NextYV12Texture(); + virtual bool ValidateRenderTarget(); + void LoadTextures(int source); + void UpdateVideoFilter(); + + // renderers + void RenderMultiPass(int renderBuffer, int field); // multi pass glsl renderer + void RenderSinglePass(int renderBuffer, int field); // single pass glsl renderer + + int m_iYV12RenderBuffer; // The index to current renderer buffer for the decoder + int m_NumYV12Buffers; // number of total render buffers + int m_iLastRenderBuffer; // index of the previous buffer that was rendererd + int m_iLastReleasedBuffer; // variable used to pass the index of the most previous released buffer to the next FlipPage if using AUTO_SOURCE + int m_RenderBufferQueue[NUM_BUFFERS]; // simple queue the size of number of YV12 buffers to help the render keep track of output order from the decoder + + bool m_bRenderFromAppThread; + bool m_bConfigured; + bool m_bValidated; + bool m_bImageReady; + unsigned m_iFlags; + unsigned int m_flipindex; // just a counter to keep track of if a image has been uploaded + bool m_StrictBinding; + + // Software upscaling. + int m_upscalingWidth; + int m_upscalingHeight; + YV12Image m_imScaled; + + // Raw data used by renderer + int m_currentField; + int m_reloadShaders; + + struct YUVPLANE + { + GLuint id; + CRect rect; + + float width; + float height; + + unsigned texwidth; + unsigned texheight; + + unsigned flipindex; + }; + + typedef YUVPLANE YUVPLANES[MAX_PLANES]; + + struct YUVBUFFER + { + YV12Image image; + unsigned flipindex; /* used to decide if this has been uploaded */ + OMX_BUFFERHEADERTYPE *pOmxBuffer; + }; + + typedef YUVBUFFER YUVBUFFERS[NUM_BUFFERS]; + + YUVBUFFERS m_buffers; + + void LoadPlane( YUVPLANE& plane, int type, unsigned flipindex + , unsigned width, unsigned height + , int stride, void* data ); + + // clear colour for "black" bars + float m_clearColour; + + HANDLE m_eventTexturesDone[NUM_BUFFERS]; + CRect m_crop; + float m_aspecterror; + + /* OMX related stuff */ + static void OnOmxRendererEmptyBufferDone(void *pClientThis, OMX_BUFFERHEADERTYPE *pBuffer); + static void OnOmxRendererEventCompletion(void *pClientThis, OmxRendererState *pOmxDecState, EOMXRendererEvent eOmxEvent, unsigned int uData1, unsigned int uData2); + + /* OMX helpers */ + int SetProfileMode(OMX_HANDLETYPE hComp,int bFlip); + + OMX_VERSIONTYPE m_vOMX; + bool m_bOmxInitialized; + bool m_bOmxTunnelMode; + void* m_hComponentHandle; + + OmxRendererCallBacks m_OmxrendererCallBacks; + + // Decoder output buffer data... + unsigned int m_uOmxRendererBufferCount; + unsigned int m_uOmxRendererBufSize; + OMX_BUFFERHEADERTYPE *m_pOmxRendererBuffers[OMX_OVRLAY_MAX_BUFFER_CNT]; + OmxRendererState m_OmxRendererState; + + CEvent m_oEventOmxSetStateDone; + CEvent m_oEventOmxEmptyBufferDone; + +}; + + +inline int NP2( unsigned x ) { +#if defined(_LINUX) && !defined(__POWERPC__) && !defined(__PPC__) && !defined(_ARM) + // If there are any issues compiling this, just append a ' && 0' + // to the above to make it '#if defined(_LINUX) && 0' + + // Linux assembly is AT&T Unix style, not Intel style + unsigned y; + __asm__("dec %%ecx \n" + "movl $1, %%eax \n" + "bsr %%ecx,%%ecx \n" + "inc %%ecx \n" + "shl %%cl, %%eax \n" + "movl %%eax, %0 \n" + :"=r"(y) + :"c"(x) + :"%eax"); + return y; +#else + --x; + x |= x >> 1; + x |= x >> 2; + x |= x >> 4; + x |= x >> 8; + x |= x >> 16; + return ++x; +#endif +} +#endif + +#endif diff --git a/xbmc/cores/VideoRenderers/NullRenderer.cpp b/xbmc/cores/VideoRenderers/NullRenderer.cpp new file mode 100644 index 00000000..e23fa7a9 --- /dev/null +++ b/xbmc/cores/VideoRenderers/NullRenderer.cpp @@ -0,0 +1,101 @@ +/* + * XBMC Media Center + * Linux OpenGL Renderer + * Copyright (c) 2007 Frodo/jcmarshall/vulkanr/d4rk + * + * Based on XBoxRenderer by Frodo/jcmarshall + * Portions Copyright (c) by the authors of ffmpeg / xvid /mplayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include "system.h" + +#ifdef HAS_NULL_RENDERER + +#include "NullRenderer.h" + +CNullRenderer::CNullRenderer() +{ +} + +CNullRenderer::~CNullRenderer() +{ +} + +unsigned int CNullRenderer::PreInit() +{ + return true; +} + +void CNullRenderer::UnInit() +{ +} + +void CNullRenderer::SetSpeed(int speed) +{ +} + +void CNullRenderer::Flush() +{ +} + +bool CNullRenderer::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, CRect &rect) +{ + return true; +} + +int CNullRenderer::GetImage(YV12Image *image, double pts, int source, bool readonly) +{ + return 0; +} + +void CNullRenderer::ReleaseImage(int source, bool preserve) +{ +} + +void CNullRenderer::Reset() +{ +} + +void CNullRenderer::Update(bool bPauseDrawing) +{ +} + +void CNullRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +{ +} + +unsigned int CNullRenderer::DrawSlice(unsigned char *src[], int stride[], int w, int h, int x, int y) +{ + return 0; +} + +bool CNullRenderer::SupportsBrightness() +{ + return false; +} + +bool CNullRenderer::SupportsContrast() +{ + return false; +} + +bool CNullRenderer::SupportsGamma() +{ + return false; +} + +#endif + diff --git a/xbmc/cores/VideoRenderers/NullRenderer.h b/xbmc/cores/VideoRenderers/NullRenderer.h new file mode 100644 index 00000000..2b577132 --- /dev/null +++ b/xbmc/cores/VideoRenderers/NullRenderer.h @@ -0,0 +1,97 @@ +#pragma once + +#include "../../settings/VideoSettings.h" +#include "RenderFlags.h" +#include "GraphicContext.h" +#include "BaseRenderer.h" +#include "utils/Thread.h" + +#define NUM_BUFFERS 2 + +#define MAX_PLANES 3 +#define MAX_FIELDS 3 + +#undef ALIGN +#define ALIGN(value, alignment) (((value)+((alignment)-1))&~((alignment)-1)) +#define CLAMP(a, min, max) ((a) > (max) ? (max) : ( (a) < (min) ? (min) : a )) + +#define IMAGE_FLAG_WRITING 0x01 /* image is in use after a call to GetImage, caller may be reading or writing */ +#define IMAGE_FLAG_READING 0x02 /* image is in use after a call to GetImage, caller is only reading */ +#define IMAGE_FLAG_DYNAMIC 0x04 /* image was allocated due to a call to GetImage */ +#define IMAGE_FLAG_RESERVED 0x08 /* image is reserved, must be asked for specifically used to preserve images */ +#define IMAGE_FLAG_READY 0x16 /* image is ready to be uploaded to texture memory */ +#define IMAGE_FLAG_INUSE (IMAGE_FLAG_WRITING | IMAGE_FLAG_READING | IMAGE_FLAG_RESERVED) + +enum EFIELDSYNC +{ + FS_NONE, + FS_TOP, + FS_BOT +}; + +struct DRAWRECT +{ + float left; + float top; + float right; + float bottom; +}; + +struct VideoVertex +{ + float x, y, z; + float y1, y2; + float u1, u2; + float v1, v2; +}; + +#define PLANE_Y 0 +#define PLANE_U 1 +#define PLANE_V 2 + +#define FIELD_FULL 0 +#define FIELD_ODD 1 +#define FIELD_EVEN 2 + +typedef unsigned char* YUVMEMORYPLANES[MAX_PLANES]; +typedef YUVMEMORYPLANES YUVMEMORYBUFFERS[NUM_BUFFERS]; + +class CRenderCapture; + +class CNullRenderer : public CBaseRenderer +{ +public: + CNullRenderer(); + virtual ~CNullRenderer(); + + virtual void Update(bool bPauseDrawing); + virtual void SetupScreenshot() {}; + + // Player functions + virtual bool Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, CRect &rect); + virtual bool IsConfigured() { return true; } + virtual int GetImage(YV12Image *image, double pts, int source = AUTOSOURCE, bool readonly = false); + virtual void ReleaseImage(int source, bool preserve = false); + virtual unsigned int DrawSlice(unsigned char *src[], int stride[], int w, int h, int x, int y); + virtual void FlipPage(int source) { } + virtual unsigned int PreInit(); + virtual void UnInit(); + virtual void Reset(); /* resets renderer after seek for example */ + virtual void SetSpeed(int speed); + virtual void Flush(); + + virtual void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255); + + // Feature support + virtual bool SupportsBrightness(); + virtual bool SupportsContrast(); + virtual bool SupportsGamma(); + + // Feature support + virtual bool SupportsMultiPassRendering() { return false; } + virtual bool Supports(ERENDERFEATURE feature) { return false; } + virtual bool Supports(EINTERLACEMETHOD method) { return false; } + virtual bool Supports(ESCALINGMETHOD method) { return false; } + bool RenderCapture(CRenderCapture* capture) { return false; } + bool IsTimed() { return true; } +}; diff --git a/xbmc/cores/VideoRenderers/RenderCapture.cpp b/xbmc/cores/VideoRenderers/RenderCapture.cpp new file mode 100644 index 00000000..c5543620 --- /dev/null +++ b/xbmc/cores/VideoRenderers/RenderCapture.cpp @@ -0,0 +1,404 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "RenderCapture.h" +#include "utils/log.h" +#include "WindowingFactory.h" +#include "utils/fastmemcpy.h" + +CRenderCaptureBase::CRenderCaptureBase() +{ + m_state = CAPTURESTATE_FAILED; + m_userState = CAPTURESTATE_FAILED; + m_pixels = NULL; + m_width = 0; + m_height = 0; + m_bufferSize = 0; + m_flags = 0; + m_asyncSupported = false; + m_asyncChecked = false; +} + +CRenderCaptureBase::~CRenderCaptureBase() +{ +} + +#if defined(HAS_GL) || defined(HAS_GLES) + +CRenderCaptureGL::CRenderCaptureGL() +{ + m_pbo = 0; + m_query = 0; +} + +CRenderCaptureGL::~CRenderCaptureGL() +{ +#ifndef HAS_GLES + if (m_asyncSupported) + { + if (m_pbo) + { + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, m_pbo); + glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); + glDeleteBuffersARB(1, &m_pbo); + } + + if (m_query) + glDeleteQueriesARB(1, &m_query); + } +#endif + + delete[] m_pixels; +} + +void CRenderCaptureGL::BeginRender() +{ + if (!m_asyncChecked) + { +#ifndef HAS_GLES + m_asyncSupported = g_Windowing.IsExtSupported("GL_ARB_occlusion_query") && g_Windowing.IsExtSupported("GL_ARB_pixel_buffer_object"); + + if (m_flags & CAPTUREFLAG_CONTINUOUS) + { + if (!g_Windowing.IsExtSupported("GL_ARB_occlusion_query")) + CLog::Log(LOGWARNING, "CRenderCaptureGL: GL_ARB_occlusion_query not supported, performance might suffer"); + if (!g_Windowing.IsExtSupported("GL_ARB_occlusion_query")) + CLog::Log(LOGWARNING, "CRenderCaptureGL: GL_ARB_pixel_buffer_object not supported, performance might suffer"); + } +#endif + m_asyncChecked = true; + } + +#ifndef HAS_GLES + if (m_asyncSupported) + { + if (!m_pbo) + glGenBuffersARB(1, &m_pbo); + + if (!m_query) + glGenQueriesARB(1, &m_query); + + //start the occlusion query + glBeginQueryARB(GL_SAMPLES_PASSED_ARB, m_query); + + //allocate data on the pbo and pixel buffer + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, m_pbo); + if (m_bufferSize != m_width * m_height * 4) + { + m_bufferSize = m_width * m_height * 4; + glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, m_bufferSize, 0, GL_STREAM_READ_ARB); + delete[] m_pixels; + m_pixels = new uint8_t[m_bufferSize]; + } + } + else +#endif + { + if (m_bufferSize != m_width * m_height * 4) + { + delete[] m_pixels; + m_bufferSize = m_width * m_height * 4; + m_pixels = new uint8_t[m_bufferSize]; + } + } +} + +void CRenderCaptureGL::EndRender() +{ +#ifndef HAS_GLES + if (m_asyncSupported) + { + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); + glEndQueryARB(GL_SAMPLES_PASSED_ARB); + + if (m_flags & CAPTUREFLAG_IMMEDIATELY) + PboToBuffer(); + else + SetState(CAPTURESTATE_NEEDSREADOUT); + } + else +#endif + { + SetState(CAPTURESTATE_DONE); + } +} + +void* CRenderCaptureGL::GetRenderBuffer() +{ +#ifndef HAS_GLES + if (m_asyncSupported) + { + return NULL; //offset into the pbo + } + else +#endif + { + return m_pixels; + } +} + +void CRenderCaptureGL::ReadOut() +{ +#ifndef HAS_GLES + if (m_asyncSupported) + { + //we don't care about the occlusion query, we just want to know if the result is available + //when it is, the write into the pbo is probably done as well, + //so it can be mapped and read without a busy wait + + GLuint readout; + glGetQueryObjectuivARB(m_query, GL_QUERY_RESULT_AVAILABLE_ARB, &readout); + if (readout) + PboToBuffer(); + } +#endif +} + +void CRenderCaptureGL::PboToBuffer() +{ +#ifndef HAS_GLES + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, m_pbo); + GLvoid* pboPtr = glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY_ARB); + + if (pboPtr) + { + fast_memcpy(m_pixels, pboPtr, m_bufferSize); + SetState(CAPTURESTATE_DONE); + } + else + { + CLog::Log(LOGERROR, "CRenderCaptureGL::PboToBuffer: glMapBufferARB failed"); + SetState(CAPTURESTATE_FAILED); + } + + glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); +#endif +} + +#elif HAS_DX /*HAS_GL*/ + +CRenderCaptureDX::CRenderCaptureDX() +{ + m_renderSurface = NULL; + m_copySurface = NULL; + m_query = NULL; + m_surfaceWidth = 0; + m_surfaceHeight = 0; + + g_Windowing.Register(this); +} + +CRenderCaptureDX::~CRenderCaptureDX() +{ + CleanupDX(); + delete[] m_pixels; + + g_Windowing.Unregister(this); +} + +void CRenderCaptureDX::BeginRender() +{ + LPDIRECT3DDEVICE9 pD3DDevice = g_Windowing.Get3DDevice(); + + if (!m_asyncChecked) + { + //check if occlusion query is supported + m_asyncSupported = pD3DDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, NULL) == D3D_OK; + if (!m_asyncSupported && (m_flags & CAPTUREFLAG_CONTINUOUS)) + CLog::Log(LOGWARNING, "CRenderCaptureDX: D3DQUERYTYPE_OCCLUSION not supported, performance might suffer"); + + m_asyncChecked = true; + } + + HRESULT result; + + if (m_surfaceWidth != m_width || m_surfaceHeight != m_height) + { + if (m_renderSurface) + { + while(m_renderSurface->Release() > 0); + m_renderSurface = NULL; + } + + if (m_copySurface) + { + while (m_copySurface->Release() > 0); + m_copySurface = NULL; + } + + result = pD3DDevice->CreateRenderTarget(m_width, m_height, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, TRUE, &m_renderSurface, NULL); + if (result != D3D_OK) + { + CLog::Log(LOGERROR, "CRenderCaptureDX::BeginRender: CreateRenderTarget failed %s", + g_Windowing.GetErrorDescription(result).c_str()); + SetState(CAPTURESTATE_FAILED); + return; + } + + result = pD3DDevice->CreateOffscreenPlainSurface(m_width, m_height, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &m_copySurface, NULL); + if (result != D3D_OK) + { + CLog::Log(LOGERROR, "CRenderCaptureDX::BeginRender: CreateOffscreenPlainSurface failed %s", + g_Windowing.GetErrorDescription(result).c_str()); + SetState(CAPTURESTATE_FAILED); + return; + } + + m_surfaceWidth = m_width; + m_surfaceHeight = m_height; + } + + if (m_bufferSize != m_width * m_height * 4) + { + m_bufferSize = m_width * m_height * 4; + delete[] m_pixels; + m_pixels = new uint8_t[m_bufferSize]; + } + + result = pD3DDevice->SetRenderTarget(0, m_renderSurface); + if (result != D3D_OK) + { + CLog::Log(LOGERROR, "CRenderCaptureDX::BeginRender: SetRenderTarget failed %s", + g_Windowing.GetErrorDescription(result).c_str()); + SetState(CAPTURESTATE_FAILED); + return; + } + + if (m_asyncSupported && !m_query) + { + result = pD3DDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, &m_query); + if (result != D3D_OK) + { + CLog::Log(LOGERROR, "CRenderCaptureDX::BeginRender: CreateQuery failed %s", + g_Windowing.GetErrorDescription(result).c_str()); + m_asyncSupported = false; + } + } + + if (m_asyncSupported) + m_query->Issue(D3DISSUE_BEGIN); +} + +void CRenderCaptureDX::EndRender() +{ + LPDIRECT3DDEVICE9 pD3DDevice = g_Windowing.Get3DDevice(); + //GetRenderTargetData should be async on most drivers, + //so the render thread doesn't have to wait for the gpu to copy the data to m_copySurface + pD3DDevice->GetRenderTargetData(m_renderSurface, m_copySurface); + + if (m_asyncSupported) + { + m_query->Issue(D3DISSUE_END); + m_query->GetData(NULL, 0, D3DGETDATA_FLUSH); //flush the query request + } + + if (m_flags & CAPTUREFLAG_IMMEDIATELY) + SurfaceToBuffer(); + else + SetState(CAPTURESTATE_NEEDSREADOUT); +} + +void CRenderCaptureDX::ReadOut() +{ + if (m_asyncSupported) + { + //if the result of the occlusion query is available, the data is probably also written into m_copySurface + HRESULT result = m_query->GetData(NULL, 0, D3DGETDATA_FLUSH); + if (result == S_OK) + { + SurfaceToBuffer(); + } + else if (result != S_FALSE) + { + CLog::Log(LOGERROR, "CRenderCaptureDX::ReadOut: GetData failed"); + SurfaceToBuffer(); + } + } + else + { + SurfaceToBuffer(); + } +} + +void CRenderCaptureDX::SurfaceToBuffer() +{ + D3DLOCKED_RECT lockedRect; + if (m_copySurface->LockRect(&lockedRect, NULL, D3DLOCK_READONLY) == D3D_OK) + { + //if pitch is same, do a direct copy, otherwise copy one line at a time + if (lockedRect.Pitch == m_width * 4) + { + fast_memcpy(m_pixels, lockedRect.pBits, m_width * m_height * 4); + } + else + { + for (unsigned int y = 0; y < m_height; y++) + fast_memcpy(m_pixels + y * m_width * 4, (uint8_t*)lockedRect.pBits + y * lockedRect.Pitch, m_width * 4); + } + m_copySurface->UnlockRect(); + SetState(CAPTURESTATE_DONE); + } + else + { + CLog::Log(LOGERROR, "CRenderCaptureDX::SurfaceToBuffer: locking m_copySurface failed"); + SetState(CAPTURESTATE_FAILED); + } +} + +void CRenderCaptureDX::OnLostDevice() +{ + CleanupDX(); + SetState(CAPTURESTATE_FAILED); +} + +void CRenderCaptureDX::OnDestroyDevice() +{ + CleanupDX(); + SetState(CAPTURESTATE_FAILED); +} + +void CRenderCaptureDX::CleanupDX() +{ + if (m_renderSurface) + { + while (m_renderSurface->Release() > 0); + m_renderSurface = NULL; + } + + if (m_copySurface) + { + while (m_copySurface->Release() > 0); + m_copySurface = NULL; + } + + if (m_asyncSupported && m_query) + { + while (m_query->Release() > 0); + m_query = NULL; + } + + m_surfaceWidth = 0; + m_surfaceHeight = 0; +} + +#endif /*HAS_DX*/ diff --git a/xbmc/cores/VideoRenderers/RenderCapture.h b/xbmc/cores/VideoRenderers/RenderCapture.h new file mode 100644 index 00000000..fd39e212 --- /dev/null +++ b/xbmc/cores/VideoRenderers/RenderCapture.h @@ -0,0 +1,233 @@ +/*! +\file RenderCapture.h +\brief +*/ + +#pragma once + +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +/* +\brief usage: + +//capture from the renderer from CApplication thread: +CRenderCapture* capture = g_renderManager.AllocRenderCapture(); +//don't forget the CAPTUREFLAG_IMMEDIATELY flag +g_renderManager.Capture(capture, width, height, CAPTUREFLAG_IMMEDIATELY); +if (capture->GetUserState() == CAPTURESTATE_DONE) + //do something with capture->GetPixels(); +g_renderManager.ReleaseRenderCapture(capture); + +//schedule a capture from CApplication thread: +m_capture = g_renderManager.AllocRenderCapture(); +g_renderManager.Capture(m_capture, width, height, 0); +//capture will be done after a couple calls to CApplication::Render() +if (m_capture->GetUserState() != CAPTURESTATE_WORKING) +{ + if (m_capture->GetUserState() == CAPTURESTATE_DONE) + //do something with m_capture->GetPixels(); + g_renderManager.ReleaseRenderCapture(m_capture); +} + +//capture from another thread: +CRenderCapture* capture = g_renderManager.AllocRenderCapture(); +//you can set the CAPTUREFLAG_IMMEDIATELY flag to get the capture a little faster, at the cost of a busy wait +g_renderManager.Capture(capture, width, height, 0); +capture->GetEvent().Wait(); +if (capture->GetUserState() == CAPTURESTATE_DONE) + //do something with capture->GetPixels(); +g_renderManager.ReleaseRenderCapture(capture); + +//continuous capture from another thread: +CRenderCapture* capture = g_renderManager.AllocRenderCapture(); +//if you set CAPTUREFLAG_IMMEDIATELY here, you'll get the captures faster, +//but CApplication thread will do a lot of busy waiting +g_renderManager.Capture(capture, width, height, CAPTUREFLAG_CONTINUOUS); +while (!m_bStop) +{ + capture->GetEvent().Wait(); + if (capture->GetUserState() == CAPTURESTATE_DONE) + //do something with capture->GetPixels(); +} +g_renderManager.ReleaseRenderCapture(capture); + +if you want to make several captures in a row, you can reuse the same CRenderCapture +even if they're a different size + +*/ + +#include "system.h" //HAS_DX, HAS_GL, HAS_GLES, opengl headers, direct3d headers + +#ifdef HAS_DX + #include "D3DResource.h" +#endif + +#include "utils/Event.h" + +enum ECAPTURESTATE +{ + CAPTURESTATE_WORKING, + CAPTURESTATE_NEEDSRENDER, + CAPTURESTATE_NEEDSREADOUT, + CAPTURESTATE_DONE, + CAPTURESTATE_FAILED, + CAPTURESTATE_NEEDSDELETE +}; + +#define CAPTUREFLAG_CONTINUOUS 0x01 //after a render is done, render a new one immediately +#define CAPTUREFLAG_IMMEDIATELY 0x02 //read out immediately after render, this can cause a busy wait + +class CRenderCaptureBase +{ + public: + CRenderCaptureBase(); + ~CRenderCaptureBase(); + + /* \brief Called by the rendermanager to set the state, should not be called by anything else */ + void SetState(ECAPTURESTATE state) { m_state = state; } + + /* \brief Called by the rendermanager to get the state, should not be called by anything else */ + ECAPTURESTATE GetState() { return m_state; } + + /* \brief Called by the rendermanager to set the userstate, should not be called by anything else */ + void SetUserState(ECAPTURESTATE state) { m_userState = state; } + + /* \brief Called by the code requesting the capture + \return CAPTURESTATE_WORKING when the capture is in progress, + CAPTURESTATE_DONE when the capture has succeeded, + CAPTURESTATE_FAILED when the capture has failed + */ + ECAPTURESTATE GetUserState() { return m_userState; } + + /* \brief The internal event will be set when the rendermanager has captured and read a videoframe, or when it has failed + \return A reference to m_event + */ + CEvent& GetEvent() { return m_event; } + + /* \brief Called by the rendermanager to set the flags, should not be called by anything else */ + void SetFlags(int flags) { m_flags = flags; } + + /* \brief Called by the rendermanager to get the flags, should not be called by anything else */ + int GetFlags() { return m_flags; } + + /* \brief Called by the rendermanager to set the width, should not be called by anything else */ + void SetWidth(unsigned int width) { m_width = width; } + + /* \brief Called by the rendermanager to set the height, should not be called by anything else */ + void SetHeight(unsigned int height) { m_height = height; } + + /* \brief Called by the code requesting the capture to get the width */ + unsigned int GetWidth() { return m_width; } + + /* \brief Called by the code requesting the capture to get the height */ + unsigned int GetHeight() { return m_height; } + + /* \brief Called by the code requesting the capture to get the buffer where the videoframe is stored, + the format is BGRA for GL and DX, and RGBA for GLES, this buffer is only valid when GetUserState returns CAPTURESTATE_DONE. + The size of the buffer is GetWidth() * GetHeight() * 4. + */ + uint8_t* GetPixels() { return m_pixels; } + + /* \brief Called by the rendermanager to know if the capture is readout async (using dma for example), + should not be called by anything else. + */ + bool IsAsync() { return m_asyncSupported; } + + protected: + ECAPTURESTATE m_state; //state for the rendermanager + ECAPTURESTATE m_userState; //state for the thread that wants the capture + int m_flags; + CEvent m_event; + + uint8_t* m_pixels; + unsigned int m_width; + unsigned int m_height; + unsigned int m_bufferSize; + + //this is set after the first render + bool m_asyncSupported; + bool m_asyncChecked; +}; + +#if defined(HAS_GL2) || defined(HAS_GLES) + +class CRenderCaptureGL : public CRenderCaptureBase +{ + public: + CRenderCaptureGL(); + ~CRenderCaptureGL(); + + void BeginRender(); + void EndRender(); + void ReadOut(); + + void* GetRenderBuffer(); + + private: + void PboToBuffer(); + GLuint m_pbo; + GLuint m_query; +}; + +//used instead of typedef CRenderCaptureGL CRenderCapture +//since C++ doesn't allow you to forward declare a typedef +class CRenderCapture : public CRenderCaptureGL +{ + public: + CRenderCapture() {}; +}; + +#elif HAS_DX /*HAS_GL*/ + +class CRenderCaptureDX : public CRenderCaptureBase, public ID3DResource +{ + public: + CRenderCaptureDX(); + ~CRenderCaptureDX(); + + void BeginRender(); + void EndRender(); + void ReadOut(); + + virtual void OnDestroyDevice(); + virtual void OnLostDevice(); + virtual void OnCreateDevice() {}; + + private: + void SurfaceToBuffer(); + void CleanupDX(); + + LPDIRECT3DSURFACE9 m_renderSurface; + LPDIRECT3DSURFACE9 m_copySurface; + LPDIRECT3DQUERY9 m_query; + + unsigned int m_surfaceWidth; + unsigned int m_surfaceHeight; +}; + +class CRenderCapture : public CRenderCaptureDX +{ + public: + CRenderCapture() {}; +}; + +#endif diff --git a/xbmc/cores/VideoRenderers/VideoRenderers.pro b/xbmc/cores/VideoRenderers/VideoRenderers.pro new file mode 100644 index 00000000..11b7dfa7 --- /dev/null +++ b/xbmc/cores/VideoRenderers/VideoRenderers.pro @@ -0,0 +1,38 @@ +include(../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . .. ../../ ../../../ ../../linux ../../../guilib ../../utils ../dvdplayer/Codecs ../dvdplayer/Codecs/ffmpeg +DEFINES += __STDC_CONSTANT_MACROS +SOURCES += \ +OverlayRenderer.cpp \ + \ +BaseRenderer.cpp \ +LinuxRenderer.cpp \ +OverlayRendererGL.cpp \ +IntelSMDRenderer.cpp \ +LinuxRendererOMX.cpp \ +RenderManager.cpp \ +OverlayRendererUtil.cpp \ +LinuxRendererGL.cpp \ + + +HEADERS += \ +OverlayRenderer.h \ + \ +BaseRenderer.h \ +LinuxRenderer.h \ +OverlayRendererGL.h \ +IntelSMDRenderer.h \ +LinuxRendererOMX.h \ +RenderManager.h \ +OverlayRendererUtil.h \ +LinuxRendererGL.h \ + + +INCLUDEPATH += ../../../ diff --git a/xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.cpp b/xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.cpp new file mode 100644 index 00000000..af712a58 --- /dev/null +++ b/xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.cpp @@ -0,0 +1,236 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +#ifdef _WIN32 + #define _USE_MATH_DEFINES +#endif + +#include "ConvolutionKernels.h" +#include "MathUtils.h" + +#ifndef M_PI + #define M_PI 3.14159265358979323846 +#endif + +#define SINC(x) (sin(M_PI * (x)) / (M_PI * (x))) + +CConvolutionKernel::CConvolutionKernel(ESCALINGMETHOD method, int size) +{ + m_size = size; + m_floatpixels = new float[m_size * 4]; + + if (method == VS_SCALINGMETHOD_LANCZOS2) + Lanczos2(); + else if (method == VS_SCALINGMETHOD_LANCZOS3_FAST) + Lanczos3Fast(); + else if (method == VS_SCALINGMETHOD_LANCZOS3) + Lanczos3(); + else if (method == VS_SCALINGMETHOD_CUBIC) + Bicubic(1.0 / 3.0, 1.0 / 3.0); + + ToIntFract(); + ToUint8(); +} + +CConvolutionKernel::~CConvolutionKernel() +{ + delete [] m_floatpixels; + delete [] m_intfractpixels; + delete [] m_uint8pixels; +} + +//generate a lanczos2 kernel which can be loaded with RGBA format +//each value of RGBA has one tap, so a shader can load 4 taps with a single pixel lookup +void CConvolutionKernel::Lanczos2() +{ + for (int i = 0; i < m_size; i++) + { + double x = (double)i / (double)m_size; + + //generate taps + for (int j = 0; j < 4; j++) + m_floatpixels[i * 4 + j] = (float)LanczosWeight(x + (double)(j - 2), 2.0); + + //any collection of 4 taps added together needs to be exactly 1.0 + //for lanczos this is not always the case, so we take each collection of 4 taps + //and divide those taps by the sum of the taps + float weight = 0.0; + for (int j = 0; j < 4; j++) + weight += m_floatpixels[i * 4 + j]; + + for (int j = 0; j < 4; j++) + m_floatpixels[i * 4 + j] /= weight; + } +} + +//generate a lanczos3 kernel which can be loaded with RGBA format +//each value of RGBA has one tap, so a shader can load 4 taps with a single pixel lookup +//the two outer lobes of the lanczos3 kernel are added to the two lobes one step to the middle +//this basically looks the same as lanczos3, but the kernel only has 4 taps, +//so it can use the 4x4 convolution shader which is twice as fast as the 6x6 one +void CConvolutionKernel::Lanczos3Fast() +{ + for (int i = 0; i < m_size; i++) + { + double a = 3.0; + double x = (double)i / (double)m_size; + + //generate taps + m_floatpixels[i * 4 + 0] = (float)(LanczosWeight(x - 2.0, a) + LanczosWeight(x - 3.0, a)); + m_floatpixels[i * 4 + 1] = (float) LanczosWeight(x - 1.0, a); + m_floatpixels[i * 4 + 2] = (float) LanczosWeight(x , a); + m_floatpixels[i * 4 + 3] = (float)(LanczosWeight(x + 1.0, a) + LanczosWeight(x + 2.0, a)); + + //any collection of 4 taps added together needs to be exactly 1.0 + //for lanczos this is not always the case, so we take each collection of 4 taps + //and divide those taps by the sum of the taps + float weight = 0.0; + for (int j = 0; j < 4; j++) + weight += m_floatpixels[i * 4 + j]; + + for (int j = 0; j < 4; j++) + m_floatpixels[i * 4 + j] /= weight; + } +} + +//generate a lanczos3 kernel which can be loaded with RGBA format +//each value of RGB has one tap, so a shader can load 3 taps with a single pixel lookup +void CConvolutionKernel::Lanczos3() +{ + for (int i = 0; i < m_size; i++) + { + double x = (double)i / (double)m_size; + + //generate taps + for (int j = 0; j < 3; j++) + m_floatpixels[i * 4 + j] = (float)LanczosWeight(x * 2.0 + (double)(j * 2 - 3), 3.0); + + m_floatpixels[i * 4 + 3] = 0.0; + } + + //any collection of 6 taps added together needs to be exactly 1.0 + //for lanczos this is not always the case, so we take each collection of 6 taps + //and divide those taps by the sum of the taps + for (int i = 0; i < m_size / 2; i++) + { + float weight = 0.0; + for (int j = 0; j < 3; j++) + { + weight += m_floatpixels[i * 4 + j]; + weight += m_floatpixels[(i + m_size / 2) * 4 + j]; + } + for (int j = 0; j < 3; j++) + { + m_floatpixels[i * 4 + j] /= weight; + m_floatpixels[(i + m_size / 2) * 4 + j] /= weight; + } + } +} + +//generate a bicubic kernel which can be loaded with RGBA format +//each value of RGBA has one tap, so a shader can load 4 taps with a single pixel lookup +void CConvolutionKernel::Bicubic(double B, double C) +{ + for (int i = 0; i < m_size; i++) + { + double x = (double)i / (double)m_size; + + //generate taps + for (int j = 0; j < 4; j++) + m_floatpixels[i * 4 + j] = (float)BicubicWeight(x + (double)(j - 2), B, C); + } +} + +double CConvolutionKernel::LanczosWeight(double x, double radius) +{ + double ax = fabs(x); + + if (ax == 0.0) + return 1.0; + else if (ax < radius) + return SINC(ax) * SINC(ax / radius); + else + return 0.0; +} + +double CConvolutionKernel::BicubicWeight(double x, double B, double C) +{ + double ax = fabs(x); + + if (ax<1.0) + { + return ((12 - 9*B - 6*C) * ax * ax * ax + + (-18 + 12*B + 6*C) * ax * ax + + (6 - 2*B))/6; + } + else if (ax<2.0) + { + return ((-B - 6*C) * ax * ax * ax + + (6*B + 30*C) * ax * ax + (-12*B - 48*C) * + ax + (8*B + 24*C)) / 6; + } + else + { + return 0.0; + } +} + + +//convert float to high byte/low byte, so the kernel can be loaded into an 8 bit texture +//with height 2 and converted back to real float in the shader +//it only works when the kernel texture uses nearest neighbour, but there's almost no difference +//between that and linear interpolation +void CConvolutionKernel::ToIntFract() +{ + m_intfractpixels = new uint8_t[m_size * 8]; + + for (int i = 0; i < m_size * 4; i++) + { + int value = MathUtils::round_int((m_floatpixels[i] + 1.0) / 2.0 * 65535.0); + if (value < 0) + value = 0; + else if (value > 65535) + value = 65535; + + int integer = value / 256; + int fract = value % 256; + + m_intfractpixels[i] = (uint8_t)integer; + m_intfractpixels[i + m_size * 4] = (uint8_t)fract; + } +} + +//convert to 8 bits unsigned +void CConvolutionKernel::ToUint8() +{ + m_uint8pixels = new uint8_t[m_size * 4]; + + for (int i = 0; i < m_size * 4; i++) + { + int value = MathUtils::round_int((m_floatpixels[i] * 0.5 + 0.5) * 255.0); + if (value < 0) + value = 0; + else if (value > 255) + value = 255; + + m_uint8pixels[i] = (uint8_t)value; + } +} + diff --git a/xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.h b/xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.h new file mode 100644 index 00000000..dd32dd68 --- /dev/null +++ b/xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.h @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#ifndef CONVOLUTIONKERNELS +#define CONVOLUTIONKERNELS + +#include "system.h" +#include "../../../settings/VideoSettings.h" + +class CConvolutionKernel +{ + public: + CConvolutionKernel(ESCALINGMETHOD method, int size); + ~CConvolutionKernel(); + + int GetSize() { return m_size; } + float* GetFloatPixels() { return m_floatpixels; } + uint8_t* GetIntFractPixels() { return m_intfractpixels; } + uint8_t* GetUint8Pixels() { return m_uint8pixels; } + + private: + + void Lanczos2(); + void Lanczos3Fast(); + void Lanczos3(); + void Bicubic(double B, double C); + + double LanczosWeight(double x, double radius); + double BicubicWeight(double x, double B, double C); + + void ToIntFract(); + void ToUint8(); + + int m_size; + float* m_floatpixels; + uint8_t* m_intfractpixels; + uint8_t* m_uint8pixels; +}; + +#endif //CONVOLUTIONKERNELS diff --git a/xbmc/cores/VideoRenderers/VideoShaders/VideoShaders.pro b/xbmc/cores/VideoRenderers/VideoShaders/VideoShaders.pro new file mode 100644 index 00000000..aa0ad4f5 --- /dev/null +++ b/xbmc/cores/VideoRenderers/VideoShaders/VideoShaders.pro @@ -0,0 +1,21 @@ +include(../../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . .. ../../ ../../../ ../../../linux ../../../../guilib ../../dvdplayer/Codecs ../../dvdplayer/Codecs/ffmpeg +SOURCES += \ +VideoFilterShader.cpp \ +YUV2RGBShader.cpp \ + + +HEADERS += \ +VideoFilterShader.h \ +YUV2RGBShader.h \ + + +INCLUDEPATH += ../../../../ diff --git a/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp b/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp new file mode 100644 index 00000000..ff31b7ad --- /dev/null +++ b/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp @@ -0,0 +1,599 @@ +/* + * Copyright (C) 2007-2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#ifdef HAS_DX + +#include "WinVideoFilter.h" +#include "WindowingFactory.h" +#include "../../../utils/log.h" +#include "../../../FileSystem/File.h" +#include +#include "ConvolutionKernels.h" +#include "YUV2RGBShader.h" + + +CYUV2RGBMatrix::CYUV2RGBMatrix() +{ + m_NeedRecalc = true; +} + +void CYUV2RGBMatrix::SetParameters(float contrast, float blacklevel, unsigned int flags) +{ + if (m_contrast != contrast) + { + m_NeedRecalc = true; + m_contrast = contrast; + } + if (m_blacklevel != blacklevel) + { + m_NeedRecalc = true; + m_blacklevel = blacklevel; + } + if (m_flags != flags) + { + m_NeedRecalc = true; + m_flags = flags; + } +} + +D3DXMATRIX* CYUV2RGBMatrix::Matrix() +{ + if (m_NeedRecalc) + { + TransformMatrix matrix; + CalculateYUVMatrix(matrix, m_flags, m_blacklevel, m_contrast); + + m_mat._11 = matrix.m[0][0]; + m_mat._12 = matrix.m[1][0]; + m_mat._13 = matrix.m[2][0]; + m_mat._14 = 0.0f; + m_mat._21 = matrix.m[0][1]; + m_mat._22 = matrix.m[1][1]; + m_mat._23 = matrix.m[2][1]; + m_mat._24 = 0.0f; + m_mat._31 = matrix.m[0][2]; + m_mat._32 = matrix.m[1][2]; + m_mat._33 = matrix.m[2][2]; + m_mat._44 = 0.0f; + m_mat._41 = matrix.m[0][3]; + m_mat._42 = matrix.m[1][3]; + m_mat._43 = matrix.m[2][3]; + m_mat._44 = 1.0f; + + m_NeedRecalc = false; + } + return &m_mat; +} + +//=================================================================== + +void CWinShader::Release() +{ + ReleaseInternal(); // virtual, so calls the child function, which is supposed to call down the hierarchy + delete this; +} + +bool CWinShader::CreateVertexBuffer(DWORD FVF, unsigned int vertCount, unsigned int vertSize, unsigned int primitivesCount) +{ + if (!m_vb.Create(vertCount * vertSize, D3DUSAGE_WRITEONLY, FVF, g_Windowing.DefaultD3DPool())) + return false; + m_vbsize = vertCount * vertSize; + m_FVF = FVF; + m_vertsize = vertSize; + m_primitivesCount = primitivesCount; + return true; +} + +bool CWinShader::LockVertexBuffer(void **data) +{ + if (!m_vb.Lock(0, m_vbsize, data, 0)) + { + CLog::Log(LOGERROR, __FUNCTION__" - failed to lock vertex buffer"); + return false; + } + return true; +} + +bool CWinShader::UnlockVertexBuffer() +{ + if (!m_vb.Unlock()) + { + CLog::Log(LOGERROR, __FUNCTION__" - failed to unlock vertex buffer"); + return false; + } + return true; +} + +void CWinShader::ReleaseInternal() +{ + if (m_effect.Get()) + m_effect.Release(); + + if (m_vb.Get()) + m_vb.Release(); + + //derived classes: always call Base::ReleaseInternal() at the end +} + +bool CWinShader::LoadEffect(CStdString filename, DefinesMap* defines) +{ + CLog::Log(LOGDEBUG, __FUNCTION__" - loading shader %s", filename.c_str()); + + XFILE::CFileStream file; + if(!file.Open(filename)) + { + CLog::Log(LOGERROR, __FUNCTION__" - failed to open file %s", filename.c_str()); + return false; + } + + CStdString pStrEffect; + getline(file, pStrEffect, '\0'); + + if (!m_effect.Create(pStrEffect, defines)) + { + CLog::Log(LOGERROR, __FUNCTION__" %s failed", pStrEffect.c_str()); + return false; + } + + return true; +} + +bool CWinShader::Execute() +{ + LPDIRECT3DDEVICE9 pD3DDevice = g_Windowing.Get3DDevice(); + + pD3DDevice->SetFVF(m_FVF); + pD3DDevice->SetStreamSource(0, m_vb.Get(), 0, m_vertsize); + + UINT cPasses, iPass; + if (!m_effect.Begin( &cPasses, 0 )) + { + CLog::Log(LOGERROR, __FUNCTION__" - failed to begin d3d effect"); + return false; + } + + for( iPass = 0; iPass < cPasses; iPass++ ) + { + if (!m_effect.BeginPass( iPass )) + { + CLog::Log(LOGERROR, __FUNCTION__" - failed to begin d3d effect pass"); + break; + } + HRESULT hr = pD3DDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, 0, m_primitivesCount); + if (FAILED(hr)) + CLog::Log(LOGERROR, __FUNCTION__" - failed DrawPrimitive %08X", hr); + + if (!m_effect.EndPass()) + CLog::Log(LOGERROR, __FUNCTION__" - failed to end d3d effect pass"); + } + if (!m_effect.End()) + CLog::Log(LOGERROR, __FUNCTION__" - failed to end d3d effect"); + + return true; +} + +//================================================================================== + +bool CYUV2RGBShader::Create(unsigned int sourceWidth, unsigned int sourceHeight, BufferFormat fmt) +{ + ReleaseInternal(); + + CWinShader::CreateVertexBuffer(D3DFVF_XYZRHW | D3DFVF_TEX3, 4, sizeof(CUSTOMVERTEX), 2); + + m_sourceWidth = sourceWidth; + m_sourceHeight = sourceHeight; + + unsigned int texWidth; + + DefinesMap defines; + + if (fmt == YV12) + { + defines["XBMC_YV12"] = ""; + texWidth = sourceWidth; + + if(!m_YUVPlanes[0].Create(texWidth , m_sourceHeight , 1, 0, D3DFMT_L8, D3DPOOL_DEFAULT) + || !m_YUVPlanes[1].Create(texWidth / 2, m_sourceHeight / 2, 1, 0, D3DFMT_L8, D3DPOOL_DEFAULT) + || !m_YUVPlanes[2].Create(texWidth / 2, m_sourceHeight / 2, 1, 0, D3DFMT_L8, D3DPOOL_DEFAULT)) + { + CLog::Log(LOGERROR, __FUNCTION__": Failed to create YV12 planes."); + return false; + } + } + else if (fmt == NV12) + { + defines["XBMC_NV12"] = ""; + texWidth = sourceWidth; + + if(!m_YUVPlanes[0].Create(texWidth , m_sourceHeight , 1, 0, D3DFMT_L8, D3DPOOL_DEFAULT) + || !m_YUVPlanes[1].Create(texWidth / 2, m_sourceHeight / 2, 1, 0, D3DFMT_A8L8, D3DPOOL_DEFAULT)) + { + CLog::Log(LOGERROR, __FUNCTION__": Failed to create NV12 planes."); + return false; + } + } + else if (fmt == YUY2) + { + defines["XBMC_YUY2"] = ""; + texWidth = sourceWidth >> 1; + + if(!m_YUVPlanes[0].Create(texWidth , m_sourceHeight , 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT)) + { + CLog::Log(LOGERROR, __FUNCTION__": Failed to create YUY2 planes."); + return false; + } + } + else if (fmt == UYVY) + { + defines["XBMC_UYVY"] = ""; + texWidth = sourceWidth >> 1; + + if(!m_YUVPlanes[0].Create(texWidth , m_sourceHeight , 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT)) + { + CLog::Log(LOGERROR, __FUNCTION__": Failed to create UYVY planes."); + return false; + } + } + else + return false; + + m_texSteps[0] = 1.0f/(float)texWidth; + m_texSteps[1] = 1.0f/(float)sourceHeight; + + CStdString effectString = "special://xbmc/system/shaders/yuv2rgb_d3d.fx"; + + if(!LoadEffect(effectString, &defines)) + { + CLog::Log(LOGERROR, __FUNCTION__": Failed to load shader %s.", effectString.c_str()); + return false; + } + + return true; +} + +void CYUV2RGBShader::Render(CRect sourceRect, CRect destRect, + float contrast, + float brightness, + unsigned int flags, + YUVBuffer* YUVbuf) +{ + PrepareParameters(sourceRect, destRect, + contrast, brightness, flags); + UploadToGPU(YUVbuf); + SetShaderParameters(YUVbuf); + Execute(); +} + +void CYUV2RGBShader::PrepareParameters(CRect sourceRect, + CRect destRect, + float contrast, + float brightness, + unsigned int flags) +{ + //See RGB renderer for comment on this + #define CHROMAOFFSET_HORIZ 0.25f + + if (m_sourceRect != sourceRect || m_destRect != destRect) + { + m_sourceRect = sourceRect; + m_destRect = destRect; + + CUSTOMVERTEX* v; + CWinShader::LockVertexBuffer((void**)&v); + + v[0].x = destRect.x1; + v[0].y = destRect.y1; + v[0].tu = sourceRect.x1 / m_sourceWidth; + v[0].tv = sourceRect.y1 / m_sourceHeight; + v[0].tu2 = v[0].tu3 = (sourceRect.x1 / 2.0f + CHROMAOFFSET_HORIZ) / (m_sourceWidth>>1); + v[0].tv2 = v[0].tv3 = (sourceRect.y1 / 2.0f + CHROMAOFFSET_HORIZ) / (m_sourceHeight>>1); + + v[1].x = destRect.x2; + v[1].y = destRect.y1; + v[1].tu = sourceRect.x2 / m_sourceWidth; + v[1].tv = sourceRect.y1 / m_sourceHeight; + v[1].tu2 = v[1].tu3 = (sourceRect.x2 / 2.0f + CHROMAOFFSET_HORIZ) / (m_sourceWidth>>1); + v[1].tv2 = v[1].tv3 = (sourceRect.y1 / 2.0f + CHROMAOFFSET_HORIZ) / (m_sourceHeight>>1); + + v[2].x = destRect.x2; + v[2].y = destRect.y2; + v[2].tu = sourceRect.x2 / m_sourceWidth; + v[2].tv = sourceRect.y2 / m_sourceHeight; + v[2].tu2 = v[2].tu3 = (sourceRect.x2 / 2.0f + CHROMAOFFSET_HORIZ) / (m_sourceWidth>>1); + v[2].tv2 = v[2].tv3 = (sourceRect.y2 / 2.0f + CHROMAOFFSET_HORIZ) / (m_sourceHeight>>1); + + v[3].x = destRect.x1; + v[3].y = destRect.y2; + v[3].tu = sourceRect.x1 / m_sourceWidth; + v[3].tv = sourceRect.y2 / m_sourceHeight; + v[3].tu2 = v[3].tu3 = (sourceRect.x1 / 2.0f + CHROMAOFFSET_HORIZ) / (m_sourceWidth>>1); + v[3].tv2 = v[3].tv3 = (sourceRect.y2 / 2.0f + CHROMAOFFSET_HORIZ) / (m_sourceHeight>>1); + + // -0.5 offset to compensate for D3D rasterization + // set z and rhw + for(int i = 0; i < 4; i++) + { + v[i].x -= 0.5; + v[i].y -= 0.5; + v[i].z = 0.0f; + v[i].rhw = 1.0f; + } + CWinShader::UnlockVertexBuffer(); + } + + m_matrix.SetParameters(contrast * 0.02f, + brightness * 0.01f - 0.5f, + flags); +} + +void CYUV2RGBShader::SetShaderParameters(YUVBuffer* YUVbuf) +{ + m_effect.SetMatrix("g_ColorMatrix", m_matrix.Matrix()); + m_effect.SetTechnique("YUV2RGB_T"); + m_effect.SetTexture("g_YTexture", m_YUVPlanes[0]); + if (YUVbuf->GetActivePlanes() > 1) + m_effect.SetTexture("g_UTexture", m_YUVPlanes[1]); + if (YUVbuf->GetActivePlanes() > 2) + m_effect.SetTexture("g_VTexture", m_YUVPlanes[2]); + m_effect.SetFloatArray("g_StepXY", m_texSteps, sizeof(m_texSteps)/sizeof(m_texSteps[0])); +} + +void CYUV2RGBShader::ReleaseInternal() +{ + for(unsigned i = 0; i < MAX_PLANES; i++) + { + if (m_YUVPlanes[i].Get()) + m_YUVPlanes[i].Release(); + } +} + +bool CYUV2RGBShader::UploadToGPU(YUVBuffer* YUVbuf) +{ + const POINT point = { 0, 0 }; + + for (unsigned int i = 0; iGetActivePlanes(); i++) + { + const RECT rect = { 0, 0, YUVbuf->planes[i].texture.GetWidth(), YUVbuf->planes[i].texture.GetHeight() }; + IDirect3DSurface9 *src, *dest; + if(FAILED(YUVbuf->planes[i].texture.Get()->GetSurfaceLevel(0, &src))) + CLog::Log(LOGERROR, __FUNCTION__": Failed to retrieve level 0 surface for source YUV plane %d", i); + if (FAILED(m_YUVPlanes[i].Get()->GetSurfaceLevel(0, &dest))) + CLog::Log(LOGERROR, __FUNCTION__": Failed to retrieve level 0 surface for destination YUV plane %d", i); + + if (FAILED(g_Windowing.Get3DDevice()->UpdateSurface(src, &rect, dest, &point))) + { + CLog::Log(LOGERROR, __FUNCTION__": Failed to copy plane %d from sysmem to vidmem.", i); + src->Release(); + dest->Release(); + return false; + } + src->Release(); + dest->Release(); + } + return true; +} + +//================================================================================== + +bool CConvolutionShader::Create(ESCALINGMETHOD method) +{ + ReleaseInternal(); + + CStdString effectString; + switch(method) + { + case VS_SCALINGMETHOD_CUBIC: + case VS_SCALINGMETHOD_LANCZOS2: + case VS_SCALINGMETHOD_LANCZOS3_FAST: + effectString = "special://xbmc/system/shaders/convolution-4x4_d3d.fx"; + break; + case VS_SCALINGMETHOD_LANCZOS3: + effectString = "special://xbmc/system/shaders/convolution-6x6_d3d.fx"; + break; + default: + CLog::Log(LOGERROR, __FUNCTION__": scaling method %d not supported.", method); + return false; + } + + if (!KernelTexFormat()) + { + CLog::Log(LOGERROR, __FUNCTION__": failed to find a compatible texture format for the kernel."); + return false; + } + + CWinShader::CreateVertexBuffer(D3DFVF_XYZRHW | D3DFVF_TEX1, 4, sizeof(CUSTOMVERTEX), 2); + + DefinesMap defines; + if (m_floattex) + defines["HAS_FLOAT_TEXTURE"] = ""; + if (m_rgba) + defines["HAS_RGBA"] = ""; + + if(!LoadEffect(effectString, &defines)) + { + CLog::Log(LOGERROR, __FUNCTION__": Failed to load shader %s.", effectString.c_str()); + return false; + } + + if (!CreateHQKernel(method)) + return false; + + return true; +} + +void CConvolutionShader::Render(CD3DTexture &sourceTexture, + unsigned int sourceWidth, unsigned int sourceHeight, + CRect sourceRect, + CRect destRect) +{ + PrepareParameters(sourceWidth, sourceHeight, sourceRect, destRect); + float texSteps[] = { 1.0f/(float)sourceWidth, 1.0f/(float)sourceHeight}; + SetShaderParameters(sourceTexture, &texSteps[0], sizeof(texSteps)/sizeof(texSteps[0])); + Execute(); +} + +bool CConvolutionShader::KernelTexFormat() +{ + if (g_Windowing.IsTextureFormatOk(D3DFMT_A16B16G16R16F, 0)) + { + m_format = D3DFMT_A16B16G16R16F; + m_floattex = true; + m_rgba = true; + } + else if (g_Windowing.IsTextureFormatOk(D3DFMT_A8B8G8R8, 0)) + { + m_format = D3DFMT_A8B8G8R8; + m_floattex = false; + m_rgba = true; + } + else if (g_Windowing.IsTextureFormatOk(D3DFMT_A8R8G8B8, 0)) + { + m_format = D3DFMT_A8R8G8B8; + m_floattex = false; + m_rgba = false; + } + else + return false; + + return true; +} + +bool CConvolutionShader::CreateHQKernel(ESCALINGMETHOD method) +{ + CConvolutionKernel kern(method, 256); + + if (!m_HQKernelTexture.Create(kern.GetSize(), 1, 1, g_Windowing.DefaultD3DUsage(), m_format, g_Windowing.DefaultD3DPool())) + { + CLog::Log(LOGERROR, __FUNCTION__": Failed to create kernel texture."); + return false; + } + + void *kernelVals; + int kernelValsSize; + + if (m_floattex) + { + float *rawVals = kern.GetFloatPixels(); + D3DXFLOAT16* float16Vals = new D3DXFLOAT16[kern.GetSize()*4]; + + for(int i = 0; i < kern.GetSize()*4; i++) + float16Vals[i] = rawVals[i]; + kernelVals = float16Vals; + kernelValsSize = sizeof(D3DXFLOAT16)*kern.GetSize()*4; + } + else + { + kernelVals = kern.GetUint8Pixels(); + kernelValsSize = sizeof(uint8_t)*kern.GetSize()*4; + } + + D3DLOCKED_RECT lr; + if (!m_HQKernelTexture.LockRect(0, &lr, NULL, D3DLOCK_DISCARD)) + CLog::Log(LOGERROR, __FUNCTION__": Failed to lock kernel texture."); + memcpy(lr.pBits, kernelVals, kernelValsSize); + if (!m_HQKernelTexture.UnlockRect(0)) + CLog::Log(LOGERROR, __FUNCTION__": Failed to unlock kernel texture."); + + if (m_floattex) + delete[] kernelVals; + + return true; +} + +void CConvolutionShader::PrepareParameters(unsigned int sourceWidth, unsigned int sourceHeight, + CRect sourceRect, + CRect destRect) +{ + if(m_sourceWidth != sourceWidth || m_sourceHeight != sourceHeight + || m_sourceRect != sourceRect || m_destRect != destRect) + { + m_sourceWidth = sourceWidth; + m_sourceHeight = sourceHeight; + m_sourceRect = sourceRect; + m_destRect = destRect; + + CUSTOMVERTEX* v; + CWinShader::LockVertexBuffer((void**)&v); + + v[0].x = destRect.x1; + v[0].y = destRect.y1; + v[0].tu = sourceRect.x1 / sourceWidth; + v[0].tv = sourceRect.y1 / sourceHeight; + + v[1].x = destRect.x2; + v[1].y = destRect.y1; + v[1].tu = sourceRect.x2 / sourceWidth; + v[1].tv = sourceRect.y1 / sourceHeight; + + v[2].x = destRect.x2; + v[2].y = destRect.y2; + v[2].tu = sourceRect.x2 / sourceWidth; + v[2].tv = sourceRect.y2 / sourceHeight; + + v[3].x = destRect.x1; + v[3].y = destRect.y2; + v[3].tu = sourceRect.x1 / sourceWidth; + v[3].tv = sourceRect.y2 / sourceHeight; + + // -0.5 offset to compensate for D3D rasterization + // set z and rhw + for(int i = 0; i < 4; i++) + { + v[i].x -= 0.5; + v[i].y -= 0.5; + v[i].z = 0.0f; + v[i].rhw = 1.0f; + } + + CWinShader::UnlockVertexBuffer(); + } +} + +void CConvolutionShader::SetShaderParameters(CD3DTexture &sourceTexture, float* texSteps, int texStepsCount) +{ + m_effect.SetTechnique( "SCALER_T" ); + m_effect.SetTexture( "g_Texture", sourceTexture ) ; + m_effect.SetTexture( "g_KernelTexture", m_HQKernelTexture ); + m_effect.SetFloatArray("g_StepXY", texSteps, texStepsCount); +} + +void CConvolutionShader::ReleaseInternal() +{ + if(m_HQKernelTexture.Get()) + m_HQKernelTexture.Release(); + CWinShader::ReleaseInternal(); +} + +//========================================================== + +bool CTestShader::Create() +{ + CStdString effectString = "special://xbmc/system/shaders/testshader.fx"; + + if(!LoadEffect(effectString, NULL)) + { + CLog::Log(LOGERROR, __FUNCTION__": Failed to load shader %s.", effectString.c_str()); + return false; + } + return true; +} + +#endif diff --git a/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.h b/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.h new file mode 100644 index 00000000..046acba4 --- /dev/null +++ b/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.h @@ -0,0 +1,152 @@ +#pragma once + +/* + * Copyright (C) 2007-2010 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#ifdef HAS_DX + +#include "../../guilib/Geometry.h" +#include "../WinRenderer.h" + +/* +class CBaseVideoFilter +{ +}; +*/ + +class CYUV2RGBMatrix +{ +public: + CYUV2RGBMatrix(); + void SetParameters(float contrast, float blacklevel, unsigned int flags); + D3DXMATRIX* Matrix(); + +private: + bool m_NeedRecalc; + float m_contrast; + float m_blacklevel; + unsigned int m_flags; + D3DXMATRIX m_mat; +}; + +class CWinShader +{ +protected: + CWinShader() {} + +public: + void Release(); // for user code only, like the SAFE_RELEASE() construct + +protected: + virtual bool CreateVertexBuffer(DWORD FVF, unsigned int vertCount, unsigned int vertSize, unsigned int primitivesCount); + virtual bool LockVertexBuffer(void **data); + virtual bool UnlockVertexBuffer(); + virtual void ReleaseInternal(); + virtual bool LoadEffect(CStdString filename, DefinesMap* defines); + virtual bool Execute(); + + CD3DEffect m_effect; + +private: + CD3DVertexBuffer m_vb; + unsigned int m_vbsize; + DWORD m_FVF; + unsigned int m_vertsize; + unsigned int m_primitivesCount; +}; + +class CYUV2RGBShader : public CWinShader +{ +public: + virtual bool Create(unsigned int sourceWidth, unsigned int sourceHeight, BufferFormat fmt); + virtual void Render(CRect sourceRect, + CRect destRect, + float contrast, + float brightness, + unsigned int flags, + YUVBuffer* YUVbuf); + +protected: + virtual void PrepareParameters(CRect sourceRect, + CRect destRect, + float contrast, + float brightness, + unsigned int flags); + virtual void SetShaderParameters(YUVBuffer* YUVbuf); + virtual void ReleaseInternal(); + virtual bool UploadToGPU(YUVBuffer* YUVbuf); + +private: + CYUV2RGBMatrix m_matrix; + unsigned int m_sourceWidth, m_sourceHeight; + CRect m_sourceRect, m_destRect; + CD3DTexture m_YUVPlanes[3]; + float m_texSteps[2]; + + struct CUSTOMVERTEX { + FLOAT x, y, z; + FLOAT rhw; + FLOAT tu, tv; // Y Texture coordinates + FLOAT tu2, tv2; // U Texture coordinates + FLOAT tu3, tv3; // V Texture coordinates + }; +}; + +class CConvolutionShader : public CWinShader +{ +public: + virtual bool Create(ESCALINGMETHOD method); + virtual void Render(CD3DTexture &sourceTexture, + unsigned int sourceWidth, unsigned int sourceHeight, + CRect sourceRect, + CRect destRect); + +protected: + virtual bool KernelTexFormat(); + virtual bool CreateHQKernel(ESCALINGMETHOD method); + virtual void PrepareParameters(unsigned int sourceWidth, unsigned int sourceHeight, + CRect sourceRect, + CRect destRect); + virtual void SetShaderParameters(CD3DTexture &sourceTexture, float* texSteps, int texStepsCount); + virtual void ReleaseInternal(); + +private: + CD3DTexture m_HQKernelTexture; + D3DFORMAT m_format; + bool m_floattex; + bool m_rgba; + unsigned int m_sourceWidth, m_sourceHeight; + CRect m_sourceRect, m_destRect; + + struct CUSTOMVERTEX { + FLOAT x, y, z; + FLOAT rhw; + FLOAT tu, tv; + }; +}; + +class CTestShader : public CWinShader +{ +public: + virtual bool Create(); +}; + +#endif diff --git a/xbmc/cores/cores.pro b/xbmc/cores/cores.pro new file mode 100644 index 00000000..8dc56c2c --- /dev/null +++ b/xbmc/cores/cores.pro @@ -0,0 +1,27 @@ +include(../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../ ../.. ffmpeg ../linux ../../guilib ../utils dvdplayer ./flashplayer +SOURCES += \ + \ +IntelSMDGlobals.cpp \ +dlgcache.cpp \ +ssrc.cpp \ +DummyVideoPlayer.cpp \ + + +HEADERS += \ + \ +IntelSMDGlobals.h \ +dlgcache.h \ +ssrc.h \ +DummyVideoPlayer.h \ + + +INCLUDEPATH += ../../ diff --git a/xbmc/cores/dvb/Makefile b/xbmc/cores/dvb/Makefile new file mode 100644 index 00000000..cc16d5a3 --- /dev/null +++ b/xbmc/cores/dvb/Makefile @@ -0,0 +1,8 @@ +INCLUDES=-I. -I.. -I../.. -I../../../ -I../../../.. -I../../utils -I../../linux -I../../../guilib -I../../FileSystem -I../../lib/libdvbpsi/src -I../../lib/libjson/include -I../../lib/sqlite3pp/ -I../../lib/libBoxee + +SRCS=dvbchannel.cpp dvbchannels.cpp dvbtuner.cpp v4lhelper.cpp dvbmanager.cpp dvbepgloader.cpp dvbpatloader.cpp epgstore.cpp epgserverloader.cpp + +LIB=dvb.a + +include ../../../Makefile.include +-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) diff --git a/xbmc/cores/dvb/dvbchannel.cpp b/xbmc/cores/dvb/dvbchannel.cpp new file mode 100644 index 00000000..cb852910 --- /dev/null +++ b/xbmc/cores/dvb/dvbchannel.cpp @@ -0,0 +1,673 @@ +#include "system.h" + +#ifdef HAS_DVB + +#include "Util.h" +#include "dvbchannel.h" + +#include + +struct ChannelFreqTable +{ + int channel; + float minMhz; + float maxMhz; +}; + +static ChannelFreqTable QAM_CHANNELS[] = +{ + { 2, 55.2500, 59.7500 }, + { 3, 61.2500, 65.7500 }, + { 4, 67.2500, 71.7500 }, + { 5, 77.2500, 81.7500 }, + { 6, 83.2500, 87.7500 }, + { 14, 121.2625, 125.7625 }, + { 15, 127.2625, 131.7625 }, + { 16, 133.2625, 137.7625 }, + { 17, 139.2500, 143.7500 }, + { 18, 145.2500, 149.7500 }, + { 19, 151.2500, 155.7500 }, + { 20, 157.2500, 161.7500 }, + { 21, 163.2500, 167.7500 }, + { 22, 169.2500, 173.7500 }, + { 23, 217.2500, 221.7500 }, + { 24, 223.2500, 227.7500 }, + { 25, 229.2625, 233.7625 }, + { 26, 235.2625, 239.7625 }, + { 27, 241.2625, 245.7625 }, + { 28, 247.2625, 251.7625 }, + { 29, 253.2625, 257.7625 }, + { 30, 259.2625, 263.7625 }, + { 31, 265.2625, 269.7625 }, + { 32, 271.2625, 275.7625 }, + { 33, 277.2625, 281.7625 }, + { 34, 283.2625, 287.7625 }, + { 35, 289.2625, 293.7625 }, + { 36, 295.2625, 299.7625 }, + { 37, 301.2625, 305.7625 }, + { 38, 307.2625, 311.7625 }, + { 39, 313.2625, 317.7625 }, + { 40, 319.2625, 323.7625 }, + { 41, 325.2625, 329.7625 }, + { 42, 331.2750, 335.7750 }, + { 43, 337.2625, 341.7625 }, + { 44, 343.2625, 347.7625 }, + { 45, 349.2625, 353.7625 }, + { 46, 355.2625, 359.7625 }, + { 47, 361.2625, 365.7625 }, + { 48, 367.2625, 371.7625 }, + { 49, 373.2625, 377.7625 }, + { 50, 379.2625, 383.7625 }, + { 51, 385.2625, 389.7625 }, + { 52, 391.2625, 395.7625 }, + { 53, 397.2625, 401.7625 }, + { 54, 403.2500, 407.7500 }, + { 55, 409.2500, 413.7500 }, + { 56, 415.2500, 419.7500 }, + { 57, 421.2500, 425.7500 }, + { 58, 427.2500, 431.7500 }, + { 59, 433.2500, 437.7500 }, + { 60, 439.2500, 443.7500 }, + { 61, 445.2500, 449.7500 }, + { 62, 451.2500, 455.7500 }, + { 63, 457.2500, 461.7500 }, + { 64, 463.2500, 467.7500 }, + { 65, 469.2500, 473.7500 }, + { 66, 475.2500, 479.7500 }, + { 67, 481.2500, 485.7500 }, + { 68, 487.2500, 491.7500 }, + { 69, 493.2500, 497.7500 }, + { 70, 499.2500, 503.7500 }, + { 71, 505.2500, 509.7500 }, + { 72, 511.2500, 515.7500 }, + { 73, 517.2500, 521.7500 }, + { 74, 523.2500, 527.7500 }, + { 75, 529.2500, 533.7500 }, + { 76, 535.2500, 539.7500 }, + { 77, 541.2500, 545.7500 }, + { 78, 547.2500, 551.7500 }, + { 79, 553.2500, 557.7500 }, + { 80, 559.2500, 563.7500 }, + { 81, 565.2500, 569.7500 }, + { 82, 571.2500, 575.7500 }, + { 83, 577.2500, 581.7500 }, + { 84, 583.2500, 587.7500 }, + { 85, 589.2500, 593.7500 }, + { 86, 595.2500, 599.7500 }, + { 87, 601.2500, 605.7500 }, + { 88, 607.2500, 611.7500 }, + { 89, 613.2500, 617.7500 }, + { 90, 619.2500, 623.7500 }, + { 91, 625.2500, 629.7500 }, + { 92, 631.2500, 635.7500 }, + { 93, 637.2500, 641.7500 }, + { 94, 643.2500, 647.7500 }, + { 95, 91.2500, 95.7500 }, + { 96, 97.2500, 101.7500 }, + { 97, 103.2500, 107.7500 }, + { 98, 109.2750, 113.7750 }, + { 99, 115.2750, 119.7750 }, + { 100, 649.2500, 653.7500 }, + { 101, 655.2500, 659.7500 }, + { 102, 661.2500, 665.7500 }, + { 103, 667.2500, 671.7500 }, + { 104, 673.2500, 677.7500 }, + { 105, 679.2500, 683.7500 }, + { 106, 685.2500, 689.7500 }, + { 107, 691.2500, 695.7500 }, + { 108, 697.2500, 701.7500 }, + { 109, 703.2500, 707.7500 }, + { 110, 709.2500, 713.7500 }, + { 111, 715.2500, 719.7500 }, + { 112, 721.2500, 725.7500 }, + { 113, 727.2500, 731.7500 }, + { 114, 733.2500, 737.7500 }, + { 115, 739.2500, 743.7500 }, + { 116, 745.2500, 749.7500 }, + { 117, 751.2500, 755.7500 }, + { 118, 757.2500, 761.7500 }, + { 119, 763.2500, 767.7500 }, + { 120, 769.2500, 773.7500 }, + { 121, 775.2500, 779.7500 }, + { 122, 781.2500, 785.7500 }, + { 123, 787.2500, 791.7500 }, + { 124, 793.2500, 797.7500 }, + { 125, 799.2500, 803.7500 }, + { 126, 805.2500, 809.7500 }, + { 127, 811.2500, 815.7500 }, + { 128, 817.2500, 821.7500 }, + { 129, 823.2500, 827.7500 }, + { 130, 829.2500, 833.7500 }, + { 131, 835.2500, 839.7500 }, + { 132, 841.2500, 845.7500 }, + { 133, 847.2500, 851.7500 }, + { 134, 853.2500, 857.7500 }, + { 135, 859.2500, 863.7500 }, + { 136, 865.2500, 869.7500 }, + { 137, 871.2500, 875.7500 }, + { 138, 877.2500, 881.7500 }, + { 139, 883.2500, 887.7500 }, + { 140, 889.2500, 893.7500 }, + { 141, 895.2500, 899.7500 }, + { 142, 901.2500, 905.7500 }, + { 143, 907.2500, 911.7500 }, + { 144, 913.2500, 917.7500 }, + { 145, 919.2500, 923.7500 }, + { 146, 925.2500, 929.7500 }, + { 147, 931.2500, 935.7500 }, + { 148, 937.2500, 941.7500 }, + { 149, 943.2500, 947.7500 }, + { 150, 949.2500, 953.7500 }, + { 151, 955.2500, 959.7500 }, + { 152, 961.2500, 965.7500 }, + { 153, 967.2500, 971.7500 }, + { 154, 973.2500, 977.7500 }, + { 155, 979.2500, 983.7500 }, + { 156, 985.2500, 989.7500 }, + { 157, 991.2500, 995.7500 }, + { 158, 997.2500, 1001.7500 }, + { 0, 0, 0} +}; + +static ChannelFreqTable VSB_CHANNELS[] = +{ + { 14, 470, 476 }, + { 15, 476, 482 }, + { 16, 482, 488 }, + { 17, 488, 494 }, + { 18, 494, 500 }, + { 19, 500, 506 }, + { 20, 506, 512 }, + { 21, 512, 518 }, + { 22, 518, 524 }, + { 23, 524, 530 }, + { 24, 530, 536 }, + { 25, 536, 542 }, + { 26, 542, 548 }, + { 27, 548, 554 }, + { 28, 554, 560 }, + { 29, 560, 566 }, + { 30, 566, 572 }, + { 31, 572, 578 }, + { 32, 578, 584 }, + { 33, 584, 590 }, + { 34, 590, 596 }, + { 35, 596, 602 }, + { 36, 602, 608 }, + { 37, 608, 614 }, + { 38, 614, 620 }, + { 39, 620, 626 }, + { 40, 626, 632 }, + { 41, 632, 638 }, + { 42, 638, 644 }, + { 43, 644, 650 }, + { 44, 650, 656 }, + { 45, 656, 662 }, + { 46, 662, 668 }, + { 47, 668, 674 }, + { 48, 674, 680 }, + { 49, 680, 686 }, + { 50, 686, 692 }, + { 51, 692, 698 }, + { 52, 698, 704 }, + { 53, 704, 710 }, + { 54, 710, 716 }, + { 55, 716, 722 }, + { 56, 722, 728 }, + { 57, 728, 734 }, + { 58, 734, 740 }, + { 59, 740, 746 }, + { 60, 746, 752 }, + { 61, 752, 758 }, + { 62, 758, 764 }, + { 63, 764, 770 }, + { 64, 770, 776 }, + { 65, 776, 782 }, + { 66, 782, 788 }, + { 67, 788, 794 }, + { 68, 794, 800 }, + { 69, 800, 806 }, + { 70, 806, 812 }, + { 71, 812, 818 }, + { 72, 818, 824 }, + { 73, 824, 830 }, + { 74, 830, 836 }, + { 75, 836, 842 }, + { 76, 842, 848 }, + { 77, 848, 854 }, + { 78, 854, 860 }, + { 79, 860, 866 }, + { 80, 866, 872 }, + { 81, 872, 878 }, + { 82, 878, 884 }, + { 0, 0, 0} +}; + +DvbChannel::DvbChannel() +{ + Clear(); +} + +DvbChannel::DvbChannel(int index) +{ + m_index = index; + m_channelNumberCalculated = false; +} + +DvbChannel::~DvbChannel() +{ +} + +CStdString DvbChannel::GetServiceName() const +{ + return m_serviceName; +} + +CStdString DvbChannel::GetServiceProviderId() const +{ + return m_serviceProvider; +} + +CStdString DvbChannel::GetFreq() const +{ + return m_freq; +} + +void DvbChannel::Clear() +{ + m_serviceId = 0; + m_originalNetworkId = 0; + m_transportStreamId = 0; + + m_isEnabled = false; + m_serviceName.clear(); + m_freq.clear(); + m_serverImage.clear(); + m_serverChannelName.clear(); + m_serverChannelNameShort.clear(); + m_serverId.clear(); +} + +int DvbChannel::GetVideoPid() const +{ + return m_videoPid; +} + +int DvbChannel::GetServiceId() const +{ + return m_serviceId; +} + +bool DvbChannel::IsEnabled() const +{ + return m_isEnabled; +} + +void DvbChannel::SetEnabled(bool enabled) +{ + m_isEnabled = enabled; +} + +CStdString DvbChannel::GetServerImage() const +{ + return m_serverImage; +} + +CStdString DvbChannel::GetServerChannelName() const +{ + return m_serverChannelName; +} + +CStdString DvbChannel::GetServerChannelNameShort() const +{ + return m_serverChannelNameShort; +} + +CStdString DvbChannel::GetServerId() const +{ + return m_serverId; +} + +bool DvbChannel::FromConfRecord(const CStdString &record) +{ + // parse a record from channels.conf and extract relevant info from it. + // note that channels.conf is different between DVBT and ATSC but this should work on both + Clear(); + CStdStringArray params; + StringUtils::SplitString(record, ":", params); + + if (params.size() < 5) + return false; + + if (params[0].Find(';') == -1) + { + m_serviceName = params[0]; + m_serviceProvider = ""; + } + else + { + CStdStringArray params2; + StringUtils::SplitString(params[0], ";", params2); + m_serviceName = params2[0]; + m_serviceProvider = params2[1]; + } + + m_serverChannelName = m_serviceName; + m_serverChannelNameShort = m_serviceName; + + m_freq = params[1]; + m_tuningParams = params[2]; + m_videoPid = atoi(params[3]); + ParseAudioPids(params[4], false); + ParseAudioPids(params[5], true); + m_serviceId = atoi(params[6]); + m_originalNetworkId = atoi(params[7]); + m_transportStreamId = atoi(params[8]); + m_virtualChannel = params[9]; + + if (m_virtualChannel == "0.0") + m_virtualChannel = ""; + + //optional, only for development without server + if (params.size() > 10) + m_serverId = params[10]; + + m_isEnabled = true; + + return true; +} + +void DvbChannel::ParseAudioPids(const CStdString& confRecord, bool isAC3) +{ + if (confRecord.size() == 0) + return; + + CStdStringArray params; + StringUtils::SplitString(confRecord, ",", params); + + for (size_t i = 0; i < params.size(); i++) + { + CStdStringArray p; + StringUtils::SplitString(params[i], "=", p); + + DvbAudioInfo info; + info.isAC3 = isAC3; + info.pid = atoi(p[0]); + if (p.size() > 1) + { + bool valid = true; + + for (size_t i = 0; i < p[1].length(); i++) + { + if (p[1][i] < 32) + { + valid = false; + break; + } + } + + if (valid) + info.lang = p[1]; + } + + m_audioPids.push_back(info); + } +} + +CStdString DvbChannel::GetVirtualChannel() const +{ + return m_virtualChannel; +} + +int DvbChannel::GetOriginalNetworkId() const +{ + return m_originalNetworkId; +} + +int DvbChannel::GetTransportStreamId() const +{ + return m_transportStreamId; +} + +CStdString DvbChannel::GetDvbTriplet() const +{ + // From GraceNote docs: + // A DVB triplet has the format dvb://aaa.bbb.ccc and consists of these parts: + // : the Original network ID (the first number). : the Transport stream ID (the second number). + // : the Service ID (the third number). + CStdString result; + if (m_transportStreamId == 0 || m_originalNetworkId == 0) + return result; + + result.Format("%d.%d.%d", m_originalNetworkId, m_transportStreamId, m_serviceId); + return result; +} + +int DvbChannel::GetIndex() const +{ + return m_index; +} + +void DvbChannel::SetIndex(int index) +{ + m_index = index; +} + +CStdString DvbChannel::GetTuningParams() const +{ + return m_tuningParams; +} + +const std::vector& DvbChannel::GetAudioPids() const +{ + return m_audioPids; +} + +CStdString DvbChannel::GetChannelLabel() const +{ + if (!m_manualChannelName.IsEmpty()) + return m_manualChannelName; + + if (!m_serverChannelNameShort.IsEmpty()) + return m_serverChannelNameShort; + + if (!m_serviceName.IsEmpty()) + return m_serviceName; + + return ""; +} + +void DvbChannel::CalculateChannelNumber() +{ + if (m_tuningParams == "QAM_256") + { + float freq = ((float) atoi(m_freq)) / 1000000; + int i = 0; + while (QAM_CHANNELS[i].channel != 0) + { + if (freq >= QAM_CHANNELS[i].minMhz && freq <= QAM_CHANNELS[i].maxMhz) + { + m_calculatedChannelNumber.Format("%d.%d", QAM_CHANNELS[i].channel, m_serviceId % 1000); +// printf("********** QAM: %s => %s\n", m_freq.c_str(), m_calculatedChannelNumber.c_str()); + break; + } + ++i; + } + } + + else if (m_tuningParams == "8VSB") + { + float freq = ((float) atoi(m_freq)) / 1000000; + int i = 0; + while (VSB_CHANNELS[i].channel != 0) + { + if (freq >= VSB_CHANNELS[i].minMhz && freq <= VSB_CHANNELS[i].maxMhz) + { + m_calculatedChannelNumber.Format("%d.%d", VSB_CHANNELS[i].channel, m_serviceId % 1000); +// printf("********** VSB: %s => %s\n", m_freq.c_str(), m_calculatedChannelNumber.c_str()); + break; + } + ++i; + } + } + + m_channelNumberCalculated = true; +} + +CStdString DvbChannel::GetChannelNumber() +{ + if (!m_manualChannelNumber.IsEmpty()) + return m_manualChannelNumber; + + if (!m_virtualChannel.IsEmpty()) + return m_virtualChannel; + + if (!m_channelNumberCalculated) + { + CalculateChannelNumber(); + } + + return m_calculatedChannelNumber; +} + +CStdString DvbChannel::GetChannelId() const +{ + if (!m_serverId.IsEmpty()) + return m_serverId; + + if (!m_virtualChannel.IsEmpty()) + return m_virtualChannel; + + if (!m_serviceName.IsEmpty()) + return m_serviceName; + + return ""; +} + +bool DvbChannel::FromJson(const Json::Value& rootValue) +{ + if (rootValue["frequency"].isNull() || + rootValue["tune_flags"].isNull() || + !rootValue["video"].isObject() || + (rootValue["video"].isObject() && !rootValue["video"]["pid"].isInt()) || + !rootValue["audio"].isArray()) + { + return false; + } + + m_serviceId = 0; + if (rootValue["program_id"].isInt()) + m_serviceId = rootValue["program_id"].asInt(); + + if (m_serviceId == 0 && rootValue["service_id"].isInt()) + m_serviceId = rootValue["service_id"].asInt(); + + if (m_serviceId == 0) + return false; + + m_serviceName = rootValue["service_name"].asString(); + m_manualChannelName = rootValue["manual_name"].asString(); + m_manualChannelNumber = rootValue["manual_channel_id"].asString(); + + m_serviceProvider = rootValue["provider_name"].asString(); + m_freq = rootValue["frequency"].asString(); + m_virtualChannel = rootValue["virtual_channel_id"].asString(); + + if (atof(m_virtualChannel.c_str()) > 99.0 || m_virtualChannel == "0.0") + m_virtualChannel = ""; + + m_tuningParams = rootValue["tune_flags"].asString(); + + if (!rootValue["ts_id"].isNull()) + m_transportStreamId = rootValue["ts_id"].asInt(); + else + m_transportStreamId = 0; + + if (!rootValue["network_id"].isNull()) + m_originalNetworkId = rootValue["network_id"].asInt(); + else + m_originalNetworkId = 0; + + m_videoPid = rootValue["video"]["pid"].asInt(); + + Json::Value audio = rootValue["audio"]; + for (Json::ArrayIndex i = 0; i < audio.size(); i++) + { + Json::Value audioItem = audio[i]; + if (!audioItem["pid"].isInt()) + return false; + + DvbAudioInfo audioInfo; + audioInfo.pid = audioItem["pid"].asInt(); + if (audioItem["is_ac3"].isBool()) + audioInfo.isAC3 = audioItem["is_ac3"].asBool(); + if (!audioItem["lang"].isNull()) + audioInfo.lang = audioItem["lang"].asString(); + + m_audioPids.push_back(audioInfo); + } + + m_isEnabled = !rootValue["is_filtered"].asBool(); + + if (rootValue["channel"].isObject()) + { + Json::Value channel = rootValue["channel"]; + m_serverId = channel["id"].asString(); + m_serverChannelName = channel["name"].asString(); + m_serverChannelNameShort = channel["name_short"].asString(); + } + + return true; +} + +Json::Value DvbChannel::ToJson() +{ + Json::Value response; + + response["program_id"] = m_serviceId; + response["service_id"] = m_serviceId; + response["service_name"] = m_serviceName; + if (!m_manualChannelName.IsEmpty()) + response["manual_name"] = m_manualChannelName; + if (!m_manualChannelNumber.IsEmpty()) + response["manual_channel_id"] = m_manualChannelNumber; + response["provider_name"] = m_serviceProvider; + response["frequency"] = m_freq; + response["virtual_channel_id"] = m_virtualChannel; + response["tune_flags"] = m_tuningParams; + if (m_transportStreamId) + response["ts_id"] = m_transportStreamId; + if (m_originalNetworkId) + response["network_id"] = m_originalNetworkId; + + Json::Value video; + video["pid"] = m_videoPid; + response["video"] = video; + + Json::Value audio; + for (size_t i = 0; i < m_audioPids.size(); i++) + { + Json::Value audioItem; + audioItem["pid"] = m_audioPids[i].pid; + audioItem["lang"] = m_audioPids[i].lang; + audioItem["is_ac3"] = m_audioPids[i].isAC3; + audio.append(audioItem); + } + response["audio"] = audio; + + response["is_filtered"] = !m_isEnabled; + + return response; +} + +void DvbChannel::SetChannelManualName(const CStdString& name) +{ + m_manualChannelName = name; +} + +void DvbChannel::SetChannelManualNumber(const CStdString& number) +{ + m_manualChannelNumber = number; +} + +#endif diff --git a/xbmc/cores/dvb/dvbchannel.h b/xbmc/cores/dvb/dvbchannel.h new file mode 100644 index 00000000..086f204a --- /dev/null +++ b/xbmc/cores/dvb/dvbchannel.h @@ -0,0 +1,105 @@ +#ifndef BXCHANNEL_H +#define BXCHANNEL_H + +#include "StdString.h" +#include +#include "json/value.h" +#include "FileItem.h" + +struct DvbAudioInfo +{ + DvbAudioInfo() { isAC3 = false; } + + int pid; + CStdString lang; + bool isAC3; +}; + +class DvbChannel +{ +public: + DvbChannel(); + DvbChannel(int index); + virtual ~DvbChannel(); + + int GetIndex() const; + void SetIndex(int index); + + /* + * The following methods return the technical information + * as retrieved by the dvb dongle by w_scan. + */ + CStdString GetServiceName() const; + CStdString GetServiceProviderId() const; + CStdString GetFreq() const; + CStdString GetTuningParams() const; + int GetVideoPid() const; + const std::vector& GetAudioPids() const; + int GetServiceId() const; + int GetOriginalNetworkId() const; + int GetTransportStreamId() const; + CStdString GetDvbTriplet() const; + CStdString GetVirtualChannel() const; + + /* Parse channels.conf */ + bool FromConfRecord(const CStdString &record); + + /* Additional information per channel returned by the server */ + CStdString GetServerImage() const; + CStdString GetServerChannelName() const; + CStdString GetServerChannelNameShort() const; + CStdString GetServerId() const; + + /* The following is calculated either locally or from the server */ + CStdString GetChannelLabel() const; + CStdString GetChannelNumber(); + CStdString GetChannelId() const; + + /* Manual editing of channel info */ + void SetChannelManualName(const CStdString& name); + void SetChannelManualNumber(const CStdString& number); + + bool IsEnabled() const; + void SetEnabled(bool enabled); + + bool FromJson(const Json::Value& rootValue); + Json::Value ToJson(); + +protected: + void Clear(); + void ParseAudioPids(const CStdString& confRecord, bool isAC3); + void CalculateChannelNumber(); + + /* local unique id per */ + int m_index; + + /* Data from w_scan */ + int m_serviceId; + CStdString m_serviceName; + CStdString m_serviceProvider; + CStdString m_freq; + CStdString m_tuningParams; + int m_videoPid; + std::vector m_audioPids; + int m_originalNetworkId; + int m_transportStreamId; + CStdString m_virtualChannel; + CStdString m_calculatedChannelNumber; + bool m_channelNumberCalculated; + + bool m_isEnabled; + + /* Data from server and user */ + CStdString m_serverId; + CStdString m_serverImage; + CStdString m_serverChannelName; + CStdString m_serverChannelNameShort; + + CStdString m_manualChannelName; + CStdString m_manualChannelNumber; + +}; + +typedef boost::shared_ptr DvbChannelPtr; + +#endif diff --git a/xbmc/cores/dvb/dvbchannels.cpp b/xbmc/cores/dvb/dvbchannels.cpp new file mode 100644 index 00000000..b886efeb --- /dev/null +++ b/xbmc/cores/dvb/dvbchannels.cpp @@ -0,0 +1,370 @@ +#include "dvbchannels.h" + +#ifdef HAS_DVB + +#include + +#include "FileSystem/File.h" +#include "utils/log.h" +#include "bxconfiguration.h" +#include "bxutils.h" +#include "GUISettings.h" +#include "Application.h" + +#define SCANNED_CHANNELS_FILE "special://home/dvb/channels.conf" +#define SCANNED_CHANNELS_SERVER_FILE "special://home/dvb/channels.json" + +DvbChannels::DvbChannels() +{ +} + +DvbChannels::~DvbChannels() +{ +} + +bool DvbChannels::LoadScannedChannels() +{ + CSingleLock lock(m_lock); + + XFILE::CFile channelsFile; + if (!XFILE::CFile::Exists(SCANNED_CHANNELS_FILE)) + { + return false; + } + + CLog::Log(LOGDEBUG, "DVBManager: has channels file. loading channels"); + + if (!channelsFile.Open(SCANNED_CHANNELS_FILE)) + { + CLog::Log(LOGWARNING,"DVBManager: cant open channels file. erasing it"); + XFILE::CFile::Delete(SCANNED_CHANNELS_FILE); + return false; + } + + m_channels.clear(); + char line[1024]; + int counter = 0; + while (channelsFile.ReadString(line, sizeof(line))) + { + CLog::Log(LOGDEBUG, "DVBManager: channels.conf line: %s", line); + + DvbChannelPtr channel(new DvbChannel(counter)); + if (channel->FromConfRecord(line)) + { + CLog::Log(LOGDEBUG, "DVBManager: adding channel %s", channel->GetServiceName().c_str()); + m_channels.push_back(channel); + + if (channel->GetServerId()) + m_channelsByServerId[channel->GetServerId()] = channel; + } + counter++; + } + + channelsFile.Close(); + + Sort(); + + return true; +} + +bool DvbChannels::HasChannels() +{ + CSingleLock lock(m_lock); + + return m_channels.size() > 0; +} + + +bool DvbChannels::SaveChannelsToServer() +{ +#ifdef HAS_SERVER_OTA + CSingleLock lock(m_lock); + + CStdString strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.ApiChannels", "http://app.boxee.tv/epg/user-channel"); + Json::Value jResponse; + int returnCode; + + Json::Value jBody = ToJSon(); + +#if 0 + Json::StyledWriter writer2; + std::string strPostData = writer2.write(jBody); + printf("post: %s\n", strPostData.c_str()); +#endif + + bool result = BOXEE::BXUtils::PerformJSONPostRequest(strUrl, jBody, jResponse, returnCode); + if (!result) + { + return false; + } + + // Cache server response for offline mode + Json::StyledWriter writer; + std::string channelsJson = writer.write(jResponse); + + XFILE::CFile channelsFile; + if (!channelsFile.OpenForWrite(SCANNED_CHANNELS_SERVER_FILE, true)) + { + CLog::Log(LOGWARNING,"DvbChannels::SaveChannelsToServer: can't open channels file"); + return false; + } + channelsFile.Write(channelsJson.c_str(), channelsJson.size()); + channelsFile.Close(); + +#if 0 + printf("got: %s\n", channelsJson.c_str()); +#endif + + if (!FromJSon(jResponse)) + { + return false; + } + + Sort(); +#endif + + return true; +} + +bool DvbChannels::LoadChannelsFromServer() +{ +#ifdef HAS_SERVER_OTA + CSingleLock lock(m_lock); + + Json::Value jResponse; + + if (g_application.IsConnectedToInternet(false)) + { + CStdString strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.ApiChannels", "http://app.boxee.tv/epg/user-channel"); + int returnCode; + + bool result = BOXEE::BXUtils::PerformJSONGetRequest(strUrl, jResponse, returnCode); + if (!result) + { + return false; + } + } + else + { + CLog::Log(LOGINFO, "DvbChannels::LoadChannelsFromServer: no internet, loading local list"); + + XFILE::CFile channelsFile; + if (!XFILE::CFile::Exists(SCANNED_CHANNELS_SERVER_FILE)) + { + CLog::Log(LOGERROR, "DvbChannels::LoadChannelsFromServer: can't find channels file"); + return false; + } + + if (!channelsFile.Open(SCANNED_CHANNELS_SERVER_FILE)) + { + CLog::Log(LOGERROR, "DvbChannels::LoadChannelsFromServer: can't open channels file"); + return false; + } + + int64_t fileSize = channelsFile.GetLength(); + char* jsonStr = new char[fileSize]; + if (channelsFile.Read(jsonStr, fileSize) != fileSize) + { + delete [] jsonStr; + CLog::Log(LOGWARNING,"DvbChannels::LoadChannelsFromServer: can't read channels file"); + return false; + } + + std::string jsonDoc = jsonStr; + delete jsonStr; + + Json::Reader reader; + if (!reader.parse(jsonDoc, jResponse)) + { + CLog::Log(LOGERROR, "DvbChannels::LoadChannelsFromServer: Failed to parse channels file. Error: %s", reader.getFormatedErrorMessages().c_str()); + return false; + } + } + +#if 0 + Json::StyledWriter writer2; + std::string strPostData2 = writer2.write(jResponse); + printf("got: %s\n", strPostData2.c_str()); +#endif + + if (!FromJSon(jResponse)) + { + return false; + } + + Sort(); +#endif + + return true; +} + +bool DvbChannels::FromJSon(const Json::Value& j) +{ + if (j["channels"].isNull() && !j["channels"].isArray()) + return false; + + if (j["channels"].size() == 0) + return true; + + m_channels.clear(); + + int counter = 0; + for (Json::ArrayIndex i = 0; i < j["channels"].size(); i++) + { + DvbChannelPtr channel(new DvbChannel(counter)); + if (channel->FromJson(j["channels"][i])) + { + CLog::Log(LOGDEBUG, "DVBManager: adding channel %s", channel->GetServiceName().c_str()); + m_channels.push_back(channel); + if (channel->GetServerId()) + m_channelsByServerId[channel->GetServerId()] = channel; + } + counter++; + } + + return true; +} + +Json::Value DvbChannels::ToJSon() +{ + Json::Value result; + result["country"] = g_guiSettings.GetString("ota.countrycode"); + + if (!g_guiSettings.GetString("ota.zipcode").IsEmpty()) + result["postal_code"] = g_guiSettings.GetString("ota.zipcode"); + + if (g_guiSettings.GetString("ota.countrycode") == "US" || + g_guiSettings.GetString("ota.countrycode") == "CA") + { + if (g_guiSettings.GetBool("ota.selectedcable")) + result["modulation"] = "qam"; + else + result["modulation"] = "vsb"; + } + else + { + result["modulation"] = "ofdm"; + } + + Json::Value channels; + for (size_t i = 0; i < m_channels.size(); i++) + { + channels.append(m_channels[i]->ToJson()); + } + result["channels"] = channels; + + return result; +} + +size_t DvbChannels::Size() +{ + CSingleLock lock(m_lock); + + return m_channels.size(); +} + +DvbChannelPtr DvbChannels::GetChannelByIndex(size_t index) +{ + CSingleLock lock(m_lock); + if (index > m_channels.size()) + { + return DvbChannelPtr(); + } + + return m_channels[index]; +} + +DvbChannelPtr DvbChannels::GetChannelByServerId(const CStdString& serverId) +{ + CSingleLock lock(m_lock); + + if (m_channelsByServerId.find(serverId) == m_channelsByServerId.end()) + return DvbChannelPtr(); + + return m_channelsByServerId.find(serverId)->second; +} + +DvbChannelPtr DvbChannels::GetChannel(const CStdString &name) +{ + CSingleLock lock(m_lock); + + foreach (DvbChannelPtr channel, m_channels) + { + if (channel->GetServiceName() == name || channel->GetVirtualChannel() == name || channel->GetServerId() == name) + return channel; + } + + return DvbChannelPtr(); +} + +DvbChannelPtr DvbChannels::GetChannelByDvbTriplet(int NetworkId, int TsId, int ServiceId) +{ + CSingleLock lock(m_lock); + + foreach (DvbChannelPtr channel, m_channels) + { + if (channel->GetOriginalNetworkId() == NetworkId && + channel->GetTransportStreamId() == TsId && + channel->GetServiceId() == ServiceId) + return channel; + } + + return DvbChannelPtr(); +} + +DvbChannelPtr DvbChannels::GetChannel(int ServiceId) +{ + CSingleLock lock(m_lock); + + foreach (DvbChannelPtr channel, m_channels) + { + if (channel->GetServiceId() == ServiceId) + return channel; + } + + return DvbChannelPtr(); +} + + +void DvbChannels::Clear() +{ + CSingleLock lock(m_lock); + m_channels.clear(); +} + +void DvbChannels::Lock() +{ + EnterCriticalSection(m_lock); +} + +void DvbChannels::Unlock() +{ + ExitCriticalSection(m_lock); +} + +static bool ChannelComparator(const DvbChannelPtr &left, const DvbChannelPtr &right) +{ + // Sort by channel number + if (!left->GetChannelNumber().IsEmpty() && !right->GetChannelNumber().IsEmpty()) + return (CUtil::VersionCompare(left->GetChannelNumber(), right->GetChannelNumber()) < 0); + // Channels with numbers should be first + else if (!left->GetChannelNumber().IsEmpty() && right->GetChannelNumber().IsEmpty()) + return true; + else if (left->GetChannelNumber().IsEmpty() && !right->GetChannelNumber().IsEmpty()) + return false; + // Otherwise, compare by string + else + return (left->GetChannelLabel().compare(right->GetChannelLabel()) < 0); +} + +void DvbChannels::Sort() +{ + std::sort(m_channels.begin(), m_channels.end(), ChannelComparator); + + for (size_t i = 0; i < m_channels.size(); i++) + { + m_channels[i]->SetIndex(i); + } +} + +#endif diff --git a/xbmc/cores/dvb/dvbchannels.h b/xbmc/cores/dvb/dvbchannels.h new file mode 100644 index 00000000..449438eb --- /dev/null +++ b/xbmc/cores/dvb/dvbchannels.h @@ -0,0 +1,48 @@ +#pragma once + +#include "system.h" + +#ifdef HAS_DVB + +#include +#include "StdString.h" +#include "json/value.h" +#include "dvbchannel.h" +#include "SingleLock.h" + +class DvbChannels +{ +public: + DvbChannels(); + virtual ~DvbChannels(); + + void Clear(); + size_t Size(); + + void Lock(); + void Unlock(); + + bool LoadScannedChannels(); + bool SaveChannelsToServer(); + bool LoadChannelsFromServer(); + + DvbChannelPtr GetChannelByIndex(size_t index); + DvbChannelPtr GetChannelByServerId(const CStdString& serverId); + + DvbChannelPtr GetChannel(const CStdString &name); + DvbChannelPtr GetChannelByDvbTriplet(int NetworkId, int TsId, int ServiceId); + DvbChannelPtr GetChannel(int ServiceId); + + bool HasChannels(); + +private: + void Sort(); + CCriticalSection m_lock; + std::vector m_channels; + std::map m_channelsByServerId; + + bool FromJSon(const Json::Value& j); + Json::Value ToJSon(); +}; + +#endif diff --git a/xbmc/cores/dvb/dvbepgloader.cpp b/xbmc/cores/dvb/dvbepgloader.cpp new file mode 100644 index 00000000..93fdffe6 --- /dev/null +++ b/xbmc/cores/dvb/dvbepgloader.cpp @@ -0,0 +1,720 @@ +/* This code was taken from ts.c, from the vlc code */ + +#include "dvbepgloader.h" + +#if defined(HAS_DVB) && defined(_LINUX) && !defined(__APPLE__) + +#include "StdString.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "Util.h" +#include +#include "SingleLock.h" + +#ifdef __GNUC__ +# define likely(p) __builtin_expect(!!(p), 1) +# define unlikely(p) __builtin_expect(!!(p), 0) +#else +# define likely(p) (!!(p)) +# define unlikely(p) (!!(p)) +#endif + +typedef struct EitData +{ + void* p_cb_data; + dvbpsi_eit_t *p_eit; + bool b_current_following; +} EitData; + +static inline unsigned clz (unsigned x) +{ +#ifdef __GNUC_ + return __builtin_clz (x); +#else + unsigned i = sizeof (x) * 8; + + while (x) + { + x = x >> 1; + i--; + } + return i; +#endif +} + +#define clz8( x ) (clz(x) - ((sizeof(unsigned) - sizeof (uint8_t)) * 8)) + +/** + * Converts the first character from a UTF-8 sequence into a code point. + * + * @param str an UTF-8 bytes sequence + * @return 0 if str points to an empty string, i.e. the first character is NUL; + * number of bytes that the first character occupies (from 1 to 4) otherwise; + * -1 if the byte sequence was not a valid UTF-8 sequence. + */ +static size_t vlc_towc (const char *str, uint32_t *restrict pwc) +{ + uint8_t *ptr = (uint8_t *)str, c; + uint32_t cp = 0; + + assert (str != NULL); + + c = *ptr; + if (unlikely(c > 0xF4)) + return -1; + + int charlen = clz8 (c ^ 0xFF); + switch (charlen) + { + case 0: // 7-bit ASCII character -> short cut + *pwc = c; + return c != '\0'; + + case 1: // continuation byte -> error + return -1; + + case 2: + if (unlikely(c < 0xC2)) // ASCII overlong + return -1; + cp = (c & 0x1F) << 6; + break; + + case 3: + cp = (c & 0x0F) << 12; + break; + + case 4: + cp = (c & 0x07) << 16; + break; + + default: + assert (0); + } + + /* Unrolled continuation bytes decoding */ + switch (charlen) + { + case 4: + c = *++ptr; + if (unlikely((c >> 6) != 2)) // not a continuation byte + return -1; + cp |= (c & 0x3f) << 12; + + if (unlikely(cp >= 0x110000)) // beyond Unicode range + return -1; + /* fall through */ + case 3: + c = *++ptr; + if (unlikely((c >> 6) != 2)) // not a continuation byte + return -1; + cp |= (c & 0x3f) << 6; + + if (unlikely(cp >= 0xD800 && cp < 0xC000)) // UTF-16 surrogate + return -1; + if (unlikely(cp < (1u << (5 * charlen - 4)))) // non-ASCII overlong + return -1; + /* fall through */ + case 2: + c = *++ptr; + if (unlikely((c >> 6) != 2)) // not a continuation byte + return -1; + cp |= (c & 0x3f); + break; + } + + *pwc = cp; + return charlen; +} + +/** + * Replaces invalid/overlong UTF-8 sequences with question marks. + * Note that it is not possible to convert from Latin-1 to UTF-8 on the fly, + * so we don't try that, even though it would be less disruptive. + * + * @return str if it was valid UTF-8, NULL if not. + */ +static char *EnsureUTF8( char *str ) +{ + char *ret = str; + size_t n; + uint32_t cp; + + while ((n = vlc_towc (str, &cp)) != 0) + if (likely(n != (size_t)-1)) + str += n; + else + { + *str++ = '?'; + ret = NULL; + } + return ret; +} + +static char *EITConvertToUTF8(const unsigned char *psz_instring, + size_t i_length, bool b_broken) +{ + const char *psz_encoding; + char *psz_outstring; + char psz_encbuf[sizeof("ISO_8859-123")]; + size_t i_in, i_out, offset = 1; + iconv_t iconv_handle; + + if (i_length < 1) + return NULL; + if (psz_instring[0] >= 0x20) + { + /* According to ETSI EN 300 468 Annex A, this should be ISO6937, + * but some broadcasters use different charset... */ + if (b_broken) + psz_encoding = "ISO_8859-1"; + else + psz_encoding = "ISO_6937"; + + offset = 0; + } + else + switch (psz_instring[0]) + { + case 0x01: + psz_encoding = "ISO_8859-5"; + break; + case 0x02: + psz_encoding = "ISO_8859-6"; + break; + case 0x03: + psz_encoding = "ISO_8859-7"; + break; + case 0x04: + psz_encoding = "ISO_8859-8"; + break; + case 0x05: + psz_encoding = "ISO_8859-9"; + break; + case 0x06: + psz_encoding = "ISO_8859-10"; + break; + case 0x07: + psz_encoding = "ISO_8859-11"; + break; + case 0x08: + psz_encoding = "ISO_8859-12"; + break; + case 0x09: + psz_encoding = "ISO_8859-13"; + break; + case 0x0a: + psz_encoding = "ISO_8859-14"; + break; + case 0x0b: + psz_encoding = "ISO_8859-15"; + break; + case 0x10: +#warning Is Latin-10 (psz_instring[2] == 16) really illegal? + if (i_length < 3 || psz_instring[1] != 0x00 || psz_instring[2] > 15 + || psz_instring[2] == 0) + { + psz_encoding = "UTF-8"; + offset = 0; + } + else + { + sprintf(psz_encbuf, "ISO_8859-%u", psz_instring[2]); + psz_encoding = psz_encbuf; + offset = 3; + } + break; + case 0x11: +#warning Is there a BOM or do we use a fixed endianess? + psz_encoding = "UTF-16"; + break; + case 0x12: + psz_encoding = "KSC5601-1987"; + break; + case 0x13: + psz_encoding = "GB2312"; /* GB-2312-1980 */ + break; + case 0x14: + psz_encoding = "BIG-5"; + break; + case 0x15: + psz_encoding = "UTF-8"; + break; + default: + /* invalid */ + psz_encoding = "UTF-8"; + offset = 0; + } + + i_in = i_length - offset; + i_out = i_in * 6 + 1; + + psz_outstring = (char*) malloc(i_out); + if (!psz_outstring) + { + return NULL; + } + + iconv_handle = iconv_open("UTF-8", psz_encoding); + if (iconv_handle == (iconv_t)(-1)) + { + /* Invalid character set (e.g. ISO_8859-12) */ + memcpy(psz_outstring, &psz_instring[offset], i_in); + psz_outstring[i_in] = '\0'; + EnsureUTF8( psz_outstring ); + } + else + { + const char *psz_in = (const char *) &psz_instring[offset]; + char *psz_out = psz_outstring; + + while (iconv(iconv_handle, (char**) &psz_in, &i_in, &psz_out, &i_out) + == (size_t) (-1)) + { + /* skip naughty byte. This may fail terribly for multibyte stuff, + * but what can we do anyway? */ + psz_in++; + i_in--; + iconv(iconv_handle, NULL, NULL, NULL, NULL); /* reset */ + } + iconv_close(iconv_handle); + + *psz_out = '\0'; + + /* Convert EIT-coded CR/LFs */ + unsigned char *pbuf = (unsigned char *) psz_outstring; + for (; pbuf < (unsigned char *) psz_out; pbuf++) + { + if (pbuf[0] == 0xc2 && pbuf[1] == 0x8a) + { + pbuf[0] = ' '; + pbuf[1] = '\n'; + } + } + + } + return psz_outstring; +} + +/* i_year: year - 1900 i_month: 0-11 i_mday: 1-31 i_hour: 0-23 i_minute: 0-59 i_second: 0-59 */ +static int64_t vlc_timegm(int i_year, int i_month, int i_mday, int i_hour, + int i_minute, int i_second) +{ + static const int pn_day[12 + 1] = + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};int64_t i_day; + int i; + + if( i_year < 70 || + i_month < 0 || i_month > 11 || i_mday < 1 || i_mday > 31 || + i_hour < 0 || i_hour > 23 || i_minute < 0 || i_minute > 59 || i_second < 0 || i_second > 59 ) + return -1; + + /* Count the number of days */ + i_day = 365 * (i_year-70) + pn_day[i_month] + i_mday - 1; +#define LEAP(y) ( ((y)%4) == 0 && (((y)%100) != 0 || ((y)%400) == 0) ? 1 : 0) + for( i = 70; i < i_year; i++ ) + i_day += LEAP(1900+i); + if( i_month > 1 ) + i_day += LEAP(1900+i_year); +#undef LEAP + /**/ + return ((24*i_day + i_hour)*60 + i_minute)*60 + i_second; +} + +#define CVT_FROM_BCD(v) ((((v) >> 4)&0xf)*10 + ((v)&0xf)) + +static void EITDecodeMjd(int i_mjd, int *p_y, int *p_m, int *p_d) +{ + const int yp = (int) (((double) i_mjd - 15078.2) / 365.25 ); + const int mp = (int) (((double) i_mjd - 14956.1 - (int) (yp * 365.25)) + / 30.6001 ); + const int c = (mp == 14 || mp == 15 ) ? 1 : 0; + + *p_y = 1900 + yp + c * 1; + *p_m = mp - 1 - c * 12; + *p_d = i_mjd - 14956 - (int) (yp * 365.25) - (int) (mp * 30.6001); +} + +static int64_t EITConvertStartTime(uint64_t i_date) +{ + const int i_mjd = i_date >> 24; + const int i_hour = CVT_FROM_BCD(i_date >> 16); + const int i_minute = CVT_FROM_BCD(i_date >> 8); + const int i_second = CVT_FROM_BCD(i_date ); + int i_year; + int i_month; + int i_day; + + /* if all 40 bits are 1, the start is unknown */ + if (i_date == uint64_t(0xffffffffffLL)) + return -1; + + EITDecodeMjd(i_mjd, &i_year, &i_month, &i_day); + return vlc_timegm(i_year - 1900, i_month - 1, i_day, i_hour, i_minute, + i_second); +} + +static int EITConvertDuration(uint32_t i_duration) +{ + return CVT_FROM_BCD(i_duration >> 16) * 3600 + + CVT_FROM_BCD(i_duration >> 8 ) * 60 + CVT_FROM_BCD(i_duration ); +} + + +void EITCallBack(void* p_cb_data, dvbpsi_eit_t *p_eit, bool b_current_following) +{ + dvbpsi_eit_event_t *p_evt; + + if (!p_eit->b_current_next) + { + dvbpsi_DeleteEIT( p_eit); + return; + } + +#if 0 + printf("new EIT service_id=%d version=%d current_next=%d " + "ts_id=%d network_id=%d segment_last_section_number=%d " + "last_table_id=%d\n", + p_eit->i_service_id, p_eit->i_version, p_eit->b_current_next, + p_eit->i_ts_id, p_eit->i_network_id, + p_eit->i_segment_last_section_number, p_eit->i_last_table_id ); +#endif + + DvbEpgInfo epg; + epg.networkId = p_eit->i_network_id; + epg.serviceId = p_eit->i_service_id; + epg.tsId = p_eit->i_ts_id; + + for (p_evt = p_eit->p_first_event; p_evt; p_evt = p_evt->p_next) + { + dvbpsi_descriptor_t *p_dr; + char *psz_name = NULL; + char *psz_text = NULL; + char *psz_extra = strdup(""); + int64_t i_start; + int i_duration; + uint16_t i_event_id; + CStdString strRating; + + i_start = EITConvertStartTime(p_evt->i_start_time); + i_duration = EITConvertDuration(p_evt->i_duration); + i_event_id = p_evt->i_event_id; + +#if 0 + printf(" * event id=%d start_time:%d duration=%d " + "running=%d free_ca=%d\n", + p_evt->i_event_id, (int)i_start, (int)i_duration, + p_evt->i_running_status, p_evt->b_free_ca ); +#endif + + for (p_dr = p_evt->p_first_descriptor; p_dr; p_dr = p_dr->p_next) + { + if (p_dr->i_tag == 0x4d) + { + dvbpsi_short_event_dr_t *pE = dvbpsi_DecodeShortEventDr(p_dr); + + /* Only take first description, as we don't handle language-info + for epg atm*/ + if (pE && psz_name == NULL) + { + psz_name = EITConvertToUTF8(pE->i_event_name, pE->i_event_name_length, + true /*p_sys->b_broken_charset */); + psz_text = EITConvertToUTF8(pE->i_text, pE->i_text_length, + true /*p_sys->b_broken_charset */); +#if 0 + printf(" - short event lang=%3.3s '%s' : '%s'\n", + pE->i_iso_639_code, psz_name, psz_text ); +#endif + } + } + else if (p_dr->i_tag == 0x4e) + { + dvbpsi_extended_event_dr_t *pE = dvbpsi_DecodeExtendedEventDr(p_dr); + if (pE) + { +#if 0 + printf(" - extended event lang=%3.3s [%d/%d]\n", + pE->i_iso_639_code, + pE->i_descriptor_number, pE->i_last_descriptor_number ); +#endif + + if (pE->i_text_length > 0) + { + char *psz_text = EITConvertToUTF8(pE->i_text, pE->i_text_length, + true /*p_sys->b_broken_charset*/); + if (psz_text) + { +#if 0 + printf(" - text='%s'\n", psz_text ); +#endif + psz_extra = (char*) realloc(psz_extra, + strlen(psz_extra) + strlen(psz_text) + 1); + strcat(psz_extra, psz_text); + free(psz_text); + } + } + + for (int i = 0; i < pE->i_entry_count; i++) + { + char *psz_dsc = EITConvertToUTF8(pE->i_item_description[i], + pE->i_item_description_length[i], + true /* p_sys->b_broken_charset */); + char *psz_itm = EITConvertToUTF8(pE->i_item[i], + pE->i_item_length[i], true /* p_sys->b_broken_charset */); + + if (psz_dsc && psz_itm) + { +#if 0 + printf(" - desc='%s' item='%s'\n", psz_dsc, psz_itm ); +#endif + +#if 0 + psz_extra = xrealloc( psz_extra, + strlen(psz_extra) + strlen(psz_dsc) + + strlen(psz_itm) + 3 + 1 ); + strcat( psz_extra, "(" ); + strcat( psz_extra, psz_dsc ); + strcat( psz_extra, " " ); + strcat( psz_extra, psz_itm ); + strcat( psz_extra, ")" ); +#endif + } + free(psz_dsc); + free(psz_itm); + } + } + } + else if (p_dr->i_tag == 0x55) // parental_rating_descriptor + { + dvbpsi_parental_rating_dr_t *pD = dvbpsi_DecodeParentalRatingDr(p_dr); + + if(pD) + { + for(int i = 0; i< pD->i_ratings_number; i++) + { + uint8_t i_rating = pD->p_parental_rating[i].i_rating; +#if 0 + printf(" - parental rating i=%d country_code %d rating %d\n", i, + pD->p_parental_rating[i].i_country_code, + pD->p_parental_rating[i].i_rating); +#endif + if(i_rating >= 0x1 && i_rating <= 0xF) + { + strRating.Format("TV-%d", i_rating + 3); + break; // FIXME: only first country for now + } + } + } + } + else + { +#if 0 + printf(" - tag=0x%x(%d)\n", p_dr->i_tag, p_dr->i_tag ); +#endif + } + } + + /* */ + DvbEpgEvent event; + + if (i_start > 0) + { + event.id = i_event_id; + event.duration = i_duration; + event.startTime = i_start; + event.name = psz_name; + event.text = psz_text; + event.rating = strRating; + if (psz_extra) + event.extra = psz_extra; + + epg.events.push_back(event); + } + + /* Update "now playing" field */ + if (p_evt->i_running_status == 0x04 && i_start > 0) + { + epg.current = event; + } + + DvbEpgLoader* epgLoader = (DvbEpgLoader*) p_cb_data; + epgLoader->OnEpgNewInfo(epg); + + free(psz_name); + free(psz_text); + + free(psz_extra); + } + + + dvbpsi_DeleteEIT(p_eit); +} + +static void EITCallBackCurrentFollowing(void *p_cb_data, dvbpsi_eit_t *p_eit) +{ + DvbEpgLoader* dvnEpgLoader = (DvbEpgLoader*)p_cb_data; + + dvnEpgLoader->OnNewEitData(p_cb_data, p_eit, true); +} + +static void EITCallBackSchedule(void *p_cb_data, dvbpsi_eit_t *p_eit) +{ + DvbEpgLoader* dvnEpgLoader = (DvbEpgLoader*)p_cb_data; + + dvnEpgLoader->OnNewEitData(p_cb_data, p_eit, false); +} + +void PSINewTableCallBack(void *p_cb_data, dvbpsi_handle h_dvbpsi, + uint8_t i_table_id, uint16_t i_extension) +{ + if (i_table_id == 0x4e || /* Current/Following */ + (i_table_id >= 0x50 && i_table_id <= 0x5f)) /* Schedule */ + { +#if 0 + printf("PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)\n", + i_table_id, i_table_id, i_extension, i_extension ); +#endif + + dvbpsi_eit_callback cb = + i_table_id == 0x4e ? (dvbpsi_eit_callback) EITCallBackCurrentFollowing : + (dvbpsi_eit_callback) EITCallBackSchedule; + + dvbpsi_AttachEIT(h_dvbpsi, i_table_id, i_extension, cb, p_cb_data); + } +} + +DvbEpgLoader::DvbEpgLoader() +{ + pthread_mutex_init(&m_listenersLock, NULL); + m_dvbpsi = dvbpsi_AttachDemux((dvbpsi_demux_new_cb_t) PSINewTableCallBack, this); + + pthread_mutex_init(&m_condLock, NULL); + pthread_cond_init(&m_newEitData, NULL); + + Create(); +} + +DvbEpgLoader::~DvbEpgLoader() +{ + pthread_mutex_destroy(&m_listenersLock); + dvbpsi_DetachDemux(m_dvbpsi); + + m_bStop = true; + pthread_cond_broadcast(&m_newEitData); + + StopThread(true); + + pthread_mutex_destroy(&m_condLock); + pthread_cond_destroy(&m_newEitData); +} + +void DvbEpgLoader::OnNewEitData(void *p_cb_data, void *p_eit, bool b_current_following) +{ + EitData* data = new EitData; + + data->p_cb_data = p_cb_data; + data->p_eit = (dvbpsi_eit_t*)p_eit; + data->b_current_following = b_current_following; + + { + CSingleLock lock(m_lock); + m_eitData.push_back(data); + } + + pthread_cond_broadcast(&m_newEitData); +} + +bool DvbEpgLoader::ProcessPacket(uint8_t* data) +{ + uint16_t i_pid = ((uint16_t) (data[1] & 0x1f) << 8) + data[2]; + if (i_pid == 0x12) + { + dvbpsi_PushPacket(m_dvbpsi, data); + return true; + } + + return false; +} + +void DvbEpgLoader::AddListener(IDvbEpgListener *alistener) +{ + pthread_mutex_lock(&m_listenersLock); + bool bExists = false; + + foreach (IDvbEpgListener* listener, m_listeners) + { + if (alistener == listener) + { + bExists = true; + break; + } + } + + if (!bExists) + m_listeners.push_back(alistener); + + pthread_mutex_unlock(&m_listenersLock); +} + +void DvbEpgLoader::RemoveListener(IDvbEpgListener *listener) +{ + pthread_mutex_lock(&m_listenersLock); + m_listeners.remove(listener); + pthread_mutex_unlock(&m_listenersLock); +} + +void DvbEpgLoader::OnEpgNewInfo(const DvbEpgInfo& info) +{ + pthread_mutex_lock(&m_listenersLock); + std::list tempListeners = m_listeners; + pthread_mutex_unlock(&m_listenersLock); + + foreach (IDvbEpgListener* listener, tempListeners) + { + listener->OnEpgNewInfo(info); + } +} + +void DvbEpgLoader::Process() +{ + while(!m_bStop) + { + pthread_cond_wait(&m_newEitData, &m_condLock); + + while(m_eitData.size() > 0) + { + EitData* data = NULL; + + { + CSingleLock lock(m_lock); + data = m_eitData.front(); + m_eitData.pop_front(); + } + + if(data) + { + EITCallBack(data->p_cb_data, data->p_eit, data->b_current_following); + delete data; + } + } + } +} + +#elif defined(__APPLE__) && defined(HAS_DVB) + +DvbEpgLoader::DvbEpgLoader() +{ +} + +DvbEpgLoader::~DvbEpgLoader() +{ +} + +#endif diff --git a/xbmc/cores/dvb/dvbepgloader.h b/xbmc/cores/dvb/dvbepgloader.h new file mode 100644 index 00000000..a42e64c7 --- /dev/null +++ b/xbmc/cores/dvb/dvbepgloader.h @@ -0,0 +1,73 @@ +#pragma once + +#include "system.h" + +#ifdef HAS_DVB + +#include +#include "StdString.h" +#include "Thread.h" + +struct DvbEpgEvent +{ + DvbEpgEvent() { startTime = 0; } + + int id; + int64_t startTime; + int duration; + CStdString name; + CStdString text; + CStdString extra; + CStdString rating; +}; + +struct DvbEpgInfo +{ + DvbEpgInfo() { serviceId = 0; networkId = 0; tsId = 0; } + + int serviceId; + int networkId; + int tsId; + DvbEpgEvent current; + std::list events; +}; + +class IDvbEpgListener +{ +public: + virtual ~IDvbEpgListener() {} + + virtual void OnEpgNewInfo(const DvbEpgInfo& info) = 0; +}; + +struct dvbpsi_decoder_s; +struct EitData; + +class DvbEpgLoader : public CThread +{ +public: + DvbEpgLoader(); + ~DvbEpgLoader(); + + bool ProcessPacket(uint8_t* data); + + void AddListener(IDvbEpgListener *listener); + void RemoveListener(IDvbEpgListener *listener); + + void OnEpgNewInfo(const DvbEpgInfo& info); + + virtual void Process(); + + void OnNewEitData(void *p_cb_data, void *p_eit, bool b_current_following); +private: + pthread_mutex_t m_listenersLock; + std::list m_listeners; + struct dvbpsi_decoder_s * m_dvbpsi; + + pthread_mutex_t m_condLock; + pthread_cond_t m_newEitData; + CCriticalSection m_lock; + std::list m_eitData; +}; + +#endif diff --git a/xbmc/cores/dvb/dvbmanager.cpp b/xbmc/cores/dvb/dvbmanager.cpp new file mode 100644 index 00000000..265fd051 --- /dev/null +++ b/xbmc/cores/dvb/dvbmanager.cpp @@ -0,0 +1,528 @@ +#include "dvbmanager.h" + +#ifdef HAS_DVB + +#include + +#include "Util.h" +#include "utils/log.h" +#include "Directory.h" +#include "Application.h" +#include "LocalizeStrings.h" +#include "SingleLock.h" +#include "epgstore.h" +#include "GUISettings.h" + +#include "json/value.h" +#include "json/reader.h" +#include "json/writer.h" + +#include "bxconfiguration.h" +#include "bxutils.h" + +#include "../lib/libBoxee/bxutils.h" +#include "../lib/libBoxee/bxconfiguration.h" +#include "HalServices.h" +#include "LiveTvModel.h" + +using namespace BOXEE; + +#define USE_BUDGET_MODE // stream using PID 0x200 +//#define FORCE_TUNE_ON_CHANNEL_CHANGE // force re-tuning even if frequencies are the same + +DVBManager::DVBManager() +{ + m_bIsRunning = false; + m_dongleInserted = false; + m_lastEpgCheckTime = 0; +} + +DVBManager &DVBManager::GetInstance() +{ + static DVBManager instance; + return instance; +} + +void DVBManager::ClearScanner() +{ + CLog::Log(LOGDEBUG, "DVBManager: clearing scanner..."); + m_scanningTuner.reset(); +} + +bool DVBManager::Start() +{ + if(m_bIsRunning) + return true; + + CSingleLock lock(m_lock); + + std::vector dvbDevices; + if (CHalServicesFactory::GetInstance().GetAllDvbDevices(dvbDevices)) + { + if (dvbDevices.size() > 0) + { + foreach (CHalDvbDevice device, dvbDevices) + { + if (device.ready) + OnDvbDongleReady(device.instance); + else if (device.connected) + OnDvbDongleInserted(); + } + } + } + +#if defined(_LINUX) && !defined(HAS_EMBEDDED) + if (CFile::Exists("/dev/dvb/adapter0/frontend0")) + { + OnDvbDongleReady(0); + } +#endif + +#if 0 + // for testing purposes + OnDvbDongleReady(0); +#endif + +#ifdef HAS_SERVER_OTA + if (g_guiSettings.GetBool("ota.scanned")) + { + m_channels.LoadChannelsFromServer(); + + // For testing purposes uncomment the following to use the channels.conf + //m_channels.Clear(); + + if (!m_channels.HasChannels()) + { + CLog::Log(LOGWARNING, "No channels found on server. Re-submitting."); + + // Oops, no channels on the server. Let's try to load the scanned channels and + // store them on the server. + if (!m_channels.LoadScannedChannels()) + { + CLog::Log(LOGERROR, "No local channels found. The user will need to re-scan"); + + g_guiSettings.SetBool("ota.scanned", false); + g_settings.Save(); + + return false; + } + + CLog::Log(LOGINFO, "Loaded %d local channels", (int) m_channels.Size()); + + if (!m_channels.SaveChannelsToServer()) + { + CLog::Log(LOGERROR, "Error saving at server"); + m_channels.Clear(); + return false; + } + } + + CLog::Log(LOGINFO, "Loaded %d server channels", (int) m_channels.Size()); + } + + m_epgServerLoader.Create(); +#else + if (g_guiSettings.GetBool("ota.scanned")) + { + m_channels.LoadScannedChannels(); + } +#endif + + if (m_channels.Size() > 0) + { + SetCurrentChannel(m_channels.GetChannelByIndex(0)); + } + + m_bIsRunning = true; + + return true; +} + +void DVBManager::OnDvbDongleInserted() +{ + CSingleLock lock(m_lock); + + m_dongleInserted = true; +} + +void DVBManager::OnDvbDongleReady(int adapterId) +{ + CSingleLock lock(m_lock); + + // add new tuner + bool found = false; + + foreach (DvbTunerPtr tuner, m_tuners) + { + if (tuner->GetId() == adapterId) + { + found = true; + break; + } + } + + int flags = 0; + +#ifdef USE_BUDGET_MODE + flags |= TUNER_FLAGS_BUDGET; +#endif + +#ifdef FORCE_TUNE_ON_CHANNEL_CHANGE + flags |= TUNER_FLAGS_FORCE_TUNE; +#endif + + if (!found) + { + DvbTunerPtr tuner(new DvbTuner(adapterId, this, flags)); + m_tuners.push_back(tuner); + } + + m_dongleInserted = true; +} + +void DVBManager::OnDvbDongleRemoved(int adapterId) +{ + for(std::vector::iterator it = m_tuners.begin(); it != m_tuners.end(); ) + { + DvbTunerPtr tuner = (*it); + int id = tuner->GetId(); + if (id == adapterId) + { + it = m_tuners.erase(it); + } + else + { + ++it; + } + } + + m_dongleInserted = false; +} + +void DVBManager::Stop() +{ + CSingleLock lock(m_lock); + m_tuners.clear(); + m_channels.Clear(); + m_epgServerLoader.StopThread(); + + m_bIsRunning = false; +} + +bool DVBManager::StartScan() +{ + CSingleLock lock(m_lock); + + foreach (DvbTunerPtr tuner, m_tuners) + { + if (tuner->GetTunerState() == DvbTuner::TUNER_IDLE) + { + m_scanningTuner = tuner; // hold a reference until scan is over + tuner->SetCountry(g_guiSettings.GetString("ota.countrycode")); + if (g_guiSettings.GetString("ota.countrycode") == "US" || + g_guiSettings.GetString("ota.countrycode") == "CA") + { + if (g_guiSettings.GetBool("ota.selectedcable")) + tuner->SetModulationType(DvbTuner::QAM); + else + tuner->SetModulationType(DvbTuner::VSB); + } + else if (tuner->GetTunerType() == DvbTuner::TUNER_TYPE_ATSC) + { + tuner->SetModulationType(DvbTuner::VSB); + } + else + { + tuner->SetModulationType(DvbTuner::OFDM); + } + tuner->AddListener(this); + tuner->StartScan(); + return true; + } + } + + return false; +} + +bool DVBManager::CancelScan() +{ + if (!IsScanning()) + return true; + + m_scanningTuner->CancelScan(); + + return true; +} + +bool DVBManager::IsScanning() +{ + return (m_scanningTuner.use_count() > 0); +} + +void DVBManager::OnScanFinished(DvbScanner::ScanState result, const CStdString& channelsFile) +{ + CLog::Log(LOGINFO, "DVBManager::OnScanFinished: result=%d", result); + + m_scanningTuner->RemoveListener(this); + + // In case of invalid scan.. + if (result != DvbScanner::SCAN_DONE) + { + return; + } + + // When scanning complete, load channels and show a message + m_channels.LoadScannedChannels(); + +#ifdef HAS_SERVER_OTA + if (!m_channels.SaveChannelsToServer()) + { + CLog::Log(LOGERROR, "Error storing at server"); + return; + } +#endif + + if (m_channels.Size() > 0) + { + SetCurrentChannel(m_channels.GetChannelByIndex(0)); + m_epgServerLoader.RequestLoad(); + + g_guiSettings.SetBool("ota.scanned", true); + g_settings.Save(); + } +} + +unsigned int DVBManager::GetScanPercent() +{ + // If not scanning, it's empty + if (!IsScanning()) + { + return 0; + } + + // If scanning is done, show progress bar full + if (m_scanningTuner->GetScanState() == DvbScanner::SCAN_DONE) + { + return 100; + } + + // Scanning that we can count will be up to 80%. The remaining 20% is for getting the channel names, and we can't know it in advance. + int percent = (int) (((float) m_scanningTuner->GetCurrentFrequencyScanCount()) / m_scanningTuner->GetTotalFrequencyScanCount() * 50.0f); + + if (m_scanningTuner->IsInitialScanDone()) + { + percent += (int) (((float) m_scanningTuner->GetCurrentFoundFrequencyCount()) / m_scanningTuner->GetTotalFoundFrequencyCount() * 50.0f); + } + + return percent; +} + +DvbScanner::ScanState DVBManager::GetScanState() +{ + if (m_scanningTuner.get() == NULL) + { + return DvbScanner::SCAN_NOT_RUNNING; + } + + return m_scanningTuner->GetScanState(); +} + +bool DVBManager::IsTuned() +{ + if (m_tuners.size() == 0) + return false; + + bool result = (m_tuners[0]->GetTuningState() == DvbTuner::TUNING_STATE_TUNED); +// printf("DVBManager::IsTuned: %d state is %d \n", result, (int) m_tuners[0]->GetTuningState()); + return result; +} + +bool DVBManager::IsTuning() +{ + if (m_tuners.size() == 0) + return false; + + bool result = (m_tuners[0]->GetTuningState() == DvbTuner::TUNING_STATE_TUNING || + m_tuners[0]->GetTuningState() == DvbTuner::TUNING_STATE_TUNING_PROGRAM); +// printf("DVBManager::IsTuning: %d\n", result); + return result; +} + +bool DVBManager::IsTuningFailed() +{ + if (m_tuners.size() == 0) + return false; + + bool result = (m_tuners[0]->GetTuningState() == DvbTuner::TUNING_STATE_TUNE_FAILED); +// printf("DVBManager::IsTuningFailed: %d\n", result); + return result; +} + +bool DVBManager::IsSignalOk() +{ + if (m_tuners.size() == 0) + return false; + + bool result = (m_tuners[0]->IsSignalOk()); +// printf("DVBManager::IsSignalOk: %d\n", result); + return result; +} + +void DVBManager::OnEpgNewInfo(const DvbEpgInfo& info) +{ + /* Find the channel for this epg data */ + CStdString channelId; + DvbChannelPtr ch = m_channels.GetChannelByDvbTriplet(info.networkId, info.tsId, info.serviceId); + if (ch.get() == NULL) + { + // We cannot find by dvb triplet. let's try by service id only... + ch = m_channels.GetChannel(info.serviceId); + if (ch.get() == NULL) + { + CLog::Log(LOGERROR, "OnEpgNewInfo: cannot find channel for epg info: on=%d s=%d ts=%d\n", info.networkId, info.serviceId, info.tsId); + return; + } + + channelId = ch->GetServiceName(); + } + else + { + channelId = ch->GetDvbTriplet(); + } + + void* tx = NULL; + try + { + /* Add events */ + tx = EpgStore::GetInstance().StartEventsTransaction(); + + foreach (DvbEpgEvent e, info.events) + { + CStdString idStr; + idStr.Format("%d", e.id); + + EpgProgramInfo info; + info.id = idStr; + info.channelId = channelId; + info.start = e.startTime; + info.end = e.startTime + e.duration; + info.title = e.name; + info.synopsis = e.text + "\n" + e.extra; + info.rating = e.rating; + + EpgStore::GetInstance().InsertEvent(tx, EPG_SOURCE_ID_OTA, info); + } + + EpgStore::GetInstance().CommitEventsTransaction(tx); + } + catch (std::exception& ex) + { + if (tx) + EpgStore::GetInstance().RollbackEventsTransaction(tx); + } +} + +bool DVBManager::ReportCurrentChannelToServerInBG() +{ +#ifdef HAS_SERVER_OTA + DvbChannelPtr currentChannel = DVBManager::GetInstance().GetCurrentChannel(); + if (!currentChannel.get()) + return false; + + std::string url = BXConfiguration::GetInstance().GetStringParam("Boxee.ReportWatchedProgram", "http://app.boxee.tv/epg/watch"); + + std::string body = ""; + if (!currentChannel->GetServerId().IsEmpty()) + { + body += "channel_id="; + body += BXUtils::URLEncode(currentChannel->GetServerId()); + } + else if (!currentChannel->GetServiceName().IsEmpty()) + { + body += "service="; + body += BXUtils::URLEncode(currentChannel->GetServiceName()); + } + else + { + // There's no id -- nothing really to report + return false; + } + + // Append: country, zip code and provider id, if we know them + body += "&country="; + body += g_guiSettings.GetString("ota.countrycode"); + + if (!g_guiSettings.GetString("ota.zipcode").IsEmpty()) + { + body += "&postal_code="; + body += g_guiSettings.GetString("ota.zipcode"); + } + + CLog::Log(LOGINFO, "Notify watch to server: url=[%s] body=[%s]", url.c_str(), body.c_str()); + + std::string response; + int retCode; + + if (!BXUtils::PerformPostRequestInBG(url, body, response, retCode, true)) + { + CLog::Log(LOGERROR, "error reporting watched to server. Return code: %d", retCode); + return false; + } +#endif + + return true; +} + +void DVBManager::SetCurrentChannel(DvbChannelPtr channel) +{ + CSingleLock lock(m_lockCurrentProgram); + + m_currentChannel = channel; + m_currentProgram.Clear(); + m_lastEpgCheckTime = 0; + + if (m_currentChannel.get() == NULL) + return; + + CStdString id = m_currentChannel->GetChannelId(); + if (id.IsEmpty()) + return; + + std::vector infos = EpgStore::GetInstance().QueryByChannelNow(id); + if (infos.size() == 0) + return; + + m_currentProgram.isNow = true; + m_currentProgram.info = infos[0]; + EpgStore::GetInstance().GetChannelSocialInfo(m_currentProgram.info.id, m_currentChannel->GetServiceName(), m_currentProgram.social); +} + +LiveTvModelProgram DVBManager::GetCurrentProgram() +{ + CSingleLock lock(m_lockCurrentProgram); + + time_t now = time(NULL); + + if (now - m_lastEpgCheckTime > 60) + { + m_lastEpgCheckTime = now; + + m_currentProgram.Clear(); + + CStdString id = m_currentChannel->GetChannelId(); + if (id.IsEmpty()) + return m_currentProgram; + + std::vector infos = EpgStore::GetInstance().QueryByChannelNow(id); + if (infos.size() == 0) + return m_currentProgram; + + m_currentProgram.isNow = true; + m_currentProgram.info = infos[0]; + EpgStore::GetInstance().GetChannelSocialInfo(m_currentProgram.info.id, m_currentChannel->GetServiceName(), m_currentProgram.social); + } + + return m_currentProgram; +} + +#endif diff --git a/xbmc/cores/dvb/dvbmanager.h b/xbmc/cores/dvb/dvbmanager.h new file mode 100644 index 00000000..2e39afe9 --- /dev/null +++ b/xbmc/cores/dvb/dvbmanager.h @@ -0,0 +1,83 @@ +#ifndef DVBMANAGER_H +#define DVBMANAGER_H + +#include "system.h" + +#ifdef HAS_DVB + +#include +#include "dvbtuner.h" +#include "dvbchannels.h" +#include "epgserverloader.h" +#include "epgstore.h" +#include "LiveTvModel.h" + +class DVBManager : public IDvbStreamListener, public IDvbEpgListener +{ + +public: + static DVBManager &GetInstance(); + + bool Start(); + void Stop(); + + bool StartScan(); + bool CancelScan(); + bool IsScanning(); + unsigned int GetScanPercent(); // between 0-100 + DvbScanner::ScanState GetScanState(); + + virtual void OnScanFinished(DvbScanner::ScanState result, const CStdString& channelsFile); + void ClearScanner(); + + DvbChannelPtr GetCurrentChannel() { return m_currentChannel; } + void SetCurrentChannel(DvbChannelPtr channel); + + std::vector GetTuners() { return m_tuners; } + DvbChannels& GetChannels() { return m_channels; } + + bool IsTuning(); + bool IsTuned(); + bool IsTuningFailed(); + bool IsSignalOk(); + + void OnDvbDongleInserted(); + void OnDvbDongleReady(int adapterId); + void OnDvbDongleRemoved(int adapterId); + + virtual void OnEpgNewInfo(const DvbEpgInfo& info); + + bool LoadResolvedChannels(); + bool SaveResolvedChannels(); + bool ResolveChannels(CStdString providerName); + + bool IsDongleInserted() { return m_dongleInserted; } + + EpgServerLoader& GetEpgServerLoader() { return m_epgServerLoader; } + bool ReportCurrentChannelToServerInBG(); + + LiveTvModelProgram GetCurrentProgram(); + +protected: + DVBManager(); + + typedef std::map DvbEpgEvents; + + CCriticalSection m_lock; + CCriticalSection m_lockCurrentProgram; + DvbTunerPtr m_scanningTuner; // keep a reference for the scanner to prevent it being deleted in the middle + std::vector m_tuners; + DvbChannels m_channels; + EpgServerLoader m_epgServerLoader; + DvbChannelPtr m_currentChannel; + LiveTvModelProgram m_currentProgram; + bool m_bIsRunning; + bool m_dongleInserted; + + time_t m_lastEpgCheckTime; + time_t m_lastTechnicalDataCheckTime; +}; + +#endif + +#endif // DVBMANAGER_H diff --git a/xbmc/cores/dvb/dvbpatloader.cpp b/xbmc/cores/dvb/dvbpatloader.cpp new file mode 100644 index 00000000..192dee08 --- /dev/null +++ b/xbmc/cores/dvb/dvbpatloader.cpp @@ -0,0 +1,115 @@ +#include "dvbpatloader.h" + +#if defined(HAS_DVB) && defined(_LINUX) && !defined(__APPLE__) + +#include "StdString.h" + +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include "Util.h" +#include +#include +#include +#include +#include +#include +#include +#include + +void AddPidToFilter(int fd, int pid, int type) +{ + struct dmx_pes_filter_params filter; + + if (pid < 0 || pid >= 0x1fff || (pid == 0 && type != DMX_PES_OTHER)) + return ; + + ioctl(fd, DMX_SET_BUFFER_SIZE, 128 * 1024); + + filter.pid = pid; + filter.input = DMX_IN_FRONTEND; + filter.output = DMX_OUT_TS_TAP; + filter.pes_type = (dmx_pes_type_t) type; + filter.flags = DMX_IMMEDIATE_START; + + if (ioctl(fd, DMX_SET_PES_FILTER, &filter) < 0) + { + printf("V4LHelper::AddPidToFilter: failed to add pid %d to filter. %s", pid, strerror(errno)); + } + else + { + printf("V4LHelper::AddPidToFilter: Successfully added pid %d to the filter", pid); + } +} + +static void PATCallBack(void *p_cb_data, dvbpsi_pat_t* p_pat) +{ + dvbpsi_pat_program_t* p_program = p_pat->p_first_program; + DvbPatLoader* patLoader = (DvbPatLoader*)p_cb_data; + printf( "\n"); + printf( "New PAT\n"); + printf( " transport_stream_id : %d\n", p_pat->i_ts_id); + printf( " version_number : %d\n", p_pat->i_version); + printf( " | program_number @ [NIT|PMT]_PID\n"); + + //AddPidToFilter(patLoader->m_fd, p_program->i_pid, DMX_PES_OTHER); + + while(p_program) + { + + printf(" | %14d @ 0x%x (%d)\n", + p_program->i_number, p_program->i_pid, p_program->i_pid); + p_program = p_program->p_next; + + } + printf( " active : %d\n", p_pat->b_current_next); + + dvbpsi_DeletePAT(p_pat); +} + +DvbPatLoader::DvbPatLoader() +{ + m_dvbpsi = dvbpsi_AttachPAT(PATCallBack, this); + m_fd = -1; +} + +void DvbPatLoader::Open() +{ + CStdString demuxPath; + demuxPath.Format("/dev/dvb/adapter0/demux0"); + + m_fd = open(demuxPath.c_str(), O_RDWR); +} + +void DvbPatLoader::Close() +{ + if(m_fd > 0) + close(m_fd); + + m_fd = -1; +} + +bool DvbPatLoader::ProcessPacket(uint8_t* data) +{ + uint16_t i_pid = ((uint16_t) (data[1] & 0x1f) << 8) + data[2]; + if (i_pid == 0x0) + { + dvbpsi_PushPacket(m_dvbpsi, data); + return true; + } +} + +#elif defined(__APPLE__) && defined(HAS_DVB) + +DvbPatLoader::DvbPatLoader() +{ +} +#endif diff --git a/xbmc/cores/dvb/dvbpatloader.h b/xbmc/cores/dvb/dvbpatloader.h new file mode 100644 index 00000000..afc518c6 --- /dev/null +++ b/xbmc/cores/dvb/dvbpatloader.h @@ -0,0 +1,30 @@ +#pragma once + +#include "system.h" + +#ifdef HAS_DVB + +#include +#include "StdString.h" + +struct dvbpsi_decoder_s; + +class DvbPatLoader +{ +public: + DvbPatLoader(); + ~DvbPatLoader() {} + + void Open(); + void Close(); + + bool ProcessPacket(uint8_t* data); + + + int m_fd; +private: + struct dvbpsi_decoder_s * m_dvbpsi; + +}; + +#endif diff --git a/xbmc/cores/dvb/dvbtuner.cpp b/xbmc/cores/dvb/dvbtuner.cpp new file mode 100644 index 00000000..55504886 --- /dev/null +++ b/xbmc/cores/dvb/dvbtuner.cpp @@ -0,0 +1,455 @@ +#include "utils/log.h" +#include "Util.h" +#include "dvbtuner.h" +#include +#include +#include "SpecialProtocol.h" +#include "RegExp.h" +#include "dvbepgloader.h" +#include +#include "SingleLock.h" + +#ifdef HAS_DVB + +#include "v4lhelper.h" + +DvbScanner::DvbScanner(DvbTuner* tuner) : m_tuner(tuner) +{ + pthread_mutex_init(&m_condLock, NULL); + pthread_cond_init(&m_scannerStarted, NULL); + + m_totalFreqCount = 0; + m_currentFreqCount = 0; + + SetState(SCAN_NOT_RUNNING); +} + +void DvbScanner::Process() +{ + m_totalFreqCount = 0; + m_currentFreqCount = 0; + m_totalFoundFreqCount = 0; + m_currentFoundFreqCount = 0; + m_initalScanDone = false; + + SetState(SCAN_STARTING); + + CStdString cmd; + FILE* f; + char szBuffer[1024]; + + CStdString frontendTypeStr = "t"; + switch (m_tuner->GetModulationType()) + { + case DvbTuner::VSB: + frontendTypeStr = "a -A 1"; + break; + case DvbTuner::QAM: + frontendTypeStr = "a -A 2"; + break; + case DvbTuner::OFDM: + case DvbTuner::UNKNOWN_MODULATION: + frontendTypeStr = "t"; + break; + } + + // First, do dry run + cmd.Format("special://xbmc/w_scan -f %s -c %s -o7 -t3 -X -a %d -C UTF-8 -d", frontendTypeStr.c_str(), m_tuner->GetCountry(), m_tuner->GetId()); + cmd = _P(cmd); + + CLog::Log(LOGDEBUG, "DvbScanner::Process: dry run of w_scan: %s", cmd.c_str()); + + f = popen(cmd.c_str(), "r"); + if (!f) + { + CLog::Log(LOGERROR, "DvbScanner::Process: dry run failed: %s", strerror(errno)); + SetState(SCAN_FAILED); + pthread_cond_broadcast(&m_scannerStarted); + m_tuner->OnScannerDone(); + return; + } + + while (!feof(f) && !m_bStop) + { + fgets(szBuffer, sizeof(szBuffer), f); + CLog::Log(LOGDEBUG, "DvbScanner::Process: dry run output: %s", szBuffer); + if (strncmp(szBuffer, "COUNT:", 6) == 0) + { + sscanf(szBuffer, "COUNT: %d", &m_totalFreqCount); + CLog::Log(LOGDEBUG, "DvbTuner: scanner (dry-run), found: %d frequencies", m_totalFreqCount); + break; + } + } + + pclose(f); + + // sometimes real scan fails due unusable/locked frontend device + // sleep here to make sure that dry scan frees frontend's resources + Sleep(500); + + printf("\nDRY RUN COUNT: %d\n", m_totalFreqCount); + + if (m_bStop) + { + CLog::Log(LOGINFO, "DvbScanner::Process: scan canceled"); + SetState(SCAN_CANCELED); + pthread_cond_broadcast(&m_scannerStarted); + m_tuner->OnScannerDone(); + return; + } + + if (m_totalFreqCount == 0) + { + CLog::Log(LOGERROR, "DvbScanner::Process: dry run failed since no frequecies were found"); + SetState(SCAN_FAILED); + pthread_cond_broadcast(&m_scannerStarted); + m_tuner->OnScannerDone(); + return; + } + + CStdString channelsFile = _P("special://home/dvb/channels.conf"); + + cmd.Format("special://xbmc/w_scan -f %s -c %s -o7 -t3 -X -a %d -C UTF-8 -E0 -R0 -g '%s' 2>&1", frontendTypeStr.c_str(), m_tuner->GetCountry(), m_tuner->GetId(), channelsFile.c_str()); + cmd = _P(cmd); + + CLog::Log(LOGDEBUG, "DvbScanner::Process: real run of w_scan: %s", cmd.c_str()); + + f = popen(cmd.c_str(), "r"); + if (!f) + { + CLog::Log(LOGERROR, "DvbScanner::Process: real run failed: %s", strerror(errno)); + SetState(SCAN_FAILED); + pthread_cond_broadcast(&m_scannerStarted); + m_tuner->OnScannerDone(); + return; + } + + SetState(SCAN_RUNNING); + + pthread_cond_broadcast(&m_scannerStarted); + + CRegExp regScanFreq; + regScanFreq.RegComp("[0-9]+: .*\\(time: .*\\)"); + + CRegExp regFreqTune; + regFreqTune.RegComp("tune to:.+f=[0-9]+"); + + CRegExp regFreqFound; + regFreqFound.RegComp("f=[0-9]+"); + + while (!feof(f) && !m_bStop) + { + printf("DvbScanner::Process: real run output: %s\n", szBuffer); + CLog::Log(LOGDEBUG, "DvbScanner::Process: real run output: %s", szBuffer); + fgets(szBuffer, sizeof(szBuffer), f); + + if (regScanFreq.RegFind(szBuffer) != -1) + { + m_currentFreqCount++; + printf("**** LIVE COUNT: %d\n", m_currentFreqCount); + } + + if (regFreqTune.RegFind(szBuffer) != -1) + { + m_initalScanDone = true; + m_currentFoundFreqCount++; + printf("**** CURRENT FREQ COUNT: %d\n", m_currentFoundFreqCount); + } + else if (regFreqFound.RegFind(szBuffer) != -1) + { + m_totalFoundFreqCount++; + printf("**** TOTAL FREQ COUNT: %d\n", m_totalFoundFreqCount); + } + } + + if (m_bStop) + { + system("pkill w_scan"); + } + + pclose(f); + + if (m_bStop) + { + CLog::Log(LOGINFO, "DvbScanner::Process: scan canceled"); + SetState(SCAN_CANCELED); + } + else + { + SetState(SCAN_DONE); + } + + m_tuner->OnScannerDone(); +} + +void DvbScanner::WaitForStarted() +{ + pthread_cond_wait(&m_scannerStarted, &m_condLock); +} + +void DvbScanner::Stop(bool bWait) +{ + m_bStop = true; +} + +void DvbScanner::SetState(ScanState state) +{ + CSingleLock lock(m_statusLock); + m_state = state; +} + +DvbScanner::ScanState DvbScanner::GetState() +{ + CSingleLock lock(m_statusLock); + return m_state; +} + +DvbTuner::DvbTuner(int id, IDvbEpgListener* epgListener, int flags) +{ + m_state = TUNER_IDLE; + m_id = id; + m_modulationType = UNKNOWN_MODULATION; + m_country = ""; + m_running = false; + m_scanner = new DvbScanner(this); + m_currChannel = ""; + m_drvLocked = false; + m_v4l = NULL; + +#if defined(_LINUX) && !defined(__APPLE__) + m_v4l = new V4LHelper(id, flags); +#endif + +#if !defined(__APPLE__) + if (epgListener) + m_epgLoader.AddListener(epgListener); +#endif + + pthread_mutex_init(&m_condLock, NULL); + pthread_mutex_init(&m_listenersLock, NULL); + pthread_cond_init(&m_threadStarted, NULL); +} + +DvbTuner::~DvbTuner() +{ + pthread_mutex_destroy(&m_condLock); + pthread_mutex_destroy(&m_listenersLock); + pthread_cond_destroy(&m_threadStarted); + + if (m_v4l) + delete m_v4l; + + if (m_scanner) + delete m_scanner; +} + +void DvbTuner::AddListener(IDvbStreamListener *alistener) +{ + pthread_mutex_lock(&m_listenersLock); + bool bExists = false; + + foreach (IDvbStreamListener* listener, m_listeners) + { + if (alistener == listener) + { + bExists = true; + break; + } + } + + if (!bExists) + m_listeners.push_back(alistener); + + pthread_mutex_unlock(&m_listenersLock); +} + +void DvbTuner::RemoveListener(IDvbStreamListener *listener) +{ + pthread_mutex_lock(&m_listenersLock); + m_listeners.remove(listener); + pthread_mutex_unlock(&m_listenersLock); +} + +bool DvbTuner::StartScan() +{ + if (m_country.length() == 0) + { + CLog::Log(LOGDEBUG, "DvbTuner: no country specified, aborting"); + return false; + } + + if (m_v4l) + m_v4l->Stop(); // we have to close the helper so that the device (frontend) will be available + + m_scanner->Create(); + m_scanner->WaitForStarted(); + + if (m_scanner->GetState() != DvbScanner::SCAN_RUNNING) + return false; + + m_state = TUNER_SCANNING; + + CLog::Log(LOGDEBUG, "DvbTuner: scanner started"); + + return true; +} + +void DvbTuner::CancelScan() +{ + m_scanner->Stop(false); + m_state = TUNER_IDLE; +} + +void DvbTuner::OnScannerDone() +{ + CLog::Log(LOGINFO, "DvbTuner::OnScannerDone: scanner done"); + + CStdString channelsFile = _P("special://home/dvb/channels.conf"); + + pthread_mutex_lock(&m_listenersLock); + std::list tempListeners = m_listeners; + pthread_mutex_unlock(&m_listenersLock); + + foreach (IDvbStreamListener* listener, tempListeners) + { + listener->OnScanFinished(m_scanner->GetState(), channelsFile); + } + + m_state = TUNER_IDLE; +} + +int DvbTuner::GetCurrentFrequencyScanCount() +{ + return m_scanner->GetCurrentFrequencyCount(); +} + +bool DvbTuner::IsInitialScanDone() +{ + return m_scanner->IsInitialScanDone(); +} + +int DvbTuner::GetCurrentFoundFrequencyCount() +{ + return m_scanner->GetCurrentFoundFrequencyCount(); +} + +int DvbTuner::GetTotalFoundFrequencyCount() +{ + return m_scanner->GetTotalFoundFrequencyCount(); +} + +int DvbTuner::GetTotalFrequencyScanCount() +{ + return m_scanner->GetTotalFrequencyCount(); +} + +DvbScanner::ScanState DvbTuner::GetScanState() const +{ + return m_scanner->GetState(); +} + +bool DvbTuner::Tune(const DvbChannel &channel) +{ + if (m_state == TUNER_SCANNING) + { + return false; + } + + if (m_v4l && !m_v4l->Tune(channel)) + { + CLog::Log(LOGERROR, "tuning failed\n"); + return false; + } + + m_state = TUNER_IDLE; + if (m_running) + { + m_running = false; +#ifndef __APPLE__ + wait(); // the thread will call NotifyStreamClosed +#endif + } + + m_currChannel.clear(); + m_currChannel = channel.GetServiceName(); + + return true; +} + +void DvbTuner::Untune() +{ + if (m_state == TUNER_SCANNING) + { + return; + } + + if (m_v4l) + { + m_v4l->Stop(); + } +} + +DvbTuner::TunerType DvbTuner::GetTunerType() +{ + if (m_v4l) + { + return m_v4l->GetTunerType(m_id); + } + + return TUNER_TYPE_UNKNOWN; +} + +int DvbTuner::Read(char *buf, int size) +{ + if (m_v4l) + return m_v4l->Read(buf, size); + + return -1; +} + +DvbTuner::TuningState DvbTuner::GetTuningState() const +{ + if (m_v4l) + return m_v4l->GetTuningState(); + return TUNING_STATE_IDLE; +} + +bool DvbTuner::IsSignalOk() +{ + if (m_v4l) + return m_v4l->IsSignalOk(); + return true; +} + +void DvbTuner::AddPidFilter(int pid, DvbTuner::DvbFilter type) +{ + if (m_v4l) + m_v4l->AddPidFilter(pid, type); +} + +void DvbTuner::RemovePidFilter(int pid) +{ + if (m_v4l) + m_v4l->RemovePidFilter(pid); +} + +void DvbTuner::RemoveAllPidFilters() +{ + if (m_v4l) + m_v4l->RemoveAllPidFilters(); +} + +DvbTunerTechnicalInfo DvbTuner::GetTechnicalInfo() +{ + return m_v4l->GetTechnicalInfo(); +} + +int DvbTuner::GetTuneFlags() +{ + if (m_v4l) + return m_v4l->GetFlags(); + else + return 0; +} + +#endif diff --git a/xbmc/cores/dvb/dvbtuner.h b/xbmc/cores/dvb/dvbtuner.h new file mode 100644 index 00000000..557b7234 --- /dev/null +++ b/xbmc/cores/dvb/dvbtuner.h @@ -0,0 +1,158 @@ +#ifndef BXTUNER_H +#define BXTUNER_H + +#include "system.h" + +#ifdef HAS_DVB + +#include + +#include "dvbchannel.h" +#include "FileSystem/File.h" +#include "FileSystem/IFile.h" +#include "Thread.h" +#include +#include "dvbepgloader.h" +#include "dvbpatloader.h" + +using namespace XFILE; + +#define TUNER_FLAGS_BUDGET 0x0001 // use PID 0x200 to stream all PIDs +#define TUNER_FLAGS_FORCE_TUNE 0x0002 // force re-tune even if using the same frequency + +class IDvbHelper; +class DvbTuner; + +class DvbScanner : public CThread +{ +public: + typedef enum { SCAN_NOT_RUNNING, SCAN_STARTING, SCAN_RUNNING, SCAN_FAILED, SCAN_DONE, SCAN_CANCELED } ScanState; + + DvbScanner(DvbTuner* tuner); + virtual void Process(); + void WaitForStarted(); + void Stop(bool bWait); + int GetCurrentFrequencyCount() { return m_currentFreqCount; } + int GetTotalFrequencyCount() { return m_totalFreqCount; } + bool IsInitialScanDone() { return m_initalScanDone; } + int GetCurrentFoundFrequencyCount() { return m_currentFoundFreqCount; } + int GetTotalFoundFrequencyCount() { return m_totalFoundFreqCount; } + ScanState GetState(); + +private: + void SetState(ScanState state); + + ScanState m_state; + DvbTuner* m_tuner; + int m_totalFreqCount; + int m_currentFreqCount; + bool m_initalScanDone; + int m_totalFoundFreqCount; + int m_currentFoundFreqCount; + CCriticalSection m_statusLock; + + pthread_mutex_t m_condLock; + pthread_cond_t m_scannerStarted; +}; + +class IDvbStreamListener +{ +public: + IDvbStreamListener() {} + virtual ~IDvbStreamListener() {} + + virtual void OnScanFinished(DvbScanner::ScanState result, const CStdString& channelsFile) = 0; +}; + +struct DvbTunerTechnicalInfo +{ + unsigned int signal; + unsigned int snr; + unsigned int ber; + unsigned int ucb; + unsigned int fe_status; +}; + +class DvbTuner +{ +public: + typedef enum { TUNER_IDLE, TUNER_SCANNING, TUNER_TUNED } TunerState; + typedef enum { TUNER_TYPE_UNINITIALIZED, TUNER_TYPE_DVBT, TUNER_TYPE_ATSC, TUNER_TYPE_UNKNOWN } TunerType; // DVBT - Europe + typedef enum { OFDM, QAM, VSB, UNKNOWN_MODULATION } ModulationType; // OFDM -- DVB-T, QAM - cable hooked up, VSB - antenna + typedef enum { TUNING_STATE_IDLE, TUNING_STATE_TUNING, TUNING_STATE_TUNING_PROGRAM, TUNING_STATE_TUNED, TUNING_STATE_TUNE_FAILED } TuningState; + typedef enum { DVB_FILTER_VIDEO, DVB_FILTER_AUDIO, DVB_FILTER_OTHER } DvbFilter; + + DvbTuner(int id, IDvbEpgListener* epgListener = NULL, int flags = 0); + virtual ~DvbTuner(); + + int GetId() const { return m_id; } + void SetId(int id) { m_id = id; } + + TunerState GetTunerState() const { return m_state; } + TuningState GetTuningState() const; + bool IsSignalOk(); + + CStdString GetCountry() const { return m_country; } + void SetCountry(const CStdString &cc) { m_country = cc; } + + bool Tune(const DvbChannel &channel); + void Untune(); + CStdString GetChannel() const { return m_currChannel; } + + void AddListener(IDvbStreamListener *listener); + void RemoveListener(IDvbStreamListener *listener); + int Listeners() const { return m_listeners.size(); } + + TunerType GetTunerType(); + ModulationType GetModulationType() const { return m_modulationType; } + void SetModulationType(ModulationType type) { m_modulationType = type; } + + void ScanFinished(bool bOk); + + bool StartScan(); + void CancelScan(); + DvbScanner::ScanState GetScanState() const; + void OnScannerDone(); + + int GetCurrentFrequencyScanCount(); + int GetTotalFrequencyScanCount(); + bool IsInitialScanDone(); + int GetCurrentFoundFrequencyCount(); + int GetTotalFoundFrequencyCount(); + + int Read(char *buf, int size); + + void AddPidFilter(int pid, DvbTuner::DvbFilter type); + void RemovePidFilter(int pid); + void RemoveAllPidFilters(); + + DvbTunerTechnicalInfo GetTechnicalInfo(); + + int GetTuneFlags(); + +protected: + int m_id; + bool m_running; + bool m_drvLocked; + TunerState m_state; + ModulationType m_modulationType; + CStdString m_country; + CStdString m_currChannel; + DvbEpgLoader m_epgLoader; + DvbPatLoader m_patLoader; + + IDvbHelper *m_v4l; + + pthread_mutex_t m_condLock; + pthread_cond_t m_threadStarted; + + pthread_mutex_t m_listenersLock; + std::list m_listeners; + DvbScanner *m_scanner; +}; + +typedef boost::shared_ptr DvbTunerPtr; + +#endif + +#endif // BXTUNER_H diff --git a/xbmc/cores/dvb/epgserverloader.cpp b/xbmc/cores/dvb/epgserverloader.cpp new file mode 100644 index 00000000..fe46934a --- /dev/null +++ b/xbmc/cores/dvb/epgserverloader.cpp @@ -0,0 +1,301 @@ + #include "system.h" + +#ifdef HAS_DVB +#include + +#include "epgserverloader.h" +#include "dvbmanager.h" +#include +#include "bxcurl.h" +#include "boxee.h" +#include "bxconfiguration.h" +#include "bxutils.h" +#include "epgstore.h" +#include "../../Util.h" +#include "xbmc/utils/log.h" +#include "Application.h" + +// 24 hours +#define FULL_EPG_PULL_INTERVAL (24 * 60 * 60) + +// 5 Min +#define MAX_SERVER_ACCESS_TIME (5 * 60) + +#define SOCIAL_PULL_INTERVAL (1 * 60) + +EpgServerLoader::EpgServerLoader() +{ + m_lastFullEpgPull = 0; + m_lastSocialPull = 0; + m_requestLoad = false; +} + +void EpgServerLoader::Process() +{ +#ifdef HAS_SERVER_OTA + time_t lastServerAccessTime = 0; + + while (!m_bStop) + { + Sleep(1000); + + if (!g_application.IsConnectedToInternet()) + continue; + + if (!DVBManager::GetInstance().GetChannels().HasChannels()) + continue; + + time_t now = time(NULL); + + lastServerAccessTime = now; + + if (m_requestLoad || m_lastFullEpgPull + FULL_EPG_PULL_INTERVAL < now) + { + PullEPG(); + m_lastFullEpgPull = now; + } + + if (m_requestLoad || (m_epgVisible && m_lastSocialPull + SOCIAL_PULL_INTERVAL < now) || m_lastSocialPull == 0) + { + PullSocial(); + m_lastSocialPull = now; + } + + m_requestLoad = false; + } +#endif +} + +std::string EpgServerLoader::TimeToString(time_t t) +{ + char result[64]; + struct tm *tms = gmtime(&t); + strftime(result, sizeof(result)-1, "%Y-%m-%d%%20%H:%M:%S", tms); + return result; +} + +time_t EpgServerLoader::StringToTime(std::string str) +{ + struct tm tms; + memset(&tms, 0, sizeof(tms)); + strptime(str.c_str(), "%Y-%m-%d %H:%M:%S", &tms); + time_t result = timegm(&tms); + return result; +} + +void EpgServerLoader::NotifyEpgVisibilityChange(bool visible) +{ + m_epgVisible = visible; +} + +bool EpgServerLoader::PullSocial() +{ + CLog::Log(LOGDEBUG, "Pull social"); + + CStdString strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.ApiEpgProgram","http://app.boxee.tv/epg/watch"); + Json::Value jsonValue; + int returnCode; + if (!BOXEE::BXUtils::PerformJSONGetRequest(strUrl, jsonValue, returnCode, false)) + { + CLog::Log(LOGERROR, "Got error return code from server for url: <%s>", strUrl.c_str()); + return false; + } + +#if 0 + printf("Got social:\n"); + Json::StyledWriter writer; + std::string epgStr = writer.write(jsonValue); + printf("%s\n", epgStr.c_str()); +#endif + + if (!jsonValue.isArray()) + { + CLog::Log(LOGERROR, "Error parsing social. Not an array."); + return false; + } + + CLog::Log(LOGINFO, "Pull social ok. got: %d items", jsonValue.size()); + if (jsonValue.size() == 0) + { + return true; + } + + std::vector* allSocialInfo = new std::vector; + + for (Json::ArrayIndex j = 0; j < jsonValue.size(); j++) + { + Json::Value m = jsonValue[j]; + + EpgSocialInfo socialInfo; + + Json::Value friends = m["friends"]; + if (friends != Json::nullValue && friends.isArray()) + { + for (Json::ArrayIndex w = 0; w < friends.size(); w++) + { + Json::Value watcher = friends[w]; + + EpgFriendInfo friendInfo; + friendInfo.firstName = watcher["first_name"].asString(); + friendInfo.lastName = watcher["last_name"].asString(); + friendInfo.name = watcher["name"].asString(); + friendInfo.shortName = watcher["short_name"].asString(); + friendInfo.thumbSmallUrl = watcher["thumb_small"].asString(); + friendInfo.thumbUrl = watcher["thumb"].asString(); + friendInfo.user_id = watcher["user_id"].asString(); + socialInfo.friends.push_back(friendInfo); + } + } + + if (!m["watching"].isNull()) + { + socialInfo.watching = m["watching"].asInt(); + } + +// socialInfo.watching = 12342; +// EpgFriendInfo f; +// f.firstName = "Nimrod"; +// f.thumbSmallUrl = "http://www.boxee.tv/htdocs/images/boxee_logo.png"; +// socialInfo.friends.push_back(f); +// f.firstName = "Alon"; +// f.thumbSmallUrl = "https://secure.gravatar.com/avatar/401c9ea9450926cb7497750aebafd4f3?s=140&d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"; +// socialInfo.friends.push_back(f); + + // Set the label + int numOfFriendsWatching = socialInfo.friends.size(); + switch (numOfFriendsWatching) + { + case 1: + // 1 friend is watching + socialInfo.label.Format("[B][COLOR whiteheidi]%s[/COLOR][/B]", socialInfo.friends[0].firstName.c_str()); + break; + + case 2: + // 2 friend is watching + socialInfo.label.Format("[B][COLOR whiteheidi]%s, %s[/COLOR][/B]", socialInfo.friends[0].firstName.c_str(), + socialInfo.friends[1].firstName.c_str()); + break; + } + + int moreWatching = socialInfo.watching - numOfFriendsWatching; + if (numOfFriendsWatching && moreWatching == 1) + socialInfo.label += " and one other person are watching"; + else if (numOfFriendsWatching && moreWatching > 1) + socialInfo.label.Format("%s and %d others are watching", socialInfo.label.c_str(), moreWatching); + else if (numOfFriendsWatching == 1 && moreWatching == 0) + socialInfo.label.Format("%s is watching", socialInfo.label.c_str()); + else if (numOfFriendsWatching == 2 && moreWatching == 0) + socialInfo.label.Format("%s are watching", socialInfo.label.c_str()); + else if (numOfFriendsWatching == 0 && moreWatching == 1) + socialInfo.label = "One other person is watching"; + else if (numOfFriendsWatching == 0 && moreWatching > 1) + socialInfo.label.Format("%d others are watching", moreWatching); + + if (!m["program_id"].isNull()) + EpgStore::GetInstance().SetChannelSocialInfo(m["program_id"].asString(), socialInfo); + else if (!m["service"].isNull()) + EpgStore::GetInstance().SetChannelSocialInfo(m["service"].asString(), socialInfo); + + allSocialInfo->push_back(socialInfo); + } + + EpgStore::GetInstance().SetSocialInfo(allSocialInfo); + + CLog::Log(LOGDEBUG, "Pull social done"); + + return true; +} + + +bool EpgServerLoader::PullEPG() +{ + CStdString strUrl = BOXEE::BXConfiguration::GetInstance().GetURLParam("Boxee.ApiEpgProgram","http://app.boxee.tv/epg/grid"); + + CLog::Log(LOGINFO, "Pull epg start from URL %s", strUrl.c_str()); + + Json::Value jsonValue; + int returnCode; + if (!BOXEE::BXUtils::PerformJSONGetRequest(strUrl, jsonValue, returnCode, false)) + { + CLog::Log(LOGERROR, "EpgServerLoader::PullEPG: Got error return code from server for url: <%s>", strUrl.c_str()); + return false; + } + + CLog::Log(LOGINFO, "Pull epg complete, parsing response"); + +#if 0 + printf("Got EPG\n"); + Json::StyledWriter writer; + std::string epgStr = writer.write(jsonValue); + printf("%s\n", epgStr.c_str()); +#endif + + if (!jsonValue.isArray()) + { + CLog::Log(LOGERROR, "EpgServerLoader::PullEPG: Error parsing epg. Not array.."); + return false; + } + + if (jsonValue.size() == 0) + { + CLog::Log(LOGERROR, "EpgServerLoader::PullEPG: Error parsing epg. Empty response."); + return true; + } + + CLog::Log(LOGINFO, "Pull epg ok. got: %d items", jsonValue.size()); + + void* tx = NULL; + try + { + tx = EpgStore::GetInstance().StartEventsTransaction(); + + EpgStore::GetInstance().CleanEventsBySource(tx, EPG_SOURCE_ID_SERVER); + + for (Json::ArrayIndex j = 0; j < jsonValue.size(); j++) + { + Json::Value m = jsonValue[j]; + + time_t start = StringToTime(m["start"].asString()); + time_t end = StringToTime(m["end"].asString()); + + CStdString programId; + programId.Format("%s-%lu", m["program_id"].asString().c_str(), start); + + EpgProgramInfo info; + info.id = programId; + info.channelId = m["channel_id"].asString(); + info.start = start; + info.end = end; + info.title = m["title"].asString(); + info.synopsis = m["synopsis"].asString(); + info.rating = m["rating"].asString(); + info.origAirDate = m["orig_airdate"].asString(); + info.seasonNumber = m["season"].asString(); + info.episodeNumber = m["episode"].asString(); + info.thumb = m["thumb"].asString(); + info.isNew = m["new"].asBool(); + info.thumb = m["thumb"].asString(); + info.showRunNumber = m["ep_syn_num"].asString(); + info.episodeTitle = m["ep_title"].asString(); + + EpgStore::GetInstance().InsertEvent(tx, EPG_SOURCE_ID_SERVER, info); + } + + EpgStore::GetInstance().CommitEventsTransaction(tx); + } + catch (std::exception& ex) + { + if (tx) + EpgStore::GetInstance().RollbackEventsTransaction(tx); + + CLog::Log(LOGERROR, "EpgServerLoader::PullEPG: Got exception: %s", ex.what()); + + return false; + } + + CLog::Log(LOGDEBUG, "Pull epg done"); + + return true; +} + +#endif diff --git a/xbmc/cores/dvb/epgserverloader.h b/xbmc/cores/dvb/epgserverloader.h new file mode 100644 index 00000000..b0c76770 --- /dev/null +++ b/xbmc/cores/dvb/epgserverloader.h @@ -0,0 +1,44 @@ +#pragma once + +#include "system.h" + +#ifdef HAS_DVB + +#include "Thread.h" +#include +#include "StdString.h" +#include + +class EpgNotificationListener +{ +public: + virtual ~EpgNotificationListener() {}; + virtual void OnEpgProgramsChange(uint64_t mintime, uint64_t maxtime) = 0; +}; + +class EpgServerLoader : public EpgNotificationListener, public CThread +{ +public: + EpgServerLoader(); + + virtual void Process(); + virtual void OnEpgProgramsChange(uint64_t mintime, uint64_t maxtime) {} + virtual void NotifyEpgVisibilityChange(bool visible); + + void RequestLoad() { m_requestLoad = true; } + +private: + bool PullEPG(); + bool PullSocial(); + std::string TimeToString(time_t t); + time_t StringToTime(std::string str); + + bool m_epgVisible; + bool m_visibilityChange; + bool m_requestLoad; + + time_t m_lastFullEpgPull; + time_t m_lastSocialPull; +}; + +#endif diff --git a/xbmc/cores/dvb/epgstore.cpp b/xbmc/cores/dvb/epgstore.cpp new file mode 100644 index 00000000..c22918b4 --- /dev/null +++ b/xbmc/cores/dvb/epgstore.cpp @@ -0,0 +1,580 @@ +#include "system.h" + +#ifdef HAS_DVB + +#include +#include + +#include "SpecialProtocol.h" +#include "File.h" +#include "Util.h" +#include "utils/log.h" +#include "SingleLock.h" + +#define DB_FILE "special://home/dvb/epg3.sqlite3" +#define DB_FILE_TMP "special://temp/epg3.sqlite3" + +#define DB_FORMAT_VERSION 1 + +#define SYNC_CACHE_INTERVAL_SEC (5 * 60) + +#include +#include "sqlite3pp.h" +#include "epgstore.h" +#include "CharsetConverter.h" + +using namespace XFILE; + +EpgStore &EpgStore::GetInstance() +{ + static EpgStore instance; + return instance; +} + +EpgStore::EpgStore() +{ + CopyFile(_P(DB_FILE), _P(DB_FILE_TMP), false); + + m_db = new sqlite3pp::database; + + CStdString dbFilePath = _P(DB_FILE_TMP); + m_db->connect(dbFilePath.c_str()); + + // Check database + std::string integrityCheckResponse; + sqlite3pp::query qry(*m_db, "PRAGMA integrity_check"); + for (sqlite3pp::query::iterator i = qry.begin(); i != qry.end(); ++i) + { + (*i).getter() >> integrityCheckResponse; + } + + CLog::Log(LOGDEBUG, "EPG database integrity check response: %s", integrityCheckResponse.c_str()); + + if (integrityCheckResponse != "ok") + { + CLog::Log(LOGERROR, "EPG database corrupt, deleting it"); + + m_db->disconnect(); + XFILE::CFile::Delete(DB_FILE); + XFILE::CFile::Delete(DB_FILE_TMP); + + CStdString dbFilePath = _P(DB_FILE_TMP); + m_db->connect(dbFilePath.c_str()); + } + + CreateTables(); + + m_insertEventCmd = new sqlite3pp::command + (*m_db, "INSERT OR REPLACE INTO programs (id, channel_id, source, start_time, end_time, data) " + " VALUES (?, ?, ?, ?, ?, ?)"); + + m_socialInfo = NULL; + + m_hEpgDataEvent = CreateEvent(NULL, false, false, NULL); + + // since we store db file on ramdisk + // we instruct here sqlite not to use cache + // and write transactions directly to file + m_db->execute("PRAGMA cache_size = 0"); + + + Create(); +} + +EpgStore::~EpgStore() +{ + m_bStop = true; + SetEvent(m_hEpgDataEvent); + StopThread(true); + CloseHandle(m_hEpgDataEvent); + + delete m_insertEventCmd; + delete m_db; + + if (m_socialInfo) + delete m_socialInfo; + + CopyFile(_P(DB_FILE_TMP), _P(DB_FILE), false); +} + +void EpgStore::CreateTables() +{ + m_db->execute( + "CREATE TABLE IF NOT EXISTS programs " + "(" + " id VARCHAR(32), " + " channel_id VARCHAR(32), " + " source VARCHAR(16), " + " start_time VARCHAR(32), " + " end_time VARCHAR(32), " + " data VARCHAR(16384)" + ")" + ); + + m_db->execute( + "CREATE INDEX IF NOT EXISTS time_index ON programs " + "(" + " start_time," + " end_time" + ")" + ); + + m_db->execute( + "CREATE INDEX IF NOT EXISTS channel_index ON programs " + "(" + " channel_id" + ")" + ); + + m_db->execute( + "CREATE UNIQUE INDEX IF NOT EXISTS event_index ON programs " + "(" + " channel_id," + " id" + ")" + ); +} + +void* EpgStore::StartEventsTransaction() +{ + return new sqlite3pp::transaction(*m_db); +} + +void EpgStore::CommitEventsTransaction(void* transaction) +{ + sqlite3pp::transaction* t = (sqlite3pp::transaction*) transaction; + if (t) + { + t->commit(); + delete t; + } +} + +void EpgStore::RollbackEventsTransaction(void* transaction) +{ + sqlite3pp::transaction* t = (sqlite3pp::transaction*) transaction; + + if (t) + { + t->rollback(); + delete t; + } +} + +CStdString EpgStore::CleanDescription(const CStdString& strDescription) +{ + CStdString description = strDescription; + + description.Replace(" ", " "); + + while (description.Find("<") != -1) + { + int start = description.Find("<"); + int end = description.Find(">"); + if (end > start) + description.Delete(start, end-start+1); + else + description.Delete(start, description.GetLength() - start); + } + description.Trim(); + + description.Replace("\\&", "&"); + description.Replace(""", "\""); + description.Replace("&", "&"); + description.Replace(" ", " "); + description.Replace(">", ">"); + description.Replace("<", "<"); + + int i; + while ((i = description.Find("&#")) >= 0) + { + CStdString src = "&#"; + int radix = 10; + + i += 2; + if (description[i] == 'x' || description[i] == 'X') + { + src += description[i]; + i++; + radix = 16; + } + + CStdString numStr; + unsigned long num; + while (description[i] != ';' && numStr.length() <= 6) + { + numStr += description[i]; + src += description[i]; + i++; + } + + // doesn't make sense....abort + if (numStr.length() > 6) + { + break; + } + + src += ';'; + char* end; + + if (numStr.IsEmpty()) + break; + + num = strtoul(numStr.c_str(), &end, radix); + + // doesn't make sense....abort + if (num == 0) + { + break; + } + + CStdStringW utf16; + utf16 += (wchar_t) num; + CStdStringA utf8; + g_charsetConverter.wToUTF8(utf16, utf8); + description.Replace(src, utf8); + } + + return description; +} + +void EpgStore::InsertEvent(void* transaction, CStdString source, EpgProgramInfo info) +{ + CStdString myTitle = info.title; + myTitle.Trim(); + CStdString mySynopsis = info.synopsis; + mySynopsis.Trim(); + + Json::Value result; + result["title"] = CleanDescription(myTitle); + result["synopsis"] = CleanDescription(mySynopsis); + if (info.rating.length()) + result["rating"] = info.rating; + if (info.origAirDate.length()) + result["orig_airdate"] = info.origAirDate; + if (info.seasonNumber.length()) + result["season_num"] = info.seasonNumber; + if (info.episodeNumber.length()) + result["episode_num"] = info.episodeNumber; + if (info.thumb.length()) + result["thumb"] = info.thumb; + if (info.showRunNumber.length()) + result["show_num"] = info.showRunNumber; + if (info.episodeTitle.length()) + result["episode_title"] = CleanDescription(info.episodeTitle); + result["new"] = info.isNew; + + Json::FastWriter writer; + CStdString data = writer.write(result); + + CSingleLock lock(m_lock); + + m_insertEventCmd->binder() << info.id << info.channelId << source << (sqlite3_int64) info.start << (sqlite3_int64) info.end << data; + m_insertEventCmd->execute(); + m_insertEventCmd->reset(); +} + +void EpgStore::CleanOldEvents(void* transaction) +{ + time_t now = time(NULL); + + CSingleLock lock(m_lock); + + CStdString sql; + sql.Format("DELETE FROM programs WHERE end_time < %lu", now); + sqlite3pp::command cmd(*m_db, sql.c_str()); + cmd.execute(); +} + +void EpgStore::CleanEventsByTimeAndSource(void* transaction, const CStdString& source, const uint64_t start, const uint64_t end) +{ + CSingleLock lock(m_lock); + + CStdString sql; + sql.Format("DELETE FROM programs WHERE start_time >= %llu AND end_time <= %llu AND source = '%s'", start, end, source.c_str()); + sqlite3pp::command cmd(*m_db, sql.c_str()); + cmd.execute(); +} + +void EpgStore::CleanEventsBySource(void* transaction, const CStdString& source) +{ + CSingleLock lock(m_lock); + + CStdString sql; + sql.Format("DELETE FROM programs WHERE source = '%s'", source.c_str()); + sqlite3pp::command cmd(*m_db, sql.c_str()); + cmd.execute(); +} + +void EpgStore::FromJson(std::string strJson, EpgProgramInfo& epgInfo) +{ + if (strJson.length() == 0) + { + return; + } + + Json::Value json; + Json::Reader reader; + if (!reader.parse(strJson, json)) + { + CLog::Log(LOGERROR, "Error parsing json: %s", reader.getFormatedErrorMessages().c_str()); + return; + } + + epgInfo.title = json["title"].asString(); + epgInfo.synopsis = json["synopsis"].asString(); + epgInfo.rating = json["rating"].asString(); + epgInfo.origAirDate = json["orig_airdate"].asString(); + epgInfo.seasonNumber = json["season_num"].asString(); + epgInfo.episodeNumber = json["episode_num"].asString(); + epgInfo.thumb = json["thumb"].asString(); + epgInfo.showRunNumber = json["show_num"].asString(); + epgInfo.episodeTitle = json["episode_title"].asString(); + epgInfo.isNew = json["new"].asBool(); +} + +std::vector EpgStore::QueryByChannelForPrograms(const CStdString& channel_id, const uint64_t startSlot, const uint64_t endSlot) +{ + std::vector result; + + try + { + CStdString queryString; + queryString.Format( + "SELECT id, channel_id, source, start_time, end_time, data " + "FROM programs " + "WHERE channel_id = '%s' AND start_time >= %llu AND start_time < %llu " + "ORDER BY start_time", channel_id.c_str(), startSlot, endSlot + ); + + sqlite3pp::query qry(*m_db, queryString); + + std::string data; + + for (sqlite3pp::query::iterator i = qry.begin(); i != qry.end(); ++i) + { + EpgProgramInfo p; + (*i).getter() >> p.id >> p.channelId >> p.sourceId >> p.start >> p.end >> data; + FromJson(data, p); + result.push_back(p); + } + } + catch (std::exception& ex) + { + CLog::Log(LOGERROR,"EpgStore::QueryByChannelForPrograms - got exception: %s", ex.what()); + } + + return result; +} + +std::vector EpgStore::QueryAllChannelsForPrograms(const uint64_t timeSlotStart, const uint64_t timeSlotEnd) +{ + std::vector result; + + try + { + CStdString queryString; + queryString.Format( + "SELECT id, channel_id, source, start_time, end_time, data " + "FROM programs " + "WHERE start_time < %llu AND end_time > %llu ", + timeSlotEnd, timeSlotStart + ); + +// printf("QueryAllChannelsForPrograms: %s\n", queryString.c_str()); + + sqlite3pp::query qry(*m_db, queryString); + + std::string data; + + for (sqlite3pp::query::iterator i = qry.begin(); i != qry.end(); ++i) + { + EpgProgramInfo p; + (*i).getter() >> p.id >> p.channelId >> p.sourceId >> p.start >> p.end >> data; + FromJson(data, p); + result.push_back(p); + } + } + catch (std::exception& ex) + { + CLog::Log(LOGERROR,"EpgStore::QueryAllChannelsForPrograms - got exception: %s", ex.what()); + } + + return result; +} + +std::vector EpgStore::QueryByChannelNow(const CStdString& channel_id) +{ + std::vector result; + + try + { + time_t now = time(NULL); + + CStdString queryString; + queryString.Format( + "SELECT id, channel_id, source, start_time, end_time, data " + "FROM programs " + "WHERE start_time <= %lu AND end_time > %lu AND channel_id = '%s'", + now, now, channel_id.c_str() + ); + + sqlite3pp::query qry(*m_db, queryString); + + std::string data; + + for (sqlite3pp::query::iterator i = qry.begin(); i != qry.end(); ++i) + { + EpgProgramInfo p; + (*i).getter() >> p.id >> p.channelId >> p.sourceId >> p.start >> p.end >> data; + FromJson(data, p); + result.push_back(p); + } + } + catch (std::exception& ex) + { + CLog::Log(LOGERROR,"EpgStore::QueryByChannelNow - got exception: %s", ex.what()); + } + + return result; +} + +void EpgStore::SetSocialInfo(std::vector* socialInfo) +{ + if (m_socialInfo) + delete m_socialInfo; + + m_socialInfo = socialInfo; +} + +void EpgStore::SetChannelSocialInfo(const CStdString& id, EpgSocialInfo& socialInfo) +{ + m_mapProgramSocialInfo[id] = socialInfo; +} + +bool EpgStore::GetChannelSocialInfo(const CStdString& programId, const CStdString& serviceId, EpgSocialInfo& socialInfo) +{ + CStdString myProgramId; + + CStdStringArray splitProgramId; + StringUtils::SplitString(programId, "-", splitProgramId); + if (splitProgramId.size() > 0) + { + myProgramId = splitProgramId[0]; + } + + std::map::iterator it = m_mapProgramSocialInfo.find(myProgramId); + + if (it != m_mapProgramSocialInfo.end()) + { + socialInfo = it->second; + return true; + } + + it = m_mapProgramSocialInfo.find(serviceId); + + if (it != m_mapProgramSocialInfo.end()) + { + socialInfo = it->second; + return true; + } + + return false; +} + +EpgStartEndTime EpgStore::QueryAllChannelsForTime(const uint64_t start, const uint64_t end) +{ + EpgStartEndTime result; + + try + { + int v1 = 0; + int v2 = 0; + + CStdString queryString; + queryString.Format( + "SELECT MIN(start_time), MAX(start_time) " + "FROM programs " + "WHERE start_time >= %llu AND start_time < %llu ", + start, end + ); + + sqlite3pp::query qry(*m_db, queryString); + + for (sqlite3pp::query::iterator i = qry.begin(); i != qry.end(); ++i) + { + (*i).getter() >> v1 >> v2; + } + + result.start = v1; + result.end = v2; + } + catch (std::exception& ex) + { + CLog::Log(LOGERROR,"EpgStore::QueryAllChannelsForTime - got exception: %s", ex.what()); + } + + return result; +} + +EpgStartEndTime EpgStore::QueryByChannelForTime(const CStdString& channel_id, const uint64_t start, const uint64_t end) +{ + EpgStartEndTime result; + + try + { + int v1 = 0; + int v2 = 0; + + CStdString queryString; + queryString.Format( + "SELECT MIN(start_time), MAX(start_time) " + "FROM programs " + "WHERE channel_id = '%s' AND start_time >= %llu AND start_time < %llu ", + channel_id.c_str(), start, end + ); + + sqlite3pp::query qry(*m_db, queryString); + + for (sqlite3pp::query::iterator i = qry.begin(); i != qry.end(); ++i) + { + (*i).getter() >> v1 >> v2; + } + + result.start = v1; + result.end = v2; + } + catch (std::exception& ex) + { + CLog::Log(LOGERROR,"EpgStore::QueryByChannelForTime - got exception: %s", ex.what()); + } + + return result; +} + +void EpgStore::Process() +{ + while(!m_bStop) + { + ::WaitForSingleObject(m_hEpgDataEvent, SYNC_CACHE_INTERVAL_SEC * 1000); + + void* tx = NULL; + try + { + tx = EpgStore::GetInstance().StartEventsTransaction(); + CleanOldEvents(tx); + EpgStore::GetInstance().CommitEventsTransaction(tx); + } + catch (std::exception& ex) + { + if (tx) + EpgStore::GetInstance().RollbackEventsTransaction(tx); + } + + { + CSingleLock lock(m_lock); + CopyFile(_P(DB_FILE_TMP), _P(DB_FILE), false); + } + } +} +#endif diff --git a/xbmc/cores/dvb/epgstore.h b/xbmc/cores/dvb/epgstore.h new file mode 100644 index 00000000..a12c3819 --- /dev/null +++ b/xbmc/cores/dvb/epgstore.h @@ -0,0 +1,131 @@ +#pragma once + +#include "system.h" +#include "sqlite3.h" +#include "Thread.h" + +#ifdef HAS_DVB + +namespace sqlite3pp +{ + class database; + class command; +} + +#define EPG_SOURCE_ID_SERVER "srv" +#define EPG_SOURCE_ID_OTA "ota" + +class EpgProgramInfo +{ +public: + EpgProgramInfo() { Clear(); } + CStdString id; + CStdString channelId; + CStdString sourceId; + sqlite3_int64 start; + sqlite3_int64 end; + CStdString title; + CStdString synopsis; + CStdString rating; + bool isNew; + CStdString origAirDate; + CStdString seasonNumber; + CStdString episodeNumber; + CStdString thumb; + CStdString showRunNumber; + CStdString episodeTitle; + + bool IsInfoFromServer() { return sourceId == EPG_SOURCE_ID_SERVER; } + + bool IsSet() + { + return (start != 0 && end != 0); + } + + void Clear() + { + start = 0; + end = 0; + isNew = false; + } +}; + +struct EpgFriendInfo +{ + CStdString user_id; + CStdString name; + CStdString shortName; + CStdString thumbUrl; + CStdString thumbSmallUrl; + CStdString firstName; + CStdString lastName; +}; + +struct EpgSocialInfo +{ + EpgSocialInfo() + { Clear(); } + + void Clear() + { + watching = 0; + friends.clear(); + label = ""; + } + + int watching; + std::vector friends; + CStdString label; +}; + +struct EpgStartEndTime +{ + time_t start; + time_t end; +}; + +class EpgStore : public CThread +{ +public: + static EpgStore &GetInstance(); + virtual ~EpgStore(); + + void CreateTables(); + void* StartEventsTransaction(); + void CommitEventsTransaction(void* transaction); + void InsertEvent(void* transaction, CStdString source, EpgProgramInfo info); + void RollbackEventsTransaction(void* transaction); + void CleanOldEvents(void* transaction); + void CleanEventsByTimeAndSource(void* transaction, const CStdString& source, const uint64_t start, const uint64_t end); + void CleanEventsBySource(void* transaction, const CStdString& source); + + std::vector QueryAllChannelsForPrograms(const uint64_t timeSlotStart, const uint64_t timeSlotEnd); + std::vector QueryByChannelForPrograms(const CStdString& channel_id, const uint64_t start, const uint64_t end); + + std::vector QueryByChannelNow(const CStdString& channel_id); + + EpgStartEndTime QueryAllChannelsForTime(const uint64_t start, const uint64_t end); + EpgStartEndTime QueryByChannelForTime(const CStdString& channel_id, const uint64_t start, const uint64_t end); + + void SetSocialInfo(std::vector* socialInfo); + void SetChannelSocialInfo(const CStdString& id, EpgSocialInfo& socialInfo); + bool GetChannelSocialInfo(const CStdString& programId, const CStdString& serviceId, EpgSocialInfo& socialInfo); + + virtual void Process(); + +private: + EpgStore(); + void FromJson(std::string json, EpgProgramInfo& epgInfo); + CStdString CleanDescription(const CStdString& strDescription); + + std::vector* m_socialInfo; + std::map m_mapProgramSocialInfo; + sqlite3pp::database* m_db; + sqlite3pp::command* m_insertEventCmd; + + HANDLE m_hEpgDataEvent; + CCriticalSection m_lock; +}; + + +#endif diff --git a/xbmc/cores/dvb/v4lhelper.cpp b/xbmc/cores/dvb/v4lhelper.cpp new file mode 100644 index 00000000..bf7bbe4e --- /dev/null +++ b/xbmc/cores/dvb/v4lhelper.cpp @@ -0,0 +1,797 @@ +/* + * All Rights Reserved, Boxee.tv + */ + +#include "v4lhelper.h" + +#if defined(HAS_DVB) && defined(_LINUX) && !defined(__APPLE__) + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "StringUtils.h" +#include "SingleLock.h" +#include "utils/log.h" +#include "Util.h" + +V4LHelper::V4LHelper(int tunerId, int flags) : IDvbHelper(tunerId, flags) +{ + m_frontendHandle = -1; + m_dvr = -1; + m_tuningState = DvbTuner::TUNING_STATE_IDLE; + m_lastSignalCheckTicks = 0; + + m_type = DvbTuner::TUNER_TYPE_UNINITIALIZED; + m_tunerId = tunerId; + + m_trValue["INVERSION_OFF"] = INVERSION_OFF; + m_trValue["INVERSION_ON"] = INVERSION_ON; + m_trValue["INVERSION_AUTO"] = INVERSION_AUTO; + + m_trValue["BANDWIDTH_6_MHZ"] = BANDWIDTH_6_MHZ; + m_trValue["BANDWIDTH_7_MHZ"] = BANDWIDTH_7_MHZ; + m_trValue["BANDWIDTH_8_MHZ"] = BANDWIDTH_8_MHZ; + + m_trValue["FEC_1_2"] = FEC_1_2; + m_trValue["FEC_2_3"] = FEC_2_3; + m_trValue["FEC_3_4"] = FEC_3_4; + m_trValue["FEC_4_5"] = FEC_4_5; + m_trValue["FEC_5_6"] = FEC_5_6; + m_trValue["FEC_6_7"] = FEC_6_7; + m_trValue["FEC_7_8"] = FEC_7_8; + m_trValue["FEC_8_9"] = FEC_8_9; + m_trValue["FEC_AUTO"] = FEC_AUTO; + m_trValue["FEC_NONE"] = FEC_NONE; + + m_trValue["GUARD_INTERVAL_1_16"] = GUARD_INTERVAL_1_16; + m_trValue["GUARD_INTERVAL_1_16"] = GUARD_INTERVAL_1_32; + m_trValue["GUARD_INTERVAL_1_4"] = GUARD_INTERVAL_1_4; + m_trValue["GUARD_INTERVAL_1_8"] = GUARD_INTERVAL_1_8; + m_trValue["GUARD_INTERVAL_AUTO"] = GUARD_INTERVAL_AUTO; + + m_trValue["HIERARCHY_1"] = HIERARCHY_1; + m_trValue["HIERARCHY_2"] = HIERARCHY_2; + m_trValue["HIERARCHY_4"] = HIERARCHY_4; + m_trValue["HIERARCHY_NONE"] = HIERARCHY_NONE; + m_trValue["HIERARCHY_AUTO"] = HIERARCHY_AUTO; + + m_trValue["QPSK"] = QPSK; + m_trValue["QAM_128"] = QAM_128; + m_trValue["QAM_16"] = QAM_16; + m_trValue["QAM_256"] = QAM_256; + m_trValue["QAM_32"] = QAM_32; + m_trValue["QAM_64"] = QAM_64; + m_trValue["QAM_AUTO"] = QAM_AUTO; + + m_trValue["TRANSMISSION_MODE_2K"] = TRANSMISSION_MODE_2K; + m_trValue["TRANSMISSION_MODE_8K"] = TRANSMISSION_MODE_8K; + m_trValue["TRANSMISSION_MODE_AUTO"] = TRANSMISSION_MODE_AUTO; + + // ATSC + m_trValue["8VSB"] = VSB_8; + m_trValue["VSB_8"] = VSB_8; + m_trValue["16VSB"] = VSB_16; + m_trValue["VSB_16"] = VSB_16; + m_trValue["QAM_64"] = QAM_64; + m_trValue["QAM_256"] = QAM_256; + + memset(&m_frontend_settings, 0, sizeof(struct dvb_frontend_parameters)); + + m_nFlags = flags; +} + +V4LHelper::~V4LHelper() +{ + Stop(); +} + +bool V4LHelper::OpenFrontEnd() +{ + if (m_frontendHandle > 0) + return true; + + CLog::Log(LOGINFO, "Opening Front End"); + + CStdString frontendPath; + frontendPath.Format("/dev/dvb/adapter%d/frontend0", m_tunerId); + + m_frontendHandle = open(frontendPath.c_str(), O_RDWR); + if (m_frontendHandle < 0) + { + CLog::Log(LOGERROR, "V4LHelper::Open: failed to open frontend! %s", + strerror(errno)); + return false; + } + + if (fcntl(m_frontendHandle, F_SETFL, O_NONBLOCK)) + { + CLog::Log(LOGWARNING, + "V4LHelper::Open: failed set O_NONBLOCK on m_frontendHandle device"); + return false; + } + + GetTunerType(m_tunerId); + + return true; +} + +void V4LHelper::CloseFrontEnd() +{ + if (m_frontendHandle < 0) + return; + + CLog::Log(LOGINFO, "Closing Front End"); + + close(m_frontendHandle); + m_frontendHandle = -1; +} + +bool V4LHelper::OpenDVR() +{ + if (m_dvr > 0) + return true; + + bool bBudgetMode = m_nFlags & TUNER_FLAGS_BUDGET; + + CLog::Log(LOGINFO, "V4LHelper::OpenDVR. budget mode %d", bBudgetMode); + + CStdString dvrPath; + if(bBudgetMode) + dvrPath.Format("/dev/dvb/adapter%d/demux0", m_tunerId); + else + dvrPath.Format("/dev/dvb/adapter%d/dvr0", m_tunerId); + + m_dvr = open(dvrPath.c_str(), O_RDONLY); + if (m_dvr < 0) + { + CLog::Log(LOGERROR, "V4LHelper::OpenDVR: failed to open dvr! %s", strerror( + errno)); + return false; + } + + if (fcntl(m_dvr, F_SETFL, O_NONBLOCK)) + { + CLog::Log(LOGWARNING, + "V4LHelper::Open: failed set O_NONBLOCK on dvr device"); + } + + if(bBudgetMode) + { + if (ioctl(m_dvr, DMX_SET_BUFFER_SIZE, 1 << 20) < 0) + { + CLog::Log(LOGERROR, "V4LHelper::OpenDVR: cannot expand demultiplexing buffer %s", + strerror(errno)); + return false; + } + + struct dmx_pes_filter_params param; + + param.pid = 0x2000; + param.input = DMX_IN_FRONTEND; + param.output = DMX_OUT_TSDEMUX_TAP; + param.pes_type = DMX_PES_OTHER; + param.flags = DMX_IMMEDIATE_START; + if (ioctl(m_dvr, DMX_SET_PES_FILTER, ¶m) < 0) + { + CLog::Log(LOGERROR, "V4LHelper::OpenDVR: cannot setup TS demultiplexer %s", + strerror(errno)); + return false; + } + } + + return true; +} + +void V4LHelper::CloseDVR() +{ + if (m_dvr < 0) + return; + + CLog::Log(LOGINFO, "Closing DVR"); + + close(m_dvr); + m_dvr = -1; +} + +void V4LHelper::RemoveAllPidFilters() +{ + bool bBudgetMode = m_nFlags & TUNER_FLAGS_BUDGET; + + if(bBudgetMode) + { + // in budget mode we only use PID 0x200, + // so we can just close the DVR + CloseDVR(); + Sleep(100); + OpenDVR(); + return; + } + + if(m_pidHandles.size() == 0) + return; + + for(std::map::const_iterator itr = m_pidHandles.begin(); itr != m_pidHandles.end(); ++itr) + { + ClosePID(itr->first); + } + + m_pidHandles.clear(); + + if(m_pidHandles.size() == 0) + { + Sleep(1000); + } +} + +void V4LHelper::CloseAll() +{ + CSingleLock lock(m_lock); + + RemoveAllPidFilters(); + CloseFrontEnd(); + CloseDVR(); +} + +DvbTuner::TunerType V4LHelper::GetTunerType(int tunerId) +{ + CSingleLock lock(m_lock); + + if (m_type != DvbTuner::TUNER_TYPE_UNINITIALIZED) + return m_type; + + m_type = DvbTuner::TUNER_TYPE_UNKNOWN; + + // + // query frontend for its type + // + struct dvb_frontend_info fe_info; + CStdString frontendPath; + frontendPath.Format("/dev/dvb/adapter%d/frontend0", tunerId); + int fd = m_frontendHandle; + if (fd == -1) + fd = open(frontendPath.c_str(), O_RDONLY); + + if (fd < 0) + { + CLog::Log(LOGERROR, "V4LHelper::GetTunerType: failed to open frontend!"); + return m_type; + } + + int rc = ioctl(fd, FE_GET_INFO, &fe_info); + if (rc < 0) + { + CLog::Log(LOGERROR, "V4LHelper::GetTunerType: failed to get frontend info!"); + if (m_frontendHandle < 0) + close(fd); + return m_type; + } + + CLog::Log(LOGINFO, "V4LHelper::GetTunerType: detected frontend (%s) type %d", + fe_info.name, fe_info.type); + if (fe_info.type == FE_ATSC) + m_type = DvbTuner::TUNER_TYPE_ATSC; + else if (fe_info.type == FE_OFDM) + m_type = DvbTuner::TUNER_TYPE_DVBT; + else + CLog::Log(LOGERROR, + "V4LHelper::GetTunerType: unknown frontend type: %s %d", fe_info.name, + fe_info.type); + + if (m_frontendHandle < 0) + close(fd); + + return m_type; +} + +bool V4LHelper::Tune(const DvbChannel &channel) +{ + bool bNoAudio = false; + bool bNoVideo = false; + + CSingleLock lock(m_lock); + + CLog::Log(LOGDEBUG, "V4LHelper::Tune: about to tune into %s", + channel.GetServiceName().c_str()); + + // Sanity check on the requested channel + if (channel.GetVideoPid() == 0) + { + CLog::Log(LOGWARNING, "V4LHelper::Tune: no video pid"); + bNoVideo = true; + } + + const std::vector& audioInfo = channel.GetAudioPids(); + if (audioInfo.size() == 0 || audioInfo[0].pid == 0) + { + CLog::Log(LOGWARNING, "V4LHelper::Tune: no audio pid"); + bNoAudio = true; + } + + if(bNoAudio && bNoVideo) + { + CLog::Log(LOGERROR, "V4LHelper::Tune: no audio or video pids found. Aborting tune"); + m_tuningState = DvbTuner::TUNING_STATE_TUNE_FAILED; + return false; + } + + // Open Front End if needed + if (m_frontendHandle <= 0) + OpenFrontEnd(); + + // Remove old pids, if they exist + bool bBudgetMode = m_nFlags & TUNER_FLAGS_BUDGET; + + if(!bBudgetMode) + RemoveAllPidFilters(); + + m_signalOk = true; + bool bForceTune = m_nFlags & TUNER_FLAGS_FORCE_TUNE; + + if (m_lastFreq != channel.GetFreq() || bForceTune) + { + m_tuningState = DvbTuner::TUNING_STATE_TUNING; + + CloseDVR(); + + struct dvb_frontend_parameters frontend; + memset(&frontend, 0, sizeof(struct dvb_frontend_parameters)); + + frontend.frequency = atoi(channel.GetFreq().c_str()); + + if (m_type == DvbTuner::TUNER_TYPE_ATSC) + { + frontend.u.vsb.modulation = (fe_modulation_t) m_trValue[channel.GetTuningParams()]; + } + else if (m_type == DvbTuner::TUNER_TYPE_DVBT) + { + CStdStringArray tuningParams; + StringUtils::SplitString(channel.GetTuningParams(), ",", tuningParams); + + frontend.inversion = (fe_spectral_inversion_t) m_trValue[tuningParams[0]]; + frontend.u.ofdm.bandwidth = (fe_bandwidth_t) m_trValue[tuningParams[1]]; + frontend.u.ofdm.code_rate_HP + = (fe_code_rate_t) m_trValue[tuningParams[2]]; + frontend.u.ofdm.code_rate_LP + = (fe_code_rate_t) m_trValue[tuningParams[3]]; + frontend.u.ofdm.constellation + = (fe_modulation_t) m_trValue[tuningParams[4]]; + frontend.u.ofdm.transmission_mode + = (fe_transmit_mode_t) m_trValue[tuningParams[5]]; + frontend.u.ofdm.guard_interval + = (fe_guard_interval_t) m_trValue[tuningParams[6]]; + frontend.u.ofdm.hierarchy_information + = (fe_hierarchy_t) m_trValue[tuningParams[7]]; + if (frontend.u.ofdm.code_rate_HP == FEC_NONE) + frontend.u.ofdm.code_rate_HP = FEC_AUTO; + if (frontend.u.ofdm.code_rate_LP == FEC_NONE) + frontend.u.ofdm.code_rate_LP = FEC_AUTO; + } + else + { + CLog::Log(LOGERROR, + "V4LHelper::Tune: unknown format type. tuning failed."); + m_tuningState = DvbTuner::TUNING_STATE_TUNE_FAILED; + return false; + } + + CLog::Log(LOGINFO, "V4LHelper::Tune: tuning frontend to freq: %d force tune %d", + frontend.frequency, bForceTune); + + if(!Tune(frontend)) + return false; + } + else + { + m_tuningState = DvbTuner::TUNING_STATE_TUNING_PROGRAM; + } + + m_lastFreq = channel.GetFreq(); + + if (m_tuningState == DvbTuner::TUNING_STATE_TUNING_PROGRAM) + { + m_tuningState = DvbTuner::TUNING_STATE_TUNED; + } + + return true; +} + +bool V4LHelper::Tune(struct dvb_frontend_parameters& frontend) +{ + /* Empty the event queue */ + for (;;) + { + struct dvb_frontend_event event; + if (ioctl(m_frontendHandle, FE_GET_EVENT, &event) < 0 + && errno == EWOULDBLOCK + ) + break; + } + + if (ioctl(m_frontendHandle, FE_SET_FRONTEND, &frontend) < 0) + { + CLog::Log(LOGERROR, "V4LHelper::Tune: failed to set up frontend!"); + m_tuningState = DvbTuner::TUNING_STATE_TUNE_FAILED; + return false; + } + + m_frontend_settings = frontend; + + return true; +} + +bool V4LHelper::IsSignalOk() +{ + if (m_tuningState != DvbTuner::TUNING_STATE_TUNED) + return true; + + return m_signalOk; +} + +bool V4LHelper::Stop() +{ + CSingleLock lock(m_lock); + + CloseAll(); + m_lastFreq = ""; + m_tuningState = DvbTuner::TUNING_STATE_IDLE; + + return true; +} + +bool V4LHelper::IsTuneDone(int tmout) +{ + if (m_frontendHandle <= 0) + return false; + + fe_status_t status; + struct pollfd pfd[1]; + time_t tm1, tm2; + bool ok = false; + int locks = 0; + + pfd[0].fd = m_frontendHandle; + pfd[0].events = POLLIN | POLLPRI; + + tm1 = tm2 = time((time_t*) NULL); + + while (!ok) + { + status = (fe_status_t) 0; + if (poll(pfd, 1, tmout * 1000) > 0) + { + if (pfd[0].revents) + { + if (ioctl(m_frontendHandle, FE_READ_STATUS, &status) >= 0) + { + if (status == (FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK)) + locks++; + } + } + } + usleep(10000); + tm2 = time((time_t*) NULL); + if ((status & FE_TIMEDOUT) || (locks >= 2) || (tm2 - tm1 >= tmout)) + ok = true; + } + + if (status == (FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK)) + { + CLog::Log(LOGINFO, "FE locked."); + return true; + } + + return false; +} + +uint16_t V4LHelper::GetSignal() +{ + CSingleLock lock(m_lock); + if (m_frontendHandle <= 0) + return 0; + + uint16_t sig = 0; + ioctl(m_frontendHandle, FE_READ_SIGNAL_STRENGTH, &sig); + + return sig; +} + +uint16_t V4LHelper::GetSNR() +{ + CSingleLock lock(m_lock); + if (m_frontendHandle <= 0) + return 0; + + uint16_t snr = 0; + ioctl(m_frontendHandle, FE_READ_SNR, &snr); + + return snr; +} + +uint16_t V4LHelper::GetBER() +{ + CSingleLock lock(m_lock); + if (m_frontendHandle <= 0) + return 0; + + uint16_t ber = 0; + ioctl(m_frontendHandle, FE_READ_BER, &ber); + + return ber; +} + +uint16_t V4LHelper::GetUCB() +{ + CSingleLock lock(m_lock); + if (m_frontendHandle <= 0) + return 0; + + uint16_t ucb = 0; + ioctl(m_frontendHandle, FE_READ_UNCORRECTED_BLOCKS, &ucb); + + return ucb; +} + +void V4LHelper::AddPidFilter(int pid, DvbTuner::DvbFilter type) +{ + bool bBudgetMode = m_nFlags & TUNER_FLAGS_BUDGET; + + if(bBudgetMode) + return; + + CLog::Log(LOGDEBUG, "Added pid %d to the filter", pid); + + if (m_pidHandles.find(pid) != m_pidHandles.end()) + { + CLog::Log(LOGWARNING, "Request to add PID already exist. Ignoring=%d", pid); + return; + } + + CSingleLock lock(m_lock); + + CStdString demuxPath; + demuxPath.Format("/dev/dvb/adapter%d/demux0", m_tunerId); + + int fd = open(demuxPath.c_str(), O_RDWR); + if (fd < 0) + { + CLog::Log(LOGERROR, "V4LHelper::AddPidFilter: failed to open demuxer for pid: %d", pid); + return; + } + + ioctl(fd, DMX_SET_BUFFER_SIZE, 256 * 1024); + + dmx_pes_type_t pes_type = DMX_PES_OTHER; + switch (type) + { + case DvbTuner::DVB_FILTER_VIDEO: pes_type = DMX_PES_VIDEO0; break; + case DvbTuner::DVB_FILTER_AUDIO: pes_type = DMX_PES_AUDIO0; break; + case DvbTuner::DVB_FILTER_OTHER: pes_type = DMX_PES_OTHER; break; + } + + struct dmx_pes_filter_params filter; + filter.pid = pid; + filter.input = DMX_IN_FRONTEND; + filter.output = DMX_OUT_TS_TAP; + filter.pes_type = pes_type; + filter.flags = DMX_IMMEDIATE_START; + + if (ioctl(fd, DMX_SET_PES_FILTER, &filter) < 0) + { + CLog::Log(LOGERROR, + "V4LHelper::AddPidToFilter: failed to add pid %d to filter. %s", pid, + strerror(errno)); + close (fd); + return; + } + + m_pidHandles[pid] = fd; +} + +void V4LHelper::RemovePidFilter(int pid) +{ + bool bBudgetMode = m_nFlags & TUNER_FLAGS_BUDGET; + + if(bBudgetMode) + return; + + printf("V4LHelper::RemovePidFilter pid %d size %d\n", pid, m_pidHandles.size()); + + if(m_pidHandles.size() == 0) + return; + + CSingleLock lock(m_lock); + + ClosePID(pid); + m_pidHandles.erase(pid); + + if(m_pidHandles.size() == 0) + { + Sleep(1000); + } +} + +void V4LHelper::ClosePID(int pid) +{ + // make sure the pid exists + if (m_pidHandles.find(pid) == m_pidHandles.end()) + { + CLog::Log(LOGWARNING, "Request to remove pid from the filter which does not exist: pid=%d", pid); + return; + } + + int fd = m_pidHandles[pid]; + + CLog::Log(LOGNONE, "Remove pid from the filter: pid=%d fd=%d", pid, fd); + + if (ioctl(fd, DMX_STOP) < 0) + { + CLog::Log(LOGWARNING, "failed to stop dmx pid %d\n", fd); + } + + close(fd); +} + +int V4LHelper::Read(char * buf, int size) +{ + CSingleLock lock(m_lock); + + static bool timeout = false; + + if (m_frontendHandle <= 0) + return -1; + + // Check the signal once a second + if (m_tuningState == DvbTuner::TUNING_STATE_TUNED && SDL_GetTicks() - m_lastSignalCheckTicks > 1000) + { + uint16_t signal = GetSignal(); + uint16_t snr = GetSNR(); + + if ((signal > 140 || signal == 0) && (snr > 100 || snr == 0)) + m_signalOk = true; + else + m_signalOk = false; + +// printf("signal=%d snr=%d signalok=%s\n", signal, snr, m_signalOk ? "true" : "false"); + + m_lastSignalCheckTicks = SDL_GetTicks(); + } + + struct pollfd ufd[2]; + int n; + + ufd[0].fd = m_frontendHandle; + ufd[0].events = POLLIN; + n = 1; + if(m_dvr > 0) + { + ufd[1].fd = m_dvr; + ufd[1].events = POLLIN; + n = 2; + } + + // we put one second timeout for video to come out. + // if it doesn't then we reopen devices + int rc = poll(ufd, n, 1000); + if (rc == -1 && errno == EINTR) + { + return 0; + } + + if (rc < 0) + { + CLog::Log(LOGERROR, "%s poll failed: %s", __func__, strerror(errno)); + return -1; + } + + // if dvr is open and we get a timeout, reopen devices + if(m_dvr > 0 && rc == 0) + { + CLog::Log(LOGWARNING, "V4LHelper::Read DVR timeout. Reopening frontend"); + CloseFrontEnd(); + CloseDVR(); + Sleep(100); + OpenFrontEnd(); + m_tuningState = DvbTuner::TUNING_STATE_TUNING; + Tune(m_frontend_settings); + } + + int bytesRead = 0; + + struct dvb_frontend_event ev; + + if (ufd[0].revents) + { + if (ioctl(m_frontendHandle, FE_GET_EVENT, &ev) < 0) + { + if (errno == EOVERFLOW) + { + CLog::Log(LOGWARNING, "Cannot dequeue events fast enough from frontend. Doing nothing"); + return 0; + } + else + CLog::Log(LOGERROR, "Cannot dequeue frontend event: %s", strerror(errno)); + } + else + { + CLog::Log(LOGINFO, "Got frontend event. status: 0x%02X", (unsigned) ev.status); + + if (ev.status == (FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK)) + { + m_tuningState = DvbTuner::TUNING_STATE_TUNED; + CloseDVR(); + } + else if (m_tuningState == DvbTuner::TUNING_STATE_TUNED) + m_tuningState = DvbTuner::TUNING_STATE_TUNE_FAILED; + } + } + + if (m_dvr > 0 && n == 2 && ufd[1].revents) + { + ssize_t val = read(m_dvr, buf, size); + + if (val == -1 && (errno != EAGAIN && errno != EINTR)) + { + if (errno == EOVERFLOW) + { + CLog::Log(LOGWARNING, "Cannot read dvr data fast enough. Doing nothing"); + return 0; + } + + CLog::Log(LOGERROR, "Error reading from dvr: %d %s", m_dvr, strerror(errno) ); + bytesRead = -1; + } + else if (val > 0) + { + bytesRead = val; + } + } + + if(m_tuningState == DvbTuner::TUNING_STATE_TUNED) + { + if(m_dvr < 0) + { + Sleep(100); + OpenDVR(); + } + } + + return bytesRead; +} + +DvbTuner::TuningState V4LHelper::GetTuningState() +{ + return m_tuningState; +} + +DvbTunerTechnicalInfo V4LHelper::GetTechnicalInfo() +{ + DvbTunerTechnicalInfo result; + memset(&result, 0, sizeof(result)); + + if (m_frontendHandle == -1) + return result; + + fe_status_t status; + + if (ioctl(m_frontendHandle, FE_READ_STATUS, &status) >= 0) + { + result.fe_status = (unsigned int) status; + } + + result.signal = GetSignal(); + result.snr = GetSNR(); + result.ber = GetBER(); + result.ucb = GetUCB(); + + return result; + +} + +#endif diff --git a/xbmc/cores/dvb/v4lhelper.h b/xbmc/cores/dvb/v4lhelper.h new file mode 100644 index 00000000..d9116f7c --- /dev/null +++ b/xbmc/cores/dvb/v4lhelper.h @@ -0,0 +1,103 @@ +/* +* All Rights Reserved, Boxee.tv +*/ + +#ifndef V4LHELPER_H +#define V4LHELPER_H + +#include "system.h" + +#ifdef HAS_DVB + +#include "dvbchannel.h" +#include "dvbtuner.h" +#include + +#if defined(_LINUX) && !defined(__APPLE__) +#include +#endif + +class IDvbHelper +{ +public: + IDvbHelper(int tunerId, int flags = 0) { }; + virtual ~IDvbHelper() { }; + + virtual bool Tune(const DvbChannel &channel) { return true; } + virtual bool Stop() { return true; } + virtual DvbTuner::TunerType GetTunerType(int tunerId) { return DvbTuner::TUNER_TYPE_UNKNOWN; } + virtual DvbTuner::TuningState GetTuningState() { return DvbTuner::TUNING_STATE_IDLE; } + virtual bool IsSignalOk() { return false; } + virtual int Read(char * buf, int size) { return -1; } + virtual void AddPidFilter(int pid, DvbTuner::DvbFilter type) { } + virtual void RemovePidFilter(int pid) { } + virtual DvbTunerTechnicalInfo GetTechnicalInfo() { return DvbTunerTechnicalInfo(); } + virtual int GetFlags() { return 0; } + virtual void RemoveAllPidFilters() {} +}; + +#if defined(_LINUX) && !defined(__APPLE__) +class V4LHelper : public IDvbHelper +{ +public: + V4LHelper(int tunerId, int flags = 0); + virtual ~V4LHelper(); + + virtual bool Tune(const DvbChannel &channel); + virtual bool Stop(); + virtual DvbTuner::TunerType GetTunerType(int tunerId); + virtual DvbTuner::TuningState GetTuningState(); + virtual int Read(char * buf, int size); + virtual bool IsSignalOk(); + + virtual void AddPidFilter(int pid, DvbTuner::DvbFilter type); + virtual void RemovePidFilter(int pid); + virtual void RemoveAllPidFilters(); + + virtual DvbTunerTechnicalInfo GetTechnicalInfo(); + virtual int GetFlags() { return m_nFlags; } + +protected: + bool OpenDVR(); + void CloseDVR(); + + bool OpenFrontEnd(); + void CloseFrontEnd(); + + + void CloseAll(); + + bool IsTuneDone(int tmout); + bool Tune(struct dvb_frontend_parameters& frontend); + + uint16_t GetSignal(); + uint16_t GetSNR(); + uint16_t GetBER(); + uint16_t GetUCB(); + + void ClosePID(int pid); + + std::map m_pidHandles; + int m_frontendHandle; + int m_dvr; + int m_tunerId; + + CStdString m_lastFreq; + + CCriticalSection m_lock; + DvbTuner::TunerType m_type; + std::map m_trValue; // translate the string in channels.conf to v4l value + + DvbTuner::TuningState m_tuningState; + bool m_signalOk; + int m_lastSignalCheckTicks; + struct dvb_frontend_parameters m_frontend_settings; + + int m_nFlags; +}; + +#endif + +#endif + +#endif // V4LHELPER_H diff --git a/xbmc/cores/dvdplayer/Codecs/Codecs.pro b/xbmc/cores/dvdplayer/Codecs/Codecs.pro new file mode 100644 index 00000000..dd0622cf --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/Codecs.pro @@ -0,0 +1,16 @@ +include(../../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +SOURCES += \ + + +HEADERS += \ + + +INCLUDEPATH += ../../../../ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/.gitignore b/xbmc/cores/dvdplayer/Codecs/ffmpeg/.gitignore new file mode 100644 index 00000000..70b94fc8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/.gitignore @@ -0,0 +1,50 @@ +.config +.version +*.o +*.d +*.exe +*.ho +*-example +*-test +*_g +config.* +doc/*.1 +doc/*.html +doc/*.pod +doxy +ffmpeg +ffplay +ffprobe +ffserver +libavcodec/libavcodec* +libavcore/libavcore* +libavdevice/libavdevice* +libavfilter/libavfilter* +libavformat/libavformat* +libavutil/avconfig.h +libavutil/libavutil* +libpostproc/libpostproc* +libswscale/libswscale* +tests/audiogen +tests/base64 +tests/data +tests/rotozoom +tests/seek_test +tests/tiny_psnr +tests/videogen +tests/vsynth1 +tests/vsynth2 +tools/cws2fws +tools/graph2dot +tools/lavfi-showfiltfmts +tools/pktdumper +tools/probetest +tools/qt-faststart +tools/trasher +tools/trasher*.d +version.h + +# ignore Windows build files +*.def +*.dll +*.lib diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils_common_opts.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils_common_opts.h new file mode 100644 index 00000000..da309977 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/cmdutils_common_opts.h @@ -0,0 +1,13 @@ + { "L", OPT_EXIT, {(void*)show_license}, "show license" }, + { "h", OPT_EXIT, {(void*)show_help}, "show help" }, + { "?", OPT_EXIT, {(void*)show_help}, "show help" }, + { "help", OPT_EXIT, {(void*)show_help}, "show help" }, + { "-help", OPT_EXIT, {(void*)show_help}, "show help" }, + { "version", OPT_EXIT, {(void*)show_version}, "show version" }, + { "formats" , OPT_EXIT, {(void*)show_formats }, "show available formats" }, + { "codecs" , OPT_EXIT, {(void*)show_codecs }, "show available codecs" }, + { "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit stream filters" }, + { "protocols", OPT_EXIT, {(void*)show_protocols}, "show available protocols" }, + { "filters", OPT_EXIT, {(void*)show_filters }, "show available filters" }, + { "pix_fmts" , OPT_EXIT, {(void*)show_pix_fmts }, "show available pixel formats" }, + { "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" }, diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/bitstream_filters.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/bitstream_filters.texi new file mode 100644 index 00000000..1ad67cd5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/bitstream_filters.texi @@ -0,0 +1,77 @@ +@chapter Bitstream Filters +@c man begin BITSTREAM FILTERS + +When you configure your FFmpeg build, all the supported bitstream +filters are enabled by default. You can list all available ones using +the configure option @code{--list-bsfs}. + +You can disable all the bitstream filters using the configure option +@code{--disable-bsfs}, and selectively enable any bitstream filter using +the option @code{--enable-bsf=BSF}, or you can disable a particular +bitstream filter using the option @code{--disable-bsf=BSF}. + +The option @code{-bsfs} of the ff* tools will display the list of +all the supported bitstream filters included in your build. + +Below is a description of the currently available bitstream filters. + +@section aac_adtstoasc + +@section chomp + +@section dump_extradata + +@section h264_mp4toannexb + +@section imx_dump_header + +@section mjpeg2jpeg + +Convert MJPEG/AVI1 packets to full JPEG/JFIF packets. + +MJPEG is a video codec wherein each video frame is essentially a +JPEG image. The individual frames can be extracted without loss, +e.g. by + +@example +ffmpeg -i ../some_mjpeg.avi -vcodec copy frames_%d.jpg +@end example + +Unfortunately, these chunks are incomplete JPEG images, because +they lack the DHT segment required for decoding. Quoting from +@url{http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml}: + +Avery Lee, writing in the rec.video.desktop newsgroup in 2001, +commented that "MJPEG, or at least the MJPEG in AVIs having the +MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* -- +Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, +and it must use basic Huffman encoding, not arithmetic or +progressive. . . . You can indeed extract the MJPEG frames and +decode them with a regular JPEG decoder, but you have to prepend +the DHT segment to them, or else the decoder won't have any idea +how to decompress the data. The exact table necessary is given in +the OpenDML spec." + +This bitstream filter patches the header of frames extracted from an MJPEG +stream (carrying the AVI1 header ID and lacking a DHT segment) to +produce fully qualified JPEG images. + +@example +ffmpeg -i mjpeg-movie.avi -vcodec copy -vbsf mjpeg2jpeg frame_%d.jpg +exiftran -i -9 frame*.jpg +ffmpeg -i frame_%d.jpg -vcodec copy rotated.avi +@end example + +@section mjpega_dump_header + +@section movsub + +@section mp3_header_compress + +@section mp3_header_decompress + +@section noise + +@section remove_extradata + +@c man end BITSTREAM FILTERS diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/build_system.txt b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/build_system.txt new file mode 100644 index 00000000..b22ff848 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/build_system.txt @@ -0,0 +1,34 @@ +FFmpeg currently uses a custom build system, this text attempts to document +some of its obscure features and options. + +Options to make: +make V=1 + Build target with verbosity 1, instead of 1, 2 can be used too + + +Useful standard make commands: +make -t + Touch all files that otherwise would be build, this is useful to reduce + unneeded rebuilding when changing headers, but note you must force rebuilds + of files that actually need it by hand then. + +make -j + rebuild with multiple jobs at the same time. Faster on multi processor systems + +make -k + continue build in case of errors, this is useful for the regression tests + sometimes but note it will still not run all reg tests. + + +Targets to make: +fate-list + Will list all fate/regression test targets + +fate + Run the fate test suite, note you must have installed it + + +Setting up local fate: +use the following command to get the fate test samples +rsync -aL rsync://rsync.mplayerhq.hu:/samples/fate-suite/ fate/fate-suite +pass --samples= to configure diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/demuxers.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/demuxers.texi new file mode 100644 index 00000000..05316ce5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/demuxers.texi @@ -0,0 +1,67 @@ +@chapter Demuxers +@c man begin DEMUXERS + +Demuxers are configured elements in FFmpeg which allow to read the +multimedia streams from a particular type of file. + +When you configure your FFmpeg build, all the supported demuxers +are enabled by default. You can list all available ones using the +configure option "--list-demuxers". + +You can disable all the demuxers using the configure option +"--disable-demuxers", and selectively enable a single demuxer with +the option "--enable-demuxer=@var{DEMUXER}", or disable it +with the option "--disable-demuxer=@var{DEMUXER}". + +The option "-formats" of the ff* tools will display the list of +enabled demuxers. + +The description of some of the currently available demuxers follows. + +@section image2 + +Image file demuxer. + +This demuxer reads from a list of image files specified by a pattern. + +The pattern may contain the string "%d" or "%0@var{N}d", which +specifies the position of the characters representing a sequential +number in each filename matched by the pattern. If the form +"%d0@var{N}d" is used, the string representing the number in each +filename is 0-padded and @var{N} is the total number of 0-padded +digits representing the number. The literal character '%' can be +specified in the pattern with the string "%%". + +If the pattern contains "%d" or "%0@var{N}d", the first filename of +the file list specified by the pattern must contain a number +inclusively contained between 0 and 4, all the following numbers must +be sequential. This limitation may be hopefully fixed. + +The pattern may contain a suffix which is used to automatically +determine the format of the images contained in the files. + +For example the pattern "img-%03d.bmp" will match a sequence of +filenames of the form @file{img-001.bmp}, @file{img-002.bmp}, ..., +@file{img-010.bmp}, etc.; the pattern "i%%m%%g-%d.jpg" will match a +sequence of filenames of the form @file{i%m%g-1.jpg}, +@file{i%m%g-2.jpg}, ..., @file{i%m%g-10.jpg}, etc. + +The size, the pixel format, and the format of each image must be the +same for all the files in the sequence. + +The following example shows how to use @file{ffmpeg} for creating a +video from the images in the file sequence @file{img-001.jpeg}, +@file{img-002.jpeg}, ..., assuming an input framerate of 10 frames per +second: +@example +ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi +@end example + +Note that the pattern must not necessarily contain "%d" or +"%0@var{N}d", for example to convert a single image file +@file{img.jpeg} you can employ the command: +@example +ffmpeg -f image2 -i img.jpeg img.png +@end example + +@c man end INPUT DEVICES diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/eval.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/eval.texi new file mode 100644 index 00000000..99cd034c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/eval.texi @@ -0,0 +1,140 @@ +@chapter Expression Evaluation +@c man begin EXPRESSION EVALUATION + +When evaluating an arithemetic expression, FFmpeg uses an internal +formula evaluator, implemented through the @file{libavutil/eval.h} +interface. + +An expression may contain unary, binary operators, constants, and +functions. + +Two expressions @var{expr1} and @var{expr2} can be combined to form +another expression "@var{expr1};@var{expr2}". +@var{expr1} and @var{expr2} are evaluated in turn, and the new +expression evaluates to the value of @var{expr2}. + +The following binary operators are available: @code{+}, @code{-}, +@code{*}, @code{/}, @code{^}. + +The following unary operators are available: @code{+}, @code{-}. + +The following functions are available: +@table @option +@item sinh(x) +@item cosh(x) +@item tanh(x) +@item sin(x) +@item cos(x) +@item tan(x) +@item atan(x) +@item asin(x) +@item acos(x) +@item exp(x) +@item log(x) +@item abs(x) +@item squish(x) +@item gauss(x) +@item isnan(x) +Return 1.0 if @var{x} is NAN, 0.0 otherwise. + +@item mod(x, y) +@item max(x, y) +@item min(x, y) +@item eq(x, y) +@item gte(x, y) +@item gt(x, y) +@item lte(x, y) +@item lt(x, y) +@item st(var, expr) +Allow to store the value of the expression @var{expr} in an internal +variable. @var{var} specifies the number of the variable where to +store the value, and it is a value ranging from 0 to 9. The function +returns the value stored in the internal variable. + +@item ld(var) +Allow to load the value of the internal variable with number +@var{var}, which was previosly stored with st(@var{var}, @var{expr}). +The function returns the loaded value. + +@item while(cond, expr) +Evaluate expression @var{expr} while the expression @var{cond} is +non-zero, and returns the value of the last @var{expr} evaluation, or +NAN if @var{cond} was always false. +@end table + +Note that: + +@code{*} works like AND + +@code{+} works like OR + +thus +@example +if A then B else C +@end example +is equivalent to +@example +A*B + not(A)*C +@end example + +When A evaluates to either 1 or 0, that is the same as +@example +A*B + eq(A,0)*C +@end example + +In your C code, you can extend the list of unary and binary functions, +and define recognized constants, so that they are available for your +expressions. + +The evaluator also recognizes the International System number +postfixes. If 'i' is appended after the postfix, powers of 2 are used +instead of powers of 10. The 'B' postfix multiplies the value for 8, +and can be appended after another postfix or used alone. This allows +using for example 'KB', 'MiB', 'G' and 'B' as postfix. + +Follows the list of available International System postfixes, with +indication of the corresponding powers of 10 and of 2. +@table @option +@item y +-24 / -80 +@item z +-21 / -70 +@item a +-18 / -60 +@item f +-15 / -50 +@item p +-12 / -40 +@item n +-9 / -30 +@item u +-6 / -20 +@item m +-3 / -10 +@item c +-2 +@item d +-1 +@item h +2 +@item k +3 / 10 +@item K +3 / 10 +@item M +6 / 20 +@item G +9 / 30 +@item T +12 / 40 +@item P +15 / 40 +@item E +18 / 50 +@item Z +21 / 60 +@item Y +24 / 70 +@end table + +@c man end diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffmpeg.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffmpeg.texi new file mode 100644 index 00000000..047444ab --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffmpeg.texi @@ -0,0 +1,1005 @@ +\input texinfo @c -*- texinfo -*- + +@settitle FFmpeg Documentation +@titlepage +@center @titlefont{FFmpeg Documentation} +@end titlepage + +@top + +@contents + +@chapter Synopsis + +The generic syntax is: + +@example +@c man begin SYNOPSIS +ffmpeg [[infile options][@option{-i} @var{infile}]]... @{[outfile options] @var{outfile}@}... +@c man end +@end example + +@chapter Description +@c man begin DESCRIPTION + +FFmpeg is a very fast video and audio converter. It can also grab from +a live audio/video source. + +The command line interface is designed to be intuitive, in the sense +that FFmpeg tries to figure out all parameters that can possibly be +derived automatically. You usually only have to specify the target +bitrate you want. + +FFmpeg can also convert from any sample rate to any other, and resize +video on the fly with a high quality polyphase filter. + +As a general rule, options are applied to the next specified +file. Therefore, order is important, and you can have the same +option on the command line multiple times. Each occurrence is +then applied to the next input or output file. + +@itemize +@item +To set the video bitrate of the output file to 64kbit/s: +@example +ffmpeg -i input.avi -b 64k output.avi +@end example + +@item +To force the frame rate of the output file to 24 fps: +@example +ffmpeg -i input.avi -r 24 output.avi +@end example + +@item +To force the frame rate of the input file (valid for raw formats only) +to 1 fps and the frame rate of the output file to 24 fps: +@example +ffmpeg -r 1 -i input.m2v -r 24 output.avi +@end example +@end itemize + +The format option may be needed for raw input files. + +By default, FFmpeg tries to convert as losslessly as possible: It +uses the same audio and video parameters for the outputs as the one +specified for the inputs. + +@c man end DESCRIPTION + +@chapter Options +@c man begin OPTIONS + +@include fftools-common-opts.texi + +@section Main options + +@table @option + +@item -f @var{fmt} +Force format. + +@item -i @var{filename} +input file name + +@item -y +Overwrite output files. + +@item -t @var{duration} +Restrict the transcoded/captured video sequence +to the duration specified in seconds. +@code{hh:mm:ss[.xxx]} syntax is also supported. + +@item -fs @var{limit_size} +Set the file size limit. + +@item -ss @var{position} +Seek to given time position in seconds. +@code{hh:mm:ss[.xxx]} syntax is also supported. + +@item -itsoffset @var{offset} +Set the input time offset in seconds. +@code{[-]hh:mm:ss[.xxx]} syntax is also supported. +This option affects all the input files that follow it. +The offset is added to the timestamps of the input files. +Specifying a positive offset means that the corresponding +streams are delayed by 'offset' seconds. + +@item -timestamp @var{time} +Set the recording timestamp in the container. +The syntax for @var{time} is: +@example +now|([(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH[:MM[:SS[.m...]]])|(HH[MM[SS[.m...]]]))[Z|z]) +@end example +If the value is "now" it takes the current time. +Time is local time unless 'Z' or 'z' is appended, in which case it is +interpreted as UTC. +If the year-month-day part is not specified it takes the current +year-month-day. + +@item -metadata @var{key}=@var{value} +Set a metadata key/value pair. + +For example, for setting the title in the output file: +@example +ffmpeg -i in.avi -metadata title="my title" out.flv +@end example + +@item -v @var{number} +Set the logging verbosity level. + +@item -target @var{type} +Specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", +"ntsc-svcd", ... ). All the format options (bitrate, codecs, +buffer sizes) are then set automatically. You can just type: + +@example +ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg +@end example + +Nevertheless you can specify additional options as long as you know +they do not conflict with the standard, as in: + +@example +ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg +@end example + +@item -dframes @var{number} +Set the number of data frames to record. + +@item -scodec @var{codec} +Force subtitle codec ('copy' to copy stream). + +@item -newsubtitle +Add a new subtitle stream to the current output stream. + +@item -slang @var{code} +Set the ISO 639 language code (3 letters) of the current subtitle stream. + +@end table + +@section Video Options + +@table @option +@item -b @var{bitrate} +Set the video bitrate in bit/s (default = 200 kb/s). +@item -vframes @var{number} +Set the number of video frames to record. +@item -r @var{fps} +Set frame rate (Hz value, fraction or abbreviation), (default = 25). +@item -s @var{size} +Set frame size. The format is @samp{wxh} (ffserver default = 160x128, ffmpeg default = same as source). +The following abbreviations are recognized: +@table @samp +@item sqcif +128x96 +@item qcif +176x144 +@item cif +352x288 +@item 4cif +704x576 +@item 16cif +1408x1152 +@item qqvga +160x120 +@item qvga +320x240 +@item vga +640x480 +@item svga +800x600 +@item xga +1024x768 +@item uxga +1600x1200 +@item qxga +2048x1536 +@item sxga +1280x1024 +@item qsxga +2560x2048 +@item hsxga +5120x4096 +@item wvga +852x480 +@item wxga +1366x768 +@item wsxga +1600x1024 +@item wuxga +1920x1200 +@item woxga +2560x1600 +@item wqsxga +3200x2048 +@item wquxga +3840x2400 +@item whsxga +6400x4096 +@item whuxga +7680x4800 +@item cga +320x200 +@item ega +640x350 +@item hd480 +852x480 +@item hd720 +1280x720 +@item hd1080 +1920x1080 +@end table + +@item -aspect @var{aspect} +Set aspect ratio (4:3, 16:9 or 1.3333, 1.7777). +@item -croptop @var{size} +@item -cropbottom @var{size} +@item -cropleft @var{size} +@item -cropright @var{size} +All the crop options have been removed. Use -vf +crop=width:height:x:y instead. + +@item -padtop @var{size} +@item -padbottom @var{size} +@item -padleft @var{size} +@item -padright @var{size} +@item -padcolor @var{hex_color} +All the pad options have been removed. Use -vf +pad=width:height:x:y:color instead. +@item -vn +Disable video recording. +@item -bt @var{tolerance} +Set video bitrate tolerance (in bits, default 4000k). +Has a minimum value of: (target_bitrate/target_framerate). +In 1-pass mode, bitrate tolerance specifies how far ratecontrol is +willing to deviate from the target average bitrate value. This is +not related to min/max bitrate. Lowering tolerance too much has +an adverse effect on quality. +@item -maxrate @var{bitrate} +Set max video bitrate (in bit/s). +Requires -bufsize to be set. +@item -minrate @var{bitrate} +Set min video bitrate (in bit/s). +Most useful in setting up a CBR encode: +@example +ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v +@end example +It is of little use elsewise. +@item -bufsize @var{size} +Set video buffer verifier buffer size (in bits). +@item -vcodec @var{codec} +Force video codec to @var{codec}. Use the @code{copy} special value to +tell that the raw codec data must be copied as is. +@item -sameq +Use same video quality as source (implies VBR). + +@item -pass @var{n} +Select the pass number (1 or 2). It is used to do two-pass +video encoding. The statistics of the video are recorded in the first +pass into a log file (see also the option -passlogfile), +and in the second pass that log file is used to generate the video +at the exact requested bitrate. +On pass 1, you may just deactivate audio and set output to null, +examples for Windows and Unix: +@example +ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y NUL +ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y /dev/null +@end example + +@item -passlogfile @var{prefix} +Set two-pass log file name prefix to @var{prefix}, the default file name +prefix is ``ffmpeg2pass''. The complete file name will be +@file{PREFIX-N.log}, where N is a number specific to the output +stream. + +@item -newvideo +Add a new video stream to the current output stream. + +@item -vlang @var{code} +Set the ISO 639 language code (3 letters) of the current video stream. + +@item -vf @var{filter_graph} +@var{filter_graph} is a description of the filter graph to apply to +the input video. +Use the option "-filters" to show all the available filters (including +also sources and sinks). + +@end table + +@section Advanced Video Options + +@table @option +@item -pix_fmt @var{format} +Set pixel format. Use 'list' as parameter to show all the supported +pixel formats. +@item -sws_flags @var{flags} +Set SwScaler flags. +@item -g @var{gop_size} +Set the group of pictures size. +@item -intra +Use only intra frames. +@item -vdt @var{n} +Discard threshold. +@item -qscale @var{q} +Use fixed video quantizer scale (VBR). +@item -qmin @var{q} +minimum video quantizer scale (VBR) +@item -qmax @var{q} +maximum video quantizer scale (VBR) +@item -qdiff @var{q} +maximum difference between the quantizer scales (VBR) +@item -qblur @var{blur} +video quantizer scale blur (VBR) (range 0.0 - 1.0) +@item -qcomp @var{compression} +video quantizer scale compression (VBR) (default 0.5). +Constant of ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0 + +@item -lmin @var{lambda} +minimum video lagrange factor (VBR) +@item -lmax @var{lambda} +max video lagrange factor (VBR) +@item -mblmin @var{lambda} +minimum macroblock quantizer scale (VBR) +@item -mblmax @var{lambda} +maximum macroblock quantizer scale (VBR) + +These four options (lmin, lmax, mblmin, mblmax) use 'lambda' units, +but you may use the QP2LAMBDA constant to easily convert from 'q' units: +@example +ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext +@end example + +@item -rc_init_cplx @var{complexity} +initial complexity for single pass encoding +@item -b_qfactor @var{factor} +qp factor between P- and B-frames +@item -i_qfactor @var{factor} +qp factor between P- and I-frames +@item -b_qoffset @var{offset} +qp offset between P- and B-frames +@item -i_qoffset @var{offset} +qp offset between P- and I-frames +@item -rc_eq @var{equation} +Set rate control equation (see section "Expression Evaluation") +(default = @code{tex^qComp}). + +When computing the rate control equation expression, besides the +standard functions defined in the section "Expression Evaluation", the +following functions are available: +@table @var +@item bits2qp(bits) +@item qp2bits(qp) +@end table + +and the following constants are available: +@table @var +@item iTex +@item pTex +@item tex +@item mv +@item fCode +@item iCount +@item mcVar +@item var +@item isI +@item isP +@item isB +@item avgQP +@item qComp +@item avgIITex +@item avgPITex +@item avgPPTex +@item avgBPTex +@item avgTex +@end table + +@item -rc_override @var{override} +rate control override for specific intervals +@item -me_method @var{method} +Set motion estimation method to @var{method}. +Available methods are (from lowest to best quality): +@table @samp +@item zero +Try just the (0, 0) vector. +@item phods +@item log +@item x1 +@item hex +@item umh +@item epzs +(default method) +@item full +exhaustive search (slow and marginally better than epzs) +@end table + +@item -dct_algo @var{algo} +Set DCT algorithm to @var{algo}. Available values are: +@table @samp +@item 0 +FF_DCT_AUTO (default) +@item 1 +FF_DCT_FASTINT +@item 2 +FF_DCT_INT +@item 3 +FF_DCT_MMX +@item 4 +FF_DCT_MLIB +@item 5 +FF_DCT_ALTIVEC +@end table + +@item -idct_algo @var{algo} +Set IDCT algorithm to @var{algo}. Available values are: +@table @samp +@item 0 +FF_IDCT_AUTO (default) +@item 1 +FF_IDCT_INT +@item 2 +FF_IDCT_SIMPLE +@item 3 +FF_IDCT_SIMPLEMMX +@item 4 +FF_IDCT_LIBMPEG2MMX +@item 5 +FF_IDCT_PS2 +@item 6 +FF_IDCT_MLIB +@item 7 +FF_IDCT_ARM +@item 8 +FF_IDCT_ALTIVEC +@item 9 +FF_IDCT_SH4 +@item 10 +FF_IDCT_SIMPLEARM +@end table + +@item -er @var{n} +Set error resilience to @var{n}. +@table @samp +@item 1 +FF_ER_CAREFUL (default) +@item 2 +FF_ER_COMPLIANT +@item 3 +FF_ER_AGGRESSIVE +@item 4 +FF_ER_VERY_AGGRESSIVE +@end table + +@item -ec @var{bit_mask} +Set error concealment to @var{bit_mask}. @var{bit_mask} is a bit mask of +the following values: +@table @samp +@item 1 +FF_EC_GUESS_MVS (default = enabled) +@item 2 +FF_EC_DEBLOCK (default = enabled) +@end table + +@item -bf @var{frames} +Use 'frames' B-frames (supported for MPEG-1, MPEG-2 and MPEG-4). +@item -mbd @var{mode} +macroblock decision +@table @samp +@item 0 +FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in FFmpeg). +@item 1 +FF_MB_DECISION_BITS: Choose the one which needs the fewest bits. +@item 2 +FF_MB_DECISION_RD: rate distortion +@end table + +@item -4mv +Use four motion vector by macroblock (MPEG-4 only). +@item -part +Use data partitioning (MPEG-4 only). +@item -bug @var{param} +Work around encoder bugs that are not auto-detected. +@item -strict @var{strictness} +How strictly to follow the standards. +@item -aic +Enable Advanced intra coding (h263+). +@item -umv +Enable Unlimited Motion Vector (h263+) + +@item -deinterlace +Deinterlace pictures. +@item -ilme +Force interlacing support in encoder (MPEG-2 and MPEG-4 only). +Use this option if your input file is interlaced and you want +to keep the interlaced format for minimum losses. +The alternative is to deinterlace the input stream with +@option{-deinterlace}, but deinterlacing introduces losses. +@item -psnr +Calculate PSNR of compressed frames. +@item -vstats +Dump video coding statistics to @file{vstats_HHMMSS.log}. +@item -vstats_file @var{file} +Dump video coding statistics to @var{file}. +@item -top @var{n} +top=1/bottom=0/auto=-1 field first +@item -dc @var{precision} +Intra_dc_precision. +@item -vtag @var{fourcc/tag} +Force video tag/fourcc. +@item -qphist +Show QP histogram. +@item -vbsf @var{bitstream_filter} +Bitstream filters available are "dump_extra", "remove_extra", "noise", "h264_mp4toannexb", "imxdump", "mjpegadump", "mjpeg2jpeg". +@example +ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264 +@end example +@item -force_key_frames @var{time}[,@var{time}...] +Force key frames at the specified timestamps, more precisely at the first +frames after each specified time. +This option can be useful to ensure that a seek point is present at a +chapter mark or any other designated place in the output file. +The timestamps must be specified in ascending order. +@end table + +@section Audio Options + +@table @option +@item -aframes @var{number} +Set the number of audio frames to record. +@item -ar @var{freq} +Set the audio sampling frequency. For input streams it is set by +default to 44100 Hz, for output streams it is set by default to the +frequency of the input stream. If the input file has audio streams +with different frequencies, the behaviour is undefined. +@item -ab @var{bitrate} +Set the audio bitrate in bit/s (default = 64k). +@item -aq @var{q} +Set the audio quality (codec-specific, VBR). +@item -ac @var{channels} +Set the number of audio channels. For input streams it is set by +default to 1, for output streams it is set by default to the same +number of audio channels in input. If the input file has audio streams +with different channel count, the behaviour is undefined. +@item -an +Disable audio recording. +@item -acodec @var{codec} +Force audio codec to @var{codec}. Use the @code{copy} special value to +specify that the raw codec data must be copied as is. +@item -newaudio +Add a new audio track to the output file. If you want to specify parameters, +do so before @code{-newaudio} (@code{-acodec}, @code{-ab}, etc..). + +Mapping will be done automatically, if the number of output streams is equal to +the number of input streams, else it will pick the first one that matches. You +can override the mapping using @code{-map} as usual. + +Example: +@example +ffmpeg -i file.mpg -vcodec copy -acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio +@end example +@item -alang @var{code} +Set the ISO 639 language code (3 letters) of the current audio stream. +@end table + +@section Advanced Audio options: + +@table @option +@item -atag @var{fourcc/tag} +Force audio tag/fourcc. +@item -absf @var{bitstream_filter} +Bitstream filters available are "dump_extra", "remove_extra", "noise", "mp3comp", "mp3decomp". +@end table + +@section Subtitle options: + +@table @option +@item -scodec @var{codec} +Force subtitle codec ('copy' to copy stream). +@item -newsubtitle +Add a new subtitle stream to the current output stream. +@item -slang @var{code} +Set the ISO 639 language code (3 letters) of the current subtitle stream. +@item -sn +Disable subtitle recording. +@item -sbsf @var{bitstream_filter} +Bitstream filters available are "mov2textsub", "text2movsub". +@example +ffmpeg -i file.mov -an -vn -sbsf mov2textsub -scodec copy -f rawvideo sub.txt +@end example +@end table + +@section Audio/Video grab options + +@table @option +@item -vc @var{channel} +Set video grab channel (DV1394 only). +@item -tvstd @var{standard} +Set television standard (NTSC, PAL (SECAM)). +@item -isync +Synchronize read on input. +@end table + +@section Advanced options + +@table @option +@item -map @var{input_stream_id}[:@var{sync_stream_id}] +Set stream mapping from input streams to output streams. +Just enumerate the input streams in the order you want them in the output. +@var{sync_stream_id} if specified sets the input stream to sync +against. +@item -map_meta_data @var{outfile}[,@var{metadata}]:@var{infile}[,@var{metadata}] +Set meta data information of @var{outfile} from @var{infile}. Note that those +are file indices (zero-based), not filenames. +Optional @var{metadata} parameters specify, which metadata to copy - (g)lobal +(i.e. metadata that applies to the whole file), per-(s)tream, per-(c)hapter or +per-(p)rogram. All metadata specifiers other than global must be followed by the +stream/chapter/program number. If metadata specifier is omitted, it defaults to +global. + +By default, global metadata is copied from the first input file to all output files, +per-stream and per-chapter metadata is copied along with streams/chapters. These +default mappings are disabled by creating any mapping of the relevant type. A negative +file index can be used to create a dummy mapping that just disables automatic copying. + +For example to copy metadata from the first stream of the input file to global metadata +of the output file: +@example +ffmpeg -i in.ogg -map_meta_data 0:0,s0 out.mp3 +@end example +@item -map_chapters @var{outfile}:@var{infile} +Copy chapters from @var{infile} to @var{outfile}. If no chapter mapping is specified, +then chapters are copied from the first input file with at least one chapter to all +output files. Use a negative file index to disable any chapter copying. +@item -debug +Print specific debug info. +@item -benchmark +Show benchmarking information at the end of an encode. +Shows CPU time used and maximum memory consumption. +Maximum memory consumption is not supported on all systems, +it will usually display as 0 if not supported. +@item -dump +Dump each input packet. +@item -hex +When dumping packets, also dump the payload. +@item -bitexact +Only use bit exact algorithms (for codec testing). +@item -ps @var{size} +Set RTP payload size in bytes. +@item -re +Read input at native frame rate. Mainly used to simulate a grab device. +@item -loop_input +Loop over the input stream. Currently it works only for image +streams. This option is used for automatic FFserver testing. +@item -loop_output @var{number_of_times} +Repeatedly loop output for formats that support looping such as animated GIF +(0 will loop the output infinitely). +@item -threads @var{count} +Thread count. +@item -vsync @var{parameter} +Video sync method. + +@table @option +@item 0 +Each frame is passed with its timestamp from the demuxer to the muxer. +@item 1 +Frames will be duplicated and dropped to achieve exactly the requested +constant framerate. +@item 2 +Frames are passed through with their timestamp or dropped so as to +prevent 2 frames from having the same timestamp. +@item -1 +Chooses between 1 and 2 depending on muxer capabilities. This is the +default method. +@end table + +With -map you can select from which stream the timestamps should be +taken. You can leave either video or audio unchanged and sync the +remaining stream(s) to the unchanged one. + +@item -async @var{samples_per_second} +Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps, +the parameter is the maximum samples per second by which the audio is changed. +-async 1 is a special case where only the start of the audio stream is corrected +without any later correction. +@item -copyts +Copy timestamps from input to output. +@item -copytb +Copy input stream time base from input to output when stream copying. +@item -shortest +Finish encoding when the shortest input stream ends. +@item -dts_delta_threshold +Timestamp discontinuity delta threshold. +@item -muxdelay @var{seconds} +Set the maximum demux-decode delay. +@item -muxpreload @var{seconds} +Set the initial demux-decode delay. +@item -streamid @var{output-stream-index}:@var{new-value} +Assign a new stream-id value to an output stream. This option should be +specified prior to the output filename to which it applies. +For the situation where multiple output files exist, a streamid +may be reassigned to a different value. + +For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for +an output mpegts file: +@example +ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts +@end example +@end table + +@section Preset files + +A preset file contains a sequence of @var{option}=@var{value} pairs, +one for each line, specifying a sequence of options which would be +awkward to specify on the command line. Lines starting with the hash +('#') character are ignored and are used to provide comments. Check +the @file{ffpresets} directory in the FFmpeg source tree for examples. + +Preset files are specified with the @code{vpre}, @code{apre}, +@code{spre}, and @code{fpre} options. The @code{fpre} option takes the +filename of the preset instead of a preset name as input and can be +used for any kind of codec. For the @code{vpre}, @code{apre}, and +@code{spre} options, the options specified in a preset file are +applied to the currently selected codec of the same type as the preset +option. + +The argument passed to the @code{vpre}, @code{apre}, and @code{spre} +preset options identifies the preset file to use according to the +following rules: + +First ffmpeg searches for a file named @var{arg}.ffpreset in the +directories @file{$FFMPEG_DATADIR} (if set), and @file{$HOME/.ffmpeg}, and in +the datadir defined at configuration time (usually @file{PREFIX/share/ffmpeg}) +in that order. For example, if the argument is @code{libx264-max}, it will +search for the file @file{libx264-max.ffpreset}. + +If no such file is found, then ffmpeg will search for a file named +@var{codec_name}-@var{arg}.ffpreset in the above-mentioned +directories, where @var{codec_name} is the name of the codec to which +the preset file options will be applied. For example, if you select +the video codec with @code{-vcodec libx264} and use @code{-vpre max}, +then it will search for the file @file{libx264-max.ffpreset}. +@c man end + +@chapter Tips +@c man begin TIPS + +@itemize +@item +For streaming at very low bitrate application, use a low frame rate +and a small GOP size. This is especially true for RealVideo where +the Linux player does not seem to be very fast, so it can miss +frames. An example is: + +@example +ffmpeg -g 3 -r 3 -t 10 -b 50k -s qcif -f rv10 /tmp/b.rm +@end example + +@item +The parameter 'q' which is displayed while encoding is the current +quantizer. The value 1 indicates that a very good quality could +be achieved. The value 31 indicates the worst quality. If q=31 appears +too often, it means that the encoder cannot compress enough to meet +your bitrate. You must either increase the bitrate, decrease the +frame rate or decrease the frame size. + +@item +If your computer is not fast enough, you can speed up the +compression at the expense of the compression ratio. You can use +'-me zero' to speed up motion estimation, and '-intra' to disable +motion estimation completely (you have only I-frames, which means it +is about as good as JPEG compression). + +@item +To have very low audio bitrates, reduce the sampling frequency +(down to 22050 Hz for MPEG audio, 22050 or 11025 for AC-3). + +@item +To have a constant quality (but a variable bitrate), use the option +'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst +quality). + +@item +When converting video files, you can use the '-sameq' option which +uses the same quality factor in the encoder as in the decoder. +It allows almost lossless encoding. + +@end itemize +@c man end TIPS + +@chapter Examples +@c man begin EXAMPLES + +@section Video and Audio grabbing + +FFmpeg can grab video and audio from devices given that you specify the input +format and device. + +@example +ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg +@end example + +Note that you must activate the right video source and channel before +launching FFmpeg with any TV viewer such as xawtv +(@url{http://linux.bytesex.org/xawtv/}) by Gerd Knorr. You also +have to set the audio recording levels correctly with a +standard mixer. + +@section X11 grabbing + +FFmpeg can grab the X11 display. + +@example +ffmpeg -f x11grab -s cif -r 25 -i :0.0 /tmp/out.mpg +@end example + +0.0 is display.screen number of your X11 server, same as +the DISPLAY environment variable. + +@example +ffmpeg -f x11grab -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg +@end example + +0.0 is display.screen number of your X11 server, same as the DISPLAY environment +variable. 10 is the x-offset and 20 the y-offset for the grabbing. + +@section Video and Audio file format conversion + +FFmpeg can use any supported file format and protocol as input: + +Examples: +@itemize +@item +You can use YUV files as input: + +@example +ffmpeg -i /tmp/test%d.Y /tmp/out.mpg +@end example + +It will use the files: +@example +/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V, +/tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc... +@end example + +The Y files use twice the resolution of the U and V files. They are +raw files, without header. They can be generated by all decent video +decoders. You must specify the size of the image with the @option{-s} option +if FFmpeg cannot guess it. + +@item +You can input from a raw YUV420P file: + +@example +ffmpeg -i /tmp/test.yuv /tmp/out.avi +@end example + +test.yuv is a file containing raw YUV planar data. Each frame is composed +of the Y plane followed by the U and V planes at half vertical and +horizontal resolution. + +@item +You can output to a raw YUV420P file: + +@example +ffmpeg -i mydivx.avi hugefile.yuv +@end example + +@item +You can set several input files and output files: + +@example +ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg +@end example + +Converts the audio file a.wav and the raw YUV video file a.yuv +to MPEG file a.mpg. + +@item +You can also do audio and video conversions at the same time: + +@example +ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2 +@end example + +Converts a.wav to MPEG audio at 22050 Hz sample rate. + +@item +You can encode to several formats at the same time and define a +mapping from input stream to output streams: + +@example +ffmpeg -i /tmp/a.wav -ab 64k /tmp/a.mp2 -ab 128k /tmp/b.mp2 -map 0:0 -map 0:0 +@end example + +Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map +file:index' specifies which input stream is used for each output +stream, in the order of the definition of output streams. + +@item +You can transcode decrypted VOBs: + +@example +ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k snatch.avi +@end example + +This is a typical DVD ripping example; the input is a VOB file, the +output an AVI file with MPEG-4 video and MP3 audio. Note that in this +command we use B-frames so the MPEG-4 stream is DivX5 compatible, and +GOP size is 300 which means one intra frame every 10 seconds for 29.97fps +input video. Furthermore, the audio stream is MP3-encoded so you need +to enable LAME support by passing @code{--enable-libmp3lame} to configure. +The mapping is particularly useful for DVD transcoding +to get the desired audio language. + +NOTE: To see the supported input formats, use @code{ffmpeg -formats}. + +@item +You can extract images from a video, or create a video from many images: + +For extracting images from a video: +@example +ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg +@end example + +This will extract one video frame per second from the video and will +output them in files named @file{foo-001.jpeg}, @file{foo-002.jpeg}, +etc. Images will be rescaled to fit the new WxH values. + +If you want to extract just a limited number of frames, you can use the +above command in combination with the -vframes or -t option, or in +combination with -ss to start extracting from a certain point in time. + +For creating a video from many images: +@example +ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi +@end example + +The syntax @code{foo-%03d.jpeg} specifies to use a decimal number +composed of three digits padded with zeroes to express the sequence +number. It is the same syntax supported by the C printf function, but +only formats accepting a normal integer are suitable. + +@item +You can put many streams of the same type in the output: + +@example +ffmpeg -i test1.avi -i test2.avi -vcodec copy -acodec copy -vcodec copy -acodec copy test12.avi -newvideo -newaudio +@end example + +In addition to the first video and audio streams, the resulting +output file @file{test12.avi} will contain the second video +and the second audio stream found in the input streams list. + +The @code{-newvideo}, @code{-newaudio} and @code{-newsubtitle} +options have to be specified immediately after the name of the output +file to which you want to add them. + +@end itemize +@c man end EXAMPLES + +@include eval.texi +@include demuxers.texi +@include muxers.texi +@include indevs.texi +@include outdevs.texi +@include protocols.texi +@include bitstream_filters.texi +@include filters.texi +@include metadata.texi + +@ignore + +@setfilename ffmpeg +@settitle FFmpeg video converter + +@c man begin SEEALSO +ffplay(1), ffprobe(1), ffserver(1) and the FFmpeg HTML documentation +@c man end + +@c man begin AUTHORS +The FFmpeg developers +@c man end + +@end ignore + +@bye diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffplay.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffplay.texi new file mode 100644 index 00000000..e0518b85 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffplay.texi @@ -0,0 +1,181 @@ +\input texinfo @c -*- texinfo -*- + +@settitle FFplay Documentation +@titlepage +@center @titlefont{FFplay Documentation} +@end titlepage + +@top + +@contents + +@chapter Synopsis + +@example +@c man begin SYNOPSIS +ffplay [options] @file{input_file} +@c man end +@end example + +@chapter Description +@c man begin DESCRIPTION + +FFplay is a very simple and portable media player using the FFmpeg +libraries and the SDL library. It is mostly used as a testbed for the +various FFmpeg APIs. +@c man end + +@chapter Options +@c man begin OPTIONS + +@include fftools-common-opts.texi + +@section Main options + +@table @option +@item -x @var{width} +Force displayed width. +@item -y @var{height} +Force displayed height. +@item -s @var{size} +Set frame size (WxH or abbreviation), needed for videos which don't +contain a header with the frame size like raw YUV. +@item -an +Disable audio. +@item -vn +Disable video. +@item -ss @var{pos} +Seek to a given position in seconds. +@item -t @var{duration} +play seconds of audio/video +@item -bytes +Seek by bytes. +@item -nodisp +Disable graphical display. +@item -f @var{fmt} +Force format. +@item -window_title @var{title} +Set window title (default is the input filename). +@item -loop @var{number} +Loops movie playback times. 0 means forever. +@item -vf @var{filter_graph} +@var{filter_graph} is a description of the filter graph to apply to +the input video. +Use the option "-filters" to show all the available filters (including +also sources and sinks). + +@end table + +@section Advanced options +@table @option +@item -pix_fmt @var{format} +Set pixel format. +@item -stats +Show the stream duration, the codec parameters, the current position in +the stream and the audio/video synchronisation drift. +@item -debug +Print specific debug info. +@item -bug +Work around bugs. +@item -vismv +Visualize motion vectors. +@item -fast +Non-spec-compliant optimizations. +@item -genpts +Generate pts. +@item -rtp_tcp +Force RTP/TCP protocol usage instead of RTP/UDP. It is only meaningful +if you are streaming with the RTSP protocol. +@item -sync @var{type} +Set the master clock to audio (@code{type=audio}), video +(@code{type=video}) or external (@code{type=ext}). Default is audio. The +master clock is used to control audio-video synchronization. Most media +players use audio as master clock, but in some cases (streaming or high +quality broadcast) it is necessary to change that. This option is mainly +used for debugging purposes. +@item -threads @var{count} +Set the thread count. +@item -ast @var{audio_stream_number} +Select the desired audio stream number, counting from 0. The number +refers to the list of all the input audio streams. If it is greater +than the number of audio streams minus one, then the last one is +selected, if it is negative the audio playback is disabled. +@item -vst @var{video_stream_number} +Select the desired video stream number, counting from 0. The number +refers to the list of all the input video streams. If it is greater +than the number of video streams minus one, then the last one is +selected, if it is negative the video playback is disabled. +@item -sst @var{subtitle_stream_number} +Select the desired subtitle stream number, counting from 0. The number +refers to the list of all the input subtitle streams. If it is greater +than the number of subtitle streams minus one, then the last one is +selected, if it is negative the subtitle rendering is disabled. +@item -autoexit +Exit when video is done playing. +@item -exitonkeydown +Exit if any key is pressed. +@item -exitonmousedown +Exit if any mouse button is pressed. +@end table + +@section While playing + +@table @key +@item q, ESC +Quit. + +@item f +Toggle full screen. + +@item p, SPC +Pause. + +@item a +Cycle audio channel. + +@item v +Cycle video channel. + +@item t +Cycle subtitle channel. + +@item w +Show audio waves. + +@item left/right +Seek backward/forward 10 seconds. + +@item down/up +Seek backward/forward 1 minute. + +@item mouse click +Seek to percentage in file corresponding to fraction of width. + +@end table + +@c man end + +@include eval.texi +@include demuxers.texi +@include muxers.texi +@include indevs.texi +@include outdevs.texi +@include protocols.texi +@include filters.texi + +@ignore + +@setfilename ffplay +@settitle FFplay media player + +@c man begin SEEALSO +ffmpeg(1), ffprobe(1), ffserver(1) and the FFmpeg HTML documentation +@c man end + +@c man begin AUTHORS +The FFmpeg developers +@c man end + +@end ignore + +@bye diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffprobe.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffprobe.texi new file mode 100644 index 00000000..de65eee6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffprobe.texi @@ -0,0 +1,134 @@ +\input texinfo @c -*- texinfo -*- + +@settitle FFprobe Documentation +@titlepage +@center @titlefont{FFprobe Documentation} +@end titlepage + +@top + +@contents + +@chapter Synopsis + +The generic syntax is: + +@example +@c man begin SYNOPSIS +ffprobe [options] [@file{input_file}] +@c man end +@end example + +@chapter Description +@c man begin DESCRIPTION + +FFprobe gathers information from multimedia streams and prints it in +human- and machine-readable fashion. + +For example it can be used to check the format of the container used +by a multimedia stream and the format and type of each media stream +contained in it. + +If a filename is specified in input, ffprobe will try to open and +probe the file content. If the file cannot be opened or recognized as +a multimedia file, a positive exit code is returned. + +FFprobe may be employed both as a standalone application or in +combination with a textual filter, which may perform more +sophisticated processing, e.g. statistical processing or plotting. + +Options are used to list some of the formats supported by ffprobe or +for specifying which information to display, and for setting how +ffprobe will show it. + +FFprobe output is designed to be easily parsable by a textual filter, +and consists of one or more sections of the form: +@example +[SECTION] +key1=val1 +... +keyN=valN +[/SECTION] +@end example + +Metadata tags stored in the container or in the streams are recognized +and printed in the corresponding "FORMAT" or "STREAM" section, and +are prefixed by the string "TAG:". + +@c man end + +@chapter Options +@c man begin OPTIONS + +@include fftools-common-opts.texi + +@section Main options + +@table @option + +@item -f @var{format} +Force format to use. + +@item -unit +Show the unit of the displayed values. + +@item -prefix +Use SI prefixes for the displayed values. +Unless the "-byte_binary_prefix" option is used all the prefixes +are decimal. + +@item -byte_binary_prefix +Force the use of binary prefixes for byte values. + +@item -sexagesimal +Use sexagesimal format HH:MM:SS.MICROSECONDS for time values. + +@item -pretty +Prettify the format of the displayed values, it corresponds to the +options "-unit -prefix -byte_binary_prefix -sexagesimal". + +@item -show_format +Show information about the container format of the input multimedia +stream. + +All the container format information is printed within a section with +name "FORMAT". + +@item -show_packets +Show information about each packet contained in the input multimedia +stream. + +The information for each single packet is printed within a dedicated +section with name "PACKET". + +@item -show_streams +Show information about each media stream contained in the input +multimedia stream. + +Each media stream information is printed within a dedicated section +with name "STREAM". + +@end table +@c man end + +@include demuxers.texi +@include muxers.texi +@include protocols.texi +@include indevs.texi + +@ignore + +@setfilename ffprobe +@settitle FFprobe media prober + +@c man begin SEEALSO +ffmpeg(1), ffplay(1), ffserver(1) and the FFmpeg HTML documentation +@c man end + +@c man begin AUTHORS +The FFmpeg developers +@c man end + +@end ignore + +@bye diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffserver.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffserver.texi new file mode 100644 index 00000000..0cab3c8a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/ffserver.texi @@ -0,0 +1,278 @@ +\input texinfo @c -*- texinfo -*- + +@settitle FFserver Documentation +@titlepage +@center @titlefont{FFserver Documentation} +@end titlepage + +@top + +@contents + +@chapter Synopsys + +The generic syntax is: + +@example +@c man begin SYNOPSIS +ffserver [options] +@c man end +@end example + +@chapter Description +@c man begin DESCRIPTION + +FFserver is a streaming server for both audio and video. It supports +several live feeds, streaming from files and time shifting on live feeds +(you can seek to positions in the past on each live feed, provided you +specify a big enough feed storage in ffserver.conf). + +FFserver runs in daemon mode by default; that is, it puts itself in +the background and detaches from its TTY, unless it is launched in +debug mode or a NoDaemon option is specified in the configuration +file. + +This documentation covers only the streaming aspects of ffserver / +ffmpeg. All questions about parameters for ffmpeg, codec questions, +etc. are not covered here. Read @file{ffmpeg-doc.html} for more +information. + +@section How does it work? + +FFserver receives prerecorded files or FFM streams from some ffmpeg +instance as input, then streams them over RTP/RTSP/HTTP. + +An ffserver instance will listen on some port as specified in the +configuration file. You can launch one or more instances of ffmpeg and +send one or more FFM streams to the port where ffserver is expecting +to receive them. Alternately, you can make ffserver launch such ffmpeg +instances at startup. + +Input streams are called feeds, and each one is specified by a +section in the configuration file. + +For each feed you can have different output streams in various +formats, each one specified by a section in the configuration +file. + +@section Status stream + +FFserver supports an HTTP interface which exposes the current status +of the server. + +Simply point your browser to the address of the special status stream +specified in the configuration file. + +For example if you have: +@example + +Format status + +# Only allow local people to get the status +ACL allow localhost +ACL allow 192.168.0.0 192.168.255.255 + +@end example + +then the server will post a page with the status information when +the special stream @file{status.html} is requested. + +@section What can this do? + +When properly configured and running, you can capture video and audio in real +time from a suitable capture card, and stream it out over the Internet to +either Windows Media Player or RealAudio player (with some restrictions). + +It can also stream from files, though that is currently broken. Very often, a +web server can be used to serve up the files just as well. + +It can stream prerecorded video from .ffm files, though it is somewhat tricky +to make it work correctly. + +@section What do I need? + +I use Linux on a 900 MHz Duron with a cheapo Bt848 based TV capture card. I'm +using stock Linux 2.4.17 with the stock drivers. [Actually that isn't true, +I needed some special drivers for my motherboard-based sound card.] + +I understand that FreeBSD systems work just fine as well. + +@section How do I make it work? + +First, build the kit. It *really* helps to have installed LAME first. Then when +you run the ffserver ./configure, make sure that you have the +@code{--enable-libmp3lame} flag turned on. + +LAME is important as it allows for streaming audio to Windows Media Player. +Don't ask why the other audio types do not work. + +As a simple test, just run the following two command lines where INPUTFILE +is some file which you can decode with ffmpeg: + +@example +./ffserver -f doc/ffserver.conf & +./ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm +@end example + +At this point you should be able to go to your Windows machine and fire up +Windows Media Player (WMP). Go to Open URL and enter + +@example + http://:8090/test.asf +@end example + +You should (after a short delay) see video and hear audio. + +WARNING: trying to stream test1.mpg doesn't work with WMP as it tries to +transfer the entire file before starting to play. +The same is true of AVI files. + +@section What happens next? + +You should edit the ffserver.conf file to suit your needs (in terms of +frame rates etc). Then install ffserver and ffmpeg, write a script to start +them up, and off you go. + +@section Troubleshooting + +@subsection I don't hear any audio, but video is fine. + +Maybe you didn't install LAME, or got your ./configure statement wrong. Check +the ffmpeg output to see if a line referring to MP3 is present. If not, then +your configuration was incorrect. If it is, then maybe your wiring is not +set up correctly. Maybe the sound card is not getting data from the right +input source. Maybe you have a really awful audio interface (like I do) +that only captures in stereo and also requires that one channel be flipped. +If you are one of these people, then export 'AUDIO_FLIP_LEFT=1' before +starting ffmpeg. + +@subsection The audio and video loose sync after a while. + +Yes, they do. + +@subsection After a long while, the video update rate goes way down in WMP. + +Yes, it does. Who knows why? + +@subsection WMP 6.4 behaves differently to WMP 7. + +Yes, it does. Any thoughts on this would be gratefully received. These +differences extend to embedding WMP into a web page. [There are two +object IDs that you can use: The old one, which does not play well, and +the new one, which does (both tested on the same system). However, +I suspect that the new one is not available unless you have installed WMP 7]. + +@section What else can it do? + +You can replay video from .ffm files that was recorded earlier. +However, there are a number of caveats, including the fact that the +ffserver parameters must match the original parameters used to record the +file. If they do not, then ffserver deletes the file before recording into it. +(Now that I write this, it seems broken). + +You can fiddle with many of the codec choices and encoding parameters, and +there are a bunch more parameters that you cannot control. Post a message +to the mailing list if there are some 'must have' parameters. Look in +ffserver.conf for a list of the currently available controls. + +It will automatically generate the ASX or RAM files that are often used +in browsers. These files are actually redirections to the underlying ASF +or RM file. The reason for this is that the browser often fetches the +entire file before starting up the external viewer. The redirection files +are very small and can be transferred quickly. [The stream itself is +often 'infinite' and thus the browser tries to download it and never +finishes.] + +@section Tips + +* When you connect to a live stream, most players (WMP, RA, etc) want to +buffer a certain number of seconds of material so that they can display the +signal continuously. However, ffserver (by default) starts sending data +in realtime. This means that there is a pause of a few seconds while the +buffering is being done by the player. The good news is that this can be +cured by adding a '?buffer=5' to the end of the URL. This means that the +stream should start 5 seconds in the past -- and so the first 5 seconds +of the stream are sent as fast as the network will allow. It will then +slow down to real time. This noticeably improves the startup experience. + +You can also add a 'Preroll 15' statement into the ffserver.conf that will +add the 15 second prebuffering on all requests that do not otherwise +specify a time. In addition, ffserver will skip frames until a key_frame +is found. This further reduces the startup delay by not transferring data +that will be discarded. + +* You may want to adjust the MaxBandwidth in the ffserver.conf to limit +the amount of bandwidth consumed by live streams. + +@section Why does the ?buffer / Preroll stop working after a time? + +It turns out that (on my machine at least) the number of frames successfully +grabbed is marginally less than the number that ought to be grabbed. This +means that the timestamp in the encoded data stream gets behind realtime. +This means that if you say 'Preroll 10', then when the stream gets 10 +or more seconds behind, there is no Preroll left. + +Fixing this requires a change in the internals of how timestamps are +handled. + +@section Does the @code{?date=} stuff work. + +Yes (subject to the limitation outlined above). Also note that whenever you +start ffserver, it deletes the ffm file (if any parameters have changed), +thus wiping out what you had recorded before. + +The format of the @code{?date=xxxxxx} is fairly flexible. You should use one +of the following formats (the 'T' is literal): + +@example +* YYYY-MM-DDTHH:MM:SS (localtime) +* YYYY-MM-DDTHH:MM:SSZ (UTC) +@end example + +You can omit the YYYY-MM-DD, and then it refers to the current day. However +note that @samp{?date=16:00:00} refers to 16:00 on the current day -- this +may be in the future and so is unlikely to be useful. + +You use this by adding the ?date= to the end of the URL for the stream. +For example: @samp{http://localhost:8080/test.asf?date=2002-07-26T23:05:00}. +@c man end + +@chapter Options +@c man begin OPTIONS + +@include fftools-common-opts.texi + +@section Main options + +@table @option +@item -f @var{configfile} +Use @file{configfile} instead of @file{/etc/ffserver.conf}. +@item -n +Enable no-launch mode. This option disables all the Launch directives +within the various sections. FFserver will not launch any +ffmpeg instance, so you will have to launch them manually. +@item -d +Enable debug mode. This option increases log verbosity, directs log +messages to stdout and causes ffserver to run in the foreground +rather than as a daemon. +@end table +@c man end + +@ignore + +@setfilename ffserver +@settitle FFserver video server + +@c man begin SEEALSO + +ffmpeg(1), ffplay(1), ffprobe(1), the @file{ffmpeg/doc/ffserver.conf} +example and the FFmpeg HTML documentation +@c man end + +@c man begin AUTHORS +The FFmpeg developers +@c man end + +@end ignore + +@bye diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/fftools-common-opts.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/fftools-common-opts.texi new file mode 100644 index 00000000..d72ca5cc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/fftools-common-opts.texi @@ -0,0 +1,93 @@ +All the numerical options, if not specified otherwise, accept in input +a string representing a number, which may contain one of the +International System number postfixes, for example 'K', 'M', 'G'. +If 'i' is appended after the postfix, powers of 2 are used instead of +powers of 10. The 'B' postfix multiplies the value for 8, and can be +appended after another postfix or used alone. This allows using for +example 'KB', 'MiB', 'G' and 'B' as postfix. + +Options which do not take arguments are boolean options, and set the +corresponding value to true. They can be set to false by prefixing +with "no" the option name, for example using "-nofoo" in the +commandline will set to false the boolean option with name "foo". + +@section Generic options + +These options are shared amongst the ff* tools. + +@table @option + +@item -L +Show license. + +@item -h, -?, -help, --help +Show help. + +@item -version +Show version. + +@item -formats +Show available formats. + +The fields preceding the format names have the following meanings: +@table @samp +@item D +Decoding available +@item E +Encoding available +@end table + +@item -codecs +Show available codecs. + +The fields preceding the codec names have the following meanings: +@table @samp +@item D +Decoding available +@item E +Encoding available +@item V/A/S +Video/audio/subtitle codec +@item S +Codec supports slices +@item D +Codec supports direct rendering +@item T +Codec can handle input truncated at random locations instead of only at frame boundaries +@end table + +@item -bsfs +Show available bitstream filters. + +@item -protocols +Show available protocols. + +@item -filters +Show available libavfilter filters. + +@item -pix_fmts +Show available pixel formats. + +@item -loglevel @var{loglevel} +Set the logging level used by the library. +@var{loglevel} is a number or a string containing one of the following values: +@table @samp +@item quiet +@item panic +@item fatal +@item error +@item warning +@item info +@item verbose +@item debug +@end table + +By default the program logs to stderr, if coloring is supported by the +terminal, colors are used to mark errors and warnings. Log coloring +can be disabled setting the environment variable +@env{FFMPEG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting +the environment variable @env{FFMPEG_FORCE_COLOR}. +The use of the environment variable @env{NO_COLOR} is deprecated and +will be dropped in a following FFmpeg version. + +@end table diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/filters.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/filters.texi new file mode 100644 index 00000000..38428865 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/filters.texi @@ -0,0 +1,1149 @@ +@chapter Filtergraph description +@c man begin FILTERGRAPH DESCRIPTION + +A filtergraph is a directed graph of connected filters. It can contain +cycles, and there can be multiple links between a pair of +filters. Each link has one input pad on one side connecting it to one +filter from which it takes its input, and one output pad on the other +side connecting it to the one filter accepting its output. + +Each filter in a filtergraph is an instance of a filter class +registered in the application, which defines the features and the +number of input and output pads of the filter. + +A filter with no input pads is called a "source", a filter with no +output pads is called a "sink". + +@section Filtergraph syntax + +A filtergraph can be represented using a textual representation, which +is recognized by the @code{-vf} and @code{-af} options of the ff* +tools, and by the @code{av_parse_graph()} function defined in +@file{libavfilter/avfiltergraph}. + +A filterchain consists of a sequence of connected filters, each one +connected to the previous one in the sequence. A filterchain is +represented by a list of ","-separated filter descriptions. + +A filtergraph consists of a sequence of filterchains. A sequence of +filterchains is represented by a list of ";"-separated filterchain +descriptions. + +A filter is represented by a string of the form: +[@var{in_link_1}]...[@var{in_link_N}]@var{filter_name}=@var{arguments}[@var{out_link_1}]...[@var{out_link_M}] + +@var{filter_name} is the name of the filter class of which the +described filter is an instance of, and has to be the name of one of +the filter classes registered in the program. +The name of the filter class is optionally followed by a string +"=@var{arguments}". + +@var{arguments} is a string which contains the parameters used to +initialize the filter instance, and are described in the filter +descriptions below. + +The list of arguments can be quoted using the character "'" as initial +and ending mark, and the character '\' for escaping the characters +within the quoted text; otherwise the argument string is considered +terminated when the next special character (belonging to the set +"[]=;,") is encountered. + +The name and arguments of the filter are optionally preceded and +followed by a list of link labels. +A link label allows to name a link and associate it to a filter output +or input pad. The preceding labels @var{in_link_1} +... @var{in_link_N}, are associated to the filter input pads, +the following labels @var{out_link_1} ... @var{out_link_M}, are +associated to the output pads. + +When two link labels with the same name are found in the +filtergraph, a link between the corresponding input and output pad is +created. + +If an output pad is not labelled, it is linked by default to the first +unlabelled input pad of the next filter in the filterchain. +For example in the filterchain: +@example +nullsrc, split[L1], [L2]overlay, nullsink +@end example +the split filter instance has two output pads, and the overlay filter +instance two input pads. The first output pad of split is labelled +"L1", the first input pad of overlay is labelled "L2", and the second +output pad of split is linked to the second input pad of overlay, +which are both unlabelled. + +In a complete filterchain all the unlabelled filter input and output +pads must be connected. A filtergraph is considered valid if all the +filter input and output pads of all the filterchains are connected. + +Follows a BNF description for the filtergraph syntax: +@example +@var{NAME} ::= sequence of alphanumeric characters and '_' +@var{LINKLABEL} ::= "[" @var{NAME} "]" +@var{LINKLABELS} ::= @var{LINKLABEL} [@var{LINKLABELS}] +@var{FILTER_ARGUMENTS} ::= sequence of chars (eventually quoted) +@var{FILTER} ::= [@var{LINKNAMES}] @var{NAME} ["=" @var{ARGUMENTS}] [@var{LINKNAMES}] +@var{FILTERCHAIN} ::= @var{FILTER} [,@var{FILTERCHAIN}] +@var{FILTERGRAPH} ::= @var{FILTERCHAIN} [;@var{FILTERGRAPH}] +@end example + +@c man end FILTERGRAPH DESCRIPTION + +@chapter Audio Filters +@c man begin AUDIO FILTERS + +When you configure your FFmpeg build, you can disable any of the +existing filters using --disable-filters. +The configure output will show the audio filters included in your +build. + +Below is a description of the currently available audio filters. + +@section anull + +Pass the audio source unchanged to the output. + +@c man end AUDIO FILTERS + +@chapter Audio Sources +@c man begin AUDIO SOURCES + +Below is a description of the currently available audio sources. + +@section anullsrc + +Null audio source, never return audio frames. It is mainly useful as a +template and to be employed in analysis / debugging tools. + +It accepts as optional parameter a string of the form +@var{sample_rate}:@var{channel_layout}. + +@var{sample_rate} specify the sample rate, and defaults to 44100. + +@var{channel_layout} specify the channel layout, and can be either an +integer or a string representing a channel layout. The default value +of @var{channel_layout} is 3, which corresponds to CH_LAYOUT_STEREO. + +Check the channel_layout_map definition in +@file{libavcodec/audioconvert.c} for the mapping between strings and +channel layout values. + +Follow some examples: +@example +# set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO. +anullsrc=48000:4 + +# same as +anullsrc=48000:mono +@end example + +@c man end AUDIO SOURCES + +@chapter Audio Sinks +@c man begin AUDIO SINKS + +Below is a description of the currently available audio sinks. + +@section anullsink + +Null audio sink, do absolutely nothing with the input audio. It is +mainly useful as a template and to be employed in analysis / debugging +tools. + +@c man end AUDIO SINKS + +@chapter Video Filters +@c man begin VIDEO FILTERS + +When you configure your FFmpeg build, you can disable any of the +existing filters using --disable-filters. +The configure output will show the video filters included in your +build. + +Below is a description of the currently available video filters. + +@section blackframe + +Detect frames that are (almost) completely black. Can be useful to +detect chapter transitions or commercials. Output lines consist of +the frame number of the detected frame, the percentage of blackness, +the position in the file if known or -1 and the timestamp in seconds. + +In order to display the output lines, you need to set the loglevel at +least to the AV_LOG_INFO value. + +The filter accepts the syntax: +@example +blackframe[=@var{amount}:[@var{threshold}]] +@end example + +@var{amount} is the percentage of the pixels that have to be below the +threshold, and defaults to 98. + +@var{threshold} is the threshold below which a pixel value is +considered black, and defaults to 32. + +@section copy + +Copy the input source unchanged to the output. Mainly useful for +testing purposes. + +@section crop + +Crop the input video to @var{out_w}:@var{out_h}:@var{x}:@var{y}. + +The parameters are expressions containing the following constants: + +@table @option +@item E, PI, PHI +the corresponding mathematical approximated values for e +(euler number), pi (greek PI), PHI (golden ratio) + +@item x, y +the computed values for @var{x} and @var{y}. They are evaluated for +each new frame. + +@item in_w, in_h +the input width and heigth + +@item iw, ih +same as @var{in_w} and @var{in_h} + +@item out_w, out_h +the output (cropped) width and heigth + +@item ow, oh +same as @var{out_w} and @var{out_h} + +@item n +the number of input frame, starting from 0 + +@item pos +the position in the file of the input frame, NAN if unknown + +@item t +timestamp expressed in seconds, NAN if the input timestamp is unknown + +@end table + +The @var{out_w} and @var{out_h} parameters specify the expressions for +the width and height of the output (cropped) video. They are +evaluated just at the configuration of the filter. + +The default value of @var{out_w} is "in_w", and the default value of +@var{out_h} is "in_h". + +The expression for @var{out_w} may depend on the value of @var{out_h}, +and the expression for @var{out_h} may depend on @var{out_w}, but they +cannot depend on @var{x} and @var{y}, as @var{x} and @var{y} are +evaluated after @var{out_w} and @var{out_h}. + +The @var{x} and @var{y} parameters specify the expressions for the +position of the top-left corner of the output (non-cropped) area. They +are evaluated for each frame. If the evaluated value is not valid, it +is approximated to the nearest valid value. + +The default value of @var{x} is "(in_w-out_w)/2", and the default +value for @var{y} is "(in_h-out_h)/2", which set the cropped area at +the center of the input image. + +The expression for @var{x} may depend on @var{y}, and the expression +for @var{y} may depend on @var{x}. + +Follow some examples: +@example +# crop the central input area with size 100x100 +crop=100:100 + +# crop the central input area with size 2/3 of the input video +"crop=2/3*in_w:2/3*in_h" + +# crop the input video central square +crop=in_h + +# delimit the rectangle with the top-left corner placed at position +# 100:100 and the right-bottom corner corresponding to the right-bottom +# corner of the input image. +crop=in_w-100:in_h-100:100:100 + +# crop 10 pixels from the left and right borders, and 20 pixels from +# the top and bottom borders +"crop=in_w-2*10:in_h-2*20" + +# keep only the bottom right quarter of the input image +"crop=in_w/2:in_h/2:in_w/2:in_h/2" + +# crop height for getting Greek harmony +"crop=in_w:1/PHI*in_w" + +# trembling effect +"crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)" + +# erratic camera effect depending on timestamp +"crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)" + +# set x depending on the value of y +"crop=in_w/2:in_h/2:y:10+10*sin(n/10)" +@end example + +@section cropdetect + +Auto-detect crop size. + +Calculate necessary cropping parameters and prints the recommended +parameters through the logging system. The detected dimensions +correspond to the non-black area of the input video. + +It accepts the syntax: +@example +cropdetect[=@var{limit}[:@var{round}[:@var{reset}]]] +@end example + +@table @option + +@item limit +Threshold, which can be optionally specified from nothing (0) to +everything (255), defaults to 24. + +@item round +Value which the width/height should be divisible by, defaults to +16. The offset is automatically adjusted to center the video. Use 2 to +get only even dimensions (needed for 4:2:2 video). 16 is best when +encoding to most video codecs. + +@item reset +Counter that determines after how many frames cropdetect will reset +the previously detected largest video area and start over to detect +the current optimal crop area. Defaults to 0. + +This can be useful when channel logos distort the video area. 0 +indicates never reset and return the largest area encountered during +playback. +@end table + +@section drawbox + +Draw a colored box on the input image. + +It accepts the syntax: +@example +drawbox=@var{x}:@var{y}:@var{width}:@var{height}:@var{color} +@end example + +@table @option + +@item x, y +Specify the top left corner coordinates of the box. Default to 0. + +@item width, height +Specify the width and height of the box, if 0 they are interpreted as +the input width and height. Default to 0. + +@item color +Specify the color of the box to write, it can be the name of a color +(case insensitive match) or a 0xRRGGBB[AA] sequence. +@end table + +Follow some examples: +@example +# draw a black box around the edge of the input image +drawbox + +# draw a box with color red and an opacity of 50% +drawbox=10:20:200:60:red@@0.5" +@end example + +@section fifo + +Buffer input images and send them when they are requested. + +This filter is mainly useful when auto-inserted by the libavfilter +framework. + +The filter does not take parameters. + +@section format + +Convert the input video to one of the specified pixel formats. +Libavfilter will try to pick one that is supported for the input to +the next filter. + +The filter accepts a list of pixel format names, separated by ":", +for example "yuv420p:monow:rgb24". + +Some examples follow: +@example +# convert the input video to the format "yuv420p" +format=yuv420p + +# convert the input video to any of the formats in the list +format=yuv420p:yuv444p:yuv410p +@end example + +@anchor{frei0r} +@section frei0r + +Apply a frei0r effect to the input video. + +To enable compilation of this filter you need to install the frei0r +header and configure FFmpeg with --enable-frei0r. + +The filter supports the syntax: +@example +@var{filter_name}[@{:|=@}@var{param1}:@var{param2}:...:@var{paramN}] +@end example + +@var{filter_name} is the name to the frei0r effect to load. If the +environment variable @env{FREI0R_PATH} is defined, the frei0r effect +is searched in each one of the directories specified by the colon +separated list in @env{FREIOR_PATH}, otherwise in the standard frei0r +paths, which are in this order: @file{HOME/.frei0r-1/lib/}, +@file{/usr/local/lib/frei0r-1/}, @file{/usr/lib/frei0r-1/}. + +@var{param1}, @var{param2}, ... , @var{paramN} specify the parameters +for the frei0r effect. + +A frei0r effect parameter can be a boolean (whose values are specified +with "y" and "n"), a double, a color (specified by the syntax +@var{R}/@var{G}/@var{B}, @var{R}, @var{G}, and @var{B} being float +numbers from 0.0 to 1.0) or by an @code{av_parse_color()} color +description), a position (specified by the syntax @var{X}/@var{Y}, +@var{X} and @var{Y} being float numbers) and a string. + +The number and kind of parameters depend on the loaded effect. If an +effect parameter is not specified the default value is set. + +Some examples follow: +@example +# apply the distort0r effect, set the first two double parameters +frei0r=distort0r:0.5:0.01 + +# apply the colordistance effect, takes a color as first parameter +frei0r=colordistance:0.2/0.3/0.4 +frei0r=colordistance:violet +frei0r=colordistance:0x112233 + +# apply the perspective effect, specify the top left and top right +# image positions +frei0r=perspective:0.2/0.2:0.8/0.2 +@end example + +For more information see: +@url{http://piksel.org/frei0r} + +@section gradfun + +Fix the banding artifacts that are sometimes introduced into nearly flat +regions by truncation to 8bit colordepth. +Interpolate the gradients that should go where the bands are, and +dither them. + +The filter takes two optional parameters, separated by ':': +@var{strength}:@var{radius} + +@var{strength} is the maximum amount by which the filter will change +any one pixel. Also the threshold for detecting nearly flat +regions. Acceptable values range from .51 to 255, default value is +1.2, out-of-range values will be clipped to the valid range. + +@var{radius} is the neighborhood to fit the gradient to. A larger +radius makes for smoother gradients, but also prevents the filter from +modifying the pixels near detailed regions. Acceptable values are +8-32, default value is 16, out-of-range values will be clipped to the +valid range. + +@example +# default parameters +gradfun=1.2:16 + +# omitting radius +gradfun=1.2 +@end example + +@section hflip + +Flip the input video horizontally. + +For example to horizontally flip the video in input with +@file{ffmpeg}: +@example +ffmpeg -i in.avi -vf "hflip" out.avi +@end example + +@section hqdn3d + +High precision/quality 3d denoise filter. This filter aims to reduce +image noise producing smooth images and making still images really +still. It should enhance compressibility. + +It accepts the following optional parameters: +@var{luma_spatial}:@var{chroma_spatial}:@var{luma_tmp}:@var{chroma_tmp} + +@table @option +@item luma_spatial +a non-negative float number which specifies spatial luma strength, +defaults to 4.0 + +@item chroma_spatial +a non-negative float number which specifies spatial chroma strength, +defaults to 3.0*@var{luma_spatial}/4.0 + +@item luma_tmp +a float number which specifies luma temporal strength, defaults to +6.0*@var{luma_spatial}/4.0 + +@item chroma_tmp +a float number which specifies chroma temporal strength, defaults to +@var{luma_tmp}*@var{chroma_spatial}/@var{luma_spatial} +@end table + +@section noformat + +Force libavfilter not to use any of the specified pixel formats for the +input to the next filter. + +The filter accepts a list of pixel format names, separated by ":", +for example "yuv420p:monow:rgb24". + +Some examples follow: +@example +# force libavfilter to use a format different from "yuv420p" for the +# input to the vflip filter +noformat=yuv420p,vflip + +# convert the input video to any of the formats not contained in the list +noformat=yuv420p:yuv444p:yuv410p +@end example + +@section null + +Pass the video source unchanged to the output. + +@section ocv + +Apply video transform using libopencv. + +To enable this filter install libopencv library and headers and +configure FFmpeg with --enable-libopencv. + +The filter takes the parameters: @var{filter_name}@{:=@}@var{filter_params}. + +@var{filter_name} is the name of the libopencv filter to apply. + +@var{filter_params} specifies the parameters to pass to the libopencv +filter. If not specified the default values are assumed. + +Refer to the official libopencv documentation for more precise +informations: +@url{http://opencv.willowgarage.com/documentation/c/image_filtering.html} + +Follows the list of supported libopencv filters. + +@anchor{dilate} +@subsection dilate + +Dilate an image by using a specific structuring element. +This filter corresponds to the libopencv function @code{cvDilate}. + +It accepts the parameters: @var{struct_el}:@var{nb_iterations}. + +@var{struct_el} represents a structuring element, and has the syntax: +@var{cols}x@var{rows}+@var{anchor_x}x@var{anchor_y}/@var{shape} + +@var{cols} and @var{rows} represent the number of colums and rows of +the structuring element, @var{anchor_x} and @var{anchor_y} the anchor +point, and @var{shape} the shape for the structuring element, and +can be one of the values "rect", "cross", "ellipse", "custom". + +If the value for @var{shape} is "custom", it must be followed by a +string of the form "=@var{filename}". The file with name +@var{filename} is assumed to represent a binary image, with each +printable character corresponding to a bright pixel. When a custom +@var{shape} is used, @var{cols} and @var{rows} are ignored, the number +or columns and rows of the read file are assumed instead. + +The default value for @var{struct_el} is "3x3+0x0/rect". + +@var{nb_iterations} specifies the number of times the transform is +applied to the image, and defaults to 1. + +Follow some example: +@example +# use the default values +ocv=dilate + +# dilate using a structuring element with a 5x5 cross, iterate two times +ocv=dilate=5x5+2x2/cross:2 + +# read the shape from the file diamond.shape, iterate two times +# the file diamond.shape may contain a pattern of characters like this: +# * +# *** +# ***** +# *** +# * +# the specified cols and rows are ignored (but not the anchor point coordinates) +ocv=0x0+2x2/custom=diamond.shape:2 +@end example + +@subsection erode + +Erode an image by using a specific structuring element. +This filter corresponds to the libopencv function @code{cvErode}. + +The filter accepts the parameters: @var{struct_el}:@var{nb_iterations}, +with the same meaning and use of those of the dilate filter +(@pxref{dilate}). + +@subsection smooth + +Smooth the input video. + +The filter takes the following parameters: +@var{type}:@var{param1}:@var{param2}:@var{param3}:@var{param4}. + +@var{type} is the type of smooth filter to apply, and can be one of +the following values: "blur", "blur_no_scale", "median", "gaussian", +"bilateral". The default value is "gaussian". + +@var{param1}, @var{param2}, @var{param3}, and @var{param4} are +parameters whose meanings depend on smooth type. @var{param1} and +@var{param2} accept integer positive values or 0, @var{param3} and +@var{param4} accept float values. + +The default value for @var{param1} is 3, the default value for the +other parameters is 0. + +These parameters correspond to the parameters assigned to the +libopencv function @code{cvSmooth}. + +@section overlay + +Overlay one video on top of another. + +It takes two inputs and one output, the first input is the "main" +video on which the second input is overlayed. + +It accepts the parameters: @var{x}:@var{y}. + +@var{x} is the x coordinate of the overlayed video on the main video, +@var{y} is the y coordinate. The parameters are expressions containing +the following parameters: + +@table @option +@item main_w, main_h +main input width and height + +@item W, H +same as @var{main_w} and @var{main_h} + +@item overlay_w, overlay_h +overlay input width and height + +@item w, h +same as @var{overlay_w} and @var{overlay_h} +@end table + +Be aware that frames are taken from each input video in timestamp +order, hence, if their initial timestamps differ, it is a a good idea +to pass the two inputs through a @var{setpts=PTS-STARTPTS} filter to +have them begin in the same zero timestamp, as it does the example for +the @var{movie} filter. + +Follow some examples: +@example +# draw the overlay at 10 pixels from the bottom right +# corner of the main video. +overlay=main_w-overlay_w-10:main_h-overlay_h-10 + +# insert a transparent PNG logo in the bottom left corner of the input +movie=0:png:logo.png [logo]; +[in][logo] overlay=10:main_h-overlay_h-10 [out] + +# insert 2 different transparent PNG logos (second logo on bottom +# right corner): +movie=0:png:logo1.png [logo1]; +movie=0:png:logo2.png [logo2]; +[in][logo1] overlay=10:H-h-10 [in+logo1]; +[in+logo1][logo2] overlay=W-w-10:H-h-10 [out] + +# add a transparent color layer on top of the main video, +# WxH specifies the size of the main input to the overlay filter +color=red@.3:WxH [over]; [in][over] overlay [out] +@end example + +You can chain togheter more overlays but the efficiency of such +approach is yet to be tested. + +@section pad + +Add paddings to the input image, and places the original input at the +given coordinates @var{x}, @var{y}. + +It accepts the following parameters: +@var{width}:@var{height}:@var{x}:@var{y}:@var{color}. + +Follows the description of the accepted parameters. + +@table @option +@item width, height + +Specify the size of the output image with the paddings added. If the +value for @var{width} or @var{height} is 0, the corresponding input size +is used for the output. + +The default value of @var{width} and @var{height} is 0. + +@item x, y + +Specify the offsets where to place the input image in the padded area +with respect to the top/left border of the output image. + +The default value of @var{x} and @var{y} is 0. + +@item color + +Specify the color of the padded area, it can be the name of a color +(case insensitive match) or a 0xRRGGBB[AA] sequence. + +The default value of @var{color} is "black". + +@end table + +For example: + +@example +# Add paddings with color "violet" to the input video. Output video +# size is 640x480, the top-left corner of the input video is placed at +# row 0, column 40. +pad=640:480:0:40:violet +@end example + +@section pixdesctest + +Pixel format descriptor test filter, mainly useful for internal +testing. The output video should be equal to the input video. + +For example: +@example +format=monow, pixdesctest +@end example + +can be used to test the monowhite pixel format descriptor definition. + +@section scale + +Scale the input video to @var{width}:@var{height} and/or convert the image format. + +For example the command: + +@example +./ffmpeg -i in.avi -vf "scale=200:100" out.avi +@end example + +will scale the input video to a size of 200x100. + +If the input image format is different from the format requested by +the next filter, the scale filter will convert the input to the +requested format. + +If the value for @var{width} or @var{height} is 0, the respective input +size is used for the output. + +If the value for @var{width} or @var{height} is -1, the scale filter will +use, for the respective output size, a value that maintains the aspect +ratio of the input image. + +The default value of @var{width} and @var{height} is 0. + +@section setpts + +Change the PTS (presentation timestamp) of the input video frames. + +Accept in input an expression evaluated through the eval API, which +can contain the following constants: + +@table @option +@item PTS +the presentation timestamp in input + +@item PI +Greek PI + +@item PHI +golden ratio + +@item E +Euler number + +@item N +the count of the input frame, starting from 0. + +@item STARTPTS +the PTS of the first video frame + +@item INTERLACED +tell if the current frame is interlaced + +@item POS +original position in the file of the frame, or undefined if undefined +for the current frame + +@item PREV_INPTS +previous input PTS + +@item PREV_OUTPTS +previous output PTS + +@end table + +Some examples follow: + +@example +# start counting PTS from zero +setpts=PTS-STARTPTS + +# fast motion +setpts=0.5*PTS + +# slow motion +setpts=2.0*PTS + +# fixed rate 25 fps +setpts=N/(25*TB) + +# fixed rate 25 fps with some jitter +setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))' +@end example + +@section settb + +Set the timebase to use for the output frames timestamps. +It is mainly useful for testing timebase configuration. + +It accepts in input an arithmetic expression representing a rational. +The expression can contain the constants "PI", "E", "PHI", "AVTB" (the +default timebase), and "intb" (the input timebase). + +The default value for the input is "intb". + +Follow some examples. + +@example +# set the timebase to 1/25 +settb=1/25 + +# set the timebase to 1/10 +settb=0.1 + +#set the timebase to 1001/1000 +settb=1+0.001 + +#set the timebase to 2*intb +settb=2*intb + +#set the default timebase value +settb=AVTB +@end example + +@section slicify + +Pass the images of input video on to next video filter as multiple +slices. + +@example +./ffmpeg -i in.avi -vf "slicify=32" out.avi +@end example + +The filter accepts the slice height as parameter. If the parameter is +not specified it will use the default value of 16. + +Adding this in the beginning of filter chains should make filtering +faster due to better use of the memory cache. + +@section transpose + +Transpose rows with columns in the input video and optionally flip it. + +It accepts a parameter representing an integer, which can assume the +values: + +@table @samp +@item 0 +Rotate by 90 degrees counterclockwise and vertically flip (default), that is: +@example +L.R L.l +. . -> . . +l.r R.r +@end example + +@item 1 +Rotate by 90 degrees clockwise, that is: +@example +L.R l.L +. . -> . . +l.r r.R +@end example + +@item 2 +Rotate by 90 degrees counterclockwise, that is: +@example +L.R R.r +. . -> . . +l.r L.l +@end example + +@item 3 +Rotate by 90 degrees clockwise and vertically flip, that is: +@example +L.R r.R +. . -> . . +l.r l.L +@end example +@end table + +@section unsharp + +Sharpen or blur the input video. + +It accepts the following parameters: +@var{luma_msize_x}:@var{luma_msize_y}:@var{luma_amount}:@var{chroma_msize_x}:@var{chroma_msize_y}:@var{chroma_amount} + +Negative values for the amount will blur the input video, while positive +values will sharpen. All parameters are optional and default to the +equivalent of the string '5:5:1.0:0:0:0.0'. + +@table @option + +@item luma_msize_x +Set the luma matrix horizontal size. It can be an integer between 3 +and 13, default value is 5. + +@item luma_msize_y +Set the luma matrix vertical size. It can be an integer between 3 +and 13, default value is 5. + +@item luma_amount +Set the luma effect strength. It can be a float number between -2.0 +and 5.0, default value is 1.0. + +@item chroma_msize_x +Set the chroma matrix horizontal size. It can be an integer between 3 +and 13, default value is 0. + +@item chroma_msize_y +Set the chroma matrix vertical size. It can be an integer between 3 +and 13, default value is 0. + +@item luma_amount +Set the chroma effect strength. It can be a float number between -2.0 +and 5.0, default value is 0.0. + +@end table + +@example +# Strong luma sharpen effect parameters +unsharp=7:7:2.5 + +# Strong blur of both luma and chroma parameters +unsharp=7:7:-2:7:7:-2 + +# Use the default values with @command{ffmpeg} +./ffmpeg -i in.avi -vf "unsharp" out.mp4 +@end example + +@section vflip + +Flip the input video vertically. + +@example +./ffmpeg -i in.avi -vf "vflip" out.avi +@end example + +@section yadif + +Deinterlace the input video ("yadif" means "yet another deinterlacing +filter"). + +It accepts the optional parameters: @var{mode}:@var{parity}. + +@var{mode} specifies the interlacing mode to adopt, accepts one of the +following values: + +@table @option +@item 0 +output 1 frame for each frame +@item 1 +output 1 frame for each field +@item 2 +like 0 but skips spatial interlacing check +@item 3 +like 1 but skips spatial interlacing check +@end table + +Default value is 0. + +@var{parity} specifies the picture field parity assumed for the input +interlaced video, accepts one of the following values: + +@table @option +@item 0 +assume bottom field first +@item 1 +assume top field first +@item -1 +enable automatic detection +@end table + +Default value is -1. +If interlacing is unknown or decoder does not export this information, +top field first will be assumed. + +@c man end VIDEO FILTERS + +@chapter Video Sources +@c man begin VIDEO SOURCES + +Below is a description of the currently available video sources. + +@section buffer + +Buffer video frames, and make them available to the filter chain. + +This source is mainly intended for a programmatic use, in particular +through the interface defined in @file{libavfilter/vsrc_buffer.h}. + +It accepts the following parameters: +@var{width}:@var{height}:@var{pix_fmt_string}:@var{timebase_num}:@var{timebase_den} + +All the parameters need to be explicitely defined. + +Follows the list of the accepted parameters. + +@table @option + +@item width, height +Specify the width and height of the buffered video frames. + +@item pix_fmt_string +A string representing the pixel format of the buffered video frames. +It may be a number corresponding to a pixel format, or a pixel format +name. + +@item timebase_num, timebase_den +Specify numerator and denomitor of the timebase assumed by the +timestamps of the buffered frames. +@end table + +For example: +@example +buffer=320:240:yuv410p:1:24 +@end example + +will instruct the source to accept video frames with size 320x240 and +with format "yuv410p" and assuming 1/24 as the timestamps timebase. +Since the pixel format with name "yuv410p" corresponds to the number 6 +(check the enum PixelFormat definition in @file{libavutil/pixfmt.h}), +this example corresponds to: +@example +buffer=320:240:6:1:24 +@end example + +@section color + +Provide an uniformly colored input. + +It accepts the following parameters: +@var{color}:@var{frame_size}:@var{frame_rate} + +Follows the description of the accepted parameters. + +@table @option + +@item color +Specify the color of the source. It can be the name of a color (case +insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an +alpha specifier. The default value is "black". + +@item frame_size +Specify the size of the sourced video, it may be a string of the form +@var{width}x@var{heigth}, or the name of a size abbreviation. The +default value is "320x240". + +@item frame_rate +Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +@var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float +number or a valid video frame rate abbreviation. The default value is +"25". + +@end table + +For example the following graph description will generate a red source +with an opacity of 0.2, with size "qcif" and a frame rate of 10 +frames per second, which will be overlayed over the source connected +to the pad with identifier "in". + +@example +"color=red@@0.2:qcif:10 [color]; [in][color] overlay [out]" +@end example + +@section nullsrc + +Null video source, never return images. It is mainly useful as a +template and to be employed in analysis / debugging tools. + +It accepts as optional parameter a string of the form +@var{width}:@var{height}:@var{timebase}. + +@var{width} and @var{height} specify the size of the configured +source. The default values of @var{width} and @var{height} are +respectively 352 and 288 (corresponding to the CIF size format). + +@var{timebase} specifies an arithmetic expression representing a +timebase. The expression can contain the constants "PI", "E", "PHI", +"AVTB" (the default timebase), and defaults to the value "AVTB". + +@section frei0r_src + +Provide a frei0r source. + +To enable compilation of this filter you need to install the frei0r +header and configure FFmpeg with --enable-frei0r. + +The source supports the syntax: +@example +@var{size}:@var{rate}:@var{src_name}[@{=|:@}@var{param1}:@var{param2}:...:@var{paramN}] +@end example + +@var{size} is the size of the video to generate, may be a string of the +form @var{width}x@var{height} or a frame size abbreviation. +@var{rate} is the rate of the video to generate, may be a string of +the form @var{num}/@var{den} or a frame rate abbreviation. +@var{src_name} is the name to the frei0r source to load. For more +information regarding frei0r and how to set the parameters read the +section "frei0r" (@pxref{frei0r}) in the description of the video +filters. + +Some examples follow: +@example +# generate a frei0r partik0l source with size 200x200 and framerate 10 +# which is overlayed on the overlay filter main input +frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay +@end example + +@c man end VIDEO SOURCES + +@chapter Video Sinks +@c man begin VIDEO SINKS + +Below is a description of the currently available video sinks. + +@section nullsink + +Null video sink, do absolutely nothing with the input video. It is +mainly useful as a template and to be employed in analysis / debugging +tools. + +@c man end VIDEO SINKS + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/git-howto.txt b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/git-howto.txt new file mode 100644 index 00000000..519c8970 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/git-howto.txt @@ -0,0 +1,259 @@ + +About Git write access: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Before everything else, you should know how to use GIT properly. +Luckily Git comes with excellent documentation. + + git --help + man git + +shows you the available subcommands, + + git --help + man git- + +shows information about the subcommand . + +The most comprehensive manual is the website Git Reference + +http://gitref.org/ + +For more information about the Git project, visit + +http://git-scm.com/ + +Consult these resources whenever you have problems, they are quite exhaustive. + +You do not need a special username or password. +All you need is to provide a ssh public key to the Git server admin. + +What follows now is a basic introduction to Git and some FFmpeg-specific +guidelines. Read it at least once, if you are granted commit privileges to the +FFmpeg project you are expected to be familiar with these rules. + + + +I. BASICS: +========== + +0. Get GIT: + + You can get git from http://git-scm.com/ + + +1. Cloning the source tree: + + git clone git://git.ffmpeg.org/ffmpeg.git + + This will put the FFmpeg sources into the directory . + + git clone git@git.ffmpeg.org:ffmpeg.git + + This will put the FFmpeg sources into the directory and let + you push back your changes to the remote repository. + + +2. Updating the source tree to the latest revision: + + git pull (--ff-only) + + pulls in the latest changes from the tracked branch. The tracked branch + can be remote. By default the master branch tracks the branch master in + the remote origin. + Caveat: Since merge commits are forbidden at least for the initial + months of git --ff-only or --rebase (see below) are recommended. + --ff-only will fail and not create merge commits if your branch + has diverged (has a different history) from the tracked branch. + +2.a Rebasing your local branches: + + git pull --rebase + + fetches the changes from the main repository and replays your local commits + over it. This is required to keep all your local changes at the top of + FFmpeg's master tree. The master tree will reject pushes with merge commits. + + +3. Adding/removing files/directories: + + git add [-A] + git rm [-r] + + GIT needs to get notified of all changes you make to your working + directory that makes files appear or disappear. + Line moves across files are automatically tracked. + + +4. Showing modifications: + + git diff + + will show all local modifications in your working directory as unified diff. + + +5. Inspecting the changelog: + + git log + + You may also use the graphical tools like gitview or gitk or the web + interface available at http://git.ffmpeg.org/ + +6. Checking source tree status: + + git status + + detects all the changes you made and lists what actions will be taken in case + of a commit (additions, modifications, deletions, etc.). + + +7. Committing: + + git diff --check + + to double check your changes before committing them to avoid trouble later + on. All experienced developers do this on each and every commit, no matter + how small. + Every one of them has been saved from looking like a fool by this many times. + It's very easy for stray debug output or cosmetic modifications to slip in, + please avoid problems through this extra level of scrutiny. + + For cosmetics-only commits you should get (almost) empty output from + + git diff -wb + + Also check the output of + + git status + + to make sure you don't have untracked files or deletions. + + git add [-i|-p|-A] + + Make sure you have told git your name and email address, e.g. by running + git config --global user.name "My Name" + git config --global user.email my@email.invalid + (--global to set the global configuration for all your git checkouts). + + Git will select the changes to the files for commit. Optionally you can use + the interactive or the patch mode to select hunk by hunk what should be + added to the commit. + + git commit + + Git will commit the selected changes to your current local branch. + + You will be prompted for a log message in an editor, which is either + set in your personal configuration file through + + git config core.editor + + or set by one of the following environment variables: + GIT_EDITOR, VISUAL or EDITOR. + + Log messages should be concise but descriptive. Explain why you made a change, + what you did will be obvious from the changes themselves most of the time. + Saying just "bug fix" or "10l" is bad. Remember that people of varying skill + levels look at and educate themselves while reading through your code. Don't + include filenames in log messages, Git provides that information. + + Possibly make the commit message have a terse, descriptive first line, an + empty line and then a full description. The first line will be used to name + the patch by git format-patch. + + +8. Renaming/moving/copying files or contents of files: + + Git automatically tracks such changes, making those normal commits. + + mv/cp path/file otherpath/otherfile + + git add [-A] . + + git commit + + Do not move, rename or copy files of which you are not the maintainer without + discussing it on the mailing list first! + +9. Reverting broken commits + + git revert + + git revert will generate a revert commit. This will not make the faulty + commit disappear from the history. + + git reset + + git reset will uncommit the changes till rewriting the current + branch history. + + git commit --amend + + allows to amend the last commit details quickly. + + git rebase -i origin/master + + will replay local commits over the main repository allowing to edit, + merge or remove some of them in the process. + + Note that the reset, commit --amend and rebase rewrite history, so you + should use them ONLY on your local or topic branches. + + The main repository will reject those changes. + +10. Preparing a patchset. + + git format-patch [-o directory] + + will generate a set of patches out of the current branch starting from + commit. By default the patches are created in the current directory. + +11. Sending patches for review + + git send-email + + will send the patches created by git format-patch or directly generates + them. All the email fields can be configured in the global/local + configuration or overridden by command line. + +12. Pushing changes to remote trees + + git push + + Will push the changes to the default remote (origin). + Git will prevent you from pushing changes if the local and remote trees are + out of sync. Refer to 2 and 2.a to sync the local tree. + + git remote add + + Will add additional remote with a name reference, it is useful if you want + to push your local branch for review on a remote host. + + git push + + Will push the changes to the remote repository. Omitting refspec makes git + push update all the remote branches matching the local ones. + +13. Finding a specific svn revision + + Since version 1.7.1 git supports ':/foo' syntax for specifying commits + based on a regular expression. see man gitrevisions + + git show :/'as revision 23456' + + will show the svn changeset r23456. With older git versions searching in + the git log output is the easiest option (especially if a pager with + search capabilities is used). + This commit can be checked out with + + git checkout -b svn_23456 :/'as revision 23456' + + or for git < 1.7.1 with + + git checkout -b svn_23456 $SHA1 + + where $SHA1 is the commit SHA1 from the 'git log' output. + + +Contact the project admins if you have technical +problems with the GIT server. diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/indevs.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/indevs.texi new file mode 100644 index 00000000..8e862ff6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/indevs.texi @@ -0,0 +1,212 @@ +@chapter Input Devices +@c man begin INPUT DEVICES + +Input devices are configured elements in FFmpeg which allow to access +the data coming from a multimedia device attached to your system. + +When you configure your FFmpeg build, all the supported input devices +are enabled by default. You can list all available ones using the +configure option "--list-indevs". + +You can disable all the input devices using the configure option +"--disable-indevs", and selectively enable an input device using the +option "--enable-indev=@var{INDEV}", or you can disable a particular +input device using the option "--disable-indev=@var{INDEV}". + +The option "-formats" of the ff* tools will display the list of +supported input devices (amongst the demuxers). + +A description of the currently available input devices follows. + +@section alsa + +ALSA (Advanced Linux Sound Architecture) input device. + +To enable this input device during configuration you need libasound +installed on your system. + +This device allows capturing from an ALSA device. The name of the +device to capture has to be an ALSA card identifier. + +An ALSA identifier has the syntax: +@example +hw:@var{CARD}[,@var{DEV}[,@var{SUBDEV}]] +@end example + +where the @var{DEV} and @var{SUBDEV} components are optional. + +The three arguments (in order: @var{CARD},@var{DEV},@var{SUBDEV}) +specify card number or identifier, device number and subdevice number +(-1 means any). + +To see the list of cards currently recognized by your system check the +files @file{/proc/asound/cards} and @file{/proc/asound/devices}. + +For example to capture with @file{ffmpeg} from an ALSA device with +card id 0, you may run the command: +@example +ffmpeg -f alsa -i hw:0 alsaout.wav +@end example + +For more information see: +@url{http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html} + +@section bktr + +BSD video input device. + +@section dv1394 + +Linux DV 1394 input device. + +@section jack + +JACK input device. + +To enable this input device during configuration you need libjack +installed on your system. + +A JACK input device creates one or more JACK writable clients, one for +each audio channel, with name @var{client_name}:input_@var{N}, where +@var{client_name} is the name provided by the application, and @var{N} +is a number which identifies the channel. +Each writable client will send the acquired data to the FFmpeg input +device. + +Once you have created one or more JACK readable clients, you need to +connect them to one or more JACK writable clients. + +To connect or disconnect JACK clients you can use the +@file{jack_connect} and @file{jack_disconnect} programs, or do it +through a graphical interface, for example with @file{qjackctl}. + +To list the JACK clients and their properties you can invoke the command +@file{jack_lsp}. + +Follows an example which shows how to capture a JACK readable client +with @file{ffmpeg}. +@example +# Create a JACK writable client with name "ffmpeg". +$ ffmpeg -f jack -i ffmpeg -y out.wav + +# Start the sample jack_metro readable client. +$ jack_metro -b 120 -d 0.2 -f 4000 + +# List the current JACK clients. +$ jack_lsp -c +system:capture_1 +system:capture_2 +system:playback_1 +system:playback_2 +ffmpeg:input_1 +metro:120_bpm + +# Connect metro to the ffmpeg writable client. +$ jack_connect metro:120_bpm ffmpeg:input_1 +@end example + +For more information read: +@url{http://jackaudio.org/} + +@section libdc1394 + +IIDC1394 input device, based on libdc1394 and libraw1394. + +@section oss + +Open Sound System input device. + +The filename to provide to the input device is the device node +representing the OSS input device, and is usually set to +@file{/dev/dsp}. + +For example to grab from @file{/dev/dsp} using @file{ffmpeg} use the +command: +@example +ffmpeg -f oss -i /dev/dsp /tmp/oss.wav +@end example + +For more information about OSS see: +@url{http://manuals.opensound.com/usersguide/dsp.html} + +@section video4linux and video4linux2 + +Video4Linux and Video4Linux2 input video devices. + +The name of the device to grab is a file device node, usually Linux +systems tend to automatically create such nodes when the device +(e.g. an USB webcam) is plugged into the system, and has a name of the +kind @file{/dev/video@var{N}}, where @var{N} is a number associated to +the device. + +Video4Linux and Video4Linux2 devices only support a limited set of +@var{width}x@var{height} sizes and framerates. You can check which are +supported for example with the command @file{dov4l} for Video4Linux +devices and the command @file{v4l-info} for Video4Linux2 devices. + +If the size for the device is set to 0x0, the input device will +try to autodetect the size to use. +Only for the video4linux2 device, if the frame rate is set to 0/0 the +input device will use the frame rate value already set in the driver. + +Video4Linux support is deprecated since Linux 2.6.30, and will be +dropped in later versions. + +Follow some usage examples of the video4linux devices with the ff* +tools. +@example +# Grab and show the input of a video4linux device, frame rate is set +# to the default of 25/1. +ffplay -s 320x240 -f video4linux /dev/video0 + +# Grab and show the input of a video4linux2 device, autoadjust size. +ffplay -f video4linux2 /dev/video0 + +# Grab and record the input of a video4linux2 device, autoadjust size, +# frame rate value defaults to 0/0 so it is read from the video4linux2 +# driver. +ffmpeg -f video4linux2 -i /dev/video0 out.mpeg +@end example + +@section vfwcap + +VfW (Video for Windows) capture input device. + +The filename passed as input is the capture driver number, ranging from +0 to 9. You may use "list" as filename to print a list of drivers. Any +other filename will be interpreted as device number 0. + +@section x11grab + +X11 video input device. + +This device allows to capture a region of an X11 display. + +The filename passed as input has the syntax: +@example +[@var{hostname}]:@var{display_number}.@var{screen_number}[+@var{x_offset},@var{y_offset}] +@end example + +@var{hostname}:@var{display_number}.@var{screen_number} specifies the +X11 display name of the screen to grab from. @var{hostname} can be +ommitted, and defaults to "localhost". The environment variable +@env{DISPLAY} contains the default display name. + +@var{x_offset} and @var{y_offset} specify the offsets of the grabbed +area with respect to the top-left border of the X11 screen. They +default to 0. + +Check the X11 documentation (e.g. man X) for more detailed information. + +Use the @file{dpyinfo} program for getting basic information about the +properties of your X11 display (e.g. grep for "name" or "dimensions"). + +For example to grab from @file{:0.0} using @file{ffmpeg}: +@example +ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg + +# Grab at position 10,20. +ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg +@end example + +@c man end INPUT DEVICES diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/libavfilter.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/libavfilter.texi new file mode 100644 index 00000000..f0b44825 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/libavfilter.texi @@ -0,0 +1,105 @@ +\input texinfo @c -*- texinfo -*- + +@settitle Libavfilter Documentation +@titlepage +@center @titlefont{Libavfilter Documentation} +@end titlepage + +@top + +@contents + +@chapter Introduction + +Libavfilter is the filtering API of FFmpeg. It is the substitute of the +now deprecated 'vhooks' and started as a Google Summer of Code project. + +Integrating libavfilter into the main FFmpeg repository is a work in +progress. If you wish to try the unfinished development code of +libavfilter then check it out from the libavfilter repository into +some directory of your choice by: + +@example + svn checkout svn://svn.ffmpeg.org/soc/libavfilter +@end example + +And then read the README file in the top directory to learn how to +integrate it into ffmpeg and ffplay. + +But note that there may still be serious bugs in the code and its API +and ABI should not be considered stable yet! + +@chapter Tutorial + +In libavfilter, it is possible for filters to have multiple inputs and +multiple outputs. +To illustrate the sorts of things that are possible, we can +use a complex filter graph. For example, the following one: + +@example +input --> split --> fifo -----------------------> overlay --> output + | ^ + | | + +------> fifo --> crop --> vflip --------+ +@end example + +splits the stream in two streams, sends one stream through the crop filter +and the vflip filter before merging it back with the other stream by +overlaying it on top. You can use the following command to achieve this: + +@example +./ffmpeg -i in.avi -s 240x320 -vf "[in] split [T1], fifo, [T2] overlay= 0:240 [out]; [T1] fifo, crop=0:0:-1:240, vflip [T2] +@end example + +where input_video.avi has a vertical resolution of 480 pixels. The +result will be that in output the top half of the video is mirrored +onto the bottom half. + +Video filters are loaded using the @var{-vf} option passed to +ffmpeg or to ffplay. Filters in the same linear chain are separated by +commas. In our example, @var{split, fifo, overlay} are in one linear +chain, and @var{fifo, crop, vflip} are in another. The points where +the linear chains join are labeled by names enclosed in square +brackets. In our example, that is @var{[T1]} and @var{[T2]}. The magic +labels @var{[in]} and @var{[out]} are the points where video is input +and output. + +Some filters take in input a list of parameters: they are specified +after the filter name and an equal sign, and are separated each other +by a semicolon. + +There exist so-called @var{source filters} that do not have a video +input, and we expect in the future some @var{sink filters} that will +not have video output. + +@chapter graph2dot + +The @file{graph2dot} program included in the FFmpeg @file{tools} +directory can be used to parse a filter graph description and issue a +corresponding textual representation in the dot language. + +Invoke the command: +@example +graph2dot -h +@end example + +to see how to use @file{graph2dot}. + +You can then pass the dot description to the @file{dot} program (from +the graphviz suite of programs) and obtain a graphical representation +of the filter graph. + +For example the sequence of commands: +@example +echo @var{GRAPH_DESCRIPTION} | \ +tools/graph2dot -o graph.tmp && \ +dot -Tpng graph.tmp -o graph.png && \ +display graph.png +@end example + +can be used to create and display an image representing the graph +described by the @var{GRAPH_DESCRIPTION} string. + +@include filters.texi + +@bye diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/metadata.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/metadata.texi new file mode 100644 index 00000000..2a285757 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/metadata.texi @@ -0,0 +1,68 @@ +@chapter Metadata +@c man begin METADATA + +FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded +INI-like text file and then load it back using the metadata muxer/demuxer. + +The file format is as follows: +@enumerate + +@item +A file consists of a header and a number of metadata tags divided into sections, +each on its own line. + +@item +The header is a ';FFMETADATA' string, followed by a version number (now 1). + +@item +Metadata tags are of the form 'key=value' + +@item +Immediately after header follows global metadata + +@item +After global metadata there may be sections with per-stream/per-chapter +metadata. + +@item +A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in +brackets ('[', ']') and ends with next section or end of file. + +@item +At the beginning of a chapter section there may be an optional timebase to be +used for start/end values. It must be in form 'TIMEBASE=num/den', where num and +den are integers. If the timebase is missing then start/end times are assumed to +be in milliseconds. +Next a chapter section must contain chapter start and end times in form +'START=num', 'END=num', where num is a positive integer. + +@item +Empty lines and lines starting with ';' or '#' are ignored. + +@item +Metadata keys or values containing special characters ('=', ';', '#', '\' and a +newline) must be escaped with a backslash '\'. + +@item +Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of +the tag (in the example above key is 'foo ', value is ' bar'). +@end enumerate + +A ffmetadata file might look like this: +@example +;FFMETADATA1 +title=bike\\shed +;this is a comment +artist=FFmpeg troll team + +[CHAPTER] +TIMEBASE=1/1000 +START=0 +#chapter ends at 0:01:00 +END=60000 +title=chapter \#1 +[STREAM] +title=multi\ +line +@end example +@c man end METADATA diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/muxers.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/muxers.texi new file mode 100644 index 00000000..d98abefd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/muxers.texi @@ -0,0 +1,112 @@ +@chapter Muxers +@c man begin MUXERS + +Muxers are configured elements in FFmpeg which allow writing +multimedia streams to a particular type of file. + +When you configure your FFmpeg build, all the supported muxers +are enabled by default. You can list all available muxers using the +configure option @code{--list-muxers}. + +You can disable all the muxers with the configure option +@code{--disable-muxers} and selectively enable / disable single muxers +with the options @code{--enable-muxer=@var{MUXER}} / +@code{--disable-muxer=@var{MUXER}}. + +The option @code{-formats} of the ff* tools will display the list of +enabled muxers. + +A description of some of the currently available muxers follows. + +@section image2 + +Image file muxer. + +This muxer writes video frames to multiple image files specified by a +pattern. + +The pattern may contain the string "%d" or "%0@var{N}d", which +specifies the position of the characters representing a numbering in +the filenames. If the form "%d0@var{N}d" is used, the string +representing the number in each filename is 0-padded to @var{N} +digits. The literal character '%' can be specified in the pattern with +the string "%%". + +If the pattern contains "%d" or "%0@var{N}d", the first filename of +the file list specified will contain the number 1, all the following +numbers will be sequential. + +The pattern may contain a suffix which is used to automatically +determine the format of the image files to write. + +For example the pattern "img-%03d.bmp" will specify a sequence of +filenames of the form @file{img-001.bmp}, @file{img-002.bmp}, ..., +@file{img-010.bmp}, etc. +The pattern "img%%-%d.jpg" will specify a sequence of filenames of the +form @file{img%-1.jpg}, @file{img%-2.jpg}, ..., @file{img%-10.jpg}, +etc. + +The following example shows how to use @file{ffmpeg} for creating a +sequence of files @file{img-001.jpeg}, @file{img-002.jpeg}, ..., +taking one image every second from the input video: +@example +ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg' +@end example + +Note that with @file{ffmpeg}, if the format is not specified with the +@code{-f} option and the output filename specifies an image file +format, the image2 muxer is automatically selected, so the previous +command can be written as: +@example +ffmpeg -i in.avi -r 1 'img-%03d.jpeg' +@end example + +Note also that the pattern must not necessarily contain "%d" or +"%0@var{N}d", for example to create a single image file +@file{img.jpeg} from the input video you can employ the command: +@example +ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg +@end example + +@section mpegts + +MPEG transport stream muxer. + +This muxer implements ISO 13818-1 and part of ETSI EN 300 468. + +The muxer options are: + +@table @option +@item -mpegts_original_network_id @var{number} +Set the original_network_id (default 0x0001). This is unique identifier +of a network in DVB. Its main use is in the unique identification of a +service through the path Original_Network_ID, Transport_Stream_ID. +@item -mpegts_transport_stream_id @var{number} +Set the transport_stream_id (default 0x0001). This identifies a +transponder in DVB. +@item -mpegts_service_id @var{number} +Set the service_id (default 0x0001) also known as program in DVB. +@item -mpegts_pmt_start_pid @var{number} +Set the first PID for PMT (default 0x1000, max 0x1f00). +@item -mpegts_start_pid @var{number} +Set the first PID for data packets (default 0x0100, max 0x0f00). +@end table + +The recognized metadata settings in mpegts muxer are @code{service_provider} +and @code{service_name}. If they are not set the default for +@code{service_provider} is "FFmpeg" and the default for +@code{service_name} is "Service01". + +@example +ffmpeg -i file.mpg -acodec copy -vcodec copy \ + -mpegts_original_network_id 0x1122 \ + -mpegts_transport_stream_id 0x3344 \ + -mpegts_service_id 0x5566 \ + -mpegts_pmt_start_pid 0x1500 \ + -mpegts_start_pid 0x150 \ + -metadata service_provider="Some provider" \ + -metadata service_name="Some Channel" \ + -y out.ts +@end example + +@c man end MUXERS diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/outdevs.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/outdevs.texi new file mode 100644 index 00000000..3c0acee9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/outdevs.texi @@ -0,0 +1,29 @@ +@chapter Output Devices +@c man begin OUTPUT DEVICES + +Output devices are configured elements in FFmpeg which allow to write +multimedia data to an output device attached to your system. + +When you configure your FFmpeg build, all the supported output devices +are enabled by default. You can list all available ones using the +configure option "--list-outdevs". + +You can disable all the output devices using the configure option +"--disable-outdevs", and selectively enable an output device using the +option "--enable-outdev=@var{OUTDEV}", or you can disable a particular +input device using the option "--disable-outdev=@var{OUTDEV}". + +The option "-formats" of the ff* tools will display the list of +enabled output devices (amongst the muxers). + +A description of the currently available output devices follows. + +@section alsa + +ALSA (Advanced Linux Sound Architecture) output device. + +@section oss + +OSS (Open Sound System) output device. + +@c man end OUTPUT DEVICES diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/protocols.texi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/protocols.texi new file mode 100644 index 00000000..29f5c90d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/protocols.texi @@ -0,0 +1,447 @@ +@chapter Protocols +@c man begin PROTOCOLS + +Protocols are configured elements in FFmpeg which allow to access +resources which require the use of a particular protocol. + +When you configure your FFmpeg build, all the supported protocols are +enabled by default. You can list all available ones using the +configure option "--list-protocols". + +You can disable all the protocols using the configure option +"--disable-protocols", and selectively enable a protocol using the +option "--enable-protocol=@var{PROTOCOL}", or you can disable a +particular protocol using the option +"--disable-protocol=@var{PROTOCOL}". + +The option "-protocols" of the ff* tools will display the list of +supported protocols. + +A description of the currently available protocols follows. + +@section concat + +Physical concatenation protocol. + +Allow to read and seek from many resource in sequence as if they were +a unique resource. + +A URL accepted by this protocol has the syntax: +@example +concat:@var{URL1}|@var{URL2}|...|@var{URLN} +@end example + +where @var{URL1}, @var{URL2}, ..., @var{URLN} are the urls of the +resource to be concatenated, each one possibly specifying a distinct +protocol. + +For example to read a sequence of files @file{split1.mpeg}, +@file{split2.mpeg}, @file{split3.mpeg} with @file{ffplay} use the +command: +@example +ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg +@end example + +Note that you may need to escape the character "|" which is special for +many shells. + +@section file + +File access protocol. + +Allow to read from or read to a file. + +For example to read from a file @file{input.mpeg} with @file{ffmpeg} +use the command: +@example +ffmpeg -i file:input.mpeg output.mpeg +@end example + +The ff* tools default to the file protocol, that is a resource +specified with the name "FILE.mpeg" is interpreted as the URL +"file:FILE.mpeg". + +@section gopher + +Gopher protocol. + +@section http + +HTTP (Hyper Text Transfer Protocol). + +@section mmst + +MMS (Microsoft Media Server) protocol over TCP. + +@section mmsh + +MMS (Microsoft Media Server) protocol over HTTP. + +The required syntax is: +@example +mmsh://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] +@end example + +@section md5 + +MD5 output protocol. + +Computes the MD5 hash of the data to be written, and on close writes +this to the designated output or stdout if none is specified. It can +be used to test muxers without writing an actual file. + +Some examples follow. +@example +# Write the MD5 hash of the encoded AVI file to the file output.avi.md5. +ffmpeg -i input.flv -f avi -y md5:output.avi.md5 + +# Write the MD5 hash of the encoded AVI file to stdout. +ffmpeg -i input.flv -f avi -y md5: +@end example + +Note that some formats (typically MOV) require the output protocol to +be seekable, so they will fail with the MD5 output protocol. + +@section pipe + +UNIX pipe access protocol. + +Allow to read and write from UNIX pipes. + +The accepted syntax is: +@example +pipe:[@var{number}] +@end example + +@var{number} is the number corresponding to the file descriptor of the +pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If @var{number} +is not specified, by default the stdout file descriptor will be used +for writing, stdin for reading. + +For example to read from stdin with @file{ffmpeg}: +@example +cat test.wav | ffmpeg -i pipe:0 +# ...this is the same as... +cat test.wav | ffmpeg -i pipe: +@end example + +For writing to stdout with @file{ffmpeg}: +@example +ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi +# ...this is the same as... +ffmpeg -i test.wav -f avi pipe: | cat > test.avi +@end example + +Note that some formats (typically MOV), require the output protocol to +be seekable, so they will fail with the pipe output protocol. + +@section rtmp + +Real-Time Messaging Protocol. + +The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐ +dia content across a TCP/IP network. + +The required syntax is: +@example +rtmp://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] +@end example + +The accepted parameters are: +@table @option + +@item server +The address of the RTMP server. + +@item port +The number of the TCP port to use (by default is 1935). + +@item app +It is the name of the application to access. It usually corresponds to +the path where the application is installed on the RTMP server +(e.g. @file{/ondemand/}, @file{/flash/live/}, etc.). + +@item playpath +It is the path or name of the resource to play with reference to the +application specified in @var{app}, may be prefixed by "mp4:". + +@end table + +For example to read with @file{ffplay} a multimedia resource named +"sample" from the application "vod" from an RTMP server "myserver": +@example +ffplay rtmp://myserver/vod/sample +@end example + +@section rtmp, rtmpe, rtmps, rtmpt, rtmpte + +Real-Time Messaging Protocol and its variants supported through +librtmp. + +Requires the presence of the librtmp headers and library during +configuration. You need to explicitely configure the build with +"--enable-librtmp". If enabled this will replace the native RTMP +protocol. + +This protocol provides most client functions and a few server +functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT), +encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled +variants of these encrypted types (RTMPTE, RTMPTS). + +The required syntax is: +@example +@var{rtmp_proto}://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] @var{options} +@end example + +where @var{rtmp_proto} is one of the strings "rtmp", "rtmpt", "rtmpe", +"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and +@var{server}, @var{port}, @var{app} and @var{playpath} have the same +meaning as specified for the RTMP native protocol. +@var{options} contains a list of space-separated options of the form +@var{key}=@var{val}. + +See the librtmp manual page (man 3 librtmp) for more information. + +For example, to stream a file in real-time to an RTMP server using +@file{ffmpeg}: +@example +ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream +@end example + +To play the same stream using @file{ffplay}: +@example +ffplay "rtmp://myserver/live/mystream live=1" +@end example + +@section rtp + +Real-Time Protocol. + +@section rtsp + +RTSP is not technically a protocol handler in libavformat, it is a demuxer +and muxer. The demuxer supports both normal RTSP (with data transferred +over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with +data transferred over RDT). + +The muxer can be used to send a stream using RTSP ANNOUNCE to a server +supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's +RTSP server, @url{http://github.com/revmischa/rtsp-server}). + +The required syntax for a RTSP url is: +@example +rtsp://@var{hostname}[:@var{port}]/@var{path}[?@var{options}] +@end example + +@var{options} is a @code{&}-separated list. The following options +are supported: + +@table @option + +@item udp +Use UDP as lower transport protocol. + +@item tcp +Use TCP (interleaving within the RTSP control channel) as lower +transport protocol. + +@item multicast +Use UDP multicast as lower transport protocol. + +@item http +Use HTTP tunneling as lower transport protocol, which is useful for +passing proxies. + +@item filter_src +Accept packets only from negotiated peer address and port. +@end table + +Multiple lower transport protocols may be specified, in that case they are +tried one at a time (if the setup of one fails, the next one is tried). +For the muxer, only the @code{tcp} and @code{udp} options are supported. + +When receiving data over UDP, the demuxer tries to reorder received packets +(since they may arrive out of order, or packets may get lost totally). In +order for this to be enabled, a maximum delay must be specified in the +@code{max_delay} field of AVFormatContext. + +When watching multi-bitrate Real-RTSP streams with @file{ffplay}, the +streams to display can be chosen with @code{-vst} @var{n} and +@code{-ast} @var{n} for video and audio respectively, and can be switched +on the fly by pressing @code{v} and @code{a}. + +Example command lines: + +To watch a stream over UDP, with a max reordering delay of 0.5 seconds: + +@example +ffplay -max_delay 500000 rtsp://server/video.mp4?udp +@end example + +To watch a stream tunneled over HTTP: + +@example +ffplay rtsp://server/video.mp4?http +@end example + +To send a stream in realtime to a RTSP server, for others to watch: + +@example +ffmpeg -re -i @var{input} -f rtsp -muxdelay 0.1 rtsp://server/live.sdp +@end example + +@section sap + +Session Announcement Protocol (RFC 2974). This is not technically a +protocol handler in libavformat, it is a muxer and demuxer. +It is used for signalling of RTP streams, by announcing the SDP for the +streams regularly on a separate port. + +@subsection Muxer + +The syntax for a SAP url given to the muxer is: +@example +sap://@var{destination}[:@var{port}][?@var{options}] +@end example + +The RTP packets are sent to @var{destination} on port @var{port}, +or to port 5004 if no port is specified. +@var{options} is a @code{&}-separated list. The following options +are supported: + +@table @option + +@item announce_addr=@var{address} +Specify the destination IP address for sending the announcements to. +If omitted, the announcements are sent to the commonly used SAP +announcement multicast address 224.2.127.254 (sap.mcast.net), or +ff0e::2:7ffe if @var{destination} is an IPv6 address. + +@item announce_port=@var{port} +Specify the port to send the announcements on, defaults to +9875 if not specified. + +@item ttl=@var{ttl} +Specify the time to live value for the announcements and RTP packets, +defaults to 255. + +@item same_port=@var{0|1} +If set to 1, send all RTP streams on the same port pair. If zero (the +default), all streams are sent on unique ports, with each stream on a +port 2 numbers higher than the previous. +VLC/Live555 requires this to be set to 1, to be able to receive the stream. +The RTP stack in libavformat for receiving requires all streams to be sent +on unique ports. +@end table + +Example command lines follow. + +To broadcast a stream on the local subnet, for watching in VLC: + +@example +ffmpeg -re -i @var{input} -f sap sap://224.0.0.255?same_port=1 +@end example + +Similarly, for watching in ffplay: + +@example +ffmpeg -re -i @var{input} -f sap sap://224.0.0.255 +@end example + +And for watching in ffplay, over IPv6: + +@example +ffmpeg -re -i @var{input} -f sap sap://[ff0e::1:2:3:4] +@end example + +@subsection Demuxer + +The syntax for a SAP url given to the demuxer is: +@example +sap://[@var{address}][:@var{port}] +@end example + +@var{address} is the multicast address to listen for announcements on, +if omitted, the default 224.2.127.254 (sap.mcast.net) is used. @var{port} +is the port that is listened on, 9875 if omitted. + +The demuxers listens for announcements on the given address and port. +Once an announcement is received, it tries to receive that particular stream. + +Example command lines follow. + +To play back the first stream announced on the normal SAP multicast address: + +@example +ffplay sap:// +@end example + +To play back the first stream announced on one the default IPv6 SAP multicast address: + +@example +ffplay sap://[ff0e::2:7ffe] +@end example + +@section tcp + +Trasmission Control Protocol. + +@section udp + +User Datagram Protocol. + +The required syntax for a UDP url is: +@example +udp://@var{hostname}:@var{port}[?@var{options}] +@end example + +@var{options} contains a list of &-seperated options of the form @var{key}=@var{val}. +Follow the list of supported options. + +@table @option + +@item buffer_size=@var{size} +set the UDP buffer size in bytes + +@item localport=@var{port} +override the local UDP port to bind with + +@item pkt_size=@var{size} +set the size in bytes of UDP packets + +@item reuse=@var{1|0} +explicitly allow or disallow reusing UDP sockets + +@item ttl=@var{ttl} +set the time to live value (for multicast only) + +@item connect=@var{1|0} +Initialize the UDP socket with @code{connect()}. In this case, the +destination address can't be changed with udp_set_remote_url later. +If the destination address isn't known at the start, this option can +be specified in udp_set_remote_url, too. +This allows finding out the source address for the packets with getsockname, +and makes writes return with AVERROR(ECONNREFUSED) if "destination +unreachable" is received. +For receiving, this gives the benefit of only receiving packets from +the specified peer address/port. +@end table + +Some usage examples of the udp protocol with @file{ffmpeg} follow. + +To stream over UDP to a remote endpoint: +@example +ffmpeg -i @var{input} -f @var{format} udp://@var{hostname}:@var{port} +@end example + +To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer: +@example +ffmpeg -i @var{input} -f mpegts udp://@var{hostname}:@var{port}?pkt_size=188&buffer_size=65535 +@end example + +To receive over UDP from a remote endpoint: +@example +ffmpeg -i udp://[@var{multicast-address}]:@var{port} +@end example + +@c man end PROTOCOLS diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/t2h.init b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/t2h.init new file mode 100644 index 00000000..cd38a3ec --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/t2h.init @@ -0,0 +1,24 @@ +# no horiz rules between sections +$end_section = \&FFMPEG_end_section; +sub FFMPEG_end_section($$) +{ +} + +$print_page_foot = \&FFMPEG_print_page_foot; +sub FFMPEG_print_page_foot($$) +{ + my $fh = shift; + print $fh "$SMALL_RULE\n"; + T2H_DEFAULT_print_page_foot($fh); +} + +# no navigation elements +$SECTION_NAVIGATION = 0; +# the same for texi2html 5.0 +$HEADERS = 0; + +# TOC and Chapter headings link +$TOC_LINKS = 1; + +# print the TOC where @contents is used +$INLINE_CONTENTS = 1; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/tablegen.txt b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/tablegen.txt new file mode 100644 index 00000000..4c4f036e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/doc/tablegen.txt @@ -0,0 +1,70 @@ +Writing a table generator + +This documentation is preliminary. +Parts of the API are not good and should be changed. + +Basic concepts + +A table generator consists of two files, *_tablegen.c and *_tablegen.h. +The .h file will provide the variable declarations and initialization +code for the tables, the .c calls the initialization code and then prints +the tables as a header file using the tableprint.h helpers. +Both of these files will be compiled for the host system, so to avoid +breakage with cross-compilation neither of them may include, directly +or indirectly, config.h or avconfig.h. +This means that e.g. libavutil/mathematics.h is ok but libavutil/libm.h is not. +Due to this, the .c file or Makefile may have to provide additional defines +or stubs, though if possible this should be avoided. +In particular, CONFIG_HARDCODED_TABLES should always be defined to 0. + +The .c file + +This file should include the *_tablegen.h and tableprint.h files and +anything else it needs as long as it does not depend on config.h or +avconfig.h. +In addition to that it must contain a main() function which initializes +all tables by calling the init functions from the .h file and then prints +them. +The printing code typically looks like this: + write_fileheader(); + printf("static const uint8_t my_array[100] = {\n"); + write_uint8_t_array(my_array, 100); + printf("};\n"); + +This is the more generic form, in case you need to do something special. +Usually you should instead use the short form: + write_fileheader(); + WRITE_ARRAY("static const", uint8_t, my_array); + +write_fileheader() adds some minor things like a "this is a generated file" +comment and some standard includes. +tablegen.h defines some write functions for one- and two-dimensional arrays +for standard types - they print only the "core" parts so they are easier +to reuse for multi-dimensional arrays so the outermost {} must be printed +separately. +If there's no standard function for printing the type you need, the +WRITE_1D_FUNC_ARGV macro is a very quick way to create one. +See libavcodec/dv_tablegen.c for an example. + + +The .h file + +This file should contain: + - one or more initialization functions + - the table variable declarations +If CONFIG_HARDCODED_TABLES is set, the initialization functions should +not do anything, and instead of the variable declarations the +generated *_tables.h file should be included. +Since that will be generated in the build directory, the path must be +included, i.e. +#include "libavcodec/example_tables.h" +not +#include "example_tables.h" + +Makefile changes + +To make the automatic table creation work, you must manually declare the +new dependency. +For this add a line similar to this: +$(SUBDIR)example.o: $(SUBDIR)example_tables.h +under the "ifdef CONFIG_HARDCODED_TABLES" section in the Makefile. diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-fast.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-fast.ffpreset new file mode 100644 index 00000000..cac6534e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-fast.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=+parti8x8+parti4x4+partp8x8+partb8x8 +me_method=hex +subq=6 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=1 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=2 +directpred=1 +trellis=1 +flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip +wpredp=2 +rc_lookahead=30 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-fast_firstpass.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-fast_firstpass.ffpreset new file mode 100644 index 00000000..65ec0112 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-fast_firstpass.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=-parti8x8-parti4x4-partp8x8-partb8x8 +me_method=dia +subq=2 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=1 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=1 +directpred=1 +trellis=0 +flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip +wpredp=2 +rc_lookahead=30 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-faster.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-faster.ffpreset new file mode 100644 index 00000000..a32eed3c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-faster.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=+parti8x8+parti4x4+partp8x8+partb8x8 +me_method=hex +subq=4 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=1 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=2 +directpred=1 +trellis=1 +flags2=+bpyramid-mixed_refs+wpred+dct8x8+fastpskip +wpredp=1 +rc_lookahead=20 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-faster_firstpass.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-faster_firstpass.ffpreset new file mode 100644 index 00000000..c777eb4e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-faster_firstpass.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=-parti8x8-parti4x4-partp8x8-partb8x8 +me_method=dia +subq=2 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=1 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=1 +directpred=1 +trellis=0 +flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip +wpredp=1 +rc_lookahead=20 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-medium.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-medium.ffpreset new file mode 100644 index 00000000..039f1d60 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-medium.ffpreset @@ -0,0 +1,22 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=+parti8x8+parti4x4+partp8x8+partb8x8 +me_method=hex +subq=7 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=1 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=3 +directpred=1 +trellis=1 +flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip +wpredp=2 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-medium_firstpass.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-medium_firstpass.ffpreset new file mode 100644 index 00000000..e4159892 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-medium_firstpass.ffpreset @@ -0,0 +1,22 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=-parti8x8-parti4x4-partp8x8-partb8x8 +me_method=dia +subq=2 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=1 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=1 +directpred=1 +trellis=0 +flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip +wpredp=2 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-placebo.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-placebo.ffpreset new file mode 100644 index 00000000..fae2222d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-placebo.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 +me_method=tesa +subq=10 +me_range=24 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=2 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=16 +refs=16 +directpred=3 +trellis=2 +flags2=+bpyramid+mixed_refs+wpred+dct8x8-fastpskip +wpredp=2 +rc_lookahead=60 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-placebo_firstpass.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-placebo_firstpass.ffpreset new file mode 100644 index 00000000..fae2222d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-placebo_firstpass.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 +me_method=tesa +subq=10 +me_range=24 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=2 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=16 +refs=16 +directpred=3 +trellis=2 +flags2=+bpyramid+mixed_refs+wpred+dct8x8-fastpskip +wpredp=2 +rc_lookahead=60 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slow.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slow.ffpreset new file mode 100644 index 00000000..0f3f4d4b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slow.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=+parti8x8+parti4x4+partp8x8+partb8x8 +me_method=umh +subq=8 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=2 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=5 +directpred=3 +trellis=1 +flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip +wpredp=2 +rc_lookahead=50 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slow_firstpass.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slow_firstpass.ffpreset new file mode 100644 index 00000000..89e74e45 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slow_firstpass.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=-parti8x8-parti4x4-partp8x8-partb8x8 +me_method=dia +subq=2 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=2 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=1 +directpred=3 +trellis=0 +flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip +wpredp=2 +rc_lookahead=50 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slower.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slower.ffpreset new file mode 100644 index 00000000..f3a412c0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slower.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 +me_method=umh +subq=9 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=2 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=8 +directpred=3 +trellis=2 +flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip +wpredp=2 +rc_lookahead=60 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slower_firstpass.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slower_firstpass.ffpreset new file mode 100644 index 00000000..aa1eb1e9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-slower_firstpass.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=-parti8x8-parti4x4-partp8x8-partb8x8 +me_method=dia +subq=2 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=2 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=1 +directpred=3 +trellis=0 +flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip +wpredp=2 +rc_lookahead=60 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-superfast.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-superfast.ffpreset new file mode 100644 index 00000000..bcd45993 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-superfast.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=+parti8x8+parti4x4-partp8x8-partb8x8 +me_method=dia +subq=1 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=1 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=1 +directpred=1 +trellis=0 +flags2=+bpyramid-mixed_refs+wpred+dct8x8+fastpskip-mbtree +wpredp=0 +rc_lookahead=0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-superfast_firstpass.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-superfast_firstpass.ffpreset new file mode 100644 index 00000000..ef06b1d5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-superfast_firstpass.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=-parti8x8-parti4x4-partp8x8-partb8x8 +me_method=dia +subq=1 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=1 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=1 +directpred=1 +trellis=0 +flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip-mbtree +wpredp=0 +rc_lookahead=0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ultrafast.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ultrafast.ffpreset new file mode 100644 index 00000000..b6d20808 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ultrafast.ffpreset @@ -0,0 +1,24 @@ +coder=0 +flags=-loop +cmp=+chroma +partitions=-parti8x8-parti4x4-partp8x8-partb8x8 +me_method=dia +subq=0 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=0 +i_qfactor=0.71 +b_strategy=0 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=0 +refs=1 +directpred=1 +trellis=0 +flags2=-bpyramid-mixed_refs-wpred-dct8x8+fastpskip-mbtree +wpredp=0 +aq_mode=0 +rc_lookahead=0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ultrafast_firstpass.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ultrafast_firstpass.ffpreset new file mode 100644 index 00000000..b6d20808 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-ultrafast_firstpass.ffpreset @@ -0,0 +1,24 @@ +coder=0 +flags=-loop +cmp=+chroma +partitions=-parti8x8-parti4x4-partp8x8-partb8x8 +me_method=dia +subq=0 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=0 +i_qfactor=0.71 +b_strategy=0 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=0 +refs=1 +directpred=1 +trellis=0 +flags2=-bpyramid-mixed_refs-wpred-dct8x8+fastpskip-mbtree +wpredp=0 +aq_mode=0 +rc_lookahead=0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-veryfast.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-veryfast.ffpreset new file mode 100644 index 00000000..16ca594a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-veryfast.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=+parti8x8+parti4x4+partp8x8+partb8x8 +me_method=hex +subq=2 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=1 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=1 +directpred=1 +trellis=0 +flags2=+bpyramid-mixed_refs+wpred+dct8x8+fastpskip +wpredp=0 +rc_lookahead=10 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-veryfast_firstpass.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-veryfast_firstpass.ffpreset new file mode 100644 index 00000000..39eaf3e2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-veryfast_firstpass.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=-parti8x8-parti4x4-partp8x8-partb8x8 +me_method=dia +subq=2 +me_range=16 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=1 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=3 +refs=1 +directpred=1 +trellis=0 +flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip +wpredp=0 +rc_lookahead=10 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-veryslow.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-veryslow.ffpreset new file mode 100644 index 00000000..a0606255 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-veryslow.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 +me_method=umh +subq=10 +me_range=24 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=2 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=8 +refs=16 +directpred=3 +trellis=2 +flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip +wpredp=2 +rc_lookahead=60 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-veryslow_firstpass.ffpreset b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-veryslow_firstpass.ffpreset new file mode 100644 index 00000000..6e7079bb --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffpresets/libx264-veryslow_firstpass.ffpreset @@ -0,0 +1,23 @@ +coder=1 +flags=+loop +cmp=+chroma +partitions=-parti8x8-parti4x4-partp8x8-partb8x8 +me_method=dia +subq=2 +me_range=24 +g=250 +keyint_min=25 +sc_threshold=40 +i_qfactor=0.71 +b_strategy=2 +qcomp=0.6 +qmin=10 +qmax=51 +qdiff=4 +bf=8 +refs=1 +directpred=3 +trellis=0 +flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip +wpredp=2 +rc_lookahead=60 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffprobe.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffprobe.c new file mode 100644 index 00000000..2c99e5a6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/ffprobe.c @@ -0,0 +1,412 @@ +/* + * FFprobe : Simple Media Prober based on the FFmpeg libraries + * Copyright (c) 2007-2010 Stefano Sabatini + * + * 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 + */ + +#include "config.h" + +#include "libavformat/avformat.h" +#include "libavcodec/avcodec.h" +#include "libavcodec/opt.h" +#include "libavutil/pixdesc.h" +#include "libavdevice/avdevice.h" +#include "cmdutils.h" + +const char program_name[] = "FFprobe"; +const int program_birth_year = 2007; + +static int do_show_format = 0; +static int do_show_packets = 0; +static int do_show_streams = 0; + +static int show_value_unit = 0; +static int use_value_prefix = 0; +static int use_byte_value_binary_prefix = 0; +static int use_value_sexagesimal_format = 0; + +/* globals */ +static const OptionDef options[]; + +/* FFprobe context */ +static const char *input_filename; +static AVInputFormat *iformat = NULL; + +static const char *binary_unit_prefixes [] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" }; +static const char *decimal_unit_prefixes[] = { "", "K" , "M" , "G" , "T" , "P" }; + +static const char *unit_second_str = "s" ; +static const char *unit_hertz_str = "Hz" ; +static const char *unit_byte_str = "byte" ; +static const char *unit_bit_per_second_str = "bit/s"; + +static char *value_string(char *buf, int buf_size, double val, const char *unit) +{ + if (unit == unit_second_str && use_value_sexagesimal_format) { + double secs; + int hours, mins; + secs = val; + mins = (int)secs / 60; + secs = secs - mins * 60; + hours = mins / 60; + mins %= 60; + snprintf(buf, buf_size, "%d:%02d:%09.6f", hours, mins, secs); + } else if (use_value_prefix) { + const char *prefix_string; + int index; + + if (unit == unit_byte_str && use_byte_value_binary_prefix) { + index = (int) (log(val)/log(2)) / 10; + index = av_clip(index, 0, FF_ARRAY_ELEMS(binary_unit_prefixes) -1); + val /= pow(2, index*10); + prefix_string = binary_unit_prefixes[index]; + } else { + index = (int) (log10(val)) / 3; + index = av_clip(index, 0, FF_ARRAY_ELEMS(decimal_unit_prefixes) -1); + val /= pow(10, index*3); + prefix_string = decimal_unit_prefixes[index]; + } + + snprintf(buf, buf_size, "%.3f %s%s", val, prefix_string, show_value_unit ? unit : ""); + } else { + snprintf(buf, buf_size, "%f %s", val, show_value_unit ? unit : ""); + } + + return buf; +} + +static char *time_value_string(char *buf, int buf_size, int64_t val, const AVRational *time_base) +{ + if (val == AV_NOPTS_VALUE) { + snprintf(buf, buf_size, "N/A"); + } else { + value_string(buf, buf_size, val * av_q2d(*time_base), unit_second_str); + } + + return buf; +} + +static char *ts_value_string (char *buf, int buf_size, int64_t ts) +{ + if (ts == AV_NOPTS_VALUE) { + snprintf(buf, buf_size, "N/A"); + } else { + snprintf(buf, buf_size, "%"PRId64, ts); + } + + return buf; +} + +static const char *media_type_string(enum AVMediaType media_type) +{ + switch (media_type) { + case AVMEDIA_TYPE_VIDEO: return "video"; + case AVMEDIA_TYPE_AUDIO: return "audio"; + case AVMEDIA_TYPE_DATA: return "data"; + case AVMEDIA_TYPE_SUBTITLE: return "subtitle"; + case AVMEDIA_TYPE_ATTACHMENT: return "attachment"; + default: return "unknown"; + } +} + +static void show_packet(AVFormatContext *fmt_ctx, AVPacket *pkt) +{ + char val_str[128]; + AVStream *st = fmt_ctx->streams[pkt->stream_index]; + + printf("[PACKET]\n"); + printf("codec_type=%s\n" , media_type_string(st->codec->codec_type)); + printf("stream_index=%d\n" , pkt->stream_index); + printf("pts=%s\n" , ts_value_string (val_str, sizeof(val_str), pkt->pts)); + printf("pts_time=%s\n" , time_value_string(val_str, sizeof(val_str), pkt->pts, &st->time_base)); + printf("dts=%s\n" , ts_value_string (val_str, sizeof(val_str), pkt->dts)); + printf("dts_time=%s\n" , time_value_string(val_str, sizeof(val_str), pkt->dts, &st->time_base)); + printf("duration=%s\n" , ts_value_string (val_str, sizeof(val_str), pkt->duration)); + printf("duration_time=%s\n", time_value_string(val_str, sizeof(val_str), pkt->duration, &st->time_base)); + printf("size=%s\n" , value_string (val_str, sizeof(val_str), pkt->size, unit_byte_str)); + printf("pos=%"PRId64"\n" , pkt->pos); + printf("flags=%c\n" , pkt->flags & AV_PKT_FLAG_KEY ? 'K' : '_'); + printf("[/PACKET]\n"); +} + +static void show_packets(AVFormatContext *fmt_ctx) +{ + AVPacket pkt; + + av_init_packet(&pkt); + + while (!av_read_frame(fmt_ctx, &pkt)) + show_packet(fmt_ctx, &pkt); +} + +static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) +{ + AVStream *stream = fmt_ctx->streams[stream_idx]; + AVCodecContext *dec_ctx; + AVCodec *dec; + char val_str[128]; + AVMetadataTag *tag = NULL; + AVRational display_aspect_ratio; + + printf("[STREAM]\n"); + + printf("index=%d\n", stream->index); + + if ((dec_ctx = stream->codec)) { + if ((dec = dec_ctx->codec)) { + printf("codec_name=%s\n", dec->name); + printf("codec_long_name=%s\n", dec->long_name); + } else { + printf("codec_name=unknown\n"); + } + + printf("codec_type=%s\n", media_type_string(dec_ctx->codec_type)); + printf("codec_time_base=%d/%d\n", dec_ctx->time_base.num, dec_ctx->time_base.den); + + /* print AVI/FourCC tag */ + av_get_codec_tag_string(val_str, sizeof(val_str), dec_ctx->codec_tag); + printf("codec_tag_string=%s\n", val_str); + printf("codec_tag=0x%04x\n", dec_ctx->codec_tag); + + switch (dec_ctx->codec_type) { + case AVMEDIA_TYPE_VIDEO: + printf("width=%d\n", dec_ctx->width); + printf("height=%d\n", dec_ctx->height); + printf("has_b_frames=%d\n", dec_ctx->has_b_frames); + if (dec_ctx->sample_aspect_ratio.num) { + printf("sample_aspect_ratio=%d:%d\n", dec_ctx->sample_aspect_ratio.num, + dec_ctx->sample_aspect_ratio.den); + av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den, + dec_ctx->width * dec_ctx->sample_aspect_ratio.num, + dec_ctx->height * dec_ctx->sample_aspect_ratio.den, + 1024*1024); + printf("display_aspect_ratio=%d:%d\n", display_aspect_ratio.num, + display_aspect_ratio.den); + } + printf("pix_fmt=%s\n", dec_ctx->pix_fmt != PIX_FMT_NONE ? + av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown"); + break; + + case AVMEDIA_TYPE_AUDIO: + printf("sample_rate=%s\n", value_string(val_str, sizeof(val_str), + dec_ctx->sample_rate, + unit_hertz_str)); + printf("channels=%d\n", dec_ctx->channels); + printf("bits_per_sample=%d\n", av_get_bits_per_sample(dec_ctx->codec_id)); + break; + } + } else { + printf("codec_type=unknown\n"); + } + + if (fmt_ctx->iformat->flags & AVFMT_SHOW_IDS) + printf("id=0x%x\n", stream->id); + printf("r_frame_rate=%d/%d\n", stream->r_frame_rate.num, stream->r_frame_rate.den); + printf("avg_frame_rate=%d/%d\n", stream->avg_frame_rate.num, stream->avg_frame_rate.den); + printf("time_base=%d/%d\n", stream->time_base.num, stream->time_base.den); + printf("start_time=%s\n", time_value_string(val_str, sizeof(val_str), stream->start_time, + &stream->time_base)); + printf("duration=%s\n", time_value_string(val_str, sizeof(val_str), stream->duration, + &stream->time_base)); + if (stream->nb_frames) + printf("nb_frames=%"PRId64"\n", stream->nb_frames); + + while ((tag = av_metadata_get(stream->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) + printf("TAG:%s=%s\n", tag->key, tag->value); + + printf("[/STREAM]\n"); +} + +static void show_format(AVFormatContext *fmt_ctx) +{ + AVMetadataTag *tag = NULL; + char val_str[128]; + + printf("[FORMAT]\n"); + + printf("filename=%s\n", fmt_ctx->filename); + printf("nb_streams=%d\n", fmt_ctx->nb_streams); + printf("format_name=%s\n", fmt_ctx->iformat->name); + printf("format_long_name=%s\n", fmt_ctx->iformat->long_name); + printf("start_time=%s\n", time_value_string(val_str, sizeof(val_str), fmt_ctx->start_time, + &AV_TIME_BASE_Q)); + printf("duration=%s\n", time_value_string(val_str, sizeof(val_str), fmt_ctx->duration, + &AV_TIME_BASE_Q)); + printf("size=%s\n", value_string(val_str, sizeof(val_str), fmt_ctx->file_size, + unit_byte_str)); + printf("bit_rate=%s\n", value_string(val_str, sizeof(val_str), fmt_ctx->bit_rate, + unit_bit_per_second_str)); + + while ((tag = av_metadata_get(fmt_ctx->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) + printf("TAG:%s=%s\n", tag->key, tag->value); + + printf("[/FORMAT]\n"); +} + +static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename) +{ + int err, i; + AVFormatContext *fmt_ctx; + + fmt_ctx = avformat_alloc_context(); + set_context_opts(fmt_ctx, avformat_opts, AV_OPT_FLAG_DECODING_PARAM, NULL); + + if ((err = av_open_input_file(&fmt_ctx, filename, iformat, 0, NULL)) < 0) { + print_error(filename, err); + return err; + } + + /* fill the streams in the format context */ + if ((err = av_find_stream_info(fmt_ctx)) < 0) { + print_error(filename, err); + return err; + } + + dump_format(fmt_ctx, 0, filename, 0); + + /* bind a decoder to each input stream */ + for (i = 0; i < fmt_ctx->nb_streams; i++) { + AVStream *stream = fmt_ctx->streams[i]; + AVCodec *codec; + + if (!(codec = avcodec_find_decoder(stream->codec->codec_id))) { + fprintf(stderr, "Unsupported codec (id=%d) for input stream %d\n", + stream->codec->codec_id, stream->index); + } else if (avcodec_open(stream->codec, codec) < 0) { + fprintf(stderr, "Error while opening codec for input stream %d\n", + stream->index); + } + } + + *fmt_ctx_ptr = fmt_ctx; + return 0; +} + +static int probe_file(const char *filename) +{ + AVFormatContext *fmt_ctx; + int ret, i; + + if ((ret = open_input_file(&fmt_ctx, filename))) + return ret; + + if (do_show_packets) + show_packets(fmt_ctx); + + if (do_show_streams) + for (i = 0; i < fmt_ctx->nb_streams; i++) + show_stream(fmt_ctx, i); + + if (do_show_format) + show_format(fmt_ctx); + + av_close_input_file(fmt_ctx); + return 0; +} + +static void show_usage(void) +{ + printf("Simple multimedia streams analyzer\n"); + printf("usage: ffprobe [OPTIONS] [INPUT_FILE]\n"); + printf("\n"); +} + +static void opt_format(const char *arg) +{ + iformat = av_find_input_format(arg); + if (!iformat) { + fprintf(stderr, "Unknown input format: %s\n", arg); + exit(1); + } +} + +static void opt_input_file(const char *arg) +{ + if (input_filename) { + fprintf(stderr, "Argument '%s' provided as input filename, but '%s' was already specified.\n", + arg, input_filename); + exit(1); + } + if (!strcmp(arg, "-")) + arg = "pipe:"; + input_filename = arg; +} + +static void show_help(void) +{ + av_log_set_callback(log_callback_help); + show_usage(); + show_help_options(options, "Main options:\n", 0, 0); + printf("\n"); + av_opt_show2(avformat_opts, NULL, + AV_OPT_FLAG_DECODING_PARAM, 0); +} + +static void opt_pretty(void) +{ + show_value_unit = 1; + use_value_prefix = 1; + use_byte_value_binary_prefix = 1; + use_value_sexagesimal_format = 1; +} + +static const OptionDef options[] = { +#include "cmdutils_common_opts.h" + { "f", HAS_ARG, {(void*)opt_format}, "force format", "format" }, + { "unit", OPT_BOOL, {(void*)&show_value_unit}, "show unit of the displayed values" }, + { "prefix", OPT_BOOL, {(void*)&use_value_prefix}, "use SI prefixes for the displayed values" }, + { "byte_binary_prefix", OPT_BOOL, {(void*)&use_byte_value_binary_prefix}, + "use binary prefixes for byte units" }, + { "sexagesimal", OPT_BOOL, {(void*)&use_value_sexagesimal_format}, + "use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units" }, + { "pretty", 0, {(void*)&opt_pretty}, + "prettify the format of displayed values, make it more human readable" }, + { "show_format", OPT_BOOL, {(void*)&do_show_format} , "show format/container info" }, + { "show_packets", OPT_BOOL, {(void*)&do_show_packets}, "show packets info" }, + { "show_streams", OPT_BOOL, {(void*)&do_show_streams}, "show streams info" }, + { "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" }, + { NULL, }, +}; + +int main(int argc, char **argv) +{ + int ret; + + av_register_all(); +#if CONFIG_AVDEVICE + avdevice_register_all(); +#endif + + avformat_opts = avformat_alloc_context(); + + show_banner(); + parse_options(argc, argv, options, opt_input_file); + + if (!input_filename) { + show_usage(); + fprintf(stderr, "You have to specify one input file.\n"); + fprintf(stderr, "Use -h to get full help or, even better, run 'man ffprobe'.\n"); + exit(1); + } + + ret = probe_file(input_filename); + + av_free(avformat_opts); + + return ret; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/include-xbmc-win32/dxva2/dxva2api.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/include-xbmc-win32/dxva2/dxva2api.h new file mode 100644 index 00000000..28e54c8d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/include-xbmc-win32/dxva2/dxva2api.h @@ -0,0 +1,502 @@ +/***************************************************************************** + * dxva2api.h: DXVA 2 interface + ***************************************************************************** + * Copyright (C) 2009 Geoffroy Couprie + * Copyright (C) 2009 Laurent Aimar + * $Id$ + * + * Authors: Geoffroy Couprie + * Laurent Aimar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +#ifndef _DXVA2API_H +#define _DXVA2API_H + +#define MINGW_DXVA2API_H_VERSION (2) + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#include +#include + +/* Define it to allow using nameless struct/union (non C99 compliant) to match + * the official documentation. */ +//#define DXVA2API_USE_BITFIELDS + +/****************STRUCTURES******************/ +#pragma pack(push, 1) + +typedef struct _DXVA2_ExtendedFormat { +#ifdef DXVA2API_USE_BITFIELDS + union { + struct { + UINT SampleFormat : 8; + UINT VideoChromaSubsampling : 4; + UINT NominalRange : 3; + UINT VideoTransferMatrix : 3; + UINT VideoLighting : 4; + UINT VideoPrimaries : 5; + UINT VideoTransferFunction : 5; + }; + UINT value; + }; +#else + UINT value; +#endif +} DXVA2_ExtendedFormat; + +typedef struct _DXVA2_Frequency { + UINT Numerator; + UINT Denominator; +} DXVA2_Frequency; + +typedef struct _DXVA2_VideoDesc { + UINT SampleWidth; + UINT SampleHeight; + DXVA2_ExtendedFormat SampleFormat; + D3DFORMAT Format; + DXVA2_Frequency InputSampleFreq; + DXVA2_Frequency OutputFrameFreq; + UINT UABProtectionLevel; + UINT Reserved; +} DXVA2_VideoDesc; + +typedef struct _DXVA2_ConfigPictureDecode { + GUID guidConfigBitstreamEncryption; + GUID guidConfigMBcontrolEncryption; + GUID guidConfigResidDiffEncryption; + UINT ConfigBitstreamRaw; + UINT ConfigMBcontrolRasterOrder; + UINT ConfigResidDiffHost; + UINT ConfigSpatialResid8; + UINT ConfigResid8Subtraction; + UINT ConfigSpatialHost8or9Clipping; + UINT ConfigSpatialResidInterleaved; + UINT ConfigIntraResidUnsigned; + UINT ConfigResidDiffAccelerator; + UINT ConfigHostInverseScan; + UINT ConfigSpecificIDCT; + UINT Config4GroupedCoefs; + USHORT ConfigMinRenderTargetBuffCount; + USHORT ConfigDecoderSpecific; +} DXVA2_ConfigPictureDecode; + +typedef struct _DXVA2_DecodeBufferDesc { + DWORD CompressedBufferType; + UINT BufferIndex; + UINT DataOffset; + UINT DataSize; + UINT FirstMBaddress; + UINT NumMBsInBuffer; + UINT Width; + UINT Height; + UINT Stride; + UINT ReservedBits; + PVOID pvPVPState; +} DXVA2_DecodeBufferDesc; + +typedef struct _DXVA2_DecodeExtensionData { + UINT Function; + PVOID pPrivateInputData; + UINT PrivateInputDataSize; + PVOID pPrivateOutputData; + UINT PrivateOutputDataSize; +} DXVA2_DecodeExtensionData; + +typedef struct _DXVA2_DecodeExecuteParams { + UINT NumCompBuffers; + DXVA2_DecodeBufferDesc *pCompressedBuffers; + DXVA2_DecodeExtensionData *pExtensionData; +} DXVA2_DecodeExecuteParams; + +enum { + DXVA2_VideoDecoderRenderTarget = 0, + DXVA2_VideoProcessorRenderTarget = 1, + DXVA2_VideoSoftwareRenderTarget = 2 +}; + +enum { + DXVA2_PictureParametersBufferType = 0, + DXVA2_MacroBlockControlBufferType = 1, + DXVA2_ResidualDifferenceBufferType = 2, + DXVA2_DeblockingControlBufferType = 3, + DXVA2_InverseQuantizationMatrixBufferType = 4, + DXVA2_SliceControlBufferType = 5, + DXVA2_BitStreamDateBufferType = 6, + DXVA2_MotionVectorBuffer = 7, + DXVA2_FilmGrainBuffer = 8 +}; + +/* DXVA MPEG-I/II and VC-1 */ +typedef struct _DXVA_PictureParameters { + USHORT wDecodedPictureIndex; + USHORT wDeblockedPictureIndex; + USHORT wForwardRefPictureIndex; + USHORT wBackwardRefPictureIndex; + USHORT wPicWidthInMBminus1; + USHORT wPicHeightInMBminus1; + UCHAR bMacroblockWidthMinus1; + UCHAR bMacroblockHeightMinus1; + UCHAR bBlockWidthMinus1; + UCHAR bBlockHeightMinus1; + UCHAR bBPPminus1; + UCHAR bPicStructure; + UCHAR bSecondField; + UCHAR bPicIntra; + UCHAR bPicBackwardPrediction; + UCHAR bBidirectionalAveragingMode; + UCHAR bMVprecisionAndChromaRelation; + UCHAR bChromaFormat; + UCHAR bPicScanFixed; + UCHAR bPicScanMethod; + UCHAR bPicReadbackRequests; + UCHAR bRcontrol; + UCHAR bPicSpatialResid8; + UCHAR bPicOverflowBlocks; + UCHAR bPicExtrapolation; + UCHAR bPicDeblocked; + UCHAR bPicDeblockConfined; + UCHAR bPic4MVallowed; + UCHAR bPicOBMC; + UCHAR bPicBinPB; + UCHAR bMV_RPS; + UCHAR bReservedBits; + USHORT wBitstreamFcodes; + USHORT wBitstreamPCEelements; + UCHAR bBitstreamConcealmentNeed; + UCHAR bBitstreamConcealmentMethod; +} DXVA_PictureParameters, *LPDXVA_PictureParameters; + +typedef struct _DXVA_QmatrixData { + BYTE bNewQmatrix[4]; + WORD Qmatrix[4][8 * 8]; +} DXVA_QmatrixData, *LPDXVA_QmatrixData; + +typedef struct _DXVA_SliceInfo { + USHORT wHorizontalPosition; + USHORT wVerticalPosition; + UINT dwSliceBitsInBuffer; + UINT dwSliceDataLocation; + UCHAR bStartCodeBitOffset; + UCHAR bReservedBits; + USHORT wMBbitOffset; + USHORT wNumberMBsInSlice; + USHORT wQuantizerScaleCode; + USHORT wBadSliceChopping; +} DXVA_SliceInfo, *LPDXVA_SliceInfo; + +/* DXVA H264 */ +typedef struct { +#ifdef DXVA2API_USE_BITFIELDS + union { + struct { + UCHAR Index7Bits : 7; + UCHAR AssociatedFlag : 1; + }; + UCHAR bPicEntry; + }; +#else + UCHAR bPicEntry; +#endif +} DXVA_PicEntry_H264; + + +typedef struct { + USHORT wFrameWidthInMbsMinus1; + USHORT wFrameHeightInMbsMinus1; + DXVA_PicEntry_H264 CurrPic; + UCHAR num_ref_frames; +#ifdef DXVA2API_USE_BITFIELDS + union { + struct { + USHORT field_pic_flag : 1; + USHORT MbaffFrameFlag : 1; + USHORT residual_colour_transform_flag : 1; + USHORT sp_for_switch_flag : 1; + USHORT chroma_format_idc : 2; + USHORT RefPicFlag : 1; + USHORT constrained_intra_pred_flag : 1; + USHORT weighted_pred_flag : 1; + USHORT weighted_bipred_idc : 2; + USHORT MbsConsecutiveFlag : 1; + USHORT frame_mbs_only_flag : 1; + USHORT transform_8x8_mode_flag : 1; + USHORT MinLumaBipredSize8x8Flag : 1; + USHORT IntraPicFlag : 1; + }; + USHORT wBitFields; + }; +#else + USHORT wBitFields; +#endif + UCHAR bit_depth_luma_minus8; + UCHAR bit_depth_chroma_minus8; + USHORT Reserved16Bits; + UINT StatusReportFeedbackNumber; + DXVA_PicEntry_H264 RefFrameList[16]; + INT CurrFieldOrderCnt[2]; + INT FieldOrderCntList[16][2]; + CHAR pic_init_qs_minus26; + CHAR chroma_qp_index_offset; + CHAR second_chroma_qp_index_offset; + UCHAR ContinuationFlag; + CHAR pic_init_qp_minus26; + UCHAR num_ref_idx_l0_active_minus1; + UCHAR num_ref_idx_l1_active_minus1; + UCHAR Reserved8BitsA; + USHORT FrameNumList[16]; + + UINT UsedForReferenceFlags; + USHORT NonExistingFrameFlags; + USHORT frame_num; + UCHAR log2_max_frame_num_minus4; + UCHAR pic_order_cnt_type; + UCHAR log2_max_pic_order_cnt_lsb_minus4; + UCHAR delta_pic_order_always_zero_flag; + UCHAR direct_8x8_inference_flag; + UCHAR entropy_coding_mode_flag; + UCHAR pic_order_present_flag; + UCHAR num_slice_groups_minus1; + UCHAR slice_group_map_type; + UCHAR deblocking_filter_control_present_flag; + UCHAR redundant_pic_cnt_present_flag; + UCHAR Reserved8BitsB; + USHORT slice_group_change_rate_minus1; + UCHAR SliceGroupMap[810]; +} DXVA_PicParams_H264; + +typedef struct { + UCHAR bScalingLists4x4[6][16]; + UCHAR bScalingLists8x8[2][64]; +} DXVA_Qmatrix_H264; + + +typedef struct { + UINT BSNALunitDataLocation; + UINT SliceBytesInBuffer; + USHORT wBadSliceChopping; + USHORT first_mb_in_slice; + USHORT NumMbsForSlice; + USHORT BitOffsetToSliceData; + UCHAR slice_type; + UCHAR luma_log2_weight_denom; + UCHAR chroma_log2_weight_denom; + + UCHAR num_ref_idx_l0_active_minus1; + UCHAR num_ref_idx_l1_active_minus1; + CHAR slice_alpha_c0_offset_div2; + CHAR slice_beta_offset_div2; + UCHAR Reserved8Bits; + DXVA_PicEntry_H264 RefPicList[2][32]; + SHORT Weights[2][32][3][2]; + CHAR slice_qs_delta; + CHAR slice_qp_delta; + UCHAR redundant_pic_cnt; + UCHAR direct_spatial_mv_pred_flag; + UCHAR cabac_init_idc; + UCHAR disable_deblocking_filter_idc; + USHORT slice_id; +} DXVA_Slice_H264_Long; + +typedef struct { + UINT BSNALunitDataLocation; + UINT SliceBytesInBuffer; + USHORT wBadSliceChopping; +} DXVA_Slice_H264_Short; + +typedef struct { + USHORT wFrameWidthInMbsMinus1; + USHORT wFrameHeightInMbsMinus1; + DXVA_PicEntry_H264 InPic; + DXVA_PicEntry_H264 OutPic; + USHORT PicOrderCnt_offset; + INT CurrPicOrderCnt; + UINT StatusReportFeedbackNumber; + UCHAR model_id; + UCHAR separate_colour_description_present_flag; + UCHAR film_grain_bit_depth_luma_minus8; + UCHAR film_grain_bit_depth_chroma_minus8; + UCHAR film_grain_full_range_flag; + UCHAR film_grain_colour_primaries; + UCHAR film_grain_transfer_characteristics; + UCHAR film_grain_matrix_coefficients; + UCHAR blending_mode_id; + UCHAR log2_scale_factor; + UCHAR comp_model_present_flag[4]; + UCHAR num_intensity_intervals_minus1[4]; + UCHAR num_model_values_minus1[4]; + UCHAR intensity_interval_lower_bound[3][16]; + UCHAR intensity_interval_upper_bound[3][16]; + SHORT comp_model_value[3][16][8]; +} DXVA_FilmGrainChar_H264; + +#pragma pack(pop) + +/*************INTERFACES************/ +#ifdef __cplusplus +extern "C" { +#endif + +typedef _COM_interface IDirectXVideoDecoderService IDirectXVideoDecoderService; +typedef _COM_interface IDirectXVideoDecoder IDirectXVideoDecoder; + +#undef INTERFACE +#define INTERFACE IDirectXVideoDecoder +DECLARE_INTERFACE_(IDirectXVideoDecoder,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(GetVideoDecoderService)(THIS_ IDirectXVideoDecoderService**) PURE; + STDMETHOD(GetCreationParameters)(THIS_ GUID*,DXVA2_VideoDesc*,DXVA2_ConfigPictureDecode*,IDirect3DSurface9***,UINT*) PURE; + STDMETHOD(GetBuffer)(THIS_ UINT,void**,UINT*) PURE; + STDMETHOD(ReleaseBuffer)(THIS_ UINT) PURE; + STDMETHOD(BeginFrame)(THIS_ IDirect3DSurface9 *,void*) PURE; + STDMETHOD(EndFrame)(THIS_ HANDLE *) PURE; + STDMETHOD(Execute)(THIS_ const DXVA2_DecodeExecuteParams*) PURE; + + +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectXVideoDecoder_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectXVideoDecoder_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectXVideoDecoder_Release(p) (p)->lpVtbl->Release(p) +#define IDirectXVideoDecoder_BeginFrame(p,a,b) (p)->lpVtbl->BeginFrame(p,a,b) +#define IDirectXVideoDecoder_EndFrame(p,a) (p)->lpVtbl->EndFrame(p,a) +#define IDirectXVideoDecoder_Execute(p,a) (p)->lpVtbl->Execute(p,a) +#define IDirectXVideoDecoder_GetBuffer(p,a,b,c) (p)->lpVtbl->GetBuffer(p,a,b,c) +#define IDirectXVideoDecoder_GetCreationParameters(p,a,b,c,d,e) (p)->lpVtbl->GetCreationParameters(p,a,b,c,d,e) +#define IDirectXVideoDecoder_GetVideoDecoderService(p,a) (p)->lpVtbl->GetVideoDecoderService(p,a) +#define IDirectXVideoDecoder_ReleaseBuffer(p,a) (p)->lpVtbl->ReleaseBuffer(p,a) +#else +#define IDirectXVideoDecoder_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectXVideoDecoder_AddRef(p) (p)->AddRef() +#define IDirectXVideoDecoder_Release(p) (p)->Release() +#define IDirectXVideoDecoder_BeginFrame(p,a,b) (p)->BeginFrame(a,b) +#define IDirectXVideoDecoder_EndFrame(p,a) (p)->EndFrame(a) +#define IDirectXVideoDecoder_Execute(p,a) (p)->Execute(a) +#define IDirectXVideoDecoder_GetBuffer(p,a,b,c) (p)->GetBuffer(a,b,c) +#define IDirectXVideoDecoder_GetCreationParameters(p,a,b,c,d,e) (p)->GetCreationParameters(a,b,c,d,e) +#define IDirectXVideoDecoder_GetVideoDecoderService(p,a) (p)->GetVideoDecoderService(a) +#define IDirectXVideoDecoder_ReleaseBuffer(p,a) (p)->ReleaseBuffer(a) +#endif + +#undef INTERFACE +#define INTERFACE IDirectXVideoAccelerationService +DECLARE_INTERFACE_(IDirectXVideoAccelerationService,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(CreateSurface)(THIS_ UINT,UINT,UINT,D3DFORMAT,D3DPOOL,DWORD,DWORD,IDirect3DSurface9**,HANDLE*) PURE; + +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectXVideoAccelerationService_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectXVideoAccelerationService_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectXVideoAccelerationService_Release(p) (p)->lpVtbl->Release(p) +#define IDirectXVideoAccelerationService_CreateSurface(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateSurface(p,a,b,c,d,e,f,g,h,i) +#else +#define IDirectXVideoAccelerationService_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectXVideoAccelerationService_AddRef(p) (p)->AddRef() +#define IDirectXVideoAccelerationService_Release(p) (p)->Release() +#define IDirectXVideoAccelerationService_CreateSurface(p,a,b,c,d,e,f,g,h,i) (p)->CreateSurface(a,b,c,d,e,f,g,h,i) +#endif + +#undef INTERFACE +#define INTERFACE IDirectXVideoDecoderService +DECLARE_INTERFACE_(IDirectXVideoDecoderService,IDirectXVideoAccelerationService) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(CreateSurface)(THIS_ UINT,UINT,UINT,D3DFORMAT,D3DPOOL,DWORD,DWORD,IDirect3DSurface9**,HANDLE*) PURE; + STDMETHOD(GetDecoderDeviceGuids)(THIS_ UINT*,GUID **) PURE; + STDMETHOD(GetDecoderRenderTargets)(THIS_ REFGUID,UINT*,D3DFORMAT**) PURE; + STDMETHOD(GetDecoderConfigurations)(THIS_ REFGUID,const DXVA2_VideoDesc*,IUnknown*,UINT*,DXVA2_ConfigPictureDecode**) PURE; + STDMETHOD(CreateVideoDecoder)(THIS_ REFGUID,const DXVA2_VideoDesc*,DXVA2_ConfigPictureDecode*,IDirect3DSurface9**,UINT,IDirectXVideoDecoder**) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectXVideoDecoderService_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectXVideoDecoderService_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectXVideoDecoderService_Release(p) (p)->lpVtbl->Release(p) +#define IDirectXVideoDecoderService_CreateSurface(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateSurface(p,a,b,c,d,e,f,g,h,i) +#define IDirectXVideoDecoderService_CreateVideoDecoder(p,a,b,c,d,e,f) (p)->lpVtbl->CreateVideoDecoder(p,a,b,c,d,e,f) +#define IDirectXVideoDecoderService_GetDecoderConfigurations(p,a,b,c,d,e) (p)->lpVtbl->GetDecoderConfigurations(p,a,b,c,d,e) +#define IDirectXVideoDecoderService_GetDecoderDeviceGuids(p,a,b) (p)->lpVtbl->GetDecoderDeviceGuids(p,a,b) +#define IDirectXVideoDecoderService_GetDecoderRenderTargets(p,a,b,c) (p)->lpVtbl->GetDecoderRenderTargets(p,a,b,c) +#else +#define IDirectXVideoDecoderService_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectXVideoDecoderService_AddRef(p) (p)->AddRef() +#define IDirectXVideoDecoderService_Release(p) (p)->Release() +#define IDirectXVideoDecoderService_CreateSurface(p,a,b,c,d,e,f,g,h,i) (p)->CreateSurface(a,b,c,d,e,f,g,h,i) +#define IDirectXVideoDecoderService_CreateVideoDecoder(p,a,b,c,d,e,f) (p)->CreateVideoDecoder(a,b,c,d,e,f) +#define IDirectXVideoDecoderService_GetDecoderConfigurations(p,a,b,c,d,e) (p)->GetDecoderConfigurations(a,b,c,d,e) +#define IDirectXVideoDecoderService_GetDecoderDeviceGuids(p,a,b) (p)->GetDecoderDeviceGuids(a,b) +#define IDirectXVideoDecoderService_GetDecoderRenderTargets(p,a,b,c) (p)->GetDecoderRenderTargets(a,b,c) +#endif + +#undef INTERFACE +#define INTERFACE IDirect3DDeviceManager9 +DECLARE_INTERFACE_(IDirect3DDeviceManager9,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(ResetDevice)(THIS_ IDirect3DDevice9*,UINT) PURE; + STDMETHOD(OpenDeviceHandle)(THIS_ HANDLE*) PURE; + STDMETHOD(CloseDeviceHandle)( THIS_ HANDLE) PURE; + STDMETHOD(TestDevice)( THIS_ HANDLE) PURE; + STDMETHOD(LockDevice)( THIS_ HANDLE,IDirect3DDevice9**,BOOL) PURE; + STDMETHOD(UnlockDevice)( THIS_ HANDLE,BOOL) PURE; + STDMETHOD(GetVideoService)( THIS_ HANDLE,REFIID,void**) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDeviceManager9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDeviceManager9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDeviceManager9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDeviceManager9_ResetDevice(p,a,b) (p)->lpVtbl->ResetDevice(p,a,b) +#define IDirect3DDeviceManager9_OpenDeviceHandle(p,a) (p)->lpVtbl->OpenDeviceHandle(p,a) +#define IDirect3DDeviceManager9_CloseDeviceHandle(p,a) (p)->lpVtbl->CloseDeviceHandle(p,a) +#define IDirect3DDeviceManager9_TestDevice(p,a) (p)->lpVtbl->TestDevice(p,a) +#define IDirect3DDeviceManager9_LockDevice(p,a,b,c) (p)->lpVtbl->LockDevice(p,a,b,c) +#define IDirect3DDeviceManager9_UnlockDevice(p,a,b) (p)->lpVtbl->UnlockDevice(p,a,b) +#define IDirect3DDeviceManager9_GetVideoService(p,a,b,c) (p)->lpVtbl->GetVideoService(p,a,b,c) +#else +#define IDirect3DDeviceManager9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDeviceManager9_AddRef(p) (p)->AddRef() +#define IDirect3DDeviceManager9_Release(p) (p)->Release() +#define IDirect3DDeviceManager9_ResetDevice(p,a,b) (p)->ResetDevice(a,b) +#define IDirect3DDeviceManager9_OpenDeviceHandle(p,a) (p)->OpenDeviceHandle(a) +#define IDirect3DDeviceManager9_CloseDeviceHandle(p,a) (p)->CloseDeviceHandle(a) +#define IDirect3DDeviceManager9_TestDevice(p,a) (p)->TestDevice(a) +#define IDirect3DDeviceManager9_LockDevice(p,a,b,c) (p)->LockDevice(a,b,c) +#define IDirect3DDeviceManager9_UnlockDevice(p,a,b) (p)->UnlockDevice(a,b) +#define IDirect3DDeviceManager9_GetVideoService(p,a,b,c) (p)->GetVideoService(a,b,c) +#endif + +#ifdef __cplusplus +}; +#endif + +#endif //_DXVA2API_H diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/include-xbmc-win32/libavutil/avconfig.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/include-xbmc-win32/libavutil/avconfig.h new file mode 100644 index 00000000..f10aa618 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/include-xbmc-win32/libavutil/avconfig.h @@ -0,0 +1,6 @@ +/* Generated by ffconf */ +#ifndef AVUTIL_AVCONFIG_H +#define AVUTIL_AVCONFIG_H +#define AV_HAVE_BIGENDIAN 0 +#define AV_HAVE_FAST_UNALIGNED 1 +#endif /* AVUTIL_AVCONFIG_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/a64colors.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/a64colors.h new file mode 100644 index 00000000..a9cdb6fa --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/a64colors.h @@ -0,0 +1,52 @@ +/* + * a64 video encoder - c64 colors in rgb (Pepto) + * Copyright (c) 2009 Tobias Bindhammer + * + * 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 + * a64 video encoder - c64 colors in rgb + */ + +#ifndef AVCODEC_A64COLORS_H +#define AVCODEC_A64COLORS_H + +#include + +/* c64 palette in RGB */ +static const uint8_t a64_palette[16][3] = { + {0x00, 0x00, 0x00}, + {0xff, 0xff, 0xff}, + {0x68, 0x37, 0x2b}, + {0x70, 0xa4, 0xb2}, + {0x6f, 0x3d, 0x86}, + {0x58, 0x8d, 0x43}, + {0x35, 0x28, 0x79}, + {0xb8, 0xc7, 0x6f}, + {0x6f, 0x4f, 0x25}, + {0x43, 0x39, 0x00}, + {0x9a, 0x67, 0x59}, + {0x44, 0x44, 0x44}, + {0x6c, 0x6c, 0x6c}, + {0x9a, 0xd2, 0x84}, + {0x6c, 0x5e, 0xb5}, + {0x95, 0x95, 0x95}, +}; + +#endif /* AVCODEC_A64COLORS_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/a64enc.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/a64enc.h new file mode 100644 index 00000000..fb559ba8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/a64enc.h @@ -0,0 +1,55 @@ +/* + * a64 video encoder - basic headers + * Copyright (c) 2009 Tobias Bindhammer + * + * 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 + * a64 video encoder - basic headers + */ + +#ifndef AVCODEC_A64ENC_H +#define AVCODEC_A64ENC_H + +#include "libavutil/lfg.h" +#include "avcodec.h" + +#define C64XRES 320 +#define C64YRES 200 + +typedef struct A64Context { + /* general variables */ + AVFrame picture; + + /* variables for multicolor modes */ + AVLFG randctx; + int mc_lifetime; + int mc_use_5col; + int mc_frame_counter; + int *mc_meta_charset; + int *mc_charmap; + int *mc_best_cb; + int mc_luma_vals[5]; + uint8_t *mc_charset; + uint8_t *mc_colram; + uint8_t *mc_palette; + int mc_pal_size; +} A64Context; + +#endif /* AVCODEC_A64ENC_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/a64multienc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/a64multienc.c new file mode 100644 index 00000000..aed28ad2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/a64multienc.c @@ -0,0 +1,389 @@ +/* + * a64 video encoder - multicolor modes + * Copyright (c) 2009 Tobias Bindhammer + * + * 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 + * a64 video encoder - multicolor modes + */ + +#include "a64enc.h" +#include "a64colors.h" +#include "a64tables.h" +#include "elbg.h" +#include "libavutil/intreadwrite.h" + +#define DITHERSTEPS 8 +#define CHARSET_CHARS 256 +#define INTERLACED 1 +#define CROP_SCREENS 1 + +/* gray gradient */ +static const int mc_colors[5]={0x0,0xb,0xc,0xf,0x1}; + +/* other possible gradients - to be tested */ +//static const int mc_colors[5]={0x0,0x8,0xa,0xf,0x7}; +//static const int mc_colors[5]={0x0,0x9,0x8,0xa,0x3}; + +static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest) +{ + int blockx, blocky, x, y; + int luma = 0; + int height = FFMIN(avctx->height, C64YRES); + int width = FFMIN(avctx->width , C64XRES); + uint8_t *src = p->data[0]; + + for (blocky = 0; blocky < C64YRES; blocky += 8) { + for (blockx = 0; blockx < C64XRES; blockx += 8) { + for (y = blocky; y < blocky + 8 && y < C64YRES; y++) { + for (x = blockx; x < blockx + 8 && x < C64XRES; x += 2) { + if(x < width && y < height) { + /* build average over 2 pixels */ + luma = (src[(x + 0 + y * p->linesize[0])] + + src[(x + 1 + y * p->linesize[0])]) / 2; + /* write blocks as linear data now so they are suitable for elbg */ + dest[0] = luma; + } + dest++; + } + } + } + } +} + +static void render_charset(AVCodecContext *avctx, uint8_t *charset, + uint8_t *colrammap) +{ + A64Context *c = avctx->priv_data; + uint8_t row1, row2; + int charpos, x, y; + int a, b; + uint8_t pix; + int lowdiff, highdiff; + int *best_cb = c->mc_best_cb; + static uint8_t index1[256]; + static uint8_t index2[256]; + static uint8_t dither[256]; + int i; + int distance; + + /* generate lookup-tables for dither and index before looping */ + i = 0; + for (a=0; a < 256; a++) { + if(i < c->mc_pal_size -1 && a == c->mc_luma_vals[i + 1]) { + distance = c->mc_luma_vals[i + 1] - c->mc_luma_vals[i]; + for(b = 0; b <= distance; b++) { + dither[c->mc_luma_vals[i] + b] = b * (DITHERSTEPS - 1) / distance; + } + i++; + } + if(i >= c->mc_pal_size - 1) dither[a] = 0; + index1[a] = i; + index2[a] = FFMIN(i + 1, c->mc_pal_size - 1); + } + + /* and render charset */ + for (charpos = 0; charpos < CHARSET_CHARS; charpos++) { + lowdiff = 0; + highdiff = 0; + for (y = 0; y < 8; y++) { + row1 = 0; row2 = 0; + for (x = 0; x < 4; x++) { + pix = best_cb[y * 4 + x]; + + /* accumulate error for brightest/darkest color */ + if (index1[pix] >= 3) + highdiff += pix - c->mc_luma_vals[3]; + if (index1[pix] < 1) + lowdiff += c->mc_luma_vals[1] - pix; + + row1 <<= 2; + + if (INTERLACED) { + row2 <<= 2; + if (interlaced_dither_patterns[dither[pix]][(y & 3) * 2 + 0][x & 3]) + row1 |= 3-(index2[pix] & 3); + else + row1 |= 3-(index1[pix] & 3); + + if (interlaced_dither_patterns[dither[pix]][(y & 3) * 2 + 1][x & 3]) + row2 |= 3-(index2[pix] & 3); + else + row2 |= 3-(index1[pix] & 3); + } + else { + if (multi_dither_patterns[dither[pix]][(y & 3)][x & 3]) + row1 |= 3-(index2[pix] & 3); + else + row1 |= 3-(index1[pix] & 3); + } + } + charset[y+0x000] = row1; + if (INTERLACED) charset[y+0x800] = row2; + } + /* do we need to adjust pixels? */ + if (highdiff > 0 && lowdiff > 0 && c->mc_use_5col) { + if (lowdiff > highdiff) { + for (x = 0; x < 32; x++) + best_cb[x] = FFMIN(c->mc_luma_vals[3], best_cb[x]); + } else { + for (x = 0; x < 32; x++) + best_cb[x] = FFMAX(c->mc_luma_vals[1], best_cb[x]); + } + charpos--; /* redo now adjusted char */ + /* no adjustment needed, all fine */ + } else { + /* advance pointers */ + best_cb += 32; + charset += 8; + + /* remember colorram value */ + colrammap[charpos] = (highdiff > 0); + } + } +} + +static av_cold int a64multi_close_encoder(AVCodecContext *avctx) +{ + A64Context *c = avctx->priv_data; + av_free(c->mc_meta_charset); + av_free(c->mc_best_cb); + av_free(c->mc_charset); + av_free(c->mc_charmap); + av_free(c->mc_colram); + return 0; +} + +static av_cold int a64multi_init_encoder(AVCodecContext *avctx) +{ + A64Context *c = avctx->priv_data; + int a; + av_lfg_init(&c->randctx, 1); + + if (avctx->global_quality < 1) { + c->mc_lifetime = 4; + } else { + c->mc_lifetime = avctx->global_quality /= FF_QP2LAMBDA; + } + + av_log(avctx, AV_LOG_INFO, "charset lifetime set to %d frame(s)\n", c->mc_lifetime); + + c->mc_frame_counter = 0; + c->mc_use_5col = avctx->codec->id == CODEC_ID_A64_MULTI5; + c->mc_pal_size = 4 + c->mc_use_5col; + + /* precalc luma values for later use */ + for (a = 0; a < c->mc_pal_size; a++) { + c->mc_luma_vals[a]=a64_palette[mc_colors[a]][0] * 0.30 + + a64_palette[mc_colors[a]][1] * 0.59 + + a64_palette[mc_colors[a]][2] * 0.11; + } + + if (!(c->mc_meta_charset = av_malloc(32000 * c->mc_lifetime * sizeof(int))) || + !(c->mc_best_cb = av_malloc(CHARSET_CHARS * 32 * sizeof(int))) || + !(c->mc_charmap = av_mallocz(1000 * c->mc_lifetime * sizeof(int))) || + !(c->mc_colram = av_mallocz(CHARSET_CHARS * sizeof(uint8_t))) || + !(c->mc_charset = av_malloc(0x800 * (INTERLACED+1) * sizeof(uint8_t)))) { + av_log(avctx, AV_LOG_ERROR, "Failed to allocate buffer memory.\n"); + return AVERROR(ENOMEM); + } + + /* set up extradata */ + if (!(avctx->extradata = av_mallocz(8 * 4 + FF_INPUT_BUFFER_PADDING_SIZE))) { + av_log(avctx, AV_LOG_ERROR, "Failed to allocate memory for extradata.\n"); + return AVERROR(ENOMEM); + } + avctx->extradata_size = 8 * 4; + AV_WB32(avctx->extradata, c->mc_lifetime); + AV_WB32(avctx->extradata + 16, INTERLACED); + + avcodec_get_frame_defaults(&c->picture); + avctx->coded_frame = &c->picture; + avctx->coded_frame->pict_type = FF_I_TYPE; + avctx->coded_frame->key_frame = 1; + if (!avctx->codec_tag) + avctx->codec_tag = AV_RL32("a64m"); + + return 0; +} + +static void a64_compress_colram(unsigned char *buf, int *charmap, uint8_t *colram) +{ + int a; + uint8_t temp; + /* only needs to be done in 5col mode */ + /* XXX could be squeezed to 0x80 bytes */ + for (a = 0; a < 256; a++) { + temp = colram[charmap[a + 0x000]] << 0; + temp |= colram[charmap[a + 0x100]] << 1; + temp |= colram[charmap[a + 0x200]] << 2; + if (a < 0xe8) temp |= colram[charmap[a + 0x300]] << 3; + buf[a] = temp << 2; + } +} + +static int a64multi_encode_frame(AVCodecContext *avctx, unsigned char *buf, + int buf_size, void *data) +{ + A64Context *c = avctx->priv_data; + AVFrame *pict = data; + AVFrame *const p = (AVFrame *) & c->picture; + + int frame; + int x, y; + int b_height; + int b_width; + + int req_size; + int num_frames = c->mc_lifetime; + + int *charmap = c->mc_charmap; + uint8_t *colram = c->mc_colram; + uint8_t *charset = c->mc_charset; + int *meta = c->mc_meta_charset; + int *best_cb = c->mc_best_cb; + + int charset_size = 0x800 * (INTERLACED + 1); + int colram_size = 0x100 * c->mc_use_5col; + int screen_size; + + if(CROP_SCREENS) { + b_height = FFMIN(avctx->height,C64YRES) >> 3; + b_width = FFMIN(avctx->width ,C64XRES) >> 3; + screen_size = b_width * b_height; + } else { + b_height = C64YRES >> 3; + b_width = C64XRES >> 3; + screen_size = 0x400; + } + + /* no data, means end encoding asap */ + if (!data) { + /* all done, end encoding */ + if (!c->mc_lifetime) return 0; + /* no more frames in queue, prepare to flush remaining frames */ + if (!c->mc_frame_counter) { + num_frames = c->mc_lifetime; + c->mc_lifetime = 0; + } + /* still frames in queue so limit lifetime to remaining frames */ + else c->mc_lifetime = c->mc_frame_counter; + /* still new data available */ + } else { + /* fill up mc_meta_charset with data until lifetime exceeds */ + if (c->mc_frame_counter < c->mc_lifetime) { + *p = *pict; + p->pict_type = FF_I_TYPE; + p->key_frame = 1; + to_meta_with_crop(avctx, p, meta + 32000 * c->mc_frame_counter); + c->mc_frame_counter++; + /* lifetime is not reached so wait for next frame first */ + return 0; + } + } + + /* lifetime reached so now convert X frames at once */ + if (c->mc_frame_counter == c->mc_lifetime) { + req_size = 0; + /* any frames to encode? */ + if (c->mc_lifetime) { + /* calc optimal new charset + charmaps */ + ff_init_elbg(meta, 32, 1000 * c->mc_lifetime, best_cb, CHARSET_CHARS, 50, charmap, &c->randctx); + ff_do_elbg (meta, 32, 1000 * c->mc_lifetime, best_cb, CHARSET_CHARS, 50, charmap, &c->randctx); + + /* create colorram map and a c64 readable charset */ + render_charset(avctx, charset, colram); + + /* copy charset to buf */ + memcpy(buf,charset, charset_size); + + /* advance pointers */ + buf += charset_size; + charset += charset_size; + req_size += charset_size; + } + /* no charset so clean buf */ + else memset(buf, 0, charset_size); + + /* write x frames to buf */ + for (frame = 0; frame < c->mc_lifetime; frame++) { + /* copy charmap to buf. buf is uchar*, charmap is int*, so no memcpy here, sorry */ + for (y = 0; y < b_height; y++) { + for (x = 0; x < b_width; x++) { + buf[y * b_width + x] = charmap[y * b_width + x]; + } + } + /* advance pointers */ + buf += screen_size; + req_size += screen_size; + + /* compress and copy colram to buf */ + if (c->mc_use_5col) { + a64_compress_colram(buf, charmap, colram); + /* advance pointers */ + buf += colram_size; + req_size += colram_size; + } + + /* advance to next charmap */ + charmap += 1000; + } + + AV_WB32(avctx->extradata + 4, c->mc_frame_counter); + AV_WB32(avctx->extradata + 8, charset_size); + AV_WB32(avctx->extradata + 12, screen_size + colram_size); + + /* reset counter */ + c->mc_frame_counter = 0; + + if (req_size > buf_size) { + av_log(avctx, AV_LOG_ERROR, "buf size too small (need %d, got %d)\n", req_size, buf_size); + return -1; + } + return req_size; + } + return 0; +} + +AVCodec ff_a64multi_encoder = { + .name = "a64multi", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_A64_MULTI, + .priv_data_size = sizeof(A64Context), + .init = a64multi_init_encoder, + .encode = a64multi_encode_frame, + .close = a64multi_close_encoder, + .pix_fmts = (const enum PixelFormat[]) {PIX_FMT_GRAY8, PIX_FMT_NONE}, + .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"), + .capabilities = CODEC_CAP_DELAY, +}; + +AVCodec ff_a64multi5_encoder = { + .name = "a64multi5", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_A64_MULTI5, + .priv_data_size = sizeof(A64Context), + .init = a64multi_init_encoder, + .encode = a64multi_encode_frame, + .close = a64multi_close_encoder, + .pix_fmts = (const enum PixelFormat[]) {PIX_FMT_GRAY8, PIX_FMT_NONE}, + .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"), + .capabilities = CODEC_CAP_DELAY, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/a64tables.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/a64tables.h new file mode 100644 index 00000000..a955ef4c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/a64tables.h @@ -0,0 +1,150 @@ +/* + * a64 video encoder - tables used by a64 encoders + * Copyright (c) 2009 Tobias Bindhammer + * + * 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 + * a64 video encoder - tables used by a64 encoders + */ + +#ifndef AVCODEC_A64TABLES_H +#define AVCODEC_A64TABLES_H + +#include + +/** + * dither patterns used vor rendering the multicolor charset + */ + +static const uint8_t multi_dither_patterns[9][4][4] = { + { + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0} + }, + { + {1, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 1, 0}, + {0, 0, 0, 0} + }, + { + {1, 0, 0, 0}, + {0, 0, 1, 0}, + {0, 1, 0, 0}, + {0, 0, 0, 1} + }, + { + {1, 0, 0, 0}, + {0, 1, 0, 1}, + {0, 0, 1, 0}, + {0, 1, 0, 1} + }, + { + {1, 0, 1, 0}, + {0, 1, 0, 1}, + {1, 0, 1, 0}, + {0, 1, 0, 1} + }, + { + {1, 1, 1, 0}, + {0, 1, 0, 1}, + {1, 0, 1, 1}, + {0, 1, 0, 1} + }, + { + {0, 1, 1, 1}, + {1, 1, 0, 1}, + {1, 0, 1, 1}, + {1, 1, 1, 0} + }, + { + {0, 1, 1, 1}, + {1, 1, 1, 1}, + {1, 1, 0, 1}, + {1, 1, 1, 1} + }, + { + {1, 1, 1, 1}, + {1, 1, 1, 1}, + {1, 1, 1, 1}, + {1, 1, 1, 1} + }, +}; + +static const uint8_t interlaced_dither_patterns[9][8][4] = { + { + {0, 0, 0, 0}, {0, 0, 0, 0}, + {0, 0, 0, 0}, {0, 0, 0, 0}, + {0, 0, 0, 0}, {0, 0, 0, 0}, + {0, 0, 0, 0}, {0, 0, 0, 0}, + }, + { + {1, 0, 1, 0}, {0, 0, 0, 0}, + {0, 0, 0, 0}, {0, 0, 0, 0}, + {1, 0, 1, 0}, {0, 0, 0, 0}, + {0, 0, 0, 0}, {0, 0, 0, 0}, + }, + { + {1, 0, 1, 0}, {0, 0, 0, 0}, + {0, 0, 0, 0}, {0, 1, 0, 1}, + {1, 0, 1, 0}, {0, 0, 0, 0}, + {0, 0, 0, 0}, {0, 1, 0, 1}, + }, + { + {1, 0, 1, 0}, {0, 1, 0, 1}, + {0, 1, 0, 1}, {0, 0, 0, 0}, + {1, 0, 1, 0}, {0, 1, 0, 1}, + {0, 1, 0, 1}, {0, 0, 0, 0}, + }, + { + {1, 0, 1, 0}, {0, 1, 0, 1}, + {0, 1, 0, 1}, {1, 0, 1, 0}, + {1, 0, 1, 0}, {0, 1, 0, 1}, + {0, 1, 0, 1}, {1, 0, 1, 0}, + }, + { + {1, 0, 1, 0}, {0, 1, 0, 1}, + {1, 1, 1, 1}, {1, 0, 1, 0}, + {1, 0, 1, 0}, {0, 1, 0, 1}, + {1, 1, 1, 1}, {1, 0, 1, 0}, + }, + { + {1, 0, 1, 0}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {0, 1, 0, 1}, + {1, 0, 1, 0}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {0, 1, 0, 1}, + }, + { + {1, 1, 1, 1}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {0, 1, 0, 1}, + {1, 1, 1, 1}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {0, 1, 0, 1}, + }, + { + {1, 1, 1, 1}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {1, 1, 1, 1}, + } +}; + +#endif /* AVCODEC_A64TABLES_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_tablegen.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_tablegen.c new file mode 100644 index 00000000..33a179f5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_tablegen.c @@ -0,0 +1,37 @@ +/* + * Generate a header file for hardcoded AAC tables + * + * Copyright (c) 2010 Alex Converse + * + * 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 + */ + +#include +#define CONFIG_HARDCODED_TABLES 0 +#include "aac_tablegen.h" +#include "tableprint.h" + +int main(void) +{ + ff_aac_tableinit(); + + write_fileheader(); + + WRITE_ARRAY("const", float, ff_aac_pow2sf_tab); + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_tablegen.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_tablegen.h new file mode 100644 index 00000000..3a820ba6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_tablegen.h @@ -0,0 +1,42 @@ +/* + * Header file for hardcoded AAC tables + * + * Copyright (c) 2010 Alex Converse + * + * 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 + */ + +#ifndef AAC_TABLEGEN_H +#define AAC_TABLEGEN_H + +#include "aac_tablegen_decl.h" + +#if CONFIG_HARDCODED_TABLES +#include "libavcodec/aac_tables.h" +#else +#include "libavutil/mathematics.h" +float ff_aac_pow2sf_tab[428]; + +void ff_aac_tableinit(void) +{ + int i; + for (i = 0; i < 428; i++) + ff_aac_pow2sf_tab[i] = pow(2, (i - 200) / 4.); +} +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* AAC_TABLEGEN_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_tablegen_decl.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_tablegen_decl.h new file mode 100644 index 00000000..9a90a09b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aac_tablegen_decl.h @@ -0,0 +1,34 @@ +/* + * Header file for hardcoded AAC tables + * + * Copyright (c) 2010 Alex Converse + * + * 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 + */ + +#ifndef AAC_TABLEGEN_DECL_H +#define AAC_TABLEGEN_DECL_H + +#if CONFIG_HARDCODED_TABLES +#define ff_aac_tableinit() +extern const float ff_aac_pow2sf_tab[428]; +#else +void ff_aac_tableinit(void); +extern float ff_aac_pow2sf_tab[428]; +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* AAC_TABLEGEN_DECL_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacadtsdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacadtsdec.c new file mode 100644 index 00000000..fd86d288 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacadtsdec.c @@ -0,0 +1,70 @@ +/* + * Audio and Video frame extraction + * Copyright (c) 2003 Fabrice Bellard + * Copyright (c) 2003 Michael Niedermayer + * Copyright (c) 2009 Alex Converse + * + * 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 + */ + +#include "aac_ac3_parser.h" +#include "aacadtsdec.h" +#include "get_bits.h" +#include "mpeg4audio.h" + +int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr) +{ + int size, rdb, ch, sr; + int aot, crc_abs; + + if(get_bits(gbc, 12) != 0xfff) + return AAC_AC3_PARSE_ERROR_SYNC; + + skip_bits1(gbc); /* id */ + skip_bits(gbc, 2); /* layer */ + crc_abs = get_bits1(gbc); /* protection_absent */ + aot = get_bits(gbc, 2); /* profile_objecttype */ + sr = get_bits(gbc, 4); /* sample_frequency_index */ + if(!ff_mpeg4audio_sample_rates[sr]) + return AAC_AC3_PARSE_ERROR_SAMPLE_RATE; + skip_bits1(gbc); /* private_bit */ + ch = get_bits(gbc, 3); /* channel_configuration */ + + skip_bits1(gbc); /* original/copy */ + skip_bits1(gbc); /* home */ + + /* adts_variable_header */ + skip_bits1(gbc); /* copyright_identification_bit */ + skip_bits1(gbc); /* copyright_identification_start */ + size = get_bits(gbc, 13); /* aac_frame_length */ + if(size < AAC_ADTS_HEADER_SIZE) + return AAC_AC3_PARSE_ERROR_FRAME_SIZE; + + skip_bits(gbc, 11); /* adts_buffer_fullness */ + rdb = get_bits(gbc, 2); /* number_of_raw_data_blocks_in_frame */ + + hdr->object_type = aot + 1; + hdr->chan_config = ch; + hdr->crc_absent = crc_abs; + hdr->num_aac_frames = rdb + 1; + hdr->sampling_index = sr; + hdr->sample_rate = ff_mpeg4audio_sample_rates[sr]; + hdr->samples = (rdb + 1) * 1024; + hdr->bit_rate = size * 8 * hdr->sample_rate / hdr->samples; + + return size; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacadtsdec.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacadtsdec.h new file mode 100644 index 00000000..6e0a869c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacadtsdec.h @@ -0,0 +1,54 @@ +/* + * AAC ADTS header decoding prototypes and structures + * Copyright (c) 2003 Fabrice Bellard + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + */ + +#ifndef AVCODEC_AACADTSDEC_H +#define AVCODEC_AACADTSDEC_H + +#include +#include "get_bits.h" + +#define AAC_ADTS_HEADER_SIZE 7 + +typedef struct { + uint32_t sample_rate; + uint32_t samples; + uint32_t bit_rate; + uint8_t crc_absent; + uint8_t object_type; + uint8_t sampling_index; + uint8_t chan_config; + uint8_t num_aac_frames; +} AACADTSHeaderInfo; + +/** + * Parse AAC frame header. + * Parse the ADTS frame header to the end of the variable header, which is + * the first 54 bits. + * @param[in] gbc BitContext containing the first 54 bits of the frame. + * @param[out] hdr Pointer to struct where header info is written. + * @return Returns 0 on success, -1 if there is a sync word mismatch, + * -2 if the version element is invalid, -3 if the sample rate + * element is invalid, or -4 if the bit rate element is invalid. + */ +int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr); + +#endif /* AVCODEC_AACADTSDEC_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacdec.c new file mode 100644 index 00000000..411c1dfc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacdec.c @@ -0,0 +1,2377 @@ +/* + * AAC decoder + * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org ) + * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com ) + * + * AAC LATM decoder + * Copyright (c) 2008-2010 Paul Kendall + * Copyright (c) 2010 Janne Grunau + * + * 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 + * AAC decoder + * @author Oded Shimon ( ods15 ods15 dyndns org ) + * @author Maxim Gavrilov ( maxim.gavrilov gmail com ) + */ + +/* + * supported tools + * + * Support? Name + * N (code in SoC repo) gain control + * Y block switching + * Y window shapes - standard + * N window shapes - Low Delay + * Y filterbank - standard + * N (code in SoC repo) filterbank - Scalable Sample Rate + * Y Temporal Noise Shaping + * N (code in SoC repo) Long Term Prediction + * Y intensity stereo + * Y channel coupling + * Y frequency domain prediction + * Y Perceptual Noise Substitution + * Y Mid/Side stereo + * N Scalable Inverse AAC Quantization + * N Frequency Selective Switch + * N upsampling filter + * Y quantization & coding - AAC + * N quantization & coding - TwinVQ + * N quantization & coding - BSAC + * N AAC Error Resilience tools + * N Error Resilience payload syntax + * N Error Protection tool + * N CELP + * N Silence Compression + * N HVXC + * N HVXC 4kbits/s VR + * N Structured Audio tools + * N Structured Audio Sample Bank Format + * N MIDI + * N Harmonic and Individual Lines plus Noise + * N Text-To-Speech Interface + * Y Spectral Band Replication + * Y (not in this code) Layer-1 + * Y (not in this code) Layer-2 + * Y (not in this code) Layer-3 + * N SinuSoidal Coding (Transient, Sinusoid, Noise) + * Y Parametric Stereo + * N Direct Stream Transfer + * + * Note: - HE AAC v1 comprises LC AAC with Spectral Band Replication. + * - HE AAC v2 comprises LC AAC with Spectral Band Replication and + Parametric Stereo. + */ + + +#include "avcodec.h" +#include "internal.h" +#include "get_bits.h" +#include "dsputil.h" +#include "fft.h" +#include "fmtconvert.h" +#include "lpc.h" + +#include "aac.h" +#include "aactab.h" +#include "aacdectab.h" +#include "cbrt_tablegen.h" +#include "sbr.h" +#include "aacsbr.h" +#include "mpeg4audio.h" +#include "aacadtsdec.h" + +#include +#include +#include +#include + +#if ARCH_ARM +# include "arm/aac.h" +#endif + +union float754 { + float f; + uint32_t i; +}; + +static VLC vlc_scalefactors; +static VLC vlc_spectral[11]; + +static const char overread_err[] = "Input buffer exhausted before END element found\n"; + +static ChannelElement *get_che(AACContext *ac, int type, int elem_id) +{ + // For PCE based channel configurations map the channels solely based on tags. + if (!ac->m4ac.chan_config) { + return ac->tag_che_map[type][elem_id]; + } + // For indexed channel configurations map the channels solely based on position. + switch (ac->m4ac.chan_config) { + case 7: + if (ac->tags_mapped == 3 && type == TYPE_CPE) { + ac->tags_mapped++; + return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][2]; + } + case 6: + /* Some streams incorrectly code 5.1 audio as SCE[0] CPE[0] CPE[1] SCE[1] + instead of SCE[0] CPE[0] CPE[1] LFE[0]. If we seem to have + encountered such a stream, transfer the LFE[0] element to the SCE[1]'s mapping */ + if (ac->tags_mapped == tags_per_config[ac->m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) { + ac->tags_mapped++; + return ac->tag_che_map[type][elem_id] = ac->che[TYPE_LFE][0]; + } + case 5: + if (ac->tags_mapped == 2 && type == TYPE_CPE) { + ac->tags_mapped++; + return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][1]; + } + case 4: + if (ac->tags_mapped == 2 && ac->m4ac.chan_config == 4 && type == TYPE_SCE) { + ac->tags_mapped++; + return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1]; + } + case 3: + case 2: + if (ac->tags_mapped == (ac->m4ac.chan_config != 2) && type == TYPE_CPE) { + ac->tags_mapped++; + return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][0]; + } else if (ac->m4ac.chan_config == 2) { + return NULL; + } + case 1: + if (!ac->tags_mapped && type == TYPE_SCE) { + ac->tags_mapped++; + return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][0]; + } + default: + return NULL; + } +} + +/** + * Check for the channel element in the current channel position configuration. + * If it exists, make sure the appropriate element is allocated and map the + * channel order to match the internal FFmpeg channel layout. + * + * @param che_pos current channel position configuration + * @param type channel element type + * @param id channel element id + * @param channels count of the number of channels in the configuration + * + * @return Returns error status. 0 - OK, !0 - error + */ +static av_cold int che_configure(AACContext *ac, + enum ChannelPosition che_pos[4][MAX_ELEM_ID], + int type, int id, + int *channels) +{ + if (che_pos[type][id]) { + if (!ac->che[type][id] && !(ac->che[type][id] = av_mallocz(sizeof(ChannelElement)))) + return AVERROR(ENOMEM); + ff_aac_sbr_ctx_init(&ac->che[type][id]->sbr); + if (type != TYPE_CCE) { + ac->output_data[(*channels)++] = ac->che[type][id]->ch[0].ret; + if (type == TYPE_CPE || + (type == TYPE_SCE && ac->m4ac.ps == 1)) { + ac->output_data[(*channels)++] = ac->che[type][id]->ch[1].ret; + } + } + } else { + if (ac->che[type][id]) + ff_aac_sbr_ctx_close(&ac->che[type][id]->sbr); + av_freep(&ac->che[type][id]); + } + return 0; +} + +/** + * Configure output channel order based on the current program configuration element. + * + * @param che_pos current channel position configuration + * @param new_che_pos New channel position configuration - we only do something if it differs from the current one. + * + * @return Returns error status. 0 - OK, !0 - error + */ +static av_cold int output_configure(AACContext *ac, + enum ChannelPosition che_pos[4][MAX_ELEM_ID], + enum ChannelPosition new_che_pos[4][MAX_ELEM_ID], + int channel_config, enum OCStatus oc_type) +{ + AVCodecContext *avctx = ac->avctx; + int i, type, channels = 0, ret; + + if (new_che_pos != che_pos) + memcpy(che_pos, new_che_pos, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0])); + + if (channel_config) { + for (i = 0; i < tags_per_config[channel_config]; i++) { + if ((ret = che_configure(ac, che_pos, + aac_channel_layout_map[channel_config - 1][i][0], + aac_channel_layout_map[channel_config - 1][i][1], + &channels))) + return ret; + } + + memset(ac->tag_che_map, 0, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0])); + + avctx->channel_layout = aac_channel_layout[channel_config - 1]; + } else { + /* Allocate or free elements depending on if they are in the + * current program configuration. + * + * Set up default 1:1 output mapping. + * + * For a 5.1 stream the output order will be: + * [ Center ] [ Front Left ] [ Front Right ] [ LFE ] [ Surround Left ] [ Surround Right ] + */ + + for (i = 0; i < MAX_ELEM_ID; i++) { + for (type = 0; type < 4; type++) { + if ((ret = che_configure(ac, che_pos, type, i, &channels))) + return ret; + } + } + + memcpy(ac->tag_che_map, ac->che, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0])); + + avctx->channel_layout = 0; + } + + avctx->channels = channels; + + ac->output_configured = oc_type; + + return 0; +} + +/** + * Decode an array of 4 bit element IDs, optionally interleaved with a stereo/mono switching bit. + * + * @param cpe_map Stereo (Channel Pair Element) map, NULL if stereo bit is not present. + * @param sce_map mono (Single Channel Element) map + * @param type speaker type/position for these channels + */ +static void decode_channel_map(enum ChannelPosition *cpe_map, + enum ChannelPosition *sce_map, + enum ChannelPosition type, + GetBitContext *gb, int n) +{ + while (n--) { + enum ChannelPosition *map = cpe_map && get_bits1(gb) ? cpe_map : sce_map; // stereo or mono map + map[get_bits(gb, 4)] = type; + } +} + +/** + * Decode program configuration element; reference: table 4.2. + * + * @param new_che_pos New channel position configuration - we only do something if it differs from the current one. + * + * @return Returns error status. 0 - OK, !0 - error + */ +static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac, + enum ChannelPosition new_che_pos[4][MAX_ELEM_ID], + GetBitContext *gb) +{ + int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc, sampling_index; + int comment_len; + + skip_bits(gb, 2); // object_type + + sampling_index = get_bits(gb, 4); + if (m4ac->sampling_index != sampling_index) + av_log(avctx, AV_LOG_WARNING, "Sample rate index in program config element does not match the sample rate index configured by the container.\n"); + + num_front = get_bits(gb, 4); + num_side = get_bits(gb, 4); + num_back = get_bits(gb, 4); + num_lfe = get_bits(gb, 2); + num_assoc_data = get_bits(gb, 3); + num_cc = get_bits(gb, 4); + + if (get_bits1(gb)) + skip_bits(gb, 4); // mono_mixdown_tag + if (get_bits1(gb)) + skip_bits(gb, 4); // stereo_mixdown_tag + + if (get_bits1(gb)) + skip_bits(gb, 3); // mixdown_coeff_index and pseudo_surround + + decode_channel_map(new_che_pos[TYPE_CPE], new_che_pos[TYPE_SCE], AAC_CHANNEL_FRONT, gb, num_front); + decode_channel_map(new_che_pos[TYPE_CPE], new_che_pos[TYPE_SCE], AAC_CHANNEL_SIDE, gb, num_side ); + decode_channel_map(new_che_pos[TYPE_CPE], new_che_pos[TYPE_SCE], AAC_CHANNEL_BACK, gb, num_back ); + decode_channel_map(NULL, new_che_pos[TYPE_LFE], AAC_CHANNEL_LFE, gb, num_lfe ); + + skip_bits_long(gb, 4 * num_assoc_data); + + decode_channel_map(new_che_pos[TYPE_CCE], new_che_pos[TYPE_CCE], AAC_CHANNEL_CC, gb, num_cc ); + + align_get_bits(gb); + + /* comment field, first byte is length */ + comment_len = get_bits(gb, 8) * 8; + if (get_bits_left(gb) < comment_len) { + av_log(avctx, AV_LOG_ERROR, overread_err); + return -1; + } + skip_bits_long(gb, comment_len); + return 0; +} + +/** + * Set up channel positions based on a default channel configuration + * as specified in table 1.17. + * + * @param new_che_pos New channel position configuration - we only do something if it differs from the current one. + * + * @return Returns error status. 0 - OK, !0 - error + */ +static av_cold int set_default_channel_config(AVCodecContext *avctx, + enum ChannelPosition new_che_pos[4][MAX_ELEM_ID], + int channel_config) +{ + if (channel_config < 1 || channel_config > 7) { + av_log(avctx, AV_LOG_ERROR, "invalid default channel configuration (%d)\n", + channel_config); + return -1; + } + + /* default channel configurations: + * + * 1ch : front center (mono) + * 2ch : L + R (stereo) + * 3ch : front center + L + R + * 4ch : front center + L + R + back center + * 5ch : front center + L + R + back stereo + * 6ch : front center + L + R + back stereo + LFE + * 7ch : front center + L + R + outer front left + outer front right + back stereo + LFE + */ + + if (channel_config != 2) + new_che_pos[TYPE_SCE][0] = AAC_CHANNEL_FRONT; // front center (or mono) + if (channel_config > 1) + new_che_pos[TYPE_CPE][0] = AAC_CHANNEL_FRONT; // L + R (or stereo) + if (channel_config == 4) + new_che_pos[TYPE_SCE][1] = AAC_CHANNEL_BACK; // back center + if (channel_config > 4) + new_che_pos[TYPE_CPE][(channel_config == 7) + 1] + = AAC_CHANNEL_BACK; // back stereo + if (channel_config > 5) + new_che_pos[TYPE_LFE][0] = AAC_CHANNEL_LFE; // LFE + if (channel_config == 7) + new_che_pos[TYPE_CPE][1] = AAC_CHANNEL_FRONT; // outer front left + outer front right + + return 0; +} + +/** + * Decode GA "General Audio" specific configuration; reference: table 4.1. + * + * @param ac pointer to AACContext, may be null + * @param avctx pointer to AVCCodecContext, used for logging + * + * @return Returns error status. 0 - OK, !0 - error + */ +static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx, + GetBitContext *gb, + MPEG4AudioConfig *m4ac, + int channel_config) +{ + enum ChannelPosition new_che_pos[4][MAX_ELEM_ID]; + int extension_flag, ret; + + if (get_bits1(gb)) { // frameLengthFlag + av_log_missing_feature(avctx, "960/120 MDCT window is", 1); + return -1; + } + + if (get_bits1(gb)) // dependsOnCoreCoder + skip_bits(gb, 14); // coreCoderDelay + extension_flag = get_bits1(gb); + + if (m4ac->object_type == AOT_AAC_SCALABLE || + m4ac->object_type == AOT_ER_AAC_SCALABLE) + skip_bits(gb, 3); // layerNr + + memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0])); + if (channel_config == 0) { + skip_bits(gb, 4); // element_instance_tag + if ((ret = decode_pce(avctx, m4ac, new_che_pos, gb))) + return ret; + } else { + if ((ret = set_default_channel_config(avctx, new_che_pos, channel_config))) + return ret; + } + if (ac && (ret = output_configure(ac, ac->che_pos, new_che_pos, channel_config, OC_GLOBAL_HDR))) + return ret; + + if (extension_flag) { + switch (m4ac->object_type) { + case AOT_ER_BSAC: + skip_bits(gb, 5); // numOfSubFrame + skip_bits(gb, 11); // layer_length + break; + case AOT_ER_AAC_LC: + case AOT_ER_AAC_LTP: + case AOT_ER_AAC_SCALABLE: + case AOT_ER_AAC_LD: + skip_bits(gb, 3); /* aacSectionDataResilienceFlag + * aacScalefactorDataResilienceFlag + * aacSpectralDataResilienceFlag + */ + break; + } + skip_bits1(gb); // extensionFlag3 (TBD in version 3) + } + return 0; +} + +/** + * Decode audio specific configuration; reference: table 1.13. + * + * @param ac pointer to AACContext, may be null + * @param avctx pointer to AVCCodecContext, used for logging + * @param m4ac pointer to MPEG4AudioConfig, used for parsing + * @param data pointer to AVCodecContext extradata + * @param data_size size of AVCCodecContext extradata + * + * @return Returns error status or number of consumed bits. <0 - error + */ +static int decode_audio_specific_config(AACContext *ac, + AVCodecContext *avctx, + MPEG4AudioConfig *m4ac, + const uint8_t *data, int data_size) +{ + GetBitContext gb; + int i; + + init_get_bits(&gb, data, data_size * 8); + + if ((i = ff_mpeg4audio_get_config(m4ac, data, data_size)) < 0) + return -1; + if (m4ac->sampling_index > 12) { + av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", m4ac->sampling_index); + return -1; + } + if (m4ac->sbr == 1 && m4ac->ps == -1) + m4ac->ps = 1; + + skip_bits_long(&gb, i); + + switch (m4ac->object_type) { + case AOT_AAC_MAIN: + case AOT_AAC_LC: + if (decode_ga_specific_config(ac, avctx, &gb, m4ac, m4ac->chan_config)) + return -1; + break; + default: + av_log(avctx, AV_LOG_ERROR, "Audio object type %s%d is not supported.\n", + m4ac->sbr == 1? "SBR+" : "", m4ac->object_type); + return -1; + } + + return get_bits_count(&gb); +} + +/** + * linear congruential pseudorandom number generator + * + * @param previous_val pointer to the current state of the generator + * + * @return Returns a 32-bit pseudorandom integer + */ +static av_always_inline int lcg_random(int previous_val) +{ + return previous_val * 1664525 + 1013904223; +} + +static av_always_inline void reset_predict_state(PredictorState *ps) +{ + ps->r0 = 0.0f; + ps->r1 = 0.0f; + ps->cor0 = 0.0f; + ps->cor1 = 0.0f; + ps->var0 = 1.0f; + ps->var1 = 1.0f; +} + +static void reset_all_predictors(PredictorState *ps) +{ + int i; + for (i = 0; i < MAX_PREDICTORS; i++) + reset_predict_state(&ps[i]); +} + +static void reset_predictor_group(PredictorState *ps, int group_num) +{ + int i; + for (i = group_num - 1; i < MAX_PREDICTORS; i += 30) + reset_predict_state(&ps[i]); +} + +#define AAC_INIT_VLC_STATIC(num, size) \ + INIT_VLC_STATIC(&vlc_spectral[num], 8, ff_aac_spectral_sizes[num], \ + ff_aac_spectral_bits[num], sizeof( ff_aac_spectral_bits[num][0]), sizeof( ff_aac_spectral_bits[num][0]), \ + ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), sizeof(ff_aac_spectral_codes[num][0]), \ + size); + +static av_cold int aac_decode_init(AVCodecContext *avctx) +{ + AACContext *ac = avctx->priv_data; + + ac->avctx = avctx; + ac->m4ac.sample_rate = avctx->sample_rate; + + if (avctx->extradata_size > 0) { + if (decode_audio_specific_config(ac, ac->avctx, &ac->m4ac, + avctx->extradata, + avctx->extradata_size) < 0) + return -1; + } + + avctx->sample_fmt = AV_SAMPLE_FMT_S16; + + AAC_INIT_VLC_STATIC( 0, 304); + AAC_INIT_VLC_STATIC( 1, 270); + AAC_INIT_VLC_STATIC( 2, 550); + AAC_INIT_VLC_STATIC( 3, 300); + AAC_INIT_VLC_STATIC( 4, 328); + AAC_INIT_VLC_STATIC( 5, 294); + AAC_INIT_VLC_STATIC( 6, 306); + AAC_INIT_VLC_STATIC( 7, 268); + AAC_INIT_VLC_STATIC( 8, 510); + AAC_INIT_VLC_STATIC( 9, 366); + AAC_INIT_VLC_STATIC(10, 462); + + ff_aac_sbr_init(); + + dsputil_init(&ac->dsp, avctx); + ff_fmt_convert_init(&ac->fmt_conv, avctx); + + ac->random_state = 0x1f2e3d4c; + + // -1024 - Compensate wrong IMDCT method. + // 60 - Required to scale values to the correct range [-32768,32767] + // for float to int16 conversion. (1 << (60 / 4)) == 32768 + ac->sf_scale = 1. / -1024.; + ac->sf_offset = 60; + + ff_aac_tableinit(); + + INIT_VLC_STATIC(&vlc_scalefactors,7,FF_ARRAY_ELEMS(ff_aac_scalefactor_code), + ff_aac_scalefactor_bits, sizeof(ff_aac_scalefactor_bits[0]), sizeof(ff_aac_scalefactor_bits[0]), + ff_aac_scalefactor_code, sizeof(ff_aac_scalefactor_code[0]), sizeof(ff_aac_scalefactor_code[0]), + 352); + + ff_mdct_init(&ac->mdct, 11, 1, 1.0); + ff_mdct_init(&ac->mdct_small, 8, 1, 1.0); + // window initialization + ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024); + ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128); + ff_init_ff_sine_windows(10); + ff_init_ff_sine_windows( 7); + + cbrt_tableinit(); + + return 0; +} + +/** + * Skip data_stream_element; reference: table 4.10. + */ +static int skip_data_stream_element(AACContext *ac, GetBitContext *gb) +{ + int byte_align = get_bits1(gb); + int count = get_bits(gb, 8); + if (count == 255) + count += get_bits(gb, 8); + if (byte_align) + align_get_bits(gb); + + if (get_bits_left(gb) < 8 * count) { + av_log(ac->avctx, AV_LOG_ERROR, overread_err); + return -1; + } + skip_bits_long(gb, 8 * count); + return 0; +} + +static int decode_prediction(AACContext *ac, IndividualChannelStream *ics, + GetBitContext *gb) +{ + int sfb; + if (get_bits1(gb)) { + ics->predictor_reset_group = get_bits(gb, 5); + if (ics->predictor_reset_group == 0 || ics->predictor_reset_group > 30) { + av_log(ac->avctx, AV_LOG_ERROR, "Invalid Predictor Reset Group.\n"); + return -1; + } + } + for (sfb = 0; sfb < FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[ac->m4ac.sampling_index]); sfb++) { + ics->prediction_used[sfb] = get_bits1(gb); + } + return 0; +} + +/** + * Decode Individual Channel Stream info; reference: table 4.6. + * + * @param common_window Channels have independent [0], or shared [1], Individual Channel Stream information. + */ +static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics, + GetBitContext *gb, int common_window) +{ + if (get_bits1(gb)) { + av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n"); + memset(ics, 0, sizeof(IndividualChannelStream)); + return -1; + } + ics->window_sequence[1] = ics->window_sequence[0]; + ics->window_sequence[0] = get_bits(gb, 2); + ics->use_kb_window[1] = ics->use_kb_window[0]; + ics->use_kb_window[0] = get_bits1(gb); + ics->num_window_groups = 1; + ics->group_len[0] = 1; + if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { + int i; + ics->max_sfb = get_bits(gb, 4); + for (i = 0; i < 7; i++) { + if (get_bits1(gb)) { + ics->group_len[ics->num_window_groups - 1]++; + } else { + ics->num_window_groups++; + ics->group_len[ics->num_window_groups - 1] = 1; + } + } + ics->num_windows = 8; + ics->swb_offset = ff_swb_offset_128[ac->m4ac.sampling_index]; + ics->num_swb = ff_aac_num_swb_128[ac->m4ac.sampling_index]; + ics->tns_max_bands = ff_tns_max_bands_128[ac->m4ac.sampling_index]; + ics->predictor_present = 0; + } else { + ics->max_sfb = get_bits(gb, 6); + ics->num_windows = 1; + ics->swb_offset = ff_swb_offset_1024[ac->m4ac.sampling_index]; + ics->num_swb = ff_aac_num_swb_1024[ac->m4ac.sampling_index]; + ics->tns_max_bands = ff_tns_max_bands_1024[ac->m4ac.sampling_index]; + ics->predictor_present = get_bits1(gb); + ics->predictor_reset_group = 0; + if (ics->predictor_present) { + if (ac->m4ac.object_type == AOT_AAC_MAIN) { + if (decode_prediction(ac, ics, gb)) { + memset(ics, 0, sizeof(IndividualChannelStream)); + return -1; + } + } else if (ac->m4ac.object_type == AOT_AAC_LC) { + av_log(ac->avctx, AV_LOG_ERROR, "Prediction is not allowed in AAC-LC.\n"); + memset(ics, 0, sizeof(IndividualChannelStream)); + return -1; + } else { + av_log_missing_feature(ac->avctx, "Predictor bit set but LTP is", 1); + memset(ics, 0, sizeof(IndividualChannelStream)); + return -1; + } + } + } + + if (ics->max_sfb > ics->num_swb) { + av_log(ac->avctx, AV_LOG_ERROR, + "Number of scalefactor bands in group (%d) exceeds limit (%d).\n", + ics->max_sfb, ics->num_swb); + memset(ics, 0, sizeof(IndividualChannelStream)); + return -1; + } + + return 0; +} + +/** + * Decode band types (section_data payload); reference: table 4.46. + * + * @param band_type array of the used band type + * @param band_type_run_end array of the last scalefactor band of a band type run + * + * @return Returns error status. 0 - OK, !0 - error + */ +static int decode_band_types(AACContext *ac, enum BandType band_type[120], + int band_type_run_end[120], GetBitContext *gb, + IndividualChannelStream *ics) +{ + int g, idx = 0; + const int bits = (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) ? 3 : 5; + for (g = 0; g < ics->num_window_groups; g++) { + int k = 0; + while (k < ics->max_sfb) { + uint8_t sect_end = k; + int sect_len_incr; + int sect_band_type = get_bits(gb, 4); + if (sect_band_type == 12) { + av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n"); + return -1; + } + while ((sect_len_incr = get_bits(gb, bits)) == (1 << bits) - 1) + sect_end += sect_len_incr; + sect_end += sect_len_incr; + if (get_bits_left(gb) < 0) { + av_log(ac->avctx, AV_LOG_ERROR, overread_err); + return -1; + } + if (sect_end > ics->max_sfb) { + av_log(ac->avctx, AV_LOG_ERROR, + "Number of bands (%d) exceeds limit (%d).\n", + sect_end, ics->max_sfb); + return -1; + } + for (; k < sect_end; k++) { + band_type [idx] = sect_band_type; + band_type_run_end[idx++] = sect_end; + } + } + } + return 0; +} + +/** + * Decode scalefactors; reference: table 4.47. + * + * @param global_gain first scalefactor value as scalefactors are differentially coded + * @param band_type array of the used band type + * @param band_type_run_end array of the last scalefactor band of a band type run + * @param sf array of scalefactors or intensity stereo positions + * + * @return Returns error status. 0 - OK, !0 - error + */ +static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb, + unsigned int global_gain, + IndividualChannelStream *ics, + enum BandType band_type[120], + int band_type_run_end[120]) +{ + const int sf_offset = ac->sf_offset + (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE ? 12 : 0); + int g, i, idx = 0; + int offset[3] = { global_gain, global_gain - 90, 100 }; + int noise_flag = 1; + static const char *sf_str[3] = { "Global gain", "Noise gain", "Intensity stereo position" }; + for (g = 0; g < ics->num_window_groups; g++) { + for (i = 0; i < ics->max_sfb;) { + int run_end = band_type_run_end[idx]; + if (band_type[idx] == ZERO_BT) { + for (; i < run_end; i++, idx++) + sf[idx] = 0.; + } else if ((band_type[idx] == INTENSITY_BT) || (band_type[idx] == INTENSITY_BT2)) { + for (; i < run_end; i++, idx++) { + offset[2] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60; + if (offset[2] > 255U) { + av_log(ac->avctx, AV_LOG_ERROR, + "%s (%d) out of range.\n", sf_str[2], offset[2]); + return -1; + } + sf[idx] = ff_aac_pow2sf_tab[-offset[2] + 300]; + } + } else if (band_type[idx] == NOISE_BT) { + for (; i < run_end; i++, idx++) { + if (noise_flag-- > 0) + offset[1] += get_bits(gb, 9) - 256; + else + offset[1] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60; + if (offset[1] > 255U) { + av_log(ac->avctx, AV_LOG_ERROR, + "%s (%d) out of range.\n", sf_str[1], offset[1]); + return -1; + } + sf[idx] = -ff_aac_pow2sf_tab[offset[1] + sf_offset + 100]; + } + } else { + for (; i < run_end; i++, idx++) { + offset[0] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60; + if (offset[0] > 255U) { + av_log(ac->avctx, AV_LOG_ERROR, + "%s (%d) out of range.\n", sf_str[0], offset[0]); + return -1; + } + sf[idx] = -ff_aac_pow2sf_tab[ offset[0] + sf_offset]; + } + } + } + } + return 0; +} + +/** + * Decode pulse data; reference: table 4.7. + */ +static int decode_pulses(Pulse *pulse, GetBitContext *gb, + const uint16_t *swb_offset, int num_swb) +{ + int i, pulse_swb; + pulse->num_pulse = get_bits(gb, 2) + 1; + pulse_swb = get_bits(gb, 6); + if (pulse_swb >= num_swb) + return -1; + pulse->pos[0] = swb_offset[pulse_swb]; + pulse->pos[0] += get_bits(gb, 5); + if (pulse->pos[0] > 1023) + return -1; + pulse->amp[0] = get_bits(gb, 4); + for (i = 1; i < pulse->num_pulse; i++) { + pulse->pos[i] = get_bits(gb, 5) + pulse->pos[i - 1]; + if (pulse->pos[i] > 1023) + return -1; + pulse->amp[i] = get_bits(gb, 4); + } + return 0; +} + +/** + * Decode Temporal Noise Shaping data; reference: table 4.48. + * + * @return Returns error status. 0 - OK, !0 - error + */ +static int decode_tns(AACContext *ac, TemporalNoiseShaping *tns, + GetBitContext *gb, const IndividualChannelStream *ics) +{ + int w, filt, i, coef_len, coef_res, coef_compress; + const int is8 = ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE; + const int tns_max_order = is8 ? 7 : ac->m4ac.object_type == AOT_AAC_MAIN ? 20 : 12; + for (w = 0; w < ics->num_windows; w++) { + if ((tns->n_filt[w] = get_bits(gb, 2 - is8))) { + coef_res = get_bits1(gb); + + for (filt = 0; filt < tns->n_filt[w]; filt++) { + int tmp2_idx; + tns->length[w][filt] = get_bits(gb, 6 - 2 * is8); + + if ((tns->order[w][filt] = get_bits(gb, 5 - 2 * is8)) > tns_max_order) { + av_log(ac->avctx, AV_LOG_ERROR, "TNS filter order %d is greater than maximum %d.\n", + tns->order[w][filt], tns_max_order); + tns->order[w][filt] = 0; + return -1; + } + if (tns->order[w][filt]) { + tns->direction[w][filt] = get_bits1(gb); + coef_compress = get_bits1(gb); + coef_len = coef_res + 3 - coef_compress; + tmp2_idx = 2 * coef_compress + coef_res; + + for (i = 0; i < tns->order[w][filt]; i++) + tns->coef[w][filt][i] = tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)]; + } + } + } + } + return 0; +} + +/** + * Decode Mid/Side data; reference: table 4.54. + * + * @param ms_present Indicates mid/side stereo presence. [0] mask is all 0s; + * [1] mask is decoded from bitstream; [2] mask is all 1s; + * [3] reserved for scalable AAC + */ +static void decode_mid_side_stereo(ChannelElement *cpe, GetBitContext *gb, + int ms_present) +{ + int idx; + if (ms_present == 1) { + for (idx = 0; idx < cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb; idx++) + cpe->ms_mask[idx] = get_bits1(gb); + } else if (ms_present == 2) { + memset(cpe->ms_mask, 1, cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb * sizeof(cpe->ms_mask[0])); + } +} + +#ifndef VMUL2 +static inline float *VMUL2(float *dst, const float *v, unsigned idx, + const float *scale) +{ + float s = *scale; + *dst++ = v[idx & 15] * s; + *dst++ = v[idx>>4 & 15] * s; + return dst; +} +#endif + +#ifndef VMUL4 +static inline float *VMUL4(float *dst, const float *v, unsigned idx, + const float *scale) +{ + float s = *scale; + *dst++ = v[idx & 3] * s; + *dst++ = v[idx>>2 & 3] * s; + *dst++ = v[idx>>4 & 3] * s; + *dst++ = v[idx>>6 & 3] * s; + return dst; +} +#endif + +#ifndef VMUL2S +static inline float *VMUL2S(float *dst, const float *v, unsigned idx, + unsigned sign, const float *scale) +{ + union float754 s0, s1; + + s0.f = s1.f = *scale; + s0.i ^= sign >> 1 << 31; + s1.i ^= sign << 31; + + *dst++ = v[idx & 15] * s0.f; + *dst++ = v[idx>>4 & 15] * s1.f; + + return dst; +} +#endif + +#ifndef VMUL4S +static inline float *VMUL4S(float *dst, const float *v, unsigned idx, + unsigned sign, const float *scale) +{ + unsigned nz = idx >> 12; + union float754 s = { .f = *scale }; + union float754 t; + + t.i = s.i ^ (sign & 1<<31); + *dst++ = v[idx & 3] * t.f; + + sign <<= nz & 1; nz >>= 1; + t.i = s.i ^ (sign & 1<<31); + *dst++ = v[idx>>2 & 3] * t.f; + + sign <<= nz & 1; nz >>= 1; + t.i = s.i ^ (sign & 1<<31); + *dst++ = v[idx>>4 & 3] * t.f; + + sign <<= nz & 1; nz >>= 1; + t.i = s.i ^ (sign & 1<<31); + *dst++ = v[idx>>6 & 3] * t.f; + + return dst; +} +#endif + +/** + * Decode spectral data; reference: table 4.50. + * Dequantize and scale spectral data; reference: 4.6.3.3. + * + * @param coef array of dequantized, scaled spectral data + * @param sf array of scalefactors or intensity stereo positions + * @param pulse_present set if pulses are present + * @param pulse pointer to pulse data struct + * @param band_type array of the used band type + * + * @return Returns error status. 0 - OK, !0 - error + */ +static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024], + GetBitContext *gb, const float sf[120], + int pulse_present, const Pulse *pulse, + const IndividualChannelStream *ics, + enum BandType band_type[120]) +{ + int i, k, g, idx = 0; + const int c = 1024 / ics->num_windows; + const uint16_t *offsets = ics->swb_offset; + float *coef_base = coef; + + for (g = 0; g < ics->num_windows; g++) + memset(coef + g * 128 + offsets[ics->max_sfb], 0, sizeof(float) * (c - offsets[ics->max_sfb])); + + for (g = 0; g < ics->num_window_groups; g++) { + unsigned g_len = ics->group_len[g]; + + for (i = 0; i < ics->max_sfb; i++, idx++) { + const unsigned cbt_m1 = band_type[idx] - 1; + float *cfo = coef + offsets[i]; + int off_len = offsets[i + 1] - offsets[i]; + int group; + + if (cbt_m1 >= INTENSITY_BT2 - 1) { + for (group = 0; group < g_len; group++, cfo+=128) { + memset(cfo, 0, off_len * sizeof(float)); + } + } else if (cbt_m1 == NOISE_BT - 1) { + for (group = 0; group < g_len; group++, cfo+=128) { + float scale; + float band_energy; + + for (k = 0; k < off_len; k++) { + ac->random_state = lcg_random(ac->random_state); + cfo[k] = ac->random_state; + } + + band_energy = ac->dsp.scalarproduct_float(cfo, cfo, off_len); + scale = sf[idx] / sqrtf(band_energy); + ac->dsp.vector_fmul_scalar(cfo, cfo, scale, off_len); + } + } else { + const float *vq = ff_aac_codebook_vector_vals[cbt_m1]; + const uint16_t *cb_vector_idx = ff_aac_codebook_vector_idx[cbt_m1]; + VLC_TYPE (*vlc_tab)[2] = vlc_spectral[cbt_m1].table; + OPEN_READER(re, gb); + + switch (cbt_m1 >> 1) { + case 0: + for (group = 0; group < g_len; group++, cfo+=128) { + float *cf = cfo; + int len = off_len; + + do { + int code; + unsigned cb_idx; + + UPDATE_CACHE(re, gb); + GET_VLC(code, re, gb, vlc_tab, 8, 2); + cb_idx = cb_vector_idx[code]; + cf = VMUL4(cf, vq, cb_idx, sf + idx); + } while (len -= 4); + } + break; + + case 1: + for (group = 0; group < g_len; group++, cfo+=128) { + float *cf = cfo; + int len = off_len; + + do { + int code; + unsigned nnz; + unsigned cb_idx; + uint32_t bits; + + UPDATE_CACHE(re, gb); + GET_VLC(code, re, gb, vlc_tab, 8, 2); + cb_idx = cb_vector_idx[code]; + nnz = cb_idx >> 8 & 15; + bits = SHOW_UBITS(re, gb, nnz) << (32-nnz); + LAST_SKIP_BITS(re, gb, nnz); + cf = VMUL4S(cf, vq, cb_idx, bits, sf + idx); + } while (len -= 4); + } + break; + + case 2: + for (group = 0; group < g_len; group++, cfo+=128) { + float *cf = cfo; + int len = off_len; + + do { + int code; + unsigned cb_idx; + + UPDATE_CACHE(re, gb); + GET_VLC(code, re, gb, vlc_tab, 8, 2); + cb_idx = cb_vector_idx[code]; + cf = VMUL2(cf, vq, cb_idx, sf + idx); + } while (len -= 2); + } + break; + + case 3: + case 4: + for (group = 0; group < g_len; group++, cfo+=128) { + float *cf = cfo; + int len = off_len; + + do { + int code; + unsigned nnz; + unsigned cb_idx; + unsigned sign; + + UPDATE_CACHE(re, gb); + GET_VLC(code, re, gb, vlc_tab, 8, 2); + cb_idx = cb_vector_idx[code]; + nnz = cb_idx >> 8 & 15; + sign = SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12); + LAST_SKIP_BITS(re, gb, nnz); + cf = VMUL2S(cf, vq, cb_idx, sign, sf + idx); + } while (len -= 2); + } + break; + + default: + for (group = 0; group < g_len; group++, cfo+=128) { + float *cf = cfo; + uint32_t *icf = (uint32_t *) cf; + int len = off_len; + + do { + int code; + unsigned nzt, nnz; + unsigned cb_idx; + uint32_t bits; + int j; + + UPDATE_CACHE(re, gb); + GET_VLC(code, re, gb, vlc_tab, 8, 2); + + if (!code) { + *icf++ = 0; + *icf++ = 0; + continue; + } + + cb_idx = cb_vector_idx[code]; + nnz = cb_idx >> 12; + nzt = cb_idx >> 8; + bits = SHOW_UBITS(re, gb, nnz) << (32-nnz); + LAST_SKIP_BITS(re, gb, nnz); + + for (j = 0; j < 2; j++) { + if (nzt & 1< 8) { + av_log(ac->avctx, AV_LOG_ERROR, "error in spectral data, ESC overflow\n"); + return -1; + } + + SKIP_BITS(re, gb, b + 1); + b += 4; + n = (1 << b) + SHOW_UBITS(re, gb, b); + LAST_SKIP_BITS(re, gb, b); + *icf++ = cbrt_tab[n] | (bits & 1<<31); + bits <<= 1; + } else { + unsigned v = ((const uint32_t*)vq)[cb_idx & 15]; + *icf++ = (bits & 1<<31) | v; + bits <<= !!v; + } + cb_idx >>= 4; + } + } while (len -= 2); + + ac->dsp.vector_fmul_scalar(cfo, cfo, sf[idx], off_len); + } + } + + CLOSE_READER(re, gb); + } + } + coef += g_len << 7; + } + + if (pulse_present) { + idx = 0; + for (i = 0; i < pulse->num_pulse; i++) { + float co = coef_base[ pulse->pos[i] ]; + while (offsets[idx + 1] <= pulse->pos[i]) + idx++; + if (band_type[idx] != NOISE_BT && sf[idx]) { + float ico = -pulse->amp[i]; + if (co) { + co /= sf[idx]; + ico = co / sqrtf(sqrtf(fabsf(co))) + (co > 0 ? -ico : ico); + } + coef_base[ pulse->pos[i] ] = cbrtf(fabsf(ico)) * ico * sf[idx]; + } + } + } + return 0; +} + +static av_always_inline float flt16_round(float pf) +{ + union float754 tmp; + tmp.f = pf; + tmp.i = (tmp.i + 0x00008000U) & 0xFFFF0000U; + return tmp.f; +} + +static av_always_inline float flt16_even(float pf) +{ + union float754 tmp; + tmp.f = pf; + tmp.i = (tmp.i + 0x00007FFFU + (tmp.i & 0x00010000U >> 16)) & 0xFFFF0000U; + return tmp.f; +} + +static av_always_inline float flt16_trunc(float pf) +{ + union float754 pun; + pun.f = pf; + pun.i &= 0xFFFF0000U; + return pun.f; +} + +static av_always_inline void predict(PredictorState *ps, float *coef, + float sf_scale, float inv_sf_scale, + int output_enable) +{ + const float a = 0.953125; // 61.0 / 64 + const float alpha = 0.90625; // 29.0 / 32 + float e0, e1; + float pv; + float k1, k2; + float r0 = ps->r0, r1 = ps->r1; + float cor0 = ps->cor0, cor1 = ps->cor1; + float var0 = ps->var0, var1 = ps->var1; + + k1 = var0 > 1 ? cor0 * flt16_even(a / var0) : 0; + k2 = var1 > 1 ? cor1 * flt16_even(a / var1) : 0; + + pv = flt16_round(k1 * r0 + k2 * r1); + if (output_enable) + *coef += pv * sf_scale; + + e0 = *coef * inv_sf_scale; + e1 = e0 - k1 * r0; + + ps->cor1 = flt16_trunc(alpha * cor1 + r1 * e1); + ps->var1 = flt16_trunc(alpha * var1 + 0.5f * (r1 * r1 + e1 * e1)); + ps->cor0 = flt16_trunc(alpha * cor0 + r0 * e0); + ps->var0 = flt16_trunc(alpha * var0 + 0.5f * (r0 * r0 + e0 * e0)); + + ps->r1 = flt16_trunc(a * (r0 - k1 * e0)); + ps->r0 = flt16_trunc(a * e0); +} + +/** + * Apply AAC-Main style frequency domain prediction. + */ +static void apply_prediction(AACContext *ac, SingleChannelElement *sce) +{ + int sfb, k; + float sf_scale = ac->sf_scale, inv_sf_scale = 1 / ac->sf_scale; + + if (!sce->ics.predictor_initialized) { + reset_all_predictors(sce->predictor_state); + sce->ics.predictor_initialized = 1; + } + + if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) { + for (sfb = 0; sfb < ff_aac_pred_sfb_max[ac->m4ac.sampling_index]; sfb++) { + for (k = sce->ics.swb_offset[sfb]; k < sce->ics.swb_offset[sfb + 1]; k++) { + predict(&sce->predictor_state[k], &sce->coeffs[k], + sf_scale, inv_sf_scale, + sce->ics.predictor_present && sce->ics.prediction_used[sfb]); + } + } + if (sce->ics.predictor_reset_group) + reset_predictor_group(sce->predictor_state, sce->ics.predictor_reset_group); + } else + reset_all_predictors(sce->predictor_state); +} + +/** + * Decode an individual_channel_stream payload; reference: table 4.44. + * + * @param common_window Channels have independent [0], or shared [1], Individual Channel Stream information. + * @param scale_flag scalable [1] or non-scalable [0] AAC (Unused until scalable AAC is implemented.) + * + * @return Returns error status. 0 - OK, !0 - error + */ +static int decode_ics(AACContext *ac, SingleChannelElement *sce, + GetBitContext *gb, int common_window, int scale_flag) +{ + Pulse pulse; + TemporalNoiseShaping *tns = &sce->tns; + IndividualChannelStream *ics = &sce->ics; + float *out = sce->coeffs; + int global_gain, pulse_present = 0; + + /* This assignment is to silence a GCC warning about the variable being used + * uninitialized when in fact it always is. + */ + pulse.num_pulse = 0; + + global_gain = get_bits(gb, 8); + + if (!common_window && !scale_flag) { + if (decode_ics_info(ac, ics, gb, 0) < 0) + return -1; + } + + if (decode_band_types(ac, sce->band_type, sce->band_type_run_end, gb, ics) < 0) + return -1; + if (decode_scalefactors(ac, sce->sf, gb, global_gain, ics, sce->band_type, sce->band_type_run_end) < 0) + return -1; + + pulse_present = 0; + if (!scale_flag) { + if ((pulse_present = get_bits1(gb))) { + if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { + av_log(ac->avctx, AV_LOG_ERROR, "Pulse tool not allowed in eight short sequence.\n"); + return -1; + } + if (decode_pulses(&pulse, gb, ics->swb_offset, ics->num_swb)) { + av_log(ac->avctx, AV_LOG_ERROR, "Pulse data corrupt or invalid.\n"); + return -1; + } + } + if ((tns->present = get_bits1(gb)) && decode_tns(ac, tns, gb, ics)) + return -1; + if (get_bits1(gb)) { + av_log_missing_feature(ac->avctx, "SSR", 1); + return -1; + } + } + + if (decode_spectrum_and_dequant(ac, out, gb, sce->sf, pulse_present, &pulse, ics, sce->band_type) < 0) + return -1; + + if (ac->m4ac.object_type == AOT_AAC_MAIN && !common_window) + apply_prediction(ac, sce); + + return 0; +} + +/** + * Mid/Side stereo decoding; reference: 4.6.8.1.3. + */ +static void apply_mid_side_stereo(AACContext *ac, ChannelElement *cpe) +{ + const IndividualChannelStream *ics = &cpe->ch[0].ics; + float *ch0 = cpe->ch[0].coeffs; + float *ch1 = cpe->ch[1].coeffs; + int g, i, group, idx = 0; + const uint16_t *offsets = ics->swb_offset; + for (g = 0; g < ics->num_window_groups; g++) { + for (i = 0; i < ics->max_sfb; i++, idx++) { + if (cpe->ms_mask[idx] && + cpe->ch[0].band_type[idx] < NOISE_BT && cpe->ch[1].band_type[idx] < NOISE_BT) { + for (group = 0; group < ics->group_len[g]; group++) { + ac->dsp.butterflies_float(ch0 + group * 128 + offsets[i], + ch1 + group * 128 + offsets[i], + offsets[i+1] - offsets[i]); + } + } + } + ch0 += ics->group_len[g] * 128; + ch1 += ics->group_len[g] * 128; + } +} + +/** + * intensity stereo decoding; reference: 4.6.8.2.3 + * + * @param ms_present Indicates mid/side stereo presence. [0] mask is all 0s; + * [1] mask is decoded from bitstream; [2] mask is all 1s; + * [3] reserved for scalable AAC + */ +static void apply_intensity_stereo(ChannelElement *cpe, int ms_present) +{ + const IndividualChannelStream *ics = &cpe->ch[1].ics; + SingleChannelElement *sce1 = &cpe->ch[1]; + float *coef0 = cpe->ch[0].coeffs, *coef1 = cpe->ch[1].coeffs; + const uint16_t *offsets = ics->swb_offset; + int g, group, i, k, idx = 0; + int c; + float scale; + for (g = 0; g < ics->num_window_groups; g++) { + for (i = 0; i < ics->max_sfb;) { + if (sce1->band_type[idx] == INTENSITY_BT || sce1->band_type[idx] == INTENSITY_BT2) { + const int bt_run_end = sce1->band_type_run_end[idx]; + for (; i < bt_run_end; i++, idx++) { + c = -1 + 2 * (sce1->band_type[idx] - 14); + if (ms_present) + c *= 1 - 2 * cpe->ms_mask[idx]; + scale = c * sce1->sf[idx]; + for (group = 0; group < ics->group_len[g]; group++) + for (k = offsets[i]; k < offsets[i + 1]; k++) + coef1[group * 128 + k] = scale * coef0[group * 128 + k]; + } + } else { + int bt_run_end = sce1->band_type_run_end[idx]; + idx += bt_run_end - i; + i = bt_run_end; + } + } + coef0 += ics->group_len[g] * 128; + coef1 += ics->group_len[g] * 128; + } +} + +/** + * Decode a channel_pair_element; reference: table 4.4. + * + * @return Returns error status. 0 - OK, !0 - error + */ +static int decode_cpe(AACContext *ac, GetBitContext *gb, ChannelElement *cpe) +{ + int i, ret, common_window, ms_present = 0; + + common_window = get_bits1(gb); + if (common_window) { + if (decode_ics_info(ac, &cpe->ch[0].ics, gb, 1)) + return -1; + i = cpe->ch[1].ics.use_kb_window[0]; + cpe->ch[1].ics = cpe->ch[0].ics; + cpe->ch[1].ics.use_kb_window[1] = i; + ms_present = get_bits(gb, 2); + if (ms_present == 3) { + av_log(ac->avctx, AV_LOG_ERROR, "ms_present = 3 is reserved.\n"); + return -1; + } else if (ms_present) + decode_mid_side_stereo(cpe, gb, ms_present); + } + if ((ret = decode_ics(ac, &cpe->ch[0], gb, common_window, 0))) + return ret; + if ((ret = decode_ics(ac, &cpe->ch[1], gb, common_window, 0))) + return ret; + + if (common_window) { + if (ms_present) + apply_mid_side_stereo(ac, cpe); + if (ac->m4ac.object_type == AOT_AAC_MAIN) { + apply_prediction(ac, &cpe->ch[0]); + apply_prediction(ac, &cpe->ch[1]); + } + } + + apply_intensity_stereo(cpe, ms_present); + return 0; +} + +static const float cce_scale[] = { + 1.09050773266525765921, //2^(1/8) + 1.18920711500272106672, //2^(1/4) + M_SQRT2, + 2, +}; + +/** + * Decode coupling_channel_element; reference: table 4.8. + * + * @return Returns error status. 0 - OK, !0 - error + */ +static int decode_cce(AACContext *ac, GetBitContext *gb, ChannelElement *che) +{ + int num_gain = 0; + int c, g, sfb, ret; + int sign; + float scale; + SingleChannelElement *sce = &che->ch[0]; + ChannelCoupling *coup = &che->coup; + + coup->coupling_point = 2 * get_bits1(gb); + coup->num_coupled = get_bits(gb, 3); + for (c = 0; c <= coup->num_coupled; c++) { + num_gain++; + coup->type[c] = get_bits1(gb) ? TYPE_CPE : TYPE_SCE; + coup->id_select[c] = get_bits(gb, 4); + if (coup->type[c] == TYPE_CPE) { + coup->ch_select[c] = get_bits(gb, 2); + if (coup->ch_select[c] == 3) + num_gain++; + } else + coup->ch_select[c] = 2; + } + coup->coupling_point += get_bits1(gb) || (coup->coupling_point >> 1); + + sign = get_bits(gb, 1); + scale = cce_scale[get_bits(gb, 2)]; + + if ((ret = decode_ics(ac, sce, gb, 0, 0))) + return ret; + + for (c = 0; c < num_gain; c++) { + int idx = 0; + int cge = 1; + int gain = 0; + float gain_cache = 1.; + if (c) { + cge = coup->coupling_point == AFTER_IMDCT ? 1 : get_bits1(gb); + gain = cge ? get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60: 0; + gain_cache = powf(scale, -gain); + } + if (coup->coupling_point == AFTER_IMDCT) { + coup->gain[c][0] = gain_cache; + } else { + for (g = 0; g < sce->ics.num_window_groups; g++) { + for (sfb = 0; sfb < sce->ics.max_sfb; sfb++, idx++) { + if (sce->band_type[idx] != ZERO_BT) { + if (!cge) { + int t = get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60; + if (t) { + int s = 1; + t = gain += t; + if (sign) { + s -= 2 * (t & 0x1); + t >>= 1; + } + gain_cache = powf(scale, -t) * s; + } + } + coup->gain[c][idx] = gain_cache; + } + } + } + } + } + return 0; +} + +/** + * Parse whether channels are to be excluded from Dynamic Range Compression; reference: table 4.53. + * + * @return Returns number of bytes consumed. + */ +static int decode_drc_channel_exclusions(DynamicRangeControl *che_drc, + GetBitContext *gb) +{ + int i; + int num_excl_chan = 0; + + do { + for (i = 0; i < 7; i++) + che_drc->exclude_mask[num_excl_chan++] = get_bits1(gb); + } while (num_excl_chan < MAX_CHANNELS - 7 && get_bits1(gb)); + + return num_excl_chan / 7; +} + +/** + * Decode dynamic range information; reference: table 4.52. + * + * @param cnt length of TYPE_FIL syntactic element in bytes + * + * @return Returns number of bytes consumed. + */ +static int decode_dynamic_range(DynamicRangeControl *che_drc, + GetBitContext *gb, int cnt) +{ + int n = 1; + int drc_num_bands = 1; + int i; + + /* pce_tag_present? */ + if (get_bits1(gb)) { + che_drc->pce_instance_tag = get_bits(gb, 4); + skip_bits(gb, 4); // tag_reserved_bits + n++; + } + + /* excluded_chns_present? */ + if (get_bits1(gb)) { + n += decode_drc_channel_exclusions(che_drc, gb); + } + + /* drc_bands_present? */ + if (get_bits1(gb)) { + che_drc->band_incr = get_bits(gb, 4); + che_drc->interpolation_scheme = get_bits(gb, 4); + n++; + drc_num_bands += che_drc->band_incr; + for (i = 0; i < drc_num_bands; i++) { + che_drc->band_top[i] = get_bits(gb, 8); + n++; + } + } + + /* prog_ref_level_present? */ + if (get_bits1(gb)) { + che_drc->prog_ref_level = get_bits(gb, 7); + skip_bits1(gb); // prog_ref_level_reserved_bits + n++; + } + + for (i = 0; i < drc_num_bands; i++) { + che_drc->dyn_rng_sgn[i] = get_bits1(gb); + che_drc->dyn_rng_ctl[i] = get_bits(gb, 7); + n++; + } + + return n; +} + +/** + * Decode extension data (incomplete); reference: table 4.51. + * + * @param cnt length of TYPE_FIL syntactic element in bytes + * + * @return Returns number of bytes consumed + */ +static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt, + ChannelElement *che, enum RawDataBlockType elem_type) +{ + int crc_flag = 0; + int res = cnt; + switch (get_bits(gb, 4)) { // extension type + case EXT_SBR_DATA_CRC: + crc_flag++; + case EXT_SBR_DATA: + if (!che) { + av_log(ac->avctx, AV_LOG_ERROR, "SBR was found before the first channel element.\n"); + return res; + } else if (!ac->m4ac.sbr) { + av_log(ac->avctx, AV_LOG_ERROR, "SBR signaled to be not-present but was found in the bitstream.\n"); + skip_bits_long(gb, 8 * cnt - 4); + return res; + } else if (ac->m4ac.sbr == -1 && ac->output_configured == OC_LOCKED) { + av_log(ac->avctx, AV_LOG_ERROR, "Implicit SBR was found with a first occurrence after the first frame.\n"); + skip_bits_long(gb, 8 * cnt - 4); + return res; + } else if (ac->m4ac.ps == -1 && ac->output_configured < OC_LOCKED && ac->avctx->channels == 1) { + ac->m4ac.sbr = 1; + ac->m4ac.ps = 1; + output_configure(ac, ac->che_pos, ac->che_pos, ac->m4ac.chan_config, ac->output_configured); + } else { + ac->m4ac.sbr = 1; + } + res = ff_decode_sbr_extension(ac, &che->sbr, gb, crc_flag, cnt, elem_type); + break; + case EXT_DYNAMIC_RANGE: + res = decode_dynamic_range(&ac->che_drc, gb, cnt); + break; + case EXT_FILL: + case EXT_FILL_DATA: + case EXT_DATA_ELEMENT: + default: + skip_bits_long(gb, 8 * cnt - 4); + break; + }; + return res; +} + +/** + * Decode Temporal Noise Shaping filter coefficients and apply all-pole filters; reference: 4.6.9.3. + * + * @param decode 1 if tool is used normally, 0 if tool is used in LTP. + * @param coef spectral coefficients + */ +static void apply_tns(float coef[1024], TemporalNoiseShaping *tns, + IndividualChannelStream *ics, int decode) +{ + const int mmm = FFMIN(ics->tns_max_bands, ics->max_sfb); + int w, filt, m, i; + int bottom, top, order, start, end, size, inc; + float lpc[TNS_MAX_ORDER]; + + for (w = 0; w < ics->num_windows; w++) { + bottom = ics->num_swb; + for (filt = 0; filt < tns->n_filt[w]; filt++) { + top = bottom; + bottom = FFMAX(0, top - tns->length[w][filt]); + order = tns->order[w][filt]; + if (order == 0) + continue; + + // tns_decode_coef + compute_lpc_coefs(tns->coef[w][filt], order, lpc, 0, 0, 0); + + start = ics->swb_offset[FFMIN(bottom, mmm)]; + end = ics->swb_offset[FFMIN( top, mmm)]; + if ((size = end - start) <= 0) + continue; + if (tns->direction[w][filt]) { + inc = -1; + start = end - 1; + } else { + inc = 1; + } + start += w * 128; + + // ar filter + for (m = 0; m < size; m++, start += inc) + for (i = 1; i <= FFMIN(m, order); i++) + coef[start] -= coef[start - i * inc] * lpc[i - 1]; + } + } +} + +/** + * Conduct IMDCT and windowing. + */ +static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce) +{ + IndividualChannelStream *ics = &sce->ics; + float *in = sce->coeffs; + float *out = sce->ret; + float *saved = sce->saved; + const float *swindow = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128; + const float *lwindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024; + const float *swindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128; + float *buf = ac->buf_mdct; + float *temp = ac->temp; + int i; + + // imdct + if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { + for (i = 0; i < 1024; i += 128) + ff_imdct_half(&ac->mdct_small, buf + i, in + i); + } else + ff_imdct_half(&ac->mdct, buf, in); + + /* window overlapping + * NOTE: To simplify the overlapping code, all 'meaningless' short to long + * and long to short transitions are considered to be short to short + * transitions. This leaves just two cases (long to long and short to short) + * with a little special sauce for EIGHT_SHORT_SEQUENCE. + */ + if ((ics->window_sequence[1] == ONLY_LONG_SEQUENCE || ics->window_sequence[1] == LONG_STOP_SEQUENCE) && + (ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) { + ac->dsp.vector_fmul_window( out, saved, buf, lwindow_prev, 512); + } else { + memcpy( out, saved, 448 * sizeof(float)); + + if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { + ac->dsp.vector_fmul_window(out + 448 + 0*128, saved + 448, buf + 0*128, swindow_prev, 64); + ac->dsp.vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow, 64); + ac->dsp.vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow, 64); + ac->dsp.vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow, 64); + ac->dsp.vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, swindow, 64); + memcpy( out + 448 + 4*128, temp, 64 * sizeof(float)); + } else { + ac->dsp.vector_fmul_window(out + 448, saved + 448, buf, swindow_prev, 64); + memcpy( out + 576, buf + 64, 448 * sizeof(float)); + } + } + + // buffer update + if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { + memcpy( saved, temp + 64, 64 * sizeof(float)); + ac->dsp.vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, swindow, 64); + ac->dsp.vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64); + ac->dsp.vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64); + memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float)); + } else if (ics->window_sequence[0] == LONG_START_SEQUENCE) { + memcpy( saved, buf + 512, 448 * sizeof(float)); + memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float)); + } else { // LONG_STOP or ONLY_LONG + memcpy( saved, buf + 512, 512 * sizeof(float)); + } +} + +/** + * Apply dependent channel coupling (applied before IMDCT). + * + * @param index index into coupling gain array + */ +static void apply_dependent_coupling(AACContext *ac, + SingleChannelElement *target, + ChannelElement *cce, int index) +{ + IndividualChannelStream *ics = &cce->ch[0].ics; + const uint16_t *offsets = ics->swb_offset; + float *dest = target->coeffs; + const float *src = cce->ch[0].coeffs; + int g, i, group, k, idx = 0; + if (ac->m4ac.object_type == AOT_AAC_LTP) { + av_log(ac->avctx, AV_LOG_ERROR, + "Dependent coupling is not supported together with LTP\n"); + return; + } + for (g = 0; g < ics->num_window_groups; g++) { + for (i = 0; i < ics->max_sfb; i++, idx++) { + if (cce->ch[0].band_type[idx] != ZERO_BT) { + const float gain = cce->coup.gain[index][idx]; + for (group = 0; group < ics->group_len[g]; group++) { + for (k = offsets[i]; k < offsets[i + 1]; k++) { + // XXX dsputil-ize + dest[group * 128 + k] += gain * src[group * 128 + k]; + } + } + } + } + dest += ics->group_len[g] * 128; + src += ics->group_len[g] * 128; + } +} + +/** + * Apply independent channel coupling (applied after IMDCT). + * + * @param index index into coupling gain array + */ +static void apply_independent_coupling(AACContext *ac, + SingleChannelElement *target, + ChannelElement *cce, int index) +{ + int i; + const float gain = cce->coup.gain[index][0]; + const float *src = cce->ch[0].ret; + float *dest = target->ret; + const int len = 1024 << (ac->m4ac.sbr == 1); + + for (i = 0; i < len; i++) + dest[i] += gain * src[i]; +} + +/** + * channel coupling transformation interface + * + * @param apply_coupling_method pointer to (in)dependent coupling function + */ +static void apply_channel_coupling(AACContext *ac, ChannelElement *cc, + enum RawDataBlockType type, int elem_id, + enum CouplingPoint coupling_point, + void (*apply_coupling_method)(AACContext *ac, SingleChannelElement *target, ChannelElement *cce, int index)) +{ + int i, c; + + for (i = 0; i < MAX_ELEM_ID; i++) { + ChannelElement *cce = ac->che[TYPE_CCE][i]; + int index = 0; + + if (cce && cce->coup.coupling_point == coupling_point) { + ChannelCoupling *coup = &cce->coup; + + for (c = 0; c <= coup->num_coupled; c++) { + if (coup->type[c] == type && coup->id_select[c] == elem_id) { + if (coup->ch_select[c] != 1) { + apply_coupling_method(ac, &cc->ch[0], cce, index); + if (coup->ch_select[c] != 0) + index++; + } + if (coup->ch_select[c] != 2) + apply_coupling_method(ac, &cc->ch[1], cce, index++); + } else + index += 1 + (coup->ch_select[c] == 3); + } + } + } +} + +/** + * Convert spectral data to float samples, applying all supported tools as appropriate. + */ +static void spectral_to_sample(AACContext *ac) +{ + int i, type; + for (type = 3; type >= 0; type--) { + for (i = 0; i < MAX_ELEM_ID; i++) { + ChannelElement *che = ac->che[type][i]; + if (che) { + if (type <= TYPE_CPE) + apply_channel_coupling(ac, che, type, i, BEFORE_TNS, apply_dependent_coupling); + if (che->ch[0].tns.present) + apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1); + if (che->ch[1].tns.present) + apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1); + if (type <= TYPE_CPE) + apply_channel_coupling(ac, che, type, i, BETWEEN_TNS_AND_IMDCT, apply_dependent_coupling); + if (type != TYPE_CCE || che->coup.coupling_point == AFTER_IMDCT) { + imdct_and_windowing(ac, &che->ch[0]); + if (type == TYPE_CPE) { + imdct_and_windowing(ac, &che->ch[1]); + } + if (ac->m4ac.sbr > 0) { + ff_sbr_apply(ac, &che->sbr, type, che->ch[0].ret, che->ch[1].ret); + } + } + if (type <= TYPE_CCE) + apply_channel_coupling(ac, che, type, i, AFTER_IMDCT, apply_independent_coupling); + } + } + } +} + +static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb) +{ + int size; + AACADTSHeaderInfo hdr_info; + + size = ff_aac_parse_header(gb, &hdr_info); + if (size > 0) { + if (ac->output_configured != OC_LOCKED && hdr_info.chan_config) { + enum ChannelPosition new_che_pos[4][MAX_ELEM_ID]; + memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0])); + ac->m4ac.chan_config = hdr_info.chan_config; + if (set_default_channel_config(ac->avctx, new_che_pos, hdr_info.chan_config)) + return -7; + if (output_configure(ac, ac->che_pos, new_che_pos, hdr_info.chan_config, OC_TRIAL_FRAME)) + return -7; + } else if (ac->output_configured != OC_LOCKED) { + ac->output_configured = OC_NONE; + } + if (ac->output_configured != OC_LOCKED) { + ac->m4ac.sbr = -1; + ac->m4ac.ps = -1; + } + ac->m4ac.sample_rate = hdr_info.sample_rate; + ac->m4ac.sampling_index = hdr_info.sampling_index; + ac->m4ac.object_type = hdr_info.object_type; + if (!ac->avctx->sample_rate) + ac->avctx->sample_rate = hdr_info.sample_rate; + if (hdr_info.num_aac_frames == 1) { + if (!hdr_info.crc_absent) + skip_bits(gb, 16); + } else { + av_log_missing_feature(ac->avctx, "More than one AAC RDB per ADTS frame is", 0); + return -1; + } + } + return size; +} + +static int aac_decode_frame_int(AVCodecContext *avctx, void *data, + int *data_size, GetBitContext *gb) +{ + AACContext *ac = avctx->priv_data; + ChannelElement *che = NULL, *che_prev = NULL; + enum RawDataBlockType elem_type, elem_type_prev = TYPE_END; + int err, elem_id, data_size_tmp; + int samples = 0, multiplier; + + if (show_bits(gb, 12) == 0xfff) { + if (parse_adts_frame_header(ac, gb) < 0) { + av_log(avctx, AV_LOG_ERROR, "Error decoding AAC frame header.\n"); + return -1; + } + if (ac->m4ac.sampling_index > 12) { + av_log(ac->avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->m4ac.sampling_index); + return -1; + } + } + + ac->tags_mapped = 0; + // parse + while ((elem_type = get_bits(gb, 3)) != TYPE_END) { + elem_id = get_bits(gb, 4); + + if (elem_type < TYPE_DSE) { + if (!(che=get_che(ac, elem_type, elem_id))) { + av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n", + elem_type, elem_id); + return -1; + } + samples = 1024; + } + + switch (elem_type) { + + case TYPE_SCE: + err = decode_ics(ac, &che->ch[0], gb, 0, 0); + break; + + case TYPE_CPE: + err = decode_cpe(ac, gb, che); + break; + + case TYPE_CCE: + err = decode_cce(ac, gb, che); + break; + + case TYPE_LFE: + err = decode_ics(ac, &che->ch[0], gb, 0, 0); + break; + + case TYPE_DSE: + err = skip_data_stream_element(ac, gb); + break; + + case TYPE_PCE: { + enum ChannelPosition new_che_pos[4][MAX_ELEM_ID]; + memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0])); + if ((err = decode_pce(avctx, &ac->m4ac, new_che_pos, gb))) + break; + if (ac->output_configured > OC_TRIAL_PCE) + av_log(avctx, AV_LOG_ERROR, + "Not evaluating a further program_config_element as this construct is dubious at best.\n"); + else + err = output_configure(ac, ac->che_pos, new_che_pos, 0, OC_TRIAL_PCE); + break; + } + + case TYPE_FIL: + if (elem_id == 15) + elem_id += get_bits(gb, 8) - 1; + if (get_bits_left(gb) < 8 * elem_id) { + av_log(avctx, AV_LOG_ERROR, overread_err); + return -1; + } + while (elem_id > 0) + elem_id -= decode_extension_payload(ac, gb, elem_id, che_prev, elem_type_prev); + err = 0; /* FIXME */ + break; + + default: + err = -1; /* should not happen, but keeps compiler happy */ + break; + } + + che_prev = che; + elem_type_prev = elem_type; + + if (err) + return err; + + if (get_bits_left(gb) < 3) { + av_log(avctx, AV_LOG_ERROR, overread_err); + return -1; + } + } + + spectral_to_sample(ac); + + multiplier = (ac->m4ac.sbr == 1) ? ac->m4ac.ext_sample_rate > ac->m4ac.sample_rate : 0; + samples <<= multiplier; + if (ac->output_configured < OC_LOCKED) { + avctx->sample_rate = ac->m4ac.sample_rate << multiplier; + avctx->frame_size = samples; + } + + data_size_tmp = samples * avctx->channels * sizeof(int16_t); + if (*data_size < data_size_tmp) { + av_log(avctx, AV_LOG_ERROR, + "Output buffer too small (%d) or trying to output too many samples (%d) for this frame.\n", + *data_size, data_size_tmp); + return -1; + } + *data_size = data_size_tmp; + + if (samples) + ac->fmt_conv.float_to_int16_interleave(data, (const float **)ac->output_data, samples, avctx->channels); + + if (ac->output_configured) + ac->output_configured = OC_LOCKED; + + return 0; +} + +static int aac_decode_frame(AVCodecContext *avctx, void *data, + int *data_size, AVPacket *avpkt) +{ + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + GetBitContext gb; + int buf_consumed; + int buf_offset; + int err; + + init_get_bits(&gb, buf, buf_size * 8); + + if ((err = aac_decode_frame_int(avctx, data, data_size, &gb)) < 0) + return err; + + buf_consumed = (get_bits_count(&gb) + 7) >> 3; + for (buf_offset = buf_consumed; buf_offset < buf_size; buf_offset++) + if (buf[buf_offset]) + break; + + return buf_size > buf_offset ? buf_consumed : buf_size; +} + +static av_cold int aac_decode_close(AVCodecContext *avctx) +{ + AACContext *ac = avctx->priv_data; + int i, type; + + for (i = 0; i < MAX_ELEM_ID; i++) { + for (type = 0; type < 4; type++) { + if (ac->che[type][i]) + ff_aac_sbr_ctx_close(&ac->che[type][i]->sbr); + av_freep(&ac->che[type][i]); + } + } + + ff_mdct_end(&ac->mdct); + ff_mdct_end(&ac->mdct_small); + return 0; +} + + +#define LOAS_SYNC_WORD 0x2b7 ///< 11 bits LOAS sync word + +struct LATMContext { + AACContext aac_ctx; ///< containing AACContext + int initialized; ///< initilized after a valid extradata was seen + + // parser data + int audio_mux_version_A; ///< LATM syntax version + int frame_length_type; ///< 0/1 variable/fixed frame length + int frame_length; ///< frame length for fixed frame length +}; + +static inline uint32_t latm_get_value(GetBitContext *b) +{ + int length = get_bits(b, 2); + + return get_bits_long(b, (length+1)*8); +} + +static int latm_decode_audio_specific_config(struct LATMContext *latmctx, + GetBitContext *gb) +{ + AVCodecContext *avctx = latmctx->aac_ctx.avctx; + MPEG4AudioConfig m4ac; + int config_start_bit = get_bits_count(gb); + int bits_consumed, esize; + + if (config_start_bit % 8) { + av_log_missing_feature(latmctx->aac_ctx.avctx, "audio specific " + "config not byte aligned.\n", 1); + return AVERROR_INVALIDDATA; + } else { + bits_consumed = + decode_audio_specific_config(NULL, avctx, &m4ac, + gb->buffer + (config_start_bit / 8), + get_bits_left(gb) / 8); + + if (bits_consumed < 0) + return AVERROR_INVALIDDATA; + + esize = (bits_consumed+7) / 8; + + if (avctx->extradata_size <= esize) { + av_free(avctx->extradata); + avctx->extradata = av_malloc(esize + FF_INPUT_BUFFER_PADDING_SIZE); + if (!avctx->extradata) + return AVERROR(ENOMEM); + } + + avctx->extradata_size = esize; + memcpy(avctx->extradata, gb->buffer + (config_start_bit/8), esize); + memset(avctx->extradata+esize, 0, FF_INPUT_BUFFER_PADDING_SIZE); + + skip_bits_long(gb, bits_consumed); + } + + return bits_consumed; +} + +static int read_stream_mux_config(struct LATMContext *latmctx, + GetBitContext *gb) +{ + int ret, audio_mux_version = get_bits(gb, 1); + + latmctx->audio_mux_version_A = 0; + if (audio_mux_version) + latmctx->audio_mux_version_A = get_bits(gb, 1); + + if (!latmctx->audio_mux_version_A) { + + if (audio_mux_version) + latm_get_value(gb); // taraFullness + + skip_bits(gb, 1); // allStreamSameTimeFraming + skip_bits(gb, 6); // numSubFrames + // numPrograms + if (get_bits(gb, 4)) { // numPrograms + av_log_missing_feature(latmctx->aac_ctx.avctx, + "multiple programs are not supported\n", 1); + return AVERROR_PATCHWELCOME; + } + + // for each program (which there is only on in DVB) + + // for each layer (which there is only on in DVB) + if (get_bits(gb, 3)) { // numLayer + av_log_missing_feature(latmctx->aac_ctx.avctx, + "multiple layers are not supported\n", 1); + return AVERROR_PATCHWELCOME; + } + + // for all but first stream: use_same_config = get_bits(gb, 1); + if (!audio_mux_version) { + if ((ret = latm_decode_audio_specific_config(latmctx, gb)) < 0) + return ret; + } else { + int ascLen = latm_get_value(gb); + if ((ret = latm_decode_audio_specific_config(latmctx, gb)) < 0) + return ret; + ascLen -= ret; + skip_bits_long(gb, ascLen); + } + + latmctx->frame_length_type = get_bits(gb, 3); + switch (latmctx->frame_length_type) { + case 0: + skip_bits(gb, 8); // latmBufferFullness + break; + case 1: + latmctx->frame_length = get_bits(gb, 9); + break; + case 3: + case 4: + case 5: + skip_bits(gb, 6); // CELP frame length table index + break; + case 6: + case 7: + skip_bits(gb, 1); // HVXC frame length table index + break; + } + + if (get_bits(gb, 1)) { // other data + if (audio_mux_version) { + latm_get_value(gb); // other_data_bits + } else { + int esc; + do { + esc = get_bits(gb, 1); + skip_bits(gb, 8); + } while (esc); + } + } + + if (get_bits(gb, 1)) // crc present + skip_bits(gb, 8); // config_crc + } + + return 0; +} + +static int read_payload_length_info(struct LATMContext *ctx, GetBitContext *gb) +{ + uint8_t tmp; + + if (ctx->frame_length_type == 0) { + int mux_slot_length = 0; + do { + tmp = get_bits(gb, 8); + mux_slot_length += tmp; + } while (tmp == 255); + return mux_slot_length; + } else if (ctx->frame_length_type == 1) { + return ctx->frame_length; + } else if (ctx->frame_length_type == 3 || + ctx->frame_length_type == 5 || + ctx->frame_length_type == 7) { + skip_bits(gb, 2); // mux_slot_length_coded + } + return 0; +} + +static int read_audio_mux_element(struct LATMContext *latmctx, + GetBitContext *gb) +{ + int err; + uint8_t use_same_mux = get_bits(gb, 1); + if (!use_same_mux) { + if ((err = read_stream_mux_config(latmctx, gb)) < 0) + return err; + } else if (!latmctx->aac_ctx.avctx->extradata) { + av_log(latmctx->aac_ctx.avctx, AV_LOG_DEBUG, + "no decoder config found\n"); + return AVERROR(EAGAIN); + } + if (latmctx->audio_mux_version_A == 0) { + int mux_slot_length_bytes = read_payload_length_info(latmctx, gb); + if (mux_slot_length_bytes * 8 > get_bits_left(gb)) { + av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR, "incomplete frame\n"); + return AVERROR_INVALIDDATA; + } else if (mux_slot_length_bytes * 8 + 256 < get_bits_left(gb)) { + av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR, + "frame length mismatch %d << %d\n", + mux_slot_length_bytes * 8, get_bits_left(gb)); + return AVERROR_INVALIDDATA; + } + } + return 0; +} + + +static int latm_decode_frame(AVCodecContext *avctx, void *out, int *out_size, + AVPacket *avpkt) +{ + struct LATMContext *latmctx = avctx->priv_data; + int muxlength, err; + GetBitContext gb; + + if (avpkt->size == 0) + return 0; + + init_get_bits(&gb, avpkt->data, avpkt->size * 8); + + // check for LOAS sync word + if (get_bits(&gb, 11) != LOAS_SYNC_WORD) + return AVERROR_INVALIDDATA; + + muxlength = get_bits(&gb, 13) + 3; + // not enough data, the parser should have sorted this + if (muxlength > avpkt->size) + return AVERROR_INVALIDDATA; + + if ((err = read_audio_mux_element(latmctx, &gb)) < 0) + return err; + + if (!latmctx->initialized) { + if (!avctx->extradata) { + *out_size = 0; + return avpkt->size; + } else { + if ((err = aac_decode_init(avctx)) < 0) + return err; + latmctx->initialized = 1; + } + } + + if (show_bits(&gb, 12) == 0xfff) { + av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR, + "ADTS header detected, probably as result of configuration " + "misparsing\n"); + return AVERROR_INVALIDDATA; + } + + if ((err = aac_decode_frame_int(avctx, out, out_size, &gb)) < 0) + return err; + + return muxlength; +} + +av_cold static int latm_decode_init(AVCodecContext *avctx) +{ + struct LATMContext *latmctx = avctx->priv_data; + int ret; + + ret = aac_decode_init(avctx); + + if (avctx->extradata_size > 0) { + latmctx->initialized = !ret; + } else { + latmctx->initialized = 0; + } + + return ret; +} + + +AVCodec ff_aac_decoder = { + "aac", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_AAC, + sizeof(AACContext), + aac_decode_init, + NULL, + aac_decode_close, + aac_decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"), + .sample_fmts = (const enum AVSampleFormat[]) { + AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE + }, + .channel_layouts = aac_channel_layout, +}; + +/* + Note: This decoder filter is intended to decode LATM streams transferred + in MPEG transport streams which only contain one program. + To do a more complex LATM demuxing a separate LATM demuxer should be used. +*/ +AVCodec ff_aac_latm_decoder = { + .name = "aac_latm", + .type = CODEC_TYPE_AUDIO, + .id = CODEC_ID_AAC_LATM, + .priv_data_size = sizeof(struct LATMContext), + .init = latm_decode_init, + .close = aac_decode_close, + .decode = latm_decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Codec LATM syntax)"), + .sample_fmts = (const enum AVSampleFormat[]) { + AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE + }, + .channel_layouts = aac_channel_layout, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacps.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacps.c new file mode 100644 index 00000000..fc124d19 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacps.c @@ -0,0 +1,1037 @@ +/* + * MPEG-4 Parametric Stereo decoding functions + * Copyright (c) 2010 Alex Converse + * + * 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 + */ + +#include +#include "libavutil/common.h" +#include "libavutil/mathematics.h" +#include "avcodec.h" +#include "get_bits.h" +#include "aacps.h" +#include "aacps_tablegen.h" +#include "aacpsdata.c" + +#define PS_BASELINE 0 //< Operate in Baseline PS mode + //< Baseline implies 10 or 20 stereo bands, + //< mixing mode A, and no ipd/opd + +#define numQMFSlots 32 //numTimeSlots * RATE + +static const int8_t num_env_tab[2][4] = { + { 0, 1, 2, 4, }, + { 1, 2, 3, 4, }, +}; + +static const int8_t nr_iidicc_par_tab[] = { + 10, 20, 34, 10, 20, 34, +}; + +static const int8_t nr_iidopd_par_tab[] = { + 5, 11, 17, 5, 11, 17, +}; + +enum { + huff_iid_df1, + huff_iid_dt1, + huff_iid_df0, + huff_iid_dt0, + huff_icc_df, + huff_icc_dt, + huff_ipd_df, + huff_ipd_dt, + huff_opd_df, + huff_opd_dt, +}; + +static const int huff_iid[] = { + huff_iid_df0, + huff_iid_df1, + huff_iid_dt0, + huff_iid_dt1, +}; + +static VLC vlc_ps[10]; + +/** + * Read Inter-channel Intensity Difference/Inter-Channel Coherence/ + * Inter-channel Phase Difference/Overall Phase Difference parameters from the + * bitstream. + * + * @param avctx contains the current codec context + * @param gb pointer to the input bitstream + * @param ps pointer to the Parametric Stereo context + * @param par pointer to the parameter to be read + * @param e envelope to decode + * @param dt 1: time delta-coded, 0: frequency delta-coded + */ +#define READ_PAR_DATA(PAR, OFFSET, MASK, ERR_CONDITION) \ +static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, \ + int8_t (*PAR)[PS_MAX_NR_IIDICC], int table_idx, int e, int dt) \ +{ \ + int b, num = ps->nr_ ## PAR ## _par; \ + VLC_TYPE (*vlc_table)[2] = vlc_ps[table_idx].table; \ + if (dt) { \ + int e_prev = e ? e - 1 : ps->num_env_old - 1; \ + e_prev = FFMAX(e_prev, 0); \ + for (b = 0; b < num; b++) { \ + int val = PAR[e_prev][b] + get_vlc2(gb, vlc_table, 9, 3) - OFFSET; \ + if (MASK) val &= MASK; \ + PAR[e][b] = val; \ + if (ERR_CONDITION) \ + goto err; \ + } \ + } else { \ + int val = 0; \ + for (b = 0; b < num; b++) { \ + val += get_vlc2(gb, vlc_table, 9, 3) - OFFSET; \ + if (MASK) val &= MASK; \ + PAR[e][b] = val; \ + if (ERR_CONDITION) \ + goto err; \ + } \ + } \ + return 0; \ +err: \ + av_log(avctx, AV_LOG_ERROR, "illegal "#PAR"\n"); \ + return -1; \ +} + +READ_PAR_DATA(iid, huff_offset[table_idx], 0, FFABS(ps->iid_par[e][b]) > 7 + 8 * ps->iid_quant) +READ_PAR_DATA(icc, huff_offset[table_idx], 0, ps->icc_par[e][b] > 7U) +READ_PAR_DATA(ipdopd, 0, 0x07, 0) + +static int ps_read_extension_data(GetBitContext *gb, PSContext *ps, int ps_extension_id) +{ + int e; + int count = get_bits_count(gb); + + if (ps_extension_id) + return 0; + + ps->enable_ipdopd = get_bits1(gb); + if (ps->enable_ipdopd) { + for (e = 0; e < ps->num_env; e++) { + int dt = get_bits1(gb); + read_ipdopd_data(NULL, gb, ps, ps->ipd_par, dt ? huff_ipd_dt : huff_ipd_df, e, dt); + dt = get_bits1(gb); + read_ipdopd_data(NULL, gb, ps, ps->opd_par, dt ? huff_opd_dt : huff_opd_df, e, dt); + } + } + skip_bits1(gb); //reserved_ps + return get_bits_count(gb) - count; +} + +static void ipdopd_reset(int8_t *opd_hist, int8_t *ipd_hist) +{ + int i; + for (i = 0; i < PS_MAX_NR_IPDOPD; i++) { + opd_hist[i] = 0; + ipd_hist[i] = 0; + } +} + +int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, PSContext *ps, int bits_left) +{ + int e; + int bit_count_start = get_bits_count(gb_host); + int header; + int bits_consumed; + GetBitContext gbc = *gb_host, *gb = &gbc; + + header = get_bits1(gb); + if (header) { //enable_ps_header + ps->enable_iid = get_bits1(gb); + if (ps->enable_iid) { + int iid_mode = get_bits(gb, 3); + if (iid_mode > 5) { + av_log(avctx, AV_LOG_ERROR, "iid_mode %d is reserved.\n", + iid_mode); + goto err; + } + ps->nr_iid_par = nr_iidicc_par_tab[iid_mode]; + ps->iid_quant = iid_mode > 2; + ps->nr_ipdopd_par = nr_iidopd_par_tab[iid_mode]; + } + ps->enable_icc = get_bits1(gb); + if (ps->enable_icc) { + ps->icc_mode = get_bits(gb, 3); + if (ps->icc_mode > 5) { + av_log(avctx, AV_LOG_ERROR, "icc_mode %d is reserved.\n", + ps->icc_mode); + goto err; + } + ps->nr_icc_par = nr_iidicc_par_tab[ps->icc_mode]; + } + ps->enable_ext = get_bits1(gb); + } + + ps->frame_class = get_bits1(gb); + ps->num_env_old = ps->num_env; + ps->num_env = num_env_tab[ps->frame_class][get_bits(gb, 2)]; + + ps->border_position[0] = -1; + if (ps->frame_class) { + for (e = 1; e <= ps->num_env; e++) + ps->border_position[e] = get_bits(gb, 5); + } else + for (e = 1; e <= ps->num_env; e++) + ps->border_position[e] = (e * numQMFSlots >> ff_log2_tab[ps->num_env]) - 1; + + if (ps->enable_iid) { + for (e = 0; e < ps->num_env; e++) { + int dt = get_bits1(gb); + if (read_iid_data(avctx, gb, ps, ps->iid_par, huff_iid[2*dt+ps->iid_quant], e, dt)) + goto err; + } + } else + memset(ps->iid_par, 0, sizeof(ps->iid_par)); + + if (ps->enable_icc) + for (e = 0; e < ps->num_env; e++) { + int dt = get_bits1(gb); + if (read_icc_data(avctx, gb, ps, ps->icc_par, dt ? huff_icc_dt : huff_icc_df, e, dt)) + goto err; + } + else + memset(ps->icc_par, 0, sizeof(ps->icc_par)); + + if (ps->enable_ext) { + int cnt = get_bits(gb, 4); + if (cnt == 15) { + cnt += get_bits(gb, 8); + } + cnt *= 8; + while (cnt > 7) { + int ps_extension_id = get_bits(gb, 2); + cnt -= 2 + ps_read_extension_data(gb, ps, ps_extension_id); + } + if (cnt < 0) { + av_log(avctx, AV_LOG_ERROR, "ps extension overflow %d", cnt); + goto err; + } + skip_bits(gb, cnt); + } + + ps->enable_ipdopd &= !PS_BASELINE; + + //Fix up envelopes + if (!ps->num_env || ps->border_position[ps->num_env] < numQMFSlots - 1) { + //Create a fake envelope + int source = ps->num_env ? ps->num_env - 1 : ps->num_env_old - 1; + if (source >= 0 && source != ps->num_env) { + if (ps->enable_iid) { + memcpy(ps->iid_par+ps->num_env, ps->iid_par+source, sizeof(ps->iid_par[0])); + } + if (ps->enable_icc) { + memcpy(ps->icc_par+ps->num_env, ps->icc_par+source, sizeof(ps->icc_par[0])); + } + if (ps->enable_ipdopd) { + memcpy(ps->ipd_par+ps->num_env, ps->ipd_par+source, sizeof(ps->ipd_par[0])); + memcpy(ps->opd_par+ps->num_env, ps->opd_par+source, sizeof(ps->opd_par[0])); + } + } + ps->num_env++; + ps->border_position[ps->num_env] = numQMFSlots - 1; + } + + + ps->is34bands_old = ps->is34bands; + if (!PS_BASELINE && (ps->enable_iid || ps->enable_icc)) + ps->is34bands = (ps->enable_iid && ps->nr_iid_par == 34) || + (ps->enable_icc && ps->nr_icc_par == 34); + + //Baseline + if (!ps->enable_ipdopd) { + memset(ps->ipd_par, 0, sizeof(ps->ipd_par)); + memset(ps->opd_par, 0, sizeof(ps->opd_par)); + } + + if (header) + ps->start = 1; + + bits_consumed = get_bits_count(gb) - bit_count_start; + if (bits_consumed <= bits_left) { + skip_bits_long(gb_host, bits_consumed); + return bits_consumed; + } + av_log(avctx, AV_LOG_ERROR, "Expected to read %d PS bits actually read %d.\n", bits_left, bits_consumed); +err: + ps->start = 0; + skip_bits_long(gb_host, bits_left); + return bits_left; +} + +/** Split one subband into 2 subsubbands with a symmetric real filter. + * The filter must have its non-center even coefficients equal to zero. */ +static void hybrid2_re(float (*in)[2], float (*out)[32][2], const float filter[7], int len, int reverse) +{ + int i, j; + for (i = 0; i < len; i++, in++) { + float re_in = filter[6] * in[6][0]; //real inphase + float re_op = 0.0f; //real out of phase + float im_in = filter[6] * in[6][1]; //imag inphase + float im_op = 0.0f; //imag out of phase + for (j = 0; j < 6; j += 2) { + re_op += filter[j+1] * (in[j+1][0] + in[12-j-1][0]); + im_op += filter[j+1] * (in[j+1][1] + in[12-j-1][1]); + } + out[ reverse][i][0] = re_in + re_op; + out[ reverse][i][1] = im_in + im_op; + out[!reverse][i][0] = re_in - re_op; + out[!reverse][i][1] = im_in - im_op; + } +} + +/** Split one subband into 6 subsubbands with a complex filter */ +static void hybrid6_cx(float (*in)[2], float (*out)[32][2], const float (*filter)[7][2], int len) +{ + int i, j, ssb; + int N = 8; + float temp[8][2]; + + for (i = 0; i < len; i++, in++) { + for (ssb = 0; ssb < N; ssb++) { + float sum_re = filter[ssb][6][0] * in[6][0], sum_im = filter[ssb][6][0] * in[6][1]; + for (j = 0; j < 6; j++) { + float in0_re = in[j][0]; + float in0_im = in[j][1]; + float in1_re = in[12-j][0]; + float in1_im = in[12-j][1]; + sum_re += filter[ssb][j][0] * (in0_re + in1_re) - filter[ssb][j][1] * (in0_im - in1_im); + sum_im += filter[ssb][j][0] * (in0_im + in1_im) + filter[ssb][j][1] * (in0_re - in1_re); + } + temp[ssb][0] = sum_re; + temp[ssb][1] = sum_im; + } + out[0][i][0] = temp[6][0]; + out[0][i][1] = temp[6][1]; + out[1][i][0] = temp[7][0]; + out[1][i][1] = temp[7][1]; + out[2][i][0] = temp[0][0]; + out[2][i][1] = temp[0][1]; + out[3][i][0] = temp[1][0]; + out[3][i][1] = temp[1][1]; + out[4][i][0] = temp[2][0] + temp[5][0]; + out[4][i][1] = temp[2][1] + temp[5][1]; + out[5][i][0] = temp[3][0] + temp[4][0]; + out[5][i][1] = temp[3][1] + temp[4][1]; + } +} + +static void hybrid4_8_12_cx(float (*in)[2], float (*out)[32][2], const float (*filter)[7][2], int N, int len) +{ + int i, j, ssb; + + for (i = 0; i < len; i++, in++) { + for (ssb = 0; ssb < N; ssb++) { + float sum_re = filter[ssb][6][0] * in[6][0], sum_im = filter[ssb][6][0] * in[6][1]; + for (j = 0; j < 6; j++) { + float in0_re = in[j][0]; + float in0_im = in[j][1]; + float in1_re = in[12-j][0]; + float in1_im = in[12-j][1]; + sum_re += filter[ssb][j][0] * (in0_re + in1_re) - filter[ssb][j][1] * (in0_im - in1_im); + sum_im += filter[ssb][j][0] * (in0_im + in1_im) + filter[ssb][j][1] * (in0_re - in1_re); + } + out[ssb][i][0] = sum_re; + out[ssb][i][1] = sum_im; + } + } +} + +static void hybrid_analysis(float out[91][32][2], float in[5][44][2], float L[2][38][64], int is34, int len) +{ + int i, j; + for (i = 0; i < 5; i++) { + for (j = 0; j < 38; j++) { + in[i][j+6][0] = L[0][j][i]; + in[i][j+6][1] = L[1][j][i]; + } + } + if (is34) { + hybrid4_8_12_cx(in[0], out, f34_0_12, 12, len); + hybrid4_8_12_cx(in[1], out+12, f34_1_8, 8, len); + hybrid4_8_12_cx(in[2], out+20, f34_2_4, 4, len); + hybrid4_8_12_cx(in[3], out+24, f34_2_4, 4, len); + hybrid4_8_12_cx(in[4], out+28, f34_2_4, 4, len); + for (i = 0; i < 59; i++) { + for (j = 0; j < len; j++) { + out[i+32][j][0] = L[0][j][i+5]; + out[i+32][j][1] = L[1][j][i+5]; + } + } + } else { + hybrid6_cx(in[0], out, f20_0_8, len); + hybrid2_re(in[1], out+6, g1_Q2, len, 1); + hybrid2_re(in[2], out+8, g1_Q2, len, 0); + for (i = 0; i < 61; i++) { + for (j = 0; j < len; j++) { + out[i+10][j][0] = L[0][j][i+3]; + out[i+10][j][1] = L[1][j][i+3]; + } + } + } + //update in_buf + for (i = 0; i < 5; i++) { + memcpy(in[i], in[i]+32, 6 * sizeof(in[i][0])); + } +} + +static void hybrid_synthesis(float out[2][38][64], float in[91][32][2], int is34, int len) +{ + int i, n; + if (is34) { + for (n = 0; n < len; n++) { + memset(out[0][n], 0, 5*sizeof(out[0][n][0])); + memset(out[1][n], 0, 5*sizeof(out[1][n][0])); + for (i = 0; i < 12; i++) { + out[0][n][0] += in[ i][n][0]; + out[1][n][0] += in[ i][n][1]; + } + for (i = 0; i < 8; i++) { + out[0][n][1] += in[12+i][n][0]; + out[1][n][1] += in[12+i][n][1]; + } + for (i = 0; i < 4; i++) { + out[0][n][2] += in[20+i][n][0]; + out[1][n][2] += in[20+i][n][1]; + out[0][n][3] += in[24+i][n][0]; + out[1][n][3] += in[24+i][n][1]; + out[0][n][4] += in[28+i][n][0]; + out[1][n][4] += in[28+i][n][1]; + } + } + for (i = 0; i < 59; i++) { + for (n = 0; n < len; n++) { + out[0][n][i+5] = in[i+32][n][0]; + out[1][n][i+5] = in[i+32][n][1]; + } + } + } else { + for (n = 0; n < len; n++) { + out[0][n][0] = in[0][n][0] + in[1][n][0] + in[2][n][0] + + in[3][n][0] + in[4][n][0] + in[5][n][0]; + out[1][n][0] = in[0][n][1] + in[1][n][1] + in[2][n][1] + + in[3][n][1] + in[4][n][1] + in[5][n][1]; + out[0][n][1] = in[6][n][0] + in[7][n][0]; + out[1][n][1] = in[6][n][1] + in[7][n][1]; + out[0][n][2] = in[8][n][0] + in[9][n][0]; + out[1][n][2] = in[8][n][1] + in[9][n][1]; + } + for (i = 0; i < 61; i++) { + for (n = 0; n < len; n++) { + out[0][n][i+3] = in[i+10][n][0]; + out[1][n][i+3] = in[i+10][n][1]; + } + } + } +} + +/// All-pass filter decay slope +#define DECAY_SLOPE 0.05f +/// Number of frequency bands that can be addressed by the parameter index, b(k) +static const int NR_PAR_BANDS[] = { 20, 34 }; +/// Number of frequency bands that can be addressed by the sub subband index, k +static const int NR_BANDS[] = { 71, 91 }; +/// Start frequency band for the all-pass filter decay slope +static const int DECAY_CUTOFF[] = { 10, 32 }; +/// Number of all-pass filer bands +static const int NR_ALLPASS_BANDS[] = { 30, 50 }; +/// First stereo band using the short one sample delay +static const int SHORT_DELAY_BAND[] = { 42, 62 }; + +/** Table 8.46 */ +static void map_idx_10_to_20(int8_t *par_mapped, const int8_t *par, int full) +{ + int b; + if (full) + b = 9; + else { + b = 4; + par_mapped[10] = 0; + } + for (; b >= 0; b--) { + par_mapped[2*b+1] = par_mapped[2*b] = par[b]; + } +} + +static void map_idx_34_to_20(int8_t *par_mapped, const int8_t *par, int full) +{ + par_mapped[ 0] = (2*par[ 0] + par[ 1]) / 3; + par_mapped[ 1] = ( par[ 1] + 2*par[ 2]) / 3; + par_mapped[ 2] = (2*par[ 3] + par[ 4]) / 3; + par_mapped[ 3] = ( par[ 4] + 2*par[ 5]) / 3; + par_mapped[ 4] = ( par[ 6] + par[ 7]) / 2; + par_mapped[ 5] = ( par[ 8] + par[ 9]) / 2; + par_mapped[ 6] = par[10]; + par_mapped[ 7] = par[11]; + par_mapped[ 8] = ( par[12] + par[13]) / 2; + par_mapped[ 9] = ( par[14] + par[15]) / 2; + par_mapped[10] = par[16]; + if (full) { + par_mapped[11] = par[17]; + par_mapped[12] = par[18]; + par_mapped[13] = par[19]; + par_mapped[14] = ( par[20] + par[21]) / 2; + par_mapped[15] = ( par[22] + par[23]) / 2; + par_mapped[16] = ( par[24] + par[25]) / 2; + par_mapped[17] = ( par[26] + par[27]) / 2; + par_mapped[18] = ( par[28] + par[29] + par[30] + par[31]) / 4; + par_mapped[19] = ( par[32] + par[33]) / 2; + } +} + +static void map_val_34_to_20(float par[PS_MAX_NR_IIDICC]) +{ + par[ 0] = (2*par[ 0] + par[ 1]) * 0.33333333f; + par[ 1] = ( par[ 1] + 2*par[ 2]) * 0.33333333f; + par[ 2] = (2*par[ 3] + par[ 4]) * 0.33333333f; + par[ 3] = ( par[ 4] + 2*par[ 5]) * 0.33333333f; + par[ 4] = ( par[ 6] + par[ 7]) * 0.5f; + par[ 5] = ( par[ 8] + par[ 9]) * 0.5f; + par[ 6] = par[10]; + par[ 7] = par[11]; + par[ 8] = ( par[12] + par[13]) * 0.5f; + par[ 9] = ( par[14] + par[15]) * 0.5f; + par[10] = par[16]; + par[11] = par[17]; + par[12] = par[18]; + par[13] = par[19]; + par[14] = ( par[20] + par[21]) * 0.5f; + par[15] = ( par[22] + par[23]) * 0.5f; + par[16] = ( par[24] + par[25]) * 0.5f; + par[17] = ( par[26] + par[27]) * 0.5f; + par[18] = ( par[28] + par[29] + par[30] + par[31]) * 0.25f; + par[19] = ( par[32] + par[33]) * 0.5f; +} + +static void map_idx_10_to_34(int8_t *par_mapped, const int8_t *par, int full) +{ + if (full) { + par_mapped[33] = par[9]; + par_mapped[32] = par[9]; + par_mapped[31] = par[9]; + par_mapped[30] = par[9]; + par_mapped[29] = par[9]; + par_mapped[28] = par[9]; + par_mapped[27] = par[8]; + par_mapped[26] = par[8]; + par_mapped[25] = par[8]; + par_mapped[24] = par[8]; + par_mapped[23] = par[7]; + par_mapped[22] = par[7]; + par_mapped[21] = par[7]; + par_mapped[20] = par[7]; + par_mapped[19] = par[6]; + par_mapped[18] = par[6]; + par_mapped[17] = par[5]; + par_mapped[16] = par[5]; + } else { + par_mapped[16] = 0; + } + par_mapped[15] = par[4]; + par_mapped[14] = par[4]; + par_mapped[13] = par[4]; + par_mapped[12] = par[4]; + par_mapped[11] = par[3]; + par_mapped[10] = par[3]; + par_mapped[ 9] = par[2]; + par_mapped[ 8] = par[2]; + par_mapped[ 7] = par[2]; + par_mapped[ 6] = par[2]; + par_mapped[ 5] = par[1]; + par_mapped[ 4] = par[1]; + par_mapped[ 3] = par[1]; + par_mapped[ 2] = par[0]; + par_mapped[ 1] = par[0]; + par_mapped[ 0] = par[0]; +} + +static void map_idx_20_to_34(int8_t *par_mapped, const int8_t *par, int full) +{ + if (full) { + par_mapped[33] = par[19]; + par_mapped[32] = par[19]; + par_mapped[31] = par[18]; + par_mapped[30] = par[18]; + par_mapped[29] = par[18]; + par_mapped[28] = par[18]; + par_mapped[27] = par[17]; + par_mapped[26] = par[17]; + par_mapped[25] = par[16]; + par_mapped[24] = par[16]; + par_mapped[23] = par[15]; + par_mapped[22] = par[15]; + par_mapped[21] = par[14]; + par_mapped[20] = par[14]; + par_mapped[19] = par[13]; + par_mapped[18] = par[12]; + par_mapped[17] = par[11]; + } + par_mapped[16] = par[10]; + par_mapped[15] = par[ 9]; + par_mapped[14] = par[ 9]; + par_mapped[13] = par[ 8]; + par_mapped[12] = par[ 8]; + par_mapped[11] = par[ 7]; + par_mapped[10] = par[ 6]; + par_mapped[ 9] = par[ 5]; + par_mapped[ 8] = par[ 5]; + par_mapped[ 7] = par[ 4]; + par_mapped[ 6] = par[ 4]; + par_mapped[ 5] = par[ 3]; + par_mapped[ 4] = (par[ 2] + par[ 3]) / 2; + par_mapped[ 3] = par[ 2]; + par_mapped[ 2] = par[ 1]; + par_mapped[ 1] = (par[ 0] + par[ 1]) / 2; + par_mapped[ 0] = par[ 0]; +} + +static void map_val_20_to_34(float par[PS_MAX_NR_IIDICC]) +{ + par[33] = par[19]; + par[32] = par[19]; + par[31] = par[18]; + par[30] = par[18]; + par[29] = par[18]; + par[28] = par[18]; + par[27] = par[17]; + par[26] = par[17]; + par[25] = par[16]; + par[24] = par[16]; + par[23] = par[15]; + par[22] = par[15]; + par[21] = par[14]; + par[20] = par[14]; + par[19] = par[13]; + par[18] = par[12]; + par[17] = par[11]; + par[16] = par[10]; + par[15] = par[ 9]; + par[14] = par[ 9]; + par[13] = par[ 8]; + par[12] = par[ 8]; + par[11] = par[ 7]; + par[10] = par[ 6]; + par[ 9] = par[ 5]; + par[ 8] = par[ 5]; + par[ 7] = par[ 4]; + par[ 6] = par[ 4]; + par[ 5] = par[ 3]; + par[ 4] = (par[ 2] + par[ 3]) * 0.5f; + par[ 3] = par[ 2]; + par[ 2] = par[ 1]; + par[ 1] = (par[ 0] + par[ 1]) * 0.5f; + par[ 0] = par[ 0]; +} + +static void decorrelation(PSContext *ps, float (*out)[32][2], const float (*s)[32][2], int is34) +{ + float power[34][PS_QMF_TIME_SLOTS] = {{0}}; + float transient_gain[34][PS_QMF_TIME_SLOTS]; + float *peak_decay_nrg = ps->peak_decay_nrg; + float *power_smooth = ps->power_smooth; + float *peak_decay_diff_smooth = ps->peak_decay_diff_smooth; + float (*delay)[PS_QMF_TIME_SLOTS + PS_MAX_DELAY][2] = ps->delay; + float (*ap_delay)[PS_AP_LINKS][PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2] = ps->ap_delay; + const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20; + const float peak_decay_factor = 0.76592833836465f; + const float transient_impact = 1.5f; + const float a_smooth = 0.25f; //< Smoothing coefficient + int i, k, m, n; + int n0 = 0, nL = 32; + static const int link_delay[] = { 3, 4, 5 }; + static const float a[] = { 0.65143905753106f, + 0.56471812200776f, + 0.48954165955695f }; + + if (is34 != ps->is34bands_old) { + memset(ps->peak_decay_nrg, 0, sizeof(ps->peak_decay_nrg)); + memset(ps->power_smooth, 0, sizeof(ps->power_smooth)); + memset(ps->peak_decay_diff_smooth, 0, sizeof(ps->peak_decay_diff_smooth)); + memset(ps->delay, 0, sizeof(ps->delay)); + memset(ps->ap_delay, 0, sizeof(ps->ap_delay)); + } + + for (n = n0; n < nL; n++) { + for (k = 0; k < NR_BANDS[is34]; k++) { + int i = k_to_i[k]; + power[i][n] += s[k][n][0] * s[k][n][0] + s[k][n][1] * s[k][n][1]; + } + } + + //Transient detection + for (i = 0; i < NR_PAR_BANDS[is34]; i++) { + for (n = n0; n < nL; n++) { + float decayed_peak = peak_decay_factor * peak_decay_nrg[i]; + float denom; + peak_decay_nrg[i] = FFMAX(decayed_peak, power[i][n]); + power_smooth[i] += a_smooth * (power[i][n] - power_smooth[i]); + peak_decay_diff_smooth[i] += a_smooth * (peak_decay_nrg[i] - power[i][n] - peak_decay_diff_smooth[i]); + denom = transient_impact * peak_decay_diff_smooth[i]; + transient_gain[i][n] = (denom > power_smooth[i]) ? + power_smooth[i] / denom : 1.0f; + } + } + + //Decorrelation and transient reduction + // PS_AP_LINKS - 1 + // ----- + // | | Q_fract_allpass[k][m]*z^-link_delay[m] - a[m]*g_decay_slope[k] + //H[k][z] = z^-2 * phi_fract[k] * | | ---------------------------------------------------------------- + // | | 1 - a[m]*g_decay_slope[k]*Q_fract_allpass[k][m]*z^-link_delay[m] + // m = 0 + //d[k][z] (out) = transient_gain_mapped[k][z] * H[k][z] * s[k][z] + for (k = 0; k < NR_ALLPASS_BANDS[is34]; k++) { + int b = k_to_i[k]; + float g_decay_slope = 1.f - DECAY_SLOPE * (k - DECAY_CUTOFF[is34]); + float ag[PS_AP_LINKS]; + g_decay_slope = av_clipf(g_decay_slope, 0.f, 1.f); + memcpy(delay[k], delay[k]+nL, PS_MAX_DELAY*sizeof(delay[k][0])); + memcpy(delay[k]+PS_MAX_DELAY, s[k], numQMFSlots*sizeof(delay[k][0])); + for (m = 0; m < PS_AP_LINKS; m++) { + memcpy(ap_delay[k][m], ap_delay[k][m]+numQMFSlots, 5*sizeof(ap_delay[k][m][0])); + ag[m] = a[m] * g_decay_slope; + } + for (n = n0; n < nL; n++) { + float in_re = delay[k][n+PS_MAX_DELAY-2][0] * phi_fract[is34][k][0] - + delay[k][n+PS_MAX_DELAY-2][1] * phi_fract[is34][k][1]; + float in_im = delay[k][n+PS_MAX_DELAY-2][0] * phi_fract[is34][k][1] + + delay[k][n+PS_MAX_DELAY-2][1] * phi_fract[is34][k][0]; + for (m = 0; m < PS_AP_LINKS; m++) { + float a_re = ag[m] * in_re; + float a_im = ag[m] * in_im; + float link_delay_re = ap_delay[k][m][n+5-link_delay[m]][0]; + float link_delay_im = ap_delay[k][m][n+5-link_delay[m]][1]; + float fractional_delay_re = Q_fract_allpass[is34][k][m][0]; + float fractional_delay_im = Q_fract_allpass[is34][k][m][1]; + ap_delay[k][m][n+5][0] = in_re; + ap_delay[k][m][n+5][1] = in_im; + in_re = link_delay_re * fractional_delay_re - link_delay_im * fractional_delay_im - a_re; + in_im = link_delay_re * fractional_delay_im + link_delay_im * fractional_delay_re - a_im; + ap_delay[k][m][n+5][0] += ag[m] * in_re; + ap_delay[k][m][n+5][1] += ag[m] * in_im; + } + out[k][n][0] = transient_gain[b][n] * in_re; + out[k][n][1] = transient_gain[b][n] * in_im; + } + } + for (; k < SHORT_DELAY_BAND[is34]; k++) { + memcpy(delay[k], delay[k]+nL, PS_MAX_DELAY*sizeof(delay[k][0])); + memcpy(delay[k]+PS_MAX_DELAY, s[k], numQMFSlots*sizeof(delay[k][0])); + for (n = n0; n < nL; n++) { + //H = delay 14 + out[k][n][0] = transient_gain[k_to_i[k]][n] * delay[k][n+PS_MAX_DELAY-14][0]; + out[k][n][1] = transient_gain[k_to_i[k]][n] * delay[k][n+PS_MAX_DELAY-14][1]; + } + } + for (; k < NR_BANDS[is34]; k++) { + memcpy(delay[k], delay[k]+nL, PS_MAX_DELAY*sizeof(delay[k][0])); + memcpy(delay[k]+PS_MAX_DELAY, s[k], numQMFSlots*sizeof(delay[k][0])); + for (n = n0; n < nL; n++) { + //H = delay 1 + out[k][n][0] = transient_gain[k_to_i[k]][n] * delay[k][n+PS_MAX_DELAY-1][0]; + out[k][n][1] = transient_gain[k_to_i[k]][n] * delay[k][n+PS_MAX_DELAY-1][1]; + } + } +} + +static void remap34(int8_t (**p_par_mapped)[PS_MAX_NR_IIDICC], + int8_t (*par)[PS_MAX_NR_IIDICC], + int num_par, int num_env, int full) +{ + int8_t (*par_mapped)[PS_MAX_NR_IIDICC] = *p_par_mapped; + int e; + if (num_par == 20 || num_par == 11) { + for (e = 0; e < num_env; e++) { + map_idx_20_to_34(par_mapped[e], par[e], full); + } + } else if (num_par == 10 || num_par == 5) { + for (e = 0; e < num_env; e++) { + map_idx_10_to_34(par_mapped[e], par[e], full); + } + } else { + *p_par_mapped = par; + } +} + +static void remap20(int8_t (**p_par_mapped)[PS_MAX_NR_IIDICC], + int8_t (*par)[PS_MAX_NR_IIDICC], + int num_par, int num_env, int full) +{ + int8_t (*par_mapped)[PS_MAX_NR_IIDICC] = *p_par_mapped; + int e; + if (num_par == 34 || num_par == 17) { + for (e = 0; e < num_env; e++) { + map_idx_34_to_20(par_mapped[e], par[e], full); + } + } else if (num_par == 10 || num_par == 5) { + for (e = 0; e < num_env; e++) { + map_idx_10_to_20(par_mapped[e], par[e], full); + } + } else { + *p_par_mapped = par; + } +} + +static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2], int is34) +{ + int e, b, k, n; + + float (*H11)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H11; + float (*H12)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H12; + float (*H21)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H21; + float (*H22)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H22; + int8_t *opd_hist = ps->opd_hist; + int8_t *ipd_hist = ps->ipd_hist; + int8_t iid_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; + int8_t icc_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; + int8_t ipd_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; + int8_t opd_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; + int8_t (*iid_mapped)[PS_MAX_NR_IIDICC] = iid_mapped_buf; + int8_t (*icc_mapped)[PS_MAX_NR_IIDICC] = icc_mapped_buf; + int8_t (*ipd_mapped)[PS_MAX_NR_IIDICC] = ipd_mapped_buf; + int8_t (*opd_mapped)[PS_MAX_NR_IIDICC] = opd_mapped_buf; + const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20; + const float (*H_LUT)[8][4] = (PS_BASELINE || ps->icc_mode < 3) ? HA : HB; + + //Remapping + memcpy(H11[0][0], H11[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[0][0][0])); + memcpy(H11[1][0], H11[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[1][0][0])); + memcpy(H12[0][0], H12[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[0][0][0])); + memcpy(H12[1][0], H12[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[1][0][0])); + memcpy(H21[0][0], H21[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[0][0][0])); + memcpy(H21[1][0], H21[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[1][0][0])); + memcpy(H22[0][0], H22[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[0][0][0])); + memcpy(H22[1][0], H22[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[1][0][0])); + if (is34) { + remap34(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1); + remap34(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1); + if (ps->enable_ipdopd) { + remap34(&ipd_mapped, ps->ipd_par, ps->nr_ipdopd_par, ps->num_env, 0); + remap34(&opd_mapped, ps->opd_par, ps->nr_ipdopd_par, ps->num_env, 0); + } + if (!ps->is34bands_old) { + map_val_20_to_34(H11[0][0]); + map_val_20_to_34(H11[1][0]); + map_val_20_to_34(H12[0][0]); + map_val_20_to_34(H12[1][0]); + map_val_20_to_34(H21[0][0]); + map_val_20_to_34(H21[1][0]); + map_val_20_to_34(H22[0][0]); + map_val_20_to_34(H22[1][0]); + ipdopd_reset(ipd_hist, opd_hist); + } + } else { + remap20(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1); + remap20(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1); + if (ps->enable_ipdopd) { + remap20(&ipd_mapped, ps->ipd_par, ps->nr_ipdopd_par, ps->num_env, 0); + remap20(&opd_mapped, ps->opd_par, ps->nr_ipdopd_par, ps->num_env, 0); + } + if (ps->is34bands_old) { + map_val_34_to_20(H11[0][0]); + map_val_34_to_20(H11[1][0]); + map_val_34_to_20(H12[0][0]); + map_val_34_to_20(H12[1][0]); + map_val_34_to_20(H21[0][0]); + map_val_34_to_20(H21[1][0]); + map_val_34_to_20(H22[0][0]); + map_val_34_to_20(H22[1][0]); + ipdopd_reset(ipd_hist, opd_hist); + } + } + + //Mixing + for (e = 0; e < ps->num_env; e++) { + for (b = 0; b < NR_PAR_BANDS[is34]; b++) { + float h11, h12, h21, h22; + h11 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][0]; + h12 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][1]; + h21 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][2]; + h22 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][3]; + if (!PS_BASELINE && ps->enable_ipdopd && b < ps->nr_ipdopd_par) { + //The spec say says to only run this smoother when enable_ipdopd + //is set but the reference decoder appears to run it constantly + float h11i, h12i, h21i, h22i; + float ipd_adj_re, ipd_adj_im; + int opd_idx = opd_hist[b] * 8 + opd_mapped[e][b]; + int ipd_idx = ipd_hist[b] * 8 + ipd_mapped[e][b]; + float opd_re = pd_re_smooth[opd_idx]; + float opd_im = pd_im_smooth[opd_idx]; + float ipd_re = pd_re_smooth[ipd_idx]; + float ipd_im = pd_im_smooth[ipd_idx]; + opd_hist[b] = opd_idx & 0x3F; + ipd_hist[b] = ipd_idx & 0x3F; + + ipd_adj_re = opd_re*ipd_re + opd_im*ipd_im; + ipd_adj_im = opd_im*ipd_re - opd_re*ipd_im; + h11i = h11 * opd_im; + h11 = h11 * opd_re; + h12i = h12 * ipd_adj_im; + h12 = h12 * ipd_adj_re; + h21i = h21 * opd_im; + h21 = h21 * opd_re; + h22i = h22 * ipd_adj_im; + h22 = h22 * ipd_adj_re; + H11[1][e+1][b] = h11i; + H12[1][e+1][b] = h12i; + H21[1][e+1][b] = h21i; + H22[1][e+1][b] = h22i; + } + H11[0][e+1][b] = h11; + H12[0][e+1][b] = h12; + H21[0][e+1][b] = h21; + H22[0][e+1][b] = h22; + } + for (k = 0; k < NR_BANDS[is34]; k++) { + float h11r, h12r, h21r, h22r; + float h11i, h12i, h21i, h22i; + float h11r_step, h12r_step, h21r_step, h22r_step; + float h11i_step, h12i_step, h21i_step, h22i_step; + int start = ps->border_position[e]; + int stop = ps->border_position[e+1]; + float width = 1.f / (stop - start); + b = k_to_i[k]; + h11r = H11[0][e][b]; + h12r = H12[0][e][b]; + h21r = H21[0][e][b]; + h22r = H22[0][e][b]; + if (!PS_BASELINE && ps->enable_ipdopd) { + //Is this necessary? ps_04_new seems unchanged + if ((is34 && k <= 13 && k >= 9) || (!is34 && k <= 1)) { + h11i = -H11[1][e][b]; + h12i = -H12[1][e][b]; + h21i = -H21[1][e][b]; + h22i = -H22[1][e][b]; + } else { + h11i = H11[1][e][b]; + h12i = H12[1][e][b]; + h21i = H21[1][e][b]; + h22i = H22[1][e][b]; + } + } + //Interpolation + h11r_step = (H11[0][e+1][b] - h11r) * width; + h12r_step = (H12[0][e+1][b] - h12r) * width; + h21r_step = (H21[0][e+1][b] - h21r) * width; + h22r_step = (H22[0][e+1][b] - h22r) * width; + if (!PS_BASELINE && ps->enable_ipdopd) { + h11i_step = (H11[1][e+1][b] - h11i) * width; + h12i_step = (H12[1][e+1][b] - h12i) * width; + h21i_step = (H21[1][e+1][b] - h21i) * width; + h22i_step = (H22[1][e+1][b] - h22i) * width; + } + for (n = start + 1; n <= stop; n++) { + //l is s, r is d + float l_re = l[k][n][0]; + float l_im = l[k][n][1]; + float r_re = r[k][n][0]; + float r_im = r[k][n][1]; + h11r += h11r_step; + h12r += h12r_step; + h21r += h21r_step; + h22r += h22r_step; + if (!PS_BASELINE && ps->enable_ipdopd) { + h11i += h11i_step; + h12i += h12i_step; + h21i += h21i_step; + h22i += h22i_step; + + l[k][n][0] = h11r*l_re + h21r*r_re - h11i*l_im - h21i*r_im; + l[k][n][1] = h11r*l_im + h21r*r_im + h11i*l_re + h21i*r_re; + r[k][n][0] = h12r*l_re + h22r*r_re - h12i*l_im - h22i*r_im; + r[k][n][1] = h12r*l_im + h22r*r_im + h12i*l_re + h22i*r_re; + } else { + l[k][n][0] = h11r*l_re + h21r*r_re; + l[k][n][1] = h11r*l_im + h21r*r_im; + r[k][n][0] = h12r*l_re + h22r*r_re; + r[k][n][1] = h12r*l_im + h22r*r_im; + } + } + } + } +} + +int ff_ps_apply(AVCodecContext *avctx, PSContext *ps, float L[2][38][64], float R[2][38][64], int top) +{ + float Lbuf[91][32][2]; + float Rbuf[91][32][2]; + const int len = 32; + int is34 = ps->is34bands; + + top += NR_BANDS[is34] - 64; + memset(ps->delay+top, 0, (NR_BANDS[is34] - top)*sizeof(ps->delay[0])); + if (top < NR_ALLPASS_BANDS[is34]) + memset(ps->ap_delay + top, 0, (NR_ALLPASS_BANDS[is34] - top)*sizeof(ps->ap_delay[0])); + + hybrid_analysis(Lbuf, ps->in_buf, L, is34, len); + decorrelation(ps, Rbuf, Lbuf, is34); + stereo_processing(ps, Lbuf, Rbuf, is34); + hybrid_synthesis(L, Lbuf, is34, len); + hybrid_synthesis(R, Rbuf, is34, len); + + return 0; +} + +#define PS_INIT_VLC_STATIC(num, size) \ + INIT_VLC_STATIC(&vlc_ps[num], 9, ps_tmp[num].table_size / ps_tmp[num].elem_size, \ + ps_tmp[num].ps_bits, 1, 1, \ + ps_tmp[num].ps_codes, ps_tmp[num].elem_size, ps_tmp[num].elem_size, \ + size); + +#define PS_VLC_ROW(name) \ + { name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) } + +av_cold void ff_ps_init(void) { + // Syntax initialization + static const struct { + const void *ps_codes, *ps_bits; + const unsigned int table_size, elem_size; + } ps_tmp[] = { + PS_VLC_ROW(huff_iid_df1), + PS_VLC_ROW(huff_iid_dt1), + PS_VLC_ROW(huff_iid_df0), + PS_VLC_ROW(huff_iid_dt0), + PS_VLC_ROW(huff_icc_df), + PS_VLC_ROW(huff_icc_dt), + PS_VLC_ROW(huff_ipd_df), + PS_VLC_ROW(huff_ipd_dt), + PS_VLC_ROW(huff_opd_df), + PS_VLC_ROW(huff_opd_dt), + }; + + PS_INIT_VLC_STATIC(0, 1544); + PS_INIT_VLC_STATIC(1, 832); + PS_INIT_VLC_STATIC(2, 1024); + PS_INIT_VLC_STATIC(3, 1036); + PS_INIT_VLC_STATIC(4, 544); + PS_INIT_VLC_STATIC(5, 544); + PS_INIT_VLC_STATIC(6, 512); + PS_INIT_VLC_STATIC(7, 512); + PS_INIT_VLC_STATIC(8, 512); + PS_INIT_VLC_STATIC(9, 512); + + ps_tableinit(); +} + +av_cold void ff_ps_ctx_init(PSContext *ps) +{ +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacps.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacps.h new file mode 100644 index 00000000..5fc211a9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacps.h @@ -0,0 +1,82 @@ +/* + * MPEG-4 Parametric Stereo definitions and declarations + * Copyright (c) 2010 Alex Converse + * + * 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 + */ + +#ifndef AVCODEC_PS_H +#define AVCODEC_PS_H + +#include + +#include "avcodec.h" +#include "get_bits.h" + +#define PS_MAX_NUM_ENV 5 +#define PS_MAX_NR_IIDICC 34 +#define PS_MAX_NR_IPDOPD 17 +#define PS_MAX_SSB 91 +#define PS_MAX_AP_BANDS 50 +#define PS_QMF_TIME_SLOTS 32 +#define PS_MAX_DELAY 14 +#define PS_AP_LINKS 3 +#define PS_MAX_AP_DELAY 5 + +typedef struct { + int start; + int enable_iid; + int iid_quant; + int nr_iid_par; + int nr_ipdopd_par; + int enable_icc; + int icc_mode; + int nr_icc_par; + int enable_ext; + int frame_class; + int num_env_old; + int num_env; + int enable_ipdopd; + int border_position[PS_MAX_NUM_ENV+1]; + int8_t iid_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; // + * + * 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 + */ + +#include +#define CONFIG_HARDCODED_TABLES 0 +#include "aacps_tablegen.h" +#include "tableprint.h" + +void write_float_3d_array (const void *p, int b, int c, int d) +{ + int i; + const float *f = p; + for (i = 0; i < b; i++) { + printf("{\n"); + write_float_2d_array(f, c, d); + printf("},\n"); + f += c * d; + } +} + +void write_float_4d_array (const void *p, int a, int b, int c, int d) +{ + int i; + const float *f = p; + for (i = 0; i < a; i++) { + printf("{\n"); + write_float_3d_array(f, b, c, d); + printf("},\n"); + f += b * c * d; + } +} + +int main(void) +{ + ps_tableinit(); + + write_fileheader(); + + printf("static const float pd_re_smooth[8*8*8] = {\n"); + write_float_array(pd_re_smooth, 8*8*8); + printf("};\n"); + printf("static const float pd_im_smooth[8*8*8] = {\n"); + write_float_array(pd_im_smooth, 8*8*8); + printf("};\n"); + + printf("static const float HA[46][8][4] = {\n"); + write_float_3d_array(HA, 46, 8, 4); + printf("};\n"); + printf("static const float HB[46][8][4] = {\n"); + write_float_3d_array(HB, 46, 8, 4); + printf("};\n"); + + printf("static const float f20_0_8[8][7][2] = {\n"); + write_float_3d_array(f20_0_8, 8, 7, 2); + printf("};\n"); + printf("static const float f34_0_12[12][7][2] = {\n"); + write_float_3d_array(f34_0_12, 12, 7, 2); + printf("};\n"); + printf("static const float f34_1_8[8][7][2] = {\n"); + write_float_3d_array(f34_1_8, 8, 7, 2); + printf("};\n"); + printf("static const float f34_2_4[4][7][2] = {\n"); + write_float_3d_array(f34_2_4, 4, 7, 2); + printf("};\n"); + + printf("static const float Q_fract_allpass[2][50][3][2] = {\n"); + write_float_4d_array(Q_fract_allpass, 2, 50, 3, 2); + printf("};\n"); + printf("static const float phi_fract[2][50][2] = {\n"); + write_float_3d_array(phi_fract, 2, 50, 2); + printf("};\n"); + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacps_tablegen.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacps_tablegen.h new file mode 100644 index 00000000..c7e062bd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacps_tablegen.h @@ -0,0 +1,212 @@ +/* + * Header file for hardcoded Parametric Stereo tables + * + * Copyright (c) 2010 Alex Converse + * + * 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 + */ + +#ifndef AACPS_TABLEGEN_H +#define AACPS_TABLEGEN_H + +#include + +#if CONFIG_HARDCODED_TABLES +#define ps_tableinit() +#include "libavcodec/aacps_tables.h" +#else +#include "libavutil/common.h" +#include "libavutil/mathematics.h" +#define NR_ALLPASS_BANDS20 30 +#define NR_ALLPASS_BANDS34 50 +#define PS_AP_LINKS 3 +static float pd_re_smooth[8*8*8]; +static float pd_im_smooth[8*8*8]; +static float HA[46][8][4]; +static float HB[46][8][4]; +static float f20_0_8 [ 8][7][2]; +static float f34_0_12[12][7][2]; +static float f34_1_8 [ 8][7][2]; +static float f34_2_4 [ 4][7][2]; +static float Q_fract_allpass[2][50][3][2]; +static float phi_fract[2][50][2]; + +static const float g0_Q8[] = { + 0.00746082949812f, 0.02270420949825f, 0.04546865930473f, 0.07266113929591f, + 0.09885108575264f, 0.11793710567217f, 0.125f +}; + +static const float g0_Q12[] = { + 0.04081179924692f, 0.03812810994926f, 0.05144908135699f, 0.06399831151592f, + 0.07428313801106f, 0.08100347892914f, 0.08333333333333f +}; + +static const float g1_Q8[] = { + 0.01565675600122f, 0.03752716391991f, 0.05417891378782f, 0.08417044116767f, + 0.10307344158036f, 0.12222452249753f, 0.125f +}; + +static const float g2_Q4[] = { + -0.05908211155639f, -0.04871498374946f, 0.0f, 0.07778723915851f, + 0.16486303567403f, 0.23279856662996f, 0.25f +}; + +static void make_filters_from_proto(float (*filter)[7][2], const float *proto, int bands) +{ + int q, n; + for (q = 0; q < bands; q++) { + for (n = 0; n < 7; n++) { + double theta = 2 * M_PI * (q + 0.5) * (n - 6) / bands; + filter[q][n][0] = proto[n] * cos(theta); + filter[q][n][1] = proto[n] * -sin(theta); + } + } +} + +static void ps_tableinit(void) +{ + static const float ipdopd_sin[] = { 0, M_SQRT1_2, 1, M_SQRT1_2, 0, -M_SQRT1_2, -1, -M_SQRT1_2 }; + static const float ipdopd_cos[] = { 1, M_SQRT1_2, 0, -M_SQRT1_2, -1, -M_SQRT1_2, 0, M_SQRT1_2 }; + int pd0, pd1, pd2; + + static const float iid_par_dequant[] = { + //iid_par_dequant_default + 0.05623413251903, 0.12589254117942, 0.19952623149689, 0.31622776601684, + 0.44668359215096, 0.63095734448019, 0.79432823472428, 1, + 1.25892541179417, 1.58489319246111, 2.23872113856834, 3.16227766016838, + 5.01187233627272, 7.94328234724282, 17.7827941003892, + //iid_par_dequant_fine + 0.00316227766017, 0.00562341325190, 0.01, 0.01778279410039, + 0.03162277660168, 0.05623413251903, 0.07943282347243, 0.11220184543020, + 0.15848931924611, 0.22387211385683, 0.31622776601684, 0.39810717055350, + 0.50118723362727, 0.63095734448019, 0.79432823472428, 1, + 1.25892541179417, 1.58489319246111, 1.99526231496888, 2.51188643150958, + 3.16227766016838, 4.46683592150963, 6.30957344480193, 8.91250938133745, + 12.5892541179417, 17.7827941003892, 31.6227766016838, 56.2341325190349, + 100, 177.827941003892, 316.227766016837, + }; + static const float icc_invq[] = { + 1, 0.937, 0.84118, 0.60092, 0.36764, 0, -0.589, -1 + }; + static const float acos_icc_invq[] = { + 0, 0.35685527, 0.57133466, 0.92614472, 1.1943263, M_PI/2, 2.2006171, M_PI + }; + int iid, icc; + + int k, m; + static const int8_t f_center_20[] = { + -3, -1, 1, 3, 5, 7, 10, 14, 18, 22, + }; + static const int8_t f_center_34[] = { + 2, 6, 10, 14, 18, 22, 26, 30, + 34,-10, -6, -2, 51, 57, 15, 21, + 27, 33, 39, 45, 54, 66, 78, 42, + 102, 66, 78, 90,102,114,126, 90, + }; + static const float fractional_delay_links[] = { 0.43f, 0.75f, 0.347f }; + const float fractional_delay_gain = 0.39f; + + for (pd0 = 0; pd0 < 8; pd0++) { + float pd0_re = ipdopd_cos[pd0]; + float pd0_im = ipdopd_sin[pd0]; + for (pd1 = 0; pd1 < 8; pd1++) { + float pd1_re = ipdopd_cos[pd1]; + float pd1_im = ipdopd_sin[pd1]; + for (pd2 = 0; pd2 < 8; pd2++) { + float pd2_re = ipdopd_cos[pd2]; + float pd2_im = ipdopd_sin[pd2]; + float re_smooth = 0.25f * pd0_re + 0.5f * pd1_re + pd2_re; + float im_smooth = 0.25f * pd0_im + 0.5f * pd1_im + pd2_im; + float pd_mag = 1 / sqrt(im_smooth * im_smooth + re_smooth * re_smooth); + pd_re_smooth[pd0*64+pd1*8+pd2] = re_smooth * pd_mag; + pd_im_smooth[pd0*64+pd1*8+pd2] = im_smooth * pd_mag; + } + } + } + + for (iid = 0; iid < 46; iid++) { + float c = iid_par_dequant[iid]; //icc_mode < 3)*/ { + float alpha = 0.5f * acos_icc_invq[icc]; + float beta = alpha * (c1 - c2) * (float)M_SQRT1_2; + HA[iid][icc][0] = c2 * cosf(beta + alpha); + HA[iid][icc][1] = c1 * cosf(beta - alpha); + HA[iid][icc][2] = c2 * sinf(beta + alpha); + HA[iid][icc][3] = c1 * sinf(beta - alpha); + } /* else */ { + float alpha, gamma, mu, rho; + float alpha_c, alpha_s, gamma_c, gamma_s; + rho = FFMAX(icc_invq[icc], 0.05f); + alpha = 0.5f * atan2f(2.0f * c * rho, c*c - 1.0f); + mu = c + 1.0f / c; + mu = sqrtf(1 + (4 * rho * rho - 4)/(mu * mu)); + gamma = atanf(sqrtf((1.0f - mu)/(1.0f + mu))); + if (alpha < 0) alpha += M_PI/2; + alpha_c = cosf(alpha); + alpha_s = sinf(alpha); + gamma_c = cosf(gamma); + gamma_s = sinf(gamma); + HB[iid][icc][0] = M_SQRT2 * alpha_c * gamma_c; + HB[iid][icc][1] = M_SQRT2 * alpha_s * gamma_c; + HB[iid][icc][2] = -M_SQRT2 * alpha_s * gamma_s; + HB[iid][icc][3] = M_SQRT2 * alpha_c * gamma_s; + } + } + } + + for (k = 0; k < NR_ALLPASS_BANDS20; k++) { + double f_center, theta; + if (k < FF_ARRAY_ELEMS(f_center_20)) + f_center = f_center_20[k] * 0.125; + else + f_center = k - 6.5f; + for (m = 0; m < PS_AP_LINKS; m++) { + theta = -M_PI * fractional_delay_links[m] * f_center; + Q_fract_allpass[0][k][m][0] = cos(theta); + Q_fract_allpass[0][k][m][1] = sin(theta); + } + theta = -M_PI*fractional_delay_gain*f_center; + phi_fract[0][k][0] = cos(theta); + phi_fract[0][k][1] = sin(theta); + } + for (k = 0; k < NR_ALLPASS_BANDS34; k++) { + double f_center, theta; + if (k < FF_ARRAY_ELEMS(f_center_34)) + f_center = f_center_34[k] / 24.; + else + f_center = k - 26.5f; + for (m = 0; m < PS_AP_LINKS; m++) { + theta = -M_PI * fractional_delay_links[m] * f_center; + Q_fract_allpass[1][k][m][0] = cos(theta); + Q_fract_allpass[1][k][m][1] = sin(theta); + } + theta = -M_PI*fractional_delay_gain*f_center; + phi_fract[1][k][0] = cos(theta); + phi_fract[1][k][1] = sin(theta); + } + + make_filters_from_proto(f20_0_8, g0_Q8, 8); + make_filters_from_proto(f34_0_12, g0_Q12, 12); + make_filters_from_proto(f34_1_8, g1_Q8, 8); + make_filters_from_proto(f34_2_4, g2_Q4, 4); +} +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* AACPS_TABLEGEN_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacpsdata.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacpsdata.c new file mode 100644 index 00000000..7431caeb --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacpsdata.c @@ -0,0 +1,163 @@ +/* + * MPEG-4 Parametric Stereo data tables + * Copyright (c) 2010 Alex Converse + * + * 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 + */ + +static const uint8_t huff_iid_df1_bits[] = { + 18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 18, 17, 17, 16, 16, 15, 14, 14, + 13, 12, 12, 11, 10, 10, 8, 7, 6, 5, 4, 3, 1, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 11, 12, 13, 14, 14, 15, 16, 16, 17, 17, 18, 17, 18, 18, + 18, 18, 18, 18, 18, 18, 18, +}; + +static const uint32_t huff_iid_df1_codes[] = { + 0x01FEB4, 0x01FEB5, 0x01FD76, 0x01FD77, 0x01FD74, 0x01FD75, 0x01FE8A, + 0x01FE8B, 0x01FE88, 0x00FE80, 0x01FEB6, 0x00FE82, 0x00FEB8, 0x007F42, + 0x007FAE, 0x003FAF, 0x001FD1, 0x001FE9, 0x000FE9, 0x0007EA, 0x0007FB, + 0x0003FB, 0x0001FB, 0x0001FF, 0x00007C, 0x00003C, 0x00001C, 0x00000C, + 0x000000, 0x000001, 0x000001, 0x000002, 0x000001, 0x00000D, 0x00001D, + 0x00003D, 0x00007D, 0x0000FC, 0x0001FC, 0x0003FC, 0x0003F4, 0x0007EB, + 0x000FEA, 0x001FEA, 0x001FD6, 0x003FD0, 0x007FAF, 0x007F43, 0x00FEB9, + 0x00FE83, 0x01FEB7, 0x00FE81, 0x01FE89, 0x01FE8E, 0x01FE8F, 0x01FE8C, + 0x01FE8D, 0x01FEB2, 0x01FEB3, 0x01FEB0, 0x01FEB1, +}; + +static const uint8_t huff_iid_dt1_bits[] = { + 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 13, + 13, 13, 12, 12, 11, 10, 9, 9, 7, 6, 5, 3, 1, 2, 5, 6, 7, 8, + 9, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, +}; + +static const uint16_t huff_iid_dt1_codes[] = { + 0x004ED4, 0x004ED5, 0x004ECE, 0x004ECF, 0x004ECC, 0x004ED6, 0x004ED8, + 0x004F46, 0x004F60, 0x002718, 0x002719, 0x002764, 0x002765, 0x00276D, + 0x0027B1, 0x0013B7, 0x0013D6, 0x0009C7, 0x0009E9, 0x0009ED, 0x0004EE, + 0x0004F7, 0x000278, 0x000139, 0x00009A, 0x00009F, 0x000020, 0x000011, + 0x00000A, 0x000003, 0x000001, 0x000000, 0x00000B, 0x000012, 0x000021, + 0x00004C, 0x00009B, 0x00013A, 0x000279, 0x000270, 0x0004EF, 0x0004E2, + 0x0009EA, 0x0009D8, 0x0013D7, 0x0013D0, 0x0027B2, 0x0027A2, 0x00271A, + 0x00271B, 0x004F66, 0x004F67, 0x004F61, 0x004F47, 0x004ED9, 0x004ED7, + 0x004ECD, 0x004ED2, 0x004ED3, 0x004ED0, 0x004ED1, +}; + +static const uint8_t huff_iid_df0_bits[] = { + 17, 17, 17, 17, 16, 15, 13, 10, 9, 7, 6, 5, 4, 3, 1, 3, 4, 5, + 6, 6, 8, 11, 13, 14, 14, 15, 17, 18, 18, +}; + +static const uint32_t huff_iid_df0_codes[] = { + 0x01FFFB, 0x01FFFC, 0x01FFFD, 0x01FFFA, 0x00FFFC, 0x007FFC, 0x001FFD, + 0x0003FE, 0x0001FE, 0x00007E, 0x00003C, 0x00001D, 0x00000D, 0x000005, + 0x000000, 0x000004, 0x00000C, 0x00001C, 0x00003D, 0x00003E, 0x0000FE, + 0x0007FE, 0x001FFC, 0x003FFC, 0x003FFD, 0x007FFD, 0x01FFFE, 0x03FFFE, + 0x03FFFF, +}; + +static const uint8_t huff_iid_dt0_bits[] = { + 19, 19, 19, 20, 20, 20, 17, 15, 12, 10, 8, 6, 4, 2, 1, 3, 5, 7, + 9, 11, 13, 14, 17, 19, 20, 20, 20, 20, 20, +}; + +static const uint32_t huff_iid_dt0_codes[] = { + 0x07FFF9, 0x07FFFA, 0x07FFFB, 0x0FFFF8, 0x0FFFF9, 0x0FFFFA, 0x01FFFD, + 0x007FFE, 0x000FFE, 0x0003FE, 0x0000FE, 0x00003E, 0x00000E, 0x000002, + 0x000000, 0x000006, 0x00001E, 0x00007E, 0x0001FE, 0x0007FE, 0x001FFE, + 0x003FFE, 0x01FFFC, 0x07FFF8, 0x0FFFFB, 0x0FFFFC, 0x0FFFFD, 0x0FFFFE, + 0x0FFFFF, +}; + +static const uint8_t huff_icc_df_bits[] = { + 14, 14, 12, 10, 7, 5, 3, 1, 2, 4, 6, 8, 9, 11, 13, +}; + +static const uint16_t huff_icc_df_codes[] = { + 0x3FFF, 0x3FFE, 0x0FFE, 0x03FE, 0x007E, 0x001E, 0x0006, 0x0000, + 0x0002, 0x000E, 0x003E, 0x00FE, 0x01FE, 0x07FE, 0x1FFE, +}; + +static const uint8_t huff_icc_dt_bits[] = { + 14, 13, 11, 9, 7, 5, 3, 1, 2, 4, 6, 8, 10, 12, 14, +}; + +static const uint16_t huff_icc_dt_codes[] = { + 0x3FFE, 0x1FFE, 0x07FE, 0x01FE, 0x007E, 0x001E, 0x0006, 0x0000, + 0x0002, 0x000E, 0x003E, 0x00FE, 0x03FE, 0x0FFE, 0x3FFF, +}; + +static const uint8_t huff_ipd_df_bits[] = { + 1, 3, 4, 4, 4, 4, 4, 4, +}; + +static const uint8_t huff_ipd_df_codes[] = { + 0x01, 0x00, 0x06, 0x04, 0x02, 0x03, 0x05, 0x07, +}; + +static const uint8_t huff_ipd_dt_bits[] = { + 1, 3, 4, 5, 5, 4, 4, 3, +}; + +static const uint8_t huff_ipd_dt_codes[] = { + 0x01, 0x02, 0x02, 0x03, 0x02, 0x00, 0x03, 0x03, +}; + +static const uint8_t huff_opd_df_bits[] = { + 1, 3, 4, 4, 5, 5, 4, 3, +}; + +static const uint8_t huff_opd_df_codes[] = { + 0x01, 0x01, 0x06, 0x04, 0x0F, 0x0E, 0x05, 0x00, +}; + +static const uint8_t huff_opd_dt_bits[] = { + 1, 3, 4, 5, 5, 4, 4, 3, +}; + +static const uint8_t huff_opd_dt_codes[] = { + 0x01, 0x02, 0x01, 0x07, 0x06, 0x00, 0x02, 0x03, +}; + +static const int8_t huff_offset[] = { + 30, 30, + 14, 14, + 7, 7, + 0, 0, + 0, 0, +}; + +///Table 8.48 +static const int8_t k_to_i_20[] = { + 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15, + 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19 +}; +///Table 8.49 +static const int8_t k_to_i_34[] = { + 0, 1, 2, 3, 4, 5, 6, 6, 7, 2, 1, 0, 10, 10, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 9, 14, 11, 12, 13, 14, 15, 16, 13, 16, 17, 18, 19, 20, 21, + 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, + 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33 +}; + +static const float g1_Q2[] = { + 0.0f, 0.01899487526049f, 0.0f, -0.07293139167538f, + 0.0f, 0.30596630545168f, 0.5f +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacsbr.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacsbr.c new file mode 100644 index 00000000..9b10bf25 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacsbr.c @@ -0,0 +1,1764 @@ +/* + * AAC Spectral Band Replication decoding functions + * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl ) + * Copyright (c) 2009-2010 Alex Converse + * + * 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 + * AAC Spectral Band Replication decoding functions + * @author Robert Swain ( rob opendot cl ) + */ + +#include "aac.h" +#include "sbr.h" +#include "aacsbr.h" +#include "aacsbrdata.h" +#include "fft.h" +#include "aacps.h" + +#include +#include + +#define ENVELOPE_ADJUSTMENT_OFFSET 2 +#define NOISE_FLOOR_OFFSET 6.0f + +/** + * SBR VLC tables + */ +enum { + T_HUFFMAN_ENV_1_5DB, + F_HUFFMAN_ENV_1_5DB, + T_HUFFMAN_ENV_BAL_1_5DB, + F_HUFFMAN_ENV_BAL_1_5DB, + T_HUFFMAN_ENV_3_0DB, + F_HUFFMAN_ENV_3_0DB, + T_HUFFMAN_ENV_BAL_3_0DB, + F_HUFFMAN_ENV_BAL_3_0DB, + T_HUFFMAN_NOISE_3_0DB, + T_HUFFMAN_NOISE_BAL_3_0DB, +}; + +/** + * bs_frame_class - frame class of current SBR frame (14496-3 sp04 p98) + */ +enum { + FIXFIX, + FIXVAR, + VARFIX, + VARVAR, +}; + +enum { + EXTENSION_ID_PS = 2, +}; + +static VLC vlc_sbr[10]; +static const int8_t vlc_sbr_lav[10] = + { 60, 60, 24, 24, 31, 31, 12, 12, 31, 12 }; +static const DECLARE_ALIGNED(16, float, zero64)[64]; + +#define SBR_INIT_VLC_STATIC(num, size) \ + INIT_VLC_STATIC(&vlc_sbr[num], 9, sbr_tmp[num].table_size / sbr_tmp[num].elem_size, \ + sbr_tmp[num].sbr_bits , 1, 1, \ + sbr_tmp[num].sbr_codes, sbr_tmp[num].elem_size, sbr_tmp[num].elem_size, \ + size) + +#define SBR_VLC_ROW(name) \ + { name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) } + +av_cold void ff_aac_sbr_init(void) +{ + int n; + static const struct { + const void *sbr_codes, *sbr_bits; + const unsigned int table_size, elem_size; + } sbr_tmp[] = { + SBR_VLC_ROW(t_huffman_env_1_5dB), + SBR_VLC_ROW(f_huffman_env_1_5dB), + SBR_VLC_ROW(t_huffman_env_bal_1_5dB), + SBR_VLC_ROW(f_huffman_env_bal_1_5dB), + SBR_VLC_ROW(t_huffman_env_3_0dB), + SBR_VLC_ROW(f_huffman_env_3_0dB), + SBR_VLC_ROW(t_huffman_env_bal_3_0dB), + SBR_VLC_ROW(f_huffman_env_bal_3_0dB), + SBR_VLC_ROW(t_huffman_noise_3_0dB), + SBR_VLC_ROW(t_huffman_noise_bal_3_0dB), + }; + + // SBR VLC table initialization + SBR_INIT_VLC_STATIC(0, 1098); + SBR_INIT_VLC_STATIC(1, 1092); + SBR_INIT_VLC_STATIC(2, 768); + SBR_INIT_VLC_STATIC(3, 1026); + SBR_INIT_VLC_STATIC(4, 1058); + SBR_INIT_VLC_STATIC(5, 1052); + SBR_INIT_VLC_STATIC(6, 544); + SBR_INIT_VLC_STATIC(7, 544); + SBR_INIT_VLC_STATIC(8, 592); + SBR_INIT_VLC_STATIC(9, 512); + + for (n = 1; n < 320; n++) + sbr_qmf_window_us[320 + n] = sbr_qmf_window_us[320 - n]; + sbr_qmf_window_us[384] = -sbr_qmf_window_us[384]; + sbr_qmf_window_us[512] = -sbr_qmf_window_us[512]; + + for (n = 0; n < 320; n++) + sbr_qmf_window_ds[n] = sbr_qmf_window_us[2*n]; + + ff_ps_init(); +} + +av_cold void ff_aac_sbr_ctx_init(SpectralBandReplication *sbr) +{ + sbr->kx[0] = sbr->kx[1] = 32; //Typo in spec, kx' inits to 32 + sbr->data[0].e_a[1] = sbr->data[1].e_a[1] = -1; + sbr->data[0].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128); + sbr->data[1].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128); + ff_mdct_init(&sbr->mdct, 7, 1, 1.0/64); + ff_mdct_init(&sbr->mdct_ana, 7, 1, -2.0); + ff_ps_ctx_init(&sbr->ps); +} + +av_cold void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr) +{ + ff_mdct_end(&sbr->mdct); + ff_mdct_end(&sbr->mdct_ana); +} + +static int qsort_comparison_function_int16(const void *a, const void *b) +{ + return *(const int16_t *)a - *(const int16_t *)b; +} + +static inline int in_table_int16(const int16_t *table, int last_el, int16_t needle) +{ + int i; + for (i = 0; i <= last_el; i++) + if (table[i] == needle) + return 1; + return 0; +} + +/// Limiter Frequency Band Table (14496-3 sp04 p198) +static void sbr_make_f_tablelim(SpectralBandReplication *sbr) +{ + int k; + if (sbr->bs_limiter_bands > 0) { + static const float bands_warped[3] = { 1.32715174233856803909f, //2^(0.49/1.2) + 1.18509277094158210129f, //2^(0.49/2) + 1.11987160404675912501f }; //2^(0.49/3) + const float lim_bands_per_octave_warped = bands_warped[sbr->bs_limiter_bands - 1]; + int16_t patch_borders[7]; + uint16_t *in = sbr->f_tablelim + 1, *out = sbr->f_tablelim; + + patch_borders[0] = sbr->kx[1]; + for (k = 1; k <= sbr->num_patches; k++) + patch_borders[k] = patch_borders[k-1] + sbr->patch_num_subbands[k-1]; + + memcpy(sbr->f_tablelim, sbr->f_tablelow, + (sbr->n[0] + 1) * sizeof(sbr->f_tablelow[0])); + if (sbr->num_patches > 1) + memcpy(sbr->f_tablelim + sbr->n[0] + 1, patch_borders + 1, + (sbr->num_patches - 1) * sizeof(patch_borders[0])); + + qsort(sbr->f_tablelim, sbr->num_patches + sbr->n[0], + sizeof(sbr->f_tablelim[0]), + qsort_comparison_function_int16); + + sbr->n_lim = sbr->n[0] + sbr->num_patches - 1; + while (out < sbr->f_tablelim + sbr->n_lim) { + if (*in >= *out * lim_bands_per_octave_warped) { + *++out = *in++; + } else if (*in == *out || + !in_table_int16(patch_borders, sbr->num_patches, *in)) { + in++; + sbr->n_lim--; + } else if (!in_table_int16(patch_borders, sbr->num_patches, *out)) { + *out = *in++; + sbr->n_lim--; + } else { + *++out = *in++; + } + } + } else { + sbr->f_tablelim[0] = sbr->f_tablelow[0]; + sbr->f_tablelim[1] = sbr->f_tablelow[sbr->n[0]]; + sbr->n_lim = 1; + } +} + +static unsigned int read_sbr_header(SpectralBandReplication *sbr, GetBitContext *gb) +{ + unsigned int cnt = get_bits_count(gb); + uint8_t bs_header_extra_1; + uint8_t bs_header_extra_2; + int old_bs_limiter_bands = sbr->bs_limiter_bands; + SpectrumParameters old_spectrum_params; + + sbr->start = 1; + + // Save last spectrum parameters variables to compare to new ones + memcpy(&old_spectrum_params, &sbr->spectrum_params, sizeof(SpectrumParameters)); + + sbr->bs_amp_res_header = get_bits1(gb); + sbr->spectrum_params.bs_start_freq = get_bits(gb, 4); + sbr->spectrum_params.bs_stop_freq = get_bits(gb, 4); + sbr->spectrum_params.bs_xover_band = get_bits(gb, 3); + skip_bits(gb, 2); // bs_reserved + + bs_header_extra_1 = get_bits1(gb); + bs_header_extra_2 = get_bits1(gb); + + if (bs_header_extra_1) { + sbr->spectrum_params.bs_freq_scale = get_bits(gb, 2); + sbr->spectrum_params.bs_alter_scale = get_bits1(gb); + sbr->spectrum_params.bs_noise_bands = get_bits(gb, 2); + } else { + sbr->spectrum_params.bs_freq_scale = 2; + sbr->spectrum_params.bs_alter_scale = 1; + sbr->spectrum_params.bs_noise_bands = 2; + } + + // Check if spectrum parameters changed + if (memcmp(&old_spectrum_params, &sbr->spectrum_params, sizeof(SpectrumParameters))) + sbr->reset = 1; + + if (bs_header_extra_2) { + sbr->bs_limiter_bands = get_bits(gb, 2); + sbr->bs_limiter_gains = get_bits(gb, 2); + sbr->bs_interpol_freq = get_bits1(gb); + sbr->bs_smoothing_mode = get_bits1(gb); + } else { + sbr->bs_limiter_bands = 2; + sbr->bs_limiter_gains = 2; + sbr->bs_interpol_freq = 1; + sbr->bs_smoothing_mode = 1; + } + + if (sbr->bs_limiter_bands != old_bs_limiter_bands && !sbr->reset) + sbr_make_f_tablelim(sbr); + + return get_bits_count(gb) - cnt; +} + +static int array_min_int16(const int16_t *array, int nel) +{ + int i, min = array[0]; + for (i = 1; i < nel; i++) + min = FFMIN(array[i], min); + return min; +} + +static void make_bands(int16_t* bands, int start, int stop, int num_bands) +{ + int k, previous, present; + float base, prod; + + base = powf((float)stop / start, 1.0f / num_bands); + prod = start; + previous = start; + + for (k = 0; k < num_bands-1; k++) { + prod *= base; + present = lrintf(prod); + bands[k] = present - previous; + previous = present; + } + bands[num_bands-1] = stop - previous; +} + +static int check_n_master(AVCodecContext *avctx, int n_master, int bs_xover_band) +{ + // Requirements (14496-3 sp04 p205) + if (n_master <= 0) { + av_log(avctx, AV_LOG_ERROR, "Invalid n_master: %d\n", n_master); + return -1; + } + if (bs_xover_band >= n_master) { + av_log(avctx, AV_LOG_ERROR, + "Invalid bitstream, crossover band index beyond array bounds: %d\n", + bs_xover_band); + return -1; + } + return 0; +} + +/// Master Frequency Band Table (14496-3 sp04 p194) +static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr, + SpectrumParameters *spectrum) +{ + unsigned int temp, max_qmf_subbands; + unsigned int start_min, stop_min; + int k; + const int8_t *sbr_offset_ptr; + int16_t stop_dk[13]; + + if (sbr->sample_rate < 32000) { + temp = 3000; + } else if (sbr->sample_rate < 64000) { + temp = 4000; + } else + temp = 5000; + + start_min = ((temp << 7) + (sbr->sample_rate >> 1)) / sbr->sample_rate; + stop_min = ((temp << 8) + (sbr->sample_rate >> 1)) / sbr->sample_rate; + + switch (sbr->sample_rate) { + case 16000: + sbr_offset_ptr = sbr_offset[0]; + break; + case 22050: + sbr_offset_ptr = sbr_offset[1]; + break; + case 24000: + sbr_offset_ptr = sbr_offset[2]; + break; + case 32000: + sbr_offset_ptr = sbr_offset[3]; + break; + case 44100: case 48000: case 64000: + sbr_offset_ptr = sbr_offset[4]; + break; + case 88200: case 96000: case 128000: case 176400: case 192000: + sbr_offset_ptr = sbr_offset[5]; + break; + default: + av_log(ac->avctx, AV_LOG_ERROR, + "Unsupported sample rate for SBR: %d\n", sbr->sample_rate); + return -1; + } + + sbr->k[0] = start_min + sbr_offset_ptr[spectrum->bs_start_freq]; + + if (spectrum->bs_stop_freq < 14) { + sbr->k[2] = stop_min; + make_bands(stop_dk, stop_min, 64, 13); + qsort(stop_dk, 13, sizeof(stop_dk[0]), qsort_comparison_function_int16); + for (k = 0; k < spectrum->bs_stop_freq; k++) + sbr->k[2] += stop_dk[k]; + } else if (spectrum->bs_stop_freq == 14) { + sbr->k[2] = 2*sbr->k[0]; + } else if (spectrum->bs_stop_freq == 15) { + sbr->k[2] = 3*sbr->k[0]; + } else { + av_log(ac->avctx, AV_LOG_ERROR, + "Invalid bs_stop_freq: %d\n", spectrum->bs_stop_freq); + return -1; + } + sbr->k[2] = FFMIN(64, sbr->k[2]); + + // Requirements (14496-3 sp04 p205) + if (sbr->sample_rate <= 32000) { + max_qmf_subbands = 48; + } else if (sbr->sample_rate == 44100) { + max_qmf_subbands = 35; + } else if (sbr->sample_rate >= 48000) + max_qmf_subbands = 32; + + if (sbr->k[2] - sbr->k[0] > max_qmf_subbands) { + av_log(ac->avctx, AV_LOG_ERROR, + "Invalid bitstream, too many QMF subbands: %d\n", sbr->k[2] - sbr->k[0]); + return -1; + } + + if (!spectrum->bs_freq_scale) { + int dk, k2diff; + + dk = spectrum->bs_alter_scale + 1; + sbr->n_master = ((sbr->k[2] - sbr->k[0] + (dk&2)) >> dk) << 1; + if (check_n_master(ac->avctx, sbr->n_master, sbr->spectrum_params.bs_xover_band)) + return -1; + + for (k = 1; k <= sbr->n_master; k++) + sbr->f_master[k] = dk; + + k2diff = sbr->k[2] - sbr->k[0] - sbr->n_master * dk; + if (k2diff < 0) { + sbr->f_master[1]--; + sbr->f_master[2]-= (k2diff < -1); + } else if (k2diff) { + sbr->f_master[sbr->n_master]++; + } + + sbr->f_master[0] = sbr->k[0]; + for (k = 1; k <= sbr->n_master; k++) + sbr->f_master[k] += sbr->f_master[k - 1]; + + } else { + int half_bands = 7 - spectrum->bs_freq_scale; // bs_freq_scale = {1,2,3} + int two_regions, num_bands_0; + int vdk0_max, vdk1_min; + int16_t vk0[49]; + + if (49 * sbr->k[2] > 110 * sbr->k[0]) { + two_regions = 1; + sbr->k[1] = 2 * sbr->k[0]; + } else { + two_regions = 0; + sbr->k[1] = sbr->k[2]; + } + + num_bands_0 = lrintf(half_bands * log2f(sbr->k[1] / (float)sbr->k[0])) * 2; + + if (num_bands_0 <= 0) { // Requirements (14496-3 sp04 p205) + av_log(ac->avctx, AV_LOG_ERROR, "Invalid num_bands_0: %d\n", num_bands_0); + return -1; + } + + vk0[0] = 0; + + make_bands(vk0+1, sbr->k[0], sbr->k[1], num_bands_0); + + qsort(vk0 + 1, num_bands_0, sizeof(vk0[1]), qsort_comparison_function_int16); + vdk0_max = vk0[num_bands_0]; + + vk0[0] = sbr->k[0]; + for (k = 1; k <= num_bands_0; k++) { + if (vk0[k] <= 0) { // Requirements (14496-3 sp04 p205) + av_log(ac->avctx, AV_LOG_ERROR, "Invalid vDk0[%d]: %d\n", k, vk0[k]); + return -1; + } + vk0[k] += vk0[k-1]; + } + + if (two_regions) { + int16_t vk1[49]; + float invwarp = spectrum->bs_alter_scale ? 0.76923076923076923077f + : 1.0f; // bs_alter_scale = {0,1} + int num_bands_1 = lrintf(half_bands * invwarp * + log2f(sbr->k[2] / (float)sbr->k[1])) * 2; + + make_bands(vk1+1, sbr->k[1], sbr->k[2], num_bands_1); + + vdk1_min = array_min_int16(vk1 + 1, num_bands_1); + + if (vdk1_min < vdk0_max) { + int change; + qsort(vk1 + 1, num_bands_1, sizeof(vk1[1]), qsort_comparison_function_int16); + change = FFMIN(vdk0_max - vk1[1], (vk1[num_bands_1] - vk1[1]) >> 1); + vk1[1] += change; + vk1[num_bands_1] -= change; + } + + qsort(vk1 + 1, num_bands_1, sizeof(vk1[1]), qsort_comparison_function_int16); + + vk1[0] = sbr->k[1]; + for (k = 1; k <= num_bands_1; k++) { + if (vk1[k] <= 0) { // Requirements (14496-3 sp04 p205) + av_log(ac->avctx, AV_LOG_ERROR, "Invalid vDk1[%d]: %d\n", k, vk1[k]); + return -1; + } + vk1[k] += vk1[k-1]; + } + + sbr->n_master = num_bands_0 + num_bands_1; + if (check_n_master(ac->avctx, sbr->n_master, sbr->spectrum_params.bs_xover_band)) + return -1; + memcpy(&sbr->f_master[0], vk0, + (num_bands_0 + 1) * sizeof(sbr->f_master[0])); + memcpy(&sbr->f_master[num_bands_0 + 1], vk1 + 1, + num_bands_1 * sizeof(sbr->f_master[0])); + + } else { + sbr->n_master = num_bands_0; + if (check_n_master(ac->avctx, sbr->n_master, sbr->spectrum_params.bs_xover_band)) + return -1; + memcpy(sbr->f_master, vk0, (num_bands_0 + 1) * sizeof(sbr->f_master[0])); + } + } + + return 0; +} + +/// High Frequency Generation - Patch Construction (14496-3 sp04 p216 fig. 4.46) +static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr) +{ + int i, k, sb = 0; + int msb = sbr->k[0]; + int usb = sbr->kx[1]; + int goal_sb = ((1000 << 11) + (sbr->sample_rate >> 1)) / sbr->sample_rate; + + sbr->num_patches = 0; + + if (goal_sb < sbr->kx[1] + sbr->m[1]) { + for (k = 0; sbr->f_master[k] < goal_sb; k++) ; + } else + k = sbr->n_master; + + do { + int odd = 0; + for (i = k; i == k || sb > (sbr->k[0] - 1 + msb - odd); i--) { + sb = sbr->f_master[i]; + odd = (sb + sbr->k[0]) & 1; + } + + // Requirements (14496-3 sp04 p205) sets the maximum number of patches to 5. + // After this check the final number of patches can still be six which is + // illegal however the Coding Technologies decoder check stream has a final + // count of 6 patches + if (sbr->num_patches > 5) { + av_log(ac->avctx, AV_LOG_ERROR, "Too many patches: %d\n", sbr->num_patches); + return -1; + } + + sbr->patch_num_subbands[sbr->num_patches] = FFMAX(sb - usb, 0); + sbr->patch_start_subband[sbr->num_patches] = sbr->k[0] - odd - sbr->patch_num_subbands[sbr->num_patches]; + + if (sbr->patch_num_subbands[sbr->num_patches] > 0) { + usb = sb; + msb = sb; + sbr->num_patches++; + } else + msb = sbr->kx[1]; + + if (sbr->f_master[k] - sb < 3) + k = sbr->n_master; + } while (sb != sbr->kx[1] + sbr->m[1]); + + if (sbr->patch_num_subbands[sbr->num_patches-1] < 3 && sbr->num_patches > 1) + sbr->num_patches--; + + return 0; +} + +/// Derived Frequency Band Tables (14496-3 sp04 p197) +static int sbr_make_f_derived(AACContext *ac, SpectralBandReplication *sbr) +{ + int k, temp; + + sbr->n[1] = sbr->n_master - sbr->spectrum_params.bs_xover_band; + sbr->n[0] = (sbr->n[1] + 1) >> 1; + + memcpy(sbr->f_tablehigh, &sbr->f_master[sbr->spectrum_params.bs_xover_band], + (sbr->n[1] + 1) * sizeof(sbr->f_master[0])); + sbr->m[1] = sbr->f_tablehigh[sbr->n[1]] - sbr->f_tablehigh[0]; + sbr->kx[1] = sbr->f_tablehigh[0]; + + // Requirements (14496-3 sp04 p205) + if (sbr->kx[1] + sbr->m[1] > 64) { + av_log(ac->avctx, AV_LOG_ERROR, + "Stop frequency border too high: %d\n", sbr->kx[1] + sbr->m[1]); + return -1; + } + if (sbr->kx[1] > 32) { + av_log(ac->avctx, AV_LOG_ERROR, "Start frequency border too high: %d\n", sbr->kx[1]); + return -1; + } + + sbr->f_tablelow[0] = sbr->f_tablehigh[0]; + temp = sbr->n[1] & 1; + for (k = 1; k <= sbr->n[0]; k++) + sbr->f_tablelow[k] = sbr->f_tablehigh[2 * k - temp]; + + sbr->n_q = FFMAX(1, lrintf(sbr->spectrum_params.bs_noise_bands * + log2f(sbr->k[2] / (float)sbr->kx[1]))); // 0 <= bs_noise_bands <= 3 + if (sbr->n_q > 5) { + av_log(ac->avctx, AV_LOG_ERROR, "Too many noise floor scale factors: %d\n", sbr->n_q); + return -1; + } + + sbr->f_tablenoise[0] = sbr->f_tablelow[0]; + temp = 0; + for (k = 1; k <= sbr->n_q; k++) { + temp += (sbr->n[0] - temp) / (sbr->n_q + 1 - k); + sbr->f_tablenoise[k] = sbr->f_tablelow[temp]; + } + + if (sbr_hf_calc_npatches(ac, sbr) < 0) + return -1; + + sbr_make_f_tablelim(sbr); + + sbr->data[0].f_indexnoise = 0; + sbr->data[1].f_indexnoise = 0; + + return 0; +} + +static av_always_inline void get_bits1_vector(GetBitContext *gb, uint8_t *vec, + int elements) +{ + int i; + for (i = 0; i < elements; i++) { + vec[i] = get_bits1(gb); + } +} + +/** ceil(log2(index+1)) */ +static const int8_t ceil_log2[] = { + 0, 1, 2, 2, 3, 3, +}; + +static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr, + GetBitContext *gb, SBRData *ch_data) +{ + int i; + unsigned bs_pointer = 0; + // frameLengthFlag ? 15 : 16; 960 sample length frames unsupported; this value is numTimeSlots + int abs_bord_trail = 16; + int num_rel_lead, num_rel_trail; + unsigned bs_num_env_old = ch_data->bs_num_env; + + ch_data->bs_freq_res[0] = ch_data->bs_freq_res[ch_data->bs_num_env]; + ch_data->bs_amp_res = sbr->bs_amp_res_header; + ch_data->t_env_num_env_old = ch_data->t_env[bs_num_env_old]; + + switch (ch_data->bs_frame_class = get_bits(gb, 2)) { + case FIXFIX: + ch_data->bs_num_env = 1 << get_bits(gb, 2); + num_rel_lead = ch_data->bs_num_env - 1; + if (ch_data->bs_num_env == 1) + ch_data->bs_amp_res = 0; + + if (ch_data->bs_num_env > 4) { + av_log(ac->avctx, AV_LOG_ERROR, + "Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n", + ch_data->bs_num_env); + return -1; + } + + ch_data->t_env[0] = 0; + ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail; + + abs_bord_trail = (abs_bord_trail + (ch_data->bs_num_env >> 1)) / + ch_data->bs_num_env; + for (i = 0; i < num_rel_lead; i++) + ch_data->t_env[i + 1] = ch_data->t_env[i] + abs_bord_trail; + + ch_data->bs_freq_res[1] = get_bits1(gb); + for (i = 1; i < ch_data->bs_num_env; i++) + ch_data->bs_freq_res[i + 1] = ch_data->bs_freq_res[1]; + break; + case FIXVAR: + abs_bord_trail += get_bits(gb, 2); + num_rel_trail = get_bits(gb, 2); + ch_data->bs_num_env = num_rel_trail + 1; + ch_data->t_env[0] = 0; + ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail; + + for (i = 0; i < num_rel_trail; i++) + ch_data->t_env[ch_data->bs_num_env - 1 - i] = + ch_data->t_env[ch_data->bs_num_env - i] - 2 * get_bits(gb, 2) - 2; + + bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]); + + for (i = 0; i < ch_data->bs_num_env; i++) + ch_data->bs_freq_res[ch_data->bs_num_env - i] = get_bits1(gb); + break; + case VARFIX: + ch_data->t_env[0] = get_bits(gb, 2); + num_rel_lead = get_bits(gb, 2); + ch_data->bs_num_env = num_rel_lead + 1; + ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail; + + for (i = 0; i < num_rel_lead; i++) + ch_data->t_env[i + 1] = ch_data->t_env[i] + 2 * get_bits(gb, 2) + 2; + + bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]); + + get_bits1_vector(gb, ch_data->bs_freq_res + 1, ch_data->bs_num_env); + break; + case VARVAR: + ch_data->t_env[0] = get_bits(gb, 2); + abs_bord_trail += get_bits(gb, 2); + num_rel_lead = get_bits(gb, 2); + num_rel_trail = get_bits(gb, 2); + ch_data->bs_num_env = num_rel_lead + num_rel_trail + 1; + + if (ch_data->bs_num_env > 5) { + av_log(ac->avctx, AV_LOG_ERROR, + "Invalid bitstream, too many SBR envelopes in VARVAR type SBR frame: %d\n", + ch_data->bs_num_env); + return -1; + } + + ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail; + + for (i = 0; i < num_rel_lead; i++) + ch_data->t_env[i + 1] = ch_data->t_env[i] + 2 * get_bits(gb, 2) + 2; + for (i = 0; i < num_rel_trail; i++) + ch_data->t_env[ch_data->bs_num_env - 1 - i] = + ch_data->t_env[ch_data->bs_num_env - i] - 2 * get_bits(gb, 2) - 2; + + bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]); + + get_bits1_vector(gb, ch_data->bs_freq_res + 1, ch_data->bs_num_env); + break; + } + + if (bs_pointer > ch_data->bs_num_env + 1) { + av_log(ac->avctx, AV_LOG_ERROR, + "Invalid bitstream, bs_pointer points to a middle noise border outside the time borders table: %d\n", + bs_pointer); + return -1; + } + + for (i = 1; i <= ch_data->bs_num_env; i++) { + if (ch_data->t_env[i-1] > ch_data->t_env[i]) { + av_log(ac->avctx, AV_LOG_ERROR, "Non monotone time borders\n"); + return -1; + } + } + + ch_data->bs_num_noise = (ch_data->bs_num_env > 1) + 1; + + ch_data->t_q[0] = ch_data->t_env[0]; + ch_data->t_q[ch_data->bs_num_noise] = ch_data->t_env[ch_data->bs_num_env]; + if (ch_data->bs_num_noise > 1) { + unsigned int idx; + if (ch_data->bs_frame_class == FIXFIX) { + idx = ch_data->bs_num_env >> 1; + } else if (ch_data->bs_frame_class & 1) { // FIXVAR or VARVAR + idx = ch_data->bs_num_env - FFMAX(bs_pointer - 1, 1); + } else { // VARFIX + if (!bs_pointer) + idx = 1; + else if (bs_pointer == 1) + idx = ch_data->bs_num_env - 1; + else // bs_pointer > 1 + idx = bs_pointer - 1; + } + ch_data->t_q[1] = ch_data->t_env[idx]; + } + + ch_data->e_a[0] = -(ch_data->e_a[1] != bs_num_env_old); // l_APrev + ch_data->e_a[1] = -1; + if ((ch_data->bs_frame_class & 1) && bs_pointer) { // FIXVAR or VARVAR and bs_pointer != 0 + ch_data->e_a[1] = ch_data->bs_num_env + 1 - bs_pointer; + } else if ((ch_data->bs_frame_class == 2) && (bs_pointer > 1)) // VARFIX and bs_pointer > 1 + ch_data->e_a[1] = bs_pointer - 1; + + return 0; +} + +static void copy_sbr_grid(SBRData *dst, const SBRData *src) { + //These variables are saved from the previous frame rather than copied + dst->bs_freq_res[0] = dst->bs_freq_res[dst->bs_num_env]; + dst->t_env_num_env_old = dst->t_env[dst->bs_num_env]; + dst->e_a[0] = -(dst->e_a[1] != dst->bs_num_env); + + //These variables are read from the bitstream and therefore copied + memcpy(dst->bs_freq_res+1, src->bs_freq_res+1, sizeof(dst->bs_freq_res)-sizeof(*dst->bs_freq_res)); + memcpy(dst->t_env, src->t_env, sizeof(dst->t_env)); + memcpy(dst->t_q, src->t_q, sizeof(dst->t_q)); + dst->bs_num_env = src->bs_num_env; + dst->bs_amp_res = src->bs_amp_res; + dst->bs_num_noise = src->bs_num_noise; + dst->bs_frame_class = src->bs_frame_class; + dst->e_a[1] = src->e_a[1]; +} + +/// Read how the envelope and noise floor data is delta coded +static void read_sbr_dtdf(SpectralBandReplication *sbr, GetBitContext *gb, + SBRData *ch_data) +{ + get_bits1_vector(gb, ch_data->bs_df_env, ch_data->bs_num_env); + get_bits1_vector(gb, ch_data->bs_df_noise, ch_data->bs_num_noise); +} + +/// Read inverse filtering data +static void read_sbr_invf(SpectralBandReplication *sbr, GetBitContext *gb, + SBRData *ch_data) +{ + int i; + + memcpy(ch_data->bs_invf_mode[1], ch_data->bs_invf_mode[0], 5 * sizeof(uint8_t)); + for (i = 0; i < sbr->n_q; i++) + ch_data->bs_invf_mode[0][i] = get_bits(gb, 2); +} + +static void read_sbr_envelope(SpectralBandReplication *sbr, GetBitContext *gb, + SBRData *ch_data, int ch) +{ + int bits; + int i, j, k; + VLC_TYPE (*t_huff)[2], (*f_huff)[2]; + int t_lav, f_lav; + const int delta = (ch == 1 && sbr->bs_coupling == 1) + 1; + const int odd = sbr->n[1] & 1; + + if (sbr->bs_coupling && ch) { + if (ch_data->bs_amp_res) { + bits = 5; + t_huff = vlc_sbr[T_HUFFMAN_ENV_BAL_3_0DB].table; + t_lav = vlc_sbr_lav[T_HUFFMAN_ENV_BAL_3_0DB]; + f_huff = vlc_sbr[F_HUFFMAN_ENV_BAL_3_0DB].table; + f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_BAL_3_0DB]; + } else { + bits = 6; + t_huff = vlc_sbr[T_HUFFMAN_ENV_BAL_1_5DB].table; + t_lav = vlc_sbr_lav[T_HUFFMAN_ENV_BAL_1_5DB]; + f_huff = vlc_sbr[F_HUFFMAN_ENV_BAL_1_5DB].table; + f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_BAL_1_5DB]; + } + } else { + if (ch_data->bs_amp_res) { + bits = 6; + t_huff = vlc_sbr[T_HUFFMAN_ENV_3_0DB].table; + t_lav = vlc_sbr_lav[T_HUFFMAN_ENV_3_0DB]; + f_huff = vlc_sbr[F_HUFFMAN_ENV_3_0DB].table; + f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_3_0DB]; + } else { + bits = 7; + t_huff = vlc_sbr[T_HUFFMAN_ENV_1_5DB].table; + t_lav = vlc_sbr_lav[T_HUFFMAN_ENV_1_5DB]; + f_huff = vlc_sbr[F_HUFFMAN_ENV_1_5DB].table; + f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_1_5DB]; + } + } + + for (i = 0; i < ch_data->bs_num_env; i++) { + if (ch_data->bs_df_env[i]) { + // bs_freq_res[0] == bs_freq_res[bs_num_env] from prev frame + if (ch_data->bs_freq_res[i + 1] == ch_data->bs_freq_res[i]) { + for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++) + ch_data->env_facs[i + 1][j] = ch_data->env_facs[i][j] + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav); + } else if (ch_data->bs_freq_res[i + 1]) { + for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++) { + k = (j + odd) >> 1; // find k such that f_tablelow[k] <= f_tablehigh[j] < f_tablelow[k + 1] + ch_data->env_facs[i + 1][j] = ch_data->env_facs[i][k] + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav); + } + } else { + for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++) { + k = j ? 2*j - odd : 0; // find k such that f_tablehigh[k] == f_tablelow[j] + ch_data->env_facs[i + 1][j] = ch_data->env_facs[i][k] + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav); + } + } + } else { + ch_data->env_facs[i + 1][0] = delta * get_bits(gb, bits); // bs_env_start_value_balance + for (j = 1; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++) + ch_data->env_facs[i + 1][j] = ch_data->env_facs[i + 1][j - 1] + delta * (get_vlc2(gb, f_huff, 9, 3) - f_lav); + } + } + + //assign 0th elements of env_facs from last elements + memcpy(ch_data->env_facs[0], ch_data->env_facs[ch_data->bs_num_env], + sizeof(ch_data->env_facs[0])); +} + +static void read_sbr_noise(SpectralBandReplication *sbr, GetBitContext *gb, + SBRData *ch_data, int ch) +{ + int i, j; + VLC_TYPE (*t_huff)[2], (*f_huff)[2]; + int t_lav, f_lav; + int delta = (ch == 1 && sbr->bs_coupling == 1) + 1; + + if (sbr->bs_coupling && ch) { + t_huff = vlc_sbr[T_HUFFMAN_NOISE_BAL_3_0DB].table; + t_lav = vlc_sbr_lav[T_HUFFMAN_NOISE_BAL_3_0DB]; + f_huff = vlc_sbr[F_HUFFMAN_ENV_BAL_3_0DB].table; + f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_BAL_3_0DB]; + } else { + t_huff = vlc_sbr[T_HUFFMAN_NOISE_3_0DB].table; + t_lav = vlc_sbr_lav[T_HUFFMAN_NOISE_3_0DB]; + f_huff = vlc_sbr[F_HUFFMAN_ENV_3_0DB].table; + f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_3_0DB]; + } + + for (i = 0; i < ch_data->bs_num_noise; i++) { + if (ch_data->bs_df_noise[i]) { + for (j = 0; j < sbr->n_q; j++) + ch_data->noise_facs[i + 1][j] = ch_data->noise_facs[i][j] + delta * (get_vlc2(gb, t_huff, 9, 2) - t_lav); + } else { + ch_data->noise_facs[i + 1][0] = delta * get_bits(gb, 5); // bs_noise_start_value_balance or bs_noise_start_value_level + for (j = 1; j < sbr->n_q; j++) + ch_data->noise_facs[i + 1][j] = ch_data->noise_facs[i + 1][j - 1] + delta * (get_vlc2(gb, f_huff, 9, 3) - f_lav); + } + } + + //assign 0th elements of noise_facs from last elements + memcpy(ch_data->noise_facs[0], ch_data->noise_facs[ch_data->bs_num_noise], + sizeof(ch_data->noise_facs[0])); +} + +static void read_sbr_extension(AACContext *ac, SpectralBandReplication *sbr, + GetBitContext *gb, + int bs_extension_id, int *num_bits_left) +{ + switch (bs_extension_id) { + case EXTENSION_ID_PS: + if (!ac->m4ac.ps) { + av_log(ac->avctx, AV_LOG_ERROR, "Parametric Stereo signaled to be not-present but was found in the bitstream.\n"); + skip_bits_long(gb, *num_bits_left); // bs_fill_bits + *num_bits_left = 0; + } else { +#if 1 + *num_bits_left -= ff_ps_read_data(ac->avctx, gb, &sbr->ps, *num_bits_left); +#else + av_log_missing_feature(ac->avctx, "Parametric Stereo is", 0); + skip_bits_long(gb, *num_bits_left); // bs_fill_bits + *num_bits_left = 0; +#endif + } + break; + default: + av_log_missing_feature(ac->avctx, "Reserved SBR extensions are", 1); + skip_bits_long(gb, *num_bits_left); // bs_fill_bits + *num_bits_left = 0; + break; + } +} + +static int read_sbr_single_channel_element(AACContext *ac, + SpectralBandReplication *sbr, + GetBitContext *gb) +{ + if (get_bits1(gb)) // bs_data_extra + skip_bits(gb, 4); // bs_reserved + + if (read_sbr_grid(ac, sbr, gb, &sbr->data[0])) + return -1; + read_sbr_dtdf(sbr, gb, &sbr->data[0]); + read_sbr_invf(sbr, gb, &sbr->data[0]); + read_sbr_envelope(sbr, gb, &sbr->data[0], 0); + read_sbr_noise(sbr, gb, &sbr->data[0], 0); + + if ((sbr->data[0].bs_add_harmonic_flag = get_bits1(gb))) + get_bits1_vector(gb, sbr->data[0].bs_add_harmonic, sbr->n[1]); + + return 0; +} + +static int read_sbr_channel_pair_element(AACContext *ac, + SpectralBandReplication *sbr, + GetBitContext *gb) +{ + if (get_bits1(gb)) // bs_data_extra + skip_bits(gb, 8); // bs_reserved + + if ((sbr->bs_coupling = get_bits1(gb))) { + if (read_sbr_grid(ac, sbr, gb, &sbr->data[0])) + return -1; + copy_sbr_grid(&sbr->data[1], &sbr->data[0]); + read_sbr_dtdf(sbr, gb, &sbr->data[0]); + read_sbr_dtdf(sbr, gb, &sbr->data[1]); + read_sbr_invf(sbr, gb, &sbr->data[0]); + memcpy(sbr->data[1].bs_invf_mode[1], sbr->data[1].bs_invf_mode[0], sizeof(sbr->data[1].bs_invf_mode[0])); + memcpy(sbr->data[1].bs_invf_mode[0], sbr->data[0].bs_invf_mode[0], sizeof(sbr->data[1].bs_invf_mode[0])); + read_sbr_envelope(sbr, gb, &sbr->data[0], 0); + read_sbr_noise(sbr, gb, &sbr->data[0], 0); + read_sbr_envelope(sbr, gb, &sbr->data[1], 1); + read_sbr_noise(sbr, gb, &sbr->data[1], 1); + } else { + if (read_sbr_grid(ac, sbr, gb, &sbr->data[0]) || + read_sbr_grid(ac, sbr, gb, &sbr->data[1])) + return -1; + read_sbr_dtdf(sbr, gb, &sbr->data[0]); + read_sbr_dtdf(sbr, gb, &sbr->data[1]); + read_sbr_invf(sbr, gb, &sbr->data[0]); + read_sbr_invf(sbr, gb, &sbr->data[1]); + read_sbr_envelope(sbr, gb, &sbr->data[0], 0); + read_sbr_envelope(sbr, gb, &sbr->data[1], 1); + read_sbr_noise(sbr, gb, &sbr->data[0], 0); + read_sbr_noise(sbr, gb, &sbr->data[1], 1); + } + + if ((sbr->data[0].bs_add_harmonic_flag = get_bits1(gb))) + get_bits1_vector(gb, sbr->data[0].bs_add_harmonic, sbr->n[1]); + if ((sbr->data[1].bs_add_harmonic_flag = get_bits1(gb))) + get_bits1_vector(gb, sbr->data[1].bs_add_harmonic, sbr->n[1]); + + return 0; +} + +static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr, + GetBitContext *gb, int id_aac) +{ + unsigned int cnt = get_bits_count(gb); + + if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) { + if (read_sbr_single_channel_element(ac, sbr, gb)) { + sbr->start = 0; + return get_bits_count(gb) - cnt; + } + } else if (id_aac == TYPE_CPE) { + if (read_sbr_channel_pair_element(ac, sbr, gb)) { + sbr->start = 0; + return get_bits_count(gb) - cnt; + } + } else { + av_log(ac->avctx, AV_LOG_ERROR, + "Invalid bitstream - cannot apply SBR to element type %d\n", id_aac); + sbr->start = 0; + return get_bits_count(gb) - cnt; + } + if (get_bits1(gb)) { // bs_extended_data + int num_bits_left = get_bits(gb, 4); // bs_extension_size + if (num_bits_left == 15) + num_bits_left += get_bits(gb, 8); // bs_esc_count + + num_bits_left <<= 3; + while (num_bits_left > 7) { + num_bits_left -= 2; + read_sbr_extension(ac, sbr, gb, get_bits(gb, 2), &num_bits_left); // bs_extension_id + } + if (num_bits_left < 0) { + av_log(ac->avctx, AV_LOG_ERROR, "SBR Extension over read.\n"); + } + if (num_bits_left > 0) + skip_bits(gb, num_bits_left); + } + + return get_bits_count(gb) - cnt; +} + +static void sbr_reset(AACContext *ac, SpectralBandReplication *sbr) +{ + int err; + err = sbr_make_f_master(ac, sbr, &sbr->spectrum_params); + if (err >= 0) + err = sbr_make_f_derived(ac, sbr); + if (err < 0) { + av_log(ac->avctx, AV_LOG_ERROR, + "SBR reset failed. Switching SBR to pure upsampling mode.\n"); + sbr->start = 0; + } +} + +/** + * Decode Spectral Band Replication extension data; reference: table 4.55. + * + * @param crc flag indicating the presence of CRC checksum + * @param cnt length of TYPE_FIL syntactic element in bytes + * + * @return Returns number of bytes consumed from the TYPE_FIL element. + */ +int ff_decode_sbr_extension(AACContext *ac, SpectralBandReplication *sbr, + GetBitContext *gb_host, int crc, int cnt, int id_aac) +{ + unsigned int num_sbr_bits = 0, num_align_bits; + unsigned bytes_read; + GetBitContext gbc = *gb_host, *gb = &gbc; + skip_bits_long(gb_host, cnt*8 - 4); + + sbr->reset = 0; + + if (!sbr->sample_rate) + sbr->sample_rate = 2 * ac->m4ac.sample_rate; //TODO use the nominal sample rate for arbitrary sample rate support + if (!ac->m4ac.ext_sample_rate) + ac->m4ac.ext_sample_rate = 2 * ac->m4ac.sample_rate; + + if (crc) { + skip_bits(gb, 10); // bs_sbr_crc_bits; TODO - implement CRC check + num_sbr_bits += 10; + } + + //Save some state from the previous frame. + sbr->kx[0] = sbr->kx[1]; + sbr->m[0] = sbr->m[1]; + + num_sbr_bits++; + if (get_bits1(gb)) // bs_header_flag + num_sbr_bits += read_sbr_header(sbr, gb); + + if (sbr->reset) + sbr_reset(ac, sbr); + + if (sbr->start) + num_sbr_bits += read_sbr_data(ac, sbr, gb, id_aac); + + num_align_bits = ((cnt << 3) - 4 - num_sbr_bits) & 7; + bytes_read = ((num_sbr_bits + num_align_bits + 4) >> 3); + + if (bytes_read > cnt) { + av_log(ac->avctx, AV_LOG_ERROR, + "Expected to read %d SBR bytes actually read %d.\n", cnt, bytes_read); + } + return cnt; +} + +/// Dequantization and stereo decoding (14496-3 sp04 p203) +static void sbr_dequant(SpectralBandReplication *sbr, int id_aac) +{ + int k, e; + int ch; + + if (id_aac == TYPE_CPE && sbr->bs_coupling) { + float alpha = sbr->data[0].bs_amp_res ? 1.0f : 0.5f; + float pan_offset = sbr->data[0].bs_amp_res ? 12.0f : 24.0f; + for (e = 1; e <= sbr->data[0].bs_num_env; e++) { + for (k = 0; k < sbr->n[sbr->data[0].bs_freq_res[e]]; k++) { + float temp1 = exp2f(sbr->data[0].env_facs[e][k] * alpha + 7.0f); + float temp2 = exp2f((pan_offset - sbr->data[1].env_facs[e][k]) * alpha); + float fac = temp1 / (1.0f + temp2); + sbr->data[0].env_facs[e][k] = fac; + sbr->data[1].env_facs[e][k] = fac * temp2; + } + } + for (e = 1; e <= sbr->data[0].bs_num_noise; e++) { + for (k = 0; k < sbr->n_q; k++) { + float temp1 = exp2f(NOISE_FLOOR_OFFSET - sbr->data[0].noise_facs[e][k] + 1); + float temp2 = exp2f(12 - sbr->data[1].noise_facs[e][k]); + float fac = temp1 / (1.0f + temp2); + sbr->data[0].noise_facs[e][k] = fac; + sbr->data[1].noise_facs[e][k] = fac * temp2; + } + } + } else { // SCE or one non-coupled CPE + for (ch = 0; ch < (id_aac == TYPE_CPE) + 1; ch++) { + float alpha = sbr->data[ch].bs_amp_res ? 1.0f : 0.5f; + for (e = 1; e <= sbr->data[ch].bs_num_env; e++) + for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++) + sbr->data[ch].env_facs[e][k] = + exp2f(alpha * sbr->data[ch].env_facs[e][k] + 6.0f); + for (e = 1; e <= sbr->data[ch].bs_num_noise; e++) + for (k = 0; k < sbr->n_q; k++) + sbr->data[ch].noise_facs[e][k] = + exp2f(NOISE_FLOOR_OFFSET - sbr->data[ch].noise_facs[e][k]); + } + } +} + +/** + * Analysis QMF Bank (14496-3 sp04 p206) + * + * @param x pointer to the beginning of the first sample window + * @param W array of complex-valued samples split into subbands + */ +static void sbr_qmf_analysis(DSPContext *dsp, FFTContext *mdct, const float *in, float *x, + float z[320], float W[2][32][32][2], + float scale) +{ + int i, k; + memcpy(W[0], W[1], sizeof(W[0])); + memcpy(x , x+1024, (320-32)*sizeof(x[0])); + if (scale != 1.0f) + dsp->vector_fmul_scalar(x+288, in, scale, 1024); + else + memcpy(x+288, in, 1024*sizeof(*x)); + for (i = 0; i < 32; i++) { // numTimeSlots*RATE = 16*2 as 960 sample frames + // are not supported + dsp->vector_fmul_reverse(z, sbr_qmf_window_ds, x, 320); + for (k = 0; k < 64; k++) { + float f = z[k] + z[k + 64] + z[k + 128] + z[k + 192] + z[k + 256]; + z[k] = f; + } + //Shuffle to IMDCT + z[64] = z[0]; + for (k = 1; k < 32; k++) { + z[64+2*k-1] = z[ k]; + z[64+2*k ] = -z[64-k]; + } + z[64+63] = z[32]; + + ff_imdct_half(mdct, z, z+64); + for (k = 0; k < 32; k++) { + W[1][i][k][0] = -z[63-k]; + W[1][i][k][1] = z[k]; + } + x += 32; + } +} + +/** + * Synthesis QMF Bank (14496-3 sp04 p206) and Downsampled Synthesis QMF Bank + * (14496-3 sp04 p206) + */ +static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct, + float *out, float X[2][38][64], + float mdct_buf[2][64], + float *v0, int *v_off, const unsigned int div) +{ + int i, n; + const float *sbr_qmf_window = div ? sbr_qmf_window_ds : sbr_qmf_window_us; + float *v; + for (i = 0; i < 32; i++) { + if (*v_off == 0) { + int saved_samples = (1280 - 128) >> div; + memcpy(&v0[SBR_SYNTHESIS_BUF_SIZE - saved_samples], v0, saved_samples * sizeof(float)); + *v_off = SBR_SYNTHESIS_BUF_SIZE - saved_samples - (128 >> div); + } else { + *v_off -= 128 >> div; + } + v = v0 + *v_off; + if (div) { + for (n = 0; n < 32; n++) { + X[0][i][ n] = -X[0][i][n]; + X[0][i][32+n] = X[1][i][31-n]; + } + ff_imdct_half(mdct, mdct_buf[0], X[0][i]); + for (n = 0; n < 32; n++) { + v[ n] = mdct_buf[0][63 - 2*n]; + v[63 - n] = -mdct_buf[0][62 - 2*n]; + } + } else { + for (n = 1; n < 64; n+=2) { + X[1][i][n] = -X[1][i][n]; + } + ff_imdct_half(mdct, mdct_buf[0], X[0][i]); + ff_imdct_half(mdct, mdct_buf[1], X[1][i]); + for (n = 0; n < 64; n++) { + v[ n] = -mdct_buf[0][63 - n] + mdct_buf[1][ n ]; + v[127 - n] = mdct_buf[0][63 - n] + mdct_buf[1][ n ]; + } + } + dsp->vector_fmul_add(out, v , sbr_qmf_window , zero64, 64 >> div); + dsp->vector_fmul_add(out, v + ( 192 >> div), sbr_qmf_window + ( 64 >> div), out , 64 >> div); + dsp->vector_fmul_add(out, v + ( 256 >> div), sbr_qmf_window + (128 >> div), out , 64 >> div); + dsp->vector_fmul_add(out, v + ( 448 >> div), sbr_qmf_window + (192 >> div), out , 64 >> div); + dsp->vector_fmul_add(out, v + ( 512 >> div), sbr_qmf_window + (256 >> div), out , 64 >> div); + dsp->vector_fmul_add(out, v + ( 704 >> div), sbr_qmf_window + (320 >> div), out , 64 >> div); + dsp->vector_fmul_add(out, v + ( 768 >> div), sbr_qmf_window + (384 >> div), out , 64 >> div); + dsp->vector_fmul_add(out, v + ( 960 >> div), sbr_qmf_window + (448 >> div), out , 64 >> div); + dsp->vector_fmul_add(out, v + (1024 >> div), sbr_qmf_window + (512 >> div), out , 64 >> div); + dsp->vector_fmul_add(out, v + (1216 >> div), sbr_qmf_window + (576 >> div), out , 64 >> div); + out += 64 >> div; + } +} + +static void autocorrelate(const float x[40][2], float phi[3][2][2], int lag) +{ + int i; + float real_sum = 0.0f; + float imag_sum = 0.0f; + if (lag) { + for (i = 1; i < 38; i++) { + real_sum += x[i][0] * x[i+lag][0] + x[i][1] * x[i+lag][1]; + imag_sum += x[i][0] * x[i+lag][1] - x[i][1] * x[i+lag][0]; + } + phi[2-lag][1][0] = real_sum + x[ 0][0] * x[lag][0] + x[ 0][1] * x[lag][1]; + phi[2-lag][1][1] = imag_sum + x[ 0][0] * x[lag][1] - x[ 0][1] * x[lag][0]; + if (lag == 1) { + phi[0][0][0] = real_sum + x[38][0] * x[39][0] + x[38][1] * x[39][1]; + phi[0][0][1] = imag_sum + x[38][0] * x[39][1] - x[38][1] * x[39][0]; + } + } else { + for (i = 1; i < 38; i++) { + real_sum += x[i][0] * x[i][0] + x[i][1] * x[i][1]; + } + phi[2][1][0] = real_sum + x[ 0][0] * x[ 0][0] + x[ 0][1] * x[ 0][1]; + phi[1][0][0] = real_sum + x[38][0] * x[38][0] + x[38][1] * x[38][1]; + } +} + +/** High Frequency Generation (14496-3 sp04 p214+) and Inverse Filtering + * (14496-3 sp04 p214) + * Warning: This routine does not seem numerically stable. + */ +static void sbr_hf_inverse_filter(float (*alpha0)[2], float (*alpha1)[2], + const float X_low[32][40][2], int k0) +{ + int k; + for (k = 0; k < k0; k++) { + float phi[3][2][2], dk; + + autocorrelate(X_low[k], phi, 0); + autocorrelate(X_low[k], phi, 1); + autocorrelate(X_low[k], phi, 2); + + dk = phi[2][1][0] * phi[1][0][0] - + (phi[1][1][0] * phi[1][1][0] + phi[1][1][1] * phi[1][1][1]) / 1.000001f; + + if (!dk) { + alpha1[k][0] = 0; + alpha1[k][1] = 0; + } else { + float temp_real, temp_im; + temp_real = phi[0][0][0] * phi[1][1][0] - + phi[0][0][1] * phi[1][1][1] - + phi[0][1][0] * phi[1][0][0]; + temp_im = phi[0][0][0] * phi[1][1][1] + + phi[0][0][1] * phi[1][1][0] - + phi[0][1][1] * phi[1][0][0]; + + alpha1[k][0] = temp_real / dk; + alpha1[k][1] = temp_im / dk; + } + + if (!phi[1][0][0]) { + alpha0[k][0] = 0; + alpha0[k][1] = 0; + } else { + float temp_real, temp_im; + temp_real = phi[0][0][0] + alpha1[k][0] * phi[1][1][0] + + alpha1[k][1] * phi[1][1][1]; + temp_im = phi[0][0][1] + alpha1[k][1] * phi[1][1][0] - + alpha1[k][0] * phi[1][1][1]; + + alpha0[k][0] = -temp_real / phi[1][0][0]; + alpha0[k][1] = -temp_im / phi[1][0][0]; + } + + if (alpha1[k][0] * alpha1[k][0] + alpha1[k][1] * alpha1[k][1] >= 16.0f || + alpha0[k][0] * alpha0[k][0] + alpha0[k][1] * alpha0[k][1] >= 16.0f) { + alpha1[k][0] = 0; + alpha1[k][1] = 0; + alpha0[k][0] = 0; + alpha0[k][1] = 0; + } + } +} + +/// Chirp Factors (14496-3 sp04 p214) +static void sbr_chirp(SpectralBandReplication *sbr, SBRData *ch_data) +{ + int i; + float new_bw; + static const float bw_tab[] = { 0.0f, 0.75f, 0.9f, 0.98f }; + + for (i = 0; i < sbr->n_q; i++) { + if (ch_data->bs_invf_mode[0][i] + ch_data->bs_invf_mode[1][i] == 1) { + new_bw = 0.6f; + } else + new_bw = bw_tab[ch_data->bs_invf_mode[0][i]]; + + if (new_bw < ch_data->bw_array[i]) { + new_bw = 0.75f * new_bw + 0.25f * ch_data->bw_array[i]; + } else + new_bw = 0.90625f * new_bw + 0.09375f * ch_data->bw_array[i]; + ch_data->bw_array[i] = new_bw < 0.015625f ? 0.0f : new_bw; + } +} + +/// Generate the subband filtered lowband +static int sbr_lf_gen(AACContext *ac, SpectralBandReplication *sbr, + float X_low[32][40][2], const float W[2][32][32][2]) +{ + int i, k; + const int t_HFGen = 8; + const int i_f = 32; + memset(X_low, 0, 32*sizeof(*X_low)); + for (k = 0; k < sbr->kx[1]; k++) { + for (i = t_HFGen; i < i_f + t_HFGen; i++) { + X_low[k][i][0] = W[1][i - t_HFGen][k][0]; + X_low[k][i][1] = W[1][i - t_HFGen][k][1]; + } + } + for (k = 0; k < sbr->kx[0]; k++) { + for (i = 0; i < t_HFGen; i++) { + X_low[k][i][0] = W[0][i + i_f - t_HFGen][k][0]; + X_low[k][i][1] = W[0][i + i_f - t_HFGen][k][1]; + } + } + return 0; +} + +/// High Frequency Generator (14496-3 sp04 p215) +static int sbr_hf_gen(AACContext *ac, SpectralBandReplication *sbr, + float X_high[64][40][2], const float X_low[32][40][2], + const float (*alpha0)[2], const float (*alpha1)[2], + const float bw_array[5], const uint8_t *t_env, + int bs_num_env) +{ + int i, j, x; + int g = 0; + int k = sbr->kx[1]; + for (j = 0; j < sbr->num_patches; j++) { + for (x = 0; x < sbr->patch_num_subbands[j]; x++, k++) { + float alpha[4]; + const int p = sbr->patch_start_subband[j] + x; + while (g <= sbr->n_q && k >= sbr->f_tablenoise[g]) + g++; + g--; + + if (g < 0) { + av_log(ac->avctx, AV_LOG_ERROR, + "ERROR : no subband found for frequency %d\n", k); + return -1; + } + + alpha[0] = alpha1[p][0] * bw_array[g] * bw_array[g]; + alpha[1] = alpha1[p][1] * bw_array[g] * bw_array[g]; + alpha[2] = alpha0[p][0] * bw_array[g]; + alpha[3] = alpha0[p][1] * bw_array[g]; + + for (i = 2 * t_env[0]; i < 2 * t_env[bs_num_env]; i++) { + const int idx = i + ENVELOPE_ADJUSTMENT_OFFSET; + X_high[k][idx][0] = + X_low[p][idx - 2][0] * alpha[0] - + X_low[p][idx - 2][1] * alpha[1] + + X_low[p][idx - 1][0] * alpha[2] - + X_low[p][idx - 1][1] * alpha[3] + + X_low[p][idx][0]; + X_high[k][idx][1] = + X_low[p][idx - 2][1] * alpha[0] + + X_low[p][idx - 2][0] * alpha[1] + + X_low[p][idx - 1][1] * alpha[2] + + X_low[p][idx - 1][0] * alpha[3] + + X_low[p][idx][1]; + } + } + } + if (k < sbr->m[1] + sbr->kx[1]) + memset(X_high + k, 0, (sbr->m[1] + sbr->kx[1] - k) * sizeof(*X_high)); + + return 0; +} + +/// Generate the subband filtered lowband +static int sbr_x_gen(SpectralBandReplication *sbr, float X[2][38][64], + const float X_low[32][40][2], const float Y[2][38][64][2], + int ch) +{ + int k, i; + const int i_f = 32; + const int i_Temp = FFMAX(2*sbr->data[ch].t_env_num_env_old - i_f, 0); + memset(X, 0, 2*sizeof(*X)); + for (k = 0; k < sbr->kx[0]; k++) { + for (i = 0; i < i_Temp; i++) { + X[0][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][0]; + X[1][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][1]; + } + } + for (; k < sbr->kx[0] + sbr->m[0]; k++) { + for (i = 0; i < i_Temp; i++) { + X[0][i][k] = Y[0][i + i_f][k][0]; + X[1][i][k] = Y[0][i + i_f][k][1]; + } + } + + for (k = 0; k < sbr->kx[1]; k++) { + for (i = i_Temp; i < 38; i++) { + X[0][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][0]; + X[1][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][1]; + } + } + for (; k < sbr->kx[1] + sbr->m[1]; k++) { + for (i = i_Temp; i < i_f; i++) { + X[0][i][k] = Y[1][i][k][0]; + X[1][i][k] = Y[1][i][k][1]; + } + } + return 0; +} + +/** High Frequency Adjustment (14496-3 sp04 p217) and Mapping + * (14496-3 sp04 p217) + */ +static void sbr_mapping(AACContext *ac, SpectralBandReplication *sbr, + SBRData *ch_data, int e_a[2]) +{ + int e, i, m; + + memset(ch_data->s_indexmapped[1], 0, 7*sizeof(ch_data->s_indexmapped[1])); + for (e = 0; e < ch_data->bs_num_env; e++) { + const unsigned int ilim = sbr->n[ch_data->bs_freq_res[e + 1]]; + uint16_t *table = ch_data->bs_freq_res[e + 1] ? sbr->f_tablehigh : sbr->f_tablelow; + int k; + + for (i = 0; i < ilim; i++) + for (m = table[i]; m < table[i + 1]; m++) + sbr->e_origmapped[e][m - sbr->kx[1]] = ch_data->env_facs[e+1][i]; + + // ch_data->bs_num_noise > 1 => 2 noise floors + k = (ch_data->bs_num_noise > 1) && (ch_data->t_env[e] >= ch_data->t_q[1]); + for (i = 0; i < sbr->n_q; i++) + for (m = sbr->f_tablenoise[i]; m < sbr->f_tablenoise[i + 1]; m++) + sbr->q_mapped[e][m - sbr->kx[1]] = ch_data->noise_facs[k+1][i]; + + for (i = 0; i < sbr->n[1]; i++) { + if (ch_data->bs_add_harmonic_flag) { + const unsigned int m_midpoint = + (sbr->f_tablehigh[i] + sbr->f_tablehigh[i + 1]) >> 1; + + ch_data->s_indexmapped[e + 1][m_midpoint - sbr->kx[1]] = ch_data->bs_add_harmonic[i] * + (e >= e_a[1] || (ch_data->s_indexmapped[0][m_midpoint - sbr->kx[1]] == 1)); + } + } + + for (i = 0; i < ilim; i++) { + int additional_sinusoid_present = 0; + for (m = table[i]; m < table[i + 1]; m++) { + if (ch_data->s_indexmapped[e + 1][m - sbr->kx[1]]) { + additional_sinusoid_present = 1; + break; + } + } + memset(&sbr->s_mapped[e][table[i] - sbr->kx[1]], additional_sinusoid_present, + (table[i + 1] - table[i]) * sizeof(sbr->s_mapped[e][0])); + } + } + + memcpy(ch_data->s_indexmapped[0], ch_data->s_indexmapped[ch_data->bs_num_env], sizeof(ch_data->s_indexmapped[0])); +} + +/// Estimation of current envelope (14496-3 sp04 p218) +static void sbr_env_estimate(float (*e_curr)[48], float X_high[64][40][2], + SpectralBandReplication *sbr, SBRData *ch_data) +{ + int e, i, m; + + if (sbr->bs_interpol_freq) { + for (e = 0; e < ch_data->bs_num_env; e++) { + const float recip_env_size = 0.5f / (ch_data->t_env[e + 1] - ch_data->t_env[e]); + int ilb = ch_data->t_env[e] * 2 + ENVELOPE_ADJUSTMENT_OFFSET; + int iub = ch_data->t_env[e + 1] * 2 + ENVELOPE_ADJUSTMENT_OFFSET; + + for (m = 0; m < sbr->m[1]; m++) { + float sum = 0.0f; + + for (i = ilb; i < iub; i++) { + sum += X_high[m + sbr->kx[1]][i][0] * X_high[m + sbr->kx[1]][i][0] + + X_high[m + sbr->kx[1]][i][1] * X_high[m + sbr->kx[1]][i][1]; + } + e_curr[e][m] = sum * recip_env_size; + } + } + } else { + int k, p; + + for (e = 0; e < ch_data->bs_num_env; e++) { + const int env_size = 2 * (ch_data->t_env[e + 1] - ch_data->t_env[e]); + int ilb = ch_data->t_env[e] * 2 + ENVELOPE_ADJUSTMENT_OFFSET; + int iub = ch_data->t_env[e + 1] * 2 + ENVELOPE_ADJUSTMENT_OFFSET; + const uint16_t *table = ch_data->bs_freq_res[e + 1] ? sbr->f_tablehigh : sbr->f_tablelow; + + for (p = 0; p < sbr->n[ch_data->bs_freq_res[e + 1]]; p++) { + float sum = 0.0f; + const int den = env_size * (table[p + 1] - table[p]); + + for (k = table[p]; k < table[p + 1]; k++) { + for (i = ilb; i < iub; i++) { + sum += X_high[k][i][0] * X_high[k][i][0] + + X_high[k][i][1] * X_high[k][i][1]; + } + } + sum /= den; + for (k = table[p]; k < table[p + 1]; k++) { + e_curr[e][k - sbr->kx[1]] = sum; + } + } + } + } +} + +/** + * Calculation of levels of additional HF signal components (14496-3 sp04 p219) + * and Calculation of gain (14496-3 sp04 p219) + */ +static void sbr_gain_calc(AACContext *ac, SpectralBandReplication *sbr, + SBRData *ch_data, const int e_a[2]) +{ + int e, k, m; + // max gain limits : -3dB, 0dB, 3dB, inf dB (limiter off) + static const float limgain[4] = { 0.70795, 1.0, 1.41254, 10000000000 }; + + for (e = 0; e < ch_data->bs_num_env; e++) { + int delta = !((e == e_a[1]) || (e == e_a[0])); + for (k = 0; k < sbr->n_lim; k++) { + float gain_boost, gain_max; + float sum[2] = { 0.0f, 0.0f }; + for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) { + const float temp = sbr->e_origmapped[e][m] / (1.0f + sbr->q_mapped[e][m]); + sbr->q_m[e][m] = sqrtf(temp * sbr->q_mapped[e][m]); + sbr->s_m[e][m] = sqrtf(temp * ch_data->s_indexmapped[e + 1][m]); + if (!sbr->s_mapped[e][m]) { + sbr->gain[e][m] = sqrtf(sbr->e_origmapped[e][m] / + ((1.0f + sbr->e_curr[e][m]) * + (1.0f + sbr->q_mapped[e][m] * delta))); + } else { + sbr->gain[e][m] = sqrtf(sbr->e_origmapped[e][m] * sbr->q_mapped[e][m] / + ((1.0f + sbr->e_curr[e][m]) * + (1.0f + sbr->q_mapped[e][m]))); + } + } + for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) { + sum[0] += sbr->e_origmapped[e][m]; + sum[1] += sbr->e_curr[e][m]; + } + gain_max = limgain[sbr->bs_limiter_gains] * sqrtf((FLT_EPSILON + sum[0]) / (FLT_EPSILON + sum[1])); + gain_max = FFMIN(100000.f, gain_max); + for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) { + float q_m_max = sbr->q_m[e][m] * gain_max / sbr->gain[e][m]; + sbr->q_m[e][m] = FFMIN(sbr->q_m[e][m], q_m_max); + sbr->gain[e][m] = FFMIN(sbr->gain[e][m], gain_max); + } + sum[0] = sum[1] = 0.0f; + for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) { + sum[0] += sbr->e_origmapped[e][m]; + sum[1] += sbr->e_curr[e][m] * sbr->gain[e][m] * sbr->gain[e][m] + + sbr->s_m[e][m] * sbr->s_m[e][m] + + (delta && !sbr->s_m[e][m]) * sbr->q_m[e][m] * sbr->q_m[e][m]; + } + gain_boost = sqrtf((FLT_EPSILON + sum[0]) / (FLT_EPSILON + sum[1])); + gain_boost = FFMIN(1.584893192f, gain_boost); + for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) { + sbr->gain[e][m] *= gain_boost; + sbr->q_m[e][m] *= gain_boost; + sbr->s_m[e][m] *= gain_boost; + } + } + } +} + +/// Assembling HF Signals (14496-3 sp04 p220) +static void sbr_hf_assemble(float Y[2][38][64][2], const float X_high[64][40][2], + SpectralBandReplication *sbr, SBRData *ch_data, + const int e_a[2]) +{ + int e, i, j, m; + const int h_SL = 4 * !sbr->bs_smoothing_mode; + const int kx = sbr->kx[1]; + const int m_max = sbr->m[1]; + static const float h_smooth[5] = { + 0.33333333333333, + 0.30150283239582, + 0.21816949906249, + 0.11516383427084, + 0.03183050093751, + }; + static const int8_t phi[2][4] = { + { 1, 0, -1, 0}, // real + { 0, 1, 0, -1}, // imaginary + }; + float (*g_temp)[48] = ch_data->g_temp, (*q_temp)[48] = ch_data->q_temp; + int indexnoise = ch_data->f_indexnoise; + int indexsine = ch_data->f_indexsine; + memcpy(Y[0], Y[1], sizeof(Y[0])); + + if (sbr->reset) { + for (i = 0; i < h_SL; i++) { + memcpy(g_temp[i + 2*ch_data->t_env[0]], sbr->gain[0], m_max * sizeof(sbr->gain[0][0])); + memcpy(q_temp[i + 2*ch_data->t_env[0]], sbr->q_m[0], m_max * sizeof(sbr->q_m[0][0])); + } + } else if (h_SL) { + memcpy(g_temp[2*ch_data->t_env[0]], g_temp[2*ch_data->t_env_num_env_old], 4*sizeof(g_temp[0])); + memcpy(q_temp[2*ch_data->t_env[0]], q_temp[2*ch_data->t_env_num_env_old], 4*sizeof(q_temp[0])); + } + + for (e = 0; e < ch_data->bs_num_env; e++) { + for (i = 2 * ch_data->t_env[e]; i < 2 * ch_data->t_env[e + 1]; i++) { + memcpy(g_temp[h_SL + i], sbr->gain[e], m_max * sizeof(sbr->gain[0][0])); + memcpy(q_temp[h_SL + i], sbr->q_m[e], m_max * sizeof(sbr->q_m[0][0])); + } + } + + for (e = 0; e < ch_data->bs_num_env; e++) { + for (i = 2 * ch_data->t_env[e]; i < 2 * ch_data->t_env[e + 1]; i++) { + int phi_sign = (1 - 2*(kx & 1)); + + if (h_SL && e != e_a[0] && e != e_a[1]) { + for (m = 0; m < m_max; m++) { + const int idx1 = i + h_SL; + float g_filt = 0.0f; + for (j = 0; j <= h_SL; j++) + g_filt += g_temp[idx1 - j][m] * h_smooth[j]; + Y[1][i][m + kx][0] = + X_high[m + kx][i + ENVELOPE_ADJUSTMENT_OFFSET][0] * g_filt; + Y[1][i][m + kx][1] = + X_high[m + kx][i + ENVELOPE_ADJUSTMENT_OFFSET][1] * g_filt; + } + } else { + for (m = 0; m < m_max; m++) { + const float g_filt = g_temp[i + h_SL][m]; + Y[1][i][m + kx][0] = + X_high[m + kx][i + ENVELOPE_ADJUSTMENT_OFFSET][0] * g_filt; + Y[1][i][m + kx][1] = + X_high[m + kx][i + ENVELOPE_ADJUSTMENT_OFFSET][1] * g_filt; + } + } + + if (e != e_a[0] && e != e_a[1]) { + for (m = 0; m < m_max; m++) { + indexnoise = (indexnoise + 1) & 0x1ff; + if (sbr->s_m[e][m]) { + Y[1][i][m + kx][0] += + sbr->s_m[e][m] * phi[0][indexsine]; + Y[1][i][m + kx][1] += + sbr->s_m[e][m] * (phi[1][indexsine] * phi_sign); + } else { + float q_filt; + if (h_SL) { + const int idx1 = i + h_SL; + q_filt = 0.0f; + for (j = 0; j <= h_SL; j++) + q_filt += q_temp[idx1 - j][m] * h_smooth[j]; + } else { + q_filt = q_temp[i][m]; + } + Y[1][i][m + kx][0] += + q_filt * sbr_noise_table[indexnoise][0]; + Y[1][i][m + kx][1] += + q_filt * sbr_noise_table[indexnoise][1]; + } + phi_sign = -phi_sign; + } + } else { + indexnoise = (indexnoise + m_max) & 0x1ff; + for (m = 0; m < m_max; m++) { + Y[1][i][m + kx][0] += + sbr->s_m[e][m] * phi[0][indexsine]; + Y[1][i][m + kx][1] += + sbr->s_m[e][m] * (phi[1][indexsine] * phi_sign); + phi_sign = -phi_sign; + } + } + indexsine = (indexsine + 1) & 3; + } + } + ch_data->f_indexnoise = indexnoise; + ch_data->f_indexsine = indexsine; +} + +void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac, + float* L, float* R) +{ + int downsampled = ac->m4ac.ext_sample_rate < sbr->sample_rate; + int ch; + int nch = (id_aac == TYPE_CPE) ? 2 : 1; + + if (sbr->start) { + sbr_dequant(sbr, id_aac); + } + for (ch = 0; ch < nch; ch++) { + /* decode channel */ + sbr_qmf_analysis(&ac->dsp, &sbr->mdct_ana, ch ? R : L, sbr->data[ch].analysis_filterbank_samples, + (float*)sbr->qmf_filter_scratch, + sbr->data[ch].W, 1/(-1024 * ac->sf_scale)); + sbr_lf_gen(ac, sbr, sbr->X_low, sbr->data[ch].W); + if (sbr->start) { + sbr_hf_inverse_filter(sbr->alpha0, sbr->alpha1, sbr->X_low, sbr->k[0]); + sbr_chirp(sbr, &sbr->data[ch]); + sbr_hf_gen(ac, sbr, sbr->X_high, sbr->X_low, sbr->alpha0, sbr->alpha1, + sbr->data[ch].bw_array, sbr->data[ch].t_env, + sbr->data[ch].bs_num_env); + + // hf_adj + sbr_mapping(ac, sbr, &sbr->data[ch], sbr->data[ch].e_a); + sbr_env_estimate(sbr->e_curr, sbr->X_high, sbr, &sbr->data[ch]); + sbr_gain_calc(ac, sbr, &sbr->data[ch], sbr->data[ch].e_a); + sbr_hf_assemble(sbr->data[ch].Y, sbr->X_high, sbr, &sbr->data[ch], + sbr->data[ch].e_a); + } + + /* synthesis */ + sbr_x_gen(sbr, sbr->X[ch], sbr->X_low, sbr->data[ch].Y, ch); + } + + if (ac->m4ac.ps == 1) { + if (sbr->ps.start) { + ff_ps_apply(ac->avctx, &sbr->ps, sbr->X[0], sbr->X[1], sbr->kx[1] + sbr->m[1]); + } else { + memcpy(sbr->X[1], sbr->X[0], sizeof(sbr->X[0])); + } + nch = 2; + } + + sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, L, sbr->X[0], sbr->qmf_filter_scratch, + sbr->data[0].synthesis_filterbank_samples, + &sbr->data[0].synthesis_filterbank_samples_offset, + downsampled); + if (nch == 2) + sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, R, sbr->X[1], sbr->qmf_filter_scratch, + sbr->data[1].synthesis_filterbank_samples, + &sbr->data[1].synthesis_filterbank_samples_offset, + downsampled); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacsbr.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacsbr.h new file mode 100644 index 00000000..6b10ed43 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacsbr.h @@ -0,0 +1,49 @@ +/* + * AAC Spectral Band Replication function declarations + * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl ) + * Copyright (c) 2010 Alex Converse + * + * 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 + * AAC Spectral Band Replication function declarations + * @author Robert Swain ( rob opendot cl ) + */ + +#ifndef AVCODEC_AACSBR_H +#define AVCODEC_AACSBR_H + +#include "get_bits.h" +#include "aac.h" +#include "sbr.h" + +/** Initialize SBR. */ +av_cold void ff_aac_sbr_init(void); +/** Initialize one SBR context. */ +av_cold void ff_aac_sbr_ctx_init(SpectralBandReplication *sbr); +/** Close one SBR context. */ +av_cold void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr); +/** Decode one SBR element. */ +int ff_decode_sbr_extension(AACContext *ac, SpectralBandReplication *sbr, + GetBitContext *gb, int crc, int cnt, int id_aac); +/** Apply one SBR element to one AAC element. */ +void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac, + float* L, float *R); + +#endif /* AVCODEC_AACSBR_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacsbrdata.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacsbrdata.h new file mode 100644 index 00000000..5d33a608 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aacsbrdata.h @@ -0,0 +1,614 @@ +/* + * AAC Spectral Band Replication decoding data + * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl ) + * + * 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 + * AAC Spectral Band Replication decoding data + * @author Robert Swain ( rob opendot cl ) + */ + +#ifndef AVCODEC_AACSBRDATA_H +#define AVCODEC_AACSBRDATA_H + +#include +#include "libavutil/mem.h" + +///< Huffman tables for SBR + +static const uint8_t t_huffman_env_1_5dB_bits[121] = { + 18, 18, 18, 18, 18, 18, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 17, 18, 16, 17, 18, 17, + 16, 16, 16, 16, 15, 14, 14, 13, + 13, 12, 11, 10, 9, 8, 7, 6, + 5, 4, 3, 2, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 12, 13, 14, + 14, 15, 16, 17, 16, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, +}; + +static const uint32_t t_huffman_env_1_5dB_codes[121] = { + 0x3ffd6, 0x3ffd7, 0x3ffd8, 0x3ffd9, 0x3ffda, 0x3ffdb, 0x7ffb8, 0x7ffb9, + 0x7ffba, 0x7ffbb, 0x7ffbc, 0x7ffbd, 0x7ffbe, 0x7ffbf, 0x7ffc0, 0x7ffc1, + 0x7ffc2, 0x7ffc3, 0x7ffc4, 0x7ffc5, 0x7ffc6, 0x7ffc7, 0x7ffc8, 0x7ffc9, + 0x7ffca, 0x7ffcb, 0x7ffcc, 0x7ffcd, 0x7ffce, 0x7ffcf, 0x7ffd0, 0x7ffd1, + 0x7ffd2, 0x7ffd3, 0x1ffe6, 0x3ffd4, 0x0fff0, 0x1ffe9, 0x3ffd5, 0x1ffe7, + 0x0fff1, 0x0ffec, 0x0ffed, 0x0ffee, 0x07ff4, 0x03ff9, 0x03ff7, 0x01ffa, + 0x01ff9, 0x00ffb, 0x007fc, 0x003fc, 0x001fd, 0x000fd, 0x0007d, 0x0003d, + 0x0001d, 0x0000d, 0x00005, 0x00001, 0x00000, 0x00004, 0x0000c, 0x0001c, + 0x0003c, 0x0007c, 0x000fc, 0x001fc, 0x003fd, 0x00ffa, 0x01ff8, 0x03ff6, + 0x03ff8, 0x07ff5, 0x0ffef, 0x1ffe8, 0x0fff2, 0x7ffd4, 0x7ffd5, 0x7ffd6, + 0x7ffd7, 0x7ffd8, 0x7ffd9, 0x7ffda, 0x7ffdb, 0x7ffdc, 0x7ffdd, 0x7ffde, + 0x7ffdf, 0x7ffe0, 0x7ffe1, 0x7ffe2, 0x7ffe3, 0x7ffe4, 0x7ffe5, 0x7ffe6, + 0x7ffe7, 0x7ffe8, 0x7ffe9, 0x7ffea, 0x7ffeb, 0x7ffec, 0x7ffed, 0x7ffee, + 0x7ffef, 0x7fff0, 0x7fff1, 0x7fff2, 0x7fff3, 0x7fff4, 0x7fff5, 0x7fff6, + 0x7fff7, 0x7fff8, 0x7fff9, 0x7fffa, 0x7fffb, 0x7fffc, 0x7fffd, 0x7fffe, + 0x7ffff, +}; + +static const uint8_t f_huffman_env_1_5dB_bits[121] = { + 19, 19, 20, 20, 20, 20, 20, 20, + 20, 19, 20, 20, 20, 20, 19, 20, + 19, 19, 20, 18, 20, 20, 20, 19, + 20, 20, 20, 19, 20, 19, 18, 19, + 18, 18, 17, 18, 17, 17, 17, 16, + 16, 16, 15, 15, 14, 13, 13, 12, + 12, 11, 10, 9, 9, 8, 7, 6, + 5, 4, 3, 2, 2, 3, 4, 5, + 6, 8, 8, 9, 10, 11, 11, 11, + 12, 12, 13, 13, 14, 14, 16, 16, + 17, 17, 18, 18, 18, 18, 18, 18, + 18, 20, 19, 20, 20, 20, 20, 20, + 20, 19, 20, 20, 20, 20, 19, 20, + 18, 20, 20, 19, 19, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, + 20, +}; + +static const uint32_t f_huffman_env_1_5dB_codes[121] = { + 0x7ffe7, 0x7ffe8, 0xfffd2, 0xfffd3, 0xfffd4, 0xfffd5, 0xfffd6, 0xfffd7, + 0xfffd8, 0x7ffda, 0xfffd9, 0xfffda, 0xfffdb, 0xfffdc, 0x7ffdb, 0xfffdd, + 0x7ffdc, 0x7ffdd, 0xfffde, 0x3ffe4, 0xfffdf, 0xfffe0, 0xfffe1, 0x7ffde, + 0xfffe2, 0xfffe3, 0xfffe4, 0x7ffdf, 0xfffe5, 0x7ffe0, 0x3ffe8, 0x7ffe1, + 0x3ffe0, 0x3ffe9, 0x1ffef, 0x3ffe5, 0x1ffec, 0x1ffed, 0x1ffee, 0x0fff4, + 0x0fff3, 0x0fff0, 0x07ff7, 0x07ff6, 0x03ffa, 0x01ffa, 0x01ff9, 0x00ffa, + 0x00ff8, 0x007f9, 0x003fb, 0x001fc, 0x001fa, 0x000fb, 0x0007c, 0x0003c, + 0x0001c, 0x0000c, 0x00005, 0x00001, 0x00000, 0x00004, 0x0000d, 0x0001d, + 0x0003d, 0x000fa, 0x000fc, 0x001fb, 0x003fa, 0x007f8, 0x007fa, 0x007fb, + 0x00ff9, 0x00ffb, 0x01ff8, 0x01ffb, 0x03ff8, 0x03ff9, 0x0fff1, 0x0fff2, + 0x1ffea, 0x1ffeb, 0x3ffe1, 0x3ffe2, 0x3ffea, 0x3ffe3, 0x3ffe6, 0x3ffe7, + 0x3ffeb, 0xfffe6, 0x7ffe2, 0xfffe7, 0xfffe8, 0xfffe9, 0xfffea, 0xfffeb, + 0xfffec, 0x7ffe3, 0xfffed, 0xfffee, 0xfffef, 0xffff0, 0x7ffe4, 0xffff1, + 0x3ffec, 0xffff2, 0xffff3, 0x7ffe5, 0x7ffe6, 0xffff4, 0xffff5, 0xffff6, + 0xffff7, 0xffff8, 0xffff9, 0xffffa, 0xffffb, 0xffffc, 0xffffd, 0xffffe, + 0xfffff, +}; + +static const uint8_t t_huffman_env_bal_1_5dB_bits[49] = { + 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 12, 11, 9, 7, 5, 3, + 1, 2, 4, 6, 8, 11, 12, 15, + 16, 16, 16, 16, 16, 16, 16, 17, + 17, 17, 17, 17, 17, 17, 17, 17, + 17, +}; + +static const uint32_t t_huffman_env_bal_1_5dB_codes[49] = { + 0x0ffe4, 0x0ffe5, 0x0ffe6, 0x0ffe7, 0x0ffe8, 0x0ffe9, 0x0ffea, 0x0ffeb, + 0x0ffec, 0x0ffed, 0x0ffee, 0x0ffef, 0x0fff0, 0x0fff1, 0x0fff2, 0x0fff3, + 0x0fff4, 0x0ffe2, 0x00ffc, 0x007fc, 0x001fe, 0x0007e, 0x0001e, 0x00006, + 0x00000, 0x00002, 0x0000e, 0x0003e, 0x000fe, 0x007fd, 0x00ffd, 0x07ff0, + 0x0ffe3, 0x0fff5, 0x0fff6, 0x0fff7, 0x0fff8, 0x0fff9, 0x0fffa, 0x1fff6, + 0x1fff7, 0x1fff8, 0x1fff9, 0x1fffa, 0x1fffb, 0x1fffc, 0x1fffd, 0x1fffe, + 0x1ffff, +}; + +static const uint8_t f_huffman_env_bal_1_5dB_bits[49] = { + 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 16, + 17, 14, 11, 11, 8, 7, 4, 2, + 1, 3, 5, 6, 9, 11, 12, 15, + 16, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 19, + 19, +}; + +static const uint32_t f_huffman_env_bal_1_5dB_codes[49] = { + 0x3ffe2, 0x3ffe3, 0x3ffe4, 0x3ffe5, 0x3ffe6, 0x3ffe7, 0x3ffe8, 0x3ffe9, + 0x3ffea, 0x3ffeb, 0x3ffec, 0x3ffed, 0x3ffee, 0x3ffef, 0x3fff0, 0x0fff7, + 0x1fff0, 0x03ffc, 0x007fe, 0x007fc, 0x000fe, 0x0007e, 0x0000e, 0x00002, + 0x00000, 0x00006, 0x0001e, 0x0003e, 0x001fe, 0x007fd, 0x00ffe, 0x07ffa, + 0x0fff6, 0x3fff1, 0x3fff2, 0x3fff3, 0x3fff4, 0x3fff5, 0x3fff6, 0x3fff7, + 0x3fff8, 0x3fff9, 0x3fffa, 0x3fffb, 0x3fffc, 0x3fffd, 0x3fffe, 0x7fffe, + 0x7ffff, +}; + +static const uint8_t t_huffman_env_3_0dB_bits[63] = { + 18, 18, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 17, 16, 16, 16, 14, 14, 14, + 13, 12, 11, 8, 6, 4, 2, 1, + 3, 5, 7, 9, 11, 13, 14, 14, + 15, 16, 17, 18, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, +}; + +static const uint32_t t_huffman_env_3_0dB_codes[63] = { + 0x3ffed, 0x3ffee, 0x7ffde, 0x7ffdf, 0x7ffe0, 0x7ffe1, 0x7ffe2, 0x7ffe3, + 0x7ffe4, 0x7ffe5, 0x7ffe6, 0x7ffe7, 0x7ffe8, 0x7ffe9, 0x7ffea, 0x7ffeb, + 0x7ffec, 0x1fff4, 0x0fff7, 0x0fff9, 0x0fff8, 0x03ffb, 0x03ffa, 0x03ff8, + 0x01ffa, 0x00ffc, 0x007fc, 0x000fe, 0x0003e, 0x0000e, 0x00002, 0x00000, + 0x00006, 0x0001e, 0x0007e, 0x001fe, 0x007fd, 0x01ffb, 0x03ff9, 0x03ffc, + 0x07ffa, 0x0fff6, 0x1fff5, 0x3ffec, 0x7ffed, 0x7ffee, 0x7ffef, 0x7fff0, + 0x7fff1, 0x7fff2, 0x7fff3, 0x7fff4, 0x7fff5, 0x7fff6, 0x7fff7, 0x7fff8, + 0x7fff9, 0x7fffa, 0x7fffb, 0x7fffc, 0x7fffd, 0x7fffe, 0x7ffff, +}; + +static const uint8_t f_huffman_env_3_0dB_bits[63] = { + 20, 20, 20, 20, 20, 20, 20, 18, + 19, 19, 19, 19, 18, 18, 20, 19, + 17, 18, 17, 16, 16, 15, 14, 12, + 11, 10, 9, 8, 6, 4, 2, 1, + 3, 5, 8, 9, 10, 11, 12, 13, + 14, 15, 15, 16, 16, 17, 17, 18, + 18, 18, 20, 19, 19, 19, 20, 19, + 19, 20, 20, 20, 20, 20, 20, +}; + +static const uint32_t f_huffman_env_3_0dB_codes[63] = { + 0xffff0, 0xffff1, 0xffff2, 0xffff3, 0xffff4, 0xffff5, 0xffff6, 0x3fff3, + 0x7fff5, 0x7ffee, 0x7ffef, 0x7fff6, 0x3fff4, 0x3fff2, 0xffff7, 0x7fff0, + 0x1fff5, 0x3fff0, 0x1fff4, 0x0fff7, 0x0fff6, 0x07ff8, 0x03ffb, 0x00ffd, + 0x007fd, 0x003fd, 0x001fd, 0x000fd, 0x0003e, 0x0000e, 0x00002, 0x00000, + 0x00006, 0x0001e, 0x000fc, 0x001fc, 0x003fc, 0x007fc, 0x00ffc, 0x01ffc, + 0x03ffa, 0x07ff9, 0x07ffa, 0x0fff8, 0x0fff9, 0x1fff6, 0x1fff7, 0x3fff5, + 0x3fff6, 0x3fff1, 0xffff8, 0x7fff1, 0x7fff2, 0x7fff3, 0xffff9, 0x7fff7, + 0x7fff4, 0xffffa, 0xffffb, 0xffffc, 0xffffd, 0xffffe, 0xfffff, +}; + +static const uint8_t t_huffman_env_bal_3_0dB_bits[25] = { + 13, 13, 13, 13, 13, 13, 13, 12, + 8, 7, 4, 3, 1, 2, 5, 6, + 9, 13, 13, 13, 13, 13, 13, 14, + 14, +}; + +static const uint16_t t_huffman_env_bal_3_0dB_codes[25] = { + 0x1ff2, 0x1ff3, 0x1ff4, 0x1ff5, 0x1ff6, 0x1ff7, 0x1ff8, 0x0ff8, + 0x00fe, 0x007e, 0x000e, 0x0006, 0x0000, 0x0002, 0x001e, 0x003e, + 0x01fe, 0x1ff9, 0x1ffa, 0x1ffb, 0x1ffc, 0x1ffd, 0x1ffe, 0x3ffe, + 0x3fff, +}; + +static const uint8_t f_huffman_env_bal_3_0dB_bits[25] = { + 13, 13, 13, 13, 13, 14, 14, 11, + 8, 7, 4, 2, 1, 3, 5, 6, + 9, 12, 13, 14, 14, 14, 14, 14, + 14, +}; + +static const uint16_t f_huffman_env_bal_3_0dB_codes[25] = { + 0x1ff7, 0x1ff8, 0x1ff9, 0x1ffa, 0x1ffb, 0x3ff8, 0x3ff9, 0x07fc, + 0x00fe, 0x007e, 0x000e, 0x0002, 0x0000, 0x0006, 0x001e, 0x003e, + 0x01fe, 0x0ffa, 0x1ff6, 0x3ffa, 0x3ffb, 0x3ffc, 0x3ffd, 0x3ffe, + 0x3fff, +}; + +static const uint8_t t_huffman_noise_3_0dB_bits[63] = { + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 11, 8, 6, 4, 3, 1, + 2, 5, 8, 10, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 14, 14, +}; + +static const uint16_t t_huffman_noise_3_0dB_codes[63] = { + 0x1fce, 0x1fcf, 0x1fd0, 0x1fd1, 0x1fd2, 0x1fd3, 0x1fd4, 0x1fd5, + 0x1fd6, 0x1fd7, 0x1fd8, 0x1fd9, 0x1fda, 0x1fdb, 0x1fdc, 0x1fdd, + 0x1fde, 0x1fdf, 0x1fe0, 0x1fe1, 0x1fe2, 0x1fe3, 0x1fe4, 0x1fe5, + 0x1fe6, 0x1fe7, 0x07f2, 0x00fd, 0x003e, 0x000e, 0x0006, 0x0000, + 0x0002, 0x001e, 0x00fc, 0x03f8, 0x1fcc, 0x1fe8, 0x1fe9, 0x1fea, + 0x1feb, 0x1fec, 0x1fcd, 0x1fed, 0x1fee, 0x1fef, 0x1ff0, 0x1ff1, + 0x1ff2, 0x1ff3, 0x1ff4, 0x1ff5, 0x1ff6, 0x1ff7, 0x1ff8, 0x1ff9, + 0x1ffa, 0x1ffb, 0x1ffc, 0x1ffd, 0x1ffe, 0x3ffe, 0x3fff, +}; + +static const uint8_t t_huffman_noise_bal_3_0dB_bits[25] = { + 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 5, 2, 1, 3, 6, 8, + 8, 8, 8, 8, 8, 8, 8, 8, + 8, +}; + +static const uint8_t t_huffman_noise_bal_3_0dB_codes[25] = { + 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0x1c, 0x02, 0x00, 0x06, 0x3a, 0xf6, + 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, + 0xff, +}; + +static const int8_t sbr_offset[6][16] = { + {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7}, // fs_sbr = 16000 Hz + {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13}, // fs_sbr = 22050 Hz + {-5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16}, // fs_sbr = 24000 Hz + {-6, -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16}, // fs_sbr = 32000 Hz + {-4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20}, // 44100 Hz <= fs_sbr <= 64000 Hz + {-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24}, // 64000 Hz < fs_sbr +}; + +///< window coefficients for analysis/synthesis QMF banks +static DECLARE_ALIGNED(16, float, sbr_qmf_window_ds)[320]; +static DECLARE_ALIGNED(16, float, sbr_qmf_window_us)[640] = { + 0.0000000000, -0.0005525286, -0.0005617692, -0.0004947518, + -0.0004875227, -0.0004893791, -0.0005040714, -0.0005226564, + -0.0005466565, -0.0005677802, -0.0005870930, -0.0006132747, + -0.0006312493, -0.0006540333, -0.0006777690, -0.0006941614, + -0.0007157736, -0.0007255043, -0.0007440941, -0.0007490598, + -0.0007681371, -0.0007724848, -0.0007834332, -0.0007779869, + -0.0007803664, -0.0007801449, -0.0007757977, -0.0007630793, + -0.0007530001, -0.0007319357, -0.0007215391, -0.0006917937, + -0.0006650415, -0.0006341594, -0.0005946118, -0.0005564576, + -0.0005145572, -0.0004606325, -0.0004095121, -0.0003501175, + -0.0002896981, -0.0002098337, -0.0001446380, -0.0000617334, + 0.0000134949, 0.0001094383, 0.0002043017, 0.0002949531, + 0.0004026540, 0.0005107388, 0.0006239376, 0.0007458025, + 0.0008608443, 0.0009885988, 0.0011250155, 0.0012577884, + 0.0013902494, 0.0015443219, 0.0016868083, 0.0018348265, + 0.0019841140, 0.0021461583, 0.0023017254, 0.0024625616, + 0.0026201758, 0.0027870464, 0.0029469447, 0.0031125420, + 0.0032739613, 0.0034418874, 0.0036008268, 0.0037603922, + 0.0039207432, 0.0040819753, 0.0042264269, 0.0043730719, + 0.0045209852, 0.0046606460, 0.0047932560, 0.0049137603, + 0.0050393022, 0.0051407353, 0.0052461166, 0.0053471681, + 0.0054196775, 0.0054876040, 0.0055475714, 0.0055938023, + 0.0056220643, 0.0056455196, 0.0056389199, 0.0056266114, + 0.0055917128, 0.0055404363, 0.0054753783, 0.0053838975, + 0.0052715758, 0.0051382275, 0.0049839687, 0.0048109469, + 0.0046039530, 0.0043801861, 0.0041251642, 0.0038456408, + 0.0035401246, 0.0032091885, 0.0028446757, 0.0024508540, + 0.0020274176, 0.0015784682, 0.0010902329, 0.0005832264, + 0.0000276045, -0.0005464280, -0.0011568135, -0.0018039472, + -0.0024826723, -0.0031933778, -0.0039401124, -0.0047222596, + -0.0055337211, -0.0063792293, -0.0072615816, -0.0081798233, + -0.0091325329, -0.0101150215, -0.0111315548, -0.0121849995, + 0.0132718220, 0.0143904666, 0.0155405553, 0.0167324712, + 0.0179433381, 0.0191872431, 0.0204531793, 0.0217467550, + 0.0230680169, 0.0244160992, 0.0257875847, 0.0271859429, + 0.0286072173, 0.0300502657, 0.0315017608, 0.0329754081, + 0.0344620948, 0.0359697560, 0.0374812850, 0.0390053679, + 0.0405349170, 0.0420649094, 0.0436097542, 0.0451488405, + 0.0466843027, 0.0482165720, 0.0497385755, 0.0512556155, + 0.0527630746, 0.0542452768, 0.0557173648, 0.0571616450, + 0.0585915683, 0.0599837480, 0.0613455171, 0.0626857808, + 0.0639715898, 0.0652247106, 0.0664367512, 0.0676075985, + 0.0687043828, 0.0697630244, 0.0707628710, 0.0717002673, + 0.0725682583, 0.0733620255, 0.0741003642, 0.0747452558, + 0.0753137336, 0.0758008358, 0.0761992479, 0.0764992170, + 0.0767093490, 0.0768173975, 0.0768230011, 0.0767204924, + 0.0765050718, 0.0761748321, 0.0757305756, 0.0751576255, + 0.0744664394, 0.0736406005, 0.0726774642, 0.0715826364, + 0.0703533073, 0.0689664013, 0.0674525021, 0.0657690668, + 0.0639444805, 0.0619602779, 0.0598166570, 0.0575152691, + 0.0550460034, 0.0524093821, 0.0495978676, 0.0466303305, + 0.0434768782, 0.0401458278, 0.0366418116, 0.0329583930, + 0.0290824006, 0.0250307561, 0.0207997072, 0.0163701258, + 0.0117623832, 0.0069636862, 0.0019765601, -0.0032086896, + -0.0085711749, -0.0141288827, -0.0198834129, -0.0258227288, + -0.0319531274, -0.0382776572, -0.0447806821, -0.0514804176, + -0.0583705326, -0.0654409853, -0.0726943300, -0.0801372934, + -0.0877547536, -0.0955533352, -0.1035329531, -0.1116826931, + -0.1200077984, -0.1285002850, -0.1371551761, -0.1459766491, + -0.1549607071, -0.1640958855, -0.1733808172, -0.1828172548, + -0.1923966745, -0.2021250176, -0.2119735853, -0.2219652696, + -0.2320690870, -0.2423016884, -0.2526480309, -0.2631053299, + -0.2736634040, -0.2843214189, -0.2950716717, -0.3059098575, + -0.3168278913, -0.3278113727, -0.3388722693, -0.3499914122, + 0.3611589903, 0.3723795546, 0.3836350013, 0.3949211761, + 0.4062317676, 0.4175696896, 0.4289119920, 0.4402553754, + 0.4515996535, 0.4629308085, 0.4742453214, 0.4855253091, + 0.4967708254, 0.5079817500, 0.5191234970, 0.5302240895, + 0.5412553448, 0.5522051258, 0.5630789140, 0.5738524131, + 0.5845403235, 0.5951123086, 0.6055783538, 0.6159109932, + 0.6261242695, 0.6361980107, 0.6461269695, 0.6559016302, + 0.6655139880, 0.6749663190, 0.6842353293, 0.6933282376, + 0.7022388719, 0.7109410426, 0.7194462634, 0.7277448900, + 0.7358211758, 0.7436827863, 0.7513137456, 0.7587080760, + 0.7658674865, 0.7727780881, 0.7794287519, 0.7858353120, + 0.7919735841, 0.7978466413, 0.8034485751, 0.8087695004, + 0.8138191270, 0.8185776004, 0.8230419890, 0.8272275347, + 0.8311038457, 0.8346937361, 0.8379717337, 0.8409541392, + 0.8436238281, 0.8459818469, 0.8480315777, 0.8497805198, + 0.8511971524, 0.8523047035, 0.8531020949, 0.8535720573, + 0.8537385600, +}; + +static const float sbr_noise_table[512][2] = { +{-0.99948153278296, -0.59483417516607}, { 0.97113454393991, -0.67528515225647}, +{ 0.14130051758487, -0.95090983575689}, {-0.47005496701697, -0.37340549728647}, +{ 0.80705063769351, 0.29653668284408}, {-0.38981478896926, 0.89572605717087}, +{-0.01053049862020, -0.66959058036166}, {-0.91266367957293, -0.11522938140034}, +{ 0.54840422910309, 0.75221367176302}, { 0.40009252867955, -0.98929400334421}, +{-0.99867974711855, -0.88147068645358}, {-0.95531076805040, 0.90908757154593}, +{-0.45725933317144, -0.56716323646760}, {-0.72929675029275, -0.98008272727324}, +{ 0.75622801399036, 0.20950329995549}, { 0.07069442601050, -0.78247898470706}, +{ 0.74496252926055, -0.91169004445807}, {-0.96440182703856, -0.94739918296622}, +{ 0.30424629369539, -0.49438267012479}, { 0.66565033746925, 0.64652935542491}, +{ 0.91697008020594, 0.17514097332009}, {-0.70774918760427, 0.52548653416543}, +{-0.70051415345560, -0.45340028808763}, {-0.99496513054797, -0.90071908066973}, +{ 0.98164490790123, -0.77463155528697}, {-0.54671580548181, -0.02570928536004}, +{-0.01689629065389, 0.00287506445732}, {-0.86110349531986, 0.42548583726477}, +{-0.98892980586032, -0.87881132267556}, { 0.51756627678691, 0.66926784710139}, +{-0.99635026409640, -0.58107730574765}, {-0.99969370862163, 0.98369989360250}, +{ 0.55266258627194, 0.59449057465591}, { 0.34581177741673, 0.94879421061866}, +{ 0.62664209577999, -0.74402970906471}, {-0.77149701404973, -0.33883658042801}, +{-0.91592244254432, 0.03687901376713}, {-0.76285492357887, -0.91371867919124}, +{ 0.79788337195331, -0.93180971199849}, { 0.54473080610200, -0.11919206037186}, +{-0.85639281671058, 0.42429854760451}, {-0.92882402971423, 0.27871809078609}, +{-0.11708371046774, -0.99800843444966}, { 0.21356749817493, -0.90716295627033}, +{-0.76191692573909, 0.99768118356265}, { 0.98111043100884, -0.95854459734407}, +{-0.85913269895572, 0.95766566168880}, {-0.93307242253692, 0.49431757696466}, +{ 0.30485754879632, -0.70540034357529}, { 0.85289650925190, 0.46766131791044}, +{ 0.91328082618125, -0.99839597361769}, {-0.05890199924154, 0.70741827819497}, +{ 0.28398686150148, 0.34633555702188}, { 0.95258164539612, -0.54893416026939}, +{-0.78566324168507, -0.75568541079691}, {-0.95789495447877, -0.20423194696966}, +{ 0.82411158711197, 0.96654618432562}, {-0.65185446735885, -0.88734990773289}, +{-0.93643603134666, 0.99870790442385}, { 0.91427159529618, -0.98290505544444}, +{-0.70395684036886, 0.58796798221039}, { 0.00563771969365, 0.61768196727244}, +{ 0.89065051931895, 0.52783352697585}, {-0.68683707712762, 0.80806944710339}, +{ 0.72165342518718, -0.69259857349564}, {-0.62928247730667, 0.13627037407335}, +{ 0.29938434065514, -0.46051329682246}, {-0.91781958879280, -0.74012716684186}, +{ 0.99298717043688, 0.40816610075661}, { 0.82368298622748, -0.74036047190173}, +{-0.98512833386833, -0.99972330709594}, {-0.95915368242257, -0.99237800466040}, +{-0.21411126572790, -0.93424819052545}, {-0.68821476106884, -0.26892306315457}, +{ 0.91851997982317, 0.09358228901785}, {-0.96062769559127, 0.36099095133739}, +{ 0.51646184922287, -0.71373332873917}, { 0.61130721139669, 0.46950141175917}, +{ 0.47336129371299, -0.27333178296162}, { 0.90998308703519, 0.96715662938132}, +{ 0.44844799194357, 0.99211574628306}, { 0.66614891079092, 0.96590176169121}, +{ 0.74922239129237, -0.89879858826087}, {-0.99571588506485, 0.52785521494349}, +{ 0.97401082477563, -0.16855870075190}, { 0.72683747733879, -0.48060774432251}, +{ 0.95432193457128, 0.68849603408441}, {-0.72962208425191, -0.76608443420917}, +{-0.85359479233537, 0.88738125901579}, {-0.81412430338535, -0.97480768049637}, +{-0.87930772356786, 0.74748307690436}, {-0.71573331064977, -0.98570608178923}, +{ 0.83524300028228, 0.83702537075163}, {-0.48086065601423, -0.98848504923531}, +{ 0.97139128574778, 0.80093621198236}, { 0.51992825347895, 0.80247631400510}, +{-0.00848591195325, -0.76670128000486}, {-0.70294374303036, 0.55359910445577}, +{-0.95894428168140, -0.43265504344783}, { 0.97079252950321, 0.09325857238682}, +{-0.92404293670797, 0.85507704027855}, {-0.69506469500450, 0.98633412625459}, +{ 0.26559203620024, 0.73314307966524}, { 0.28038443336943, 0.14537913654427}, +{-0.74138124825523, 0.99310339807762}, {-0.01752795995444, -0.82616635284178}, +{-0.55126773094930, -0.98898543862153}, { 0.97960898850996, -0.94021446752851}, +{-0.99196309146936, 0.67019017358456}, {-0.67684928085260, 0.12631491649378}, +{ 0.09140039465500, -0.20537731453108}, {-0.71658965751996, -0.97788200391224}, +{ 0.81014640078925, 0.53722648362443}, { 0.40616991671205, -0.26469008598449}, +{-0.67680188682972, 0.94502052337695}, { 0.86849774348749, -0.18333598647899}, +{-0.99500381284851, -0.02634122068550}, { 0.84329189340667, 0.10406957462213}, +{-0.09215968531446, 0.69540012101253}, { 0.99956173327206, -0.12358542001404}, +{-0.79732779473535, -0.91582524736159}, { 0.96349973642406, 0.96640458041000}, +{-0.79942778496547, 0.64323902822857}, {-0.11566039853896, 0.28587846253726}, +{-0.39922954514662, 0.94129601616966}, { 0.99089197565987, -0.92062625581587}, +{ 0.28631285179909, -0.91035047143603}, {-0.83302725605608, -0.67330410892084}, +{ 0.95404443402072, 0.49162765398743}, {-0.06449863579434, 0.03250560813135}, +{-0.99575054486311, 0.42389784469507}, {-0.65501142790847, 0.82546114655624}, +{-0.81254441908887, -0.51627234660629}, {-0.99646369485481, 0.84490533520752}, +{ 0.00287840603348, 0.64768261158166}, { 0.70176989408455, -0.20453028573322}, +{ 0.96361882270190, 0.40706967140989}, {-0.68883758192426, 0.91338958840772}, +{-0.34875585502238, 0.71472290693300}, { 0.91980081243087, 0.66507455644919}, +{-0.99009048343881, 0.85868021604848}, { 0.68865791458395, 0.55660316809678}, +{-0.99484402129368, -0.20052559254934}, { 0.94214511408023, -0.99696425367461}, +{-0.67414626793544, 0.49548221180078}, {-0.47339353684664, -0.85904328834047}, +{ 0.14323651387360, -0.94145598222488}, {-0.29268293575672, 0.05759224927952}, +{ 0.43793861458754, -0.78904969892724}, {-0.36345126374441, 0.64874435357162}, +{-0.08750604656825, 0.97686944362527}, {-0.96495267812511, -0.53960305946511}, +{ 0.55526940659947, 0.78891523734774}, { 0.73538215752630, 0.96452072373404}, +{-0.30889773919437, -0.80664389776860}, { 0.03574995626194, -0.97325616900959}, +{ 0.98720684660488, 0.48409133691962}, {-0.81689296271203, -0.90827703628298}, +{ 0.67866860118215, 0.81284503870856}, {-0.15808569732583, 0.85279555024382}, +{ 0.80723395114371, -0.24717418514605}, { 0.47788757329038, -0.46333147839295}, +{ 0.96367554763201, 0.38486749303242}, {-0.99143875716818, -0.24945277239809}, +{ 0.83081876925833, -0.94780851414763}, {-0.58753191905341, 0.01290772389163}, +{ 0.95538108220960, -0.85557052096538}, {-0.96490920476211, -0.64020970923102}, +{-0.97327101028521, 0.12378128133110}, { 0.91400366022124, 0.57972471346930}, +{-0.99925837363824, 0.71084847864067}, {-0.86875903507313, -0.20291699203564}, +{-0.26240034795124, -0.68264554369108}, {-0.24664412953388, -0.87642273115183}, +{ 0.02416275806869, 0.27192914288905}, { 0.82068619590515, -0.85087787994476}, +{ 0.88547373760759, -0.89636802901469}, {-0.18173078152226, -0.26152145156800}, +{ 0.09355476558534, 0.54845123045604}, {-0.54668414224090, 0.95980774020221}, +{ 0.37050990604091, -0.59910140383171}, {-0.70373594262891, 0.91227665827081}, +{-0.34600785879594, -0.99441426144200}, {-0.68774481731008, -0.30238837956299}, +{-0.26843291251234, 0.83115668004362}, { 0.49072334613242, -0.45359708737775}, +{ 0.38975993093975, 0.95515358099121}, {-0.97757125224150, 0.05305894580606}, +{-0.17325552859616, -0.92770672250494}, { 0.99948035025744, 0.58285545563426}, +{-0.64946246527458, 0.68645507104960}, {-0.12016920576437, -0.57147322153312}, +{-0.58947456517751, -0.34847132454388}, {-0.41815140454465, 0.16276422358861}, +{ 0.99885650204884, 0.11136095490444}, {-0.56649614128386, -0.90494866361587}, +{ 0.94138021032330, 0.35281916733018}, {-0.75725076534641, 0.53650549640587}, +{ 0.20541973692630, -0.94435144369918}, { 0.99980371023351, 0.79835913565599}, +{ 0.29078277605775, 0.35393777921520}, {-0.62858772103030, 0.38765693387102}, +{ 0.43440904467688, -0.98546330463232}, {-0.98298583762390, 0.21021524625209}, +{ 0.19513029146934, -0.94239832251867}, {-0.95476662400101, 0.98364554179143}, +{ 0.93379635304810, -0.70881994583682}, {-0.85235410573336, -0.08342347966410}, +{-0.86425093011245, -0.45795025029466}, { 0.38879779059045, 0.97274429344593}, +{ 0.92045124735495, -0.62433652524220}, { 0.89162532251878, 0.54950955570563}, +{-0.36834336949252, 0.96458298020975}, { 0.93891760988045, -0.89968353740388}, +{ 0.99267657565094, -0.03757034316958}, {-0.94063471614176, 0.41332338538963}, +{ 0.99740224117019, -0.16830494996370}, {-0.35899413170555, -0.46633226649613}, +{ 0.05237237274947, -0.25640361602661}, { 0.36703583957424, -0.38653265641875}, +{ 0.91653180367913, -0.30587628726597}, { 0.69000803499316, 0.90952171386132}, +{-0.38658751133527, 0.99501571208985}, {-0.29250814029851, 0.37444994344615}, +{-0.60182204677608, 0.86779651036123}, {-0.97418588163217, 0.96468523666475}, +{ 0.88461574003963, 0.57508405276414}, { 0.05198933055162, 0.21269661669964}, +{-0.53499621979720, 0.97241553731237}, {-0.49429560226497, 0.98183865291903}, +{-0.98935142339139, -0.40249159006933}, {-0.98081380091130, -0.72856895534041}, +{-0.27338148835532, 0.99950922447209}, { 0.06310802338302, -0.54539587529618}, +{-0.20461677199539, -0.14209977628489}, { 0.66223843141647, 0.72528579940326}, +{-0.84764345483665, 0.02372316801261}, {-0.89039863483811, 0.88866581484602}, +{ 0.95903308477986, 0.76744927173873}, { 0.73504123909879, -0.03747203173192}, +{-0.31744434966056, -0.36834111883652}, {-0.34110827591623, 0.40211222807691}, +{ 0.47803883714199, -0.39423219786288}, { 0.98299195879514, 0.01989791390047}, +{-0.30963073129751, -0.18076720599336}, { 0.99992588229018, -0.26281872094289}, +{-0.93149731080767, -0.98313162570490}, { 0.99923472302773, -0.80142993767554}, +{-0.26024169633417, -0.75999759855752}, {-0.35712514743563, 0.19298963768574}, +{-0.99899084509530, 0.74645156992493}, { 0.86557171579452, 0.55593866696299}, +{ 0.33408042438752, 0.86185953874709}, { 0.99010736374716, 0.04602397576623}, +{-0.66694269691195, -0.91643611810148}, { 0.64016792079480, 0.15649530836856}, +{ 0.99570534804836, 0.45844586038111}, {-0.63431466947340, 0.21079116459234}, +{-0.07706847005931, -0.89581437101329}, { 0.98590090577724, 0.88241721133981}, +{ 0.80099335254678, -0.36851896710853}, { 0.78368131392666, 0.45506999802597}, +{ 0.08707806671691, 0.80938994918745}, {-0.86811883080712, 0.39347308654705}, +{-0.39466529740375, -0.66809432114456}, { 0.97875325649683, -0.72467840967746}, +{-0.95038560288864, 0.89563219587625}, { 0.17005239424212, 0.54683053962658}, +{-0.76910792026848, -0.96226617549298}, { 0.99743281016846, 0.42697157037567}, +{ 0.95437383549973, 0.97002324109952}, { 0.99578905365569, -0.54106826257356}, +{ 0.28058259829990, -0.85361420634036}, { 0.85256524470573, -0.64567607735589}, +{-0.50608540105128, -0.65846015480300}, {-0.97210735183243, -0.23095213067791}, +{ 0.95424048234441, -0.99240147091219}, {-0.96926570524023, 0.73775654896574}, +{ 0.30872163214726, 0.41514960556126}, {-0.24523839572639, 0.63206633394807}, +{-0.33813265086024, -0.38661779441897}, {-0.05826828420146, -0.06940774188029}, +{-0.22898461455054, 0.97054853316316}, {-0.18509915019881, 0.47565762892084}, +{-0.10488238045009, -0.87769947402394}, {-0.71886586182037, 0.78030982480538}, +{ 0.99793873738654, 0.90041310491497}, { 0.57563307626120, -0.91034337352097}, +{ 0.28909646383717, 0.96307783970534}, { 0.42188998312520, 0.48148651230437}, +{ 0.93335049681047, -0.43537023883588}, {-0.97087374418267, 0.86636445711364}, +{ 0.36722871286923, 0.65291654172961}, {-0.81093025665696, 0.08778370229363}, +{-0.26240603062237, -0.92774095379098}, { 0.83996497984604, 0.55839849139647}, +{-0.99909615720225, -0.96024605713970}, { 0.74649464155061, 0.12144893606462}, +{-0.74774595569805, -0.26898062008959}, { 0.95781667469567, -0.79047927052628}, +{ 0.95472308713099, -0.08588776019550}, { 0.48708332746299, 0.99999041579432}, +{ 0.46332038247497, 0.10964126185063}, {-0.76497004940162, 0.89210929242238}, +{ 0.57397389364339, 0.35289703373760}, { 0.75374316974495, 0.96705214651335}, +{-0.59174397685714, -0.89405370422752}, { 0.75087906691890, -0.29612672982396}, +{-0.98607857336230, 0.25034911730023}, {-0.40761056640505, -0.90045573444695}, +{ 0.66929266740477, 0.98629493401748}, {-0.97463695257310, -0.00190223301301}, +{ 0.90145509409859, 0.99781390365446}, {-0.87259289048043, 0.99233587353666}, +{-0.91529461447692, -0.15698707534206}, {-0.03305738840705, -0.37205262859764}, +{ 0.07223051368337, -0.88805001733626}, { 0.99498012188353, 0.97094358113387}, +{-0.74904939500519, 0.99985483641521}, { 0.04585228574211, 0.99812337444082}, +{-0.89054954257993, -0.31791913188064}, {-0.83782144651251, 0.97637632547466}, +{ 0.33454804933804, -0.86231516800408}, {-0.99707579362824, 0.93237990079441}, +{-0.22827527843994, 0.18874759397997}, { 0.67248046289143, -0.03646211390569}, +{-0.05146538187944, -0.92599700120679}, { 0.99947295749905, 0.93625229707912}, +{ 0.66951124390363, 0.98905825623893}, {-0.99602956559179, -0.44654715757688}, +{ 0.82104905483590, 0.99540741724928}, { 0.99186510988782, 0.72023001312947}, +{-0.65284592392918, 0.52186723253637}, { 0.93885443798188, -0.74895312615259}, +{ 0.96735248738388, 0.90891816978629}, {-0.22225968841114, 0.57124029781228}, +{-0.44132783753414, -0.92688840659280}, {-0.85694974219574, 0.88844532719844}, +{ 0.91783042091762, -0.46356892383970}, { 0.72556974415690, -0.99899555770747}, +{-0.99711581834508, 0.58211560180426}, { 0.77638976371966, 0.94321834873819}, +{ 0.07717324253925, 0.58638399856595}, {-0.56049829194163, 0.82522301569036}, +{ 0.98398893639988, 0.39467440420569}, { 0.47546946844938, 0.68613044836811}, +{ 0.65675089314631, 0.18331637134880}, { 0.03273375457980, -0.74933109564108}, +{-0.38684144784738, 0.51337349030406}, {-0.97346267944545, -0.96549364384098}, +{-0.53282156061942, -0.91423265091354}, { 0.99817310731176, 0.61133572482148}, +{-0.50254500772635, -0.88829338134294}, { 0.01995873238855, 0.85223515096765}, +{ 0.99930381973804, 0.94578896296649}, { 0.82907767600783, -0.06323442598128}, +{-0.58660709669728, 0.96840773806582}, {-0.17573736667267, -0.48166920859485}, +{ 0.83434292401346, -0.13023450646997}, { 0.05946491307025, 0.20511047074866}, +{ 0.81505484574602, -0.94685947861369}, {-0.44976380954860, 0.40894572671545}, +{-0.89746474625671, 0.99846578838537}, { 0.39677256130792, -0.74854668609359}, +{-0.07588948563079, 0.74096214084170}, { 0.76343198951445, 0.41746629422634}, +{-0.74490104699626, 0.94725911744610}, { 0.64880119792759, 0.41336660830571}, +{ 0.62319537462542, -0.93098313552599}, { 0.42215817594807, -0.07712787385208}, +{ 0.02704554141885, -0.05417518053666}, { 0.80001773566818, 0.91542195141039}, +{-0.79351832348816, -0.36208897989136}, { 0.63872359151636, 0.08128252493444}, +{ 0.52890520960295, 0.60048872455592}, { 0.74238552914587, 0.04491915291044}, +{ 0.99096131449250, -0.19451182854402}, {-0.80412329643109, -0.88513818199457}, +{-0.64612616129736, 0.72198674804544}, { 0.11657770663191, -0.83662833815041}, +{-0.95053182488101, -0.96939905138082}, {-0.62228872928622, 0.82767262846661}, +{ 0.03004475787316, -0.99738896333384}, {-0.97987214341034, 0.36526129686425}, +{-0.99986980746200, -0.36021610299715}, { 0.89110648599879, -0.97894250343044}, +{ 0.10407960510582, 0.77357793811619}, { 0.95964737821728, -0.35435818285502}, +{ 0.50843233159162, 0.96107691266205}, { 0.17006334670615, -0.76854025314829}, +{ 0.25872675063360, 0.99893303933816}, {-0.01115998681937, 0.98496019742444}, +{-0.79598702973261, 0.97138411318894}, {-0.99264708948101, -0.99542822402536}, +{-0.99829663752818, 0.01877138824311}, {-0.70801016548184, 0.33680685948117}, +{-0.70467057786826, 0.93272777501857}, { 0.99846021905254, -0.98725746254433}, +{-0.63364968534650, -0.16473594423746}, {-0.16258217500792, -0.95939125400802}, +{-0.43645594360633, -0.94805030113284}, {-0.99848471702976, 0.96245166923809}, +{-0.16796458968998, -0.98987511890470}, {-0.87979225745213, -0.71725725041680}, +{ 0.44183099021786, -0.93568974498761}, { 0.93310180125532, -0.99913308068246}, +{-0.93941931782002, -0.56409379640356}, {-0.88590003188677, 0.47624600491382}, +{ 0.99971463703691, -0.83889954253462}, {-0.75376385639978, 0.00814643438625}, +{ 0.93887685615875, -0.11284528204636}, { 0.85126435782309, 0.52349251543547}, +{ 0.39701421446381, 0.81779634174316}, {-0.37024464187437, -0.87071656222959}, +{-0.36024828242896, 0.34655735648287}, {-0.93388812549209, -0.84476541096429}, +{-0.65298804552119, -0.18439575450921}, { 0.11960319006843, 0.99899346780168}, +{ 0.94292565553160, 0.83163906518293}, { 0.75081145286948, -0.35533223142265}, +{ 0.56721979748394, -0.24076836414499}, { 0.46857766746029, -0.30140233457198}, +{ 0.97312313923635, -0.99548191630031}, {-0.38299976567017, 0.98516909715427}, +{ 0.41025800019463, 0.02116736935734}, { 0.09638062008048, 0.04411984381457}, +{-0.85283249275397, 0.91475563922421}, { 0.88866808958124, -0.99735267083226}, +{-0.48202429536989, -0.96805608884164}, { 0.27572582416567, 0.58634753335832}, +{-0.65889129659168, 0.58835634138583}, { 0.98838086953732, 0.99994349600236}, +{-0.20651349620689, 0.54593044066355}, {-0.62126416356920, -0.59893681700392}, +{ 0.20320105410437, -0.86879180355289}, {-0.97790548600584, 0.96290806999242}, +{ 0.11112534735126, 0.21484763313301}, {-0.41368337314182, 0.28216837680365}, +{ 0.24133038992960, 0.51294362630238}, {-0.66393410674885, -0.08249679629081}, +{-0.53697829178752, -0.97649903936228}, {-0.97224737889348, 0.22081333579837}, +{ 0.87392477144549, -0.12796173740361}, { 0.19050361015753, 0.01602615387195}, +{-0.46353441212724, -0.95249041539006}, {-0.07064096339021, -0.94479803205886}, +{-0.92444085484466, -0.10457590187436}, {-0.83822593578728, -0.01695043208885}, +{ 0.75214681811150, -0.99955681042665}, {-0.42102998829339, 0.99720941999394}, +{-0.72094786237696, -0.35008961934255}, { 0.78843311019251, 0.52851398958271}, +{ 0.97394027897442, -0.26695944086561}, { 0.99206463477946, -0.57010120849429}, +{ 0.76789609461795, -0.76519356730966}, {-0.82002421836409, -0.73530179553767}, +{ 0.81924990025724, 0.99698425250579}, {-0.26719850873357, 0.68903369776193}, +{-0.43311260380975, 0.85321815947490}, { 0.99194979673836, 0.91876249766422}, +{-0.80692001248487, -0.32627540663214}, { 0.43080003649976, -0.21919095636638}, +{ 0.67709491937357, -0.95478075822906}, { 0.56151770568316, -0.70693811747778}, +{ 0.10831862810749, -0.08628837174592}, { 0.91229417540436, -0.65987351408410}, +{-0.48972893932274, 0.56289246362686}, {-0.89033658689697, -0.71656563987082}, +{ 0.65269447475094, 0.65916004833932}, { 0.67439478141121, -0.81684380846796}, +{-0.47770832416973, -0.16789556203025}, {-0.99715979260878, -0.93565784007648}, +{-0.90889593602546, 0.62034397054380}, {-0.06618622548177, -0.23812217221359}, +{ 0.99430266919728, 0.18812555317553}, { 0.97686402381843, -0.28664534366620}, +{ 0.94813650221268, -0.97506640027128}, {-0.95434497492853, -0.79607978501983}, +{-0.49104783137150, 0.32895214359663}, { 0.99881175120751, 0.88993983831354}, +{ 0.50449166760303, -0.85995072408434}, { 0.47162891065108, -0.18680204049569}, +{-0.62081581361840, 0.75000676218956}, {-0.43867015250812, 0.99998069244322}, +{ 0.98630563232075, -0.53578899600662}, {-0.61510362277374, -0.89515019899997}, +{-0.03841517601843, -0.69888815681179}, {-0.30102157304644, -0.07667808922205}, +{ 0.41881284182683, 0.02188098922282}, {-0.86135454941237, 0.98947480909359}, +{ 0.67226861393788, -0.13494389011014}, {-0.70737398842068, -0.76547349325992}, +{ 0.94044946687963, 0.09026201157416}, {-0.82386352534327, 0.08924768823676}, +{-0.32070666698656, 0.50143421908753}, { 0.57593163224487, -0.98966422921509}, +{-0.36326018419965, 0.07440243123228}, { 0.99979044674350, -0.14130287347405}, +{-0.92366023326932, -0.97979298068180}, {-0.44607178518598, -0.54233252016394}, +{ 0.44226800932956, 0.71326756742752}, { 0.03671907158312, 0.63606389366675}, +{ 0.52175424682195, -0.85396826735705}, {-0.94701139690956, -0.01826348194255}, +{-0.98759606946049, 0.82288714303073}, { 0.87434794743625, 0.89399495655433}, +{-0.93412041758744, 0.41374052024363}, { 0.96063943315511, 0.93116709541280}, +{ 0.97534253457837, 0.86150930812689}, { 0.99642466504163, 0.70190043427512}, +{-0.94705089665984, -0.29580042814306}, { 0.91599807087376, -0.98147830385781}, +}; + +#endif /* AVCODEC_AACSBRDATA_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc_fixed.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc_fixed.c new file mode 100644 index 00000000..90e148b9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc_fixed.c @@ -0,0 +1,440 @@ +/* + * The simplest AC-3 encoder + * Copyright (c) 2000 Fabrice Bellard + * Copyright (c) 2006-2010 Justin Ruggles + * Copyright (c) 2006-2010 Prakash Punnoor + * + * 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 + * fixed-point AC-3 encoder. + */ + +#undef CONFIG_AC3ENC_FLOAT +#include "ac3enc.c" + + +/** Scale a float value by 2^15, convert to an integer, and clip to range -32767..32767. */ +#define FIX15(a) av_clip(SCALE_FLOAT(a, 15), -32767, 32767) + + +/** + * Finalize MDCT and free allocated memory. + */ +static av_cold void mdct_end(AC3MDCTContext *mdct) +{ + mdct->nbits = 0; + av_freep(&mdct->costab); + av_freep(&mdct->sintab); + av_freep(&mdct->xcos1); + av_freep(&mdct->xsin1); + av_freep(&mdct->rot_tmp); + av_freep(&mdct->cplx_tmp); +} + + +/** + * Initialize FFT tables. + * @param ln log2(FFT size) + */ +static av_cold int fft_init(AVCodecContext *avctx, AC3MDCTContext *mdct, int ln) +{ + int i, n, n2; + float alpha; + + n = 1 << ln; + n2 = n >> 1; + + FF_ALLOC_OR_GOTO(avctx, mdct->costab, n2 * sizeof(*mdct->costab), fft_alloc_fail); + FF_ALLOC_OR_GOTO(avctx, mdct->sintab, n2 * sizeof(*mdct->sintab), fft_alloc_fail); + + for (i = 0; i < n2; i++) { + alpha = 2.0 * M_PI * i / n; + mdct->costab[i] = FIX15(cos(alpha)); + mdct->sintab[i] = FIX15(sin(alpha)); + } + + return 0; +fft_alloc_fail: + mdct_end(mdct); + return AVERROR(ENOMEM); +} + + +/** + * Initialize MDCT tables. + * @param nbits log2(MDCT size) + */ +static av_cold int mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct, + int nbits) +{ + int i, n, n4, ret; + + n = 1 << nbits; + n4 = n >> 2; + + mdct->nbits = nbits; + + ret = fft_init(avctx, mdct, nbits - 2); + if (ret) + return ret; + + mdct->window = ff_ac3_window; + + FF_ALLOC_OR_GOTO(avctx, mdct->xcos1, n4 * sizeof(*mdct->xcos1), mdct_alloc_fail); + FF_ALLOC_OR_GOTO(avctx, mdct->xsin1, n4 * sizeof(*mdct->xsin1), mdct_alloc_fail); + FF_ALLOC_OR_GOTO(avctx, mdct->rot_tmp, n * sizeof(*mdct->rot_tmp), mdct_alloc_fail); + FF_ALLOC_OR_GOTO(avctx, mdct->cplx_tmp, n4 * sizeof(*mdct->cplx_tmp), mdct_alloc_fail); + + for (i = 0; i < n4; i++) { + float alpha = 2.0 * M_PI * (i + 1.0 / 8.0) / n; + mdct->xcos1[i] = FIX15(-cos(alpha)); + mdct->xsin1[i] = FIX15(-sin(alpha)); + } + + return 0; +mdct_alloc_fail: + mdct_end(mdct); + return AVERROR(ENOMEM); +} + + +/** Butterfly op */ +#define BF(pre, pim, qre, qim, pre1, pim1, qre1, qim1) \ +{ \ + int ax, ay, bx, by; \ + bx = pre1; \ + by = pim1; \ + ax = qre1; \ + ay = qim1; \ + pre = (bx + ax) >> 1; \ + pim = (by + ay) >> 1; \ + qre = (bx - ax) >> 1; \ + qim = (by - ay) >> 1; \ +} + + +/** Complex multiply */ +#define CMUL(pre, pim, are, aim, bre, bim) \ +{ \ + pre = (MUL16(are, bre) - MUL16(aim, bim)) >> 15; \ + pim = (MUL16(are, bim) + MUL16(bre, aim)) >> 15; \ +} + + +/** + * Calculate a 2^n point complex FFT on 2^ln points. + * @param z complex input/output samples + * @param ln log2(FFT size) + */ +static void fft(AC3MDCTContext *mdct, IComplex *z, int ln) +{ + int j, l, np, np2; + int nblocks, nloops; + register IComplex *p,*q; + int tmp_re, tmp_im; + + np = 1 << ln; + + /* reverse */ + for (j = 0; j < np; j++) { + int k = av_reverse[j] >> (8 - ln); + if (k < j) + FFSWAP(IComplex, z[k], z[j]); + } + + /* pass 0 */ + + p = &z[0]; + j = np >> 1; + do { + BF(p[0].re, p[0].im, p[1].re, p[1].im, + p[0].re, p[0].im, p[1].re, p[1].im); + p += 2; + } while (--j); + + /* pass 1 */ + + p = &z[0]; + j = np >> 2; + do { + BF(p[0].re, p[0].im, p[2].re, p[2].im, + p[0].re, p[0].im, p[2].re, p[2].im); + BF(p[1].re, p[1].im, p[3].re, p[3].im, + p[1].re, p[1].im, p[3].im, -p[3].re); + p+=4; + } while (--j); + + /* pass 2 .. ln-1 */ + + nblocks = np >> 3; + nloops = 1 << 2; + np2 = np >> 1; + do { + p = z; + q = z + nloops; + for (j = 0; j < nblocks; j++) { + BF(p->re, p->im, q->re, q->im, + p->re, p->im, q->re, q->im); + p++; + q++; + for(l = nblocks; l < np2; l += nblocks) { + CMUL(tmp_re, tmp_im, mdct->costab[l], -mdct->sintab[l], q->re, q->im); + BF(p->re, p->im, q->re, q->im, + p->re, p->im, tmp_re, tmp_im); + p++; + q++; + } + p += nloops; + q += nloops; + } + nblocks = nblocks >> 1; + nloops = nloops << 1; + } while (nblocks); +} + + +/** + * Calculate a 512-point MDCT + * @param out 256 output frequency coefficients + * @param in 512 windowed input audio samples + */ +static void mdct512(AC3MDCTContext *mdct, int32_t *out, int16_t *in) +{ + int i, re, im, n, n2, n4; + int16_t *rot = mdct->rot_tmp; + IComplex *x = mdct->cplx_tmp; + + n = 1 << mdct->nbits; + n2 = n >> 1; + n4 = n >> 2; + + /* shift to simplify computations */ + for (i = 0; i > 1; + im = -((int)rot[n2+2*i] - (int)rot[n2-1-2*i]) >> 1; + CMUL(x[i].re, x[i].im, re, im, -mdct->xcos1[i], mdct->xsin1[i]); + } + + fft(mdct, x, mdct->nbits - 2); + + /* post rotation */ + for (i = 0; i < n4; i++) { + re = x[i].re; + im = x[i].im; + CMUL(out[n2-1-2*i], out[2*i], re, im, mdct->xsin1[i], mdct->xcos1[i]); + } +} + + +/** + * Apply KBD window to input samples prior to MDCT. + */ +static void apply_window(DSPContext *dsp, int16_t *output, const int16_t *input, + const int16_t *window, int n) +{ + int i; + int n2 = n >> 1; + + for (i = 0; i < n2; i++) { + output[i] = MUL16(input[i], window[i]) >> 15; + output[n-i-1] = MUL16(input[n-i-1], window[i]) >> 15; + } +} + + +/** + * Calculate the log2() of the maximum absolute value in an array. + * @param tab input array + * @param n number of values in the array + * @return log2(max(abs(tab[]))) + */ +static int log2_tab(int16_t *tab, int n) +{ + int i, v; + + v = 0; + for (i = 0; i < n; i++) + v |= abs(tab[i]); + + return av_log2(v); +} + + +/** + * Left-shift each value in an array by a specified amount. + * @param tab input array + * @param n number of values in the array + * @param lshift left shift amount. a negative value means right shift. + */ +static void lshift_tab(int16_t *tab, int n, int lshift) +{ + int i; + + if (lshift > 0) { + for (i = 0; i < n; i++) + tab[i] <<= lshift; + } else if (lshift < 0) { + lshift = -lshift; + for (i = 0; i < n; i++) + tab[i] >>= lshift; + } +} + + +/** + * Normalize the input samples to use the maximum available precision. + * This assumes signed 16-bit input samples. Exponents are reduced by 9 to + * match the 24-bit internal precision for MDCT coefficients. + * + * @return exponent shift + */ +static int normalize_samples(AC3EncodeContext *s) +{ + int v = 14 - log2_tab(s->windowed_samples, AC3_WINDOW_SIZE); + v = FFMAX(0, v); + lshift_tab(s->windowed_samples, AC3_WINDOW_SIZE, v); + return v - 9; +} + + +/** + * Scale MDCT coefficients from float to fixed-point. + */ +static void scale_coefficients(AC3EncodeContext *s) +{ + /* scaling/conversion is obviously not needed for the fixed-point encoder + since the coefficients are already fixed-point. */ + return; +} + + +#ifdef TEST +/*************************************************************************/ +/* TEST */ + +#include "libavutil/lfg.h" + +#define MDCT_NBITS 9 +#define MDCT_SAMPLES (1 << MDCT_NBITS) +#define FN (MDCT_SAMPLES/4) + + +static void fft_test(AC3MDCTContext *mdct, AVLFG *lfg) +{ + IComplex in[FN], in1[FN]; + int k, n, i; + float sum_re, sum_im, a; + + for (i = 0; i < FN; i++) { + in[i].re = av_lfg_get(lfg) % 65535 - 32767; + in[i].im = av_lfg_get(lfg) % 65535 - 32767; + in1[i] = in[i]; + } + fft(mdct, in, 7); + + /* do it by hand */ + for (k = 0; k < FN; k++) { + sum_re = 0; + sum_im = 0; + for (n = 0; n < FN; n++) { + a = -2 * M_PI * (n * k) / FN; + sum_re += in1[n].re * cos(a) - in1[n].im * sin(a); + sum_im += in1[n].re * sin(a) + in1[n].im * cos(a); + } + av_log(NULL, AV_LOG_DEBUG, "%3d: %6d,%6d %6.0f,%6.0f\n", + k, in[k].re, in[k].im, sum_re / FN, sum_im / FN); + } +} + + +static void mdct_test(AC3MDCTContext *mdct, AVLFG *lfg) +{ + int16_t input[MDCT_SAMPLES]; + int32_t output[AC3_MAX_COEFS]; + float input1[MDCT_SAMPLES]; + float output1[AC3_MAX_COEFS]; + float s, a, err, e, emax; + int i, k, n; + + for (i = 0; i < MDCT_SAMPLES; i++) { + input[i] = (av_lfg_get(lfg) % 65535 - 32767) * 9 / 10; + input1[i] = input[i]; + } + + mdct512(mdct, output, input); + + /* do it by hand */ + for (k = 0; k < AC3_MAX_COEFS; k++) { + s = 0; + for (n = 0; n < MDCT_SAMPLES; n++) { + a = (2*M_PI*(2*n+1+MDCT_SAMPLES/2)*(2*k+1) / (4 * MDCT_SAMPLES)); + s += input1[n] * cos(a); + } + output1[k] = -2 * s / MDCT_SAMPLES; + } + + err = 0; + emax = 0; + for (i = 0; i < AC3_MAX_COEFS; i++) { + av_log(NULL, AV_LOG_DEBUG, "%3d: %7d %7.0f\n", i, output[i], output1[i]); + e = output[i] - output1[i]; + if (e > emax) + emax = e; + err += e * e; + } + av_log(NULL, AV_LOG_DEBUG, "err2=%f emax=%f\n", err / AC3_MAX_COEFS, emax); +} + + +int main(void) +{ + AVLFG lfg; + AC3MDCTContext mdct; + + mdct.avctx = NULL; + av_log_set_level(AV_LOG_DEBUG); + mdct_init(&mdct, 9); + + fft_test(&mdct, &lfg); + mdct_test(&mdct, &lfg); + + return 0; +} +#endif /* TEST */ + + +AVCodec ff_ac3_fixed_encoder = { + "ac3_fixed", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_AC3, + sizeof(AC3EncodeContext), + ac3_encode_init, + ac3_encode_frame, + ac3_encode_close, + NULL, + .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE}, + .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), + .channel_layouts = ac3_channel_layouts, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc_fixed.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc_fixed.h new file mode 100644 index 00000000..12c8ace4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc_fixed.h @@ -0,0 +1,59 @@ +/* + * The simplest AC-3 encoder + * Copyright (c) 2000 Fabrice Bellard + * Copyright (c) 2006-2010 Justin Ruggles + * Copyright (c) 2006-2010 Prakash Punnoor + * + * 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 + * fixed-point AC-3 encoder header. + */ + +#ifndef AVCODEC_AC3ENC_FIXED_H +#define AVCODEC_AC3ENC_FIXED_H + +#include + + +typedef int16_t SampleType; +typedef int32_t CoefType; +typedef int64_t CoefSumType; + + +/** + * Compex number. + * Used in fixed-point MDCT calculation. + */ +typedef struct IComplex { + int16_t re,im; +} IComplex; + +typedef struct AC3MDCTContext { + const int16_t *window; ///< MDCT window function + int nbits; ///< log2(transform size) + int16_t *costab; ///< FFT cos table + int16_t *sintab; ///< FFT sin table + int16_t *xcos1; ///< MDCT cos table + int16_t *xsin1; ///< MDCT sin table + int16_t *rot_tmp; ///< temp buffer for pre-rotated samples + IComplex *cplx_tmp; ///< temp buffer for complex pre-rotated samples +} AC3MDCTContext; + +#endif /* AVCODEC_AC3ENC_FIXED_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc_float.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc_float.c new file mode 100644 index 00000000..8668b2e0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc_float.c @@ -0,0 +1,124 @@ +/* + * The simplest AC-3 encoder + * Copyright (c) 2000 Fabrice Bellard + * Copyright (c) 2006-2010 Justin Ruggles + * Copyright (c) 2006-2010 Prakash Punnoor + * + * 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 + * floating-point AC-3 encoder. + */ + +#define CONFIG_AC3ENC_FLOAT 1 +#include "ac3enc.c" + + +/** + * Finalize MDCT and free allocated memory. + */ +static av_cold void mdct_end(AC3MDCTContext *mdct) +{ + ff_mdct_end(&mdct->fft); + av_freep(&mdct->window); +} + + +/** + * Initialize MDCT tables. + * @param nbits log2(MDCT size) + */ +static av_cold int mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct, + int nbits) +{ + float *window; + int i, n, n2; + + n = 1 << nbits; + n2 = n >> 1; + + window = av_malloc(n * sizeof(*window)); + if (!window) { + av_log(avctx, AV_LOG_ERROR, "Cannot allocate memory.\n"); + return AVERROR(ENOMEM); + } + ff_kbd_window_init(window, 5.0, n2); + for (i = 0; i < n2; i++) + window[n-1-i] = window[i]; + mdct->window = window; + + return ff_mdct_init(&mdct->fft, nbits, 0, -2.0 / n); +} + + +/** + * Calculate a 512-point MDCT + * @param out 256 output frequency coefficients + * @param in 512 windowed input audio samples + */ +static void mdct512(AC3MDCTContext *mdct, float *out, float *in) +{ + ff_mdct_calc(&mdct->fft, out, in); +} + + +/** + * Apply KBD window to input samples prior to MDCT. + */ +static void apply_window(DSPContext *dsp, float *output, const float *input, + const float *window, int n) +{ + dsp->vector_fmul(output, input, window, n); +} + + +/** + * Normalize the input samples to use the maximum available precision. + */ +static int normalize_samples(AC3EncodeContext *s) +{ + /* Normalization is not needed for floating-point samples, so just return 0 */ + return 0; +} + + +/** + * Scale MDCT coefficients from float to 24-bit fixed-point. + */ +static void scale_coefficients(AC3EncodeContext *s) +{ + int i; + for (i = 0; i < AC3_MAX_COEFS * AC3_MAX_BLOCKS * s->channels; i++) + s->fixed_coef_buffer[i] = SCALE_FLOAT(s->mdct_coef_buffer[i], 24); +} + + +AVCodec ff_ac3_encoder = { + "ac3", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_AC3, + sizeof(AC3EncodeContext), + ac3_encode_init, + ac3_encode_frame, + ac3_encode_close, + NULL, + .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_FLT,AV_SAMPLE_FMT_NONE}, + .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), + .channel_layouts = ac3_channel_layouts, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc_float.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc_float.h new file mode 100644 index 00000000..1726ca04 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ac3enc_float.h @@ -0,0 +1,45 @@ +/* + * The simplest AC-3 encoder + * Copyright (c) 2000 Fabrice Bellard + * Copyright (c) 2006-2010 Justin Ruggles + * Copyright (c) 2006-2010 Prakash Punnoor + * + * 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 + * floating-point AC-3 encoder header. + */ + +#ifndef AVCODEC_AC3ENC_FLOAT_H +#define AVCODEC_AC3ENC_FLOAT_H + +#include "fft.h" + + +typedef float SampleType; +typedef float CoefType; +typedef float CoefSumType; + + +typedef struct AC3MDCTContext { + const float *window; ///< MDCT window function + FFTContext fft; ///< FFT context for MDCT calculation +} AC3MDCTContext; + +#endif /* AVCODEC_AC3ENC_FLOAT_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alpha/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alpha/Makefile new file mode 100644 index 00000000..2779a231 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alpha/Makefile @@ -0,0 +1,6 @@ +OBJS += alpha/dsputil_alpha.o \ + alpha/dsputil_alpha_asm.o \ + alpha/motion_est_alpha.o \ + alpha/motion_est_mvi_asm.o \ + alpha/mpegvideo_alpha.o \ + alpha/simple_idct_alpha.o \ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alpha/dsputil_alpha.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alpha/dsputil_alpha.h new file mode 100644 index 00000000..a3fa3dd5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alpha/dsputil_alpha.h @@ -0,0 +1,50 @@ +/* + * 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 + */ + +#ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H +#define AVCODEC_ALPHA_DSPUTIL_ALPHA_H + +#include "libavcodec/dsputil.h" + +void ff_simple_idct_axp(DCTELEM *block); +void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block); +void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block); + +void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels, + int line_size, int h); +void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, + int line_size); +void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, + int line_size); +extern void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, + int line_size); +extern void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, + int line_size); + +void get_pixels_mvi(DCTELEM *restrict block, + const uint8_t *restrict pixels, int line_size); +void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, + int stride); +int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); +int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); +int pix_abs16x16_x2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); +int pix_abs16x16_y2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); +int pix_abs16x16_xy2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); + + +#endif /* AVCODEC_ALPHA_DSPUTIL_ALPHA_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alsdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alsdec.c new file mode 100644 index 00000000..bfc589d2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/alsdec.c @@ -0,0 +1,1754 @@ +/* + * MPEG-4 ALS decoder + * Copyright (c) 2009 Thilo Borgmann + * + * 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 + * MPEG-4 ALS decoder + * @author Thilo Borgmann + */ + + +//#define DEBUG + + +#include "avcodec.h" +#include "get_bits.h" +#include "unary.h" +#include "mpeg4audio.h" +#include "bytestream.h" +#include "bgmc.h" +#include "dsputil.h" +#include "libavcore/samplefmt.h" +#include "libavutil/crc.h" + +#include + +/** Rice parameters and corresponding index offsets for decoding the + * indices of scaled PARCOR values. The table chosen is set globally + * by the encoder and stored in ALSSpecificConfig. + */ +static const int8_t parcor_rice_table[3][20][2] = { + { {-52, 4}, {-29, 5}, {-31, 4}, { 19, 4}, {-16, 4}, + { 12, 3}, { -7, 3}, { 9, 3}, { -5, 3}, { 6, 3}, + { -4, 3}, { 3, 3}, { -3, 2}, { 3, 2}, { -2, 2}, + { 3, 2}, { -1, 2}, { 2, 2}, { -1, 2}, { 2, 2} }, + { {-58, 3}, {-42, 4}, {-46, 4}, { 37, 5}, {-36, 4}, + { 29, 4}, {-29, 4}, { 25, 4}, {-23, 4}, { 20, 4}, + {-17, 4}, { 16, 4}, {-12, 4}, { 12, 3}, {-10, 4}, + { 7, 3}, { -4, 4}, { 3, 3}, { -1, 3}, { 1, 3} }, + { {-59, 3}, {-45, 5}, {-50, 4}, { 38, 4}, {-39, 4}, + { 32, 4}, {-30, 4}, { 25, 3}, {-23, 3}, { 20, 3}, + {-20, 3}, { 16, 3}, {-13, 3}, { 10, 3}, { -7, 3}, + { 3, 3}, { 0, 3}, { -1, 3}, { 2, 3}, { -1, 2} } +}; + + +/** Scaled PARCOR values used for the first two PARCOR coefficients. + * To be indexed by the Rice coded indices. + * Generated by: parcor_scaled_values[i] = 32 + ((i * (i+1)) << 7) - (1 << 20) + * Actual values are divided by 32 in order to be stored in 16 bits. + */ +static const int16_t parcor_scaled_values[] = { + -1048544 / 32, -1048288 / 32, -1047776 / 32, -1047008 / 32, + -1045984 / 32, -1044704 / 32, -1043168 / 32, -1041376 / 32, + -1039328 / 32, -1037024 / 32, -1034464 / 32, -1031648 / 32, + -1028576 / 32, -1025248 / 32, -1021664 / 32, -1017824 / 32, + -1013728 / 32, -1009376 / 32, -1004768 / 32, -999904 / 32, + -994784 / 32, -989408 / 32, -983776 / 32, -977888 / 32, + -971744 / 32, -965344 / 32, -958688 / 32, -951776 / 32, + -944608 / 32, -937184 / 32, -929504 / 32, -921568 / 32, + -913376 / 32, -904928 / 32, -896224 / 32, -887264 / 32, + -878048 / 32, -868576 / 32, -858848 / 32, -848864 / 32, + -838624 / 32, -828128 / 32, -817376 / 32, -806368 / 32, + -795104 / 32, -783584 / 32, -771808 / 32, -759776 / 32, + -747488 / 32, -734944 / 32, -722144 / 32, -709088 / 32, + -695776 / 32, -682208 / 32, -668384 / 32, -654304 / 32, + -639968 / 32, -625376 / 32, -610528 / 32, -595424 / 32, + -580064 / 32, -564448 / 32, -548576 / 32, -532448 / 32, + -516064 / 32, -499424 / 32, -482528 / 32, -465376 / 32, + -447968 / 32, -430304 / 32, -412384 / 32, -394208 / 32, + -375776 / 32, -357088 / 32, -338144 / 32, -318944 / 32, + -299488 / 32, -279776 / 32, -259808 / 32, -239584 / 32, + -219104 / 32, -198368 / 32, -177376 / 32, -156128 / 32, + -134624 / 32, -112864 / 32, -90848 / 32, -68576 / 32, + -46048 / 32, -23264 / 32, -224 / 32, 23072 / 32, + 46624 / 32, 70432 / 32, 94496 / 32, 118816 / 32, + 143392 / 32, 168224 / 32, 193312 / 32, 218656 / 32, + 244256 / 32, 270112 / 32, 296224 / 32, 322592 / 32, + 349216 / 32, 376096 / 32, 403232 / 32, 430624 / 32, + 458272 / 32, 486176 / 32, 514336 / 32, 542752 / 32, + 571424 / 32, 600352 / 32, 629536 / 32, 658976 / 32, + 688672 / 32, 718624 / 32, 748832 / 32, 779296 / 32, + 810016 / 32, 840992 / 32, 872224 / 32, 903712 / 32, + 935456 / 32, 967456 / 32, 999712 / 32, 1032224 / 32 +}; + + +/** Gain values of p(0) for long-term prediction. + * To be indexed by the Rice coded indices. + */ +static const uint8_t ltp_gain_values [4][4] = { + { 0, 8, 16, 24}, + {32, 40, 48, 56}, + {64, 70, 76, 82}, + {88, 92, 96, 100} +}; + + +/** Inter-channel weighting factors for multi-channel correlation. + * To be indexed by the Rice coded indices. + */ +static const int16_t mcc_weightings[] = { + 204, 192, 179, 166, 153, 140, 128, 115, + 102, 89, 76, 64, 51, 38, 25, 12, + 0, -12, -25, -38, -51, -64, -76, -89, + -102, -115, -128, -140, -153, -166, -179, -192 +}; + + +/** Tail codes used in arithmetic coding using block Gilbert-Moore codes. + */ +static const uint8_t tail_code[16][6] = { + { 74, 44, 25, 13, 7, 3}, + { 68, 42, 24, 13, 7, 3}, + { 58, 39, 23, 13, 7, 3}, + {126, 70, 37, 19, 10, 5}, + {132, 70, 37, 20, 10, 5}, + {124, 70, 38, 20, 10, 5}, + {120, 69, 37, 20, 11, 5}, + {116, 67, 37, 20, 11, 5}, + {108, 66, 36, 20, 10, 5}, + {102, 62, 36, 20, 10, 5}, + { 88, 58, 34, 19, 10, 5}, + {162, 89, 49, 25, 13, 7}, + {156, 87, 49, 26, 14, 7}, + {150, 86, 47, 26, 14, 7}, + {142, 84, 47, 26, 14, 7}, + {131, 79, 46, 26, 14, 7} +}; + + +enum RA_Flag { + RA_FLAG_NONE, + RA_FLAG_FRAMES, + RA_FLAG_HEADER +}; + + +typedef struct { + uint32_t samples; ///< number of samples, 0xFFFFFFFF if unknown + int resolution; ///< 000 = 8-bit; 001 = 16-bit; 010 = 24-bit; 011 = 32-bit + int floating; ///< 1 = IEEE 32-bit floating-point, 0 = integer + int msb_first; ///< 1 = original CRC calculated on big-endian system, 0 = little-endian + int frame_length; ///< frame length for each frame (last frame may differ) + int ra_distance; ///< distance between RA frames (in frames, 0...255) + enum RA_Flag ra_flag; ///< indicates where the size of ra units is stored + int adapt_order; ///< adaptive order: 1 = on, 0 = off + int coef_table; ///< table index of Rice code parameters + int long_term_prediction; ///< long term prediction (LTP): 1 = on, 0 = off + int max_order; ///< maximum prediction order (0..1023) + int block_switching; ///< number of block switching levels + int bgmc; ///< "Block Gilbert-Moore Code": 1 = on, 0 = off (Rice coding only) + int sb_part; ///< sub-block partition + int joint_stereo; ///< joint stereo: 1 = on, 0 = off + int mc_coding; ///< extended inter-channel coding (multi channel coding): 1 = on, 0 = off + int chan_config; ///< indicates that a chan_config_info field is present + int chan_sort; ///< channel rearrangement: 1 = on, 0 = off + int rlslms; ///< use "Recursive Least Square-Least Mean Square" predictor: 1 = on, 0 = off + int chan_config_info; ///< mapping of channels to loudspeaker locations. Unused until setting channel configuration is implemented. + int *chan_pos; ///< original channel positions + int crc_enabled; ///< enable Cyclic Redundancy Checksum +} ALSSpecificConfig; + + +typedef struct { + int stop_flag; + int master_channel; + int time_diff_flag; + int time_diff_sign; + int time_diff_index; + int weighting[6]; +} ALSChannelData; + + +typedef struct { + AVCodecContext *avctx; + ALSSpecificConfig sconf; + GetBitContext gb; + DSPContext dsp; + const AVCRC *crc_table; + uint32_t crc_org; ///< CRC value of the original input data + uint32_t crc; ///< CRC value calculated from decoded data + unsigned int cur_frame_length; ///< length of the current frame to decode + unsigned int frame_id; ///< the frame ID / number of the current frame + unsigned int js_switch; ///< if true, joint-stereo decoding is enforced + unsigned int num_blocks; ///< number of blocks used in the current frame + unsigned int s_max; ///< maximum Rice parameter allowed in entropy coding + uint8_t *bgmc_lut; ///< pointer at lookup tables used for BGMC + int *bgmc_lut_status; ///< pointer at lookup table status flags used for BGMC + int ltp_lag_length; ///< number of bits used for ltp lag value + int *const_block; ///< contains const_block flags for all channels + unsigned int *shift_lsbs; ///< contains shift_lsbs flags for all channels + unsigned int *opt_order; ///< contains opt_order flags for all channels + int *store_prev_samples; ///< contains store_prev_samples flags for all channels + int *use_ltp; ///< contains use_ltp flags for all channels + int *ltp_lag; ///< contains ltp lag values for all channels + int **ltp_gain; ///< gain values for ltp 5-tap filter for a channel + int *ltp_gain_buffer; ///< contains all gain values for ltp 5-tap filter + int32_t **quant_cof; ///< quantized parcor coefficients for a channel + int32_t *quant_cof_buffer; ///< contains all quantized parcor coefficients + int32_t **lpc_cof; ///< coefficients of the direct form prediction filter for a channel + int32_t *lpc_cof_buffer; ///< contains all coefficients of the direct form prediction filter + int32_t *lpc_cof_reversed_buffer; ///< temporary buffer to set up a reversed versio of lpc_cof_buffer + ALSChannelData **chan_data; ///< channel data for multi-channel correlation + ALSChannelData *chan_data_buffer; ///< contains channel data for all channels + int *reverted_channels; ///< stores a flag for each reverted channel + int32_t *prev_raw_samples; ///< contains unshifted raw samples from the previous block + int32_t **raw_samples; ///< decoded raw samples for each channel + int32_t *raw_buffer; ///< contains all decoded raw samples including carryover samples + uint8_t *crc_buffer; ///< buffer of byte order corrected samples used for CRC check +} ALSDecContext; + + +typedef struct { + unsigned int block_length; ///< number of samples within the block + unsigned int ra_block; ///< if true, this is a random access block + int *const_block; ///< if true, this is a constant value block + int js_blocks; ///< true if this block contains a difference signal + unsigned int *shift_lsbs; ///< shift of values for this block + unsigned int *opt_order; ///< prediction order of this block + int *store_prev_samples;///< if true, carryover samples have to be stored + int *use_ltp; ///< if true, long-term prediction is used + int *ltp_lag; ///< lag value for long-term prediction + int *ltp_gain; ///< gain values for ltp 5-tap filter + int32_t *quant_cof; ///< quantized parcor coefficients + int32_t *lpc_cof; ///< coefficients of the direct form prediction + int32_t *raw_samples; ///< decoded raw samples / residuals for this block + int32_t *prev_raw_samples; ///< contains unshifted raw samples from the previous block + int32_t *raw_other; ///< decoded raw samples of the other channel of a channel pair +} ALSBlockData; + + +static av_cold void dprint_specific_config(ALSDecContext *ctx) +{ +#ifdef DEBUG + AVCodecContext *avctx = ctx->avctx; + ALSSpecificConfig *sconf = &ctx->sconf; + + av_dlog(avctx, "resolution = %i\n", sconf->resolution); + av_dlog(avctx, "floating = %i\n", sconf->floating); + av_dlog(avctx, "frame_length = %i\n", sconf->frame_length); + av_dlog(avctx, "ra_distance = %i\n", sconf->ra_distance); + av_dlog(avctx, "ra_flag = %i\n", sconf->ra_flag); + av_dlog(avctx, "adapt_order = %i\n", sconf->adapt_order); + av_dlog(avctx, "coef_table = %i\n", sconf->coef_table); + av_dlog(avctx, "long_term_prediction = %i\n", sconf->long_term_prediction); + av_dlog(avctx, "max_order = %i\n", sconf->max_order); + av_dlog(avctx, "block_switching = %i\n", sconf->block_switching); + av_dlog(avctx, "bgmc = %i\n", sconf->bgmc); + av_dlog(avctx, "sb_part = %i\n", sconf->sb_part); + av_dlog(avctx, "joint_stereo = %i\n", sconf->joint_stereo); + av_dlog(avctx, "mc_coding = %i\n", sconf->mc_coding); + av_dlog(avctx, "chan_config = %i\n", sconf->chan_config); + av_dlog(avctx, "chan_sort = %i\n", sconf->chan_sort); + av_dlog(avctx, "RLSLMS = %i\n", sconf->rlslms); + av_dlog(avctx, "chan_config_info = %i\n", sconf->chan_config_info); +#endif +} + + +/** Read an ALSSpecificConfig from a buffer into the output struct. + */ +static av_cold int read_specific_config(ALSDecContext *ctx) +{ + GetBitContext gb; + uint64_t ht_size; + int i, config_offset; + MPEG4AudioConfig m4ac; + ALSSpecificConfig *sconf = &ctx->sconf; + AVCodecContext *avctx = ctx->avctx; + uint32_t als_id, header_size, trailer_size; + + init_get_bits(&gb, avctx->extradata, avctx->extradata_size * 8); + + config_offset = ff_mpeg4audio_get_config(&m4ac, avctx->extradata, + avctx->extradata_size); + + if (config_offset < 0) + return -1; + + skip_bits_long(&gb, config_offset); + + if (get_bits_left(&gb) < (30 << 3)) + return -1; + + // read the fixed items + als_id = get_bits_long(&gb, 32); + avctx->sample_rate = m4ac.sample_rate; + skip_bits_long(&gb, 32); // sample rate already known + sconf->samples = get_bits_long(&gb, 32); + avctx->channels = m4ac.channels; + skip_bits(&gb, 16); // number of channels already knwon + skip_bits(&gb, 3); // skip file_type + sconf->resolution = get_bits(&gb, 3); + sconf->floating = get_bits1(&gb); + sconf->msb_first = get_bits1(&gb); + sconf->frame_length = get_bits(&gb, 16) + 1; + sconf->ra_distance = get_bits(&gb, 8); + sconf->ra_flag = get_bits(&gb, 2); + sconf->adapt_order = get_bits1(&gb); + sconf->coef_table = get_bits(&gb, 2); + sconf->long_term_prediction = get_bits1(&gb); + sconf->max_order = get_bits(&gb, 10); + sconf->block_switching = get_bits(&gb, 2); + sconf->bgmc = get_bits1(&gb); + sconf->sb_part = get_bits1(&gb); + sconf->joint_stereo = get_bits1(&gb); + sconf->mc_coding = get_bits1(&gb); + sconf->chan_config = get_bits1(&gb); + sconf->chan_sort = get_bits1(&gb); + sconf->crc_enabled = get_bits1(&gb); + sconf->rlslms = get_bits1(&gb); + skip_bits(&gb, 5); // skip 5 reserved bits + skip_bits1(&gb); // skip aux_data_enabled + + + // check for ALSSpecificConfig struct + if (als_id != MKBETAG('A','L','S','\0')) + return -1; + + ctx->cur_frame_length = sconf->frame_length; + + // read channel config + if (sconf->chan_config) + sconf->chan_config_info = get_bits(&gb, 16); + // TODO: use this to set avctx->channel_layout + + + // read channel sorting + if (sconf->chan_sort && avctx->channels > 1) { + int chan_pos_bits = av_ceil_log2(avctx->channels); + int bits_needed = avctx->channels * chan_pos_bits + 7; + if (get_bits_left(&gb) < bits_needed) + return -1; + + if (!(sconf->chan_pos = av_malloc(avctx->channels * sizeof(*sconf->chan_pos)))) + return AVERROR(ENOMEM); + + for (i = 0; i < avctx->channels; i++) + sconf->chan_pos[i] = get_bits(&gb, chan_pos_bits); + + align_get_bits(&gb); + // TODO: use this to actually do channel sorting + } else { + sconf->chan_sort = 0; + } + + + // read fixed header and trailer sizes, + // if size = 0xFFFFFFFF then there is no data field! + if (get_bits_left(&gb) < 64) + return -1; + + header_size = get_bits_long(&gb, 32); + trailer_size = get_bits_long(&gb, 32); + if (header_size == 0xFFFFFFFF) + header_size = 0; + if (trailer_size == 0xFFFFFFFF) + trailer_size = 0; + + ht_size = ((int64_t)(header_size) + (int64_t)(trailer_size)) << 3; + + + // skip the header and trailer data + if (get_bits_left(&gb) < ht_size) + return -1; + + if (ht_size > INT32_MAX) + return -1; + + skip_bits_long(&gb, ht_size); + + + // initialize CRC calculation + if (sconf->crc_enabled) { + if (get_bits_left(&gb) < 32) + return -1; + + if (avctx->error_recognition >= FF_ER_CAREFUL) { + ctx->crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE); + ctx->crc = 0xFFFFFFFF; + ctx->crc_org = ~get_bits_long(&gb, 32); + } else + skip_bits_long(&gb, 32); + } + + + // no need to read the rest of ALSSpecificConfig (ra_unit_size & aux data) + + dprint_specific_config(ctx); + + return 0; +} + + +/** Check the ALSSpecificConfig for unsupported features. + */ +static int check_specific_config(ALSDecContext *ctx) +{ + ALSSpecificConfig *sconf = &ctx->sconf; + int error = 0; + + // report unsupported feature and set error value + #define MISSING_ERR(cond, str, errval) \ + { \ + if (cond) { \ + av_log_missing_feature(ctx->avctx, str, 0); \ + error = errval; \ + } \ + } + + MISSING_ERR(sconf->floating, "Floating point decoding", -1); + MISSING_ERR(sconf->rlslms, "Adaptive RLS-LMS prediction", -1); + MISSING_ERR(sconf->chan_sort, "Channel sorting", 0); + + return error; +} + + +/** Parse the bs_info field to extract the block partitioning used in + * block switching mode, refer to ISO/IEC 14496-3, section 11.6.2. + */ +static void parse_bs_info(const uint32_t bs_info, unsigned int n, + unsigned int div, unsigned int **div_blocks, + unsigned int *num_blocks) +{ + if (n < 31 && ((bs_info << n) & 0x40000000)) { + // if the level is valid and the investigated bit n is set + // then recursively check both children at bits (2n+1) and (2n+2) + n *= 2; + div += 1; + parse_bs_info(bs_info, n + 1, div, div_blocks, num_blocks); + parse_bs_info(bs_info, n + 2, div, div_blocks, num_blocks); + } else { + // else the bit is not set or the last level has been reached + // (bit implicitly not set) + **div_blocks = div; + (*div_blocks)++; + (*num_blocks)++; + } +} + + +/** Read and decode a Rice codeword. + */ +static int32_t decode_rice(GetBitContext *gb, unsigned int k) +{ + int max = get_bits_left(gb) - k; + int q = get_unary(gb, 0, max); + int r = k ? get_bits1(gb) : !(q & 1); + + if (k > 1) { + q <<= (k - 1); + q += get_bits_long(gb, k - 1); + } else if (!k) { + q >>= 1; + } + return r ? q : ~q; +} + + +/** Convert PARCOR coefficient k to direct filter coefficient. + */ +static void parcor_to_lpc(unsigned int k, const int32_t *par, int32_t *cof) +{ + int i, j; + + for (i = 0, j = k - 1; i < j; i++, j--) { + int tmp1 = ((MUL64(par[k], cof[j]) + (1 << 19)) >> 20); + cof[j] += ((MUL64(par[k], cof[i]) + (1 << 19)) >> 20); + cof[i] += tmp1; + } + if (i == j) + cof[i] += ((MUL64(par[k], cof[j]) + (1 << 19)) >> 20); + + cof[k] = par[k]; +} + + +/** Read block switching field if necessary and set actual block sizes. + * Also assure that the block sizes of the last frame correspond to the + * actual number of samples. + */ +static void get_block_sizes(ALSDecContext *ctx, unsigned int *div_blocks, + uint32_t *bs_info) +{ + ALSSpecificConfig *sconf = &ctx->sconf; + GetBitContext *gb = &ctx->gb; + unsigned int *ptr_div_blocks = div_blocks; + unsigned int b; + + if (sconf->block_switching) { + unsigned int bs_info_len = 1 << (sconf->block_switching + 2); + *bs_info = get_bits_long(gb, bs_info_len); + *bs_info <<= (32 - bs_info_len); + } + + ctx->num_blocks = 0; + parse_bs_info(*bs_info, 0, 0, &ptr_div_blocks, &ctx->num_blocks); + + // The last frame may have an overdetermined block structure given in + // the bitstream. In that case the defined block structure would need + // more samples than available to be consistent. + // The block structure is actually used but the block sizes are adapted + // to fit the actual number of available samples. + // Example: 5 samples, 2nd level block sizes: 2 2 2 2. + // This results in the actual block sizes: 2 2 1 0. + // This is not specified in 14496-3 but actually done by the reference + // codec RM22 revision 2. + // This appears to happen in case of an odd number of samples in the last + // frame which is actually not allowed by the block length switching part + // of 14496-3. + // The ALS conformance files feature an odd number of samples in the last + // frame. + + for (b = 0; b < ctx->num_blocks; b++) + div_blocks[b] = ctx->sconf.frame_length >> div_blocks[b]; + + if (ctx->cur_frame_length != ctx->sconf.frame_length) { + unsigned int remaining = ctx->cur_frame_length; + + for (b = 0; b < ctx->num_blocks; b++) { + if (remaining <= div_blocks[b]) { + div_blocks[b] = remaining; + ctx->num_blocks = b + 1; + break; + } + + remaining -= div_blocks[b]; + } + } +} + + +/** Read the block data for a constant block + */ +static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd) +{ + ALSSpecificConfig *sconf = &ctx->sconf; + AVCodecContext *avctx = ctx->avctx; + GetBitContext *gb = &ctx->gb; + + *bd->raw_samples = 0; + *bd->const_block = get_bits1(gb); // 1 = constant value, 0 = zero block (silence) + bd->js_blocks = get_bits1(gb); + + // skip 5 reserved bits + skip_bits(gb, 5); + + if (*bd->const_block) { + unsigned int const_val_bits = sconf->floating ? 24 : avctx->bits_per_raw_sample; + *bd->raw_samples = get_sbits_long(gb, const_val_bits); + } + + // ensure constant block decoding by reusing this field + *bd->const_block = 1; +} + + +/** Decode the block data for a constant block + */ +static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd) +{ + int smp = bd->block_length - 1; + int32_t val = *bd->raw_samples; + int32_t *dst = bd->raw_samples + 1; + + // write raw samples into buffer + for (; smp; smp--) + *dst++ = val; +} + + +/** Read the block data for a non-constant block + */ +static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) +{ + ALSSpecificConfig *sconf = &ctx->sconf; + AVCodecContext *avctx = ctx->avctx; + GetBitContext *gb = &ctx->gb; + unsigned int k; + unsigned int s[8]; + unsigned int sx[8]; + unsigned int sub_blocks, log2_sub_blocks, sb_length; + unsigned int start = 0; + unsigned int opt_order; + int sb; + int32_t *quant_cof = bd->quant_cof; + int32_t *current_res; + + + // ensure variable block decoding by reusing this field + *bd->const_block = 0; + + *bd->opt_order = 1; + bd->js_blocks = get_bits1(gb); + + opt_order = *bd->opt_order; + + // determine the number of subblocks for entropy decoding + if (!sconf->bgmc && !sconf->sb_part) { + log2_sub_blocks = 0; + } else { + if (sconf->bgmc && sconf->sb_part) + log2_sub_blocks = get_bits(gb, 2); + else + log2_sub_blocks = 2 * get_bits1(gb); + } + + sub_blocks = 1 << log2_sub_blocks; + + // do not continue in case of a damaged stream since + // block_length must be evenly divisible by sub_blocks + if (bd->block_length & (sub_blocks - 1)) { + av_log(avctx, AV_LOG_WARNING, + "Block length is not evenly divisible by the number of subblocks.\n"); + return -1; + } + + sb_length = bd->block_length >> log2_sub_blocks; + + if (sconf->bgmc) { + s[0] = get_bits(gb, 8 + (sconf->resolution > 1)); + for (k = 1; k < sub_blocks; k++) + s[k] = s[k - 1] + decode_rice(gb, 2); + + for (k = 0; k < sub_blocks; k++) { + sx[k] = s[k] & 0x0F; + s [k] >>= 4; + } + } else { + s[0] = get_bits(gb, 4 + (sconf->resolution > 1)); + for (k = 1; k < sub_blocks; k++) + s[k] = s[k - 1] + decode_rice(gb, 0); + } + + if (get_bits1(gb)) + *bd->shift_lsbs = get_bits(gb, 4) + 1; + + *bd->store_prev_samples = (bd->js_blocks && bd->raw_other) || *bd->shift_lsbs; + + + if (!sconf->rlslms) { + if (sconf->adapt_order) { + int opt_order_length = av_ceil_log2(av_clip((bd->block_length >> 3) - 1, + 2, sconf->max_order + 1)); + *bd->opt_order = get_bits(gb, opt_order_length); + } else { + *bd->opt_order = sconf->max_order; + } + + opt_order = *bd->opt_order; + + if (opt_order) { + int add_base; + + if (sconf->coef_table == 3) { + add_base = 0x7F; + + // read coefficient 0 + quant_cof[0] = 32 * parcor_scaled_values[get_bits(gb, 7)]; + + // read coefficient 1 + if (opt_order > 1) + quant_cof[1] = -32 * parcor_scaled_values[get_bits(gb, 7)]; + + // read coefficients 2 to opt_order + for (k = 2; k < opt_order; k++) + quant_cof[k] = get_bits(gb, 7); + } else { + int k_max; + add_base = 1; + + // read coefficient 0 to 19 + k_max = FFMIN(opt_order, 20); + for (k = 0; k < k_max; k++) { + int rice_param = parcor_rice_table[sconf->coef_table][k][1]; + int offset = parcor_rice_table[sconf->coef_table][k][0]; + quant_cof[k] = decode_rice(gb, rice_param) + offset; + } + + // read coefficients 20 to 126 + k_max = FFMIN(opt_order, 127); + for (; k < k_max; k++) + quant_cof[k] = decode_rice(gb, 2) + (k & 1); + + // read coefficients 127 to opt_order + for (; k < opt_order; k++) + quant_cof[k] = decode_rice(gb, 1); + + quant_cof[0] = 32 * parcor_scaled_values[quant_cof[0] + 64]; + + if (opt_order > 1) + quant_cof[1] = -32 * parcor_scaled_values[quant_cof[1] + 64]; + } + + for (k = 2; k < opt_order; k++) + quant_cof[k] = (quant_cof[k] << 14) + (add_base << 13); + } + } + + // read LTP gain and lag values + if (sconf->long_term_prediction) { + *bd->use_ltp = get_bits1(gb); + + if (*bd->use_ltp) { + int r, c; + + bd->ltp_gain[0] = decode_rice(gb, 1) << 3; + bd->ltp_gain[1] = decode_rice(gb, 2) << 3; + + r = get_unary(gb, 0, 4); + c = get_bits(gb, 2); + bd->ltp_gain[2] = ltp_gain_values[r][c]; + + bd->ltp_gain[3] = decode_rice(gb, 2) << 3; + bd->ltp_gain[4] = decode_rice(gb, 1) << 3; + + *bd->ltp_lag = get_bits(gb, ctx->ltp_lag_length); + *bd->ltp_lag += FFMAX(4, opt_order + 1); + } + } + + // read first value and residuals in case of a random access block + if (bd->ra_block) { + if (opt_order) + bd->raw_samples[0] = decode_rice(gb, avctx->bits_per_raw_sample - 4); + if (opt_order > 1) + bd->raw_samples[1] = decode_rice(gb, FFMIN(s[0] + 3, ctx->s_max)); + if (opt_order > 2) + bd->raw_samples[2] = decode_rice(gb, FFMIN(s[0] + 1, ctx->s_max)); + + start = FFMIN(opt_order, 3); + } + + // read all residuals + if (sconf->bgmc) { + int delta[8]; + unsigned int k [8]; + unsigned int b = av_clip((av_ceil_log2(bd->block_length) - 3) >> 1, 0, 5); + unsigned int i = start; + + // read most significant bits + unsigned int high; + unsigned int low; + unsigned int value; + + ff_bgmc_decode_init(gb, &high, &low, &value); + + current_res = bd->raw_samples + start; + + for (sb = 0; sb < sub_blocks; sb++, i = 0) { + k [sb] = s[sb] > b ? s[sb] - b : 0; + delta[sb] = 5 - s[sb] + k[sb]; + + ff_bgmc_decode(gb, sb_length, current_res, + delta[sb], sx[sb], &high, &low, &value, ctx->bgmc_lut, ctx->bgmc_lut_status); + + current_res += sb_length; + } + + ff_bgmc_decode_end(gb); + + + // read least significant bits and tails + i = start; + current_res = bd->raw_samples + start; + + for (sb = 0; sb < sub_blocks; sb++, i = 0) { + unsigned int cur_tail_code = tail_code[sx[sb]][delta[sb]]; + unsigned int cur_k = k[sb]; + unsigned int cur_s = s[sb]; + + for (; i < sb_length; i++) { + int32_t res = *current_res; + + if (res == cur_tail_code) { + unsigned int max_msb = (2 + (sx[sb] > 2) + (sx[sb] > 10)) + << (5 - delta[sb]); + + res = decode_rice(gb, cur_s); + + if (res >= 0) { + res += (max_msb ) << cur_k; + } else { + res -= (max_msb - 1) << cur_k; + } + } else { + if (res > cur_tail_code) + res--; + + if (res & 1) + res = -res; + + res >>= 1; + + if (cur_k) { + res <<= cur_k; + res |= get_bits_long(gb, cur_k); + } + } + + *current_res++ = res; + } + } + } else { + current_res = bd->raw_samples + start; + + for (sb = 0; sb < sub_blocks; sb++, start = 0) + for (; start < sb_length; start++) + *current_res++ = decode_rice(gb, s[sb]); + } + + if (!sconf->mc_coding || ctx->js_switch) + align_get_bits(gb); + + return 0; +} + + +/** Decode the block data for a non-constant block + */ +static int decode_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) +{ + ALSSpecificConfig *sconf = &ctx->sconf; + unsigned int block_length = bd->block_length; + unsigned int smp = 0; + unsigned int k; + int opt_order = *bd->opt_order; + int sb; + int64_t y; + int32_t *quant_cof = bd->quant_cof; + int32_t *lpc_cof = bd->lpc_cof; + int32_t *raw_samples = bd->raw_samples; + int32_t *raw_samples_end = bd->raw_samples + bd->block_length; + int32_t *lpc_cof_reversed = ctx->lpc_cof_reversed_buffer; + + // reverse long-term prediction + if (*bd->use_ltp) { + int ltp_smp; + + for (ltp_smp = FFMAX(*bd->ltp_lag - 2, 0); ltp_smp < block_length; ltp_smp++) { + int center = ltp_smp - *bd->ltp_lag; + int begin = FFMAX(0, center - 2); + int end = center + 3; + int tab = 5 - (end - begin); + int base; + + y = 1 << 6; + + for (base = begin; base < end; base++, tab++) + y += MUL64(bd->ltp_gain[tab], raw_samples[base]); + + raw_samples[ltp_smp] += y >> 7; + } + } + + // reconstruct all samples from residuals + if (bd->ra_block) { + for (smp = 0; smp < opt_order; smp++) { + y = 1 << 19; + + for (sb = 0; sb < smp; sb++) + y += MUL64(lpc_cof[sb], raw_samples[-(sb + 1)]); + + *raw_samples++ -= y >> 20; + parcor_to_lpc(smp, quant_cof, lpc_cof); + } + } else { + for (k = 0; k < opt_order; k++) + parcor_to_lpc(k, quant_cof, lpc_cof); + + // store previous samples in case that they have to be altered + if (*bd->store_prev_samples) + memcpy(bd->prev_raw_samples, raw_samples - sconf->max_order, + sizeof(*bd->prev_raw_samples) * sconf->max_order); + + // reconstruct difference signal for prediction (joint-stereo) + if (bd->js_blocks && bd->raw_other) { + int32_t *left, *right; + + if (bd->raw_other > raw_samples) { // D = R - L + left = raw_samples; + right = bd->raw_other; + } else { // D = R - L + left = bd->raw_other; + right = raw_samples; + } + + for (sb = -1; sb >= -sconf->max_order; sb--) + raw_samples[sb] = right[sb] - left[sb]; + } + + // reconstruct shifted signal + if (*bd->shift_lsbs) + for (sb = -1; sb >= -sconf->max_order; sb--) + raw_samples[sb] >>= *bd->shift_lsbs; + } + + // reverse linear prediction coefficients for efficiency + lpc_cof = lpc_cof + opt_order; + + for (sb = 0; sb < opt_order; sb++) + lpc_cof_reversed[sb] = lpc_cof[-(sb + 1)]; + + // reconstruct raw samples + raw_samples = bd->raw_samples + smp; + lpc_cof = lpc_cof_reversed + opt_order; + + for (; raw_samples < raw_samples_end; raw_samples++) { + y = 1 << 19; + + for (sb = -opt_order; sb < 0; sb++) + y += MUL64(lpc_cof[sb], raw_samples[sb]); + + *raw_samples -= y >> 20; + } + + raw_samples = bd->raw_samples; + + // restore previous samples in case that they have been altered + if (*bd->store_prev_samples) + memcpy(raw_samples - sconf->max_order, bd->prev_raw_samples, + sizeof(*raw_samples) * sconf->max_order); + + return 0; +} + + +/** Read the block data. + */ +static int read_block(ALSDecContext *ctx, ALSBlockData *bd) +{ + GetBitContext *gb = &ctx->gb; + + *bd->shift_lsbs = 0; + // read block type flag and read the samples accordingly + if (get_bits1(gb)) { + if (read_var_block_data(ctx, bd)) + return -1; + } else { + read_const_block_data(ctx, bd); + } + + return 0; +} + + +/** Decode the block data. + */ +static int decode_block(ALSDecContext *ctx, ALSBlockData *bd) +{ + unsigned int smp; + + // read block type flag and read the samples accordingly + if (*bd->const_block) + decode_const_block_data(ctx, bd); + else if (decode_var_block_data(ctx, bd)) + return -1; + + // TODO: read RLSLMS extension data + + if (*bd->shift_lsbs) + for (smp = 0; smp < bd->block_length; smp++) + bd->raw_samples[smp] <<= *bd->shift_lsbs; + + return 0; +} + + +/** Read and decode block data successively. + */ +static int read_decode_block(ALSDecContext *ctx, ALSBlockData *bd) +{ + int ret; + + ret = read_block(ctx, bd); + + if (ret) + return ret; + + ret = decode_block(ctx, bd); + + return ret; +} + + +/** Compute the number of samples left to decode for the current frame and + * sets these samples to zero. + */ +static void zero_remaining(unsigned int b, unsigned int b_max, + const unsigned int *div_blocks, int32_t *buf) +{ + unsigned int count = 0; + + while (b < b_max) + count += div_blocks[b]; + + if (count) + memset(buf, 0, sizeof(*buf) * count); +} + + +/** Decode blocks independently. + */ +static int decode_blocks_ind(ALSDecContext *ctx, unsigned int ra_frame, + unsigned int c, const unsigned int *div_blocks, + unsigned int *js_blocks) +{ + unsigned int b; + ALSBlockData bd; + + memset(&bd, 0, sizeof(ALSBlockData)); + + bd.ra_block = ra_frame; + bd.const_block = ctx->const_block; + bd.shift_lsbs = ctx->shift_lsbs; + bd.opt_order = ctx->opt_order; + bd.store_prev_samples = ctx->store_prev_samples; + bd.use_ltp = ctx->use_ltp; + bd.ltp_lag = ctx->ltp_lag; + bd.ltp_gain = ctx->ltp_gain[0]; + bd.quant_cof = ctx->quant_cof[0]; + bd.lpc_cof = ctx->lpc_cof[0]; + bd.prev_raw_samples = ctx->prev_raw_samples; + bd.raw_samples = ctx->raw_samples[c]; + + + for (b = 0; b < ctx->num_blocks; b++) { + bd.block_length = div_blocks[b]; + + if (read_decode_block(ctx, &bd)) { + // damaged block, write zero for the rest of the frame + zero_remaining(b, ctx->num_blocks, div_blocks, bd.raw_samples); + return -1; + } + bd.raw_samples += div_blocks[b]; + bd.ra_block = 0; + } + + return 0; +} + + +/** Decode blocks dependently. + */ +static int decode_blocks(ALSDecContext *ctx, unsigned int ra_frame, + unsigned int c, const unsigned int *div_blocks, + unsigned int *js_blocks) +{ + ALSSpecificConfig *sconf = &ctx->sconf; + unsigned int offset = 0; + unsigned int b; + ALSBlockData bd[2]; + + memset(bd, 0, 2 * sizeof(ALSBlockData)); + + bd[0].ra_block = ra_frame; + bd[0].const_block = ctx->const_block; + bd[0].shift_lsbs = ctx->shift_lsbs; + bd[0].opt_order = ctx->opt_order; + bd[0].store_prev_samples = ctx->store_prev_samples; + bd[0].use_ltp = ctx->use_ltp; + bd[0].ltp_lag = ctx->ltp_lag; + bd[0].ltp_gain = ctx->ltp_gain[0]; + bd[0].quant_cof = ctx->quant_cof[0]; + bd[0].lpc_cof = ctx->lpc_cof[0]; + bd[0].prev_raw_samples = ctx->prev_raw_samples; + bd[0].js_blocks = *js_blocks; + + bd[1].ra_block = ra_frame; + bd[1].const_block = ctx->const_block; + bd[1].shift_lsbs = ctx->shift_lsbs; + bd[1].opt_order = ctx->opt_order; + bd[1].store_prev_samples = ctx->store_prev_samples; + bd[1].use_ltp = ctx->use_ltp; + bd[1].ltp_lag = ctx->ltp_lag; + bd[1].ltp_gain = ctx->ltp_gain[0]; + bd[1].quant_cof = ctx->quant_cof[0]; + bd[1].lpc_cof = ctx->lpc_cof[0]; + bd[1].prev_raw_samples = ctx->prev_raw_samples; + bd[1].js_blocks = *(js_blocks + 1); + + // decode all blocks + for (b = 0; b < ctx->num_blocks; b++) { + unsigned int s; + + bd[0].block_length = div_blocks[b]; + bd[1].block_length = div_blocks[b]; + + bd[0].raw_samples = ctx->raw_samples[c ] + offset; + bd[1].raw_samples = ctx->raw_samples[c + 1] + offset; + + bd[0].raw_other = bd[1].raw_samples; + bd[1].raw_other = bd[0].raw_samples; + + if(read_decode_block(ctx, &bd[0]) || read_decode_block(ctx, &bd[1])) { + // damaged block, write zero for the rest of the frame + zero_remaining(b, ctx->num_blocks, div_blocks, bd[0].raw_samples); + zero_remaining(b, ctx->num_blocks, div_blocks, bd[1].raw_samples); + return -1; + } + + // reconstruct joint-stereo blocks + if (bd[0].js_blocks) { + if (bd[1].js_blocks) + av_log(ctx->avctx, AV_LOG_WARNING, "Invalid channel pair!\n"); + + for (s = 0; s < div_blocks[b]; s++) + bd[0].raw_samples[s] = bd[1].raw_samples[s] - bd[0].raw_samples[s]; + } else if (bd[1].js_blocks) { + for (s = 0; s < div_blocks[b]; s++) + bd[1].raw_samples[s] = bd[1].raw_samples[s] + bd[0].raw_samples[s]; + } + + offset += div_blocks[b]; + bd[0].ra_block = 0; + bd[1].ra_block = 0; + } + + // store carryover raw samples, + // the others channel raw samples are stored by the calling function. + memmove(ctx->raw_samples[c] - sconf->max_order, + ctx->raw_samples[c] - sconf->max_order + sconf->frame_length, + sizeof(*ctx->raw_samples[c]) * sconf->max_order); + + return 0; +} + + +/** Read the channel data. + */ +static int read_channel_data(ALSDecContext *ctx, ALSChannelData *cd, int c) +{ + GetBitContext *gb = &ctx->gb; + ALSChannelData *current = cd; + unsigned int channels = ctx->avctx->channels; + int entries = 0; + + while (entries < channels && !(current->stop_flag = get_bits1(gb))) { + current->master_channel = get_bits_long(gb, av_ceil_log2(channels)); + + if (current->master_channel >= channels) { + av_log(ctx->avctx, AV_LOG_ERROR, "Invalid master channel!\n"); + return -1; + } + + if (current->master_channel != c) { + current->time_diff_flag = get_bits1(gb); + current->weighting[0] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)]; + current->weighting[1] = mcc_weightings[av_clip(decode_rice(gb, 2) + 14, 0, 32)]; + current->weighting[2] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)]; + + if (current->time_diff_flag) { + current->weighting[3] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)]; + current->weighting[4] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)]; + current->weighting[5] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)]; + + current->time_diff_sign = get_bits1(gb); + current->time_diff_index = get_bits(gb, ctx->ltp_lag_length - 3) + 3; + } + } + + current++; + entries++; + } + + if (entries == channels) { + av_log(ctx->avctx, AV_LOG_ERROR, "Damaged channel data!\n"); + return -1; + } + + align_get_bits(gb); + return 0; +} + + +/** Recursively reverts the inter-channel correlation for a block. + */ +static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd, + ALSChannelData **cd, int *reverted, + unsigned int offset, int c) +{ + ALSChannelData *ch = cd[c]; + unsigned int dep = 0; + unsigned int channels = ctx->avctx->channels; + + if (reverted[c]) + return 0; + + reverted[c] = 1; + + while (dep < channels && !ch[dep].stop_flag) { + revert_channel_correlation(ctx, bd, cd, reverted, offset, + ch[dep].master_channel); + + dep++; + } + + if (dep == channels) { + av_log(ctx->avctx, AV_LOG_WARNING, "Invalid channel correlation!\n"); + return -1; + } + + bd->const_block = ctx->const_block + c; + bd->shift_lsbs = ctx->shift_lsbs + c; + bd->opt_order = ctx->opt_order + c; + bd->store_prev_samples = ctx->store_prev_samples + c; + bd->use_ltp = ctx->use_ltp + c; + bd->ltp_lag = ctx->ltp_lag + c; + bd->ltp_gain = ctx->ltp_gain[c]; + bd->lpc_cof = ctx->lpc_cof[c]; + bd->quant_cof = ctx->quant_cof[c]; + bd->raw_samples = ctx->raw_samples[c] + offset; + + dep = 0; + while (!ch[dep].stop_flag) { + unsigned int smp; + unsigned int begin = 1; + unsigned int end = bd->block_length - 1; + int64_t y; + int32_t *master = ctx->raw_samples[ch[dep].master_channel] + offset; + + if (ch[dep].time_diff_flag) { + int t = ch[dep].time_diff_index; + + if (ch[dep].time_diff_sign) { + t = -t; + begin -= t; + } else { + end -= t; + } + + for (smp = begin; smp < end; smp++) { + y = (1 << 6) + + MUL64(ch[dep].weighting[0], master[smp - 1 ]) + + MUL64(ch[dep].weighting[1], master[smp ]) + + MUL64(ch[dep].weighting[2], master[smp + 1 ]) + + MUL64(ch[dep].weighting[3], master[smp - 1 + t]) + + MUL64(ch[dep].weighting[4], master[smp + t]) + + MUL64(ch[dep].weighting[5], master[smp + 1 + t]); + + bd->raw_samples[smp] += y >> 7; + } + } else { + for (smp = begin; smp < end; smp++) { + y = (1 << 6) + + MUL64(ch[dep].weighting[0], master[smp - 1]) + + MUL64(ch[dep].weighting[1], master[smp ]) + + MUL64(ch[dep].weighting[2], master[smp + 1]); + + bd->raw_samples[smp] += y >> 7; + } + } + + dep++; + } + + return 0; +} + + +/** Read the frame data. + */ +static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame) +{ + ALSSpecificConfig *sconf = &ctx->sconf; + AVCodecContext *avctx = ctx->avctx; + GetBitContext *gb = &ctx->gb; + unsigned int div_blocks[32]; ///< block sizes. + unsigned int c; + unsigned int js_blocks[2]; + + uint32_t bs_info = 0; + + // skip the size of the ra unit if present in the frame + if (sconf->ra_flag == RA_FLAG_FRAMES && ra_frame) + skip_bits_long(gb, 32); + + if (sconf->mc_coding && sconf->joint_stereo) { + ctx->js_switch = get_bits1(gb); + align_get_bits(gb); + } + + if (!sconf->mc_coding || ctx->js_switch) { + int independent_bs = !sconf->joint_stereo; + + for (c = 0; c < avctx->channels; c++) { + js_blocks[0] = 0; + js_blocks[1] = 0; + + get_block_sizes(ctx, div_blocks, &bs_info); + + // if joint_stereo and block_switching is set, independent decoding + // is signaled via the first bit of bs_info + if (sconf->joint_stereo && sconf->block_switching) + if (bs_info >> 31) + independent_bs = 2; + + // if this is the last channel, it has to be decoded independently + if (c == avctx->channels - 1) + independent_bs = 1; + + if (independent_bs) { + if (decode_blocks_ind(ctx, ra_frame, c, div_blocks, js_blocks)) + return -1; + + independent_bs--; + } else { + if (decode_blocks(ctx, ra_frame, c, div_blocks, js_blocks)) + return -1; + + c++; + } + + // store carryover raw samples + memmove(ctx->raw_samples[c] - sconf->max_order, + ctx->raw_samples[c] - sconf->max_order + sconf->frame_length, + sizeof(*ctx->raw_samples[c]) * sconf->max_order); + } + } else { // multi-channel coding + ALSBlockData bd; + int b; + int *reverted_channels = ctx->reverted_channels; + unsigned int offset = 0; + + for (c = 0; c < avctx->channels; c++) + if (ctx->chan_data[c] < ctx->chan_data_buffer) { + av_log(ctx->avctx, AV_LOG_ERROR, "Invalid channel data!\n"); + return -1; + } + + memset(&bd, 0, sizeof(ALSBlockData)); + memset(reverted_channels, 0, sizeof(*reverted_channels) * avctx->channels); + + bd.ra_block = ra_frame; + bd.prev_raw_samples = ctx->prev_raw_samples; + + get_block_sizes(ctx, div_blocks, &bs_info); + + for (b = 0; b < ctx->num_blocks; b++) { + bd.block_length = div_blocks[b]; + + for (c = 0; c < avctx->channels; c++) { + bd.const_block = ctx->const_block + c; + bd.shift_lsbs = ctx->shift_lsbs + c; + bd.opt_order = ctx->opt_order + c; + bd.store_prev_samples = ctx->store_prev_samples + c; + bd.use_ltp = ctx->use_ltp + c; + bd.ltp_lag = ctx->ltp_lag + c; + bd.ltp_gain = ctx->ltp_gain[c]; + bd.lpc_cof = ctx->lpc_cof[c]; + bd.quant_cof = ctx->quant_cof[c]; + bd.raw_samples = ctx->raw_samples[c] + offset; + bd.raw_other = NULL; + + read_block(ctx, &bd); + if (read_channel_data(ctx, ctx->chan_data[c], c)) + return -1; + } + + for (c = 0; c < avctx->channels; c++) + if (revert_channel_correlation(ctx, &bd, ctx->chan_data, + reverted_channels, offset, c)) + return -1; + + for (c = 0; c < avctx->channels; c++) { + bd.const_block = ctx->const_block + c; + bd.shift_lsbs = ctx->shift_lsbs + c; + bd.opt_order = ctx->opt_order + c; + bd.store_prev_samples = ctx->store_prev_samples + c; + bd.use_ltp = ctx->use_ltp + c; + bd.ltp_lag = ctx->ltp_lag + c; + bd.ltp_gain = ctx->ltp_gain[c]; + bd.lpc_cof = ctx->lpc_cof[c]; + bd.quant_cof = ctx->quant_cof[c]; + bd.raw_samples = ctx->raw_samples[c] + offset; + decode_block(ctx, &bd); + } + + memset(reverted_channels, 0, avctx->channels * sizeof(*reverted_channels)); + offset += div_blocks[b]; + bd.ra_block = 0; + } + + // store carryover raw samples + for (c = 0; c < avctx->channels; c++) + memmove(ctx->raw_samples[c] - sconf->max_order, + ctx->raw_samples[c] - sconf->max_order + sconf->frame_length, + sizeof(*ctx->raw_samples[c]) * sconf->max_order); + } + + // TODO: read_diff_float_data + + return 0; +} + + +/** Decode an ALS frame. + */ +static int decode_frame(AVCodecContext *avctx, + void *data, int *data_size, + AVPacket *avpkt) +{ + ALSDecContext *ctx = avctx->priv_data; + ALSSpecificConfig *sconf = &ctx->sconf; + const uint8_t *buffer = avpkt->data; + int buffer_size = avpkt->size; + int invalid_frame, size; + unsigned int c, sample, ra_frame, bytes_read, shift; + + init_get_bits(&ctx->gb, buffer, buffer_size * 8); + + // In the case that the distance between random access frames is set to zero + // (sconf->ra_distance == 0) no frame is treated as a random access frame. + // For the first frame, if prediction is used, all samples used from the + // previous frame are assumed to be zero. + ra_frame = sconf->ra_distance && !(ctx->frame_id % sconf->ra_distance); + + // the last frame to decode might have a different length + if (sconf->samples != 0xFFFFFFFF) + ctx->cur_frame_length = FFMIN(sconf->samples - ctx->frame_id * (uint64_t) sconf->frame_length, + sconf->frame_length); + else + ctx->cur_frame_length = sconf->frame_length; + + // decode the frame data + if ((invalid_frame = read_frame_data(ctx, ra_frame) < 0)) + av_log(ctx->avctx, AV_LOG_WARNING, + "Reading frame data failed. Skipping RA unit.\n"); + + ctx->frame_id++; + + // check for size of decoded data + size = ctx->cur_frame_length * avctx->channels * + (av_get_bits_per_sample_fmt(avctx->sample_fmt) >> 3); + + if (size > *data_size) { + av_log(avctx, AV_LOG_ERROR, "Decoded data exceeds buffer size.\n"); + return -1; + } + + *data_size = size; + + // transform decoded frame into output format + #define INTERLEAVE_OUTPUT(bps) \ + { \ + int##bps##_t *dest = (int##bps##_t*) data; \ + shift = bps - ctx->avctx->bits_per_raw_sample; \ + for (sample = 0; sample < ctx->cur_frame_length; sample++) \ + for (c = 0; c < avctx->channels; c++) \ + *dest++ = ctx->raw_samples[c][sample] << shift; \ + } + + if (ctx->avctx->bits_per_raw_sample <= 16) { + INTERLEAVE_OUTPUT(16) + } else { + INTERLEAVE_OUTPUT(32) + } + + // update CRC + if (sconf->crc_enabled && avctx->error_recognition >= FF_ER_CAREFUL) { + int swap = HAVE_BIGENDIAN != sconf->msb_first; + + if (ctx->avctx->bits_per_raw_sample == 24) { + int32_t *src = data; + + for (sample = 0; + sample < ctx->cur_frame_length * avctx->channels; + sample++) { + int32_t v; + + if (swap) + v = av_bswap32(src[sample]); + else + v = src[sample]; + if (!HAVE_BIGENDIAN) + v >>= 8; + + ctx->crc = av_crc(ctx->crc_table, ctx->crc, (uint8_t*)(&v), 3); + } + } else { + uint8_t *crc_source; + + if (swap) { + if (ctx->avctx->bits_per_raw_sample <= 16) { + int16_t *src = (int16_t*) data; + int16_t *dest = (int16_t*) ctx->crc_buffer; + for (sample = 0; + sample < ctx->cur_frame_length * avctx->channels; + sample++) + *dest++ = av_bswap16(src[sample]); + } else { + ctx->dsp.bswap_buf((uint32_t*)ctx->crc_buffer, data, + ctx->cur_frame_length * avctx->channels); + } + crc_source = ctx->crc_buffer; + } else { + crc_source = data; + } + + ctx->crc = av_crc(ctx->crc_table, ctx->crc, crc_source, size); + } + + + // check CRC sums if this is the last frame + if (ctx->cur_frame_length != sconf->frame_length && + ctx->crc_org != ctx->crc) { + av_log(avctx, AV_LOG_ERROR, "CRC error.\n"); + } + } + + + bytes_read = invalid_frame ? buffer_size : + (get_bits_count(&ctx->gb) + 7) >> 3; + + return bytes_read; +} + + +/** Uninitialize the ALS decoder. + */ +static av_cold int decode_end(AVCodecContext *avctx) +{ + ALSDecContext *ctx = avctx->priv_data; + + av_freep(&ctx->sconf.chan_pos); + + ff_bgmc_end(&ctx->bgmc_lut, &ctx->bgmc_lut_status); + + av_freep(&ctx->const_block); + av_freep(&ctx->shift_lsbs); + av_freep(&ctx->opt_order); + av_freep(&ctx->store_prev_samples); + av_freep(&ctx->use_ltp); + av_freep(&ctx->ltp_lag); + av_freep(&ctx->ltp_gain); + av_freep(&ctx->ltp_gain_buffer); + av_freep(&ctx->quant_cof); + av_freep(&ctx->lpc_cof); + av_freep(&ctx->quant_cof_buffer); + av_freep(&ctx->lpc_cof_buffer); + av_freep(&ctx->lpc_cof_reversed_buffer); + av_freep(&ctx->prev_raw_samples); + av_freep(&ctx->raw_samples); + av_freep(&ctx->raw_buffer); + av_freep(&ctx->chan_data); + av_freep(&ctx->chan_data_buffer); + av_freep(&ctx->reverted_channels); + av_freep(&ctx->crc_buffer); + + return 0; +} + + +/** Initialize the ALS decoder. + */ +static av_cold int decode_init(AVCodecContext *avctx) +{ + unsigned int c; + unsigned int channel_size; + int num_buffers; + ALSDecContext *ctx = avctx->priv_data; + ALSSpecificConfig *sconf = &ctx->sconf; + ctx->avctx = avctx; + + if (!avctx->extradata) { + av_log(avctx, AV_LOG_ERROR, "Missing required ALS extradata.\n"); + return -1; + } + + if (read_specific_config(ctx)) { + av_log(avctx, AV_LOG_ERROR, "Reading ALSSpecificConfig failed.\n"); + decode_end(avctx); + return -1; + } + + if (check_specific_config(ctx)) { + decode_end(avctx); + return -1; + } + + if (sconf->bgmc) + ff_bgmc_init(avctx, &ctx->bgmc_lut, &ctx->bgmc_lut_status); + + if (sconf->floating) { + avctx->sample_fmt = AV_SAMPLE_FMT_FLT; + avctx->bits_per_raw_sample = 32; + } else { + avctx->sample_fmt = sconf->resolution > 1 + ? AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16; + avctx->bits_per_raw_sample = (sconf->resolution + 1) * 8; + } + + // set maximum Rice parameter for progressive decoding based on resolution + // This is not specified in 14496-3 but actually done by the reference + // codec RM22 revision 2. + ctx->s_max = sconf->resolution > 1 ? 31 : 15; + + // set lag value for long-term prediction + ctx->ltp_lag_length = 8 + (avctx->sample_rate >= 96000) + + (avctx->sample_rate >= 192000); + + // allocate quantized parcor coefficient buffer + num_buffers = sconf->mc_coding ? avctx->channels : 1; + + ctx->quant_cof = av_malloc(sizeof(*ctx->quant_cof) * num_buffers); + ctx->lpc_cof = av_malloc(sizeof(*ctx->lpc_cof) * num_buffers); + ctx->quant_cof_buffer = av_malloc(sizeof(*ctx->quant_cof_buffer) * + num_buffers * sconf->max_order); + ctx->lpc_cof_buffer = av_malloc(sizeof(*ctx->lpc_cof_buffer) * + num_buffers * sconf->max_order); + ctx->lpc_cof_reversed_buffer = av_malloc(sizeof(*ctx->lpc_cof_buffer) * + sconf->max_order); + + if (!ctx->quant_cof || !ctx->lpc_cof || + !ctx->quant_cof_buffer || !ctx->lpc_cof_buffer || + !ctx->lpc_cof_reversed_buffer) { + av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n"); + return AVERROR(ENOMEM); + } + + // assign quantized parcor coefficient buffers + for (c = 0; c < num_buffers; c++) { + ctx->quant_cof[c] = ctx->quant_cof_buffer + c * sconf->max_order; + ctx->lpc_cof[c] = ctx->lpc_cof_buffer + c * sconf->max_order; + } + + // allocate and assign lag and gain data buffer for ltp mode + ctx->const_block = av_malloc (sizeof(*ctx->const_block) * num_buffers); + ctx->shift_lsbs = av_malloc (sizeof(*ctx->shift_lsbs) * num_buffers); + ctx->opt_order = av_malloc (sizeof(*ctx->opt_order) * num_buffers); + ctx->store_prev_samples = av_malloc(sizeof(*ctx->store_prev_samples) * num_buffers); + ctx->use_ltp = av_mallocz(sizeof(*ctx->use_ltp) * num_buffers); + ctx->ltp_lag = av_malloc (sizeof(*ctx->ltp_lag) * num_buffers); + ctx->ltp_gain = av_malloc (sizeof(*ctx->ltp_gain) * num_buffers); + ctx->ltp_gain_buffer = av_malloc (sizeof(*ctx->ltp_gain_buffer) * + num_buffers * 5); + + if (!ctx->const_block || !ctx->shift_lsbs || + !ctx->opt_order || !ctx->store_prev_samples || + !ctx->use_ltp || !ctx->ltp_lag || + !ctx->ltp_gain || !ctx->ltp_gain_buffer) { + av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n"); + decode_end(avctx); + return AVERROR(ENOMEM); + } + + for (c = 0; c < num_buffers; c++) + ctx->ltp_gain[c] = ctx->ltp_gain_buffer + c * 5; + + // allocate and assign channel data buffer for mcc mode + if (sconf->mc_coding) { + ctx->chan_data_buffer = av_malloc(sizeof(*ctx->chan_data_buffer) * + num_buffers * num_buffers); + ctx->chan_data = av_malloc(sizeof(*ctx->chan_data) * + num_buffers); + ctx->reverted_channels = av_malloc(sizeof(*ctx->reverted_channels) * + num_buffers); + + if (!ctx->chan_data_buffer || !ctx->chan_data || !ctx->reverted_channels) { + av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n"); + decode_end(avctx); + return AVERROR(ENOMEM); + } + + for (c = 0; c < num_buffers; c++) + ctx->chan_data[c] = ctx->chan_data_buffer + c * num_buffers; + } else { + ctx->chan_data = NULL; + ctx->chan_data_buffer = NULL; + ctx->reverted_channels = NULL; + } + + avctx->frame_size = sconf->frame_length; + channel_size = sconf->frame_length + sconf->max_order; + + ctx->prev_raw_samples = av_malloc (sizeof(*ctx->prev_raw_samples) * sconf->max_order); + ctx->raw_buffer = av_mallocz(sizeof(*ctx-> raw_buffer) * avctx->channels * channel_size); + ctx->raw_samples = av_malloc (sizeof(*ctx-> raw_samples) * avctx->channels); + + // allocate previous raw sample buffer + if (!ctx->prev_raw_samples || !ctx->raw_buffer|| !ctx->raw_samples) { + av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n"); + decode_end(avctx); + return AVERROR(ENOMEM); + } + + // assign raw samples buffers + ctx->raw_samples[0] = ctx->raw_buffer + sconf->max_order; + for (c = 1; c < avctx->channels; c++) + ctx->raw_samples[c] = ctx->raw_samples[c - 1] + channel_size; + + // allocate crc buffer + if (HAVE_BIGENDIAN != sconf->msb_first && sconf->crc_enabled && + avctx->error_recognition >= FF_ER_CAREFUL) { + ctx->crc_buffer = av_malloc(sizeof(*ctx->crc_buffer) * + ctx->cur_frame_length * + avctx->channels * + (av_get_bits_per_sample_fmt(avctx->sample_fmt) >> 3)); + if (!ctx->crc_buffer) { + av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n"); + decode_end(avctx); + return AVERROR(ENOMEM); + } + } + + dsputil_init(&ctx->dsp, avctx); + + return 0; +} + + +/** Flush (reset) the frame ID after seeking. + */ +static av_cold void flush(AVCodecContext *avctx) +{ + ALSDecContext *ctx = avctx->priv_data; + + ctx->frame_id = 0; +} + + +AVCodec ff_als_decoder = { + "als", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_MP4ALS, + sizeof(ALSDecContext), + decode_init, + NULL, + decode_end, + decode_frame, + .flush = flush, + .capabilities = CODEC_CAP_SUBFRAMES, + .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 Audio Lossless Coding (ALS)"), +}; + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amr.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amr.h new file mode 100644 index 00000000..7e5a4dce --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amr.h @@ -0,0 +1,68 @@ +/* + * Shared functions between AMR codecs + * + * Copyright (c) 2010 Marcelo Galvao Povoa + * + * 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 + */ + +#ifndef AVCODEC_AMR_H +#define AVCODEC_AMR_H + +#include "avcodec.h" + +#ifdef AMR_USE_16BIT_TABLES +#define R_TABLE_TYPE uint16_t +#else +#define R_TABLE_TYPE uint8_t +#endif + +/** + * Fill the frame structure variables from bitstream by parsing the + * given reordering table that uses the following format: + * + * Each field (16 bits) in the AMR Frame is stored as: + * - one byte for the number of bits in the field + * - one byte for the field index + * - then, one byte for each bit of the field (from most-significant to least) + * of the position of that bit in the AMR frame. + * + * @param out pointer to the frame struct + * @param size the size in bytes of the frame struct + * @param data input bitstream after the frame header + * @param ord_table the reordering table as above + */ +static inline void ff_amr_bit_reorder(uint16_t *out, int size, + const uint8_t *data, + const R_TABLE_TYPE *ord_table) +{ + int field_size; + + memset(out, 0, size); + while ((field_size = *ord_table++)) { + int field = 0; + int field_offset = *ord_table++; + while (field_size--) { + int bit = *ord_table++; + field <<= 1; + field |= data[bit >> 3] >> (bit & 7) & 1; + } + out[field_offset] = field; + } +} + +#endif /* AVCODEC_AMR_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amrnbdata.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amrnbdata.h new file mode 100644 index 00000000..2f214398 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amrnbdata.h @@ -0,0 +1,1672 @@ +/* + * AMR narrowband data and definitions + * Copyright (c) 2006-2007 Robert Swain + * Copyright (c) 2009 Colin McQuillan + * + * 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 + * AMR narrowband data and definitions + */ + +#ifndef AVCODEC_AMRNBDATA_H +#define AVCODEC_AMRNBDATA_H + +#include + +#include "libavutil/common.h" /* offsetof */ + +#define AMR_SUBFRAME_SIZE 40 ///< samples per subframe + +/** Frame type (Table 1a in 3GPP TS 26.101) */ +enum Mode { + MODE_4k75 = 0, ///< 4.75 kbit/s + MODE_5k15, ///< 5.15 kbit/s + MODE_5k9, ///< 5.90 kbit/s + MODE_6k7, ///< 6.70 kbit/s + MODE_7k4, ///< 7.40 kbit/s + MODE_7k95, ///< 7.95 kbit/s + MODE_10k2, ///< 10.2 kbit/s + MODE_12k2, ///< 12.2 kbit/s + MODE_DTX, ///< silent frame + N_MODES, ///< number of modes + NO_DATA = 15 ///< no transmission +}; + +#define LP_FILTER_ORDER 10 ///< linear predictive coding filter order + +/** + * AMRNB unpacked data subframe + */ +typedef struct { + uint16_t p_lag; ///< index to decode the pitch lag + uint16_t p_gain; ///< index to decode the pitch gain + uint16_t fixed_gain; ///< index to decode the fixed gain factor, for MODE_12k2 and MODE_7k95 + uint16_t pulses[10]; ///< pulses: 10 for MODE_12k2, 7 for MODE_10k2, and index and sign for others +} AMRNBSubframe; + +/** + * AMRNB unpacked data frame + */ +typedef struct { + uint16_t lsf[5]; ///< lsf parameters: 5 parameters for MODE_12k2, only 3 for other modes + AMRNBSubframe subframe[4]; ///< unpacked data for each subframe +} AMRNBFrame; + +/** The index of a frame parameter */ +#define AMR_BIT(field) (offsetof(AMRNBFrame, field) >> 1) +/** The index of a subframe-specific parameter */ +#define AMR_OF(frame_num, variable) AMR_BIT(subframe[frame_num].variable) + +// The following order* tables are used to convert AMR frame parameters to and +// from a bitstream. See 3GPP TS 26.101 for more information. +// Each field in AMRNBFrame is stored as: +// * one byte for the number of bits in the field +// * one byte for the field index +// * then, one byte for each bit of the field (from most-significant to least) +// of the position of that bit in the AMR frame. +static const uint8_t order_MODE_4k75[] = { + 8, AMR_BIT(lsf[0]), 7, 6, 5, 4, 3, 2, 1, 0, + 8, AMR_BIT(lsf[1]), 15, 14, 13, 12, 11, 10, 9, 8, + 7, AMR_BIT(lsf[2]), 51, 35, 34, 50, 33, 49, 32, + 8, AMR_OF(0,p_lag), 23, 22, 21, 20, 19, 18, 43, 42, + 8, AMR_OF(0,p_gain), 54, 55, 40, 41, 24, 25, 26, 27, + 7, AMR_OF(0,pulses[0]), 92, 68, 67, 84, 66, 65, 80, + 2, AMR_OF(0,pulses[1]), 53, 52, + 4, AMR_OF(1,p_lag), 17, 16, 48, 63, + 7, AMR_OF(1,pulses[0]), 91, 64, 79, 83, 78, 77, 95, + 2, AMR_OF(1,pulses[1]), 62, 61, + 4, AMR_OF(2,p_lag), 31, 30, 60, 59, + 8, AMR_OF(2,p_gain), 44, 45, 46, 47, 36, 37, 38, 39, + 7, AMR_OF(2,pulses[0]), 90, 76, 75, 82, 74, 73, 94, + 2, AMR_OF(2,pulses[1]), 58, 57, + 4, AMR_OF(3,p_lag), 29, 28, 56, 71, + 7, AMR_OF(3,pulses[0]), 89, 72, 87, 81, 86, 85, 93, + 2, AMR_OF(3,pulses[1]), 70, 69, + 0 +}; + +static const uint8_t order_MODE_5k15[] = { + 8, AMR_BIT(lsf[0]), 0, 1, 2, 3, 4, 5, 6, 7, + 8, AMR_BIT(lsf[1]), 8, 9, 10, 11, 12, 13, 14, 15, + 7, AMR_BIT(lsf[2]), 70, 51, 43, 71, 50, 60, 49, + 8, AMR_OF(0,p_lag), 23, 22, 21, 20, 19, 47, 54, 59, + 6, AMR_OF(0,p_gain), 48, 42, 35, 29, 30, 31, + 7, AMR_OF(0,pulses[0]), 92, 84, 82, 100, 79, 72, 88, + 2, AMR_OF(0,pulses[1]), 67, 68, + 4, AMR_OF(1,p_lag), 18, 46, 53, 58, + 6, AMR_OF(1,p_gain), 63, 41, 34, 26, 27, 28, + 7, AMR_OF(1,pulses[0]), 91, 83, 81, 99, 78, 87, 103, + 2, AMR_OF(1,pulses[1]), 65, 66, + 4, AMR_OF(2,p_lag), 17, 45, 52, 57, + 6, AMR_OF(2,p_gain), 62, 40, 33, 39, 24, 25, + 7, AMR_OF(2,pulses[0]), 90, 80, 95, 98, 77, 86, 102, + 2, AMR_OF(2,pulses[1]), 75, 64, + 4, AMR_OF(3,p_lag), 16, 44, 56, 69, + 6, AMR_OF(3,p_gain), 61, 55, 32, 36, 37, 38, + 7, AMR_OF(3,pulses[0]), 89, 94, 93, 97, 76, 85, 101, + 2, AMR_OF(3,pulses[1]), 73, 74, + 0 +}; + +static const uint8_t order_MODE_5k9[] = { + 8, AMR_BIT(lsf[0]), 7, 6, 0, 3, 5, 4, 2, 1, + 9, AMR_BIT(lsf[1]), 13, 12, 8, 11, 10, 15, 9, 14, 23, + 9, AMR_BIT(lsf[2]), 71, 56, 60, 70, 59, 57, 58, 69, 76, + 8, AMR_OF(0,p_lag), 16, 18, 22, 20, 30, 38, 44, 42, + 6, AMR_OF(0,p_gain), 75, 48, 52, 40, 34, 26, + 9, AMR_OF(0,pulses[0]), 101, 89, 93, 117, 105, 81, 85, 109, 97, + 2, AMR_OF(0,pulses[1]), 67, 78, + 4, AMR_OF(1,p_lag), 28, 36, 46, 87, + 6, AMR_OF(1,p_gain), 74, 63, 51, 55, 33, 25, + 9, AMR_OF(1,pulses[0]), 100, 88, 92, 116, 104, 80, 84, 108, 96, + 2, AMR_OF(1,pulses[1]), 64, 79, + 8, AMR_OF(2,p_lag), 31, 17, 21, 19, 29, 37, 43, 41, + 6, AMR_OF(2,p_gain), 73, 62, 50, 54, 32, 24, + 9, AMR_OF(2,pulses[0]), 99, 103, 91, 115, 119, 95, 83, 107, 111, + 2, AMR_OF(2,pulses[1]), 66, 77, + 4, AMR_OF(3,p_lag), 27, 35, 45, 86, + 6, AMR_OF(3,p_gain), 72, 61, 49, 53, 47, 39, + 9, AMR_OF(3,pulses[0]), 98, 102, 90, 114, 118, 94, 82, 106, 110, + 2, AMR_OF(3,pulses[1]), 65, 68, + 0 +}; + +static const uint8_t order_MODE_6k7[] = { + 8, AMR_BIT(lsf[0]), 7, 6, 15, 4, 5, 3, 2, 0, + 9, AMR_BIT(lsf[1]), 14, 13, 8, 12, 10, 1, 9, 11, 29, + 9, AMR_BIT(lsf[2]), 57, 58, 50, 56, 60, 59, 49, 71, 70, + 8, AMR_OF(0,p_lag), 17, 19, 23, 21, 31, 24, 32, 52, + 7, AMR_OF(0,p_gain), 36, 82, 69, 46, 42, 48, 77, + 11, AMR_OF(0,pulses[0]), 109, 97, 133, 121, 101, 89, 125, 113, 93, 117, + 105, + 3, AMR_OF(0,pulses[1]), 81, 73, 65, + 4, AMR_OF(1,p_lag), 28, 26, 38, 54, + 7, AMR_OF(1,p_gain), 35, 83, 68, 45, 41, 63, 76, + 11, AMR_OF(1,pulses[0]), 108, 96, 132, 120, 100, 88, 124, 112, 92, 116, + 104, + 3, AMR_OF(1,pulses[1]), 80, 72, 64, + 8, AMR_OF(2,p_lag), 16, 18, 22, 20, 30, 39, 47, 51, + 7, AMR_OF(2,p_gain), 34, 84, 67, 44, 40, 62, 75, + 11, AMR_OF(2,pulses[0]), 107, 111, 131, 135, 99, 103, 123, 127, 91, 115, + 119, + 3, AMR_OF(2,pulses[1]), 95, 87, 79, + 4, AMR_OF(3,p_lag), 27, 25, 37, 53, + 7, AMR_OF(3,p_gain), 33, 85, 66, 43, 55, 61, 74, + 11, AMR_OF(3,pulses[0]), 106, 110, 130, 134, 98, 102, 122, 126, 90, 114, + 118, + 3, AMR_OF(3,pulses[1]), 94, 86, 78, + 0 +}; + +static const uint8_t order_MODE_7k4[] = { + 8, AMR_BIT(lsf[0]), 7, 6, 5, 4, 3, 2, 1, 0, + 9, AMR_BIT(lsf[1]), 15, 14, 13, 12, 11, 10, 9, 8, 23, + 9, AMR_BIT(lsf[2]), 53, 52, 51, 58, 40, 55, 54, 57, 56, + 8, AMR_OF(0,p_lag), 22, 20, 18, 16, 30, 50, 95, 94, + 7, AMR_OF(0,p_gain), 28, 24, 73, 36, 32, 62, 67, + 13, AMR_OF(0,pulses[0]), 127, 123, 135, 131, 143, 139, 151, 103, 102, 101, + 100, 99, 98, + 4, AMR_OF(0,pulses[1]), 83, 75, 79, 71, + 5, AMR_OF(1,p_lag), 44, 42, 49, 93, 92, + 7, AMR_OF(1,p_gain), 27, 39, 72, 35, 47, 61, 66, + 13, AMR_OF(1,pulses[0]), 126, 122, 134, 130, 142, 138, 150, 97, 96, 111, + 110, 109, 108, + 4, AMR_OF(1,pulses[1]), 82, 74, 78, 70, + 8, AMR_OF(2,p_lag), 21, 19, 17, 31, 29, 48, 91, 90, + 7, AMR_OF(2,p_gain), 26, 38, 87, 34, 46, 60, 65, + 13, AMR_OF(2,pulses[0]), 125, 121, 133, 129, 141, 137, 149, 107, 106, 105, + 104, 119, 118, + 4, AMR_OF(2,pulses[1]), 81, 85, 77, 69, + 5, AMR_OF(3,p_lag), 43, 41, 63, 89, 88, + 7, AMR_OF(3,p_gain), 25, 37, 86, 33, 45, 59, 64, + 13, AMR_OF(3,pulses[0]), 124, 120, 132, 128, 140, 136, 148, 117, 116, 115, + 114, 113, 112, + 4, AMR_OF(3,pulses[1]), 80, 84, 76, 68, + 0 +}; + +static const uint8_t order_MODE_7k95[] = { + 9, AMR_BIT(lsf[0]), 67, 68, 1, 2, 3, 4, 5, 6, 7, + 9, AMR_BIT(lsf[1]), 14, 13, 9, 12, 11, 0, 10, 15, 8, + 9, AMR_BIT(lsf[2]), 18, 19, 23, 17, 22, 20, 21, 66, 65, + 8, AMR_OF(0,p_lag), 44, 42, 40, 54, 52, 56, 64, 78, + 4, AMR_OF(0,p_gain), 36, 32, 72, 80, + 5, AMR_OF(0,fixed_gain), 16, 28, 24, 60, 84, + 13, AMR_OF(0,pulses[0]), 135, 109, 144, 156, 120, 97, 148, 121, 101, 122, + 123, 89, 124, + 4, AMR_OF(0,pulses[1]), 125, 126, 127, 112, + 6, AMR_OF(1,p_lag), 50, 48, 62, 70, 76, 74, + 4, AMR_OF(1,p_gain), 35, 47, 87, 95, + 5, AMR_OF(1,fixed_gain), 31, 27, 39, 59, 83, + 13, AMR_OF(1,pulses[0]), 129, 108, 159, 155, 130, 96, 147, 131, 100, 132, + 133, 88, 134, + 4, AMR_OF(1,pulses[1]), 113, 114, 115, 116, + 8, AMR_OF(2,p_lag), 43, 41, 55, 53, 51, 71, 79, 77, + 4, AMR_OF(2,p_gain), 34, 46, 86, 94, + 5, AMR_OF(2,fixed_gain), 30, 26, 38, 58, 82, + 13, AMR_OF(2,pulses[0]), 139, 107, 158, 154, 140, 111, 146, 141, 99, 142, + 143, 103, 128, + 4, AMR_OF(2,pulses[1]), 105, 90, 91, 92, + 6, AMR_OF(3,p_lag), 49, 63, 61, 69, 75, 73, + 4, AMR_OF(3,p_gain), 33, 45, 85, 93, + 5, AMR_OF(3,fixed_gain), 29, 25, 37, 57, 81, + 13, AMR_OF(3,pulses[0]), 149, 106, 157, 153, 150, 110, 145, 151, 98, 136, + 137, 102, 138, + 4, AMR_OF(3,pulses[1]), 117, 118, 119, 104, + 0 +}; + +static const uint8_t order_MODE_10k2[] = { + 8, AMR_BIT(lsf[0]), 0, 1, 2, 3, 4, 5, 6, 7, + 9, AMR_BIT(lsf[1]), 23, 8, 9, 10, 11, 12, 13, 14, 15, + 9, AMR_BIT(lsf[2]), 57, 58, 62, 56, 60, 59, 61, 71, 70, + 8, AMR_OF(0,p_lag), 22, 21, 20, 19, 18, 17, 42, 41, + 7, AMR_OF(0,p_gain), 38, 50, 84, 37, 36, 85, 83, + 1, AMR_OF(0,pulses[0]), 66, + 1, AMR_OF(0,pulses[1]), 67, + 1, AMR_OF(0,pulses[2]), 68, + 1, AMR_OF(0,pulses[3]), 69, + 10, AMR_OF(0,pulses[4]), 145, 144, 156, 153, 154, 163, 161, 192, 206, 195, + 10, AMR_OF(0,pulses[5]), 158, 159, 157, 152, 155, 165, 160, 205, 204, 194, + 7, AMR_OF(0,pulses[6]), 167, 166, 162, 164, 196, 207, 193, + 5, AMR_OF(1,p_lag), 26, 25, 54, 53, 89, + 7, AMR_OF(1,p_gain), 35, 49, 81, 34, 33, 82, 80, + 1, AMR_OF(1,pulses[0]), 78, + 1, AMR_OF(1,pulses[1]), 79, + 1, AMR_OF(1,pulses[2]), 64, + 1, AMR_OF(1,pulses[3]), 65, + 10, AMR_OF(1,pulses[4]), 103, 102, 98, 111, 96, 105, 119, 185, 199, 188, + 10, AMR_OF(1,pulses[5]), 100, 101, 99, 110, 97, 107, 118, 198, 197, 187, + 7, AMR_OF(1,pulses[6]), 109, 108, 104, 106, 189, 184, 186, + 8, AMR_OF(2,p_lag), 16, 31, 30, 29, 28, 27, 40, 55, + 7, AMR_OF(2,p_gain), 32, 48, 94, 47, 46, 95, 93, + 1, AMR_OF(2,pulses[0]), 74, + 1, AMR_OF(2,pulses[1]), 75, + 1, AMR_OF(2,pulses[2]), 76, + 1, AMR_OF(2,pulses[3]), 77, + 10, AMR_OF(2,pulses[4]), 117, 116, 112, 125, 126, 135, 133, 178, 176, 181, + 10, AMR_OF(2,pulses[5]), 114, 115, 113, 124, 127, 121, 132, 191, 190, 180, + 7, AMR_OF(2,pulses[6]), 123, 122, 134, 120, 182, 177, 179, + 5, AMR_OF(3,p_lag), 24, 39, 52, 51, 88, + 7, AMR_OF(3,p_gain), 45, 63, 91, 44, 43, 92, 90, + 1, AMR_OF(3,pulses[0]), 86, + 1, AMR_OF(3,pulses[1]), 87, + 1, AMR_OF(3,pulses[2]), 72, + 1, AMR_OF(3,pulses[3]), 73, + 10, AMR_OF(3,pulses[4]), 131, 130, 142, 139, 140, 149, 147, 171, 169, 174, + 10, AMR_OF(3,pulses[5]), 128, 129, 143, 138, 141, 151, 146, 168, 183, 173, + 7, AMR_OF(3,pulses[6]), 137, 136, 148, 150, 175, 170, 172, + 0 +}; + +static const uint8_t order_MODE_12k2[] = { + 7, AMR_BIT(lsf[0]), 7, 6, 5, 4, 3, 2, 1, + 8, AMR_BIT(lsf[1]), 0, 15, 14, 13, 12, 11, 10, 9, + 9, AMR_BIT(lsf[2]), 23, 22, 21, 20, 19, 18, 17, 16, 8, + 8, AMR_BIT(lsf[3]), 31, 30, 29, 28, 27, 86, 85, 84, + 6, AMR_BIT(lsf[4]), 83, 82, 81, 80, 127, 126, + 9, AMR_OF(0,p_lag), 26, 24, 38, 36, 34, 32, 46, 44, 42, + 4, AMR_OF(0,p_gain), 40, 52, 48, 95, + 5, AMR_OF(0,fixed_gain), 60, 56, 68, 91, 111, + 3, AMR_OF(0,pulses[0]), 191, 176, 177, + 4, AMR_OF(0,pulses[1]), 103, 123, 124, 125, + 3, AMR_OF(0,pulses[2]), 188, 189, 190, + 4, AMR_OF(0,pulses[3]), 99, 120, 121, 122, + 3, AMR_OF(0,pulses[4]), 185, 186, 187, + 4, AMR_OF(0,pulses[5]), 107, 133, 134, 135, + 3, AMR_OF(0,pulses[6]), 198, 199, 184, + 4, AMR_OF(0,pulses[7]), 119, 130, 131, 132, + 3, AMR_OF(0,pulses[8]), 195, 196, 197, + 4, AMR_OF(0,pulses[9]), 115, 143, 128, 129, + 6, AMR_OF(1,p_lag), 64, 78, 76, 74, 72, 245, + 4, AMR_OF(1,p_gain), 55, 51, 63, 94, + 5, AMR_OF(1,fixed_gain), 59, 71, 67, 90, 110, + 3, AMR_OF(1,pulses[0]), 192, 193, 194, + 4, AMR_OF(1,pulses[1]), 102, 140, 141, 142, + 3, AMR_OF(1,pulses[2]), 205, 206, 207, + 4, AMR_OF(1,pulses[3]), 98, 137, 138, 139, + 3, AMR_OF(1,pulses[4]), 202, 203, 204, + 4, AMR_OF(1,pulses[5]), 106, 150, 151, 136, + 3, AMR_OF(1,pulses[6]), 215, 200, 201, + 4, AMR_OF(1,pulses[7]), 118, 147, 148, 149, + 3, AMR_OF(1,pulses[8]), 212, 213, 214, + 4, AMR_OF(1,pulses[9]), 114, 144, 145, 146, + 9, AMR_OF(2,p_lag), 25, 39, 37, 35, 33, 47, 45, 43, 41, + 4, AMR_OF(2,p_gain), 54, 50, 62, 93, + 5, AMR_OF(2,fixed_gain), 58, 70, 66, 89, 109, + 3, AMR_OF(2,pulses[0]), 209, 210, 211, + 4, AMR_OF(2,pulses[1]), 101, 157, 158, 159, + 3, AMR_OF(2,pulses[2]), 222, 223, 208, + 4, AMR_OF(2,pulses[3]), 97, 154, 155, 156, + 3, AMR_OF(2,pulses[4]), 219, 220, 221, + 4, AMR_OF(2,pulses[5]), 105, 167, 152, 153, + 3, AMR_OF(2,pulses[6]), 216, 217, 218, + 4, AMR_OF(2,pulses[7]), 117, 164, 165, 166, + 3, AMR_OF(2,pulses[8]), 229, 230, 231, + 4, AMR_OF(2,pulses[9]), 113, 161, 162, 163, + 6, AMR_OF(3,p_lag), 79, 77, 75, 73, 87, 244, + 4, AMR_OF(3,p_gain), 53, 49, 61, 92, + 5, AMR_OF(3,fixed_gain), 57, 69, 65, 88, 108, + 3, AMR_OF(3,pulses[0]), 226, 227, 228, + 4, AMR_OF(3,pulses[1]), 100, 174, 175, 160, + 3, AMR_OF(3,pulses[2]), 239, 224, 225, + 4, AMR_OF(3,pulses[3]), 96, 171, 172, 173, + 3, AMR_OF(3,pulses[4]), 236, 237, 238, + 4, AMR_OF(3,pulses[5]), 104, 168, 169, 170, + 3, AMR_OF(3,pulses[6]), 233, 234, 235, + 4, AMR_OF(3,pulses[7]), 116, 181, 182, 183, + 3, AMR_OF(3,pulses[8]), 246, 247, 232, + 4, AMR_OF(3,pulses[9]), 112, 178, 179, 180, + 0 +}; + +/** + * position of the bitmapping data for each packet type in + * the AMRNBFrame + */ +static const uint8_t * const amr_unpacking_bitmaps_per_mode[N_MODES] = { + order_MODE_4k75, + order_MODE_5k15, + order_MODE_5k9, + order_MODE_6k7, + order_MODE_7k4, + order_MODE_7k95, + order_MODE_10k2, + order_MODE_12k2, +}; + +/** number of bytes for each mode */ +static const uint8_t frame_sizes_nb[N_MODES] = { + 12, 13, 15, 17, 19, 20, 26, 31, 5 +}; + +/** + * Base-5 representation for values 0-124 + * + * This is useful for decoding pulse positions in 10.2 kbit/s frames. + * Safe values are provided for out of range positions 125-127. + */ +static const uint8_t base_five_table[128][3] = { + {0, 0, 0}, {0, 0, 1}, {0, 0, 2}, {0, 0, 3}, {0, 0, 4}, {0, 1, 0}, {0, 1, 1}, + {0, 1, 2}, {0, 1, 3}, {0, 1, 4}, {0, 2, 0}, {0, 2, 1}, {0, 2, 2}, {0, 2, 3}, + {0, 2, 4}, {0, 3, 0}, {0, 3, 1}, {0, 3, 2}, {0, 3, 3}, {0, 3, 4}, {0, 4, 0}, + {0, 4, 1}, {0, 4, 2}, {0, 4, 3}, {0, 4, 4}, {1, 0, 0}, {1, 0, 1}, {1, 0, 2}, + {1, 0, 3}, {1, 0, 4}, {1, 1, 0}, {1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 1, 4}, + {1, 2, 0}, {1, 2, 1}, {1, 2, 2}, {1, 2, 3}, {1, 2, 4}, {1, 3, 0}, {1, 3, 1}, + {1, 3, 2}, {1, 3, 3}, {1, 3, 4}, {1, 4, 0}, {1, 4, 1}, {1, 4, 2}, {1, 4, 3}, + {1, 4, 4}, {2, 0, 0}, {2, 0, 1}, {2, 0, 2}, {2, 0, 3}, {2, 0, 4}, {2, 1, 0}, + {2, 1, 1}, {2, 1, 2}, {2, 1, 3}, {2, 1, 4}, {2, 2, 0}, {2, 2, 1}, {2, 2, 2}, + {2, 2, 3}, {2, 2, 4}, {2, 3, 0}, {2, 3, 1}, {2, 3, 2}, {2, 3, 3}, {2, 3, 4}, + {2, 4, 0}, {2, 4, 1}, {2, 4, 2}, {2, 4, 3}, {2, 4, 4}, {3, 0, 0}, {3, 0, 1}, + {3, 0, 2}, {3, 0, 3}, {3, 0, 4}, {3, 1, 0}, {3, 1, 1}, {3, 1, 2}, {3, 1, 3}, + {3, 1, 4}, {3, 2, 0}, {3, 2, 1}, {3, 2, 2}, {3, 2, 3}, {3, 2, 4}, {3, 3, 0}, + {3, 3, 1}, {3, 3, 2}, {3, 3, 3}, {3, 3, 4}, {3, 4, 0}, {3, 4, 1}, {3, 4, 2}, + {3, 4, 3}, {3, 4, 4}, {4, 0, 0}, {4, 0, 1}, {4, 0, 2}, {4, 0, 3}, {4, 0, 4}, + {4, 1, 0}, {4, 1, 1}, {4, 1, 2}, {4, 1, 3}, {4, 1, 4}, {4, 2, 0}, {4, 2, 1}, + {4, 2, 2}, {4, 2, 3}, {4, 2, 4}, {4, 3, 0}, {4, 3, 1}, {4, 3, 2}, {4, 3, 3}, + {4, 3, 4}, {4, 4, 0}, {4, 4, 1}, {4, 4, 2}, {4, 4, 3}, {4, 4, 4}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0} +}; + +/** + * Values for the lsp vector from the 4th subframe of the + * previous subframe values. + * + * @note: Taken from Decoder_amr_reset in Q15 using val/1000 + */ +static const int8_t lsp_sub4_init[LP_FILTER_ORDER] = { + 30, 26, 21, 15, 8, 0, -8, -15, -21, -26 +}; + +/** + * Mean lsp values. + * + * @note: Taken from Decoder_amr_reset in Q15 + */ +static const int16_t lsp_avg_init[LP_FILTER_ORDER] = { + 1384, 2077, 3420, 5108, 6742, 8122, 9863, 11092, 12714, 13701 +}; + +// LSF tables + +// These are stored as integers to save space. The values are taken from +// q_plsf_3.tab and q_plsf_5.tab in 3GPP TS 26.090. + +static const int16_t lsf_3_3_MODE_5k15[128][4] = { +{ 419, 163, -30, -262}, { -455, -789,-1430, -721}, { 1006, 664, 269, 25}, +{ 619, 260, 183, 96}, { -968,-1358, -388, 135}, { -693, 835, 456, 154}, +{ 1105, 703, 569, 363}, { 1625, 1326, 985, 748}, { -220, 219, 76, -208}, +{-1455,-1662, 49, 149}, { -964, -172, -752, -336}, { 625, 209, -250, -66}, +{-1017, -838, -2, 317}, {-2168,-1485, -138, 123}, {-1876,-2099, -521, 85}, +{ -967, -366, -695, -881}, { -921,-1011, -763, -949}, { -124, -256, -352, -660}, +{ 178, 463, 354, 304}, {-1744, -591, -282, 79}, {-2249, 175, 867, 499}, +{ -138, -180, -181, -21}, {-2291,-1241, -460, -520}, { -771, 451, -10, -308}, +{ 271, -65, 4, 214}, { -279, -435, -43, -348}, { -670, 35, -65, -211}, +{ 806, 535, 85, 297}, { 57, 239, 722, 493}, { 225, 661, 840, 547}, +{ -540, -376, 14, 349}, { 469, 721, 331, 162}, { -544, -752, -62, -10}, +{ 398, -88, 724, 701}, { -19, -533, -94, 601}, { 136, -71, -681, -747}, +{ -166, -344, 261, -50}, { 161, -52, 485, 337}, {-1675, 50, 190, -93}, +{-2282, -231, -194, -82}, { -95, -595, -154, 128}, { 894, 501, 588, 457}, +{ -345, 206, 122, 110}, { -631, -227, -569, 3}, { 408, 239, 397, 226}, +{ -197, -2, 128, 491}, { 1281, 904, 292, 215}, { 538, 306, 259, 509}, +{ -677,-1047, 13, 321}, { -679, -588, -358, -212}, { -558, 243, 646, 479}, +{ 486, 342, 634, 532}, { 107, 802, 331, 136}, { -112, -398,-1031, -286}, +{ -326, -705, 288, 272}, { 1299, 1144, 1178, 860}, { -423, 121, -385, -148}, +{ -295, -302, -834, -819}, { 16, -24, -201, -476}, { 555, 91, -245, 294}, +{ -38, -379, -962,-1221}, {-1191,-1518, -273, -395}, { -390,-1013, -645, 573}, +{-1843,-1030, 505, 468}, { 744, 947, 609, 493}, { -689,-1172, -628, -135}, +{-1026, 195, 411, 196}, { 1582, 1147, 575, 337}, {-1239, -777, -648, -142}, +{ 595, 825, 967, 735}, {-1206, -970, -81, -342}, { -745, 13, -72, 375}, +{ 454, 19, 1407, 921}, {-1647, -172, 861, 562}, { 928, 1537, 1063, 740}, +{-2472, -952, 264, 82}, { -502, -965,-1334, 123}, { 867, 1236, 534, 171}, +{-2320, -460, 780, 363}, {-1190, -617, 252, -61}, { -174, 34, 1011, 788}, +{-2333, 247, 423, 153}, { -16, -355, 262, 449}, {-1576,-1073, -544, -371}, +{ -615, -305, 1051, 805}, { 687, 528, 6, -182}, { 935, 875, 1002, 809}, +{ 199, 257, 126, 76}, { -584,-1138, 599, 556}, {-1105,-1391,-1591, -519}, +{ -977,-1325, 108, 347}, { -722, -975, 365, 101}, { -145, 681, 249, -153}, +{ 0, -334, -570, 159}, { 412, 285, -336, -617}, { -953, -966, 887, 689}, +{-1251, 84, -185, -398}, { -592, 433, 1044, 653}, { 85, 329, -40, 361}, +{ -433, -705, 466, 574}, { -154, 654, 592, 290}, { -167, 72, 349, 175}, +{ 674, 297, 977, 720}, { 1235, 1204, 757, 488}, { -400, -269, 538, 372}, +{-1350,-1387,-1194, -91}, { 1262, 876, 775, 700}, { -599, -38, -430, -722}, +{ 1976, 1630, 991, 608}, { 111, 276, -226, -96}, { -947, -388, -11, -7}, +{ -303, -531, -839, 338}, { 1734, 1710, 1405, 1013}, { -516, -855, -645, 210}, +{ -688, -416, 513, 230}, { -822, -637,-1146, -320}, { -952, -658, -694, 183}, +{ -114, -623, 818, 674}, { -191, -204, 731, 635}, { 51, 1221, 883, 576}, +{ -954, -431, 826, 598}, { -342, -755, -900, -407}, {-1126, -354, -206, -512}, +{ -547, -810, -357, -620}, { 66, 515, -73, -410}, { -872, -945,-1444,-1227}, +{ 191, -17, -544, -231}, {-1540, -544, -901, -886} +}; + +static const int16_t lsf_3_1_MODE_7k95[512][3] = { +{ -890,-1550,-2541}, { -819, -970, 175}, { -826,-1234, -762}, +{ -599, -22, 634}, { -811, -987, -902}, { -323, 203, 26}, +{ -383, -235, -781}, { -399, 1262, 906}, { -932,-1399,-1380}, +{ -624, 93, 87}, { -414, -539, -691}, { 37, 633, 510}, +{ -387, -476,-1330}, { 399, 66, 263}, { -407, -49, -335}, +{ -417, 1041, 1865}, { -779,-1089,-1440}, { -746, -858, 832}, +{ -581, -759, -371}, { -673, -506, 2088}, { -560, -634,-1179}, +{ 271, 241, 14}, { -438, -244, -397}, { 463, 1202, 1047}, +{ -606, -797,-1438}, { -51, -323, 481}, { -224, -584, -527}, +{ 494, 881, 682}, { -433, -306,-1002}, { 554, 659, 222}, +{ 171, -160, -353}, { 681, 1798, 1565}, { -852,-1181,-1695}, +{ -336, -666, 114}, { -581, -756, -744}, { -195, 375, 497}, +{ -465, -804,-1098}, { 154, 282, -131}, { -50, -191, -719}, +{ 323, 732, 1542}, { -722, -819,-1404}, { 105, -250, 185}, +{ -178, -502, -742}, { 321, 510, 1111}, { -323, -567, -966}, +{ 127, 484, 338}, { -160, 52, -338}, { 732, 1367, 1554}, +{ -626, -802,-1696}, { -286, -586, 676}, { -695, -343, -370}, +{ -490, 295, 1893}, { -630, -574,-1014}, { -80, 645, -69}, +{ -6, -318, -364}, { 782, 1450, 1038}, { -313, -733,-1395}, +{ 120, 60, 477}, { -264, -585, -123}, { 711, 1245, 633}, +{ -91, -355,-1016}, { 771, 758, 261}, { 253, 81, -474}, +{ 930, 2215, 1720}, { -808,-1099,-1925}, { -560, -782, 169}, +{ -804,-1074, -188}, { -626, -55, 1405}, { -694, -716,-1194}, +{ -660, 354, 329}, { -514, -55, -543}, { 366, 1033, 1182}, +{ -658, -959,-1357}, { -55, -184, 93}, { -605, -286, -662}, +{ 404, 449, 827}, { -286, -350,-1263}, { 628, 306, 227}, +{ -16, 147, -623}, { 186, 923, 2146}, { -674, -890,-1606}, +{ -443, -228, 339}, { -369, -790, -409}, { 231, 86, 1469}, +{ -448, -581,-1061}, { 594, 450, -177}, { -124, -170, -447}, +{ 671, 1159, 1404}, { -476, -667,-1511}, { -77, -138, 716}, +{ -177, -372, -381}, { 451, 934, 915}, { -250, -432, -822}, +{ 272, 828, 446}, { 26, 19, -31}, { 698, 1692, 2168}, +{ -646, -977,-1924}, { -179, -473, 268}, { -379, -745, -691}, +{ 11, 127, 1033}, { -488, -917, -825}, { 61, 323, 135}, +{ 147, -145, -686}, { 685, 786, 1682}, { -506, -848,-1297}, +{ 35, 90, 222}, { -23, -346, -670}, { 455, 591, 1287}, +{ -203, -593,-1086}, { 652, 352, 437}, { 39, 63, -457}, +{ 841, 1265, 2105}, { -520, -882,-1584}, { -328, -711, 1421}, +{ -596, -342, -70}, { 209, 173, 1928}, { -423, -598, -921}, +{ 421, 605, -38}, { -2, -245, -127}, { 896, 1969, 1135}, +{ -379, -518,-1579}, { 173, 118, 753}, { -55, -381, -52}, +{ 985, 1021, 753}, { -2, -291, -891}, { 753, 992, 423}, +{ 264, 131, -196}, { 895, 2274, 2543}, { -635,-1088,-2499}, +{ -529, -982, 526}, { -764, -830, -548}, { -436, 316, 599}, +{ -675, -940, -746}, { -57, 236, -11}, { -201, -81, -798}, +{ 16, 845, 1558}, { -737, -985,-1212}, { -468, 17, 290}, +{ -279, -584, -700}, { 183, 822, 705}, { -265, -492,-1187}, +{ 421, 152, 468}, { -390, 166, -268}, { 39, 1550, 1868}, +{ -635, -966,-1571}, { -453, -492, 910}, { -284,-1027, -75}, +{ -181, -133, 1852}, { -445, -624,-1174}, { 420, 367, -49}, +{ -389, -212, -169}, { 707, 1073, 1208}, { -539, -710,-1449}, +{ 83, -163, 484}, { -236, -543, -355}, { 338, 1175, 814}, +{ -246, -309, -958}, { 606, 760, 60}, { 166, -8, -163}, +{ -306, 1849, 2563}, { -747,-1025,-1783}, { -419, -446, 209}, +{ -718, -566, -534}, { -506, 693, 857}, { -463, -697,-1082}, +{ 325, 431, -206}, { -15, -8, -763}, { 545, 919, 1518}, +{ -611, -783,-1313}, { 256, -55, 208}, { -165, -348, -662}, +{ 321, 680, 930}, { -326, -429, -951}, { 484, 446, 570}, +{ -197, 72, -73}, { 909, 1455, 1741}, { -563, -737,-1974}, +{ -124, -416, 718}, { -478, -404, -314}, { -16, 446, 1636}, +{ -551, -537, -750}, { -58, 638, 214}, { 55, -185, -271}, +{ 1148, 1301, 1212}, { -483, -671,-1264}, { 117, 285, 543}, +{ -204, -391, -111}, { 513, 1538, 854}, { -114, -190, -978}, +{ 877, 595, 464}, { 260, 260, -311}, { 748, 2283, 2216}, +{ -517, -945,-2171}, { -326, -708, 378}, { -812, -691, -232}, +{ -560, 687, 1409}, { -732, -690, -836}, { -359, 645, 386}, +{ -265, 62, -678}, { 145, 1644, 1208}, { -555, -988,-1233}, +{ -78, 14, 114}, { -327, -358, -489}, { 392, 677, 697}, +{ -201, -236,-1140}, { 693, 449, 178}, { -243, 256, -433}, +{ 611, 1385, 2456}, { -612, -901,-1464}, { -307, -17, 499}, +{ -315, -667, -254}, { 256, 428, 1463}, { -486, -422,-1056}, +{ 655, 370, 18}, { -102, -185, -276}, { 755, 1578, 1335}, +{ -488, -603,-1418}, { 182, -93, 870}, { -73, -458, -348}, +{ 835, 862, 957}, { -282, -333, -746}, { 547, 839, 428}, +{ 273, -89, 13}, { 940, 1708, 2576}, { -418,-1084,-1758}, +{ -44, -358, 259}, { -497, -643, -560}, { 99, 557, 961}, +{ -421, -766, -917}, { 295, 326, 184}, { 175, 15, -626}, +{ 532, 878, 1981}, { -443, -768,-1275}, { 221, 156, 268}, +{ 39, -363, -505}, { 695, 772, 1140}, { -162, -459, -912}, +{ 709, 444, 658}, { 25, 303, -312}, { 1268, 1410, 1715}, +{ -297, -766,-1836}, { -263, -108, 1070}, { -406, -13, -129}, +{ 57, 438, 2734}, { -374, -487, -835}, { 304, 696, 164}, +{ 104, -235, 5}, { 1611, 1900, 1399}, { -229, -582,-1325}, +{ 405, 192, 817}, { -87, -438, 111}, { 1028, 1199, 993}, +{ 68, -175, -934}, { 1033, 1117, 451}, { 478, 200, -248}, +{ 2127, 2696, 2042}, { -835,-1323,-2131}, { -799, -692, 466}, +{ -812,-1032, -469}, { -622, 288, 920}, { -701, -841,-1070}, +{ -411, 512, 8}, { -390, -91, -744}, { -30, 1043, 1161}, +{ -822,-1148,-1156}, { -294, -46, 110}, { -411, -374, -678}, +{ 214, 531, 668}, { -406, -420,-1194}, { 487, 232, 303}, +{ -318, 91, -472}, { 123, 1232, 2445}, { -722, -952,-1495}, +{ -738, -675, 1332}, { -543, -606, -211}, { -95, -98, 1508}, +{ -549, -514,-1193}, { 473, 211, 73}, { -288, -112, -389}, +{ 537, 1332, 1258}, { -567, -755,-1545}, { 71, -283, 632}, +{ -170, -481, -493}, { 681, 1002, 817}, { -356, -331, -877}, +{ 419, 706, 346}, { 241, -34, -326}, { 377, 1950, 1883}, +{ -727,-1075,-1625}, { -233, -543, 116}, { -524, -806, -585}, +{ -73, 478, 729}, { -288, -925,-1143}, { 173, 447, -52}, +{ 68, -229, -606}, { 449, 529, 1797}, { -591, -875,-1363}, +{ 183, -144, 324}, { -103, -452, -666}, { 623, 488, 1176}, +{ -238, -511,-1004}, { 326, 552, 458}, { 136, 108, -319}, +{ 626, 1343, 1883}, { -490, -646,-1730}, { -186, -449, 984}, +{ -738, -76, -170}, { -550, 755, 2560}, { -496, -510, -947}, +{ 210, 694, -52}, { 84, -322, -199}, { 1090, 1625, 1224}, +{ -376, -603,-1396}, { 343, 74, 632}, { -175, -502, -32}, +{ 972, 1332, 734}, { 52, -295,-1113}, { 1065, 918, 160}, +{ 393, 107, -397}, { 1214, 2649, 1741}, { -632,-1201,-1891}, +{ -719, -277, 353}, { -651, -880, -122}, { -211, 209, 1338}, +{ -562, -714,-1059}, { -208, 388, 159}, { -320, -61, -551}, +{ 293, 1092, 1443}, { -648, -865,-1253}, { -49, -143, 305}, +{ -401, -227, -585}, { 561, 532, 927}, { -117, -443,-1188}, +{ 507, 436, 292}, { -79, 233, -458}, { 671, 1025, 2396}, +{ -633, -842,-1525}, { -308, -286, 640}, { -373, -621, -407}, +{ 418, 253, 1305}, { -315, -581,-1137}, { 572, 685, -281}, +{ 61, -68, -371}, { 991, 1101, 1498}, { -493, -683,-1362}, +{ -47, 164, 704}, { -256, -314, -268}, { 631, 949, 1052}, +{ -118, -348, -833}, { 68, 1180, 568}, { 152, 117, 34}, +{ 1113, 1902, 2239}, { -601, -959,-1706}, { -143, -489, 480}, +{ -332, -655, -574}, { 54, 353, 1192}, { -462, -652, -796}, +{ 150, 549, 112}, { 195, -111, -515}, { 679, 1108, 1647}, +{ -558, -749,-1217}, { -9, 272, 341}, { -53, -265, -535}, +{ 489, 843, 1298}, { -120, -482,-1032}, { 632, 543, 408}, +{ 179, 306, -526}, { 1124, 1464, 2244}, { -417, -786,-1562}, +{ -224, -384, 1364}, { -377, -459, -25}, { 385, 489, 2174}, +{ -332, -651, -829}, { 544, 553, 61}, { 22, -113, -89}, +{ 1128, 1725, 1524}, { -216, -373,-1653}, { 161, 316, 908}, +{ -165, -222, -67}, { 1362, 1175, 789}, { 73, -252, -767}, +{ 738, 932, 616}, { 362, 246, -126}, { 787, 2654, 3027}, +{ -691,-1106,-2190}, { -565, -588, 524}, { -590, -979, -490}, +{ -263, 397, 982}, { -577, -837, -945}, { -22, 435, -49}, +{ -190, -118, -629}, { -88, 1240, 1513}, { -636,-1051,-1019}, +{ -291, 189, 259}, { -257, -470, -629}, { 145, 945, 894}, +{ -326, -364,-1094}, { 543, 260, 630}, { -202, 189, -209}, +{ 357, 1379, 2091}, { -569,-1075,-1449}, { -714, -239, 919}, +{ -420, -705, -84}, { -109, -114, 2407}, { -413, -529,-1177}, +{ 482, 368, 131}, { -186, -72, -131}, { 861, 1255, 1220}, +{ -611, -658,-1341}, { 227, -121, 631}, { -176, -489, -218}, +{ 745, 1175, 957}, { -321, -148, -936}, { 671, 966, 216}, +{ 340, -3, -143}, { 469, 1848, 2437}, { -729, -961,-1683}, +{ -213, -254, 321}, { -511, -438, -521}, { -126, 725, 903}, +{ -340, -685,-1032}, { 316, 480, 20}, { 23, -89, -551}, +{ 353, 1051, 1789}, { -544, -757,-1364}, { 298, -25, 436}, +{ -100, -392, -519}, { 467, 754, 1078}, { -210, -398,-1078}, +{ 620, 658, 630}, { 33, 147, -178}, { 921, 1687, 1921}, +{ -325, -528,-1978}, { 2, -285, 910}, { -371, -490, -230}, +{ 0, 597, 2010}, { -496, -395, -834}, { 37, 945, 245}, +{ 181, -160, -144}, { 1481, 1373, 1357}, { -355, -601,-1270}, +{ 298, 322, 672}, { -193, -336, 77}, { 1089, 1533, 922}, +{ 177, -39,-1125}, { 996, 781, 536}, { 456, 366, -432}, +{ 1415, 2440, 2279}, { -466, -758,-2325}, { -303, -509, 387}, +{ -727, -557, 66}, { -145, 643, 1248}, { -544, -676, -916}, +{ -225, 862, 588}, { -152, 40, -533}, { 423, 1423, 1558}, +{ -572, -843,-1145}, { -128, 85, 461}, { -238, -257, -584}, +{ 605, 748, 861}, { 24, -202,-1409}, { 797, 487, 303}, +{ -181, 364, -182}, { 616, 1378, 2942}, { -494, -852,-1441}, +{ -292, 61, 812}, { -84, -723, -182}, { 555, 532, 1506}, +{ -365, -493,-1057}, { 822, 588, 11}, { -14, -18, -230}, +{ 1001, 1401, 1451}, { -474, -569,-1292}, { 302, 62, 1062}, +{ -70, -376, -222}, { 982, 974, 1149}, { -196, -234, -795}, +{ 479, 1098, 499}, { 362, 58, 70}, { 1147, 2069, 2857}, +{ -487, -878,-1824}, { 73, -288, 348}, { -358, -500, -508}, +{ 199, 721, 1242}, { -78, -697, -795}, { 361, 536, 196}, +{ 374, 110, -735}, { 847, 1051, 1896}, { -366, -713,-1182}, +{ 315, 320, 429}, { 72, -215, -450}, { 759, 886, 1363}, +{ -30, -428, -834}, { 861, 627, 796}, { 118, 468, -279}, +{ 1355, 1883, 1893}, { -188, -642,-1612}, { 63, -175, 1198}, +{ -418, -211, 51}, { 414, 587, 2601}, { -234, -557, -858}, +{ 424, 889, 222}, { 136, -101, 83}, { 1413, 2278, 1383}, +{ -84, -445,-1389}, { 414, 313, 1045}, { 29, -343, 65}, +{ 1552, 1647, 980}, { 183, -91, -829}, { 1273, 1413, 360}, +{ 553, 272, -107}, { 1587, 3149, 2603} +}; + +static const int16_t lsf_3_1[256][3] = { +{ 6, 82, -131}, { 154, -56, -735}, { 183, -65, -265}, +{ 9, -210, -361}, { 113, 718, 1817}, { 1010, 1214, 1573}, +{ 857, 1333, 2276}, { 827, 1568, 1933}, { 717, 1989, 2206}, +{ 838, 1172, 1823}, { 721, 1000, 2154}, { 286, 476, 1509}, +{ -247, -531, 230}, { 147, -82, 569}, { 26, -177, -944}, +{ -27, -273, 692}, { -164, -264, -183}, { 224, 790, 1039}, +{ 899, 946, 601}, { 485, 771, 1150}, { 524, 677, 903}, +{ -140, 375, 778}, { 410, 676, 429}, { 301, 530, 1009}, +{ 719, 646, 38}, { 226, 367, 40}, { 145, -45, -505}, +{ 290, 121, -121}, { 302, 127, 166}, { -124, -383, -956}, +{ -358, -455, -977}, { 715, 878, 894}, { 978, 923, 211}, +{ 477, 272, 64}, { 188, -78, 17}, { -143, -65, 38}, +{ 643, 586, 621}, { -134, -426, -651}, { 347, 545, 2820}, +{ 1188, 2726, 2442}, { 142, -80, 1735}, { 283, 130, 461}, +{ -262, -399,-1145}, { -411, 155, 430}, { 329, 375, 779}, +{ 53, -226, -139}, { -129, -236, 1682}, { 285, 744, 1327}, +{ 738, 697, 1664}, { 312, 409, 266}, { 325, 720, 135}, +{ 1, 221, 453}, { 8, 203, 145}, { 299, 640, 760}, +{ 29, 468, 638}, { 103, 429, 379}, { 420, 954, 932}, +{ 1326, 1210, 1258}, { 704, 1012, 1152}, { -166, -444, -266}, +{ -316, -130, -376}, { 191, 1151, 1904}, { -240, -543,-1260}, +{ -112, 268, 1207}, { 70, 1062, 1583}, { 278, 1360, 1574}, +{ -258, -272, -768}, { 19, 563, 2240}, { -3, -265, 135}, +{ -295, -591, -388}, { 140, 354, -206}, { -260, -504, -795}, +{ -433, -718,-1319}, { 109, 331, 962}, { -429, -87, 652}, +{ -296, 426, 1019}, { -239, 775, 851}, { 489, 1334, 1073}, +{ -334, -332, 25}, { 543, 1206, 1807}, { 326, 61, 727}, +{ 578, 849, 1405}, { -208, -277, 329}, { -152, 64, 669}, +{ -434, -678, -727}, { -454, -71, 251}, { 605, 480, 254}, +{ -482, 11, 996}, { -289, 395, 486}, { 722, 1049, 1440}, +{ -30, -316, -786}, { -106, -115, -619}, { 861, 1474, 1412}, +{ 1055, 1366, 1184}, { 812, 1237, 925}, { 42, -251, -576}, +{ 342, 141, -454}, { -168, -80, 1359}, { -342, -656,-1763}, +{ 100, 821, 725}, { 990, 747, 800}, { 332, 440, 568}, +{ 663, 379, 852}, { 112, 165, -369}, { 597, 910, 282}, +{ -8, 834, 1281}, { -352, 572, 695}, { 462, 2246, 1806}, +{ 345, 190, 1374}, { 416, 915, 2166}, { 168, -82, 280}, +{ -516, -446, 840}, { 47, 533, 44}, { -362, -711,-1143}, +{ 22, 193, 1472}, { -85, 233, 1813}, { -62, 579, 1504}, +{ 550, 944, 1749}, { 723, 650, 1148}, { 972, 884, 1395}, +{ -425, 643, 0}, { 1000, 952, 1098}, { 249, 1446, 672}, +{ -334, -87, 2172}, { -554, 1882, 2672}, { 140, 1826, 1853}, +{ 920, 1749, 2590}, { 1076, 1933, 2038}, { -137, -443,-1555}, +{ 1269, 1174, 468}, { -493, -122, 1521}, { -451, 1033, 1214}, +{ 482, 1695, 1118}, { 815, 649, 384}, { -446, -692, 107}, +{ -319, -605, -118}, { -207, -505, 525}, { -468, -12, 2736}, +{ 75, 1934, 1305}, { 880, 2358, 2267}, { 1285, 1575, 2004}, +{ -48, -304,-1186}, { -435, -461, -251}, { -366, -404, -547}, +{ -289, -605, -597}, { -538, -810, -165}, { -120, 3, 356}, +{ 639, 1241, 1502}, { 96, 177, 750}, { -435, -585,-1174}, +{ -356, 109, -79}, { -485, 288, 2005}, { 9, 1116, 731}, +{ 880, 2134, 946}, { -265, 1585, 1065}, { 1157, 1210, 843}, +{ -498, -668, 431}, { 374, 321, -229}, { 1440, 2101, 1381}, +{ 449, 461, 1155}, { -105, 39, -384}, { -263, 367, 182}, +{ -371, -660, 773}, { -188, 1151, 971}, { 1333, 1632, 1435}, +{ 774, 1267, 1221}, { -482, -832,-1489}, { -237, -210, 860}, +{ 890, 1615, 1064}, { 472, 1062, 1192}, { 185, 1077, 989}, +{ -568, -992,-1704}, { -449, -902,-2043}, { -142, -377, -458}, +{ -210, -554,-1029}, { -11, 1133, 2265}, { -329, -675, -893}, +{ -250, 657, 1187}, { 519, 1510, 1779}, { 520, 539, 1403}, +{ 527, 1421, 1302}, { -563, -871,-1248}, { -147, -463, 879}, +{ -76, 2334, 2840}, { 563, 2573, 2385}, { 632, 1926, 2920}, +{ 719, 2023, 1840}, { -545, -723, 1108}, { 129, -125, 884}, +{ 1417, 1632, 925}, { -94, 1566, 1751}, { -341, 1533, 1551}, +{ 591, 395, -274}, { -76, 981, 2831}, { 153, 2985, 1844}, +{ 1032, 2565, 2749}, { 1508, 2832, 1879}, { 791, 1199, 538}, +{ -190, -453, 1489}, { -278, -548, 1158}, { -245, 1941, 2044}, +{ 1024, 1560, 1650}, { 512, 253, 466}, { -62, -323, 1151}, +{ -473, -376, 507}, { -433, 1380, 2162}, { 899, 1943, 1445}, +{ 134, 704, 440}, { 460, 525, -28}, { -450, 279, 1338}, +{ 0, 971, 252}, { -445, -627, -991}, { -348, -602,-1424}, +{ 398, 712, 1656}, { -107, 314, -178}, { 93, 2226, 2238}, +{ 518, 849, 656}, { -462, -711, -447}, { 174, -34, 1191}, +{ -119, 42, 1005}, { -372, 274, 758}, { 1036, 2352, 1838}, +{ 675, 1724, 1498}, { 430, 1286, 2133}, { -129, -439, 0}, +{ -373, 800, 2144}, { 6, 1587, 2478}, { 478, 596, 2128}, +{ -428, -736, 1505}, { 385, 178, 980}, { 139, 449, 1225}, +{ -526, -842, -982}, { 145, 1554, 1242}, { 623, 1448, 656}, +{ 349, 1016, 1482}, { 31, -280, 415}, { -316, 724, 1641}, +{ 360, 1058, 556}, { -436, -358, 1201}, { -355, 1123, 1939}, +{ 401, 1584, 2248}, { -527,-1012, 355}, { 233, 238, 2233}, +{ -550, -897, -639}, { -365, -501, 1957}, { 389, 1860, 1621}, +{ 162, 1132, 1264}, { -237, 1174, 1390}, { -640, -411, 116}, +{ -228, 1694, 2298}, { 1639, 2186, 2267}, { 562, 1273, 2658}, +{ 323, 338, 1774}, { 578, 1107, 852}, { 22, 594, 934}, +{ -143, 718, 446} +}; + + +static const int16_t lsf_3_2[512][3] = { +{ 50, 71, -9}, { -338, -698,-1407}, { 102, -138, -820}, +{ -310, -469,-1147}, { 414, 67, -267}, { 1060, 814, 1441}, +{ 1548, 1360, 1272}, { 1754, 1895, 1661}, { 2019, 2133, 1820}, +{ 1808, 2318, 1845}, { 644, -93, 454}, { 858, 329, -136}, +{ 489, -258, -128}, { -198, -745, -41}, { -52, -265, -985}, +{ 346, 137, 479}, {-1741, -748, -684}, {-1163,-1725, -367}, +{ -895,-1145, -784}, { -488, -946, -968}, { -85, -390, -725}, +{ 215, -340, -171}, { 1020, 916, 1969}, { 564, 179, 746}, +{ 662, 977, 1734}, { 887, 622, 914}, { 939, 856, 1165}, +{ 309, 688, 803}, { 917, 161, 570}, { 118, -20, -283}, +{ -816, -42, 204}, {-1228, -325, -462}, { -963, -202, -143}, +{ -988, -484, -361}, { -702, -978, -477}, { -302, -790,-1188}, +{ -100, -786,-1088}, {-1054, -947,-1684}, { -202, -843, -782}, +{-1039,-1378, -901}, { -624, -110, -85}, { 356, 213, -10}, +{ -493, 364, 774}, { 425, 822, 479}, { -83, 557, 520}, +{ -992,-1560, -572}, { -603, -741, -26}, { -502, -638, -903}, +{ 209, 306, 147}, { -316, -593, -596}, { -85, -211, -225}, +{ -918, -529, 117}, { 233, -439, -738}, { 1101, 751, 633}, +{ 1457, 1716, 1511}, { 1765, 1457, 910}, { 1122, 1156, 849}, +{ 1354, 868, 470}, { -871,-1150,-1796}, { -871, -861, -992}, +{ -118, 155, 212}, {-1051, -849, -606}, {-1117,-1849,-2750}, +{-1019,-1427,-1869}, { 370, -184, -414}, { 959, 493, 104}, +{ 958, 1039, 543}, { 154, 653, 201}, { 1249, 507, 150}, +{ 663, 503, 230}, { 623, 777, 675}, { 659, 88, -110}, +{ 843, 244, 224}, { 382, 541, 302}, { 724, 433, 666}, +{ 1166, 734, 341}, { -138, 20, -397}, {-1183, -424, -46}, +{ -321, -352, -124}, { 1333, 1021, 1080}, { 262, 366, 723}, +{ 922, 283, -551}, { 31, -636, -611}, { -689, -697, -415}, +{ -952, -779, -201}, {-1329, -598, -359}, { -953,-1285, 166}, +{ 493, 305, 221}, { 846, 703, 610}, { 840, 936, 774}, +{ -723,-1324,-1261}, { -357,-1025,-1388}, {-1096,-1376, -365}, +{-1416,-1881, -608}, {-1798,-1727, -674}, { -545,-1173, -703}, +{ 678, 786, 148}, { -123, 696, 1288}, { 644, 350, -10}, +{ 414, 614, 15}, { 137, 344, -211}, { -814,-1512, -819}, +{ -391, -930, -588}, { 47, -591, -898}, { -909,-1097, -163}, +{-1272,-1167, -157}, {-1464,-1525, -389}, {-1274,-1188, -624}, +{ 671, 213, 454}, { 124, -274, -525}, { -729, -496, -152}, +{-1344, 122, 135}, {-2905, -589, -394}, {-1728, 441, -50}, +{ 1476, 904, 787}, { 316, 236, -440}, { -347, 217, 413}, +{ -911, -917, 121}, { -455, -932, 202}, { -92, -465, -375}, +{ 488, 390, 474}, { 876, 729, 316}, {-1815,-1312, -669}, +{ 87, 962, 432}, { 563, -249,-1058}, { 250, 285, 1105}, +{ 1141, 427, 696}, {-1038,-1664,-1582}, { -948, 346, 160}, +{ -309, -272, -858}, { 670, 624, 1250}, { -944, -408, -666}, +{ -606, -320, -384}, { -492, 230, 65}, { 334, -50, -16}, +{ -16, -690,-1397}, { 1791, 1716, 1399}, { 2478, 2063, 1404}, +{ 1245, 1471, 1426}, { -382,-1037, -2}, { 173, -398, 1145}, +{ 1491, 2024, 1801}, { 772, 1274, 1506}, { 1429, 1735, 2001}, +{ 1079, 1218, 1273}, {-1154,-1851,-1329}, { -808,-1133,-1096}, +{ -451,-1033,-1722}, { 65, 578, -84}, {-1476,-2434,-1778}, +{ -765,-1366, -494}, { -218, -594, -931}, { 337, -236, 562}, +{ 2357, 2662, 1938}, { 1489, 1276, 874}, { 189, 358, 374}, +{-1519,-2281,-2346}, { -967,-1271,-2095}, { -628,-1188,-1542}, +{ 1661, 1043, 546}, { 565, 1061, 732}, { -64, -836, -434}, +{ -436, -96, 203}, { 1078, 1216, 1636}, { 907, 1534, 986}, +{ 326, 965, 845}, { 142, -84, 197}, { 470, 2379, 1570}, +{ 1133, 470, 1214}, { 395, 1376, 1200}, { 1125, 1042, 348}, +{ -543,-1234, -376}, { -215, -181, 481}, {-1947,-1621, -210}, +{ -750,-1185, 390}, { 29, -399, 27}, { 820, 1236, 755}, +{ 695, 979, 409}, { -174, 1197, 1035}, { 912, 1356, 1846}, +{ -992,-1437, 484}, {-1485,-1700, 208}, { -412, 1204, 1432}, +{ -271, 896, 1144}, { -416, 1777, 1434}, {-1696,-2644, -204}, +{-1789,-1551, 1033}, {-1656,-1559, 1303}, {-1253,-1589, 1081}, +{ -669,-1095, -66}, { -682, 320, -345}, { 659, 305, 1069}, +{-1292, -804, -19}, {-1635,-1291, 29}, {-1683, -497, 71}, +{ -287, -7, -100}, { -494, -962, -237}, { 852, 1881, 1740}, +{-1217,-1387, 227}, { -660, 302, 373}, { 96, 1087, 1257}, +{-1074,-1669, 160}, { 485, 2076, 1798}, { -934, -220, 552}, +{ -596, -612, 237}, { 336, 1720, 879}, { 643, 629, 434}, +{ 1267, 522, 1633}, { 15, 244, -441}, { 1475, 717, 184}, +{ 1819, 1590, 1709}, { 988, 261, 937}, { 2093, 2345, 1520}, +{ 2139, 1858, 1606}, { -577, -579,-1203}, { -956, 135, -488}, +{ -464, 51, -338}, { -629, -348, -723}, { 1146, 2073, 1442}, +{ 2192, 1466, 911}, {-1444,-1572,-2278}, { 1400, 710, 1297}, +{ 1335, 633, 928}, { 1434, 2194, 2594}, { 2422, 2204, 1881}, +{ 982, 2242, 1854}, { 380, 792, 1145}, { -63, -539, 414}, +{ -252, -964, -314}, {-1261, -683, -780}, { -831, -526,-1005}, +{-1666,-1135, -424}, {-1611, -452, -299}, { 1268, 1048, 642}, +{ 1147, 853, 856}, { -675, -336, 139}, { 2268, 1343, 1418}, +{ 29, 768, 797}, {-1224, 423, 564}, {-1318,-1082, 245}, +{-1302, -812, 573}, {-1298,-1617, 646}, { -968, 834, 723}, +{ 993, 1652, 2027}, { -191, -817, 432}, { 662, 60, 198}, +{ 626, 997, 1330}, { 1648, 1963, 1289}, {-1597, -93, -45}, +{-1088, 37, -84}, { 1653, 2607, 2337}, { 1065, 2040, 2377}, +{ 1139, 2326, 2118}, { 859, 357, 1510}, { 664, 1227, 1099}, +{ 479, 1360, 912}, { 1897, 1754, 2019}, { 1168, 1909, 1784}, +{ 399, 34, 256}, { -593, -304,-1053}, { 547, 1694, 1407}, +{ 647, -99, -341}, { 1492, 1647, 1190}, { 38, -644, -212}, +{ 395, 846, 222}, { -704, -765, -716}, { -724,-1964,-2804}, +{ -150, 291, -82}, { 1233, 1459, 1007}, { -140, -155, 153}, +{ 439, 297, 1568}, {-1529, -410, -636}, { 1536, 455, -237}, +{-1328, -139, -260}, { 531, 554, 868}, { 269, 1264, 606}, +{ -233, 883, 463}, { 742, 600, -120}, { -73, 421, 212}, +{ -439, -58, 804}, {-1286,-1241, 728}, { 294, -490, 50}, +{ -591, -905,-1254}, { 42, -687, 147}, { -25, 273, 596}, +{ -311, 1213, 601}, { -754, 849, 584}, { 429, 607, 587}, +{ -602, -166, 461}, { -796, -823, 777}, { 1380, 910, 1755}, +{ 119, 1417, 972}, { -219, -880,-1596}, {-1049,-1010, 438}, +{ -713,-1379, 78}, { 0, -447,-1179}, {-1136,-1319,-1573}, +{ 2248, 1767, 1309}, { 946, 1583, 1432}, { 1150, 482, 436}, +{ -469,-1108, 618}, { -447, -966, 1088}, {-1252,-1515, -114}, +{-1104,-2008, -579}, { 210, 613, 497}, {-1975,-1437, 642}, +{-1269, -856, 1011}, {-1646,-1185, 1063}, {-1555, -672, 1204}, +{-1692,-1114, 623}, { -979,-1326,-1277}, { 539, -147, 894}, +{-1354, -897, -434}, { 888, 475, 428}, { 153, -384, 338}, +{-1492, -511, 359}, { -974,-1115, -470}, { 105, -550, 677}, +{ -937,-1145, 877}, { 380, -260, 210}, { 1685, 924, 1256}, +{ 1775, 1190, 1095}, { 1419, 631, 533}, { 627, 299, -347}, +{ -411, -534, 647}, { -650, 29, -595}, { -378,-1367, 1563}, +{ 1402, 1121, 1465}, { 1089, 1410, 648}, {-2096,-1090, -6}, +{ 311, -194, -869}, { -639, -831, 416}, {-1162,-1224, 1349}, +{-1247, -941, 1813}, {-2193,-1987, 453}, { -619,-1367, -956}, +{-1606,-1972,-1507}, {-1175,-1057,-1104}, { -377, 601, 201}, +{ 1876, 825, 374}, { -430,-1323, 29}, {-1397,-1249,-1331}, +{-1007,-1504, 960}, {-1401,-2009, 197}, {-1379,-1949, -236}, +{-1077, 123, 422}, { 615, 1269, 546}, { -306, 1526, 904}, +{ 1194, 1788, 1177}, { -626, -884,-1526}, { 199, 766, 1504}, +{-1065, 862, 197}, {-1034,-1773, -887}, { -800, 145, 599}, +{-1134, -519, 626}, {-1205,-1926, 500}, { -910,-1041,-1395}, +{-1476,-1567, -969}, { -523, 842, 34}, { 1794, 646, 862}, +{-1207,-1888,-1002}, { -78, -9, -672}, { 1044, 759, 80}, +{ -600, 1139, 1019}, { 57, 2000, 1422}, { -833, 1414, 1121}, +{-1202, 1630, 1260}, { -461, 1420, 1244}, { 1537, 975, 253}, +{ -283, 324, -359}, { 599, -195, 106}, { 588, 62, -587}, +{ -757, 645, 205}, { 51, 1201, 758}, {-1209, 673, -390}, +{ -624, 1581, 941}, { -151, 1023, 735}, { 2820, 1301, 690}, +{ -302, 524, -99}, { -900,-1588,-1189}, { 1084, 251, 238}, +{ 2014, 1792, 1010}, { 1245, 1633, 1741}, {-1227,-1540,-1208}, +{ -621, 456, -109}, { 40, -65, 788}, { -805, -699,-1350}, +{ -583, 904, 832}, { -801, 532, 594}, { 1972, 1408, 1351}, +{-1177,-1880,-2114}, { -773, 568, 948}, {-1015, 1079, 1260}, +{-1111, 482, -130}, { 1778, 1044, 780}, {-1491, 245, 912}, +{ -316,-1141, -917}, { -536,-1442,-2346}, { -785,-1546,-1988}, +{-2003, 257, 909}, {-1849, -633,-1209}, {-1538,-1918,-1054}, +{ 1606, 2239, 1576}, { -567,-1500,-1544}, {-1279, 195, 1369}, +{ -817, 293, 1219}, { -525, 630, 1197}, {-1698,-2425,-1840}, +{ -303, 731, 747}, {-1169, -251, 269}, { -950, -75, 1684}, +{-1182, -453, 1005}, {-1599, 585, 378}, {-2075, -571, -427}, +{ -529,-1159,-1171}, { -283, -205, -564}, { -796, 1246, 717}, +{ 2277, 927, 539}, { -454, 559, 440}, { -717, 1460, 1615}, +{-1030, 1052, 1610}, {-1169, -138, 847}, { 226, 39, -612}, +{-1251, -106, -729}, { -651, 968, 1302}, { -714, -636, 1727}, +{ 353, 1069, 410}, { -798, -156, 1099}, { -574, 918, 446}, +{-1310, 1012, 466}, { 1408, 1591, 765}, { 1429, 1380, 1757}, +{ 1949, 1956, 2378}, { 1578, 2047, 2148}, { 916, 98, -7}, +{ 1893, 1418, 2141}, { 348, 1405, 1579}, { 152, 1134, 1801}, +{ -267, 154, 1395}, {-1166, 469, 1054}, {-1142, -405,-1073}, +{-1341,-2264,-1581}, { -364, 869, 1706}, {-1162, 549, 1550}, +{-1225,-1932,-1666}, {-1485,-1977,-2055}, {-1727, -906, -98}, +{-1897, 233, 1492}, { 892, 108, -331}, {-1728,-1170,-1700}, +{-1060, 1980, 1790}, {-1070,-1741,-1909}, { -11, 1539, 1317}, +{-1600, 94, 497}, { 421, 443, -197}, {-1578, -349, -994}, +{ -599, -539, 1140}, { -965,-1419, -129}, {-1341, 175, -447}, +{ -375, 1311, 2055}, { -371, -650, -307}, {-1073, 605, 365}, +{-2057, -113, 430}, { 652, 914, 967}, {-1012,-1586,-2323}, +{ 1505, 1248, 559}, { 262, -486, -401}, {-1727, 1342, 1546}, +{ 50, 56, 432}, { -330, 119, -604}, {-1517,-1080, -810}, +{ 946, 1127, 1055}, {-1400,-1703,-1712}, {-1270, -704,-1317}, +{ 807, 1821, 1143}, { 2760, 1606, 2171}, { 1120, 409, -150}, +{ -147, 404, 959}, { 2439, 1911, 2189}, { -906, -141, -866}, +{ -904, -142, -458}, { -557, -708,-1679}, { -830,-1431,-1583}, +{-1842,-1346,-1086}, {-1604, -272, 915}, {-1196, 772, 1056}, +{ -638,-1234,-1897}, { -500, -81, -822}, {-1289,-1613, -735}, +{ -117, 785, 168}, {-1090, 1133, 922}, {-1096, -746, 1384}, +{ 287, -547,-1063}, {-1376,-2201,-1204}, {-2176,-1570,-1757}, +{-1511,-2241, -771}, {-1737, 1099, 830}, {-1588, 724, 1243}, +{-1542, 693, 805}, {-1690, -240, 1665}, {-1700, -4, -668}, +{ 2149, 816, 1042}, { -818,-1841, 22}, { -764, -507, 449}, +{-1151, -617, 289}, { -843,-1596, -240}, { 498, -234, -657}, +{ -752, 480, 1678}, { -319, -481, 193}, { -811, 171, -119}, +{-2128, -202, -848}, { 1717, 1140, 1700} +}; + +static const int16_t lsf_3_3[512][4] = { +{ 67, -17, 66, -12}, {-1690, -581, -104, -272}, {-1076,-1186,-1845, -376}, +{-1140, -926, -420, -58}, { -259, -656,-1134, -553}, { 1788, 1227, 455, 129}, +{ 462, 441, -240, -528}, { 840, 514, 130, -75}, { 1114, 623, 153, 216}, +{ 1068, 564, -6, -276}, { 1119, 727, 190, -68}, { 704, 306, 119, -264}, +{ 329, 61, -100, 156}, { 364, 123, 183, -208}, { -171, -123, 220, -65}, +{ -306, -62, 402, 17}, { -660, -938, -266, 0}, { 385, 235, 276, 285}, +{ 320, 268, -336, -200}, { -724, 17, -84, 381}, { -544, 429, 494, 519}, +{ -117, 288, 304, 329}, { 643, 157, 701, 508}, { 1200, 625, 796, 608}, +{ 998, 421, 492, 632}, { 1204, 780, 446, 132}, { 1257, 844, 547, 449}, +{ 829, 658, 541, 470}, { 1132, 1258, 918, 639}, { 547, 51, 423, 279}, +{ 9, 392, 83, 94}, { 542, 543, 229, -147}, { -198, 129, 194, -185}, +{ -863,-1321, -302, 30}, { -597, -629, -19, 114}, { -900,-1081, 466, 353}, +{-1483,-1573, 15, -143}, {-1708,-2059, -751, 196}, {-1876,-2067, -642, -258}, +{-2335,-1470, -450, -564}, { -584, -186, -872, -414}, {-1805, -988,-1125,-1310}, +{ -726,-1129, 28, 169}, {-1039, -864, -718, -246}, { 484, 36, -233, -49}, +{ 265, 67, 289, 467}, { 178, 543, 810, 540}, { 84, 282, 672, 703}, +{ -975, -777, 129, 287}, { -938, -227, 955, 595}, {-1617, -289, 836, 649}, +{-1847, -215, 1106, 718}, {-2034,-1085, 650, 440}, {-2101, -529, 907, 575}, +{-2011, -336, 670, 204}, {-2389, -692, 360, 137}, {-2156,-2204, -9, 280}, +{ -266, 119, 39, 193}, { 78, -59, -120, 226}, { -975, -858, -781,-1095}, +{ -619, -413, -451, -842}, {-1216,-1321, -813, -883}, {-1376,-1615, -394, -428}, +{ -737,-1113, -549, -790}, { -880, -975, -967, -642}, { -985, -886,-1273,-1361}, +{ -473, -804,-1401,-1407}, { 160, -265, -919, -275}, { -248, -250, -718, -380}, +{ 97, -103, -375, -229}, { -415, -193, -135, -555}, { 628, 361, 119, 216}, +{ 579, 364, 391, 209}, { 634, 522, -154, -148}, { 526, 389, 170, 33}, +{ 105, 267, 64, 380}, {-1503,-1000, -30, -369}, {-1070, 58, 647, 223}, +{-1520, -291, 621, 307}, {-1531, 156, 762, 404}, {-2029, 141, 734, 499}, +{-1849, -650, 306, 512}, { -187, -104, -59, 438}, { 134, -230, 156, -186}, +{ -61, -260, -16, 10}, { -569, -3, -421, -297}, {-1725, -521, -346, 178}, +{-1362, -59, -44, 157}, {-2146, -461, -470, -349}, {-2170, -1, -369, -121}, +{-1579, -373, -900,-1015}, {-1117, -591, -613, -784}, { -561, 122, -75, -449}, +{ -4, -171, -123, -372}, { 192, 168, -76, -132}, { 252, -107, 340, 210}, +{ 392, 509, 272, 181}, { -109, 145, 218, 119}, { -416, -263, 485, 265}, +{ -181, -8, -286, 226}, { -244, -218, 69, -290}, { -158, 191, -1, -64}, +{ -592, -90, 213, -96}, { 255, 435, 178, -80}, { -369, -18, -33, -80}, +{ -42, 415, 140, -222}, { 1143, 651, 649, 329}, { 767, 556, 249, 235}, +{ 948, 413, 442, 279}, { 141, 339, 356, 557}, { -470, -170, 99, 237}, +{ -569, -800, 352, 565}, { 282, 473, 470, 332}, { -199, -690,-1284, -917}, +{ -193, -426, -800,-1122}, { -26, -371, -490, -193}, { 637, 595, 519, 330}, +{ 408, -115, 79, 12}, { 477, 87, -103, -376}, { -666, -347, -277, -291}, +{ -510, -481, 169, 297}, { -829, -738, -205, -171}, { -320, -540, 328, 283}, +{ -859, -958, 442, -2}, { 556, 686, 130, 56}, { 1383, 1012, 755, 427}, +{ 612, 741, 628, 553}, { -339, -796, 134, 277}, { -633,-1085, -2, -246}, +{ -880,-1035,-1607,-1064}, { -994, -474,-1138, -488}, { -414, -795, 73, -206}, +{ -8, -139, 439, 204}, { -176, -578, 23, 131}, { -269, -757, -191, 245}, +{ -109, -338, 112, 316}, { 120, -406, -118, 611}, { -180, -186, -645, 115}, +{ -173, 34, -518, -489}, { -151, 61, -583, -844}, { 220, -138, -681,-1020}, +{ 391, -17, -598, -321}, { 157, -295, 129, 155}, { -926, -875, -987, 285}, +{ 241, -83, -125, -125}, { 620, 597, 432, 92}, { 393, 78, 409, 61}, +{ -393, -739, -413, -748}, { 83, 54, 361, 27}, {-1084, 130, -337, -694}, +{-1565, 297, 318, -19}, {-1873, 36, 51, -317}, {-2323, -246, 231, -84}, +{-2306, -783, 40, -179}, {-2233, -930, -474, -462}, { -754, -86, -288, -626}, +{-2411, -455, -63, 171}, {-1099,-1094, -26, -143}, {-1193, -455, -406, -381}, +{ -605, -210, -96, -51}, { -580, -476, -276, -15}, {-1195, -634,-1203, -881}, +{ -378, -221, -669, -952}, { 594, 178, -403, -676}, { 763, 327, 601, 290}, +{ 172, 300, 203, 157}, { -56, -336, 356, 24}, { -228, -296, -259, -29}, +{ -186, 263, 416, 14}, { -353, 373, -12, -216}, { 257, 96, 174, 57}, +{-1526, -616, -954, -499}, { -497, -152, -333, 125}, { 105, 200, 179, -97}, +{ -331, -224, 765, 697}, { 760, 256, 301, 59}, { 455, -85, 204, 288}, +{ -514, 240, 251, -109}, { 256, 417, -34, -413}, { 101, 430, 384, 156}, +{ -31, -10, 206, 426}, { 589, 145, 143, 71}, { 808, 906, 333, 349}, +{ 986, 938, 589, 331}, { 1300, 824, 187, 509}, { 1062, 653, 379, 466}, +{ 1462, 937, 401, 274}, { 787, 861, 265, 2}, { 609, 553, 28, 305}, +{ 926, 340, 106, 386}, { 241, -267, -147, 225}, { -178, -534, 347, 502}, +{ -643, -381, 397, 30}, { -651, -733, -435, 398}, { -407, -726, -484, -248}, +{ -789, -914, -438, -476}, { -498, -390, 75, -295}, { -964, -590, -606, 150}, +{ -121, -49, -155, -78}, { 935, 550, 389, 38}, { -321, 127, 424, 315}, +{ -285, -113, 283, 259}, { 658, 203, 322, 486}, { 903, 505, 748, 417}, +{ 611, 423, 555, 512}, { 239, -83, -578, -19}, { -339, -731, 349, 13}, +{ -934,-1399, -114, -360}, { 107, 692, 182, 90}, {-1243,-1538,-1551, -725}, +{ -568, -903,-1363, -525}, { -517, -853, -861,-1004}, { -168, -690, -835, 63}, +{ -137, -556, -547, 144}, { -286, -817, 485, 319}, { -147, -408, 526, 246}, +{ -347, -434, 297, -28}, { -290, -471,-1110,-1285}, { -460, -359, -988, -794}, +{ 1347, 1299, 690, 523}, { 1216, 1068, 1094, 757}, { 825, 1140, 752, 494}, +{ 1252, 1365, 1195, 898}, { 521, 1053, 532, 432}, { -334, -216, -313, -263}, +{ -160, 52, -472, -155}, { 127, 136, -380, 44}, { 851, 410, -162, -489}, +{ 123, -255, -796, -667}, { 1090, 917, 789, 493}, { 1397, 1197, 558, 202}, +{ -51, -118, -342, -701}, { 83, 108, -42, -441}, { 61, 95, 287, 256}, +{ -27, 89, 524, 531}, { 351, 227, 592, 545}, { 697, 155, -164, 307}, +{ 638, 274, -489, -50}, { 754, 240, -166, -124}, { -116, -579,-1212, -63}, +{ 190, -295,-1040,-1296}, { 147, -376, -177, -113}, { 841, 1241, 1051, 668}, +{ 2, 293, 551, 304}, {-1096, -953, -248, 376}, { -750, -965, 87, 516}, +{ -275, -516, 689, 391}, { -379, -643, 876, 594}, { -390,-1013, -645, 573}, +{ -107, -568, -689, -826}, {-1025, -27, -328, -203}, { 861, 749, 548, 233}, +{-1660,-1043, 451, 108}, { -660, -620, 430, 236}, { 21, -396,-1158, -631}, +{ 1372, 1298, 967, 577}, { 1125, 1125, 589, 454}, { -323, -865, -467, 153}, +{ -468, -699, -804, -509}, { -392, -718, -204, -35}, { -603,-1093, -567, -162}, +{ -505,-1004, -102, 350}, { 219, 224, 423, 252}, { 395, 591, 608, 363}, +{ -746, -96, 373, 172}, { 171, 295, 714, 339}, { 233, 77, 107, 277}, +{ 157, 153, -499, -356}, { 1547, 1073, 576, 494}, { -292, -339, -504, -592}, +{ -903, -72, -619, -481}, {-1594,-1117, -567, -254}, { -793, -507, -564, -291}, +{ -492, -532, 502, 560}, { -382, 427, 600, 230}, { -227, 477, 251, 75}, +{ 285, 842, 813, 476}, {-1310,-1333, 186, 377}, { -587, -917, 643, 381}, +{-1186, -553, 411, 82}, {-1127, -820, -174, -540}, { -604, 119, 543, 205}, +{ -380, 657, 909, 567}, { 112, -298, -374, 114}, { -857, -251, 56, 159}, +{ 401, 345, -34, -140}, { -111, -607, 41, 614}, { 355, -114, -77, 474}, +{ 578, 56, 1450, 924}, { 1098, 1420, 741, 400}, { 246, 22, 588, 313}, +{ -121, 327, 831, 472}, {-1138, -608, 856, 552}, {-1241,-1072, 638, 600}, +{ -358, 254, -333, -303}, { -646, 739, 358, 74}, { 1226, 1671, 1221, 849}, +{ 2241, 1624, 983, 636}, { 1841, 1477, 749, 384}, { 350, 263, 87, 128}, +{-1902, -941, -144, -64}, {-1734, -255, 288, -31}, {-2644,-1238, 366, 235}, +{-1643,-1092,-1344, -304}, { -541,-1075,-1116, 123}, {-1178, -252, -816, -180}, +{-1016, 533, 565, 233}, { -487, -430, -188, 334}, { 867, 1236, 534, 171}, +{-1590,-1607, 635, 630}, {-2196, 310, 924, 412}, {-2358, -328, 956, 529}, +{-2639, -377, 630, 278}, {-2602, 317, 799, 299}, {-2406, 133, 340, 31}, +{-2156,-1468, 131, 125}, {-1184, -490, -139, 46}, { -744, 447, 891, 564}, +{ 67, -451, 646, 604}, { -553, -429, -876, 396}, { 162, -66, 1305, 915}, +{ 479, 579, 1088, 794}, { 450, 278, 566, 324}, {-1057, -154, 148, -177}, +{-2545, 168, 1070, 592}, {-2351, -42, 819, 345}, {-2344, -707, 721, 250}, +{-2175,-1497, -309, 122}, { -78, -73, 120, 173}, { -4, 262, -263, -261}, +{ -431, -64, -405, -732}, {-2609, 116, -83, -193}, {-1525, -944, -477, -725}, +{ -508, 307, 170, 172}, { 832, 417, 832, 686}, { -225, 177, 894, 818}, +{ -482, -389, 1279, 1039}, { -383, 201, -350, 40}, { 730, 635, 226, 526}, +{ 503, 462, 338, 398}, { 535, 714, 40, -282}, { 1482, 1471, 1085, 731}, +{ 1561, 1072, 909, 693}, { 1419, 1282, 889, 879}, { 1153, 728, 1186, 840}, +{ -226, 1130, 949, 689}, { -494, -986,-1556, -128}, { -568, -721, -713, -26}, +{ 317, 524, 70, 135}, { -405, -865,-1766, -652}, { -174, -801, 885, 773}, +{ -153, -91, 1099, 751}, { -506,-1149, 853, 646}, { 241, 782, 519, 539}, +{ 1853, 1700, 1101, 684}, {-1249,-1486, -464, 188}, { -893,-1409,-1312, -341}, +{ -135, 438, -175, 18}, { 1111, 976, 319, 208}, {-1430,-1768, 83, 458}, +{ -530,-1000, 307, 129}, { -840, -15, -29, -356}, { -911, -924,-1147, -242}, +{ -119, -528, 127, -133}, { -761, -765, 190, -83}, { -315, 895, 522, 231}, +{ -222, 102, -63, -428}, { 316, 699, 379, 70}, { 25, 716, 314, -108}, +{ 507, 874, 566, 238}, { 108, 941, 519, 195}, { 425, -60, -427, 257}, +{ 139, -103, -630, 446}, { 334, 370, 412, 48}, { -172, -690, -283, 557}, +{ 187, -286, 158, 483}, { 140, 270, -344, -631}, { 924, 579, -116, 132}, +{ 142, 466, -68, -64}, { 230, -145, -302, -542}, { -803, -912, 1018, 737}, +{ -773, 1015, 630, 297}, {-2596, 95, 445, 336}, {-2122, 491, 510, 191}, +{-1253, 161, -2, -324}, {-1450, -633, -712, -105}, { -842, -254, -411, 100}, +{ -640, -290, 1010, 763}, { -650, 313, 1169, 730}, { 140, 505, 1030, 766}, +{ 772, 287, 1067, 823}, { 495, 749, 305, 323}, { -164, 462, 78, 399}, +{ -342, -874, 69, 597}, { -16, 620, 621, 337}, { -138, -444, -265, 218}, +{ 84, -450, 953, 666}, { -222, -803, 541, 604}, { -921,-1376, 244, 116}, +{ -841, -723, 630, 588}, { 140, 663, 294, 368}, { 935, 1046, 881, 759}, +{ 1746, 1464, 916, 628}, { 436, 963, 281, 1}, { -119, 74, 542, 213}, +{ 1, -567, 301, 241}, { 260, 435, 222, 396}, { 936, 957, 1108, 703}, +{ 510, 506, 808, 478}, { 601, 694, 960, 620}, { 972, 741, 980, 600}, +{ 834, 717, 767, 684}, { 643, 972, 935, 638}, { 501, 661, 720, 851}, +{ -105, -632, -303, -117}, { -429, 130, 789, 442}, { -522, -188, 704, 373}, +{ -759, 42, 814, 523}, { -531,-1137, 373, 578}, { -682,-1203, -455, 285}, +{-1163,-1577,-1098, 44}, { 81, -82, 712, 363}, { 477, 246, 954, 622}, +{ 1604, 1622, 1277, 891}, { 1409, 859, 924, 892}, { 774, 1041, 947, 1142}, +{ 40, -546, -75, 288}, { -616, -106, -697, -26}, { -169, -160, -891, -739}, +{ -279, -384,-1029, -350}, { 1781, 1308, 1046, 816}, { 1580, 1533, 1472, 1178}, +{ 1505, 1076, 1216, 899}, { 890, 904, 564, 654}, { 920, 692, 1021, 856}, +{ -493, 132, 177, 505}, { 71, 195, -28, 97}, { 456, 351, -164, 88}, +{ 439, 278, -40, 350}, { 1395, 949, 234, -95}, { -805, -472, 38, -163}, +{ 367, -98, 489, 523}, { 1025, 1178, 1212, 906}, { 319, 1314, 814, 461}, +{ -123, -543, -804, 447}, { -748, -324, -897,-1127}, { -737, -501, -789, -713}, +{ 715, 777, 1239, 922}, { 1949, 1939, 1368, 865}, { 730, 880, 758, 388}, +{ -871, 454, 17, -251}, { -381, -810,-1583, 239}, { -521, -966, -792, 259}, +{ -890,-1358, -770, -73}, { 166, 349, -212, 323}, { -840, -301, 473, 435}, +{ -679, -464, 728, 351}, { -156, -199, 667, 432}, { 29, -252, 415, 480}, +{ -731, -379, 145, 559}, { -528, -631,-1158, -159}, { 445, 273, 123, 639}, +{ 373, -126, 800, 568}, { 84, -162, 720, 712}, { -830, -536, -185, 222}, +{ 408, 452, 501, 771}, { -897,-1355, -67, 442}, { -792,-1406, 566, 602}, +{ 167, -326, 509, 330}, { -95, -626, -730, -344}, { 1668, 1217, 779, 455}, +{ 1316, 828, 584, 719}, { 404, -31, 1013, 789}, { 89, 107, 891, 549}, +{ 871, 1581, 917, 671}, { 866, 1479, 1289, 854}, { 391, 1068, 1122, 812}, +{ 78, -562, 345, 563}, { 429, -103, 417, 787}, { -122, -437, 411, 788}, +{ -913, -417, 602, 754}, { -226, -16, 151, 760}, { -700, 118, -104, -14}, +{-1128, 48, 284, 393}, { -390, -419, -639, -116}, { -910, 306, 316, -13}, +{ 1207, 984, 821, 669}, {-1195, -693, 140, -213}, { -884, -416, -199, -558}, +{ -616, 245, -404, -664}, { 262, 56, -617, -724}, { -85, -491, -320, -656}, +{ -570, -831, -129, -528}, {-1506, -63, -367, -385}, { -358, -321, 4, 51}, +{ -366, -214, 319, 511}, { 146, 671, -17, -291}, { -110, 464, -139, -496}, +{ -202, 220, -312, -631}, { -660, -73, -655, -820}, { -662, -653,-1288, -857}, +{ -430, -953, -959, -264}, { -49, -468, -72, -381}, { -350, -563, -193, -407}, +{ 55, -408, -803, 11}, { -309, 649, 188, -198}, { -512, 461, -79, -458}, +{-1318, -263, -134, -523}, {-1657, -435, -495, -765}, { 57, -347, -414, 434}, +{-1141, -242, -664, -857}, { 34, -68, -707, -338} +}; + +static const int16_t lsf_5_1[128][4] = { +{ -451,-1065, -529,-1305}, { -450, -756, -497, -863}, { -384, -619, -413, -669}, +{ -317, -538, -331, -556}, { -414, -508, -424, -378}, { -274, -324, -434, -614}, +{ -226, -500, -232, -514}, { -263, -377, -298, -410}, { -151, -710, -174, -818}, +{ -149, -412, -156, -429}, { -288, -462, -186, -203}, { -170, -302, -191, -321}, +{ -131, -147, -297, -395}, { -228, -214, -245, -192}, { -67, -316, -71, -327}, +{ -104, -205, -94, -183}, { -143, -38, -193, -95}, { 16, -76, -124, -248}, +{ 23, -237, 24, -244}, { 18, -136, 44, -111}, { -33, -24, -25, 0}, +{ 149, 19, 23, -143}, { 158, -169, 174, -181}, { 133, -55, 165, -26}, +{ 111, 84, 98, 75}, { 87, 183, -115, -11}, { -8, 130, 11, 170}, +{ 254, 77, 205, 17}, { 183, 112, 262, 194}, { 202, 287, 95, 189}, +{ -42, -105, 234, 179}, { 39, 186, 163, 345}, { 332, 199, 299, 161}, +{ -54, 285, -78, 281}, { -133, 141, -182, 111}, { 249, 341, 271, 364}, +{ 93, 403, 75, 391}, { 92, 510, -138, 220}, { -185, -29, -34, 361}, +{ -115, 320, 3, 554}, { 99, 286, 218, 591}, { -245, 406, -268, 453}, +{ 0, 580, 25, 606}, { 275, 532, 148, 450}, { -73, 739, -285, 518}, +{ -288, 94, -203, 674}, { -140, -74, 205, 714}, { -114, 299, 176, 923}, +{ 182, 557, 240, 705}, { -16, 513, 485, 593}, { 293, 384, 451, 617}, +{ -38, 50, 563, 529}, { 303, 209, 459, 363}, { 433, 452, 450, 454}, +{ 367, 606, 477, 741}, { 432, 353, 368, 267}, { 361, 716, 273, 583}, +{ 453, 166, 510, 172}, { 201, 629, 274, 191}, { 568, 639, 302, 298}, +{ 634, 387, 643, 350}, { 587, 560, 612, 565}, { 600, 788, 487, 672}, +{ 512, 1015, 321, 333}, { 357, 854, -125, 413}, { 474, 712, 17, -151}, +{ 564, 285, 270, -241}, { 971, 889, 489, 220}, { 510, 896, 549, 924}, +{ 327, 825, 290, 911}, { 540, 1108, 158, 805}, { 199, 957, 511, 730}, +{ 100, 874, 13, 791}, { 435, 632, 676, 972}, { 249, 900, 467, 1218}, +{ 781, 1074, 585, 785}, { -23, 669, 267, 1043}, { 619, 1084, 615, 1145}, +{ 622, 905, 916, 1049}, { 80, 331, 584, 1075}, { 89, 639, 988, 961}, +{ 770, 720, 798, 699}, { 492, 447, 899, 627}, { 271, 1188, 725, 1333}, +{ 87, 603, 832, 1603}, { 616, 1127, 890, 1505}, { 1000, 1156, 866, 1009}, +{ 995, 827, 1149, 858}, { 817, 1450, 773, 1320}, { 500, 1389, 312, 1153}, +{ -20, 1084, 64, 1283}, { 2, 1172, 399, 1869}, { 514, 1706, 502, 1636}, +{ 886, 1522, 416, 600}, { 1131, 1350, 1275, 1390}, { 889, 1795, 914, 1766}, +{ 227, 1183, 1250, 1826}, { 505, 1854, 919, 2353}, { -199, 431, 152, 1735}, +{ -213, -28, 392, 1334}, { -153, -52, 978, 1151}, { -323, -400, 813, 1703}, +{ -136, 84, 1449, 2015}, { -331, -143, -137, 1192}, { -256, 534, -157, 1031}, +{ -307, -439, 542, 731}, { -329, -420, -97, 616}, { -362, -168, -322, 366}, +{ -247, -110, -211, 89}, { -196, -309, 20, 59}, { -364, -463, -286, 89}, +{ -336, 175, -432, 141}, { -379, -190, -434, -196}, { -79, 150, -278, -227}, +{ -280, 166, -555, -422}, { -155, 541, -366, 54}, { -29, -83, -301, -774}, +{ 186, 628, -397, -264}, { 242, 293, -197, -585}, { 124, 410, 53, -133}, +{ 10, 340, -570,-1065}, { 65, -446, 68, -493}, { 383, 937, -357, -711}, +{ -359, -250, -677,-1068}, { 292, -26, 363, 6}, { 607, 1313, -127, -10}, +{ 1513, 1886, 713, 972}, { 1469, 2181, 1443, 2016} +}; + +static const int16_t lsf_5_2[256][4] = { +{-1631,-1600,-1796,-2290}, {-1027,-1770,-1100,-2025}, {-1277,-1388,-1367,-1534}, +{ -947,-1461, -972,-1524}, { -999,-1222,-1020,-1172}, { -815, -987, -992,-1371}, +{-1216,-1006,-1289,-1094}, { -744,-1268, -755,-1293}, { -862, -923, -905, -984}, +{ -678,-1051, -685,-1050}, {-1087, -985,-1062, -679}, { -989, -641,-1127, -976}, +{ -762, -654, -890, -806}, { -833,-1091, -706, -629}, { -621, -806, -640, -812}, +{ -775, -634, -779, -543}, { -996, -565,-1075, -580}, { -546, -611, -572, -619}, +{ -760, -290, -879, -526}, { -823, -462, -795, -253}, { -553, -415, -589, -439}, +{ -533, -340, -692, -935}, { -505, -772, -702,-1131}, { -263, -306, -971, -483}, +{ -445, -74, -555, -548}, { -614, -129, -693, -234}, { -396, -246, -475, -250}, +{ -265, -404, -376, -514}, { -417, -510, -300, -313}, { -334, -664, -463, -814}, +{ -386, -704, -337, -615}, { -234, -201, -233, -239}, { -167, -567, -203, -619}, +{ -147, -415, -115, -352}, { -166, -750, -171, -761}, { -270, -879, -264, -903}, +{ -367, -744, 43, -475}, { 14, -653, 43, -670}, { 11, -448, -59, -521}, +{ -126, -119, -155, -613}, { -42, -863, -27, -931}, { 136, -483, 183, -468}, +{ 55, -298, 55, -304}, { 313, -609, 313, -720}, { 322, -167, 100, -541}, +{ -3, -119, -111, -187}, { 233, -236, 260, -234}, { 26, -165, 134, -45}, +{ -40, -549, 360, -203}, { 378, -388, 450, -383}, { 275, 20, 182, -103}, +{ 246, -111, 431, 37}, { 462, -146, 487, -157}, { -284, -59, 503, -184}, +{ 24, 53, -3, 54}, { 122, 259, 333, 66}, { 484, 104, 436, 68}, +{ 195, 116, 190, 206}, { 269, -9, 482, 352}, { 382, 285, 399, 277}, +{ 452, 256, 69, 186}, { 13, 297, -13, 259}, { -95, 30, 56, 394}, +{ 196, 425, 205, 456}, { 281, 577, 15, 191}, { 375, 290, 407, 576}, +{ -56, 227, 544, 405}, { 0, 549, -92, 528}, { -229, 351, -245, 338}, +{ -362, 435, 167, 527}, { -75, 302, 91, 824}, { 129, 599, 496, 679}, +{ 186, 749, 153, 737}, { -281, 600, -348, 615}, { -236, 769, 41, 881}, +{ 38, 890, -220, 841}, { -357, 883, -393, 903}, { -634, 474, -444, 850}, +{ -175, 678, -493, 242}, { -519, 785, -714, 582}, { -541, 366, -543, 434}, +{ -597, 500, -765, 222}, { -702, 917, -743, 962}, { -869, 501, -899, 548}, +{ -379, 200, -435, 157}, { -819, 214, -861, 157}, { -614, 40, -632, 94}, +{ -883, -54, -741, 516}, { -501, 298, -614, -171}, { -870, -161, -865, -23}, +{ -818, 93,-1015, -267}, { -662, -359, -549, 2}, { -442, -121, -377, 0}, +{ -227, 33, -414, -126}, { -129, 212, -934, 34}, {-1082, -282,-1119, -268}, +{ -710, -825, -420, -191}, {-1076, -928, -917, -93}, { -628, -358, 97, 7}, +{ -206, -393, -101, 24}, { -203, 38, -168, 83}, { -599, -423, -279, 426}, +{ -700, 118, -75, 206}, { -981, -673, -680, 417}, { -367, 37, -279, 474}, +{ -129, -318, 319, 296}, { -626, -39, 343, 602}, { -696, -39, -303, 940}, +{ 104, 233, -380, 137}, { -36, 269, -75, -214}, { 120, 43, -529, -477}, +{ 459, 164, -202, -229}, { -49, -167, 609, 792}, { 98, -220, 915, 148}, +{ 293, 283, 869, 91}, { 575, 394, 326, -78}, { 717, 67, 365, -323}, +{ 616, -36, 731, 27}, { 619, 238, 632, 273}, { 448, 99, 801, 476}, +{ 869, 273, 685, 64}, { 789, 72, 1021, 217}, { 793, 459, 734, 360}, +{ 646, 480, 360, 322}, { 429, 464, 638, 430}, { 756, 363, 1000, 404}, +{ 683, 528, 602, 615}, { 655, 413, 946, 687}, { 937, 602, 904, 604}, +{ 555, 737, 786, 662}, { 467, 654, 362, 589}, { 929, 710, 498, 478}, +{ 415, 420, 693, 883}, { 813, 683, 781, 925}, { 913, 939, 726, 732}, +{ 491, 853, 531, 948}, { 734, 963, 315, 808}, { 761, 755, 1144, 760}, +{ 655, 1076, 826, 1057}, { 1091, 838, 1003, 808}, { 1047, 1133, 659, 1101}, +{ 992, 1050, 1074, 1075}, { 971, 694, 1226, 1054}, { 571, 841, 884, 1404}, +{ 1379, 1096, 1080, 861}, { 1231, 735, 1284, 760}, { 1272, 991, 1367, 1053}, +{ 1257, 700, 1050, 534}, { 988, 453, 1264, 599}, { 1140, 679, 1621, 815}, +{ 1384, 521, 1317, 393}, { 1564, 805, 1448, 686}, { 1068, 648, 875, 307}, +{ 1083, 361, 1047, 317}, { 1417, 964, 675, 571}, { 1152, 79, 1114, -47}, +{ 1530, 311, 1721, 314}, { 1166, 689, 514, -94}, { 349, 282, 1412, 328}, +{ 1025, 487, -65, 57}, { 805, 970, 36, 62}, { 769, -263, 791, -346}, +{ 637, 699, -137, 620}, { 534, 541, -735, 194}, { 711, 300, -268, -863}, +{ 926, 769, -708, -428}, { 506, 174, -892, -630}, { 435, 547,-1435, -258}, +{ 621, 471,-1018,-1368}, { -393, 521, -920, -686}, { -25, 20, -982,-1156}, +{ 340, 9,-1558,-1135}, { -352, 48,-1579, -402}, { -887, 6,-1156, -888}, +{ -548, -352,-1643,-1168}, { -159, 610,-2024, -963}, { -225, 193,-1656,-1960}, +{ -245, -493, -964,-1680}, { -936, -635,-1299,-1744}, {-1388, -604,-1540, -835}, +{-1397, -135,-1588, -290}, {-1670, -712,-2011,-1632}, {-1663, -27,-2258, -811}, +{-1157, 184,-1265, 189}, {-1367, 586,-2011, 201}, { -790, 712,-1210, 3}, +{-1033, 808,-1251, 830}, { -111, 635,-1636, 447}, { -463, -949, -445, -928}, +{ -504,-1162, -501,-1211}, { 144, -351, -372,-1052}, { -283,-1059, -279,-1123}, +{ -575,-1438, -587,-1614}, { -935, -984, 229, 690}, { -921, -719, -403, 1362}, +{ -685, -465, 874, 397}, { -509, -46, 317, 1334}, { -485, 456, 813, 439}, +{ -411, 339, 898, 1067}, { -425, 46, 1441, 497}, { -909, -800, 1465, 1046}, +{ -254, -321, 1430, 1165}, { 68, 350, 1034, 666}, { 370, 11, 1311, 790}, +{ 143, 232, 1041, 1562}, { -114, 663, 1616, 1078}, { 454, 579, 1275, 1040}, +{ -76, 909, 752, 1067}, { 153, 512, 348, 1214}, { 614, 385, 1843, 808}, +{ 269, 1034, 203, 1086}, { 652, 1017, 1783, 1130}, { 429, 1327, 387, 1384}, +{ -49, 1183, -72, 1215}, { -416, 1001, 544, 1749}, { -352, 1223, -502, 1199}, +{ -589, 569, -227, 1630}, { -142, 1578, -230, 1715}, { -714, 1288, -838, 1398}, +{ 1131, 1357, -208, 1232}, { 437, 965, -929, 818}, { 811, 1410, 859, 1507}, +{ 164, 1212, 1387, 1793}, { 484, 1874, 456, 2063}, { 996, 1170, 1326, 1402}, +{ 1316, 1360, 1135, 1262}, { 1234, 1618, 1361, 1768}, { 1421, 1227, 1584, 1347}, +{ 854, 672, 1685, 1566}, { 1139, 1270, 2016, 1825}, { 1773, 1581, 1532, 1460}, +{ 1487, 946, 1659, 1021}, { 1744, 1212, 1392, 977}, { 1772, 1161, 1826, 1164}, +{ 1718, 1429, 1973, 1591}, { 1185, 864, 2132, 1061}, { 1799, 814, 1838, 757}, +{ 2104, 1315, 2054, 1258}, { 2113, 915, 2331, 930}, { 1467, 1147, 2590, 1439}, +{ 2245, 1744, 2090, 1620}, { 2358, 1454, 2666, 1506}, { 1876, 1837, 2070, 1975}, +{ 1739, 1577, 682, 1289}, { 1584, 2045, 1454, 2098}, { 2498, 2004, 2711, 2066}, +{ 726, 1588, 2756, 2336}, { 228, 847, 2456, 1659}, { 36, 301, 1942, 1957}, +{ -446, -96, 2154, 1396}, { 1533, 1101, 14, 608}, { -923, -732, 1383, 1982}, +{ 1345, 952, -680, 321}, { 1281, 1268,-1594, 365}, { 941, 946,-1737, -822}, +{ 2374, 2787, 1821, 2788} +}; + +static const int16_t lsf_5_3[256][4] = { +{-1812,-2275,-1879,-2537}, {-1640,-1848,-1695,-2004}, {-1220,-1912,-1221,-2106}, +{-1559,-1588,-1573,-1556}, {-1195,-1615,-1224,-1727}, {-1359,-1151,-1616,-1948}, +{-1274,-1391,-1305,-1403}, {-1607,-1179,-1676,-1311}, {-1443,-1478,-1367, -898}, +{-1256,-1059,-1331,-1134}, { -982,-1133,-1149,-1504}, {-1080,-1308,-1020,-1183}, +{ -980,-1486, -967,-1495}, { -988, -922,-1047,-1077}, { -838,-1179, -858,-1222}, +{-1131,-1041,-1064, -767}, { -872,-1157, -701, -880}, { -706, -906, -774,-1016}, +{ -578,-1080, -801,-1478}, { -591,-1111, -592,-1146}, { -713,-1388, -640,-1376}, +{ -597,-1059, -416, -903}, { -686, -832, -661, -708}, { -444, -868, -490, -921}, +{ -374, -776, -619,-1170}, { -585, -549, -769, -795}, { -435, -659, -530, -741}, +{ -498, -837, -357, -597}, { -279, -871, -243, -887}, { -282, -665, -280, -667}, +{ -165, -560, -394, -903}, { -362, -410, -448, -583}, { -409, -574, -313, -357}, +{ -637, -548, -570, -436}, { -896, -504, -382, -757}, { -58, -481, -165, -618}, +{ -191, -374, -234, -382}, { -222, -683, -25, -480}, { -418, -359, -730, -353}, +{ -324, -157, -432, -322}, { -394, -303, -284, -104}, { -601, -289, -556, -196}, +{ -588, -150, -659, -608}, { -473, -24, -68, -448}, { -474, -8, -506, -45}, +{ -748, -184, -844, -252}, { -901, -91, -584, -97}, { -652, 138, -764, -131}, +{ -678, -12, -670, 165}, { -259, -3, -840, -107}, { -909, 37, -992, 44}, +{ -854, -415, -839, 13}, {-1001, -271,-1026, -309}, { -798, -478, -832, -488}, +{ -943, 168,-1112, -387}, {-1185, -101,-1183, -40}, { -941, -316,-1030, -770}, +{-1044, -625,-1081, -538}, {-1224, -299,-1312, -436}, {-1197, -663,-1167, -161}, +{-1216, -690,-1237, -831}, {-1432, -720,-1403, -493}, { -898, -740, -922, -801}, +{-1102, -402,-1579, -964}, {-1061, -638,-1269,-1438}, {-1499, -934,-1502, -895}, +{-1598, -564,-1723, -717}, { -606, -597,-1166,-1085}, {-1369, -468,-1946,-1493}, +{-1838, -953,-1932, -931}, {-1499, -188,-1635, -421}, {-1457, -338,-1448, -22}, +{-1942, -422,-2006, -249}, { -496, -114,-1910, -755}, {-1289, 174,-1451, -109}, +{ -482, -257,-1221, -508}, {-1617, 151,-1694, 208}, { -654, 107,-1651, 29}, +{-1141, 279,-1215, 306}, {-1228, -506, -730, -175}, {-1236, -101, -969, 551}, +{ -870, 278, -823, 315}, { -563, 376,-1051, 228}, { -507, 280, -599, 281}, +{ -758, 253, -305, 379}, { -755, -134, -611, 660}, { -824, 536, -817, 646}, +{ -413, 49, -341, 177}, { -453, 526, -482, 589}, { -71, 339, -657, 264}, +{ -244, 295, -237, 315}, { -387, 569, -506, -9}, { -377, 14, -160, 661}, +{ -216, 40, -308, -46}, { 95, 214, -242, 167}, { -86, 192, -56, 27}, +{ -76, 31, 36, 309}, { -106, -182, -113, 74}, { -441, -22, 23, 139}, +{ 81, -11, 44, 15}, { -87, -137, -118, -207}, { -158, -58, 272, -92}, +{ -156, -441, 8, -136}, { 128, -221, 101, -218}, { 40, -197, -76, -456}, +{ 9, -445, 33, -423}, { 226, 60, 73, -222}, { 156, -399, 280, -318}, +{ 245, -341, 166, -499}, { 339, -190, 327, -219}, { 325, -137, -89, -596}, +{ 100, -627, 144, -677}, { 487, 28, 252, -391}, { 214, -41, 282, -28}, +{ 99, -286, 331, 49}, { 459, -388, 565, -369}, { 436, 28, 336, -9}, +{ 397, -167, 618, 34}, { 596, -17, 561, -140}, { 299, 79, 522, 125}, +{ 203, 2, 244, 288}, { 255, 211, 175, 82}, { 596, 187, 517, 108}, +{ 381, 255, 365, 297}, { 497, 352, 327, -82}, { 25, 210, 371, 245}, +{ 261, 3, 545, 449}, { 140, 294, 44, 295}, { 212, 347, 244, 494}, +{ 331, 528, 201, 307}, { 349, 411, 613, 284}, { 614, 413, 464, 322}, +{ 624, 397, 97, 200}, { -160, 384, 149, 362}, { 495, 525, 269, 585}, +{ 33, 491, -121, 433}, { 427, 611, 498, 516}, { 171, 443, 497, 666}, +{ 440, 275, 566, 575}, { 146, 639, 155, 670}, { -33, 173, 212, 696}, +{ -166, 601, -191, 695}, { -489, 503, 175, 742}, { 214, 476, 372, 1083}, +{ 578, 530, 586, 777}, { 425, 874, 315, 841}, { 374, 848, -165, 565}, +{ 35, 991, -39, 1062}, { 329, 712, 786, 840}, { 645, 795, 661, 676}, +{ 571, 918, 632, 1079}, { 673, 817, 318, 388}, { 874, 1012, 564, 848}, +{ 880, 620, 557, 479}, { 671, 453, 692, 468}, { 840, 642, 844, 645}, +{ 506, 428, 897, 567}, { 837, 387, 962, 499}, { 691, 561, 939, 926}, +{ 783, 296, 790, 268}, { 1028, 530, 874, 329}, { 548, 143, 675, 291}, +{ 503, 66, 1041, 359}, { 786, 97, 805, 33}, { 837, 470, 511, 49}, +{ 1092, 327, 1174, 323}, { 3, 242, 872, 474}, { 689, 429, 1329, 678}, +{ 1042, 620, 1109, 664}, { 321, 193, 889, 950}, { 1153, 874, 893, 635}, +{ 877, 862, 948, 913}, { 1293, 665, 1320, 639}, { 997, 793, 1402, 1030}, +{ 1176, 1012, 1110, 959}, { 1410, 925, 1403, 915}, { 543, 862, 1116, 1222}, +{ 835, 1190, 835, 1190}, { 959, 1148, 1147, 1376}, { 1300, 1193, 1415, 1231}, +{ 1335, 1341, 746, 1092}, { 1711, 1283, 1389, 1073}, { 1334, 1566, 1153, 1475}, +{ 1645, 1137, 1825, 1220}, { 1056, 1382, 1521, 1730}, { 1632, 1545, 1620, 1542}, +{ 855, 1596, 865, 1667}, { 693, 885, 1716, 1519}, { 1167, 1296, 2209, 1760}, +{ 1952, 1493, 2020, 1482}, { 1534, 1866, 1694, 2008}, { 1566, 748, 1761, 825}, +{ 294, 1392, 1084, 2058}, { 621, 1315, 365, 1287}, { 198, 1028, 488, 1408}, +{ 249, 403, 1014, 1561}, { 324, 363, 1645, 1044}, { 193, 367, 2034, 1859}, +{ -251, 579, 750, 994}, { -243, 30, 1325, 879}, { -28, -169, 624, 917}, +{ -453, 159, 186, 1370}, { -614, 6, 537, 392}, { -94, -291, 781, 229}, +{ -128, -298, 245, 491}, { -701, -648, 972, 789}, { -501, -640, 178, 255}, +{ -365, -390, -255, 317}, { -958, -294, -191, 228}, { -775, -447, 157, -237}, +{ -657, -720, -407, 92}, { -117, -611, 334, -230}, { -679,-1084, -144, -317}, +{ -901, -861, -738, -360}, { -85, -727, -90, -787}, { 100, -22, -391, -263}, +{ -56, -73, -337, -754}, { 5, -189, -706, -624}, { 89, -344, -135,-1113}, +{ -353, -237, -684,-1135}, { -275,-1102, -269,-1203}, { 152, 145, -722,-1232}, +{ 49, 80,-1248, -776}, { -248, 391, -732, -547}, { 469, 218, -255, -864}, +{ 69, 366, -166, -485}, { -688, 191,-1212,-1196}, { -170, -169,-1308,-1631}, +{ 321, 470,-1419,-1243}, { -64, 272,-1361, -248}, { 492, 565, -721, -609}, +{ 195, 485, -573, -133}, { 427, 202, -171, -118}, { 199, 575, 2, -31}, +{ 694, 755,-1366, -39}, { 552, 557, -489, 271}, { 680, 537, 13, -453}, +{ 855, 954, -133, -52}, { -81, 738,-1169, 637}, { 1055, 1059, -95, 676}, +{ 1259, 1081, 489, 305}, { -449, 954, -534, 996}, { -969, 866,-1058, 1059}, +{-1294, 618,-1416, 617}, { -458, 1366, -159, 1821}, { -774, -528, -14, 1110}, +{-1202, -901, -772, 433}, {-1256,-1255,-1011, -302}, { -602, -585, -759,-1618}, +{ -760,-1549, -840,-1921}, { -816, -539,-1769,-2235}, { -227, -36,-2034,-1831}, +{-2107,-1126,-2471,-1816}, {-1470, 252,-2701, -415}, { -571, -467, 1509, 1554}, +{ 2180, 1975, 2326, 2020} +}; + +static const int16_t lsf_5_4[256][4] = { +{-1857,-1681,-1857,-1755}, {-2056,-1150,-2134,-1654}, {-1619,-1099,-1704,-1131}, +{-1345,-1608,-1359,-1638}, {-1338,-1293,-1325,-1265}, {-1664,-1649,-1487, -851}, +{-1346,-1832,-1413,-2188}, {-1282, -681,-1785,-1649}, { -966,-1082,-1183,-1676}, +{-1054,-1073,-1142,-1158}, {-1207, -744,-1274, -997}, { -934,-1383, -927,-1416}, +{-1010,-1305, -783, -955}, {-1049, -900, -993, -817}, { -737, -823, -972,-1189}, +{ -738,-1094, -738,-1154}, { -784, -801, -810, -786}, { -892, -520,-1000, -818}, +{ -644, -965, -577, -882}, { -541, -694, -671, -917}, { -595, -642, -646, -615}, +{ -956, -621, -925, -515}, { -727, -483, -815, -485}, { -840, -578, -440, -713}, +{ -578, -325, -657, -670}, { -386, -570, -441, -666}, { -514, -787, -392, -529}, +{ -522, -453, -487, -423}, { -616, -585, -617, -157}, { -662, -268, -680, -348}, +{ -322, -323, -632, -444}, { -304, -430, -332, -458}, { -277, -468, -659, -793}, +{ -319, -636, -227, -554}, { -373, -347, -334, -210}, { -456, -192, -530, -242}, +{ -216, -198, -366, -370}, { -338, -161, -409, -748}, { -107, -380, -294, -643}, +{ -223, -665, -234, -741}, { -141, -496, -130, -510}, { -139, -327, -172, -305}, +{ -306, -580, -164, -263}, { -262, -172, -67, -402}, { 31, -366, -10, -436}, +{ -86, -527, 71, -377}, { -22, -609, -12, -678}, { -67, -319, 63, -191}, +{ 35, -181, -39, -242}, { 126, -167, -140, -544}, { 155, -297, 174, -297}, +{ 38, -8, 117, -380}, { 197, -452, 240, -522}, { 223, -103, 110, -187}, +{ 87, -155, 169, -47}, { 157, 26, -83, -100}, { 128, 80, 209, -62}, +{ 6, 7, 22, 5}, { 318, -20, 248, -45}, { -200, -63, 156, -69}, +{ 250, -183, 369, -126}, { -113, -76, -142, -122}, { -64, -254, -31, 35}, +{ -177, -71, -7, 171}, { 93, 27, 108, 212}, { -330, -209, -123, -70}, +{ -279, 95, -96, 20}, { -188, -61, -314, 87}, { -300, -78, -354, -134}, +{ 11, 122, -140, 122}, { -275, 152, -293, 140}, { -82, 138, -321, -111}, +{ -480, -156, -359, 76}, { -254, -40, -635, -96}, { -522, 79, -507, 8}, +{ -268, 303, -539, 68}, { -446, 61, -522, 306}, { 111, 189, -435, 122}, +{ -379, 166, -571, -398}, { -632, -74, -747, -95}, { -455, 194, -952, 83}, +{ -798, 192, -755, 192}, { -781, -162, -619, 234}, { -663, -297, -488, -109}, +{ -964, -132, -838, -68}, { -843, 58,-1112, -86}, { -805, -299, -944, -253}, +{ -778, -50, -965, -549}, { -352, -98, -992, -343}, {-1117, -315,-1117, -307}, +{-1155, -374, -637, -230}, {-1166, -43,-1299, -100}, { -925, -393,-1274, -600}, +{ -689, -130,-1479, -312}, {-1321, -254,-1464, -442}, {-1292, -613,-1261, -503}, +{-1501, -368,-1322, 26}, {-1432, -66,-1743, -161}, {-1644, -467,-1760, -548}, +{-1393, -568,-1556, -871}, {-1495,-1034,-1387, -571}, {-1917, -528,-1783, -123}, +{-1897, -231,-2054, -323}, {-2052, -906,-1976, -567}, {-1917, -620,-2047, -989}, +{-1077, -370,-2031, -704}, {-2355, -749,-2740,-1089}, {-1909, 159,-2012, 248}, +{ -626, -123,-2339, -962}, { -669, -408,-1379,-1174}, { -452, -364,-1044, -735}, +{ -132, 183,-1620, -752}, { -547, -307, -777,-1261}, { -98, 41, -880,-1091}, +{ -257, 97,-1602,-1833}, { 31, -26, -644, -561}, { -180, -546, -385,-1095}, +{ -410, -802, -414, -827}, { -457, -970, -490,-1109}, { -215, -916, -144, -937}, +{ -493,-1269, -517,-1507}, { 181, 101, -332, -889}, { -836, -937, -559, -429}, +{ -629, -547, -183, -337}, { -545, -82, -250, -286}, { 5, -132, -348, -252}, +{ -293, -472, -158, 100}, { -29, 197, -236, -424}, { -861, -213, -140, -7}, +{ -427, -443, 187, -97}, { -684, -736, -293, 258}, { -368, -152, -150, 392}, +{ -609, 175, -142, 299}, { -138, 152, -119, 329}, { -486, -52, 293, 198}, +{ -183, 117, 175, 331}, { -58, -274, 231, 300}, { -288, 330, -305, 372}, +{ -111, 409, -9, 423}, { 83, 256, 67, 367}, { -19, 248, 91, 113}, +{ -35, 406, -191, 154}, { 238, 296, 5, 197}, { 141, 221, 313, 198}, +{ 211, 421, 244, 334}, { 88, 426, -243, 454}, { 202, 552, -5, 403}, +{ 291, 185, 219, 301}, { 251, 138, 128, 69}, { 197, 288, -140, -61}, +{ 188, 361, 197, 598}, { 442, 273, 290, 143}, { 472, 482, 157, 370}, +{ 415, 321, 372, 385}, { 402, 552, 155, 24}, { 550, 263, -11, 21}, +{ 360, 227, 147, -254}, { 424, 97, 366, -13}, { 375, 141, 449, 232}, +{ 396, 507, 474, 272}, { 701, 324, 362, -47}, { 587, 148, 543, 69}, +{ 400, -51, 561, 59}, { 220, -10, 352, 147}, { 206, 211, 653, 185}, +{ 563, 297, 565, 284}, { 594, 121, 766, 192}, { 398, 118, 642, 434}, +{ 233, 264, 481, 467}, { 129, -165, 699, 239}, { 90, 26, 342, 474}, +{ -55, 27, 388, 94}, { -172, 0, 725, 379}, { -60, 337, 370, 465}, +{ 95, 319, 806, 595}, { 78, 260, 497, 851}, { 210, 560, 458, 574}, +{ -464, 202, 497, 625}, { -202, 152, 48, 712}, { -20, 566, 100, 715}, +{ 455, 468, 411, 605}, { 319, 646, 195, 615}, { 401, 538, 680, 739}, +{ 201, 667, 434, 954}, { 454, 425, 646, 491}, { 606, 681, 416, 508}, +{ 497, 822, 426, 815}, { 660, 647, 628, 716}, { 697, 466, 618, 457}, +{ 685, 460, 365, 309}, { 721, 567, 836, 601}, { 609, 300, 825, 459}, +{ 943, 687, 681, 533}, { 915, 598, 591, 243}, { 876, 451, 874, 420}, +{ 786, 317, 732, 220}, { 922, 317, 1108, 367}, { 531, 466, 1028, 649}, +{ 1053, 615, 1034, 553}, { 829, 602, 1021, 799}, { 927, 803, 878, 763}, +{ 799, 496, 1373, 773}, { 585, 770, 803, 930}, { 1099, 793, 1222, 862}, +{ 1209, 895, 1025, 727}, { 772, 845, 1172, 1115}, { 867, 1021, 830, 1013}, +{ 841, 910, 506, 703}, { 1239, 1077, 620, 819}, { 1196, 1083, 1155, 1081}, +{ 1142, 907, 1547, 1121}, { 1309, 648, 1343, 612}, { 1484, 988, 1479, 937}, +{ 985, 1328, 955, 1341}, { 429, 910, 841, 1338}, { 564, 1179, 412, 1156}, +{ 1427, 1320, 1434, 1330}, { 640, 760, 1726, 1410}, { 190, 555, 1073, 1005}, +{ 426, 257, 839, 980}, { 235, 231, 1520, 1167}, { 109, 293, 1014, 1569}, +{ 305, 142, 1148, 539}, { -291, -108, 1213, 972}, { 22, -216, 667, 828}, +{ -482, 438, 453, 1431}, { -581, -422, 789, 387}, { -358, -454, 174, 780}, +{ -36, -372, 390, -134}, { -629, 160, -306, 751}, {-1258, -331, 177, 522}, +{ -248, 574, -251, 639}, { -531, 407, -596, 394}, { -419, 789, -617, 801}, +{ -986, 399, -857, 727}, { -7, 518, -703, 310}, {-1143, -24,-1002, 287}, +{ -960, 363,-1299, 312}, {-1534, 245,-1557, 305}, { 28, 153, -859, -175}, +{ -33, 332,-1398, -154}, { 212, 410, -593, -197}, {-1092, -704, -904, -65}, +{ 282, 367, -918, -686}, { 345, 93, -258, -357}, { 696, 644, -693, -28}, +{ 448, 493, -273, 193}, { 527, 546, -243, -513}, { 384, -136, 273, -353}, +{ 512, -142, 537, -198}, { 941, 750, 83, 248}, { 578, 861, -56, 592}, +{ 842, 44, 892, 24}, { 33, 890, -16, 982}, { 831, 1398, 1535, 1898}, +{ 1716, 1376, 1948, 1465} +}; + +static const int16_t lsf_5_5[64][4] = { +{-1002, -929,-1096,-1203}, { -641, -931, -604, -961}, { -779, -673, -835, -788}, +{ -416, -664, -458, -766}, { -652, -521, -662, -495}, {-1023, -509,-1023, -428}, +{ -444, -552, -368, -449}, { -479, -211,-1054, -903}, { -316, -249, -569, -591}, +{ -569, -275, -541, -191}, { -716, -188, -842, -264}, { -333, -248, -318, -228}, +{ -275, 1, -567, -228}, { -115, -221, -238, -374}, { -197, -507, -222, -579}, +{ -258, -432, -61, -244}, { -345, 2, -338, 39}, { -215, -169, -58, 0}, +{ -56, -6, -203, -131}, { 1, -186, -5, -211}, { 6, -380, 11, -418}, +{ -116, 131, -134, 113}, { 89, -4, 71, -2}, { -19, -192, 262, 24}, +{ 189, 151, -133, -109}, { 186, -153, 166, -219}, { 37, 139, 193, 171}, +{ 337, 124, 158, -61}, { 141, 226, -13, 190}, { 231, 34, 354, 109}, +{ 316, 201, 244, 164}, { 330, -85, 390, -84}, { 254, 327, 257, 335}, +{ 491, 147, 476, 105}, { 54, 77, 437, 370}, { 421, 314, 449, 342}, +{ 329, 126, 673, 292}, { 571, 388, 243, 193}, { 653, 320, 621, 280}, +{ 194, 380, 517, 581}, { 45, 323, 111, 422}, { 489, 395, 734, 534}, +{ 622, 546, 486, 502}, { 318, 572, 189, 550}, { 385, 422, -157, 153}, +{ -125, 382, -197, 386}, { -263, 334, 228, 697}, { -188, 1, 51, 297}, +{ -507, 213, -376, 397}, { -24, 255, -547, 89}, { -502, -94, 387, 179}, +{ -620, 68, -684, 112}, { -642, -350, -260, 172}, { -438, -324, 264, 648}, +{ -964, -4,-1121, 7}, { -134, 134,-1133, -306}, { 143, 96, -420, -497}, +{-1221, -350,-1527, -685}, { -161, 72, 873, 691}, { 732, 283, 921, 353}, +{ 334, 475, 1095, 821}, { 864, 524, 843, 497}, { 714, 711, 788, 750}, +{ 1076, 714, 1204, 753} +}; + +static const float lsf_3_mean[LP_FILTER_ORDER] = { + 377.441, 554.688, 922.363, 1339.84, 1702.15, + 2046.390, 2452.880, 2741.460, 3116.70, 3348.14 +}; + +static const float lsf_5_mean[LP_FILTER_ORDER] = { + 337.891, 507.080, 834.961, 1247.07, 1646.00, + 1982.910, 2407.960, 2708.010, 3104.00, 3344.97 +}; + +/** Prediction factor table for modes other than 12.2kbit/s */ +static const float pred_fac[LP_FILTER_ORDER] = { + 0.291626, 0.328644, 0.383636, 0.405640, 0.438873, + 0.355560, 0.323120, 0.298065, 0.262238, 0.197876, +}; + +// fixed tables + +/** + * number of pulses per mode + */ +static const uint8_t pulses_nb_per_mode[] = {2, 2, 2, 3, 4, 4, 8, 10}; + +/** track start positions for algebraic code book routines */ +static const uint8_t track_position[16] = { + 0, 2, 0, 3, 0, 2, 0, 3, 1, 3, 2, 4, 1, 4, 1, 4 +}; + +/** 3-bit Gray code to binary lookup table */ +static const uint8_t gray_decode[8] = { 0, 5, 15, 10, 25, 30, 20, 35 }; + + +// gain tables + +/** scalar quantized pitch gain table for 7.95 and 12.2 kbps modes */ +static const uint16_t qua_gain_pit[16] = { + 0, 3277, 6556, 8192, 9830, 11469, 12288, 13107, + 13926, 14746, 15565, 16384, 17203, 18022, 18842, 19661 +}; + +/** scalar quantized fixed gain table for 7.95 and 12.2 kbps modes */ +static const uint16_t qua_gain_code[32] = { + 159, 206, 268, 349, 419, 482, 554, 637, + 733, 842, 969, 1114, 1281, 1473, 1694, 1948, + 2241, 2577, 2963, 3408, 3919, 4507, 5183, 5960, + 6855, 7883, 9065, 10425, 12510, 16263, 21142, 27485 +}; + +/** desired mean innovation energy, indexed by active mode */ +static const float energy_mean[8] = { + 33.0, 33.0, 33.0, 28.75, 30.0, 36.0, 33.0, 36.0 +}; + +/** 4-tap moving average prediction coefficients in reverse order */ +static const float energy_pred_fac[4] = { 0.19, 0.34, 0.58, 0.68 }; + +/** gain table for 4.75 kbps mode + * + * first index has even/odd indexes for subframes 0,2/1,3 + * second index is {pitch_gain, fixed_gain_factor} */ +static const uint16_t gains_MODE_4k75[512][2] = { +{ 812, 128}, { 542, 140}, { 2873, 1135}, { 2266, 3402}, { 2067, 563}, +{12677, 647}, { 4132, 1798}, { 5601, 5285}, { 7689, 374}, { 3735, 441}, +{10912, 2638}, {11807, 2494}, {20490, 797}, { 5218, 675}, { 6724, 8354}, +{ 5282, 1696}, { 1488, 428}, { 5882, 452}, { 5332, 4072}, { 3583, 1268}, +{ 2469, 901}, {15894, 1005}, {14982, 3271}, {10331, 4858}, { 3635, 2021}, +{ 2596, 835}, {12360, 4892}, {12206, 1704}, {13432, 1604}, { 9118, 2341}, +{ 3968, 1538}, { 5479, 9936}, { 3795, 417}, { 1359, 414}, { 3640, 1569}, +{ 7995, 3541}, {11405, 645}, { 8552, 635}, { 4056, 1377}, {16608, 6124}, +{11420, 700}, { 2007, 607}, {12415, 1578}, {11119, 4654}, {13680, 1708}, +{11990, 1229}, { 7996, 7297}, {13231, 5715}, { 2428, 1159}, { 2073, 1941}, +{ 6218, 6121}, { 3546, 1804}, { 8925, 1802}, { 8679, 1580}, {13935, 3576}, +{13313, 6237}, { 6142, 1130}, { 5994, 1734}, {14141, 4662}, {11271, 3321}, +{12226, 1551}, {13931, 3015}, { 5081,10464}, { 9444, 6706}, { 1689, 683}, +{ 1436, 1306}, { 7212, 3933}, { 4082, 2713}, { 7793, 704}, {15070, 802}, +{ 6299, 5212}, { 4337, 5357}, { 6676, 541}, { 6062, 626}, {13651, 3700}, +{11498, 2408}, {16156, 716}, {12177, 751}, { 8065,11489}, { 6314, 2256}, +{ 4466, 496}, { 7293, 523}, {10213, 3833}, { 8394, 3037}, { 8403, 966}, +{14228, 1880}, { 8703, 5409}, {16395, 4863}, { 7420, 1979}, { 6089, 1230}, +{ 9371, 4398}, {14558, 3363}, {13559, 2873}, {13163, 1465}, { 5534, 1678}, +{13138,14771}, { 7338, 600}, { 1318, 548}, { 4252, 3539}, {10044, 2364}, +{10587, 622}, {13088, 669}, {14126, 3526}, { 5039, 9784}, {15338, 619}, +{ 3115, 590}, {16442, 3013}, {15542, 4168}, {15537, 1611}, {15405, 1228}, +{16023, 9299}, { 7534, 4976}, { 1990, 1213}, {11447, 1157}, {12512, 5519}, +{ 9475, 2644}, { 7716, 2034}, {13280, 2239}, {16011, 5093}, { 8066, 6761}, +{10083, 1413}, { 5002, 2347}, {12523, 5975}, {15126, 2899}, {18264, 2289}, +{15827, 2527}, {16265,10254}, {14651,11319}, { 1797, 337}, { 3115, 397}, +{ 3510, 2928}, { 4592, 2670}, { 7519, 628}, {11415, 656}, { 5946, 2435}, +{ 6544, 7367}, { 8238, 829}, { 4000, 863}, {10032, 2492}, {16057, 3551}, +{18204, 1054}, { 6103, 1454}, { 5884, 7900}, {18752, 3468}, { 1864, 544}, +{ 9198, 683}, {11623, 4160}, { 4594, 1644}, { 3158, 1157}, {15953, 2560}, +{12349, 3733}, {17420, 5260}, { 6106, 2004}, { 2917, 1742}, {16467, 5257}, +{16787, 1680}, {17205, 1759}, { 4773, 3231}, { 7386, 6035}, {14342,10012}, +{ 4035, 442}, { 4194, 458}, { 9214, 2242}, { 7427, 4217}, {12860, 801}, +{11186, 825}, {12648, 2084}, {12956, 6554}, { 9505, 996}, { 6629, 985}, +{10537, 2502}, {15289, 5006}, {12602, 2055}, {15484, 1653}, {16194, 6921}, +{14231, 5790}, { 2626, 828}, { 5615, 1686}, {13663, 5778}, { 3668, 1554}, +{11313, 2633}, { 9770, 1459}, {14003, 4733}, {15897, 6291}, { 6278, 1870}, +{ 7910, 2285}, {16978, 4571}, {16576, 3849}, {15248, 2311}, {16023, 3244}, +{14459,17808}, {11847, 2763}, { 1981, 1407}, { 1400, 876}, { 4335, 3547}, +{ 4391, 4210}, { 5405, 680}, {17461, 781}, { 6501, 5118}, { 8091, 7677}, +{ 7355, 794}, { 8333, 1182}, {15041, 3160}, {14928, 3039}, {20421, 880}, +{14545, 852}, {12337,14708}, { 6904, 1920}, { 4225, 933}, { 8218, 1087}, +{10659, 4084}, {10082, 4533}, { 2735, 840}, {20657, 1081}, {16711, 5966}, +{15873, 4578}, {10871, 2574}, { 3773, 1166}, {14519, 4044}, {20699, 2627}, +{15219, 2734}, {15274, 2186}, { 6257, 3226}, {13125,19480}, { 7196, 930}, +{ 2462, 1618}, { 4515, 3092}, {13852, 4277}, {10460, 833}, {17339, 810}, +{16891, 2289}, {15546, 8217}, {13603, 1684}, { 3197, 1834}, {15948, 2820}, +{15812, 5327}, {17006, 2438}, {16788, 1326}, {15671, 8156}, {11726, 8556}, +{ 3762, 2053}, { 9563, 1317}, {13561, 6790}, {12227, 1936}, { 8180, 3550}, +{13287, 1778}, {16299, 6599}, {16291, 7758}, { 8521, 2551}, { 7225, 2645}, +{18269, 7489}, {16885, 2248}, {17882, 2884}, {17265, 3328}, { 9417,20162}, +{11042, 8320}, { 1286, 620}, { 1431, 583}, { 5993, 2289}, { 3978, 3626}, +{ 5144, 752}, {13409, 830}, { 5553, 2860}, {11764, 5908}, {10737, 560}, +{ 5446, 564}, {13321, 3008}, {11946, 3683}, {19887, 798}, { 9825, 728}, +{13663, 8748}, { 7391, 3053}, { 2515, 778}, { 6050, 833}, { 6469, 5074}, +{ 8305, 2463}, { 6141, 1865}, {15308, 1262}, {14408, 4547}, {13663, 4515}, +{ 3137, 2983}, { 2479, 1259}, {15088, 4647}, {15382, 2607}, {14492, 2392}, +{12462, 2537}, { 7539, 2949}, {12909,12060}, { 5468, 684}, { 3141, 722}, +{ 5081, 1274}, {12732, 4200}, {15302, 681}, { 7819, 592}, { 6534, 2021}, +{16478, 8737}, {13364, 882}, { 5397, 899}, {14656, 2178}, {14741, 4227}, +{14270, 1298}, {13929, 2029}, {15477, 7482}, {15815, 4572}, { 2521, 2013}, +{ 5062, 1804}, { 5159, 6582}, { 7130, 3597}, {10920, 1611}, {11729, 1708}, +{16903, 3455}, {16268, 6640}, { 9306, 1007}, { 9369, 2106}, {19182, 5037}, +{12441, 4269}, {15919, 1332}, {15357, 3512}, {11898,14141}, {16101, 6854}, +{ 2010, 737}, { 3779, 861}, {11454, 2880}, { 3564, 3540}, { 9057, 1241}, +{12391, 896}, { 8546, 4629}, {11561, 5776}, { 8129, 589}, { 8218, 588}, +{18728, 3755}, {12973, 3149}, {15729, 758}, {16634, 754}, {15222,11138}, +{15871, 2208}, { 4673, 610}, {10218, 678}, {15257, 4146}, { 5729, 3327}, +{ 8377, 1670}, {19862, 2321}, {15450, 5511}, {14054, 5481}, { 5728, 2888}, +{ 7580, 1346}, {14384, 5325}, {16236, 3950}, {15118, 3744}, {15306, 1435}, +{14597, 4070}, {12301,15696}, { 7617, 1699}, { 2170, 884}, { 4459, 4567}, +{18094, 3306}, {12742, 815}, {14926, 907}, {15016, 4281}, {15518, 8368}, +{17994, 1087}, { 2358, 865}, {16281, 3787}, {15679, 4596}, {16356, 1534}, +{16584, 2210}, {16833, 9697}, {15929, 4513}, { 3277, 1085}, { 9643, 2187}, +{11973, 6068}, { 9199, 4462}, { 8955, 1629}, {10289, 3062}, {16481, 5155}, +{15466, 7066}, {13678, 2543}, { 5273, 2277}, {16746, 6213}, {16655, 3408}, +{20304, 3363}, {18688, 1985}, {14172,12867}, {15154,15703}, { 4473, 1020}, +{ 1681, 886}, { 4311, 4301}, { 8952, 3657}, { 5893, 1147}, {11647, 1452}, +{15886, 2227}, { 4582, 6644}, { 6929, 1205}, { 6220, 799}, {12415, 3409}, +{15968, 3877}, {19859, 2109}, { 9689, 2141}, {14742, 8830}, {14480, 2599}, +{ 1817, 1238}, { 7771, 813}, {19079, 4410}, { 5554, 2064}, { 3687, 2844}, +{17435, 2256}, {16697, 4486}, {16199, 5388}, { 8028, 2763}, { 3405, 2119}, +{17426, 5477}, {13698, 2786}, {19879, 2720}, { 9098, 3880}, {18172, 4833}, +{17336,12207}, { 5116, 996}, { 4935, 988}, { 9888, 3081}, { 6014, 5371}, +{15881, 1667}, { 8405, 1183}, {15087, 2366}, {19777, 7002}, {11963, 1562}, +{ 7279, 1128}, {16859, 1532}, {15762, 5381}, {14708, 2065}, {20105, 2155}, +{17158, 8245}, {17911, 6318}, { 5467, 1504}, { 4100, 2574}, {17421, 6810}, +{ 5673, 2888}, {16636, 3382}, { 8975, 1831}, {20159, 4737}, {19550, 7294}, +{ 6658, 2781}, {11472, 3321}, {19397, 5054}, {18878, 4722}, {16439, 2373}, +{20430, 4386}, {11353,26526}, {11593, 3068}, { 2866, 1566}, { 5108, 1070}, +{ 9614, 4915}, { 4939, 3536}, { 7541, 878}, {20717, 851}, { 6938, 4395}, +{16799, 7733}, {10137, 1019}, { 9845, 964}, {15494, 3955}, {15459, 3430}, +{18863, 982}, {20120, 963}, {16876,12887}, {14334, 4200}, { 6599, 1220}, +{ 9222, 814}, {16942, 5134}, { 5661, 4898}, { 5488, 1798}, {20258, 3962}, +{17005, 6178}, {17929, 5929}, { 9365, 3420}, { 7474, 1971}, {19537, 5177}, +{19003, 3006}, {16454, 3788}, {16070, 2367}, { 8664, 2743}, { 9445,26358}, +{10856, 1287}, { 3555, 1009}, { 5606, 3622}, {19453, 5512}, {12453, 797}, +{20634, 911}, {15427, 3066}, {17037,10275}, {18883, 2633}, { 3913, 1268}, +{19519, 3371}, {18052, 5230}, {19291, 1678}, {19508, 3172}, {18072,10754}, +{16625, 6845}, { 3134, 2298}, {10869, 2437}, {15580, 6913}, {12597, 3381}, +{11116, 3297}, {16762, 2424}, {18853, 6715}, {17171, 9887}, {12743, 2605}, +{ 8937, 3140}, {19033, 7764}, {18347, 3880}, {20475, 3682}, {19602, 3380}, +{13044,19373}, {10526,23124} +}; + +/** gain table for 6.70, 7.40 and 10.2 kbps modes + * + * second index is {pitch_gain, fixed_gain_factor} */ +static const uint16_t gains_high[128][2] = { +{ 577, 662}, { 806, 1836}, { 3109, 1052}, { 4181, 1387}, { 2373, 1425}, +{ 3248, 1985}, { 1827, 2320}, { 941, 3314}, { 2351, 2977}, { 3616, 2420}, +{ 3451, 3096}, { 2955, 4301}, { 1848, 4500}, { 3884, 5416}, { 1187, 7210}, +{ 3083, 9000}, { 7384, 883}, { 5962, 1506}, { 5155, 2134}, { 7944, 2009}, +{ 6507, 2250}, { 7670, 2752}, { 5952, 3016}, { 4898, 3764}, { 6989, 3588}, +{ 8174, 3978}, { 6064, 4404}, { 7709, 5087}, { 5523, 6021}, { 7769, 7126}, +{ 6060, 7938}, { 5594,11487}, {10581, 1356}, { 9049, 1597}, { 9794, 2035}, +{ 8946, 2415}, {10296, 2584}, { 9407, 2734}, { 8700, 3218}, { 9757, 3395}, +{10177, 3892}, { 9170, 4528}, {10152, 5004}, { 9114, 5735}, {10500, 6266}, +{10110, 7631}, { 8844, 8727}, { 8956,12496}, {12924, 976}, {11435, 1755}, +{12138, 2328}, {11388, 2368}, {10700, 3064}, {12332, 2861}, {11722, 3327}, +{11270, 3700}, {10861, 4413}, {12082, 4533}, {11283, 5205}, {11960, 6305}, +{11167, 7534}, {12128, 8329}, {10969,10777}, {10300,17376}, {13899, 1681}, +{12580, 2045}, {13265, 2439}, {14033, 2989}, {13452, 3098}, {12396, 3658}, +{13510, 3780}, {12880, 4272}, {13533, 4861}, {12667, 5457}, {13854, 6106}, +{13031, 6483}, {13557, 7721}, {12957, 9311}, {13714,11551}, {12591,15206}, +{15113, 1540}, {15072, 2333}, {14527, 2511}, {14692, 3199}, {15382, 3560}, +{14133, 3960}, {15102, 4236}, {14332, 4824}, {14846, 5451}, {15306, 6083}, +{14329, 6888}, {15060, 7689}, {14406, 9426}, {15387, 9741}, {14824,14271}, +{13600,24939}, {16396, 1969}, {16817, 2832}, {15713, 2843}, {16104, 3336}, +{16384, 3963}, {16940, 4579}, {15711, 4599}, {16222, 5448}, {16832, 6382}, +{15745, 7141}, {16326, 7469}, {16611, 8624}, {17028,10418}, {15905,11817}, +{16878,14690}, {16515,20870}, {18142, 2083}, {19401, 3178}, {17508, 3426}, +{20054, 4027}, {18069, 4249}, {18952, 5066}, {17711, 5402}, {19835, 6192}, +{17950, 7014}, {21318, 7877}, {17910, 9289}, {19144, 9290}, {20517,11381}, +{18075,14485}, {19999,17882}, {18842,32764} +}; + +/** gain table for 5.15 and 5.90 kbps modes + * + * second index is {pitch_gain, fixed_gain_factor} */ +static const uint16_t gains_low[64][2] = { +{10813,28753}, {20480, 2785}, {18841, 6594}, { 6225, 7413}, {17203,10444}, +{21626, 1269}, {21135, 4423}, {11304, 1556}, {19005,12820}, {17367, 2498}, +{17858, 4833}, { 9994, 2498}, {17530, 7864}, {14254, 1884}, {15892, 3153}, +{ 6717, 1802}, {18186,20193}, {18022, 3031}, {16711, 5857}, { 8847, 4014}, +{15892, 8970}, {18022, 1392}, {16711, 4096}, { 8192, 655}, {15237,13926}, +{14254, 3112}, {14090, 4669}, { 5406, 2703}, {13434, 6553}, {12451, 901}, +{12451, 2662}, { 3768, 655}, {14745,23511}, {19169, 2457}, {20152, 5079}, +{ 6881, 4096}, {20480, 8560}, {19660, 737}, {19005, 4259}, { 7864, 2088}, +{11468,12288}, {15892, 1474}, {15728, 4628}, { 9175, 1433}, {16056, 7004}, +{14827, 737}, {15073, 2252}, { 5079, 1228}, {13271,17326}, {16547, 2334}, +{15073, 5816}, { 3932, 3686}, {14254, 8601}, {16875, 778}, {15073, 3809}, +{ 6062, 614}, { 9338, 9256}, {13271, 1761}, {13271, 3522}, { 2457, 1966}, +{11468, 5529}, {10485, 737}, {11632, 3194}, { 1474, 778} +}; + + +// pre-processing tables + +/** impulse response filter tables converted to float from Q15 int32_t + * used for anti-sparseness processing */ +static const float ir_filter_strong_MODE_7k95[AMR_SUBFRAME_SIZE] = { + 0.817169, 0.024445, 0.076447, -0.020844, -0.042175, 0.017761, 0.018433, +-0.038879, 0.107147, -0.179871, 0.138367, -0.015228, -0.059204, 0.091888, +-0.154358, 0.171326, -0.060730, -0.032379, -0.044525, 0.135559, -0.021362, +-0.162811, 0.140656, 0.013794, -0.017975, -0.102295, 0.090118, 0.038666, +-0.036987, -0.079041, 0.052826, 0.112000, -0.136566, -0.029755, 0.134003, +-0.077423, 0.028961, -0.041595, -0.029877, 0.174988, +}; + +static const float ir_filter_strong[AMR_SUBFRAME_SIZE] = { + 0.448303, 0.351501, 0.038696, -0.084259, -0.173065, 0.229309, -0.001068, +-0.085663, -0.092773, 0.147186, 0.090088, -0.257080, 0.115509, 0.044403, + 0.066498, -0.263580, 0.245697, -0.064178, -0.044373, 0.023712, 0.033813, +-0.072784, 0.068787, -0.011078, -0.020569, -0.064178, 0.184509, -0.173370, + 0.032715, 0.095306, -0.154358, 0.162109, -0.071075, -0.113770, 0.211304, +-0.118683, 0.020599, -0.054169, 0.000885, 0.309601, +}; + +static const float ir_filter_medium[AMR_SUBFRAME_SIZE] = { + 0.923889, 0.116913, -0.123169, 0.090698, -0.031982, -0.030579, 0.075592, +-0.092865, 0.085907, -0.068085, 0.053497, -0.049164, 0.052307, -0.054169, + 0.047089, -0.030762, 0.013092, -0.005157, 0.014404, -0.038574, 0.066406, +-0.082581, 0.076996, -0.049469, 0.010498, 0.025208, -0.046661, 0.052612, +-0.050568, 0.051910, -0.062958, 0.080688, -0.093384, 0.088409, -0.060364, + 0.016998, 0.023804, -0.041779, 0.025696, 0.019989, +}; + +static const float *ir_filters_lookup[2] = { + ir_filter_strong, ir_filter_medium +}; +static const float *ir_filters_lookup_MODE_7k95[2] = { + ir_filter_strong_MODE_7k95, ir_filter_medium +}; + +// High-pass coefficients + +static const float highpass_zeros[2] = { -2.0, 1.0 }; +static const float highpass_poles[2] = { -1.933105469, 0.935913085 }; +static const float highpass_gain = 0.939819335; + +#endif /* AVCODEC_AMRNBDATA_H */ + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amrnbdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amrnbdec.c new file mode 100644 index 00000000..ec896c7d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amrnbdec.c @@ -0,0 +1,1048 @@ +/* + * AMR narrowband decoder + * Copyright (c) 2006-2007 Robert Swain + * Copyright (c) 2009 Colin McQuillan + * + * 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 + * AMR narrowband decoder + * + * This decoder uses floats for simplicity and so is not bit-exact. One + * difference is that differences in phase can accumulate. The test sequences + * in 3GPP TS 26.074 can still be useful. + * + * - Comparing this file's output to the output of the ref decoder gives a + * PSNR of 30 to 80. Plotting the output samples shows a difference in + * phase in some areas. + * + * - Comparing both decoders against their input, this decoder gives a similar + * PSNR. If the test sequence homing frames are removed (this decoder does + * not detect them), the PSNR is at least as good as the reference on 140 + * out of 169 tests. + */ + + +#include +#include + +#include "avcodec.h" +#include "get_bits.h" +#include "libavutil/common.h" +#include "celp_math.h" +#include "celp_filters.h" +#include "acelp_filters.h" +#include "acelp_vectors.h" +#include "acelp_pitch_delay.h" +#include "lsp.h" +#include "amr.h" + +#include "amrnbdata.h" + +#define AMR_BLOCK_SIZE 160 ///< samples per frame +#define AMR_SAMPLE_BOUND 32768.0 ///< threshold for synthesis overflow + +/** + * Scale from constructed speech to [-1,1] + * + * AMR is designed to produce 16-bit PCM samples (3GPP TS 26.090 4.2) but + * upscales by two (section 6.2.2). + * + * Fundamentally, this scale is determined by energy_mean through + * the fixed vector contribution to the excitation vector. + */ +#define AMR_SAMPLE_SCALE (2.0 / 32768.0) + +/** Prediction factor for 12.2kbit/s mode */ +#define PRED_FAC_MODE_12k2 0.65 + +#define LSF_R_FAC (8000.0 / 32768.0) ///< LSF residual tables to Hertz +#define MIN_LSF_SPACING (50.0488 / 8000.0) ///< Ensures stability of LPC filter +#define PITCH_LAG_MIN_MODE_12k2 18 ///< Lower bound on decoded lag search in 12.2kbit/s mode + +/** Initial energy in dB. Also used for bad frames (unimplemented). */ +#define MIN_ENERGY -14.0 + +/** Maximum sharpening factor + * + * The specification says 0.8, which should be 13107, but the reference C code + * uses 13017 instead. (Amusingly the same applies to SHARP_MAX in g729dec.c.) + */ +#define SHARP_MAX 0.79449462890625 + +/** Number of impulse response coefficients used for tilt factor */ +#define AMR_TILT_RESPONSE 22 +/** Tilt factor = 1st reflection coefficient * gamma_t */ +#define AMR_TILT_GAMMA_T 0.8 +/** Adaptive gain control factor used in post-filter */ +#define AMR_AGC_ALPHA 0.9 + +typedef struct AMRContext { + AMRNBFrame frame; ///< decoded AMR parameters (lsf coefficients, codebook indexes, etc) + uint8_t bad_frame_indicator; ///< bad frame ? 1 : 0 + enum Mode cur_frame_mode; + + int16_t prev_lsf_r[LP_FILTER_ORDER]; ///< residual LSF vector from previous subframe + double lsp[4][LP_FILTER_ORDER]; ///< lsp vectors from current frame + double prev_lsp_sub4[LP_FILTER_ORDER]; ///< lsp vector for the 4th subframe of the previous frame + + float lsf_q[4][LP_FILTER_ORDER]; ///< Interpolated LSF vector for fixed gain smoothing + float lsf_avg[LP_FILTER_ORDER]; ///< vector of averaged lsf vector + + float lpc[4][LP_FILTER_ORDER]; ///< lpc coefficient vectors for 4 subframes + + uint8_t pitch_lag_int; ///< integer part of pitch lag from current subframe + + float excitation_buf[PITCH_DELAY_MAX + LP_FILTER_ORDER + 1 + AMR_SUBFRAME_SIZE]; ///< current excitation and all necessary excitation history + float *excitation; ///< pointer to the current excitation vector in excitation_buf + + float pitch_vector[AMR_SUBFRAME_SIZE]; ///< adaptive code book (pitch) vector + float fixed_vector[AMR_SUBFRAME_SIZE]; ///< algebraic codebook (fixed) vector (must be kept zero between frames) + + float prediction_error[4]; ///< quantified prediction errors {20log10(^gamma_gc)} for previous four subframes + float pitch_gain[5]; ///< quantified pitch gains for the current and previous four subframes + float fixed_gain[5]; ///< quantified fixed gains for the current and previous four subframes + + float beta; ///< previous pitch_gain, bounded by [0.0,SHARP_MAX] + uint8_t diff_count; ///< the number of subframes for which diff has been above 0.65 + uint8_t hang_count; ///< the number of subframes since a hangover period started + + float prev_sparse_fixed_gain; ///< previous fixed gain; used by anti-sparseness processing to determine "onset" + uint8_t prev_ir_filter_nr; ///< previous impulse response filter "impNr": 0 - strong, 1 - medium, 2 - none + uint8_t ir_filter_onset; ///< flag for impulse response filter strength + + float postfilter_mem[10]; ///< previous intermediate values in the formant filter + float tilt_mem; ///< previous input to tilt compensation filter + float postfilter_agc; ///< previous factor used for adaptive gain control + float high_pass_mem[2]; ///< previous intermediate values in the high-pass filter + + float samples_in[LP_FILTER_ORDER + AMR_SUBFRAME_SIZE]; ///< floating point samples + +} AMRContext; + +/** Double version of ff_weighted_vector_sumf() */ +static void weighted_vector_sumd(double *out, const double *in_a, + const double *in_b, double weight_coeff_a, + double weight_coeff_b, int length) +{ + int i; + + for (i = 0; i < length; i++) + out[i] = weight_coeff_a * in_a[i] + + weight_coeff_b * in_b[i]; +} + +static av_cold int amrnb_decode_init(AVCodecContext *avctx) +{ + AMRContext *p = avctx->priv_data; + int i; + + avctx->sample_fmt = AV_SAMPLE_FMT_FLT; + + // p->excitation always points to the same position in p->excitation_buf + p->excitation = &p->excitation_buf[PITCH_DELAY_MAX + LP_FILTER_ORDER + 1]; + + for (i = 0; i < LP_FILTER_ORDER; i++) { + p->prev_lsp_sub4[i] = lsp_sub4_init[i] * 1000 / (float)(1 << 15); + p->lsf_avg[i] = p->lsf_q[3][i] = lsp_avg_init[i] / (float)(1 << 15); + } + + for (i = 0; i < 4; i++) + p->prediction_error[i] = MIN_ENERGY; + + return 0; +} + + +/** + * Unpack an RFC4867 speech frame into the AMR frame mode and parameters. + * + * The order of speech bits is specified by 3GPP TS 26.101. + * + * @param p the context + * @param buf pointer to the input buffer + * @param buf_size size of the input buffer + * + * @return the frame mode + */ +static enum Mode unpack_bitstream(AMRContext *p, const uint8_t *buf, + int buf_size) +{ + GetBitContext gb; + enum Mode mode; + + init_get_bits(&gb, buf, buf_size * 8); + + // Decode the first octet. + skip_bits(&gb, 1); // padding bit + mode = get_bits(&gb, 4); // frame type + p->bad_frame_indicator = !get_bits1(&gb); // quality bit + skip_bits(&gb, 2); // two padding bits + + if (mode < MODE_DTX) + ff_amr_bit_reorder((uint16_t *) &p->frame, sizeof(AMRNBFrame), buf + 1, + amr_unpacking_bitmaps_per_mode[mode]); + + return mode; +} + + +/// @defgroup amr_lpc_decoding AMR pitch LPC coefficient decoding functions +/// @{ + +/** + * Interpolate the LSF vector (used for fixed gain smoothing). + * The interpolation is done over all four subframes even in MODE_12k2. + * + * @param[in,out] lsf_q LSFs in [0,1] for each subframe + * @param[in] lsf_new New LSFs in [0,1] for subframe 4 + */ +static void interpolate_lsf(float lsf_q[4][LP_FILTER_ORDER], float *lsf_new) +{ + int i; + + for (i = 0; i < 4; i++) + ff_weighted_vector_sumf(lsf_q[i], lsf_q[3], lsf_new, + 0.25 * (3 - i), 0.25 * (i + 1), + LP_FILTER_ORDER); +} + +/** + * Decode a set of 5 split-matrix quantized lsf indexes into an lsp vector. + * + * @param p the context + * @param lsp output LSP vector + * @param lsf_no_r LSF vector without the residual vector added + * @param lsf_quantizer pointers to LSF dictionary tables + * @param quantizer_offset offset in tables + * @param sign for the 3 dictionary table + * @param update store data for computing the next frame's LSFs + */ +static void lsf2lsp_for_mode12k2(AMRContext *p, double lsp[LP_FILTER_ORDER], + const float lsf_no_r[LP_FILTER_ORDER], + const int16_t *lsf_quantizer[5], + const int quantizer_offset, + const int sign, const int update) +{ + int16_t lsf_r[LP_FILTER_ORDER]; // residual LSF vector + float lsf_q[LP_FILTER_ORDER]; // quantified LSF vector + int i; + + for (i = 0; i < LP_FILTER_ORDER >> 1; i++) + memcpy(&lsf_r[i << 1], &lsf_quantizer[i][quantizer_offset], + 2 * sizeof(*lsf_r)); + + if (sign) { + lsf_r[4] *= -1; + lsf_r[5] *= -1; + } + + if (update) + memcpy(p->prev_lsf_r, lsf_r, LP_FILTER_ORDER * sizeof(float)); + + for (i = 0; i < LP_FILTER_ORDER; i++) + lsf_q[i] = lsf_r[i] * (LSF_R_FAC / 8000.0) + lsf_no_r[i] * (1.0 / 8000.0); + + ff_set_min_dist_lsf(lsf_q, MIN_LSF_SPACING, LP_FILTER_ORDER); + + if (update) + interpolate_lsf(p->lsf_q, lsf_q); + + ff_acelp_lsf2lspd(lsp, lsf_q, LP_FILTER_ORDER); +} + +/** + * Decode a set of 5 split-matrix quantized lsf indexes into 2 lsp vectors. + * + * @param p pointer to the AMRContext + */ +static void lsf2lsp_5(AMRContext *p) +{ + const uint16_t *lsf_param = p->frame.lsf; + float lsf_no_r[LP_FILTER_ORDER]; // LSFs without the residual vector + const int16_t *lsf_quantizer[5]; + int i; + + lsf_quantizer[0] = lsf_5_1[lsf_param[0]]; + lsf_quantizer[1] = lsf_5_2[lsf_param[1]]; + lsf_quantizer[2] = lsf_5_3[lsf_param[2] >> 1]; + lsf_quantizer[3] = lsf_5_4[lsf_param[3]]; + lsf_quantizer[4] = lsf_5_5[lsf_param[4]]; + + for (i = 0; i < LP_FILTER_ORDER; i++) + lsf_no_r[i] = p->prev_lsf_r[i] * LSF_R_FAC * PRED_FAC_MODE_12k2 + lsf_5_mean[i]; + + lsf2lsp_for_mode12k2(p, p->lsp[1], lsf_no_r, lsf_quantizer, 0, lsf_param[2] & 1, 0); + lsf2lsp_for_mode12k2(p, p->lsp[3], lsf_no_r, lsf_quantizer, 2, lsf_param[2] & 1, 1); + + // interpolate LSP vectors at subframes 1 and 3 + weighted_vector_sumd(p->lsp[0], p->prev_lsp_sub4, p->lsp[1], 0.5, 0.5, LP_FILTER_ORDER); + weighted_vector_sumd(p->lsp[2], p->lsp[1] , p->lsp[3], 0.5, 0.5, LP_FILTER_ORDER); +} + +/** + * Decode a set of 3 split-matrix quantized lsf indexes into an lsp vector. + * + * @param p pointer to the AMRContext + */ +static void lsf2lsp_3(AMRContext *p) +{ + const uint16_t *lsf_param = p->frame.lsf; + int16_t lsf_r[LP_FILTER_ORDER]; // residual LSF vector + float lsf_q[LP_FILTER_ORDER]; // quantified LSF vector + const int16_t *lsf_quantizer; + int i, j; + + lsf_quantizer = (p->cur_frame_mode == MODE_7k95 ? lsf_3_1_MODE_7k95 : lsf_3_1)[lsf_param[0]]; + memcpy(lsf_r, lsf_quantizer, 3 * sizeof(*lsf_r)); + + lsf_quantizer = lsf_3_2[lsf_param[1] << (p->cur_frame_mode <= MODE_5k15)]; + memcpy(lsf_r + 3, lsf_quantizer, 3 * sizeof(*lsf_r)); + + lsf_quantizer = (p->cur_frame_mode <= MODE_5k15 ? lsf_3_3_MODE_5k15 : lsf_3_3)[lsf_param[2]]; + memcpy(lsf_r + 6, lsf_quantizer, 4 * sizeof(*lsf_r)); + + // calculate mean-removed LSF vector and add mean + for (i = 0; i < LP_FILTER_ORDER; i++) + lsf_q[i] = (lsf_r[i] + p->prev_lsf_r[i] * pred_fac[i]) * (LSF_R_FAC / 8000.0) + lsf_3_mean[i] * (1.0 / 8000.0); + + ff_set_min_dist_lsf(lsf_q, MIN_LSF_SPACING, LP_FILTER_ORDER); + + // store data for computing the next frame's LSFs + interpolate_lsf(p->lsf_q, lsf_q); + memcpy(p->prev_lsf_r, lsf_r, LP_FILTER_ORDER * sizeof(*lsf_r)); + + ff_acelp_lsf2lspd(p->lsp[3], lsf_q, LP_FILTER_ORDER); + + // interpolate LSP vectors at subframes 1, 2 and 3 + for (i = 1; i <= 3; i++) + for(j = 0; j < LP_FILTER_ORDER; j++) + p->lsp[i-1][j] = p->prev_lsp_sub4[j] + + (p->lsp[3][j] - p->prev_lsp_sub4[j]) * 0.25 * i; +} + +/// @} + + +/// @defgroup amr_pitch_vector_decoding AMR pitch vector decoding functions +/// @{ + +/** + * Like ff_decode_pitch_lag(), but with 1/6 resolution + */ +static void decode_pitch_lag_1_6(int *lag_int, int *lag_frac, int pitch_index, + const int prev_lag_int, const int subframe) +{ + if (subframe == 0 || subframe == 2) { + if (pitch_index < 463) { + *lag_int = (pitch_index + 107) * 10923 >> 16; + *lag_frac = pitch_index - *lag_int * 6 + 105; + } else { + *lag_int = pitch_index - 368; + *lag_frac = 0; + } + } else { + *lag_int = ((pitch_index + 5) * 10923 >> 16) - 1; + *lag_frac = pitch_index - *lag_int * 6 - 3; + *lag_int += av_clip(prev_lag_int - 5, PITCH_LAG_MIN_MODE_12k2, + PITCH_DELAY_MAX - 9); + } +} + +static void decode_pitch_vector(AMRContext *p, + const AMRNBSubframe *amr_subframe, + const int subframe) +{ + int pitch_lag_int, pitch_lag_frac; + enum Mode mode = p->cur_frame_mode; + + if (p->cur_frame_mode == MODE_12k2) { + decode_pitch_lag_1_6(&pitch_lag_int, &pitch_lag_frac, + amr_subframe->p_lag, p->pitch_lag_int, + subframe); + } else + ff_decode_pitch_lag(&pitch_lag_int, &pitch_lag_frac, + amr_subframe->p_lag, + p->pitch_lag_int, subframe, + mode != MODE_4k75 && mode != MODE_5k15, + mode <= MODE_6k7 ? 4 : (mode == MODE_7k95 ? 5 : 6)); + + p->pitch_lag_int = pitch_lag_int; // store previous lag in a uint8_t + + pitch_lag_frac <<= (p->cur_frame_mode != MODE_12k2); + + pitch_lag_int += pitch_lag_frac > 0; + + /* Calculate the pitch vector by interpolating the past excitation at the + pitch lag using a b60 hamming windowed sinc function. */ + ff_acelp_interpolatef(p->excitation, p->excitation + 1 - pitch_lag_int, + ff_b60_sinc, 6, + pitch_lag_frac + 6 - 6*(pitch_lag_frac > 0), + 10, AMR_SUBFRAME_SIZE); + + memcpy(p->pitch_vector, p->excitation, AMR_SUBFRAME_SIZE * sizeof(float)); +} + +/// @} + + +/// @defgroup amr_algebraic_code_book AMR algebraic code book (fixed) vector decoding functions +/// @{ + +/** + * Decode a 10-bit algebraic codebook index from a 10.2 kbit/s frame. + */ +static void decode_10bit_pulse(int code, int pulse_position[8], + int i1, int i2, int i3) +{ + // coded using 7+3 bits with the 3 LSBs being, individually, the LSB of 1 of + // the 3 pulses and the upper 7 bits being coded in base 5 + const uint8_t *positions = base_five_table[code >> 3]; + pulse_position[i1] = (positions[2] << 1) + ( code & 1); + pulse_position[i2] = (positions[1] << 1) + ((code >> 1) & 1); + pulse_position[i3] = (positions[0] << 1) + ((code >> 2) & 1); +} + +/** + * Decode the algebraic codebook index to pulse positions and signs and + * construct the algebraic codebook vector for MODE_10k2. + * + * @param fixed_index positions of the eight pulses + * @param fixed_sparse pointer to the algebraic codebook vector + */ +static void decode_8_pulses_31bits(const int16_t *fixed_index, + AMRFixed *fixed_sparse) +{ + int pulse_position[8]; + int i, temp; + + decode_10bit_pulse(fixed_index[4], pulse_position, 0, 4, 1); + decode_10bit_pulse(fixed_index[5], pulse_position, 2, 6, 5); + + // coded using 5+2 bits with the 2 LSBs being, individually, the LSB of 1 of + // the 2 pulses and the upper 5 bits being coded in base 5 + temp = ((fixed_index[6] >> 2) * 25 + 12) >> 5; + pulse_position[3] = temp % 5; + pulse_position[7] = temp / 5; + if (pulse_position[7] & 1) + pulse_position[3] = 4 - pulse_position[3]; + pulse_position[3] = (pulse_position[3] << 1) + ( fixed_index[6] & 1); + pulse_position[7] = (pulse_position[7] << 1) + ((fixed_index[6] >> 1) & 1); + + fixed_sparse->n = 8; + for (i = 0; i < 4; i++) { + const int pos1 = (pulse_position[i] << 2) + i; + const int pos2 = (pulse_position[i + 4] << 2) + i; + const float sign = fixed_index[i] ? -1.0 : 1.0; + fixed_sparse->x[i ] = pos1; + fixed_sparse->x[i + 4] = pos2; + fixed_sparse->y[i ] = sign; + fixed_sparse->y[i + 4] = pos2 < pos1 ? -sign : sign; + } +} + +/** + * Decode the algebraic codebook index to pulse positions and signs, + * then construct the algebraic codebook vector. + * + * nb of pulses | bits encoding pulses + * For MODE_4k75 or MODE_5k15, 2 | 1-3, 4-6, 7 + * MODE_5k9, 2 | 1, 2-4, 5-6, 7-9 + * MODE_6k7, 3 | 1-3, 4, 5-7, 8, 9-11 + * MODE_7k4 or MODE_7k95, 4 | 1-3, 4-6, 7-9, 10, 11-13 + * + * @param fixed_sparse pointer to the algebraic codebook vector + * @param pulses algebraic codebook indexes + * @param mode mode of the current frame + * @param subframe current subframe number + */ +static void decode_fixed_sparse(AMRFixed *fixed_sparse, const uint16_t *pulses, + const enum Mode mode, const int subframe) +{ + assert(MODE_4k75 <= mode && mode <= MODE_12k2); + + if (mode == MODE_12k2) { + ff_decode_10_pulses_35bits(pulses, fixed_sparse, gray_decode, 5, 3); + } else if (mode == MODE_10k2) { + decode_8_pulses_31bits(pulses, fixed_sparse); + } else { + int *pulse_position = fixed_sparse->x; + int i, pulse_subset; + const int fixed_index = pulses[0]; + + if (mode <= MODE_5k15) { + pulse_subset = ((fixed_index >> 3) & 8) + (subframe << 1); + pulse_position[0] = ( fixed_index & 7) * 5 + track_position[pulse_subset]; + pulse_position[1] = ((fixed_index >> 3) & 7) * 5 + track_position[pulse_subset + 1]; + fixed_sparse->n = 2; + } else if (mode == MODE_5k9) { + pulse_subset = ((fixed_index & 1) << 1) + 1; + pulse_position[0] = ((fixed_index >> 1) & 7) * 5 + pulse_subset; + pulse_subset = (fixed_index >> 4) & 3; + pulse_position[1] = ((fixed_index >> 6) & 7) * 5 + pulse_subset + (pulse_subset == 3 ? 1 : 0); + fixed_sparse->n = pulse_position[0] == pulse_position[1] ? 1 : 2; + } else if (mode == MODE_6k7) { + pulse_position[0] = (fixed_index & 7) * 5; + pulse_subset = (fixed_index >> 2) & 2; + pulse_position[1] = ((fixed_index >> 4) & 7) * 5 + pulse_subset + 1; + pulse_subset = (fixed_index >> 6) & 2; + pulse_position[2] = ((fixed_index >> 8) & 7) * 5 + pulse_subset + 2; + fixed_sparse->n = 3; + } else { // mode <= MODE_7k95 + pulse_position[0] = gray_decode[ fixed_index & 7]; + pulse_position[1] = gray_decode[(fixed_index >> 3) & 7] + 1; + pulse_position[2] = gray_decode[(fixed_index >> 6) & 7] + 2; + pulse_subset = (fixed_index >> 9) & 1; + pulse_position[3] = gray_decode[(fixed_index >> 10) & 7] + pulse_subset + 3; + fixed_sparse->n = 4; + } + for (i = 0; i < fixed_sparse->n; i++) + fixed_sparse->y[i] = (pulses[1] >> i) & 1 ? 1.0 : -1.0; + } +} + +/** + * Apply pitch lag to obtain the sharpened fixed vector (section 6.1.2) + * + * @param p the context + * @param subframe unpacked amr subframe + * @param mode mode of the current frame + * @param fixed_sparse sparse respresentation of the fixed vector + */ +static void pitch_sharpening(AMRContext *p, int subframe, enum Mode mode, + AMRFixed *fixed_sparse) +{ + // The spec suggests the current pitch gain is always used, but in other + // modes the pitch and codebook gains are joinly quantized (sec 5.8.2) + // so the codebook gain cannot depend on the quantized pitch gain. + if (mode == MODE_12k2) + p->beta = FFMIN(p->pitch_gain[4], 1.0); + + fixed_sparse->pitch_lag = p->pitch_lag_int; + fixed_sparse->pitch_fac = p->beta; + + // Save pitch sharpening factor for the next subframe + // MODE_4k75 only updates on the 2nd and 4th subframes - this follows from + // the fact that the gains for two subframes are jointly quantized. + if (mode != MODE_4k75 || subframe & 1) + p->beta = av_clipf(p->pitch_gain[4], 0.0, SHARP_MAX); +} +/// @} + + +/// @defgroup amr_gain_decoding AMR gain decoding functions +/// @{ + +/** + * fixed gain smoothing + * Note that where the spec specifies the "spectrum in the q domain" + * in section 6.1.4, in fact frequencies should be used. + * + * @param p the context + * @param lsf LSFs for the current subframe, in the range [0,1] + * @param lsf_avg averaged LSFs + * @param mode mode of the current frame + * + * @return fixed gain smoothed + */ +static float fixed_gain_smooth(AMRContext *p , const float *lsf, + const float *lsf_avg, const enum Mode mode) +{ + float diff = 0.0; + int i; + + for (i = 0; i < LP_FILTER_ORDER; i++) + diff += fabs(lsf_avg[i] - lsf[i]) / lsf_avg[i]; + + // If diff is large for ten subframes, disable smoothing for a 40-subframe + // hangover period. + p->diff_count++; + if (diff <= 0.65) + p->diff_count = 0; + + if (p->diff_count > 10) { + p->hang_count = 0; + p->diff_count--; // don't let diff_count overflow + } + + if (p->hang_count < 40) { + p->hang_count++; + } else if (mode < MODE_7k4 || mode == MODE_10k2) { + const float smoothing_factor = av_clipf(4.0 * diff - 1.6, 0.0, 1.0); + const float fixed_gain_mean = (p->fixed_gain[0] + p->fixed_gain[1] + + p->fixed_gain[2] + p->fixed_gain[3] + + p->fixed_gain[4]) * 0.2; + return smoothing_factor * p->fixed_gain[4] + + (1.0 - smoothing_factor) * fixed_gain_mean; + } + return p->fixed_gain[4]; +} + +/** + * Decode pitch gain and fixed gain factor (part of section 6.1.3). + * + * @param p the context + * @param amr_subframe unpacked amr subframe + * @param mode mode of the current frame + * @param subframe current subframe number + * @param fixed_gain_factor decoded gain correction factor + */ +static void decode_gains(AMRContext *p, const AMRNBSubframe *amr_subframe, + const enum Mode mode, const int subframe, + float *fixed_gain_factor) +{ + if (mode == MODE_12k2 || mode == MODE_7k95) { + p->pitch_gain[4] = qua_gain_pit [amr_subframe->p_gain ] + * (1.0 / 16384.0); + *fixed_gain_factor = qua_gain_code[amr_subframe->fixed_gain] + * (1.0 / 2048.0); + } else { + const uint16_t *gains; + + if (mode >= MODE_6k7) { + gains = gains_high[amr_subframe->p_gain]; + } else if (mode >= MODE_5k15) { + gains = gains_low [amr_subframe->p_gain]; + } else { + // gain index is only coded in subframes 0,2 for MODE_4k75 + gains = gains_MODE_4k75[(p->frame.subframe[subframe & 2].p_gain << 1) + (subframe & 1)]; + } + + p->pitch_gain[4] = gains[0] * (1.0 / 16384.0); + *fixed_gain_factor = gains[1] * (1.0 / 4096.0); + } +} + +/// @} + + +/// @defgroup amr_pre_processing AMR pre-processing functions +/// @{ + +/** + * Circularly convolve a sparse fixed vector with a phase dispersion impulse + * response filter (D.6.2 of G.729 and 6.1.5 of AMR). + * + * @param out vector with filter applied + * @param in source vector + * @param filter phase filter coefficients + * + * out[n] = sum(i,0,len-1){ in[i] * filter[(len + n - i)%len] } + */ +static void apply_ir_filter(float *out, const AMRFixed *in, + const float *filter) +{ + float filter1[AMR_SUBFRAME_SIZE], //!< filters at pitch lag*1 and *2 + filter2[AMR_SUBFRAME_SIZE]; + int lag = in->pitch_lag; + float fac = in->pitch_fac; + int i; + + if (lag < AMR_SUBFRAME_SIZE) { + ff_celp_circ_addf(filter1, filter, filter, lag, fac, + AMR_SUBFRAME_SIZE); + + if (lag < AMR_SUBFRAME_SIZE >> 1) + ff_celp_circ_addf(filter2, filter, filter1, lag, fac, + AMR_SUBFRAME_SIZE); + } + + memset(out, 0, sizeof(float) * AMR_SUBFRAME_SIZE); + for (i = 0; i < in->n; i++) { + int x = in->x[i]; + float y = in->y[i]; + const float *filterp; + + if (x >= AMR_SUBFRAME_SIZE - lag) { + filterp = filter; + } else if (x >= AMR_SUBFRAME_SIZE - (lag << 1)) { + filterp = filter1; + } else + filterp = filter2; + + ff_celp_circ_addf(out, out, filterp, x, y, AMR_SUBFRAME_SIZE); + } +} + +/** + * Reduce fixed vector sparseness by smoothing with one of three IR filters. + * Also know as "adaptive phase dispersion". + * + * This implements 3GPP TS 26.090 section 6.1(5). + * + * @param p the context + * @param fixed_sparse algebraic codebook vector + * @param fixed_vector unfiltered fixed vector + * @param fixed_gain smoothed gain + * @param out space for modified vector if necessary + */ +static const float *anti_sparseness(AMRContext *p, AMRFixed *fixed_sparse, + const float *fixed_vector, + float fixed_gain, float *out) +{ + int ir_filter_nr; + + if (p->pitch_gain[4] < 0.6) { + ir_filter_nr = 0; // strong filtering + } else if (p->pitch_gain[4] < 0.9) { + ir_filter_nr = 1; // medium filtering + } else + ir_filter_nr = 2; // no filtering + + // detect 'onset' + if (fixed_gain > 2.0 * p->prev_sparse_fixed_gain) { + p->ir_filter_onset = 2; + } else if (p->ir_filter_onset) + p->ir_filter_onset--; + + if (!p->ir_filter_onset) { + int i, count = 0; + + for (i = 0; i < 5; i++) + if (p->pitch_gain[i] < 0.6) + count++; + if (count > 2) + ir_filter_nr = 0; + + if (ir_filter_nr > p->prev_ir_filter_nr + 1) + ir_filter_nr--; + } else if (ir_filter_nr < 2) + ir_filter_nr++; + + // Disable filtering for very low level of fixed_gain. + // Note this step is not specified in the technical description but is in + // the reference source in the function Ph_disp. + if (fixed_gain < 5.0) + ir_filter_nr = 2; + + if (p->cur_frame_mode != MODE_7k4 && p->cur_frame_mode < MODE_10k2 + && ir_filter_nr < 2) { + apply_ir_filter(out, fixed_sparse, + (p->cur_frame_mode == MODE_7k95 ? + ir_filters_lookup_MODE_7k95 : + ir_filters_lookup)[ir_filter_nr]); + fixed_vector = out; + } + + // update ir filter strength history + p->prev_ir_filter_nr = ir_filter_nr; + p->prev_sparse_fixed_gain = fixed_gain; + + return fixed_vector; +} + +/// @} + + +/// @defgroup amr_synthesis AMR synthesis functions +/// @{ + +/** + * Conduct 10th order linear predictive coding synthesis. + * + * @param p pointer to the AMRContext + * @param lpc pointer to the LPC coefficients + * @param fixed_gain fixed codebook gain for synthesis + * @param fixed_vector algebraic codebook vector + * @param samples pointer to the output speech samples + * @param overflow 16-bit overflow flag + */ +static int synthesis(AMRContext *p, float *lpc, + float fixed_gain, const float *fixed_vector, + float *samples, uint8_t overflow) +{ + int i; + float excitation[AMR_SUBFRAME_SIZE]; + + // if an overflow has been detected, the pitch vector is scaled down by a + // factor of 4 + if (overflow) + for (i = 0; i < AMR_SUBFRAME_SIZE; i++) + p->pitch_vector[i] *= 0.25; + + ff_weighted_vector_sumf(excitation, p->pitch_vector, fixed_vector, + p->pitch_gain[4], fixed_gain, AMR_SUBFRAME_SIZE); + + // emphasize pitch vector contribution + if (p->pitch_gain[4] > 0.5 && !overflow) { + float energy = ff_dot_productf(excitation, excitation, + AMR_SUBFRAME_SIZE); + float pitch_factor = + p->pitch_gain[4] * + (p->cur_frame_mode == MODE_12k2 ? + 0.25 * FFMIN(p->pitch_gain[4], 1.0) : + 0.5 * FFMIN(p->pitch_gain[4], SHARP_MAX)); + + for (i = 0; i < AMR_SUBFRAME_SIZE; i++) + excitation[i] += pitch_factor * p->pitch_vector[i]; + + ff_scale_vector_to_given_sum_of_squares(excitation, excitation, energy, + AMR_SUBFRAME_SIZE); + } + + ff_celp_lp_synthesis_filterf(samples, lpc, excitation, AMR_SUBFRAME_SIZE, + LP_FILTER_ORDER); + + // detect overflow + for (i = 0; i < AMR_SUBFRAME_SIZE; i++) + if (fabsf(samples[i]) > AMR_SAMPLE_BOUND) { + return 1; + } + + return 0; +} + +/// @} + + +/// @defgroup amr_update AMR update functions +/// @{ + +/** + * Update buffers and history at the end of decoding a subframe. + * + * @param p pointer to the AMRContext + */ +static void update_state(AMRContext *p) +{ + memcpy(p->prev_lsp_sub4, p->lsp[3], LP_FILTER_ORDER * sizeof(p->lsp[3][0])); + + memmove(&p->excitation_buf[0], &p->excitation_buf[AMR_SUBFRAME_SIZE], + (PITCH_DELAY_MAX + LP_FILTER_ORDER + 1) * sizeof(float)); + + memmove(&p->pitch_gain[0], &p->pitch_gain[1], 4 * sizeof(float)); + memmove(&p->fixed_gain[0], &p->fixed_gain[1], 4 * sizeof(float)); + + memmove(&p->samples_in[0], &p->samples_in[AMR_SUBFRAME_SIZE], + LP_FILTER_ORDER * sizeof(float)); +} + +/// @} + + +/// @defgroup amr_postproc AMR Post processing functions +/// @{ + +/** + * Get the tilt factor of a formant filter from its transfer function + * + * @param lpc_n LP_FILTER_ORDER coefficients of the numerator + * @param lpc_d LP_FILTER_ORDER coefficients of the denominator + */ +static float tilt_factor(float *lpc_n, float *lpc_d) +{ + float rh0, rh1; // autocorrelation at lag 0 and 1 + + // LP_FILTER_ORDER prior zeros are needed for ff_celp_lp_synthesis_filterf + float impulse_buffer[LP_FILTER_ORDER + AMR_TILT_RESPONSE] = { 0 }; + float *hf = impulse_buffer + LP_FILTER_ORDER; // start of impulse response + + hf[0] = 1.0; + memcpy(hf + 1, lpc_n, sizeof(float) * LP_FILTER_ORDER); + ff_celp_lp_synthesis_filterf(hf, lpc_d, hf, AMR_TILT_RESPONSE, + LP_FILTER_ORDER); + + rh0 = ff_dot_productf(hf, hf, AMR_TILT_RESPONSE); + rh1 = ff_dot_productf(hf, hf + 1, AMR_TILT_RESPONSE - 1); + + // The spec only specifies this check for 12.2 and 10.2 kbit/s + // modes. But in the ref source the tilt is always non-negative. + return rh1 >= 0.0 ? rh1 / rh0 * AMR_TILT_GAMMA_T : 0.0; +} + +/** + * Perform adaptive post-filtering to enhance the quality of the speech. + * See section 6.2.1. + * + * @param p pointer to the AMRContext + * @param lpc interpolated LP coefficients for this subframe + * @param buf_out output of the filter + */ +static void postfilter(AMRContext *p, float *lpc, float *buf_out) +{ + int i; + float *samples = p->samples_in + LP_FILTER_ORDER; // Start of input + + float speech_gain = ff_dot_productf(samples, samples, + AMR_SUBFRAME_SIZE); + + float pole_out[AMR_SUBFRAME_SIZE + LP_FILTER_ORDER]; // Output of pole filter + const float *gamma_n, *gamma_d; // Formant filter factor table + float lpc_n[LP_FILTER_ORDER], lpc_d[LP_FILTER_ORDER]; // Transfer function coefficients + + if (p->cur_frame_mode == MODE_12k2 || p->cur_frame_mode == MODE_10k2) { + gamma_n = ff_pow_0_7; + gamma_d = ff_pow_0_75; + } else { + gamma_n = ff_pow_0_55; + gamma_d = ff_pow_0_7; + } + + for (i = 0; i < LP_FILTER_ORDER; i++) { + lpc_n[i] = lpc[i] * gamma_n[i]; + lpc_d[i] = lpc[i] * gamma_d[i]; + } + + memcpy(pole_out, p->postfilter_mem, sizeof(float) * LP_FILTER_ORDER); + ff_celp_lp_synthesis_filterf(pole_out + LP_FILTER_ORDER, lpc_d, samples, + AMR_SUBFRAME_SIZE, LP_FILTER_ORDER); + memcpy(p->postfilter_mem, pole_out + AMR_SUBFRAME_SIZE, + sizeof(float) * LP_FILTER_ORDER); + + ff_celp_lp_zero_synthesis_filterf(buf_out, lpc_n, + pole_out + LP_FILTER_ORDER, + AMR_SUBFRAME_SIZE, LP_FILTER_ORDER); + + ff_tilt_compensation(&p->tilt_mem, tilt_factor(lpc_n, lpc_d), buf_out, + AMR_SUBFRAME_SIZE); + + ff_adaptive_gain_control(buf_out, buf_out, speech_gain, AMR_SUBFRAME_SIZE, + AMR_AGC_ALPHA, &p->postfilter_agc); +} + +/// @} + +static int amrnb_decode_frame(AVCodecContext *avctx, void *data, int *data_size, + AVPacket *avpkt) +{ + + AMRContext *p = avctx->priv_data; // pointer to private data + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + float *buf_out = data; // pointer to the output data buffer + int i, subframe; + float fixed_gain_factor; + AMRFixed fixed_sparse = {0}; // fixed vector up to anti-sparseness processing + float spare_vector[AMR_SUBFRAME_SIZE]; // extra stack space to hold result from anti-sparseness processing + float synth_fixed_gain; // the fixed gain that synthesis should use + const float *synth_fixed_vector; // pointer to the fixed vector that synthesis should use + + p->cur_frame_mode = unpack_bitstream(p, buf, buf_size); + if (p->cur_frame_mode == MODE_DTX) { + av_log_missing_feature(avctx, "dtx mode", 1); + return -1; + } + + if (p->cur_frame_mode == MODE_12k2) { + lsf2lsp_5(p); + } else + lsf2lsp_3(p); + + for (i = 0; i < 4; i++) + ff_acelp_lspd2lpc(p->lsp[i], p->lpc[i], 5); + + for (subframe = 0; subframe < 4; subframe++) { + const AMRNBSubframe *amr_subframe = &p->frame.subframe[subframe]; + + decode_pitch_vector(p, amr_subframe, subframe); + + decode_fixed_sparse(&fixed_sparse, amr_subframe->pulses, + p->cur_frame_mode, subframe); + + // The fixed gain (section 6.1.3) depends on the fixed vector + // (section 6.1.2), but the fixed vector calculation uses + // pitch sharpening based on the on the pitch gain (section 6.1.3). + // So the correct order is: pitch gain, pitch sharpening, fixed gain. + decode_gains(p, amr_subframe, p->cur_frame_mode, subframe, + &fixed_gain_factor); + + pitch_sharpening(p, subframe, p->cur_frame_mode, &fixed_sparse); + + ff_set_fixed_vector(p->fixed_vector, &fixed_sparse, 1.0, + AMR_SUBFRAME_SIZE); + + p->fixed_gain[4] = + ff_amr_set_fixed_gain(fixed_gain_factor, + ff_dot_productf(p->fixed_vector, p->fixed_vector, + AMR_SUBFRAME_SIZE)/AMR_SUBFRAME_SIZE, + p->prediction_error, + energy_mean[p->cur_frame_mode], energy_pred_fac); + + // The excitation feedback is calculated without any processing such + // as fixed gain smoothing. This isn't mentioned in the specification. + for (i = 0; i < AMR_SUBFRAME_SIZE; i++) + p->excitation[i] *= p->pitch_gain[4]; + ff_set_fixed_vector(p->excitation, &fixed_sparse, p->fixed_gain[4], + AMR_SUBFRAME_SIZE); + + // In the ref decoder, excitation is stored with no fractional bits. + // This step prevents buzz in silent periods. The ref encoder can + // emit long sequences with pitch factor greater than one. This + // creates unwanted feedback if the excitation vector is nonzero. + // (e.g. test sequence T19_795.COD in 3GPP TS 26.074) + for (i = 0; i < AMR_SUBFRAME_SIZE; i++) + p->excitation[i] = truncf(p->excitation[i]); + + // Smooth fixed gain. + // The specification is ambiguous, but in the reference source, the + // smoothed value is NOT fed back into later fixed gain smoothing. + synth_fixed_gain = fixed_gain_smooth(p, p->lsf_q[subframe], + p->lsf_avg, p->cur_frame_mode); + + synth_fixed_vector = anti_sparseness(p, &fixed_sparse, p->fixed_vector, + synth_fixed_gain, spare_vector); + + if (synthesis(p, p->lpc[subframe], synth_fixed_gain, + synth_fixed_vector, &p->samples_in[LP_FILTER_ORDER], 0)) + // overflow detected -> rerun synthesis scaling pitch vector down + // by a factor of 4, skipping pitch vector contribution emphasis + // and adaptive gain control + synthesis(p, p->lpc[subframe], synth_fixed_gain, + synth_fixed_vector, &p->samples_in[LP_FILTER_ORDER], 1); + + postfilter(p, p->lpc[subframe], buf_out + subframe * AMR_SUBFRAME_SIZE); + + // update buffers and history + ff_clear_fixed_vector(p->fixed_vector, &fixed_sparse, AMR_SUBFRAME_SIZE); + update_state(p); + } + + ff_acelp_apply_order_2_transfer_function(buf_out, buf_out, highpass_zeros, + highpass_poles, + highpass_gain * AMR_SAMPLE_SCALE, + p->high_pass_mem, AMR_BLOCK_SIZE); + + /* Update averaged lsf vector (used for fixed gain smoothing). + * + * Note that lsf_avg should not incorporate the current frame's LSFs + * for fixed_gain_smooth. + * The specification has an incorrect formula: the reference decoder uses + * qbar(n-1) rather than qbar(n) in section 6.1(4) equation 71. */ + ff_weighted_vector_sumf(p->lsf_avg, p->lsf_avg, p->lsf_q[3], + 0.84, 0.16, LP_FILTER_ORDER); + + /* report how many samples we got */ + *data_size = AMR_BLOCK_SIZE * sizeof(float); + + /* return the amount of bytes consumed if everything was OK */ + return frame_sizes_nb[p->cur_frame_mode] + 1; // +7 for rounding and +8 for TOC +} + + +AVCodec ff_amrnb_decoder = { + .name = "amrnb", + .type = AVMEDIA_TYPE_AUDIO, + .id = CODEC_ID_AMR_NB, + .priv_data_size = sizeof(AMRContext), + .init = amrnb_decode_init, + .decode = amrnb_decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("Adaptive Multi-Rate NarrowBand"), + .sample_fmts = (enum AVSampleFormat[]){AV_SAMPLE_FMT_FLT,AV_SAMPLE_FMT_NONE}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amrwbdata.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amrwbdata.h new file mode 100644 index 00000000..36553d5a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amrwbdata.h @@ -0,0 +1,1890 @@ +/* + * AMR wideband data and definitions + * Copyright (c) 2010 Marcelo Galvao Povoa + * + * 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 + * AMR wideband data and definitions + */ + +#ifndef AVCODEC_AMRWBDATA_H +#define AVCODEC_AMRWBDATA_H + +#include +#include + +#define LP_ORDER 16 ///< linear predictive coding filter order +#define LP_ORDER_16k 20 ///< lpc filter order at 16kHz +#define HB_FIR_SIZE 30 ///< amount of past data needed by HB filters +#define UPS_FIR_SIZE 12 ///< upsampling filter size +#define UPS_MEM_SIZE (2 * UPS_FIR_SIZE) + +#define MIN_ISF_SPACING (128.0 / 32768.0) ///< minimum isf gap +#define PRED_FACTOR (1.0 / 3.0) +#define MIN_ENERGY -14.0 ///< initial innnovation energy (dB) +#define ENERGY_MEAN 30.0 ///< mean innovation energy (dB) in all modes +#define PREEMPH_FAC 0.68 ///< factor used to de-emphasize synthesis + +#define AMRWB_SFR_SIZE 64 ///< samples per subframe at 12.8 kHz +#define AMRWB_SFR_SIZE_16k 80 ///< samples per subframe at 16 kHz +#define AMRWB_P_DELAY_MAX 231 ///< maximum pitch delay value +#define AMRWB_P_DELAY_MIN 34 + +/* Relative mode ordering is sensitive */ +enum Mode { + MODE_6k60 = 0, ///< 6.60 kbit/s + MODE_8k85, ///< 8.85 kbit/s + MODE_12k65, ///< 12.65 kbit/s + MODE_14k25, ///< 14.25 kbit/s + MODE_15k85, ///< 15.85 kbit/s + MODE_18k25, ///< 18.25 kbit/s + MODE_19k85, ///< 19.85 kbit/s + MODE_23k05, ///< 23.05 kbit/s + MODE_23k85, ///< 23.85 kbit/s + MODE_SID, ///< comfort noise frame + /* 10-13: Future use */ + SP_LOST = 14, ///< speech lost + NO_DATA ///< no transmission +}; + +/* All decoded parameters in these structs must be 2 bytes long + * because of the direct indexing at the frame parsing */ +typedef struct { + uint16_t adap; ///< adaptive codebook index + uint16_t ltp; ///< ltp-filtering flag + uint16_t vq_gain; ///< VQ adaptive and innovative gains + uint16_t hb_gain; ///< high-band energy index (mode 23k85 only) + uint16_t pul_ih[4]; ///< MSBs part of codebook index (high modes only) + uint16_t pul_il[4]; ///< LSBs part of codebook index +} AMRWBSubFrame; + +typedef struct { + uint16_t vad; ///< voice activity detection flag + uint16_t isp_id[7]; ///< index of ISP subvectors + AMRWBSubFrame subframe[4]; ///< data for subframes +} AMRWBFrame; + +/** The index of a frame parameter */ +#define AMR_BIT(field) (offsetof(AMRWBFrame, field) >> 1) +/** The index of a subframe-specific parameter */ +#define AMR_OF(frame_num, variable) AMR_BIT(subframe[frame_num].variable) + +//As defined in 3GPP TS 26.201 V9.0.0 +//Tables for bit parsing in Core Frame speech frames +//The reordered bits are in order of decreasing importance and +//may be contiguously separated in Class A, B and C bits. + +// Each field in AMRWBFrame is stored as: +// * one byte for the number of bits in the field +// * one byte for the field index +// * then, one byte for each bit of the field (from most-significant to least) +// of the position of that bit in the AMR frame. +static const uint16_t order_MODE_6k60[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 24, 33, 39, 12, 6, 5, 4, 13, + 8, AMR_BIT(isp_id[1]), 65, 79, 64, 78, 51, 61, 71, 70, + 7, AMR_BIT(isp_id[2]), 52, 55, 44, 54, 53, 43, 42, + 7, AMR_BIT(isp_id[3]), 60, 59, 58, 57, 56, 75, 74, + 6, AMR_BIT(isp_id[4]), 73, 72, 86, 87, 85, 84, + 8, AMR_OF(0, adap), 11, 10, 9, 8, 28, 27, 49, 69, + 6, AMR_OF(0, pul_il[0]), 83, 91, 99, 107, 115, 123, + 6, AMR_OF(0, pul_il[1]), 82, 103, 111, 119, 127, 135, + 6, AMR_OF(0, vq_gain), 38, 23, 34, 19, 3, 15, + 5, AMR_OF(1, adap), 32, 41, 63, 67, 77, + 6, AMR_OF(1, pul_il[0]), 81, 90, 98, 106, 114, 122, + 6, AMR_OF(1, pul_il[1]), 80, 102, 110, 118, 126, 134, + 6, AMR_OF(1, vq_gain), 26, 22, 36, 18, 2, 14, + 5, AMR_OF(2, adap), 45, 40, 50, 48, 68, + 6, AMR_OF(2, pul_il[0]), 95, 89, 97, 105, 113, 121, + 6, AMR_OF(2, pul_il[1]), 94, 101, 109, 117, 125, 133, + 6, AMR_OF(2, vq_gain), 37, 21, 35, 17, 1, 31, + 5, AMR_OF(3, adap), 47, 46, 62, 66, 76, + 6, AMR_OF(3, pul_il[0]), 93, 88, 96, 104, 112, 120, + 6, AMR_OF(3, pul_il[1]), 92, 100, 108, 116, 124, 132, + 6, AMR_OF(3, vq_gain), 25, 20, 29, 16, 0, 30, + 0 +}; + +static const uint16_t order_MODE_8k85[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 47, 32, 2, 6, 3, 5, 4, 60, + 8, AMR_BIT(isp_id[1]), 69, 50, 67, 41, 51, 49, 59, 53, + 6, AMR_BIT(isp_id[2]), 40, 55, 43, 54, 42, 62, + 7, AMR_BIT(isp_id[3]), 63, 48, 52, 61, 77, 78, 72, + 7, AMR_BIT(isp_id[4]), 85, 56, 86, 68, 74, 73, 81, + 5, AMR_BIT(isp_id[5]), 82, 95, 80, 94, 91, + 5, AMR_BIT(isp_id[6]), 90, 89, 88, 103, 87, + 8, AMR_OF(0, adap), 1, 0, 15, 35, 33, 58, 64, 84, + 5, AMR_OF(0, pul_il[0]), 102, 118, 134, 150, 166, + 5, AMR_OF(0, pul_il[1]), 101, 114, 130, 146, 162, + 5, AMR_OF(0, pul_il[2]), 100, 126, 142, 158, 174, + 5, AMR_OF(0, pul_il[3]), 99, 122, 138, 154, 170, + 6, AMR_OF(0, vq_gain), 11, 39, 19, 31, 27, 23, + 5, AMR_OF(1, adap), 46, 71, 66, 76, 93, + 5, AMR_OF(1, pul_il[0]), 98, 117, 133, 149, 165, + 5, AMR_OF(1, pul_il[1]), 97, 113, 129, 145, 161, + 5, AMR_OF(1, pul_il[2]), 96, 125, 141, 157, 173, + 5, AMR_OF(1, pul_il[3]), 111, 121, 137, 153, 169, + 6, AMR_OF(1, vq_gain), 10, 38, 18, 30, 26, 22, + 8, AMR_OF(2, adap), 14, 13, 12, 34, 45, 57, 79, 83, + 5, AMR_OF(2, pul_il[0]), 110, 116, 132, 148, 164, + 5, AMR_OF(2, pul_il[1]), 109, 112, 128, 144, 160, + 5, AMR_OF(2, pul_il[2]), 108, 124, 140, 156, 172, + 5, AMR_OF(2, pul_il[3]), 107, 120, 136, 152, 168, + 6, AMR_OF(2, vq_gain), 9, 37, 17, 29, 25, 21, + 5, AMR_OF(3, adap), 44, 70, 65, 75, 92, + 5, AMR_OF(3, pul_il[0]), 106, 115, 131, 147, 163, + 5, AMR_OF(3, pul_il[1]), 105, 127, 143, 159, 175, + 5, AMR_OF(3, pul_il[2]), 104, 123, 139, 155, 171, + 5, AMR_OF(3, pul_il[3]), 119, 135, 151, 167, 183, + 6, AMR_OF(3, vq_gain), 8, 36, 16, 28, 24, 20, + 0 +}; + +static const uint16_t order_MODE_12k65[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 77, 58, 75, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 85, 86, 80, + 7, AMR_BIT(isp_id[4]), 93, 64, 94, 76, 82, 81, 89, + 5, AMR_BIT(isp_id[5]), 90, 103, 88, 102, 99, + 5, AMR_BIT(isp_id[6]), 98, 97, 96, 111, 95, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 72, + 92, + 1, AMR_OF(0, ltp), 110, + 9, AMR_OF(0, pul_il[0]), 106, 122, 154, 186, 218, 134, 166, 198, + 230, + 9, AMR_OF(0, pul_il[1]), 105, 130, 162, 194, 226, 142, 174, 206, + 238, + 9, AMR_OF(0, pul_il[2]), 104, 138, 170, 202, 234, 150, 182, 214, + 246, + 9, AMR_OF(0, pul_il[3]), 119, 146, 178, 210, 242, 158, 190, 222, + 254, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 6, AMR_OF(1, adap), 35, 54, 79, 74, 84, 101, + 1, AMR_OF(1, ltp), 109, + 9, AMR_OF(1, pul_il[0]), 118, 121, 153, 185, 217, 133, 165, 197, + 229, + 9, AMR_OF(1, pul_il[1]), 117, 129, 161, 193, 225, 141, 173, 205, + 237, + 9, AMR_OF(1, pul_il[2]), 116, 137, 169, 201, 233, 149, 181, 213, + 245, + 9, AMR_OF(1, pul_il[3]), 115, 145, 177, 209, 241, 157, 189, 221, + 253, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 87, + 91, + 1, AMR_OF(2, ltp), 108, + 9, AMR_OF(2, pul_il[0]), 114, 120, 152, 184, 216, 132, 164, 196, + 228, + 9, AMR_OF(2, pul_il[1]), 113, 128, 160, 192, 224, 140, 172, 204, + 236, + 9, AMR_OF(2, pul_il[2]), 112, 136, 168, 200, 232, 148, 180, 212, + 244, + 9, AMR_OF(2, pul_il[3]), 127, 144, 176, 208, 240, 156, 188, 220, + 252, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 6, AMR_OF(3, adap), 34, 53, 78, 73, 83, 100, + 1, AMR_OF(3, ltp), 107, + 9, AMR_OF(3, pul_il[0]), 126, 135, 167, 199, 231, 131, 163, 195, + 227, + 9, AMR_OF(3, pul_il[1]), 125, 143, 175, 207, 239, 139, 171, 203, + 235, + 9, AMR_OF(3, pul_il[2]), 124, 151, 183, 215, 247, 147, 179, 211, + 243, + 9, AMR_OF(3, pul_il[3]), 123, 159, 191, 223, 255, 155, 187, 219, + 251, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 0 +}; + +static const uint16_t order_MODE_14k25[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 77, 58, 75, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 85, 86, 80, + 7, AMR_BIT(isp_id[4]), 93, 64, 94, 76, 82, 81, 89, + 5, AMR_BIT(isp_id[5]), 90, 103, 88, 102, 99, + 5, AMR_BIT(isp_id[6]), 98, 97, 96, 111, 95, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 72, + 92, + 1, AMR_OF(0, ltp), 110, + 13, AMR_OF(0, pul_il[0]), 114, 186, 210, 234, 258, 106, 126, 162, + 170, 198, 222, 246, 270, + 13, AMR_OF(0, pul_il[1]), 122, 194, 218, 242, 266, 118, 134, 174, + 182, 206, 230, 254, 278, + 9, AMR_OF(0, pul_il[2]), 130, 138, 146, 154, 178, 202, 226, 250, + 274, + 9, AMR_OF(0, pul_il[3]), 142, 150, 158, 166, 190, 214, 238, 262, + 286, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 6, AMR_OF(1, adap), 35, 54, 79, 74, 84, 101, + 1, AMR_OF(1, ltp), 109, + 13, AMR_OF(1, pul_il[0]), 113, 185, 209, 233, 257, 105, 125, 161, + 169, 197, 221, 245, 269, + 13, AMR_OF(1, pul_il[1]), 121, 193, 217, 241, 265, 117, 133, 173, + 181, 205, 229, 253, 277, + 9, AMR_OF(1, pul_il[2]), 129, 137, 145, 153, 177, 201, 225, 249, + 273, + 9, AMR_OF(1, pul_il[3]), 141, 149, 157, 165, 189, 213, 237, 261, + 285, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 87, + 91, + 1, AMR_OF(2, ltp), 108, + 13, AMR_OF(2, pul_il[0]), 112, 184, 208, 232, 256, 104, 124, 160, + 168, 196, 220, 244, 268, + 13, AMR_OF(2, pul_il[1]), 120, 192, 216, 240, 264, 116, 132, 172, + 180, 204, 228, 252, 276, + 9, AMR_OF(2, pul_il[2]), 128, 136, 144, 152, 176, 200, 224, 248, + 272, + 9, AMR_OF(2, pul_il[3]), 140, 148, 156, 164, 188, 212, 236, 260, + 284, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 6, AMR_OF(3, adap), 34, 53, 78, 73, 83, 100, + 1, AMR_OF(3, ltp), 107, + 13, AMR_OF(3, pul_il[0]), 127, 199, 223, 247, 271, 119, 123, 175, + 183, 195, 219, 243, 267, + 13, AMR_OF(3, pul_il[1]), 135, 207, 231, 255, 279, 115, 131, 171, + 179, 203, 227, 251, 275, + 9, AMR_OF(3, pul_il[2]), 143, 151, 159, 167, 191, 215, 239, 263, + 287, + 9, AMR_OF(3, pul_il[3]), 139, 147, 155, 163, 187, 211, 235, 259, + 283, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 0 +}; + +static const uint16_t order_MODE_15k85[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 77, 58, 75, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 85, 86, 80, + 7, AMR_BIT(isp_id[4]), 93, 64, 94, 76, 82, 81, 89, + 5, AMR_BIT(isp_id[5]), 90, 103, 88, 102, 99, + 5, AMR_BIT(isp_id[6]), 98, 97, 96, 111, 95, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 72, + 92, + 1, AMR_OF(0, ltp), 110, + 13, AMR_OF(0, pul_il[0]), 122, 154, 170, 218, 266, 138, 106, 182, + 230, 278, 178, 226, 274, + 13, AMR_OF(0, pul_il[1]), 134, 166, 190, 238, 286, 150, 118, 186, + 234, 282, 198, 246, 294, + 13, AMR_OF(0, pul_il[2]), 130, 162, 194, 242, 290, 146, 114, 206, + 254, 302, 202, 250, 298, + 13, AMR_OF(0, pul_il[3]), 142, 174, 214, 262, 310, 158, 126, 210, + 258, 306, 222, 270, 318, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 6, AMR_OF(1, adap), 35, 54, 79, 74, 84, 101, + 1, AMR_OF(1, ltp), 109, + 13, AMR_OF(1, pul_il[0]), 121, 153, 169, 217, 265, 137, 105, 181, + 229, 277, 177, 225, 273, + 13, AMR_OF(1, pul_il[1]), 133, 165, 189, 237, 285, 149, 117, 185, + 233, 281, 197, 245, 293, + 13, AMR_OF(1, pul_il[2]), 129, 161, 193, 241, 289, 145, 113, 205, + 253, 301, 201, 249, 297, + 13, AMR_OF(1, pul_il[3]), 141, 173, 213, 261, 309, 157, 125, 209, + 257, 305, 221, 269, 317, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 87, + 91, + 1, AMR_OF(2, ltp), 108, + 13, AMR_OF(2, pul_il[0]), 120, 152, 168, 216, 264, 136, 104, 180, + 228, 276, 176, 224, 272, + 13, AMR_OF(2, pul_il[1]), 132, 164, 188, 236, 284, 148, 116, 184, + 232, 280, 196, 244, 292, + 13, AMR_OF(2, pul_il[2]), 128, 160, 192, 240, 288, 144, 112, 204, + 252, 300, 200, 248, 296, + 13, AMR_OF(2, pul_il[3]), 140, 172, 212, 260, 308, 156, 124, 208, + 256, 304, 220, 268, 316, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 6, AMR_OF(3, adap), 34, 53, 78, 73, 83, 100, + 1, AMR_OF(3, ltp), 107, + 13, AMR_OF(3, pul_il[0]), 135, 167, 183, 231, 279, 151, 119, 179, + 227, 275, 191, 239, 287, + 13, AMR_OF(3, pul_il[1]), 131, 163, 187, 235, 283, 147, 115, 199, + 247, 295, 195, 243, 291, + 13, AMR_OF(3, pul_il[2]), 143, 175, 207, 255, 303, 159, 127, 203, + 251, 299, 215, 263, 311, + 13, AMR_OF(3, pul_il[3]), 139, 171, 211, 259, 307, 155, 123, 223, + 271, 319, 219, 267, 315, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 0 +}; + +static const uint16_t order_MODE_18k25[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 77, 58, 75, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 85, 86, 80, + 7, AMR_BIT(isp_id[4]), 93, 64, 94, 76, 82, 81, 89, + 5, AMR_BIT(isp_id[5]), 90, 103, 88, 102, 99, + 5, AMR_BIT(isp_id[6]), 98, 97, 96, 111, 95, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 72, + 92, + 1, AMR_OF(0, ltp), 110, + 2, AMR_OF(0, pul_ih[0]), 124, 115, + 2, AMR_OF(0, pul_ih[1]), 150, 117, + 2, AMR_OF(0, pul_ih[2]), 129, 114, + 2, AMR_OF(0, pul_ih[3]), 121, 131, + 14, AMR_OF(0, pul_il[0]), 161, 257, 343, 199, 177, 303, 204, 173, + 168, 260, 277, 307, 338, 128, + 14, AMR_OF(0, pul_il[1]), 194, 286, 347, 222, 214, 316, 236, 152, + 166, 242, 284, 308, 344, 142, + 14, AMR_OF(0, pul_il[2]), 169, 273, 353, 202, 189, 311, 240, 200, + 171, 261, 309, 296, 345, 130, + 14, AMR_OF(0, pul_il[3]), 198, 275, 349, 187, 163, 282, 193, 195, + 175, 234, 265, 289, 328, 119, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 6, AMR_OF(1, adap), 35, 54, 79, 74, 84, 101, + 1, AMR_OF(1, ltp), 109, + 2, AMR_OF(1, pul_ih[0]), 139, 104, + 2, AMR_OF(1, pul_ih[1]), 135, 118, + 2, AMR_OF(1, pul_ih[2]), 112, 127, + 2, AMR_OF(1, pul_ih[3]), 140, 141, + 14, AMR_OF(1, pul_il[0]), 179, 276, 340, 225, 223, 321, 235, 190, + 182, 271, 310, 315, 352, 125, + 14, AMR_OF(1, pul_il[1]), 153, 264, 329, 232, 209, 323, 231, 165, + 191, 279, 290, 312, 367, 134, + 14, AMR_OF(1, pul_il[2]), 167, 269, 341, 205, 197, 298, 224, 160, + 170, 259, 280, 317, 357, 148, + 14, AMR_OF(1, pul_il[3]), 203, 272, 342, 227, 192, 299, 233, 172, + 183, 256, 283, 326, 355, 106, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 87, + 91, + 1, AMR_OF(2, ltp), 108, + 2, AMR_OF(2, pul_ih[0]), 144, 120, + 2, AMR_OF(2, pul_ih[1]), 157, 123, + 2, AMR_OF(2, pul_ih[2]), 145, 138, + 2, AMR_OF(2, pul_ih[3]), 132, 154, + 14, AMR_OF(2, pul_il[0]), 241, 319, 365, 252, 253, 331, 254, 230, + 220, 263, 285, 314, 364, 156, + 14, AMR_OF(2, pul_il[1]), 247, 291, 339, 249, 250, 332, 267, 196, + 207, 268, 304, 324, 356, 158, + 14, AMR_OF(2, pul_il[2]), 210, 300, 348, 243, 237, 333, 246, 206, + 219, 266, 318, 335, 363, 159, + 14, AMR_OF(2, pul_il[3]), 239, 306, 366, 221, 226, 297, 251, 184, + 178, 258, 292, 305, 346, 116, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 6, AMR_OF(3, adap), 34, 53, 78, 73, 83, 100, + 1, AMR_OF(3, ltp), 107, + 2, AMR_OF(3, pul_ih[0]), 143, 126, + 2, AMR_OF(3, pul_ih[1]), 137, 122, + 2, AMR_OF(3, pul_ih[2]), 149, 105, + 2, AMR_OF(3, pul_ih[3]), 133, 136, + 14, AMR_OF(3, pul_il[0]), 162, 287, 337, 244, 229, 322, 218, 180, + 186, 262, 274, 288, 351, 146, + 14, AMR_OF(3, pul_il[1]), 212, 294, 358, 248, 228, 334, 215, 174, + 176, 270, 293, 301, 354, 147, + 14, AMR_OF(3, pul_il[2]), 185, 327, 336, 211, 213, 313, 245, 181, + 188, 255, 281, 325, 350, 151, + 14, AMR_OF(3, pul_il[3]), 201, 295, 359, 216, 208, 320, 238, 164, + 155, 217, 278, 302, 330, 113, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 0 +}; + +static const uint16_t order_MODE_19k85[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 77, 58, 75, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 85, 86, 80, + 7, AMR_BIT(isp_id[4]), 93, 64, 94, 76, 82, 81, 89, + 5, AMR_BIT(isp_id[5]), 90, 103, 88, 102, 99, + 5, AMR_BIT(isp_id[6]), 98, 97, 96, 111, 95, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 72, + 92, + 1, AMR_OF(0, ltp), 110, + 10, AMR_OF(0, pul_ih[0]), 134, 153, 263, 342, 399, 154, 106, 177, + 317, 265, + 10, AMR_OF(0, pul_ih[1]), 128, 167, 270, 351, 385, 160, 105, 213, + 329, 259, + 2, AMR_OF(0, pul_ih[2]), 123, 147, + 2, AMR_OF(0, pul_ih[3]), 131, 143, + 10, AMR_OF(0, pul_il[0]), 346, 118, 170, 201, 296, 368, 250, 284, + 341, 391, + 10, AMR_OF(0, pul_il[1]), 345, 104, 166, 196, 281, 374, 242, 269, + 327, 390, + 14, AMR_OF(0, pul_il[2]), 141, 171, 291, 364, 229, 210, 308, 228, + 206, 200, 258, 295, 313, 361, + 14, AMR_OF(0, pul_il[3]), 144, 188, 282, 366, 217, 216, 309, 218, + 193, 182, 245, 287, 300, 367, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 6, AMR_OF(1, adap), 35, 54, 79, 74, 84, 101, + 1, AMR_OF(1, ltp), 109, + 10, AMR_OF(1, pul_ih[0]), 139, 169, 267, 348, 389, 163, 116, 189, + 343, 268, + 10, AMR_OF(1, pul_ih[1]), 120, 161, 249, 339, 397, 152, 114, 230, + 334, 303, + 2, AMR_OF(1, pul_ih[2]), 125, 138, + 2, AMR_OF(1, pul_ih[3]), 112, 129, + 10, AMR_OF(1, pul_il[0]), 349, 122, 162, 203, 288, 372, 278, 274, + 312, 377, + 10, AMR_OF(1, pul_il[1]), 357, 126, 165, 214, 298, 362, 252, 260, + 321, 378, + 14, AMR_OF(1, pul_il[2]), 150, 199, 266, 355, 211, 180, 285, 241, + 195, 198, 243, 275, 323, 375, + 14, AMR_OF(1, pul_il[3]), 142, 191, 256, 353, 208, 220, 314, 237, + 190, 212, 255, 304, 318, 371, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 87, + 91, + 1, AMR_OF(2, ltp), 108, + 10, AMR_OF(2, pul_ih[0]), 159, 168, 302, 356, 395, 178, 132, 185, + 330, 286, + 10, AMR_OF(2, pul_ih[1]), 158, 181, 292, 358, 396, 176, 133, 235, + 331, 276, + 2, AMR_OF(2, pul_ih[2]), 130, 157, + 2, AMR_OF(2, pul_ih[3]), 124, 136, + 10, AMR_OF(2, pul_il[0]), 354, 121, 194, 246, 322, 379, 272, 273, + 332, 398, + 10, AMR_OF(2, pul_il[1]), 359, 140, 186, 236, 333, 376, 290, 301, + 338, 387, + 14, AMR_OF(2, pul_il[2]), 155, 227, 319, 369, 253, 254, 350, 248, + 224, 239, 240, 293, 315, 383, + 14, AMR_OF(2, pul_il[3]), 156, 209, 297, 373, 225, 215, 326, 247, + 197, 184, 232, 289, 310, 365, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 6, AMR_OF(3, adap), 34, 53, 78, 73, 83, 100, + 1, AMR_OF(3, ltp), 107, + 10, AMR_OF(3, pul_ih[0]), 148, 164, 264, 340, 388, 183, 117, 205, + 336, 261, + 10, AMR_OF(3, pul_ih[1]), 146, 174, 257, 335, 384, 173, 113, 187, + 320, 279, + 2, AMR_OF(3, pul_ih[2]), 127, 151, + 2, AMR_OF(3, pul_ih[3]), 119, 137, + 10, AMR_OF(3, pul_il[0]), 352, 135, 172, 238, 306, 381, 262, 271, + 328, 382, + 10, AMR_OF(3, pul_il[1]), 347, 115, 179, 219, 305, 380, 277, 294, + 337, 386, + 14, AMR_OF(3, pul_il[2]), 145, 192, 307, 370, 234, 223, 324, 244, + 202, 204, 251, 299, 325, 360, + 14, AMR_OF(3, pul_il[3]), 149, 221, 311, 363, 226, 222, 316, 231, + 207, 175, 233, 280, 283, 344, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 0 +}; + +static const uint16_t order_MODE_23k05[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 77, 58, 75, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 85, 86, 80, + 7, AMR_BIT(isp_id[4]), 93, 64, 94, 76, 82, 81, 89, + 5, AMR_BIT(isp_id[5]), 90, 103, 88, 102, 99, + 5, AMR_BIT(isp_id[6]), 98, 97, 96, 111, 95, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 72, + 92, + 1, AMR_OF(0, ltp), 110, + 11, AMR_OF(0, pul_ih[0]), 118, 129, 131, 153, 170, 282, 298, 210, + 191, 357, 317, + 11, AMR_OF(0, pul_ih[1]), 126, 146, 135, 165, 187, 273, 345, 295, + 172, 338, 340, + 11, AMR_OF(0, pul_ih[2]), 119, 137, 141, 167, 208, 304, 366, 256, + 177, 339, 328, + 11, AMR_OF(0, pul_ih[3]), 116, 130, 120, 166, 190, 252, 311, 239, + 173, 343, 318, + 11, AMR_OF(0, pul_il[0]), 245, 180, 342, 424, 259, 277, 266, 380, + 398, 423, 440, + 11, AMR_OF(0, pul_il[1]), 218, 207, 367, 434, 201, 240, 275, 363, + 399, 419, 452, + 11, AMR_OF(0, pul_il[2]), 274, 188, 348, 425, 242, 204, 262, 365, + 402, 431, 463, + 11, AMR_OF(0, pul_il[3]), 221, 183, 337, 439, 243, 216, 251, 354, + 390, 411, 462, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 6, AMR_OF(1, adap), 35, 54, 79, 74, 84, 101, + 1, AMR_OF(1, ltp), 109, + 11, AMR_OF(1, pul_ih[0]), 115, 140, 142, 161, 230, 291, 351, 235, + 181, 293, 310, + 11, AMR_OF(1, pul_ih[1]), 104, 138, 132, 162, 211, 315, 347, 233, + 176, 320, 329, + 11, AMR_OF(1, pul_ih[2]), 106, 134, 125, 154, 205, 267, 306, 220, + 185, 330, 297, + 11, AMR_OF(1, pul_ih[3]), 105, 148, 122, 152, 215, 302, 350, 254, + 178, 319, 313, + 11, AMR_OF(1, pul_il[0]), 269, 189, 382, 432, 272, 228, 263, 383, + 406, 422, 453, + 11, AMR_OF(1, pul_il[1]), 286, 206, 377, 446, 226, 222, 265, 368, + 404, 416, 454, + 11, AMR_OF(1, pul_il[2]), 247, 195, 358, 445, 224, 236, 309, 341, + 375, 408, 449, + 11, AMR_OF(1, pul_il[3]), 225, 192, 359, 436, 250, 258, 290, 389, + 400, 420, 448, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 87, + 91, + 1, AMR_OF(2, ltp), 108, + 11, AMR_OF(2, pul_ih[0]), 139, 144, 145, 169, 234, 327, 395, 299, + 244, 356, 379, + 11, AMR_OF(2, pul_ih[1]), 127, 156, 158, 171, 231, 308, 397, 355, + 261, 371, 335, + 11, AMR_OF(2, pul_ih[2]), 123, 155, 157, 193, 241, 362, 384, 323, + 238, 392, 361, + 11, AMR_OF(2, pul_ih[3]), 114, 147, 121, 175, 196, 333, 373, 303, + 184, 353, 322, + 11, AMR_OF(2, pul_il[0]), 271, 203, 385, 442, 307, 276, 334, 405, + 412, 427, 459, + 11, AMR_OF(2, pul_il[1]), 278, 200, 388, 447, 292, 288, 296, 403, + 415, 429, 460, + 11, AMR_OF(2, pul_il[2]), 312, 214, 393, 433, 279, 301, 314, 391, + 410, 426, 450, + 11, AMR_OF(2, pul_il[3]), 280, 186, 376, 437, 268, 260, 255, 364, + 414, 417, 441, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 6, AMR_OF(3, adap), 34, 53, 78, 73, 83, 100, + 1, AMR_OF(3, ltp), 107, + 11, AMR_OF(3, pul_ih[0]), 112, 159, 143, 164, 213, 281, 332, 284, + 168, 344, 325, + 11, AMR_OF(3, pul_ih[1]), 113, 150, 149, 179, 199, 316, 324, 285, + 237, 360, 336, + 11, AMR_OF(3, pul_ih[2]), 124, 136, 151, 174, 209, 326, 349, 248, + 198, 374, 331, + 11, AMR_OF(3, pul_ih[3]), 117, 128, 133, 163, 202, 300, 372, 305, + 194, 387, 321, + 11, AMR_OF(3, pul_il[0]), 249, 182, 352, 428, 253, 264, 289, 413, + 407, 418, 461, + 11, AMR_OF(3, pul_il[1]), 287, 212, 369, 444, 223, 246, 217, 346, + 394, 401, 451, + 11, AMR_OF(3, pul_il[2]), 219, 197, 378, 435, 229, 257, 283, 396, + 409, 430, 455, + 11, AMR_OF(3, pul_il[3]), 232, 160, 370, 438, 227, 270, 294, 381, + 386, 421, 443, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 0 +}; + +static const uint16_t order_MODE_23k85[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 93, 58, 91, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 101, 102, 96, + 7, AMR_BIT(isp_id[4]), 109, 64, 110, 92, 98, 97, 105, + 5, AMR_BIT(isp_id[5]), 106, 119, 104, 118, 115, + 5, AMR_BIT(isp_id[6]), 114, 113, 112, 127, 111, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 88, + 108, + 1, AMR_OF(0, ltp), 126, + 11, AMR_OF(0, pul_ih[0]), 134, 145, 147, 169, 186, 298, 314, 226, + 207, 373, 333, + 11, AMR_OF(0, pul_ih[1]), 142, 162, 151, 181, 203, 289, 361, 311, + 188, 354, 356, + 11, AMR_OF(0, pul_ih[2]), 135, 153, 157, 183, 224, 320, 382, 272, + 193, 355, 344, + 11, AMR_OF(0, pul_ih[3]), 132, 146, 136, 182, 206, 268, 327, 255, + 189, 359, 334, + 11, AMR_OF(0, pul_il[0]), 261, 196, 358, 440, 275, 293, 282, 396, + 414, 439, 456, + 11, AMR_OF(0, pul_il[1]), 234, 223, 383, 450, 217, 256, 291, 379, + 415, 435, 468, + 11, AMR_OF(0, pul_il[2]), 290, 204, 364, 441, 258, 220, 278, 381, + 418, 447, 479, + 11, AMR_OF(0, pul_il[3]), 237, 199, 353, 455, 259, 232, 267, 370, + 406, 427, 478, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 4, AMR_OF(0, hb_gain), 79, 78, 77, 76, + 6, AMR_OF(1, adap), 35, 54, 95, 90, 100, 117, + 1, AMR_OF(1, ltp), 125, + 11, AMR_OF(1, pul_ih[0]), 131, 156, 158, 177, 246, 307, 367, 251, + 197, 309, 326, + 11, AMR_OF(1, pul_ih[1]), 120, 154, 148, 178, 227, 331, 363, 249, + 192, 336, 345, + 11, AMR_OF(1, pul_ih[2]), 122, 150, 141, 170, 221, 283, 322, 236, + 201, 346, 313, + 11, AMR_OF(1, pul_ih[3]), 121, 164, 138, 168, 231, 318, 366, 270, + 194, 335, 329, + 11, AMR_OF(1, pul_il[0]), 285, 205, 398, 448, 288, 244, 279, 399, + 422, 438, 469, + 11, AMR_OF(1, pul_il[1]), 302, 222, 393, 462, 242, 238, 281, 384, + 420, 432, 470, + 11, AMR_OF(1, pul_il[2]), 263, 211, 374, 461, 240, 252, 325, 357, + 391, 424, 465, + 11, AMR_OF(1, pul_il[3]), 241, 208, 375, 452, 266, 274, 306, 405, + 416, 436, 464, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 4, AMR_OF(1, hb_gain), 75, 74, 73, 72, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 103, + 107, + 1, AMR_OF(2, ltp), 124, + 11, AMR_OF(2, pul_ih[0]), 155, 160, 161, 185, 250, 343, 411, 315, + 260, 372, 395, + 11, AMR_OF(2, pul_ih[1]), 143, 172, 174, 187, 247, 324, 413, 371, + 277, 387, 351, + 11, AMR_OF(2, pul_ih[2]), 139, 171, 173, 209, 257, 378, 400, 339, + 254, 408, 377, + 11, AMR_OF(2, pul_ih[3]), 130, 163, 137, 191, 212, 349, 389, 319, + 200, 369, 338, + 11, AMR_OF(2, pul_il[0]), 287, 219, 401, 458, 323, 292, 350, 421, + 428, 443, 475, + 11, AMR_OF(2, pul_il[1]), 294, 216, 404, 463, 308, 304, 312, 419, + 431, 445, 476, + 11, AMR_OF(2, pul_il[2]), 328, 230, 409, 449, 295, 317, 330, 407, + 426, 442, 466, + 11, AMR_OF(2, pul_il[3]), 296, 202, 392, 453, 284, 276, 271, 380, + 430, 433, 457, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 4, AMR_OF(2, hb_gain), 87, 86, 85, 84, + 6, AMR_OF(3, adap), 34, 53, 94, 89, 99, 116, + 1, AMR_OF(3, ltp), 123, + 11, AMR_OF(3, pul_ih[0]), 128, 175, 159, 180, 229, 297, 348, 300, + 184, 360, 341, + 11, AMR_OF(3, pul_ih[1]), 129, 166, 165, 195, 215, 332, 340, 301, + 253, 376, 352, + 11, AMR_OF(3, pul_ih[2]), 140, 152, 167, 190, 225, 342, 365, 264, + 214, 390, 347, + 11, AMR_OF(3, pul_ih[3]), 133, 144, 149, 179, 218, 316, 388, 321, + 210, 403, 337, + 11, AMR_OF(3, pul_il[0]), 265, 198, 368, 444, 269, 280, 305, 429, + 423, 434, 477, + 11, AMR_OF(3, pul_il[1]), 303, 228, 385, 460, 239, 262, 233, 362, + 410, 417, 467, + 11, AMR_OF(3, pul_il[2]), 235, 213, 394, 451, 245, 273, 299, 412, + 425, 446, 471, + 11, AMR_OF(3, pul_il[3]), 248, 176, 386, 454, 243, 286, 310, 397, + 402, 437, 459, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 4, AMR_OF(3, hb_gain), 83, 82, 81, 80, + 0 +}; + +/** Reordering array addresses for each mode */ +static const uint16_t* amr_bit_orderings_by_mode[] = { + order_MODE_6k60, + order_MODE_8k85, + order_MODE_12k65, + order_MODE_14k25, + order_MODE_15k85, + order_MODE_18k25, + order_MODE_19k85, + order_MODE_23k05, + order_MODE_23k85 +}; + +// Extracted from 3GPP TS 26.173 V9.0.0 (qpisf_2s.tab) +// The *_36b tables are used in 6k60 mode +// Stored in fixed-point to save some space +/** Indexed tables for retrieval of quantized ISF vectors in Q15 */ +static const int16_t dico1_isf[256][9] = { + { 579, 1081, 1035, 390, 3, -263, -198, -82, 38}, + { 18, -68, -12, 313, 761, 405, 249, 111, -76}, + { 740, 1263, 1292, 1006, 997, 1019, 1017, 976, 923}, + { -91, 827, 948, 648, 613, 535, 522, 490, 421}, + { 41, -44, -281, -472, 652, 534, 193, 135, -90}, + { 41, -121, -356, -60, 663, 307, 61, -48, -344}, + { 557, 946, 1049, 867, 846, 990, 1112, 1262, 1241}, + { -118, -204, 328, 512, 870, 793, 610, 402, 186}, + { 156, 293, 74, -338, -475, -897, -594, -161, -497}, + { 226, 131, -138, 307, 169, -271, -164, -387, -624}, + { 62, -32, -61, -252, -541, -828, -1027, -523, -662}, + { 102, -61, 141, 112, -270, -251, -541, 25, -150}, + { 6, -132, -356, -686, -96, -322, -522, -31, -326}, + { -36, -209, -521, -229, 307, -132, -5, -99, -384}, + { 60, -51, -237, -668, -973, -407, -708, -75, -172}, + { 26, -138, -266, 111, -302, 43, -278, -356, -359}, + { 570, 822, 496, -154, -312, -92, 137, 279, 371}, + { -146, 368, 409, 68, 6, 77, 167, 202, 162}, + { 633, 898, 996, 756, 662, 683, 783, 909, 996}, + { -103, 294, 607, 415, 483, 462, 480, 431, 408}, + { -120, -338, -612, -524, 584, 331, 92, 433, 276}, + { -178, -293, -154, -41, 269, 100, -9, 213, 160}, + { 830, 736, 278, 820, 1254, 686, 712, 1039, 473}, + { -218, -304, 463, 454, 397, 273, 202, 286, 273}, + { -232, 7, 6, -388, -472, -427, -378, -167, -100}, + { -294, -183, 134, -47, 101, -88, -84, -117, -3}, + { 57, 17, -202, -634, -989, -1119, -533, 176, -36}, + { 120, -28, 23, 111, -319, 318, -22, -77, 266}, + { -271, -464, -434, -658, -640, -385, -385, -99, -69}, + { -198, -259, -266, -44, -39, -139, -137, 171, 66}, + { 9, -145, -377, -846, -1000, -111, -325, 342, 135}, + { -81, -286, -380, 192, -57, 307, 76, -24, -140}, + { 677, 702, 247, 56, 249, 141, -105, -236, -99}, + { 36, -39, -69, 348, 198, -93, 322, 91, -72}, + { 503, 885, 1508, 1307, 1282, 1172, 1119, 1209, 1061}, + { 416, 719, 989, 1227, 1001, 1052, 954, 741, 1044}, + { -127, -376, -657, 139, 623, 223, 501, 306, 220}, + { -113, -384, -796, 504, 438, 85, 213, -83, -194}, + { 585, 1132, 1233, 1091, 1247, 1433, 1512, 1448, 1314}, + { -174, -422, 7, 1155, 1089, 1182, 1003, 945, 806}, + { 8, -126, -317, -103, -351, -695, -98, -268, -537}, + { 33, -103, -290, 167, -39, -407, 44, -208, -375}, + { 104, -23, -64, -291, -637, -851, -1084, -61, -112}, + { -75, -306, -434, 218, -148, -354, -680, -133, -216}, + { -121, -377, -718, -97, -130, -361, -156, -379, -599}, + { -56, -254, -586, 235, 157, -214, 11, -260, -149}, + { -124, -267, -397, -580, -593, -527, -805, -385, 346}, + { -193, -440, -708, -351, -141, -255, -499, -147, -185}, + { 448, 660, 494, 208, 509, 461, 338, 291, 149}, + { -223, 88, 335, 159, 212, 191, 286, 308, 205}, + { -31, 469, 803, 659, 619, 658, 843, 987, 1113}, + { -171, -242, 514, 362, 295, 524, 552, 694, 585}, + { -64, -308, -448, -21, 284, 786, 446, 289, 92}, + { -218, -390, -7, 169, 206, 330, 352, 408, 358}, + { -36, 702, 959, 859, 861, 1115, 1269, 1357, 1305}, + { -133, -341, -65, 678, 417, 440, 486, 518, 780}, + { 33, -44, -191, -344, -461, -755, -201, 217, -31}, + { -353, -547, -44, 123, -61, -68, -79, 29, 60}, + { 73, -57, -406, -766, -1243, -1203, 240, 400, 165}, + { -73, -282, -601, -213, -171, -375, 332, 35, -103}, + { -29, -207, -553, -476, -638, -908, 172, -22, -135}, + { -192, -239, -164, -103, -111, -47, 153, 125, 110}, + { -1, -203, -570, -1030, -1424, -535, 155, 1, 147}, + { -333, -653, -865, -197, -158, -21, -44, 95, 108}, + { 389, 588, 490, 33, -237, -524, -628, -136, -260}, + { 40, -177, -462, 453, 862, 380, 131, -130, -405}, + { 842, 1678, 1841, 1549, 1474, 1256, 1082, 905, 742}, + { 370, 1216, 1768, 1633, 1212, 636, 22, -330, 71}, + { -76, -281, -741, -742, 898, 619, 277, 71, -222}, + { -32, -265, -556, -25, 994, 682, 305, 126, -165}, + { 73, 738, 893, 968, 993, 1768, 2273, 1840, 1391}, + { -69, -349, -585, 234, 1158, 903, 626, 510, 251}, + { -1, -99, -272, -210, -603, -351, -540, -811, -383}, + { -16, -230, -504, 410, 149, -205, -343, -651, -639}, + { 103, -9, -227, -205, -562, -781, -1079, -1208, -156}, + { 143, 63, -135, -67, -317, -602, -784, -1154, -640}, + { -144, -391, -674, -622, -200, -254, -660, -947, -395}, + { -40, -250, -625, 27, 543, 94, -131, -386, -673}, + { -123, -371, -757, -451, -564, -614, -415, -711, -35}, + { -116, -309, -593, -268, 239, -33, -338, -650, -135}, + { 94, 251, 554, 57, -312, -423, -154, -57, 235}, + { -268, -71, 381, 114, -44, -87, 125, 173, 133}, + { 1513, 1714, 1238, 534, 276, 315, 461, 459, 508}, + { -131, -19, 1149, 670, 486, 356, 309, 369, 296}, + { -223, -501, -899, -722, -70, 6, 131, 310, 394}, + { -99, -303, -517, 249, 64, -53, 135, -11, 453}, + { -147, -399, -730, -401, 817, 738, 802, 749, 575}, + { -154, -435, -739, 800, 593, 366, 529, 318, 326}, + { -224, 45, -39, -387, -515, -518, -608, -384, -321}, + { -315, -377, 143, -101, -113, -377, -177, -144, -12}, + { 117, 40, -239, -651, -1051, -581, -737, -990, -328}, + { 26, -50, -157, -23, -453, -283, -531, -546, 192}, + { -252, -501, -743, -589, -627, -499, -328, -118, -72}, + { -324, -494, -244, -306, -144, -177, -262, -135, -78}, + { -36, -234, -519, -961, -1290, -314, -479, -371, -45}, + { -95, -292, -535, -8, -300, 112, -164, -277, 198}, + { -99, -128, 880, 836, 579, 351, 23, -95, -217}, + { -27, -258, 124, 1011, 597, 425, 144, 7, -73}, + { 421, 1293, 1640, 1623, 1742, 1617, 1499, 1284, 1006}, + { -95, 752, 1680, 1569, 1618, 1436, 1200, 980, 712}, + { -69, -300, -683, -435, 1132, 899, 504, 332, 109}, + { -74, -323, -637, 563, 1074, 608, 371, 105, -49}, + { -78, 831, 1194, 1110, 1378, 1481, 1492, 1365, 1217}, + { -259, -121, 1440, 1334, 1628, 1490, 1438, 1223, 933}, + { -82, -306, -613, -222, -378, -675, -545, -671, -845}, + { 53, -124, -347, 422, 52, -125, -270, -529, 9}, + { 79, -89, -320, -662, -999, -1199, -1243, -676, -297}, + { -68, -273, -611, 137, -146, -397, -627, -845, -220}, + { -112, -346, -797, -826, 234, -132, -188, -278, -522}, + { -159, -405, -734, -419, 293, 74, -167, -167, 184}, + { -153, -437, -833, -1080, -336, -472, -561, -340, -253}, + { -169, -423, -820, -904, -131, -19, -346, -604, 31}, + { 33, -31, 312, 62, -148, 49, -59, 564, 486}, + { -306, -333, 194, -44, 67, 72, 147, 205, 243}, + { -207, -49, 1360, 983, 969, 991, 1014, 1110, 973}, + { -211, -172, 883, 627, 711, 674, 705, 798, 746}, + { -88, -325, -763, -974, 687, 908, 514, 382, 172}, + { -292, -612, -805, 63, 131, 270, 259, 352, 348}, + { -235, -84, 955, 818, 1120, 1289, 1559, 1480, 1285}, + { -180, -461, -614, 657, 691, 745, 854, 783, 713}, + { -97, -309, -477, -614, -777, -734, -768, -526, -472}, + { -344, -476, -35, -169, 49, -77, -150, -240, -141}, + { -52, -268, -639, -919, -1278, -1113, -342, -333, -151}, + { -68, -242, -585, -73, -209, -478, -159, -429, 133}, + { -197, -499, -1005, -1268, -272, -224, -105, -67, 17}, + { -363, -618, -414, -116, -62, 20, 10, 116, 108}, + { -195, -475, -906, -1260, -891, -441, -277, -142, -28}, + { -226, -519, -950, -700, -275, -266, -116, -105, 82}, + { 404, 511, 520, 327, 17, -194, -333, -536, -586}, + { -114, -130, 276, 237, 204, 342, 135, -16, -111}, + { 670, 1208, 1168, 860, 742, 601, 528, 403, 309}, + { 397, 621, 966, 752, 579, 398, 400, 329, 252}, + { 191, 180, -137, -467, 272, 106, -95, 17, -192}, + { -80, -290, -626, 194, 598, 196, 21, -281, 77}, + { 510, 864, 1108, 807, 939, 902, 925, 717, 481}, + { 137, 367, 534, 764, 670, 382, 296, 153, 84}, + { 303, 497, 144, -85, -125, -539, -482, -464, -764}, + { 233, 347, 68, -147, 169, -210, -242, -226, -482}, + { 307, 422, 154, -175, -386, -722, -724, -904, -1015}, + { 309, 308, 160, -60, -470, -420, -598, -791, -219}, + { 68, 121, -137, -560, -146, -446, -515, -494, -729}, + { 130, 53, -227, 46, 474, 32, -161, -192, -490}, + { 213, 164, -71, -465, -876, -161, -456, -587, -48}, + { 218, 117, 39, 177, -194, -88, -226, -418, 50}, + { 210, 547, 569, 279, 121, -44, -50, 10, -84}, + { 58, 140, 182, -5, 267, 117, 106, 211, 198}, + { 539, 835, 913, 719, 617, 544, 591, 565, 642}, + { 153, 559, 872, 460, 222, 108, 188, 180, 183}, + { 158, 119, 284, -153, -271, 229, 87, 110, -57}, + { -183, 82, 118, 21, 13, 40, 118, 191, 185}, + { 162, 889, 654, 108, -34, 244, 488, 561, 532}, + { 163, 56, 609, 341, 50, 329, 68, 266, 218}, + { 100, 206, 18, -304, -107, -436, -487, -65, -306}, + { -86, 154, 134, -30, -45, -73, -104, -80, -96}, + { 245, 330, 10, -440, -849, -1082, 79, 40, -265}, + { 196, 372, 272, -181, -493, -389, 275, 80, -59}, + { 2, -12, -246, -505, -100, -436, 21, -187, -431}, + { -221, -48, 36, -271, -186, -147, -109, 26, 71}, + { 213, 140, 72, -351, -620, -84, -363, 69, 46}, + { 91, 167, -3, -95, -99, -105, -48, 114, 147}, + { 259, 249, 172, 607, 406, 52, 59, -189, -320}, + { 115, -85, -54, 574, 128, 226, -59, -253, 130}, + { -62, 1033, 1308, 1035, 1127, 1098, 1029, 961, 823}, + { 39, 364, 757, 940, 728, 660, 659, 583, 770}, + { -115, -338, -760, -471, 394, 37, 441, 178, 6}, + { -57, -305, -525, 796, 453, 188, -4, -114, 248}, + { 71, 444, 797, 731, 1096, 1157, 1222, 1029, 811}, + { 135, 359, 551, 425, 749, 815, 874, 704, 502}, + { 132, 247, 0, -206, -449, -750, -258, -514, -633}, + { 248, 249, 91, 121, -195, -499, -90, -282, -435}, + { 78, 20, -277, -623, -983, -1224, -415, -458, -639}, + { 347, 509, 208, -179, -464, -728, -76, -237, -486}, + { -103, -343, -756, -713, -265, -609, -191, -398, -636}, + { -121, -383, -749, 567, 252, -36, -354, -417, -50}, + { 204, 100, -149, -650, -1081, -47, -7, -263, 111}, + { -46, -180, -267, -324, -562, -394, -692, 398, 292}, + { 482, 670, 683, 624, 442, 165, 116, 36, -149}, + { 108, 247, 291, 247, 355, 122, 109, 224, 296}, + { -14, 945, 990, 801, 755, 815, 847, 913, 892}, + { 292, 349, 725, 482, 388, 329, 429, 620, 667}, + { -34, 197, 213, -127, 84, 494, 620, 575, 375}, + { 126, 207, 172, 167, 362, 202, 296, 395, 455}, + { -6, 250, 539, 467, 636, 801, 1149, 1287, 1118}, + { 27, 240, 369, 280, 440, 411, 634, 892, 953}, + { 159, 170, -58, -395, -797, -690, 77, -211, -334}, + { -5, -28, -13, -74, -335, -603, 300, 88, -205}, + { 82, -33, -364, -698, -1203, -1153, 110, -146, -289}, + { 113, 1, -243, -588, -994, -496, 414, 160, 42}, + { -56, -247, -440, -693, -996, -479, 11, -178, -357}, + { -151, -353, -327, -211, -340, 141, 65, 425, 453}, + { 34, -169, -455, -932, -1215, 138, 499, 256, 324}, + { 68, 139, -15, -547, -478, 17, 306, 502, 481}, + { -32, -134, 445, 129, -143, -244, -503, -507, -599}, + { 61, -140, -345, 496, 458, -2, 20, -227, -514}, + { 394, 1765, 1666, 1339, 1117, 806, 642, 479, 380}, + { 215, 519, 920, 1053, 1090, 791, 528, 290, 155}, + { -54, -233, -647, -602, 639, 294, -2, -167, -442}, + { -78, -315, -791, -113, 820, 403, 158, -116, -356}, + { 529, 1851, 2003, 1228, 622, -41, -416, 344, 819}, + { -105, -379, -236, 1224, 893, 749, 568, 356, 214}, + { -17, -199, -144, 50, -283, -247, -578, -846, -1087}, + { 69, -11, -381, -206, 209, -284, -387, -416, -716}, + { 39, -5, -145, -374, -682, -909, -1074, -1169, -1066}, + { 287, 226, 67, -221, -662, -171, -421, -642, -707}, + { -132, -348, -538, -448, -20, -4, -354, -748, -933}, + { 4, -75, -289, -598, 317, 52, -208, -297, -559}, + { -88, -264, -358, -589, -631, -248, -523, -822, -1071}, + { 70, -8, 54, -314, -515, 92, -146, -274, -493}, + { 199, 62, 391, 158, -141, 71, -219, -203, -207}, + { 152, 40, 329, 162, -29, 48, -149, 108, 127}, + { 635, 1058, 883, 492, 372, 312, 317, 274, 241}, + { 267, 722, 1256, 882, 625, 248, 8, -81, -60}, + { -58, -138, -291, -600, -12, -2, -39, 147, 117}, + { -107, -345, -513, 459, 76, 92, -272, 388, 262}, + { 362, 516, 203, -409, -716, -831, -331, 185, 209}, + { -117, -391, -298, 671, 292, 538, 257, 166, -38}, + { -102, -319, -194, -283, -573, -262, -579, -219, -444}, + { -235, 78, 11, -168, -101, -229, -263, -321, -123}, + { 70, 50, -170, -599, -996, -588, -263, -516, -455}, + { 394, 363, 229, -136, -538, 21, -183, -348, -201}, + { -124, -368, -640, -879, -847, -209, -409, -494, -515}, + { -127, -341, -541, -425, -510, -10, -252, -473, -291}, + { 84, -69, -201, -676, -868, 103, -311, -132, -320}, + { 5, -173, -188, -297, -628, 197, -57, 7, -11}, + { 49, -160, 56, 558, 111, 33, -311, -440, -463}, + { -1, -246, -307, 862, 453, 139, -170, -355, -232}, + { 279, 966, 1642, 1478, 1463, 1123, 795, 525, 339}, + { -197, -38, 1702, 1331, 1252, 950, 692, 504, 426}, + { -108, -344, -861, -1172, 444, 354, 88, -46, -220}, + { -53, -321, -494, 1113, 744, 364, 198, -34, -75}, + { 457, 955, 1177, 1214, 1427, 1457, 1345, 917, 539}, + { -69, 199, 897, 1140, 1343, 1183, 977, 742, 522}, + { 122, 44, -269, 27, -155, -562, -307, -590, -773}, + { 154, 42, -160, 252, -129, -305, -471, -733, -371}, + { 135, 185, -82, -416, -722, -913, -504, -743, -880}, + { 149, 214, -84, -329, -680, -835, -426, -661, -81}, + { -128, -380, -735, -998, -337, 17, -182, -467, -697}, + { -84, -290, -510, -592, 13, 440, 154, -38, -279}, + { 70, -61, -246, -727, -1047, -80, -381, -535, -704}, + { 178, -2, -146, -670, -938, 482, 138, 63, 65}, + { -11, 15, 772, 443, 142, -20, -209, -126, -161}, + { -32, -249, 95, 552, 124, 30, -343, 82, -86}, + { 148, 751, 1515, 1105, 867, 606, 474, 448, 399}, + { -163, -257, 899, 1097, 906, 751, 502, 390, 294}, + { -51, -258, -447, -806, -368, 763, 464, 364, 183}, + { -166, -374, -367, 87, 35, 399, 418, 856, 833}, + { -205, -310, 588, 778, 785, 1065, 1118, 1245, 1157}, + { -173, -312, 107, 345, 400, 790, 870, 1113, 1001}, + { -7, -120, -387, -410, -614, -943, -226, -384, -491}, + { -203, -288, -51, -331, -90, -178, -408, -573, -338}, + { 56, -29, -273, -627, -1041, -798, -247, -467, 148}, + { 66, -2, -205, -205, -575, -349, -57, -352, -58}, + { -45, -225, -471, -924, -497, 77, -32, 44, -135}, + { -277, -491, -497, -502, -424, -202, -137, 77, 96}, + { 26, -179, -469, -1008, -1260, 262, -35, -132, -259}, + { -66, -232, -447, -533, -789, -191, -100, -267, 364} +}; + +static const int16_t dico2_isf[256][7] = { + { 1357, 1313, 1136, 784, 438, 181, 145}, + { 636, 648, 667, 568, 442, 217, 362}, + { 427, 440, 674, 524, 332, 117, -417}, + { 121, 295, 468, 465, 230, 44, -221}, + { -147, -240, 149, 80, 390, 278, 106}, + { -418, -556, 552, 511, 235, 144, -95}, + { 43, 193, 274, 150, 67, 34, -273}, + { -43, -126, 171, 416, 282, 63, -354}, + { -372, -86, -344, -108, -94, -182, -89}, + { -600, -840, -200, 465, 258, -11, -253}, + { -48, 329, 97, -290, -543, -795, -354}, + { -570, -117, 187, 10, -133, -416, -76}, + { -618, -129, -247, -371, 45, -76, 277}, + { -1022, -1079, 126, 474, 254, 127, 52}, + { -281, 76, -167, -361, -283, -551, -283}, + { -119, -52, -1, 134, -32, -204, -415}, + { 1064, 827, 637, 684, 464, 209, 12}, + { 482, 416, 449, 371, 335, 294, 194}, + { 719, 576, 365, 135, 113, 91, -199}, + { 298, 176, 493, 366, 194, 163, 36}, + { -35, -236, -259, -36, -4, 99, 152}, + { -98, -306, -27, 228, 90, 111, -86}, + { 91, 13, -211, -258, -106, 86, -64}, + { 73, -35, -57, -31, 162, 35, -192}, + { -109, -335, -629, -66, -61, -128, 322}, + { -495, -669, -728, 193, 31, -220, 122}, + { 324, 95, -89, -91, -409, -710, -154}, + { 0, -234, 92, 33, -343, -609, -220}, + { -343, -408, -476, -655, -153, 82, 222}, + { -490, -745, -255, 49, -48, 135, -127}, + { 119, -67, -328, -390, -272, -545, -56}, + { -57, -130, -10, -7, -164, -47, -22}, + { 984, 1064, 961, 568, 210, -27, 16}, + { 811, 691, 754, 514, 224, -35, 166}, + { 662, 704, 618, 386, 57, -211, -257}, + { 510, 359, 418, 393, 91, -144, -18}, + { -193, -31, -27, 223, 89, -143, 24}, + { -112, -98, 471, 319, 185, 3, 175}, + { 252, 146, -47, 272, 48, -211, -234}, + { 146, 69, 203, 364, 68, -52, 51}, + { -259, -478, -697, -349, -758, -501, 63}, + { -501, -769, -289, 79, -311, -497, -106}, + { 251, 53, -235, -469, -895, -884, 145}, + { -416, -551, 140, -133, -523, -775, 44}, + { -326, -423, -713, -497, -86, -431, 99}, + { -757, -772, -160, -76, -46, -32, 379}, + { 85, -35, -200, -401, -663, -1040, -247}, + { -180, -330, -92, -376, 27, -183, -110}, + { 1279, 1086, 781, 502, 324, 164, 157}, + { 682, 466, 449, 277, 146, 28, 409}, + { 635, 472, 390, 107, -232, -538, -139}, + { 196, 396, 332, 213, 209, -29, -81}, + { 150, -95, -312, 76, -77, -320, -50}, + { 46, 9, 47, 175, 139, 30, 384}, + { 218, 206, -24, -250, -96, -276, -183}, + { 26, 119, 38, 14, -4, -133, -52}, + { -477, -614, -987, -715, -631, -813, 200}, + { -744, -1009, -1065, -745, -631, -171, 18}, + { -137, -251, -483, -613, -980, -1203, 12}, + { -605, -767, -562, -686, -1088, -515, 58}, + { -202, -428, -782, -1072, -96, -234, -179}, + { -480, -709, -1070, -897, -131, -92, 321}, + { -145, -193, -512, -729, -572, -765, -210}, + { -331, -585, -525, -631, -281, -208, -303}, + { 1165, 1104, 939, 828, 716, 426, 155}, + { 6, -109, 820, 778, 415, 113, -27}, + { 381, 339, 314, 265, 121, -9, -474}, + { -373, 47, 584, 442, 99, -231, -113}, + { -496, -38, -285, 262, 305, 170, 4}, + { -587, -556, 69, 66, 471, 354, 13}, + { -138, 70, -18, 106, 67, 167, -302}, + { -445, -141, 185, 191, 151, 83, -133}, + { -257, -521, -720, -198, 134, -46, -182}, + { -819, -1168, -777, 512, 359, 95, -113}, + { 137, -2, -74, -138, -401, -114, -371}, + { -242, -466, 204, 223, -31, -212, -192}, + { -532, -637, -466, -686, 256, 277, -139}, + { -1141, -1244, -381, -75, -54, 14, 88}, + { -311, 115, -143, -499, -343, 124, -416}, + { -616, -147, -135, 43, -4, 121, -369}, + { 835, 783, 641, 390, 355, 350, 64}, + { 72, 194, 443, 467, 436, 219, 372}, + { 464, 369, 192, 4, -156, -72, -226}, + { 57, 206, 303, 205, 188, 101, 265}, + { -40, -205, -488, -184, 276, 64, -26}, + { -217, -433, -297, 137, 328, 308, -289}, + { 378, 81, -308, -465, 57, -37, 227}, + { -100, 24, -36, -151, 199, 8, 143}, + { -426, -697, -1059, -133, 388, 161, 321}, + { -644, -1023, -1271, 39, 66, -123, 70}, + { 372, 177, -173, -556, -553, -304, -189}, + { -117, -369, -425, -122, -462, -152, -73}, + { -649, -850, -1189, -767, 497, 360, 222}, + { -798, -1139, -1455, -190, 430, 234, 179}, + { 42, -94, -405, -692, 38, -202, -246}, + { -169, -366, -290, -88, -64, 32, -292}, + { 1010, 923, 938, 710, 465, 230, 342}, + { 217, 300, 1054, 675, 68, -458, -179}, + { 78, 453, 316, 18, -237, -496, -243}, + { 167, 21, 424, 215, -91, -303, -170}, + { -290, -81, -70, -67, 40, 54, -59}, + { -353, -427, -90, 53, 94, 9, 54}, + { -28, 318, 283, 15, -240, -58, 79}, + { -75, -121, 229, 35, 58, 6, -133}, + { -351, -514, -744, -834, -705, -137, 164}, + { -1124, -1388, -1055, -230, -73, 40, 36}, + { -163, -233, -532, -785, -1170, -697, 96}, + { -788, -959, -246, -430, -624, -165, -8}, + { -856, -540, -630, -907, -337, -70, 76}, + { -937, -1042, -659, -733, -208, 199, -26}, + { -523, 78, -98, -501, -869, -890, -81}, + { -624, -703, -45, -348, -25, 87, -186}, + { 1005, 823, 546, 249, 90, -22, 207}, + { 298, 397, 381, 319, 200, 62, 303}, + { 473, 379, 133, -247, -632, -441, 75}, + { 284, 208, 391, 115, -25, 44, 95}, + { -72, 79, -95, -63, -129, -293, 203}, + { -164, -349, 115, 122, 69, -1, 378}, + { 348, 170, 99, 58, -179, -302, 188}, + { -190, -2, 150, 23, -51, -11, 216}, + { -615, -863, -1090, -1427, -802, -48, -6}, + { -961, -1276, -1548, -727, -58, 56, 223}, + { -124, -255, -561, -988, -1277, -148, -82}, + { -480, -660, -891, -1191, -1339, -325, 20}, + { -621, -917, -1296, -1350, 264, 289, 50}, + { -844, -1022, -1345, -1329, -293, 46, 278}, + { -260, -468, -829, -1176, -533, -560, -78}, + { -215, -484, -822, -1233, -791, 15, -138}, + { 1301, 1317, 1262, 1048, 716, 357, -64}, + { 578, 824, 925, 802, 630, 362, 102}, + { 470, 925, 767, 514, 327, 190, -112}, + { 225, 492, 495, 437, 598, 384, -45}, + { 43, 82, -42, 175, 519, 342, -64}, + { -304, -154, 159, 576, 403, 221, 327}, + { 214, 244, 122, -62, 312, 92, -160}, + { 218, 208, 310, 268, 306, 323, -199}, + { -285, -269, -79, -124, -143, -153, 236}, + { -205, -384, -426, 344, 59, -185, -184}, + { -272, 247, 126, -210, -518, -468, 78}, + { -99, -120, 502, 160, -280, -557, 304}, + { -423, -17, -283, -443, 215, 212, -140}, + { -564, -684, -228, 510, 361, 130, 323}, + { -428, 335, 98, -65, 36, -215, -246}, + { -362, 51, 364, -16, -234, 150, -165}, + { 914, 883, 751, 653, 676, 464, -153}, + { 631, 545, 535, 720, 596, 360, -81}, + { 783, 712, 512, 439, 341, 251, -391}, + { 497, 417, 249, 372, 295, 173, -193}, + { 128, -110, -385, 93, 39, 173, -231}, + { 216, -59, -253, 462, 389, 154, 69}, + { 455, 270, -4, -337, -49, 233, -322}, + { 307, 143, 53, 218, 128, 236, -156}, + { -37, -186, -240, -411, -110, 9, 399}, + { -140, -365, -628, 258, 380, 214, 277}, + { 131, 454, 177, -285, -520, 108, -214}, + { 77, -141, 201, -123, -490, -131, 60}, + { -14, -194, -521, -741, 273, 362, -33}, + { -362, -566, -287, -228, 161, 237, 317}, + { -269, 195, -75, -375, -204, 11, 77}, + { -128, -264, -156, -223, -475, 265, 27}, + { 1238, 1147, 916, 689, 432, 210, -280}, + { 800, 664, 879, 726, 411, 160, -164}, + { 454, 686, 536, 275, 147, 46, 111}, + { 303, 486, 512, 355, 241, 181, -69}, + { 79, 92, 29, 147, 233, 52, 17}, + { -171, 289, 131, 439, 271, 3, -10}, + { 413, 241, 144, 174, 155, -2, 14}, + { 58, 217, 247, 219, 149, 175, -18}, + { 228, -8, -240, -206, -513, -191, 202}, + { -96, -272, -454, 33, -300, -575, 46}, + { -10, -108, -246, -347, -770, -535, 9}, + { -326, -430, -61, -321, -704, -299, 201}, + { -1, -280, -603, -419, -185, 18, -36}, + { -516, -522, -379, -291, -181, -97, 27}, + { -159, -313, -525, -224, -510, -831, -197}, + { -292, -459, -59, -310, -562, -143, -351}, + { 1066, 912, 631, 389, 207, 86, -224}, + { 596, 512, 596, 505, 314, 122, -48}, + { 787, 861, 441, -93, -303, 33, -190}, + { 257, 469, 337, 51, 15, 298, -93}, + { 295, 73, -119, 25, 36, 23, 108}, + { -28, -3, -32, 114, 21, 185, 107}, + { 482, 305, 15, -279, -319, 52, 96}, + { 226, 46, 115, 72, -136, 133, -125}, + { 18, -207, -559, -590, -503, -482, 321}, + { -571, -789, -951, -172, -441, -538, 113}, + { 181, 14, -310, -641, -1001, -202, 159}, + { -136, -393, -433, -513, -911, -144, -22}, + { 72, -265, -706, -954, -159, 53, 332}, + { -338, -591, -852, -383, -395, 56, 44}, + { 43, -158, -464, -897, -631, -157, -294}, + { -161, -128, -328, -573, -483, -125, 11}, + { 1017, 906, 1051, 1005, 679, 341, -102}, + { 359, 334, 1567, 1314, 723, 105, 10}, + { -65, 726, 529, 301, 220, 43, -273}, + { -510, 436, 719, 566, 358, 179, 114}, + { -560, 298, 133, -120, 342, 225, 14}, + { -899, -101, 217, 617, 400, 146, -58}, + { -41, 352, 82, -196, 39, 121, -167}, + { -212, 59, 447, 284, 423, 250, -169}, + { -371, -484, -596, 30, -41, 249, 22}, + { -372, -650, -794, 477, 445, 216, -79}, + { -352, 275, 17, -443, -929, 92, 19}, + { -699, -696, 431, 264, -49, -310, 182}, + { -978, -217, -430, -400, 101, 261, 72}, + { -929, -889, -357, -13, 463, 378, 236}, + { -826, 56, 30, -299, -360, -128, -51}, + { -878, -299, -111, 75, 65, 36, 3}, + { 817, 368, -25, 354, 697, 591, -173}, + { 309, 212, 222, 751, 484, 140, -56}, + { 593, 379, 70, -8, 258, 180, 110}, + { 165, -46, 255, 297, 219, 273, 105}, + { 160, -70, -358, -181, 379, 330, 319}, + { -238, -369, -198, 740, 580, 319, -143}, + { 201, 109, -202, -456, 328, 276, -141}, + { 203, 170, 111, 42, 207, 360, 188}, + { -345, -399, -513, -233, 650, 422, 81}, + { -635, -961, -1220, 463, 539, 204, 209}, + { 202, -25, -194, -498, -787, 193, -143}, + { -449, -538, 195, -106, -331, 68, 62}, + { -228, -477, -840, -576, 317, 128, 283}, + { -671, -937, -807, -114, 391, 335, -62}, + { 246, 2, -314, -679, -303, 180, -88}, + { -107, -272, 90, -198, -28, 290, -112}, + { 885, 1149, 1021, 712, 496, 281, -83}, + { 269, 492, 787, 643, 347, 70, 124}, + { 336, 636, 499, 92, -229, -179, 191}, + { 26, 402, 564, 340, 149, -11, 135}, + { -440, 561, 470, 204, -72, -186, 140}, + { -720, 14, 355, 229, 68, -133, 465}, + { 110, 310, 103, 12, 106, 29, 158}, + { -178, 113, 161, 142, 121, 115, 27}, + { -651, -414, -645, -152, -164, -13, -429}, + { -639, -944, -681, -104, -81, 52, -189}, + { -663, -164, -316, -683, -954, -205, -83}, + { -609, -669, -172, -517, -694, 283, -80}, + { -646, -152, -383, -678, -246, -40, -143}, + { -747, -796, -745, -390, -98, 43, 275}, + { -599, -199, -398, -433, -436, -538, 31}, + { -1107, -568, -376, -265, -126, -21, 1}, + { 847, 573, 308, 392, 305, 101, 55}, + { 273, 293, 201, 267, 346, 201, 123}, + { 727, 480, 226, 2, -65, -138, 164}, + { 273, 208, 173, 292, 12, 253, 174}, + { 340, 207, 180, 88, 116, 46, 475}, + { -460, -166, -30, 13, 110, 173, 396}, + { 137, 88, 43, -137, -94, 34, 284}, + { 96, -14, 226, 40, 63, 70, 130}, + { -467, -735, -1012, -1174, -307, 305, -67}, + { -612, -920, -1146, -567, -8, 92, -25}, + { -182, -271, -492, -754, -857, 287, -75}, + { -494, -787, -689, -683, -709, 137, -326}, + { -288, -550, -903, -1105, 334, 321, -62}, + { -354, -653, -834, -445, 1, 377, -152}, + { -162, -306, -608, -937, -297, 247, -192}, + { -234, -477, -244, -488, -266, 342, -332} +}; + +static const int16_t dico21_isf[64][3] = { + { 329, 409, 249}, { -33, 505, 160}, + { -29, -14, 582}, { -262, 127, 354}, + { 145, 237, 175}, { -152, 245, 122}, + { 27, 42, 340}, { -84, -93, 311}, + { 285, 222, -156}, { 47, -43, -504}, + { 234, 121, 385}, { 104, -317, 45}, + { 176, 195, 8}, { 104, -59, -94}, + { 177, 53, 192}, { -34, -127, 152}, + { 570, 277, -34}, { -67, -329, -639}, + { -157, -272, 462}, { -177, -462, 198}, + { 322, 179, 115}, { -386, 171, 19}, + { 19, -12, 195}, { -120, -252, 201}, + { 304, 36, -336}, { -128, -221, -380}, + { 171, -185, 296}, { -242, -312, 23}, + { 198, 39, 16}, { -3, -177, -111}, + { 111, -93, 76}, { -92, -223, 4}, + { 177, 406, -44}, { -168, 380, -149}, + { -4, 273, 331}, { -420, 513, 277}, + { 21, 247, 47}, { -58, 131, -2}, + { -3, 134, 180}, { -145, 40, 175}, + { 189, 74, -145}, { -27, -45, -325}, + { 370, -114, -21}, { -83, -415, -173}, + { 77, 95, -51}, { -40, -30, -67}, + { 71, 88, 86}, { -35, -98, 14}, + { 69, 197, -334}, { -196, 79, -231}, + { -348, -137, 218}, { -352, -89, -85}, + { 47, 201, -130}, { -165, 37, -15}, + { -43, 3, 86}, { -161, -108, 79}, + { 83, 21, -237}, { -81, -149, -238}, + { 150, -186, -251}, { -186, -249, -162}, + { -19, 66, -139}, { -26, -50, -181}, + { 24, 11, 0}, { -130, -105, -98} +}; + +static const int16_t dico22_isf[128][3] = { + { -127, 310, 42}, { -242, 197, 5}, + { -151, 84, -17}, { -214, 127, -149}, + { -247, -131, 159}, { -268, -267, -95}, + { -217, 1, -79}, { -271, -80, -185}, + { -45, 436, 159}, { 165, 199, 391}, + { -33, 81, 187}, { -66, -42, 355}, + { -298, -57, 343}, { -108, -537, 226}, + { -144, -23, 193}, { 176, -402, 87}, + { 53, 296, 25}, { -84, 253, -104}, + { -58, 105, -126}, { -169, 174, -314}, + { -48, 44, -294}, { -164, -417, -242}, + { -139, 3, -194}, { -155, -207, -211}, + { 119, 322, 213}, { 333, 50, 380}, + { 237, 247, -2}, { 466, -16, 201}, + { 238, -255, -107}, { 67, -440, -149}, + { 122, -88, -139}, { 88, -247, -73}, + { -41, 231, 167}, { -62, 155, 16}, + { -65, 16, 77}, { -68, -2, -63}, + { -151, -300, 160}, { -18, -333, 54}, + { -56, -94, 5}, { 2, -190, 14}, + { 92, 148, 209}, { 108, 9, 272}, + { 108, 35, 110}, { 142, -85, 145}, + { 47, -157, 279}, { 3, -320, 246}, + { 43, -72, 68}, { 86, -217, 135}, + { 36, 140, 79}, { 56, 175, -49}, + { 26, 45, 3}, { 73, 55, -101}, + { 109, -183, -242}, { -4, -283, -242}, + { 48, -68, -48}, { -6, -153, -122}, + { 161, 196, 96}, { 232, 80, 190}, + { 165, 97, 11}, { 258, -31, 71}, + { 267, -77, -91}, { 311, -209, 87}, + { 152, -14, -22}, { 150, -149, 9}, + { -324, 557, 187}, { -384, 307, 46}, + { -251, 27, 77}, { -365, 77, -52}, + { -482, -84, 160}, { -424, -515, -64}, + { -294, -120, -4}, { -476, -116, -109}, + { -97, 318, 365}, { 106, 627, 445}, + { -190, 120, 287}, { -146, 65, 619}, + { -427, 242, 363}, { -361, -371, 432}, + { -347, 102, 168}, { -629, 195, -14}, + { -65, 476, -47}, { -297, 320, -168}, + { -55, 356, -264}, { -391, 82, -286}, + { -51, -31, -556}, { -178, -399, -586}, + { -205, -49, -360}, { -343, -238, -337}, + { 220, 457, 58}, { 561, 467, 259}, + { 340, 270, -168}, { 450, 77, -280}, + { 60, 167, -413}, { 133, -252, -492}, + { 216, 157, -290}, { 282, 0, -495}, + { -226, 293, 183}, { -157, 135, 122}, + { -158, -59, 39}, { -133, -118, -97}, + { -332, -309, 113}, { -160, -425, -6}, + { -149, -211, 24}, { -80, -277, -90}, + { -11, 125, 338}, { 130, -71, 465}, + { 5, -45, 184}, { 237, -95, 253}, + { -139, -197, 297}, { -19, -300, 511}, + { -63, -152, 139}, { 250, -289, 336}, + { 124, 339, -150}, { 34, 176, -208}, + { 171, 166, -116}, { 94, 38, -229}, + { 75, -65, -339}, { -78, -205, -385}, + { 0, -30, -163}, { -56, -110, -242}, + { 321, 244, 194}, { 505, 238, -1}, + { 317, 116, 65}, { 309, 88, -74}, + { 452, -51, -50}, { 334, -217, -290}, + { 211, 41, -152}, { 238, -55, -260} +}; + +static const int16_t dico23_isf[128][3] = { + { -10, 151, 359}, { 136, 298, 223}, + { 255, -104, 290}, { 423, 6, 183}, + { -270, -269, -98}, { -52, -82, 13}, + { -82, -274, -97}, { 90, -246, -72}, + { -299, -70, 421}, { -88, 365, 430}, + { 187, -318, 381}, { 380, 37, 488}, + { -373, -316, 79}, { -308, -101, 5}, + { -135, -451, 8}, { 72, -421, -154}, + { 180, 170, -121}, { 62, 177, -40}, + { 326, 80, -105}, { 248, 263, -5}, + { -168, -181, -221}, { -2, -23, -158}, + { -14, -149, -121}, { 119, -91, -147}, + { 119, 332, -153}, { 49, 303, 34}, + { 442, -55, -69}, { 217, 454, 58}, + { -359, -187, -375}, { -42, 50, -274}, + { -8, -267, -249}, { 85, -86, -346}, + { -77, -40, 345}, { 89, 134, 219}, + { 156, -80, 160}, { 108, 40, 116}, + { -158, -206, 29}, { 5, -32, 175}, + { -65, -158, 146}, { 55, -78, 73}, + { -114, -222, 353}, { -47, 81, 211}, + { 49, -151, 268}, { 105, 4, 302}, + { -263, -132, 183}, { -151, -28, 201}, + { -177, -307, 166}, { 101, -221, 130}, + { 74, 58, -98}, { 32, 44, 13}, + { 194, 30, -142}, { 170, 96, 8}, + { -136, -119, -91}, { -65, 8, -55}, + { 3, -188, 12}, { 45, -63, -49}, + { 149, -21, -19}, { 24, 144, 95}, + { 254, -22, 60}, { 161, 196, 96}, + { -158, -61, 48}, { -70, 33, 82}, + { -23, -321, 58}, { 155, -147, 5}, + { -364, 328, 77}, { -21, 453, 173}, + { -108, 82, 630}, { 367, 263, 208}, + { -300, -62, -176}, { -205, 143, -158}, + { -169, -410, -264}, { 257, -269, -100}, + { -636, 289, -2}, { -292, 627, 173}, + { -382, -363, 387}, { 248, 524, 447}, + { -521, -111, -107}, { -395, 118, -274}, + { -343, -680, -125}, { -172, -447, -663}, + { 75, 148, -367}, { -79, 263, -94}, + { 249, 148, -286}, { 380, 271, -162}, + { -142, -4, -186}, { -57, 111, -125}, + { -35, -108, -254}, { 100, 29, -242}, + { -80, 303, -264}, { -78, 464, -57}, + { 248, -22, -494}, { 661, 662, 44}, + { -193, -40, -330}, { -178, 145, -337}, + { -90, -199, -400}, { -40, -23, -498}, + { -192, 114, 315}, { -41, 244, 190}, + { 88, -97, 485}, { 241, 80, 212}, + { -246, 40, 87}, { -156, 147, 134}, + { -2, -334, 239}, { 308, -203, 110}, + { -459, 251, 422}, { -218, 310, 228}, + { -86, -346, 654}, { 184, 175, 425}, + { -481, -63, 169}, { -349, 117, 188}, + { -125, -560, 310}, { 158, -416, 94}, + { 46, 171, -192}, { -63, 157, 14}, + { 256, -35, -271}, { 322, 123, 53}, + { -214, 4, -76}, { -156, 86, -18}, + { 128, -197, -232}, { 265, -90, -98}, + { -308, 332, -145}, { -131, 308, 58}, + { 509, 59, -339}, { 562, 196, -14}, + { -378, 100, -47}, { -234, 202, 1}, + { 104, -270, -493}, { 319, -210, -325} +}; + +static const int16_t dico24_isf[32][3] = { + { -79, -89, -4}, { -171, 77, -211}, + { 160, -193, 98}, { 120, -103, 323}, + { 32, -22, -129}, { 72, 78, -268}, + { 182, -76, -66}, { 309, 99, -145}, + { -229, -157, -84}, { -383, 98, -71}, + { -90, -352, 12}, { -284, -178, 178}, + { -65, -125, -166}, { -87, -175, -351}, + { 42, -198, -48}, { 154, -140, -243}, + { -77, 18, 108}, { -39, 355, 91}, + { 87, 8, 155}, { -4, 158, 239}, + { 128, 95, -54}, { 7, 246, -124}, + { 258, 15, 89}, { 206, 216, 98}, + { -201, 9, 18}, { -312, 233, 204}, + { -39, -174, 155}, { -144, -9, 284}, + { -57, 70, -69}, { -157, 187, 18}, + { 54, -30, 23}, { 24, 135, 55} +}; + +static const int16_t dico25_isf[32][4] = { + { 169, 142, -119, 115}, { 206, -20, 94, 226}, + { -106, 313, -21, 16}, { -62, 161, 71, 255}, + { -89, 101, -185, 125}, { 72, -30, -201, 344}, + { -258, 33, -8, 81}, { -104, -154, 72, 296}, + { 144, -68, -268, -25}, { 81, -78, -87, 106}, + { 22, 155, -186, -119}, { -46, -28, 27, 91}, + { -114, -37, -175, -33}, { -94, -222, -189, 122}, + { -132, -119, -191, -270}, { -172, -173, 18, -43}, + { 279, 135, -42, -128}, { 187, -86, 229, -138}, + { 159, 240, 140, 46}, { 69, 25, 227, 77}, + { 21, 115, 13, 8}, { 68, -248, 126, 81}, + { -150, 137, 207, -9}, { -154, -133, 289, 67}, + { 143, -37, -86, -326}, { 180, -32, 19, -23}, + { 26, 168, 116, -233}, { -32, -26, 118, -78}, + { 3, -8, -45, -115}, { 57, -215, -54, -83}, + { -209, 112, -22, -167}, { -91, -151, 168, -262} +}; + +static const int16_t dico21_isf_36b[128][5] = { + { -52, -96, 212, 315, -73}, { 82, -204, 363, 136, -197}, + { -126, -331, 183, 218, 143}, { -49, -41, 557, 230, 72}, + { 2, -73, 163, 377, 221}, { 133, 111, 278, 215, -110}, + { -102, -20, 284, 113, 273}, { 84, 319, 290, 18, 85}, + { -25, -5, 125, 132, -204}, { -38, -5, 286, -9, -356}, + { -140, -256, 92, 117, -189}, { -144, 191, 313, 51, -98}, + { 167, -10, 44, 247, 36}, { 381, 197, 238, 74, 6}, + { 38, -408, 29, -3, -85}, { 92, 266, 157, -25, -200}, + { 161, -121, 70, 84, -140}, { -16, -86, 112, -94, -189}, + { -269, -270, 351, 107, -24}, { -68, -67, 492, -103, -155}, + { -53, -131, 62, 122, 10}, { 135, 84, 283, -55, -120}, + { -12, -219, 331, -81, 167}, { 220, -136, 147, -172, -42}, + { 140, -95, -109, -88, -194}, { 0, -2, -4, -33, -381}, + { -66, -217, 152, -186, -402}, { 244, 108, 156, -140, -395}, + { 113, -136, -196, 110, -24}, { 214, 118, 11, -64, -131}, + { -110, -286, -6, -332, 16}, { 94, 97, 79, -291, -205}, + { -5, -39, -20, 252, -96}, { 76, 174, 101, 163, 61}, + { -69, -239, -55, 399, 6}, { -115, 319, 164, 275, 196}, + { -15, 36, -47, 331, 121}, { 226, 209, 271, 325, 184}, + { 13, -80, -218, 471, 353}, { 288, 378, 16, -51, 251}, + { 174, 116, 52, 149, -279}, { 235, 276, 39, 120, -48}, + { 0, -108, -108, 241, -339}, { -93, 534, 45, 33, -87}, + { 194, 149, -71, 405, -44}, { 409, 370, 81, -186, -154}, + { 25, -102, -448, 124, -173}, { 22, 408, -110, -310, -214}, + { -26, 23, -83, 114, 14}, { -110, 164, 52, 223, -82}, + { 37, -25, -263, 306, -15}, { -466, 415, 292, 165, -18}, + { 29, -19, -171, 155, 182}, { 179, 144, -27, 231, 258}, + { -103, -247, -396, 238, 113}, { 375, -154, -109, -4, 156}, + { 98, 85, -292, -5, -124}, { 116, 139, -116, -98, -294}, + { -14, -83, -278, -117, -378}, { 106, 33, -106, -344, -484}, + { 119, 17, -412, 138, 166}, { 384, 101, -204, 88, -156}, + { -121, -284, -300, -1, -166}, { 280, 33, -152, -313, -81}, + { -37, 22, 229, 153, 37}, { -60, -83, 236, -8, -41}, + { -169, -228, 126, -20, 363}, { -235, 17, 364, -156, 156}, + { -25, -30, 72, 144, 156}, { 153, -26, 256, 97, 144}, + { -21, -37, 48, -65, 250}, { 63, 77, 273, -128, 124}, + { -129, -26, 40, 9, -115}, { -6, 82, 38, -90, -182}, + { -336, -13, 28, 158, 91}, { -30, 241, 137, -170, -17}, + { 146, 14, -11, 33, 61}, { 192, 197, 54, -84, 85}, + { 23, -200, -78, -29, 140}, { 122, 237, 106, -341, 136}, + { -57, -142, -85, -16, -74}, { -59, -90, -8, -187, -20}, + { -211, -267, 216, -179, -110}, { -50, -7, 220, -267, -70}, + { -57, -42, -17, -15, 71}, { 32, 21, 63, -137, 33}, + { -137, -175, 104, -68, 97}, { -67, -43, 133, -301, 221}, + { -116, -200, -81, -92, -272}, { -64, -41, -54, -244, -220}, + { -287, -242, -50, -87, -89}, { -245, 236, 102, -166, -295}, + { 66, 24, -162, -71, 95}, { 66, 136, -90, -220, -36}, + { -98, -161, -222, -188, 29}, { -18, 18, -19, -415, 9}, + { 49, 61, 100, 39, -56}, { -111, 82, 135, -31, 52}, + { -90, -153, -93, 189, 182}, { -214, 295, 119, -74, 284}, + { 2, 137, 37, 47, 182}, { 92, 117, 184, -53, 373}, + { -21, -14, -35, 136, 391}, { 146, 129, -164, -28, 333}, + { 92, 80, -84, 100, -134}, { -8, 217, -32, 3, -47}, + { -151, 251, -215, 142, 92}, { -224, 310, -172, -275, 98}, + { 159, 155, -177, 112, 53}, { 205, 27, 8, -240, 192}, + { 169, 120, -319, -201, 106}, { 11, 36, -86, -237, 455}, + { -109, -154, -163, 174, -55}, { -38, 32, -101, -78, -59}, + { -205, -321, -97, 69, 79}, { -310, 44, 18, -185, 34}, + { -115, -20, -148, -39, 203}, { -29, 154, -30, -158, 166}, + { -45, -131, -317, -24, 363}, { -165, -205, -112, -222, 265}, + { -32, -44, -150, 54, -193}, { -6, -38, -255, -169, -115}, + { -266, 87, -189, -36, -169}, { -60, -87, -266, -436, -170}, + { -68, -81, -278, 24, 38}, { -23, -19, -155, -256, 141}, + { -61, -226, -565, -175, 71}, { 9, -29, -237, -515, 263} +}; + +static const int16_t dico22_isf_36b[128][4] = { + { -298, -6, 95, 31}, { -213, -87, -122, 261}, + { 4, -49, 208, 14}, { -129, -110, 30, 118}, + { -214, 258, 110, -235}, { -41, -18, -126, 120}, + { 103, 65, 127, -37}, { 126, -36, -24, 25}, + { -138, -67, -278, -186}, { -164, -194, -201, 78}, + { -211, -87, -51, -221}, { -174, -79, -94, -39}, + { 23, -6, -157, -240}, { 22, -110, -153, -68}, + { 148, -5, -2, -149}, { -1, -135, -39, -179}, + { 68, 360, -117, -15}, { 137, 47, -278, 146}, + { 136, 260, 135, 65}, { 61, 116, -45, 97}, + { 231, 379, 87, -120}, { 338, 177, -272, 3}, + { 266, 156, 28, -69}, { 260, 84, -85, 86}, + { -266, 154, -256, -182}, { -17, -65, -304, -6}, + { -40, 175, -151, -180}, { -27, 27, -87, -63}, + { 121, 114, -166, -469}, { 159, -66, -323, -231}, + { 214, 152, -141, -212}, { 137, 36, -184, -51}, + { -282, -237, 40, 10}, { -48, -235, -37, 251}, + { -54, -323, 136, 29}, { -88, -174, 213, 198}, + { -390, 99, -63, -375}, { 107, -169, -164, 424}, + { 69, -111, 141, -167}, { 74, -129, 65, 144}, + { -353, -207, -205, -109}, { -160, -386, -355, 98}, + { -176, -493, -20, -143}, { -252, -432, -2, 216}, + { -90, -174, -168, -411}, { 13, -284, -229, -160}, + { -87, -279, 34, -251}, { -75, -263, -58, -42}, + { 420, 53, -211, -358}, { 384, -35, -374, 396}, + { 68, -228, 323, -2}, { 167, -307, 192, 194}, + { 459, 329, -5, -332}, { 375, 79, -7, 313}, + { 282, -124, 200, -92}, { 271, -162, -70, 180}, + { -157, -298, -514, -309}, { 58, -163, -546, 18}, + { 124, -364, 167, -238}, { 83, -411, -117, 96}, + { 140, -112, -388, -624}, { 259, -133, -317, 41}, + { 163, -130, -64, -334}, { 226, -165, -124, -110}, + { -466, -61, 6, 229}, { -153, 205, -145, 242}, + { -159, 48, 195, 148}, { -58, 28, 31, 279}, + { -303, 185, 279, -4}, { -61, 197, 59, 86}, + { -114, 123, 168, -52}, { 35, 36, 100, 126}, + { -407, 102, -77, -40}, { -338, -1, -342, 156}, + { -179, 105, -34, -97}, { -185, 84, -35, 108}, + { -133, 107, -91, -357}, { -180, 54, -229, 24}, + { -44, 47, 47, -182}, { -66, 13, 45, 4}, + { -339, 251, 64, 226}, { -42, 101, -350, 275}, + { -99, 398, 142, 121}, { 111, 12, -102, 260}, + { 0, 505, 260, -94}, { 161, 285, -96, 224}, + { -4, 206, 314, 33}, { 167, 139, 88, 204}, + { -235, 316, -60, -25}, { -8, -150, -312, 201}, + { -36, 292, 61, -104}, { -40, 174, -162, 42}, + { -21, 402, -29, -351}, { 21, 152, -360, -93}, + { 57, 191, 212, -196}, { 76, 158, -21, -69}, + { -328, -185, 331, 119}, { -53, 285, 56, 337}, + { -107, -24, 405, 29}, { -18, 137, 272, 277}, + { -255, 22, 173, -191}, { 295, 322, 325, 302}, + { 21, -27, 332, -178}, { 119, 13, 271, 129}, + { -455, -180, 116, -191}, { -227, 62, -148, 524}, + { -176, -287, 282, -157}, { -243, 13, 199, 430}, + { -59, -49, 115, -365}, { 72, -172, -137, 93}, + { -138, -126, 141, -84}, { 5, -124, 38, -20}, + { -258, 311, 601, 213}, { 94, 130, -61, 502}, + { -1, -157, 485, 313}, { 146, -74, 158, 345}, + { 276, 135, 280, -57}, { 490, 252, 99, 43}, + { 267, -74, 429, 105}, { 278, -23, 119, 94}, + { -542, 488, 257, -115}, { -84, -244, -438, 478}, + { -113, -545, 387, 101}, { -95, -306, 111, 498}, + { 95, 166, 22, -301}, { 420, -15, -58, -78}, + { 270, 29, 122, -282}, { 160, -240, 50, -38} +}; + +static const int16_t dico23_isf_36b[64][7] = { + { 81, -18, 68, -27, -122, -280, -4}, + { 45, -177, 209, -30, -136, -74, 131}, + { -44, 101, -75, -88, -48, -137, -54}, + { -245, -28, 63, -18, -112, -103, 58}, + { -79, -6, 220, -65, 114, -35, -50}, + { 109, -65, 143, -114, 129, 76, 125}, + { 166, 90, -61, -242, 186, -74, -43}, + { -46, -92, 49, -227, 24, -155, 39}, + { 67, 85, 99, -42, 53, -184, -281}, + { 142, -122, 0, 21, -142, -15, -17}, + { 223, 92, -21, -48, -82, -14, -167}, + { 51, -37, -243, -30, -90, 18, -56}, + { 54, 105, 74, 86, 69, 13, -101}, + { 196, 72, -89, 43, 65, 19, 39}, + { 121, 34, 131, -82, 25, 213, -156}, + { 101, -102, -136, -21, 57, 214, 22}, + { 36, -124, 205, 204, 58, -156, -83}, + { 83, -117, 137, 137, 85, 116, 44}, + { -92, -148, -68, 11, -102, -197, -220}, + { -76, -185, -58, 132, -26, -183, 85}, + { -7, -31, -2, 23, 205, -151, 10}, + { -27, -37, -5, -18, 292, 131, 1}, + { 117, -168, 9, -93, 80, -59, -125}, + { -182, -244, 98, -24, 135, -22, 94}, + { 221, 97, 106, 42, 43, -160, 83}, + { 25, -64, -21, 6, 14, -15, 154}, + { 126, 15, -140, 150, -10, -207, -114}, + { 79, -63, -211, -70, -28, -217, 165}, + { 46, 38, -22, 281, 132, -62, 109}, + { 112, 54, -112, -93, 208, 27, 296}, + { 115, 10, -147, 41, 216, 42, -276}, + { 50, -115, -254, 167, 117, -2, 61}, + { 17, 144, 34, -72, -186, -150, 272}, + { -29, -66, -89, -95, -149, 129, 251}, + { 122, 0, -50, -234, -91, 36, 26}, + { -105, -102, -88, -121, -236, -7, -11}, + { -204, 109, 5, -191, 105, -15, 163}, + { -80, 32, -24, -209, 41, 294, 70}, + { -106, -94, -204, -118, 120, -50, -37}, + { -82, -241, 46, -131, -29, 150, -55}, + { 33, 155, 120, -89, -8, 7, 62}, + { 213, 82, 61, 18, -161, 144, 152}, + { 30, 131, 65, -87, -255, -17, -107}, + { -8, 85, -64, 51, -162, 223, -53}, + { -134, 261, 69, -56, 218, 72, -111}, + { 2, 155, -113, -87, 49, 85, -28}, + { -163, 42, -1, -196, 7, 39, -245}, + { 14, -137, -79, 11, -160, 202, -293}, + { -94, 33, 208, 100, 56, -44, 326}, + { -78, -41, 232, 13, -142, 227, 80}, + { -16, -87, 201, 33, -133, 15, -183}, + { -58, -192, -47, 184, -128, 133, 99}, + { -205, 11, -155, 78, 52, 72, 141}, + { -246, 26, 99, 151, 59, 115, -64}, + { -79, -47, -16, -14, 6, 47, -43}, + { -72, -178, -27, 162, 112, 43, -174}, + { -175, 238, 186, 71, -54, -188, -76}, + { -225, 233, 39, -39, -158, 122, 44}, + { -26, 43, 84, 130, -93, -51, 22}, + { 3, 92, -150, 136, -182, -57, 97}, + { -131, 179, -78, 80, 91, -165, 90}, + { -2, 148, 15, 130, 65, 175, 117}, + { -138, 114, -137, 132, 3, -10, -186}, + { 140, -4, -37, 254, -62, 92, -109} +}; + +/** Means of ISF vectors in Q15 */ +static const int16_t isf_mean[LP_ORDER] = { + 738, 1326, 2336, 3578, 4596, 5662, 6711, 7730, + 8750, 9753, 10705, 11728, 12833, 13971, 15043, 4037 +}; + +/** Initialization tables for the processed ISF vector in Q15 */ +static const int16_t isf_init[LP_ORDER] = { + 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, + 9216, 10240, 11264, 12288, 13312, 14336, 15360, 3840 +}; + +/** ISF/ISP interpolation coefficients for each subframe */ +static const float isfp_inter[4] = { 0.45, 0.8, 0.96, 1.0 }; + +/** Coefficients for FIR interpolation of excitation vector + * at pitch lag resulting the adaptive codebook vector */ +static const float ac_inter[65] = { + 9.400024e-01, + 8.563843e-01, 6.322632e-01, 3.375854e-01, 5.908203e-02, + -1.310425e-01, -1.994019e-01, -1.585693e-01, -5.633545e-02, + 4.760742e-02, 1.067505e-01, 1.036987e-01, 5.206299e-02, + -1.519775e-02, -6.372070e-02, -7.366943e-02, -4.650879e-02, + -9.765625e-04, 3.820801e-02, 5.316162e-02, 4.003906e-02, + 9.338379e-03, -2.166748e-02, -3.778076e-02, -3.320312e-02, + -1.300049e-02, 1.068115e-02, 2.587891e-02, 2.630615e-02, + 1.379395e-02, -3.662109e-03, -1.678467e-02, -1.983643e-02, + -1.275635e-02, -5.493164e-04, 1.007080e-02, 1.409912e-02, + 1.068115e-02, 2.624512e-03, -5.371094e-03, -9.338379e-03, + -8.117676e-03, -3.173828e-03, 2.319336e-03, 5.615234e-03, + 5.554199e-03, 2.868652e-03, -6.103516e-04, -2.990723e-03, + -3.356934e-03, -2.014160e-03, -1.220703e-04, 1.342773e-03, + 1.708984e-03, 1.159668e-03, 2.441406e-04, -4.272461e-04, + -6.103516e-04, -4.272461e-04, -1.220703e-04, 6.103516e-05, + 1.220703e-04, 6.103516e-05, 0.000000e+00, 0.000000e+00 +}; + +/** [i][j] is the number of pulses present in track j at mode i */ +static const uint8_t pulses_nb_per_mode_tr[][4] = { + {1, 1, 0, 0}, {1, 1, 1, 1}, {2, 2, 2, 2}, + {3, 3, 2, 2}, {3, 3, 3, 3}, {4, 4, 4, 4}, + {5, 5, 4, 4}, {6, 6, 6, 6}, {6, 6, 6, 6} +}; + +/** Tables for decoding quantized gains { pitch (Q14), fixed factor (Q11) } */ +static const int16_t qua_gain_6b[64][2] = { + { 1566, 1332}, { 1577, 3557}, + { 3071, 6490}, { 4193, 10163}, + { 4496, 2534}, { 5019, 4488}, + { 5586, 15614}, { 5725, 1422}, + { 6453, 580}, { 6724, 6831}, + { 7657, 3527}, { 8072, 2099}, + { 8232, 5319}, { 8827, 8775}, + { 9740, 2868}, { 9856, 1465}, + { 10087, 12488}, { 10241, 4453}, + { 10859, 6618}, { 11321, 3587}, + { 11417, 1800}, { 11643, 2428}, + { 11718, 988}, { 12312, 5093}, + { 12523, 8413}, { 12574, 26214}, + { 12601, 3396}, { 13172, 1623}, + { 13285, 2423}, { 13418, 6087}, + { 13459, 12810}, { 13656, 3607}, + { 14111, 4521}, { 14144, 1229}, + { 14425, 1871}, { 14431, 7234}, + { 14445, 2834}, { 14628, 10036}, + { 14860, 17496}, { 15161, 3629}, + { 15209, 5819}, { 15299, 2256}, + { 15518, 4722}, { 15663, 1060}, + { 15759, 7972}, { 15939, 11964}, + { 16020, 2996}, { 16086, 1707}, + { 16521, 4254}, { 16576, 6224}, + { 16894, 2380}, { 16906, 681}, + { 17213, 8406}, { 17610, 3418}, + { 17895, 5269}, { 18168, 11748}, + { 18230, 1575}, { 18607, 32767}, + { 18728, 21684}, { 19137, 2543}, + { 19422, 6577}, { 19446, 4097}, + { 19450, 9056}, { 20371, 14885} +}; + +static const int16_t qua_gain_7b[128][2] = { + { 204, 441}, { 464, 1977}, + { 869, 1077}, { 1072, 3062}, + { 1281, 4759}, { 1647, 1539}, + { 1845, 7020}, { 1853, 634}, + { 1995, 2336}, { 2351, 15400}, + { 2661, 1165}, { 2702, 3900}, + { 2710, 10133}, { 3195, 1752}, + { 3498, 2624}, { 3663, 849}, + { 3984, 5697}, { 4214, 3399}, + { 4415, 1304}, { 4695, 2056}, + { 5376, 4558}, { 5386, 676}, + { 5518, 23554}, { 5567, 7794}, + { 5644, 3061}, { 5672, 1513}, + { 5957, 2338}, { 6533, 1060}, + { 6804, 5998}, { 6820, 1767}, + { 6937, 3837}, { 7277, 414}, + { 7305, 2665}, { 7466, 11304}, + { 7942, 794}, { 8007, 1982}, + { 8007, 1366}, { 8326, 3105}, + { 8336, 4810}, { 8708, 7954}, + { 8989, 2279}, { 9031, 1055}, + { 9247, 3568}, { 9283, 1631}, + { 9654, 6311}, { 9811, 2605}, + { 10120, 683}, { 10143, 4179}, + { 10245, 1946}, { 10335, 1218}, + { 10468, 9960}, { 10651, 3000}, + { 10951, 1530}, { 10969, 5290}, + { 11203, 2305}, { 11325, 3562}, + { 11771, 6754}, { 11839, 1849}, + { 11941, 4495}, { 11954, 1298}, + { 11975, 15223}, { 11977, 883}, + { 11986, 2842}, { 12438, 2141}, + { 12593, 3665}, { 12636, 8367}, + { 12658, 1594}, { 12886, 2628}, + { 12984, 4942}, { 13146, 1115}, + { 13224, 524}, { 13341, 3163}, + { 13399, 1923}, { 13549, 5961}, + { 13606, 1401}, { 13655, 2399}, + { 13782, 3909}, { 13868, 10923}, + { 14226, 1723}, { 14232, 2939}, + { 14278, 7528}, { 14439, 4598}, + { 14451, 984}, { 14458, 2265}, + { 14792, 1403}, { 14818, 3445}, + { 14899, 5709}, { 15017, 15362}, + { 15048, 1946}, { 15069, 2655}, + { 15405, 9591}, { 15405, 4079}, + { 15570, 7183}, { 15687, 2286}, + { 15691, 1624}, { 15699, 3068}, + { 15772, 5149}, { 15868, 1205}, + { 15970, 696}, { 16249, 3584}, + { 16338, 1917}, { 16424, 2560}, + { 16483, 4438}, { 16529, 6410}, + { 16620, 11966}, { 16839, 8780}, + { 17030, 3050}, { 17033, 18325}, + { 17092, 1568}, { 17123, 5197}, + { 17351, 2113}, { 17374, 980}, + { 17566, 26214}, { 17609, 3912}, + { 17639, 32767}, { 18151, 7871}, + { 18197, 2516}, { 18202, 5649}, + { 18679, 3283}, { 18930, 1370}, + { 19271, 13757}, { 19317, 4120}, + { 19460, 1973}, { 19654, 10018}, + { 19764, 6792}, { 19912, 5135}, + { 20040, 2841}, { 21234, 19833} +}; + +/** 4-tap moving average prediction coefficients in reverse order */ +static const float energy_pred_fac[4] = { 0.2, 0.3, 0.4, 0.5 }; + +/** impulse response filter tables converted to float from Q15 + * used for anti-sparseness processing */ +static const float ir_filter_str[64] = { + 6.159058e-01, 2.958069e-01, 9.979248e-02, -1.048889e-01, + 8.740234e-02, -1.599121e-01, 4.849243e-02, -4.141235e-02, + 1.831055e-02, 1.188049e-01, -4.568481e-02, -2.130127e-02, + 3.671265e-02, -1.601868e-01, 3.659058e-02, 1.639099e-01, + -4.541016e-02, -2.151489e-02, -8.810425e-02, 6.030273e-02, + 2.740479e-02, 2.200317e-02, -1.182861e-01, 1.289978e-01, + -1.560059e-01, 1.953125e-01, -3.149414e-02, -1.441956e-01, + 1.249084e-01, -1.328125e-01, 9.780884e-02, 6.500244e-02, + -6.091309e-02, -5.599976e-02, 8.081055e-02, -5.450439e-02, + -1.239014e-02, 1.748657e-02, 7.580566e-02, -1.101074e-01, + 9.579468e-02, -4.159546e-02, -7.830811e-02, 1.162109e-01, + -1.950073e-02, -6.259155e-02, -1.651001e-02, 7.250977e-02, + 1.199951e-01, -1.911011e-01, 4.370117e-02, -1.098938e-01, + 1.492004e-01, 1.129150e-02, 1.730347e-02, -3.549194e-02, + -8.709717e-02, 5.841064e-02, 1.190186e-03, -7.379150e-02, + 1.054077e-01, 9.078979e-02, -1.227112e-01, 1.047058e-01 +}; + +static const float ir_filter_mid[64] = { + 7.354126e-01, 3.192139e-01, -1.606140e-01, -2.328491e-02, + 6.250000e-02, -2.828979e-02, 5.349731e-02, -1.014099e-01, + 6.750488e-02, 1.989746e-02, -6.549072e-02, 7.589722e-02, + -1.080017e-01, 1.253967e-01, -6.430054e-02, -1.141357e-02, + -1.910400e-02, 1.303101e-01, -1.673889e-01, 6.820679e-02, + 5.670166e-02, -8.450317e-02, 2.270508e-02, 3.479004e-02, + -2.328491e-02, -4.928589e-02, 1.239014e-01, -1.395874e-01, + 9.100342e-02, -3.549194e-02, 2.230835e-02, -3.350830e-02, + 2.450562e-02, 5.096436e-03, -2.178955e-02, 1.849365e-02, + -1.708984e-02, 1.950073e-02, 1.312256e-03, -5.389404e-02, + 9.851074e-02, -8.489990e-02, 2.029419e-02, 2.328491e-02, + 7.110596e-03, -6.109619e-02, 3.939819e-02, 5.709839e-02, + -1.058960e-01, 3.149414e-02, 8.270264e-02, -1.232910e-01, + 1.105957e-01, -1.286011e-01, 1.614990e-01, -1.303101e-01, + 4.769897e-02, 3.295898e-03, -1.770020e-02, 5.010986e-02, + -7.501221e-02, 2.920532e-02, 1.660156e-02, 7.751465e-02 +}; + +static const float *ir_filters_lookup[2] = { + ir_filter_str, ir_filter_mid +}; + +/** High-pass filters coefficients for 31 Hz and 400 Hz cutoff */ +static const float hpf_zeros[2] = { -2.0, 1.0 }; +static const float hpf_31_poles[2] = { -1.978881836, 0.979125977 }; +static const float hpf_31_gain = 0.989501953; + +static const float hpf_400_poles[2] = { -1.787109375, 0.864257812 }; +static const float hpf_400_gain = 0.893554687; + +/** Interpolation coefficients for 5/4 signal upsampling + * Table from the reference source was reordered for efficiency */ +static const float upsample_fir[4][24] = { + { -6.103516e-05, 7.324219e-04, -2.014160e-03, 4.150391e-03, + -7.263184e-03, 1.165771e-02, -1.776123e-02, 2.624512e-02, + -3.869629e-02, 5.877686e-02, -9.863281e-02, 2.314453e-01, + 9.348755e-01, -1.523438e-01, 7.861328e-02, -4.937744e-02, + 3.308105e-02, -2.252197e-02, 1.507568e-02, -9.765625e-03, + 5.859375e-03, -3.173828e-03, 1.403809e-03, -3.662109e-04 }, + { -2.441406e-04, 1.464844e-03, -3.784180e-03, 7.568359e-03, + -1.300049e-02, 2.062988e-02, -3.112793e-02, 4.589844e-02, + -6.781006e-02, 1.042480e-01, -1.815186e-01, 5.016479e-01, + 7.548828e-01, -2.094727e-01, 1.148071e-01, -7.348633e-02, + 4.956055e-02, -3.369141e-02, 2.246094e-02, -1.434326e-02, + 8.483887e-03, -4.455566e-03, 1.831055e-03, -4.272461e-04 }, + { -4.272461e-04, 1.831055e-03, -4.455566e-03, 8.483887e-03, + -1.434326e-02, 2.246094e-02, -3.369141e-02, 4.956055e-02, + -7.348633e-02, 1.148071e-01, -2.094727e-01, 7.548828e-01, + 5.016479e-01, -1.815186e-01, 1.042480e-01, -6.781006e-02, + 4.589844e-02, -3.112793e-02, 2.062988e-02, -1.300049e-02, + 7.568359e-03, -3.784180e-03, 1.464844e-03, -2.441406e-04 }, + { -3.662109e-04, 1.403809e-03, -3.173828e-03, 5.859375e-03, + -9.765625e-03, 1.507568e-02, -2.252197e-02, 3.308105e-02, + -4.937744e-02, 7.861328e-02, -1.523438e-01, 9.348755e-01, + 2.314453e-01, -9.863281e-02, 5.877686e-02, -3.869629e-02, + 2.624512e-02, -1.776123e-02, 1.165771e-02, -7.263184e-03, + 4.150391e-03, -2.014160e-03, 7.324219e-04, -6.103516e-05 } +}; + +/** High band quantized gains for 23k85 in Q14 */ +static const uint16_t qua_hb_gain[16] = { + 3624, 4673, 5597, 6479, 7425, 8378, 9324, 10264, + 11210, 12206, 13391, 14844, 16770, 19655, 24289, 32728 +}; + +/** High-band post-processing FIR filters coefficients from Q15 */ +static const float bpf_6_7_coef[31] = { // band pass, 6kHz and 7kHz cutoffs + -2.441406e-04, 3.585815e-04, 2.441406e-04, + -2.059937e-04, -2.815248e-03, 8.560180e-03, + -1.084137e-02, 0.000000e+00, 2.897645e-02, + -6.774902e-02, 9.421540e-02, -8.380128e-02, + 2.706910e-02, 5.924987e-02, -1.373367e-01, + 1.687469e-01, + -1.373367e-01, 5.924987e-02, 2.706910e-02, + -8.380128e-02, 9.421540e-02, -6.774902e-02, + 2.897645e-02, 0.000000e+00, -1.084137e-02, + 8.560180e-03, -2.815248e-03, -2.059937e-04, + 2.441406e-04, 3.585815e-04, -2.441406e-04 +}; + +static const float lpf_7_coef[31] = { // low pass, 7kHz cutoff + -6.408691e-04, 1.434326e-03, -2.716064e-03, + 4.455566e-03, -6.195068e-03, 6.988525e-03, + -5.401611e-03, 0.000000e+00, 1.022339e-02, + -2.560425e-02, 4.531860e-02, -6.747437e-02, + 8.944702e-02, -1.080933e-01, 1.206360e-01, + 8.753052e-01, + 1.206360e-01, -1.080933e-01, 8.944702e-02, + -6.747437e-02, 4.531860e-02, -2.560425e-02, + 1.022339e-02, 0.000000e+00, -5.401611e-03, + 6.988525e-03, -6.195068e-03, 4.455566e-03, + -2.716064e-03, 1.434326e-03, -6.408691e-04 +}; + +/** Core frame sizes in each mode */ +static const uint16_t cf_sizes_wb[] = { + 132, 177, 253, 285, 317, 365, 397, 461, 477, + 40 /// SID/comfort noise frame +}; + +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amrwbdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amrwbdec.c new file mode 100644 index 00000000..8bf02a2b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/amrwbdec.c @@ -0,0 +1,1237 @@ +/* + * AMR wideband decoder + * Copyright (c) 2010 Marcelo Galvao Povoa + * + * 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 + * AMR wideband decoder + */ + +#include "libavutil/lfg.h" + +#include "avcodec.h" +#include "get_bits.h" +#include "lsp.h" +#include "celp_math.h" +#include "celp_filters.h" +#include "acelp_filters.h" +#include "acelp_vectors.h" +#include "acelp_pitch_delay.h" + +#define AMR_USE_16BIT_TABLES +#include "amr.h" + +#include "amrwbdata.h" + +typedef struct { + AMRWBFrame frame; ///< AMRWB parameters decoded from bitstream + enum Mode fr_cur_mode; ///< mode index of current frame + uint8_t fr_quality; ///< frame quality index (FQI) + float isf_cur[LP_ORDER]; ///< working ISF vector from current frame + float isf_q_past[LP_ORDER]; ///< quantized ISF vector of the previous frame + float isf_past_final[LP_ORDER]; ///< final processed ISF vector of the previous frame + double isp[4][LP_ORDER]; ///< ISP vectors from current frame + double isp_sub4_past[LP_ORDER]; ///< ISP vector for the 4th subframe of the previous frame + + float lp_coef[4][LP_ORDER]; ///< Linear Prediction Coefficients from ISP vector + + uint8_t base_pitch_lag; ///< integer part of pitch lag for the next relative subframe + uint8_t pitch_lag_int; ///< integer part of pitch lag of the previous subframe + + float excitation_buf[AMRWB_P_DELAY_MAX + LP_ORDER + 2 + AMRWB_SFR_SIZE]; ///< current excitation and all necessary excitation history + float *excitation; ///< points to current excitation in excitation_buf[] + + float pitch_vector[AMRWB_SFR_SIZE]; ///< adaptive codebook (pitch) vector for current subframe + float fixed_vector[AMRWB_SFR_SIZE]; ///< algebraic codebook (fixed) vector for current subframe + + float prediction_error[4]; ///< quantified prediction errors {20log10(^gamma_gc)} for previous four subframes + float pitch_gain[6]; ///< quantified pitch gains for the current and previous five subframes + float fixed_gain[2]; ///< quantified fixed gains for the current and previous subframes + + float tilt_coef; ///< {beta_1} related to the voicing of the previous subframe + + float prev_sparse_fixed_gain; ///< previous fixed gain; used by anti-sparseness to determine "onset" + uint8_t prev_ir_filter_nr; ///< previous impulse response filter "impNr": 0 - strong, 1 - medium, 2 - none + float prev_tr_gain; ///< previous initial gain used by noise enhancer for threshold + + float samples_az[LP_ORDER + AMRWB_SFR_SIZE]; ///< low-band samples and memory from synthesis at 12.8kHz + float samples_up[UPS_MEM_SIZE + AMRWB_SFR_SIZE]; ///< low-band samples and memory processed for upsampling + float samples_hb[LP_ORDER_16k + AMRWB_SFR_SIZE_16k]; ///< high-band samples and memory from synthesis at 16kHz + + float hpf_31_mem[2], hpf_400_mem[2]; ///< previous values in the high pass filters + float demph_mem[1]; ///< previous value in the de-emphasis filter + float bpf_6_7_mem[HB_FIR_SIZE]; ///< previous values in the high-band band pass filter + float lpf_7_mem[HB_FIR_SIZE]; ///< previous values in the high-band low pass filter + + AVLFG prng; ///< random number generator for white noise excitation + uint8_t first_frame; ///< flag active during decoding of the first frame +} AMRWBContext; + +static av_cold int amrwb_decode_init(AVCodecContext *avctx) +{ + AMRWBContext *ctx = avctx->priv_data; + int i; + + avctx->sample_fmt = SAMPLE_FMT_FLT; + + av_lfg_init(&ctx->prng, 1); + + ctx->excitation = &ctx->excitation_buf[AMRWB_P_DELAY_MAX + LP_ORDER + 1]; + ctx->first_frame = 1; + + for (i = 0; i < LP_ORDER; i++) + ctx->isf_past_final[i] = isf_init[i] * (1.0f / (1 << 15)); + + for (i = 0; i < 4; i++) + ctx->prediction_error[i] = MIN_ENERGY; + + return 0; +} + +/** + * Decode the frame header in the "MIME/storage" format. This format + * is simpler and does not carry the auxiliary information of the frame + * + * @param[in] ctx The Context + * @param[in] buf Pointer to the input buffer + * + * @return The decoded header length in bytes + */ +static int decode_mime_header(AMRWBContext *ctx, const uint8_t *buf) +{ + GetBitContext gb; + init_get_bits(&gb, buf, 8); + + /* Decode frame header (1st octet) */ + skip_bits(&gb, 1); // padding bit + ctx->fr_cur_mode = get_bits(&gb, 4); + ctx->fr_quality = get_bits1(&gb); + skip_bits(&gb, 2); // padding bits + + return 1; +} + +/** + * Decodes quantized ISF vectors using 36-bit indexes (6K60 mode only) + * + * @param[in] ind Array of 5 indexes + * @param[out] isf_q Buffer for isf_q[LP_ORDER] + * + */ +static void decode_isf_indices_36b(uint16_t *ind, float *isf_q) +{ + int i; + + for (i = 0; i < 9; i++) + isf_q[i] = dico1_isf[ind[0]][i] * (1.0f / (1 << 15)); + + for (i = 0; i < 7; i++) + isf_q[i + 9] = dico2_isf[ind[1]][i] * (1.0f / (1 << 15)); + + for (i = 0; i < 5; i++) + isf_q[i] += dico21_isf_36b[ind[2]][i] * (1.0f / (1 << 15)); + + for (i = 0; i < 4; i++) + isf_q[i + 5] += dico22_isf_36b[ind[3]][i] * (1.0f / (1 << 15)); + + for (i = 0; i < 7; i++) + isf_q[i + 9] += dico23_isf_36b[ind[4]][i] * (1.0f / (1 << 15)); +} + +/** + * Decodes quantized ISF vectors using 46-bit indexes (except 6K60 mode) + * + * @param[in] ind Array of 7 indexes + * @param[out] isf_q Buffer for isf_q[LP_ORDER] + * + */ +static void decode_isf_indices_46b(uint16_t *ind, float *isf_q) +{ + int i; + + for (i = 0; i < 9; i++) + isf_q[i] = dico1_isf[ind[0]][i] * (1.0f / (1 << 15)); + + for (i = 0; i < 7; i++) + isf_q[i + 9] = dico2_isf[ind[1]][i] * (1.0f / (1 << 15)); + + for (i = 0; i < 3; i++) + isf_q[i] += dico21_isf[ind[2]][i] * (1.0f / (1 << 15)); + + for (i = 0; i < 3; i++) + isf_q[i + 3] += dico22_isf[ind[3]][i] * (1.0f / (1 << 15)); + + for (i = 0; i < 3; i++) + isf_q[i + 6] += dico23_isf[ind[4]][i] * (1.0f / (1 << 15)); + + for (i = 0; i < 3; i++) + isf_q[i + 9] += dico24_isf[ind[5]][i] * (1.0f / (1 << 15)); + + for (i = 0; i < 4; i++) + isf_q[i + 12] += dico25_isf[ind[6]][i] * (1.0f / (1 << 15)); +} + +/** + * Apply mean and past ISF values using the prediction factor + * Updates past ISF vector + * + * @param[in,out] isf_q Current quantized ISF + * @param[in,out] isf_past Past quantized ISF + * + */ +static void isf_add_mean_and_past(float *isf_q, float *isf_past) +{ + int i; + float tmp; + + for (i = 0; i < LP_ORDER; i++) { + tmp = isf_q[i]; + isf_q[i] += isf_mean[i] * (1.0f / (1 << 15)); + isf_q[i] += PRED_FACTOR * isf_past[i]; + isf_past[i] = tmp; + } +} + +/** + * Interpolate the fourth ISP vector from current and past frames + * to obtain a ISP vector for each subframe + * + * @param[in,out] isp_q ISPs for each subframe + * @param[in] isp4_past Past ISP for subframe 4 + */ +static void interpolate_isp(double isp_q[4][LP_ORDER], const double *isp4_past) +{ + int i, k; + + for (k = 0; k < 3; k++) { + float c = isfp_inter[k]; + for (i = 0; i < LP_ORDER; i++) + isp_q[k][i] = (1.0 - c) * isp4_past[i] + c * isp_q[3][i]; + } +} + +/** + * Decode an adaptive codebook index into pitch lag (except 6k60, 8k85 modes) + * Calculate integer lag and fractional lag always using 1/4 resolution + * In 1st and 3rd subframes the index is relative to last subframe integer lag + * + * @param[out] lag_int Decoded integer pitch lag + * @param[out] lag_frac Decoded fractional pitch lag + * @param[in] pitch_index Adaptive codebook pitch index + * @param[in,out] base_lag_int Base integer lag used in relative subframes + * @param[in] subframe Current subframe index (0 to 3) + */ +static void decode_pitch_lag_high(int *lag_int, int *lag_frac, int pitch_index, + uint8_t *base_lag_int, int subframe) +{ + if (subframe == 0 || subframe == 2) { + if (pitch_index < 376) { + *lag_int = (pitch_index + 137) >> 2; + *lag_frac = pitch_index - (*lag_int << 2) + 136; + } else if (pitch_index < 440) { + *lag_int = (pitch_index + 257 - 376) >> 1; + *lag_frac = (pitch_index - (*lag_int << 1) + 256 - 376) << 1; + /* the actual resolution is 1/2 but expressed as 1/4 */ + } else { + *lag_int = pitch_index - 280; + *lag_frac = 0; + } + /* minimum lag for next subframe */ + *base_lag_int = av_clip(*lag_int - 8 - (*lag_frac < 0), + AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15); + // XXX: the spec states clearly that *base_lag_int should be + // the nearest integer to *lag_int (minus 8), but the ref code + // actually always uses its floor, I'm following the latter + } else { + *lag_int = (pitch_index + 1) >> 2; + *lag_frac = pitch_index - (*lag_int << 2); + *lag_int += *base_lag_int; + } +} + +/** + * Decode a adaptive codebook index into pitch lag for 8k85 and 6k60 modes + * Description is analogous to decode_pitch_lag_high, but in 6k60 relative + * index is used for all subframes except the first + */ +static void decode_pitch_lag_low(int *lag_int, int *lag_frac, int pitch_index, + uint8_t *base_lag_int, int subframe, enum Mode mode) +{ + if (subframe == 0 || (subframe == 2 && mode != MODE_6k60)) { + if (pitch_index < 116) { + *lag_int = (pitch_index + 69) >> 1; + *lag_frac = (pitch_index - (*lag_int << 1) + 68) << 1; + } else { + *lag_int = pitch_index - 24; + *lag_frac = 0; + } + // XXX: same problem as before + *base_lag_int = av_clip(*lag_int - 8 - (*lag_frac < 0), + AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15); + } else { + *lag_int = (pitch_index + 1) >> 1; + *lag_frac = (pitch_index - (*lag_int << 1)) << 1; + *lag_int += *base_lag_int; + } +} + +/** + * Find the pitch vector by interpolating the past excitation at the + * pitch delay, which is obtained in this function + * + * @param[in,out] ctx The context + * @param[in] amr_subframe Current subframe data + * @param[in] subframe Current subframe index (0 to 3) + */ +static void decode_pitch_vector(AMRWBContext *ctx, + const AMRWBSubFrame *amr_subframe, + const int subframe) +{ + int pitch_lag_int, pitch_lag_frac; + int i; + float *exc = ctx->excitation; + enum Mode mode = ctx->fr_cur_mode; + + if (mode <= MODE_8k85) { + decode_pitch_lag_low(&pitch_lag_int, &pitch_lag_frac, amr_subframe->adap, + &ctx->base_pitch_lag, subframe, mode); + } else + decode_pitch_lag_high(&pitch_lag_int, &pitch_lag_frac, amr_subframe->adap, + &ctx->base_pitch_lag, subframe); + + ctx->pitch_lag_int = pitch_lag_int; + pitch_lag_int += pitch_lag_frac > 0; + + /* Calculate the pitch vector by interpolating the past excitation at the + pitch lag using a hamming windowed sinc function */ + ff_acelp_interpolatef(exc, exc + 1 - pitch_lag_int, + ac_inter, 4, + pitch_lag_frac + (pitch_lag_frac > 0 ? 0 : 4), + LP_ORDER, AMRWB_SFR_SIZE + 1); + + /* Check which pitch signal path should be used + * 6k60 and 8k85 modes have the ltp flag set to 0 */ + if (amr_subframe->ltp) { + memcpy(ctx->pitch_vector, exc, AMRWB_SFR_SIZE * sizeof(float)); + } else { + for (i = 0; i < AMRWB_SFR_SIZE; i++) + ctx->pitch_vector[i] = 0.18 * exc[i - 1] + 0.64 * exc[i] + + 0.18 * exc[i + 1]; + memcpy(exc, ctx->pitch_vector, AMRWB_SFR_SIZE * sizeof(float)); + } +} + +/** Get x bits in the index interval [lsb,lsb+len-1] inclusive */ +#define BIT_STR(x,lsb,len) (((x) >> (lsb)) & ((1 << (len)) - 1)) + +/** Get the bit at specified position */ +#define BIT_POS(x, p) (((x) >> (p)) & 1) + +/** + * The next six functions decode_[i]p_track decode exactly i pulses + * positions and amplitudes (-1 or 1) in a subframe track using + * an encoded pulse indexing (TS 26.190 section 5.8.2) + * + * The results are given in out[], in which a negative number means + * amplitude -1 and vice versa (i.e., ampl(x) = x / abs(x) ) + * + * @param[out] out Output buffer (writes i elements) + * @param[in] code Pulse index (no. of bits varies, see below) + * @param[in] m (log2) Number of potential positions + * @param[in] off Offset for decoded positions + */ +static inline void decode_1p_track(int *out, int code, int m, int off) +{ + int pos = BIT_STR(code, 0, m) + off; ///code: m+1 bits + + out[0] = BIT_POS(code, m) ? -pos : pos; +} + +static inline void decode_2p_track(int *out, int code, int m, int off) ///code: 2m+1 bits +{ + int pos0 = BIT_STR(code, m, m) + off; + int pos1 = BIT_STR(code, 0, m) + off; + + out[0] = BIT_POS(code, 2*m) ? -pos0 : pos0; + out[1] = BIT_POS(code, 2*m) ? -pos1 : pos1; + out[1] = pos0 > pos1 ? -out[1] : out[1]; +} + +static void decode_3p_track(int *out, int code, int m, int off) ///code: 3m+1 bits +{ + int half_2p = BIT_POS(code, 2*m - 1) << (m - 1); + + decode_2p_track(out, BIT_STR(code, 0, 2*m - 1), + m - 1, off + half_2p); + decode_1p_track(out + 2, BIT_STR(code, 2*m, m + 1), m, off); +} + +static void decode_4p_track(int *out, int code, int m, int off) ///code: 4m bits +{ + int half_4p, subhalf_2p; + int b_offset = 1 << (m - 1); + + switch (BIT_STR(code, 4*m - 2, 2)) { /* case ID (2 bits) */ + case 0: /* 0 pulses in A, 4 pulses in B or vice versa */ + half_4p = BIT_POS(code, 4*m - 3) << (m - 1); // which has 4 pulses + subhalf_2p = BIT_POS(code, 2*m - 3) << (m - 2); + + decode_2p_track(out, BIT_STR(code, 0, 2*m - 3), + m - 2, off + half_4p + subhalf_2p); + decode_2p_track(out + 2, BIT_STR(code, 2*m - 2, 2*m - 1), + m - 1, off + half_4p); + break; + case 1: /* 1 pulse in A, 3 pulses in B */ + decode_1p_track(out, BIT_STR(code, 3*m - 2, m), + m - 1, off); + decode_3p_track(out + 1, BIT_STR(code, 0, 3*m - 2), + m - 1, off + b_offset); + break; + case 2: /* 2 pulses in each half */ + decode_2p_track(out, BIT_STR(code, 2*m - 1, 2*m - 1), + m - 1, off); + decode_2p_track(out + 2, BIT_STR(code, 0, 2*m - 1), + m - 1, off + b_offset); + break; + case 3: /* 3 pulses in A, 1 pulse in B */ + decode_3p_track(out, BIT_STR(code, m, 3*m - 2), + m - 1, off); + decode_1p_track(out + 3, BIT_STR(code, 0, m), + m - 1, off + b_offset); + break; + } +} + +static void decode_5p_track(int *out, int code, int m, int off) ///code: 5m bits +{ + int half_3p = BIT_POS(code, 5*m - 1) << (m - 1); + + decode_3p_track(out, BIT_STR(code, 2*m + 1, 3*m - 2), + m - 1, off + half_3p); + + decode_2p_track(out + 3, BIT_STR(code, 0, 2*m + 1), m, off); +} + +static void decode_6p_track(int *out, int code, int m, int off) ///code: 6m-2 bits +{ + int b_offset = 1 << (m - 1); + /* which half has more pulses in cases 0 to 2 */ + int half_more = BIT_POS(code, 6*m - 5) << (m - 1); + int half_other = b_offset - half_more; + + switch (BIT_STR(code, 6*m - 4, 2)) { /* case ID (2 bits) */ + case 0: /* 0 pulses in A, 6 pulses in B or vice versa */ + decode_1p_track(out, BIT_STR(code, 0, m), + m - 1, off + half_more); + decode_5p_track(out + 1, BIT_STR(code, m, 5*m - 5), + m - 1, off + half_more); + break; + case 1: /* 1 pulse in A, 5 pulses in B or vice versa */ + decode_1p_track(out, BIT_STR(code, 0, m), + m - 1, off + half_other); + decode_5p_track(out + 1, BIT_STR(code, m, 5*m - 5), + m - 1, off + half_more); + break; + case 2: /* 2 pulses in A, 4 pulses in B or vice versa */ + decode_2p_track(out, BIT_STR(code, 0, 2*m - 1), + m - 1, off + half_other); + decode_4p_track(out + 2, BIT_STR(code, 2*m - 1, 4*m - 4), + m - 1, off + half_more); + break; + case 3: /* 3 pulses in A, 3 pulses in B */ + decode_3p_track(out, BIT_STR(code, 3*m - 2, 3*m - 2), + m - 1, off); + decode_3p_track(out + 3, BIT_STR(code, 0, 3*m - 2), + m - 1, off + b_offset); + break; + } +} + +/** + * Decode the algebraic codebook index to pulse positions and signs, + * then construct the algebraic codebook vector + * + * @param[out] fixed_vector Buffer for the fixed codebook excitation + * @param[in] pulse_hi MSBs part of the pulse index array (higher modes only) + * @param[in] pulse_lo LSBs part of the pulse index array + * @param[in] mode Mode of the current frame + */ +static void decode_fixed_vector(float *fixed_vector, const uint16_t *pulse_hi, + const uint16_t *pulse_lo, const enum Mode mode) +{ + /* sig_pos stores for each track the decoded pulse position indexes + * (1-based) multiplied by its corresponding amplitude (+1 or -1) */ + int sig_pos[4][6]; + int spacing = (mode == MODE_6k60) ? 2 : 4; + int i, j; + + switch (mode) { + case MODE_6k60: + for (i = 0; i < 2; i++) + decode_1p_track(sig_pos[i], pulse_lo[i], 5, 1); + break; + case MODE_8k85: + for (i = 0; i < 4; i++) + decode_1p_track(sig_pos[i], pulse_lo[i], 4, 1); + break; + case MODE_12k65: + for (i = 0; i < 4; i++) + decode_2p_track(sig_pos[i], pulse_lo[i], 4, 1); + break; + case MODE_14k25: + for (i = 0; i < 2; i++) + decode_3p_track(sig_pos[i], pulse_lo[i], 4, 1); + for (i = 2; i < 4; i++) + decode_2p_track(sig_pos[i], pulse_lo[i], 4, 1); + break; + case MODE_15k85: + for (i = 0; i < 4; i++) + decode_3p_track(sig_pos[i], pulse_lo[i], 4, 1); + break; + case MODE_18k25: + for (i = 0; i < 4; i++) + decode_4p_track(sig_pos[i], (int) pulse_lo[i] + + ((int) pulse_hi[i] << 14), 4, 1); + break; + case MODE_19k85: + for (i = 0; i < 2; i++) + decode_5p_track(sig_pos[i], (int) pulse_lo[i] + + ((int) pulse_hi[i] << 10), 4, 1); + for (i = 2; i < 4; i++) + decode_4p_track(sig_pos[i], (int) pulse_lo[i] + + ((int) pulse_hi[i] << 14), 4, 1); + break; + case MODE_23k05: + case MODE_23k85: + for (i = 0; i < 4; i++) + decode_6p_track(sig_pos[i], (int) pulse_lo[i] + + ((int) pulse_hi[i] << 11), 4, 1); + break; + } + + memset(fixed_vector, 0, sizeof(float) * AMRWB_SFR_SIZE); + + for (i = 0; i < 4; i++) + for (j = 0; j < pulses_nb_per_mode_tr[mode][i]; j++) { + int pos = (FFABS(sig_pos[i][j]) - 1) * spacing + i; + + fixed_vector[pos] += sig_pos[i][j] < 0 ? -1.0 : 1.0; + } +} + +/** + * Decode pitch gain and fixed gain correction factor + * + * @param[in] vq_gain Vector-quantized index for gains + * @param[in] mode Mode of the current frame + * @param[out] fixed_gain_factor Decoded fixed gain correction factor + * @param[out] pitch_gain Decoded pitch gain + */ +static void decode_gains(const uint8_t vq_gain, const enum Mode mode, + float *fixed_gain_factor, float *pitch_gain) +{ + const int16_t *gains = (mode <= MODE_8k85 ? qua_gain_6b[vq_gain] : + qua_gain_7b[vq_gain]); + + *pitch_gain = gains[0] * (1.0f / (1 << 14)); + *fixed_gain_factor = gains[1] * (1.0f / (1 << 11)); +} + +/** + * Apply pitch sharpening filters to the fixed codebook vector + * + * @param[in] ctx The context + * @param[in,out] fixed_vector Fixed codebook excitation + */ +// XXX: Spec states this procedure should be applied when the pitch +// lag is less than 64, but this checking seems absent in reference and AMR-NB +static void pitch_sharpening(AMRWBContext *ctx, float *fixed_vector) +{ + int i; + + /* Tilt part */ + for (i = AMRWB_SFR_SIZE - 1; i != 0; i--) + fixed_vector[i] -= fixed_vector[i - 1] * ctx->tilt_coef; + + /* Periodicity enhancement part */ + for (i = ctx->pitch_lag_int; i < AMRWB_SFR_SIZE; i++) + fixed_vector[i] += fixed_vector[i - ctx->pitch_lag_int] * 0.85; +} + +/** + * Calculate the voicing factor (-1.0 = unvoiced to 1.0 = voiced) + * + * @param[in] p_vector, f_vector Pitch and fixed excitation vectors + * @param[in] p_gain, f_gain Pitch and fixed gains + */ +// XXX: There is something wrong with the precision here! The magnitudes +// of the energies are not correct. Please check the reference code carefully +static float voice_factor(float *p_vector, float p_gain, + float *f_vector, float f_gain) +{ + double p_ener = (double) ff_dot_productf(p_vector, p_vector, + AMRWB_SFR_SIZE) * p_gain * p_gain; + double f_ener = (double) ff_dot_productf(f_vector, f_vector, + AMRWB_SFR_SIZE) * f_gain * f_gain; + + return (p_ener - f_ener) / (p_ener + f_ener); +} + +/** + * Reduce fixed vector sparseness by smoothing with one of three IR filters + * Also known as "adaptive phase dispersion" + * + * @param[in] ctx The context + * @param[in,out] fixed_vector Unfiltered fixed vector + * @param[out] buf Space for modified vector if necessary + * + * @return The potentially overwritten filtered fixed vector address + */ +static float *anti_sparseness(AMRWBContext *ctx, + float *fixed_vector, float *buf) +{ + int ir_filter_nr; + + if (ctx->fr_cur_mode > MODE_8k85) // no filtering in higher modes + return fixed_vector; + + if (ctx->pitch_gain[0] < 0.6) { + ir_filter_nr = 0; // strong filtering + } else if (ctx->pitch_gain[0] < 0.9) { + ir_filter_nr = 1; // medium filtering + } else + ir_filter_nr = 2; // no filtering + + /* detect 'onset' */ + if (ctx->fixed_gain[0] > 3.0 * ctx->fixed_gain[1]) { + if (ir_filter_nr < 2) + ir_filter_nr++; + } else { + int i, count = 0; + + for (i = 0; i < 6; i++) + if (ctx->pitch_gain[i] < 0.6) + count++; + + if (count > 2) + ir_filter_nr = 0; + + if (ir_filter_nr > ctx->prev_ir_filter_nr + 1) + ir_filter_nr--; + } + + /* update ir filter strength history */ + ctx->prev_ir_filter_nr = ir_filter_nr; + + ir_filter_nr += (ctx->fr_cur_mode == MODE_8k85); + + if (ir_filter_nr < 2) { + int i; + const float *coef = ir_filters_lookup[ir_filter_nr]; + + /* Circular convolution code in the reference + * decoder was modified to avoid using one + * extra array. The filtered vector is given by: + * + * c2(n) = sum(i,0,len-1){ c(i) * coef( (n - i + len) % len ) } + */ + + memset(buf, 0, sizeof(float) * AMRWB_SFR_SIZE); + for (i = 0; i < AMRWB_SFR_SIZE; i++) + if (fixed_vector[i]) + ff_celp_circ_addf(buf, buf, coef, i, fixed_vector[i], + AMRWB_SFR_SIZE); + fixed_vector = buf; + } + + return fixed_vector; +} + +/** + * Calculate a stability factor {teta} based on distance between + * current and past isf. A value of 1 shows maximum signal stability + */ +static float stability_factor(const float *isf, const float *isf_past) +{ + int i; + float acc = 0.0; + + for (i = 0; i < LP_ORDER - 1; i++) + acc += (isf[i] - isf_past[i]) * (isf[i] - isf_past[i]); + + // XXX: This part is not so clear from the reference code + // the result is more accurate changing the "/ 256" to "* 512" + return FFMAX(0.0, 1.25 - acc * 0.8 * 512); +} + +/** + * Apply a non-linear fixed gain smoothing in order to reduce + * fluctuation in the energy of excitation + * + * @param[in] fixed_gain Unsmoothed fixed gain + * @param[in,out] prev_tr_gain Previous threshold gain (updated) + * @param[in] voice_fac Frame voicing factor + * @param[in] stab_fac Frame stability factor + * + * @return The smoothed gain + */ +static float noise_enhancer(float fixed_gain, float *prev_tr_gain, + float voice_fac, float stab_fac) +{ + float sm_fac = 0.5 * (1 - voice_fac) * stab_fac; + float g0; + + // XXX: the following fixed-point constants used to in(de)crement + // gain by 1.5dB were taken from the reference code, maybe it could + // be simpler + if (fixed_gain < *prev_tr_gain) { + g0 = FFMIN(*prev_tr_gain, fixed_gain + fixed_gain * + (6226 * (1.0f / (1 << 15)))); // +1.5 dB + } else + g0 = FFMAX(*prev_tr_gain, fixed_gain * + (27536 * (1.0f / (1 << 15)))); // -1.5 dB + + *prev_tr_gain = g0; // update next frame threshold + + return sm_fac * g0 + (1 - sm_fac) * fixed_gain; +} + +/** + * Filter the fixed_vector to emphasize the higher frequencies + * + * @param[in,out] fixed_vector Fixed codebook vector + * @param[in] voice_fac Frame voicing factor + */ +static void pitch_enhancer(float *fixed_vector, float voice_fac) +{ + int i; + float cpe = 0.125 * (1 + voice_fac); + float last = fixed_vector[0]; // holds c(i - 1) + + fixed_vector[0] -= cpe * fixed_vector[1]; + + for (i = 1; i < AMRWB_SFR_SIZE - 1; i++) { + float cur = fixed_vector[i]; + + fixed_vector[i] -= cpe * (last + fixed_vector[i + 1]); + last = cur; + } + + fixed_vector[AMRWB_SFR_SIZE - 1] -= cpe * last; +} + +/** + * Conduct 16th order linear predictive coding synthesis from excitation + * + * @param[in] ctx Pointer to the AMRWBContext + * @param[in] lpc Pointer to the LPC coefficients + * @param[out] excitation Buffer for synthesis final excitation + * @param[in] fixed_gain Fixed codebook gain for synthesis + * @param[in] fixed_vector Algebraic codebook vector + * @param[in,out] samples Pointer to the output samples and memory + */ +static void synthesis(AMRWBContext *ctx, float *lpc, float *excitation, + float fixed_gain, const float *fixed_vector, + float *samples) +{ + ff_weighted_vector_sumf(excitation, ctx->pitch_vector, fixed_vector, + ctx->pitch_gain[0], fixed_gain, AMRWB_SFR_SIZE); + + /* emphasize pitch vector contribution in low bitrate modes */ + if (ctx->pitch_gain[0] > 0.5 && ctx->fr_cur_mode <= MODE_8k85) { + int i; + float energy = ff_dot_productf(excitation, excitation, + AMRWB_SFR_SIZE); + + // XXX: Weird part in both ref code and spec. A unknown parameter + // {beta} seems to be identical to the current pitch gain + float pitch_factor = 0.25 * ctx->pitch_gain[0] * ctx->pitch_gain[0]; + + for (i = 0; i < AMRWB_SFR_SIZE; i++) + excitation[i] += pitch_factor * ctx->pitch_vector[i]; + + ff_scale_vector_to_given_sum_of_squares(excitation, excitation, + energy, AMRWB_SFR_SIZE); + } + + ff_celp_lp_synthesis_filterf(samples, lpc, excitation, + AMRWB_SFR_SIZE, LP_ORDER); +} + +/** + * Apply to synthesis a de-emphasis filter of the form: + * H(z) = 1 / (1 - m * z^-1) + * + * @param[out] out Output buffer + * @param[in] in Input samples array with in[-1] + * @param[in] m Filter coefficient + * @param[in,out] mem State from last filtering + */ +static void de_emphasis(float *out, float *in, float m, float mem[1]) +{ + int i; + + out[0] = in[0] + m * mem[0]; + + for (i = 1; i < AMRWB_SFR_SIZE; i++) + out[i] = in[i] + out[i - 1] * m; + + mem[0] = out[AMRWB_SFR_SIZE - 1]; +} + +/** + * Upsample a signal by 5/4 ratio (from 12.8kHz to 16kHz) using + * a FIR interpolation filter. Uses past data from before *in address + * + * @param[out] out Buffer for interpolated signal + * @param[in] in Current signal data (length 0.8*o_size) + * @param[in] o_size Output signal length + */ +static void upsample_5_4(float *out, const float *in, int o_size) +{ + const float *in0 = in - UPS_FIR_SIZE + 1; + int i, j, k; + int int_part = 0, frac_part; + + i = 0; + for (j = 0; j < o_size / 5; j++) { + out[i] = in[int_part]; + frac_part = 4; + i++; + + for (k = 1; k < 5; k++) { + out[i] = ff_dot_productf(in0 + int_part, upsample_fir[4 - frac_part], + UPS_MEM_SIZE); + int_part++; + frac_part--; + i++; + } + } +} + +/** + * Calculate the high-band gain based on encoded index (23k85 mode) or + * on the low-band speech signal and the Voice Activity Detection flag + * + * @param[in] ctx The context + * @param[in] synth LB speech synthesis at 12.8k + * @param[in] hb_idx Gain index for mode 23k85 only + * @param[in] vad VAD flag for the frame + */ +static float find_hb_gain(AMRWBContext *ctx, const float *synth, + uint16_t hb_idx, uint8_t vad) +{ + int wsp = (vad > 0); + float tilt; + + if (ctx->fr_cur_mode == MODE_23k85) + return qua_hb_gain[hb_idx] * (1.0f / (1 << 14)); + + tilt = ff_dot_productf(synth, synth + 1, AMRWB_SFR_SIZE - 1) / + ff_dot_productf(synth, synth, AMRWB_SFR_SIZE); + + /* return gain bounded by [0.1, 1.0] */ + return av_clipf((1.0 - FFMAX(0.0, tilt)) * (1.25 - 0.25 * wsp), 0.1, 1.0); +} + +/** + * Generate the high-band excitation with the same energy from the lower + * one and scaled by the given gain + * + * @param[in] ctx The context + * @param[out] hb_exc Buffer for the excitation + * @param[in] synth_exc Low-band excitation used for synthesis + * @param[in] hb_gain Wanted excitation gain + */ +static void scaled_hb_excitation(AMRWBContext *ctx, float *hb_exc, + const float *synth_exc, float hb_gain) +{ + int i; + float energy = ff_dot_productf(synth_exc, synth_exc, AMRWB_SFR_SIZE); + + /* Generate a white-noise excitation */ + for (i = 0; i < AMRWB_SFR_SIZE_16k; i++) + hb_exc[i] = 32768.0 - (uint16_t) av_lfg_get(&ctx->prng); + + ff_scale_vector_to_given_sum_of_squares(hb_exc, hb_exc, + energy * hb_gain * hb_gain, + AMRWB_SFR_SIZE_16k); +} + +/** + * Calculate the auto-correlation for the ISF difference vector + */ +static float auto_correlation(float *diff_isf, float mean, int lag) +{ + int i; + float sum = 0.0; + + for (i = 7; i < LP_ORDER - 2; i++) { + float prod = (diff_isf[i] - mean) * (diff_isf[i - lag] - mean); + sum += prod * prod; + } + return sum; +} + +/** + * Extrapolate a ISF vector to the 16kHz range (20th order LP) + * used at mode 6k60 LP filter for the high frequency band + * + * @param[out] out Buffer for extrapolated isf + * @param[in] isf Input isf vector + */ +static void extrapolate_isf(float out[LP_ORDER_16k], float isf[LP_ORDER]) +{ + float diff_isf[LP_ORDER - 2], diff_mean; + float *diff_hi = diff_isf - LP_ORDER + 1; // diff array for extrapolated indexes + float corr_lag[3]; + float est, scale; + int i, i_max_corr; + + memcpy(out, isf, (LP_ORDER - 1) * sizeof(float)); + out[LP_ORDER_16k - 1] = isf[LP_ORDER - 1]; + + /* Calculate the difference vector */ + for (i = 0; i < LP_ORDER - 2; i++) + diff_isf[i] = isf[i + 1] - isf[i]; + + diff_mean = 0.0; + for (i = 2; i < LP_ORDER - 2; i++) + diff_mean += diff_isf[i] * (1.0f / (LP_ORDER - 4)); + + /* Find which is the maximum autocorrelation */ + i_max_corr = 0; + for (i = 0; i < 3; i++) { + corr_lag[i] = auto_correlation(diff_isf, diff_mean, i + 2); + + if (corr_lag[i] > corr_lag[i_max_corr]) + i_max_corr = i; + } + i_max_corr++; + + for (i = LP_ORDER - 1; i < LP_ORDER_16k - 1; i++) + out[i] = isf[i - 1] + isf[i - 1 - i_max_corr] + - isf[i - 2 - i_max_corr]; + + /* Calculate an estimate for ISF(18) and scale ISF based on the error */ + est = 7965 + (out[2] - out[3] - out[4]) / 6.0; + scale = 0.5 * (FFMIN(est, 7600) - out[LP_ORDER - 2]) / + (out[LP_ORDER_16k - 2] - out[LP_ORDER - 2]); + + for (i = LP_ORDER - 1; i < LP_ORDER_16k - 1; i++) + diff_hi[i] = scale * (out[i] - out[i - 1]); + + /* Stability insurance */ + for (i = LP_ORDER; i < LP_ORDER_16k - 1; i++) + if (diff_hi[i] + diff_hi[i - 1] < 5.0) { + if (diff_hi[i] > diff_hi[i - 1]) { + diff_hi[i - 1] = 5.0 - diff_hi[i]; + } else + diff_hi[i] = 5.0 - diff_hi[i - 1]; + } + + for (i = LP_ORDER - 1; i < LP_ORDER_16k - 1; i++) + out[i] = out[i - 1] + diff_hi[i] * (1.0f / (1 << 15)); + + /* Scale the ISF vector for 16000 Hz */ + for (i = 0; i < LP_ORDER_16k - 1; i++) + out[i] *= 0.8; +} + +/** + * Spectral expand the LP coefficients using the equation: + * y[i] = x[i] * (gamma ** i) + * + * @param[out] out Output buffer (may use input array) + * @param[in] lpc LP coefficients array + * @param[in] gamma Weighting factor + * @param[in] size LP array size + */ +static void lpc_weighting(float *out, const float *lpc, float gamma, int size) +{ + int i; + float fac = gamma; + + for (i = 0; i < size; i++) { + out[i] = lpc[i] * fac; + fac *= gamma; + } +} + +/** + * Conduct 20th order linear predictive coding synthesis for the high + * frequency band excitation at 16kHz + * + * @param[in] ctx The context + * @param[in] subframe Current subframe index (0 to 3) + * @param[in,out] samples Pointer to the output speech samples + * @param[in] exc Generated white-noise scaled excitation + * @param[in] isf Current frame isf vector + * @param[in] isf_past Past frame final isf vector + */ +static void hb_synthesis(AMRWBContext *ctx, int subframe, float *samples, + const float *exc, const float *isf, const float *isf_past) +{ + float hb_lpc[LP_ORDER_16k]; + enum Mode mode = ctx->fr_cur_mode; + + if (mode == MODE_6k60) { + float e_isf[LP_ORDER_16k]; // ISF vector for extrapolation + double e_isp[LP_ORDER_16k]; + + ff_weighted_vector_sumf(e_isf, isf_past, isf, isfp_inter[subframe], + 1.0 - isfp_inter[subframe], LP_ORDER); + + extrapolate_isf(e_isf, e_isf); + + e_isf[LP_ORDER_16k - 1] *= 2.0; + ff_acelp_lsf2lspd(e_isp, e_isf, LP_ORDER_16k); + ff_amrwb_lsp2lpc(e_isp, hb_lpc, LP_ORDER_16k); + + lpc_weighting(hb_lpc, hb_lpc, 0.9, LP_ORDER_16k); + } else { + lpc_weighting(hb_lpc, ctx->lp_coef[subframe], 0.6, LP_ORDER); + } + + ff_celp_lp_synthesis_filterf(samples, hb_lpc, exc, AMRWB_SFR_SIZE_16k, + (mode == MODE_6k60) ? LP_ORDER_16k : LP_ORDER); +} + +/** + * Apply to high-band samples a 15th order filter + * The filter characteristic depends on the given coefficients + * + * @param[out] out Buffer for filtered output + * @param[in] fir_coef Filter coefficients + * @param[in,out] mem State from last filtering (updated) + * @param[in] in Input speech data (high-band) + * + * @remark It is safe to pass the same array in in and out parameters + */ +static void hb_fir_filter(float *out, const float fir_coef[HB_FIR_SIZE + 1], + float mem[HB_FIR_SIZE], const float *in) +{ + int i, j; + float data[AMRWB_SFR_SIZE_16k + HB_FIR_SIZE]; // past and current samples + + memcpy(data, mem, HB_FIR_SIZE * sizeof(float)); + memcpy(data + HB_FIR_SIZE, in, AMRWB_SFR_SIZE_16k * sizeof(float)); + + for (i = 0; i < AMRWB_SFR_SIZE_16k; i++) { + out[i] = 0.0; + for (j = 0; j <= HB_FIR_SIZE; j++) + out[i] += data[i + j] * fir_coef[j]; + } + + memcpy(mem, data + AMRWB_SFR_SIZE_16k, HB_FIR_SIZE * sizeof(float)); +} + +/** + * Update context state before the next subframe + */ +static void update_sub_state(AMRWBContext *ctx) +{ + memmove(&ctx->excitation_buf[0], &ctx->excitation_buf[AMRWB_SFR_SIZE], + (AMRWB_P_DELAY_MAX + LP_ORDER + 1) * sizeof(float)); + + memmove(&ctx->pitch_gain[1], &ctx->pitch_gain[0], 5 * sizeof(float)); + memmove(&ctx->fixed_gain[1], &ctx->fixed_gain[0], 1 * sizeof(float)); + + memmove(&ctx->samples_az[0], &ctx->samples_az[AMRWB_SFR_SIZE], + LP_ORDER * sizeof(float)); + memmove(&ctx->samples_up[0], &ctx->samples_up[AMRWB_SFR_SIZE], + UPS_MEM_SIZE * sizeof(float)); + memmove(&ctx->samples_hb[0], &ctx->samples_hb[AMRWB_SFR_SIZE_16k], + LP_ORDER_16k * sizeof(float)); +} + +static int amrwb_decode_frame(AVCodecContext *avctx, void *data, int *data_size, + AVPacket *avpkt) +{ + AMRWBContext *ctx = avctx->priv_data; + AMRWBFrame *cf = &ctx->frame; + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + int expected_fr_size, header_size; + float *buf_out = data; + float spare_vector[AMRWB_SFR_SIZE]; // extra stack space to hold result from anti-sparseness processing + float fixed_gain_factor; // fixed gain correction factor (gamma) + float *synth_fixed_vector; // pointer to the fixed vector that synthesis should use + float synth_fixed_gain; // the fixed gain that synthesis should use + float voice_fac, stab_fac; // parameters used for gain smoothing + float synth_exc[AMRWB_SFR_SIZE]; // post-processed excitation for synthesis + float hb_exc[AMRWB_SFR_SIZE_16k]; // excitation for the high frequency band + float hb_samples[AMRWB_SFR_SIZE_16k]; // filtered high-band samples from synthesis + float hb_gain; + int sub, i; + + header_size = decode_mime_header(ctx, buf); + expected_fr_size = ((cf_sizes_wb[ctx->fr_cur_mode] + 7) >> 3) + 1; + + if (buf_size < expected_fr_size) { + av_log(avctx, AV_LOG_ERROR, + "Frame too small (%d bytes). Truncated file?\n", buf_size); + *data_size = 0; + return buf_size; + } + + if (!ctx->fr_quality || ctx->fr_cur_mode > MODE_SID) + av_log(avctx, AV_LOG_ERROR, "Encountered a bad or corrupted frame\n"); + + if (ctx->fr_cur_mode == MODE_SID) /* Comfort noise frame */ + av_log_missing_feature(avctx, "SID mode", 1); + + if (ctx->fr_cur_mode >= MODE_SID) + return -1; + + ff_amr_bit_reorder((uint16_t *) &ctx->frame, sizeof(AMRWBFrame), + buf + header_size, amr_bit_orderings_by_mode[ctx->fr_cur_mode]); + + /* Decode the quantized ISF vector */ + if (ctx->fr_cur_mode == MODE_6k60) { + decode_isf_indices_36b(cf->isp_id, ctx->isf_cur); + } else { + decode_isf_indices_46b(cf->isp_id, ctx->isf_cur); + } + + isf_add_mean_and_past(ctx->isf_cur, ctx->isf_q_past); + ff_set_min_dist_lsf(ctx->isf_cur, MIN_ISF_SPACING, LP_ORDER - 1); + + stab_fac = stability_factor(ctx->isf_cur, ctx->isf_past_final); + + ctx->isf_cur[LP_ORDER - 1] *= 2.0; + ff_acelp_lsf2lspd(ctx->isp[3], ctx->isf_cur, LP_ORDER); + + /* Generate a ISP vector for each subframe */ + if (ctx->first_frame) { + ctx->first_frame = 0; + memcpy(ctx->isp_sub4_past, ctx->isp[3], LP_ORDER * sizeof(double)); + } + interpolate_isp(ctx->isp, ctx->isp_sub4_past); + + for (sub = 0; sub < 4; sub++) + ff_amrwb_lsp2lpc(ctx->isp[sub], ctx->lp_coef[sub], LP_ORDER); + + for (sub = 0; sub < 4; sub++) { + const AMRWBSubFrame *cur_subframe = &cf->subframe[sub]; + float *sub_buf = buf_out + sub * AMRWB_SFR_SIZE_16k; + + /* Decode adaptive codebook (pitch vector) */ + decode_pitch_vector(ctx, cur_subframe, sub); + /* Decode innovative codebook (fixed vector) */ + decode_fixed_vector(ctx->fixed_vector, cur_subframe->pul_ih, + cur_subframe->pul_il, ctx->fr_cur_mode); + + pitch_sharpening(ctx, ctx->fixed_vector); + + decode_gains(cur_subframe->vq_gain, ctx->fr_cur_mode, + &fixed_gain_factor, &ctx->pitch_gain[0]); + + ctx->fixed_gain[0] = + ff_amr_set_fixed_gain(fixed_gain_factor, + ff_dot_productf(ctx->fixed_vector, ctx->fixed_vector, + AMRWB_SFR_SIZE) / AMRWB_SFR_SIZE, + ctx->prediction_error, + ENERGY_MEAN, energy_pred_fac); + + /* Calculate voice factor and store tilt for next subframe */ + voice_fac = voice_factor(ctx->pitch_vector, ctx->pitch_gain[0], + ctx->fixed_vector, ctx->fixed_gain[0]); + ctx->tilt_coef = voice_fac * 0.25 + 0.25; + + /* Construct current excitation */ + for (i = 0; i < AMRWB_SFR_SIZE; i++) { + ctx->excitation[i] *= ctx->pitch_gain[0]; + ctx->excitation[i] += ctx->fixed_gain[0] * ctx->fixed_vector[i]; + ctx->excitation[i] = truncf(ctx->excitation[i]); + } + + /* Post-processing of excitation elements */ + synth_fixed_gain = noise_enhancer(ctx->fixed_gain[0], &ctx->prev_tr_gain, + voice_fac, stab_fac); + + synth_fixed_vector = anti_sparseness(ctx, ctx->fixed_vector, + spare_vector); + + pitch_enhancer(synth_fixed_vector, voice_fac); + + synthesis(ctx, ctx->lp_coef[sub], synth_exc, synth_fixed_gain, + synth_fixed_vector, &ctx->samples_az[LP_ORDER]); + + /* Synthesis speech post-processing */ + de_emphasis(&ctx->samples_up[UPS_MEM_SIZE], + &ctx->samples_az[LP_ORDER], PREEMPH_FAC, ctx->demph_mem); + + ff_acelp_apply_order_2_transfer_function(&ctx->samples_up[UPS_MEM_SIZE], + &ctx->samples_up[UPS_MEM_SIZE], hpf_zeros, hpf_31_poles, + hpf_31_gain, ctx->hpf_31_mem, AMRWB_SFR_SIZE); + + upsample_5_4(sub_buf, &ctx->samples_up[UPS_FIR_SIZE], + AMRWB_SFR_SIZE_16k); + + /* High frequency band (6.4 - 7.0 kHz) generation part */ + ff_acelp_apply_order_2_transfer_function(hb_samples, + &ctx->samples_up[UPS_MEM_SIZE], hpf_zeros, hpf_400_poles, + hpf_400_gain, ctx->hpf_400_mem, AMRWB_SFR_SIZE); + + hb_gain = find_hb_gain(ctx, hb_samples, + cur_subframe->hb_gain, cf->vad); + + scaled_hb_excitation(ctx, hb_exc, synth_exc, hb_gain); + + hb_synthesis(ctx, sub, &ctx->samples_hb[LP_ORDER_16k], + hb_exc, ctx->isf_cur, ctx->isf_past_final); + + /* High-band post-processing filters */ + hb_fir_filter(hb_samples, bpf_6_7_coef, ctx->bpf_6_7_mem, + &ctx->samples_hb[LP_ORDER_16k]); + + if (ctx->fr_cur_mode == MODE_23k85) + hb_fir_filter(hb_samples, lpf_7_coef, ctx->lpf_7_mem, + hb_samples); + + /* Add the low and high frequency bands */ + for (i = 0; i < AMRWB_SFR_SIZE_16k; i++) + sub_buf[i] = (sub_buf[i] + hb_samples[i]) * (1.0f / (1 << 15)); + + /* Update buffers and history */ + update_sub_state(ctx); + } + + /* update state for next frame */ + memcpy(ctx->isp_sub4_past, ctx->isp[3], LP_ORDER * sizeof(ctx->isp[3][0])); + memcpy(ctx->isf_past_final, ctx->isf_cur, LP_ORDER * sizeof(float)); + + /* report how many samples we got */ + *data_size = 4 * AMRWB_SFR_SIZE_16k * sizeof(float); + + return expected_fr_size; +} + +AVCodec ff_amrwb_decoder = { + .name = "amrwb", + .type = CODEC_TYPE_AUDIO, + .id = CODEC_ID_AMR_WB, + .priv_data_size = sizeof(AMRWBContext), + .init = amrwb_decode_init, + .decode = amrwb_decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("Adaptive Multi-Rate WideBand"), + .sample_fmts = (enum AVSampleFormat[]){SAMPLE_FMT_FLT,SAMPLE_FMT_NONE}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/anm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/anm.c new file mode 100644 index 00000000..5b2b9df8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/anm.c @@ -0,0 +1,197 @@ +/* + * Deluxe Paint Animation decoder + * Copyright (c) 2009 Peter Ross + * + * 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 + * Deluxe Paint Animation decoder + */ + +#include "avcodec.h" +#include "bytestream.h" + +typedef struct AnmContext { + AVFrame frame; + int x; ///< x coordinate position +} AnmContext; + +static av_cold int decode_init(AVCodecContext *avctx) +{ + AnmContext *s = avctx->priv_data; + const uint8_t *buf; + int i; + + avctx->pix_fmt = PIX_FMT_PAL8; + + if (avctx->extradata_size != 16*8 + 4*256) + return -1; + + s->frame.reference = 1; + if (avctx->get_buffer(avctx, &s->frame) < 0) { + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return -1; + } + + buf = avctx->extradata + 16*8; + for (i = 0; i < 256; i++) + ((uint32_t*)s->frame.data[1])[i] = bytestream_get_le32(&buf); + + return 0; +} + +/** + * Perform decode operation + * @param dst, dst_end Destination image buffer + * @param buf, buf_end Source buffer (optional, see below) + * @param pixel Fill color (optional, see below) + * @param count Pixel count + * @param x Pointer to x-axis counter + * @param width Image width + * @param linesize Destination image buffer linesize + * @return non-zero if destination buffer is exhausted + * + * a copy operation is achieved when 'buf' is set + * a fill operation is acheived when 'buf' is null and pixel is >= 0 + * a skip operation is acheived when 'buf' is null and pixel is < 0 + */ +static inline int op(uint8_t **dst, const uint8_t *dst_end, + const uint8_t **buf, const uint8_t *buf_end, + int pixel, int count, + int *x, int width, int linesize) +{ + int remaining = width - *x; + while(count > 0) { + int striplen = FFMIN(count, remaining); + if (buf) { + striplen = FFMIN(striplen, buf_end - *buf); + memcpy(*dst, *buf, striplen); + *buf += striplen; + } else if (pixel >= 0) + memset(*dst, pixel, striplen); + *dst += striplen; + remaining -= striplen; + count -= striplen; + if (remaining <= 0) { + *dst += linesize - width; + remaining = width; + } + if (linesize > 0) { + if (*dst >= dst_end) goto exhausted; + } else { + if (*dst <= dst_end) goto exhausted; + } + } + *x = width - remaining; + return 0; + +exhausted: + *x = width - remaining; + return 1; +} + +static int decode_frame(AVCodecContext *avctx, + void *data, int *data_size, + AVPacket *avpkt) +{ + AnmContext *s = avctx->priv_data; + const uint8_t *buf = avpkt->data; + const int buf_size = avpkt->size; + const uint8_t *buf_end = buf + buf_size; + uint8_t *dst, *dst_end; + int count; + + if(avctx->reget_buffer(avctx, &s->frame) < 0){ + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return -1; + } + dst = s->frame.data[0]; + dst_end = s->frame.data[0] + s->frame.linesize[0]*avctx->height; + + if (buf[0] != 0x42) { + av_log_ask_for_sample(avctx, "unknown record type\n"); + return buf_size; + } + if (buf[1]) { + av_log_ask_for_sample(avctx, "padding bytes not supported\n"); + return buf_size; + } + buf += 4; + + s->x = 0; + do { + /* if statements are ordered by probability */ +#define OP(buf, pixel, count) \ + op(&dst, dst_end, (buf), buf_end, (pixel), (count), &s->x, avctx->width, s->frame.linesize[0]) + + int type = bytestream_get_byte(&buf); + count = type & 0x7F; + type >>= 7; + if (count) { + if (OP(type ? NULL : &buf, -1, count)) break; + } else if (!type) { + int pixel; + count = bytestream_get_byte(&buf); /* count==0 gives nop */ + pixel = bytestream_get_byte(&buf); + if (OP(NULL, pixel, count)) break; + } else { + int pixel; + type = bytestream_get_le16(&buf); + count = type & 0x3FFF; + type >>= 14; + if (!count) { + if (type == 0) + break; // stop + if (type == 2) { + av_log_ask_for_sample(avctx, "unknown opcode"); + return AVERROR_INVALIDDATA; + } + continue; + } + pixel = type == 3 ? bytestream_get_byte(&buf) : -1; + if (type == 1) count += 0x4000; + if (OP(type == 2 ? &buf : NULL, pixel, count)) break; + } + } while (buf + 1 < buf_end); + + *data_size = sizeof(AVFrame); + *(AVFrame*)data = s->frame; + return buf_size; +} + +static av_cold int decode_end(AVCodecContext *avctx) +{ + AnmContext *s = avctx->priv_data; + if (s->frame.data[0]) + avctx->release_buffer(avctx, &s->frame); + return 0; +} + +AVCodec ff_anm_decoder = { + "anm", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_ANM, + sizeof(AnmContext), + decode_init, + NULL, + decode_end, + decode_frame, + CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ansi.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ansi.c new file mode 100644 index 00000000..9d6dc9d3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ansi.c @@ -0,0 +1,435 @@ +/* + * ASCII/ANSI art decoder + * Copyright (c) 2010 Peter Ross + * + * 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 + * ASCII/ANSI art decoder + */ + +#include "libavutil/lfg.h" +#include "avcodec.h" +#include "cga_data.h" + +#define ATTR_BOLD 0x01 /**< Bold/Bright-foreground (mode 1) */ +#define ATTR_FAINT 0x02 /**< Faint (mode 2) */ +#define ATTR_UNDERLINE 0x08 /**< Underline (mode 4) */ +#define ATTR_BLINK 0x10 /**< Blink/Bright-background (mode 5) */ +#define ATTR_REVERSE 0x40 /**< Reverse (mode 7) */ +#define ATTR_CONCEALED 0x80 /**< Concealed (mode 8) */ + +#define DEFAULT_FG_COLOR 7 /**< CGA color index */ +#define DEFAULT_BG_COLOR 0 +#define DEFAULT_SCREEN_MODE 3 /**< 80x25 */ + +#define FONT_WIDTH 8 /**< Font width */ + +/** map ansi color index to cga palette index */ +static const uint8_t ansi_to_cga[16] = { + 0, 4, 2, 6, 1, 5, 3, 7, 8, 12, 10, 14, 9, 13, 11, 15 +}; + +typedef struct { + AVFrame frame; + int x; /**< x cursor position (pixels) */ + int y; /**< y cursor position (pixels) */ + int sx; /**< saved x cursor position (pixels) */ + int sy; /**< saved y cursor position (pixels) */ + const uint8_t* font; /**< font */ + int font_height; /**< font height */ + int attributes; /**< attribute flags */ + int fg; /**< foreground color */ + int bg; /**< background color */ + + /* ansi parser state machine */ + enum { + STATE_NORMAL = 0, + STATE_ESCAPE, + STATE_CODE, + STATE_MUSIC_PREAMBLE + } state; +#define MAX_NB_ARGS 4 + int args[MAX_NB_ARGS]; + int nb_args; /**< number of arguments (may exceed MAX_NB_ARGS) */ +} AnsiContext; + +static av_cold int decode_init(AVCodecContext *avctx) +{ + AnsiContext *s = avctx->priv_data; + avctx->pix_fmt = PIX_FMT_PAL8; + + /* defaults */ + s->font = ff_vga16_font; + s->font_height = 16; + s->fg = DEFAULT_FG_COLOR; + s->bg = DEFAULT_BG_COLOR; + + if (!avctx->width || !avctx->height) + avcodec_set_dimensions(avctx, 80<<3, 25<<4); + + return 0; +} + +static void hscroll(AVCodecContext *avctx) +{ + AnsiContext *s = avctx->priv_data; + int i; + + if (s->y < avctx->height - s->font_height) { + s->y += s->font_height; + return; + } + + i = 0; + for (; i < avctx->height - s->font_height; i++) + memcpy(s->frame.data[0] + i * s->frame.linesize[0], + s->frame.data[0] + (i + s->font_height) * s->frame.linesize[0], + avctx->width); + for (; i < avctx->height; i++) + memset(s->frame.data[0] + i * s->frame.linesize[0], + DEFAULT_BG_COLOR, avctx->width); +} + +static void erase_line(AVCodecContext * avctx, int xoffset, int xlength) +{ + AnsiContext *s = avctx->priv_data; + int i; + for (i = 0; i < s->font_height; i++) + memset(s->frame.data[0] + (s->y + i)*s->frame.linesize[0] + xoffset, + DEFAULT_BG_COLOR, xlength); +} + +static void erase_screen(AVCodecContext *avctx) +{ + AnsiContext *s = avctx->priv_data; + int i; + for (i = 0; i < avctx->height; i++) + memset(s->frame.data[0] + i * s->frame.linesize[0], DEFAULT_BG_COLOR, avctx->width); + s->x = s->y = 0; +} + +/** + * Draw character to screen + */ +static void draw_char(AVCodecContext *avctx, int c) +{ + AnsiContext *s = avctx->priv_data; + int fg = s->fg; + int bg = s->bg; + + if ((s->attributes & ATTR_BOLD)) + fg += 8; + if ((s->attributes & ATTR_BLINK)) + bg += 8; + if ((s->attributes & ATTR_REVERSE)) + FFSWAP(int, fg, bg); + if ((s->attributes & ATTR_CONCEALED)) + fg = bg; + ff_draw_pc_font(s->frame.data[0] + s->y * s->frame.linesize[0] + s->x, + s->frame.linesize[0], s->font, s->font_height, c, fg, bg); + s->x += FONT_WIDTH; + if (s->x >= avctx->width) { + s->x = 0; + hscroll(avctx); + } +} + +/** + * Execute ANSI escape code + * @param <0 error + */ +static int execute_code(AVCodecContext * avctx, int c) +{ + AnsiContext *s = avctx->priv_data; + int ret, i, width, height; + switch(c) { + case 'A': //Cursor Up + s->y = FFMAX(s->y - (s->nb_args > 0 ? s->args[0]*s->font_height : s->font_height), 0); + break; + case 'B': //Cursor Down + s->y = FFMIN(s->y + (s->nb_args > 0 ? s->args[0]*s->font_height : s->font_height), avctx->height - s->font_height); + break; + case 'C': //Cursor Right + s->x = FFMIN(s->x + (s->nb_args > 0 ? s->args[0]*FONT_WIDTH : FONT_WIDTH), avctx->width - FONT_WIDTH); + break; + case 'D': //Cursor Left + s->x = FFMAX(s->x - (s->nb_args > 0 ? s->args[0]*FONT_WIDTH : FONT_WIDTH), 0); + break; + case 'H': //Cursor Position + case 'f': //Horizontal and Vertical Position + s->y = s->nb_args > 0 ? av_clip((s->args[0] - 1)*s->font_height, 0, avctx->height - s->font_height) : 0; + s->x = s->nb_args > 1 ? av_clip((s->args[1] - 1)*FONT_WIDTH, 0, avctx->width - FONT_WIDTH) : 0; + break; + case 'h': //set creen mode + case 'l': //reset screen mode + if (s->nb_args < 2) + s->args[0] = DEFAULT_SCREEN_MODE; + switch(s->args[0]) { + case 0: case 1: case 4: case 5: case 13: case 19: //320x200 (25 rows) + s->font = ff_cga_font; + s->font_height = 8; + width = 40<<3; + height = 25<<3; + break; + case 2: case 3: //640x400 (25 rows) + s->font = ff_vga16_font; + s->font_height = 16; + width = 80<<3; + height = 25<<4; + break; + case 6: case 14: //640x200 (25 rows) + s->font = ff_cga_font; + s->font_height = 8; + width = 80<<3; + height = 25<<3; + break; + case 7: //set line wrapping + break; + case 15: case 16: //640x350 (43 rows) + s->font = ff_cga_font; + s->font_height = 8; + width = 80<<3; + height = 43<<3; + break; + case 17: case 18: //640x480 (60 rows) + s->font = ff_cga_font; + s->font_height = 8; + width = 80<<3; + height = 60<<4; + break; + default: + av_log_ask_for_sample(avctx, "unsupported screen mode\n"); + } + if (width != avctx->width || height != avctx->height) { + if (s->frame.data[0]) + avctx->release_buffer(avctx, &s->frame); + avcodec_set_dimensions(avctx, width, height); + ret = avctx->get_buffer(avctx, &s->frame); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return ret; + } + s->frame.pict_type = FF_I_TYPE; + s->frame.palette_has_changed = 1; + memcpy(s->frame.data[1], ff_cga_palette, 16 * 4); + erase_screen(avctx); + } else if (c == 'l') { + erase_screen(avctx); + } + break; + case 'J': //Erase in Page + switch (s->args[0]) { + case 0: + erase_line(avctx, s->x, avctx->width - s->x); + if (s->y < avctx->height - s->font_height) + memset(s->frame.data[0] + (s->y + s->font_height)*s->frame.linesize[0], + DEFAULT_BG_COLOR, (avctx->height - s->y - s->font_height)*s->frame.linesize[0]); + break; + case 1: + erase_line(avctx, 0, s->x); + if (s->y > 0) + memset(s->frame.data[0], DEFAULT_BG_COLOR, s->y * s->frame.linesize[0]); + break; + case 2: + erase_screen(avctx); + } + break; + case 'K': //Erase in Line + switch(s->args[0]) { + case 0: + erase_line(avctx, s->x, avctx->width - s->x); + break; + case 1: + erase_line(avctx, 0, s->x); + break; + case 2: + erase_line(avctx, 0, avctx->width); + } + break; + case 'm': //Select Graphics Rendition + if (s->nb_args == 0) { + s->nb_args = 1; + s->args[0] = 0; + } + for (i = 0; i < FFMIN(s->nb_args, MAX_NB_ARGS); i++) { + int m = s->args[i]; + if (m == 0) { + s->attributes = 0; + s->fg = DEFAULT_FG_COLOR; + s->bg = DEFAULT_BG_COLOR; + } else if (m == 1 || m == 2 || m == 4 || m == 5 || m == 7 || m == 8) { + s->attributes |= 1 << (m - 1); + } else if (m >= 30 && m <= 38) { + s->fg = ansi_to_cga[m - 30]; + } else if (m == 39) { + s->fg = ansi_to_cga[DEFAULT_FG_COLOR]; + } else if (m >= 40 && m <= 47) { + s->bg = ansi_to_cga[m - 40]; + } else if (m == 49) { + s->fg = ansi_to_cga[DEFAULT_BG_COLOR]; + } else { + av_log_ask_for_sample(avctx, "unsupported rendition parameter\n"); + } + } + break; + case 'n': //Device Status Report + case 'R': //report current line and column + /* ignore */ + break; + case 's': //Save Cursor Position + s->sx = s->x; + s->sy = s->y; + break; + case 'u': //Restore Cursor Position + s->x = av_clip(s->sx, 0, avctx->width - FONT_WIDTH); + s->y = av_clip(s->sy, 0, avctx->height - s->font_height); + break; + default: + av_log_ask_for_sample(avctx, "unsupported escape code\n"); + break; + } + return 0; +} + +static int decode_frame(AVCodecContext *avctx, + void *data, int *data_size, + AVPacket *avpkt) +{ + AnsiContext *s = avctx->priv_data; + uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + const uint8_t *buf_end = buf+buf_size; + int ret, i, count; + + ret = avctx->reget_buffer(avctx, &s->frame); + if (ret < 0){ + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return ret; + } + s->frame.pict_type = FF_I_TYPE; + s->frame.palette_has_changed = 1; + memcpy(s->frame.data[1], ff_cga_palette, 16 * 4); + + while(buf < buf_end) { + switch(s->state) { + case STATE_NORMAL: + switch (buf[0]) { + case 0x00: //NUL + case 0x07: //BEL + case 0x1A: //SUB + /* ignore */ + break; + case 0x08: //BS + s->x = FFMAX(s->x - 1, 0); + break; + case 0x09: //HT + i = s->x / FONT_WIDTH; + count = ((i + 8) & ~7) - i; + for (i = 0; i < count; i++) + draw_char(avctx, ' '); + break; + case 0x0A: //LF + hscroll(avctx); + case 0x0D: //CR + s->x = 0; + break; + case 0x0C: //FF + erase_screen(avctx); + break; + case 0x1B: //ESC + s->state = STATE_ESCAPE; + break; + default: + draw_char(avctx, buf[0]); + } + break; + case STATE_ESCAPE: + if (buf[0] == '[') { + s->state = STATE_CODE; + s->nb_args = 0; + s->args[0] = 0; + } else { + s->state = STATE_NORMAL; + draw_char(avctx, 0x1B); + return -1; + continue; + } + break; + case STATE_CODE: + switch(buf[0]) { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + if (s->nb_args < MAX_NB_ARGS) + s->args[s->nb_args] = s->args[s->nb_args] * 10 + buf[0] - '0'; + break; + case ';': + s->nb_args++; + if (s->nb_args < MAX_NB_ARGS) + s->args[s->nb_args] = 0; + break; + case 'M': + s->state = STATE_MUSIC_PREAMBLE; + break; + case '=': case '?': + /* ignore */ + break; + default: + if (s->nb_args > MAX_NB_ARGS) + av_log(avctx, AV_LOG_WARNING, "args overflow (%i)\n", s->nb_args); + if (s->nb_args < MAX_NB_ARGS && s->args[s->nb_args]) + s->nb_args++; + if (execute_code(avctx, buf[0]) < 0) + return -1; + s->state = STATE_NORMAL; + } + break; + case STATE_MUSIC_PREAMBLE: + if (buf[0] == 0x0E || buf[0] == 0x1B) + s->state = STATE_NORMAL; + /* ignore music data */ + break; + } + buf++; + } + + *data_size = sizeof(AVFrame); + *(AVFrame*)data = s->frame; + return buf_size; +} + +static av_cold int decode_close(AVCodecContext *avctx) +{ + AnsiContext *s = avctx->priv_data; + if (s->frame.data[0]) + avctx->release_buffer(avctx, &s->frame); + return 0; +} + +AVCodec ff_ansi_decoder = { + .name = "ansi", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_ANSI, + .priv_data_size = sizeof(AnsiContext), + .init = decode_init, + .close = decode_close, + .decode = decode_frame, + .capabilities = CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("ASCII/ANSI art"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/Makefile new file mode 100644 index 00000000..014456ee --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/Makefile @@ -0,0 +1,63 @@ +OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_init_arm.o \ + +OBJS-$(CONFIG_VP5_DECODER) += arm/vp56dsp_init_arm.o +OBJS-$(CONFIG_VP6_DECODER) += arm/vp56dsp_init_arm.o + +OBJS-$(CONFIG_H264DSP) += arm/h264dsp_init_arm.o +OBJS-$(CONFIG_H264PRED) += arm/h264pred_init_arm.o + +OBJS += arm/dsputil_init_arm.o \ + arm/dsputil_arm.o \ + arm/fft_init_arm.o \ + arm/fmtconvert_init_arm.o \ + arm/jrevdct_arm.o \ + arm/mpegvideo_arm.o \ + arm/simple_idct_arm.o \ + +OBJS-$(HAVE_ARMV5TE) += arm/dsputil_init_armv5te.o \ + arm/mpegvideo_armv5te.o \ + arm/mpegvideo_armv5te_s.o \ + arm/simple_idct_armv5te.o \ + +OBJS-$(HAVE_ARMV6) += arm/dsputil_init_armv6.o \ + arm/dsputil_armv6.o \ + arm/simple_idct_armv6.o \ + +VFP-OBJS-$(HAVE_ARMV6) += arm/fmtconvert_vfp.o \ + +OBJS-$(HAVE_ARMVFP) += arm/dsputil_vfp.o \ + arm/dsputil_init_vfp.o \ + $(VFP-OBJS-yes) + +OBJS-$(HAVE_IWMMXT) += arm/dsputil_iwmmxt.o \ + arm/mpegvideo_iwmmxt.o \ + +NEON-OBJS-$(CONFIG_FFT) += arm/fft_neon.o \ + +NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \ + +NEON-OBJS-$(CONFIG_RDFT) += arm/rdft_neon.o \ + +NEON-OBJS-$(CONFIG_H264DSP) += arm/h264dsp_neon.o \ + arm/h264idct_neon.o \ + +NEON-OBJS-$(CONFIG_H264PRED) += arm/h264pred_neon.o \ + +NEON-OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_neon.o \ + arm/synth_filter_neon.o \ + +NEON-OBJS-$(CONFIG_VP3_DECODER) += arm/vp3dsp_neon.o + +NEON-OBJS-$(CONFIG_VP5_DECODER) += arm/vp56dsp_neon.o \ + arm/vp3dsp_neon.o \ + +NEON-OBJS-$(CONFIG_VP6_DECODER) += arm/vp56dsp_neon.o \ + arm/vp3dsp_neon.o \ + +OBJS-$(HAVE_NEON) += arm/dsputil_init_neon.o \ + arm/dsputil_neon.o \ + arm/fmtconvert_neon.o \ + arm/int_neon.o \ + arm/mpegvideo_neon.o \ + arm/simple_idct_neon.o \ + $(NEON-OBJS-yes) diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/aac.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/aac.h new file mode 100644 index 00000000..390cdbfc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/aac.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#ifndef AVCODEC_ARM_AAC_H +#define AVCODEC_ARM_AAC_H + +#include "config.h" + +#if HAVE_NEON && HAVE_INLINE_ASM + +#define VMUL2 VMUL2 +static inline float *VMUL2(float *dst, const float *v, unsigned idx, + const float *scale) +{ + unsigned v0, v1; + __asm__ volatile ("ubfx %0, %4, #0, #4 \n\t" + "ubfx %1, %4, #4, #4 \n\t" + "ldr %0, [%3, %0, lsl #2] \n\t" + "ldr %1, [%3, %1, lsl #2] \n\t" + "vld1.32 {d1[]}, [%5,:32] \n\t" + "vmov d0, %0, %1 \n\t" + "vmul.f32 d0, d0, d1 \n\t" + "vst1.32 {d0}, [%2,:64]! \n\t" + : "=&r"(v0), "=&r"(v1), "+r"(dst) + : "r"(v), "r"(idx), "r"(scale) + : "d0", "d1"); + return dst; +} + +#define VMUL4 VMUL4 +static inline float *VMUL4(float *dst, const float *v, unsigned idx, + const float *scale) +{ + unsigned v0, v1, v2, v3; + __asm__ volatile ("ubfx %0, %6, #0, #2 \n\t" + "ubfx %1, %6, #2, #2 \n\t" + "ldr %0, [%5, %0, lsl #2] \n\t" + "ubfx %2, %6, #4, #2 \n\t" + "ldr %1, [%5, %1, lsl #2] \n\t" + "ubfx %3, %6, #6, #2 \n\t" + "ldr %2, [%5, %2, lsl #2] \n\t" + "vmov d0, %0, %1 \n\t" + "ldr %3, [%5, %3, lsl #2] \n\t" + "vld1.32 {d2[],d3[]},[%7,:32] \n\t" + "vmov d1, %2, %3 \n\t" + "vmul.f32 q0, q0, q1 \n\t" + "vst1.32 {q0}, [%4,:128]! \n\t" + : "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst) + : "r"(v), "r"(idx), "r"(scale) + : "d0", "d1", "d2", "d3"); + return dst; +} + +#define VMUL2S VMUL2S +static inline float *VMUL2S(float *dst, const float *v, unsigned idx, + unsigned sign, const float *scale) +{ + unsigned v0, v1, v2, v3; + __asm__ volatile ("ubfx %0, %6, #0, #4 \n\t" + "ubfx %1, %6, #4, #4 \n\t" + "ldr %0, [%5, %0, lsl #2] \n\t" + "lsl %2, %8, #30 \n\t" + "ldr %1, [%5, %1, lsl #2] \n\t" + "lsl %3, %8, #31 \n\t" + "vmov d0, %0, %1 \n\t" + "bic %2, %2, #1<<30 \n\t" + "vld1.32 {d1[]}, [%7,:32] \n\t" + "vmov d2, %2, %3 \n\t" + "veor d0, d0, d2 \n\t" + "vmul.f32 d0, d0, d1 \n\t" + "vst1.32 {d0}, [%4,:64]! \n\t" + : "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst) + : "r"(v), "r"(idx), "r"(scale), "r"(sign) + : "d0", "d1", "d2"); + return dst; +} + +#define VMUL4S VMUL4S +static inline float *VMUL4S(float *dst, const float *v, unsigned idx, + unsigned sign, const float *scale) +{ + unsigned v0, v1, v2, v3, nz; + __asm__ volatile ("vld1.32 {d2[],d3[]},[%9,:32] \n\t" + "ubfx %0, %8, #0, #2 \n\t" + "ubfx %1, %8, #2, #2 \n\t" + "ldr %0, [%7, %0, lsl #2] \n\t" + "ubfx %2, %8, #4, #2 \n\t" + "ldr %1, [%7, %1, lsl #2] \n\t" + "ubfx %3, %8, #6, #2 \n\t" + "ldr %2, [%7, %2, lsl #2] \n\t" + "vmov d0, %0, %1 \n\t" + "ldr %3, [%7, %3, lsl #2] \n\t" + "lsr %6, %8, #12 \n\t" + "rbit %6, %6 \n\t" + "vmov d1, %2, %3 \n\t" + "lsls %6, %6, #1 \n\t" + "and %0, %5, #1<<31 \n\t" + "lslcs %5, %5, #1 \n\t" + "lsls %6, %6, #1 \n\t" + "and %1, %5, #1<<31 \n\t" + "lslcs %5, %5, #1 \n\t" + "lsls %6, %6, #1 \n\t" + "and %2, %5, #1<<31 \n\t" + "lslcs %5, %5, #1 \n\t" + "vmov d4, %0, %1 \n\t" + "and %3, %5, #1<<31 \n\t" + "vmov d5, %2, %3 \n\t" + "veor q0, q0, q2 \n\t" + "vmul.f32 q0, q0, q1 \n\t" + "vst1.32 {q0}, [%4,:128]! \n\t" + : "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst), + "+r"(sign), "=r"(nz) + : "r"(v), "r"(idx), "r"(scale) + : "d0", "d1", "d2", "d3", "d4", "d5"); + return dst; +} + +#endif /* HAVE_NEON && HAVE_INLINE_ASM */ + +#endif /* AVCODEC_ARM_AAC_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/asm-offsets.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/asm-offsets.h new file mode 100644 index 00000000..7f735348 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/asm-offsets.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#ifndef AVCODEC_ARM_ASM_OFFSETS_H +#define AVCODEC_ARM_ASM_OFFSETS_H + +#ifndef __ASSEMBLER__ +#include +#define CHK_OFFS(s, m, o) struct check_##o { \ + int x_##o[offsetof(s, m) == o? 1: -1]; \ + } +#endif + +/* MpegEncContext */ +#define Y_DC_SCALE 0xb4 +#define C_DC_SCALE 0xb8 +#define AC_PRED 0xbc +#define BLOCK_LAST_INDEX 0xc0 +#define H263_AIC 0xf0 +#define INTER_SCANTAB_RASTER_END 0x138 + +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dcadsp_init_arm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dcadsp_init_arm.c new file mode 100644 index 00000000..5663cd7f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dcadsp_init_arm.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavcodec/dcadsp.h" + +void ff_dca_lfe_fir_neon(float *out, const float *in, const float *coefs, + int decifactor, float scale); + +void av_cold ff_dcadsp_init_arm(DCADSPContext *s) +{ + if (HAVE_NEON) + s->lfe_fir = ff_dca_lfe_fir_neon; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dcadsp_neon.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dcadsp_neon.S new file mode 100644 index 00000000..c3bddd3e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/dcadsp_neon.S @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#include "asm.S" + +function ff_dca_lfe_fir_neon, export=1 + push {r4-r6,lr} + + add r4, r0, r3, lsl #2 @ out2 + add r5, r2, #256*4-16 @ cf1 + sub r1, r1, #12 + cmp r3, #32 + moveq r6, #256/32 + movne r6, #256/64 +NOVFP vldr s0, [sp, #16] @ scale + mov lr, #-16 +1: + vmov.f32 q2, #0.0 @ v0 + vmov.f32 q3, #0.0 @ v1 + mov r12, r6 +2: + vld1.32 {q8}, [r2,:128]! @ cf0 + vld1.32 {q9}, [r5,:128], lr @ cf1 + vld1.32 {q1}, [r1], lr @ in + subs r12, r12, #4 + vrev64.32 q10, q8 + vmla.f32 q3, q1, q9 + vmla.f32 d4, d2, d21 + vmla.f32 d5, d3, d20 + bne 2b + + add r1, r1, r6, lsl #2 + subs r3, r3, #1 + vadd.f32 d4, d4, d5 + vadd.f32 d6, d6, d7 + vpadd.f32 d4, d4, d6 + vmul.f32 d5, d4, d0[0] + vst1.32 {d5[0]}, [r0,:32]! + vst1.32 {d5[1]}, [r4,:32]! + bne 1b + + pop {r4-r6,pc} +endfunc diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/fmtconvert_init_arm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/fmtconvert_init_arm.c new file mode 100644 index 00000000..4b6e3939 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/fmtconvert_init_arm.c @@ -0,0 +1,48 @@ +/* + * ARM optimized Format Conversion Utils + * + * 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 + */ + +#include + +#include "libavcodec/avcodec.h" +#include "libavcodec/fmtconvert.h" + +void ff_int32_to_float_fmul_scalar_neon(float *dst, const int *src, + float mul, int len); + +void ff_float_to_int16_neon(int16_t *dst, const float *src, long len); +void ff_float_to_int16_interleave_neon(int16_t *, const float **, long, int); + +void ff_float_to_int16_vfp(int16_t *dst, const float *src, long len); + +void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx) +{ + if (HAVE_ARMVFP && HAVE_ARMV6) { + c->float_to_int16 = ff_float_to_int16_vfp; + } + + if (HAVE_NEON) { + c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_neon; + + if (!(avctx->flags & CODEC_FLAG_BITEXACT)) { + c->float_to_int16 = ff_float_to_int16_neon; + c->float_to_int16_interleave = ff_float_to_int16_interleave_neon; + } + } +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/fmtconvert_neon.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/fmtconvert_neon.S new file mode 100644 index 00000000..359e57e4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/fmtconvert_neon.S @@ -0,0 +1,391 @@ +/* + * ARM NEON optimised Format Conversion Utils + * Copyright (c) 2008 Mans Rullgard + * + * 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 + */ + +#include "config.h" +#include "asm.S" + + preserve8 + .text + +function ff_float_to_int16_neon, export=1 + subs r2, r2, #8 + vld1.64 {d0-d1}, [r1,:128]! + vcvt.s32.f32 q8, q0, #16 + vld1.64 {d2-d3}, [r1,:128]! + vcvt.s32.f32 q9, q1, #16 + beq 3f + bics ip, r2, #15 + beq 2f +1: subs ip, ip, #16 + vshrn.s32 d4, q8, #16 + vld1.64 {d0-d1}, [r1,:128]! + vcvt.s32.f32 q0, q0, #16 + vshrn.s32 d5, q9, #16 + vld1.64 {d2-d3}, [r1,:128]! + vcvt.s32.f32 q1, q1, #16 + vshrn.s32 d6, q0, #16 + vst1.64 {d4-d5}, [r0,:128]! + vshrn.s32 d7, q1, #16 + vld1.64 {d16-d17},[r1,:128]! + vcvt.s32.f32 q8, q8, #16 + vld1.64 {d18-d19},[r1,:128]! + vcvt.s32.f32 q9, q9, #16 + vst1.64 {d6-d7}, [r0,:128]! + bne 1b + ands r2, r2, #15 + beq 3f +2: vld1.64 {d0-d1}, [r1,:128]! + vshrn.s32 d4, q8, #16 + vcvt.s32.f32 q0, q0, #16 + vld1.64 {d2-d3}, [r1,:128]! + vshrn.s32 d5, q9, #16 + vcvt.s32.f32 q1, q1, #16 + vshrn.s32 d6, q0, #16 + vst1.64 {d4-d5}, [r0,:128]! + vshrn.s32 d7, q1, #16 + vst1.64 {d6-d7}, [r0,:128]! + bx lr +3: vshrn.s32 d4, q8, #16 + vshrn.s32 d5, q9, #16 + vst1.64 {d4-d5}, [r0,:128]! + bx lr +endfunc + +function ff_float_to_int16_interleave_neon, export=1 + cmp r3, #2 + ldrlt r1, [r1] + blt ff_float_to_int16_neon + bne 4f + + ldr r3, [r1] + ldr r1, [r1, #4] + + subs r2, r2, #8 + vld1.64 {d0-d1}, [r3,:128]! + vcvt.s32.f32 q8, q0, #16 + vld1.64 {d2-d3}, [r3,:128]! + vcvt.s32.f32 q9, q1, #16 + vld1.64 {d20-d21},[r1,:128]! + vcvt.s32.f32 q10, q10, #16 + vld1.64 {d22-d23},[r1,:128]! + vcvt.s32.f32 q11, q11, #16 + beq 3f + bics ip, r2, #15 + beq 2f +1: subs ip, ip, #16 + vld1.64 {d0-d1}, [r3,:128]! + vcvt.s32.f32 q0, q0, #16 + vsri.32 q10, q8, #16 + vld1.64 {d2-d3}, [r3,:128]! + vcvt.s32.f32 q1, q1, #16 + vld1.64 {d24-d25},[r1,:128]! + vcvt.s32.f32 q12, q12, #16 + vld1.64 {d26-d27},[r1,:128]! + vsri.32 q11, q9, #16 + vst1.64 {d20-d21},[r0,:128]! + vcvt.s32.f32 q13, q13, #16 + vst1.64 {d22-d23},[r0,:128]! + vsri.32 q12, q0, #16 + vld1.64 {d16-d17},[r3,:128]! + vsri.32 q13, q1, #16 + vst1.64 {d24-d25},[r0,:128]! + vcvt.s32.f32 q8, q8, #16 + vld1.64 {d18-d19},[r3,:128]! + vcvt.s32.f32 q9, q9, #16 + vld1.64 {d20-d21},[r1,:128]! + vcvt.s32.f32 q10, q10, #16 + vld1.64 {d22-d23},[r1,:128]! + vcvt.s32.f32 q11, q11, #16 + vst1.64 {d26-d27},[r0,:128]! + bne 1b + ands r2, r2, #15 + beq 3f +2: vsri.32 q10, q8, #16 + vld1.64 {d0-d1}, [r3,:128]! + vcvt.s32.f32 q0, q0, #16 + vld1.64 {d2-d3}, [r3,:128]! + vcvt.s32.f32 q1, q1, #16 + vld1.64 {d24-d25},[r1,:128]! + vcvt.s32.f32 q12, q12, #16 + vsri.32 q11, q9, #16 + vld1.64 {d26-d27},[r1,:128]! + vcvt.s32.f32 q13, q13, #16 + vst1.64 {d20-d21},[r0,:128]! + vsri.32 q12, q0, #16 + vst1.64 {d22-d23},[r0,:128]! + vsri.32 q13, q1, #16 + vst1.64 {d24-d27},[r0,:128]! + bx lr +3: vsri.32 q10, q8, #16 + vsri.32 q11, q9, #16 + vst1.64 {d20-d23},[r0,:128]! + bx lr + +4: push {r4-r8,lr} + cmp r3, #4 + lsl ip, r3, #1 + blt 4f + + @ 4 channels +5: ldmia r1!, {r4-r7} + mov lr, r2 + mov r8, r0 + vld1.64 {d16-d17},[r4,:128]! + vcvt.s32.f32 q8, q8, #16 + vld1.64 {d18-d19},[r5,:128]! + vcvt.s32.f32 q9, q9, #16 + vld1.64 {d20-d21},[r6,:128]! + vcvt.s32.f32 q10, q10, #16 + vld1.64 {d22-d23},[r7,:128]! + vcvt.s32.f32 q11, q11, #16 +6: subs lr, lr, #8 + vld1.64 {d0-d1}, [r4,:128]! + vcvt.s32.f32 q0, q0, #16 + vsri.32 q9, q8, #16 + vld1.64 {d2-d3}, [r5,:128]! + vcvt.s32.f32 q1, q1, #16 + vsri.32 q11, q10, #16 + vld1.64 {d4-d5}, [r6,:128]! + vcvt.s32.f32 q2, q2, #16 + vzip.32 d18, d22 + vld1.64 {d6-d7}, [r7,:128]! + vcvt.s32.f32 q3, q3, #16 + vzip.32 d19, d23 + vst1.64 {d18}, [r8], ip + vsri.32 q1, q0, #16 + vst1.64 {d22}, [r8], ip + vsri.32 q3, q2, #16 + vst1.64 {d19}, [r8], ip + vzip.32 d2, d6 + vst1.64 {d23}, [r8], ip + vzip.32 d3, d7 + beq 7f + vld1.64 {d16-d17},[r4,:128]! + vcvt.s32.f32 q8, q8, #16 + vst1.64 {d2}, [r8], ip + vld1.64 {d18-d19},[r5,:128]! + vcvt.s32.f32 q9, q9, #16 + vst1.64 {d6}, [r8], ip + vld1.64 {d20-d21},[r6,:128]! + vcvt.s32.f32 q10, q10, #16 + vst1.64 {d3}, [r8], ip + vld1.64 {d22-d23},[r7,:128]! + vcvt.s32.f32 q11, q11, #16 + vst1.64 {d7}, [r8], ip + b 6b +7: vst1.64 {d2}, [r8], ip + vst1.64 {d6}, [r8], ip + vst1.64 {d3}, [r8], ip + vst1.64 {d7}, [r8], ip + subs r3, r3, #4 + popeq {r4-r8,pc} + cmp r3, #4 + add r0, r0, #8 + bge 5b + + @ 2 channels +4: cmp r3, #2 + blt 4f + ldmia r1!, {r4-r5} + mov lr, r2 + mov r8, r0 + tst lr, #8 + vld1.64 {d16-d17},[r4,:128]! + vcvt.s32.f32 q8, q8, #16 + vld1.64 {d18-d19},[r5,:128]! + vcvt.s32.f32 q9, q9, #16 + vld1.64 {d20-d21},[r4,:128]! + vcvt.s32.f32 q10, q10, #16 + vld1.64 {d22-d23},[r5,:128]! + vcvt.s32.f32 q11, q11, #16 + beq 6f + subs lr, lr, #8 + beq 7f + vsri.32 d18, d16, #16 + vsri.32 d19, d17, #16 + vld1.64 {d16-d17},[r4,:128]! + vcvt.s32.f32 q8, q8, #16 + vst1.32 {d18[0]}, [r8], ip + vsri.32 d22, d20, #16 + vst1.32 {d18[1]}, [r8], ip + vsri.32 d23, d21, #16 + vst1.32 {d19[0]}, [r8], ip + vst1.32 {d19[1]}, [r8], ip + vld1.64 {d18-d19},[r5,:128]! + vcvt.s32.f32 q9, q9, #16 + vst1.32 {d22[0]}, [r8], ip + vst1.32 {d22[1]}, [r8], ip + vld1.64 {d20-d21},[r4,:128]! + vcvt.s32.f32 q10, q10, #16 + vst1.32 {d23[0]}, [r8], ip + vst1.32 {d23[1]}, [r8], ip + vld1.64 {d22-d23},[r5,:128]! + vcvt.s32.f32 q11, q11, #16 +6: subs lr, lr, #16 + vld1.64 {d0-d1}, [r4,:128]! + vcvt.s32.f32 q0, q0, #16 + vsri.32 d18, d16, #16 + vld1.64 {d2-d3}, [r5,:128]! + vcvt.s32.f32 q1, q1, #16 + vsri.32 d19, d17, #16 + vld1.64 {d4-d5}, [r4,:128]! + vcvt.s32.f32 q2, q2, #16 + vld1.64 {d6-d7}, [r5,:128]! + vcvt.s32.f32 q3, q3, #16 + vst1.32 {d18[0]}, [r8], ip + vsri.32 d22, d20, #16 + vst1.32 {d18[1]}, [r8], ip + vsri.32 d23, d21, #16 + vst1.32 {d19[0]}, [r8], ip + vsri.32 d2, d0, #16 + vst1.32 {d19[1]}, [r8], ip + vsri.32 d3, d1, #16 + vst1.32 {d22[0]}, [r8], ip + vsri.32 d6, d4, #16 + vst1.32 {d22[1]}, [r8], ip + vsri.32 d7, d5, #16 + vst1.32 {d23[0]}, [r8], ip + vst1.32 {d23[1]}, [r8], ip + beq 6f + vld1.64 {d16-d17},[r4,:128]! + vcvt.s32.f32 q8, q8, #16 + vst1.32 {d2[0]}, [r8], ip + vst1.32 {d2[1]}, [r8], ip + vld1.64 {d18-d19},[r5,:128]! + vcvt.s32.f32 q9, q9, #16 + vst1.32 {d3[0]}, [r8], ip + vst1.32 {d3[1]}, [r8], ip + vld1.64 {d20-d21},[r4,:128]! + vcvt.s32.f32 q10, q10, #16 + vst1.32 {d6[0]}, [r8], ip + vst1.32 {d6[1]}, [r8], ip + vld1.64 {d22-d23},[r5,:128]! + vcvt.s32.f32 q11, q11, #16 + vst1.32 {d7[0]}, [r8], ip + vst1.32 {d7[1]}, [r8], ip + bgt 6b +6: vst1.32 {d2[0]}, [r8], ip + vst1.32 {d2[1]}, [r8], ip + vst1.32 {d3[0]}, [r8], ip + vst1.32 {d3[1]}, [r8], ip + vst1.32 {d6[0]}, [r8], ip + vst1.32 {d6[1]}, [r8], ip + vst1.32 {d7[0]}, [r8], ip + vst1.32 {d7[1]}, [r8], ip + b 8f +7: vsri.32 d18, d16, #16 + vsri.32 d19, d17, #16 + vst1.32 {d18[0]}, [r8], ip + vsri.32 d22, d20, #16 + vst1.32 {d18[1]}, [r8], ip + vsri.32 d23, d21, #16 + vst1.32 {d19[0]}, [r8], ip + vst1.32 {d19[1]}, [r8], ip + vst1.32 {d22[0]}, [r8], ip + vst1.32 {d22[1]}, [r8], ip + vst1.32 {d23[0]}, [r8], ip + vst1.32 {d23[1]}, [r8], ip +8: subs r3, r3, #2 + add r0, r0, #4 + popeq {r4-r8,pc} + + @ 1 channel +4: ldr r4, [r1],#4 + tst r2, #8 + mov lr, r2 + mov r5, r0 + vld1.64 {d0-d1}, [r4,:128]! + vcvt.s32.f32 q0, q0, #16 + vld1.64 {d2-d3}, [r4,:128]! + vcvt.s32.f32 q1, q1, #16 + bne 8f +6: subs lr, lr, #16 + vld1.64 {d4-d5}, [r4,:128]! + vcvt.s32.f32 q2, q2, #16 + vld1.64 {d6-d7}, [r4,:128]! + vcvt.s32.f32 q3, q3, #16 + vst1.16 {d0[1]}, [r5,:16], ip + vst1.16 {d0[3]}, [r5,:16], ip + vst1.16 {d1[1]}, [r5,:16], ip + vst1.16 {d1[3]}, [r5,:16], ip + vst1.16 {d2[1]}, [r5,:16], ip + vst1.16 {d2[3]}, [r5,:16], ip + vst1.16 {d3[1]}, [r5,:16], ip + vst1.16 {d3[3]}, [r5,:16], ip + beq 7f + vld1.64 {d0-d1}, [r4,:128]! + vcvt.s32.f32 q0, q0, #16 + vld1.64 {d2-d3}, [r4,:128]! + vcvt.s32.f32 q1, q1, #16 +7: vst1.16 {d4[1]}, [r5,:16], ip + vst1.16 {d4[3]}, [r5,:16], ip + vst1.16 {d5[1]}, [r5,:16], ip + vst1.16 {d5[3]}, [r5,:16], ip + vst1.16 {d6[1]}, [r5,:16], ip + vst1.16 {d6[3]}, [r5,:16], ip + vst1.16 {d7[1]}, [r5,:16], ip + vst1.16 {d7[3]}, [r5,:16], ip + bgt 6b + pop {r4-r8,pc} +8: subs lr, lr, #8 + vst1.16 {d0[1]}, [r5,:16], ip + vst1.16 {d0[3]}, [r5,:16], ip + vst1.16 {d1[1]}, [r5,:16], ip + vst1.16 {d1[3]}, [r5,:16], ip + vst1.16 {d2[1]}, [r5,:16], ip + vst1.16 {d2[3]}, [r5,:16], ip + vst1.16 {d3[1]}, [r5,:16], ip + vst1.16 {d3[3]}, [r5,:16], ip + popeq {r4-r8,pc} + vld1.64 {d0-d1}, [r4,:128]! + vcvt.s32.f32 q0, q0, #16 + vld1.64 {d2-d3}, [r4,:128]! + vcvt.s32.f32 q1, q1, #16 + b 6b +endfunc + +function ff_int32_to_float_fmul_scalar_neon, export=1 +VFP vdup.32 q0, d0[0] +VFP len .req r2 +NOVFP vdup.32 q0, r2 +NOVFP len .req r3 + + vld1.32 {q1},[r1,:128]! + vcvt.f32.s32 q3, q1 + vld1.32 {q2},[r1,:128]! + vcvt.f32.s32 q8, q2 +1: subs len, len, #8 + pld [r1, #16] + vmul.f32 q9, q3, q0 + vmul.f32 q10, q8, q0 + beq 2f + vld1.32 {q1},[r1,:128]! + vcvt.f32.s32 q3, q1 + vld1.32 {q2},[r1,:128]! + vcvt.f32.s32 q8, q2 + vst1.32 {q9}, [r0,:128]! + vst1.32 {q10},[r0,:128]! + b 1b +2: vst1.32 {q9}, [r0,:128]! + vst1.32 {q10},[r0,:128]! + bx lr + .unreq len +endfunc diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/fmtconvert_vfp.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/fmtconvert_vfp.S new file mode 100644 index 00000000..1d19e775 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/fmtconvert_vfp.S @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2008 Siarhei Siamashka + * + * 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 + */ + +#include "config.h" +#include "asm.S" + + .syntax unified + +/** + * ARM VFP optimized float to int16 conversion. + * Assume that len is a positive number and is multiple of 8, destination + * buffer is at least 4 bytes aligned (8 bytes alignment is better for + * performance), little endian byte sex + */ +@ void ff_float_to_int16_vfp(int16_t *dst, const float *src, int len) +function ff_float_to_int16_vfp, export=1 + push {r4-r8,lr} + vpush {d8-d11} + vldmia r1!, {s16-s23} + vcvt.s32.f32 s0, s16 + vcvt.s32.f32 s1, s17 + vcvt.s32.f32 s2, s18 + vcvt.s32.f32 s3, s19 + vcvt.s32.f32 s4, s20 + vcvt.s32.f32 s5, s21 + vcvt.s32.f32 s6, s22 + vcvt.s32.f32 s7, s23 +1: + subs r2, r2, #8 + vmov r3, r4, s0, s1 + vmov r5, r6, s2, s3 + vmov r7, r8, s4, s5 + vmov ip, lr, s6, s7 + vldmiagt r1!, {s16-s23} + ssat r4, #16, r4 + ssat r3, #16, r3 + ssat r6, #16, r6 + ssat r5, #16, r5 + pkhbt r3, r3, r4, lsl #16 + pkhbt r4, r5, r6, lsl #16 + vcvtgt.s32.f32 s0, s16 + vcvtgt.s32.f32 s1, s17 + vcvtgt.s32.f32 s2, s18 + vcvtgt.s32.f32 s3, s19 + vcvtgt.s32.f32 s4, s20 + vcvtgt.s32.f32 s5, s21 + vcvtgt.s32.f32 s6, s22 + vcvtgt.s32.f32 s7, s23 + ssat r8, #16, r8 + ssat r7, #16, r7 + ssat lr, #16, lr + ssat ip, #16, ip + pkhbt r5, r7, r8, lsl #16 + pkhbt r6, ip, lr, lsl #16 + stmia r0!, {r3-r6} + bgt 1b + + vpop {d8-d11} + pop {r4-r8,pc} +endfunc diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264dsp_init_arm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264dsp_init_arm.c new file mode 100644 index 00000000..e55a9f46 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264dsp_init_arm.c @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#include + +#include "libavcodec/dsputil.h" +#include "libavcodec/h264dsp.h" + +void ff_h264_v_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha, + int beta, int8_t *tc0); +void ff_h264_h_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha, + int beta, int8_t *tc0); +void ff_h264_v_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha, + int beta, int8_t *tc0); +void ff_h264_h_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha, + int beta, int8_t *tc0); + +void ff_weight_h264_pixels_16x16_neon(uint8_t *ds, int stride, int log2_den, + int weight, int offset); +void ff_weight_h264_pixels_16x8_neon(uint8_t *ds, int stride, int log2_den, + int weight, int offset); +void ff_weight_h264_pixels_8x16_neon(uint8_t *ds, int stride, int log2_den, + int weight, int offset); +void ff_weight_h264_pixels_8x8_neon(uint8_t *ds, int stride, int log2_den, + int weight, int offset); +void ff_weight_h264_pixels_8x4_neon(uint8_t *ds, int stride, int log2_den, + int weight, int offset); +void ff_weight_h264_pixels_4x8_neon(uint8_t *ds, int stride, int log2_den, + int weight, int offset); +void ff_weight_h264_pixels_4x4_neon(uint8_t *ds, int stride, int log2_den, + int weight, int offset); +void ff_weight_h264_pixels_4x2_neon(uint8_t *ds, int stride, int log2_den, + int weight, int offset); + +void ff_biweight_h264_pixels_16x16_neon(uint8_t *dst, uint8_t *src, int stride, + int log2_den, int weightd, int weights, + int offset); +void ff_biweight_h264_pixels_16x8_neon(uint8_t *dst, uint8_t *src, int stride, + int log2_den, int weightd, int weights, + int offset); +void ff_biweight_h264_pixels_8x16_neon(uint8_t *dst, uint8_t *src, int stride, + int log2_den, int weightd, int weights, + int offset); +void ff_biweight_h264_pixels_8x8_neon(uint8_t *dst, uint8_t *src, int stride, + int log2_den, int weightd, int weights, + int offset); +void ff_biweight_h264_pixels_8x4_neon(uint8_t *dst, uint8_t *src, int stride, + int log2_den, int weightd, int weights, + int offset); +void ff_biweight_h264_pixels_4x8_neon(uint8_t *dst, uint8_t *src, int stride, + int log2_den, int weightd, int weights, + int offset); +void ff_biweight_h264_pixels_4x4_neon(uint8_t *dst, uint8_t *src, int stride, + int log2_den, int weightd, int weights, + int offset); +void ff_biweight_h264_pixels_4x2_neon(uint8_t *dst, uint8_t *src, int stride, + int log2_den, int weightd, int weights, + int offset); + +void ff_h264_idct_add_neon(uint8_t *dst, DCTELEM *block, int stride); +void ff_h264_idct_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride); +void ff_h264_idct_add16_neon(uint8_t *dst, const int *block_offset, + DCTELEM *block, int stride, + const uint8_t nnzc[6*8]); +void ff_h264_idct_add16intra_neon(uint8_t *dst, const int *block_offset, + DCTELEM *block, int stride, + const uint8_t nnzc[6*8]); +void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset, + DCTELEM *block, int stride, + const uint8_t nnzc[6*8]); + +void ff_h264_idct8_add_neon(uint8_t *dst, DCTELEM *block, int stride); +void ff_h264_idct8_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride); +void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset, + DCTELEM *block, int stride, + const uint8_t nnzc[6*8]); + +static void ff_h264dsp_init_neon(H264DSPContext *c) +{ + c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon; + c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon; + c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon; + c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon; + + c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16x16_neon; + c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_16x8_neon; + c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels_8x16_neon; + c->weight_h264_pixels_tab[3] = ff_weight_h264_pixels_8x8_neon; + c->weight_h264_pixels_tab[4] = ff_weight_h264_pixels_8x4_neon; + c->weight_h264_pixels_tab[5] = ff_weight_h264_pixels_4x8_neon; + c->weight_h264_pixels_tab[6] = ff_weight_h264_pixels_4x4_neon; + c->weight_h264_pixels_tab[7] = ff_weight_h264_pixels_4x2_neon; + + c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels_16x16_neon; + c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels_16x8_neon; + c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels_8x16_neon; + c->biweight_h264_pixels_tab[3] = ff_biweight_h264_pixels_8x8_neon; + c->biweight_h264_pixels_tab[4] = ff_biweight_h264_pixels_8x4_neon; + c->biweight_h264_pixels_tab[5] = ff_biweight_h264_pixels_4x8_neon; + c->biweight_h264_pixels_tab[6] = ff_biweight_h264_pixels_4x4_neon; + c->biweight_h264_pixels_tab[7] = ff_biweight_h264_pixels_4x2_neon; + + c->h264_idct_add = ff_h264_idct_add_neon; + c->h264_idct_dc_add = ff_h264_idct_dc_add_neon; + c->h264_idct_add16 = ff_h264_idct_add16_neon; + c->h264_idct_add16intra = ff_h264_idct_add16intra_neon; + c->h264_idct_add8 = ff_h264_idct_add8_neon; + c->h264_idct8_add = ff_h264_idct8_add_neon; + c->h264_idct8_dc_add = ff_h264_idct8_dc_add_neon; + c->h264_idct8_add4 = ff_h264_idct8_add4_neon; +} + +void ff_h264dsp_init_arm(H264DSPContext *c) +{ + if (HAVE_NEON) ff_h264dsp_init_neon(c); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_init_arm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_init_arm.c new file mode 100644 index 00000000..87cc558e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_init_arm.c @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2009 Mans Rullgard + * + * 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 + */ + +#include + +#include "libavcodec/h264pred.h" + +void ff_pred16x16_vert_neon(uint8_t *src, int stride); +void ff_pred16x16_hor_neon(uint8_t *src, int stride); +void ff_pred16x16_plane_neon(uint8_t *src, int stride); +void ff_pred16x16_dc_neon(uint8_t *src, int stride); +void ff_pred16x16_128_dc_neon(uint8_t *src, int stride); +void ff_pred16x16_left_dc_neon(uint8_t *src, int stride); +void ff_pred16x16_top_dc_neon(uint8_t *src, int stride); + +void ff_pred8x8_vert_neon(uint8_t *src, int stride); +void ff_pred8x8_hor_neon(uint8_t *src, int stride); +void ff_pred8x8_plane_neon(uint8_t *src, int stride); +void ff_pred8x8_dc_neon(uint8_t *src, int stride); +void ff_pred8x8_128_dc_neon(uint8_t *src, int stride); +void ff_pred8x8_left_dc_neon(uint8_t *src, int stride); +void ff_pred8x8_top_dc_neon(uint8_t *src, int stride); +void ff_pred8x8_l0t_dc_neon(uint8_t *src, int stride); +void ff_pred8x8_0lt_dc_neon(uint8_t *src, int stride); +void ff_pred8x8_l00_dc_neon(uint8_t *src, int stride); +void ff_pred8x8_0l0_dc_neon(uint8_t *src, int stride); + +static void ff_h264_pred_init_neon(H264PredContext *h, int codec_id) +{ + h->pred8x8[VERT_PRED8x8 ] = ff_pred8x8_vert_neon; + h->pred8x8[HOR_PRED8x8 ] = ff_pred8x8_hor_neon; + if (codec_id != CODEC_ID_VP8) + h->pred8x8[PLANE_PRED8x8] = ff_pred8x8_plane_neon; + h->pred8x8[DC_128_PRED8x8 ] = ff_pred8x8_128_dc_neon; + if (codec_id != CODEC_ID_RV40 && codec_id != CODEC_ID_VP8) { + h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_neon; + h->pred8x8[LEFT_DC_PRED8x8] = ff_pred8x8_left_dc_neon; + h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_neon; + h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8] = ff_pred8x8_l0t_dc_neon; + h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8] = ff_pred8x8_0lt_dc_neon; + h->pred8x8[ALZHEIMER_DC_L00_PRED8x8] = ff_pred8x8_l00_dc_neon; + h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8] = ff_pred8x8_0l0_dc_neon; + } + + h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_neon; + h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vert_neon; + h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_hor_neon; + h->pred16x16[LEFT_DC_PRED8x8] = ff_pred16x16_left_dc_neon; + h->pred16x16[TOP_DC_PRED8x8 ] = ff_pred16x16_top_dc_neon; + h->pred16x16[DC_128_PRED8x8 ] = ff_pred16x16_128_dc_neon; + if (codec_id != CODEC_ID_SVQ3 && codec_id != CODEC_ID_RV40 && codec_id != CODEC_ID_VP8) + h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_neon; +} + +void ff_h264_pred_init_arm(H264PredContext *h, int codec_id) +{ + if (HAVE_NEON) ff_h264_pred_init_neon(h, codec_id); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_neon.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_neon.S new file mode 100644 index 00000000..63c96ee7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/h264pred_neon.S @@ -0,0 +1,362 @@ +/* + * Copyright (c) 2009 Mans Rullgard + * + * 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 + */ + +#include "asm.S" + + .macro ldcol.8 rd, rs, rt, n=8, hi=0 +.if \n == 8 || \hi == 0 + vld1.8 {\rd[0]}, [\rs], \rt + vld1.8 {\rd[1]}, [\rs], \rt + vld1.8 {\rd[2]}, [\rs], \rt + vld1.8 {\rd[3]}, [\rs], \rt +.endif +.if \n == 8 || \hi == 1 + vld1.8 {\rd[4]}, [\rs], \rt + vld1.8 {\rd[5]}, [\rs], \rt + vld1.8 {\rd[6]}, [\rs], \rt + vld1.8 {\rd[7]}, [\rs], \rt +.endif + .endm + + .macro add16x8 dq, dl, dh, rl, rh + vaddl.u8 \dq, \rl, \rh + vadd.u16 \dl, \dl, \dh + vpadd.u16 \dl, \dl, \dl + vpadd.u16 \dl, \dl, \dl + .endm + +function ff_pred16x16_128_dc_neon, export=1 + vmov.i8 q0, #128 + b .L_pred16x16_dc_end +endfunc + +function ff_pred16x16_top_dc_neon, export=1 + sub r2, r0, r1 + vld1.8 {q0}, [r2,:128] + add16x8 q0, d0, d1, d0, d1 + vrshrn.u16 d0, q0, #4 + vdup.8 q0, d0[0] + b .L_pred16x16_dc_end +endfunc + +function ff_pred16x16_left_dc_neon, export=1 + sub r2, r0, #1 + ldcol.8 d0, r2, r1 + ldcol.8 d1, r2, r1 + add16x8 q0, d0, d1, d0, d1 + vrshrn.u16 d0, q0, #4 + vdup.8 q0, d0[0] + b .L_pred16x16_dc_end +endfunc + +function ff_pred16x16_dc_neon, export=1 + sub r2, r0, r1 + vld1.8 {q0}, [r2,:128] + sub r2, r0, #1 + ldcol.8 d2, r2, r1 + ldcol.8 d3, r2, r1 + vaddl.u8 q0, d0, d1 + vaddl.u8 q1, d2, d3 + vadd.u16 q0, q0, q1 + vadd.u16 d0, d0, d1 + vpadd.u16 d0, d0, d0 + vpadd.u16 d0, d0, d0 + vrshrn.u16 d0, q0, #5 + vdup.8 q0, d0[0] +.L_pred16x16_dc_end: + mov r3, #8 +6: vst1.8 {q0}, [r0,:128], r1 + vst1.8 {q0}, [r0,:128], r1 + subs r3, r3, #1 + bne 6b + bx lr +endfunc + +function ff_pred16x16_hor_neon, export=1 + sub r2, r0, #1 + mov r3, #16 +1: vld1.8 {d0[],d1[]},[r2], r1 + vst1.8 {q0}, [r0,:128], r1 + subs r3, r3, #1 + bne 1b + bx lr +endfunc + +function ff_pred16x16_vert_neon, export=1 + sub r0, r0, r1 + vld1.8 {q0}, [r0,:128], r1 + mov r3, #8 +1: vst1.8 {q0}, [r0,:128], r1 + vst1.8 {q0}, [r0,:128], r1 + subs r3, r3, #1 + bne 1b + bx lr +endfunc + +function ff_pred16x16_plane_neon, export=1 + sub r3, r0, r1 + add r2, r3, #8 + sub r3, r3, #1 + vld1.8 {d0}, [r3] + vld1.8 {d2}, [r2,:64], r1 + ldcol.8 d1, r3, r1 + add r3, r3, r1 + ldcol.8 d3, r3, r1 + vrev64.8 q0, q0 + vaddl.u8 q8, d2, d3 + vsubl.u8 q2, d2, d0 + vsubl.u8 q3, d3, d1 + movrel r3, p16weight + vld1.8 {q0}, [r3,:128] + vmul.s16 q2, q2, q0 + vmul.s16 q3, q3, q0 + vadd.i16 d4, d4, d5 + vadd.i16 d5, d6, d7 + vpadd.i16 d4, d4, d5 + vpadd.i16 d4, d4, d4 + vshll.s16 q3, d4, #2 + vaddw.s16 q2, q3, d4 + vrshrn.s32 d4, q2, #6 + mov r3, #0 + vtrn.16 d4, d5 + vadd.i16 d2, d4, d5 + vshl.i16 d3, d2, #3 + vrev64.16 d16, d17 + vsub.i16 d3, d3, d2 + vadd.i16 d16, d16, d0 + vshl.i16 d2, d16, #4 + vsub.i16 d2, d2, d3 + vshl.i16 d3, d4, #4 + vext.16 q0, q0, q0, #7 + vsub.i16 d6, d5, d3 + vmov.16 d0[0], r3 + vmul.i16 q0, q0, d4[0] + vdup.16 q1, d2[0] + vdup.16 q2, d4[0] + vdup.16 q3, d6[0] + vshl.i16 q2, q2, #3 + vadd.i16 q1, q1, q0 + vadd.i16 q3, q3, q2 + mov r3, #16 +1: + vqshrun.s16 d0, q1, #5 + vadd.i16 q1, q1, q2 + vqshrun.s16 d1, q1, #5 + vadd.i16 q1, q1, q3 + vst1.8 {q0}, [r0,:128], r1 + subs r3, r3, #1 + bne 1b + bx lr +endfunc + + .section .rodata + .align 4 +p16weight: + .short 1,2,3,4,5,6,7,8 + + .text + +function ff_pred8x8_hor_neon, export=1 + sub r2, r0, #1 + mov r3, #8 +1: vld1.8 {d0[]}, [r2], r1 + vst1.8 {d0}, [r0,:64], r1 + subs r3, r3, #1 + bne 1b + bx lr +endfunc + +function ff_pred8x8_vert_neon, export=1 + sub r0, r0, r1 + vld1.8 {d0}, [r0,:64], r1 + mov r3, #4 +1: vst1.8 {d0}, [r0,:64], r1 + vst1.8 {d0}, [r0,:64], r1 + subs r3, r3, #1 + bne 1b + bx lr +endfunc + +function ff_pred8x8_plane_neon, export=1 + sub r3, r0, r1 + add r2, r3, #4 + sub r3, r3, #1 + vld1.32 {d0[0]}, [r3] + vld1.32 {d2[0]}, [r2,:32], r1 + ldcol.8 d0, r3, r1, 4, hi=1 + add r3, r3, r1 + ldcol.8 d3, r3, r1, 4 + vaddl.u8 q8, d2, d3 + vrev32.8 d0, d0 + vtrn.32 d2, d3 + vsubl.u8 q2, d2, d0 + movrel r3, p16weight + vld1.16 {q0}, [r3,:128] + vmul.s16 d4, d4, d0 + vmul.s16 d5, d5, d0 + vpadd.i16 d4, d4, d5 + vpaddl.s16 d4, d4 + vshl.i32 d5, d4, #4 + vadd.s32 d4, d4, d5 + vrshrn.s32 d4, q2, #5 + mov r3, #0 + vtrn.16 d4, d5 + vadd.i16 d2, d4, d5 + vshl.i16 d3, d2, #2 + vrev64.16 d16, d16 + vsub.i16 d3, d3, d2 + vadd.i16 d16, d16, d0 + vshl.i16 d2, d16, #4 + vsub.i16 d2, d2, d3 + vshl.i16 d3, d4, #3 + vext.16 q0, q0, q0, #7 + vsub.i16 d6, d5, d3 + vmov.16 d0[0], r3 + vmul.i16 q0, q0, d4[0] + vdup.16 q1, d2[0] + vdup.16 q2, d4[0] + vdup.16 q3, d6[0] + vshl.i16 q2, q2, #3 + vadd.i16 q1, q1, q0 + vadd.i16 q3, q3, q2 + mov r3, #8 +1: + vqshrun.s16 d0, q1, #5 + vadd.i16 q1, q1, q3 + vst1.8 {d0}, [r0,:64], r1 + subs r3, r3, #1 + bne 1b + bx lr +endfunc + +function ff_pred8x8_128_dc_neon, export=1 + vmov.i8 q0, #128 + b .L_pred8x8_dc_end +endfunc + +function ff_pred8x8_top_dc_neon, export=1 + sub r2, r0, r1 + vld1.8 {d0}, [r2,:64] + vpaddl.u8 d0, d0 + vpadd.u16 d0, d0, d0 + vrshrn.u16 d0, q0, #2 + vdup.8 d1, d0[1] + vdup.8 d0, d0[0] + vtrn.32 d0, d1 + b .L_pred8x8_dc_end +endfunc + +function ff_pred8x8_left_dc_neon, export=1 + sub r2, r0, #1 + ldcol.8 d0, r2, r1 + vpaddl.u8 d0, d0 + vpadd.u16 d0, d0, d0 + vrshrn.u16 d0, q0, #2 + vdup.8 d1, d0[1] + vdup.8 d0, d0[0] + b .L_pred8x8_dc_end +endfunc + +function ff_pred8x8_dc_neon, export=1 + sub r2, r0, r1 + vld1.8 {d0}, [r2,:64] + sub r2, r0, #1 + ldcol.8 d1, r2, r1 + vtrn.32 d0, d1 + vpaddl.u8 q0, q0 + vpadd.u16 d0, d0, d1 + vpadd.u16 d1, d0, d0 + vrshrn.u16 d2, q0, #3 + vrshrn.u16 d3, q0, #2 + vdup.8 d0, d2[4] + vdup.8 d1, d3[3] + vdup.8 d4, d3[2] + vdup.8 d5, d2[5] + vtrn.32 q0, q2 +.L_pred8x8_dc_end: + mov r3, #4 + add r2, r0, r1, lsl #2 +6: vst1.8 {d0}, [r0,:64], r1 + vst1.8 {d1}, [r2,:64], r1 + subs r3, r3, #1 + bne 6b + bx lr +endfunc + +function ff_pred8x8_l0t_dc_neon, export=1 + sub r2, r0, r1 + vld1.8 {d0}, [r2,:64] + sub r2, r0, #1 + ldcol.8 d1, r2, r1, 4 + vtrn.32 d0, d1 + vpaddl.u8 q0, q0 + vpadd.u16 d0, d0, d1 + vpadd.u16 d1, d0, d0 + vrshrn.u16 d2, q0, #3 + vrshrn.u16 d3, q0, #2 + vdup.8 d0, d2[4] + vdup.8 d1, d3[0] + vdup.8 q2, d3[2] + vtrn.32 q0, q2 + b .L_pred8x8_dc_end +endfunc + +function ff_pred8x8_l00_dc_neon, export=1 + sub r2, r0, #1 + ldcol.8 d0, r2, r1, 4 + vpaddl.u8 d0, d0 + vpadd.u16 d0, d0, d0 + vrshrn.u16 d0, q0, #2 + vmov.i8 d1, #128 + vdup.8 d0, d0[0] + b .L_pred8x8_dc_end +endfunc + +function ff_pred8x8_0lt_dc_neon, export=1 + sub r2, r0, r1 + vld1.8 {d0}, [r2,:64] + add r2, r0, r1, lsl #2 + sub r2, r2, #1 + ldcol.8 d1, r2, r1, 4, hi=1 + vtrn.32 d0, d1 + vpaddl.u8 q0, q0 + vpadd.u16 d0, d0, d1 + vpadd.u16 d1, d0, d0 + vrshrn.u16 d3, q0, #2 + vrshrn.u16 d2, q0, #3 + vdup.8 d0, d3[0] + vdup.8 d1, d3[3] + vdup.8 d4, d3[2] + vdup.8 d5, d2[5] + vtrn.32 q0, q2 + b .L_pred8x8_dc_end +endfunc + +function ff_pred8x8_0l0_dc_neon, export=1 + add r2, r0, r1, lsl #2 + sub r2, r2, #1 + ldcol.8 d1, r2, r1, 4 + vpaddl.u8 d2, d1 + vpadd.u16 d2, d2, d2 + vrshrn.u16 d1, q1, #2 + vmov.i8 d0, #128 + vdup.8 d1, d1[0] + b .L_pred8x8_dc_end +endfunc diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/int_neon.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/int_neon.S new file mode 100644 index 00000000..e8023e06 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/int_neon.S @@ -0,0 +1,118 @@ +/* + * ARM NEON optimised integer operations + * Copyright (c) 2009 Kostya Shishkov + * + * 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 + */ + +#include "asm.S" + + preserve8 + .fpu neon + .text + +function ff_scalarproduct_int16_neon, export=1 + vmov.i16 q0, #0 + vmov.i16 q1, #0 + vmov.i16 q2, #0 + vmov.i16 q3, #0 + negs r3, r3 + beq 2f + + vdup.s32 q12, r3 +1: vld1.16 {d16-d17}, [r0]! + vld1.16 {d20-d21}, [r1,:128]! + vmull.s16 q12, d16, d20 + vld1.16 {d18-d19}, [r0]! + vmull.s16 q13, d17, d21 + vld1.16 {d22-d23}, [r1,:128]! + vmull.s16 q14, d18, d22 + vmull.s16 q15, d19, d23 + vshl.s32 q8, q12, q12 + vshl.s32 q9, q13, q12 + vadd.s32 q0, q0, q8 + vshl.s32 q10, q14, q12 + vadd.s32 q1, q1, q9 + vshl.s32 q11, q15, q12 + vadd.s32 q2, q2, q10 + vadd.s32 q3, q3, q11 + subs r2, r2, #16 + bne 1b + b 3f + +2: vld1.16 {d16-d17}, [r0]! + vld1.16 {d20-d21}, [r1,:128]! + vmlal.s16 q0, d16, d20 + vld1.16 {d18-d19}, [r0]! + vmlal.s16 q1, d17, d21 + vld1.16 {d22-d23}, [r1,:128]! + vmlal.s16 q2, d18, d22 + vmlal.s16 q3, d19, d23 + subs r2, r2, #16 + bne 2b + +3: vpadd.s32 d16, d0, d1 + vpadd.s32 d17, d2, d3 + vpadd.s32 d10, d4, d5 + vpadd.s32 d11, d6, d7 + vpadd.s32 d0, d16, d17 + vpadd.s32 d1, d10, d11 + vpadd.s32 d2, d0, d1 + vpaddl.s32 d3, d2 + vmov.32 r0, d3[0] + bx lr +endfunc + +@ scalarproduct_and_madd_int16(/*aligned*/v0,v1,v2,order,mul) +function ff_scalarproduct_and_madd_int16_neon, export=1 + vld1.16 {d28[],d29[]}, [sp] + vmov.i16 q0, #0 + vmov.i16 q1, #0 + vmov.i16 q2, #0 + vmov.i16 q3, #0 + mov r12, r0 + +1: vld1.16 {d16-d17}, [r0,:128]! + vld1.16 {d18-d19}, [r1]! + vld1.16 {d20-d21}, [r2]! + vld1.16 {d22-d23}, [r0,:128]! + vld1.16 {d24-d25}, [r1]! + vld1.16 {d26-d27}, [r2]! + vmul.s16 q10, q10, q14 + vmul.s16 q13, q13, q14 + vmlal.s16 q0, d16, d18 + vmlal.s16 q1, d17, d19 + vadd.s16 q10, q8, q10 + vadd.s16 q13, q11, q13 + vmlal.s16 q2, d22, d24 + vmlal.s16 q3, d23, d25 + vst1.16 {q10}, [r12,:128]! + subs r3, r3, #16 + vst1.16 {q13}, [r12,:128]! + bne 1b + + vpadd.s32 d16, d0, d1 + vpadd.s32 d17, d2, d3 + vpadd.s32 d10, d4, d5 + vpadd.s32 d11, d6, d7 + vpadd.s32 d0, d16, d17 + vpadd.s32 d1, d10, d11 + vpadd.s32 d2, d0, d1 + vpaddl.s32 d3, d2 + vmov.32 r0, d3[0] + bx lr +endfunc diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/mpegvideo_arm.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/mpegvideo_arm.h new file mode 100644 index 00000000..4cc25fdd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/mpegvideo_arm.h @@ -0,0 +1,27 @@ +/* + * 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 + */ + +#ifndef AVCODEC_ARM_MPEGVIDEO_H +#define AVCODEC_ARM_MPEGVIDEO_H + +#include "libavcodec/mpegvideo.h" + +void MPV_common_init_iwmmxt(MpegEncContext *s); +void MPV_common_init_armv5te(MpegEncContext *s); + +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/mpegvideo_neon.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/mpegvideo_neon.S new file mode 100644 index 00000000..b695fb7c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/mpegvideo_neon.S @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#include "asm.S" +#include "asm-offsets.h" + +function ff_dct_unquantize_h263_inter_neon, export=1 + add r12, r0, #BLOCK_LAST_INDEX + ldr r12, [r12, r2, lsl #2] + add r0, r0, #INTER_SCANTAB_RASTER_END + ldrb r12, [r0, r12] + sub r2, r3, #1 + lsl r0, r3, #1 + orr r2, r2, #1 + add r3, r12, #1 +endfunc + +function ff_dct_unquantize_h263_neon, export=1 + vdup.16 q15, r0 @ qmul + vdup.16 q14, r2 @ qadd + vneg.s16 q13, q14 + cmp r3, #4 + mov r0, r1 + ble 2f +1: + vld1.16 {q0}, [r0,:128]! + vclt.s16 q3, q0, #0 + vld1.16 {q8}, [r0,:128]! + vceq.s16 q1, q0, #0 + vmul.s16 q2, q0, q15 + vclt.s16 q11, q8, #0 + vmul.s16 q10, q8, q15 + vbsl q3, q13, q14 + vbsl q11, q13, q14 + vadd.s16 q2, q2, q3 + vceq.s16 q9, q8, #0 + vadd.s16 q10, q10, q11 + vbif q0, q2, q1 + vbif q8, q10, q9 + subs r3, r3, #16 + vst1.16 {q0}, [r1,:128]! + vst1.16 {q8}, [r1,:128]! + bxle lr + cmp r3, #8 + bgt 1b +2: + vld1.16 {d0}, [r0,:64] + vclt.s16 d3, d0, #0 + vceq.s16 d1, d0, #0 + vmul.s16 d2, d0, d30 + vbsl d3, d26, d28 + vadd.s16 d2, d2, d3 + vbif d0, d2, d1 + vst1.16 {d0}, [r1,:64] + bx lr +endfunc + +function ff_dct_unquantize_h263_intra_neon, export=1 + push {r4-r6,lr} + add r12, r0, #BLOCK_LAST_INDEX + ldr r6, [r0, #AC_PRED] + add lr, r0, #INTER_SCANTAB_RASTER_END + cmp r6, #0 + movne r12, #63 + bne 1f + ldr r12, [r12, r2, lsl #2] + ldrb r12, [lr, r12] +1: ldr r5, [r0, #H263_AIC] + ldrsh r4, [r1] + cmp r5, #0 + mov r5, r1 + movne r2, #0 + bne 2f + cmp r2, #4 + addge r0, r0, #4 + sub r2, r3, #1 + ldr r6, [r0, #Y_DC_SCALE] + orr r2, r2, #1 + smulbb r4, r4, r6 +2: lsl r0, r3, #1 + add r3, r12, #1 + bl ff_dct_unquantize_h263_neon + vmov.16 d0[0], r4 + vst1.16 {d0[0]}, [r5] + pop {r4-r6,pc} +endfunc diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/rdft_neon.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/rdft_neon.S new file mode 100644 index 00000000..4f8a1032 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/rdft_neon.S @@ -0,0 +1,151 @@ +/* + * ARM NEON optimised RDFT + * Copyright (c) 2009 Mans Rullgard + * + * 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 + */ + +#include "asm.S" + + preserve8 + +function ff_rdft_calc_neon, export=1 + push {r4-r8,lr} + + ldr r6, [r0, #4] @ inverse + mov r4, r0 + mov r5, r1 + + lsls r6, r6, #31 + bne 1f + add r0, r4, #20 + bl X(ff_fft_permute_neon) + add r0, r4, #20 + mov r1, r5 + bl X(ff_fft_calc_neon) +1: + ldr r12, [r4, #0] @ nbits + mov r2, #1 + lsl r12, r2, r12 + add r0, r5, #8 + add r1, r5, r12, lsl #2 + lsr r12, r12, #2 + ldr r2, [r4, #12] @ tcos + sub r12, r12, #2 + ldr r3, [r4, #16] @ tsin + mov r7, r0 + sub r1, r1, #8 + mov lr, r1 + mov r8, #-8 + vld1.32 {d0}, [r0,:64]! @ d1[0,1] + vld1.32 {d1}, [r1,:64], r8 @ d2[0,1] + vld1.32 {d4}, [r2,:64]! @ tcos[i] + vld1.32 {d5}, [r3,:64]! @ tsin[i] + vmov.f32 d18, #0.5 @ k1 + vdup.32 d19, r6 + pld [r0, #32] + veor d19, d18, d19 @ k2 + vmov.i32 d16, #0 + vmov.i32 d17, #1<<31 + pld [r1, #-32] + vtrn.32 d16, d17 + pld [r2, #32] + vrev64.32 d16, d16 @ d16=1,0 d17=0,1 + pld [r3, #32] +2: + veor q1, q0, q8 @ -d1[0],d1[1], d2[0],-d2[1] + vld1.32 {d24}, [r0,:64]! @ d1[0,1] + vadd.f32 d0, d0, d3 @ d1[0]+d2[0], d1[1]-d2[1] + vld1.32 {d25}, [r1,:64], r8 @ d2[0,1] + vadd.f32 d1, d2, d1 @ -d1[0]+d2[0], d1[1]+d2[1] + veor q3, q12, q8 @ -d1[0],d1[1], d2[0],-d2[1] + pld [r0, #32] + vmul.f32 q10, q0, q9 @ ev.re, ev.im, od.im, od.re + pld [r1, #-32] + vadd.f32 d0, d24, d7 @ d1[0]+d2[0], d1[1]-d2[1] + vadd.f32 d1, d6, d25 @ -d1[0]+d2[0], d1[1]+d2[1] + vmul.f32 q11, q0, q9 @ ev.re, ev.im, od.im, od.re + veor d7, d21, d16 @ -od.im, od.re + vrev64.32 d3, d21 @ od.re, od.im + veor d6, d20, d17 @ ev.re,-ev.im + veor d2, d3, d16 @ -od.re, od.im + vmla.f32 d20, d3, d4[1] + vmla.f32 d20, d7, d5[1] + vmla.f32 d6, d2, d4[1] + vmla.f32 d6, d21, d5[1] + vld1.32 {d4}, [r2,:64]! @ tcos[i] + veor d7, d23, d16 @ -od.im, od.re + vld1.32 {d5}, [r3,:64]! @ tsin[i] + veor d24, d22, d17 @ ev.re,-ev.im + vrev64.32 d3, d23 @ od.re, od.im + pld [r2, #32] + veor d2, d3, d16 @ -od.re, od.im + pld [r3, #32] + vmla.f32 d22, d3, d4[0] + vmla.f32 d22, d7, d5[0] + vmla.f32 d24, d2, d4[0] + vmla.f32 d24, d23, d5[0] + vld1.32 {d0}, [r0,:64]! @ d1[0,1] + vld1.32 {d1}, [r1,:64], r8 @ d2[0,1] + vst1.32 {d20}, [r7,:64]! + vst1.32 {d6}, [lr,:64], r8 + vst1.32 {d22}, [r7,:64]! + vst1.32 {d24}, [lr,:64], r8 + subs r12, r12, #2 + bgt 2b + + veor q1, q0, q8 @ -d1[0],d1[1], d2[0],-d2[1] + vadd.f32 d0, d0, d3 @ d1[0]+d2[0], d1[1]-d2[1] + vadd.f32 d1, d2, d1 @ -d1[0]+d2[0], d1[1]+d2[1] + ldr r2, [r4, #8] @ sign_convention + vmul.f32 q10, q0, q9 @ ev.re, ev.im, od.im, od.re + add r0, r0, #4 + bfc r2, #0, #31 + vld1.32 {d0[0]}, [r0,:32] + veor d7, d21, d16 @ -od.im, od.re + vrev64.32 d3, d21 @ od.re, od.im + veor d6, d20, d17 @ ev.re,-ev.im + vld1.32 {d22}, [r5,:64] + vdup.32 d1, r2 + vmov d23, d22 + veor d2, d3, d16 @ -od.re, od.im + vtrn.32 d22, d23 + veor d0, d0, d1 + veor d23, d23, d17 + vmla.f32 d20, d3, d4[1] + vmla.f32 d20, d7, d5[1] + vmla.f32 d6, d2, d4[1] + vmla.f32 d6, d21, d5[1] + vadd.f32 d22, d22, d23 + vst1.32 {d20}, [r7,:64] + vst1.32 {d6}, [lr,:64] + vst1.32 {d0[0]}, [r0,:32] + vst1.32 {d22}, [r5,:64] + + cmp r6, #0 + popeq {r4-r8,pc} + + vmul.f32 d22, d22, d18 + vst1.32 {d22}, [r5,:64] + add r0, r4, #20 + mov r1, r5 + bl X(ff_fft_permute_neon) + add r0, r4, #20 + mov r1, r5 + pop {r4-r8,lr} + b X(ff_fft_calc_neon) +endfunc diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/synth_filter_neon.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/synth_filter_neon.S new file mode 100644 index 00000000..1464abe5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/synth_filter_neon.S @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#include "asm.S" + + preserve8 + +function ff_synth_filter_float_neon, export=1 + push {r3-r11,lr} + + ldr r4, [r2] @ synth_buf_offset + add r1, r1, r4, lsl #2 @ synth_buf + sub r12, r4, #32 + bfc r12, #9, #23 + bic r4, r4, #63 + str r12, [r2] + + ldr r2, [sp, #12*4] @ in + mov r9, r1 @ synth_buf + +VFP vpush {d0} + bl X(ff_imdct_half_neon) +VFP vpop {d0} + pop {r3} + + ldr r5, [sp, #9*4] @ window + ldr r2, [sp, #10*4] @ out +NOVFP vldr s0, [sp, #12*4] @ scale + add r8, r9, #12*4 + + mov lr, #64*4 + mov r1, #4 +1: + add r10, r9, #16*4 @ synth_buf + add r11, r8, #16*4 + add r0, r5, #16*4 @ window + add r6, r5, #32*4 + add r7, r5, #48*4 + + vld1.32 {q10}, [r3,:128] @ a + add r3, r3, #16*4 + vld1.32 {q1}, [r3,:128] @ b + vmov.f32 q2, #0.0 @ c + vmov.f32 q3, #0.0 @ d + + mov r12, #512 +2: + vld1.32 {q9}, [r8, :128], lr + vrev64.32 q9, q9 + vld1.32 {q8}, [r5, :128], lr + vmls.f32 d20, d16, d19 + vld1.32 {q11}, [r0, :128], lr + vmls.f32 d21, d17, d18 + vld1.32 {q12}, [r9, :128], lr + vmla.f32 d2, d22, d24 + vld1.32 {q8}, [r6, :128], lr + vmla.f32 d3, d23, d25 + vld1.32 {q9}, [r10,:128], lr + vmla.f32 d4, d16, d18 + vld1.32 {q12}, [r11,:128], lr + vmla.f32 d5, d17, d19 + vrev64.32 q12, q12 + vld1.32 {q11}, [r7, :128], lr + vmla.f32 d6, d22, d25 + vmla.f32 d7, d23, d24 + subs r12, r12, #64 + beq 3f + cmp r12, r4 + bne 2b + sub r8, r8, #512*4 + sub r9, r9, #512*4 + sub r10, r10, #512*4 + sub r11, r11, #512*4 + b 2b +3: + vmul.f32 q8, q10, d0[0] + vmul.f32 q9, q1, d0[0] + vst1.32 {q3}, [r3,:128] + sub r3, r3, #16*4 + vst1.32 {q2}, [r3,:128] + vst1.32 {q8}, [r2,:128] + add r2, r2, #16*4 + vst1.32 {q9}, [r2,:128] + + subs r1, r1, #1 + popeq {r4-r11,pc} + + cmp r4, #0 + subeq r8, r8, #512*4 + subeq r9, r9, #512*4 + sub r5, r5, #512*4 + sub r2, r2, #12*4 @ out + add r3, r3, #4*4 @ synth_buf2 + add r5, r5, #4*4 @ window + add r9, r9, #4*4 @ synth_buf + sub r8, r8, #4*4 @ synth_buf + b 1b +endfunc diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/vp56dsp_init_arm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/vp56dsp_init_arm.c new file mode 100644 index 00000000..ceab9a87 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/vp56dsp_init_arm.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#include +#include "libavcodec/avcodec.h" +#include "libavcodec/vp56dsp.h" + +void ff_vp6_edge_filter_hor_neon(uint8_t *yuv, int stride, int t); +void ff_vp6_edge_filter_ver_neon(uint8_t *yuv, int stride, int t); + +void ff_vp56dsp_init_arm(VP56DSPContext *s, enum CodecID codec) +{ + if (codec != CODEC_ID_VP5 && HAVE_NEON) { + s->edge_filter_hor = ff_vp6_edge_filter_hor_neon; + s->edge_filter_ver = ff_vp6_edge_filter_ver_neon; + } +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/vp56dsp_neon.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/vp56dsp_neon.S new file mode 100644 index 00000000..03536610 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/arm/vp56dsp_neon.S @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#include "asm.S" + +.macro vp6_edge_filter + vdup.16 q3, r2 @ t + vmov.i16 q13, #1 + vsubl.u8 q0, d20, d18 @ p[ 0] - p[-s] + vsubl.u8 q1, d16, d22 @ p[-2*s] - p[ s] + vsubl.u8 q14, d21, d19 + vsubl.u8 q15, d17, d23 + vadd.i16 q2, q0, q0 @ 2*(p[0]-p[-s]) + vadd.i16 d29, d28, d28 + vadd.i16 q0, q0, q1 @ p[0]-p[-s] + p[-2*s]-p[s] + vadd.i16 d28, d28, d30 + vadd.i16 q0, q0, q2 @ 3*(p[0]-p[-s]) + p[-2*s]-p[s] + vadd.i16 d28, d28, d29 + vrshr.s16 q0, q0, #3 @ v + vrshr.s16 d28, d28, #3 + vsub.i16 q8, q3, q13 @ t-1 + vabs.s16 q1, q0 @ V + vshr.s16 q2, q0, #15 @ s + vabs.s16 d30, d28 + vshr.s16 d29, d28, #15 + vsub.i16 q12, q1, q3 @ V-t + vsub.i16 d31, d30, d6 + vsub.i16 q12, q12, q13 @ V-t-1 + vsub.i16 d31, d31, d26 + vcge.u16 q12, q12, q8 @ V-t-1 >= t-1 + vcge.u16 d31, d31, d16 + vadd.i16 q13, q3, q3 @ 2*t + vadd.i16 d16, d6, d6 + vsub.i16 q13, q13, q1 @ 2*t - V + vsub.i16 d16, d16, d30 + vadd.i16 q13, q13, q2 @ += s + vadd.i16 d16, d16, d29 + veor q13, q13, q2 @ ^= s + veor d16, d16, d29 + vbif q0, q13, q12 + vbif d28, d16, d31 + vmovl.u8 q1, d20 + vmovl.u8 q15, d21 + vaddw.u8 q2, q0, d18 + vaddw.u8 q3, q14, d19 + vsub.i16 q1, q1, q0 + vsub.i16 d30, d30, d28 + vqmovun.s16 d18, q2 + vqmovun.s16 d19, q3 + vqmovun.s16 d20, q1 + vqmovun.s16 d21, q15 +.endm + +function ff_vp6_edge_filter_ver_neon, export=1 + sub r0, r0, r1, lsl #1 + vld1.8 {q8}, [r0], r1 @ p[-2*s] + vld1.8 {q9}, [r0], r1 @ p[-s] + vld1.8 {q10}, [r0], r1 @ p[0] + vld1.8 {q11}, [r0] @ p[s] + vp6_edge_filter + sub r0, r0, r1, lsl #1 + sub r1, r1, #8 + vst1.8 {d18}, [r0]! + vst1.32 {d19[0]}, [r0], r1 + vst1.8 {d20}, [r0]! + vst1.32 {d21[0]}, [r0] + bx lr +endfunc + +function ff_vp6_edge_filter_hor_neon, export=1 + sub r3, r0, #1 + sub r0, r0, #2 + vld1.32 {d16[0]}, [r0], r1 + vld1.32 {d18[0]}, [r0], r1 + vld1.32 {d20[0]}, [r0], r1 + vld1.32 {d22[0]}, [r0], r1 + vld1.32 {d16[1]}, [r0], r1 + vld1.32 {d18[1]}, [r0], r1 + vld1.32 {d20[1]}, [r0], r1 + vld1.32 {d22[1]}, [r0], r1 + vld1.32 {d17[0]}, [r0], r1 + vld1.32 {d19[0]}, [r0], r1 + vld1.32 {d21[0]}, [r0], r1 + vld1.32 {d23[0]}, [r0], r1 + vtrn.8 q8, q9 + vtrn.8 q10, q11 + vtrn.16 q8, q10 + vtrn.16 q9, q11 + vp6_edge_filter + vtrn.8 q9, q10 + vst1.16 {d18[0]}, [r3], r1 + vst1.16 {d20[0]}, [r3], r1 + vst1.16 {d18[1]}, [r3], r1 + vst1.16 {d20[1]}, [r3], r1 + vst1.16 {d18[2]}, [r3], r1 + vst1.16 {d20[2]}, [r3], r1 + vst1.16 {d18[3]}, [r3], r1 + vst1.16 {d20[3]}, [r3], r1 + vst1.16 {d19[0]}, [r3], r1 + vst1.16 {d21[0]}, [r3], r1 + vst1.16 {d19[1]}, [r3], r1 + vst1.16 {d21[1]}, [r3], r1 + bx lr +endfunc diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ass.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ass.c new file mode 100644 index 00000000..0662b8df --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ass.c @@ -0,0 +1,124 @@ +/* + * SSA/ASS common funtions + * Copyright (c) 2010 Aurelien Jacobs + * + * 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 + */ + +#include "avcodec.h" +#include "ass.h" + +/** + * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS. + * + * @param avctx pointer to the AVCodecContext + * @param font name of the default font face to use + * @param font_size default font size to use + * @param color default text color to use (ABGR) + * @param back_color default background color to use (ABGR) + * @param bold 1 for bold text, 0 for normal text + * @param italic 1 for italic text, 0 for normal text + * @param underline 1 for underline text, 0 for normal text + * @param alignment position of the text (left, center, top...), defined after + * the layout of the numpad (1-3 sub, 4-6 mid, 7-9 top) + * @return >= 0 on success otherwise an error code <0 + */ +static int ff_ass_subtitle_header(AVCodecContext *avctx, + const char *font, int font_size, + int color, int back_color, + int bold, int italic, int underline, + int alignment) +{ + char header[512]; + + snprintf(header, sizeof(header), + "[Script Info]\r\n" + "ScriptType: v4.00+\r\n" + "\r\n" + "[V4+ Styles]\r\n" + "Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding\r\n" + "Style: Default,%s,%d,&H%x,&H%x,&H%x,&H%x,%d,%d,%d,1,1,0,%d,10,10,10,0,0\r\n" + "\r\n" + "[Events]\r\n" + "Format: Layer, Start, End, Text\r\n", + font, font_size, color, color, back_color, back_color, + -bold, -italic, -underline, alignment); + + avctx->subtitle_header = av_strdup(header); + if (!avctx->subtitle_header) + return AVERROR(ENOMEM); + avctx->subtitle_header_size = strlen(avctx->subtitle_header); + return 0; +} + +int ff_ass_subtitle_header_default(AVCodecContext *avctx) +{ + return ff_ass_subtitle_header(avctx, ASS_DEFAULT_FONT, + ASS_DEFAULT_FONT_SIZE, + ASS_DEFAULT_COLOR, + ASS_DEFAULT_BACK_COLOR, + ASS_DEFAULT_BOLD, + ASS_DEFAULT_ITALIC, + ASS_DEFAULT_UNDERLINE, + ASS_DEFAULT_ALIGNMENT); +} + +void ff_ass_init(AVSubtitle *sub) +{ + memset(sub, 0, sizeof(*sub)); +} + +static int ts_to_string(char *str, int strlen, int ts) +{ + int h, m, s; + h = ts/360000; ts -= 360000*h; + m = ts/ 6000; ts -= 6000*m; + s = ts/ 100; ts -= 100*s; + return snprintf(str, strlen, "%d:%02d:%02d.%02d", h, m, s, ts); +} + +int ff_ass_add_rect(AVSubtitle *sub, const char *dialog, + int ts_start, int ts_end, int raw) +{ + int len = 0, dlen, duration = ts_end - ts_start; + char s_start[16], s_end[16], header[48] = {0}; + AVSubtitleRect **rects; + + if (!raw) { + ts_to_string(s_start, sizeof(s_start), ts_start); + ts_to_string(s_end, sizeof(s_end), ts_end ); + len = snprintf(header, sizeof(header), "Dialogue: 0,%s,%s,", + s_start, s_end); + } + + dlen = strcspn(dialog, "\n"); + dlen += dialog[dlen] == '\n'; + + rects = av_realloc(sub->rects, (sub->num_rects+1) * sizeof(*sub->rects)); + if (!rects) + return AVERROR(ENOMEM); + sub->rects = rects; + sub->end_display_time = FFMAX(sub->end_display_time, 10 * duration); + rects[sub->num_rects] = av_mallocz(sizeof(*rects[0])); + rects[sub->num_rects]->type = SUBTITLE_ASS; + rects[sub->num_rects]->ass = av_malloc(len + dlen + 1); + strcpy (rects[sub->num_rects]->ass , header); + strncpy(rects[sub->num_rects]->ass + len, dialog, dlen); + rects[sub->num_rects]->ass[len+dlen] = 0; + sub->num_rects++; + return dlen; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ass.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ass.h new file mode 100644 index 00000000..f29a7c46 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ass.h @@ -0,0 +1,77 @@ +/* + * SSA/ASS common funtions + * Copyright (c) 2010 Aurelien Jacobs + * + * 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 + */ + +#ifndef AVCODEC_ASS_H +#define AVCODEC_ASS_H + +#include "avcodec.h" + +/** + * Default values for ASS style. + * @defgroup ass_default + * @{ + */ +#define ASS_DEFAULT_FONT "Arial" +#define ASS_DEFAULT_FONT_SIZE 16 +#define ASS_DEFAULT_COLOR 0xffffff +#define ASS_DEFAULT_BACK_COLOR 0 +#define ASS_DEFAULT_BOLD 0 +#define ASS_DEFAULT_ITALIC 0 +#define ASS_DEFAULT_UNDERLINE 0 +#define ASS_DEFAULT_ALIGNMENT 2 +/** @} */ + +/** + * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS + * with default style. + * + * @param avctx pointer to the AVCodecContext + * @return >= 0 on success otherwise an error code <0 + */ +int ff_ass_subtitle_header_default(AVCodecContext *avctx); + +/** + * Initialize an AVSubtitle structure for use with ff_ass_add_rect(). + * + * @param sub pointer to the AVSubtitle + */ +void ff_ass_init(AVSubtitle *sub); + +/** + * Add an ASS dialog line to an AVSubtitle as a new AVSubtitleRect. + * + * @param sub pointer to the AVSubtitle + * @param dialog ASS dialog to add to sub + * @param ts_start start timestamp for this dialog (in 1/100 second unit) + * @param ts_end end timestamp for this dialog (in 1/100 second unit) + * @param raw when set to 1, it indicates that dialog contains a whole ASS + * dialog line which should be copied as is. + * when set to 0, it indicates that dialog contains only the Text + * part of the ASS dialog line, the rest of the line + * will be generated. + * @return number of characters read from dialog. It can be less than the whole + * length of dialog, if dialog contains several lines of text. + * A negative value indicates an error. + */ +int ff_ass_add_rect(AVSubtitle *sub, const char *dialog, + int ts_start, int ts_end, int raw); + +#endif /* AVCODEC_ASS_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/assdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/assdec.c new file mode 100644 index 00000000..c1ad0c4a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/assdec.c @@ -0,0 +1,62 @@ +/* + * SSA/ASS decoder + * Copyright (c) 2010 Aurelien Jacobs + * + * 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 + */ + +#include "avcodec.h" +#include "ass.h" + +static av_cold int ass_decode_init(AVCodecContext *avctx) +{ + avctx->subtitle_header = av_malloc(avctx->extradata_size); + if (!avctx->extradata) + return AVERROR(ENOMEM); + memcpy(avctx->subtitle_header, avctx->extradata, avctx->extradata_size); + avctx->subtitle_header_size = avctx->extradata_size; + return 0; +} + +static int ass_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, + AVPacket *avpkt) +{ + const char *ptr = avpkt->data; + int len, size = avpkt->size; + + ff_ass_init(data); + + while (size > 0) { + len = ff_ass_add_rect(data, ptr, 0, 0/* FIXME: duration */, 1); + if (len < 0) + return len; + ptr += len; + size -= len; + } + + *got_sub_ptr = avpkt->size > 0; + return avpkt->size; +} + +AVCodec ff_ass_decoder = { + .name = "ass", + .long_name = NULL_IF_CONFIG_SMALL("Advanced SubStation Alpha subtitle"), + .type = AVMEDIA_TYPE_SUBTITLE, + .id = CODEC_ID_SSA, + .init = ass_decode_init, + .decode = ass_decode_frame, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/assenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/assenc.c new file mode 100644 index 00000000..103f2ff2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/assenc.c @@ -0,0 +1,67 @@ +/* + * SSA/ASS encoder + * Copyright (c) 2010 Aurelien Jacobs + * + * 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 + */ + +#include "avcodec.h" +#include "libavutil/avstring.h" + +static av_cold int ass_encode_init(AVCodecContext *avctx) +{ + avctx->extradata = av_malloc(avctx->subtitle_header_size); + if (!avctx->extradata) + return AVERROR(ENOMEM); + memcpy(avctx->extradata, avctx->subtitle_header, avctx->subtitle_header_size); + avctx->extradata_size = avctx->subtitle_header_size; + return 0; +} + +static int ass_encode_frame(AVCodecContext *avctx, + unsigned char *buf, int bufsize, void *data) +{ + AVSubtitle *sub = data; + int i, len, total_len = 0; + + for (i=0; inum_rects; i++) { + if (sub->rects[i]->type != SUBTITLE_ASS) { + av_log(avctx, AV_LOG_ERROR, "Only SUBTITLE_ASS type supported.\n"); + return -1; + } + + len = av_strlcpy(buf+total_len, sub->rects[i]->ass, bufsize-total_len); + + if (len > bufsize-total_len-1) { + av_log(avctx, AV_LOG_ERROR, "Buffer too small for ASS event.\n"); + return -1; + } + + total_len += len; + } + + return total_len; +} + +AVCodec ff_ass_encoder = { + .name = "ass", + .long_name = NULL_IF_CONFIG_SMALL("Advanced SubStation Alpha subtitle"), + .type = AVMEDIA_TYPE_SUBTITLE, + .id = CODEC_ID_SSA, + .init = ass_encode_init, + .encode = ass_encode_frame, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aura.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aura.c new file mode 100644 index 00000000..9041c7cb --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/aura.c @@ -0,0 +1,138 @@ +/* + * Aura 2 decoder + * + * 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 + * Aura 2 decoder + */ + +#include "avcodec.h" + +typedef struct AuraDecodeContext { + AVCodecContext *avctx; + AVFrame frame; +} AuraDecodeContext; + +static av_cold int aura_decode_init(AVCodecContext *avctx) +{ + AuraDecodeContext *s = avctx->priv_data; + + s->avctx = avctx; + /* width needs to be divisible by 4 for this codec to work */ + if (avctx->width & 0x3) + return -1; + avctx->pix_fmt = PIX_FMT_YUV422P; + + return 0; +} + +static int aura_decode_frame(AVCodecContext *avctx, + void *data, int *data_size, + AVPacket *pkt) +{ + AuraDecodeContext *s=avctx->priv_data; + + uint8_t *Y, *U, *V; + uint8_t val; + int x, y; + const uint8_t *buf = pkt->data; + + /* prediction error tables (make it clear that they are signed values) */ + const int8_t *delta_table = (const int8_t*)buf + 16; + + if (pkt->size != 48 + avctx->height * avctx->width) { + av_log(avctx, AV_LOG_ERROR, "got a buffer with %d bytes when %d were expected\n", + pkt->size, 48 + avctx->height * avctx->width); + return -1; + } + + /* pixel data starts 48 bytes in, after 3x16-byte tables */ + buf += 48; + + if(s->frame.data[0]) + avctx->release_buffer(avctx, &s->frame); + + s->frame.buffer_hints = FF_BUFFER_HINTS_VALID; + s->frame.reference = 0; + if(avctx->get_buffer(avctx, &s->frame) < 0) { + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return -1; + } + + Y = s->frame.data[0]; + U = s->frame.data[1]; + V = s->frame.data[2]; + + /* iterate through each line in the height */ + for (y = 0; y < avctx->height; y++) { + /* reset predictors */ + val = *buf++; + U[0] = val & 0xF0; + Y[0] = val << 4; + val = *buf++; + V[0] = val & 0xF0; + Y[1] = Y[0] + delta_table[val & 0xF]; + Y += 2; U++; V++; + + /* iterate through the remaining pixel groups (4 pixels/group) */ + for (x = 1; x < (avctx->width >> 1); x++) { + val = *buf++; + U[0] = U[-1] + delta_table[val >> 4]; + Y[0] = Y[-1] + delta_table[val & 0xF]; + val = *buf++; + V[0] = V[-1] + delta_table[val >> 4]; + Y[1] = Y[ 0] + delta_table[val & 0xF]; + Y += 2; U++; V++; + } + Y += s->frame.linesize[0] - avctx->width; + U += s->frame.linesize[1] - (avctx->width >> 1); + V += s->frame.linesize[2] - (avctx->width >> 1); + } + + *data_size=sizeof(AVFrame); + *(AVFrame*)data= s->frame; + + return pkt->size; +} + +static av_cold int aura_decode_end(AVCodecContext *avctx) +{ + AuraDecodeContext *s = avctx->priv_data; + + if (s->frame.data[0]) + avctx->release_buffer(avctx, &s->frame); + + return 0; +} + +AVCodec ff_aura2_decoder = { + "aura2", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_AURA2, + sizeof(AuraDecodeContext), + aura_decode_init, + NULL, + aura_decode_end, + aura_decode_frame, + CODEC_CAP_DR1, + NULL, + .long_name = NULL_IF_CONFIG_SMALL("Auravision Aura 2"), +}; + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avfft.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avfft.c new file mode 100644 index 00000000..7d5d0839 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avfft.c @@ -0,0 +1,142 @@ +/* + * 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 + */ + +#include "libavutil/mem.h" +#include "avfft.h" +#include "fft.h" + +/* FFT */ + +FFTContext *av_fft_init(int nbits, int inverse) +{ + FFTContext *s = av_malloc(sizeof(*s)); + + if (s && ff_fft_init(s, nbits, inverse)) + av_freep(&s); + + return s; +} + +void av_fft_permute(FFTContext *s, FFTComplex *z) +{ + s->fft_permute(s, z); +} + +void av_fft_calc(FFTContext *s, FFTComplex *z) +{ + s->fft_calc(s, z); +} + +void av_fft_end(FFTContext *s) +{ + if (s) { + ff_fft_end(s); + av_free(s); + } +} + +#if CONFIG_MDCT + +FFTContext *av_mdct_init(int nbits, int inverse, double scale) +{ + FFTContext *s = av_malloc(sizeof(*s)); + + if (s && ff_mdct_init(s, nbits, inverse, scale)) + av_freep(&s); + + return s; +} + +void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input) +{ + s->imdct_calc(s, output, input); +} + +void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input) +{ + s->imdct_half(s, output, input); +} + +void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input) +{ + s->mdct_calc(s, output, input); +} + +void av_mdct_end(FFTContext *s) +{ + if (s) { + ff_mdct_end(s); + av_free(s); + } +} + +#endif /* CONFIG_MDCT */ + +#if CONFIG_RDFT + +RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans) +{ + RDFTContext *s = av_malloc(sizeof(*s)); + + if (s && ff_rdft_init(s, nbits, trans)) + av_freep(&s); + + return s; +} + +void av_rdft_calc(RDFTContext *s, FFTSample *data) +{ + ff_rdft_calc(s, data); +} + +void av_rdft_end(RDFTContext *s) +{ + if (s) { + ff_rdft_end(s); + av_free(s); + } +} + +#endif /* CONFIG_RDFT */ + +#if CONFIG_DCT + +DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse) +{ + DCTContext *s = av_malloc(sizeof(*s)); + + if (s && ff_dct_init(s, nbits, inverse)) + av_freep(&s); + + return s; +} + +void av_dct_calc(DCTContext *s, FFTSample *data) +{ + ff_dct_calc(s, data); +} + +void av_dct_end(DCTContext *s) +{ + if (s) { + ff_dct_end(s); + av_free(s); + } +} + +#endif /* CONFIG_DCT */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avfft.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avfft.h new file mode 100644 index 00000000..be2d9c7e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/avfft.h @@ -0,0 +1,99 @@ +/* + * 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 + */ + +#ifndef AVCODEC_AVFFT_H +#define AVCODEC_AVFFT_H + +typedef float FFTSample; + +typedef struct FFTComplex { + FFTSample re, im; +} FFTComplex; + +typedef struct FFTContext FFTContext; + +/** + * Set up a complex FFT. + * @param nbits log2 of the length of the input array + * @param inverse if 0 perform the forward transform, if 1 perform the inverse + */ +FFTContext *av_fft_init(int nbits, int inverse); + +/** + * Do the permutation needed BEFORE calling ff_fft_calc(). + */ +void av_fft_permute(FFTContext *s, FFTComplex *z); + +/** + * Do a complex FFT with the parameters defined in av_fft_init(). The + * input data must be permuted before. No 1.0/sqrt(n) normalization is done. + */ +void av_fft_calc(FFTContext *s, FFTComplex *z); + +void av_fft_end(FFTContext *s); + +FFTContext *av_mdct_init(int nbits, int inverse, double scale); +void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); +void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +void av_mdct_end(FFTContext *s); + +/* Real Discrete Fourier Transform */ + +enum RDFTransformType { + DFT_R2C, + IDFT_C2R, + IDFT_R2C, + DFT_C2R, +}; + +typedef struct RDFTContext RDFTContext; + +/** + * Set up a real FFT. + * @param nbits log2 of the length of the input array + * @param trans the type of transform + */ +RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans); +void av_rdft_calc(RDFTContext *s, FFTSample *data); +void av_rdft_end(RDFTContext *s); + +/* Discrete Cosine Transform */ + +typedef struct DCTContext DCTContext; + +enum DCTTransformType { + DCT_II = 0, + DCT_III, + DCT_I, + DST_I, +}; + +/** + * Set up DCT. + * @param nbits size of the input array: + * (1 << nbits) for DCT-II, DCT-III and DST-I + * (1 << nbits) + 1 for DCT-I + * + * @note the first element of the input of DST-I is ignored + */ +DCTContext *av_dct_init(int nbits, enum DCTTransformType type); +void av_dct_calc(DCTContext *s, FFTSample *data); +void av_dct_end (DCTContext *s); + +#endif /* AVCODEC_AVFFT_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bfin/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bfin/Makefile new file mode 100644 index 00000000..e50e3cd6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bfin/Makefile @@ -0,0 +1,7 @@ +OBJS += bfin/dsputil_bfin.o \ + bfin/fdct_bfin.o \ + bfin/idct_bfin.o \ + bfin/mpegvideo_bfin.o \ + bfin/pixels_bfin.o \ + bfin/vp3_bfin.o \ + bfin/vp3_idct_bfin.o \ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bgmc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bgmc.c new file mode 100644 index 00000000..b9041d08 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bgmc.c @@ -0,0 +1,570 @@ +/* + * Block Gilbert-Moore decoder + * Copyright (c) 2010 Thilo Borgmann + * + * 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 + * Block Gilbert-Moore decoder as used by MPEG-4 ALS + * @author Thilo Borgmann + */ + + +#include "bgmc.h" + + +#define FREQ_BITS 14 // bits used by frequency counters +#define VALUE_BITS 18 // bits used to represent the values +#define TOP_VALUE ((1 << VALUE_BITS) - 1) // maximum value +#define FIRST_QTR (TOP_VALUE / 4 + 1) // first quarter of values maximum value +#define HALF (2 * FIRST_QTR) // first half of values maximum value +#define THIRD_QTR (3 * FIRST_QTR) // third quarter of values maximum value + +#define LUT_BITS (FREQ_BITS - 8) // number of bits used to index lookup tables +#define LUT_SIZE (1 << LUT_BITS) // size of the lookup tables +#define LUT_BUFF 4 // number of buffered lookup tables + + +/** Cumulative frequency tables for block Gilbert-Moore coding. + */ +static const uint16_t cf_tables_1[3][129] = { + { + 16384, 16066, 15748, 15431, 15114, 14799, 14485, 14173, 13861, 13552, + 13243, 12939, 12635, 12336, 12038, 11745, 11452, 11161, 10870, 10586, + 10303, 10027, 9751, 9483, 9215, 8953, 8692, 8440, 8189, 7946, + 7704, 7472, 7240, 7008, 6776, 6554, 6333, 6122, 5912, 5711, + 5512, 5320, 5128, 4947, 4766, 4595, 4425, 4264, 4104, 3946, + 3788, 3640, 3493, 3355, 3218, 3090, 2963, 2842, 2721, 2609, + 2498, 2395, 2292, 2196, 2100, 2004, 1908, 1820, 1732, 1651, + 1570, 1497, 1424, 1355, 1287, 1223, 1161, 1100, 1044, 988, + 938, 888, 839, 790, 746, 702, 662, 623, 588, 553, + 520, 488, 459, 431, 405, 380, 357, 334, 311, 288, + 268, 248, 230, 213, 197, 182, 168, 154, 142, 130, + 119, 108, 99, 90, 81, 72, 64, 56, 49, 42, + 36, 30, 25, 20, 15, 11, 7, 3, 0 + }, + { + 16384, 16080, 15776, 15473, 15170, 14868, 14567, 14268, 13970, 13674, + 13378, 13086, 12794, 12505, 12218, 11936, 11654, 11373, 11092, 10818, + 10544, 10276, 10008, 9749, 9490, 9236, 8982, 8737, 8492, 8256, + 8020, 7792, 7564, 7336, 7108, 6888, 6669, 6459, 6249, 6050, + 5852, 5660, 5468, 5286, 5104, 4931, 4760, 4598, 4436, 4275, + 4115, 3965, 3816, 3674, 3534, 3403, 3272, 3147, 3023, 2907, + 2792, 2684, 2577, 2476, 2375, 2274, 2173, 2079, 1986, 1897, + 1810, 1724, 1645, 1567, 1493, 1419, 1351, 1284, 1222, 1161, + 1105, 1050, 995, 941, 891, 842, 797, 753, 713, 673, + 636, 599, 566, 533, 503, 473, 446, 419, 392, 365, + 340, 316, 294, 272, 253, 234, 216, 199, 184, 169, + 155, 142, 130, 118, 106, 95, 85, 75, 66, 57, + 49, 41, 34, 27, 21, 15, 10, 5, 0 + }, + { + 16384, 16092, 15801, 15510, 15219, 14930, 14641, 14355, 14069, 13785, + 13501, 13219, 12938, 12661, 12384, 12112, 11841, 11571, 11301, 11037, + 10773, 10514, 10256, 10005, 9754, 9508, 9263, 9025, 8787, 8557, + 8327, 8103, 7879, 7655, 7431, 7215, 7000, 6792, 6585, 6387, + 6190, 5998, 5807, 5625, 5445, 5272, 5100, 4937, 4774, 4613, + 4452, 4301, 4150, 4007, 3865, 3731, 3597, 3469, 3341, 3218, + 3099, 2981, 2869, 2758, 2652, 2546, 2440, 2334, 2234, 2134, + 2041, 1949, 1864, 1779, 1699, 1620, 1547, 1474, 1407, 1340, + 1278, 1217, 1157, 1097, 1043, 989, 940, 891, 846, 801, + 759, 718, 680, 643, 609, 575, 543, 511, 479, 447, + 418, 389, 363, 337, 314, 291, 270, 249, 230, 212, + 195, 179, 164, 149, 135, 121, 108, 96, 85, 74, + 64, 54, 45, 36, 28, 20, 13, 6, 0 + } +}; + + +static const uint16_t cf_tables_2[8][193] = { + { + 16384, 16104, 15825, 15546, 15268, 14991, 14714, 14439, 14164, 13891, + 13620, 13350, 13081, 12815, 12549, 12287, 12025, 11765, 11505, 11250, + 10996, 10746, 10497, 10254, 10011, 9772, 9534, 9303, 9072, 8848, + 8624, 8406, 8188, 7970, 7752, 7539, 7327, 7123, 6919, 6724, + 6529, 6339, 6150, 5970, 5790, 5618, 5446, 5282, 5119, 4957, + 4795, 4642, 4490, 4345, 4201, 4065, 3929, 3798, 3669, 3547, + 3425, 3310, 3196, 3086, 2976, 2866, 2756, 2650, 2545, 2447, + 2350, 2260, 2170, 2085, 2000, 1921, 1843, 1770, 1698, 1632, + 1566, 1501, 1436, 1376, 1316, 1261, 1207, 1157, 1108, 1061, + 1015, 973, 931, 893, 855, 819, 783, 747, 711, 677, + 644, 614, 584, 557, 530, 505, 480, 458, 436, 416, + 396, 378, 360, 343, 326, 310, 295, 281, 267, 255, + 243, 232, 221, 211, 201, 192, 183, 174, 166, 158, + 150, 142, 134, 126, 119, 112, 106, 100, 95, 90, + 85, 80, 76, 72, 69, 66, 63, 60, 57, 54, + 51, 48, 46, 44, 42, 40, 38, 36, 34, 33, + 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, + 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, + 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, + 2, 1, 0 + }, + { + 16384, 16116, 15849, 15582, 15316, 15050, 14785, 14521, 14257, 13995, + 13734, 13476, 13218, 12963, 12708, 12457, 12206, 11956, 11706, 11460, + 11215, 10975, 10735, 10500, 10265, 10034, 9803, 9579, 9355, 9136, + 8917, 8703, 8489, 8275, 8061, 7853, 7645, 7444, 7244, 7051, + 6858, 6671, 6484, 6305, 6127, 5956, 5785, 5622, 5459, 5298, + 5137, 4983, 4830, 4684, 4539, 4401, 4263, 4131, 3999, 3874, + 3750, 3632, 3515, 3401, 3287, 3173, 3059, 2949, 2840, 2737, + 2635, 2539, 2444, 2354, 2264, 2181, 2098, 2020, 1943, 1872, + 1801, 1731, 1661, 1596, 1532, 1472, 1412, 1357, 1303, 1251, + 1200, 1153, 1106, 1063, 1020, 979, 938, 897, 856, 818, + 780, 746, 712, 681, 650, 621, 592, 566, 540, 517, + 494, 473, 452, 431, 410, 391, 373, 356, 340, 325, + 310, 296, 282, 270, 258, 247, 236, 225, 214, 203, + 192, 182, 172, 162, 153, 144, 136, 128, 121, 114, + 108, 102, 97, 92, 87, 82, 77, 73, 69, 65, + 62, 59, 56, 53, 50, 47, 45, 43, 41, 39, + 37, 35, 33, 31, 29, 27, 26, 25, 24, 23, + 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, + 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, + 2, 1, 0 + }, + { + 16384, 16128, 15872, 15617, 15362, 15107, 14853, 14600, 14347, 14096, + 13846, 13597, 13350, 13105, 12860, 12618, 12376, 12135, 11894, 11657, + 11421, 11189, 10957, 10730, 10503, 10279, 10056, 9838, 9620, 9407, + 9195, 8987, 8779, 8571, 8363, 8159, 7955, 7758, 7561, 7371, + 7182, 6997, 6812, 6635, 6459, 6289, 6120, 5957, 5795, 5634, + 5473, 5319, 5165, 5018, 4871, 4732, 4593, 4458, 4324, 4197, + 4071, 3951, 3831, 3714, 3597, 3480, 3363, 3250, 3138, 3032, + 2927, 2828, 2729, 2635, 2541, 2453, 2366, 2284, 2202, 2126, + 2050, 1975, 1900, 1830, 1761, 1697, 1633, 1574, 1515, 1459, + 1403, 1351, 1300, 1252, 1205, 1160, 1115, 1070, 1025, 982, + 939, 899, 860, 824, 789, 756, 723, 693, 663, 636, + 609, 584, 559, 535, 511, 489, 467, 447, 427, 409, + 391, 374, 358, 343, 328, 313, 300, 287, 274, 261, + 248, 235, 223, 211, 200, 189, 179, 169, 160, 151, + 143, 135, 128, 121, 115, 109, 103, 97, 92, 87, + 82, 77, 73, 69, 65, 61, 58, 55, 52, 49, + 46, 43, 40, 37, 35, 33, 31, 29, 27, 25, + 23, 21, 20, 19, 18, 17, 16, 15, 14, 13, + 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, + 2, 1, 0 + }, + { + 16384, 16139, 15894, 15649, 15405, 15162, 14919, 14677, 14435, 14195, + 13955, 13717, 13479, 13243, 13008, 12775, 12542, 12310, 12079, 11851, + 11623, 11399, 11176, 10956, 10737, 10521, 10305, 10094, 9883, 9677, + 9471, 9268, 9065, 8862, 8659, 8459, 8260, 8067, 7874, 7688, + 7502, 7321, 7140, 6965, 6790, 6621, 6452, 6290, 6128, 5968, + 5808, 5655, 5503, 5356, 5209, 5069, 4929, 4794, 4660, 4532, + 4404, 4282, 4160, 4041, 3922, 3803, 3684, 3568, 3452, 3343, + 3234, 3131, 3029, 2931, 2833, 2741, 2649, 2563, 2477, 2396, + 2316, 2236, 2157, 2083, 2009, 1940, 1871, 1807, 1743, 1683, + 1623, 1567, 1511, 1459, 1407, 1357, 1307, 1257, 1207, 1159, + 1111, 1067, 1023, 983, 943, 905, 868, 834, 800, 769, + 738, 709, 681, 653, 625, 600, 575, 552, 529, 508, + 487, 466, 447, 428, 410, 392, 376, 360, 344, 328, + 313, 298, 283, 268, 255, 242, 230, 218, 207, 196, + 186, 176, 167, 158, 150, 142, 135, 128, 121, 114, + 108, 102, 97, 92, 87, 82, 78, 74, 70, 66, + 62, 58, 54, 50, 47, 44, 41, 38, 35, 32, + 30, 28, 26, 24, 22, 20, 18, 16, 14, 13, + 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, + 2, 1, 0 + }, + { + 16384, 16149, 15915, 15681, 15447, 15214, 14981, 14749, 14517, 14286, + 14055, 13827, 13599, 13373, 13147, 12923, 12699, 12476, 12253, 12034, + 11815, 11599, 11383, 11171, 10959, 10750, 10541, 10337, 10133, 9933, + 9733, 9536, 9339, 9142, 8945, 8751, 8557, 8369, 8181, 7998, + 7816, 7638, 7460, 7288, 7116, 6950, 6785, 6625, 6465, 6306, + 6147, 5995, 5843, 5697, 5551, 5411, 5271, 5135, 5000, 4871, + 4742, 4618, 4495, 4374, 4253, 4132, 4011, 3893, 3775, 3663, + 3552, 3446, 3340, 3239, 3138, 3043, 2948, 2858, 2768, 2684, + 2600, 2516, 2433, 2355, 2278, 2205, 2133, 2065, 1997, 1932, + 1867, 1807, 1747, 1690, 1634, 1580, 1526, 1472, 1418, 1366, + 1314, 1266, 1218, 1174, 1130, 1088, 1047, 1009, 971, 936, + 901, 868, 836, 804, 772, 743, 714, 685, 658, 631, + 606, 582, 559, 536, 515, 494, 475, 456, 437, 418, + 399, 380, 362, 344, 328, 312, 297, 283, 270, 257, + 245, 233, 222, 211, 201, 191, 181, 172, 163, 155, + 147, 139, 132, 125, 119, 113, 107, 101, 96, 91, + 86, 81, 76, 71, 66, 62, 58, 54, 50, 46, + 43, 40, 37, 34, 31, 28, 26, 24, 22, 20, + 18, 16, 14, 12, 10, 8, 6, 5, 4, 3, + 2, 1, 0 + }, + { + 16384, 16159, 15934, 15709, 15485, 15261, 15038, 14816, 14594, 14373, + 14152, 13933, 13714, 13497, 13280, 13065, 12850, 12636, 12422, 12211, + 12000, 11791, 11583, 11378, 11173, 10971, 10769, 10571, 10373, 10179, + 9985, 9793, 9601, 9409, 9217, 9029, 8842, 8658, 8475, 8297, + 8120, 7946, 7773, 7604, 7435, 7271, 7108, 6950, 6792, 6634, + 6477, 6326, 6175, 6029, 5883, 5742, 5602, 5466, 5330, 5199, + 5068, 4943, 4818, 4696, 4574, 4452, 4330, 4211, 4093, 3979, + 3866, 3759, 3652, 3549, 3446, 3348, 3250, 3157, 3065, 2977, + 2889, 2802, 2716, 2634, 2553, 2476, 2399, 2326, 2254, 2185, + 2117, 2052, 1987, 1926, 1866, 1808, 1750, 1692, 1634, 1578, + 1522, 1470, 1418, 1369, 1321, 1275, 1229, 1187, 1145, 1105, + 1066, 1027, 991, 955, 919, 883, 850, 817, 786, 756, + 728, 700, 674, 648, 624, 600, 578, 556, 534, 512, + 490, 468, 447, 426, 407, 388, 371, 354, 338, 322, + 307, 293, 280, 267, 255, 243, 231, 219, 209, 199, + 189, 179, 170, 161, 153, 145, 138, 131, 124, 117, + 111, 105, 99, 93, 87, 81, 76, 71, 66, 61, + 57, 53, 49, 45, 42, 39, 36, 33, 30, 27, + 24, 21, 19, 17, 15, 13, 11, 9, 7, 5, + 3, 1, 0 + }, + { + 16384, 16169, 15954, 15739, 15524, 15310, 15096, 14883, 14670, 14458, + 14246, 14035, 13824, 13614, 13405, 13198, 12991, 12785, 12579, 12376, + 12173, 11972, 11772, 11574, 11377, 11182, 10987, 10795, 10603, 10414, + 10226, 10040, 9854, 9668, 9482, 9299, 9116, 8937, 8759, 8585, + 8411, 8241, 8071, 7906, 7741, 7580, 7419, 7263, 7107, 6952, + 6797, 6647, 6497, 6353, 6209, 6070, 5931, 5796, 5661, 5531, + 5401, 5275, 5150, 5027, 4904, 4781, 4658, 4538, 4419, 4304, + 4190, 4081, 3972, 3867, 3762, 3662, 3562, 3467, 3372, 3281, + 3191, 3101, 3012, 2928, 2844, 2764, 2684, 2608, 2533, 2460, + 2387, 2318, 2250, 2185, 2121, 2059, 1997, 1935, 1873, 1813, + 1754, 1698, 1642, 1588, 1535, 1483, 1433, 1384, 1338, 1292, + 1249, 1206, 1165, 1125, 1085, 1045, 1008, 971, 937, 903, + 871, 840, 810, 780, 752, 724, 698, 672, 647, 622, + 597, 572, 548, 524, 502, 480, 460, 440, 421, 403, + 386, 369, 353, 337, 323, 309, 295, 281, 268, 255, + 243, 231, 220, 209, 199, 189, 180, 171, 163, 155, + 147, 139, 131, 123, 116, 109, 102, 95, 89, 83, + 77, 72, 67, 62, 57, 52, 48, 44, 40, 36, + 32, 28, 25, 22, 19, 16, 13, 10, 8, 6, + 4, 2, 0 + }, + { + 16384, 16177, 15970, 15764, 15558, 15353, 15148, 14944, 14740, 14537, + 14334, 14132, 13930, 13729, 13529, 13330, 13131, 12933, 12735, 12539, + 12343, 12150, 11957, 11766, 11576, 11388, 11200, 11015, 10830, 10647, + 10465, 10285, 10105, 9925, 9745, 9568, 9391, 9218, 9045, 8876, + 8707, 8541, 8375, 8213, 8051, 7894, 7737, 7583, 7429, 7277, + 7125, 6977, 6830, 6687, 6544, 6406, 6268, 6133, 5998, 5868, + 5738, 5612, 5487, 5364, 5241, 5118, 4995, 4875, 4755, 4640, + 4525, 4414, 4304, 4198, 4092, 3990, 3888, 3790, 3693, 3600, + 3507, 3415, 3323, 3235, 3147, 3064, 2981, 2902, 2823, 2746, + 2670, 2594, 2522, 2450, 2382, 2314, 2248, 2182, 2116, 2050, + 1987, 1924, 1864, 1804, 1748, 1692, 1638, 1585, 1534, 1484, + 1437, 1390, 1346, 1302, 1258, 1215, 1174, 1133, 1095, 1057, + 1021, 986, 952, 918, 887, 856, 827, 798, 770, 742, + 714, 686, 659, 632, 607, 582, 559, 536, 514, 492, + 472, 452, 433, 415, 398, 381, 364, 348, 333, 318, + 304, 290, 277, 264, 252, 240, 229, 218, 208, 198, + 188, 178, 168, 158, 149, 140, 132, 124, 116, 108, + 101, 94, 87, 81, 75, 69, 64, 59, 54, 49, + 44, 39, 35, 31, 27, 23, 19, 15, 12, 9, + 6, 3, 0 + } +}; + + +static const uint16_t cf_tables_3[5][257] = { + { + 16384, 16187, 15990, 15793, 15597, 15401, 15205, 15009, 14813, 14618, + 14423, 14230, 14037, 13845, 13653, 13463, 13273, 13083, 12894, 12706, + 12518, 12332, 12146, 11962, 11778, 11597, 11416, 11237, 11059, 10882, + 10706, 10532, 10358, 10184, 10010, 9838, 9666, 9497, 9328, 9163, + 8999, 8837, 8675, 8517, 8359, 8205, 8051, 7901, 7751, 7602, + 7453, 7308, 7163, 7022, 6882, 6745, 6609, 6476, 6343, 6214, + 6085, 5960, 5835, 5712, 5589, 5466, 5343, 5223, 5103, 4987, + 4872, 4761, 4650, 4542, 4435, 4332, 4229, 4130, 4031, 3936, + 3841, 3747, 3653, 3563, 3473, 3387, 3302, 3220, 3138, 3059, + 2980, 2905, 2830, 2759, 2688, 2619, 2550, 2481, 2412, 2345, + 2278, 2215, 2152, 2092, 2032, 1974, 1917, 1863, 1809, 1758, + 1707, 1659, 1611, 1564, 1517, 1473, 1429, 1387, 1346, 1307, + 1268, 1230, 1193, 1158, 1123, 1090, 1058, 1026, 994, 962, + 930, 899, 869, 841, 813, 786, 760, 735, 710, 687, + 664, 643, 622, 602, 582, 562, 543, 525, 507, 490, + 473, 457, 442, 427, 412, 398, 385, 373, 361, 349, + 337, 325, 313, 301, 290, 279, 269, 259, 249, 240, + 231, 222, 214, 206, 199, 192, 185, 178, 171, 165, + 159, 153, 148, 143, 138, 133, 128, 123, 119, 115, + 111, 107, 103, 99, 95, 91, 87, 83, 80, 77, + 74, 71, 68, 65, 63, 61, 59, 57, 55, 53, + 51, 49, 47, 45, 43, 41, 40, 39, 38, 37, + 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, + 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, + 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, + 6, 5, 4, 3, 2, 1, 0 + }, + { + 16384, 16195, 16006, 15817, 15629, 15441, 15253, 15065, 14878, 14692, + 14506, 14321, 14136, 13952, 13768, 13585, 13402, 13219, 13037, 12857, + 12677, 12499, 12321, 12144, 11967, 11792, 11617, 11444, 11271, 11100, + 10930, 10762, 10594, 10426, 10258, 10091, 9925, 9761, 9598, 9438, + 9278, 9120, 8963, 8809, 8655, 8504, 8354, 8207, 8060, 7914, + 7769, 7627, 7485, 7347, 7209, 7074, 6939, 6807, 6676, 6548, + 6420, 6296, 6172, 6050, 5928, 5806, 5684, 5564, 5444, 5328, + 5212, 5100, 4988, 4879, 4771, 4667, 4563, 4462, 4362, 4265, + 4169, 4073, 3978, 3886, 3795, 3707, 3619, 3535, 3451, 3369, + 3288, 3210, 3133, 3059, 2985, 2913, 2841, 2769, 2697, 2627, + 2557, 2490, 2424, 2360, 2297, 2237, 2177, 2119, 2062, 2007, + 1953, 1901, 1849, 1798, 1748, 1700, 1652, 1607, 1562, 1519, + 1476, 1435, 1394, 1355, 1317, 1281, 1245, 1210, 1175, 1140, + 1105, 1071, 1037, 1005, 973, 943, 913, 885, 857, 830, + 804, 779, 754, 731, 708, 685, 663, 642, 621, 601, + 581, 563, 545, 528, 511, 495, 479, 463, 448, 433, + 419, 405, 391, 377, 364, 351, 338, 326, 314, 302, + 291, 280, 270, 260, 251, 242, 234, 226, 218, 210, + 202, 195, 188, 181, 174, 168, 162, 156, 150, 144, + 139, 134, 129, 124, 119, 114, 109, 104, 100, 96, + 92, 88, 84, 80, 77, 74, 71, 68, 65, 62, + 59, 56, 54, 52, 50, 48, 46, 44, 42, 40, + 38, 36, 34, 33, 32, 31, 30, 29, 28, 27, + 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, + 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, + 6, 5, 4, 3, 2, 1, 0 + }, + { + 16384, 16203, 16022, 15842, 15662, 15482, 15302, 15122, 14942, 14763, + 14584, 14406, 14228, 14051, 13874, 13698, 13522, 13347, 13172, 12998, + 12824, 12652, 12480, 12310, 12140, 11971, 11803, 11637, 11471, 11307, + 11143, 10980, 10817, 10654, 10491, 10330, 10169, 10011, 9853, 9697, + 9542, 9389, 9236, 9086, 8936, 8789, 8642, 8498, 8355, 8212, + 8070, 7931, 7792, 7656, 7520, 7388, 7256, 7126, 6996, 6870, + 6744, 6621, 6498, 6377, 6256, 6135, 6014, 5895, 5776, 5660, + 5545, 5433, 5321, 5212, 5104, 4999, 4895, 4793, 4692, 4594, + 4496, 4400, 4304, 4211, 4118, 4028, 3939, 3853, 3767, 3684, + 3601, 3521, 3441, 3364, 3287, 3212, 3137, 3062, 2987, 2915, + 2843, 2773, 2704, 2638, 2572, 2508, 2445, 2384, 2324, 2266, + 2208, 2153, 2098, 2044, 1990, 1939, 1888, 1839, 1791, 1745, + 1699, 1655, 1611, 1569, 1527, 1487, 1448, 1409, 1370, 1331, + 1292, 1255, 1218, 1183, 1148, 1115, 1082, 1051, 1020, 990, + 960, 932, 904, 878, 852, 826, 801, 777, 753, 731, + 709, 687, 666, 645, 625, 605, 586, 567, 550, 533, + 516, 499, 482, 465, 449, 433, 418, 403, 389, 375, + 362, 349, 337, 325, 314, 303, 293, 283, 273, 263, + 254, 245, 236, 227, 219, 211, 204, 197, 190, 183, + 177, 171, 165, 159, 153, 147, 141, 135, 130, 125, + 120, 115, 110, 105, 101, 97, 93, 89, 85, 81, + 77, 74, 71, 68, 65, 62, 59, 56, 53, 51, + 49, 47, 45, 43, 41, 39, 37, 35, 33, 31, + 29, 27, 25, 23, 22, 21, 20, 19, 18, 17, + 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, + 6, 5, 4, 3, 2, 1, 0 + }, + { + 16384, 16210, 16036, 15863, 15690, 15517, 15344, 15172, 15000, 14828, + 14656, 14485, 14314, 14145, 13976, 13808, 13640, 13472, 13304, 13137, + 12970, 12804, 12639, 12475, 12312, 12149, 11987, 11827, 11667, 11508, + 11349, 11192, 11035, 10878, 10721, 10565, 10410, 10257, 10104, 9953, + 9802, 9654, 9506, 9359, 9213, 9070, 8927, 8787, 8647, 8508, + 8369, 8233, 8097, 7964, 7831, 7700, 7570, 7442, 7315, 7190, + 7065, 6943, 6821, 6701, 6581, 6461, 6341, 6223, 6105, 5990, + 5876, 5764, 5653, 5545, 5437, 5331, 5226, 5124, 5022, 4924, + 4826, 4729, 4632, 4538, 4444, 4353, 4262, 4174, 4087, 4002, + 3917, 3835, 3753, 3674, 3595, 3518, 3441, 3364, 3287, 3212, + 3138, 3066, 2995, 2926, 2858, 2792, 2726, 2662, 2599, 2538, + 2478, 2420, 2362, 2305, 2249, 2195, 2141, 2089, 2037, 1988, + 1939, 1891, 1844, 1799, 1754, 1711, 1668, 1626, 1584, 1542, + 1500, 1459, 1418, 1380, 1342, 1305, 1269, 1234, 1199, 1166, + 1133, 1102, 1071, 1041, 1012, 983, 954, 926, 899, 872, + 847, 822, 798, 774, 751, 728, 707, 686, 666, 646, + 627, 608, 589, 570, 552, 534, 517, 500, 484, 468, + 453, 438, 424, 410, 397, 384, 372, 360, 348, 336, + 325, 314, 303, 293, 283, 273, 264, 255, 246, 237, + 229, 221, 213, 205, 197, 189, 181, 174, 167, 160, + 154, 148, 142, 136, 131, 126, 121, 116, 111, 106, + 101, 97, 93, 89, 85, 81, 77, 73, 70, 67, + 64, 61, 58, 55, 52, 49, 46, 43, 40, 37, + 35, 33, 31, 29, 27, 25, 23, 21, 19, 17, + 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, + 6, 5, 4, 3, 2, 1, 0 + }, + { + 16384, 16218, 16052, 15886, 15720, 15554, 15389, 15224, 15059, 14895, + 14731, 14567, 14403, 14240, 14077, 13915, 13753, 13591, 13429, 13269, + 13109, 12950, 12791, 12633, 12476, 12320, 12164, 12009, 11854, 11701, + 11548, 11396, 11244, 11092, 10940, 10790, 10640, 10492, 10344, 10198, + 10052, 9908, 9764, 9622, 9481, 9342, 9203, 9066, 8929, 8793, + 8657, 8524, 8391, 8261, 8131, 8003, 7875, 7749, 7624, 7502, + 7380, 7260, 7140, 7022, 6904, 6786, 6668, 6551, 6435, 6322, + 6209, 6099, 5989, 5881, 5773, 5668, 5563, 5461, 5359, 5260, + 5161, 5063, 4965, 4871, 4777, 4686, 4595, 4506, 4417, 4331, + 4245, 4162, 4079, 3999, 3919, 3841, 3763, 3685, 3607, 3530, + 3454, 3380, 3307, 3236, 3166, 3097, 3029, 2963, 2897, 2834, + 2771, 2710, 2650, 2591, 2532, 2475, 2418, 2363, 2309, 2257, + 2205, 2155, 2105, 2057, 2009, 1963, 1918, 1873, 1828, 1783, + 1738, 1694, 1650, 1607, 1565, 1524, 1484, 1445, 1407, 1369, + 1333, 1297, 1263, 1229, 1197, 1165, 1134, 1103, 1073, 1043, + 1015, 987, 960, 933, 907, 882, 858, 834, 811, 788, + 766, 744, 722, 700, 679, 658, 638, 618, 599, 581, + 563, 545, 528, 511, 495, 480, 465, 451, 437, 423, + 410, 397, 384, 372, 360, 348, 337, 326, 315, 305, + 295, 285, 275, 265, 255, 245, 236, 227, 219, 211, + 203, 195, 188, 181, 174, 167, 161, 155, 149, 143, + 137, 131, 126, 121, 116, 111, 106, 101, 97, 93, + 89, 85, 81, 77, 73, 69, 65, 61, 58, 55, + 52, 49, 46, 43, 40, 37, 34, 32, 30, 28, + 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, + 6, 5, 4, 3, 2, 1, 0 + } +}; + + +static const uint16_t * const cf_table[16] = { + cf_tables_1[0], cf_tables_1[1], cf_tables_1[2], cf_tables_2[0], + cf_tables_2[1], cf_tables_2[2], cf_tables_2[3], cf_tables_2[4], + cf_tables_2[5], cf_tables_2[6], cf_tables_2[7], cf_tables_3[0], + cf_tables_3[1], cf_tables_3[2], cf_tables_3[3], cf_tables_3[4] +}; + + +/** Initialize a given lookup table using a given delta + */ +static void bgmc_lut_fillp(uint8_t *lut, int *lut_status, + int delta) +{ + unsigned int sx, i; + + for (sx = 0; sx < 16; sx++) + for (i = 0; i < LUT_SIZE; i++) { + unsigned int target = (i + 1) << (FREQ_BITS - LUT_BITS); + unsigned int symbol = 1 << delta; + + while (cf_table[sx][symbol] > target) + symbol += 1 << delta; + + *lut++ = symbol >> delta; + } + + *lut_status = delta; +} + + +/** Retune the index of a suitable lookup table for a given delta + */ +static uint8_t* bgmc_lut_getp(uint8_t *lut, int *lut_status, + int delta) +{ + unsigned int i = av_clip(delta, 0, LUT_BUFF - 1); + + lut += (i * LUT_SIZE) << 4; + + if (lut_status[i] != delta) + bgmc_lut_fillp(lut, &lut_status[i], delta); + + return lut; +} + + +/** Initialize the lookup table arrays + */ +int ff_bgmc_init(AVCodecContext *avctx, uint8_t **cf_lut, int **cf_lut_status) +{ + *cf_lut = av_malloc(sizeof(*cf_lut ) * LUT_BUFF * 16 * LUT_SIZE); + *cf_lut_status = av_malloc(sizeof(*cf_lut_status) * LUT_BUFF); + + if (!cf_lut || !cf_lut_status) { + ff_bgmc_end(cf_lut, cf_lut_status); + av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n"); + return AVERROR(ENOMEM); + } else { + // initialize lut_status buffer to a value never used to compare against + memset(*cf_lut_status, -1, sizeof(*cf_lut_status) * LUT_BUFF); + } + + return 0; +} + + +/** Release the lookup table arrays + */ +void ff_bgmc_end(uint8_t **cf_lut, int **cf_lut_status) +{ + av_freep(cf_lut); + av_freep(cf_lut_status); +} + + +/** Initialize decoding and reads the first value + */ +void ff_bgmc_decode_init(GetBitContext *gb, + unsigned int *h, unsigned int *l, unsigned int *v) +{ + *h = TOP_VALUE; + *l = 0; + *v = get_bits_long(gb, VALUE_BITS); +} + + +/** Finish decoding + */ +void ff_bgmc_decode_end(GetBitContext *gb) +{ + skip_bits_long(gb, -(VALUE_BITS - 2)); +} + + +/** Read and decode a block Gilbert-Moore coded symbol + */ +void ff_bgmc_decode(GetBitContext *gb, unsigned int num, int32_t *dst, + int delta, unsigned int sx, + unsigned int *h, unsigned int *l, unsigned int *v, + uint8_t *cf_lut, int *cf_lut_status) +{ + unsigned int i; + uint8_t *lut = bgmc_lut_getp(cf_lut, cf_lut_status, delta); + + // read current state + unsigned int high = *h; + unsigned int low = *l; + unsigned int value = *v; + + lut += sx * LUT_SIZE; + + // decode num samples + for (i = 0; i < num; i++) { + unsigned int range = high - low + 1; + unsigned int target = (((value - low + 1) << FREQ_BITS) - 1) / range; + unsigned int symbol = lut[target >> (FREQ_BITS - LUT_BITS)] << delta; + + while (cf_table[sx][symbol] > target) + symbol += 1 << delta; + + symbol = (symbol >> delta) - 1; + + high = low + ((range * cf_table[sx][(symbol ) << delta] - (1 << FREQ_BITS)) >> FREQ_BITS); + low = low + ((range * cf_table[sx][(symbol + 1) << delta] ) >> FREQ_BITS); + + while (1) { + if (high >= HALF) { + if (low >= HALF) { + value -= HALF; + low -= HALF; + high -= HALF; + } else if (low >= FIRST_QTR && high < THIRD_QTR) { + value -= FIRST_QTR; + low -= FIRST_QTR; + high -= FIRST_QTR; + } else break; + } + + low *= 2; + high = 2 * high + 1; + value = 2 * value + get_bits1(gb); + } + + *dst++ = symbol; + } + + // save current state + *h = high; + *l = low; + *v = value; +} + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bgmc.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bgmc.h new file mode 100644 index 00000000..9e386fdb --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bgmc.h @@ -0,0 +1,56 @@ +/* + * Block Gilbert-Moore decoder + * Copyright (c) 2010 Thilo Borgmann + * + * 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 + * Block Gilbert-Moore decoder header + * @author Thilo Borgmann + */ + + +#ifndef AVCODEC_BGMC_H +#define AVCODEC_BGMC_H + + +#include "avcodec.h" +#include "get_bits.h" + + +int ff_bgmc_init(AVCodecContext *avctx, uint8_t **cf_lut, int **cf_lut_status); + + +void ff_bgmc_end(uint8_t **cf_lut, int **cf_lut_status); + + +void ff_bgmc_decode_init(GetBitContext *gb, + unsigned int *h, unsigned int *l, unsigned int *v); + + +void ff_bgmc_decode_end(GetBitContext *gb); + + +void ff_bgmc_decode(GetBitContext *gb, unsigned int num, int32_t *dst, + int delta, unsigned int sx, + unsigned int *h, unsigned int *l, unsigned int *v, + uint8_t *cf_lut, int *cf_lut_status); + + +#endif /* AVCODEC_BGMC_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bink.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bink.c new file mode 100644 index 00000000..64a10b71 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/bink.c @@ -0,0 +1,1013 @@ +/* + * Bink video decoder + * Copyright (c) 2009 Konstantin Shishkov + * + * 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 + */ + +#include "libavcore/imgutils.h" +#include "avcodec.h" +#include "dsputil.h" +#include "binkdata.h" +#include "mathops.h" + +#define ALT_BITSTREAM_READER_LE +#include "get_bits.h" + +#define BINK_FLAG_ALPHA 0x00100000 +#define BINK_FLAG_GRAY 0x00020000 + +static VLC bink_trees[16]; + +/** + * IDs for different data types used in Bink video codec + */ +enum Sources { + BINK_SRC_BLOCK_TYPES = 0, ///< 8x8 block types + BINK_SRC_SUB_BLOCK_TYPES, ///< 16x16 block types (a subset of 8x8 block types) + BINK_SRC_COLORS, ///< pixel values used for different block types + BINK_SRC_PATTERN, ///< 8-bit values for 2-colour pattern fill + BINK_SRC_X_OFF, ///< X components of motion value + BINK_SRC_Y_OFF, ///< Y components of motion value + BINK_SRC_INTRA_DC, ///< DC values for intrablocks with DCT + BINK_SRC_INTER_DC, ///< DC values for interblocks with DCT + BINK_SRC_RUN, ///< run lengths for special fill block + + BINK_NB_SRC +}; + +/** + * data needed to decode 4-bit Huffman-coded value + */ +typedef struct Tree { + int vlc_num; ///< tree number (in bink_trees[]) + uint8_t syms[16]; ///< leaf value to symbol mapping +} Tree; + +#define GET_HUFF(gb, tree) (tree).syms[get_vlc2(gb, bink_trees[(tree).vlc_num].table,\ + bink_trees[(tree).vlc_num].bits, 1)] + +/** + * data structure used for decoding single Bink data type + */ +typedef struct Bundle { + int len; ///< length of number of entries to decode (in bits) + Tree tree; ///< Huffman tree-related data + uint8_t *data; ///< buffer for decoded symbols + uint8_t *data_end; ///< buffer end + uint8_t *cur_dec; ///< pointer to the not yet decoded part of the buffer + uint8_t *cur_ptr; ///< pointer to the data that is not read from buffer yet +} Bundle; + +/* + * Decoder context + */ +typedef struct BinkContext { + AVCodecContext *avctx; + DSPContext dsp; + AVFrame pic, last; + int version; ///< internal Bink file version + int has_alpha; + int swap_planes; + ScanTable scantable; ///< permutated scantable for DCT coeffs decoding + + Bundle bundle[BINK_NB_SRC]; ///< bundles for decoding all data types + Tree col_high[16]; ///< trees for decoding high nibble in "colours" data type + int col_lastval; ///< value of last decoded high nibble in "colours" data type +} BinkContext; + +/** + * Bink video block types + */ +enum BlockTypes { + SKIP_BLOCK = 0, ///< skipped block + SCALED_BLOCK, ///< block has size 16x16 + MOTION_BLOCK, ///< block is copied from previous frame with some offset + RUN_BLOCK, ///< block is composed from runs of colours with custom scan order + RESIDUE_BLOCK, ///< motion block with some difference added + INTRA_BLOCK, ///< intra DCT block + FILL_BLOCK, ///< block is filled with single colour + INTER_BLOCK, ///< motion block with DCT applied to the difference + PATTERN_BLOCK, ///< block is filled with two colours following custom pattern + RAW_BLOCK, ///< uncoded 8x8 block +}; + +/** + * Initialize length length in all bundles. + * + * @param c decoder context + * @param width plane width + * @param bw plane width in 8x8 blocks + */ +static void init_lengths(BinkContext *c, int width, int bw) +{ + c->bundle[BINK_SRC_BLOCK_TYPES].len = av_log2((width >> 3) + 511) + 1; + + c->bundle[BINK_SRC_SUB_BLOCK_TYPES].len = av_log2((width >> 4) + 511) + 1; + + c->bundle[BINK_SRC_COLORS].len = av_log2(bw*64 + 511) + 1; + + c->bundle[BINK_SRC_INTRA_DC].len = + c->bundle[BINK_SRC_INTER_DC].len = + c->bundle[BINK_SRC_X_OFF].len = + c->bundle[BINK_SRC_Y_OFF].len = av_log2((width >> 3) + 511) + 1; + + c->bundle[BINK_SRC_PATTERN].len = av_log2((bw << 3) + 511) + 1; + + c->bundle[BINK_SRC_RUN].len = av_log2(bw*48 + 511) + 1; +} + +/** + * Allocate memory for bundles. + * + * @param c decoder context + */ +static av_cold void init_bundles(BinkContext *c) +{ + int bw, bh, blocks; + int i; + + bw = (c->avctx->width + 7) >> 3; + bh = (c->avctx->height + 7) >> 3; + blocks = bw * bh; + + for (i = 0; i < BINK_NB_SRC; i++) { + c->bundle[i].data = av_malloc(blocks * 64); + c->bundle[i].data_end = c->bundle[i].data + blocks * 64; + } +} + +/** + * Free memory used by bundles. + * + * @param c decoder context + */ +static av_cold void free_bundles(BinkContext *c) +{ + int i; + for (i = 0; i < BINK_NB_SRC; i++) + av_freep(&c->bundle[i].data); +} + +/** + * Merge two consequent lists of equal size depending on bits read. + * + * @param gb context for reading bits + * @param dst buffer where merged list will be written to + * @param src pointer to the head of the first list (the second lists starts at src+size) + * @param size input lists size + */ +static void merge(GetBitContext *gb, uint8_t *dst, uint8_t *src, int size) +{ + uint8_t *src2 = src + size; + int size2 = size; + + do { + if (!get_bits1(gb)) { + *dst++ = *src++; + size--; + } else { + *dst++ = *src2++; + size2--; + } + } while (size && size2); + + while (size--) + *dst++ = *src++; + while (size2--) + *dst++ = *src2++; +} + +/** + * Read information about Huffman tree used to decode data. + * + * @param gb context for reading bits + * @param tree pointer for storing tree data + */ +static void read_tree(GetBitContext *gb, Tree *tree) +{ + uint8_t tmp1[16], tmp2[16], *in = tmp1, *out = tmp2; + int i, t, len; + + tree->vlc_num = get_bits(gb, 4); + if (!tree->vlc_num) { + for (i = 0; i < 16; i++) + tree->syms[i] = i; + return; + } + if (get_bits1(gb)) { + len = get_bits(gb, 3); + memset(tmp1, 0, sizeof(tmp1)); + for (i = 0; i <= len; i++) { + tree->syms[i] = get_bits(gb, 4); + tmp1[tree->syms[i]] = 1; + } + for (i = 0; i < 16; i++) + if (!tmp1[i]) + tree->syms[++len] = i; + } else { + len = get_bits(gb, 2); + for (i = 0; i < 16; i++) + in[i] = i; + for (i = 0; i <= len; i++) { + int size = 1 << i; + for (t = 0; t < 16; t += size << 1) + merge(gb, out + t, in + t, size); + FFSWAP(uint8_t*, in, out); + } + memcpy(tree->syms, in, 16); + } +} + +/** + * Prepare bundle for decoding data. + * + * @param gb context for reading bits + * @param c decoder context + * @param bundle_num number of the bundle to initialize + */ +static void read_bundle(GetBitContext *gb, BinkContext *c, int bundle_num) +{ + int i; + + if (bundle_num == BINK_SRC_COLORS) { + for (i = 0; i < 16; i++) + read_tree(gb, &c->col_high[i]); + c->col_lastval = 0; + } + if (bundle_num != BINK_SRC_INTRA_DC && bundle_num != BINK_SRC_INTER_DC) + read_tree(gb, &c->bundle[bundle_num].tree); + c->bundle[bundle_num].cur_dec = + c->bundle[bundle_num].cur_ptr = c->bundle[bundle_num].data; +} + +/** + * common check before starting decoding bundle data + * + * @param gb context for reading bits + * @param b bundle + * @param t variable where number of elements to decode will be stored + */ +#define CHECK_READ_VAL(gb, b, t) \ + if (!b->cur_dec || (b->cur_dec > b->cur_ptr)) \ + return 0; \ + t = get_bits(gb, b->len); \ + if (!t) { \ + b->cur_dec = NULL; \ + return 0; \ + } \ + +static int read_runs(AVCodecContext *avctx, GetBitContext *gb, Bundle *b) +{ + int t, v; + const uint8_t *dec_end; + + CHECK_READ_VAL(gb, b, t); + dec_end = b->cur_dec + t; + if (dec_end > b->data_end) { + av_log(avctx, AV_LOG_ERROR, "Run value went out of bounds\n"); + return -1; + } + if (get_bits1(gb)) { + v = get_bits(gb, 4); + memset(b->cur_dec, v, t); + b->cur_dec += t; + } else { + while (b->cur_dec < dec_end) + *b->cur_dec++ = GET_HUFF(gb, b->tree); + } + return 0; +} + +static int read_motion_values(AVCodecContext *avctx, GetBitContext *gb, Bundle *b) +{ + int t, sign, v; + const uint8_t *dec_end; + + CHECK_READ_VAL(gb, b, t); + dec_end = b->cur_dec + t; + if (dec_end > b->data_end) { + av_log(avctx, AV_LOG_ERROR, "Too many motion values\n"); + return -1; + } + if (get_bits1(gb)) { + v = get_bits(gb, 4); + if (v) { + sign = -get_bits1(gb); + v = (v ^ sign) - sign; + } + memset(b->cur_dec, v, t); + b->cur_dec += t; + } else { + do { + v = GET_HUFF(gb, b->tree); + if (v) { + sign = -get_bits1(gb); + v = (v ^ sign) - sign; + } + *b->cur_dec++ = v; + } while (b->cur_dec < dec_end); + } + return 0; +} + +static const uint8_t bink_rlelens[4] = { 4, 8, 12, 32 }; + +static int read_block_types(AVCodecContext *avctx, GetBitContext *gb, Bundle *b) +{ + int t, v; + int last = 0; + const uint8_t *dec_end; + + CHECK_READ_VAL(gb, b, t); + dec_end = b->cur_dec + t; + if (dec_end > b->data_end) { + av_log(avctx, AV_LOG_ERROR, "Too many block type values\n"); + return -1; + } + if (get_bits1(gb)) { + v = get_bits(gb, 4); + memset(b->cur_dec, v, t); + b->cur_dec += t; + } else { + do { + v = GET_HUFF(gb, b->tree); + if (v < 12) { + last = v; + *b->cur_dec++ = v; + } else { + int run = bink_rlelens[v - 12]; + + memset(b->cur_dec, last, run); + b->cur_dec += run; + } + } while (b->cur_dec < dec_end); + } + return 0; +} + +static int read_patterns(AVCodecContext *avctx, GetBitContext *gb, Bundle *b) +{ + int t, v; + const uint8_t *dec_end; + + CHECK_READ_VAL(gb, b, t); + dec_end = b->cur_dec + t; + if (dec_end > b->data_end) { + av_log(avctx, AV_LOG_ERROR, "Too many pattern values\n"); + return -1; + } + while (b->cur_dec < dec_end) { + v = GET_HUFF(gb, b->tree); + v |= GET_HUFF(gb, b->tree) << 4; + *b->cur_dec++ = v; + } + + return 0; +} + +static int read_colors(GetBitContext *gb, Bundle *b, BinkContext *c) +{ + int t, sign, v; + const uint8_t *dec_end; + + CHECK_READ_VAL(gb, b, t); + dec_end = b->cur_dec + t; + if (dec_end > b->data_end) { + av_log(c->avctx, AV_LOG_ERROR, "Too many color values\n"); + return -1; + } + if (get_bits1(gb)) { + c->col_lastval = GET_HUFF(gb, c->col_high[c->col_lastval]); + v = GET_HUFF(gb, b->tree); + v = (c->col_lastval << 4) | v; + if (c->version < 'i') { + sign = ((int8_t) v) >> 7; + v = ((v & 0x7F) ^ sign) - sign; + v += 0x80; + } + memset(b->cur_dec, v, t); + b->cur_dec += t; + } else { + while (b->cur_dec < dec_end) { + c->col_lastval = GET_HUFF(gb, c->col_high[c->col_lastval]); + v = GET_HUFF(gb, b->tree); + v = (c->col_lastval << 4) | v; + if (c->version < 'i') { + sign = ((int8_t) v) >> 7; + v = ((v & 0x7F) ^ sign) - sign; + v += 0x80; + } + *b->cur_dec++ = v; + } + } + return 0; +} + +/** number of bits used to store first DC value in bundle */ +#define DC_START_BITS 11 + +static int read_dcs(AVCodecContext *avctx, GetBitContext *gb, Bundle *b, + int start_bits, int has_sign) +{ + int i, j, len, len2, bsize, sign, v, v2; + int16_t *dst = (int16_t*)b->cur_dec; + + CHECK_READ_VAL(gb, b, len); + v = get_bits(gb, start_bits - has_sign); + if (v && has_sign) { + sign = -get_bits1(gb); + v = (v ^ sign) - sign; + } + *dst++ = v; + len--; + for (i = 0; i < len; i += 8) { + len2 = FFMIN(len - i, 8); + bsize = get_bits(gb, 4); + if (bsize) { + for (j = 0; j < len2; j++) { + v2 = get_bits(gb, bsize); + if (v2) { + sign = -get_bits1(gb); + v2 = (v2 ^ sign) - sign; + } + v += v2; + *dst++ = v; + if (v < -32768 || v > 32767) { + av_log(avctx, AV_LOG_ERROR, "DC value went out of bounds: %d\n", v); + return -1; + } + } + } else { + for (j = 0; j < len2; j++) + *dst++ = v; + } + } + + b->cur_dec = (uint8_t*)dst; + return 0; +} + +/** + * Retrieve next value from bundle. + * + * @param c decoder context + * @param bundle bundle number + */ +static inline int get_value(BinkContext *c, int bundle) +{ + int16_t ret; + + if (bundle < BINK_SRC_X_OFF || bundle == BINK_SRC_RUN) + return *c->bundle[bundle].cur_ptr++; + if (bundle == BINK_SRC_X_OFF || bundle == BINK_SRC_Y_OFF) + return (int8_t)*c->bundle[bundle].cur_ptr++; + ret = *(int16_t*)c->bundle[bundle].cur_ptr; + c->bundle[bundle].cur_ptr += 2; + return ret; +} + +/** + * Read 8x8 block of DCT coefficients. + * + * @param gb context for reading bits + * @param block place for storing coefficients + * @param scan scan order table + * @param is_intra tells what set of quantizer matrices to use + * @return 0 for success, negative value in other cases + */ +static int read_dct_coeffs(GetBitContext *gb, DCTELEM block[64], const uint8_t *scan, + int is_intra) +{ + int coef_list[128]; + int mode_list[128]; + int i, t, mask, bits, ccoef, mode, sign; + int list_start = 64, list_end = 64, list_pos; + int coef_count = 0; + int coef_idx[64]; + int quant_idx; + const uint32_t *quant; + + coef_list[list_end] = 4; mode_list[list_end++] = 0; + coef_list[list_end] = 24; mode_list[list_end++] = 0; + coef_list[list_end] = 44; mode_list[list_end++] = 0; + coef_list[list_end] = 1; mode_list[list_end++] = 3; + coef_list[list_end] = 2; mode_list[list_end++] = 3; + coef_list[list_end] = 3; mode_list[list_end++] = 3; + + bits = get_bits(gb, 4) - 1; + for (mask = 1 << bits; bits >= 0; mask >>= 1, bits--) { + list_pos = list_start; + while (list_pos < list_end) { + if (!(mode_list[list_pos] | coef_list[list_pos]) || !get_bits1(gb)) { + list_pos++; + continue; + } + ccoef = coef_list[list_pos]; + mode = mode_list[list_pos]; + switch (mode) { + case 0: + coef_list[list_pos] = ccoef + 4; + mode_list[list_pos] = 1; + case 2: + if (mode == 2) { + coef_list[list_pos] = 0; + mode_list[list_pos++] = 0; + } + for (i = 0; i < 4; i++, ccoef++) { + if (get_bits1(gb)) { + coef_list[--list_start] = ccoef; + mode_list[ list_start] = 3; + } else { + int t; + if (!bits) { + t = 1 - (get_bits1(gb) << 1); + } else { + t = get_bits(gb, bits) | mask; + sign = -get_bits1(gb); + t = (t ^ sign) - sign; + } + block[scan[ccoef]] = t; + coef_idx[coef_count++] = ccoef; + } + } + break; + case 1: + mode_list[list_pos] = 2; + for (i = 0; i < 3; i++) { + ccoef += 4; + coef_list[list_end] = ccoef; + mode_list[list_end++] = 2; + } + break; + case 3: + if (!bits) { + t = 1 - (get_bits1(gb) << 1); + } else { + t = get_bits(gb, bits) | mask; + sign = -get_bits1(gb); + t = (t ^ sign) - sign; + } + block[scan[ccoef]] = t; + coef_idx[coef_count++] = ccoef; + coef_list[list_pos] = 0; + mode_list[list_pos++] = 0; + break; + } + } + } + + quant_idx = get_bits(gb, 4); + quant = is_intra ? bink_intra_quant[quant_idx] + : bink_inter_quant[quant_idx]; + block[0] = (block[0] * quant[0]) >> 11; + for (i = 0; i < coef_count; i++) { + int idx = coef_idx[i]; + block[scan[idx]] = (block[scan[idx]] * quant[idx]) >> 11; + } + + return 0; +} + +/** + * Read 8x8 block with residue after motion compensation. + * + * @param gb context for reading bits + * @param block place to store read data + * @param masks_count number of masks to decode + * @return 0 on success, negative value in other cases + */ +static int read_residue(GetBitContext *gb, DCTELEM block[64], int masks_count) +{ + int coef_list[128]; + int mode_list[128]; + int i, sign, mask, ccoef, mode; + int list_start = 64, list_end = 64, list_pos; + int nz_coeff[64]; + int nz_coeff_count = 0; + + coef_list[list_end] = 4; mode_list[list_end++] = 0; + coef_list[list_end] = 24; mode_list[list_end++] = 0; + coef_list[list_end] = 44; mode_list[list_end++] = 0; + coef_list[list_end] = 0; mode_list[list_end++] = 2; + + for (mask = 1 << get_bits(gb, 3); mask; mask >>= 1) { + for (i = 0; i < nz_coeff_count; i++) { + if (!get_bits1(gb)) + continue; + if (block[nz_coeff[i]] < 0) + block[nz_coeff[i]] -= mask; + else + block[nz_coeff[i]] += mask; + masks_count--; + if (masks_count < 0) + return 0; + } + list_pos = list_start; + while (list_pos < list_end) { + if (!(coef_list[list_pos] | mode_list[list_pos]) || !get_bits1(gb)) { + list_pos++; + continue; + } + ccoef = coef_list[list_pos]; + mode = mode_list[list_pos]; + switch (mode) { + case 0: + coef_list[list_pos] = ccoef + 4; + mode_list[list_pos] = 1; + case 2: + if (mode == 2) { + coef_list[list_pos] = 0; + mode_list[list_pos++] = 0; + } + for (i = 0; i < 4; i++, ccoef++) { + if (get_bits1(gb)) { + coef_list[--list_start] = ccoef; + mode_list[ list_start] = 3; + } else { + nz_coeff[nz_coeff_count++] = bink_scan[ccoef]; + sign = -get_bits1(gb); + block[bink_scan[ccoef]] = (mask ^ sign) - sign; + masks_count--; + if (masks_count < 0) + return 0; + } + } + break; + case 1: + mode_list[list_pos] = 2; + for (i = 0; i < 3; i++) { + ccoef += 4; + coef_list[list_end] = ccoef; + mode_list[list_end++] = 2; + } + break; + case 3: + nz_coeff[nz_coeff_count++] = bink_scan[ccoef]; + sign = -get_bits1(gb); + block[bink_scan[ccoef]] = (mask ^ sign) - sign; + coef_list[list_pos] = 0; + mode_list[list_pos++] = 0; + masks_count--; + if (masks_count < 0) + return 0; + break; + } + } + } + + return 0; +} + +static int bink_decode_plane(BinkContext *c, GetBitContext *gb, int plane_idx, + int is_chroma) +{ + int blk; + int i, j, bx, by; + uint8_t *dst, *prev, *ref, *ref_start, *ref_end; + int v, col[2]; + const uint8_t *scan; + int xoff, yoff; + LOCAL_ALIGNED_16(DCTELEM, block, [64]); + LOCAL_ALIGNED_16(uint8_t, ublock, [64]); + int coordmap[64]; + + const int stride = c->pic.linesize[plane_idx]; + int bw = is_chroma ? (c->avctx->width + 15) >> 4 : (c->avctx->width + 7) >> 3; + int bh = is_chroma ? (c->avctx->height + 15) >> 4 : (c->avctx->height + 7) >> 3; + int width = c->avctx->width >> is_chroma; + + init_lengths(c, FFMAX(width, 8), bw); + for (i = 0; i < BINK_NB_SRC; i++) + read_bundle(gb, c, i); + + ref_start = c->last.data[plane_idx]; + ref_end = c->last.data[plane_idx] + + (bw - 1 + c->last.linesize[plane_idx] * (bh - 1)) * 8; + + for (i = 0; i < 64; i++) + coordmap[i] = (i & 7) + (i >> 3) * stride; + + for (by = 0; by < bh; by++) { + if (read_block_types(c->avctx, gb, &c->bundle[BINK_SRC_BLOCK_TYPES]) < 0) + return -1; + if (read_block_types(c->avctx, gb, &c->bundle[BINK_SRC_SUB_BLOCK_TYPES]) < 0) + return -1; + if (read_colors(gb, &c->bundle[BINK_SRC_COLORS], c) < 0) + return -1; + if (read_patterns(c->avctx, gb, &c->bundle[BINK_SRC_PATTERN]) < 0) + return -1; + if (read_motion_values(c->avctx, gb, &c->bundle[BINK_SRC_X_OFF]) < 0) + return -1; + if (read_motion_values(c->avctx, gb, &c->bundle[BINK_SRC_Y_OFF]) < 0) + return -1; + if (read_dcs(c->avctx, gb, &c->bundle[BINK_SRC_INTRA_DC], DC_START_BITS, 0) < 0) + return -1; + if (read_dcs(c->avctx, gb, &c->bundle[BINK_SRC_INTER_DC], DC_START_BITS, 1) < 0) + return -1; + if (read_runs(c->avctx, gb, &c->bundle[BINK_SRC_RUN]) < 0) + return -1; + + if (by == bh) + break; + dst = c->pic.data[plane_idx] + 8*by*stride; + prev = c->last.data[plane_idx] + 8*by*stride; + for (bx = 0; bx < bw; bx++, dst += 8, prev += 8) { + blk = get_value(c, BINK_SRC_BLOCK_TYPES); + // 16x16 block type on odd line means part of the already decoded block, so skip it + if ((by & 1) && blk == SCALED_BLOCK) { + bx++; + dst += 8; + prev += 8; + continue; + } + switch (blk) { + case SKIP_BLOCK: + c->dsp.put_pixels_tab[1][0](dst, prev, stride, 8); + break; + case SCALED_BLOCK: + blk = get_value(c, BINK_SRC_SUB_BLOCK_TYPES); + switch (blk) { + case RUN_BLOCK: + scan = bink_patterns[get_bits(gb, 4)]; + i = 0; + do { + int run = get_value(c, BINK_SRC_RUN) + 1; + + i += run; + if (i > 64) { + av_log(c->avctx, AV_LOG_ERROR, "Run went out of bounds\n"); + return -1; + } + if (get_bits1(gb)) { + v = get_value(c, BINK_SRC_COLORS); + for (j = 0; j < run; j++) + ublock[*scan++] = v; + } else { + for (j = 0; j < run; j++) + ublock[*scan++] = get_value(c, BINK_SRC_COLORS); + } + } while (i < 63); + if (i == 63) + ublock[*scan++] = get_value(c, BINK_SRC_COLORS); + break; + case INTRA_BLOCK: + c->dsp.clear_block(block); + block[0] = get_value(c, BINK_SRC_INTRA_DC); + read_dct_coeffs(gb, block, c->scantable.permutated, 1); + c->dsp.idct(block); + c->dsp.put_pixels_nonclamped(block, ublock, 8); + break; + case FILL_BLOCK: + v = get_value(c, BINK_SRC_COLORS); + c->dsp.fill_block_tab[0](dst, v, stride, 16); + break; + case PATTERN_BLOCK: + for (i = 0; i < 2; i++) + col[i] = get_value(c, BINK_SRC_COLORS); + for (j = 0; j < 8; j++) { + v = get_value(c, BINK_SRC_PATTERN); + for (i = 0; i < 8; i++, v >>= 1) + ublock[i + j*8] = col[v & 1]; + } + break; + case RAW_BLOCK: + for (j = 0; j < 8; j++) + for (i = 0; i < 8; i++) + ublock[i + j*8] = get_value(c, BINK_SRC_COLORS); + break; + default: + av_log(c->avctx, AV_LOG_ERROR, "Incorrect 16x16 block type %d\n", blk); + return -1; + } + if (blk != FILL_BLOCK) + c->dsp.scale_block(ublock, dst, stride); + bx++; + dst += 8; + prev += 8; + break; + case MOTION_BLOCK: + xoff = get_value(c, BINK_SRC_X_OFF); + yoff = get_value(c, BINK_SRC_Y_OFF); + ref = prev + xoff + yoff * stride; + if (ref < ref_start || ref > ref_end) { + av_log(c->avctx, AV_LOG_ERROR, "Copy out of bounds @%d, %d\n", + bx*8 + xoff, by*8 + yoff); + return -1; + } + c->dsp.put_pixels_tab[1][0](dst, ref, stride, 8); + break; + case RUN_BLOCK: + scan = bink_patterns[get_bits(gb, 4)]; + i = 0; + do { + int run = get_value(c, BINK_SRC_RUN) + 1; + + i += run; + if (i > 64) { + av_log(c->avctx, AV_LOG_ERROR, "Run went out of bounds\n"); + return -1; + } + if (get_bits1(gb)) { + v = get_value(c, BINK_SRC_COLORS); + for (j = 0; j < run; j++) + dst[coordmap[*scan++]] = v; + } else { + for (j = 0; j < run; j++) + dst[coordmap[*scan++]] = get_value(c, BINK_SRC_COLORS); + } + } while (i < 63); + if (i == 63) + dst[coordmap[*scan++]] = get_value(c, BINK_SRC_COLORS); + break; + case RESIDUE_BLOCK: + xoff = get_value(c, BINK_SRC_X_OFF); + yoff = get_value(c, BINK_SRC_Y_OFF); + ref = prev + xoff + yoff * stride; + if (ref < ref_start || ref > ref_end) { + av_log(c->avctx, AV_LOG_ERROR, "Copy out of bounds @%d, %d\n", + bx*8 + xoff, by*8 + yoff); + return -1; + } + c->dsp.put_pixels_tab[1][0](dst, ref, stride, 8); + c->dsp.clear_block(block); + v = get_bits(gb, 7); + read_residue(gb, block, v); + c->dsp.add_pixels8(dst, block, stride); + break; + case INTRA_BLOCK: + c->dsp.clear_block(block); + block[0] = get_value(c, BINK_SRC_INTRA_DC); + read_dct_coeffs(gb, block, c->scantable.permutated, 1); + c->dsp.idct_put(dst, stride, block); + break; + case FILL_BLOCK: + v = get_value(c, BINK_SRC_COLORS); + c->dsp.fill_block_tab[1](dst, v, stride, 8); + break; + case INTER_BLOCK: + xoff = get_value(c, BINK_SRC_X_OFF); + yoff = get_value(c, BINK_SRC_Y_OFF); + ref = prev + xoff + yoff * stride; + c->dsp.put_pixels_tab[1][0](dst, ref, stride, 8); + c->dsp.clear_block(block); + block[0] = get_value(c, BINK_SRC_INTER_DC); + read_dct_coeffs(gb, block, c->scantable.permutated, 0); + c->dsp.idct_add(dst, stride, block); + break; + case PATTERN_BLOCK: + for (i = 0; i < 2; i++) + col[i] = get_value(c, BINK_SRC_COLORS); + for (i = 0; i < 8; i++) { + v = get_value(c, BINK_SRC_PATTERN); + for (j = 0; j < 8; j++, v >>= 1) + dst[i*stride + j] = col[v & 1]; + } + break; + case RAW_BLOCK: + for (i = 0; i < 8; i++) + memcpy(dst + i*stride, c->bundle[BINK_SRC_COLORS].cur_ptr + i*8, 8); + c->bundle[BINK_SRC_COLORS].cur_ptr += 64; + break; + default: + av_log(c->avctx, AV_LOG_ERROR, "Unknown block type %d\n", blk); + return -1; + } + } + } + if (get_bits_count(gb) & 0x1F) //next plane data starts at 32-bit boundary + skip_bits_long(gb, 32 - (get_bits_count(gb) & 0x1F)); + + return 0; +} + +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *pkt) +{ + BinkContext * const c = avctx->priv_data; + GetBitContext gb; + int plane, plane_idx; + int bits_count = pkt->size << 3; + + if(c->pic.data[0]) + avctx->release_buffer(avctx, &c->pic); + + if(avctx->get_buffer(avctx, &c->pic) < 0){ + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return -1; + } + + init_get_bits(&gb, pkt->data, bits_count); + if (c->has_alpha) { + if (c->version >= 'i') + skip_bits_long(&gb, 32); + if (bink_decode_plane(c, &gb, 3, 0) < 0) + return -1; + } + if (c->version >= 'i') + skip_bits_long(&gb, 32); + + for (plane = 0; plane < 3; plane++) { + plane_idx = (!plane || !c->swap_planes) ? plane : (plane ^ 3); + + if (bink_decode_plane(c, &gb, plane_idx, !!plane) < 0) + return -1; + if (get_bits_count(&gb) >= bits_count) + break; + } + emms_c(); + + *data_size = sizeof(AVFrame); + *(AVFrame*)data = c->pic; + + FFSWAP(AVFrame, c->pic, c->last); + + /* always report that the buffer was completely consumed */ + return pkt->size; +} + +static av_cold int decode_init(AVCodecContext *avctx) +{ + BinkContext * const c = avctx->priv_data; + static VLC_TYPE table[16 * 128][2]; + int i; + int flags; + + c->version = avctx->codec_tag >> 24; + if (c->version < 'c') { + av_log(avctx, AV_LOG_ERROR, "Too old version '%c'\n", c->version); + return -1; + } + if (avctx->extradata_size < 4) { + av_log(avctx, AV_LOG_ERROR, "Extradata missing or too short\n"); + return -1; + } + flags = AV_RL32(avctx->extradata); + c->has_alpha = flags & BINK_FLAG_ALPHA; + c->swap_planes = c->version >= 'h'; + if (!bink_trees[15].table) { + for (i = 0; i < 16; i++) { + const int maxbits = bink_tree_lens[i][15]; + bink_trees[i].table = table + i*128; + bink_trees[i].table_allocated = 1 << maxbits; + init_vlc(&bink_trees[i], maxbits, 16, + bink_tree_lens[i], 1, 1, + bink_tree_bits[i], 1, 1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); + } + } + c->avctx = avctx; + + c->pic.data[0] = NULL; + + if (av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0) { + return 1; + } + + avctx->pix_fmt = c->has_alpha ? PIX_FMT_YUVA420P : PIX_FMT_YUV420P; + + avctx->idct_algo = FF_IDCT_BINK; + dsputil_init(&c->dsp, avctx); + ff_init_scantable(c->dsp.idct_permutation, &c->scantable, bink_scan); + + init_bundles(c); + + return 0; +} + +static av_cold int decode_end(AVCodecContext *avctx) +{ + BinkContext * const c = avctx->priv_data; + + if (c->pic.data[0]) + avctx->release_buffer(avctx, &c->pic); + if (c->last.data[0]) + avctx->release_buffer(avctx, &c->last); + + free_bundles(c); + return 0; +} + +AVCodec ff_bink_decoder = { + "binkvideo", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_BINKVIDEO, + sizeof(BinkContext), + decode_init, + NULL, + decode_end, + decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("Bink video"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/binkaudio.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/binkaudio.c new file mode 100644 index 00000000..53484654 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/binkaudio.c @@ -0,0 +1,310 @@ +/* + * Bink Audio decoder + * Copyright (c) 2007-2010 Peter Ross (pross@xvid.org) + * Copyright (c) 2009 Daniel Verkamp (daniel@drv.nu) + * + * 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 + * Bink Audio decoder + * + * Technical details here: + * http://wiki.multimedia.cx/index.php?title=Bink_Audio + */ + +#include "avcodec.h" +#define ALT_BITSTREAM_READER_LE +#include "get_bits.h" +#include "dsputil.h" +#include "fft.h" +#include "fmtconvert.h" + +extern const uint16_t ff_wma_critical_freqs[25]; + +#define MAX_CHANNELS 2 +#define BINK_BLOCK_MAX_SIZE (MAX_CHANNELS << 11) + +typedef struct { + AVCodecContext *avctx; + GetBitContext gb; + DSPContext dsp; + FmtConvertContext fmt_conv; + int first; + int channels; + int frame_len; ///< transform size (samples) + int overlap_len; ///< overlap size (samples) + int block_size; + int num_bands; + unsigned int *bands; + float root; + DECLARE_ALIGNED(16, FFTSample, coeffs)[BINK_BLOCK_MAX_SIZE]; + DECLARE_ALIGNED(16, short, previous)[BINK_BLOCK_MAX_SIZE / 16]; ///< coeffs from previous audio block + float *coeffs_ptr[MAX_CHANNELS]; ///< pointers to the coeffs arrays for float_to_int16_interleave + union { + RDFTContext rdft; + DCTContext dct; + } trans; +} BinkAudioContext; + + +static av_cold int decode_init(AVCodecContext *avctx) +{ + BinkAudioContext *s = avctx->priv_data; + int sample_rate = avctx->sample_rate; + int sample_rate_half; + int i; + int frame_len_bits; + + s->avctx = avctx; + dsputil_init(&s->dsp, avctx); + ff_fmt_convert_init(&s->fmt_conv, avctx); + + /* determine frame length */ + if (avctx->sample_rate < 22050) { + frame_len_bits = 9; + } else if (avctx->sample_rate < 44100) { + frame_len_bits = 10; + } else { + frame_len_bits = 11; + } + s->frame_len = 1 << frame_len_bits; + + if (s->channels > MAX_CHANNELS) { + av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels); + return -1; + } + + if (avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT) { + // audio is already interleaved for the RDFT format variant + sample_rate *= avctx->channels; + s->frame_len *= avctx->channels; + s->channels = 1; + if (avctx->channels == 2) + frame_len_bits++; + } else { + s->channels = avctx->channels; + } + + s->overlap_len = s->frame_len / 16; + s->block_size = (s->frame_len - s->overlap_len) * s->channels; + sample_rate_half = (sample_rate + 1) / 2; + s->root = 2.0 / sqrt(s->frame_len); + + /* calculate number of bands */ + for (s->num_bands = 1; s->num_bands < 25; s->num_bands++) + if (sample_rate_half <= ff_wma_critical_freqs[s->num_bands - 1]) + break; + + s->bands = av_malloc((s->num_bands + 1) * sizeof(*s->bands)); + if (!s->bands) + return AVERROR(ENOMEM); + + /* populate bands data */ + s->bands[0] = 1; + for (i = 1; i < s->num_bands; i++) + s->bands[i] = ff_wma_critical_freqs[i - 1] * (s->frame_len / 2) / sample_rate_half; + s->bands[s->num_bands] = s->frame_len / 2; + + s->first = 1; + avctx->sample_fmt = AV_SAMPLE_FMT_S16; + + for (i = 0; i < s->channels; i++) + s->coeffs_ptr[i] = s->coeffs + i * s->frame_len; + + if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT) + ff_rdft_init(&s->trans.rdft, frame_len_bits, DFT_C2R); + else if (CONFIG_BINKAUDIO_DCT_DECODER) + ff_dct_init(&s->trans.dct, frame_len_bits, DCT_III); + else + return -1; + + return 0; +} + +static float get_float(GetBitContext *gb) +{ + int power = get_bits(gb, 5); + float f = ldexpf(get_bits_long(gb, 23), power - 23); + if (get_bits1(gb)) + f = -f; + return f; +} + +static const uint8_t rle_length_tab[16] = { + 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 32, 64 +}; + +/** + * Decode Bink Audio block + * @param[out] out Output buffer (must contain s->block_size elements) + */ +static void decode_block(BinkAudioContext *s, short *out, int use_dct) +{ + int ch, i, j, k; + float q, quant[25]; + int width, coeff; + GetBitContext *gb = &s->gb; + + if (use_dct) + skip_bits(gb, 2); + + for (ch = 0; ch < s->channels; ch++) { + FFTSample *coeffs = s->coeffs_ptr[ch]; + q = 0.0f; + coeffs[0] = get_float(gb) * s->root; + coeffs[1] = get_float(gb) * s->root; + + for (i = 0; i < s->num_bands; i++) { + /* constant is result of 0.066399999/log10(M_E) */ + int value = get_bits(gb, 8); + quant[i] = expf(FFMIN(value, 95) * 0.15289164787221953823f) * s->root; + } + + // find band (k) + for (k = 0; s->bands[k] < 1; k++) { + q = quant[k]; + } + + // parse coefficients + i = 2; + while (i < s->frame_len) { + if (get_bits1(gb)) { + j = i + rle_length_tab[get_bits(gb, 4)] * 8; + } else { + j = i + 8; + } + + j = FFMIN(j, s->frame_len); + + width = get_bits(gb, 4); + if (width == 0) { + memset(coeffs + i, 0, (j - i) * sizeof(*coeffs)); + i = j; + while (s->bands[k] * 2 < i) + q = quant[k++]; + } else { + while (i < j) { + if (s->bands[k] * 2 == i) + q = quant[k++]; + coeff = get_bits(gb, width); + if (coeff) { + if (get_bits1(gb)) + coeffs[i] = -q * coeff; + else + coeffs[i] = q * coeff; + } else { + coeffs[i] = 0.0f; + } + i++; + } + } + } + + if (CONFIG_BINKAUDIO_DCT_DECODER && use_dct) { + coeffs[0] /= 0.5; + ff_dct_calc (&s->trans.dct, coeffs); + s->dsp.vector_fmul_scalar(coeffs, coeffs, s->frame_len / 2, s->frame_len); + } + else if (CONFIG_BINKAUDIO_RDFT_DECODER) + ff_rdft_calc(&s->trans.rdft, coeffs); + } + + s->fmt_conv.float_to_int16_interleave(out, (const float **)s->coeffs_ptr, + s->frame_len, s->channels); + + if (!s->first) { + int count = s->overlap_len * s->channels; + int shift = av_log2(count); + for (i = 0; i < count; i++) { + out[i] = (s->previous[i] * (count - i) + out[i] * i) >> shift; + } + } + + memcpy(s->previous, out + s->block_size, + s->overlap_len * s->channels * sizeof(*out)); + + s->first = 0; +} + +static av_cold int decode_end(AVCodecContext *avctx) +{ + BinkAudioContext * s = avctx->priv_data; + av_freep(&s->bands); + if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT) + ff_rdft_end(&s->trans.rdft); + else if (CONFIG_BINKAUDIO_DCT_DECODER) + ff_dct_end(&s->trans.dct); + return 0; +} + +static void get_bits_align32(GetBitContext *s) +{ + int n = (-get_bits_count(s)) & 31; + if (n) skip_bits(s, n); +} + +static int decode_frame(AVCodecContext *avctx, + void *data, int *data_size, + AVPacket *avpkt) +{ + BinkAudioContext *s = avctx->priv_data; + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + short *samples = data; + short *samples_end = (short*)((uint8_t*)data + *data_size); + int reported_size; + GetBitContext *gb = &s->gb; + + init_get_bits(gb, buf, buf_size * 8); + + reported_size = get_bits_long(gb, 32); + while (get_bits_count(gb) / 8 < buf_size && + samples + s->block_size <= samples_end) { + decode_block(s, samples, avctx->codec->id == CODEC_ID_BINKAUDIO_DCT); + samples += s->block_size; + get_bits_align32(gb); + } + + *data_size = FFMIN(reported_size, (uint8_t*)samples - (uint8_t*)data); + return buf_size; +} + +AVCodec ff_binkaudio_rdft_decoder = { + "binkaudio_rdft", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_BINKAUDIO_RDFT, + sizeof(BinkAudioContext), + decode_init, + NULL, + decode_end, + decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("Bink Audio (RDFT)") +}; + +AVCodec ff_binkaudio_dct_decoder = { + "binkaudio_dct", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_BINKAUDIO_DCT, + sizeof(BinkAudioContext), + decode_init, + NULL, + decode_end, + decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("Bink Audio (DCT)") +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/binkdata.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/binkdata.h new file mode 100644 index 00000000..1ca34a68 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/binkdata.h @@ -0,0 +1,614 @@ +/* + * Bink video decoder + * Copyright (C) 2009 Kostya Shishkov + * + * 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 + */ + +#ifndef AVCODEC_BINKDATA_H +#define AVCODEC_BINKDATA_H + +#include + +/** Bink DCT and residue 8x8 block scan order */ +static const uint8_t bink_scan[64] = { + 0, 1, 8, 9, 2, 3, 10, 11, + 4, 5, 12, 13, 6, 7, 14, 15, + 20, 21, 28, 29, 22, 23, 30, 31, + 16, 17, 24, 25, 32, 33, 40, 41, + 34, 35, 42, 43, 48, 49, 56, 57, + 50, 51, 58, 59, 18, 19, 26, 27, + 36, 37, 44, 45, 38, 39, 46, 47, + 52, 53, 60, 61, 54, 55, 62, 63 +}; + +static const uint8_t bink_tree_bits[16][16] = { + { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + }, + { + 0x00, 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, + 0x0F, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F, + }, + { + 0x00, 0x02, 0x01, 0x09, 0x05, 0x15, 0x0D, 0x1D, + 0x03, 0x13, 0x0B, 0x1B, 0x07, 0x17, 0x0F, 0x1F, + }, + { + 0x00, 0x02, 0x06, 0x01, 0x09, 0x05, 0x0D, 0x1D, + 0x03, 0x13, 0x0B, 0x1B, 0x07, 0x17, 0x0F, 0x1F, + }, + { + 0x00, 0x04, 0x02, 0x06, 0x01, 0x09, 0x05, 0x0D, + 0x03, 0x13, 0x0B, 0x1B, 0x07, 0x17, 0x0F, 0x1F, + }, + { + 0x00, 0x04, 0x02, 0x0A, 0x06, 0x0E, 0x01, 0x09, + 0x05, 0x0D, 0x03, 0x0B, 0x07, 0x17, 0x0F, 0x1F, + }, + { + 0x00, 0x02, 0x0A, 0x06, 0x0E, 0x01, 0x09, 0x05, + 0x0D, 0x03, 0x0B, 0x1B, 0x07, 0x17, 0x0F, 0x1F, + }, + { + 0x00, 0x01, 0x05, 0x03, 0x13, 0x0B, 0x1B, 0x3B, + 0x07, 0x27, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F, + }, + { + 0x00, 0x01, 0x03, 0x13, 0x0B, 0x2B, 0x1B, 0x3B, + 0x07, 0x27, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F, + }, + { + 0x00, 0x01, 0x05, 0x0D, 0x03, 0x13, 0x0B, 0x1B, + 0x07, 0x27, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F, + }, + { + 0x00, 0x02, 0x01, 0x05, 0x0D, 0x03, 0x13, 0x0B, + 0x1B, 0x07, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F, + }, + { + 0x00, 0x01, 0x09, 0x05, 0x0D, 0x03, 0x13, 0x0B, + 0x1B, 0x07, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F, + }, + { + 0x00, 0x02, 0x01, 0x03, 0x13, 0x0B, 0x1B, 0x3B, + 0x07, 0x27, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F, + }, + { + 0x00, 0x01, 0x05, 0x03, 0x07, 0x27, 0x17, 0x37, + 0x0F, 0x4F, 0x2F, 0x6F, 0x1F, 0x5F, 0x3F, 0x7F, + }, + { + 0x00, 0x01, 0x05, 0x03, 0x07, 0x17, 0x37, 0x77, + 0x0F, 0x4F, 0x2F, 0x6F, 0x1F, 0x5F, 0x3F, 0x7F, + }, + { + 0x00, 0x02, 0x01, 0x05, 0x03, 0x07, 0x27, 0x17, + 0x37, 0x0F, 0x2F, 0x6F, 0x1F, 0x5F, 0x3F, 0x7F, + }, +}; + +static const uint8_t bink_tree_lens[16][16] = { + { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, + { 1, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, + { 2, 2, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, + { 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, + { 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5 }, + { 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5 }, + { 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5 }, + { 1, 3, 3, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }, + { 1, 2, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }, + { 1, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6 }, + { 2, 2, 3, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 }, + { 1, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 }, + { 2, 2, 2, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }, + { 1, 3, 3, 3, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7 }, + { 1, 3, 3, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }, + { 2, 2, 3, 3, 3, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7 }, +}; + +static const uint8_t bink_patterns[16][64] = { + { + 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38, + 0x39, 0x31, 0x29, 0x21, 0x19, 0x11, 0x09, 0x01, + 0x02, 0x0A, 0x12, 0x1A, 0x22, 0x2A, 0x32, 0x3A, + 0x3B, 0x33, 0x2B, 0x23, 0x1B, 0x13, 0x0B, 0x03, + 0x04, 0x0C, 0x14, 0x1C, 0x24, 0x2C, 0x34, 0x3C, + 0x3D, 0x35, 0x2D, 0x25, 0x1D, 0x15, 0x0D, 0x05, + 0x06, 0x0E, 0x16, 0x1E, 0x26, 0x2E, 0x36, 0x3E, + 0x3F, 0x37, 0x2F, 0x27, 0x1F, 0x17, 0x0F, 0x07, + }, + { + 0x3B, 0x3A, 0x39, 0x38, 0x30, 0x31, 0x32, 0x33, + 0x2B, 0x2A, 0x29, 0x28, 0x20, 0x21, 0x22, 0x23, + 0x1B, 0x1A, 0x19, 0x18, 0x10, 0x11, 0x12, 0x13, + 0x0B, 0x0A, 0x09, 0x08, 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, 0x0F, 0x0E, 0x0D, 0x0C, + 0x14, 0x15, 0x16, 0x17, 0x1F, 0x1E, 0x1D, 0x1C, + 0x24, 0x25, 0x26, 0x27, 0x2F, 0x2E, 0x2D, 0x2C, + 0x34, 0x35, 0x36, 0x37, 0x3F, 0x3E, 0x3D, 0x3C, + }, + { + 0x19, 0x11, 0x12, 0x1A, 0x1B, 0x13, 0x0B, 0x03, + 0x02, 0x0A, 0x09, 0x01, 0x00, 0x08, 0x10, 0x18, + 0x20, 0x28, 0x30, 0x38, 0x39, 0x31, 0x29, 0x2A, + 0x32, 0x3A, 0x3B, 0x33, 0x2B, 0x23, 0x22, 0x21, + 0x1D, 0x15, 0x16, 0x1E, 0x1F, 0x17, 0x0F, 0x07, + 0x06, 0x0E, 0x0D, 0x05, 0x04, 0x0C, 0x14, 0x1C, + 0x24, 0x2C, 0x34, 0x3C, 0x3D, 0x35, 0x2D, 0x2E, + 0x36, 0x3E, 0x3F, 0x37, 0x2F, 0x27, 0x26, 0x25, + }, + { + 0x03, 0x0B, 0x02, 0x0A, 0x01, 0x09, 0x00, 0x08, + 0x10, 0x18, 0x11, 0x19, 0x12, 0x1A, 0x13, 0x1B, + 0x23, 0x2B, 0x22, 0x2A, 0x21, 0x29, 0x20, 0x28, + 0x30, 0x38, 0x31, 0x39, 0x32, 0x3A, 0x33, 0x3B, + 0x3C, 0x34, 0x3D, 0x35, 0x3E, 0x36, 0x3F, 0x37, + 0x2F, 0x27, 0x2E, 0x26, 0x2D, 0x25, 0x2C, 0x24, + 0x1C, 0x14, 0x1D, 0x15, 0x1E, 0x16, 0x1F, 0x17, + 0x0F, 0x07, 0x0E, 0x06, 0x0D, 0x05, 0x0C, 0x04, + }, + { + 0x18, 0x19, 0x10, 0x11, 0x08, 0x09, 0x00, 0x01, + 0x02, 0x03, 0x0A, 0x0B, 0x12, 0x13, 0x1A, 0x1B, + 0x1C, 0x1D, 0x14, 0x15, 0x0C, 0x0D, 0x04, 0x05, + 0x06, 0x07, 0x0E, 0x0F, 0x16, 0x17, 0x1E, 0x1F, + 0x27, 0x26, 0x2F, 0x2E, 0x37, 0x36, 0x3F, 0x3E, + 0x3D, 0x3C, 0x35, 0x34, 0x2D, 0x2C, 0x25, 0x24, + 0x23, 0x22, 0x2B, 0x2A, 0x33, 0x32, 0x3B, 0x3A, + 0x39, 0x38, 0x31, 0x30, 0x29, 0x28, 0x21, 0x20, + }, + { + 0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B, + 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B, + 0x20, 0x21, 0x22, 0x23, 0x28, 0x29, 0x2A, 0x2B, + 0x30, 0x31, 0x32, 0x33, 0x38, 0x39, 0x3A, 0x3B, + 0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F, + 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F, + 0x24, 0x25, 0x26, 0x27, 0x2C, 0x2D, 0x2E, 0x2F, + 0x34, 0x35, 0x36, 0x37, 0x3C, 0x3D, 0x3E, 0x3F, + }, + { + 0x06, 0x07, 0x0F, 0x0E, 0x0D, 0x05, 0x0C, 0x04, + 0x03, 0x0B, 0x02, 0x0A, 0x09, 0x01, 0x00, 0x08, + 0x10, 0x18, 0x11, 0x19, 0x12, 0x1A, 0x13, 0x1B, + 0x14, 0x1C, 0x15, 0x1D, 0x16, 0x1E, 0x17, 0x1F, + 0x27, 0x2F, 0x26, 0x2E, 0x25, 0x2D, 0x24, 0x2C, + 0x23, 0x2B, 0x22, 0x2A, 0x21, 0x29, 0x20, 0x28, + 0x31, 0x30, 0x38, 0x39, 0x3A, 0x32, 0x3B, 0x33, + 0x3C, 0x34, 0x3D, 0x35, 0x36, 0x37, 0x3F, 0x3E, + }, + { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x2F, 0x2E, 0x2D, 0x2C, 0x2B, 0x2A, 0x29, 0x28, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38, + }, + { + 0x00, 0x08, 0x09, 0x01, 0x02, 0x03, 0x0B, 0x0A, + 0x12, 0x13, 0x1B, 0x1A, 0x19, 0x11, 0x10, 0x18, + 0x20, 0x28, 0x29, 0x21, 0x22, 0x23, 0x2B, 0x2A, + 0x32, 0x31, 0x30, 0x38, 0x39, 0x3A, 0x3B, 0x33, + 0x34, 0x3C, 0x3D, 0x3E, 0x3F, 0x37, 0x36, 0x35, + 0x2D, 0x2C, 0x24, 0x25, 0x26, 0x2E, 0x2F, 0x27, + 0x1F, 0x17, 0x16, 0x1E, 0x1D, 0x1C, 0x14, 0x15, + 0x0D, 0x0C, 0x04, 0x05, 0x06, 0x0E, 0x0F, 0x07, + }, + { + 0x18, 0x19, 0x10, 0x11, 0x08, 0x09, 0x00, 0x01, + 0x02, 0x03, 0x0A, 0x0B, 0x12, 0x13, 0x1A, 0x1B, + 0x1C, 0x1D, 0x14, 0x15, 0x0C, 0x0D, 0x04, 0x05, + 0x06, 0x07, 0x0E, 0x0F, 0x16, 0x17, 0x1E, 0x1F, + 0x26, 0x27, 0x2E, 0x2F, 0x36, 0x37, 0x3E, 0x3F, + 0x3C, 0x3D, 0x34, 0x35, 0x2C, 0x2D, 0x24, 0x25, + 0x22, 0x23, 0x2A, 0x2B, 0x32, 0x33, 0x3A, 0x3B, + 0x38, 0x39, 0x30, 0x31, 0x28, 0x29, 0x20, 0x21, + }, + { + 0x00, 0x08, 0x01, 0x09, 0x02, 0x0A, 0x03, 0x0B, + 0x13, 0x1B, 0x12, 0x1A, 0x11, 0x19, 0x10, 0x18, + 0x20, 0x28, 0x21, 0x29, 0x22, 0x2A, 0x23, 0x2B, + 0x33, 0x3B, 0x32, 0x3A, 0x31, 0x39, 0x30, 0x38, + 0x3C, 0x34, 0x3D, 0x35, 0x3E, 0x36, 0x3F, 0x37, + 0x2F, 0x27, 0x2E, 0x26, 0x2D, 0x25, 0x2C, 0x24, + 0x1F, 0x17, 0x1E, 0x16, 0x1D, 0x15, 0x1C, 0x14, + 0x0C, 0x04, 0x0D, 0x05, 0x0E, 0x06, 0x0F, 0x07, + }, + { + 0x00, 0x08, 0x10, 0x18, 0x19, 0x1A, 0x1B, 0x13, + 0x0B, 0x03, 0x02, 0x01, 0x09, 0x11, 0x12, 0x0A, + 0x04, 0x0C, 0x14, 0x1C, 0x1D, 0x1E, 0x1F, 0x17, + 0x0F, 0x07, 0x06, 0x05, 0x0D, 0x15, 0x16, 0x0E, + 0x24, 0x2C, 0x34, 0x3C, 0x3D, 0x3E, 0x3F, 0x37, + 0x2F, 0x27, 0x26, 0x25, 0x2D, 0x35, 0x36, 0x2E, + 0x20, 0x28, 0x30, 0x38, 0x39, 0x3A, 0x3B, 0x33, + 0x2B, 0x23, 0x22, 0x21, 0x29, 0x31, 0x32, 0x2A, + }, + { + 0x00, 0x08, 0x09, 0x01, 0x02, 0x03, 0x0B, 0x0A, + 0x13, 0x1B, 0x1A, 0x12, 0x11, 0x10, 0x18, 0x19, + 0x21, 0x20, 0x28, 0x29, 0x2A, 0x22, 0x23, 0x2B, + 0x33, 0x3B, 0x3A, 0x32, 0x31, 0x39, 0x38, 0x30, + 0x34, 0x3C, 0x3D, 0x35, 0x36, 0x3E, 0x3F, 0x37, + 0x2F, 0x27, 0x26, 0x2E, 0x2D, 0x2C, 0x24, 0x25, + 0x1D, 0x1C, 0x14, 0x15, 0x16, 0x1E, 0x1F, 0x17, + 0x0E, 0x0F, 0x07, 0x06, 0x05, 0x0D, 0x0C, 0x04, + }, + { + 0x18, 0x10, 0x08, 0x00, 0x01, 0x02, 0x03, 0x0B, + 0x13, 0x1B, 0x1A, 0x19, 0x11, 0x0A, 0x09, 0x12, + 0x1C, 0x14, 0x0C, 0x04, 0x05, 0x06, 0x07, 0x0F, + 0x17, 0x1F, 0x1E, 0x1D, 0x15, 0x0E, 0x0D, 0x16, + 0x3C, 0x34, 0x2C, 0x24, 0x25, 0x26, 0x27, 0x2F, + 0x37, 0x3F, 0x3E, 0x3D, 0x35, 0x2E, 0x2D, 0x36, + 0x38, 0x30, 0x28, 0x20, 0x21, 0x22, 0x23, 0x2B, + 0x33, 0x3B, 0x3A, 0x39, 0x31, 0x2A, 0x29, 0x32, + }, + { + 0x00, 0x08, 0x09, 0x01, 0x02, 0x0A, 0x12, 0x11, + 0x10, 0x18, 0x19, 0x1A, 0x1B, 0x13, 0x0B, 0x03, + 0x07, 0x06, 0x0E, 0x0F, 0x17, 0x16, 0x15, 0x0D, + 0x05, 0x04, 0x0C, 0x14, 0x1C, 0x1D, 0x1E, 0x1F, + 0x3F, 0x3E, 0x36, 0x37, 0x2F, 0x2E, 0x2D, 0x35, + 0x3D, 0x3C, 0x34, 0x2C, 0x24, 0x25, 0x26, 0x27, + 0x38, 0x30, 0x31, 0x39, 0x3A, 0x32, 0x2A, 0x29, + 0x28, 0x20, 0x21, 0x22, 0x23, 0x2B, 0x33, 0x3B, + }, + { + 0x00, 0x01, 0x08, 0x09, 0x10, 0x11, 0x18, 0x19, + 0x20, 0x21, 0x28, 0x29, 0x30, 0x31, 0x38, 0x39, + 0x3A, 0x3B, 0x32, 0x33, 0x2A, 0x2B, 0x22, 0x23, + 0x1A, 0x1B, 0x12, 0x13, 0x0A, 0x0B, 0x02, 0x03, + 0x04, 0x05, 0x0C, 0x0D, 0x14, 0x15, 0x1C, 0x1D, + 0x24, 0x25, 0x2C, 0x2D, 0x34, 0x35, 0x3C, 0x3D, + 0x3E, 0x3F, 0x36, 0x37, 0x2E, 0x2F, 0x26, 0x27, + 0x1E, 0x1F, 0x16, 0x17, 0x0E, 0x0F, 0x06, 0x07, + } +}; + +static const uint32_t bink_intra_quant[16][64] = { +{ + 0x010000, 0x016315, 0x01E83D, 0x02A535, 0x014E7B, 0x016577, 0x02F1E6, 0x02724C, + 0x010000, 0x00EEDA, 0x024102, 0x017F9B, 0x00BE80, 0x00611E, 0x01083C, 0x00A552, + 0x021F88, 0x01DC53, 0x027FAD, 0x01F697, 0x014819, 0x00A743, 0x015A31, 0x009688, + 0x02346F, 0x030EE5, 0x01FBFA, 0x02C096, 0x01D000, 0x028396, 0x019247, 0x01F9AA, + 0x02346F, 0x01FBFA, 0x01DC53, 0x0231B8, 0x012F12, 0x01E06C, 0x00CB10, 0x0119A8, + 0x01C48C, 0x019748, 0x014E86, 0x0122AF, 0x02C628, 0x027F20, 0x0297B5, 0x023F32, + 0x025000, 0x01AB6B, 0x01D122, 0x0159B3, 0x012669, 0x008D43, 0x00EE1F, 0x0075ED, + 0x01490C, 0x010288, 0x00F735, 0x00EF51, 0x00E0F1, 0x0072AD, 0x00A4D8, 0x006517, +}, +{ + 0x015555, 0x01D971, 0x028AFC, 0x0386F1, 0x01BDF9, 0x01DC9F, 0x03ED33, 0x034311, + 0x015555, 0x013E78, 0x030158, 0x01FF7A, 0x00FE00, 0x00817D, 0x01604F, 0x00DC6D, + 0x02D4B5, 0x027B19, 0x0354E7, 0x029E1F, 0x01B577, 0x00DF04, 0x01CD96, 0x00C8B6, + 0x02F095, 0x0413DC, 0x02A54E, 0x03AB73, 0x026AAB, 0x035A1E, 0x02185E, 0x02A238, + 0x02F095, 0x02A54E, 0x027B19, 0x02ECF5, 0x019418, 0x028090, 0x010EC0, 0x01778A, + 0x025B66, 0x021F0B, 0x01BE09, 0x018394, 0x03B2E0, 0x03542A, 0x0374F1, 0x02FEEE, + 0x031555, 0x0239E4, 0x026C2D, 0x01CCEE, 0x01888C, 0x00BC59, 0x013D7E, 0x009D3C, + 0x01B6BB, 0x0158B5, 0x01499C, 0x013F17, 0x012BEC, 0x0098E6, 0x00DBCB, 0x0086C9, +}, +{ + 0x01AAAB, 0x024FCE, 0x032DBB, 0x0468AD, 0x022D78, 0x0253C7, 0x04E87F, 0x0413D5, + 0x01AAAB, 0x018E16, 0x03C1AE, 0x027F58, 0x013D80, 0x00A1DC, 0x01B863, 0x011388, + 0x0389E2, 0x0319DF, 0x042A21, 0x0345A7, 0x0222D4, 0x0116C5, 0x0240FC, 0x00FAE3, + 0x03ACBA, 0x0518D3, 0x034EA1, 0x04964F, 0x030555, 0x0430A5, 0x029E76, 0x034AC5, + 0x03ACBA, 0x034EA1, 0x0319DF, 0x03A833, 0x01F91E, 0x0320B4, 0x015270, 0x01D56D, + 0x02F23F, 0x02A6CE, 0x022D8B, 0x01E479, 0x049F98, 0x042935, 0x04522D, 0x03BEA9, + 0x03DAAB, 0x02C85D, 0x030738, 0x02402A, 0x01EAAF, 0x00EB6F, 0x018CDE, 0x00C48A, + 0x022469, 0x01AEE2, 0x019C02, 0x018EDD, 0x0176E7, 0x00BF20, 0x0112BE, 0x00A87B, +}, +{ + 0x020000, 0x02C62A, 0x03D07A, 0x054A69, 0x029CF6, 0x02CAEF, 0x05E3CC, 0x04E499, + 0x020000, 0x01DDB4, 0x048204, 0x02FF36, 0x017D01, 0x00C23C, 0x021077, 0x014AA3, + 0x043F0F, 0x03B8A6, 0x04FF5A, 0x03ED2E, 0x029032, 0x014E86, 0x02B461, 0x012D11, + 0x0468DF, 0x061DCA, 0x03F7F5, 0x05812C, 0x03A000, 0x05072C, 0x03248D, 0x03F353, + 0x0468DF, 0x03F7F5, 0x03B8A6, 0x046370, 0x025E24, 0x03C0D8, 0x019620, 0x02334F, + 0x038919, 0x032E91, 0x029D0D, 0x02455E, 0x058C50, 0x04FE3F, 0x052F69, 0x047E65, + 0x04A000, 0x0356D6, 0x03A243, 0x02B365, 0x024CD2, 0x011A85, 0x01DC3E, 0x00EBD9, + 0x029218, 0x020510, 0x01EE69, 0x01DEA2, 0x01C1E2, 0x00E559, 0x0149B0, 0x00CA2D, +}, +{ + 0x02AAAB, 0x03B2E3, 0x0515F8, 0x070DE2, 0x037BF2, 0x03B93E, 0x07DA65, 0x068621, + 0x02AAAB, 0x027CF0, 0x0602B1, 0x03FEF3, 0x01FC01, 0x0102FA, 0x02C09F, 0x01B8DA, + 0x05A96A, 0x04F632, 0x06A9CE, 0x053C3E, 0x036AED, 0x01BE09, 0x039B2D, 0x01916B, + 0x05E129, 0x0827B8, 0x054A9C, 0x0756E5, 0x04D555, 0x06B43B, 0x0430BC, 0x05446F, + 0x05E129, 0x054A9C, 0x04F632, 0x05D9EB, 0x032830, 0x050121, 0x021D80, 0x02EF14, + 0x04B6CC, 0x043E16, 0x037C11, 0x030728, 0x0765C0, 0x06A855, 0x06E9E2, 0x05FDDB, + 0x062AAB, 0x0473C8, 0x04D85A, 0x0399DC, 0x031118, 0x0178B2, 0x027AFD, 0x013A77, + 0x036D76, 0x02B16A, 0x029337, 0x027E2E, 0x0257D8, 0x0131CC, 0x01B796, 0x010D91, +}, +{ + 0x038000, 0x04DACA, 0x06ACD5, 0x094238, 0x0492AE, 0x04E322, 0x0A4EA5, 0x08900C, + 0x038000, 0x0343FB, 0x07E388, 0x053E9F, 0x029AC1, 0x0153E8, 0x039CD0, 0x02429E, + 0x076E5B, 0x068322, 0x08BEDE, 0x06DF11, 0x047C57, 0x02496B, 0x04BBAB, 0x020EDD, + 0x07B786, 0x0AB421, 0x06F1ED, 0x09A20D, 0x065800, 0x08CC8E, 0x057FF7, 0x06E9D2, + 0x07B786, 0x06F1ED, 0x068322, 0x07AE04, 0x0424BF, 0x06917B, 0x02C6B8, 0x03D9CB, + 0x062FEB, 0x05917D, 0x0492D7, 0x03F964, 0x09B58C, 0x08BCEF, 0x0912F8, 0x07DD30, + 0x081800, 0x05D7F7, 0x065BF6, 0x04B9F1, 0x040670, 0x01EE69, 0x03416C, 0x019CBC, + 0x047FAA, 0x0388DC, 0x036138, 0x03459C, 0x03134C, 0x01915C, 0x0240F5, 0x0161CF, +}, +{ + 0x040000, 0x058C54, 0x07A0F4, 0x0A94D3, 0x0539EC, 0x0595DD, 0x0BC798, 0x09C932, + 0x040000, 0x03BB68, 0x090409, 0x05FE6D, 0x02FA01, 0x018477, 0x0420EE, 0x029547, + 0x087E1F, 0x07714C, 0x09FEB5, 0x07DA5D, 0x052064, 0x029D0D, 0x0568C3, 0x025A21, + 0x08D1BE, 0x0C3B94, 0x07EFEA, 0x0B0258, 0x074000, 0x0A0E59, 0x06491A, 0x07E6A7, + 0x08D1BE, 0x07EFEA, 0x07714C, 0x08C6E0, 0x04BC48, 0x0781B1, 0x032C3F, 0x04669F, + 0x071232, 0x065D22, 0x053A1A, 0x048ABC, 0x0B18A0, 0x09FC7F, 0x0A5ED3, 0x08FCC9, + 0x094000, 0x06ADAC, 0x074487, 0x0566CA, 0x0499A5, 0x02350B, 0x03B87B, 0x01D7B3, + 0x052430, 0x040A20, 0x03DCD3, 0x03BD45, 0x0383C5, 0x01CAB3, 0x029361, 0x01945A, +}, +{ + 0x050000, 0x06EF69, 0x098931, 0x0D3A07, 0x068867, 0x06FB55, 0x0EB97E, 0x0C3B7E, + 0x050000, 0x04AA42, 0x0B450B, 0x077E08, 0x03B881, 0x01E595, 0x05292A, 0x033A99, + 0x0A9DA7, 0x094D9F, 0x0C7E62, 0x09D0F4, 0x06687D, 0x034450, 0x06C2F4, 0x02F0AA, + 0x0B062D, 0x0F4A78, 0x09EBE4, 0x0DC2EE, 0x091000, 0x0C91EF, 0x07DB61, 0x09E050, + 0x0B062D, 0x09EBE4, 0x094D9F, 0x0AF898, 0x05EB59, 0x09621D, 0x03F74F, 0x058046, + 0x08D6BE, 0x07F46A, 0x0688A0, 0x05AD6B, 0x0DDEC8, 0x0C7B9F, 0x0CF687, 0x0B3BFB, + 0x0B9000, 0x085917, 0x0915A8, 0x06C07D, 0x05C00E, 0x02C24D, 0x04A69A, 0x024D9F, + 0x066D3C, 0x050CA7, 0x04D407, 0x04AC96, 0x0464B6, 0x023D5F, 0x033839, 0x01F971, +}, +{ + 0x060000, 0x08527E, 0x0B716E, 0x0FDF3C, 0x07D6E1, 0x0860CC, 0x11AB63, 0x0EADCB, + 0x060000, 0x05991C, 0x0D860D, 0x08FDA3, 0x047702, 0x0246B3, 0x063165, 0x03DFEA, + 0x0CBD2E, 0x0B29F1, 0x0EFE0F, 0x0BC78B, 0x07B096, 0x03EB93, 0x081D24, 0x038732, + 0x0D3A9C, 0x12595D, 0x0BE7DF, 0x108384, 0x0AE000, 0x0F1585, 0x096DA8, 0x0BD9FA, + 0x0D3A9C, 0x0BE7DF, 0x0B29F1, 0x0D2A50, 0x071A6B, 0x0B4289, 0x04C25F, 0x0699EE, + 0x0A9B4A, 0x098BB2, 0x07D727, 0x06D01A, 0x10A4F0, 0x0EFABE, 0x0F8E3C, 0x0D7B2E, + 0x0DE000, 0x0A0482, 0x0AE6CA, 0x081A2F, 0x06E677, 0x034F90, 0x0594B9, 0x02C38C, + 0x07B649, 0x060F2F, 0x05CB3C, 0x059BE7, 0x0545A7, 0x02B00C, 0x03DD11, 0x025E87, +}, +{ + 0x080000, 0x0B18A8, 0x0F41E8, 0x1529A5, 0x0A73D7, 0x0B2BBB, 0x178F2F, 0x139264, + 0x080000, 0x0776CF, 0x120812, 0x0BFCD9, 0x05F402, 0x0308EF, 0x0841DC, 0x052A8E, + 0x10FC3E, 0x0EE297, 0x13FD69, 0x0FB4B9, 0x0A40C8, 0x053A1A, 0x0AD186, 0x04B442, + 0x11A37B, 0x187727, 0x0FDFD4, 0x1604B0, 0x0E8000, 0x141CB1, 0x0C9235, 0x0FCD4D, + 0x11A37B, 0x0FDFD4, 0x0EE297, 0x118DC0, 0x09788F, 0x0F0362, 0x06587F, 0x08CD3D, + 0x0E2463, 0x0CBA43, 0x0A7434, 0x091577, 0x163140, 0x13F8FE, 0x14BDA5, 0x11F992, + 0x128000, 0x0D5B58, 0x0E890D, 0x0ACD94, 0x093349, 0x046A15, 0x0770F7, 0x03AF65, + 0x0A4861, 0x08143F, 0x07B9A6, 0x077A89, 0x070789, 0x039565, 0x0526C2, 0x0328B4, +}, +{ + 0x0C0000, 0x10A4FD, 0x16E2DB, 0x1FBE78, 0x0FADC3, 0x10C198, 0x2356C7, 0x1D5B96, + 0x0C0000, 0x0B3237, 0x1B0C1A, 0x11FB46, 0x08EE03, 0x048D66, 0x0C62CA, 0x07BFD5, + 0x197A5D, 0x1653E3, 0x1DFC1E, 0x178F16, 0x0F612C, 0x07D727, 0x103A49, 0x070E64, + 0x1A7539, 0x24B2BB, 0x17CFBD, 0x210709, 0x15C000, 0x1E2B0A, 0x12DB4F, 0x17B3F4, + 0x1A7539, 0x17CFBD, 0x1653E3, 0x1A54A0, 0x0E34D7, 0x168513, 0x0984BE, 0x0D33DC, + 0x153695, 0x131765, 0x0FAE4E, 0x0DA033, 0x2149E1, 0x1DF57D, 0x1F1C78, 0x1AF65B, + 0x1BC000, 0x140904, 0x15CD94, 0x10345E, 0x0DCCEE, 0x069F20, 0x0B2972, 0x058718, + 0x0F6C91, 0x0C1E5E, 0x0B9678, 0x0B37CE, 0x0A8B4E, 0x056018, 0x07BA22, 0x04BD0E, +}, +{ + 0x110000, 0x179466, 0x206C0C, 0x2CF87F, 0x16362A, 0x17BCED, 0x321044, 0x299714, + 0x110000, 0x0FDC79, 0x265125, 0x19794E, 0x0CA685, 0x0672FB, 0x118BF4, 0x0AFA6D, + 0x241804, 0x1FA181, 0x2A7A80, 0x21600A, 0x15C9A9, 0x0B1B77, 0x16FD3C, 0x09FF0D, + 0x257B66, 0x33FD33, 0x21BBA2, 0x2EC9F7, 0x1ED000, 0x2ABCF9, 0x1AB6B0, 0x219444, + 0x257B66, 0x21BBA2, 0x1FA181, 0x254D38, 0x142030, 0x1FE730, 0x0D7C0E, 0x12B423, + 0x1E0D52, 0x1B0BCF, 0x1636EE, 0x134D9E, 0x2F28A9, 0x2A711B, 0x2C12FF, 0x263256, + 0x275000, 0x1C621B, 0x1EE33C, 0x16F4DB, 0x138CFB, 0x09616E, 0x0FD00C, 0x07D4B7, + 0x15D9CE, 0x112B06, 0x106A80, 0x0FE464, 0x0EF004, 0x079D77, 0x0AF25B, 0x06B67F, +}, +{ + 0x160000, 0x1E83CF, 0x29F53D, 0x3A3286, 0x1CBE90, 0x1EB842, 0x40C9C2, 0x35D293, + 0x160000, 0x1486BA, 0x319630, 0x20F756, 0x105F06, 0x085891, 0x16B51E, 0x0E3506, + 0x2EB5AA, 0x28EF20, 0x36F8E1, 0x2B30FE, 0x1C3225, 0x0E5FC7, 0x1DC030, 0x0CEFB7, + 0x308193, 0x4347AC, 0x2BA786, 0x3C8CE5, 0x27E000, 0x374EE7, 0x229212, 0x2B7494, + 0x308193, 0x2BA786, 0x28EF20, 0x3045D0, 0x1A0B89, 0x29494D, 0x11735D, 0x183469, + 0x26E410, 0x230039, 0x1CBF8F, 0x18FB09, 0x3D0771, 0x36ECBA, 0x390986, 0x316E52, + 0x32E000, 0x24BB33, 0x27F8E4, 0x1DB557, 0x194D09, 0x0C23BB, 0x1476A6, 0x0A2256, + 0x1C470A, 0x1637AD, 0x153E87, 0x1490FA, 0x1354B9, 0x09DAD6, 0x0E2A94, 0x08AFF0, +}, +{ + 0x1C0000, 0x26D64D, 0x3566AA, 0x4A11C2, 0x249572, 0x27190E, 0x527525, 0x44805E, + 0x1C0000, 0x1A1FD6, 0x3F1C3E, 0x29F4F9, 0x14D607, 0x0A9F44, 0x1CE683, 0x1214F0, + 0x3B72D9, 0x341911, 0x45F6F0, 0x36F889, 0x23E2BB, 0x124B5B, 0x25DD54, 0x1076E9, + 0x3DBC30, 0x55A109, 0x378F64, 0x4D1069, 0x32C000, 0x46646C, 0x2BFFB9, 0x374E8E, + 0x3DBC30, 0x378F64, 0x341911, 0x3D7020, 0x2125F5, 0x348BD6, 0x1635BC, 0x1ECE57, + 0x317F5B, 0x2C8BEB, 0x2496B6, 0x1FCB22, 0x4DAC61, 0x45E778, 0x4897C2, 0x3EE97F, + 0x40C000, 0x2EBFB5, 0x32DFAE, 0x25CF86, 0x203380, 0x0F734B, 0x1A0B5F, 0x0CE5E2, + 0x23FD53, 0x1C46DC, 0x1B09C4, 0x1A2CE1, 0x189A60, 0x0C8AE2, 0x1207A5, 0x0B0E77, +}, +{ + 0x220000, 0x2F28CC, 0x40D818, 0x59F0FE, 0x2C6C53, 0x2F79DA, 0x642089, 0x532E29, + 0x220000, 0x1FB8F1, 0x4CA24B, 0x32F29C, 0x194D09, 0x0CE5F7, 0x2317E8, 0x15F4DB, + 0x483007, 0x3F4303, 0x54F4FF, 0x42C014, 0x2B9351, 0x1636EE, 0x2DFA79, 0x13FE1A, + 0x4AF6CC, 0x67FA67, 0x437743, 0x5D93EE, 0x3DA000, 0x5579F1, 0x356D61, 0x432888, + 0x4AF6CC, 0x437743, 0x3F4303, 0x4A9A70, 0x284060, 0x3FCE60, 0x1AF81B, 0x256845, + 0x3C1AA5, 0x36179D, 0x2C6DDD, 0x269B3C, 0x5E5152, 0x54E237, 0x5825FE, 0x4C64AD, + 0x4EA000, 0x38C437, 0x3DC678, 0x2DE9B5, 0x2719F7, 0x12C2DB, 0x1FA018, 0x0FA96E, + 0x2BB39B, 0x22560C, 0x20D500, 0x1FC8C8, 0x1DE007, 0x0F3AEE, 0x15E4B7, 0x0D6CFE, +}, +{ + 0x2C0000, 0x3D079E, 0x53EA79, 0x74650C, 0x397D20, 0x3D7083, 0x819383, 0x6BA525, + 0x2C0000, 0x290D75, 0x632C61, 0x41EEAC, 0x20BE0C, 0x10B121, 0x2D6A3B, 0x1C6A0C, + 0x5D6B54, 0x51DE40, 0x6DF1C2, 0x5661FB, 0x38644B, 0x1CBF8F, 0x3B8060, 0x19DF6D, + 0x610326, 0x868F57, 0x574F0B, 0x7919CA, 0x4FC000, 0x6E9DCE, 0x452423, 0x56E928, + 0x610326, 0x574F0B, 0x51DE40, 0x608BA0, 0x341713, 0x52929A, 0x22E6BA, 0x3068D2, + 0x4DC821, 0x460071, 0x397F1E, 0x31F611, 0x7A0EE2, 0x6DD974, 0x72130C, 0x62DCA3, + 0x65C000, 0x497665, 0x4FF1C9, 0x3B6AAE, 0x329A12, 0x184776, 0x28ED4D, 0x1444AC, + 0x388E14, 0x2C6F5A, 0x2A7D0F, 0x2921F4, 0x26A973, 0x13B5AD, 0x1C5528, 0x115FDF, +}, +}; + +static const uint32_t bink_inter_quant[16][64] = { +{ + 0x010000, 0x017946, 0x01A5A9, 0x0248DC, 0x016363, 0x0152A7, 0x0243EC, 0x0209EA, + 0x012000, 0x00E248, 0x01BBDA, 0x015CBC, 0x00A486, 0x0053E0, 0x00F036, 0x008095, + 0x01B701, 0x016959, 0x01B0B9, 0x0153FD, 0x00F8E7, 0x007EE4, 0x00EA30, 0x007763, + 0x01B701, 0x0260EB, 0x019DE9, 0x023E1B, 0x017000, 0x01FE6E, 0x012DB5, 0x01A27B, + 0x01E0D1, 0x01B0B9, 0x018A33, 0x01718D, 0x00D87A, 0x014449, 0x007B9A, 0x00AB71, + 0x013178, 0x0112EA, 0x00AD08, 0x009BB9, 0x023D97, 0x020437, 0x021CCC, 0x01E6B4, + 0x018000, 0x012DB5, 0x0146D9, 0x0100CE, 0x00CFD2, 0x006E5C, 0x00B0E4, 0x005A2D, + 0x00E9CC, 0x00B7B1, 0x00846F, 0x006B85, 0x008337, 0x0042E5, 0x004A10, 0x002831, +}, +{ + 0x015555, 0x01F708, 0x023237, 0x030BD0, 0x01D9D9, 0x01C389, 0x03053B, 0x02B7E3, + 0x018000, 0x012DB5, 0x024FCE, 0x01D0FA, 0x00DB5D, 0x006FD5, 0x014048, 0x00AB71, + 0x024957, 0x01E1CC, 0x0240F7, 0x01C551, 0x014BDE, 0x00A92F, 0x013840, 0x009F2F, + 0x024957, 0x032BE4, 0x0227E1, 0x02FD7A, 0x01EAAB, 0x02A893, 0x019247, 0x022DF9, + 0x028116, 0x0240F7, 0x020D99, 0x01ECBC, 0x0120A3, 0x01B061, 0x00A4CE, 0x00E497, + 0x01974B, 0x016E8E, 0x00E6B5, 0x00CFA2, 0x02FCC9, 0x02B04A, 0x02D110, 0x0288F1, + 0x020000, 0x019247, 0x01B3CC, 0x015668, 0x011518, 0x009325, 0x00EBDA, 0x00783D, + 0x0137BB, 0x00F4ED, 0x00B093, 0x008F5C, 0x00AEF4, 0x005931, 0x0062BF, 0x003597, +}, +{ + 0x01AAAB, 0x0274CB, 0x02BEC4, 0x03CEC4, 0x02504F, 0x02346C, 0x03C689, 0x0365DC, + 0x01E000, 0x017922, 0x02E3C1, 0x024539, 0x011235, 0x008BCA, 0x01905A, 0x00D64D, + 0x02DBAD, 0x025A40, 0x02D134, 0x0236A5, 0x019ED6, 0x00D37B, 0x018650, 0x00C6FB, + 0x02DBAD, 0x03F6DD, 0x02B1D9, 0x03BCD8, 0x026555, 0x0352B8, 0x01F6D8, 0x02B977, + 0x03215C, 0x02D134, 0x029100, 0x0267EB, 0x0168CC, 0x021C7A, 0x00CE01, 0x011DBD, + 0x01FD1E, 0x01CA31, 0x012062, 0x01038A, 0x03BBFB, 0x035C5C, 0x038554, 0x032B2D, + 0x028000, 0x01F6D8, 0x0220C0, 0x01AC02, 0x015A5E, 0x00B7EF, 0x0126D1, 0x00964C, + 0x0185A9, 0x013228, 0x00DCB8, 0x00B333, 0x00DAB2, 0x006F7D, 0x007B6F, 0x0042FC, +}, +{ + 0x020000, 0x02F28D, 0x034B52, 0x0491B8, 0x02C6C5, 0x02A54E, 0x0487D8, 0x0413D5, + 0x024000, 0x01C48F, 0x0377B5, 0x02B977, 0x01490C, 0x00A7BF, 0x01E06C, 0x01012A, + 0x036E03, 0x02D2B3, 0x036172, 0x02A7FA, 0x01F1CE, 0x00FDC7, 0x01D460, 0x00EEC7, + 0x036E03, 0x04C1D6, 0x033BD1, 0x047C37, 0x02E000, 0x03FCDD, 0x025B6A, 0x0344F5, + 0x03C1A1, 0x036172, 0x031466, 0x02E31B, 0x01B0F5, 0x028892, 0x00F735, 0x0156E2, + 0x0262F1, 0x0225D5, 0x015A10, 0x013772, 0x047B2D, 0x04086E, 0x043998, 0x03CD69, + 0x030000, 0x025B6A, 0x028DB3, 0x02019B, 0x019FA3, 0x00DCB8, 0x0161C7, 0x00B45B, + 0x01D398, 0x016F63, 0x0108DD, 0x00D70A, 0x01066F, 0x0085C9, 0x00941F, 0x005062, +}, +{ + 0x02AAAB, 0x03EE11, 0x04646D, 0x0617A0, 0x03B3B2, 0x038713, 0x060A75, 0x056FC6, + 0x030000, 0x025B6A, 0x049F9B, 0x03A1F4, 0x01B6BB, 0x00DFAA, 0x028090, 0x0156E2, + 0x0492AE, 0x03C399, 0x0481ED, 0x038AA2, 0x0297BD, 0x01525F, 0x027080, 0x013E5E, + 0x0492AE, 0x0657C8, 0x044FC1, 0x05FAF4, 0x03D555, 0x055126, 0x03248D, 0x045BF2, + 0x05022D, 0x0481ED, 0x041B33, 0x03D979, 0x024147, 0x0360C3, 0x01499C, 0x01C92E, + 0x032E96, 0x02DD1C, 0x01CD6A, 0x019F43, 0x05F991, 0x056093, 0x05A220, 0x0511E1, + 0x040000, 0x03248D, 0x036799, 0x02ACCF, 0x022A2F, 0x01264B, 0x01D7B5, 0x00F079, + 0x026F75, 0x01E9D9, 0x016127, 0x011EB8, 0x015DE9, 0x00B262, 0x00C57F, 0x006B2D, +}, +{ + 0x038000, 0x052876, 0x05C3CF, 0x07FF02, 0x04DBD9, 0x04A148, 0x07EDBA, 0x0722B4, + 0x03F000, 0x0317FB, 0x06117C, 0x04C491, 0x023FD5, 0x01258F, 0x0348BD, 0x01C209, + 0x060085, 0x04F0B9, 0x05EA87, 0x04A5F5, 0x036728, 0x01BC1C, 0x0333A8, 0x01A1DB, + 0x060085, 0x085336, 0x05A8AE, 0x07D960, 0x050800, 0x06FA82, 0x041FF9, 0x05B8AE, + 0x0692DA, 0x05EA87, 0x0563B2, 0x050D6E, 0x02F5AD, 0x046F00, 0x01B09C, 0x02580C, + 0x042D25, 0x03C235, 0x025D9B, 0x022108, 0x07D78F, 0x070EC1, 0x0764CA, 0x06A777, + 0x054000, 0x041FF9, 0x0477F9, 0x0382D0, 0x02D75E, 0x018242, 0x026B1D, 0x013B9F, + 0x03324A, 0x0282ED, 0x01CF83, 0x017851, 0x01CB42, 0x00EA21, 0x010336, 0x008CAC, +}, +{ + 0x040000, 0x05E519, 0x0696A4, 0x092370, 0x058D8A, 0x054A9C, 0x090FB0, 0x0827AA, + 0x048000, 0x03891F, 0x06EF69, 0x0572EE, 0x029218, 0x014F7E, 0x03C0D8, 0x020254, + 0x06DC05, 0x05A565, 0x06C2E4, 0x054FF3, 0x03E39B, 0x01FB8E, 0x03A8C0, 0x01DD8D, + 0x06DC05, 0x0983AC, 0x0677A2, 0x08F86E, 0x05C000, 0x07F9B9, 0x04B6D4, 0x0689EB, + 0x078343, 0x06C2E4, 0x0628CC, 0x05C635, 0x0361EA, 0x051124, 0x01EE69, 0x02ADC5, + 0x04C5E1, 0x044BAA, 0x02B41F, 0x026EE5, 0x08F65A, 0x0810DD, 0x087330, 0x079AD1, + 0x060000, 0x04B6D4, 0x051B65, 0x040337, 0x033F47, 0x01B970, 0x02C38F, 0x0168B6, + 0x03A730, 0x02DEC6, 0x0211BA, 0x01AE14, 0x020CDD, 0x010B93, 0x01283E, 0x00A0C4, +}, +{ + 0x050000, 0x075E60, 0x083C4D, 0x0B6C4C, 0x06F0ED, 0x069D43, 0x0B539C, 0x0A3194, + 0x05A000, 0x046B67, 0x08AB44, 0x06CFAA, 0x03369E, 0x01A35E, 0x04B10F, 0x0282E8, + 0x089307, 0x070EBF, 0x08739C, 0x06A3F0, 0x04DC82, 0x027A72, 0x0492F0, 0x0254F0, + 0x089307, 0x0BE497, 0x08158B, 0x0B3689, 0x073000, 0x09F827, 0x05E489, 0x082C66, + 0x096413, 0x08739C, 0x07B2FF, 0x0737C2, 0x043A64, 0x06556D, 0x026A04, 0x035936, + 0x05F75A, 0x055E94, 0x036127, 0x030A9E, 0x0B33F1, 0x0A1514, 0x0A8FFC, 0x098186, + 0x078000, 0x05E489, 0x06623F, 0x050405, 0x040F19, 0x0227CC, 0x037473, 0x01C2E3, + 0x0490FC, 0x039677, 0x029629, 0x021999, 0x029015, 0x014E78, 0x01724E, 0x00C8F5, +}, +{ + 0x060000, 0x08D7A6, 0x09E1F6, 0x0DB528, 0x085450, 0x07EFEA, 0x0D9788, 0x0C3B7E, + 0x06C000, 0x054DAE, 0x0A671E, 0x082C66, 0x03DB24, 0x01F73E, 0x05A145, 0x03037D, + 0x0A4A08, 0x087818, 0x0A2455, 0x07F7ED, 0x05D569, 0x02F955, 0x057D20, 0x02CC54, + 0x0A4A08, 0x0E4582, 0x09B373, 0x0D74A5, 0x08A000, 0x0BF696, 0x07123E, 0x09CEE0, + 0x0B44E4, 0x0A2455, 0x093D32, 0x08A950, 0x0512DF, 0x0799B6, 0x02E59E, 0x0404A7, + 0x0728D2, 0x06717F, 0x040E2F, 0x03A657, 0x0D7187, 0x0C194B, 0x0CACC8, 0x0B683A, + 0x090000, 0x07123E, 0x07A918, 0x0604D2, 0x04DEEA, 0x029629, 0x042556, 0x021D11, + 0x057AC8, 0x044E28, 0x031A97, 0x02851E, 0x03134C, 0x01915C, 0x01BC5D, 0x00F126, +}, +{ + 0x080000, 0x0BCA33, 0x0D2D48, 0x1246E0, 0x0B1B15, 0x0A9538, 0x121F5F, 0x104F53, + 0x090000, 0x07123E, 0x0DDED2, 0x0AE5DD, 0x052430, 0x029EFD, 0x0781B1, 0x0404A7, + 0x0DB80B, 0x0B4ACB, 0x0D85C7, 0x0A9FE7, 0x07C736, 0x03F71D, 0x075180, 0x03BB1A, + 0x0DB80B, 0x130757, 0x0CEF44, 0x11F0DC, 0x0B8000, 0x0FF372, 0x096DA8, 0x0D13D6, + 0x0F0686, 0x0D85C7, 0x0C5198, 0x0B8C6A, 0x06C3D4, 0x0A2248, 0x03DCD3, 0x055B8A, + 0x098BC3, 0x089754, 0x05683E, 0x04DDC9, 0x11ECB4, 0x1021B9, 0x10E661, 0x0F35A3, + 0x0C0000, 0x096DA8, 0x0A36CB, 0x08066E, 0x067E8E, 0x0372E1, 0x05871E, 0x02D16B, + 0x074E60, 0x05BD8B, 0x042374, 0x035C28, 0x0419BB, 0x021726, 0x02507C, 0x014188, +}, +{ + 0x0C0000, 0x11AF4C, 0x13C3EC, 0x1B6A50, 0x10A89F, 0x0FDFD4, 0x1B2F0F, 0x1876FD, + 0x0D8000, 0x0A9B5D, 0x14CE3C, 0x1058CB, 0x07B649, 0x03EE7B, 0x0B4289, 0x0606FB, + 0x149410, 0x10F030, 0x1448AB, 0x0FEFDA, 0x0BAAD2, 0x05F2AB, 0x0AFA40, 0x0598A7, + 0x149410, 0x1C8B03, 0x1366E6, 0x1AE949, 0x114000, 0x17ED2B, 0x0E247C, 0x139DC1, + 0x1689C8, 0x1448AB, 0x127A63, 0x11529F, 0x0A25BE, 0x0F336D, 0x05CB3C, 0x08094E, + 0x0E51A4, 0x0CE2FE, 0x081C5D, 0x074CAE, 0x1AE30E, 0x183296, 0x195991, 0x16D074, + 0x120000, 0x0E247C, 0x0F5230, 0x0C09A5, 0x09BDD5, 0x052C51, 0x084AAC, 0x043A21, + 0x0AF590, 0x089C51, 0x06352E, 0x050A3B, 0x062698, 0x0322B9, 0x0378BA, 0x01E24D, +}, +{ + 0x110000, 0x190DAC, 0x1C0039, 0x26D69C, 0x17998C, 0x167D16, 0x2682AB, 0x22A891, + 0x132000, 0x0F06C3, 0x1D797F, 0x172876, 0x0AECE7, 0x0591D9, 0x0FF398, 0x0889E3, + 0x1D2717, 0x17FEEF, 0x1CBC47, 0x1693CA, 0x108754, 0x086D1D, 0x0F8D30, 0x07ED98, + 0x1D2717, 0x286F9A, 0x1B7C71, 0x261FD3, 0x187000, 0x21E552, 0x140904, 0x1BCA27, + 0x1FEDDC, 0x1CBC47, 0x1A2D62, 0x188A62, 0x0E6022, 0x1588DA, 0x083540, 0x0B6284, + 0x1448FE, 0x124192, 0x0B7D84, 0x0A574B, 0x2616FF, 0x2247AA, 0x23E98D, 0x2051FA, + 0x198000, 0x140904, 0x15B46F, 0x110DAA, 0x0DCCEE, 0x07541E, 0x0BBF1F, 0x05FD04, + 0x0F868B, 0x0C32C8, 0x08CB57, 0x0723D4, 0x08B6AD, 0x047130, 0x04EB08, 0x02AB42, +}, +{ + 0x160000, 0x206C0C, 0x243C86, 0x3242E8, 0x1E8A79, 0x1D1A59, 0x31D646, 0x2CDA25, + 0x18C000, 0x13722A, 0x2624C3, 0x1DF820, 0x0E2385, 0x073537, 0x14A4A7, 0x0B0CCC, + 0x25BA1D, 0x1F0DAE, 0x252FE4, 0x1D37BB, 0x1563D6, 0x0AE78E, 0x142021, 0x0A4288, + 0x25BA1D, 0x345430, 0x2391FB, 0x31565C, 0x1FA000, 0x2BDD7A, 0x19ED8D, 0x23F68C, + 0x2951EF, 0x252FE4, 0x21E061, 0x1FC224, 0x129A87, 0x1BDE47, 0x0A9F44, 0x0EBBBA, + 0x1A4058, 0x17A026, 0x0EDEAB, 0x0D61E9, 0x314AEF, 0x2C5CBE, 0x2E798A, 0x29D380, + 0x210000, 0x19ED8D, 0x1C16AE, 0x1611AE, 0x11DC06, 0x097BEA, 0x0F3391, 0x07BFE7, + 0x141787, 0x0FC93E, 0x0B617F, 0x093D6D, 0x0B46C1, 0x05BFA8, 0x065D55, 0x037437, +}, +{ + 0x1C0000, 0x2943B2, 0x2E1E7C, 0x3FF810, 0x26DEC9, 0x250A43, 0x3F6DCE, 0x3915A3, + 0x1F8000, 0x18BFD8, 0x308BE1, 0x262485, 0x11FEA9, 0x092C75, 0x1A45EB, 0x0E1049, + 0x300425, 0x2785C6, 0x2F5439, 0x252FA8, 0x1B393F, 0x0DE0E4, 0x199D41, 0x0D0EDC, + 0x300425, 0x4299B2, 0x2D456E, 0x3ECB00, 0x284000, 0x37D40F, 0x20FFCB, 0x2DC56D, + 0x3496D3, 0x2F5439, 0x2B1D93, 0x286B74, 0x17AD66, 0x2377FE, 0x0D84E2, 0x12C062, + 0x21692A, 0x1E11A5, 0x12ECDA, 0x110840, 0x3EBC76, 0x387608, 0x3B2652, 0x353BBA, + 0x2A0000, 0x20FFCB, 0x23BFC6, 0x1C1681, 0x16BAF1, 0x0C1213, 0x1358E8, 0x09DCF8, + 0x19924F, 0x141767, 0x0E7C16, 0x0BC28A, 0x0E5A0D, 0x075104, 0x0819B2, 0x04655D, +}, +{ + 0x220000, 0x321B58, 0x380072, 0x4DAD38, 0x2F3318, 0x2CFA2D, 0x4D0556, 0x455122, + 0x264000, 0x1E0D86, 0x3AF2FE, 0x2E50EB, 0x15D9CE, 0x0B23B2, 0x1FE730, 0x1113C7, + 0x3A4E2D, 0x2FFDDF, 0x39788E, 0x2D2795, 0x210EA8, 0x10DA39, 0x1F1A61, 0x0FDB2F, + 0x3A4E2D, 0x50DF33, 0x36F8E1, 0x4C3FA5, 0x30E000, 0x43CAA5, 0x281209, 0x37944D, + 0x3FDBB7, 0x39788E, 0x345AC4, 0x3114C3, 0x1CC044, 0x2B11B4, 0x106A80, 0x16C509, + 0x2891FC, 0x248324, 0x16FB08, 0x14AE97, 0x4C2DFD, 0x448F54, 0x47D31B, 0x40A3F5, + 0x330000, 0x281209, 0x2B68DF, 0x221B53, 0x1B99DB, 0x0EA83B, 0x177E3E, 0x0BFA09, + 0x1F0D17, 0x18658F, 0x1196AE, 0x0E47A8, 0x116D5A, 0x08E260, 0x09D60F, 0x055684, +}, +{ + 0x2C0000, 0x40D818, 0x48790C, 0x6485D0, 0x3D14F2, 0x3A34B2, 0x63AC8D, 0x59B44A, + 0x318000, 0x26E454, 0x4C4986, 0x3BF03F, 0x1C470A, 0x0E6A6E, 0x29494D, 0x161998, + 0x4B743A, 0x3E1B5C, 0x4A5FC7, 0x3A6F75, 0x2AC7AC, 0x15CF1D, 0x284041, 0x148510, + 0x4B743A, 0x68A861, 0x4723F6, 0x62ACB8, 0x3F4000, 0x57BAF3, 0x33DB1A, 0x47ED19, + 0x52A3DE, 0x4A5FC7, 0x43C0C2, 0x3F8448, 0x25350D, 0x37BC8E, 0x153E87, 0x1D7775, + 0x3480B0, 0x2F404C, 0x1DBD56, 0x1AC3D2, 0x6295DE, 0x58B97B, 0x5CF313, 0x53A701, + 0x420000, 0x33DB1A, 0x382D5C, 0x2C235D, 0x23B80D, 0x12F7D4, 0x1E6723, 0x0F7FCF, + 0x282F0E, 0x1F927D, 0x16C2FF, 0x127AD9, 0x168D83, 0x0B7F50, 0x0CBAAA, 0x06E86E, +}, +}; + +#endif /* AVCODEC_BINKDATA_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/binkidct.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/binkidct.c new file mode 100644 index 00000000..160926e1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/binkidct.c @@ -0,0 +1,112 @@ +/* + * Bink IDCT algorithm + * Copyright (c) 2009 Kostya Shishkov + * + * 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 + * Bink IDCT algorithm + */ + +#include "dsputil.h" + +#define A1 2896 /* (1/sqrt(2))<<12 */ +#define A2 2217 +#define A3 3784 +#define A4 -5352 + +#define IDCT_TRANSFORM(dest,s0,s1,s2,s3,s4,s5,s6,s7,d0,d1,d2,d3,d4,d5,d6,d7,munge,src) {\ + const int a0 = (src)[s0] + (src)[s4]; \ + const int a1 = (src)[s0] - (src)[s4]; \ + const int a2 = (src)[s2] + (src)[s6]; \ + const int a3 = (A1*((src)[s2] - (src)[s6])) >> 11; \ + const int a4 = (src)[s5] + (src)[s3]; \ + const int a5 = (src)[s5] - (src)[s3]; \ + const int a6 = (src)[s1] + (src)[s7]; \ + const int a7 = (src)[s1] - (src)[s7]; \ + const int b0 = a4 + a6; \ + const int b1 = (A3*(a5 + a7)) >> 11; \ + const int b2 = ((A4*a5) >> 11) - b0 + b1; \ + const int b3 = (A1*(a6 - a4) >> 11) - b2; \ + const int b4 = ((A2*a7) >> 11) + b3 - b1; \ + (dest)[d0] = munge(a0+a2 +b0); \ + (dest)[d1] = munge(a1+a3-a2+b2); \ + (dest)[d2] = munge(a1-a3+a2+b3); \ + (dest)[d3] = munge(a0-a2 -b4); \ + (dest)[d4] = munge(a0-a2 +b4); \ + (dest)[d5] = munge(a1-a3+a2-b3); \ + (dest)[d6] = munge(a1+a3-a2-b2); \ + (dest)[d7] = munge(a0+a2 -b0); \ +} +/* end IDCT_TRANSFORM macro */ + +#define MUNGE_NONE(x) (x) +#define IDCT_COL(dest,src) IDCT_TRANSFORM(dest,0,8,16,24,32,40,48,56,0,8,16,24,32,40,48,56,MUNGE_NONE,src) + +#define MUNGE_ROW(x) (((x) + 0x7F)>>8) +#define IDCT_ROW(dest,src) IDCT_TRANSFORM(dest,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,MUNGE_ROW,src) + +static inline void bink_idct_col(DCTELEM *dest, const DCTELEM *src) +{ + if ((src[8]|src[16]|src[24]|src[32]|src[40]|src[48]|src[56])==0) { + dest[0] = + dest[8] = + dest[16] = + dest[24] = + dest[32] = + dest[40] = + dest[48] = + dest[56] = src[0]; + } else { + IDCT_COL(dest, src); + } +} + +void ff_bink_idct_c(DCTELEM *block) +{ + int i; + DCTELEM temp[64]; + + for (i = 0; i < 8; i++) + bink_idct_col(&temp[i], &block[i]); + for (i = 0; i < 8; i++) { + IDCT_ROW( (&block[8*i]), (&temp[8*i]) ); + } +} + +void ff_bink_idct_add_c(uint8_t *dest, int linesize, DCTELEM *block) +{ + int i, j; + + ff_bink_idct_c(block); + for (i = 0; i < 8; i++, dest += linesize, block += 8) + for (j = 0; j < 8; j++) + dest[j] += block[j]; +} + +void ff_bink_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block) +{ + int i; + DCTELEM temp[64]; + for (i = 0; i < 8; i++) + bink_idct_col(&temp[i], &block[i]); + for (i = 0; i < 8; i++) { + IDCT_ROW( (&dest[i*linesize]), (&temp[8*i]) ); + } +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cavsdsp.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cavsdsp.h new file mode 100644 index 00000000..d3fae69e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cavsdsp.h @@ -0,0 +1,41 @@ +/* + * Chinese AVS video (AVS1-P2, JiZhun profile) decoder. + * Copyright (c) 2006 Stefan Gehrer + * + * 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 + */ + +#ifndef AVCODEC_CAVSDSP_H +#define AVCODEC_CAVSDSP_H + +#include +#include "dsputil.h" + +typedef struct CAVSDSPContext { + qpel_mc_func put_cavs_qpel_pixels_tab[2][16]; + qpel_mc_func avg_cavs_qpel_pixels_tab[2][16]; + void (*cavs_filter_lv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2); + void (*cavs_filter_lh)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2); + void (*cavs_filter_cv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2); + void (*cavs_filter_ch)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2); + void (*cavs_idct8_add)(uint8_t *dst, DCTELEM *block, int stride); +} CAVSDSPContext; + +void ff_cavsdsp_init(CAVSDSPContext* c, AVCodecContext *avctx); +void ff_cavsdsp_init_mmx(CAVSDSPContext* c, AVCodecContext *avctx); + +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cbrt_tablegen.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cbrt_tablegen.c new file mode 100644 index 00000000..e0a8e63a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cbrt_tablegen.c @@ -0,0 +1,37 @@ +/* + * Generate a header file for hardcoded AAC cube-root table + * + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + */ + +#include +#define CONFIG_HARDCODED_TABLES 0 +#include "cbrt_tablegen.h" +#include "tableprint.h" + +int main(void) +{ + cbrt_tableinit(); + + write_fileheader(); + + WRITE_ARRAY("static const", uint32_t, cbrt_tab); + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cbrt_tablegen.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cbrt_tablegen.h new file mode 100644 index 00000000..930e5137 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cbrt_tablegen.h @@ -0,0 +1,51 @@ +/* + * Header file for hardcoded AAC cube-root table + * + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + */ + +#ifndef CBRT_TABLEGEN_H +#define CBRT_TABLEGEN_H + +#include +#include + +#if CONFIG_HARDCODED_TABLES +#define cbrt_tableinit() +#include "libavcodec/cbrt_tables.h" +#else +static uint32_t cbrt_tab[1 << 13]; + +static void cbrt_tableinit(void) +{ + if (!cbrt_tab[(1<<13) - 1]) { + int i; + for (i = 0; i < 1<<13; i++) { + union { + float f; + uint32_t i; + } f; + f.f = cbrtf(i) * i; + cbrt_tab[i] = f.i; + } + } +} +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* CBRT_TABLEGEN_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cdgraphics.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cdgraphics.c new file mode 100644 index 00000000..68f556b3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/cdgraphics.c @@ -0,0 +1,382 @@ +/* + * CD Graphics Video Decoder + * Copyright (c) 2009 Michael Tison + * + * 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 + */ + +#include "avcodec.h" +#include "bytestream.h" + +/** + * @file + * @brief CD Graphics Video Decoder + * @author Michael Tison + * @sa http://wiki.multimedia.cx/index.php?title=CD_Graphics + * @sa http://www.ccs.neu.edu/home/bchafy/cdb/info/cdg + */ + +/// default screen sizes +#define CDG_FULL_WIDTH 300 +#define CDG_FULL_HEIGHT 216 +#define CDG_DISPLAY_WIDTH 294 +#define CDG_DISPLAY_HEIGHT 204 +#define CDG_BORDER_WIDTH 6 +#define CDG_BORDER_HEIGHT 12 + +/// masks +#define CDG_COMMAND 0x09 +#define CDG_MASK 0x3F + +/// instruction codes +#define CDG_INST_MEMORY_PRESET 1 +#define CDG_INST_BORDER_PRESET 2 +#define CDG_INST_TILE_BLOCK 6 +#define CDG_INST_SCROLL_PRESET 20 +#define CDG_INST_SCROLL_COPY 24 +#define CDG_INST_LOAD_PAL_LO 30 +#define CDG_INST_LOAD_PAL_HIGH 31 +#define CDG_INST_TILE_BLOCK_XOR 38 + +/// data sizes +#define CDG_PACKET_SIZE 24 +#define CDG_DATA_SIZE 16 +#define CDG_TILE_HEIGHT 12 +#define CDG_TILE_WIDTH 6 +#define CDG_MINIMUM_PKT_SIZE 6 +#define CDG_MINIMUM_SCROLL_SIZE 3 +#define CDG_HEADER_SIZE 8 +#define CDG_PALETTE_SIZE 16 + +typedef struct CDGraphicsContext { + AVFrame frame; + int hscroll; + int vscroll; +} CDGraphicsContext; + +static void cdg_init_frame(AVFrame *frame) +{ + avcodec_get_frame_defaults(frame); + frame->reference = 3; + frame->buffer_hints = FF_BUFFER_HINTS_VALID | + FF_BUFFER_HINTS_READABLE | + FF_BUFFER_HINTS_PRESERVE | + FF_BUFFER_HINTS_REUSABLE; +} + +static av_cold int cdg_decode_init(AVCodecContext *avctx) +{ + CDGraphicsContext *cc = avctx->priv_data; + + cdg_init_frame(&cc->frame); + + avctx->width = CDG_FULL_WIDTH; + avctx->height = CDG_FULL_HEIGHT; + avctx->pix_fmt = PIX_FMT_PAL8; + + return 0; +} + +static void cdg_border_preset(CDGraphicsContext *cc, uint8_t *data) +{ + int y; + int lsize = cc->frame.linesize[0]; + uint8_t *buf = cc->frame.data[0]; + int color = data[0] & 0x0F; + + if (!(data[1] & 0x0F)) { + /// fill the top and bottom borders + memset(buf, color, CDG_BORDER_HEIGHT * lsize); + memset(buf + (CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT) * lsize, + color, CDG_BORDER_HEIGHT * lsize); + + /// fill the side borders + for (y = CDG_BORDER_HEIGHT; y < CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT; y++) { + memset(buf + y * lsize, color, CDG_BORDER_WIDTH); + memset(buf + CDG_FULL_WIDTH - CDG_BORDER_WIDTH + y * lsize, + color, CDG_BORDER_WIDTH); + } + } +} + +static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low) +{ + uint8_t r, g, b; + uint16_t color; + int i; + int array_offset = low ? 0 : 8; + uint32_t *palette = (uint32_t *) cc->frame.data[1]; + + for (i = 0; i < 8; i++) { + color = (data[2 * i] << 6) + (data[2 * i + 1] & 0x3F); + r = ((color >> 8) & 0x000F) * 17; + g = ((color >> 4) & 0x000F) * 17; + b = ((color ) & 0x000F) * 17; + palette[i + array_offset] = r << 16 | g << 8 | b; + } + cc->frame.palette_has_changed = 1; +} + +static int cdg_tile_block(CDGraphicsContext *cc, uint8_t *data, int b) +{ + unsigned ci, ri; + int color; + int x, y; + int ai; + int stride = cc->frame.linesize[0]; + uint8_t *buf = cc->frame.data[0]; + + ri = (data[2] & 0x1F) * CDG_TILE_HEIGHT + cc->vscroll; + ci = (data[3] & 0x3F) * CDG_TILE_WIDTH + cc->hscroll; + + if (ri > (CDG_FULL_HEIGHT - CDG_TILE_HEIGHT)) + return AVERROR(EINVAL); + if (ci > (CDG_FULL_WIDTH - CDG_TILE_WIDTH)) + return AVERROR(EINVAL); + + for (y = 0; y < CDG_TILE_HEIGHT; y++) { + for (x = 0; x < CDG_TILE_WIDTH; x++) { + if (!((data[4 + y] >> (5 - x)) & 0x01)) + color = data[0] & 0x0F; + else + color = data[1] & 0x0F; + + ai = ci + x + (stride * (ri + y)); + if (b) + color ^= buf[ai]; + buf[ai] = color; + } + } + + return 0; +} + +#define UP 2 +#define DOWN 1 +#define LEFT 2 +#define RIGHT 1 + +static void cdg_copy_rect_buf(int out_tl_x, int out_tl_y, uint8_t *out, + int in_tl_x, int in_tl_y, uint8_t *in, + int w, int h, int stride) +{ + int y; + + in += in_tl_x + in_tl_y * stride; + out += out_tl_x + out_tl_y * stride; + for (y = 0; y < h; y++) + memcpy(out + y * stride, in + y * stride, w); +} + +static void cdg_fill_rect_preset(int tl_x, int tl_y, uint8_t *out, + int color, int w, int h, int stride) +{ + int y; + + for (y = tl_y; y < tl_y + h; y++) + memset(out + tl_x + y * stride, color, w); +} + +static void cdg_fill_wrapper(int out_tl_x, int out_tl_y, uint8_t *out, + int in_tl_x, int in_tl_y, uint8_t *in, + int color, int w, int h, int stride, int roll) +{ + if (roll) { + cdg_copy_rect_buf(out_tl_x, out_tl_y, out, in_tl_x, in_tl_y, + in, w, h, stride); + } else { + cdg_fill_rect_preset(out_tl_x, out_tl_y, out, color, w, h, stride); + } +} + +static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data, + AVFrame *new_frame, int roll_over) +{ + int color; + int hscmd, h_off, hinc, vscmd, v_off, vinc; + int y; + int stride = cc->frame.linesize[0]; + uint8_t *in = cc->frame.data[0]; + uint8_t *out = new_frame->data[0]; + + color = data[0] & 0x0F; + hscmd = (data[1] & 0x30) >> 4; + vscmd = (data[2] & 0x30) >> 4; + + h_off = FFMIN(data[1] & 0x07, CDG_BORDER_WIDTH - 1); + v_off = FFMIN(data[2] & 0x07, CDG_BORDER_HEIGHT - 1); + + /// find the difference and save the offset for cdg_tile_block usage + hinc = h_off - cc->hscroll; + vinc = v_off - cc->vscroll; + cc->hscroll = h_off; + cc->vscroll = v_off; + + if (vscmd == UP) + vinc -= 12; + if (vscmd == DOWN) + vinc += 12; + if (hscmd == LEFT) + hinc -= 6; + if (hscmd == RIGHT) + hinc += 6; + + if (!hinc && !vinc) + return; + + memcpy(new_frame->data[1], cc->frame.data[1], CDG_PALETTE_SIZE * 4); + + for (y = FFMAX(0, vinc); y < FFMIN(CDG_FULL_HEIGHT + vinc, CDG_FULL_HEIGHT); y++) + memcpy(out + FFMAX(0, hinc) + stride * y, + in + FFMAX(0, hinc) - hinc + (y - vinc) * stride, + FFMIN(stride + hinc, stride)); + + if (vinc > 0) + cdg_fill_wrapper(0, 0, out, + 0, CDG_FULL_HEIGHT - vinc, in, color, + stride, vinc, stride, roll_over); + else if (vinc < 0) + cdg_fill_wrapper(0, CDG_FULL_HEIGHT + vinc, out, + 0, 0, in, color, + stride, -1 * vinc, stride, roll_over); + + if (hinc > 0) + cdg_fill_wrapper(0, 0, out, + CDG_FULL_WIDTH - hinc, 0, in, color, + hinc, CDG_FULL_HEIGHT, stride, roll_over); + else if (hinc < 0) + cdg_fill_wrapper(CDG_FULL_WIDTH + hinc, 0, out, + 0, 0, in, color, + -1 * hinc, CDG_FULL_HEIGHT, stride, roll_over); + +} + +static int cdg_decode_frame(AVCodecContext *avctx, + void *data, int *data_size, AVPacket *avpkt) +{ + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + int ret; + uint8_t command, inst; + uint8_t cdg_data[CDG_DATA_SIZE]; + AVFrame new_frame; + CDGraphicsContext *cc = avctx->priv_data; + + if (buf_size < CDG_MINIMUM_PKT_SIZE) { + av_log(avctx, AV_LOG_ERROR, "buffer too small for decoder\n"); + return AVERROR(EINVAL); + } + + ret = avctx->reget_buffer(avctx, &cc->frame); + if (ret) { + av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); + return ret; + } + + command = bytestream_get_byte(&buf); + inst = bytestream_get_byte(&buf); + inst &= CDG_MASK; + buf += 2; /// skipping 2 unneeded bytes + bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE); + + if ((command & CDG_MASK) == CDG_COMMAND) { + switch (inst) { + case CDG_INST_MEMORY_PRESET: + if (!(cdg_data[1] & 0x0F)) + memset(cc->frame.data[0], cdg_data[0] & 0x0F, + cc->frame.linesize[0] * CDG_FULL_HEIGHT); + break; + case CDG_INST_LOAD_PAL_LO: + case CDG_INST_LOAD_PAL_HIGH: + if (buf_size - CDG_HEADER_SIZE < CDG_DATA_SIZE) { + av_log(avctx, AV_LOG_ERROR, "buffer too small for loading palette\n"); + return AVERROR(EINVAL); + } + + cdg_load_palette(cc, cdg_data, inst == CDG_INST_LOAD_PAL_LO); + break; + case CDG_INST_BORDER_PRESET: + cdg_border_preset(cc, cdg_data); + break; + case CDG_INST_TILE_BLOCK_XOR: + case CDG_INST_TILE_BLOCK: + if (buf_size - CDG_HEADER_SIZE < CDG_DATA_SIZE) { + av_log(avctx, AV_LOG_ERROR, "buffer too small for drawing tile\n"); + return AVERROR(EINVAL); + } + + ret = cdg_tile_block(cc, cdg_data, inst == CDG_INST_TILE_BLOCK_XOR); + if (ret) { + av_log(avctx, AV_LOG_ERROR, "tile is out of range\n"); + return ret; + } + break; + case CDG_INST_SCROLL_PRESET: + case CDG_INST_SCROLL_COPY: + if (buf_size - CDG_HEADER_SIZE < CDG_MINIMUM_SCROLL_SIZE) { + av_log(avctx, AV_LOG_ERROR, "buffer too small for scrolling\n"); + return AVERROR(EINVAL); + } + + cdg_init_frame(&new_frame); + ret = avctx->get_buffer(avctx, &new_frame); + if (ret) { + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return ret; + } + + cdg_scroll(cc, cdg_data, &new_frame, inst == CDG_INST_SCROLL_COPY); + avctx->release_buffer(avctx, &cc->frame); + cc->frame = new_frame; + break; + default: + break; + } + + *data_size = sizeof(AVFrame); + } else { + *data_size = 0; + buf_size = 0; + } + + *(AVFrame *) data = cc->frame; + return buf_size; +} + +static av_cold int cdg_decode_end(AVCodecContext *avctx) +{ + CDGraphicsContext *cc = avctx->priv_data; + + if (cc->frame.data[0]) + avctx->release_buffer(avctx, &cc->frame); + + return 0; +} + +AVCodec ff_cdgraphics_decoder = { + "cdgraphics", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_CDGRAPHICS, + sizeof(CDGraphicsContext), + cdg_decode_init, + NULL, + cdg_decode_end, + cdg_decode_frame, + CODEC_CAP_DR1, + .max_lowres = 5, + .long_name = NULL_IF_CONFIG_SMALL("CD Graphics video"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/chomp_bsf.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/chomp_bsf.c new file mode 100644 index 00000000..eaefaaa5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/chomp_bsf.c @@ -0,0 +1,47 @@ +/* + * Chomp bitstream filter + * Copyright (c) 2010 Alex Converse + * + * 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 + */ + +#include "avcodec.h" +#include "internal.h" + +static int chomp_filter(AVBitStreamFilterContext *bsfc, + AVCodecContext *avctx, const char *args, + uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size, + int keyframe) +{ + while (buf_size > 0 && !buf[buf_size-1]) + buf_size--; + + *poutbuf = (uint8_t*) buf; + *poutbuf_size = buf_size; + + return 0; +} + +/** + * This filter removes a string of NULL bytes from the end of a packet. + */ +AVBitStreamFilter ff_chomp_bsf = { + "chomp", + 0, + chomp_filter, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/costablegen.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/costablegen.c new file mode 100644 index 00000000..bfcd6356 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/costablegen.c @@ -0,0 +1,56 @@ +/* + * Generate a header file for hardcoded ff_cos_* tables + * + * Copyright (c) 2009 Reimar DÃķffinger + * + * 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 + */ + +#include +#include +#include + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif +#define BITS 16 +#define FLOATFMT "%.18e" + +int main(int argc, char *argv[]) +{ + int i, j; + int do_sin = argc == 2 && !strcmp(argv[1], "sin"); + double (*func)(double) = do_sin ? sin : cos; + + printf("/* This file was generated by libavcodec/costablegen */\n"); + printf("#include \"libavcodec/fft.h\"\n"); + for (i = 4; i <= BITS; i++) { + int m = 1 << i; + double freq = 2*M_PI/m; + printf("%s(%i) = {\n ", do_sin ? "SINTABLE" : "COSTABLE", m); + for (j = 0; j < m/2 - 1; j++) { + int idx = j > m/4 ? m/2 - j : j; + if (do_sin && j >= m/4) + idx = m/4 - j; + printf(" "FLOATFMT",", func(idx*freq)); + if ((j & 3) == 3) + printf("\n "); + } + printf(" "FLOATFMT"\n};\n", func(do_sin ? -(m/4 - 1)*freq : freq)); + } + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dcadsp.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dcadsp.c new file mode 100644 index 00000000..dd4994d2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dcadsp.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2004 Gildas Bazin + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#include "config.h" +#include "dcadsp.h" + +static void dca_lfe_fir_c(float *out, const float *in, const float *coefs, + int decifactor, float scale) +{ + float *out2 = out + decifactor; + const float *cf0 = coefs; + const float *cf1 = coefs + 256; + int j, k; + + /* One decimated sample generates 2*decifactor interpolated ones */ + for (k = 0; k < decifactor; k++) { + float v0 = 0.0; + float v1 = 0.0; + for (j = 0; j < 256 / decifactor; j++) { + float s = in[-j]; + v0 += s * *cf0++; + v1 += s * *--cf1; + } + *out++ = v0 * scale; + *out2++ = v1 * scale; + } +} + +void ff_dcadsp_init(DCADSPContext *s) +{ + s->lfe_fir = dca_lfe_fir_c; + if (ARCH_ARM) ff_dcadsp_init_arm(s); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dcadsp.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dcadsp.h new file mode 100644 index 00000000..bb157f76 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dcadsp.h @@ -0,0 +1,30 @@ +/* + * 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 + */ + +#ifndef AVCODEC_DCADSP_H +#define AVCODEC_DCADSP_H + +typedef struct DCADSPContext { + void (*lfe_fir)(float *out, const float *in, const float *coefs, + int decifactor, float scale); +} DCADSPContext; + +void ff_dcadsp_init(DCADSPContext *s); +void ff_dcadsp_init_arm(DCADSPContext *s); + +#endif /* AVCODEC_DCADSP_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dct.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dct.c new file mode 100644 index 00000000..dab94c30 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dct.c @@ -0,0 +1,226 @@ +/* + * (I)DCT Transforms + * Copyright (c) 2009 Peter Ross + * Copyright (c) 2010 Alex Converse + * Copyright (c) 2010 Vitor Sessak + * + * 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 St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * (Inverse) Discrete Cosine Transforms. These are also known as the + * type II and type III DCTs respectively. + */ + +#include +#include "libavutil/mathematics.h" +#include "fft.h" +#include "x86/fft.h" + +#define DCT32_FLOAT +#include "dct32.c" + +/* sin((M_PI * x / (2*n)) */ +#define SIN(s,n,x) (s->costab[(n) - (x)]) + +/* cos((M_PI * x / (2*n)) */ +#define COS(s,n,x) (s->costab[x]) + +static void ff_dst_calc_I_c(DCTContext *ctx, FFTSample *data) +{ + int n = 1 << ctx->nbits; + int i; + + data[0] = 0; + for(i = 1; i < n/2; i++) { + float tmp1 = data[i ]; + float tmp2 = data[n - i]; + float s = SIN(ctx, n, 2*i); + + s *= tmp1 + tmp2; + tmp1 = (tmp1 - tmp2) * 0.5f; + data[i ] = s + tmp1; + data[n - i] = s - tmp1; + } + + data[n/2] *= 2; + ff_rdft_calc(&ctx->rdft, data); + + data[0] *= 0.5f; + + for(i = 1; i < n-2; i += 2) { + data[i + 1] += data[i - 1]; + data[i ] = -data[i + 2]; + } + + data[n-1] = 0; +} + +static void ff_dct_calc_I_c(DCTContext *ctx, FFTSample *data) +{ + int n = 1 << ctx->nbits; + int i; + float next = -0.5f * (data[0] - data[n]); + + for(i = 0; i < n/2; i++) { + float tmp1 = data[i ]; + float tmp2 = data[n - i]; + float s = SIN(ctx, n, 2*i); + float c = COS(ctx, n, 2*i); + + c *= tmp1 - tmp2; + s *= tmp1 - tmp2; + + next += c; + + tmp1 = (tmp1 + tmp2) * 0.5f; + data[i ] = tmp1 - s; + data[n - i] = tmp1 + s; + } + + ff_rdft_calc(&ctx->rdft, data); + data[n] = data[1]; + data[1] = next; + + for(i = 3; i <= n; i += 2) + data[i] = data[i - 2] - data[i]; +} + +static void ff_dct_calc_III_c(DCTContext *ctx, FFTSample *data) +{ + int n = 1 << ctx->nbits; + int i; + + float next = data[n - 1]; + float inv_n = 1.0f / n; + + for (i = n - 2; i >= 2; i -= 2) { + float val1 = data[i ]; + float val2 = data[i - 1] - data[i + 1]; + float c = COS(ctx, n, i); + float s = SIN(ctx, n, i); + + data[i ] = c * val1 + s * val2; + data[i + 1] = s * val1 - c * val2; + } + + data[1] = 2 * next; + + ff_rdft_calc(&ctx->rdft, data); + + for (i = 0; i < n / 2; i++) { + float tmp1 = data[i ] * inv_n; + float tmp2 = data[n - i - 1] * inv_n; + float csc = ctx->csc2[i] * (tmp1 - tmp2); + + tmp1 += tmp2; + data[i ] = tmp1 + csc; + data[n - i - 1] = tmp1 - csc; + } +} + +static void ff_dct_calc_II_c(DCTContext *ctx, FFTSample *data) +{ + int n = 1 << ctx->nbits; + int i; + float next; + + for (i=0; i < n/2; i++) { + float tmp1 = data[i ]; + float tmp2 = data[n - i - 1]; + float s = SIN(ctx, n, 2*i + 1); + + s *= tmp1 - tmp2; + tmp1 = (tmp1 + tmp2) * 0.5f; + + data[i ] = tmp1 + s; + data[n-i-1] = tmp1 - s; + } + + ff_rdft_calc(&ctx->rdft, data); + + next = data[1] * 0.5; + data[1] *= -1; + + for (i = n - 2; i >= 0; i -= 2) { + float inr = data[i ]; + float ini = data[i + 1]; + float c = COS(ctx, n, i); + float s = SIN(ctx, n, i); + + data[i ] = c * inr + s * ini; + + data[i+1] = next; + + next += s * inr - c * ini; + } +} + +static void dct32_func(DCTContext *ctx, FFTSample *data) +{ + ctx->dct32(data, data); +} + +void ff_dct_calc(DCTContext *s, FFTSample *data) +{ + s->dct_calc(s, data); +} + +av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse) +{ + int n = 1 << nbits; + int i; + + s->nbits = nbits; + s->inverse = inverse; + + ff_init_ff_cos_tabs(nbits+2); + + s->costab = ff_cos_tabs[nbits+2]; + + s->csc2 = av_malloc(n/2 * sizeof(FFTSample)); + + if (ff_rdft_init(&s->rdft, nbits, inverse == DCT_III) < 0) { + av_free(s->csc2); + return -1; + } + + for (i = 0; i < n/2; i++) + s->csc2[i] = 0.5 / sin((M_PI / (2*n) * (2*i + 1))); + + switch(inverse) { + case DCT_I : s->dct_calc = ff_dct_calc_I_c; break; + case DCT_II : s->dct_calc = ff_dct_calc_II_c ; break; + case DCT_III: s->dct_calc = ff_dct_calc_III_c; break; + case DST_I : s->dct_calc = ff_dst_calc_I_c; break; + } + + if (inverse == DCT_II && nbits == 5) + s->dct_calc = dct32_func; + + s->dct32 = dct32; + if (HAVE_MMX) ff_dct_init_mmx(s); + + return 0; +} + +av_cold void ff_dct_end(DCTContext *s) +{ + ff_rdft_end(&s->rdft); + av_free(s->csc2); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dct32.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dct32.c new file mode 100644 index 00000000..4e843ee8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dct32.c @@ -0,0 +1,267 @@ +/* + * Template for the Discrete Cosine Transform for 32 samples + * Copyright (c) 2001, 2002 Fabrice Bellard + * + * 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 + */ + +#ifdef DCT32_FLOAT +# define FIXHR(x) ((float)(x)) +# define MULH3(x, y, s) ((s)*(y)*(x)) +# define INTFLOAT float +#endif + + +/* tab[i][j] = 1.0 / (2.0 * cos(pi*(2*k+1) / 2^(6 - j))) */ + +/* cos(i*pi/64) */ + +#define COS0_0 FIXHR(0.50060299823519630134/2) +#define COS0_1 FIXHR(0.50547095989754365998/2) +#define COS0_2 FIXHR(0.51544730992262454697/2) +#define COS0_3 FIXHR(0.53104259108978417447/2) +#define COS0_4 FIXHR(0.55310389603444452782/2) +#define COS0_5 FIXHR(0.58293496820613387367/2) +#define COS0_6 FIXHR(0.62250412303566481615/2) +#define COS0_7 FIXHR(0.67480834145500574602/2) +#define COS0_8 FIXHR(0.74453627100229844977/2) +#define COS0_9 FIXHR(0.83934964541552703873/2) +#define COS0_10 FIXHR(0.97256823786196069369/2) +#define COS0_11 FIXHR(1.16943993343288495515/4) +#define COS0_12 FIXHR(1.48416461631416627724/4) +#define COS0_13 FIXHR(2.05778100995341155085/8) +#define COS0_14 FIXHR(3.40760841846871878570/8) +#define COS0_15 FIXHR(10.19000812354805681150/32) + +#define COS1_0 FIXHR(0.50241928618815570551/2) +#define COS1_1 FIXHR(0.52249861493968888062/2) +#define COS1_2 FIXHR(0.56694403481635770368/2) +#define COS1_3 FIXHR(0.64682178335999012954/2) +#define COS1_4 FIXHR(0.78815462345125022473/2) +#define COS1_5 FIXHR(1.06067768599034747134/4) +#define COS1_6 FIXHR(1.72244709823833392782/4) +#define COS1_7 FIXHR(5.10114861868916385802/16) + +#define COS2_0 FIXHR(0.50979557910415916894/2) +#define COS2_1 FIXHR(0.60134488693504528054/2) +#define COS2_2 FIXHR(0.89997622313641570463/2) +#define COS2_3 FIXHR(2.56291544774150617881/8) + +#define COS3_0 FIXHR(0.54119610014619698439/2) +#define COS3_1 FIXHR(1.30656296487637652785/4) + +#define COS4_0 FIXHR(0.70710678118654752439/2) + +/* butterfly operator */ +#define BF(a, b, c, s)\ +{\ + tmp0 = val##a + val##b;\ + tmp1 = val##a - val##b;\ + val##a = tmp0;\ + val##b = MULH3(tmp1, c, 1<<(s));\ +} + +#define BF0(a, b, c, s)\ +{\ + tmp0 = tab[a] + tab[b];\ + tmp1 = tab[a] - tab[b];\ + val##a = tmp0;\ + val##b = MULH3(tmp1, c, 1<<(s));\ +} + +#define BF1(a, b, c, d)\ +{\ + BF(a, b, COS4_0, 1);\ + BF(c, d,-COS4_0, 1);\ + val##c += val##d;\ +} + +#define BF2(a, b, c, d)\ +{\ + BF(a, b, COS4_0, 1);\ + BF(c, d,-COS4_0, 1);\ + val##c += val##d;\ + val##a += val##c;\ + val##c += val##b;\ + val##b += val##d;\ +} + +#define ADD(a, b) val##a += val##b + +/* DCT32 without 1/sqrt(2) coef zero scaling. */ +static void dct32(INTFLOAT *out, const INTFLOAT *tab) +{ + INTFLOAT tmp0, tmp1; + + INTFLOAT val0 , val1 , val2 , val3 , val4 , val5 , val6 , val7 , + val8 , val9 , val10, val11, val12, val13, val14, val15, + val16, val17, val18, val19, val20, val21, val22, val23, + val24, val25, val26, val27, val28, val29, val30, val31; + + /* pass 1 */ + BF0( 0, 31, COS0_0 , 1); + BF0(15, 16, COS0_15, 5); + /* pass 2 */ + BF( 0, 15, COS1_0 , 1); + BF(16, 31,-COS1_0 , 1); + /* pass 1 */ + BF0( 7, 24, COS0_7 , 1); + BF0( 8, 23, COS0_8 , 1); + /* pass 2 */ + BF( 7, 8, COS1_7 , 4); + BF(23, 24,-COS1_7 , 4); + /* pass 3 */ + BF( 0, 7, COS2_0 , 1); + BF( 8, 15,-COS2_0 , 1); + BF(16, 23, COS2_0 , 1); + BF(24, 31,-COS2_0 , 1); + /* pass 1 */ + BF0( 3, 28, COS0_3 , 1); + BF0(12, 19, COS0_12, 2); + /* pass 2 */ + BF( 3, 12, COS1_3 , 1); + BF(19, 28,-COS1_3 , 1); + /* pass 1 */ + BF0( 4, 27, COS0_4 , 1); + BF0(11, 20, COS0_11, 2); + /* pass 2 */ + BF( 4, 11, COS1_4 , 1); + BF(20, 27,-COS1_4 , 1); + /* pass 3 */ + BF( 3, 4, COS2_3 , 3); + BF(11, 12,-COS2_3 , 3); + BF(19, 20, COS2_3 , 3); + BF(27, 28,-COS2_3 , 3); + /* pass 4 */ + BF( 0, 3, COS3_0 , 1); + BF( 4, 7,-COS3_0 , 1); + BF( 8, 11, COS3_0 , 1); + BF(12, 15,-COS3_0 , 1); + BF(16, 19, COS3_0 , 1); + BF(20, 23,-COS3_0 , 1); + BF(24, 27, COS3_0 , 1); + BF(28, 31,-COS3_0 , 1); + + + + /* pass 1 */ + BF0( 1, 30, COS0_1 , 1); + BF0(14, 17, COS0_14, 3); + /* pass 2 */ + BF( 1, 14, COS1_1 , 1); + BF(17, 30,-COS1_1 , 1); + /* pass 1 */ + BF0( 6, 25, COS0_6 , 1); + BF0( 9, 22, COS0_9 , 1); + /* pass 2 */ + BF( 6, 9, COS1_6 , 2); + BF(22, 25,-COS1_6 , 2); + /* pass 3 */ + BF( 1, 6, COS2_1 , 1); + BF( 9, 14,-COS2_1 , 1); + BF(17, 22, COS2_1 , 1); + BF(25, 30,-COS2_1 , 1); + + /* pass 1 */ + BF0( 2, 29, COS0_2 , 1); + BF0(13, 18, COS0_13, 3); + /* pass 2 */ + BF( 2, 13, COS1_2 , 1); + BF(18, 29,-COS1_2 , 1); + /* pass 1 */ + BF0( 5, 26, COS0_5 , 1); + BF0(10, 21, COS0_10, 1); + /* pass 2 */ + BF( 5, 10, COS1_5 , 2); + BF(21, 26,-COS1_5 , 2); + /* pass 3 */ + BF( 2, 5, COS2_2 , 1); + BF(10, 13,-COS2_2 , 1); + BF(18, 21, COS2_2 , 1); + BF(26, 29,-COS2_2 , 1); + /* pass 4 */ + BF( 1, 2, COS3_1 , 2); + BF( 5, 6,-COS3_1 , 2); + BF( 9, 10, COS3_1 , 2); + BF(13, 14,-COS3_1 , 2); + BF(17, 18, COS3_1 , 2); + BF(21, 22,-COS3_1 , 2); + BF(25, 26, COS3_1 , 2); + BF(29, 30,-COS3_1 , 2); + + /* pass 5 */ + BF1( 0, 1, 2, 3); + BF2( 4, 5, 6, 7); + BF1( 8, 9, 10, 11); + BF2(12, 13, 14, 15); + BF1(16, 17, 18, 19); + BF2(20, 21, 22, 23); + BF1(24, 25, 26, 27); + BF2(28, 29, 30, 31); + + /* pass 6 */ + + ADD( 8, 12); + ADD(12, 10); + ADD(10, 14); + ADD(14, 9); + ADD( 9, 13); + ADD(13, 11); + ADD(11, 15); + + out[ 0] = val0; + out[16] = val1; + out[ 8] = val2; + out[24] = val3; + out[ 4] = val4; + out[20] = val5; + out[12] = val6; + out[28] = val7; + out[ 2] = val8; + out[18] = val9; + out[10] = val10; + out[26] = val11; + out[ 6] = val12; + out[22] = val13; + out[14] = val14; + out[30] = val15; + + ADD(24, 28); + ADD(28, 26); + ADD(26, 30); + ADD(30, 25); + ADD(25, 29); + ADD(29, 27); + ADD(27, 31); + + out[ 1] = val16 + val24; + out[17] = val17 + val25; + out[ 9] = val18 + val26; + out[25] = val19 + val27; + out[ 5] = val20 + val28; + out[21] = val21 + val29; + out[13] = val22 + val30; + out[29] = val23 + val31; + out[ 3] = val24 + val20; + out[19] = val25 + val21; + out[11] = val26 + val22; + out[27] = val27 + val23; + out[ 7] = val28 + val18; + out[23] = val29 + val19; + out[15] = val30 + val17; + out[31] = val31; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dctref.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dctref.h new file mode 100644 index 00000000..adbaf689 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dctref.h @@ -0,0 +1,31 @@ +/* + * reference discrete cosine transform (double precision) + * Copyright (C) 2009 Dylan Yudaken + * + * 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 + */ + +#ifndef AVCODEC_DCTREF_H +#define AVCODEC_DCTREF_H + +#include "dsputil.h" + +void ff_ref_fdct(DCTELEM *block); +void ff_ref_idct(DCTELEM *block); +void ff_ref_dct_init(void); + +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv_tablegen.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv_tablegen.c new file mode 100644 index 00000000..5d3793e1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv_tablegen.c @@ -0,0 +1,47 @@ +/* + * Generate a header file for hardcoded DV tables + * + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + */ + +#include +#define CONFIG_HARDCODED_TABLES 0 +#ifndef CONFIG_SMALL +#error CONFIG_SMALL must be defined to generate tables +#endif +#include "dv_tablegen.h" +#include "tableprint.h" +#include + +WRITE_1D_FUNC_ARGV(dv_vlc_pair, 7, + "{0x%"PRIx32", %"PRId8"}", data[i].vlc, data[i].size) +WRITE_2D_FUNC(dv_vlc_pair) + +int main(void) +{ + dv_vlc_map_tableinit(); + + write_fileheader(); + + printf("static const struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE] = {\n"); + write_dv_vlc_pair_2d_array(dv_vlc_map, DV_VLC_MAP_RUN_SIZE, DV_VLC_MAP_LEV_SIZE); + printf("};\n"); + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv_tablegen.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv_tablegen.h new file mode 100644 index 00000000..47e8c362 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv_tablegen.h @@ -0,0 +1,96 @@ +/* + * Header file for hardcoded DV tables + * + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + */ + +#ifndef DV_TABLEGEN_H +#define DV_TABLEGEN_H + +#include +#include "dv_vlc_data.h" + +#if CONFIG_SMALL +#define DV_VLC_MAP_RUN_SIZE 15 +#define DV_VLC_MAP_LEV_SIZE 23 +#else +#define DV_VLC_MAP_RUN_SIZE 64 +#define DV_VLC_MAP_LEV_SIZE 512 //FIXME sign was removed so this should be /2 but needs check +#endif + +/* VLC encoding lookup table */ +typedef struct dv_vlc_pair { + uint32_t vlc; + uint32_t size; +} dv_vlc_pair; + +#if CONFIG_HARDCODED_TABLES +#define dv_vlc_map_tableinit() +#include "libavcodec/dv_tables.h" +#else +static struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE]; + +static void dv_vlc_map_tableinit(void) +{ + int i, j; + for (i = 0; i < NB_DV_VLC - 1; i++) { + if (dv_vlc_run[i] >= DV_VLC_MAP_RUN_SIZE) + continue; +#if CONFIG_SMALL + if (dv_vlc_level[i] >= DV_VLC_MAP_LEV_SIZE) + continue; +#endif + + if (dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size != 0) + continue; + + dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].vlc = + dv_vlc_bits[i] << (!!dv_vlc_level[i]); + dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size = + dv_vlc_len[i] + (!!dv_vlc_level[i]); + } + for (i = 0; i < DV_VLC_MAP_RUN_SIZE; i++) { +#if CONFIG_SMALL + for (j = 1; j < DV_VLC_MAP_LEV_SIZE; j++) { + if (dv_vlc_map[i][j].size == 0) { + dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc | + (dv_vlc_map[i-1][0].vlc << (dv_vlc_map[0][j].size)); + dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size + + dv_vlc_map[0][j].size; + } + } +#else + for (j = 1; j < DV_VLC_MAP_LEV_SIZE/2; j++) { + if (dv_vlc_map[i][j].size == 0) { + dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc | + (dv_vlc_map[i-1][0].vlc << (dv_vlc_map[0][j].size)); + dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size + + dv_vlc_map[0][j].size; + } + dv_vlc_map[i][((uint16_t)(-j))&0x1ff].vlc = + dv_vlc_map[i][j].vlc | 1; + dv_vlc_map[i][((uint16_t)(-j))&0x1ff].size = + dv_vlc_map[i][j].size; + } +#endif + } +} +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* DV_TABLEGEN_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv_vlc_data.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv_vlc_data.h new file mode 100644 index 00000000..c23c5646 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dv_vlc_data.h @@ -0,0 +1,259 @@ +/* + * VLC constants for DV codec + * Copyright (c) 2002 Fabrice Bellard + * + * 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 + * VLC constants for DV codec. + */ + +#ifndef AVCODEC_DV_VLC_DATA_H +#define AVCODEC_DV_VLC_DATA_H + +#include + +#define NB_DV_VLC 409 + +/* + * There's a catch about the following three tables: the mapping they establish + * between (run, level) and vlc is not 1-1. So you have to watch out for that + * when building misc. tables. E.g. (1, 0) can be either 0x7cf or 0x1f82. + */ +static const uint16_t dv_vlc_bits[409] = { + 0x0000, 0x0002, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016, + 0x0017, 0x0030, 0x0031, 0x0032, 0x0033, 0x0068, 0x0069, 0x006a, + 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x00e0, 0x00e1, 0x00e2, + 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, + 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x01e0, 0x01e1, 0x01e2, + 0x01e3, 0x01e4, 0x01e5, 0x01e6, 0x01e7, 0x01e8, 0x01e9, 0x01ea, + 0x01eb, 0x01ec, 0x01ed, 0x01ee, 0x01ef, 0x03e0, 0x03e1, 0x03e2, + 0x03e3, 0x03e4, 0x03e5, 0x03e6, 0x07ce, 0x07cf, 0x07d0, 0x07d1, + 0x07d2, 0x07d3, 0x07d4, 0x07d5, 0x0fac, 0x0fad, 0x0fae, 0x0faf, + 0x0fb0, 0x0fb1, 0x0fb2, 0x0fb3, 0x0fb4, 0x0fb5, 0x0fb6, 0x0fb7, + 0x0fb8, 0x0fb9, 0x0fba, 0x0fbb, 0x0fbc, 0x0fbd, 0x0fbe, 0x0fbf, + 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87, + 0x1f88, 0x1f89, 0x1f8a, 0x1f8b, 0x1f8c, 0x1f8d, 0x1f8e, 0x1f8f, + 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97, + 0x1f98, 0x1f99, 0x1f9a, 0x1f9b, 0x1f9c, 0x1f9d, 0x1f9e, 0x1f9f, + 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7, + 0x1fa8, 0x1fa9, 0x1faa, 0x1fab, 0x1fac, 0x1fad, 0x1fae, 0x1faf, + 0x1fb0, 0x1fb1, 0x1fb2, 0x1fb3, 0x1fb4, 0x1fb5, 0x1fb6, 0x1fb7, + 0x1fb8, 0x1fb9, 0x1fba, 0x1fbb, 0x1fbc, 0x1fbd, 0x1fbe, 0x1fbf, + 0x7f00, 0x7f01, 0x7f02, 0x7f03, 0x7f04, 0x7f05, 0x7f06, 0x7f07, + 0x7f08, 0x7f09, 0x7f0a, 0x7f0b, 0x7f0c, 0x7f0d, 0x7f0e, 0x7f0f, + 0x7f10, 0x7f11, 0x7f12, 0x7f13, 0x7f14, 0x7f15, 0x7f16, 0x7f17, + 0x7f18, 0x7f19, 0x7f1a, 0x7f1b, 0x7f1c, 0x7f1d, 0x7f1e, 0x7f1f, + 0x7f20, 0x7f21, 0x7f22, 0x7f23, 0x7f24, 0x7f25, 0x7f26, 0x7f27, + 0x7f28, 0x7f29, 0x7f2a, 0x7f2b, 0x7f2c, 0x7f2d, 0x7f2e, 0x7f2f, + 0x7f30, 0x7f31, 0x7f32, 0x7f33, 0x7f34, 0x7f35, 0x7f36, 0x7f37, + 0x7f38, 0x7f39, 0x7f3a, 0x7f3b, 0x7f3c, 0x7f3d, 0x7f3e, 0x7f3f, + 0x7f40, 0x7f41, 0x7f42, 0x7f43, 0x7f44, 0x7f45, 0x7f46, 0x7f47, + 0x7f48, 0x7f49, 0x7f4a, 0x7f4b, 0x7f4c, 0x7f4d, 0x7f4e, 0x7f4f, + 0x7f50, 0x7f51, 0x7f52, 0x7f53, 0x7f54, 0x7f55, 0x7f56, 0x7f57, + 0x7f58, 0x7f59, 0x7f5a, 0x7f5b, 0x7f5c, 0x7f5d, 0x7f5e, 0x7f5f, + 0x7f60, 0x7f61, 0x7f62, 0x7f63, 0x7f64, 0x7f65, 0x7f66, 0x7f67, + 0x7f68, 0x7f69, 0x7f6a, 0x7f6b, 0x7f6c, 0x7f6d, 0x7f6e, 0x7f6f, + 0x7f70, 0x7f71, 0x7f72, 0x7f73, 0x7f74, 0x7f75, 0x7f76, 0x7f77, + 0x7f78, 0x7f79, 0x7f7a, 0x7f7b, 0x7f7c, 0x7f7d, 0x7f7e, 0x7f7f, + 0x7f80, 0x7f81, 0x7f82, 0x7f83, 0x7f84, 0x7f85, 0x7f86, 0x7f87, + 0x7f88, 0x7f89, 0x7f8a, 0x7f8b, 0x7f8c, 0x7f8d, 0x7f8e, 0x7f8f, + 0x7f90, 0x7f91, 0x7f92, 0x7f93, 0x7f94, 0x7f95, 0x7f96, 0x7f97, + 0x7f98, 0x7f99, 0x7f9a, 0x7f9b, 0x7f9c, 0x7f9d, 0x7f9e, 0x7f9f, + 0x7fa0, 0x7fa1, 0x7fa2, 0x7fa3, 0x7fa4, 0x7fa5, 0x7fa6, 0x7fa7, + 0x7fa8, 0x7fa9, 0x7faa, 0x7fab, 0x7fac, 0x7fad, 0x7fae, 0x7faf, + 0x7fb0, 0x7fb1, 0x7fb2, 0x7fb3, 0x7fb4, 0x7fb5, 0x7fb6, 0x7fb7, + 0x7fb8, 0x7fb9, 0x7fba, 0x7fbb, 0x7fbc, 0x7fbd, 0x7fbe, 0x7fbf, + 0x7fc0, 0x7fc1, 0x7fc2, 0x7fc3, 0x7fc4, 0x7fc5, 0x7fc6, 0x7fc7, + 0x7fc8, 0x7fc9, 0x7fca, 0x7fcb, 0x7fcc, 0x7fcd, 0x7fce, 0x7fcf, + 0x7fd0, 0x7fd1, 0x7fd2, 0x7fd3, 0x7fd4, 0x7fd5, 0x7fd6, 0x7fd7, + 0x7fd8, 0x7fd9, 0x7fda, 0x7fdb, 0x7fdc, 0x7fdd, 0x7fde, 0x7fdf, + 0x7fe0, 0x7fe1, 0x7fe2, 0x7fe3, 0x7fe4, 0x7fe5, 0x7fe6, 0x7fe7, + 0x7fe8, 0x7fe9, 0x7fea, 0x7feb, 0x7fec, 0x7fed, 0x7fee, 0x7fef, + 0x7ff0, 0x7ff1, 0x7ff2, 0x7ff3, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7, + 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff, + 0x0006, +}; + +static const uint8_t dv_vlc_len[409] = { + 2, 3, 4, 4, 4, 5, 5, 5, + 5, 6, 6, 6, 6, 7, 7, 7, + 7, 7, 7, 7, 7, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 10, 10, 10, + 10, 10, 10, 10, 11, 11, 11, 11, + 11, 11, 11, 11, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 4, +}; + +static const uint8_t dv_vlc_run[409] = { + 0, 0, 1, 0, 0, 2, 1, 0, + 0, 3, 4, 0, 0, 5, 6, 2, + 1, 1, 0, 0, 0, 7, 8, 9, + 10, 3, 4, 2, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 11, 12, 13, + 14, 5, 6, 3, 4, 2, 2, 1, + 0, 0, 0, 0, 0, 5, 3, 3, + 2, 1, 1, 1, 0, 1, 6, 4, + 3, 1, 1, 1, 2, 3, 4, 5, + 7, 8, 9, 10, 7, 8, 4, 3, + 2, 2, 2, 2, 2, 1, 1, 1, + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +127, +}; + +static const uint8_t dv_vlc_level[409] = { + 1, 2, 1, 3, 4, 1, 2, 5, + 6, 1, 1, 7, 8, 1, 1, 2, + 3, 4, 9, 10, 11, 1, 1, 1, + 1, 2, 2, 3, 5, 6, 7, 12, + 13, 14, 15, 16, 17, 1, 1, 1, + 1, 2, 2, 3, 3, 4, 5, 8, + 18, 19, 20, 21, 22, 3, 4, 5, + 6, 9, 10, 11, 0, 0, 3, 4, + 6, 12, 13, 14, 0, 0, 0, 0, + 2, 2, 2, 2, 3, 3, 5, 7, + 7, 8, 9, 10, 11, 15, 16, 17, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, + 0, +}; + +#endif /* AVCODEC_DV_VLC_DATA_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dvdata.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dvdata.c new file mode 100644 index 00000000..05993d87 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dvdata.c @@ -0,0 +1,285 @@ +/* + * Constants for DV codec + * Copyright (c) 2002 Fabrice Bellard + * + * 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 + * Constants for DV codec. + */ + +#include "libavutil/rational.h" +#include "avcodec.h" +#include "dvdata.h" + +static DVwork_chunk work_chunks_dv25pal [1*12*27]; +static DVwork_chunk work_chunks_dv25pal411[1*12*27]; +static DVwork_chunk work_chunks_dv25ntsc [1*10*27]; +static DVwork_chunk work_chunks_dv50pal [2*12*27]; +static DVwork_chunk work_chunks_dv50ntsc [2*10*27]; +static DVwork_chunk work_chunks_dv100palp [2*12*27]; +static DVwork_chunk work_chunks_dv100ntscp[2*10*27]; +static DVwork_chunk work_chunks_dv100pali [4*12*27]; +static DVwork_chunk work_chunks_dv100ntsci[4*10*27]; + +static uint32_t dv_idct_factor_sd [2*2*22*64]; +static uint32_t dv_idct_factor_hd1080[2*4*16*64]; +static uint32_t dv_idct_factor_hd720 [2*4*16*64]; + +static const DVprofile dv_profiles[] = { + { .dsf = 0, + .video_stype = 0x0, + .frame_size = 120000, /* IEC 61834, SMPTE-314M - 525/60 (NTSC) */ + .difseg_size = 10, + .n_difchan = 1, + .time_base = { 1001, 30000 }, + .ltc_divisor = 30, + .height = 480, + .width = 720, + .sar = {{8, 9}, {32, 27}}, + .work_chunks = &work_chunks_dv25ntsc[0], + .idct_factor = &dv_idct_factor_sd[0], + .pix_fmt = PIX_FMT_YUV411P, + .bpm = 6, + .block_sizes = block_sizes_dv2550, + .audio_stride = 90, + .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */ + .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */ + .audio_shuffle = dv_audio_shuffle525, + }, + { .dsf = 1, + .video_stype = 0x0, + .frame_size = 144000, /* IEC 61834 - 625/50 (PAL) */ + .difseg_size = 12, + .n_difchan = 1, + .time_base = { 1, 25 }, + .ltc_divisor = 25, + .height = 576, + .width = 720, + .sar = {{16, 15}, {64, 45}}, + .work_chunks = &work_chunks_dv25pal[0], + .idct_factor = &dv_idct_factor_sd[0], + .pix_fmt = PIX_FMT_YUV420P, + .bpm = 6, + .block_sizes = block_sizes_dv2550, + .audio_stride = 108, + .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */ + .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 }, + .audio_shuffle = dv_audio_shuffle625, + }, + { .dsf = 1, + .video_stype = 0x0, + .frame_size = 144000, /* SMPTE-314M - 625/50 (PAL) */ + .difseg_size = 12, + .n_difchan = 1, + .time_base = { 1, 25 }, + .ltc_divisor = 25, + .height = 576, + .width = 720, + .sar = {{16, 15}, {64, 45}}, + .work_chunks = &work_chunks_dv25pal411[0], + .idct_factor = &dv_idct_factor_sd[0], + .pix_fmt = PIX_FMT_YUV411P, + .bpm = 6, + .block_sizes = block_sizes_dv2550, + .audio_stride = 108, + .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */ + .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 }, + .audio_shuffle = dv_audio_shuffle625, + }, + { .dsf = 0, + .video_stype = 0x4, + .frame_size = 240000, /* SMPTE-314M - 525/60 (NTSC) 50 Mbps */ + .difseg_size = 10, /* also known as "DVCPRO50" */ + .n_difchan = 2, + .time_base = { 1001, 30000 }, + .ltc_divisor = 30, + .height = 480, + .width = 720, + .sar = {{8, 9}, {32, 27}}, + .work_chunks = &work_chunks_dv50ntsc[0], + .idct_factor = &dv_idct_factor_sd[0], + .pix_fmt = PIX_FMT_YUV422P, + .bpm = 6, + .block_sizes = block_sizes_dv2550, + .audio_stride = 90, + .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */ + .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */ + .audio_shuffle = dv_audio_shuffle525, + }, + { .dsf = 1, + .video_stype = 0x4, + .frame_size = 288000, /* SMPTE-314M - 625/50 (PAL) 50 Mbps */ + .difseg_size = 12, /* also known as "DVCPRO50" */ + .n_difchan = 2, + .time_base = { 1, 25 }, + .ltc_divisor = 25, + .height = 576, + .width = 720, + .sar = {{16, 15}, {64, 45}}, + .work_chunks = &work_chunks_dv50pal[0], + .idct_factor = &dv_idct_factor_sd[0], + .pix_fmt = PIX_FMT_YUV422P, + .bpm = 6, + .block_sizes = block_sizes_dv2550, + .audio_stride = 108, + .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */ + .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 }, + .audio_shuffle = dv_audio_shuffle625, + }, + { .dsf = 0, + .video_stype = 0x14, + .frame_size = 480000, /* SMPTE-370M - 1080i60 100 Mbps */ + .difseg_size = 10, /* also known as "DVCPRO HD" */ + .n_difchan = 4, + .time_base = { 1001, 30000 }, + .ltc_divisor = 30, + .height = 1080, + .width = 1280, + .sar = {{1, 1}, {3, 2}}, + .work_chunks = &work_chunks_dv100ntsci[0], + .idct_factor = &dv_idct_factor_hd1080[0], + .pix_fmt = PIX_FMT_YUV422P, + .bpm = 8, + .block_sizes = block_sizes_dv100, + .audio_stride = 90, + .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */ + .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */ + .audio_shuffle = dv_audio_shuffle525, + }, + { .dsf = 1, + .video_stype = 0x14, + .frame_size = 576000, /* SMPTE-370M - 1080i50 100 Mbps */ + .difseg_size = 12, /* also known as "DVCPRO HD" */ + .n_difchan = 4, + .time_base = { 1, 25 }, + .ltc_divisor = 25, + .height = 1080, + .width = 1440, + .sar = {{1, 1}, {4, 3}}, + .work_chunks = &work_chunks_dv100pali[0], + .idct_factor = &dv_idct_factor_hd1080[0], + .pix_fmt = PIX_FMT_YUV422P, + .bpm = 8, + .block_sizes = block_sizes_dv100, + .audio_stride = 108, + .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */ + .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 }, + .audio_shuffle = dv_audio_shuffle625, + }, + { .dsf = 0, + .video_stype = 0x18, + .frame_size = 240000, /* SMPTE-370M - 720p60 100 Mbps */ + .difseg_size = 10, /* also known as "DVCPRO HD" */ + .n_difchan = 2, + .time_base = { 1001, 60000 }, + .ltc_divisor = 60, + .height = 720, + .width = 960, + .sar = {{1, 1}, {4, 3}}, + .work_chunks = &work_chunks_dv100ntscp[0], + .idct_factor = &dv_idct_factor_hd720[0], + .pix_fmt = PIX_FMT_YUV422P, + .bpm = 8, + .block_sizes = block_sizes_dv100, + .audio_stride = 90, + .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */ + .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */ + .audio_shuffle = dv_audio_shuffle525, + }, + { .dsf = 1, + .video_stype = 0x18, + .frame_size = 288000, /* SMPTE-370M - 720p50 100 Mbps */ + .difseg_size = 12, /* also known as "DVCPRO HD" */ + .n_difchan = 2, + .time_base = { 1, 50 }, + .ltc_divisor = 50, + .height = 720, + .width = 960, + .sar = {{1, 1}, {4, 3}}, + .work_chunks = &work_chunks_dv100palp[0], + .idct_factor = &dv_idct_factor_hd720[0], + .pix_fmt = PIX_FMT_YUV422P, + .bpm = 8, + .block_sizes = block_sizes_dv100, + .audio_stride = 90, + .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */ + .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 }, + .audio_shuffle = dv_audio_shuffle625, + }, + { .dsf = 1, + .video_stype = 0x1, + .frame_size = 144000, /* IEC 61883-5 - 625/50 (PAL) */ + .difseg_size = 12, + .n_difchan = 1, + .time_base = { 1, 25 }, + .ltc_divisor = 25, + .height = 576, + .width = 720, + .sar = {{16, 15}, {64, 45}}, + .work_chunks = &work_chunks_dv25pal[0], + .idct_factor = &dv_idct_factor_sd[0], + .pix_fmt = PIX_FMT_YUV420P, + .bpm = 6, + .block_sizes = block_sizes_dv2550, + .audio_stride = 108, + .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */ + .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 }, + .audio_shuffle = dv_audio_shuffle625, + } +}; + +const DVprofile* ff_dv_frame_profile(const DVprofile *sys, + const uint8_t* frame, unsigned buf_size) +{ + int i; + + int dsf = (frame[3] & 0x80) >> 7; + + int stype = frame[80*5 + 48 + 3] & 0x1f; + + /* 576i50 25Mbps 4:1:1 is a special case */ + if (dsf == 1 && stype == 0 && frame[4] & 0x07 /* the APT field */) { + return &dv_profiles[2]; + } + + for (i=0; iframe_size) + return sys; + + return NULL; +} + +const DVprofile* ff_dv_codec_profile(AVCodecContext* codec) +{ + int i; + + for (i=0; iheight == dv_profiles[i].height && + codec->pix_fmt == dv_profiles[i].pix_fmt && + codec->width == dv_profiles[i].width) + return &dv_profiles[i]; + + return NULL; +} + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dwt.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dwt.c new file mode 100644 index 00000000..d9d58de8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dwt.c @@ -0,0 +1,843 @@ +/* + * Copyright (C) 2004-2010 Michael Niedermayer + * + * 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 + */ + +#include "libavutil/attributes.h" +#include "dsputil.h" +#include "dwt.h" + +void ff_slice_buffer_init(slice_buffer * buf, int line_count, int max_allocated_lines, int line_width, IDWTELEM * base_buffer) +{ + int i; + + buf->base_buffer = base_buffer; + buf->line_count = line_count; + buf->line_width = line_width; + buf->data_count = max_allocated_lines; + buf->line = av_mallocz (sizeof(IDWTELEM *) * line_count); + buf->data_stack = av_malloc (sizeof(IDWTELEM *) * max_allocated_lines); + + for(i = 0; i < max_allocated_lines; i++){ + buf->data_stack[i] = av_malloc (sizeof(IDWTELEM) * line_width); + } + + buf->data_stack_top = max_allocated_lines - 1; +} + +IDWTELEM * ff_slice_buffer_load_line(slice_buffer * buf, int line) +{ + IDWTELEM * buffer; + + assert(buf->data_stack_top >= 0); +// assert(!buf->line[line]); + if (buf->line[line]) + return buf->line[line]; + + buffer = buf->data_stack[buf->data_stack_top]; + buf->data_stack_top--; + buf->line[line] = buffer; + + return buffer; +} + +void ff_slice_buffer_release(slice_buffer * buf, int line) +{ + IDWTELEM * buffer; + + assert(line >= 0 && line < buf->line_count); + assert(buf->line[line]); + + buffer = buf->line[line]; + buf->data_stack_top++; + buf->data_stack[buf->data_stack_top] = buffer; + buf->line[line] = NULL; +} + +void ff_slice_buffer_flush(slice_buffer * buf) +{ + int i; + for(i = 0; i < buf->line_count; i++){ + if (buf->line[i]) + ff_slice_buffer_release(buf, i); + } +} + +void ff_slice_buffer_destroy(slice_buffer * buf) +{ + int i; + ff_slice_buffer_flush(buf); + + for(i = buf->data_count - 1; i >= 0; i--){ + av_freep(&buf->data_stack[i]); + } + av_freep(&buf->data_stack); + av_freep(&buf->line); +} + +static inline int mirror(int v, int m){ + while((unsigned)v > (unsigned)m){ + v=-v; + if(v<0) v+= 2*m; + } + return v; +} + +static av_always_inline void +lift(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, + int dst_step, int src_step, int ref_step, + int width, int mul, int add, int shift, + int highpass, int inverse){ + const int mirror_left= !highpass; + const int mirror_right= (width&1) ^ highpass; + const int w= (width>>1) - 1 + (highpass & width); + int i; + +#define LIFT(src, ref, inv) ((src) + ((inv) ? - (ref) : + (ref))) + if(mirror_left){ + dst[0] = LIFT(src[0], ((mul*2*ref[0]+add)>>shift), inverse); + dst += dst_step; + src += src_step; + } + + for(i=0; i>shift), + inverse); + } + + if(mirror_right){ + dst[w*dst_step] = + LIFT(src[w*src_step], + ((mul*2*ref[w*ref_step]+add)>>shift), + inverse); + } +} + +static av_always_inline void +inv_lift(IDWTELEM *dst, IDWTELEM *src, IDWTELEM *ref, + int dst_step, int src_step, int ref_step, + int width, int mul, int add, int shift, + int highpass, int inverse){ + const int mirror_left= !highpass; + const int mirror_right= (width&1) ^ highpass; + const int w= (width>>1) - 1 + (highpass & width); + int i; + +#define LIFT(src, ref, inv) ((src) + ((inv) ? - (ref) : + (ref))) + if(mirror_left){ + dst[0] = LIFT(src[0], ((mul*2*ref[0]+add)>>shift), inverse); + dst += dst_step; + src += src_step; + } + + for(i=0; i>shift), + inverse); + } + + if(mirror_right){ + dst[w*dst_step] = + LIFT(src[w*src_step], + ((mul*2*ref[w*ref_step]+add)>>shift), + inverse); + } +} + +#ifndef liftS +static av_always_inline void +liftS(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, + int dst_step, int src_step, int ref_step, + int width, int mul, int add, int shift, + int highpass, int inverse){ + const int mirror_left= !highpass; + const int mirror_right= (width&1) ^ highpass; + const int w= (width>>1) - 1 + (highpass & width); + int i; + + assert(shift == 4); +#define LIFTS(src, ref, inv) \ + ((inv) ? \ + (src) + (((ref) + 4*(src))>>shift): \ + -((-16*(src) + (ref) + add/4 + 1 + (5<<25))/(5*4) - (1<<23))) + if(mirror_left){ + dst[0] = LIFTS(src[0], mul*2*ref[0]+add, inverse); + dst += dst_step; + src += src_step; + } + + for(i=0; i>1) - 1 + (highpass & width); + int i; + + assert(shift == 4); +#define LIFTS(src, ref, inv) \ + ((inv) ? \ + (src) + (((ref) + 4*(src))>>shift): \ + -((-16*(src) + (ref) + add/4 + 1 + (5<<25))/(5*4) - (1<<23))) + if(mirror_left){ + dst[0] = LIFTS(src[0], mul*2*ref[0]+add, inverse); + dst += dst_step; + src += src_step; + } + + for(i=0; i>1; + int x; + const int w2= (width+1)>>1; + + for(x=0; x>1; + A4 += (A1 + 1)>>1; + b[0+width2] = A1; + b[0 ] = A4; + for(x=1; x+1>1; + A2 += (A1 + A3 + 2)>>2; + b[x+width2] = A3; + b[x ] = A2; + + A1= temp[x+1+width2]; + A2= temp[x+2 ]; + A1 -= (A2 + A4)>>1; + A4 += (A1 + A3 + 2)>>2; + b[x+1+width2] = A1; + b[x+1 ] = A4; + } + A3= temp[width-1]; + A3 -= A2; + A2 += (A1 + A3 + 2)>>2; + b[width -1] = A3; + b[width2-1] = A2; + } +#else + lift(b+w2, temp+w2, temp, 1, 1, 1, width, -1, 0, 1, 1, 0); + lift(b , temp , b+w2, 1, 1, 1, width, 1, 2, 2, 0, 0); +#endif /* 0 */ +} + +static void vertical_decompose53iH0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){ + int i; + + for(i=0; i>1; + } +} + +static void vertical_decompose53iL0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){ + int i; + + for(i=0; i>2; + } +} + +static void spatial_decompose53i(DWTELEM *buffer, int width, int height, int stride){ + int y; + DWTELEM *b0= buffer + mirror(-2-1, height-1)*stride; + DWTELEM *b1= buffer + mirror(-2 , height-1)*stride; + + for(y=-2; y>1; + + lift (temp+w2, b +1, b , 1, 2, 2, width, W_AM, W_AO, W_AS, 1, 1); + liftS(temp , b , temp+w2, 1, 2, 1, width, W_BM, W_BO, W_BS, 0, 0); + lift (b +w2, temp+w2, temp , 1, 1, 1, width, W_CM, W_CO, W_CS, 1, 0); + lift (b , temp , b +w2, 1, 1, 1, width, W_DM, W_DO, W_DS, 0, 0); +} + + +static void vertical_decompose97iH0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){ + int i; + + for(i=0; i>W_AS; + } +} + +static void vertical_decompose97iH1(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){ + int i; + + for(i=0; i>W_CS; + } +} + +static void vertical_decompose97iL0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){ + int i; + + for(i=0; i>W_BS; +#else + b1[i] = (16*4*b1[i] - 4*(b0[i] + b2[i]) + W_BO*5 + (5<<27)) / (5*16) - (1<<23); +#endif + } +} + +static void vertical_decompose97iL1(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){ + int i; + + for(i=0; i>W_DS; + } +} + +static void spatial_decompose97i(DWTELEM *buffer, int width, int height, int stride){ + int y; + DWTELEM *b0= buffer + mirror(-4-1, height-1)*stride; + DWTELEM *b1= buffer + mirror(-4 , height-1)*stride; + DWTELEM *b2= buffer + mirror(-4+1, height-1)*stride; + DWTELEM *b3= buffer + mirror(-4+2, height-1)*stride; + + for(y=-4; y>level, height>>level, stride<>level, height>>level, stride<>1; + const int w2= (width+1)>>1; + int x; + + for(x=0; x>1); + for(x=2; x>2); + b[x-1] = temp[x-1] + ((b [x-2] + b [x ]+1)>>1); + } + if(width&1){ + b[x ] = temp[x ] - ((temp[x-1]+1)>>1); + b[x-1] = temp[x-1] + ((b [x-2] + b [x ]+1)>>1); + }else + b[x-1] = temp[x-1] + b[x-2]; +} + +static void vertical_compose53iH0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width){ + int i; + + for(i=0; i>1; + } +} + +static void vertical_compose53iL0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width){ + int i; + + for(i=0; i>2; + } +} + +static void spatial_compose53i_buffered_init(DWTCompose *cs, slice_buffer * sb, int height, int stride_line){ + cs->b0 = slice_buffer_get_line(sb, mirror(-1-1, height-1) * stride_line); + cs->b1 = slice_buffer_get_line(sb, mirror(-1 , height-1) * stride_line); + cs->y = -1; +} + +static void spatial_compose53i_init(DWTCompose *cs, IDWTELEM *buffer, int height, int stride){ + cs->b0 = buffer + mirror(-1-1, height-1)*stride; + cs->b1 = buffer + mirror(-1 , height-1)*stride; + cs->y = -1; +} + +static void spatial_compose53i_dy_buffered(DWTCompose *cs, slice_buffer * sb, int width, int height, int stride_line){ + int y= cs->y; + + IDWTELEM *b0= cs->b0; + IDWTELEM *b1= cs->b1; + IDWTELEM *b2= slice_buffer_get_line(sb, mirror(y+1, height-1) * stride_line); + IDWTELEM *b3= slice_buffer_get_line(sb, mirror(y+2, height-1) * stride_line); + + if(y+1<(unsigned)height && y<(unsigned)height){ + int x; + + for(x=0; x>2; + b1[x] += (b0[x] + b2[x])>>1; + } + }else{ + if(y+1<(unsigned)height) vertical_compose53iL0(b1, b2, b3, width); + if(y+0<(unsigned)height) vertical_compose53iH0(b0, b1, b2, width); + } + + if(y-1<(unsigned)height) horizontal_compose53i(b0, width); + if(y+0<(unsigned)height) horizontal_compose53i(b1, width); + + cs->b0 = b2; + cs->b1 = b3; + cs->y += 2; +} + +static void spatial_compose53i_dy(DWTCompose *cs, IDWTELEM *buffer, int width, int height, int stride){ + int y= cs->y; + IDWTELEM *b0= cs->b0; + IDWTELEM *b1= cs->b1; + IDWTELEM *b2= buffer + mirror(y+1, height-1)*stride; + IDWTELEM *b3= buffer + mirror(y+2, height-1)*stride; + + if(y+1<(unsigned)height) vertical_compose53iL0(b1, b2, b3, width); + if(y+0<(unsigned)height) vertical_compose53iH0(b0, b1, b2, width); + + if(y-1<(unsigned)height) horizontal_compose53i(b0, width); + if(y+0<(unsigned)height) horizontal_compose53i(b1, width); + + cs->b0 = b2; + cs->b1 = b3; + cs->y += 2; +} + +static void av_unused spatial_compose53i(IDWTELEM *buffer, int width, int height, int stride){ + DWTCompose cs; + spatial_compose53i_init(&cs, buffer, height, stride); + while(cs.y <= height) + spatial_compose53i_dy(&cs, buffer, width, height, stride); +} + + +void ff_snow_horizontal_compose97i(IDWTELEM *b, int width){ + IDWTELEM temp[width]; + const int w2= (width+1)>>1; + +#if 0 //maybe more understadable but slower + inv_lift (temp , b , b +w2, 2, 1, 1, width, W_DM, W_DO, W_DS, 0, 1); + inv_lift (temp+1 , b +w2, temp , 2, 1, 2, width, W_CM, W_CO, W_CS, 1, 1); + + inv_liftS(b , temp , temp+1 , 2, 2, 2, width, W_BM, W_BO, W_BS, 0, 1); + inv_lift (b+1 , temp+1 , b , 2, 2, 2, width, W_AM, W_AO, W_AS, 1, 0); +#else + int x; + temp[0] = b[0] - ((3*b[w2]+2)>>2); + for(x=1; x<(width>>1); x++){ + temp[2*x ] = b[x ] - ((3*(b [x+w2-1] + b[x+w2])+4)>>3); + temp[2*x-1] = b[x+w2-1] - temp[2*x-2] - temp[2*x]; + } + if(width&1){ + temp[2*x ] = b[x ] - ((3*b [x+w2-1]+2)>>2); + temp[2*x-1] = b[x+w2-1] - temp[2*x-2] - temp[2*x]; + }else + temp[2*x-1] = b[x+w2-1] - 2*temp[2*x-2]; + + b[0] = temp[0] + ((2*temp[0] + temp[1]+4)>>3); + for(x=2; x>4); + b[x-1] = temp[x-1] + ((3*(b [x-2] + b [x ] ))>>1); + } + if(width&1){ + b[x ] = temp[x ] + ((2*temp[x ] + temp[x-1]+4)>>3); + b[x-1] = temp[x-1] + ((3*(b [x-2] + b [x ] ))>>1); + }else + b[x-1] = temp[x-1] + 3*b [x-2]; +#endif +} + +static void vertical_compose97iH0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width){ + int i; + + for(i=0; i>W_AS; + } +} + +static void vertical_compose97iH1(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width){ + int i; + + for(i=0; i>W_CS; + } +} + +static void vertical_compose97iL0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width){ + int i; + + for(i=0; i>W_BS; +#else + b1[i] += (W_BM*(b0[i] + b2[i])+4*b1[i]+W_BO)>>W_BS; +#endif + } +} + +static void vertical_compose97iL1(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width){ + int i; + + for(i=0; i>W_DS; + } +} + +void ff_snow_vertical_compose97i(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, IDWTELEM *b5, int width){ + int i; + + for(i=0; i>W_DS; + b3[i] -= (W_CM*(b2[i] + b4[i])+W_CO)>>W_CS; +#ifdef liftS + b2[i] += (W_BM*(b1[i] + b3[i])+W_BO)>>W_BS; +#else + b2[i] += (W_BM*(b1[i] + b3[i])+4*b2[i]+W_BO)>>W_BS; +#endif + b1[i] += (W_AM*(b0[i] + b2[i])+W_AO)>>W_AS; + } +} + +static void spatial_compose97i_buffered_init(DWTCompose *cs, slice_buffer * sb, int height, int stride_line){ + cs->b0 = slice_buffer_get_line(sb, mirror(-3-1, height-1) * stride_line); + cs->b1 = slice_buffer_get_line(sb, mirror(-3 , height-1) * stride_line); + cs->b2 = slice_buffer_get_line(sb, mirror(-3+1, height-1) * stride_line); + cs->b3 = slice_buffer_get_line(sb, mirror(-3+2, height-1) * stride_line); + cs->y = -3; +} + +static void spatial_compose97i_init(DWTCompose *cs, IDWTELEM *buffer, int height, int stride){ + cs->b0 = buffer + mirror(-3-1, height-1)*stride; + cs->b1 = buffer + mirror(-3 , height-1)*stride; + cs->b2 = buffer + mirror(-3+1, height-1)*stride; + cs->b3 = buffer + mirror(-3+2, height-1)*stride; + cs->y = -3; +} + +static void spatial_compose97i_dy_buffered(DWTContext *dsp, DWTCompose *cs, slice_buffer * sb, int width, int height, int stride_line){ + int y = cs->y; + + IDWTELEM *b0= cs->b0; + IDWTELEM *b1= cs->b1; + IDWTELEM *b2= cs->b2; + IDWTELEM *b3= cs->b3; + IDWTELEM *b4= slice_buffer_get_line(sb, mirror(y + 3, height - 1) * stride_line); + IDWTELEM *b5= slice_buffer_get_line(sb, mirror(y + 4, height - 1) * stride_line); + + if(y>0 && y+4vertical_compose97i(b0, b1, b2, b3, b4, b5, width); + }else{ + if(y+3<(unsigned)height) vertical_compose97iL1(b3, b4, b5, width); + if(y+2<(unsigned)height) vertical_compose97iH1(b2, b3, b4, width); + if(y+1<(unsigned)height) vertical_compose97iL0(b1, b2, b3, width); + if(y+0<(unsigned)height) vertical_compose97iH0(b0, b1, b2, width); + } + + if(y-1<(unsigned)height) dsp->horizontal_compose97i(b0, width); + if(y+0<(unsigned)height) dsp->horizontal_compose97i(b1, width); + + cs->b0=b2; + cs->b1=b3; + cs->b2=b4; + cs->b3=b5; + cs->y += 2; +} + +static void spatial_compose97i_dy(DWTCompose *cs, IDWTELEM *buffer, int width, int height, int stride){ + int y = cs->y; + IDWTELEM *b0= cs->b0; + IDWTELEM *b1= cs->b1; + IDWTELEM *b2= cs->b2; + IDWTELEM *b3= cs->b3; + IDWTELEM *b4= buffer + mirror(y+3, height-1)*stride; + IDWTELEM *b5= buffer + mirror(y+4, height-1)*stride; + + if(y+3<(unsigned)height) vertical_compose97iL1(b3, b4, b5, width); + if(y+2<(unsigned)height) vertical_compose97iH1(b2, b3, b4, width); + if(y+1<(unsigned)height) vertical_compose97iL0(b1, b2, b3, width); + if(y+0<(unsigned)height) vertical_compose97iH0(b0, b1, b2, width); + + if(y-1<(unsigned)height) ff_snow_horizontal_compose97i(b0, width); + if(y+0<(unsigned)height) ff_snow_horizontal_compose97i(b1, width); + + cs->b0=b2; + cs->b1=b3; + cs->b2=b4; + cs->b3=b5; + cs->y += 2; +} + +static void av_unused spatial_compose97i(IDWTELEM *buffer, int width, int height, int stride){ + DWTCompose cs; + spatial_compose97i_init(&cs, buffer, height, stride); + while(cs.y <= height) + spatial_compose97i_dy(&cs, buffer, width, height, stride); +} + +void ff_spatial_idwt_buffered_init(DWTCompose *cs, slice_buffer * sb, int width, int height, int stride_line, int type, int decomposition_count){ + int level; + for(level=decomposition_count-1; level>=0; level--){ + switch(type){ + case DWT_97: spatial_compose97i_buffered_init(cs+level, sb, height>>level, stride_line<>level, stride_line<=0; level--){ + while(cs[level].y <= FFMIN((y>>level)+support, height>>level)){ + switch(type){ + case DWT_97: spatial_compose97i_dy_buffered(dsp, cs+level, slice_buf, width>>level, height>>level, stride_line<>level, height>>level, stride_line<=0; level--){ + switch(type){ + case DWT_97: spatial_compose97i_init(cs+level, buffer, height>>level, stride<>level, stride<=0; level--){ + while(cs[level].y <= FFMIN((y>>level)+support, height>>level)){ + switch(type){ + case DWT_97: spatial_compose97i_dy(cs+level, buffer, width>>level, height>>level, stride<>level, height>>level, stride<>(dec_count-level); + int sx= (ori&1) ? size : 0; + int stride= 32<<(dec_count-level); + int sy= (ori&2) ? stride>>1 : 0; + + for(i=0; i=0); + return s>>9; +} + +static int w53_8_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ + return w_c(v, pix1, pix2, line_size, 8, h, 1); +} + +static int w97_8_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ + return w_c(v, pix1, pix2, line_size, 8, h, 0); +} + +static int w53_16_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ + return w_c(v, pix1, pix2, line_size, 16, h, 1); +} + +static int w97_16_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ + return w_c(v, pix1, pix2, line_size, 16, h, 0); +} + +int ff_w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ + return w_c(v, pix1, pix2, line_size, 32, h, 1); +} + +int ff_w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){ + return w_c(v, pix1, pix2, line_size, 32, h, 0); +} + +void ff_dsputil_init_dwt(DSPContext *c) +{ + c->w53[0]= w53_16_c; + c->w53[1]= w53_8_c; + c->w97[0]= w97_16_c; + c->w97[1]= w97_8_c; +} + +void ff_dwt_init(DWTContext *c) +{ + c->vertical_compose97i = ff_snow_vertical_compose97i; + c->horizontal_compose97i = ff_snow_horizontal_compose97i; + c->inner_add_yblock = ff_snow_inner_add_yblock; + + if (HAVE_MMX) ff_dwt_init_x86(c); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dwt.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dwt.h new file mode 100644 index 00000000..b10e4f55 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dwt.h @@ -0,0 +1,154 @@ +/* + * Copyright (C) 2004-2010 Michael Niedermayer + * + * 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 + */ + +#ifndef AVCODEC_DWT_H +#define AVCODEC_DWT_H + +#include + +typedef int DWTELEM; +typedef short IDWTELEM; + +typedef struct { + IDWTELEM *b0; + IDWTELEM *b1; + IDWTELEM *b2; + IDWTELEM *b3; + int y; +} DWTCompose; + +/** Used to minimize the amount of memory used in order to optimize cache performance. **/ +typedef struct slice_buffer_s { + IDWTELEM * * line; ///< For use by idwt and predict_slices. + IDWTELEM * * data_stack; ///< Used for internal purposes. + int data_stack_top; + int line_count; + int line_width; + int data_count; + IDWTELEM * base_buffer; ///< Buffer that this structure is caching. +} slice_buffer; + +typedef struct DWTContext { + void (*vertical_compose97i)(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, IDWTELEM *b5, int width); + void (*horizontal_compose97i)(IDWTELEM *b, int width); + void (*inner_add_yblock)(const uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8); +} DWTContext; + +#define MAX_DECOMPOSITIONS 8 + +#define DWT_97 0 +#define DWT_53 1 + +#define liftS lift +#if 1 +#define W_AM 3 +#define W_AO 0 +#define W_AS 1 + +#undef liftS +#define W_BM 1 +#define W_BO 8 +#define W_BS 4 + +#define W_CM 1 +#define W_CO 0 +#define W_CS 0 + +#define W_DM 3 +#define W_DO 4 +#define W_DS 3 +#elif 0 +#define W_AM 55 +#define W_AO 16 +#define W_AS 5 + +#define W_BM 3 +#define W_BO 32 +#define W_BS 6 + +#define W_CM 127 +#define W_CO 64 +#define W_CS 7 + +#define W_DM 7 +#define W_DO 8 +#define W_DS 4 +#elif 0 +#define W_AM 97 +#define W_AO 32 +#define W_AS 6 + +#define W_BM 63 +#define W_BO 512 +#define W_BS 10 + +#define W_CM 13 +#define W_CO 8 +#define W_CS 4 + +#define W_DM 15 +#define W_DO 16 +#define W_DS 5 + +#else + +#define W_AM 203 +#define W_AO 64 +#define W_AS 7 + +#define W_BM 217 +#define W_BO 2048 +#define W_BS 12 + +#define W_CM 113 +#define W_CO 64 +#define W_CS 7 + +#define W_DM 227 +#define W_DO 128 +#define W_DS 9 +#endif + +#define slice_buffer_get_line(slice_buf, line_num) ((slice_buf)->line[line_num] ? (slice_buf)->line[line_num] : ff_slice_buffer_load_line((slice_buf), (line_num))) +//#define slice_buffer_get_line(slice_buf, line_num) (ff_slice_buffer_load_line((slice_buf), (line_num))) + +void ff_slice_buffer_init(slice_buffer * buf, int line_count, int max_allocated_lines, int line_width, IDWTELEM * base_buffer); +void ff_slice_buffer_release(slice_buffer * buf, int line); +void ff_slice_buffer_flush(slice_buffer * buf); +void ff_slice_buffer_destroy(slice_buffer * buf); +IDWTELEM * ff_slice_buffer_load_line(slice_buffer * buf, int line); + +void ff_snow_vertical_compose97i(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, IDWTELEM *b5, int width); +void ff_snow_horizontal_compose97i(IDWTELEM *b, int width); +void ff_snow_inner_add_yblock(const uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8); + +int ff_w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h); +int ff_w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h); + +void ff_spatial_dwt(int *buffer, int width, int height, int stride, int type, int decomposition_count); + +void ff_spatial_idwt_buffered_init(DWTCompose *cs, slice_buffer * sb, int width, int height, int stride_line, int type, int decomposition_count); +void ff_spatial_idwt_buffered_slice(DWTContext *dsp, DWTCompose *cs, slice_buffer * slice_buf, int width, int height, int stride_line, int type, int decomposition_count, int y); +void ff_spatial_idwt(IDWTELEM *buffer, int width, int height, int stride, int type, int decomposition_count); + +void ff_dwt_init(DWTContext *c); +void ff_dwt_init_x86(DWTContext *c); + +#endif /* AVCODEC_DWT_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2.c new file mode 100644 index 00000000..3f14311c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2.c @@ -0,0 +1,154 @@ +/* + * DXVA2 HW acceleration. + * + * copyright (c) 2010 Laurent Aimar + * + * 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 + */ + +#include "dxva2_internal.h" + +void *ff_dxva2_get_surface(const Picture *picture) +{ + return picture->data[3]; +} + +unsigned ff_dxva2_get_surface_index(const struct dxva_context *ctx, + const Picture *picture) +{ + void *surface = ff_dxva2_get_surface(picture); + unsigned i; + + for (i = 0; i < ctx->surface_count; i++) + if (ctx->surface[i] == surface) + return i; + + assert(0); + return 0; +} + +int ff_dxva2_commit_buffer(AVCodecContext *avctx, + struct dxva_context *ctx, + DXVA2_DecodeBufferDesc *dsc, + unsigned type, const void *data, unsigned size, + unsigned mb_count) +{ + void *dxva_data; + unsigned dxva_size; + int result; + + if (FAILED(IDirectXVideoDecoder_GetBuffer(ctx->decoder, type, + &dxva_data, &dxva_size))) { + av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %d\n", type); + return -1; + } + if (size <= dxva_size) { + memcpy(dxva_data, data, size); + + memset(dsc, 0, sizeof(*dsc)); + dsc->CompressedBufferType = type; + dsc->DataSize = size; + dsc->NumMBsInBuffer = mb_count; + + result = 0; + } else { + av_log(avctx, AV_LOG_ERROR, "Buffer for type %d was too small\n", type); + result = -1; + } + if (FAILED(IDirectXVideoDecoder_ReleaseBuffer(ctx->decoder, type))) { + av_log(avctx, AV_LOG_ERROR, "Failed to release buffer type %d\n", type); + result = -1; + } + return result; +} + +int ff_dxva2_common_end_frame(AVCodecContext *avctx, MpegEncContext *s, + const void *pp, unsigned pp_size, + const void *qm, unsigned qm_size, + int (*commit_bs_si)(AVCodecContext *, + DXVA2_DecodeBufferDesc *bs, + DXVA2_DecodeBufferDesc *slice)) +{ + struct dxva_context *ctx = avctx->hwaccel_context; + unsigned buffer_count = 0; + DXVA2_DecodeBufferDesc buffer[4]; + DXVA2_DecodeExecuteParams exec; + int result; + + if (FAILED(IDirectXVideoDecoder_BeginFrame(ctx->decoder, + ff_dxva2_get_surface(s->current_picture_ptr), + NULL))) { + av_log(avctx, AV_LOG_ERROR, "Failed to begin frame\n"); + return -1; + } + + result = ff_dxva2_commit_buffer(avctx, ctx, &buffer[buffer_count], + DXVA2_PictureParametersBufferType, + pp, pp_size, 0); + if (result) { + av_log(avctx, AV_LOG_ERROR, + "Failed to add picture parameter buffer\n"); + goto end; + } + buffer_count++; + + if (qm_size > 0) { + result = ff_dxva2_commit_buffer(avctx, ctx, &buffer[buffer_count], + DXVA2_InverseQuantizationMatrixBufferType, + qm, qm_size, 0); + if (result) { + av_log(avctx, AV_LOG_ERROR, + "Failed to add inverse quantization matrix buffer\n"); + goto end; + } + buffer_count++; + } + + result = commit_bs_si(avctx, + &buffer[buffer_count + 0], + &buffer[buffer_count + 1]); + if (result) { + av_log(avctx, AV_LOG_ERROR, + "Failed to add bitstream or slice control buffer\n"); + goto end; + } + buffer_count += 2; + + /* TODO Film Grain when possible */ + + assert(buffer_count == 1 + (qm_size > 0) + 2); + + memset(&exec, 0, sizeof(exec)); + exec.NumCompBuffers = buffer_count; + exec.pCompressedBuffers = buffer; + exec.pExtensionData = NULL; + if (FAILED(IDirectXVideoDecoder_Execute(ctx->decoder, &exec))) { + av_log(avctx, AV_LOG_ERROR, "Failed to execute\n"); + result = -1; + } + +end: + if (FAILED(IDirectXVideoDecoder_EndFrame(ctx->decoder, NULL))) { + av_log(avctx, AV_LOG_ERROR, "Failed to end frame\n"); + result = -1; + } + + if (!result) + ff_draw_horiz_band(s, 0, s->avctx->height); + return result; +} + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2.h new file mode 100644 index 00000000..5c5fe21e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2.h @@ -0,0 +1,68 @@ +/* + * DXVA2 HW acceleration + * + * copyright (c) 2009 Laurent Aimar + * + * 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 + */ + +#ifndef AVCODEC_DXVA_H +#define AVCODEC_DXVA_H + +#include + +#include + +/** + * This structure is used to provides the necessary configurations and data + * to the DXVA2 FFmpeg HWAccel implementation. + * + * The application must make it available as AVCodecContext.hwaccel_context. + */ +struct dxva_context { + /** + * DXVA2 decoder object + */ + IDirectXVideoDecoder *decoder; + + /** + * DXVA2 configuration used to create the decoder + */ + const DXVA2_ConfigPictureDecode *cfg; + + /** + * The number of surface in the surface array + */ + unsigned surface_count; + + /** + * The array of Direct3D surfaces used to create the decoder + */ + LPDIRECT3DSURFACE9 *surface; + + /** + * A bit field configuring the workarounds needed for using the decoder + */ + uint64_t workaround; + + /** + * Private to the FFmpeg AVHWAccel implementation + */ + unsigned report_id; +}; + +#endif /* AVCODEC_DXVA_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2_h264.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2_h264.c new file mode 100644 index 00000000..17fb2b55 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2_h264.c @@ -0,0 +1,437 @@ +/* + * DXVA2 H264 HW acceleration. + * + * copyright (c) 2009 Laurent Aimar + * + * 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 + */ + +#include "dxva2_internal.h" +#include "h264.h" +#include "h264data.h" + +struct dxva2_picture_context { + DXVA_PicParams_H264 pp; + DXVA_Qmatrix_H264 qm; + unsigned slice_count; + DXVA_Slice_H264_Short slice_short[MAX_SLICES]; + DXVA_Slice_H264_Long slice_long[MAX_SLICES]; + const uint8_t *bitstream; + unsigned bitstream_size; +}; + +static void fill_picture_entry(DXVA_PicEntry_H264 *pic, + unsigned index, unsigned flag) +{ + assert((index&0x7f) == index && (flag&0x01) == flag); + pic->bPicEntry = index | (flag << 7); +} + +static void fill_picture_parameters(struct dxva_context *ctx, const H264Context *h, + DXVA_PicParams_H264 *pp) +{ + const MpegEncContext *s = &h->s; + const Picture *current_picture = s->current_picture_ptr; + int i, j; + + memset(pp, 0, sizeof(*pp)); + /* Configure current picture */ + fill_picture_entry(&pp->CurrPic, + ff_dxva2_get_surface_index(ctx, current_picture), + s->picture_structure == PICT_BOTTOM_FIELD); + /* Configure the set of references */ + pp->UsedForReferenceFlags = 0; + pp->NonExistingFrameFlags = 0; + for (i = 0, j = 0; i < FF_ARRAY_ELEMS(pp->RefFrameList); i++) { + const Picture *r; + if (j < h->short_ref_count) { + r = h->short_ref[j++]; + } else { + r = NULL; + while (!r && j < h->short_ref_count + 16) + r = h->long_ref[j++ - h->short_ref_count]; + } + if (r) { + fill_picture_entry(&pp->RefFrameList[i], + ff_dxva2_get_surface_index(ctx, r), + r->long_ref != 0); + + if ((r->reference & PICT_TOP_FIELD) && r->field_poc[0] != INT_MAX) + pp->FieldOrderCntList[i][0] = r->field_poc[0]; + if ((r->reference & PICT_BOTTOM_FIELD) && r->field_poc[1] != INT_MAX) + pp->FieldOrderCntList[i][1] = r->field_poc[1]; + + pp->FrameNumList[i] = r->long_ref ? r->pic_id : r->frame_num; + if (r->reference & PICT_TOP_FIELD) + pp->UsedForReferenceFlags |= 1 << (2*i + 0); + if (r->reference & PICT_BOTTOM_FIELD) + pp->UsedForReferenceFlags |= 1 << (2*i + 1); + } else { + pp->RefFrameList[i].bPicEntry = 0xff; + pp->FieldOrderCntList[i][0] = 0; + pp->FieldOrderCntList[i][1] = 0; + pp->FrameNumList[i] = 0; + } + } + + pp->wFrameWidthInMbsMinus1 = s->mb_width - 1; + pp->wFrameHeightInMbsMinus1 = s->mb_height - 1; + pp->num_ref_frames = h->sps.ref_frame_count; + + pp->wBitFields = ((s->picture_structure != PICT_FRAME) << 0) | + (h->sps.mb_aff << 1) | + (h->sps.residual_color_transform_flag << 2) | + /* sp_for_switch_flag (not implemented by FFmpeg) */ + (0 << 3) | + (h->sps.chroma_format_idc << 4) | + ((h->nal_ref_idc != 0) << 6) | + (h->pps.constrained_intra_pred << 7) | + (h->pps.weighted_pred << 8) | + (h->pps.weighted_bipred_idc << 9) | + /* MbsConsecutiveFlag */ + (1 << 11) | + (h->sps.frame_mbs_only_flag << 12) | + (h->pps.transform_8x8_mode << 13) | + ((h->sps.level_idc >= 31) << 14) | + /* IntraPicFlag (Modified if we detect a non + * intra slice in decode_slice) */ + (1 << 15); + + pp->bit_depth_luma_minus8 = h->sps.bit_depth_luma - 8; + pp->bit_depth_chroma_minus8 = h->sps.bit_depth_chroma - 8; + pp->Reserved16Bits = 3; /* FIXME is there a way to detect the right mode ? */ + pp->StatusReportFeedbackNumber = 1 + ctx->report_id++; + pp->CurrFieldOrderCnt[0] = 0; + if ((s->picture_structure & PICT_TOP_FIELD) && + current_picture->field_poc[0] != INT_MAX) + pp->CurrFieldOrderCnt[0] = current_picture->field_poc[0]; + pp->CurrFieldOrderCnt[1] = 0; + if ((s->picture_structure & PICT_BOTTOM_FIELD) && + current_picture->field_poc[1] != INT_MAX) + pp->CurrFieldOrderCnt[1] = current_picture->field_poc[1]; + pp->pic_init_qs_minus26 = h->pps.init_qs - 26; + pp->chroma_qp_index_offset = h->pps.chroma_qp_index_offset[0]; + pp->second_chroma_qp_index_offset = h->pps.chroma_qp_index_offset[1]; + pp->ContinuationFlag = 1; + pp->pic_init_qp_minus26 = h->pps.init_qp - 26; + pp->num_ref_idx_l0_active_minus1 = h->pps.ref_count[0] - 1; + pp->num_ref_idx_l1_active_minus1 = h->pps.ref_count[1] - 1; + pp->Reserved8BitsA = 0; + pp->frame_num = h->frame_num; + pp->log2_max_frame_num_minus4 = h->sps.log2_max_frame_num - 4; + pp->pic_order_cnt_type = h->sps.poc_type; + if (h->sps.poc_type == 0) + pp->log2_max_pic_order_cnt_lsb_minus4 = h->sps.log2_max_poc_lsb - 4; + else if (h->sps.poc_type == 1) + pp->delta_pic_order_always_zero_flag = h->sps.delta_pic_order_always_zero_flag; + pp->direct_8x8_inference_flag = h->sps.direct_8x8_inference_flag; + pp->entropy_coding_mode_flag = h->pps.cabac; + pp->pic_order_present_flag = h->pps.pic_order_present; + pp->num_slice_groups_minus1 = h->pps.slice_group_count - 1; + pp->slice_group_map_type = h->pps.mb_slice_group_map_type; + pp->deblocking_filter_control_present_flag = h->pps.deblocking_filter_parameters_present; + pp->redundant_pic_cnt_present_flag= h->pps.redundant_pic_cnt_present; + pp->Reserved8BitsB = 0; + pp->slice_group_change_rate_minus1= 0; /* XXX not implemented by FFmpeg */ + //pp->SliceGroupMap[810]; /* XXX not implemented by FFmpeg */ +} + +static void fill_scaling_lists(const H264Context *h, DXVA_Qmatrix_H264 *qm) +{ + unsigned i, j; + memset(qm, 0, sizeof(*qm)); + for (i = 0; i < 6; i++) + for (j = 0; j < 16; j++) + qm->bScalingLists4x4[i][j] = h->pps.scaling_matrix4[i][zigzag_scan[j]]; + + for (i = 0; i < 2; i++) + for (j = 0; j < 64; j++) + qm->bScalingLists8x8[i][j] = h->pps.scaling_matrix8[i][ff_zigzag_direct[j]]; +} + +static int is_slice_short(struct dxva_context *ctx) +{ + assert(ctx->cfg->ConfigBitstreamRaw == 1 || + ctx->cfg->ConfigBitstreamRaw == 2); + return ctx->cfg->ConfigBitstreamRaw == 2; +} + +static void fill_slice_short(DXVA_Slice_H264_Short *slice, + unsigned position, unsigned size) +{ + memset(slice, 0, sizeof(*slice)); + slice->BSNALunitDataLocation = position; + slice->SliceBytesInBuffer = size; + slice->wBadSliceChopping = 0; +} + +static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice, + unsigned position, unsigned size) +{ + const H264Context *h = avctx->priv_data; + struct dxva_context *ctx = avctx->hwaccel_context; + const MpegEncContext *s = &h->s; + unsigned list; + + memset(slice, 0, sizeof(*slice)); + slice->BSNALunitDataLocation = position; + slice->SliceBytesInBuffer = size; + slice->wBadSliceChopping = 0; + + slice->first_mb_in_slice = (s->mb_y >> FIELD_OR_MBAFF_PICTURE) * s->mb_width + s->mb_x; + slice->NumMbsForSlice = 0; /* XXX it is set once we have all slices */ + slice->BitOffsetToSliceData = get_bits_count(&s->gb); + slice->slice_type = ff_h264_get_slice_type(h); + if (h->slice_type_fixed) + slice->slice_type += 5; + slice->luma_log2_weight_denom = h->luma_log2_weight_denom; + slice->chroma_log2_weight_denom = h->chroma_log2_weight_denom; + if (h->list_count > 0) + slice->num_ref_idx_l0_active_minus1 = h->ref_count[0] - 1; + if (h->list_count > 1) + slice->num_ref_idx_l1_active_minus1 = h->ref_count[1] - 1; + slice->slice_alpha_c0_offset_div2 = h->slice_alpha_c0_offset / 2 - 26; + slice->slice_beta_offset_div2 = h->slice_beta_offset / 2 - 26; + slice->Reserved8Bits = 0; + + for (list = 0; list < 2; list++) { + unsigned i; + for (i = 0; i < FF_ARRAY_ELEMS(slice->RefPicList[list]); i++) { + if (list < h->list_count && i < h->ref_count[list]) { + const Picture *r = &h->ref_list[list][i]; + unsigned plane; + fill_picture_entry(&slice->RefPicList[list][i], + ff_dxva2_get_surface_index(ctx, r), + r->reference == PICT_BOTTOM_FIELD); + for (plane = 0; plane < 3; plane++) { + int w, o; + if (plane == 0 && h->luma_weight_flag[list]) { + w = h->luma_weight[i][list][0]; + o = h->luma_weight[i][list][1]; + } else if (plane >= 1 && h->chroma_weight_flag[list]) { + w = h->chroma_weight[i][list][plane-1][0]; + o = h->chroma_weight[i][list][plane-1][1]; + } else { + w = 1 << (plane == 0 ? h->luma_log2_weight_denom : + h->chroma_log2_weight_denom); + o = 0; + } + slice->Weights[list][i][plane][0] = w; + slice->Weights[list][i][plane][1] = o; + } + } else { + unsigned plane; + slice->RefPicList[list][i].bPicEntry = 0xff; + for (plane = 0; plane < 3; plane++) { + slice->Weights[list][i][plane][0] = 0; + slice->Weights[list][i][plane][1] = 0; + } + } + } + } + slice->slice_qs_delta = 0; /* XXX not implemented by FFmpeg */ + slice->slice_qp_delta = s->qscale - h->pps.init_qp; + slice->redundant_pic_cnt = h->redundant_pic_count; + if (h->slice_type == FF_B_TYPE) + slice->direct_spatial_mv_pred_flag = h->direct_spatial_mv_pred; + slice->cabac_init_idc = h->pps.cabac ? h->cabac_init_idc : 0; + if (h->deblocking_filter < 2) + slice->disable_deblocking_filter_idc = 1 - h->deblocking_filter; + else + slice->disable_deblocking_filter_idc = h->deblocking_filter; + slice->slice_id = h->current_slice - 1; +} + +static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, + DXVA2_DecodeBufferDesc *bs, + DXVA2_DecodeBufferDesc *sc) +{ + const H264Context *h = avctx->priv_data; + const MpegEncContext *s = &h->s; + const unsigned mb_count = s->mb_width * s->mb_height; + struct dxva_context *ctx = avctx->hwaccel_context; + const Picture *current_picture = h->s.current_picture_ptr; + struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private; + DXVA_Slice_H264_Short *slice = NULL; + uint8_t *dxva_data, *current, *end; + unsigned dxva_size; + void *slice_data; + unsigned slice_size; + unsigned padding; + unsigned i; + + /* Create an annex B bitstream buffer with only slice NAL and finalize slice */ + if (FAILED(IDirectXVideoDecoder_GetBuffer(ctx->decoder, + DXVA2_BitStreamDateBufferType, + &dxva_data, &dxva_size))) + return -1; + current = dxva_data; + end = dxva_data + dxva_size; + + for (i = 0; i < ctx_pic->slice_count; i++) { + static const uint8_t start_code[] = { 0, 0, 1 }; + static const unsigned start_code_size = sizeof(start_code); + unsigned position, size; + + assert(offsetof(DXVA_Slice_H264_Short, BSNALunitDataLocation) == + offsetof(DXVA_Slice_H264_Long, BSNALunitDataLocation)); + assert(offsetof(DXVA_Slice_H264_Short, SliceBytesInBuffer) == + offsetof(DXVA_Slice_H264_Long, SliceBytesInBuffer)); + + if (is_slice_short(ctx)) + slice = &ctx_pic->slice_short[i]; + else + slice = (DXVA_Slice_H264_Short*)&ctx_pic->slice_long[i]; + + position = slice->BSNALunitDataLocation; + size = slice->SliceBytesInBuffer; + if (start_code_size + size > end - current) { + av_log(avctx, AV_LOG_ERROR, "Failed to build bitstream"); + break; + } + + slice->BSNALunitDataLocation = current - dxva_data; + slice->SliceBytesInBuffer = start_code_size + size; + + if (!is_slice_short(ctx)) { + DXVA_Slice_H264_Long *slice_long = (DXVA_Slice_H264_Long*)slice; + if (i < ctx_pic->slice_count - 1) + slice_long->NumMbsForSlice = + slice_long[1].first_mb_in_slice - slice_long[0].first_mb_in_slice; + else + slice_long->NumMbsForSlice = mb_count - slice_long->first_mb_in_slice; + } + + memcpy(current, start_code, start_code_size); + current += start_code_size; + + memcpy(current, &ctx_pic->bitstream[position], size); + current += size; + } + padding = FFMIN(128 - ((current - dxva_data) & 127), end - current); + if (slice && padding > 0) { + memset(current, 0, padding); + current += padding; + + slice->SliceBytesInBuffer += padding; + } + if (FAILED(IDirectXVideoDecoder_ReleaseBuffer(ctx->decoder, + DXVA2_BitStreamDateBufferType))) + return -1; + if (i < ctx_pic->slice_count) + return -1; + + memset(bs, 0, sizeof(*bs)); + bs->CompressedBufferType = DXVA2_BitStreamDateBufferType; + bs->DataSize = current - dxva_data; + bs->NumMBsInBuffer = mb_count; + + if (is_slice_short(ctx)) { + slice_data = ctx_pic->slice_short; + slice_size = ctx_pic->slice_count * sizeof(*ctx_pic->slice_short); + } else { + slice_data = ctx_pic->slice_long; + slice_size = ctx_pic->slice_count * sizeof(*ctx_pic->slice_long); + } + assert((bs->DataSize & 127) == 0); + return ff_dxva2_commit_buffer(avctx, ctx, sc, + DXVA2_SliceControlBufferType, + slice_data, slice_size, mb_count); +} + + +static int start_frame(AVCodecContext *avctx, + av_unused const uint8_t *buffer, + av_unused uint32_t size) +{ + const H264Context *h = avctx->priv_data; + struct dxva_context *ctx = avctx->hwaccel_context; + struct dxva2_picture_context *ctx_pic = h->s.current_picture_ptr->hwaccel_picture_private; + + if (!ctx->decoder || !ctx->cfg || ctx->surface_count <= 0) + return -1; + assert(ctx_pic); + + /* Fill up DXVA_PicParams_H264 */ + fill_picture_parameters(ctx, h, &ctx_pic->pp); + + /* Fill up DXVA_Qmatrix_H264 */ + fill_scaling_lists(h, &ctx_pic->qm); + + ctx_pic->slice_count = 0; + ctx_pic->bitstream_size = 0; + ctx_pic->bitstream = NULL; + return 0; +} + +static int decode_slice(AVCodecContext *avctx, + const uint8_t *buffer, uint32_t size) +{ + const H264Context *h = avctx->priv_data; + struct dxva_context *ctx = avctx->hwaccel_context; + const Picture *current_picture = h->s.current_picture_ptr; + struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private; + unsigned position; + + if (ctx_pic->slice_count >= MAX_SLICES) + return -1; + + if (!ctx_pic->bitstream) + ctx_pic->bitstream = buffer; + ctx_pic->bitstream_size += size; + + position = buffer - ctx_pic->bitstream; + if (is_slice_short(ctx)) + fill_slice_short(&ctx_pic->slice_short[ctx_pic->slice_count], + position, size); + else + fill_slice_long(avctx, &ctx_pic->slice_long[ctx_pic->slice_count], + position, size); + ctx_pic->slice_count++; + + if (h->slice_type != FF_I_TYPE && h->slice_type != FF_SI_TYPE) + ctx_pic->pp.wBitFields &= ~(1 << 15); /* Set IntraPicFlag to 0 */ + return 0; +} + +static int end_frame(AVCodecContext *avctx) +{ + H264Context *h = avctx->priv_data; + MpegEncContext *s = &h->s; + struct dxva2_picture_context *ctx_pic = + h->s.current_picture_ptr->hwaccel_picture_private; + + if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) + return -1; + return ff_dxva2_common_end_frame(avctx, s, + &ctx_pic->pp, sizeof(ctx_pic->pp), + &ctx_pic->qm, sizeof(ctx_pic->qm), + commit_bitstream_and_slice_buffer); +} + +AVHWAccel ff_h264_dxva2_hwaccel = { + .name = "h264_dxva2", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_H264, + .pix_fmt = PIX_FMT_DXVA2_VLD, + .capabilities = 0, + .start_frame = start_frame, + .decode_slice = decode_slice, + .end_frame = end_frame, + .priv_data_size = sizeof(struct dxva2_picture_context), +}; + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2_internal.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2_internal.h new file mode 100644 index 00000000..a9be7a07 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2_internal.h @@ -0,0 +1,48 @@ +/* + * DXVA2 HW acceleration + * + * copyright (c) 2010 Laurent Aimar + * + * 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 + */ + +#ifndef AVCODEC_DXVA_INTERNAL_H +#define AVCODEC_DXVA_INTERNAL_H + +#include "dxva2.h" +#include "avcodec.h" +#include "mpegvideo.h" + +void *ff_dxva2_get_surface(const Picture *picture); + +unsigned ff_dxva2_get_surface_index(const struct dxva_context *, + const Picture *picture); + +int ff_dxva2_commit_buffer(AVCodecContext *, struct dxva_context *, + DXVA2_DecodeBufferDesc *, + unsigned type, const void *data, unsigned size, + unsigned mb_count); + + +int ff_dxva2_common_end_frame(AVCodecContext *, MpegEncContext *, + const void *pp, unsigned pp_size, + const void *qm, unsigned qm_size, + int (*commit_bs_si)(AVCodecContext *, + DXVA2_DecodeBufferDesc *bs, + DXVA2_DecodeBufferDesc *slice)); + +#endif /* AVCODEC_DXVA_INTERNAL_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2_mpeg2.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2_mpeg2.c new file mode 100644 index 00000000..780542a6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2_mpeg2.c @@ -0,0 +1,274 @@ +/* + * MPEG-2 HW acceleration. + * + * copyright (c) 2010 Laurent Aimar + * + * 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 + */ + +#include "dxva2_internal.h" + +#define MAX_SLICES (SLICE_MAX_START_CODE - SLICE_MIN_START_CODE + 1) +struct dxva2_picture_context { + DXVA_PictureParameters pp; + DXVA_QmatrixData qm; + unsigned slice_count; + DXVA_SliceInfo slice[MAX_SLICES]; + + const uint8_t *bitstream; + unsigned bitstream_size; +}; + +static void fill_picture_parameters(AVCodecContext *avctx, + struct dxva_context *ctx, + const struct MpegEncContext *s, + DXVA_PictureParameters *pp) +{ + const Picture *current_picture = s->current_picture_ptr; + int is_field = s->picture_structure != PICT_FRAME; + + memset(pp, 0, sizeof(*pp)); + pp->wDecodedPictureIndex = ff_dxva2_get_surface_index(ctx, current_picture); + pp->wDeblockedPictureIndex = 0; + if (s->pict_type != FF_I_TYPE) + pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->last_picture); + else + pp->wForwardRefPictureIndex = 0xffff; + if (s->pict_type == FF_B_TYPE) + pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->next_picture); + else + pp->wBackwardRefPictureIndex = 0xffff; + pp->wPicWidthInMBminus1 = s->mb_width - 1; + pp->wPicHeightInMBminus1 = (s->mb_height >> is_field) - 1; + pp->bMacroblockWidthMinus1 = 15; + pp->bMacroblockHeightMinus1 = 15; + pp->bBlockWidthMinus1 = 7; + pp->bBlockHeightMinus1 = 7; + pp->bBPPminus1 = 7; + pp->bPicStructure = s->picture_structure; + pp->bSecondField = is_field && !s->first_field; + pp->bPicIntra = s->pict_type == FF_I_TYPE; + pp->bPicBackwardPrediction = s->pict_type == FF_B_TYPE; + pp->bBidirectionalAveragingMode = 0; + pp->bMVprecisionAndChromaRelation= 0; /* FIXME */ + pp->bChromaFormat = s->chroma_format; + pp->bPicScanFixed = 1; + pp->bPicScanMethod = s->alternate_scan ? 1 : 0; + pp->bPicReadbackRequests = 0; + pp->bRcontrol = 0; + pp->bPicSpatialResid8 = 0; + pp->bPicOverflowBlocks = 0; + pp->bPicExtrapolation = 0; + pp->bPicDeblocked = 0; + pp->bPicDeblockConfined = 0; + pp->bPic4MVallowed = 0; + pp->bPicOBMC = 0; + pp->bPicBinPB = 0; + pp->bMV_RPS = 0; + pp->bReservedBits = 0; + pp->wBitstreamFcodes = (s->mpeg_f_code[0][0] << 12) | + (s->mpeg_f_code[0][1] << 8) | + (s->mpeg_f_code[1][0] << 4) | + (s->mpeg_f_code[1][1] ); + pp->wBitstreamPCEelements = (s->intra_dc_precision << 14) | + (s->picture_structure << 12) | + (s->top_field_first << 11) | + (s->frame_pred_frame_dct << 10) | + (s->concealment_motion_vectors << 9) | + (s->q_scale_type << 8) | + (s->intra_vlc_format << 7) | + (s->alternate_scan << 6) | + (s->repeat_first_field << 5) | + (s->chroma_420_type << 4) | + (s->progressive_frame << 3); + pp->bBitstreamConcealmentNeed = 0; + pp->bBitstreamConcealmentMethod = 0; +} + +static void fill_quantization_matrices(AVCodecContext *avctx, + struct dxva_context *ctx, + const struct MpegEncContext *s, + DXVA_QmatrixData *qm) +{ + int i; + for (i = 0; i < 4; i++) + qm->bNewQmatrix[i] = 1; + for (i = 0; i < 64; i++) { + int n = s->dsp.idct_permutation[ff_zigzag_direct[i]]; + qm->Qmatrix[0][i] = s->intra_matrix[n];; + qm->Qmatrix[1][i] = s->inter_matrix[n];; + qm->Qmatrix[2][i] = s->chroma_intra_matrix[n];; + qm->Qmatrix[3][i] = s->chroma_inter_matrix[n];; + } +} + +static void fill_slice(AVCodecContext *avctx, + const struct MpegEncContext *s, + DXVA_SliceInfo *slice, + unsigned position, + const uint8_t *buffer, unsigned size) +{ + int is_field = s->picture_structure != PICT_FRAME; + GetBitContext gb; + + memset(slice, 0, sizeof(*slice)); + slice->wHorizontalPosition = s->mb_x; + slice->wVerticalPosition = s->mb_y >> is_field; + slice->dwSliceBitsInBuffer = 8 * size; + slice->dwSliceDataLocation = position; + slice->bStartCodeBitOffset = 0; + slice->bReservedBits = 0; + /* XXX We store the index of the first MB and it will be fixed later */ + slice->wNumberMBsInSlice = (s->mb_y >> is_field) * s->mb_width + s->mb_x; + slice->wBadSliceChopping = 0; + + init_get_bits(&gb, &buffer[4], 8 * (size - 4)); + + slice->wQuantizerScaleCode = get_bits(&gb, 5); + while (get_bits1(&gb)) + skip_bits(&gb, 8); + + slice->wMBbitOffset = 4 * 8 + get_bits_count(&gb); +} +static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, + DXVA2_DecodeBufferDesc *bs, + DXVA2_DecodeBufferDesc *sc) +{ + const struct MpegEncContext *s = avctx->priv_data; + struct dxva_context *ctx = avctx->hwaccel_context; + struct dxva2_picture_context *ctx_pic = + s->current_picture_ptr->hwaccel_picture_private; + const int is_field = s->picture_structure != PICT_FRAME; + const unsigned mb_count = s->mb_width * (s->mb_height >> is_field); + uint8_t *dxva_data, *current, *end; + unsigned dxva_size; + unsigned i; + + if (FAILED(IDirectXVideoDecoder_GetBuffer(ctx->decoder, + DXVA2_BitStreamDateBufferType, + &dxva_data, &dxva_size))) + return -1; + current = dxva_data; + end = dxva_data + dxva_size; + + for (i = 0; i < ctx_pic->slice_count; i++) { + DXVA_SliceInfo *slice = &ctx_pic->slice[i]; + unsigned position = slice->dwSliceDataLocation; + unsigned size = slice->dwSliceBitsInBuffer / 8; + if (size > end - current) { + av_log(avctx, AV_LOG_ERROR, "Failed to build bitstream"); + break; + } + slice->dwSliceDataLocation = current - dxva_data; + + if (i < ctx_pic->slice_count - 1) + slice->wNumberMBsInSlice = + slice[1].wNumberMBsInSlice - slice[0].wNumberMBsInSlice; + else + slice->wNumberMBsInSlice = + mb_count - slice[0].wNumberMBsInSlice; + + memcpy(current, &ctx_pic->bitstream[position], size); + current += size; + } + if (FAILED(IDirectXVideoDecoder_ReleaseBuffer(ctx->decoder, + DXVA2_BitStreamDateBufferType))) + return -1; + if (i < ctx_pic->slice_count) + return -1; + + memset(bs, 0, sizeof(*bs)); + bs->CompressedBufferType = DXVA2_BitStreamDateBufferType; + bs->DataSize = current - dxva_data; + bs->NumMBsInBuffer = mb_count; + + return ff_dxva2_commit_buffer(avctx, ctx, sc, + DXVA2_SliceControlBufferType, + ctx_pic->slice, + ctx_pic->slice_count * sizeof(*ctx_pic->slice), + mb_count); +} + +static int start_frame(AVCodecContext *avctx, + av_unused const uint8_t *buffer, + av_unused uint32_t size) +{ + const struct MpegEncContext *s = avctx->priv_data; + struct dxva_context *ctx = avctx->hwaccel_context; + struct dxva2_picture_context *ctx_pic = + s->current_picture_ptr->hwaccel_picture_private; + + if (!ctx->decoder || !ctx->cfg || ctx->surface_count <= 0) + return -1; + assert(ctx_pic); + + fill_picture_parameters(avctx, ctx, s, &ctx_pic->pp); + fill_quantization_matrices(avctx, ctx, s, &ctx_pic->qm); + + ctx_pic->slice_count = 0; + ctx_pic->bitstream_size = 0; + ctx_pic->bitstream = NULL; + return 0; +} + +static int decode_slice(AVCodecContext *avctx, + const uint8_t *buffer, uint32_t size) +{ + const struct MpegEncContext *s = avctx->priv_data; + struct dxva2_picture_context *ctx_pic = + s->current_picture_ptr->hwaccel_picture_private; + unsigned position; + + if (ctx_pic->slice_count >= MAX_SLICES) + return -1; + + if (!ctx_pic->bitstream) + ctx_pic->bitstream = buffer; + ctx_pic->bitstream_size += size; + + position = buffer - ctx_pic->bitstream; + fill_slice(avctx, s, &ctx_pic->slice[ctx_pic->slice_count++], position, + buffer, size); + return 0; +} + +static int end_frame(AVCodecContext *avctx) +{ + struct MpegEncContext *s = avctx->priv_data; + struct dxva2_picture_context *ctx_pic = + s->current_picture_ptr->hwaccel_picture_private; + + if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) + return -1; + return ff_dxva2_common_end_frame(avctx, s, + &ctx_pic->pp, sizeof(ctx_pic->pp), + &ctx_pic->qm, sizeof(ctx_pic->qm), + commit_bitstream_and_slice_buffer); +} + +AVHWAccel ff_mpeg2_dxva2_hwaccel = { + .name = "mpeg2_dxva2", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_MPEG2VIDEO, + .pix_fmt = PIX_FMT_DXVA2_VLD, + .capabilities = 0, + .start_frame = start_frame, + .decode_slice = decode_slice, + .end_frame = end_frame, + .priv_data_size = sizeof(struct dxva2_picture_context), +}; + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2_vc1.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2_vc1.c new file mode 100644 index 00000000..2b9a690e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/dxva2_vc1.c @@ -0,0 +1,291 @@ +/* + * DXVA2 WMV3/VC-1 HW acceleration. + * + * copyright (c) 2010 Laurent Aimar + * + * 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 + */ + +#include "dxva2_internal.h" +#include "vc1.h" +#include "vc1data.h" + +struct dxva2_picture_context { + DXVA_PictureParameters pp; + DXVA_SliceInfo si; + + const uint8_t *bitstream; + unsigned bitstream_size; +}; + +static void fill_picture_parameters(AVCodecContext *avctx, + struct dxva_context *ctx, const VC1Context *v, + DXVA_PictureParameters *pp) +{ + const MpegEncContext *s = &v->s; + const Picture *current_picture = s->current_picture_ptr; + + memset(pp, 0, sizeof(*pp)); + pp->wDecodedPictureIndex = + pp->wDeblockedPictureIndex = ff_dxva2_get_surface_index(ctx, current_picture); + if (s->pict_type != FF_I_TYPE) + pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->last_picture); + else + pp->wForwardRefPictureIndex = 0xffff; + if (s->pict_type == FF_B_TYPE) + pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->next_picture); + else + pp->wBackwardRefPictureIndex = 0xffff; + if (v->profile == PROFILE_ADVANCED) { + /* It is the cropped width/height -1 of the frame */ + pp->wPicWidthInMBminus1 = avctx->width - 1; + pp->wPicHeightInMBminus1= avctx->height - 1; + } else { + /* It is the coded width/height in macroblock -1 of the frame */ + pp->wPicWidthInMBminus1 = s->mb_width - 1; + pp->wPicHeightInMBminus1= s->mb_height - 1; + } + pp->bMacroblockWidthMinus1 = 15; + pp->bMacroblockHeightMinus1 = 15; + pp->bBlockWidthMinus1 = 7; + pp->bBlockHeightMinus1 = 7; + pp->bBPPminus1 = 7; + if (s->picture_structure & PICT_TOP_FIELD) + pp->bPicStructure |= 0x01; + if (s->picture_structure & PICT_BOTTOM_FIELD) + pp->bPicStructure |= 0x02; + pp->bSecondField = v->interlace && v->fcm != 0x03 && !s->first_field; + pp->bPicIntra = s->pict_type == FF_I_TYPE; + pp->bPicBackwardPrediction = s->pict_type == FF_B_TYPE; + pp->bBidirectionalAveragingMode = (1 << 7) | + ((ctx->cfg->ConfigIntraResidUnsigned != 0) << 6) | + ((ctx->cfg->ConfigResidDiffAccelerator != 0) << 5) | + ((v->lumscale != 32 || v->lumshift != 0) << 4) | + ((v->profile == PROFILE_ADVANCED) << 3); + pp->bMVprecisionAndChromaRelation = ((v->mv_mode == MV_PMODE_1MV_HPEL_BILIN) << 3) | + (1 << 2) | + (0 << 1) | + (!s->quarter_sample ); + pp->bChromaFormat = v->chromaformat; + ctx->report_id++; + if (ctx->report_id >= (1 << 16)) + ctx->report_id = 1; + pp->bPicScanFixed = ctx->report_id >> 8; + pp->bPicScanMethod = ctx->report_id & 0xff; + pp->bPicReadbackRequests = 0; + pp->bRcontrol = v->rnd; + pp->bPicSpatialResid8 = (v->panscanflag << 7) | + (v->refdist_flag << 6) | + (s->loop_filter << 5) | + (v->fastuvmc << 4) | + (v->extended_mv << 3) | + (v->dquant << 1) | + (v->vstransform ); + pp->bPicOverflowBlocks = (v->quantizer_mode << 6) | + (v->multires << 5) | + (s->resync_marker << 4) | + (v->rangered << 3) | + (s->max_b_frames ); + pp->bPicExtrapolation = (!v->interlace || v->fcm == 0x00) ? 1 : 2; + pp->bPicDeblocked = ((v->profile != PROFILE_ADVANCED && v->rangeredfrm) << 5) | + (s->loop_filter << 1); + pp->bPicDeblockConfined = (v->postprocflag << 7) | + (v->broadcast << 6) | + (v->interlace << 5) | + (v->tfcntrflag << 4) | + (v->finterpflag << 3) | + ((s->pict_type != FF_B_TYPE) << 2) | + (v->psf << 1) | + (v->extended_dmv ); + if (s->pict_type != FF_I_TYPE) + pp->bPic4MVallowed = v->mv_mode == MV_PMODE_MIXED_MV || + (v->mv_mode == MV_PMODE_INTENSITY_COMP && + v->mv_mode2 == MV_PMODE_MIXED_MV); + if (v->profile == PROFILE_ADVANCED) + pp->bPicOBMC = (v->range_mapy_flag << 7) | + (v->range_mapy << 4) | + (v->range_mapuv_flag << 3) | + (v->range_mapuv ); + pp->bPicBinPB = 0; + pp->bMV_RPS = 0; + pp->bReservedBits = 0; + if (s->picture_structure == PICT_FRAME) { + pp->wBitstreamFcodes = v->lumscale; + pp->wBitstreamPCEelements = v->lumshift; + } else { + /* Syntax: (top_field_param << 8) | bottom_field_param */ + pp->wBitstreamFcodes = (v->lumscale << 8) | v->lumscale; + pp->wBitstreamPCEelements = (v->lumshift << 8) | v->lumshift; + } + pp->bBitstreamConcealmentNeed = 0; + pp->bBitstreamConcealmentMethod = 0; +} + +static void fill_slice(AVCodecContext *avctx, DXVA_SliceInfo *slice, + unsigned position, unsigned size) +{ + const VC1Context *v = avctx->priv_data; + const MpegEncContext *s = &v->s; + + memset(slice, 0, sizeof(*slice)); + slice->wHorizontalPosition = 0; + slice->wVerticalPosition = s->mb_y; + slice->dwSliceBitsInBuffer = 8 * size; + slice->dwSliceDataLocation = position; + slice->bStartCodeBitOffset = 0; + slice->bReservedBits = 0; + slice->wMBbitOffset = get_bits_count(&s->gb); + slice->wNumberMBsInSlice = s->mb_width * s->mb_height; /* XXX We assume 1 slice */ + slice->wQuantizerScaleCode = v->pq; + slice->wBadSliceChopping = 0; +} + +static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, + DXVA2_DecodeBufferDesc *bs, + DXVA2_DecodeBufferDesc *sc) +{ + const VC1Context *v = avctx->priv_data; + struct dxva_context *ctx = avctx->hwaccel_context; + const MpegEncContext *s = &v->s; + struct dxva2_picture_context *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; + + DXVA_SliceInfo *slice = &ctx_pic->si; + + static const uint8_t start_code[] = { 0, 0, 1, 0x0d }; + const unsigned start_code_size = avctx->codec_id == CODEC_ID_VC1 ? sizeof(start_code) : 0; + const unsigned slice_size = slice->dwSliceBitsInBuffer / 8; + const unsigned padding = 128 - ((start_code_size + slice_size) & 127); + const unsigned data_size = start_code_size + slice_size + padding; + + uint8_t *dxva_data; + unsigned dxva_size; + int result; + + if (FAILED(IDirectXVideoDecoder_GetBuffer(ctx->decoder, + DXVA2_BitStreamDateBufferType, + &dxva_data, &dxva_size))) + return -1; + + result = data_size <= dxva_size ? 0 : -1; + if (!result) { + if (start_code_size > 0) + memcpy(dxva_data, start_code, start_code_size); + memcpy(dxva_data + start_code_size, + ctx_pic->bitstream + slice->dwSliceDataLocation, slice_size); + if (padding > 0) + memset(dxva_data + start_code_size + slice_size, 0, padding); + slice->dwSliceBitsInBuffer = 8 * data_size; + } + if (FAILED(IDirectXVideoDecoder_ReleaseBuffer(ctx->decoder, + DXVA2_BitStreamDateBufferType))) + return -1; + if (result) + return result; + + memset(bs, 0, sizeof(*bs)); + bs->CompressedBufferType = DXVA2_BitStreamDateBufferType; + bs->DataSize = data_size; + bs->NumMBsInBuffer = s->mb_width * s->mb_height; + assert((bs->DataSize & 127) == 0); + + return ff_dxva2_commit_buffer(avctx, ctx, sc, + DXVA2_SliceControlBufferType, + slice, sizeof(*slice), bs->NumMBsInBuffer); +} + +static int start_frame(AVCodecContext *avctx, + av_unused const uint8_t *buffer, + av_unused uint32_t size) +{ + const VC1Context *v = avctx->priv_data; + struct dxva_context *ctx = avctx->hwaccel_context; + struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; + + if (!ctx->decoder || !ctx->cfg || ctx->surface_count <= 0) + return -1; + assert(ctx_pic); + + fill_picture_parameters(avctx, ctx, v, &ctx_pic->pp); + + ctx_pic->bitstream_size = 0; + ctx_pic->bitstream = NULL; + return 0; +} + +static int decode_slice(AVCodecContext *avctx, + const uint8_t *buffer, uint32_t size) +{ + const VC1Context *v = avctx->priv_data; + const Picture *current_picture = v->s.current_picture_ptr; + struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private; + + if (ctx_pic->bitstream_size > 0) + return -1; + + if (avctx->codec_id == CODEC_ID_VC1 && + size >= 4 && IS_MARKER(AV_RB32(buffer))) { + buffer += 4; + size -= 4; + } + + ctx_pic->bitstream_size = size; + ctx_pic->bitstream = buffer; + + fill_slice(avctx, &ctx_pic->si, 0, size); + return 0; +} + +static int end_frame(AVCodecContext *avctx) +{ + VC1Context *v = avctx->priv_data; + struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; + + if (ctx_pic->bitstream_size <= 0) + return -1; + + return ff_dxva2_common_end_frame(avctx, &v->s, + &ctx_pic->pp, sizeof(ctx_pic->pp), + NULL, 0, + commit_bitstream_and_slice_buffer); +} + +#if CONFIG_WMV3_DXVA2_HWACCEL +AVHWAccel ff_wmv3_dxva2_hwaccel = { + .name = "wmv3_dxva2", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_WMV3, + .pix_fmt = PIX_FMT_DXVA2_VLD, + .capabilities = 0, + .start_frame = start_frame, + .decode_slice = decode_slice, + .end_frame = end_frame, + .priv_data_size = sizeof(struct dxva2_picture_context), +}; +#endif + +AVHWAccel ff_vc1_dxva2_hwaccel = { + .name = "vc1_dxva2", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_VC1, + .pix_fmt = PIX_FMT_DXVA2_VLD, + .capabilities = 0, + .start_frame = start_frame, + .decode_slice = decode_slice, + .end_frame = end_frame, + .priv_data_size = sizeof(struct dxva2_picture_context), +}; + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fft.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fft.h new file mode 100644 index 00000000..37cbfbf6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fft.h @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + */ + +#ifndef AVCODEC_FFT_H +#define AVCODEC_FFT_H + +#include +#include "config.h" +#include "libavutil/mem.h" +#include "avfft.h" + +/* FFT computation */ + +struct FFTContext { + int nbits; + int inverse; + uint16_t *revtab; + FFTComplex *tmp_buf; + int mdct_size; /* size of MDCT (i.e. number of input data * 2) */ + int mdct_bits; /* n = 2^nbits */ + /* pre/post rotation tables */ + FFTSample *tcos; + FFTSample *tsin; + void (*fft_permute)(struct FFTContext *s, FFTComplex *z); + void (*fft_calc)(struct FFTContext *s, FFTComplex *z); + void (*imdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input); + void (*imdct_half)(struct FFTContext *s, FFTSample *output, const FFTSample *input); + void (*mdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input); + int permutation; +#define FF_MDCT_PERM_NONE 0 +#define FF_MDCT_PERM_INTERLEAVE 1 +}; + +#if CONFIG_HARDCODED_TABLES +#define COSTABLE_CONST const +#define SINTABLE_CONST const +#define SINETABLE_CONST const +#else +#define COSTABLE_CONST +#define SINTABLE_CONST +#define SINETABLE_CONST +#endif + +#define COSTABLE(size) \ + COSTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_cos_##size)[size/2] +#define SINTABLE(size) \ + SINTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_sin_##size)[size/2] +#define SINETABLE(size) \ + SINETABLE_CONST DECLARE_ALIGNED(16, float, ff_sine_##size)[size] +extern COSTABLE(16); +extern COSTABLE(32); +extern COSTABLE(64); +extern COSTABLE(128); +extern COSTABLE(256); +extern COSTABLE(512); +extern COSTABLE(1024); +extern COSTABLE(2048); +extern COSTABLE(4096); +extern COSTABLE(8192); +extern COSTABLE(16384); +extern COSTABLE(32768); +extern COSTABLE(65536); +extern COSTABLE_CONST FFTSample* const ff_cos_tabs[17]; + +/** + * Initialize the cosine table in ff_cos_tabs[index] + * \param index index in ff_cos_tabs array of the table to initialize + */ +void ff_init_ff_cos_tabs(int index); + +extern SINTABLE(16); +extern SINTABLE(32); +extern SINTABLE(64); +extern SINTABLE(128); +extern SINTABLE(256); +extern SINTABLE(512); +extern SINTABLE(1024); +extern SINTABLE(2048); +extern SINTABLE(4096); +extern SINTABLE(8192); +extern SINTABLE(16384); +extern SINTABLE(32768); +extern SINTABLE(65536); + +/** + * Set up a complex FFT. + * @param nbits log2 of the length of the input array + * @param inverse if 0 perform the forward transform, if 1 perform the inverse + */ +int ff_fft_init(FFTContext *s, int nbits, int inverse); + +void ff_fft_init_altivec(FFTContext *s); +void ff_fft_init_mmx(FFTContext *s); +void ff_fft_init_arm(FFTContext *s); +void ff_dct_init_mmx(DCTContext *s); + +/** + * Do the permutation needed BEFORE calling ff_fft_calc(). + */ +static inline void ff_fft_permute(FFTContext *s, FFTComplex *z) +{ + s->fft_permute(s, z); +} +/** + * Do a complex FFT with the parameters defined in ff_fft_init(). The + * input data must be permuted before. No 1.0/sqrt(n) normalization is done. + */ +static inline void ff_fft_calc(FFTContext *s, FFTComplex *z) +{ + s->fft_calc(s, z); +} +void ff_fft_end(FFTContext *s); + +/* MDCT computation */ + +static inline void ff_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input) +{ + s->imdct_calc(s, output, input); +} +static inline void ff_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input) +{ + s->imdct_half(s, output, input); +} + +static inline void ff_mdct_calc(FFTContext *s, FFTSample *output, + const FFTSample *input) +{ + s->mdct_calc(s, output, input); +} + +/** + * Maximum window size for ff_kbd_window_init. + */ +#define FF_KBD_WINDOW_MAX 1024 + +/** + * Generate a Kaiser-Bessel Derived Window. + * @param window pointer to half window + * @param alpha determines window shape + * @param n size of half window, max FF_KBD_WINDOW_MAX + */ +void ff_kbd_window_init(float *window, float alpha, int n); + +/** + * Generate a sine window. + * @param window pointer to half window + * @param n size of half window + */ +void ff_sine_window_init(float *window, int n); + +/** + * initialize the specified entry of ff_sine_windows + */ +void ff_init_ff_sine_windows(int index); +extern SINETABLE( 32); +extern SINETABLE( 64); +extern SINETABLE( 128); +extern SINETABLE( 256); +extern SINETABLE( 512); +extern SINETABLE(1024); +extern SINETABLE(2048); +extern SINETABLE(4096); +extern SINETABLE_CONST float * const ff_sine_windows[13]; + +int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale); +void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input); +void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input); +void ff_mdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input); +void ff_mdct_end(FFTContext *s); + +/* Real Discrete Fourier Transform */ + +struct RDFTContext { + int nbits; + int inverse; + int sign_convention; + + /* pre/post rotation tables */ + const FFTSample *tcos; + SINTABLE_CONST FFTSample *tsin; + FFTContext fft; + void (*rdft_calc)(struct RDFTContext *s, FFTSample *z); +}; + +/** + * Set up a real FFT. + * @param nbits log2 of the length of the input array + * @param trans the type of transform + */ +int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans); +void ff_rdft_end(RDFTContext *s); + +void ff_rdft_init_arm(RDFTContext *s); + +static av_always_inline void ff_rdft_calc(RDFTContext *s, FFTSample *data) +{ + s->rdft_calc(s, data); +} + +/* Discrete Cosine Transform */ + +struct DCTContext { + int nbits; + int inverse; + RDFTContext rdft; + const float *costab; + FFTSample *csc2; + void (*dct_calc)(struct DCTContext *s, FFTSample *data); + void (*dct32)(FFTSample *out, const FFTSample *in); +}; + +/** + * Set up DCT. + * @param nbits size of the input array: + * (1 << nbits) for DCT-II, DCT-III and DST-I + * (1 << nbits) + 1 for DCT-I + * + * @note the first element of the input of DST-I is ignored + */ +int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType type); +void ff_dct_calc(DCTContext *s, FFTSample *data); +void ff_dct_end (DCTContext *s); + +#endif /* AVCODEC_FFT_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flac_parser.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flac_parser.c new file mode 100644 index 00000000..50ad72b7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flac_parser.c @@ -0,0 +1,682 @@ +/* + * FLAC parser + * Copyright (c) 2010 Michael Chinen + * + * 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 + * FLAC parser + * + * The FLAC parser buffers input until FLAC_MIN_HEADERS has been found. + * Each time it finds and verifies a CRC-8 header it sees which of the + * FLAC_MAX_SEQUENTIAL_HEADERS that came before it have a valid CRC-16 footer + * that ends at the newly found header. + * Headers are scored by FLAC_HEADER_BASE_SCORE plus the max of it's crc-verified + * children, penalized by changes in sample rate, frame number, etc. + * The parser returns the frame with the highest score. + **/ + +#include "libavutil/crc.h" +#include "libavutil/fifo.h" +#include "bytestream.h" +#include "parser.h" +#include "flac.h" + +/** maximum number of adjacent headers that compare CRCs against each other */ +#define FLAC_MAX_SEQUENTIAL_HEADERS 3 +/** minimum number of headers buffered and checked before returning frames */ +#define FLAC_MIN_HEADERS 10 +/** estimate for average size of a FLAC frame */ +#define FLAC_AVG_FRAME_SIZE 8192 + +/** scoring settings for score_header */ +#define FLAC_HEADER_BASE_SCORE 10 +#define FLAC_HEADER_CHANGED_PENALTY 7 +#define FLAC_HEADER_CRC_FAIL_PENALTY 50 +#define FLAC_HEADER_NOT_PENALIZED_YET 100000 +#define FLAC_HEADER_NOT_SCORED_YET -100000 + +/** largest possible size of flac header */ +#define MAX_FRAME_HEADER_SIZE 16 + +typedef struct FLACHeaderMarker { + int offset; /**< byte offset from start of FLACParseContext->buffer */ + int *link_penalty; /**< pointer to array of local scores between this header + and the one at a distance equal array position */ + int max_score; /**< maximum score found after checking each child that + has a valid CRC */ + FLACFrameInfo fi; /**< decoded frame header info */ + struct FLACHeaderMarker *next; /**< next CRC-8 verified header that + immediately follows this one in + the bytestream */ + struct FLACHeaderMarker *best_child; /**< following frame header with + which this frame has the best + score with */ +} FLACHeaderMarker; + +typedef struct FLACParseContext { + AVCodecContext *avctx; /**< codec context pointer for logging */ + FLACHeaderMarker *headers; /**< linked-list that starts at the first + CRC-8 verified header within buffer */ + FLACHeaderMarker *best_header; /**< highest scoring header within buffer */ + int nb_headers_found; /**< number of headers found in the last + flac_parse() call */ + int nb_headers_buffered; /**< number of headers that are buffered */ + int best_header_valid; /**< flag set when the parser returns junk; + if set return best_header next time */ + AVFifoBuffer *fifo_buf; /**< buffer to store all data until headers + can be verified */ + int end_padded; /**< specifies if fifo_buf's end is padded */ + uint8_t *wrap_buf; /**< general fifo read buffer when wrapped */ + int wrap_buf_allocated_size; /**< actual allocated size of the buffer */ +} FLACParseContext; + +static int frame_header_is_valid(AVCodecContext *avctx, const uint8_t *buf, + FLACFrameInfo *fi) +{ + GetBitContext gb; + init_get_bits(&gb, buf, MAX_FRAME_HEADER_SIZE * 8); + return !ff_flac_decode_frame_header(avctx, &gb, fi, 127); +} + +/** + * Non-destructive fast fifo pointer fetching + * Returns a pointer from the specified offset. + * If possible the pointer points within the fifo buffer. + * Otherwise (if it would cause a wrap around,) a pointer to a user-specified + * buffer is used. + * The pointer can be NULL. In any case it will be reallocated to hold the size. + * If the returned pointer will be used after subsequent calls to flac_fifo_read_wrap + * then the subsequent calls should pass in a different wrap_buf so as to not + * overwrite the contents of the previous wrap_buf. + * This function is based on av_fifo_generic_read, which is why there is a comment + * about a memory barrier for SMP. + */ +static uint8_t* flac_fifo_read_wrap(FLACParseContext *fpc, int offset, int len, + uint8_t** wrap_buf, int* allocated_size) +{ + AVFifoBuffer *f = fpc->fifo_buf; + uint8_t *start = f->rptr + offset; + uint8_t *tmp_buf; + + if (start >= f->end) + start -= f->end - f->buffer; + if (f->end - start >= len) + return start; + + tmp_buf = av_fast_realloc(*wrap_buf, allocated_size, len); + + if (!tmp_buf) { + av_log(fpc->avctx, AV_LOG_ERROR, + "couldn't reallocate wrap buffer of size %d", len); + return NULL; + } + *wrap_buf = tmp_buf; + do { + int seg_len = FFMIN(f->end - start, len); + memcpy(tmp_buf, start, seg_len); + tmp_buf = (uint8_t*)tmp_buf + seg_len; +// memory barrier needed for SMP here in theory + + start += seg_len - (f->end - f->buffer); + len -= seg_len; + } while (len > 0); + + return *wrap_buf; +} + +/** + * Return a pointer in the fifo buffer where the offset starts at until + * the wrap point or end of request. + * len will contain the valid length of the returned buffer. + * A second call to flac_fifo_read (with new offset and len) should be called + * to get the post-wrap buf if the returned len is less than the requested. + **/ +static uint8_t* flac_fifo_read(FLACParseContext *fpc, int offset, int *len) +{ + AVFifoBuffer *f = fpc->fifo_buf; + uint8_t *start = f->rptr + offset; + + if (start >= f->end) + start -= f->end - f->buffer; + *len = FFMIN(*len, f->end - start); + return start; +} + +static int find_headers_search_validate(FLACParseContext *fpc, int offset) +{ + FLACFrameInfo fi; + uint8_t *header_buf; + int size = 0; + header_buf = flac_fifo_read_wrap(fpc, offset, + MAX_FRAME_HEADER_SIZE, + &fpc->wrap_buf, + &fpc->wrap_buf_allocated_size); + if (frame_header_is_valid(fpc->avctx, header_buf, &fi)) { + FLACHeaderMarker **end_handle = &fpc->headers; + int i; + + size = 0; + while (*end_handle) { + end_handle = &(*end_handle)->next; + size++; + } + + *end_handle = av_mallocz(sizeof(FLACHeaderMarker)); + if (!*end_handle) { + av_log(fpc->avctx, AV_LOG_ERROR, + "couldn't allocate FLACHeaderMarker\n"); + return AVERROR(ENOMEM); + } + (*end_handle)->fi = fi; + (*end_handle)->offset = offset; + (*end_handle)->link_penalty = av_malloc(sizeof(int) * + FLAC_MAX_SEQUENTIAL_HEADERS); + for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS; i++) + (*end_handle)->link_penalty[i] = FLAC_HEADER_NOT_PENALIZED_YET; + + fpc->nb_headers_found++; + size++; + } + return size; +} + +static int find_headers_search(FLACParseContext *fpc, uint8_t *buf, int buf_size, + int search_start) + +{ + int size = 0, mod_offset = (buf_size - 1) % 4, i, j; + uint32_t x; + + for (i = 0; i < mod_offset; i++) { + if ((AV_RB16(buf + i) & 0xFFFE) == 0xFFF8) + size = find_headers_search_validate(fpc, search_start + i); + } + + for (; i < buf_size - 1; i += 4) { + x = AV_RB32(buf + i); + if (((x & ~(x + 0x01010101)) & 0x80808080)) { + for (j = 0; j < 4; j++) { + if ((AV_RB16(buf + i + j) & 0xFFFE) == 0xFFF8) + size = find_headers_search_validate(fpc, search_start + i + j); + } + } + } + return size; +} + +static int find_new_headers(FLACParseContext *fpc, int search_start) +{ + FLACHeaderMarker *end; + int search_end, size = 0, read_len, temp; + uint8_t *buf; + fpc->nb_headers_found = 0; + + /* Search for a new header of at most 16 bytes. */ + search_end = av_fifo_size(fpc->fifo_buf) - (MAX_FRAME_HEADER_SIZE - 1); + read_len = search_end - search_start + 1; + buf = flac_fifo_read(fpc, search_start, &read_len); + size = find_headers_search(fpc, buf, read_len, search_start); + search_start += read_len - 1; + + /* If fifo end was hit do the wrap around. */ + if (search_start != search_end) { + uint8_t wrap[2]; + + wrap[0] = buf[read_len - 1]; + read_len = search_end - search_start + 1; + + /* search_start + 1 is the post-wrap offset in the fifo. */ + buf = flac_fifo_read(fpc, search_start + 1, &read_len); + wrap[1] = buf[0]; + + if ((AV_RB16(wrap) & 0xFFFE) == 0xFFF8) { + temp = find_headers_search_validate(fpc, search_start); + size = FFMAX(size, temp); + } + search_start++; + + /* Continue to do the last half of the wrap. */ + temp = find_headers_search(fpc, buf, read_len, search_start); + size = FFMAX(size, temp); + search_start += read_len - 1; + } + + /* Return the size even if no new headers were found. */ + if (!size && fpc->headers) + for (end = fpc->headers; end; end = end->next) + size++; + return size; +} + +static int check_header_mismatch(FLACParseContext *fpc, + FLACHeaderMarker *header, + FLACHeaderMarker *child, + int log_level_offset) +{ + FLACFrameInfo *header_fi = &header->fi, *child_fi = &child->fi; + int deduction = 0, deduction_expected = 0, i; + if (child_fi->samplerate != header_fi->samplerate) { + deduction += FLAC_HEADER_CHANGED_PENALTY; + av_log(fpc->avctx, AV_LOG_WARNING + log_level_offset, + "sample rate change detected in adjacent frames\n"); + } + if (child_fi->bps != header_fi->bps) { + deduction += FLAC_HEADER_CHANGED_PENALTY; + av_log(fpc->avctx, AV_LOG_WARNING + log_level_offset, + "bits per sample change detected in adjacent frames\n"); + } + if (child_fi->is_var_size != header_fi->is_var_size) { + /* Changing blocking strategy not allowed per the spec */ + deduction += FLAC_HEADER_BASE_SCORE; + av_log(fpc->avctx, AV_LOG_WARNING + log_level_offset, + "blocking strategy change detected in adjacent frames\n"); + } + if (child_fi->channels != header_fi->channels) { + deduction += FLAC_HEADER_CHANGED_PENALTY; + av_log(fpc->avctx, AV_LOG_WARNING + log_level_offset, + "number of channels change detected in adjacent frames\n"); + } + /* Check sample and frame numbers. */ + if ((child_fi->frame_or_sample_num - header_fi->frame_or_sample_num + != header_fi->blocksize) && + (child_fi->frame_or_sample_num + != header_fi->frame_or_sample_num + 1)) { + FLACHeaderMarker *curr; + int expected_frame_num, expected_sample_num; + /* If there are frames in the middle we expect this deduction, + as they are probably valid and this one follows it */ + + expected_frame_num = expected_sample_num = header_fi->frame_or_sample_num; + curr = header; + while (curr != child) { + /* Ignore frames that failed all crc checks */ + for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS; i++) { + if (curr->link_penalty[i] < FLAC_HEADER_CRC_FAIL_PENALTY) { + expected_frame_num++; + expected_sample_num += curr->fi.blocksize; + break; + } + } + curr = curr->next; + } + + if (expected_frame_num == child_fi->frame_or_sample_num || + expected_sample_num == child_fi->frame_or_sample_num) + deduction_expected = deduction ? 0 : 1; + + deduction += FLAC_HEADER_CHANGED_PENALTY; + av_log(fpc->avctx, AV_LOG_WARNING + log_level_offset, + "sample/frame number mismatch in adjacent frames\n"); + } + + /* If we have suspicious headers, check the CRC between them */ + if (deduction && !deduction_expected) { + FLACHeaderMarker *curr; + int read_len; + uint8_t *buf; + uint32_t crc = 1; + int inverted_test = 0; + + /* Since CRC is expensive only do it if we haven't yet. + This assumes a CRC penalty is greater than all other check penalties */ + curr = header->next; + for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS && curr != child; i++) + curr = curr->next; + + if (header->link_penalty[i] < FLAC_HEADER_CRC_FAIL_PENALTY || + header->link_penalty[i] == FLAC_HEADER_NOT_PENALIZED_YET) { + FLACHeaderMarker *start, *end; + + /* Although overlapping chains are scored, the crc should never + have to be computed twice for a single byte. */ + start = header; + end = child; + if (i > 0 && + header->link_penalty[i - 1] >= FLAC_HEADER_CRC_FAIL_PENALTY) { + while (start->next != child) + start = start->next; + inverted_test = 1; + } else if (i > 0 && + header->next->link_penalty[i-1] >= + FLAC_HEADER_CRC_FAIL_PENALTY ) { + end = header->next; + inverted_test = 1; + } + + read_len = end->offset - start->offset; + buf = flac_fifo_read(fpc, start->offset, &read_len); + crc = av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, buf, read_len); + read_len = (end->offset - start->offset) - read_len; + + if (read_len) { + buf = flac_fifo_read(fpc, end->offset - read_len, &read_len); + crc = av_crc(av_crc_get_table(AV_CRC_16_ANSI), crc, buf, read_len); + } + } + + if (!crc ^ !inverted_test) { + deduction += FLAC_HEADER_CRC_FAIL_PENALTY; + av_log(fpc->avctx, AV_LOG_WARNING + log_level_offset, + "crc check failed from offset %i (frame %"PRId64") to %i (frame %"PRId64")\n", + header->offset, header_fi->frame_or_sample_num, + child->offset, child_fi->frame_or_sample_num); + } + } + return deduction; +} + +/** + * Score a header. + * + * Give FLAC_HEADER_BASE_SCORE points to a frame for existing. + * If it has children, (subsequent frames of which the preceding CRC footer + * validates against this one,) then take the maximum score of the children, + * with a penalty of FLAC_HEADER_CHANGED_PENALTY applied for each change to + * bps, sample rate, channels, but not decorrelation mode, or blocksize, + * because it can change often. + **/ +static int score_header(FLACParseContext *fpc, FLACHeaderMarker *header) +{ + FLACHeaderMarker *child; + int dist = 0; + int child_score; + + if (header->max_score != FLAC_HEADER_NOT_SCORED_YET) + return header->max_score; + + header->max_score = FLAC_HEADER_BASE_SCORE; + + /* Check and compute the children's scores. */ + child = header->next; + for (dist = 0; dist < FLAC_MAX_SEQUENTIAL_HEADERS && child; dist++) { + /* Look at the child's frame header info and penalize suspicious + changes between the headers. */ + if (header->link_penalty[dist] == FLAC_HEADER_NOT_PENALIZED_YET) { + header->link_penalty[dist] = check_header_mismatch(fpc, header, + child, AV_LOG_DEBUG); + } + child_score = score_header(fpc, child) - header->link_penalty[dist]; + + if (FLAC_HEADER_BASE_SCORE + child_score > header->max_score) { + /* Keep the child because the frame scoring is dynamic. */ + header->best_child = child; + header->max_score = FLAC_HEADER_BASE_SCORE + child_score; + } + child = child->next; + } + + return header->max_score; +} + +static void score_sequences(FLACParseContext *fpc) +{ + FLACHeaderMarker *curr; + int best_score = FLAC_HEADER_NOT_SCORED_YET; + /* First pass to clear all old scores. */ + for (curr = fpc->headers; curr; curr = curr->next) + curr->max_score = FLAC_HEADER_NOT_SCORED_YET; + + /* Do a second pass to score them all. */ + for (curr = fpc->headers; curr; curr = curr->next) { + if (score_header(fpc, curr) > best_score) { + fpc->best_header = curr; + best_score = curr->max_score; + } + } +} + +static int get_best_header(FLACParseContext* fpc, const uint8_t **poutbuf, + int *poutbuf_size) +{ + FLACHeaderMarker *header = fpc->best_header; + FLACHeaderMarker *child = header->best_child; + if (!child) { + *poutbuf_size = av_fifo_size(fpc->fifo_buf) - header->offset; + } else { + *poutbuf_size = child->offset - header->offset; + + /* If the child has suspicious changes, log them */ + check_header_mismatch(fpc, header, child, 0); + } + + fpc->avctx->sample_rate = header->fi.samplerate; + fpc->avctx->channels = header->fi.channels; + fpc->avctx->frame_size = header->fi.blocksize; + *poutbuf = flac_fifo_read_wrap(fpc, header->offset, *poutbuf_size, + &fpc->wrap_buf, + &fpc->wrap_buf_allocated_size); + + fpc->best_header_valid = 0; + /* Return the negative overread index so the client can compute pos. + This should be the amount overread to the beginning of the child */ + if (child) + return child->offset - av_fifo_size(fpc->fifo_buf); + return 0; +} + +static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx, + const uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size) +{ + FLACParseContext *fpc = s->priv_data; + FLACHeaderMarker *curr; + int nb_headers; + const uint8_t *read_end = buf; + const uint8_t *read_start = buf; + + if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) { + FLACFrameInfo fi; + if (frame_header_is_valid(avctx, buf, &fi)) + avctx->frame_size = fi.blocksize; + *poutbuf = buf; + *poutbuf_size = buf_size; + return buf_size; + } + + fpc->avctx = avctx; + if (fpc->best_header_valid) + return get_best_header(fpc, poutbuf, poutbuf_size); + + /* If a best_header was found last call remove it with the buffer data. */ + if (fpc->best_header && fpc->best_header->best_child) { + FLACHeaderMarker *temp; + FLACHeaderMarker *best_child = fpc->best_header->best_child; + + /* Remove headers in list until the end of the best_header. */ + for (curr = fpc->headers; curr != best_child; curr = temp) { + if (curr != fpc->best_header) { + av_log(avctx, AV_LOG_DEBUG, + "dropping low score %i frame header from offset %i to %i\n", + curr->max_score, curr->offset, curr->next->offset); + } + temp = curr->next; + av_freep(&curr->link_penalty); + av_free(curr); + fpc->nb_headers_buffered--; + } + /* Release returned data from ring buffer. */ + av_fifo_drain(fpc->fifo_buf, best_child->offset); + + /* Fix the offset for the headers remaining to match the new buffer. */ + for (curr = best_child->next; curr; curr = curr->next) + curr->offset -= best_child->offset; + + fpc->nb_headers_buffered--; + best_child->offset = 0; + fpc->headers = best_child; + if (fpc->nb_headers_buffered >= FLAC_MIN_HEADERS) { + fpc->best_header = best_child; + return get_best_header(fpc, poutbuf, poutbuf_size); + } + fpc->best_header = NULL; + } else if (fpc->best_header) { + /* No end frame no need to delete the buffer; probably eof */ + FLACHeaderMarker *temp; + + for (curr = fpc->headers; curr != fpc->best_header; curr = temp) { + temp = curr->next; + av_freep(&curr->link_penalty); + av_free(curr); + } + fpc->headers = fpc->best_header->next; + av_freep(&fpc->best_header->link_penalty); + av_freep(&fpc->best_header); + } + + /* Find and score new headers. */ + while ((buf && read_end < buf + buf_size && + fpc->nb_headers_buffered < FLAC_MIN_HEADERS) + || (!buf && !fpc->end_padded)) { + int start_offset; + + /* Pad the end once if EOF, to check the final region for headers. */ + if (!buf) { + fpc->end_padded = 1; + buf_size = MAX_FRAME_HEADER_SIZE; + read_end = read_start + MAX_FRAME_HEADER_SIZE; + } else { + /* The maximum read size is the upper-bound of what the parser + needs to have the required number of frames buffered */ + int nb_desired = FLAC_MIN_HEADERS - fpc->nb_headers_buffered + 1; + read_end = read_end + FFMIN(buf + buf_size - read_end, + nb_desired * FLAC_AVG_FRAME_SIZE); + } + + /* Fill the buffer. */ + if (av_fifo_realloc2(fpc->fifo_buf, + (read_end - read_start) + av_fifo_size(fpc->fifo_buf)) < 0) { + av_log(avctx, AV_LOG_ERROR, + "couldn't reallocate buffer of size %td\n", + (read_end - read_start) + av_fifo_size(fpc->fifo_buf)); + goto handle_error; + } + + if (buf) { + av_fifo_generic_write(fpc->fifo_buf, (void*) read_start, + read_end - read_start, NULL); + } else { + int8_t pad[MAX_FRAME_HEADER_SIZE]; + memset(pad, 0, sizeof(pad)); + av_fifo_generic_write(fpc->fifo_buf, (void*) pad, sizeof(pad), NULL); + } + + /* Tag headers and update sequences. */ + start_offset = av_fifo_size(fpc->fifo_buf) - + ((read_end - read_start) + (MAX_FRAME_HEADER_SIZE - 1)); + start_offset = FFMAX(0, start_offset); + nb_headers = find_new_headers(fpc, start_offset); + + if (nb_headers < 0) { + av_log(avctx, AV_LOG_ERROR, + "find_new_headers couldn't allocate FLAC header\n"); + goto handle_error; + } + + fpc->nb_headers_buffered = nb_headers; + /* Wait till FLAC_MIN_HEADERS to output a valid frame. */ + if (!fpc->end_padded && fpc->nb_headers_buffered < FLAC_MIN_HEADERS) { + if (buf && read_end < buf + buf_size) { + read_start = read_end; + continue; + } else { + goto handle_error; + } + } + + /* If headers found, update the scores since we have longer chains. */ + if (fpc->end_padded || fpc->nb_headers_found) + score_sequences(fpc); + + /* restore the state pre-padding */ + if (fpc->end_padded) { + /* HACK: drain the tail of the fifo */ + fpc->fifo_buf->wptr -= MAX_FRAME_HEADER_SIZE; + fpc->fifo_buf->wndx -= MAX_FRAME_HEADER_SIZE; + if (fpc->fifo_buf->wptr < 0) { + fpc->fifo_buf->wptr += fpc->fifo_buf->end - + fpc->fifo_buf->buffer; + } + buf_size = 0; + read_start = read_end = NULL; + } + } + + curr = fpc->headers; + for (curr = fpc->headers; curr; curr = curr->next) + if (!fpc->best_header || curr->max_score > fpc->best_header->max_score) + fpc->best_header = curr; + + if (fpc->best_header) { + fpc->best_header_valid = 1; + if (fpc->best_header->offset > 0) { + /* Output a junk frame. */ + av_log(avctx, AV_LOG_DEBUG, "Junk frame till offset %i\n", + fpc->best_header->offset); + + /* Set frame_size to 0. It is unknown or invalid in a junk frame. */ + avctx->frame_size = 0; + *poutbuf_size = fpc->best_header->offset; + *poutbuf = flac_fifo_read_wrap(fpc, 0, *poutbuf_size, + &fpc->wrap_buf, + &fpc->wrap_buf_allocated_size); + return buf_size ? (read_end - buf) : (fpc->best_header->offset - + av_fifo_size(fpc->fifo_buf)); + } + if (!buf_size) + return get_best_header(fpc, poutbuf, poutbuf_size); + } + +handle_error: + *poutbuf = NULL; + *poutbuf_size = 0; + return read_end - buf; +} + +static int flac_parse_init(AVCodecParserContext *c) +{ + FLACParseContext *fpc = c->priv_data; + /* There will generally be FLAC_MIN_HEADERS buffered in the fifo before + it drains. This is allocated early to avoid slow reallocation. */ + fpc->fifo_buf = av_fifo_alloc(FLAC_AVG_FRAME_SIZE * (FLAC_MIN_HEADERS + 3)); + return 0; +} + +static void flac_parse_close(AVCodecParserContext *c) +{ + FLACParseContext *fpc = c->priv_data; + FLACHeaderMarker *curr = fpc->headers, *temp; + + while (curr) { + temp = curr->next; + av_freep(&curr->link_penalty); + av_free(curr); + curr = temp; + } + av_fifo_free(fpc->fifo_buf); + av_free(fpc->wrap_buf); +} + +AVCodecParser ff_flac_parser = { + { CODEC_ID_FLAC }, + sizeof(FLACParseContext), + flac_parse_init, + flac_parse, + flac_parse_close, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flv.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flv.h new file mode 100644 index 00000000..eb10f226 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flv.h @@ -0,0 +1,34 @@ +/* + * FLV specific private header. + * 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 + */ + +#ifndef AVCODEC_FLV_H +#define AVCODEC_FLV_H + +#include "mpegvideo.h" +#include "get_bits.h" +#include "put_bits.h" + +void ff_flv_encode_picture_header(MpegEncContext * s, int picture_number); +void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level, int run, int last); + +int ff_flv_decode_picture_header(MpegEncContext *s); +void ff_flv2_decode_ac_esc(GetBitContext *gb, int *level, int *run, int *last); + +#endif + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flvdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flvdec.c new file mode 100644 index 00000000..b1a75781 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flvdec.c @@ -0,0 +1,134 @@ +/* + * FLV decoding. + * 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 + */ + +#include "mpegvideo.h" +#include "h263.h" +#include "flv.h" +#include "libavcore/imgutils.h" + +void ff_flv2_decode_ac_esc(GetBitContext *gb, int *level, int *run, int *last){ + int is11 = get_bits1(gb); + *last = get_bits1(gb); + *run = get_bits(gb, 6); + if(is11){ + *level = get_sbits(gb, 11); + } else { + *level = get_sbits(gb, 7); + } +} + +int ff_flv_decode_picture_header(MpegEncContext *s) +{ + int format, width, height; + + /* picture header */ + if (get_bits_long(&s->gb, 17) != 1) { + av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n"); + return -1; + } + format = get_bits(&s->gb, 5); + if (format != 0 && format != 1) { + av_log(s->avctx, AV_LOG_ERROR, "Bad picture format\n"); + return -1; + } + s->h263_flv = format+1; + s->picture_number = get_bits(&s->gb, 8); /* picture timestamp */ + format = get_bits(&s->gb, 3); + switch (format) { + case 0: + width = get_bits(&s->gb, 8); + height = get_bits(&s->gb, 8); + break; + case 1: + width = get_bits(&s->gb, 16); + height = get_bits(&s->gb, 16); + break; + case 2: + width = 352; + height = 288; + break; + case 3: + width = 176; + height = 144; + break; + case 4: + width = 128; + height = 96; + break; + case 5: + width = 320; + height = 240; + break; + case 6: + width = 160; + height = 120; + break; + default: + width = height = 0; + break; + } + if(av_image_check_size(width, height, 0, s->avctx)) + return -1; + s->width = width; + s->height = height; + + s->pict_type = FF_I_TYPE + get_bits(&s->gb, 2); + s->dropable= s->pict_type > FF_P_TYPE; + if (s->dropable) + s->pict_type = FF_P_TYPE; + + skip_bits1(&s->gb); /* deblocking flag */ + s->chroma_qscale= s->qscale = get_bits(&s->gb, 5); + + s->h263_plus = 0; + + s->unrestricted_mv = 1; + s->h263_long_vectors = 0; + + /* PEI */ + while (get_bits1(&s->gb) != 0) { + skip_bits(&s->gb, 8); + } + s->f_code = 1; + + if(s->avctx->debug & FF_DEBUG_PICT_INFO){ + av_log(s->avctx, AV_LOG_DEBUG, "%c esc_type:%d, qp:%d num:%d\n", + s->dropable ? 'D' : av_get_pict_type_char(s->pict_type), s->h263_flv-1, s->qscale, s->picture_number); + } + + s->y_dc_scale_table= + s->c_dc_scale_table= ff_mpeg1_dc_scale_table; + + return 0; +} + +AVCodec ff_flv_decoder = { + "flv", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_FLV1, + sizeof(MpegEncContext), + ff_h263_decode_init, + NULL, + ff_h263_decode_end, + ff_h263_decode_frame, + CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1, + .max_lowres= 3, + .long_name= NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"), + .pix_fmts= ff_pixfmt_list_420, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flvenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flvenc.c new file mode 100644 index 00000000..5e81dcb1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/flvenc.c @@ -0,0 +1,97 @@ +/* + * FLV Encoding specific code. + * 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 + */ + +#include "mpegvideo.h" +#include "h263.h" +#include "flv.h" + +void ff_flv_encode_picture_header(MpegEncContext * s, int picture_number) +{ + int format; + + align_put_bits(&s->pb); + + put_bits(&s->pb, 17, 1); + put_bits(&s->pb, 5, (s->h263_flv-1)); /* 0: h263 escape codes 1: 11-bit escape codes */ + put_bits(&s->pb, 8, (((int64_t)s->picture_number * 30 * s->avctx->time_base.num) / //FIXME use timestamp + s->avctx->time_base.den) & 0xff); /* TemporalReference */ + if (s->width == 352 && s->height == 288) + format = 2; + else if (s->width == 176 && s->height == 144) + format = 3; + else if (s->width == 128 && s->height == 96) + format = 4; + else if (s->width == 320 && s->height == 240) + format = 5; + else if (s->width == 160 && s->height == 120) + format = 6; + else if (s->width <= 255 && s->height <= 255) + format = 0; /* use 1 byte width & height */ + else + format = 1; /* use 2 bytes width & height */ + put_bits(&s->pb, 3, format); /* PictureSize */ + if (format == 0) { + put_bits(&s->pb, 8, s->width); + put_bits(&s->pb, 8, s->height); + } else if (format == 1) { + put_bits(&s->pb, 16, s->width); + put_bits(&s->pb, 16, s->height); + } + put_bits(&s->pb, 2, s->pict_type == FF_P_TYPE); /* PictureType */ + put_bits(&s->pb, 1, 1); /* DeblockingFlag: on */ + put_bits(&s->pb, 5, s->qscale); /* Quantizer */ + put_bits(&s->pb, 1, 0); /* ExtraInformation */ + + if(s->h263_aic){ + s->y_dc_scale_table= + s->c_dc_scale_table= ff_aic_dc_scale_table; + }else{ + s->y_dc_scale_table= + s->c_dc_scale_table= ff_mpeg1_dc_scale_table; + } +} + +void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level, int run, int last){ + if(level < 64) { // 7-bit level + put_bits(pb, 1, 0); + put_bits(pb, 1, last); + put_bits(pb, 6, run); + + put_sbits(pb, 7, slevel); + } else { + /* 11-bit level */ + put_bits(pb, 1, 1); + put_bits(pb, 1, last); + put_bits(pb, 6, run); + + put_sbits(pb, 11, slevel); + } +} + +AVCodec ff_flv_encoder = { + "flv", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_FLV1, + sizeof(MpegEncContext), + MPV_encode_init, + MPV_encode_picture, + MPV_encode_end, + .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, + .long_name= NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fmtconvert.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fmtconvert.c new file mode 100644 index 00000000..e26b8997 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fmtconvert.c @@ -0,0 +1,68 @@ +/* + * Format Conversion Utils + * Copyright (c) 2000, 2001 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + */ + +#include "avcodec.h" +#include "fmtconvert.h" + +static void int32_to_float_fmul_scalar_c(float *dst, const int *src, float mul, int len){ + int i; + for(i=0; iint32_to_float_fmul_scalar = int32_to_float_fmul_scalar_c; + c->float_to_int16 = float_to_int16_c; + c->float_to_int16_interleave = float_to_int16_interleave_c; + + if (ARCH_ARM) ff_fmt_convert_init_arm(c, avctx); + if (ARCH_PPC) ff_fmt_convert_init_ppc(c, avctx); + if (HAVE_MMX) ff_fmt_convert_init_x86(c, avctx); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fmtconvert.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fmtconvert.h new file mode 100644 index 00000000..f2ee261f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/fmtconvert.h @@ -0,0 +1,79 @@ +/* + * Format Conversion Utils + * Copyright (c) 2000, 2001 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + */ + +#ifndef AVCODEC_FMTCONVERT_H +#define AVCODEC_FMTCONVERT_H + +#include "avcodec.h" + +typedef struct FmtConvertContext { + /** + * Convert an array of int32_t to float and multiply by a float value. + * @param dst destination array of float. + * constraints: 16-byte aligned + * @param src source array of int32_t. + * constraints: 16-byte aligned + * @param len number of elements to convert. + * constraints: multiple of 8 + */ + void (*int32_to_float_fmul_scalar)(float *dst, const int *src, float mul, int len); + + /** + * Convert an array of float to an array of int16_t. + * + * Convert floats from in the range [-32768.0,32767.0] to ints + * without rescaling + * + * @param dst destination array of int16_t. + * constraints: 16-byte aligned + * @param src source array of float. + * constraints: 16-byte aligned + * @param len number of elements to convert. + * constraints: multiple of 8 + */ + void (*float_to_int16)(int16_t *dst, const float *src, long len); + + /** + * Convert multiple arrays of float to an interleaved array of int16_t. + * + * Convert floats from in the range [-32768.0,32767.0] to ints + * without rescaling + * + * @param dst destination array of interleaved int16_t. + * constraints: 16-byte aligned + * @param src source array of float arrays, one for each channel. + * constraints: 16-byte aligned + * @param len number of elements to convert. + * constraints: multiple of 8 + * @param channels number of channels + */ + void (*float_to_int16_interleave)(int16_t *dst, const float **src, + long len, int channels); +} FmtConvertContext; + +void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx); + +void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx); +void ff_fmt_convert_init_ppc(FmtConvertContext *c, AVCodecContext *avctx); +void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx); + +#endif /* AVCODEC_FMTCONVERT_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/frwu.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/frwu.c new file mode 100644 index 00000000..306166bd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/frwu.c @@ -0,0 +1,123 @@ +/* + * Forward Uncompressed + * + * Copyright (c) 2009 Reimar DÃķffinger + * + * 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 + */ + +#include "avcodec.h" +#include "bytestream.h" +#include "libavutil/intreadwrite.h" + +static av_cold int decode_init(AVCodecContext *avctx) +{ + if (avctx->width & 1) { + av_log(avctx, AV_LOG_ERROR, "FRWU needs even width\n"); + return -1; + } + avctx->pix_fmt = PIX_FMT_UYVY422; + + avctx->coded_frame = avcodec_alloc_frame(); + + return 0; +} + +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, + AVPacket *avpkt) +{ + int field; + AVFrame *pic = avctx->coded_frame; + const uint8_t *buf = avpkt->data; + const uint8_t *buf_end = buf + avpkt->size; + + if (pic->data[0]) + avctx->release_buffer(avctx, pic); + + if (avpkt->size < avctx->width * 2 * avctx->height + 4 + 2*8) { + av_log(avctx, AV_LOG_ERROR, "Packet is too small.\n"); + return -1; + } + if (bytestream_get_le32(&buf) != AV_RL32("FRW1")) { + av_log(avctx, AV_LOG_ERROR, "incorrect marker\n"); + return -1; + } + + pic->reference = 0; + if (avctx->get_buffer(avctx, pic) < 0) + return -1; + + pic->pict_type = FF_I_TYPE; + pic->key_frame = 1; + pic->interlaced_frame = 1; + pic->top_field_first = 1; + + for (field = 0; field < 2; field++) { + int i; + int field_h = (avctx->height + !field) >> 1; + int field_size, min_field_size = avctx->width * 2 * field_h; + uint8_t *dst = pic->data[0]; + if (buf_end - buf < 8) + return -1; + buf += 4; // flags? 0x80 == bottom field maybe? + field_size = bytestream_get_le32(&buf); + if (field_size < min_field_size) { + av_log(avctx, AV_LOG_ERROR, "Field size %i is too small (required %i)\n", field_size, min_field_size); + return -1; + } + if (buf_end - buf < field_size) { + av_log(avctx, AV_LOG_ERROR, "Packet is too small, need %i, have %i\n", field_size, (int)(buf_end - buf)); + return -1; + } + if (field) + dst += pic->linesize[0]; + for (i = 0; i < field_h; i++) { + memcpy(dst, buf, avctx->width * 2); + buf += avctx->width * 2; + dst += pic->linesize[0] << 1; + } + buf += field_size - min_field_size; + } + + *data_size = sizeof(AVFrame); + *(AVFrame*)data = *pic; + + return avpkt->size; +} + +static av_cold int decode_close(AVCodecContext *avctx) +{ + AVFrame *pic = avctx->coded_frame; + if (pic->data[0]) + avctx->release_buffer(avctx, pic); + av_freep(&avctx->coded_frame); + + return 0; +} + +AVCodec ff_frwu_decoder = { + "FRWU", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_FRWU, + 0, + decode_init, + NULL, + decode_close, + decode_frame, + CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("Forward Uncompressed"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/g722.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/g722.c new file mode 100644 index 00000000..0efc390a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/g722.c @@ -0,0 +1,583 @@ +/* + * G.722 ADPCM audio encoder/decoder + * + * Copyright (c) CMU 1993 Computer Science, Speech Group + * Chengxiang Lu and Alex Hauptmann + * Copyright (c) 2005 Steve Underwood + * Copyright (c) 2009 Kenan Gillet + * Copyright (c) 2010 Martin Storsjo + * + * 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 + * + * G.722 ADPCM audio codec + * + * This G.722 decoder is a bit-exact implementation of the ITU G.722 + * specification for all three specified bitrates - 64000bps, 56000bps + * and 48000bps. It passes the ITU tests. + * + * @note For the 56000bps and 48000bps bitrates, the lowest 1 or 2 bits + * respectively of each byte are ignored. + */ + +#include "avcodec.h" +#include "mathops.h" +#include "get_bits.h" + +#define PREV_SAMPLES_BUF_SIZE 1024 + +#define FREEZE_INTERVAL 128 + +typedef struct { + int16_t prev_samples[PREV_SAMPLES_BUF_SIZE]; ///< memory of past decoded samples + int prev_samples_pos; ///< the number of values in prev_samples + + /** + * The band[0] and band[1] correspond respectively to the lower band and higher band. + */ + struct G722Band { + int16_t s_predictor; ///< predictor output value + int32_t s_zero; ///< previous output signal from zero predictor + int8_t part_reconst_mem[2]; ///< signs of previous partially reconstructed signals + int16_t prev_qtzd_reconst; ///< previous quantized reconstructed signal (internal value, using low_inv_quant4) + int16_t pole_mem[2]; ///< second-order pole section coefficient buffer + int32_t diff_mem[6]; ///< quantizer difference signal memory + int16_t zero_mem[6]; ///< Seventh-order zero section coefficient buffer + int16_t log_factor; ///< delayed 2-logarithmic quantizer factor + int16_t scale_factor; ///< delayed quantizer scale factor + } band[2]; + + struct TrellisNode { + struct G722Band state; + uint32_t ssd; + int path; + } *node_buf[2], **nodep_buf[2]; + + struct TrellisPath { + int value; + int prev; + } *paths[2]; +} G722Context; + + +static const int8_t sign_lookup[2] = { -1, 1 }; + +static const int16_t inv_log2_table[32] = { + 2048, 2093, 2139, 2186, 2233, 2282, 2332, 2383, + 2435, 2489, 2543, 2599, 2656, 2714, 2774, 2834, + 2896, 2960, 3025, 3091, 3158, 3228, 3298, 3371, + 3444, 3520, 3597, 3676, 3756, 3838, 3922, 4008 +}; +static const int16_t high_log_factor_step[2] = { 798, -214 }; +static const int16_t high_inv_quant[4] = { -926, -202, 926, 202 }; +/** + * low_log_factor_step[index] == wl[rl42[index]] + */ +static const int16_t low_log_factor_step[16] = { + -60, 3042, 1198, 538, 334, 172, 58, -30, + 3042, 1198, 538, 334, 172, 58, -30, -60 +}; +static const int16_t low_inv_quant4[16] = { + 0, -2557, -1612, -1121, -786, -530, -323, -150, + 2557, 1612, 1121, 786, 530, 323, 150, 0 +}; +static const int16_t low_inv_quant6[64] = { + -17, -17, -17, -17, -3101, -2738, -2376, -2088, + -1873, -1689, -1535, -1399, -1279, -1170, -1072, -982, + -899, -822, -750, -682, -618, -558, -501, -447, + -396, -347, -300, -254, -211, -170, -130, -91, + 3101, 2738, 2376, 2088, 1873, 1689, 1535, 1399, + 1279, 1170, 1072, 982, 899, 822, 750, 682, + 618, 558, 501, 447, 396, 347, 300, 254, + 211, 170, 130, 91, 54, 17, -54, -17 +}; + +/** + * quadrature mirror filter (QMF) coefficients + * + * ITU-T G.722 Table 11 + */ +static const int16_t qmf_coeffs[12] = { + 3, -11, 12, 32, -210, 951, 3876, -805, 362, -156, 53, -11, +}; + + +/** + * adaptive predictor + * + * @param cur_diff the dequantized and scaled delta calculated from the + * current codeword + */ +static void do_adaptive_prediction(struct G722Band *band, const int cur_diff) +{ + int sg[2], limit, i, cur_qtzd_reconst; + + const int cur_part_reconst = band->s_zero + cur_diff < 0; + + sg[0] = sign_lookup[cur_part_reconst != band->part_reconst_mem[0]]; + sg[1] = sign_lookup[cur_part_reconst == band->part_reconst_mem[1]]; + band->part_reconst_mem[1] = band->part_reconst_mem[0]; + band->part_reconst_mem[0] = cur_part_reconst; + + band->pole_mem[1] = av_clip((sg[0] * av_clip(band->pole_mem[0], -8191, 8191) >> 5) + + (sg[1] << 7) + (band->pole_mem[1] * 127 >> 7), -12288, 12288); + + limit = 15360 - band->pole_mem[1]; + band->pole_mem[0] = av_clip(-192 * sg[0] + (band->pole_mem[0] * 255 >> 8), -limit, limit); + + + if (cur_diff) { + for (i = 0; i < 6; i++) + band->zero_mem[i] = ((band->zero_mem[i]*255) >> 8) + + ((band->diff_mem[i]^cur_diff) < 0 ? -128 : 128); + } else + for (i = 0; i < 6; i++) + band->zero_mem[i] = (band->zero_mem[i]*255) >> 8; + + for (i = 5; i > 0; i--) + band->diff_mem[i] = band->diff_mem[i-1]; + band->diff_mem[0] = av_clip_int16(cur_diff << 1); + + band->s_zero = 0; + for (i = 5; i >= 0; i--) + band->s_zero += (band->zero_mem[i]*band->diff_mem[i]) >> 15; + + + cur_qtzd_reconst = av_clip_int16((band->s_predictor + cur_diff) << 1); + band->s_predictor = av_clip_int16(band->s_zero + + (band->pole_mem[0] * cur_qtzd_reconst >> 15) + + (band->pole_mem[1] * band->prev_qtzd_reconst >> 15)); + band->prev_qtzd_reconst = cur_qtzd_reconst; +} + +static int inline linear_scale_factor(const int log_factor) +{ + const int wd1 = inv_log2_table[(log_factor >> 6) & 31]; + const int shift = log_factor >> 11; + return shift < 0 ? wd1 >> -shift : wd1 << shift; +} + +static void update_low_predictor(struct G722Band *band, const int ilow) +{ + do_adaptive_prediction(band, + band->scale_factor * low_inv_quant4[ilow] >> 10); + + // quantizer adaptation + band->log_factor = av_clip((band->log_factor * 127 >> 7) + + low_log_factor_step[ilow], 0, 18432); + band->scale_factor = linear_scale_factor(band->log_factor - (8 << 11)); +} + +static void update_high_predictor(struct G722Band *band, const int dhigh, + const int ihigh) +{ + do_adaptive_prediction(band, dhigh); + + // quantizer adaptation + band->log_factor = av_clip((band->log_factor * 127 >> 7) + + high_log_factor_step[ihigh&1], 0, 22528); + band->scale_factor = linear_scale_factor(band->log_factor - (10 << 11)); +} + +static void apply_qmf(const int16_t *prev_samples, int *xout1, int *xout2) +{ + int i; + + *xout1 = 0; + *xout2 = 0; + for (i = 0; i < 12; i++) { + MAC16(*xout2, prev_samples[2*i ], qmf_coeffs[i ]); + MAC16(*xout1, prev_samples[2*i+1], qmf_coeffs[11-i]); + } +} + +static av_cold int g722_init(AVCodecContext * avctx) +{ + G722Context *c = avctx->priv_data; + + if (avctx->channels != 1) { + av_log(avctx, AV_LOG_ERROR, "Only mono tracks are allowed.\n"); + return AVERROR_INVALIDDATA; + } + avctx->sample_fmt = AV_SAMPLE_FMT_S16; + + switch (avctx->bits_per_coded_sample) { + case 8: + case 7: + case 6: + break; + default: + av_log(avctx, AV_LOG_WARNING, "Unsupported bits_per_coded_sample [%d], " + "assuming 8\n", + avctx->bits_per_coded_sample); + case 0: + avctx->bits_per_coded_sample = 8; + break; + } + + c->band[0].scale_factor = 8; + c->band[1].scale_factor = 2; + c->prev_samples_pos = 22; + + if (avctx->lowres) + avctx->sample_rate /= 2; + + if (avctx->trellis) { + int frontier = 1 << avctx->trellis; + int max_paths = frontier * FREEZE_INTERVAL; + int i; + for (i = 0; i < 2; i++) { + c->paths[i] = av_mallocz(max_paths * sizeof(**c->paths)); + c->node_buf[i] = av_mallocz(2 * frontier * sizeof(**c->node_buf)); + c->nodep_buf[i] = av_mallocz(2 * frontier * sizeof(**c->nodep_buf)); + } + } + + return 0; +} + +static av_cold int g722_close(AVCodecContext *avctx) +{ + G722Context *c = avctx->priv_data; + int i; + for (i = 0; i < 2; i++) { + av_freep(&c->paths[i]); + av_freep(&c->node_buf[i]); + av_freep(&c->nodep_buf[i]); + } + return 0; +} + +#if CONFIG_ADPCM_G722_DECODER +static const int16_t low_inv_quant5[32] = { + -35, -35, -2919, -2195, -1765, -1458, -1219, -1023, + -858, -714, -587, -473, -370, -276, -190, -110, + 2919, 2195, 1765, 1458, 1219, 1023, 858, 714, + 587, 473, 370, 276, 190, 110, 35, -35 +}; + +static const int16_t *low_inv_quants[3] = { low_inv_quant6, low_inv_quant5, + low_inv_quant4 }; + +static int g722_decode_frame(AVCodecContext *avctx, void *data, + int *data_size, AVPacket *avpkt) +{ + G722Context *c = avctx->priv_data; + int16_t *out_buf = data; + int j, out_len = 0; + const int skip = 8 - avctx->bits_per_coded_sample; + const int16_t *quantizer_table = low_inv_quants[skip]; + GetBitContext gb; + + init_get_bits(&gb, avpkt->data, avpkt->size * 8); + + for (j = 0; j < avpkt->size; j++) { + int ilow, ihigh, rlow; + + ihigh = get_bits(&gb, 2); + ilow = get_bits(&gb, 6 - skip); + skip_bits(&gb, skip); + + rlow = av_clip((c->band[0].scale_factor * quantizer_table[ilow] >> 10) + + c->band[0].s_predictor, -16384, 16383); + + update_low_predictor(&c->band[0], ilow >> (2 - skip)); + + if (!avctx->lowres) { + const int dhigh = c->band[1].scale_factor * + high_inv_quant[ihigh] >> 10; + const int rhigh = av_clip(dhigh + c->band[1].s_predictor, + -16384, 16383); + int xout1, xout2; + + update_high_predictor(&c->band[1], dhigh, ihigh); + + c->prev_samples[c->prev_samples_pos++] = rlow + rhigh; + c->prev_samples[c->prev_samples_pos++] = rlow - rhigh; + apply_qmf(c->prev_samples + c->prev_samples_pos - 24, + &xout1, &xout2); + out_buf[out_len++] = av_clip_int16(xout1 >> 12); + out_buf[out_len++] = av_clip_int16(xout2 >> 12); + if (c->prev_samples_pos >= PREV_SAMPLES_BUF_SIZE) { + memmove(c->prev_samples, + c->prev_samples + c->prev_samples_pos - 22, + 22 * sizeof(c->prev_samples[0])); + c->prev_samples_pos = 22; + } + } else + out_buf[out_len++] = rlow; + } + *data_size = out_len << 1; + return avpkt->size; +} + +AVCodec ff_adpcm_g722_decoder = { + .name = "g722", + .type = AVMEDIA_TYPE_AUDIO, + .id = CODEC_ID_ADPCM_G722, + .priv_data_size = sizeof(G722Context), + .init = g722_init, + .decode = g722_decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"), + .max_lowres = 1, +}; +#endif + +#if CONFIG_ADPCM_G722_ENCODER +static const int16_t low_quant[33] = { + 35, 72, 110, 150, 190, 233, 276, 323, + 370, 422, 473, 530, 587, 650, 714, 786, + 858, 940, 1023, 1121, 1219, 1339, 1458, 1612, + 1765, 1980, 2195, 2557, 2919 +}; + +static inline void filter_samples(G722Context *c, const int16_t *samples, + int *xlow, int *xhigh) +{ + int xout1, xout2; + c->prev_samples[c->prev_samples_pos++] = samples[0]; + c->prev_samples[c->prev_samples_pos++] = samples[1]; + apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2); + *xlow = xout1 + xout2 >> 13; + *xhigh = xout1 - xout2 >> 13; + if (c->prev_samples_pos >= PREV_SAMPLES_BUF_SIZE) { + memmove(c->prev_samples, + c->prev_samples + c->prev_samples_pos - 22, + 22 * sizeof(c->prev_samples[0])); + c->prev_samples_pos = 22; + } +} + +static inline int encode_high(const struct G722Band *state, int xhigh) +{ + int diff = av_clip_int16(xhigh - state->s_predictor); + int pred = 141 * state->scale_factor >> 8; + /* = diff >= 0 ? (diff < pred) + 2 : diff >= -pred */ + return ((diff ^ (diff >> (sizeof(diff)*8-1))) < pred) + 2*(diff >= 0); +} + +static inline int encode_low(const struct G722Band* state, int xlow) +{ + int diff = av_clip_int16(xlow - state->s_predictor); + /* = diff >= 0 ? diff : -(diff + 1) */ + int limit = diff ^ (diff >> (sizeof(diff)*8-1)); + int i = 0; + limit = limit + 1 << 10; + if (limit > low_quant[8] * state->scale_factor) + i = 9; + while (i < 29 && limit > low_quant[i] * state->scale_factor) + i++; + return (diff < 0 ? (i < 2 ? 63 : 33) : 61) - i; +} + +static int g722_encode_trellis(AVCodecContext *avctx, + uint8_t *dst, int buf_size, void *data) +{ + G722Context *c = avctx->priv_data; + const int16_t *samples = data; + int i, j, k; + int frontier = 1 << avctx->trellis; + struct TrellisNode **nodes[2]; + struct TrellisNode **nodes_next[2]; + int pathn[2] = {0, 0}, froze = -1; + struct TrellisPath *p[2]; + + for (i = 0; i < 2; i++) { + nodes[i] = c->nodep_buf[i]; + nodes_next[i] = c->nodep_buf[i] + frontier; + memset(c->nodep_buf[i], 0, 2 * frontier * sizeof(*c->nodep_buf)); + nodes[i][0] = c->node_buf[i] + frontier; + nodes[i][0]->ssd = 0; + nodes[i][0]->path = 0; + nodes[i][0]->state = c->band[i]; + } + + for (i = 0; i < buf_size >> 1; i++) { + int xlow, xhigh; + struct TrellisNode *next[2]; + int heap_pos[2] = {0, 0}; + + for (j = 0; j < 2; j++) { + next[j] = c->node_buf[j] + frontier*(i & 1); + memset(nodes_next[j], 0, frontier * sizeof(**nodes_next)); + } + + filter_samples(c, &samples[2*i], &xlow, &xhigh); + + for (j = 0; j < frontier && nodes[0][j]; j++) { + /* Only k >> 2 affects the future adaptive state, therefore testing + * small steps that don't change k >> 2 is useless, the orignal + * value from encode_low is better than them. Since we step k + * in steps of 4, make sure range is a multiple of 4, so that + * we don't miss the original value from encode_low. */ + int range = j < frontier/2 ? 4 : 0; + struct TrellisNode *cur_node = nodes[0][j]; + + int ilow = encode_low(&cur_node->state, xlow); + + for (k = ilow - range; k <= ilow + range && k <= 63; k += 4) { + int decoded, dec_diff, pos; + uint32_t ssd; + struct TrellisNode* node; + + if (k < 0) + continue; + + decoded = av_clip((cur_node->state.scale_factor * + low_inv_quant6[k] >> 10) + + cur_node->state.s_predictor, -16384, 16383); + dec_diff = xlow - decoded; + +#define STORE_NODE(index, UPDATE, VALUE)\ + ssd = cur_node->ssd + dec_diff*dec_diff;\ + /* Check for wraparound. Using 64 bit ssd counters would \ + * be simpler, but is slower on x86 32 bit. */\ + if (ssd < cur_node->ssd)\ + continue;\ + if (heap_pos[index] < frontier) {\ + pos = heap_pos[index]++;\ + assert(pathn[index] < FREEZE_INTERVAL * frontier);\ + node = nodes_next[index][pos] = next[index]++;\ + node->path = pathn[index]++;\ + } else {\ + /* Try to replace one of the leaf nodes with the new \ + * one, but not always testing the same leaf position */\ + pos = (frontier>>1) + (heap_pos[index] & ((frontier>>1) - 1));\ + if (ssd >= nodes_next[index][pos]->ssd)\ + continue;\ + heap_pos[index]++;\ + node = nodes_next[index][pos];\ + }\ + node->ssd = ssd;\ + node->state = cur_node->state;\ + UPDATE;\ + c->paths[index][node->path].value = VALUE;\ + c->paths[index][node->path].prev = cur_node->path;\ + /* Sift the newly inserted node up in the heap to restore \ + * the heap property */\ + while (pos > 0) {\ + int parent = (pos - 1) >> 1;\ + if (nodes_next[index][parent]->ssd <= ssd)\ + break;\ + FFSWAP(struct TrellisNode*, nodes_next[index][parent],\ + nodes_next[index][pos]);\ + pos = parent;\ + } + STORE_NODE(0, update_low_predictor(&node->state, k >> 2), k); + } + } + + for (j = 0; j < frontier && nodes[1][j]; j++) { + int ihigh; + struct TrellisNode *cur_node = nodes[1][j]; + + /* We don't try to get any initial guess for ihigh via + * encode_high - since there's only 4 possible values, test + * them all. Testing all of these gives a much, much larger + * gain than testing a larger range around ilow. */ + for (ihigh = 0; ihigh < 4; ihigh++) { + int dhigh, decoded, dec_diff, pos; + uint32_t ssd; + struct TrellisNode* node; + + dhigh = cur_node->state.scale_factor * + high_inv_quant[ihigh] >> 10; + decoded = av_clip(dhigh + cur_node->state.s_predictor, + -16384, 16383); + dec_diff = xhigh - decoded; + + STORE_NODE(1, update_high_predictor(&node->state, dhigh, ihigh), ihigh); + } + } + + for (j = 0; j < 2; j++) { + FFSWAP(struct TrellisNode**, nodes[j], nodes_next[j]); + + if (nodes[j][0]->ssd > (1 << 16)) { + for (k = 1; k < frontier && nodes[j][k]; k++) + nodes[j][k]->ssd -= nodes[j][0]->ssd; + nodes[j][0]->ssd = 0; + } + } + + if (i == froze + FREEZE_INTERVAL) { + p[0] = &c->paths[0][nodes[0][0]->path]; + p[1] = &c->paths[1][nodes[1][0]->path]; + for (j = i; j > froze; j--) { + dst[j] = p[1]->value << 6 | p[0]->value; + p[0] = &c->paths[0][p[0]->prev]; + p[1] = &c->paths[1][p[1]->prev]; + } + froze = i; + pathn[0] = pathn[1] = 0; + memset(nodes[0] + 1, 0, (frontier - 1)*sizeof(**nodes)); + memset(nodes[1] + 1, 0, (frontier - 1)*sizeof(**nodes)); + } + } + + p[0] = &c->paths[0][nodes[0][0]->path]; + p[1] = &c->paths[1][nodes[1][0]->path]; + for (j = i; j > froze; j--) { + dst[j] = p[1]->value << 6 | p[0]->value; + p[0] = &c->paths[0][p[0]->prev]; + p[1] = &c->paths[1][p[1]->prev]; + } + c->band[0] = nodes[0][0]->state; + c->band[1] = nodes[1][0]->state; + + return i; +} + +static int g722_encode_frame(AVCodecContext *avctx, + uint8_t *dst, int buf_size, void *data) +{ + G722Context *c = avctx->priv_data; + const int16_t *samples = data; + int i; + + if (avctx->trellis) + return g722_encode_trellis(avctx, dst, buf_size, data); + + for (i = 0; i < buf_size >> 1; i++) { + int xlow, xhigh, ihigh, ilow; + filter_samples(c, &samples[2*i], &xlow, &xhigh); + ihigh = encode_high(&c->band[1], xhigh); + ilow = encode_low(&c->band[0], xlow); + update_high_predictor(&c->band[1], c->band[1].scale_factor * + high_inv_quant[ihigh] >> 10, ihigh); + update_low_predictor(&c->band[0], ilow >> 2); + *dst++ = ihigh << 6 | ilow; + } + return i; +} + +AVCodec ff_adpcm_g722_encoder = { + .name = "g722", + .type = AVMEDIA_TYPE_AUDIO, + .id = CODEC_ID_ADPCM_G722, + .priv_data_size = sizeof(G722Context), + .init = g722_init, + .close = g722_close, + .encode = g722_encode_frame, + .long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"), + .sample_fmts = (enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE}, +}; +#endif + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gsmdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gsmdec.c new file mode 100644 index 00000000..4ce36b48 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gsmdec.c @@ -0,0 +1,109 @@ +/* + * gsm 06.10 decoder + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + * GSM decoder + */ + +#include "avcodec.h" +#include "get_bits.h" +#include "msgsmdec.h" + +#include "gsmdec_template.c" + +static av_cold int gsm_init(AVCodecContext *avctx) +{ + avctx->channels = 1; + if (!avctx->sample_rate) + avctx->sample_rate = 8000; + avctx->sample_fmt = AV_SAMPLE_FMT_S16; + + switch (avctx->codec_id) { + case CODEC_ID_GSM: + avctx->frame_size = GSM_FRAME_SIZE; + avctx->block_align = GSM_BLOCK_SIZE; + break; + case CODEC_ID_GSM_MS: + avctx->frame_size = 2 * GSM_FRAME_SIZE; + avctx->block_align = GSM_MS_BLOCK_SIZE; + } + + return 0; +} + +static int gsm_decode_frame(AVCodecContext *avctx, void *data, + int *data_size, AVPacket *avpkt) +{ + int res; + GetBitContext gb; + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + int16_t *samples = data; + int frame_bytes = 2 * avctx->frame_size; + + if (*data_size < frame_bytes) + return -1; + *data_size = 0; + if(buf_size < avctx->block_align) + return AVERROR_INVALIDDATA; + + switch (avctx->codec_id) { + case CODEC_ID_GSM: + init_get_bits(&gb, buf, buf_size * 8); + if (get_bits(&gb, 4) != 0xd) + av_log(avctx, AV_LOG_WARNING, "Missing GSM magic!\n"); + res = gsm_decode_block(avctx, samples, &gb); + if (res < 0) + return res; + break; + case CODEC_ID_GSM_MS: + res = ff_msgsm_decode_block(avctx, samples, buf); + if (res < 0) + return res; + } + *data_size = frame_bytes; + return avctx->block_align; +} + +AVCodec ff_gsm_decoder = { + "gsm", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_GSM, + sizeof(GSMContext), + gsm_init, + NULL, + NULL, + gsm_decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("GSM"), +}; + +AVCodec ff_gsm_ms_decoder = { + "gsm_ms", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_GSM_MS, + sizeof(GSMContext), + gsm_init, + NULL, + NULL, + gsm_decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("GSM Microsoft variant"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gsmdec_data.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gsmdec_data.c new file mode 100644 index 00000000..4324ea28 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gsmdec_data.c @@ -0,0 +1,94 @@ +/* + * gsm 06.10 decoder data + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + */ + +#include +#include "gsmdec_data.h" + +const uint16_t ff_gsm_long_term_gain_tab[4] = { + 3277, 11469, 21299, 32767 +}; + +const int16_t ff_gsm_dequant_tab[64][8] = { + { -28, -20, -12, -4, 4, 12, 20, 28}, + { -56, -40, -24, -8, 8, 24, 40, 56}, + { -84, -60, -36, -12, 12, 36, 60, 84}, + { -112, -80, -48, -16, 16, 48, 80, 112}, + { -140, -100, -60, -20, 20, 60, 100, 140}, + { -168, -120, -72, -24, 24, 72, 120, 168}, + { -196, -140, -84, -28, 28, 84, 140, 196}, + { -224, -160, -96, -32, 32, 96, 160, 224}, + { -252, -180, -108, -36, 36, 108, 180, 252}, + { -280, -200, -120, -40, 40, 120, 200, 280}, + { -308, -220, -132, -44, 44, 132, 220, 308}, + { -336, -240, -144, -48, 48, 144, 240, 336}, + { -364, -260, -156, -52, 52, 156, 260, 364}, + { -392, -280, -168, -56, 56, 168, 280, 392}, + { -420, -300, -180, -60, 60, 180, 300, 420}, + { -448, -320, -192, -64, 64, 192, 320, 448}, + { -504, -360, -216, -72, 72, 216, 360, 504}, + { -560, -400, -240, -80, 80, 240, 400, 560}, + { -616, -440, -264, -88, 88, 264, 440, 616}, + { -672, -480, -288, -96, 96, 288, 480, 672}, + { -728, -520, -312, -104, 104, 312, 520, 728}, + { -784, -560, -336, -112, 112, 336, 560, 784}, + { -840, -600, -360, -120, 120, 360, 600, 840}, + { -896, -640, -384, -128, 128, 384, 640, 896}, + { -1008, -720, -432, -144, 144, 432, 720, 1008}, + { -1120, -800, -480, -160, 160, 480, 800, 1120}, + { -1232, -880, -528, -176, 176, 528, 880, 1232}, + { -1344, -960, -576, -192, 192, 576, 960, 1344}, + { -1456, -1040, -624, -208, 208, 624, 1040, 1456}, + { -1568, -1120, -672, -224, 224, 672, 1120, 1568}, + { -1680, -1200, -720, -240, 240, 720, 1200, 1680}, + { -1792, -1280, -768, -256, 256, 768, 1280, 1792}, + { -2016, -1440, -864, -288, 288, 864, 1440, 2016}, + { -2240, -1600, -960, -320, 320, 960, 1600, 2240}, + { -2464, -1760, -1056, -352, 352, 1056, 1760, 2464}, + { -2688, -1920, -1152, -384, 384, 1152, 1920, 2688}, + { -2912, -2080, -1248, -416, 416, 1248, 2080, 2912}, + { -3136, -2240, -1344, -448, 448, 1344, 2240, 3136}, + { -3360, -2400, -1440, -480, 480, 1440, 2400, 3360}, + { -3584, -2560, -1536, -512, 512, 1536, 2560, 3584}, + { -4032, -2880, -1728, -576, 576, 1728, 2880, 4032}, + { -4480, -3200, -1920, -640, 640, 1920, 3200, 4480}, + { -4928, -3520, -2112, -704, 704, 2112, 3520, 4928}, + { -5376, -3840, -2304, -768, 768, 2304, 3840, 5376}, + { -5824, -4160, -2496, -832, 832, 2496, 4160, 5824}, + { -6272, -4480, -2688, -896, 896, 2688, 4480, 6272}, + { -6720, -4800, -2880, -960, 960, 2880, 4800, 6720}, + { -7168, -5120, -3072, -1024, 1024, 3072, 5120, 7168}, + { -8063, -5759, -3456, -1152, 1152, 3456, 5760, 8064}, + { -8959, -6399, -3840, -1280, 1280, 3840, 6400, 8960}, + { -9855, -7039, -4224, -1408, 1408, 4224, 7040, 9856}, + {-10751, -7679, -4608, -1536, 1536, 4608, 7680, 10752}, + {-11647, -8319, -4992, -1664, 1664, 4992, 8320, 11648}, + {-12543, -8959, -5376, -1792, 1792, 5376, 8960, 12544}, + {-13439, -9599, -5760, -1920, 1920, 5760, 9600, 13440}, + {-14335, -10239, -6144, -2048, 2048, 6144, 10240, 14336}, + {-16127, -11519, -6912, -2304, 2304, 6912, 11519, 16127}, + {-17919, -12799, -7680, -2560, 2560, 7680, 12799, 17919}, + {-19711, -14079, -8448, -2816, 2816, 8448, 14079, 19711}, + {-21503, -15359, -9216, -3072, 3072, 9216, 15359, 21503}, + {-23295, -16639, -9984, -3328, 3328, 9984, 16639, 23295}, + {-25087, -17919, -10752, -3584, 3584, 10752, 17919, 25087}, + {-26879, -19199, -11520, -3840, 3840, 11520, 19199, 26879}, + {-28671, -20479, -12288, -4096, 4096, 12288, 20479, 28671} +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gsmdec_data.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gsmdec_data.h new file mode 100644 index 00000000..6b05bf6c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gsmdec_data.h @@ -0,0 +1,47 @@ +/* + * gsm 06.10 decoder data + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + */ + +#ifndef GSMDEC_DATA +#define GSMDEC_DATA + +#include + +// input and output sizes in byte +#define GSM_BLOCK_SIZE 33 +#define GSM_MS_BLOCK_SIZE 65 +#define GSM_FRAME_SIZE 160 + +typedef struct { + // Contains first 120 elements from the previous frame + // (used by long_term_synth according to the "lag"), + // then in the following 160 elements the current + // frame is constructed. + int16_t ref_buf[280]; + int v[9]; + int lar[2][8]; + int lar_idx; + int msr; +} GSMContext; + +extern const uint16_t ff_gsm_long_term_gain_tab[4]; +extern const int16_t ff_gsm_dequant_tab[64][8]; + +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gsmdec_template.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gsmdec_template.c new file mode 100644 index 00000000..b63ec9ed --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/gsmdec_template.c @@ -0,0 +1,150 @@ +/* + * gsm 06.10 decoder + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + * GSM decoder + */ + +#include "get_bits.h" +#include "gsmdec_data.h" + +static void apcm_dequant_add(GetBitContext *gb, int16_t *dst) +{ + int i; + int maxidx = get_bits(gb, 6); + const int16_t *tab = ff_gsm_dequant_tab[maxidx]; + for (i = 0; i < 13; i++) + dst[3*i] += tab[get_bits(gb, 3)]; +} + +static inline int gsm_mult(int a, int b) +{ + return (a * b + (1 << 14)) >> 15; +} + +static void long_term_synth(int16_t *dst, int lag, int gain_idx) +{ + int i; + const int16_t *src = dst - lag; + uint16_t gain = ff_gsm_long_term_gain_tab[gain_idx]; + for (i = 0; i < 40; i++) + dst[i] = gsm_mult(gain, src[i]); +} + +static inline int decode_log_area(int coded, int factor, int offset) +{ + coded <<= 10; + coded -= offset; + return gsm_mult(coded, factor) << 1; +} + +static av_noinline int get_rrp(int filtered) +{ + int abs = FFABS(filtered); + if (abs < 11059) abs <<= 1; + else if (abs < 20070) abs += 11059; + else abs = (abs >> 2) + 26112; + return filtered < 0 ? -abs : abs; +} + +static int filter_value(int in, int rrp[8], int v[9]) +{ + int i; + for (i = 7; i >= 0; i--) { + in -= gsm_mult(rrp[i], v[i]); + v[i + 1] = v[i] + gsm_mult(rrp[i], in); + } + v[0] = in; + return in; +} + +static void short_term_synth(GSMContext *ctx, int16_t *dst, const int16_t *src) +{ + int i; + int rrp[8]; + int *lar = ctx->lar[ctx->lar_idx]; + int *lar_prev = ctx->lar[ctx->lar_idx ^ 1]; + for (i = 0; i < 8; i++) + rrp[i] = get_rrp((lar_prev[i] >> 2) + (lar_prev[i] >> 1) + (lar[i] >> 2)); + for (i = 0; i < 13; i++) + dst[i] = filter_value(src[i], rrp, ctx->v); + + for (i = 0; i < 8; i++) + rrp[i] = get_rrp((lar_prev[i] >> 1) + (lar [i] >> 1)); + for (i = 13; i < 27; i++) + dst[i] = filter_value(src[i], rrp, ctx->v); + + for (i = 0; i < 8; i++) + rrp[i] = get_rrp((lar_prev[i] >> 2) + (lar [i] >> 1) + (lar[i] >> 2)); + for (i = 27; i < 40; i++) + dst[i] = filter_value(src[i], rrp, ctx->v); + + for (i = 0; i < 8; i++) + rrp[i] = get_rrp(lar[i]); + for (i = 40; i < 160; i++) + dst[i] = filter_value(src[i], rrp, ctx->v); + + ctx->lar_idx ^= 1; +} + +static int postprocess(int16_t *data, int msr) +{ + int i; + for (i = 0; i < 160; i++) { + msr = av_clip_int16(data[i] + gsm_mult(msr, 28180)); + data[i] = av_clip_int16(msr << 1) & ~7; + } + return msr; +} + +static int gsm_decode_block(AVCodecContext *avctx, int16_t *samples, + GetBitContext *gb) +{ + GSMContext *ctx = avctx->priv_data; + int i; + int16_t *ref_dst = ctx->ref_buf + 120; + int *lar = ctx->lar[ctx->lar_idx]; + lar[0] = decode_log_area(get_bits(gb, 6), 13107, 1 << 15); + lar[1] = decode_log_area(get_bits(gb, 6), 13107, 1 << 15); + lar[2] = decode_log_area(get_bits(gb, 5), 13107, (1 << 14) + 2048*2); + lar[3] = decode_log_area(get_bits(gb, 5), 13107, (1 << 14) - 2560*2); + lar[4] = decode_log_area(get_bits(gb, 4), 19223, (1 << 13) + 94*2); + lar[5] = decode_log_area(get_bits(gb, 4), 17476, (1 << 13) - 1792*2); + lar[6] = decode_log_area(get_bits(gb, 3), 31454, (1 << 12) - 341*2); + lar[7] = decode_log_area(get_bits(gb, 3), 29708, (1 << 12) - 1144*2); + + for (i = 0; i < 4; i++) { + int lag = get_bits(gb, 7); + int gain_idx = get_bits(gb, 2); + int offset = get_bits(gb, 2); + lag = av_clip(lag, 40, 120); + long_term_synth(ref_dst, lag, gain_idx); + apcm_dequant_add(gb, ref_dst + offset); + ref_dst += 40; + } + memcpy(ctx->ref_buf, ctx->ref_buf + 160, 120 * sizeof(*ctx->ref_buf)); + short_term_synth(ctx, samples, ctx->ref_buf + 120); + // for optimal speed this could be merged with short_term_synth, + // not done yet because it is a bit ugly + ctx->msr = postprocess(samples, ctx->msr); + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_cabac.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_cabac.c new file mode 100644 index 00000000..c83a7c76 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_cabac.c @@ -0,0 +1,1730 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... cabac decoding + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + * H.264 / AVC / MPEG4 part10 cabac decoding. + * @author Michael Niedermayer + */ + +#define CABAC 1 + +#include "internal.h" +#include "dsputil.h" +#include "avcodec.h" +#include "h264.h" +#include "h264data.h" +#include "h264_mvpred.h" +#include "golomb.h" + +#include "cabac.h" +#if ARCH_X86 +#include "x86/h264_i386.h" +#endif + +//#undef NDEBUG +#include + +/* Cabac pre state table */ + +static const int8_t cabac_context_init_I[460][2] = +{ + /* 0 - 10 */ + { 20, -15 }, { 2, 54 }, { 3, 74 }, { 20, -15 }, + { 2, 54 }, { 3, 74 }, { -28,127 }, { -23, 104 }, + { -6, 53 }, { -1, 54 }, { 7, 51 }, + + /* 11 - 23 unsused for I */ + { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, + { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, + { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, + { 0, 0 }, + + /* 24- 39 */ + { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, + { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, + { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, + { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, + + /* 40 - 53 */ + { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, + { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, + { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, + { 0, 0 }, { 0, 0 }, + + /* 54 - 59 */ + { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, + { 0, 0 }, { 0, 0 }, + + /* 60 - 69 */ + { 0, 41 }, { 0, 63 }, { 0, 63 }, { 0, 63 }, + { -9, 83 }, { 4, 86 }, { 0, 97 }, { -7, 72 }, + { 13, 41 }, { 3, 62 }, + + /* 70 -> 87 */ + { 0, 11 }, { 1, 55 }, { 0, 69 }, { -17, 127 }, + { -13, 102 },{ 0, 82 }, { -7, 74 }, { -21, 107 }, + { -27, 127 },{ -31, 127 },{ -24, 127 }, { -18, 95 }, + { -27, 127 },{ -21, 114 },{ -30, 127 }, { -17, 123 }, + { -12, 115 },{ -16, 122 }, + + /* 88 -> 104 */ + { -11, 115 },{ -12, 63 }, { -2, 68 }, { -15, 84 }, + { -13, 104 },{ -3, 70 }, { -8, 93 }, { -10, 90 }, + { -30, 127 },{ -1, 74 }, { -6, 97 }, { -7, 91 }, + { -20, 127 },{ -4, 56 }, { -5, 82 }, { -7, 76 }, + { -22, 125 }, + + /* 105 -> 135 */ + { -7, 93 }, { -11, 87 }, { -3, 77 }, { -5, 71 }, + { -4, 63 }, { -4, 68 }, { -12, 84 }, { -7, 62 }, + { -7, 65 }, { 8, 61 }, { 5, 56 }, { -2, 66 }, + { 1, 64 }, { 0, 61 }, { -2, 78 }, { 1, 50 }, + { 7, 52 }, { 10, 35 }, { 0, 44 }, { 11, 38 }, + { 1, 45 }, { 0, 46 }, { 5, 44 }, { 31, 17 }, + { 1, 51 }, { 7, 50 }, { 28, 19 }, { 16, 33 }, + { 14, 62 }, { -13, 108 },{ -15, 100 }, + + /* 136 -> 165 */ + { -13, 101 },{ -13, 91 }, { -12, 94 }, { -10, 88 }, + { -16, 84 }, { -10, 86 }, { -7, 83 }, { -13, 87 }, + { -19, 94 }, { 1, 70 }, { 0, 72 }, { -5, 74 }, + { 18, 59 }, { -8, 102 }, { -15, 100 }, { 0, 95 }, + { -4, 75 }, { 2, 72 }, { -11, 75 }, { -3, 71 }, + { 15, 46 }, { -13, 69 }, { 0, 62 }, { 0, 65 }, + { 21, 37 }, { -15, 72 }, { 9, 57 }, { 16, 54 }, + { 0, 62 }, { 12, 72 }, + + /* 166 -> 196 */ + { 24, 0 }, { 15, 9 }, { 8, 25 }, { 13, 18 }, + { 15, 9 }, { 13, 19 }, { 10, 37 }, { 12, 18 }, + { 6, 29 }, { 20, 33 }, { 15, 30 }, { 4, 45 }, + { 1, 58 }, { 0, 62 }, { 7, 61 }, { 12, 38 }, + { 11, 45 }, { 15, 39 }, { 11, 42 }, { 13, 44 }, + { 16, 45 }, { 12, 41 }, { 10, 49 }, { 30, 34 }, + { 18, 42 }, { 10, 55 }, { 17, 51 }, { 17, 46 }, + { 0, 89 }, { 26, -19 }, { 22, -17 }, + + /* 197 -> 226 */ + { 26, -17 }, { 30, -25 }, { 28, -20 }, { 33, -23 }, + { 37, -27 }, { 33, -23 }, { 40, -28 }, { 38, -17 }, + { 33, -11 }, { 40, -15 }, { 41, -6 }, { 38, 1 }, + { 41, 17 }, { 30, -6 }, { 27, 3 }, { 26, 22 }, + { 37, -16 }, { 35, -4 }, { 38, -8 }, { 38, -3 }, + { 37, 3 }, { 38, 5 }, { 42, 0 }, { 35, 16 }, + { 39, 22 }, { 14, 48 }, { 27, 37 }, { 21, 60 }, + { 12, 68 }, { 2, 97 }, + + /* 227 -> 251 */ + { -3, 71 }, { -6, 42 }, { -5, 50 }, { -3, 54 }, + { -2, 62 }, { 0, 58 }, { 1, 63 }, { -2, 72 }, + { -1, 74 }, { -9, 91 }, { -5, 67 }, { -5, 27 }, + { -3, 39 }, { -2, 44 }, { 0, 46 }, { -16, 64 }, + { -8, 68 }, { -10, 78 }, { -6, 77 }, { -10, 86 }, + { -12, 92 }, { -15, 55 }, { -10, 60 }, { -6, 62 }, + { -4, 65 }, + + /* 252 -> 275 */ + { -12, 73 }, { -8, 76 }, { -7, 80 }, { -9, 88 }, + { -17, 110 },{ -11, 97 }, { -20, 84 }, { -11, 79 }, + { -6, 73 }, { -4, 74 }, { -13, 86 }, { -13, 96 }, + { -11, 97 }, { -19, 117 },{ -8, 78 }, { -5, 33 }, + { -4, 48 }, { -2, 53 }, { -3, 62 }, { -13, 71 }, + { -10, 79 }, { -12, 86 }, { -13, 90 }, { -14, 97 }, + + /* 276 a bit special (not used, bypass is used instead) */ + { 0, 0 }, + + /* 277 -> 307 */ + { -6, 93 }, { -6, 84 }, { -8, 79 }, { 0, 66 }, + { -1, 71 }, { 0, 62 }, { -2, 60 }, { -2, 59 }, + { -5, 75 }, { -3, 62 }, { -4, 58 }, { -9, 66 }, + { -1, 79 }, { 0, 71 }, { 3, 68 }, { 10, 44 }, + { -7, 62 }, { 15, 36 }, { 14, 40 }, { 16, 27 }, + { 12, 29 }, { 1, 44 }, { 20, 36 }, { 18, 32 }, + { 5, 42 }, { 1, 48 }, { 10, 62 }, { 17, 46 }, + { 9, 64 }, { -12, 104 },{ -11, 97 }, + + /* 308 -> 337 */ + { -16, 96 }, { -7, 88 }, { -8, 85 }, { -7, 85 }, + { -9, 85 }, { -13, 88 }, { 4, 66 }, { -3, 77 }, + { -3, 76 }, { -6, 76 }, { 10, 58 }, { -1, 76 }, + { -1, 83 }, { -7, 99 }, { -14, 95 }, { 2, 95 }, + { 0, 76 }, { -5, 74 }, { 0, 70 }, { -11, 75 }, + { 1, 68 }, { 0, 65 }, { -14, 73 }, { 3, 62 }, + { 4, 62 }, { -1, 68 }, { -13, 75 }, { 11, 55 }, + { 5, 64 }, { 12, 70 }, + + /* 338 -> 368 */ + { 15, 6 }, { 6, 19 }, { 7, 16 }, { 12, 14 }, + { 18, 13 }, { 13, 11 }, { 13, 15 }, { 15, 16 }, + { 12, 23 }, { 13, 23 }, { 15, 20 }, { 14, 26 }, + { 14, 44 }, { 17, 40 }, { 17, 47 }, { 24, 17 }, + { 21, 21 }, { 25, 22 }, { 31, 27 }, { 22, 29 }, + { 19, 35 }, { 14, 50 }, { 10, 57 }, { 7, 63 }, + { -2, 77 }, { -4, 82 }, { -3, 94 }, { 9, 69 }, + { -12, 109 },{ 36, -35 }, { 36, -34 }, + + /* 369 -> 398 */ + { 32, -26 }, { 37, -30 }, { 44, -32 }, { 34, -18 }, + { 34, -15 }, { 40, -15 }, { 33, -7 }, { 35, -5 }, + { 33, 0 }, { 38, 2 }, { 33, 13 }, { 23, 35 }, + { 13, 58 }, { 29, -3 }, { 26, 0 }, { 22, 30 }, + { 31, -7 }, { 35, -15 }, { 34, -3 }, { 34, 3 }, + { 36, -1 }, { 34, 5 }, { 32, 11 }, { 35, 5 }, + { 34, 12 }, { 39, 11 }, { 30, 29 }, { 34, 26 }, + { 29, 39 }, { 19, 66 }, + + /* 399 -> 435 */ + { 31, 21 }, { 31, 31 }, { 25, 50 }, + { -17, 120 }, { -20, 112 }, { -18, 114 }, { -11, 85 }, + { -15, 92 }, { -14, 89 }, { -26, 71 }, { -15, 81 }, + { -14, 80 }, { 0, 68 }, { -14, 70 }, { -24, 56 }, + { -23, 68 }, { -24, 50 }, { -11, 74 }, { 23, -13 }, + { 26, -13 }, { 40, -15 }, { 49, -14 }, { 44, 3 }, + { 45, 6 }, { 44, 34 }, { 33, 54 }, { 19, 82 }, + { -3, 75 }, { -1, 23 }, { 1, 34 }, { 1, 43 }, + { 0, 54 }, { -2, 55 }, { 0, 61 }, { 1, 64 }, + { 0, 68 }, { -9, 92 }, + + /* 436 -> 459 */ + { -14, 106 }, { -13, 97 }, { -15, 90 }, { -12, 90 }, + { -18, 88 }, { -10, 73 }, { -9, 79 }, { -14, 86 }, + { -10, 73 }, { -10, 70 }, { -10, 69 }, { -5, 66 }, + { -9, 64 }, { -5, 58 }, { 2, 59 }, { 21, -10 }, + { 24, -11 }, { 28, -8 }, { 28, -1 }, { 29, 3 }, + { 29, 9 }, { 35, 20 }, { 29, 36 }, { 14, 67 } +}; + +static const int8_t cabac_context_init_PB[3][460][2] = +{ + /* i_cabac_init_idc == 0 */ + { + /* 0 - 10 */ + { 20, -15 }, { 2, 54 }, { 3, 74 }, { 20, -15 }, + { 2, 54 }, { 3, 74 }, { -28, 127 }, { -23, 104 }, + { -6, 53 }, { -1, 54 }, { 7, 51 }, + + /* 11 - 23 */ + { 23, 33 }, { 23, 2 }, { 21, 0 }, { 1, 9 }, + { 0, 49 }, { -37, 118 }, { 5, 57 }, { -13, 78 }, + { -11, 65 }, { 1, 62 }, { 12, 49 }, { -4, 73 }, + { 17, 50 }, + + /* 24 - 39 */ + { 18, 64 }, { 9, 43 }, { 29, 0 }, { 26, 67 }, + { 16, 90 }, { 9, 104 }, { -46, 127 }, { -20, 104 }, + { 1, 67 }, { -13, 78 }, { -11, 65 }, { 1, 62 }, + { -6, 86 }, { -17, 95 }, { -6, 61 }, { 9, 45 }, + + /* 40 - 53 */ + { -3, 69 }, { -6, 81 }, { -11, 96 }, { 6, 55 }, + { 7, 67 }, { -5, 86 }, { 2, 88 }, { 0, 58 }, + { -3, 76 }, { -10, 94 }, { 5, 54 }, { 4, 69 }, + { -3, 81 }, { 0, 88 }, + + /* 54 - 59 */ + { -7, 67 }, { -5, 74 }, { -4, 74 }, { -5, 80 }, + { -7, 72 }, { 1, 58 }, + + /* 60 - 69 */ + { 0, 41 }, { 0, 63 }, { 0, 63 }, { 0, 63 }, + { -9, 83 }, { 4, 86 }, { 0, 97 }, { -7, 72 }, + { 13, 41 }, { 3, 62 }, + + /* 70 - 87 */ + { 0, 45 }, { -4, 78 }, { -3, 96 }, { -27, 126 }, + { -28, 98 }, { -25, 101 }, { -23, 67 }, { -28, 82 }, + { -20, 94 }, { -16, 83 }, { -22, 110 }, { -21, 91 }, + { -18, 102 }, { -13, 93 }, { -29, 127 }, { -7, 92 }, + { -5, 89 }, { -7, 96 }, { -13, 108 }, { -3, 46 }, + { -1, 65 }, { -1, 57 }, { -9, 93 }, { -3, 74 }, + { -9, 92 }, { -8, 87 }, { -23, 126 }, { 5, 54 }, + { 6, 60 }, { 6, 59 }, { 6, 69 }, { -1, 48 }, + { 0, 68 }, { -4, 69 }, { -8, 88 }, + + /* 105 -> 165 */ + { -2, 85 }, { -6, 78 }, { -1, 75 }, { -7, 77 }, + { 2, 54 }, { 5, 50 }, { -3, 68 }, { 1, 50 }, + { 6, 42 }, { -4, 81 }, { 1, 63 }, { -4, 70 }, + { 0, 67 }, { 2, 57 }, { -2, 76 }, { 11, 35 }, + { 4, 64 }, { 1, 61 }, { 11, 35 }, { 18, 25 }, + { 12, 24 }, { 13, 29 }, { 13, 36 }, { -10, 93 }, + { -7, 73 }, { -2, 73 }, { 13, 46 }, { 9, 49 }, + { -7, 100 }, { 9, 53 }, { 2, 53 }, { 5, 53 }, + { -2, 61 }, { 0, 56 }, { 0, 56 }, { -13, 63 }, + { -5, 60 }, { -1, 62 }, { 4, 57 }, { -6, 69 }, + { 4, 57 }, { 14, 39 }, { 4, 51 }, { 13, 68 }, + { 3, 64 }, { 1, 61 }, { 9, 63 }, { 7, 50 }, + { 16, 39 }, { 5, 44 }, { 4, 52 }, { 11, 48 }, + { -5, 60 }, { -1, 59 }, { 0, 59 }, { 22, 33 }, + { 5, 44 }, { 14, 43 }, { -1, 78 }, { 0, 60 }, + { 9, 69 }, + + /* 166 - 226 */ + { 11, 28 }, { 2, 40 }, { 3, 44 }, { 0, 49 }, + { 0, 46 }, { 2, 44 }, { 2, 51 }, { 0, 47 }, + { 4, 39 }, { 2, 62 }, { 6, 46 }, { 0, 54 }, + { 3, 54 }, { 2, 58 }, { 4, 63 }, { 6, 51 }, + { 6, 57 }, { 7, 53 }, { 6, 52 }, { 6, 55 }, + { 11, 45 }, { 14, 36 }, { 8, 53 }, { -1, 82 }, + { 7, 55 }, { -3, 78 }, { 15, 46 }, { 22, 31 }, + { -1, 84 }, { 25, 7 }, { 30, -7 }, { 28, 3 }, + { 28, 4 }, { 32, 0 }, { 34, -1 }, { 30, 6 }, + { 30, 6 }, { 32, 9 }, { 31, 19 }, { 26, 27 }, + { 26, 30 }, { 37, 20 }, { 28, 34 }, { 17, 70 }, + { 1, 67 }, { 5, 59 }, { 9, 67 }, { 16, 30 }, + { 18, 32 }, { 18, 35 }, { 22, 29 }, { 24, 31 }, + { 23, 38 }, { 18, 43 }, { 20, 41 }, { 11, 63 }, + { 9, 59 }, { 9, 64 }, { -1, 94 }, { -2, 89 }, + { -9, 108 }, + + /* 227 - 275 */ + { -6, 76 }, { -2, 44 }, { 0, 45 }, { 0, 52 }, + { -3, 64 }, { -2, 59 }, { -4, 70 }, { -4, 75 }, + { -8, 82 }, { -17, 102 }, { -9, 77 }, { 3, 24 }, + { 0, 42 }, { 0, 48 }, { 0, 55 }, { -6, 59 }, + { -7, 71 }, { -12, 83 }, { -11, 87 }, { -30, 119 }, + { 1, 58 }, { -3, 29 }, { -1, 36 }, { 1, 38 }, + { 2, 43 }, { -6, 55 }, { 0, 58 }, { 0, 64 }, + { -3, 74 }, { -10, 90 }, { 0, 70 }, { -4, 29 }, + { 5, 31 }, { 7, 42 }, { 1, 59 }, { -2, 58 }, + { -3, 72 }, { -3, 81 }, { -11, 97 }, { 0, 58 }, + { 8, 5 }, { 10, 14 }, { 14, 18 }, { 13, 27 }, + { 2, 40 }, { 0, 58 }, { -3, 70 }, { -6, 79 }, + { -8, 85 }, + + /* 276 a bit special (not used, bypass is used instead) */ + { 0, 0 }, + + /* 277 - 337 */ + { -13, 106 }, { -16, 106 }, { -10, 87 }, { -21, 114 }, + { -18, 110 }, { -14, 98 }, { -22, 110 }, { -21, 106 }, + { -18, 103 }, { -21, 107 }, { -23, 108 }, { -26, 112 }, + { -10, 96 }, { -12, 95 }, { -5, 91 }, { -9, 93 }, + { -22, 94 }, { -5, 86 }, { 9, 67 }, { -4, 80 }, + { -10, 85 }, { -1, 70 }, { 7, 60 }, { 9, 58 }, + { 5, 61 }, { 12, 50 }, { 15, 50 }, { 18, 49 }, + { 17, 54 }, { 10, 41 }, { 7, 46 }, { -1, 51 }, + { 7, 49 }, { 8, 52 }, { 9, 41 }, { 6, 47 }, + { 2, 55 }, { 13, 41 }, { 10, 44 }, { 6, 50 }, + { 5, 53 }, { 13, 49 }, { 4, 63 }, { 6, 64 }, + { -2, 69 }, { -2, 59 }, { 6, 70 }, { 10, 44 }, + { 9, 31 }, { 12, 43 }, { 3, 53 }, { 14, 34 }, + { 10, 38 }, { -3, 52 }, { 13, 40 }, { 17, 32 }, + { 7, 44 }, { 7, 38 }, { 13, 50 }, { 10, 57 }, + { 26, 43 }, + + /* 338 - 398 */ + { 14, 11 }, { 11, 14 }, { 9, 11 }, { 18, 11 }, + { 21, 9 }, { 23, -2 }, { 32, -15 }, { 32, -15 }, + { 34, -21 }, { 39, -23 }, { 42, -33 }, { 41, -31 }, + { 46, -28 }, { 38, -12 }, { 21, 29 }, { 45, -24 }, + { 53, -45 }, { 48, -26 }, { 65, -43 }, { 43, -19 }, + { 39, -10 }, { 30, 9 }, { 18, 26 }, { 20, 27 }, + { 0, 57 }, { -14, 82 }, { -5, 75 }, { -19, 97 }, + { -35, 125 }, { 27, 0 }, { 28, 0 }, { 31, -4 }, + { 27, 6 }, { 34, 8 }, { 30, 10 }, { 24, 22 }, + { 33, 19 }, { 22, 32 }, { 26, 31 }, { 21, 41 }, + { 26, 44 }, { 23, 47 }, { 16, 65 }, { 14, 71 }, + { 8, 60 }, { 6, 63 }, { 17, 65 }, { 21, 24 }, + { 23, 20 }, { 26, 23 }, { 27, 32 }, { 28, 23 }, + { 28, 24 }, { 23, 40 }, { 24, 32 }, { 28, 29 }, + { 23, 42 }, { 19, 57 }, { 22, 53 }, { 22, 61 }, + { 11, 86 }, + + /* 399 - 435 */ + { 12, 40 }, { 11, 51 }, { 14, 59 }, + { -4, 79 }, { -7, 71 }, { -5, 69 }, { -9, 70 }, + { -8, 66 }, { -10, 68 }, { -19, 73 }, { -12, 69 }, + { -16, 70 }, { -15, 67 }, { -20, 62 }, { -19, 70 }, + { -16, 66 }, { -22, 65 }, { -20, 63 }, { 9, -2 }, + { 26, -9 }, { 33, -9 }, { 39, -7 }, { 41, -2 }, + { 45, 3 }, { 49, 9 }, { 45, 27 }, { 36, 59 }, + { -6, 66 }, { -7, 35 }, { -7, 42 }, { -8, 45 }, + { -5, 48 }, { -12, 56 }, { -6, 60 }, { -5, 62 }, + { -8, 66 }, { -8, 76 }, + + /* 436 - 459 */ + { -5, 85 }, { -6, 81 }, { -10, 77 }, { -7, 81 }, + { -17, 80 }, { -18, 73 }, { -4, 74 }, { -10, 83 }, + { -9, 71 }, { -9, 67 }, { -1, 61 }, { -8, 66 }, + { -14, 66 }, { 0, 59 }, { 2, 59 }, { 21, -13 }, + { 33, -14 }, { 39, -7 }, { 46, -2 }, { 51, 2 }, + { 60, 6 }, { 61, 17 }, { 55, 34 }, { 42, 62 }, + }, + + /* i_cabac_init_idc == 1 */ + { + /* 0 - 10 */ + { 20, -15 }, { 2, 54 }, { 3, 74 }, { 20, -15 }, + { 2, 54 }, { 3, 74 }, { -28, 127 }, { -23, 104 }, + { -6, 53 }, { -1, 54 }, { 7, 51 }, + + /* 11 - 23 */ + { 22, 25 }, { 34, 0 }, { 16, 0 }, { -2, 9 }, + { 4, 41 }, { -29, 118 }, { 2, 65 }, { -6, 71 }, + { -13, 79 }, { 5, 52 }, { 9, 50 }, { -3, 70 }, + { 10, 54 }, + + /* 24 - 39 */ + { 26, 34 }, { 19, 22 }, { 40, 0 }, { 57, 2 }, + { 41, 36 }, { 26, 69 }, { -45, 127 }, { -15, 101 }, + { -4, 76 }, { -6, 71 }, { -13, 79 }, { 5, 52 }, + { 6, 69 }, { -13, 90 }, { 0, 52 }, { 8, 43 }, + + /* 40 - 53 */ + { -2, 69 },{ -5, 82 },{ -10, 96 },{ 2, 59 }, + { 2, 75 },{ -3, 87 },{ -3, 100 },{ 1, 56 }, + { -3, 74 },{ -6, 85 },{ 0, 59 },{ -3, 81 }, + { -7, 86 },{ -5, 95 }, + + /* 54 - 59 */ + { -1, 66 },{ -1, 77 },{ 1, 70 },{ -2, 86 }, + { -5, 72 },{ 0, 61 }, + + /* 60 - 69 */ + { 0, 41 }, { 0, 63 }, { 0, 63 }, { 0, 63 }, + { -9, 83 }, { 4, 86 }, { 0, 97 }, { -7, 72 }, + { 13, 41 }, { 3, 62 }, + + /* 70 - 104 */ + { 13, 15 }, { 7, 51 }, { 2, 80 }, { -39, 127 }, + { -18, 91 }, { -17, 96 }, { -26, 81 }, { -35, 98 }, + { -24, 102 }, { -23, 97 }, { -27, 119 }, { -24, 99 }, + { -21, 110 }, { -18, 102 }, { -36, 127 }, { 0, 80 }, + { -5, 89 }, { -7, 94 }, { -4, 92 }, { 0, 39 }, + { 0, 65 }, { -15, 84 }, { -35, 127 }, { -2, 73 }, + { -12, 104 }, { -9, 91 }, { -31, 127 }, { 3, 55 }, + { 7, 56 }, { 7, 55 }, { 8, 61 }, { -3, 53 }, + { 0, 68 }, { -7, 74 }, { -9, 88 }, + + /* 105 -> 165 */ + { -13, 103 }, { -13, 91 }, { -9, 89 }, { -14, 92 }, + { -8, 76 }, { -12, 87 }, { -23, 110 }, { -24, 105 }, + { -10, 78 }, { -20, 112 }, { -17, 99 }, { -78, 127 }, + { -70, 127 }, { -50, 127 }, { -46, 127 }, { -4, 66 }, + { -5, 78 }, { -4, 71 }, { -8, 72 }, { 2, 59 }, + { -1, 55 }, { -7, 70 }, { -6, 75 }, { -8, 89 }, + { -34, 119 }, { -3, 75 }, { 32, 20 }, { 30, 22 }, + { -44, 127 }, { 0, 54 }, { -5, 61 }, { 0, 58 }, + { -1, 60 }, { -3, 61 }, { -8, 67 }, { -25, 84 }, + { -14, 74 }, { -5, 65 }, { 5, 52 }, { 2, 57 }, + { 0, 61 }, { -9, 69 }, { -11, 70 }, { 18, 55 }, + { -4, 71 }, { 0, 58 }, { 7, 61 }, { 9, 41 }, + { 18, 25 }, { 9, 32 }, { 5, 43 }, { 9, 47 }, + { 0, 44 }, { 0, 51 }, { 2, 46 }, { 19, 38 }, + { -4, 66 }, { 15, 38 }, { 12, 42 }, { 9, 34 }, + { 0, 89 }, + + /* 166 - 226 */ + { 4, 45 }, { 10, 28 }, { 10, 31 }, { 33, -11 }, + { 52, -43 }, { 18, 15 }, { 28, 0 }, { 35, -22 }, + { 38, -25 }, { 34, 0 }, { 39, -18 }, { 32, -12 }, + { 102, -94 }, { 0, 0 }, { 56, -15 }, { 33, -4 }, + { 29, 10 }, { 37, -5 }, { 51, -29 }, { 39, -9 }, + { 52, -34 }, { 69, -58 }, { 67, -63 }, { 44, -5 }, + { 32, 7 }, { 55, -29 }, { 32, 1 }, { 0, 0 }, + { 27, 36 }, { 33, -25 }, { 34, -30 }, { 36, -28 }, + { 38, -28 }, { 38, -27 }, { 34, -18 }, { 35, -16 }, + { 34, -14 }, { 32, -8 }, { 37, -6 }, { 35, 0 }, + { 30, 10 }, { 28, 18 }, { 26, 25 }, { 29, 41 }, + { 0, 75 }, { 2, 72 }, { 8, 77 }, { 14, 35 }, + { 18, 31 }, { 17, 35 }, { 21, 30 }, { 17, 45 }, + { 20, 42 }, { 18, 45 }, { 27, 26 }, { 16, 54 }, + { 7, 66 }, { 16, 56 }, { 11, 73 }, { 10, 67 }, + { -10, 116 }, + + /* 227 - 275 */ + { -23, 112 }, { -15, 71 }, { -7, 61 }, { 0, 53 }, + { -5, 66 }, { -11, 77 }, { -9, 80 }, { -9, 84 }, + { -10, 87 }, { -34, 127 }, { -21, 101 }, { -3, 39 }, + { -5, 53 }, { -7, 61 }, { -11, 75 }, { -15, 77 }, + { -17, 91 }, { -25, 107 }, { -25, 111 }, { -28, 122 }, + { -11, 76 }, { -10, 44 }, { -10, 52 }, { -10, 57 }, + { -9, 58 }, { -16, 72 }, { -7, 69 }, { -4, 69 }, + { -5, 74 }, { -9, 86 }, { 2, 66 }, { -9, 34 }, + { 1, 32 }, { 11, 31 }, { 5, 52 }, { -2, 55 }, + { -2, 67 }, { 0, 73 }, { -8, 89 }, { 3, 52 }, + { 7, 4 }, { 10, 8 }, { 17, 8 }, { 16, 19 }, + { 3, 37 }, { -1, 61 }, { -5, 73 }, { -1, 70 }, + { -4, 78 }, + + /* 276 a bit special (not used, bypass is used instead) */ + { 0, 0 }, + + /* 277 - 337 */ + { -21, 126 }, { -23, 124 }, { -20, 110 }, { -26, 126 }, + { -25, 124 }, { -17, 105 }, { -27, 121 }, { -27, 117 }, + { -17, 102 }, { -26, 117 }, { -27, 116 }, { -33, 122 }, + { -10, 95 }, { -14, 100 }, { -8, 95 }, { -17, 111 }, + { -28, 114 }, { -6, 89 }, { -2, 80 }, { -4, 82 }, + { -9, 85 }, { -8, 81 }, { -1, 72 }, { 5, 64 }, + { 1, 67 }, { 9, 56 }, { 0, 69 }, { 1, 69 }, + { 7, 69 }, { -7, 69 }, { -6, 67 }, { -16, 77 }, + { -2, 64 }, { 2, 61 }, { -6, 67 }, { -3, 64 }, + { 2, 57 }, { -3, 65 }, { -3, 66 }, { 0, 62 }, + { 9, 51 }, { -1, 66 }, { -2, 71 }, { -2, 75 }, + { -1, 70 }, { -9, 72 }, { 14, 60 }, { 16, 37 }, + { 0, 47 }, { 18, 35 }, { 11, 37 }, { 12, 41 }, + { 10, 41 }, { 2, 48 }, { 12, 41 }, { 13, 41 }, + { 0, 59 }, { 3, 50 }, { 19, 40 }, { 3, 66 }, + { 18, 50 }, + + /* 338 - 398 */ + { 19, -6 }, { 18, -6 }, { 14, 0 }, { 26, -12 }, + { 31, -16 }, { 33, -25 }, { 33, -22 }, { 37, -28 }, + { 39, -30 }, { 42, -30 }, { 47, -42 }, { 45, -36 }, + { 49, -34 }, { 41, -17 }, { 32, 9 }, { 69, -71 }, + { 63, -63 }, { 66, -64 }, { 77, -74 }, { 54, -39 }, + { 52, -35 }, { 41, -10 }, { 36, 0 }, { 40, -1 }, + { 30, 14 }, { 28, 26 }, { 23, 37 }, { 12, 55 }, + { 11, 65 }, { 37, -33 }, { 39, -36 }, { 40, -37 }, + { 38, -30 }, { 46, -33 }, { 42, -30 }, { 40, -24 }, + { 49, -29 }, { 38, -12 }, { 40, -10 }, { 38, -3 }, + { 46, -5 }, { 31, 20 }, { 29, 30 }, { 25, 44 }, + { 12, 48 }, { 11, 49 }, { 26, 45 }, { 22, 22 }, + { 23, 22 }, { 27, 21 }, { 33, 20 }, { 26, 28 }, + { 30, 24 }, { 27, 34 }, { 18, 42 }, { 25, 39 }, + { 18, 50 }, { 12, 70 }, { 21, 54 }, { 14, 71 }, + { 11, 83 }, + + /* 399 - 435 */ + { 25, 32 }, { 21, 49 }, { 21, 54 }, + { -5, 85 }, { -6, 81 }, { -10, 77 }, { -7, 81 }, + { -17, 80 }, { -18, 73 }, { -4, 74 }, { -10, 83 }, + { -9, 71 }, { -9, 67 }, { -1, 61 }, { -8, 66 }, + { -14, 66 }, { 0, 59 }, { 2, 59 }, { 17, -10 }, + { 32, -13 }, { 42, -9 }, { 49, -5 }, { 53, 0 }, + { 64, 3 }, { 68, 10 }, { 66, 27 }, { 47, 57 }, + { -5, 71 }, { 0, 24 }, { -1, 36 }, { -2, 42 }, + { -2, 52 }, { -9, 57 }, { -6, 63 }, { -4, 65 }, + { -4, 67 }, { -7, 82 }, + + /* 436 - 459 */ + { -3, 81 }, { -3, 76 }, { -7, 72 }, { -6, 78 }, + { -12, 72 }, { -14, 68 }, { -3, 70 }, { -6, 76 }, + { -5, 66 }, { -5, 62 }, { 0, 57 }, { -4, 61 }, + { -9, 60 }, { 1, 54 }, { 2, 58 }, { 17, -10 }, + { 32, -13 }, { 42, -9 }, { 49, -5 }, { 53, 0 }, + { 64, 3 }, { 68, 10 }, { 66, 27 }, { 47, 57 }, + }, + + /* i_cabac_init_idc == 2 */ + { + /* 0 - 10 */ + { 20, -15 }, { 2, 54 }, { 3, 74 }, { 20, -15 }, + { 2, 54 }, { 3, 74 }, { -28, 127 }, { -23, 104 }, + { -6, 53 }, { -1, 54 }, { 7, 51 }, + + /* 11 - 23 */ + { 29, 16 }, { 25, 0 }, { 14, 0 }, { -10, 51 }, + { -3, 62 }, { -27, 99 }, { 26, 16 }, { -4, 85 }, + { -24, 102 }, { 5, 57 }, { 6, 57 }, { -17, 73 }, + { 14, 57 }, + + /* 24 - 39 */ + { 20, 40 }, { 20, 10 }, { 29, 0 }, { 54, 0 }, + { 37, 42 }, { 12, 97 }, { -32, 127 }, { -22, 117 }, + { -2, 74 }, { -4, 85 }, { -24, 102 }, { 5, 57 }, + { -6, 93 }, { -14, 88 }, { -6, 44 }, { 4, 55 }, + + /* 40 - 53 */ + { -11, 89 },{ -15, 103 },{ -21, 116 },{ 19, 57 }, + { 20, 58 },{ 4, 84 },{ 6, 96 },{ 1, 63 }, + { -5, 85 },{ -13, 106 },{ 5, 63 },{ 6, 75 }, + { -3, 90 },{ -1, 101 }, + + /* 54 - 59 */ + { 3, 55 },{ -4, 79 },{ -2, 75 },{ -12, 97 }, + { -7, 50 },{ 1, 60 }, + + /* 60 - 69 */ + { 0, 41 }, { 0, 63 }, { 0, 63 }, { 0, 63 }, + { -9, 83 }, { 4, 86 }, { 0, 97 }, { -7, 72 }, + { 13, 41 }, { 3, 62 }, + + /* 70 - 104 */ + { 7, 34 }, { -9, 88 }, { -20, 127 }, { -36, 127 }, + { -17, 91 }, { -14, 95 }, { -25, 84 }, { -25, 86 }, + { -12, 89 }, { -17, 91 }, { -31, 127 }, { -14, 76 }, + { -18, 103 }, { -13, 90 }, { -37, 127 }, { 11, 80 }, + { 5, 76 }, { 2, 84 }, { 5, 78 }, { -6, 55 }, + { 4, 61 }, { -14, 83 }, { -37, 127 }, { -5, 79 }, + { -11, 104 }, { -11, 91 }, { -30, 127 }, { 0, 65 }, + { -2, 79 }, { 0, 72 }, { -4, 92 }, { -6, 56 }, + { 3, 68 }, { -8, 71 }, { -13, 98 }, + + /* 105 -> 165 */ + { -4, 86 }, { -12, 88 }, { -5, 82 }, { -3, 72 }, + { -4, 67 }, { -8, 72 }, { -16, 89 }, { -9, 69 }, + { -1, 59 }, { 5, 66 }, { 4, 57 }, { -4, 71 }, + { -2, 71 }, { 2, 58 }, { -1, 74 }, { -4, 44 }, + { -1, 69 }, { 0, 62 }, { -7, 51 }, { -4, 47 }, + { -6, 42 }, { -3, 41 }, { -6, 53 }, { 8, 76 }, + { -9, 78 }, { -11, 83 }, { 9, 52 }, { 0, 67 }, + { -5, 90 }, { 1, 67 }, { -15, 72 }, { -5, 75 }, + { -8, 80 }, { -21, 83 }, { -21, 64 }, { -13, 31 }, + { -25, 64 }, { -29, 94 }, { 9, 75 }, { 17, 63 }, + { -8, 74 }, { -5, 35 }, { -2, 27 }, { 13, 91 }, + { 3, 65 }, { -7, 69 }, { 8, 77 }, { -10, 66 }, + { 3, 62 }, { -3, 68 }, { -20, 81 }, { 0, 30 }, + { 1, 7 }, { -3, 23 }, { -21, 74 }, { 16, 66 }, + { -23, 124 }, { 17, 37 }, { 44, -18 }, { 50, -34 }, + { -22, 127 }, + + /* 166 - 226 */ + { 4, 39 }, { 0, 42 }, { 7, 34 }, { 11, 29 }, + { 8, 31 }, { 6, 37 }, { 7, 42 }, { 3, 40 }, + { 8, 33 }, { 13, 43 }, { 13, 36 }, { 4, 47 }, + { 3, 55 }, { 2, 58 }, { 6, 60 }, { 8, 44 }, + { 11, 44 }, { 14, 42 }, { 7, 48 }, { 4, 56 }, + { 4, 52 }, { 13, 37 }, { 9, 49 }, { 19, 58 }, + { 10, 48 }, { 12, 45 }, { 0, 69 }, { 20, 33 }, + { 8, 63 }, { 35, -18 }, { 33, -25 }, { 28, -3 }, + { 24, 10 }, { 27, 0 }, { 34, -14 }, { 52, -44 }, + { 39, -24 }, { 19, 17 }, { 31, 25 }, { 36, 29 }, + { 24, 33 }, { 34, 15 }, { 30, 20 }, { 22, 73 }, + { 20, 34 }, { 19, 31 }, { 27, 44 }, { 19, 16 }, + { 15, 36 }, { 15, 36 }, { 21, 28 }, { 25, 21 }, + { 30, 20 }, { 31, 12 }, { 27, 16 }, { 24, 42 }, + { 0, 93 }, { 14, 56 }, { 15, 57 }, { 26, 38 }, + { -24, 127 }, + + /* 227 - 275 */ + { -24, 115 }, { -22, 82 }, { -9, 62 }, { 0, 53 }, + { 0, 59 }, { -14, 85 }, { -13, 89 }, { -13, 94 }, + { -11, 92 }, { -29, 127 }, { -21, 100 }, { -14, 57 }, + { -12, 67 }, { -11, 71 }, { -10, 77 }, { -21, 85 }, + { -16, 88 }, { -23, 104 }, { -15, 98 }, { -37, 127 }, + { -10, 82 }, { -8, 48 }, { -8, 61 }, { -8, 66 }, + { -7, 70 }, { -14, 75 }, { -10, 79 }, { -9, 83 }, + { -12, 92 }, { -18, 108 }, { -4, 79 }, { -22, 69 }, + { -16, 75 }, { -2, 58 }, { 1, 58 }, { -13, 78 }, + { -9, 83 }, { -4, 81 }, { -13, 99 }, { -13, 81 }, + { -6, 38 }, { -13, 62 }, { -6, 58 }, { -2, 59 }, + { -16, 73 }, { -10, 76 }, { -13, 86 }, { -9, 83 }, + { -10, 87 }, + + /* 276 a bit special (not used, bypass is used instead) */ + { 0, 0 }, + + /* 277 - 337 */ + { -22, 127 }, { -25, 127 }, { -25, 120 }, { -27, 127 }, + { -19, 114 }, { -23, 117 }, { -25, 118 }, { -26, 117 }, + { -24, 113 }, { -28, 118 }, { -31, 120 }, { -37, 124 }, + { -10, 94 }, { -15, 102 }, { -10, 99 }, { -13, 106 }, + { -50, 127 }, { -5, 92 }, { 17, 57 }, { -5, 86 }, + { -13, 94 }, { -12, 91 }, { -2, 77 }, { 0, 71 }, + { -1, 73 }, { 4, 64 }, { -7, 81 }, { 5, 64 }, + { 15, 57 }, { 1, 67 }, { 0, 68 }, { -10, 67 }, + { 1, 68 }, { 0, 77 }, { 2, 64 }, { 0, 68 }, + { -5, 78 }, { 7, 55 }, { 5, 59 }, { 2, 65 }, + { 14, 54 }, { 15, 44 }, { 5, 60 }, { 2, 70 }, + { -2, 76 }, { -18, 86 }, { 12, 70 }, { 5, 64 }, + { -12, 70 }, { 11, 55 }, { 5, 56 }, { 0, 69 }, + { 2, 65 }, { -6, 74 }, { 5, 54 }, { 7, 54 }, + { -6, 76 }, { -11, 82 }, { -2, 77 }, { -2, 77 }, + { 25, 42 }, + + /* 338 - 398 */ + { 17, -13 }, { 16, -9 }, { 17, -12 }, { 27, -21 }, + { 37, -30 }, { 41, -40 }, { 42, -41 }, { 48, -47 }, + { 39, -32 }, { 46, -40 }, { 52, -51 }, { 46, -41 }, + { 52, -39 }, { 43, -19 }, { 32, 11 }, { 61, -55 }, + { 56, -46 }, { 62, -50 }, { 81, -67 }, { 45, -20 }, + { 35, -2 }, { 28, 15 }, { 34, 1 }, { 39, 1 }, + { 30, 17 }, { 20, 38 }, { 18, 45 }, { 15, 54 }, + { 0, 79 }, { 36, -16 }, { 37, -14 }, { 37, -17 }, + { 32, 1 }, { 34, 15 }, { 29, 15 }, { 24, 25 }, + { 34, 22 }, { 31, 16 }, { 35, 18 }, { 31, 28 }, + { 33, 41 }, { 36, 28 }, { 27, 47 }, { 21, 62 }, + { 18, 31 }, { 19, 26 }, { 36, 24 }, { 24, 23 }, + { 27, 16 }, { 24, 30 }, { 31, 29 }, { 22, 41 }, + { 22, 42 }, { 16, 60 }, { 15, 52 }, { 14, 60 }, + { 3, 78 }, { -16, 123 }, { 21, 53 }, { 22, 56 }, + { 25, 61 }, + + /* 399 - 435 */ + { 21, 33 }, { 19, 50 }, { 17, 61 }, + { -3, 78 }, { -8, 74 }, { -9, 72 }, { -10, 72 }, + { -18, 75 }, { -12, 71 }, { -11, 63 }, { -5, 70 }, + { -17, 75 }, { -14, 72 }, { -16, 67 }, { -8, 53 }, + { -14, 59 }, { -9, 52 }, { -11, 68 }, { 9, -2 }, + { 30, -10 }, { 31, -4 }, { 33, -1 }, { 33, 7 }, + { 31, 12 }, { 37, 23 }, { 31, 38 }, { 20, 64 }, + { -9, 71 }, { -7, 37 }, { -8, 44 }, { -11, 49 }, + { -10, 56 }, { -12, 59 }, { -8, 63 }, { -9, 67 }, + { -6, 68 }, { -10, 79 }, + + /* 436 - 459 */ + { -3, 78 }, { -8, 74 }, { -9, 72 }, { -10, 72 }, + { -18, 75 }, { -12, 71 }, { -11, 63 }, { -5, 70 }, + { -17, 75 }, { -14, 72 }, { -16, 67 }, { -8, 53 }, + { -14, 59 }, { -9, 52 }, { -11, 68 }, { 9, -2 }, + { 30, -10 }, { 31, -4 }, { 33, -1 }, { 33, 7 }, + { 31, 12 }, { 37, 23 }, { 31, 38 }, { 20, 64 }, + } +}; + +void ff_h264_init_cabac_states(H264Context *h) { + MpegEncContext * const s = &h->s; + int i; + const int8_t (*tab)[2]; + + if( h->slice_type_nos == FF_I_TYPE ) tab = cabac_context_init_I; + else tab = cabac_context_init_PB[h->cabac_init_idc]; + + /* calculate pre-state */ + for( i= 0; i < 460; i++ ) { + int pre = 2*(((tab[i][0] * s->qscale) >>4 ) + tab[i][1]) - 127; + + pre^= pre>>31; + if(pre > 124) + pre= 124 + (pre&1); + + h->cabac_state[i] = pre; + } +} + +static int decode_cabac_field_decoding_flag(H264Context *h) { + MpegEncContext * const s = &h->s; + const long mbb_xy = h->mb_xy - 2L*s->mb_stride; + + unsigned long ctx = 0; + + ctx += h->mb_field_decoding_flag & !!s->mb_x; //for FMO:(s->current_picture.mb_type[mba_xy]>>7)&(h->slice_table[mba_xy] == h->slice_num); + ctx += (s->current_picture.mb_type[mbb_xy]>>7)&(h->slice_table[mbb_xy] == h->slice_num); + + return get_cabac_noinline( &h->cabac, &(h->cabac_state+70)[ctx] ); +} + +static int decode_cabac_intra_mb_type(H264Context *h, int ctx_base, int intra_slice) { + uint8_t *state= &h->cabac_state[ctx_base]; + int mb_type; + + if(intra_slice){ + int ctx=0; + if( h->left_type[0] & (MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM)) + ctx++; + if( h->top_type & (MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM)) + ctx++; + if( get_cabac_noinline( &h->cabac, &state[ctx] ) == 0 ) + return 0; /* I4x4 */ + state += 2; + }else{ + if( get_cabac_noinline( &h->cabac, state ) == 0 ) + return 0; /* I4x4 */ + } + + if( get_cabac_terminate( &h->cabac ) ) + return 25; /* PCM */ + + mb_type = 1; /* I16x16 */ + mb_type += 12 * get_cabac_noinline( &h->cabac, &state[1] ); /* cbp_luma != 0 */ + if( get_cabac_noinline( &h->cabac, &state[2] ) ) /* cbp_chroma */ + mb_type += 4 + 4 * get_cabac_noinline( &h->cabac, &state[2+intra_slice] ); + mb_type += 2 * get_cabac_noinline( &h->cabac, &state[3+intra_slice] ); + mb_type += 1 * get_cabac_noinline( &h->cabac, &state[3+2*intra_slice] ); + return mb_type; +} + +static int decode_cabac_mb_skip( H264Context *h, int mb_x, int mb_y ) { + MpegEncContext * const s = &h->s; + int mba_xy, mbb_xy; + int ctx = 0; + + if(FRAME_MBAFF){ //FIXME merge with the stuff in fill_caches? + int mb_xy = mb_x + (mb_y&~1)*s->mb_stride; + mba_xy = mb_xy - 1; + if( (mb_y&1) + && h->slice_table[mba_xy] == h->slice_num + && MB_FIELD == !!IS_INTERLACED( s->current_picture.mb_type[mba_xy] ) ) + mba_xy += s->mb_stride; + if( MB_FIELD ){ + mbb_xy = mb_xy - s->mb_stride; + if( !(mb_y&1) + && h->slice_table[mbb_xy] == h->slice_num + && IS_INTERLACED( s->current_picture.mb_type[mbb_xy] ) ) + mbb_xy -= s->mb_stride; + }else + mbb_xy = mb_x + (mb_y-1)*s->mb_stride; + }else{ + int mb_xy = h->mb_xy; + mba_xy = mb_xy - 1; + mbb_xy = mb_xy - (s->mb_stride << FIELD_PICTURE); + } + + if( h->slice_table[mba_xy] == h->slice_num && !IS_SKIP( s->current_picture.mb_type[mba_xy] )) + ctx++; + if( h->slice_table[mbb_xy] == h->slice_num && !IS_SKIP( s->current_picture.mb_type[mbb_xy] )) + ctx++; + + if( h->slice_type_nos == FF_B_TYPE ) + ctx += 13; + return get_cabac_noinline( &h->cabac, &h->cabac_state[11+ctx] ); +} + +static int decode_cabac_mb_intra4x4_pred_mode( H264Context *h, int pred_mode ) { + int mode = 0; + + if( get_cabac( &h->cabac, &h->cabac_state[68] ) ) + return pred_mode; + + mode += 1 * get_cabac( &h->cabac, &h->cabac_state[69] ); + mode += 2 * get_cabac( &h->cabac, &h->cabac_state[69] ); + mode += 4 * get_cabac( &h->cabac, &h->cabac_state[69] ); + + return mode + ( mode >= pred_mode ); +} + +static int decode_cabac_mb_chroma_pre_mode( H264Context *h) { + const int mba_xy = h->left_mb_xy[0]; + const int mbb_xy = h->top_mb_xy; + + int ctx = 0; + + /* No need to test for IS_INTRA4x4 and IS_INTRA16x16, as we set chroma_pred_mode_table to 0 */ + if( h->left_type[0] && h->chroma_pred_mode_table[mba_xy] != 0 ) + ctx++; + + if( h->top_type && h->chroma_pred_mode_table[mbb_xy] != 0 ) + ctx++; + + if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+ctx] ) == 0 ) + return 0; + + if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+3] ) == 0 ) + return 1; + if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+3] ) == 0 ) + return 2; + else + return 3; +} + +static int decode_cabac_mb_cbp_luma( H264Context *h) { + int cbp_b, cbp_a, ctx, cbp = 0; + + cbp_a = h->left_cbp; + cbp_b = h->top_cbp; + + ctx = !(cbp_a & 0x02) + 2 * !(cbp_b & 0x04); + cbp += get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]); + ctx = !(cbp & 0x01) + 2 * !(cbp_b & 0x08); + cbp += get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]) << 1; + ctx = !(cbp_a & 0x08) + 2 * !(cbp & 0x01); + cbp += get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]) << 2; + ctx = !(cbp & 0x04) + 2 * !(cbp & 0x02); + cbp += get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]) << 3; + return cbp; +} +static int decode_cabac_mb_cbp_chroma( H264Context *h) { + int ctx; + int cbp_a, cbp_b; + + cbp_a = (h->left_cbp>>4)&0x03; + cbp_b = (h-> top_cbp>>4)&0x03; + + ctx = 0; + if( cbp_a > 0 ) ctx++; + if( cbp_b > 0 ) ctx += 2; + if( get_cabac_noinline( &h->cabac, &h->cabac_state[77 + ctx] ) == 0 ) + return 0; + + ctx = 4; + if( cbp_a == 2 ) ctx++; + if( cbp_b == 2 ) ctx += 2; + return 1 + get_cabac_noinline( &h->cabac, &h->cabac_state[77 + ctx] ); +} + +static int decode_cabac_p_mb_sub_type( H264Context *h ) { + if( get_cabac( &h->cabac, &h->cabac_state[21] ) ) + return 0; /* 8x8 */ + if( !get_cabac( &h->cabac, &h->cabac_state[22] ) ) + return 1; /* 8x4 */ + if( get_cabac( &h->cabac, &h->cabac_state[23] ) ) + return 2; /* 4x8 */ + return 3; /* 4x4 */ +} +static int decode_cabac_b_mb_sub_type( H264Context *h ) { + int type; + if( !get_cabac( &h->cabac, &h->cabac_state[36] ) ) + return 0; /* B_Direct_8x8 */ + if( !get_cabac( &h->cabac, &h->cabac_state[37] ) ) + return 1 + get_cabac( &h->cabac, &h->cabac_state[39] ); /* B_L0_8x8, B_L1_8x8 */ + type = 3; + if( get_cabac( &h->cabac, &h->cabac_state[38] ) ) { + if( get_cabac( &h->cabac, &h->cabac_state[39] ) ) + return 11 + get_cabac( &h->cabac, &h->cabac_state[39] ); /* B_L1_4x4, B_Bi_4x4 */ + type += 4; + } + type += 2*get_cabac( &h->cabac, &h->cabac_state[39] ); + type += get_cabac( &h->cabac, &h->cabac_state[39] ); + return type; +} + +static int decode_cabac_mb_ref( H264Context *h, int list, int n ) { + int refa = h->ref_cache[list][scan8[n] - 1]; + int refb = h->ref_cache[list][scan8[n] - 8]; + int ref = 0; + int ctx = 0; + + if( h->slice_type_nos == FF_B_TYPE) { + if( refa > 0 && !(h->direct_cache[scan8[n] - 1]&(MB_TYPE_DIRECT2>>1)) ) + ctx++; + if( refb > 0 && !(h->direct_cache[scan8[n] - 8]&(MB_TYPE_DIRECT2>>1)) ) + ctx += 2; + } else { + if( refa > 0 ) + ctx++; + if( refb > 0 ) + ctx += 2; + } + + while( get_cabac( &h->cabac, &h->cabac_state[54+ctx] ) ) { + ref++; + ctx = (ctx>>2)+4; + if(ref >= 32 /*h->ref_list[list]*/){ + return -1; + } + } + return ref; +} + +static int decode_cabac_mb_mvd( H264Context *h, int ctxbase, int amvd, int *mvda) { + int mvd; + + if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+((amvd-3)>>(INT_BIT-1))+((amvd-33)>>(INT_BIT-1))+2])){ +// if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+(amvd>2)+(amvd>32)])){ + *mvda= 0; + return 0; + } + + mvd= 1; + ctxbase+= 3; + while( mvd < 9 && get_cabac( &h->cabac, &h->cabac_state[ctxbase] ) ) { + if( mvd < 4 ) + ctxbase++; + mvd++; + } + + if( mvd >= 9 ) { + int k = 3; + while( get_cabac_bypass( &h->cabac ) ) { + mvd += 1 << k; + k++; + if(k>24){ + av_log(h->s.avctx, AV_LOG_ERROR, "overflow in decode_cabac_mb_mvd\n"); + return INT_MIN; + } + } + while( k-- ) { + mvd += get_cabac_bypass( &h->cabac )<cabac, -mvd ); +} + +#define DECODE_CABAC_MB_MVD( h, list, n )\ +{\ + int amvd0 = h->mvd_cache[list][scan8[n] - 1][0] +\ + h->mvd_cache[list][scan8[n] - 8][0];\ + int amvd1 = h->mvd_cache[list][scan8[n] - 1][1] +\ + h->mvd_cache[list][scan8[n] - 8][1];\ +\ + mx += decode_cabac_mb_mvd( h, 40, amvd0, &mpx );\ + my += decode_cabac_mb_mvd( h, 47, amvd1, &mpy );\ +} + +static av_always_inline int get_cabac_cbf_ctx( H264Context *h, int cat, int idx, int is_dc ) { + int nza, nzb; + int ctx = 0; + + if( is_dc ) { + if( cat == 0 ) { + nza = h->left_cbp&0x100; + nzb = h-> top_cbp&0x100; + } else { + idx -= CHROMA_DC_BLOCK_INDEX; + nza = (h->left_cbp>>(6+idx))&0x01; + nzb = (h-> top_cbp>>(6+idx))&0x01; + } + } else { + assert(cat == 1 || cat == 2 || cat == 4); + nza = h->non_zero_count_cache[scan8[idx] - 1]; + nzb = h->non_zero_count_cache[scan8[idx] - 8]; + } + + if( nza > 0 ) + ctx++; + + if( nzb > 0 ) + ctx += 2; + + return ctx + 4 * cat; +} + +DECLARE_ASM_CONST(1, uint8_t, last_coeff_flag_offset_8x8)[63] = { + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8 +}; + +static av_always_inline void decode_cabac_residual_internal( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff, int is_dc ) { + static const int significant_coeff_flag_offset[2][6] = { + { 105+0, 105+15, 105+29, 105+44, 105+47, 402 }, + { 277+0, 277+15, 277+29, 277+44, 277+47, 436 } + }; + static const int last_coeff_flag_offset[2][6] = { + { 166+0, 166+15, 166+29, 166+44, 166+47, 417 }, + { 338+0, 338+15, 338+29, 338+44, 338+47, 451 } + }; + static const int coeff_abs_level_m1_offset[6] = { + 227+0, 227+10, 227+20, 227+30, 227+39, 426 + }; + static const uint8_t significant_coeff_flag_offset_8x8[2][63] = { + { 0, 1, 2, 3, 4, 5, 5, 4, 4, 3, 3, 4, 4, 4, 5, 5, + 4, 4, 4, 4, 3, 3, 6, 7, 7, 7, 8, 9,10, 9, 8, 7, + 7, 6,11,12,13,11, 6, 7, 8, 9,14,10, 9, 8, 6,11, + 12,13,11, 6, 9,14,10, 9,11,12,13,11,14,10,12 }, + { 0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 7, 7, 8, 4, 5, + 6, 9,10,10, 8,11,12,11, 9, 9,10,10, 8,11,12,11, + 9, 9,10,10, 8,11,12,11, 9, 9,10,10, 8,13,13, 9, + 9,10,10, 8,13,13, 9, 9,10,10,14,14,14,14,14 } + }; + /* node ctx: 0..3: abslevel1 (with abslevelgt1 == 0). + * 4..7: abslevelgt1 + 3 (and abslevel1 doesn't matter). + * map node ctx => cabac ctx for level=1 */ + static const uint8_t coeff_abs_level1_ctx[8] = { 1, 2, 3, 4, 0, 0, 0, 0 }; + /* map node ctx => cabac ctx for level>1 */ + static const uint8_t coeff_abs_levelgt1_ctx[8] = { 5, 5, 5, 5, 6, 7, 8, 9 }; + static const uint8_t coeff_abs_level_transition[2][8] = { + /* update node ctx after decoding a level=1 */ + { 1, 2, 3, 3, 4, 5, 6, 7 }, + /* update node ctx after decoding a level>1 */ + { 4, 4, 4, 4, 5, 6, 7, 7 } + }; + + int index[64]; + + int av_unused last; + int coeff_count = 0; + int node_ctx = 0; + + uint8_t *significant_coeff_ctx_base; + uint8_t *last_coeff_ctx_base; + uint8_t *abs_level_m1_ctx_base; + +#if !ARCH_X86 +#define CABAC_ON_STACK +#endif +#ifdef CABAC_ON_STACK +#define CC &cc + CABACContext cc; + cc.range = h->cabac.range; + cc.low = h->cabac.low; + cc.bytestream= h->cabac.bytestream; +#else +#define CC &h->cabac +#endif + + significant_coeff_ctx_base = h->cabac_state + + significant_coeff_flag_offset[MB_FIELD][cat]; + last_coeff_ctx_base = h->cabac_state + + last_coeff_flag_offset[MB_FIELD][cat]; + abs_level_m1_ctx_base = h->cabac_state + + coeff_abs_level_m1_offset[cat]; + + if( !is_dc && cat == 5 ) { +#define DECODE_SIGNIFICANCE( coefs, sig_off, last_off ) \ + for(last= 0; last < coefs; last++) { \ + uint8_t *sig_ctx = significant_coeff_ctx_base + sig_off; \ + if( get_cabac( CC, sig_ctx )) { \ + uint8_t *last_ctx = last_coeff_ctx_base + last_off; \ + index[coeff_count++] = last; \ + if( get_cabac( CC, last_ctx ) ) { \ + last= max_coeff; \ + break; \ + } \ + } \ + }\ + if( last == max_coeff -1 ) {\ + index[coeff_count++] = last;\ + } + const uint8_t *sig_off = significant_coeff_flag_offset_8x8[MB_FIELD]; +#if ARCH_X86 && HAVE_7REGS && HAVE_EBX_AVAILABLE && !defined(BROKEN_RELOCATIONS) + coeff_count= decode_significance_8x8_x86(CC, significant_coeff_ctx_base, index, sig_off); + } else { + coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index); +#else + DECODE_SIGNIFICANCE( 63, sig_off[last], last_coeff_flag_offset_8x8[last] ); + } else { + DECODE_SIGNIFICANCE( max_coeff - 1, last, last ); +#endif + } + assert(coeff_count > 0); + + if( is_dc ) { + if( cat == 0 ) + h->cbp_table[h->mb_xy] |= 0x100; + else + h->cbp_table[h->mb_xy] |= 0x40 << (n - CHROMA_DC_BLOCK_INDEX); + h->non_zero_count_cache[scan8[n]] = coeff_count; + } else { + if( cat == 5 ) + fill_rectangle(&h->non_zero_count_cache[scan8[n]], 2, 2, 8, coeff_count, 1); + else { + assert( cat == 1 || cat == 2 || cat == 4 ); + h->non_zero_count_cache[scan8[n]] = coeff_count; + } + } + + do { + uint8_t *ctx = coeff_abs_level1_ctx[node_ctx] + abs_level_m1_ctx_base; + + int j= scantable[index[--coeff_count]]; + + if( get_cabac( CC, ctx ) == 0 ) { + node_ctx = coeff_abs_level_transition[0][node_ctx]; + if( is_dc ) { + block[j] = get_cabac_bypass_sign( CC, -1); + }else{ + block[j] = (get_cabac_bypass_sign( CC, -qmul[j]) + 32) >> 6; + } + } else { + int coeff_abs = 2; + ctx = coeff_abs_levelgt1_ctx[node_ctx] + abs_level_m1_ctx_base; + node_ctx = coeff_abs_level_transition[1][node_ctx]; + + while( coeff_abs < 15 && get_cabac( CC, ctx ) ) { + coeff_abs++; + } + + if( coeff_abs >= 15 ) { + int j = 0; + while( get_cabac_bypass( CC ) ) { + j++; + } + + coeff_abs=1; + while( j-- ) { + coeff_abs += coeff_abs + get_cabac_bypass( CC ); + } + coeff_abs+= 14; + } + + if( is_dc ) { + block[j] = get_cabac_bypass_sign( CC, -coeff_abs ); + }else{ + block[j] = (get_cabac_bypass_sign( CC, -coeff_abs ) * qmul[j] + 32) >> 6; + } + } + } while( coeff_count ); +#ifdef CABAC_ON_STACK + h->cabac.range = cc.range ; + h->cabac.low = cc.low ; + h->cabac.bytestream= cc.bytestream; +#endif + +} + +static void decode_cabac_residual_dc_internal( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, int max_coeff ) { + decode_cabac_residual_internal(h, block, cat, n, scantable, NULL, max_coeff, 1); +} + +static void decode_cabac_residual_nondc_internal( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff ) { + decode_cabac_residual_internal(h, block, cat, n, scantable, qmul, max_coeff, 0); +} + +/* cat: 0-> DC 16x16 n = 0 + * 1-> AC 16x16 n = luma4x4idx + * 2-> Luma4x4 n = luma4x4idx + * 3-> DC Chroma n = iCbCr + * 4-> AC Chroma n = 16 + 4 * iCbCr + chroma4x4idx + * 5-> Luma8x8 n = 4 * luma8x8idx */ + +/* Partially inline the CABAC residual decode: inline the coded block flag. + * This has very little impact on binary size and improves performance + * because it allows improved constant propagation into get_cabac_cbf_ctx, + * as well as because most blocks have zero CBFs. */ + +static av_always_inline void decode_cabac_residual_dc( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, int max_coeff ) { + /* read coded block flag */ + if( get_cabac( &h->cabac, &h->cabac_state[85 + get_cabac_cbf_ctx( h, cat, n, 1 ) ] ) == 0 ) { + h->non_zero_count_cache[scan8[n]] = 0; + return; + } + decode_cabac_residual_dc_internal( h, block, cat, n, scantable, max_coeff ); +} + +static av_always_inline void decode_cabac_residual_nondc( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff ) { + /* read coded block flag */ + if( cat != 5 && get_cabac( &h->cabac, &h->cabac_state[85 + get_cabac_cbf_ctx( h, cat, n, 0 ) ] ) == 0 ) { + h->non_zero_count_cache[scan8[n]] = 0; + return; + } + decode_cabac_residual_nondc_internal( h, block, cat, n, scantable, qmul, max_coeff ); +} + +/** + * decodes a macroblock + * @return 0 if OK, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed + */ +int ff_h264_decode_mb_cabac(H264Context *h) { + MpegEncContext * const s = &h->s; + int mb_xy; + int mb_type, partition_count, cbp = 0; + int dct8x8_allowed= h->pps.transform_8x8_mode; + + mb_xy = h->mb_xy = s->mb_x + s->mb_y*s->mb_stride; + + tprintf(s->avctx, "pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y); + if( h->slice_type_nos != FF_I_TYPE ) { + int skip; + /* a skipped mb needs the aff flag from the following mb */ + if( FRAME_MBAFF && (s->mb_y&1)==1 && h->prev_mb_skipped ) + skip = h->next_mb_skipped; + else + skip = decode_cabac_mb_skip( h, s->mb_x, s->mb_y ); + /* read skip flags */ + if( skip ) { + if( FRAME_MBAFF && (s->mb_y&1)==0 ){ + s->current_picture.mb_type[mb_xy] = MB_TYPE_SKIP; + h->next_mb_skipped = decode_cabac_mb_skip( h, s->mb_x, s->mb_y+1 ); + if(!h->next_mb_skipped) + h->mb_mbaff = h->mb_field_decoding_flag = decode_cabac_field_decoding_flag(h); + } + + decode_mb_skip(h); + + h->cbp_table[mb_xy] = 0; + h->chroma_pred_mode_table[mb_xy] = 0; + h->last_qscale_diff = 0; + + return 0; + + } + } + if(FRAME_MBAFF){ + if( (s->mb_y&1) == 0 ) + h->mb_mbaff = + h->mb_field_decoding_flag = decode_cabac_field_decoding_flag(h); + } + + h->prev_mb_skipped = 0; + + fill_decode_neighbors(h, -(MB_FIELD)); + + if( h->slice_type_nos == FF_B_TYPE ) { + int ctx = 0; + assert(h->slice_type_nos == FF_B_TYPE); + + if( !IS_DIRECT( h->left_type[0]-1 ) ) + ctx++; + if( !IS_DIRECT( h->top_type-1 ) ) + ctx++; + + if( !get_cabac_noinline( &h->cabac, &h->cabac_state[27+ctx] ) ){ + mb_type= 0; /* B_Direct_16x16 */ + }else if( !get_cabac_noinline( &h->cabac, &h->cabac_state[27+3] ) ) { + mb_type= 1 + get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ); /* B_L[01]_16x16 */ + }else{ + int bits; + bits = get_cabac_noinline( &h->cabac, &h->cabac_state[27+4] ) << 3; + bits+= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ) << 2; + bits+= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ) << 1; + bits+= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ); + if( bits < 8 ){ + mb_type= bits + 3; /* B_Bi_16x16 through B_L1_L0_16x8 */ + }else if( bits == 13 ){ + mb_type= decode_cabac_intra_mb_type(h, 32, 0); + goto decode_intra_mb; + }else if( bits == 14 ){ + mb_type= 11; /* B_L1_L0_8x16 */ + }else if( bits == 15 ){ + mb_type= 22; /* B_8x8 */ + }else{ + bits= ( bits<<1 ) + get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ); + mb_type= bits - 4; /* B_L0_Bi_* through B_Bi_Bi_* */ + } + } + partition_count= b_mb_type_info[mb_type].partition_count; + mb_type= b_mb_type_info[mb_type].type; + } else if( h->slice_type_nos == FF_P_TYPE ) { + if( get_cabac_noinline( &h->cabac, &h->cabac_state[14] ) == 0 ) { + /* P-type */ + if( get_cabac_noinline( &h->cabac, &h->cabac_state[15] ) == 0 ) { + /* P_L0_D16x16, P_8x8 */ + mb_type= 3 * get_cabac_noinline( &h->cabac, &h->cabac_state[16] ); + } else { + /* P_L0_D8x16, P_L0_D16x8 */ + mb_type= 2 - get_cabac_noinline( &h->cabac, &h->cabac_state[17] ); + } + partition_count= p_mb_type_info[mb_type].partition_count; + mb_type= p_mb_type_info[mb_type].type; + } else { + mb_type= decode_cabac_intra_mb_type(h, 17, 0); + goto decode_intra_mb; + } + } else { + mb_type= decode_cabac_intra_mb_type(h, 3, 1); + if(h->slice_type == FF_SI_TYPE && mb_type) + mb_type--; + assert(h->slice_type_nos == FF_I_TYPE); +decode_intra_mb: + partition_count = 0; + cbp= i_mb_type_info[mb_type].cbp; + h->intra16x16_pred_mode= i_mb_type_info[mb_type].pred_mode; + mb_type= i_mb_type_info[mb_type].type; + } + if(MB_FIELD) + mb_type |= MB_TYPE_INTERLACED; + + h->slice_table[ mb_xy ]= h->slice_num; + + if(IS_INTRA_PCM(mb_type)) { + const uint8_t *ptr; + + // We assume these blocks are very rare so we do not optimize it. + // FIXME The two following lines get the bitstream position in the cabac + // decode, I think it should be done by a function in cabac.h (or cabac.c). + ptr= h->cabac.bytestream; + if(h->cabac.low&0x1) ptr--; + if(CABAC_BITS==16){ + if(h->cabac.low&0x1FF) ptr--; + } + + // The pixels are stored in the same order as levels in h->mb array. + memcpy(h->mb, ptr, 256); ptr+=256; + if(CHROMA){ + memcpy(h->mb+128, ptr, 128); ptr+=128; + } + + ff_init_cabac_decoder(&h->cabac, ptr, h->cabac.bytestream_end - ptr); + + // All blocks are present + h->cbp_table[mb_xy] = 0x1ef; + h->chroma_pred_mode_table[mb_xy] = 0; + // In deblocking, the quantizer is 0 + s->current_picture.qscale_table[mb_xy]= 0; + // All coeffs are present + memset(h->non_zero_count[mb_xy], 16, 32); + s->current_picture.mb_type[mb_xy]= mb_type; + h->last_qscale_diff = 0; + return 0; + } + + if(MB_MBAFF){ + h->ref_count[0] <<= 1; + h->ref_count[1] <<= 1; + } + + fill_decode_caches(h, mb_type); + + if( IS_INTRA( mb_type ) ) { + int i, pred_mode; + if( IS_INTRA4x4( mb_type ) ) { + if( dct8x8_allowed && get_cabac_noinline( &h->cabac, &h->cabac_state[399 + h->neighbor_transform_size] ) ) { + mb_type |= MB_TYPE_8x8DCT; + for( i = 0; i < 16; i+=4 ) { + int pred = pred_intra_mode( h, i ); + int mode = decode_cabac_mb_intra4x4_pred_mode( h, pred ); + fill_rectangle( &h->intra4x4_pred_mode_cache[ scan8[i] ], 2, 2, 8, mode, 1 ); + } + } else { + for( i = 0; i < 16; i++ ) { + int pred = pred_intra_mode( h, i ); + h->intra4x4_pred_mode_cache[ scan8[i] ] = decode_cabac_mb_intra4x4_pred_mode( h, pred ); + + //av_log( s->avctx, AV_LOG_ERROR, "i4x4 pred=%d mode=%d\n", pred, h->intra4x4_pred_mode_cache[ scan8[i] ] ); + } + } + ff_h264_write_back_intra_pred_mode(h); + if( ff_h264_check_intra4x4_pred_mode(h) < 0 ) return -1; + } else { + h->intra16x16_pred_mode= ff_h264_check_intra_pred_mode( h, h->intra16x16_pred_mode ); + if( h->intra16x16_pred_mode < 0 ) return -1; + } + if(CHROMA){ + h->chroma_pred_mode_table[mb_xy] = + pred_mode = decode_cabac_mb_chroma_pre_mode( h ); + + pred_mode= ff_h264_check_intra_pred_mode( h, pred_mode ); + if( pred_mode < 0 ) return -1; + h->chroma_pred_mode= pred_mode; + } else { + h->chroma_pred_mode= DC_128_PRED8x8; + } + } else if( partition_count == 4 ) { + int i, j, sub_partition_count[4], list, ref[2][4]; + + if( h->slice_type_nos == FF_B_TYPE ) { + for( i = 0; i < 4; i++ ) { + h->sub_mb_type[i] = decode_cabac_b_mb_sub_type( h ); + sub_partition_count[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count; + h->sub_mb_type[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].type; + } + if( IS_DIRECT(h->sub_mb_type[0] | h->sub_mb_type[1] | + h->sub_mb_type[2] | h->sub_mb_type[3]) ) { + ff_h264_pred_direct_motion(h, &mb_type); + h->ref_cache[0][scan8[4]] = + h->ref_cache[1][scan8[4]] = + h->ref_cache[0][scan8[12]] = + h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE; + for( i = 0; i < 4; i++ ) + fill_rectangle( &h->direct_cache[scan8[4*i]], 2, 2, 8, (h->sub_mb_type[i]>>1)&0xFF, 1 ); + } + } else { + for( i = 0; i < 4; i++ ) { + h->sub_mb_type[i] = decode_cabac_p_mb_sub_type( h ); + sub_partition_count[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count; + h->sub_mb_type[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].type; + } + } + + for( list = 0; list < h->list_count; list++ ) { + for( i = 0; i < 4; i++ ) { + if(IS_DIRECT(h->sub_mb_type[i])) continue; + if(IS_DIR(h->sub_mb_type[i], 0, list)){ + if( h->ref_count[list] > 1 ){ + ref[list][i] = decode_cabac_mb_ref( h, list, 4*i ); + if(ref[list][i] >= (unsigned)h->ref_count[list]){ + av_log(s->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref[list][i], h->ref_count[list]); + return -1; + } + }else + ref[list][i] = 0; + } else { + ref[list][i] = -1; + } + h->ref_cache[list][ scan8[4*i]+1 ]= + h->ref_cache[list][ scan8[4*i]+8 ]=h->ref_cache[list][ scan8[4*i]+9 ]= ref[list][i]; + } + } + + if(dct8x8_allowed) + dct8x8_allowed = get_dct8x8_allowed(h); + + for(list=0; listlist_count; list++){ + for(i=0; i<4; i++){ + h->ref_cache[list][ scan8[4*i] ]=h->ref_cache[list][ scan8[4*i]+1 ]; + if(IS_DIRECT(h->sub_mb_type[i])){ + fill_rectangle(h->mvd_cache[list][scan8[4*i]], 2, 2, 8, 0, 2); + continue; + } + + if(IS_DIR(h->sub_mb_type[i], 0, list) && !IS_DIRECT(h->sub_mb_type[i])){ + const int sub_mb_type= h->sub_mb_type[i]; + const int block_width= (sub_mb_type & (MB_TYPE_16x16|MB_TYPE_16x8)) ? 2 : 1; + for(j=0; jmv_cache[list][ scan8[index] ]; + uint8_t (* mvd_cache)[2]= &h->mvd_cache[list][ scan8[index] ]; + pred_motion(h, index, block_width, list, h->ref_cache[list][ scan8[index] ], &mx, &my); + DECODE_CABAC_MB_MVD( h, list, index) + tprintf(s->avctx, "final mv:%d %d\n", mx, my); + + if(IS_SUB_8X8(sub_mb_type)){ + mv_cache[ 1 ][0]= + mv_cache[ 8 ][0]= mv_cache[ 9 ][0]= mx; + mv_cache[ 1 ][1]= + mv_cache[ 8 ][1]= mv_cache[ 9 ][1]= my; + + mvd_cache[ 1 ][0]= + mvd_cache[ 8 ][0]= mvd_cache[ 9 ][0]= mpx; + mvd_cache[ 1 ][1]= + mvd_cache[ 8 ][1]= mvd_cache[ 9 ][1]= mpy; + }else if(IS_SUB_8X4(sub_mb_type)){ + mv_cache[ 1 ][0]= mx; + mv_cache[ 1 ][1]= my; + + mvd_cache[ 1 ][0]= mpx; + mvd_cache[ 1 ][1]= mpy; + }else if(IS_SUB_4X8(sub_mb_type)){ + mv_cache[ 8 ][0]= mx; + mv_cache[ 8 ][1]= my; + + mvd_cache[ 8 ][0]= mpx; + mvd_cache[ 8 ][1]= mpy; + } + mv_cache[ 0 ][0]= mx; + mv_cache[ 0 ][1]= my; + + mvd_cache[ 0 ][0]= mpx; + mvd_cache[ 0 ][1]= mpy; + } + }else{ + fill_rectangle(h->mv_cache [list][ scan8[4*i] ], 2, 2, 8, 0, 4); + fill_rectangle(h->mvd_cache[list][ scan8[4*i] ], 2, 2, 8, 0, 2); + } + } + } + } else if( IS_DIRECT(mb_type) ) { + ff_h264_pred_direct_motion(h, &mb_type); + fill_rectangle(h->mvd_cache[0][scan8[0]], 4, 4, 8, 0, 2); + fill_rectangle(h->mvd_cache[1][scan8[0]], 4, 4, 8, 0, 2); + dct8x8_allowed &= h->sps.direct_8x8_inference_flag; + } else { + int list, i; + if(IS_16X16(mb_type)){ + for(list=0; listlist_count; list++){ + if(IS_DIR(mb_type, 0, list)){ + int ref; + if(h->ref_count[list] > 1){ + ref= decode_cabac_mb_ref(h, list, 0); + if(ref >= (unsigned)h->ref_count[list]){ + av_log(s->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref, h->ref_count[list]); + return -1; + } + }else + ref=0; + fill_rectangle(&h->ref_cache[list][ scan8[0] ], 4, 4, 8, ref, 1); + } + } + for(list=0; listlist_count; list++){ + if(IS_DIR(mb_type, 0, list)){ + int mx,my,mpx,mpy; + pred_motion(h, 0, 4, list, h->ref_cache[list][ scan8[0] ], &mx, &my); + DECODE_CABAC_MB_MVD( h, list, 0) + tprintf(s->avctx, "final mv:%d %d\n", mx, my); + + fill_rectangle(h->mvd_cache[list][ scan8[0] ], 4, 4, 8, pack8to16(mpx,mpy), 2); + fill_rectangle(h->mv_cache[list][ scan8[0] ], 4, 4, 8, pack16to32(mx,my), 4); + } + } + } + else if(IS_16X8(mb_type)){ + for(list=0; listlist_count; list++){ + for(i=0; i<2; i++){ + if(IS_DIR(mb_type, i, list)){ + int ref; + if(h->ref_count[list] > 1){ + ref= decode_cabac_mb_ref( h, list, 8*i ); + if(ref >= (unsigned)h->ref_count[list]){ + av_log(s->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref, h->ref_count[list]); + return -1; + } + }else + ref=0; + fill_rectangle(&h->ref_cache[list][ scan8[0] + 16*i ], 4, 2, 8, ref, 1); + }else + fill_rectangle(&h->ref_cache[list][ scan8[0] + 16*i ], 4, 2, 8, (LIST_NOT_USED&0xFF), 1); + } + } + for(list=0; listlist_count; list++){ + for(i=0; i<2; i++){ + if(IS_DIR(mb_type, i, list)){ + int mx,my,mpx,mpy; + pred_16x8_motion(h, 8*i, list, h->ref_cache[list][scan8[0] + 16*i], &mx, &my); + DECODE_CABAC_MB_MVD( h, list, 8*i) + tprintf(s->avctx, "final mv:%d %d\n", mx, my); + + fill_rectangle(h->mvd_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack8to16(mpx,mpy), 2); + fill_rectangle(h->mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack16to32(mx,my), 4); + }else{ + fill_rectangle(h->mvd_cache[list][ scan8[0] + 16*i ], 4, 2, 8, 0, 2); + fill_rectangle(h-> mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, 0, 4); + } + } + } + }else{ + assert(IS_8X16(mb_type)); + for(list=0; listlist_count; list++){ + for(i=0; i<2; i++){ + if(IS_DIR(mb_type, i, list)){ //FIXME optimize + int ref; + if(h->ref_count[list] > 1){ + ref= decode_cabac_mb_ref( h, list, 4*i ); + if(ref >= (unsigned)h->ref_count[list]){ + av_log(s->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref, h->ref_count[list]); + return -1; + } + }else + ref=0; + fill_rectangle(&h->ref_cache[list][ scan8[0] + 2*i ], 2, 4, 8, ref, 1); + }else + fill_rectangle(&h->ref_cache[list][ scan8[0] + 2*i ], 2, 4, 8, (LIST_NOT_USED&0xFF), 1); + } + } + for(list=0; listlist_count; list++){ + for(i=0; i<2; i++){ + if(IS_DIR(mb_type, i, list)){ + int mx,my,mpx,mpy; + pred_8x16_motion(h, i*4, list, h->ref_cache[list][ scan8[0] + 2*i ], &mx, &my); + DECODE_CABAC_MB_MVD( h, list, 4*i) + + tprintf(s->avctx, "final mv:%d %d\n", mx, my); + fill_rectangle(h->mvd_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack8to16(mpx,mpy), 2); + fill_rectangle(h->mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack16to32(mx,my), 4); + }else{ + fill_rectangle(h->mvd_cache[list][ scan8[0] + 2*i ], 2, 4, 8, 0, 2); + fill_rectangle(h-> mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, 0, 4); + } + } + } + } + } + + if( IS_INTER( mb_type ) ) { + h->chroma_pred_mode_table[mb_xy] = 0; + write_back_motion( h, mb_type ); + } + + if( !IS_INTRA16x16( mb_type ) ) { + cbp = decode_cabac_mb_cbp_luma( h ); + if(CHROMA) + cbp |= decode_cabac_mb_cbp_chroma( h ) << 4; + } + + h->cbp_table[mb_xy] = h->cbp = cbp; + + if( dct8x8_allowed && (cbp&15) && !IS_INTRA( mb_type ) ) { + mb_type |= MB_TYPE_8x8DCT * get_cabac_noinline( &h->cabac, &h->cabac_state[399 + h->neighbor_transform_size] ); + } + s->current_picture.mb_type[mb_xy]= mb_type; + + if( cbp || IS_INTRA16x16( mb_type ) ) { + const uint8_t *scan, *scan8x8; + const uint32_t *qmul; + + if(IS_INTERLACED(mb_type)){ + scan8x8= s->qscale ? h->field_scan8x8 : h->field_scan8x8_q0; + scan= s->qscale ? h->field_scan : h->field_scan_q0; + }else{ + scan8x8= s->qscale ? h->zigzag_scan8x8 : h->zigzag_scan8x8_q0; + scan= s->qscale ? h->zigzag_scan : h->zigzag_scan_q0; + } + + // decode_cabac_mb_dqp + if(get_cabac_noinline( &h->cabac, &h->cabac_state[60 + (h->last_qscale_diff != 0)])){ + int val = 1; + int ctx= 2; + + while( get_cabac_noinline( &h->cabac, &h->cabac_state[60 + ctx] ) ) { + ctx= 3; + val++; + if(val > 102){ //prevent infinite loop + av_log(h->s.avctx, AV_LOG_ERROR, "cabac decode of qscale diff failed at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + } + + if( val&0x01 ) + val= (val + 1)>>1 ; + else + val= -((val + 1)>>1); + h->last_qscale_diff = val; + s->qscale += val; + if(((unsigned)s->qscale) > 51){ + if(s->qscale<0) s->qscale+= 52; + else s->qscale-= 52; + } + h->chroma_qp[0] = get_chroma_qp(h, 0, s->qscale); + h->chroma_qp[1] = get_chroma_qp(h, 1, s->qscale); + }else + h->last_qscale_diff=0; + + if( IS_INTRA16x16( mb_type ) ) { + int i; + //av_log( s->avctx, AV_LOG_ERROR, "INTRA16x16 DC\n" ); + AV_ZERO128(h->mb_luma_dc+0); + AV_ZERO128(h->mb_luma_dc+8); + decode_cabac_residual_dc( h, h->mb_luma_dc, 0, LUMA_DC_BLOCK_INDEX, scan, 16); + + if( cbp&15 ) { + qmul = h->dequant4_coeff[0][s->qscale]; + for( i = 0; i < 16; i++ ) { + //av_log( s->avctx, AV_LOG_ERROR, "INTRA16x16 AC:%d\n", i ); + decode_cabac_residual_nondc(h, h->mb + 16*i, 1, i, scan + 1, qmul, 15); + } + } else { + fill_rectangle(&h->non_zero_count_cache[scan8[0]], 4, 4, 8, 0, 1); + } + } else { + int i8x8, i4x4; + for( i8x8 = 0; i8x8 < 4; i8x8++ ) { + if( cbp & (1<mb + 64*i8x8, 5, 4*i8x8, + scan8x8, h->dequant8_coeff[IS_INTRA( mb_type ) ? 0:1][s->qscale], 64); + } else { + qmul = h->dequant4_coeff[IS_INTRA( mb_type ) ? 0:3][s->qscale]; + for( i4x4 = 0; i4x4 < 4; i4x4++ ) { + const int index = 4*i8x8 + i4x4; + //av_log( s->avctx, AV_LOG_ERROR, "Luma4x4: %d\n", index ); +//START_TIMER + decode_cabac_residual_nondc(h, h->mb + 16*index, 2, index, scan, qmul, 16); +//STOP_TIMER("decode_residual") + } + } + } else { + uint8_t * const nnz= &h->non_zero_count_cache[ scan8[4*i8x8] ]; + nnz[0] = nnz[1] = nnz[8] = nnz[9] = 0; + } + } + } + + if( cbp&0x30 ){ + int c; + for( c = 0; c < 2; c++ ) { + //av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-DC\n",c ); + decode_cabac_residual_dc(h, h->mb + 256 + 16*4*c, 3, CHROMA_DC_BLOCK_INDEX+c, chroma_dc_scan, 4); + } + } + + if( cbp&0x20 ) { + int c, i; + for( c = 0; c < 2; c++ ) { + qmul = h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[c]]; + for( i = 0; i < 4; i++ ) { + const int index = 16 + 4 * c + i; + //av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-AC %d\n",c, index - 16 ); + decode_cabac_residual_nondc(h, h->mb + 16*index, 4, index, scan + 1, qmul, 15); + } + } + } else { + uint8_t * const nnz= &h->non_zero_count_cache[0]; + nnz[ scan8[16]+0 ] = nnz[ scan8[16]+1 ] =nnz[ scan8[16]+8 ] =nnz[ scan8[16]+9 ] = + nnz[ scan8[20]+0 ] = nnz[ scan8[20]+1 ] =nnz[ scan8[20]+8 ] =nnz[ scan8[20]+9 ] = 0; + } + } else { + uint8_t * const nnz= &h->non_zero_count_cache[0]; + fill_rectangle(&nnz[scan8[0]], 4, 4, 8, 0, 1); + nnz[ scan8[16]+0 ] = nnz[ scan8[16]+1 ] =nnz[ scan8[16]+8 ] =nnz[ scan8[16]+9 ] = + nnz[ scan8[20]+0 ] = nnz[ scan8[20]+1 ] =nnz[ scan8[20]+8 ] =nnz[ scan8[20]+9 ] = 0; + h->last_qscale_diff = 0; + } + + s->current_picture.qscale_table[mb_xy]= s->qscale; + write_back_non_zero_count(h); + + if(MB_MBAFF){ + h->ref_count[0] >>= 1; + h->ref_count[1] >>= 1; + } + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_cavlc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_cavlc.c new file mode 100644 index 00000000..63d2b3ca --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_cavlc.c @@ -0,0 +1,1029 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... cavlc bitstream decoding + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + * H.264 / AVC / MPEG4 part10 cavlc bitstream decoding. + * @author Michael Niedermayer + */ + +#define CABAC 0 + +#include "internal.h" +#include "avcodec.h" +#include "mpegvideo.h" +#include "h264.h" +#include "h264data.h" // FIXME FIXME FIXME +#include "h264_mvpred.h" +#include "golomb.h" + +//#undef NDEBUG +#include + +static const uint8_t golomb_to_inter_cbp_gray[16]={ + 0, 1, 2, 4, 8, 3, 5,10,12,15, 7,11,13,14, 6, 9, +}; + +static const uint8_t golomb_to_intra4x4_cbp_gray[16]={ +15, 0, 7,11,13,14, 3, 5,10,12, 1, 2, 4, 8, 6, 9, +}; + +static const uint8_t chroma_dc_coeff_token_len[4*5]={ + 2, 0, 0, 0, + 6, 1, 0, 0, + 6, 6, 3, 0, + 6, 7, 7, 6, + 6, 8, 8, 7, +}; + +static const uint8_t chroma_dc_coeff_token_bits[4*5]={ + 1, 0, 0, 0, + 7, 1, 0, 0, + 4, 6, 1, 0, + 3, 3, 2, 5, + 2, 3, 2, 0, +}; + +static const uint8_t coeff_token_len[4][4*17]={ +{ + 1, 0, 0, 0, + 6, 2, 0, 0, 8, 6, 3, 0, 9, 8, 7, 5, 10, 9, 8, 6, + 11,10, 9, 7, 13,11,10, 8, 13,13,11, 9, 13,13,13,10, + 14,14,13,11, 14,14,14,13, 15,15,14,14, 15,15,15,14, + 16,15,15,15, 16,16,16,15, 16,16,16,16, 16,16,16,16, +}, +{ + 2, 0, 0, 0, + 6, 2, 0, 0, 6, 5, 3, 0, 7, 6, 6, 4, 8, 6, 6, 4, + 8, 7, 7, 5, 9, 8, 8, 6, 11, 9, 9, 6, 11,11,11, 7, + 12,11,11, 9, 12,12,12,11, 12,12,12,11, 13,13,13,12, + 13,13,13,13, 13,14,13,13, 14,14,14,13, 14,14,14,14, +}, +{ + 4, 0, 0, 0, + 6, 4, 0, 0, 6, 5, 4, 0, 6, 5, 5, 4, 7, 5, 5, 4, + 7, 5, 5, 4, 7, 6, 6, 4, 7, 6, 6, 4, 8, 7, 7, 5, + 8, 8, 7, 6, 9, 8, 8, 7, 9, 9, 8, 8, 9, 9, 9, 8, + 10, 9, 9, 9, 10,10,10,10, 10,10,10,10, 10,10,10,10, +}, +{ + 6, 0, 0, 0, + 6, 6, 0, 0, 6, 6, 6, 0, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, +} +}; + +static const uint8_t coeff_token_bits[4][4*17]={ +{ + 1, 0, 0, 0, + 5, 1, 0, 0, 7, 4, 1, 0, 7, 6, 5, 3, 7, 6, 5, 3, + 7, 6, 5, 4, 15, 6, 5, 4, 11,14, 5, 4, 8,10,13, 4, + 15,14, 9, 4, 11,10,13,12, 15,14, 9,12, 11,10,13, 8, + 15, 1, 9,12, 11,14,13, 8, 7,10, 9,12, 4, 6, 5, 8, +}, +{ + 3, 0, 0, 0, + 11, 2, 0, 0, 7, 7, 3, 0, 7,10, 9, 5, 7, 6, 5, 4, + 4, 6, 5, 6, 7, 6, 5, 8, 15, 6, 5, 4, 11,14,13, 4, + 15,10, 9, 4, 11,14,13,12, 8,10, 9, 8, 15,14,13,12, + 11,10, 9,12, 7,11, 6, 8, 9, 8,10, 1, 7, 6, 5, 4, +}, +{ + 15, 0, 0, 0, + 15,14, 0, 0, 11,15,13, 0, 8,12,14,12, 15,10,11,11, + 11, 8, 9,10, 9,14,13, 9, 8,10, 9, 8, 15,14,13,13, + 11,14,10,12, 15,10,13,12, 11,14, 9,12, 8,10,13, 8, + 13, 7, 9,12, 9,12,11,10, 5, 8, 7, 6, 1, 4, 3, 2, +}, +{ + 3, 0, 0, 0, + 0, 1, 0, 0, 4, 5, 6, 0, 8, 9,10,11, 12,13,14,15, + 16,17,18,19, 20,21,22,23, 24,25,26,27, 28,29,30,31, + 32,33,34,35, 36,37,38,39, 40,41,42,43, 44,45,46,47, + 48,49,50,51, 52,53,54,55, 56,57,58,59, 60,61,62,63, +} +}; + +static const uint8_t total_zeros_len[16][16]= { + {1,3,3,4,4,5,5,6,6,7,7,8,8,9,9,9}, + {3,3,3,3,3,4,4,4,4,5,5,6,6,6,6}, + {4,3,3,3,4,4,3,3,4,5,5,6,5,6}, + {5,3,4,4,3,3,3,4,3,4,5,5,5}, + {4,4,4,3,3,3,3,3,4,5,4,5}, + {6,5,3,3,3,3,3,3,4,3,6}, + {6,5,3,3,3,2,3,4,3,6}, + {6,4,5,3,2,2,3,3,6}, + {6,6,4,2,2,3,2,5}, + {5,5,3,2,2,2,4}, + {4,4,3,3,1,3}, + {4,4,2,1,3}, + {3,3,1,2}, + {2,2,1}, + {1,1}, +}; + +static const uint8_t total_zeros_bits[16][16]= { + {1,3,2,3,2,3,2,3,2,3,2,3,2,3,2,1}, + {7,6,5,4,3,5,4,3,2,3,2,3,2,1,0}, + {5,7,6,5,4,3,4,3,2,3,2,1,1,0}, + {3,7,5,4,6,5,4,3,3,2,2,1,0}, + {5,4,3,7,6,5,4,3,2,1,1,0}, + {1,1,7,6,5,4,3,2,1,1,0}, + {1,1,5,4,3,3,2,1,1,0}, + {1,1,1,3,3,2,2,1,0}, + {1,0,1,3,2,1,1,1}, + {1,0,1,3,2,1,1}, + {0,1,1,2,1,3}, + {0,1,1,1,1}, + {0,1,1,1}, + {0,1,1}, + {0,1}, +}; + +static const uint8_t chroma_dc_total_zeros_len[3][4]= { + { 1, 2, 3, 3,}, + { 1, 2, 2, 0,}, + { 1, 1, 0, 0,}, +}; + +static const uint8_t chroma_dc_total_zeros_bits[3][4]= { + { 1, 1, 1, 0,}, + { 1, 1, 0, 0,}, + { 1, 0, 0, 0,}, +}; + +static const uint8_t run_len[7][16]={ + {1,1}, + {1,2,2}, + {2,2,2,2}, + {2,2,2,3,3}, + {2,2,3,3,3,3}, + {2,3,3,3,3,3,3}, + {3,3,3,3,3,3,3,4,5,6,7,8,9,10,11}, +}; + +static const uint8_t run_bits[7][16]={ + {1,0}, + {1,1,0}, + {3,2,1,0}, + {3,2,1,1,0}, + {3,2,3,2,1,0}, + {3,0,1,3,2,5,4}, + {7,6,5,4,3,2,1,1,1,1,1,1,1,1,1}, +}; + +static VLC coeff_token_vlc[4]; +static VLC_TYPE coeff_token_vlc_tables[520+332+280+256][2]; +static const int coeff_token_vlc_tables_size[4]={520,332,280,256}; + +static VLC chroma_dc_coeff_token_vlc; +static VLC_TYPE chroma_dc_coeff_token_vlc_table[256][2]; +static const int chroma_dc_coeff_token_vlc_table_size = 256; + +static VLC total_zeros_vlc[15]; +static VLC_TYPE total_zeros_vlc_tables[15][512][2]; +static const int total_zeros_vlc_tables_size = 512; + +static VLC chroma_dc_total_zeros_vlc[3]; +static VLC_TYPE chroma_dc_total_zeros_vlc_tables[3][8][2]; +static const int chroma_dc_total_zeros_vlc_tables_size = 8; + +static VLC run_vlc[6]; +static VLC_TYPE run_vlc_tables[6][8][2]; +static const int run_vlc_tables_size = 8; + +static VLC run7_vlc; +static VLC_TYPE run7_vlc_table[96][2]; +static const int run7_vlc_table_size = 96; + +#define LEVEL_TAB_BITS 8 +static int8_t cavlc_level_tab[7][1<non_zero_count_cache[index8 - 1]; + const int top = h->non_zero_count_cache[index8 - 8]; + int i= left + top; + + if(i<64) i= (i+1)>>1; + + tprintf(h->s.avctx, "pred_nnz L%X T%X n%d s%d P%X\n", left, top, n, scan8[n], i&31); + + return i&31; +} + +static av_cold void init_cavlc_level_tab(void){ + int suffix_length, mask; + unsigned int i; + + for(suffix_length=0; suffix_length<7; suffix_length++){ + for(i=0; i<(1<>(LEVEL_TAB_BITS-prefix-1-suffix_length)) - (1<>1) ^ mask) - mask; + if(prefix + 1 + suffix_length <= LEVEL_TAB_BITS){ + cavlc_level_tab[suffix_length][i][0]= level_code; + cavlc_level_tab[suffix_length][i][1]= prefix + 1 + suffix_length; + }else if(prefix + 1 <= LEVEL_TAB_BITS){ + cavlc_level_tab[suffix_length][i][0]= prefix+100; + cavlc_level_tab[suffix_length][i][1]= prefix + 1; + }else{ + cavlc_level_tab[suffix_length][i][0]= LEVEL_TAB_BITS+100; + cavlc_level_tab[suffix_length][i][1]= LEVEL_TAB_BITS; + } + } + } +} + +av_cold void ff_h264_decode_init_vlc(void){ + static int done = 0; + + if (!done) { + int i; + int offset; + done = 1; + + chroma_dc_coeff_token_vlc.table = chroma_dc_coeff_token_vlc_table; + chroma_dc_coeff_token_vlc.table_allocated = chroma_dc_coeff_token_vlc_table_size; + init_vlc(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5, + &chroma_dc_coeff_token_len [0], 1, 1, + &chroma_dc_coeff_token_bits[0], 1, 1, + INIT_VLC_USE_NEW_STATIC); + + offset = 0; + for(i=0; i<4; i++){ + coeff_token_vlc[i].table = coeff_token_vlc_tables+offset; + coeff_token_vlc[i].table_allocated = coeff_token_vlc_tables_size[i]; + init_vlc(&coeff_token_vlc[i], COEFF_TOKEN_VLC_BITS, 4*17, + &coeff_token_len [i][0], 1, 1, + &coeff_token_bits[i][0], 1, 1, + INIT_VLC_USE_NEW_STATIC); + offset += coeff_token_vlc_tables_size[i]; + } + /* + * This is a one time safety check to make sure that + * the packed static coeff_token_vlc table sizes + * were initialized correctly. + */ + assert(offset == FF_ARRAY_ELEMS(coeff_token_vlc_tables)); + + for(i=0; i<3; i++){ + chroma_dc_total_zeros_vlc[i].table = chroma_dc_total_zeros_vlc_tables[i]; + chroma_dc_total_zeros_vlc[i].table_allocated = chroma_dc_total_zeros_vlc_tables_size; + init_vlc(&chroma_dc_total_zeros_vlc[i], + CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 4, + &chroma_dc_total_zeros_len [i][0], 1, 1, + &chroma_dc_total_zeros_bits[i][0], 1, 1, + INIT_VLC_USE_NEW_STATIC); + } + for(i=0; i<15; i++){ + total_zeros_vlc[i].table = total_zeros_vlc_tables[i]; + total_zeros_vlc[i].table_allocated = total_zeros_vlc_tables_size; + init_vlc(&total_zeros_vlc[i], + TOTAL_ZEROS_VLC_BITS, 16, + &total_zeros_len [i][0], 1, 1, + &total_zeros_bits[i][0], 1, 1, + INIT_VLC_USE_NEW_STATIC); + } + + for(i=0; i<6; i++){ + run_vlc[i].table = run_vlc_tables[i]; + run_vlc[i].table_allocated = run_vlc_tables_size; + init_vlc(&run_vlc[i], + RUN_VLC_BITS, 7, + &run_len [i][0], 1, 1, + &run_bits[i][0], 1, 1, + INIT_VLC_USE_NEW_STATIC); + } + run7_vlc.table = run7_vlc_table, + run7_vlc.table_allocated = run7_vlc_table_size; + init_vlc(&run7_vlc, RUN7_VLC_BITS, 16, + &run_len [6][0], 1, 1, + &run_bits[6][0], 1, 1, + INIT_VLC_USE_NEW_STATIC); + + init_cavlc_level_tab(); + } +} + +/** + * + */ +static inline int get_level_prefix(GetBitContext *gb){ + unsigned int buf; + int log; + + OPEN_READER(re, gb); + UPDATE_CACHE(re, gb); + buf=GET_CACHE(re, gb); + + log= 32 - av_log2(buf); +#ifdef TRACE + print_bin(buf>>(32-log), log); + av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d lpr @%5d in %s get_level_prefix\n", buf>>(32-log), log, log-1, get_bits_count(gb), __FILE__); +#endif + + LAST_SKIP_BITS(re, gb, log); + CLOSE_READER(re, gb); + + return log-1; +} + +/** + * decodes a residual block. + * @param n block index + * @param scantable scantable + * @param max_coeff number of coefficients in the block + * @return <0 if an error occurred + */ +static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){ + MpegEncContext * const s = &h->s; + static const int coeff_token_table_index[17]= {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3}; + int level[16]; + int zeros_left, coeff_token, total_coeff, i, trailing_ones, run_before; + + //FIXME put trailing_onex into the context + + if(n >= CHROMA_DC_BLOCK_INDEX){ + coeff_token= get_vlc2(gb, chroma_dc_coeff_token_vlc.table, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 1); + total_coeff= coeff_token>>2; + }else{ + if(n == LUMA_DC_BLOCK_INDEX){ + total_coeff= pred_non_zero_count(h, 0); + coeff_token= get_vlc2(gb, coeff_token_vlc[ coeff_token_table_index[total_coeff] ].table, COEFF_TOKEN_VLC_BITS, 2); + total_coeff= coeff_token>>2; + }else{ + total_coeff= pred_non_zero_count(h, n); + coeff_token= get_vlc2(gb, coeff_token_vlc[ coeff_token_table_index[total_coeff] ].table, COEFF_TOKEN_VLC_BITS, 2); + total_coeff= coeff_token>>2; + } + } + h->non_zero_count_cache[ scan8[n] ]= total_coeff; + + //FIXME set last_non_zero? + + if(total_coeff==0) + return 0; + if(total_coeff > (unsigned)max_coeff) { + av_log(h->s.avctx, AV_LOG_ERROR, "corrupted macroblock %d %d (total_coeff=%d)\n", s->mb_x, s->mb_y, total_coeff); + return -1; + } + + trailing_ones= coeff_token&3; + tprintf(h->s.avctx, "trailing:%d, total:%d\n", trailing_ones, total_coeff); + assert(total_coeff<=16); + + i = show_bits(gb, 3); + skip_bits(gb, trailing_ones); + level[0] = 1-((i&4)>>1); + level[1] = 1-((i&2) ); + level[2] = 1-((i&1)<<1); + + if(trailing_ones 10 & trailing_ones < 3; + int bitsi= show_bits(gb, LEVEL_TAB_BITS); + int level_code= cavlc_level_tab[suffix_length][bitsi][0]; + + skip_bits(gb, cavlc_level_tab[suffix_length][bitsi][1]); + if(level_code >= 100){ + prefix= level_code - 100; + if(prefix == LEVEL_TAB_BITS) + prefix += get_level_prefix(gb); + + //first coefficient has suffix_length equal to 0 or 1 + if(prefix<14){ //FIXME try to build a large unified VLC table for all this + if(suffix_length) + level_code= (prefix<<1) + get_bits1(gb); //part + else + level_code= prefix; //part + }else if(prefix==14){ + if(suffix_length) + level_code= (prefix<<1) + get_bits1(gb); //part + else + level_code= prefix + get_bits(gb, 4); //part + }else{ + level_code= 30 + get_bits(gb, prefix-3); //part + if(prefix>=16){ + if(prefix > 25+3){ + av_log(h->s.avctx, AV_LOG_ERROR, "Invalid level prefix\n"); + return -1; + } + level_code += (1<<(prefix-3))-4096; + } + } + + if(trailing_ones < 3) level_code += 2; + + suffix_length = 2; + mask= -(level_code&1); + level[trailing_ones]= (((2+level_code)>>1) ^ mask) - mask; + }else{ + level_code += ((level_code>>31)|1) & -(trailing_ones < 3); + + suffix_length = 1 + (level_code + 3U > 6U); + level[trailing_ones]= level_code; + } + + //remaining coefficients have suffix_length > 0 + for(i=trailing_ones+1;i= 100){ + prefix= level_code - 100; + if(prefix == LEVEL_TAB_BITS){ + prefix += get_level_prefix(gb); + } + if(prefix<15){ + level_code = (prefix<=16) + level_code += (1<<(prefix-3))-4096; + } + mask= -(level_code&1); + level_code= (((2+level_code)>>1) ^ mask) - mask; + } + level[i]= level_code; + suffix_length+= suffix_limit[suffix_length] + level_code > 2U*suffix_limit[suffix_length]; + } + } + + if(total_coeff == max_coeff) + zeros_left=0; + else{ + if(n >= CHROMA_DC_BLOCK_INDEX) + zeros_left= get_vlc2(gb, (chroma_dc_total_zeros_vlc-1)[ total_coeff ].table, CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 1); + else + zeros_left= get_vlc2(gb, (total_zeros_vlc-1)[ total_coeff ].table, TOTAL_ZEROS_VLC_BITS, 1); + } + + scantable += zeros_left + total_coeff - 1; + if(n >= LUMA_DC_BLOCK_INDEX){ + block[*scantable] = level[0]; + for(i=1;i 0;i++) { + if(zeros_left < 7) + run_before= get_vlc2(gb, (run_vlc-1)[zeros_left].table, RUN_VLC_BITS, 1); + else + run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); + zeros_left -= run_before; + scantable -= 1 + run_before; + block[*scantable]= level[i]; + } + for(;i>6; + for(i=1;i 0;i++) { + if(zeros_left < 7) + run_before= get_vlc2(gb, (run_vlc-1)[zeros_left].table, RUN_VLC_BITS, 1); + else + run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); + zeros_left -= run_before; + scantable -= 1 + run_before; + block[*scantable]= (level[i] * qmul[*scantable] + 32)>>6; + } + for(;i>6; + } + } + + if(zeros_left<0){ + av_log(h->s.avctx, AV_LOG_ERROR, "negative number of zero coeffs at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + + return 0; +} + +int ff_h264_decode_mb_cavlc(H264Context *h){ + MpegEncContext * const s = &h->s; + int mb_xy; + int partition_count; + unsigned int mb_type, cbp; + int dct8x8_allowed= h->pps.transform_8x8_mode; + + mb_xy = h->mb_xy = s->mb_x + s->mb_y*s->mb_stride; + + tprintf(s->avctx, "pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y); + cbp = 0; /* avoid warning. FIXME: find a solution without slowing + down the code */ + if(h->slice_type_nos != FF_I_TYPE){ + if(s->mb_skip_run==-1) + s->mb_skip_run= get_ue_golomb(&s->gb); + + if (s->mb_skip_run--) { + if(FRAME_MBAFF && (s->mb_y&1) == 0){ + if(s->mb_skip_run==0) + h->mb_mbaff = h->mb_field_decoding_flag = get_bits1(&s->gb); + } + decode_mb_skip(h); + return 0; + } + } + if(FRAME_MBAFF){ + if( (s->mb_y&1) == 0 ) + h->mb_mbaff = h->mb_field_decoding_flag = get_bits1(&s->gb); + } + + h->prev_mb_skipped= 0; + + mb_type= get_ue_golomb(&s->gb); + if(h->slice_type_nos == FF_B_TYPE){ + if(mb_type < 23){ + partition_count= b_mb_type_info[mb_type].partition_count; + mb_type= b_mb_type_info[mb_type].type; + }else{ + mb_type -= 23; + goto decode_intra_mb; + } + }else if(h->slice_type_nos == FF_P_TYPE){ + if(mb_type < 5){ + partition_count= p_mb_type_info[mb_type].partition_count; + mb_type= p_mb_type_info[mb_type].type; + }else{ + mb_type -= 5; + goto decode_intra_mb; + } + }else{ + assert(h->slice_type_nos == FF_I_TYPE); + if(h->slice_type == FF_SI_TYPE && mb_type) + mb_type--; +decode_intra_mb: + if(mb_type > 25){ + av_log(h->s.avctx, AV_LOG_ERROR, "mb_type %d in %c slice too large at %d %d\n", mb_type, av_get_pict_type_char(h->slice_type), s->mb_x, s->mb_y); + return -1; + } + partition_count=0; + cbp= i_mb_type_info[mb_type].cbp; + h->intra16x16_pred_mode= i_mb_type_info[mb_type].pred_mode; + mb_type= i_mb_type_info[mb_type].type; + } + + if(MB_FIELD) + mb_type |= MB_TYPE_INTERLACED; + + h->slice_table[ mb_xy ]= h->slice_num; + + if(IS_INTRA_PCM(mb_type)){ + unsigned int x; + + // We assume these blocks are very rare so we do not optimize it. + align_get_bits(&s->gb); + + // The pixels are stored in the same order as levels in h->mb array. + for(x=0; x < (CHROMA ? 384 : 256); x++){ + ((uint8_t*)h->mb)[x]= get_bits(&s->gb, 8); + } + + // In deblocking, the quantizer is 0 + s->current_picture.qscale_table[mb_xy]= 0; + // All coeffs are present + memset(h->non_zero_count[mb_xy], 16, 32); + + s->current_picture.mb_type[mb_xy]= mb_type; + return 0; + } + + if(MB_MBAFF){ + h->ref_count[0] <<= 1; + h->ref_count[1] <<= 1; + } + + fill_decode_neighbors(h, mb_type); + fill_decode_caches(h, mb_type); + + //mb_pred + if(IS_INTRA(mb_type)){ + int pred_mode; +// init_top_left_availability(h); + if(IS_INTRA4x4(mb_type)){ + int i; + int di = 1; + if(dct8x8_allowed && get_bits1(&s->gb)){ + mb_type |= MB_TYPE_8x8DCT; + di = 4; + } + +// fill_intra4x4_pred_table(h); + for(i=0; i<16; i+=di){ + int mode= pred_intra_mode(h, i); + + if(!get_bits1(&s->gb)){ + const int rem_mode= get_bits(&s->gb, 3); + mode = rem_mode + (rem_mode >= mode); + } + + if(di==4) + fill_rectangle( &h->intra4x4_pred_mode_cache[ scan8[i] ], 2, 2, 8, mode, 1 ); + else + h->intra4x4_pred_mode_cache[ scan8[i] ] = mode; + } + ff_h264_write_back_intra_pred_mode(h); + if( ff_h264_check_intra4x4_pred_mode(h) < 0) + return -1; + }else{ + h->intra16x16_pred_mode= ff_h264_check_intra_pred_mode(h, h->intra16x16_pred_mode); + if(h->intra16x16_pred_mode < 0) + return -1; + } + if(CHROMA){ + pred_mode= ff_h264_check_intra_pred_mode(h, get_ue_golomb_31(&s->gb)); + if(pred_mode < 0) + return -1; + h->chroma_pred_mode= pred_mode; + } else { + h->chroma_pred_mode = DC_128_PRED8x8; + } + }else if(partition_count==4){ + int i, j, sub_partition_count[4], list, ref[2][4]; + + if(h->slice_type_nos == FF_B_TYPE){ + for(i=0; i<4; i++){ + h->sub_mb_type[i]= get_ue_golomb_31(&s->gb); + if(h->sub_mb_type[i] >=13){ + av_log(h->s.avctx, AV_LOG_ERROR, "B sub_mb_type %u out of range at %d %d\n", h->sub_mb_type[i], s->mb_x, s->mb_y); + return -1; + } + sub_partition_count[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count; + h->sub_mb_type[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].type; + } + if( IS_DIRECT(h->sub_mb_type[0]|h->sub_mb_type[1]|h->sub_mb_type[2]|h->sub_mb_type[3])) { + ff_h264_pred_direct_motion(h, &mb_type); + h->ref_cache[0][scan8[4]] = + h->ref_cache[1][scan8[4]] = + h->ref_cache[0][scan8[12]] = + h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE; + } + }else{ + assert(h->slice_type_nos == FF_P_TYPE); //FIXME SP correct ? + for(i=0; i<4; i++){ + h->sub_mb_type[i]= get_ue_golomb_31(&s->gb); + if(h->sub_mb_type[i] >=4){ + av_log(h->s.avctx, AV_LOG_ERROR, "P sub_mb_type %u out of range at %d %d\n", h->sub_mb_type[i], s->mb_x, s->mb_y); + return -1; + } + sub_partition_count[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count; + h->sub_mb_type[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].type; + } + } + + for(list=0; listlist_count; list++){ + int ref_count= IS_REF0(mb_type) ? 1 : h->ref_count[list]; + for(i=0; i<4; i++){ + if(IS_DIRECT(h->sub_mb_type[i])) continue; + if(IS_DIR(h->sub_mb_type[i], 0, list)){ + unsigned int tmp; + if(ref_count == 1){ + tmp= 0; + }else if(ref_count == 2){ + tmp= get_bits1(&s->gb)^1; + }else{ + tmp= get_ue_golomb_31(&s->gb); + if(tmp>=ref_count){ + av_log(h->s.avctx, AV_LOG_ERROR, "ref %u overflow\n", tmp); + return -1; + } + } + ref[list][i]= tmp; + }else{ + //FIXME + ref[list][i] = -1; + } + } + } + + if(dct8x8_allowed) + dct8x8_allowed = get_dct8x8_allowed(h); + + for(list=0; listlist_count; list++){ + for(i=0; i<4; i++){ + if(IS_DIRECT(h->sub_mb_type[i])) { + h->ref_cache[list][ scan8[4*i] ] = h->ref_cache[list][ scan8[4*i]+1 ]; + continue; + } + h->ref_cache[list][ scan8[4*i] ]=h->ref_cache[list][ scan8[4*i]+1 ]= + h->ref_cache[list][ scan8[4*i]+8 ]=h->ref_cache[list][ scan8[4*i]+9 ]= ref[list][i]; + + if(IS_DIR(h->sub_mb_type[i], 0, list)){ + const int sub_mb_type= h->sub_mb_type[i]; + const int block_width= (sub_mb_type & (MB_TYPE_16x16|MB_TYPE_16x8)) ? 2 : 1; + for(j=0; jmv_cache[list][ scan8[index] ]; + pred_motion(h, index, block_width, list, h->ref_cache[list][ scan8[index] ], &mx, &my); + mx += get_se_golomb(&s->gb); + my += get_se_golomb(&s->gb); + tprintf(s->avctx, "final mv:%d %d\n", mx, my); + + if(IS_SUB_8X8(sub_mb_type)){ + mv_cache[ 1 ][0]= + mv_cache[ 8 ][0]= mv_cache[ 9 ][0]= mx; + mv_cache[ 1 ][1]= + mv_cache[ 8 ][1]= mv_cache[ 9 ][1]= my; + }else if(IS_SUB_8X4(sub_mb_type)){ + mv_cache[ 1 ][0]= mx; + mv_cache[ 1 ][1]= my; + }else if(IS_SUB_4X8(sub_mb_type)){ + mv_cache[ 8 ][0]= mx; + mv_cache[ 8 ][1]= my; + } + mv_cache[ 0 ][0]= mx; + mv_cache[ 0 ][1]= my; + } + }else{ + uint32_t *p= (uint32_t *)&h->mv_cache[list][ scan8[4*i] ][0]; + p[0] = p[1]= + p[8] = p[9]= 0; + } + } + } + }else if(IS_DIRECT(mb_type)){ + ff_h264_pred_direct_motion(h, &mb_type); + dct8x8_allowed &= h->sps.direct_8x8_inference_flag; + }else{ + int list, mx, my, i; + //FIXME we should set ref_idx_l? to 0 if we use that later ... + if(IS_16X16(mb_type)){ + for(list=0; listlist_count; list++){ + unsigned int val; + if(IS_DIR(mb_type, 0, list)){ + if(h->ref_count[list]==1){ + val= 0; + }else if(h->ref_count[list]==2){ + val= get_bits1(&s->gb)^1; + }else{ + val= get_ue_golomb_31(&s->gb); + if(val >= h->ref_count[list]){ + av_log(h->s.avctx, AV_LOG_ERROR, "ref %u overflow\n", val); + return -1; + } + } + fill_rectangle(&h->ref_cache[list][ scan8[0] ], 4, 4, 8, val, 1); + } + } + for(list=0; listlist_count; list++){ + if(IS_DIR(mb_type, 0, list)){ + pred_motion(h, 0, 4, list, h->ref_cache[list][ scan8[0] ], &mx, &my); + mx += get_se_golomb(&s->gb); + my += get_se_golomb(&s->gb); + tprintf(s->avctx, "final mv:%d %d\n", mx, my); + + fill_rectangle(h->mv_cache[list][ scan8[0] ], 4, 4, 8, pack16to32(mx,my), 4); + } + } + } + else if(IS_16X8(mb_type)){ + for(list=0; listlist_count; list++){ + for(i=0; i<2; i++){ + unsigned int val; + if(IS_DIR(mb_type, i, list)){ + if(h->ref_count[list] == 1){ + val= 0; + }else if(h->ref_count[list] == 2){ + val= get_bits1(&s->gb)^1; + }else{ + val= get_ue_golomb_31(&s->gb); + if(val >= h->ref_count[list]){ + av_log(h->s.avctx, AV_LOG_ERROR, "ref %u overflow\n", val); + return -1; + } + } + }else + val= LIST_NOT_USED&0xFF; + fill_rectangle(&h->ref_cache[list][ scan8[0] + 16*i ], 4, 2, 8, val, 1); + } + } + for(list=0; listlist_count; list++){ + for(i=0; i<2; i++){ + unsigned int val; + if(IS_DIR(mb_type, i, list)){ + pred_16x8_motion(h, 8*i, list, h->ref_cache[list][scan8[0] + 16*i], &mx, &my); + mx += get_se_golomb(&s->gb); + my += get_se_golomb(&s->gb); + tprintf(s->avctx, "final mv:%d %d\n", mx, my); + + val= pack16to32(mx,my); + }else + val=0; + fill_rectangle(h->mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, val, 4); + } + } + }else{ + assert(IS_8X16(mb_type)); + for(list=0; listlist_count; list++){ + for(i=0; i<2; i++){ + unsigned int val; + if(IS_DIR(mb_type, i, list)){ //FIXME optimize + if(h->ref_count[list]==1){ + val= 0; + }else if(h->ref_count[list]==2){ + val= get_bits1(&s->gb)^1; + }else{ + val= get_ue_golomb_31(&s->gb); + if(val >= h->ref_count[list]){ + av_log(h->s.avctx, AV_LOG_ERROR, "ref %u overflow\n", val); + return -1; + } + } + }else + val= LIST_NOT_USED&0xFF; + fill_rectangle(&h->ref_cache[list][ scan8[0] + 2*i ], 2, 4, 8, val, 1); + } + } + for(list=0; listlist_count; list++){ + for(i=0; i<2; i++){ + unsigned int val; + if(IS_DIR(mb_type, i, list)){ + pred_8x16_motion(h, i*4, list, h->ref_cache[list][ scan8[0] + 2*i ], &mx, &my); + mx += get_se_golomb(&s->gb); + my += get_se_golomb(&s->gb); + tprintf(s->avctx, "final mv:%d %d\n", mx, my); + + val= pack16to32(mx,my); + }else + val=0; + fill_rectangle(h->mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, val, 4); + } + } + } + } + + if(IS_INTER(mb_type)) + write_back_motion(h, mb_type); + + if(!IS_INTRA16x16(mb_type)){ + cbp= get_ue_golomb(&s->gb); + if(cbp > 47){ + av_log(h->s.avctx, AV_LOG_ERROR, "cbp too large (%u) at %d %d\n", cbp, s->mb_x, s->mb_y); + return -1; + } + + if(CHROMA){ + if(IS_INTRA4x4(mb_type)) cbp= golomb_to_intra4x4_cbp[cbp]; + else cbp= golomb_to_inter_cbp [cbp]; + }else{ + if(IS_INTRA4x4(mb_type)) cbp= golomb_to_intra4x4_cbp_gray[cbp]; + else cbp= golomb_to_inter_cbp_gray[cbp]; + } + } + + if(dct8x8_allowed && (cbp&15) && !IS_INTRA(mb_type)){ + mb_type |= MB_TYPE_8x8DCT*get_bits1(&s->gb); + } + h->cbp= + h->cbp_table[mb_xy]= cbp; + s->current_picture.mb_type[mb_xy]= mb_type; + + if(cbp || IS_INTRA16x16(mb_type)){ + int i8x8, i4x4, chroma_idx; + int dquant; + GetBitContext *gb= IS_INTRA(mb_type) ? h->intra_gb_ptr : h->inter_gb_ptr; + const uint8_t *scan, *scan8x8; + + if(IS_INTERLACED(mb_type)){ + scan8x8= s->qscale ? h->field_scan8x8_cavlc : h->field_scan8x8_cavlc_q0; + scan= s->qscale ? h->field_scan : h->field_scan_q0; + }else{ + scan8x8= s->qscale ? h->zigzag_scan8x8_cavlc : h->zigzag_scan8x8_cavlc_q0; + scan= s->qscale ? h->zigzag_scan : h->zigzag_scan_q0; + } + + dquant= get_se_golomb(&s->gb); + + s->qscale += dquant; + + if(((unsigned)s->qscale) > 51){ + if(s->qscale<0) s->qscale+= 52; + else s->qscale-= 52; + if(((unsigned)s->qscale) > 51){ + av_log(h->s.avctx, AV_LOG_ERROR, "dquant out of range (%d) at %d %d\n", dquant, s->mb_x, s->mb_y); + return -1; + } + } + + h->chroma_qp[0]= get_chroma_qp(h, 0, s->qscale); + h->chroma_qp[1]= get_chroma_qp(h, 1, s->qscale); + if(IS_INTRA16x16(mb_type)){ + AV_ZERO128(h->mb_luma_dc+0); + AV_ZERO128(h->mb_luma_dc+8); + if( decode_residual(h, h->intra_gb_ptr, h->mb_luma_dc, LUMA_DC_BLOCK_INDEX, scan, h->dequant4_coeff[0][s->qscale], 16) < 0){ + return -1; //FIXME continue if partitioned and other return -1 too + } + + assert((cbp&15) == 0 || (cbp&15) == 15); + + if(cbp&15){ + for(i8x8=0; i8x8<4; i8x8++){ + for(i4x4=0; i4x4<4; i4x4++){ + const int index= i4x4 + 4*i8x8; + if( decode_residual(h, h->intra_gb_ptr, h->mb + 16*index, index, scan + 1, h->dequant4_coeff[0][s->qscale], 15) < 0 ){ + return -1; + } + } + } + }else{ + fill_rectangle(&h->non_zero_count_cache[scan8[0]], 4, 4, 8, 0, 1); + } + }else{ + for(i8x8=0; i8x8<4; i8x8++){ + if(cbp & (1<mb[64*i8x8]; + uint8_t *nnz; + for(i4x4=0; i4x4<4; i4x4++){ + if( decode_residual(h, gb, buf, i4x4+4*i8x8, scan8x8+16*i4x4, + h->dequant8_coeff[IS_INTRA( mb_type ) ? 0:1][s->qscale], 16) <0 ) + return -1; + } + nnz= &h->non_zero_count_cache[ scan8[4*i8x8] ]; + nnz[0] += nnz[1] + nnz[8] + nnz[9]; + }else{ + for(i4x4=0; i4x4<4; i4x4++){ + const int index= i4x4 + 4*i8x8; + + if( decode_residual(h, gb, h->mb + 16*index, index, scan, h->dequant4_coeff[IS_INTRA( mb_type ) ? 0:3][s->qscale], 16) <0 ){ + return -1; + } + } + } + }else{ + uint8_t * const nnz= &h->non_zero_count_cache[ scan8[4*i8x8] ]; + nnz[0] = nnz[1] = nnz[8] = nnz[9] = 0; + } + } + } + + if(cbp&0x30){ + for(chroma_idx=0; chroma_idx<2; chroma_idx++) + if( decode_residual(h, gb, h->mb + 256 + 16*4*chroma_idx, CHROMA_DC_BLOCK_INDEX+chroma_idx, chroma_dc_scan, NULL, 4) < 0){ + return -1; + } + } + + if(cbp&0x20){ + for(chroma_idx=0; chroma_idx<2; chroma_idx++){ + const uint32_t *qmul = h->dequant4_coeff[chroma_idx+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[chroma_idx]]; + for(i4x4=0; i4x4<4; i4x4++){ + const int index= 16 + 4*chroma_idx + i4x4; + if( decode_residual(h, gb, h->mb + 16*index, index, scan + 1, qmul, 15) < 0){ + return -1; + } + } + } + }else{ + uint8_t * const nnz= &h->non_zero_count_cache[0]; + nnz[ scan8[16]+0 ] = nnz[ scan8[16]+1 ] =nnz[ scan8[16]+8 ] =nnz[ scan8[16]+9 ] = + nnz[ scan8[20]+0 ] = nnz[ scan8[20]+1 ] =nnz[ scan8[20]+8 ] =nnz[ scan8[20]+9 ] = 0; + } + }else{ + uint8_t * const nnz= &h->non_zero_count_cache[0]; + fill_rectangle(&nnz[scan8[0]], 4, 4, 8, 0, 1); + nnz[ scan8[16]+0 ] = nnz[ scan8[16]+1 ] =nnz[ scan8[16]+8 ] =nnz[ scan8[16]+9 ] = + nnz[ scan8[20]+0 ] = nnz[ scan8[20]+1 ] =nnz[ scan8[20]+8 ] =nnz[ scan8[20]+9 ] = 0; + } + s->current_picture.qscale_table[mb_xy]= s->qscale; + write_back_non_zero_count(h); + + if(MB_MBAFF){ + h->ref_count[0] >>= 1; + h->ref_count[1] >>= 1; + } + + return 0; +} + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_direct.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_direct.c new file mode 100644 index 00000000..d22780d9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_direct.c @@ -0,0 +1,590 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... direct mb/block decoding + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + * H.264 / AVC / MPEG4 part10 direct mb/block decoding. + * @author Michael Niedermayer + */ + +#include "internal.h" +#include "dsputil.h" +#include "avcodec.h" +#include "mpegvideo.h" +#include "h264.h" +#include "rectangle.h" + +//#undef NDEBUG +#include + + +static int get_scale_factor(H264Context * const h, int poc, int poc1, int i){ + int poc0 = h->ref_list[0][i].poc; + int td = av_clip(poc1 - poc0, -128, 127); + if(td == 0 || h->ref_list[0][i].long_ref){ + return 256; + }else{ + int tb = av_clip(poc - poc0, -128, 127); + int tx = (16384 + (FFABS(td) >> 1)) / td; + return av_clip((tb*tx + 32) >> 6, -1024, 1023); + } +} + +void ff_h264_direct_dist_scale_factor(H264Context * const h){ + MpegEncContext * const s = &h->s; + const int poc = h->s.current_picture_ptr->field_poc[ s->picture_structure == PICT_BOTTOM_FIELD ]; + const int poc1 = h->ref_list[1][0].poc; + int i, field; + for(field=0; field<2; field++){ + const int poc = h->s.current_picture_ptr->field_poc[field]; + const int poc1 = h->ref_list[1][0].field_poc[field]; + for(i=0; i < 2*h->ref_count[0]; i++) + h->dist_scale_factor_field[field][i^field] = get_scale_factor(h, poc, poc1, i+16); + } + + for(i=0; iref_count[0]; i++){ + h->dist_scale_factor[i] = get_scale_factor(h, poc, poc1, i); + } +} + +static void fill_colmap(H264Context *h, int map[2][16+32], int list, int field, int colfield, int mbafi){ + MpegEncContext * const s = &h->s; + Picture * const ref1 = &h->ref_list[1][0]; + int j, old_ref, rfield; + int start= mbafi ? 16 : 0; + int end = mbafi ? 16+2*h->ref_count[0] : h->ref_count[0]; + int interl= mbafi || s->picture_structure != PICT_FRAME; + + /* bogus; fills in for missing frames */ + memset(map[list], 0, sizeof(map[list])); + + for(rfield=0; rfield<2; rfield++){ + for(old_ref=0; old_refref_count[colfield][list]; old_ref++){ + int poc = ref1->ref_poc[colfield][list][old_ref]; + + if (!interl) + poc |= 3; + else if( interl && (poc&3) == 3) //FIXME store all MBAFF references so this isnt needed + poc= (poc&~3) + rfield + 1; + + for(j=start; jref_list[0][j].frame_num + (h->ref_list[0][j].reference&3) == poc){ + int cur_ref= mbafi ? (j-16)^field : j; + map[list][2*old_ref + (rfield^field) + 16] = cur_ref; + if(rfield == field || !interl) + map[list][old_ref] = cur_ref; + break; + } + } + } + } +} + +void ff_h264_direct_ref_list_init(H264Context * const h){ + MpegEncContext * const s = &h->s; + Picture * const ref1 = &h->ref_list[1][0]; + Picture * const cur = s->current_picture_ptr; + int list, j, field; + int sidx= (s->picture_structure&1)^1; + int ref1sidx= (ref1->reference&1)^1; + + for(list=0; list<2; list++){ + cur->ref_count[sidx][list] = h->ref_count[list]; + for(j=0; jref_count[list]; j++) + cur->ref_poc[sidx][list][j] = 4*h->ref_list[list][j].frame_num + (h->ref_list[list][j].reference&3); + } + + if(s->picture_structure == PICT_FRAME){ + memcpy(cur->ref_count[1], cur->ref_count[0], sizeof(cur->ref_count[0])); + memcpy(cur->ref_poc [1], cur->ref_poc [0], sizeof(cur->ref_poc [0])); + } + + cur->mbaff= FRAME_MBAFF; + + h->col_fieldoff= 0; + if(s->picture_structure == PICT_FRAME){ + int cur_poc = s->current_picture_ptr->poc; + int *col_poc = h->ref_list[1]->field_poc; + h->col_parity= (FFABS(col_poc[0] - cur_poc) >= FFABS(col_poc[1] - cur_poc)); + ref1sidx=sidx= h->col_parity; + }else if(!(s->picture_structure & h->ref_list[1][0].reference) && !h->ref_list[1][0].mbaff){ // FL -> FL & differ parity + h->col_fieldoff= s->mb_stride*(2*(h->ref_list[1][0].reference) - 3); + } + + if(cur->pict_type != FF_B_TYPE || h->direct_spatial_mv_pred) + return; + + for(list=0; list<2; list++){ + fill_colmap(h, h->map_col_to_list0, list, sidx, ref1sidx, 0); + if(FRAME_MBAFF) + for(field=0; field<2; field++) + fill_colmap(h, h->map_col_to_list0_field[field], list, field, field, 1); + } +} + +static void pred_spatial_direct_motion(H264Context * const h, int *mb_type){ + MpegEncContext * const s = &h->s; + int b8_stride = 2; + int b4_stride = h->b_stride; + int mb_xy = h->mb_xy; + int mb_type_col[2]; + const int16_t (*l1mv0)[2], (*l1mv1)[2]; + const int8_t *l1ref0, *l1ref1; + const int is_b8x8 = IS_8X8(*mb_type); + unsigned int sub_mb_type= MB_TYPE_L0L1; + int i8, i4; + int ref[2]; + int mv[2]; + int list; + + assert(h->ref_list[1][0].reference&3); + +#define MB_TYPE_16x16_OR_INTRA (MB_TYPE_16x16|MB_TYPE_INTRA4x4|MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM) + + + /* ref = min(neighbors) */ + for(list=0; list<2; list++){ + int left_ref = h->ref_cache[list][scan8[0] - 1]; + int top_ref = h->ref_cache[list][scan8[0] - 8]; + int refc = h->ref_cache[list][scan8[0] - 8 + 4]; + const int16_t *C= h->mv_cache[list][ scan8[0] - 8 + 4]; + if(refc == PART_NOT_AVAILABLE){ + refc = h->ref_cache[list][scan8[0] - 8 - 1]; + C = h-> mv_cache[list][scan8[0] - 8 - 1]; + } + ref[list] = FFMIN3((unsigned)left_ref, (unsigned)top_ref, (unsigned)refc); + if(ref[list] >= 0){ + //this is just pred_motion() but with the cases removed that cannot happen for direct blocks + const int16_t * const A= h->mv_cache[list][ scan8[0] - 1 ]; + const int16_t * const B= h->mv_cache[list][ scan8[0] - 8 ]; + + int match_count= (left_ref==ref[list]) + (top_ref==ref[list]) + (refc==ref[list]); + if(match_count > 1){ //most common + mv[list]= pack16to32(mid_pred(A[0], B[0], C[0]), + mid_pred(A[1], B[1], C[1]) ); + }else { + assert(match_count==1); + if(left_ref==ref[list]){ + mv[list]= AV_RN32A(A); + }else if(top_ref==ref[list]){ + mv[list]= AV_RN32A(B); + }else{ + mv[list]= AV_RN32A(C); + } + } + }else{ + int mask= ~(MB_TYPE_L0 << (2*list)); + mv[list] = 0; + ref[list] = -1; + if(!is_b8x8) + *mb_type &= mask; + sub_mb_type &= mask; + } + } + if(ref[0] < 0 && ref[1] < 0){ + ref[0] = ref[1] = 0; + if(!is_b8x8) + *mb_type |= MB_TYPE_L0L1; + sub_mb_type |= MB_TYPE_L0L1; + } + + if(!(is_b8x8|mv[0]|mv[1])){ + fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1); + fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1); + fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, 0, 4); + fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, 0, 4); + *mb_type= (*mb_type & ~(MB_TYPE_8x8|MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_P1L0|MB_TYPE_P1L1))|MB_TYPE_16x16|MB_TYPE_DIRECT2; + return; + } + + if(IS_INTERLACED(h->ref_list[1][0].mb_type[mb_xy])){ // AFL/AFR/FR/FL -> AFL/FL + if(!IS_INTERLACED(*mb_type)){ // AFR/FR -> AFL/FL + mb_xy= s->mb_x + ((s->mb_y&~1) + h->col_parity)*s->mb_stride; + b8_stride = 0; + }else{ + mb_xy += h->col_fieldoff; // non zero for FL -> FL & differ parity + } + goto single_col; + }else{ // AFL/AFR/FR/FL -> AFR/FR + if(IS_INTERLACED(*mb_type)){ // AFL /FL -> AFR/FR + mb_xy= s->mb_x + (s->mb_y&~1)*s->mb_stride; + mb_type_col[0] = h->ref_list[1][0].mb_type[mb_xy]; + mb_type_col[1] = h->ref_list[1][0].mb_type[mb_xy + s->mb_stride]; + b8_stride = 2+4*s->mb_stride; + b4_stride *= 6; + + sub_mb_type |= MB_TYPE_16x16|MB_TYPE_DIRECT2; /* B_SUB_8x8 */ + if( (mb_type_col[0] & MB_TYPE_16x16_OR_INTRA) + && (mb_type_col[1] & MB_TYPE_16x16_OR_INTRA) + && !is_b8x8){ + *mb_type |= MB_TYPE_16x8 |MB_TYPE_DIRECT2; /* B_16x8 */ + }else{ + *mb_type |= MB_TYPE_8x8; + } + }else{ // AFR/FR -> AFR/FR +single_col: + mb_type_col[0] = + mb_type_col[1] = h->ref_list[1][0].mb_type[mb_xy]; + + sub_mb_type |= MB_TYPE_16x16|MB_TYPE_DIRECT2; /* B_SUB_8x8 */ + if(!is_b8x8 && (mb_type_col[0] & MB_TYPE_16x16_OR_INTRA)){ + *mb_type |= MB_TYPE_16x16|MB_TYPE_DIRECT2; /* B_16x16 */ + }else if(!is_b8x8 && (mb_type_col[0] & (MB_TYPE_16x8|MB_TYPE_8x16))){ + *mb_type |= MB_TYPE_DIRECT2 | (mb_type_col[0] & (MB_TYPE_16x8|MB_TYPE_8x16)); + }else{ + if(!h->sps.direct_8x8_inference_flag){ + /* FIXME save sub mb types from previous frames (or derive from MVs) + * so we know exactly what block size to use */ + sub_mb_type += (MB_TYPE_8x8-MB_TYPE_16x16); /* B_SUB_4x4 */ + } + *mb_type |= MB_TYPE_8x8; + } + } + } + + l1mv0 = &h->ref_list[1][0].motion_val[0][h->mb2b_xy [mb_xy]]; + l1mv1 = &h->ref_list[1][0].motion_val[1][h->mb2b_xy [mb_xy]]; + l1ref0 = &h->ref_list[1][0].ref_index [0][4*mb_xy]; + l1ref1 = &h->ref_list[1][0].ref_index [1][4*mb_xy]; + if(!b8_stride){ + if(s->mb_y&1){ + l1ref0 += 2; + l1ref1 += 2; + l1mv0 += 2*b4_stride; + l1mv1 += 2*b4_stride; + } + } + + + if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col[0])){ + int n=0; + for(i8=0; i8<4; i8++){ + int x8 = i8&1; + int y8 = i8>>1; + int xy8 = x8+y8*b8_stride; + int xy4 = 3*x8+y8*b4_stride; + int a,b; + + if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) + continue; + h->sub_mb_type[i8] = sub_mb_type; + + fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); + fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); + if(!IS_INTRA(mb_type_col[y8]) && !h->ref_list[1][0].long_ref + && ( (l1ref0[xy8] == 0 && FFABS(l1mv0[xy4][0]) <= 1 && FFABS(l1mv0[xy4][1]) <= 1) + || (l1ref0[xy8] < 0 && l1ref1[xy8] == 0 && FFABS(l1mv1[xy4][0]) <= 1 && FFABS(l1mv1[xy4][1]) <= 1))){ + a=b=0; + if(ref[0] > 0) + a= mv[0]; + if(ref[1] > 0) + b= mv[1]; + n++; + }else{ + a= mv[0]; + b= mv[1]; + } + fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, a, 4); + fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, b, 4); + } + if(!is_b8x8 && !(n&3)) + *mb_type= (*mb_type & ~(MB_TYPE_8x8|MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_P1L0|MB_TYPE_P1L1))|MB_TYPE_16x16|MB_TYPE_DIRECT2; + }else if(IS_16X16(*mb_type)){ + int a,b; + + fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1); + fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1); + if(!IS_INTRA(mb_type_col[0]) && !h->ref_list[1][0].long_ref + && ( (l1ref0[0] == 0 && FFABS(l1mv0[0][0]) <= 1 && FFABS(l1mv0[0][1]) <= 1) + || (l1ref0[0] < 0 && l1ref1[0] == 0 && FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][1]) <= 1 + && h->x264_build>33U))){ + a=b=0; + if(ref[0] > 0) + a= mv[0]; + if(ref[1] > 0) + b= mv[1]; + }else{ + a= mv[0]; + b= mv[1]; + } + fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, a, 4); + fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, b, 4); + }else{ + int n=0; + for(i8=0; i8<4; i8++){ + const int x8 = i8&1; + const int y8 = i8>>1; + + if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) + continue; + h->sub_mb_type[i8] = sub_mb_type; + + fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, mv[0], 4); + fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, mv[1], 4); + fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); + fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); + + assert(b8_stride==2); + /* col_zero_flag */ + if(!IS_INTRA(mb_type_col[0]) && !h->ref_list[1][0].long_ref && ( l1ref0[i8] == 0 + || (l1ref0[i8] < 0 && l1ref1[i8] == 0 + && h->x264_build>33U))){ + const int16_t (*l1mv)[2]= l1ref0[i8] == 0 ? l1mv0 : l1mv1; + if(IS_SUB_8X8(sub_mb_type)){ + const int16_t *mv_col = l1mv[x8*3 + y8*3*b4_stride]; + if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ + if(ref[0] == 0) + fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); + if(ref[1] == 0) + fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); + n+=4; + } + }else{ + int m=0; + for(i4=0; i4<4; i4++){ + const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*b4_stride]; + if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ + if(ref[0] == 0) + AV_ZERO32(h->mv_cache[0][scan8[i8*4+i4]]); + if(ref[1] == 0) + AV_ZERO32(h->mv_cache[1][scan8[i8*4+i4]]); + m++; + } + } + if(!(m&3)) + h->sub_mb_type[i8]+= MB_TYPE_16x16 - MB_TYPE_8x8; + n+=m; + } + } + } + if(!is_b8x8 && !(n&15)) + *mb_type= (*mb_type & ~(MB_TYPE_8x8|MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_P1L0|MB_TYPE_P1L1))|MB_TYPE_16x16|MB_TYPE_DIRECT2; + } +} + +static void pred_temp_direct_motion(H264Context * const h, int *mb_type){ + MpegEncContext * const s = &h->s; + int b8_stride = 2; + int b4_stride = h->b_stride; + int mb_xy = h->mb_xy; + int mb_type_col[2]; + const int16_t (*l1mv0)[2], (*l1mv1)[2]; + const int8_t *l1ref0, *l1ref1; + const int is_b8x8 = IS_8X8(*mb_type); + unsigned int sub_mb_type; + int i8, i4; + + assert(h->ref_list[1][0].reference&3); + + if(IS_INTERLACED(h->ref_list[1][0].mb_type[mb_xy])){ // AFL/AFR/FR/FL -> AFL/FL + if(!IS_INTERLACED(*mb_type)){ // AFR/FR -> AFL/FL + mb_xy= s->mb_x + ((s->mb_y&~1) + h->col_parity)*s->mb_stride; + b8_stride = 0; + }else{ + mb_xy += h->col_fieldoff; // non zero for FL -> FL & differ parity + } + goto single_col; + }else{ // AFL/AFR/FR/FL -> AFR/FR + if(IS_INTERLACED(*mb_type)){ // AFL /FL -> AFR/FR + mb_xy= s->mb_x + (s->mb_y&~1)*s->mb_stride; + mb_type_col[0] = h->ref_list[1][0].mb_type[mb_xy]; + mb_type_col[1] = h->ref_list[1][0].mb_type[mb_xy + s->mb_stride]; + b8_stride = 2+4*s->mb_stride; + b4_stride *= 6; + + sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; /* B_SUB_8x8 */ + + if( (mb_type_col[0] & MB_TYPE_16x16_OR_INTRA) + && (mb_type_col[1] & MB_TYPE_16x16_OR_INTRA) + && !is_b8x8){ + *mb_type |= MB_TYPE_16x8 |MB_TYPE_L0L1|MB_TYPE_DIRECT2; /* B_16x8 */ + }else{ + *mb_type |= MB_TYPE_8x8|MB_TYPE_L0L1; + } + }else{ // AFR/FR -> AFR/FR +single_col: + mb_type_col[0] = + mb_type_col[1] = h->ref_list[1][0].mb_type[mb_xy]; + + sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; /* B_SUB_8x8 */ + if(!is_b8x8 && (mb_type_col[0] & MB_TYPE_16x16_OR_INTRA)){ + *mb_type |= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; /* B_16x16 */ + }else if(!is_b8x8 && (mb_type_col[0] & (MB_TYPE_16x8|MB_TYPE_8x16))){ + *mb_type |= MB_TYPE_L0L1|MB_TYPE_DIRECT2 | (mb_type_col[0] & (MB_TYPE_16x8|MB_TYPE_8x16)); + }else{ + if(!h->sps.direct_8x8_inference_flag){ + /* FIXME save sub mb types from previous frames (or derive from MVs) + * so we know exactly what block size to use */ + sub_mb_type = MB_TYPE_8x8|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; /* B_SUB_4x4 */ + } + *mb_type |= MB_TYPE_8x8|MB_TYPE_L0L1; + } + } + } + + l1mv0 = &h->ref_list[1][0].motion_val[0][h->mb2b_xy [mb_xy]]; + l1mv1 = &h->ref_list[1][0].motion_val[1][h->mb2b_xy [mb_xy]]; + l1ref0 = &h->ref_list[1][0].ref_index [0][4*mb_xy]; + l1ref1 = &h->ref_list[1][0].ref_index [1][4*mb_xy]; + if(!b8_stride){ + if(s->mb_y&1){ + l1ref0 += 2; + l1ref1 += 2; + l1mv0 += 2*b4_stride; + l1mv1 += 2*b4_stride; + } + } + + { + const int *map_col_to_list0[2] = {h->map_col_to_list0[0], h->map_col_to_list0[1]}; + const int *dist_scale_factor = h->dist_scale_factor; + int ref_offset; + + if(FRAME_MBAFF && IS_INTERLACED(*mb_type)){ + map_col_to_list0[0] = h->map_col_to_list0_field[s->mb_y&1][0]; + map_col_to_list0[1] = h->map_col_to_list0_field[s->mb_y&1][1]; + dist_scale_factor =h->dist_scale_factor_field[s->mb_y&1]; + } + ref_offset = (h->ref_list[1][0].mbaff<<4) & (mb_type_col[0]>>3); //if(h->ref_list[1][0].mbaff && IS_INTERLACED(mb_type_col[0])) ref_offset=16 else 0 + + if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col[0])){ + int y_shift = 2*!IS_INTERLACED(*mb_type); + assert(h->sps.direct_8x8_inference_flag); + + for(i8=0; i8<4; i8++){ + const int x8 = i8&1; + const int y8 = i8>>1; + int ref0, scale; + const int16_t (*l1mv)[2]= l1mv0; + + if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) + continue; + h->sub_mb_type[i8] = sub_mb_type; + + fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1); + if(IS_INTRA(mb_type_col[y8])){ + fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1); + fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); + fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); + continue; + } + + ref0 = l1ref0[x8 + y8*b8_stride]; + if(ref0 >= 0) + ref0 = map_col_to_list0[0][ref0 + ref_offset]; + else{ + ref0 = map_col_to_list0[1][l1ref1[x8 + y8*b8_stride] + ref_offset]; + l1mv= l1mv1; + } + scale = dist_scale_factor[ref0]; + fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1); + + { + const int16_t *mv_col = l1mv[x8*3 + y8*b4_stride]; + int my_col = (mv_col[1]<> 8; + int my = (scale * my_col + 128) >> 8; + fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4); + fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-my_col), 4); + } + } + return; + } + + /* one-to-one mv scaling */ + + if(IS_16X16(*mb_type)){ + int ref, mv0, mv1; + + fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, 0, 1); + if(IS_INTRA(mb_type_col[0])){ + ref=mv0=mv1=0; + }else{ + const int ref0 = l1ref0[0] >= 0 ? map_col_to_list0[0][l1ref0[0] + ref_offset] + : map_col_to_list0[1][l1ref1[0] + ref_offset]; + const int scale = dist_scale_factor[ref0]; + const int16_t *mv_col = l1ref0[0] >= 0 ? l1mv0[0] : l1mv1[0]; + int mv_l0[2]; + mv_l0[0] = (scale * mv_col[0] + 128) >> 8; + mv_l0[1] = (scale * mv_col[1] + 128) >> 8; + ref= ref0; + mv0= pack16to32(mv_l0[0],mv_l0[1]); + mv1= pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]); + } + fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1); + fill_rectangle(&h-> mv_cache[0][scan8[0]], 4, 4, 8, mv0, 4); + fill_rectangle(&h-> mv_cache[1][scan8[0]], 4, 4, 8, mv1, 4); + }else{ + for(i8=0; i8<4; i8++){ + const int x8 = i8&1; + const int y8 = i8>>1; + int ref0, scale; + const int16_t (*l1mv)[2]= l1mv0; + + if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) + continue; + h->sub_mb_type[i8] = sub_mb_type; + fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1); + if(IS_INTRA(mb_type_col[0])){ + fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1); + fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); + fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); + continue; + } + + assert(b8_stride == 2); + ref0 = l1ref0[i8]; + if(ref0 >= 0) + ref0 = map_col_to_list0[0][ref0 + ref_offset]; + else{ + ref0 = map_col_to_list0[1][l1ref1[i8] + ref_offset]; + l1mv= l1mv1; + } + scale = dist_scale_factor[ref0]; + + fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1); + if(IS_SUB_8X8(sub_mb_type)){ + const int16_t *mv_col = l1mv[x8*3 + y8*3*b4_stride]; + int mx = (scale * mv_col[0] + 128) >> 8; + int my = (scale * mv_col[1] + 128) >> 8; + fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4); + fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-mv_col[1]), 4); + }else + for(i4=0; i4<4; i4++){ + const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*b4_stride]; + int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]]; + mv_l0[0] = (scale * mv_col[0] + 128) >> 8; + mv_l0[1] = (scale * mv_col[1] + 128) >> 8; + AV_WN32A(h->mv_cache[1][scan8[i8*4+i4]], + pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1])); + } + } + } + } +} + +void ff_h264_pred_direct_motion(H264Context * const h, int *mb_type){ + if(h->direct_spatial_mv_pred){ + pred_spatial_direct_motion(h, mb_type); + }else{ + pred_temp_direct_motion(h, mb_type); + } +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_loopfilter.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_loopfilter.c new file mode 100644 index 00000000..710e0370 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_loopfilter.c @@ -0,0 +1,752 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... loop filter + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + * H.264 / AVC / MPEG4 part10 loop filter. + * @author Michael Niedermayer + */ + +#include "libavutil/intreadwrite.h" +#include "internal.h" +#include "dsputil.h" +#include "avcodec.h" +#include "mpegvideo.h" +#include "h264.h" +#include "mathops.h" +#include "rectangle.h" + +//#undef NDEBUG +#include + +/* Deblocking filter (p153) */ +static const uint8_t alpha_table[52*3] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 4, 4, 5, 6, + 7, 8, 9, 10, 12, 13, 15, 17, 20, 22, + 25, 28, 32, 36, 40, 45, 50, 56, 63, 71, + 80, 90,101,113,127,144,162,182,203,226, + 255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255, +}; +static const uint8_t beta_table[52*3] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, + 3, 3, 3, 4, 4, 4, 6, 6, 7, 7, + 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, + 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, + 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, +}; +static const uint8_t tc0_table[52*3][4] = { + {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, + {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, + {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, + {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, + {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, + {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, + {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, + {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, + {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, + {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, + {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, + {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 1 }, + {-1, 0, 0, 1 }, {-1, 0, 0, 1 }, {-1, 0, 0, 1 }, {-1, 0, 1, 1 }, {-1, 0, 1, 1 }, {-1, 1, 1, 1 }, + {-1, 1, 1, 1 }, {-1, 1, 1, 1 }, {-1, 1, 1, 1 }, {-1, 1, 1, 2 }, {-1, 1, 1, 2 }, {-1, 1, 1, 2 }, + {-1, 1, 1, 2 }, {-1, 1, 2, 3 }, {-1, 1, 2, 3 }, {-1, 2, 2, 3 }, {-1, 2, 2, 4 }, {-1, 2, 3, 4 }, + {-1, 2, 3, 4 }, {-1, 3, 3, 5 }, {-1, 3, 4, 6 }, {-1, 3, 4, 6 }, {-1, 4, 5, 7 }, {-1, 4, 5, 8 }, + {-1, 4, 6, 9 }, {-1, 5, 7,10 }, {-1, 6, 8,11 }, {-1, 6, 8,13 }, {-1, 7,10,14 }, {-1, 8,11,16 }, + {-1, 9,12,18 }, {-1,10,13,20 }, {-1,11,15,23 }, {-1,13,17,25 }, + {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, + {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, + {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, + {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, + {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, + {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, + {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, + {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, + {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, +}; + +static void av_always_inline filter_mb_edgev( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h) { + const unsigned int index_a = qp + h->slice_alpha_c0_offset; + const int alpha = alpha_table[index_a]; + const int beta = beta_table[qp + h->slice_beta_offset]; + if (alpha ==0 || beta == 0) return; + + if( bS[0] < 4 ) { + int8_t tc[4]; + tc[0] = tc0_table[index_a][bS[0]]; + tc[1] = tc0_table[index_a][bS[1]]; + tc[2] = tc0_table[index_a][bS[2]]; + tc[3] = tc0_table[index_a][bS[3]]; + h->h264dsp.h264_h_loop_filter_luma(pix, stride, alpha, beta, tc); + } else { + h->h264dsp.h264_h_loop_filter_luma_intra(pix, stride, alpha, beta); + } +} +static void av_always_inline filter_mb_edgecv( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h ) { + const unsigned int index_a = qp + h->slice_alpha_c0_offset; + const int alpha = alpha_table[index_a]; + const int beta = beta_table[qp + h->slice_beta_offset]; + if (alpha ==0 || beta == 0) return; + + if( bS[0] < 4 ) { + int8_t tc[4]; + tc[0] = tc0_table[index_a][bS[0]]+1; + tc[1] = tc0_table[index_a][bS[1]]+1; + tc[2] = tc0_table[index_a][bS[2]]+1; + tc[3] = tc0_table[index_a][bS[3]]+1; + h->h264dsp.h264_h_loop_filter_chroma(pix, stride, alpha, beta, tc); + } else { + h->h264dsp.h264_h_loop_filter_chroma_intra(pix, stride, alpha, beta); + } +} + +static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int bsi, int qp ) { + int i; + int index_a = qp + h->slice_alpha_c0_offset; + int alpha = alpha_table[index_a]; + int beta = beta_table[qp + h->slice_beta_offset]; + for( i = 0; i < 8; i++, pix += stride) { + const int bS_index = (i >> 1) * bsi; + + if( bS[bS_index] == 0 ) { + continue; + } + + if( bS[bS_index] < 4 ) { + const int tc0 = tc0_table[index_a][bS[bS_index]]; + const int p0 = pix[-1]; + const int p1 = pix[-2]; + const int p2 = pix[-3]; + const int q0 = pix[0]; + const int q1 = pix[1]; + const int q2 = pix[2]; + + if( FFABS( p0 - q0 ) < alpha && + FFABS( p1 - p0 ) < beta && + FFABS( q1 - q0 ) < beta ) { + int tc = tc0; + int i_delta; + + if( FFABS( p2 - p0 ) < beta ) { + if(tc0) + pix[-2] = p1 + av_clip( ( p2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( p1 << 1 ) ) >> 1, -tc0, tc0 ); + tc++; + } + if( FFABS( q2 - q0 ) < beta ) { + if(tc0) + pix[1] = q1 + av_clip( ( q2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( q1 << 1 ) ) >> 1, -tc0, tc0 ); + tc++; + } + + i_delta = av_clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc ); + pix[-1] = av_clip_uint8( p0 + i_delta ); /* p0' */ + pix[0] = av_clip_uint8( q0 - i_delta ); /* q0' */ + tprintf(h->s.avctx, "filter_mb_mbaff_edgev i:%d, qp:%d, indexA:%d, alpha:%d, beta:%d, tc:%d\n# bS:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", i, qp[qp_index], index_a, alpha, beta, tc, bS[bS_index], pix[-3], p1, p0, q0, q1, pix[2], p1, pix[-1], pix[0], q1); + } + }else{ + const int p0 = pix[-1]; + const int p1 = pix[-2]; + const int p2 = pix[-3]; + + const int q0 = pix[0]; + const int q1 = pix[1]; + const int q2 = pix[2]; + + if( FFABS( p0 - q0 ) < alpha && + FFABS( p1 - p0 ) < beta && + FFABS( q1 - q0 ) < beta ) { + + if(FFABS( p0 - q0 ) < (( alpha >> 2 ) + 2 )){ + if( FFABS( p2 - p0 ) < beta) + { + const int p3 = pix[-4]; + /* p0', p1', p2' */ + pix[-1] = ( p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4 ) >> 3; + pix[-2] = ( p2 + p1 + p0 + q0 + 2 ) >> 2; + pix[-3] = ( 2*p3 + 3*p2 + p1 + p0 + q0 + 4 ) >> 3; + } else { + /* p0' */ + pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2; + } + if( FFABS( q2 - q0 ) < beta) + { + const int q3 = pix[3]; + /* q0', q1', q2' */ + pix[0] = ( p1 + 2*p0 + 2*q0 + 2*q1 + q2 + 4 ) >> 3; + pix[1] = ( p0 + q0 + q1 + q2 + 2 ) >> 2; + pix[2] = ( 2*q3 + 3*q2 + q1 + q0 + p0 + 4 ) >> 3; + } else { + /* q0' */ + pix[0] = ( 2*q1 + q0 + p1 + 2 ) >> 2; + } + }else{ + /* p0', q0' */ + pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2; + pix[ 0] = ( 2*q1 + q0 + p1 + 2 ) >> 2; + } + tprintf(h->s.avctx, "filter_mb_mbaff_edgev i:%d, qp:%d, indexA:%d, alpha:%d, beta:%d\n# bS:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x, %02x, %02x]\n", i, qp[qp_index], index_a, alpha, beta, p2, p1, p0, q0, q1, q2, pix[-3], pix[-2], pix[-1], pix[0], pix[1], pix[2]); + } + } + } +} +static void filter_mb_mbaff_edgecv( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int bsi, int qp ) { + int i; + int index_a = qp + h->slice_alpha_c0_offset; + int alpha = alpha_table[index_a]; + int beta = beta_table[qp + h->slice_beta_offset]; + for( i = 0; i < 4; i++, pix += stride) { + const int bS_index = i*bsi; + + if( bS[bS_index] == 0 ) { + continue; + } + + if( bS[bS_index] < 4 ) { + const int tc = tc0_table[index_a][bS[bS_index]] + 1; + const int p0 = pix[-1]; + const int p1 = pix[-2]; + const int q0 = pix[0]; + const int q1 = pix[1]; + + if( FFABS( p0 - q0 ) < alpha && + FFABS( p1 - p0 ) < beta && + FFABS( q1 - q0 ) < beta ) { + const int i_delta = av_clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc ); + + pix[-1] = av_clip_uint8( p0 + i_delta ); /* p0' */ + pix[0] = av_clip_uint8( q0 - i_delta ); /* q0' */ + tprintf(h->s.avctx, "filter_mb_mbaff_edgecv i:%d, qp:%d, indexA:%d, alpha:%d, beta:%d, tc:%d\n# bS:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", i, qp[qp_index], index_a, alpha, beta, tc, bS[bS_index], pix[-3], p1, p0, q0, q1, pix[2], p1, pix[-1], pix[0], q1); + } + }else{ + const int p0 = pix[-1]; + const int p1 = pix[-2]; + const int q0 = pix[0]; + const int q1 = pix[1]; + + if( FFABS( p0 - q0 ) < alpha && + FFABS( p1 - p0 ) < beta && + FFABS( q1 - q0 ) < beta ) { + + pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2; /* p0' */ + pix[0] = ( 2*q1 + q0 + p1 + 2 ) >> 2; /* q0' */ + tprintf(h->s.avctx, "filter_mb_mbaff_edgecv i:%d\n# bS:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x, %02x, %02x]\n", i, pix[-3], p1, p0, q0, q1, pix[2], pix[-3], pix[-2], pix[-1], pix[0], pix[1], pix[2]); + } + } + } +} + +static void av_always_inline filter_mb_edgeh( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h ) { + const unsigned int index_a = qp + h->slice_alpha_c0_offset; + const int alpha = alpha_table[index_a]; + const int beta = beta_table[qp + h->slice_beta_offset]; + if (alpha ==0 || beta == 0) return; + + if( bS[0] < 4 ) { + int8_t tc[4]; + tc[0] = tc0_table[index_a][bS[0]]; + tc[1] = tc0_table[index_a][bS[1]]; + tc[2] = tc0_table[index_a][bS[2]]; + tc[3] = tc0_table[index_a][bS[3]]; + h->h264dsp.h264_v_loop_filter_luma(pix, stride, alpha, beta, tc); + } else { + h->h264dsp.h264_v_loop_filter_luma_intra(pix, stride, alpha, beta); + } +} + +static void av_always_inline filter_mb_edgech( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h ) { + const unsigned int index_a = qp + h->slice_alpha_c0_offset; + const int alpha = alpha_table[index_a]; + const int beta = beta_table[qp + h->slice_beta_offset]; + if (alpha ==0 || beta == 0) return; + + if( bS[0] < 4 ) { + int8_t tc[4]; + tc[0] = tc0_table[index_a][bS[0]]+1; + tc[1] = tc0_table[index_a][bS[1]]+1; + tc[2] = tc0_table[index_a][bS[2]]+1; + tc[3] = tc0_table[index_a][bS[3]]+1; + h->h264dsp.h264_v_loop_filter_chroma(pix, stride, alpha, beta, tc); + } else { + h->h264dsp.h264_v_loop_filter_chroma_intra(pix, stride, alpha, beta); + } +} + +void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) { + MpegEncContext * const s = &h->s; + int mb_xy; + int mb_type, left_type; + int qp, qp0, qp1, qpc, qpc0, qpc1, qp_thresh; + + mb_xy = h->mb_xy; + + if(!h->top_type || !h->h264dsp.h264_loop_filter_strength || h->pps.chroma_qp_diff) { + ff_h264_filter_mb(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize); + return; + } + assert(!FRAME_MBAFF); + left_type= h->left_type[0]; + + mb_type = s->current_picture.mb_type[mb_xy]; + qp = s->current_picture.qscale_table[mb_xy]; + qp0 = s->current_picture.qscale_table[mb_xy-1]; + qp1 = s->current_picture.qscale_table[h->top_mb_xy]; + qpc = get_chroma_qp( h, 0, qp ); + qpc0 = get_chroma_qp( h, 0, qp0 ); + qpc1 = get_chroma_qp( h, 0, qp1 ); + qp0 = (qp + qp0 + 1) >> 1; + qp1 = (qp + qp1 + 1) >> 1; + qpc0 = (qpc + qpc0 + 1) >> 1; + qpc1 = (qpc + qpc1 + 1) >> 1; + qp_thresh = 15+52 - h->slice_alpha_c0_offset; + if(qp <= qp_thresh && qp0 <= qp_thresh && qp1 <= qp_thresh && + qpc <= qp_thresh && qpc0 <= qp_thresh && qpc1 <= qp_thresh) + return; + + if( IS_INTRA(mb_type) ) { + int16_t bS4[4] = {4,4,4,4}; + int16_t bS3[4] = {3,3,3,3}; + int16_t *bSH = FIELD_PICTURE ? bS3 : bS4; + if(left_type) + filter_mb_edgev( &img_y[4*0], linesize, bS4, qp0, h); + if( IS_8x8DCT(mb_type) ) { + filter_mb_edgev( &img_y[4*2], linesize, bS3, qp, h); + filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, h); + filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, h); + } else { + filter_mb_edgev( &img_y[4*1], linesize, bS3, qp, h); + filter_mb_edgev( &img_y[4*2], linesize, bS3, qp, h); + filter_mb_edgev( &img_y[4*3], linesize, bS3, qp, h); + filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, h); + filter_mb_edgeh( &img_y[4*1*linesize], linesize, bS3, qp, h); + filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, h); + filter_mb_edgeh( &img_y[4*3*linesize], linesize, bS3, qp, h); + } + if(left_type){ + filter_mb_edgecv( &img_cb[2*0], uvlinesize, bS4, qpc0, h); + filter_mb_edgecv( &img_cr[2*0], uvlinesize, bS4, qpc0, h); + } + filter_mb_edgecv( &img_cb[2*2], uvlinesize, bS3, qpc, h); + filter_mb_edgecv( &img_cr[2*2], uvlinesize, bS3, qpc, h); + filter_mb_edgech( &img_cb[2*0*uvlinesize], uvlinesize, bSH, qpc1, h); + filter_mb_edgech( &img_cb[2*2*uvlinesize], uvlinesize, bS3, qpc, h); + filter_mb_edgech( &img_cr[2*0*uvlinesize], uvlinesize, bSH, qpc1, h); + filter_mb_edgech( &img_cr[2*2*uvlinesize], uvlinesize, bS3, qpc, h); + return; + } else { + LOCAL_ALIGNED_8(int16_t, bS, [2], [4][4]); + int edges; + if( IS_8x8DCT(mb_type) && (h->cbp&7) == 7 ) { + edges = 4; + AV_WN64A(bS[0][0], 0x0002000200020002ULL); + AV_WN64A(bS[0][2], 0x0002000200020002ULL); + AV_WN64A(bS[1][0], 0x0002000200020002ULL); + AV_WN64A(bS[1][2], 0x0002000200020002ULL); + } else { + int mask_edge1 = (3*(((5*mb_type)>>5)&1)) | (mb_type>>4); //(mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16)) ? 3 : (mb_type & MB_TYPE_16x8) ? 1 : 0; + int mask_edge0 = 3*((mask_edge1>>1) & ((5*left_type)>>5)&1); // (mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16)) && (h->left_type[0] & (MB_TYPE_16x16 | MB_TYPE_8x16)) ? 3 : 0; + int step = 1+(mb_type>>24); //IS_8x8DCT(mb_type) ? 2 : 1; + edges = 4 - 3*((mb_type>>3) & !(h->cbp & 15)); //(mb_type & MB_TYPE_16x16) && !(h->cbp & 15) ? 1 : 4; + h->h264dsp.h264_loop_filter_strength( bS, h->non_zero_count_cache, h->ref_cache, h->mv_cache, + h->list_count==2, edges, step, mask_edge0, mask_edge1, FIELD_PICTURE); + } + if( IS_INTRA(left_type) ) + AV_WN64A(bS[0][0], 0x0004000400040004ULL); + if( IS_INTRA(h->top_type) ) + AV_WN64A(bS[1][0], FIELD_PICTURE ? 0x0003000300030003ULL : 0x0004000400040004ULL); + +#define FILTER(hv,dir,edge)\ + if(AV_RN64A(bS[dir][edge])) { \ + filter_mb_edge##hv( &img_y[4*edge*(dir?linesize:1)], linesize, bS[dir][edge], edge ? qp : qp##dir, h );\ + if(!(edge&1)) {\ + filter_mb_edgec##hv( &img_cb[2*edge*(dir?uvlinesize:1)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir, h );\ + filter_mb_edgec##hv( &img_cr[2*edge*(dir?uvlinesize:1)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir, h );\ + }\ + } + if(left_type) + FILTER(v,0,0); + if( edges == 1 ) { + FILTER(h,1,0); + } else if( IS_8x8DCT(mb_type) ) { + FILTER(v,0,2); + FILTER(h,1,0); + FILTER(h,1,2); + } else { + FILTER(v,0,1); + FILTER(v,0,2); + FILTER(v,0,3); + FILTER(h,1,0); + FILTER(h,1,1); + FILTER(h,1,2); + FILTER(h,1,3); + } +#undef FILTER + } +} + +static int check_mv(H264Context *h, long b_idx, long bn_idx, int mvy_limit){ + int v; + + v= h->ref_cache[0][b_idx] != h->ref_cache[0][bn_idx]; + if(!v && h->ref_cache[0][b_idx]!=-1) + v= h->mv_cache[0][b_idx][0] - h->mv_cache[0][bn_idx][0] + 3 >= 7U | + FFABS( h->mv_cache[0][b_idx][1] - h->mv_cache[0][bn_idx][1] ) >= mvy_limit; + + if(h->list_count==2){ + if(!v) + v = h->ref_cache[1][b_idx] != h->ref_cache[1][bn_idx] | + h->mv_cache[1][b_idx][0] - h->mv_cache[1][bn_idx][0] + 3 >= 7U | + FFABS( h->mv_cache[1][b_idx][1] - h->mv_cache[1][bn_idx][1] ) >= mvy_limit; + + if(v){ + if(h->ref_cache[0][b_idx] != h->ref_cache[1][bn_idx] | + h->ref_cache[1][b_idx] != h->ref_cache[0][bn_idx]) + return 1; + return + h->mv_cache[0][b_idx][0] - h->mv_cache[1][bn_idx][0] + 3 >= 7U | + FFABS( h->mv_cache[0][b_idx][1] - h->mv_cache[1][bn_idx][1] ) >= mvy_limit | + h->mv_cache[1][b_idx][0] - h->mv_cache[0][bn_idx][0] + 3 >= 7U | + FFABS( h->mv_cache[1][b_idx][1] - h->mv_cache[0][bn_idx][1] ) >= mvy_limit; + } + } + + return v; +} + +static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize, int mb_xy, int mb_type, int mvy_limit, int first_vertical_edge_done, int dir) { + MpegEncContext * const s = &h->s; + int edge; + const int mbm_xy = dir == 0 ? mb_xy -1 : h->top_mb_xy; + const int mbm_type = dir == 0 ? h->left_type[0] : h->top_type; + + // how often to recheck mv-based bS when iterating between edges + static const uint8_t mask_edge_tab[2][8]={{0,3,3,3,1,1,1,1}, + {0,3,1,1,3,3,3,3}}; + const int mask_edge = mask_edge_tab[dir][(mb_type>>3)&7]; + const int edges = mask_edge== 3 && !(h->cbp&15) ? 1 : 4; + + // how often to recheck mv-based bS when iterating along each edge + const int mask_par0 = mb_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir)); + + if(mbm_type && !first_vertical_edge_done){ + + if (FRAME_MBAFF && (dir == 1) && ((mb_y&1) == 0) + && IS_INTERLACED(mbm_type&~mb_type) + ) { + // This is a special case in the norm where the filtering must + // be done twice (one each of the field) even if we are in a + // frame macroblock. + // + unsigned int tmp_linesize = 2 * linesize; + unsigned int tmp_uvlinesize = 2 * uvlinesize; + int mbn_xy = mb_xy - 2 * s->mb_stride; + int j; + + for(j=0; j<2; j++, mbn_xy += s->mb_stride){ + DECLARE_ALIGNED(8, int16_t, bS)[4]; + int qp; + if( IS_INTRA(mb_type|s->current_picture.mb_type[mbn_xy]) ) { + AV_WN64A(bS, 0x0003000300030003ULL); + } else { + if(!CABAC && IS_8x8DCT(s->current_picture.mb_type[mbn_xy])){ + bS[0]= 1+((h->cbp_table[mbn_xy] & 4)||h->non_zero_count_cache[scan8[0]+0]); + bS[1]= 1+((h->cbp_table[mbn_xy] & 4)||h->non_zero_count_cache[scan8[0]+1]); + bS[2]= 1+((h->cbp_table[mbn_xy] & 8)||h->non_zero_count_cache[scan8[0]+2]); + bS[3]= 1+((h->cbp_table[mbn_xy] & 8)||h->non_zero_count_cache[scan8[0]+3]); + }else{ + const uint8_t *mbn_nnz = h->non_zero_count[mbn_xy] + 4+3*8; + int i; + for( i = 0; i < 4; i++ ) { + bS[i] = 1 + !!(h->non_zero_count_cache[scan8[0]+i] | mbn_nnz[i]); + } + } + } + // Do not use s->qscale as luma quantizer because it has not the same + // value in IPCM macroblocks. + qp = ( s->current_picture.qscale_table[mb_xy] + s->current_picture.qscale_table[mbn_xy] + 1 ) >> 1; + tprintf(s->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, tmp_linesize, tmp_uvlinesize); + { int i; for (i = 0; i < 4; i++) tprintf(s->avctx, " bS[%d]:%d", i, bS[i]); tprintf(s->avctx, "\n"); } + filter_mb_edgeh( &img_y[j*linesize], tmp_linesize, bS, qp, h ); + filter_mb_edgech( &img_cb[j*uvlinesize], tmp_uvlinesize, bS, + ( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1, h); + filter_mb_edgech( &img_cr[j*uvlinesize], tmp_uvlinesize, bS, + ( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1, h); + } + }else{ + DECLARE_ALIGNED(8, int16_t, bS)[4]; + int qp; + + if( IS_INTRA(mb_type|mbm_type)) { + AV_WN64A(bS, 0x0003000300030003ULL); + if ( (!IS_INTERLACED(mb_type|mbm_type)) + || ((FRAME_MBAFF || (s->picture_structure != PICT_FRAME)) && (dir == 0)) + ) + AV_WN64A(bS, 0x0004000400040004ULL); + } else { + int i; + int mv_done; + + if( dir && FRAME_MBAFF && IS_INTERLACED(mb_type ^ mbm_type)) { + AV_WN64A(bS, 0x0001000100010001ULL); + mv_done = 1; + } + else if( mask_par0 && ((mbm_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir)))) ) { + int b_idx= 8 + 4; + int bn_idx= b_idx - (dir ? 8:1); + + bS[0] = bS[1] = bS[2] = bS[3] = check_mv(h, 8 + 4, bn_idx, mvy_limit); + mv_done = 1; + } + else + mv_done = 0; + + for( i = 0; i < 4; i++ ) { + int x = dir == 0 ? 0 : i; + int y = dir == 0 ? i : 0; + int b_idx= 8 + 4 + x + 8*y; + int bn_idx= b_idx - (dir ? 8:1); + + if( h->non_zero_count_cache[b_idx] | + h->non_zero_count_cache[bn_idx] ) { + bS[i] = 2; + } + else if(!mv_done) + { + bS[i] = check_mv(h, b_idx, bn_idx, mvy_limit); + } + } + } + + /* Filter edge */ + // Do not use s->qscale as luma quantizer because it has not the same + // value in IPCM macroblocks. + if(bS[0]+bS[1]+bS[2]+bS[3]){ + qp = ( s->current_picture.qscale_table[mb_xy] + s->current_picture.qscale_table[mbm_xy] + 1 ) >> 1; + //tprintf(s->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d, QPc:%d, QPcn:%d\n", mb_x, mb_y, dir, edge, qp, h->chroma_qp[0], s->current_picture.qscale_table[mbn_xy]); + tprintf(s->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize); + //{ int i; for (i = 0; i < 4; i++) tprintf(s->avctx, " bS[%d]:%d", i, bS[i]); tprintf(s->avctx, "\n"); } + if( dir == 0 ) { + filter_mb_edgev( &img_y[0], linesize, bS, qp, h ); + { + int qp= ( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbm_xy] ) + 1 ) >> 1; + filter_mb_edgecv( &img_cb[0], uvlinesize, bS, qp, h); + if(h->pps.chroma_qp_diff) + qp= ( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbm_xy] ) + 1 ) >> 1; + filter_mb_edgecv( &img_cr[0], uvlinesize, bS, qp, h); + } + } else { + filter_mb_edgeh( &img_y[0], linesize, bS, qp, h ); + { + int qp= ( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbm_xy] ) + 1 ) >> 1; + filter_mb_edgech( &img_cb[0], uvlinesize, bS, qp, h); + if(h->pps.chroma_qp_diff) + qp= ( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbm_xy] ) + 1 ) >> 1; + filter_mb_edgech( &img_cr[0], uvlinesize, bS, qp, h); + } + } + } + } + } + + /* Calculate bS */ + for( edge = 1; edge < edges; edge++ ) { + DECLARE_ALIGNED(8, int16_t, bS)[4]; + int qp; + + if( IS_8x8DCT(mb_type & (edge<<24)) ) // (edge&1) && IS_8x8DCT(mb_type) + continue; + + if( IS_INTRA(mb_type)) { + AV_WN64A(bS, 0x0003000300030003ULL); + } else { + int i; + int mv_done; + + if( edge & mask_edge ) { + AV_ZERO64(bS); + mv_done = 1; + } + else if( mask_par0 ) { + int b_idx= 8 + 4 + edge * (dir ? 8:1); + int bn_idx= b_idx - (dir ? 8:1); + + bS[0] = bS[1] = bS[2] = bS[3] = check_mv(h, b_idx, bn_idx, mvy_limit); + mv_done = 1; + } + else + mv_done = 0; + + for( i = 0; i < 4; i++ ) { + int x = dir == 0 ? edge : i; + int y = dir == 0 ? i : edge; + int b_idx= 8 + 4 + x + 8*y; + int bn_idx= b_idx - (dir ? 8:1); + + if( h->non_zero_count_cache[b_idx] | + h->non_zero_count_cache[bn_idx] ) { + bS[i] = 2; + } + else if(!mv_done) + { + bS[i] = check_mv(h, b_idx, bn_idx, mvy_limit); + } + } + + if(bS[0]+bS[1]+bS[2]+bS[3] == 0) + continue; + } + + /* Filter edge */ + // Do not use s->qscale as luma quantizer because it has not the same + // value in IPCM macroblocks. + qp = s->current_picture.qscale_table[mb_xy]; + //tprintf(s->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d, QPc:%d, QPcn:%d\n", mb_x, mb_y, dir, edge, qp, h->chroma_qp[0], s->current_picture.qscale_table[mbn_xy]); + tprintf(s->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize); + //{ int i; for (i = 0; i < 4; i++) tprintf(s->avctx, " bS[%d]:%d", i, bS[i]); tprintf(s->avctx, "\n"); } + if( dir == 0 ) { + filter_mb_edgev( &img_y[4*edge], linesize, bS, qp, h ); + if( (edge&1) == 0 ) { + filter_mb_edgecv( &img_cb[2*edge], uvlinesize, bS, h->chroma_qp[0], h); + filter_mb_edgecv( &img_cr[2*edge], uvlinesize, bS, h->chroma_qp[1], h); + } + } else { + filter_mb_edgeh( &img_y[4*edge*linesize], linesize, bS, qp, h ); + if( (edge&1) == 0 ) { + filter_mb_edgech( &img_cb[2*edge*uvlinesize], uvlinesize, bS, h->chroma_qp[0], h); + filter_mb_edgech( &img_cr[2*edge*uvlinesize], uvlinesize, bS, h->chroma_qp[1], h); + } + } + } +} + +void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) { + MpegEncContext * const s = &h->s; + const int mb_xy= mb_x + mb_y*s->mb_stride; + const int mb_type = s->current_picture.mb_type[mb_xy]; + const int mvy_limit = IS_INTERLACED(mb_type) ? 2 : 4; + int first_vertical_edge_done = 0; + av_unused int dir; + + if (FRAME_MBAFF + // and current and left pair do not have the same interlaced type + && IS_INTERLACED(mb_type^h->left_type[0]) + // and left mb is in available to us + && h->left_type[0]) { + /* First vertical edge is different in MBAFF frames + * There are 8 different bS to compute and 2 different Qp + */ + DECLARE_ALIGNED(8, int16_t, bS)[8]; + int qp[2]; + int bqp[2]; + int rqp[2]; + int mb_qp, mbn0_qp, mbn1_qp; + int i; + first_vertical_edge_done = 1; + + if( IS_INTRA(mb_type) ) { + AV_WN64A(&bS[0], 0x0004000400040004ULL); + AV_WN64A(&bS[4], 0x0004000400040004ULL); + } else { + static const uint8_t offset[2][2][8]={ + { + {7+8*0, 7+8*0, 7+8*0, 7+8*0, 7+8*1, 7+8*1, 7+8*1, 7+8*1}, + {7+8*2, 7+8*2, 7+8*2, 7+8*2, 7+8*3, 7+8*3, 7+8*3, 7+8*3}, + },{ + {7+8*0, 7+8*1, 7+8*2, 7+8*3, 7+8*0, 7+8*1, 7+8*2, 7+8*3}, + {7+8*0, 7+8*1, 7+8*2, 7+8*3, 7+8*0, 7+8*1, 7+8*2, 7+8*3}, + } + }; + const uint8_t *off= offset[MB_FIELD][mb_y&1]; + for( i = 0; i < 8; i++ ) { + int j= MB_FIELD ? i>>2 : i&1; + int mbn_xy = h->left_mb_xy[j]; + int mbn_type= h->left_type[j]; + + if( IS_INTRA( mbn_type ) ) + bS[i] = 4; + else{ + bS[i] = 1 + !!(h->non_zero_count_cache[12+8*(i>>1)] | + ((!h->pps.cabac && IS_8x8DCT(mbn_type)) ? + (h->cbp_table[mbn_xy] & ((MB_FIELD ? (i&2) : (mb_y&1)) ? 8 : 2)) + : + h->non_zero_count[mbn_xy][ off[i] ])); + } + } + } + + mb_qp = s->current_picture.qscale_table[mb_xy]; + mbn0_qp = s->current_picture.qscale_table[h->left_mb_xy[0]]; + mbn1_qp = s->current_picture.qscale_table[h->left_mb_xy[1]]; + qp[0] = ( mb_qp + mbn0_qp + 1 ) >> 1; + bqp[0] = ( get_chroma_qp( h, 0, mb_qp ) + + get_chroma_qp( h, 0, mbn0_qp ) + 1 ) >> 1; + rqp[0] = ( get_chroma_qp( h, 1, mb_qp ) + + get_chroma_qp( h, 1, mbn0_qp ) + 1 ) >> 1; + qp[1] = ( mb_qp + mbn1_qp + 1 ) >> 1; + bqp[1] = ( get_chroma_qp( h, 0, mb_qp ) + + get_chroma_qp( h, 0, mbn1_qp ) + 1 ) >> 1; + rqp[1] = ( get_chroma_qp( h, 1, mb_qp ) + + get_chroma_qp( h, 1, mbn1_qp ) + 1 ) >> 1; + + /* Filter edge */ + tprintf(s->avctx, "filter mb:%d/%d MBAFF, QPy:%d/%d, QPb:%d/%d QPr:%d/%d ls:%d uvls:%d", mb_x, mb_y, qp[0], qp[1], bqp[0], bqp[1], rqp[0], rqp[1], linesize, uvlinesize); + { int i; for (i = 0; i < 8; i++) tprintf(s->avctx, " bS[%d]:%d", i, bS[i]); tprintf(s->avctx, "\n"); } + if(MB_FIELD){ + filter_mb_mbaff_edgev ( h, img_y , linesize, bS , 1, qp [0] ); + filter_mb_mbaff_edgev ( h, img_y + 8* linesize, linesize, bS+4, 1, qp [1] ); + filter_mb_mbaff_edgecv( h, img_cb, uvlinesize, bS , 1, bqp[0] ); + filter_mb_mbaff_edgecv( h, img_cb + 4*uvlinesize, uvlinesize, bS+4, 1, bqp[1] ); + filter_mb_mbaff_edgecv( h, img_cr, uvlinesize, bS , 1, rqp[0] ); + filter_mb_mbaff_edgecv( h, img_cr + 4*uvlinesize, uvlinesize, bS+4, 1, rqp[1] ); + }else{ + filter_mb_mbaff_edgev ( h, img_y , 2* linesize, bS , 2, qp [0] ); + filter_mb_mbaff_edgev ( h, img_y + linesize, 2* linesize, bS+1, 2, qp [1] ); + filter_mb_mbaff_edgecv( h, img_cb, 2*uvlinesize, bS , 2, bqp[0] ); + filter_mb_mbaff_edgecv( h, img_cb + uvlinesize, 2*uvlinesize, bS+1, 2, bqp[1] ); + filter_mb_mbaff_edgecv( h, img_cr, 2*uvlinesize, bS , 2, rqp[0] ); + filter_mb_mbaff_edgecv( h, img_cr + uvlinesize, 2*uvlinesize, bS+1, 2, rqp[1] ); + } + } + +#if CONFIG_SMALL + for( dir = 0; dir < 2; dir++ ) + filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, dir ? 0 : first_vertical_edge_done, dir); +#else + filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, first_vertical_edge_done, 0); + filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, 0, 1); +#endif +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_mvpred.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_mvpred.h new file mode 100644 index 00000000..661ef6c3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_mvpred.h @@ -0,0 +1,236 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... motion vector predicion + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + * H.264 / AVC / MPEG4 part10 motion vector predicion. + * @author Michael Niedermayer + */ + +#ifndef AVCODEC_H264_MVPRED_H +#define AVCODEC_H264_MVPRED_H + +#include "internal.h" +#include "avcodec.h" +#include "h264.h" + +//#undef NDEBUG +#include + +static inline int fetch_diagonal_mv(H264Context *h, const int16_t **C, int i, int list, int part_width){ + const int topright_ref= h->ref_cache[list][ i - 8 + part_width ]; + MpegEncContext *s = &h->s; + + /* there is no consistent mapping of mvs to neighboring locations that will + * make mbaff happy, so we can't move all this logic to fill_caches */ + if(FRAME_MBAFF){ + +#define SET_DIAG_MV(MV_OP, REF_OP, XY, Y4)\ + const int xy = XY, y4 = Y4;\ + const int mb_type = mb_types[xy+(y4>>2)*s->mb_stride];\ + if(!USES_LIST(mb_type,list))\ + return LIST_NOT_USED;\ + mv = s->current_picture_ptr->motion_val[list][h->mb2b_xy[xy]+3 + y4*h->b_stride];\ + h->mv_cache[list][scan8[0]-2][0] = mv[0];\ + h->mv_cache[list][scan8[0]-2][1] = mv[1] MV_OP;\ + return s->current_picture_ptr->ref_index[list][4*xy+1 + (y4&~1)] REF_OP; + + if(topright_ref == PART_NOT_AVAILABLE + && i >= scan8[0]+8 && (i&7)==4 + && h->ref_cache[list][scan8[0]-1] != PART_NOT_AVAILABLE){ + const uint32_t *mb_types = s->current_picture_ptr->mb_type; + const int16_t *mv; + AV_ZERO32(h->mv_cache[list][scan8[0]-2]); + *C = h->mv_cache[list][scan8[0]-2]; + + if(!MB_FIELD + && IS_INTERLACED(h->left_type[0])){ + SET_DIAG_MV(*2, >>1, h->left_mb_xy[0]+s->mb_stride, (s->mb_y&1)*2+(i>>5)); + assert(h->left_mb_xy[0] == h->left_mb_xy[1]); + } + if(MB_FIELD + && !IS_INTERLACED(h->left_type[0])){ + // left shift will turn LIST_NOT_USED into PART_NOT_AVAILABLE, but that's OK. + SET_DIAG_MV(/2, <<1, h->left_mb_xy[i>=36], ((i>>2))&3); + } + } +#undef SET_DIAG_MV + } + + if(topright_ref != PART_NOT_AVAILABLE){ + *C= h->mv_cache[list][ i - 8 + part_width ]; + return topright_ref; + }else{ + tprintf(s->avctx, "topright MV not available\n"); + + *C= h->mv_cache[list][ i - 8 - 1 ]; + return h->ref_cache[list][ i - 8 - 1 ]; + } +} + +/** + * gets the predicted MV. + * @param n the block index + * @param part_width the width of the partition (4, 8,16) -> (1, 2, 4) + * @param mx the x component of the predicted motion vector + * @param my the y component of the predicted motion vector + */ +static inline void pred_motion(H264Context * const h, int n, int part_width, int list, int ref, int * const mx, int * const my){ + const int index8= scan8[n]; + const int top_ref= h->ref_cache[list][ index8 - 8 ]; + const int left_ref= h->ref_cache[list][ index8 - 1 ]; + const int16_t * const A= h->mv_cache[list][ index8 - 1 ]; + const int16_t * const B= h->mv_cache[list][ index8 - 8 ]; + const int16_t * C; + int diagonal_ref, match_count; + + assert(part_width==1 || part_width==2 || part_width==4); + +/* mv_cache + B . . A T T T T + U . . L . . , . + U . . L . . . . + U . . L . . , . + . . . L . . . . +*/ + + diagonal_ref= fetch_diagonal_mv(h, &C, index8, list, part_width); + match_count= (diagonal_ref==ref) + (top_ref==ref) + (left_ref==ref); + tprintf(h->s.avctx, "pred_motion match_count=%d\n", match_count); + if(match_count > 1){ //most common + *mx= mid_pred(A[0], B[0], C[0]); + *my= mid_pred(A[1], B[1], C[1]); + }else if(match_count==1){ + if(left_ref==ref){ + *mx= A[0]; + *my= A[1]; + }else if(top_ref==ref){ + *mx= B[0]; + *my= B[1]; + }else{ + *mx= C[0]; + *my= C[1]; + } + }else{ + if(top_ref == PART_NOT_AVAILABLE && diagonal_ref == PART_NOT_AVAILABLE && left_ref != PART_NOT_AVAILABLE){ + *mx= A[0]; + *my= A[1]; + }else{ + *mx= mid_pred(A[0], B[0], C[0]); + *my= mid_pred(A[1], B[1], C[1]); + } + } + + tprintf(h->s.avctx, "pred_motion (%2d %2d %2d) (%2d %2d %2d) (%2d %2d %2d) -> (%2d %2d %2d) at %2d %2d %d list %d\n", top_ref, B[0], B[1], diagonal_ref, C[0], C[1], left_ref, A[0], A[1], ref, *mx, *my, h->s.mb_x, h->s.mb_y, n, list); +} + +/** + * gets the directionally predicted 16x8 MV. + * @param n the block index + * @param mx the x component of the predicted motion vector + * @param my the y component of the predicted motion vector + */ +static inline void pred_16x8_motion(H264Context * const h, int n, int list, int ref, int * const mx, int * const my){ + if(n==0){ + const int top_ref= h->ref_cache[list][ scan8[0] - 8 ]; + const int16_t * const B= h->mv_cache[list][ scan8[0] - 8 ]; + + tprintf(h->s.avctx, "pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n", top_ref, B[0], B[1], h->s.mb_x, h->s.mb_y, n, list); + + if(top_ref == ref){ + *mx= B[0]; + *my= B[1]; + return; + } + }else{ + const int left_ref= h->ref_cache[list][ scan8[8] - 1 ]; + const int16_t * const A= h->mv_cache[list][ scan8[8] - 1 ]; + + tprintf(h->s.avctx, "pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n", left_ref, A[0], A[1], h->s.mb_x, h->s.mb_y, n, list); + + if(left_ref == ref){ + *mx= A[0]; + *my= A[1]; + return; + } + } + + //RARE + pred_motion(h, n, 4, list, ref, mx, my); +} + +/** + * gets the directionally predicted 8x16 MV. + * @param n the block index + * @param mx the x component of the predicted motion vector + * @param my the y component of the predicted motion vector + */ +static inline void pred_8x16_motion(H264Context * const h, int n, int list, int ref, int * const mx, int * const my){ + if(n==0){ + const int left_ref= h->ref_cache[list][ scan8[0] - 1 ]; + const int16_t * const A= h->mv_cache[list][ scan8[0] - 1 ]; + + tprintf(h->s.avctx, "pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n", left_ref, A[0], A[1], h->s.mb_x, h->s.mb_y, n, list); + + if(left_ref == ref){ + *mx= A[0]; + *my= A[1]; + return; + } + }else{ + const int16_t * C; + int diagonal_ref; + + diagonal_ref= fetch_diagonal_mv(h, &C, scan8[4], list, 2); + + tprintf(h->s.avctx, "pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n", diagonal_ref, C[0], C[1], h->s.mb_x, h->s.mb_y, n, list); + + if(diagonal_ref == ref){ + *mx= C[0]; + *my= C[1]; + return; + } + } + + //RARE + pred_motion(h, n, 2, list, ref, mx, my); +} + +static inline void pred_pskip_motion(H264Context * const h, int * const mx, int * const my){ + const int top_ref = h->ref_cache[0][ scan8[0] - 8 ]; + const int left_ref= h->ref_cache[0][ scan8[0] - 1 ]; + + tprintf(h->s.avctx, "pred_pskip: (%d) (%d) at %2d %2d\n", top_ref, left_ref, h->s.mb_x, h->s.mb_y); + + if(top_ref == PART_NOT_AVAILABLE || left_ref == PART_NOT_AVAILABLE + || !( top_ref | AV_RN32A(h->mv_cache[0][ scan8[0] - 8 ])) + || !(left_ref | AV_RN32A(h->mv_cache[0][ scan8[0] - 1 ]))){ + + *mx = *my = 0; + return; + } + + pred_motion(h, 0, 4, 0, 0, mx, my); + + return; +} + +#endif /* AVCODEC_H264_MVPRED_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_ps.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_ps.c new file mode 100644 index 00000000..3fe5815e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_ps.c @@ -0,0 +1,543 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... parameter set decoding + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + * H.264 / AVC / MPEG4 part10 parameter set decoding. + * @author Michael Niedermayer + */ + +#include "libavcore/imgutils.h" +#include "internal.h" +#include "dsputil.h" +#include "avcodec.h" +#include "h264.h" +#include "h264data.h" //FIXME FIXME FIXME (just for zigzag_scan) +#include "golomb.h" + + +//#undef NDEBUG +#include + +static const AVRational pixel_aspect[17]={ + {0, 1}, + {1, 1}, + {12, 11}, + {10, 11}, + {16, 11}, + {40, 33}, + {24, 11}, + {20, 11}, + {32, 11}, + {80, 33}, + {18, 11}, + {15, 11}, + {64, 33}, + {160,99}, + {4, 3}, + {3, 2}, + {2, 1}, +}; + +const uint8_t ff_h264_chroma_qp[52]={ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11, + 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27, + 28,29,29,30,31,32,32,33,34,34,35,35,36,36,37,37, + 37,38,38,38,39,39,39,39 +}; + +static const uint8_t default_scaling4[2][16]={ +{ 6,13,20,28, + 13,20,28,32, + 20,28,32,37, + 28,32,37,42 +},{ + 10,14,20,24, + 14,20,24,27, + 20,24,27,30, + 24,27,30,34 +}}; + +static const uint8_t default_scaling8[2][64]={ +{ 6,10,13,16,18,23,25,27, + 10,11,16,18,23,25,27,29, + 13,16,18,23,25,27,29,31, + 16,18,23,25,27,29,31,33, + 18,23,25,27,29,31,33,36, + 23,25,27,29,31,33,36,38, + 25,27,29,31,33,36,38,40, + 27,29,31,33,36,38,40,42 +},{ + 9,13,15,17,19,21,22,24, + 13,13,17,19,21,22,24,25, + 15,17,19,21,22,24,25,27, + 17,19,21,22,24,25,27,28, + 19,21,22,24,25,27,28,30, + 21,22,24,25,27,28,30,32, + 22,24,25,27,28,30,32,33, + 24,25,27,28,30,32,33,35 +}}; + +static inline int decode_hrd_parameters(H264Context *h, SPS *sps){ + MpegEncContext * const s = &h->s; + int cpb_count, i; + cpb_count = get_ue_golomb_31(&s->gb) + 1; + + if(cpb_count > 32U){ + av_log(h->s.avctx, AV_LOG_ERROR, "cpb_count %d invalid\n", cpb_count); + return -1; + } + + get_bits(&s->gb, 4); /* bit_rate_scale */ + get_bits(&s->gb, 4); /* cpb_size_scale */ + for(i=0; igb); /* bit_rate_value_minus1 */ + get_ue_golomb(&s->gb); /* cpb_size_value_minus1 */ + get_bits1(&s->gb); /* cbr_flag */ + } + sps->initial_cpb_removal_delay_length = get_bits(&s->gb, 5) + 1; + sps->cpb_removal_delay_length = get_bits(&s->gb, 5) + 1; + sps->dpb_output_delay_length = get_bits(&s->gb, 5) + 1; + sps->time_offset_length = get_bits(&s->gb, 5); + sps->cpb_cnt = cpb_count; + return 0; +} + +static inline int decode_vui_parameters(H264Context *h, SPS *sps){ + MpegEncContext * const s = &h->s; + int aspect_ratio_info_present_flag; + unsigned int aspect_ratio_idc; + + aspect_ratio_info_present_flag= get_bits1(&s->gb); + + if( aspect_ratio_info_present_flag ) { + aspect_ratio_idc= get_bits(&s->gb, 8); + if( aspect_ratio_idc == EXTENDED_SAR ) { + sps->sar.num= get_bits(&s->gb, 16); + sps->sar.den= get_bits(&s->gb, 16); + }else if(aspect_ratio_idc < FF_ARRAY_ELEMS(pixel_aspect)){ + sps->sar= pixel_aspect[aspect_ratio_idc]; + }else{ + av_log(h->s.avctx, AV_LOG_ERROR, "illegal aspect ratio\n"); + return -1; + } + }else{ + sps->sar.num= + sps->sar.den= 0; + } +// s->avctx->aspect_ratio= sar_width*s->width / (float)(s->height*sar_height); + + if(get_bits1(&s->gb)){ /* overscan_info_present_flag */ + get_bits1(&s->gb); /* overscan_appropriate_flag */ + } + + sps->video_signal_type_present_flag = get_bits1(&s->gb); + if(sps->video_signal_type_present_flag){ + get_bits(&s->gb, 3); /* video_format */ + sps->full_range = get_bits1(&s->gb); /* video_full_range_flag */ + + sps->colour_description_present_flag = get_bits1(&s->gb); + if(sps->colour_description_present_flag){ + sps->color_primaries = get_bits(&s->gb, 8); /* colour_primaries */ + sps->color_trc = get_bits(&s->gb, 8); /* transfer_characteristics */ + sps->colorspace = get_bits(&s->gb, 8); /* matrix_coefficients */ + if (sps->color_primaries >= AVCOL_PRI_NB) + sps->color_primaries = AVCOL_PRI_UNSPECIFIED; + if (sps->color_trc >= AVCOL_TRC_NB) + sps->color_trc = AVCOL_TRC_UNSPECIFIED; + if (sps->colorspace >= AVCOL_SPC_NB) + sps->colorspace = AVCOL_SPC_UNSPECIFIED; + } + } + + if(get_bits1(&s->gb)){ /* chroma_location_info_present_flag */ + s->avctx->chroma_sample_location = get_ue_golomb(&s->gb)+1; /* chroma_sample_location_type_top_field */ + get_ue_golomb(&s->gb); /* chroma_sample_location_type_bottom_field */ + } + + sps->timing_info_present_flag = get_bits1(&s->gb); + if(sps->timing_info_present_flag){ + sps->num_units_in_tick = get_bits_long(&s->gb, 32); + sps->time_scale = get_bits_long(&s->gb, 32); + if(!sps->num_units_in_tick || !sps->time_scale){ + av_log(h->s.avctx, AV_LOG_ERROR, "time_scale/num_units_in_tick invalid or unsupported (%d/%d)\n", sps->time_scale, sps->num_units_in_tick); + return -1; + } + sps->fixed_frame_rate_flag = get_bits1(&s->gb); + } + + sps->nal_hrd_parameters_present_flag = get_bits1(&s->gb); + if(sps->nal_hrd_parameters_present_flag) + if(decode_hrd_parameters(h, sps) < 0) + return -1; + sps->vcl_hrd_parameters_present_flag = get_bits1(&s->gb); + if(sps->vcl_hrd_parameters_present_flag) + if(decode_hrd_parameters(h, sps) < 0) + return -1; + if(sps->nal_hrd_parameters_present_flag || sps->vcl_hrd_parameters_present_flag) + get_bits1(&s->gb); /* low_delay_hrd_flag */ + sps->pic_struct_present_flag = get_bits1(&s->gb); + + sps->bitstream_restriction_flag = get_bits1(&s->gb); + if(sps->bitstream_restriction_flag){ + get_bits1(&s->gb); /* motion_vectors_over_pic_boundaries_flag */ + get_ue_golomb(&s->gb); /* max_bytes_per_pic_denom */ + get_ue_golomb(&s->gb); /* max_bits_per_mb_denom */ + get_ue_golomb(&s->gb); /* log2_max_mv_length_horizontal */ + get_ue_golomb(&s->gb); /* log2_max_mv_length_vertical */ + sps->num_reorder_frames= get_ue_golomb(&s->gb); + get_ue_golomb(&s->gb); /*max_dec_frame_buffering*/ + + if(s->gb.size_in_bits < get_bits_count(&s->gb)){ + av_log(h->s.avctx, AV_LOG_ERROR, "Overread VUI by %d bits\n", get_bits_count(&s->gb) - s->gb.size_in_bits); + sps->num_reorder_frames=0; + sps->bitstream_restriction_flag= 0; + } + + if(sps->num_reorder_frames > 16U /*max_dec_frame_buffering || max_dec_frame_buffering > 16*/){ + av_log(h->s.avctx, AV_LOG_ERROR, "illegal num_reorder_frames %d\n", sps->num_reorder_frames); + return -1; + } + } + + return 0; +} + +static void decode_scaling_list(H264Context *h, uint8_t *factors, int size, + const uint8_t *jvt_list, const uint8_t *fallback_list){ + MpegEncContext * const s = &h->s; + int i, last = 8, next = 8; + const uint8_t *scan = size == 16 ? zigzag_scan : ff_zigzag_direct; + if(!get_bits1(&s->gb)) /* matrix not written, we use the predicted one */ + memcpy(factors, fallback_list, size*sizeof(uint8_t)); + else + for(i=0;igb)) & 0xff; + if(!i && !next){ /* matrix not written, we use the preset one */ + memcpy(factors, jvt_list, size*sizeof(uint8_t)); + break; + } + last = factors[scan[i]] = next ? next : last; + } +} + +static void decode_scaling_matrices(H264Context *h, SPS *sps, PPS *pps, int is_sps, + uint8_t (*scaling_matrix4)[16], uint8_t (*scaling_matrix8)[64]){ + MpegEncContext * const s = &h->s; + int fallback_sps = !is_sps && sps->scaling_matrix_present; + const uint8_t *fallback[4] = { + fallback_sps ? sps->scaling_matrix4[0] : default_scaling4[0], + fallback_sps ? sps->scaling_matrix4[3] : default_scaling4[1], + fallback_sps ? sps->scaling_matrix8[0] : default_scaling8[0], + fallback_sps ? sps->scaling_matrix8[1] : default_scaling8[1] + }; + if(get_bits1(&s->gb)){ + sps->scaling_matrix_present |= is_sps; + decode_scaling_list(h,scaling_matrix4[0],16,default_scaling4[0],fallback[0]); // Intra, Y + decode_scaling_list(h,scaling_matrix4[1],16,default_scaling4[0],scaling_matrix4[0]); // Intra, Cr + decode_scaling_list(h,scaling_matrix4[2],16,default_scaling4[0],scaling_matrix4[1]); // Intra, Cb + decode_scaling_list(h,scaling_matrix4[3],16,default_scaling4[1],fallback[1]); // Inter, Y + decode_scaling_list(h,scaling_matrix4[4],16,default_scaling4[1],scaling_matrix4[3]); // Inter, Cr + decode_scaling_list(h,scaling_matrix4[5],16,default_scaling4[1],scaling_matrix4[4]); // Inter, Cb + if(is_sps || pps->transform_8x8_mode){ + decode_scaling_list(h,scaling_matrix8[0],64,default_scaling8[0],fallback[2]); // Intra, Y + decode_scaling_list(h,scaling_matrix8[1],64,default_scaling8[1],fallback[3]); // Inter, Y + } + } +} + +int ff_h264_decode_seq_parameter_set(H264Context *h){ + MpegEncContext * const s = &h->s; + int profile_idc, level_idc, constraint_set_flags = 0; + unsigned int sps_id; + int i; + SPS *sps; + + profile_idc= get_bits(&s->gb, 8); + constraint_set_flags |= get_bits1(&s->gb) << 0; //constraint_set0_flag + constraint_set_flags |= get_bits1(&s->gb) << 1; //constraint_set1_flag + constraint_set_flags |= get_bits1(&s->gb) << 2; //constraint_set2_flag + constraint_set_flags |= get_bits1(&s->gb) << 3; //constraint_set3_flag + get_bits(&s->gb, 4); // reserved + level_idc= get_bits(&s->gb, 8); + sps_id= get_ue_golomb_31(&s->gb); + + if(sps_id >= MAX_SPS_COUNT) { + av_log(h->s.avctx, AV_LOG_ERROR, "sps_id (%d) out of range\n", sps_id); + return -1; + } + sps= av_mallocz(sizeof(SPS)); + if(sps == NULL) + return -1; + + sps->time_offset_length = 24; + sps->profile_idc= profile_idc; + sps->constraint_set_flags = constraint_set_flags; + sps->level_idc= level_idc; + + memset(sps->scaling_matrix4, 16, sizeof(sps->scaling_matrix4)); + memset(sps->scaling_matrix8, 16, sizeof(sps->scaling_matrix8)); + sps->scaling_matrix_present = 0; + + if(sps->profile_idc >= 100){ //high profile + sps->chroma_format_idc= get_ue_golomb_31(&s->gb); + if(sps->chroma_format_idc == 3) + sps->residual_color_transform_flag = get_bits1(&s->gb); + sps->bit_depth_luma = get_ue_golomb(&s->gb) + 8; + sps->bit_depth_chroma = get_ue_golomb(&s->gb) + 8; + sps->transform_bypass = get_bits1(&s->gb); + decode_scaling_matrices(h, sps, NULL, 1, sps->scaling_matrix4, sps->scaling_matrix8); + }else{ + sps->chroma_format_idc= 1; + sps->bit_depth_luma = 8; + sps->bit_depth_chroma = 8; + } + + sps->log2_max_frame_num= get_ue_golomb(&s->gb) + 4; + sps->poc_type= get_ue_golomb_31(&s->gb); + + if(sps->poc_type == 0){ //FIXME #define + sps->log2_max_poc_lsb= get_ue_golomb(&s->gb) + 4; + } else if(sps->poc_type == 1){//FIXME #define + sps->delta_pic_order_always_zero_flag= get_bits1(&s->gb); + sps->offset_for_non_ref_pic= get_se_golomb(&s->gb); + sps->offset_for_top_to_bottom_field= get_se_golomb(&s->gb); + sps->poc_cycle_length = get_ue_golomb(&s->gb); + + if((unsigned)sps->poc_cycle_length >= FF_ARRAY_ELEMS(sps->offset_for_ref_frame)){ + av_log(h->s.avctx, AV_LOG_ERROR, "poc_cycle_length overflow %u\n", sps->poc_cycle_length); + goto fail; + } + + for(i=0; ipoc_cycle_length; i++) + sps->offset_for_ref_frame[i]= get_se_golomb(&s->gb); + }else if(sps->poc_type != 2){ + av_log(h->s.avctx, AV_LOG_ERROR, "illegal POC type %d\n", sps->poc_type); + goto fail; + } + + sps->ref_frame_count= get_ue_golomb_31(&s->gb); + if(sps->ref_frame_count > MAX_PICTURE_COUNT-2 || sps->ref_frame_count >= 32U){ + av_log(h->s.avctx, AV_LOG_ERROR, "too many reference frames\n"); + goto fail; + } + sps->gaps_in_frame_num_allowed_flag= get_bits1(&s->gb); + sps->mb_width = get_ue_golomb(&s->gb) + 1; + sps->mb_height= get_ue_golomb(&s->gb) + 1; + if((unsigned)sps->mb_width >= INT_MAX/16 || (unsigned)sps->mb_height >= INT_MAX/16 || + av_image_check_size(16*sps->mb_width, 16*sps->mb_height, 0, h->s.avctx)){ + av_log(h->s.avctx, AV_LOG_ERROR, "mb_width/height overflow\n"); + goto fail; + } + + sps->frame_mbs_only_flag= get_bits1(&s->gb); + if(!sps->frame_mbs_only_flag) + sps->mb_aff= get_bits1(&s->gb); + else + sps->mb_aff= 0; + + sps->direct_8x8_inference_flag= get_bits1(&s->gb); + if(!sps->frame_mbs_only_flag && !sps->direct_8x8_inference_flag){ + av_log(h->s.avctx, AV_LOG_ERROR, "This stream was generated by a broken encoder, invalid 8x8 inference\n"); + goto fail; + } + +#ifndef ALLOW_INTERLACE + if(sps->mb_aff) + av_log(h->s.avctx, AV_LOG_ERROR, "MBAFF support not included; enable it at compile-time.\n"); +#endif + sps->crop= get_bits1(&s->gb); + if(sps->crop){ + sps->crop_left = get_ue_golomb(&s->gb); + sps->crop_right = get_ue_golomb(&s->gb); + sps->crop_top = get_ue_golomb(&s->gb); + sps->crop_bottom= get_ue_golomb(&s->gb); + if(sps->crop_left || sps->crop_top){ + av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ...\n"); + } + if(sps->crop_right >= 8 || sps->crop_bottom >= 8){ + av_log(h->s.avctx, AV_LOG_ERROR, "brainfart cropping not supported, this could look slightly wrong ...\n"); + } + }else{ + sps->crop_left = + sps->crop_right = + sps->crop_top = + sps->crop_bottom= 0; + } + + sps->vui_parameters_present_flag= get_bits1(&s->gb); + if( sps->vui_parameters_present_flag ) + if (decode_vui_parameters(h, sps) < 0) + goto fail; + + if(!sps->sar.den) + sps->sar.den= 1; + + if(s->avctx->debug&FF_DEBUG_PICT_INFO){ + av_log(h->s.avctx, AV_LOG_DEBUG, "sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%d/%d/%d/%d %s %s %d/%d\n", + sps_id, sps->profile_idc, sps->level_idc, + sps->poc_type, + sps->ref_frame_count, + sps->mb_width, sps->mb_height, + sps->frame_mbs_only_flag ? "FRM" : (sps->mb_aff ? "MB-AFF" : "PIC-AFF"), + sps->direct_8x8_inference_flag ? "8B8" : "", + sps->crop_left, sps->crop_right, + sps->crop_top, sps->crop_bottom, + sps->vui_parameters_present_flag ? "VUI" : "", + ((const char*[]){"Gray","420","422","444"})[sps->chroma_format_idc], + sps->timing_info_present_flag ? sps->num_units_in_tick : 0, + sps->timing_info_present_flag ? sps->time_scale : 0 + ); + } + + av_free(h->sps_buffers[sps_id]); + h->sps_buffers[sps_id]= sps; + h->sps = *sps; + return 0; +fail: + av_free(sps); + return -1; +} + +static void +build_qp_table(PPS *pps, int t, int index) +{ + int i; + for(i = 0; i < 52; i++) + pps->chroma_qp_table[t][i] = ff_h264_chroma_qp[av_clip(i + index, 0, 51)]; +} + +int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length){ + MpegEncContext * const s = &h->s; + unsigned int pps_id= get_ue_golomb(&s->gb); + PPS *pps; + + if(pps_id >= MAX_PPS_COUNT) { + av_log(h->s.avctx, AV_LOG_ERROR, "pps_id (%d) out of range\n", pps_id); + return -1; + } + + pps= av_mallocz(sizeof(PPS)); + if(pps == NULL) + return -1; + pps->sps_id= get_ue_golomb_31(&s->gb); + if((unsigned)pps->sps_id>=MAX_SPS_COUNT || h->sps_buffers[pps->sps_id] == NULL){ + av_log(h->s.avctx, AV_LOG_ERROR, "sps_id out of range\n"); + goto fail; + } + + pps->cabac= get_bits1(&s->gb); + pps->pic_order_present= get_bits1(&s->gb); + pps->slice_group_count= get_ue_golomb(&s->gb) + 1; + if(pps->slice_group_count > 1 ){ + pps->mb_slice_group_map_type= get_ue_golomb(&s->gb); + av_log(h->s.avctx, AV_LOG_ERROR, "FMO not supported\n"); + switch(pps->mb_slice_group_map_type){ + case 0: +#if 0 +| for( i = 0; i <= num_slice_groups_minus1; i++ ) | | | +| run_length[ i ] |1 |ue(v) | +#endif + break; + case 2: +#if 0 +| for( i = 0; i < num_slice_groups_minus1; i++ ) | | | +|{ | | | +| top_left_mb[ i ] |1 |ue(v) | +| bottom_right_mb[ i ] |1 |ue(v) | +| } | | | +#endif + break; + case 3: + case 4: + case 5: +#if 0 +| slice_group_change_direction_flag |1 |u(1) | +| slice_group_change_rate_minus1 |1 |ue(v) | +#endif + break; + case 6: +#if 0 +| slice_group_id_cnt_minus1 |1 |ue(v) | +| for( i = 0; i <= slice_group_id_cnt_minus1; i++ | | | +|) | | | +| slice_group_id[ i ] |1 |u(v) | +#endif + break; + } + } + pps->ref_count[0]= get_ue_golomb(&s->gb) + 1; + pps->ref_count[1]= get_ue_golomb(&s->gb) + 1; + if(pps->ref_count[0]-1 > 32-1 || pps->ref_count[1]-1 > 32-1){ + av_log(h->s.avctx, AV_LOG_ERROR, "reference overflow (pps)\n"); + goto fail; + } + + pps->weighted_pred= get_bits1(&s->gb); + pps->weighted_bipred_idc= get_bits(&s->gb, 2); + pps->init_qp= get_se_golomb(&s->gb) + 26; + pps->init_qs= get_se_golomb(&s->gb) + 26; + pps->chroma_qp_index_offset[0]= get_se_golomb(&s->gb); + pps->deblocking_filter_parameters_present= get_bits1(&s->gb); + pps->constrained_intra_pred= get_bits1(&s->gb); + pps->redundant_pic_cnt_present = get_bits1(&s->gb); + + pps->transform_8x8_mode= 0; + h->dequant_coeff_pps= -1; //contents of sps/pps can change even if id doesn't, so reinit + memcpy(pps->scaling_matrix4, h->sps_buffers[pps->sps_id]->scaling_matrix4, sizeof(pps->scaling_matrix4)); + memcpy(pps->scaling_matrix8, h->sps_buffers[pps->sps_id]->scaling_matrix8, sizeof(pps->scaling_matrix8)); + + if(get_bits_count(&s->gb) < bit_length){ + pps->transform_8x8_mode= get_bits1(&s->gb); + decode_scaling_matrices(h, h->sps_buffers[pps->sps_id], pps, 0, pps->scaling_matrix4, pps->scaling_matrix8); + pps->chroma_qp_index_offset[1]= get_se_golomb(&s->gb); //second_chroma_qp_index_offset + } else { + pps->chroma_qp_index_offset[1]= pps->chroma_qp_index_offset[0]; + } + + build_qp_table(pps, 0, pps->chroma_qp_index_offset[0]); + build_qp_table(pps, 1, pps->chroma_qp_index_offset[1]); + if(pps->chroma_qp_index_offset[0] != pps->chroma_qp_index_offset[1]) + pps->chroma_qp_diff= 1; + + if(s->avctx->debug&FF_DEBUG_PICT_INFO){ + av_log(h->s.avctx, AV_LOG_DEBUG, "pps:%u sps:%u %s slice_groups:%d ref:%d/%d %s qp:%d/%d/%d/%d %s %s %s %s\n", + pps_id, pps->sps_id, + pps->cabac ? "CABAC" : "CAVLC", + pps->slice_group_count, + pps->ref_count[0], pps->ref_count[1], + pps->weighted_pred ? "weighted" : "", + pps->init_qp, pps->init_qs, pps->chroma_qp_index_offset[0], pps->chroma_qp_index_offset[1], + pps->deblocking_filter_parameters_present ? "LPAR" : "", + pps->constrained_intra_pred ? "CONSTR" : "", + pps->redundant_pic_cnt_present ? "REDU" : "", + pps->transform_8x8_mode ? "8x8DCT" : "" + ); + } + + av_free(h->pps_buffers[pps_id]); + h->pps_buffers[pps_id]= pps; + return 0; +fail: + av_free(pps); + return -1; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_refs.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_refs.c new file mode 100644 index 00000000..74eaaa8a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_refs.c @@ -0,0 +1,700 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... reference picture handling + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + * H.264 / AVC / MPEG4 part10 reference picture handling. + * @author Michael Niedermayer + */ + +#include "internal.h" +#include "dsputil.h" +#include "avcodec.h" +#include "h264.h" +#include "golomb.h" + +//#undef NDEBUG +#include + + +static void pic_as_field(Picture *pic, const int parity){ + int i; + for (i = 0; i < 4; ++i) { + if (parity == PICT_BOTTOM_FIELD) + pic->data[i] += pic->linesize[i]; + pic->reference = parity; + pic->linesize[i] *= 2; + } + pic->poc= pic->field_poc[parity == PICT_BOTTOM_FIELD]; +} + +static int split_field_copy(Picture *dest, Picture *src, + int parity, int id_add){ + int match = !!(src->reference & parity); + + if (match) { + *dest = *src; + if(parity != PICT_FRAME){ + pic_as_field(dest, parity); + dest->pic_id *= 2; + dest->pic_id += id_add; + } + } + + return match; +} + +static int build_def_list(Picture *def, Picture **in, int len, int is_long, int sel){ + int i[2]={0}; + int index=0; + + while(i[0]reference & sel))) + i[0]++; + while(i[1]reference & (sel^3)))) + i[1]++; + if(i[0] < len){ + in[ i[0] ]->pic_id= is_long ? i[0] : in[ i[0] ]->frame_num; + split_field_copy(&def[index++], in[ i[0]++ ], sel , 1); + } + if(i[1] < len){ + in[ i[1] ]->pic_id= is_long ? i[1] : in[ i[1] ]->frame_num; + split_field_copy(&def[index++], in[ i[1]++ ], sel^3, 0); + } + } + + return index; +} + +static int add_sorted(Picture **sorted, Picture **src, int len, int limit, int dir){ + int i, best_poc; + int out_i= 0; + + for(;;){ + best_poc= dir ? INT_MIN : INT_MAX; + + for(i=0; ipoc; + if(((poc > limit) ^ dir) && ((poc < best_poc) ^ dir)){ + best_poc= poc; + sorted[out_i]= src[i]; + } + } + if(best_poc == (dir ? INT_MIN : INT_MAX)) + break; + limit= sorted[out_i++]->poc - dir; + } + return out_i; +} + +int ff_h264_fill_default_ref_list(H264Context *h){ + MpegEncContext * const s = &h->s; + int i, len; + + if(h->slice_type_nos==FF_B_TYPE){ + Picture *sorted[32]; + int cur_poc, list; + int lens[2]; + + if(FIELD_PICTURE) + cur_poc= s->current_picture_ptr->field_poc[ s->picture_structure == PICT_BOTTOM_FIELD ]; + else + cur_poc= s->current_picture_ptr->poc; + + for(list= 0; list<2; list++){ + len= add_sorted(sorted , h->short_ref, h->short_ref_count, cur_poc, 1^list); + len+=add_sorted(sorted+len, h->short_ref, h->short_ref_count, cur_poc, 0^list); + assert(len<=32); + len= build_def_list(h->default_ref_list[list] , sorted , len, 0, s->picture_structure); + len+=build_def_list(h->default_ref_list[list]+len, h->long_ref, 16 , 1, s->picture_structure); + assert(len<=32); + + if(len < h->ref_count[list]) + memset(&h->default_ref_list[list][len], 0, sizeof(Picture)*(h->ref_count[list] - len)); + lens[list]= len; + } + + if(lens[0] == lens[1] && lens[1] > 1){ + for(i=0; h->default_ref_list[0][i].data[0] == h->default_ref_list[1][i].data[0] && idefault_ref_list[1][0], h->default_ref_list[1][1]); + } + }else{ + len = build_def_list(h->default_ref_list[0] , h->short_ref, h->short_ref_count, 0, s->picture_structure); + len+= build_def_list(h->default_ref_list[0]+len, h-> long_ref, 16 , 1, s->picture_structure); + assert(len <= 32); + if(len < h->ref_count[0]) + memset(&h->default_ref_list[0][len], 0, sizeof(Picture)*(h->ref_count[0] - len)); + } +#ifdef TRACE + for (i=0; iref_count[0]; i++) { + tprintf(h->s.avctx, "List0: %s fn:%d 0x%p\n", (h->default_ref_list[0][i].long_ref ? "LT" : "ST"), h->default_ref_list[0][i].pic_id, h->default_ref_list[0][i].data[0]); + } + if(h->slice_type_nos==FF_B_TYPE){ + for (i=0; iref_count[1]; i++) { + tprintf(h->s.avctx, "List1: %s fn:%d 0x%p\n", (h->default_ref_list[1][i].long_ref ? "LT" : "ST"), h->default_ref_list[1][i].pic_id, h->default_ref_list[1][i].data[0]); + } + } +#endif + return 0; +} + +static void print_short_term(H264Context *h); +static void print_long_term(H264Context *h); + +/** + * Extract structure information about the picture described by pic_num in + * the current decoding context (frame or field). Note that pic_num is + * picture number without wrapping (so, 0<=pic_nums; + + *structure = s->picture_structure; + if(FIELD_PICTURE){ + if (!(pic_num & 1)) + /* opposite field */ + *structure ^= PICT_FRAME; + pic_num >>= 1; + } + + return pic_num; +} + +int ff_h264_decode_ref_pic_list_reordering(H264Context *h){ + MpegEncContext * const s = &h->s; + int list, index, pic_structure; + + print_short_term(h); + print_long_term(h); + + for(list=0; listlist_count; list++){ + memcpy(h->ref_list[list], h->default_ref_list[list], sizeof(Picture)*h->ref_count[list]); + + if(get_bits1(&s->gb)){ + int pred= h->curr_pic_num; + + for(index=0; ; index++){ + unsigned int reordering_of_pic_nums_idc= get_ue_golomb_31(&s->gb); + unsigned int pic_id; + int i; + Picture *ref = NULL; + + if(reordering_of_pic_nums_idc==3) + break; + + if(index >= h->ref_count[list]){ + av_log(h->s.avctx, AV_LOG_ERROR, "reference count overflow\n"); + return -1; + } + + if(reordering_of_pic_nums_idc<3){ + if(reordering_of_pic_nums_idc<2){ + const unsigned int abs_diff_pic_num= get_ue_golomb(&s->gb) + 1; + int frame_num; + + if(abs_diff_pic_num > h->max_pic_num){ + av_log(h->s.avctx, AV_LOG_ERROR, "abs_diff_pic_num overflow\n"); + return -1; + } + + if(reordering_of_pic_nums_idc == 0) pred-= abs_diff_pic_num; + else pred+= abs_diff_pic_num; + pred &= h->max_pic_num - 1; + + frame_num = pic_num_extract(h, pred, &pic_structure); + + for(i= h->short_ref_count-1; i>=0; i--){ + ref = h->short_ref[i]; + assert(ref->reference); + assert(!ref->long_ref); + if( + ref->frame_num == frame_num && + (ref->reference & pic_structure) + ) + break; + } + if(i>=0) + ref->pic_id= pred; + }else{ + int long_idx; + pic_id= get_ue_golomb(&s->gb); //long_term_pic_idx + + long_idx= pic_num_extract(h, pic_id, &pic_structure); + + if(long_idx>31){ + av_log(h->s.avctx, AV_LOG_ERROR, "long_term_pic_idx overflow\n"); + return -1; + } + ref = h->long_ref[long_idx]; + assert(!(ref && !ref->reference)); + if(ref && (ref->reference & pic_structure)){ + ref->pic_id= pic_id; + assert(ref->long_ref); + i=0; + }else{ + i=-1; + } + } + + if (i < 0) { + av_log(h->s.avctx, AV_LOG_ERROR, "reference picture missing during reorder\n"); + memset(&h->ref_list[list][index], 0, sizeof(Picture)); //FIXME + } else { + for(i=index; i+1ref_count[list]; i++){ + if(ref->long_ref == h->ref_list[list][i].long_ref && ref->pic_id == h->ref_list[list][i].pic_id) + break; + } + for(; i > index; i--){ + h->ref_list[list][i]= h->ref_list[list][i-1]; + } + h->ref_list[list][index]= *ref; + if (FIELD_PICTURE){ + pic_as_field(&h->ref_list[list][index], pic_structure); + } + } + }else{ + av_log(h->s.avctx, AV_LOG_ERROR, "illegal reordering_of_pic_nums_idc\n"); + return -1; + } + } + } + } + for(list=0; listlist_count; list++){ + for(index= 0; index < h->ref_count[list]; index++){ + if(!h->ref_list[list][index].data[0]){ + av_log(h->s.avctx, AV_LOG_ERROR, "Missing reference picture\n"); + if(h->default_ref_list[list][0].data[0]) + h->ref_list[list][index]= h->default_ref_list[list][0]; + else + return -1; + } + } + } + + return 0; +} + +void ff_h264_fill_mbaff_ref_list(H264Context *h){ + int list, i, j; + for(list=0; list<2; list++){ //FIXME try list_count + for(i=0; iref_count[list]; i++){ + Picture *frame = &h->ref_list[list][i]; + Picture *field = &h->ref_list[list][16+2*i]; + field[0] = *frame; + for(j=0; j<3; j++) + field[0].linesize[j] <<= 1; + field[0].reference = PICT_TOP_FIELD; + field[0].poc= field[0].field_poc[0]; + field[1] = field[0]; + for(j=0; j<3; j++) + field[1].data[j] += frame->linesize[j]; + field[1].reference = PICT_BOTTOM_FIELD; + field[1].poc= field[1].field_poc[1]; + + h->luma_weight[16+2*i][list][0] = h->luma_weight[16+2*i+1][list][0] = h->luma_weight[i][list][0]; + h->luma_weight[16+2*i][list][1] = h->luma_weight[16+2*i+1][list][1] = h->luma_weight[i][list][1]; + for(j=0; j<2; j++){ + h->chroma_weight[16+2*i][list][j][0] = h->chroma_weight[16+2*i+1][list][j][0] = h->chroma_weight[i][list][j][0]; + h->chroma_weight[16+2*i][list][j][1] = h->chroma_weight[16+2*i+1][list][j][1] = h->chroma_weight[i][list][j][1]; + } + } + } +} + +/** + * Mark a picture as no longer needed for reference. The refmask + * argument allows unreferencing of individual fields or the whole frame. + * If the picture becomes entirely unreferenced, but is being held for + * display purposes, it is marked as such. + * @param refmask mask of fields to unreference; the mask is bitwise + * anded with the reference marking of pic + * @return non-zero if pic becomes entirely unreferenced (except possibly + * for display purposes) zero if one of the fields remains in + * reference + */ +static inline int unreference_pic(H264Context *h, Picture *pic, int refmask){ + int i; + if (pic->reference &= refmask) { + return 0; + } else { + for(i = 0; h->delayed_pic[i]; i++) + if(pic == h->delayed_pic[i]){ + pic->reference=DELAYED_PIC_REF; + break; + } + return 1; + } +} + +/** + * Find a Picture in the short term reference list by frame number. + * @param frame_num frame number to search for + * @param idx the index into h->short_ref where returned picture is found + * undefined if no picture found. + * @return pointer to the found picture, or NULL if no pic with the provided + * frame number is found + */ +static Picture * find_short(H264Context *h, int frame_num, int *idx){ + MpegEncContext * const s = &h->s; + int i; + + for(i=0; ishort_ref_count; i++){ + Picture *pic= h->short_ref[i]; + if(s->avctx->debug&FF_DEBUG_MMCO) + av_log(h->s.avctx, AV_LOG_DEBUG, "%d %d %p\n", i, pic->frame_num, pic); + if(pic->frame_num == frame_num) { + *idx = i; + return pic; + } + } + return NULL; +} + +/** + * Remove a picture from the short term reference list by its index in + * that list. This does no checking on the provided index; it is assumed + * to be valid. Other list entries are shifted down. + * @param i index into h->short_ref of picture to remove. + */ +static void remove_short_at_index(H264Context *h, int i){ + assert(i >= 0 && i < h->short_ref_count); + h->short_ref[i]= NULL; + if (--h->short_ref_count) + memmove(&h->short_ref[i], &h->short_ref[i+1], (h->short_ref_count - i)*sizeof(Picture*)); +} + +/** + * + * @return the removed picture or NULL if an error occurs + */ +static Picture * remove_short(H264Context *h, int frame_num, int ref_mask){ + MpegEncContext * const s = &h->s; + Picture *pic; + int i; + + if(s->avctx->debug&FF_DEBUG_MMCO) + av_log(h->s.avctx, AV_LOG_DEBUG, "remove short %d count %d\n", frame_num, h->short_ref_count); + + pic = find_short(h, frame_num, &i); + if (pic){ + if(unreference_pic(h, pic, ref_mask)) + remove_short_at_index(h, i); + } + + return pic; +} + +/** + * Remove a picture from the long term reference list by its index in + * that list. + * @return the removed picture or NULL if an error occurs + */ +static Picture * remove_long(H264Context *h, int i, int ref_mask){ + Picture *pic; + + pic= h->long_ref[i]; + if (pic){ + if(unreference_pic(h, pic, ref_mask)){ + assert(h->long_ref[i]->long_ref == 1); + h->long_ref[i]->long_ref= 0; + h->long_ref[i]= NULL; + h->long_ref_count--; + } + } + + return pic; +} + +void ff_h264_remove_all_refs(H264Context *h){ + int i; + + for(i=0; i<16; i++){ + remove_long(h, i, 0); + } + assert(h->long_ref_count==0); + + for(i=0; ishort_ref_count; i++){ + unreference_pic(h, h->short_ref[i], 0); + h->short_ref[i]= NULL; + } + h->short_ref_count=0; +} + +/** + * print short term list + */ +static void print_short_term(H264Context *h) { + uint32_t i; + if(h->s.avctx->debug&FF_DEBUG_MMCO) { + av_log(h->s.avctx, AV_LOG_DEBUG, "short term list:\n"); + for(i=0; ishort_ref_count; i++){ + Picture *pic= h->short_ref[i]; + av_log(h->s.avctx, AV_LOG_DEBUG, "%d fn:%d poc:%d %p\n", i, pic->frame_num, pic->poc, pic->data[0]); + } + } +} + +/** + * print long term list + */ +static void print_long_term(H264Context *h) { + uint32_t i; + if(h->s.avctx->debug&FF_DEBUG_MMCO) { + av_log(h->s.avctx, AV_LOG_DEBUG, "long term list:\n"); + for(i = 0; i < 16; i++){ + Picture *pic= h->long_ref[i]; + if (pic) { + av_log(h->s.avctx, AV_LOG_DEBUG, "%d fn:%d poc:%d %p\n", i, pic->frame_num, pic->poc, pic->data[0]); + } + } + } +} + +void ff_generate_sliding_window_mmcos(H264Context *h) { + MpegEncContext * const s = &h->s; + assert(h->long_ref_count + h->short_ref_count <= h->sps.ref_frame_count); + + h->mmco_index= 0; + if(h->short_ref_count && h->long_ref_count + h->short_ref_count == h->sps.ref_frame_count && + !(FIELD_PICTURE && !s->first_field && s->current_picture_ptr->reference)) { + h->mmco[0].opcode= MMCO_SHORT2UNUSED; + h->mmco[0].short_pic_num= h->short_ref[ h->short_ref_count - 1 ]->frame_num; + h->mmco_index= 1; + if (FIELD_PICTURE) { + h->mmco[0].short_pic_num *= 2; + h->mmco[1].opcode= MMCO_SHORT2UNUSED; + h->mmco[1].short_pic_num= h->mmco[0].short_pic_num + 1; + h->mmco_index= 2; + } + } +} + +int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){ + MpegEncContext * const s = &h->s; + int i, av_uninit(j); + int current_ref_assigned=0; + Picture *av_uninit(pic); + + if((s->avctx->debug&FF_DEBUG_MMCO) && mmco_count==0) + av_log(h->s.avctx, AV_LOG_DEBUG, "no mmco here\n"); + + for(i=0; iavctx->debug&FF_DEBUG_MMCO) + av_log(h->s.avctx, AV_LOG_DEBUG, "mmco:%d %d %d\n", h->mmco[i].opcode, h->mmco[i].short_pic_num, h->mmco[i].long_arg); + + if( mmco[i].opcode == MMCO_SHORT2UNUSED + || mmco[i].opcode == MMCO_SHORT2LONG){ + frame_num = pic_num_extract(h, mmco[i].short_pic_num, &structure); + pic = find_short(h, frame_num, &j); + if(!pic){ + if(mmco[i].opcode != MMCO_SHORT2LONG || !h->long_ref[mmco[i].long_arg] + || h->long_ref[mmco[i].long_arg]->frame_num != frame_num) + av_log(h->s.avctx, AV_LOG_ERROR, "mmco: unref short failure\n"); + continue; + } + } + + switch(mmco[i].opcode){ + case MMCO_SHORT2UNUSED: + if(s->avctx->debug&FF_DEBUG_MMCO) + av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: unref short %d count %d\n", h->mmco[i].short_pic_num, h->short_ref_count); + remove_short(h, frame_num, structure ^ PICT_FRAME); + break; + case MMCO_SHORT2LONG: + if (h->long_ref[mmco[i].long_arg] != pic) + remove_long(h, mmco[i].long_arg, 0); + + remove_short_at_index(h, j); + h->long_ref[ mmco[i].long_arg ]= pic; + if (h->long_ref[ mmco[i].long_arg ]){ + h->long_ref[ mmco[i].long_arg ]->long_ref=1; + h->long_ref_count++; + } + break; + case MMCO_LONG2UNUSED: + j = pic_num_extract(h, mmco[i].long_arg, &structure); + pic = h->long_ref[j]; + if (pic) { + remove_long(h, j, structure ^ PICT_FRAME); + } else if(s->avctx->debug&FF_DEBUG_MMCO) + av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: unref long failure\n"); + break; + case MMCO_LONG: + // Comment below left from previous code as it is an interresting note. + /* First field in pair is in short term list or + * at a different long term index. + * This is not allowed; see 7.4.3.3, notes 2 and 3. + * Report the problem and keep the pair where it is, + * and mark this field valid. + */ + + if (h->long_ref[mmco[i].long_arg] != s->current_picture_ptr) { + remove_long(h, mmco[i].long_arg, 0); + + h->long_ref[ mmco[i].long_arg ]= s->current_picture_ptr; + h->long_ref[ mmco[i].long_arg ]->long_ref=1; + h->long_ref_count++; + } + + s->current_picture_ptr->reference |= s->picture_structure; + current_ref_assigned=1; + break; + case MMCO_SET_MAX_LONG: + assert(mmco[i].long_arg <= 16); + // just remove the long term which index is greater than new max + for(j = mmco[i].long_arg; j<16; j++){ + remove_long(h, j, 0); + } + break; + case MMCO_RESET: + while(h->short_ref_count){ + remove_short(h, h->short_ref[0]->frame_num, 0); + } + for(j = 0; j < 16; j++) { + remove_long(h, j, 0); + } + s->current_picture_ptr->poc= + s->current_picture_ptr->field_poc[0]= + s->current_picture_ptr->field_poc[1]= + h->poc_lsb= + h->poc_msb= + h->frame_num= + s->current_picture_ptr->frame_num= 0; + s->current_picture_ptr->mmco_reset=1; + break; + default: assert(0); + } + } + + if (!current_ref_assigned) { + /* Second field of complementary field pair; the first field of + * which is already referenced. If short referenced, it + * should be first entry in short_ref. If not, it must exist + * in long_ref; trying to put it on the short list here is an + * error in the encoded bit stream (ref: 7.4.3.3, NOTE 2 and 3). + */ + if (h->short_ref_count && h->short_ref[0] == s->current_picture_ptr) { + /* Just mark the second field valid */ + s->current_picture_ptr->reference = PICT_FRAME; + } else if (s->current_picture_ptr->long_ref) { + av_log(h->s.avctx, AV_LOG_ERROR, "illegal short term reference " + "assignment for second field " + "in complementary field pair " + "(first field is long term)\n"); + } else { + pic= remove_short(h, s->current_picture_ptr->frame_num, 0); + if(pic){ + av_log(h->s.avctx, AV_LOG_ERROR, "illegal short term buffer state detected\n"); + } + + if(h->short_ref_count) + memmove(&h->short_ref[1], &h->short_ref[0], h->short_ref_count*sizeof(Picture*)); + + h->short_ref[0]= s->current_picture_ptr; + h->short_ref_count++; + s->current_picture_ptr->reference |= s->picture_structure; + } + } + + if (h->long_ref_count + h->short_ref_count > h->sps.ref_frame_count){ + + /* We have too many reference frames, probably due to corrupted + * stream. Need to discard one frame. Prevents overrun of the + * short_ref and long_ref buffers. + */ + av_log(h->s.avctx, AV_LOG_ERROR, + "number of reference frames exceeds max (probably " + "corrupt input), discarding one\n"); + + if (h->long_ref_count && !h->short_ref_count) { + for (i = 0; i < 16; ++i) + if (h->long_ref[i]) + break; + + assert(i < 16); + remove_long(h, i, 0); + } else { + pic = h->short_ref[h->short_ref_count - 1]; + remove_short(h, pic->frame_num, 0); + } + } + + print_short_term(h); + print_long_term(h); + return 0; +} + +int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb){ + MpegEncContext * const s = &h->s; + int i; + + h->mmco_index= 0; + if(h->nal_unit_type == NAL_IDR_SLICE){ //FIXME fields + s->broken_link= get_bits1(gb) -1; + if(get_bits1(gb)){ + h->mmco[0].opcode= MMCO_LONG; + h->mmco[0].long_arg= 0; + h->mmco_index= 1; + } + }else{ + if(get_bits1(gb)){ // adaptive_ref_pic_marking_mode_flag + for(i= 0; immco[i].opcode= opcode; + if(opcode==MMCO_SHORT2UNUSED || opcode==MMCO_SHORT2LONG){ + h->mmco[i].short_pic_num= (h->curr_pic_num - get_ue_golomb(gb) - 1) & (h->max_pic_num - 1); +/* if(h->mmco[i].short_pic_num >= h->short_ref_count || h->short_ref[ h->mmco[i].short_pic_num ] == NULL){ + av_log(s->avctx, AV_LOG_ERROR, "illegal short ref in memory management control operation %d\n", mmco); + return -1; + }*/ + } + if(opcode==MMCO_SHORT2LONG || opcode==MMCO_LONG2UNUSED || opcode==MMCO_LONG || opcode==MMCO_SET_MAX_LONG){ + unsigned int long_arg= get_ue_golomb_31(gb); + if(long_arg >= 32 || (long_arg >= 16 && !(opcode == MMCO_LONG2UNUSED && FIELD_PICTURE))){ + av_log(h->s.avctx, AV_LOG_ERROR, "illegal long ref in memory management control operation %d\n", opcode); + return -1; + } + h->mmco[i].long_arg= long_arg; + } + + if(opcode > (unsigned)MMCO_LONG){ + av_log(h->s.avctx, AV_LOG_ERROR, "illegal memory management control operation %d\n", opcode); + return -1; + } + if(opcode == MMCO_END) + break; + } + h->mmco_index= i; + }else{ + ff_generate_sliding_window_mmcos(h); + } + } + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_sei.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_sei.c new file mode 100644 index 00000000..195ea285 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_sei.c @@ -0,0 +1,206 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... sei decoding + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + * H.264 / AVC / MPEG4 part10 sei decoding. + * @author Michael Niedermayer + */ + +#include "internal.h" +#include "avcodec.h" +#include "h264.h" +#include "golomb.h" + +//#undef NDEBUG +#include + +static const uint8_t sei_num_clock_ts_table[9]={ + 1, 1, 1, 2, 2, 3, 3, 2, 3 +}; + +void ff_h264_reset_sei(H264Context *h) { + h->sei_recovery_frame_cnt = -1; + h->sei_dpb_output_delay = 0; + h->sei_cpb_removal_delay = -1; + h->sei_buffering_period_present = 0; +} + +static int decode_picture_timing(H264Context *h){ + MpegEncContext * const s = &h->s; + if(h->sps.nal_hrd_parameters_present_flag || h->sps.vcl_hrd_parameters_present_flag){ + h->sei_cpb_removal_delay = get_bits(&s->gb, h->sps.cpb_removal_delay_length); + h->sei_dpb_output_delay = get_bits(&s->gb, h->sps.dpb_output_delay_length); + } + if(h->sps.pic_struct_present_flag){ + unsigned int i, num_clock_ts; + h->sei_pic_struct = get_bits(&s->gb, 4); + h->sei_ct_type = 0; + + if (h->sei_pic_struct > SEI_PIC_STRUCT_FRAME_TRIPLING) + return -1; + + num_clock_ts = sei_num_clock_ts_table[h->sei_pic_struct]; + + for (i = 0 ; i < num_clock_ts ; i++){ + if(get_bits(&s->gb, 1)){ /* clock_timestamp_flag */ + unsigned int full_timestamp_flag; + h->sei_ct_type |= 1<gb, 2); + skip_bits(&s->gb, 1); /* nuit_field_based_flag */ + skip_bits(&s->gb, 5); /* counting_type */ + full_timestamp_flag = get_bits(&s->gb, 1); + skip_bits(&s->gb, 1); /* discontinuity_flag */ + skip_bits(&s->gb, 1); /* cnt_dropped_flag */ + skip_bits(&s->gb, 8); /* n_frames */ + if(full_timestamp_flag){ + skip_bits(&s->gb, 6); /* seconds_value 0..59 */ + skip_bits(&s->gb, 6); /* minutes_value 0..59 */ + skip_bits(&s->gb, 5); /* hours_value 0..23 */ + }else{ + if(get_bits(&s->gb, 1)){ /* seconds_flag */ + skip_bits(&s->gb, 6); /* seconds_value range 0..59 */ + if(get_bits(&s->gb, 1)){ /* minutes_flag */ + skip_bits(&s->gb, 6); /* minutes_value 0..59 */ + if(get_bits(&s->gb, 1)) /* hours_flag */ + skip_bits(&s->gb, 5); /* hours_value 0..23 */ + } + } + } + if(h->sps.time_offset_length > 0) + skip_bits(&s->gb, h->sps.time_offset_length); /* time_offset */ + } + } + + if(s->avctx->debug & FF_DEBUG_PICT_INFO) + av_log(s->avctx, AV_LOG_DEBUG, "ct_type:%X pic_struct:%d\n", h->sei_ct_type, h->sei_pic_struct); + } + return 0; +} + +static int decode_unregistered_user_data(H264Context *h, int size){ + MpegEncContext * const s = &h->s; + uint8_t user_data[16+256]; + int e, build, i; + + if(size<16) + return -1; + + for(i=0; igb, 8); + } + + user_data[i]= 0; + e= sscanf(user_data+16, "x264 - core %d"/*%s - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html*/, &build); + if(e==1 && build>0) + h->x264_build= build; + + if(s->avctx->debug & FF_DEBUG_BUGS) + av_log(s->avctx, AV_LOG_DEBUG, "user data:\"%s\"\n", user_data+16); + + for(; igb, 8); + + return 0; +} + +static int decode_recovery_point(H264Context *h){ + MpegEncContext * const s = &h->s; + + h->sei_recovery_frame_cnt = get_ue_golomb(&s->gb); + skip_bits(&s->gb, 4); /* 1b exact_match_flag, 1b broken_link_flag, 2b changing_slice_group_idc */ + + return 0; +} + +static int decode_buffering_period(H264Context *h){ + MpegEncContext * const s = &h->s; + unsigned int sps_id; + int sched_sel_idx; + SPS *sps; + + sps_id = get_ue_golomb_31(&s->gb); + if(sps_id > 31 || !h->sps_buffers[sps_id]) { + av_log(h->s.avctx, AV_LOG_ERROR, "non-existing SPS %d referenced in buffering period\n", sps_id); + return -1; + } + sps = h->sps_buffers[sps_id]; + + // NOTE: This is really so duplicated in the standard... See H.264, D.1.1 + if (sps->nal_hrd_parameters_present_flag) { + for (sched_sel_idx = 0; sched_sel_idx < sps->cpb_cnt; sched_sel_idx++) { + h->initial_cpb_removal_delay[sched_sel_idx] = get_bits(&s->gb, sps->initial_cpb_removal_delay_length); + skip_bits(&s->gb, sps->initial_cpb_removal_delay_length); // initial_cpb_removal_delay_offset + } + } + if (sps->vcl_hrd_parameters_present_flag) { + for (sched_sel_idx = 0; sched_sel_idx < sps->cpb_cnt; sched_sel_idx++) { + h->initial_cpb_removal_delay[sched_sel_idx] = get_bits(&s->gb, sps->initial_cpb_removal_delay_length); + skip_bits(&s->gb, sps->initial_cpb_removal_delay_length); // initial_cpb_removal_delay_offset + } + } + + h->sei_buffering_period_present = 1; + return 0; +} + +int ff_h264_decode_sei(H264Context *h){ + MpegEncContext * const s = &h->s; + + while(get_bits_count(&s->gb) + 16 < s->gb.size_in_bits){ + int size, type; + + type=0; + do{ + type+= show_bits(&s->gb, 8); + }while(get_bits(&s->gb, 8) == 255); + + size=0; + do{ + size+= show_bits(&s->gb, 8); + }while(get_bits(&s->gb, 8) == 255); + + switch(type){ + case SEI_TYPE_PIC_TIMING: // Picture timing SEI + if(decode_picture_timing(h) < 0) + return -1; + break; + case SEI_TYPE_USER_DATA_UNREGISTERED: + if(decode_unregistered_user_data(h, size) < 0) + return -1; + break; + case SEI_TYPE_RECOVERY_POINT: + if(decode_recovery_point(h) < 0) + return -1; + break; + case SEI_BUFFERING_PERIOD: + if(decode_buffering_period(h) < 0) + return -1; + break; + default: + skip_bits(&s->gb, 8*size); + } + + //FIXME check bits here + align_get_bits(&s->gb); + } + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264dsp.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264dsp.c new file mode 100644 index 00000000..c3ee06d9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264dsp.c @@ -0,0 +1,321 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder + * Copyright (c) 2003-2010 Michael Niedermayer + * + * 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 + * H.264 / AVC / MPEG4 part10 DSP functions. + * @author Michael Niedermayer + */ + +#include +#include "avcodec.h" +#include "h264dsp.h" + +#define op_scale1(x) block[x] = av_clip_uint8( (block[x]*weight + offset) >> log2_denom ) +#define op_scale2(x) dst[x] = av_clip_uint8( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1)) +#define H264_WEIGHT(W,H) \ +static void weight_h264_pixels ## W ## x ## H ## _c(uint8_t *block, int stride, int log2_denom, int weight, int offset){ \ + int y; \ + offset <<= log2_denom; \ + if(log2_denom) offset += 1<<(log2_denom-1); \ + for(y=0; y> 1 ) ) >> 1) - p1, -tc0[i], tc0[i] ); + tc++; + } + if( FFABS( q2 - q0 ) < beta ) { + if(tc0[i]) + pix[ xstride] = q1 + av_clip( (( q2 + ( ( p0 + q0 + 1 ) >> 1 ) ) >> 1) - q1, -tc0[i], tc0[i] ); + tc++; + } + + i_delta = av_clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc ); + pix[-xstride] = av_clip_uint8( p0 + i_delta ); /* p0' */ + pix[0] = av_clip_uint8( q0 - i_delta ); /* q0' */ + } + pix += ystride; + } + } +} +static void h264_v_loop_filter_luma_c(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0) +{ + h264_loop_filter_luma_c(pix, stride, 1, alpha, beta, tc0); +} +static void h264_h_loop_filter_luma_c(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0) +{ + h264_loop_filter_luma_c(pix, 1, stride, alpha, beta, tc0); +} + +static av_always_inline av_flatten void h264_loop_filter_luma_intra_c(uint8_t *pix, int xstride, int ystride, int alpha, int beta) +{ + int d; + for( d = 0; d < 16; d++ ) { + const int p2 = pix[-3*xstride]; + const int p1 = pix[-2*xstride]; + const int p0 = pix[-1*xstride]; + + const int q0 = pix[ 0*xstride]; + const int q1 = pix[ 1*xstride]; + const int q2 = pix[ 2*xstride]; + + if( FFABS( p0 - q0 ) < alpha && + FFABS( p1 - p0 ) < beta && + FFABS( q1 - q0 ) < beta ) { + + if(FFABS( p0 - q0 ) < (( alpha >> 2 ) + 2 )){ + if( FFABS( p2 - p0 ) < beta) + { + const int p3 = pix[-4*xstride]; + /* p0', p1', p2' */ + pix[-1*xstride] = ( p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4 ) >> 3; + pix[-2*xstride] = ( p2 + p1 + p0 + q0 + 2 ) >> 2; + pix[-3*xstride] = ( 2*p3 + 3*p2 + p1 + p0 + q0 + 4 ) >> 3; + } else { + /* p0' */ + pix[-1*xstride] = ( 2*p1 + p0 + q1 + 2 ) >> 2; + } + if( FFABS( q2 - q0 ) < beta) + { + const int q3 = pix[3*xstride]; + /* q0', q1', q2' */ + pix[0*xstride] = ( p1 + 2*p0 + 2*q0 + 2*q1 + q2 + 4 ) >> 3; + pix[1*xstride] = ( p0 + q0 + q1 + q2 + 2 ) >> 2; + pix[2*xstride] = ( 2*q3 + 3*q2 + q1 + q0 + p0 + 4 ) >> 3; + } else { + /* q0' */ + pix[0*xstride] = ( 2*q1 + q0 + p1 + 2 ) >> 2; + } + }else{ + /* p0', q0' */ + pix[-1*xstride] = ( 2*p1 + p0 + q1 + 2 ) >> 2; + pix[ 0*xstride] = ( 2*q1 + q0 + p1 + 2 ) >> 2; + } + } + pix += ystride; + } +} +static void h264_v_loop_filter_luma_intra_c(uint8_t *pix, int stride, int alpha, int beta) +{ + h264_loop_filter_luma_intra_c(pix, stride, 1, alpha, beta); +} +static void h264_h_loop_filter_luma_intra_c(uint8_t *pix, int stride, int alpha, int beta) +{ + h264_loop_filter_luma_intra_c(pix, 1, stride, alpha, beta); +} + +static av_always_inline av_flatten void h264_loop_filter_chroma_c(uint8_t *pix, int xstride, int ystride, int alpha, int beta, int8_t *tc0) +{ + int i, d; + for( i = 0; i < 4; i++ ) { + const int tc = tc0[i]; + if( tc <= 0 ) { + pix += 2*ystride; + continue; + } + for( d = 0; d < 2; d++ ) { + const int p0 = pix[-1*xstride]; + const int p1 = pix[-2*xstride]; + const int q0 = pix[0]; + const int q1 = pix[1*xstride]; + + if( FFABS( p0 - q0 ) < alpha && + FFABS( p1 - p0 ) < beta && + FFABS( q1 - q0 ) < beta ) { + + int delta = av_clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc ); + + pix[-xstride] = av_clip_uint8( p0 + delta ); /* p0' */ + pix[0] = av_clip_uint8( q0 - delta ); /* q0' */ + } + pix += ystride; + } + } +} +static void h264_v_loop_filter_chroma_c(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0) +{ + h264_loop_filter_chroma_c(pix, stride, 1, alpha, beta, tc0); +} +static void h264_h_loop_filter_chroma_c(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0) +{ + h264_loop_filter_chroma_c(pix, 1, stride, alpha, beta, tc0); +} + +static av_always_inline av_flatten void h264_loop_filter_chroma_intra_c(uint8_t *pix, int xstride, int ystride, int alpha, int beta) +{ + int d; + for( d = 0; d < 8; d++ ) { + const int p0 = pix[-1*xstride]; + const int p1 = pix[-2*xstride]; + const int q0 = pix[0]; + const int q1 = pix[1*xstride]; + + if( FFABS( p0 - q0 ) < alpha && + FFABS( p1 - p0 ) < beta && + FFABS( q1 - q0 ) < beta ) { + + pix[-xstride] = ( 2*p1 + p0 + q1 + 2 ) >> 2; /* p0' */ + pix[0] = ( 2*q1 + q0 + p1 + 2 ) >> 2; /* q0' */ + } + pix += ystride; + } +} +static void h264_v_loop_filter_chroma_intra_c(uint8_t *pix, int stride, int alpha, int beta) +{ + h264_loop_filter_chroma_intra_c(pix, stride, 1, alpha, beta); +} +static void h264_h_loop_filter_chroma_intra_c(uint8_t *pix, int stride, int alpha, int beta) +{ + h264_loop_filter_chroma_intra_c(pix, 1, stride, alpha, beta); +} + +void ff_h264dsp_init(H264DSPContext *c) +{ + c->h264_idct_add= ff_h264_idct_add_c; + c->h264_idct8_add= ff_h264_idct8_add_c; + c->h264_idct_dc_add= ff_h264_idct_dc_add_c; + c->h264_idct8_dc_add= ff_h264_idct8_dc_add_c; + c->h264_idct_add16 = ff_h264_idct_add16_c; + c->h264_idct8_add4 = ff_h264_idct8_add4_c; + c->h264_idct_add8 = ff_h264_idct_add8_c; + c->h264_idct_add16intra= ff_h264_idct_add16intra_c; + c->h264_luma_dc_dequant_idct= ff_h264_luma_dc_dequant_idct_c; + + c->weight_h264_pixels_tab[0]= weight_h264_pixels16x16_c; + c->weight_h264_pixels_tab[1]= weight_h264_pixels16x8_c; + c->weight_h264_pixels_tab[2]= weight_h264_pixels8x16_c; + c->weight_h264_pixels_tab[3]= weight_h264_pixels8x8_c; + c->weight_h264_pixels_tab[4]= weight_h264_pixels8x4_c; + c->weight_h264_pixels_tab[5]= weight_h264_pixels4x8_c; + c->weight_h264_pixels_tab[6]= weight_h264_pixels4x4_c; + c->weight_h264_pixels_tab[7]= weight_h264_pixels4x2_c; + c->weight_h264_pixels_tab[8]= weight_h264_pixels2x4_c; + c->weight_h264_pixels_tab[9]= weight_h264_pixels2x2_c; + c->biweight_h264_pixels_tab[0]= biweight_h264_pixels16x16_c; + c->biweight_h264_pixels_tab[1]= biweight_h264_pixels16x8_c; + c->biweight_h264_pixels_tab[2]= biweight_h264_pixels8x16_c; + c->biweight_h264_pixels_tab[3]= biweight_h264_pixels8x8_c; + c->biweight_h264_pixels_tab[4]= biweight_h264_pixels8x4_c; + c->biweight_h264_pixels_tab[5]= biweight_h264_pixels4x8_c; + c->biweight_h264_pixels_tab[6]= biweight_h264_pixels4x4_c; + c->biweight_h264_pixels_tab[7]= biweight_h264_pixels4x2_c; + c->biweight_h264_pixels_tab[8]= biweight_h264_pixels2x4_c; + c->biweight_h264_pixels_tab[9]= biweight_h264_pixels2x2_c; + + c->h264_v_loop_filter_luma= h264_v_loop_filter_luma_c; + c->h264_h_loop_filter_luma= h264_h_loop_filter_luma_c; + c->h264_v_loop_filter_luma_intra= h264_v_loop_filter_luma_intra_c; + c->h264_h_loop_filter_luma_intra= h264_h_loop_filter_luma_intra_c; + c->h264_v_loop_filter_chroma= h264_v_loop_filter_chroma_c; + c->h264_h_loop_filter_chroma= h264_h_loop_filter_chroma_c; + c->h264_v_loop_filter_chroma_intra= h264_v_loop_filter_chroma_intra_c; + c->h264_h_loop_filter_chroma_intra= h264_h_loop_filter_chroma_intra_c; + c->h264_loop_filter_strength= NULL; + + if (ARCH_ARM) ff_h264dsp_init_arm(c); + if (HAVE_ALTIVEC) ff_h264dsp_init_ppc(c); + if (HAVE_MMX) ff_h264dsp_init_x86(c); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264dsp.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264dsp.h new file mode 100644 index 00000000..2491c90b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264dsp.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2003-2010 Michael Niedermayer + * + * 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 + * H.264 DSP functions. + * @author Michael Niedermayer + */ + +#ifndef AVCODEC_H264DSP_H +#define AVCODEC_H264DSP_H + +#include +#include "dsputil.h" + +//typedef void (*h264_chroma_mc_func)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y); +typedef void (*h264_weight_func)(uint8_t *block, int stride, int log2_denom, int weight, int offset); +typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset); + +/** + * Context for storing H.264 DSP functions + */ +typedef struct H264DSPContext{ + /* weighted MC */ + h264_weight_func weight_h264_pixels_tab[10]; + h264_biweight_func biweight_h264_pixels_tab[10]; + + /* loop filter */ + void (*h264_v_loop_filter_luma)(uint8_t *pix/*align 16*/, int stride, int alpha, int beta, int8_t *tc0); + void (*h264_h_loop_filter_luma)(uint8_t *pix/*align 4 */, int stride, int alpha, int beta, int8_t *tc0); + /* v/h_loop_filter_luma_intra: align 16 */ + void (*h264_v_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta); + void (*h264_h_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta); + void (*h264_v_loop_filter_chroma)(uint8_t *pix/*align 8*/, int stride, int alpha, int beta, int8_t *tc0); + void (*h264_h_loop_filter_chroma)(uint8_t *pix/*align 4*/, int stride, int alpha, int beta, int8_t *tc0); + void (*h264_v_loop_filter_chroma_intra)(uint8_t *pix/*align 8*/, int stride, int alpha, int beta); + void (*h264_h_loop_filter_chroma_intra)(uint8_t *pix/*align 8*/, int stride, int alpha, int beta); + // h264_loop_filter_strength: simd only. the C version is inlined in h264.c + void (*h264_loop_filter_strength)(int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2], + int bidir, int edges, int step, int mask_mv0, int mask_mv1, int field); + + /* IDCT */ + void (*h264_idct_add)(uint8_t *dst/*align 4*/, DCTELEM *block/*align 16*/, int stride); + void (*h264_idct8_add)(uint8_t *dst/*align 8*/, DCTELEM *block/*align 16*/, int stride); + void (*h264_idct_dc_add)(uint8_t *dst/*align 4*/, DCTELEM *block/*align 16*/, int stride); + void (*h264_idct8_dc_add)(uint8_t *dst/*align 8*/, DCTELEM *block/*align 16*/, int stride); + + void (*h264_dct)(DCTELEM block[4][4]); + void (*h264_idct_add16)(uint8_t *dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]); + void (*h264_idct8_add4)(uint8_t *dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]); + void (*h264_idct_add8)(uint8_t **dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]); + void (*h264_idct_add16intra)(uint8_t *dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]); + void (*h264_luma_dc_dequant_idct)(DCTELEM *output, DCTELEM *input/*align 16*/, int qmul); +}H264DSPContext; + +void ff_h264dsp_init(H264DSPContext *c); +void ff_h264dsp_init_arm(H264DSPContext *c); +void ff_h264dsp_init_ppc(H264DSPContext *c); +void ff_h264dsp_init_x86(H264DSPContext *c); + +#endif /* AVCODEC_H264DSP_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/iff.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/iff.c new file mode 100644 index 00000000..18ad7004 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/iff.c @@ -0,0 +1,394 @@ +/* + * IFF PBM/ILBM bitmap decoder + * Copyright (c) 2010 Peter Ross + * Copyright (c) 2010 Sebastian Vater + * + * 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 + * IFF PBM/ILBM bitmap decoder + */ + +#include "libavcore/imgutils.h" +#include "bytestream.h" +#include "avcodec.h" +#include "get_bits.h" + +typedef struct { + AVFrame frame; + int planesize; + uint8_t * planebuf; + int init; // 1 if buffer and palette data already initialized, 0 otherwise +} IffContext; + +#define LUT8_PART(plane, v) \ + AV_LE2NE64C(UINT64_C(0x0000000)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x1000000)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x0010000)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x1010000)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x0000100)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x1000100)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x0010100)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x1010100)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x0000001)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x1000001)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x0010001)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x1010001)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x0000101)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x1000101)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x0010101)<<32 | v) << plane, \ + AV_LE2NE64C(UINT64_C(0x1010101)<<32 | v) << plane + +#define LUT8(plane) { \ + LUT8_PART(plane, 0x0000000), \ + LUT8_PART(plane, 0x1000000), \ + LUT8_PART(plane, 0x0010000), \ + LUT8_PART(plane, 0x1010000), \ + LUT8_PART(plane, 0x0000100), \ + LUT8_PART(plane, 0x1000100), \ + LUT8_PART(plane, 0x0010100), \ + LUT8_PART(plane, 0x1010100), \ + LUT8_PART(plane, 0x0000001), \ + LUT8_PART(plane, 0x1000001), \ + LUT8_PART(plane, 0x0010001), \ + LUT8_PART(plane, 0x1010001), \ + LUT8_PART(plane, 0x0000101), \ + LUT8_PART(plane, 0x1000101), \ + LUT8_PART(plane, 0x0010101), \ + LUT8_PART(plane, 0x1010101), \ +} + +// 8 planes * 8-bit mask +static const uint64_t plane8_lut[8][256] = { + LUT8(0), LUT8(1), LUT8(2), LUT8(3), + LUT8(4), LUT8(5), LUT8(6), LUT8(7), +}; + +#define LUT32(plane) { \ + 0, 0, 0, 0, \ + 0, 0, 0, 1 << plane, \ + 0, 0, 1 << plane, 0, \ + 0, 0, 1 << plane, 1 << plane, \ + 0, 1 << plane, 0, 0, \ + 0, 1 << plane, 0, 1 << plane, \ + 0, 1 << plane, 1 << plane, 0, \ + 0, 1 << plane, 1 << plane, 1 << plane, \ + 1 << plane, 0, 0, 0, \ + 1 << plane, 0, 0, 1 << plane, \ + 1 << plane, 0, 1 << plane, 0, \ + 1 << plane, 0, 1 << plane, 1 << plane, \ + 1 << plane, 1 << plane, 0, 0, \ + 1 << plane, 1 << plane, 0, 1 << plane, \ + 1 << plane, 1 << plane, 1 << plane, 0, \ + 1 << plane, 1 << plane, 1 << plane, 1 << plane, \ +} + +// 32 planes * 4-bit mask * 4 lookup tables each +static const uint32_t plane32_lut[32][16*4] = { + LUT32( 0), LUT32( 1), LUT32( 2), LUT32( 3), + LUT32( 4), LUT32( 5), LUT32( 6), LUT32( 7), + LUT32( 8), LUT32( 9), LUT32(10), LUT32(11), + LUT32(12), LUT32(13), LUT32(14), LUT32(15), + LUT32(16), LUT32(17), LUT32(18), LUT32(19), + LUT32(20), LUT32(21), LUT32(22), LUT32(23), + LUT32(24), LUT32(25), LUT32(26), LUT32(27), + LUT32(28), LUT32(29), LUT32(30), LUT32(31), +}; + +// Gray to RGB, required for palette table of grayscale images with bpp < 8 +static av_always_inline uint32_t gray2rgb(const uint32_t x) { + return x << 16 | x << 8 | x; +} + +/** + * Convert CMAP buffer (stored in extradata) to lavc palette format + */ +static int ff_cmap_read_palette(AVCodecContext *avctx, uint32_t *pal) +{ + int count, i; + + if (avctx->bits_per_coded_sample > 8) { + av_log(avctx, AV_LOG_ERROR, "bit_per_coded_sample > 8 not supported\n"); + return AVERROR_INVALIDDATA; + } + + count = 1 << avctx->bits_per_coded_sample; + // If extradata is smaller than actually needed, fill the remaining with black. + count = FFMIN(avctx->extradata_size / 3, count); + if (count) { + for (i=0; i < count; i++) { + pal[i] = 0xFF000000 | AV_RB24( avctx->extradata + i*3 ); + } + } else { // Create gray-scale color palette for bps < 8 + count = 1 << avctx->bits_per_coded_sample; + + for (i=0; i < count; i++) { + pal[i] = 0xFF000000 | gray2rgb((i * 255) >> avctx->bits_per_coded_sample); + } + } + return 0; +} + +static av_cold int decode_init(AVCodecContext *avctx) +{ + IffContext *s = avctx->priv_data; + int err; + + if (avctx->bits_per_coded_sample <= 8) { + avctx->pix_fmt = (avctx->bits_per_coded_sample < 8 || + avctx->extradata_size) ? PIX_FMT_PAL8 + : PIX_FMT_GRAY8; + } else if (avctx->bits_per_coded_sample <= 32) { + avctx->pix_fmt = PIX_FMT_BGR32; + } else { + return AVERROR_INVALIDDATA; + } + + if ((err = av_image_check_size(avctx->width, avctx->height, 0, avctx))) + return err; + s->planesize = FFALIGN(avctx->width, 16) >> 3; // Align plane size in bits to word-boundary + s->planebuf = av_malloc(s->planesize + FF_INPUT_BUFFER_PADDING_SIZE); + if (!s->planebuf) + return AVERROR(ENOMEM); + + s->frame.reference = 1; + + return 0; +} + +/** + * Decode interleaved plane buffer up to 8bpp + * @param dst Destination buffer + * @param buf Source buffer + * @param buf_size + * @param plane plane number to decode as + */ +static void decodeplane8(uint8_t *dst, const uint8_t *buf, int buf_size, int plane) +{ + const uint64_t *lut = plane8_lut[plane]; + do { + uint64_t v = AV_RN64A(dst) | lut[*buf++]; + AV_WN64A(dst, v); + dst += 8; + } while (--buf_size); +} + +/** + * Decode interleaved plane buffer up to 24bpp + * @param dst Destination buffer + * @param buf Source buffer + * @param buf_size + * @param plane plane number to decode as + */ +static void decodeplane32(uint32_t *dst, const uint8_t *buf, int buf_size, int plane) +{ + const uint32_t *lut = plane32_lut[plane]; + do { + unsigned mask = (*buf >> 2) & ~3; + dst[0] |= lut[mask++]; + dst[1] |= lut[mask++]; + dst[2] |= lut[mask++]; + dst[3] |= lut[mask]; + mask = (*buf++ << 2) & 0x3F; + dst[4] |= lut[mask++]; + dst[5] |= lut[mask++]; + dst[6] |= lut[mask++]; + dst[7] |= lut[mask]; + dst += 8; + } while (--buf_size); +} + +/** + * Decode one complete byterun1 encoded line. + * + * @param dst the destination buffer where to store decompressed bitstream + * @param dst_size the destination plane size in bytes + * @param buf the source byterun1 compressed bitstream + * @param buf_end the EOF of source byterun1 compressed bitstream + * @return number of consumed bytes in byterun1 compressed bitstream +*/ +static int decode_byterun(uint8_t *dst, int dst_size, + const uint8_t *buf, const uint8_t *const buf_end) { + const uint8_t *const buf_start = buf; + unsigned x; + for (x = 0; x < dst_size && buf < buf_end;) { + unsigned length; + const int8_t value = *buf++; + if (value >= 0) { + length = value + 1; + memcpy(dst + x, buf, FFMIN3(length, dst_size - x, buf_end - buf)); + buf += length; + } else if (value > -128) { + length = -value + 1; + memset(dst + x, *buf++, FFMIN(length, dst_size - x)); + } else { // noop + continue; + } + x += length; + } + return buf - buf_start; +} + +static int decode_frame_ilbm(AVCodecContext *avctx, + void *data, int *data_size, + AVPacket *avpkt) +{ + IffContext *s = avctx->priv_data; + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + const uint8_t *buf_end = buf+buf_size; + int y, plane, res; + + if (s->init) { + if ((res = avctx->reget_buffer(avctx, &s->frame)) < 0) { + av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); + return res; + } + } else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) { + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return res; + } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != PIX_FMT_GRAY8) { + if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0) + return res; + } + s->init = 1; + + if (avctx->codec_tag == MKTAG('I','L','B','M')) { // interleaved + if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) { + for(y = 0; y < avctx->height; y++ ) { + uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ]; + memset(row, 0, avctx->width); + for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end; plane++) { + decodeplane8(row, buf, FFMIN(s->planesize, buf_end - buf), plane); + buf += s->planesize; + } + } + } else { // PIX_FMT_BGR32 + for(y = 0; y < avctx->height; y++ ) { + uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; + memset(row, 0, avctx->width << 2); + for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end; plane++) { + decodeplane32((uint32_t *) row, buf, FFMIN(s->planesize, buf_end - buf), plane); + buf += s->planesize; + } + } + } + } else if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) { // IFF-PBM + for(y = 0; y < avctx->height; y++ ) { + uint8_t *row = &s->frame.data[0][y * s->frame.linesize[0]]; + memcpy(row, buf, FFMIN(avctx->width, buf_end - buf)); + buf += avctx->width + (avctx->width % 2); // padding if odd + } + } + + *data_size = sizeof(AVFrame); + *(AVFrame*)data = s->frame; + return buf_size; +} + +static int decode_frame_byterun1(AVCodecContext *avctx, + void *data, int *data_size, + AVPacket *avpkt) +{ + IffContext *s = avctx->priv_data; + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + const uint8_t *buf_end = buf+buf_size; + int y, plane, res; + + if (s->init) { + if ((res = avctx->reget_buffer(avctx, &s->frame)) < 0) { + av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); + return res; + } + } else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) { + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return res; + } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != PIX_FMT_GRAY8) { + if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0) + return res; + } + s->init = 1; + + if (avctx->codec_tag == MKTAG('I','L','B','M')) { //interleaved + if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) { + for(y = 0; y < avctx->height ; y++ ) { + uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ]; + memset(row, 0, avctx->width); + for (plane = 0; plane < avctx->bits_per_coded_sample; plane++) { + buf += decode_byterun(s->planebuf, s->planesize, buf, buf_end); + decodeplane8(row, s->planebuf, s->planesize, plane); + } + } + } else { //PIX_FMT_BGR32 + for(y = 0; y < avctx->height ; y++ ) { + uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; + memset(row, 0, avctx->width << 2); + for (plane = 0; plane < avctx->bits_per_coded_sample; plane++) { + buf += decode_byterun(s->planebuf, s->planesize, buf, buf_end); + decodeplane32((uint32_t *) row, s->planebuf, s->planesize, plane); + } + } + } + } else { + for(y = 0; y < avctx->height ; y++ ) { + uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; + buf += decode_byterun(row, avctx->width, buf, buf_end); + } + } + + *data_size = sizeof(AVFrame); + *(AVFrame*)data = s->frame; + return buf_size; +} + +static av_cold int decode_end(AVCodecContext *avctx) +{ + IffContext *s = avctx->priv_data; + if (s->frame.data[0]) + avctx->release_buffer(avctx, &s->frame); + av_freep(&s->planebuf); + return 0; +} + +AVCodec ff_iff_ilbm_decoder = { + "iff_ilbm", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_IFF_ILBM, + sizeof(IffContext), + decode_init, + NULL, + decode_end, + decode_frame_ilbm, + CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("IFF ILBM"), +}; + +AVCodec ff_iff_byterun1_decoder = { + "iff_byterun1", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_IFF_BYTERUN1, + sizeof(IffContext), + decode_init, + NULL, + decode_end, + decode_frame_byterun1, + CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("IFF ByteRun1"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/indeo5.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/indeo5.c new file mode 100644 index 00000000..d96b3103 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/indeo5.c @@ -0,0 +1,830 @@ +/* + * Indeo Video Interactive v5 compatible decoder + * Copyright (c) 2009 Maxim Poliakovski + * + * 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 + * Indeo Video Interactive version 5 decoder + * + * Indeo5 data is usually transported within .avi or .mov files. + * Known FOURCCs: 'IV50' + */ + +#define ALT_BITSTREAM_READER_LE +#include "avcodec.h" +#include "get_bits.h" +#include "dsputil.h" +#include "ivi_dsp.h" +#include "ivi_common.h" +#include "indeo5data.h" + +/** + * Indeo5 frame types. + */ +enum { + FRAMETYPE_INTRA = 0, + FRAMETYPE_INTER = 1, ///< non-droppable P-frame + FRAMETYPE_INTER_SCAL = 2, ///< droppable P-frame used in the scalability mode + FRAMETYPE_INTER_NOREF = 3, ///< droppable P-frame + FRAMETYPE_NULL = 4 ///< empty frame with no data +}; + +#define IVI5_PIC_SIZE_ESC 15 + +#define IVI5_IS_PROTECTED 0x20 + +typedef struct { + GetBitContext gb; + AVFrame frame; + RVMapDesc rvmap_tabs[9]; ///< local corrected copy of the static rvmap tables + IVIPlaneDesc planes[3]; ///< color planes + const uint8_t *frame_data; ///< input frame data pointer + int buf_switch; ///< used to switch between three buffers + int inter_scal; ///< signals a sequence of scalable inter frames + int dst_buf; ///< buffer index for the currently decoded frame + int ref_buf; ///< inter frame reference buffer index + int ref2_buf; ///< temporal storage for switching buffers + uint32_t frame_size; ///< frame size in bytes + int frame_type; + int prev_frame_type; ///< frame type of the previous frame + int frame_num; + uint32_t pic_hdr_size; ///< picture header size in bytes + uint8_t frame_flags; + uint16_t checksum; ///< frame checksum + + IVIHuffTab mb_vlc; ///< vlc table for decoding macroblock data + + uint16_t gop_hdr_size; + uint8_t gop_flags; + int is_scalable; + uint32_t lock_word; + IVIPicConfig pic_conf; +} IVI5DecContext; + + +/** + * Decode Indeo5 GOP (Group of pictures) header. + * This header is present in key frames only. + * It defines parameters for all frames in a GOP. + * + * @param[in,out] ctx ptr to the decoder context + * @param[in] avctx ptr to the AVCodecContext + * @return result code: 0 = OK, -1 = error + */ +static int decode_gop_header(IVI5DecContext *ctx, AVCodecContext *avctx) +{ + int result, i, p, tile_size, pic_size_indx, mb_size, blk_size; + int quant_mat, blk_size_changed = 0; + IVIBandDesc *band, *band1, *band2; + IVIPicConfig pic_conf; + + ctx->gop_flags = get_bits(&ctx->gb, 8); + + ctx->gop_hdr_size = (ctx->gop_flags & 1) ? get_bits(&ctx->gb, 16) : 0; + + if (ctx->gop_flags & IVI5_IS_PROTECTED) + ctx->lock_word = get_bits_long(&ctx->gb, 32); + + tile_size = (ctx->gop_flags & 0x40) ? 64 << get_bits(&ctx->gb, 2) : 0; + if (tile_size > 256) { + av_log(avctx, AV_LOG_ERROR, "Invalid tile size: %d\n", tile_size); + return -1; + } + + /* decode number of wavelet bands */ + /* num_levels * 3 + 1 */ + pic_conf.luma_bands = get_bits(&ctx->gb, 2) * 3 + 1; + pic_conf.chroma_bands = get_bits1(&ctx->gb) * 3 + 1; + ctx->is_scalable = pic_conf.luma_bands != 1 || pic_conf.chroma_bands != 1; + if (ctx->is_scalable && (pic_conf.luma_bands != 4 || pic_conf.chroma_bands != 1)) { + av_log(avctx, AV_LOG_ERROR, "Scalability: unsupported subdivision! Luma bands: %d, chroma bands: %d\n", + pic_conf.luma_bands, pic_conf.chroma_bands); + return -1; + } + + pic_size_indx = get_bits(&ctx->gb, 4); + if (pic_size_indx == IVI5_PIC_SIZE_ESC) { + pic_conf.pic_height = get_bits(&ctx->gb, 13); + pic_conf.pic_width = get_bits(&ctx->gb, 13); + } else { + pic_conf.pic_height = ivi5_common_pic_sizes[pic_size_indx * 2 + 1] << 2; + pic_conf.pic_width = ivi5_common_pic_sizes[pic_size_indx * 2 ] << 2; + } + + if (ctx->gop_flags & 2) { + av_log(avctx, AV_LOG_ERROR, "YV12 picture format not supported!\n"); + return -1; + } + + pic_conf.chroma_height = (pic_conf.pic_height + 3) >> 2; + pic_conf.chroma_width = (pic_conf.pic_width + 3) >> 2; + + if (!tile_size) { + pic_conf.tile_height = pic_conf.pic_height; + pic_conf.tile_width = pic_conf.pic_width; + } else { + pic_conf.tile_height = pic_conf.tile_width = tile_size; + } + + /* check if picture layout was changed and reallocate buffers */ + if (ivi_pic_config_cmp(&pic_conf, &ctx->pic_conf)) { + result = ff_ivi_init_planes(ctx->planes, &pic_conf); + if (result) { + av_log(avctx, AV_LOG_ERROR, "Couldn't reallocate color planes!\n"); + return -1; + } + ctx->pic_conf = pic_conf; + blk_size_changed = 1; /* force reallocation of the internal structures */ + } + + for (p = 0; p <= 1; p++) { + for (i = 0; i < (!p ? pic_conf.luma_bands : pic_conf.chroma_bands); i++) { + band = &ctx->planes[p].bands[i]; + + band->is_halfpel = get_bits1(&ctx->gb); + + mb_size = get_bits1(&ctx->gb); + blk_size = 8 >> get_bits1(&ctx->gb); + mb_size = blk_size << !mb_size; + + blk_size_changed = mb_size != band->mb_size || blk_size != band->blk_size; + if (blk_size_changed) { + band->mb_size = mb_size; + band->blk_size = blk_size; + } + + if (get_bits1(&ctx->gb)) { + av_log(avctx, AV_LOG_ERROR, "Extended transform info encountered!\n"); + return -1; + } + + /* select transform function and scan pattern according to plane and band number */ + switch ((p << 2) + i) { + case 0: + band->inv_transform = ff_ivi_inverse_slant_8x8; + band->dc_transform = ff_ivi_dc_slant_2d; + band->scan = ff_zigzag_direct; + break; + + case 1: + band->inv_transform = ff_ivi_row_slant8; + band->dc_transform = ff_ivi_dc_row_slant; + band->scan = ff_ivi_vertical_scan_8x8; + break; + + case 2: + band->inv_transform = ff_ivi_col_slant8; + band->dc_transform = ff_ivi_dc_col_slant; + band->scan = ff_ivi_horizontal_scan_8x8; + break; + + case 3: + band->inv_transform = ff_ivi_put_pixels_8x8; + band->dc_transform = ff_ivi_put_dc_pixel_8x8; + band->scan = ff_ivi_horizontal_scan_8x8; + break; + + case 4: + band->inv_transform = ff_ivi_inverse_slant_4x4; + band->dc_transform = ff_ivi_dc_slant_2d; + band->scan = ff_ivi_direct_scan_4x4; + break; + } + + band->is_2d_trans = band->inv_transform == ff_ivi_inverse_slant_8x8 || + band->inv_transform == ff_ivi_inverse_slant_4x4; + + /* select dequant matrix according to plane and band number */ + if (!p) { + quant_mat = (pic_conf.luma_bands > 1) ? i+1 : 0; + } else { + quant_mat = 5; + } + + if (band->blk_size == 8) { + band->intra_base = &ivi5_base_quant_8x8_intra[quant_mat][0]; + band->inter_base = &ivi5_base_quant_8x8_inter[quant_mat][0]; + band->intra_scale = &ivi5_scale_quant_8x8_intra[quant_mat][0]; + band->inter_scale = &ivi5_scale_quant_8x8_inter[quant_mat][0]; + } else { + band->intra_base = ivi5_base_quant_4x4_intra; + band->inter_base = ivi5_base_quant_4x4_inter; + band->intra_scale = ivi5_scale_quant_4x4_intra; + band->inter_scale = ivi5_scale_quant_4x4_inter; + } + + if (get_bits(&ctx->gb, 2)) { + av_log(avctx, AV_LOG_ERROR, "End marker missing!\n"); + return -1; + } + } + } + + /* copy chroma parameters into the 2nd chroma plane */ + for (i = 0; i < pic_conf.chroma_bands; i++) { + band1 = &ctx->planes[1].bands[i]; + band2 = &ctx->planes[2].bands[i]; + + band2->width = band1->width; + band2->height = band1->height; + band2->mb_size = band1->mb_size; + band2->blk_size = band1->blk_size; + band2->is_halfpel = band1->is_halfpel; + band2->intra_base = band1->intra_base; + band2->inter_base = band1->inter_base; + band2->intra_scale = band1->intra_scale; + band2->inter_scale = band1->inter_scale; + band2->scan = band1->scan; + band2->inv_transform = band1->inv_transform; + band2->dc_transform = band1->dc_transform; + band2->is_2d_trans = band1->is_2d_trans; + } + + /* reallocate internal structures if needed */ + if (blk_size_changed) { + result = ff_ivi_init_tiles(ctx->planes, pic_conf.tile_width, + pic_conf.tile_height); + if (result) { + av_log(avctx, AV_LOG_ERROR, + "Couldn't reallocate internal structures!\n"); + return -1; + } + } + + if (ctx->gop_flags & 8) { + if (get_bits(&ctx->gb, 3)) { + av_log(avctx, AV_LOG_ERROR, "Alignment bits are not zero!\n"); + return -1; + } + + if (get_bits1(&ctx->gb)) + skip_bits_long(&ctx->gb, 24); /* skip transparency fill color */ + } + + align_get_bits(&ctx->gb); + + skip_bits(&ctx->gb, 23); /* FIXME: unknown meaning */ + + /* skip GOP extension if any */ + if (get_bits1(&ctx->gb)) { + do { + i = get_bits(&ctx->gb, 16); + } while (i & 0x8000); + } + + align_get_bits(&ctx->gb); + + return 0; +} + + +/** + * Skip a header extension. + * + * @param[in,out] gb the GetBit context + */ +static inline void skip_hdr_extension(GetBitContext *gb) +{ + int i, len; + + do { + len = get_bits(gb, 8); + for (i = 0; i < len; i++) skip_bits(gb, 8); + } while(len); +} + + +/** + * Decode Indeo5 picture header. + * + * @param[in,out] ctx ptr to the decoder context + * @param[in] avctx ptr to the AVCodecContext + * @return result code: 0 = OK, -1 = error + */ +static int decode_pic_hdr(IVI5DecContext *ctx, AVCodecContext *avctx) +{ + if (get_bits(&ctx->gb, 5) != 0x1F) { + av_log(avctx, AV_LOG_ERROR, "Invalid picture start code!\n"); + return -1; + } + + ctx->prev_frame_type = ctx->frame_type; + ctx->frame_type = get_bits(&ctx->gb, 3); + if (ctx->frame_type >= 5) { + av_log(avctx, AV_LOG_ERROR, "Invalid frame type: %d \n", ctx->frame_type); + return -1; + } + + ctx->frame_num = get_bits(&ctx->gb, 8); + + if (ctx->frame_type == FRAMETYPE_INTRA) { + if (decode_gop_header(ctx, avctx)) + return -1; + } + + if (ctx->frame_type != FRAMETYPE_NULL) { + ctx->frame_flags = get_bits(&ctx->gb, 8); + + ctx->pic_hdr_size = (ctx->frame_flags & 1) ? get_bits_long(&ctx->gb, 24) : 0; + + ctx->checksum = (ctx->frame_flags & 0x10) ? get_bits(&ctx->gb, 16) : 0; + + /* skip unknown extension if any */ + if (ctx->frame_flags & 0x20) + skip_hdr_extension(&ctx->gb); /* XXX: untested */ + + /* decode macroblock huffman codebook */ + if (ff_ivi_dec_huff_desc(&ctx->gb, ctx->frame_flags & 0x40, IVI_MB_HUFF, &ctx->mb_vlc, avctx)) + return -1; + + skip_bits(&ctx->gb, 3); /* FIXME: unknown meaning! */ + } + + align_get_bits(&ctx->gb); + + return 0; +} + + +/** + * Decode Indeo5 band header. + * + * @param[in,out] ctx ptr to the decoder context + * @param[in,out] band ptr to the band descriptor + * @param[in] avctx ptr to the AVCodecContext + * @return result code: 0 = OK, -1 = error + */ +static int decode_band_hdr(IVI5DecContext *ctx, IVIBandDesc *band, + AVCodecContext *avctx) +{ + int i; + uint8_t band_flags; + + band_flags = get_bits(&ctx->gb, 8); + + if (band_flags & 1) { + band->is_empty = 1; + return 0; + } + + band->data_size = (ctx->frame_flags & 0x80) ? get_bits_long(&ctx->gb, 24) : 0; + + band->inherit_mv = band_flags & 2; + band->inherit_qdelta = band_flags & 8; + band->qdelta_present = band_flags & 4; + if (!band->qdelta_present) band->inherit_qdelta = 1; + + /* decode rvmap probability corrections if any */ + band->num_corr = 0; /* there are no corrections */ + if (band_flags & 0x10) { + band->num_corr = get_bits(&ctx->gb, 8); /* get number of correction pairs */ + if (band->num_corr > 61) { + av_log(avctx, AV_LOG_ERROR, "Too many corrections: %d\n", + band->num_corr); + return -1; + } + + /* read correction pairs */ + for (i = 0; i < band->num_corr * 2; i++) + band->corr[i] = get_bits(&ctx->gb, 8); + } + + /* select appropriate rvmap table for this band */ + band->rvmap_sel = (band_flags & 0x40) ? get_bits(&ctx->gb, 3) : 8; + + /* decode block huffman codebook */ + if (ff_ivi_dec_huff_desc(&ctx->gb, band_flags & 0x80, IVI_BLK_HUFF, &band->blk_vlc, avctx)) + return -1; + + band->checksum_present = get_bits1(&ctx->gb); + if (band->checksum_present) + band->checksum = get_bits(&ctx->gb, 16); + + band->glob_quant = get_bits(&ctx->gb, 5); + + /* skip unknown extension if any */ + if (band_flags & 0x20) { /* XXX: untested */ + align_get_bits(&ctx->gb); + skip_hdr_extension(&ctx->gb); + } + + align_get_bits(&ctx->gb); + + return 0; +} + + +/** + * Decode info (block type, cbp, quant delta, motion vector) + * for all macroblocks in the current tile. + * + * @param[in,out] ctx ptr to the decoder context + * @param[in,out] band ptr to the band descriptor + * @param[in,out] tile ptr to the tile descriptor + * @param[in] avctx ptr to the AVCodecContext + * @return result code: 0 = OK, -1 = error + */ +static int decode_mb_info(IVI5DecContext *ctx, IVIBandDesc *band, + IVITile *tile, AVCodecContext *avctx) +{ + int x, y, mv_x, mv_y, mv_delta, offs, mb_offset, + mv_scale, blks_per_mb; + IVIMbInfo *mb, *ref_mb; + int row_offset = band->mb_size * band->pitch; + + mb = tile->mbs; + ref_mb = tile->ref_mbs; + offs = tile->ypos * band->pitch + tile->xpos; + + /* scale factor for motion vectors */ + mv_scale = (ctx->planes[0].bands[0].mb_size >> 3) - (band->mb_size >> 3); + mv_x = mv_y = 0; + + for (y = tile->ypos; y < (tile->ypos + tile->height); y += band->mb_size) { + mb_offset = offs; + + for (x = tile->xpos; x < (tile->xpos + tile->width); x += band->mb_size) { + mb->xpos = x; + mb->ypos = y; + mb->buf_offs = mb_offset; + + if (get_bits1(&ctx->gb)) { + if (ctx->frame_type == FRAMETYPE_INTRA) { + av_log(avctx, AV_LOG_ERROR, "Empty macroblock in an INTRA picture!\n"); + return -1; + } + mb->type = 1; /* empty macroblocks are always INTER */ + mb->cbp = 0; /* all blocks are empty */ + + mb->q_delta = 0; + if (!band->plane && !band->band_num && (ctx->frame_flags & 8)) { + mb->q_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table, + IVI_VLC_BITS, 1); + mb->q_delta = IVI_TOSIGNED(mb->q_delta); + } + + mb->mv_x = mb->mv_y = 0; /* no motion vector coded */ + if (band->inherit_mv){ + /* motion vector inheritance */ + if (mv_scale) { + mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale); + mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale); + } else { + mb->mv_x = ref_mb->mv_x; + mb->mv_y = ref_mb->mv_y; + } + } + } else { + if (band->inherit_mv) { + mb->type = ref_mb->type; /* copy mb_type from corresponding reference mb */ + } else if (ctx->frame_type == FRAMETYPE_INTRA) { + mb->type = 0; /* mb_type is always INTRA for intra-frames */ + } else { + mb->type = get_bits1(&ctx->gb); + } + + blks_per_mb = band->mb_size != band->blk_size ? 4 : 1; + mb->cbp = get_bits(&ctx->gb, blks_per_mb); + + mb->q_delta = 0; + if (band->qdelta_present) { + if (band->inherit_qdelta) { + if (ref_mb) mb->q_delta = ref_mb->q_delta; + } else if (mb->cbp || (!band->plane && !band->band_num && + (ctx->frame_flags & 8))) { + mb->q_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table, + IVI_VLC_BITS, 1); + mb->q_delta = IVI_TOSIGNED(mb->q_delta); + } + } + + if (!mb->type) { + mb->mv_x = mb->mv_y = 0; /* there is no motion vector in intra-macroblocks */ + } else { + if (band->inherit_mv){ + /* motion vector inheritance */ + if (mv_scale) { + mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale); + mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale); + } else { + mb->mv_x = ref_mb->mv_x; + mb->mv_y = ref_mb->mv_y; + } + } else { + /* decode motion vector deltas */ + mv_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table, + IVI_VLC_BITS, 1); + mv_y += IVI_TOSIGNED(mv_delta); + mv_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table, + IVI_VLC_BITS, 1); + mv_x += IVI_TOSIGNED(mv_delta); + mb->mv_x = mv_x; + mb->mv_y = mv_y; + } + } + } + + mb++; + if (ref_mb) + ref_mb++; + mb_offset += band->mb_size; + } + + offs += row_offset; + } + + align_get_bits(&ctx->gb); + + return 0; +} + + +/** + * Decode an Indeo5 band. + * + * @param[in,out] ctx ptr to the decoder context + * @param[in,out] band ptr to the band descriptor + * @param[in] avctx ptr to the AVCodecContext + * @return result code: 0 = OK, -1 = error + */ +static int decode_band(IVI5DecContext *ctx, int plane_num, + IVIBandDesc *band, AVCodecContext *avctx) +{ + int result, i, t, idx1, idx2, pos; + IVITile *tile; + + band->buf = band->bufs[ctx->dst_buf]; + band->ref_buf = band->bufs[ctx->ref_buf]; + band->data_ptr = ctx->frame_data + (get_bits_count(&ctx->gb) >> 3); + + result = decode_band_hdr(ctx, band, avctx); + if (result) { + av_log(avctx, AV_LOG_ERROR, "Error while decoding band header: %d\n", + result); + return -1; + } + + if (band->is_empty) { + av_log(avctx, AV_LOG_ERROR, "Empty band encountered!\n"); + return -1; + } + + band->rv_map = &ctx->rvmap_tabs[band->rvmap_sel]; + + /* apply corrections to the selected rvmap table if present */ + for (i = 0; i < band->num_corr; i++) { + idx1 = band->corr[i*2]; + idx2 = band->corr[i*2+1]; + FFSWAP(uint8_t, band->rv_map->runtab[idx1], band->rv_map->runtab[idx2]); + FFSWAP(int16_t, band->rv_map->valtab[idx1], band->rv_map->valtab[idx2]); + } + + pos = get_bits_count(&ctx->gb); + + for (t = 0; t < band->num_tiles; t++) { + tile = &band->tiles[t]; + + tile->is_empty = get_bits1(&ctx->gb); + if (tile->is_empty) { + ff_ivi_process_empty_tile(avctx, band, tile, + (ctx->planes[0].bands[0].mb_size >> 3) - (band->mb_size >> 3)); + } else { + tile->data_size = ff_ivi_dec_tile_data_size(&ctx->gb); + + result = decode_mb_info(ctx, band, tile, avctx); + if (result < 0) + break; + + result = ff_ivi_decode_blocks(&ctx->gb, band, tile); + if (result < 0 || (get_bits_count(&ctx->gb) - pos) >> 3 != tile->data_size) { + av_log(avctx, AV_LOG_ERROR, "Corrupted tile data encountered!\n"); + break; + } + pos += tile->data_size << 3; // skip to next tile + } + } + + /* restore the selected rvmap table by applying its corrections in reverse order */ + for (i = band->num_corr-1; i >= 0; i--) { + idx1 = band->corr[i*2]; + idx2 = band->corr[i*2+1]; + FFSWAP(uint8_t, band->rv_map->runtab[idx1], band->rv_map->runtab[idx2]); + FFSWAP(int16_t, band->rv_map->valtab[idx1], band->rv_map->valtab[idx2]); + } + +#if IVI_DEBUG + if (band->checksum_present) { + uint16_t chksum = ivi_calc_band_checksum(band); + if (chksum != band->checksum) { + av_log(avctx, AV_LOG_ERROR, + "Band checksum mismatch! Plane %d, band %d, received: %x, calculated: %x\n", + band->plane, band->band_num, band->checksum, chksum); + } + } +#endif + + align_get_bits(&ctx->gb); + + return result; +} + + +/** + * Switch buffers. + * + * @param[in,out] ctx ptr to the decoder context + */ +static void switch_buffers(IVI5DecContext *ctx) +{ + switch (ctx->prev_frame_type) { + case FRAMETYPE_INTRA: + case FRAMETYPE_INTER: + ctx->buf_switch ^= 1; + ctx->dst_buf = ctx->buf_switch; + ctx->ref_buf = ctx->buf_switch ^ 1; + break; + case FRAMETYPE_INTER_SCAL: + if (!ctx->inter_scal) { + ctx->ref2_buf = 2; + ctx->inter_scal = 1; + } + FFSWAP(int, ctx->dst_buf, ctx->ref2_buf); + ctx->ref_buf = ctx->ref2_buf; + break; + case FRAMETYPE_INTER_NOREF: + break; + } + + switch (ctx->frame_type) { + case FRAMETYPE_INTRA: + ctx->buf_switch = 0; + /* FALLTHROUGH */ + case FRAMETYPE_INTER: + ctx->inter_scal = 0; + ctx->dst_buf = ctx->buf_switch; + ctx->ref_buf = ctx->buf_switch ^ 1; + break; + case FRAMETYPE_INTER_SCAL: + case FRAMETYPE_INTER_NOREF: + case FRAMETYPE_NULL: + break; + } +} + + +/** + * Initialize Indeo5 decoder. + */ +static av_cold int decode_init(AVCodecContext *avctx) +{ + IVI5DecContext *ctx = avctx->priv_data; + int result; + + ff_ivi_init_static_vlc(); + + /* copy rvmap tables in our context so we can apply changes to them */ + memcpy(ctx->rvmap_tabs, ff_ivi_rvmap_tabs, sizeof(ff_ivi_rvmap_tabs)); + + /* set the initial picture layout according to the basic profile: + there is only one band per plane (no scalability), only one tile (no local decoding) + and picture format = YVU9 */ + ctx->pic_conf.pic_width = avctx->width; + ctx->pic_conf.pic_height = avctx->height; + ctx->pic_conf.chroma_width = (avctx->width + 3) >> 2; + ctx->pic_conf.chroma_height = (avctx->height + 3) >> 2; + ctx->pic_conf.tile_width = avctx->width; + ctx->pic_conf.tile_height = avctx->height; + ctx->pic_conf.luma_bands = ctx->pic_conf.chroma_bands = 1; + + result = ff_ivi_init_planes(ctx->planes, &ctx->pic_conf); + if (result) { + av_log(avctx, AV_LOG_ERROR, "Couldn't allocate color planes!\n"); + return -1; + } + + ctx->buf_switch = 0; + ctx->inter_scal = 0; + + avctx->pix_fmt = PIX_FMT_YUV410P; + + return 0; +} + + +/** + * main decoder function + */ +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, + AVPacket *avpkt) +{ + IVI5DecContext *ctx = avctx->priv_data; + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + int result, p, b; + + init_get_bits(&ctx->gb, buf, buf_size * 8); + ctx->frame_data = buf; + ctx->frame_size = buf_size; + + result = decode_pic_hdr(ctx, avctx); + if (result) { + av_log(avctx, AV_LOG_ERROR, + "Error while decoding picture header: %d\n", result); + return -1; + } + + if (ctx->gop_flags & IVI5_IS_PROTECTED) { + av_log(avctx, AV_LOG_ERROR, "Password-protected clip!\n"); + return -1; + } + + switch_buffers(ctx); + + //START_TIMER; + + if (ctx->frame_type != FRAMETYPE_NULL) { + for (p = 0; p < 3; p++) { + for (b = 0; b < ctx->planes[p].num_bands; b++) { + result = decode_band(ctx, p, &ctx->planes[p].bands[b], avctx); + if (result) { + av_log(avctx, AV_LOG_ERROR, + "Error while decoding band: %d, plane: %d\n", b, p); + return -1; + } + } + } + } + + //STOP_TIMER("decode_planes"); + + if (ctx->frame.data[0]) + avctx->release_buffer(avctx, &ctx->frame); + + ctx->frame.reference = 0; + if (avctx->get_buffer(avctx, &ctx->frame) < 0) { + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return -1; + } + + if (ctx->is_scalable) { + ff_ivi_recompose53 (&ctx->planes[0], ctx->frame.data[0], ctx->frame.linesize[0], 4); + } else { + ff_ivi_output_plane(&ctx->planes[0], ctx->frame.data[0], ctx->frame.linesize[0]); + } + + ff_ivi_output_plane(&ctx->planes[2], ctx->frame.data[1], ctx->frame.linesize[1]); + ff_ivi_output_plane(&ctx->planes[1], ctx->frame.data[2], ctx->frame.linesize[2]); + + *data_size = sizeof(AVFrame); + *(AVFrame*)data = ctx->frame; + + return buf_size; +} + + +/** + * Close Indeo5 decoder and clean up its context. + */ +static av_cold int decode_close(AVCodecContext *avctx) +{ + IVI5DecContext *ctx = avctx->priv_data; + + ff_ivi_free_buffers(&ctx->planes[0]); + + if (ctx->mb_vlc.cust_tab.table) + free_vlc(&ctx->mb_vlc.cust_tab); + + if (ctx->frame.data[0]) + avctx->release_buffer(avctx, &ctx->frame); + + return 0; +} + + +AVCodec ff_indeo5_decoder = { + .name = "indeo5", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_INDEO5, + .priv_data_size = sizeof(IVI5DecContext), + .init = decode_init, + .close = decode_close, + .decode = decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 5"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/indeo5data.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/indeo5data.h new file mode 100644 index 00000000..a6217d0b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/indeo5data.h @@ -0,0 +1,162 @@ +/* + * Indeo Video Interactive 5 compatible decoder + * Copyright (c) 2009 Maxim Poliakovski + * + * 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 + * This file contains data needed for the Indeo5 decoder. + */ + +#ifndef AVCODEC_INDEO5DATA_H +#define AVCODEC_INDEO5DATA_H + +#include + +/** + * standard picture dimensions (width, height divided by 4) + */ +static const uint8_t ivi5_common_pic_sizes[30] = { + 160, 120, 80, 60, 40, 30, 176, 120, 88, 60, 88, 72, 44, 36, 60, 45, 160, 60, + 176, 60, 20, 15, 22, 18, 0, 0, 0, 0, 0, 0 +}; + + +/** + * Indeo5 dequantization matrixes consist of two tables: base table + * and scale table. The base table defines the dequantization matrix + * itself and the scale table tells how this matrix should be scaled + * for a particular quant level (0...24). + * + * ivi5_base_quant_bbb_ttt - base tables for block size 'bbb' of type 'ttt' + * ivi5_scale_quant_bbb_ttt - scale tables for block size 'bbb' of type 'ttt' + */ +static const uint16_t ivi5_base_quant_8x8_inter[5][64] = { + {0x26, 0x3a, 0x3e, 0x46, 0x4a, 0x4e, 0x52, 0x5a, 0x3a, 0x3e, 0x42, 0x46, 0x4a, 0x4e, 0x56, 0x5e, + 0x3e, 0x42, 0x46, 0x48, 0x4c, 0x52, 0x5a, 0x62, 0x46, 0x46, 0x48, 0x4a, 0x4e, 0x56, 0x5e, 0x66, + 0x4a, 0x4a, 0x4c, 0x4e, 0x52, 0x5a, 0x62, 0x6a, 0x4e, 0x4e, 0x52, 0x56, 0x5a, 0x5e, 0x66, 0x6e, + 0x52, 0x56, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x72, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x6e, 0x72, 0x76, + }, + {0x26, 0x3a, 0x3e, 0x46, 0x4a, 0x4e, 0x52, 0x5a, 0x3a, 0x3e, 0x42, 0x46, 0x4a, 0x4e, 0x56, 0x5e, + 0x3e, 0x42, 0x46, 0x48, 0x4c, 0x52, 0x5a, 0x62, 0x46, 0x46, 0x48, 0x4a, 0x4e, 0x56, 0x5e, 0x66, + 0x4a, 0x4a, 0x4c, 0x4e, 0x52, 0x5a, 0x62, 0x6a, 0x4e, 0x4e, 0x52, 0x56, 0x5a, 0x5e, 0x66, 0x6e, + 0x52, 0x56, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x72, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x6e, 0x72, 0x76, + }, + {0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + }, + {0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, + 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, + 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, + }, + {0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + } +}; + +static const uint16_t ivi5_base_quant_8x8_intra[5][64] = { + {0x1a, 0x2e, 0x36, 0x42, 0x46, 0x4a, 0x4e, 0x5a, 0x2e, 0x32, 0x3e, 0x42, 0x46, 0x4e, 0x56, 0x6a, + 0x36, 0x3e, 0x3e, 0x44, 0x4a, 0x54, 0x66, 0x72, 0x42, 0x42, 0x44, 0x4a, 0x52, 0x62, 0x6c, 0x7a, + 0x46, 0x46, 0x4a, 0x52, 0x5e, 0x66, 0x72, 0x8e, 0x4a, 0x4e, 0x54, 0x62, 0x66, 0x6e, 0x86, 0xa6, + 0x4e, 0x56, 0x66, 0x6c, 0x72, 0x86, 0x9a, 0xca, 0x5a, 0x6a, 0x72, 0x7a, 0x8e, 0xa6, 0xca, 0xfe, + }, + {0x26, 0x3a, 0x3e, 0x46, 0x4a, 0x4e, 0x52, 0x5a, 0x3a, 0x3e, 0x42, 0x46, 0x4a, 0x4e, 0x56, 0x5e, + 0x3e, 0x42, 0x46, 0x48, 0x4c, 0x52, 0x5a, 0x62, 0x46, 0x46, 0x48, 0x4a, 0x4e, 0x56, 0x5e, 0x66, + 0x4a, 0x4a, 0x4c, 0x4e, 0x52, 0x5a, 0x62, 0x6a, 0x4e, 0x4e, 0x52, 0x56, 0x5a, 0x5e, 0x66, 0x6e, + 0x52, 0x56, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x72, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x6e, 0x72, 0x76, + }, + {0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + }, + {0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, + 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, + 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, + }, + {0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + } +}; + +static const uint16_t ivi5_base_quant_4x4_inter[16] = { + 0x1e, 0x3e, 0x4a, 0x52, 0x3e, 0x4a, 0x52, 0x56, 0x4a, 0x52, 0x56, 0x5e, 0x52, 0x56, 0x5e, 0x66 +}; + +static const uint16_t ivi5_base_quant_4x4_intra[16] = { + 0x1e, 0x3e, 0x4a, 0x52, 0x3e, 0x4a, 0x52, 0x5e, 0x4a, 0x52, 0x5e, 0x7a, 0x52, 0x5e, 0x7a, 0x92 +}; + + +static const uint8_t ivi5_scale_quant_8x8_inter[5][24] = { + {0x0b, 0x11, 0x13, 0x14, 0x15, 0x16, 0x18, 0x1a, 0x1b, 0x1d, 0x20, 0x22, + 0x23, 0x25, 0x28, 0x2a, 0x2e, 0x32, 0x35, 0x39, 0x3d, 0x41, 0x44, 0x4a, + }, + {0x07, 0x14, 0x16, 0x18, 0x1b, 0x1e, 0x22, 0x25, 0x29, 0x2d, 0x31, 0x35, + 0x3a, 0x3f, 0x44, 0x4a, 0x50, 0x56, 0x5c, 0x63, 0x6a, 0x71, 0x78, 0x7e, + }, + {0x15, 0x25, 0x28, 0x2d, 0x30, 0x34, 0x3a, 0x3d, 0x42, 0x48, 0x4c, 0x51, + 0x56, 0x5b, 0x60, 0x65, 0x6b, 0x70, 0x76, 0x7c, 0x82, 0x88, 0x8f, 0x97, + }, + {0x13, 0x1f, 0x20, 0x22, 0x25, 0x28, 0x2b, 0x2d, 0x30, 0x33, 0x36, 0x39, + 0x3c, 0x3f, 0x42, 0x45, 0x48, 0x4b, 0x4e, 0x52, 0x56, 0x5a, 0x5e, 0x62, + }, + {0x3c, 0x52, 0x58, 0x5d, 0x63, 0x68, 0x68, 0x6d, 0x73, 0x78, 0x7c, 0x80, + 0x84, 0x89, 0x8e, 0x93, 0x98, 0x9d, 0xa3, 0xa9, 0xad, 0xb1, 0xb5, 0xba, + }, +}; + +static const uint8_t ivi5_scale_quant_8x8_intra[5][24] = { + {0x0b, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x17, 0x18, 0x1a, 0x1c, 0x1e, 0x20, + 0x22, 0x24, 0x27, 0x28, 0x2a, 0x2d, 0x2f, 0x31, 0x34, 0x37, 0x39, 0x3c, + }, + {0x01, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1b, 0x1e, 0x22, 0x25, 0x28, 0x2c, + 0x30, 0x34, 0x38, 0x3d, 0x42, 0x47, 0x4c, 0x52, 0x58, 0x5e, 0x65, 0x6c, + }, + {0x13, 0x22, 0x27, 0x2a, 0x2d, 0x33, 0x36, 0x3c, 0x41, 0x45, 0x49, 0x4e, + 0x53, 0x58, 0x5d, 0x63, 0x69, 0x6f, 0x75, 0x7c, 0x82, 0x88, 0x8e, 0x95, + }, + {0x13, 0x1f, 0x21, 0x24, 0x27, 0x29, 0x2d, 0x2f, 0x34, 0x37, 0x3a, 0x3d, + 0x40, 0x44, 0x48, 0x4c, 0x4f, 0x52, 0x56, 0x5a, 0x5e, 0x62, 0x66, 0x6b, + }, + {0x31, 0x42, 0x47, 0x47, 0x4d, 0x52, 0x58, 0x58, 0x5d, 0x63, 0x67, 0x6b, + 0x6f, 0x73, 0x78, 0x7c, 0x80, 0x84, 0x89, 0x8e, 0x93, 0x98, 0x9d, 0xa4, + } +}; + +static const uint8_t ivi5_scale_quant_4x4_inter[24] = { + 0x0b, 0x0d, 0x0d, 0x0e, 0x11, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, +}; + +static const uint8_t ivi5_scale_quant_4x4_intra[24] = { + 0x01, 0x0b, 0x0b, 0x0d, 0x0d, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20 +}; + + +#endif /* AVCODEC_INDEO5DATA_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/intelh263dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/intelh263dec.c new file mode 100644 index 00000000..00b15ce3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/intelh263dec.c @@ -0,0 +1,131 @@ +/* + * H.263i decoder + * + * 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 + */ + +#include "mpegvideo.h" +#include "h263.h" + +/* don't understand why they choose a different header ! */ +int ff_intel_h263_decode_picture_header(MpegEncContext *s) +{ + int format; + + /* picture header */ + if (get_bits_long(&s->gb, 22) != 0x20) { + av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n"); + return -1; + } + s->picture_number = get_bits(&s->gb, 8); /* picture timestamp */ + + if (get_bits1(&s->gb) != 1) { + av_log(s->avctx, AV_LOG_ERROR, "Bad marker\n"); + return -1; /* marker */ + } + if (get_bits1(&s->gb) != 0) { + av_log(s->avctx, AV_LOG_ERROR, "Bad H263 id\n"); + return -1; /* h263 id */ + } + skip_bits1(&s->gb); /* split screen off */ + skip_bits1(&s->gb); /* camera off */ + skip_bits1(&s->gb); /* freeze picture release off */ + + format = get_bits(&s->gb, 3); + if (format != 7) { + av_log(s->avctx, AV_LOG_ERROR, "Intel H263 free format not supported\n"); + return -1; + } + s->h263_plus = 0; + + s->pict_type = FF_I_TYPE + get_bits1(&s->gb); + + s->unrestricted_mv = get_bits1(&s->gb); + s->h263_long_vectors = s->unrestricted_mv; + + if (get_bits1(&s->gb) != 0) { + av_log(s->avctx, AV_LOG_ERROR, "SAC not supported\n"); + return -1; /* SAC: off */ + } + s->obmc= get_bits1(&s->gb); + s->pb_frame = get_bits1(&s->gb); + + if(format == 7){ + format = get_bits(&s->gb, 3); + if(format == 0 || format == 7){ + av_log(s->avctx, AV_LOG_ERROR, "Wrong Intel H263 format\n"); + return -1; + } + if(get_bits(&s->gb, 2)) + av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n"); + s->loop_filter = get_bits1(&s->gb); + if(get_bits1(&s->gb)) + av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n"); + if(get_bits1(&s->gb)) + s->pb_frame = 2; + if(get_bits(&s->gb, 5)) + av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n"); + if(get_bits(&s->gb, 5) != 1) + av_log(s->avctx, AV_LOG_ERROR, "Invalid marker\n"); + } + if(format == 6){ + int ar = get_bits(&s->gb, 4); + skip_bits(&s->gb, 9); // display width + skip_bits1(&s->gb); + skip_bits(&s->gb, 9); // display height + if(ar == 15){ + skip_bits(&s->gb, 8); // aspect ratio - width + skip_bits(&s->gb, 8); // aspect ratio - height + } + } + + s->chroma_qscale= s->qscale = get_bits(&s->gb, 5); + skip_bits1(&s->gb); /* Continuous Presence Multipoint mode: off */ + + if(s->pb_frame){ + skip_bits(&s->gb, 3); //temporal reference for B-frame + skip_bits(&s->gb, 2); //dbquant + } + + /* PEI */ + while (get_bits1(&s->gb) != 0) { + skip_bits(&s->gb, 8); + } + s->f_code = 1; + + s->y_dc_scale_table= + s->c_dc_scale_table= ff_mpeg1_dc_scale_table; + + ff_h263_show_pict_info(s); + + return 0; +} + +AVCodec ff_h263i_decoder = { + "h263i", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_H263I, + sizeof(MpegEncContext), + ff_h263_decode_init, + NULL, + ff_h263_decode_end, + ff_h263_decode_frame, + CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("Intel H.263"), + .pix_fmts= ff_pixfmt_list_420, +}; + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/inverse.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/inverse.c new file mode 100644 index 00000000..04681d25 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/inverse.c @@ -0,0 +1 @@ +#include "libavutil/inverse.c" diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ituh263dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ituh263dec.c new file mode 100644 index 00000000..728019ac --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ituh263dec.c @@ -0,0 +1,1131 @@ +/* + * ITU H263 bitstream decoder + * Copyright (c) 2000,2001 Fabrice Bellard + * H263+ support. + * Copyright (c) 2001 Juan J. Sierralta P + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + * h263 decoder. + */ + +//#define DEBUG +#include + +#include "dsputil.h" +#include "avcodec.h" +#include "mpegvideo.h" +#include "h263.h" +#include "mathops.h" +#include "unary.h" +#include "flv.h" +#include "mpeg4video.h" + +//#undef NDEBUG +//#include + +// The defines below define the number of bits that are read at once for +// reading vlc values. Changing these may improve speed and data cache needs +// be aware though that decreasing them may need the number of stages that is +// passed to get_vlc* to be increased. +#define MV_VLC_BITS 9 +#define H263_MBTYPE_B_VLC_BITS 6 +#define CBPC_B_VLC_BITS 3 + +static const int h263_mb_type_b_map[15]= { + MB_TYPE_DIRECT2 | MB_TYPE_L0L1, + MB_TYPE_DIRECT2 | MB_TYPE_L0L1 | MB_TYPE_CBP, + MB_TYPE_DIRECT2 | MB_TYPE_L0L1 | MB_TYPE_CBP | MB_TYPE_QUANT, + MB_TYPE_L0 | MB_TYPE_16x16, + MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_16x16, + MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16, + MB_TYPE_L1 | MB_TYPE_16x16, + MB_TYPE_L1 | MB_TYPE_CBP | MB_TYPE_16x16, + MB_TYPE_L1 | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16, + MB_TYPE_L0L1 | MB_TYPE_16x16, + MB_TYPE_L0L1 | MB_TYPE_CBP | MB_TYPE_16x16, + MB_TYPE_L0L1 | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16, + 0, //stuffing + MB_TYPE_INTRA4x4 | MB_TYPE_CBP, + MB_TYPE_INTRA4x4 | MB_TYPE_CBP | MB_TYPE_QUANT, +}; + +void ff_h263_show_pict_info(MpegEncContext *s){ + if(s->avctx->debug&FF_DEBUG_PICT_INFO){ + av_log(s->avctx, AV_LOG_DEBUG, "qp:%d %c size:%d rnd:%d%s%s%s%s%s%s%s%s%s %d/%d\n", + s->qscale, av_get_pict_type_char(s->pict_type), + s->gb.size_in_bits, 1-s->no_rounding, + s->obmc ? " AP" : "", + s->umvplus ? " UMV" : "", + s->h263_long_vectors ? " LONG" : "", + s->h263_plus ? " +" : "", + s->h263_aic ? " AIC" : "", + s->alt_inter_vlc ? " AIV" : "", + s->modified_quant ? " MQ" : "", + s->loop_filter ? " LOOP" : "", + s->h263_slice_structured ? " SS" : "", + s->avctx->time_base.den, s->avctx->time_base.num + ); + } +} + +/***********************************************/ +/* decoding */ + +VLC ff_h263_intra_MCBPC_vlc; +VLC ff_h263_inter_MCBPC_vlc; +VLC ff_h263_cbpy_vlc; +static VLC mv_vlc; +static VLC h263_mbtype_b_vlc; +static VLC cbpc_b_vlc; + +/* init vlcs */ + +/* XXX: find a better solution to handle static init */ +void h263_decode_init_vlc(MpegEncContext *s) +{ + static int done = 0; + + if (!done) { + done = 1; + + INIT_VLC_STATIC(&ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9, + ff_h263_intra_MCBPC_bits, 1, 1, + ff_h263_intra_MCBPC_code, 1, 1, 72); + INIT_VLC_STATIC(&ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28, + ff_h263_inter_MCBPC_bits, 1, 1, + ff_h263_inter_MCBPC_code, 1, 1, 198); + INIT_VLC_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16, + &ff_h263_cbpy_tab[0][1], 2, 1, + &ff_h263_cbpy_tab[0][0], 2, 1, 64); + INIT_VLC_STATIC(&mv_vlc, MV_VLC_BITS, 33, + &mvtab[0][1], 2, 1, + &mvtab[0][0], 2, 1, 538); + init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]); + init_rl(&rl_intra_aic, ff_h263_static_rl_table_store[1]); + INIT_VLC_RL(ff_h263_rl_inter, 554); + INIT_VLC_RL(rl_intra_aic, 554); + INIT_VLC_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15, + &h263_mbtype_b_tab[0][1], 2, 1, + &h263_mbtype_b_tab[0][0], 2, 1, 80); + INIT_VLC_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4, + &cbpc_b_tab[0][1], 2, 1, + &cbpc_b_tab[0][0], 2, 1, 8); + } +} + +int ff_h263_decode_mba(MpegEncContext *s) +{ + int i, mb_pos; + + for(i=0; i<6; i++){ + if(s->mb_num-1 <= ff_mba_max[i]) break; + } + mb_pos= get_bits(&s->gb, ff_mba_length[i]); + s->mb_x= mb_pos % s->mb_width; + s->mb_y= mb_pos / s->mb_width; + + return mb_pos; +} + +/** + * decodes the group of blocks header or slice header. + * @return <0 if an error occurred + */ +static int h263_decode_gob_header(MpegEncContext *s) +{ + unsigned int val, gfid, gob_number; + int left; + + /* Check for GOB Start Code */ + val = show_bits(&s->gb, 16); + if(val) + return -1; + + /* We have a GBSC probably with GSTUFF */ + skip_bits(&s->gb, 16); /* Drop the zeros */ + left= get_bits_left(&s->gb); + //MN: we must check the bits left or we might end in a infinite loop (or segfault) + for(;left>13; left--){ + if(get_bits1(&s->gb)) break; /* Seek the '1' bit */ + } + if(left<=13) + return -1; + + if(s->h263_slice_structured){ + if(get_bits1(&s->gb)==0) + return -1; + + ff_h263_decode_mba(s); + + if(s->mb_num > 1583) + if(get_bits1(&s->gb)==0) + return -1; + + s->qscale = get_bits(&s->gb, 5); /* SQUANT */ + if(get_bits1(&s->gb)==0) + return -1; + gfid = get_bits(&s->gb, 2); /* GFID */ + }else{ + gob_number = get_bits(&s->gb, 5); /* GN */ + s->mb_x= 0; + s->mb_y= s->gob_index* gob_number; + gfid = get_bits(&s->gb, 2); /* GFID */ + s->qscale = get_bits(&s->gb, 5); /* GQUANT */ + } + + if(s->mb_y >= s->mb_height) + return -1; + + if(s->qscale==0) + return -1; + + return 0; +} + +/** + * finds the next resync_marker + * @param p pointer to buffer to scan + * @param end pointer to the end of the buffer + * @return pointer to the next resync_marker, or end if none was found + */ +const uint8_t *ff_h263_find_resync_marker(const uint8_t *restrict p, const uint8_t * restrict end) +{ + assert(p < end); + + end-=2; + p++; + for(;pcodec_id==CODEC_ID_MPEG4){ + skip_bits1(&s->gb); + align_get_bits(&s->gb); + } + + if(show_bits(&s->gb, 16)==0){ + pos= get_bits_count(&s->gb); + if(CONFIG_MPEG4_DECODER && s->codec_id==CODEC_ID_MPEG4) + ret= mpeg4_decode_video_packet_header(s); + else + ret= h263_decode_gob_header(s); + if(ret>=0) + return pos; + } + //OK, it's not where it is supposed to be ... + s->gb= s->last_resync_gb; + align_get_bits(&s->gb); + left= get_bits_left(&s->gb); + + for(;left>16+1+5+5; left-=8){ + if(show_bits(&s->gb, 16)==0){ + GetBitContext bak= s->gb; + + pos= get_bits_count(&s->gb); + if(CONFIG_MPEG4_DECODER && s->codec_id==CODEC_ID_MPEG4) + ret= mpeg4_decode_video_packet_header(s); + else + ret= h263_decode_gob_header(s); + if(ret>=0) + return pos; + + s->gb= bak; + } + skip_bits(&s->gb, 8); + } + + return -1; +} + +int h263_decode_motion(MpegEncContext * s, int pred, int f_code) +{ + int code, val, sign, shift, l; + code = get_vlc2(&s->gb, mv_vlc.table, MV_VLC_BITS, 2); + + if (code == 0) + return pred; + if (code < 0) + return 0xffff; + + sign = get_bits1(&s->gb); + shift = f_code - 1; + val = code; + if (shift) { + val = (val - 1) << shift; + val |= get_bits(&s->gb, shift); + val++; + } + if (sign) + val = -val; + val += pred; + + /* modulo decoding */ + if (!s->h263_long_vectors) { + l = INT_BIT - 5 - f_code; + val = (val<>l; + } else { + /* horrible h263 long vector mode */ + if (pred < -31 && val < -63) + val += 64; + if (pred > 32 && val > 63) + val -= 64; + + } + return val; +} + + +/* Decodes RVLC of H.263+ UMV */ +static int h263p_decode_umotion(MpegEncContext * s, int pred) +{ + int code = 0, sign; + + if (get_bits1(&s->gb)) /* Motion difference = 0 */ + return pred; + + code = 2 + get_bits1(&s->gb); + + while (get_bits1(&s->gb)) + { + code <<= 1; + code += get_bits1(&s->gb); + } + sign = code & 1; + code >>= 1; + + code = (sign) ? (pred - code) : (pred + code); + av_dlog(s->avctx,"H.263+ UMV Motion = %d\n", code); + return code; + +} + +/** + * read the next MVs for OBMC. yes this is a ugly hack, feel free to send a patch :) + */ +static void preview_obmc(MpegEncContext *s){ + GetBitContext gb= s->gb; + + int cbpc, i, pred_x, pred_y, mx, my; + int16_t *mot_val; + const int xy= s->mb_x + 1 + s->mb_y * s->mb_stride; + const int stride= s->b8_stride*2; + + for(i=0; i<4; i++) + s->block_index[i]+= 2; + for(i=4; i<6; i++) + s->block_index[i]+= 1; + s->mb_x++; + + assert(s->pict_type == FF_P_TYPE); + + do{ + if (get_bits1(&s->gb)) { + /* skip mb */ + mot_val = s->current_picture.motion_val[0][ s->block_index[0] ]; + mot_val[0 ]= mot_val[2 ]= + mot_val[0+stride]= mot_val[2+stride]= 0; + mot_val[1 ]= mot_val[3 ]= + mot_val[1+stride]= mot_val[3+stride]= 0; + + s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + goto end; + } + cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); + }while(cbpc == 20); + + if(cbpc & 4){ + s->current_picture.mb_type[xy]= MB_TYPE_INTRA; + }else{ + get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); + if (cbpc & 8) { + if(s->modified_quant){ + if(get_bits1(&s->gb)) skip_bits(&s->gb, 1); + else skip_bits(&s->gb, 5); + }else + skip_bits(&s->gb, 2); + } + + if ((cbpc & 16) == 0) { + s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0; + /* 16x16 motion prediction */ + mot_val= h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + if (s->umvplus) + mx = h263p_decode_umotion(s, pred_x); + else + mx = h263_decode_motion(s, pred_x, 1); + + if (s->umvplus) + my = h263p_decode_umotion(s, pred_y); + else + my = h263_decode_motion(s, pred_y, 1); + + mot_val[0 ]= mot_val[2 ]= + mot_val[0+stride]= mot_val[2+stride]= mx; + mot_val[1 ]= mot_val[3 ]= + mot_val[1+stride]= mot_val[3+stride]= my; + } else { + s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0; + for(i=0;i<4;i++) { + mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y); + if (s->umvplus) + mx = h263p_decode_umotion(s, pred_x); + else + mx = h263_decode_motion(s, pred_x, 1); + + if (s->umvplus) + my = h263p_decode_umotion(s, pred_y); + else + my = h263_decode_motion(s, pred_y, 1); + if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1) + skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */ + mot_val[0] = mx; + mot_val[1] = my; + } + } + } +end: + + for(i=0; i<4; i++) + s->block_index[i]-= 2; + for(i=4; i<6; i++) + s->block_index[i]-= 1; + s->mb_x--; + + s->gb= gb; +} + +static void h263_decode_dquant(MpegEncContext *s){ + static const int8_t quant_tab[4] = { -1, -2, 1, 2 }; + + if(s->modified_quant){ + if(get_bits1(&s->gb)) + s->qscale= modified_quant_tab[get_bits1(&s->gb)][ s->qscale ]; + else + s->qscale= get_bits(&s->gb, 5); + }else + s->qscale += quant_tab[get_bits(&s->gb, 2)]; + ff_set_qscale(s, s->qscale); +} + +static int h263_decode_block(MpegEncContext * s, DCTELEM * block, + int n, int coded) +{ + int code, level, i, j, last, run; + RLTable *rl = &ff_h263_rl_inter; + const uint8_t *scan_table; + GetBitContext gb= s->gb; + + scan_table = s->intra_scantable.permutated; + if (s->h263_aic && s->mb_intra) { + rl = &rl_intra_aic; + i = 0; + if (s->ac_pred) { + if (s->h263_aic_dir) + scan_table = s->intra_v_scantable.permutated; /* left */ + else + scan_table = s->intra_h_scantable.permutated; /* top */ + } + } else if (s->mb_intra) { + /* DC coef */ + if(s->codec_id == CODEC_ID_RV10){ +#if CONFIG_RV10_DECODER + if (s->rv10_version == 3 && s->pict_type == FF_I_TYPE) { + int component, diff; + component = (n <= 3 ? 0 : n - 4 + 1); + level = s->last_dc[component]; + if (s->rv10_first_dc_coded[component]) { + diff = rv_decode_dc(s, n); + if (diff == 0xffff) + return -1; + level += diff; + level = level & 0xff; /* handle wrap round */ + s->last_dc[component] = level; + } else { + s->rv10_first_dc_coded[component] = 1; + } + } else { + level = get_bits(&s->gb, 8); + if (level == 255) + level = 128; + } +#endif + }else{ + level = get_bits(&s->gb, 8); + if((level&0x7F) == 0){ + av_log(s->avctx, AV_LOG_ERROR, "illegal dc %d at %d %d\n", level, s->mb_x, s->mb_y); + if(s->error_recognition >= FF_ER_COMPLIANT) + return -1; + } + if (level == 255) + level = 128; + } + block[0] = level; + i = 1; + } else { + i = 0; + } + if (!coded) { + if (s->mb_intra && s->h263_aic) + goto not_coded; + s->block_last_index[n] = i - 1; + return 0; + } +retry: + for(;;) { + code = get_vlc2(&s->gb, rl->vlc.table, TEX_VLC_BITS, 2); + if (code < 0){ + av_log(s->avctx, AV_LOG_ERROR, "illegal ac vlc code at %dx%d\n", s->mb_x, s->mb_y); + return -1; + } + if (code == rl->n) { + /* escape */ + if (CONFIG_FLV_DECODER && s->h263_flv > 1) { + ff_flv2_decode_ac_esc(&s->gb, &level, &run, &last); + } else { + last = get_bits1(&s->gb); + run = get_bits(&s->gb, 6); + level = (int8_t)get_bits(&s->gb, 8); + if(level == -128){ + if (s->codec_id == CODEC_ID_RV10) { + /* XXX: should patch encoder too */ + level = get_sbits(&s->gb, 12); + }else{ + level = get_bits(&s->gb, 5); + level |= get_sbits(&s->gb, 6)<<5; + } + } + } + } else { + run = rl->table_run[code]; + level = rl->table_level[code]; + last = code >= rl->last; + if (get_bits1(&s->gb)) + level = -level; + } + i += run; + if (i >= 64){ + if(s->alt_inter_vlc && rl == &ff_h263_rl_inter && !s->mb_intra){ + //Looks like a hack but no, it's the way it is supposed to work ... + rl = &rl_intra_aic; + i = 0; + s->gb= gb; + s->dsp.clear_block(block); + goto retry; + } + av_log(s->avctx, AV_LOG_ERROR, "run overflow at %dx%d i:%d\n", s->mb_x, s->mb_y, s->mb_intra); + return -1; + } + j = scan_table[i]; + block[j] = level; + if (last) + break; + i++; + } +not_coded: + if (s->mb_intra && s->h263_aic) { + h263_pred_acdc(s, block, n); + i = 63; + } + s->block_last_index[n] = i; + return 0; +} + +static int h263_skip_b_part(MpegEncContext *s, int cbp) +{ + LOCAL_ALIGNED_16(DCTELEM, dblock, [64]); + int i, mbi; + + /* we have to set s->mb_intra to zero to decode B-part of PB-frame correctly + * but real value should be restored in order to be used later (in OBMC condition) + */ + mbi = s->mb_intra; + s->mb_intra = 0; + for (i = 0; i < 6; i++) { + if (h263_decode_block(s, dblock, i, cbp&32) < 0) + return -1; + cbp+=cbp; + } + s->mb_intra = mbi; + return 0; +} + +static int h263_get_modb(GetBitContext *gb, int pb_frame, int *cbpb) +{ + int c, mv = 1; + + if (pb_frame < 3) { // h.263 Annex G and i263 PB-frame + c = get_bits1(gb); + if (pb_frame == 2 && c) + mv = !get_bits1(gb); + } else { // h.263 Annex M improved PB-frame + mv = get_unary(gb, 0, 4) + 1; + c = mv & 1; + mv = !!(mv & 2); + } + if(c) + *cbpb = get_bits(gb, 6); + return mv; +} + +int ff_h263_decode_mb(MpegEncContext *s, + DCTELEM block[6][64]) +{ + int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; + int16_t *mot_val; + const int xy= s->mb_x + s->mb_y * s->mb_stride; + int cbpb = 0, pb_mv_count = 0; + + assert(!s->h263_pred); + + if (s->pict_type == FF_P_TYPE) { + do{ + if (get_bits1(&s->gb)) { + /* skip mb */ + s->mb_intra = 0; + for(i=0;i<6;i++) + s->block_last_index[i] = -1; + s->mv_dir = MV_DIR_FORWARD; + s->mv_type = MV_TYPE_16X16; + s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + s->mv[0][0][0] = 0; + s->mv[0][0][1] = 0; + s->mb_skipped = !(s->obmc | s->loop_filter); + goto end; + } + cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); + if (cbpc < 0){ + av_log(s->avctx, AV_LOG_ERROR, "cbpc damaged at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + }while(cbpc == 20); + + s->dsp.clear_blocks(s->block[0]); + + dquant = cbpc & 8; + s->mb_intra = ((cbpc & 4) != 0); + if (s->mb_intra) goto intra; + + if(s->pb_frame && get_bits1(&s->gb)) + pb_mv_count = h263_get_modb(&s->gb, s->pb_frame, &cbpb); + cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); + + if(s->alt_inter_vlc==0 || (cbpc & 3)!=3) + cbpy ^= 0xF; + + cbp = (cbpc & 3) | (cbpy << 2); + if (dquant) { + h263_decode_dquant(s); + } + + s->mv_dir = MV_DIR_FORWARD; + if ((cbpc & 16) == 0) { + s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0; + /* 16x16 motion prediction */ + s->mv_type = MV_TYPE_16X16; + h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + if (s->umvplus) + mx = h263p_decode_umotion(s, pred_x); + else + mx = h263_decode_motion(s, pred_x, 1); + + if (mx >= 0xffff) + return -1; + + if (s->umvplus) + my = h263p_decode_umotion(s, pred_y); + else + my = h263_decode_motion(s, pred_y, 1); + + if (my >= 0xffff) + return -1; + s->mv[0][0][0] = mx; + s->mv[0][0][1] = my; + + if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1) + skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */ + } else { + s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0; + s->mv_type = MV_TYPE_8X8; + for(i=0;i<4;i++) { + mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y); + if (s->umvplus) + mx = h263p_decode_umotion(s, pred_x); + else + mx = h263_decode_motion(s, pred_x, 1); + if (mx >= 0xffff) + return -1; + + if (s->umvplus) + my = h263p_decode_umotion(s, pred_y); + else + my = h263_decode_motion(s, pred_y, 1); + if (my >= 0xffff) + return -1; + s->mv[0][i][0] = mx; + s->mv[0][i][1] = my; + if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1) + skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */ + mot_val[0] = mx; + mot_val[1] = my; + } + } + } else if(s->pict_type==FF_B_TYPE) { + int mb_type; + const int stride= s->b8_stride; + int16_t *mot_val0 = s->current_picture.motion_val[0][ 2*(s->mb_x + s->mb_y*stride) ]; + int16_t *mot_val1 = s->current_picture.motion_val[1][ 2*(s->mb_x + s->mb_y*stride) ]; +// const int mv_xy= s->mb_x + 1 + s->mb_y * s->mb_stride; + + //FIXME ugly + mot_val0[0 ]= mot_val0[2 ]= mot_val0[0+2*stride]= mot_val0[2+2*stride]= + mot_val0[1 ]= mot_val0[3 ]= mot_val0[1+2*stride]= mot_val0[3+2*stride]= + mot_val1[0 ]= mot_val1[2 ]= mot_val1[0+2*stride]= mot_val1[2+2*stride]= + mot_val1[1 ]= mot_val1[3 ]= mot_val1[1+2*stride]= mot_val1[3+2*stride]= 0; + + do{ + mb_type= get_vlc2(&s->gb, h263_mbtype_b_vlc.table, H263_MBTYPE_B_VLC_BITS, 2); + if (mb_type < 0){ + av_log(s->avctx, AV_LOG_ERROR, "b mb_type damaged at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + + mb_type= h263_mb_type_b_map[ mb_type ]; + }while(!mb_type); + + s->mb_intra = IS_INTRA(mb_type); + if(HAS_CBP(mb_type)){ + s->dsp.clear_blocks(s->block[0]); + cbpc = get_vlc2(&s->gb, cbpc_b_vlc.table, CBPC_B_VLC_BITS, 1); + if(s->mb_intra){ + dquant = IS_QUANT(mb_type); + goto intra; + } + + cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); + + if (cbpy < 0){ + av_log(s->avctx, AV_LOG_ERROR, "b cbpy damaged at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + + if(s->alt_inter_vlc==0 || (cbpc & 3)!=3) + cbpy ^= 0xF; + + cbp = (cbpc & 3) | (cbpy << 2); + }else + cbp=0; + + assert(!s->mb_intra); + + if(IS_QUANT(mb_type)){ + h263_decode_dquant(s); + } + + if(IS_DIRECT(mb_type)){ + s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT; + mb_type |= ff_mpeg4_set_direct_mv(s, 0, 0); + }else{ + s->mv_dir = 0; + s->mv_type= MV_TYPE_16X16; +//FIXME UMV + + if(USES_LIST(mb_type, 0)){ + int16_t *mot_val= h263_pred_motion(s, 0, 0, &mx, &my); + s->mv_dir = MV_DIR_FORWARD; + + mx = h263_decode_motion(s, mx, 1); + my = h263_decode_motion(s, my, 1); + + s->mv[0][0][0] = mx; + s->mv[0][0][1] = my; + mot_val[0 ]= mot_val[2 ]= mot_val[0+2*stride]= mot_val[2+2*stride]= mx; + mot_val[1 ]= mot_val[3 ]= mot_val[1+2*stride]= mot_val[3+2*stride]= my; + } + + if(USES_LIST(mb_type, 1)){ + int16_t *mot_val= h263_pred_motion(s, 0, 1, &mx, &my); + s->mv_dir |= MV_DIR_BACKWARD; + + mx = h263_decode_motion(s, mx, 1); + my = h263_decode_motion(s, my, 1); + + s->mv[1][0][0] = mx; + s->mv[1][0][1] = my; + mot_val[0 ]= mot_val[2 ]= mot_val[0+2*stride]= mot_val[2+2*stride]= mx; + mot_val[1 ]= mot_val[3 ]= mot_val[1+2*stride]= mot_val[3+2*stride]= my; + } + } + + s->current_picture.mb_type[xy]= mb_type; + } else { /* I-Frame */ + do{ + cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2); + if (cbpc < 0){ + av_log(s->avctx, AV_LOG_ERROR, "I cbpc damaged at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + }while(cbpc == 8); + + s->dsp.clear_blocks(s->block[0]); + + dquant = cbpc & 4; + s->mb_intra = 1; +intra: + s->current_picture.mb_type[xy]= MB_TYPE_INTRA; + if (s->h263_aic) { + s->ac_pred = get_bits1(&s->gb); + if(s->ac_pred){ + s->current_picture.mb_type[xy]= MB_TYPE_INTRA | MB_TYPE_ACPRED; + + s->h263_aic_dir = get_bits1(&s->gb); + } + }else + s->ac_pred = 0; + + if(s->pb_frame && get_bits1(&s->gb)) + pb_mv_count = h263_get_modb(&s->gb, s->pb_frame, &cbpb); + cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); + if(cbpy<0){ + av_log(s->avctx, AV_LOG_ERROR, "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + cbp = (cbpc & 3) | (cbpy << 2); + if (dquant) { + h263_decode_dquant(s); + } + + pb_mv_count += !!s->pb_frame; + } + + while(pb_mv_count--){ + h263_decode_motion(s, 0, 1); + h263_decode_motion(s, 0, 1); + } + + /* decode each block */ + for (i = 0; i < 6; i++) { + if (h263_decode_block(s, block[i], i, cbp&32) < 0) + return -1; + cbp+=cbp; + } + + if(s->pb_frame && h263_skip_b_part(s, cbpb) < 0) + return -1; + if(s->obmc && !s->mb_intra){ + if(s->pict_type == FF_P_TYPE && s->mb_x+1mb_width && s->mb_num_left != 1) + preview_obmc(s); + } +end: + + /* per-MB end of slice check */ + { + int v= show_bits(&s->gb, 16); + + if(get_bits_count(&s->gb) + 16 > s->gb.size_in_bits){ + v>>= get_bits_count(&s->gb) + 16 - s->gb.size_in_bits; + } + + if(v==0) + return SLICE_END; + } + + return SLICE_OK; +} + +/* most is hardcoded. should extend to handle all h263 streams */ +int h263_decode_picture_header(MpegEncContext *s) +{ + int format, width, height, i; + uint32_t startcode; + + align_get_bits(&s->gb); + + startcode= get_bits(&s->gb, 22-8); + + for(i= get_bits_left(&s->gb); i>24; i-=8) { + startcode = ((startcode << 8) | get_bits(&s->gb, 8)) & 0x003FFFFF; + + if(startcode == 0x20) + break; + } + + if (startcode != 0x20) { + av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n"); + return -1; + } + /* temporal reference */ + i = get_bits(&s->gb, 8); /* picture timestamp */ + if( (s->picture_number&~0xFF)+i < s->picture_number) + i+= 256; + s->current_picture_ptr->pts= + s->picture_number= (s->picture_number&~0xFF) + i; + + /* PTYPE starts here */ + if (get_bits1(&s->gb) != 1) { + /* marker */ + av_log(s->avctx, AV_LOG_ERROR, "Bad marker\n"); + return -1; + } + if (get_bits1(&s->gb) != 0) { + av_log(s->avctx, AV_LOG_ERROR, "Bad H263 id\n"); + return -1; /* h263 id */ + } + skip_bits1(&s->gb); /* split screen off */ + skip_bits1(&s->gb); /* camera off */ + skip_bits1(&s->gb); /* freeze picture release off */ + + format = get_bits(&s->gb, 3); + /* + 0 forbidden + 1 sub-QCIF + 10 QCIF + 7 extended PTYPE (PLUSPTYPE) + */ + + if (format != 7 && format != 6) { + s->h263_plus = 0; + /* H.263v1 */ + width = h263_format[format][0]; + height = h263_format[format][1]; + if (!width) + return -1; + + s->pict_type = FF_I_TYPE + get_bits1(&s->gb); + + s->h263_long_vectors = get_bits1(&s->gb); + + if (get_bits1(&s->gb) != 0) { + av_log(s->avctx, AV_LOG_ERROR, "H263 SAC not supported\n"); + return -1; /* SAC: off */ + } + s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */ + s->unrestricted_mv = s->h263_long_vectors || s->obmc; + + s->pb_frame = get_bits1(&s->gb); + s->chroma_qscale= s->qscale = get_bits(&s->gb, 5); + skip_bits1(&s->gb); /* Continuous Presence Multipoint mode: off */ + + s->width = width; + s->height = height; + s->avctx->sample_aspect_ratio= (AVRational){12,11}; + s->avctx->time_base= (AVRational){1001, 30000}; + } else { + int ufep; + + /* H.263v2 */ + s->h263_plus = 1; + ufep = get_bits(&s->gb, 3); /* Update Full Extended PTYPE */ + + /* ufep other than 0 and 1 are reserved */ + if (ufep == 1) { + /* OPPTYPE */ + format = get_bits(&s->gb, 3); + av_dlog(s->avctx, "ufep=1, format: %d\n", format); + s->custom_pcf= get_bits1(&s->gb); + s->umvplus = get_bits1(&s->gb); /* Unrestricted Motion Vector */ + if (get_bits1(&s->gb) != 0) { + av_log(s->avctx, AV_LOG_ERROR, "Syntax-based Arithmetic Coding (SAC) not supported\n"); + } + s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */ + s->h263_aic = get_bits1(&s->gb); /* Advanced Intra Coding (AIC) */ + s->loop_filter= get_bits1(&s->gb); + s->unrestricted_mv = s->umvplus || s->obmc || s->loop_filter; + + s->h263_slice_structured= get_bits1(&s->gb); + if (get_bits1(&s->gb) != 0) { + av_log(s->avctx, AV_LOG_ERROR, "Reference Picture Selection not supported\n"); + } + if (get_bits1(&s->gb) != 0) { + av_log(s->avctx, AV_LOG_ERROR, "Independent Segment Decoding not supported\n"); + } + s->alt_inter_vlc= get_bits1(&s->gb); + s->modified_quant= get_bits1(&s->gb); + if(s->modified_quant) + s->chroma_qscale_table= ff_h263_chroma_qscale_table; + + skip_bits(&s->gb, 1); /* Prevent start code emulation */ + + skip_bits(&s->gb, 3); /* Reserved */ + } else if (ufep != 0) { + av_log(s->avctx, AV_LOG_ERROR, "Bad UFEP type (%d)\n", ufep); + return -1; + } + + /* MPPTYPE */ + s->pict_type = get_bits(&s->gb, 3); + switch(s->pict_type){ + case 0: s->pict_type= FF_I_TYPE;break; + case 1: s->pict_type= FF_P_TYPE;break; + case 2: s->pict_type= FF_P_TYPE;s->pb_frame = 3;break; + case 3: s->pict_type= FF_B_TYPE;break; + case 7: s->pict_type= FF_I_TYPE;break; //ZYGO + default: + return -1; + } + skip_bits(&s->gb, 2); + s->no_rounding = get_bits1(&s->gb); + skip_bits(&s->gb, 4); + + /* Get the picture dimensions */ + if (ufep) { + if (format == 6) { + /* Custom Picture Format (CPFMT) */ + s->aspect_ratio_info = get_bits(&s->gb, 4); + av_dlog(s->avctx, "aspect: %d\n", s->aspect_ratio_info); + /* aspect ratios: + 0 - forbidden + 1 - 1:1 + 2 - 12:11 (CIF 4:3) + 3 - 10:11 (525-type 4:3) + 4 - 16:11 (CIF 16:9) + 5 - 40:33 (525-type 16:9) + 6-14 - reserved + */ + width = (get_bits(&s->gb, 9) + 1) * 4; + skip_bits1(&s->gb); + height = get_bits(&s->gb, 9) * 4; + av_dlog(s->avctx, "\nH.263+ Custom picture: %dx%d\n",width,height); + if (s->aspect_ratio_info == FF_ASPECT_EXTENDED) { + /* aspected dimensions */ + s->avctx->sample_aspect_ratio.num= get_bits(&s->gb, 8); + s->avctx->sample_aspect_ratio.den= get_bits(&s->gb, 8); + }else{ + s->avctx->sample_aspect_ratio= ff_h263_pixel_aspect[s->aspect_ratio_info]; + } + } else { + width = h263_format[format][0]; + height = h263_format[format][1]; + s->avctx->sample_aspect_ratio= (AVRational){12,11}; + } + if ((width == 0) || (height == 0)) + return -1; + s->width = width; + s->height = height; + + if(s->custom_pcf){ + int gcd; + s->avctx->time_base.den= 1800000; + s->avctx->time_base.num= 1000 + get_bits1(&s->gb); + s->avctx->time_base.num*= get_bits(&s->gb, 7); + if(s->avctx->time_base.num == 0){ + av_log(s, AV_LOG_ERROR, "zero framerate\n"); + return -1; + } + gcd= av_gcd(s->avctx->time_base.den, s->avctx->time_base.num); + s->avctx->time_base.den /= gcd; + s->avctx->time_base.num /= gcd; + }else{ + s->avctx->time_base= (AVRational){1001, 30000}; + } + } + + if(s->custom_pcf){ + skip_bits(&s->gb, 2); //extended Temporal reference + } + + if (ufep) { + if (s->umvplus) { + if(get_bits1(&s->gb)==0) /* Unlimited Unrestricted Motion Vectors Indicator (UUI) */ + skip_bits1(&s->gb); + } + if(s->h263_slice_structured){ + if (get_bits1(&s->gb) != 0) { + av_log(s->avctx, AV_LOG_ERROR, "rectangular slices not supported\n"); + } + if (get_bits1(&s->gb) != 0) { + av_log(s->avctx, AV_LOG_ERROR, "unordered slices not supported\n"); + } + } + } + + s->qscale = get_bits(&s->gb, 5); + } + + s->mb_width = (s->width + 15) / 16; + s->mb_height = (s->height + 15) / 16; + s->mb_num = s->mb_width * s->mb_height; + + if (s->pb_frame) { + skip_bits(&s->gb, 3); /* Temporal reference for B-pictures */ + if (s->custom_pcf) + skip_bits(&s->gb, 2); //extended Temporal reference + skip_bits(&s->gb, 2); /* Quantization information for B-pictures */ + } + + /* PEI */ + while (get_bits1(&s->gb) != 0) { + skip_bits(&s->gb, 8); + } + + if(s->h263_slice_structured){ + if (get_bits1(&s->gb) != 1) { + av_log(s->avctx, AV_LOG_ERROR, "SEPB1 marker missing\n"); + return -1; + } + + ff_h263_decode_mba(s); + + if (get_bits1(&s->gb) != 1) { + av_log(s->avctx, AV_LOG_ERROR, "SEPB2 marker missing\n"); + return -1; + } + } + s->f_code = 1; + + if(s->h263_aic){ + s->y_dc_scale_table= + s->c_dc_scale_table= ff_aic_dc_scale_table; + }else{ + s->y_dc_scale_table= + s->c_dc_scale_table= ff_mpeg1_dc_scale_table; + } + + ff_h263_show_pict_info(s); + if (s->pict_type == FF_I_TYPE && s->codec_tag == AV_RL32("ZYGO")){ + int i,j; + for(i=0; i<85; i++) av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb)); + av_log(s->avctx, AV_LOG_DEBUG, "\n"); + for(i=0; i<13; i++){ + for(j=0; j<3; j++){ + int v= get_bits(&s->gb, 8); + v |= get_sbits(&s->gb, 8)<<8; + av_log(s->avctx, AV_LOG_DEBUG, " %5d", v); + } + av_log(s->avctx, AV_LOG_DEBUG, "\n"); + } + for(i=0; i<50; i++) av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb)); + } + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ituh263enc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ituh263enc.c new file mode 100644 index 00000000..6a84636e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ituh263enc.c @@ -0,0 +1,842 @@ +/* + * ITU H263 bitstream encoder + * Copyright (c) 2000,2001 Fabrice Bellard + * H263+ support. + * Copyright (c) 2001 Juan J. Sierralta P + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + * h263 bitstream encoder. + */ + +//#define DEBUG +#include + +#include "dsputil.h" +#include "avcodec.h" +#include "mpegvideo.h" +#include "h263.h" +#include "mathops.h" +#include "unary.h" +#include "flv.h" +#include "mpeg4video.h" +#include "internal.h" + +//#undef NDEBUG +//#include + +/** + * Table of number of bits a motion vector component needs. + */ +static uint8_t mv_penalty[MAX_FCODE+1][MAX_MV*2+1]; + +/** + * Minimal fcode that a motion vector component would need. + */ +static uint8_t fcode_tab[MAX_MV*2+1]; + +/** + * Minimal fcode that a motion vector component would need in umv. + * All entries in this table are 1. + */ +static uint8_t umv_fcode_tab[MAX_MV*2+1]; + +//unified encoding tables for run length encoding of coefficients +//unified in the sense that the specification specifies the encoding in several steps. +static uint8_t uni_h263_intra_aic_rl_len [64*64*2*2]; +static uint8_t uni_h263_inter_rl_len [64*64*2*2]; +//#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128 + (run)*256 + (level)) +//#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128*64 + (run) + (level)*64) +#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128*64 + (run)*128 + (level)) + +static const uint8_t wrong_run[102] = { + 1, 2, 3, 5, 4, 10, 9, 8, +11, 15, 17, 16, 23, 22, 21, 20, +19, 18, 25, 24, 27, 26, 11, 7, + 6, 1, 2, 13, 2, 2, 2, 2, + 6, 12, 3, 9, 1, 3, 4, 3, + 7, 4, 1, 1, 5, 5, 14, 6, + 1, 7, 1, 8, 1, 1, 1, 1, +10, 1, 1, 5, 9, 17, 25, 24, +29, 33, 32, 41, 2, 23, 28, 31, + 3, 22, 30, 4, 27, 40, 8, 26, + 6, 39, 7, 38, 16, 37, 15, 10, +11, 12, 13, 14, 1, 21, 20, 18, +19, 2, 1, 34, 35, 36 +}; + +/** + * Return the 4 bit value that specifies the given aspect ratio. + * This may be one of the standard aspect ratios or it specifies + * that the aspect will be stored explicitly later. + */ +av_const int ff_h263_aspect_to_info(AVRational aspect){ + int i; + + if(aspect.num==0) aspect= (AVRational){1,1}; + + for(i=1; i<6; i++){ + if(av_cmp_q(ff_h263_pixel_aspect[i], aspect) == 0){ + return i; + } + } + + return FF_ASPECT_EXTENDED; +} + +void h263_encode_picture_header(MpegEncContext * s, int picture_number) +{ + int format, coded_frame_rate, coded_frame_rate_base, i, temp_ref; + int best_clock_code=1; + int best_divisor=60; + int best_error= INT_MAX; + + if(s->h263_plus){ + for(i=0; i<2; i++){ + int div, error; + div= (s->avctx->time_base.num*1800000LL + 500LL*s->avctx->time_base.den) / ((1000LL+i)*s->avctx->time_base.den); + div= av_clip(div, 1, 127); + error= FFABS(s->avctx->time_base.num*1800000LL - (1000LL+i)*s->avctx->time_base.den*div); + if(error < best_error){ + best_error= error; + best_divisor= div; + best_clock_code= i; + } + } + } + s->custom_pcf= best_clock_code!=1 || best_divisor!=60; + coded_frame_rate= 1800000; + coded_frame_rate_base= (1000+best_clock_code)*best_divisor; + + align_put_bits(&s->pb); + + /* Update the pointer to last GOB */ + s->ptr_lastgob = put_bits_ptr(&s->pb); + put_bits(&s->pb, 22, 0x20); /* PSC */ + temp_ref= s->picture_number * (int64_t)coded_frame_rate * s->avctx->time_base.num / //FIXME use timestamp + (coded_frame_rate_base * (int64_t)s->avctx->time_base.den); + put_sbits(&s->pb, 8, temp_ref); /* TemporalReference */ + + put_bits(&s->pb, 1, 1); /* marker */ + put_bits(&s->pb, 1, 0); /* h263 id */ + put_bits(&s->pb, 1, 0); /* split screen off */ + put_bits(&s->pb, 1, 0); /* camera off */ + put_bits(&s->pb, 1, 0); /* freeze picture release off */ + + format = ff_match_2uint16(h263_format, FF_ARRAY_ELEMS(h263_format), s->width, s->height); + if (!s->h263_plus) { + /* H.263v1 */ + put_bits(&s->pb, 3, format); + put_bits(&s->pb, 1, (s->pict_type == FF_P_TYPE)); + /* By now UMV IS DISABLED ON H.263v1, since the restrictions + of H.263v1 UMV implies to check the predicted MV after + calculation of the current MB to see if we're on the limits */ + put_bits(&s->pb, 1, 0); /* Unrestricted Motion Vector: off */ + put_bits(&s->pb, 1, 0); /* SAC: off */ + put_bits(&s->pb, 1, s->obmc); /* Advanced Prediction */ + put_bits(&s->pb, 1, 0); /* only I/P frames, no PB frame */ + put_bits(&s->pb, 5, s->qscale); + put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode: off */ + } else { + int ufep=1; + /* H.263v2 */ + /* H.263 Plus PTYPE */ + + put_bits(&s->pb, 3, 7); + put_bits(&s->pb,3,ufep); /* Update Full Extended PTYPE */ + if (format == 8) + put_bits(&s->pb,3,6); /* Custom Source Format */ + else + put_bits(&s->pb, 3, format); + + put_bits(&s->pb,1, s->custom_pcf); + put_bits(&s->pb,1, s->umvplus); /* Unrestricted Motion Vector */ + put_bits(&s->pb,1,0); /* SAC: off */ + put_bits(&s->pb,1,s->obmc); /* Advanced Prediction Mode */ + put_bits(&s->pb,1,s->h263_aic); /* Advanced Intra Coding */ + put_bits(&s->pb,1,s->loop_filter); /* Deblocking Filter */ + put_bits(&s->pb,1,s->h263_slice_structured); /* Slice Structured */ + put_bits(&s->pb,1,0); /* Reference Picture Selection: off */ + put_bits(&s->pb,1,0); /* Independent Segment Decoding: off */ + put_bits(&s->pb,1,s->alt_inter_vlc); /* Alternative Inter VLC */ + put_bits(&s->pb,1,s->modified_quant); /* Modified Quantization: */ + put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */ + put_bits(&s->pb,3,0); /* Reserved */ + + put_bits(&s->pb, 3, s->pict_type == FF_P_TYPE); + + put_bits(&s->pb,1,0); /* Reference Picture Resampling: off */ + put_bits(&s->pb,1,0); /* Reduced-Resolution Update: off */ + put_bits(&s->pb,1,s->no_rounding); /* Rounding Type */ + put_bits(&s->pb,2,0); /* Reserved */ + put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */ + + /* This should be here if PLUSPTYPE */ + put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode: off */ + + if (format == 8) { + /* Custom Picture Format (CPFMT) */ + s->aspect_ratio_info= ff_h263_aspect_to_info(s->avctx->sample_aspect_ratio); + + put_bits(&s->pb,4,s->aspect_ratio_info); + put_bits(&s->pb,9,(s->width >> 2) - 1); + put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */ + put_bits(&s->pb,9,(s->height >> 2)); + if (s->aspect_ratio_info == FF_ASPECT_EXTENDED){ + put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.num); + put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.den); + } + } + if(s->custom_pcf){ + if(ufep){ + put_bits(&s->pb, 1, best_clock_code); + put_bits(&s->pb, 7, best_divisor); + } + put_sbits(&s->pb, 2, temp_ref>>8); + } + + /* Unlimited Unrestricted Motion Vectors Indicator (UUI) */ + if (s->umvplus) +// put_bits(&s->pb,1,1); /* Limited according tables of Annex D */ +//FIXME check actual requested range + put_bits(&s->pb,2,1); /* unlimited */ + if(s->h263_slice_structured) + put_bits(&s->pb,2,0); /* no weird submodes */ + + put_bits(&s->pb, 5, s->qscale); + } + + put_bits(&s->pb, 1, 0); /* no PEI */ + + if(s->h263_slice_structured){ + put_bits(&s->pb, 1, 1); + + assert(s->mb_x == 0 && s->mb_y == 0); + ff_h263_encode_mba(s); + + put_bits(&s->pb, 1, 1); + } + + if(s->h263_aic){ + s->y_dc_scale_table= + s->c_dc_scale_table= ff_aic_dc_scale_table; + }else{ + s->y_dc_scale_table= + s->c_dc_scale_table= ff_mpeg1_dc_scale_table; + } +} + +/** + * Encode a group of blocks header. + */ +void h263_encode_gob_header(MpegEncContext * s, int mb_line) +{ + put_bits(&s->pb, 17, 1); /* GBSC */ + + if(s->h263_slice_structured){ + put_bits(&s->pb, 1, 1); + + ff_h263_encode_mba(s); + + if(s->mb_num > 1583) + put_bits(&s->pb, 1, 1); + put_bits(&s->pb, 5, s->qscale); /* GQUANT */ + put_bits(&s->pb, 1, 1); + put_bits(&s->pb, 2, s->pict_type == FF_I_TYPE); /* GFID */ + }else{ + int gob_number= mb_line / s->gob_index; + + put_bits(&s->pb, 5, gob_number); /* GN */ + put_bits(&s->pb, 2, s->pict_type == FF_I_TYPE); /* GFID */ + put_bits(&s->pb, 5, s->qscale); /* GQUANT */ + } +} + +/** + * modify qscale so that encoding is acually possible in h263 (limit difference to -2..2) + */ +void ff_clean_h263_qscales(MpegEncContext *s){ + int i; + int8_t * const qscale_table= s->current_picture.qscale_table; + + ff_init_qscale_tab(s); + + for(i=1; imb_num; i++){ + if(qscale_table[ s->mb_index2xy[i] ] - qscale_table[ s->mb_index2xy[i-1] ] >2) + qscale_table[ s->mb_index2xy[i] ]= qscale_table[ s->mb_index2xy[i-1] ]+2; + } + for(i=s->mb_num-2; i>=0; i--){ + if(qscale_table[ s->mb_index2xy[i] ] - qscale_table[ s->mb_index2xy[i+1] ] >2) + qscale_table[ s->mb_index2xy[i] ]= qscale_table[ s->mb_index2xy[i+1] ]+2; + } + + if(s->codec_id != CODEC_ID_H263P){ + for(i=1; imb_num; i++){ + int mb_xy= s->mb_index2xy[i]; + + if(qscale_table[mb_xy] != qscale_table[s->mb_index2xy[i-1]] && (s->mb_type[mb_xy]&CANDIDATE_MB_TYPE_INTER4V)){ + s->mb_type[mb_xy]|= CANDIDATE_MB_TYPE_INTER; + } + } + } +} + +static const int dquant_code[5]= {1,0,9,2,3}; + +/** + * encodes a 8x8 block. + * @param block the 8x8 block + * @param n block index (0-3 are luma, 4-5 are chroma) + */ +static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n) +{ + int level, run, last, i, j, last_index, last_non_zero, sign, slevel, code; + RLTable *rl; + + rl = &ff_h263_rl_inter; + if (s->mb_intra && !s->h263_aic) { + /* DC coef */ + level = block[0]; + /* 255 cannot be represented, so we clamp */ + if (level > 254) { + level = 254; + block[0] = 254; + } + /* 0 cannot be represented also */ + else if (level < 1) { + level = 1; + block[0] = 1; + } + if (level == 128) //FIXME check rv10 + put_bits(&s->pb, 8, 0xff); + else + put_bits(&s->pb, 8, level); + i = 1; + } else { + i = 0; + if (s->h263_aic && s->mb_intra) + rl = &rl_intra_aic; + + if(s->alt_inter_vlc && !s->mb_intra){ + int aic_vlc_bits=0; + int inter_vlc_bits=0; + int wrong_pos=-1; + int aic_code; + + last_index = s->block_last_index[n]; + last_non_zero = i - 1; + for (; i <= last_index; i++) { + j = s->intra_scantable.permutated[i]; + level = block[j]; + if (level) { + run = i - last_non_zero - 1; + last = (i == last_index); + + if(level<0) level= -level; + + code = get_rl_index(rl, last, run, level); + aic_code = get_rl_index(&rl_intra_aic, last, run, level); + inter_vlc_bits += rl->table_vlc[code][1]+1; + aic_vlc_bits += rl_intra_aic.table_vlc[aic_code][1]+1; + + if (code == rl->n) { + inter_vlc_bits += 1+6+8-1; + } + if (aic_code == rl_intra_aic.n) { + aic_vlc_bits += 1+6+8-1; + wrong_pos += run + 1; + }else + wrong_pos += wrong_run[aic_code]; + last_non_zero = i; + } + } + i = 0; + if(aic_vlc_bits < inter_vlc_bits && wrong_pos > 63) + rl = &rl_intra_aic; + } + } + + /* AC coefs */ + last_index = s->block_last_index[n]; + last_non_zero = i - 1; + for (; i <= last_index; i++) { + j = s->intra_scantable.permutated[i]; + level = block[j]; + if (level) { + run = i - last_non_zero - 1; + last = (i == last_index); + sign = 0; + slevel = level; + if (level < 0) { + sign = 1; + level = -level; + } + code = get_rl_index(rl, last, run, level); + put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]); + if (code == rl->n) { + if(!CONFIG_FLV_ENCODER || s->h263_flv <= 1){ + put_bits(&s->pb, 1, last); + put_bits(&s->pb, 6, run); + + assert(slevel != 0); + + if(level < 128) + put_sbits(&s->pb, 8, slevel); + else{ + put_bits(&s->pb, 8, 128); + put_sbits(&s->pb, 5, slevel); + put_sbits(&s->pb, 6, slevel>>5); + } + }else{ + ff_flv2_encode_ac_esc(&s->pb, slevel, level, run, last); + } + } else { + put_bits(&s->pb, 1, sign); + } + last_non_zero = i; + } + } +} + +/* Encode MV differences on H.263+ with Unrestricted MV mode */ +static void h263p_encode_umotion(MpegEncContext * s, int val) +{ + short sval = 0; + short i = 0; + short n_bits = 0; + short temp_val; + int code = 0; + int tcode; + + if ( val == 0) + put_bits(&s->pb, 1, 1); + else if (val == 1) + put_bits(&s->pb, 3, 0); + else if (val == -1) + put_bits(&s->pb, 3, 2); + else { + + sval = ((val < 0) ? (short)(-val):(short)val); + temp_val = sval; + + while (temp_val != 0) { + temp_val = temp_val >> 1; + n_bits++; + } + + i = n_bits - 1; + while (i > 0) { + tcode = (sval & (1 << (i-1))) >> (i-1); + tcode = (tcode << 1) | 1; + code = (code << 2) | tcode; + i--; + } + code = ((code << 1) | (val < 0)) << 1; + put_bits(&s->pb, (2*n_bits)+1, code); + } +} + +void h263_encode_mb(MpegEncContext * s, + DCTELEM block[6][64], + int motion_x, int motion_y) +{ + int cbpc, cbpy, i, cbp, pred_x, pred_y; + int16_t pred_dc; + int16_t rec_intradc[6]; + int16_t *dc_ptr[6]; + const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1); + + if (!s->mb_intra) { + /* compute cbp */ + cbp= get_p_cbp(s, block, motion_x, motion_y); + + if ((cbp | motion_x | motion_y | s->dquant | (s->mv_type - MV_TYPE_16X16)) == 0) { + /* skip macroblock */ + put_bits(&s->pb, 1, 1); + if(interleaved_stats){ + s->misc_bits++; + s->last_bits++; + } + s->skip_count++; + + return; + } + put_bits(&s->pb, 1, 0); /* mb coded */ + + cbpc = cbp & 3; + cbpy = cbp >> 2; + if(s->alt_inter_vlc==0 || cbpc!=3) + cbpy ^= 0xF; + if(s->dquant) cbpc+= 8; + if(s->mv_type==MV_TYPE_16X16){ + put_bits(&s->pb, + ff_h263_inter_MCBPC_bits[cbpc], + ff_h263_inter_MCBPC_code[cbpc]); + + put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); + if(s->dquant) + put_bits(&s->pb, 2, dquant_code[s->dquant+2]); + + if(interleaved_stats){ + s->misc_bits+= get_bits_diff(s); + } + + /* motion vectors: 16x16 mode */ + h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + + if (!s->umvplus) { + ff_h263_encode_motion_vector(s, motion_x - pred_x, + motion_y - pred_y, 1); + } + else { + h263p_encode_umotion(s, motion_x - pred_x); + h263p_encode_umotion(s, motion_y - pred_y); + if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1)) + /* To prevent Start Code emulation */ + put_bits(&s->pb,1,1); + } + }else{ + put_bits(&s->pb, + ff_h263_inter_MCBPC_bits[cbpc+16], + ff_h263_inter_MCBPC_code[cbpc+16]); + put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); + if(s->dquant) + put_bits(&s->pb, 2, dquant_code[s->dquant+2]); + + if(interleaved_stats){ + s->misc_bits+= get_bits_diff(s); + } + + for(i=0; i<4; i++){ + /* motion vectors: 8x8 mode*/ + h263_pred_motion(s, i, 0, &pred_x, &pred_y); + + motion_x= s->current_picture.motion_val[0][ s->block_index[i] ][0]; + motion_y= s->current_picture.motion_val[0][ s->block_index[i] ][1]; + if (!s->umvplus) { + ff_h263_encode_motion_vector(s, motion_x - pred_x, + motion_y - pred_y, 1); + } + else { + h263p_encode_umotion(s, motion_x - pred_x); + h263p_encode_umotion(s, motion_y - pred_y); + if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1)) + /* To prevent Start Code emulation */ + put_bits(&s->pb,1,1); + } + } + } + + if(interleaved_stats){ + s->mv_bits+= get_bits_diff(s); + } + } else { + assert(s->mb_intra); + + cbp = 0; + if (s->h263_aic) { + /* Predict DC */ + for(i=0; i<6; i++) { + int16_t level = block[i][0]; + int scale; + + if(i<4) scale= s->y_dc_scale; + else scale= s->c_dc_scale; + + pred_dc = h263_pred_dc(s, i, &dc_ptr[i]); + level -= pred_dc; + /* Quant */ + if (level >= 0) + level = (level + (scale>>1))/scale; + else + level = (level - (scale>>1))/scale; + + /* AIC can change CBP */ + if (level == 0 && s->block_last_index[i] == 0) + s->block_last_index[i] = -1; + + if(!s->modified_quant){ + if (level < -127) + level = -127; + else if (level > 127) + level = 127; + } + + block[i][0] = level; + /* Reconstruction */ + rec_intradc[i] = scale*level + pred_dc; + /* Oddify */ + rec_intradc[i] |= 1; + //if ((rec_intradc[i] % 2) == 0) + // rec_intradc[i]++; + /* Clipping */ + if (rec_intradc[i] < 0) + rec_intradc[i] = 0; + else if (rec_intradc[i] > 2047) + rec_intradc[i] = 2047; + + /* Update AC/DC tables */ + *dc_ptr[i] = rec_intradc[i]; + if (s->block_last_index[i] >= 0) + cbp |= 1 << (5 - i); + } + }else{ + for(i=0; i<6; i++) { + /* compute cbp */ + if (s->block_last_index[i] >= 1) + cbp |= 1 << (5 - i); + } + } + + cbpc = cbp & 3; + if (s->pict_type == FF_I_TYPE) { + if(s->dquant) cbpc+=4; + put_bits(&s->pb, + ff_h263_intra_MCBPC_bits[cbpc], + ff_h263_intra_MCBPC_code[cbpc]); + } else { + if(s->dquant) cbpc+=8; + put_bits(&s->pb, 1, 0); /* mb coded */ + put_bits(&s->pb, + ff_h263_inter_MCBPC_bits[cbpc + 4], + ff_h263_inter_MCBPC_code[cbpc + 4]); + } + if (s->h263_aic) { + /* XXX: currently, we do not try to use ac prediction */ + put_bits(&s->pb, 1, 0); /* no AC prediction */ + } + cbpy = cbp >> 2; + put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); + if(s->dquant) + put_bits(&s->pb, 2, dquant_code[s->dquant+2]); + + if(interleaved_stats){ + s->misc_bits+= get_bits_diff(s); + } + } + + for(i=0; i<6; i++) { + /* encode each block */ + h263_encode_block(s, block[i], i); + + /* Update INTRADC for decoding */ + if (s->h263_aic && s->mb_intra) { + block[i][0] = rec_intradc[i]; + + } + } + + if(interleaved_stats){ + if (!s->mb_intra) { + s->p_tex_bits+= get_bits_diff(s); + s->f_count++; + }else{ + s->i_tex_bits+= get_bits_diff(s); + s->i_count++; + } + } +} + +void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code) +{ + int range, l, bit_size, sign, code, bits; + + if (val == 0) { + /* zero vector */ + code = 0; + put_bits(&s->pb, mvtab[code][1], mvtab[code][0]); + } else { + bit_size = f_code - 1; + range = 1 << bit_size; + /* modulo encoding */ + l= INT_BIT - 6 - bit_size; + val = (val<>l; + sign = val>>31; + val= (val^sign)-sign; + sign&=1; + + val--; + code = (val >> bit_size) + 1; + bits = val & (range - 1); + + put_bits(&s->pb, mvtab[code][1] + 1, (mvtab[code][0] << 1) | sign); + if (bit_size > 0) { + put_bits(&s->pb, bit_size, bits); + } + } +} + +static void init_mv_penalty_and_fcode(MpegEncContext *s) +{ + int f_code; + int mv; + + for(f_code=1; f_code<=MAX_FCODE; f_code++){ + for(mv=-MAX_MV; mv<=MAX_MV; mv++){ + int len; + + if(mv==0) len= mvtab[0][1]; + else{ + int val, bit_size, code; + + bit_size = f_code - 1; + + val=mv; + if (val < 0) + val = -val; + val--; + code = (val >> bit_size) + 1; + if(code<33){ + len= mvtab[code][1] + 1 + bit_size; + }else{ + len= mvtab[32][1] + av_log2(code>>5) + 2 + bit_size; + } + } + + mv_penalty[f_code][mv+MAX_MV]= len; + } + } + + for(f_code=MAX_FCODE; f_code>0; f_code--){ + for(mv=-(16<= 64); + assert(MAX_RUN >= 63); + + for(slevel=-64; slevel<64; slevel++){ + if(slevel==0) continue; + for(run=0; run<64; run++){ + for(last=0; last<=1; last++){ + const int index= UNI_MPEG4_ENC_INDEX(last, run, slevel+64); + int level= slevel < 0 ? -slevel : slevel; + int sign= slevel < 0 ? 1 : 0; + int bits, len, code; + + len_tab[index]= 100; + + /* ESC0 */ + code= get_rl_index(rl, last, run, level); + bits= rl->table_vlc[code][0]; + len= rl->table_vlc[code][1]; + bits=bits*2+sign; len++; + + if(code!=rl->n && len < len_tab[index]){ + if(bits_tab) bits_tab[index]= bits; + len_tab [index]= len; + } + /* ESC */ + bits= rl->table_vlc[rl->n][0]; + len = rl->table_vlc[rl->n][1]; + bits=bits*2+last; len++; + bits=bits*64+run; len+=6; + bits=bits*256+(level&0xff); len+=8; + + if(len < len_tab[index]){ + if(bits_tab) bits_tab[index]= bits; + len_tab [index]= len; + } + } + } + } +} + +void h263_encode_init(MpegEncContext *s) +{ + static int done = 0; + + if (!done) { + done = 1; + + init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]); + init_rl(&rl_intra_aic, ff_h263_static_rl_table_store[1]); + + init_uni_h263_rl_tab(&rl_intra_aic, NULL, uni_h263_intra_aic_rl_len); + init_uni_h263_rl_tab(&ff_h263_rl_inter , NULL, uni_h263_inter_rl_len); + + init_mv_penalty_and_fcode(s); + } + s->me.mv_penalty= mv_penalty; //FIXME exact table for msmpeg4 & h263p + + s->intra_ac_vlc_length =s->inter_ac_vlc_length = uni_h263_inter_rl_len; + s->intra_ac_vlc_last_length=s->inter_ac_vlc_last_length= uni_h263_inter_rl_len + 128*64; + if(s->h263_aic){ + s->intra_ac_vlc_length = uni_h263_intra_aic_rl_len; + s->intra_ac_vlc_last_length= uni_h263_intra_aic_rl_len + 128*64; + } + s->ac_esc_length= 7+1+6+8; + + // use fcodes >1 only for mpeg4 & h263 & h263p FIXME + switch(s->codec_id){ + case CODEC_ID_MPEG4: + s->fcode_tab= fcode_tab; + break; + case CODEC_ID_H263P: + if(s->umvplus) + s->fcode_tab= umv_fcode_tab; + if(s->modified_quant){ + s->min_qcoeff= -2047; + s->max_qcoeff= 2047; + }else{ + s->min_qcoeff= -127; + s->max_qcoeff= 127; + } + break; + //Note for mpeg4 & h263 the dc-scale table will be set per frame as needed later + case CODEC_ID_FLV1: + if (s->h263_flv > 1) { + s->min_qcoeff= -1023; + s->max_qcoeff= 1023; + } else { + s->min_qcoeff= -127; + s->max_qcoeff= 127; + } + s->y_dc_scale_table= + s->c_dc_scale_table= ff_mpeg1_dc_scale_table; + break; + default: //nothing needed - default table already set in mpegvideo.c + s->min_qcoeff= -127; + s->max_qcoeff= 127; + s->y_dc_scale_table= + s->c_dc_scale_table= ff_mpeg1_dc_scale_table; + } +} + +void ff_h263_encode_mba(MpegEncContext *s) +{ + int i, mb_pos; + + for(i=0; i<6; i++){ + if(s->mb_num-1 <= ff_mba_max[i]) break; + } + mb_pos= s->mb_x + s->mb_width*s->mb_y; + put_bits(&s->pb, ff_mba_length[i], mb_pos); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ivi_common.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ivi_common.c new file mode 100644 index 00000000..0e552bcc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ivi_common.c @@ -0,0 +1,1037 @@ +/* + * common functions for Indeo Video Interactive codecs (Indeo4 and Indeo5) + * + * Copyright (c) 2009 Maxim Poliakovski + * + * 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 + * This file contains functions and data shared by both Indeo4 and + * Indeo5 decoders. + */ + +#define ALT_BITSTREAM_READER_LE +#include "avcodec.h" +#include "get_bits.h" +#include "ivi_common.h" +#include "libavutil/common.h" +#include "ivi_dsp.h" + +extern const IVIHuffDesc ff_ivi_mb_huff_desc[8]; ///< static macroblock huffman tables +extern const IVIHuffDesc ff_ivi_blk_huff_desc[8]; ///< static block huffman tables + +VLC ff_ivi_mb_vlc_tabs [8]; +VLC ff_ivi_blk_vlc_tabs[8]; + +/** + * Reverse "nbits" bits of the value "val" and return the result + * in the least significant bits. + */ +static uint16_t inv_bits(uint16_t val, int nbits) +{ + uint16_t res; + + if (nbits <= 8) { + res = av_reverse[val] >> (8-nbits); + } else + res = ((av_reverse[val & 0xFF] << 8) + (av_reverse[val >> 8])) >> (16-nbits); + + return res; +} + +int ff_ivi_create_huff_from_desc(const IVIHuffDesc *cb, VLC *vlc, int flag) +{ + int pos, i, j, codes_per_row, prefix, not_last_row; + uint16_t codewords[256]; /* FIXME: move this temporal storage out? */ + uint8_t bits[256]; + + pos = 0; /* current position = 0 */ + + for (i = 0; i < cb->num_rows; i++) { + codes_per_row = 1 << cb->xbits[i]; + not_last_row = (i != cb->num_rows - 1); + prefix = ((1 << i) - 1) << (cb->xbits[i] + not_last_row); + + for (j = 0; j < codes_per_row; j++) { + if (pos >= 256) /* Some Indeo5 codebooks can have more than 256 */ + break; /* elements, but only 256 codes are allowed! */ + + bits[pos] = i + cb->xbits[i] + not_last_row; + if (bits[pos] > IVI_VLC_BITS) + return -1; /* invalid descriptor */ + + codewords[pos] = inv_bits((prefix | j), bits[pos]); + if (!bits[pos]) + bits[pos] = 1; + + pos++; + }//for j + }//for i + + /* number of codewords = pos */ + return init_vlc(vlc, IVI_VLC_BITS, pos, bits, 1, 1, codewords, 2, 2, + (flag ? INIT_VLC_USE_NEW_STATIC : 0) | INIT_VLC_LE); +} + +void ff_ivi_init_static_vlc(void) +{ + int i; + static VLC_TYPE table_data[8192 * 16][2]; + static int initialized_vlcs = 0; + + if (initialized_vlcs) + return; + for (i = 0; i < 8; i++) { + ff_ivi_mb_vlc_tabs[i].table = table_data + i * 2 * 8192; + ff_ivi_mb_vlc_tabs[i].table_allocated = 8192; + ff_ivi_create_huff_from_desc(&ff_ivi_mb_huff_desc[i], &ff_ivi_mb_vlc_tabs[i], 1); + ff_ivi_blk_vlc_tabs[i].table = table_data + (i * 2 + 1) * 8192; + ff_ivi_blk_vlc_tabs[i].table_allocated = 8192; + ff_ivi_create_huff_from_desc(&ff_ivi_blk_huff_desc[i], &ff_ivi_blk_vlc_tabs[i], 1); + } + initialized_vlcs = 1; +} + +int ff_ivi_dec_huff_desc(GetBitContext *gb, int desc_coded, int which_tab, + IVIHuffTab *huff_tab, AVCodecContext *avctx) +{ + int i, result; + IVIHuffDesc new_huff; + + if (!desc_coded) { + /* select default table */ + huff_tab->tab = (which_tab) ? &ff_ivi_blk_vlc_tabs[7] + : &ff_ivi_mb_vlc_tabs [7]; + } else { + huff_tab->tab_sel = get_bits(gb, 3); + if (huff_tab->tab_sel == 7) { + /* custom huffman table (explicitly encoded) */ + new_huff.num_rows = get_bits(gb, 4); + + for (i = 0; i < new_huff.num_rows; i++) + new_huff.xbits[i] = get_bits(gb, 4); + + /* Have we got the same custom table? Rebuild if not. */ + if (ff_ivi_huff_desc_cmp(&new_huff, &huff_tab->cust_desc)) { + ff_ivi_huff_desc_copy(&huff_tab->cust_desc, &new_huff); + + if (huff_tab->cust_tab.table) + free_vlc(&huff_tab->cust_tab); + result = ff_ivi_create_huff_from_desc(&huff_tab->cust_desc, + &huff_tab->cust_tab, 0); + if (result) { + av_log(avctx, AV_LOG_ERROR, + "Error while initializing custom vlc table!\n"); + return -1; + } + } + huff_tab->tab = &huff_tab->cust_tab; + } else { + /* select one of predefined tables */ + huff_tab->tab = (which_tab) ? &ff_ivi_blk_vlc_tabs[huff_tab->tab_sel] + : &ff_ivi_mb_vlc_tabs [huff_tab->tab_sel]; + } + } + + return 0; +} + +int ff_ivi_huff_desc_cmp(const IVIHuffDesc *desc1, const IVIHuffDesc *desc2) +{ + return desc1->num_rows != desc2->num_rows + || memcmp(desc1->xbits, desc2->xbits, desc1->num_rows); +} + +void ff_ivi_huff_desc_copy(IVIHuffDesc *dst, const IVIHuffDesc *src) +{ + dst->num_rows = src->num_rows; + memcpy(dst->xbits, src->xbits, src->num_rows); +} + +int av_cold ff_ivi_init_planes(IVIPlaneDesc *planes, const IVIPicConfig *cfg) +{ + int p, b; + uint32_t b_width, b_height, align_fac, width_aligned, height_aligned, buf_size; + IVIBandDesc *band; + + ff_ivi_free_buffers(planes); + + /* fill in the descriptor of the luminance plane */ + planes[0].width = cfg->pic_width; + planes[0].height = cfg->pic_height; + planes[0].num_bands = cfg->luma_bands; + + /* fill in the descriptors of the chrominance planes */ + planes[1].width = planes[2].width = (cfg->pic_width + 3) >> 2; + planes[1].height = planes[2].height = (cfg->pic_height + 3) >> 2; + planes[1].num_bands = planes[2].num_bands = cfg->chroma_bands; + + for (p = 0; p < 3; p++) { + planes[p].bands = av_mallocz(planes[p].num_bands * sizeof(IVIBandDesc)); + if (!planes[p].bands) + return AVERROR(ENOMEM); + + /* select band dimensions: if there is only one band then it + * has the full size, if there are several bands each of them + * has only half size */ + b_width = planes[p].num_bands == 1 ? planes[p].width : (planes[p].width + 1) >> 1; + b_height = planes[p].num_bands == 1 ? planes[p].height : (planes[p].height + 1) >> 1; + + /* luma band buffers will be aligned on 16x16 (max macroblock size) */ + /* chroma band buffers will be aligned on 8x8 (max macroblock size) */ + align_fac = p ? 8 : 16; + width_aligned = FFALIGN(b_width , align_fac); + height_aligned = FFALIGN(b_height, align_fac); + buf_size = width_aligned * height_aligned * sizeof(int16_t); + + for (b = 0; b < planes[p].num_bands; b++) { + band = &planes[p].bands[b]; /* select appropriate plane/band */ + band->plane = p; + band->band_num = b; + band->width = b_width; + band->height = b_height; + band->pitch = width_aligned; + band->bufs[0] = av_malloc(buf_size); + band->bufs[1] = av_malloc(buf_size); + if (!band->bufs[0] || !band->bufs[1]) + return AVERROR(ENOMEM); + + /* allocate the 3rd band buffer for scalability mode */ + if (cfg->luma_bands > 1) { + band->bufs[2] = av_malloc(buf_size); + if (!band->bufs[2]) + return AVERROR(ENOMEM); + } + + planes[p].bands[0].blk_vlc.cust_desc.num_rows = 0; /* reset custom vlc */ + } + } + + return 0; +} + +void av_cold ff_ivi_free_buffers(IVIPlaneDesc *planes) +{ + int p, b, t; + + for (p = 0; p < 3; p++) { + for (b = 0; b < planes[p].num_bands; b++) { + av_freep(&planes[p].bands[b].bufs[0]); + av_freep(&planes[p].bands[b].bufs[1]); + av_freep(&planes[p].bands[b].bufs[2]); + + if (planes[p].bands[b].blk_vlc.cust_tab.table) + free_vlc(&planes[p].bands[b].blk_vlc.cust_tab); + for (t = 0; t < planes[p].bands[b].num_tiles; t++) + av_freep(&planes[p].bands[b].tiles[t].mbs); + av_freep(&planes[p].bands[b].tiles); + } + av_freep(&planes[p].bands); + } +} + +int av_cold ff_ivi_init_tiles(IVIPlaneDesc *planes, int tile_width, int tile_height) +{ + int p, b, x, y, x_tiles, y_tiles, t_width, t_height; + IVIBandDesc *band; + IVITile *tile, *ref_tile; + + for (p = 0; p < 3; p++) { + t_width = !p ? tile_width : (tile_width + 3) >> 2; + t_height = !p ? tile_height : (tile_height + 3) >> 2; + + if (!p && planes[0].num_bands == 4) { + t_width >>= 1; + t_height >>= 1; + } + + for (b = 0; b < planes[p].num_bands; b++) { + band = &planes[p].bands[b]; + x_tiles = IVI_NUM_TILES(band->width, t_width); + y_tiles = IVI_NUM_TILES(band->height, t_height); + band->num_tiles = x_tiles * y_tiles; + + av_freep(&band->tiles); + band->tiles = av_mallocz(band->num_tiles * sizeof(IVITile)); + if (!band->tiles) + return AVERROR(ENOMEM); + + tile = band->tiles; + + /* use the first luma band as reference for motion vectors + * and quant */ + ref_tile = planes[0].bands[0].tiles; + + for (y = 0; y < band->height; y += t_height) { + for (x = 0; x < band->width; x += t_width) { + tile->xpos = x; + tile->ypos = y; + tile->width = FFMIN(band->width - x, t_width); + tile->height = FFMIN(band->height - y, t_height); + tile->is_empty = tile->data_size = 0; + /* calculate number of macroblocks */ + tile->num_MBs = IVI_MBs_PER_TILE(tile->width, tile->height, + band->mb_size); + + av_freep(&tile->mbs); + tile->mbs = av_malloc(tile->num_MBs * sizeof(IVIMbInfo)); + if (!tile->mbs) + return AVERROR(ENOMEM); + + tile->ref_mbs = 0; + if (p || b) { + tile->ref_mbs = ref_tile->mbs; + ref_tile++; + } + + tile++; + } + } + + }// for b + }// for p + + return 0; +} + +int ff_ivi_dec_tile_data_size(GetBitContext *gb) +{ + int len; + + len = 0; + if (get_bits1(gb)) { + len = get_bits(gb, 8); + if (len == 255) + len = get_bits_long(gb, 24); + } + + /* align the bitstream reader on the byte boundary */ + align_get_bits(gb); + + return len; +} + +int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile) +{ + int mbn, blk, num_blocks, num_coeffs, blk_size, scan_pos, run, val, + pos, is_intra, mc_type, mv_x, mv_y, col_mask; + uint8_t col_flags[8]; + int32_t prev_dc, trvec[64]; + uint32_t cbp, sym, lo, hi, quant, buf_offs, q; + IVIMbInfo *mb; + RVMapDesc *rvmap = band->rv_map; + void (*mc_with_delta_func)(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type); + void (*mc_no_delta_func) (int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type); + const uint16_t *base_tab; + const uint8_t *scale_tab; + + prev_dc = 0; /* init intra prediction for the DC coefficient */ + + blk_size = band->blk_size; + col_mask = blk_size - 1; /* column mask for tracking non-zero coeffs */ + num_blocks = (band->mb_size != blk_size) ? 4 : 1; /* number of blocks per mb */ + num_coeffs = blk_size * blk_size; + if (blk_size == 8) { + mc_with_delta_func = ff_ivi_mc_8x8_delta; + mc_no_delta_func = ff_ivi_mc_8x8_no_delta; + } else { + mc_with_delta_func = ff_ivi_mc_4x4_delta; + mc_no_delta_func = ff_ivi_mc_4x4_no_delta; + } + + for (mbn = 0, mb = tile->mbs; mbn < tile->num_MBs; mb++, mbn++) { + is_intra = !mb->type; + cbp = mb->cbp; + buf_offs = mb->buf_offs; + + quant = av_clip(band->glob_quant + mb->q_delta, 0, 23); + + base_tab = is_intra ? band->intra_base : band->inter_base; + scale_tab = is_intra ? band->intra_scale : band->inter_scale; + if (scale_tab) + quant = scale_tab[quant]; + + if (!is_intra) { + mv_x = mb->mv_x; + mv_y = mb->mv_y; + if (!band->is_halfpel) { + mc_type = 0; /* we have only fullpel vectors */ + } else { + mc_type = ((mv_y & 1) << 1) | (mv_x & 1); + mv_x >>= 1; + mv_y >>= 1; /* convert halfpel vectors into fullpel ones */ + } + } + + for (blk = 0; blk < num_blocks; blk++) { + /* adjust block position in the buffer according to its number */ + if (blk & 1) { + buf_offs += blk_size; + } else if (blk == 2) { + buf_offs -= blk_size; + buf_offs += blk_size * band->pitch; + } + + if (cbp & 1) { /* block coded ? */ + scan_pos = -1; + memset(trvec, 0, num_coeffs*sizeof(trvec[0])); /* zero transform vector */ + memset(col_flags, 0, sizeof(col_flags)); /* zero column flags */ + + while (scan_pos <= num_coeffs) { + sym = get_vlc2(gb, band->blk_vlc.tab->table, IVI_VLC_BITS, 1); + if (sym == rvmap->eob_sym) + break; /* End of block */ + + if (sym == rvmap->esc_sym) { /* Escape - run/val explicitly coded using 3 vlc codes */ + run = get_vlc2(gb, band->blk_vlc.tab->table, IVI_VLC_BITS, 1) + 1; + lo = get_vlc2(gb, band->blk_vlc.tab->table, IVI_VLC_BITS, 1); + hi = get_vlc2(gb, band->blk_vlc.tab->table, IVI_VLC_BITS, 1); + val = IVI_TOSIGNED((hi << 6) | lo); /* merge them and convert into signed val */ + } else { + if (sym >= 256U) { + av_log(NULL, AV_LOG_ERROR, "Invalid sym encountered: %d.\n", sym); + return -1; + } + run = rvmap->runtab[sym]; + val = rvmap->valtab[sym]; + } + + /* de-zigzag and dequantize */ + scan_pos += run; + if (scan_pos >= num_coeffs) + break; + pos = band->scan[scan_pos]; + + if (IVI_DEBUG && !val) + av_log(NULL, AV_LOG_ERROR, "Val = 0 encountered!\n"); + + q = (base_tab[pos] * quant) >> 9; + if (q > 1) + val = val * q + FFSIGN(val) * (((q ^ 1) - 1) >> 1); + trvec[pos] = val; + col_flags[pos & col_mask] |= !!val; /* track columns containing non-zero coeffs */ + }// while + + if (scan_pos >= num_coeffs && sym != rvmap->eob_sym) + return -1; /* corrupt block data */ + + /* undoing DC coeff prediction for intra-blocks */ + if (is_intra && band->is_2d_trans) { + prev_dc += trvec[0]; + trvec[0] = prev_dc; + col_flags[0] |= !!prev_dc; + } + + /* apply inverse transform */ + band->inv_transform(trvec, band->buf + buf_offs, + band->pitch, col_flags); + + /* apply motion compensation */ + if (!is_intra) + mc_with_delta_func(band->buf + buf_offs, + band->ref_buf + buf_offs + mv_y * band->pitch + mv_x, + band->pitch, mc_type); + } else { + /* block not coded */ + /* for intra blocks apply the dc slant transform */ + /* for inter - perform the motion compensation without delta */ + if (is_intra && band->dc_transform) { + band->dc_transform(&prev_dc, band->buf + buf_offs, + band->pitch, blk_size); + } else + mc_no_delta_func(band->buf + buf_offs, + band->ref_buf + buf_offs + mv_y * band->pitch + mv_x, + band->pitch, mc_type); + } + + cbp >>= 1; + }// for blk + }// for mbn + + align_get_bits(gb); + + return 0; +} + +void ff_ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band, + IVITile *tile, int32_t mv_scale) +{ + int x, y, need_mc, mbn, blk, num_blocks, mv_x, mv_y, mc_type; + int offs, mb_offset, row_offset; + IVIMbInfo *mb, *ref_mb; + const int16_t *src; + int16_t *dst; + void (*mc_no_delta_func)(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, + int mc_type); + + offs = tile->ypos * band->pitch + tile->xpos; + mb = tile->mbs; + ref_mb = tile->ref_mbs; + row_offset = band->mb_size * band->pitch; + need_mc = 0; /* reset the mc tracking flag */ + + for (y = tile->ypos; y < (tile->ypos + tile->height); y += band->mb_size) { + mb_offset = offs; + + for (x = tile->xpos; x < (tile->xpos + tile->width); x += band->mb_size) { + mb->xpos = x; + mb->ypos = y; + mb->buf_offs = mb_offset; + + mb->type = 1; /* set the macroblocks type = INTER */ + mb->cbp = 0; /* all blocks are empty */ + + if (!band->qdelta_present && !band->plane && !band->band_num) { + mb->q_delta = band->glob_quant; + mb->mv_x = 0; + mb->mv_y = 0; + } + + if (band->inherit_qdelta && ref_mb) + mb->q_delta = ref_mb->q_delta; + + if (band->inherit_mv) { + /* motion vector inheritance */ + if (mv_scale) { + mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale); + mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale); + } else { + mb->mv_x = ref_mb->mv_x; + mb->mv_y = ref_mb->mv_y; + } + need_mc |= mb->mv_x || mb->mv_y; /* tracking non-zero motion vectors */ + } + + mb++; + if (ref_mb) + ref_mb++; + mb_offset += band->mb_size; + } // for x + offs += row_offset; + } // for y + + if (band->inherit_mv && need_mc) { /* apply motion compensation if there is at least one non-zero motion vector */ + num_blocks = (band->mb_size != band->blk_size) ? 4 : 1; /* number of blocks per mb */ + mc_no_delta_func = (band->blk_size == 8) ? ff_ivi_mc_8x8_no_delta + : ff_ivi_mc_4x4_no_delta; + + for (mbn = 0, mb = tile->mbs; mbn < tile->num_MBs; mb++, mbn++) { + mv_x = mb->mv_x; + mv_y = mb->mv_y; + if (!band->is_halfpel) { + mc_type = 0; /* we have only fullpel vectors */ + } else { + mc_type = ((mv_y & 1) << 1) | (mv_x & 1); + mv_x >>= 1; + mv_y >>= 1; /* convert halfpel vectors into fullpel ones */ + } + + for (blk = 0; blk < num_blocks; blk++) { + /* adjust block position in the buffer according with its number */ + offs = mb->buf_offs + band->blk_size * ((blk & 1) + !!(blk & 2) * band->pitch); + mc_no_delta_func(band->buf + offs, + band->ref_buf + offs + mv_y * band->pitch + mv_x, + band->pitch, mc_type); + } + } + } else { + /* copy data from the reference tile into the current one */ + src = band->ref_buf + tile->ypos * band->pitch + tile->xpos; + dst = band->buf + tile->ypos * band->pitch + tile->xpos; + for (y = 0; y < tile->height; y++) { + memcpy(dst, src, tile->width*sizeof(band->buf[0])); + src += band->pitch; + dst += band->pitch; + } + } +} + + +#if IVI_DEBUG +uint16_t ivi_calc_band_checksum (IVIBandDesc *band) +{ + int x, y; + int16_t *src, checksum; + + src = band->buf; + checksum = 0; + + for (y = 0; y < band->height; src += band->pitch, y++) + for (x = 0; x < band->width; x++) + checksum += src[x]; + + return checksum; +} + +int ivi_check_band (IVIBandDesc *band, const uint8_t *ref, int pitch) +{ + int x, y, result; + uint8_t t1, t2; + int16_t *src; + + src = band->buf; + result = 0; + + for (y = 0; y < band->height; src += band->pitch, y++) { + for (x = 0; x < band->width; x++) { + t1 = av_clip(src[x] + 128, 0, 255); + t2 = ref[x]; + if (t1 != t2) { + av_log(NULL, AV_LOG_ERROR, "Data mismatch: row %d, column %d\n", + y / band->blk_size, x / band->blk_size); + result = -1; + } + } + ref += pitch; + } + + return result; +} +#endif + +void ff_ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, int dst_pitch) +{ + int x, y; + const int16_t *src = plane->bands[0].buf; + uint32_t pitch = plane->bands[0].pitch; + + for (y = 0; y < plane->height; y++) { + for (x = 0; x < plane->width; x++) + dst[x] = av_clip_uint8(src[x] + 128); + src += pitch; + dst += dst_pitch; + } +} + + +/** + * These are 2x8 predefined Huffman codebooks for coding macroblock/block + * signals. They are specified using "huffman descriptors" in order to + * avoid huge static tables. The decoding tables will be generated at + * startup from these descriptors. + */ +const IVIHuffDesc ff_ivi_mb_huff_desc[8] = { + {8, {0, 4, 5, 4, 4, 4, 6, 6}}, + {12, {0, 2, 2, 3, 3, 3, 3, 5, 3, 2, 2, 2}}, + {12, {0, 2, 3, 4, 3, 3, 3, 3, 4, 3, 2, 2}}, + {12, {0, 3, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2}}, + {13, {0, 4, 4, 3, 3, 3, 3, 2, 3, 3, 2, 1, 1}}, + {9, {0, 4, 4, 4, 4, 3, 3, 3, 2}}, + {10, {0, 4, 4, 4, 4, 3, 3, 2, 2, 2}}, + {12, {0, 4, 4, 4, 3, 3, 2, 3, 2, 2, 2, 2}} +}; + +const IVIHuffDesc ff_ivi_blk_huff_desc[8] = { + {10, {1, 2, 3, 4, 4, 7, 5, 5, 4, 1}}, + {11, {2, 3, 4, 4, 4, 7, 5, 4, 3, 3, 2}}, + {12, {2, 4, 5, 5, 5, 5, 6, 4, 4, 3, 1, 1}}, + {13, {3, 3, 4, 4, 5, 6, 6, 4, 4, 3, 2, 1, 1}}, + {11, {3, 4, 4, 5, 5, 5, 6, 5, 4, 2, 2}}, + {13, {3, 4, 5, 5, 5, 5, 6, 4, 3, 3, 2, 1, 1}}, + {13, {3, 4, 5, 5, 5, 6, 5, 4, 3, 3, 2, 1, 1}}, + {9, {3, 4, 4, 5, 5, 5, 6, 5, 5}} +}; + + +/** + * Scan patterns shared between indeo4 and indeo5 + */ +const uint8_t ff_ivi_vertical_scan_8x8[64] = { + 0, 8, 16, 24, 32, 40, 48, 56, + 1, 9, 17, 25, 33, 41, 49, 57, + 2, 10, 18, 26, 34, 42, 50, 58, + 3, 11, 19, 27, 35, 43, 51, 59, + 4, 12, 20, 28, 36, 44, 52, 60, + 5, 13, 21, 29, 37, 45, 53, 61, + 6, 14, 22, 30, 38, 46, 54, 62, + 7, 15, 23, 31, 39, 47, 55, 63 +}; + +const uint8_t ff_ivi_horizontal_scan_8x8[64] = { + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63 +}; + +const uint8_t ff_ivi_direct_scan_4x4[16] = { + 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15 +}; + + +/** + * Run-value (RLE) tables. + */ +const RVMapDesc ff_ivi_rvmap_tabs[9] = { +{ /* MapTab0 */ + 5, /* eob_sym */ + 2, /* esc_sym */ + /* run table */ + {1, 1, 0, 1, 1, 0, 1, 1, 2, 2, 1, 1, 1, 1, 3, 3, + 1, 1, 2, 2, 1, 1, 4, 4, 1, 1, 1, 1, 2, 2, 5, 5, + 1, 1, 3, 3, 1, 1, 6, 6, 1, 2, 1, 2, 7, 7, 1, 1, + 8, 8, 1, 1, 4, 2, 1, 4, 2, 1, 3, 3, 1, 1, 1, 9, + 9, 1, 2, 1, 2, 1, 5, 5, 1, 1, 10, 10, 1, 1, 3, 3, + 2, 2, 1, 1, 11, 11, 6, 4, 4, 1, 6, 1, 2, 1, 2, 12, + 8, 1, 12, 7, 8, 7, 1, 16, 1, 16, 1, 3, 3, 13, 1, 13, + 2, 2, 1, 15, 1, 5, 14, 15, 1, 5, 14, 1, 17, 8, 17, 8, + 1, 4, 4, 2, 2, 1, 25, 25, 24, 24, 1, 3, 1, 3, 1, 8, + 6, 7, 6, 1, 18, 8, 18, 1, 7, 23, 2, 2, 23, 1, 1, 21, + 22, 9, 9, 22, 19, 1, 21, 5, 19, 5, 1, 33, 20, 33, 20, 8, + 4, 4, 1, 32, 2, 2, 8, 3, 32, 26, 3, 1, 7, 7, 26, 6, + 1, 6, 1, 1, 16, 1, 10, 1, 10, 2, 16, 29, 28, 2, 29, 28, + 1, 27, 5, 8, 5, 27, 1, 8, 3, 7, 3, 31, 41, 31, 1, 41, + 6, 1, 6, 7, 4, 4, 1, 1, 2, 1, 2, 11, 34, 30, 11, 1, + 30, 15, 15, 34, 36, 40, 36, 40, 35, 35, 37, 37, 39, 39, 38, 38}, + + /* value table */ + { 1, -1, 0, 2, -2, 0, 3, -3, 1, -1, 4, -4, 5, -5, 1, -1, + 6, -6, 2, -2, 7, -7, 1, -1, 8, -8, 9, -9, 3, -3, 1, -1, + 10, -10, 2, -2, 11, -11, 1, -1, 12, 4, -12, -4, 1, -1, 13, -13, + 1, -1, 14, -14, 2, 5, 15, -2, -5, -15, -3, 3, 16, -16, 17, 1, + -1, -17, 6, 18, -6, -18, 2, -2, 19, -19, 1, -1, 20, -20, 4, -4, + 7, -7, 21, -21, 1, -1, 2, 3, -3, 22, -2, -22, 8, 23, -8, 1, + 2, -23, -1, 2, -2, -2, 24, 1, -24, -1, 25, 5, -5, 1, -25, -1, + 9, -9, 26, 1, -26, 3, 1, -1, 27, -3, -1, -27, 1, 3, -1, -3, + 28, -4, 4, 10, -10, -28, 1, -1, 1, -1, 29, 6, -29, -6, 30, -4, + 3, 3, -3, -30, 1, 4, -1, 31, -3, 1, 11, -11, -1, -31, 32, -1, + -1, 2, -2, 1, 1, -32, 1, 4, -1, -4, 33, -1, 1, 1, -1, 5, + 5, -5, -33, -1, -12, 12, -5, -7, 1, 1, 7, 34, 4, -4, -1, 4, + -34, -4, 35, 36, -2, -35, -2, -36, 2, 13, 2, -1, 1, -13, 1, -1, + 37, 1, -5, 6, 5, -1, 38, -6, -8, 5, 8, -1, 1, 1, -37, -1, + 5, 39, -5, -5, 6, -6, -38, -39, -14, 40, 14, 2, 1, 1, -2, -40, + -1, -2, 2, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, -1} +},{ + /* MapTab1 */ + 0, /* eob_sym */ + 38, /* esc_sym */ + /* run table */ + {0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 8, 6, 8, 7, + 7, 9, 9, 10, 10, 11, 11, 1, 12, 1, 12, 13, 13, 16, 14, 16, + 14, 15, 15, 17, 17, 18, 0, 18, 19, 20, 21, 19, 22, 21, 20, 22, + 25, 24, 2, 25, 24, 23, 23, 2, 26, 28, 26, 28, 29, 27, 29, 27, + 33, 33, 1, 32, 1, 3, 32, 30, 36, 3, 36, 30, 31, 31, 35, 34, + 37, 41, 34, 35, 37, 4, 41, 4, 49, 8, 8, 49, 40, 38, 5, 38, + 40, 39, 5, 39, 42, 43, 42, 7, 57, 6, 43, 44, 6, 50, 7, 44, + 57, 48, 50, 48, 45, 45, 46, 47, 51, 46, 47, 58, 1, 51, 58, 1, + 52, 59, 53, 9, 52, 55, 55, 59, 53, 56, 54, 56, 54, 9, 64, 64, + 60, 63, 60, 63, 61, 62, 61, 62, 2, 10, 2, 10, 11, 1, 11, 13, + 12, 1, 12, 13, 16, 16, 8, 8, 14, 3, 3, 15, 14, 15, 4, 4, + 1, 17, 17, 5, 1, 7, 7, 5, 6, 1, 2, 2, 6, 22, 1, 25, + 21, 22, 8, 24, 1, 21, 25, 24, 8, 18, 18, 23, 9, 20, 23, 33, + 29, 33, 20, 1, 19, 1, 29, 36, 9, 36, 19, 41, 28, 57, 32, 3, + 28, 3, 1, 27, 49, 49, 1, 32, 26, 26, 2, 4, 4, 7, 57, 41, + 2, 7, 10, 5, 37, 16, 10, 27, 8, 8, 13, 16, 37, 13, 1, 5}, + + /* value table */ + {0, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, + -1, 1, -1, 1, -1, 1, -1, 2, 1, -2, -1, 1, -1, 1, 1, -1, + -1, 1, -1, 1, -1, 1, 0, -1, 1, 1, 1, -1, 1, -1, -1, -1, + 1, 1, 2, -1, -1, 1, -1, -2, 1, 1, -1, -1, 1, 1, -1, -1, + 1, -1, 3, 1, -3, 2, -1, 1, 1, -2, -1, -1, -1, 1, 1, 1, + 1, 1, -1, -1, -1, 2, -1, -2, 1, 2, -2, -1, 1, 1, 2, -1, + -1, 1, -2, -1, 1, 1, -1, 2, 1, 2, -1, 1, -2, -1, -2, -1, + -1, 1, 1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 4, -1, -1, -4, + 1, 1, 1, 2, -1, -1, 1, -1, -1, 1, -1, -1, 1, -2, 1, -1, + 1, 1, -1, -1, 1, 1, -1, -1, 3, 2, -3, -2, 2, 5, -2, 2, + 2, -5, -2, -2, -2, 2, -3, 3, 2, 3, -3, 2, -2, -2, 3, -3, + 6, 2, -2, 3, -6, 3, -3, -3, 3, 7, -4, 4, -3, 2, -7, 2, + 2, -2, -4, 2, 8, -2, -2, -2, 4, 2, -2, 2, 3, 2, -2, -2, + 2, 2, -2, -8, -2, 9, -2, 2, -3, -2, 2, -2, 2, 2, 2, 4, + -2, -4, 10, 2, 2, -2, -9, -2, 2, -2, 5, 4, -4, 4, -2, 2, + -5, -4, -3, 4, 2, -3, 3, -2, -5, 5, 3, 3, -2, -3, -10, -4} +},{ + /* MapTab2 */ + 2, /* eob_sym */ + 11, /* esc_sym */ + /* run table */ + {1, 1, 0, 2, 2, 1, 1, 3, 3, 4, 4, 0, 1, 1, 5, 5, + 2, 2, 6, 6, 7, 7, 1, 8, 1, 8, 3, 3, 9, 9, 1, 2, + 2, 1, 4, 10, 4, 10, 11, 11, 1, 5, 12, 12, 1, 5, 13, 13, + 3, 3, 6, 6, 2, 2, 14, 14, 16, 16, 15, 7, 15, 8, 8, 7, + 1, 1, 17, 17, 4, 4, 1, 1, 18, 18, 2, 2, 5, 5, 25, 3, + 9, 3, 25, 9, 19, 24, 19, 24, 1, 21, 20, 1, 21, 22, 20, 22, + 23, 23, 8, 6, 33, 6, 8, 33, 7, 7, 26, 26, 1, 32, 1, 32, + 28, 4, 28, 10, 29, 27, 27, 10, 41, 4, 29, 2, 2, 41, 36, 31, + 49, 31, 34, 30, 34, 36, 30, 35, 1, 49, 11, 5, 35, 11, 1, 3, + 3, 5, 37, 37, 8, 40, 8, 40, 12, 12, 42, 42, 1, 38, 16, 57, + 1, 6, 16, 39, 38, 6, 7, 7, 13, 13, 39, 43, 2, 43, 57, 2, + 50, 9, 44, 9, 50, 4, 15, 48, 44, 4, 1, 15, 48, 14, 14, 1, + 45, 45, 8, 3, 5, 8, 51, 47, 3, 46, 46, 47, 5, 51, 1, 17, + 17, 58, 1, 58, 2, 52, 52, 2, 53, 7, 59, 6, 6, 56, 53, 55, + 7, 55, 1, 54, 59, 56, 54, 10, 1, 10, 4, 60, 1, 60, 8, 4, + 8, 64, 64, 61, 1, 63, 3, 63, 62, 61, 5, 11, 5, 3, 11, 62}, + + /* value table */ + { 1, -1, 0, 1, -1, 2, -2, 1, -1, 1, -1, 0, 3, -3, 1, -1, + 2, -2, 1, -1, 1, -1, 4, 1, -4, -1, 2, -2, 1, -1, 5, 3, + -3, -5, 2, 1, -2, -1, 1, -1, 6, 2, 1, -1, -6, -2, 1, -1, + 3, -3, 2, -2, 4, -4, 1, -1, 1, -1, 1, 2, -1, 2, -2, -2, + 7, -7, 1, -1, 3, -3, 8, -8, 1, -1, 5, -5, 3, -3, 1, 4, + 2, -4, -1, -2, 1, 1, -1, -1, 9, 1, 1, -9, -1, 1, -1, -1, + 1, -1, 3, -3, 1, 3, -3, -1, 3, -3, 1, -1, 10, 1, -10, -1, + 1, 4, -1, 2, 1, -1, 1, -2, 1, -4, -1, 6, -6, -1, 1, 1, + 1, -1, 1, 1, -1, -1, -1, 1, 11, -1, -2, 4, -1, 2, -11, 5, + -5, -4, -1, 1, 4, 1, -4, -1, -2, 2, 1, -1, 12, 1, -2, 1, + -12, 4, 2, 1, -1, -4, 4, -4, 2, -2, -1, 1, 7, -1, -1, -7, + -1, -3, 1, 3, 1, 5, 2, 1, -1, -5, 13, -2, -1, 2, -2, -13, + 1, -1, 5, 6, 5, -5, 1, 1, -6, 1, -1, -1, -5, -1, 14, 2, + -2, 1, -14, -1, 8, 1, -1, -8, 1, 5, 1, 5, -5, 1, -1, 1, + -5, -1, 15, 1, -1, -1, -1, 3, -15, -3, 6, 1, 16, -1, 6, -6, + -6, 1, -1, 1, -16, 1, 7, -1, 1, -1, -6, -3, 6, -7, 3, -1} +},{ + /* MapTab3 */ + 0, /* eob_sym */ + 35, /* esc_sym */ + /* run table */ + {0, 1, 1, 2, 2, 3, 3, 4, 4, 1, 1, 5, 5, 6, 6, 7, + 7, 8, 8, 9, 9, 2, 2, 10, 10, 1, 1, 11, 11, 12, 12, 3, + 3, 13, 13, 0, 14, 14, 16, 15, 16, 15, 4, 4, 17, 1, 17, 1, + 5, 5, 18, 18, 2, 2, 6, 6, 8, 19, 7, 8, 7, 19, 20, 20, + 21, 21, 22, 24, 22, 24, 23, 23, 1, 1, 25, 25, 3, 3, 26, 26, + 9, 9, 27, 27, 28, 28, 33, 29, 4, 33, 29, 1, 4, 1, 32, 32, + 2, 2, 31, 10, 30, 10, 30, 31, 34, 34, 5, 5, 36, 36, 35, 41, + 35, 11, 41, 11, 37, 1, 8, 8, 37, 6, 1, 6, 40, 7, 7, 40, + 12, 38, 12, 39, 39, 38, 49, 13, 49, 13, 3, 42, 3, 42, 16, 16, + 43, 43, 14, 14, 1, 1, 44, 15, 44, 15, 2, 2, 57, 48, 50, 48, + 57, 50, 4, 45, 45, 4, 46, 47, 47, 46, 1, 51, 1, 17, 17, 51, + 8, 9, 9, 5, 58, 8, 58, 5, 52, 52, 55, 56, 53, 56, 55, 59, + 59, 53, 54, 1, 6, 54, 7, 7, 6, 1, 2, 3, 2, 3, 64, 60, + 60, 10, 10, 64, 61, 62, 61, 63, 1, 63, 62, 1, 18, 24, 18, 4, + 25, 4, 8, 21, 21, 1, 24, 22, 25, 22, 8, 11, 19, 11, 23, 1, + 20, 23, 19, 20, 5, 12, 5, 1, 16, 2, 12, 13, 2, 13, 1, 16}, + + /* value table */ + { 0, 1, -1, 1, -1, 1, -1, 1, -1, 2, -2, 1, -1, 1, -1, 1, + -1, 1, -1, 1, -1, 2, -2, 1, -1, 3, -3, 1, -1, 1, -1, 2, + -2, 1, -1, 0, 1, -1, 1, 1, -1, -1, 2, -2, 1, 4, -1, -4, + 2, -2, 1, -1, -3, 3, 2, -2, 2, 1, 2, -2, -2, -1, 1, -1, + 1, -1, 1, 1, -1, -1, 1, -1, 5, -5, 1, -1, 3, -3, 1, -1, + 2, -2, 1, -1, 1, -1, 1, 1, 3, -1, -1, 6, -3, -6, -1, 1, + 4, -4, 1, 2, 1, -2, -1, -1, 1, -1, 3, -3, 1, -1, 1, 1, + -1, 2, -1, -2, 1, 7, -3, 3, -1, 3, -7, -3, 1, -3, 3, -1, + 2, 1, -2, 1, -1, -1, 1, 2, -1, -2, -4, -1, 4, 1, 2, -2, + 1, -1, -2, 2, 8, -8, -1, 2, 1, -2, -5, 5, 1, -1, -1, 1, + -1, 1, 4, -1, 1, -4, -1, -1, 1, 1, 9, 1, -9, 2, -2, -1, + -4, 3, -3, -4, -1, 4, 1, 4, 1, -1, 1, -1, 1, 1, -1, 1, + -1, -1, -1, 10, 4, 1, 4, -4, -4, -10, 6, 5, -6, -5, 1, -1, + 1, 3, -3, -1, 1, -1, -1, -1, 11, 1, 1, -11, -2, -2, 2, 5, + -2, -5, -5, 2, -2, 12, 2, -2, 2, 2, 5, -3, -2, 3, -2, -12, + -2, 2, 2, 2, -5, 3, 5, 13, -3, 7, -3, -3, -7, 3, -13, 3} +},{ + /* MapTab4 */ + 0, /* eob_sym */ + 34, /* esc_sym */ + /* run table */ + {0, 1, 1, 1, 2, 2, 1, 3, 3, 1, 1, 1, 4, 4, 1, 5, + 2, 1, 5, 2, 1, 1, 6, 6, 1, 1, 1, 1, 1, 7, 3, 1, + 2, 3, 0, 1, 2, 7, 1, 1, 1, 8, 1, 1, 8, 1, 1, 1, + 9, 1, 9, 1, 2, 1, 1, 2, 1, 1, 10, 4, 1, 10, 1, 4, + 1, 1, 1, 1, 1, 3, 1, 1, 1, 3, 2, 1, 5, 1, 1, 1, + 2, 5, 1, 11, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 1, 6, 1, 6, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 12, + 3, 1, 12, 1, 1, 1, 2, 1, 1, 3, 1, 1, 1, 1, 1, 1, + 4, 1, 1, 1, 2, 1, 1, 4, 1, 1, 1, 1, 1, 1, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 2, 1, 1, 5, + 1, 1, 1, 1, 1, 7, 1, 7, 1, 1, 2, 3, 1, 1, 1, 1, + 5, 1, 1, 1, 1, 1, 1, 2, 13, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 13, 2, 1, 1, 4, 1, 1, 1, + 3, 1, 6, 1, 1, 1, 14, 1, 1, 1, 1, 1, 14, 6, 1, 1, + 1, 1, 15, 2, 4, 1, 2, 3, 15, 1, 1, 1, 8, 1, 1, 8, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1}, + + /* value table */ + { 0, 1, -1, 2, 1, -1, -2, 1, -1, 3, -3, 4, 1, -1, -4, 1, + 2, 5, -1, -2, -5, 6, 1, -1, -6, 7, -7, 8, -8, 1, 2, 9, + 3, -2, 0, -9, -3, -1, 10, -10, 11, 1, -11, 12, -1, -12, 13, -13, + 1, 14, -1, -14, 4, 15, -15, -4, 16, -16, 1, 2, 17, -1, -17, -2, + 18, -18, 19, -19, 20, 3, -20, 21, -21, -3, 5, 22, 2, -22, -23, 23, + -5, -2, 24, 1, -24, -1, 25, -25, 26, -26, -27, 27, 28, 29, -28, -29, + 6, 30, 2, -31, -2, -30, 31, -6, -32, 32, 33, -33, 34, -35, -34, 1, + 4, -36, -1, 35, 37, 36, 7, -37, 38, -4, -38, 39, 41, 40, -40, -39, + 3, 42, -43, -41, -7, -42, 43, -3, 44, -44, 45, -45, 46, 47, 8, -47, + -48, -46, 50, -50, 48, 49, 51, -49, 52, -52, 5, -51, -8, -53, 53, 3, + -56, 56, 55, 54, -54, 2, 60, -2, -55, 58, 9, -5, 59, 57, -57, -63, + -3, -58, -60, -61, 61, -59, -62, -9, 1, 64, 62, 69, -64, 63, 65, -67, + -68, 66, -65, 68, -66, -69, 67, -70, -1, 10, 71, -71, 4, 73, 72, 70, + 6, -76, -3, 74, -78, -74, 1, 78, 80, -72, -75, 76, -1, 3, -73, 79, + 75, 77, 1, 11, -4, -79, -10, -6, -1, -77, -83, -80, 2, 81, -84, -2, + 83, -81, 82, -82, 84, -87, -86, 85, -11, -85, 86, -89, 87, -88, 88, 89} +},{ + /* MapTab5 */ + 2, /* eob_sym */ + 33, /* esc_sym */ + /* run table */ + {1, 1, 0, 2, 1, 2, 1, 3, 3, 1, 1, 4, 4, 2, 2, 1, + 1, 5, 5, 6, 1, 6, 1, 7, 7, 3, 3, 2, 8, 2, 8, 1, + 1, 0, 9, 9, 1, 1, 10, 4, 10, 4, 11, 11, 2, 1, 2, 1, + 12, 12, 3, 3, 1, 1, 13, 5, 5, 13, 14, 1, 1, 14, 2, 2, + 6, 6, 15, 1, 1, 15, 16, 4, 7, 16, 4, 7, 1, 1, 3, 3, + 8, 8, 2, 2, 1, 1, 17, 17, 1, 1, 18, 18, 5, 5, 2, 2, + 1, 1, 9, 19, 9, 19, 20, 3, 3, 20, 1, 10, 21, 1, 10, 4, + 4, 21, 22, 6, 6, 22, 1, 1, 23, 24, 2, 2, 23, 24, 11, 1, + 1, 11, 7, 25, 7, 1, 1, 25, 8, 8, 3, 26, 3, 1, 12, 2, + 2, 26, 1, 12, 5, 5, 27, 4, 1, 4, 1, 27, 28, 1, 28, 13, + 1, 13, 2, 29, 2, 1, 32, 6, 1, 30, 14, 29, 14, 6, 3, 31, + 3, 1, 30, 1, 32, 31, 33, 9, 33, 1, 1, 7, 9, 7, 2, 2, + 1, 1, 4, 36, 34, 4, 5, 10, 10, 5, 34, 1, 1, 35, 8, 8, + 36, 3, 35, 1, 15, 3, 2, 1, 16, 15, 16, 2, 37, 1, 37, 1, + 1, 1, 6, 6, 38, 1, 38, 11, 1, 39, 39, 40, 11, 2, 41, 4, + 40, 1, 2, 4, 1, 1, 1, 41, 3, 1, 3, 1, 5, 7, 5, 7}, + + /* value table */ + { 1, -1, 0, 1, 2, -1, -2, 1, -1, 3, -3, 1, -1, 2, -2, 4, + -4, 1, -1, 1, 5, -1, -5, 1, -1, 2, -2, 3, 1, -3, -1, 6, + -6, 0, 1, -1, 7, -7, 1, 2, -1, -2, 1, -1, 4, 8, -4, -8, + 1, -1, 3, -3, 9, -9, 1, 2, -2, -1, 1, 10, -10, -1, 5, -5, + 2, -2, 1, 11, -11, -1, 1, 3, 2, -1, -3, -2, 12, -12, 4, -4, + 2, -2, -6, 6, 13, -13, 1, -1, 14, -14, 1, -1, 3, -3, 7, -7, + 15, -15, 2, 1, -2, -1, 1, 5, -5, -1, -16, 2, 1, 16, -2, 4, + -4, -1, 1, 3, -3, -1, 17, -17, 1, 1, -8, 8, -1, -1, 2, 18, + -18, -2, 3, 1, -3, 19, -19, -1, 3, -3, 6, 1, -6, 20, 2, 9, + -9, -1, -20, -2, 4, -4, 1, -5, 21, 5, -21, -1, 1, -22, -1, 2, + 22, -2, 10, 1, -10, 23, 1, 4, -23, 1, 2, -1, -2, -4, -7, 1, + 7, -24, -1, 24, -1, -1, 1, 3, -1, -25, 25, 4, -3, -4, 11, -11, + 26, -26, 6, 1, 1, -6, -5, -3, 3, 5, -1, -27, 27, 1, 4, -4, + -1, -8, -1, 28, 2, 8, -12, -28, -2, -2, 2, 12, -1, 29, 1, -29, + 30, -30, 5, -5, 1, -31, -1, 3, 31, -1, 1, 1, -3, -13, 1, -7, + -1, -32, 13, 7, 32, 33, -33, -1, -9, -34, 9, 34, -6, 5, 6, -5} +},{ + /* MapTab6 */ + 2, /* eob_sym */ + 13, /* esc_sym */ + /* run table */ + {1, 1, 0, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 0, 2, 2, + 4, 1, 4, 1, 1, 1, 5, 5, 1, 1, 6, 6, 2, 2, 1, 1, + 3, 3, 7, 7, 1, 1, 8, 8, 1, 1, 2, 2, 1, 9, 1, 9, + 4, 4, 10, 1, 1, 10, 1, 1, 11, 11, 3, 3, 1, 2, 1, 2, + 1, 1, 12, 12, 5, 5, 1, 1, 13, 1, 1, 13, 2, 2, 1, 1, + 6, 6, 1, 1, 4, 14, 4, 14, 3, 1, 3, 1, 1, 1, 15, 7, + 15, 2, 2, 7, 1, 1, 1, 8, 1, 8, 16, 16, 1, 1, 1, 1, + 2, 1, 1, 2, 1, 1, 3, 5, 5, 3, 4, 1, 1, 4, 1, 1, + 17, 17, 9, 1, 1, 9, 2, 2, 1, 1, 10, 10, 1, 6, 1, 1, + 6, 18, 1, 1, 18, 1, 1, 1, 2, 2, 3, 1, 3, 1, 1, 1, + 4, 1, 19, 1, 19, 7, 1, 1, 20, 1, 4, 20, 1, 7, 11, 2, + 1, 11, 21, 2, 8, 5, 1, 8, 1, 5, 21, 1, 1, 1, 22, 1, + 1, 22, 1, 1, 3, 3, 1, 23, 2, 12, 24, 1, 1, 2, 1, 1, + 12, 23, 1, 1, 24, 1, 1, 1, 4, 1, 1, 1, 2, 1, 6, 6, + 4, 2, 1, 1, 1, 1, 1, 1, 1, 14, 13, 3, 1, 25, 9, 25, + 14, 1, 9, 3, 13, 1, 1, 1, 1, 1, 10, 1, 1, 2, 10, 2}, + + /* value table */ + {-20, -1, 0, 2, -2, 1, -1, 3, -3, 1, -1, 4, -4, 0, 2, -2, + 1, 5, -1, -5, 6, -6, 1, -1, 7, -7, 1, -1, 3, -3, 8, -8, + 2, -2, 1, -1, 9, -9, 1, -1, 10, -10, 4, -4, 11, 1, -11, -1, + 2, -2, 1, 12, -12, -1, 13, -13, 1, -1, 3, -3, 14, 5, -14, -5, + -15, 15, -1, 1, 2, -2, 16, -16, 1, 17, -17, -1, 6, -6, 18, -18, + 2, -2, -19, 19, -3, 1, 3, -1, 4, 20, -4, 1, -21, 21, 1, 2, + -1, -7, 7, -2, 22, -22, 23, 2, -23, -2, 1, -1, -24, 24, -25, 25, + -8, -26, 26, 8, -27, 27, 5, 3, -3, -5, -4, 28, -28, 4, 29, -29, + 1, -1, -2, -30, 30, 2, 9, -9, -31, 31, 2, -2, -32, 3, 32, -33, + -3, 1, 33, -34, -1, 34, -35, 35, -10, 10, -6, 36, 6, -36, 37, -37, + -5, 38, 1, -38, -1, 3, 39, -39, -1, 40, 5, 1, -40, -3, 2, -11, + -41, -2, 1, 11, -3, -4, 41, 3, 42, 4, -1, -43, -42, 43, 1, -44, + 45, -1, 44, -45, -7, 7, -46, 1, -12, 2, 1, -47, 46, 12, 47, 48, + -2, -1, -48, 49, -1, -50, -49, 50, -6, -51, 51, 52, -13, 53, -4, 4, + 6, 13, -53, -52, -54, 55, 54, -55, -56, -2, 2, -8, 56, 1, -3, -1, + 2, 58, 3, 8, -2, 57, -58, -60, -59, -57, -3, 60, 59, -14, 3, 14} +},{ + /* MapTab7 */ + 2, /* eob_sym */ + 38, /* esc_sym */ + /* run table */ + {1, 1, 0, 2, 2, 1, 1, 3, 3, 4, 4, 5, 5, 1, 1, 6, + 6, 2, 2, 7, 7, 8, 8, 1, 1, 3, 3, 9, 9, 10, 10, 1, + 1, 2, 2, 4, 4, 11, 0, 11, 12, 12, 13, 13, 1, 1, 5, 5, + 14, 14, 15, 16, 15, 16, 3, 3, 1, 6, 1, 6, 2, 2, 7, 7, + 8, 8, 17, 17, 1, 1, 4, 4, 18, 18, 2, 2, 1, 19, 1, 20, + 19, 20, 21, 21, 3, 3, 22, 22, 5, 5, 24, 1, 1, 23, 9, 23, + 24, 9, 2, 2, 10, 1, 1, 10, 6, 6, 25, 4, 4, 25, 7, 7, + 26, 8, 1, 8, 3, 1, 26, 3, 11, 11, 27, 27, 2, 28, 1, 2, + 28, 1, 12, 12, 5, 5, 29, 13, 13, 29, 32, 1, 1, 33, 31, 30, + 32, 4, 30, 33, 4, 31, 3, 14, 1, 1, 3, 34, 34, 2, 2, 14, + 6, 6, 35, 36, 35, 36, 1, 15, 1, 16, 16, 15, 7, 9, 7, 9, + 37, 8, 8, 37, 1, 1, 39, 2, 38, 39, 2, 40, 5, 38, 40, 5, + 3, 3, 4, 4, 10, 10, 1, 1, 1, 1, 41, 2, 41, 2, 6, 6, + 1, 1, 11, 42, 11, 43, 3, 42, 3, 17, 4, 43, 1, 17, 7, 1, + 8, 44, 4, 7, 44, 5, 8, 2, 5, 1, 2, 48, 45, 1, 12, 45, + 12, 48, 13, 13, 1, 9, 9, 46, 1, 46, 47, 47, 49, 18, 18, 49}, + + /* value table */ + { 1, -1, 0, 1, -1, 2, -2, 1, -1, 1, -1, 1, -1, 3, -3, 1, + -1, -2, 2, 1, -1, 1, -1, 4, -4, -2, 2, 1, -1, 1, -1, 5, + -5, -3, 3, 2, -2, 1, 0, -1, 1, -1, 1, -1, 6, -6, 2, -2, + 1, -1, 1, 1, -1, -1, -3, 3, 7, 2, -7, -2, -4, 4, 2, -2, + 2, -2, 1, -1, 8, -8, 3, -3, 1, -1, -5, 5, 9, 1, -9, 1, + -1, -1, 1, -1, -4, 4, 1, -1, 3, -3, 1, -10, 10, 1, 2, -1, + -1, -2, 6, -6, 2, 11, -11, -2, 3, -3, 1, -4, 4, -1, 3, -3, + 1, 3, 12, -3, -5, -12, -1, 5, 2, -2, 1, -1, -7, 1, 13, 7, + -1, -13, 2, -2, 4, -4, 1, 2, -2, -1, 1, 14, -14, 1, 1, 1, + -1, -5, -1, -1, 5, -1, -6, 2, -15, 15, 6, 1, -1, -8, 8, -2, + -4, 4, 1, 1, -1, -1, 16, 2, -16, -2, 2, -2, 4, 3, -4, -3, + -1, -4, 4, 1, -17, 17, -1, -9, 1, 1, 9, 1, -5, -1, -1, 5, + -7, 7, 6, -6, 3, -3, 18, -18, 19, -19, 1, -10, -1, 10, -5, 5, + 20, -20, -3, 1, 3, 1, 8, -1, -8, 2, 7, -1, -21, -2, 5, 21, + 5, -1, -7, -5, 1, -6, -5, -11, 6, 22, 11, 1, 1, -22, -3, -1, + 3, -1, 3, -3, -23, 4, -4, 1, 23, -1, 1, -1, 1, -2, 2, -1} +},{ + /* MapTab8 */ + 4, /* eob_sym */ + 11, /* esc_sym */ + /* run table */ + {1, 1, 1, 1, 0, 2, 2, 1, 1, 3, 3, 0, 1, 1, 2, 2, + 4, 4, 1, 1, 5, 5, 1, 1, 2, 2, 3, 3, 6, 6, 1, 1, + 7, 7, 8, 1, 8, 2, 2, 1, 4, 4, 1, 3, 1, 3, 9, 9, + 2, 2, 1, 5, 1, 5, 10, 10, 1, 1, 11, 11, 3, 6, 3, 4, + 4, 6, 2, 2, 1, 12, 1, 12, 7, 13, 7, 13, 1, 1, 8, 8, + 2, 2, 14, 14, 16, 15, 16, 5, 5, 1, 3, 15, 1, 3, 4, 4, + 1, 1, 17, 17, 2, 2, 6, 6, 1, 18, 1, 18, 22, 21, 22, 21, + 25, 24, 25, 19, 9, 20, 9, 23, 19, 24, 20, 3, 23, 7, 3, 1, + 1, 7, 28, 26, 29, 5, 28, 26, 5, 8, 29, 4, 8, 27, 2, 2, + 4, 27, 1, 1, 10, 36, 10, 33, 33, 36, 30, 1, 32, 32, 1, 30, + 6, 31, 31, 35, 3, 6, 11, 11, 3, 2, 35, 2, 34, 1, 34, 1, + 37, 37, 12, 7, 12, 5, 41, 5, 4, 7, 1, 8, 13, 4, 1, 41, + 13, 38, 8, 38, 9, 1, 40, 40, 9, 1, 39, 2, 2, 49, 39, 42, + 3, 3, 14, 16, 49, 14, 16, 42, 43, 43, 6, 6, 15, 1, 1, 15, + 44, 44, 1, 1, 50, 48, 4, 5, 4, 7, 5, 2, 10, 10, 48, 7, + 50, 45, 2, 1, 45, 8, 8, 1, 46, 46, 3, 47, 47, 3, 1, 1}, + + /* value table */ + { 1, -1, 2, -2, 0, 1, -1, 3, -3, 1, -1, 0, 4, -4, 2, -2, + 1, -1, 5, -5, 1, -1, 6, -6, 3, -3, 2, -2, 1, -1, 7, -7, + 1, -1, 1, 8, -1, 4, -4, -8, 2, -2, 9, 3, -9, -3, 1, -1, + 5, -5, 10, 2, -10, -2, 1, -1, 11, -11, 1, -1, -4, 2, 4, 3, + -3, -2, 6, -6, 12, 1, -12, -1, 2, 1, -2, -1, 13, -13, 2, -2, + 7, -7, 1, -1, 1, 1, -1, 3, -3, 14, 5, -1, -14, -5, 4, -4, + 15, -15, 1, -1, 8, -8, -3, 3, 16, 1, -16, -1, 1, 1, -1, -1, + 1, 1, -1, 1, 2, 1, -2, 1, -1, -1, -1, 6, -1, 3, -6, 17, + -17, -3, 1, 1, 1, 4, -1, -1, -4, 3, -1, 5, -3, -1, -9, 9, + -5, 1, 18, -18, 2, 1, -2, 1, -1, -1, 1, 19, -1, 1, -19, -1, + 4, 1, -1, 1, 7, -4, -2, 2, -7, 10, -1, -10, 1, 20, -1, -20, + 1, -1, 2, 4, -2, 5, 1, -5, 6, -4, 21, 4, 2, -6, -21, -1, + -2, 1, -4, -1, -3, 22, -1, 1, 3, -22, -1, 11, -11, 1, 1, 1, + 8, -8, 2, 2, -1, -2, -2, -1, 1, -1, -5, 5, 2, 23, -23, -2, + 1, -1, 24, -24, -1, -1, 7, 6, -7, 5, -6, 12, -3, 3, 1, -5, + 1, 1, -12, 25, -1, -5, 5, -25, -1, 1, 9, 1, -1, -9, 26, -26} +} +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ivi_common.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ivi_common.h new file mode 100644 index 00000000..803c0580 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ivi_common.h @@ -0,0 +1,355 @@ +/* + * common functions for Indeo Video Interactive codecs (Indeo4 and Indeo5) + * + * Copyright (c) 2009 Maxim Poliakovski + * + * 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 + * This file contains structures and macros shared by both Indeo4 and + * Indeo5 decoders. + */ + +#ifndef AVCODEC_IVI_COMMON_H +#define AVCODEC_IVI_COMMON_H + +#include "avcodec.h" +#include "get_bits.h" +#include + +#define IVI_DEBUG 0 + +#define IVI_VLC_BITS 13 ///< max number of bits of the ivi's huffman codes + +/** + * huffman codebook descriptor + */ +typedef struct { + int32_t num_rows; + uint8_t xbits[16]; +} IVIHuffDesc; + +/** + * macroblock/block huffman table descriptor + */ +typedef struct { + int32_t tab_sel; /// index of one of the predefined tables + /// or "7" for custom one + VLC *tab; /// pointer to the table associated with tab_sel + + //! the following are used only when tab_sel == 7 + IVIHuffDesc cust_desc; /// custom Huffman codebook descriptor + VLC cust_tab; /// vlc table for custom codebook +} IVIHuffTab; + +enum { + IVI_MB_HUFF = 0, /// Huffman table is used for coding macroblocks + IVI_BLK_HUFF = 1 /// Huffman table is used for coding blocks +}; + +extern VLC ff_ivi_mb_vlc_tabs [8]; ///< static macroblock Huffman tables +extern VLC ff_ivi_blk_vlc_tabs[8]; ///< static block Huffman tables + + +/** + * Common scan patterns (defined in ivi_common.c) + */ +extern const uint8_t ff_ivi_vertical_scan_8x8[64]; +extern const uint8_t ff_ivi_horizontal_scan_8x8[64]; +extern const uint8_t ff_ivi_direct_scan_4x4[16]; + + +/** + * Declare inverse transform function types + */ +typedef void (InvTransformPtr)(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags); +typedef void (DCTransformPtr) (const int32_t *in, int16_t *out, uint32_t pitch, int blk_size); + + +/** + * run-value (RLE) table descriptor + */ +typedef struct { + uint8_t eob_sym; ///< end of block symbol + uint8_t esc_sym; ///< escape symbol + uint8_t runtab[256]; + int8_t valtab[256]; +} RVMapDesc; + +extern const RVMapDesc ff_ivi_rvmap_tabs[9]; + + +/** + * information for Indeo macroblock (16x16, 8x8 or 4x4) + */ +typedef struct { + int16_t xpos; + int16_t ypos; + uint32_t buf_offs; ///< address in the output buffer for this mb + uint8_t type; ///< macroblock type: 0 - INTRA, 1 - INTER + uint8_t cbp; ///< coded block pattern + int8_t q_delta; ///< quant delta + int8_t mv_x; ///< motion vector (x component) + int8_t mv_y; ///< motion vector (y component) +} IVIMbInfo; + + +/** + * information for Indeo tile + */ +typedef struct { + int xpos; + int ypos; + int width; + int height; + int is_empty; ///< = 1 if this tile doesn't contain any data + int data_size; ///< size of the data in bytes + int num_MBs; ///< number of macroblocks in this tile + IVIMbInfo *mbs; ///< array of macroblock descriptors + IVIMbInfo *ref_mbs; ///< ptr to the macroblock descriptors of the reference tile +} IVITile; + + +/** + * information for Indeo wavelet band + */ +typedef struct { + int plane; ///< plane number this band belongs to + int band_num; ///< band number + int width; + int height; + const uint8_t *data_ptr; ///< ptr to the first byte of the band data + int data_size; ///< size of the band data + int16_t *buf; ///< pointer to the output buffer for this band + int16_t *ref_buf; ///< pointer to the reference frame buffer (for motion compensation) + int16_t *bufs[3]; ///< array of pointers to the band buffers + int pitch; ///< pitch associated with the buffers above + int is_empty; ///< = 1 if this band doesn't contain any data + int mb_size; ///< macroblock size + int blk_size; ///< block size + int is_halfpel; ///< precision of the motion compensation: 0 - fullpel, 1 - halfpel + int inherit_mv; ///< tells if motion vector is inherited from reference macroblock + int inherit_qdelta; ///< tells if quantiser delta is inherited from reference macroblock + int qdelta_present; ///< tells if Qdelta signal is present in the bitstream (Indeo5 only) + int quant_mat; ///< dequant matrix index + int glob_quant; ///< quant base for this band + const uint8_t *scan; ///< ptr to the scan pattern + + IVIHuffTab blk_vlc; ///< vlc table for decoding block data + + int num_corr; ///< number of correction entries + uint8_t corr[61*2]; ///< rvmap correction pairs + int rvmap_sel; ///< rvmap table selector + RVMapDesc *rv_map; ///< ptr to the RLE table for this band + int num_tiles; ///< number of tiles in this band + IVITile *tiles; ///< array of tile descriptors + InvTransformPtr *inv_transform; + DCTransformPtr *dc_transform; + int is_2d_trans; ///< 1 indicates that the two-dimensional inverse transform is used + int32_t checksum; ///< for debug purposes + int checksum_present; + int bufsize; ///< band buffer size in bytes + const uint16_t *intra_base; ///< quantization matrix for intra blocks + const uint16_t *inter_base; ///< quantization matrix for inter blocks + const uint8_t *intra_scale; ///< quantization coefficient for intra blocks + const uint8_t *inter_scale; ///< quantization coefficient for inter blocks +} IVIBandDesc; + + +/** + * color plane (luma or chroma) information + */ +typedef struct { + uint16_t width; + uint16_t height; + uint8_t num_bands; ///< number of bands this plane subdivided into + IVIBandDesc *bands; ///< array of band descriptors +} IVIPlaneDesc; + + +typedef struct { + uint16_t pic_width; + uint16_t pic_height; + uint16_t chroma_width; + uint16_t chroma_height; + uint16_t tile_width; + uint16_t tile_height; + uint8_t luma_bands; + uint8_t chroma_bands; +} IVIPicConfig; + +/** compare some properties of two pictures */ +static inline int ivi_pic_config_cmp(IVIPicConfig *str1, IVIPicConfig *str2) +{ + return (str1->pic_width != str2->pic_width || str1->pic_height != str2->pic_height || + str1->chroma_width != str2->chroma_width || str1->chroma_height != str2->chroma_height || + str1->tile_width != str2->tile_width || str1->tile_height != str2->tile_height || + str1->luma_bands != str2->luma_bands || str1->chroma_bands != str2->chroma_bands); +} + +/** calculate number of tiles in a stride */ +#define IVI_NUM_TILES(stride, tile_size) (((stride) + (tile_size) - 1) / (tile_size)) + +/** calculate number of macroblocks in a tile */ +#define IVI_MBs_PER_TILE(tile_width, tile_height, mb_size) \ + ((((tile_width) + (mb_size) - 1) / (mb_size)) * (((tile_height) + (mb_size) - 1) / (mb_size))) + +/** convert unsigned values into signed ones (the sign is in the LSB) */ +#define IVI_TOSIGNED(val) (-(((val) >> 1) ^ -((val) & 1))) + +/** scale motion vector */ +static inline int ivi_scale_mv(int mv, int mv_scale) +{ + return (mv + (mv > 0) + (mv_scale - 1)) >> mv_scale; +} + +/** + * Generate a huffman codebook from the given descriptor + * and convert it into the FFmpeg VLC table. + * + * @param[in] cb pointer to codebook descriptor + * @param[out] vlc where to place the generated VLC table + * @param[in] flag flag: 1 - for static or 0 for dynamic tables + * @return result code: 0 - OK, -1 = error (invalid codebook descriptor) + */ +int ff_ivi_create_huff_from_desc(const IVIHuffDesc *cb, VLC *vlc, int flag); + +/** + * Initialize static codes used for macroblock and block decoding. + */ +void ff_ivi_init_static_vlc(void); + +/** + * Decode a huffman codebook descriptor from the bitstream + * and select specified huffman table. + * + * @param[in,out] gb the GetBit context + * @param[in] desc_coded flag signalling if table descriptor was coded + * @param[in] which_tab codebook purpose (IVI_MB_HUFF or IVI_BLK_HUFF) + * @param[out] huff_tab pointer to the descriptor of the selected table + * @param[in] avctx AVCodecContext pointer + * @return zero on success, negative value otherwise + */ +int ff_ivi_dec_huff_desc(GetBitContext *gb, int desc_coded, int which_tab, + IVIHuffTab *huff_tab, AVCodecContext *avctx); + +/** + * Compare two huffman codebook descriptors. + * + * @param[in] desc1 ptr to the 1st descriptor to compare + * @param[in] desc2 ptr to the 2nd descriptor to compare + * @return comparison result: 0 - equal, 1 - not equal + */ +int ff_ivi_huff_desc_cmp(const IVIHuffDesc *desc1, const IVIHuffDesc *desc2); + +/** + * Copy huffman codebook descriptors. + * + * @param[out] dst ptr to the destination descriptor + * @param[in] src ptr to the source descriptor + */ +void ff_ivi_huff_desc_copy(IVIHuffDesc *dst, const IVIHuffDesc *src); + +/** + * Initialize planes (prepares descriptors, allocates buffers etc). + * + * @param[in,out] planes pointer to the array of the plane descriptors + * @param[in] cfg pointer to the ivi_pic_config structure describing picture layout + * @return result code: 0 - OK + */ +int ff_ivi_init_planes(IVIPlaneDesc *planes, const IVIPicConfig *cfg); + +/** + * Free planes, bands and macroblocks buffers. + * + * @param[in] planes pointer to the array of the plane descriptors + */ +void ff_ivi_free_buffers(IVIPlaneDesc *planes); + +/** + * Initialize tile and macroblock descriptors. + * + * @param[in,out] planes pointer to the array of the plane descriptors + * @param[in] tile_width tile width + * @param[in] tile_height tile height + * @return result code: 0 - OK + */ +int ff_ivi_init_tiles(IVIPlaneDesc *planes, int tile_width, int tile_height); + +/** + * Decode size of the tile data. + * The size is stored as a variable-length field having the following format: + * if (tile_data_size < 255) than this field is only one byte long + * if (tile_data_size >= 255) than this field four is byte long: 0xFF X1 X2 X3 + * where X1-X3 is size of the tile data + * + * @param[in,out] gb the GetBit context + * @return size of the tile data in bytes + */ +int ff_ivi_dec_tile_data_size(GetBitContext *gb); + +/** + * Decode block data: + * extract huffman-coded transform coefficients from the bitstream, + * dequantize them, apply inverse transform and motion compensation + * in order to reconstruct the picture. + * + * @param[in,out] gb the GetBit context + * @param[in] band pointer to the band descriptor + * @param[in] tile pointer to the tile descriptor + * @return result code: 0 - OK, -1 = error (corrupted blocks data) + */ +int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile); + +/** + * Handle empty tiles by performing data copying and motion + * compensation respectively. + * + * @param[in] avctx ptr to the AVCodecContext + * @param[in] band pointer to the band descriptor + * @param[in] tile pointer to the tile descriptor + * @param[in] mv_scale scaling factor for motion vectors + */ +void ff_ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band, + IVITile *tile, int32_t mv_scale); + +/** + * Convert and output the current plane. + * This conversion is done by adding back the bias value of 128 + * (subtracted in the encoder) and clipping the result. + * + * @param[in] plane pointer to the descriptor of the plane being processed + * @param[out] dst pointer to the buffer receiving converted pixels + * @param[in] dst_pitch pitch for moving to the next y line + */ +void ff_ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, int dst_pitch); + +#if IVI_DEBUG +/** + * Calculate band checksum from band data. + */ +uint16_t ivi_calc_band_checksum (IVIBandDesc *band); + +/** + * Verify that band data lies in range. + */ +int ivi_check_band (IVIBandDesc *band, const uint8_t *ref, int pitch); +#endif + +#endif /* AVCODEC_IVI_COMMON_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ivi_dsp.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ivi_dsp.c new file mode 100644 index 00000000..ccaffd45 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ivi_dsp.c @@ -0,0 +1,467 @@ +/* + * DSP functions for Indeo Video Interactive codecs (Indeo4 and Indeo5) + * + * Copyright (c) 2009 Maxim Poliakovski + * + * 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 + * DSP functions (inverse transforms, motion compensation, wavelet recompostions) + * for Indeo Video Interactive codecs. + */ + +#include "avcodec.h" +#include "dsputil.h" +#include "dwt.h" +#include "ivi_common.h" +#include "ivi_dsp.h" + +void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, + const int dst_pitch, const int num_bands) +{ + int x, y, indx; + int32_t p0, p1, p2, p3, tmp0, tmp1, tmp2; + int32_t b0_1, b0_2, b1_1, b1_2, b1_3, b2_1, b2_2, b2_3, b2_4, b2_5, b2_6; + int32_t b3_1, b3_2, b3_3, b3_4, b3_5, b3_6, b3_7, b3_8, b3_9; + int32_t pitch, back_pitch; + const IDWTELEM *b0_ptr, *b1_ptr, *b2_ptr, *b3_ptr; + + /* all bands should have the same pitch */ + pitch = plane->bands[0].pitch; + + /* pixels at the position "y-1" will be set to pixels at the "y" for the 1st iteration */ + back_pitch = 0; + + /* get pointers to the wavelet bands */ + b0_ptr = plane->bands[0].buf; + b1_ptr = plane->bands[1].buf; + b2_ptr = plane->bands[2].buf; + b3_ptr = plane->bands[3].buf; + + for (y = 0; y < plane->height; y += 2) { + /* load storage variables with values */ + if (num_bands > 0) { + b0_1 = b0_ptr[0]; + b0_2 = b0_ptr[pitch]; + } + + if (num_bands > 1) { + b1_1 = b1_ptr[back_pitch]; + b1_2 = b1_ptr[0]; + b1_3 = b1_1 - b1_2*6 + b1_ptr[pitch]; + } + + if (num_bands > 2) { + b2_2 = b2_ptr[0]; // b2[x, y ] + b2_3 = b2_2; // b2[x+1,y ] = b2[x,y] + b2_5 = b2_ptr[pitch]; // b2[x ,y+1] + b2_6 = b2_5; // b2[x+1,y+1] = b2[x,y+1] + } + + if (num_bands > 3) { + b3_2 = b3_ptr[back_pitch]; // b3[x ,y-1] + b3_3 = b3_2; // b3[x+1,y-1] = b3[x ,y-1] + b3_5 = b3_ptr[0]; // b3[x ,y ] + b3_6 = b3_5; // b3[x+1,y ] = b3[x ,y ] + b3_8 = b3_2 - b3_5*6 + b3_ptr[pitch]; + b3_9 = b3_8; + } + + for (x = 0, indx = 0; x < plane->width; x+=2, indx++) { + /* some values calculated in the previous iterations can */ + /* be reused in the next ones, so do appropriate copying */ + b2_1 = b2_2; // b2[x-1,y ] = b2[x, y ] + b2_2 = b2_3; // b2[x ,y ] = b2[x+1,y ] + b2_4 = b2_5; // b2[x-1,y+1] = b2[x ,y+1] + b2_5 = b2_6; // b2[x ,y+1] = b2[x+1,y+1] + b3_1 = b3_2; // b3[x-1,y-1] = b3[x ,y-1] + b3_2 = b3_3; // b3[x ,y-1] = b3[x+1,y-1] + b3_4 = b3_5; // b3[x-1,y ] = b3[x ,y ] + b3_5 = b3_6; // b3[x ,y ] = b3[x+1,y ] + b3_7 = b3_8; // vert_HPF(x-1) + b3_8 = b3_9; // vert_HPF(x ) + + p0 = p1 = p2 = p3 = 0; + + /* process the LL-band by applying LPF both vertically and horizontally */ + if (num_bands > 0) { + tmp0 = b0_1; + tmp2 = b0_2; + b0_1 = b0_ptr[indx+1]; + b0_2 = b0_ptr[pitch+indx+1]; + tmp1 = tmp0 + b0_1; + + p0 = tmp0 << 4; + p1 = tmp1 << 3; + p2 = (tmp0 + tmp2) << 3; + p3 = (tmp1 + tmp2 + b0_2) << 2; + } + + /* process the HL-band by applying HPF vertically and LPF horizontally */ + if (num_bands > 1) { + tmp0 = b1_2; + tmp1 = b1_1; + b1_2 = b1_ptr[indx+1]; + b1_1 = b1_ptr[back_pitch+indx+1]; + + tmp2 = tmp1 - tmp0*6 + b1_3; + b1_3 = b1_1 - b1_2*6 + b1_ptr[pitch+indx+1]; + + p0 += (tmp0 + tmp1) << 3; + p1 += (tmp0 + tmp1 + b1_1 + b1_2) << 2; + p2 += tmp2 << 2; + p3 += (tmp2 + b1_3) << 1; + } + + /* process the LH-band by applying LPF vertically and HPF horizontally */ + if (num_bands > 2) { + b2_3 = b2_ptr[indx+1]; + b2_6 = b2_ptr[pitch+indx+1]; + + tmp0 = b2_1 + b2_2; + tmp1 = b2_1 - b2_2*6 + b2_3; + + p0 += tmp0 << 3; + p1 += tmp1 << 2; + p2 += (tmp0 + b2_4 + b2_5) << 2; + p3 += (tmp1 + b2_4 - b2_5*6 + b2_6) << 1; + } + + /* process the HH-band by applying HPF both vertically and horizontally */ + if (num_bands > 3) { + b3_6 = b3_ptr[indx+1]; // b3[x+1,y ] + b3_3 = b3_ptr[back_pitch+indx+1]; // b3[x+1,y-1] + + tmp0 = b3_1 + b3_4; + tmp1 = b3_2 + b3_5; + tmp2 = b3_3 + b3_6; + + b3_9 = b3_3 - b3_6*6 + b3_ptr[pitch+indx+1]; + + p0 += (tmp0 + tmp1) << 2; + p1 += (tmp0 - tmp1*6 + tmp2) << 1; + p2 += (b3_7 + b3_8) << 1; + p3 += b3_7 - b3_8*6 + b3_9; + } + + /* output four pixels */ + dst[x] = av_clip_uint8((p0 >> 6) + 128); + dst[x+1] = av_clip_uint8((p1 >> 6) + 128); + dst[dst_pitch+x] = av_clip_uint8((p2 >> 6) + 128); + dst[dst_pitch+x+1] = av_clip_uint8((p3 >> 6) + 128); + }// for x + + dst += dst_pitch << 1; + + back_pitch = -pitch; + + b0_ptr += pitch; + b1_ptr += pitch; + b2_ptr += pitch; + b3_ptr += pitch; + } +} + +/** butterfly operation for the inverse slant transform */ +#define IVI_SLANT_BFLY(s1, s2, o1, o2, t) \ + t = s1 - s2;\ + o1 = s1 + s2;\ + o2 = t;\ + +/** This is a reflection a,b = 1/2, 5/4 for the inverse slant transform */ +#define IVI_IREFLECT(s1, s2, o1, o2, t) \ + t = ((s1 + s2*2 + 2) >> 2) + s1;\ + o2 = ((s1*2 - s2 + 2) >> 2) - s2;\ + o1 = t;\ + +/** This is a reflection a,b = 1/2, 7/8 for the inverse slant transform */ +#define IVI_SLANT_PART4(s1, s2, o1, o2, t) \ + t = s2 + ((s1*4 - s2 + 4) >> 3);\ + o2 = s1 + ((-s1 - s2*4 + 4) >> 3);\ + o1 = t;\ + +/** inverse slant8 transform */ +#define IVI_INV_SLANT8(s1, s4, s8, s5, s2, s6, s3, s7,\ + d1, d2, d3, d4, d5, d6, d7, d8,\ + t0, t1, t2, t3, t4, t5, t6, t7, t8) {\ + IVI_SLANT_PART4(s4, s5, t4, t5, t0);\ +\ + IVI_SLANT_BFLY(s1, t5, t1, t5, t0); IVI_SLANT_BFLY(s2, s6, t2, t6, t0);\ + IVI_SLANT_BFLY(s7, s3, t7, t3, t0); IVI_SLANT_BFLY(t4, s8, t4, t8, t0);\ +\ + IVI_SLANT_BFLY(t1, t2, t1, t2, t0); IVI_IREFLECT (t4, t3, t4, t3, t0);\ + IVI_SLANT_BFLY(t5, t6, t5, t6, t0); IVI_IREFLECT (t8, t7, t8, t7, t0);\ + IVI_SLANT_BFLY(t1, t4, t1, t4, t0); IVI_SLANT_BFLY(t2, t3, t2, t3, t0);\ + IVI_SLANT_BFLY(t5, t8, t5, t8, t0); IVI_SLANT_BFLY(t6, t7, t6, t7, t0);\ + d1 = COMPENSATE(t1);\ + d2 = COMPENSATE(t2);\ + d3 = COMPENSATE(t3);\ + d4 = COMPENSATE(t4);\ + d5 = COMPENSATE(t5);\ + d6 = COMPENSATE(t6);\ + d7 = COMPENSATE(t7);\ + d8 = COMPENSATE(t8);} + +/** inverse slant4 transform */ +#define IVI_INV_SLANT4(s1, s4, s2, s3, d1, d2, d3, d4, t0, t1, t2, t3, t4) {\ + IVI_SLANT_BFLY(s1, s2, t1, t2, t0); IVI_IREFLECT (s4, s3, t4, t3, t0);\ +\ + IVI_SLANT_BFLY(t1, t4, t1, t4, t0); IVI_SLANT_BFLY(t2, t3, t2, t3, t0);\ + d1 = COMPENSATE(t1);\ + d2 = COMPENSATE(t2);\ + d3 = COMPENSATE(t3);\ + d4 = COMPENSATE(t4);} + +void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags) +{ + int i; + const int32_t *src; + int32_t *dst; + int tmp[64]; + int t0, t1, t2, t3, t4, t5, t6, t7, t8; + +#define COMPENSATE(x) (x) + src = in; + dst = tmp; + for (i = 0; i < 8; i++) { + if (flags[i]) { + IVI_INV_SLANT8(src[0], src[8], src[16], src[24], src[32], src[40], src[48], src[56], + dst[0], dst[8], dst[16], dst[24], dst[32], dst[40], dst[48], dst[56], + t0, t1, t2, t3, t4, t5, t6, t7, t8); + } else + dst[0] = dst[8] = dst[16] = dst[24] = dst[32] = dst[40] = dst[48] = dst[56] = 0; + + src++; + dst++; + } +#undef COMPENSATE + +#define COMPENSATE(x) ((x + 1)>>1) + src = tmp; + for (i = 0; i < 8; i++) { + if (!src[0] && !src[1] && !src[2] && !src[3] && !src[4] && !src[5] && !src[6] && !src[7]) { + memset(out, 0, 8*sizeof(out[0])); + } else { + IVI_INV_SLANT8(src[0], src[1], src[2], src[3], src[4], src[5], src[6], src[7], + out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7], + t0, t1, t2, t3, t4, t5, t6, t7, t8); + } + src += 8; + out += pitch; + } +#undef COMPENSATE +} + +void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags) +{ + int i; + const int32_t *src; + int32_t *dst; + int tmp[16]; + int t0, t1, t2, t3, t4; + +#define COMPENSATE(x) (x) + src = in; + dst = tmp; + for (i = 0; i < 4; i++) { + if (flags[i]) { + IVI_INV_SLANT4(src[0], src[4], src[8], src[12], + dst[0], dst[4], dst[8], dst[12], + t0, t1, t2, t3, t4); + } else + dst[0] = dst[4] = dst[8] = dst[12] = 0; + + src++; + dst++; + } +#undef COMPENSATE + +#define COMPENSATE(x) ((x + 1)>>1) + src = tmp; + for (i = 0; i < 4; i++) { + if (!src[0] && !src[1] && !src[2] && !src[3]) { + out[0] = out[1] = out[2] = out[3] = 0; + } else { + IVI_INV_SLANT4(src[0], src[1], src[2], src[3], + out[0], out[1], out[2], out[3], + t0, t1, t2, t3, t4); + } + src += 4; + out += pitch; + } +#undef COMPENSATE +} + +void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size) +{ + int x, y; + int16_t dc_coeff; + + dc_coeff = (*in + 1) >> 1; + + for (y = 0; y < blk_size; out += pitch, y++) { + for (x = 0; x < blk_size; x++) + out[x] = dc_coeff; + } +} + +void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags) +{ + int i; + int t0, t1, t2, t3, t4, t5, t6, t7, t8; + +#define COMPENSATE(x) ((x + 1)>>1) + for (i = 0; i < 8; i++) { + if (!in[0] && !in[1] && !in[2] && !in[3] && !in[4] && !in[5] && !in[6] && !in[7]) { + memset(out, 0, 8*sizeof(out[0])); + } else { + IVI_INV_SLANT8( in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7], + out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7], + t0, t1, t2, t3, t4, t5, t6, t7, t8); + } + in += 8; + out += pitch; + } +#undef COMPENSATE +} + +void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size) +{ + int x, y; + int16_t dc_coeff; + + dc_coeff = (*in + 1) >> 1; + + for (x = 0; x < blk_size; x++) + out[x] = dc_coeff; + + out += pitch; + + for (y = 1; y < blk_size; out += pitch, y++) { + for (x = 0; x < blk_size; x++) + out[x] = 0; + } +} + +void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags) +{ + int i, row2, row4, row8; + int t0, t1, t2, t3, t4, t5, t6, t7, t8; + + row2 = pitch << 1; + row4 = pitch << 2; + row8 = pitch << 3; + +#define COMPENSATE(x) ((x + 1)>>1) + for (i = 0; i < 8; i++) { + if (flags[i]) { + IVI_INV_SLANT8(in[0], in[8], in[16], in[24], in[32], in[40], in[48], in[56], + out[0], out[pitch], out[row2], out[row2 + pitch], out[row4], + out[row4 + pitch], out[row4 + row2], out[row8 - pitch], + t0, t1, t2, t3, t4, t5, t6, t7, t8); + } else { + out[0] = out[pitch] = out[row2] = out[row2 + pitch] = out[row4] = + out[row4 + pitch] = out[row4 + row2] = out[row8 - pitch] = 0; + } + + in++; + out++; + } +#undef COMPENSATE +} + +void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size) +{ + int x, y; + int16_t dc_coeff; + + dc_coeff = (*in + 1) >> 1; + + for (y = 0; y < blk_size; out += pitch, y++) { + out[0] = dc_coeff; + for (x = 1; x < blk_size; x++) + out[x] = 0; + } +} + +void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch, + const uint8_t *flags) +{ + int x, y; + + for (y = 0; y < 8; out += pitch, in += 8, y++) + for (x = 0; x < 8; x++) + out[x] = in[x]; +} + +void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch, + int blk_size) +{ + int y; + + out[0] = in[0]; + memset(out + 1, 0, 7*sizeof(out[0])); + out += pitch; + + for (y = 1; y < 8; out += pitch, y++) + memset(out, 0, 8*sizeof(out[0])); +} + +#define IVI_MC_TEMPLATE(size, suffix, OP) \ +void ff_ivi_mc_ ## size ##x## size ## suffix (int16_t *buf, const int16_t *ref_buf, \ + uint32_t pitch, int mc_type) \ +{ \ + int i, j; \ + const int16_t *wptr; \ +\ + switch (mc_type) { \ + case 0: /* fullpel (no interpolation) */ \ + for (i = 0; i < size; i++, buf += pitch, ref_buf += pitch) { \ + for (j = 0; j < size; j++) {\ + OP(buf[j], ref_buf[j]); \ + } \ + } \ + break; \ + case 1: /* horizontal halfpel interpolation */ \ + for (i = 0; i < size; i++, buf += pitch, ref_buf += pitch) \ + for (j = 0; j < size; j++) \ + OP(buf[j], (ref_buf[j] + ref_buf[j+1]) >> 1); \ + break; \ + case 2: /* vertical halfpel interpolation */ \ + wptr = ref_buf + pitch; \ + for (i = 0; i < size; i++, buf += pitch, wptr += pitch, ref_buf += pitch) \ + for (j = 0; j < size; j++) \ + OP(buf[j], (ref_buf[j] + wptr[j]) >> 1); \ + break; \ + case 3: /* vertical and horizontal halfpel interpolation */ \ + wptr = ref_buf + pitch; \ + for (i = 0; i < size; i++, buf += pitch, wptr += pitch, ref_buf += pitch) \ + for (j = 0; j < size; j++) \ + OP(buf[j], (ref_buf[j] + ref_buf[j+1] + wptr[j] + wptr[j+1]) >> 2); \ + break; \ + } \ +} \ + +#define OP_PUT(a, b) (a) = (b) +#define OP_ADD(a, b) (a) += (b) + +IVI_MC_TEMPLATE(8, _no_delta, OP_PUT); +IVI_MC_TEMPLATE(8, _delta, OP_ADD); +IVI_MC_TEMPLATE(4, _no_delta, OP_PUT); +IVI_MC_TEMPLATE(4, _delta, OP_ADD); diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ivi_dsp.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ivi_dsp.h new file mode 100644 index 00000000..4fb2f800 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ivi_dsp.h @@ -0,0 +1,170 @@ +/* + * DSP functions for Indeo Video Interactive codecs (Indeo4 and Indeo5) + * + * Copyright (c) 2009 Maxim Poliakovski + * + * 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 + * DSP functions (inverse transforms, motion compensations, wavelet recompostion) + * for Indeo Video Interactive codecs. + */ + +#ifndef AVCODEC_IVI_DSP_H +#define AVCODEC_IVI_DSP_H + +#include "avcodec.h" +#include "ivi_common.h" + +/** + * 5/3 wavelet recomposition filter for Indeo5 + * + * @param[in] plane pointer to the descriptor of the plane being processed + * @param[out] dst pointer to the destination buffer + * @param[in] dst_pitch pitch of the destination buffer + * @param[in] num_bands number of wavelet bands to be processed + */ +void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, + const int dst_pitch, const int num_bands); + +/** + * two-dimensional inverse slant 8x8 transform + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags: + * != 0 - non_empty column, 0 - empty one + * (this array must be filled by caller) + */ +void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch, + const uint8_t *flags); + +/** + * two-dimensional inverse slant 4x4 transform + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags: + * != 0 - non_empty column, 0 - empty one + * (this array must be filled by caller) + */ +void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch, + const uint8_t *flags); + +/** + * DC-only two-dimensional inverse slant transform. + * Performing the inverse slant transform in this case is equivalent to + * spreading (DC_coeff + 1)/2 over the whole block. + * It works much faster than performing the slant transform on a vector of zeroes. + * + * @param[in] in pointer to the dc coefficient + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] blk_size transform block size + */ +void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size); + +/** + * inverse 1D row slant transform + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags (unused here) + */ +void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch, + const uint8_t *flags); + +/** + * inverse 1D column slant transform + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags: + * != 0 - non_empty column, 0 - empty one + * (this array must be filled by caller) + */ +void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch, + const uint8_t *flags); + +/** + * DC-only inverse row slant transform + */ +void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size); + +/** + * DC-only inverse column slant transform + */ +void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size); + +/** + * Copy the pixels into the frame buffer. + */ +void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags); + +/** + * Copy the DC coefficient into the first pixel of the block and + * zero all others. + */ +void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size); + +/** + * 8x8 block motion compensation with adding delta + * + * @param[in,out] buf pointer to the block in the current frame buffer containing delta + * @param[in] ref_buf pointer to the corresponding block in the reference frame + * @param[in] pitch pitch for moving to the next y line + * @param[in] mc_type interpolation type + */ +void ff_ivi_mc_8x8_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type); + +/** + * 4x4 block motion compensation with adding delta + * + * @param[in,out] buf pointer to the block in the current frame buffer containing delta + * @param[in] ref_buf pointer to the corresponding block in the reference frame + * @param[in] pitch pitch for moving to the next y line + * @param[in] mc_type interpolation type + */ +void ff_ivi_mc_4x4_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type); + +/** + * motion compensation without adding delta + * + * @param[in,out] buf pointer to the block in the current frame receiving the result + * @param[in] ref_buf pointer to the corresponding block in the reference frame + * @param[in] pitch pitch for moving to the next y line + * @param[in] mc_type interpolation type + */ +void ff_ivi_mc_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type); + +/** + * 4x4 block motion compensation without adding delta + * + * @param[in,out] buf pointer to the block in the current frame receiving the result + * @param[in] ref_buf pointer to the corresponding block in the reference frame + * @param[in] pitch pitch for moving to the next y line + * @param[in] mc_type interpolation type + */ +void ff_ivi_mc_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type); + +#endif /* AVCODEC_IVI_DSP_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/kgv1dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/kgv1dec.c new file mode 100644 index 00000000..efc477f3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/kgv1dec.c @@ -0,0 +1,178 @@ +/* + * Kega Game Video (KGV1) decoder + * Copyright (c) 2010 Daniel Verkamp + * + * 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 + * Kega Game Video decoder + */ + +#include "libavutil/intreadwrite.h" +#include "libavcore/imgutils.h" +#include "avcodec.h" + +typedef struct { + AVCodecContext *avctx; + AVFrame pic; + uint16_t *prev, *cur; +} KgvContext; + +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) +{ + const uint8_t *buf = avpkt->data; + const uint8_t *buf_end = buf + avpkt->size; + KgvContext * const c = avctx->priv_data; + int offsets[7]; + uint16_t *out, *prev; + int outcnt = 0, maxcnt; + int w, h, i; + + if (avpkt->size < 2) + return -1; + + w = (buf[0] + 1) * 8; + h = (buf[1] + 1) * 8; + buf += 2; + + if (av_image_check_size(w, h, 0, avctx)) + return -1; + + if (w != avctx->width || h != avctx->height) + avcodec_set_dimensions(avctx, w, h); + + maxcnt = w * h; + + out = av_realloc(c->cur, w * h * 2); + if (!out) + return -1; + c->cur = out; + + prev = av_realloc(c->prev, w * h * 2); + if (!prev) + return -1; + c->prev = prev; + + for (i = 0; i < 7; i++) + offsets[i] = -1; + + while (outcnt < maxcnt && buf_end - 2 > buf) { + int code = AV_RL16(buf); + buf += 2; + + if (!(code & 0x8000)) { + out[outcnt++] = code; // rgb555 pixel coded directly + } else { + int count; + uint16_t *inp; + + if ((code & 0x6000) == 0x6000) { + // copy from previous frame + int oidx = (code >> 10) & 7; + int start; + + count = (code & 0x3FF) + 3; + + if (offsets[oidx] < 0) { + if (buf_end - 3 < buf) + break; + offsets[oidx] = AV_RL24(buf); + buf += 3; + } + + start = (outcnt + offsets[oidx]) % maxcnt; + + if (maxcnt - start < count) + break; + + inp = prev + start; + } else { + // copy from earlier in this frame + int offset = (code & 0x1FFF) + 1; + + if (!(code & 0x6000)) { + count = 2; + } else if ((code & 0x6000) == 0x2000) { + count = 3; + } else { + if (buf_end - 1 < buf) + break; + count = 4 + *buf++; + } + + if (outcnt < offset) + break; + + inp = out + outcnt - offset; + } + + if (maxcnt - outcnt < count) + break; + + for (i = 0; i < count; i++) + out[outcnt++] = inp[i]; + } + } + + if (outcnt - maxcnt) + av_log(avctx, AV_LOG_DEBUG, "frame finished with %d diff\n", outcnt - maxcnt); + + c->pic.data[0] = (uint8_t *)c->cur; + c->pic.linesize[0] = w * 2; + + *data_size = sizeof(AVFrame); + *(AVFrame*)data = c->pic; + + FFSWAP(uint16_t *, c->cur, c->prev); + + return avpkt->size; +} + +static av_cold int decode_init(AVCodecContext *avctx) +{ + KgvContext * const c = avctx->priv_data; + + c->avctx = avctx; + avctx->pix_fmt = PIX_FMT_RGB555; + + return 0; +} + +static av_cold int decode_end(AVCodecContext *avctx) +{ + KgvContext * const c = avctx->priv_data; + + av_freep(&c->cur); + av_freep(&c->prev); + + return 0; +} + +AVCodec ff_kgv1_decoder = { + "kgv1", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_KGV1, + sizeof(KgvContext), + decode_init, + NULL, + decode_end, + decode_frame, + .max_lowres = 1, + .long_name = NULL_IF_CONFIG_SMALL("Kega Game Video"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lagarith.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lagarith.c new file mode 100644 index 00000000..89580dc1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lagarith.c @@ -0,0 +1,522 @@ +/* + * Lagarith lossless decoder + * Copyright (c) 2009 Nathan Caldwell + * + * 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 libavcodec/lagarith.c + * Lagarith lossless decoder + * @author Nathan Caldwell + */ + +#include "avcodec.h" +#include "get_bits.h" +#include "mathops.h" +#include "dsputil.h" +#include "lagarithrac.h" + +enum LagarithFrameType { + FRAME_RAW = 1, /*!< uncompressed */ + FRAME_U_RGB24 = 2, /*!< unaligned RGB24 */ + FRAME_ARITH_YUY2 = 3, /*!< arithmetic coded YUY2 */ + FRAME_ARITH_RGB24 = 4, /*!< arithmetic coded RGB24 */ + FRAME_SOLID_GRAY = 5, /*!< solid grayscale color frame */ + FRAME_SOLID_COLOR = 6, /*!< solid non-grayscale color frame */ + FRAME_OLD_ARITH_RGB = 7, /*!< obsolete arithmetic coded RGB (no longer encoded by upstream since version 1.1.0) */ + FRAME_ARITH_RGBA = 8, /*!< arithmetic coded RGBA */ + FRAME_SOLID_RGBA = 9, /*!< solid RGBA color frame */ + FRAME_ARITH_YV12 = 10, /*!< arithmetic coded YV12 */ + FRAME_REDUCED_RES = 11, /*!< reduced resolution YV12 frame */ +}; + +typedef struct LagarithContext { + AVCodecContext *avctx; + AVFrame picture; + DSPContext dsp; + int zeros; /*!< number of consecutive zero bytes encountered */ + int zeros_rem; /*!< number of zero bytes remaining to output */ +} LagarithContext; + +/** + * Compute the 52bit mantissa of 1/(double)denom. + * This crazy format uses floats in an entropy coder and we have to match x86 + * rounding exactly, thus ordinary floats aren't portable enough. + * @param denom denominator + * @return 52bit mantissa + * @see softfloat_mul + */ +static uint64_t softfloat_reciprocal(uint32_t denom) +{ + int shift = av_log2(denom - 1) + 1; + uint64_t ret = (1ULL << 52) / denom; + uint64_t err = (1ULL << 52) - ret * denom; + ret <<= shift; + err <<= shift; + err += denom / 2; + return ret + err / denom; +} + +/** + * (uint32_t)(x*f), where f has the given mantissa, and exponent 0 + * Used in combination with softfloat_reciprocal computes x/(double)denom. + * @param x 32bit integer factor + * @param mantissa mantissa of f with exponent 0 + * @return 32bit integer value (x*f) + * @see softfloat_reciprocal + */ +static uint32_t softfloat_mul(uint32_t x, uint64_t mantissa) +{ + uint64_t l = x * (mantissa & 0xffffffff); + uint64_t h = x * (mantissa >> 32); + h += l >> 32; + l &= 0xffffffff; + l += 1 << av_log2(h >> 21); + h += l >> 32; + return h >> 20; +} + +static uint8_t lag_calc_zero_run(int8_t x) +{ + return (x << 1) ^ (x >> 7); +} + +static int lag_decode_prob(GetBitContext *gb, uint32_t *value) +{ + static const uint8_t series[] = { 1, 2, 3, 5, 8, 13, 21 }; + int i; + int bit = 0; + int bits = 0; + int prevbit = 0; + unsigned val; + + for (i = 0; i < 7; i++) { + if (prevbit && bit) + break; + prevbit = bit; + bit = get_bits1(gb); + if (bit && !prevbit) + bits += series[i]; + } + bits--; + if (bits < 0 || bits > 31) { + *value = 0; + return -1; + } else if (bits == 0) { + *value = 0; + return 0; + } + + val = get_bits_long(gb, bits); + val |= 1 << bits; + + *value = val - 1; + + return 0; +} + +static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) +{ + int i, j, scale_factor; + unsigned prob, cumulative_target; + unsigned cumul_prob = 0; + unsigned scaled_cumul_prob = 0; + + rac->prob[0] = 0; + rac->prob[257] = UINT_MAX; + /* Read probabilities from bitstream */ + for (i = 1; i < 257; i++) { + if (lag_decode_prob(gb, &rac->prob[i]) < 0) { + av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability encountered.\n"); + return -1; + } + if ((uint64_t)cumul_prob + rac->prob[i] > UINT_MAX) { + av_log(rac->avctx, AV_LOG_ERROR, "Integer overflow encountered in cumulative probability calculation.\n"); + return -1; + } + cumul_prob += rac->prob[i]; + if (!rac->prob[i]) { + if (lag_decode_prob(gb, &prob)) { + av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability run encountered.\n"); + return -1; + } + if (prob > 257 - i) + prob = 257 - i; + for (j = 0; j < prob; j++) + rac->prob[++i] = 0; + } + } + + if (!cumul_prob) { + av_log(rac->avctx, AV_LOG_ERROR, "All probabilities are 0!\n"); + return -1; + } + + /* Scale probabilities so cumulative probability is an even power of 2. */ + scale_factor = av_log2(cumul_prob); + + if (cumul_prob & (cumul_prob - 1)) { + uint64_t mul = softfloat_reciprocal(cumul_prob); + for (i = 1; i < 257; i++) { + rac->prob[i] = softfloat_mul(rac->prob[i], mul); + scaled_cumul_prob += rac->prob[i]; + } + + scale_factor++; + cumulative_target = 1 << scale_factor; + + if (scaled_cumul_prob > cumulative_target) { + av_log(rac->avctx, AV_LOG_ERROR, + "Scaled probabilities are larger than target!\n"); + return -1; + } + + scaled_cumul_prob = cumulative_target - scaled_cumul_prob; + + for (i = 1; scaled_cumul_prob; i = (i & 0x7f) + 1) { + if (rac->prob[i]) { + rac->prob[i]++; + scaled_cumul_prob--; + } + /* Comment from reference source: + * if (b & 0x80 == 0) { // order of operations is 'wrong'; it has been left this way + * // since the compression change is negligable and fixing it + * // breaks backwards compatibilty + * b =- (signed int)b; + * b &= 0xFF; + * } else { + * b++; + * b &= 0x7f; + * } + */ + } + } + + rac->scale = scale_factor; + + /* Fill probability array with cumulative probability for each symbol. */ + for (i = 1; i < 257; i++) + rac->prob[i] += rac->prob[i - 1]; + + return 0; +} + +static void add_lag_median_prediction(uint8_t *dst, uint8_t *src1, + uint8_t *diff, int w, int *left, + int *left_top) +{ + /* This is almost identical to add_hfyu_median_prediction in dsputil.h. + * However the &0xFF on the gradient predictor yealds incorrect output + * for lagarith. + */ + int i; + uint8_t l, lt; + + l = *left; + lt = *left_top; + + for (i = 0; i < w; i++) { + l = mid_pred(l, src1[i], l + src1[i] - lt) + diff[i]; + lt = src1[i]; + dst[i] = l; + } + + *left = l; + *left_top = lt; +} + +static void lag_pred_line(LagarithContext *l, uint8_t *buf, + int width, int stride, int line) +{ + int L, TL; + + if (!line) { + /* Left prediction only for first line */ + L = l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1, + width - 1, buf[0]); + return; + } else if (line == 1) { + /* Second line, left predict first pixel, the rest of the line is median predicted */ + /* FIXME: In the case of RGB this pixel is top predicted */ + TL = buf[-stride]; + } else { + /* Top left is 2 rows back, last pixel */ + TL = buf[width - (2 * stride) - 1]; + } + /* Left pixel is actually prev_row[width] */ + L = buf[width - stride - 1]; + + add_lag_median_prediction(buf, buf - stride, buf, + width, &L, &TL); +} + +static int lag_decode_line(LagarithContext *l, lag_rac *rac, + uint8_t *dst, int width, int stride, + int esc_count) +{ + int i = 0; + int ret = 0; + + if (!esc_count) + esc_count = -1; + + /* Output any zeros remaining from the previous run */ +handle_zeros: + if (l->zeros_rem) { + int count = FFMIN(l->zeros_rem, width - i); + memset(dst + i, 0, count); + i += count; + l->zeros_rem -= count; + } + + while (i < width) { + dst[i] = lag_get_rac(rac); + ret++; + + if (dst[i]) + l->zeros = 0; + else + l->zeros++; + + i++; + if (l->zeros == esc_count) { + int index = lag_get_rac(rac); + ret++; + + l->zeros = 0; + + l->zeros_rem = lag_calc_zero_run(index); + goto handle_zeros; + } + } + return ret; +} + +static int lag_decode_zero_run_line(LagarithContext *l, uint8_t *dst, + const uint8_t *src, int width, + int esc_count) +{ + int i = 0; + int count; + uint8_t zero_run = 0; + const uint8_t *start = src; + uint8_t mask1 = -(esc_count < 2); + uint8_t mask2 = -(esc_count < 3); + uint8_t *end = dst + (width - 2); + +output_zeros: + if (l->zeros_rem) { + count = FFMIN(l->zeros_rem, width - i); + memset(dst, 0, count); + l->zeros_rem -= count; + dst += count; + } + + while (dst < end) { + i = 0; + while (!zero_run && dst + i < end) { + i++; + zero_run = + !(src[i] | (src[i + 1] & mask1) | (src[i + 2] & mask2)); + } + if (zero_run) { + zero_run = 0; + i += esc_count; + memcpy(dst, src, i); + dst += i; + l->zeros_rem = lag_calc_zero_run(src[i]); + + src += i + 1; + goto output_zeros; + } else { + memcpy(dst, src, i); + src += i; + } + } + return start - src; +} + + + +static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst, + int width, int height, int stride, + const uint8_t *src, int src_size) +{ + int i = 0; + int read = 0; + uint32_t length; + uint32_t offset = 1; + int esc_count = src[0]; + GetBitContext gb; + lag_rac rac; + + rac.avctx = l->avctx; + l->zeros = 0; + + if (esc_count < 4) { + length = width * height; + if (esc_count && AV_RL32(src + 1) < length) { + length = AV_RL32(src + 1); + offset += 4; + } + + init_get_bits(&gb, src + offset, src_size * 8); + + if (lag_read_prob_header(&rac, &gb) < 0) + return -1; + + lag_rac_init(&rac, &gb, length - stride); + + for (i = 0; i < height; i++) + read += lag_decode_line(l, &rac, dst + (i * stride), width, + stride, esc_count); + + if (read > length) + av_log(l->avctx, AV_LOG_WARNING, + "Output more bytes than length (%d of %d)\n", read, + length); + } else if (esc_count < 8) { + esc_count -= 4; + if (esc_count > 0) { + /* Zero run coding only, no range coding. */ + for (i = 0; i < height; i++) + src += lag_decode_zero_run_line(l, dst + (i * stride), src, + width, esc_count); + } else { + /* Plane is stored uncompressed */ + for (i = 0; i < height; i++) { + memcpy(dst + (i * stride), src, width); + src += width; + } + } + } else if (esc_count == 0xff) { + /* Plane is a solid run of given value */ + for (i = 0; i < height; i++) + memset(dst + i * stride, src[1], width); + /* Do not apply prediction. + Note: memset to 0 above, setting first value to src[1] + and applying prediction gives the same result. */ + return 0; + } else { + av_log(l->avctx, AV_LOG_ERROR, + "Invalid zero run escape code! (%#x)\n", esc_count); + return -1; + } + + for (i = 0; i < height; i++) { + lag_pred_line(l, dst, width, stride, i); + dst += stride; + } + + return 0; +} + +/** + * Decode a frame. + * @param avctx codec context + * @param data output AVFrame + * @param data_size size of output data or 0 if no picture is returned + * @param avpkt input packet + * @return number of consumed bytes on success or negative if decode fails + */ +static int lag_decode_frame(AVCodecContext *avctx, + void *data, int *data_size, AVPacket *avpkt) +{ + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + LagarithContext *l = avctx->priv_data; + AVFrame *const p = &l->picture; + uint8_t frametype = 0; + uint32_t offset_gu = 0, offset_bv = 0, offset_ry = 9; + + AVFrame *picture = data; + + if (p->data[0]) + avctx->release_buffer(avctx, p); + + p->reference = 0; + p->key_frame = 1; + + frametype = buf[0]; + + offset_gu = AV_RL32(buf + 1); + offset_bv = AV_RL32(buf + 5); + + switch (frametype) { + case FRAME_ARITH_YV12: + avctx->pix_fmt = PIX_FMT_YUV420P; + + if (avctx->get_buffer(avctx, p) < 0) { + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return -1; + } + + lag_decode_arith_plane(l, p->data[0], avctx->width, avctx->height, + p->linesize[0], buf + offset_ry, + buf_size); + lag_decode_arith_plane(l, p->data[2], avctx->width / 2, + avctx->height / 2, p->linesize[2], + buf + offset_gu, buf_size); + lag_decode_arith_plane(l, p->data[1], avctx->width / 2, + avctx->height / 2, p->linesize[1], + buf + offset_bv, buf_size); + break; + default: + av_log(avctx, AV_LOG_ERROR, + "Unsupported Lagarith frame type: %#x\n", frametype); + return -1; + } + + *picture = *p; + *data_size = sizeof(AVFrame); + + return buf_size; +} + +static av_cold int lag_decode_init(AVCodecContext *avctx) +{ + LagarithContext *l = avctx->priv_data; + l->avctx = avctx; + + dsputil_init(&l->dsp, avctx); + + return 0; +} + +static av_cold int lag_decode_end(AVCodecContext *avctx) +{ + LagarithContext *l = avctx->priv_data; + + if (l->picture.data[0]) + avctx->release_buffer(avctx, &l->picture); + + return 0; +} + +AVCodec ff_lagarith_decoder = { + "lagarith", + CODEC_TYPE_VIDEO, + CODEC_ID_LAGARITH, + sizeof(LagarithContext), + lag_decode_init, + NULL, + lag_decode_end, + lag_decode_frame, + CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("Lagarith lossless"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lagarithrac.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lagarithrac.c new file mode 100644 index 00000000..0cbc3b84 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lagarithrac.c @@ -0,0 +1,58 @@ +/* + * Lagarith range decoder + * Copyright (c) 2009 Nathan Caldwell + * Copyright (c) 2009 David Conrad + * + * 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 libavcodec/lagarithrac.c + * Lagarith range decoder + * @author Nathan Caldwell + * @author David Conrad + */ + +#include "get_bits.h" +#include "lagarithrac.h" + +void lag_rac_init(lag_rac *l, GetBitContext *gb, int length) +{ + int i, j; + + /* According to reference decoder "1st byte is garbage", + * however, it gets skipped by the call to align_get_bits() + */ + align_get_bits(gb); + l->bytestream_start = + l->bytestream = gb->buffer + get_bits_count(gb) / 8; + l->bytestream_end = l->bytestream_start + length; + + l->range = 0x80; + l->low = *l->bytestream >> 1; + l->hash_shift = FFMAX(l->scale - 8, 0); + + for (i = j = 0; i < 256; i++) { + unsigned r = i << l->hash_shift; + while (l->prob[j + 1] <= r) + j++; + l->range_hash[i] = j; + } + + /* Add conversion factor to hash_shift so we don't have to in lag_get_rac. */ + l->hash_shift += 23; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lagarithrac.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lagarithrac.h new file mode 100644 index 00000000..d985b603 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/lagarithrac.h @@ -0,0 +1,116 @@ +/* + * Lagarith range decoder + * Copyright (c) 2009 Nathan Caldwell + * Copyright (c) 2009 David Conrad + * + * 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 libavcodec/lagarithrac.h + * Lagarith range decoder + * @author Nathan Caldwell + * @author David Conrad + */ + +#ifndef AVCODEC_LAGARITHRAC_H +#define AVCODEC_LAGARITHRAC_H + +#include +#include "libavutil/common.h" +#include "libavutil/intreadwrite.h" +#include "avcodec.h" +#include "get_bits.h" + +typedef struct lag_rac { + AVCodecContext *avctx; + unsigned low; + unsigned range; + unsigned scale; /*!< Number of bits of precision in range. */ + unsigned hash_shift; /*!< Number of bits to shift to calculate hash for radix search. */ + + const uint8_t *bytestream_start; /*!< Start of input bytestream. */ + const uint8_t *bytestream; /*!< Current position in input bytestream. */ + const uint8_t *bytestream_end; /*!< End position of input bytestream. */ + + uint32_t prob[258]; /*!< Table of cumulative probability for each symbol. */ + uint8_t range_hash[256]; /*!< Hash table mapping upper byte to approximate symbol. */ +} lag_rac; + +void lag_rac_init(lag_rac *l, GetBitContext *gb, int length); + +/* TODO: Optimize */ +static inline void lag_rac_refill(lag_rac *l) +{ + while (l->range <= 0x800000) { + l->low <<= 8; + l->range <<= 8; + l->low |= 0xff & (AV_RB16(l->bytestream) >> 1); + if (l->bytestream < l->bytestream_end) + l->bytestream++; + } +} + +/** + * Decode a single byte from the compressed plane described by *l. + * @param l pointer to lag_rac for the current plane + * @return next byte of decoded data + */ +static inline uint8_t lag_get_rac(lag_rac *l) +{ + unsigned range_scaled, low_scaled, div; + int val; + uint8_t shift; + + lag_rac_refill(l); + + range_scaled = l->range >> l->scale; + + if (l->low < range_scaled * l->prob[255]) { + /* val = 0 is frequent enough to deserve a shortcut */ + if (l->low < range_scaled * l->prob[1]) { + val = 0; + } else { + /* FIXME __builtin_clz is ~20% faster here, but not allowed in generic code. */ + shift = 30 - av_log2(range_scaled); + div = ((range_scaled << shift) + (1 << 23) - 1) >> 23; + /* low>>24 ensures that any cases too big for exact FASTDIV are + * under- rather than over-estimated + */ + low_scaled = FASTDIV(l->low - (l->low >> 24), div); + shift -= l->hash_shift; + shift &= 31; + low_scaled = (low_scaled << shift) | (low_scaled >> (32 - shift)); + /* low_scaled is now a lower bound of low/range_scaled */ + val = l->range_hash[(uint8_t) low_scaled]; + while (l->low >= range_scaled * l->prob[val + 1]) + val++; + } + + l->range = range_scaled * (l->prob[val + 1] - l->prob[val]); + } else { + val = 255; + l->range -= range_scaled * l->prob[255]; + } + + l->low -= range_scaled * l->prob[val]; + + return val; +} + + +#endif /* AVCODEC_LAGARITHRAC_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libvpxdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libvpxdec.c new file mode 100644 index 00000000..f912322c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libvpxdec.c @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2010, Google, Inc. + * + * 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 + * VP8 decoder support via libvpx + */ + +#define VPX_CODEC_DISABLE_COMPAT 1 +#include +#include + +#include "libavcore/imgutils.h" +#include "avcodec.h" + +typedef struct VP8DecoderContext { + struct vpx_codec_ctx decoder; +} VP8Context; + +static av_cold int vp8_init(AVCodecContext *avctx) +{ + VP8Context *ctx = avctx->priv_data; + const struct vpx_codec_iface *iface = &vpx_codec_vp8_dx_algo; + struct vpx_codec_dec_cfg deccfg = { + /* token partitions+1 would be a decent choice */ + .threads = FFMIN(avctx->thread_count, 16) + }; + + av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str()); + av_log(avctx, AV_LOG_VERBOSE, "%s\n", vpx_codec_build_config()); + + if (vpx_codec_dec_init(&ctx->decoder, iface, &deccfg, 0) != VPX_CODEC_OK) { + const char *error = vpx_codec_error(&ctx->decoder); + av_log(avctx, AV_LOG_ERROR, "Failed to initialize decoder: %s\n", + error); + return AVERROR(EINVAL); + } + + avctx->pix_fmt = PIX_FMT_YUV420P; + return 0; +} + +static int vp8_decode(AVCodecContext *avctx, + void *data, int *data_size, AVPacket *avpkt) +{ + VP8Context *ctx = avctx->priv_data; + AVFrame *picture = data; + const void *iter = NULL; + struct vpx_image *img; + + if (vpx_codec_decode(&ctx->decoder, avpkt->data, avpkt->size, NULL, 0) != + VPX_CODEC_OK) { + const char *error = vpx_codec_error(&ctx->decoder); + const char *detail = vpx_codec_error_detail(&ctx->decoder); + + av_log(avctx, AV_LOG_ERROR, "Failed to decode frame: %s\n", error); + if (detail) + av_log(avctx, AV_LOG_ERROR, " Additional information: %s\n", + detail); + return AVERROR_INVALIDDATA; + } + + if ((img = vpx_codec_get_frame(&ctx->decoder, &iter))) { + if (img->fmt != VPX_IMG_FMT_I420) { + av_log(avctx, AV_LOG_ERROR, "Unsupported output colorspace (%d)\n", + img->fmt); + return AVERROR_INVALIDDATA; + } + + if ((int) img->d_w != avctx->width || (int) img->d_h != avctx->height) { + av_log(avctx, AV_LOG_INFO, "dimension change! %dx%d -> %dx%d\n", + avctx->width, avctx->height, img->d_w, img->d_h); + if (av_image_check_size(img->d_w, img->d_h, 0, avctx)) + return AVERROR_INVALIDDATA; + avcodec_set_dimensions(avctx, img->d_w, img->d_h); + } + picture->data[0] = img->planes[0]; + picture->data[1] = img->planes[1]; + picture->data[2] = img->planes[2]; + picture->data[3] = NULL; + picture->linesize[0] = img->stride[0]; + picture->linesize[1] = img->stride[1]; + picture->linesize[2] = img->stride[2]; + picture->linesize[3] = 0; + *data_size = sizeof(AVPicture); + } + return avpkt->size; +} + +static av_cold int vp8_free(AVCodecContext *avctx) +{ + VP8Context *ctx = avctx->priv_data; + vpx_codec_destroy(&ctx->decoder); + return 0; +} + +AVCodec ff_libvpx_decoder = { + "libvpx", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_VP8, + sizeof(VP8Context), + vp8_init, + NULL, /* encode */ + vp8_free, + vp8_decode, + 0, /* capabilities */ + .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libvpxenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libvpxenc.c new file mode 100644 index 00000000..878c979d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libvpxenc.c @@ -0,0 +1,509 @@ +/* + * Copyright (c) 2010, Google, Inc. + * + * 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 + * VP8 encoder support via libvpx + */ + +#define VPX_DISABLE_CTRL_TYPECHECKS 1 +#define VPX_CODEC_DISABLE_COMPAT 1 +#include +#include + +#include "avcodec.h" +#include "libavutil/base64.h" + +/** + * Portion of struct vpx_codec_cx_pkt from vpx_encoder.h. + * One encoded frame returned from the library. + */ +struct FrameListData { + void *buf; /**< compressed data buffer */ + size_t sz; /**< length of compressed data */ + int64_t pts; /**< time stamp to show frame + (in timebase units) */ + unsigned long duration; /**< duration to show frame + (in timebase units) */ + uint32_t flags; /**< flags for this frame */ + struct FrameListData *next; +}; + +typedef struct VP8EncoderContext { + struct vpx_codec_ctx encoder; + struct vpx_image rawimg; + struct vpx_fixed_buf twopass_stats; + unsigned long deadline; //i.e., RT/GOOD/BEST + struct FrameListData *coded_frame_list; +} VP8Context; + +/** String mappings for enum vp8e_enc_control_id */ +static const char *ctlidstr[] = { + [VP8E_UPD_ENTROPY] = "VP8E_UPD_ENTROPY", + [VP8E_UPD_REFERENCE] = "VP8E_UPD_REFERENCE", + [VP8E_USE_REFERENCE] = "VP8E_USE_REFERENCE", + [VP8E_SET_ROI_MAP] = "VP8E_SET_ROI_MAP", + [VP8E_SET_ACTIVEMAP] = "VP8E_SET_ACTIVEMAP", + [VP8E_SET_SCALEMODE] = "VP8E_SET_SCALEMODE", + [VP8E_SET_CPUUSED] = "VP8E_SET_CPUUSED", + [VP8E_SET_ENABLEAUTOALTREF] = "VP8E_SET_ENABLEAUTOALTREF", + [VP8E_SET_NOISE_SENSITIVITY] = "VP8E_SET_NOISE_SENSITIVITY", + [VP8E_SET_SHARPNESS] = "VP8E_SET_SHARPNESS", + [VP8E_SET_STATIC_THRESHOLD] = "VP8E_SET_STATIC_THRESHOLD", + [VP8E_SET_TOKEN_PARTITIONS] = "VP8E_SET_TOKEN_PARTITIONS", + [VP8E_GET_LAST_QUANTIZER] = "VP8E_GET_LAST_QUANTIZER", + [VP8E_SET_ARNR_MAXFRAMES] = "VP8E_SET_ARNR_MAXFRAMES", + [VP8E_SET_ARNR_STRENGTH] = "VP8E_SET_ARNR_STRENGTH", + [VP8E_SET_ARNR_TYPE] = "VP8E_SET_ARNR_TYPE", +}; + +static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc) +{ + VP8Context *ctx = avctx->priv_data; + const char *error = vpx_codec_error(&ctx->encoder); + const char *detail = vpx_codec_error_detail(&ctx->encoder); + + av_log(avctx, AV_LOG_ERROR, "%s: %s\n", desc, error); + if (detail) + av_log(avctx, AV_LOG_ERROR, " Additional information: %s\n", detail); +} + +static av_cold void dump_enc_cfg(AVCodecContext *avctx, + const struct vpx_codec_enc_cfg *cfg) +{ + int width = -30; + int level = AV_LOG_DEBUG; + + av_log(avctx, level, "vpx_codec_enc_cfg\n"); + av_log(avctx, level, "generic settings\n" + " %*s%u\n %*s%u\n %*s%u\n %*s%u\n %*s%u\n" + " %*s{%u/%u}\n %*s%u\n %*s%d\n %*s%u\n", + width, "g_usage:", cfg->g_usage, + width, "g_threads:", cfg->g_threads, + width, "g_profile:", cfg->g_profile, + width, "g_w:", cfg->g_w, + width, "g_h:", cfg->g_h, + width, "g_timebase:", cfg->g_timebase.num, cfg->g_timebase.den, + width, "g_error_resilient:", cfg->g_error_resilient, + width, "g_pass:", cfg->g_pass, + width, "g_lag_in_frames:", cfg->g_lag_in_frames); + av_log(avctx, level, "rate control settings\n" + " %*s%u\n %*s%u\n %*s%u\n %*s%u\n" + " %*s%d\n %*s%p(%zu)\n %*s%u\n", + width, "rc_dropframe_thresh:", cfg->rc_dropframe_thresh, + width, "rc_resize_allowed:", cfg->rc_resize_allowed, + width, "rc_resize_up_thresh:", cfg->rc_resize_up_thresh, + width, "rc_resize_down_thresh:", cfg->rc_resize_down_thresh, + width, "rc_end_usage:", cfg->rc_end_usage, + width, "rc_twopass_stats_in:", cfg->rc_twopass_stats_in.buf, cfg->rc_twopass_stats_in.sz, + width, "rc_target_bitrate:", cfg->rc_target_bitrate); + av_log(avctx, level, "quantizer settings\n" + " %*s%u\n %*s%u\n", + width, "rc_min_quantizer:", cfg->rc_min_quantizer, + width, "rc_max_quantizer:", cfg->rc_max_quantizer); + av_log(avctx, level, "bitrate tolerance\n" + " %*s%u\n %*s%u\n", + width, "rc_undershoot_pct:", cfg->rc_undershoot_pct, + width, "rc_overshoot_pct:", cfg->rc_overshoot_pct); + av_log(avctx, level, "decoder buffer model\n" + " %*s%u\n %*s%u\n %*s%u\n", + width, "rc_buf_sz:", cfg->rc_buf_sz, + width, "rc_buf_initial_sz:", cfg->rc_buf_initial_sz, + width, "rc_buf_optimal_sz:", cfg->rc_buf_optimal_sz); + av_log(avctx, level, "2 pass rate control settings\n" + " %*s%u\n %*s%u\n %*s%u\n", + width, "rc_2pass_vbr_bias_pct:", cfg->rc_2pass_vbr_bias_pct, + width, "rc_2pass_vbr_minsection_pct:", cfg->rc_2pass_vbr_minsection_pct, + width, "rc_2pass_vbr_maxsection_pct:", cfg->rc_2pass_vbr_maxsection_pct); + av_log(avctx, level, "keyframing settings\n" + " %*s%d\n %*s%u\n %*s%u\n", + width, "kf_mode:", cfg->kf_mode, + width, "kf_min_dist:", cfg->kf_min_dist, + width, "kf_max_dist:", cfg->kf_max_dist); + av_log(avctx, level, "\n"); +} + +static void coded_frame_add(void *list, struct FrameListData *cx_frame) +{ + struct FrameListData **p = list; + + while (*p != NULL) + p = &(*p)->next; + *p = cx_frame; + cx_frame->next = NULL; +} + +static av_cold void free_coded_frame(struct FrameListData *cx_frame) +{ + av_freep(&cx_frame->buf); + av_freep(&cx_frame); +} + +static av_cold void free_frame_list(struct FrameListData *list) +{ + struct FrameListData *p = list; + + while (p) { + list = list->next; + free_coded_frame(p); + p = list; + } +} + +static av_cold int codecctl_int(AVCodecContext *avctx, + enum vp8e_enc_control_id id, int val) +{ + VP8Context *ctx = avctx->priv_data; + char buf[80]; + int width = -30; + int res; + + snprintf(buf, sizeof(buf), "%s:", ctlidstr[id]); + av_log(avctx, AV_LOG_DEBUG, " %*s%d\n", width, buf, val); + + res = vpx_codec_control(&ctx->encoder, id, val); + if (res != VPX_CODEC_OK) { + snprintf(buf, sizeof(buf), "Failed to set %s codec control", + ctlidstr[id]); + log_encoder_error(avctx, buf); + } + + return res == VPX_CODEC_OK ? 0 : AVERROR(EINVAL); +} + +static av_cold int vp8_free(AVCodecContext *avctx) +{ + VP8Context *ctx = avctx->priv_data; + + vpx_codec_destroy(&ctx->encoder); + av_freep(&ctx->twopass_stats.buf); + av_freep(&avctx->coded_frame); + av_freep(&avctx->stats_out); + free_frame_list(ctx->coded_frame_list); + return 0; +} + +static av_cold int vp8_init(AVCodecContext *avctx) +{ + VP8Context *ctx = avctx->priv_data; + const struct vpx_codec_iface *iface = &vpx_codec_vp8_cx_algo; + int cpuused = 3; + struct vpx_codec_enc_cfg enccfg; + int res; + + av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str()); + av_log(avctx, AV_LOG_VERBOSE, "%s\n", vpx_codec_build_config()); + + if ((res = vpx_codec_enc_config_default(iface, &enccfg, 0)) != VPX_CODEC_OK) { + av_log(avctx, AV_LOG_ERROR, "Failed to get config: %s\n", + vpx_codec_err_to_string(res)); + return AVERROR(EINVAL); + } + dump_enc_cfg(avctx, &enccfg); + + enccfg.g_w = avctx->width; + enccfg.g_h = avctx->height; + enccfg.g_timebase.num = avctx->time_base.num; + enccfg.g_timebase.den = avctx->time_base.den; + enccfg.g_threads = avctx->thread_count; + + if (avctx->flags & CODEC_FLAG_PASS1) + enccfg.g_pass = VPX_RC_FIRST_PASS; + else if (avctx->flags & CODEC_FLAG_PASS2) + enccfg.g_pass = VPX_RC_LAST_PASS; + else + enccfg.g_pass = VPX_RC_ONE_PASS; + + if (avctx->rc_min_rate == avctx->rc_max_rate && + avctx->rc_min_rate == avctx->bit_rate) + enccfg.rc_end_usage = VPX_CBR; + enccfg.rc_target_bitrate = av_rescale_rnd(avctx->bit_rate, 1, 1000, + AV_ROUND_NEAR_INF); + + enccfg.rc_min_quantizer = avctx->qmin; + enccfg.rc_max_quantizer = avctx->qmax; + enccfg.rc_dropframe_thresh = avctx->frame_skip_threshold; + + //0-100 (0 => CBR, 100 => VBR) + enccfg.rc_2pass_vbr_bias_pct = round(avctx->qcompress * 100); + enccfg.rc_2pass_vbr_minsection_pct = + avctx->rc_min_rate * 100LL / avctx->bit_rate; + if (avctx->rc_max_rate) + enccfg.rc_2pass_vbr_maxsection_pct = + avctx->rc_max_rate * 100LL / avctx->bit_rate; + + if (avctx->rc_buffer_size) + enccfg.rc_buf_sz = + avctx->rc_buffer_size * 1000LL / avctx->bit_rate; + if (avctx->rc_initial_buffer_occupancy) + enccfg.rc_buf_initial_sz = + avctx->rc_initial_buffer_occupancy * 1000LL / avctx->bit_rate; + enccfg.rc_buf_optimal_sz = enccfg.rc_buf_sz * 5 / 6; + + //_enc_init() will balk if kf_min_dist differs from max w/VPX_KF_AUTO + if (avctx->keyint_min == avctx->gop_size) + enccfg.kf_min_dist = avctx->keyint_min; + enccfg.kf_max_dist = avctx->gop_size; + + if (enccfg.g_pass == VPX_RC_FIRST_PASS) + enccfg.g_lag_in_frames = 0; + else if (enccfg.g_pass == VPX_RC_LAST_PASS) { + int decode_size; + + if (!avctx->stats_in) { + av_log(avctx, AV_LOG_ERROR, "No stats file for second pass\n"); + return AVERROR_INVALIDDATA; + } + + ctx->twopass_stats.sz = strlen(avctx->stats_in) * 3 / 4; + ctx->twopass_stats.buf = av_malloc(ctx->twopass_stats.sz); + if (!ctx->twopass_stats.buf) { + av_log(avctx, AV_LOG_ERROR, + "Stat buffer alloc (%zu bytes) failed\n", + ctx->twopass_stats.sz); + return AVERROR(ENOMEM); + } + decode_size = av_base64_decode(ctx->twopass_stats.buf, avctx->stats_in, + ctx->twopass_stats.sz); + if (decode_size < 0) { + av_log(avctx, AV_LOG_ERROR, "Stat buffer decode failed\n"); + return AVERROR_INVALIDDATA; + } + + ctx->twopass_stats.sz = decode_size; + enccfg.rc_twopass_stats_in = ctx->twopass_stats; + } + + ctx->deadline = VPX_DL_GOOD_QUALITY; + /* 0-3: For non-zero values the encoder increasingly optimizes for reduced + complexity playback on low powered devices at the expense of encode + quality. */ + if (avctx->profile != FF_PROFILE_UNKNOWN) + enccfg.g_profile = avctx->profile; + + dump_enc_cfg(avctx, &enccfg); + /* Construct Encoder Context */ + res = vpx_codec_enc_init(&ctx->encoder, iface, &enccfg, 0); + if (res != VPX_CODEC_OK) { + log_encoder_error(avctx, "Failed to initialize encoder"); + return AVERROR(EINVAL); + } + + //codec control failures are currently treated only as warnings + av_log(avctx, AV_LOG_DEBUG, "vpx_codec_control\n"); + codecctl_int(avctx, VP8E_SET_CPUUSED, cpuused); + codecctl_int(avctx, VP8E_SET_NOISE_SENSITIVITY, avctx->noise_reduction); + codecctl_int(avctx, VP8E_SET_TOKEN_PARTITIONS, av_log2(avctx->slices)); + + //provide dummy value to initialize wrapper, values will be updated each _encode() + vpx_img_wrap(&ctx->rawimg, VPX_IMG_FMT_I420, avctx->width, avctx->height, 1, + (unsigned char*)1); + + avctx->coded_frame = avcodec_alloc_frame(); + if (!avctx->coded_frame) { + av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n"); + vp8_free(avctx); + return AVERROR(ENOMEM); + } + return 0; +} + +static inline void cx_pktcpy(struct FrameListData *dst, + const struct vpx_codec_cx_pkt *src) +{ + dst->pts = src->data.frame.pts; + dst->duration = src->data.frame.duration; + dst->flags = src->data.frame.flags; + dst->sz = src->data.frame.sz; + dst->buf = src->data.frame.buf; +} + +/** + * Store coded frame information in format suitable for return from encode(). + * + * Write buffer information from @a cx_frame to @a buf & @a buf_size. + * Timing/frame details to @a coded_frame. + * @return Frame size written to @a buf on success + * @return AVERROR(EINVAL) on error + */ +static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, + uint8_t *buf, int buf_size, AVFrame *coded_frame) +{ + if ((int) cx_frame->sz <= buf_size) { + buf_size = cx_frame->sz; + memcpy(buf, cx_frame->buf, buf_size); + coded_frame->pts = cx_frame->pts; + coded_frame->key_frame = !!(cx_frame->flags & VPX_FRAME_IS_KEY); + + if (coded_frame->key_frame) + coded_frame->pict_type = FF_I_TYPE; + else + coded_frame->pict_type = FF_P_TYPE; + } else { + av_log(avctx, AV_LOG_ERROR, + "Compressed frame larger than storage provided! (%zu/%d)\n", + cx_frame->sz, buf_size); + return AVERROR(EINVAL); + } + return buf_size; +} + +/** + * Queue multiple output frames from the encoder, returning the front-most. + * In cases where vpx_codec_get_cx_data() returns more than 1 frame append + * the frame queue. Return the head frame if available. + * @return Stored frame size + * @return AVERROR(EINVAL) on output size error + * @return AVERROR(ENOMEM) on coded frame queue data allocation error + */ +static int queue_frames(AVCodecContext *avctx, uint8_t *buf, int buf_size, + AVFrame *coded_frame) +{ + VP8Context *ctx = avctx->priv_data; + const struct vpx_codec_cx_pkt *pkt; + const void *iter = NULL; + int size = 0; + + if (ctx->coded_frame_list) { + struct FrameListData *cx_frame = ctx->coded_frame_list; + /* return the leading frame if we've already begun queueing */ + size = storeframe(avctx, cx_frame, buf, buf_size, coded_frame); + if (size < 0) + return AVERROR(EINVAL); + ctx->coded_frame_list = cx_frame->next; + free_coded_frame(cx_frame); + } + + /* consume all available output from the encoder before returning. buffers + are only good through the next vpx_codec call */ + while ((pkt = vpx_codec_get_cx_data(&ctx->encoder, &iter))) { + switch (pkt->kind) { + case VPX_CODEC_CX_FRAME_PKT: + if (!size) { + struct FrameListData cx_frame; + + /* avoid storing the frame when the list is empty and we haven't yet + provided a frame for output */ + assert(!ctx->coded_frame_list); + cx_pktcpy(&cx_frame, pkt); + size = storeframe(avctx, &cx_frame, buf, buf_size, coded_frame); + if (size < 0) + return AVERROR(EINVAL); + } else { + struct FrameListData *cx_frame = + av_malloc(sizeof(struct FrameListData)); + + if (!cx_frame) { + av_log(avctx, AV_LOG_ERROR, + "Frame queue element alloc failed\n"); + return AVERROR(ENOMEM); + } + cx_pktcpy(cx_frame, pkt); + cx_frame->buf = av_malloc(cx_frame->sz); + + if (!cx_frame->buf) { + av_log(avctx, AV_LOG_ERROR, + "Data buffer alloc (%zu bytes) failed\n", + cx_frame->sz); + return AVERROR(ENOMEM); + } + memcpy(cx_frame->buf, pkt->data.frame.buf, pkt->data.frame.sz); + coded_frame_add(&ctx->coded_frame_list, cx_frame); + } + break; + case VPX_CODEC_STATS_PKT: { + struct vpx_fixed_buf *stats = &ctx->twopass_stats; + stats->buf = av_realloc(stats->buf, + stats->sz + pkt->data.twopass_stats.sz); + if (!stats->buf) { + av_log(avctx, AV_LOG_ERROR, "Stat buffer realloc failed\n"); + return AVERROR(ENOMEM); + } + memcpy((uint8_t*)stats->buf + stats->sz, + pkt->data.twopass_stats.buf, pkt->data.twopass_stats.sz); + stats->sz += pkt->data.twopass_stats.sz; + break; + } + case VPX_CODEC_PSNR_PKT: //FIXME add support for CODEC_FLAG_PSNR + case VPX_CODEC_CUSTOM_PKT: + //ignore unsupported/unrecognized packet types + break; + } + } + + return size; +} + +static int vp8_encode(AVCodecContext *avctx, uint8_t *buf, int buf_size, + void *data) +{ + VP8Context *ctx = avctx->priv_data; + AVFrame *frame = data; + struct vpx_image *rawimg = NULL; + int64_t timestamp = 0; + int res, coded_size; + + if (frame) { + rawimg = &ctx->rawimg; + rawimg->planes[VPX_PLANE_Y] = frame->data[0]; + rawimg->planes[VPX_PLANE_U] = frame->data[1]; + rawimg->planes[VPX_PLANE_V] = frame->data[2]; + rawimg->stride[VPX_PLANE_Y] = frame->linesize[0]; + rawimg->stride[VPX_PLANE_U] = frame->linesize[1]; + rawimg->stride[VPX_PLANE_V] = frame->linesize[2]; + timestamp = frame->pts; + } + + res = vpx_codec_encode(&ctx->encoder, rawimg, timestamp, + avctx->ticks_per_frame, 0, ctx->deadline); + if (res != VPX_CODEC_OK) { + log_encoder_error(avctx, "Error encoding frame"); + return AVERROR_INVALIDDATA; + } + coded_size = queue_frames(avctx, buf, buf_size, avctx->coded_frame); + + if (!frame && avctx->flags & CODEC_FLAG_PASS1) { + unsigned int b64_size = AV_BASE64_SIZE(ctx->twopass_stats.sz); + + avctx->stats_out = av_malloc(b64_size); + if (!avctx->stats_out) { + av_log(avctx, AV_LOG_ERROR, "Stat buffer alloc (%d bytes) failed\n", + b64_size); + return AVERROR(ENOMEM); + } + av_base64_encode(avctx->stats_out, b64_size, ctx->twopass_stats.buf, + ctx->twopass_stats.sz); + } + return coded_size; +} + +AVCodec ff_libvpx_encoder = { + "libvpx", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_VP8, + sizeof(VP8Context), + vp8_init, + vp8_encode, + vp8_free, + NULL, + CODEC_CAP_DELAY, + .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, + .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libxavs.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libxavs.c new file mode 100644 index 00000000..08b93f58 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/libxavs.c @@ -0,0 +1,351 @@ +/* + * AVS encoding using the xavs library + * Copyright (C) 2010 Amanda, Y.N. Wu + * + * 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 + */ + +#include +#include +#include +#include +#include +#include +#include "avcodec.h" + +#define END_OF_STREAM 0x001 + +#define XAVS_PART_I8X8 0x002 /* Analyze i8x8 (requires 8x8 transform) */ +#define XAVS_PART_P8X8 0x010 /* Analyze p16x8, p8x16 and p8x8 */ +#define XAVS_PART_B8X8 0x100 /* Analyze b16x8, b*/ + +typedef struct XavsContext { + xavs_param_t params; + xavs_t *enc; + xavs_picture_t pic; + uint8_t *sei; + int sei_size; + AVFrame out_pic; + int end_of_stream; +} XavsContext; + +static void XAVS_log(void *p, int level, const char *fmt, va_list args) +{ + static const int level_map[] = { + [XAVS_LOG_ERROR] = AV_LOG_ERROR, + [XAVS_LOG_WARNING] = AV_LOG_WARNING, + [XAVS_LOG_INFO] = AV_LOG_INFO, + [XAVS_LOG_DEBUG] = AV_LOG_DEBUG + }; + + if (level < 0 || level > XAVS_LOG_DEBUG) + return; + + av_vlog(p, level_map[level], fmt, args); +} + +static int encode_nals(AVCodecContext *ctx, uint8_t *buf, + int size, xavs_nal_t *nals, + int nnal, int skip_sei) +{ + XavsContext *x4 = ctx->priv_data; + uint8_t *p = buf; + int i, s; + + /* Write the SEI as part of the first frame. */ + if (x4->sei_size > 0 && nnal > 0) { + memcpy(p, x4->sei, x4->sei_size); + p += x4->sei_size; + x4->sei_size = 0; + } + + for (i = 0; i < nnal; i++) { + /* Don't put the SEI in extradata. */ + if (skip_sei && nals[i].i_type == NAL_SEI) { + x4->sei = av_malloc( 5 + nals[i].i_payload * 4 / 3 ); + if (xavs_nal_encode(x4->sei, &x4->sei_size, 1, nals + i) < 0) + return -1; + + continue; + } + s = xavs_nal_encode(p, &size, 1, nals + i); + if (s < 0) + return -1; + p += s; + } + + return p - buf; +} + +static int XAVS_frame(AVCodecContext *ctx, uint8_t *buf, + int bufsize, void *data) +{ + XavsContext *x4 = ctx->priv_data; + AVFrame *frame = data; + xavs_nal_t *nal; + int nnal, i; + xavs_picture_t pic_out; + + x4->pic.img.i_csp = XAVS_CSP_I420; + x4->pic.img.i_plane = 3; + + if (frame) { + for (i = 0; i < 3; i++) { + x4->pic.img.plane[i] = frame->data[i]; + x4->pic.img.i_stride[i] = frame->linesize[i]; + } + + x4->pic.i_pts = frame->pts; + x4->pic.i_type = XAVS_TYPE_AUTO; + } + + if (xavs_encoder_encode(x4->enc, &nal, &nnal, + frame? &x4->pic: NULL, &pic_out) < 0) + return -1; + + bufsize = encode_nals(ctx, buf, bufsize, nal, nnal, 0); + + if (bufsize < 0) + return -1; + + if (!bufsize && !frame && !(x4->end_of_stream)){ + buf[bufsize] = 0x0; + buf[bufsize+1] = 0x0; + buf[bufsize+2] = 0x01; + buf[bufsize+3] = 0xb1; + bufsize += 4; + x4->end_of_stream = END_OF_STREAM; + return bufsize; + } + /* FIXME: libxavs now provides DTS */ + /* but AVFrame doesn't have a field for it. */ + x4->out_pic.pts = pic_out.i_pts; + + switch (pic_out.i_type) { + case XAVS_TYPE_IDR: + case XAVS_TYPE_I: + x4->out_pic.pict_type = FF_I_TYPE; + break; + case XAVS_TYPE_P: + x4->out_pic.pict_type = FF_P_TYPE; + break; + case XAVS_TYPE_B: + case XAVS_TYPE_BREF: + x4->out_pic.pict_type = FF_B_TYPE; + break; + } + + /* There is no IDR frame in AVS JiZhun */ + /* Sequence header is used as a flag */ + x4->out_pic.key_frame = pic_out.i_type == XAVS_TYPE_I; + + x4->out_pic.quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA; + + return bufsize; +} + +static av_cold int XAVS_close(AVCodecContext *avctx) +{ + XavsContext *x4 = avctx->priv_data; + + av_freep(&avctx->extradata); + av_free(x4->sei); + + if (x4->enc) + xavs_encoder_close(x4->enc); + + return 0; +} + +static av_cold int XAVS_init(AVCodecContext *avctx) +{ + XavsContext *x4 = avctx->priv_data; + + x4->sei_size = 0; + xavs_param_default(&x4->params); + + x4->params.pf_log = XAVS_log; + x4->params.p_log_private = avctx; + x4->params.i_keyint_max = avctx->gop_size; + x4->params.rc.i_bitrate = avctx->bit_rate / 1000; + x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000; + x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000; + x4->params.rc.b_stat_write = avctx->flags & CODEC_FLAG_PASS1; + if (avctx->flags & CODEC_FLAG_PASS2) { + x4->params.rc.b_stat_read = 1; + } else { + if (avctx->crf) { + x4->params.rc.i_rc_method = XAVS_RC_CRF; + x4->params.rc.f_rf_constant = avctx->crf; + } else if (avctx->cqp > -1) { + x4->params.rc.i_rc_method = XAVS_RC_CQP; + x4->params.rc.i_qp_constant = avctx->cqp; + } + } + + /* if neither crf nor cqp modes are selected we have to enable the RC */ + /* we do it this way because we cannot check if the bitrate has been set */ + if (!(avctx->crf || (avctx->cqp > -1))) + x4->params.rc.i_rc_method = XAVS_RC_ABR; + + x4->params.i_bframe = avctx->max_b_frames; + /* cabac is not included in AVS JiZhun Profile */ + x4->params.b_cabac = 0; + + x4->params.i_bframe_adaptive = avctx->b_frame_strategy; + x4->params.i_bframe_bias = avctx->bframebias; + + avctx->has_b_frames = !!avctx->max_b_frames; + + /* AVS doesn't allow B picture as reference */ + /* The max allowed reference frame number of B is 2 */ + x4->params.i_keyint_min = avctx->keyint_min; + if (x4->params.i_keyint_min > x4->params.i_keyint_max) + x4->params.i_keyint_min = x4->params.i_keyint_max; + + x4->params.i_scenecut_threshold = avctx->scenechange_threshold; + + // x4->params.b_deblocking_filter = avctx->flags & CODEC_FLAG_LOOP_FILTER; + x4->params.i_deblocking_filter_alphac0 = avctx->deblockalpha; + x4->params.i_deblocking_filter_beta = avctx->deblockbeta; + + x4->params.rc.i_qp_min = avctx->qmin; + x4->params.rc.i_qp_max = avctx->qmax; + x4->params.rc.i_qp_step = avctx->max_qdiff; + + x4->params.rc.f_qcompress = avctx->qcompress; /* 0.0 => cbr, 1.0 => constant qp */ + x4->params.rc.f_qblur = avctx->qblur; /* temporally blur quants */ + x4->params.rc.f_complexity_blur = avctx->complexityblur; + + x4->params.i_frame_reference = avctx->refs; + + x4->params.i_width = avctx->width; + x4->params.i_height = avctx->height; + x4->params.vui.i_sar_width = avctx->sample_aspect_ratio.num; + x4->params.vui.i_sar_height = avctx->sample_aspect_ratio.den; + /* This is only used for counting the fps */ + x4->params.i_fps_num = avctx->time_base.den; + x4->params.i_fps_den = avctx->time_base.num; + x4->params.analyse.inter = XAVS_ANALYSE_I8x8 |XAVS_ANALYSE_PSUB16x16| XAVS_ANALYSE_BSUB16x16; + if (avctx->partitions) { + if (avctx->partitions & XAVS_PART_I8X8) + x4->params.analyse.inter |= XAVS_ANALYSE_I8x8; + + if (avctx->partitions & XAVS_PART_P8X8) + x4->params.analyse.inter |= XAVS_ANALYSE_PSUB16x16; + + if (avctx->partitions & XAVS_PART_B8X8) + x4->params.analyse.inter |= XAVS_ANALYSE_BSUB16x16; + } + + x4->params.analyse.i_direct_mv_pred = avctx->directpred; + + x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED; + + switch (avctx->me_method) { + case ME_EPZS: + x4->params.analyse.i_me_method = XAVS_ME_DIA; + break; + case ME_HEX: + x4->params.analyse.i_me_method = XAVS_ME_HEX; + break; + case ME_UMH: + x4->params.analyse.i_me_method = XAVS_ME_UMH; + break; + case ME_FULL: + x4->params.analyse.i_me_method = XAVS_ME_ESA; + break; + case ME_TESA: + x4->params.analyse.i_me_method = XAVS_ME_TESA; + break; + default: + x4->params.analyse.i_me_method = XAVS_ME_HEX; + } + + x4->params.analyse.i_me_range = avctx->me_range; + x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality; + + x4->params.analyse.b_mixed_references = avctx->flags2 & CODEC_FLAG2_MIXED_REFS; + x4->params.analyse.b_chroma_me = avctx->me_cmp & FF_CMP_CHROMA; + /* AVS P2 only enables 8x8 transform */ + x4->params.analyse.b_transform_8x8 = 1; //avctx->flags2 & CODEC_FLAG2_8X8DCT; + x4->params.analyse.b_fast_pskip = avctx->flags2 & CODEC_FLAG2_FASTPSKIP; + + x4->params.analyse.i_trellis = avctx->trellis; + x4->params.analyse.i_noise_reduction = avctx->noise_reduction; + + if (avctx->level > 0) + x4->params.i_level_idc = avctx->level; + + x4->params.rc.f_rate_tolerance = + (float)avctx->bit_rate_tolerance/avctx->bit_rate; + + if ((avctx->rc_buffer_size) && + (avctx->rc_initial_buffer_occupancy <= avctx->rc_buffer_size)) { + x4->params.rc.f_vbv_buffer_init = + (float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size; + } else + x4->params.rc.f_vbv_buffer_init = 0.9; + + /* TAG:do we have MB tree RC method */ + /* what is the RC method we are now using? Default NO */ + x4->params.rc.b_mb_tree = !!(avctx->flags2 & CODEC_FLAG2_MBTREE); + x4->params.rc.f_ip_factor = 1 / fabs(avctx->i_quant_factor); + x4->params.rc.f_pb_factor = avctx->b_quant_factor; + x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset; + + x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR; + x4->params.i_log_level = XAVS_LOG_DEBUG; + x4->params.b_aud = avctx->flags2 & CODEC_FLAG2_AUD; + x4->params.i_threads = avctx->thread_count; + x4->params.b_interlaced = avctx->flags & CODEC_FLAG_INTERLACED_DCT; + + if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) + x4->params.b_repeat_headers = 0; + + x4->enc = xavs_encoder_open(&x4->params); + if (!x4->enc) + return -1; + + avctx->coded_frame = &x4->out_pic; + /* TAG: Do we have GLOBAL HEADER in AVS */ + /* We Have PPS and SPS in AVS */ + if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) { + xavs_nal_t *nal; + int nnal, s; + + s = xavs_encoder_headers(x4->enc, &nal, &nnal); + + avctx->extradata = av_malloc(s); + avctx->extradata_size = encode_nals(avctx, avctx->extradata, s, nal, nnal, 1); + } + return 0; +} + +AVCodec ff_libxavs_encoder = { + .name = "libxavs", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_CAVS, + .priv_data_size = sizeof(XavsContext), + .init = XAVS_init, + .encode = XAVS_frame, + .close = XAVS_close, + .capabilities = CODEC_CAP_DELAY, + .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NONE }, + .long_name = NULL_IF_CONFIG_SMALL("libxavs - the Chinese Audio Video Standard Encoder"), +}; + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mdct_tablegen.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mdct_tablegen.c new file mode 100644 index 00000000..6205f06e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mdct_tablegen.c @@ -0,0 +1,49 @@ +/* + * Generate a header file for hardcoded MDCT tables + * + * Copyright (c) 2009 Reimar DÃķffinger + * + * 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 + */ + +#include +#define CONFIG_HARDCODED_TABLES 0 +#define SINETABLE_CONST +#define SINETABLE(size) \ + float ff_sine_##size[size] +#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif +#include "mdct_tablegen.h" +#include "tableprint.h" + +int main(void) +{ + int i; + + write_fileheader(); + + for (i = 5; i <= 12; i++) { + ff_init_ff_sine_windows(i); + printf("SINETABLE(%4i) = {\n", 1 << i); + write_float_array(ff_sine_windows[i], 1 << i); + printf("};\n"); + } + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mdct_tablegen.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mdct_tablegen.h new file mode 100644 index 00000000..51a00942 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mdct_tablegen.h @@ -0,0 +1,60 @@ +/* + * Header file for hardcoded MDCT tables + * + * Copyright (c) 2009 Reimar DÃķffinger + * + * 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 + */ + +#include +// do not use libavutil/libm.h since this is compiled both +// for the host and the target and config.h is only valid for the target +#include +#include "libavutil/attributes.h" + +#if !CONFIG_HARDCODED_TABLES +SINETABLE( 32); +SINETABLE( 64); +SINETABLE( 128); +SINETABLE( 256); +SINETABLE( 512); +SINETABLE(1024); +SINETABLE(2048); +SINETABLE(4096); +#else +#include "libavcodec/mdct_tables.h" +#endif + +SINETABLE_CONST float * const ff_sine_windows[] = { + NULL, NULL, NULL, NULL, NULL, // unused + ff_sine_32 , ff_sine_64 , + ff_sine_128, ff_sine_256, ff_sine_512, ff_sine_1024, ff_sine_2048, ff_sine_4096 +}; + +// Generate a sine window. +av_cold void ff_sine_window_init(float *window, int n) { + int i; + for(i = 0; i < n; i++) + window[i] = sinf((i + 0.5) * (M_PI / (2.0 * n))); +} + +av_cold void ff_init_ff_sine_windows(int index) { + assert(index >= 0 && index < FF_ARRAY_ELEMS(ff_sine_windows)); +#if !CONFIG_HARDCODED_TABLES + ff_sine_window_init(ff_sine_windows[index], 1 << index); +#endif +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mips/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mips/Makefile new file mode 100644 index 00000000..3f4da68e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mips/Makefile @@ -0,0 +1,3 @@ +OBJS-$(HAVE_MMI) += ps2/dsputil_mmi.o \ + ps2/idct_mmi.o \ + ps2/mpegvideo_mmi.o \ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpeg2jpeg_bsf.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpeg2jpeg_bsf.c new file mode 100644 index 00000000..855f24ad --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mjpeg2jpeg_bsf.c @@ -0,0 +1,113 @@ +/* + * MJPEG/AVI1 to JPEG/JFIF bitstream format filter + * Copyright (c) 2010 Adrian Daerr and Nicolas George + * + * 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 + */ + +/* + * Adapted from mjpeg2jpeg.c, with original copyright: + * Paris 2010 Adrian Daerr, public domain + */ + +#include +#include "avcodec.h" +#include "mjpeg.h" + +static const uint8_t jpeg_header[] = { + 0xff, 0xd8, // SOI + 0xff, 0xe0, // APP0 + 0x00, 0x10, // APP0 header size (including + // this field, but excluding preceding) + 0x4a, 0x46, 0x49, 0x46, 0x00, // ID string 'JFIF\0' + 0x01, 0x01, // version + 0x00, // bits per type + 0x00, 0x00, // X density + 0x00, 0x00, // Y density + 0x00, // X thumbnail size + 0x00, // Y thumbnail size +}; + +static const int dht_segment_size = 420; +static const uint8_t dht_segment_head[] = { 0xFF, 0xC4, 0x01, 0xA2, 0x00 }; +static const uint8_t dht_segment_frag[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x0a, 0x0b, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static uint8_t *append(uint8_t *buf, const uint8_t *src, int size) +{ + memcpy(buf, src, size); + return buf + size; +} + +static uint8_t *append_dht_segment(uint8_t *buf) +{ + buf = append(buf, dht_segment_head, sizeof(dht_segment_head)); + buf = append(buf, ff_mjpeg_bits_dc_luminance + 1, 16); + buf = append(buf, dht_segment_frag, sizeof(dht_segment_frag)); + buf = append(buf, ff_mjpeg_val_dc, 12); + *(buf++) = 0x10; + buf = append(buf, ff_mjpeg_bits_ac_luminance + 1, 16); + buf = append(buf, ff_mjpeg_val_ac_luminance, 162); + *(buf++) = 0x11; + buf = append(buf, ff_mjpeg_bits_ac_chrominance + 1, 16); + buf = append(buf, ff_mjpeg_val_ac_chrominance, 162); + return buf; +} + +static int mjpeg2jpeg_filter(AVBitStreamFilterContext *bsfc, + AVCodecContext *avctx, const char *args, + uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size, + int keyframe) +{ + int input_skip, output_size; + uint8_t *output, *out; + + if (buf_size < 12) { + av_log(avctx, AV_LOG_ERROR, "input is truncated\n"); + return AVERROR_INVALIDDATA; + } + if (memcmp("AVI1", buf + 6, 4)) { + av_log(avctx, AV_LOG_ERROR, "input is not MJPEG/AVI1\n"); + return AVERROR_INVALIDDATA; + } + input_skip = (buf[4] << 8) + buf[5] + 4; + if (buf_size < input_skip) { + av_log(avctx, AV_LOG_ERROR, "input is truncated\n"); + return AVERROR_INVALIDDATA; + } + output_size = buf_size - input_skip + + sizeof(jpeg_header) + dht_segment_size; + output = out = av_malloc(output_size); + if (!output) + return AVERROR(ENOMEM); + out = append(out, jpeg_header, sizeof(jpeg_header)); + out = append_dht_segment(out); + out = append(out, buf + input_skip, buf_size - input_skip); + *poutbuf = output; + *poutbuf_size = output_size; + return 1; +} + +AVBitStreamFilter ff_mjpeg2jpeg_bsf = { + .name = "mjpeg2jpeg", + .priv_data_size = 0, + .filter = mjpeg2jpeg_filter, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.c new file mode 100644 index 00000000..31e5cdf7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.c @@ -0,0 +1,41 @@ +/* + * Generate a header file for hardcoded motionpixels RGB to YUV table + * + * Copyright (c) 2009 Reimar DÃķffinger + * + * 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 + */ + +#include +#define CONFIG_HARDCODED_TABLES 0 +#define MAX_NEG_CROP 0 +#define ff_cropTbl ((uint8_t *)NULL) +#include "motionpixels_tablegen.h" +#include "tableprint.h" + +int main(void) +{ + motionpixels_tableinit(); + + write_fileheader(); + + printf("static const YuvPixel mp_rgb_yuv_table[1 << 15] = {\n"); + write_int8_t_2d_array(mp_rgb_yuv_table, 1 << 15, 3); + printf("};\n"); + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.h new file mode 100644 index 00000000..5d6df52a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/motionpixels_tablegen.h @@ -0,0 +1,91 @@ +/* + * Header file for hardcoded motionpixels RGB to YUV table + * + * Copyright (c) 2009 Reimar DÃķffinger + * + * 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 + */ + +#ifndef MOTIONPIXELS_TABLEGEN_H +#define MOTIONPIXELS_TABLEGEN_H + +#include + +typedef struct YuvPixel { + int8_t y, v, u; +} YuvPixel; + +static int mp_yuv_to_rgb(int y, int v, int u, int clip_rgb) { + static const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; + int r, g, b; + + r = (1000 * y + 701 * v) / 1000; + g = (1000 * y - 357 * v - 172 * u) / 1000; + b = (1000 * y + 886 * u) / 1000; + if (clip_rgb) + return ((cm[r * 8] & 0xF8) << 7) | ((cm[g * 8] & 0xF8) << 2) | (cm[b * 8] >> 3); + if ((unsigned)r < 32 && (unsigned)g < 32 && (unsigned)b < 32) + return (r << 10) | (g << 5) | b; + return 1 << 15; +} + +#if CONFIG_HARDCODED_TABLES +#define motionpixels_tableinit() +#include "libavcodec/motionpixels_tables.h" +#else +static YuvPixel mp_rgb_yuv_table[1 << 15]; + +static void mp_set_zero_yuv(YuvPixel *p) +{ + int i, j; + + for (i = 0; i < 31; ++i) { + for (j = 31; j > i; --j) + if (!(p[j].u | p[j].v | p[j].y)) + p[j] = p[j - 1]; + for (j = 0; j < 31 - i; ++j) + if (!(p[j].u | p[j].v | p[j].y)) + p[j] = p[j + 1]; + } +} + +static void mp_build_rgb_yuv_table(YuvPixel *p) +{ + int y, v, u, i; + + for (y = 0; y <= 31; ++y) + for (v = -31; v <= 31; ++v) + for (u = -31; u <= 31; ++u) { + i = mp_yuv_to_rgb(y, v, u, 0); + if (i < (1 << 15) && !(p[i].u | p[i].v | p[i].y)) { + p[i].y = y; + p[i].v = v; + p[i].u = u; + } + } + for (i = 0; i < 1024; ++i) + mp_set_zero_yuv(p + i * 32); +} + +static void motionpixels_tableinit(void) +{ + if (!mp_rgb_yuv_table[0].u) + mp_build_rgb_yuv_table(mp_rgb_yuv_table); +} +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* MOTIONPIXELS_TABLEGEN_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4video.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4video.c new file mode 100644 index 00000000..dd4dd8ad --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4video.c @@ -0,0 +1,171 @@ +/* + * MPEG4 decoder / encoder common code. + * Copyright (c) 2000,2001 Fabrice Bellard + * Copyright (c) 2002-2010 Michael Niedermayer + * + * 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 + */ + +#include "mpegvideo.h" +#include "mpeg4video.h" +#include "mpeg4data.h" + +uint8_t ff_mpeg4_static_rl_table_store[3][2][2*MAX_RUN + MAX_LEVEL + 3]; + +int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s){ + switch(s->pict_type){ + case FF_I_TYPE: + return 16; + case FF_P_TYPE: + case FF_S_TYPE: + return s->f_code+15; + case FF_B_TYPE: + return FFMAX3(s->f_code, s->b_code, 2) + 15; + default: + return -1; + } +} + +void ff_mpeg4_clean_buffers(MpegEncContext *s) +{ + int c_wrap, c_xy, l_wrap, l_xy; + + l_wrap= s->b8_stride; + l_xy= (2*s->mb_y-1)*l_wrap + s->mb_x*2 - 1; + c_wrap= s->mb_stride; + c_xy= (s->mb_y-1)*c_wrap + s->mb_x - 1; + +#if 0 + /* clean DC */ + memsetw(s->dc_val[0] + l_xy, 1024, l_wrap*2+1); + memsetw(s->dc_val[1] + c_xy, 1024, c_wrap+1); + memsetw(s->dc_val[2] + c_xy, 1024, c_wrap+1); +#endif + + /* clean AC */ + memset(s->ac_val[0] + l_xy, 0, (l_wrap*2+1)*16*sizeof(int16_t)); + memset(s->ac_val[1] + c_xy, 0, (c_wrap +1)*16*sizeof(int16_t)); + memset(s->ac_val[2] + c_xy, 0, (c_wrap +1)*16*sizeof(int16_t)); + + /* clean MV */ + // we can't clear the MVs as they might be needed by a b frame +// memset(s->motion_val + l_xy, 0, (l_wrap*2+1)*2*sizeof(int16_t)); +// memset(s->motion_val, 0, 2*sizeof(int16_t)*(2 + s->mb_width*2)*(2 + s->mb_height*2)); + s->last_mv[0][0][0]= + s->last_mv[0][0][1]= + s->last_mv[1][0][0]= + s->last_mv[1][0][1]= 0; +} + +#define tab_size ((signed)FF_ARRAY_ELEMS(s->direct_scale_mv[0])) +#define tab_bias (tab_size/2) + +//used by mpeg4 and rv10 decoder +void ff_mpeg4_init_direct_mv(MpegEncContext *s){ + int i; + for(i=0; idirect_scale_mv[0][i] = (i-tab_bias)*s->pb_time/s->pp_time; + s->direct_scale_mv[1][i] = (i-tab_bias)*(s->pb_time-s->pp_time)/s->pp_time; + } +} + +static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, int my, int i){ + int xy= s->block_index[i]; + uint16_t time_pp= s->pp_time; + uint16_t time_pb= s->pb_time; + int p_mx, p_my; + + p_mx= s->next_picture.motion_val[0][xy][0]; + if((unsigned)(p_mx + tab_bias) < tab_size){ + s->mv[0][i][0] = s->direct_scale_mv[0][p_mx + tab_bias] + mx; + s->mv[1][i][0] = mx ? s->mv[0][i][0] - p_mx + : s->direct_scale_mv[1][p_mx + tab_bias]; + }else{ + s->mv[0][i][0] = p_mx*time_pb/time_pp + mx; + s->mv[1][i][0] = mx ? s->mv[0][i][0] - p_mx + : p_mx*(time_pb - time_pp)/time_pp; + } + p_my= s->next_picture.motion_val[0][xy][1]; + if((unsigned)(p_my + tab_bias) < tab_size){ + s->mv[0][i][1] = s->direct_scale_mv[0][p_my + tab_bias] + my; + s->mv[1][i][1] = my ? s->mv[0][i][1] - p_my + : s->direct_scale_mv[1][p_my + tab_bias]; + }else{ + s->mv[0][i][1] = p_my*time_pb/time_pp + my; + s->mv[1][i][1] = my ? s->mv[0][i][1] - p_my + : p_my*(time_pb - time_pp)/time_pp; + } +} + +#undef tab_size +#undef tab_bias + +/** + * + * @return the mb_type + */ +int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my){ + const int mb_index= s->mb_x + s->mb_y*s->mb_stride; + const int colocated_mb_type= s->next_picture.mb_type[mb_index]; + uint16_t time_pp; + uint16_t time_pb; + int i; + + //FIXME avoid divides + // try special case with shifts for 1 and 3 B-frames? + + if(IS_8X8(colocated_mb_type)){ + s->mv_type = MV_TYPE_8X8; + for(i=0; i<4; i++){ + ff_mpeg4_set_one_direct_mv(s, mx, my, i); + } + return MB_TYPE_DIRECT2 | MB_TYPE_8x8 | MB_TYPE_L0L1; + } else if(IS_INTERLACED(colocated_mb_type)){ + s->mv_type = MV_TYPE_FIELD; + for(i=0; i<2; i++){ + int field_select= s->next_picture.ref_index[0][4*mb_index + 2*i]; + s->field_select[0][i]= field_select; + s->field_select[1][i]= i; + if(s->top_field_first){ + time_pp= s->pp_field_time - field_select + i; + time_pb= s->pb_field_time - field_select + i; + }else{ + time_pp= s->pp_field_time + field_select - i; + time_pb= s->pb_field_time + field_select - i; + } + s->mv[0][i][0] = s->p_field_mv_table[i][0][mb_index][0]*time_pb/time_pp + mx; + s->mv[0][i][1] = s->p_field_mv_table[i][0][mb_index][1]*time_pb/time_pp + my; + s->mv[1][i][0] = mx ? s->mv[0][i][0] - s->p_field_mv_table[i][0][mb_index][0] + : s->p_field_mv_table[i][0][mb_index][0]*(time_pb - time_pp)/time_pp; + s->mv[1][i][1] = my ? s->mv[0][i][1] - s->p_field_mv_table[i][0][mb_index][1] + : s->p_field_mv_table[i][0][mb_index][1]*(time_pb - time_pp)/time_pp; + } + return MB_TYPE_DIRECT2 | MB_TYPE_16x8 | MB_TYPE_L0L1 | MB_TYPE_INTERLACED; + }else{ + ff_mpeg4_set_one_direct_mv(s, mx, my, 0); + s->mv[0][1][0] = s->mv[0][2][0] = s->mv[0][3][0] = s->mv[0][0][0]; + s->mv[0][1][1] = s->mv[0][2][1] = s->mv[0][3][1] = s->mv[0][0][1]; + s->mv[1][1][0] = s->mv[1][2][0] = s->mv[1][3][0] = s->mv[1][0][0]; + s->mv[1][1][1] = s->mv[1][2][1] = s->mv[1][3][1] = s->mv[1][0][1]; + if((s->avctx->workaround_bugs & FF_BUG_DIRECT_BLOCKSIZE) || !s->quarter_sample) + s->mv_type= MV_TYPE_16X16; + else + s->mv_type= MV_TYPE_8X8; + return MB_TYPE_DIRECT2 | MB_TYPE_16x16 | MB_TYPE_L0L1; //Note see prev line + } +} + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4video.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4video.h new file mode 100644 index 00000000..aab32364 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4video.h @@ -0,0 +1,202 @@ +/* + * MPEG4 encoder/decoder internal header. + * Copyright (c) 2000,2001 Fabrice Bellard + * Copyright (c) 2002-2010 Michael Niedermayer + * + * 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 + */ + +#ifndef AVCODEC_MPEG4VIDEO_H +#define AVCODEC_MPEG4VIDEO_H + +#include +#include "get_bits.h" +#include "mpegvideo.h" +#include "rl.h" + +// shapes +#define RECT_SHAPE 0 +#define BIN_SHAPE 1 +#define BIN_ONLY_SHAPE 2 +#define GRAY_SHAPE 3 + +#define SIMPLE_VO_TYPE 1 +#define CORE_VO_TYPE 3 +#define MAIN_VO_TYPE 4 +#define NBIT_VO_TYPE 5 +#define ARTS_VO_TYPE 10 +#define ACE_VO_TYPE 12 +#define ADV_SIMPLE_VO_TYPE 17 + +// aspect_ratio_info +#define EXTENDED_PAR 15 + +//vol_sprite_usage / sprite_enable +#define STATIC_SPRITE 1 +#define GMC_SPRITE 2 + +#define MOTION_MARKER 0x1F001 +#define DC_MARKER 0x6B001 + +#define VOS_STARTCODE 0x1B0 +#define USER_DATA_STARTCODE 0x1B2 +#define GOP_STARTCODE 0x1B3 +#define VISUAL_OBJ_STARTCODE 0x1B5 +#define VOP_STARTCODE 0x1B6 + +/* dc encoding for mpeg4 */ +extern const uint8_t ff_mpeg4_DCtab_lum[13][2]; +extern const uint8_t ff_mpeg4_DCtab_chrom[13][2]; + +extern const uint16_t ff_mpeg4_intra_vlc[103][2]; +extern RLTable ff_mpeg4_rl_intra; + +/* Note this is identical to the intra rvlc except that it is reordered. */ +extern const uint16_t inter_rvlc[170][2]; +extern RLTable rvlc_rl_inter; + +extern const uint16_t intra_rvlc[170][2]; +extern RLTable rvlc_rl_intra; + +extern const uint16_t sprite_trajectory_tab[15][2]; +extern const uint8_t mb_type_b_tab[4][2]; + +/* these matrixes will be permuted for the idct */ +extern const int16_t ff_mpeg4_default_intra_matrix[64]; +extern const int16_t ff_mpeg4_default_non_intra_matrix[64]; + +extern const uint8_t ff_mpeg4_y_dc_scale_table[32]; +extern const uint8_t ff_mpeg4_c_dc_scale_table[32]; +extern const uint16_t ff_mpeg4_resync_prefix[8]; + +extern const uint8_t mpeg4_dc_threshold[8]; + +void mpeg4_encode_mb(MpegEncContext *s, + DCTELEM block[6][64], + int motion_x, int motion_y); +void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, + int dir); +void ff_set_mpeg4_time(MpegEncContext * s); +void mpeg4_encode_picture_header(MpegEncContext *s, int picture_number); + +int ff_mpeg4_decode_picture_header(MpegEncContext * s, GetBitContext *gb); +void ff_mpeg4_encode_video_packet_header(MpegEncContext *s); +void ff_mpeg4_clean_buffers(MpegEncContext *s); +void ff_mpeg4_stuffing(PutBitContext * pbc); +void ff_mpeg4_init_partitions(MpegEncContext *s); +void ff_mpeg4_merge_partitions(MpegEncContext *s); +void ff_clean_mpeg4_qscales(MpegEncContext *s); +int ff_mpeg4_decode_partitions(MpegEncContext *s); +int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s); +int mpeg4_decode_video_packet_header(MpegEncContext *s); +void ff_mpeg4_init_direct_mv(MpegEncContext *s); + +/** + * + * @return the mb_type + */ +int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my); + +extern uint8_t ff_mpeg4_static_rl_table_store[3][2][2*MAX_RUN + MAX_LEVEL + 3]; + + +#if 0 //3IV1 is quite rare and it slows things down a tiny bit +#define IS_3IV1 s->codec_tag == AV_RL32("3IV1") +#else +#define IS_3IV1 0 +#endif + + +/** + * predicts the dc. + * encoding quantized level -> quantized diff + * decoding quantized diff -> quantized level + * @param n block index (0-3 are luma, 4-5 are chroma) + * @param dir_ptr pointer to an integer where the prediction direction will be stored + */ +static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, int level, int *dir_ptr, int encoding) +{ + int a, b, c, wrap, pred, scale, ret; + int16_t *dc_val; + + /* find prediction */ + if (n < 4) { + scale = s->y_dc_scale; + } else { + scale = s->c_dc_scale; + } + if(IS_3IV1) + scale= 8; + + wrap= s->block_wrap[n]; + dc_val = s->dc_val[0] + s->block_index[n]; + + /* B C + * A X + */ + a = dc_val[ - 1]; + b = dc_val[ - 1 - wrap]; + c = dc_val[ - wrap]; + + /* outside slice handling (we can't do that by memset as we need the dc for error resilience) */ + if(s->first_slice_line && n!=3){ + if(n!=2) b=c= 1024; + if(n!=1 && s->mb_x == s->resync_mb_x) b=a= 1024; + } + if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1){ + if(n==0 || n==4 || n==5) + b=1024; + } + + if (abs(a - b) < abs(b - c)) { + pred = c; + *dir_ptr = 1; /* top */ + } else { + pred = a; + *dir_ptr = 0; /* left */ + } + /* we assume pred is positive */ + pred = FASTDIV((pred + (scale >> 1)), scale); + + if(encoding){ + ret = level - pred; + }else{ + level += pred; + ret= level; + if(s->error_recognition>=3){ + if(level<0){ + av_log(s->avctx, AV_LOG_ERROR, "dc<0 at %dx%d\n", s->mb_x, s->mb_y); + return -1; + } + if(level*scale > 2048 + scale){ + av_log(s->avctx, AV_LOG_ERROR, "dc overflow at %dx%d\n", s->mb_x, s->mb_y); + return -1; + } + } + } + level *=scale; + if(level&(~2047)){ + if(level<0) + level=0; + else if(!(s->workaround_bugs&FF_BUG_DC_CLIP)) + level=2047; + } + dc_val[0]= level; + + return ret; +} +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4videodec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4videodec.c new file mode 100644 index 00000000..5303da38 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4videodec.c @@ -0,0 +1,2259 @@ +/* + * MPEG4 decoder. + * Copyright (c) 2000,2001 Fabrice Bellard + * Copyright (c) 2002-2010 Michael Niedermayer + * + * 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 + */ + +#include "mpegvideo.h" +#include "mpeg4video.h" +#include "h263.h" + +// The defines below define the number of bits that are read at once for +// reading vlc values. Changing these may improve speed and data cache needs +// be aware though that decreasing them may need the number of stages that is +// passed to get_vlc* to be increased. +#define SPRITE_TRAJ_VLC_BITS 6 +#define DC_VLC_BITS 9 +#define MB_TYPE_B_VLC_BITS 4 + + +static VLC dc_lum, dc_chrom; +static VLC sprite_trajectory; +static VLC mb_type_b_vlc; + +static const int mb_type_b_map[4]= { + MB_TYPE_DIRECT2 | MB_TYPE_L0L1, + MB_TYPE_L0L1 | MB_TYPE_16x16, + MB_TYPE_L1 | MB_TYPE_16x16, + MB_TYPE_L0 | MB_TYPE_16x16, +}; + +/** + * predicts the ac. + * @param n block index (0-3 are luma, 4-5 are chroma) + * @param dir the ac prediction direction + */ +void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, + int dir) +{ + int i; + int16_t *ac_val, *ac_val1; + int8_t * const qscale_table= s->current_picture.qscale_table; + + /* find prediction */ + ac_val = s->ac_val[0][0] + s->block_index[n] * 16; + ac_val1 = ac_val; + if (s->ac_pred) { + if (dir == 0) { + const int xy= s->mb_x-1 + s->mb_y*s->mb_stride; + /* left prediction */ + ac_val -= 16; + + if(s->mb_x==0 || s->qscale == qscale_table[xy] || n==1 || n==3){ + /* same qscale */ + for(i=1;i<8;i++) { + block[s->dsp.idct_permutation[i<<3]] += ac_val[i]; + } + }else{ + /* different qscale, we must rescale */ + for(i=1;i<8;i++) { + block[s->dsp.idct_permutation[i<<3]] += ROUNDED_DIV(ac_val[i]*qscale_table[xy], s->qscale); + } + } + } else { + const int xy= s->mb_x + s->mb_y*s->mb_stride - s->mb_stride; + /* top prediction */ + ac_val -= 16 * s->block_wrap[n]; + + if(s->mb_y==0 || s->qscale == qscale_table[xy] || n==2 || n==3){ + /* same qscale */ + for(i=1;i<8;i++) { + block[s->dsp.idct_permutation[i]] += ac_val[i + 8]; + } + }else{ + /* different qscale, we must rescale */ + for(i=1;i<8;i++) { + block[s->dsp.idct_permutation[i]] += ROUNDED_DIV(ac_val[i + 8]*qscale_table[xy], s->qscale); + } + } + } + } + /* left copy */ + for(i=1;i<8;i++) + ac_val1[i ] = block[s->dsp.idct_permutation[i<<3]]; + + /* top copy */ + for(i=1;i<8;i++) + ac_val1[8 + i] = block[s->dsp.idct_permutation[i ]]; + +} + +/** + * check if the next stuff is a resync marker or the end. + * @return 0 if not + */ +static inline int mpeg4_is_resync(MpegEncContext *s){ + int bits_count= get_bits_count(&s->gb); + int v= show_bits(&s->gb, 16); + + if(s->workaround_bugs&FF_BUG_NO_PADDING){ + return 0; + } + + while(v<=0xFF){ + if(s->pict_type==FF_B_TYPE || (v>>(8-s->pict_type)!=1) || s->partitioned_frame) + break; + skip_bits(&s->gb, 8+s->pict_type); + bits_count+= 8+s->pict_type; + v= show_bits(&s->gb, 16); + } + + if(bits_count + 8 >= s->gb.size_in_bits){ + v>>=8; + v|= 0x7F >> (7-(bits_count&7)); + + if(v==0x7F) + return 1; + }else{ + if(v == ff_mpeg4_resync_prefix[bits_count&7]){ + int len; + GetBitContext gb= s->gb; + + skip_bits(&s->gb, 1); + align_get_bits(&s->gb); + + for(len=0; len<32; len++){ + if(get_bits1(&s->gb)) break; + } + + s->gb= gb; + + if(len>=ff_mpeg4_get_video_packet_prefix_length(s)) + return 1; + } + } + return 0; +} + +static void mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb) +{ + int i; + int a= 2<sprite_warping_accuracy; + int rho= 3-s->sprite_warping_accuracy; + int r=16/a; + const int vop_ref[4][2]= {{0,0}, {s->width,0}, {0, s->height}, {s->width, s->height}}; // only true for rectangle shapes + int d[4][2]={{0,0}, {0,0}, {0,0}, {0,0}}; + int sprite_ref[4][2]; + int virtual_ref[2][2]; + int w2, h2, w3, h3; + int alpha=0, beta=0; + int w= s->width; + int h= s->height; + int min_ab; + + for(i=0; inum_sprite_warping_points; i++){ + int length; + int x=0, y=0; + + length= get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3); + if(length){ + x= get_xbits(gb, length); + } + if(!(s->divx_version==500 && s->divx_build==413)) skip_bits1(gb); /* marker bit */ + + length= get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3); + if(length){ + y=get_xbits(gb, length); + } + skip_bits1(gb); /* marker bit */ + s->sprite_traj[i][0]= d[i][0]= x; + s->sprite_traj[i][1]= d[i][1]= y; + } + for(; i<4; i++) + s->sprite_traj[i][0]= s->sprite_traj[i][1]= 0; + + while((1<divx_version==500 && s->divx_build==413){ + sprite_ref[0][0]= a*vop_ref[0][0] + d[0][0]; + sprite_ref[0][1]= a*vop_ref[0][1] + d[0][1]; + sprite_ref[1][0]= a*vop_ref[1][0] + d[0][0] + d[1][0]; + sprite_ref[1][1]= a*vop_ref[1][1] + d[0][1] + d[1][1]; + sprite_ref[2][0]= a*vop_ref[2][0] + d[0][0] + d[2][0]; + sprite_ref[2][1]= a*vop_ref[2][1] + d[0][1] + d[2][1]; + } else { + sprite_ref[0][0]= (a>>1)*(2*vop_ref[0][0] + d[0][0]); + sprite_ref[0][1]= (a>>1)*(2*vop_ref[0][1] + d[0][1]); + sprite_ref[1][0]= (a>>1)*(2*vop_ref[1][0] + d[0][0] + d[1][0]); + sprite_ref[1][1]= (a>>1)*(2*vop_ref[1][1] + d[0][1] + d[1][1]); + sprite_ref[2][0]= (a>>1)*(2*vop_ref[2][0] + d[0][0] + d[2][0]); + sprite_ref[2][1]= (a>>1)*(2*vop_ref[2][1] + d[0][1] + d[2][1]); + } +/* sprite_ref[3][0]= (a>>1)*(2*vop_ref[3][0] + d[0][0] + d[1][0] + d[2][0] + d[3][0]); + sprite_ref[3][1]= (a>>1)*(2*vop_ref[3][1] + d[0][1] + d[1][1] + d[2][1] + d[3][1]); */ + +// this is mostly identical to the mpeg4 std (and is totally unreadable because of that ...) +// perhaps it should be reordered to be more readable ... +// the idea behind this virtual_ref mess is to be able to use shifts later per pixel instead of divides +// so the distance between points is converted from w&h based to w2&h2 based which are of the 2^x form + virtual_ref[0][0]= 16*(vop_ref[0][0] + w2) + + ROUNDED_DIV(((w - w2)*(r*sprite_ref[0][0] - 16*vop_ref[0][0]) + w2*(r*sprite_ref[1][0] - 16*vop_ref[1][0])),w); + virtual_ref[0][1]= 16*vop_ref[0][1] + + ROUNDED_DIV(((w - w2)*(r*sprite_ref[0][1] - 16*vop_ref[0][1]) + w2*(r*sprite_ref[1][1] - 16*vop_ref[1][1])),w); + virtual_ref[1][0]= 16*vop_ref[0][0] + + ROUNDED_DIV(((h - h2)*(r*sprite_ref[0][0] - 16*vop_ref[0][0]) + h2*(r*sprite_ref[2][0] - 16*vop_ref[2][0])),h); + virtual_ref[1][1]= 16*(vop_ref[0][1] + h2) + + ROUNDED_DIV(((h - h2)*(r*sprite_ref[0][1] - 16*vop_ref[0][1]) + h2*(r*sprite_ref[2][1] - 16*vop_ref[2][1])),h); + + switch(s->num_sprite_warping_points) + { + case 0: + s->sprite_offset[0][0]= 0; + s->sprite_offset[0][1]= 0; + s->sprite_offset[1][0]= 0; + s->sprite_offset[1][1]= 0; + s->sprite_delta[0][0]= a; + s->sprite_delta[0][1]= 0; + s->sprite_delta[1][0]= 0; + s->sprite_delta[1][1]= a; + s->sprite_shift[0]= 0; + s->sprite_shift[1]= 0; + break; + case 1: //GMC only + s->sprite_offset[0][0]= sprite_ref[0][0] - a*vop_ref[0][0]; + s->sprite_offset[0][1]= sprite_ref[0][1] - a*vop_ref[0][1]; + s->sprite_offset[1][0]= ((sprite_ref[0][0]>>1)|(sprite_ref[0][0]&1)) - a*(vop_ref[0][0]/2); + s->sprite_offset[1][1]= ((sprite_ref[0][1]>>1)|(sprite_ref[0][1]&1)) - a*(vop_ref[0][1]/2); + s->sprite_delta[0][0]= a; + s->sprite_delta[0][1]= 0; + s->sprite_delta[1][0]= 0; + s->sprite_delta[1][1]= a; + s->sprite_shift[0]= 0; + s->sprite_shift[1]= 0; + break; + case 2: + s->sprite_offset[0][0]= (sprite_ref[0][0]<<(alpha+rho)) + + (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-vop_ref[0][0]) + + ( r*sprite_ref[0][1] - virtual_ref[0][1])*(-vop_ref[0][1]) + + (1<<(alpha+rho-1)); + s->sprite_offset[0][1]= (sprite_ref[0][1]<<(alpha+rho)) + + (-r*sprite_ref[0][1] + virtual_ref[0][1])*(-vop_ref[0][0]) + + (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-vop_ref[0][1]) + + (1<<(alpha+rho-1)); + s->sprite_offset[1][0]= ( (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-2*vop_ref[0][0] + 1) + +( r*sprite_ref[0][1] - virtual_ref[0][1])*(-2*vop_ref[0][1] + 1) + +2*w2*r*sprite_ref[0][0] + - 16*w2 + + (1<<(alpha+rho+1))); + s->sprite_offset[1][1]= ( (-r*sprite_ref[0][1] + virtual_ref[0][1])*(-2*vop_ref[0][0] + 1) + +(-r*sprite_ref[0][0] + virtual_ref[0][0])*(-2*vop_ref[0][1] + 1) + +2*w2*r*sprite_ref[0][1] + - 16*w2 + + (1<<(alpha+rho+1))); + s->sprite_delta[0][0]= (-r*sprite_ref[0][0] + virtual_ref[0][0]); + s->sprite_delta[0][1]= (+r*sprite_ref[0][1] - virtual_ref[0][1]); + s->sprite_delta[1][0]= (-r*sprite_ref[0][1] + virtual_ref[0][1]); + s->sprite_delta[1][1]= (-r*sprite_ref[0][0] + virtual_ref[0][0]); + + s->sprite_shift[0]= alpha+rho; + s->sprite_shift[1]= alpha+rho+2; + break; + case 3: + min_ab= FFMIN(alpha, beta); + w3= w2>>min_ab; + h3= h2>>min_ab; + s->sprite_offset[0][0]= (sprite_ref[0][0]<<(alpha+beta+rho-min_ab)) + + (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3*(-vop_ref[0][0]) + + (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3*(-vop_ref[0][1]) + + (1<<(alpha+beta+rho-min_ab-1)); + s->sprite_offset[0][1]= (sprite_ref[0][1]<<(alpha+beta+rho-min_ab)) + + (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3*(-vop_ref[0][0]) + + (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3*(-vop_ref[0][1]) + + (1<<(alpha+beta+rho-min_ab-1)); + s->sprite_offset[1][0]= (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3*(-2*vop_ref[0][0] + 1) + + (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3*(-2*vop_ref[0][1] + 1) + + 2*w2*h3*r*sprite_ref[0][0] + - 16*w2*h3 + + (1<<(alpha+beta+rho-min_ab+1)); + s->sprite_offset[1][1]= (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3*(-2*vop_ref[0][0] + 1) + + (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3*(-2*vop_ref[0][1] + 1) + + 2*w2*h3*r*sprite_ref[0][1] + - 16*w2*h3 + + (1<<(alpha+beta+rho-min_ab+1)); + s->sprite_delta[0][0]= (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3; + s->sprite_delta[0][1]= (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3; + s->sprite_delta[1][0]= (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3; + s->sprite_delta[1][1]= (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3; + + s->sprite_shift[0]= alpha + beta + rho - min_ab; + s->sprite_shift[1]= alpha + beta + rho - min_ab + 2; + break; + } + /* try to simplify the situation */ + if( s->sprite_delta[0][0] == a<sprite_shift[0] + && s->sprite_delta[0][1] == 0 + && s->sprite_delta[1][0] == 0 + && s->sprite_delta[1][1] == a<sprite_shift[0]) + { + s->sprite_offset[0][0]>>=s->sprite_shift[0]; + s->sprite_offset[0][1]>>=s->sprite_shift[0]; + s->sprite_offset[1][0]>>=s->sprite_shift[1]; + s->sprite_offset[1][1]>>=s->sprite_shift[1]; + s->sprite_delta[0][0]= a; + s->sprite_delta[0][1]= 0; + s->sprite_delta[1][0]= 0; + s->sprite_delta[1][1]= a; + s->sprite_shift[0]= 0; + s->sprite_shift[1]= 0; + s->real_sprite_warping_points=1; + } + else{ + int shift_y= 16 - s->sprite_shift[0]; + int shift_c= 16 - s->sprite_shift[1]; + for(i=0; i<2; i++){ + s->sprite_offset[0][i]<<= shift_y; + s->sprite_offset[1][i]<<= shift_c; + s->sprite_delta[0][i]<<= shift_y; + s->sprite_delta[1][i]<<= shift_y; + s->sprite_shift[i]= 16; + } + s->real_sprite_warping_points= s->num_sprite_warping_points; + } +} + +/** + * decodes the next video packet. + * @return <0 if something went wrong + */ +int mpeg4_decode_video_packet_header(MpegEncContext *s) +{ + int mb_num_bits= av_log2(s->mb_num - 1) + 1; + int header_extension=0, mb_num, len; + + /* is there enough space left for a video packet + header */ + if( get_bits_count(&s->gb) > s->gb.size_in_bits-20) return -1; + + for(len=0; len<32; len++){ + if(get_bits1(&s->gb)) break; + } + + if(len!=ff_mpeg4_get_video_packet_prefix_length(s)){ + av_log(s->avctx, AV_LOG_ERROR, "marker does not match f_code\n"); + return -1; + } + + if(s->shape != RECT_SHAPE){ + header_extension= get_bits1(&s->gb); + //FIXME more stuff here + } + + mb_num= get_bits(&s->gb, mb_num_bits); + if(mb_num>=s->mb_num){ + av_log(s->avctx, AV_LOG_ERROR, "illegal mb_num in video packet (%d %d) \n", mb_num, s->mb_num); + return -1; + } + if(s->pict_type == FF_B_TYPE){ + while(s->next_picture.mbskip_table[ s->mb_index2xy[ mb_num ] ]) mb_num++; + if(mb_num >= s->mb_num) return -1; // slice contains just skipped MBs which where already decoded + } + + s->mb_x= mb_num % s->mb_width; + s->mb_y= mb_num / s->mb_width; + + if(s->shape != BIN_ONLY_SHAPE){ + int qscale= get_bits(&s->gb, s->quant_precision); + if(qscale) + s->chroma_qscale=s->qscale= qscale; + } + + if(s->shape == RECT_SHAPE){ + header_extension= get_bits1(&s->gb); + } + if(header_extension){ + int time_increment; + int time_incr=0; + + while (get_bits1(&s->gb) != 0) + time_incr++; + + check_marker(&s->gb, "before time_increment in video packed header"); + time_increment= get_bits(&s->gb, s->time_increment_bits); + check_marker(&s->gb, "before vop_coding_type in video packed header"); + + skip_bits(&s->gb, 2); /* vop coding type */ + //FIXME not rect stuff here + + if(s->shape != BIN_ONLY_SHAPE){ + skip_bits(&s->gb, 3); /* intra dc vlc threshold */ +//FIXME don't just ignore everything + if(s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE){ + mpeg4_decode_sprite_trajectory(s, &s->gb); + av_log(s->avctx, AV_LOG_ERROR, "untested\n"); + } + + //FIXME reduced res stuff here + + if (s->pict_type != FF_I_TYPE) { + int f_code = get_bits(&s->gb, 3); /* fcode_for */ + if(f_code==0){ + av_log(s->avctx, AV_LOG_ERROR, "Error, video packet header damaged (f_code=0)\n"); + } + } + if (s->pict_type == FF_B_TYPE) { + int b_code = get_bits(&s->gb, 3); + if(b_code==0){ + av_log(s->avctx, AV_LOG_ERROR, "Error, video packet header damaged (b_code=0)\n"); + } + } + } + } + //FIXME new-pred stuff + + return 0; +} + +/** + * gets the average motion vector for a GMC MB. + * @param n either 0 for the x component or 1 for y + * @return the average MV for a GMC MB + */ +static inline int get_amv(MpegEncContext *s, int n){ + int x, y, mb_v, sum, dx, dy, shift; + int len = 1 << (s->f_code + 4); + const int a= s->sprite_warping_accuracy; + + if(s->workaround_bugs & FF_BUG_AMV) + len >>= s->quarter_sample; + + if(s->real_sprite_warping_points==1){ + if(s->divx_version==500 && s->divx_build==413) + sum= s->sprite_offset[0][n] / (1<<(a - s->quarter_sample)); + else + sum= RSHIFT(s->sprite_offset[0][n]<quarter_sample, a); + }else{ + dx= s->sprite_delta[n][0]; + dy= s->sprite_delta[n][1]; + shift= s->sprite_shift[0]; + if(n) dy -= 1<<(shift + a + 1); + else dx -= 1<<(shift + a + 1); + mb_v= s->sprite_offset[0][n] + dx*s->mb_x*16 + dy*s->mb_y*16; + + sum=0; + for(y=0; y<16; y++){ + int v; + + v= mb_v + dy*y; + //XXX FIXME optimize + for(x=0; x<16; x++){ + sum+= v>>shift; + v+= dx; + } + } + sum= RSHIFT(sum, a+8-s->quarter_sample); + } + + if (sum < -len) sum= -len; + else if (sum >= len) sum= len-1; + + return sum; +} + +/** + * decodes the dc value. + * @param n block index (0-3 are luma, 4-5 are chroma) + * @param dir_ptr the prediction direction will be stored here + * @return the quantized dc + */ +static inline int mpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr) +{ + int level, code; + + if (n < 4) + code = get_vlc2(&s->gb, dc_lum.table, DC_VLC_BITS, 1); + else + code = get_vlc2(&s->gb, dc_chrom.table, DC_VLC_BITS, 1); + if (code < 0 || code > 9 /* && s->nbit<9 */){ + av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n"); + return -1; + } + if (code == 0) { + level = 0; + } else { + if(IS_3IV1){ + if(code==1) + level= 2*get_bits1(&s->gb)-1; + else{ + if(get_bits1(&s->gb)) + level = get_bits(&s->gb, code-1) + (1<<(code-1)); + else + level = -get_bits(&s->gb, code-1) - (1<<(code-1)); + } + }else{ + level = get_xbits(&s->gb, code); + } + + if (code > 8){ + if(get_bits1(&s->gb)==0){ /* marker */ + if(s->error_recognition>=2){ + av_log(s->avctx, AV_LOG_ERROR, "dc marker bit missing\n"); + return -1; + } + } + } + } + + return ff_mpeg4_pred_dc(s, n, level, dir_ptr, 0); +} + +/** + * decodes first partition. + * @return number of MBs decoded or <0 if an error occurred + */ +static int mpeg4_decode_partition_a(MpegEncContext *s){ + int mb_num; + static const int8_t quant_tab[4] = { -1, -2, 1, 2 }; + + /* decode first partition */ + mb_num=0; + s->first_slice_line=1; + for(; s->mb_ymb_height; s->mb_y++){ + ff_init_block_index(s); + for(; s->mb_xmb_width; s->mb_x++){ + const int xy= s->mb_x + s->mb_y*s->mb_stride; + int cbpc; + int dir=0; + + mb_num++; + ff_update_block_index(s); + if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1) + s->first_slice_line=0; + + if(s->pict_type==FF_I_TYPE){ + int i; + + do{ + if(show_bits_long(&s->gb, 19)==DC_MARKER){ + return mb_num-1; + } + + cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2); + if (cbpc < 0){ + av_log(s->avctx, AV_LOG_ERROR, "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + }while(cbpc == 8); + + s->cbp_table[xy]= cbpc & 3; + s->current_picture.mb_type[xy]= MB_TYPE_INTRA; + s->mb_intra = 1; + + if(cbpc & 4) { + ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]); + } + s->current_picture.qscale_table[xy]= s->qscale; + + s->mbintra_table[xy]= 1; + for(i=0; i<6; i++){ + int dc_pred_dir; + int dc= mpeg4_decode_dc(s, i, &dc_pred_dir); + if(dc < 0){ + av_log(s->avctx, AV_LOG_ERROR, "DC corrupted at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + dir<<=1; + if(dc_pred_dir) dir|=1; + } + s->pred_dir_table[xy]= dir; + }else{ /* P/S_TYPE */ + int mx, my, pred_x, pred_y, bits; + int16_t * const mot_val= s->current_picture.motion_val[0][s->block_index[0]]; + const int stride= s->b8_stride*2; + +try_again: + bits= show_bits(&s->gb, 17); + if(bits==MOTION_MARKER){ + return mb_num-1; + } + skip_bits1(&s->gb); + if(bits&0x10000){ + /* skip mb */ + if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE){ + s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_GMC | MB_TYPE_L0; + mx= get_amv(s, 0); + my= get_amv(s, 1); + }else{ + s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + mx=my=0; + } + mot_val[0 ]= mot_val[2 ]= + mot_val[0+stride]= mot_val[2+stride]= mx; + mot_val[1 ]= mot_val[3 ]= + mot_val[1+stride]= mot_val[3+stride]= my; + + if(s->mbintra_table[xy]) + ff_clean_intra_table_entries(s); + continue; + } + + cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); + if (cbpc < 0){ + av_log(s->avctx, AV_LOG_ERROR, "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + if(cbpc == 20) + goto try_again; + + s->cbp_table[xy]= cbpc&(8+3); //8 is dquant + + s->mb_intra = ((cbpc & 4) != 0); + + if(s->mb_intra){ + s->current_picture.mb_type[xy]= MB_TYPE_INTRA; + s->mbintra_table[xy]= 1; + mot_val[0 ]= mot_val[2 ]= + mot_val[0+stride]= mot_val[2+stride]= 0; + mot_val[1 ]= mot_val[3 ]= + mot_val[1+stride]= mot_val[3+stride]= 0; + }else{ + if(s->mbintra_table[xy]) + ff_clean_intra_table_entries(s); + + if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0) + s->mcsel= get_bits1(&s->gb); + else s->mcsel= 0; + + if ((cbpc & 16) == 0) { + /* 16x16 motion prediction */ + + h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + if(!s->mcsel){ + mx = h263_decode_motion(s, pred_x, s->f_code); + if (mx >= 0xffff) + return -1; + + my = h263_decode_motion(s, pred_y, s->f_code); + if (my >= 0xffff) + return -1; + s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0; + } else { + mx = get_amv(s, 0); + my = get_amv(s, 1); + s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_GMC | MB_TYPE_L0; + } + + mot_val[0 ]= mot_val[2 ] = + mot_val[0+stride]= mot_val[2+stride]= mx; + mot_val[1 ]= mot_val[3 ]= + mot_val[1+stride]= mot_val[3+stride]= my; + } else { + int i; + s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0; + for(i=0;i<4;i++) { + int16_t *mot_val= h263_pred_motion(s, i, 0, &pred_x, &pred_y); + mx = h263_decode_motion(s, pred_x, s->f_code); + if (mx >= 0xffff) + return -1; + + my = h263_decode_motion(s, pred_y, s->f_code); + if (my >= 0xffff) + return -1; + mot_val[0] = mx; + mot_val[1] = my; + } + } + } + } + } + s->mb_x= 0; + } + + return mb_num; +} + +/** + * decode second partition. + * @return <0 if an error occurred + */ +static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){ + int mb_num=0; + static const int8_t quant_tab[4] = { -1, -2, 1, 2 }; + + s->mb_x= s->resync_mb_x; + s->first_slice_line=1; + for(s->mb_y= s->resync_mb_y; mb_num < mb_count; s->mb_y++){ + ff_init_block_index(s); + for(; mb_num < mb_count && s->mb_xmb_width; s->mb_x++){ + const int xy= s->mb_x + s->mb_y*s->mb_stride; + + mb_num++; + ff_update_block_index(s); + if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1) + s->first_slice_line=0; + + if(s->pict_type==FF_I_TYPE){ + int ac_pred= get_bits1(&s->gb); + int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); + if(cbpy<0){ + av_log(s->avctx, AV_LOG_ERROR, "cbpy corrupted at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + + s->cbp_table[xy]|= cbpy<<2; + s->current_picture.mb_type[xy] |= ac_pred*MB_TYPE_ACPRED; + }else{ /* P || S_TYPE */ + if(IS_INTRA(s->current_picture.mb_type[xy])){ + int dir=0,i; + int ac_pred = get_bits1(&s->gb); + int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); + + if(cbpy<0){ + av_log(s->avctx, AV_LOG_ERROR, "I cbpy corrupted at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + + if(s->cbp_table[xy] & 8) { + ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]); + } + s->current_picture.qscale_table[xy]= s->qscale; + + for(i=0; i<6; i++){ + int dc_pred_dir; + int dc= mpeg4_decode_dc(s, i, &dc_pred_dir); + if(dc < 0){ + av_log(s->avctx, AV_LOG_ERROR, "DC corrupted at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + dir<<=1; + if(dc_pred_dir) dir|=1; + } + s->cbp_table[xy]&= 3; //remove dquant + s->cbp_table[xy]|= cbpy<<2; + s->current_picture.mb_type[xy] |= ac_pred*MB_TYPE_ACPRED; + s->pred_dir_table[xy]= dir; + }else if(IS_SKIP(s->current_picture.mb_type[xy])){ + s->current_picture.qscale_table[xy]= s->qscale; + s->cbp_table[xy]= 0; + }else{ + int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); + + if(cbpy<0){ + av_log(s->avctx, AV_LOG_ERROR, "P cbpy corrupted at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + + if(s->cbp_table[xy] & 8) { + ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]); + } + s->current_picture.qscale_table[xy]= s->qscale; + + s->cbp_table[xy]&= 3; //remove dquant + s->cbp_table[xy]|= (cbpy^0xf)<<2; + } + } + } + if(mb_num >= mb_count) return 0; + s->mb_x= 0; + } + return 0; +} + +/** + * decodes the first & second partition + * @return <0 if error (and sets error type in the error_status_table) + */ +int ff_mpeg4_decode_partitions(MpegEncContext *s) +{ + int mb_num; + const int part_a_error= s->pict_type==FF_I_TYPE ? (DC_ERROR|MV_ERROR) : MV_ERROR; + const int part_a_end = s->pict_type==FF_I_TYPE ? (DC_END |MV_END) : MV_END; + + mb_num= mpeg4_decode_partition_a(s); + if(mb_num<0){ + ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, part_a_error); + return -1; + } + + if(s->resync_mb_x + s->resync_mb_y*s->mb_width + mb_num > s->mb_num){ + av_log(s->avctx, AV_LOG_ERROR, "slice below monitor ...\n"); + ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, part_a_error); + return -1; + } + + s->mb_num_left= mb_num; + + if(s->pict_type==FF_I_TYPE){ + while(show_bits(&s->gb, 9) == 1) + skip_bits(&s->gb, 9); + if(get_bits_long(&s->gb, 19)!=DC_MARKER){ + av_log(s->avctx, AV_LOG_ERROR, "marker missing after first I partition at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + }else{ + while(show_bits(&s->gb, 10) == 1) + skip_bits(&s->gb, 10); + if(get_bits(&s->gb, 17)!=MOTION_MARKER){ + av_log(s->avctx, AV_LOG_ERROR, "marker missing after first P partition at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + } + ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, part_a_end); + + if( mpeg4_decode_partition_b(s, mb_num) < 0){ + if(s->pict_type==FF_P_TYPE) + ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, DC_ERROR); + return -1; + }else{ + if(s->pict_type==FF_P_TYPE) + ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, DC_END); + } + + return 0; +} + +/** + * decodes a block. + * @return <0 if an error occurred + */ +static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, + int n, int coded, int intra, int rvlc) +{ + int level, i, last, run; + int dc_pred_dir; + RLTable * rl; + RL_VLC_ELEM * rl_vlc; + const uint8_t * scan_table; + int qmul, qadd; + + //Note intra & rvlc should be optimized away if this is inlined + + if(intra) { + if(s->use_intra_dc_vlc){ + /* DC coef */ + if(s->partitioned_frame){ + level = s->dc_val[0][ s->block_index[n] ]; + if(n<4) level= FASTDIV((level + (s->y_dc_scale>>1)), s->y_dc_scale); + else level= FASTDIV((level + (s->c_dc_scale>>1)), s->c_dc_scale); + dc_pred_dir= (s->pred_dir_table[s->mb_x + s->mb_y*s->mb_stride]<ac_pred) { + if (dc_pred_dir == 0) + scan_table = s->intra_v_scantable.permutated; /* left */ + else + scan_table = s->intra_h_scantable.permutated; /* top */ + } else { + scan_table = s->intra_scantable.permutated; + } + qmul=1; + qadd=0; + } else { + i = -1; + if (!coded) { + s->block_last_index[n] = i; + return 0; + } + if(rvlc) rl = &rvlc_rl_inter; + else rl = &ff_h263_rl_inter; + + scan_table = s->intra_scantable.permutated; + + if(s->mpeg_quant){ + qmul=1; + qadd=0; + if(rvlc){ + rl_vlc = rvlc_rl_inter.rl_vlc[0]; + }else{ + rl_vlc = ff_h263_rl_inter.rl_vlc[0]; + } + }else{ + qmul = s->qscale << 1; + qadd = (s->qscale - 1) | 1; + if(rvlc){ + rl_vlc = rvlc_rl_inter.rl_vlc[s->qscale]; + }else{ + rl_vlc = ff_h263_rl_inter.rl_vlc[s->qscale]; + } + } + } + { + OPEN_READER(re, &s->gb); + for(;;) { + UPDATE_CACHE(re, &s->gb); + GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 0); + if (level==0) { + /* escape */ + if(rvlc){ + if(SHOW_UBITS(re, &s->gb, 1)==0){ + av_log(s->avctx, AV_LOG_ERROR, "1. marker bit missing in rvlc esc\n"); + return -1; + }; SKIP_CACHE(re, &s->gb, 1); + + last= SHOW_UBITS(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1); + run= SHOW_UBITS(re, &s->gb, 6); LAST_SKIP_CACHE(re, &s->gb, 6); + SKIP_COUNTER(re, &s->gb, 1+1+6); + UPDATE_CACHE(re, &s->gb); + + if(SHOW_UBITS(re, &s->gb, 1)==0){ + av_log(s->avctx, AV_LOG_ERROR, "2. marker bit missing in rvlc esc\n"); + return -1; + }; SKIP_CACHE(re, &s->gb, 1); + + level= SHOW_UBITS(re, &s->gb, 11); SKIP_CACHE(re, &s->gb, 11); + + if(SHOW_UBITS(re, &s->gb, 5)!=0x10){ + av_log(s->avctx, AV_LOG_ERROR, "reverse esc missing\n"); + return -1; + }; SKIP_CACHE(re, &s->gb, 5); + + level= level * qmul + qadd; + level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); LAST_SKIP_CACHE(re, &s->gb, 1); + SKIP_COUNTER(re, &s->gb, 1+11+5+1); + + i+= run + 1; + if(last) i+=192; + }else{ + int cache; + cache= GET_CACHE(re, &s->gb); + + if(IS_3IV1) + cache ^= 0xC0000000; + + if (cache&0x80000000) { + if (cache&0x40000000) { + /* third escape */ + SKIP_CACHE(re, &s->gb, 2); + last= SHOW_UBITS(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1); + run= SHOW_UBITS(re, &s->gb, 6); LAST_SKIP_CACHE(re, &s->gb, 6); + SKIP_COUNTER(re, &s->gb, 2+1+6); + UPDATE_CACHE(re, &s->gb); + + if(IS_3IV1){ + level= SHOW_SBITS(re, &s->gb, 12); LAST_SKIP_BITS(re, &s->gb, 12); + }else{ + if(SHOW_UBITS(re, &s->gb, 1)==0){ + av_log(s->avctx, AV_LOG_ERROR, "1. marker bit missing in 3. esc\n"); + return -1; + }; SKIP_CACHE(re, &s->gb, 1); + + level= SHOW_SBITS(re, &s->gb, 12); SKIP_CACHE(re, &s->gb, 12); + + if(SHOW_UBITS(re, &s->gb, 1)==0){ + av_log(s->avctx, AV_LOG_ERROR, "2. marker bit missing in 3. esc\n"); + return -1; + }; LAST_SKIP_CACHE(re, &s->gb, 1); + + SKIP_COUNTER(re, &s->gb, 1+12+1); + } + +#if 0 + if(s->error_recognition >= FF_ER_COMPLIANT){ + const int abs_level= FFABS(level); + if(abs_level<=MAX_LEVEL && run<=MAX_RUN){ + const int run1= run - rl->max_run[last][abs_level] - 1; + if(abs_level <= rl->max_level[last][run]){ + av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, vlc encoding possible\n"); + return -1; + } + if(s->error_recognition > FF_ER_COMPLIANT){ + if(abs_level <= rl->max_level[last][run]*2){ + av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 1 encoding possible\n"); + return -1; + } + if(run1 >= 0 && abs_level <= rl->max_level[last][run1]){ + av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 2 encoding possible\n"); + return -1; + } + } + } + } +#endif + if (level>0) level= level * qmul + qadd; + else level= level * qmul - qadd; + + if((unsigned)(level + 2048) > 4095){ + if(s->error_recognition > FF_ER_COMPLIANT){ + if(level > 2560 || level<-2560){ + av_log(s->avctx, AV_LOG_ERROR, "|level| overflow in 3. esc, qp=%d\n", s->qscale); + return -1; + } + } + level= level<0 ? -2048 : 2047; + } + + i+= run + 1; + if(last) i+=192; + } else { + /* second escape */ + SKIP_BITS(re, &s->gb, 2); + GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1); + i+= run + rl->max_run[run>>7][level/qmul] +1; //FIXME opt indexing + level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); + LAST_SKIP_BITS(re, &s->gb, 1); + } + } else { + /* first escape */ + SKIP_BITS(re, &s->gb, 1); + GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1); + i+= run; + level = level + rl->max_level[run>>7][(run-1)&63] * qmul;//FIXME opt indexing + level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); + LAST_SKIP_BITS(re, &s->gb, 1); + } + } + } else { + i+= run; + level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); + LAST_SKIP_BITS(re, &s->gb, 1); + } + if (i > 62){ + i-= 192; + if(i&(~63)){ + av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + + block[scan_table[i]] = level; + break; + } + + block[scan_table[i]] = level; + } + CLOSE_READER(re, &s->gb); + } + not_coded: + if (intra) { + if(!s->use_intra_dc_vlc){ + block[0] = ff_mpeg4_pred_dc(s, n, block[0], &dc_pred_dir, 0); + + i -= i>>31; //if(i == -1) i=0; + } + + mpeg4_pred_ac(s, block, n, dc_pred_dir); + if (s->ac_pred) { + i = 63; /* XXX: not optimal */ + } + } + s->block_last_index[n] = i; + return 0; +} + +/** + * decode partition C of one MB. + * @return <0 if an error occurred + */ +static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64]) +{ + int cbp, mb_type; + const int xy= s->mb_x + s->mb_y*s->mb_stride; + + mb_type= s->current_picture.mb_type[xy]; + cbp = s->cbp_table[xy]; + + s->use_intra_dc_vlc= s->qscale < s->intra_dc_threshold; + + if(s->current_picture.qscale_table[xy] != s->qscale){ + ff_set_qscale(s, s->current_picture.qscale_table[xy] ); + } + + if (s->pict_type == FF_P_TYPE || s->pict_type==FF_S_TYPE) { + int i; + for(i=0; i<4; i++){ + s->mv[0][i][0] = s->current_picture.motion_val[0][ s->block_index[i] ][0]; + s->mv[0][i][1] = s->current_picture.motion_val[0][ s->block_index[i] ][1]; + } + s->mb_intra = IS_INTRA(mb_type); + + if (IS_SKIP(mb_type)) { + /* skip mb */ + for(i=0;i<6;i++) + s->block_last_index[i] = -1; + s->mv_dir = MV_DIR_FORWARD; + s->mv_type = MV_TYPE_16X16; + if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE){ + s->mcsel=1; + s->mb_skipped = 0; + }else{ + s->mcsel=0; + s->mb_skipped = 1; + } + }else if(s->mb_intra){ + s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]); + }else if(!s->mb_intra){ +// s->mcsel= 0; //FIXME do we need to init that + + s->mv_dir = MV_DIR_FORWARD; + if (IS_8X8(mb_type)) { + s->mv_type = MV_TYPE_8X8; + } else { + s->mv_type = MV_TYPE_16X16; + } + } + } else { /* I-Frame */ + s->mb_intra = 1; + s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]); + } + + if (!IS_SKIP(mb_type)) { + int i; + s->dsp.clear_blocks(s->block[0]); + /* decode each block */ + for (i = 0; i < 6; i++) { + if(mpeg4_decode_block(s, block[i], i, cbp&32, s->mb_intra, s->rvlc) < 0){ + av_log(s->avctx, AV_LOG_ERROR, "texture corrupted at %d %d %d\n", s->mb_x, s->mb_y, s->mb_intra); + return -1; + } + cbp+=cbp; + } + } + + /* per-MB end of slice check */ + + if(--s->mb_num_left <= 0){ + if(mpeg4_is_resync(s)) + return SLICE_END; + else + return SLICE_NOEND; + }else{ + if(mpeg4_is_resync(s)){ + const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1; + if(s->cbp_table[xy+delta]) + return SLICE_END; + } + return SLICE_OK; + } +} + +static int mpeg4_decode_mb(MpegEncContext *s, + DCTELEM block[6][64]) +{ + int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; + int16_t *mot_val; + static int8_t quant_tab[4] = { -1, -2, 1, 2 }; + const int xy= s->mb_x + s->mb_y * s->mb_stride; + + assert(s->h263_pred); + + if (s->pict_type == FF_P_TYPE || s->pict_type==FF_S_TYPE) { + do{ + if (get_bits1(&s->gb)) { + /* skip mb */ + s->mb_intra = 0; + for(i=0;i<6;i++) + s->block_last_index[i] = -1; + s->mv_dir = MV_DIR_FORWARD; + s->mv_type = MV_TYPE_16X16; + if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE){ + s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_GMC | MB_TYPE_16x16 | MB_TYPE_L0; + s->mcsel=1; + s->mv[0][0][0]= get_amv(s, 0); + s->mv[0][0][1]= get_amv(s, 1); + + s->mb_skipped = 0; + }else{ + s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + s->mcsel=0; + s->mv[0][0][0] = 0; + s->mv[0][0][1] = 0; + s->mb_skipped = 1; + } + goto end; + } + cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); + if (cbpc < 0){ + av_log(s->avctx, AV_LOG_ERROR, "cbpc damaged at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + }while(cbpc == 20); + + s->dsp.clear_blocks(s->block[0]); + dquant = cbpc & 8; + s->mb_intra = ((cbpc & 4) != 0); + if (s->mb_intra) goto intra; + + if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0) + s->mcsel= get_bits1(&s->gb); + else s->mcsel= 0; + cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1) ^ 0x0F; + + cbp = (cbpc & 3) | (cbpy << 2); + if (dquant) { + ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]); + } + if((!s->progressive_sequence) && (cbp || (s->workaround_bugs&FF_BUG_XVID_ILACE))) + s->interlaced_dct= get_bits1(&s->gb); + + s->mv_dir = MV_DIR_FORWARD; + if ((cbpc & 16) == 0) { + if(s->mcsel){ + s->current_picture.mb_type[xy]= MB_TYPE_GMC | MB_TYPE_16x16 | MB_TYPE_L0; + /* 16x16 global motion prediction */ + s->mv_type = MV_TYPE_16X16; + mx= get_amv(s, 0); + my= get_amv(s, 1); + s->mv[0][0][0] = mx; + s->mv[0][0][1] = my; + }else if((!s->progressive_sequence) && get_bits1(&s->gb)){ + s->current_picture.mb_type[xy]= MB_TYPE_16x8 | MB_TYPE_L0 | MB_TYPE_INTERLACED; + /* 16x8 field motion prediction */ + s->mv_type= MV_TYPE_FIELD; + + s->field_select[0][0]= get_bits1(&s->gb); + s->field_select[0][1]= get_bits1(&s->gb); + + h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + + for(i=0; i<2; i++){ + mx = h263_decode_motion(s, pred_x, s->f_code); + if (mx >= 0xffff) + return -1; + + my = h263_decode_motion(s, pred_y/2, s->f_code); + if (my >= 0xffff) + return -1; + + s->mv[0][i][0] = mx; + s->mv[0][i][1] = my; + } + }else{ + s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0; + /* 16x16 motion prediction */ + s->mv_type = MV_TYPE_16X16; + h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + mx = h263_decode_motion(s, pred_x, s->f_code); + + if (mx >= 0xffff) + return -1; + + my = h263_decode_motion(s, pred_y, s->f_code); + + if (my >= 0xffff) + return -1; + s->mv[0][0][0] = mx; + s->mv[0][0][1] = my; + } + } else { + s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0; + s->mv_type = MV_TYPE_8X8; + for(i=0;i<4;i++) { + mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y); + mx = h263_decode_motion(s, pred_x, s->f_code); + if (mx >= 0xffff) + return -1; + + my = h263_decode_motion(s, pred_y, s->f_code); + if (my >= 0xffff) + return -1; + s->mv[0][i][0] = mx; + s->mv[0][i][1] = my; + mot_val[0] = mx; + mot_val[1] = my; + } + } + } else if(s->pict_type==FF_B_TYPE) { + int modb1; // first bit of modb + int modb2; // second bit of modb + int mb_type; + + s->mb_intra = 0; //B-frames never contain intra blocks + s->mcsel=0; // ... true gmc blocks + + if(s->mb_x==0){ + for(i=0; i<2; i++){ + s->last_mv[i][0][0]= + s->last_mv[i][0][1]= + s->last_mv[i][1][0]= + s->last_mv[i][1][1]= 0; + } + } + + /* if we skipped it in the future P Frame than skip it now too */ + s->mb_skipped= s->next_picture.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]; // Note, skiptab=0 if last was GMC + + if(s->mb_skipped){ + /* skip mb */ + for(i=0;i<6;i++) + s->block_last_index[i] = -1; + + s->mv_dir = MV_DIR_FORWARD; + s->mv_type = MV_TYPE_16X16; + s->mv[0][0][0] = 0; + s->mv[0][0][1] = 0; + s->mv[1][0][0] = 0; + s->mv[1][0][1] = 0; + s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + goto end; + } + + modb1= get_bits1(&s->gb); + if(modb1){ + mb_type= MB_TYPE_DIRECT2 | MB_TYPE_SKIP | MB_TYPE_L0L1; //like MB_TYPE_B_DIRECT but no vectors coded + cbp=0; + }else{ + modb2= get_bits1(&s->gb); + mb_type= get_vlc2(&s->gb, mb_type_b_vlc.table, MB_TYPE_B_VLC_BITS, 1); + if(mb_type<0){ + av_log(s->avctx, AV_LOG_ERROR, "illegal MB_type\n"); + return -1; + } + mb_type= mb_type_b_map[ mb_type ]; + if(modb2) cbp= 0; + else{ + s->dsp.clear_blocks(s->block[0]); + cbp= get_bits(&s->gb, 6); + } + + if ((!IS_DIRECT(mb_type)) && cbp) { + if(get_bits1(&s->gb)){ + ff_set_qscale(s, s->qscale + get_bits1(&s->gb)*4 - 2); + } + } + + if(!s->progressive_sequence){ + if(cbp) + s->interlaced_dct= get_bits1(&s->gb); + + if(!IS_DIRECT(mb_type) && get_bits1(&s->gb)){ + mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED; + mb_type &= ~MB_TYPE_16x16; + + if(USES_LIST(mb_type, 0)){ + s->field_select[0][0]= get_bits1(&s->gb); + s->field_select[0][1]= get_bits1(&s->gb); + } + if(USES_LIST(mb_type, 1)){ + s->field_select[1][0]= get_bits1(&s->gb); + s->field_select[1][1]= get_bits1(&s->gb); + } + } + } + + s->mv_dir = 0; + if((mb_type & (MB_TYPE_DIRECT2|MB_TYPE_INTERLACED)) == 0){ + s->mv_type= MV_TYPE_16X16; + + if(USES_LIST(mb_type, 0)){ + s->mv_dir = MV_DIR_FORWARD; + + mx = h263_decode_motion(s, s->last_mv[0][0][0], s->f_code); + my = h263_decode_motion(s, s->last_mv[0][0][1], s->f_code); + s->last_mv[0][1][0]= s->last_mv[0][0][0]= s->mv[0][0][0] = mx; + s->last_mv[0][1][1]= s->last_mv[0][0][1]= s->mv[0][0][1] = my; + } + + if(USES_LIST(mb_type, 1)){ + s->mv_dir |= MV_DIR_BACKWARD; + + mx = h263_decode_motion(s, s->last_mv[1][0][0], s->b_code); + my = h263_decode_motion(s, s->last_mv[1][0][1], s->b_code); + s->last_mv[1][1][0]= s->last_mv[1][0][0]= s->mv[1][0][0] = mx; + s->last_mv[1][1][1]= s->last_mv[1][0][1]= s->mv[1][0][1] = my; + } + }else if(!IS_DIRECT(mb_type)){ + s->mv_type= MV_TYPE_FIELD; + + if(USES_LIST(mb_type, 0)){ + s->mv_dir = MV_DIR_FORWARD; + + for(i=0; i<2; i++){ + mx = h263_decode_motion(s, s->last_mv[0][i][0] , s->f_code); + my = h263_decode_motion(s, s->last_mv[0][i][1]/2, s->f_code); + s->last_mv[0][i][0]= s->mv[0][i][0] = mx; + s->last_mv[0][i][1]= (s->mv[0][i][1] = my)*2; + } + } + + if(USES_LIST(mb_type, 1)){ + s->mv_dir |= MV_DIR_BACKWARD; + + for(i=0; i<2; i++){ + mx = h263_decode_motion(s, s->last_mv[1][i][0] , s->b_code); + my = h263_decode_motion(s, s->last_mv[1][i][1]/2, s->b_code); + s->last_mv[1][i][0]= s->mv[1][i][0] = mx; + s->last_mv[1][i][1]= (s->mv[1][i][1] = my)*2; + } + } + } + } + + if(IS_DIRECT(mb_type)){ + if(IS_SKIP(mb_type)) + mx=my=0; + else{ + mx = h263_decode_motion(s, 0, 1); + my = h263_decode_motion(s, 0, 1); + } + + s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT; + mb_type |= ff_mpeg4_set_direct_mv(s, mx, my); + } + s->current_picture.mb_type[xy]= mb_type; + } else { /* I-Frame */ + do{ + cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2); + if (cbpc < 0){ + av_log(s->avctx, AV_LOG_ERROR, "I cbpc damaged at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + }while(cbpc == 8); + + dquant = cbpc & 4; + s->mb_intra = 1; +intra: + s->ac_pred = get_bits1(&s->gb); + if(s->ac_pred) + s->current_picture.mb_type[xy]= MB_TYPE_INTRA | MB_TYPE_ACPRED; + else + s->current_picture.mb_type[xy]= MB_TYPE_INTRA; + + cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); + if(cbpy<0){ + av_log(s->avctx, AV_LOG_ERROR, "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + cbp = (cbpc & 3) | (cbpy << 2); + + s->use_intra_dc_vlc= s->qscale < s->intra_dc_threshold; + + if (dquant) { + ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]); + } + + if(!s->progressive_sequence) + s->interlaced_dct= get_bits1(&s->gb); + + s->dsp.clear_blocks(s->block[0]); + /* decode each block */ + for (i = 0; i < 6; i++) { + if (mpeg4_decode_block(s, block[i], i, cbp&32, 1, 0) < 0) + return -1; + cbp+=cbp; + } + goto end; + } + + /* decode each block */ + for (i = 0; i < 6; i++) { + if (mpeg4_decode_block(s, block[i], i, cbp&32, 0, 0) < 0) + return -1; + cbp+=cbp; + } +end: + + /* per-MB end of slice check */ + if(s->codec_id==CODEC_ID_MPEG4){ + if(mpeg4_is_resync(s)){ + const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1; + if(s->pict_type==FF_B_TYPE && s->next_picture.mbskip_table[xy + delta]) + return SLICE_OK; + return SLICE_END; + } + } + + return SLICE_OK; +} + + +static int mpeg4_decode_gop_header(MpegEncContext * s, GetBitContext *gb){ + int hours, minutes, seconds; + + hours= get_bits(gb, 5); + minutes= get_bits(gb, 6); + skip_bits1(gb); + seconds= get_bits(gb, 6); + + s->time_base= seconds + 60*(minutes + 60*hours); + + skip_bits1(gb); + skip_bits1(gb); + + return 0; +} + +static int decode_vol_header(MpegEncContext *s, GetBitContext *gb){ + int width, height, vo_ver_id; + + /* vol header */ + skip_bits(gb, 1); /* random access */ + s->vo_type= get_bits(gb, 8); + if (get_bits1(gb) != 0) { /* is_ol_id */ + vo_ver_id = get_bits(gb, 4); /* vo_ver_id */ + skip_bits(gb, 3); /* vo_priority */ + } else { + vo_ver_id = 1; + } + s->aspect_ratio_info= get_bits(gb, 4); + if(s->aspect_ratio_info == FF_ASPECT_EXTENDED){ + s->avctx->sample_aspect_ratio.num= get_bits(gb, 8); // par_width + s->avctx->sample_aspect_ratio.den= get_bits(gb, 8); // par_height + }else{ + s->avctx->sample_aspect_ratio= ff_h263_pixel_aspect[s->aspect_ratio_info]; + } + + if ((s->vol_control_parameters=get_bits1(gb))) { /* vol control parameter */ + int chroma_format= get_bits(gb, 2); + if(chroma_format!=CHROMA_420){ + av_log(s->avctx, AV_LOG_ERROR, "illegal chroma format\n"); + } + s->low_delay= get_bits1(gb); + if(get_bits1(gb)){ /* vbv parameters */ + get_bits(gb, 15); /* first_half_bitrate */ + skip_bits1(gb); /* marker */ + get_bits(gb, 15); /* latter_half_bitrate */ + skip_bits1(gb); /* marker */ + get_bits(gb, 15); /* first_half_vbv_buffer_size */ + skip_bits1(gb); /* marker */ + get_bits(gb, 3); /* latter_half_vbv_buffer_size */ + get_bits(gb, 11); /* first_half_vbv_occupancy */ + skip_bits1(gb); /* marker */ + get_bits(gb, 15); /* latter_half_vbv_occupancy */ + skip_bits1(gb); /* marker */ + } + }else{ + // set low delay flag only once the smartest? low delay detection won't be overriden + if(s->picture_number==0) + s->low_delay=0; + } + + s->shape = get_bits(gb, 2); /* vol shape */ + if(s->shape != RECT_SHAPE) av_log(s->avctx, AV_LOG_ERROR, "only rectangular vol supported\n"); + if(s->shape == GRAY_SHAPE && vo_ver_id != 1){ + av_log(s->avctx, AV_LOG_ERROR, "Gray shape not supported\n"); + skip_bits(gb, 4); //video_object_layer_shape_extension + } + + check_marker(gb, "before time_increment_resolution"); + + s->avctx->time_base.den = get_bits(gb, 16); + if(!s->avctx->time_base.den){ + av_log(s->avctx, AV_LOG_ERROR, "time_base.den==0\n"); + s->avctx->time_base.num = 0; + return -1; + } + + s->time_increment_bits = av_log2(s->avctx->time_base.den - 1) + 1; + if (s->time_increment_bits < 1) + s->time_increment_bits = 1; + + check_marker(gb, "before fixed_vop_rate"); + + if (get_bits1(gb) != 0) { /* fixed_vop_rate */ + s->avctx->time_base.num = get_bits(gb, s->time_increment_bits); + }else + s->avctx->time_base.num = 1; + + s->t_frame=0; + + if (s->shape != BIN_ONLY_SHAPE) { + if (s->shape == RECT_SHAPE) { + skip_bits1(gb); /* marker */ + width = get_bits(gb, 13); + skip_bits1(gb); /* marker */ + height = get_bits(gb, 13); + skip_bits1(gb); /* marker */ + if(width && height && !(s->width && s->codec_tag == AV_RL32("MP4S"))){ /* they should be non zero but who knows ... */ + s->width = width; + s->height = height; + } + } + + s->progressive_sequence= + s->progressive_frame= get_bits1(gb)^1; + s->interlaced_dct=0; + if(!get_bits1(gb) && (s->avctx->debug & FF_DEBUG_PICT_INFO)) + av_log(s->avctx, AV_LOG_INFO, "MPEG4 OBMC not supported (very likely buggy encoder)\n"); /* OBMC Disable */ + if (vo_ver_id == 1) { + s->vol_sprite_usage = get_bits1(gb); /* vol_sprite_usage */ + } else { + s->vol_sprite_usage = get_bits(gb, 2); /* vol_sprite_usage */ + } + if(s->vol_sprite_usage==STATIC_SPRITE) av_log(s->avctx, AV_LOG_ERROR, "Static Sprites not supported\n"); + if(s->vol_sprite_usage==STATIC_SPRITE || s->vol_sprite_usage==GMC_SPRITE){ + if(s->vol_sprite_usage==STATIC_SPRITE){ + s->sprite_width = get_bits(gb, 13); + skip_bits1(gb); /* marker */ + s->sprite_height= get_bits(gb, 13); + skip_bits1(gb); /* marker */ + s->sprite_left = get_bits(gb, 13); + skip_bits1(gb); /* marker */ + s->sprite_top = get_bits(gb, 13); + skip_bits1(gb); /* marker */ + } + s->num_sprite_warping_points= get_bits(gb, 6); + if(s->num_sprite_warping_points > 3){ + av_log(s->avctx, AV_LOG_ERROR, "%d sprite_warping_points\n", s->num_sprite_warping_points); + s->num_sprite_warping_points= 0; + return -1; + } + s->sprite_warping_accuracy = get_bits(gb, 2); + s->sprite_brightness_change= get_bits1(gb); + if(s->vol_sprite_usage==STATIC_SPRITE) + s->low_latency_sprite= get_bits1(gb); + } + // FIXME sadct disable bit if verid!=1 && shape not rect + + if (get_bits1(gb) == 1) { /* not_8_bit */ + s->quant_precision = get_bits(gb, 4); /* quant_precision */ + if(get_bits(gb, 4)!=8) av_log(s->avctx, AV_LOG_ERROR, "N-bit not supported\n"); /* bits_per_pixel */ + if(s->quant_precision!=5) av_log(s->avctx, AV_LOG_ERROR, "quant precision %d\n", s->quant_precision); + } else { + s->quant_precision = 5; + } + + // FIXME a bunch of grayscale shape things + + if((s->mpeg_quant=get_bits1(gb))){ /* vol_quant_type */ + int i, v; + + /* load default matrixes */ + for(i=0; i<64; i++){ + int j= s->dsp.idct_permutation[i]; + v= ff_mpeg4_default_intra_matrix[i]; + s->intra_matrix[j]= v; + s->chroma_intra_matrix[j]= v; + + v= ff_mpeg4_default_non_intra_matrix[i]; + s->inter_matrix[j]= v; + s->chroma_inter_matrix[j]= v; + } + + /* load custom intra matrix */ + if(get_bits1(gb)){ + int last=0; + for(i=0; i<64; i++){ + int j; + v= get_bits(gb, 8); + if(v==0) break; + + last= v; + j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ]; + s->intra_matrix[j]= v; + s->chroma_intra_matrix[j]= v; + } + + /* replicate last value */ + for(; i<64; i++){ + int j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ]; + s->intra_matrix[j]= last; + s->chroma_intra_matrix[j]= last; + } + } + + /* load custom non intra matrix */ + if(get_bits1(gb)){ + int last=0; + for(i=0; i<64; i++){ + int j; + v= get_bits(gb, 8); + if(v==0) break; + + last= v; + j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ]; + s->inter_matrix[j]= v; + s->chroma_inter_matrix[j]= v; + } + + /* replicate last value */ + for(; i<64; i++){ + int j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ]; + s->inter_matrix[j]= last; + s->chroma_inter_matrix[j]= last; + } + } + + // FIXME a bunch of grayscale shape things + } + + if(vo_ver_id != 1) + s->quarter_sample= get_bits1(gb); + else s->quarter_sample=0; + + if(!get_bits1(gb)){ + int pos= get_bits_count(gb); + int estimation_method= get_bits(gb, 2); + if(estimation_method<2){ + if(!get_bits1(gb)){ + s->cplx_estimation_trash_i += 8*get_bits1(gb); //opaque + s->cplx_estimation_trash_i += 8*get_bits1(gb); //transparent + s->cplx_estimation_trash_i += 8*get_bits1(gb); //intra_cae + s->cplx_estimation_trash_i += 8*get_bits1(gb); //inter_cae + s->cplx_estimation_trash_i += 8*get_bits1(gb); //no_update + s->cplx_estimation_trash_i += 8*get_bits1(gb); //upampling + } + if(!get_bits1(gb)){ + s->cplx_estimation_trash_i += 8*get_bits1(gb); //intra_blocks + s->cplx_estimation_trash_p += 8*get_bits1(gb); //inter_blocks + s->cplx_estimation_trash_p += 8*get_bits1(gb); //inter4v_blocks + s->cplx_estimation_trash_i += 8*get_bits1(gb); //not coded blocks + } + if(!check_marker(gb, "in complexity estimation part 1")){ + skip_bits_long(gb, pos - get_bits_count(gb)); + goto no_cplx_est; + } + if(!get_bits1(gb)){ + s->cplx_estimation_trash_i += 8*get_bits1(gb); //dct_coeffs + s->cplx_estimation_trash_i += 8*get_bits1(gb); //dct_lines + s->cplx_estimation_trash_i += 8*get_bits1(gb); //vlc_syms + s->cplx_estimation_trash_i += 4*get_bits1(gb); //vlc_bits + } + if(!get_bits1(gb)){ + s->cplx_estimation_trash_p += 8*get_bits1(gb); //apm + s->cplx_estimation_trash_p += 8*get_bits1(gb); //npm + s->cplx_estimation_trash_b += 8*get_bits1(gb); //interpolate_mc_q + s->cplx_estimation_trash_p += 8*get_bits1(gb); //forwback_mc_q + s->cplx_estimation_trash_p += 8*get_bits1(gb); //halfpel2 + s->cplx_estimation_trash_p += 8*get_bits1(gb); //halfpel4 + } + if(!check_marker(gb, "in complexity estimation part 2")){ + skip_bits_long(gb, pos - get_bits_count(gb)); + goto no_cplx_est; + } + if(estimation_method==1){ + s->cplx_estimation_trash_i += 8*get_bits1(gb); //sadct + s->cplx_estimation_trash_p += 8*get_bits1(gb); //qpel + } + }else + av_log(s->avctx, AV_LOG_ERROR, "Invalid Complexity estimation method %d\n", estimation_method); + }else{ +no_cplx_est: + s->cplx_estimation_trash_i= + s->cplx_estimation_trash_p= + s->cplx_estimation_trash_b= 0; + } + + s->resync_marker= !get_bits1(gb); /* resync_marker_disabled */ + + s->data_partitioning= get_bits1(gb); + if(s->data_partitioning){ + s->rvlc= get_bits1(gb); + } + + if(vo_ver_id != 1) { + s->new_pred= get_bits1(gb); + if(s->new_pred){ + av_log(s->avctx, AV_LOG_ERROR, "new pred not supported\n"); + skip_bits(gb, 2); /* requested upstream message type */ + skip_bits1(gb); /* newpred segment type */ + } + s->reduced_res_vop= get_bits1(gb); + if(s->reduced_res_vop) av_log(s->avctx, AV_LOG_ERROR, "reduced resolution VOP not supported\n"); + } + else{ + s->new_pred=0; + s->reduced_res_vop= 0; + } + + s->scalability= get_bits1(gb); + + if (s->scalability) { + GetBitContext bak= *gb; + int ref_layer_id; + int ref_layer_sampling_dir; + int h_sampling_factor_n; + int h_sampling_factor_m; + int v_sampling_factor_n; + int v_sampling_factor_m; + + s->hierachy_type= get_bits1(gb); + ref_layer_id= get_bits(gb, 4); + ref_layer_sampling_dir= get_bits1(gb); + h_sampling_factor_n= get_bits(gb, 5); + h_sampling_factor_m= get_bits(gb, 5); + v_sampling_factor_n= get_bits(gb, 5); + v_sampling_factor_m= get_bits(gb, 5); + s->enhancement_type= get_bits1(gb); + + if( h_sampling_factor_n==0 || h_sampling_factor_m==0 + || v_sampling_factor_n==0 || v_sampling_factor_m==0){ + /* illegal scalability header (VERY broken encoder), + * trying to workaround */ + s->scalability=0; + *gb= bak; + }else + av_log(s->avctx, AV_LOG_ERROR, "scalability not supported\n"); + + // bin shape stuff FIXME + } + } + return 0; +} + +/** + * decodes the user data stuff in the header. + * Also initializes divx/xvid/lavc_version/build. + */ +static int decode_user_data(MpegEncContext *s, GetBitContext *gb){ + char buf[256]; + int i; + int e; + int ver = 0, build = 0, ver2 = 0, ver3 = 0; + char last; + + for(i=0; i<255 && get_bits_count(gb) < gb->size_in_bits; i++){ + if(show_bits(gb, 23) == 0) break; + buf[i]= get_bits(gb, 8); + } + buf[i]=0; + + /* divx detection */ + e=sscanf(buf, "DivX%dBuild%d%c", &ver, &build, &last); + if(e<2) + e=sscanf(buf, "DivX%db%d%c", &ver, &build, &last); + if(e>=2){ + s->divx_version= ver; + s->divx_build= build; + s->divx_packed= e==3 && last=='p'; + if(s->divx_packed && !s->showed_packed_warning) { + av_log(s->avctx, AV_LOG_WARNING, "Invalid and inefficient vfw-avi packed B frames detected\n"); + s->showed_packed_warning=1; + } + } + + /* ffmpeg detection */ + e=sscanf(buf, "FFmpe%*[^b]b%d", &build)+3; + if(e!=4) + e=sscanf(buf, "FFmpeg v%d.%d.%d / libavcodec build: %d", &ver, &ver2, &ver3, &build); + if(e!=4){ + e=sscanf(buf, "Lavc%d.%d.%d", &ver, &ver2, &ver3)+1; + if (e>1) + build= (ver<<16) + (ver2<<8) + ver3; + } + if(e!=4){ + if(strcmp(buf, "ffmpeg")==0){ + s->lavc_build= 4600; + } + } + if(e==4){ + s->lavc_build= build; + } + + /* Xvid detection */ + e=sscanf(buf, "XviD%d", &build); + if(e==1){ + s->xvid_build= build; + } + + return 0; +} + +static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ + int time_incr, time_increment; + + s->pict_type = get_bits(gb, 2) + FF_I_TYPE; /* pict type: I = 0 , P = 1 */ + if(s->pict_type==FF_B_TYPE && s->low_delay && s->vol_control_parameters==0 && !(s->flags & CODEC_FLAG_LOW_DELAY)){ + av_log(s->avctx, AV_LOG_ERROR, "low_delay flag incorrectly, clearing it\n"); + s->low_delay=0; + } + + s->partitioned_frame= s->data_partitioning && s->pict_type!=FF_B_TYPE; + if(s->partitioned_frame) + s->decode_mb= mpeg4_decode_partitioned_mb; + else + s->decode_mb= mpeg4_decode_mb; + + time_incr=0; + while (get_bits1(gb) != 0) + time_incr++; + + check_marker(gb, "before time_increment"); + + if(s->time_increment_bits==0 || !(show_bits(gb, s->time_increment_bits+1)&1)){ + av_log(s->avctx, AV_LOG_ERROR, "hmm, seems the headers are not complete, trying to guess time_increment_bits\n"); + + for(s->time_increment_bits=1 ;s->time_increment_bits<16; s->time_increment_bits++){ + if ( s->pict_type == FF_P_TYPE + || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) { + if((show_bits(gb, s->time_increment_bits+6)&0x37) == 0x30) break; + }else + if((show_bits(gb, s->time_increment_bits+5)&0x1F) == 0x18) break; + } + + av_log(s->avctx, AV_LOG_ERROR, "my guess is %d bits ;)\n",s->time_increment_bits); + } + + if(IS_3IV1) time_increment= get_bits1(gb); //FIXME investigate further + else time_increment= get_bits(gb, s->time_increment_bits); + + if(s->pict_type!=FF_B_TYPE){ + s->last_time_base= s->time_base; + s->time_base+= time_incr; + s->time= s->time_base*s->avctx->time_base.den + time_increment; + if(s->workaround_bugs&FF_BUG_UMP4){ + if(s->time < s->last_non_b_time){ + /* header is not mpeg-4-compatible, broken encoder, + * trying to workaround */ + s->time_base++; + s->time+= s->avctx->time_base.den; + } + } + s->pp_time= s->time - s->last_non_b_time; + s->last_non_b_time= s->time; + }else{ + s->time= (s->last_time_base + time_incr)*s->avctx->time_base.den + time_increment; + s->pb_time= s->pp_time - (s->last_non_b_time - s->time); + if(s->pp_time <=s->pb_time || s->pp_time <= s->pp_time - s->pb_time || s->pp_time<=0){ + /* messed up order, maybe after seeking? skipping current b-frame */ + return FRAME_SKIPPED; + } + ff_mpeg4_init_direct_mv(s); + + if(s->t_frame==0) s->t_frame= s->pb_time; + if(s->t_frame==0) s->t_frame=1; // 1/0 protection + s->pp_field_time= ( ROUNDED_DIV(s->last_non_b_time, s->t_frame) + - ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2; + s->pb_field_time= ( ROUNDED_DIV(s->time, s->t_frame) + - ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2; + if(!s->progressive_sequence){ + if(s->pp_field_time <= s->pb_field_time || s->pb_field_time <= 1) + return FRAME_SKIPPED; + } + } + + if(s->avctx->time_base.num) + s->current_picture_ptr->pts= (s->time + s->avctx->time_base.num/2) / s->avctx->time_base.num; + else + s->current_picture_ptr->pts= AV_NOPTS_VALUE; + if(s->avctx->debug&FF_DEBUG_PTS) + av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %"PRId64"\n", s->current_picture_ptr->pts); + + check_marker(gb, "before vop_coded"); + + /* vop coded */ + if (get_bits1(gb) != 1){ + if(s->avctx->debug&FF_DEBUG_PICT_INFO) + av_log(s->avctx, AV_LOG_ERROR, "vop not coded\n"); + return FRAME_SKIPPED; + } + if (s->shape != BIN_ONLY_SHAPE && ( s->pict_type == FF_P_TYPE + || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE))) { + /* rounding type for motion estimation */ + s->no_rounding = get_bits1(gb); + } else { + s->no_rounding = 0; + } +//FIXME reduced res stuff + + if (s->shape != RECT_SHAPE) { + if (s->vol_sprite_usage != 1 || s->pict_type != FF_I_TYPE) { + int width, height, hor_spat_ref, ver_spat_ref; + + width = get_bits(gb, 13); + skip_bits1(gb); /* marker */ + height = get_bits(gb, 13); + skip_bits1(gb); /* marker */ + hor_spat_ref = get_bits(gb, 13); /* hor_spat_ref */ + skip_bits1(gb); /* marker */ + ver_spat_ref = get_bits(gb, 13); /* ver_spat_ref */ + } + skip_bits1(gb); /* change_CR_disable */ + + if (get_bits1(gb) != 0) { + skip_bits(gb, 8); /* constant_alpha_value */ + } + } +//FIXME complexity estimation stuff + + if (s->shape != BIN_ONLY_SHAPE) { + skip_bits_long(gb, s->cplx_estimation_trash_i); + if(s->pict_type != FF_I_TYPE) + skip_bits_long(gb, s->cplx_estimation_trash_p); + if(s->pict_type == FF_B_TYPE) + skip_bits_long(gb, s->cplx_estimation_trash_b); + + s->intra_dc_threshold= mpeg4_dc_threshold[ get_bits(gb, 3) ]; + if(!s->progressive_sequence){ + s->top_field_first= get_bits1(gb); + s->alternate_scan= get_bits1(gb); + }else + s->alternate_scan= 0; + } + + if(s->alternate_scan){ + ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , ff_alternate_vertical_scan); + ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , ff_alternate_vertical_scan); + ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, ff_alternate_vertical_scan); + ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan); + } else{ + ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , ff_zigzag_direct); + ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , ff_zigzag_direct); + ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan); + ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan); + } + + if(s->pict_type == FF_S_TYPE && (s->vol_sprite_usage==STATIC_SPRITE || s->vol_sprite_usage==GMC_SPRITE)){ + mpeg4_decode_sprite_trajectory(s, gb); + if(s->sprite_brightness_change) av_log(s->avctx, AV_LOG_ERROR, "sprite_brightness_change not supported\n"); + if(s->vol_sprite_usage==STATIC_SPRITE) av_log(s->avctx, AV_LOG_ERROR, "static sprite not supported\n"); + } + + if (s->shape != BIN_ONLY_SHAPE) { + s->chroma_qscale= s->qscale = get_bits(gb, s->quant_precision); + if(s->qscale==0){ + av_log(s->avctx, AV_LOG_ERROR, "Error, header damaged or not MPEG4 header (qscale=0)\n"); + return -1; // makes no sense to continue, as there is nothing left from the image then + } + + if (s->pict_type != FF_I_TYPE) { + s->f_code = get_bits(gb, 3); /* fcode_for */ + if(s->f_code==0){ + av_log(s->avctx, AV_LOG_ERROR, "Error, header damaged or not MPEG4 header (f_code=0)\n"); + return -1; // makes no sense to continue, as the MV decoding will break very quickly + } + }else + s->f_code=1; + + if (s->pict_type == FF_B_TYPE) { + s->b_code = get_bits(gb, 3); + }else + s->b_code=1; + + if(s->avctx->debug&FF_DEBUG_PICT_INFO){ + av_log(s->avctx, AV_LOG_DEBUG, "qp:%d fc:%d,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d rnd:%d vot:%d%s dc:%d ce:%d/%d/%d\n", + s->qscale, s->f_code, s->b_code, + s->pict_type == FF_I_TYPE ? "I" : (s->pict_type == FF_P_TYPE ? "P" : (s->pict_type == FF_B_TYPE ? "B" : "S")), + gb->size_in_bits,s->progressive_sequence, s->alternate_scan, s->top_field_first, + s->quarter_sample ? "q" : "h", s->data_partitioning, s->resync_marker, s->num_sprite_warping_points, + s->sprite_warping_accuracy, 1-s->no_rounding, s->vo_type, s->vol_control_parameters ? " VOLC" : " ", s->intra_dc_threshold, s->cplx_estimation_trash_i, s->cplx_estimation_trash_p, s->cplx_estimation_trash_b); + } + + if(!s->scalability){ + if (s->shape!=RECT_SHAPE && s->pict_type!=FF_I_TYPE) { + skip_bits1(gb); // vop shape coding type + } + }else{ + if(s->enhancement_type){ + int load_backward_shape= get_bits1(gb); + if(load_backward_shape){ + av_log(s->avctx, AV_LOG_ERROR, "load backward shape isn't supported\n"); + } + } + skip_bits(gb, 2); //ref_select_code + } + } + /* detect buggy encoders which don't set the low_delay flag (divx4/xvid/opendivx)*/ + // note we cannot detect divx5 without b-frames easily (although it's buggy too) + if(s->vo_type==0 && s->vol_control_parameters==0 && s->divx_version==-1 && s->picture_number==0){ + av_log(s->avctx, AV_LOG_ERROR, "looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag\n"); + s->low_delay=1; + } + + s->picture_number++; // better than pic number==0 always ;) + + s->y_dc_scale_table= ff_mpeg4_y_dc_scale_table; //FIXME add short header support + s->c_dc_scale_table= ff_mpeg4_c_dc_scale_table; + + if(s->workaround_bugs&FF_BUG_EDGE){ + s->h_edge_pos= s->width; + s->v_edge_pos= s->height; + } + return 0; +} + +/** + * decode mpeg4 headers + * @return <0 if no VOP found (or a damaged one) + * FRAME_SKIPPED if a not coded VOP is found + * 0 if a VOP is found + */ +int ff_mpeg4_decode_picture_header(MpegEncContext * s, GetBitContext *gb) +{ + int startcode, v; + + /* search next start code */ + align_get_bits(gb); + + if(s->codec_tag == AV_RL32("WV1F") && show_bits(gb, 24) == 0x575630){ + skip_bits(gb, 24); + if(get_bits(gb, 8) == 0xF0) + goto end; + } + + startcode = 0xff; + for(;;) { + if(get_bits_count(gb) >= gb->size_in_bits){ + if(gb->size_in_bits==8 && (s->divx_version>=0 || s->xvid_build>=0)){ + av_log(s->avctx, AV_LOG_ERROR, "frame skip %d\n", gb->size_in_bits); + return FRAME_SKIPPED; //divx bug + }else + return -1; //end of stream + } + + /* use the bits after the test */ + v = get_bits(gb, 8); + startcode = ((startcode << 8) | v) & 0xffffffff; + + if((startcode&0xFFFFFF00) != 0x100) + continue; //no startcode + + if(s->avctx->debug&FF_DEBUG_STARTCODE){ + av_log(s->avctx, AV_LOG_DEBUG, "startcode: %3X ", startcode); + if (startcode<=0x11F) av_log(s->avctx, AV_LOG_DEBUG, "Video Object Start"); + else if(startcode<=0x12F) av_log(s->avctx, AV_LOG_DEBUG, "Video Object Layer Start"); + else if(startcode<=0x13F) av_log(s->avctx, AV_LOG_DEBUG, "Reserved"); + else if(startcode<=0x15F) av_log(s->avctx, AV_LOG_DEBUG, "FGS bp start"); + else if(startcode<=0x1AF) av_log(s->avctx, AV_LOG_DEBUG, "Reserved"); + else if(startcode==0x1B0) av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Seq Start"); + else if(startcode==0x1B1) av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Seq End"); + else if(startcode==0x1B2) av_log(s->avctx, AV_LOG_DEBUG, "User Data"); + else if(startcode==0x1B3) av_log(s->avctx, AV_LOG_DEBUG, "Group of VOP start"); + else if(startcode==0x1B4) av_log(s->avctx, AV_LOG_DEBUG, "Video Session Error"); + else if(startcode==0x1B5) av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Start"); + else if(startcode==0x1B6) av_log(s->avctx, AV_LOG_DEBUG, "Video Object Plane start"); + else if(startcode==0x1B7) av_log(s->avctx, AV_LOG_DEBUG, "slice start"); + else if(startcode==0x1B8) av_log(s->avctx, AV_LOG_DEBUG, "extension start"); + else if(startcode==0x1B9) av_log(s->avctx, AV_LOG_DEBUG, "fgs start"); + else if(startcode==0x1BA) av_log(s->avctx, AV_LOG_DEBUG, "FBA Object start"); + else if(startcode==0x1BB) av_log(s->avctx, AV_LOG_DEBUG, "FBA Object Plane start"); + else if(startcode==0x1BC) av_log(s->avctx, AV_LOG_DEBUG, "Mesh Object start"); + else if(startcode==0x1BD) av_log(s->avctx, AV_LOG_DEBUG, "Mesh Object Plane start"); + else if(startcode==0x1BE) av_log(s->avctx, AV_LOG_DEBUG, "Still Texture Object start"); + else if(startcode==0x1BF) av_log(s->avctx, AV_LOG_DEBUG, "Texture Spatial Layer start"); + else if(startcode==0x1C0) av_log(s->avctx, AV_LOG_DEBUG, "Texture SNR Layer start"); + else if(startcode==0x1C1) av_log(s->avctx, AV_LOG_DEBUG, "Texture Tile start"); + else if(startcode==0x1C2) av_log(s->avctx, AV_LOG_DEBUG, "Texture Shape Layer start"); + else if(startcode==0x1C3) av_log(s->avctx, AV_LOG_DEBUG, "stuffing start"); + else if(startcode<=0x1C5) av_log(s->avctx, AV_LOG_DEBUG, "reserved"); + else if(startcode<=0x1FF) av_log(s->avctx, AV_LOG_DEBUG, "System start"); + av_log(s->avctx, AV_LOG_DEBUG, " at %d\n", get_bits_count(gb)); + } + + if(startcode >= 0x120 && startcode <= 0x12F){ + if(decode_vol_header(s, gb) < 0) + return -1; + } + else if(startcode == USER_DATA_STARTCODE){ + decode_user_data(s, gb); + } + else if(startcode == GOP_STARTCODE){ + mpeg4_decode_gop_header(s, gb); + } + else if(startcode == VOP_STARTCODE){ + break; + } + + align_get_bits(gb); + startcode = 0xff; + } +end: + if(s->flags& CODEC_FLAG_LOW_DELAY) + s->low_delay=1; + s->avctx->has_b_frames= !s->low_delay; + return decode_vop_header(s, gb); +} + +static av_cold int decode_init(AVCodecContext *avctx) +{ + MpegEncContext *s = avctx->priv_data; + int ret; + static int done = 0; + + s->divx_version= + s->divx_build= + s->xvid_build= + s->lavc_build= -1; + + if((ret=ff_h263_decode_init(avctx)) < 0) + return ret; + + if (!done) { + done = 1; + + init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]); + init_rl(&rvlc_rl_inter, ff_mpeg4_static_rl_table_store[1]); + init_rl(&rvlc_rl_intra, ff_mpeg4_static_rl_table_store[2]); + INIT_VLC_RL(ff_mpeg4_rl_intra, 554); + INIT_VLC_RL(rvlc_rl_inter, 1072); + INIT_VLC_RL(rvlc_rl_intra, 1072); + INIT_VLC_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */, + &ff_mpeg4_DCtab_lum[0][1], 2, 1, + &ff_mpeg4_DCtab_lum[0][0], 2, 1, 512); + INIT_VLC_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */, + &ff_mpeg4_DCtab_chrom[0][1], 2, 1, + &ff_mpeg4_DCtab_chrom[0][0], 2, 1, 512); + INIT_VLC_STATIC(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15, + &sprite_trajectory_tab[0][1], 4, 2, + &sprite_trajectory_tab[0][0], 4, 2, 128); + INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4, + &mb_type_b_tab[0][1], 2, 1, + &mb_type_b_tab[0][0], 2, 1, 16); + } + + s->h263_pred = 1; + s->low_delay = 0; //default, might be overriden in the vol header during header parsing + s->decode_mb= mpeg4_decode_mb; + s->time_increment_bits = 4; /* default value for broken headers */ + avctx->chroma_sample_location = AVCHROMA_LOC_LEFT; + + return 0; +} + +AVCodec ff_mpeg4_decoder = { + "mpeg4", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_MPEG4, + sizeof(MpegEncContext), + decode_init, + NULL, + ff_h263_decode_end, + ff_h263_decode_frame, + CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY, + .flush= ff_mpeg_flush, + .max_lowres= 3, + .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), + .pix_fmts= ff_hwaccel_pixfmt_list_420, +}; + + +#if CONFIG_MPEG4_VDPAU_DECODER +AVCodec ff_mpeg4_vdpau_decoder = { + "mpeg4_vdpau", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_MPEG4, + sizeof(MpegEncContext), + decode_init, + NULL, + ff_h263_decode_end, + ff_h263_decode_frame, + CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU, + .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 (VDPAU)"), + .pix_fmts= (const enum PixelFormat[]){PIX_FMT_VDPAU_MPEG4, PIX_FMT_NONE}, +}; +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4videoenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4videoenc.c new file mode 100644 index 00000000..2af898b9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpeg4videoenc.c @@ -0,0 +1,1352 @@ +/* + * MPEG4 encoder. + * Copyright (c) 2000,2001 Fabrice Bellard + * Copyright (c) 2002-2010 Michael Niedermayer + * + * 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 + */ + +#include "mpegvideo.h" +#include "h263.h" +#include "mpeg4video.h" + +//The uni_DCtab_* tables below contain unified bits+length tables to encode DC +//differences in mpeg4. Unified in the sense that the specification specifies +//this encoding in several steps. +static uint8_t uni_DCtab_lum_len[512]; +static uint8_t uni_DCtab_chrom_len[512]; +static uint16_t uni_DCtab_lum_bits[512]; +static uint16_t uni_DCtab_chrom_bits[512]; + +//unified encoding tables for run length encoding of coefficients +//unified in the sense that the specification specifies the encoding in several steps. +static uint32_t uni_mpeg4_intra_rl_bits[64*64*2*2]; +static uint8_t uni_mpeg4_intra_rl_len [64*64*2*2]; +static uint32_t uni_mpeg4_inter_rl_bits[64*64*2*2]; +static uint8_t uni_mpeg4_inter_rl_len [64*64*2*2]; +//#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128 + (run)*256 + (level)) +//#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128*64 + (run) + (level)*64) +#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128*64 + (run)*128 + (level)) + +/* mpeg4 +inter +max level: 24/6 +max run: 53/63 + +intra +max level: 53/16 +max run: 29/41 +*/ + + +/** + * Return the number of bits that encoding the 8x8 block in block would need. + * @param[in] block_last_index last index in scantable order that refers to a non zero element in block. + */ +static inline int get_block_rate(MpegEncContext * s, DCTELEM block[64], int block_last_index, uint8_t scantable[64]){ + int last=0; + int j; + int rate=0; + + for(j=1; j<=block_last_index; j++){ + const int index= scantable[j]; + int level= block[index]; + if(level){ + level+= 64; + if((level&(~127)) == 0){ + if(jintra_ac_vlc_length [UNI_AC_ENC_INDEX(j-last-1, level)]; + else rate+= s->intra_ac_vlc_last_length[UNI_AC_ENC_INDEX(j-last-1, level)]; + }else + rate += s->ac_esc_length; + + last= j; + } + } + + return rate; +} + + +/** + * Restore the ac coefficients in block that have been changed by decide_ac_pred(). + * This function also restores s->block_last_index. + * @param[in,out] block MB coefficients, these will be restored + * @param[in] dir ac prediction direction for each 8x8 block + * @param[out] st scantable for each 8x8 block + * @param[in] zigzag_last_index index refering to the last non zero coefficient in zigzag order + */ +static inline void restore_ac_coeffs(MpegEncContext * s, DCTELEM block[6][64], const int dir[6], uint8_t *st[6], const int zigzag_last_index[6]) +{ + int i, n; + memcpy(s->block_last_index, zigzag_last_index, sizeof(int)*6); + + for(n=0; n<6; n++){ + int16_t *ac_val = s->ac_val[0][0] + s->block_index[n] * 16; + + st[n]= s->intra_scantable.permutated; + if(dir[n]){ + /* top prediction */ + for(i=1; i<8; i++){ + block[n][s->dsp.idct_permutation[i ]] = ac_val[i+8]; + } + }else{ + /* left prediction */ + for(i=1; i<8; i++){ + block[n][s->dsp.idct_permutation[i<<3]]= ac_val[i ]; + } + } + } +} + +/** + * Return the optimal value (0 or 1) for the ac_pred element for the given MB in mpeg4. + * This function will also update s->block_last_index and s->ac_val. + * @param[in,out] block MB coefficients, these will be updated if 1 is returned + * @param[in] dir ac prediction direction for each 8x8 block + * @param[out] st scantable for each 8x8 block + * @param[out] zigzag_last_index index refering to the last non zero coefficient in zigzag order + */ +static inline int decide_ac_pred(MpegEncContext * s, DCTELEM block[6][64], const int dir[6], uint8_t *st[6], int zigzag_last_index[6]) +{ + int score= 0; + int i, n; + int8_t * const qscale_table= s->current_picture.qscale_table; + + memcpy(zigzag_last_index, s->block_last_index, sizeof(int)*6); + + for(n=0; n<6; n++){ + int16_t *ac_val, *ac_val1; + + score -= get_block_rate(s, block[n], s->block_last_index[n], s->intra_scantable.permutated); + + ac_val = s->ac_val[0][0] + s->block_index[n] * 16; + ac_val1= ac_val; + if(dir[n]){ + const int xy= s->mb_x + s->mb_y*s->mb_stride - s->mb_stride; + /* top prediction */ + ac_val-= s->block_wrap[n]*16; + if(s->mb_y==0 || s->qscale == qscale_table[xy] || n==2 || n==3){ + /* same qscale */ + for(i=1; i<8; i++){ + const int level= block[n][s->dsp.idct_permutation[i ]]; + block[n][s->dsp.idct_permutation[i ]] = level - ac_val[i+8]; + ac_val1[i ]= block[n][s->dsp.idct_permutation[i<<3]]; + ac_val1[i+8]= level; + } + }else{ + /* different qscale, we must rescale */ + for(i=1; i<8; i++){ + const int level= block[n][s->dsp.idct_permutation[i ]]; + block[n][s->dsp.idct_permutation[i ]] = level - ROUNDED_DIV(ac_val[i + 8]*qscale_table[xy], s->qscale); + ac_val1[i ]= block[n][s->dsp.idct_permutation[i<<3]]; + ac_val1[i+8]= level; + } + } + st[n]= s->intra_h_scantable.permutated; + }else{ + const int xy= s->mb_x-1 + s->mb_y*s->mb_stride; + /* left prediction */ + ac_val-= 16; + if(s->mb_x==0 || s->qscale == qscale_table[xy] || n==1 || n==3){ + /* same qscale */ + for(i=1; i<8; i++){ + const int level= block[n][s->dsp.idct_permutation[i<<3]]; + block[n][s->dsp.idct_permutation[i<<3]]= level - ac_val[i]; + ac_val1[i ]= level; + ac_val1[i+8]= block[n][s->dsp.idct_permutation[i ]]; + } + }else{ + /* different qscale, we must rescale */ + for(i=1; i<8; i++){ + const int level= block[n][s->dsp.idct_permutation[i<<3]]; + block[n][s->dsp.idct_permutation[i<<3]]= level - ROUNDED_DIV(ac_val[i]*qscale_table[xy], s->qscale); + ac_val1[i ]= level; + ac_val1[i+8]= block[n][s->dsp.idct_permutation[i ]]; + } + } + st[n]= s->intra_v_scantable.permutated; + } + + for(i=63; i>0; i--) //FIXME optimize + if(block[n][ st[n][i] ]) break; + s->block_last_index[n]= i; + + score += get_block_rate(s, block[n], s->block_last_index[n], st[n]); + } + + if(score < 0){ + return 1; + }else{ + restore_ac_coeffs(s, block, dir, st, zigzag_last_index); + return 0; + } +} + +/** + * modify mb_type & qscale so that encoding is acually possible in mpeg4 + */ +void ff_clean_mpeg4_qscales(MpegEncContext *s){ + int i; + int8_t * const qscale_table= s->current_picture.qscale_table; + + ff_clean_h263_qscales(s); + + if(s->pict_type== FF_B_TYPE){ + int odd=0; + /* ok, come on, this isn't funny anymore, there's more code for handling this mpeg4 mess than for the actual adaptive quantization */ + + for(i=0; imb_num; i++){ + int mb_xy= s->mb_index2xy[i]; + odd += qscale_table[mb_xy]&1; + } + + if(2*odd > s->mb_num) odd=1; + else odd=0; + + for(i=0; imb_num; i++){ + int mb_xy= s->mb_index2xy[i]; + if((qscale_table[mb_xy]&1) != odd) + qscale_table[mb_xy]++; + if(qscale_table[mb_xy] > 31) + qscale_table[mb_xy]= 31; + } + + for(i=1; imb_num; i++){ + int mb_xy= s->mb_index2xy[i]; + if(qscale_table[mb_xy] != qscale_table[s->mb_index2xy[i-1]] && (s->mb_type[mb_xy]&CANDIDATE_MB_TYPE_DIRECT)){ + s->mb_type[mb_xy]|= CANDIDATE_MB_TYPE_BIDIR; + } + } + } +} + + +/** + * encodes the dc value. + * @param n block index (0-3 are luma, 4-5 are chroma) + */ +static inline void mpeg4_encode_dc(PutBitContext * s, int level, int n) +{ +#if 1 + /* DC will overflow if level is outside the [-255,255] range. */ + level+=256; + if (n < 4) { + /* luminance */ + put_bits(s, uni_DCtab_lum_len[level], uni_DCtab_lum_bits[level]); + } else { + /* chrominance */ + put_bits(s, uni_DCtab_chrom_len[level], uni_DCtab_chrom_bits[level]); + } +#else + int size, v; + /* find number of bits */ + size = 0; + v = abs(level); + while (v) { + v >>= 1; + size++; + } + + if (n < 4) { + /* luminance */ + put_bits(&s->pb, ff_mpeg4_DCtab_lum[size][1], ff_mpeg4_DCtab_lum[size][0]); + } else { + /* chrominance */ + put_bits(&s->pb, ff_mpeg4_DCtab_chrom[size][1], ff_mpeg4_DCtab_chrom[size][0]); + } + + /* encode remaining bits */ + if (size > 0) { + if (level < 0) + level = (-level) ^ ((1 << size) - 1); + put_bits(&s->pb, size, level); + if (size > 8) + put_bits(&s->pb, 1, 1); + } +#endif +} + +static inline int mpeg4_get_dc_length(int level, int n){ + if (n < 4) { + return uni_DCtab_lum_len[level + 256]; + } else { + return uni_DCtab_chrom_len[level + 256]; + } +} + +/** + * encodes a 8x8 block + * @param n block index (0-3 are luma, 4-5 are chroma) + */ +static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n, int intra_dc, + uint8_t *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb) +{ + int i, last_non_zero; +#if 0 //variables for the outcommented version + int code, sign, last; +#endif + const RLTable *rl; + uint32_t *bits_tab; + uint8_t *len_tab; + const int last_index = s->block_last_index[n]; + + if (s->mb_intra) { //Note gcc (3.2.1 at least) will optimize this away + /* mpeg4 based DC predictor */ + mpeg4_encode_dc(dc_pb, intra_dc, n); + if(last_index<1) return; + i = 1; + rl = &ff_mpeg4_rl_intra; + bits_tab= uni_mpeg4_intra_rl_bits; + len_tab = uni_mpeg4_intra_rl_len; + } else { + if(last_index<0) return; + i = 0; + rl = &ff_h263_rl_inter; + bits_tab= uni_mpeg4_inter_rl_bits; + len_tab = uni_mpeg4_inter_rl_len; + } + + /* AC coefs */ + last_non_zero = i - 1; +#if 1 + for (; i < last_index; i++) { + int level = block[ scan_table[i] ]; + if (level) { + int run = i - last_non_zero - 1; + level+=64; + if((level&(~127)) == 0){ + const int index= UNI_MPEG4_ENC_INDEX(0, run, level); + put_bits(ac_pb, len_tab[index], bits_tab[index]); + }else{ //ESC3 + put_bits(ac_pb, 7+2+1+6+1+12+1, (3<<23)+(3<<21)+(0<<20)+(run<<14)+(1<<13)+(((level-64)&0xfff)<<1)+1); + } + last_non_zero = i; + } + } + /*if(i<=last_index)*/{ + int level = block[ scan_table[i] ]; + int run = i - last_non_zero - 1; + level+=64; + if((level&(~127)) == 0){ + const int index= UNI_MPEG4_ENC_INDEX(1, run, level); + put_bits(ac_pb, len_tab[index], bits_tab[index]); + }else{ //ESC3 + put_bits(ac_pb, 7+2+1+6+1+12+1, (3<<23)+(3<<21)+(1<<20)+(run<<14)+(1<<13)+(((level-64)&0xfff)<<1)+1); + } + } +#else + for (; i <= last_index; i++) { + const int slevel = block[ scan_table[i] ]; + if (slevel) { + int level; + int run = i - last_non_zero - 1; + last = (i == last_index); + sign = 0; + level = slevel; + if (level < 0) { + sign = 1; + level = -level; + } + code = get_rl_index(rl, last, run, level); + put_bits(ac_pb, rl->table_vlc[code][1], rl->table_vlc[code][0]); + if (code == rl->n) { + int level1, run1; + level1 = level - rl->max_level[last][run]; + if (level1 < 1) + goto esc2; + code = get_rl_index(rl, last, run, level1); + if (code == rl->n) { + esc2: + put_bits(ac_pb, 1, 1); + if (level > MAX_LEVEL) + goto esc3; + run1 = run - rl->max_run[last][level] - 1; + if (run1 < 0) + goto esc3; + code = get_rl_index(rl, last, run1, level); + if (code == rl->n) { + esc3: + /* third escape */ + put_bits(ac_pb, 1, 1); + put_bits(ac_pb, 1, last); + put_bits(ac_pb, 6, run); + put_bits(ac_pb, 1, 1); + put_sbits(ac_pb, 12, slevel); + put_bits(ac_pb, 1, 1); + } else { + /* second escape */ + put_bits(ac_pb, 1, 0); + put_bits(ac_pb, rl->table_vlc[code][1], rl->table_vlc[code][0]); + put_bits(ac_pb, 1, sign); + } + } else { + /* first escape */ + put_bits(ac_pb, 1, 0); + put_bits(ac_pb, rl->table_vlc[code][1], rl->table_vlc[code][0]); + put_bits(ac_pb, 1, sign); + } + } else { + put_bits(ac_pb, 1, sign); + } + last_non_zero = i; + } + } +#endif +} + +static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc, + uint8_t *scan_table) +{ + int i, last_non_zero; + uint8_t *len_tab; + const int last_index = s->block_last_index[n]; + int len=0; + + if (s->mb_intra) { //Note gcc (3.2.1 at least) will optimize this away + /* mpeg4 based DC predictor */ + len += mpeg4_get_dc_length(intra_dc, n); + if(last_index<1) return len; + i = 1; + len_tab = uni_mpeg4_intra_rl_len; + } else { + if(last_index<0) return 0; + i = 0; + len_tab = uni_mpeg4_inter_rl_len; + } + + /* AC coefs */ + last_non_zero = i - 1; + for (; i < last_index; i++) { + int level = block[ scan_table[i] ]; + if (level) { + int run = i - last_non_zero - 1; + level+=64; + if((level&(~127)) == 0){ + const int index= UNI_MPEG4_ENC_INDEX(0, run, level); + len += len_tab[index]; + }else{ //ESC3 + len += 7+2+1+6+1+12+1; + } + last_non_zero = i; + } + } + /*if(i<=last_index)*/{ + int level = block[ scan_table[i] ]; + int run = i - last_non_zero - 1; + level+=64; + if((level&(~127)) == 0){ + const int index= UNI_MPEG4_ENC_INDEX(1, run, level); + len += len_tab[index]; + }else{ //ESC3 + len += 7+2+1+6+1+12+1; + } + } + + return len; +} + +static inline void mpeg4_encode_blocks(MpegEncContext * s, DCTELEM block[6][64], int intra_dc[6], + uint8_t **scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb){ + int i; + + if(scan_table){ + if(s->flags2 & CODEC_FLAG2_NO_OUTPUT){ + for (i = 0; i < 6; i++) { + skip_put_bits(&s->pb, mpeg4_get_block_length(s, block[i], i, intra_dc[i], scan_table[i])); + } + }else{ + /* encode each block */ + for (i = 0; i < 6; i++) { + mpeg4_encode_block(s, block[i], i, intra_dc[i], scan_table[i], dc_pb, ac_pb); + } + } + }else{ + if(s->flags2 & CODEC_FLAG2_NO_OUTPUT){ + for (i = 0; i < 6; i++) { + skip_put_bits(&s->pb, mpeg4_get_block_length(s, block[i], i, 0, s->intra_scantable.permutated)); + } + }else{ + /* encode each block */ + for (i = 0; i < 6; i++) { + mpeg4_encode_block(s, block[i], i, 0, s->intra_scantable.permutated, dc_pb, ac_pb); + } + } + } +} + +//FIXME this is duplicated to h263.c +static const int dquant_code[5]= {1,0,9,2,3}; + +void mpeg4_encode_mb(MpegEncContext * s, + DCTELEM block[6][64], + int motion_x, int motion_y) +{ + int cbpc, cbpy, pred_x, pred_y; + PutBitContext * const pb2 = s->data_partitioning ? &s->pb2 : &s->pb; + PutBitContext * const tex_pb = s->data_partitioning && s->pict_type!=FF_B_TYPE ? &s->tex_pb : &s->pb; + PutBitContext * const dc_pb = s->data_partitioning && s->pict_type!=FF_I_TYPE ? &s->pb2 : &s->pb; + const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1) && !s->data_partitioning ? 1 : 0; + + if (!s->mb_intra) { + int i, cbp; + + if(s->pict_type==FF_B_TYPE){ + static const int mb_type_table[8]= {-1, 3, 2, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */ + int mb_type= mb_type_table[s->mv_dir]; + + if(s->mb_x==0){ + for(i=0; i<2; i++){ + s->last_mv[i][0][0]= + s->last_mv[i][0][1]= + s->last_mv[i][1][0]= + s->last_mv[i][1][1]= 0; + } + } + + assert(s->dquant>=-2 && s->dquant<=2); + assert((s->dquant&1)==0); + assert(mb_type>=0); + + /* nothing to do if this MB was skipped in the next P Frame */ + if(s->next_picture.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]){ //FIXME avoid DCT & ... + s->skip_count++; + s->mv[0][0][0]= + s->mv[0][0][1]= + s->mv[1][0][0]= + s->mv[1][0][1]= 0; + s->mv_dir= MV_DIR_FORWARD; //doesn't matter + s->qscale -= s->dquant; +// s->mb_skipped=1; + + return; + } + + cbp= get_b_cbp(s, block, motion_x, motion_y, mb_type); + + if ((cbp | motion_x | motion_y | mb_type) ==0) { + /* direct MB with MV={0,0} */ + assert(s->dquant==0); + + put_bits(&s->pb, 1, 1); /* mb not coded modb1=1 */ + + if(interleaved_stats){ + s->misc_bits++; + s->last_bits++; + } + s->skip_count++; + return; + } + + put_bits(&s->pb, 1, 0); /* mb coded modb1=0 */ + put_bits(&s->pb, 1, cbp ? 0 : 1); /* modb2 */ //FIXME merge + put_bits(&s->pb, mb_type+1, 1); // this table is so simple that we don't need it :) + if(cbp) put_bits(&s->pb, 6, cbp); + + if(cbp && mb_type){ + if(s->dquant) + put_bits(&s->pb, 2, (s->dquant>>2)+3); + else + put_bits(&s->pb, 1, 0); + }else + s->qscale -= s->dquant; + + if(!s->progressive_sequence){ + if(cbp) + put_bits(&s->pb, 1, s->interlaced_dct); + if(mb_type) // not direct mode + put_bits(&s->pb, 1, s->mv_type == MV_TYPE_FIELD); + } + + if(interleaved_stats){ + s->misc_bits+= get_bits_diff(s); + } + + if(mb_type == 0){ + assert(s->mv_dir & MV_DIRECT); + ff_h263_encode_motion_vector(s, motion_x, motion_y, 1); + s->b_count++; + s->f_count++; + }else{ + assert(mb_type > 0 && mb_type < 4); + if(s->mv_type != MV_TYPE_FIELD){ + if(s->mv_dir & MV_DIR_FORWARD){ + ff_h263_encode_motion_vector(s, s->mv[0][0][0] - s->last_mv[0][0][0], + s->mv[0][0][1] - s->last_mv[0][0][1], s->f_code); + s->last_mv[0][0][0]= s->last_mv[0][1][0]= s->mv[0][0][0]; + s->last_mv[0][0][1]= s->last_mv[0][1][1]= s->mv[0][0][1]; + s->f_count++; + } + if(s->mv_dir & MV_DIR_BACKWARD){ + ff_h263_encode_motion_vector(s, s->mv[1][0][0] - s->last_mv[1][0][0], + s->mv[1][0][1] - s->last_mv[1][0][1], s->b_code); + s->last_mv[1][0][0]= s->last_mv[1][1][0]= s->mv[1][0][0]; + s->last_mv[1][0][1]= s->last_mv[1][1][1]= s->mv[1][0][1]; + s->b_count++; + } + }else{ + if(s->mv_dir & MV_DIR_FORWARD){ + put_bits(&s->pb, 1, s->field_select[0][0]); + put_bits(&s->pb, 1, s->field_select[0][1]); + } + if(s->mv_dir & MV_DIR_BACKWARD){ + put_bits(&s->pb, 1, s->field_select[1][0]); + put_bits(&s->pb, 1, s->field_select[1][1]); + } + if(s->mv_dir & MV_DIR_FORWARD){ + for(i=0; i<2; i++){ + ff_h263_encode_motion_vector(s, s->mv[0][i][0] - s->last_mv[0][i][0] , + s->mv[0][i][1] - s->last_mv[0][i][1]/2, s->f_code); + s->last_mv[0][i][0]= s->mv[0][i][0]; + s->last_mv[0][i][1]= s->mv[0][i][1]*2; + } + s->f_count++; + } + if(s->mv_dir & MV_DIR_BACKWARD){ + for(i=0; i<2; i++){ + ff_h263_encode_motion_vector(s, s->mv[1][i][0] - s->last_mv[1][i][0] , + s->mv[1][i][1] - s->last_mv[1][i][1]/2, s->b_code); + s->last_mv[1][i][0]= s->mv[1][i][0]; + s->last_mv[1][i][1]= s->mv[1][i][1]*2; + } + s->b_count++; + } + } + } + + if(interleaved_stats){ + s->mv_bits+= get_bits_diff(s); + } + + mpeg4_encode_blocks(s, block, NULL, NULL, NULL, &s->pb); + + if(interleaved_stats){ + s->p_tex_bits+= get_bits_diff(s); + } + + }else{ /* s->pict_type==FF_B_TYPE */ + cbp= get_p_cbp(s, block, motion_x, motion_y); + + if ((cbp | motion_x | motion_y | s->dquant) == 0 && s->mv_type==MV_TYPE_16X16) { + /* check if the B frames can skip it too, as we must skip it if we skip here + why didn't they just compress the skip-mb bits instead of reusing them ?! */ + if(s->max_b_frames>0){ + int i; + int x,y, offset; + uint8_t *p_pic; + + x= s->mb_x*16; + y= s->mb_y*16; + if(x+16 > s->width) x= s->width-16; + if(y+16 > s->height) y= s->height-16; + + offset= x + y*s->linesize; + p_pic= s->new_picture.data[0] + offset; + + s->mb_skipped=1; + for(i=0; imax_b_frames; i++){ + uint8_t *b_pic; + int diff; + Picture *pic= s->reordered_input_picture[i+1]; + + if(pic==NULL || pic->pict_type!=FF_B_TYPE) break; + + b_pic= pic->data[0] + offset; + if(pic->type != FF_BUFFER_TYPE_SHARED) + b_pic+= INPLACE_OFFSET; + diff= s->dsp.sad[0](NULL, p_pic, b_pic, s->linesize, 16); + if(diff>s->qscale*70){ //FIXME check that 70 is optimal + s->mb_skipped=0; + break; + } + } + }else + s->mb_skipped=1; + + if(s->mb_skipped==1){ + /* skip macroblock */ + put_bits(&s->pb, 1, 1); + + if(interleaved_stats){ + s->misc_bits++; + s->last_bits++; + } + s->skip_count++; + + return; + } + } + + put_bits(&s->pb, 1, 0); /* mb coded */ + cbpc = cbp & 3; + cbpy = cbp >> 2; + cbpy ^= 0xf; + if(s->mv_type==MV_TYPE_16X16){ + if(s->dquant) cbpc+= 8; + put_bits(&s->pb, + ff_h263_inter_MCBPC_bits[cbpc], + ff_h263_inter_MCBPC_code[cbpc]); + + put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); + if(s->dquant) + put_bits(pb2, 2, dquant_code[s->dquant+2]); + + if(!s->progressive_sequence){ + if(cbp) + put_bits(pb2, 1, s->interlaced_dct); + put_bits(pb2, 1, 0); + } + + if(interleaved_stats){ + s->misc_bits+= get_bits_diff(s); + } + + /* motion vectors: 16x16 mode */ + h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + + ff_h263_encode_motion_vector(s, motion_x - pred_x, + motion_y - pred_y, s->f_code); + }else if(s->mv_type==MV_TYPE_FIELD){ + if(s->dquant) cbpc+= 8; + put_bits(&s->pb, + ff_h263_inter_MCBPC_bits[cbpc], + ff_h263_inter_MCBPC_code[cbpc]); + + put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); + if(s->dquant) + put_bits(pb2, 2, dquant_code[s->dquant+2]); + + assert(!s->progressive_sequence); + if(cbp) + put_bits(pb2, 1, s->interlaced_dct); + put_bits(pb2, 1, 1); + + if(interleaved_stats){ + s->misc_bits+= get_bits_diff(s); + } + + /* motion vectors: 16x8 interlaced mode */ + h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + pred_y /=2; + + put_bits(&s->pb, 1, s->field_select[0][0]); + put_bits(&s->pb, 1, s->field_select[0][1]); + + ff_h263_encode_motion_vector(s, s->mv[0][0][0] - pred_x, + s->mv[0][0][1] - pred_y, s->f_code); + ff_h263_encode_motion_vector(s, s->mv[0][1][0] - pred_x, + s->mv[0][1][1] - pred_y, s->f_code); + }else{ + assert(s->mv_type==MV_TYPE_8X8); + put_bits(&s->pb, + ff_h263_inter_MCBPC_bits[cbpc+16], + ff_h263_inter_MCBPC_code[cbpc+16]); + put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); + + if(!s->progressive_sequence){ + if(cbp) + put_bits(pb2, 1, s->interlaced_dct); + } + + if(interleaved_stats){ + s->misc_bits+= get_bits_diff(s); + } + + for(i=0; i<4; i++){ + /* motion vectors: 8x8 mode*/ + h263_pred_motion(s, i, 0, &pred_x, &pred_y); + + ff_h263_encode_motion_vector(s, s->current_picture.motion_val[0][ s->block_index[i] ][0] - pred_x, + s->current_picture.motion_val[0][ s->block_index[i] ][1] - pred_y, s->f_code); + } + } + + if(interleaved_stats){ + s->mv_bits+= get_bits_diff(s); + } + + mpeg4_encode_blocks(s, block, NULL, NULL, NULL, tex_pb); + + if(interleaved_stats){ + s->p_tex_bits+= get_bits_diff(s); + } + s->f_count++; + } + } else { + int cbp; + int dc_diff[6]; //dc values with the dc prediction subtracted + int dir[6]; //prediction direction + int zigzag_last_index[6]; + uint8_t *scan_table[6]; + int i; + + for(i=0; i<6; i++){ + dc_diff[i]= ff_mpeg4_pred_dc(s, i, block[i][0], &dir[i], 1); + } + + if(s->flags & CODEC_FLAG_AC_PRED){ + s->ac_pred= decide_ac_pred(s, block, dir, scan_table, zigzag_last_index); + }else{ + for(i=0; i<6; i++) + scan_table[i]= s->intra_scantable.permutated; + } + + /* compute cbp */ + cbp = 0; + for (i = 0; i < 6; i++) { + if (s->block_last_index[i] >= 1) + cbp |= 1 << (5 - i); + } + + cbpc = cbp & 3; + if (s->pict_type == FF_I_TYPE) { + if(s->dquant) cbpc+=4; + put_bits(&s->pb, + ff_h263_intra_MCBPC_bits[cbpc], + ff_h263_intra_MCBPC_code[cbpc]); + } else { + if(s->dquant) cbpc+=8; + put_bits(&s->pb, 1, 0); /* mb coded */ + put_bits(&s->pb, + ff_h263_inter_MCBPC_bits[cbpc + 4], + ff_h263_inter_MCBPC_code[cbpc + 4]); + } + put_bits(pb2, 1, s->ac_pred); + cbpy = cbp >> 2; + put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]); + if(s->dquant) + put_bits(dc_pb, 2, dquant_code[s->dquant+2]); + + if(!s->progressive_sequence){ + put_bits(dc_pb, 1, s->interlaced_dct); + } + + if(interleaved_stats){ + s->misc_bits+= get_bits_diff(s); + } + + mpeg4_encode_blocks(s, block, dc_diff, scan_table, dc_pb, tex_pb); + + if(interleaved_stats){ + s->i_tex_bits+= get_bits_diff(s); + } + s->i_count++; + + /* restore ac coeffs & last_index stuff if we messed them up with the prediction */ + if(s->ac_pred) + restore_ac_coeffs(s, block, dir, scan_table, zigzag_last_index); + } +} + +/** + * add mpeg4 stuffing bits (01...1) + */ +void ff_mpeg4_stuffing(PutBitContext * pbc) +{ + int length; + put_bits(pbc, 1, 0); + length= (-put_bits_count(pbc))&7; + if(length) put_bits(pbc, length, (1<pict_type==FF_B_TYPE){ + ff_mpeg4_init_direct_mv(s); + }else{ + s->last_time_base= s->time_base; + s->time_base= s->time/s->avctx->time_base.den; + } +} + +static void mpeg4_encode_gop_header(MpegEncContext * s){ + int hours, minutes, seconds; + int64_t time; + + put_bits(&s->pb, 16, 0); + put_bits(&s->pb, 16, GOP_STARTCODE); + + time= s->current_picture_ptr->pts; + if(s->reordered_input_picture[1]) + time= FFMIN(time, s->reordered_input_picture[1]->pts); + time= time*s->avctx->time_base.num; + + seconds= time/s->avctx->time_base.den; + minutes= seconds/60; seconds %= 60; + hours= minutes/60; minutes %= 60; + hours%=24; + + put_bits(&s->pb, 5, hours); + put_bits(&s->pb, 6, minutes); + put_bits(&s->pb, 1, 1); + put_bits(&s->pb, 6, seconds); + + put_bits(&s->pb, 1, !!(s->flags&CODEC_FLAG_CLOSED_GOP)); + put_bits(&s->pb, 1, 0); //broken link == NO + + s->last_time_base= time / s->avctx->time_base.den; + + ff_mpeg4_stuffing(&s->pb); +} + +static void mpeg4_encode_visual_object_header(MpegEncContext * s){ + int profile_and_level_indication; + int vo_ver_id; + + if(s->avctx->profile != FF_PROFILE_UNKNOWN){ + profile_and_level_indication = s->avctx->profile << 4; + }else if(s->max_b_frames || s->quarter_sample){ + profile_and_level_indication= 0xF0; // adv simple + }else{ + profile_and_level_indication= 0x00; // simple + } + + if(s->avctx->level != FF_LEVEL_UNKNOWN){ + profile_and_level_indication |= s->avctx->level; + }else{ + profile_and_level_indication |= 1; //level 1 + } + + if(profile_and_level_indication>>4 == 0xF){ + vo_ver_id= 5; + }else{ + vo_ver_id= 1; + } + + //FIXME levels + + put_bits(&s->pb, 16, 0); + put_bits(&s->pb, 16, VOS_STARTCODE); + + put_bits(&s->pb, 8, profile_and_level_indication); + + put_bits(&s->pb, 16, 0); + put_bits(&s->pb, 16, VISUAL_OBJ_STARTCODE); + + put_bits(&s->pb, 1, 1); + put_bits(&s->pb, 4, vo_ver_id); + put_bits(&s->pb, 3, 1); //priority + + put_bits(&s->pb, 4, 1); //visual obj type== video obj + + put_bits(&s->pb, 1, 0); //video signal type == no clue //FIXME + + ff_mpeg4_stuffing(&s->pb); +} + +static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_number) +{ + int vo_ver_id; + + if (!CONFIG_MPEG4_ENCODER) return; + + if(s->max_b_frames || s->quarter_sample){ + vo_ver_id= 5; + s->vo_type= ADV_SIMPLE_VO_TYPE; + }else{ + vo_ver_id= 1; + s->vo_type= SIMPLE_VO_TYPE; + } + + put_bits(&s->pb, 16, 0); + put_bits(&s->pb, 16, 0x100 + vo_number); /* video obj */ + put_bits(&s->pb, 16, 0); + put_bits(&s->pb, 16, 0x120 + vol_number); /* video obj layer */ + + put_bits(&s->pb, 1, 0); /* random access vol */ + put_bits(&s->pb, 8, s->vo_type); /* video obj type indication */ + if(s->workaround_bugs & FF_BUG_MS) { + put_bits(&s->pb, 1, 0); /* is obj layer id= no */ + } else { + put_bits(&s->pb, 1, 1); /* is obj layer id= yes */ + put_bits(&s->pb, 4, vo_ver_id); /* is obj layer ver id */ + put_bits(&s->pb, 3, 1); /* is obj layer priority */ + } + + s->aspect_ratio_info= ff_h263_aspect_to_info(s->avctx->sample_aspect_ratio); + + put_bits(&s->pb, 4, s->aspect_ratio_info);/* aspect ratio info */ + if (s->aspect_ratio_info == FF_ASPECT_EXTENDED){ + put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.num); + put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.den); + } + + if(s->workaround_bugs & FF_BUG_MS) { // + put_bits(&s->pb, 1, 0); /* vol control parameters= no @@@ */ + } else { + put_bits(&s->pb, 1, 1); /* vol control parameters= yes */ + put_bits(&s->pb, 2, 1); /* chroma format YUV 420/YV12 */ + put_bits(&s->pb, 1, s->low_delay); + put_bits(&s->pb, 1, 0); /* vbv parameters= no */ + } + + put_bits(&s->pb, 2, RECT_SHAPE); /* vol shape= rectangle */ + put_bits(&s->pb, 1, 1); /* marker bit */ + + put_bits(&s->pb, 16, s->avctx->time_base.den); + if (s->time_increment_bits < 1) + s->time_increment_bits = 1; + put_bits(&s->pb, 1, 1); /* marker bit */ + put_bits(&s->pb, 1, 0); /* fixed vop rate=no */ + put_bits(&s->pb, 1, 1); /* marker bit */ + put_bits(&s->pb, 13, s->width); /* vol width */ + put_bits(&s->pb, 1, 1); /* marker bit */ + put_bits(&s->pb, 13, s->height); /* vol height */ + put_bits(&s->pb, 1, 1); /* marker bit */ + put_bits(&s->pb, 1, s->progressive_sequence ? 0 : 1); + put_bits(&s->pb, 1, 1); /* obmc disable */ + if (vo_ver_id == 1) { + put_bits(&s->pb, 1, s->vol_sprite_usage); /* sprite enable */ + }else{ + put_bits(&s->pb, 2, s->vol_sprite_usage); /* sprite enable */ + } + + put_bits(&s->pb, 1, 0); /* not 8 bit == false */ + put_bits(&s->pb, 1, s->mpeg_quant); /* quant type= (0=h263 style)*/ + + if(s->mpeg_quant){ + ff_write_quant_matrix(&s->pb, s->avctx->intra_matrix); + ff_write_quant_matrix(&s->pb, s->avctx->inter_matrix); + } + + if (vo_ver_id != 1) + put_bits(&s->pb, 1, s->quarter_sample); + put_bits(&s->pb, 1, 1); /* complexity estimation disable */ + s->resync_marker= s->rtp_mode; + put_bits(&s->pb, 1, s->resync_marker ? 0 : 1);/* resync marker disable */ + put_bits(&s->pb, 1, s->data_partitioning ? 1 : 0); + if(s->data_partitioning){ + put_bits(&s->pb, 1, 0); /* no rvlc */ + } + + if (vo_ver_id != 1){ + put_bits(&s->pb, 1, 0); /* newpred */ + put_bits(&s->pb, 1, 0); /* reduced res vop */ + } + put_bits(&s->pb, 1, 0); /* scalability */ + + ff_mpeg4_stuffing(&s->pb); + + /* user data */ + if(!(s->flags & CODEC_FLAG_BITEXACT)){ + put_bits(&s->pb, 16, 0); + put_bits(&s->pb, 16, 0x1B2); /* user_data */ + ff_put_string(&s->pb, LIBAVCODEC_IDENT, 0); + } +} + +/* write mpeg4 VOP header */ +void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number) +{ + int time_incr; + int time_div, time_mod; + + if(s->pict_type==FF_I_TYPE){ + if(!(s->flags&CODEC_FLAG_GLOBAL_HEADER)){ + if(s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) //HACK, the reference sw is buggy + mpeg4_encode_visual_object_header(s); + if(s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT || picture_number==0) //HACK, the reference sw is buggy + mpeg4_encode_vol_header(s, 0, 0); + } + if(!(s->workaround_bugs & FF_BUG_MS)) + mpeg4_encode_gop_header(s); + } + + s->partitioned_frame= s->data_partitioning && s->pict_type!=FF_B_TYPE; + + put_bits(&s->pb, 16, 0); /* vop header */ + put_bits(&s->pb, 16, VOP_STARTCODE); /* vop header */ + put_bits(&s->pb, 2, s->pict_type - 1); /* pict type: I = 0 , P = 1 */ + + assert(s->time>=0); + time_div= s->time/s->avctx->time_base.den; + time_mod= s->time%s->avctx->time_base.den; + time_incr= time_div - s->last_time_base; + assert(time_incr >= 0); + while(time_incr--) + put_bits(&s->pb, 1, 1); + + put_bits(&s->pb, 1, 0); + + put_bits(&s->pb, 1, 1); /* marker */ + put_bits(&s->pb, s->time_increment_bits, time_mod); /* time increment */ + put_bits(&s->pb, 1, 1); /* marker */ + put_bits(&s->pb, 1, 1); /* vop coded */ + if ( s->pict_type == FF_P_TYPE + || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) { + put_bits(&s->pb, 1, s->no_rounding); /* rounding type */ + } + put_bits(&s->pb, 3, 0); /* intra dc VLC threshold */ + if(!s->progressive_sequence){ + put_bits(&s->pb, 1, s->current_picture_ptr->top_field_first); + put_bits(&s->pb, 1, s->alternate_scan); + } + //FIXME sprite stuff + + put_bits(&s->pb, 5, s->qscale); + + if (s->pict_type != FF_I_TYPE) + put_bits(&s->pb, 3, s->f_code); /* fcode_for */ + if (s->pict_type == FF_B_TYPE) + put_bits(&s->pb, 3, s->b_code); /* fcode_back */ +} + + +static void init_uni_dc_tab(void) +{ + int level, uni_code, uni_len; + + for(level=-256; level<256; level++){ + int size, v, l; + /* find number of bits */ + size = 0; + v = abs(level); + while (v) { + v >>= 1; + size++; + } + + if (level < 0) + l= (-level) ^ ((1 << size) - 1); + else + l= level; + + /* luminance */ + uni_code= ff_mpeg4_DCtab_lum[size][0]; + uni_len = ff_mpeg4_DCtab_lum[size][1]; + + if (size > 0) { + uni_code<<=size; uni_code|=l; + uni_len+=size; + if (size > 8){ + uni_code<<=1; uni_code|=1; + uni_len++; + } + } + uni_DCtab_lum_bits[level+256]= uni_code; + uni_DCtab_lum_len [level+256]= uni_len; + + /* chrominance */ + uni_code= ff_mpeg4_DCtab_chrom[size][0]; + uni_len = ff_mpeg4_DCtab_chrom[size][1]; + + if (size > 0) { + uni_code<<=size; uni_code|=l; + uni_len+=size; + if (size > 8){ + uni_code<<=1; uni_code|=1; + uni_len++; + } + } + uni_DCtab_chrom_bits[level+256]= uni_code; + uni_DCtab_chrom_len [level+256]= uni_len; + + } +} + +static void init_uni_mpeg4_rl_tab(RLTable *rl, uint32_t *bits_tab, uint8_t *len_tab){ + int slevel, run, last; + + assert(MAX_LEVEL >= 64); + assert(MAX_RUN >= 63); + + for(slevel=-64; slevel<64; slevel++){ + if(slevel==0) continue; + for(run=0; run<64; run++){ + for(last=0; last<=1; last++){ + const int index= UNI_MPEG4_ENC_INDEX(last, run, slevel+64); + int level= slevel < 0 ? -slevel : slevel; + int sign= slevel < 0 ? 1 : 0; + int bits, len, code; + int level1, run1; + + len_tab[index]= 100; + + /* ESC0 */ + code= get_rl_index(rl, last, run, level); + bits= rl->table_vlc[code][0]; + len= rl->table_vlc[code][1]; + bits=bits*2+sign; len++; + + if(code!=rl->n && len < len_tab[index]){ + bits_tab[index]= bits; + len_tab [index]= len; + } + /* ESC1 */ + bits= rl->table_vlc[rl->n][0]; + len= rl->table_vlc[rl->n][1]; + bits=bits*2; len++; //esc1 + level1= level - rl->max_level[last][run]; + if(level1>0){ + code= get_rl_index(rl, last, run, level1); + bits<<= rl->table_vlc[code][1]; + len += rl->table_vlc[code][1]; + bits += rl->table_vlc[code][0]; + bits=bits*2+sign; len++; + + if(code!=rl->n && len < len_tab[index]){ + bits_tab[index]= bits; + len_tab [index]= len; + } + } + /* ESC2 */ + bits= rl->table_vlc[rl->n][0]; + len= rl->table_vlc[rl->n][1]; + bits=bits*4+2; len+=2; //esc2 + run1 = run - rl->max_run[last][level] - 1; + if(run1>=0){ + code= get_rl_index(rl, last, run1, level); + bits<<= rl->table_vlc[code][1]; + len += rl->table_vlc[code][1]; + bits += rl->table_vlc[code][0]; + bits=bits*2+sign; len++; + + if(code!=rl->n && len < len_tab[index]){ + bits_tab[index]= bits; + len_tab [index]= len; + } + } + /* ESC3 */ + bits= rl->table_vlc[rl->n][0]; + len = rl->table_vlc[rl->n][1]; + bits=bits*4+3; len+=2; //esc3 + bits=bits*2+last; len++; + bits=bits*64+run; len+=6; + bits=bits*2+1; len++; //marker + bits=bits*4096+(slevel&0xfff); len+=12; + bits=bits*2+1; len++; //marker + + if(len < len_tab[index]){ + bits_tab[index]= bits; + len_tab [index]= len; + } + } + } + } +} + +static av_cold int encode_init(AVCodecContext *avctx) +{ + MpegEncContext *s = avctx->priv_data; + int ret; + static int done = 0; + + if((ret=MPV_encode_init(avctx)) < 0) + return ret; + + if (!done) { + done = 1; + + init_uni_dc_tab(); + + init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]); + + init_uni_mpeg4_rl_tab(&ff_mpeg4_rl_intra, uni_mpeg4_intra_rl_bits, uni_mpeg4_intra_rl_len); + init_uni_mpeg4_rl_tab(&ff_h263_rl_inter, uni_mpeg4_inter_rl_bits, uni_mpeg4_inter_rl_len); + } + + s->min_qcoeff= -2048; + s->max_qcoeff= 2047; + s->intra_ac_vlc_length = uni_mpeg4_intra_rl_len; + s->intra_ac_vlc_last_length= uni_mpeg4_intra_rl_len + 128*64; + s->inter_ac_vlc_length = uni_mpeg4_inter_rl_len; + s->inter_ac_vlc_last_length= uni_mpeg4_inter_rl_len + 128*64; + s->luma_dc_vlc_length= uni_DCtab_lum_len; + s->chroma_dc_vlc_length= uni_DCtab_chrom_len; + s->ac_esc_length= 7+2+1+6+1+12+1; + s->y_dc_scale_table= ff_mpeg4_y_dc_scale_table; + s->c_dc_scale_table= ff_mpeg4_c_dc_scale_table; + + if(s->flags & CODEC_FLAG_GLOBAL_HEADER){ + + s->avctx->extradata= av_malloc(1024); + init_put_bits(&s->pb, s->avctx->extradata, 1024); + + if(!(s->workaround_bugs & FF_BUG_MS)) + mpeg4_encode_visual_object_header(s); + mpeg4_encode_vol_header(s, 0, 0); + +// ff_mpeg4_stuffing(&s->pb); ? + flush_put_bits(&s->pb); + s->avctx->extradata_size= (put_bits_count(&s->pb)+7)>>3; + } + return 0; +} + +void ff_mpeg4_init_partitions(MpegEncContext *s) +{ + uint8_t *start= put_bits_ptr(&s->pb); + uint8_t *end= s->pb.buf_end; + int size= end - start; + int pb_size = (((intptr_t)start + size/3)&(~3)) - (intptr_t)start; + int tex_size= (size - 2*pb_size)&(~3); + + set_put_bits_buffer_size(&s->pb, pb_size); + init_put_bits(&s->tex_pb, start + pb_size , tex_size); + init_put_bits(&s->pb2 , start + pb_size + tex_size, pb_size); +} + +void ff_mpeg4_merge_partitions(MpegEncContext *s) +{ + const int pb2_len = put_bits_count(&s->pb2 ); + const int tex_pb_len= put_bits_count(&s->tex_pb); + const int bits= put_bits_count(&s->pb); + + if(s->pict_type==FF_I_TYPE){ + put_bits(&s->pb, 19, DC_MARKER); + s->misc_bits+=19 + pb2_len + bits - s->last_bits; + s->i_tex_bits+= tex_pb_len; + }else{ + put_bits(&s->pb, 17, MOTION_MARKER); + s->misc_bits+=17 + pb2_len; + s->mv_bits+= bits - s->last_bits; + s->p_tex_bits+= tex_pb_len; + } + + flush_put_bits(&s->pb2); + flush_put_bits(&s->tex_pb); + + set_put_bits_buffer_size(&s->pb, s->pb2.buf_end - s->pb.buf); + ff_copy_bits(&s->pb, s->pb2.buf , pb2_len); + ff_copy_bits(&s->pb, s->tex_pb.buf, tex_pb_len); + s->last_bits= put_bits_count(&s->pb); +} + + +void ff_mpeg4_encode_video_packet_header(MpegEncContext *s) +{ + int mb_num_bits= av_log2(s->mb_num - 1) + 1; + + put_bits(&s->pb, ff_mpeg4_get_video_packet_prefix_length(s), 0); + put_bits(&s->pb, 1, 1); + + put_bits(&s->pb, mb_num_bits, s->mb_x + s->mb_y*s->mb_width); + put_bits(&s->pb, s->quant_precision, s->qscale); + put_bits(&s->pb, 1, 0); /* no HEC */ +} + +AVCodec ff_mpeg4_encoder = { + "mpeg4", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_MPEG4, + sizeof(MpegEncContext), + encode_init, + MPV_encode_picture, + MPV_encode_end, + .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, + .capabilities= CODEC_CAP_DELAY, + .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio3.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio3.h new file mode 100644 index 00000000..c374a59a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio3.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2007 Michael Niedermayer + * + * 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 + */ + +/* layer 3 "granule" */ +typedef struct GranuleDef { + uint8_t scfsi; + int part2_3_length; + int big_values; + int global_gain; + int scalefac_compress; + uint8_t block_type; + uint8_t switch_point; + int table_select[3]; + int subblock_gain[3]; + uint8_t scalefac_scale; + uint8_t count1table_select; + int region_size[3]; /* number of huffman codes in each region */ + int preflag; + int short_start, long_end; /* long/short band indexes */ + uint8_t scale_factors[40]; + int32_t sb_hybrid[SBLIMIT * 18]; /* 576 samples */ +} GranuleDef; + +void ff_mp3_init(void); + +/** + * Compute huffman coded region sizes. + */ +void ff_init_short_region(MPADecodeContext *s, GranuleDef *g); + +/** + * Compute huffman coded region sizes. + */ +void ff_init_long_region(MPADecodeContext *s, GranuleDef *g, int ra1, int ra2); + +void ff_compute_band_indexes(MPADecodeContext *s, GranuleDef *g); diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.c new file mode 100644 index 00000000..0888e786 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.c @@ -0,0 +1,42 @@ +/* + * Generate a header file for hardcoded mpegaudiodec tables + * + * Copyright (c) 2009 Reimar DÃķffinger + * + * 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 + */ + +#include +#define CONFIG_HARDCODED_TABLES 0 +#include "mpegaudio_tablegen.h" +#include "tableprint.h" + +int main(void) +{ + mpegaudio_tableinit(); + + write_fileheader(); + + WRITE_ARRAY("static const", int8_t, table_4_3_exp); + WRITE_ARRAY("static const", uint32_t, table_4_3_value); + WRITE_ARRAY("static const", uint32_t, exp_table); + WRITE_ARRAY("static const", float, exp_table_float); + WRITE_2D_ARRAY("static const", uint32_t, expval_table); + WRITE_2D_ARRAY("static const", float, expval_table_float); + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.h new file mode 100644 index 00000000..6b5ff228 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudio_tablegen.h @@ -0,0 +1,69 @@ +/* + * Header file for hardcoded mpegaudiodec tables + * + * Copyright (c) 2009 Reimar DÃķffinger + * + * 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 + */ + +#ifndef MPEGAUDIO_TABLEGEN_H +#define MPEGAUDIO_TABLEGEN_H + +#include +#include + +#define TABLE_4_3_SIZE (8191 + 16)*4 +#if CONFIG_HARDCODED_TABLES +#define mpegaudio_tableinit() +#include "libavcodec/mpegaudio_tables.h" +#else +static int8_t table_4_3_exp[TABLE_4_3_SIZE]; +static uint32_t table_4_3_value[TABLE_4_3_SIZE]; +static uint32_t exp_table[512]; +static uint32_t expval_table[512][16]; +static float exp_table_float[512]; +static float expval_table_float[512][16]; + +static void mpegaudio_tableinit(void) +{ + int i, value, exponent; + for (i = 1; i < TABLE_4_3_SIZE; i++) { + double value = i / 4; + double f, fm; + int e, m; + f = value * cbrtf(value) * pow(2, (i & 3) * 0.25); + fm = frexp(f, &e); + m = (uint32_t)(fm * (1LL << 31) + 0.5); + e += FRAC_BITS - 31 + 5 - 100; + + /* normalized to FRAC_BITS */ + table_4_3_value[i] = m; + table_4_3_exp[i] = -e; + } + for (exponent = 0; exponent < 512; exponent++) { + for (value = 0; value < 16; value++) { + double f = (double)value * cbrtf(value) * pow(2, (exponent - 400) * 0.25 + FRAC_BITS + 5); + expval_table[exponent][value] = llrint(f); + expval_table_float[exponent][value] = f; + } + exp_table[exponent] = expval_table[exponent][1]; + exp_table_float[exponent] = expval_table_float[exponent][1]; + } +} +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* MPEGAUDIO_TABLEGEN_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudiodec_float.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudiodec_float.c new file mode 100644 index 00000000..758ef83e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/mpegaudiodec_float.c @@ -0,0 +1,168 @@ +/* + * Float MPEG Audio decoder + * Copyright (c) 2010 Michael Niedermayer + * + * 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 + */ + +#define CONFIG_FLOAT 1 +#include "mpegaudiodec.c" + +void ff_mpa_synth_filter_float(MPADecodeContext *s, float *synth_buf_ptr, + int *synth_buf_offset, + float *window, int *dither_state, + float *samples, int incr, + float sb_samples[SBLIMIT]) +{ + float *synth_buf; + int offset; + + offset = *synth_buf_offset; + synth_buf = synth_buf_ptr + offset; + + s->dct.dct32(synth_buf, sb_samples); + s->apply_window_mp3(synth_buf, window, dither_state, samples, incr); + + offset = (offset - 32) & 511; + *synth_buf_offset = offset; +} + +static void compute_antialias_float(MPADecodeContext *s, + GranuleDef *g) +{ + float *ptr; + int n, i; + + /* we antialias only "long" bands */ + if (g->block_type == 2) { + if (!g->switch_point) + return; + /* XXX: check this for 8000Hz case */ + n = 1; + } else { + n = SBLIMIT - 1; + } + + ptr = g->sb_hybrid + 18; + for(i = n;i > 0;i--) { + float tmp0, tmp1; + float *csa = &csa_table_float[0][0]; +#define FLOAT_AA(j)\ + tmp0= ptr[-1-j];\ + tmp1= ptr[ j];\ + ptr[-1-j] = tmp0 * csa[0+4*j] - tmp1 * csa[1+4*j];\ + ptr[ j] = tmp0 * csa[1+4*j] + tmp1 * csa[0+4*j]; + + FLOAT_AA(0) + FLOAT_AA(1) + FLOAT_AA(2) + FLOAT_AA(3) + FLOAT_AA(4) + FLOAT_AA(5) + FLOAT_AA(6) + FLOAT_AA(7) + + ptr += 18; + } +} + +static av_cold int decode_end(AVCodecContext * avctx) +{ + MPADecodeContext *s = avctx->priv_data; + ff_dct_end(&s->dct); + return 0; +} + +#if CONFIG_MP1FLOAT_DECODER +AVCodec ff_mp1float_decoder = +{ + "mp1float", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_MP1, + sizeof(MPADecodeContext), + decode_init, + NULL, + decode_end, + decode_frame, + CODEC_CAP_PARSE_ONLY, + .flush= flush, + .long_name= NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), +}; +#endif +#if CONFIG_MP2FLOAT_DECODER +AVCodec ff_mp2float_decoder = +{ + "mp2float", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_MP2, + sizeof(MPADecodeContext), + decode_init, + NULL, + decode_end, + decode_frame, + CODEC_CAP_PARSE_ONLY, + .flush= flush, + .long_name= NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), +}; +#endif +#if CONFIG_MP3FLOAT_DECODER +AVCodec ff_mp3float_decoder = +{ + "mp3float", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_MP3, + sizeof(MPADecodeContext), + decode_init, + NULL, + decode_end, + decode_frame, + CODEC_CAP_PARSE_ONLY, + .flush= flush, + .long_name= NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), +}; +#endif +#if CONFIG_MP3ADUFLOAT_DECODER +AVCodec ff_mp3adufloat_decoder = +{ + "mp3adufloat", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_MP3ADU, + sizeof(MPADecodeContext), + decode_init, + NULL, + decode_end, + decode_frame_adu, + CODEC_CAP_PARSE_ONLY, + .flush= flush, + .long_name= NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), +}; +#endif +#if CONFIG_MP3ON4FLOAT_DECODER +AVCodec ff_mp3on4float_decoder = +{ + "mp3on4float", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_MP3ON4, + sizeof(MP3On4DecodeContext), + decode_init_mp3on4, + NULL, + decode_close_mp3on4, + decode_frame_mp3on4, + .flush= flush, + .long_name= NULL_IF_CONFIG_SMALL("MP3onMP4"), +}; +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/msgsmdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/msgsmdec.c new file mode 100644 index 00000000..e759451c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/msgsmdec.c @@ -0,0 +1,37 @@ +/* + * gsm 06.10 decoder, Microsoft variant + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + */ + +#define ALT_BITSTREAM_READER_LE +#include "avcodec.h" +#include "msgsmdec.h" +#include "gsmdec_template.c" + +int ff_msgsm_decode_block(AVCodecContext *avctx, int16_t *samples, + const uint8_t *buf) +{ + int res; + GetBitContext gb; + init_get_bits(&gb, buf, GSM_MS_BLOCK_SIZE * 8); + res = gsm_decode_block(avctx, samples, &gb); + if (res < 0) + return res; + return gsm_decode_block(avctx, samples + GSM_FRAME_SIZE, &gb); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/msgsmdec.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/msgsmdec.h new file mode 100644 index 00000000..fbf819a4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/msgsmdec.h @@ -0,0 +1,30 @@ +/* + * gsm 06.10 decoder, Microsoft variant + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + */ + +#ifndef MSGSMDEC_H +#define MSGSMDEC_H + +#include "avcodec.h" + +int ff_msgsm_decode_block(AVCodecContext *avctx, int16_t *samples, + const uint8_t *buf); + +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pamenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pamenc.c new file mode 100644 index 00000000..9f50d7fb --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pamenc.c @@ -0,0 +1,120 @@ +/* + * PAM image format + * Copyright (c) 2002, 2003 Fabrice Bellard + * + * 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 + */ + +#include "avcodec.h" +#include "bytestream.h" +#include "pnm.h" + + +static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, + int buf_size, void *data) +{ + PNMContext *s = avctx->priv_data; + AVFrame *pict = data; + AVFrame * const p = (AVFrame*)&s->picture; + int i, h, w, n, linesize, depth, maxval; + const char *tuple_type; + uint8_t *ptr; + + if (buf_size < avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height) + 200) { + av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n"); + return -1; + } + + *p = *pict; + p->pict_type = FF_I_TYPE; + p->key_frame = 1; + + s->bytestream_start = + s->bytestream = outbuf; + s->bytestream_end = outbuf+buf_size; + + h = avctx->height; + w = avctx->width; + switch (avctx->pix_fmt) { + case PIX_FMT_MONOWHITE: + n = (w + 7) >> 3; + depth = 1; + maxval = 1; + tuple_type = "BLACKANDWHITE"; + break; + case PIX_FMT_GRAY8: + n = w; + depth = 1; + maxval = 255; + tuple_type = "GRAYSCALE"; + break; + case PIX_FMT_RGB24: + n = w * 3; + depth = 3; + maxval = 255; + tuple_type = "RGB"; + break; + case PIX_FMT_RGB32: + n = w * 4; + depth = 4; + maxval = 255; + tuple_type = "RGB_ALPHA"; + break; + default: + return -1; + } + snprintf(s->bytestream, s->bytestream_end - s->bytestream, + "P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\nTUPLETYPE %s\nENDHDR\n", + w, h, depth, maxval, tuple_type); + s->bytestream += strlen(s->bytestream); + + ptr = p->data[0]; + linesize = p->linesize[0]; + + if (avctx->pix_fmt == PIX_FMT_RGB32) { + int j; + unsigned int v; + + for (i = 0; i < h; i++) { + for (j = 0; j < w; j++) { + v = ((uint32_t *)ptr)[j]; + bytestream_put_be24(&s->bytestream, v); + *s->bytestream++ = v >> 24; + } + ptr += linesize; + } + } else { + for (i = 0; i < h; i++) { + memcpy(s->bytestream, ptr, n); + s->bytestream += n; + ptr += linesize; + } + } + return s->bytestream - s->bytestream_start; +} + + +AVCodec ff_pam_encoder = { + "pam", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_PAM, + sizeof(PNMContext), + ff_pnm_init, + pam_encode_frame, + .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE, PIX_FMT_NONE}, + .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcm_tablegen.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcm_tablegen.c new file mode 100644 index 00000000..b0fde936 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcm_tablegen.c @@ -0,0 +1,40 @@ +/* + * Generate a header file for hardcoded PCM tables + * + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + */ + +#include +#define CONFIG_HARDCODED_TABLES 0 +#include "pcm_tablegen.h" +#include "tableprint.h" + +int main(void) +{ + pcm_alaw_tableinit(); + pcm_ulaw_tableinit(); + + write_fileheader(); + + WRITE_ARRAY("static const", uint8_t, linear_to_alaw); + WRITE_ARRAY("static const", uint8_t, linear_to_ulaw); + + return 0; +} + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcm_tablegen.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcm_tablegen.h new file mode 100644 index 00000000..3d641b05 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pcm_tablegen.h @@ -0,0 +1,119 @@ +/* + * Header file for hardcoded PCM tables + * + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + */ + +#ifndef PCM_TABLEGEN_H +#define PCM_TABLEGEN_H + +#include +#include "libavutil/attributes.h" + +/* from g711.c by SUN microsystems (unrestricted use) */ + +#define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */ +#define QUANT_MASK (0xf) /* Quantization field mask. */ +#define NSEGS (8) /* Number of A-law segments. */ +#define SEG_SHIFT (4) /* Left shift for segment number. */ +#define SEG_MASK (0x70) /* Segment field mask. */ + +#define BIAS (0x84) /* Bias for linear code. */ + +/* + * alaw2linear() - Convert an A-law value to 16-bit linear PCM + * + */ +static av_cold int alaw2linear(unsigned char a_val) +{ + int t; + int seg; + + a_val ^= 0x55; + + t = a_val & QUANT_MASK; + seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT; + if(seg) t= (t + t + 1 + 32) << (seg + 2); + else t= (t + t + 1 ) << 3; + + return (a_val & SIGN_BIT) ? t : -t; +} + +static av_cold int ulaw2linear(unsigned char u_val) +{ + int t; + + /* Complement to obtain normal u-law value. */ + u_val = ~u_val; + + /* + * Extract and bias the quantization bits. Then + * shift up by the segment number and subtract out the bias. + */ + t = ((u_val & QUANT_MASK) << 3) + BIAS; + t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT; + + return (u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS); +} + +#if CONFIG_HARDCODED_TABLES +#define pcm_alaw_tableinit() +#define pcm_ulaw_tableinit() +#include "libavcodec/pcm_tables.h" +#else +/* 16384 entries per table */ +static uint8_t linear_to_alaw[16384]; +static uint8_t linear_to_ulaw[16384]; + +static av_cold void build_xlaw_table(uint8_t *linear_to_xlaw, + int (*xlaw2linear)(unsigned char), + int mask) +{ + int i, j, v, v1, v2; + + j = 0; + for(i=0;i<128;i++) { + if (i != 127) { + v1 = xlaw2linear(i ^ mask); + v2 = xlaw2linear((i + 1) ^ mask); + v = (v1 + v2 + 4) >> 3; + } else { + v = 8192; + } + for(;j 0) + linear_to_xlaw[8192 - j] = (i ^ (mask ^ 0x80)); + } + } + linear_to_xlaw[0] = linear_to_xlaw[1]; +} + +static void pcm_alaw_tableinit(void) +{ + build_xlaw_table(linear_to_alaw, alaw2linear, 0xd5); +} + +static void pcm_ulaw_tableinit(void) +{ + build_xlaw_table(linear_to_ulaw, ulaw2linear, 0xff); +} +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* PCM_TABLEGEN_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pictordec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pictordec.c new file mode 100644 index 00000000..59885ae3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pictordec.c @@ -0,0 +1,251 @@ +/* + * Pictor/PC Paint decoder + * Copyright (c) 2010 Peter Ross + * + * 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 + * Pictor/PC Paint decoder + */ + +#include "libavcore/imgutils.h" +#include "avcodec.h" +#include "bytestream.h" +#include "cga_data.h" + +typedef struct PicContext { + AVFrame frame; + int width, height; + int nb_planes; +} PicContext; + +static void picmemset_8bpp(PicContext *s, int value, int run, int *x, int *y) +{ + while (run > 0) { + uint8_t *d = s->frame.data[0] + *y * s->frame.linesize[0]; + if (*x + run >= s->width) { + int n = s->width - *x; + memset(d + *x, value, n); + run -= n; + *x = 0; + *y -= 1; + if (*y < 0) + break; + } else { + memset(d + *x, value, run); + *x += run; + break; + } + } +} + +static void picmemset(PicContext *s, int value, int run, int *x, int *y, int *plane, int bits_per_plane) +{ + uint8_t *d; + int shift = *plane * bits_per_plane; + int mask = ((1 << bits_per_plane) - 1) << shift; + value <<= shift; + + while (run > 0) { + int j; + for (j = 8-bits_per_plane; j >= 0; j -= bits_per_plane) { + d = s->frame.data[0] + *y * s->frame.linesize[0]; + d[*x] |= (value >> j) & mask; + *x += 1; + if (*x == s->width) { + *y -= 1; + *x = 0; + if (*y < 0) { + *y = s->height - 1; + *plane += 1; + value <<= bits_per_plane; + mask <<= bits_per_plane; + if (*plane >= s->nb_planes) + break; + } + } + } + run--; + } +} + +static const uint8_t cga_mode45_index[6][4] = { + [0] = { 0, 3, 5, 7 }, // mode4, palette#1, low intensity + [1] = { 0, 2, 4, 6 }, // mode4, palette#2, low intensity + [2] = { 0, 3, 4, 7 }, // mode5, low intensity + [3] = { 0, 11, 13, 15 }, // mode4, palette#1, high intensity + [4] = { 0, 10, 12, 14 }, // mode4, palette#2, high intensity + [5] = { 0, 11, 12, 15 }, // mode5, high intensity +}; + +static int decode_frame(AVCodecContext *avctx, + void *data, int *data_size, + AVPacket *avpkt) +{ + PicContext *s = avctx->priv_data; + int buf_size = avpkt->size; + const uint8_t *buf = avpkt->data; + const uint8_t *buf_end = avpkt->data + buf_size; + uint32_t *palette; + int bits_per_plane, bpp, etype, esize, npal; + int i, x, y, plane; + + if (buf_size < 11) + return AVERROR_INVALIDDATA; + + if (bytestream_get_le16(&buf) != 0x1234) + return AVERROR_INVALIDDATA; + s->width = bytestream_get_le16(&buf); + s->height = bytestream_get_le16(&buf); + buf += 4; + bits_per_plane = *buf & 0xF; + s->nb_planes = (*buf++ >> 4) + 1; + bpp = s->nb_planes ? bits_per_plane*s->nb_planes : bits_per_plane; + if (bits_per_plane > 8 || bpp < 1 || bpp > 32) { + av_log_ask_for_sample(s, "unsupported bit depth\n"); + return AVERROR_INVALIDDATA; + } + + if (*buf == 0xFF) { + buf += 2; + etype = bytestream_get_le16(&buf); + esize = bytestream_get_le16(&buf); + if (buf_end - buf < esize) + return AVERROR_INVALIDDATA; + } else { + etype = -1; + esize = 0; + } + + avctx->pix_fmt = PIX_FMT_PAL8; + + if (s->width != avctx->width && s->height != avctx->height) { + if (av_image_check_size(s->width, s->height, 0, avctx) < 0) + return -1; + avcodec_set_dimensions(avctx, s->width, s->height); + if (s->frame.data[0]) + avctx->release_buffer(avctx, &s->frame); + } + + if (avctx->get_buffer(avctx, &s->frame) < 0){ + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return -1; + } + memset(s->frame.data[0], 0, s->height * s->frame.linesize[0]); + s->frame.pict_type = FF_I_TYPE; + s->frame.palette_has_changed = 1; + + palette = (uint32_t*)s->frame.data[1]; + if (etype == 1 && esize > 1 && *buf < 6) { + int idx = *buf; + npal = 4; + for (i = 0; i < npal; i++) + palette[i] = ff_cga_palette[ cga_mode45_index[idx][i] ]; + } else if (etype == 2) { + npal = FFMIN(esize, 16); + for (i = 0; i < npal; i++) + palette[i] = ff_cga_palette[ FFMIN(buf[i], 16)]; + } else if (etype == 3) { + npal = FFMIN(esize, 16); + for (i = 0; i < npal; i++) + palette[i] = ff_ega_palette[ FFMIN(buf[i], 63)]; + } else if (etype == 4 || etype == 5) { + npal = FFMIN(esize / 3, 256); + for (i = 0; i < npal; i++) + palette[i] = AV_RB24(buf + i*3) << 2; + } else { + if (bpp == 1) { + npal = 2; + palette[0] = 0x000000; + palette[1] = 0xFFFFFF; + } else if (bpp == 2) { + npal = 4; + for (i = 0; i < npal; i++) + palette[i] = ff_cga_palette[ cga_mode45_index[0][i] ]; + } else { + npal = 16; + memcpy(palette, ff_cga_palette, npal * 4); + } + } + // fill remaining palette entries + memset(palette + npal, 0, AVPALETTE_SIZE - npal * 4); + buf += esize; + + + x = 0; + y = s->height - 1; + plane = 0; + if (bytestream_get_le16(&buf)) { + while (buf_end - buf >= 6) { + const uint8_t *buf_pend = buf + FFMIN(AV_RL16(buf), buf_end - buf); + //ignore uncompressed block size reported at buf[2] + int marker = buf[4]; + buf += 5; + + while (plane < s->nb_planes && buf_pend - buf >= 1) { + int run = 1; + int val = *buf++; + if (val == marker) { + run = *buf++; + if (run == 0) + run = bytestream_get_le16(&buf); + val = *buf++; + } + if (buf > buf_end) + break; + + if (bits_per_plane == 8) { + picmemset_8bpp(s, val, run, &x, &y); + if (y < 0) + break; + } else { + picmemset(s, val, run, &x, &y, &plane, bits_per_plane); + } + } + } + } else { + av_log_ask_for_sample(s, "uncompressed image\n"); + return buf_size; + } + + *data_size = sizeof(AVFrame); + *(AVFrame*)data = s->frame; + return buf_size; +} + +static av_cold int decode_end(AVCodecContext *avctx) +{ + PicContext *s = avctx->priv_data; + if (s->frame.data[0]) + avctx->release_buffer(avctx, &s->frame); + return 0; +} + +AVCodec ff_pictor_decoder = { + "pictor", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_PICTOR, + sizeof(PicContext), + NULL, + NULL, + decode_end, + decode_frame, + CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("Pictor/PC Paint"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnmdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnmdec.c new file mode 100644 index 00000000..39faab7b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/pnmdec.c @@ -0,0 +1,273 @@ +/* + * PNM image format + * Copyright (c) 2002, 2003 Fabrice Bellard + * + * 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 + */ + +#include "avcodec.h" +#include "bytestream.h" +#include "put_bits.h" +#include "pnm.h" + + +static int pnm_decode_frame(AVCodecContext *avctx, void *data, + int *data_size, AVPacket *avpkt) +{ + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + PNMContext * const s = avctx->priv_data; + AVFrame *picture = data; + AVFrame * const p = (AVFrame*)&s->picture; + int i, j, n, linesize, h, upgrade = 0; + unsigned char *ptr; + int components, sample_len; + + s->bytestream_start = + s->bytestream = buf; + s->bytestream_end = buf + buf_size; + + if (ff_pnm_decode_header(avctx, s) < 0) + return -1; + + if (p->data[0]) + avctx->release_buffer(avctx, p); + + p->reference = 0; + if (avctx->get_buffer(avctx, p) < 0) { + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return -1; + } + p->pict_type = FF_I_TYPE; + p->key_frame = 1; + + switch (avctx->pix_fmt) { + default: + return -1; + case PIX_FMT_RGB48BE: + n = avctx->width * 6; + components=3; + sample_len=16; + goto do_read; + case PIX_FMT_RGB24: + n = avctx->width * 3; + components=3; + sample_len=8; + goto do_read; + case PIX_FMT_GRAY8: + n = avctx->width; + components=1; + sample_len=8; + if (s->maxval < 255) + upgrade = 1; + goto do_read; + case PIX_FMT_GRAY16BE: + case PIX_FMT_GRAY16LE: + n = avctx->width * 2; + components=1; + sample_len=16; + if (s->maxval < 65535) + upgrade = 2; + goto do_read; + case PIX_FMT_MONOWHITE: + case PIX_FMT_MONOBLACK: + n = (avctx->width + 7) >> 3; + components=1; + sample_len=1; + do_read: + ptr = p->data[0]; + linesize = p->linesize[0]; + if (s->bytestream + n * avctx->height > s->bytestream_end) + return -1; + if(s->type < 4){ + for (i=0; iheight; i++) { + PutBitContext pb; + init_put_bits(&pb, ptr, linesize); + for(j=0; jwidth * components; j++){ + unsigned int c=0; + int v=0; + while(s->bytestream < s->bytestream_end && (*s->bytestream < '0' || *s->bytestream > '9' )) + s->bytestream++; + if(s->bytestream >= s->bytestream_end) + return -1; + do{ + v= 10*v + c; + c= (*s->bytestream++) - '0'; + }while(c <= 9); + put_bits(&pb, sample_len, (((1<maxval>>1))/s->maxval); + } + flush_put_bits(&pb); + ptr+= linesize; + } + }else{ + for (i = 0; i < avctx->height; i++) { + if (!upgrade) + memcpy(ptr, s->bytestream, n); + else if (upgrade == 1) { + unsigned int j, f = (255 * 128 + s->maxval / 2) / s->maxval; + for (j = 0; j < n; j++) + ptr[j] = (s->bytestream[j] * f + 64) >> 7; + } else if (upgrade == 2) { + unsigned int j, v, f = (65535 * 32768 + s->maxval / 2) / s->maxval; + for (j = 0; j < n / 2; j++) { + v = av_be2ne16(((uint16_t *)s->bytestream)[j]); + ((uint16_t *)ptr)[j] = (v * f + 16384) >> 15; + } + } + s->bytestream += n; + ptr += linesize; + } + } + break; + case PIX_FMT_YUV420P: + { + unsigned char *ptr1, *ptr2; + + n = avctx->width; + ptr = p->data[0]; + linesize = p->linesize[0]; + if (s->bytestream + n * avctx->height * 3 / 2 > s->bytestream_end) + return -1; + for (i = 0; i < avctx->height; i++) { + memcpy(ptr, s->bytestream, n); + s->bytestream += n; + ptr += linesize; + } + ptr1 = p->data[1]; + ptr2 = p->data[2]; + n >>= 1; + h = avctx->height >> 1; + for (i = 0; i < h; i++) { + memcpy(ptr1, s->bytestream, n); + s->bytestream += n; + memcpy(ptr2, s->bytestream, n); + s->bytestream += n; + ptr1 += p->linesize[1]; + ptr2 += p->linesize[2]; + } + } + break; + case PIX_FMT_RGB32: + ptr = p->data[0]; + linesize = p->linesize[0]; + if (s->bytestream + avctx->width * avctx->height * 4 > s->bytestream_end) + return -1; + for (i = 0; i < avctx->height; i++) { + int j, r, g, b, a; + + for (j = 0; j < avctx->width; j++) { + r = *s->bytestream++; + g = *s->bytestream++; + b = *s->bytestream++; + a = *s->bytestream++; + ((uint32_t *)ptr)[j] = (a << 24) | (r << 16) | (g << 8) | b; + } + ptr += linesize; + } + break; + } + *picture = *(AVFrame*)&s->picture; + *data_size = sizeof(AVPicture); + + return s->bytestream - s->bytestream_start; +} + + +#if CONFIG_PGM_DECODER +AVCodec ff_pgm_decoder = { + "pgm", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_PGM, + sizeof(PNMContext), + ff_pnm_init, + NULL, + ff_pnm_end, + pnm_decode_frame, + CODEC_CAP_DR1, + .pix_fmts = (const enum PixelFormat[]){PIX_FMT_GRAY8, PIX_FMT_GRAY16BE, PIX_FMT_NONE}, + .max_lowres = 5, + .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"), +}; +#endif + +#if CONFIG_PGMYUV_DECODER +AVCodec ff_pgmyuv_decoder = { + "pgmyuv", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_PGMYUV, + sizeof(PNMContext), + ff_pnm_init, + NULL, + ff_pnm_end, + pnm_decode_frame, + CODEC_CAP_DR1, + .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, + .max_lowres = 5, + .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"), +}; +#endif + +#if CONFIG_PPM_DECODER +AVCodec ff_ppm_decoder = { + "ppm", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_PPM, + sizeof(PNMContext), + ff_pnm_init, + NULL, + ff_pnm_end, + pnm_decode_frame, + CODEC_CAP_DR1, + .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB48BE, PIX_FMT_NONE}, + .max_lowres = 5, + .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"), +}; +#endif + +#if CONFIG_PBM_DECODER +AVCodec ff_pbm_decoder = { + "pbm", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_PBM, + sizeof(PNMContext), + ff_pnm_init, + NULL, + ff_pnm_end, + pnm_decode_frame, + CODEC_CAP_DR1, + .pix_fmts = (const enum PixelFormat[]){PIX_FMT_MONOWHITE, PIX_FMT_NONE}, + .max_lowres = 5, + .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"), +}; +#endif + +#if CONFIG_PAM_DECODER +AVCodec ff_pam_decoder = { + "pam", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_PAM, + sizeof(PNMContext), + ff_pnm_init, + NULL, + ff_pnm_end, + pnm_decode_frame, + CODEC_CAP_DR1, + .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE, PIX_FMT_NONE}, + .max_lowres = 5, + .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"), +}; +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/Makefile new file mode 100644 index 00000000..35ea0c38 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/Makefile @@ -0,0 +1,29 @@ +OBJS += ppc/dsputil_ppc.o \ + +ALTIVEC-OBJS-$(CONFIG_H264DSP) += ppc/h264_altivec.o +ALTIVEC-OBJS-$(CONFIG_VC1_DECODER) += ppc/vc1dsp_altivec.o +ALTIVEC-OBJS-$(CONFIG_VP3_DECODER) += ppc/vp3dsp_altivec.o +ALTIVEC-OBJS-$(CONFIG_VP5_DECODER) += ppc/vp3dsp_altivec.o +ALTIVEC-OBJS-$(CONFIG_VP6_DECODER) += ppc/vp3dsp_altivec.o +ALTIVEC-OBJS-$(CONFIG_VP8_DECODER) += ppc/vp8dsp_altivec.o + +ALTIVEC-OBJS-$(CONFIG_MP1FLOAT_DECODER) += ppc/mpegaudiodec_altivec.o +ALTIVEC-OBJS-$(CONFIG_MP2FLOAT_DECODER) += ppc/mpegaudiodec_altivec.o +ALTIVEC-OBJS-$(CONFIG_MP3FLOAT_DECODER) += ppc/mpegaudiodec_altivec.o +ALTIVEC-OBJS-$(CONFIG_MP3ON4FLOAT_DECODER) += ppc/mpegaudiodec_altivec.o +ALTIVEC-OBJS-$(CONFIG_MP3ADUFLOAT_DECODER) += ppc/mpegaudiodec_altivec.o + +FFT-OBJS-$(HAVE_GNU_AS) += ppc/fft_altivec_s.o \ + +ALTIVEC-OBJS-$(CONFIG_FFT) += ppc/fft_altivec.o \ + $(FFT-OBJS-yes) + +OBJS-$(HAVE_ALTIVEC) += ppc/dsputil_altivec.o \ + ppc/fdct_altivec.o \ + ppc/float_altivec.o \ + ppc/fmtconvert_altivec.o \ + ppc/gmc_altivec.o \ + ppc/idct_altivec.o \ + ppc/int_altivec.o \ + ppc/mpegvideo_altivec.o \ + $(ALTIVEC-OBJS-yes) diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/asm.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/asm.S new file mode 100644 index 00000000..e372d53c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/asm.S @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2009 Loren Merritt + * + * 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 + */ + +#include "config.h" + +#define GLUE(a, b) a ## b +#define JOIN(a, b) GLUE(a, b) +#define X(s) JOIN(EXTERN_ASM, s) + +#if ARCH_PPC64 + +#define PTR .quad +#define lp ld +#define lpx ldx +#define stp std +#define stpu stdu +#define PS 8 +#define L(s) JOIN(., s) + +.macro extfunc name + .global X(\name) + .section .opd, "aw" +X(\name): + .quad L(\name), .TOC.@tocbase, 0 + .previous + .type X(\name), STT_FUNC +L(\name): +.endm + +.macro movrel rd, sym + ld \rd, \sym@got(r2) +.endm + +#else /* ARCH_PPC64 */ + +#define PTR .int +#define lp lwz +#define lpx lwzx +#define stp stw +#define stpu stwu +#define PS 4 +#define L(s) s + +.macro extfunc name + .global X(\name) + .type X(\name), STT_FUNC +X(\name): +\name: +.endm + +.macro movrel rd, sym +#if CONFIG_PIC + lwz \rd, \sym@got(r2) +#else + lis \rd, \sym@ha + la \rd, \sym@l(\rd) +#endif +.endm + +#endif /* ARCH_PPC64 */ + +#if HAVE_IBM_ASM + +.macro DEFINE_REG n + .equiv r\n, \n + .equiv f\n, \n + .equiv v\n, \n +.endm + +DEFINE_REG 0 +DEFINE_REG 1 +DEFINE_REG 2 +DEFINE_REG 3 +DEFINE_REG 4 +DEFINE_REG 5 +DEFINE_REG 6 +DEFINE_REG 7 +DEFINE_REG 8 +DEFINE_REG 9 +DEFINE_REG 10 +DEFINE_REG 11 +DEFINE_REG 12 +DEFINE_REG 13 +DEFINE_REG 14 +DEFINE_REG 15 +DEFINE_REG 16 +DEFINE_REG 17 +DEFINE_REG 18 +DEFINE_REG 19 +DEFINE_REG 20 +DEFINE_REG 21 +DEFINE_REG 22 +DEFINE_REG 23 +DEFINE_REG 24 +DEFINE_REG 25 +DEFINE_REG 26 +DEFINE_REG 27 +DEFINE_REG 28 +DEFINE_REG 29 +DEFINE_REG 30 +DEFINE_REG 31 + +#endif /* HAVE_IBM_ASM */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/fft_altivec_s.S b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/fft_altivec_s.S new file mode 100644 index 00000000..5d3c5406 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/fft_altivec_s.S @@ -0,0 +1,448 @@ +/* + * FFT transform with Altivec optimizations + * Copyright (c) 2009 Loren Merritt + * + * This algorithm (though not any of the implementation details) is + * based on libdjbfft by D. J. Bernstein. + * + * 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 + */ + +/* + * These functions are not individually interchangeable with the C versions. + * While C takes arrays of FFTComplex, Altivec leaves intermediate results + * in blocks as convenient to the vector size. + * i.e. {4x real, 4x imaginary, 4x real, ...} + * + * I ignore standard calling convention. + * Instead, the following registers are treated as global constants: + * v14: zero + * v15..v18: cosines + * v19..v29: permutations + * r9: 16 + * r12: ff_cos_tabs + * and the rest are free for local use. + */ + +#include "config.h" +#include "asm.S" + +.text + +.macro addi2 ra, imm // add 32-bit immediate +.if \imm & 0xffff + addi \ra, \ra, \imm@l +.endif +.if (\imm+0x8000)>>16 + addis \ra, \ra, \imm@ha +.endif +.endm + +.macro FFT4 a0, a1, a2, a3 // in:0-1 out:2-3 + vperm \a2,\a0,\a1,v20 // vcprm(0,1,s2,s1) // {r0,i0,r3,i2} + vperm \a3,\a0,\a1,v21 // vcprm(2,3,s0,s3) // {r1,i1,r2,i3} + vaddfp \a0,\a2,\a3 // {t1,t2,t6,t5} + vsubfp \a1,\a2,\a3 // {t3,t4,t8,t7} + vmrghw \a2,\a0,\a1 // vcprm(0,s0,1,s1) // {t1,t3,t2,t4} + vperm \a3,\a0,\a1,v22 // vcprm(2,s3,3,s2) // {t6,t7,t5,t8} + vaddfp \a0,\a2,\a3 // {r0,r1,i0,i1} + vsubfp \a1,\a2,\a3 // {r2,r3,i2,i3} + vperm \a2,\a0,\a1,v23 // vcprm(0,1,s0,s1) // {r0,r1,r2,r3} + vperm \a3,\a0,\a1,v24 // vcprm(2,3,s2,s3) // {i0,i1,i2,i3} +.endm + +.macro FFT4x2 a0, a1, b0, b1, a2, a3, b2, b3 + vperm \a2,\a0,\a1,v20 // vcprm(0,1,s2,s1) // {r0,i0,r3,i2} + vperm \a3,\a0,\a1,v21 // vcprm(2,3,s0,s3) // {r1,i1,r2,i3} + vperm \b2,\b0,\b1,v20 + vperm \b3,\b0,\b1,v21 + vaddfp \a0,\a2,\a3 // {t1,t2,t6,t5} + vsubfp \a1,\a2,\a3 // {t3,t4,t8,t7} + vaddfp \b0,\b2,\b3 + vsubfp \b1,\b2,\b3 + vmrghw \a2,\a0,\a1 // vcprm(0,s0,1,s1) // {t1,t3,t2,t4} + vperm \a3,\a0,\a1,v22 // vcprm(2,s3,3,s2) // {t6,t7,t5,t8} + vmrghw \b2,\b0,\b1 + vperm \b3,\b0,\b1,v22 + vaddfp \a0,\a2,\a3 // {r0,r1,i0,i1} + vsubfp \a1,\a2,\a3 // {r2,r3,i2,i3} + vaddfp \b0,\b2,\b3 + vsubfp \b1,\b2,\b3 + vperm \a2,\a0,\a1,v23 // vcprm(0,1,s0,s1) // {r0,r1,r2,r3} + vperm \a3,\a0,\a1,v24 // vcprm(2,3,s2,s3) // {i0,i1,i2,i3} + vperm \b2,\b0,\b1,v23 + vperm \b3,\b0,\b1,v24 +.endm + +.macro FFT8 a0, a1, b0, b1, a2, a3, b2, b3, b4 // in,out:a0-b1 + vmrghw \b2,\b0,\b1 // vcprm(0,s0,1,s1) // {r4,r6,i4,i6} + vmrglw \b3,\b0,\b1 // vcprm(2,s2,3,s3) // {r5,r7,i5,i7} + vperm \a2,\a0,\a1,v20 // FFT4 ... + vperm \a3,\a0,\a1,v21 + vaddfp \b0,\b2,\b3 // {t1,t3,t2,t4} + vsubfp \b1,\b2,\b3 // {r5,r7,i5,i7} + vperm \b4,\b1,\b1,v25 // vcprm(2,3,0,1) // {i5,i7,r5,r7} + vaddfp \a0,\a2,\a3 + vsubfp \a1,\a2,\a3 + vmaddfp \b1,\b1,v17,v14 // * {-1,1,1,-1}/sqrt(2) + vmaddfp \b1,\b4,v18,\b1 // * { 1,1,1,1 }/sqrt(2) // {t8,ta,t7,t9} + vmrghw \a2,\a0,\a1 + vperm \a3,\a0,\a1,v22 + vperm \b2,\b0,\b1,v26 // vcprm(1,2,s3,s0) // {t3,t2,t9,t8} + vperm \b3,\b0,\b1,v27 // vcprm(0,3,s2,s1) // {t1,t4,t7,ta} + vaddfp \a0,\a2,\a3 + vsubfp \a1,\a2,\a3 + vaddfp \b0,\b2,\b3 // {t1,t2,t9,ta} + vsubfp \b1,\b2,\b3 // {t6,t5,tc,tb} + vperm \a2,\a0,\a1,v23 + vperm \a3,\a0,\a1,v24 + vperm \b2,\b0,\b1,v28 // vcprm(0,2,s1,s3) // {t1,t9,t5,tb} + vperm \b3,\b0,\b1,v29 // vcprm(1,3,s0,s2) // {t2,ta,t6,tc} + vsubfp \b0,\a2,\b2 // {r4,r5,r6,r7} + vsubfp \b1,\a3,\b3 // {i4,i5,i6,i7} + vaddfp \a0,\a2,\b2 // {r0,r1,r2,r3} + vaddfp \a1,\a3,\b3 // {i0,i1,i2,i3} +.endm + +.macro BF d0,d1,s0,s1 + vsubfp \d1,\s0,\s1 + vaddfp \d0,\s0,\s1 +.endm + +.macro zip d0,d1,s0,s1 + vmrghw \d0,\s0,\s1 + vmrglw \d1,\s0,\s1 +.endm + +.macro def_fft4 interleave +fft4\interleave\()_altivec: + lvx v0, 0,r3 + lvx v1,r9,r3 + FFT4 v0,v1,v2,v3 +.ifnb \interleave + zip v0,v1,v2,v3 + stvx v0, 0,r3 + stvx v1,r9,r3 +.else + stvx v2, 0,r3 + stvx v3,r9,r3 +.endif + blr +.endm + +.macro def_fft8 interleave +fft8\interleave\()_altivec: + addi r4,r3,32 + lvx v0, 0,r3 + lvx v1,r9,r3 + lvx v2, 0,r4 + lvx v3,r9,r4 + FFT8 v0,v1,v2,v3,v4,v5,v6,v7,v8 +.ifnb \interleave + zip v4,v5,v0,v1 + zip v6,v7,v2,v3 + stvx v4, 0,r3 + stvx v5,r9,r3 + stvx v6, 0,r4 + stvx v7,r9,r4 +.else + stvx v0, 0,r3 + stvx v1,r9,r3 + stvx v2, 0,r4 + stvx v3,r9,r4 +.endif + blr +.endm + +.macro def_fft16 interleave +fft16\interleave\()_altivec: + addi r5,r3,64 + addi r6,r3,96 + addi r4,r3,32 + lvx v0, 0,r5 + lvx v1,r9,r5 + lvx v2, 0,r6 + lvx v3,r9,r6 + FFT4x2 v0,v1,v2,v3,v4,v5,v6,v7 + lvx v0, 0,r3 + lvx v1,r9,r3 + lvx v2, 0,r4 + lvx v3,r9,r4 + FFT8 v0,v1,v2,v3,v8,v9,v10,v11,v12 + vmaddfp v8,v4,v15,v14 // r2*wre + vmaddfp v9,v5,v15,v14 // i2*wre + vmaddfp v10,v6,v15,v14 // r3*wre + vmaddfp v11,v7,v15,v14 // i3*wre + vmaddfp v8,v5,v16,v8 // i2*wim + vnmsubfp v9,v4,v16,v9 // r2*wim + vnmsubfp v10,v7,v16,v10 // i3*wim + vmaddfp v11,v6,v16,v11 // r3*wim + BF v10,v12,v10,v8 + BF v11,v13,v9,v11 + BF v0,v4,v0,v10 + BF v3,v7,v3,v12 + BF v1,v5,v1,v11 + BF v2,v6,v2,v13 +.ifnb \interleave + zip v8, v9,v0,v1 + zip v10,v11,v2,v3 + zip v12,v13,v4,v5 + zip v14,v15,v6,v7 + stvx v8, 0,r3 + stvx v9,r9,r3 + stvx v10, 0,r4 + stvx v11,r9,r4 + stvx v12, 0,r5 + stvx v13,r9,r5 + stvx v14, 0,r6 + stvx v15,r9,r6 +.else + stvx v0, 0,r3 + stvx v4, 0,r5 + stvx v3,r9,r4 + stvx v7,r9,r6 + stvx v1,r9,r3 + stvx v5,r9,r5 + stvx v2, 0,r4 + stvx v6, 0,r6 +.endif + blr +.endm + +// void pass(float *z, float *wre, int n) +.macro PASS interleave, suffix +fft_pass\suffix\()_altivec: + mtctr r5 + slwi r0,r5,4 + slwi r7,r5,6 // o2 + slwi r5,r5,5 // o1 + add r10,r5,r7 // o3 + add r0,r4,r0 // wim + addi r6,r5,16 // o1+16 + addi r8,r7,16 // o2+16 + addi r11,r10,16 // o3+16 +1: + lvx v8, 0,r4 // wre + lvx v10, 0,r0 // wim + sub r0,r0,r9 + lvx v9, 0,r0 + vperm v9,v9,v10,v19 // vcprm(s0,3,2,1) => wim[0 .. -3] + lvx v4,r3,r7 // r2 = z[o2] + lvx v5,r3,r8 // i2 = z[o2+16] + lvx v6,r3,r10 // r3 = z[o3] + lvx v7,r3,r11 // i3 = z[o3+16] + vmaddfp v10,v4,v8,v14 // r2*wre + vmaddfp v11,v5,v8,v14 // i2*wre + vmaddfp v12,v6,v8,v14 // r3*wre + vmaddfp v13,v7,v8,v14 // i3*wre + lvx v0, 0,r3 // r0 = z[0] + lvx v3,r3,r6 // i1 = z[o1+16] + vmaddfp v10,v5,v9,v10 // i2*wim + vnmsubfp v11,v4,v9,v11 // r2*wim + vnmsubfp v12,v7,v9,v12 // i3*wim + vmaddfp v13,v6,v9,v13 // r3*wim + lvx v1,r3,r9 // i0 = z[16] + lvx v2,r3,r5 // r1 = z[o1] + BF v12,v8,v12,v10 + BF v13,v9,v11,v13 + BF v0,v4,v0,v12 + BF v3,v7,v3,v8 +.if !\interleave + stvx v0, 0,r3 + stvx v4,r3,r7 + stvx v3,r3,r6 + stvx v7,r3,r11 +.endif + BF v1,v5,v1,v13 + BF v2,v6,v2,v9 +.if !\interleave + stvx v1,r3,r9 + stvx v2,r3,r5 + stvx v5,r3,r8 + stvx v6,r3,r10 +.else + vmrghw v8,v0,v1 + vmrglw v9,v0,v1 + stvx v8, 0,r3 + stvx v9,r3,r9 + vmrghw v8,v2,v3 + vmrglw v9,v2,v3 + stvx v8,r3,r5 + stvx v9,r3,r6 + vmrghw v8,v4,v5 + vmrglw v9,v4,v5 + stvx v8,r3,r7 + stvx v9,r3,r8 + vmrghw v8,v6,v7 + vmrglw v9,v6,v7 + stvx v8,r3,r10 + stvx v9,r3,r11 +.endif + addi r3,r3,32 + addi r4,r4,16 + bdnz 1b + sub r3,r3,r5 + blr +.endm + +#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ + +#define WORD_0 0x00,0x01,0x02,0x03 +#define WORD_1 0x04,0x05,0x06,0x07 +#define WORD_2 0x08,0x09,0x0a,0x0b +#define WORD_3 0x0c,0x0d,0x0e,0x0f +#define WORD_s0 0x10,0x11,0x12,0x13 +#define WORD_s1 0x14,0x15,0x16,0x17 +#define WORD_s2 0x18,0x19,0x1a,0x1b +#define WORD_s3 0x1c,0x1d,0x1e,0x1f + +#define vcprm(a, b, c, d) .byte WORD_##a, WORD_##b, WORD_##c, WORD_##d + + .rodata + .align 4 +fft_data: + .float 0, 0, 0, 0 + .float 1, 0.92387953, M_SQRT1_2, 0.38268343 + .float 0, 0.38268343, M_SQRT1_2, 0.92387953 + .float -M_SQRT1_2, M_SQRT1_2, M_SQRT1_2,-M_SQRT1_2 + .float M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, M_SQRT1_2 + vcprm(s0,3,2,1) + vcprm(0,1,s2,s1) + vcprm(2,3,s0,s3) + vcprm(2,s3,3,s2) + vcprm(0,1,s0,s1) + vcprm(2,3,s2,s3) + vcprm(2,3,0,1) + vcprm(1,2,s3,s0) + vcprm(0,3,s2,s1) + vcprm(0,2,s1,s3) + vcprm(1,3,s0,s2) + +.macro lvm b, r, regs:vararg + lvx \r, 0, \b + addi \b, \b, 16 + .ifnb \regs + lvm \b, \regs + .endif +.endm + +.macro stvm b, r, regs:vararg + stvx \r, 0, \b + addi \b, \b, 16 + .ifnb \regs + stvm \b, \regs + .endif +.endm + +.macro fft_calc interleave +extfunc ff_fft_calc\interleave\()_altivec + mflr r0 + stp r0, 2*PS(r1) + stpu r1, -(160+16*PS)(r1) + addi r6, r1, 16*PS + stvm r6, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29 + mfvrsave r0 + stw r0, 15*PS(r1) + li r6, 0xfffffffc + mtvrsave r6 + + movrel r6, fft_data + lvm r6, v14, v15, v16, v17, v18, v19, v20, v21 + lvm r6, v22, v23, v24, v25, v26, v27, v28, v29 + + li r9, 16 + movrel r12, X(ff_cos_tabs) + + movrel r6, fft_dispatch_tab\interleave\()_altivec + lwz r3, 0(r3) + subi r3, r3, 2 + slwi r3, r3, 2+ARCH_PPC64 + lpx r3, r3, r6 + mtctr r3 + mr r3, r4 + bctrl + + addi r6, r1, 16*PS + lvm r6, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29 + lwz r6, 15*PS(r1) + mtvrsave r6 + lp r1, 0(r1) + lp r0, 2*PS(r1) + mtlr r0 + blr +.endm + +.macro DECL_FFT suffix, bits, n, n2, n4 +fft\n\suffix\()_altivec: + mflr r0 + stp r0,PS*(\bits-3)(r1) + bl fft\n2\()_altivec + addi2 r3,\n*4 + bl fft\n4\()_altivec + addi2 r3,\n*2 + bl fft\n4\()_altivec + addi2 r3,\n*-6 + lp r0,PS*(\bits-3)(r1) + lp r4,\bits*PS(r12) + mtlr r0 + li r5,\n/16 + b fft_pass\suffix\()_altivec +.endm + +.macro DECL_FFTS interleave, suffix + .text + def_fft4 \suffix + def_fft8 \suffix + def_fft16 \suffix + PASS \interleave, \suffix + DECL_FFT \suffix, 5, 32, 16, 8 + DECL_FFT \suffix, 6, 64, 32, 16 + DECL_FFT \suffix, 7, 128, 64, 32 + DECL_FFT \suffix, 8, 256, 128, 64 + DECL_FFT \suffix, 9, 512, 256, 128 + DECL_FFT \suffix,10, 1024, 512, 256 + DECL_FFT \suffix,11, 2048, 1024, 512 + DECL_FFT \suffix,12, 4096, 2048, 1024 + DECL_FFT \suffix,13, 8192, 4096, 2048 + DECL_FFT \suffix,14,16384, 8192, 4096 + DECL_FFT \suffix,15,32768,16384, 8192 + DECL_FFT \suffix,16,65536,32768,16384 + + fft_calc \suffix + + .rodata + .align 3 +fft_dispatch_tab\suffix\()_altivec: + PTR fft4\suffix\()_altivec + PTR fft8\suffix\()_altivec + PTR fft16\suffix\()_altivec + PTR fft32\suffix\()_altivec + PTR fft64\suffix\()_altivec + PTR fft128\suffix\()_altivec + PTR fft256\suffix\()_altivec + PTR fft512\suffix\()_altivec + PTR fft1024\suffix\()_altivec + PTR fft2048\suffix\()_altivec + PTR fft4096\suffix\()_altivec + PTR fft8192\suffix\()_altivec + PTR fft16384\suffix\()_altivec + PTR fft32768\suffix\()_altivec + PTR fft65536\suffix\()_altivec +.endm + +DECL_FFTS 0 +DECL_FFTS 1, _interleave diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/fmtconvert_altivec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/fmtconvert_altivec.c new file mode 100644 index 00000000..e5287c96 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/fmtconvert_altivec.c @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2006 Luca Barbato + * + * 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 + */ + +#include "libavcodec/fmtconvert.h" + +#include "dsputil_altivec.h" +#include "util_altivec.h" + +static void int32_to_float_fmul_scalar_altivec(float *dst, const int *src, float mul, int len) +{ + union { + vector float v; + float s[4]; + } mul_u; + int i; + vector float src1, src2, dst1, dst2, mul_v, zero; + + zero = (vector float)vec_splat_u32(0); + mul_u.s[0] = mul; + mul_v = vec_splat(mul_u.v, 0); + + for(i=0; iint32_to_float_fmul_scalar = int32_to_float_fmul_scalar_altivec; + if(!(avctx->flags & CODEC_FLAG_BITEXACT)) { + c->float_to_int16 = float_to_int16_altivec; + c->float_to_int16_interleave = float_to_int16_interleave_altivec; + } +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/mpegaudiodec_altivec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/mpegaudiodec_altivec.c new file mode 100644 index 00000000..e087d4ad --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/mpegaudiodec_altivec.c @@ -0,0 +1,130 @@ +/* + * Altivec optimized MP3 decoding functions + * Copyright (c) 2010 Vitor Sessak + * + * 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 + */ + +#include "dsputil_altivec.h" +#include "util_altivec.h" + +#define CONFIG_FLOAT 1 +#include "libavcodec/mpegaudio.h" + +#define MACS(rt, ra, rb) rt+=(ra)*(rb) +#define MLSS(rt, ra, rb) rt-=(ra)*(rb) + +#define SUM8(op, sum, w, p) \ +{ \ + op(sum, (w)[0 * 64], (p)[0 * 64]); \ + op(sum, (w)[1 * 64], (p)[1 * 64]); \ + op(sum, (w)[2 * 64], (p)[2 * 64]); \ + op(sum, (w)[3 * 64], (p)[3 * 64]); \ + op(sum, (w)[4 * 64], (p)[4 * 64]); \ + op(sum, (w)[5 * 64], (p)[5 * 64]); \ + op(sum, (w)[6 * 64], (p)[6 * 64]); \ + op(sum, (w)[7 * 64], (p)[7 * 64]); \ +} + +static void apply_window(const float *buf, const float *win1, + const float *win2, float *sum1, float *sum2, int len) +{ + const vector float *win1a = (const vector float *) win1; + const vector float *win2a = (const vector float *) win2; + const vector float *bufa = (const vector float *) buf; + vector float *sum1a = (vector float *) sum1; + vector float *sum2a = (vector float *) sum2; + vector float av_uninit(v0), av_uninit(v4); + vector float v1, v2, v3; + + len = len >> 2; + +#define MULT(a, b) \ + { \ + v1 = vec_ld(a, win1a); \ + v2 = vec_ld(b, win2a); \ + v3 = vec_ld(a, bufa); \ + v0 = vec_madd(v3, v1, v0); \ + v4 = vec_madd(v2, v3, v4); \ + } + + while (len--) { + v0 = vec_xor(v0, v0); + v4 = vec_xor(v4, v4); + + MULT( 0, 0); + MULT( 256, 64); + MULT( 512, 128); + MULT( 768, 192); + MULT(1024, 256); + MULT(1280, 320); + MULT(1536, 384); + MULT(1792, 448); + + vec_st(v0, 0, sum1a); + vec_st(v4, 0, sum2a); + sum1a++; + sum2a++; + win1a++; + win2a++; + bufa++; + } +} + +static void apply_window_mp3(float *in, float *win, int *unused, float *out, + int incr) +{ + LOCAL_ALIGNED_16(float, suma, [17]); + LOCAL_ALIGNED_16(float, sumb, [17]); + LOCAL_ALIGNED_16(float, sumc, [17]); + LOCAL_ALIGNED_16(float, sumd, [17]); + + float sum; + int j; + float *out2 = out + 32 * incr; + + /* copy to avoid wrap */ + memcpy(in + 512, in, 32 * sizeof(*in)); + + apply_window(in + 16, win , win + 512, suma, sumc, 16); + apply_window(in + 32, win + 48, win + 640, sumb, sumd, 16); + + SUM8(MLSS, suma[0], win + 32, in + 48); + + sumc[ 0] = 0; + sumb[16] = 0; + sumd[16] = 0; + + out[0 ] = suma[ 0]; + out += incr; + out2 -= incr; + for(j=1;j<16;j++) { + *out = suma[ j] - sumd[16-j]; + *out2 = -sumb[16-j] - sumc[ j]; + out += incr; + out2 -= incr; + } + + sum = 0; + SUM8(MLSS, sum, win + 16 + 32, in + 32); + *out = sum; +} + +void ff_mpegaudiodec_init_altivec(MPADecodeContext *s) +{ + s->apply_window_mp3 = apply_window_mp3; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/regs.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/regs.h new file mode 100644 index 00000000..63861f28 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/regs.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#ifndef AVCODEC_PPC_REGS_H +#define AVCODEC_PPC_REGS_H + +#include "libavutil/avutil.h" +#include "config.h" + +#if HAVE_IBM_ASM +# define r(n) AV_TOSTRING(n) +# define f(n) AV_TOSTRING(n) +# define v(n) AV_TOSTRING(n) +#else +# define r(n) AV_TOSTRING(r ## n) +# define f(n) AV_TOSTRING(f ## n) +# define v(n) AV_TOSTRING(v ## n) +#endif + +#endif /* AVCODEC_PPC_REGS_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c new file mode 100644 index 00000000..8096c4a5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c @@ -0,0 +1,296 @@ +/** + * VP8 compatible video decoder + * + * Copyright (C) 2010 David Conrad + * + * 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 + */ + +#include "libavutil/cpu.h" +#include "libavcodec/vp8dsp.h" +#include "dsputil_altivec.h" +#include "types_altivec.h" +#include "util_altivec.h" + +#define REPT4(...) { __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__ } + +// h subpel filter uses msum to multiply+add 4 pixel taps at once +static const vec_s8 h_subpel_filters_inner[7] = +{ + REPT4( -6, 123, 12, -1), + REPT4(-11, 108, 36, -8), + REPT4( -9, 93, 50, -6), + REPT4(-16, 77, 77, -16), + REPT4( -6, 50, 93, -9), + REPT4( -8, 36, 108, -11), + REPT4( -1, 12, 123, -6), +}; + +// for 6tap filters, these are the outer two taps +// The zeros mask off pixels 4-7 when filtering 0-3 +// and vice-versa +static const vec_s8 h_subpel_filters_outer[3] = +{ + REPT4(0, 0, 2, 1), + REPT4(0, 0, 3, 3), + REPT4(0, 0, 1, 2), +}; + +#define LOAD_H_SUBPEL_FILTER(i) \ + vec_s8 filter_inner = h_subpel_filters_inner[i]; \ + vec_s8 filter_outerh = h_subpel_filters_outer[(i)>>1]; \ + vec_s8 filter_outerl = vec_sld(filter_outerh, filter_outerh, 2) + +#define FILTER_H(dstv, off) \ + a = vec_ld((off)-2, src); \ + b = vec_ld((off)-2+15, src); \ +\ + pixh = vec_perm(a, b, permh##off); \ + pixl = vec_perm(a, b, perml##off); \ + filth = vec_msum(filter_inner, pixh, c64); \ + filtl = vec_msum(filter_inner, pixl, c64); \ +\ + if (is6tap) { \ + outer = vec_perm(a, b, perm_6tap##off); \ + filth = vec_msum(filter_outerh, outer, filth); \ + filtl = vec_msum(filter_outerl, outer, filtl); \ + } \ + if (w == 4) \ + filtl = filth; /* discard pixels 4-7 */ \ + dstv = vec_packs(filth, filtl); \ + dstv = vec_sra(dstv, c7) + +static av_always_inline +void put_vp8_epel_h_altivec_core(uint8_t *dst, int dst_stride, + uint8_t *src, int src_stride, + int h, int mx, int w, int is6tap) +{ + LOAD_H_SUBPEL_FILTER(mx-1); + vec_u8 align_vec0, align_vec8, permh0, permh8, filt; + vec_u8 perm_6tap0, perm_6tap8, perml0, perml8; + vec_u8 a, b, pixh, pixl, outer; + vec_s16 f16h, f16l; + vec_s32 filth, filtl; + + vec_u8 perm_inner = { 1,2,3,4, 2,3,4,5, 3,4,5,6, 4,5,6,7 }; + vec_u8 perm_outer = { 4,9, 0,5, 5,10, 1,6, 6,11, 2,7, 7,12, 3,8 }; + vec_s32 c64 = vec_sl(vec_splat_s32(1), vec_splat_u32(6)); + vec_u16 c7 = vec_splat_u16(7); + + align_vec0 = vec_lvsl( -2, src); + align_vec8 = vec_lvsl(8-2, src); + + permh0 = vec_perm(align_vec0, align_vec0, perm_inner); + permh8 = vec_perm(align_vec8, align_vec8, perm_inner); + perm_inner = vec_add(perm_inner, vec_splat_u8(4)); + perml0 = vec_perm(align_vec0, align_vec0, perm_inner); + perml8 = vec_perm(align_vec8, align_vec8, perm_inner); + perm_6tap0 = vec_perm(align_vec0, align_vec0, perm_outer); + perm_6tap8 = vec_perm(align_vec8, align_vec8, perm_outer); + + while (h --> 0) { + FILTER_H(f16h, 0); + + if (w == 16) { + FILTER_H(f16l, 8); + filt = vec_packsu(f16h, f16l); + vec_st(filt, 0, dst); + } else { + filt = vec_packsu(f16h, f16h); + vec_ste((vec_u32)filt, 0, (uint32_t*)dst); + if (w == 8) + vec_ste((vec_u32)filt, 4, (uint32_t*)dst); + } + src += src_stride; + dst += dst_stride; + } +} + +// v subpel filter does a simple vertical multiply + add +static const vec_u8 v_subpel_filters[7] = +{ + { 0, 6, 123, 12, 1, 0 }, + { 2, 11, 108, 36, 8, 1 }, + { 0, 9, 93, 50, 6, 0 }, + { 3, 16, 77, 77, 16, 3 }, + { 0, 6, 50, 93, 9, 0 }, + { 1, 8, 36, 108, 11, 2 }, + { 0, 1, 12, 123, 6, 0 }, +}; + +#define LOAD_V_SUBPEL_FILTER(i) \ + vec_u8 subpel_filter = v_subpel_filters[i]; \ + vec_u8 f0 = vec_splat(subpel_filter, 0); \ + vec_u8 f1 = vec_splat(subpel_filter, 1); \ + vec_u8 f2 = vec_splat(subpel_filter, 2); \ + vec_u8 f3 = vec_splat(subpel_filter, 3); \ + vec_u8 f4 = vec_splat(subpel_filter, 4); \ + vec_u8 f5 = vec_splat(subpel_filter, 5) + +#define FILTER_V(dstv, vec_mul) \ + s1f = (vec_s16)vec_mul(s1, f1); \ + s2f = (vec_s16)vec_mul(s2, f2); \ + s3f = (vec_s16)vec_mul(s3, f3); \ + s4f = (vec_s16)vec_mul(s4, f4); \ + s2f = vec_subs(s2f, s1f); \ + s3f = vec_subs(s3f, s4f); \ + if (is6tap) { \ + s0f = (vec_s16)vec_mul(s0, f0); \ + s5f = (vec_s16)vec_mul(s5, f5); \ + s2f = vec_adds(s2f, s0f); \ + s3f = vec_adds(s3f, s5f); \ + } \ + dstv = vec_adds(s2f, s3f); \ + dstv = vec_adds(dstv, c64); \ + dstv = vec_sra(dstv, c7) + +static av_always_inline +void put_vp8_epel_v_altivec_core(uint8_t *dst, int dst_stride, + uint8_t *src, int src_stride, + int h, int my, int w, int is6tap) +{ + LOAD_V_SUBPEL_FILTER(my-1); + vec_u8 s0, s1, s2, s3, s4, s5, filt, align_vech, perm_vec, align_vecl; + vec_s16 s0f, s1f, s2f, s3f, s4f, s5f, f16h, f16l; + vec_s16 c64 = vec_sl(vec_splat_s16(1), vec_splat_u16(6)); + vec_u16 c7 = vec_splat_u16(7); + + // we want pixels 0-7 to be in the even positions and 8-15 in the odd, + // so combine this permute with the alignment permute vector + align_vech = vec_lvsl(0, src); + align_vecl = vec_sld(align_vech, align_vech, 8); + if (w ==16) + perm_vec = vec_mergeh(align_vech, align_vecl); + else + perm_vec = vec_mergeh(align_vech, align_vech); + + if (is6tap) + s0 = load_with_perm_vec(-2*src_stride, src, perm_vec); + s1 = load_with_perm_vec(-1*src_stride, src, perm_vec); + s2 = load_with_perm_vec( 0*src_stride, src, perm_vec); + s3 = load_with_perm_vec( 1*src_stride, src, perm_vec); + if (is6tap) + s4 = load_with_perm_vec( 2*src_stride, src, perm_vec); + + src += (2+is6tap)*src_stride; + + while (h --> 0) { + if (is6tap) + s5 = load_with_perm_vec(0, src, perm_vec); + else + s4 = load_with_perm_vec(0, src, perm_vec); + + FILTER_V(f16h, vec_mule); + + if (w == 16) { + FILTER_V(f16l, vec_mulo); + filt = vec_packsu(f16h, f16l); + vec_st(filt, 0, dst); + } else { + filt = vec_packsu(f16h, f16h); + if (w == 4) + filt = (vec_u8)vec_splat((vec_u32)filt, 0); + else + vec_ste((vec_u32)filt, 4, (uint32_t*)dst); + vec_ste((vec_u32)filt, 0, (uint32_t*)dst); + } + + if (is6tap) + s0 = s1; + s1 = s2; + s2 = s3; + s3 = s4; + if (is6tap) + s4 = s5; + + dst += dst_stride; + src += src_stride; + } +} + +#define EPEL_FUNCS(WIDTH, TAPS) \ +static av_noinline \ +void put_vp8_epel ## WIDTH ## _h ## TAPS ## _altivec(uint8_t *dst, int dst_stride, uint8_t *src, int src_stride, int h, int mx, int my) \ +{ \ + put_vp8_epel_h_altivec_core(dst, dst_stride, src, src_stride, h, mx, WIDTH, TAPS == 6); \ +} \ +\ +static av_noinline \ +void put_vp8_epel ## WIDTH ## _v ## TAPS ## _altivec(uint8_t *dst, int dst_stride, uint8_t *src, int src_stride, int h, int mx, int my) \ +{ \ + put_vp8_epel_v_altivec_core(dst, dst_stride, src, src_stride, h, my, WIDTH, TAPS == 6); \ +} + +#define EPEL_HV(WIDTH, HTAPS, VTAPS) \ +static void put_vp8_epel ## WIDTH ## _h ## HTAPS ## v ## VTAPS ## _altivec(uint8_t *dst, int stride, uint8_t *src, int s, int h, int mx, int my) \ +{ \ + DECLARE_ALIGNED(16, uint8_t, tmp)[(2*WIDTH+5)*16]; \ + put_vp8_epel ## WIDTH ## _h ## HTAPS ## _altivec(tmp, 16, src-2*stride, stride, h+5, mx, my); \ + put_vp8_epel ## WIDTH ## _v ## VTAPS ## _altivec(dst, stride, tmp+2*16, 16, h, mx, my); \ +} + +EPEL_FUNCS(16,6) +EPEL_FUNCS(8, 6) +EPEL_FUNCS(8, 4) +EPEL_FUNCS(4, 6) +EPEL_FUNCS(4, 4) + +EPEL_HV(16, 6,6) +EPEL_HV(8, 6,6) +EPEL_HV(8, 4,6) +EPEL_HV(8, 6,4) +EPEL_HV(8, 4,4) +EPEL_HV(4, 6,6) +EPEL_HV(4, 4,6) +EPEL_HV(4, 6,4) +EPEL_HV(4, 4,4) + +static void put_vp8_pixels16_altivec(uint8_t *dst, int stride, uint8_t *src, int s, int h, int mx, int my) +{ + put_pixels16_altivec(dst, src, stride, h); +} + +av_cold void ff_vp8dsp_init_altivec(VP8DSPContext *c) +{ + if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) + return; + + c->put_vp8_epel_pixels_tab[0][0][0] = put_vp8_pixels16_altivec; + c->put_vp8_epel_pixels_tab[0][0][2] = put_vp8_epel16_h6_altivec; + c->put_vp8_epel_pixels_tab[0][2][0] = put_vp8_epel16_v6_altivec; + c->put_vp8_epel_pixels_tab[0][2][2] = put_vp8_epel16_h6v6_altivec; + + c->put_vp8_epel_pixels_tab[1][0][2] = put_vp8_epel8_h6_altivec; + c->put_vp8_epel_pixels_tab[1][2][0] = put_vp8_epel8_v6_altivec; + c->put_vp8_epel_pixels_tab[1][0][1] = put_vp8_epel8_h4_altivec; + c->put_vp8_epel_pixels_tab[1][1][0] = put_vp8_epel8_v4_altivec; + + c->put_vp8_epel_pixels_tab[1][2][2] = put_vp8_epel8_h6v6_altivec; + c->put_vp8_epel_pixels_tab[1][1][1] = put_vp8_epel8_h4v4_altivec; + c->put_vp8_epel_pixels_tab[1][1][2] = put_vp8_epel8_h6v4_altivec; + c->put_vp8_epel_pixels_tab[1][2][1] = put_vp8_epel8_h4v6_altivec; + + c->put_vp8_epel_pixels_tab[2][0][2] = put_vp8_epel4_h6_altivec; + c->put_vp8_epel_pixels_tab[2][2][0] = put_vp8_epel4_v6_altivec; + c->put_vp8_epel_pixels_tab[2][0][1] = put_vp8_epel4_h4_altivec; + c->put_vp8_epel_pixels_tab[2][1][0] = put_vp8_epel4_v4_altivec; + + c->put_vp8_epel_pixels_tab[2][2][2] = put_vp8_epel4_h6v6_altivec; + c->put_vp8_epel_pixels_tab[2][1][1] = put_vp8_epel4_h4v4_altivec; + c->put_vp8_epel_pixels_tab[2][1][2] = put_vp8_epel4_h6v4_altivec; + c->put_vp8_epel_pixels_tab[2][2][1] = put_vp8_epel4_h4v6_altivec; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdm2_tablegen.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdm2_tablegen.c new file mode 100644 index 00000000..a7a9fb66 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdm2_tablegen.c @@ -0,0 +1,44 @@ +/* + * Generate a header file for hardcoded QDM2 tables + * + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + */ + +#include +#define CONFIG_HARDCODED_TABLES 0 +#include "qdm2_tablegen.h" +#include "tableprint.h" + +int main(void) +{ + softclip_table_init(); + rnd_table_init(); + init_noise_samples(); + + write_fileheader(); + + WRITE_ARRAY("static const", uint16_t, softclip_table); + WRITE_ARRAY("static const", float, noise_table); + WRITE_ARRAY("static const", float, noise_samples); + + WRITE_2D_ARRAY("static const", uint8_t, random_dequant_index); + WRITE_2D_ARRAY("static const", uint8_t, random_dequant_type24); + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdm2_tablegen.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdm2_tablegen.h new file mode 100644 index 00000000..6718f58b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/qdm2_tablegen.h @@ -0,0 +1,102 @@ +/* + * Header file for hardcoded QDM2 tables + * + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + */ + +#ifndef QDM2_TABLEGEN_H +#define QDM2_TABLEGEN_H + +#include +#include +#include "libavutil/attributes.h" + +#define SOFTCLIP_THRESHOLD 27600 +#define HARDCLIP_THRESHOLD 35716 + +#if CONFIG_HARDCODED_TABLES +#define softclip_table_init() +#define rnd_table_init() +#define init_noise_samples() +#include "libavcodec/qdm2_tables.h" +#else +static uint16_t softclip_table[HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1]; +static float noise_table[4096]; +static uint8_t random_dequant_index[256][5]; +static uint8_t random_dequant_type24[128][3]; +static float noise_samples[128]; + +static av_cold void softclip_table_init(void) { + int i; + double dfl = SOFTCLIP_THRESHOLD - 32767; + float delta = 1.0 / -dfl; + for (i = 0; i < HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1; i++) + softclip_table[i] = SOFTCLIP_THRESHOLD - ((int)(sin((float)i * delta) * dfl) & 0x0000FFFF); +} + + +// random generated table +static av_cold void rnd_table_init(void) { + int i,j; + uint32_t ldw,hdw; + uint64_t tmp64_1; + uint64_t random_seed = 0; + float delta = 1.0 / 16384.0; + for(i = 0; i < 4096 ;i++) { + random_seed = random_seed * 214013 + 2531011; + noise_table[i] = (delta * (float)(((int32_t)random_seed >> 16) & 0x00007FFF)- 1.0) * 1.3; + } + + for (i = 0; i < 256 ;i++) { + random_seed = 81; + ldw = i; + for (j = 0; j < 5 ;j++) { + random_dequant_index[i][j] = (uint8_t)((ldw / random_seed) & 0xFF); + ldw = (uint32_t)ldw % (uint32_t)random_seed; + tmp64_1 = (random_seed * 0x55555556); + hdw = (uint32_t)(tmp64_1 >> 32); + random_seed = (uint64_t)(hdw + (ldw >> 31)); + } + } + for (i = 0; i < 128 ;i++) { + random_seed = 25; + ldw = i; + for (j = 0; j < 3 ;j++) { + random_dequant_type24[i][j] = (uint8_t)((ldw / random_seed) & 0xFF); + ldw = (uint32_t)ldw % (uint32_t)random_seed; + tmp64_1 = (random_seed * 0x66666667); + hdw = (uint32_t)(tmp64_1 >> 33); + random_seed = hdw + (ldw >> 31); + } + } +} + + +static av_cold void init_noise_samples(void) { + int i; + int random_seed = 0; + float delta = 1.0 / 16384.0; + for (i = 0; i < 128;i++) { + random_seed = random_seed * 214013 + 2531011; + noise_samples[i] = (delta * (float)((random_seed >> 16) & 0x00007fff) - 1.0); + } +} +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* QDM2_TABLEGEN_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/r210dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/r210dec.c new file mode 100644 index 00000000..a5222b17 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/r210dec.c @@ -0,0 +1,126 @@ +/* + * R210 decoder + * + * Copyright (c) 2009 Reimar Doeffinger + * + * 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 + */ + +#include "avcodec.h" +#include "libavutil/bswap.h" + +static av_cold int decode_init(AVCodecContext *avctx) +{ + avctx->pix_fmt = PIX_FMT_RGB48; + avctx->bits_per_raw_sample = 10; + + avctx->coded_frame = avcodec_alloc_frame(); + + return 0; +} + +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, + AVPacket *avpkt) +{ + int h, w; + AVFrame *pic = avctx->coded_frame; + const uint32_t *src = (const uint32_t *)avpkt->data; + int aligned_width = FFALIGN(avctx->width, 64); + uint8_t *dst_line; + + if (pic->data[0]) + avctx->release_buffer(avctx, pic); + + if (avpkt->size < 4 * aligned_width * avctx->height) { + av_log(avctx, AV_LOG_ERROR, "packet too small\n"); + return -1; + } + + pic->reference = 0; + if (avctx->get_buffer(avctx, pic) < 0) + return -1; + + pic->pict_type = FF_I_TYPE; + pic->key_frame = 1; + dst_line = pic->data[0]; + + for (h = 0; h < avctx->height; h++) { + uint16_t *dst = (uint16_t *)dst_line; + for (w = 0; w < avctx->width; w++) { + uint32_t pixel = av_be2ne32(*src++); + uint16_t r, g, b; + if (avctx->codec_id==CODEC_ID_R210) { + b = pixel << 6; + g = (pixel >> 4) & 0xffc0; + r = (pixel >> 14) & 0xffc0; + } else { + b = pixel << 4; + g = (pixel >> 6) & 0xffc0; + r = (pixel >> 16) & 0xffc0; + } + *dst++ = r | (r >> 10); + *dst++ = g | (g >> 10); + *dst++ = b | (b >> 10); + } + src += aligned_width - avctx->width; + dst_line += pic->linesize[0]; + } + + *data_size = sizeof(AVFrame); + *(AVFrame*)data = *avctx->coded_frame; + + return avpkt->size; +} + +static av_cold int decode_close(AVCodecContext *avctx) +{ + AVFrame *pic = avctx->coded_frame; + if (pic->data[0]) + avctx->release_buffer(avctx, pic); + av_freep(&avctx->coded_frame); + + return 0; +} + +#if CONFIG_R210_DECODER +AVCodec ff_r210_decoder = { + "r210", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_R210, + 0, + decode_init, + NULL, + decode_close, + decode_frame, + CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"), +}; +#endif +#if CONFIG_R10K_DECODER +AVCodec ff_r10k_decoder = { + "r10k", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_R10K, + 0, + decode_init, + NULL, + decode_close, + decode_frame, + CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"), +}; +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ra144dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ra144dec.c new file mode 100644 index 00000000..53f529d6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ra144dec.c @@ -0,0 +1,128 @@ +/* + * Real Audio 1.0 (14.4K) + * + * Copyright (c) 2008 Vitor Sessak + * Copyright (c) 2003 Nick Kurshev + * Based on public domain decoder at http://www.honeypot.net/audio + * + * 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 + */ + +#include "libavutil/intmath.h" +#include "avcodec.h" +#include "get_bits.h" +#include "ra144.h" + + +static av_cold int ra144_decode_init(AVCodecContext * avctx) +{ + RA144Context *ractx = avctx->priv_data; + + ractx->avctx = avctx; + + ractx->lpc_coef[0] = ractx->lpc_tables[0]; + ractx->lpc_coef[1] = ractx->lpc_tables[1]; + + avctx->sample_fmt = AV_SAMPLE_FMT_S16; + return 0; +} + +static void do_output_subblock(RA144Context *ractx, const uint16_t *lpc_coefs, + int gval, GetBitContext *gb) +{ + int cba_idx = get_bits(gb, 7); // index of the adaptive CB, 0 if none + int gain = get_bits(gb, 8); + int cb1_idx = get_bits(gb, 7); + int cb2_idx = get_bits(gb, 7); + + ff_subblock_synthesis(ractx, lpc_coefs, cba_idx, cb1_idx, cb2_idx, gval, + gain); +} + +/** Uncompress one block (20 bytes -> 160*2 bytes). */ +static int ra144_decode_frame(AVCodecContext * avctx, void *vdata, + int *data_size, AVPacket *avpkt) +{ + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + static const uint8_t sizes[10] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2}; + unsigned int refl_rms[4]; // RMS of the reflection coefficients + uint16_t block_coefs[4][10]; // LPC coefficients of each sub-block + unsigned int lpc_refl[10]; // LPC reflection coefficients of the frame + int i, j; + int16_t *data = vdata; + unsigned int energy; + + RA144Context *ractx = avctx->priv_data; + GetBitContext gb; + + if (*data_size < 2*160) + return -1; + + if(buf_size < 20) { + av_log(avctx, AV_LOG_ERROR, + "Frame too small (%d bytes). Truncated file?\n", buf_size); + *data_size = 0; + return buf_size; + } + init_get_bits(&gb, buf, 20 * 8); + + for (i=0; i<10; i++) + lpc_refl[i] = ff_lpc_refl_cb[i][get_bits(&gb, sizes[i])]; + + ff_eval_coefs(ractx->lpc_coef[0], lpc_refl); + ractx->lpc_refl_rms[0] = ff_rms(lpc_refl); + + energy = ff_energy_tab[get_bits(&gb, 5)]; + + refl_rms[0] = ff_interp(ractx, block_coefs[0], 1, 1, ractx->old_energy); + refl_rms[1] = ff_interp(ractx, block_coefs[1], 2, + energy <= ractx->old_energy, + ff_t_sqrt(energy*ractx->old_energy) >> 12); + refl_rms[2] = ff_interp(ractx, block_coefs[2], 3, 0, energy); + refl_rms[3] = ff_rescale_rms(ractx->lpc_refl_rms[0], energy); + + ff_int_to_int16(block_coefs[3], ractx->lpc_coef[0]); + + for (i=0; i < 4; i++) { + do_output_subblock(ractx, block_coefs[i], refl_rms[i], &gb); + + for (j=0; j < BLOCKSIZE; j++) + *data++ = av_clip_int16(ractx->curr_sblock[j + 10] << 2); + } + + ractx->old_energy = energy; + ractx->lpc_refl_rms[1] = ractx->lpc_refl_rms[0]; + + FFSWAP(unsigned int *, ractx->lpc_coef[0], ractx->lpc_coef[1]); + + *data_size = 2*160; + return 20; +} + +AVCodec ff_ra_144_decoder = +{ + "real_144", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_RA_144, + sizeof(RA144Context), + ra144_decode_init, + NULL, + NULL, + ra144_decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K)"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ra144enc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ra144enc.c new file mode 100644 index 00000000..a0912056 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/ra144enc.c @@ -0,0 +1,521 @@ +/* + * Real Audio 1.0 (14.4K) encoder + * Copyright (c) 2010 Francesco Lavra + * + * 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 + * Real Audio 1.0 (14.4K) encoder + * @author Francesco Lavra + */ + +#include + +#include "avcodec.h" +#include "put_bits.h" +#include "celp_filters.h" +#include "ra144.h" + + +static av_cold int ra144_encode_init(AVCodecContext * avctx) +{ + RA144Context *ractx; + int ret; + + if (avctx->sample_fmt != AV_SAMPLE_FMT_S16) { + av_log(avctx, AV_LOG_ERROR, "invalid sample format\n"); + return -1; + } + if (avctx->channels != 1) { + av_log(avctx, AV_LOG_ERROR, "invalid number of channels: %d\n", + avctx->channels); + return -1; + } + avctx->frame_size = NBLOCKS * BLOCKSIZE; + avctx->bit_rate = 8000; + ractx = avctx->priv_data; + ractx->lpc_coef[0] = ractx->lpc_tables[0]; + ractx->lpc_coef[1] = ractx->lpc_tables[1]; + ractx->avctx = avctx; + ret = ff_lpc_init(&ractx->lpc_ctx, avctx->frame_size, LPC_ORDER, + AV_LPC_TYPE_LEVINSON); + return ret; +} + + +static av_cold int ra144_encode_close(AVCodecContext *avctx) +{ + RA144Context *ractx = avctx->priv_data; + ff_lpc_end(&ractx->lpc_ctx); + return 0; +} + + +/** + * Quantize a value by searching a sorted table for the element with the + * nearest value + * + * @param value value to quantize + * @param table array containing the quantization table + * @param size size of the quantization table + * @return index of the quantization table corresponding to the element with the + * nearest value + */ +static int quantize(int value, const int16_t *table, unsigned int size) +{ + unsigned int low = 0, high = size - 1; + + while (1) { + int index = (low + high) >> 1; + int error = table[index] - value; + + if (index == low) + return table[high] + error > value ? low : high; + if (error > 0) { + high = index; + } else { + low = index; + } + } +} + + +/** + * Orthogonalize a vector to another vector + * + * @param v vector to orthogonalize + * @param u vector against which orthogonalization is performed + */ +static void orthogonalize(float *v, const float *u) +{ + int i; + float num = 0, den = 0; + + for (i = 0; i < BLOCKSIZE; i++) { + num += v[i] * u[i]; + den += u[i] * u[i]; + } + num /= den; + for (i = 0; i < BLOCKSIZE; i++) + v[i] -= num * u[i]; +} + + +/** + * Calculate match score and gain of an LPC-filtered vector with respect to + * input data, possibly othogonalizing it to up to 2 other vectors + * + * @param work array used to calculate the filtered vector + * @param coefs coefficients of the LPC filter + * @param vect original vector + * @param ortho1 first vector against which orthogonalization is performed + * @param ortho2 second vector against which orthogonalization is performed + * @param data input data + * @param score pointer to variable where match score is returned + * @param gain pointer to variable where gain is returned + */ +static void get_match_score(float *work, const float *coefs, float *vect, + const float *ortho1, const float *ortho2, + const float *data, float *score, float *gain) +{ + float c, g; + int i; + + ff_celp_lp_synthesis_filterf(work, coefs, vect, BLOCKSIZE, LPC_ORDER); + if (ortho1) + orthogonalize(work, ortho1); + if (ortho2) + orthogonalize(work, ortho2); + c = g = 0; + for (i = 0; i < BLOCKSIZE; i++) { + g += work[i] * work[i]; + c += data[i] * work[i]; + } + if (c <= 0) { + *score = 0; + return; + } + *gain = c / g; + *score = *gain * c; +} + + +/** + * Create a vector from the adaptive codebook at a given lag value + * + * @param vect array where vector is stored + * @param cb adaptive codebook + * @param lag lag value + */ +static void create_adapt_vect(float *vect, const int16_t *cb, int lag) +{ + int i; + + cb += BUFFERSIZE - lag; + for (i = 0; i < FFMIN(BLOCKSIZE, lag); i++) + vect[i] = cb[i]; + if (lag < BLOCKSIZE) + for (i = 0; i < BLOCKSIZE - lag; i++) + vect[lag + i] = cb[i]; +} + + +/** + * Search the adaptive codebook for the best entry and gain and remove its + * contribution from input data + * + * @param adapt_cb array from which the adaptive codebook is extracted + * @param work array used to calculate LPC-filtered vectors + * @param coefs coefficients of the LPC filter + * @param data input data + * @return index of the best entry of the adaptive codebook + */ +static int adaptive_cb_search(const int16_t *adapt_cb, float *work, + const float *coefs, float *data) +{ + int i, best_vect; + float score, gain, best_score, best_gain; + float exc[BLOCKSIZE]; + + gain = best_score = 0; + for (i = BLOCKSIZE / 2; i <= BUFFERSIZE; i++) { + create_adapt_vect(exc, adapt_cb, i); + get_match_score(work, coefs, exc, NULL, NULL, data, &score, &gain); + if (score > best_score) { + best_score = score; + best_vect = i; + best_gain = gain; + } + } + if (!best_score) + return 0; + + /** + * Re-calculate the filtered vector from the vector with maximum match score + * and remove its contribution from input data. + */ + create_adapt_vect(exc, adapt_cb, best_vect); + ff_celp_lp_synthesis_filterf(work, coefs, exc, BLOCKSIZE, LPC_ORDER); + for (i = 0; i < BLOCKSIZE; i++) + data[i] -= best_gain * work[i]; + return (best_vect - BLOCKSIZE / 2 + 1); +} + + +/** + * Find the best vector of a fixed codebook by applying an LPC filter to + * codebook entries, possibly othogonalizing them to up to 2 other vectors and + * matching the results with input data + * + * @param work array used to calculate the filtered vectors + * @param coefs coefficients of the LPC filter + * @param cb fixed codebook + * @param ortho1 first vector against which orthogonalization is performed + * @param ortho2 second vector against which orthogonalization is performed + * @param data input data + * @param idx pointer to variable where the index of the best codebook entry is + * returned + * @param gain pointer to variable where the gain of the best codebook entry is + * returned + */ +static void find_best_vect(float *work, const float *coefs, + const int8_t cb[][BLOCKSIZE], const float *ortho1, + const float *ortho2, float *data, int *idx, + float *gain) +{ + int i, j; + float g, score, best_score; + float vect[BLOCKSIZE]; + + *idx = *gain = best_score = 0; + for (i = 0; i < FIXED_CB_SIZE; i++) { + for (j = 0; j < BLOCKSIZE; j++) + vect[j] = cb[i][j]; + get_match_score(work, coefs, vect, ortho1, ortho2, data, &score, &g); + if (score > best_score) { + best_score = score; + *idx = i; + *gain = g; + } + } +} + + +/** + * Search the two fixed codebooks for the best entry and gain + * + * @param work array used to calculate LPC-filtered vectors + * @param coefs coefficients of the LPC filter + * @param data input data + * @param cba_idx index of the best entry of the adaptive codebook + * @param cb1_idx pointer to variable where the index of the best entry of the + * first fixed codebook is returned + * @param cb2_idx pointer to variable where the index of the best entry of the + * second fixed codebook is returned + */ +static void fixed_cb_search(float *work, const float *coefs, float *data, + int cba_idx, int *cb1_idx, int *cb2_idx) +{ + int i, ortho_cb1; + float gain; + float cba_vect[BLOCKSIZE], cb1_vect[BLOCKSIZE]; + float vect[BLOCKSIZE]; + + /** + * The filtered vector from the adaptive codebook can be retrieved from + * work, because this function is called just after adaptive_cb_search(). + */ + if (cba_idx) + memcpy(cba_vect, work, sizeof(cba_vect)); + + find_best_vect(work, coefs, ff_cb1_vects, cba_idx ? cba_vect : NULL, NULL, + data, cb1_idx, &gain); + + /** + * Re-calculate the filtered vector from the vector with maximum match score + * and remove its contribution from input data. + */ + if (gain) { + for (i = 0; i < BLOCKSIZE; i++) + vect[i] = ff_cb1_vects[*cb1_idx][i]; + ff_celp_lp_synthesis_filterf(work, coefs, vect, BLOCKSIZE, LPC_ORDER); + if (cba_idx) + orthogonalize(work, cba_vect); + for (i = 0; i < BLOCKSIZE; i++) + data[i] -= gain * work[i]; + memcpy(cb1_vect, work, sizeof(cb1_vect)); + ortho_cb1 = 1; + } else + ortho_cb1 = 0; + + find_best_vect(work, coefs, ff_cb2_vects, cba_idx ? cba_vect : NULL, + ortho_cb1 ? cb1_vect : NULL, data, cb2_idx, &gain); +} + + +/** + * Encode a subblock of the current frame + * + * @param ractx encoder context + * @param sblock_data input data of the subblock + * @param lpc_coefs coefficients of the LPC filter + * @param rms RMS of the reflection coefficients + * @param pb pointer to PutBitContext of the current frame + */ +static void ra144_encode_subblock(RA144Context *ractx, + const int16_t *sblock_data, + const int16_t *lpc_coefs, unsigned int rms, + PutBitContext *pb) +{ + float data[BLOCKSIZE], work[LPC_ORDER + BLOCKSIZE]; + float coefs[LPC_ORDER]; + float zero[BLOCKSIZE], cba[BLOCKSIZE], cb1[BLOCKSIZE], cb2[BLOCKSIZE]; + int16_t cba_vect[BLOCKSIZE]; + int cba_idx, cb1_idx, cb2_idx, gain; + int i, n, m[3]; + float g[3]; + float error, best_error; + + for (i = 0; i < LPC_ORDER; i++) { + work[i] = ractx->curr_sblock[BLOCKSIZE + i]; + coefs[i] = lpc_coefs[i] * (1/4096.0); + } + + /** + * Calculate the zero-input response of the LPC filter and subtract it from + * input data. + */ + memset(data, 0, sizeof(data)); + ff_celp_lp_synthesis_filterf(work + LPC_ORDER, coefs, data, BLOCKSIZE, + LPC_ORDER); + for (i = 0; i < BLOCKSIZE; i++) { + zero[i] = work[LPC_ORDER + i]; + data[i] = sblock_data[i] - zero[i]; + } + + /** + * Codebook search is performed without taking into account the contribution + * of the previous subblock, since it has been just subtracted from input + * data. + */ + memset(work, 0, LPC_ORDER * sizeof(*work)); + + cba_idx = adaptive_cb_search(ractx->adapt_cb, work + LPC_ORDER, coefs, + data); + if (cba_idx) { + /** + * The filtered vector from the adaptive codebook can be retrieved from + * work, see implementation of adaptive_cb_search(). + */ + memcpy(cba, work + LPC_ORDER, sizeof(cba)); + + ff_copy_and_dup(cba_vect, ractx->adapt_cb, cba_idx + BLOCKSIZE / 2 - 1); + m[0] = (ff_irms(cba_vect) * rms) >> 12; + } + fixed_cb_search(work + LPC_ORDER, coefs, data, cba_idx, &cb1_idx, &cb2_idx); + for (i = 0; i < BLOCKSIZE; i++) { + cb1[i] = ff_cb1_vects[cb1_idx][i]; + cb2[i] = ff_cb2_vects[cb2_idx][i]; + } + ff_celp_lp_synthesis_filterf(work + LPC_ORDER, coefs, cb1, BLOCKSIZE, + LPC_ORDER); + memcpy(cb1, work + LPC_ORDER, sizeof(cb1)); + m[1] = (ff_cb1_base[cb1_idx] * rms) >> 8; + ff_celp_lp_synthesis_filterf(work + LPC_ORDER, coefs, cb2, BLOCKSIZE, + LPC_ORDER); + memcpy(cb2, work + LPC_ORDER, sizeof(cb2)); + m[2] = (ff_cb2_base[cb2_idx] * rms) >> 8; + best_error = FLT_MAX; + gain = 0; + for (n = 0; n < 256; n++) { + g[1] = ((ff_gain_val_tab[n][1] * m[1]) >> ff_gain_exp_tab[n]) * + (1/4096.0); + g[2] = ((ff_gain_val_tab[n][2] * m[2]) >> ff_gain_exp_tab[n]) * + (1/4096.0); + error = 0; + if (cba_idx) { + g[0] = ((ff_gain_val_tab[n][0] * m[0]) >> ff_gain_exp_tab[n]) * + (1/4096.0); + for (i = 0; i < BLOCKSIZE; i++) { + data[i] = zero[i] + g[0] * cba[i] + g[1] * cb1[i] + + g[2] * cb2[i]; + error += (data[i] - sblock_data[i]) * + (data[i] - sblock_data[i]); + } + } else { + for (i = 0; i < BLOCKSIZE; i++) { + data[i] = zero[i] + g[1] * cb1[i] + g[2] * cb2[i]; + error += (data[i] - sblock_data[i]) * + (data[i] - sblock_data[i]); + } + } + if (error < best_error) { + best_error = error; + gain = n; + } + } + put_bits(pb, 7, cba_idx); + put_bits(pb, 8, gain); + put_bits(pb, 7, cb1_idx); + put_bits(pb, 7, cb2_idx); + ff_subblock_synthesis(ractx, lpc_coefs, cba_idx, cb1_idx, cb2_idx, rms, + gain); +} + + +static int ra144_encode_frame(AVCodecContext *avctx, uint8_t *frame, + int buf_size, void *data) +{ + static const uint8_t sizes[LPC_ORDER] = {64, 32, 32, 16, 16, 8, 8, 8, 8, 4}; + static const uint8_t bit_sizes[LPC_ORDER] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2}; + RA144Context *ractx; + PutBitContext pb; + int32_t lpc_data[NBLOCKS * BLOCKSIZE]; + int32_t lpc_coefs[LPC_ORDER][MAX_LPC_ORDER]; + int shift[LPC_ORDER]; + int16_t block_coefs[NBLOCKS][LPC_ORDER]; + int lpc_refl[LPC_ORDER]; /**< reflection coefficients of the frame */ + unsigned int refl_rms[NBLOCKS]; /**< RMS of the reflection coefficients */ + int energy = 0; + int i, idx; + + if (buf_size < FRAMESIZE) { + av_log(avctx, AV_LOG_ERROR, "output buffer too small\n"); + return 0; + } + ractx = avctx->priv_data; + + /** + * Since the LPC coefficients are calculated on a frame centered over the + * fourth subframe, to encode a given frame, data from the next frame is + * needed. In each call to this function, the previous frame (whose data are + * saved in the encoder context) is encoded, and data from the current frame + * are saved in the encoder context to be used in the next function call. + */ + for (i = 0; i < (2 * BLOCKSIZE + BLOCKSIZE / 2); i++) { + lpc_data[i] = ractx->curr_block[BLOCKSIZE + BLOCKSIZE / 2 + i]; + energy += (lpc_data[i] * lpc_data[i]) >> 4; + } + for (i = 2 * BLOCKSIZE + BLOCKSIZE / 2; i < NBLOCKS * BLOCKSIZE; i++) { + lpc_data[i] = *((int16_t *)data + i - 2 * BLOCKSIZE - BLOCKSIZE / 2) >> + 2; + energy += (lpc_data[i] * lpc_data[i]) >> 4; + } + energy = ff_energy_tab[quantize(ff_t_sqrt(energy >> 5) >> 10, ff_energy_tab, + 32)]; + + ff_lpc_calc_coefs(&ractx->lpc_ctx, lpc_data, NBLOCKS * BLOCKSIZE, LPC_ORDER, + LPC_ORDER, 16, lpc_coefs, shift, AV_LPC_TYPE_LEVINSON, + 0, ORDER_METHOD_EST, 12, 0); + for (i = 0; i < LPC_ORDER; i++) + block_coefs[NBLOCKS - 1][i] = -(lpc_coefs[LPC_ORDER - 1][i] << + (12 - shift[LPC_ORDER - 1])); + + /** + * TODO: apply perceptual weighting of the input speech through bandwidth + * expansion of the LPC filter. + */ + + if (ff_eval_refl(lpc_refl, block_coefs[NBLOCKS - 1], avctx)) { + /** + * The filter is unstable: use the coefficients of the previous frame. + */ + ff_int_to_int16(block_coefs[NBLOCKS - 1], ractx->lpc_coef[1]); + ff_eval_refl(lpc_refl, block_coefs[NBLOCKS - 1], avctx); + } + init_put_bits(&pb, frame, buf_size); + for (i = 0; i < LPC_ORDER; i++) { + idx = quantize(lpc_refl[i], ff_lpc_refl_cb[i], sizes[i]); + put_bits(&pb, bit_sizes[i], idx); + lpc_refl[i] = ff_lpc_refl_cb[i][idx]; + } + ractx->lpc_refl_rms[0] = ff_rms(lpc_refl); + ff_eval_coefs(ractx->lpc_coef[0], lpc_refl); + refl_rms[0] = ff_interp(ractx, block_coefs[0], 1, 1, ractx->old_energy); + refl_rms[1] = ff_interp(ractx, block_coefs[1], 2, + energy <= ractx->old_energy, + ff_t_sqrt(energy * ractx->old_energy) >> 12); + refl_rms[2] = ff_interp(ractx, block_coefs[2], 3, 0, energy); + refl_rms[3] = ff_rescale_rms(ractx->lpc_refl_rms[0], energy); + ff_int_to_int16(block_coefs[NBLOCKS - 1], ractx->lpc_coef[0]); + put_bits(&pb, 5, quantize(energy, ff_energy_tab, 32)); + for (i = 0; i < NBLOCKS; i++) + ra144_encode_subblock(ractx, ractx->curr_block + i * BLOCKSIZE, + block_coefs[i], refl_rms[i], &pb); + flush_put_bits(&pb); + ractx->old_energy = energy; + ractx->lpc_refl_rms[1] = ractx->lpc_refl_rms[0]; + FFSWAP(unsigned int *, ractx->lpc_coef[0], ractx->lpc_coef[1]); + for (i = 0; i < NBLOCKS * BLOCKSIZE; i++) + ractx->curr_block[i] = *((int16_t *)data + i) >> 2; + return FRAMESIZE; +} + + +AVCodec ff_ra_144_encoder = +{ + "real_144", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_RA_144, + sizeof(RA144Context), + ra144_encode_init, + ra144_encode_frame, + ra144_encode_close, + .long_name = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K) encoder"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sbr.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sbr.h new file mode 100644 index 00000000..82a996fd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sbr.h @@ -0,0 +1,185 @@ +/* + * Spectral Band Replication definitions and structures + * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl ) + * Copyright (c) 2010 Alex Converse + * + * 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 + * Spectral Band Replication definitions and structures + * @author Robert Swain ( rob opendot cl ) + */ + +#ifndef AVCODEC_SBR_H +#define AVCODEC_SBR_H + +#include +#include "fft.h" +#include "aacps.h" + +/** + * Spectral Band Replication header - spectrum parameters that invoke a reset if they differ from the previous header. + */ +typedef struct { + uint8_t bs_start_freq; + uint8_t bs_stop_freq; + uint8_t bs_xover_band; + + /** + * @defgroup bs_header_extra_1 Variables associated with bs_header_extra_1 + * @{ + */ + uint8_t bs_freq_scale; + uint8_t bs_alter_scale; + uint8_t bs_noise_bands; + /** @} */ +} SpectrumParameters; + +#define SBR_SYNTHESIS_BUF_SIZE ((1280-128)*2) + +/** + * Spectral Band Replication per channel data + */ +typedef struct { + /** + * @defgroup aac_bitstream Main bitstream data variables + * @{ + */ + unsigned bs_frame_class; + unsigned bs_add_harmonic_flag; + unsigned bs_num_env; + uint8_t bs_freq_res[7]; + unsigned bs_num_noise; + uint8_t bs_df_env[5]; + uint8_t bs_df_noise[2]; + uint8_t bs_invf_mode[2][5]; + uint8_t bs_add_harmonic[48]; + unsigned bs_amp_res; + /** @} */ + + /** + * @defgroup state State variables + * @{ + */ + DECLARE_ALIGNED(16, float, synthesis_filterbank_samples)[SBR_SYNTHESIS_BUF_SIZE]; + DECLARE_ALIGNED(16, float, analysis_filterbank_samples) [1312]; + int synthesis_filterbank_samples_offset; + ///l_APrev and l_A + int e_a[2]; + ///Chirp factors + float bw_array[5]; + ///QMF values of the original signal + float W[2][32][32][2]; + ///QMF output of the HF adjustor + float Y[2][38][64][2]; + float g_temp[42][48]; + float q_temp[42][48]; + uint8_t s_indexmapped[8][48]; + ///Envelope scalefactors + float env_facs[6][48]; + ///Noise scalefactors + float noise_facs[3][5]; + ///Envelope time borders + uint8_t t_env[8]; + ///Envelope time border of the last envelope of the previous frame + uint8_t t_env_num_env_old; + ///Noise time borders + uint8_t t_q[3]; + unsigned f_indexnoise; + unsigned f_indexsine; + /** @} */ +} SBRData; + +/** + * Spectral Band Replication + */ +typedef struct { + int sample_rate; + int start; + int reset; + SpectrumParameters spectrum_params; + int bs_amp_res_header; + /** + * @defgroup bs_header_extra_2 variables associated with bs_header_extra_2 + * @{ + */ + unsigned bs_limiter_bands; + unsigned bs_limiter_gains; + unsigned bs_interpol_freq; + unsigned bs_smoothing_mode; + /** @} */ + unsigned bs_coupling; + unsigned k[5]; ///< k0, k1, k2 + ///kx', and kx respectively, kx is the first QMF subband where SBR is used. + ///kx' is its value from the previous frame + unsigned kx[2]; + ///M' and M respectively, M is the number of QMF subbands that use SBR. + unsigned m[2]; + ///The number of frequency bands in f_master + unsigned n_master; + SBRData data[2]; + PSContext ps; + ///N_Low and N_High respectively, the number of frequency bands for low and high resolution + unsigned n[2]; + ///Number of noise floor bands + unsigned n_q; + ///Number of limiter bands + unsigned n_lim; + ///The master QMF frequency grouping + uint16_t f_master[49]; + ///Frequency borders for low resolution SBR + uint16_t f_tablelow[25]; + ///Frequency borders for high resolution SBR + uint16_t f_tablehigh[49]; + ///Frequency borders for noise floors + uint16_t f_tablenoise[6]; + ///Frequency borders for the limiter + uint16_t f_tablelim[29]; + unsigned num_patches; + uint8_t patch_num_subbands[6]; + uint8_t patch_start_subband[6]; + ///QMF low frequency input to the HF generator + float X_low[32][40][2]; + ///QMF output of the HF generator + float X_high[64][40][2]; + ///QMF values of the reconstructed signal + DECLARE_ALIGNED(16, float, X)[2][2][38][64]; + ///Zeroth coefficient used to filter the subband signals + float alpha0[64][2]; + ///First coefficient used to filter the subband signals + float alpha1[64][2]; + ///Dequantized envelope scalefactors, remapped + float e_origmapped[7][48]; + ///Dequantized noise scalefactors, remapped + float q_mapped[7][48]; + ///Sinusoidal presence, remapped + uint8_t s_mapped[7][48]; + ///Estimated envelope + float e_curr[7][48]; + ///Amplitude adjusted noise scalefactors + float q_m[7][48]; + ///Sinusoidal levels + float s_m[7][48]; + float gain[7][48]; + DECLARE_ALIGNED(16, float, qmf_filter_scratch)[5][64]; + FFTContext mdct_ana; + FFTContext mdct; +} SpectralBandReplication; + +#endif /* AVCODEC_SBR_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sh4/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sh4/Makefile new file mode 100644 index 00000000..142cba47 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sh4/Makefile @@ -0,0 +1,3 @@ +OBJS += sh4/dsputil_align.o \ + sh4/dsputil_sh4.o \ + sh4/idct_sh4.o \ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sh4/dsputil_sh4.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sh4/dsputil_sh4.h new file mode 100644 index 00000000..2c1f77c7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sh4/dsputil_sh4.h @@ -0,0 +1,28 @@ +/* + * 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 + */ + +#ifndef AVCODEC_SH4_DSPUTIL_SH4_H +#define AVCODEC_SH4_DSPUTIL_SH4_H + +#include "libavcodec/avcodec.h" +#include "libavcodec/dsputil.h" + +void idct_sh4(DCTELEM *block); +void dsputil_init_align(DSPContext* c, AVCodecContext *avctx); + +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sipr.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sipr.c new file mode 100644 index 00000000..b96e3b90 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sipr.c @@ -0,0 +1,562 @@ +/* + * SIPR / ACELP.NET decoder + * + * Copyright (c) 2008 Vladimir Voroshilov + * Copyright (c) 2009 Vitor Sessak + * + * 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 + */ + +#include +#include + +#include "libavutil/mathematics.h" +#include "avcodec.h" +#define ALT_BITSTREAM_READER_LE +#include "get_bits.h" +#include "dsputil.h" + +#include "lsp.h" +#include "celp_math.h" +#include "acelp_vectors.h" +#include "acelp_pitch_delay.h" +#include "acelp_filters.h" +#include "celp_filters.h" + +#define MAX_SUBFRAME_COUNT 5 + +#include "sipr.h" +#include "siprdata.h" + +typedef struct { + const char *mode_name; + uint16_t bits_per_frame; + uint8_t subframe_count; + uint8_t frames_per_packet; + float pitch_sharp_factor; + + /* bitstream parameters */ + uint8_t number_of_fc_indexes; + uint8_t ma_predictor_bits; ///< size in bits of the switched MA predictor + + /** size in bits of the i-th stage vector of quantizer */ + uint8_t vq_indexes_bits[5]; + + /** size in bits of the adaptive-codebook index for every subframe */ + uint8_t pitch_delay_bits[5]; + + uint8_t gp_index_bits; + uint8_t fc_index_bits[10]; ///< size in bits of the fixed codebook indexes + uint8_t gc_index_bits; ///< size in bits of the gain codebook indexes +} SiprModeParam; + +static const SiprModeParam modes[MODE_COUNT] = { + [MODE_16k] = { + .mode_name = "16k", + .bits_per_frame = 160, + .subframe_count = SUBFRAME_COUNT_16k, + .frames_per_packet = 1, + .pitch_sharp_factor = 0.00, + + .number_of_fc_indexes = 10, + .ma_predictor_bits = 1, + .vq_indexes_bits = {7, 8, 7, 7, 7}, + .pitch_delay_bits = {9, 6}, + .gp_index_bits = 4, + .fc_index_bits = {4, 5, 4, 5, 4, 5, 4, 5, 4, 5}, + .gc_index_bits = 5 + }, + + [MODE_8k5] = { + .mode_name = "8k5", + .bits_per_frame = 152, + .subframe_count = 3, + .frames_per_packet = 1, + .pitch_sharp_factor = 0.8, + + .number_of_fc_indexes = 3, + .ma_predictor_bits = 0, + .vq_indexes_bits = {6, 7, 7, 7, 5}, + .pitch_delay_bits = {8, 5, 5}, + .gp_index_bits = 0, + .fc_index_bits = {9, 9, 9}, + .gc_index_bits = 7 + }, + + [MODE_6k5] = { + .mode_name = "6k5", + .bits_per_frame = 232, + .subframe_count = 3, + .frames_per_packet = 2, + .pitch_sharp_factor = 0.8, + + .number_of_fc_indexes = 3, + .ma_predictor_bits = 0, + .vq_indexes_bits = {6, 7, 7, 7, 5}, + .pitch_delay_bits = {8, 5, 5}, + .gp_index_bits = 0, + .fc_index_bits = {5, 5, 5}, + .gc_index_bits = 7 + }, + + [MODE_5k0] = { + .mode_name = "5k0", + .bits_per_frame = 296, + .subframe_count = 5, + .frames_per_packet = 2, + .pitch_sharp_factor = 0.85, + + .number_of_fc_indexes = 1, + .ma_predictor_bits = 0, + .vq_indexes_bits = {6, 7, 7, 7, 5}, + .pitch_delay_bits = {8, 5, 8, 5, 5}, + .gp_index_bits = 0, + .fc_index_bits = {10}, + .gc_index_bits = 7 + } +}; + +const float ff_pow_0_5[] = { + 1.0/(1 << 1), 1.0/(1 << 2), 1.0/(1 << 3), 1.0/(1 << 4), + 1.0/(1 << 5), 1.0/(1 << 6), 1.0/(1 << 7), 1.0/(1 << 8), + 1.0/(1 << 9), 1.0/(1 << 10), 1.0/(1 << 11), 1.0/(1 << 12), + 1.0/(1 << 13), 1.0/(1 << 14), 1.0/(1 << 15), 1.0/(1 << 16) +}; + +static void dequant(float *out, const int *idx, const float *cbs[]) +{ + int i; + int stride = 2; + int num_vec = 5; + + for (i = 0; i < num_vec; i++) + memcpy(out + stride*i, cbs[i] + stride*idx[i], stride*sizeof(float)); + +} + +static void lsf_decode_fp(float *lsfnew, float *lsf_history, + const SiprParameters *parm) +{ + int i; + float lsf_tmp[LP_FILTER_ORDER]; + + dequant(lsf_tmp, parm->vq_indexes, lsf_codebooks); + + for (i = 0; i < LP_FILTER_ORDER; i++) + lsfnew[i] = lsf_history[i] * 0.33 + lsf_tmp[i] + mean_lsf[i]; + + ff_sort_nearly_sorted_floats(lsfnew, LP_FILTER_ORDER - 1); + + /* Note that a minimum distance is not enforced between the last value and + the previous one, contrary to what is done in ff_acelp_reorder_lsf() */ + ff_set_min_dist_lsf(lsfnew, LSFQ_DIFF_MIN, LP_FILTER_ORDER - 1); + lsfnew[9] = FFMIN(lsfnew[LP_FILTER_ORDER - 1], 1.3 * M_PI); + + memcpy(lsf_history, lsf_tmp, LP_FILTER_ORDER * sizeof(*lsf_history)); + + for (i = 0; i < LP_FILTER_ORDER - 1; i++) + lsfnew[i] = cos(lsfnew[i]); + lsfnew[LP_FILTER_ORDER - 1] *= 6.153848 / M_PI; +} + +/** Apply pitch lag to the fixed vector (AMR section 6.1.2). */ +static void pitch_sharpening(int pitch_lag_int, float beta, + float *fixed_vector) +{ + int i; + + for (i = pitch_lag_int; i < SUBFR_SIZE; i++) + fixed_vector[i] += beta * fixed_vector[i - pitch_lag_int]; +} + +/** + * Extract decoding parameters from the input bitstream. + * @param parms parameters structure + * @param pgb pointer to initialized GetBitContext structure + */ +static void decode_parameters(SiprParameters* parms, GetBitContext *pgb, + const SiprModeParam *p) +{ + int i, j; + + parms->ma_pred_switch = get_bits(pgb, p->ma_predictor_bits); + + for (i = 0; i < 5; i++) + parms->vq_indexes[i] = get_bits(pgb, p->vq_indexes_bits[i]); + + for (i = 0; i < p->subframe_count; i++) { + parms->pitch_delay[i] = get_bits(pgb, p->pitch_delay_bits[i]); + parms->gp_index[i] = get_bits(pgb, p->gp_index_bits); + + for (j = 0; j < p->number_of_fc_indexes; j++) + parms->fc_indexes[i][j] = get_bits(pgb, p->fc_index_bits[j]); + + parms->gc_index[i] = get_bits(pgb, p->gc_index_bits); + } +} + +static void sipr_decode_lp(float *lsfnew, const float *lsfold, float *Az, + int num_subfr) +{ + double lsfint[LP_FILTER_ORDER]; + int i,j; + float t, t0 = 1.0 / num_subfr; + + t = t0 * 0.5; + for (i = 0; i < num_subfr; i++) { + for (j = 0; j < LP_FILTER_ORDER; j++) + lsfint[j] = lsfold[j] * (1 - t) + t * lsfnew[j]; + + ff_amrwb_lsp2lpc(lsfint, Az, LP_FILTER_ORDER); + Az += LP_FILTER_ORDER; + t += t0; + } +} + +/** + * Evaluate the adaptive impulse response. + */ +static void eval_ir(const float *Az, int pitch_lag, float *freq, + float pitch_sharp_factor) +{ + float tmp1[SUBFR_SIZE+1], tmp2[LP_FILTER_ORDER+1]; + int i; + + tmp1[0] = 1.; + for (i = 0; i < LP_FILTER_ORDER; i++) { + tmp1[i+1] = Az[i] * ff_pow_0_55[i]; + tmp2[i ] = Az[i] * ff_pow_0_7 [i]; + } + memset(tmp1 + 11, 0, 37 * sizeof(float)); + + ff_celp_lp_synthesis_filterf(freq, tmp2, tmp1, SUBFR_SIZE, + LP_FILTER_ORDER); + + pitch_sharpening(pitch_lag, pitch_sharp_factor, freq); +} + +/** + * Evaluate the convolution of a vector with a sparse vector. + */ +static void convolute_with_sparse(float *out, const AMRFixed *pulses, + const float *shape, int length) +{ + int i, j; + + memset(out, 0, length*sizeof(float)); + for (i = 0; i < pulses->n; i++) + for (j = pulses->x[i]; j < length; j++) + out[j] += pulses->y[i] * shape[j - pulses->x[i]]; +} + +/** + * Apply postfilter, very similar to AMR one. + */ +static void postfilter_5k0(SiprContext *ctx, const float *lpc, float *samples) +{ + float buf[SUBFR_SIZE + LP_FILTER_ORDER]; + float *pole_out = buf + LP_FILTER_ORDER; + float lpc_n[LP_FILTER_ORDER]; + float lpc_d[LP_FILTER_ORDER]; + int i; + + for (i = 0; i < LP_FILTER_ORDER; i++) { + lpc_d[i] = lpc[i] * ff_pow_0_75[i]; + lpc_n[i] = lpc[i] * ff_pow_0_5 [i]; + }; + + memcpy(pole_out - LP_FILTER_ORDER, ctx->postfilter_mem, + LP_FILTER_ORDER*sizeof(float)); + + ff_celp_lp_synthesis_filterf(pole_out, lpc_d, samples, SUBFR_SIZE, + LP_FILTER_ORDER); + + memcpy(ctx->postfilter_mem, pole_out + SUBFR_SIZE - LP_FILTER_ORDER, + LP_FILTER_ORDER*sizeof(float)); + + ff_tilt_compensation(&ctx->tilt_mem, 0.4, pole_out, SUBFR_SIZE); + + memcpy(pole_out - LP_FILTER_ORDER, ctx->postfilter_mem5k0, + LP_FILTER_ORDER*sizeof(*pole_out)); + + memcpy(ctx->postfilter_mem5k0, pole_out + SUBFR_SIZE - LP_FILTER_ORDER, + LP_FILTER_ORDER*sizeof(*pole_out)); + + ff_celp_lp_zero_synthesis_filterf(samples, lpc_n, pole_out, SUBFR_SIZE, + LP_FILTER_ORDER); + +} + +static void decode_fixed_sparse(AMRFixed *fixed_sparse, const int16_t *pulses, + SiprMode mode, int low_gain) +{ + int i; + + switch (mode) { + case MODE_6k5: + for (i = 0; i < 3; i++) { + fixed_sparse->x[i] = 3 * (pulses[i] & 0xf) + i; + fixed_sparse->y[i] = pulses[i] & 0x10 ? -1 : 1; + } + fixed_sparse->n = 3; + break; + case MODE_8k5: + for (i = 0; i < 3; i++) { + fixed_sparse->x[2*i ] = 3 * ((pulses[i] >> 4) & 0xf) + i; + fixed_sparse->x[2*i + 1] = 3 * ( pulses[i] & 0xf) + i; + + fixed_sparse->y[2*i ] = (pulses[i] & 0x100) ? -1.0: 1.0; + + fixed_sparse->y[2*i + 1] = + (fixed_sparse->x[2*i + 1] < fixed_sparse->x[2*i]) ? + -fixed_sparse->y[2*i ] : fixed_sparse->y[2*i]; + } + + fixed_sparse->n = 6; + break; + case MODE_5k0: + default: + if (low_gain) { + int offset = (pulses[0] & 0x200) ? 2 : 0; + int val = pulses[0]; + + for (i = 0; i < 3; i++) { + int index = (val & 0x7) * 6 + 4 - i*2; + + fixed_sparse->y[i] = (offset + index) & 0x3 ? -1 : 1; + fixed_sparse->x[i] = index; + + val >>= 3; + } + fixed_sparse->n = 3; + } else { + int pulse_subset = (pulses[0] >> 8) & 1; + + fixed_sparse->x[0] = ((pulses[0] >> 4) & 15) * 3 + pulse_subset; + fixed_sparse->x[1] = ( pulses[0] & 15) * 3 + pulse_subset + 1; + + fixed_sparse->y[0] = pulses[0] & 0x200 ? -1 : 1; + fixed_sparse->y[1] = -fixed_sparse->y[0]; + fixed_sparse->n = 2; + } + break; + } +} + +static void decode_frame(SiprContext *ctx, SiprParameters *params, + float *out_data) +{ + int i, j; + int subframe_count = modes[ctx->mode].subframe_count; + int frame_size = subframe_count * SUBFR_SIZE; + float Az[LP_FILTER_ORDER * MAX_SUBFRAME_COUNT]; + float *excitation; + float ir_buf[SUBFR_SIZE + LP_FILTER_ORDER]; + float lsf_new[LP_FILTER_ORDER]; + float *impulse_response = ir_buf + LP_FILTER_ORDER; + float *synth = ctx->synth_buf + 16; // 16 instead of LP_FILTER_ORDER for + // memory alignment + int t0_first = 0; + AMRFixed fixed_cb; + + memset(ir_buf, 0, LP_FILTER_ORDER * sizeof(float)); + lsf_decode_fp(lsf_new, ctx->lsf_history, params); + + sipr_decode_lp(lsf_new, ctx->lsp_history, Az, subframe_count); + + memcpy(ctx->lsp_history, lsf_new, LP_FILTER_ORDER * sizeof(float)); + + excitation = ctx->excitation + PITCH_DELAY_MAX + L_INTERPOL; + + for (i = 0; i < subframe_count; i++) { + float *pAz = Az + i*LP_FILTER_ORDER; + float fixed_vector[SUBFR_SIZE]; + int T0,T0_frac; + float pitch_gain, gain_code, avg_energy; + + ff_decode_pitch_lag(&T0, &T0_frac, params->pitch_delay[i], t0_first, i, + ctx->mode == MODE_5k0, 6); + + if (i == 0 || (i == 2 && ctx->mode == MODE_5k0)) + t0_first = T0; + + ff_acelp_interpolatef(excitation, excitation - T0 + (T0_frac <= 0), + ff_b60_sinc, 6, + 2 * ((2 + T0_frac)%3 + 1), LP_FILTER_ORDER, + SUBFR_SIZE); + + decode_fixed_sparse(&fixed_cb, params->fc_indexes[i], ctx->mode, + ctx->past_pitch_gain < 0.8); + + eval_ir(pAz, T0, impulse_response, modes[ctx->mode].pitch_sharp_factor); + + convolute_with_sparse(fixed_vector, &fixed_cb, impulse_response, + SUBFR_SIZE); + + avg_energy = + (0.01 + ff_dot_productf(fixed_vector, fixed_vector, SUBFR_SIZE))/ + SUBFR_SIZE; + + ctx->past_pitch_gain = pitch_gain = gain_cb[params->gc_index[i]][0]; + + gain_code = ff_amr_set_fixed_gain(gain_cb[params->gc_index[i]][1], + avg_energy, ctx->energy_history, + 34 - 15.0/(0.05*M_LN10/M_LN2), + pred); + + ff_weighted_vector_sumf(excitation, excitation, fixed_vector, + pitch_gain, gain_code, SUBFR_SIZE); + + pitch_gain *= 0.5 * pitch_gain; + pitch_gain = FFMIN(pitch_gain, 0.4); + + ctx->gain_mem = 0.7 * ctx->gain_mem + 0.3 * pitch_gain; + ctx->gain_mem = FFMIN(ctx->gain_mem, pitch_gain); + gain_code *= ctx->gain_mem; + + for (j = 0; j < SUBFR_SIZE; j++) + fixed_vector[j] = excitation[j] - gain_code * fixed_vector[j]; + + if (ctx->mode == MODE_5k0) { + postfilter_5k0(ctx, pAz, fixed_vector); + + ff_celp_lp_synthesis_filterf(ctx->postfilter_syn5k0 + LP_FILTER_ORDER + i*SUBFR_SIZE, + pAz, excitation, SUBFR_SIZE, + LP_FILTER_ORDER); + } + + ff_celp_lp_synthesis_filterf(synth + i*SUBFR_SIZE, pAz, fixed_vector, + SUBFR_SIZE, LP_FILTER_ORDER); + + excitation += SUBFR_SIZE; + } + + memcpy(synth - LP_FILTER_ORDER, synth + frame_size - LP_FILTER_ORDER, + LP_FILTER_ORDER * sizeof(float)); + + if (ctx->mode == MODE_5k0) { + for (i = 0; i < subframe_count; i++) { + float energy = ff_dot_productf(ctx->postfilter_syn5k0 + LP_FILTER_ORDER + i*SUBFR_SIZE, + ctx->postfilter_syn5k0 + LP_FILTER_ORDER + i*SUBFR_SIZE, + SUBFR_SIZE); + ff_adaptive_gain_control(&synth[i * SUBFR_SIZE], + &synth[i * SUBFR_SIZE], energy, + SUBFR_SIZE, 0.9, &ctx->postfilter_agc); + } + + memcpy(ctx->postfilter_syn5k0, ctx->postfilter_syn5k0 + frame_size, + LP_FILTER_ORDER*sizeof(float)); + } + memcpy(ctx->excitation, excitation - PITCH_DELAY_MAX - L_INTERPOL, + (PITCH_DELAY_MAX + L_INTERPOL) * sizeof(float)); + + ff_acelp_apply_order_2_transfer_function(out_data, synth, + (const float[2]) {-1.99997 , 1.000000000}, + (const float[2]) {-1.93307352, 0.935891986}, + 0.939805806, + ctx->highpass_filt_mem, + frame_size); +} + +static av_cold int sipr_decoder_init(AVCodecContext * avctx) +{ + SiprContext *ctx = avctx->priv_data; + int i; + + if (avctx->bit_rate > 12200) ctx->mode = MODE_16k; + else if (avctx->bit_rate > 7500 ) ctx->mode = MODE_8k5; + else if (avctx->bit_rate > 5750 ) ctx->mode = MODE_6k5; + else ctx->mode = MODE_5k0; + + av_log(avctx, AV_LOG_DEBUG, "Mode: %s\n", modes[ctx->mode].mode_name); + + if (ctx->mode == MODE_16k) + ff_sipr_init_16k(ctx); + + for (i = 0; i < LP_FILTER_ORDER; i++) + ctx->lsp_history[i] = cos((i+1) * M_PI / (LP_FILTER_ORDER + 1)); + + for (i = 0; i < 4; i++) + ctx->energy_history[i] = -14; + + avctx->sample_fmt = AV_SAMPLE_FMT_FLT; + + dsputil_init(&ctx->dsp, avctx); + + return 0; +} + +static int sipr_decode_frame(AVCodecContext *avctx, void *datap, + int *data_size, AVPacket *avpkt) +{ + SiprContext *ctx = avctx->priv_data; + const uint8_t *buf=avpkt->data; + SiprParameters parm; + const SiprModeParam *mode_par = &modes[ctx->mode]; + GetBitContext gb; + float *data = datap; + int subframe_size = ctx->mode == MODE_16k ? L_SUBFR_16k : SUBFR_SIZE; + int i; + + ctx->avctx = avctx; + if (avpkt->size < (mode_par->bits_per_frame >> 3)) { + av_log(avctx, AV_LOG_ERROR, + "Error processing packet: packet size (%d) too small\n", + avpkt->size); + + *data_size = 0; + return -1; + } + if (*data_size < subframe_size * mode_par->subframe_count * sizeof(float)) { + av_log(avctx, AV_LOG_ERROR, + "Error processing packet: output buffer (%d) too small\n", + *data_size); + + *data_size = 0; + return -1; + } + + init_get_bits(&gb, buf, mode_par->bits_per_frame); + + for (i = 0; i < mode_par->frames_per_packet; i++) { + decode_parameters(&parm, &gb, mode_par); + + if (ctx->mode == MODE_16k) + ff_sipr_decode_frame_16k(ctx, &parm, data); + else + decode_frame(ctx, &parm, data); + + data += subframe_size * mode_par->subframe_count; + } + + *data_size = mode_par->frames_per_packet * subframe_size * + mode_par->subframe_count * sizeof(float); + + return mode_par->bits_per_frame >> 3; +} + +AVCodec ff_sipr_decoder = { + "sipr", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_SIPR, + sizeof(SiprContext), + sipr_decoder_init, + NULL, + NULL, + sipr_decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("RealAudio SIPR / ACELP.NET"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sipr.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sipr.h new file mode 100644 index 00000000..66e76964 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sipr.h @@ -0,0 +1,107 @@ +/* + * SIPR / ACELP.NET decoder + * + * Copyright (c) 2008 Vladimir Voroshilov + * Copyright (c) 2009 Vitor Sessak + * + * 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 + */ + +#ifndef AVCODEC_SIPR_H +#define AVCODEC_SIPR_H + +#include "avcodec.h" +#include "dsputil.h" +#include "acelp_pitch_delay.h" + +#define LP_FILTER_ORDER_16k 16 +#define L_SUBFR_16k 80 +#define PITCH_MIN 30 +#define PITCH_MAX 281 + +#define LSFQ_DIFF_MIN (0.0125 * M_PI) + +#define LP_FILTER_ORDER 10 + +/** Number of past samples needed for excitation interpolation */ +#define L_INTERPOL (LP_FILTER_ORDER + 1) + +/** Subframe size for all modes except 16k */ +#define SUBFR_SIZE 48 + +#define SUBFRAME_COUNT_16k 2 + +typedef enum { + MODE_16k, + MODE_8k5, + MODE_6k5, + MODE_5k0, + MODE_COUNT +} SiprMode; + +typedef struct { + AVCodecContext *avctx; + DSPContext dsp; + + SiprMode mode; + + float past_pitch_gain; + float lsf_history[LP_FILTER_ORDER_16k]; + + float excitation[L_INTERPOL + PITCH_MAX + 2 * L_SUBFR_16k]; + + DECLARE_ALIGNED(16, float, synth_buf)[LP_FILTER_ORDER + 5*SUBFR_SIZE + 6]; + + float lsp_history[LP_FILTER_ORDER]; + float gain_mem; + float energy_history[4]; + float highpass_filt_mem[2]; + float postfilter_mem[PITCH_DELAY_MAX + LP_FILTER_ORDER]; + + /* 5k0 */ + float tilt_mem; + float postfilter_agc; + float postfilter_mem5k0[PITCH_DELAY_MAX + LP_FILTER_ORDER]; + float postfilter_syn5k0[LP_FILTER_ORDER + SUBFR_SIZE*5]; + + /* 16k */ + int pitch_lag_prev; + float iir_mem[LP_FILTER_ORDER_16k+1]; + float filt_buf[2][LP_FILTER_ORDER_16k+1]; + float *filt_mem[2]; + float mem_preemph[LP_FILTER_ORDER_16k]; + float synth[LP_FILTER_ORDER_16k]; + double lsp_history_16k[16]; +} SiprContext; + +typedef struct { + int ma_pred_switch; ///< switched moving average predictor + int vq_indexes[5]; + int pitch_delay[5]; ///< pitch delay + int gp_index[5]; ///< adaptive-codebook gain indexes + int16_t fc_indexes[5][10]; ///< fixed-codebook indexes + int gc_index[5]; ///< fixed-codebook gain indexes +} SiprParameters; + +extern const float ff_pow_0_5[16]; + +void ff_sipr_init_16k(SiprContext *ctx); + +void ff_sipr_decode_frame_16k(SiprContext *ctx, SiprParameters *params, + float *out_data); + +#endif /* AVCODEC_SIPR_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sipr16k.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sipr16k.c new file mode 100644 index 00000000..7fb92529 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sipr16k.c @@ -0,0 +1,280 @@ +/* + * SIPR decoder for the 16k mode + * + * Copyright (c) 2008 Vladimir Voroshilov + * Copyright (c) 2009 Vitor Sessak + * + * 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 + */ + +#include + +#include "sipr.h" +#include "libavutil/mathematics.h" +#include "lsp.h" +#include "celp_math.h" +#include "acelp_vectors.h" +#include "acelp_pitch_delay.h" +#include "acelp_filters.h" +#include "celp_filters.h" + +#include "sipr16kdata.h" + +/** + * Convert an lsf vector into an lsp vector. + * + * @param lsf input lsf vector + * @param lsp output lsp vector + */ +static void lsf2lsp(const float *lsf, double *lsp) +{ + int i; + + for (i = 0; i < LP_FILTER_ORDER_16k; i++) + lsp[i] = cosf(lsf[i]); +} + +static void dequant(float *out, const int *idx, const float *cbs[]) +{ + int i; + + for (i = 0; i < 4; i++) + memcpy(out + 3*i, cbs[i] + 3*idx[i], 3*sizeof(float)); + + memcpy(out + 12, cbs[4] + 4*idx[4], 4*sizeof(float)); +} + +static void lsf_decode_fp_16k(float* lsf_history, float* isp_new, + const int* parm, int ma_pred) +{ + int i; + float isp_q[LP_FILTER_ORDER_16k]; + + dequant(isp_q, parm, lsf_codebooks_16k); + + for (i = 0; i < LP_FILTER_ORDER_16k; i++) { + isp_new[i] = (1 - qu[ma_pred]) * isp_q[i] + + qu[ma_pred] * lsf_history[i] + + mean_lsf_16k[i]; + } + + memcpy(lsf_history, isp_q, LP_FILTER_ORDER_16k * sizeof(float)); +} + +static int dec_delay3_1st(int index) +{ + if (index < 390) { + return index + 88; + } else + return 3 * index - 690; +} + +static int dec_delay3_2nd(int index, int pit_min, int pit_max, + int pitch_lag_prev) +{ + if (index < 62) { + int pitch_delay_min = av_clip(pitch_lag_prev - 10, + pit_min, pit_max - 19); + return 3 * pitch_delay_min + index - 2; + } else + return 3 * pitch_lag_prev; +} + +static void postfilter(float *out_data, float* synth, float* iir_mem, + float* filt_mem[2], float* mem_preemph) +{ + float buf[30 + LP_FILTER_ORDER_16k]; + float *tmpbuf = buf + LP_FILTER_ORDER_16k; + float s; + int i; + + for (i = 0; i < LP_FILTER_ORDER_16k; i++) + filt_mem[0][i] = iir_mem[i] * ff_pow_0_5[i]; + + memcpy(tmpbuf - LP_FILTER_ORDER_16k, mem_preemph, + LP_FILTER_ORDER_16k*sizeof(*buf)); + + ff_celp_lp_synthesis_filterf(tmpbuf, filt_mem[1], synth, 30, + LP_FILTER_ORDER_16k); + + memcpy(synth - LP_FILTER_ORDER_16k, mem_preemph, + LP_FILTER_ORDER_16k * sizeof(*synth)); + + ff_celp_lp_synthesis_filterf(synth, filt_mem[0], synth, 30, + LP_FILTER_ORDER_16k); + + memcpy(out_data + 30 - LP_FILTER_ORDER_16k, + synth + 30 - LP_FILTER_ORDER_16k, + LP_FILTER_ORDER_16k * sizeof(*synth)); + + ff_celp_lp_synthesis_filterf(out_data + 30, filt_mem[0], + synth + 30, 2 * L_SUBFR_16k - 30, + LP_FILTER_ORDER_16k); + + + memcpy(mem_preemph, out_data + 2*L_SUBFR_16k - LP_FILTER_ORDER_16k, + LP_FILTER_ORDER_16k * sizeof(*synth)); + + FFSWAP(float *, filt_mem[0], filt_mem[1]); + for (i = 0, s = 0; i < 30; i++, s += 1.0/30) + out_data[i] = tmpbuf[i] + s * (synth[i] - tmpbuf[i]); +} + +/** + * Floating point version of ff_acelp_lp_decode(). + */ +static void acelp_lp_decodef(float *lp_1st, float *lp_2nd, + const double *lsp_2nd, const double *lsp_prev) +{ + double lsp_1st[LP_FILTER_ORDER_16k]; + int i; + + /* LSP values for first subframe (3.2.5 of G.729, Equation 24) */ + for (i = 0; i < LP_FILTER_ORDER_16k; i++) + lsp_1st[i] = (lsp_2nd[i] + lsp_prev[i]) * 0.5; + + ff_acelp_lspd2lpc(lsp_1st, lp_1st, LP_FILTER_ORDER_16k >> 1); + + /* LSP values for second subframe (3.2.5 of G.729) */ + ff_acelp_lspd2lpc(lsp_2nd, lp_2nd, LP_FILTER_ORDER_16k >> 1); +} + +/** + * Floating point version of ff_acelp_decode_gain_code(). + */ +static float acelp_decode_gain_codef(float gain_corr_factor, const float *fc_v, + float mr_energy, const float *quant_energy, + const float *ma_prediction_coeff, + int subframe_size, int ma_pred_order) +{ + mr_energy += + ff_dot_productf(quant_energy, ma_prediction_coeff, ma_pred_order); + + mr_energy = gain_corr_factor * exp(M_LN10 / 20. * mr_energy) / + sqrt((0.01 + ff_dot_productf(fc_v, fc_v, subframe_size))); + return mr_energy; +} + +#define DIVIDE_BY_3(x) ((x) * 10923 >> 15) + +void ff_sipr_decode_frame_16k(SiprContext *ctx, SiprParameters *params, + float *out_data) +{ + int frame_size = SUBFRAME_COUNT_16k * L_SUBFR_16k; + float *synth = ctx->synth_buf + LP_FILTER_ORDER_16k; + float lsf_new[LP_FILTER_ORDER_16k]; + double lsp_new[LP_FILTER_ORDER_16k]; + float Az[2][LP_FILTER_ORDER_16k]; + float fixed_vector[L_SUBFR_16k]; + float pitch_fac, gain_code; + + int i; + int pitch_delay_3x; + + float *excitation = ctx->excitation + 292; + + lsf_decode_fp_16k(ctx->lsf_history, lsf_new, params->vq_indexes, + params->ma_pred_switch); + + ff_set_min_dist_lsf(lsf_new, LSFQ_DIFF_MIN / 2, LP_FILTER_ORDER_16k); + + lsf2lsp(lsf_new, lsp_new); + + acelp_lp_decodef(Az[0], Az[1], lsp_new, ctx->lsp_history_16k); + + memcpy(ctx->lsp_history_16k, lsp_new, LP_FILTER_ORDER_16k * sizeof(double)); + + memcpy(synth - LP_FILTER_ORDER_16k, ctx->synth, + LP_FILTER_ORDER_16k * sizeof(*synth)); + + for (i = 0; i < SUBFRAME_COUNT_16k; i++) { + int i_subfr = i * L_SUBFR_16k; + AMRFixed f; + float gain_corr_factor; + int pitch_delay_int; + int pitch_delay_frac; + + if (!i) { + pitch_delay_3x = dec_delay3_1st(params->pitch_delay[i]); + } else + pitch_delay_3x = dec_delay3_2nd(params->pitch_delay[i], + PITCH_MIN, PITCH_MAX, + ctx->pitch_lag_prev); + + pitch_fac = gain_pitch_cb_16k[params->gp_index[i]]; + f.pitch_fac = FFMIN(pitch_fac, 1.0); + f.pitch_lag = DIVIDE_BY_3(pitch_delay_3x+1); + ctx->pitch_lag_prev = f.pitch_lag; + + pitch_delay_int = DIVIDE_BY_3(pitch_delay_3x + 2); + pitch_delay_frac = pitch_delay_3x + 2 - 3*pitch_delay_int; + + ff_acelp_interpolatef(&excitation[i_subfr], + &excitation[i_subfr] - pitch_delay_int + 1, + sinc_win, 3, pitch_delay_frac + 1, + LP_FILTER_ORDER, L_SUBFR_16k); + + + memset(fixed_vector, 0, sizeof(fixed_vector)); + + ff_decode_10_pulses_35bits(params->fc_indexes[i], &f, + ff_fc_4pulses_8bits_tracks_13, 5, 4); + + ff_set_fixed_vector(fixed_vector, &f, 1.0, L_SUBFR_16k); + + gain_corr_factor = gain_cb_16k[params->gc_index[i]]; + gain_code = gain_corr_factor * + acelp_decode_gain_codef(sqrt(L_SUBFR_16k), fixed_vector, + 19.0 - 15.0/(0.05*M_LN10/M_LN2), + pred_16k, ctx->energy_history, + L_SUBFR_16k, 2); + + ctx->energy_history[1] = ctx->energy_history[0]; + ctx->energy_history[0] = 20.0 * log10f(gain_corr_factor); + + ff_weighted_vector_sumf(&excitation[i_subfr], &excitation[i_subfr], + fixed_vector, pitch_fac, + gain_code, L_SUBFR_16k); + + ff_celp_lp_synthesis_filterf(synth + i_subfr, Az[i], + &excitation[i_subfr], L_SUBFR_16k, + LP_FILTER_ORDER_16k); + + } + memcpy(ctx->synth, synth + frame_size - LP_FILTER_ORDER_16k, + LP_FILTER_ORDER_16k * sizeof(*synth)); + + memmove(ctx->excitation, ctx->excitation + 2 * L_SUBFR_16k, + (L_INTERPOL+PITCH_MAX) * sizeof(float)); + + postfilter(out_data, synth, ctx->iir_mem, ctx->filt_mem, ctx->mem_preemph); + + memcpy(ctx->iir_mem, Az[1], LP_FILTER_ORDER_16k * sizeof(float)); +} + +void ff_sipr_init_16k(SiprContext *ctx) +{ + int i; + + for (i = 0; i < LP_FILTER_ORDER_16k; i++) + ctx->lsp_history_16k[i] = cos((i + 1) * M_PI/(LP_FILTER_ORDER_16k + 1)); + + ctx->filt_mem[0] = ctx->filt_buf[0]; + ctx->filt_mem[1] = ctx->filt_buf[1]; + + ctx->pitch_lag_prev = 180; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sipr16kdata.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sipr16kdata.h new file mode 100644 index 00000000..96bf0e96 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sipr16kdata.h @@ -0,0 +1,533 @@ +/* + * SIPR decoder for the 16k mode + * + * Copyright (c) 2008 Vladimir Voroshilov + * Copyright (c) 2009 Vitor Sessak + * + * 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 + */ + +#ifndef AVCODEC_SIPR16KDATA_H +#define AVCODEC_SIPR16KDATA_H + +static const float pred_16k[2] = {0.8, 0.6}; +static const float qu[2] = { 0.12, 0.5}; + +static const float gain_cb_16k[32] = { + 0.07499, 0.10593, 0.14125, 0.18836, + 0.23714, 0.28184, 0.32734, 0.37584, + 0.42170, 0.47315, 0.53088, 0.59566, + 0.66834, 0.74989, 0.84140, 0.94406, + 1.05925, 1.18850, 1.33352, 1.49624, + 1.67880, 1.88365, 2.11349, 2.37137, + 2.66073, 3.05492, 3.54813, 4.21697, + 5.30884, 7.07946, 9.44061, 13.33521, +}; + +static const float gain_pitch_cb_16k[16] = { + 0.00, 0.2, 0.40, 0.5, 0.60, 0.7, 0.75, 0.8, + 0.85, 0.9, 0.95, 1.0, 1.05, 1.1, 1.15, 1.2, +}; + + +static const float mean_lsf_16k[16] = { + 0.131554, 0.246615, 0.435896, 0.644419, + 0.827810, 1.017876, 1.198910, 1.379159, + 1.562157, 1.736908, 1.940719, 2.131963, + 2.347162, 2.521521, 2.717870, 2.847068 +}; + +/** + * Hamming windowed sinc function, like in AMR + */ +static const float sinc_win[40] = { + 0.874475, 0.755101, 0.455962, 0.118807, -0.114223, -0.176778, + -0.101923, 0.015553, 0.086555, 0.078193, 0.018660, -0.037513, + -0.052733, -0.027459, 0.009967, 0.030278, 0.024050, 0.003055, + -0.013862, -0.016162, -0.006725, 0.004212, 0.008634, 0.005721, + -0.000000, -0.003710, -0.003690, -0.001228, 0.001409, 0.002610, +}; + +static const float lsf_cb1_16k[128][3] = { + {-0.089990, -0.172485, -0.203391}, {-0.094710, -0.178687, -0.134483}, + {-0.056398, -0.131952, -0.154500}, {-0.051362, -0.128138, -0.198549}, + {-0.061700, -0.142830, -0.251623}, {-0.041512, -0.115637, -0.229420}, + {-0.036544, -0.107512, -0.173125}, {-0.024158, -0.088450, -0.204144}, + {-0.038690, -0.103368, -0.132674}, {-0.056954, -0.128472, -0.104669}, + {-0.020963, -0.076785, -0.163199}, {-0.012952, -0.077249, -0.128385}, + {-0.032787, -0.097044, -0.093967}, {-0.035214, -0.053838, -0.111940}, + {-0.013850, -0.036926, -0.139328}, {-0.004956, -0.065092, -0.087709}, + {-0.065354, -0.065595, -0.079064}, {-0.023627, -0.081457, -0.054195}, + {-0.027335, -0.035244, -0.068034}, { 0.016555, -0.047075, -0.128286}, + { 0.021066, -0.037252, -0.092041}, { 0.014681, -0.043044, -0.057739}, + {-0.008493, -0.008143, -0.102486}, {-0.002303, -0.061540, -0.022952}, + {-0.006061, -0.014278, -0.033652}, {-0.005276, 0.011246, -0.062762}, + { 0.043411, -0.006303, -0.063730}, { 0.035885, -0.010052, -0.115290}, + { 0.030628, -0.031538, -0.017807}, { 0.022345, 0.028210, -0.032335}, + { 0.026535, 0.027536, -0.091150}, {-0.003365, -0.008077, 0.015687}, + {-0.026013, 0.017493, -0.010355}, { 0.059069, 0.010634, -0.007530}, + { 0.044038, -0.019424, 0.030453}, {-0.036065, -0.034215, -0.007758}, + { 0.022486, 0.042543, 0.027870}, {-0.049985, -0.016085, 0.021768}, + {-0.021715, 0.021168, 0.052076}, {-0.004243, -0.061228, 0.027640}, + {-0.033950, -0.017287, 0.064656}, { 0.016151, 0.000727, 0.062757}, + {-0.063456, -0.043152, 0.056707}, {-0.067715, 0.006126, 0.058178}, + {-0.038931, 0.051673, 0.030636}, {-0.073017, -0.074716, 0.026387}, + {-0.039893, -0.104629, 0.039616}, {-0.073179, -0.074601, 0.082069}, + {-0.066154, -0.027180, 0.099439}, {-0.075167, -0.121149, 0.071938}, + {-0.030382, -0.092582, 0.091067}, {-0.084519, -0.137542, 0.023626}, + {-0.060956, -0.121259, -0.015264}, {-0.030069, -0.093823, -0.008692}, + {-0.063564, -0.065225, -0.025820}, {-0.052074, -0.117595, -0.059689}, + {-0.091652, -0.165173, -0.045573}, {-0.070167, -0.121342, 0.131707}, + {-0.061024, -0.005833, -0.051035}, { 0.007837, -0.051816, 0.074575}, + {-0.070643, -0.053927, 0.149498}, {-0.014358, -0.066681, 0.139708}, + {-0.058186, 0.029576, 0.092923}, {-0.023371, 0.007058, 0.112484}, + {-0.057969, 0.022786, 0.148420}, { 0.029439, -0.017673, 0.121423}, + {-0.015811, 0.056785, 0.091594}, { 0.004347, 0.056680, 0.137848}, + {-0.004464, 0.002342, 0.184013}, { 0.029660, 0.046870, 0.082654}, + { 0.059408, 0.001016, 0.086063}, { 0.055263, 0.027574, 0.155037}, + { 0.062166, 0.064323, 0.117371}, { 0.022967, 0.100050, 0.077227}, + { 0.041795, 0.096343, 0.170421}, { 0.053189, 0.122931, 0.118549}, + { 0.094247, 0.094448, 0.078395}, { 0.082407, 0.033408, 0.041085}, + { 0.096820, 0.115960, 0.149433}, { 0.067804, 0.121849, 0.025336}, + {-0.008421, 0.104316, 0.032314}, { 0.031013, 0.073218, -0.004899}, + { 0.085079, 0.060323, -0.009687}, { 0.028174, 0.092766, -0.055590}, + { 0.070133, 0.039160, -0.061035}, {-0.039211, 0.072517, -0.028756}, + { 0.129686, 0.100233, -0.046998}, { 0.154189, 0.107616, 0.022791}, + {-0.049331, 0.094184, 0.087984}, {-0.013179, 0.126552, 0.125099}, + {-0.058716, 0.098524, 0.150886}, {-0.022753, 0.080011, 0.191127}, + { 0.013451, 0.164593, 0.153768}, { 0.074818, 0.181214, 0.108211}, + { 0.091323, 0.169249, 0.168460}, { 0.033885, 0.155516, 0.213745}, + {-0.032128, 0.227238, 0.135815}, {-0.059176, 0.168980, 0.229110}, + { 0.033917, 0.229753, 0.222264}, { 0.082702, 0.116370, 0.224697}, + { 0.127737, 0.186658, 0.212783}, { 0.047528, 0.063920, 0.216856}, + {-0.002446, 0.114174, 0.263289}, {-0.077783, 0.082523, 0.249697}, + { 0.010023, 0.024267, 0.256874}, { 0.053190, 0.111422, 0.310407}, + {-0.078804, 0.004444, 0.224078}, {-0.055253, -0.059180, 0.217892}, + {-0.065371, 0.008124, 0.333405}, {-0.076188, -0.098767, 0.286983}, + {-0.071911, -0.115804, 0.198031}, {-0.062473, 0.183639, 0.370162}, + {-0.042666, 0.255210, 0.262720}, { 0.011999, 0.217530, 0.318291}, + {-0.042144, 0.322087, 0.326387}, { 0.090663, 0.205835, 0.294784}, + { 0.058218, 0.293649, 0.277927}, { 0.157506, 0.282870, 0.294610}, + { 0.118248, 0.261007, 0.148614}, { 0.065261, 0.332362, 0.411912}, + { 0.141269, 0.451850, 0.315726}, { 0.001706, 0.456301, 0.357590}, + {-0.052947, 0.356559, 0.456944}, { 0.247707, 0.263837, 0.152591}, + { 0.306847, 0.417373, 0.258553}, { 0.166347, 0.149222, 0.118973}, + { 0.379709, 0.292172, 0.139875}, { 0.010171, -0.055170, -0.174523} +}; + +static const float lsf_cb2_16k[256][3] = { + {-0.213011, -0.293385, -0.330597}, {-0.212582, -0.240992, -0.338239}, + {-0.223373, -0.306214, -0.277192}, {-0.231138, -0.287729, -0.229412}, + {-0.238466, -0.228571, -0.260954}, {-0.140931, -0.247018, -0.258566}, + {-0.136239, -0.249669, -0.350143}, {-0.149738, -0.192970, -0.281475}, + {-0.167058, -0.261052, -0.196301}, {-0.177049, -0.201324, -0.207897}, + {-0.116915, -0.200629, -0.212526}, {-0.162247, -0.143805, -0.245093}, + {-0.082042, -0.191842, -0.266338}, {-0.098846, -0.208511, -0.320481}, + {-0.113510, -0.152470, -0.222474}, {-0.066197, -0.179112, -0.207813}, + {-0.129490, -0.169320, -0.155238}, {-0.078843, -0.190292, -0.155172}, + {-0.087790, -0.147729, -0.169351}, {-0.141037, -0.127207, -0.177910}, + {-0.126525, -0.223961, -0.153639}, {-0.101464, -0.189953, -0.114559}, + {-0.102450, -0.106303, -0.151171}, {-0.103208, -0.144457, -0.105378}, + {-0.170794, -0.140525, -0.136428}, {-0.168641, -0.203064, -0.135368}, + {-0.138193, -0.116042, -0.111905}, {-0.145085, -0.168581, -0.092613}, + {-0.126379, -0.220431, -0.091327}, {-0.212934, -0.184797, -0.101632}, + {-0.193711, -0.140556, -0.078304}, {-0.173674, -0.197276, -0.060140}, + {-0.197897, -0.241907, -0.091997}, {-0.156037, -0.258519, -0.111628}, + {-0.241964, -0.191124, -0.063140}, {-0.261340, -0.240847, -0.103132}, + {-0.221621, -0.242972, -0.041255}, {-0.224166, -0.232742, -0.161568}, + {-0.203591, -0.294470, -0.126035}, {-0.209540, -0.303149, -0.053170}, + {-0.253859, -0.295066, -0.156050}, {-0.278143, -0.331105, -0.085237}, + {-0.300273, -0.198750, -0.094834}, {-0.260477, -0.169713, -0.132476}, + {-0.211889, -0.172454, -0.164281}, {-0.228370, -0.122149, -0.124178}, + {-0.254629, -0.135668, -0.081692}, {-0.263813, -0.154928, -0.213596}, + {-0.308224, -0.106877, -0.084404}, {-0.242644, -0.082862, -0.085835}, + {-0.252084, -0.064888, -0.146498}, {-0.198162, -0.105721, -0.188887}, + {-0.189238, -0.088028, -0.109736}, {-0.197598, -0.099831, -0.044030}, + {-0.269017, -0.105991, -0.021513}, {-0.231349, -0.058825, -0.041407}, + {-0.225589, -0.027501, -0.087160}, {-0.160347, -0.058341, -0.079789}, + {-0.158729, -0.108951, -0.067262}, {-0.170483, -0.053023, -0.017561}, + {-0.175207, -0.013649, -0.049513}, {-0.156004, -0.108378, -0.004052}, + {-0.219958, -0.082362, 0.014950}, {-0.217785, -0.012981, -0.009410}, + {-0.123290, -0.040849, -0.040910}, {-0.119861, -0.095078, -0.060246}, + {-0.117537, -0.065479, 0.002968}, {-0.103231, -0.113298, -0.023282}, + {-0.136365, -0.149524, -0.051387}, {-0.119332, -0.164400, -0.009103}, + {-0.104522, -0.060948, -0.083056}, {-0.071461, -0.070787, -0.037347}, + {-0.081116, -0.149015, -0.056740}, {-0.069561, -0.108099, -0.069167}, + {-0.055624, -0.117369, -0.025091}, {-0.091941, -0.190091, -0.060020}, + {-0.072003, -0.168433, -0.006540}, {-0.033305, -0.154427, -0.054608}, + {-0.062988, -0.127093, -0.108307}, {-0.056690, -0.170813, -0.102834}, + {-0.018273, -0.127863, -0.094998}, {-0.056239, -0.123678, -0.146262}, + {-0.023442, -0.154617, -0.137417}, {-0.051903, -0.078379, -0.093395}, + {-0.014599, -0.104412, -0.135959}, {-0.051582, -0.081280, -0.140643}, + {-0.092727, -0.091930, -0.107816}, {-0.024814, -0.140993, -0.183243}, + {-0.064307, -0.113024, -0.194788}, {-0.000118, -0.098858, -0.195336}, + {-0.028090, -0.048258, -0.164101}, {-0.093414, -0.055969, -0.172743}, + {-0.114445, -0.104336, -0.215204}, {-0.048518, -0.132063, -0.242991}, + {-0.159620, -0.060240, -0.178592}, {-0.135728, -0.067473, -0.131876}, + {-0.078464, -0.038040, -0.125105}, {-0.011061, -0.064011, -0.102496}, + {-0.033887, -0.026485, -0.109493}, {-0.129128, -0.014216, -0.111329}, + {-0.190687, -0.030660, -0.135825}, {-0.082037, 0.010997, -0.100167}, + {-0.183403, 0.001651, -0.098962}, {-0.074775, -0.030335, -0.062217}, + {-0.031759, -0.050551, -0.059420}, {-0.051439, 0.010827, -0.052148}, + {-0.126744, 0.008689, -0.047785}, {-0.145916, 0.042019, -0.077431}, + {-0.093552, 0.054143, -0.060473}, {-0.090660, 0.012868, -0.018195}, + {-0.079783, -0.033071, 0.001482}, {-0.033010, -0.022331, -0.014506}, + {-0.004798, -0.017339, -0.060120}, {-0.025021, 0.026390, -0.003263}, + {-0.001437, 0.025994, -0.040892}, {-0.074821, 0.019005, 0.027549}, + {-0.030811, -0.012114, 0.034284}, { 0.006785, 0.004618, 0.018717}, + { 0.013392, -0.032597, -0.023731}, { 0.035994, 0.005963, -0.011757}, + { 0.008071, -0.045750, 0.024889}, { 0.013055, 0.017040, 0.054121}, + {-0.012989, 0.044864, 0.036327}, { 0.025054, 0.047137, 0.009974}, + { 0.053801, 0.024178, 0.031774}, { 0.056442, -0.030647, 0.021291}, + { 0.032247, 0.052680, 0.049886}, { 0.035369, 0.090207, 0.031394}, + { 0.064720, 0.070390, 0.040938}, { 0.022112, 0.054834, 0.091059}, + { 0.041765, 0.086248, 0.070196}, { 0.070645, 0.060852, 0.078825}, + { 0.058506, 0.016920, 0.081612}, { 0.000009, 0.086500, 0.059849}, + { 0.071253, 0.107392, 0.059046}, { 0.094702, 0.096160, 0.090982}, + { 0.047639, 0.110877, 0.111227}, { 0.122444, 0.090909, 0.057396}, + { 0.101916, 0.052299, 0.029909}, { 0.076560, 0.086094, -0.007252}, + { 0.123411, 0.030769, 0.082749}, { 0.135579, 0.103022, 0.009540}, + { 0.120576, 0.065284, -0.024095}, { 0.077483, 0.028526, -0.012369}, + { 0.128747, 0.017901, -0.003874}, { 0.158254, 0.046962, 0.029577}, + { 0.102287, -0.002211, 0.037329}, { 0.089654, -0.021372, -0.006857}, + { 0.137917, 0.027228, -0.053223}, { 0.098728, -0.012192, -0.048518}, + { 0.083974, 0.036153, -0.062266}, { 0.048230, -0.010241, -0.052293}, + { 0.110135, 0.007715, -0.095233}, { 0.068294, -0.014317, -0.104029}, + { 0.063909, -0.056416, -0.063023}, { 0.059133, -0.044675, -0.023780}, + { 0.030748, 0.021845, -0.086332}, { 0.023994, -0.045574, -0.076232}, + { 0.052147, -0.059825, -0.109667}, { 0.013087, -0.020420, -0.121945}, + { 0.018163, -0.096765, -0.088758}, { 0.020196, -0.076470, -0.048112}, + { 0.020282, -0.084204, -0.135535}, { 0.040076, -0.053464, -0.161949}, + {-0.017796, -0.103070, -0.059559}, {-0.016484, -0.070138, -0.016866}, + { 0.004849, -0.112481, -0.017731}, { 0.040160, -0.073873, -0.005327}, + { 0.002202, -0.094723, 0.045366}, {-0.056918, -0.081578, 0.017875}, + {-0.031099, -0.141708, 0.009186}, {-0.102802, -0.122675, 0.030060}, + {-0.061717, -0.145116, 0.076680}, {-0.073607, -0.050464, 0.072853}, + {-0.117403, -0.194921, 0.040101}, {-0.185236, -0.133620, 0.045939}, + {-0.160174, -0.057226, 0.056641}, {-0.178489, -0.173435, -0.007806}, + {-0.199916, -0.204866, 0.047342}, {-0.152337, -0.249651, 0.034656}, + {-0.185637, -0.230942, -0.002072}, {-0.122548, -0.215209, -0.024552}, + {-0.249578, -0.209714, 0.009470}, {-0.160108, -0.257702, -0.040992}, + {-0.216694, -0.289353, 0.027182}, {-0.226390, -0.147844, -0.022742}, + {-0.288737, -0.272150, -0.013948}, {-0.262554, -0.237035, 0.072473}, + {-0.306267, -0.188335, -0.032894}, {-0.259666, -0.345816, 0.024138}, + {-0.271093, -0.137143, 0.040404}, {-0.201317, -0.286782, 0.107615}, + {-0.235725, -0.163396, 0.113844}, {-0.159988, -0.209788, 0.112140}, + {-0.262985, -0.056741, 0.093506}, {-0.277226, -0.037306, 0.016008}, + {-0.293486, -0.040422, -0.062018}, {-0.214921, 0.022900, 0.055295}, + {-0.253889, 0.058575, -0.000151}, {-0.246689, 0.024242, -0.058488}, + {-0.143790, 0.006767, 0.014061}, {-0.187077, 0.048882, -0.035625}, + {-0.196369, 0.112085, 0.031546}, {-0.124264, 0.086197, -0.020800}, + {-0.126249, 0.016960, 0.095741}, {-0.079816, 0.080398, 0.051038}, + {-0.056269, 0.075380, -0.028262}, {-0.120493, 0.148495, 0.028430}, + {-0.161750, 0.101290, 0.117806}, {-0.003247, 0.083393, -0.017061}, + {-0.034007, 0.142542, 0.007402}, {-0.037618, 0.025871, 0.089496}, + {-0.082819, 0.184435, 0.073224}, { 0.006448, 0.167015, 0.080548}, + { 0.035315, 0.144022, 0.003218}, {-0.023459, 0.088147, 0.152604}, + { 0.006247, -0.024099, 0.077792}, { 0.039894, 0.057586, -0.042455}, + {-0.020417, 0.035400, -0.093971}, { 0.075465, 0.052063, 0.145582}, + { 0.078027, 0.184720, 0.092096}, { 0.107295, 0.148380, 0.022264}, + { 0.066928, -0.052831, 0.065108}, { 0.093295, 0.118157, 0.149815}, + { 0.119373, 0.137114, 0.099536}, { 0.138653, 0.075509, 0.121545}, + { 0.174025, 0.077531, 0.077169}, { 0.165839, 0.150080, 0.133423}, + { 0.173276, 0.155887, 0.048150}, { 0.162910, 0.095898, 0.171896}, + { 0.214577, 0.112888, 0.115579}, { 0.204755, 0.106392, 0.032337}, + { 0.178853, 0.205034, 0.114760}, { 0.177401, 0.070504, -0.013778}, + { 0.241624, 0.166921, 0.066087}, { 0.219595, 0.183553, 0.172332}, + { 0.123671, 0.170842, 0.167216}, { 0.177104, 0.240197, 0.186359}, + { 0.272003, 0.220214, 0.126073}, { 0.093748, 0.235843, 0.160998}, + { 0.141510, 0.190012, 0.240416}, { 0.046878, 0.168984, 0.190412}, + { 0.094898, 0.107038, 0.235003}, { 0.108592, 0.269536, 0.262528}, + {-0.027754, 0.234355, 0.134544}, { 0.265127, 0.267540, 0.199041}, + { 0.199523, 0.291507, 0.265171}, { 0.266177, 0.209339, 0.350369}, + { 0.322159, 0.344794, 0.270823}, { 0.399957, 0.264065, 0.110387}, + { 0.277817, 0.127407, -0.035625}, {-0.177038, 0.208155, 0.119077}, + { 0.049075, -0.076294, 0.145711}, { 0.187246, 0.042865, -0.127097}, + { 0.117885, -0.023489, -0.138658}, {-0.284256, 0.068153, 0.124259} +}; + +static const float lsf_cb3_16k[128][3] = { + {-0.223412, -0.236300, -0.188067}, {-0.202286, -0.218711, -0.102947}, + {-0.251652, -0.161020, -0.125280}, {-0.169223, -0.138155, -0.140430}, + {-0.176427, -0.146628, -0.222632}, {-0.120584, -0.187276, -0.180164}, + {-0.195559, -0.074225, -0.169109}, {-0.144551, -0.142774, -0.073340}, + {-0.111001, -0.111310, -0.130696}, {-0.095221, -0.174684, -0.111841}, + {-0.112158, -0.103049, -0.195130}, {-0.059989, -0.142170, -0.157850}, + {-0.127598, -0.051759, -0.153109}, {-0.063753, -0.067898, -0.164117}, + {-0.141753, -0.068274, -0.091999}, {-0.060482, -0.101054, -0.099475}, + {-0.104699, -0.104456, -0.066496}, {-0.073649, -0.052614, -0.091612}, + {-0.088268, -0.019072, -0.129956}, {-0.018837, -0.104115, -0.127837}, + {-0.021630, -0.033055, -0.129868}, {-0.083768, -0.047549, -0.041407}, + {-0.055892, -0.108526, -0.043200}, {-0.027816, -0.062499, -0.048190}, + {-0.002248, -0.110428, -0.062868}, { 0.001270, -0.033245, -0.072404}, + {-0.042747, -0.013835, -0.033829}, {-0.037615, -0.147833, -0.083912}, + {-0.045023, 0.006011, -0.092182}, {-0.050411, -0.081832, 0.005787}, + { 0.000357, -0.104282, -0.009428}, {-0.003893, -0.047892, -0.001506}, + {-0.040077, -0.147110, -0.009065}, {-0.060858, -0.030972, 0.012999}, + {-0.014674, 0.001370, 0.005554}, {-0.101362, -0.126061, -0.001898}, + {-0.102519, -0.000390, -0.015721}, {-0.132687, -0.069608, -0.019928}, + {-0.102227, -0.076131, 0.043306}, {-0.055193, 0.027001, 0.011857}, + {-0.156427, -0.016629, 0.017480}, {-0.078736, 0.002809, 0.057979}, + {-0.157789, -0.016693, -0.055073}, {-0.179397, -0.095520, 0.022065}, + {-0.110219, 0.010408, -0.081927}, {-0.125392, 0.049111, 0.044595}, + {-0.112528, 0.063173, -0.024954}, {-0.185525, 0.053093, -0.032102}, + {-0.176887, -0.019379, -0.115125}, {-0.249706, -0.017664, -0.059188}, + {-0.200243, -0.103311, -0.066846}, {-0.055404, 0.045106, -0.046991}, + {-0.000544, 0.022690, -0.044831}, { 0.022298, -0.016367, -0.022509}, + { 0.028278, 0.017585, -0.100612}, { 0.061781, -0.020826, -0.068190}, + { 0.029157, -0.074477, -0.098898}, { 0.043073, -0.067234, -0.032293}, + { 0.060157, 0.034636, -0.034885}, { 0.071153, -0.013881, -0.009036}, + { 0.054196, -0.029989, -0.131139}, { 0.030193, 0.024976, 0.009861}, + { 0.055943, -0.045304, 0.031927}, { 0.033217, -0.002418, 0.038165}, + { 0.063814, 0.045625, 0.025309}, { 0.033689, 0.038819, 0.049700}, + { 0.073582, 0.028527, 0.060200}, {-0.007957, 0.022531, 0.043687}, + {-0.000984, 0.054518, 0.018742}, { 0.057004, 0.060916, 0.060573}, + { 0.009883, 0.015238, 0.080211}, { 0.022742, 0.070832, 0.068855}, + { 0.053001, 0.029790, 0.091446}, {-0.042447, 0.060379, 0.061462}, + { 0.076826, 0.062468, 0.089653}, { 0.039065, 0.069768, 0.119128}, + { 0.064145, 0.095353, 0.071621}, { 0.094411, 0.069527, 0.054197}, + { 0.042812, 0.093060, 0.027980}, { 0.094791, 0.099189, 0.101112}, + { 0.117611, 0.048601, 0.093111}, { 0.119951, 0.122758, 0.051546}, + { 0.103558, 0.085245, -0.010700}, { 0.150126, 0.059766, 0.020280}, + { 0.108066, 0.017170, 0.008606}, { 0.108422, 0.023253, -0.063942}, + { 0.019652, 0.072284, -0.030331}, { 0.192719, 0.075624, 0.071156}, + { 0.221140, 0.069191, -0.035085}, { 0.188367, 0.126200, 0.035225}, + { 0.185760, 0.043537, -0.101714}, {-0.042518, 0.099646, 0.003244}, + {-0.015308, -0.027521, 0.046006}, { 0.034086, -0.045777, 0.095989}, + { 0.007174, -0.093358, 0.046459}, {-0.051248, -0.062095, 0.083161}, + {-0.045626, -0.133301, 0.052997}, {-0.037840, 0.024042, 0.131097}, + {-0.020217, -0.115942, 0.126170}, {-0.134550, -0.036291, 0.111322}, + {-0.110576, -0.160024, 0.091841}, {-0.093308, -0.184958, 0.013939}, + {-0.082735, -0.167417, -0.051725}, {-0.169934, -0.173003, -0.007155}, + {-0.128244, -0.213123, -0.053337}, {-0.079852, -0.154116, -0.246546}, + {-0.032242, -0.108756, -0.204133}, {-0.140117, -0.199495, -0.284505}, + { 0.010842, -0.074979, -0.166333}, {-0.093313, 0.145006, 0.034110}, + {-0.039236, 0.113213, 0.111053}, { 0.040613, -0.031783, 0.174058}, + {-0.164232, 0.131421, 0.149842}, { 0.026893, 0.107281, 0.179297}, + { 0.047086, 0.158606, 0.103267}, {-0.070567, 0.210459, 0.134734}, + { 0.094392, 0.137050, 0.166892}, { 0.086039, 0.063657, 0.168825}, + { 0.159371, 0.120897, 0.154357}, { 0.147101, 0.160684, 0.114882}, + { 0.120158, 0.199650, 0.180948}, { 0.191417, 0.174500, 0.170734}, + { 0.159153, 0.142165, 0.233347}, { 0.232002, 0.150181, 0.102736}, + { 0.188299, 0.221738, 0.228748}, { 0.256786, 0.209685, 0.161534}, + { 0.257861, 0.247793, 0.250516}, {-0.164461, -0.000143, 0.232461} +}; + +static const float lsf_cb4_16k[128][3] = { + {-0.193369, -0.304643, -0.253777}, {-0.164125, -0.277786, -0.153116}, + {-0.135681, -0.209120, -0.211724}, {-0.121822, -0.215734, -0.292207}, + {-0.198781, -0.161674, -0.242538}, {-0.164147, -0.180570, -0.138070}, + {-0.095915, -0.198695, -0.154309}, {-0.248386, -0.234462, -0.136984}, + {-0.164968, -0.108318, -0.175635}, {-0.124171, -0.111809, -0.224402}, + {-0.067398, -0.157017, -0.195759}, {-0.090132, -0.119174, -0.165253}, + {-0.099460, -0.146895, -0.106799}, {-0.141493, -0.108103, -0.108880}, + {-0.085088, -0.098340, -0.109953}, {-0.105526, -0.054463, -0.154315}, + {-0.040480, -0.144285, -0.124042}, {-0.040969, -0.084039, -0.142880}, + {-0.049082, -0.118553, -0.066686}, {-0.096336, -0.087515, -0.055741}, + {-0.058605, -0.059327, -0.089275}, {-0.121842, -0.058681, -0.086949}, + {-0.053792, -0.022025, -0.124451}, {-0.036744, -0.068891, -0.045865}, + { 0.003900, -0.098237, -0.091158}, {-0.001664, -0.045089, -0.081353}, + {-0.072829, -0.034087, -0.038416}, {-0.100822, -0.007330, -0.088715}, + {-0.035911, -0.005864, -0.062577}, {-0.020205, -0.026547, -0.019634}, + { 0.004291, -0.041290, -0.138181}, { 0.023404, -0.010932, -0.044904}, + { 0.013557, 0.014823, -0.092943}, { 0.059673, -0.031024, -0.095739}, + { 0.021130, -0.080607, -0.034594}, { 0.024655, -0.035564, 0.003243}, + { 0.017106, 0.006952, -0.000308}, { 0.075208, -0.030910, -0.031181}, + { 0.024965, 0.048632, -0.039448}, { 0.057028, 0.021547, -0.009418}, + {-0.018577, 0.023697, -0.009759}, { 0.024077, 0.033053, 0.024324}, + { 0.037052, -0.003436, 0.044530}, {-0.012871, -0.007179, 0.031795}, + { 0.077877, 0.021547, 0.023131}, { 0.053365, 0.052078, 0.029433}, + { 0.011429, 0.070426, 0.028734}, {-0.001827, 0.033115, 0.061505}, + {-0.044870, 0.038568, 0.026239}, { 0.061633, 0.034799, 0.059784}, + { 0.034261, 0.060342, 0.065185}, { 0.058981, 0.082481, 0.047252}, + { 0.090008, 0.065942, 0.044470}, { 0.066961, 0.073728, -0.000428}, + { 0.074763, 0.060293, 0.085632}, { 0.066366, 0.103375, 0.079642}, + { 0.122297, 0.036558, 0.058745}, { 0.111042, 0.092093, 0.085412}, + { 0.099243, 0.115476, 0.039254}, { 0.019973, 0.122844, 0.050255}, + { 0.159571, 0.098965, 0.051740}, { 0.137624, 0.072405, -0.006922}, + { 0.130240, 0.146091, 0.089698}, { 0.138335, 0.092968, 0.136193}, + { 0.066031, 0.149304, 0.125476}, { 0.202749, 0.145751, 0.077122}, + { 0.002224, 0.082811, 0.131200}, { 0.124476, 0.178073, 0.162336}, + { 0.174722, 0.190298, 0.127106}, { 0.202193, 0.153569, 0.163840}, + { 0.242604, 0.197796, 0.136929}, { 0.185809, 0.229348, 0.193353}, + {-0.058814, 0.195178, 0.141821}, { 0.253646, 0.247175, 0.205766}, + { 0.061433, -0.025542, 0.119311}, {-0.057816, 0.082445, 0.073243}, + {-0.069239, 0.148678, 0.031146}, {-0.030217, -0.008503, 0.106194}, + {-0.026708, 0.087469, -0.009589}, {-0.090418, 0.000265, 0.056807}, + {-0.050607, -0.019383, 0.010494}, {-0.079397, 0.008233, -0.011469}, + {-0.072634, -0.061165, 0.046917}, {-0.075741, -0.072343, -0.007557}, + {-0.025162, -0.073363, 0.005173}, {-0.123371, -0.041257, -0.008375}, + {-0.139904, 0.018285, 0.009920}, {-0.143421, -0.104238, 0.033457}, + {-0.100923, -0.134400, -0.023257}, {-0.157791, -0.095042, -0.036959}, + {-0.219890, -0.078637, 0.001815}, {-0.183607, -0.023053, -0.043678}, + {-0.145303, -0.158923, -0.059045}, {-0.197615, -0.165199, 0.028099}, + {-0.225131, -0.167756, -0.056401}, {-0.216572, -0.104751, -0.102964}, + {-0.171336, -0.241967, -0.063404}, {-0.134035, -0.205614, 0.011831}, + {-0.297116, -0.211173, -0.015352}, {-0.086464, -0.200592, -0.070454}, + {-0.217777, -0.278403, 0.030398}, {-0.236248, -0.323694, -0.087588}, + {-0.222074, -0.210785, 0.106210}, {-0.283400, -0.097077, 0.041303}, + {-0.078417, -0.154464, 0.062956}, {-0.214417, -0.100695, 0.121909}, + {-0.178576, -0.028847, 0.061042}, {-0.037999, -0.144233, -0.010546}, + {-0.086695, -0.070996, 0.125282}, { 0.010788, -0.085006, 0.058527}, + {-0.154015, 0.066560, 0.071038}, {-0.143503, 0.033260, 0.154393}, + {-0.134069, 0.032420, -0.056293}, {-0.110851, 0.086908, 0.003920}, + {-0.057254, 0.047674, -0.055571}, {-0.214206, 0.068784, -0.004735}, + {-0.257264, 0.050468, 0.081702}, {-0.291834, 0.004120, -0.022366}, + {-0.173309, -0.029081, -0.115901}, {-0.207622, 0.168664, 0.136030}, + { 0.090541, 0.032754, -0.057330}, { 0.140219, -0.000735, -0.015633}, + { 0.136697, -0.017163, -0.100909}, { 0.029838, -0.089515, -0.147130}, + {-0.055367, -0.072683, -0.214015}, { 0.048680, -0.057633, -0.212429}, + {-0.013134, -0.113898, -0.196403}, {-0.071702, -0.159408, -0.254895} +}; + +static const float lsf_cb5_16k[128][4] = { + {-0.201277, -0.278679, -0.173262, -0.198580}, + {-0.214667, -0.151922, -0.117551, -0.192713}, + {-0.160962, -0.207728, -0.124750, -0.129749}, + {-0.131043, -0.137818, -0.155281, -0.166308}, + {-0.179134, -0.169602, -0.165223, -0.066293}, + {-0.136474, -0.177035, -0.250127, -0.134370}, + {-0.066970, -0.146274, -0.170638, -0.134436}, + {-0.083288, -0.165860, -0.103437, -0.140361}, + {-0.130474, -0.119317, -0.124393, -0.086408}, + {-0.127609, -0.134415, -0.073592, -0.116103}, + {-0.113027, -0.091756, -0.107786, -0.131935}, + {-0.125530, -0.182152, -0.093796, -0.045088}, + {-0.077122, -0.138052, -0.166271, -0.038886}, + {-0.073027, -0.106845, -0.067073, -0.113910}, + {-0.049146, -0.107019, -0.112531, -0.063388}, + {-0.101539, -0.119586, -0.050297, -0.040670}, + {-0.107784, -0.066913, -0.080993, -0.052352}, + {-0.152155, -0.103010, -0.090461, -0.015526}, + {-0.153087, -0.087656, -0.029889, -0.037367}, + {-0.215281, -0.138062, -0.089162, -0.050839}, + {-0.053350, -0.060169, -0.063459, -0.024499}, + {-0.051674, -0.076355, -0.033733, -0.077211}, + {-0.045047, -0.107006, -0.020880, -0.024525}, + {-0.083003, -0.063672, -0.013243, -0.028324}, + {-0.104104, -0.075450, -0.032746, 0.024480}, + {-0.085695, -0.019502, -0.045121, -0.025016}, + {-0.123120, -0.030844, -0.003533, -0.016224}, + {-0.025568, -0.049172, -0.003911, -0.027522}, + {-0.039029, -0.019857, -0.043211, -0.058087}, + {-0.040122, -0.023067, -0.001356, 0.008607}, + {-0.063351, -0.001776, 0.016015, -0.027088}, + {-0.068110, -0.038838, 0.042525, 0.001076}, + {-0.043623, -0.020736, -0.047862, 0.037710}, + {-0.041052, 0.021954, -0.025660, 0.000758}, + {-0.013035, 0.002583, -0.008233, -0.037300}, + {-0.005523, -0.014670, 0.019651, -0.012667}, + {-0.004409, -0.014437, -0.059412, -0.019701}, + { 0.024946, -0.011663, -0.014351, -0.028762}, + { 0.012660, 0.018489, -0.010205, 0.012695}, + {-0.004423, 0.017827, 0.040544, 0.003629}, + { 0.020684, 0.026743, 0.007752, -0.025595}, + { 0.032071, 0.000043, 0.026188, -0.006444}, + { 0.058793, 0.015820, -0.001119, -0.017415}, + { 0.020156, -0.047590, 0.004227, 0.008670}, + { 0.054770, 0.032135, 0.029770, -0.009767}, + { 0.030884, 0.047757, 0.033068, 0.006866}, + { 0.062039, 0.011646, 0.056037, 0.016859}, + { 0.013798, -0.028196, 0.060710, 0.014299}, + { 0.100043, 0.041445, 0.023379, -0.014889}, + { 0.062728, -0.042821, 0.002180, -0.055380}, + { 0.061663, 0.018767, -0.015571, -0.074095}, + { 0.062980, 0.080497, 0.011808, -0.031787}, + { 0.084964, 0.043100, -0.025877, 0.020309}, + { 0.014707, 0.035421, -0.041440, -0.053373}, + { 0.081268, 0.005791, -0.066290, -0.039825}, + { 0.017691, -0.020401, -0.040513, -0.083960}, + { 0.120874, 0.055753, -0.025988, -0.059552}, + { 0.079912, 0.007894, -0.085380, -0.114587}, + { 0.036856, -0.039331, -0.104237, -0.069116}, + { 0.008526, -0.064273, -0.048312, -0.038595}, + { 0.033461, -0.028956, -0.066505, 0.038722}, + {-0.042064, -0.043989, -0.100653, -0.071550}, + {-0.015342, -0.064850, -0.065675, -0.122769}, + {-0.006581, -0.004919, -0.113564, -0.145753}, + { 0.008273, -0.070702, -0.164998, -0.095541}, + {-0.001698, -0.063744, -0.129971, -0.011162}, + {-0.048471, -0.087500, -0.111006, -0.161823}, + {-0.032193, -0.091955, -0.080642, 0.012288}, + {-0.095873, -0.015986, -0.072722, -0.101745}, + {-0.079477, -0.082060, -0.203008, -0.100297}, + {-0.023883, -0.064022, -0.168341, -0.211739}, + {-0.070530, -0.103547, -0.123858, 0.055049}, + {-0.033503, -0.076812, -0.016287, 0.044159}, + {-0.088427, -0.161682, -0.058579, 0.013873}, + {-0.083068, -0.168222, -0.016773, -0.080209}, + {-0.080548, -0.139090, 0.030544, 0.007171}, + {-0.117482, -0.083718, 0.027074, -0.003674}, + {-0.163085, -0.156856, -0.012618, -0.022329}, + {-0.176540, -0.113042, -0.020148, 0.051770}, + {-0.153891, -0.199293, -0.043244, 0.028331}, + {-0.107822, -0.150615, 0.016430, 0.092919}, + {-0.137676, -0.183224, 0.066026, 0.029343}, + {-0.191106, -0.099250, 0.045370, 0.004084}, + {-0.237042, -0.130815, -0.022543, -0.029428}, + {-0.201014, -0.053591, -0.007305, -0.033547}, + {-0.249286, -0.228408, 0.005002, 0.007146}, + {-0.206509, -0.211998, -0.061352, -0.047233}, + {-0.255702, -0.135114, 0.076375, 0.036630}, + {-0.296271, -0.073946, -0.007273, -0.019601}, + {-0.302917, -0.175111, -0.070024, -0.043905}, + {-0.239275, -0.043962, -0.084982, -0.067446}, + {-0.254583, -0.294720, -0.088762, -0.070451}, + {-0.205583, -0.238996, -0.124753, 0.033076}, + {-0.205583, -0.215882, -0.028472, 0.118679}, + {-0.153640, -0.204464, -0.039654, -0.134441}, + {-0.145929, -0.191970, -0.175308, 0.021366}, + {-0.149348, -0.212569, -0.118324, 0.103812}, + {-0.166397, -0.220581, -0.265260, -0.029113}, + {-0.164171, -0.231262, -0.258828, 0.061427}, + {-0.200198, -0.263453, -0.212016, 0.115359}, + {-0.130088, -0.212168, -0.202368, 0.118563}, + {-0.206387, -0.078075, -0.227856, -0.111165}, + {-0.129605, -0.176848, -0.241584, -0.259900}, + {-0.176826, -0.045901, -0.141712, -0.209345}, + {-0.351173, -0.031097, -0.133935, -0.182412}, + {-0.164232, 0.027006, -0.014039, -0.053567}, + {-0.171037, -0.025924, 0.030972, 0.017329}, + {-0.080862, -0.021577, 0.007652, 0.063968}, + {-0.061788, 0.042024, -0.018783, -0.057979}, + {-0.110311, 0.054760, 0.031446, -0.006710}, + {-0.136637, 0.022171, 0.084991, 0.028039}, + {-0.254471, -0.004376, 0.078034, 0.033649}, + {-0.234464, 0.088157, 0.040999, 0.002639}, + {-0.037095, 0.059443, 0.072180, 0.015027}, + {-0.046841, -0.004813, 0.088266, 0.038786}, + {-0.086782, 0.120100, 0.082655, 0.020271}, + {-0.118361, -0.069242, 0.094867, 0.039200}, + {-0.023342, -0.084303, 0.052684, 0.017093}, + {-0.014194, 0.001012, 0.011946, 0.074125}, + {-0.015342, 0.076396, 0.022365, -0.028001}, + { 0.027706, 0.037047, 0.107573, 0.060815}, + { 0.030615, 0.040664, 0.010467, 0.074289}, + { 0.038646, 0.115584, 0.069627, 0.007642}, + { 0.096463, 0.069818, 0.062494, 0.015413}, + { 0.054834, 0.065232, 0.054286, 0.110088}, + { 0.152312, 0.092371, 0.026420, -0.013184}, + { 0.144264, 0.123438, 0.080131, 0.023233}, + { 0.124405, 0.009943, -0.148477, -0.205184} +}; + +static const float *lsf_codebooks_16k[] = { + lsf_cb1_16k[0], lsf_cb2_16k[0], lsf_cb3_16k[0], lsf_cb4_16k[0], + lsf_cb5_16k[0] +}; + +#endif /* AVCODEC_SIPR16KDATA_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/siprdata.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/siprdata.h new file mode 100644 index 00000000..ed804ee8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/siprdata.h @@ -0,0 +1,263 @@ +/* + * SIPR / ACELP.NET decoder + * + * Copyright (c) 2008 Vladimir Voroshilov + * Copyright (c) 2009 Vitor Sessak + * + * 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 + */ + +#ifndef AVCODEC_SIPRDATA_H +#define AVCODEC_SIPRDATA_H + +static const float mean_lsf[10] = { + 0.297151, 0.452308, 0.765443, 1.134803, 1.421125, + 1.773822, 2.049173, 2.375914, 2.585097, 0.075756 +}; + +static const float lsf_cb1[64][2] = { + { 0.007587, -0.005843}, { 0.042163, -0.028048}, {-0.017147, -0.060705}, + { 0.013773, -0.038108}, {-0.041563, -0.078571}, {-0.076928, -0.119343}, + { 0.012654, 0.176005}, { 0.059737, 0.156869}, { 0.171767, 0.231837}, + { 0.114030, 0.242047}, { 0.168977, 0.283101}, { 0.146210, 0.397961}, + { 0.249446, 0.268421}, { 0.137074, 0.186724}, {-0.057736, -0.135638}, + {-0.109664, -0.124611}, {-0.021234, -0.031174}, {-0.013990, -0.091819}, + {-0.040046, -0.111426}, {-0.016830, 0.055361}, { 0.057815, 0.071606}, + { 0.060670, 0.114436}, { 0.106695, 0.140838}, { 0.093601, 0.092793}, + { 0.039593, 0.006142}, {-0.066589, -0.092463}, {-0.102589, -0.171380}, + {-0.059621, -0.050671}, { 0.166131, 0.139773}, { 0.213069, 0.190761}, + { 0.061820, 0.037661}, { 0.136471, 0.090823}, {-0.019789, 0.013515}, + { 0.022280, 0.079473}, { 0.215281, 0.461959}, { 0.206497, 0.340077}, + { 0.012249, -0.065596}, { 0.091345, 0.190871}, { 0.019506, 0.037266}, + {-0.050702, -0.013223}, {-0.057334, 0.028943}, { 0.291512, 0.371415}, + {-0.053467, 0.084160}, { 0.025372, 0.375310}, { 0.269995, 0.566520}, + {-0.095259, -0.012353}, { 0.050479, 0.212893}, { 0.101219, 0.049320}, + { 0.072426, 0.283362}, {-0.084116, -0.150542}, {-0.031485, 0.144922}, + { 0.012714, 0.256910}, {-0.009528, 0.102768}, {-0.039572, 0.204967}, + {-0.098800, 0.055038}, { 0.020719, 0.128387}, {-0.045559, -0.178373}, + {-0.082338, 0.136933}, {-0.058270, 0.292806}, { 0.084242, 0.505112}, + { 0.121825, 0.326386}, {-0.102658, -0.069341}, { 0.071675, 0.004744}, + {-0.117763, -0.202608} +}; + +static const float lsf_cb2[128][2] = { + { 0.025412, 0.006095}, {-0.069803, 0.010650}, {-0.175957, -0.185800}, + {-0.139298, -0.048013}, {-0.156150, -0.129688}, {-0.160523, 0.068022}, + { 0.199683, 0.259982}, { 0.258038, 0.236147}, { 0.367089, 0.304716}, + { 0.251764, 0.305853}, { 0.394314, 0.382153}, { 0.448579, 0.337438}, + { 0.323286, 0.425563}, { 0.015369, 0.123820}, {-0.026770, 0.083881}, + {-0.112161, -0.097993}, {-0.221847, -0.161311}, {-0.050014, -0.092862}, + {-0.214960, -0.398498}, {-0.114062, -0.241381}, { 0.137950, 0.138852}, + { 0.031529, 0.065719}, { 0.208734, 0.084760}, { 0.157862, 0.057535}, + { 0.124750, 0.011922}, {-0.035227, -0.154397}, {-0.105523, -0.291427}, + {-0.073488, -0.201948}, {-0.224184, -0.273290}, {-0.168019, -0.240297}, + {-0.271591, -0.384682}, {-0.124784, 0.014253}, { 0.004210, -0.110418}, + { 0.074270, -0.014272}, { 0.053058, -0.068672}, {-0.090098, -0.145019}, + { 0.303214, 0.210323}, { 0.413443, 0.272002}, { 0.356904, 0.230646}, + {-0.035186, -0.028579}, {-0.117558, 0.115105}, {-0.159225, 0.218385}, + {-0.230178, 0.172901}, {-0.216148, -0.110195}, { 0.309444, 0.101508}, + { 0.250489, 0.118338}, { 0.293324, 0.151205}, {-0.023634, 0.033084}, + { 0.076708, 0.114024}, { 0.123119, 0.087704}, {-0.060265, 0.126543}, + {-0.223766, -0.021903}, {-0.241987, -0.328089}, { 0.205598, 0.147925}, + {-0.087010, 0.064601}, {-0.287892, -0.286099}, {-0.179451, -0.350781}, + {-0.219572, 0.043816}, {-0.217263, 0.245550}, {-0.286743, -0.180981}, + { 0.172659, 0.112620}, {-0.105422, 0.176856}, { 0.006176, -0.051491}, + { 0.099802, 0.176322}, {-0.186620, -0.068980}, { 0.164689, 0.185018}, + { 0.519877, 0.376111}, { 0.521941, 0.533731}, { 0.473375, 0.439534}, + { 0.214235, 0.202476}, { 0.579215, 0.466969}, { 0.310414, 0.271057}, + { 0.257450, 0.058939}, { 0.023936, -0.169464}, {-0.268817, -0.064531}, + {-0.174182, -0.000198}, {-0.268405, -0.234529}, {-0.296522, 0.247140}, + { 0.115950, -0.072194}, {-0.303666, 0.149084}, {-0.347762, -0.011002}, + {-0.223829, -0.214137}, {-0.278958, -0.457975}, { 0.135500, 0.238466}, + { 0.312730, 0.342760}, { 0.071754, -0.125912}, { 0.485938, 0.260429}, + { 0.037536, 0.179771}, { 0.391493, 0.156938}, { 0.397320, 0.484446}, + {-0.308630, -0.342418}, {-0.269599, -0.128453}, {-0.086683, -0.043863}, + { 0.421115, 0.213521}, { 0.082417, 0.049006}, {-0.087873, 0.238126}, + { 0.338899, 0.166131}, {-0.166988, 0.147105}, {-0.167214, -0.294075}, + { 0.588706, 0.328303}, { 0.207270, 0.017671}, {-0.141658, 0.291147}, + {-0.140850, 0.374321}, { 0.028180, 0.322510}, {-0.229858, 0.328036}, + {-0.060743, -0.260916}, {-0.011131, 0.246442}, {-0.058151, 0.310760}, + {-0.127536, -0.186432}, {-0.128523, -0.334884}, {-0.283899, 0.077729}, + {-0.031595, 0.181015}, {-0.329330, -0.108630}, {-0.215739, 0.107458}, + { 0.175734, 0.327134}, { 0.255801, 0.176077}, { 0.228265, 0.396859}, + {-0.370909, -0.185081}, {-0.355138, -0.300405}, { 0.061669, 0.242616}, + { 0.104489, 0.307995}, {-0.320021, -0.234002}, { 0.077349, 0.416286}, + {-0.339471, -0.407609}, {-0.019384, -0.215111}, { 0.168229, -0.032453}, + {-0.040140, 0.399658}, {-0.275141, 0.008218} +}; + +static const float lsf_cb3[128][2] = { + { 0.024608, 0.006198}, {-0.216616, -0.398169}, {-0.089601, -0.201370}, + {-0.121878, -0.305281}, { 0.037913, 0.059320}, { 0.245126, 0.244089}, + { 0.266853, 0.182476}, { 0.319362, 0.203481}, { 0.349945, 0.252644}, + { 0.393849, 0.279272}, { 0.445707, 0.258063}, { 0.387321, 0.200855}, + {-0.038818, 0.129603}, {-0.009510, 0.076441}, {-0.023892, -0.028199}, + {-0.117134, -0.145990}, {-0.186585, -0.052886}, {-0.034250, -0.084547}, + {-0.087443, -0.095426}, {-0.453322, -0.174493}, {-0.363975, -0.148186}, + {-0.334413, -0.202479}, {-0.221313, -0.181320}, {-0.131146, -0.050611}, + {-0.104706, 0.115139}, { 0.192765, 0.275417}, { 0.014184, 0.194251}, + { 0.154215, 0.226949}, { 0.084031, 0.221759}, { 0.189438, 0.164566}, + { 0.130737, 0.170962}, {-0.066815, 0.062954}, {-0.177176, -0.145167}, + {-0.247608, -0.129767}, {-0.187886, -0.293720}, {-0.244036, -0.344655}, + {-0.203063, -0.234947}, {-0.292715, -0.158421}, { 0.064990, -0.028164}, + { 0.147664, 0.085995}, { 0.107977, 0.002253}, { 0.071286, 0.027533}, + { 0.021017, -0.049807}, {-0.272056, -0.217857}, {-0.065596, 0.008375}, + {-0.150818, -0.195514}, {-0.012767, -0.150787}, { 0.238541, 0.136606}, + { 0.291741, 0.114024}, { 0.202677, 0.103701}, { 0.140985, 0.037759}, + {-0.257347, -0.442383}, {-0.320666, -0.319742}, {-0.488725, -0.603660}, + {-0.319170, -0.469806}, { 0.014970, -0.101074}, { 0.102209, 0.066790}, + {-0.076202, -0.044884}, { 0.073868, 0.152565}, { 0.070755, -0.091358}, + {-0.016751, 0.027216}, { 0.071201, 0.096981}, {-0.060975, -0.145638}, + { 0.114156, 0.117587}, {-0.284757, -0.029101}, {-0.253005, -0.073645}, + {-0.204028, -0.098492}, {-0.114508, 0.001219}, {-0.225284, -0.011998}, + {-0.235670, 0.084330}, { 0.161921, 0.128334}, { 0.025717, 0.119456}, + {-0.255292, -0.281471}, {-0.392803, -0.095809}, { 0.039229, -0.152110}, + {-0.310905, -0.099233}, {-0.268773, 0.032308}, {-0.340150, 0.013129}, + {-0.344890, -0.045157}, {-0.188423, 0.265603}, {-0.168235, -0.000936}, + { 0.000462, 0.297000}, { 0.263674, 0.371214}, {-0.146797, -0.098225}, + {-0.386557, -0.282426}, {-0.070940, -0.255550}, { 0.293258, 0.252785}, + { 0.408332, 0.387751}, {-0.381914, -0.358918}, {-0.463621, -0.315560}, + {-0.323681, -0.258465}, { 0.250055, 0.071195}, {-0.405256, -0.429754}, + {-0.135748, -0.251274}, { 0.186827, 0.060177}, { 0.116742, -0.053526}, + {-0.403321, -0.220339}, {-0.414144, -0.021108}, {-0.416877, 0.050184}, + {-0.470083, -0.079564}, {-0.315554, 0.219217}, {-0.273183, 0.138437}, + { 0.253231, 0.306374}, { 0.177802, 0.346298}, { 0.210358, 0.207697}, + {-0.323480, 0.077519}, {-0.193136, 0.048170}, { 0.114492, 0.292778}, + {-0.130766, 0.056677}, {-0.171572, -0.349267}, {-0.370076, -0.536392}, + {-0.311109, -0.389953}, { 0.334928, 0.367664}, { 0.351246, 0.438664}, + { 0.518803, 0.331253}, { 0.437061, 0.327257}, { 0.318906, 0.307389}, + {-0.025972, -0.206758}, { 0.373278, 0.325438}, { 0.473488, 0.389441}, + { 0.478553, 0.477990}, { 0.332783, 0.153825}, { 0.212098, 0.452336}, + { 0.161522, -0.011212}, { 0.209368, 0.020687}, {-0.086262, 0.204493}, + {-0.388643, 0.133640}, {-0.177016, 0.134404} +}; + +static const float lsf_cb4[128][2] = { + {-0.003594, -0.022447}, { 0.070651, 0.028334}, {-0.290374, -0.018347}, + {-0.224495, -0.370312}, {-0.269555, -0.131227}, {-0.122714, -0.267733}, + { 0.173325, 0.138698}, { 0.161946, 0.020687}, { 0.111706, 0.022510}, + { 0.097638, 0.056049}, { 0.139754, 0.059920}, { 0.056549, -0.050586}, + { 0.036301, 0.021501}, {-0.066347, 0.012324}, {-0.066972, 0.096136}, + {-0.120062, -0.084201}, { 0.011225, 0.047425}, {-0.012846, -0.067390}, + {-0.116201, 0.122874}, {-0.027819, 0.035453}, {-0.024743, 0.072835}, + {-0.034061, -0.001310}, { 0.077469, 0.081609}, { 0.128347, 0.139584}, + { 0.183416, 0.086563}, {-0.155839, -0.053775}, {-0.190403, -0.018639}, + {-0.202548, -0.062841}, {-0.373733, -0.275094}, {-0.394260, -0.186513}, + {-0.465700, -0.220031}, { 0.064400, -0.095825}, {-0.262053, -0.199837}, + {-0.167233, -0.094402}, { 0.048600, 0.057567}, {-0.007122, 0.168506}, + { 0.050938, 0.156451}, {-0.060828, 0.147083}, {-0.171889, 0.195822}, + {-0.218934, 0.138431}, {-0.270532, 0.195775}, {-0.405818, 0.075643}, + {-0.440187, 0.193387}, {-0.484968, 0.157607}, {-0.480560, 0.067230}, + {-0.436757, -0.111847}, {-0.040731, -0.040363}, {-0.202319, -0.170457}, + {-0.158515, -0.134551}, {-0.356709, -0.378549}, {-0.268820, -0.289831}, + {-0.188486, -0.289306}, {-0.148139, -0.177616}, {-0.071591, -0.191128}, + {-0.052270, -0.150589}, {-0.020543, -0.116220}, { 0.039584, -0.012592}, + {-0.268226, 0.042704}, {-0.209755, 0.069423}, {-0.168964, 0.124504}, + {-0.363240, 0.188266}, {-0.524935, -0.025010}, {-0.105894, -0.002699}, + {-0.251830, -0.062018}, {-0.310480, -0.082325}, { 0.014652, 0.083127}, + {-0.136512, 0.033116}, {-0.073755, -0.025236}, { 0.110766, 0.095954}, + { 0.002878, 0.011838}, {-0.074977, -0.244586}, {-0.047023, -0.081339}, + {-0.183249, 0.029525}, { 0.263435, 0.206934}, {-0.156721, -0.229993}, + {-0.112224, -0.208941}, {-0.116534, -0.123191}, {-0.073988, -0.111668}, + { 0.029484, -0.137573}, {-0.009802, -0.161685}, {-0.023273, 0.114043}, + {-0.332651, 0.049072}, {-0.394009, 0.018608}, {-0.433543, -0.035318}, + {-0.368459, -0.108024}, {-0.350215, -0.037617}, {-0.321140, -0.178537}, + { 0.020307, -0.048487}, {-0.210512, -0.232274}, {-0.082140, -0.065443}, + { 0.081961, -0.009340}, { 0.146794, 0.101973}, { 0.213999, 0.124687}, + { 0.100217, -0.054095}, {-0.114411, -0.041403}, {-0.097631, 0.037061}, + {-0.099651, -0.157978}, {-0.215790, -0.116550}, {-0.107100, 0.076300}, + { 0.084653, 0.126088}, { 0.246439, 0.091442}, { 0.160077, 0.188536}, + { 0.273900, 0.279190}, { 0.320417, 0.232550}, { 0.132710, -0.018988}, + { 0.018950, -0.091681}, {-0.032073, -0.202906}, { 0.212789, 0.178188}, + { 0.208580, 0.239726}, { 0.049420, 0.099840}, {-0.145695, -0.010619}, + {-0.132525, -0.322660}, { 0.019666, 0.126603}, { 0.260809, 0.147727}, + {-0.232795, -0.001090}, {-0.049826, 0.225987}, {-0.154774, 0.076614}, + { 0.045032, 0.221397}, { 0.321014, 0.161632}, {-0.062379, 0.053586}, + { 0.132252, 0.246675}, { 0.392627, 0.271905}, {-0.264585, 0.102344}, + {-0.327200, 0.121624}, {-0.399642, 0.124445}, {-0.108335, 0.179171}, + { 0.100374, 0.182731}, { 0.203852, 0.049505} +}; + +static const float lsf_cb5[32][2] = { + {-0.047705, 0.008002}, { 0.011332, 0.065028}, {-0.021796, -0.034777}, + {-0.147394, -0.001241}, {-0.001577, 0.020599}, {-0.083827, -0.028975}, + {-0.177707, 0.066046}, {-0.043241, -0.165144}, { 0.053322, 0.096519}, + {-0.097688, 0.106484}, {-0.023392, 0.111234}, {-0.146747, -0.159360}, + { 0.027241, -0.011806}, {-0.043156, 0.057667}, { 0.019516, -0.062116}, + { 0.025990, 0.162533}, { 0.091888, 0.009720}, {-0.098511, 0.036414}, + { 0.013722, -0.116512}, { 0.054833, -0.180975}, { 0.119497, 0.128774}, + { 0.118378, -0.125997}, { 0.065882, -0.030932}, { 0.120581, -0.039964}, + {-0.050561, -0.088577}, { 0.050134, 0.033194}, {-0.129654, -0.075112}, + {-0.225334, -0.040234}, { 0.070629, -0.084455}, { 0.095508, 0.063548}, + { 0.150514, 0.034366}, { 0.186092, -0.069272} +}; + +static const float *lsf_codebooks[] = { + lsf_cb1[0], lsf_cb2[0], lsf_cb3[0], lsf_cb4[0], lsf_cb5[0] +}; + +static const float gain_cb[128][2] = { + {0.035230, 0.161540}, {0.049223, 0.448359}, {0.057443, 0.809043}, + {0.072434, 1.760306}, {0.111491, 0.566418}, {0.112820, 1.098524}, + {0.143493, 0.726856}, {0.144840, 0.347800}, {0.180341, 1.050010}, + {0.188171, 2.197256}, {0.189771, 0.256947}, {0.198260, 0.484678}, + {0.210622, 0.755825}, {0.220694, 0.590788}, {0.237062, 1.322214}, + {0.255175, 0.338710}, {0.298980, 0.919051}, {0.314627, 0.520961}, + {0.337106, 1.469863}, {0.341422, 2.804546}, {0.363257, 0.736222}, + {0.363881, 0.367640}, {0.369850, 1.937934}, {0.370136, 1.075201}, + {0.397152, 0.549410}, {0.426557, 0.876015}, {0.450686, 0.215588}, + {0.468116, 0.671848}, {0.470495, 1.242034}, {0.474180, 1.739845}, + {0.484875, 0.490564}, {0.498917, 0.971238}, {0.530996, 0.785765}, + {0.539768, 2.130689}, {0.546021, 0.589544}, {0.546632, 3.050846}, + {0.552336, 0.389775}, {0.556302, 1.400103}, {0.559688, 1.105421}, + {0.574140, 0.667513}, {0.595547, 0.828943}, {0.597771, 0.496929}, + {0.617079, 1.863075}, {0.619657, 1.221713}, {0.621172, 0.950275}, + {0.628426, 0.630766}, {0.628689, 4.242164}, {0.640899, 1.529846}, + {0.645813, 0.331127}, {0.653056, 0.748168}, {0.662909, 1.077438}, + {0.669505, 2.631114}, {0.681570, 1.839298}, {0.687844, 0.903400}, + {0.688660, 1.270830}, {0.695070, 0.578227}, {0.697926, 0.428440}, + {0.715454, 0.812355}, {0.729981, 1.539357}, {0.737434, 1.106765}, + {0.740241, 2.033374}, {0.740871, 0.568460}, {0.752689, 0.698461}, + {0.756587, 0.893078}, {0.767797, 0.499246}, {0.768516, 3.712434}, + {0.773153, 1.332360}, {0.786125, 1.042996}, {0.788792, 0.238388}, + {0.790861, 2.273229}, {0.795338, 1.582767}, {0.809621, 0.595501}, + {0.821032, 0.756460}, {0.824590, 0.922925}, {0.826019, 1.186793}, + {0.827426, 1.885076}, {0.830080, 6.088666}, {0.837028, 2.819993}, + {0.845561, 1.490623}, {0.848323, 0.410436}, {0.856522, 0.729725}, + {0.862636, 0.966880}, {0.874561, 1.681660}, {0.874751, 1.177630}, + {0.879289, 2.301300}, {0.886671, 0.613068}, {0.896729, 0.781097}, + {0.904777, 3.484111}, {0.906098, 1.330892}, {0.919182, 1.877203}, + {0.919901, 0.569511}, {0.921772, 1.034126}, {0.922439, 0.376000}, + {0.934221, 1.485214}, {0.938842, 0.869135}, {0.939166, 2.378294}, + {0.958933, 1.122722}, {0.959042, 0.694098}, {0.960995, 1.743430}, + {0.970763, 2.884897}, {0.982881, 0.814506}, {0.990141, 1.330022}, + {0.996447, 1.823381}, {1.000013, 0.967498}, {1.000743, 0.480597}, + {1.008020, 5.095226}, {1.013883, 2.105435}, {1.026438, 0.691312}, + {1.027361, 1.558169}, {1.030123, 3.586526}, {1.033916, 1.118036}, + {1.039315, 2.543360}, {1.068596, 0.836380}, {1.081023, 1.318768}, + {1.093150, 2.267843}, {1.095607, 1.712383}, {1.102816, 1.037334}, + {1.103231, 3.536292}, {1.107320, 0.508615}, {1.150000, 7.999000}, + {1.156731, 1.236772}, {1.168428, 2.268084}, {1.184130, 0.775839}, + {1.210609, 1.511840}, {1.220663, 4.365683}, {1.224016, 0.983179}, + {1.252236, 2.778535}, {1.301176, 1.923126} +}; + +static const float pred[4] = { + 0.200, 0.334, 0.504, 0.691 +}; + +#endif /* AVCODEC_SIPRDATA_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sparc/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sparc/Makefile new file mode 100644 index 00000000..4b387461 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sparc/Makefile @@ -0,0 +1,2 @@ +OBJS-$(HAVE_VIS) += sparc/dsputil_vis.o \ + sparc/simple_idct_vis.o \ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sparc/dsputil_vis.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sparc/dsputil_vis.h new file mode 100644 index 00000000..97ff965d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/sparc/dsputil_vis.h @@ -0,0 +1,29 @@ +/* + * 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 + */ + +#ifndef AVCODEC_SPARC_DSPUTIL_VIS_H +#define AVCODEC_SPARC_DSPUTIL_VIS_H + +#include +#include "libavcodec/dsputil.h" + +void ff_simple_idct_put_vis(uint8_t *dest, int line_size, DCTELEM *data); +void ff_simple_idct_add_vis(uint8_t *dest, int line_size, DCTELEM *data); +void ff_simple_idct_vis(DCTELEM *data); + +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/srtdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/srtdec.c new file mode 100644 index 00000000..30fdc12f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/srtdec.c @@ -0,0 +1,241 @@ +/* + * SubRip subtitle decoder + * Copyright (c) 2010 Aurelien Jacobs + * + * 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 + */ + +#include "libavutil/avstring.h" +#include "libavcore/parseutils.h" +#include "avcodec.h" +#include "ass.h" + +static int html_color_parse(AVCodecContext *avctx, const char *str) +{ + uint8_t rgba[4]; + if (av_parse_color(rgba, str, strcspn(str, "\" >"), avctx) < 0) + return -1; + return rgba[0] | rgba[1] << 8 | rgba[2] << 16; +} + +enum { + PARAM_UNKNOWN = -1, + PARAM_SIZE, + PARAM_COLOR, + PARAM_FACE, + PARAM_NUMBER +}; + +typedef struct { + char tag[128]; + char param[PARAM_NUMBER][128]; +} SrtStack; + +static const char *srt_to_ass(AVCodecContext *avctx, char *out, char *out_end, + const char *in, int x1, int y1, int x2, int y2) +{ + char c, *param, buffer[128], tmp[128]; + int len, tag_close, sptr = 1, line_start = 1, an = 0, end = 0; + SrtStack stack[16]; + + stack[0].tag[0] = 0; + strcpy(stack[0].param[PARAM_SIZE], "{\\fs}"); + strcpy(stack[0].param[PARAM_COLOR], "{\\c}"); + strcpy(stack[0].param[PARAM_FACE], "{\\fn}"); + + if (x1 >= 0 && y1 >= 0) { + if (x2 >= 0 && y2 >= 0 && (x2 != x1 || y2 != y1)) + out += snprintf(out, out_end-out, + "{\\an1}{\\move(%d,%d,%d,%d)}", x1, y1, x2, y2); + else + out += snprintf(out, out_end-out, "{\\an1}{\\pos(%d,%d)}", x1, y1); + } + + for (; out < out_end && !end && *in; in++) { + switch (*in) { + case '\r': + break; + case '\n': + if (line_start) { + end = 1; + break; + } + while (out[-1] == ' ') + out--; + out += snprintf(out, out_end-out, "\\N"); + line_start = 1; + break; + case ' ': + if (!line_start) + *out++ = *in; + break; + case '{': /* skip all {\xxx} substrings except for {\an%d} + and all microdvd like styles such as {Y:xxx} */ + an += sscanf(in, "{\\an%*1u}%c", &c) == 1; + if ((an != 1 && sscanf(in, "{\\%*[^}]}%n%c", &len, &c) > 0) || + sscanf(in, "{%*1[CcFfoPSsYy]:%*[^}]}%n%c", &len, &c) > 0) { + in += len - 1; + } else + *out++ = *in; + break; + case '<': + tag_close = in[1] == '/'; + if (sscanf(in+tag_close+1, "%128[^>]>%n%c", buffer, &len,&c) >= 2) { + if ((param = strchr(buffer, ' '))) + *param++ = 0; + if ((!tag_close && sptr < FF_ARRAY_ELEMS(stack)) || + ( tag_close && sptr > 0 && !strcmp(stack[sptr-1].tag, buffer))) { + int i, j, unknown = 0; + in += len + tag_close; + if (!tag_close) + memset(stack+sptr, 0, sizeof(*stack)); + if (!strcmp(buffer, "font")) { + if (tag_close) { + for (i=PARAM_NUMBER-1; i>=0; i--) + if (stack[sptr-1].param[i][0]) + for (j=sptr-2; j>=0; j--) + if (stack[j].param[i][0]) { + out += snprintf(out, out_end-out, + stack[j].param[i]); + break; + } + } else { + while (param) { + if (!strncmp(param, "size=", 5)) { + unsigned font_size; + param += 5 + (param[5] == '"'); + if (sscanf(param, "%u", &font_size) == 1) { + snprintf(stack[sptr].param[PARAM_SIZE], + sizeof(stack[0].param[PARAM_SIZE]), + "{\\fs%u}", font_size); + } + } else if (!strncmp(param, "color=", 6)) { + param += 6 + (param[6] == '"'); + snprintf(stack[sptr].param[PARAM_COLOR], + sizeof(stack[0].param[PARAM_COLOR]), + "{\\c&H%X&}", + html_color_parse(avctx, param)); + } else if (!strncmp(param, "face=", 5)) { + param += 5 + (param[5] == '"'); + len = strcspn(param, + param[-1] == '"' ? "\"" :" "); + av_strlcpy(tmp, param, + FFMIN(sizeof(tmp), len+1)); + param += len; + snprintf(stack[sptr].param[PARAM_FACE], + sizeof(stack[0].param[PARAM_FACE]), + "{\\fn%s}", tmp); + } + if ((param = strchr(param, ' '))) + param++; + } + for (i=0; i", buffer); + } + if (tag_close) { + sptr--; + } else if (unknown && !strstr(in, tmp)) { + in -= len + tag_close; + *out++ = *in; + } else + av_strlcpy(stack[sptr++].tag, buffer, + sizeof(stack[0].tag)); + break; + } + } + default: + *out++ = *in; + break; + } + if (*in != ' ' && *in != '\r' && *in != '\n') + line_start = 0; + } + + out = FFMIN(out, out_end-3); + while (!strncmp(out-2, "\\N", 2)) + out -= 2; + while (out[-1] == ' ') + out--; + out += snprintf(out, out_end-out, "\r\n"); + return in; +} + +static const char *read_ts(const char *buf, int *ts_start, int *ts_end, + int *x1, int *y1, int *x2, int *y2) +{ + int i, hs, ms, ss, he, me, se; + + for (i=0; i<2; i++) { + /* try to read timestamps in either the first or second line */ + int c = sscanf(buf, "%d:%2d:%2d%*1[,.]%3d --> %d:%2d:%2d%*1[,.]%3d" + "%*[ ]X1:%u X2:%u Y1:%u Y2:%u", + &hs, &ms, &ss, ts_start, &he, &me, &se, ts_end, + x1, x2, y1, y2); + buf += strcspn(buf, "\n") + 1; + if (c >= 8) { + *ts_start = 100*(ss + 60*(ms + 60*hs)) + *ts_start/10; + *ts_end = 100*(se + 60*(me + 60*he)) + *ts_end /10; + return buf; + } + } + return NULL; +} + +static int srt_decode_frame(AVCodecContext *avctx, + void *data, int *got_sub_ptr, AVPacket *avpkt) +{ + AVSubtitle *sub = data; + int ts_start, ts_end, x1 = -1, y1 = -1, x2 = -1, y2 = -1; + char buffer[2048]; + const char *ptr = avpkt->data; + const char *end = avpkt->data + avpkt->size; + + if (avpkt->size <= 0) + return avpkt->size; + + ff_ass_init(sub); + + while (ptr < end && *ptr) { + ptr = read_ts(ptr, &ts_start, &ts_end, &x1, &y1, &x2, &y2); + if (!ptr) + break; + ptr = srt_to_ass(avctx, buffer, buffer+sizeof(buffer), ptr, + x1, y1, x2, y2); + ff_ass_add_rect(sub, buffer, ts_start, ts_end, 0); + } + + *got_sub_ptr = sub->num_rects > 0; + return avpkt->size; +} + +AVCodec ff_srt_decoder = { + .name = "srt", + .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), + .type = AVMEDIA_TYPE_SUBTITLE, + .id = CODEC_ID_SRT, + .init = ff_ass_subtitle_header_default, + .decode = srt_decode_frame, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.c new file mode 100644 index 00000000..4af496d3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.c @@ -0,0 +1,64 @@ +/* + * copyright (c) 2008 Michael Niedermayer + * + * 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 + */ + +#include "fft.h" +#include "synth_filter.h" + +static void synth_filter_float(FFTContext *imdct, + float *synth_buf_ptr, int *synth_buf_offset, + float synth_buf2[32], const float window[512], + float out[32], const float in[32], float scale) +{ + float *synth_buf= synth_buf_ptr + *synth_buf_offset; + int i, j; + + ff_imdct_half(imdct, synth_buf, in); + + for (i = 0; i < 16; i++){ + float a= synth_buf2[i ]; + float b= synth_buf2[i + 16]; + float c= 0; + float d= 0; + for (j = 0; j < 512 - *synth_buf_offset; j += 64){ + a += window[i + j ]*(-synth_buf[15 - i + j ]); + b += window[i + j + 16]*( synth_buf[ i + j ]); + c += window[i + j + 32]*( synth_buf[16 + i + j ]); + d += window[i + j + 48]*( synth_buf[31 - i + j ]); + } + for ( ; j < 512; j += 64){ + a += window[i + j ]*(-synth_buf[15 - i + j - 512]); + b += window[i + j + 16]*( synth_buf[ i + j - 512]); + c += window[i + j + 32]*( synth_buf[16 + i + j - 512]); + d += window[i + j + 48]*( synth_buf[31 - i + j - 512]); + } + out[i ] = a*scale; + out[i + 16] = b*scale; + synth_buf2[i ] = c; + synth_buf2[i + 16] = d; + } + *synth_buf_offset= (*synth_buf_offset - 32)&511; +} + +av_cold void ff_synth_filter_init(SynthFilterContext *c) +{ + c->synth_filter_float = synth_filter_float; + + if (ARCH_ARM) ff_synth_filter_init_arm(c); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.h new file mode 100644 index 00000000..33edcc43 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/synth_filter.h @@ -0,0 +1,37 @@ +/* + * copyright (c) 2008 Michael Niedermayer + * + * 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 + */ + +#ifndef AVCODEC_SYNTH_FILTER_H +#define AVCODEC_SYNTH_FILTER_H + +#include "fft.h" + +typedef struct SynthFilterContext { + void (*synth_filter_float)(FFTContext *imdct, + float *synth_buf_ptr, int *synth_buf_offset, + float synth_buf2[32], const float window[512], + float out[32], const float in[32], + float scale); +} SynthFilterContext; + +void ff_synth_filter_init(SynthFilterContext *c); +void ff_synth_filter_init_arm(SynthFilterContext *c); + +#endif /* AVCODEC_SYNTH_FILTER_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.c new file mode 100644 index 00000000..52f6ac2a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.c @@ -0,0 +1,41 @@ +/* + * Generate a file for hardcoded tables + * + * Copyright (c) 2009 Reimar DÃķffinger + * + * 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 + */ + +#include +#include +#include "tableprint.h" + +WRITE_1D_FUNC(int8_t, "%3"PRIi8, 15) +WRITE_1D_FUNC(uint8_t, "0x%02"PRIx8, 15) +WRITE_1D_FUNC(uint16_t, "0x%08"PRIx16, 7) +WRITE_1D_FUNC(uint32_t, "0x%08"PRIx32, 7) +WRITE_1D_FUNC(float, "%.18e", 3) + +WRITE_2D_FUNC(int8_t) +WRITE_2D_FUNC(uint8_t) +WRITE_2D_FUNC(uint32_t) +WRITE_2D_FUNC(float) + +void write_fileheader(void) { + printf("/* This file was generated by libavcodec/tableprint */\n"); + printf("#include \n"); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.h new file mode 100644 index 00000000..97a667db --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/tableprint.h @@ -0,0 +1,95 @@ +/* + * Generate a file for hardcoded tables + * + * Copyright (c) 2009 Reimar DÃķffinger + * + * 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 + */ + +#ifndef AVCODEC_TABLEPRINT_H +#define AVCODEC_TABLEPRINT_H + +#include +#include +#include "libavutil/common.h" + +#define WRITE_1D_FUNC_ARGV(type, linebrk, fmtstr, ...)\ +void write_##type##_array(const type *data, int len)\ +{\ + int i;\ + printf(" ");\ + for (i = 0; i < len - 1; i++) {\ + printf(" "fmtstr",", __VA_ARGS__);\ + if ((i & linebrk) == linebrk) printf("\n ");\ + }\ + printf(" "fmtstr"\n", __VA_ARGS__);\ +} + +#define WRITE_1D_FUNC(type, fmtstr, linebrk)\ + WRITE_1D_FUNC_ARGV(type, linebrk, fmtstr, data[i]) + +#define WRITE_2D_FUNC(type)\ +void write_##type##_2d_array(const void *arg, int len, int len2)\ +{\ + const type *data = arg;\ + int i;\ + printf(" {\n");\ + for (i = 0; i < len; i++) {\ + write_##type##_array(data + i * len2, len2);\ + printf(i == len - 1 ? " }\n" : " }, {\n");\ + }\ +} + +/** + * \defgroup printfuncs Predefined functions for printing tables + * + * \{ + */ +void write_int8_t_array (const int8_t *, int); +void write_uint8_t_array (const uint8_t *, int); +void write_uint16_t_array (const uint16_t *, int); +void write_uint32_t_array (const uint32_t *, int); +void write_float_array (const float *, int); +void write_int8_t_2d_array (const void *, int, int); +void write_uint8_t_2d_array (const void *, int, int); +void write_uint32_t_2d_array(const void *, int, int); +void write_float_2d_array (const void *, int, int); +/** \} */ // end of printfuncs group + +/** Write a standard file header */ +void write_fileheader(void); + +#define WRITE_ARRAY(prefix, type, name) \ + do { \ + const size_t array_size = FF_ARRAY_ELEMS(name); \ + printf(prefix" "#type" "#name"[%zu] = {\n", \ + array_size); \ + write_##type##_array(name, array_size); \ + printf("};\n"); \ + } while(0) + +#define WRITE_2D_ARRAY(prefix, type, name) \ + do { \ + const size_t array_size1 = FF_ARRAY_ELEMS(name); \ + const size_t array_size2 = FF_ARRAY_ELEMS(name[0]); \ + printf(prefix" "#type" "#name"[%zu][%zu] = {\n", \ + array_size1, array_size2 ); \ + write_##type##_2d_array(name, array_size1, array_size2); \ + printf("};\n"); \ + } while(0) + +#endif /* AVCODEC_TABLEPRINT_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/targa.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/targa.h new file mode 100644 index 00000000..5bc2a440 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/targa.h @@ -0,0 +1,36 @@ +/* + * 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 + * targa file common definitions + * + * Based on: + * http://www.gamers.org/dEngine/quake3/TGA.txt + * + * and other specs you can find referenced for example in: + * http://en.wikipedia.org/wiki/Truevision_TGA + */ + +enum TargaCompr { + TGA_NODATA = 0, // no image data + TGA_PAL = 1, // palettized + TGA_RGB = 2, // true-color + TGA_BW = 3, // black & white or grayscale + TGA_RLE = 8, // flag pointing that data is RLE-coded +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vaapi_h264.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vaapi_h264.c new file mode 100644 index 00000000..cbe526b6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vaapi_h264.c @@ -0,0 +1,347 @@ +/* + * H.264 HW decode acceleration through VA API + * + * Copyright (C) 2008-2009 Splitted-Desktop Systems + * + * 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 + */ + +#include "vaapi_internal.h" +#include "h264.h" + +/** @file + * This file implements the glue code between FFmpeg's and VA API's + * structures for H.264 decoding. + */ + +/** + * Initialize an empty VA API picture. + * + * VA API requires a fixed-size reference picture array. + */ +static void init_vaapi_pic(VAPictureH264 *va_pic) +{ + va_pic->picture_id = VA_INVALID_ID; + va_pic->flags = VA_PICTURE_H264_INVALID; + va_pic->TopFieldOrderCnt = 0; + va_pic->BottomFieldOrderCnt = 0; +} + +/** + * Translate an FFmpeg Picture into its VA API form. + * + * @param[out] va_pic A pointer to VA API's own picture struct + * @param[in] pic A pointer to the FFmpeg picture struct to convert + * @param[in] pic_structure The picture field type (as defined in mpegvideo.h), + * supersedes pic's field type if nonzero. + */ +static void fill_vaapi_pic(VAPictureH264 *va_pic, + Picture *pic, + int pic_structure) +{ + if (pic_structure == 0) + pic_structure = pic->reference; + + va_pic->picture_id = ff_vaapi_get_surface_id(pic); + va_pic->frame_idx = pic->long_ref ? pic->pic_id : pic->frame_num; + + va_pic->flags = 0; + if (pic_structure != PICT_FRAME) + va_pic->flags |= (pic_structure & PICT_TOP_FIELD) ? VA_PICTURE_H264_TOP_FIELD : VA_PICTURE_H264_BOTTOM_FIELD; + if (pic->reference) + va_pic->flags |= pic->long_ref ? VA_PICTURE_H264_LONG_TERM_REFERENCE : VA_PICTURE_H264_SHORT_TERM_REFERENCE; + + va_pic->TopFieldOrderCnt = 0; + if (pic->field_poc[0] != INT_MAX) + va_pic->TopFieldOrderCnt = pic->field_poc[0]; + + va_pic->BottomFieldOrderCnt = 0; + if (pic->field_poc[1] != INT_MAX) + va_pic->BottomFieldOrderCnt = pic->field_poc[1]; +} + +/** Decoded Picture Buffer (DPB). */ +typedef struct DPB { + int size; ///< Current number of reference frames in the DPB + int max_size; ///< Max number of reference frames. This is FF_ARRAY_ELEMS(VAPictureParameterBufferH264.ReferenceFrames) + VAPictureH264 *va_pics; ///< Pointer to VAPictureParameterBufferH264.ReferenceFrames array +} DPB; + +/** + * Append picture to the decoded picture buffer, in a VA API form that + * merges the second field picture attributes with the first, if + * available. The decoded picture buffer's size must be large enough + * to receive the new VA API picture object. + */ +static int dpb_add(DPB *dpb, Picture *pic) +{ + int i; + + if (dpb->size >= dpb->max_size) + return -1; + + for (i = 0; i < dpb->size; i++) { + VAPictureH264 * const va_pic = &dpb->va_pics[i]; + if (va_pic->picture_id == ff_vaapi_get_surface_id(pic)) { + VAPictureH264 temp_va_pic; + fill_vaapi_pic(&temp_va_pic, pic, 0); + + if ((temp_va_pic.flags ^ va_pic->flags) & (VA_PICTURE_H264_TOP_FIELD | VA_PICTURE_H264_BOTTOM_FIELD)) { + va_pic->flags |= temp_va_pic.flags & (VA_PICTURE_H264_TOP_FIELD | VA_PICTURE_H264_BOTTOM_FIELD); + /* Merge second field */ + if (temp_va_pic.flags & VA_PICTURE_H264_TOP_FIELD) { + va_pic->TopFieldOrderCnt = temp_va_pic.TopFieldOrderCnt; + } else { + va_pic->BottomFieldOrderCnt = temp_va_pic.BottomFieldOrderCnt; + } + } + return 0; + } + } + + fill_vaapi_pic(&dpb->va_pics[dpb->size++], pic, 0); + return 0; +} + +/** Fill in VA API reference frames array. */ +static int fill_vaapi_ReferenceFrames(VAPictureParameterBufferH264 *pic_param, + H264Context *h) +{ + DPB dpb; + int i; + + dpb.size = 0; + dpb.max_size = FF_ARRAY_ELEMS(pic_param->ReferenceFrames); + dpb.va_pics = pic_param->ReferenceFrames; + for (i = 0; i < dpb.max_size; i++) + init_vaapi_pic(&dpb.va_pics[i]); + + for (i = 0; i < h->short_ref_count; i++) { + Picture * const pic = h->short_ref[i]; + if (pic && pic->reference && dpb_add(&dpb, pic) < 0) + return -1; + } + + for (i = 0; i < 16; i++) { + Picture * const pic = h->long_ref[i]; + if (pic && pic->reference && dpb_add(&dpb, pic) < 0) + return -1; + } + return 0; +} + +/** + * Fill in VA API reference picture lists from the FFmpeg reference + * picture list. + * + * @param[out] RefPicList VA API internal reference picture list + * @param[in] ref_list A pointer to the FFmpeg reference list + * @param[in] ref_count The number of reference pictures in ref_list + */ +static void fill_vaapi_RefPicList(VAPictureH264 RefPicList[32], + Picture *ref_list, + unsigned int ref_count) +{ + unsigned int i, n = 0; + for (i = 0; i < ref_count; i++) + if (ref_list[i].reference) + fill_vaapi_pic(&RefPicList[n++], &ref_list[i], 0); + + for (; n < 32; n++) + init_vaapi_pic(&RefPicList[n]); +} + +/** + * Fill in prediction weight table. + * + * VA API requires a plain prediction weight table as it does not infer + * any value. + * + * @param[in] h A pointer to the current H.264 context + * @param[in] list The reference frame list index to use + * @param[out] luma_weight_flag VA API plain luma weight flag + * @param[out] luma_weight VA API plain luma weight table + * @param[out] luma_offset VA API plain luma offset table + * @param[out] chroma_weight_flag VA API plain chroma weight flag + * @param[out] chroma_weight VA API plain chroma weight table + * @param[out] chroma_offset VA API plain chroma offset table + */ +static void fill_vaapi_plain_pred_weight_table(H264Context *h, + int list, + unsigned char *luma_weight_flag, + short luma_weight[32], + short luma_offset[32], + unsigned char *chroma_weight_flag, + short chroma_weight[32][2], + short chroma_offset[32][2]) +{ + unsigned int i, j; + + *luma_weight_flag = h->luma_weight_flag[list]; + *chroma_weight_flag = h->chroma_weight_flag[list]; + + for (i = 0; i < h->ref_count[list]; i++) { + /* VA API also wants the inferred (default) values, not + only what is available in the bitstream (7.4.3.2). */ + if (h->luma_weight_flag[list]) { + luma_weight[i] = h->luma_weight[i][list][0]; + luma_offset[i] = h->luma_weight[i][list][1]; + } else { + luma_weight[i] = 1 << h->luma_log2_weight_denom; + luma_offset[i] = 0; + } + for (j = 0; j < 2; j++) { + if (h->chroma_weight_flag[list]) { + chroma_weight[i][j] = h->chroma_weight[i][list][j][0]; + chroma_offset[i][j] = h->chroma_weight[i][list][j][1]; + } else { + chroma_weight[i][j] = 1 << h->chroma_log2_weight_denom; + chroma_offset[i][j] = 0; + } + } + } +} + +/** Initialize and start decoding a frame with VA API. */ +static int start_frame(AVCodecContext *avctx, + av_unused const uint8_t *buffer, + av_unused uint32_t size) +{ + H264Context * const h = avctx->priv_data; + MpegEncContext * const s = &h->s; + struct vaapi_context * const vactx = avctx->hwaccel_context; + VAPictureParameterBufferH264 *pic_param; + VAIQMatrixBufferH264 *iq_matrix; + + av_dlog(avctx, "start_frame()\n"); + + vactx->slice_param_size = sizeof(VASliceParameterBufferH264); + + /* Fill in VAPictureParameterBufferH264. */ + pic_param = ff_vaapi_alloc_pic_param(vactx, sizeof(VAPictureParameterBufferH264)); + if (!pic_param) + return -1; + fill_vaapi_pic(&pic_param->CurrPic, s->current_picture_ptr, s->picture_structure); + if (fill_vaapi_ReferenceFrames(pic_param, h) < 0) + return -1; + pic_param->picture_width_in_mbs_minus1 = s->mb_width - 1; + pic_param->picture_height_in_mbs_minus1 = s->mb_height - 1; + pic_param->bit_depth_luma_minus8 = h->sps.bit_depth_luma - 8; + pic_param->bit_depth_chroma_minus8 = h->sps.bit_depth_chroma - 8; + pic_param->num_ref_frames = h->sps.ref_frame_count; + pic_param->seq_fields.value = 0; /* reset all bits */ + pic_param->seq_fields.bits.chroma_format_idc = h->sps.chroma_format_idc; + pic_param->seq_fields.bits.residual_colour_transform_flag = h->sps.residual_color_transform_flag; /* XXX: only for 4:4:4 high profile? */ + pic_param->seq_fields.bits.gaps_in_frame_num_value_allowed_flag = h->sps.gaps_in_frame_num_allowed_flag; + pic_param->seq_fields.bits.frame_mbs_only_flag = h->sps.frame_mbs_only_flag; + pic_param->seq_fields.bits.mb_adaptive_frame_field_flag = h->sps.mb_aff; + pic_param->seq_fields.bits.direct_8x8_inference_flag = h->sps.direct_8x8_inference_flag; + pic_param->seq_fields.bits.MinLumaBiPredSize8x8 = h->sps.level_idc >= 31; /* A.3.3.2 */ + pic_param->seq_fields.bits.log2_max_frame_num_minus4 = h->sps.log2_max_frame_num - 4; + pic_param->seq_fields.bits.pic_order_cnt_type = h->sps.poc_type; + pic_param->seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4 = h->sps.log2_max_poc_lsb - 4; + pic_param->seq_fields.bits.delta_pic_order_always_zero_flag = h->sps.delta_pic_order_always_zero_flag; + pic_param->num_slice_groups_minus1 = h->pps.slice_group_count - 1; + pic_param->slice_group_map_type = h->pps.mb_slice_group_map_type; + pic_param->slice_group_change_rate_minus1 = 0; /* XXX: unimplemented in FFmpeg */ + pic_param->pic_init_qp_minus26 = h->pps.init_qp - 26; + pic_param->pic_init_qs_minus26 = h->pps.init_qs - 26; + pic_param->chroma_qp_index_offset = h->pps.chroma_qp_index_offset[0]; + pic_param->second_chroma_qp_index_offset = h->pps.chroma_qp_index_offset[1]; + pic_param->pic_fields.value = 0; /* reset all bits */ + pic_param->pic_fields.bits.entropy_coding_mode_flag = h->pps.cabac; + pic_param->pic_fields.bits.weighted_pred_flag = h->pps.weighted_pred; + pic_param->pic_fields.bits.weighted_bipred_idc = h->pps.weighted_bipred_idc; + pic_param->pic_fields.bits.transform_8x8_mode_flag = h->pps.transform_8x8_mode; + pic_param->pic_fields.bits.field_pic_flag = s->picture_structure != PICT_FRAME; + pic_param->pic_fields.bits.constrained_intra_pred_flag = h->pps.constrained_intra_pred; + pic_param->pic_fields.bits.pic_order_present_flag = h->pps.pic_order_present; + pic_param->pic_fields.bits.deblocking_filter_control_present_flag = h->pps.deblocking_filter_parameters_present; + pic_param->pic_fields.bits.redundant_pic_cnt_present_flag = h->pps.redundant_pic_cnt_present; + pic_param->pic_fields.bits.reference_pic_flag = h->nal_ref_idc != 0; + pic_param->frame_num = h->frame_num; + + /* Fill in VAIQMatrixBufferH264. */ + iq_matrix = ff_vaapi_alloc_iq_matrix(vactx, sizeof(VAIQMatrixBufferH264)); + if (!iq_matrix) + return -1; + memcpy(iq_matrix->ScalingList4x4, h->pps.scaling_matrix4, sizeof(iq_matrix->ScalingList4x4)); + memcpy(iq_matrix->ScalingList8x8, h->pps.scaling_matrix8, sizeof(iq_matrix->ScalingList8x8)); + return 0; +} + +/** End a hardware decoding based frame. */ +static int end_frame(AVCodecContext *avctx) +{ + H264Context * const h = avctx->priv_data; + + av_dlog(avctx, "end_frame()\n"); + return ff_vaapi_common_end_frame(&h->s); +} + +/** Decode the given H.264 slice with VA API. */ +static int decode_slice(AVCodecContext *avctx, + const uint8_t *buffer, + uint32_t size) +{ + H264Context * const h = avctx->priv_data; + MpegEncContext * const s = &h->s; + VASliceParameterBufferH264 *slice_param; + + av_dlog(avctx, "decode_slice(): buffer %p, size %d\n", buffer, size); + + /* Fill in VASliceParameterBufferH264. */ + slice_param = (VASliceParameterBufferH264 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size); + if (!slice_param) + return -1; + slice_param->slice_data_bit_offset = get_bits_count(&h->s.gb) + 8; /* bit buffer started beyond nal_unit_type */ + slice_param->first_mb_in_slice = (s->mb_y >> FIELD_OR_MBAFF_PICTURE) * s->mb_width + s->mb_x; + slice_param->slice_type = ff_h264_get_slice_type(h); + slice_param->direct_spatial_mv_pred_flag = h->slice_type == FF_B_TYPE ? h->direct_spatial_mv_pred : 0; + slice_param->num_ref_idx_l0_active_minus1 = h->list_count > 0 ? h->ref_count[0] - 1 : 0; + slice_param->num_ref_idx_l1_active_minus1 = h->list_count > 1 ? h->ref_count[1] - 1 : 0; + slice_param->cabac_init_idc = h->cabac_init_idc; + slice_param->slice_qp_delta = s->qscale - h->pps.init_qp; + slice_param->disable_deblocking_filter_idc = h->deblocking_filter < 2 ? !h->deblocking_filter : h->deblocking_filter; + slice_param->slice_alpha_c0_offset_div2 = h->slice_alpha_c0_offset / 2 - 26; + slice_param->slice_beta_offset_div2 = h->slice_beta_offset / 2 - 26; + slice_param->luma_log2_weight_denom = h->luma_log2_weight_denom; + slice_param->chroma_log2_weight_denom = h->chroma_log2_weight_denom; + + fill_vaapi_RefPicList(slice_param->RefPicList0, h->ref_list[0], h->list_count > 0 ? h->ref_count[0] : 0); + fill_vaapi_RefPicList(slice_param->RefPicList1, h->ref_list[1], h->list_count > 1 ? h->ref_count[1] : 0); + + fill_vaapi_plain_pred_weight_table(h, 0, + &slice_param->luma_weight_l0_flag, slice_param->luma_weight_l0, slice_param->luma_offset_l0, + &slice_param->chroma_weight_l0_flag, slice_param->chroma_weight_l0, slice_param->chroma_offset_l0); + fill_vaapi_plain_pred_weight_table(h, 1, + &slice_param->luma_weight_l1_flag, slice_param->luma_weight_l1, slice_param->luma_offset_l1, + &slice_param->chroma_weight_l1_flag, slice_param->chroma_weight_l1, slice_param->chroma_offset_l1); + return 0; +} + +AVHWAccel ff_h264_vaapi_hwaccel = { + .name = "h264_vaapi", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_H264, + .pix_fmt = PIX_FMT_VAAPI_VLD, + .capabilities = 0, + .start_frame = start_frame, + .end_frame = end_frame, + .decode_slice = decode_slice, + .priv_data_size = 0, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp56dsp.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp56dsp.c new file mode 100644 index 00000000..c629343a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp56dsp.c @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2006 Aurelien Jacobs + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#include +#include "avcodec.h" +#include "vp56dsp.h" + +/* Gives very similar result than the vp6 version except in a few cases */ +static int vp5_adjust(int v, int t) +{ + int s2, s1 = v >> 31; + v ^= s1; + v -= s1; + v *= v < 2*t; + v -= t; + s2 = v >> 31; + v ^= s2; + v -= s2; + v = t - v; + v += s1; + v ^= s1; + return v; +} + +static int vp6_adjust(int v, int t) +{ + int V = v, s = v >> 31; + V ^= s; + V -= s; + if (V-t-1 >= (unsigned)(t-1)) + return v; + V = 2*t - V; + V += s; + V ^= s; + return V; +} + + +#define VP56_EDGE_FILTER(pfx, suf, pix_inc, line_inc) \ +static void pfx##_edge_filter_##suf(uint8_t *yuv, int stride, int t) \ +{ \ + int pix2_inc = 2 * pix_inc; \ + int i, v; \ + \ + for (i=0; i<12; i++) { \ + v = (yuv[-pix2_inc] + 3*(yuv[0]-yuv[-pix_inc]) - yuv[pix_inc] + 4)>>3;\ + v = pfx##_adjust(v, t); \ + yuv[-pix_inc] = av_clip_uint8(yuv[-pix_inc] + v); \ + yuv[0] = av_clip_uint8(yuv[0] - v); \ + yuv += line_inc; \ + } \ +} + +VP56_EDGE_FILTER(vp5, hor, 1, stride) +VP56_EDGE_FILTER(vp5, ver, stride, 1) +VP56_EDGE_FILTER(vp6, hor, 1, stride) +VP56_EDGE_FILTER(vp6, ver, stride, 1) + +void ff_vp56dsp_init(VP56DSPContext *s, enum CodecID codec) +{ + if (codec == CODEC_ID_VP5) { + s->edge_filter_hor = vp5_edge_filter_hor; + s->edge_filter_ver = vp5_edge_filter_ver; + } else { + s->edge_filter_hor = vp6_edge_filter_hor; + s->edge_filter_ver = vp6_edge_filter_ver; + + if (CONFIG_VP6_DECODER) { + s->vp6_filter_diag4 = ff_vp6_filter_diag4_c; + } + } + + if (ARCH_ARM) ff_vp56dsp_init_arm(s, codec); + if (HAVE_MMX) ff_vp56dsp_init_x86(s, codec); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp56dsp.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp56dsp.h new file mode 100644 index 00000000..74a9cb53 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp56dsp.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#ifndef AVCODEC_VP56DSP_H +#define AVCODEC_VP56DSP_H + +#include +#include "avcodec.h" + +typedef struct VP56DSPContext { + void (*edge_filter_hor)(uint8_t *yuv, int stride, int t); + void (*edge_filter_ver)(uint8_t *yuv, int stride, int t); + + void (*vp6_filter_diag4)(uint8_t *dst, uint8_t *src, int stride, + const int16_t *h_weights,const int16_t *v_weights); +} VP56DSPContext; + +void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride, + const int16_t *h_weights, const int16_t *v_weights); + +void ff_vp56dsp_init(VP56DSPContext *s, enum CodecID codec); +void ff_vp56dsp_init_arm(VP56DSPContext *s, enum CodecID codec); +void ff_vp56dsp_init_x86(VP56DSPContext* c, enum CodecID codec); + +#endif /* AVCODEC_VP56DSP_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp56rac.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp56rac.c new file mode 100644 index 00000000..f11531de --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp56rac.c @@ -0,0 +1,47 @@ +/* + * VP5/6/8 decoder + * Copyright (c) 2010 Jason Garrett-Glaser + * + * 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 + */ + +#include "libavutil/common.h" +#include "vp56.h" + +const uint8_t ff_vp56_norm_shift[256]= { + 8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +void ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size) +{ + c->high = 255; + c->bits = -16; + c->buffer = buf; + c->end = buf + buf_size; + c->code_word = bytestream_get_be24(&c->buffer); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8.c new file mode 100644 index 00000000..effeb4ed --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8.c @@ -0,0 +1,1856 @@ +/** + * VP8 compatible video decoder + * + * Copyright (C) 2010 David Conrad + * Copyright (C) 2010 Ronald S. Bultje + * Copyright (C) 2010 Jason Garrett-Glaser + * + * 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 + */ + +#include "libavcore/imgutils.h" +#include "avcodec.h" +#include "vp56.h" +#include "vp8data.h" +#include "vp8dsp.h" +#include "h264pred.h" +#include "rectangle.h" + +typedef struct { + uint8_t filter_level; + uint8_t inner_limit; + uint8_t inner_filter; +} VP8FilterStrength; + +typedef struct { + uint8_t skip; + // todo: make it possible to check for at least (i4x4 or split_mv) + // in one op. are others needed? + uint8_t mode; + uint8_t ref_frame; + uint8_t partitioning; + VP56mv mv; + VP56mv bmv[16]; +} VP8Macroblock; + +typedef struct { + AVCodecContext *avctx; + DSPContext dsp; + VP8DSPContext vp8dsp; + H264PredContext hpc; + vp8_mc_func put_pixels_tab[3][3][3]; + AVFrame frames[4]; + AVFrame *framep[4]; + uint8_t *edge_emu_buffer; + VP56RangeCoder c; ///< header context, includes mb modes and motion vectors + int profile; + + int mb_width; /* number of horizontal MB */ + int mb_height; /* number of vertical MB */ + int linesize; + int uvlinesize; + + int keyframe; + int invisible; + int update_last; ///< update VP56_FRAME_PREVIOUS with the current one + int update_golden; ///< VP56_FRAME_NONE if not updated, or which frame to copy if so + int update_altref; + int deblock_filter; + + /** + * If this flag is not set, all the probability updates + * are discarded after this frame is decoded. + */ + int update_probabilities; + + /** + * All coefficients are contained in separate arith coding contexts. + * There can be 1, 2, 4, or 8 of these after the header context. + */ + int num_coeff_partitions; + VP56RangeCoder coeff_partition[8]; + + VP8Macroblock *macroblocks; + VP8Macroblock *macroblocks_base; + VP8FilterStrength *filter_strength; + + uint8_t *intra4x4_pred_mode_top; + uint8_t intra4x4_pred_mode_left[4]; + uint8_t *segmentation_map; + + /** + * Cache of the top row needed for intra prediction + * 16 for luma, 8 for each chroma plane + */ + uint8_t (*top_border)[16+8+8]; + + /** + * For coeff decode, we need to know whether the above block had non-zero + * coefficients. This means for each macroblock, we need data for 4 luma + * blocks, 2 u blocks, 2 v blocks, and the luma dc block, for a total of 9 + * per macroblock. We keep the last row in top_nnz. + */ + uint8_t (*top_nnz)[9]; + DECLARE_ALIGNED(8, uint8_t, left_nnz)[9]; + + /** + * This is the index plus one of the last non-zero coeff + * for each of the blocks in the current macroblock. + * So, 0 -> no coeffs + * 1 -> dc-only (special transform) + * 2+-> full transform + */ + DECLARE_ALIGNED(16, uint8_t, non_zero_count_cache)[6][4]; + DECLARE_ALIGNED(16, DCTELEM, block)[6][4][16]; + DECLARE_ALIGNED(16, DCTELEM, block_dc)[16]; + uint8_t intra4x4_pred_mode_mb[16]; + + int chroma_pred_mode; ///< 8x8c pred mode of the current macroblock + int segment; ///< segment of the current macroblock + + int mbskip_enabled; + int sign_bias[4]; ///< one state [0, 1] per ref frame type + int ref_count[3]; + + /** + * Base parameters for segmentation, i.e. per-macroblock parameters. + * These must be kept unchanged even if segmentation is not used for + * a frame, since the values persist between interframes. + */ + struct { + int enabled; + int absolute_vals; + int update_map; + int8_t base_quant[4]; + int8_t filter_level[4]; ///< base loop filter level + } segmentation; + + /** + * Macroblocks can have one of 4 different quants in a frame when + * segmentation is enabled. + * If segmentation is disabled, only the first segment's values are used. + */ + struct { + // [0] - DC qmul [1] - AC qmul + int16_t luma_qmul[2]; + int16_t luma_dc_qmul[2]; ///< luma dc-only block quant + int16_t chroma_qmul[2]; + } qmat[4]; + + struct { + int simple; + int level; + int sharpness; + } filter; + + struct { + int enabled; ///< whether each mb can have a different strength based on mode/ref + + /** + * filter strength adjustment for the following macroblock modes: + * [0] - i4x4 + * [1] - zero mv + * [2] - inter modes except for zero or split mv + * [3] - split mv + * i16x16 modes never have any adjustment + */ + int8_t mode[4]; + + /** + * filter strength adjustment for macroblocks that reference: + * [0] - intra / VP56_FRAME_CURRENT + * [1] - VP56_FRAME_PREVIOUS + * [2] - VP56_FRAME_GOLDEN + * [3] - altref / VP56_FRAME_GOLDEN2 + */ + int8_t ref[4]; + } lf_delta; + + /** + * These are all of the updatable probabilities for binary decisions. + * They are only implictly reset on keyframes, making it quite likely + * for an interframe to desync if a prior frame's header was corrupt + * or missing outright! + */ + struct { + uint8_t segmentid[3]; + uint8_t mbskip; + uint8_t intra; + uint8_t last; + uint8_t golden; + uint8_t pred16x16[4]; + uint8_t pred8x8c[3]; + /* Padded to allow overreads */ + uint8_t token[4][17][3][NUM_DCT_TOKENS-1]; + uint8_t mvc[2][19]; + } prob[2]; +} VP8Context; + +static void vp8_decode_flush(AVCodecContext *avctx) +{ + VP8Context *s = avctx->priv_data; + int i; + + for (i = 0; i < 4; i++) + if (s->frames[i].data[0]) + avctx->release_buffer(avctx, &s->frames[i]); + memset(s->framep, 0, sizeof(s->framep)); + + av_freep(&s->macroblocks_base); + av_freep(&s->filter_strength); + av_freep(&s->intra4x4_pred_mode_top); + av_freep(&s->top_nnz); + av_freep(&s->edge_emu_buffer); + av_freep(&s->top_border); + av_freep(&s->segmentation_map); + + s->macroblocks = NULL; +} + +static int update_dimensions(VP8Context *s, int width, int height) +{ + if (av_image_check_size(width, height, 0, s->avctx)) + return AVERROR_INVALIDDATA; + + vp8_decode_flush(s->avctx); + + avcodec_set_dimensions(s->avctx, width, height); + + s->mb_width = (s->avctx->coded_width +15) / 16; + s->mb_height = (s->avctx->coded_height+15) / 16; + + s->macroblocks_base = av_mallocz((s->mb_width+s->mb_height*2+1)*sizeof(*s->macroblocks)); + s->filter_strength = av_mallocz(s->mb_width*sizeof(*s->filter_strength)); + s->intra4x4_pred_mode_top = av_mallocz(s->mb_width*4); + s->top_nnz = av_mallocz(s->mb_width*sizeof(*s->top_nnz)); + s->top_border = av_mallocz((s->mb_width+1)*sizeof(*s->top_border)); + s->segmentation_map = av_mallocz(s->mb_width*s->mb_height); + + if (!s->macroblocks_base || !s->filter_strength || !s->intra4x4_pred_mode_top || + !s->top_nnz || !s->top_border || !s->segmentation_map) + return AVERROR(ENOMEM); + + s->macroblocks = s->macroblocks_base + 1; + + return 0; +} + +static void parse_segment_info(VP8Context *s) +{ + VP56RangeCoder *c = &s->c; + int i; + + s->segmentation.update_map = vp8_rac_get(c); + + if (vp8_rac_get(c)) { // update segment feature data + s->segmentation.absolute_vals = vp8_rac_get(c); + + for (i = 0; i < 4; i++) + s->segmentation.base_quant[i] = vp8_rac_get_sint(c, 7); + + for (i = 0; i < 4; i++) + s->segmentation.filter_level[i] = vp8_rac_get_sint(c, 6); + } + if (s->segmentation.update_map) + for (i = 0; i < 3; i++) + s->prob->segmentid[i] = vp8_rac_get(c) ? vp8_rac_get_uint(c, 8) : 255; +} + +static void update_lf_deltas(VP8Context *s) +{ + VP56RangeCoder *c = &s->c; + int i; + + for (i = 0; i < 4; i++) + s->lf_delta.ref[i] = vp8_rac_get_sint(c, 6); + + for (i = 0; i < 4; i++) + s->lf_delta.mode[i] = vp8_rac_get_sint(c, 6); +} + +static int setup_partitions(VP8Context *s, const uint8_t *buf, int buf_size) +{ + const uint8_t *sizes = buf; + int i; + + s->num_coeff_partitions = 1 << vp8_rac_get_uint(&s->c, 2); + + buf += 3*(s->num_coeff_partitions-1); + buf_size -= 3*(s->num_coeff_partitions-1); + if (buf_size < 0) + return -1; + + for (i = 0; i < s->num_coeff_partitions-1; i++) { + int size = AV_RL24(sizes + 3*i); + if (buf_size - size < 0) + return -1; + + ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, size); + buf += size; + buf_size -= size; + } + ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, buf_size); + + return 0; +} + +static void get_quants(VP8Context *s) +{ + VP56RangeCoder *c = &s->c; + int i, base_qi; + + int yac_qi = vp8_rac_get_uint(c, 7); + int ydc_delta = vp8_rac_get_sint(c, 4); + int y2dc_delta = vp8_rac_get_sint(c, 4); + int y2ac_delta = vp8_rac_get_sint(c, 4); + int uvdc_delta = vp8_rac_get_sint(c, 4); + int uvac_delta = vp8_rac_get_sint(c, 4); + + for (i = 0; i < 4; i++) { + if (s->segmentation.enabled) { + base_qi = s->segmentation.base_quant[i]; + if (!s->segmentation.absolute_vals) + base_qi += yac_qi; + } else + base_qi = yac_qi; + + s->qmat[i].luma_qmul[0] = vp8_dc_qlookup[av_clip(base_qi + ydc_delta , 0, 127)]; + s->qmat[i].luma_qmul[1] = vp8_ac_qlookup[av_clip(base_qi , 0, 127)]; + s->qmat[i].luma_dc_qmul[0] = 2 * vp8_dc_qlookup[av_clip(base_qi + y2dc_delta, 0, 127)]; + s->qmat[i].luma_dc_qmul[1] = 155 * vp8_ac_qlookup[av_clip(base_qi + y2ac_delta, 0, 127)] / 100; + s->qmat[i].chroma_qmul[0] = vp8_dc_qlookup[av_clip(base_qi + uvdc_delta, 0, 127)]; + s->qmat[i].chroma_qmul[1] = vp8_ac_qlookup[av_clip(base_qi + uvac_delta, 0, 127)]; + + s->qmat[i].luma_dc_qmul[1] = FFMAX(s->qmat[i].luma_dc_qmul[1], 8); + s->qmat[i].chroma_qmul[0] = FFMIN(s->qmat[i].chroma_qmul[0], 132); + } +} + +/** + * Determine which buffers golden and altref should be updated with after this frame. + * The spec isn't clear here, so I'm going by my understanding of what libvpx does + * + * Intra frames update all 3 references + * Inter frames update VP56_FRAME_PREVIOUS if the update_last flag is set + * If the update (golden|altref) flag is set, it's updated with the current frame + * if update_last is set, and VP56_FRAME_PREVIOUS otherwise. + * If the flag is not set, the number read means: + * 0: no update + * 1: VP56_FRAME_PREVIOUS + * 2: update golden with altref, or update altref with golden + */ +static VP56Frame ref_to_update(VP8Context *s, int update, VP56Frame ref) +{ + VP56RangeCoder *c = &s->c; + + if (update) + return VP56_FRAME_CURRENT; + + switch (vp8_rac_get_uint(c, 2)) { + case 1: + return VP56_FRAME_PREVIOUS; + case 2: + return (ref == VP56_FRAME_GOLDEN) ? VP56_FRAME_GOLDEN2 : VP56_FRAME_GOLDEN; + } + return VP56_FRAME_NONE; +} + +static void update_refs(VP8Context *s) +{ + VP56RangeCoder *c = &s->c; + + int update_golden = vp8_rac_get(c); + int update_altref = vp8_rac_get(c); + + s->update_golden = ref_to_update(s, update_golden, VP56_FRAME_GOLDEN); + s->update_altref = ref_to_update(s, update_altref, VP56_FRAME_GOLDEN2); +} + +static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size) +{ + VP56RangeCoder *c = &s->c; + int header_size, hscale, vscale, i, j, k, l, m, ret; + int width = s->avctx->width; + int height = s->avctx->height; + + s->keyframe = !(buf[0] & 1); + s->profile = (buf[0]>>1) & 7; + s->invisible = !(buf[0] & 0x10); + header_size = AV_RL24(buf) >> 5; + buf += 3; + buf_size -= 3; + + if (s->profile > 3) + av_log(s->avctx, AV_LOG_WARNING, "Unknown profile %d\n", s->profile); + + if (!s->profile) + memcpy(s->put_pixels_tab, s->vp8dsp.put_vp8_epel_pixels_tab, sizeof(s->put_pixels_tab)); + else // profile 1-3 use bilinear, 4+ aren't defined so whatever + memcpy(s->put_pixels_tab, s->vp8dsp.put_vp8_bilinear_pixels_tab, sizeof(s->put_pixels_tab)); + + if (header_size > buf_size - 7*s->keyframe) { + av_log(s->avctx, AV_LOG_ERROR, "Header size larger than data provided\n"); + return AVERROR_INVALIDDATA; + } + + if (s->keyframe) { + if (AV_RL24(buf) != 0x2a019d) { + av_log(s->avctx, AV_LOG_ERROR, "Invalid start code 0x%x\n", AV_RL24(buf)); + return AVERROR_INVALIDDATA; + } + width = AV_RL16(buf+3) & 0x3fff; + height = AV_RL16(buf+5) & 0x3fff; + hscale = buf[4] >> 6; + vscale = buf[6] >> 6; + buf += 7; + buf_size -= 7; + + if (hscale || vscale) + av_log_missing_feature(s->avctx, "Upscaling", 1); + + s->update_golden = s->update_altref = VP56_FRAME_CURRENT; + for (i = 0; i < 4; i++) + for (j = 0; j < 16; j++) + memcpy(s->prob->token[i][j], vp8_token_default_probs[i][vp8_coeff_band[j]], + sizeof(s->prob->token[i][j])); + memcpy(s->prob->pred16x16, vp8_pred16x16_prob_inter, sizeof(s->prob->pred16x16)); + memcpy(s->prob->pred8x8c , vp8_pred8x8c_prob_inter , sizeof(s->prob->pred8x8c)); + memcpy(s->prob->mvc , vp8_mv_default_prob , sizeof(s->prob->mvc)); + memset(&s->segmentation, 0, sizeof(s->segmentation)); + } + + if (!s->macroblocks_base || /* first frame */ + width != s->avctx->width || height != s->avctx->height) { + if ((ret = update_dimensions(s, width, height) < 0)) + return ret; + } + + ff_vp56_init_range_decoder(c, buf, header_size); + buf += header_size; + buf_size -= header_size; + + if (s->keyframe) { + if (vp8_rac_get(c)) + av_log(s->avctx, AV_LOG_WARNING, "Unspecified colorspace\n"); + vp8_rac_get(c); // whether we can skip clamping in dsp functions + } + + if ((s->segmentation.enabled = vp8_rac_get(c))) + parse_segment_info(s); + else + s->segmentation.update_map = 0; // FIXME: move this to some init function? + + s->filter.simple = vp8_rac_get(c); + s->filter.level = vp8_rac_get_uint(c, 6); + s->filter.sharpness = vp8_rac_get_uint(c, 3); + + if ((s->lf_delta.enabled = vp8_rac_get(c))) + if (vp8_rac_get(c)) + update_lf_deltas(s); + + if (setup_partitions(s, buf, buf_size)) { + av_log(s->avctx, AV_LOG_ERROR, "Invalid partitions\n"); + return AVERROR_INVALIDDATA; + } + + get_quants(s); + + if (!s->keyframe) { + update_refs(s); + s->sign_bias[VP56_FRAME_GOLDEN] = vp8_rac_get(c); + s->sign_bias[VP56_FRAME_GOLDEN2 /* altref */] = vp8_rac_get(c); + } + + // if we aren't saving this frame's probabilities for future frames, + // make a copy of the current probabilities + if (!(s->update_probabilities = vp8_rac_get(c))) + s->prob[1] = s->prob[0]; + + s->update_last = s->keyframe || vp8_rac_get(c); + + for (i = 0; i < 4; i++) + for (j = 0; j < 8; j++) + for (k = 0; k < 3; k++) + for (l = 0; l < NUM_DCT_TOKENS-1; l++) + if (vp56_rac_get_prob_branchy(c, vp8_token_update_probs[i][j][k][l])) { + int prob = vp8_rac_get_uint(c, 8); + for (m = 0; vp8_coeff_band_indexes[j][m] >= 0; m++) + s->prob->token[i][vp8_coeff_band_indexes[j][m]][k][l] = prob; + } + + if ((s->mbskip_enabled = vp8_rac_get(c))) + s->prob->mbskip = vp8_rac_get_uint(c, 8); + + if (!s->keyframe) { + s->prob->intra = vp8_rac_get_uint(c, 8); + s->prob->last = vp8_rac_get_uint(c, 8); + s->prob->golden = vp8_rac_get_uint(c, 8); + + if (vp8_rac_get(c)) + for (i = 0; i < 4; i++) + s->prob->pred16x16[i] = vp8_rac_get_uint(c, 8); + if (vp8_rac_get(c)) + for (i = 0; i < 3; i++) + s->prob->pred8x8c[i] = vp8_rac_get_uint(c, 8); + + // 17.2 MV probability update + for (i = 0; i < 2; i++) + for (j = 0; j < 19; j++) + if (vp56_rac_get_prob_branchy(c, vp8_mv_update_prob[i][j])) + s->prob->mvc[i][j] = vp8_rac_get_nn(c); + } + + return 0; +} + +static av_always_inline +void clamp_mv(VP8Context *s, VP56mv *dst, const VP56mv *src, int mb_x, int mb_y) +{ +#define MARGIN (16 << 2) + dst->x = av_clip(src->x, -((mb_x << 6) + MARGIN), + ((s->mb_width - 1 - mb_x) << 6) + MARGIN); + dst->y = av_clip(src->y, -((mb_y << 6) + MARGIN), + ((s->mb_height - 1 - mb_y) << 6) + MARGIN); +} + +static av_always_inline +void find_near_mvs(VP8Context *s, VP8Macroblock *mb, + VP56mv near[2], VP56mv *best, uint8_t cnt[4]) +{ + VP8Macroblock *mb_edge[3] = { mb + 2 /* top */, + mb - 1 /* left */, + mb + 1 /* top-left */ }; + enum { EDGE_TOP, EDGE_LEFT, EDGE_TOPLEFT }; + VP56mv near_mv[4] = {{ 0 }}; + enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV }; + int idx = CNT_ZERO; + int best_idx = CNT_ZERO; + int cur_sign_bias = s->sign_bias[mb->ref_frame]; + int *sign_bias = s->sign_bias; + + /* Process MB on top, left and top-left */ + #define MV_EDGE_CHECK(n)\ + {\ + VP8Macroblock *edge = mb_edge[n];\ + int edge_ref = edge->ref_frame;\ + if (edge_ref != VP56_FRAME_CURRENT) {\ + uint32_t mv = AV_RN32A(&edge->mv);\ + if (mv) {\ + if (cur_sign_bias != sign_bias[edge_ref]) {\ + /* SWAR negate of the values in mv. */\ + mv = ~mv;\ + mv = ((mv&0x7fff7fff) + 0x00010001) ^ (mv&0x80008000);\ + }\ + if (!n || mv != AV_RN32A(&near_mv[idx]))\ + AV_WN32A(&near_mv[++idx], mv);\ + cnt[idx] += 1 + (n != 2);\ + } else\ + cnt[CNT_ZERO] += 1 + (n != 2);\ + }\ + } + MV_EDGE_CHECK(0) + MV_EDGE_CHECK(1) + MV_EDGE_CHECK(2) + + /* If we have three distinct MVs, merge first and last if they're the same */ + if (cnt[CNT_SPLITMV] && AV_RN32A(&near_mv[1+EDGE_TOP]) == AV_RN32A(&near_mv[1+EDGE_TOPLEFT])) + cnt[CNT_NEAREST] += 1; + + cnt[CNT_SPLITMV] = ((mb_edge[EDGE_LEFT]->mode == VP8_MVMODE_SPLIT) + + (mb_edge[EDGE_TOP]->mode == VP8_MVMODE_SPLIT)) * 2 + + (mb_edge[EDGE_TOPLEFT]->mode == VP8_MVMODE_SPLIT); + + /* Swap near and nearest if necessary */ + if (cnt[CNT_NEAR] > cnt[CNT_NEAREST]) { + FFSWAP(uint8_t, cnt[CNT_NEAREST], cnt[CNT_NEAR]); + FFSWAP( VP56mv, near_mv[CNT_NEAREST], near_mv[CNT_NEAR]); + } + + /* Choose the best mv out of 0,0 and the nearest mv */ + if (cnt[CNT_NEAREST] >= cnt[CNT_ZERO]) + best_idx = CNT_NEAREST; + + mb->mv = near_mv[best_idx]; + near[0] = near_mv[CNT_NEAREST]; + near[1] = near_mv[CNT_NEAR]; +} + +/** + * Motion vector coding, 17.1. + */ +static int read_mv_component(VP56RangeCoder *c, const uint8_t *p) +{ + int bit, x = 0; + + if (vp56_rac_get_prob_branchy(c, p[0])) { + int i; + + for (i = 0; i < 3; i++) + x += vp56_rac_get_prob(c, p[9 + i]) << i; + for (i = 9; i > 3; i--) + x += vp56_rac_get_prob(c, p[9 + i]) << i; + if (!(x & 0xFFF0) || vp56_rac_get_prob(c, p[12])) + x += 8; + } else { + // small_mvtree + const uint8_t *ps = p+2; + bit = vp56_rac_get_prob(c, *ps); + ps += 1 + 3*bit; + x += 4*bit; + bit = vp56_rac_get_prob(c, *ps); + ps += 1 + bit; + x += 2*bit; + x += vp56_rac_get_prob(c, *ps); + } + + return (x && vp56_rac_get_prob(c, p[1])) ? -x : x; +} + +static av_always_inline +const uint8_t *get_submv_prob(uint32_t left, uint32_t top) +{ + if (left == top) + return vp8_submv_prob[4-!!left]; + if (!top) + return vp8_submv_prob[2]; + return vp8_submv_prob[1-!!left]; +} + +/** + * Split motion vector prediction, 16.4. + * @returns the number of motion vectors parsed (2, 4 or 16) + */ +static av_always_inline +int decode_splitmvs(VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb) +{ + int part_idx; + int n, num; + VP8Macroblock *top_mb = &mb[2]; + VP8Macroblock *left_mb = &mb[-1]; + const uint8_t *mbsplits_left = vp8_mbsplits[left_mb->partitioning], + *mbsplits_top = vp8_mbsplits[top_mb->partitioning], + *mbsplits_cur, *firstidx; + VP56mv *top_mv = top_mb->bmv; + VP56mv *left_mv = left_mb->bmv; + VP56mv *cur_mv = mb->bmv; + + if (vp56_rac_get_prob_branchy(c, vp8_mbsplit_prob[0])) { + if (vp56_rac_get_prob_branchy(c, vp8_mbsplit_prob[1])) { + part_idx = VP8_SPLITMVMODE_16x8 + vp56_rac_get_prob(c, vp8_mbsplit_prob[2]); + } else { + part_idx = VP8_SPLITMVMODE_8x8; + } + } else { + part_idx = VP8_SPLITMVMODE_4x4; + } + + num = vp8_mbsplit_count[part_idx]; + mbsplits_cur = vp8_mbsplits[part_idx], + firstidx = vp8_mbfirstidx[part_idx]; + mb->partitioning = part_idx; + + for (n = 0; n < num; n++) { + int k = firstidx[n]; + uint32_t left, above; + const uint8_t *submv_prob; + + if (!(k & 3)) + left = AV_RN32A(&left_mv[mbsplits_left[k + 3]]); + else + left = AV_RN32A(&cur_mv[mbsplits_cur[k - 1]]); + if (k <= 3) + above = AV_RN32A(&top_mv[mbsplits_top[k + 12]]); + else + above = AV_RN32A(&cur_mv[mbsplits_cur[k - 4]]); + + submv_prob = get_submv_prob(left, above); + + if (vp56_rac_get_prob_branchy(c, submv_prob[0])) { + if (vp56_rac_get_prob_branchy(c, submv_prob[1])) { + if (vp56_rac_get_prob_branchy(c, submv_prob[2])) { + mb->bmv[n].y = mb->mv.y + read_mv_component(c, s->prob->mvc[0]); + mb->bmv[n].x = mb->mv.x + read_mv_component(c, s->prob->mvc[1]); + } else { + AV_ZERO32(&mb->bmv[n]); + } + } else { + AV_WN32A(&mb->bmv[n], above); + } + } else { + AV_WN32A(&mb->bmv[n], left); + } + } + + return num; +} + +static av_always_inline +void decode_intra4x4_modes(VP8Context *s, VP56RangeCoder *c, + int mb_x, int keyframe) +{ + uint8_t *intra4x4 = s->intra4x4_pred_mode_mb; + if (keyframe) { + int x, y; + uint8_t* const top = s->intra4x4_pred_mode_top + 4 * mb_x; + uint8_t* const left = s->intra4x4_pred_mode_left; + for (y = 0; y < 4; y++) { + for (x = 0; x < 4; x++) { + const uint8_t *ctx; + ctx = vp8_pred4x4_prob_intra[top[x]][left[y]]; + *intra4x4 = vp8_rac_get_tree(c, vp8_pred4x4_tree, ctx); + left[y] = top[x] = *intra4x4; + intra4x4++; + } + } + } else { + int i; + for (i = 0; i < 16; i++) + intra4x4[i] = vp8_rac_get_tree(c, vp8_pred4x4_tree, vp8_pred4x4_prob_inter); + } +} + +static av_always_inline +void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, uint8_t *segment) +{ + VP56RangeCoder *c = &s->c; + + if (s->segmentation.update_map) + *segment = vp8_rac_get_tree(c, vp8_segmentid_tree, s->prob->segmentid); + s->segment = *segment; + + mb->skip = s->mbskip_enabled ? vp56_rac_get_prob(c, s->prob->mbskip) : 0; + + if (s->keyframe) { + mb->mode = vp8_rac_get_tree(c, vp8_pred16x16_tree_intra, vp8_pred16x16_prob_intra); + + if (mb->mode == MODE_I4x4) { + decode_intra4x4_modes(s, c, mb_x, 1); + } else { + const uint32_t modes = vp8_pred4x4_mode[mb->mode] * 0x01010101u; + AV_WN32A(s->intra4x4_pred_mode_top + 4 * mb_x, modes); + AV_WN32A(s->intra4x4_pred_mode_left, modes); + } + + s->chroma_pred_mode = vp8_rac_get_tree(c, vp8_pred8x8c_tree, vp8_pred8x8c_prob_intra); + mb->ref_frame = VP56_FRAME_CURRENT; + } else if (vp56_rac_get_prob_branchy(c, s->prob->intra)) { + VP56mv near[2], best; + uint8_t cnt[4] = { 0 }; + + // inter MB, 16.2 + if (vp56_rac_get_prob_branchy(c, s->prob->last)) + mb->ref_frame = vp56_rac_get_prob(c, s->prob->golden) ? + VP56_FRAME_GOLDEN2 /* altref */ : VP56_FRAME_GOLDEN; + else + mb->ref_frame = VP56_FRAME_PREVIOUS; + s->ref_count[mb->ref_frame-1]++; + + // motion vectors, 16.3 + find_near_mvs(s, mb, near, &best, cnt); + if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[0]][0])) { + if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[1]][1])) { + if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[2]][2])) { + if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[3]][3])) { + mb->mode = VP8_MVMODE_SPLIT; + clamp_mv(s, &mb->mv, &mb->mv, mb_x, mb_y); + mb->mv = mb->bmv[decode_splitmvs(s, c, mb) - 1]; + } else { + mb->mode = VP8_MVMODE_NEW; + clamp_mv(s, &mb->mv, &mb->mv, mb_x, mb_y); + mb->mv.y += read_mv_component(c, s->prob->mvc[0]); + mb->mv.x += read_mv_component(c, s->prob->mvc[1]); + } + } else { + mb->mode = VP8_MVMODE_NEAR; + clamp_mv(s, &mb->mv, &near[1], mb_x, mb_y); + } + } else { + mb->mode = VP8_MVMODE_NEAREST; + clamp_mv(s, &mb->mv, &near[0], mb_x, mb_y); + } + } else { + mb->mode = VP8_MVMODE_ZERO; + AV_ZERO32(&mb->mv); + } + if (mb->mode != VP8_MVMODE_SPLIT) { + mb->partitioning = VP8_SPLITMVMODE_NONE; + mb->bmv[0] = mb->mv; + } + } else { + // intra MB, 16.1 + mb->mode = vp8_rac_get_tree(c, vp8_pred16x16_tree_inter, s->prob->pred16x16); + + if (mb->mode == MODE_I4x4) + decode_intra4x4_modes(s, c, mb_x, 0); + + s->chroma_pred_mode = vp8_rac_get_tree(c, vp8_pred8x8c_tree, s->prob->pred8x8c); + mb->ref_frame = VP56_FRAME_CURRENT; + mb->partitioning = VP8_SPLITMVMODE_NONE; + AV_ZERO32(&mb->bmv[0]); + } +} + +/** + * @param c arithmetic bitstream reader context + * @param block destination for block coefficients + * @param probs probabilities to use when reading trees from the bitstream + * @param i initial coeff index, 0 unless a separate DC block is coded + * @param zero_nhood the initial prediction context for number of surrounding + * all-zero blocks (only left/top, so 0-2) + * @param qmul array holding the dc/ac dequant factor at position 0/1 + * @return 0 if no coeffs were decoded + * otherwise, the index of the last coeff decoded plus one + */ +static int decode_block_coeffs_internal(VP56RangeCoder *c, DCTELEM block[16], + uint8_t probs[8][3][NUM_DCT_TOKENS-1], + int i, uint8_t *token_prob, int16_t qmul[2]) +{ + goto skip_eob; + do { + int coeff; + if (!vp56_rac_get_prob_branchy(c, token_prob[0])) // DCT_EOB + return i; + +skip_eob: + if (!vp56_rac_get_prob_branchy(c, token_prob[1])) { // DCT_0 + if (++i == 16) + return i; // invalid input; blocks should end with EOB + token_prob = probs[i][0]; + goto skip_eob; + } + + if (!vp56_rac_get_prob_branchy(c, token_prob[2])) { // DCT_1 + coeff = 1; + token_prob = probs[i+1][1]; + } else { + if (!vp56_rac_get_prob_branchy(c, token_prob[3])) { // DCT 2,3,4 + coeff = vp56_rac_get_prob_branchy(c, token_prob[4]); + if (coeff) + coeff += vp56_rac_get_prob(c, token_prob[5]); + coeff += 2; + } else { + // DCT_CAT* + if (!vp56_rac_get_prob_branchy(c, token_prob[6])) { + if (!vp56_rac_get_prob_branchy(c, token_prob[7])) { // DCT_CAT1 + coeff = 5 + vp56_rac_get_prob(c, vp8_dct_cat1_prob[0]); + } else { // DCT_CAT2 + coeff = 7; + coeff += vp56_rac_get_prob(c, vp8_dct_cat2_prob[0]) << 1; + coeff += vp56_rac_get_prob(c, vp8_dct_cat2_prob[1]); + } + } else { // DCT_CAT3 and up + int a = vp56_rac_get_prob(c, token_prob[8]); + int b = vp56_rac_get_prob(c, token_prob[9+a]); + int cat = (a<<1) + b; + coeff = 3 + (8<segment; + int block_dc = 0; + + if (mb->mode != MODE_I4x4 && mb->mode != VP8_MVMODE_SPLIT) { + nnz_pred = t_nnz[8] + l_nnz[8]; + + // decode DC values and do hadamard + nnz = decode_block_coeffs(c, s->block_dc, s->prob->token[1], 0, nnz_pred, + s->qmat[segment].luma_dc_qmul); + l_nnz[8] = t_nnz[8] = !!nnz; + if (nnz) { + nnz_total += nnz; + block_dc = 1; + if (nnz == 1) + s->vp8dsp.vp8_luma_dc_wht_dc(s->block, s->block_dc); + else + s->vp8dsp.vp8_luma_dc_wht(s->block, s->block_dc); + } + luma_start = 1; + luma_ctx = 0; + } + + // luma blocks + for (y = 0; y < 4; y++) + for (x = 0; x < 4; x++) { + nnz_pred = l_nnz[y] + t_nnz[x]; + nnz = decode_block_coeffs(c, s->block[y][x], s->prob->token[luma_ctx], luma_start, + nnz_pred, s->qmat[segment].luma_qmul); + // nnz+block_dc may be one more than the actual last index, but we don't care + s->non_zero_count_cache[y][x] = nnz + block_dc; + t_nnz[x] = l_nnz[y] = !!nnz; + nnz_total += nnz; + } + + // chroma blocks + // TODO: what to do about dimensions? 2nd dim for luma is x, + // but for chroma it's (y<<1)|x + for (i = 4; i < 6; i++) + for (y = 0; y < 2; y++) + for (x = 0; x < 2; x++) { + nnz_pred = l_nnz[i+2*y] + t_nnz[i+2*x]; + nnz = decode_block_coeffs(c, s->block[i][(y<<1)+x], s->prob->token[2], 0, + nnz_pred, s->qmat[segment].chroma_qmul); + s->non_zero_count_cache[i][(y<<1)+x] = nnz; + t_nnz[i+2*x] = l_nnz[i+2*y] = !!nnz; + nnz_total += nnz; + } + + // if there were no coded coeffs despite the macroblock not being marked skip, + // we MUST not do the inner loop filter and should not do IDCT + // Since skip isn't used for bitstream prediction, just manually set it. + if (!nnz_total) + mb->skip = 1; +} + +static av_always_inline +void backup_mb_border(uint8_t *top_border, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, + int linesize, int uvlinesize, int simple) +{ + AV_COPY128(top_border, src_y + 15*linesize); + if (!simple) { + AV_COPY64(top_border+16, src_cb + 7*uvlinesize); + AV_COPY64(top_border+24, src_cr + 7*uvlinesize); + } +} + +static av_always_inline +void xchg_mb_border(uint8_t *top_border, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, + int linesize, int uvlinesize, int mb_x, int mb_y, int mb_width, + int simple, int xchg) +{ + uint8_t *top_border_m1 = top_border-32; // for TL prediction + src_y -= linesize; + src_cb -= uvlinesize; + src_cr -= uvlinesize; + +#define XCHG(a,b,xchg) do { \ + if (xchg) AV_SWAP64(b,a); \ + else AV_COPY64(b,a); \ + } while (0) + + XCHG(top_border_m1+8, src_y-8, xchg); + XCHG(top_border, src_y, xchg); + XCHG(top_border+8, src_y+8, 1); + if (mb_x < mb_width-1) + XCHG(top_border+32, src_y+16, 1); + + // only copy chroma for normal loop filter + // or to initialize the top row to 127 + if (!simple || !mb_y) { + XCHG(top_border_m1+16, src_cb-8, xchg); + XCHG(top_border_m1+24, src_cr-8, xchg); + XCHG(top_border+16, src_cb, 1); + XCHG(top_border+24, src_cr, 1); + } +} + +static av_always_inline +int check_dc_pred8x8_mode(int mode, int mb_x, int mb_y) +{ + if (!mb_x) { + return mb_y ? TOP_DC_PRED8x8 : DC_128_PRED8x8; + } else { + return mb_y ? mode : LEFT_DC_PRED8x8; + } +} + +static av_always_inline +int check_tm_pred8x8_mode(int mode, int mb_x, int mb_y) +{ + if (!mb_x) { + return mb_y ? VERT_PRED8x8 : DC_129_PRED8x8; + } else { + return mb_y ? mode : HOR_PRED8x8; + } +} + +static av_always_inline +int check_intra_pred8x8_mode(int mode, int mb_x, int mb_y) +{ + if (mode == DC_PRED8x8) { + return check_dc_pred8x8_mode(mode, mb_x, mb_y); + } else { + return mode; + } +} + +static av_always_inline +int check_intra_pred8x8_mode_emuedge(int mode, int mb_x, int mb_y) +{ + switch (mode) { + case DC_PRED8x8: + return check_dc_pred8x8_mode(mode, mb_x, mb_y); + case VERT_PRED8x8: + return !mb_y ? DC_127_PRED8x8 : mode; + case HOR_PRED8x8: + return !mb_x ? DC_129_PRED8x8 : mode; + case PLANE_PRED8x8 /*TM*/: + return check_tm_pred8x8_mode(mode, mb_x, mb_y); + } + return mode; +} + +static av_always_inline +int check_tm_pred4x4_mode(int mode, int mb_x, int mb_y) +{ + if (!mb_x) { + return mb_y ? VERT_VP8_PRED : DC_129_PRED; + } else { + return mb_y ? mode : HOR_VP8_PRED; + } +} + +static av_always_inline +int check_intra_pred4x4_mode_emuedge(int mode, int mb_x, int mb_y, int *copy_buf) +{ + switch (mode) { + case VERT_PRED: + if (!mb_x && mb_y) { + *copy_buf = 1; + return mode; + } + /* fall-through */ + case DIAG_DOWN_LEFT_PRED: + case VERT_LEFT_PRED: + return !mb_y ? DC_127_PRED : mode; + case HOR_PRED: + if (!mb_y) { + *copy_buf = 1; + return mode; + } + /* fall-through */ + case HOR_UP_PRED: + return !mb_x ? DC_129_PRED : mode; + case TM_VP8_PRED: + return check_tm_pred4x4_mode(mode, mb_x, mb_y); + case DC_PRED: // 4x4 DC doesn't use the same "H.264-style" exceptions as 16x16/8x8 DC + case DIAG_DOWN_RIGHT_PRED: + case VERT_RIGHT_PRED: + case HOR_DOWN_PRED: + if (!mb_y || !mb_x) + *copy_buf = 1; + return mode; + } + return mode; +} + +static av_always_inline +void intra_predict(VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb, + int mb_x, int mb_y) +{ + AVCodecContext *avctx = s->avctx; + int x, y, mode, nnz, tr; + + // for the first row, we need to run xchg_mb_border to init the top edge to 127 + // otherwise, skip it if we aren't going to deblock + if (!(avctx->flags & CODEC_FLAG_EMU_EDGE && !mb_y) && (s->deblock_filter || !mb_y)) + xchg_mb_border(s->top_border[mb_x+1], dst[0], dst[1], dst[2], + s->linesize, s->uvlinesize, mb_x, mb_y, s->mb_width, + s->filter.simple, 1); + + if (mb->mode < MODE_I4x4) { + if (avctx->flags & CODEC_FLAG_EMU_EDGE) { // tested + mode = check_intra_pred8x8_mode_emuedge(mb->mode, mb_x, mb_y); + } else { + mode = check_intra_pred8x8_mode(mb->mode, mb_x, mb_y); + } + s->hpc.pred16x16[mode](dst[0], s->linesize); + } else { + uint8_t *ptr = dst[0]; + uint8_t *intra4x4 = s->intra4x4_pred_mode_mb; + uint8_t tr_top[4] = { 127, 127, 127, 127 }; + + // all blocks on the right edge of the macroblock use bottom edge + // the top macroblock for their topright edge + uint8_t *tr_right = ptr - s->linesize + 16; + + // if we're on the right edge of the frame, said edge is extended + // from the top macroblock + if (!(!mb_y && avctx->flags & CODEC_FLAG_EMU_EDGE) && + mb_x == s->mb_width-1) { + tr = tr_right[-1]*0x01010101; + tr_right = (uint8_t *)&tr; + } + + if (mb->skip) + AV_ZERO128(s->non_zero_count_cache); + + for (y = 0; y < 4; y++) { + uint8_t *topright = ptr + 4 - s->linesize; + for (x = 0; x < 4; x++) { + int copy = 0, linesize = s->linesize; + uint8_t *dst = ptr+4*x; + DECLARE_ALIGNED(4, uint8_t, copy_dst)[5*8]; + + if ((y == 0 || x == 3) && mb_y == 0 && avctx->flags & CODEC_FLAG_EMU_EDGE) { + topright = tr_top; + } else if (x == 3) + topright = tr_right; + + if (avctx->flags & CODEC_FLAG_EMU_EDGE) { // mb_x+x or mb_y+y is a hack but works + mode = check_intra_pred4x4_mode_emuedge(intra4x4[x], mb_x + x, mb_y + y, ©); + if (copy) { + dst = copy_dst + 12; + linesize = 8; + if (!(mb_y + y)) { + copy_dst[3] = 127U; + AV_WN32A(copy_dst+4, 127U * 0x01010101U); + } else { + AV_COPY32(copy_dst+4, ptr+4*x-s->linesize); + if (!(mb_x + x)) { + copy_dst[3] = 129U; + } else { + copy_dst[3] = ptr[4*x-s->linesize-1]; + } + } + if (!(mb_x + x)) { + copy_dst[11] = + copy_dst[19] = + copy_dst[27] = + copy_dst[35] = 129U; + } else { + copy_dst[11] = ptr[4*x -1]; + copy_dst[19] = ptr[4*x+s->linesize -1]; + copy_dst[27] = ptr[4*x+s->linesize*2-1]; + copy_dst[35] = ptr[4*x+s->linesize*3-1]; + } + } + } else { + mode = intra4x4[x]; + } + s->hpc.pred4x4[mode](dst, topright, linesize); + if (copy) { + AV_COPY32(ptr+4*x , copy_dst+12); + AV_COPY32(ptr+4*x+s->linesize , copy_dst+20); + AV_COPY32(ptr+4*x+s->linesize*2, copy_dst+28); + AV_COPY32(ptr+4*x+s->linesize*3, copy_dst+36); + } + + nnz = s->non_zero_count_cache[y][x]; + if (nnz) { + if (nnz == 1) + s->vp8dsp.vp8_idct_dc_add(ptr+4*x, s->block[y][x], s->linesize); + else + s->vp8dsp.vp8_idct_add(ptr+4*x, s->block[y][x], s->linesize); + } + topright += 4; + } + + ptr += 4*s->linesize; + intra4x4 += 4; + } + } + + if (avctx->flags & CODEC_FLAG_EMU_EDGE) { + mode = check_intra_pred8x8_mode_emuedge(s->chroma_pred_mode, mb_x, mb_y); + } else { + mode = check_intra_pred8x8_mode(s->chroma_pred_mode, mb_x, mb_y); + } + s->hpc.pred8x8[mode](dst[1], s->uvlinesize); + s->hpc.pred8x8[mode](dst[2], s->uvlinesize); + + if (!(avctx->flags & CODEC_FLAG_EMU_EDGE && !mb_y) && (s->deblock_filter || !mb_y)) + xchg_mb_border(s->top_border[mb_x+1], dst[0], dst[1], dst[2], + s->linesize, s->uvlinesize, mb_x, mb_y, s->mb_width, + s->filter.simple, 0); +} + +static const uint8_t subpel_idx[3][8] = { + { 0, 1, 2, 1, 2, 1, 2, 1 }, // nr. of left extra pixels, + // also function pointer index + { 0, 3, 5, 3, 5, 3, 5, 3 }, // nr. of extra pixels required + { 0, 2, 3, 2, 3, 2, 3, 2 }, // nr. of right extra pixels +}; + +/** + * Generic MC function. + * + * @param s VP8 decoding context + * @param luma 1 for luma (Y) planes, 0 for chroma (Cb/Cr) planes + * @param dst target buffer for block data at block position + * @param src reference picture buffer at origin (0, 0) + * @param mv motion vector (relative to block position) to get pixel data from + * @param x_off horizontal position of block from origin (0, 0) + * @param y_off vertical position of block from origin (0, 0) + * @param block_w width of block (16, 8 or 4) + * @param block_h height of block (always same as block_w) + * @param width width of src/dst plane data + * @param height height of src/dst plane data + * @param linesize size of a single line of plane data, including padding + * @param mc_func motion compensation function pointers (bilinear or sixtap MC) + */ +static av_always_inline +void vp8_mc_luma(VP8Context *s, uint8_t *dst, uint8_t *src, const VP56mv *mv, + int x_off, int y_off, int block_w, int block_h, + int width, int height, int linesize, + vp8_mc_func mc_func[3][3]) +{ + if (AV_RN32A(mv)) { + + int mx = (mv->x << 1)&7, mx_idx = subpel_idx[0][mx]; + int my = (mv->y << 1)&7, my_idx = subpel_idx[0][my]; + + x_off += mv->x >> 2; + y_off += mv->y >> 2; + + // edge emulation + src += y_off * linesize + x_off; + if (x_off < mx_idx || x_off >= width - block_w - subpel_idx[2][mx] || + y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) { + s->dsp.emulated_edge_mc(s->edge_emu_buffer, src - my_idx * linesize - mx_idx, linesize, + block_w + subpel_idx[1][mx], block_h + subpel_idx[1][my], + x_off - mx_idx, y_off - my_idx, width, height); + src = s->edge_emu_buffer + mx_idx + linesize * my_idx; + } + mc_func[my_idx][mx_idx](dst, linesize, src, linesize, block_h, mx, my); + } else + mc_func[0][0](dst, linesize, src + y_off * linesize + x_off, linesize, block_h, 0, 0); +} + +static av_always_inline +void vp8_mc_chroma(VP8Context *s, uint8_t *dst1, uint8_t *dst2, uint8_t *src1, + uint8_t *src2, const VP56mv *mv, int x_off, int y_off, + int block_w, int block_h, int width, int height, int linesize, + vp8_mc_func mc_func[3][3]) +{ + if (AV_RN32A(mv)) { + int mx = mv->x&7, mx_idx = subpel_idx[0][mx]; + int my = mv->y&7, my_idx = subpel_idx[0][my]; + + x_off += mv->x >> 3; + y_off += mv->y >> 3; + + // edge emulation + src1 += y_off * linesize + x_off; + src2 += y_off * linesize + x_off; + if (x_off < mx_idx || x_off >= width - block_w - subpel_idx[2][mx] || + y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) { + s->dsp.emulated_edge_mc(s->edge_emu_buffer, src1 - my_idx * linesize - mx_idx, linesize, + block_w + subpel_idx[1][mx], block_h + subpel_idx[1][my], + x_off - mx_idx, y_off - my_idx, width, height); + src1 = s->edge_emu_buffer + mx_idx + linesize * my_idx; + mc_func[my_idx][mx_idx](dst1, linesize, src1, linesize, block_h, mx, my); + + s->dsp.emulated_edge_mc(s->edge_emu_buffer, src2 - my_idx * linesize - mx_idx, linesize, + block_w + subpel_idx[1][mx], block_h + subpel_idx[1][my], + x_off - mx_idx, y_off - my_idx, width, height); + src2 = s->edge_emu_buffer + mx_idx + linesize * my_idx; + mc_func[my_idx][mx_idx](dst2, linesize, src2, linesize, block_h, mx, my); + } else { + mc_func[my_idx][mx_idx](dst1, linesize, src1, linesize, block_h, mx, my); + mc_func[my_idx][mx_idx](dst2, linesize, src2, linesize, block_h, mx, my); + } + } else { + mc_func[0][0](dst1, linesize, src1 + y_off * linesize + x_off, linesize, block_h, 0, 0); + mc_func[0][0](dst2, linesize, src2 + y_off * linesize + x_off, linesize, block_h, 0, 0); + } +} + +static av_always_inline +void vp8_mc_part(VP8Context *s, uint8_t *dst[3], + AVFrame *ref_frame, int x_off, int y_off, + int bx_off, int by_off, + int block_w, int block_h, + int width, int height, VP56mv *mv) +{ + VP56mv uvmv = *mv; + + /* Y */ + vp8_mc_luma(s, dst[0] + by_off * s->linesize + bx_off, + ref_frame->data[0], mv, x_off + bx_off, y_off + by_off, + block_w, block_h, width, height, s->linesize, + s->put_pixels_tab[block_w == 8]); + + /* U/V */ + if (s->profile == 3) { + uvmv.x &= ~7; + uvmv.y &= ~7; + } + x_off >>= 1; y_off >>= 1; + bx_off >>= 1; by_off >>= 1; + width >>= 1; height >>= 1; + block_w >>= 1; block_h >>= 1; + vp8_mc_chroma(s, dst[1] + by_off * s->uvlinesize + bx_off, + dst[2] + by_off * s->uvlinesize + bx_off, ref_frame->data[1], + ref_frame->data[2], &uvmv, x_off + bx_off, y_off + by_off, + block_w, block_h, width, height, s->uvlinesize, + s->put_pixels_tab[1 + (block_w == 4)]); +} + +/* Fetch pixels for estimated mv 4 macroblocks ahead. + * Optimized for 64-byte cache lines. Inspired by ffh264 prefetch_motion. */ +static av_always_inline void prefetch_motion(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int mb_xy, int ref) +{ + /* Don't prefetch refs that haven't been used very often this frame. */ + if (s->ref_count[ref-1] > (mb_xy >> 5)) { + int x_off = mb_x << 4, y_off = mb_y << 4; + int mx = (mb->mv.x>>2) + x_off + 8; + int my = (mb->mv.y>>2) + y_off; + uint8_t **src= s->framep[ref]->data; + int off= mx + (my + (mb_x&3)*4)*s->linesize + 64; + s->dsp.prefetch(src[0]+off, s->linesize, 4); + off= (mx>>1) + ((my>>1) + (mb_x&7))*s->uvlinesize + 64; + s->dsp.prefetch(src[1]+off, src[2]-src[1], 2); + } +} + +/** + * Apply motion vectors to prediction buffer, chapter 18. + */ +static av_always_inline +void inter_predict(VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb, + int mb_x, int mb_y) +{ + int x_off = mb_x << 4, y_off = mb_y << 4; + int width = 16*s->mb_width, height = 16*s->mb_height; + AVFrame *ref = s->framep[mb->ref_frame]; + VP56mv *bmv = mb->bmv; + + switch (mb->partitioning) { + case VP8_SPLITMVMODE_NONE: + vp8_mc_part(s, dst, ref, x_off, y_off, + 0, 0, 16, 16, width, height, &mb->mv); + break; + case VP8_SPLITMVMODE_4x4: { + int x, y; + VP56mv uvmv; + + /* Y */ + for (y = 0; y < 4; y++) { + for (x = 0; x < 4; x++) { + vp8_mc_luma(s, dst[0] + 4*y*s->linesize + x*4, + ref->data[0], &bmv[4*y + x], + 4*x + x_off, 4*y + y_off, 4, 4, + width, height, s->linesize, + s->put_pixels_tab[2]); + } + } + + /* U/V */ + x_off >>= 1; y_off >>= 1; width >>= 1; height >>= 1; + for (y = 0; y < 2; y++) { + for (x = 0; x < 2; x++) { + uvmv.x = mb->bmv[ 2*y * 4 + 2*x ].x + + mb->bmv[ 2*y * 4 + 2*x+1].x + + mb->bmv[(2*y+1) * 4 + 2*x ].x + + mb->bmv[(2*y+1) * 4 + 2*x+1].x; + uvmv.y = mb->bmv[ 2*y * 4 + 2*x ].y + + mb->bmv[ 2*y * 4 + 2*x+1].y + + mb->bmv[(2*y+1) * 4 + 2*x ].y + + mb->bmv[(2*y+1) * 4 + 2*x+1].y; + uvmv.x = (uvmv.x + 2 + (uvmv.x >> (INT_BIT-1))) >> 2; + uvmv.y = (uvmv.y + 2 + (uvmv.y >> (INT_BIT-1))) >> 2; + if (s->profile == 3) { + uvmv.x &= ~7; + uvmv.y &= ~7; + } + vp8_mc_chroma(s, dst[1] + 4*y*s->uvlinesize + x*4, + dst[2] + 4*y*s->uvlinesize + x*4, + ref->data[1], ref->data[2], &uvmv, + 4*x + x_off, 4*y + y_off, 4, 4, + width, height, s->uvlinesize, + s->put_pixels_tab[2]); + } + } + break; + } + case VP8_SPLITMVMODE_16x8: + vp8_mc_part(s, dst, ref, x_off, y_off, + 0, 0, 16, 8, width, height, &bmv[0]); + vp8_mc_part(s, dst, ref, x_off, y_off, + 0, 8, 16, 8, width, height, &bmv[1]); + break; + case VP8_SPLITMVMODE_8x16: + vp8_mc_part(s, dst, ref, x_off, y_off, + 0, 0, 8, 16, width, height, &bmv[0]); + vp8_mc_part(s, dst, ref, x_off, y_off, + 8, 0, 8, 16, width, height, &bmv[1]); + break; + case VP8_SPLITMVMODE_8x8: + vp8_mc_part(s, dst, ref, x_off, y_off, + 0, 0, 8, 8, width, height, &bmv[0]); + vp8_mc_part(s, dst, ref, x_off, y_off, + 8, 0, 8, 8, width, height, &bmv[1]); + vp8_mc_part(s, dst, ref, x_off, y_off, + 0, 8, 8, 8, width, height, &bmv[2]); + vp8_mc_part(s, dst, ref, x_off, y_off, + 8, 8, 8, 8, width, height, &bmv[3]); + break; + } +} + +static av_always_inline void idct_mb(VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb) +{ + int x, y, ch; + + if (mb->mode != MODE_I4x4) { + uint8_t *y_dst = dst[0]; + for (y = 0; y < 4; y++) { + uint32_t nnz4 = AV_RN32A(s->non_zero_count_cache[y]); + if (nnz4) { + if (nnz4&~0x01010101) { + for (x = 0; x < 4; x++) { + int nnz = s->non_zero_count_cache[y][x]; + if (nnz) { + if (nnz == 1) + s->vp8dsp.vp8_idct_dc_add(y_dst+4*x, s->block[y][x], s->linesize); + else + s->vp8dsp.vp8_idct_add(y_dst+4*x, s->block[y][x], s->linesize); + } + } + } else { + s->vp8dsp.vp8_idct_dc_add4y(y_dst, s->block[y], s->linesize); + } + } + y_dst += 4*s->linesize; + } + } + + for (ch = 0; ch < 2; ch++) { + uint32_t nnz4 = AV_RN32A(s->non_zero_count_cache[4+ch]); + if (nnz4) { + uint8_t *ch_dst = dst[1+ch]; + if (nnz4&~0x01010101) { + for (y = 0; y < 2; y++) { + for (x = 0; x < 2; x++) { + int nnz = s->non_zero_count_cache[4+ch][(y<<1)+x]; + if (nnz) { + if (nnz == 1) + s->vp8dsp.vp8_idct_dc_add(ch_dst+4*x, s->block[4+ch][(y<<1)+x], s->uvlinesize); + else + s->vp8dsp.vp8_idct_add(ch_dst+4*x, s->block[4+ch][(y<<1)+x], s->uvlinesize); + } + } + ch_dst += 4*s->uvlinesize; + } + } else { + s->vp8dsp.vp8_idct_dc_add4uv(ch_dst, s->block[4+ch], s->uvlinesize); + } + } + } +} + +static av_always_inline void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb, VP8FilterStrength *f ) +{ + int interior_limit, filter_level; + + if (s->segmentation.enabled) { + filter_level = s->segmentation.filter_level[s->segment]; + if (!s->segmentation.absolute_vals) + filter_level += s->filter.level; + } else + filter_level = s->filter.level; + + if (s->lf_delta.enabled) { + filter_level += s->lf_delta.ref[mb->ref_frame]; + + if (mb->ref_frame == VP56_FRAME_CURRENT) { + if (mb->mode == MODE_I4x4) + filter_level += s->lf_delta.mode[0]; + } else { + if (mb->mode == VP8_MVMODE_ZERO) + filter_level += s->lf_delta.mode[1]; + else if (mb->mode == VP8_MVMODE_SPLIT) + filter_level += s->lf_delta.mode[3]; + else + filter_level += s->lf_delta.mode[2]; + } + } + filter_level = av_clip(filter_level, 0, 63); + + interior_limit = filter_level; + if (s->filter.sharpness) { + interior_limit >>= s->filter.sharpness > 4 ? 2 : 1; + interior_limit = FFMIN(interior_limit, 9 - s->filter.sharpness); + } + interior_limit = FFMAX(interior_limit, 1); + + f->filter_level = filter_level; + f->inner_limit = interior_limit; + f->inner_filter = !mb->skip || mb->mode == MODE_I4x4 || mb->mode == VP8_MVMODE_SPLIT; +} + +static av_always_inline void filter_mb(VP8Context *s, uint8_t *dst[3], VP8FilterStrength *f, int mb_x, int mb_y) +{ + int mbedge_lim, bedge_lim, hev_thresh; + int filter_level = f->filter_level; + int inner_limit = f->inner_limit; + int inner_filter = f->inner_filter; + int linesize = s->linesize; + int uvlinesize = s->uvlinesize; + + if (!filter_level) + return; + + mbedge_lim = 2*(filter_level+2) + inner_limit; + bedge_lim = 2* filter_level + inner_limit; + hev_thresh = filter_level >= 15; + + if (s->keyframe) { + if (filter_level >= 40) + hev_thresh = 2; + } else { + if (filter_level >= 40) + hev_thresh = 3; + else if (filter_level >= 20) + hev_thresh = 2; + } + + if (mb_x) { + s->vp8dsp.vp8_h_loop_filter16y(dst[0], linesize, + mbedge_lim, inner_limit, hev_thresh); + s->vp8dsp.vp8_h_loop_filter8uv(dst[1], dst[2], uvlinesize, + mbedge_lim, inner_limit, hev_thresh); + } + + if (inner_filter) { + s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0]+ 4, linesize, bedge_lim, + inner_limit, hev_thresh); + s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0]+ 8, linesize, bedge_lim, + inner_limit, hev_thresh); + s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0]+12, linesize, bedge_lim, + inner_limit, hev_thresh); + s->vp8dsp.vp8_h_loop_filter8uv_inner(dst[1] + 4, dst[2] + 4, + uvlinesize, bedge_lim, + inner_limit, hev_thresh); + } + + if (mb_y) { + s->vp8dsp.vp8_v_loop_filter16y(dst[0], linesize, + mbedge_lim, inner_limit, hev_thresh); + s->vp8dsp.vp8_v_loop_filter8uv(dst[1], dst[2], uvlinesize, + mbedge_lim, inner_limit, hev_thresh); + } + + if (inner_filter) { + s->vp8dsp.vp8_v_loop_filter16y_inner(dst[0]+ 4*linesize, + linesize, bedge_lim, + inner_limit, hev_thresh); + s->vp8dsp.vp8_v_loop_filter16y_inner(dst[0]+ 8*linesize, + linesize, bedge_lim, + inner_limit, hev_thresh); + s->vp8dsp.vp8_v_loop_filter16y_inner(dst[0]+12*linesize, + linesize, bedge_lim, + inner_limit, hev_thresh); + s->vp8dsp.vp8_v_loop_filter8uv_inner(dst[1] + 4 * uvlinesize, + dst[2] + 4 * uvlinesize, + uvlinesize, bedge_lim, + inner_limit, hev_thresh); + } +} + +static av_always_inline void filter_mb_simple(VP8Context *s, uint8_t *dst, VP8FilterStrength *f, int mb_x, int mb_y) +{ + int mbedge_lim, bedge_lim; + int filter_level = f->filter_level; + int inner_limit = f->inner_limit; + int inner_filter = f->inner_filter; + int linesize = s->linesize; + + if (!filter_level) + return; + + mbedge_lim = 2*(filter_level+2) + inner_limit; + bedge_lim = 2* filter_level + inner_limit; + + if (mb_x) + s->vp8dsp.vp8_h_loop_filter_simple(dst, linesize, mbedge_lim); + if (inner_filter) { + s->vp8dsp.vp8_h_loop_filter_simple(dst+ 4, linesize, bedge_lim); + s->vp8dsp.vp8_h_loop_filter_simple(dst+ 8, linesize, bedge_lim); + s->vp8dsp.vp8_h_loop_filter_simple(dst+12, linesize, bedge_lim); + } + + if (mb_y) + s->vp8dsp.vp8_v_loop_filter_simple(dst, linesize, mbedge_lim); + if (inner_filter) { + s->vp8dsp.vp8_v_loop_filter_simple(dst+ 4*linesize, linesize, bedge_lim); + s->vp8dsp.vp8_v_loop_filter_simple(dst+ 8*linesize, linesize, bedge_lim); + s->vp8dsp.vp8_v_loop_filter_simple(dst+12*linesize, linesize, bedge_lim); + } +} + +static void filter_mb_row(VP8Context *s, int mb_y) +{ + VP8FilterStrength *f = s->filter_strength; + uint8_t *dst[3] = { + s->framep[VP56_FRAME_CURRENT]->data[0] + 16*mb_y*s->linesize, + s->framep[VP56_FRAME_CURRENT]->data[1] + 8*mb_y*s->uvlinesize, + s->framep[VP56_FRAME_CURRENT]->data[2] + 8*mb_y*s->uvlinesize + }; + int mb_x; + + for (mb_x = 0; mb_x < s->mb_width; mb_x++) { + backup_mb_border(s->top_border[mb_x+1], dst[0], dst[1], dst[2], s->linesize, s->uvlinesize, 0); + filter_mb(s, dst, f++, mb_x, mb_y); + dst[0] += 16; + dst[1] += 8; + dst[2] += 8; + } +} + +static void filter_mb_row_simple(VP8Context *s, int mb_y) +{ + VP8FilterStrength *f = s->filter_strength; + uint8_t *dst = s->framep[VP56_FRAME_CURRENT]->data[0] + 16*mb_y*s->linesize; + int mb_x; + + for (mb_x = 0; mb_x < s->mb_width; mb_x++) { + backup_mb_border(s->top_border[mb_x+1], dst, NULL, NULL, s->linesize, 0, 1); + filter_mb_simple(s, dst, f++, mb_x, mb_y); + dst += 16; + } +} + +static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *data_size, + AVPacket *avpkt) +{ + VP8Context *s = avctx->priv_data; + int ret, mb_x, mb_y, i, y, referenced; + enum AVDiscard skip_thresh; + AVFrame *av_uninit(curframe); + + if ((ret = decode_frame_header(s, avpkt->data, avpkt->size)) < 0) + return ret; + + referenced = s->update_last || s->update_golden == VP56_FRAME_CURRENT + || s->update_altref == VP56_FRAME_CURRENT; + + skip_thresh = !referenced ? AVDISCARD_NONREF : + !s->keyframe ? AVDISCARD_NONKEY : AVDISCARD_ALL; + + if (avctx->skip_frame >= skip_thresh) { + s->invisible = 1; + goto skip_decode; + } + s->deblock_filter = s->filter.level && avctx->skip_loop_filter < skip_thresh; + + for (i = 0; i < 4; i++) + if (&s->frames[i] != s->framep[VP56_FRAME_PREVIOUS] && + &s->frames[i] != s->framep[VP56_FRAME_GOLDEN] && + &s->frames[i] != s->framep[VP56_FRAME_GOLDEN2]) { + curframe = s->framep[VP56_FRAME_CURRENT] = &s->frames[i]; + break; + } + if (curframe->data[0]) + avctx->release_buffer(avctx, curframe); + + curframe->key_frame = s->keyframe; + curframe->pict_type = s->keyframe ? FF_I_TYPE : FF_P_TYPE; + curframe->reference = referenced ? 3 : 0; + if ((ret = avctx->get_buffer(avctx, curframe))) { + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed!\n"); + return ret; + } + + // Given that arithmetic probabilities are updated every frame, it's quite likely + // that the values we have on a random interframe are complete junk if we didn't + // start decode on a keyframe. So just don't display anything rather than junk. + if (!s->keyframe && (!s->framep[VP56_FRAME_PREVIOUS] || + !s->framep[VP56_FRAME_GOLDEN] || + !s->framep[VP56_FRAME_GOLDEN2])) { + av_log(avctx, AV_LOG_WARNING, "Discarding interframe without a prior keyframe!\n"); + return AVERROR_INVALIDDATA; + } + + s->linesize = curframe->linesize[0]; + s->uvlinesize = curframe->linesize[1]; + + if (!s->edge_emu_buffer) + s->edge_emu_buffer = av_malloc(21*s->linesize); + + memset(s->top_nnz, 0, s->mb_width*sizeof(*s->top_nnz)); + + /* Zero macroblock structures for top/top-left prediction from outside the frame. */ + memset(s->macroblocks + s->mb_height*2 - 1, 0, (s->mb_width+1)*sizeof(*s->macroblocks)); + + // top edge of 127 for intra prediction + if (!(avctx->flags & CODEC_FLAG_EMU_EDGE)) { + s->top_border[0][15] = s->top_border[0][23] = 127; + memset(s->top_border[1]-1, 127, s->mb_width*sizeof(*s->top_border)+1); + } + memset(s->ref_count, 0, sizeof(s->ref_count)); + if (s->keyframe) + memset(s->intra4x4_pred_mode_top, DC_PRED, s->mb_width*4); + + for (mb_y = 0; mb_y < s->mb_height; mb_y++) { + VP56RangeCoder *c = &s->coeff_partition[mb_y & (s->num_coeff_partitions-1)]; + VP8Macroblock *mb = s->macroblocks + (s->mb_height - mb_y - 1)*2; + int mb_xy = mb_y*s->mb_width; + uint8_t *dst[3] = { + curframe->data[0] + 16*mb_y*s->linesize, + curframe->data[1] + 8*mb_y*s->uvlinesize, + curframe->data[2] + 8*mb_y*s->uvlinesize + }; + + memset(mb - 1, 0, sizeof(*mb)); // zero left macroblock + memset(s->left_nnz, 0, sizeof(s->left_nnz)); + AV_WN32A(s->intra4x4_pred_mode_left, DC_PRED*0x01010101); + + // left edge of 129 for intra prediction + if (!(avctx->flags & CODEC_FLAG_EMU_EDGE)) { + for (i = 0; i < 3; i++) + for (y = 0; y < 16>>!!i; y++) + dst[i][y*curframe->linesize[i]-1] = 129; + if (mb_y == 1) // top left edge is also 129 + s->top_border[0][15] = s->top_border[0][23] = s->top_border[0][31] = 129; + } + + for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb_xy++, mb++) { + /* Prefetch the current frame, 4 MBs ahead */ + s->dsp.prefetch(dst[0] + (mb_x&3)*4*s->linesize + 64, s->linesize, 4); + s->dsp.prefetch(dst[1] + (mb_x&7)*s->uvlinesize + 64, dst[2] - dst[1], 2); + + decode_mb_mode(s, mb, mb_x, mb_y, s->segmentation_map + mb_xy); + + prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP56_FRAME_PREVIOUS); + + if (!mb->skip) + decode_mb_coeffs(s, c, mb, s->top_nnz[mb_x], s->left_nnz); + + if (mb->mode <= MODE_I4x4) + intra_predict(s, dst, mb, mb_x, mb_y); + else + inter_predict(s, dst, mb, mb_x, mb_y); + + prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP56_FRAME_GOLDEN); + + if (!mb->skip) { + idct_mb(s, dst, mb); + } else { + AV_ZERO64(s->left_nnz); + AV_WN64(s->top_nnz[mb_x], 0); // array of 9, so unaligned + + // Reset DC block predictors if they would exist if the mb had coefficients + if (mb->mode != MODE_I4x4 && mb->mode != VP8_MVMODE_SPLIT) { + s->left_nnz[8] = 0; + s->top_nnz[mb_x][8] = 0; + } + } + + if (s->deblock_filter) + filter_level_for_mb(s, mb, &s->filter_strength[mb_x]); + + prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP56_FRAME_GOLDEN2); + + dst[0] += 16; + dst[1] += 8; + dst[2] += 8; + } + if (s->deblock_filter) { + if (s->filter.simple) + filter_mb_row_simple(s, mb_y); + else + filter_mb_row(s, mb_y); + } + } + +skip_decode: + // if future frames don't use the updated probabilities, + // reset them to the values we saved + if (!s->update_probabilities) + s->prob[0] = s->prob[1]; + + // check if golden and altref are swapped + if (s->update_altref == VP56_FRAME_GOLDEN && + s->update_golden == VP56_FRAME_GOLDEN2) + FFSWAP(AVFrame *, s->framep[VP56_FRAME_GOLDEN], s->framep[VP56_FRAME_GOLDEN2]); + else { + if (s->update_altref != VP56_FRAME_NONE) + s->framep[VP56_FRAME_GOLDEN2] = s->framep[s->update_altref]; + + if (s->update_golden != VP56_FRAME_NONE) + s->framep[VP56_FRAME_GOLDEN] = s->framep[s->update_golden]; + } + + if (s->update_last) // move cur->prev + s->framep[VP56_FRAME_PREVIOUS] = s->framep[VP56_FRAME_CURRENT]; + + // release no longer referenced frames + for (i = 0; i < 4; i++) + if (s->frames[i].data[0] && + &s->frames[i] != s->framep[VP56_FRAME_CURRENT] && + &s->frames[i] != s->framep[VP56_FRAME_PREVIOUS] && + &s->frames[i] != s->framep[VP56_FRAME_GOLDEN] && + &s->frames[i] != s->framep[VP56_FRAME_GOLDEN2]) + avctx->release_buffer(avctx, &s->frames[i]); + + if (!s->invisible) { + *(AVFrame*)data = *s->framep[VP56_FRAME_CURRENT]; + *data_size = sizeof(AVFrame); + } + + return avpkt->size; +} + +static av_cold int vp8_decode_init(AVCodecContext *avctx) +{ + VP8Context *s = avctx->priv_data; + + s->avctx = avctx; + avctx->pix_fmt = PIX_FMT_YUV420P; + + dsputil_init(&s->dsp, avctx); + ff_h264_pred_init(&s->hpc, CODEC_ID_VP8); + ff_vp8dsp_init(&s->vp8dsp); + + return 0; +} + +static av_cold int vp8_decode_free(AVCodecContext *avctx) +{ + vp8_decode_flush(avctx); + return 0; +} + +AVCodec ff_vp8_decoder = { + "vp8", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_VP8, + sizeof(VP8Context), + vp8_decode_init, + NULL, + vp8_decode_free, + vp8_decode_frame, + CODEC_CAP_DR1, + .flush = vp8_decode_flush, + .long_name = NULL_IF_CONFIG_SMALL("On2 VP8"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8_parser.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8_parser.c new file mode 100644 index 00000000..e769e33a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8_parser.c @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2008 Michael Niedermayer + * + * 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 + */ + +#include "parser.h" + +static int parse(AVCodecParserContext *s, + AVCodecContext *avctx, + const uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size) +{ + s->pict_type= (buf[0]&0x01) ? FF_P_TYPE : FF_I_TYPE; + + *poutbuf = buf; + *poutbuf_size = buf_size; + return buf_size; +} + +AVCodecParser ff_vp8_parser = { + { CODEC_ID_VP8 }, + 0, + NULL, + parse, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8data.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8data.h new file mode 100644 index 00000000..775472e8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8data.h @@ -0,0 +1,722 @@ +/** + * VP8 compatible video decoder + * + * Copyright (C) 2010 David Conrad + * Copyright (C) 2010 Ronald S. Bultje + * + * 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 + */ + +// TODO: move these #define and enum to a better header... + +#define VP8_MAX_QUANT 127 + +enum dct_token { + DCT_0, + DCT_1, + DCT_2, + DCT_3, + DCT_4, + DCT_CAT1, + DCT_CAT2, + DCT_CAT3, + DCT_CAT4, + DCT_CAT5, + DCT_CAT6, + DCT_EOB, + + NUM_DCT_TOKENS +}; + +#include "h264pred.h" + +// used to signal 4x4 intra pred in luma MBs +#define MODE_I4x4 4 + +enum inter_mvmode { + VP8_MVMODE_NEAREST = MODE_I4x4 + 1, + VP8_MVMODE_NEAR, + VP8_MVMODE_ZERO, + VP8_MVMODE_NEW, + VP8_MVMODE_SPLIT +}; + +enum inter_splitmvmode { + VP8_SPLITMVMODE_16x8 = 0, ///< 2 16x8 blocks (vertical) + VP8_SPLITMVMODE_8x16, ///< 2 8x16 blocks (horizontal) + VP8_SPLITMVMODE_8x8, ///< 2x2 blocks of 8x8px each + VP8_SPLITMVMODE_4x4, ///< 4x4 blocks of 4x4px each + VP8_SPLITMVMODE_NONE, ///< (only used in prediction) no split MVs +}; + +static const uint8_t vp8_pred4x4_mode[] = +{ + [DC_PRED8x8] = DC_PRED, + [VERT_PRED8x8] = VERT_PRED, + [HOR_PRED8x8] = HOR_PRED, + [PLANE_PRED8x8] = TM_VP8_PRED, +}; + +static const int8_t vp8_pred16x16_tree_intra[4][2] = +{ + { -MODE_I4x4, 1 }, // '0' + { 2, 3 }, + { -DC_PRED8x8, -VERT_PRED8x8 }, // '100', '101' + { -HOR_PRED8x8, -PLANE_PRED8x8 }, // '110', '111' +}; + +static const int8_t vp8_pred16x16_tree_inter[4][2] = +{ + { -DC_PRED8x8, 1 }, // '0' + { 2, 3 }, + { -VERT_PRED8x8, -HOR_PRED8x8 }, // '100', '101' + { -PLANE_PRED8x8, -MODE_I4x4 }, // '110', '111' +}; + +static const int vp8_mode_contexts[6][4] = { + { 7, 1, 1, 143 }, + { 14, 18, 14, 107 }, + { 135, 64, 57, 68 }, + { 60, 56, 128, 65 }, + { 159, 134, 128, 34 }, + { 234, 188, 128, 28 }, +}; + +static const uint8_t vp8_mbsplits[5][16] = { + { 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1 }, + { 0, 0, 1, 1, 0, 0, 1, 1, + 0, 0, 1, 1, 0, 0, 1, 1 }, + { 0, 0, 1, 1, 0, 0, 1, 1, + 2, 2, 3, 3, 2, 2, 3, 3 }, + { 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15 }, + { 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 } +}; + +static const uint8_t vp8_mbfirstidx[4][16] = { + { 0, 8 }, { 0, 2 }, { 0, 2, 8, 10 }, + { 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15 } +}; + +static const uint8_t vp8_mbsplit_count[4] = { 2, 2, 4, 16 }; +static const uint8_t vp8_mbsplit_prob[3] = { 110, 111, 150 }; + +static const uint8_t vp8_submv_prob[5][3] = { + { 147, 136, 18 }, + { 106, 145, 1 }, + { 179, 121, 1 }, + { 223, 1, 34 }, + { 208, 1, 1 } +}; + +static const uint8_t vp8_pred16x16_prob_intra[4] = { 145, 156, 163, 128 }; +static const uint8_t vp8_pred16x16_prob_inter[4] = { 112, 86, 140, 37 }; + +static const int8_t vp8_pred4x4_tree[9][2] = +{ + { -DC_PRED, 1 }, // '0' + { -TM_VP8_PRED, 2 }, // '10' + { -VERT_PRED, 3 }, // '110' + { 4, 6 }, + { -HOR_PRED, 5 }, // '11100' + { -DIAG_DOWN_RIGHT_PRED, -VERT_RIGHT_PRED }, // '111010', '111011' + { -DIAG_DOWN_LEFT_PRED, 7 }, // '11110' + { -VERT_LEFT_PRED, 8 }, // '111110' + { -HOR_DOWN_PRED, -HOR_UP_PRED }, // '1111110', '1111111' +}; + +static const int8_t vp8_pred8x8c_tree[3][2] = +{ + { -DC_PRED8x8, 1 }, // '0' + { -VERT_PRED8x8, 2 }, // '10 + { -HOR_PRED8x8, -PLANE_PRED8x8 }, // '110', '111' +}; + +static const uint8_t vp8_pred8x8c_prob_intra[3] = { 142, 114, 183 }; +static const uint8_t vp8_pred8x8c_prob_inter[3] = { 162, 101, 204 }; + +static const uint8_t vp8_pred4x4_prob_inter[9] = +{ + 120, 90, 79, 133, 87, 85, 80, 111, 151 +}; + +static const uint8_t vp8_pred4x4_prob_intra[10][10][9] = +{ + { + { 39, 53, 200, 87, 26, 21, 43, 232, 171 }, + { 56, 34, 51, 104, 114, 102, 29, 93, 77 }, + { 88, 88, 147, 150, 42, 46, 45, 196, 205 }, + { 107, 54, 32, 26, 51, 1, 81, 43, 31 }, + { 39, 28, 85, 171, 58, 165, 90, 98, 64 }, + { 34, 22, 116, 206, 23, 34, 43, 166, 73 }, + { 34, 19, 21, 102, 132, 188, 16, 76, 124 }, + { 68, 25, 106, 22, 64, 171, 36, 225, 114 }, + { 62, 18, 78, 95, 85, 57, 50, 48, 51 }, + { 43, 97, 183, 117, 85, 38, 35, 179, 61 }, + }, + { + { 112, 113, 77, 85, 179, 255, 38, 120, 114 }, + { 40, 42, 1, 196, 245, 209, 10, 25, 109 }, + { 193, 101, 35, 159, 215, 111, 89, 46, 111 }, + { 100, 80, 8, 43, 154, 1, 51, 26, 71 }, + { 88, 43, 29, 140, 166, 213, 37, 43, 154 }, + { 61, 63, 30, 155, 67, 45, 68, 1, 209 }, + { 41, 40, 5, 102, 211, 183, 4, 1, 221 }, + { 142, 78, 78, 16, 255, 128, 34, 197, 171 }, + { 51, 50, 17, 168, 209, 192, 23, 25, 82 }, + { 60, 148, 31, 172, 219, 228, 21, 18, 111 }, + }, + { + { 175, 69, 143, 80, 85, 82, 72, 155, 103 }, + { 56, 58, 10, 171, 218, 189, 17, 13, 152 }, + { 231, 120, 48, 89, 115, 113, 120, 152, 112 }, + { 144, 71, 10, 38, 171, 213, 144, 34, 26 }, + { 114, 26, 17, 163, 44, 195, 21, 10, 173 }, + { 121, 24, 80, 195, 26, 62, 44, 64, 85 }, + { 63, 20, 8, 114, 114, 208, 12, 9, 226 }, + { 170, 46, 55, 19, 136, 160, 33, 206, 71 }, + { 81, 40, 11, 96, 182, 84, 29, 16, 36 }, + { 152, 179, 64, 126, 170, 118, 46, 70, 95 }, + }, + { + { 75, 79, 123, 47, 51, 128, 81, 171, 1 }, + { 57, 17, 5, 71, 102, 57, 53, 41, 49 }, + { 125, 98, 42, 88, 104, 85, 117, 175, 82 }, + { 115, 21, 2, 10, 102, 255, 166, 23, 6 }, + { 38, 33, 13, 121, 57, 73, 26, 1, 85 }, + { 41, 10, 67, 138, 77, 110, 90, 47, 114 }, + { 57, 18, 10, 102, 102, 213, 34, 20, 43 }, + { 101, 29, 16, 10, 85, 128, 101, 196, 26 }, + { 117, 20, 15, 36, 163, 128, 68, 1, 26 }, + { 95, 84, 53, 89, 128, 100, 113, 101, 45 }, + }, + { + { 63, 59, 90, 180, 59, 166, 93, 73, 154 }, + { 40, 40, 21, 116, 143, 209, 34, 39, 175 }, + { 138, 31, 36, 171, 27, 166, 38, 44, 229 }, + { 57, 46, 22, 24, 128, 1, 54, 17, 37 }, + { 47, 15, 16, 183, 34, 223, 49, 45, 183 }, + { 46, 17, 33, 183, 6, 98, 15, 32, 183 }, + { 40, 3, 9, 115, 51, 192, 18, 6, 223 }, + { 65, 32, 73, 115, 28, 128, 23, 128, 205 }, + { 87, 37, 9, 115, 59, 77, 64, 21, 47 }, + { 67, 87, 58, 169, 82, 115, 26, 59, 179 }, + }, + { + { 54, 57, 112, 184, 5, 41, 38, 166, 213 }, + { 30, 34, 26, 133, 152, 116, 10, 32, 134 }, + { 104, 55, 44, 218, 9, 54, 53, 130, 226 }, + { 75, 32, 12, 51, 192, 255, 160, 43, 51 }, + { 39, 19, 53, 221, 26, 114, 32, 73, 255 }, + { 31, 9, 65, 234, 2, 15, 1, 118, 73 }, + { 56, 21, 23, 111, 59, 205, 45, 37, 192 }, + { 88, 31, 35, 67, 102, 85, 55, 186, 85 }, + { 55, 38, 70, 124, 73, 102, 1, 34, 98 }, + { 64, 90, 70, 205, 40, 41, 23, 26, 57 }, + }, + { + { 86, 40, 64, 135, 148, 224, 45, 183, 128 }, + { 22, 26, 17, 131, 240, 154, 14, 1, 209 }, + { 164, 50, 31, 137, 154, 133, 25, 35, 218 }, + { 83, 12, 13, 54, 192, 255, 68, 47, 28 }, + { 45, 16, 21, 91, 64, 222, 7, 1, 197 }, + { 56, 21, 39, 155, 60, 138, 23, 102, 213 }, + { 18, 11, 7, 63, 144, 171, 4, 4, 246 }, + { 85, 26, 85, 85, 128, 128, 32, 146, 171 }, + { 35, 27, 10, 146, 174, 171, 12, 26, 128 }, + { 51, 103, 44, 131, 131, 123, 31, 6, 158 }, + }, + { + { 68, 45, 128, 34, 1, 47, 11, 245, 171 }, + { 62, 17, 19, 70, 146, 85, 55, 62, 70 }, + { 102, 61, 71, 37, 34, 53, 31, 243, 192 }, + { 75, 15, 9, 9, 64, 255, 184, 119, 16 }, + { 37, 43, 37, 154, 100, 163, 85, 160, 1 }, + { 63, 9, 92, 136, 28, 64, 32, 201, 85 }, + { 56, 8, 17, 132, 137, 255, 55, 116, 128 }, + { 86, 6, 28, 5, 64, 255, 25, 248, 1 }, + { 58, 15, 20, 82, 135, 57, 26, 121, 40 }, + { 69, 60, 71, 38, 73, 119, 28, 222, 37 }, + }, + { + { 101, 75, 128, 139, 118, 146, 116, 128, 85 }, + { 56, 41, 15, 176, 236, 85, 37, 9, 62 }, + { 190, 80, 35, 99, 180, 80, 126, 54, 45 }, + { 146, 36, 19, 30, 171, 255, 97, 27, 20 }, + { 71, 30, 17, 119, 118, 255, 17, 18, 138 }, + { 101, 38, 60, 138, 55, 70, 43, 26, 142 }, + { 32, 41, 20, 117, 151, 142, 20, 21, 163 }, + { 138, 45, 61, 62, 219, 1, 81, 188, 64 }, + { 112, 19, 12, 61, 195, 128, 48, 4, 24 }, + { 85, 126, 47, 87, 176, 51, 41, 20, 32 }, + }, + { + { 66, 102, 167, 99, 74, 62, 40, 234, 128 }, + { 41, 53, 9, 178, 241, 141, 26, 8, 107 }, + { 134, 183, 89, 137, 98, 101, 106, 165, 148 }, + { 104, 79, 12, 27, 217, 255, 87, 17, 7 }, + { 74, 43, 26, 146, 73, 166, 49, 23, 157 }, + { 65, 38, 105, 160, 51, 52, 31, 115, 128 }, + { 47, 41, 14, 110, 182, 183, 21, 17, 194 }, + { 87, 68, 71, 44, 114, 51, 15, 186, 23 }, + { 66, 45, 25, 102, 197, 189, 23, 18, 22 }, + { 72, 187, 100, 130, 157, 111, 32, 75, 80 }, + }, +}; + +static const int8_t vp8_segmentid_tree[][2] = +{ + { 1, 2 }, + { -0, -1 }, // '00', '01' + { -2, -3 }, // '10', '11' +}; + +static const uint8_t vp8_coeff_band[16] = +{ + 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7 +}; + +/* Inverse of vp8_coeff_band: mappings of bands to coefficient indexes. + * Each list is -1-terminated. */ +static const int8_t vp8_coeff_band_indexes[8][10] = +{ + {0, -1}, + {1, -1}, + {2, -1}, + {3, -1}, + {5, -1}, + {6, -1}, + {4, 7, 8, 9, 10, 11, 12, 13, 14, -1}, + {15, -1} +}; + +static const uint8_t vp8_dct_cat1_prob[] = { 159, 0 }; +static const uint8_t vp8_dct_cat2_prob[] = { 165, 145, 0 }; +static const uint8_t vp8_dct_cat3_prob[] = { 173, 148, 140, 0 }; +static const uint8_t vp8_dct_cat4_prob[] = { 176, 155, 140, 135, 0 }; +static const uint8_t vp8_dct_cat5_prob[] = { 180, 157, 141, 134, 130, 0 }; +static const uint8_t vp8_dct_cat6_prob[] = { 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0 }; + +// only used for cat3 and above; cat 1 and 2 are referenced directly +static const uint8_t * const vp8_dct_cat_prob[] = +{ + vp8_dct_cat3_prob, + vp8_dct_cat4_prob, + vp8_dct_cat5_prob, + vp8_dct_cat6_prob, +}; + +static const uint8_t vp8_token_default_probs[4][8][3][NUM_DCT_TOKENS-1] = +{ + { + { + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + { + { 253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128 }, + { 189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128 }, + { 106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128 }, + }, + { + { 1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128 }, + { 181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128 }, + { 78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128 }, + }, + { + { 1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128 }, + { 184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128 }, + { 77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128 }, + }, + { + { 1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128 }, + { 170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128 }, + { 37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128 }, + }, + { + { 1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128 }, + { 207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128 }, + { 102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128 }, + }, + { + { 1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128 }, + { 177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128 }, + { 80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128 }, + }, + { + { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + }, + { + { + { 198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62 }, + { 131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1 }, + { 68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128 }, + }, + { + { 1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128 }, + { 184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128 }, + { 81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128 }, + }, + { + { 1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128 }, + { 99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128 }, + { 23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128 }, + }, + { + { 1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128 }, + { 109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128 }, + { 44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128 }, + }, + { + { 1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128 }, + { 94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128 }, + { 22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128 }, + }, + { + { 1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128 }, + { 124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128 }, + { 35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128 }, + }, + { + { 1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128 }, + { 121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128 }, + { 45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128 }, + }, + { + { 1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128 }, + { 203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128 }, + }, + }, + { + { + { 253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128 }, + { 175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128 }, + { 73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128 }, + }, + { + { 1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128 }, + { 239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128 }, + { 155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128 }, + }, + { + { 1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128 }, + { 201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128 }, + { 69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128 }, + }, + { + { 1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128 }, + { 141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, + }, + { + { 1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128 }, + { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + { + { 1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + { + { 1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + { + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + }, + { + { + { 202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255 }, + { 126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128 }, + { 61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128 }, + }, + { + { 1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128 }, + { 166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128 }, + { 39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128 }, + }, + { + { 1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128 }, + { 124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128 }, + { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128 }, + }, + { + { 1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128 }, + { 149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128 }, + { 28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128 }, + }, + { + { 1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128 }, + { 123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128 }, + { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128 }, + }, + { + { 1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128 }, + { 168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128 }, + { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 }, + }, + { + { 1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128 }, + { 141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128 }, + { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128 }, + }, + { + { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + }, +}; + +static const uint8_t vp8_token_update_probs[4][8][3][NUM_DCT_TOKENS-1] = +{ + { + { + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255 }, + { 250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255 }, + { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + }, + { + { + { 217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255 }, + { 234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255 }, + }, + { + { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + }, + { + { + { 186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255 }, + { 251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255 }, + }, + { + { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + }, + { + { + { 248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255 }, + { 248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + { + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + }, + }, +}; + +// fixme: copied from h264data.h +static const uint8_t zigzag_scan[16]={ + 0+0*4, 1+0*4, 0+1*4, 0+2*4, + 1+1*4, 2+0*4, 3+0*4, 2+1*4, + 1+2*4, 0+3*4, 1+3*4, 2+2*4, + 3+1*4, 3+2*4, 2+3*4, 3+3*4, +}; + +static const uint8_t vp8_dc_qlookup[VP8_MAX_QUANT+1] = +{ + 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, + 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 91, 93, 95, 96, 98, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118, + 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157, +}; + +static const uint16_t vp8_ac_qlookup[VP8_MAX_QUANT+1] = +{ + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, + 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, + 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, + 155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, + 213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284, +}; + +static const uint8_t vp8_mv_update_prob[2][19] = { + { 237, + 246, + 253, 253, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 250, 250, 252, 254, 254 }, + { 231, + 243, + 245, 253, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 251, 251, 254, 254, 254 } +}; + +static const uint8_t vp8_mv_default_prob[2][19] = { + { 162, + 128, + 225, 146, 172, 147, 214, 39, 156, + 128, 129, 132, 75, 145, 178, 206, 239, 254, 254 }, + { 164, + 128, + 204, 170, 119, 235, 140, 230, 228, + 128, 130, 130, 74, 148, 180, 203, 236, 254, 254 } +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8dsp.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8dsp.c new file mode 100644 index 00000000..30699cec --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8dsp.c @@ -0,0 +1,526 @@ +/** + * VP8 compatible video decoder + * + * Copyright (C) 2010 David Conrad + * Copyright (C) 2010 Ronald S. Bultje + * + * 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 + */ + +#include "dsputil.h" +#include "vp8dsp.h" + +// TODO: Maybe add dequant +static void vp8_luma_dc_wht_c(DCTELEM block[4][4][16], DCTELEM dc[16]) +{ + int i, t0, t1, t2, t3; + + for (i = 0; i < 4; i++) { + t0 = dc[0*4+i] + dc[3*4+i]; + t1 = dc[1*4+i] + dc[2*4+i]; + t2 = dc[1*4+i] - dc[2*4+i]; + t3 = dc[0*4+i] - dc[3*4+i]; + + dc[0*4+i] = t0 + t1; + dc[1*4+i] = t3 + t2; + dc[2*4+i] = t0 - t1; + dc[3*4+i] = t3 - t2; + } + + for (i = 0; i < 4; i++) { + t0 = dc[i*4+0] + dc[i*4+3] + 3; // rounding + t1 = dc[i*4+1] + dc[i*4+2]; + t2 = dc[i*4+1] - dc[i*4+2]; + t3 = dc[i*4+0] - dc[i*4+3] + 3; // rounding + dc[i*4+0] = 0; + dc[i*4+1] = 0; + dc[i*4+2] = 0; + dc[i*4+3] = 0; + + block[i][0][0] = (t0 + t1) >> 3; + block[i][1][0] = (t3 + t2) >> 3; + block[i][2][0] = (t0 - t1) >> 3; + block[i][3][0] = (t3 - t2) >> 3; + } +} + +static void vp8_luma_dc_wht_dc_c(DCTELEM block[4][4][16], DCTELEM dc[16]) +{ + int i, val = (dc[0] + 3) >> 3; + dc[0] = 0; + + for (i = 0; i < 4; i++) { + block[i][0][0] = val; + block[i][1][0] = val; + block[i][2][0] = val; + block[i][3][0] = val; + } +} + +#define MUL_20091(a) ((((a)*20091) >> 16) + (a)) +#define MUL_35468(a) (((a)*35468) >> 16) + +static void vp8_idct_add_c(uint8_t *dst, DCTELEM block[16], int stride) +{ + int i, t0, t1, t2, t3; + uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; + DCTELEM tmp[16]; + + for (i = 0; i < 4; i++) { + t0 = block[0*4+i] + block[2*4+i]; + t1 = block[0*4+i] - block[2*4+i]; + t2 = MUL_35468(block[1*4+i]) - MUL_20091(block[3*4+i]); + t3 = MUL_20091(block[1*4+i]) + MUL_35468(block[3*4+i]); + block[0*4+i] = 0; + block[1*4+i] = 0; + block[2*4+i] = 0; + block[3*4+i] = 0; + + tmp[i*4+0] = t0 + t3; + tmp[i*4+1] = t1 + t2; + tmp[i*4+2] = t1 - t2; + tmp[i*4+3] = t0 - t3; + } + + for (i = 0; i < 4; i++) { + t0 = tmp[0*4+i] + tmp[2*4+i]; + t1 = tmp[0*4+i] - tmp[2*4+i]; + t2 = MUL_35468(tmp[1*4+i]) - MUL_20091(tmp[3*4+i]); + t3 = MUL_20091(tmp[1*4+i]) + MUL_35468(tmp[3*4+i]); + + dst[0] = cm[dst[0] + ((t0 + t3 + 4) >> 3)]; + dst[1] = cm[dst[1] + ((t1 + t2 + 4) >> 3)]; + dst[2] = cm[dst[2] + ((t1 - t2 + 4) >> 3)]; + dst[3] = cm[dst[3] + ((t0 - t3 + 4) >> 3)]; + dst += stride; + } +} + +static void vp8_idct_dc_add_c(uint8_t *dst, DCTELEM block[16], int stride) +{ + int i, dc = (block[0] + 4) >> 3; + uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + dc; + block[0] = 0; + + for (i = 0; i < 4; i++) { + dst[0] = cm[dst[0]]; + dst[1] = cm[dst[1]]; + dst[2] = cm[dst[2]]; + dst[3] = cm[dst[3]]; + dst += stride; + } +} + +static void vp8_idct_dc_add4uv_c(uint8_t *dst, DCTELEM block[4][16], int stride) +{ + vp8_idct_dc_add_c(dst+stride*0+0, block[0], stride); + vp8_idct_dc_add_c(dst+stride*0+4, block[1], stride); + vp8_idct_dc_add_c(dst+stride*4+0, block[2], stride); + vp8_idct_dc_add_c(dst+stride*4+4, block[3], stride); +} + +static void vp8_idct_dc_add4y_c(uint8_t *dst, DCTELEM block[4][16], int stride) +{ + vp8_idct_dc_add_c(dst+ 0, block[0], stride); + vp8_idct_dc_add_c(dst+ 4, block[1], stride); + vp8_idct_dc_add_c(dst+ 8, block[2], stride); + vp8_idct_dc_add_c(dst+12, block[3], stride); +} + +// because I like only having two parameters to pass functions... +#define LOAD_PIXELS\ + int av_unused p3 = p[-4*stride];\ + int av_unused p2 = p[-3*stride];\ + int av_unused p1 = p[-2*stride];\ + int av_unused p0 = p[-1*stride];\ + int av_unused q0 = p[ 0*stride];\ + int av_unused q1 = p[ 1*stride];\ + int av_unused q2 = p[ 2*stride];\ + int av_unused q3 = p[ 3*stride]; + +#define clip_int8(n) (cm[n+0x80]-0x80) + +static av_always_inline void filter_common(uint8_t *p, int stride, int is4tap) +{ + LOAD_PIXELS + int a, f1, f2; + uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; + + a = 3*(q0 - p0); + + if (is4tap) + a += clip_int8(p1 - q1); + + a = clip_int8(a); + + // We deviate from the spec here with c(a+3) >> 3 + // since that's what libvpx does. + f1 = FFMIN(a+4, 127) >> 3; + f2 = FFMIN(a+3, 127) >> 3; + + // Despite what the spec says, we do need to clamp here to + // be bitexact with libvpx. + p[-1*stride] = cm[p0 + f2]; + p[ 0*stride] = cm[q0 - f1]; + + // only used for _inner on blocks without high edge variance + if (!is4tap) { + a = (f1+1)>>1; + p[-2*stride] = cm[p1 + a]; + p[ 1*stride] = cm[q1 - a]; + } +} + +static av_always_inline int simple_limit(uint8_t *p, int stride, int flim) +{ + LOAD_PIXELS + return 2*FFABS(p0-q0) + (FFABS(p1-q1) >> 1) <= flim; +} + +/** + * E - limit at the macroblock edge + * I - limit for interior difference + */ +static av_always_inline int normal_limit(uint8_t *p, int stride, int E, int I) +{ + LOAD_PIXELS + return simple_limit(p, stride, E) + && FFABS(p3-p2) <= I && FFABS(p2-p1) <= I && FFABS(p1-p0) <= I + && FFABS(q3-q2) <= I && FFABS(q2-q1) <= I && FFABS(q1-q0) <= I; +} + +// high edge variance +static av_always_inline int hev(uint8_t *p, int stride, int thresh) +{ + LOAD_PIXELS + return FFABS(p1-p0) > thresh || FFABS(q1-q0) > thresh; +} + +static av_always_inline void filter_mbedge(uint8_t *p, int stride) +{ + int a0, a1, a2, w; + uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; + + LOAD_PIXELS + + w = clip_int8(p1-q1); + w = clip_int8(w + 3*(q0-p0)); + + a0 = (27*w + 63) >> 7; + a1 = (18*w + 63) >> 7; + a2 = ( 9*w + 63) >> 7; + + p[-3*stride] = cm[p2 + a2]; + p[-2*stride] = cm[p1 + a1]; + p[-1*stride] = cm[p0 + a0]; + p[ 0*stride] = cm[q0 - a0]; + p[ 1*stride] = cm[q1 - a1]; + p[ 2*stride] = cm[q2 - a2]; +} + +#define LOOP_FILTER(dir, size, stridea, strideb, maybe_inline) \ +static maybe_inline void vp8_ ## dir ## _loop_filter ## size ## _c(uint8_t *dst, int stride,\ + int flim_E, int flim_I, int hev_thresh)\ +{\ + int i;\ +\ + for (i = 0; i < size; i++)\ + if (normal_limit(dst+i*stridea, strideb, flim_E, flim_I)) {\ + if (hev(dst+i*stridea, strideb, hev_thresh))\ + filter_common(dst+i*stridea, strideb, 1);\ + else\ + filter_mbedge(dst+i*stridea, strideb);\ + }\ +}\ +\ +static maybe_inline void vp8_ ## dir ## _loop_filter ## size ## _inner_c(uint8_t *dst, int stride,\ + int flim_E, int flim_I, int hev_thresh)\ +{\ + int i;\ +\ + for (i = 0; i < size; i++)\ + if (normal_limit(dst+i*stridea, strideb, flim_E, flim_I)) {\ + int hv = hev(dst+i*stridea, strideb, hev_thresh);\ + if (hv) \ + filter_common(dst+i*stridea, strideb, 1);\ + else \ + filter_common(dst+i*stridea, strideb, 0);\ + }\ +} + +LOOP_FILTER(v, 16, 1, stride,) +LOOP_FILTER(h, 16, stride, 1,) + +#define UV_LOOP_FILTER(dir, stridea, strideb) \ +LOOP_FILTER(dir, 8, stridea, strideb, av_always_inline) \ +static void vp8_ ## dir ## _loop_filter8uv_c(uint8_t *dstU, uint8_t *dstV, int stride,\ + int fE, int fI, int hev_thresh)\ +{\ + vp8_ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh);\ + vp8_ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh);\ +}\ +static void vp8_ ## dir ## _loop_filter8uv_inner_c(uint8_t *dstU, uint8_t *dstV, int stride,\ + int fE, int fI, int hev_thresh)\ +{\ + vp8_ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, hev_thresh);\ + vp8_ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, hev_thresh);\ +} + +UV_LOOP_FILTER(v, 1, stride) +UV_LOOP_FILTER(h, stride, 1) + +static void vp8_v_loop_filter_simple_c(uint8_t *dst, int stride, int flim) +{ + int i; + + for (i = 0; i < 16; i++) + if (simple_limit(dst+i, stride, flim)) + filter_common(dst+i, stride, 1); +} + +static void vp8_h_loop_filter_simple_c(uint8_t *dst, int stride, int flim) +{ + int i; + + for (i = 0; i < 16; i++) + if (simple_limit(dst+i*stride, 1, flim)) + filter_common(dst+i*stride, 1, 1); +} + +static const uint8_t subpel_filters[7][6] = { + { 0, 6, 123, 12, 1, 0 }, + { 2, 11, 108, 36, 8, 1 }, + { 0, 9, 93, 50, 6, 0 }, + { 3, 16, 77, 77, 16, 3 }, + { 0, 6, 50, 93, 9, 0 }, + { 1, 8, 36, 108, 11, 2 }, + { 0, 1, 12, 123, 6, 0 }, +}; + +#define PUT_PIXELS(WIDTH) \ +static void put_vp8_pixels ## WIDTH ##_c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int x, int y) { \ + int i; \ + for (i = 0; i < h; i++, dst+= dststride, src+= srcstride) { \ + memcpy(dst, src, WIDTH); \ + } \ +} + +PUT_PIXELS(16) +PUT_PIXELS(8) +PUT_PIXELS(4) + +#define FILTER_6TAP(src, F, stride) \ + cm[(F[2]*src[x+0*stride] - F[1]*src[x-1*stride] + F[0]*src[x-2*stride] + \ + F[3]*src[x+1*stride] - F[4]*src[x+2*stride] + F[5]*src[x+3*stride] + 64) >> 7] + +#define FILTER_4TAP(src, F, stride) \ + cm[(F[2]*src[x+0*stride] - F[1]*src[x-1*stride] + \ + F[3]*src[x+1*stride] - F[4]*src[x+2*stride] + 64) >> 7] + +#define VP8_EPEL_H(SIZE, TAPS) \ +static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \ +{ \ + const uint8_t *filter = subpel_filters[mx-1]; \ + uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \ + int x, y; \ +\ + for (y = 0; y < h; y++) { \ + for (x = 0; x < SIZE; x++) \ + dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \ + dst += dststride; \ + src += srcstride; \ + } \ +} +#define VP8_EPEL_V(SIZE, TAPS) \ +static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \ +{ \ + const uint8_t *filter = subpel_filters[my-1]; \ + uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \ + int x, y; \ +\ + for (y = 0; y < h; y++) { \ + for (x = 0; x < SIZE; x++) \ + dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \ + dst += dststride; \ + src += srcstride; \ + } \ +} +#define VP8_EPEL_HV(SIZE, HTAPS, VTAPS) \ +static void put_vp8_epel ## SIZE ## _h ## HTAPS ## v ## VTAPS ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \ +{ \ + const uint8_t *filter = subpel_filters[mx-1]; \ + uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \ + int x, y; \ + uint8_t tmp_array[(2*SIZE+VTAPS-1)*SIZE]; \ + uint8_t *tmp = tmp_array; \ + src -= (2-(VTAPS==4))*srcstride; \ +\ + for (y = 0; y < h+VTAPS-1; y++) { \ + for (x = 0; x < SIZE; x++) \ + tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \ + tmp += SIZE; \ + src += srcstride; \ + } \ +\ + tmp = tmp_array + (2-(VTAPS==4))*SIZE; \ + filter = subpel_filters[my-1]; \ +\ + for (y = 0; y < h; y++) { \ + for (x = 0; x < SIZE; x++) \ + dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \ + dst += dststride; \ + tmp += SIZE; \ + } \ +} + +VP8_EPEL_H(16, 4) +VP8_EPEL_H(8, 4) +VP8_EPEL_H(4, 4) +VP8_EPEL_H(16, 6) +VP8_EPEL_H(8, 6) +VP8_EPEL_H(4, 6) +VP8_EPEL_V(16, 4) +VP8_EPEL_V(8, 4) +VP8_EPEL_V(4, 4) +VP8_EPEL_V(16, 6) +VP8_EPEL_V(8, 6) +VP8_EPEL_V(4, 6) +VP8_EPEL_HV(16, 4, 4) +VP8_EPEL_HV(8, 4, 4) +VP8_EPEL_HV(4, 4, 4) +VP8_EPEL_HV(16, 4, 6) +VP8_EPEL_HV(8, 4, 6) +VP8_EPEL_HV(4, 4, 6) +VP8_EPEL_HV(16, 6, 4) +VP8_EPEL_HV(8, 6, 4) +VP8_EPEL_HV(4, 6, 4) +VP8_EPEL_HV(16, 6, 6) +VP8_EPEL_HV(8, 6, 6) +VP8_EPEL_HV(4, 6, 6) + +#define VP8_BILINEAR(SIZE) \ +static void put_vp8_bilinear ## SIZE ## _h_c(uint8_t *dst, int stride, uint8_t *src, int s2, int h, int mx, int my) \ +{ \ + int a = 8-mx, b = mx; \ + int x, y; \ +\ + for (y = 0; y < h; y++) { \ + for (x = 0; x < SIZE; x++) \ + dst[x] = (a*src[x] + b*src[x+1] + 4) >> 3; \ + dst += stride; \ + src += stride; \ + } \ +} \ +static void put_vp8_bilinear ## SIZE ## _v_c(uint8_t *dst, int stride, uint8_t *src, int s2, int h, int mx, int my) \ +{ \ + int c = 8-my, d = my; \ + int x, y; \ +\ + for (y = 0; y < h; y++) { \ + for (x = 0; x < SIZE; x++) \ + dst[x] = (c*src[x] + d*src[x+stride] + 4) >> 3; \ + dst += stride; \ + src += stride; \ + } \ +} \ +\ +static void put_vp8_bilinear ## SIZE ## _hv_c(uint8_t *dst, int stride, uint8_t *src, int s2, int h, int mx, int my) \ +{ \ + int a = 8-mx, b = mx; \ + int c = 8-my, d = my; \ + int x, y; \ + uint8_t tmp_array[(2*SIZE+1)*SIZE]; \ + uint8_t *tmp = tmp_array; \ +\ + for (y = 0; y < h+1; y++) { \ + for (x = 0; x < SIZE; x++) \ + tmp[x] = (a*src[x] + b*src[x+1] + 4) >> 3; \ + tmp += SIZE; \ + src += stride; \ + } \ +\ + tmp = tmp_array; \ +\ + for (y = 0; y < h; y++) { \ + for (x = 0; x < SIZE; x++) \ + dst[x] = (c*tmp[x] + d*tmp[x+SIZE] + 4) >> 3; \ + dst += stride; \ + tmp += SIZE; \ + } \ +} + +VP8_BILINEAR(16) +VP8_BILINEAR(8) +VP8_BILINEAR(4) + +#define VP8_MC_FUNC(IDX, SIZE) \ + dsp->put_vp8_epel_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \ + dsp->put_vp8_epel_pixels_tab[IDX][0][1] = put_vp8_epel ## SIZE ## _h4_c; \ + dsp->put_vp8_epel_pixels_tab[IDX][0][2] = put_vp8_epel ## SIZE ## _h6_c; \ + dsp->put_vp8_epel_pixels_tab[IDX][1][0] = put_vp8_epel ## SIZE ## _v4_c; \ + dsp->put_vp8_epel_pixels_tab[IDX][1][1] = put_vp8_epel ## SIZE ## _h4v4_c; \ + dsp->put_vp8_epel_pixels_tab[IDX][1][2] = put_vp8_epel ## SIZE ## _h6v4_c; \ + dsp->put_vp8_epel_pixels_tab[IDX][2][0] = put_vp8_epel ## SIZE ## _v6_c; \ + dsp->put_vp8_epel_pixels_tab[IDX][2][1] = put_vp8_epel ## SIZE ## _h4v6_c; \ + dsp->put_vp8_epel_pixels_tab[IDX][2][2] = put_vp8_epel ## SIZE ## _h6v6_c + +#define VP8_BILINEAR_MC_FUNC(IDX, SIZE) \ + dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \ + dsp->put_vp8_bilinear_pixels_tab[IDX][0][1] = put_vp8_bilinear ## SIZE ## _h_c; \ + dsp->put_vp8_bilinear_pixels_tab[IDX][0][2] = put_vp8_bilinear ## SIZE ## _h_c; \ + dsp->put_vp8_bilinear_pixels_tab[IDX][1][0] = put_vp8_bilinear ## SIZE ## _v_c; \ + dsp->put_vp8_bilinear_pixels_tab[IDX][1][1] = put_vp8_bilinear ## SIZE ## _hv_c; \ + dsp->put_vp8_bilinear_pixels_tab[IDX][1][2] = put_vp8_bilinear ## SIZE ## _hv_c; \ + dsp->put_vp8_bilinear_pixels_tab[IDX][2][0] = put_vp8_bilinear ## SIZE ## _v_c; \ + dsp->put_vp8_bilinear_pixels_tab[IDX][2][1] = put_vp8_bilinear ## SIZE ## _hv_c; \ + dsp->put_vp8_bilinear_pixels_tab[IDX][2][2] = put_vp8_bilinear ## SIZE ## _hv_c + +av_cold void ff_vp8dsp_init(VP8DSPContext *dsp) +{ + dsp->vp8_luma_dc_wht = vp8_luma_dc_wht_c; + dsp->vp8_luma_dc_wht_dc = vp8_luma_dc_wht_dc_c; + dsp->vp8_idct_add = vp8_idct_add_c; + dsp->vp8_idct_dc_add = vp8_idct_dc_add_c; + dsp->vp8_idct_dc_add4y = vp8_idct_dc_add4y_c; + dsp->vp8_idct_dc_add4uv = vp8_idct_dc_add4uv_c; + + dsp->vp8_v_loop_filter16y = vp8_v_loop_filter16_c; + dsp->vp8_h_loop_filter16y = vp8_h_loop_filter16_c; + dsp->vp8_v_loop_filter8uv = vp8_v_loop_filter8uv_c; + dsp->vp8_h_loop_filter8uv = vp8_h_loop_filter8uv_c; + + dsp->vp8_v_loop_filter16y_inner = vp8_v_loop_filter16_inner_c; + dsp->vp8_h_loop_filter16y_inner = vp8_h_loop_filter16_inner_c; + dsp->vp8_v_loop_filter8uv_inner = vp8_v_loop_filter8uv_inner_c; + dsp->vp8_h_loop_filter8uv_inner = vp8_h_loop_filter8uv_inner_c; + + dsp->vp8_v_loop_filter_simple = vp8_v_loop_filter_simple_c; + dsp->vp8_h_loop_filter_simple = vp8_h_loop_filter_simple_c; + + VP8_MC_FUNC(0, 16); + VP8_MC_FUNC(1, 8); + VP8_MC_FUNC(2, 4); + + VP8_BILINEAR_MC_FUNC(0, 16); + VP8_BILINEAR_MC_FUNC(1, 8); + VP8_BILINEAR_MC_FUNC(2, 4); + + if (HAVE_MMX) + ff_vp8dsp_init_x86(dsp); + if (HAVE_ALTIVEC) + ff_vp8dsp_init_altivec(dsp); +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8dsp.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8dsp.h new file mode 100644 index 00000000..ee5c7ec0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/vp8dsp.h @@ -0,0 +1,83 @@ +/** + * VP8 compatible video decoder + * + * Copyright (C) 2010 David Conrad + * Copyright (C) 2010 Ronald S. Bultje + * + * 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 + */ + + +#ifndef AVCODEC_VP8DSP_H +#define AVCODEC_VP8DSP_H + +#include "dsputil.h" + +typedef void (*vp8_mc_func)(uint8_t *dst/*align 8*/, int dstStride, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y); + +typedef struct VP8DSPContext { + void (*vp8_luma_dc_wht)(DCTELEM block[4][4][16], DCTELEM dc[16]); + void (*vp8_luma_dc_wht_dc)(DCTELEM block[4][4][16], DCTELEM dc[16]); + void (*vp8_idct_add)(uint8_t *dst, DCTELEM block[16], int stride); + void (*vp8_idct_dc_add)(uint8_t *dst, DCTELEM block[16], int stride); + void (*vp8_idct_dc_add4y)(uint8_t *dst, DCTELEM block[4][16], int stride); + void (*vp8_idct_dc_add4uv)(uint8_t *dst, DCTELEM block[4][16], int stride); + + // loop filter applied to edges between macroblocks + void (*vp8_v_loop_filter16y)(uint8_t *dst, int stride, + int flim_E, int flim_I, int hev_thresh); + void (*vp8_h_loop_filter16y)(uint8_t *dst, int stride, + int flim_E, int flim_I, int hev_thresh); + void (*vp8_v_loop_filter8uv)(uint8_t *dstU, uint8_t *dstV, int stride, + int flim_E, int flim_I, int hev_thresh); + void (*vp8_h_loop_filter8uv)(uint8_t *dstU, uint8_t *dstV, int stride, + int flim_E, int flim_I, int hev_thresh); + + // loop filter applied to inner macroblock edges + void (*vp8_v_loop_filter16y_inner)(uint8_t *dst, int stride, + int flim_E, int flim_I, int hev_thresh); + void (*vp8_h_loop_filter16y_inner)(uint8_t *dst, int stride, + int flim_E, int flim_I, int hev_thresh); + void (*vp8_v_loop_filter8uv_inner)(uint8_t *dstU, uint8_t *dstV, int stride, + int flim_E, int flim_I, int hev_thresh); + void (*vp8_h_loop_filter8uv_inner)(uint8_t *dstU, uint8_t *dstV, int stride, + int flim_E, int flim_I, int hev_thresh); + + void (*vp8_v_loop_filter_simple)(uint8_t *dst, int stride, int flim); + void (*vp8_h_loop_filter_simple)(uint8_t *dst, int stride, int flim); + + /** + * first dimension: width>>3, height is assumed equal to width + * second dimension: 0 if no vertical interpolation is needed; + * 1 4-tap vertical interpolation filter (my & 1) + * 2 6-tap vertical interpolation filter (!(my & 1)) + * third dimension: same as second dimention, for horizontal interpolation + * so something like put_vp8_epel_pixels_tab[width>>3][2*!!my-(my&1)][2*!!mx-(mx&1)](..., mx, my) + */ + vp8_mc_func put_vp8_epel_pixels_tab[3][3][3]; + vp8_mc_func put_vp8_bilinear_pixels_tab[3][3][3]; +} VP8DSPContext; + +void ff_put_vp8_pixels16_c(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y); +void ff_put_vp8_pixels8_c(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y); +void ff_put_vp8_pixels4_c(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y); + +void ff_vp8dsp_init(VP8DSPContext *c); +void ff_vp8dsp_init_x86(VP8DSPContext *c); +void ff_vp8dsp_init_altivec(VP8DSPContext *c); + +#endif /* AVCODEC_VP8DSP_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmavoice.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmavoice.c new file mode 100644 index 00000000..13011ec2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmavoice.c @@ -0,0 +1,2033 @@ +/* + * Windows Media Audio Voice decoder. + * Copyright (c) 2009 Ronald S. Bultje + * + * 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 + * @brief Windows Media Audio Voice compatible decoder + * @author Ronald S. Bultje + */ + +#include +#include "avcodec.h" +#include "get_bits.h" +#include "put_bits.h" +#include "wmavoice_data.h" +#include "celp_math.h" +#include "celp_filters.h" +#include "acelp_vectors.h" +#include "acelp_filters.h" +#include "lsp.h" +#include "libavutil/lzo.h" +#include "avfft.h" +#include "fft.h" + +#define MAX_BLOCKS 8 ///< maximum number of blocks per frame +#define MAX_LSPS 16 ///< maximum filter order +#define MAX_LSPS_ALIGN16 16 ///< same as #MAX_LSPS; needs to be multiple + ///< of 16 for ASM input buffer alignment +#define MAX_FRAMES 3 ///< maximum number of frames per superframe +#define MAX_FRAMESIZE 160 ///< maximum number of samples per frame +#define MAX_SIGNAL_HISTORY 416 ///< maximum excitation signal history +#define MAX_SFRAMESIZE (MAX_FRAMESIZE * MAX_FRAMES) + ///< maximum number of samples per superframe +#define SFRAME_CACHE_MAXSIZE 256 ///< maximum cache size for frame data that + ///< was split over two packets +#define VLC_NBITS 6 ///< number of bits to read per VLC iteration + +/** + * Frame type VLC coding. + */ +static VLC frame_type_vlc; + +/** + * Adaptive codebook types. + */ +enum { + ACB_TYPE_NONE = 0, ///< no adaptive codebook (only hardcoded fixed) + ACB_TYPE_ASYMMETRIC = 1, ///< adaptive codebook with per-frame pitch, which + ///< we interpolate to get a per-sample pitch. + ///< Signal is generated using an asymmetric sinc + ///< window function + ///< @note see #wmavoice_ipol1_coeffs + ACB_TYPE_HAMMING = 2 ///< Per-block pitch with signal generation using + ///< a Hamming sinc window function + ///< @note see #wmavoice_ipol2_coeffs +}; + +/** + * Fixed codebook types. + */ +enum { + FCB_TYPE_SILENCE = 0, ///< comfort noise during silence + ///< generated from a hardcoded (fixed) codebook + ///< with per-frame (low) gain values + FCB_TYPE_HARDCODED = 1, ///< hardcoded (fixed) codebook with per-block + ///< gain values + FCB_TYPE_AW_PULSES = 2, ///< Pitch-adaptive window (AW) pulse signals, + ///< used in particular for low-bitrate streams + FCB_TYPE_EXC_PULSES = 3, ///< Innovation (fixed) codebook pulse sets in + ///< combinations of either single pulses or + ///< pulse pairs +}; + +/** + * Description of frame types. + */ +static const struct frame_type_desc { + uint8_t n_blocks; ///< amount of blocks per frame (each block + ///< (contains 160/#n_blocks samples) + uint8_t log_n_blocks; ///< log2(#n_blocks) + uint8_t acb_type; ///< Adaptive codebook type (ACB_TYPE_*) + uint8_t fcb_type; ///< Fixed codebook type (FCB_TYPE_*) + uint8_t dbl_pulses; ///< how many pulse vectors have pulse pairs + ///< (rather than just one single pulse) + ///< only if #fcb_type == #FCB_TYPE_EXC_PULSES + uint16_t frame_size; ///< the amount of bits that make up the block + ///< data (per frame) +} frame_descs[17] = { + { 1, 0, ACB_TYPE_NONE, FCB_TYPE_SILENCE, 0, 0 }, + { 2, 1, ACB_TYPE_NONE, FCB_TYPE_HARDCODED, 0, 28 }, + { 2, 1, ACB_TYPE_ASYMMETRIC, FCB_TYPE_AW_PULSES, 0, 46 }, + { 2, 1, ACB_TYPE_ASYMMETRIC, FCB_TYPE_EXC_PULSES, 2, 80 }, + { 2, 1, ACB_TYPE_ASYMMETRIC, FCB_TYPE_EXC_PULSES, 5, 104 }, + { 4, 2, ACB_TYPE_ASYMMETRIC, FCB_TYPE_EXC_PULSES, 0, 108 }, + { 4, 2, ACB_TYPE_ASYMMETRIC, FCB_TYPE_EXC_PULSES, 2, 132 }, + { 4, 2, ACB_TYPE_ASYMMETRIC, FCB_TYPE_EXC_PULSES, 5, 168 }, + { 2, 1, ACB_TYPE_HAMMING, FCB_TYPE_EXC_PULSES, 0, 64 }, + { 2, 1, ACB_TYPE_HAMMING, FCB_TYPE_EXC_PULSES, 2, 80 }, + { 2, 1, ACB_TYPE_HAMMING, FCB_TYPE_EXC_PULSES, 5, 104 }, + { 4, 2, ACB_TYPE_HAMMING, FCB_TYPE_EXC_PULSES, 0, 108 }, + { 4, 2, ACB_TYPE_HAMMING, FCB_TYPE_EXC_PULSES, 2, 132 }, + { 4, 2, ACB_TYPE_HAMMING, FCB_TYPE_EXC_PULSES, 5, 168 }, + { 8, 3, ACB_TYPE_HAMMING, FCB_TYPE_EXC_PULSES, 0, 176 }, + { 8, 3, ACB_TYPE_HAMMING, FCB_TYPE_EXC_PULSES, 2, 208 }, + { 8, 3, ACB_TYPE_HAMMING, FCB_TYPE_EXC_PULSES, 5, 256 } +}; + +/** + * WMA Voice decoding context. + */ +typedef struct { + /** + * @defgroup struct_global Global values + * Global values, specified in the stream header / extradata or used + * all over. + * @{ + */ + GetBitContext gb; ///< packet bitreader. During decoder init, + ///< it contains the extradata from the + ///< demuxer. During decoding, it contains + ///< packet data. + int8_t vbm_tree[25]; ///< converts VLC codes to frame type + + int spillover_bitsize; ///< number of bits used to specify + ///< #spillover_nbits in the packet header + ///< = ceil(log2(ctx->block_align << 3)) + int history_nsamples; ///< number of samples in history for signal + ///< prediction (through ACB) + + /* postfilter specific values */ + int do_apf; ///< whether to apply the averaged + ///< projection filter (APF) + int denoise_strength; ///< strength of denoising in Wiener filter + ///< [0-11] + int denoise_tilt_corr; ///< Whether to apply tilt correction to the + ///< Wiener filter coefficients (postfilter) + int dc_level; ///< Predicted amount of DC noise, based + ///< on which a DC removal filter is used + + int lsps; ///< number of LSPs per frame [10 or 16] + int lsp_q_mode; ///< defines quantizer defaults [0, 1] + int lsp_def_mode; ///< defines different sets of LSP defaults + ///< [0, 1] + int frame_lsp_bitsize; ///< size (in bits) of LSPs, when encoded + ///< per-frame (independent coding) + int sframe_lsp_bitsize; ///< size (in bits) of LSPs, when encoded + ///< per superframe (residual coding) + + int min_pitch_val; ///< base value for pitch parsing code + int max_pitch_val; ///< max value + 1 for pitch parsing + int pitch_nbits; ///< number of bits used to specify the + ///< pitch value in the frame header + int block_pitch_nbits; ///< number of bits used to specify the + ///< first block's pitch value + int block_pitch_range; ///< range of the block pitch + int block_delta_pitch_nbits; ///< number of bits used to specify the + ///< delta pitch between this and the last + ///< block's pitch value, used in all but + ///< first block + int block_delta_pitch_hrange; ///< 1/2 range of the delta (full range is + ///< from -this to +this-1) + uint16_t block_conv_table[4]; ///< boundaries for block pitch unit/scale + ///< conversion + + /** + * @} + * @defgroup struct_packet Packet values + * Packet values, specified in the packet header or related to a packet. + * A packet is considered to be a single unit of data provided to this + * decoder by the demuxer. + * @{ + */ + int spillover_nbits; ///< number of bits of the previous packet's + ///< last superframe preceeding this + ///< packet's first full superframe (useful + ///< for re-synchronization also) + int has_residual_lsps; ///< if set, superframes contain one set of + ///< LSPs that cover all frames, encoded as + ///< independent and residual LSPs; if not + ///< set, each frame contains its own, fully + ///< independent, LSPs + int skip_bits_next; ///< number of bits to skip at the next call + ///< to #wmavoice_decode_packet() (since + ///< they're part of the previous superframe) + + uint8_t sframe_cache[SFRAME_CACHE_MAXSIZE + FF_INPUT_BUFFER_PADDING_SIZE]; + ///< cache for superframe data split over + ///< multiple packets + int sframe_cache_size; ///< set to >0 if we have data from an + ///< (incomplete) superframe from a previous + ///< packet that spilled over in the current + ///< packet; specifies the amount of bits in + ///< #sframe_cache + PutBitContext pb; ///< bitstream writer for #sframe_cache + + /** + * @} + * @defgroup struct_frame Frame and superframe values + * Superframe and frame data - these can change from frame to frame, + * although some of them do in that case serve as a cache / history for + * the next frame or superframe. + * @{ + */ + double prev_lsps[MAX_LSPS]; ///< LSPs of the last frame of the previous + ///< superframe + int last_pitch_val; ///< pitch value of the previous frame + int last_acb_type; ///< frame type [0-2] of the previous frame + int pitch_diff_sh16; ///< ((cur_pitch_val - #last_pitch_val) + ///< << 16) / #MAX_FRAMESIZE + float silence_gain; ///< set for use in blocks if #ACB_TYPE_NONE + + int aw_idx_is_ext; ///< whether the AW index was encoded in + ///< 8 bits (instead of 6) + int aw_pulse_range; ///< the range over which #aw_pulse_set1() + ///< can apply the pulse, relative to the + ///< value in aw_first_pulse_off. The exact + ///< position of the first AW-pulse is within + ///< [pulse_off, pulse_off + this], and + ///< depends on bitstream values; [16 or 24] + int aw_n_pulses[2]; ///< number of AW-pulses in each block; note + ///< that this number can be negative (in + ///< which case it basically means "zero") + int aw_first_pulse_off[2]; ///< index of first sample to which to + ///< apply AW-pulses, or -0xff if unset + int aw_next_pulse_off_cache; ///< the position (relative to start of the + ///< second block) at which pulses should + ///< start to be positioned, serves as a + ///< cache for pitch-adaptive window pulses + ///< between blocks + + int frame_cntr; ///< current frame index [0 - 0xFFFE]; is + ///< only used for comfort noise in #pRNG() + float gain_pred_err[6]; ///< cache for gain prediction + float excitation_history[MAX_SIGNAL_HISTORY]; + ///< cache of the signal of previous + ///< superframes, used as a history for + ///< signal generation + float synth_history[MAX_LSPS]; ///< see #excitation_history + /** + * @} + * @defgroup post_filter Postfilter values + * Variables used for postfilter implementation, mostly history for + * smoothing and so on, and context variables for FFT/iFFT. + * @{ + */ + RDFTContext rdft, irdft; ///< contexts for FFT-calculation in the + ///< postfilter (for denoise filter) + DCTContext dct, dst; ///< contexts for phase shift (in Hilbert + ///< transform, part of postfilter) + float sin[511], cos[511]; ///< 8-bit cosine/sine windows over [-pi,pi] + ///< range + float postfilter_agc; ///< gain control memory, used in + ///< #adaptive_gain_control() + float dcf_mem[2]; ///< DC filter history + float zero_exc_pf[MAX_SIGNAL_HISTORY + MAX_SFRAMESIZE]; + ///< zero filter output (i.e. excitation) + ///< by postfilter + float denoise_filter_cache[MAX_FRAMESIZE]; + int denoise_filter_cache_size; ///< samples in #denoise_filter_cache + DECLARE_ALIGNED(16, float, tilted_lpcs_pf)[0x80]; + ///< aligned buffer for LPC tilting + DECLARE_ALIGNED(16, float, denoise_coeffs_pf)[0x80]; + ///< aligned buffer for denoise coefficients + DECLARE_ALIGNED(16, float, synth_filter_out_buf)[0x80 + MAX_LSPS_ALIGN16]; + ///< aligned buffer for postfilter speech + ///< synthesis + /** + * @} + */ +} WMAVoiceContext; + +/** + * Set up the variable bit mode (VBM) tree from container extradata. + * @param gb bit I/O context. + * The bit context (s->gb) should be loaded with byte 23-46 of the + * container extradata (i.e. the ones containing the VBM tree). + * @param vbm_tree pointer to array to which the decoded VBM tree will be + * written. + * @return 0 on success, <0 on error. + */ +static av_cold int decode_vbmtree(GetBitContext *gb, int8_t vbm_tree[25]) +{ + static const uint8_t bits[] = { + 2, 2, 2, 4, 4, 4, + 6, 6, 6, 8, 8, 8, + 10, 10, 10, 12, 12, 12, + 14, 14, 14, 14 + }; + static const uint16_t codes[] = { + 0x0000, 0x0001, 0x0002, // 00/01/10 + 0x000c, 0x000d, 0x000e, // 11+00/01/10 + 0x003c, 0x003d, 0x003e, // 1111+00/01/10 + 0x00fc, 0x00fd, 0x00fe, // 111111+00/01/10 + 0x03fc, 0x03fd, 0x03fe, // 11111111+00/01/10 + 0x0ffc, 0x0ffd, 0x0ffe, // 1111111111+00/01/10 + 0x3ffc, 0x3ffd, 0x3ffe, 0x3fff // 111111111111+xx + }; + int cntr[8], n, res; + + memset(vbm_tree, 0xff, sizeof(vbm_tree)); + memset(cntr, 0, sizeof(cntr)); + for (n = 0; n < 17; n++) { + res = get_bits(gb, 3); + if (cntr[res] > 3) // should be >= 3 + (res == 7)) + return -1; + vbm_tree[res * 3 + cntr[res]++] = n; + } + INIT_VLC_STATIC(&frame_type_vlc, VLC_NBITS, sizeof(bits), + bits, 1, 1, codes, 2, 2, 132); + return 0; +} + +/** + * Set up decoder with parameters from demuxer (extradata etc.). + */ +static av_cold int wmavoice_decode_init(AVCodecContext *ctx) +{ + int n, flags, pitch_range, lsp16_flag; + WMAVoiceContext *s = ctx->priv_data; + + /** + * Extradata layout: + * - byte 0-18: WMAPro-in-WMAVoice extradata (see wmaprodec.c), + * - byte 19-22: flags field (annoyingly in LE; see below for known + * values), + * - byte 23-46: variable bitmode tree (really just 17 * 3 bits, + * rest is 0). + */ + if (ctx->extradata_size != 46) { + av_log(ctx, AV_LOG_ERROR, + "Invalid extradata size %d (should be 46)\n", + ctx->extradata_size); + return -1; + } + flags = AV_RL32(ctx->extradata + 18); + s->spillover_bitsize = 3 + av_ceil_log2(ctx->block_align); + s->do_apf = flags & 0x1; + if (s->do_apf) { + ff_rdft_init(&s->rdft, 7, DFT_R2C); + ff_rdft_init(&s->irdft, 7, IDFT_C2R); + ff_dct_init(&s->dct, 6, DCT_I); + ff_dct_init(&s->dst, 6, DST_I); + + ff_sine_window_init(s->cos, 256); + memcpy(&s->sin[255], s->cos, 256 * sizeof(s->cos[0])); + for (n = 0; n < 255; n++) { + s->sin[n] = -s->sin[510 - n]; + s->cos[510 - n] = s->cos[n]; + } + } + s->denoise_strength = (flags >> 2) & 0xF; + if (s->denoise_strength >= 12) { + av_log(ctx, AV_LOG_ERROR, + "Invalid denoise filter strength %d (max=11)\n", + s->denoise_strength); + return -1; + } + s->denoise_tilt_corr = !!(flags & 0x40); + s->dc_level = (flags >> 7) & 0xF; + s->lsp_q_mode = !!(flags & 0x2000); + s->lsp_def_mode = !!(flags & 0x4000); + lsp16_flag = flags & 0x1000; + if (lsp16_flag) { + s->lsps = 16; + s->frame_lsp_bitsize = 34; + s->sframe_lsp_bitsize = 60; + } else { + s->lsps = 10; + s->frame_lsp_bitsize = 24; + s->sframe_lsp_bitsize = 48; + } + for (n = 0; n < s->lsps; n++) + s->prev_lsps[n] = M_PI * (n + 1.0) / (s->lsps + 1.0); + + init_get_bits(&s->gb, ctx->extradata + 22, (ctx->extradata_size - 22) << 3); + if (decode_vbmtree(&s->gb, s->vbm_tree) < 0) { + av_log(ctx, AV_LOG_ERROR, "Invalid VBM tree; broken extradata?\n"); + return -1; + } + + s->min_pitch_val = ((ctx->sample_rate << 8) / 400 + 50) >> 8; + s->max_pitch_val = ((ctx->sample_rate << 8) * 37 / 2000 + 50) >> 8; + pitch_range = s->max_pitch_val - s->min_pitch_val; + s->pitch_nbits = av_ceil_log2(pitch_range); + s->last_pitch_val = 40; + s->last_acb_type = ACB_TYPE_NONE; + s->history_nsamples = s->max_pitch_val + 8; + + if (s->min_pitch_val < 1 || s->history_nsamples > MAX_SIGNAL_HISTORY) { + int min_sr = ((((1 << 8) - 50) * 400) + 0xFF) >> 8, + max_sr = ((((MAX_SIGNAL_HISTORY - 8) << 8) + 205) * 2000 / 37) >> 8; + + av_log(ctx, AV_LOG_ERROR, + "Unsupported samplerate %d (min=%d, max=%d)\n", + ctx->sample_rate, min_sr, max_sr); // 322-22097 Hz + + return -1; + } + + s->block_conv_table[0] = s->min_pitch_val; + s->block_conv_table[1] = (pitch_range * 25) >> 6; + s->block_conv_table[2] = (pitch_range * 44) >> 6; + s->block_conv_table[3] = s->max_pitch_val - 1; + s->block_delta_pitch_hrange = (pitch_range >> 3) & ~0xF; + s->block_delta_pitch_nbits = 1 + av_ceil_log2(s->block_delta_pitch_hrange); + s->block_pitch_range = s->block_conv_table[2] + + s->block_conv_table[3] + 1 + + 2 * (s->block_conv_table[1] - 2 * s->min_pitch_val); + s->block_pitch_nbits = av_ceil_log2(s->block_pitch_range); + + ctx->sample_fmt = AV_SAMPLE_FMT_FLT; + + return 0; +} + +/** + * @defgroup postfilter Postfilter functions + * Postfilter functions (gain control, wiener denoise filter, DC filter, + * kalman smoothening, plus surrounding code to wrap it) + * @{ + */ +/** + * Adaptive gain control (as used in postfilter). + * + * Identical to #ff_adaptive_gain_control() in acelp_vectors.c, except + * that the energy here is calculated using sum(abs(...)), whereas the + * other codecs (e.g. AMR-NB, SIPRO) use sqrt(dotproduct(...)). + * + * @param out output buffer for filtered samples + * @param in input buffer containing the samples as they are after the + * postfilter steps so far + * @param speech_synth input buffer containing speech synth before postfilter + * @param size input buffer size + * @param alpha exponential filter factor + * @param gain_mem pointer to filter memory (single float) + */ +static void adaptive_gain_control(float *out, const float *in, + const float *speech_synth, + int size, float alpha, float *gain_mem) +{ + int i; + float speech_energy = 0.0, postfilter_energy = 0.0, gain_scale_factor; + float mem = *gain_mem; + + for (i = 0; i < size; i++) { + speech_energy += fabsf(speech_synth[i]); + postfilter_energy += fabsf(in[i]); + } + gain_scale_factor = (1.0 - alpha) * speech_energy / postfilter_energy; + + for (i = 0; i < size; i++) { + mem = alpha * mem + gain_scale_factor; + out[i] = in[i] * mem; + } + + *gain_mem = mem; +} + +/** + * Kalman smoothing function. + * + * This function looks back pitch +/- 3 samples back into history to find + * the best fitting curve (that one giving the optimal gain of the two + * signals, i.e. the highest dot product between the two), and then + * uses that signal history to smoothen the output of the speech synthesis + * filter. + * + * @param s WMA Voice decoding context + * @param pitch pitch of the speech signal + * @param in input speech signal + * @param out output pointer for smoothened signal + * @param size input/output buffer size + * + * @returns -1 if no smoothening took place, e.g. because no optimal + * fit could be found, or 0 on success. + */ +static int kalman_smoothen(WMAVoiceContext *s, int pitch, + const float *in, float *out, int size) +{ + int n; + float optimal_gain = 0, dot; + const float *ptr = &in[-FFMAX(s->min_pitch_val, pitch - 3)], + *end = &in[-FFMIN(s->max_pitch_val, pitch + 3)], + *best_hist_ptr; + + /* find best fitting point in history */ + do { + dot = ff_dot_productf(in, ptr, size); + if (dot > optimal_gain) { + optimal_gain = dot; + best_hist_ptr = ptr; + } + } while (--ptr >= end); + + if (optimal_gain <= 0) + return -1; + dot = ff_dot_productf(best_hist_ptr, best_hist_ptr, size); + if (dot <= 0) // would be 1.0 + return -1; + + if (optimal_gain <= dot) { + dot = dot / (dot + 0.6 * optimal_gain); // 0.625-1.000 + } else + dot = 0.625; + + /* actual smoothing */ + for (n = 0; n < size; n++) + out[n] = best_hist_ptr[n] + dot * (in[n] - best_hist_ptr[n]); + + return 0; +} + +/** + * Get the tilt factor of a formant filter from its transfer function + * @see #tilt_factor() in amrnbdec.c, which does essentially the same, + * but somehow (??) it does a speech synthesis filter in the + * middle, which is missing here + * + * @param lpcs LPC coefficients + * @param n_lpcs Size of LPC buffer + * @returns the tilt factor + */ +static float tilt_factor(const float *lpcs, int n_lpcs) +{ + float rh0, rh1; + + rh0 = 1.0 + ff_dot_productf(lpcs, lpcs, n_lpcs); + rh1 = lpcs[0] + ff_dot_productf(lpcs, &lpcs[1], n_lpcs - 1); + + return rh1 / rh0; +} + +/** + * Derive denoise filter coefficients (in real domain) from the LPCs. + */ +static void calc_input_response(WMAVoiceContext *s, float *lpcs, + int fcb_type, float *coeffs, int remainder) +{ + float last_coeff, min = 15.0, max = -15.0; + float irange, angle_mul, gain_mul, range, sq; + int n, idx; + + /* Create frequency power spectrum of speech input (i.e. RDFT of LPCs) */ + ff_rdft_calc(&s->rdft, lpcs); +#define log_range(var, assign) do { \ + float tmp = log10f(assign); var = tmp; \ + max = FFMAX(max, tmp); min = FFMIN(min, tmp); \ + } while (0) + log_range(last_coeff, lpcs[1] * lpcs[1]); + for (n = 1; n < 64; n++) + log_range(lpcs[n], lpcs[n * 2] * lpcs[n * 2] + + lpcs[n * 2 + 1] * lpcs[n * 2 + 1]); + log_range(lpcs[0], lpcs[0] * lpcs[0]); +#undef log_range + range = max - min; + lpcs[64] = last_coeff; + + /* Now, use this spectrum to pick out these frequencies with higher + * (relative) power/energy (which we then take to be "not noise"), + * and set up a table (still in lpc[]) of (relative) gains per frequency. + * These frequencies will be maintained, while others ("noise") will be + * decreased in the filter output. */ + irange = 64.0 / range; // so irange*(max-value) is in the range [0, 63] + gain_mul = range * (fcb_type == FCB_TYPE_HARDCODED ? (5.0 / 13.0) : + (5.0 / 14.7)); + angle_mul = gain_mul * (8.0 * M_LN10 / M_PI); + for (n = 0; n <= 64; n++) { + float pwr; + + idx = FFMAX(0, lrint((max - lpcs[n]) * irange) - 1); + pwr = wmavoice_denoise_power_table[s->denoise_strength][idx]; + lpcs[n] = angle_mul * pwr; + + /* 70.57 =~ 1/log10(1.0331663) */ + idx = (pwr * gain_mul - 0.0295) * 70.570526123; + if (idx > 127) { // fallback if index falls outside table range + coeffs[n] = wmavoice_energy_table[127] * + powf(1.0331663, idx - 127); + } else + coeffs[n] = wmavoice_energy_table[FFMAX(0, idx)]; + } + + /* calculate the Hilbert transform of the gains, which we do (since this + * is a sinus input) by doing a phase shift (in theory, H(sin())=cos()). + * Hilbert_Transform(RDFT(x)) = Laplace_Transform(x), which calculates the + * "moment" of the LPCs in this filter. */ + ff_dct_calc(&s->dct, lpcs); + ff_dct_calc(&s->dst, lpcs); + + /* Split out the coefficient indexes into phase/magnitude pairs */ + idx = 255 + av_clip(lpcs[64], -255, 255); + coeffs[0] = coeffs[0] * s->cos[idx]; + idx = 255 + av_clip(lpcs[64] - 2 * lpcs[63], -255, 255); + last_coeff = coeffs[64] * s->cos[idx]; + for (n = 63;; n--) { + idx = 255 + av_clip(-lpcs[64] - 2 * lpcs[n - 1], -255, 255); + coeffs[n * 2 + 1] = coeffs[n] * s->sin[idx]; + coeffs[n * 2] = coeffs[n] * s->cos[idx]; + + if (!--n) break; + + idx = 255 + av_clip( lpcs[64] - 2 * lpcs[n - 1], -255, 255); + coeffs[n * 2 + 1] = coeffs[n] * s->sin[idx]; + coeffs[n * 2] = coeffs[n] * s->cos[idx]; + } + coeffs[1] = last_coeff; + + /* move into real domain */ + ff_rdft_calc(&s->irdft, coeffs); + + /* tilt correction and normalize scale */ + memset(&coeffs[remainder], 0, sizeof(coeffs[0]) * (128 - remainder)); + if (s->denoise_tilt_corr) { + float tilt_mem = 0; + + coeffs[remainder - 1] = 0; + ff_tilt_compensation(&tilt_mem, + -1.8 * tilt_factor(coeffs, remainder - 1), + coeffs, remainder); + } + sq = (1.0 / 64.0) * sqrtf(1 / ff_dot_productf(coeffs, coeffs, remainder)); + for (n = 0; n < remainder; n++) + coeffs[n] *= sq; +} + +/** + * This function applies a Wiener filter on the (noisy) speech signal as + * a means to denoise it. + * + * - take RDFT of LPCs to get the power spectrum of the noise + speech; + * - using this power spectrum, calculate (for each frequency) the Wiener + * filter gain, which depends on the frequency power and desired level + * of noise subtraction (when set too high, this leads to artifacts) + * We can do this symmetrically over the X-axis (so 0-4kHz is the inverse + * of 4-8kHz); + * - by doing a phase shift, calculate the Hilbert transform of this array + * of per-frequency filter-gains to get the filtering coefficients; + * - smoothen/normalize/de-tilt these filter coefficients as desired; + * - take RDFT of noisy sound, apply the coefficients and take its IRDFT + * to get the denoised speech signal; + * - the leftover (i.e. output of the IRDFT on denoised speech data beyond + * the frame boundary) are saved and applied to subsequent frames by an + * overlap-add method (otherwise you get clicking-artifacts). + * + * @param s WMA Voice decoding context + * @param fcb_type Frame (codebook) type + * @param synth_pf input: the noisy speech signal, output: denoised speech + * data; should be 16-byte aligned (for ASM purposes) + * @param size size of the speech data + * @param lpcs LPCs used to synthesize this frame's speech data + */ +static void wiener_denoise(WMAVoiceContext *s, int fcb_type, + float *synth_pf, int size, + const float *lpcs) +{ + int remainder, lim, n; + + if (fcb_type != FCB_TYPE_SILENCE) { + float *tilted_lpcs = s->tilted_lpcs_pf, + *coeffs = s->denoise_coeffs_pf, tilt_mem = 0; + + tilted_lpcs[0] = 1.0; + memcpy(&tilted_lpcs[1], lpcs, sizeof(lpcs[0]) * s->lsps); + memset(&tilted_lpcs[s->lsps + 1], 0, + sizeof(tilted_lpcs[0]) * (128 - s->lsps - 1)); + ff_tilt_compensation(&tilt_mem, 0.7 * tilt_factor(lpcs, s->lsps), + tilted_lpcs, s->lsps + 2); + + /* The IRDFT output (127 samples for 7-bit filter) beyond the frame + * size is applied to the next frame. All input beyond this is zero, + * and thus all output beyond this will go towards zero, hence we can + * limit to min(size-1, 127-size) as a performance consideration. */ + remainder = FFMIN(127 - size, size - 1); + calc_input_response(s, tilted_lpcs, fcb_type, coeffs, remainder); + + /* apply coefficients (in frequency spectrum domain), i.e. complex + * number multiplication */ + memset(&synth_pf[size], 0, sizeof(synth_pf[0]) * (128 - size)); + ff_rdft_calc(&s->rdft, synth_pf); + ff_rdft_calc(&s->rdft, coeffs); + synth_pf[0] *= coeffs[0]; + synth_pf[1] *= coeffs[1]; + for (n = 1; n < 64; n++) { + float v1 = synth_pf[n * 2], v2 = synth_pf[n * 2 + 1]; + synth_pf[n * 2] = v1 * coeffs[n * 2] - v2 * coeffs[n * 2 + 1]; + synth_pf[n * 2 + 1] = v2 * coeffs[n * 2] + v1 * coeffs[n * 2 + 1]; + } + ff_rdft_calc(&s->irdft, synth_pf); + } + + /* merge filter output with the history of previous runs */ + if (s->denoise_filter_cache_size) { + lim = FFMIN(s->denoise_filter_cache_size, size); + for (n = 0; n < lim; n++) + synth_pf[n] += s->denoise_filter_cache[n]; + s->denoise_filter_cache_size -= lim; + memmove(s->denoise_filter_cache, &s->denoise_filter_cache[size], + sizeof(s->denoise_filter_cache[0]) * s->denoise_filter_cache_size); + } + + /* move remainder of filter output into a cache for future runs */ + if (fcb_type != FCB_TYPE_SILENCE) { + lim = FFMIN(remainder, s->denoise_filter_cache_size); + for (n = 0; n < lim; n++) + s->denoise_filter_cache[n] += synth_pf[size + n]; + if (lim < remainder) { + memcpy(&s->denoise_filter_cache[lim], &synth_pf[size + lim], + sizeof(s->denoise_filter_cache[0]) * (remainder - lim)); + s->denoise_filter_cache_size = remainder; + } + } +} + +/** + * Averaging projection filter, the postfilter used in WMAVoice. + * + * This uses the following steps: + * - A zero-synthesis filter (generate excitation from synth signal) + * - Kalman smoothing on excitation, based on pitch + * - Re-synthesized smoothened output + * - Iterative Wiener denoise filter + * - Adaptive gain filter + * - DC filter + * + * @param s WMAVoice decoding context + * @param synth Speech synthesis output (before postfilter) + * @param samples Output buffer for filtered samples + * @param size Buffer size of synth & samples + * @param lpcs Generated LPCs used for speech synthesis + * @param zero_exc_pf destination for zero synthesis filter (16-byte aligned) + * @param fcb_type Frame type (silence, hardcoded, AW-pulses or FCB-pulses) + * @param pitch Pitch of the input signal + */ +static void postfilter(WMAVoiceContext *s, const float *synth, + float *samples, int size, + const float *lpcs, float *zero_exc_pf, + int fcb_type, int pitch) +{ + float synth_filter_in_buf[MAX_FRAMESIZE / 2], + *synth_pf = &s->synth_filter_out_buf[MAX_LSPS_ALIGN16], + *synth_filter_in = zero_exc_pf; + + assert(size <= MAX_FRAMESIZE / 2); + + /* generate excitation from input signal */ + ff_celp_lp_zero_synthesis_filterf(zero_exc_pf, lpcs, synth, size, s->lsps); + + if (fcb_type >= FCB_TYPE_AW_PULSES && + !kalman_smoothen(s, pitch, zero_exc_pf, synth_filter_in_buf, size)) + synth_filter_in = synth_filter_in_buf; + + /* re-synthesize speech after smoothening, and keep history */ + ff_celp_lp_synthesis_filterf(synth_pf, lpcs, + synth_filter_in, size, s->lsps); + memcpy(&synth_pf[-s->lsps], &synth_pf[size - s->lsps], + sizeof(synth_pf[0]) * s->lsps); + + wiener_denoise(s, fcb_type, synth_pf, size, lpcs); + + adaptive_gain_control(samples, synth_pf, synth, size, 0.99, + &s->postfilter_agc); + + if (s->dc_level > 8) { + /* remove ultra-low frequency DC noise / highpass filter; + * coefficients are identical to those used in SIPR decoding, + * and very closely resemble those used in AMR-NB decoding. */ + ff_acelp_apply_order_2_transfer_function(samples, samples, + (const float[2]) { -1.99997, 1.0 }, + (const float[2]) { -1.9330735188, 0.93589198496 }, + 0.93980580475, s->dcf_mem, size); + } +} +/** + * @} + */ + +/** + * Dequantize LSPs + * @param lsps output pointer to the array that will hold the LSPs + * @param num number of LSPs to be dequantized + * @param values quantized values, contains n_stages values + * @param sizes range (i.e. max value) of each quantized value + * @param n_stages number of dequantization runs + * @param table dequantization table to be used + * @param mul_q LSF multiplier + * @param base_q base (lowest) LSF values + */ +static void dequant_lsps(double *lsps, int num, + const uint16_t *values, + const uint16_t *sizes, + int n_stages, const uint8_t *table, + const double *mul_q, + const double *base_q) +{ + int n, m; + + memset(lsps, 0, num * sizeof(*lsps)); + for (n = 0; n < n_stages; n++) { + const uint8_t *t_off = &table[values[n] * num]; + double base = base_q[n], mul = mul_q[n]; + + for (m = 0; m < num; m++) + lsps[m] += base + mul * t_off[m]; + + table += sizes[n] * num; + } +} + +/** + * @defgroup lsp_dequant LSP dequantization routines + * LSP dequantization routines, for 10/16LSPs and independent/residual coding. + * @note we assume enough bits are available, caller should check. + * lsp10i() consumes 24 bits; lsp10r() consumes an additional 24 bits; + * lsp16i() consumes 34 bits; lsp16r() consumes an additional 26 bits. + * @{ + */ +/** + * Parse 10 independently-coded LSPs. + */ +static void dequant_lsp10i(GetBitContext *gb, double *lsps) +{ + static const uint16_t vec_sizes[4] = { 256, 64, 32, 32 }; + static const double mul_lsf[4] = { + 5.2187144800e-3, 1.4626986422e-3, + 9.6179549166e-4, 1.1325736225e-3 + }; + static const double base_lsf[4] = { + M_PI * -2.15522e-1, M_PI * -6.1646e-2, + M_PI * -3.3486e-2, M_PI * -5.7408e-2 + }; + uint16_t v[4]; + + v[0] = get_bits(gb, 8); + v[1] = get_bits(gb, 6); + v[2] = get_bits(gb, 5); + v[3] = get_bits(gb, 5); + + dequant_lsps(lsps, 10, v, vec_sizes, 4, wmavoice_dq_lsp10i, + mul_lsf, base_lsf); +} + +/** + * Parse 10 independently-coded LSPs, and then derive the tables to + * generate LSPs for the other frames from them (residual coding). + */ +static void dequant_lsp10r(GetBitContext *gb, + double *i_lsps, const double *old, + double *a1, double *a2, int q_mode) +{ + static const uint16_t vec_sizes[3] = { 128, 64, 64 }; + static const double mul_lsf[3] = { + 2.5807601174e-3, 1.2354460219e-3, 1.1763821673e-3 + }; + static const double base_lsf[3] = { + M_PI * -1.07448e-1, M_PI * -5.2706e-2, M_PI * -5.1634e-2 + }; + const float (*ipol_tab)[2][10] = q_mode ? + wmavoice_lsp10_intercoeff_b : wmavoice_lsp10_intercoeff_a; + uint16_t interpol, v[3]; + int n; + + dequant_lsp10i(gb, i_lsps); + + interpol = get_bits(gb, 5); + v[0] = get_bits(gb, 7); + v[1] = get_bits(gb, 6); + v[2] = get_bits(gb, 6); + + for (n = 0; n < 10; n++) { + double delta = old[n] - i_lsps[n]; + a1[n] = ipol_tab[interpol][0][n] * delta + i_lsps[n]; + a1[10 + n] = ipol_tab[interpol][1][n] * delta + i_lsps[n]; + } + + dequant_lsps(a2, 20, v, vec_sizes, 3, wmavoice_dq_lsp10r, + mul_lsf, base_lsf); +} + +/** + * Parse 16 independently-coded LSPs. + */ +static void dequant_lsp16i(GetBitContext *gb, double *lsps) +{ + static const uint16_t vec_sizes[5] = { 256, 64, 128, 64, 128 }; + static const double mul_lsf[5] = { + 3.3439586280e-3, 6.9908173703e-4, + 3.3216608306e-3, 1.0334960326e-3, + 3.1899104283e-3 + }; + static const double base_lsf[5] = { + M_PI * -1.27576e-1, M_PI * -2.4292e-2, + M_PI * -1.28094e-1, M_PI * -3.2128e-2, + M_PI * -1.29816e-1 + }; + uint16_t v[5]; + + v[0] = get_bits(gb, 8); + v[1] = get_bits(gb, 6); + v[2] = get_bits(gb, 7); + v[3] = get_bits(gb, 6); + v[4] = get_bits(gb, 7); + + dequant_lsps( lsps, 5, v, vec_sizes, 2, + wmavoice_dq_lsp16i1, mul_lsf, base_lsf); + dequant_lsps(&lsps[5], 5, &v[2], &vec_sizes[2], 2, + wmavoice_dq_lsp16i2, &mul_lsf[2], &base_lsf[2]); + dequant_lsps(&lsps[10], 6, &v[4], &vec_sizes[4], 1, + wmavoice_dq_lsp16i3, &mul_lsf[4], &base_lsf[4]); +} + +/** + * Parse 16 independently-coded LSPs, and then derive the tables to + * generate LSPs for the other frames from them (residual coding). + */ +static void dequant_lsp16r(GetBitContext *gb, + double *i_lsps, const double *old, + double *a1, double *a2, int q_mode) +{ + static const uint16_t vec_sizes[3] = { 128, 128, 128 }; + static const double mul_lsf[3] = { + 1.2232979501e-3, 1.4062241527e-3, 1.6114744851e-3 + }; + static const double base_lsf[3] = { + M_PI * -5.5830e-2, M_PI * -5.2908e-2, M_PI * -5.4776e-2 + }; + const float (*ipol_tab)[2][16] = q_mode ? + wmavoice_lsp16_intercoeff_b : wmavoice_lsp16_intercoeff_a; + uint16_t interpol, v[3]; + int n; + + dequant_lsp16i(gb, i_lsps); + + interpol = get_bits(gb, 5); + v[0] = get_bits(gb, 7); + v[1] = get_bits(gb, 7); + v[2] = get_bits(gb, 7); + + for (n = 0; n < 16; n++) { + double delta = old[n] - i_lsps[n]; + a1[n] = ipol_tab[interpol][0][n] * delta + i_lsps[n]; + a1[16 + n] = ipol_tab[interpol][1][n] * delta + i_lsps[n]; + } + + dequant_lsps( a2, 10, v, vec_sizes, 1, + wmavoice_dq_lsp16r1, mul_lsf, base_lsf); + dequant_lsps(&a2[10], 10, &v[1], &vec_sizes[1], 1, + wmavoice_dq_lsp16r2, &mul_lsf[1], &base_lsf[1]); + dequant_lsps(&a2[20], 12, &v[2], &vec_sizes[2], 1, + wmavoice_dq_lsp16r3, &mul_lsf[2], &base_lsf[2]); +} + +/** + * @} + * @defgroup aw Pitch-adaptive window coding functions + * The next few functions are for pitch-adaptive window coding. + * @{ + */ +/** + * Parse the offset of the first pitch-adaptive window pulses, and + * the distribution of pulses between the two blocks in this frame. + * @param s WMA Voice decoding context private data + * @param gb bit I/O context + * @param pitch pitch for each block in this frame + */ +static void aw_parse_coords(WMAVoiceContext *s, GetBitContext *gb, + const int *pitch) +{ + static const int16_t start_offset[94] = { + -11, -9, -7, -5, -3, -1, 1, 3, 5, 7, 9, 11, + 13, 15, 18, 17, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 35, 37, 39, 41, 43, + 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, + 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, + 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, + 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, + 141, 143, 145, 147, 149, 151, 153, 155, 157, 159 + }; + int bits, offset; + + /* position of pulse */ + s->aw_idx_is_ext = 0; + if ((bits = get_bits(gb, 6)) >= 54) { + s->aw_idx_is_ext = 1; + bits += (bits - 54) * 3 + get_bits(gb, 2); + } + + /* for a repeated pulse at pulse_off with a pitch_lag of pitch[], count + * the distribution of the pulses in each block contained in this frame. */ + s->aw_pulse_range = FFMIN(pitch[0], pitch[1]) > 32 ? 24 : 16; + for (offset = start_offset[bits]; offset < 0; offset += pitch[0]) ; + s->aw_n_pulses[0] = (pitch[0] - 1 + MAX_FRAMESIZE / 2 - offset) / pitch[0]; + s->aw_first_pulse_off[0] = offset - s->aw_pulse_range / 2; + offset += s->aw_n_pulses[0] * pitch[0]; + s->aw_n_pulses[1] = (pitch[1] - 1 + MAX_FRAMESIZE - offset) / pitch[1]; + s->aw_first_pulse_off[1] = offset - (MAX_FRAMESIZE + s->aw_pulse_range) / 2; + + /* if continuing from a position before the block, reset position to + * start of block (when corrected for the range over which it can be + * spread in aw_pulse_set1()). */ + if (start_offset[bits] < MAX_FRAMESIZE / 2) { + while (s->aw_first_pulse_off[1] - pitch[1] + s->aw_pulse_range > 0) + s->aw_first_pulse_off[1] -= pitch[1]; + if (start_offset[bits] < 0) + while (s->aw_first_pulse_off[0] - pitch[0] + s->aw_pulse_range > 0) + s->aw_first_pulse_off[0] -= pitch[0]; + } +} + +/** + * Apply second set of pitch-adaptive window pulses. + * @param s WMA Voice decoding context private data + * @param gb bit I/O context + * @param block_idx block index in frame [0, 1] + * @param fcb structure containing fixed codebook vector info + */ +static void aw_pulse_set2(WMAVoiceContext *s, GetBitContext *gb, + int block_idx, AMRFixed *fcb) +{ + uint16_t use_mask_mem[9]; // only 5 are used, rest is padding + uint16_t *use_mask = use_mask_mem + 2; + /* in this function, idx is the index in the 80-bit (+ padding) use_mask + * bit-array. Since use_mask consists of 16-bit values, the lower 4 bits + * of idx are the position of the bit within a particular item in the + * array (0 being the most significant bit, and 15 being the least + * significant bit), and the remainder (>> 4) is the index in the + * use_mask[]-array. This is faster and uses less memory than using a + * 80-byte/80-int array. */ + int pulse_off = s->aw_first_pulse_off[block_idx], + pulse_start, n, idx, range, aidx, start_off = 0; + + /* set offset of first pulse to within this block */ + if (s->aw_n_pulses[block_idx] > 0) + while (pulse_off + s->aw_pulse_range < 1) + pulse_off += fcb->pitch_lag; + + /* find range per pulse */ + if (s->aw_n_pulses[0] > 0) { + if (block_idx == 0) { + range = 32; + } else /* block_idx = 1 */ { + range = 8; + if (s->aw_n_pulses[block_idx] > 0) + pulse_off = s->aw_next_pulse_off_cache; + } + } else + range = 16; + pulse_start = s->aw_n_pulses[block_idx] > 0 ? pulse_off - range / 2 : 0; + + /* aw_pulse_set1() already applies pulses around pulse_off (to be exactly, + * in the range of [pulse_off, pulse_off + s->aw_pulse_range], and thus + * we exclude that range from being pulsed again in this function. */ + memset(&use_mask[-2], 0, 2 * sizeof(use_mask[0])); + memset( use_mask, -1, 5 * sizeof(use_mask[0])); + memset(&use_mask[5], 0, 2 * sizeof(use_mask[0])); + if (s->aw_n_pulses[block_idx] > 0) + for (idx = pulse_off; idx < MAX_FRAMESIZE / 2; idx += fcb->pitch_lag) { + int excl_range = s->aw_pulse_range; // always 16 or 24 + uint16_t *use_mask_ptr = &use_mask[idx >> 4]; + int first_sh = 16 - (idx & 15); + *use_mask_ptr++ &= 0xFFFF << first_sh; + excl_range -= first_sh; + if (excl_range >= 16) { + *use_mask_ptr++ = 0; + *use_mask_ptr &= 0xFFFF >> (excl_range - 16); + } else + *use_mask_ptr &= 0xFFFF >> excl_range; + } + + /* find the 'aidx'th offset that is not excluded */ + aidx = get_bits(gb, s->aw_n_pulses[0] > 0 ? 5 - 2 * block_idx : 4); + for (n = 0; n <= aidx; pulse_start++) { + for (idx = pulse_start; idx < 0; idx += fcb->pitch_lag) ; + if (idx >= MAX_FRAMESIZE / 2) { // find from zero + if (use_mask[0]) idx = 0x0F; + else if (use_mask[1]) idx = 0x1F; + else if (use_mask[2]) idx = 0x2F; + else if (use_mask[3]) idx = 0x3F; + else if (use_mask[4]) idx = 0x4F; + else return; + idx -= av_log2_16bit(use_mask[idx >> 4]); + } + if (use_mask[idx >> 4] & (0x8000 >> (idx & 15))) { + use_mask[idx >> 4] &= ~(0x8000 >> (idx & 15)); + n++; + start_off = idx; + } + } + + fcb->x[fcb->n] = start_off; + fcb->y[fcb->n] = get_bits1(gb) ? -1.0 : 1.0; + fcb->n++; + + /* set offset for next block, relative to start of that block */ + n = (MAX_FRAMESIZE / 2 - start_off) % fcb->pitch_lag; + s->aw_next_pulse_off_cache = n ? fcb->pitch_lag - n : 0; +} + +/** + * Apply first set of pitch-adaptive window pulses. + * @param s WMA Voice decoding context private data + * @param gb bit I/O context + * @param block_idx block index in frame [0, 1] + * @param fcb storage location for fixed codebook pulse info + */ +static void aw_pulse_set1(WMAVoiceContext *s, GetBitContext *gb, + int block_idx, AMRFixed *fcb) +{ + int val = get_bits(gb, 12 - 2 * (s->aw_idx_is_ext && !block_idx)); + float v; + + if (s->aw_n_pulses[block_idx] > 0) { + int n, v_mask, i_mask, sh, n_pulses; + + if (s->aw_pulse_range == 24) { // 3 pulses, 1:sign + 3:index each + n_pulses = 3; + v_mask = 8; + i_mask = 7; + sh = 4; + } else { // 4 pulses, 1:sign + 2:index each + n_pulses = 4; + v_mask = 4; + i_mask = 3; + sh = 3; + } + + for (n = n_pulses - 1; n >= 0; n--, val >>= sh) { + fcb->y[fcb->n] = (val & v_mask) ? -1.0 : 1.0; + fcb->x[fcb->n] = (val & i_mask) * n_pulses + n + + s->aw_first_pulse_off[block_idx]; + while (fcb->x[fcb->n] < 0) + fcb->x[fcb->n] += fcb->pitch_lag; + if (fcb->x[fcb->n] < MAX_FRAMESIZE / 2) + fcb->n++; + } + } else { + int num2 = (val & 0x1FF) >> 1, delta, idx; + + if (num2 < 1 * 79) { delta = 1; idx = num2 + 1; } + else if (num2 < 2 * 78) { delta = 3; idx = num2 + 1 - 1 * 77; } + else if (num2 < 3 * 77) { delta = 5; idx = num2 + 1 - 2 * 76; } + else { delta = 7; idx = num2 + 1 - 3 * 75; } + v = (val & 0x200) ? -1.0 : 1.0; + + fcb->no_repeat_mask |= 3 << fcb->n; + fcb->x[fcb->n] = idx - delta; + fcb->y[fcb->n] = v; + fcb->x[fcb->n + 1] = idx; + fcb->y[fcb->n + 1] = (val & 1) ? -v : v; + fcb->n += 2; + } +} + +/** + * @} + * + * Generate a random number from frame_cntr and block_idx, which will lief + * in the range [0, 1000 - block_size] (so it can be used as an index in a + * table of size 1000 of which you want to read block_size entries). + * + * @param frame_cntr current frame number + * @param block_num current block index + * @param block_size amount of entries we want to read from a table + * that has 1000 entries + * @return a (non-)random number in the [0, 1000 - block_size] range. + */ +static int pRNG(int frame_cntr, int block_num, int block_size) +{ + /* array to simplify the calculation of z: + * y = (x % 9) * 5 + 6; + * z = (49995 * x) / y; + * Since y only has 9 values, we can remove the division by using a + * LUT and using FASTDIV-style divisions. For each of the 9 values + * of y, we can rewrite z as: + * z = x * (49995 / y) + x * ((49995 % y) / y) + * In this table, each col represents one possible value of y, the + * first number is 49995 / y, and the second is the FASTDIV variant + * of 49995 % y / y. */ + static const unsigned int div_tbl[9][2] = { + { 8332, 3 * 715827883U }, // y = 6 + { 4545, 0 * 390451573U }, // y = 11 + { 3124, 11 * 268435456U }, // y = 16 + { 2380, 15 * 204522253U }, // y = 21 + { 1922, 23 * 165191050U }, // y = 26 + { 1612, 23 * 138547333U }, // y = 31 + { 1388, 27 * 119304648U }, // y = 36 + { 1219, 16 * 104755300U }, // y = 41 + { 1086, 39 * 93368855U } // y = 46 + }; + unsigned int z, y, x = MUL16(block_num, 1877) + frame_cntr; + if (x >= 0xFFFF) x -= 0xFFFF; // max value of x is 8*1877+0xFFFE=0x13AA6, + // so this is effectively a modulo (%) + y = x - 9 * MULH(477218589, x); // x % 9 + z = (uint16_t) (x * div_tbl[y][0] + UMULH(x, div_tbl[y][1])); + // z = x * 49995 / (y * 5 + 6) + return z % (1000 - block_size); +} + +/** + * Parse hardcoded signal for a single block. + * @note see #synth_block(). + */ +static void synth_block_hardcoded(WMAVoiceContext *s, GetBitContext *gb, + int block_idx, int size, + const struct frame_type_desc *frame_desc, + float *excitation) +{ + float gain; + int n, r_idx; + + assert(size <= MAX_FRAMESIZE); + + /* Set the offset from which we start reading wmavoice_std_codebook */ + if (frame_desc->fcb_type == FCB_TYPE_SILENCE) { + r_idx = pRNG(s->frame_cntr, block_idx, size); + gain = s->silence_gain; + } else /* FCB_TYPE_HARDCODED */ { + r_idx = get_bits(gb, 8); + gain = wmavoice_gain_universal[get_bits(gb, 6)]; + } + + /* Clear gain prediction parameters */ + memset(s->gain_pred_err, 0, sizeof(s->gain_pred_err)); + + /* Apply gain to hardcoded codebook and use that as excitation signal */ + for (n = 0; n < size; n++) + excitation[n] = wmavoice_std_codebook[r_idx + n] * gain; +} + +/** + * Parse FCB/ACB signal for a single block. + * @note see #synth_block(). + */ +static void synth_block_fcb_acb(WMAVoiceContext *s, GetBitContext *gb, + int block_idx, int size, + int block_pitch_sh2, + const struct frame_type_desc *frame_desc, + float *excitation) +{ + static const float gain_coeff[6] = { + 0.8169, -0.06545, 0.1726, 0.0185, -0.0359, 0.0458 + }; + float pulses[MAX_FRAMESIZE / 2], pred_err, acb_gain, fcb_gain; + int n, idx, gain_weight; + AMRFixed fcb; + + assert(size <= MAX_FRAMESIZE / 2); + memset(pulses, 0, sizeof(*pulses) * size); + + fcb.pitch_lag = block_pitch_sh2 >> 2; + fcb.pitch_fac = 1.0; + fcb.no_repeat_mask = 0; + fcb.n = 0; + + /* For the other frame types, this is where we apply the innovation + * (fixed) codebook pulses of the speech signal. */ + if (frame_desc->fcb_type == FCB_TYPE_AW_PULSES) { + aw_pulse_set1(s, gb, block_idx, &fcb); + aw_pulse_set2(s, gb, block_idx, &fcb); + } else /* FCB_TYPE_EXC_PULSES */ { + int offset_nbits = 5 - frame_desc->log_n_blocks; + + fcb.no_repeat_mask = -1; + /* similar to ff_decode_10_pulses_35bits(), but with single pulses + * (instead of double) for a subset of pulses */ + for (n = 0; n < 5; n++) { + float sign; + int pos1, pos2; + + sign = get_bits1(gb) ? 1.0 : -1.0; + pos1 = get_bits(gb, offset_nbits); + fcb.x[fcb.n] = n + 5 * pos1; + fcb.y[fcb.n++] = sign; + if (n < frame_desc->dbl_pulses) { + pos2 = get_bits(gb, offset_nbits); + fcb.x[fcb.n] = n + 5 * pos2; + fcb.y[fcb.n++] = (pos1 < pos2) ? -sign : sign; + } + } + } + ff_set_fixed_vector(pulses, &fcb, 1.0, size); + + /* Calculate gain for adaptive & fixed codebook signal. + * see ff_amr_set_fixed_gain(). */ + idx = get_bits(gb, 7); + fcb_gain = expf(ff_dot_productf(s->gain_pred_err, gain_coeff, 6) - + 5.2409161640 + wmavoice_gain_codebook_fcb[idx]); + acb_gain = wmavoice_gain_codebook_acb[idx]; + pred_err = av_clipf(wmavoice_gain_codebook_fcb[idx], + -2.9957322736 /* log(0.05) */, + 1.6094379124 /* log(5.0) */); + + gain_weight = 8 >> frame_desc->log_n_blocks; + memmove(&s->gain_pred_err[gain_weight], s->gain_pred_err, + sizeof(*s->gain_pred_err) * (6 - gain_weight)); + for (n = 0; n < gain_weight; n++) + s->gain_pred_err[n] = pred_err; + + /* Calculation of adaptive codebook */ + if (frame_desc->acb_type == ACB_TYPE_ASYMMETRIC) { + int len; + for (n = 0; n < size; n += len) { + int next_idx_sh16; + int abs_idx = block_idx * size + n; + int pitch_sh16 = (s->last_pitch_val << 16) + + s->pitch_diff_sh16 * abs_idx; + int pitch = (pitch_sh16 + 0x6FFF) >> 16; + int idx_sh16 = ((pitch << 16) - pitch_sh16) * 8 + 0x58000; + idx = idx_sh16 >> 16; + if (s->pitch_diff_sh16) { + if (s->pitch_diff_sh16 > 0) { + next_idx_sh16 = (idx_sh16) &~ 0xFFFF; + } else + next_idx_sh16 = (idx_sh16 + 0x10000) &~ 0xFFFF; + len = av_clip((idx_sh16 - next_idx_sh16) / s->pitch_diff_sh16 / 8, + 1, size - n); + } else + len = size; + + ff_acelp_interpolatef(&excitation[n], &excitation[n - pitch], + wmavoice_ipol1_coeffs, 17, + idx, 9, len); + } + } else /* ACB_TYPE_HAMMING */ { + int block_pitch = block_pitch_sh2 >> 2; + idx = block_pitch_sh2 & 3; + if (idx) { + ff_acelp_interpolatef(excitation, &excitation[-block_pitch], + wmavoice_ipol2_coeffs, 4, + idx, 8, size); + } else + av_memcpy_backptr((uint8_t *) excitation, sizeof(float) * block_pitch, + sizeof(float) * size); + } + + /* Interpolate ACB/FCB and use as excitation signal */ + ff_weighted_vector_sumf(excitation, excitation, pulses, + acb_gain, fcb_gain, size); +} + +/** + * Parse data in a single block. + * @note we assume enough bits are available, caller should check. + * + * @param s WMA Voice decoding context private data + * @param gb bit I/O context + * @param block_idx index of the to-be-read block + * @param size amount of samples to be read in this block + * @param block_pitch_sh2 pitch for this block << 2 + * @param lsps LSPs for (the end of) this frame + * @param prev_lsps LSPs for the last frame + * @param frame_desc frame type descriptor + * @param excitation target memory for the ACB+FCB interpolated signal + * @param synth target memory for the speech synthesis filter output + * @return 0 on success, <0 on error. + */ +static void synth_block(WMAVoiceContext *s, GetBitContext *gb, + int block_idx, int size, + int block_pitch_sh2, + const double *lsps, const double *prev_lsps, + const struct frame_type_desc *frame_desc, + float *excitation, float *synth) +{ + double i_lsps[MAX_LSPS]; + float lpcs[MAX_LSPS]; + float fac; + int n; + + if (frame_desc->acb_type == ACB_TYPE_NONE) + synth_block_hardcoded(s, gb, block_idx, size, frame_desc, excitation); + else + synth_block_fcb_acb(s, gb, block_idx, size, block_pitch_sh2, + frame_desc, excitation); + + /* convert interpolated LSPs to LPCs */ + fac = (block_idx + 0.5) / frame_desc->n_blocks; + for (n = 0; n < s->lsps; n++) // LSF -> LSP + i_lsps[n] = cos(prev_lsps[n] + fac * (lsps[n] - prev_lsps[n])); + ff_acelp_lspd2lpc(i_lsps, lpcs, s->lsps >> 1); + + /* Speech synthesis */ + ff_celp_lp_synthesis_filterf(synth, lpcs, excitation, size, s->lsps); +} + +/** + * Synthesize output samples for a single frame. + * @note we assume enough bits are available, caller should check. + * + * @param ctx WMA Voice decoder context + * @param gb bit I/O context (s->gb or one for cross-packet superframes) + * @param frame_idx Frame number within superframe [0-2] + * @param samples pointer to output sample buffer, has space for at least 160 + * samples + * @param lsps LSP array + * @param prev_lsps array of previous frame's LSPs + * @param excitation target buffer for excitation signal + * @param synth target buffer for synthesized speech data + * @return 0 on success, <0 on error. + */ +static int synth_frame(AVCodecContext *ctx, GetBitContext *gb, int frame_idx, + float *samples, + const double *lsps, const double *prev_lsps, + float *excitation, float *synth) +{ + WMAVoiceContext *s = ctx->priv_data; + int n, n_blocks_x2, log_n_blocks_x2, cur_pitch_val; + int pitch[MAX_BLOCKS], last_block_pitch; + + /* Parse frame type ("frame header"), see frame_descs */ + int bd_idx = s->vbm_tree[get_vlc2(gb, frame_type_vlc.table, 6, 3)], + block_nsamples = MAX_FRAMESIZE / frame_descs[bd_idx].n_blocks; + + if (bd_idx < 0) { + av_log(ctx, AV_LOG_ERROR, + "Invalid frame type VLC code, skipping\n"); + return -1; + } + + /* Pitch calculation for ACB_TYPE_ASYMMETRIC ("pitch-per-frame") */ + if (frame_descs[bd_idx].acb_type == ACB_TYPE_ASYMMETRIC) { + /* Pitch is provided per frame, which is interpreted as the pitch of + * the last sample of the last block of this frame. We can interpolate + * the pitch of other blocks (and even pitch-per-sample) by gradually + * incrementing/decrementing prev_frame_pitch to cur_pitch_val. */ + n_blocks_x2 = frame_descs[bd_idx].n_blocks << 1; + log_n_blocks_x2 = frame_descs[bd_idx].log_n_blocks + 1; + cur_pitch_val = s->min_pitch_val + get_bits(gb, s->pitch_nbits); + cur_pitch_val = FFMIN(cur_pitch_val, s->max_pitch_val - 1); + if (s->last_acb_type == ACB_TYPE_NONE || + 20 * abs(cur_pitch_val - s->last_pitch_val) > + (cur_pitch_val + s->last_pitch_val)) + s->last_pitch_val = cur_pitch_val; + + /* pitch per block */ + for (n = 0; n < frame_descs[bd_idx].n_blocks; n++) { + int fac = n * 2 + 1; + + pitch[n] = (MUL16(fac, cur_pitch_val) + + MUL16((n_blocks_x2 - fac), s->last_pitch_val) + + frame_descs[bd_idx].n_blocks) >> log_n_blocks_x2; + } + + /* "pitch-diff-per-sample" for calculation of pitch per sample */ + s->pitch_diff_sh16 = + ((cur_pitch_val - s->last_pitch_val) << 16) / MAX_FRAMESIZE; + } + + /* Global gain (if silence) and pitch-adaptive window coordinates */ + switch (frame_descs[bd_idx].fcb_type) { + case FCB_TYPE_SILENCE: + s->silence_gain = wmavoice_gain_silence[get_bits(gb, 8)]; + break; + case FCB_TYPE_AW_PULSES: + aw_parse_coords(s, gb, pitch); + break; + } + + for (n = 0; n < frame_descs[bd_idx].n_blocks; n++) { + int bl_pitch_sh2; + + /* Pitch calculation for ACB_TYPE_HAMMING ("pitch-per-block") */ + switch (frame_descs[bd_idx].acb_type) { + case ACB_TYPE_HAMMING: { + /* Pitch is given per block. Per-block pitches are encoded as an + * absolute value for the first block, and then delta values + * relative to this value) for all subsequent blocks. The scale of + * this pitch value is semi-logaritmic compared to its use in the + * decoder, so we convert it to normal scale also. */ + int block_pitch, + t1 = (s->block_conv_table[1] - s->block_conv_table[0]) << 2, + t2 = (s->block_conv_table[2] - s->block_conv_table[1]) << 1, + t3 = s->block_conv_table[3] - s->block_conv_table[2] + 1; + + if (n == 0) { + block_pitch = get_bits(gb, s->block_pitch_nbits); + } else + block_pitch = last_block_pitch - s->block_delta_pitch_hrange + + get_bits(gb, s->block_delta_pitch_nbits); + /* Convert last_ so that any next delta is within _range */ + last_block_pitch = av_clip(block_pitch, + s->block_delta_pitch_hrange, + s->block_pitch_range - + s->block_delta_pitch_hrange); + + /* Convert semi-log-style scale back to normal scale */ + if (block_pitch < t1) { + bl_pitch_sh2 = (s->block_conv_table[0] << 2) + block_pitch; + } else { + block_pitch -= t1; + if (block_pitch < t2) { + bl_pitch_sh2 = + (s->block_conv_table[1] << 2) + (block_pitch << 1); + } else { + block_pitch -= t2; + if (block_pitch < t3) { + bl_pitch_sh2 = + (s->block_conv_table[2] + block_pitch) << 2; + } else + bl_pitch_sh2 = s->block_conv_table[3] << 2; + } + } + pitch[n] = bl_pitch_sh2 >> 2; + break; + } + + case ACB_TYPE_ASYMMETRIC: { + bl_pitch_sh2 = pitch[n] << 2; + break; + } + + default: // ACB_TYPE_NONE has no pitch + bl_pitch_sh2 = 0; + break; + } + + synth_block(s, gb, n, block_nsamples, bl_pitch_sh2, + lsps, prev_lsps, &frame_descs[bd_idx], + &excitation[n * block_nsamples], + &synth[n * block_nsamples]); + } + + /* Averaging projection filter, if applicable. Else, just copy samples + * from synthesis buffer */ + if (s->do_apf) { + double i_lsps[MAX_LSPS]; + float lpcs[MAX_LSPS]; + + for (n = 0; n < s->lsps; n++) // LSF -> LSP + i_lsps[n] = cos(0.5 * (prev_lsps[n] + lsps[n])); + ff_acelp_lspd2lpc(i_lsps, lpcs, s->lsps >> 1); + postfilter(s, synth, samples, 80, lpcs, + &s->zero_exc_pf[s->history_nsamples + MAX_FRAMESIZE * frame_idx], + frame_descs[bd_idx].fcb_type, pitch[0]); + + for (n = 0; n < s->lsps; n++) // LSF -> LSP + i_lsps[n] = cos(lsps[n]); + ff_acelp_lspd2lpc(i_lsps, lpcs, s->lsps >> 1); + postfilter(s, &synth[80], &samples[80], 80, lpcs, + &s->zero_exc_pf[s->history_nsamples + MAX_FRAMESIZE * frame_idx + 80], + frame_descs[bd_idx].fcb_type, pitch[0]); + } else + memcpy(samples, synth, 160 * sizeof(synth[0])); + + /* Cache values for next frame */ + s->frame_cntr++; + if (s->frame_cntr >= 0xFFFF) s->frame_cntr -= 0xFFFF; // i.e. modulo (%) + s->last_acb_type = frame_descs[bd_idx].acb_type; + switch (frame_descs[bd_idx].acb_type) { + case ACB_TYPE_NONE: + s->last_pitch_val = 0; + break; + case ACB_TYPE_ASYMMETRIC: + s->last_pitch_val = cur_pitch_val; + break; + case ACB_TYPE_HAMMING: + s->last_pitch_val = pitch[frame_descs[bd_idx].n_blocks - 1]; + break; + } + + return 0; +} + +/** + * Ensure minimum value for first item, maximum value for last value, + * proper spacing between each value and proper ordering. + * + * @param lsps array of LSPs + * @param num size of LSP array + * + * @note basically a double version of #ff_acelp_reorder_lsf(), might be + * useful to put in a generic location later on. Parts are also + * present in #ff_set_min_dist_lsf() + #ff_sort_nearly_sorted_floats(), + * which is in float. + */ +static void stabilize_lsps(double *lsps, int num) +{ + int n, m, l; + + /* set minimum value for first, maximum value for last and minimum + * spacing between LSF values. + * Very similar to ff_set_min_dist_lsf(), but in double. */ + lsps[0] = FFMAX(lsps[0], 0.0015 * M_PI); + for (n = 1; n < num; n++) + lsps[n] = FFMAX(lsps[n], lsps[n - 1] + 0.0125 * M_PI); + lsps[num - 1] = FFMIN(lsps[num - 1], 0.9985 * M_PI); + + /* reorder (looks like one-time / non-recursed bubblesort). + * Very similar to ff_sort_nearly_sorted_floats(), but in double. */ + for (n = 1; n < num; n++) { + if (lsps[n] < lsps[n - 1]) { + for (m = 1; m < num; m++) { + double tmp = lsps[m]; + for (l = m - 1; l >= 0; l--) { + if (lsps[l] <= tmp) break; + lsps[l + 1] = lsps[l]; + } + lsps[l + 1] = tmp; + } + break; + } + } +} + +/** + * Test if there's enough bits to read 1 superframe. + * + * @param orig_gb bit I/O context used for reading. This function + * does not modify the state of the bitreader; it + * only uses it to copy the current stream position + * @param s WMA Voice decoding context private data + * @return -1 if unsupported, 1 on not enough bits or 0 if OK. + */ +static int check_bits_for_superframe(GetBitContext *orig_gb, + WMAVoiceContext *s) +{ + GetBitContext s_gb, *gb = &s_gb; + int n, need_bits, bd_idx; + const struct frame_type_desc *frame_desc; + + /* initialize a copy */ + init_get_bits(gb, orig_gb->buffer, orig_gb->size_in_bits); + skip_bits_long(gb, get_bits_count(orig_gb)); + assert(get_bits_left(gb) == get_bits_left(orig_gb)); + + /* superframe header */ + if (get_bits_left(gb) < 14) + return 1; + if (!get_bits1(gb)) + return -1; // WMAPro-in-WMAVoice superframe + if (get_bits1(gb)) skip_bits(gb, 12); // number of samples in superframe + if (s->has_residual_lsps) { // residual LSPs (for all frames) + if (get_bits_left(gb) < s->sframe_lsp_bitsize) + return 1; + skip_bits_long(gb, s->sframe_lsp_bitsize); + } + + /* frames */ + for (n = 0; n < MAX_FRAMES; n++) { + int aw_idx_is_ext = 0; + + if (!s->has_residual_lsps) { // independent LSPs (per-frame) + if (get_bits_left(gb) < s->frame_lsp_bitsize) return 1; + skip_bits_long(gb, s->frame_lsp_bitsize); + } + bd_idx = s->vbm_tree[get_vlc2(gb, frame_type_vlc.table, 6, 3)]; + if (bd_idx < 0) + return -1; // invalid frame type VLC code + frame_desc = &frame_descs[bd_idx]; + if (frame_desc->acb_type == ACB_TYPE_ASYMMETRIC) { + if (get_bits_left(gb) < s->pitch_nbits) + return 1; + skip_bits_long(gb, s->pitch_nbits); + } + if (frame_desc->fcb_type == FCB_TYPE_SILENCE) { + skip_bits(gb, 8); + } else if (frame_desc->fcb_type == FCB_TYPE_AW_PULSES) { + int tmp = get_bits(gb, 6); + if (tmp >= 0x36) { + skip_bits(gb, 2); + aw_idx_is_ext = 1; + } + } + + /* blocks */ + if (frame_desc->acb_type == ACB_TYPE_HAMMING) { + need_bits = s->block_pitch_nbits + + (frame_desc->n_blocks - 1) * s->block_delta_pitch_nbits; + } else if (frame_desc->fcb_type == FCB_TYPE_AW_PULSES) { + need_bits = 2 * !aw_idx_is_ext; + } else + need_bits = 0; + need_bits += frame_desc->frame_size; + if (get_bits_left(gb) < need_bits) + return 1; + skip_bits_long(gb, need_bits); + } + + return 0; +} + +/** + * Synthesize output samples for a single superframe. If we have any data + * cached in s->sframe_cache, that will be used instead of whatever is loaded + * in s->gb. + * + * WMA Voice superframes contain 3 frames, each containing 160 audio samples, + * to give a total of 480 samples per frame. See #synth_frame() for frame + * parsing. In addition to 3 frames, superframes can also contain the LSPs + * (if these are globally specified for all frames (residually); they can + * also be specified individually per-frame. See the s->has_residual_lsps + * option), and can specify the number of samples encoded in this superframe + * (if less than 480), usually used to prevent blanks at track boundaries. + * + * @param ctx WMA Voice decoder context + * @param samples pointer to output buffer for voice samples + * @param data_size pointer containing the size of #samples on input, and the + * amount of #samples filled on output + * @return 0 on success, <0 on error or 1 if there was not enough data to + * fully parse the superframe + */ +static int synth_superframe(AVCodecContext *ctx, + float *samples, int *data_size) +{ + WMAVoiceContext *s = ctx->priv_data; + GetBitContext *gb = &s->gb, s_gb; + int n, res, n_samples = 480; + double lsps[MAX_FRAMES][MAX_LSPS]; + const double *mean_lsf = s->lsps == 16 ? + wmavoice_mean_lsf16[s->lsp_def_mode] : wmavoice_mean_lsf10[s->lsp_def_mode]; + float excitation[MAX_SIGNAL_HISTORY + MAX_SFRAMESIZE + 12]; + float synth[MAX_LSPS + MAX_SFRAMESIZE]; + + memcpy(synth, s->synth_history, + s->lsps * sizeof(*synth)); + memcpy(excitation, s->excitation_history, + s->history_nsamples * sizeof(*excitation)); + + if (s->sframe_cache_size > 0) { + gb = &s_gb; + init_get_bits(gb, s->sframe_cache, s->sframe_cache_size); + s->sframe_cache_size = 0; + } + + if ((res = check_bits_for_superframe(gb, s)) == 1) return 1; + + /* First bit is speech/music bit, it differentiates between WMAVoice + * speech samples (the actual codec) and WMAVoice music samples, which + * are really WMAPro-in-WMAVoice-superframes. I've never seen those in + * the wild yet. */ + if (!get_bits1(gb)) { + av_log_missing_feature(ctx, "WMAPro-in-WMAVoice support", 1); + return -1; + } + + /* (optional) nr. of samples in superframe; always <= 480 and >= 0 */ + if (get_bits1(gb)) { + if ((n_samples = get_bits(gb, 12)) > 480) { + av_log(ctx, AV_LOG_ERROR, + "Superframe encodes >480 samples (%d), not allowed\n", + n_samples); + return -1; + } + } + /* Parse LSPs, if global for the superframe (can also be per-frame). */ + if (s->has_residual_lsps) { + double prev_lsps[MAX_LSPS], a1[MAX_LSPS * 2], a2[MAX_LSPS * 2]; + + for (n = 0; n < s->lsps; n++) + prev_lsps[n] = s->prev_lsps[n] - mean_lsf[n]; + + if (s->lsps == 10) { + dequant_lsp10r(gb, lsps[2], prev_lsps, a1, a2, s->lsp_q_mode); + } else /* s->lsps == 16 */ + dequant_lsp16r(gb, lsps[2], prev_lsps, a1, a2, s->lsp_q_mode); + + for (n = 0; n < s->lsps; n++) { + lsps[0][n] = mean_lsf[n] + (a1[n] - a2[n * 2]); + lsps[1][n] = mean_lsf[n] + (a1[s->lsps + n] - a2[n * 2 + 1]); + lsps[2][n] += mean_lsf[n]; + } + for (n = 0; n < 3; n++) + stabilize_lsps(lsps[n], s->lsps); + } + + /* Parse frames, optionally preceeded by per-frame (independent) LSPs. */ + for (n = 0; n < 3; n++) { + if (!s->has_residual_lsps) { + int m; + + if (s->lsps == 10) { + dequant_lsp10i(gb, lsps[n]); + } else /* s->lsps == 16 */ + dequant_lsp16i(gb, lsps[n]); + + for (m = 0; m < s->lsps; m++) + lsps[n][m] += mean_lsf[m]; + stabilize_lsps(lsps[n], s->lsps); + } + + if ((res = synth_frame(ctx, gb, n, + &samples[n * MAX_FRAMESIZE], + lsps[n], n == 0 ? s->prev_lsps : lsps[n - 1], + &excitation[s->history_nsamples + n * MAX_FRAMESIZE], + &synth[s->lsps + n * MAX_FRAMESIZE]))) + return res; + } + + /* Statistics? FIXME - we don't check for length, a slight overrun + * will be caught by internal buffer padding, and anything else + * will be skipped, not read. */ + if (get_bits1(gb)) { + res = get_bits(gb, 4); + skip_bits(gb, 10 * (res + 1)); + } + + /* Specify nr. of output samples */ + *data_size = n_samples * sizeof(float); + + /* Update history */ + memcpy(s->prev_lsps, lsps[2], + s->lsps * sizeof(*s->prev_lsps)); + memcpy(s->synth_history, &synth[MAX_SFRAMESIZE], + s->lsps * sizeof(*synth)); + memcpy(s->excitation_history, &excitation[MAX_SFRAMESIZE], + s->history_nsamples * sizeof(*excitation)); + if (s->do_apf) + memmove(s->zero_exc_pf, &s->zero_exc_pf[MAX_SFRAMESIZE], + s->history_nsamples * sizeof(*s->zero_exc_pf)); + + return 0; +} + +/** + * Parse the packet header at the start of each packet (input data to this + * decoder). + * + * @param s WMA Voice decoding context private data + * @return 1 if not enough bits were available, or 0 on success. + */ +static int parse_packet_header(WMAVoiceContext *s) +{ + GetBitContext *gb = &s->gb; + unsigned int res; + + if (get_bits_left(gb) < 11) + return 1; + skip_bits(gb, 4); // packet sequence number + s->has_residual_lsps = get_bits1(gb); + do { + res = get_bits(gb, 6); // number of superframes per packet + // (minus first one if there is spillover) + if (get_bits_left(gb) < 6 * (res == 0x3F) + s->spillover_bitsize) + return 1; + } while (res == 0x3F); + s->spillover_nbits = get_bits(gb, s->spillover_bitsize); + + return 0; +} + +/** + * Copy (unaligned) bits from gb/data/size to pb. + * + * @param pb target buffer to copy bits into + * @param data source buffer to copy bits from + * @param size size of the source data, in bytes + * @param gb bit I/O context specifying the current position in the source. + * data. This function might use this to align the bit position to + * a whole-byte boundary before calling #ff_copy_bits() on aligned + * source data + * @param nbits the amount of bits to copy from source to target + * + * @note after calling this function, the current position in the input bit + * I/O context is undefined. + */ +static void copy_bits(PutBitContext *pb, + const uint8_t *data, int size, + GetBitContext *gb, int nbits) +{ + int rmn_bytes, rmn_bits; + + rmn_bits = rmn_bytes = get_bits_left(gb); + if (rmn_bits < nbits) + return; + rmn_bits &= 7; rmn_bytes >>= 3; + if ((rmn_bits = FFMIN(rmn_bits, nbits)) > 0) + put_bits(pb, rmn_bits, get_bits(gb, rmn_bits)); + ff_copy_bits(pb, data + size - rmn_bytes, + FFMIN(nbits - rmn_bits, rmn_bytes << 3)); +} + +/** + * Packet decoding: a packet is anything that the (ASF) demuxer contains, + * and we expect that the demuxer / application provides it to us as such + * (else you'll probably get garbage as output). Every packet has a size of + * ctx->block_align bytes, starts with a packet header (see + * #parse_packet_header()), and then a series of superframes. Superframe + * boundaries may exceed packets, i.e. superframes can split data over + * multiple (two) packets. + * + * For more information about frames, see #synth_superframe(). + */ +static int wmavoice_decode_packet(AVCodecContext *ctx, void *data, + int *data_size, AVPacket *avpkt) +{ + WMAVoiceContext *s = ctx->priv_data; + GetBitContext *gb = &s->gb; + int size, res, pos; + + if (*data_size < 480 * sizeof(float)) { + av_log(ctx, AV_LOG_ERROR, + "Output buffer too small (%d given - %zu needed)\n", + *data_size, 480 * sizeof(float)); + return -1; + } + *data_size = 0; + + /* Packets are sometimes a multiple of ctx->block_align, with a packet + * header at each ctx->block_align bytes. However, FFmpeg's ASF demuxer + * feeds us ASF packets, which may concatenate multiple "codec" packets + * in a single "muxer" packet, so we artificially emulate that by + * capping the packet size at ctx->block_align. */ + for (size = avpkt->size; size > ctx->block_align; size -= ctx->block_align); + if (!size) + return 0; + init_get_bits(&s->gb, avpkt->data, size << 3); + + /* size == ctx->block_align is used to indicate whether we are dealing with + * a new packet or a packet of which we already read the packet header + * previously. */ + if (size == ctx->block_align) { // new packet header + if ((res = parse_packet_header(s)) < 0) + return res; + + /* If the packet header specifies a s->spillover_nbits, then we want + * to push out all data of the previous packet (+ spillover) before + * continuing to parse new superframes in the current packet. */ + if (s->spillover_nbits > 0) { + if (s->sframe_cache_size > 0) { + int cnt = get_bits_count(gb); + copy_bits(&s->pb, avpkt->data, size, gb, s->spillover_nbits); + flush_put_bits(&s->pb); + s->sframe_cache_size += s->spillover_nbits; + if ((res = synth_superframe(ctx, data, data_size)) == 0 && + *data_size > 0) { + cnt += s->spillover_nbits; + s->skip_bits_next = cnt & 7; + return cnt >> 3; + } else + skip_bits_long (gb, s->spillover_nbits - cnt + + get_bits_count(gb)); // resync + } else + skip_bits_long(gb, s->spillover_nbits); // resync + } + } else if (s->skip_bits_next) + skip_bits(gb, s->skip_bits_next); + + /* Try parsing superframes in current packet */ + s->sframe_cache_size = 0; + s->skip_bits_next = 0; + pos = get_bits_left(gb); + if ((res = synth_superframe(ctx, data, data_size)) < 0) { + return res; + } else if (*data_size > 0) { + int cnt = get_bits_count(gb); + s->skip_bits_next = cnt & 7; + return cnt >> 3; + } else if ((s->sframe_cache_size = pos) > 0) { + /* rewind bit reader to start of last (incomplete) superframe... */ + init_get_bits(gb, avpkt->data, size << 3); + skip_bits_long(gb, (size << 3) - pos); + assert(get_bits_left(gb) == pos); + + /* ...and cache it for spillover in next packet */ + init_put_bits(&s->pb, s->sframe_cache, SFRAME_CACHE_MAXSIZE); + copy_bits(&s->pb, avpkt->data, size, gb, s->sframe_cache_size); + // FIXME bad - just copy bytes as whole and add use the + // skip_bits_next field + } + + return size; +} + +static av_cold int wmavoice_decode_end(AVCodecContext *ctx) +{ + WMAVoiceContext *s = ctx->priv_data; + + if (s->do_apf) { + ff_rdft_end(&s->rdft); + ff_rdft_end(&s->irdft); + ff_dct_end(&s->dct); + ff_dct_end(&s->dst); + } + + return 0; +} + +static av_cold void wmavoice_flush(AVCodecContext *ctx) +{ + WMAVoiceContext *s = ctx->priv_data; + int n; + + s->postfilter_agc = 0; + s->sframe_cache_size = 0; + s->skip_bits_next = 0; + for (n = 0; n < s->lsps; n++) + s->prev_lsps[n] = M_PI * (n + 1.0) / (s->lsps + 1.0); + memset(s->excitation_history, 0, + sizeof(*s->excitation_history) * MAX_SIGNAL_HISTORY); + memset(s->synth_history, 0, + sizeof(*s->synth_history) * MAX_LSPS); + memset(s->gain_pred_err, 0, + sizeof(s->gain_pred_err)); + + if (s->do_apf) { + memset(&s->synth_filter_out_buf[MAX_LSPS_ALIGN16 - s->lsps], 0, + sizeof(*s->synth_filter_out_buf) * s->lsps); + memset(s->dcf_mem, 0, + sizeof(*s->dcf_mem) * 2); + memset(s->zero_exc_pf, 0, + sizeof(*s->zero_exc_pf) * s->history_nsamples); + memset(s->denoise_filter_cache, 0, sizeof(s->denoise_filter_cache)); + } +} + +AVCodec ff_wmavoice_decoder = { + "wmavoice", + AVMEDIA_TYPE_AUDIO, + CODEC_ID_WMAVOICE, + sizeof(WMAVoiceContext), + wmavoice_decode_init, + NULL, + wmavoice_decode_end, + wmavoice_decode_packet, + CODEC_CAP_SUBFRAMES, + .flush = wmavoice_flush, + .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio Voice"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmavoice_data.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmavoice_data.h new file mode 100644 index 00000000..cbf65b04 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/wmavoice_data.h @@ -0,0 +1,3259 @@ +/* + * Windows Media Voice (WMAVoice) tables. + * Copyright (c) 2009 Ronald S. Bultje + * + * 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 + * @brief Windows Media Voice (WMAVoice) tables + * @author Ronald S. Bultje + */ + +#ifndef AVCODEC_WMAVOICE_DATA_H +#define AVCODEC_WMAVOICE_DATA_H + +#include + +static const uint8_t wmavoice_dq_lsp10i[0xf00] = { + 125, 109, 84, 55, 34, 51, 109, 112, 118, 132, + 122, 102, 78, 80, 132, 119, 132, 132, 125, 131, + 109, 91, 131, 131, 136, 136, 137, 137, 140, 145, + 140, 143, 117, 136, 122, 106, 109, 91, 115, 119, + 133, 117, 103, 80, 55, 117, 123, 102, 93, 80, + 139, 116, 70, 39, 95, 89, 103, 113, 112, 122, + 135, 244, 229, 215, 199, 181, 163, 150, 146, 144, + 143, 173, 171, 154, 155, 154, 151, 148, 145, 143, + 132, 138, 116, 85, 117, 94, 108, 117, 107, 116, + 132, 118, 123, 119, 88, 67, 49, 95, 84, 95, + 121, 103, 74, 70, 179, 164, 141, 126, 107, 112, + 119, 95, 103, 149, 139, 148, 144, 147, 148, 141, + 151, 133, 142, 129, 111, 131, 108, 128, 122, 108, + 121, 96, 115, 138, 116, 93, 105, 115, 115, 123, + 129, 106, 136, 180, 147, 130, 108, 141, 131, 118, + 136, 155, 176, 156, 135, 129, 140, 146, 142, 134, + 141, 130, 109, 80, 52, 38, 18, 47, 118, 134, + 155, 141, 100, 78, 72, 89, 79, 96, 92, 98, + 133, 111, 83, 91, 72, 58, 105, 115, 112, 120, + 145, 127, 135, 113, 113, 105, 105, 85, 69, 61, + 115, 96, 116, 145, 159, 170, 175, 175, 168, 155, + 140, 120, 84, 52, 80, 145, 125, 127, 116, 126, + 128, 108, 101, 198, 227, 200, 178, 159, 147, 148, + 121, 88, 46, 109, 124, 126, 126, 137, 147, 147, + 129, 107, 164, 148, 127, 117, 134, 120, 111, 116, + 120, 103, 98, 73, 66, 61, 70, 115, 116, 125, + 126, 100, 77, 188, 162, 140, 114, 128, 139, 123, + 145, 165, 164, 134, 109, 100, 108, 118, 127, 130, + 156, 182, 190, 173, 167, 165, 162, 157, 152, 147, + 150, 164, 179, 183, 173, 155, 140, 136, 134, 135, + 122, 92, 69, 140, 132, 118, 108, 128, 138, 132, + 123, 127, 148, 137, 150, 149, 139, 127, 124, 130, + 136, 138, 112, 70, 41, 37, 132, 140, 129, 125, + 130, 111, 78, 33, 51, 161, 141, 136, 120, 122, + 126, 110, 87, 106, 85, 68, 48, 81, 112, 113, + 135, 125, 98, 85, 102, 80, 100, 87, 86, 116, + 142, 133, 110, 66, 48, 152, 139, 135, 136, 123, + 128, 116, 89, 102, 128, 99, 83, 61, 105, 124, + 120, 94, 73, 83, 78, 100, 122, 124, 128, 132, + 144, 137, 116, 102, 75, 144, 136, 127, 140, 127, + 154, 144, 118, 99, 90, 90, 89, 75, 68, 83, + 123, 103, 89, 198, 180, 154, 138, 122, 136, 120, + 138, 118, 121, 136, 110, 105, 85, 111, 101, 104, + 121, 126, 139, 115, 99, 101, 107, 110, 123, 126, + 127, 115, 88, 109, 164, 134, 138, 138, 120, 121, + 130, 202, 195, 202, 199, 201, 181, 164, 159, 148, + 120, 116, 194, 199, 186, 171, 154, 142, 137, 133, + 137, 129, 112, 149, 134, 112, 149, 138, 120, 134, + 119, 102, 107, 83, 79, 114, 119, 127, 128, 128, + 144, 148, 165, 155, 161, 150, 135, 122, 116, 115, + 120, 99, 80, 120, 123, 124, 111, 89, 70, 108, + 118, 95, 66, 53, 105, 126, 125, 105, 83, 111, + 129, 197, 191, 197, 206, 213, 216, 208, 196, 169, + 133, 109, 127, 164, 134, 121, 99, 92, 82, 71, + 131, 121, 93, 91, 136, 105, 115, 140, 120, 110, + 150, 164, 139, 108, 87, 81, 93, 92, 104, 116, + 133, 114, 125, 126, 111, 136, 110, 156, 147, 133, + 113, 94, 118, 120, 115, 125, 124, 126, 127, 134, + 116, 131, 161, 158, 166, 157, 150, 150, 144, 141, + 125, 185, 169, 142, 140, 143, 139, 131, 134, 138, + 179, 188, 170, 150, 134, 140, 144, 133, 127, 127, + 150, 177, 204, 184, 192, 194, 190, 193, 177, 158, + 114, 113, 138, 116, 137, 135, 132, 131, 127, 134, + 120, 147, 163, 135, 133, 137, 136, 136, 133, 135, + 137, 120, 95, 73, 46, 48, 111, 97, 97, 123, + 139, 130, 109, 76, 52, 72, 61, 61, 125, 127, + 132, 119, 119, 90, 66, 41, 64, 156, 143, 129, + 131, 106, 58, 25, 99, 115, 122, 136, 129, 132, + 134, 123, 97, 53, 27, 114, 125, 114, 120, 123, + 122, 107, 93, 57, 47, 133, 128, 138, 141, 131, + 145, 132, 122, 110, 79, 57, 30, 73, 153, 144, + 150, 132, 85, 59, 133, 125, 130, 115, 100, 96, + 148, 127, 111, 86, 61, 38, 110, 121, 108, 99, + 157, 143, 105, 77, 116, 118, 115, 131, 122, 122, + 133, 119, 134, 108, 86, 61, 129, 165, 143, 127, + 125, 105, 89, 111, 97, 85, 113, 99, 98, 117, + 149, 131, 101, 106, 88, 95, 79, 119, 123, 120, + 125, 109, 81, 100, 201, 183, 156, 138, 115, 116, + 141, 119, 129, 105, 76, 60, 110, 99, 92, 82, + 150, 156, 129, 95, 69, 115, 115, 113, 134, 125, + 118, 97, 67, 96, 203, 197, 171, 151, 133, 125, + 143, 131, 120, 134, 105, 80, 51, 60, 139, 134, + 129, 160, 223, 219, 219, 212, 197, 173, 157, 146, + 132, 112, 164, 144, 119, 102, 92, 76, 73, 94, + 132, 112, 124, 114, 93, 92, 83, 73, 69, 99, + 129, 103, 188, 163, 142, 132, 127, 101, 82, 59, + 140, 141, 111, 74, 46, 105, 113, 99, 127, 122, + 125, 94, 63, 112, 116, 101, 81, 120, 136, 134, + 133, 190, 224, 193, 179, 158, 146, 143, 140, 136, + 152, 161, 132, 120, 112, 94, 114, 102, 92, 116, + 129, 194, 196, 202, 211, 212, 210, 190, 169, 152, + 166, 166, 145, 111, 91, 132, 133, 128, 136, 130, + 118, 94, 72, 74, 92, 86, 89, 92, 106, 123, + 126, 100, 86, 137, 117, 92, 76, 104, 106, 114, + 133, 109, 204, 192, 166, 148, 138, 128, 111, 81, + 118, 99, 79, 146, 169, 141, 123, 102, 131, 120, + 127, 105, 136, 204, 170, 154, 131, 145, 135, 119, + 117, 95, 64, 83, 141, 136, 118, 96, 99, 126, + 115, 93, 98, 102, 95, 105, 106, 114, 119, 128, + 131, 121, 98, 139, 149, 119, 109, 86, 105, 129, + 134, 119, 104, 169, 185, 155, 141, 122, 107, 127, + 136, 115, 85, 108, 87, 126, 102, 128, 136, 129, + 125, 99, 126, 158, 133, 139, 132, 113, 91, 107, + 141, 122, 128, 161, 130, 127, 105, 120, 118, 106, + 122, 140, 161, 168, 187, 184, 176, 158, 144, 140, + 127, 111, 89, 130, 132, 105, 134, 121, 100, 122, + 129, 110, 128, 115, 129, 116, 132, 118, 114, 119, + 138, 133, 132, 188, 183, 159, 161, 147, 134, 140, + 132, 113, 84, 167, 147, 132, 124, 109, 133, 121, + 132, 128, 116, 121, 98, 101, 145, 129, 128, 129, + 124, 112, 152, 158, 136, 161, 139, 165, 158, 142, + 139, 138, 110, 127, 148, 117, 126, 118, 101, 116, + 155, 168, 154, 128, 120, 152, 150, 141, 140, 135, + 127, 111, 109, 134, 104, 133, 110, 112, 132, 114, + 111, 87, 68, 89, 107, 121, 121, 126, 126, 129, + 120, 148, 169, 163, 173, 178, 185, 188, 178, 163, + 122, 97, 86, 117, 101, 138, 118, 142, 155, 139, + 125, 114, 131, 138, 153, 149, 163, 150, 143, 141, + 157, 161, 138, 152, 134, 121, 122, 109, 110, 124, + 151, 171, 196, 168, 145, 139, 147, 151, 146, 139, + 134, 169, 179, 170, 175, 178, 177, 173, 165, 154, + 120, 151, 118, 107, 125, 129, 133, 133, 136, 139, + 119, 141, 159, 151, 160, 165, 168, 169, 162, 152, + 115, 111, 119, 94, 117, 121, 127, 127, 132, 136, + 134, 153, 147, 142, 142, 147, 159, 159, 154, 147, + 110, 106, 139, 135, 143, 142, 147, 146, 147, 147, + 115, 133, 151, 133, 141, 142, 151, 152, 147, 144, + 115, 132, 144, 131, 125, 126, 128, 130, 131, 136, + 138, 118, 96, 71, 48, 26, 43, 130, 125, 125, + 134, 122, 98, 54, 28, 84, 77, 73, 109, 125, + 133, 112, 67, 48, 141, 129, 126, 113, 112, 118, + 143, 123, 89, 54, 71, 73, 75, 131, 123, 123, + 126, 109, 81, 31, 15, 94, 110, 109, 119, 128, + 132, 122, 97, 92, 73, 50, 27, 22, 104, 133, + 133, 119, 94, 48, 34, 168, 160, 154, 151, 130, + 147, 133, 90, 54, 71, 123, 106, 105, 93, 117, + 143, 132, 107, 69, 45, 78, 178, 169, 150, 139, + 138, 123, 116, 96, 69, 49, 32, 113, 103, 112, + 154, 151, 125, 79, 60, 152, 160, 154, 155, 137, + 142, 151, 124, 88, 66, 59, 94, 87, 95, 119, + 166, 154, 122, 92, 138, 132, 124, 114, 97, 97, + 122, 99, 98, 219, 191, 176, 165, 159, 153, 131, + 130, 119, 91, 51, 24, 41, 144, 156, 147, 139, + 139, 122, 81, 65, 124, 111, 104, 90, 94, 98, + 138, 120, 112, 91, 63, 65, 89, 75, 78, 106, + 126, 107, 91, 85, 69, 95, 90, 84, 108, 120, + 155, 139, 100, 78, 120, 110, 109, 91, 77, 73, + 144, 130, 135, 112, 88, 65, 62, 142, 129, 126, + 170, 154, 150, 131, 121, 116, 100, 92, 83, 86, + 131, 122, 98, 107, 102, 75, 54, 38, 117, 130, + 146, 139, 117, 107, 86, 66, 44, 30, 97, 128, + 129, 116, 100, 59, 108, 127, 119, 139, 129, 129, + 124, 106, 79, 49, 154, 190, 166, 152, 133, 123, + 141, 149, 123, 89, 61, 70, 143, 132, 125, 126, + 136, 113, 177, 166, 141, 123, 109, 108, 105, 93, + 137, 117, 147, 123, 99, 85, 109, 98, 91, 75, + 129, 121, 102, 78, 53, 90, 149, 136, 134, 135, + 144, 136, 126, 90, 114, 152, 137, 152, 138, 128, + 133, 115, 107, 129, 99, 78, 60, 129, 125, 118, + 147, 141, 119, 124, 110, 91, 79, 64, 106, 117, + 134, 111, 164, 143, 123, 113, 116, 95, 76, 56, + 147, 159, 140, 109, 83, 84, 140, 135, 127, 129, + 123, 104, 116, 99, 91, 87, 80, 110, 113, 121, + 124, 106, 174, 174, 152, 141, 132, 134, 126, 124, + 140, 190, 240, 215, 212, 189, 173, 158, 144, 137, + 123, 97, 79, 102, 110, 111, 90, 75, 126, 124, + 134, 121, 104, 145, 127, 100, 77, 65, 120, 118, + 123, 106, 87, 41, 68, 119, 106, 115, 109, 119, + 137, 232, 241, 225, 217, 202, 183, 169, 156, 145, + 161, 146, 127, 110, 97, 107, 88, 114, 108, 106, + 141, 244, 216, 192, 172, 163, 148, 143, 144, 144, + 128, 127, 109, 89, 77, 68, 124, 120, 121, 125, + 125, 94, 48, 71, 116, 113, 104, 120, 142, 137, + 133, 129, 115, 82, 68, 120, 99, 133, 134, 124, + 130, 106, 108, 160, 130, 111, 89, 129, 124, 119, + 134, 120, 149, 143, 116, 95, 87, 142, 132, 122, + 126, 114, 108, 107, 80, 141, 133, 123, 137, 124, + 117, 95, 69, 43, 62, 98, 114, 116, 112, 120, + 122, 99, 87, 164, 145, 123, 99, 95, 118, 105, + 126, 101, 102, 120, 113, 110, 92, 139, 134, 126, + 148, 194, 241, 219, 221, 215, 200, 193, 174, 151, + 127, 104, 122, 136, 113, 106, 110, 95, 78, 106, + 131, 163, 217, 199, 194, 175, 164, 155, 142, 138, + 139, 124, 88, 57, 161, 161, 145, 139, 124, 116, + 127, 110, 91, 98, 126, 104, 113, 98, 94, 94, + 145, 138, 114, 90, 75, 130, 117, 107, 99, 90, + 119, 98, 86, 101, 148, 133, 103, 83, 124, 131, + 143, 168, 169, 133, 110, 117, 139, 149, 147, 137, + 124, 106, 80, 138, 194, 163, 142, 119, 106, 130, + 136, 125, 105, 114, 87, 113, 101, 89, 108, 102, + 114, 90, 53, 46, 105, 116, 126, 122, 118, 122, + 124, 102, 92, 195, 167, 160, 144, 154, 154, 132, + 118, 97, 88, 72, 98, 120, 112, 98, 79, 117, + 114, 107, 185, 191, 191, 188, 175, 165, 153, 143, + 119, 97, 90, 89, 120, 151, 136, 113, 99, 112, + 141, 121, 144, 122, 125, 113, 133, 111, 92, 69, + 120, 98, 78, 109, 151, 145, 157, 157, 151, 143, + 130, 110, 120, 188, 159, 141, 119, 112, 109, 98, + 126, 112, 83, 110, 169, 139, 127, 105, 93, 123, + 141, 145, 117, 106, 91, 78, 123, 107, 101, 125, + 117, 95, 71, 147, 176, 153, 148, 133, 135, 127, + 124, 106, 79, 64, 115, 96, 108, 115, 106, 105, + 127, 115, 90, 98, 105, 81, 144, 135, 117, 125, + 126, 104, 98, 165, 138, 136, 112, 149, 148, 131, + 119, 144, 186, 185, 204, 202, 209, 200, 182, 161, + 123, 153, 190, 189, 199, 194, 191, 176, 157, 147, + 121, 103, 119, 98, 100, 120, 106, 97, 95, 126, + 137, 130, 102, 117, 117, 92, 126, 114, 101, 118, + 131, 219, 190, 167, 153, 151, 144, 140, 142, 143, + 114, 102, 151, 152, 132, 120, 112, 120, 127, 131, + 138, 122, 91, 143, 118, 120, 114, 104, 124, 117, + 148, 142, 117, 126, 97, 125, 108, 116, 142, 125, + 126, 106, 91, 169, 208, 178, 158, 138, 127, 135, + 133, 126, 101, 83, 147, 130, 125, 117, 114, 117, + 120, 103, 94, 149, 136, 129, 139, 118, 133, 133, + 147, 152, 126, 132, 119, 97, 132, 129, 114, 126, + 112, 107, 148, 125, 112, 114, 124, 125, 129, 135, + 139, 121, 157, 151, 131, 140, 118, 147, 136, 121, + 115, 105, 159, 167, 185, 191, 196, 190, 176, 160, + 124, 106, 104, 122, 130, 114, 152, 144, 134, 136, + 136, 152, 159, 153, 131, 114, 116, 126, 129, 129, + 124, 109, 87, 131, 107, 115, 130, 107, 144, 131, + 126, 162, 176, 175, 180, 176, 160, 141, 134, 134, + 136, 127, 108, 161, 162, 133, 141, 124, 112, 128, + 130, 115, 110, 140, 107, 155, 134, 131, 156, 137, + 122, 106, 116, 127, 118, 161, 150, 170, 167, 152, + 139, 177, 203, 176, 155, 139, 130, 128, 129, 132, + 137, 119, 125, 103, 110, 123, 107, 120, 108, 101, + 113, 107, 160, 154, 160, 166, 169, 176, 168, 156, + 115, 90, 65, 115, 115, 104, 120, 112, 109, 124, + 131, 123, 100, 109, 185, 158, 141, 132, 116, 119, + 139, 130, 119, 156, 124, 138, 127, 116, 141, 128, + 133, 118, 115, 180, 149, 151, 135, 130, 147, 129, + 117, 90, 80, 119, 124, 128, 132, 130, 128, 135, + 112, 97, 142, 161, 167, 165, 154, 142, 136, 135, + 118, 141, 193, 172, 157, 152, 148, 145, 146, 141, + 125, 147, 165, 166, 149, 133, 123, 122, 128, 131, + 128, 193, 177, 174, 182, 186, 197, 193, 191, 173, + 124, 144, 162, 133, 113, 113, 123, 128, 129, 130, + 117, 98, 121, 122, 137, 132, 110, 97, 111, 130, + 128, 176, 151, 125, 126, 134, 130, 121, 127, 130, + 122, 151, 142, 111, 106, 121, 126, 126, 130, 134, + 148, 167, 186, 153, 129, 122, 124, 128, 130, 128, + 148, 172, 206, 178, 171, 182, 169, 180, 172, 156, + 133, 164, 174, 160, 155, 163, 163, 172, 169, 158, + 132, 150, 147, 142, 152, 140, 140, 140, 134, 135, + 137, 158, 167, 172, 163, 153, 169, 158, 146, 147, + 150, 161, 162, 172, 153, 133, 140, 144, 136, 135, + 109, 84, 101, 120, 129, 134, 133, 136, 137, 143, + 112, 114, 157, 147, 141, 136, 135, 133, 135, 138, + 121, 154, 161, 150, 149, 154, 151, 144, 146, 144, + 111, 117, 125, 125, 130, 131, 135, 137, 143, 148, + 121, 141, 146, 131, 138, 126, 118, 111, 119, 130, + 120, 135, 145, 121, 140, 134, 138, 137, 131, 134, + 115, 137, 132, 137, 139, 138, 138, 139, 145, 149, + 131, 149, 147, 133, 132, 126, 131, 134, 130, 133, + 110, 98, 84, 141, 107, 169, 169, 123, 125, 126, + 118, 210, 98, 126, 132, 138, 128, 139, 156, 157, + 140, 142, 129, 95, 192, 178, 182, 186, 183, 159, + 135, 134, 144, 124, 100, 228, 203, 161, 122, 104, + 139, 159, 134, 161, 121, 126, 192, 152, 218, 180, + 132, 132, 119, 99, 96, 97, 80, 53, 134, 143, + 102, 114, 133, 114, 127, 83, 77, 126, 85, 107, + 110, 114, 194, 186, 139, 116, 147, 104, 129, 138, + 126, 133, 109, 144, 115, 45, 130, 97, 159, 155, + 157, 162, 189, 185, 168, 163, 151, 151, 142, 135, + 144, 147, 120, 74, 192, 186, 149, 118, 71, 84, + 143, 156, 133, 178, 168, 107, 119, 149, 105, 112, + 182, 184, 158, 118, 118, 148, 128, 177, 171, 152, + 139, 135, 126, 209, 171, 150, 123, 100, 190, 158, + 166, 97, 136, 123, 136, 139, 128, 138, 126, 121, + 132, 131, 128, 95, 60, 168, 127, 140, 208, 161, + 109, 102, 119, 162, 150, 137, 107, 200, 156, 136, + 136, 128, 103, 95, 74, 91, 220, 173, 152, 138, + 139, 129, 140, 136, 122, 82, 180, 115, 53, 90, + 121, 107, 99, 148, 116, 139, 100, 63, 191, 155, + 130, 129, 163, 155, 98, 175, 95, 151, 127, 107, + 124, 124, 116, 88, 71, 164, 148, 96, 57, 89, + 125, 117, 77, 63, 162, 144, 113, 109, 137, 134, + 134, 130, 149, 174, 158, 158, 130, 81, 28, 67, + 142, 139, 129, 100, 194, 134, 68, 175, 131, 103, + 136, 132, 122, 96, 119, 82, 115, 249, 215, 168, + 125, 139, 199, 96, 146, 123, 136, 179, 142, 137, + 181, 166, 106, 86, 122, 106, 123, 131, 106, 119, + 129, 189, 188, 147, 126, 110, 101, 114, 147, 136, + 132, 106, 72, 175, 148, 99, 130, 153, 125, 136, + 123, 119, 147, 170, 157, 126, 209, 188, 158, 152, + 101, 89, 142, 131, 161, 150, 148, 124, 89, 119, + 141, 137, 131, 103, 81, 85, 64, 175, 129, 121, + 137, 144, 142, 145, 119, 205, 148, 80, 165, 138, + 143, 137, 167, 165, 148, 149, 110, 234, 217, 170, + 167, 152, 75, 140, 155, 155, 175, 129, 136, 134, + 136, 152, 161, 131, 140, 121, 91, 79, 255, 209, + 132, 147, 120, 114, 177, 128, 110, 61, 89, 131, + 125, 127, 93, 87, 167, 115, 186, 162, 107, 106, + 134, 162, 151, 100, 79, 67, 151, 116, 130, 142, + 162, 153, 155, 143, 122, 85, 202, 187, 135, 125, + 158, 155, 103, 129, 74, 149, 130, 98, 129, 126, + 148, 152, 153, 133, 118, 94, 80, 70, 47, 90, + 124, 118, 143, 184, 158, 126, 70, 82, 111, 113, + 126, 135, 175, 141, 203, 166, 123, 123, 134, 133, + 113, 111, 128, 76, 128, 177, 151, 178, 134, 125, + 120, 120, 193, 106, 98, 134, 101, 86, 101, 114, + 136, 127, 134, 196, 86, 105, 145, 128, 119, 137, + 138, 126, 230, 161, 141, 128, 129, 136, 88, 83, + 103, 118, 178, 123, 89, 101, 161, 173, 165, 147, + 130, 123, 171, 158, 131, 81, 50, 177, 162, 136, + 125, 115, 82, 173, 195, 168, 130, 112, 112, 121, + 152, 148, 167, 87, 82, 161, 142, 147, 98, 89, + 168, 138, 97, 157, 132, 114, 74, 126, 161, 141, + 135, 123, 68, 137, 124, 118, 112, 92, 65, 96, + 191, 181, 161, 151, 141, 145, 129, 102, 97, 111, + 144, 128, 55, 128, 115, 155, 129, 184, 167, 147, + 131, 141, 125, 33, 127, 111, 127, 131, 125, 130, + 137, 130, 121, 195, 172, 177, 176, 149, 98, 97, + 126, 106, 168, 159, 144, 185, 156, 151, 182, 158, + 123, 93, 110, 116, 98, 99, 125, 136, 139, 148, + 79, 112, 149, 128, 147, 136, 118, 105, 166, 152, + 117, 115, 92, 128, 148, 132, 170, 143, 226, 190, + 122, 192, 165, 121, 143, 144, 174, 124, 113, 124, + 122, 135, 34, 93, 118, 111, 111, 136, 123, 116, + 99, 195, 139, 99, 114, 102, 96, 108, 111, 112, + 113, 129, 172, 137, 105, 139, 154, 86, 113, 108, + 132, 79, 63, 120, 93, 162, 90, 103, 94, 95, + 117, 127, 104, 100, 142, 129, 93, 27, 196, 153, + 113, 91, 101, 90, 84, 68, 138, 38, 118, 148, + 87, 103, 125, 109, 96, 152, 100, 56, 31, 62, + 176, 129, 124, 115, 103, 92, 100, 121, 130, 125, + 128, 71, 82, 71, 152, 85, 107, 116, 138, 133, + 103, 116, 139, 144, 72, 37, 118, 141, 109, 95, + 86, 92, 121, 167, 156, 104, 92, 91, 122, 114, + 89, 61, 172, 128, 95, 103, 84, 101, 88, 84, + 116, 125, 108, 62, 74, 108, 160, 143, 189, 164, + 91, 115, 144, 43, 116, 79, 106, 108, 74, 83, + 87, 90, 61, 71, 76, 76, 95, 130, 89, 94, + 114, 107, 101, 145, 161, 147, 143, 163, 147, 129, + 101, 73, 111, 108, 93, 104, 186, 141, 99, 89, + 112, 126, 111, 113, 152, 41, 159, 115, 131, 124, + 117, 101, 115, 130, 124, 87, 59, 177, 63, 85, + 109, 116, 103, 68, 145, 132, 29, 119, 96, 89, + 117, 90, 181, 103, 101, 111, 97, 96, 199, 171, + 113, 120, 93, 119, 101, 64, 56, 55, 63, 90, + 105, 101, 86, 45, 136, 179, 142, 102, 115, 114, + 113, 108, 121, 84, 23, 125, 76, 102, 119, 107, + 120, 104, 73, 177, 83, 114, 128, 85, 152, 126, + 137, 115, 149, 109, 163, 133, 110, 98, 54, 61, + 95, 111, 135, 103, 88, 164, 115, 187, 122, 98, + 129, 132, 95, 86, 71, 119, 146, 111, 38, 67, + 102, 100, 66, 148, 137, 103, 145, 95, 35, 85, + 44, 136, 102, 111, 108, 115, 136, 105, 120, 110, + 108, 147, 112, 169, 116, 146, 81, 120, 94, 84, + 93, 97, 90, 119, 102, 91, 48, 147, 204, 151, + 148, 160, 144, 131, 144, 175, 158, 133, 212, 163, + 172, 152, 151, 112, 148, 151, 145, 179, 160, 124, + 164, 164, 167, 161, 141, 120, 131, 141, 198, 177, + 169, 156, 146, 156, 124, 185, 164, 195, 181, 193, + 201, 147, 148, 168, 165, 159, 162, 148, 150, 148, + 146, 157, 158, 149, 164, 129, 160, 214, 174, 166, + 154, 176, 146, 141, 155, 140, 140, 169, 106, 155, + 166, 162, 134, 193, 157, 155, 146, 196, 171, 107, + 177, 174, 163, 155, 147, 203, 162, 146, 150, 83, + 157, 170, 180, 178, 159, 157, 151, 117, 115, 183, + 170, 180, 174, 150, 177, 173, 136, 181, 196, 184, + 164, 168, 165, 148, 175, 168, 209, 189, 159, 114, + 157, 158, 141, 168, 170, 139, 175, 128, 151, 39, + 128, 154, 159, 161, 148, 180, 131, 165, 159, 131, + 163, 150, 174, 178, 178, 198, 172, 138, 184, 191, + 143, 164, 161, 163, 210, 171, 155, 168, 150, 116, + 182, 170, 145, 152, 141, 139, 191, 149, 160, 202, + 145, 169, 145, 181, 148, 183, 197, 165, 146, 171, + 161, 153, 157, 170, 164, 149, 183, 167, 246, 235, + 162, 144, 170, 152, 173, 150, 113, 135, 156, 154, + 158, 148, 178, 159, 161, 114, 180, 156, 116, 163, + 164, 161, 122, 164, 164, 183, 135, 135, 144, 182, + 160, 147, 163, 152, 169, 185, 159, 177, 99, 211, + 168, 167, 215, 170, 150, 157, 154, 176, 154, 143, + 163, 117, 178, 160, 163, 165, 164, 166, 174, 136, + 159, 169, 152, 123, 199, 149, 169, 140, 159, 208, + 155, 161, 186, 122, 134, 167, 171, 145, 148, 176, + 148, 137, 114, 160, 166, 153, 162, 156, 164, 172, + 155, 148, 155, 182, 114, 150, 157, 154, 140, 159, + 166, 160, 169, 206, 182, 145, 157, 165, 147, 202, + 131, 154, 193, 162, 162, 149, 167, 157, 191, 188, + 149, 205, 147, 166, 150, 150, 159, 153, 171, 160 +}; + +static const uint8_t wmavoice_dq_lsp16i1[0x640] = { + 142, 121, 141, 112, 99, 119, 92, 122, 183, 155, + 122, 98, 75, 78, 85, 101, 108, 134, 128, 123, + 115, 90, 79, 58, 73, 127, 106, 60, 97, 107, + 141, 163, 130, 123, 136, 156, 201, 189, 204, 206, + 140, 116, 69, 60, 117, 123, 106, 124, 91, 63, + 150, 144, 110, 80, 63, 112, 80, 70, 76, 63, + 114, 86, 147, 165, 137, 125, 120, 140, 115, 101, + 101, 99, 166, 158, 158, 104, 126, 131, 134, 143, + 121, 102, 73, 36, 83, 132, 113, 76, 38, 20, + 132, 111, 78, 73, 51, 131, 108, 131, 105, 80, + 148, 138, 101, 65, 47, 115, 86, 50, 124, 129, + 116, 89, 85, 87, 64, 111, 74, 39, 115, 113, + 112, 83, 75, 122, 127, 114, 91, 106, 125, 130, + 131, 108, 79, 136, 112, 110, 147, 164, 144, 124, + 121, 236, 218, 190, 168, 106, 101, 160, 172, 191, + 113, 138, 102, 91, 109, 100, 71, 85, 112, 119, + 121, 96, 51, 64, 126, 135, 114, 76, 34, 104, + 145, 127, 90, 56, 131, 142, 131, 92, 123, 102, + 128, 105, 63, 24, 95, 115, 87, 49, 156, 174, + 123, 105, 88, 58, 55, 141, 119, 99, 75, 81, + 137, 117, 114, 80, 56, 119, 91, 106, 166, 135, + 114, 84, 38, 93, 116, 129, 103, 97, 87, 97, + 115, 184, 193, 173, 157, 117, 88, 114, 151, 121, + 126, 111, 75, 129, 133, 130, 107, 71, 115, 92, + 128, 108, 120, 100, 97, 111, 80, 119, 122, 91, + 114, 94, 149, 129, 136, 114, 88, 132, 110, 85, + 116, 99, 101, 71, 71, 110, 140, 142, 131, 110, + 122, 98, 83, 127, 100, 106, 130, 123, 114, 103, + 113, 87, 140, 116, 113, 140, 161, 171, 145, 129, + 115, 178, 158, 161, 160, 118, 195, 209, 221, 228, + 99, 83, 140, 134, 140, 127, 186, 168, 187, 187, + 107, 114, 100, 111, 111, 104, 130, 131, 116, 128, + 128, 104, 64, 18, 49, 126, 107, 69, 56, 153, + 154, 142, 110, 113, 89, 120, 93, 73, 190, 172, + 119, 96, 57, 21, 60, 126, 122, 81, 99, 117, + 159, 141, 108, 88, 120, 144, 125, 89, 44, 94, + 147, 131, 93, 81, 61, 133, 113, 85, 47, 62, + 123, 121, 87, 53, 90, 120, 94, 76, 70, 48, + 125, 103, 93, 64, 35, 140, 129, 88, 47, 30, + 127, 104, 58, 51, 103, 124, 100, 102, 76, 47, + 115, 87, 54, 46, 77, 182, 218, 174, 163, 145, + 140, 126, 89, 105, 82, 125, 119, 101, 69, 58, + 125, 107, 172, 145, 128, 138, 113, 109, 92, 90, + 117, 93, 83, 93, 132, 125, 102, 67, 148, 161, + 131, 110, 96, 99, 74, 119, 92, 54, 84, 81, + 110, 152, 120, 106, 131, 108, 74, 68, 99, 107, + 121, 97, 120, 101, 78, 132, 110, 127, 164, 134, + 111, 159, 204, 189, 178, 158, 183, 146, 144, 137, + 123, 106, 136, 108, 135, 117, 91, 163, 135, 113, + 119, 177, 134, 122, 121, 132, 109, 157, 131, 113, + 115, 87, 87, 100, 92, 120, 95, 59, 146, 139, + 129, 101, 135, 122, 101, 119, 100, 112, 88, 99, + 118, 90, 123, 125, 107, 121, 98, 73, 104, 80, + 112, 79, 86, 122, 96, 104, 81, 107, 90, 93, + 112, 150, 140, 109, 115, 113, 86, 73, 76, 112, + 130, 111, 101, 112, 84, 123, 97, 63, 134, 115, + 109, 77, 128, 141, 119, 125, 101, 108, 147, 119, + 134, 149, 150, 127, 115, 136, 244, 220, 210, 189, + 105, 138, 171, 156, 174, 117, 162, 133, 146, 141, + 115, 93, 119, 98, 122, 114, 106, 154, 145, 162, + 107, 131, 189, 165, 152, 101, 107, 129, 114, 139, + 116, 186, 186, 161, 180, 100, 89, 137, 116, 116, + 106, 130, 194, 196, 207, 110, 156, 157, 138, 149, + 102, 93, 159, 138, 120, 109, 132, 105, 122, 135, + 148, 128, 85, 76, 102, 168, 154, 141, 117, 100, + 125, 106, 62, 101, 146, 124, 102, 65, 25, 15, + 120, 94, 46, 21, 94, 149, 128, 115, 85, 92, + 119, 93, 70, 52, 30, 162, 151, 123, 91, 80, + 126, 112, 84, 47, 33, 138, 114, 73, 60, 87, + 126, 211, 174, 158, 143, 129, 106, 65, 31, 133, + 119, 95, 52, 99, 173, 123, 96, 119, 206, 178, + 127, 104, 60, 61, 67, 152, 136, 104, 63, 83, + 133, 130, 92, 64, 45, 120, 96, 53, 30, 130, + 128, 103, 74, 59, 35, 135, 114, 77, 30, 57, + 108, 130, 123, 90, 87, 143, 125, 93, 54, 60, + 133, 118, 79, 87, 95, 115, 89, 111, 88, 65, + 124, 102, 70, 40, 47, 148, 131, 123, 130, 104, + 127, 109, 87, 56, 121, 147, 123, 121, 107, 85, + 178, 237, 200, 193, 170, 139, 118, 100, 75, 110, + 133, 121, 81, 73, 68, 120, 195, 157, 141, 131, + 127, 102, 107, 88, 60, 136, 113, 100, 69, 45, + 128, 105, 93, 77, 67, 131, 116, 149, 184, 156, + 115, 85, 35, 45, 112, 128, 108, 68, 73, 111, + 118, 93, 187, 162, 139, 136, 115, 84, 57, 37, + 131, 133, 125, 98, 85, 138, 115, 92, 86, 61, + 116, 96, 70, 52, 110, 115, 109, 135, 104, 88, + 136, 159, 122, 109, 115, 122, 110, 98, 70, 95, + 112, 81, 68, 85, 90, 124, 101, 87, 56, 89, + 109, 82, 98, 100, 115, 124, 102, 76, 88, 63, + 111, 78, 42, 78, 102, 110, 71, 64, 131, 111, + 125, 104, 107, 87, 123, 129, 131, 99, 85, 68, + 147, 137, 102, 99, 75, 120, 155, 142, 109, 91, + 132, 109, 131, 141, 113, 136, 119, 94, 152, 128, + 127, 102, 79, 159, 134, 111, 78, 98, 109, 80, + 115, 86, 51, 63, 103, 116, 86, 170, 149, 123, + 135, 178, 159, 125, 114, 113, 189, 226, 203, 202, + 140, 117, 116, 94, 70, 128, 103, 94, 174, 149, + 118, 98, 83, 84, 106, 115, 157, 120, 94, 95, + 131, 112, 75, 96, 74, 121, 97, 144, 117, 95, + 120, 90, 140, 138, 110, 119, 93, 55, 92, 114, + 114, 87, 151, 125, 100, 111, 82, 83, 160, 139, + 114, 86, 56, 90, 138, 104, 109, 101, 77, 118, + 140, 142, 143, 148, 126, 121, 102, 129, 107, 111, + 113, 79, 58, 111, 91, 120, 94, 63, 115, 98, + 121, 94, 99, 97, 78, 120, 92, 68, 173, 148, + 122, 114, 109, 87, 82, 132, 229, 192, 176, 155, + 137, 116, 123, 97, 115, 132, 115, 86, 120, 95, + 135, 116, 101, 136, 108, 109, 74, 100, 125, 115, + 112, 158, 144, 124, 134, 114, 83, 73, 147, 120, + 120, 104, 150, 122, 116, 110, 104, 192, 183, 174, + 134, 112, 116, 120, 93, 121, 101, 93, 110, 90, + 121, 93, 147, 152, 122, 115, 153, 171, 161, 142, + 123, 95, 116, 114, 93, 113, 89, 96, 77, 93, + 113, 174, 180, 143, 138, 116, 86, 100, 135, 106, + 103, 121, 149, 115, 103, 121, 95, 82, 149, 121, + 117, 92, 93, 111, 114, 123, 209, 196, 193, 183, + 125, 102, 107, 130, 104, 115, 91, 113, 103, 99, + 114, 86, 68, 108, 110, 111, 159, 162, 125, 113, + 125, 235, 234, 225, 214, 99, 74, 118, 121, 127, + 104, 123, 158, 128, 127, 113, 96, 116, 136, 158, + 100, 80, 138, 155, 166, 118, 143, 115, 125, 114, + 119, 137, 133, 136, 139, 151, 188, 172, 174, 173, + 138, 161, 158, 158, 155, 121, 198, 194, 211, 202, + 100, 90, 112, 110, 122, 100, 91, 122, 128, 135, + 101, 109, 127, 101, 114, 105, 126, 160, 147, 143, + 109, 138, 142, 158, 163, 113, 174, 185, 188, 206, + 112, 154, 166, 176, 183, 101, 108, 140, 140, 143, + 106, 135, 130, 137, 126, 103, 114, 115, 128, 126, + 107, 86, 21, 115, 75, 117, 139, 97, 65, 105, + 64, 191, 101, 106, 139, 107, 98, 218, 132, 104, + 73, 136, 165, 84, 118, 150, 111, 58, 130, 107, + 99, 136, 132, 56, 52, 102, 136, 69, 78, 163, + 85, 173, 148, 138, 85, 69, 106, 128, 133, 155, + 104, 91, 149, 56, 104, 103, 101, 172, 96, 57, + 104, 97, 125, 197, 166, 107, 169, 47, 120, 103, + 150, 89, 99, 139, 162, 101, 69, 137, 158, 126, + 191, 173, 127, 79, 155, 51, 131, 112, 86, 74, + 135, 61, 114, 81, 125, 117, 112, 72, 175, 72, + 127, 123, 142, 132, 78, 116, 158, 111, 121, 143, + 108, 102, 89, 20, 194, 81, 99, 107, 65, 150, + 103, 78, 91, 69, 96, 104, 116, 116, 103, 105, + 107, 117, 110, 130, 28, 88, 103, 62, 72, 85, + 125, 126, 141, 126, 178, 121, 102, 57, 46, 124, + 97, 91, 89, 138, 95, 98, 143, 99, 169, 123, + 140, 119, 113, 82, 140, 118, 112, 91, 92, 241, + 134, 89, 95, 112, 78, 167, 140, 145, 121, 100, + 109, 205, 144, 91, 100, 113, 103, 142, 175, 95, + 117, 121, 35, 121, 127, 159, 129, 85, 64, 75, + 116, 98, 103, 127, 129, 66, 68, 110, 96, 86, + 79, 100, 156, 133, 92, 135, 96, 164, 132, 121, + 93, 163, 134, 91, 208, 104, 77, 126, 116, 58, + 136, 118, 132, 81, 61, 73, 115, 66, 129, 123, + 111, 85, 42, 178, 134, 108, 132, 159, 45, 157, + 105, 164, 100, 94, 60, 96, 57, 154, 105, 102, + 103, 114, 96, 12, 91, 119, 115, 67, 92, 64, + 94, 61, 106, 106, 165, 105, 94, 98, 68, 30, + 146, 130, 107, 173, 140, 102, 90, 163, 106, 184, + 100, 53, 68, 131, 92, 105, 111, 68, 153, 186, + 101, 82, 48, 99, 147, 122, 136, 176, 96, 96, + 104, 132, 167, 149, 136, 138, 144, 97, 120, 92 +}; + +static const uint8_t wmavoice_dq_lsp16i2[0x3c0] = { + 23, 12, 107, 119, 110, 205, 214, 212, 208, 201, + 102, 95, 69, 117, 107, 118, 123, 118, 123, 121, + 82, 58, 83, 95, 84, 139, 145, 153, 161, 169, + 102, 100, 138, 121, 101, 129, 130, 138, 150, 139, + 76, 104, 86, 112, 133, 113, 91, 63, 73, 129, + 199, 193, 182, 181, 172, 119, 101, 83, 94, 76, + 161, 157, 152, 157, 158, 110, 90, 121, 96, 79, + 124, 107, 114, 88, 73, 152, 137, 121, 107, 99, + 57, 50, 100, 81, 74, 115, 96, 72, 49, 69, + 83, 68, 40, 53, 103, 36, 131, 107, 84, 64, + 236, 245, 242, 231, 213, 95, 109, 88, 69, 110, + 228, 221, 204, 182, 170, 129, 110, 97, 118, 104, + 98, 76, 98, 75, 61, 93, 77, 113, 91, 72, + 116, 94, 106, 134, 118, 177, 188, 169, 162, 153, + 163, 149, 131, 131, 132, 177, 163, 173, 168, 158, + 113, 131, 107, 113, 100, 132, 143, 131, 134, 142, + 45, 36, 121, 113, 102, 43, 95, 84, 67, 56, + 76, 82, 68, 48, 33, 55, 58, 59, 43, 65, + 66, 85, 66, 81, 94, 102, 82, 54, 33, 94, + 113, 111, 89, 60, 34, 138, 120, 101, 101, 86, + 88, 73, 55, 114, 115, 92, 74, 93, 77, 123, + 90, 117, 99, 79, 59, 97, 75, 97, 122, 104, + 233, 237, 227, 208, 190, 209, 230, 233, 240, 241, + 195, 197, 188, 167, 147, 204, 185, 168, 162, 157, + 142, 124, 119, 123, 106, 117, 110, 81, 121, 123, + 74, 116, 124, 119, 120, 178, 168, 146, 132, 125, + 102, 104, 105, 110, 114, 104, 82, 78, 100, 86, + 120, 102, 105, 93, 143, 127, 108, 128, 106, 88, + 177, 189, 203, 207, 215, 101, 131, 119, 95, 73, + 149, 139, 135, 147, 153, 160, 167, 165, 174, 177, + 120, 109, 134, 140, 145, 131, 130, 142, 139, 161, + 143, 158, 148, 145, 145, 123, 142, 132, 116, 102, + 40, 23, 79, 82, 84, 26, 83, 141, 130, 122, + 65, 46, 43, 89, 86, 28, 75, 80, 79, 98, + 84, 65, 47, 26, 44, 49, 112, 101, 100, 94, + 88, 76, 75, 48, 82, 104, 100, 75, 45, 15, + 99, 83, 63, 34, 30, 66, 55, 94, 118, 113, + 122, 106, 91, 68, 60, 135, 122, 104, 77, 59, + 82, 102, 84, 62, 46, 92, 74, 55, 82, 71, + 145, 134, 118, 93, 75, 79, 62, 83, 65, 55, + 91, 94, 64, 70, 98, 89, 117, 110, 87, 97, + 210, 223, 225, 223, 213, 83, 103, 86, 101, 85, + 126, 106, 81, 79, 105, 216, 219, 217, 199, 179, + 86, 78, 115, 138, 135, 102, 84, 87, 59, 46, + 219, 206, 184, 167, 158, 201, 188, 165, 145, 135, + 87, 113, 142, 152, 155, 190, 170, 153, 149, 146, + 205, 208, 201, 185, 167, 84, 73, 124, 104, 96, + 76, 88, 99, 74, 80, 110, 125, 122, 99, 112, + 108, 84, 70, 130, 137, 161, 152, 136, 119, 105, + 110, 91, 101, 74, 96, 111, 101, 93, 153, 149, + 133, 124, 102, 97, 120, 101, 93, 75, 81, 64, + 111, 94, 107, 79, 58, 188, 206, 215, 221, 232, + 163, 175, 165, 150, 136, 103, 106, 123, 133, 132, + 168, 184, 191, 183, 170, 110, 117, 90, 98, 93, + 104, 87, 122, 98, 127, 129, 110, 127, 113, 125, + 134, 118, 102, 140, 132, 186, 199, 202, 198, 188, + 149, 147, 175, 185, 186, 117, 93, 99, 112, 93, + 107, 138, 138, 129, 128, 96, 129, 104, 118, 134, + 145, 136, 115, 121, 129, 138, 155, 148, 134, 120, + 170, 151, 150, 145, 138, 168, 173, 185, 194, 200, + 144, 159, 172, 168, 156, 121, 121, 138, 173, 168, + 126, 111, 140, 139, 117, 149, 133, 142, 137, 130, + 143, 139, 158, 158, 146, 119, 128, 121, 132, 145, + 122, 136, 159, 153, 141, 133, 133, 130, 129, 126, + 120, 76, 50, 149, 109, 92, 155, 118, 90, 66, + 132, 117, 87, 156, 117, 119, 102, 44, 83, 91, + 109, 73, 106, 84, 29, 55, 130, 112, 81, 241, + 75, 40, 91, 89, 67, 112, 90, 149, 81, 72, + 128, 90, 71, 28, 160, 73, 157, 123, 143, 108, + 63, 88, 70, 81, 97, 75, 111, 149, 113, 96, + 78, 104, 83, 179, 95, 105, 106, 65, 130, 66, + 51, 118, 92, 53, 68, 105, 75, 176, 151, 115, + 94, 75, 68, 95, 220, 103, 125, 105, 43, 95, + 39, 114, 65, 145, 135, 33, 142, 138, 103, 52, + 82, 85, 117, 110, 67, 102, 74, 42, 62, 118, + 144, 121, 82, 57, 102, 67, 75, 44, 129, 96, + 75, 63, 88, 48, 116, 135, 94, 85, 102, 66, + 122, 77, 105, 122, 152, 120, 56, 90, 83, 100, + 90, 128, 63, 80, 103, 126, 117, 103, 80, 193, + 42, 73, 117, 93, 91, 95, 128, 100, 128, 162, + 70, 120, 126, 73, 123, 99, 99, 91, 75, 135, + 81, 125, 111, 77, 13, 94, 78, 85, 187, 157, + 11, 143, 109, 99, 119, 53, 141, 82, 122, 68, + 132, 89, 136, 119, 88, 75, 49, 174, 119, 70, + 138, 121, 108, 78, 52, 104, 90, 96, 93, 93, + 114, 90, 78, 46, 58, 62, 114, 69, 44, 162, + 103, 58, 98, 141, 83, 137, 95, 119, 73, 111, + 81, 46, 126, 111, 123, 107, 117, 122, 121, 54, + 106, 104, 59, 110, 148, 97, 155, 97, 83, 133, + 97, 71, 57, 91, 58, 52, 79, 127, 152, 109, + 96, 92, 145, 107, 149, 102, 61, 125, 61, 170, + 56, 89, 77, 106, 38, 147, 96, 77, 105, 123, + 85, 83, 117, 63, 69, 126, 133, 93, 107, 92, + 77, 115, 95, 111, 103, 61, 87, 103, 98, 155, + 94, 111, 80, 78, 54, 117, 128, 130, 99, 109, + 106, 99, 113, 133, 115, 89, 65, 74, 112, 127 +}; + +static const uint8_t wmavoice_dq_lsp16i3[0x300] = { + 70, 100, 121, 129, 132, 132, 201, 188, 165, 145, 144, 136, + 112, 127, 116, 125, 130, 129, 124, 135, 135, 146, 129, 128, + 162, 158, 144, 151, 135, 129, 103, 86, 111, 113, 112, 122, + 90, 139, 129, 117, 126, 129, 142, 145, 167, 147, 124, 124, + 230, 209, 189, 175, 156, 141, 64, 80, 86, 108, 121, 129, + 44, 79, 115, 113, 115, 128, 133, 106, 79, 109, 125, 127, + 171, 156, 132, 109, 103, 115, 106, 70, 93, 145, 141, 128, + 148, 125, 122, 107, 110, 117, 146, 145, 128, 110, 98, 111, + 237, 212, 185, 156, 139, 133, 84, 55, 26, 77, 114, 127, + 172, 170, 171, 168, 162, 143, 82, 82, 76, 70, 104, 126, + 17, 95, 109, 111, 120, 132, 81, 74, 57, 126, 141, 131, + 110, 127, 162, 148, 129, 123, 177, 172, 155, 151, 145, 134, + 144, 123, 90, 66, 109, 130, 82, 127, 103, 123, 132, 131, + 127, 97, 97, 142, 140, 128, 159, 134, 136, 123, 113, 117, + 131, 140, 154, 169, 158, 134, 96, 109, 150, 122, 105, 120, + 120, 150, 152, 122, 119, 125, 123, 126, 124, 107, 100, 113, + 248, 233, 216, 189, 160, 142, 58, 24, 13, 77, 111, 127, + 183, 189, 182, 157, 140, 131, 96, 83, 59, 43, 73, 119, + 222, 196, 171, 146, 129, 128, 32, 13, 53, 101, 114, 127, + 119, 101, 70, 70, 110, 127, 77, 86, 161, 148, 130, 118, + 199, 183, 170, 167, 156, 141, 30, 115, 142, 133, 131, 130, + 101, 103, 181, 176, 152, 126, 66, 44, 73, 94, 111, 128, + 150, 122, 100, 101, 104, 118, 61, 110, 87, 76, 93, 125, + 190, 170, 150, 134, 135, 129, 112, 89, 63, 123, 141, 132, + 175, 154, 136, 142, 140, 132, 117, 143, 129, 128, 136, 132, + 168, 142, 112, 113, 128, 128, 155, 169, 159, 144, 139, 131, + 61, 136, 144, 124, 112, 123, 86, 81, 104, 121, 129, 130, + 160, 127, 118, 150, 151, 134, 126, 115, 121, 132, 134, 131, + 137, 148, 144, 139, 140, 134, 106, 102, 105, 90, 87, 113, + 134, 129, 128, 121, 121, 123, 153, 151, 129, 139, 142, 134, + 150, 142, 141, 148, 149, 141, 100, 121, 133, 147, 150, 134, + 163, 158, 147, 132, 141, 132, 142, 127, 141, 136, 136, 132, + 232, 218, 205, 189, 169, 146, 243, 224, 201, 171, 147, 138, + 224, 196, 169, 162, 154, 140, 51, 20, 59, 111, 121, 128, + 203, 197, 193, 177, 162, 145, 75, 40, 47, 122, 130, 129, + 102, 77, 47, 83, 121, 129, 111, 108, 84, 56, 63, 114, + 211, 181, 154, 137, 126, 125, 213, 198, 186, 162, 144, 138, + 41, 45, 90, 110, 118, 130, 83, 63, 130, 164, 153, 128, + 195, 167, 142, 123, 113, 119, 19, 42, 105, 113, 120, 132, + 50, 63, 49, 64, 112, 128, 114, 90, 132, 171, 162, 134, + 129, 128, 107, 83, 74, 110, 50, 116, 109, 120, 128, 132, + 94, 59, 73, 111, 117, 126, 197, 170, 166, 153, 138, 132, + 65, 48, 109, 133, 131, 128, 170, 163, 172, 158, 138, 130, + 66, 126, 147, 160, 151, 132, 42, 129, 117, 95, 91, 120, + 97, 165, 164, 142, 133, 125, 163, 142, 114, 88, 97, 122, + 104, 77, 142, 143, 128, 120, 136, 160, 188, 169, 149, 130, + 113, 83, 85, 102, 114, 125, 164, 169, 142, 120, 122, 124, + 98, 152, 132, 105, 92, 117, 42, 71, 125, 155, 151, 137, + 94, 105, 81, 107, 118, 126, 84, 56, 123, 117, 108, 122, + 174, 179, 166, 137, 118, 121, 130, 103, 147, 152, 134, 124, + 148, 127, 94, 117, 144, 134, 129, 106, 102, 95, 106, 118, + 147, 157, 153, 125, 103, 117, 155, 128, 113, 132, 120, 122, + 181, 151, 136, 126, 122, 122, 110, 111, 109, 108, 120, 124, + 97, 130, 103, 89, 107, 124, 179, 158, 158, 142, 131, 128, + 142, 111, 115, 122, 126, 125, 145, 145, 134, 115, 129, 128, + 130, 139, 112, 99, 121, 125, 79, 104, 119, 102, 105, 123, + 116, 121, 136, 125, 126, 127, 124, 100, 122, 119, 111, 119, + 159, 140, 139, 128, 138, 131, 105, 100, 116, 128, 135, 132, + 159, 142, 156, 147, 140, 134, 130, 150, 129, 126, 114, 120, + 138, 124, 146, 131, 109, 119, 93, 115, 125, 131, 125, 129, + 125, 121, 101, 119, 114, 120, 163, 154, 151, 153, 153, 139, + 166, 153, 150, 133, 119, 121, 159, 151, 128, 130, 122, 123, + 147, 154, 144, 133, 128, 127, 129, 131, 134, 140, 148, 138, + 138, 136, 120, 131, 135, 131, 150, 140, 137, 144, 129, 129 +}; + +static const uint8_t wmavoice_dq_lsp10r[0x1400] = { + 128, 128, 129, 129, 130, 130, 131, 130, 129, 129, + 134, 133, 127, 125, 136, 135, 135, 134, 173, 172, + 133, 139, 136, 165, 133, 176, 137, 159, 135, 152, + 147, 161, 147, 152, 149, 156, 146, 146, 140, 136, + 134, 135, 136, 140, 139, 155, 123, 133, 132, 142, + 132, 148, 143, 177, 124, 143, 123, 136, 126, 134, + 126, 125, 125, 124, 129, 128, 123, 123, 133, 133, + 116, 116, 121, 121, 121, 120, 129, 128, 131, 131, + 132, 133, 132, 129, 138, 124, 138, 124, 132, 100, + 135, 94, 149, 111, 152, 115, 150, 128, 141, 133, + 129, 129, 130, 129, 147, 145, 136, 137, 120, 122, + 120, 122, 127, 129, 104, 108, 113, 115, 124, 124, + 140, 139, 147, 145, 132, 130, 184, 177, 201, 196, + 170, 171, 160, 161, 145, 147, 137, 145, 131, 131, + 130, 130, 130, 130, 130, 130, 132, 134, 131, 132, + 131, 133, 141, 144, 142, 149, 84, 93, 103, 104, + 139, 139, 142, 140, 147, 147, 172, 165, 122, 121, + 98, 100, 101, 106, 112, 117, 122, 124, 124, 124, + 134, 133, 133, 133, 146, 142, 147, 145, 156, 156, + 143, 146, 119, 124, 129, 132, 151, 149, 136, 135, + 147, 148, 181, 180, 199, 188, 190, 173, 166, 161, + 147, 142, 153, 149, 154, 146, 150, 146, 138, 134, + 131, 135, 96, 136, 48, 138, 56, 131, 63, 124, + 85, 128, 103, 132, 117, 134, 120, 132, 125, 129, + 131, 130, 129, 128, 129, 128, 163, 168, 117, 120, + 121, 121, 136, 138, 131, 132, 135, 136, 131, 133, + 133, 133, 133, 134, 117, 118, 105, 109, 142, 151, + 144, 159, 131, 138, 121, 126, 123, 123, 121, 124, + 131, 131, 129, 129, 141, 140, 142, 134, 87, 90, + 109, 109, 130, 127, 139, 143, 133, 131, 127, 126, + 134, 135, 134, 136, 97, 98, 130, 132, 134, 137, + 115, 119, 125, 130, 107, 109, 119, 118, 126, 127, + 134, 135, 127, 132, 172, 203, 160, 196, 152, 179, + 152, 172, 148, 168, 153, 172, 145, 156, 137, 140, + 102, 116, 42, 56, 74, 61, 82, 70, 86, 78, + 101, 97, 104, 100, 115, 108, 116, 108, 123, 118, + 149, 143, 166, 129, 168, 96, 142, 95, 135, 98, + 117, 86, 116, 93, 121, 108, 119, 107, 121, 117, + 135, 135, 127, 138, 72, 132, 99, 136, 112, 147, + 120, 152, 136, 155, 138, 146, 140, 142, 134, 139, + 163, 145, 192, 130, 147, 124, 147, 125, 133, 125, + 127, 124, 128, 123, 129, 122, 130, 122, 130, 125, + 130, 137, 135, 180, 124, 133, 130, 129, 132, 133, + 124, 124, 131, 130, 132, 136, 126, 124, 127, 125, + 132, 132, 133, 133, 144, 140, 143, 142, 137, 135, + 143, 138, 152, 149, 221, 219, 158, 161, 143, 141, + 130, 129, 140, 135, 170, 145, 193, 156, 186, 152, + 167, 139, 151, 131, 142, 127, 134, 120, 131, 125, + 135, 133, 141, 125, 199, 109, 137, 126, 134, 123, + 130, 129, 132, 123, 128, 125, 122, 126, 125, 125, + 130, 128, 91, 89, 138, 135, 139, 134, 133, 129, + 132, 130, 125, 128, 136, 135, 129, 127, 126, 126, + 132, 131, 133, 131, 128, 120, 132, 126, 126, 119, + 134, 130, 131, 123, 104, 95, 140, 141, 136, 137, + 133, 133, 133, 134, 117, 98, 74, 49, 112, 111, + 123, 122, 126, 127, 131, 131, 127, 126, 128, 129, + 130, 131, 124, 127, 101, 107, 108, 109, 115, 115, + 100, 99, 130, 128, 134, 136, 125, 127, 128, 130, + 136, 137, 145, 150, 149, 164, 136, 151, 114, 111, + 124, 125, 143, 150, 162, 174, 158, 169, 136, 137, + 131, 131, 131, 131, 132, 133, 111, 110, 122, 121, + 136, 136, 134, 133, 131, 132, 127, 127, 125, 125, + 128, 129, 129, 130, 125, 127, 140, 140, 148, 149, + 133, 136, 146, 153, 110, 118, 127, 129, 128, 129, + 131, 133, 127, 131, 140, 161, 167, 224, 131, 139, + 136, 143, 135, 139, 138, 143, 149, 155, 141, 143, + 134, 132, 120, 111, 83, 83, 121, 126, 102, 107, + 112, 115, 97, 104, 120, 115, 129, 123, 122, 122, + 134, 135, 122, 131, 102, 124, 114, 119, 93, 103, + 78, 79, 67, 72, 66, 73, 78, 82, 103, 102, + 144, 135, 165, 139, 165, 129, 160, 126, 153, 127, + 161, 134, 160, 142, 160, 143, 148, 140, 138, 135, + 138, 95, 147, 54, 143, 78, 140, 112, 142, 113, + 140, 121, 135, 117, 135, 122, 136, 131, 131, 132, + 147, 159, 140, 156, 127, 81, 142, 128, 146, 127, + 144, 125, 146, 128, 149, 130, 144, 135, 133, 128, + 130, 131, 131, 131, 134, 139, 126, 134, 141, 154, + 168, 205, 153, 176, 148, 163, 147, 158, 141, 143, + 131, 135, 126, 146, 108, 157, 107, 156, 119, 146, + 100, 138, 104, 125, 119, 134, 101, 122, 113, 122, + 95, 133, 52, 140, 83, 136, 110, 133, 114, 131, + 123, 131, 133, 131, 138, 135, 132, 132, 127, 127, + 129, 128, 124, 122, 128, 126, 145, 170, 143, 172, + 141, 163, 143, 176, 138, 164, 139, 155, 135, 145, + 135, 136, 136, 127, 132, 76, 128, 76, 127, 63, + 125, 66, 123, 67, 120, 71, 124, 92, 122, 111, + 133, 133, 135, 136, 139, 140, 147, 147, 150, 144, + 156, 147, 150, 145, 154, 146, 120, 123, 123, 124, + 137, 133, 170, 141, 124, 124, 135, 134, 134, 135, + 132, 132, 129, 129, 130, 130, 136, 136, 130, 132, + 147, 159, 135, 158, 115, 146, 120, 148, 117, 136, + 115, 137, 113, 132, 133, 142, 140, 144, 132, 134, + 134, 135, 134, 137, 137, 147, 162, 178, 136, 147, + 134, 144, 123, 132, 111, 113, 113, 113, 124, 124, + 132, 131, 126, 126, 117, 114, 100, 95, 130, 125, + 157, 145, 164, 156, 163, 158, 145, 145, 133, 134, + 134, 134, 127, 126, 113, 102, 136, 130, 124, 122, + 143, 145, 127, 131, 135, 143, 133, 137, 132, 132, + 92, 94, 122, 125, 128, 129, 131, 130, 134, 135, + 132, 128, 129, 127, 132, 132, 131, 129, 127, 127, + 129, 129, 132, 131, 139, 131, 137, 132, 216, 178, + 146, 134, 147, 137, 151, 142, 148, 139, 144, 138, + 128, 127, 129, 129, 123, 131, 71, 91, 126, 128, + 130, 134, 117, 123, 125, 125, 135, 140, 129, 132, + 132, 132, 133, 134, 124, 130, 127, 133, 133, 138, + 142, 149, 135, 141, 145, 149, 154, 164, 135, 138, + 135, 135, 141, 142, 138, 137, 116, 96, 105, 86, + 127, 118, 128, 120, 124, 117, 125, 117, 125, 121, + 131, 131, 132, 134, 144, 145, 112, 112, 121, 123, + 113, 116, 121, 123, 139, 138, 128, 128, 131, 131, + 134, 132, 132, 132, 125, 128, 127, 130, 125, 131, + 120, 128, 90, 119, 68, 98, 99, 112, 115, 124, + 135, 135, 134, 134, 128, 129, 137, 137, 137, 138, + 110, 114, 129, 130, 144, 145, 123, 125, 129, 129, + 132, 133, 129, 130, 168, 187, 140, 149, 137, 144, + 129, 130, 129, 134, 133, 138, 118, 118, 122, 120, + 131, 130, 129, 128, 133, 133, 125, 125, 124, 123, + 181, 179, 129, 129, 131, 127, 139, 136, 130, 128, + 133, 133, 132, 132, 121, 120, 122, 119, 132, 129, + 129, 125, 107, 96, 136, 137, 150, 146, 135, 134, + 131, 131, 130, 130, 126, 123, 126, 123, 128, 125, + 130, 123, 134, 127, 183, 159, 143, 135, 137, 134, + 129, 129, 128, 128, 134, 133, 139, 138, 133, 132, + 129, 127, 154, 151, 150, 144, 146, 146, 141, 142, + 132, 132, 131, 131, 130, 130, 132, 133, 114, 115, + 132, 132, 122, 122, 132, 131, 115, 117, 120, 120, + 129, 129, 130, 130, 130, 129, 130, 131, 129, 131, + 130, 130, 129, 129, 133, 132, 143, 144, 91, 91, + 137, 136, 118, 107, 60, 45, 56, 49, 57, 52, + 60, 56, 71, 75, 77, 80, 92, 97, 106, 106, + 112, 131, 58, 121, 19, 65, 84, 101, 108, 122, + 121, 127, 112, 117, 106, 112, 117, 124, 126, 127, + 130, 129, 138, 133, 166, 155, 192, 179, 192, 177, + 208, 191, 204, 192, 186, 179, 163, 163, 138, 142, + 134, 134, 144, 142, 243, 236, 148, 146, 141, 137, + 145, 141, 151, 144, 147, 143, 135, 139, 134, 133, + 134, 128, 138, 88, 142, 10, 127, 76, 130, 96, + 129, 102, 128, 108, 123, 111, 127, 119, 127, 124, + 136, 136, 139, 139, 142, 140, 246, 241, 158, 167, + 143, 145, 146, 149, 143, 145, 148, 152, 133, 134, + 139, 135, 135, 136, 99, 137, 95, 133, 75, 138, + 67, 135, 73, 128, 83, 132, 96, 126, 115, 127, + 130, 132, 137, 136, 140, 135, 134, 130, 137, 131, + 159, 151, 215, 197, 181, 170, 160, 149, 150, 143, + 145, 148, 186, 207, 141, 147, 135, 137, 122, 122, + 126, 125, 128, 126, 127, 127, 134, 126, 131, 123, + 133, 133, 126, 122, 128, 122, 99, 93, 59, 60, + 82, 82, 106, 107, 119, 123, 124, 128, 128, 129, + 134, 137, 133, 139, 133, 136, 141, 132, 139, 122, + 142, 97, 130, 81, 128, 89, 129, 101, 125, 112, + 137, 140, 129, 148, 101, 159, 118, 180, 122, 178, + 120, 178, 116, 168, 118, 153, 127, 151, 126, 136, + 132, 134, 125, 126, 118, 105, 156, 124, 180, 132, + 163, 124, 148, 121, 131, 112, 127, 115, 125, 122, + 129, 131, 128, 129, 136, 134, 142, 141, 165, 158, + 203, 182, 141, 136, 132, 130, 135, 135, 130, 130, + 133, 133, 132, 132, 127, 126, 106, 105, 112, 110, + 106, 105, 80, 84, 100, 101, 122, 125, 126, 128, + 101, 109, 46, 59, 114, 112, 119, 119, 126, 121, + 129, 124, 128, 125, 125, 122, 123, 120, 125, 122, + 135, 134, 121, 134, 56, 139, 131, 145, 135, 138, + 136, 139, 126, 130, 122, 132, 126, 129, 124, 129, + 153, 169, 146, 179, 138, 139, 151, 143, 148, 138, + 153, 137, 142, 129, 144, 126, 140, 128, 133, 126, + 136, 134, 154, 149, 173, 157, 152, 144, 149, 141, + 137, 136, 127, 121, 123, 121, 121, 126, 120, 123, + 157, 143, 166, 135, 120, 122, 112, 118, 102, 118, + 111, 124, 134, 131, 141, 138, 135, 134, 126, 129, + 140, 123, 152, 76, 131, 116, 138, 136, 126, 134, + 130, 142, 126, 136, 120, 132, 126, 128, 124, 127, + 131, 138, 80, 147, 126, 138, 130, 140, 129, 134, + 133, 135, 131, 132, 126, 127, 127, 125, 125, 123, + 132, 132, 130, 132, 123, 130, 102, 102, 107, 110, + 116, 127, 132, 152, 142, 160, 143, 151, 142, 146, + 132, 132, 132, 132, 125, 126, 132, 140, 158, 199, + 135, 149, 134, 140, 135, 131, 129, 120, 127, 121, + 129, 130, 122, 123, 125, 124, 138, 138, 138, 135, + 140, 141, 101, 94, 105, 98, 121, 122, 127, 128, + 126, 127, 119, 121, 133, 156, 132, 159, 130, 148, + 137, 164, 127, 138, 130, 137, 135, 140, 126, 126, + 128, 129, 129, 129, 126, 124, 130, 128, 143, 138, + 149, 143, 185, 170, 129, 127, 138, 133, 138, 135, + 132, 134, 137, 144, 139, 183, 131, 145, 127, 128, + 128, 127, 128, 122, 129, 125, 145, 139, 135, 131, + 132, 133, 132, 130, 152, 96, 159, 85, 150, 105, + 154, 115, 143, 120, 138, 126, 134, 124, 130, 126, + 128, 127, 121, 123, 122, 123, 116, 125, 84, 87, + 133, 135, 129, 131, 123, 126, 133, 135, 131, 130, + 136, 134, 129, 119, 79, 63, 116, 116, 136, 133, + 133, 130, 140, 143, 127, 127, 124, 125, 127, 128, + 128, 126, 124, 120, 139, 128, 153, 134, 151, 134, + 174, 145, 159, 136, 165, 144, 171, 149, 143, 135, + 134, 134, 133, 133, 121, 119, 177, 162, 166, 154, + 127, 130, 132, 132, 136, 137, 142, 143, 138, 137, + 167, 151, 162, 142, 128, 136, 142, 148, 128, 143, + 145, 153, 140, 149, 132, 141, 128, 139, 127, 133, + 156, 169, 131, 129, 126, 120, 127, 125, 129, 120, + 131, 126, 126, 123, 124, 121, 122, 121, 123, 123, + 138, 140, 149, 156, 145, 152, 105, 102, 131, 126, + 151, 146, 147, 139, 144, 137, 143, 133, 135, 130, + 132, 130, 131, 129, 126, 130, 126, 129, 110, 135, + 115, 139, 108, 146, 105, 147, 121, 134, 124, 133, + 137, 137, 135, 134, 143, 142, 146, 146, 120, 121, + 139, 137, 133, 129, 149, 145, 139, 133, 130, 127, + 134, 134, 134, 134, 125, 124, 117, 119, 120, 113, + 84, 80, 122, 125, 108, 112, 97, 102, 118, 120, + 124, 123, 115, 116, 110, 111, 98, 97, 127, 124, + 129, 127, 120, 117, 114, 109, 106, 104, 116, 116, + 138, 138, 139, 141, 142, 146, 127, 125, 133, 130, + 134, 128, 134, 127, 116, 91, 105, 84, 114, 106, + 128, 128, 126, 126, 131, 137, 126, 129, 133, 139, + 134, 145, 132, 143, 150, 192, 131, 142, 138, 141, + 132, 130, 132, 130, 149, 138, 196, 152, 137, 125, + 134, 125, 139, 128, 133, 125, 141, 134, 134, 135, + 134, 135, 134, 135, 131, 130, 136, 133, 110, 106, + 142, 144, 153, 162, 131, 129, 134, 132, 131, 130, + 126, 125, 132, 130, 168, 153, 126, 124, 130, 126, + 140, 135, 140, 134, 138, 133, 145, 137, 135, 134, + 130, 130, 132, 131, 133, 132, 129, 129, 125, 128, + 128, 130, 133, 139, 143, 152, 193, 215, 152, 160, + 130, 131, 129, 131, 130, 131, 135, 136, 136, 141, + 83, 81, 121, 120, 136, 130, 150, 145, 147, 145, + 134, 133, 135, 133, 146, 142, 135, 131, 127, 128, + 134, 135, 93, 102, 126, 132, 131, 133, 127, 129, + 124, 125, 120, 122, 103, 106, 128, 129, 139, 138, + 127, 128, 134, 134, 143, 138, 139, 134, 135, 133, + 131, 130, 133, 131, 139, 134, 138, 136, 166, 156, + 119, 116, 121, 122, 126, 124, 116, 117, 123, 124, + 131, 131, 129, 129, 130, 128, 141, 138, 135, 132, + 154, 145, 137, 129, 131, 125, 146, 137, 138, 135, + 131, 131, 131, 132, 129, 130, 134, 138, 111, 116, + 113, 118, 123, 125, 122, 124, 143, 147, 138, 140, + 116, 113, 114, 112, 130, 126, 117, 115, 127, 126, + 139, 137, 141, 139, 131, 132, 143, 144, 139, 140, + 130, 130, 129, 128, 136, 134, 119, 117, 152, 143, + 155, 143, 120, 119, 142, 139, 124, 130, 126, 128, + 112, 110, 112, 109, 136, 132, 125, 118, 121, 115, + 103, 101, 109, 100, 125, 120, 121, 117, 122, 121, + 128, 128, 127, 127, 124, 124, 128, 127, 131, 129, + 142, 138, 147, 141, 115, 108, 113, 109, 122, 119, + 136, 133, 150, 139, 142, 131, 119, 111, 151, 137, + 121, 116, 146, 134, 137, 129, 121, 123, 127, 129, + 130, 130, 130, 130, 136, 137, 126, 126, 136, 136, + 133, 133, 139, 139, 142, 143, 119, 120, 134, 134, + 132, 132, 133, 133, 135, 138, 129, 131, 133, 134, + 135, 138, 126, 130, 117, 118, 131, 132, 135, 135, + 129, 129, 128, 128, 126, 129, 127, 129, 123, 125, + 115, 117, 156, 157, 127, 131, 129, 129, 128, 129, + 129, 130, 131, 131, 126, 127, 135, 134, 136, 135, + 140, 136, 117, 113, 132, 128, 104, 97, 109, 106, + 131, 131, 131, 131, 121, 123, 124, 125, 126, 127, + 127, 127, 135, 135, 128, 128, 130, 130, 141, 140, + 129, 129, 129, 129, 129, 127, 127, 125, 149, 146, + 125, 123, 134, 133, 134, 132, 152, 150, 138, 138, + 128, 128, 126, 125, 132, 133, 141, 143, 136, 136, + 126, 127, 126, 127, 129, 131, 128, 129, 135, 134, + 176, 139, 192, 135, 145, 122, 149, 117, 155, 134, + 169, 133, 157, 139, 142, 136, 151, 152, 142, 147, + 166, 174, 103, 107, 141, 134, 140, 136, 144, 135, + 147, 135, 156, 131, 153, 127, 133, 126, 130, 124, + 127, 130, 123, 124, 114, 105, 195, 193, 156, 157, + 165, 158, 126, 122, 149, 141, 174, 173, 152, 147, + 136, 139, 131, 138, 163, 169, 103, 124, 80, 102, + 153, 186, 121, 151, 134, 161, 156, 190, 141, 151, + 121, 123, 124, 127, 119, 127, 133, 134, 157, 156, + 81, 69, 136, 134, 160, 169, 118, 114, 135, 128, + 114, 116, 97, 97, 117, 122, 152, 161, 115, 121, + 106, 122, 135, 137, 111, 113, 125, 135, 141, 145, + 143, 146, 143, 150, 132, 136, 142, 150, 151, 167, + 101, 107, 155, 173, 112, 124, 105, 100, 128, 126, + 127, 130, 133, 134, 142, 121, 131, 116, 176, 145, + 161, 120, 209, 150, 196, 133, 147, 115, 149, 130, + 144, 145, 144, 145, 120, 119, 163, 160, 117, 118, + 123, 117, 154, 119, 193, 98, 149, 101, 137, 116, + 133, 135, 140, 143, 144, 156, 131, 146, 186, 201, + 140, 139, 123, 125, 158, 169, 157, 166, 142, 143, + 130, 131, 132, 132, 128, 128, 141, 142, 147, 149, + 145, 148, 137, 139, 129, 129, 107, 108, 157, 157, + 120, 121, 119, 119, 140, 132, 137, 131, 118, 113, + 143, 136, 134, 135, 164, 158, 133, 125, 127, 124, + 148, 122, 197, 130, 173, 145, 110, 139, 123, 165, + 83, 158, 90, 167, 93, 142, 136, 169, 134, 152, + 130, 126, 154, 138, 227, 150, 156, 114, 147, 114, + 142, 109, 135, 110, 166, 135, 176, 150, 152, 142, + 132, 132, 136, 136, 130, 135, 143, 152, 136, 144, + 152, 160, 177, 185, 112, 112, 165, 166, 160, 161, + 145, 145, 138, 139, 116, 118, 127, 131, 66, 80, + 132, 142, 119, 127, 101, 108, 120, 130, 126, 130, + 135, 135, 142, 139, 153, 137, 55, 30, 142, 139, + 139, 143, 135, 133, 129, 133, 109, 108, 129, 129, + 136, 135, 134, 131, 129, 132, 132, 134, 135, 149, + 79, 206, 123, 137, 135, 143, 130, 140, 131, 134, + 100, 99, 165, 164, 142, 123, 148, 133, 133, 122, + 142, 133, 138, 125, 119, 111, 129, 123, 137, 130, + 131, 132, 123, 129, 174, 185, 196, 181, 127, 111, + 156, 141, 132, 114, 129, 106, 132, 107, 126, 117, + 134, 140, 131, 136, 119, 146, 92, 246, 128, 132, + 125, 129, 132, 140, 128, 141, 126, 145, 137, 142, + 130, 130, 110, 115, 124, 139, 127, 151, 118, 152, + 98, 146, 36, 108, 126, 158, 112, 146, 112, 130, + 138, 136, 145, 138, 153, 145, 116, 125, 90, 103, + 137, 138, 189, 185, 141, 151, 86, 93, 111, 111, + 133, 171, 125, 209, 140, 132, 130, 134, 129, 101, + 142, 120, 142, 132, 135, 126, 141, 140, 140, 134, + 128, 123, 131, 123, 138, 118, 163, 133, 240, 197, + 176, 151, 126, 123, 81, 94, 109, 118, 124, 133, + 135, 133, 137, 134, 154, 135, 140, 155, 69, 190, + 119, 149, 141, 151, 142, 123, 135, 125, 129, 130, + 127, 125, 132, 127, 107, 80, 123, 103, 145, 131, + 133, 107, 140, 103, 135, 106, 170, 145, 159, 143, + 136, 137, 127, 130, 105, 119, 129, 134, 141, 151, + 116, 127, 119, 140, 75, 119, 152, 162, 149, 152, + 72, 138, 9, 143, 118, 160, 126, 134, 141, 147, + 135, 131, 129, 129, 135, 129, 136, 126, 133, 125, + 137, 135, 146, 141, 145, 139, 141, 140, 133, 130, + 213, 208, 139, 130, 139, 136, 117, 117, 126, 125, + 133, 130, 138, 131, 141, 100, 145, 93, 159, 121, + 144, 132, 117, 160, 102, 187, 99, 162, 117, 144, + 132, 132, 134, 134, 140, 141, 127, 126, 128, 131, + 116, 116, 121, 127, 119, 126, 114, 114, 99, 100, + 141, 144, 148, 159, 179, 224, 95, 131, 100, 125, + 87, 110, 112, 132, 134, 147, 111, 125, 122, 122, + 137, 140, 141, 129, 169, 12, 144, 132, 133, 144, + 141, 146, 137, 147, 136, 122, 133, 130, 131, 128, + 141, 142, 128, 139, 15, 69, 160, 159, 142, 130, + 137, 126, 159, 141, 145, 143, 128, 125, 134, 128, + 131, 130, 127, 127, 114, 104, 119, 98, 83, 68, + 139, 120, 173, 142, 199, 154, 191, 153, 158, 145, + 128, 130, 127, 127, 148, 150, 110, 99, 119, 109, + 120, 113, 163, 154, 110, 90, 138, 129, 149, 144, + 131, 134, 124, 142, 76, 217, 130, 129, 140, 138, + 133, 135, 145, 150, 136, 138, 127, 130, 130, 134, + 144, 119, 178, 70, 143, 130, 115, 136, 139, 138, + 129, 109, 136, 116, 147, 122, 126, 112, 126, 123, + 132, 139, 128, 144, 107, 156, 75, 163, 120, 164, + 151, 136, 151, 99, 160, 112, 159, 126, 143, 126, + 140, 138, 137, 135, 152, 108, 251, 85, 138, 116, + 137, 118, 141, 119, 136, 121, 150, 134, 138, 131, + 137, 137, 143, 144, 150, 153, 148, 154, 152, 151, + 117, 104, 124, 96, 93, 67, 146, 138, 149, 148, + 149, 153, 172, 193, 108, 114, 125, 128, 145, 165, + 149, 160, 121, 130, 115, 120, 110, 112, 121, 118, + 145, 146, 141, 142, 127, 127, 103, 95, 138, 143, + 114, 126, 109, 115, 143, 136, 153, 149, 144, 142, + 140, 138, 150, 144, 128, 116, 142, 136, 135, 122, + 93, 88, 164, 163, 141, 142, 171, 182, 154, 160, + 124, 125, 122, 123, 158, 155, 111, 97, 138, 130, + 157, 134, 101, 65, 129, 118, 121, 114, 124, 119, + 131, 133, 125, 129, 136, 147, 135, 152, 131, 133, + 110, 115, 118, 114, 161, 159, 233, 218, 172, 166, + 140, 107, 125, 0, 140, 103, 140, 115, 125, 113, + 132, 135, 128, 133, 138, 146, 131, 145, 127, 133, + 131, 131, 122, 122, 135, 132, 126, 124, 132, 133, + 164, 167, 121, 127, 117, 120, 167, 162, 145, 143, + 135, 134, 136, 134, 156, 146, 195, 177, 127, 139, + 108, 140, 141, 173, 141, 178, 131, 155, 129, 141, + 134, 134, 119, 114, 184, 184, 127, 126, 147, 151, + 130, 140, 146, 159, 134, 145, 131, 136, 137, 142, + 135, 137, 128, 136, 83, 108, 97, 98, 152, 119, + 207, 144, 142, 121, 144, 129, 131, 127, 130, 132, + 124, 125, 108, 107, 94, 116, 81, 114, 139, 173, + 131, 158, 145, 177, 141, 163, 136, 140, 143, 144, + 135, 141, 132, 136, 134, 142, 142, 136, 173, 50, + 143, 106, 142, 127, 134, 139, 127, 133, 125, 125, + 129, 130, 131, 133, 132, 148, 110, 138, 113, 135, + 138, 175, 108, 151, 55, 119, 51, 100, 93, 116, + 121, 121, 146, 151, 99, 120, 127, 137, 107, 122, + 125, 139, 110, 132, 135, 156, 141, 156, 148, 157, + 137, 137, 141, 140, 139, 137, 130, 128, 138, 136, + 132, 134, 115, 110, 177, 179, 81, 86, 100, 98, + 84, 83, 121, 121, 148, 157, 127, 133, 146, 156, + 127, 136, 143, 151, 135, 139, 138, 142, 136, 136, + 201, 164, 151, 129, 123, 136, 147, 148, 127, 142, + 128, 143, 101, 126, 119, 133, 114, 131, 116, 126, + 132, 133, 140, 140, 126, 125, 156, 153, 142, 129, + 140, 130, 77, 69, 134, 132, 146, 148, 135, 136, + 133, 132, 123, 116, 116, 103, 150, 135, 144, 127, + 130, 117, 136, 122, 122, 106, 48, 38, 81, 78, + 145, 146, 135, 136, 123, 122, 126, 133, 133, 138, + 145, 145, 144, 150, 160, 181, 142, 139, 150, 150, + 136, 136, 139, 139, 133, 133, 139, 135, 134, 129, + 140, 137, 153, 145, 132, 131, 151, 144, 68, 66, + 137, 137, 139, 139, 146, 146, 142, 139, 129, 128, + 131, 129, 133, 132, 135, 134, 135, 134, 201, 200, + 137, 136, 146, 143, 155, 153, 157, 158, 131, 138, + 140, 139, 143, 144, 128, 123, 216, 192, 159, 150, + 137, 138, 136, 142, 145, 148, 126, 162, 140, 170, + 186, 95, 131, 140, 143, 148, 133, 128, 130, 133, + 141, 139, 153, 150, 122, 122, 134, 144, 124, 130, + 159, 166, 133, 139, 151, 150, 138, 139, 131, 134, + 121, 121, 131, 129, 148, 180, 121, 135, 118, 131, + 124, 148, 119, 119, 129, 126, 150, 156, 155, 160, + 40, 154, 115, 157, 133, 129, 140, 133, 143, 133, + 143, 132, 144, 130, 141, 131, 134, 130, 137, 133, + 134, 136, 141, 140, 145, 137, 152, 124, 183, 91, + 118, 154, 123, 158, 136, 134, 140, 142, 138, 142, + 138, 135, 131, 131, 138, 129, 121, 128, 146, 219, + 124, 123, 125, 135, 120, 126, 127, 141, 133, 136, + 127, 124, 120, 107, 152, 125, 149, 108, 158, 144, + 196, 185, 174, 164, 151, 149, 138, 131, 140, 137, + 149, 148, 144, 145, 143, 145, 140, 143, 141, 147, + 112, 125, 113, 113, 149, 155, 143, 149, 146, 151, + 138, 138, 141, 138, 144, 129, 134, 125, 143, 140, + 153, 154, 142, 123, 162, 42, 154, 106, 153, 130, + 153, 153, 137, 137, 144, 144, 142, 140, 165, 151, + 161, 140, 144, 134, 156, 124, 167, 143, 166, 155, + 132, 132, 137, 138, 137, 132, 124, 127, 140, 144, + 134, 140, 162, 180, 127, 131, 152, 169, 145, 156, + 133, 134, 131, 133, 130, 132, 147, 149, 125, 117, + 127, 118, 159, 155, 147, 142, 122, 117, 145, 144, + 138, 137, 130, 133, 113, 149, 168, 224, 166, 201, + 129, 151, 147, 154, 136, 135, 140, 136, 152, 141, + 120, 112, 140, 127, 161, 100, 132, 115, 118, 125, + 115, 133, 115, 157, 144, 146, 114, 135, 127, 139, + 138, 141, 135, 135, 137, 136, 147, 142, 143, 144, + 139, 152, 142, 136, 147, 143, 177, 39, 125, 71, + 147, 143, 66, 88, 132, 158, 123, 126, 116, 135, + 119, 124, 128, 135, 133, 140, 137, 126, 137, 130, + 155, 38, 149, 103, 130, 135, 139, 143, 127, 137, + 135, 141, 138, 148, 131, 148, 136, 147, 132, 139, + 136, 140, 115, 129, 115, 151, 136, 160, 87, 131, + 157, 176, 150, 164, 140, 141, 135, 119, 137, 133, + 141, 140, 140, 139, 134, 134, 142, 144, 131, 132, + 131, 134, 131, 132, 116, 114, 129, 133, 205, 207, + 130, 133, 160, 170, 137, 127, 124, 112, 158, 146, + 155, 137, 134, 136, 137, 142, 177, 184, 149, 152, + 135, 134, 133, 132, 135, 129, 144, 136, 139, 134, + 161, 155, 126, 109, 215, 186, 177, 153, 160, 149, + 139, 139, 136, 140, 140, 142, 186, 71, 129, 144, + 131, 165, 142, 152, 140, 151, 141, 143, 137, 139, + 144, 138, 150, 135, 133, 126, 136, 143, 99, 152, + 139, 131, 190, 118, 122, 147, 134, 155, 136, 143, + 138, 135, 137, 132, 147, 144, 150, 144, 138, 134, + 129, 133, 130, 138, 56, 175, 129, 166, 147, 165, + 140, 138, 144, 137, 141, 133, 150, 139, 129, 135, + 40, 83, 126, 130, 110, 120, 100, 110, 126, 128, + 141, 142, 217, 175, 172, 151, 146, 153, 125, 132, + 128, 137, 141, 141, 145, 145, 140, 133, 132, 131, + 129, 144, 128, 177, 133, 195, 147, 120, 138, 131, + 161, 114, 166, 134, 162, 118, 161, 115, 155, 129, + 137, 136, 141, 129, 141, 132, 55, 168, 121, 126, + 136, 139, 120, 133, 149, 147, 132, 141, 131, 136, + 147, 150, 151, 132, 101, 31, 117, 101, 129, 132, + 122, 138, 128, 137, 140, 170, 131, 143, 131, 134, + 149, 192, 122, 158, 136, 146, 133, 166, 143, 141, + 141, 136, 141, 129, 125, 155, 140, 138, 137, 131, + 111, 112, 131, 132, 120, 127, 149, 148, 151, 141, + 156, 148, 133, 129, 127, 124, 144, 137, 142, 139, + 134, 133, 141, 138, 133, 135, 124, 96, 226, 152, + 116, 108, 128, 105, 155, 130, 153, 138, 144, 139, + 142, 141, 137, 135, 142, 143, 156, 162, 136, 89, + 188, 145, 181, 152, 138, 146, 146, 154, 145, 149, + 152, 133, 158, 133, 42, 153, 117, 144, 149, 139, + 125, 139, 134, 128, 150, 128, 143, 125, 135, 132, + 143, 141, 143, 141, 164, 173, 141, 142, 156, 155, + 154, 154, 169, 170, 77, 80, 112, 105, 135, 134, + 126, 143, 120, 172, 111, 144, 120, 154, 107, 153, + 95, 134, 104, 134, 128, 116, 163, 131, 151, 136, + 135, 133, 142, 143, 152, 204, 149, 112, 156, 128, + 150, 126, 127, 129, 139, 175, 143, 141, 138, 135, + 168, 148, 152, 105, 164, 121, 134, 122, 119, 109, + 122, 148, 136, 143, 153, 132, 158, 148, 149, 150, + 133, 131, 142, 141, 150, 149, 156, 173, 138, 155, + 129, 144, 111, 107, 130, 129, 96, 89, 106, 104, + 135, 135, 144, 146, 131, 153, 134, 154, 146, 166, + 117, 138, 163, 187, 190, 216, 149, 156, 149, 152, + 142, 142, 153, 154, 109, 145, 40, 102, 116, 126, + 137, 139, 149, 157, 108, 124, 139, 146, 142, 147, + 130, 126, 120, 111, 172, 146, 169, 136, 150, 135, + 126, 96, 159, 143, 150, 122, 162, 129, 156, 142, + 135, 142, 144, 138, 222, 109, 137, 145, 144, 142, + 141, 143, 138, 136, 124, 150, 133, 144, 137, 145, + 141, 144, 139, 144, 134, 154, 114, 136, 145, 173, + 151, 215, 110, 115, 127, 134, 145, 150, 145, 144, + 144, 142, 139, 131, 147, 132, 141, 119, 143, 106, + 165, 41, 147, 129, 129, 144, 138, 135, 138, 140, + 128, 150, 89, 163, 154, 115, 141, 127, 132, 145, + 135, 157, 143, 145, 140, 141, 127, 135, 127, 129, + 142, 147, 116, 147, 104, 162, 153, 143, 146, 130, + 144, 110, 133, 123, 130, 137, 118, 198, 126, 152, + 154, 146, 139, 127, 147, 112, 207, 151, 156, 136, + 162, 137, 108, 121, 130, 135, 125, 131, 131, 134, + 134, 134, 141, 144, 107, 143, 137, 144, 124, 136, + 115, 147, 130, 157, 119, 167, 71, 144, 97, 128, + 134, 138, 132, 133, 138, 138, 146, 146, 147, 131, + 141, 138, 185, 65, 145, 123, 139, 130, 142, 128, + 139, 136, 157, 147, 124, 119, 164, 148, 170, 154, + 133, 130, 157, 148, 140, 141, 130, 135, 134, 137, + 136, 137, 143, 144, 144, 144, 178, 186, 71, 73, + 120, 118, 127, 124, 152, 151, 155, 146, 141, 138, + 142, 143, 139, 143, 133, 134, 139, 140, 138, 135, + 146, 141, 78, 198, 129, 139, 141, 141, 134, 141, + 137, 136, 120, 120, 124, 118, 143, 148, 148, 152, + 131, 143, 129, 137, 152, 158, 157, 160, 175, 178, + 137, 139, 131, 133, 146, 152, 121, 147, 142, 143, + 129, 136, 149, 145, 197, 114, 103, 141, 124, 140, + 141, 140, 129, 129, 127, 130, 131, 124, 123, 117, + 150, 139, 120, 109, 119, 120, 163, 163, 117, 121, + 139, 139, 136, 136, 94, 74, 150, 145, 126, 127, + 147, 150, 158, 162, 84, 74, 136, 129, 140, 132, + 136, 135, 146, 145, 124, 116, 129, 120, 130, 129, + 130, 109, 122, 111, 160, 141, 135, 113, 131, 121, + 136, 135, 135, 135, 147, 147, 140, 140, 144, 145, + 139, 142, 131, 137, 145, 145, 143, 153, 48, 49, + 145, 143, 151, 147, 158, 146, 135, 124, 124, 116, + 159, 140, 131, 126, 123, 120, 103, 117, 113, 119, + 148, 146, 128, 124, 123, 126, 123, 120, 158, 141, + 148, 137, 146, 143, 125, 143, 89, 107, 116, 123, + 149, 147, 141, 139, 149, 153, 118, 121, 139, 138, + 105, 119, 168, 147, 139, 141, 143, 138, 133, 130, + 126, 126, 143, 142, 146, 144, 124, 123, 143, 145, + 149, 148, 147, 141, 151, 143, 118, 113, 175, 171 +}; + +static const uint8_t wmavoice_dq_lsp16r1[0x500] = { + 147, 145, 193, 168, 188, 156, 141, 145, 141, 139, + 148, 149, 148, 149, 153, 157, 144, 144, 152, 152, + 141, 145, 153, 143, 243, 134, 151, 133, 166, 135, + 150, 149, 135, 132, 32, 39, 110, 111, 109, 114, + 126, 127, 147, 146, 177, 169, 162, 156, 210, 187, + 141, 147, 95, 150, 127, 155, 108, 133, 139, 148, + 138, 138, 140, 140, 147, 146, 134, 130, 136, 134, + 147, 146, 142, 150, 62, 174, 126, 151, 122, 156, + 154, 156, 179, 184, 115, 107, 105, 99, 127, 124, + 146, 131, 140, 44, 132, 125, 156, 146, 153, 153, + 136, 137, 145, 144, 141, 139, 158, 152, 138, 132, + 145, 145, 147, 145, 146, 141, 144, 140, 110, 97, + 140, 141, 143, 142, 130, 123, 127, 117, 126, 120, + 147, 146, 161, 155, 169, 135, 122, 117, 166, 155, + 144, 144, 142, 142, 125, 122, 137, 128, 194, 172, + 127, 85, 148, 143, 153, 141, 147, 147, 140, 143, + 118, 140, 0, 69, 51, 60, 111, 123, 137, 135, + 146, 146, 164, 165, 207, 214, 145, 143, 149, 147, + 178, 168, 197, 170, 134, 154, 148, 159, 115, 140, + 103, 118, 13, 38, 139, 138, 135, 138, 140, 141, + 144, 144, 140, 140, 150, 150, 156, 157, 164, 171, + 143, 143, 140, 142, 118, 120, 172, 172, 160, 163, + 146, 147, 150, 151, 176, 176, 230, 237, 153, 153, + 168, 156, 173, 149, 164, 148, 162, 146, 178, 158, + 147, 145, 143, 145, 111, 126, 111, 130, 89, 118, + 153, 158, 122, 120, 142, 125, 124, 105, 148, 138, + 145, 144, 156, 151, 193, 154, 146, 147, 119, 135, + 142, 141, 145, 145, 152, 147, 142, 141, 146, 146, + 139, 138, 154, 154, 148, 150, 147, 149, 144, 145, + 134, 134, 141, 140, 135, 134, 145, 147, 160, 163, + 144, 145, 149, 146, 115, 67, 127, 119, 141, 135, + 145, 141, 130, 124, 143, 144, 151, 165, 141, 144, + 154, 152, 160, 136, 115, 82, 64, 71, 64, 65, + 143, 143, 151, 149, 240, 251, 165, 173, 173, 179, + 148, 134, 156, 55, 160, 105, 133, 91, 129, 96, + 149, 149, 145, 144, 160, 154, 171, 159, 140, 142, + 154, 163, 178, 244, 147, 140, 153, 150, 137, 121, + 145, 144, 145, 146, 138, 139, 149, 152, 189, 198, + 148, 148, 156, 158, 168, 182, 165, 182, 172, 201, + 143, 142, 99, 92, 152, 152, 143, 143, 127, 127, + 165, 148, 173, 124, 113, 122, 134, 142, 127, 142, + 124, 126, 137, 137, 131, 132, 144, 142, 141, 138, + 172, 176, 138, 111, 152, 136, 167, 154, 156, 137, + 140, 150, 78, 145, 158, 157, 161, 154, 155, 147, + 153, 164, 156, 191, 129, 109, 153, 146, 153, 141, + 138, 137, 141, 138, 115, 94, 144, 141, 155, 147, + 144, 142, 144, 137, 168, 113, 141, 134, 145, 137, + 146, 144, 150, 148, 140, 155, 103, 178, 137, 149, + 145, 147, 148, 153, 175, 201, 138, 146, 110, 108, + 143, 146, 124, 134, 124, 127, 164, 158, 127, 135, + 145, 146, 150, 150, 145, 147, 95, 80, 150, 151, + 149, 149, 162, 162, 144, 152, 170, 169, 145, 154, + 145, 149, 143, 146, 142, 145, 152, 146, 160, 98, + 141, 141, 153, 153, 140, 137, 131, 131, 145, 146, + 133, 132, 127, 124, 158, 150, 173, 164, 178, 167, + 146, 146, 154, 155, 117, 127, 143, 147, 147, 156, + 142, 143, 144, 145, 146, 152, 170, 199, 151, 165, + 146, 147, 139, 140, 147, 149, 132, 134, 147, 149, + 138, 139, 142, 143, 162, 188, 145, 149, 160, 164, + 150, 150, 139, 139, 143, 142, 146, 146, 137, 138, + 142, 142, 141, 140, 152, 153, 164, 171, 110, 112, + 139, 139, 143, 143, 138, 138, 142, 142, 143, 143, + 137, 140, 142, 142, 145, 141, 149, 141, 182, 135, + 146, 146, 150, 150, 144, 145, 150, 151, 135, 137, + 137, 145, 51, 62, 68, 54, 69, 57, 62, 41, + 137, 139, 139, 144, 135, 150, 225, 232, 208, 197, + 136, 135, 141, 143, 145, 150, 160, 169, 213, 247, + 142, 137, 72, 54, 110, 107, 105, 107, 127, 130, + 145, 143, 169, 155, 219, 174, 195, 164, 183, 157, + 155, 157, 239, 232, 169, 164, 170, 172, 156, 159, + 142, 143, 136, 144, 59, 100, 139, 142, 130, 138, + 147, 146, 150, 161, 128, 235, 143, 155, 146, 167, + 154, 149, 128, 151, 42, 149, 55, 136, 59, 127, + 128, 126, 74, 92, 143, 153, 140, 150, 166, 176, + 146, 152, 150, 145, 140, 100, 140, 105, 124, 59, + 195, 191, 146, 148, 144, 136, 136, 133, 129, 122, + 133, 148, 40, 147, 102, 140, 123, 148, 118, 136, + 143, 143, 150, 148, 184, 153, 160, 147, 166, 149, + 58, 68, 127, 135, 141, 145, 143, 147, 150, 151, + 140, 143, 137, 137, 120, 114, 71, 65, 125, 123, + 153, 148, 215, 159, 136, 135, 150, 146, 150, 150, + 148, 138, 166, 94, 150, 145, 145, 139, 147, 145, + 146, 147, 150, 139, 171, 63, 158, 142, 153, 133, + 147, 148, 143, 143, 76, 72, 155, 159, 164, 176, + 149, 149, 173, 195, 145, 165, 138, 144, 150, 167, + 180, 169, 146, 151, 146, 166, 147, 166, 149, 171, + 157, 156, 168, 166, 147, 149, 121, 122, 116, 124, + 145, 145, 147, 148, 172, 189, 168, 180, 144, 146, + 139, 145, 141, 150, 115, 172, 141, 146, 143, 148, + 145, 145, 142, 143, 145, 147, 138, 143, 58, 73, + 141, 142, 146, 145, 163, 149, 218, 161, 147, 132, + 152, 147, 146, 147, 140, 150, 141, 152, 89, 150, + 78, 134, 135, 137, 139, 142, 140, 137, 137, 130, + 144, 144, 152, 151, 145, 140, 181, 170, 191, 168, + 164, 166, 136, 148, 112, 124, 139, 144, 146, 149, + 142, 151, 113, 182, 137, 150, 143, 156, 138, 147, + 154, 156, 108, 102, 118, 119, 133, 139, 113, 111, + 145, 144, 150, 147, 175, 151, 104, 106, 116, 114, + 143, 144, 151, 157, 151, 191, 135, 113, 138, 123, + 146, 146, 155, 157, 106, 145, 132, 127, 140, 125, + 161, 165, 146, 150, 151, 154, 139, 140, 142, 143, + 144, 148, 145, 149, 147, 138, 168, 104, 146, 136, + 138, 140, 91, 108, 111, 110, 145, 140, 158, 154, + 130, 112, 122, 118, 136, 135, 119, 118, 141, 140, + 147, 146, 146, 145, 138, 138, 182, 188, 132, 132, + 144, 144, 156, 155, 168, 172, 123, 128, 144, 151, + 142, 140, 145, 145, 137, 144, 141, 152, 128, 188, + 149, 149, 160, 161, 160, 160, 166, 163, 130, 107, + 143, 143, 142, 142, 149, 149, 132, 132, 170, 174, + 148, 148, 154, 153, 118, 111, 157, 155, 114, 109, + 140, 139, 138, 137, 205, 187, 137, 133, 147, 144, + 144, 145, 147, 149, 105, 125, 108, 117, 155, 162, + 146, 146, 162, 157, 144, 122, 154, 143, 161, 139, + 141, 142, 130, 131, 144, 144, 142, 141, 144, 142, + 132, 132, 141, 141, 150, 151, 139, 141, 151, 153, + 142, 142, 154, 154, 150, 150, 148, 148, 166, 165, + 143, 142, 144, 144, 132, 132, 142, 144, 130, 128, + 142, 142, 143, 143, 153, 153, 147, 142, 129, 125, + 142, 141, 143, 142, 143, 147, 105, 122, 135, 140, + 141, 140, 140, 140, 151, 151, 156, 155, 146, 146, + 133, 134, 140, 142, 142, 145, 141, 146, 112, 133, + 142, 142, 145, 145, 137, 138, 155, 157, 149, 150, + 144, 144, 139, 138, 130, 128, 132, 131, 147, 147, + 139, 140, 142, 143, 115, 121, 141, 143, 137, 141, + 146, 146, 150, 150, 145, 144, 133, 133, 133, 135, + 143, 144, 144, 144, 166, 167, 139, 142, 139, 140, + 150, 149, 138, 138, 142, 140, 148, 147, 160, 155, + 146, 146, 147, 147, 138, 137, 143, 142, 151, 150 +}; + +static const uint8_t wmavoice_dq_lsp16r2[0x500] = { + 98, 98, 119, 121, 109, 112, 128, 135, 115, 121, + 159, 113, 113, 106, 127, 114, 101, 102, 105, 111, + 161, 162, 137, 138, 161, 159, 152, 150, 150, 148, + 128, 79, 131, 102, 142, 120, 133, 119, 130, 117, + 121, 115, 142, 133, 186, 155, 179, 144, 169, 135, + 107, 103, 106, 106, 122, 122, 111, 112, 112, 115, + 127, 123, 118, 115, 128, 125, 123, 119, 115, 109, + 124, 130, 117, 126, 121, 133, 84, 144, 99, 114, + 122, 125, 123, 131, 124, 135, 176, 200, 158, 176, + 68, 74, 86, 87, 117, 115, 119, 116, 135, 128, + 115, 116, 102, 104, 119, 123, 133, 148, 102, 109, + 71, 121, 106, 117, 107, 127, 106, 122, 100, 110, + 117, 115, 129, 128, 87, 84, 116, 116, 151, 157, + 116, 128, 110, 117, 119, 134, 100, 114, 120, 129, + 142, 141, 146, 151, 94, 91, 114, 114, 118, 118, + 114, 112, 112, 109, 115, 112, 123, 123, 147, 148, + 110, 164, 106, 152, 110, 158, 106, 151, 105, 135, + 85, 51, 71, 27, 71, 34, 74, 45, 85, 53, + 145, 134, 140, 130, 136, 134, 118, 122, 118, 126, + 117, 84, 121, 81, 106, 80, 109, 106, 121, 127, + 95, 94, 112, 110, 90, 94, 109, 107, 114, 109, + 117, 118, 118, 123, 107, 107, 86, 93, 29, 31, + 125, 112, 104, 60, 121, 111, 127, 116, 133, 130, + 118, 117, 148, 145, 122, 126, 124, 127, 90, 91, + 113, 110, 119, 118, 152, 147, 115, 112, 132, 131, + 129, 140, 98, 112, 73, 85, 109, 115, 122, 126, + 123, 122, 122, 122, 126, 125, 137, 140, 203, 210, + 164, 176, 114, 114, 125, 122, 119, 112, 125, 120, + 124, 122, 118, 115, 95, 96, 141, 144, 132, 131, + 127, 130, 132, 134, 116, 114, 122, 123, 137, 134, + 111, 111, 112, 116, 106, 118, 77, 101, 104, 115, + 111, 111, 125, 126, 118, 121, 113, 115, 113, 113, + 171, 170, 202, 199, 221, 206, 199, 184, 177, 167, + 73, 90, 61, 93, 43, 74, 51, 71, 51, 72, + 130, 130, 140, 137, 134, 132, 164, 160, 118, 111, + 123, 136, 133, 154, 130, 158, 106, 110, 110, 114, + 97, 97, 91, 94, 70, 69, 125, 123, 141, 140, + 119, 100, 116, 77, 111, 67, 105, 52, 95, 34, + 100, 122, 90, 124, 68, 120, 43, 117, 50, 112, + 130, 129, 192, 188, 123, 118, 124, 117, 121, 115, + 122, 111, 129, 111, 157, 85, 125, 109, 125, 119, + 143, 152, 119, 128, 114, 116, 129, 136, 148, 157, + 119, 117, 115, 115, 150, 148, 163, 154, 109, 102, + 120, 126, 73, 119, 106, 121, 102, 122, 96, 113, + 84, 83, 117, 115, 122, 117, 154, 143, 159, 142, + 118, 122, 114, 117, 115, 122, 114, 130, 99, 156, + 123, 120, 122, 116, 100, 81, 99, 91, 121, 112, + 139, 131, 164, 142, 132, 119, 145, 133, 157, 141, + 112, 109, 118, 116, 142, 134, 108, 110, 96, 99, + 111, 110, 113, 112, 111, 104, 98, 94, 131, 131, + 115, 114, 121, 118, 120, 115, 173, 148, 123, 117, + 121, 124, 122, 124, 140, 146, 78, 82, 96, 93, + 86, 90, 124, 125, 121, 123, 105, 106, 134, 135, + 107, 109, 132, 141, 100, 95, 113, 114, 102, 105, + 113, 130, 98, 145, 116, 115, 124, 117, 115, 105, + 120, 123, 89, 87, 109, 108, 102, 101, 117, 117, + 113, 122, 132, 138, 77, 116, 86, 99, 118, 126, + 123, 120, 117, 111, 124, 119, 129, 118, 63, 58, + 141, 135, 108, 106, 109, 111, 108, 110, 135, 138, + 117, 114, 134, 127, 139, 129, 138, 130, 126, 122, + 121, 118, 124, 121, 133, 130, 98, 85, 130, 123, + 147, 129, 118, 112, 148, 130, 136, 123, 148, 131, + 113, 112, 123, 118, 123, 115, 147, 95, 117, 110, + 118, 119, 112, 113, 112, 113, 119, 119, 120, 120, + 158, 133, 198, 145, 188, 129, 197, 137, 195, 133, + 132, 140, 140, 139, 158, 156, 223, 217, 233, 233, + 48, 56, 34, 37, 82, 84, 102, 102, 108, 110, + 120, 142, 136, 169, 146, 195, 136, 186, 140, 182, + 196, 186, 158, 155, 142, 134, 132, 125, 120, 119, + 97, 105, 72, 75, 82, 85, 81, 84, 107, 109, + 67, 121, 43, 119, 69, 124, 87, 129, 88, 128, + 53, 57, 93, 98, 91, 94, 93, 98, 104, 104, + 124, 123, 133, 133, 182, 181, 119, 121, 114, 116, + 128, 105, 134, 112, 131, 72, 119, 59, 111, 84, + 132, 142, 145, 180, 124, 132, 131, 143, 122, 134, + 88, 85, 103, 103, 136, 140, 131, 143, 114, 132, + 116, 57, 113, 57, 121, 76, 126, 80, 118, 86, + 127, 112, 127, 97, 131, 100, 149, 91, 163, 86, + 122, 119, 128, 121, 128, 116, 142, 127, 173, 139, + 162, 116, 166, 107, 149, 103, 152, 107, 141, 108, + 114, 113, 118, 116, 56, 43, 90, 90, 105, 105, + 132, 134, 110, 107, 106, 105, 82, 84, 84, 84, + 102, 106, 79, 89, 99, 99, 127, 129, 114, 118, + 139, 157, 116, 123, 116, 123, 87, 89, 110, 113, + 119, 126, 97, 97, 155, 163, 142, 153, 143, 146, + 117, 114, 66, 67, 125, 126, 127, 128, 114, 113, + 111, 114, 127, 133, 123, 132, 143, 162, 133, 148, + 105, 108, 114, 114, 110, 109, 57, 48, 109, 106, + 113, 130, 104, 131, 88, 139, 102, 169, 100, 172, + 129, 114, 150, 97, 114, 112, 117, 119, 109, 116, + 92, 107, 96, 116, 90, 125, 101, 122, 125, 140, + 125, 133, 122, 129, 136, 153, 125, 135, 131, 139, + 84, 71, 129, 123, 135, 120, 114, 103, 112, 101, + 108, 121, 115, 156, 106, 123, 116, 131, 127, 139, + 137, 147, 109, 117, 119, 126, 135, 144, 117, 119, + 120, 127, 76, 105, 111, 116, 120, 125, 141, 138, + 107, 104, 162, 155, 135, 130, 127, 123, 127, 121, + 102, 104, 84, 87, 112, 115, 97, 102, 78, 82, + 119, 118, 120, 123, 91, 105, 114, 119, 119, 126, + 130, 126, 134, 126, 158, 134, 133, 99, 116, 100, + 125, 122, 145, 143, 126, 117, 98, 96, 121, 120, + 152, 148, 131, 126, 130, 129, 126, 119, 87, 87, + 131, 131, 139, 137, 101, 102, 104, 105, 86, 83, + 92, 89, 111, 105, 121, 115, 137, 124, 96, 84, + 100, 96, 122, 119, 107, 108, 93, 96, 79, 82, + 128, 123, 108, 106, 123, 120, 150, 150, 143, 140, + 121, 120, 97, 99, 79, 80, 116, 116, 88, 90, + 128, 131, 101, 97, 140, 140, 117, 116, 116, 118, + 137, 135, 100, 91, 115, 112, 134, 121, 107, 99, + 120, 122, 122, 125, 124, 126, 136, 141, 89, 95, + 103, 119, 103, 116, 122, 139, 125, 137, 152, 170, + 121, 122, 124, 124, 98, 97, 137, 140, 96, 92, + 115, 113, 136, 136, 128, 132, 122, 124, 151, 158, + 100, 107, 121, 131, 131, 158, 119, 130, 113, 114, + 114, 109, 148, 130, 103, 95, 127, 116, 137, 120, + 103, 108, 97, 97, 133, 128, 113, 109, 136, 128, + 125, 124, 118, 118, 122, 121, 101, 99, 157, 152, + 138, 134, 124, 115, 113, 101, 123, 112, 124, 110, + 116, 113, 128, 121, 119, 110, 124, 113, 128, 67, + 114, 118, 114, 123, 109, 121, 102, 123, 56, 116, + 117, 111, 112, 99, 124, 114, 112, 79, 114, 88, + 112, 113, 115, 117, 126, 127, 130, 132, 123, 122, + 111, 104, 111, 102, 112, 102, 129, 118, 129, 115, + 123, 124, 130, 133, 114, 117, 125, 127, 112, 117, + 124, 125, 119, 120, 117, 116, 105, 104, 110, 110, + 125, 124, 118, 116, 124, 123, 124, 121, 133, 132, + 111, 111, 124, 124, 120, 119, 116, 116, 134, 130, + 114, 116, 112, 113, 109, 111, 116, 118, 95, 98 +}; + +static const uint8_t wmavoice_dq_lsp16r3[0x600] = { + 84, 82, 95, 94, 125, 131, 98, 102, 94, 93, 104, 104, + 127, 113, 87, 77, 125, 114, 109, 94, 94, 91, 106, 105, + 168, 125, 163, 120, 128, 100, 119, 99, 108, 97, 108, 106, + 86, 85, 128, 125, 79, 73, 103, 102, 123, 123, 116, 117, + 84, 76, 135, 131, 133, 133, 129, 130, 125, 123, 115, 114, + 94, 97, 79, 81, 115, 115, 94, 93, 128, 127, 126, 125, + 124, 111, 105, 114, 104, 117, 109, 110, 124, 125, 118, 117, + 107, 110, 106, 110, 93, 93, 149, 148, 118, 119, 111, 110, + 147, 157, 143, 156, 134, 136, 118, 121, 106, 107, 105, 105, + 114, 83, 114, 46, 106, 53, 110, 83, 107, 94, 105, 103, + 92, 90, 109, 106, 172, 160, 114, 110, 109, 110, 110, 109, + 90, 98, 98, 109, 102, 98, 97, 92, 100, 100, 101, 102, + 123, 117, 124, 98, 82, 80, 117, 115, 112, 110, 109, 108, + 107, 111, 100, 115, 105, 120, 104, 105, 83, 82, 95, 96, + 109, 120, 72, 71, 97, 104, 69, 74, 99, 102, 118, 117, + 137, 133, 142, 135, 105, 110, 121, 121, 125, 122, 114, 112, + 151, 186, 115, 132, 103, 111, 100, 104, 99, 101, 104, 105, + 18, 38, 56, 65, 76, 83, 85, 91, 101, 103, 108, 110, + 144, 135, 126, 121, 115, 113, 79, 80, 118, 117, 117, 117, + 117, 124, 115, 115, 126, 113, 130, 116, 112, 106, 108, 105, + 77, 76, 76, 80, 109, 109, 125, 129, 130, 133, 116, 118, + 96, 86, 109, 99, 102, 69, 84, 69, 107, 103, 114, 113, + 78, 118, 82, 114, 84, 129, 69, 112, 78, 98, 96, 103, + 89, 137, 96, 111, 105, 97, 93, 93, 101, 105, 105, 105, + 141, 123, 102, 93, 91, 79, 87, 81, 102, 99, 109, 108, + 94, 92, 124, 123, 130, 134, 100, 107, 71, 75, 92, 91, + 94, 104, 107, 83, 106, 101, 113, 114, 122, 122, 114, 114, + 118, 124, 103, 106, 95, 116, 90, 93, 107, 104, 109, 107, + 116, 118, 76, 72, 88, 88, 132, 132, 140, 141, 116, 116, + 90, 81, 111, 95, 139, 97, 123, 96, 112, 100, 110, 108, + 112, 116, 133, 140, 112, 120, 80, 85, 55, 55, 85, 84, + 125, 94, 111, 104, 116, 103, 112, 86, 93, 84, 99, 98, + 180, 179, 197, 197, 169, 163, 149, 146, 130, 124, 116, 115, + 76, 47, 36, 11, 43, 28, 66, 53, 82, 80, 102, 99, + 119, 123, 176, 201, 113, 120, 112, 111, 103, 105, 106, 110, + 145, 114, 112, 89, 120, 93, 123, 104, 131, 123, 113, 111, + 97, 109, 82, 106, 75, 104, 103, 115, 120, 124, 111, 114, + 114, 111, 113, 105, 34, 33, 63, 63, 105, 106, 122, 122, + 51, 41, 96, 92, 125, 125, 118, 118, 118, 119, 113, 113, + 111, 180, 108, 178, 107, 171, 110, 160, 105, 136, 102, 117, + 76, 79, 90, 92, 80, 88, 88, 93, 123, 124, 122, 122, + 131, 128, 123, 122, 151, 158, 108, 107, 129, 128, 119, 119, + 97, 99, 114, 120, 121, 125, 151, 157, 82, 89, 95, 96, + 128, 94, 130, 95, 149, 113, 149, 120, 127, 115, 113, 109, + 167, 171, 83, 80, 84, 79, 106, 106, 112, 110, 107, 108, + 130, 139, 81, 88, 107, 106, 112, 112, 119, 118, 114, 112, + 108, 105, 100, 98, 120, 116, 122, 117, 38, 37, 72, 73, + 118, 125, 110, 120, 114, 126, 135, 142, 139, 142, 118, 119, + 119, 119, 156, 145, 78, 75, 94, 94, 112, 110, 113, 113, + 101, 108, 98, 104, 103, 109, 117, 118, 167, 167, 132, 132, + 116, 108, 118, 111, 149, 136, 85, 74, 95, 92, 113, 112, + 74, 69, 104, 107, 96, 100, 117, 121, 103, 105, 103, 103, + 110, 106, 111, 101, 82, 72, 96, 92, 132, 130, 120, 121, + 116, 113, 138, 139, 104, 103, 131, 131, 68, 69, 92, 92, + 97, 97, 146, 151, 122, 132, 97, 95, 117, 116, 115, 116, + 139, 134, 110, 110, 124, 129, 100, 110, 86, 91, 100, 102, + 116, 136, 88, 90, 137, 139, 103, 114, 114, 117, 111, 110, + 82, 83, 104, 102, 97, 99, 97, 97, 58, 56, 84, 84, + 83, 122, 76, 105, 112, 126, 120, 134, 112, 120, 108, 110, + 114, 128, 73, 90, 72, 76, 98, 100, 95, 96, 101, 102, + 101, 108, 118, 126, 94, 102, 81, 83, 138, 140, 131, 130, + 88, 100, 112, 124, 105, 106, 122, 123, 121, 121, 114, 114, + 76, 108, 73, 83, 93, 95, 110, 111, 98, 99, 103, 103, + 105, 112, 98, 108, 114, 95, 117, 98, 120, 116, 116, 115, + 231, 238, 150, 146, 124, 126, 115, 122, 117, 121, 112, 112, + 74, 73, 72, 74, 60, 61, 62, 61, 85, 85, 101, 101, + 67, 69, 50, 51, 83, 83, 110, 110, 118, 113, 112, 111, + 199, 124, 184, 115, 176, 117, 165, 120, 138, 115, 116, 114, + 52, 116, 36, 107, 49, 99, 72, 106, 91, 107, 104, 105, + 140, 138, 141, 135, 154, 147, 166, 159, 139, 136, 116, 115, + 130, 119, 180, 157, 183, 149, 136, 121, 119, 114, 111, 110, + 104, 129, 113, 154, 111, 148, 108, 132, 105, 117, 106, 111, + 114, 35, 99, 65, 113, 94, 110, 98, 111, 107, 107, 106, + 106, 110, 128, 135, 162, 175, 143, 155, 115, 116, 109, 109, + 168, 155, 112, 109, 125, 125, 126, 122, 126, 124, 111, 112, + 128, 96, 160, 77, 151, 77, 121, 80, 114, 94, 107, 103, + 97, 104, 101, 116, 56, 79, 74, 83, 92, 95, 104, 106, + 63, 68, 76, 77, 110, 107, 96, 90, 85, 83, 97, 96, + 116, 110, 46, 42, 103, 100, 122, 120, 102, 101, 104, 104, + 106, 101, 109, 98, 96, 61, 67, 35, 72, 61, 96, 93, + 88, 80, 81, 76, 113, 110, 144, 143, 88, 89, 93, 94, + 95, 96, 100, 101, 136, 132, 166, 160, 148, 147, 115, 116, + 80, 78, 130, 129, 120, 108, 91, 85, 95, 91, 104, 102, + 151, 147, 106, 109, 110, 110, 64, 69, 68, 67, 96, 96, + 90, 166, 97, 128, 99, 120, 104, 121, 109, 118, 105, 109, + 122, 138, 110, 143, 75, 97, 83, 94, 89, 94, 102, 103, + 136, 142, 103, 110, 83, 89, 99, 101, 138, 138, 120, 122, + 168, 88, 105, 90, 109, 107, 110, 111, 106, 105, 103, 102, + 68, 72, 102, 104, 92, 102, 65, 75, 89, 94, 106, 106, + 83, 74, 93, 85, 73, 66, 106, 102, 100, 92, 99, 97, + 93, 99, 101, 96, 116, 112, 125, 120, 88, 88, 96, 96, + 44, 98, 93, 115, 104, 116, 103, 107, 112, 113, 107, 107, + 93, 83, 105, 99, 93, 84, 127, 125, 141, 143, 117, 118, + 106, 103, 126, 121, 137, 123, 123, 114, 147, 142, 127, 123, + 103, 110, 89, 91, 121, 124, 66, 71, 68, 69, 96, 97, + 114, 105, 68, 65, 69, 67, 96, 94, 131, 130, 123, 121, + 111, 104, 130, 121, 95, 95, 72, 74, 88, 88, 105, 104, + 135, 124, 110, 98, 114, 111, 159, 158, 111, 113, 104, 106, + 103, 108, 94, 107, 55, 57, 115, 118, 121, 122, 111, 111, + 97, 99, 106, 111, 119, 126, 59, 62, 111, 112, 124, 125, + 86, 93, 100, 110, 118, 145, 113, 132, 120, 125, 112, 112, + 101, 115, 78, 149, 81, 114, 111, 121, 108, 112, 107, 108, + 104, 104, 94, 96, 84, 83, 135, 132, 71, 69, 88, 86, + 100, 98, 62, 60, 81, 80, 90, 89, 63, 66, 89, 90, + 123, 116, 108, 99, 90, 86, 91, 92, 65, 65, 88, 88, + 84, 79, 115, 109, 123, 111, 99, 99, 134, 136, 121, 123, + 127, 137, 84, 88, 104, 107, 128, 130, 74, 69, 89, 89, + 118, 112, 143, 132, 141, 131, 113, 113, 99, 102, 104, 105, + 117, 115, 100, 99, 131, 126, 90, 88, 145, 144, 128, 127, + 112, 114, 131, 133, 85, 84, 118, 119, 151, 152, 117, 117, + 110, 105, 162, 140, 116, 107, 140, 134, 124, 122, 113, 113, + 107, 110, 124, 133, 98, 103, 99, 107, 109, 113, 112, 112, + 115, 105, 82, 77, 125, 122, 133, 132, 118, 120, 113, 113, + 101, 88, 84, 80, 97, 99, 91, 91, 94, 94, 101, 100, + 121, 86, 139, 108, 106, 93, 103, 99, 112, 108, 108, 107, + 113, 83, 105, 102, 125, 125, 114, 115, 110, 112, 108, 109, + 93, 112, 113, 121, 125, 131, 101, 101, 107, 109, 111, 111, + 98, 102, 117, 126, 80, 84, 107, 109, 83, 84, 96, 97, + 132, 136, 112, 118, 94, 93, 121, 118, 99, 98, 102, 103, + 122, 127, 128, 133, 118, 104, 102, 88, 100, 94, 104, 102, + 115, 116, 102, 105, 140, 142, 135, 130, 90, 88, 100, 101, + 94, 86, 112, 112, 89, 121, 92, 101, 109, 108, 110, 112, + 99, 93, 129, 114, 109, 99, 131, 119, 102, 97, 103, 103, + 103, 116, 124, 101, 115, 95, 105, 101, 94, 91, 100, 100, + 113, 90, 94, 86, 92, 92, 117, 111, 106, 103, 106, 105, + 115, 99, 110, 91, 107, 104, 81, 90, 108, 113, 112, 113, + 113, 114, 93, 101, 101, 102, 101, 126, 93, 103, 104, 105, + 117, 106, 124, 107, 104, 119, 108, 133, 104, 111, 104, 106 +}; + +static const float wmavoice_lsp10_intercoeff_a[32][2][10] = { + { { 0.5108627081, 0.0480548441, -1.5099149644, 0.6736935377, + 0.7536551058, 0.7651474178, 0.8510628343, 0.6667704582, + 0.7576012611, 0.7091397047 }, + { 0.1351471841, -0.1965375543, -1.6313457787, 0.3218626380, + 0.4132472873, 0.4663473070, 0.5805781186, 0.3962165117, + 0.4818550050, 0.4907165468 } }, + { { 0.8556320667, 0.7774704993, -0.0175759494, -0.1882298589, + 0.1892164350, 0.4850396216, 0.6270319819, 0.6327089071, + 0.6513319910, 0.6075088978 }, + { 0.4374088347, 0.3505934179, -0.0762144327, -0.2830760479, + -0.0626451969, 0.1500318050, 0.2602472305, 0.2781780064, + 0.3167395592, 0.3596626520 } }, + { { 0.1899779737, 0.0650856197, 0.1699010432, 0.9122628570, + 0.9097705483, 0.7433397174, 0.6304935217, 0.5164704025, + 0.4174703658, 0.5215242505 }, + { 0.0704856217, 0.0169009864, 0.0188394487, 0.5587704182, + 0.5194473267, 0.3539164960, 0.2426626086, 0.1721164286, + 0.1371548772, 0.2594856918 } }, + { { 0.8858859241, 0.9100474715, 0.8921859264, 0.9332397878, + 1.0225475132, 1.0555013716, 1.0983552337, 1.1290244758, + 1.0363244414, 0.9277705550 }, + { 0.4810934663, 0.5782935023, 0.6835935414, 0.7650781870, + 0.9018090069, 0.9996321201, 1.0219936669, 1.0474705994, + 0.9109474719, 0.7774704993 } }, + { { 0.4359549880, 0.2275702953, 0.0993548632, 0.1763395071, + 0.1055856347, 0.1018471718, 0.1170087159, 0.1221317947, + 0.1834010482, 0.2988780141 }, + { 0.1573702693, 0.1041317880, 0.0506856143, 0.0781702399, + 0.0058932900, -0.0026913285, -0.0031067133, 0.0070702136, + 0.0116394460, 0.0566394627 } }, + { { 0.8528628349, 0.8028782010, 0.4680088460, 0.9055474699, + 1.3742399514, 1.1093629301, 0.4122780561, 0.4003703594, + 0.6360319853, 0.6415704489 }, + { 0.4252934456, 0.3823703527, 0.1676856577, 0.5241550207, + 1.1995706558, 0.9088013172, 0.1224087179, 0.0730471611, + 0.3071857095, 0.3772472739 } }, + { { 0.5508781075, 0.2829549313, -0.0022067130, 0.1042702496, + 1.0318244398, 1.3258476257, 1.3550630212, 0.9931936562, + 0.7195243239, 0.6807550788 }, + { 0.2679318488, 0.0960317850, -0.1357529163, -0.1291759908, + 0.6451012194, 0.9968628883, 0.9510321021, 0.6608166099, + 0.3799472749, 0.3735780418 } }, + { { 0.9967244267, 1.0255244374, 0.9800398052, 0.7939474285, + 0.8288397491, 0.8390166759, 0.8660166860, 0.9247936308, + 0.9127474725, 0.8684397638 }, + { 0.7921474278, 0.9416859448, 0.8547320664, 0.5348165631, + 0.6231550574, 0.6703012288, 0.6987550855, 0.8147858977, + 0.7406397164, 0.6496012211 } }, + { { 0.1439394951, -0.3193529844, -0.2024914026, -0.1854606271, + 0.0877240896, 0.1617318094, 0.3087087870, 0.3777318895, + 0.3910242021, 0.4797780812 }, + { -0.0157067180, -0.1778452396, -0.1554836929, -0.1759760082, + -0.0607759655, -0.0161221027, 0.0393317640, 0.0758856237, + 0.1163856387, 0.1947548985 } }, + { { 1.1021629274, 0.9958244264, 0.4658626914, 0.3089164793, + 0.3740626574, 0.2962472439, 0.3170857131, 0.2420395315, + 0.2649549246, 0.2936857045 }, + { 0.4700857699, 0.1809087396, 0.0311625302, 0.0106009841, + 0.0311625302, 0.0266625285, 0.0221625268, 0.0156548321, + 0.0551163852, 0.1010164022 } }, + { { 0.2925087810, 0.3418011069, 0.7339243293, 0.7322627902, + 0.7288704813, 0.7924935818, 0.7724166512, 0.7819012702, + 0.8325782120, 0.7954705060 }, + { 0.0559471548, -0.0456144214, -0.0462374985, -0.1005144417, + -0.0511528850, -0.0455451906, -0.0044220984, 0.0451471508, + 0.1232394874, 0.2085318267 } }, + { { 0.2230702937, -0.9052532017, 1.2441552877, 1.0825706124, + 0.9088705480, 0.8797243834, 0.8648397624, 0.8091089725, + 0.7633474171, 0.7468704879 }, + { -0.2030452490, -1.4167303145, 1.3542322516, 0.8369397521, + 0.6148473620, 0.5560704172, 0.5450627208, 0.4978473186, + 0.4200319052, 0.4904396236 } }, + { { 0.6088242829, 0.5965704322, 0.6547242999, 0.8554936051, + -0.2989298999, 0.2404472232, 0.3573780358, 0.7499166429, + 0.7691628039, 0.6824858487 }, + { 0.2582395375, 0.2721549273, 0.3462318778, 0.4820626974, + -0.4780299664, -0.0712990463, 0.0200163722, 0.4246703684, + 0.4660011530, 0.4172626734 } }, + { { 1.1749937236, 1.0773090720, 1.0566782951, 1.0249013603, + 0.9947167337, 0.9626628757, 0.9562244117, 0.9072782397, + 0.7654243410, 0.6448935270 }, + { 1.1595552564, 0.9340013266, 0.3959395885, 0.3693549633, + 0.3915780485, 0.3104395568, 0.3499011099, 0.2236933708, + 0.1638087332, 0.1811856627 } }, + { { 0.9572628736, 0.9389859438, 0.6619243026, 0.6849089265, + 0.7276935577, 0.7839781940, 0.7987243533, 0.7748397291, + 0.7101089358, 0.7277627885 }, + { 0.5809935033, 0.5575934947, 0.3544703424, 0.3636780381, + 0.3736472726, 0.4486242235, 0.4684934616, 0.4481396079, + 0.3456780314, 0.4478626847 } }, + { { 0.1259394884, 1.3096476197, 1.0794552267, 1.0009475052, + 0.9061013162, 0.9216782451, 0.8954397738, 0.9160013199, + 0.8575012982, 0.7479089499 }, + { -0.3689222336, 1.5293861628, 0.7323320210, 0.4102703631, + 0.3825780451, 0.2828164697, 0.2644010782, 0.2455010712, + 0.2482010722, 0.2335241437 } }, + { { 0.5380704105, 0.1600702703, -0.0657605827, -0.2390452623, + -0.3885837793, -0.4150299430, -0.3001760542, -0.1451683044, + 0.1312010288, 0.2798395455 }, + { 0.2074933648, 0.0560163856, -0.0956682861, -0.2893068194, + -0.3889991641, -0.3918376267, -0.3550068438, -0.2649375796, + -0.0554451942, 0.1167317927 } }, + { { 0.6092396677, 0.5101011693, 0.4012011290, 0.5416011810, + 0.5715781152, 0.6476627588, 0.6988243163, 0.7306012511, + 0.7531704903, 0.6534781456 }, + { 0.2060395181, 0.1409625709, 0.1024702489, 0.1834010482, + 0.1946856678, 0.2547779977, 0.3134857118, 0.3283011019, + 0.3837549686, 0.3501780331 } }, + { { 0.4516011477, 0.5351627171, 0.8068243563, 0.7049858570, + 0.7165473998, 0.6005858183, 0.4870473146, 0.2500010729, + 0.3132087886, 0.4462703764 }, + { 0.1053087115, 0.1348702610, 0.4457857609, 0.3499703407, + 0.3537780344, 0.2628780007, 0.1665087342, 0.0200856030, + 0.0329625309, 0.1525241137 } }, + { { 0.7058166265, 0.7305320203, 1.1684860289, 1.4524707496, + 1.3212091625, 1.2613245249, 1.1712552607, 1.1154552400, + 1.0487167537, 0.9153782427 }, + { 0.2286087573, 0.2851703167, 1.2016475797, 1.5154707730, + 1.2726091444, 1.1459167898, 0.9801090360, 0.9296397865, + 0.8490551412, 0.6772243083 } }, + { { 0.6686396897, 0.5728935003, 0.4734780788, 0.6970243156, + 0.5852165818, -0.0762836635, -0.2054683268, -0.1380375326, + 0.1282933354, 0.3467164934 }, + { 0.2925087810, 0.2344933748, 0.1677548885, 0.2747856975, + 0.2097087502, -0.2795452774, -0.3761222363, -0.3183837533, + -0.0834836662, 0.1482318044 } }, + { { 0.6559704542, 0.7737320364, 0.9867551923, 0.9912551939, + 0.9508936405, 0.9114320874, 0.8336859047, 0.7905551195, + 0.7672935724, 0.7532397211 }, + { 0.1843702793, 0.2565087676, 0.7571858764, 0.7545551062, + 0.6793704629, 0.5981627405, 0.5078165531, 0.4282011390, + 0.3948318958, 0.4502165318 } }, + { { 0.4430857599, 0.6102781296, 0.8485012949, 0.8573628366, + 0.9078320861, 0.9979705811, 1.0411013663, 1.0524552166, + 1.0194321275, 0.9023628533 }, + { 0.0070009828, 0.0084548295, 0.1613856554, 0.3484472632, + 0.4385857582, 0.5895088911, 0.6367935240, 0.6736935377, + 0.7026320100, 0.5924165845 } }, + { { 1.0532859862, 1.1059706211, 1.1311013997, 1.1250783205, + 1.0425552130, 0.9993551970, 0.9673013389, 0.9386397898, + 0.8836013079, 0.8336859047 }, + { 0.9791398048, 1.1481321752, 1.1275706291, 1.0082167387, + 0.8809705377, 0.8031551242, 0.7287320197, 0.6496704519, + 0.5211088657, 0.4734088480 } }, + { { -0.0251221061, -0.0443682671, 0.1282241046, 0.3850703537, + 0.4252934456, 0.4547857642, 0.4690473080, 0.4873242378, + 0.6001012027, 0.5882627368 }, + { -0.0562759638, -0.0246374905, 0.0070009828, 0.0971394777, + 0.1232394874, 0.1278779507, 0.1302317977, 0.1462241113, + 0.2073549032, 0.2446010709 } }, + { { 1.1749244928, 1.1155937016, 0.9236167073, 0.6288319826, + 0.6515396833, 0.5391781032, 0.5398011804, 0.4997165501, + 0.4066703618, 0.3998857439 }, + { 0.9403013289, 0.7346166372, 0.1841625869, 0.1319625676, + 0.1395087242, 0.0857856274, 0.0952702463, 0.0860625505, + 0.0829471648, 0.1132010221 } }, + { { 0.9047167003, 0.9840551913, 0.9933321178, 0.9360090196, + 0.9164859354, 0.9213320911, 0.8701705337, 0.8815936148, + 0.8414397538, 0.8188012838 }, + { 0.0961010158, -0.0147374868, 0.0202240646, 0.1002548635, + 0.1407548785, 0.1837472022, 0.1858241260, 0.2064549029, + 0.2228626013, 0.2859318554 } }, + { { 0.4034165144, 0.1918472052, 2.1959402561, 0.4763165414, + 0.6577012241, 0.7036704719, 0.6626858413, 0.7650089562, + 0.7702704966, 0.6543781459 }, + { 0.0940933228, -0.1222529113, 2.3491480052, 0.1385394931, + 0.3052472472, 0.3665857315, 0.3350857198, 0.4722319245, + 0.4313857555, 0.3846549690 } }, + { { 0.8215012848, 0.8613782227, 1.0399936736, 1.4082322717, + 0.4075011313, 0.4091626704, 0.5230473280, 0.6101396680, + 0.7510243356, 0.7237474024 }, + { 0.4810934663, 0.5670088828, 0.9207782447, 1.3007860780, + 0.0453548431, 0.0858548582, 0.1803548932, 0.2790087759, + 0.3974626660, 0.4581780732 } }, + { { 1.5921784937, 1.4987169206, 1.1321398616, 0.8235089779, + 0.6888550818, 0.6621319950, 0.6192089021, 0.6533396840, + 0.7196627855, 0.6549319923 }, + { 1.5911400318, 1.4768399894, 0.9358705580, 0.4674549997, + 0.3522549570, 0.3144549429, 0.2985318601, 0.3559241891, + 0.4061857462, 0.3958703578 } }, + { { 0.7975474298, 0.8712782264, 0.8974474669, 0.3008164763, + 0.5562088788, 0.6655935347, 0.8921166956, 1.0918475389, + 0.9544936419, 0.8554936051 }, + { 0.3769703507, 0.4930703938, 0.6619243026, -0.0382759571, + 0.1766856611, 0.3015780151, 0.5952550471, 0.8903859258, + 0.7395320237, 0.6205935180 } }, + { { 0.2206472158, 2.4467634261, 1.2920629978, 1.0239321291, + 0.9014628530, 0.8552166820, 0.8219859004, 0.9005628526, + 0.7614781857, 0.7763628066 }, + { -0.2722068131, 2.8967635930, 1.3039706945, 0.7695089579, + 0.6132550538, 0.5701242685, 0.5737935007, 0.6533396840, + 0.5422934890, 0.5150857866 } }, +}; + +static const float wmavoice_lsp10_intercoeff_b[32][2][10] = { + { { 0.4881048799, -0.1998192370, -0.3872502148, 0.0109423101, + 0.0406953394, 0.1788437665, 0.1673750877, 0.3409781158, + 0.4061202109, 0.5221177042 }, + { 0.1492218077, -0.1372330189, -0.2683691680, -0.0621950924, + -0.0624572337, -0.0068177581, -0.0076041818, 0.0680235624, + 0.1055752933, 0.1199930608 } }, + { { 0.7934338748, 0.0012430847, 0.4239458144, 0.5521328747, + 0.6497149467, 0.6423749924, 0.7170197070, 0.7169541717, + 0.7778364718, 0.8397018015 }, + { 0.2768190503, -0.0491535664, -0.0325731337, 0.0261465013, + 0.0469867289, 0.0649434030, 0.0781815350, 0.1031504869, + 0.1194687784, 0.2451654971 } }, + { { 0.7212139666, 0.1658677757, 0.0101558864, 0.5636015534, + 1.3175852597, 1.1911676526, 1.1266809106, 0.8230558336, + 0.8604109585, 0.8094900250 }, + { 0.3658815324, 0.0816549063, -0.2092563212, 0.1946377754, + 1.0856558084, 0.9491457641, 0.8461242616, 0.5193652213, + 0.5975488424, 0.5293265879 } }, + { { 0.9507186115, 0.9078585207, 0.8773190677, 0.8677509129, + 0.8024122119, 0.8127667904, 0.8246286809, 0.8779088855, + 0.9454102516, 0.9863698184 }, + { 0.6883807778, 0.6900191605, 0.7059442401, 0.6552854478, + 0.5843107104, 0.5553441048, 0.5887671113, 0.6494528055, + 0.7725936472, 0.7792782485 } }, + { { 0.2399882078, 0.1938513517, 0.4441962242, 0.4475385249, + 0.3055235147, 0.1745184362, 0.1174371839, 0.0679580271, + 0.0782470703, 0.1695377529 }, + { 0.0170370936, 0.0253600776, 0.2072205544, 0.1907711923, + 0.1096384823, 0.0327000320, -0.0134368241, -0.0461389422, + -0.0372916758, -0.0243156850 } }, + { { 0.5457104146, 0.3774812818, 0.5235594809, 0.2994287312, + 0.2394639254, 0.5731041729, 0.9971176088, 1.1646913886, + 0.9028123021, 0.7777709365 }, + { 0.2288472056, 0.1181580722, 0.2074171603, 0.0355180502, + -0.0024924278, 0.2596487999, 0.7474936247, 0.9103488624, + 0.5927647650, 0.4772915542 } }, + { { 0.6541713476, 0.6412608922, 0.7625012100, 0.7826205492, + 0.4839106202, 0.3311478198, 0.4577620327, 0.8572652638, + 0.9442306161, 0.8282986581 }, + { 0.2852075696, 0.2614837885, 0.4221763611, 0.4314823747, + 0.1434547007, 0.0435788929, 0.1397191882, 0.5525916219, + 0.6752081811, 0.5487250388 } }, + { { 0.6742251515, 1.0610800683, 1.0500701368, 0.9570100009, + 0.9325653315, 0.9243078828, 0.9148707986, 0.8317720294, + 0.7696445584, 0.6784849465 }, + { 0.2283884585, 0.9739181101, 0.5336519182, 0.4974764287, + 0.3998288214, 0.3674543798, 0.2719694376, 0.2608939707, + 0.2087934017, 0.1675716937 } }, + { { 0.3736146986, -1.5457833707, 0.9216864705, 0.7959242165, + 0.7358283401, 0.7233110964, 0.7271121442, 0.6852350831, + 0.6891672015, 0.6589554250 }, + { 0.1246460676, -1.7167649865, 0.7037160397, 0.4803061783, + 0.4694928527, 0.4654951990, 0.5208069980, 0.5305717587, + 0.5288023055, 0.5278192759 } }, + { { 1.0116009116, 0.9882703424, 0.8393741250, 0.8889843524, + 0.8934407532, 0.8906227350, 0.9222107530, 0.8973073363, + 0.9257496595, 0.9306648076 }, + { 0.5097970665, -0.0106843412, 0.1419473886, 0.2804890275, + 0.3719763160, 0.3694859743, 0.4640534222, 0.5034401417, + 0.5592106879, 0.6652468145 } }, + { { 0.9718209803, 0.7615181804, 0.2172474563, 0.4920369983, + 0.4310891628, 0.5038333535, 0.4668059051, 0.5339140594, + 0.4453758597, 0.4050061107 }, + { 0.6543679535, 0.1205173433, -0.0050483048, 0.1580035388, + 0.1308719218, 0.1700620353, 0.1740596890, 0.2179683447, + 0.1967349052, 0.1703897119 } }, + { { 0.7663022578, 0.4025157690, 1.3811545074, 1.1642981768, + 1.0709758997, 0.9812580645, 1.0092416406, 0.9089070857, + 0.7776398659, 0.8189926445 }, + { 0.3471384346, 0.0602248609, 1.3968829811, 1.0841484964, + 0.8940305710, 0.7313719392, 0.7345176339, 0.5304406881, + 0.4076275229, 0.4535677731 } }, + { { 0.1300854981, 0.1323136985, 0.7564064264, 0.7335346043, + 0.7924508452, 0.6039057672, 0.6896914840, 0.3694859743, + 0.2825861573, 0.3179096878 }, + { -0.0208423138, -0.0530856848, 0.3449102342, 0.3819376826, + 0.4466865659, 0.2807511687, 0.3842969537, 0.1144880950, + 0.0617321730, 0.0767397583 } }, + { { 0.7559476793, 0.8462553322, 0.6452585459, 1.1308751702, + 1.0606868565, 0.9498666525, 0.7425129414, 0.6221901178, + 0.6574481130, 0.6976212561 }, + { 0.3420922160, 0.4310236275, 0.2800958157, 0.9317133725, + 0.8210897744, 0.6144569516, 0.3227593005, 0.2464762032, + 0.2769501209, 0.3521846533 } }, + { { 0.7609938979, 0.6943444908, 1.1490939856, 0.4350868165, + 0.6101971567, 0.6246149242, 0.7370079756, 0.6522052884, + 0.6966382265, 0.7565374970 }, + { 0.3939306438, 0.3449102342, 0.9874839187, 0.0910919905, + 0.2804234922, 0.2888775468, 0.4060546756, 0.3284608722, + 0.3483836055, 0.4819445610 } }, + { { 0.7828826904, 1.1833034158, 1.9916158915, 0.8667678833, + 0.9218830764, 0.8856420517, 0.9373494089, 0.7415299118, + 0.7450032830, 0.7074515522 }, + { 0.4685098231, 1.1713104546, 1.9853245020, 0.6206828058, + 0.6664264500, 0.6033814847, 0.6089519858, 0.3784643114, + 0.4212588668, 0.3441893458 } }, + { { 0.4671335816, 0.4177199602, 0.0804097354, -0.1836975515, + -0.1802241802, -0.0775958896, -0.0250365734, 0.0884050429, + 0.2136430144, 0.3472039700 }, + { 0.1187478900, 0.1122598946, -0.0381436348, -0.2284581661, + -0.2302276194, -0.1738672554, -0.1350048184, -0.0547896028, + 0.0000634491, 0.0545888245 } }, + { { 0.5545576811, 0.4791920781, 0.8204999566, 0.8462553322, + 0.9212277234, 0.8946203887, 0.9659883380, 0.9137566984, + 0.9225384295, 0.9207034409 }, + { 0.1176993251, -0.0429277122, -0.0330318809, 0.0566859543, + 0.0983008742, 0.1593797803, 0.1732077301, 0.2320584357, + 0.2739354968, 0.3753186166 } }, + { { 0.7157745361, 0.6367389560, -1.2036890686, 0.7107283175, + 0.6885118484, 0.7332724631, 0.7436270416, 0.7113181353, + 0.5935511887, 0.6023984551 }, + { 0.3664058149, 0.3280676603, -1.3082178831, 0.3909815550, + 0.3641776145, 0.3926854730, 0.3898674548, 0.4086760879, + 0.3127979338, 0.3949792087 } }, + { { 1.0267395675, 1.0621941686, 1.0415505469, 0.9971176088, + 0.9764739871, 0.9904330075, 0.9591071308, 0.9338760376, + 0.9026156962, 0.9073997736 }, + { 0.9855833948, 1.0548542142, 0.9787021875, 0.8573307991, + 0.8360973597, 0.8193203211, 0.7386463583, 0.7038471103, + 0.6333966553, 0.6434235573 } }, + { { 0.6235008240, 0.7635497749, 0.8094900250, 0.7227212787, + -0.0610809922, -0.1357912421, -0.2359291911, 0.0800165236, + 0.3972729445, 0.5078965425 }, + { 0.2983146310, 0.4983939230, 0.4145742655, 0.3284608722, + -0.3203386664, -0.3495018780, -0.4734291434, -0.1808139980, + 0.1211071610, 0.2001427412 } }, + { { 0.8925887942, 0.8804647624, 0.6153089106, 0.6760601401, + 0.7887153327, 1.0065546930, 1.0829033256, 1.0347348750, + 0.9800128937, 0.9125770628 }, + { 0.5955827832, 0.6195687056, 0.2924164534, 0.3553958833, + 0.5417127609, 0.8713553548, 0.9977729619, 0.8817754686, + 0.7645328045, 0.6604627371 } }, + { { 1.1581378579, 1.0359145105, 0.7731179297, 0.6839243770, + 0.6839899123, 0.6664264500, 0.6910677254, 0.6579068601, + 0.6779606640, 0.6243527830 }, + { 1.1508634388, 0.8400294781, 0.2358594835, 0.2542749047, + 0.2484422624, 0.2620736063, 0.2676441073, 0.2713796198, + 0.3068997562, 0.3223005533 } }, + { { 0.1376220584, 1.2572927773, 0.8593623936, 0.6218624413, + 0.5128116906, 0.5393534899, 0.4436064065, 0.4334484339, + 0.4494390488, 0.4002220333 }, + { -0.1159995794, 1.2433337569, 0.4805027843, 0.2632532418, + 0.1769432425, 0.1868390739, 0.1555131972, 0.1530228555, + 0.1490252018, 0.1559064090 } }, + { { 0.1817273200, -0.0085216761, 0.0739872754, 0.1808098257, + 0.2770811915, 0.3344901204, 0.4292541742, 0.5404020548, + 0.5780193210, 0.5707449019 }, + { -0.0035409927, -0.0188107193, -0.0057691932, 0.0132360458, + 0.0560961366, 0.0534747243, 0.1002013981, 0.1737320125, + 0.1706518531, 0.1637706459 } }, + { { 0.9648087025, 1.0030813217, 0.9501943290, 0.8381944895, + 0.7545059025, 0.7621735334, 0.7121700943, 0.7328792512, + 0.7534573376, 0.7414643764 }, + { 0.1872322857, -0.0081939995, 0.0663851798, 0.0963348150, + 0.0509188473, 0.0565548837, 0.0471833348, 0.0809340179, + 0.1049199402, 0.1751082540 } }, + { { 0.6792713702, 0.9521603882, 0.5296542645, 0.3657504618, + 0.3905883431, 0.3121425807, 0.2726903260, 0.3156159520, + 0.2859284580, 0.3179096878 }, + { 0.2307477295, 0.3771536052, 0.0743804872, 0.0260154307, + 0.0477731526, 0.0391880274, 0.0228042006, 0.0572757721, + 0.0337485969, 0.0492149293 } }, + { { 0.8649328947, 0.9505875409, 1.0443030298, 1.1704584956, + 1.2709241211, 1.3232212961, 1.2477901578, 1.1513877213, + 1.0346038043, 0.9695272446 }, + { 0.4620873630, 0.5685822368, 0.8975039423, 1.0476453304, + 1.2278674245, 1.2290470600, 1.1962138712, 1.0051129162, + 0.8706344664, 0.7477557659 } }, + { { 0.4188340604, 0.6011532843, 0.4726385474, 0.6389671564, + 0.6753392518, 0.7842589319, 0.6147846282, 0.6708828509, + 0.6406055391, 0.5398777723 }, + { 0.1012499630, 0.2312064767, 0.1773364544, 0.2800302804, + 0.3348177969, 0.4343003929, 0.2822584808, 0.3293128312, + 0.3024433553, 0.2401848137 } }, + { { 0.5049474537, 0.7943513691, 0.9536021650, 0.9407572448, + 0.9823721647, 0.9747045338, 1.0145500004, 0.9629737139, + 0.9526191354, 0.9283710718 }, + { 0.0566204190, 0.0973178446, 0.5812305510, 0.5687133074, + 0.6834000945, 0.6616423726, 0.7611905038, 0.6683925092, + 0.6463071108, 0.6118355393 } }, + { { 0.8969141245, 0.9359731674, 0.8756151497, 0.8419300020, + 0.8353109360, 0.6807131469, 0.3358008265, 0.3386188447, + 0.3524467945, 0.4495045841 }, + { 0.5298508704, 0.4606455863, 0.4934132397, 0.4415748119, + 0.4015327394, 0.2052544951, -0.0329663455, -0.0154684186, + 0.0418094397, 0.1631152928 } }, + { { 0.6345762908, 2.5209445655, 1.0373562872, 0.9166402519, + 0.8865595460, 0.8907538056, 0.8522190452, 0.7290782034, + 0.7385808229, 0.6345107555 }, + { 0.2641707361, 2.5696372986, 0.8539884984, 0.6532538533, + 0.6087553799, 0.5851626694, 0.5276226699, 0.4330552220, + 0.3971418738, 0.3599833548 } }, +}; + +static const float wmavoice_lsp16_intercoeff_a[32][2][16] = { + { { 0.5337238312, 0.4810695648, -0.3766536713, -0.1204767227, + -0.0898437500, -0.0070896149, 0.1134738922, 0.1337728500, + 0.3739156723, 0.3849058151, 0.4220180511, 0.5404901505, + 0.5224876404, 0.5502910614, 0.5313453674, 0.4405946732 }, + { 0.1775283813, 0.1679325104, -0.2702789307, -0.1359367371, + -0.1452455521, -0.0888595581, -0.0256662369, -0.0023736954, + 0.1074047089, 0.1431636810, 0.1357412338, 0.2045526505, + 0.2686481476, 0.3404531479, 0.3209333420, 0.1493968964 } }, + { { 0.7402400970, 0.0838251114, 0.6486282349, 0.6145095825, + 0.7331047058, 0.7183008194, 0.7436847687, 0.7627944946, + 0.7653779984, 0.7795667648, 0.8399305344, 0.8393154144, + 0.8219690323, 0.7474164963, 0.6681070328, 0.6490793228 }, + { 0.2850513458, -0.0544128418, -0.0300130844, 0.0204677582, + 0.0328931808, 0.0589332581, 0.0796422958, 0.1187639236, + 0.1320505142, 0.1539077759, 0.2189874649, 0.2865276337, + 0.2973947525, 0.2614307404, 0.2416648865, 0.2428951263 } }, + { { 0.6129922867, 0.7300701141, 0.2073822021, 0.5005893707, + 0.5713691711, 0.5374965668, 0.6293134689, 0.5639057159, + 0.7402811050, 0.6982889175, 0.4668397903, 0.6698703766, + 0.8758535385, 0.8678569794, 0.8678569794, 0.7810840607 }, + { 0.2986249924, 0.3269615173, 0.0096416473, 0.1800708771, + 0.2474060059, 0.2203407288, 0.3007984161, 0.2674179077, + 0.4424810410, 0.4046306610, 0.2063980103, 0.4230022430, + 0.6222190857, 0.6574449539, 0.6776618958, 0.6604385376 } }, + { { 0.7258052826, 0.5073966980, -0.3947381973, 0.5254812241, + 1.0561246872, 0.9706230164, 0.9727144241, 0.9185838699, + 0.8184833527, 0.9093980789, 0.8645353317, 0.7870302200, + 0.6347675323, 0.5123996735, 0.2846002579, 0.3252801895 }, + { 0.4306297302, 0.2182903290, -0.4902458191, 0.1783485413, + 0.7783365250, 0.7152252197, 0.7404451370, 0.6012639999, + 0.5421304703, 0.6619558334, 0.6316919327, 0.5596818924, + 0.3952398300, 0.3567333221, 0.1505041122, 0.1290159225 } }, + { { 0.3077287674, 0.2543363571, 0.2834520340, 0.5282287598, + 0.5350360870, 0.4943971634, 0.4521999359, 0.3086309433, + 0.2372770309, 0.0819387436, -0.1385612488, -0.0848407745, + -0.0380916595, 0.1192150116, 0.3228197098, 0.3012905121 }, + { 0.0567188263, 0.0196886063, 0.0682420731, 0.2102527618, + 0.2452325821, 0.2060699463, 0.1620273590, 0.0784120560, + 0.0418329239, -0.0508041382, -0.2193880081, -0.1644783020, + -0.1361827850, -0.0307512283, 0.1486587524, 0.2356367111 } }, + { { 0.4387903214, 0.5723943710, 0.6147556305, 0.9973602295, + 1.1645498276, 1.1898927689, 1.0326681137, 0.6939010620, + 0.6064310074, 0.4686441422, 0.4646663666, 0.4895582199, + 0.5654230118, 0.6004848480, 0.6179132462, 0.6439123154 }, + { 0.1324195862, 0.2426080704, 0.3132238388, 0.7359752655, + 0.9749288559, 0.9535636902, 0.8105278015, 0.4118890762, + 0.3013315201, 0.2006158829, 0.2331352234, 0.2535161972, + 0.3375005722, 0.4103307724, 0.4102897644, 0.4529380798 } }, + { { 0.7335557938, 0.9203472137, 0.4852113724, 0.8646993637, + 0.7304391861, 0.7503690720, 0.6289854050, 0.6900463104, + 0.6421079636, 0.5184278488, 0.4444904327, 0.2660236359, + 0.2143125534, 0.2406396866, 0.4836940765, 0.5597229004 }, + { 0.3689947128, 0.4967346191, 0.1176567078, 0.5127687454, + 0.3235168457, 0.3426265717, 0.2417469025, 0.3310623169, + 0.2629890442, 0.2130823135, 0.1329116821, 0.0468769073, + -0.0081968307, 0.0146446228, 0.2440433502, 0.3408632278 } }, + { { 0.9425325394, 0.9597969055, 0.6160678864, 0.7050962448, + 0.8063859940, 0.9063224792, 0.9890356064, 1.0038805008, + 1.0338163376, 0.9453620911, 0.9634056091, 0.8068370819, + 0.6859455109, 0.8909034729, 0.9990415573, 1.0122871399 }, + { 0.6895952225, 0.6451835632, 0.3169965744, 0.4268569946, + 0.5666122437, 0.7722673416, 0.8845882416, 0.9061584473, + 0.9550399780, 0.8118810654, 0.8601064682, 0.6129922867, + 0.5069866180, 0.7065315247, 0.7862920761, 0.7766551971 } }, + { { 0.5641517639, -0.0941905975, 0.0412998199, 0.1810550690, + 0.3459482193, 0.4213209152, 0.4401025772, 0.5397109985, + 0.5607891083, 0.6348905563, 0.6861915588, 0.7280607224, + 0.7267074585, 0.6447324753, 0.5948257446, 0.5475025177 }, + { 0.1906919479, -0.0519113541, -0.0608100891, -0.0018815994, + 0.0383062363, 0.0362558365, 0.0529870987, 0.0692672729, + 0.0953073502, 0.1327886581, 0.1390628815, 0.1904459000, + 0.2362518311, 0.2063980103, 0.2311668396, 0.2291574478 } }, + { { 0.9901428223, 0.9589767456, 0.9012374878, 0.8017930984, + 0.8929538727, 0.8512077332, 0.8790111542, 0.8832759857, + 0.8949632645, 0.9159183502, 0.9293279648, 0.9152622223, + 0.9247350693, 0.8753614426, 0.8730239868, 0.8066730499 }, + { 0.4230432510, -0.0464572906, 0.0182533264, 0.1159753799, + 0.2349395752, 0.2740612030, 0.2987070084, 0.3620643616, + 0.3923282623, 0.4694643021, 0.5202322006, 0.5356512070, + 0.5564012527, 0.5362663269, 0.4791831970, 0.5046901703 } }, + { { 0.9785375595, 0.8820457458, 0.3965110779, 0.4790191650, + 0.3907699585, 0.4195575714, 0.2938270569, 0.4091415405, + 0.3659191132, 0.4030723572, 0.4168510437, 0.5030908585, + 0.5023117065, 0.5511522293, 0.5354051590, 0.5563192368 }, + { 0.6592903137, 0.2933759689, 0.0562677383, 0.1286878586, + 0.0758285522, 0.1192560196, 0.0508956909, 0.1175336838, + 0.0684061050, 0.0988750458, 0.0923957825, 0.1819572449, + 0.1965150833, 0.2257537842, 0.3049812317, 0.2993221283 } }, + { { 0.7120265961, 0.7847747803, 0.6065950394, 0.7235908508, + 0.6740531921, 0.6535081863, 0.3734235764, 0.4788551331, + 0.4410867691, 0.6927528381, 1.0758495331, 1.1148891449, + 1.0708875656, 0.8896322250, 0.6401805878, 0.5057153702 }, + { 0.4210338593, 0.4763126373, 0.3229017258, 0.4079113007, + 0.3922462463, 0.3529195786, 0.1258993149, 0.2168960571, + 0.2207508087, 0.4605655670, 0.8759355545, 0.9526205063, + 0.8843832016, 0.7001342773, 0.4503545761, 0.3484086990 } }, + { { 0.5254402161, 0.5349540710, 0.7036199570, 0.6240234375, + 0.6464548111, 0.7537727356, 0.8311548233, 0.7334327698, + 0.3484907150, 0.1846637726, 0.0894021988, 0.3977823257, + 0.7672233582, 0.9224796295, 0.8818407059, 0.7453250885 }, + { 0.2587652206, 0.2524499893, 0.4135704041, 0.3129367828, + 0.3403711319, 0.4473199844, 0.5330266953, 0.4227561951, + 0.1080198288, -0.0044651031, -0.0727024078, 0.1583776474, + 0.5302381516, 0.7313823700, 0.6735610962, 0.5630855560 } }, + { { 0.7936325073, 0.8551034927, 0.9755849838, 0.8953323364, + 0.9345769882, 0.7202281952, 0.8388233185, 0.7941656113, + 0.7550849915, 0.7894906998, 0.8590402603, 0.7813711166, + 0.8483371735, 0.8652324677, 0.8586711884, 0.9584846497 }, + { 0.4781579971, 0.4731960297, 0.8289403915, 0.6175031662, + 0.7262973785, 0.3638277054, 0.5544328690, 0.4761896133, + 0.4388723373, 0.5021476746, 0.5630445480, 0.4562187195, + 0.5190429688, 0.5937595367, 0.6121721268, 0.6973457336 } }, + { { 1.0724458694, 1.0449705124, 0.8594503403, 0.7604160309, + 0.7837905884, 0.8136444092, 0.7623023987, 0.6098756790, + 0.6432561874, 0.6395244598, 0.6853713989, 0.7401580811, + 0.7399530411, 0.7652549744, 0.7675104141, 0.7393789291 }, + { 0.9382266998, 0.8419809341, 0.3087539673, 0.3620233536, + 0.3547649384, 0.4241094589, 0.2857894897, 0.2123851776, + 0.2355957031, 0.2794332504, 0.3219995499, 0.3898267746, + 0.3937635422, 0.4058198929, 0.4228382111, 0.4181222916 } }, + { { 1.0275421143, 1.0940570831, 1.0164289474, 0.9097671509, + 0.9400720596, 0.8976287842, 0.9175586700, 0.8900833130, + 0.9154262543, 0.9492578506, 1.0011329651, 1.0361537933, + 1.0359487534, 0.9320344925, 0.8974237442, 0.8811845779 }, + { 1.0046186447, 1.0860195160, 0.9442958832, 0.7473344803, + 0.7876043320, 0.7410602570, 0.7422084808, 0.6844692230, + 0.7256412506, 0.8455486298, 0.8969316483, 0.9362173080, + 0.9092340469, 0.8227071762, 0.7481546402, 0.7088689804 } }, + { { 0.2205047607, -0.0129537582, 0.0972347260, 0.1154832840, + 0.0951843262, 0.1532516479, 0.1288108826, 0.1749858856, + 0.1591157913, 0.2134923935, 0.2477340698, 0.2634811401, + 0.3032999039, 0.3272485733, 0.3170785904, 0.3172016144 }, + { 0.0032854080, -0.0446119308, 0.0284643173, 0.0155467987, + -0.0063104630, 0.0226001740, 0.0086984634, 0.0262088776, + 0.0173921585, 0.0360507965, 0.0366659164, 0.0215339661, + 0.0412178040, 0.1047391891, 0.1258172989, 0.0609836578 } }, + { { 0.1495609283, 0.3275766373, 0.8598194122, 0.6847562790, + 0.7550849915, 0.5662431717, 0.6930398941, 0.7526245117, + 0.7300291061, 0.7284708023, 0.6608896255, 0.5224056244, + 0.4273900986, 0.5757160187, 0.4625749588, 0.5123586655 }, + { -0.0352210999, -0.0428895950, 0.3110914230, 0.2699604034, + 0.3307752609, 0.2059469223, 0.2332172394, 0.3204412460, + 0.2846412659, 0.3354911804, 0.2448635101, 0.1514062881, + 0.1062564850, 0.2613077164, 0.2123441696, 0.3000602722 } }, + { { 0.6218910217, 0.6033554077, 0.4551525116, 0.3161764145, + 0.2864866257, 0.6195125580, 0.7577505112, 1.0062179565, + 0.8485012054, 0.6777849197, 0.7455301285, 0.3630485535, + 0.2327661514, 0.5563192368, 0.4448595047, 0.3806819916 }, + { 0.2624969482, 0.2679510117, 0.1839666367, 0.0335903168, + 0.0294075012, 0.2902593613, 0.4959144592, 0.7905979156, + 0.5748548508, 0.3753919601, 0.4855394363, 0.1089630127, + 0.0362968445, 0.3632535934, 0.2681150436, 0.2735691071 } }, + { { 0.7064495087, 0.4431781769, 0.7628355026, 0.7271585464, + 0.7812070847, 0.7806739807, 0.8909854889, 0.8958654404, + 0.9126787186, 0.9038209915, 0.9246120453, 0.9624624252, + 0.9732475281, 0.7420034409, 0.5060844421, 0.5189199448 }, + { 0.3457021713, -0.0149221420, 0.3174476624, 0.3580865860, + 0.4243965149, 0.4275541306, 0.5887155533, 0.6478490829, + 0.6320610046, 0.6627349854, 0.6868886948, 0.7396659851, + 0.7551259995, 0.5275316238, 0.3075237274, 0.3806819916 } }, + { { 0.4376831055, 0.4904603958, 0.6262788773, 0.5901098251, + 0.4176712036, 0.0221490860, -0.1612796783, -0.2236118317, + -0.1087894440, -0.0022506714, 0.1051902771, 0.3307752609, + 0.4167690277, 0.4997692108, 0.4645843506, 0.5228567123 }, + { 0.1228237152, 0.1671123505, 0.2931299210, 0.2549924850, + 0.1435737610, -0.1124801636, -0.2181987762, -0.2723293304, + -0.1573429108, -0.0837745667, -0.0325555801, 0.1024427414, + 0.1938495636, 0.2825498581, 0.2247285843, 0.2879629135 } }, + { { 0.6100807190, 0.7900238037, 0.9581155777, 0.8999662399, + 0.9277286530, 0.9720993042, 0.9966220856, 0.9630365372, + 0.9571723938, 0.8992280960, 0.8370189667, 0.7417984009, + 0.7174396515, 0.6122951508, 0.6746683121, 0.7030458450 }, + { 0.0859165192, 0.0914115906, 0.6077432632, 0.5471334457, + 0.5943746567, 0.6805324554, 0.6680250168, 0.6033554077, + 0.6302976608, 0.4874258041, 0.3647298813, 0.2770137787, + 0.2544183731, 0.2608156204, 0.3331537247, 0.4950942993 } }, + { { 0.4051227570, 1.1022176743, 0.8262338638, 0.6573219299, + 0.5948667526, 0.5426225662, 0.4987850189, 0.4370269775, + 0.4421119690, 0.3837165833, 0.3728494644, 0.3706760406, + 0.4169740677, 0.3559951782, 0.2994041443, 0.3896217346 }, + { 0.0716867447, 0.9253911972, 0.2780799866, 0.2460117340, + 0.1675224304, 0.1527595520, 0.1278266907, 0.1226596832, + 0.1165084839, 0.0982189178, 0.0952253342, 0.1113414764, + 0.1498889923, 0.0940361023, 0.0802984238, 0.1560811996 } }, + { { 0.7024717331, 0.7363853455, 0.9629545212, 0.9635286331, + 1.0819597244, 1.1529855728, 1.2984409332, 1.2693252563, + 1.2848672867, 1.2877378464, 1.2133083344, 1.0696573257, + 1.0864706039, 0.9851808548, 0.8312368393, 0.8047866821 }, + { 0.3001422882, 0.2273120880, 0.6279602051, 0.6936140060, + 0.8097076416, 0.9440498352, 1.1028738022, 1.1766471863, + 1.1199741364, 1.1608181000, 1.0665817261, 0.8872537613, + 0.9082908630, 0.7602519989, 0.6542053223, 0.7317514420 } }, + { { 0.0643463135, -0.6808919907, 0.2889881134, 0.6142225266, + 0.6356697083, 0.6825828552, 0.6259508133, 0.4945611954, + 0.5866651535, 0.6357517242, 0.5208883286, 0.4207878113, + 0.5125637054, 0.3758020401, 0.5424175262, 0.6172571182 }, + { -0.0636806488, -0.7585611343, 0.0850553513, 0.2996912003, + 0.3620643616, 0.4444084167, 0.4597454071, 0.3120756149, + 0.4016780853, 0.5026807785, 0.4111919403, 0.3183498383, + 0.3666572571, 0.1829824448, 0.3269205093, 0.4095926285 } }, + { { 0.9277286530, 0.9651279449, 0.9602069855, 0.9327726364, + 0.9208393097, 0.8868436813, 0.9011554718, 0.8569488525, + 0.9015245438, 0.8969726562, 0.9367094040, 0.9445009232, + 0.8617057800, 0.8215589523, 0.8333692551, 0.7939195633 }, + { 0.1719102859, 0.1142530441, 0.1245460510, 0.1646108627, + 0.1408672333, 0.0949792862, 0.0271930695, 0.0265779495, + -0.0064334869, -0.0109033585, 0.0152187347, 0.0252656937, + 0.0166950226, 0.0736141205, 0.1205682755, 0.1895437241 } }, + { { 0.5964250565, 0.6065130234, 0.7228116989, 0.7348270416, + 0.0718097687, 0.2369899750, 0.2456426620, 0.4961194992, + 0.6410417557, 0.6765956879, 0.6771287918, 0.7285938263, + 0.6706905365, 0.5105543137, 0.5068635941, 0.5430326462 }, + { 0.2782440186, 0.2620048523, 0.4424400330, 0.4124631882, + -0.1158838272, 0.0186223984, 0.0059919357, 0.1853609085, + 0.3568563461, 0.3791646957, 0.4100847244, 0.4654865265, + 0.4614677429, 0.3209743500, 0.3199081421, 0.3836755753 } }, + { { 0.8051557541, 0.8506336212, 0.9544658661, 0.5584516525, + 0.5874032974, 0.5727224350, 0.6177902222, 0.7659521103, + 0.9526205063, 1.0424280167, 1.0705595016, 1.0042905807, + 0.6005258560, 0.3886785507, 0.4739751816, 0.6542463303 }, + { 0.4775428772, 0.5541868210, 0.7128057480, 0.2146816254, + 0.2502765656, 0.2488822937, 0.3009214401, 0.4667987823, + 0.6929988861, 0.8599834442, 0.8784780502, 0.7463912964, + 0.3217535019, 0.1274986267, 0.2767267227, 0.5119485855 } }, + { { 0.5978193283, 0.5092830658, 1.0738401413, 0.7688636780, + 0.8214769363, 0.7682075500, 0.4970626831, 0.2783260345, + 0.2652854919, 0.3625154495, 0.5700569153, 0.5044031143, + 0.4003248215, 0.5162544250, 0.5727634430, 0.5538587570 }, + { 0.2752094269, 0.1747808456, 0.8557186127, 0.4280872345, + 0.5143680573, 0.4139804840, 0.1810960770, 0.0109539032, + 0.0317039490, 0.0842351913, 0.3129367828, 0.2614717484, + 0.1564092636, 0.2352676392, 0.3249931335, 0.3505821228 } }, + { { 0.7093610764, 0.7587757111, 1.8517618179, 1.0092525482, + 0.8078622818, 0.8792982101, 0.8210668564, 0.8600654602, + 0.6913585663, 0.6436662674, 0.6216859818, 0.6123771667, + 0.5940465927, 0.5910940170, 0.6505966187, 0.5801038742 }, + { 0.3370904922, 0.4681930542, 1.9236078262, 0.8053607941, + 0.5321245193, 0.6342344284, 0.5054693222, 0.5788326263, + 0.4400615692, 0.4086904526, 0.3924102783, 0.4220180511, + 0.3835115433, 0.4230432510, 0.5190839767, 0.3990535736 } }, + { { 0.6277141571, 1.1122236252, 1.0259838104, 0.9486427307, + 0.9184608459, 0.9059944153, 0.9080038071, 0.8282022476, + 0.8440313339, 0.7887935638, 0.7468013763, 0.6746683121, + 0.6319379807, 0.6246795654, 0.7263793945, 0.7349090576 }, + { 0.2427721024, 1.0851583481, 0.6180362701, 0.5837125778, + 0.4324750900, 0.4684801102, 0.3745307922, 0.3027257919, + 0.3646888733, 0.2409267426, 0.2158298492, 0.2052907944, + 0.2100887299, 0.2276401520, 0.3409452438, 0.4045896530 } }, + { { 0.8391513824, 0.8713426590, 1.1366233826, 1.1440868378, + 1.1443738937, 1.0877418518, 1.0516138077, 1.0099496841, + 0.9216184616, 0.8990640640, 0.9001302719, 0.8993101120, + 0.8055248260, 0.8150796890, 0.7272815704, 0.7196130753 }, + { 0.4634771347, 0.5807189941, 1.1287908554, 1.1066875458, + 1.0765056610, 0.9287538528, 0.8956193924, 0.8026132584, + 0.6725769043, 0.5856809616, 0.5527515411, 0.5183868408, + 0.4529380798, 0.5074377060, 0.4632720947, 0.5554990768 } }, +}; + +static const float wmavoice_lsp16_intercoeff_b[32][2][16] = { + { { 0.5431776047, -0.1212130189, -0.2471650839, 0.0683670044, + 0.1418520808, 0.2518971562, 0.3708084226, 0.4141484499, + 0.5712364912, 0.5852659345, 0.5670641661, 0.6401320100, + 0.6447737217, 0.6726239920, 0.4994724989, 0.5574678183 }, + { 0.2040718794, -0.1271064281, -0.2266163826, -0.0406349897, + -0.0145058036, 0.0283126831, 0.0851084590, 0.0913147926, + 0.1307432652, 0.1926501393, 0.2310355306, 0.2828245163, + 0.3171940446, 0.4424681067, 0.2960716486, 0.3510941863 } }, + { { 0.8073900938, 0.0403081179, 0.5392660499, 0.6928597689, + 0.6499369740, 0.7328097820, 0.7755761147, 0.7766191959, + 0.8820225596, 0.8423333168, 0.8898978233, 0.8488525748, + 0.8654375672, 0.6728326082, 0.6169234514, 0.6755967736 }, + { 0.3653843999, -0.0846008658, -0.0224332213, 0.1120721102, + 0.1020585299, 0.1741876006, 0.2129902244, 0.2160151601, + 0.3619422317, 0.4185815454, 0.5455245376, 0.5363975763, + 0.5429168344, 0.3505726457, 0.3296067119, 0.3620986938 } }, + { { 0.1843576431, 0.0179861784, 0.3122915626, 0.3600125313, + 0.2466817498, 0.2172668576, 0.1975526214, 0.1177569032, + 0.1196866035, 0.0849519968, 0.0962694287, 0.1591672301, + 0.2300446033, 0.3082756996, 0.4047607183, 0.3925045133 }, + { -0.0275964737, -0.0794897676, 0.1168181300, 0.1591150761, + 0.0915755630, 0.0460972190, 0.0562151074, 0.0084419847, + -0.0095511675, -0.0408957601, -0.0376100540, -0.0166962743, + 0.0656028390, 0.1226072311, 0.2293144464, 0.2142419219 } }, + { { 0.4781936407, -1.2478972673, 0.4884679914, 0.7755239606, + 0.6785174012, 0.6590117812, 0.6177057624, 0.6427918673, + 0.5402048230, 0.5512614846, 0.6424267888, 0.4229103327, + 0.5106334686, 0.5136062503, 0.4490395188, 0.4753251672 }, + { 0.2852236032, -1.3815159798, 0.1904075146, 0.4874770641, + 0.4593138695, 0.4182686210, 0.4174863100, 0.4604612589, + 0.4089330435, 0.3891666532, 0.4700576067, 0.2383370996, + 0.2801646590, 0.3398289084, 0.2766703367, 0.3374298215 } }, + { { 0.5925153494, 0.3858809471, 1.0754098296, 0.5752002001, + 0.5516265631, 0.4853909016, 0.4719351530, 0.5018194318, + 0.3037382960, 0.5154316425, 0.8809794784, 0.7755761147, + 0.5941321254, 0.3974069953, 0.5925675035, 0.6097261906 }, + { 0.3008176684, 0.0706617832, 0.8484353423, 0.2574254870, + 0.2815728188, 0.1930673718, 0.2523665428, 0.2691601515, + 0.1271967888, 0.2653007507, 0.6473292708, 0.5275835395, + 0.3928174376, 0.2405275702, 0.4008491635, 0.4556109309 } }, + { { 0.7339050174, 0.4290645123, 0.6859754324, 0.6349166036, + 0.8034263849, 0.8509387374, 0.8591269255, 1.1049811840, + 1.3928194642, 1.3423343301, 1.0849018693, 0.8943830729, + 0.8579795361, 0.6920774579, 0.5613272190, 0.4303162098 }, + { 0.4534726143, 0.0901674032, 0.3465046287, 0.3470261693, + 0.5217422843, 0.5874564052, 0.6014336944, 0.9161834717, + 1.2823571563, 1.2193550467, 0.8868207335, 0.6514494419, + 0.6249030232, 0.4453887343, 0.3665317893, 0.2242033482 } }, + { { 0.4293252826, 0.3303368688, 0.6181751490, 0.9884168506, + 0.9915460944, 0.7939864993, 0.3019129038, 0.2443348169, + 0.4543070793, 0.5617444515, 0.4895110726, 0.6600027084, + 0.6290231943, 0.5580936670, 0.5459417701, 0.4647378922 }, + { 0.1409133077, -0.0050137639, 0.2551307082, 0.6764833927, + 0.7112701535, 0.4648943543, 0.0301380754, -0.0235806108, + 0.1018499136, 0.2422486544, 0.2406318784, 0.4000146985, + 0.3713299632, 0.3259559274, 0.3820737004, 0.2888743877 } }, + { { 0.7733334899, 0.8321111202, 1.3098945022, 1.0331128836, + 1.0380675197, 0.9479974508, 0.9740223289, 0.9442945123, + 0.8926619887, 0.8719046712, 0.8640815616, 0.8404036164, + 0.8359183669, 0.7675965428, 0.6895219088, 0.7266034484 }, + { 0.3655408621, 0.4643206596, 1.2171645761, 0.8341451287, + 0.8387868404, 0.6713201404, 0.6814901829, 0.6294404268, + 0.5172048807, 0.5205948949, 0.5408828259, 0.5298783183, + 0.5781729817, 0.5000983477, 0.4727174640, 0.4326109886 } }, + { { 0.8902629018, 0.4598354101, 0.6392975450, 0.4483093619, + 0.6220867038, 0.6323089004, 0.7063676715, 0.3717993498, + 0.6718416810, 0.7876758575, 0.2807383537, 0.3118221760, + 0.6703813672, 0.7662405372, 0.7122610807, 0.7851724625 }, + { 0.6301705837, 0.1221378446, 0.3532846570, 0.1412783861, + 0.3471826315, 0.3435318470, 0.4466925859, 0.1390357614, + 0.4092981219, 0.5406742096, 0.0690450072, 0.0829179883, + 0.4625995755, 0.5700891018, 0.5542864203, 0.6545265317 } }, + { { -0.1100520492, 0.3803526163, 0.8075987101, 0.6903563738, + 0.8012359142, 0.7835035324, 0.8195941448, 0.8381088376, + 0.8033220768, 0.7511680126, 0.6393496990, 0.6096218824, + 0.6934856176, 0.6690253615, 0.6401841640, 0.5600233674 }, + { -0.1776958704, -0.0293175578, 0.1520742774, 0.1746048331, + 0.2222214937, 0.3052507639, 0.2977927327, 0.3797789216, + 0.3395681381, 0.2976884246, 0.2516885400, 0.2403711081, + 0.3567789793, 0.3302847147, 0.3368039727, 0.3310148716 } }, + { { 0.5587195158, 0.4676063657, 0.1392965317, -0.0990996957, + -0.0816280842, -0.1146416068, -0.0116894841, 0.0521992445, + 0.1626615524, 0.2923687100, 0.4029874802, 0.4528989196, + 0.4694839120, 0.5058352947, 0.5369191170, 0.5105291605 }, + { 0.2193530202, 0.1211469173, 0.0179861784, -0.2022604346, + -0.1409794092, -0.2121175528, -0.1152674556, -0.0594626069, + -0.0122110248, 0.0274260640, 0.1414870024, 0.2044369578, + 0.2167974710, 0.2615978122, 0.3348221183, 0.3707562685 } }, + { { 0.5948622823, 0.7065241337, 0.9414781928, 0.9340723157, + 0.8835350275, 0.9730835557, 0.8503650427, 0.8902629018, + 0.8746688366, 0.6910865307, 0.6404449344, 0.6976057887, + 0.5916287303, 0.6022160053, 0.7729684114, 0.6096740365 }, + { 0.1262058616, 0.1300652623, 0.6594290137, 0.6535877585, + 0.5639349222, 0.6982316375, 0.4828875065, 0.5577285886, + 0.4591052532, 0.2964367270, 0.2695252299, 0.3324751854, + 0.2860580683, 0.2902825475, 0.4623388052, 0.3369604349 } }, + { { 0.8821268678, 0.8539636731, 0.2898653150, 0.7478301525, + 0.5109463930, 0.8577187657, 0.4884679914, 0.7846509218, + 0.7684310079, 0.7032384276, 0.6691296697, 0.8593355417, + 0.9383489490, 0.9808023572, 0.6804992557, 0.6403927803 }, + { 0.5590324402, 0.4209806323, 0.0259135962, 0.4318808317, + 0.2104346752, 0.5453680754, 0.1783599257, 0.4467447400, + 0.4352708459, 0.4089330435, 0.3994410038, 0.5984609127, + 0.6872792840, 0.7321317792, 0.4408513308, 0.4542027712 } }, + { { 0.6371070743, 0.6311093569, 0.7152860165, 0.6929640770, + 0.2292101383, 0.3234525323, 0.9644259810, 0.9881039262, + 0.8722697496, 0.4370440841, 0.4051779509, 0.4944135547, + 0.5392660499, 0.5969484448, 0.4268740416, 0.4990552664 }, + { 0.4233797193, 0.3647063971, 0.4345406890, 0.4180078506, + -0.0006328225, 0.0586141944, 0.7620160580, 0.8152132034, + 0.6707985997, 0.2095480561, 0.2178405523, 0.2776612639, + 0.3142212629, 0.3808741570, 0.2676998377, 0.2804775834 } }, + { { 0.4509170651, 0.9490405321, 0.8557890654, 0.8271043301, + 0.6915559173, 0.7321839333, 0.6257896423, 0.6274064183, + 0.5238284469, 0.5194996595, 0.4116972089, 0.3382642865, + 0.3755022883, 0.4867990613, 0.5686287880, 0.5106856227 }, + { 0.0989292860, 0.6244857907, 0.4700576067, 0.3905226588, + 0.2630059719, 0.3009741306, 0.2150763869, 0.2067838907, + 0.1533781290, 0.1815934777, 0.1023714542, 0.0373874903, + 0.0897501707, 0.1849313378, 0.2852757573, 0.2625887394 } }, + { { 0.9954054952, 0.9554033279, 0.8237664700, 0.9780903459, + 0.7261862159, 0.7884581685, 0.7933084965, 0.7393290401, + 0.8783196211, 1.0409359932, 1.0217954516, 0.9159227014, + 0.8698185086, 0.7057939768, 0.7662926912, 0.7339571714 }, + { 0.7913266420, 0.6739278436, 0.5061482191, 0.7058982849, + 0.3480692506, 0.4338105321, 0.4428853393, 0.3758152127, + 0.5962182879, 0.7925261855, 0.7968549728, 0.6629754901, + 0.6325175166, 0.4598354101, 0.5310778618, 0.5518873334 } }, + { { 0.4638512731, 0.0604917407, 0.1897295117, 0.3403504491, + 0.4708399177, 0.5241413713, 0.6061275601, 0.6446694136, + 0.7313494682, 0.7208143473, 0.6268848777, 0.6081094146, + 0.4913364649, 0.3529717326, 0.4954566360, 0.5767126679 }, + { 0.1353849769, -0.0274400115, 0.0002537966, 0.0272174478, + 0.0555371046, 0.0652899146, 0.1010676026, 0.1073260903, + 0.1568724513, 0.2207611799, 0.1434167027, 0.2262373567, + 0.1177047491, 0.0162650943, 0.2529402375, 0.4087765813 } }, + { { 0.9700064659, 0.9917025566, 0.9159227014, 0.9309430718, + 0.8991290927, 0.9314124584, 0.9059612751, 0.9473194480, + 0.9604622722, 0.9377752542, 0.9197821021, 0.8869771957, + 0.8506779671, 0.8594920039, 0.8320589662, 0.8739908338 }, + { 0.2892394662, 0.0551198721, 0.0892807841, 0.1158793569, + 0.0905846357, 0.0738953352, 0.0395258069, 0.0240360498, + 0.0477139950, 0.0751470327, 0.1171310544, 0.1555164456, + 0.1384620667, 0.1818542480, 0.2104868293, 0.1288135648 } }, + { { 0.4101847410, 0.3326316476, 0.4666675925, 0.5077128410, + 0.5892296433, 0.4272912741, 0.0603352785, -0.8668596745, + -1.1103670001, -0.0900248885, 0.1626615524, 0.1487885714, + 0.4130010605, 0.5119373202, 0.5820323825, 0.5486016273 }, + { 0.0383262634, 0.1300652623, 0.2295230627, 0.2706204653, + 0.3722165823, 0.1698066592, -0.0934670568, -0.8677462935, + -1.0724509954, -0.2164463401, -0.0056917667, -0.0301520228, + 0.1299088001, 0.2579991817, 0.3482257128, 0.2469425201 } }, + { { 0.6031547785, 0.5515222549, 0.4292209744, 0.5027582049, + 0.8167778254, 1.0925685167, 0.9878953099, 0.7019345760, + 0.2509583831, 0.2475162148, 0.5660732388, 0.5145971775, + 0.4824181199, 0.5970005989, 0.5996604562, 0.5384315848 }, + { 0.3677313328, 0.2650399804, 0.1585935354, 0.2213348746, + 0.5566333532, 0.8425940871, 0.7604514360, 0.4523773789, + 0.0681062341, 0.0737388730, 0.3169854283, 0.2868403792, + 0.2661873698, 0.3635068536, 0.4300554395, 0.3743027449 } }, + { { 0.5017672777, 0.6634970307, 0.6869142056, 0.7066284418, + 0.5669598579, 0.0621085167, 0.0634645224, 0.2321307659, + 0.8322675824, 0.9855483770, 0.8296598792, 0.6140028238, + 0.5462546945, 0.6730412245, 0.6856103539, 0.5975221395 }, + { 0.2680649161, 0.3324230313, 0.3688787222, 0.3886451125, + 0.2774004936, -0.1695076823, -0.1353467703, 0.0159000158, + 0.5895425677, 0.7586781979, 0.5639870763, 0.3687744141, + 0.3401418328, 0.4477356672, 0.4782979488, 0.4034568667 } }, + { { 0.8838479519, 0.9025712609, 0.7326533198, 0.8124490380, + 0.8956347704, 1.1007045507, 1.2731780410, 1.2029786706, + 1.0839109421, 0.9664078355, 0.7356782556, 0.6942157745, + 0.6917645335, 0.6383587718, 0.6503020525, 0.5989302993 }, + { 0.5576764345, 0.4596789479, 0.3790487647, 0.5514179468, + 0.7333834767, 0.9612445831, 1.1976589561, 1.1094664335, + 0.8868207335, 0.6789346337, 0.4643206596, 0.4029353261, + 0.4384522438, 0.3871847987, 0.4326109886, 0.3691916466 } }, + { { 0.8520861268, 0.8413423896, 0.7238392830, 0.9103943706, + 0.7072542906, 0.6479029655, 0.4557673931, 0.1908247471, + -0.0569070578, -0.1013423204, 0.2517406940, 0.4854952097, + 0.5820845366, 0.5886037946, 0.6177579165, 0.6226603985 }, + { 0.6160889864, 0.4592095613, 0.4752208591, 0.6685559750, + 0.4326109886, 0.4077335000, 0.2314006090, 0.0173603296, + -0.2208272815, -0.3014574647, 0.0321199298, 0.2559130192, + 0.3603254557, 0.3466089368, 0.4072119594, 0.4776199460 } }, + { { 0.7083495259, 0.9001721740, 0.6795083284, 1.2743254304, + 1.3672639728, 1.2563322783, 0.8557369113, 0.8287732601, + 0.7942472696, 0.8006622195, 0.7034991980, 0.5479236245, + 0.6391932368, 0.6248508692, 0.5495925546, 0.4719351530 }, + { 0.4000146985, 0.6493632793, 0.4583229423, 1.1484255195, + 1.2521599531, 1.1232351065, 0.6150459051, 0.5347808003, + 0.4726653099, 0.5269576907, 0.4278128147, 0.2745841742, + 0.3868718743, 0.4183729291, 0.3474434018, 0.3150035739 } }, + { { 0.9070043564, 0.7648323774, 0.4281778932, 0.5475063920, + 0.4134704471, 0.4706834555, 0.4549329281, 0.4648422003, + 0.4572798610, 0.4823138118, 0.4666154385, 0.4841913581, + 0.4018922448, 0.4297946692, 0.4646857381, 0.6091003418 }, + { 0.4925360084, 0.2065231204, 0.0948612690, 0.1716842055, + 0.0992422104, 0.1332988143, 0.1255800128, 0.1257364750, + 0.0955392718, 0.1118634939, 0.1372103691, 0.1525958180, + 0.0902717113, 0.1591672301, 0.2335910797, 0.3767018318 } }, + { { 0.3185500503, 0.8677845001, 0.7776622772, 0.8160476685, + 0.8624126315, 0.8057211637, 0.8852561116, 0.8471314907, + 0.9145145416, 0.8945916891, 0.8638729453, 0.8531292081, + 0.7425104380, 0.6215651631, 0.6501455903, 0.6341864467 }, + { -0.0499705672, 0.0687842369, 0.3051464558, 0.3368039727, + 0.4942049384, 0.3823344707, 0.5683158636, 0.5044271350, + 0.6278236508, 0.5777035952, 0.5745221972, 0.5502184033, + 0.4244228005, 0.3163595796, 0.3525545001, 0.3582914472 } }, + { { 0.3200625181, 0.9415303469, 0.6067534089, 0.3568832874, + 0.1600538492, 0.2938811779, 0.2037589550, 0.3017564416, + 0.2572168708, 0.4796018004, 0.6938506961, 0.6847758889, + 0.7232134342, 0.6111343503, 0.5159531832, 0.4856516719 }, + { 0.0680540800, 0.6285016537, 0.2514277697, 0.0790064335, + -0.0687981844, 0.0521992445, -0.0055874586, 0.0537117124, + 0.0188206434, 0.1883213520, 0.4493002892, 0.4300554395, + 0.4750122428, 0.3658016324, 0.3119786382, 0.2818335891 } }, + { { 0.6864969730, 1.0815640092, 0.9838794470, 0.8845259547, + 0.9438772798, 0.8888025880, 0.8178730607, 0.8581881523, + 0.7128347754, 0.7120524645, 0.7345308661, 0.7945601940, + 0.7854853868, 0.8261655569, 0.6941114664, 0.6646444201 }, + { 0.2847542167, 0.9535257816, 0.6691818237, 0.5026538968, + 0.5945493579, 0.4125838280, 0.3886451125, 0.3740941286, + 0.2453778982, 0.2928902507, 0.3219922185, 0.4065861106, + 0.3838469386, 0.4289602041, 0.3910441995, 0.3821780086 } }, + { { 1.1335094571, 1.0390062928, 0.7019867301, 0.6203134656, + 0.6951545477, 0.4863818288, 0.6171320677, 0.6247465611, + 0.5907421112, 0.6711115241, 0.7322882414, 0.7042293549, + 0.5635698438, 0.6174449921, 0.6727283001, 0.6431047916 }, + { 1.0146503448, 0.7762541175, 0.2200310230, 0.2459515929, + 0.2703596950, 0.1376276016, 0.2522100806, 0.2622758150, + 0.2389107943, 0.2956544161, 0.3799875379, 0.3653843999, + 0.2561216354, 0.2842326760, 0.4034568667, 0.3700782657 } }, + { { 0.6342907548, 0.9627570510, 0.5214815140, -0.0226939917, + 0.5616401434, 0.7231091261, 0.7417802811, 0.9092991352, + 0.9739701748, 0.7804785967, 0.6771092415, 0.6352295280, + 0.4660417438, 0.5869870186, 0.6692339778, 0.5986173749 }, + { 0.3988673091, 0.6997441053, 0.2316613793, -0.2566571236, + 0.2685343027, 0.4484136701, 0.4490395188, 0.6886874437, + 0.7703085542, 0.5847443938, 0.4539941549, 0.4098196626, + 0.2579991817, 0.3376384377, 0.4754816294, 0.5095382333 } }, + { { 0.4443456531, 2.0296727419, 0.6569256186, 0.6439914107, + 0.6436263323, 0.5507399440, 0.6095175743, 0.6066491008, + 0.5347808003, 0.2529402375, 0.4443978071, 0.7000570297, + 0.8259569407, 0.5927761197, 0.5078171492, 0.4418422580 }, + { 0.2430831194, 1.9133691788, 0.3723730445, 0.3764410615, + 0.3874977231, 0.3212099075, 0.3832210898, 0.4474227428, + 0.3644977808, 0.0814055204, 0.2752621770, 0.4647378922, + 0.6619845629, 0.4304205179, 0.3143777251, 0.2705683112 } }, + { { 0.9740744829, 1.0730628967, 0.9743352532, 0.9098728299, + 0.9453375936, 0.9661470652, 0.9270836711, 0.9643738270, + 0.9989519715, 0.9627048969, 0.9348546267, 0.9865393043, + 0.9399657249, 0.9752218723, 0.8440544009, 0.8819182515 }, + { 0.9258319736, 1.0357205868, 0.8463491797, 0.8108844161, + 0.8391519189, 0.8566235304, 0.8305986524, 0.8880724311, + 0.9181653261, 0.8670021892, 0.8305986524, 0.8995984793, + 0.8300249577, 0.8711223602, 0.7195626497, 0.8138571978 } }, +}; + +static const double wmavoice_mean_lsf10[2][10] = { + { 0.2235394066, 0.4097484909, 0.7025292732, 1.1077160169, + 1.3939179044, 1.6741291716, 1.9552949226, 2.2199793918, + 2.5103400247, 2.7829212906 }, + { 0.1493683393, 0.3714357373, 0.7702730245, 1.0609411394, + 1.3270362536, 1.5806033119, 1.8398507524, 2.1116740248, + 2.3823505771, 2.6865718527 } +}; + +static const double wmavoice_mean_lsf16[2][16] = { + { 0.0999206754, 0.2345933590, 0.4621011210, 0.6772546160, + 0.8346396060, 1.0067495130, 1.1571691668, 1.3292508688, + 1.4941465650, 1.6600755584, 1.8461284908, 2.0529487333, + 2.2690810112, 2.4949894820, 2.7172752965, 2.9164840903 }, + { 0.0918298402, 0.2475621892, 0.4782937721, 0.6284774045, + 0.7861951264, 0.9303736000, 1.0940441024, 1.2521029300, + 1.4434732098, 1.6551410742, 1.8917962963, 2.0967280403, + 2.2981430375, 2.4826173497, 2.6827972461, 2.8811350800 } +}; + +static const float wmavoice_std_codebook[1000] = { + -0.185013, -0.150405, -0.707267, -0.284100, 0.882898, + -0.788627, 0.061005, 0.374431, 0.053843, -0.909826, + 0.543602, 0.219326, 0.285698, 0.154709, -0.455005, + 0.426276, -0.868852, -0.952324, -0.550001, 0.813814, + -0.352815, 0.242122, 0.820495, -0.189574, -0.449538, + 0.499132, -0.247783, 0.598159, 0.732040, -0.564406, + -0.631788, -0.452973, 0.285189, -0.339055, 0.262927, + 0.168087, -0.127682, -0.676067, -0.457481, 0.926161, + -0.585893, -0.913880, 0.145487, 0.699804, 0.240829, + 0.690482, 0.126081, 0.371977, 0.738158, 0.576080, + 0.185791, -0.614657, -0.181799, 0.006285, 0.195768, + 0.368663, -0.494583, 0.947985, -0.033178, -0.762543, + -0.616421, 0.335034, -0.215516, 0.668769, 0.995979, + -0.952588, -0.163144, -0.131704, -0.628655, 0.379374, + -0.205543, -0.214549, 0.465494, 0.939944, -0.514744, + -0.293676, 0.630426, 0.611336, -0.921699, 0.368584, + 0.187416, 0.264092, 0.753927, -0.994382, -0.729623, + -0.050304, 0.374280, -0.224205, -0.102319, -0.658897, + 0.013252, 0.281260, 0.676137, 0.797736, -0.049971, + 0.672115, 0.845148, 0.786885, -0.459588, -0.783507, + 0.166259, 0.334869, 0.001944, -0.368247, 0.274813, + 0.487200, 0.338077, -0.094761, 0.098536, 0.416378, + -0.726176, -0.714048, -0.319530, -0.972249, -0.708430, + -0.049153, -0.022553, 0.665850, 0.726642, 0.875127, + -0.993047, -0.260106, 0.156387, 0.683090, -0.462370, + -0.893584, 0.355205, -0.617222, 0.893301, 0.895617, + -0.400729, 0.059559, 0.230486, 0.601215, 0.691313, + -0.494701, 0.088415, 0.029390, 0.410539, -0.813049, + -0.554232, 0.684362, -0.527097, 0.126238, 0.712113, + -0.235528, -0.922915, -0.310440, -0.569678, 0.803727, + -0.435313, -0.562725, -0.456380, 0.721075, -0.879635, + 0.081250, 0.827491, 0.475570, 0.464029, 0.720792, + 0.371187, -0.936700, -0.219649, -0.398327, 0.664515, + -0.528336, 0.106972, -0.247070, 0.501053, -0.482490, + -0.060119, 0.946821, -0.798127, 0.412784, 0.073058, + 0.913986, -0.822744, 0.150143, -0.396453, -0.392421, + -0.046130, 0.168234, 0.044854, 0.497490, -0.110691, + 0.165219, -0.421259, -0.283200, -0.359212, -0.957231, + -0.562409, -0.988025, -0.893931, 0.217942, -0.386352, + 0.770585, 0.689606, 0.720620, -0.476485, 0.190659, + -0.761870, 0.463395, 0.137480, -0.559997, -0.123821, + -0.789461, -0.646011, 0.053435, 0.360682, -0.042464, + 0.661014, -0.685448, -0.874230, -0.294133, 0.812042, + 0.015078, 0.871086, -0.609218, 0.731878, -0.488126, + -0.566448, -0.830530, -0.476150, -0.460379, 0.387412, + 0.137497, -0.689794, 0.077018, -0.141883, -0.166280, + -0.732322, 0.096247, -0.702884, 0.405158, 0.536250, + 0.173295, 0.615696, 0.890239, -0.773270, -0.023622, + -0.152226, 0.887744, 0.290930, -0.026456, -0.406389, + 0.102972, 0.988622, -0.535303, 0.493754, 0.720500, + -0.023428, 0.927306, 0.889970, 0.500421, -0.533073, + 0.277382, -0.362081, -0.222867, -0.645599, 0.496035, + 0.610853, -0.377922, -0.407718, 0.907969, -0.972764, + -0.871468, 0.081264, 0.642933, -0.981230, 0.307994, + -0.380689, -0.133456, 0.195738, 0.910241, 0.840088, + 0.789349, 0.013213, 0.828710, -0.745954, -0.493033, + 0.549210, 0.230618, -0.565727, 0.439180, -0.268961, + -0.098800, -0.283438, 0.368958, 0.678333, 0.070963, + -0.135007, 0.289186, 0.693041, 0.457275, 0.197155, + 0.720277, 0.585807, -0.721581, 0.363210, 0.604577, + 0.586413, 0.982521, -0.528878, -0.217849, 0.892762, + -0.688791, -0.428500, -0.094025, -0.860081, -0.174454, + 0.412942, 0.689129, -0.943836, 0.847215, 0.128309, + -0.212797, -0.251585, 0.844871, -0.843839, -0.573252, + -0.084167, 0.021154, 0.715935, -0.391126, -0.521570, + -0.086910, -0.670848, -0.935763, 0.191509, 0.692361, + 0.668814, -0.222078, 0.674882, -0.860064, 0.560073, + 0.567644, -0.548855, -0.868427, -0.526382, -0.408936, + -0.042881, 0.886560, -0.719807, 0.013283, 0.733775, + 0.408502, 0.800487, -0.517810, 0.253372, 0.956648, + -0.091062, -0.830794, -0.022198, -0.375127, -0.221920, + 0.456232, 0.537963, 0.107232, 0.520469, -0.270529, + -0.200406, 0.189284, 0.507393, -0.525524, 0.329220, + 0.067466, -0.957881, 0.780365, 0.199039, -0.484262, + -0.628570, -0.843843, -0.597703, -0.348377, 0.169441, + -0.863928, -0.939875, -0.030073, -0.381738, 0.313497, + -0.073425, 0.527200, 0.482703, 0.904377, -0.847927, + -0.739217, 0.360609, 0.690035, 0.368015, -0.118921, + -0.580493, -0.832391, -0.929638, 0.926900, -0.357915, + 0.399582, -0.005634, -0.315796, 0.179947, -0.806596, + 0.393360, 0.732931, -0.415833, -0.724526, 0.957347, + -0.892887, 0.475366, 0.173583, -0.418554, -0.302536, + 0.627315, 0.782000, 0.497542, 0.139082, 0.570111, + 0.732375, -0.454643, 0.302218, -0.019505, 0.881778, + -0.057606, 0.273041, 0.414170, -0.503501, -0.079602, + -0.083941, 0.007178, -0.171925, 0.506856, 0.520953, + 0.631684, -0.099784, 0.253885, -0.784149, 0.175691, + 0.211231, -0.677036, -0.348943, -0.615186, -0.095591, + 0.348521, -0.987871, -0.313590, -0.153938, 0.151210, + -0.743479, -0.421562, 0.696567, 0.558739, 0.558933, + 0.578346, -0.498867, -0.168026, -0.007485, -0.002368, + 0.752372, 0.908575, -0.995190, -0.419553, 0.415430, + 0.525763, -0.787869, -0.684353, -0.220353, -0.572018, + 0.491337, 0.990879, -0.249054, -0.857606, -0.624307, + 0.655355, 0.490915, -0.612178, -0.658235, -0.663023, + 0.539032, -0.401714, -0.084585, 0.235599, -0.842975, + -0.525653, -0.186055, -0.341841, 0.306321, 0.806460, + 0.655791, 0.058693, 0.715035, 0.660601, 0.639140, + 0.130465, 0.186363, 0.851271, 0.446112, 0.966011, + -0.720746, -0.062551, 0.956890, 0.030200, 0.079843, + -0.667418, -0.314445, -0.429243, -0.279596, 0.027320, + -0.092266, -0.740564, 0.625606, 0.823149, 0.495035, + 0.782632, -0.702504, -0.691020, -0.559209, 0.603818, + -0.884560, -0.903419, -0.337489, 0.830475, 0.757182, + -0.698349, -0.039060, -0.056455, -0.847078, -0.592948, + -0.090444, -0.567824, 0.344501, -0.133554, 0.462375, + -0.575656, 0.199028, -0.852070, -0.004899, 0.919432, + 0.175251, 0.902835, -0.821132, -0.199143, 0.725984, + 0.673903, -0.416511, -0.976519, 0.982883, 0.024279, + 0.627298, -0.901677, 0.120861, -0.710191, 0.928798, + -0.121958, -0.408540, -0.110261, 0.821588, -0.255618, + 0.296790, -0.268856, 0.176557, -0.358709, 0.597589, + -0.361067, 0.065635, -0.203382, -0.213137, -0.939264, + -0.283951, 0.962113, 0.963571, -0.105083, -0.237030, + 0.689556, -0.431180, 0.346459, 0.713037, -0.448297, + -0.629262, 0.340335, -0.349973, 0.491599, 0.630144, + -0.421175, -0.630359, -0.778396, 0.468564, -0.808771, + -0.034014, -0.234646, -0.077627, -0.857457, 0.406645, + -0.480038, -0.218524, -0.527720, 0.316580, 0.568338, + -0.466984, -0.967371, 0.530452, -0.503413, -0.072454, + -0.706578, -0.813857, 0.496366, 0.639881, 0.899179, + -0.951931, -0.989381, 0.239514, -0.301904, 0.502218, + -0.130341, 0.276921, 0.871860, 0.091262, -0.254515, + -0.936911, -0.942752, 0.510839, -0.014539, -0.800209, + -0.082516, 0.505423, -0.018733, 0.389763, -0.177997, + -0.450395, 0.922779, -0.145368, -0.919943, -0.580634, + 0.782178, -0.626521, -0.394491, 0.278545, -0.986640, + -0.495312, 0.326614, -0.976021, 0.744203, -0.975290, + 0.526197, -0.386139, 0.301631, 0.398057, 0.705124, + -0.952884, 0.461146, 0.762372, 0.557954, -0.553393, + 0.962163, -0.524562, 0.952030, -0.056570, 0.865202, + -0.225967, 0.493035, 0.787981, 0.628665, 0.573093, + -0.792653, 0.410844, 0.946571, -0.187144, -0.310612, + 0.959931, 0.317544, -0.983998, 0.983911, 0.061747, + -0.959287, 0.510108, 0.675608, 0.342344, -0.091835, + 0.380731, 0.389460, -0.630689, 0.143103, -0.052586, + -0.184083, 0.105266, 0.422852, -0.232052, -0.951303, + 0.288054, 0.541981, 0.541732, 0.076035, 0.170646, + 0.114825, 0.283382, -0.418510, 0.061396, -0.903763, + 0.270879, 0.021327, 0.413782, 0.286881, 0.005238, + -0.524472, 0.327594, -0.484654, -0.848864, -0.330063, + 0.423511, 0.531868, -0.940603, 0.792822, -0.325029, + 0.006811, -0.391261, 0.780237, -0.570337, 0.376687, + 0.828934, 0.717717, -0.081333, 0.370666, -0.206248, + -0.910686, -0.514510, -0.922867, -0.329196, 0.546886, + -0.826629, 0.941683, -0.431786, 0.587152, 0.228564, + 0.573452, -0.937320, -0.443843, -0.911202, -0.786184, + 0.226094, 0.512309, 0.745684, 0.285491, 0.305131, + -0.579345, -0.707698, 0.913870, -0.799108, -0.278035, + 0.290556, -0.970174, -0.560318, -0.790776, 0.400492, + 0.233434, -0.701462, 0.885982, 0.310567, -0.030658, + 0.432868, 0.483938, -0.088976, -0.998918, 0.071090, + -0.860412, 0.574534, 0.133770, -0.304255, 0.663332, + 0.347586, 0.921839, 0.175641, 0.093270, 0.207330, + -0.519228, 0.513925, 0.499633, -0.605358, 0.714817, + -0.778402, 0.685198, 0.744643, -0.338720, 0.894422, + 0.145135, 0.894714, -0.807041, 0.031117, 0.205281, + 0.162301, -0.536015, -0.310781, -0.926675, -0.534932, + 0.760308, -0.787088, -0.960398, -0.105922, -0.091343, + 0.702934, -0.758336, -0.169504, -0.121425, 0.334935, + -0.962173, 0.359347, -0.151140, 0.537460, 0.753989, + -0.436323, 0.759058, 0.439187, -0.691680, -0.579662, + 0.333608, 0.453454, -0.684948, 0.526567, -0.515429, + 0.520333, -0.311132, -0.051443, -0.790448, -0.237807, + 0.413625, 0.969861, -0.024895, 0.453226, -0.136061, + 0.883762, 0.156160, 0.105603, -0.285741, -0.965264, + -0.559462, -0.247914, 0.394083, 0.289398, -0.710455, + 0.148072, 0.853074, -0.951397, -0.412742, -0.838606, + -0.531059, 0.920866, 0.614848, -0.216007, 0.447434, + -0.900580, -0.695673, -0.863698, 0.047977, -0.486121, + -0.101505, -0.538399, -0.516261, 0.873600, 0.914828, + 0.347678, 0.757362, 0.070988, -0.546718, -0.528380, + 0.105724, -0.106180, 0.223706, -0.500194, -0.816782, + 0.513251, 0.647878, -0.963708, 0.561854, -0.764864, + -0.802314, -0.969205, -0.843997, 0.812534, -0.185212, + 0.603436, 0.911954, 0.119114, 0.739738, -0.040069, + 0.632993, -0.361767, 0.421532, -0.883268, -0.488168, + 0.336360, 0.464411, -0.730806, -0.592652, 0.917693, + -0.259186, 0.513071, -0.188487, 0.964520, -0.987122, + -0.005270, 0.477771, 0.660756, 0.031023, 0.039625, + 0.895892, 0.228709, 0.070419, -0.948105, 0.041243, + 0.885207, 0.655331, -0.046803, 0.004321, 0.395069, + 0.913128, -0.362686, -0.966698, 0.334661, -0.245954, + -0.454865, -0.328980, -0.781543, -0.185671, 0.078368, + -0.863850, 0.555143, -0.408560, -0.052338, 0.519663, + -0.395683, 0.942393, -0.002565, -0.734927, -0.026585, + -0.962941, -0.839035, -0.797876, 0.107479, -0.787140, + 0.243367, -0.007314, 0.868191, -0.803435, 0.997007, + 0.263261, -0.890307, -0.365679, 0.296563, 0.444354, + 0.388367, 0.841698, -0.884626, 0.606824, -0.343973, + 0.193743, 0.742974, -0.788830, 0.785182, -0.309364, + 0.730833, -0.610500, -0.366971, -0.271732, -0.345427, + 0.606444, -0.234673, -0.184462, 0.808568, 0.872806, + 0.028398, 0.051936, -0.134508, -0.103410, 0.248500, + -0.137501, -0.840150, 0.358194, 0.496819, 0.456413, + -0.197453, -0.114814, 0.298111, -0.082078, -0.507990, + 0.954138, -0.888336, -0.765016, -0.834692, 0.896847, + -0.074380, 0.896141, -0.713654, 0.558649, -0.375591, + -0.059081, 0.165093, 0.389736, 0.756458, -0.026339, + 0.262542, -0.215144, -0.974403, -0.871966, 0.681446 +}; + +static const float wmavoice_gain_silence[256] = { + 0.0000188351, 0.0000249147, 0.0000294447, 0.0000365973, + 0.0000423193, 0.0000464916, 0.0000498295, 0.0000525713, + 0.0000550747, 0.0000574589, 0.0000596046, 0.0000615120, + 0.0000634193, 0.0000649691, 0.0000665188, 0.0000679493, + 0.0000692606, 0.0000704527, 0.0000716448, 0.0000728369, + 0.0000737906, 0.0000747442, 0.0000755787, 0.0000762939, + 0.0000770092, 0.0000778437, 0.0000785589, 0.0000792742, + 0.0000799894, 0.0000807047, 0.0000814199, 0.0000822544, + 0.0000829697, 0.0000838041, 0.0000845194, 0.0000854731, + 0.0000865459, 0.0000876188, 0.0000889301, 0.0000904799, + 0.0000923872, 0.0000950098, 0.0000988245, 0.0001032352, + 0.0001088381, 0.0001147985, 0.0001225471, 0.0001319647, + 0.0001431704, 0.0001568794, 0.0001744032, 0.0001952648, + 0.0002206564, 0.0002535582, 0.0002965927, 0.0003464222, + 0.0004109144, 0.0004891157, 0.0005909204, 0.0007261038, + 0.0008867979, 0.0010721684, 0.0012696981, 0.0015079975, + 0.0017461777, 0.0019979477, 0.0022052526, 0.0023679733, + 0.0025173426, 0.0026556253, 0.0027927160, 0.0029264688, + 0.0030447245, 0.0031807423, 0.0033060312, 0.0034313202, + 0.0035454035, 0.0036598444, 0.0037686825, 0.0038731098, + 0.0039769411, 0.0040702820, 0.0041661263, 0.0042562485, + 0.0043400526, 0.0044249296, 0.0045082569, 0.0045900345, + 0.0046693087, 0.0047430992, 0.0048171282, 0.0048881769, + 0.0049589872, 0.0050252676, 0.0050880909, 0.0051497221, + 0.0052082539, 0.0052671432, 0.0053246021, 0.0053800344, + 0.0054348707, 0.0054861307, 0.0055367947, 0.0055862665, + 0.0056355000, 0.0056805611, 0.0057252645, 0.0057705641, + 0.0058110952, 0.0058538914, 0.0058966875, 0.0059366226, + 0.0059723854, 0.0060091019, 0.0060437918, 0.0060794353, + 0.0061159134, 0.0061485767, 0.0061824322, 0.0062153339, + 0.0062497854, 0.0062820911, 0.0063197613, 0.0063550472, + 0.0063927174, 0.0064336061, 0.0064769983, 0.0065194368, + 0.0065603256, 0.0066006184, 0.0066410303, 0.0066826344, + 0.0067234039, 0.0067654848, 0.0068060160, 0.0068466663, + 0.0068866014, 0.0069231987, 0.0069609880, 0.0069983006, + 0.0070366859, 0.0070750713, 0.0071122646, 0.0071535110, + 0.0071973801, 0.0072410107, 0.0072846413, 0.0073343515, + 0.0073832273, 0.0074360371, 0.0074878931, 0.0075426102, + 0.0076007843, 0.0076560974, 0.0077134371, 0.0077683926, + 0.0078265667, 0.0078855753, 0.0079488754, 0.0080170631, + 0.0080827475, 0.0081528425, 0.0082212687, 0.0082877874, + 0.0083510876, 0.0084129572, 0.0084775686, 0.0085455179, + 0.0086110830, 0.0086781979, 0.0087503195, 0.0088242292, + 0.0089002848, 0.0089734793, 0.0090423822, 0.0091133118, + 0.0091816187, 0.0092473030, 0.0093164444, 0.0093911886, + 0.0094678402, 0.0095427036, 0.0096175671, 0.0096931458, + 0.0097666979, 0.0098397732, 0.0099166632, 0.0099946260, + 0.0100749731, 0.0101612806, 0.0102528334, 0.0103493929, + 0.0104434490, 0.0105448961, 0.0106583834, 0.0107737780, + 0.0108981133, 0.0110142231, 0.0111318827, 0.0112472773, + 0.0113576651, 0.0114786625, 0.0116028786, 0.0117331743, + 0.0118676424, 0.0120122433, 0.0121580362, 0.0123010874, + 0.0124633312, 0.0126402378, 0.0128232241, 0.0130140781, + 0.0132108927, 0.0134289265, 0.0136625767, 0.0138912201, + 0.0141364336, 0.0144006014, 0.0146615505, 0.0149335861, + 0.0152134895, 0.0155050755, 0.0158376694, 0.0162067413, + 0.0165973902, 0.0169926882, 0.0174319744, 0.0179271698, + 0.0184448957, 0.0190744400, 0.0197248459, 0.0204203129, + 0.0212460756, 0.0221523046, 0.0231562853, 0.0243031979, + 0.0256397724, 0.0271918774, 0.0289602280, 0.0310072899, + 0.0333702564, 0.0363805294, 0.0401413441, 0.0443998575, + 0.0498176813, 0.0562580824, 0.0640066862, 0.0732775927, + 0.0836604834, 0.0962959528, 0.1122496128, 0.1335854530, + 0.1608980894, 0.1990102530, 0.2616490126, 0.3926030397 +}; + +static const float wmavoice_gain_universal[64] = { + 0.0000000000, 0.0000000000, 0.0000015497, 0.0000015497, + 0.0000095367, 0.0000164509, 0.0000379086, 0.0000494719, + 0.0000799894, 0.0001058578, 0.0001349449, 0.0001627207, + 0.0001972914, 0.0002325773, 0.0002671480, 0.0003106594, + 0.0003589392, 0.0004127026, 0.0004582405, 0.0005071163, + 0.0005759001, 0.0006588697, 0.0007554293, 0.0008602142, + 0.0009772778, 0.0011068583, 0.0012603998, 0.0013889074, + 0.0015437603, 0.0016924143, 0.0018980503, 0.0021264553, + 0.0023632050, 0.0025693178, 0.0028522015, 0.0031896830, + 0.0034654140, 0.0037885904, 0.0041683912, 0.0046081543, + 0.0050576925, 0.0055632591, 0.0061818361, 0.0068151951, + 0.0073953867, 0.0081818104, 0.0091186762, 0.0102789402, + 0.0119919777, 0.0134155750, 0.0154829025, 0.0173798800, + 0.0199711323, 0.0229473114, 0.0268185139, 0.0319474936, + 0.0393068790, 0.0460114479, 0.0523469448, 0.0637906790, + 0.0845471621, 0.1105458736, 0.1499300003, 0.2219169140 +}; + +static const float wmavoice_gain_codebook_acb[128] = { + 0.05, 0.14, 0.16, 0.05, 0.17, 0.25, 0.07, 0.21, + 0.12, 0.22, 0.23, 0.13, 0.24, 0.32, 0.14, 0.29, + 0.31, 0.41, 0.43, 0.32, 0.43, 0.51, 0.34, 0.48, + 0.38, 0.47, 0.49, 0.38, 0.49, 0.57, 0.40, 0.54, + 0.49, 0.59, 0.61, 0.50, 0.61, 0.69, 0.52, 0.66, + 0.56, 0.65, 0.67, 0.56, 0.67, 0.75, 0.58, 0.72, + 0.65, 0.74, 0.76, 0.65, 0.76, 0.84, 0.67, 0.81, + 0.71, 0.80, 0.82, 0.71, 0.82, 0.90, 0.73, 0.87, + 0.81, 0.90, 0.92, 0.81, 0.93, 1.01, 0.83, 0.97, + 0.87, 0.96, 0.98, 0.87, 0.98, 1.06, 0.89, 1.03, + 0.92, 1.02, 1.04, 0.93, 1.04, 1.12, 0.95, 1.09, + 0.93, 1.02, 1.04, 0.93, 1.04, 1.12, 0.95, 1.09, + 0.94, 1.04, 1.05, 0.10, 1.06, 1.14, 0.96, 1.11, + 0.98, 1.08, 1.10, 0.99, 1.10, 1.18, 1.01, 1.15, + 1.06, 1.15, 1.17, 1.06, 1.17, 1.25, 1.08, 1.22, + 1.16, 1.25, 1.27, 1.16, 1.28, 1.36, 1.18, 1.32 +}; + +static const float wmavoice_gain_codebook_fcb[128] = { + -0.8439700703 /* log(0.430) */, -0.6143360001 /* log(0.541) */, + -0.1531511795 /* log(0.858) */, -0.0998203353 /* log(0.905) */, + 0.3213585988 /* log(1.379) */, 0.3777512695 /* log(1.459) */, + 0.7158866675 /* log(2.046) */, 1.2700414043 /* log(3.561) */, + -1.6873994539 /* log(0.185) */, -1.2173958247 /* log(0.296) */, + -0.4893903430 /* log(0.613) */, -0.4155154440 /* log(0.660) */, + 0.1257512053 /* log(1.134) */, 0.1947440768 /* log(1.215) */, + 0.5883420662 /* log(1.801) */, 1.1987592373 /* log(3.316) */, + -1.3586791941 /* log(0.257) */, -0.9996723408 /* log(0.368) */, + -0.3768776513 /* log(0.686) */, -0.3119747650 /* log(0.732) */, + 0.1881379421 /* log(1.207) */, 0.2523139286 /* log(1.287) */, + 0.6280751838 /* log(1.874) */, 1.2202397768 /* log(3.388) */, + -0.7381445465 /* log(0.478) */, -0.5310283311 /* log(0.588) */, + -0.0987159729 /* log(0.906) */, -0.0491902442 /* log(0.952) */, + 0.3555743385 /* log(1.427) */, 0.4101209196 /* log(1.507) */, + 0.7390761124 /* log(2.094) */, 1.2831536022 /* log(3.608) */, + -0.2497442331 /* log(0.779) */, -0.1165338163 /* log(0.890) */, + 0.1881379421 /* log(1.207) */, 0.2255406759 /* log(1.253) */, + 0.5469646704 /* log(1.728) */, 0.5922212620 /* log(1.808) */, + 0.8733832309 /* log(2.395) */, 1.3632815868 /* log(3.909) */, + -1.3903023825 /* log(0.249) */, -1.0216512475 /* log(0.360) */, + -0.3900840061 /* log(0.677) */, -0.3229638866 /* log(0.724) */, + 0.1806534997 /* log(1.198) */, 0.2460785226 /* log(1.279) */, + 0.6232610531 /* log(1.865) */, 1.2178757095 /* log(3.380) */, + -0.6033064766 /* log(0.547) */, -0.4185503477 /* log(0.658) */, + -0.0253178080 /* log(0.975) */, 0.0217614918 /* log(1.022) */, + 0.4027948796 /* log(1.496) */, 0.4555243080 /* log(1.577) */, + 0.7714961470 /* log(2.163) */, 1.3023691262 /* log(3.678) */, + -1.1056369036 /* log(0.331) */, -0.8164453969 /* log(0.442) */, + -0.2757535016 /* log(0.759) */, -0.2156715365 /* log(0.806) */, + 0.2468600779 /* log(1.280) */, 0.3082197237 /* log(1.361) */, + 0.6662897264 /* log(1.947) */, 1.2418464568 /* log(3.462) */, + -0.5395680926 /* log(0.583) */, -0.3652833185 /* log(0.694) */, + 0.0109399400 /* log(1.011) */, 0.0554347069 /* log(1.057) */, + 0.4265740713 /* log(1.532) */, 0.4774756441 /* log(1.612) */, + 0.7880027116 /* log(2.199) */, 1.3118401752 /* log(3.713) */, + -0.9571127264 /* log(0.384) */, -0.7031975164 /* log(0.495) */, + -0.2082549388 /* log(0.812) */, -0.1519863570 /* log(0.859) */, + 0.2874320412 /* log(1.333) */, 0.3464225675 /* log(1.414) */, + 0.6931471806 /* log(2.000) */, 1.2570395253 /* log(3.515) */, + -0.2420715612 /* log(0.785) */, -0.1098148660 /* log(0.896) */, + 0.1930966300 /* log(1.213) */, 0.2311117210 /* log(1.260) */, + 0.5504308784 /* log(1.734) */, 0.5960854677 /* log(1.815) */, + 0.8758853172 /* log(2.401) */, 1.3650707247 /* log(3.916) */, + 0.6564831962 /* log(1.928) */, 0.7124594916 /* log(2.039) */, + 0.8569652658 /* log(2.356) */, 0.8767179568 /* log(2.403) */, + 1.0567480846 /* log(2.877) */, 1.0841752409 /* log(2.957) */, + 1.2652560327 /* log(3.544) */, 1.6211688353 /* log(5.059) */, + -1.5417792640 /* log(0.214) */, -1.1239300967 /* log(0.325) */, + -0.4431669753 /* log(0.642) */, -5.2983173665 /* log(0.005) */, + 0.1510028735 /* log(1.163) */, 0.2183319943 /* log(1.244) */, + 0.6043159669 /* log(1.830) */, 1.2074666936 /* log(3.345) */, + -0.5124936809 /* log(0.599) */, -0.3424903089 /* log(0.710) */, + 0.0266419309 /* log(1.027) */, 0.0713899961 /* log(1.074) */, + 0.4369637752 /* log(1.548) */, 0.4879663296 /* log(1.629) */, + 0.7952524035 /* log(2.215) */, 1.3164082337 /* log(3.730) */, + -0.8867319296 /* log(0.412) */, -0.6481738149 /* log(0.523) */, + -0.1743533871 /* log(0.840) */, -0.1199102967 /* log(0.887) */, + 0.3089542077 /* log(1.362) */, 0.3660310389 /* log(1.442) */, + 0.7075430608 /* log(2.029) */, 1.2649738259 /* log(3.543) */, + -0.0943106795 /* log(0.910) */, 0.0207825392 /* log(1.021) */, + 0.2911759617 /* log(1.338) */, 0.3249778572 /* log(1.384) */, + 0.6200387087 /* log(1.859) */, 0.6621723763 /* log(1.939) */, + 0.9266370239 /* log(2.526) */, 1.3962446920 /* log(4.040) */ +}; + +static const float wmavoice_ipol1_coeffs[17*9] = { + 0, + 0.6308171151, 0.7613050340, 0.8632577061, 0.9280143976, + 0.9499985575, 0.9273047447, 0.8618999123, 0.7594153284, + -0.1791058179, -0.1351341452, -0.0589959878, 0.0472882274, + 0.1784339990, 0.3262237605, 0.4801855979, 0.6285545824, + 0, + -0.1921342459, -0.1786532696, -0.1341681625, -0.0575229186, + 0.0492091286, 0.1806929555, 0.3286687729, 0.4826357064, + 0.0807464118, 0.0506337392, 0.0080115446, -0.0428523305, + -0.0958572026, -0.1436148431, -0.1782128509, -0.1921164688, + 0, + 0.0960653644, 0.0803771760, 0.0500416081, 0.0072485465, + -0.0437018941, -0.0966834794, -0.1442930843, -0.1786170151, + -0.0391932014, -0.0189622506, 0.0070230183, 0.0356589290, + 0.0630142610, 0.0847979258, 0.0969368290, 0.0961942221, + 0, + -0.0515680681, -0.0389267015, -0.0185848991, 0.0074699190, + 0.0361179407, 0.0634181346, 0.0850781347, 0.0970333587, + 0.0178811825, 0.0048708571, -0.0108041526, -0.0271167825, + -0.0416534986, -0.0519338618, -0.0557823736, -0.0517020743, + 0, + 0.0267091128, 0.0177022810, 0.0046363524, -0.0110662053, + -0.0273700613, -0.0418578978, -0.0520511451, -0.0557823028, + -0.0069270437, 0.0008217385, 0.0097293532, 0.0185749526, + 0.0259542684, 0.0304777338, 0.0309953480, 0.0268154419, + 0, + -0.0125539196, -0.0068173436, 0.0009580161, 0.0098749646, + 0.0187084037, 0.0260526291, 0.0305201071, 0.0309665180, + 0.0019149571, -0.0022503408, -0.0068592466, -0.0112465904, + -0.0146595868, -0.0163685936, -0.0157934162, -0.0126258885, + 0, + 0.0050976076, 0.0018546581, -0.0023221741, -0.0069331308, + -0.0113109085, -0.0147021576, -0.0163786146, -0.0157635096, + -0.0001162733, 0.0019313511, 0.0040823850, 0.0060192454, + 0.0073876535, 0.0078486321, 0.0071403184, 0.0051400312, + 0, + -0.0017920607, -0.0000857157, 0.0019657183, 0.0041159806, + 0.0060465694, 0.0074030068, 0.0078470460, 0.0071185785, + -0.0004100171, -0.0015364708, -0.0025490071, -0.0033188616, + -0.0037196307, -0.0036417283, -0.0030119629, -0.0018155784, + 0, + 0.0006907531, -0.0004282868, -0.0015539061, -0.0025635813, + -0.0033285026, -0.0037224069, -0.0036361245, -0.0029972247, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/** + * Hamming-window sinc function (num = 32, x = [ 0, 31 ]): + * (0.54 + 0.46 * cos(2 * M_PI * x / (num - 1))) * + * sin(x * M_PI / 4) / (x * M_PI / 4) + */ +static const float wmavoice_ipol2_coeffs[32] = { + 1, 0.8563459515, 0.5888634918, 0.2648358640, + 0, -0.1360490318, -0.1434589471, -0.0758505310, + 0, 0.0410402636, 0.0412485781, 0.0200064587, + 0, -0.0081391358, -0.0068223253, -0.0029313546, + 0, 0.0025864919, 0.0053062555, 0.0055688801, + 0, -0.0104795941, -0.0187493577, -0.0160592399, + 0, 0.0212381664, 0.0331059131, 0.0251942366, + 0, -0.0273968070, -0.0392575669, -0.0276240534 +}; + +/** + * LUT for 1.071575641632 * pow(1.0331663, n - 127) + */ +static const float wmavoice_energy_table[128] = { + 0.0169982178, 0.0175619858, 0.0181444519, 0.0187462362, + 0.0193679795, 0.0200103437, 0.0206740128, 0.0213596933, + 0.0220681153, 0.0228000330, 0.0235562258, 0.0243374986, + 0.0251446834, 0.0259786395, 0.0268402549, 0.0277304468, + 0.0286501631, 0.0296003830, 0.0305821182, 0.0315964139, + 0.0326443501, 0.0337270424, 0.0348456436, 0.0360013446, + 0.0371953760, 0.0384290090, 0.0397035571, 0.0410203772, + 0.0423808713, 0.0437864880, 0.0452387238, 0.0467391249, + 0.0482892887, 0.0498908657, 0.0515455612, 0.0532551367, + 0.0550214125, 0.0568462692, 0.0587316496, 0.0606795611, + 0.0626920777, 0.0647713419, 0.0669195677, 0.0691390421, + 0.0714321284, 0.0738012678, 0.0762489827, 0.0787778794, + 0.0813906502, 0.0840900769, 0.0868790336, 0.0897604897, + 0.0927375130, 0.0958132732, 0.0989910450, 0.1022742117, + 0.1056662688, 0.1091708280, 0.1127916204, 0.1165325012, + 0.1203974531, 0.1243905911, 0.1285161668, 0.1327785725, + 0.1371823465, 0.1417321773, 0.1464329093, 0.1512895470, + 0.1563072616, 0.1614913951, 0.1668474671, 0.1723811803, + 0.1780984262, 0.1840052921, 0.1901080668, 0.1964132480, + 0.2029275487, 0.2096579046, 0.2166114816, 0.2237956830, + 0.2312181577, 0.2388868085, 0.2468098001, 0.2549955679, + 0.2634528274, 0.2721905830, 0.2812181375, 0.2905451026, + 0.3001814086, 0.3101373153, 0.3204234225, 0.3310506819, + 0.3420304081, 0.3533742912, 0.3650944090, 0.3772032397, + 0.3897136755, 0.4026390362, 0.4159930832, 0.4297900346, + 0.4440445799, 0.4587718956, 0.4739876619, 0.4897080789, + 0.5059498840, 0.5227303696, 0.5400674019, 0.5579794393, + 0.5764855528, 0.5956054456, 0.6153594745, 0.6357686714, + 0.6568547659, 0.6786402082, 0.7011481929, 0.7244026842, + 0.7484284410, 0.7732510432, 0.7988969192, 0.8253933741, + 0.8527686184, 0.8810517982, 0.9102730265, 0.9404634147, + 0.9716551065, 1.0038813113, 1.0371763400, 1.0715756416 +}; + +/** + * LUT for f(x,y) = pow((y + 6.9) / 64, 0.025 * (x + 1)). + */ +static const float wmavoice_denoise_power_table[12][64] = { + { 0.9458379339, 0.9490436287, 0.9518757236, 0.9544130754, + 0.9567118717, 0.9588135761, 0.9607496688, 0.9625446194, + 0.9642178285, 0.9657849396, 0.9672587526, 0.9686498743, + 0.9699671937, 0.9712182343, 0.9724094211, 0.9735462842, + 0.9746336187, 0.9756756090, 0.9766759291, 0.9776378218, + 0.9785641645, 0.9794575217, 0.9803201890, 0.9811542296, + 0.9819615045, 0.9827436985, 0.9835023412, 0.9842388263, + 0.9849544265, 0.9856503078, 0.9863275406, 0.9869871101, + 0.9876299254, 0.9882568267, 0.9888685922, 0.9894659445, + 0.9900495551, 0.9906200497, 0.9911780119, 0.9917239872, + 0.9922584859, 0.9927819864, 0.9932949377, 0.9937977618, + 0.9942908555, 0.9947745929, 0.9952493267, 0.9957153901, + 0.9961730980, 0.9966227482, 0.9970646231, 0.9974989903, + 0.9979261037, 0.9983462046, 0.9987595223, 0.9991662752, + 0.9995666709, 0.9999609077, 1.0003491745, 1.0007316515, + 1.0011085110, 1.0014799178, 1.0018460292, 1.0022069960 }, + { 0.8946093973, 0.9006838092, 0.9060673931, 0.9109043185, + 0.9152976055, 0.9193234737, 0.9230399260, 0.9264921443, + 0.9297160207, 0.9327405496, 0.9355894944, 0.9382825789, + 0.9408363568, 0.9432648587, 0.9455800822, 0.9477923675, + 0.9499106907, 0.9519428941, 0.9538958704, 0.9557757107, + 0.9575878241, 0.9593370368, 0.9610276730, 0.9626636222, + 0.9642483964, 0.9657851769, 0.9672768552, 0.9687260672, + 0.9701352224, 0.9715065293, 0.9728420173, 0.9741435556, + 0.9754128696, 0.9766515555, 0.9778610927, 0.9790428553, + 0.9801981216, 0.9813280829, 0.9824338513, 0.9835164667, + 0.9845769028, 0.9856160726, 0.9866348334, 0.9876339913, + 0.9886143053, 0.9895764906, 0.9905212223, 0.9914491381, + 0.9923608411, 0.9932569022, 0.9941378627, 0.9950042356, + 0.9958565084, 0.9966951442, 0.9975205834, 0.9983332454, + 0.9991335296, 0.9999218170, 1.0006984708, 1.0014638383, + 1.0022182509, 1.0029620257, 1.0036954662, 1.0044188628 }, + { 0.8461555040, 0.8547882305, 0.8624635555, 0.8693789920, + 0.8756760853, 0.8814598273, 0.8868103032, 0.8917900284, + 0.8964487626, 0.9008267754, 0.9049571273, 0.9088673021, + 0.9125804007, 0.9161160306, 0.9194909803, 0.9227197376, + 0.9258148939, 0.9287874629, 0.9316471355, 0.9344024839, + 0.9370611291, 0.9396298766, 0.9421148300, 0.9445214846, + 0.9468548060, 0.9491192967, 0.9513190517, 0.9534578074, + 0.9555389816, 0.9575657096, 0.9595408742, 0.9614671327, + 0.9633469396, 0.9651825670, 0.9669761222, 0.9687295635, + 0.9704447142, 0.9721232742, 0.9737668316, 0.9753768718, + 0.9769547868, 0.9785018824, 0.9800193854, 0.9815084500, + 0.9829701633, 0.9844055505, 0.9858155796, 0.9872011653, + 0.9885631734, 0.9899024236, 0.9912196934, 0.9925157203, + 0.9937912053, 0.9950468143, 0.9962831814, 0.9975009102, + 0.9987005760, 0.9998827277, 1.0010478892, 1.0021965608, + 1.0033292209, 1.0044463270, 1.0055483173, 1.0066356112 }, + { 0.8003259737, 0.8112313241, 0.8209581209, 0.8297466775, + 0.8377697066, 0.8451556492, 0.8520027051, 0.8583876935, + 0.8643718792, 0.8700049328, 0.8753277020, 0.8803741979, + 0.8851730502, 0.8897485937, 0.8941216918, 0.8983103719, + 0.9023303202, 0.9061952736, 0.9099173316, 0.9135072091, + 0.9169744409, 0.9203275502, 0.9235741882, 0.9267212496, + 0.9297749699, 0.9327410079, 0.9356245146, 0.9384301933, + 0.9411623497, 0.9438249364, 0.9464215906, 0.9489556668, + 0.9514302661, 0.9538482608, 0.9562123167, 0.9585249126, + 0.9607883576, 0.9630048062, 0.9651762722, 0.9673046403, + 0.9693916775, 0.9714390425, 0.9734482944, 0.9754209007, + 0.9773582446, 0.9792616307, 0.9811322918, 0.9829713934, + 0.9847800389, 0.9865592739, 0.9883100900, 0.9900334289, + 0.9917301853, 0.9934012104, 0.9950473143, 0.9966692689, + 0.9982678100, 0.9998436400, 1.0013974295, 1.0029298194, + 1.0044414224, 1.0059328250, 1.0074045889, 1.0088572520 }, + { 0.7569786654, 0.7698939195, 0.7814501054, 0.7919210783, + 0.8015042240, 0.8103467104, 0.8185613167, 0.8262364557, + 0.8334427763, 0.8402376615, 0.8466683811, 0.8527743561, + 0.8585888194, 0.8641400582, 0.8694523567, 0.8745467247, + 0.8794414652, 0.8841526254, 0.8886943552, 0.8930791981, + 0.8973183276, 0.9014217415, 0.9053984227, 0.9092564737, + 0.9130032283, 0.9166453478, 0.9201889007, 0.9236394320, + 0.9270020224, 0.9302813390, 0.9334816797, 0.9366070112, + 0.9396610028, 0.9426470554, 0.9455683275, 0.9484277579, + 0.9512280860, 0.9539718690, 0.9566614986, 0.9592992147, + 0.9618871182, 0.9644271823, 0.9669212630, 0.9693711079, + 0.9717783651, 0.9741445900, 0.9764712529, 0.9787597445, + 0.9810113822, 0.9832274148, 0.9854090274, 0.9875573457, + 0.9896734398, 0.9917583281, 0.9938129803, 0.9958383209, + 0.9978352315, 0.9998045539, 1.0017470919, 1.0036636145, + 1.0055548568, 1.0074215229, 1.0092642871, 1.0110837959 }, + { 0.7159791370, 0.7306629191, 0.7438433845, 0.7558198318, + 0.7668086064, 0.7769714272, 0.7864325139, 0.7952894548, + 0.8036203840, 0.8114888792, 0.8189474022, 0.8260397728, + 0.8328029877, 0.8392685815, 0.8454636629, 0.8514117142, + 0.8571332177, 0.8626461513, 0.8679663850, 0.8731080020, + 0.8780835596, 0.8829043049, 0.8875803529, 0.8921208349, + 0.8965340237, 0.9008274393, 0.9050079382, 0.9090817905, + 0.9130547454, 0.9169320882, 0.9207186893, 0.9244190474, + 0.9280373261, 0.9315773876, 0.9350428208, 0.9384369673, + 0.9417629433, 0.9450236603, 0.9482218422, 0.9513600421, + 0.9544406555, 0.9574659338, 0.9604379957, 0.9633588374, + 0.9662303420, 0.9690542879, 0.9718323569, 0.9745661408, + 0.9772571477, 0.9799068082, 0.9825164805, 0.9850874551, + 0.9876209597, 0.9901181627, 0.9925801775, 0.9950080658, + 0.9974028405, 0.9997654692, 1.0020968764, 1.0043979464, + 1.0066695255, 1.0089124239, 1.0111274185, 1.0133152537 }, + { 0.6772002277, 0.6934309881, 0.7080464599, 0.7213643301, + 0.7336148970, 0.7449707526, 0.7555647772, 0.7655015856, + 0.7748651015, 0.7837237382, 0.7921340426, 0.8001433220, + 0.8077915768, 0.8151129499, 0.8221368310, 0.8288887107, + 0.8353908496, 0.8416628090, 0.8477218755, 0.8535834053, + 0.8592611049, 0.8647672624, 0.8701129393, 0.8753081305, + 0.8803618988, 0.8852824894, 0.8900774261, 0.8947535945, + 0.8993173131, 0.9037743949, 0.9081302004, 0.9123896841, + 0.9165574352, 0.9206377129, 0.9246344779, 0.9285514202, + 0.9323919830, 0.9361593853, 0.9398566405, 0.9434865742, + 0.9470518396, 0.9505549317, 0.9539981992, 0.9573838564, + 0.9607139933, 0.9639905847, 0.9672154989, 0.9703905051, + 0.9735172803, 0.9765974162, 0.9796324243, 0.9826237418, + 0.9855727362, 0.9884807098, 0.9913489039, 0.9941785028, + 0.9969706369, 0.9997263861, 1.0024467831, 1.0051328157, + 1.0077854297, 1.0104055314, 1.0129939892, 1.0155516364 }, + { 0.6405216642, 0.6580962612, 0.6739722363, 0.6884795488, + 0.7018580813, 0.7142880714, 0.7259086094, 0.7368294324, + 0.7471387455, 0.7569085832, 0.7661985859, 0.7750587283, + 0.7835313288, 0.7916525600, 0.7994535998, 0.8069615243, + 0.8142000068, 0.8211898738, 0.8279495504, 0.8344954211, + 0.8408421252, 0.8470027997, 0.8529892811, 0.8588122744, + 0.8644814947, 0.8700057878, 0.8753932324, 0.8806512276, + 0.8857865684, 0.8908055105, 0.8957138271, 0.9005168576, + 0.9052195513, 0.9098265046, 0.9143419945, 0.9187700080, + 0.9231142680, 0.9273782568, 0.9315652364, 0.9356782672, + 0.9397202245, 0.9436938133, 0.9476015819, 0.9514459336, + 0.9552291382, 0.9589533414, 0.9626205741, 0.9662327603, + 0.9697917251, 0.9732992008, 0.9767568340, 0.9801661903, + 0.9835287605, 0.9868459649, 0.9901191578, 0.9933496315, + 0.9965386205, 0.9996873045, 1.0027968119, 1.0058682226, + 1.0089025710, 1.0119008485, 1.0148640056, 1.0177929548 }, + { 0.6058296875, 0.6245620637, 0.6415378101, 0.6570938835, + 0.6714759586, 0.6848691001, 0.6974164561, 0.7092312055, + 0.7204044988, 0.7310109103, 0.7411122884, 0.7507605397, + 0.7599996842, 0.7688674015, 0.7773962122, 0.7856143935, + 0.7935466990, 0.8012149303, 0.8086383963, 0.8158342858, + 0.8228179717, 0.8296032631, 0.8362026133, 0.8426272954, + 0.8488875492, 0.8549927056, 0.8609512936, 0.8667711307, + 0.8724594015, 0.8780227256, 0.8834672161, 0.8887985309, + 0.8940219180, 0.8991422543, 0.9041640810, 0.9090916337, + 0.9139288704, 0.9186794948, 0.9233469789, 0.9279345818, + 0.9324453671, 0.9368822185, 0.9412478543, 0.9455448393, + 0.9497755970, 0.9539424198, 0.9580474782, 0.9620928299, + 0.9660804271, 0.9700121244, 0.9738896845, 0.9777147851, + 0.9814890239, 0.9852139236, 0.9888909370, 0.9925214512, + 0.9961067913, 0.9996482244, 1.0031469629, 1.0066041676, + 1.0100209506, 1.0133983785, 1.0167374742, 1.0200392198 }, + { 0.5730166999, 0.5927366473, 0.6106642672, 0.6271389942, + 0.6424090212, 0.6566617910, 0.6700426292, 0.6826666808, + 0.6946268614, 0.7059993279, 0.7168473476, 0.7272241023, + 0.7371747608, 0.7467380401, 0.7559474006, 0.7648319736, + 0.7734172908, 0.7817258650, 0.7897776570, 0.7975904541, + 0.8051801811, 0.8125611560, 0.8197463039, 0.8267473349, + 0.8335748949, 0.8402386937, 0.8467476129, 0.8531098003, + 0.8593327495, 0.8654233698, 0.8713880464, 0.8772326935, + 0.8829628002, 0.8885834710, 0.8940994619, 0.8995152120, + 0.9048348715, 0.9100623268, 0.9152012229, 0.9202549833, + 0.9252268281, 0.9301197899, 0.9349367288, 0.9396803449, + 0.9443531909, 0.9489576823, 0.9534961076, 0.9579706374, + 0.9623833320, 0.9667361492, 0.9710309512, 0.9752695109, + 0.9794535174, 0.9835845813, 0.9876642399, 0.9916939614, + 0.9956751493, 0.9996091459, 1.0034972362, 1.0073406510, + 1.0111405700, 1.0148981248, 1.0186144013, 1.0222904422 }, + { 0.5419809316, 0.5625329386, 0.5812764912, 0.5985496562, + 0.6146003370, 0.6296162401, 0.6437432340, 0.6570971404, + 0.6697716039, 0.6818435182, 0.6933768712, 0.7044255353, + 0.7150353340, 0.7252456009, 0.7350903742, 0.7445993259, + 0.7537984929, 0.7627108595, 0.7713568269, 0.7797545943, + 0.7879204712, 0.7958691361, 0.8036138516, 0.8111666444, + 0.8185384580, 0.8257392814, 0.8327782597, 0.8396637886, + 0.8464035955, 0.8530048108, 0.8594740287, 0.8658173611, + 0.8720404845, 0.8781486812, 0.8841468762, 0.8900396688, + 0.8958313620, 0.9015259874, 0.9071273286, 0.9126389413, + 0.9180641715, 0.9234061727, 0.9286679198, 0.9338522236, + 0.9389617420, 0.9439989920, 0.9489663591, 0.9538661069, + 0.9587003852, 0.9634712378, 0.9681806094, 0.9728303524, + 0.9774222323, 0.9819579336, 0.9864390644, 0.9908671615, + 0.9952436943, 0.9995700689, 1.0038476318, 1.0080776733, + 1.0122614305, 1.0164000906, 1.0204947932, 1.0245466331 }, + { 0.5126261246, 0.5338683013, 0.5533029807, 0.5712636181, + 0.5879954388, 0.6036845987, 0.6184760989, 0.6324853169, + 0.6458057215, 0.6585142011, 0.6706748475, 0.6823417062, + 0.6935608163, 0.7043717519, 0.7148088052, 0.7249019070, + 0.7346773529, 0.7441583823, 0.7533656456, 0.7623175831, + 0.7710307376, 0.7795200117, 0.7877988829, 0.7958795841, + 0.8037732557, 0.8114900754, 0.8190393682, 0.8264297018, + 0.8336689680, 0.8407644543, 0.8477229049, 0.8545505751, + 0.8612532786, 0.8678364291, 0.8743050768, 0.8806639416, + 0.8869174414, 0.8930697184, 0.8991246621, 0.9050859297, + 0.9109569648, 0.9167410144, 0.9224411436, 0.9280602496, + 0.9336010737, 0.9390662129, 0.9444581300, 0.9497791628, + 0.9550315328, 0.9602173528, 0.9653386345, 0.9703972943, + 0.9753951600, 0.9803339761, 0.9852154088, 0.9900410510, + 0.9948124263, 0.9995309934, 1.0041981497, 1.0088152348, + 1.0133835335, 1.0179042791, 1.0223786564, 1.0268078035 }, +}; + +#endif /* AVCODEC_WMAVOICE_DATA_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/Makefile new file mode 100644 index 00000000..83cec004 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/Makefile @@ -0,0 +1,58 @@ +OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp.o +OBJS-$(CONFIG_TRUEHD_DECODER) += x86/mlpdsp.o + +YASM-OBJS-FFT-$(HAVE_AMD3DNOW) += x86/fft_3dn.o +YASM-OBJS-FFT-$(HAVE_AMD3DNOWEXT) += x86/fft_3dn2.o +YASM-OBJS-FFT-$(HAVE_SSE) += x86/fft_sse.o +YASM-OBJS-$(CONFIG_FFT) += x86/fft_mmx.o \ + $(YASM-OBJS-FFT-yes) + +MMX-OBJS-$(CONFIG_H264DSP) += x86/h264dsp_mmx.o +YASM-OBJS-$(CONFIG_H264DSP) += x86/h264_deblock.o \ + x86/h264_weight.o \ + x86/h264_idct.o \ + +YASM-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred.o +MMX-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred_init.o + +YASM-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_yasm.o + +MMX-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp_mmx.o +MMX-OBJS-$(CONFIG_MP1FLOAT_DECODER) += x86/mpegaudiodec_mmx.o +MMX-OBJS-$(CONFIG_MP2FLOAT_DECODER) += x86/mpegaudiodec_mmx.o +MMX-OBJS-$(CONFIG_MP3FLOAT_DECODER) += x86/mpegaudiodec_mmx.o +MMX-OBJS-$(CONFIG_MP3ON4FLOAT_DECODER) += x86/mpegaudiodec_mmx.o +MMX-OBJS-$(CONFIG_MP3ADUFLOAT_DECODER) += x86/mpegaudiodec_mmx.o +MMX-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o +YASM-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_yasm.o +MMX-OBJS-$(CONFIG_GPL) += x86/idct_mmx.o +MMX-OBJS-$(CONFIG_LPC) += x86/lpc_mmx.o +MMX-OBJS-$(CONFIG_DWT) += x86/snowdsp_mmx.o +MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o +YASM-OBJS-$(CONFIG_VP3_DECODER) += x86/vp3dsp.o +YASM-OBJS-$(CONFIG_VP5_DECODER) += x86/vp3dsp.o +MMX-OBJS-$(CONFIG_VP5_DECODER) += x86/vp56dsp_init.o +YASM-OBJS-$(CONFIG_VP6_DECODER) += x86/vp3dsp.o \ + x86/vp56dsp.o +MMX-OBJS-$(CONFIG_VP6_DECODER) += x86/vp56dsp_init.o +YASM-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp.o +MMX-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp-init.o +MMX-OBJS-$(HAVE_YASM) += x86/dsputil_yasm.o \ + x86/deinterlace.o \ + x86/fmtconvert.o \ + x86/h264_chromamc.o \ + $(YASM-OBJS-yes) + +MMX-OBJS-$(CONFIG_FFT) += x86/fft.o + +OBJS-$(HAVE_MMX) += x86/dnxhd_mmx.o \ + x86/dsputil_mmx.o \ + x86/fdct_mmx.o \ + x86/fmtconvert_mmx.o \ + x86/idct_mmx_xvid.o \ + x86/idct_sse2_xvid.o \ + x86/motion_est_mmx.o \ + x86/mpegvideo_mmx.o \ + x86/simple_idct_mmx.o \ + +MMX-OBJS-$(CONFIG_DCT) += x86/dct32_sse.o diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dct32_sse.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dct32_sse.c new file mode 100644 index 00000000..74338d69 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dct32_sse.c @@ -0,0 +1,296 @@ +/* + * 32 point SSE-optimized DCT transform + * Copyright (c) 2010 Vitor Sessak + * + * 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 + */ + +#include + +#include "libavutil/x86_cpu.h" +#include "libavutil/mem.h" +#include "libavcodec/dsputil.h" +#include "fft.h" + +DECLARE_ALIGNED(16, static const float, b1)[] = { + 0.500603, 0.505471, 0.515447, 0.531043, + 0.553104, 0.582935, 0.622504, 0.674808, + -1.169440, -0.972568, -0.839350, -0.744536, + -10.190008, -3.407609, -2.057781, -1.484165, + 0.502419, 0.522499, 0.566944, 0.646822, + 0.788155, 1.060678, 1.722447, 5.101149, + 0.509796, 0.601345, 0.899976, 2.562916, + 1.000000, 1.000000, 1.306563, 0.541196, + 1.000000, 0.707107, 1.000000, -0.707107 +}; + +DECLARE_ALIGNED(16, static const int32_t, smask)[4] = { + 0, 0, 0x80000000, 0x80000000 +}; + +/* butterfly operator */ +#define BUTTERFLY(a,b,c,tmp) \ + "movaps %%" #a ", %%" #tmp " \n\t" \ + "subps %%" #b ", %%" #a " \n\t" \ + "addps %%" #tmp ", %%" #b " \n\t" \ + "mulps " #c ", %%" #a " \n\t" + +///* Same as BUTTERFLY when vectors a and b overlap */ +#define BUTTERFLY0(val, mask, cos, tmp, shuf) \ + "movaps %%" #val ", %%" #tmp " \n\t" \ + "shufps " #shuf ", %%" #val ",%%" #val " \n\t" \ + "xorps %%" #mask ", %%" #tmp " \n\t" /* flip signs */ \ + "addps %%" #tmp ", %%" #val " \n\t" \ + "mulps %%" #cos ", %%" #val " \n\t" + +#define BUTTERFLY2(val, mask, cos, tmp) BUTTERFLY0(val, mask, cos, tmp, $0x1b) +#define BUTTERFLY3(val, mask, cos, tmp) BUTTERFLY0(val, mask, cos, tmp, $0xb1) + +void ff_dct32_float_sse(FFTSample *out, const FFTSample *in) +{ + int32_t tmp1 = 0; + __asm__ volatile( + /* pass 1 */ + + "movaps (%4), %%xmm0 \n\t" + "movaps 112(%4), %%xmm1 \n\t" + "shufps $0x1b, %%xmm1, %%xmm1 \n\t" + BUTTERFLY(xmm0, xmm1, (%2), xmm3) + + "movaps 64(%4), %%xmm7 \n\t" + "movaps 48(%4), %%xmm4 \n\t" + "shufps $0x1b, %%xmm4, %%xmm4 \n\t" + BUTTERFLY(xmm7, xmm4, 48(%2), xmm3) + + + /* pass 2 */ + "movaps 64(%2), %%xmm2 \n\t" + BUTTERFLY(xmm1, xmm4, %%xmm2, xmm3) + "movaps %%xmm1, 48(%1) \n\t" + "movaps %%xmm4, (%1) \n\t" + + /* pass 1 */ + "movaps 16(%4), %%xmm1 \n\t" + "movaps 96(%4), %%xmm6 \n\t" + "shufps $0x1b, %%xmm6, %%xmm6 \n\t" + BUTTERFLY(xmm1, xmm6, 16(%2), xmm3) + + "movaps 80(%4), %%xmm4 \n\t" + "movaps 32(%4), %%xmm5 \n\t" + "shufps $0x1b, %%xmm5, %%xmm5 \n\t" + BUTTERFLY(xmm4, xmm5, 32(%2), xmm3) + + /* pass 2 */ + BUTTERFLY(xmm0, xmm7, %%xmm2, xmm3) + + "movaps 80(%2), %%xmm2 \n\t" + BUTTERFLY(xmm6, xmm5, %%xmm2, xmm3) + + BUTTERFLY(xmm1, xmm4, %%xmm2, xmm3) + + /* pass 3 */ + "movaps 96(%2), %%xmm2 \n\t" + "shufps $0x1b, %%xmm1, %%xmm1 \n\t" + BUTTERFLY(xmm0, xmm1, %%xmm2, xmm3) + "movaps %%xmm0, 112(%1) \n\t" + "movaps %%xmm1, 96(%1) \n\t" + + "movaps 0(%1), %%xmm0 \n\t" + "shufps $0x1b, %%xmm5, %%xmm5 \n\t" + BUTTERFLY(xmm0, xmm5, %%xmm2, xmm3) + + "movaps 48(%1), %%xmm1 \n\t" + "shufps $0x1b, %%xmm6, %%xmm6 \n\t" + BUTTERFLY(xmm1, xmm6, %%xmm2, xmm3) + "movaps %%xmm1, 48(%1) \n\t" + + "shufps $0x1b, %%xmm4, %%xmm4 \n\t" + BUTTERFLY(xmm7, xmm4, %%xmm2, xmm3) + + /* pass 4 */ + "movaps (%3), %%xmm3 \n\t" + "movaps 112(%2), %%xmm2 \n\t" + + BUTTERFLY2(xmm5, xmm3, xmm2, xmm1) + + BUTTERFLY2(xmm0, xmm3, xmm2, xmm1) + "movaps %%xmm0, 16(%1) \n\t" + + BUTTERFLY2(xmm6, xmm3, xmm2, xmm1) + "movaps %%xmm6, 32(%1) \n\t" + + "movaps 48(%1), %%xmm0 \n\t" + BUTTERFLY2(xmm0, xmm3, xmm2, xmm1) + "movaps %%xmm0, 48(%1) \n\t" + + BUTTERFLY2(xmm4, xmm3, xmm2, xmm1) + + BUTTERFLY2(xmm7, xmm3, xmm2, xmm1) + + "movaps 96(%1), %%xmm6 \n\t" + BUTTERFLY2(xmm6, xmm3, xmm2, xmm1) + + "movaps 112(%1), %%xmm0 \n\t" + BUTTERFLY2(xmm0, xmm3, xmm2, xmm1) + + /* pass 5 */ + "movaps 128(%2), %%xmm2 \n\t" + "shufps $0xCC, %%xmm3,%%xmm3 \n\t" + + BUTTERFLY3(xmm5, xmm3, xmm2, xmm1) + "movaps %%xmm5, (%1) \n\t" + + "movaps 16(%1), %%xmm1 \n\t" + BUTTERFLY3(xmm1, xmm3, xmm2, xmm5) + "movaps %%xmm1, 16(%1) \n\t" + + BUTTERFLY3(xmm4, xmm3, xmm2, xmm5) + "movaps %%xmm4, 64(%1) \n\t" + + BUTTERFLY3(xmm7, xmm3, xmm2, xmm5) + "movaps %%xmm7, 80(%1) \n\t" + + "movaps 32(%1), %%xmm5 \n\t" + BUTTERFLY3(xmm5, xmm3, xmm2, xmm7) + "movaps %%xmm5, 32(%1) \n\t" + + "movaps 48(%1), %%xmm4 \n\t" + BUTTERFLY3(xmm4, xmm3, xmm2, xmm7) + "movaps %%xmm4, 48(%1) \n\t" + + BUTTERFLY3(xmm6, xmm3, xmm2, xmm7) + "movaps %%xmm6, 96(%1) \n\t" + + BUTTERFLY3(xmm0, xmm3, xmm2, xmm7) + "movaps %%xmm0, 112(%1) \n\t" + + + /* pass 6, no SIMD... */ + "movss 56(%1), %%xmm3 \n\t" + "movl 4(%1), %0 \n\t" + "addss 60(%1), %%xmm3 \n\t" + "movss 72(%1), %%xmm7 \n\t" + "addss %%xmm3, %%xmm4 \n\t" + "movss 52(%1), %%xmm2 \n\t" + "addss %%xmm3, %%xmm2 \n\t" + "movss 24(%1), %%xmm3 \n\t" + "addss 28(%1), %%xmm3 \n\t" + "addss 76(%1), %%xmm7 \n\t" + "addss %%xmm3, %%xmm1 \n\t" + "addss %%xmm4, %%xmm5 \n\t" + "movss %%xmm1, 16(%1) \n\t" + "movss 20(%1), %%xmm1 \n\t" + "addss %%xmm3, %%xmm1 \n\t" + "movss 40(%1), %%xmm3 \n\t" + "movss %%xmm1, 48(%1) \n\t" + "addss 44(%1), %%xmm3 \n\t" + "movss 20(%1), %%xmm1 \n\t" + "addss %%xmm3, %%xmm4 \n\t" + "addss %%xmm2, %%xmm3 \n\t" + "addss 28(%1), %%xmm1 \n\t" + "movss %%xmm3, 40(%1) \n\t" + "addss 36(%1), %%xmm2 \n\t" + "movss 8(%1), %%xmm3 \n\t" + "movss %%xmm2, 56(%1) \n\t" + "addss 12(%1), %%xmm3 \n\t" + "movss %%xmm5, 8(%1) \n\t" + "movss %%xmm3, 32(%1) \n\t" + "movss 52(%1), %%xmm2 \n\t" + "movss 80(%1), %%xmm3 \n\t" + "movss 120(%1), %%xmm5 \n\t" + "movss %%xmm1, 80(%1) \n\t" + "movss %%xmm4, 24(%1) \n\t" + "addss 124(%1), %%xmm5 \n\t" + "movss 64(%1), %%xmm1 \n\t" + "addss 60(%1), %%xmm2 \n\t" + "addss %%xmm5, %%xmm0 \n\t" + "addss 116(%1), %%xmm5 \n\t" + "movl %0, 64(%1) \n\t" + "addss %%xmm0, %%xmm6 \n\t" + "addss %%xmm6, %%xmm1 \n\t" + "movl 12(%1), %0 \n\t" + "movss %%xmm1, 4(%1) \n\t" + "movss 88(%1), %%xmm1 \n\t" + "movl %0, 96(%1) \n\t" + "addss 92(%1), %%xmm1 \n\t" + "movss 104(%1), %%xmm4 \n\t" + "movl 28(%1), %0 \n\t" + "addss 108(%1), %%xmm4 \n\t" + "addss %%xmm4, %%xmm0 \n\t" + "addss %%xmm1, %%xmm3 \n\t" + "addss 84(%1), %%xmm1 \n\t" + "addss %%xmm5, %%xmm4 \n\t" + "addss %%xmm3, %%xmm6 \n\t" + "addss %%xmm0, %%xmm3 \n\t" + "addss %%xmm7, %%xmm0 \n\t" + "addss 100(%1), %%xmm5 \n\t" + "addss %%xmm4, %%xmm7 \n\t" + "movl %0, 112(%1) \n\t" + "movss %%xmm0, 28(%1) \n\t" + "movss 36(%1), %%xmm0 \n\t" + "movss %%xmm7, 36(%1) \n\t" + "addss %%xmm1, %%xmm4 \n\t" + "movss 116(%1), %%xmm7 \n\t" + "addss %%xmm2, %%xmm0 \n\t" + "addss 124(%1), %%xmm7 \n\t" + "movss %%xmm0, 72(%1) \n\t" + "movss 44(%1), %%xmm0 \n\t" + "movss %%xmm6, 12(%1) \n\t" + "movss %%xmm3, 20(%1) \n\t" + "addss %%xmm0, %%xmm2 \n\t" + "movss %%xmm4, 44(%1) \n\t" + "movss %%xmm2, 88(%1) \n\t" + "addss 60(%1), %%xmm0 \n\t" + "movl 60(%1), %0 \n\t" + "movl %0, 120(%1) \n\t" + "movss %%xmm0, 104(%1) \n\t" + "addss %%xmm5, %%xmm1 \n\t" + "addss 68(%1), %%xmm5 \n\t" + "movss %%xmm1, 52(%1) \n\t" + "movss %%xmm5, 60(%1) \n\t" + "movss 68(%1), %%xmm1 \n\t" + "movss 100(%1), %%xmm5 \n\t" + "addss %%xmm7, %%xmm5 \n\t" + "addss 108(%1), %%xmm7 \n\t" + "addss %%xmm5, %%xmm1 \n\t" + "movss 84(%1), %%xmm2 \n\t" + "addss 92(%1), %%xmm2 \n\t" + "addss %%xmm2, %%xmm5 \n\t" + "movss %%xmm1, 68(%1) \n\t" + "addss %%xmm7, %%xmm2 \n\t" + "movss 76(%1), %%xmm1 \n\t" + "movss %%xmm2, 84(%1) \n\t" + "movss %%xmm5, 76(%1) \n\t" + "movss 108(%1), %%xmm2 \n\t" + "addss %%xmm1, %%xmm7 \n\t" + "addss 124(%1), %%xmm2 \n\t" + "addss %%xmm2, %%xmm1 \n\t" + "addss 92(%1), %%xmm2 \n\t" + "movss %%xmm1, 100(%1) \n\t" + "movss %%xmm2, 108(%1) \n\t" + "movss 92(%1), %%xmm2 \n\t" + "movss %%xmm7, 92(%1) \n\t" + "addss 124(%1), %%xmm2 \n\t" + "movss %%xmm2, 116(%1) \n\t" + :"+&r"(tmp1) + :"r"(out), "r"(b1), "r"(smask), "r"(in) + :XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", + "%xmm4", "%xmm5", "%xmm6", "%xmm7",) + "memory" + ); +} + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/deinterlace.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/deinterlace.asm new file mode 100644 index 00000000..76a096ef --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/deinterlace.asm @@ -0,0 +1,83 @@ +;****************************************************************************** +;* MMX optimized deinterlacing functions +;* Copyright (c) 2010 Vitor Sessak +;* Copyright (c) 2002 Michael Niedermayer +;* +;* 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 +;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;****************************************************************************** + +%include "x86inc.asm" +%include "x86util.asm" + +SECTION_RODATA + +cextern pw_4 + +SECTION .text + +%macro DEINTERLACE 1 +%ifidn %1, inplace +;void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size) +cglobal deinterlace_line_inplace_mmx, 6,6,7, lum_m4, lum_m3, lum_m2, lum_m1, lum, size +%else +;void ff_deinterlace_line_mmx(uint8_t *dst, const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size) +cglobal deinterlace_line_mmx, 7,7,7, dst, lum_m4, lum_m3, lum_m2, lum_m1, lum, size +%endif + pxor mm7, mm7 + movq mm6, [pw_4] +.nextrow + movd mm0, [lum_m4q] + movd mm1, [lum_m3q] + movd mm2, [lum_m2q] +%ifidn %1, inplace + movd [lum_m4q], mm2 +%endif + movd mm3, [lum_m1q] + movd mm4, [lumq] + punpcklbw mm0, mm7 + punpcklbw mm1, mm7 + punpcklbw mm2, mm7 + punpcklbw mm3, mm7 + punpcklbw mm4, mm7 + paddw mm1, mm3 + psllw mm2, 1 + paddw mm0, mm4 + psllw mm1, 2 + paddw mm2, mm6 + paddw mm1, mm2 + psubusw mm1, mm0 + psrlw mm1, 3 + packuswb mm1, mm7 +%ifidn %1, inplace + movd [lum_m2q], mm1 +%else + movd [dstq], mm1 + add dstq, 4 +%endif + add lum_m4q, 4 + add lum_m3q, 4 + add lum_m2q, 4 + add lum_m1q, 4 + add lumq, 4 + sub sized, 4 + jg .nextrow + REP_RET +%endmacro + +DEINTERLACE "" + +DEINTERLACE inplace diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputilenc_yasm.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputilenc_yasm.asm new file mode 100644 index 00000000..b2844a5c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/dsputilenc_yasm.asm @@ -0,0 +1,342 @@ +;***************************************************************************** +;* MMX optimized DSP utils +;***************************************************************************** +;* Copyright (c) 2000, 2001 Fabrice Bellard +;* Copyright (c) 2002-2004 Michael Niedermayer +;* +;* 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 +;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;***************************************************************************** + +%include "x86inc.asm" +%include "x86util.asm" + +SECTION .text + +%macro DIFF_PIXELS_1 4 + movh %1, %3 + movh %2, %4 + punpcklbw %2, %1 + punpcklbw %1, %1 + psubw %1, %2 +%endmacro + +; %1=uint8_t *pix1, %2=uint8_t *pix2, %3=static offset, %4=stride, %5=stride*3 +; %6=temporary storage location +; this macro requires $mmsize stack space (aligned) on %6 (except on SSE+x86-64) +%macro DIFF_PIXELS_8 6 + DIFF_PIXELS_1 m0, m7, [%1 +%3], [%2 +%3] + DIFF_PIXELS_1 m1, m7, [%1+%4 +%3], [%2+%4 +%3] + DIFF_PIXELS_1 m2, m7, [%1+%4*2+%3], [%2+%4*2+%3] + add %1, %5 + add %2, %5 + DIFF_PIXELS_1 m3, m7, [%1 +%3], [%2 +%3] + DIFF_PIXELS_1 m4, m7, [%1+%4 +%3], [%2+%4 +%3] + DIFF_PIXELS_1 m5, m7, [%1+%4*2+%3], [%2+%4*2+%3] + DIFF_PIXELS_1 m6, m7, [%1+%5 +%3], [%2+%5 +%3] +%ifdef m8 + DIFF_PIXELS_1 m7, m8, [%1+%4*4+%3], [%2+%4*4+%3] +%else + mova [%6], m0 + DIFF_PIXELS_1 m7, m0, [%1+%4*4+%3], [%2+%4*4+%3] + mova m0, [%6] +%endif + sub %1, %5 + sub %2, %5 +%endmacro + +%macro HADAMARD8 0 + SUMSUB_BADC m0, m1, m2, m3 + SUMSUB_BADC m4, m5, m6, m7 + SUMSUB_BADC m0, m2, m1, m3 + SUMSUB_BADC m4, m6, m5, m7 + SUMSUB_BADC m0, m4, m1, m5 + SUMSUB_BADC m2, m6, m3, m7 +%endmacro + +%macro ABS1_SUM 3 + ABS1 %1, %2 + paddusw %3, %1 +%endmacro + +%macro ABS2_SUM 6 + ABS2 %1, %2, %3, %4 + paddusw %5, %1 + paddusw %6, %2 +%endmacro + +%macro ABS_SUM_8x8_64 1 + ABS2 m0, m1, m8, m9 + ABS2_SUM m2, m3, m8, m9, m0, m1 + ABS2_SUM m4, m5, m8, m9, m0, m1 + ABS2_SUM m6, m7, m8, m9, m0, m1 + paddusw m0, m1 +%endmacro + +%macro ABS_SUM_8x8_32 1 + mova [%1], m7 + ABS1 m0, m7 + ABS1 m1, m7 + ABS1_SUM m2, m7, m0 + ABS1_SUM m3, m7, m1 + ABS1_SUM m4, m7, m0 + ABS1_SUM m5, m7, m1 + ABS1_SUM m6, m7, m0 + mova m2, [%1] + ABS1_SUM m2, m7, m1 + paddusw m0, m1 +%endmacro + +; FIXME: HSUM_* saturates at 64k, while an 8x8 hadamard or dct block can get up to +; about 100k on extreme inputs. But that's very unlikely to occur in natural video, +; and it's even more unlikely to not have any alternative mvs/modes with lower cost. +%macro HSUM_MMX 3 + mova %2, %1 + psrlq %1, 32 + paddusw %1, %2 + mova %2, %1 + psrlq %1, 16 + paddusw %1, %2 + movd %3, %1 +%endmacro + +%macro HSUM_MMX2 3 + pshufw %2, %1, 0xE + paddusw %1, %2 + pshufw %2, %1, 0x1 + paddusw %1, %2 + movd %3, %1 +%endmacro + +%macro HSUM_SSE2 3 + movhlps %2, %1 + paddusw %1, %2 + pshuflw %2, %1, 0xE + paddusw %1, %2 + pshuflw %2, %1, 0x1 + paddusw %1, %2 + movd %3, %1 +%endmacro + +%macro STORE4 5 + mova [%1+mmsize*0], %2 + mova [%1+mmsize*1], %3 + mova [%1+mmsize*2], %4 + mova [%1+mmsize*3], %5 +%endmacro + +%macro LOAD4 5 + mova %2, [%1+mmsize*0] + mova %3, [%1+mmsize*1] + mova %4, [%1+mmsize*2] + mova %5, [%1+mmsize*3] +%endmacro + +%macro hadamard8_16_wrapper 3 +cglobal hadamard8_diff_%1, 4, 4, %2 +%ifndef m8 + %assign pad %3*mmsize-(4+stack_offset&(mmsize-1)) + SUB rsp, pad +%endif + call hadamard8x8_diff_%1 +%ifndef m8 + ADD rsp, pad +%endif + RET + +cglobal hadamard8_diff16_%1, 5, 6, %2 +%ifndef m8 + %assign pad %3*mmsize-(4+stack_offset&(mmsize-1)) + SUB rsp, pad +%endif + + call hadamard8x8_diff_%1 + mov r5d, eax + + add r1, 8 + add r2, 8 + call hadamard8x8_diff_%1 + add r5d, eax + + cmp r4d, 16 + jne .done + + lea r1, [r1+r3*8-8] + lea r2, [r2+r3*8-8] + call hadamard8x8_diff_%1 + add r5d, eax + + add r1, 8 + add r2, 8 + call hadamard8x8_diff_%1 + add r5d, eax + +.done + mov eax, r5d +%ifndef m8 + ADD rsp, pad +%endif + RET +%endmacro + +%macro HADAMARD8_DIFF_MMX 1 +ALIGN 16 +; int hadamard8_diff_##cpu(void *s, uint8_t *src1, uint8_t *src2, +; int stride, int h) +; r0 = void *s = unused, int h = unused (always 8) +; note how r1, r2 and r3 are not clobbered in this function, so 16x16 +; can simply call this 2x2x (and that's why we access rsp+gprsize +; everywhere, which is rsp of calling func +hadamard8x8_diff_%1: + lea r0, [r3*3] + + ; first 4x8 pixels + DIFF_PIXELS_8 r1, r2, 0, r3, r0, rsp+gprsize+0x60 + HADAMARD8 + mova [rsp+gprsize+0x60], m7 + TRANSPOSE4x4W 0, 1, 2, 3, 7 + STORE4 rsp+gprsize, m0, m1, m2, m3 + mova m7, [rsp+gprsize+0x60] + TRANSPOSE4x4W 4, 5, 6, 7, 0 + STORE4 rsp+gprsize+0x40, m4, m5, m6, m7 + + ; second 4x8 pixels + DIFF_PIXELS_8 r1, r2, 4, r3, r0, rsp+gprsize+0x60 + HADAMARD8 + mova [rsp+gprsize+0x60], m7 + TRANSPOSE4x4W 0, 1, 2, 3, 7 + STORE4 rsp+gprsize+0x20, m0, m1, m2, m3 + mova m7, [rsp+gprsize+0x60] + TRANSPOSE4x4W 4, 5, 6, 7, 0 + + LOAD4 rsp+gprsize+0x40, m0, m1, m2, m3 + HADAMARD8 + ABS_SUM_8x8_32 rsp+gprsize+0x60 + mova [rsp+gprsize+0x60], m0 + + LOAD4 rsp+gprsize , m0, m1, m2, m3 + LOAD4 rsp+gprsize+0x20, m4, m5, m6, m7 + HADAMARD8 + ABS_SUM_8x8_32 rsp+gprsize + paddusw m0, [rsp+gprsize+0x60] + + HSUM m0, m1, eax + and rax, 0xFFFF + ret + +hadamard8_16_wrapper %1, 0, 14 +%endmacro + +%macro HADAMARD8_DIFF_SSE2 2 +hadamard8x8_diff_%1: + lea r0, [r3*3] + DIFF_PIXELS_8 r1, r2, 0, r3, r0, rsp+gprsize + HADAMARD8 +%ifdef ARCH_X86_64 + TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, 8 +%else + TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, [rsp+gprsize], [rsp+mmsize+gprsize] +%endif + HADAMARD8 + ABS_SUM_8x8 rsp+gprsize + HSUM_SSE2 m0, m1, eax + and eax, 0xFFFF + ret + +hadamard8_16_wrapper %1, %2, 3 +%endmacro + +INIT_MMX +%define ABS1 ABS1_MMX +%define HSUM HSUM_MMX +HADAMARD8_DIFF_MMX mmx + +%define ABS1 ABS1_MMX2 +%define HSUM HSUM_MMX2 +HADAMARD8_DIFF_MMX mmx2 + +INIT_XMM +%define ABS2 ABS2_MMX2 +%ifdef ARCH_X86_64 +%define ABS_SUM_8x8 ABS_SUM_8x8_64 +%else +%define ABS_SUM_8x8 ABS_SUM_8x8_32 +%endif +HADAMARD8_DIFF_SSE2 sse2, 10 + +%define ABS2 ABS2_SSSE3 +%define ABS_SUM_8x8 ABS_SUM_8x8_64 +HADAMARD8_DIFF_SSE2 ssse3, 9 + +INIT_XMM +; sse16_sse2(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) +cglobal sse16_sse2, 5, 5, 8 + shr r4d, 1 + pxor m0, m0 ; mm0 = 0 + pxor m7, m7 ; mm7 holds the sum + +.next2lines ; FIXME why are these unaligned movs? pix1[] is aligned + movu m1, [r1 ] ; mm1 = pix1[0][0-15] + movu m2, [r2 ] ; mm2 = pix2[0][0-15] + movu m3, [r1+r3] ; mm3 = pix1[1][0-15] + movu m4, [r2+r3] ; mm4 = pix2[1][0-15] + + ; todo: mm1-mm2, mm3-mm4 + ; algo: subtract mm1 from mm2 with saturation and vice versa + ; OR the result to get the absolute difference + mova m5, m1 + mova m6, m3 + psubusb m1, m2 + psubusb m3, m4 + psubusb m2, m5 + psubusb m4, m6 + + por m2, m1 + por m4, m3 + + ; now convert to 16-bit vectors so we can square them + mova m1, m2 + mova m3, m4 + + punpckhbw m2, m0 + punpckhbw m4, m0 + punpcklbw m1, m0 ; mm1 not spread over (mm1,mm2) + punpcklbw m3, m0 ; mm4 not spread over (mm3,mm4) + + pmaddwd m2, m2 + pmaddwd m4, m4 + pmaddwd m1, m1 + pmaddwd m3, m3 + + lea r1, [r1+r3*2] ; pix1 += 2*line_size + lea r2, [r2+r3*2] ; pix2 += 2*line_size + + paddd m1, m2 + paddd m3, m4 + paddd m7, m1 + paddd m7, m3 + + dec r4 + jnz .next2lines + + mova m1, m7 + psrldq m7, 8 ; shift hi qword to lo + paddd m7, m1 + mova m1, m7 + psrldq m7, 4 ; shift hi dword to lo + paddd m7, m1 + movd eax, m7 ; return value + RET diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/fmtconvert.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/fmtconvert.asm new file mode 100644 index 00000000..6c744fc5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/fmtconvert.asm @@ -0,0 +1,91 @@ +;****************************************************************************** +;* x86 optimized Format Conversion Utils +;* Copyright (c) 2008 Loren Merritt +;* +;* 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 +;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;****************************************************************************** + +%include "x86inc.asm" + +section .text align=16 + +%macro PSWAPD_SSE 2 + pshufw %1, %2, 0x4e +%endmacro +%macro PSWAPD_3DN1 2 + movq %1, %2 + psrlq %1, 32 + punpckldq %1, %2 +%endmacro + +%macro FLOAT_TO_INT16_INTERLEAVE6 1 +; void float_to_int16_interleave6_sse(int16_t *dst, const float **src, int len) +cglobal float_to_int16_interleave6_%1, 2,7,0, dst, src, src1, src2, src3, src4, src5 +%ifdef ARCH_X86_64 + %define lend r10d + mov lend, r2d +%else + %define lend dword r2m +%endif + mov src1q, [srcq+1*gprsize] + mov src2q, [srcq+2*gprsize] + mov src3q, [srcq+3*gprsize] + mov src4q, [srcq+4*gprsize] + mov src5q, [srcq+5*gprsize] + mov srcq, [srcq] + sub src1q, srcq + sub src2q, srcq + sub src3q, srcq + sub src4q, srcq + sub src5q, srcq +.loop: + cvtps2pi mm0, [srcq] + cvtps2pi mm1, [srcq+src1q] + cvtps2pi mm2, [srcq+src2q] + cvtps2pi mm3, [srcq+src3q] + cvtps2pi mm4, [srcq+src4q] + cvtps2pi mm5, [srcq+src5q] + packssdw mm0, mm3 + packssdw mm1, mm4 + packssdw mm2, mm5 + pswapd mm3, mm0 + punpcklwd mm0, mm1 + punpckhwd mm1, mm2 + punpcklwd mm2, mm3 + pswapd mm3, mm0 + punpckldq mm0, mm2 + punpckhdq mm2, mm1 + punpckldq mm1, mm3 + movq [dstq ], mm0 + movq [dstq+16], mm2 + movq [dstq+ 8], mm1 + add srcq, 8 + add dstq, 24 + sub lend, 2 + jg .loop + emms + RET +%endmacro ; FLOAT_TO_INT16_INTERLEAVE6 + +%define pswapd PSWAPD_SSE +FLOAT_TO_INT16_INTERLEAVE6 sse +%define cvtps2pi pf2id +%define pswapd PSWAPD_3DN1 +FLOAT_TO_INT16_INTERLEAVE6 3dnow +%undef pswapd +FLOAT_TO_INT16_INTERLEAVE6 3dn2 +%undef cvtps2pi diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/fmtconvert_mmx.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/fmtconvert_mmx.c new file mode 100644 index 00000000..ea41f730 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/fmtconvert_mmx.c @@ -0,0 +1,266 @@ +/* + * Format Conversion Utils + * Copyright (c) 2000, 2001 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + * + * MMX optimization by Nick Kurshev + */ + +#include "libavutil/cpu.h" +#include "libavutil/x86_cpu.h" +#include "libavcodec/fmtconvert.h" + +static void int32_to_float_fmul_scalar_sse(float *dst, const int *src, float mul, int len) +{ + x86_reg i = -4*len; + __asm__ volatile( + "movss %3, %%xmm4 \n" + "shufps $0, %%xmm4, %%xmm4 \n" + "1: \n" + "cvtpi2ps (%2,%0), %%xmm0 \n" + "cvtpi2ps 8(%2,%0), %%xmm1 \n" + "cvtpi2ps 16(%2,%0), %%xmm2 \n" + "cvtpi2ps 24(%2,%0), %%xmm3 \n" + "movlhps %%xmm1, %%xmm0 \n" + "movlhps %%xmm3, %%xmm2 \n" + "mulps %%xmm4, %%xmm0 \n" + "mulps %%xmm4, %%xmm2 \n" + "movaps %%xmm0, (%1,%0) \n" + "movaps %%xmm2, 16(%1,%0) \n" + "add $32, %0 \n" + "jl 1b \n" + :"+r"(i) + :"r"(dst+len), "r"(src+len), "m"(mul) + ); +} + +static void int32_to_float_fmul_scalar_sse2(float *dst, const int *src, float mul, int len) +{ + x86_reg i = -4*len; + __asm__ volatile( + "movss %3, %%xmm4 \n" + "shufps $0, %%xmm4, %%xmm4 \n" + "1: \n" + "cvtdq2ps (%2,%0), %%xmm0 \n" + "cvtdq2ps 16(%2,%0), %%xmm1 \n" + "mulps %%xmm4, %%xmm0 \n" + "mulps %%xmm4, %%xmm1 \n" + "movaps %%xmm0, (%1,%0) \n" + "movaps %%xmm1, 16(%1,%0) \n" + "add $32, %0 \n" + "jl 1b \n" + :"+r"(i) + :"r"(dst+len), "r"(src+len), "m"(mul) + ); +} + +static void float_to_int16_3dnow(int16_t *dst, const float *src, long len){ + x86_reg reglen = len; + // not bit-exact: pf2id uses different rounding than C and SSE + __asm__ volatile( + "add %0 , %0 \n\t" + "lea (%2,%0,2) , %2 \n\t" + "add %0 , %1 \n\t" + "neg %0 \n\t" + "1: \n\t" + "pf2id (%2,%0,2) , %%mm0 \n\t" + "pf2id 8(%2,%0,2) , %%mm1 \n\t" + "pf2id 16(%2,%0,2) , %%mm2 \n\t" + "pf2id 24(%2,%0,2) , %%mm3 \n\t" + "packssdw %%mm1 , %%mm0 \n\t" + "packssdw %%mm3 , %%mm2 \n\t" + "movq %%mm0 , (%1,%0) \n\t" + "movq %%mm2 , 8(%1,%0) \n\t" + "add $16 , %0 \n\t" + " js 1b \n\t" + "femms \n\t" + :"+r"(reglen), "+r"(dst), "+r"(src) + ); +} + +static void float_to_int16_sse(int16_t *dst, const float *src, long len){ + x86_reg reglen = len; + __asm__ volatile( + "add %0 , %0 \n\t" + "lea (%2,%0,2) , %2 \n\t" + "add %0 , %1 \n\t" + "neg %0 \n\t" + "1: \n\t" + "cvtps2pi (%2,%0,2) , %%mm0 \n\t" + "cvtps2pi 8(%2,%0,2) , %%mm1 \n\t" + "cvtps2pi 16(%2,%0,2) , %%mm2 \n\t" + "cvtps2pi 24(%2,%0,2) , %%mm3 \n\t" + "packssdw %%mm1 , %%mm0 \n\t" + "packssdw %%mm3 , %%mm2 \n\t" + "movq %%mm0 , (%1,%0) \n\t" + "movq %%mm2 , 8(%1,%0) \n\t" + "add $16 , %0 \n\t" + " js 1b \n\t" + "emms \n\t" + :"+r"(reglen), "+r"(dst), "+r"(src) + ); +} + +static void float_to_int16_sse2(int16_t *dst, const float *src, long len){ + x86_reg reglen = len; + __asm__ volatile( + "add %0 , %0 \n\t" + "lea (%2,%0,2) , %2 \n\t" + "add %0 , %1 \n\t" + "neg %0 \n\t" + "1: \n\t" + "cvtps2dq (%2,%0,2) , %%xmm0 \n\t" + "cvtps2dq 16(%2,%0,2) , %%xmm1 \n\t" + "packssdw %%xmm1 , %%xmm0 \n\t" + "movdqa %%xmm0 , (%1,%0) \n\t" + "add $16 , %0 \n\t" + " js 1b \n\t" + :"+r"(reglen), "+r"(dst), "+r"(src) + ); +} + +void ff_float_to_int16_interleave6_sse(int16_t *dst, const float **src, int len); +void ff_float_to_int16_interleave6_3dnow(int16_t *dst, const float **src, int len); +void ff_float_to_int16_interleave6_3dn2(int16_t *dst, const float **src, int len); + +#if !HAVE_YASM +#define ff_float_to_int16_interleave6_sse(a,b,c) float_to_int16_interleave_misc_sse(a,b,c,6) +#define ff_float_to_int16_interleave6_3dnow(a,b,c) float_to_int16_interleave_misc_3dnow(a,b,c,6) +#define ff_float_to_int16_interleave6_3dn2(a,b,c) float_to_int16_interleave_misc_3dnow(a,b,c,6) +#endif +#define ff_float_to_int16_interleave6_sse2 ff_float_to_int16_interleave6_sse + +#define FLOAT_TO_INT16_INTERLEAVE(cpu, body) \ +/* gcc pessimizes register allocation if this is in the same function as float_to_int16_interleave_sse2*/\ +static av_noinline void float_to_int16_interleave_misc_##cpu(int16_t *dst, const float **src, long len, int channels){\ + DECLARE_ALIGNED(16, int16_t, tmp)[len];\ + int i,j,c;\ + for(c=0; cflags & CODEC_FLAG_BITEXACT)){ + c->float_to_int16 = float_to_int16_3dnow; + c->float_to_int16_interleave = float_to_int16_interleave_3dnow; + } + } + if(mm_flags & AV_CPU_FLAG_3DNOWEXT){ + if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ + c->float_to_int16_interleave = float_to_int16_interleave_3dn2; + } + } + if(mm_flags & AV_CPU_FLAG_SSE){ + c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_sse; + c->float_to_int16 = float_to_int16_sse; + c->float_to_int16_interleave = float_to_int16_interleave_sse; + } + if(mm_flags & AV_CPU_FLAG_SSE2){ + c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_sse2; + c->float_to_int16 = float_to_int16_sse2; + c->float_to_int16_interleave = float_to_int16_interleave_sse2; + } + } +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_chromamc.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_chromamc.asm new file mode 100644 index 00000000..3bb5ed48 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_chromamc.asm @@ -0,0 +1,669 @@ +;****************************************************************************** +;* MMX/SSSE3-optimized functions for H264 chroma MC +;* Copyright (c) 2005 Zoltan Hidvegi , +;* 2005-2008 Loren Merritt +;* +;* 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 +;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;****************************************************************************** + +%include "x86inc.asm" +%include "x86util.asm" + +SECTION_RODATA + +rnd_rv40_2d_tbl: times 4 dw 0 + times 4 dw 16 + times 4 dw 32 + times 4 dw 16 + times 4 dw 32 + times 4 dw 28 + times 4 dw 32 + times 4 dw 28 + times 4 dw 0 + times 4 dw 32 + times 4 dw 16 + times 4 dw 32 + times 4 dw 32 + times 4 dw 28 + times 4 dw 32 + times 4 dw 28 +rnd_rv40_1d_tbl: times 4 dw 0 + times 4 dw 2 + times 4 dw 4 + times 4 dw 2 + times 4 dw 4 + times 4 dw 3 + times 4 dw 4 + times 4 dw 3 + times 4 dw 0 + times 4 dw 4 + times 4 dw 2 + times 4 dw 4 + times 4 dw 4 + times 4 dw 3 + times 4 dw 4 + times 4 dw 3 + +cextern pw_3 +cextern pw_4 +cextern pw_8 +cextern pw_28 +cextern pw_32 +cextern pw_64 + +SECTION .text + +%macro mv0_pixels_mc8 0 + lea r4, [r2*2 ] +.next4rows + movq mm0, [r1 ] + movq mm1, [r1+r2] + CHROMAMC_AVG mm0, [r0 ] + CHROMAMC_AVG mm1, [r0+r2] + movq [r0 ], mm0 + movq [r0+r2], mm1 + add r0, r4 + add r1, r4 + movq mm0, [r1 ] + movq mm1, [r1+r2] + CHROMAMC_AVG mm0, [r0 ] + CHROMAMC_AVG mm1, [r0+r2] + add r1, r4 + movq [r0 ], mm0 + movq [r0+r2], mm1 + add r0, r4 + sub r3d, 4 + jne .next4rows +%endmacro + +%macro chroma_mc8_mmx_func 3 +; put/avg_h264_chroma_mc8_mmx_*(uint8_t *dst /*align 8*/, uint8_t *src /*align 1*/, +; int stride, int h, int mx, int my) +cglobal %1_%2_chroma_mc8_%3, 6, 7, 0 +%ifdef ARCH_X86_64 + movsxd r2, r2d +%endif + mov r6d, r5d + or r6d, r4d + jne .at_least_one_non_zero + ; mx == 0 AND my == 0 - no filter needed + mv0_pixels_mc8 + REP_RET + +.at_least_one_non_zero +%ifidn %2, rv40 +%ifdef PIC +%define rnd_1d_rv40 r11 +%define rnd_2d_rv40 r11 +%else ; no-PIC +%define rnd_1d_rv40 rnd_rv40_1d_tbl +%define rnd_2d_rv40 rnd_rv40_2d_tbl +%endif +%ifdef ARCH_X86_64 + mov r10, r5 + and r10, 6 ; &~1 for mx/my=[0,7] + lea r10, [r10*4+r4] + sar r10d, 1 +%define rnd_bias r10 +%define dest_reg r0 +%else ; x86-32 + mov r0, r5 + and r0, 6 ; &~1 for mx/my=[0,7] + lea r0, [r0*4+r4] + sar r0d, 1 +%define rnd_bias r0 +%define dest_reg r5 +%endif +%else ; vc1, h264 +%define rnd_bias 0 +%define dest_reg r0 +%endif + + test r5d, r5d + mov r6, 1 + je .my_is_zero + test r4d, r4d + mov r6, r2 ; dxy = x ? 1 : stride + jne .both_non_zero +.my_is_zero + ; mx == 0 XOR my == 0 - 1 dimensional filter only + or r4d, r5d ; x + y + +%ifidn %2, rv40 +%ifdef PIC + lea r11, [rnd_rv40_1d_tbl] +%endif +%ifndef ARCH_X86_64 + mov r5, r0m +%endif +%endif + + movd m5, r4d + movq m4, [pw_8] + movq m6, [rnd_1d_%2+rnd_bias*8] ; mm6 = rnd >> 3 + punpcklwd m5, m5 + punpckldq m5, m5 ; mm5 = B = x + pxor m7, m7 + psubw m4, m5 ; mm4 = A = 8-x + +.next1drow + movq m0, [r1 ] ; mm0 = src[0..7] + movq m2, [r1+r6] ; mm1 = src[1..8] + + movq m1, m0 + movq m3, m2 + punpcklbw m0, m7 + punpckhbw m1, m7 + punpcklbw m2, m7 + punpckhbw m3, m7 + pmullw m0, m4 ; [mm0,mm1] = A * src[0..7] + pmullw m1, m4 + pmullw m2, m5 ; [mm2,mm3] = B * src[1..8] + pmullw m3, m5 + + paddw m0, m6 + paddw m1, m6 + paddw m0, m2 + paddw m1, m3 + psrlw m0, 3 + psrlw m1, 3 + packuswb m0, m1 + CHROMAMC_AVG m0, [dest_reg] + movq [dest_reg], m0 ; dst[0..7] = (A * src[0..7] + B * src[1..8] + (rnd >> 3)) >> 3 + + add dest_reg, r2 + add r1, r2 + dec r3d + jne .next1drow + REP_RET + +.both_non_zero ; general case, bilinear + movd m4, r4d ; x + movd m6, r5d ; y +%ifidn %2, rv40 +%ifdef PIC + lea r11, [rnd_rv40_2d_tbl] +%endif +%ifndef ARCH_X86_64 + mov r5, r0m +%endif +%endif + mov r6, rsp ; backup stack pointer + and rsp, ~(mmsize-1) ; align stack + sub rsp, 16 ; AA and DD + + punpcklwd m4, m4 + punpcklwd m6, m6 + punpckldq m4, m4 ; mm4 = x words + punpckldq m6, m6 ; mm6 = y words + movq m5, m4 + pmullw m4, m6 ; mm4 = x * y + psllw m5, 3 + psllw m6, 3 + movq m7, m5 + paddw m7, m6 + movq [rsp+8], m4 ; DD = x * y + psubw m5, m4 ; mm5 = B = 8x - xy + psubw m6, m4 ; mm6 = C = 8y - xy + paddw m4, [pw_64] + psubw m4, m7 ; mm4 = A = xy - (8x+8y) + 64 + pxor m7, m7 + movq [rsp ], m4 + + movq m0, [r1 ] ; mm0 = src[0..7] + movq m1, [r1+1] ; mm1 = src[1..8] +.next2drow + add r1, r2 + + movq m2, m0 + movq m3, m1 + punpckhbw m0, m7 + punpcklbw m1, m7 + punpcklbw m2, m7 + punpckhbw m3, m7 + pmullw m0, [rsp] + pmullw m2, [rsp] + pmullw m1, m5 + pmullw m3, m5 + paddw m2, m1 ; mm2 = A * src[0..3] + B * src[1..4] + paddw m3, m0 ; mm3 = A * src[4..7] + B * src[5..8] + + movq m0, [r1] + movq m1, m0 + punpcklbw m0, m7 + punpckhbw m1, m7 + pmullw m0, m6 + pmullw m1, m6 + paddw m2, m0 + paddw m3, m1 ; [mm2,mm3] += C * src[0..7] + + movq m1, [r1+1] + movq m0, m1 + movq m4, m1 + punpcklbw m0, m7 + punpckhbw m4, m7 + pmullw m0, [rsp+8] + pmullw m4, [rsp+8] + paddw m2, m0 + paddw m3, m4 ; [mm2,mm3] += D * src[1..8] + movq m0, [r1] + + paddw m2, [rnd_2d_%2+rnd_bias*8] + paddw m3, [rnd_2d_%2+rnd_bias*8] + psrlw m2, 6 + psrlw m3, 6 + packuswb m2, m3 + CHROMAMC_AVG m2, [dest_reg] + movq [dest_reg], m2 ; dst[0..7] = ([mm2,mm3] + rnd) >> 6 + + add dest_reg, r2 + dec r3d + jne .next2drow + mov rsp, r6 ; restore stack pointer + RET +%endmacro + +%macro chroma_mc4_mmx_func 3 +cglobal %1_%2_chroma_mc4_%3, 6, 6, 0 +%ifdef ARCH_X86_64 + movsxd r2, r2d +%endif + pxor m7, m7 + movd m2, r4d ; x + movd m3, r5d ; y + movq m4, [pw_8] + movq m5, [pw_8] + punpcklwd m2, m2 + punpcklwd m3, m3 + punpcklwd m2, m2 + punpcklwd m3, m3 + psubw m4, m2 + psubw m5, m3 + +%ifidn %2, rv40 +%ifdef PIC + lea r11, [rnd_rv40_2d_tbl] +%define rnd_2d_rv40 r11 +%else +%define rnd_2d_rv40 rnd_rv40_2d_tbl +%endif + and r5, 6 ; &~1 for mx/my=[0,7] + lea r5, [r5*4+r4] + sar r5d, 1 +%define rnd_bias r5 +%else ; vc1, h264 +%define rnd_bias 0 +%endif + + movd m0, [r1 ] + movd m6, [r1+1] + add r1, r2 + punpcklbw m0, m7 + punpcklbw m6, m7 + pmullw m0, m4 + pmullw m6, m2 + paddw m6, m0 + +.next2rows + movd m0, [r1 ] + movd m1, [r1+1] + add r1, r2 + punpcklbw m0, m7 + punpcklbw m1, m7 + pmullw m0, m4 + pmullw m1, m2 + paddw m1, m0 + movq m0, m1 + + pmullw m6, m5 + pmullw m1, m3 + paddw m6, [rnd_2d_%2+rnd_bias*8] + paddw m1, m6 + psrlw m1, 6 + packuswb m1, m1 + CHROMAMC_AVG4 m1, m6, [r0] + movd [r0], m1 + add r0, r2 + + movd m6, [r1 ] + movd m1, [r1+1] + add r1, r2 + punpcklbw m6, m7 + punpcklbw m1, m7 + pmullw m6, m4 + pmullw m1, m2 + paddw m1, m6 + movq m6, m1 + pmullw m0, m5 + pmullw m1, m3 + paddw m0, [rnd_2d_%2+rnd_bias*8] + paddw m1, m0 + psrlw m1, 6 + packuswb m1, m1 + CHROMAMC_AVG4 m1, m0, [r0] + movd [r0], m1 + add r0, r2 + sub r3d, 2 + jnz .next2rows + REP_RET +%endmacro + +%macro chroma_mc2_mmx_func 3 +cglobal %1_%2_chroma_mc2_%3, 6, 7, 0 +%ifdef ARCH_X86_64 + movsxd r2, r2d +%endif + + mov r6d, r4d + shl r4d, 16 + sub r4d, r6d + add r4d, 8 + imul r5d, r4d ; x*y<<16 | y*(8-x) + shl r4d, 3 + sub r4d, r5d ; x*(8-y)<<16 | (8-x)*(8-y) + + movd m5, r4d + movd m6, r5d + punpckldq m5, m5 ; mm5 = {A,B,A,B} + punpckldq m6, m6 ; mm6 = {C,D,C,D} + pxor m7, m7 + movd m2, [r1] + punpcklbw m2, m7 + pshufw m2, m2, 0x94 ; mm0 = src[0,1,1,2] + +.nextrow + add r1, r2 + movq m1, m2 + pmaddwd m1, m5 ; mm1 = A * src[0,1] + B * src[1,2] + movd m0, [r1] + punpcklbw m0, m7 + pshufw m0, m0, 0x94 ; mm0 = src[0,1,1,2] + movq m2, m0 + pmaddwd m0, m6 + paddw m1, [rnd_2d_%2] + paddw m1, m0 ; mm1 += C * src[0,1] + D * src[1,2] + psrlw m1, 6 + packssdw m1, m7 + packuswb m1, m7 + CHROMAMC_AVG4 m1, m3, [r0] + movd r5d, m1 + mov [r0], r5w + add r0, r2 + sub r3d, 1 + jnz .nextrow + REP_RET +%endmacro + +%define rnd_1d_h264 pw_4 +%define rnd_2d_h264 pw_32 +%define rnd_1d_vc1 pw_3 +%define rnd_2d_vc1 pw_28 + +%macro NOTHING 2-3 +%endmacro +%macro DIRECT_AVG 2 + PAVG %1, %2 +%endmacro +%macro COPY_AVG 3 + movd %2, %3 + PAVG %1, %2 +%endmacro + +INIT_MMX +%define CHROMAMC_AVG NOTHING +%define CHROMAMC_AVG4 NOTHING +chroma_mc8_mmx_func put, h264, mmx_rnd +chroma_mc8_mmx_func put, vc1, mmx_nornd +chroma_mc8_mmx_func put, rv40, mmx +chroma_mc4_mmx_func put, h264, mmx +chroma_mc4_mmx_func put, rv40, mmx +chroma_mc2_mmx_func put, h264, mmx2 + +%define CHROMAMC_AVG DIRECT_AVG +%define CHROMAMC_AVG4 COPY_AVG +%define PAVG pavgb +chroma_mc8_mmx_func avg, h264, mmx2_rnd +chroma_mc8_mmx_func avg, vc1, mmx2_nornd +chroma_mc8_mmx_func avg, rv40, mmx2 +chroma_mc4_mmx_func avg, h264, mmx2 +chroma_mc4_mmx_func avg, rv40, mmx2 +chroma_mc2_mmx_func avg, h264, mmx2 + +%define PAVG pavgusb +chroma_mc8_mmx_func avg, h264, 3dnow_rnd +chroma_mc8_mmx_func avg, vc1, 3dnow_nornd +chroma_mc8_mmx_func avg, rv40, 3dnow +chroma_mc4_mmx_func avg, h264, 3dnow +chroma_mc4_mmx_func avg, rv40, 3dnow + +%macro chroma_mc8_ssse3_func 3 +cglobal %1_%2_chroma_mc8_%3, 6, 7, 8 +%ifdef ARCH_X86_64 + movsxd r2, r2d +%endif + mov r6d, r5d + or r6d, r4d + jne .at_least_one_non_zero + ; mx == 0 AND my == 0 - no filter needed + mv0_pixels_mc8 + REP_RET + +.at_least_one_non_zero + test r5d, r5d + je .my_is_zero + test r4d, r4d + je .mx_is_zero + + ; general case, bilinear + mov r6d, r4d + shl r4d, 8 + sub r4, r6 + add r4, 8 ; x*288+8 = x<<8 | (8-x) + mov r6, 8 + sub r6d, r5d + imul r6, r4 ; (8-y)*(x*255+8) = (8-y)*x<<8 | (8-y)*(8-x) + imul r4d, r5d ; y *(x*255+8) = y *x<<8 | y *(8-x) + + movd m7, r6d + movd m6, r4d + movdqa m5, [rnd_2d_%2] + pshuflw m7, m7, 0 + pshuflw m6, m6, 0 + movlhps m7, m7 + movlhps m6, m6 + + movq m0, [r1 ] + movq m1, [r1 +1] + punpcklbw m0, m1 + add r1, r2 +.next2rows + movq m1, [r1 ] + movq m2, [r1 +1] + movq m3, [r1+r2 ] + movq m4, [r1+r2+1] + lea r1, [r1+r2*2] + punpcklbw m1, m2 + punpcklbw m3, m4 + movdqa m2, m1 + movdqa m4, m3 + pmaddubsw m0, m7 + pmaddubsw m1, m6 + pmaddubsw m2, m7 + pmaddubsw m3, m6 + paddw m0, m5 + paddw m2, m5 + paddw m1, m0 + paddw m3, m2 + movdqa m0, m4 + psrlw m1, 6 + psrlw m3, 6 +%ifidn %1, avg + movq m2, [r0 ] + movhps m2, [r0+r2] +%endif + packuswb m1, m3 + CHROMAMC_AVG m1, m2 + movq [r0 ], m1 + movhps [r0+r2], m1 + sub r3d, 2 + lea r0, [r0+r2*2] + jg .next2rows + REP_RET + +.my_is_zero + mov r5d, r4d + shl r4d, 8 + add r4, 8 + sub r4, r5 ; 255*x+8 = x<<8 | (8-x) + movd m7, r4d + movdqa m6, [rnd_1d_%2] + pshuflw m7, m7, 0 + movlhps m7, m7 + +.next2xrows + movq m0, [r1 ] + movq m1, [r1 +1] + movq m2, [r1+r2 ] + movq m3, [r1+r2+1] + punpcklbw m0, m1 + punpcklbw m2, m3 + pmaddubsw m0, m7 + pmaddubsw m2, m7 +%ifidn %1, avg + movq m4, [r0 ] + movhps m4, [r0+r2] +%endif + paddw m0, m6 + paddw m2, m6 + psrlw m0, 3 + psrlw m2, 3 + packuswb m0, m2 + CHROMAMC_AVG m0, m4 + movq [r0 ], m0 + movhps [r0+r2], m0 + sub r3d, 2 + lea r0, [r0+r2*2] + lea r1, [r1+r2*2] + jg .next2xrows + REP_RET + +.mx_is_zero + mov r4d, r5d + shl r5d, 8 + add r5, 8 + sub r5, r4 ; 255*y+8 = y<<8 | (8-y) + movd m7, r5d + movdqa m6, [rnd_1d_%2] + pshuflw m7, m7, 0 + movlhps m7, m7 + +.next2yrows + movq m0, [r1 ] + movq m1, [r1+r2 ] + movdqa m2, m1 + movq m3, [r1+r2*2] + punpcklbw m0, m1 + punpcklbw m2, m3 + pmaddubsw m0, m7 + pmaddubsw m2, m7 +%ifidn %1, avg + movq m4, [r0 ] + movhps m4, [r0+r2] +%endif + paddw m0, m6 + paddw m2, m6 + psrlw m0, 3 + psrlw m2, 3 + packuswb m0, m2 + CHROMAMC_AVG m0, m4 + movq [r0 ], m0 + movhps [r0+r2], m0 + sub r3d, 2 + lea r0, [r0+r2*2] + lea r1, [r1+r2*2] + jg .next2yrows + REP_RET +%endmacro + +%macro chroma_mc4_ssse3_func 3 +cglobal %1_%2_chroma_mc4_%3, 6, 7, 0 +%ifdef ARCH_X86_64 + movsxd r2, r2d +%endif + mov r6, r4 + shl r4d, 8 + sub r4d, r6d + add r4d, 8 ; x*288+8 + mov r6, 8 + sub r6d, r5d + imul r6d, r4d ; (8-y)*(x*255+8) = (8-y)*x<<8 | (8-y)*(8-x) + imul r4d, r5d ; y *(x*255+8) = y *x<<8 | y *(8-x) + + movd m7, r6d + movd m6, r4d + movq m5, [pw_32] + pshufw m7, m7, 0 + pshufw m6, m6, 0 + + movd m0, [r1 ] + punpcklbw m0, [r1 +1] + add r1, r2 +.next2rows + movd m1, [r1 ] + movd m3, [r1+r2 ] + punpcklbw m1, [r1 +1] + punpcklbw m3, [r1+r2+1] + lea r1, [r1+r2*2] + movq m2, m1 + movq m4, m3 + pmaddubsw m0, m7 + pmaddubsw m1, m6 + pmaddubsw m2, m7 + pmaddubsw m3, m6 + paddw m0, m5 + paddw m2, m5 + paddw m1, m0 + paddw m3, m2 + movq m0, m4 + psrlw m1, 6 + psrlw m3, 6 + packuswb m1, m1 + packuswb m3, m3 + CHROMAMC_AVG m1, [r0 ] + CHROMAMC_AVG m3, [r0+r2] + movd [r0 ], m1 + movd [r0+r2], m3 + sub r3d, 2 + lea r0, [r0+r2*2] + jg .next2rows + REP_RET +%endmacro + +%define CHROMAMC_AVG NOTHING +INIT_XMM +chroma_mc8_ssse3_func put, h264, ssse3_rnd +chroma_mc8_ssse3_func put, vc1, ssse3_nornd +INIT_MMX +chroma_mc4_ssse3_func put, h264, ssse3 + +%define CHROMAMC_AVG DIRECT_AVG +%define PAVG pavgb +INIT_XMM +chroma_mc8_ssse3_func avg, h264, ssse3_rnd +chroma_mc8_ssse3_func avg, vc1, ssse3_nornd +INIT_MMX +chroma_mc4_ssse3_func avg, h264, ssse3 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_deblock.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_deblock.asm new file mode 100644 index 00000000..fb9cacfd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_deblock.asm @@ -0,0 +1,889 @@ +;***************************************************************************** +;* MMX/SSE2-optimized H.264 deblocking code +;***************************************************************************** +;* Copyright (C) 2005-2008 x264 project +;* +;* Authors: Loren Merritt +;* Jason Garrett-Glaser +;* +;* 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 +;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;****************************************************************************** + +%include "x86inc.asm" +%include "x86util.asm" + +SECTION_RODATA + +cextern pb_0 +cextern pb_1 +cextern pb_3 +cextern pb_A1 + +SECTION .text + +; expands to [base],...,[base+7*stride] +%define PASS8ROWS(base, base3, stride, stride3) \ + [base], [base+stride], [base+stride*2], [base3], \ + [base3+stride], [base3+stride*2], [base3+stride3], [base3+stride*4] + +; in: 8 rows of 4 bytes in %1..%8 +; out: 4 rows of 8 bytes in m0..m3 +%macro TRANSPOSE4x8_LOAD 8 + movd m0, %1 + movd m2, %2 + movd m1, %3 + movd m3, %4 + punpcklbw m0, m2 + punpcklbw m1, m3 + movq m2, m0 + punpcklwd m0, m1 + punpckhwd m2, m1 + + movd m4, %5 + movd m6, %6 + movd m5, %7 + movd m7, %8 + punpcklbw m4, m6 + punpcklbw m5, m7 + movq m6, m4 + punpcklwd m4, m5 + punpckhwd m6, m5 + + movq m1, m0 + movq m3, m2 + punpckldq m0, m4 + punpckhdq m1, m4 + punpckldq m2, m6 + punpckhdq m3, m6 +%endmacro + +; in: 4 rows of 8 bytes in m0..m3 +; out: 8 rows of 4 bytes in %1..%8 +%macro TRANSPOSE8x4_STORE 8 + movq m4, m0 + movq m5, m1 + movq m6, m2 + punpckhdq m4, m4 + punpckhdq m5, m5 + punpckhdq m6, m6 + + punpcklbw m0, m1 + punpcklbw m2, m3 + movq m1, m0 + punpcklwd m0, m2 + punpckhwd m1, m2 + movd %1, m0 + punpckhdq m0, m0 + movd %2, m0 + movd %3, m1 + punpckhdq m1, m1 + movd %4, m1 + + punpckhdq m3, m3 + punpcklbw m4, m5 + punpcklbw m6, m3 + movq m5, m4 + punpcklwd m4, m6 + punpckhwd m5, m6 + movd %5, m4 + punpckhdq m4, m4 + movd %6, m4 + movd %7, m5 + punpckhdq m5, m5 + movd %8, m5 +%endmacro + +%macro SBUTTERFLY3 4 + movq %4, %2 + punpckl%1 %2, %3 + punpckh%1 %4, %3 +%endmacro + +; in: 8 rows of 8 (only the middle 6 pels are used) in %1..%8 +; out: 6 rows of 8 in [%9+0*16] .. [%9+5*16] +%macro TRANSPOSE6x8_MEM 9 + movq m0, %1 + movq m1, %2 + movq m2, %3 + movq m3, %4 + movq m4, %5 + movq m5, %6 + movq m6, %7 + SBUTTERFLY3 bw, m0, m1, m7 + SBUTTERFLY3 bw, m2, m3, m1 + SBUTTERFLY3 bw, m4, m5, m3 + movq [%9+0x10], m1 + SBUTTERFLY3 bw, m6, %8, m5 + SBUTTERFLY3 wd, m0, m2, m1 + SBUTTERFLY3 wd, m4, m6, m2 + punpckhdq m0, m4 + movq [%9+0x00], m0 + SBUTTERFLY3 wd, m7, [%9+0x10], m6 + SBUTTERFLY3 wd, m3, m5, m4 + SBUTTERFLY3 dq, m7, m3, m0 + SBUTTERFLY3 dq, m1, m2, m5 + punpckldq m6, m4 + movq [%9+0x10], m1 + movq [%9+0x20], m5 + movq [%9+0x30], m7 + movq [%9+0x40], m0 + movq [%9+0x50], m6 +%endmacro + +; in: 8 rows of 8 in %1..%8 +; out: 8 rows of 8 in %9..%16 +%macro TRANSPOSE8x8_MEM 16 + movq m0, %1 + movq m1, %2 + movq m2, %3 + movq m3, %4 + movq m4, %5 + movq m5, %6 + movq m6, %7 + SBUTTERFLY3 bw, m0, m1, m7 + SBUTTERFLY3 bw, m2, m3, m1 + SBUTTERFLY3 bw, m4, m5, m3 + SBUTTERFLY3 bw, m6, %8, m5 + movq %9, m3 + SBUTTERFLY3 wd, m0, m2, m3 + SBUTTERFLY3 wd, m4, m6, m2 + SBUTTERFLY3 wd, m7, m1, m6 + movq %11, m2 + movq m2, %9 + SBUTTERFLY3 wd, m2, m5, m1 + SBUTTERFLY3 dq, m0, m4, m5 + SBUTTERFLY3 dq, m7, m2, m4 + movq %9, m0 + movq %10, m5 + movq %13, m7 + movq %14, m4 + SBUTTERFLY3 dq, m3, %11, m0 + SBUTTERFLY3 dq, m6, m1, m5 + movq %11, m3 + movq %12, m0 + movq %15, m6 + movq %16, m5 +%endmacro + +; out: %4 = |%1-%2|>%3 +; clobbers: %5 +%macro DIFF_GT 5 + mova %5, %2 + mova %4, %1 + psubusb %5, %1 + psubusb %4, %2 + por %4, %5 + psubusb %4, %3 +%endmacro + +; out: %4 = |%1-%2|>%3 +; clobbers: %5 +%macro DIFF_GT2 5 + mova %5, %2 + mova %4, %1 + psubusb %5, %1 + psubusb %4, %2 + psubusb %5, %3 + psubusb %4, %3 + pcmpeqb %4, %5 +%endmacro + +%macro SPLATW 1 +%ifidn m0, xmm0 + pshuflw %1, %1, 0 + punpcklqdq %1, %1 +%else + pshufw %1, %1, 0 +%endif +%endmacro + +; in: m0=p1 m1=p0 m2=q0 m3=q1 %1=alpha-1 %2=beta-1 +; out: m5=beta-1, m7=mask, %3=alpha-1 +; clobbers: m4,m6 +%macro LOAD_MASK 2-3 + movd m4, %1 + movd m5, %2 + SPLATW m4 + SPLATW m5 + packuswb m4, m4 ; 16x alpha-1 + packuswb m5, m5 ; 16x beta-1 +%if %0>2 + mova %3, m4 +%endif + DIFF_GT m1, m2, m4, m7, m6 ; |p0-q0| > alpha-1 + DIFF_GT m0, m1, m5, m4, m6 ; |p1-p0| > beta-1 + por m7, m4 + DIFF_GT m3, m2, m5, m4, m6 ; |q1-q0| > beta-1 + por m7, m4 + pxor m6, m6 + pcmpeqb m7, m6 +%endmacro + +; in: m0=p1 m1=p0 m2=q0 m3=q1 m7=(tc&mask) +; out: m1=p0' m2=q0' +; clobbers: m0,3-6 +%macro DEBLOCK_P0_Q0 0 + mova m5, m1 + pxor m5, m2 ; p0^q0 + pand m5, [pb_1] ; (p0^q0)&1 + pcmpeqb m4, m4 + pxor m3, m4 + pavgb m3, m0 ; (p1 - q1 + 256)>>1 + pavgb m3, [pb_3] ; (((p1 - q1 + 256)>>1)+4)>>1 = 64+2+(p1-q1)>>2 + pxor m4, m1 + pavgb m4, m2 ; (q0 - p0 + 256)>>1 + pavgb m3, m5 + paddusb m3, m4 ; d+128+33 + mova m6, [pb_A1] + psubusb m6, m3 + psubusb m3, [pb_A1] + pminub m6, m7 + pminub m3, m7 + psubusb m1, m6 + psubusb m2, m3 + paddusb m1, m3 + paddusb m2, m6 +%endmacro + +; in: m1=p0 m2=q0 +; %1=p1 %2=q2 %3=[q2] %4=[q1] %5=tc0 %6=tmp +; out: [q1] = clip( (q2+((p0+q0+1)>>1))>>1, q1-tc0, q1+tc0 ) +; clobbers: q2, tmp, tc0 +%macro LUMA_Q1 6 + mova %6, m1 + pavgb %6, m2 + pavgb %2, %6 ; avg(p2,avg(p0,q0)) + pxor %6, %3 + pand %6, [pb_1] ; (p2^avg(p0,q0))&1 + psubusb %2, %6 ; (p2+((p0+q0+1)>>1))>>1 + mova %6, %1 + psubusb %6, %5 + paddusb %5, %1 + pmaxub %2, %6 + pminub %2, %5 + mova %4, %2 +%endmacro + +%ifdef ARCH_X86_64 +;----------------------------------------------------------------------------- +; void x264_deblock_v_luma_sse2( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) +;----------------------------------------------------------------------------- +INIT_XMM +cglobal x264_deblock_v_luma_sse2, 5,5,10 + movd m8, [r4] ; tc0 + lea r4, [r1*3] + dec r2d ; alpha-1 + neg r4 + dec r3d ; beta-1 + add r4, r0 ; pix-3*stride + + mova m0, [r4+r1] ; p1 + mova m1, [r4+2*r1] ; p0 + mova m2, [r0] ; q0 + mova m3, [r0+r1] ; q1 + LOAD_MASK r2d, r3d + + punpcklbw m8, m8 + punpcklbw m8, m8 ; tc = 4x tc0[3], 4x tc0[2], 4x tc0[1], 4x tc0[0] + pcmpeqb m9, m9 + pcmpeqb m9, m8 + pandn m9, m7 + pand m8, m9 + + movdqa m3, [r4] ; p2 + DIFF_GT2 m1, m3, m5, m6, m7 ; |p2-p0| > beta-1 + pand m6, m9 + mova m7, m8 + psubb m7, m6 + pand m6, m8 + LUMA_Q1 m0, m3, [r4], [r4+r1], m6, m4 + + movdqa m4, [r0+2*r1] ; q2 + DIFF_GT2 m2, m4, m5, m6, m3 ; |q2-q0| > beta-1 + pand m6, m9 + pand m8, m6 + psubb m7, m6 + mova m3, [r0+r1] + LUMA_Q1 m3, m4, [r0+2*r1], [r0+r1], m8, m6 + + DEBLOCK_P0_Q0 + mova [r4+2*r1], m1 + mova [r0], m2 + RET + +;----------------------------------------------------------------------------- +; void x264_deblock_h_luma_sse2( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) +;----------------------------------------------------------------------------- +INIT_MMX +cglobal x264_deblock_h_luma_sse2, 5,7 + movsxd r10, r1d + lea r11, [r10+r10*2] + lea r6, [r0-4] + lea r5, [r0-4+r11] +%ifdef WIN64 + sub rsp, 0x98 + %define pix_tmp rsp+0x30 +%else + sub rsp, 0x68 + %define pix_tmp rsp +%endif + + ; transpose 6x16 -> tmp space + TRANSPOSE6x8_MEM PASS8ROWS(r6, r5, r10, r11), pix_tmp + lea r6, [r6+r10*8] + lea r5, [r5+r10*8] + TRANSPOSE6x8_MEM PASS8ROWS(r6, r5, r10, r11), pix_tmp+8 + + ; vertical filter + ; alpha, beta, tc0 are still in r2d, r3d, r4 + ; don't backup r6, r5, r10, r11 because x264_deblock_v_luma_sse2 doesn't use them + lea r0, [pix_tmp+0x30] + mov r1d, 0x10 +%ifdef WIN64 + mov [rsp+0x20], r4 +%endif + call x264_deblock_v_luma_sse2 + + ; transpose 16x4 -> original space (only the middle 4 rows were changed by the filter) + add r6, 2 + add r5, 2 + movq m0, [pix_tmp+0x18] + movq m1, [pix_tmp+0x28] + movq m2, [pix_tmp+0x38] + movq m3, [pix_tmp+0x48] + TRANSPOSE8x4_STORE PASS8ROWS(r6, r5, r10, r11) + + shl r10, 3 + sub r6, r10 + sub r5, r10 + shr r10, 3 + movq m0, [pix_tmp+0x10] + movq m1, [pix_tmp+0x20] + movq m2, [pix_tmp+0x30] + movq m3, [pix_tmp+0x40] + TRANSPOSE8x4_STORE PASS8ROWS(r6, r5, r10, r11) + +%ifdef WIN64 + add rsp, 0x98 +%else + add rsp, 0x68 +%endif + RET + +%else + +%macro DEBLOCK_LUMA 3 +;----------------------------------------------------------------------------- +; void x264_deblock_v8_luma_mmxext( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) +;----------------------------------------------------------------------------- +cglobal x264_deblock_%2_luma_%1, 5,5 + lea r4, [r1*3] + dec r2 ; alpha-1 + neg r4 + dec r3 ; beta-1 + add r4, r0 ; pix-3*stride + %assign pad 2*%3+12-(stack_offset&15) + SUB esp, pad + + mova m0, [r4+r1] ; p1 + mova m1, [r4+2*r1] ; p0 + mova m2, [r0] ; q0 + mova m3, [r0+r1] ; q1 + LOAD_MASK r2, r3 + + mov r3, r4mp + movd m4, [r3] ; tc0 + punpcklbw m4, m4 + punpcklbw m4, m4 ; tc = 4x tc0[3], 4x tc0[2], 4x tc0[1], 4x tc0[0] + mova [esp+%3], m4 ; tc + pcmpeqb m3, m3 + pcmpgtb m4, m3 + pand m4, m7 + mova [esp], m4 ; mask + + mova m3, [r4] ; p2 + DIFF_GT2 m1, m3, m5, m6, m7 ; |p2-p0| > beta-1 + pand m6, m4 + pand m4, [esp+%3] ; tc + mova m7, m4 + psubb m7, m6 + pand m6, m4 + LUMA_Q1 m0, m3, [r4], [r4+r1], m6, m4 + + mova m4, [r0+2*r1] ; q2 + DIFF_GT2 m2, m4, m5, m6, m3 ; |q2-q0| > beta-1 + mova m5, [esp] ; mask + pand m6, m5 + mova m5, [esp+%3] ; tc + pand m5, m6 + psubb m7, m6 + mova m3, [r0+r1] + LUMA_Q1 m3, m4, [r0+2*r1], [r0+r1], m5, m6 + + DEBLOCK_P0_Q0 + mova [r4+2*r1], m1 + mova [r0], m2 + ADD esp, pad + RET + +;----------------------------------------------------------------------------- +; void x264_deblock_h_luma_mmxext( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) +;----------------------------------------------------------------------------- +INIT_MMX +cglobal x264_deblock_h_luma_%1, 0,5 + mov r0, r0mp + mov r3, r1m + lea r4, [r3*3] + sub r0, 4 + lea r1, [r0+r4] + %assign pad 0x78-(stack_offset&15) + SUB esp, pad +%define pix_tmp esp+12 + + ; transpose 6x16 -> tmp space + TRANSPOSE6x8_MEM PASS8ROWS(r0, r1, r3, r4), pix_tmp + lea r0, [r0+r3*8] + lea r1, [r1+r3*8] + TRANSPOSE6x8_MEM PASS8ROWS(r0, r1, r3, r4), pix_tmp+8 + + ; vertical filter + lea r0, [pix_tmp+0x30] + PUSH dword r4m + PUSH dword r3m + PUSH dword r2m + PUSH dword 16 + PUSH dword r0 + call x264_deblock_%2_luma_%1 +%ifidn %2, v8 + add dword [esp ], 8 ; pix_tmp+0x38 + add dword [esp+16], 2 ; tc0+2 + call x264_deblock_%2_luma_%1 +%endif + ADD esp, 20 + + ; transpose 16x4 -> original space (only the middle 4 rows were changed by the filter) + mov r0, r0mp + sub r0, 2 + lea r1, [r0+r4] + + movq m0, [pix_tmp+0x10] + movq m1, [pix_tmp+0x20] + movq m2, [pix_tmp+0x30] + movq m3, [pix_tmp+0x40] + TRANSPOSE8x4_STORE PASS8ROWS(r0, r1, r3, r4) + + lea r0, [r0+r3*8] + lea r1, [r1+r3*8] + movq m0, [pix_tmp+0x18] + movq m1, [pix_tmp+0x28] + movq m2, [pix_tmp+0x38] + movq m3, [pix_tmp+0x48] + TRANSPOSE8x4_STORE PASS8ROWS(r0, r1, r3, r4) + + ADD esp, pad + RET +%endmacro ; DEBLOCK_LUMA + +INIT_MMX +DEBLOCK_LUMA mmxext, v8, 8 +INIT_XMM +DEBLOCK_LUMA sse2, v, 16 + +%endif ; ARCH + + + +%macro LUMA_INTRA_P012 4 ; p0..p3 in memory + mova t0, p2 + mova t1, p0 + pavgb t0, p1 + pavgb t1, q0 + pavgb t0, t1 ; ((p2+p1+1)/2 + (p0+q0+1)/2 + 1)/2 + mova t5, t1 + mova t2, p2 + mova t3, p0 + paddb t2, p1 + paddb t3, q0 + paddb t2, t3 + mova t3, t2 + mova t4, t2 + psrlw t2, 1 + pavgb t2, mpb_0 + pxor t2, t0 + pand t2, mpb_1 + psubb t0, t2 ; p1' = (p2+p1+p0+q0+2)/4; + + mova t1, p2 + mova t2, p2 + pavgb t1, q1 + psubb t2, q1 + paddb t3, t3 + psubb t3, t2 ; p2+2*p1+2*p0+2*q0+q1 + pand t2, mpb_1 + psubb t1, t2 + pavgb t1, p1 + pavgb t1, t5 ; (((p2+q1)/2 + p1+1)/2 + (p0+q0+1)/2 + 1)/2 + psrlw t3, 2 + pavgb t3, mpb_0 + pxor t3, t1 + pand t3, mpb_1 + psubb t1, t3 ; p0'a = (p2+2*p1+2*p0+2*q0+q1+4)/8 + + mova t3, p0 + mova t2, p0 + pxor t3, q1 + pavgb t2, q1 + pand t3, mpb_1 + psubb t2, t3 + pavgb t2, p1 ; p0'b = (2*p1+p0+q0+2)/4 + + pxor t1, t2 + pxor t2, p0 + pand t1, mask1p + pand t2, mask0 + pxor t1, t2 + pxor t1, p0 + mova %1, t1 ; store p0 + + mova t1, %4 ; p3 + mova t2, t1 + pavgb t1, p2 + paddb t2, p2 + pavgb t1, t0 ; (p3+p2+1)/2 + (p2+p1+p0+q0+2)/4 + paddb t2, t2 + paddb t2, t4 ; 2*p3+3*p2+p1+p0+q0 + psrlw t2, 2 + pavgb t2, mpb_0 + pxor t2, t1 + pand t2, mpb_1 + psubb t1, t2 ; p2' = (2*p3+3*p2+p1+p0+q0+4)/8 + + pxor t0, p1 + pxor t1, p2 + pand t0, mask1p + pand t1, mask1p + pxor t0, p1 + pxor t1, p2 + mova %2, t0 ; store p1 + mova %3, t1 ; store p2 +%endmacro + +%macro LUMA_INTRA_SWAP_PQ 0 + %define q1 m0 + %define q0 m1 + %define p0 m2 + %define p1 m3 + %define p2 q2 + %define mask1p mask1q +%endmacro + +%macro DEBLOCK_LUMA_INTRA 2 + %define p1 m0 + %define p0 m1 + %define q0 m2 + %define q1 m3 + %define t0 m4 + %define t1 m5 + %define t2 m6 + %define t3 m7 +%ifdef ARCH_X86_64 + %define p2 m8 + %define q2 m9 + %define t4 m10 + %define t5 m11 + %define mask0 m12 + %define mask1p m13 + %define mask1q [rsp-24] + %define mpb_0 m14 + %define mpb_1 m15 +%else + %define spill(x) [esp+16*x+((stack_offset+4)&15)] + %define p2 [r4+r1] + %define q2 [r0+2*r1] + %define t4 spill(0) + %define t5 spill(1) + %define mask0 spill(2) + %define mask1p spill(3) + %define mask1q spill(4) + %define mpb_0 [pb_0] + %define mpb_1 [pb_1] +%endif + +;----------------------------------------------------------------------------- +; void x264_deblock_v_luma_intra_sse2( uint8_t *pix, int stride, int alpha, int beta ) +;----------------------------------------------------------------------------- +cglobal x264_deblock_%2_luma_intra_%1, 4,6,16 +%ifndef ARCH_X86_64 + sub esp, 0x60 +%endif + lea r4, [r1*4] + lea r5, [r1*3] ; 3*stride + dec r2d ; alpha-1 + jl .end + neg r4 + dec r3d ; beta-1 + jl .end + add r4, r0 ; pix-4*stride + mova p1, [r4+2*r1] + mova p0, [r4+r5] + mova q0, [r0] + mova q1, [r0+r1] +%ifdef ARCH_X86_64 + pxor mpb_0, mpb_0 + mova mpb_1, [pb_1] + LOAD_MASK r2d, r3d, t5 ; m5=beta-1, t5=alpha-1, m7=mask0 + SWAP 7, 12 ; m12=mask0 + pavgb t5, mpb_0 + pavgb t5, mpb_1 ; alpha/4+1 + movdqa p2, [r4+r1] + movdqa q2, [r0+2*r1] + DIFF_GT2 p0, q0, t5, t0, t3 ; t0 = |p0-q0| > alpha/4+1 + DIFF_GT2 p0, p2, m5, t2, t5 ; mask1 = |p2-p0| > beta-1 + DIFF_GT2 q0, q2, m5, t4, t5 ; t4 = |q2-q0| > beta-1 + pand t0, mask0 + pand t4, t0 + pand t2, t0 + mova mask1q, t4 + mova mask1p, t2 +%else + LOAD_MASK r2d, r3d, t5 ; m5=beta-1, t5=alpha-1, m7=mask0 + mova m4, t5 + mova mask0, m7 + pavgb m4, [pb_0] + pavgb m4, [pb_1] ; alpha/4+1 + DIFF_GT2 p0, q0, m4, m6, m7 ; m6 = |p0-q0| > alpha/4+1 + pand m6, mask0 + DIFF_GT2 p0, p2, m5, m4, m7 ; m4 = |p2-p0| > beta-1 + pand m4, m6 + mova mask1p, m4 + DIFF_GT2 q0, q2, m5, m4, m7 ; m4 = |q2-q0| > beta-1 + pand m4, m6 + mova mask1q, m4 +%endif + LUMA_INTRA_P012 [r4+r5], [r4+2*r1], [r4+r1], [r4] + LUMA_INTRA_SWAP_PQ + LUMA_INTRA_P012 [r0], [r0+r1], [r0+2*r1], [r0+r5] +.end: +%ifndef ARCH_X86_64 + add esp, 0x60 +%endif + RET + +INIT_MMX +%ifdef ARCH_X86_64 +;----------------------------------------------------------------------------- +; void x264_deblock_h_luma_intra_sse2( uint8_t *pix, int stride, int alpha, int beta ) +;----------------------------------------------------------------------------- +cglobal x264_deblock_h_luma_intra_%1, 4,7 + movsxd r10, r1d + lea r11, [r10*3] + lea r6, [r0-4] + lea r5, [r0-4+r11] + sub rsp, 0x88 + %define pix_tmp rsp + + ; transpose 8x16 -> tmp space + TRANSPOSE8x8_MEM PASS8ROWS(r6, r5, r10, r11), PASS8ROWS(pix_tmp, pix_tmp+0x30, 0x10, 0x30) + lea r6, [r6+r10*8] + lea r5, [r5+r10*8] + TRANSPOSE8x8_MEM PASS8ROWS(r6, r5, r10, r11), PASS8ROWS(pix_tmp+8, pix_tmp+0x38, 0x10, 0x30) + + lea r0, [pix_tmp+0x40] + mov r1, 0x10 + call x264_deblock_v_luma_intra_%1 + + ; transpose 16x6 -> original space (but we can't write only 6 pixels, so really 16x8) + lea r5, [r6+r11] + TRANSPOSE8x8_MEM PASS8ROWS(pix_tmp+8, pix_tmp+0x38, 0x10, 0x30), PASS8ROWS(r6, r5, r10, r11) + shl r10, 3 + sub r6, r10 + sub r5, r10 + shr r10, 3 + TRANSPOSE8x8_MEM PASS8ROWS(pix_tmp, pix_tmp+0x30, 0x10, 0x30), PASS8ROWS(r6, r5, r10, r11) + add rsp, 0x88 + RET +%else +cglobal x264_deblock_h_luma_intra_%1, 2,4 + lea r3, [r1*3] + sub r0, 4 + lea r2, [r0+r3] +%assign pad 0x8c-(stack_offset&15) + SUB rsp, pad + %define pix_tmp rsp + + ; transpose 8x16 -> tmp space + TRANSPOSE8x8_MEM PASS8ROWS(r0, r2, r1, r3), PASS8ROWS(pix_tmp, pix_tmp+0x30, 0x10, 0x30) + lea r0, [r0+r1*8] + lea r2, [r2+r1*8] + TRANSPOSE8x8_MEM PASS8ROWS(r0, r2, r1, r3), PASS8ROWS(pix_tmp+8, pix_tmp+0x38, 0x10, 0x30) + + lea r0, [pix_tmp+0x40] + PUSH dword r3m + PUSH dword r2m + PUSH dword 16 + PUSH r0 + call x264_deblock_%2_luma_intra_%1 +%ifidn %2, v8 + add dword [rsp], 8 ; pix_tmp+8 + call x264_deblock_%2_luma_intra_%1 +%endif + ADD esp, 16 + + mov r1, r1m + mov r0, r0mp + lea r3, [r1*3] + sub r0, 4 + lea r2, [r0+r3] + ; transpose 16x6 -> original space (but we can't write only 6 pixels, so really 16x8) + TRANSPOSE8x8_MEM PASS8ROWS(pix_tmp, pix_tmp+0x30, 0x10, 0x30), PASS8ROWS(r0, r2, r1, r3) + lea r0, [r0+r1*8] + lea r2, [r2+r1*8] + TRANSPOSE8x8_MEM PASS8ROWS(pix_tmp+8, pix_tmp+0x38, 0x10, 0x30), PASS8ROWS(r0, r2, r1, r3) + ADD rsp, pad + RET +%endif ; ARCH_X86_64 +%endmacro ; DEBLOCK_LUMA_INTRA + +INIT_XMM +DEBLOCK_LUMA_INTRA sse2, v +%ifndef ARCH_X86_64 +INIT_MMX +DEBLOCK_LUMA_INTRA mmxext, v8 +%endif + + + +INIT_MMX + +%macro CHROMA_V_START 0 + dec r2d ; alpha-1 + dec r3d ; beta-1 + mov t5, r0 + sub t5, r1 + sub t5, r1 +%endmacro + +%macro CHROMA_H_START 0 + dec r2d + dec r3d + sub r0, 2 + lea t6, [r1*3] + mov t5, r0 + add r0, t6 +%endmacro + +%define t5 r5 +%define t6 r6 + +;----------------------------------------------------------------------------- +; void x264_deblock_v_chroma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) +;----------------------------------------------------------------------------- +cglobal x264_deblock_v_chroma_mmxext, 5,6 + CHROMA_V_START + movq m0, [t5] + movq m1, [t5+r1] + movq m2, [r0] + movq m3, [r0+r1] + call x264_chroma_inter_body_mmxext + movq [t5+r1], m1 + movq [r0], m2 + RET + +;----------------------------------------------------------------------------- +; void x264_deblock_h_chroma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) +;----------------------------------------------------------------------------- +cglobal x264_deblock_h_chroma_mmxext, 5,7 +%ifdef ARCH_X86_64 + %define buf0 [rsp-24] + %define buf1 [rsp-16] +%else + %define buf0 r0m + %define buf1 r2m +%endif + CHROMA_H_START + TRANSPOSE4x8_LOAD PASS8ROWS(t5, r0, r1, t6) + movq buf0, m0 + movq buf1, m3 + call x264_chroma_inter_body_mmxext + movq m0, buf0 + movq m3, buf1 + TRANSPOSE8x4_STORE PASS8ROWS(t5, r0, r1, t6) + RET + +ALIGN 16 +x264_chroma_inter_body_mmxext: + LOAD_MASK r2d, r3d + movd m6, [r4] ; tc0 + punpcklbw m6, m6 + pand m7, m6 + DEBLOCK_P0_Q0 + ret + + + +; in: %1=p0 %2=p1 %3=q1 +; out: p0 = (p0 + q1 + 2*p1 + 2) >> 2 +%macro CHROMA_INTRA_P0 3 + movq m4, %1 + pxor m4, %3 + pand m4, [pb_1] ; m4 = (p0^q1)&1 + pavgb %1, %3 + psubusb %1, m4 + pavgb %1, %2 ; dst = avg(p1, avg(p0,q1) - ((p0^q1)&1)) +%endmacro + +%define t5 r4 +%define t6 r5 + +;----------------------------------------------------------------------------- +; void x264_deblock_v_chroma_intra( uint8_t *pix, int stride, int alpha, int beta ) +;----------------------------------------------------------------------------- +cglobal x264_deblock_v_chroma_intra_mmxext, 4,5 + CHROMA_V_START + movq m0, [t5] + movq m1, [t5+r1] + movq m2, [r0] + movq m3, [r0+r1] + call x264_chroma_intra_body_mmxext + movq [t5+r1], m1 + movq [r0], m2 + RET + +;----------------------------------------------------------------------------- +; void x264_deblock_h_chroma_intra( uint8_t *pix, int stride, int alpha, int beta ) +;----------------------------------------------------------------------------- +cglobal x264_deblock_h_chroma_intra_mmxext, 4,6 + CHROMA_H_START + TRANSPOSE4x8_LOAD PASS8ROWS(t5, r0, r1, t6) + call x264_chroma_intra_body_mmxext + TRANSPOSE8x4_STORE PASS8ROWS(t5, r0, r1, t6) + RET + +ALIGN 16 +x264_chroma_intra_body_mmxext: + LOAD_MASK r2d, r3d + movq m5, m1 + movq m6, m2 + CHROMA_INTRA_P0 m1, m0, m3 + CHROMA_INTRA_P0 m2, m3, m0 + psubb m1, m5 + psubb m2, m6 + pand m1, m7 + pand m2, m7 + paddb m1, m5 + paddb m2, m6 + ret diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_idct.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_idct.asm new file mode 100644 index 00000000..fdb35003 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_idct.asm @@ -0,0 +1,1010 @@ +;***************************************************************************** +;* MMX/SSE2-optimized H.264 iDCT +;***************************************************************************** +;* Copyright (C) 2004-2005 Michael Niedermayer, Loren Merritt +;* Copyright (C) 2003-2008 x264 project +;* +;* Authors: Laurent Aimar +;* Loren Merritt +;* Holger Lubitz +;* Min Chen +;* +;* 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 +;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;***************************************************************************** + +%include "x86inc.asm" +%include "x86util.asm" + +SECTION_RODATA + +; FIXME this table is a duplicate from h264data.h, and will be removed once the tables from, h264 have been split +scan8_mem: db 4+1*8, 5+1*8, 4+2*8, 5+2*8 + db 6+1*8, 7+1*8, 6+2*8, 7+2*8 + db 4+3*8, 5+3*8, 4+4*8, 5+4*8 + db 6+3*8, 7+3*8, 6+4*8, 7+4*8 + db 1+1*8, 2+1*8 + db 1+2*8, 2+2*8 + db 1+4*8, 2+4*8 + db 1+5*8, 2+5*8 +%ifdef PIC +%define scan8 r11 +%else +%define scan8 scan8_mem +%endif + +cextern pw_32 +cextern pw_1 + +SECTION .text + +; %1=uint8_t *dst, %2=int16_t *block, %3=int stride +%macro IDCT4_ADD 3 + ; Load dct coeffs + movq m0, [%2] + movq m1, [%2+8] + movq m2, [%2+16] + movq m3, [%2+24] + + IDCT4_1D 0, 1, 2, 3, 4, 5 + mova m6, [pw_32] + TRANSPOSE4x4W 0, 1, 2, 3, 4 + paddw m0, m6 + IDCT4_1D 0, 1, 2, 3, 4, 5 + pxor m7, m7 + + STORE_DIFFx2 m0, m1, m4, m5, m7, 6, %1, %3 + lea %1, [%1+%3*2] + STORE_DIFFx2 m2, m3, m4, m5, m7, 6, %1, %3 +%endmacro + +INIT_MMX +; ff_h264_idct_add_mmx(uint8_t *dst, int16_t *block, int stride) +cglobal h264_idct_add_mmx, 3, 3, 0 + IDCT4_ADD r0, r1, r2 + RET + +%macro IDCT8_1D 2 + mova m4, m5 + mova m0, m1 + psraw m4, 1 + psraw m1, 1 + paddw m4, m5 + paddw m1, m0 + paddw m4, m7 + paddw m1, m5 + psubw m4, m0 + paddw m1, m3 + + psubw m0, m3 + psubw m5, m3 + paddw m0, m7 + psubw m5, m7 + psraw m3, 1 + psraw m7, 1 + psubw m0, m3 + psubw m5, m7 + + mova m3, m4 + mova m7, m1 + psraw m1, 2 + psraw m3, 2 + paddw m3, m0 + psraw m0, 2 + paddw m1, m5 + psraw m5, 2 + psubw m0, m4 + psubw m7, m5 + + mova m4, m2 + mova m5, m6 + psraw m4, 1 + psraw m6, 1 + psubw m4, m5 + paddw m6, m2 + + mova m2, %1 + mova m5, %2 + SUMSUB_BA m5, m2 + SUMSUB_BA m6, m5 + SUMSUB_BA m4, m2 + SUMSUB_BA m7, m6 + SUMSUB_BA m0, m4 + SUMSUB_BA m3, m2 + SUMSUB_BA m1, m5 + SWAP 7, 6, 4, 5, 2, 3, 1, 0 ; 70315246 -> 01234567 +%endmacro + +%macro IDCT8_1D_FULL 1 + mova m7, [%1+112] + mova m6, [%1+ 96] + mova m5, [%1+ 80] + mova m3, [%1+ 48] + mova m2, [%1+ 32] + mova m1, [%1+ 16] + IDCT8_1D [%1], [%1+ 64] +%endmacro + +; %1=int16_t *block, %2=int16_t *dstblock +%macro IDCT8_ADD_MMX_START 2 + IDCT8_1D_FULL %1 + mova [%1], m7 + TRANSPOSE4x4W 0, 1, 2, 3, 7 + mova m7, [%1] + mova [%2 ], m0 + mova [%2+16], m1 + mova [%2+32], m2 + mova [%2+48], m3 + TRANSPOSE4x4W 4, 5, 6, 7, 3 + mova [%2+ 8], m4 + mova [%2+24], m5 + mova [%2+40], m6 + mova [%2+56], m7 +%endmacro + +; %1=uint8_t *dst, %2=int16_t *block, %3=int stride +%macro IDCT8_ADD_MMX_END 3 + IDCT8_1D_FULL %2 + mova [%2 ], m5 + mova [%2+16], m6 + mova [%2+32], m7 + + pxor m7, m7 + STORE_DIFFx2 m0, m1, m5, m6, m7, 6, %1, %3 + lea %1, [%1+%3*2] + STORE_DIFFx2 m2, m3, m5, m6, m7, 6, %1, %3 + mova m0, [%2 ] + mova m1, [%2+16] + mova m2, [%2+32] + lea %1, [%1+%3*2] + STORE_DIFFx2 m4, m0, m5, m6, m7, 6, %1, %3 + lea %1, [%1+%3*2] + STORE_DIFFx2 m1, m2, m5, m6, m7, 6, %1, %3 +%endmacro + +INIT_MMX +; ff_h264_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride) +cglobal h264_idct8_add_mmx, 3, 4, 0 + %assign pad 128+4-(stack_offset&7) + SUB rsp, pad + + add word [r1], 32 + IDCT8_ADD_MMX_START r1 , rsp + IDCT8_ADD_MMX_START r1+8, rsp+64 + lea r3, [r0+4] + IDCT8_ADD_MMX_END r0 , rsp, r2 + IDCT8_ADD_MMX_END r3 , rsp+8, r2 + + ADD rsp, pad + RET + +; %1=uint8_t *dst, %2=int16_t *block, %3=int stride +%macro IDCT8_ADD_SSE 4 + IDCT8_1D_FULL %2 +%ifdef ARCH_X86_64 + TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, 8 +%else + TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, [%2], [%2+16] +%endif + paddw m0, [pw_32] + +%ifndef ARCH_X86_64 + mova [%2 ], m0 + mova [%2+16], m4 + IDCT8_1D [%2], [%2+ 16] + mova [%2 ], m6 + mova [%2+16], m7 +%else + SWAP 0, 8 + SWAP 4, 9 + IDCT8_1D m8, m9 + SWAP 6, 8 + SWAP 7, 9 +%endif + + pxor m7, m7 + lea %4, [%3*3] + STORE_DIFF m0, m6, m7, [%1 ] + STORE_DIFF m1, m6, m7, [%1+%3 ] + STORE_DIFF m2, m6, m7, [%1+%3*2] + STORE_DIFF m3, m6, m7, [%1+%4 ] +%ifndef ARCH_X86_64 + mova m0, [%2 ] + mova m1, [%2+16] +%else + SWAP 0, 8 + SWAP 1, 9 +%endif + lea %1, [%1+%3*4] + STORE_DIFF m4, m6, m7, [%1 ] + STORE_DIFF m5, m6, m7, [%1+%3 ] + STORE_DIFF m0, m6, m7, [%1+%3*2] + STORE_DIFF m1, m6, m7, [%1+%4 ] +%endmacro + +INIT_XMM +; ff_h264_idct8_add_sse2(uint8_t *dst, int16_t *block, int stride) +cglobal h264_idct8_add_sse2, 3, 4, 10 + IDCT8_ADD_SSE r0, r1, r2, r3 + RET + +%macro DC_ADD_MMX2_INIT 2-3 +%if %0 == 2 + movsx %1, word [%1] + add %1, 32 + sar %1, 6 + movd m0, %1d + lea %1, [%2*3] +%else + add %3, 32 + sar %3, 6 + movd m0, %3d + lea %3, [%2*3] +%endif + pshufw m0, m0, 0 + pxor m1, m1 + psubw m1, m0 + packuswb m0, m0 + packuswb m1, m1 +%endmacro + +%macro DC_ADD_MMX2_OP 3-4 + %1 m2, [%2 ] + %1 m3, [%2+%3 ] + %1 m4, [%2+%3*2] + %1 m5, [%2+%4 ] + paddusb m2, m0 + paddusb m3, m0 + paddusb m4, m0 + paddusb m5, m0 + psubusb m2, m1 + psubusb m3, m1 + psubusb m4, m1 + psubusb m5, m1 + %1 [%2 ], m2 + %1 [%2+%3 ], m3 + %1 [%2+%3*2], m4 + %1 [%2+%4 ], m5 +%endmacro + +INIT_MMX +; ff_h264_idct_dc_add_mmx2(uint8_t *dst, int16_t *block, int stride) +cglobal h264_idct_dc_add_mmx2, 3, 3, 0 + DC_ADD_MMX2_INIT r1, r2 + DC_ADD_MMX2_OP movh, r0, r2, r1 + RET + +; ff_h264_idct8_dc_add_mmx2(uint8_t *dst, int16_t *block, int stride) +cglobal h264_idct8_dc_add_mmx2, 3, 3, 0 + DC_ADD_MMX2_INIT r1, r2 + DC_ADD_MMX2_OP mova, r0, r2, r1 + lea r0, [r0+r2*4] + DC_ADD_MMX2_OP mova, r0, r2, r1 + RET + +; ff_h264_idct_add16_mmx(uint8_t *dst, const int *block_offset, +; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +cglobal h264_idct_add16_mmx, 5, 7, 0 + xor r5, r5 +%ifdef PIC + lea r11, [scan8_mem] +%endif +.nextblock + movzx r6, byte [scan8+r5] + movzx r6, byte [r4+r6] + test r6, r6 + jz .skipblock + mov r6d, dword [r1+r5*4] + lea r6, [r0+r6] + IDCT4_ADD r6, r2, r3 +.skipblock + inc r5 + add r2, 32 + cmp r5, 16 + jl .nextblock + REP_RET + +; ff_h264_idct8_add4_mmx(uint8_t *dst, const int *block_offset, +; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +cglobal h264_idct8_add4_mmx, 5, 7, 0 + %assign pad 128+4-(stack_offset&7) + SUB rsp, pad + + xor r5, r5 +%ifdef PIC + lea r11, [scan8_mem] +%endif +.nextblock + movzx r6, byte [scan8+r5] + movzx r6, byte [r4+r6] + test r6, r6 + jz .skipblock + mov r6d, dword [r1+r5*4] + lea r6, [r0+r6] + add word [r2], 32 + IDCT8_ADD_MMX_START r2 , rsp + IDCT8_ADD_MMX_START r2+8, rsp+64 + IDCT8_ADD_MMX_END r6 , rsp, r3 + mov r6d, dword [r1+r5*4] + lea r6, [r0+r6+4] + IDCT8_ADD_MMX_END r6 , rsp+8, r3 +.skipblock + add r5, 4 + add r2, 128 + cmp r5, 16 + jl .nextblock + ADD rsp, pad + RET + +; ff_h264_idct_add16_mmx2(uint8_t *dst, const int *block_offset, +; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +cglobal h264_idct_add16_mmx2, 5, 7, 0 + xor r5, r5 +%ifdef PIC + lea r11, [scan8_mem] +%endif +.nextblock + movzx r6, byte [scan8+r5] + movzx r6, byte [r4+r6] + test r6, r6 + jz .skipblock + cmp r6, 1 + jnz .no_dc + movsx r6, word [r2] + test r6, r6 + jz .no_dc + DC_ADD_MMX2_INIT r2, r3, r6 +%ifdef ARCH_X86_64 +%define dst_reg r10 +%define dst_regd r10d +%else +%define dst_reg r1 +%define dst_regd r1d +%endif + mov dst_regd, dword [r1+r5*4] + lea dst_reg, [r0+dst_reg] + DC_ADD_MMX2_OP movh, dst_reg, r3, r6 +%ifndef ARCH_X86_64 + mov r1, r1m +%endif + inc r5 + add r2, 32 + cmp r5, 16 + jl .nextblock + REP_RET +.no_dc + mov r6d, dword [r1+r5*4] + lea r6, [r0+r6] + IDCT4_ADD r6, r2, r3 +.skipblock + inc r5 + add r2, 32 + cmp r5, 16 + jl .nextblock + REP_RET + +; ff_h264_idct_add16intra_mmx(uint8_t *dst, const int *block_offset, +; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +cglobal h264_idct_add16intra_mmx, 5, 7, 0 + xor r5, r5 +%ifdef PIC + lea r11, [scan8_mem] +%endif +.nextblock + movzx r6, byte [scan8+r5] + movzx r6, byte [r4+r6] + or r6w, word [r2] + test r6, r6 + jz .skipblock + mov r6d, dword [r1+r5*4] + lea r6, [r0+r6] + IDCT4_ADD r6, r2, r3 +.skipblock + inc r5 + add r2, 32 + cmp r5, 16 + jl .nextblock + REP_RET + +; ff_h264_idct_add16intra_mmx2(uint8_t *dst, const int *block_offset, +; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +cglobal h264_idct_add16intra_mmx2, 5, 7, 0 + xor r5, r5 +%ifdef PIC + lea r11, [scan8_mem] +%endif +.nextblock + movzx r6, byte [scan8+r5] + movzx r6, byte [r4+r6] + test r6, r6 + jz .try_dc + mov r6d, dword [r1+r5*4] + lea r6, [r0+r6] + IDCT4_ADD r6, r2, r3 + inc r5 + add r2, 32 + cmp r5, 16 + jl .nextblock + REP_RET +.try_dc + movsx r6, word [r2] + test r6, r6 + jz .skipblock + DC_ADD_MMX2_INIT r2, r3, r6 +%ifdef ARCH_X86_64 +%define dst_reg r10 +%define dst_regd r10d +%else +%define dst_reg r1 +%define dst_regd r1d +%endif + mov dst_regd, dword [r1+r5*4] + lea dst_reg, [r0+dst_reg] + DC_ADD_MMX2_OP movh, dst_reg, r3, r6 +%ifndef ARCH_X86_64 + mov r1, r1m +%endif +.skipblock + inc r5 + add r2, 32 + cmp r5, 16 + jl .nextblock + REP_RET + +; ff_h264_idct8_add4_mmx2(uint8_t *dst, const int *block_offset, +; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +cglobal h264_idct8_add4_mmx2, 5, 7, 0 + %assign pad 128+4-(stack_offset&7) + SUB rsp, pad + + xor r5, r5 +%ifdef PIC + lea r11, [scan8_mem] +%endif +.nextblock + movzx r6, byte [scan8+r5] + movzx r6, byte [r4+r6] + test r6, r6 + jz .skipblock + cmp r6, 1 + jnz .no_dc + movsx r6, word [r2] + test r6, r6 + jz .no_dc + DC_ADD_MMX2_INIT r2, r3, r6 +%ifdef ARCH_X86_64 +%define dst_reg r10 +%define dst_regd r10d +%else +%define dst_reg r1 +%define dst_regd r1d +%endif + mov dst_regd, dword [r1+r5*4] + lea dst_reg, [r0+dst_reg] + DC_ADD_MMX2_OP mova, dst_reg, r3, r6 + lea dst_reg, [dst_reg+r3*4] + DC_ADD_MMX2_OP mova, dst_reg, r3, r6 +%ifndef ARCH_X86_64 + mov r1, r1m +%endif + add r5, 4 + add r2, 128 + cmp r5, 16 + jl .nextblock + + ADD rsp, pad + RET +.no_dc + mov r6d, dword [r1+r5*4] + lea r6, [r0+r6] + add word [r2], 32 + IDCT8_ADD_MMX_START r2 , rsp + IDCT8_ADD_MMX_START r2+8, rsp+64 + IDCT8_ADD_MMX_END r6 , rsp, r3 + mov r6d, dword [r1+r5*4] + lea r6, [r0+r6+4] + IDCT8_ADD_MMX_END r6 , rsp+8, r3 +.skipblock + add r5, 4 + add r2, 128 + cmp r5, 16 + jl .nextblock + + ADD rsp, pad + RET + +INIT_XMM +; ff_h264_idct8_add4_sse2(uint8_t *dst, const int *block_offset, +; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +cglobal h264_idct8_add4_sse2, 5, 7, 10 + xor r5, r5 +%ifdef PIC + lea r11, [scan8_mem] +%endif +.nextblock + movzx r6, byte [scan8+r5] + movzx r6, byte [r4+r6] + test r6, r6 + jz .skipblock + cmp r6, 1 + jnz .no_dc + movsx r6, word [r2] + test r6, r6 + jz .no_dc +INIT_MMX + DC_ADD_MMX2_INIT r2, r3, r6 +%ifdef ARCH_X86_64 +%define dst_reg r10 +%define dst_regd r10d +%else +%define dst_reg r1 +%define dst_regd r1d +%endif + mov dst_regd, dword [r1+r5*4] + lea dst_reg, [r0+dst_reg] + DC_ADD_MMX2_OP mova, dst_reg, r3, r6 + lea dst_reg, [dst_reg+r3*4] + DC_ADD_MMX2_OP mova, dst_reg, r3, r6 +%ifndef ARCH_X86_64 + mov r1, r1m +%endif + add r5, 4 + add r2, 128 + cmp r5, 16 + jl .nextblock + REP_RET +.no_dc +INIT_XMM + mov dst_regd, dword [r1+r5*4] + lea dst_reg, [r0+dst_reg] + IDCT8_ADD_SSE dst_reg, r2, r3, r6 +%ifndef ARCH_X86_64 + mov r1, r1m +%endif +.skipblock + add r5, 4 + add r2, 128 + cmp r5, 16 + jl .nextblock + REP_RET + +INIT_MMX +h264_idct_add8_mmx_plane: +.nextblock + movzx r6, byte [scan8+r5] + movzx r6, byte [r4+r6] + or r6w, word [r2] + test r6, r6 + jz .skipblock +%ifdef ARCH_X86_64 + mov r0d, dword [r1+r5*4] + add r0, [r10] +%else + mov r0, r1m ; XXX r1m here is actually r0m of the calling func + mov r0, [r0] + add r0, dword [r1+r5*4] +%endif + IDCT4_ADD r0, r2, r3 +.skipblock + inc r5 + add r2, 32 + test r5, 3 + jnz .nextblock + rep ret + +; ff_h264_idct_add8_mmx(uint8_t **dest, const int *block_offset, +; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +cglobal h264_idct_add8_mmx, 5, 7, 0 + mov r5, 16 + add r2, 512 +%ifdef PIC + lea r11, [scan8_mem] +%endif +%ifdef ARCH_X86_64 + mov r10, r0 +%endif + call h264_idct_add8_mmx_plane +%ifdef ARCH_X86_64 + add r10, gprsize +%else + add r0mp, gprsize +%endif + call h264_idct_add8_mmx_plane + RET + +h264_idct_add8_mmx2_plane +.nextblock + movzx r6, byte [scan8+r5] + movzx r6, byte [r4+r6] + test r6, r6 + jz .try_dc +%ifdef ARCH_X86_64 + mov r0d, dword [r1+r5*4] + add r0, [r10] +%else + mov r0, r1m ; XXX r1m here is actually r0m of the calling func + mov r0, [r0] + add r0, dword [r1+r5*4] +%endif + IDCT4_ADD r0, r2, r3 + inc r5 + add r2, 32 + test r5, 3 + jnz .nextblock + rep ret +.try_dc + movsx r6, word [r2] + test r6, r6 + jz .skipblock + DC_ADD_MMX2_INIT r2, r3, r6 +%ifdef ARCH_X86_64 + mov r0d, dword [r1+r5*4] + add r0, [r10] +%else + mov r0, r1m ; XXX r1m here is actually r0m of the calling func + mov r0, [r0] + add r0, dword [r1+r5*4] +%endif + DC_ADD_MMX2_OP movh, r0, r3, r6 +.skipblock + inc r5 + add r2, 32 + test r5, 3 + jnz .nextblock + rep ret + +; ff_h264_idct_add8_mmx2(uint8_t **dest, const int *block_offset, +; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +cglobal h264_idct_add8_mmx2, 5, 7, 0 + mov r5, 16 + add r2, 512 +%ifdef ARCH_X86_64 + mov r10, r0 +%endif +%ifdef PIC + lea r11, [scan8_mem] +%endif + call h264_idct_add8_mmx2_plane +%ifdef ARCH_X86_64 + add r10, gprsize +%else + add r0mp, gprsize +%endif + call h264_idct_add8_mmx2_plane + RET + +INIT_MMX +; r0 = uint8_t *dst, r2 = int16_t *block, r3 = int stride, r6=clobbered +h264_idct_dc_add8_mmx2: + movd m0, [r2 ] ; 0 0 X D + punpcklwd m0, [r2+32] ; x X d D + paddsw m0, [pw_32] + psraw m0, 6 + punpcklwd m0, m0 ; d d D D + pxor m1, m1 ; 0 0 0 0 + psubw m1, m0 ; -d-d-D-D + packuswb m0, m1 ; -d-d-D-D d d D D + pshufw m1, m0, 0xFA ; -d-d-d-d-D-D-D-D + punpcklwd m0, m0 ; d d d d D D D D + lea r6, [r3*3] + DC_ADD_MMX2_OP movq, r0, r3, r6 + ret + +ALIGN 16 +INIT_XMM +; r0 = uint8_t *dst (clobbered), r2 = int16_t *block, r3 = int stride +x264_add8x4_idct_sse2: + movq m0, [r2+ 0] + movq m1, [r2+ 8] + movq m2, [r2+16] + movq m3, [r2+24] + movhps m0, [r2+32] + movhps m1, [r2+40] + movhps m2, [r2+48] + movhps m3, [r2+56] + IDCT4_1D 0,1,2,3,4,5 + TRANSPOSE2x4x4W 0,1,2,3,4 + paddw m0, [pw_32] + IDCT4_1D 0,1,2,3,4,5 + pxor m7, m7 + STORE_DIFFx2 m0, m1, m4, m5, m7, 6, r0, r3 + lea r0, [r0+r3*2] + STORE_DIFFx2 m2, m3, m4, m5, m7, 6, r0, r3 + ret + +%macro add16_sse2_cycle 2 + movzx r0, word [r4+%2] + test r0, r0 + jz .cycle%1end + mov r0d, dword [r1+%1*8] +%ifdef ARCH_X86_64 + add r0, r10 +%else + add r0, r0m +%endif + call x264_add8x4_idct_sse2 +.cycle%1end +%if %1 < 7 + add r2, 64 +%endif +%endmacro + +; ff_h264_idct_add16_sse2(uint8_t *dst, const int *block_offset, +; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +cglobal h264_idct_add16_sse2, 5, 5, 8 +%ifdef ARCH_X86_64 + mov r10, r0 +%endif + ; unrolling of the loop leads to an average performance gain of + ; 20-25% + add16_sse2_cycle 0, 0xc + add16_sse2_cycle 1, 0x14 + add16_sse2_cycle 2, 0xe + add16_sse2_cycle 3, 0x16 + add16_sse2_cycle 4, 0x1c + add16_sse2_cycle 5, 0x24 + add16_sse2_cycle 6, 0x1e + add16_sse2_cycle 7, 0x26 + RET + +%macro add16intra_sse2_cycle 2 + movzx r0, word [r4+%2] + test r0, r0 + jz .try%1dc + mov r0d, dword [r1+%1*8] +%ifdef ARCH_X86_64 + add r0, r10 +%else + add r0, r0m +%endif + call x264_add8x4_idct_sse2 + jmp .cycle%1end +.try%1dc + movsx r0, word [r2 ] + or r0w, word [r2+32] + jz .cycle%1end + mov r0d, dword [r1+%1*8] +%ifdef ARCH_X86_64 + add r0, r10 +%else + add r0, r0m +%endif + call h264_idct_dc_add8_mmx2 +.cycle%1end +%if %1 < 7 + add r2, 64 +%endif +%endmacro + +; ff_h264_idct_add16intra_sse2(uint8_t *dst, const int *block_offset, +; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +cglobal h264_idct_add16intra_sse2, 5, 7, 8 +%ifdef ARCH_X86_64 + mov r10, r0 +%endif + add16intra_sse2_cycle 0, 0xc + add16intra_sse2_cycle 1, 0x14 + add16intra_sse2_cycle 2, 0xe + add16intra_sse2_cycle 3, 0x16 + add16intra_sse2_cycle 4, 0x1c + add16intra_sse2_cycle 5, 0x24 + add16intra_sse2_cycle 6, 0x1e + add16intra_sse2_cycle 7, 0x26 + RET + +%macro add8_sse2_cycle 2 + movzx r0, word [r4+%2] + test r0, r0 + jz .try%1dc +%ifdef ARCH_X86_64 + mov r0d, dword [r1+%1*8+64] + add r0, [r10] +%else + mov r0, r0m + mov r0, [r0] + add r0, dword [r1+%1*8+64] +%endif + call x264_add8x4_idct_sse2 + jmp .cycle%1end +.try%1dc + movsx r0, word [r2 ] + or r0w, word [r2+32] + jz .cycle%1end +%ifdef ARCH_X86_64 + mov r0d, dword [r1+%1*8+64] + add r0, [r10] +%else + mov r0, r0m + mov r0, [r0] + add r0, dword [r1+%1*8+64] +%endif + call h264_idct_dc_add8_mmx2 +.cycle%1end +%if %1 < 3 + add r2, 64 +%endif +%endmacro + +; ff_h264_idct_add8_sse2(uint8_t **dest, const int *block_offset, +; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +cglobal h264_idct_add8_sse2, 5, 7, 8 + add r2, 512 +%ifdef ARCH_X86_64 + mov r10, r0 +%endif + add8_sse2_cycle 0, 0x09 + add8_sse2_cycle 1, 0x11 +%ifdef ARCH_X86_64 + add r10, gprsize +%else + add r0mp, gprsize +%endif + add8_sse2_cycle 2, 0x21 + add8_sse2_cycle 3, 0x29 + RET + +;void ff_h264_luma_dc_dequant_idct_mmx(DCTELEM *output, DCTELEM *input, int qmul) + +%macro WALSH4_1D 5 + SUMSUB_BADC m%4, m%3, m%2, m%1, m%5 + SUMSUB_BADC m%4, m%2, m%3, m%1, m%5 + SWAP %1, %4, %3 +%endmacro + +%macro DEQUANT_MMX 3 + mova m7, [pw_1] + mova m4, %1 + punpcklwd %1, m7 + punpckhwd m4, m7 + mova m5, %2 + punpcklwd %2, m7 + punpckhwd m5, m7 + movd m7, t3d + punpckldq m7, m7 + pmaddwd %1, m7 + pmaddwd %2, m7 + pmaddwd m4, m7 + pmaddwd m5, m7 + psrad %1, %3 + psrad %2, %3 + psrad m4, %3 + psrad m5, %3 + packssdw %1, m4 + packssdw %2, m5 +%endmacro + +%macro STORE_WORDS_MMX 5 + movd t0d, %1 + psrlq %1, 32 + movd t1d, %1 + mov [t2+%2*32], t0w + mov [t2+%4*32], t1w + shr t0d, 16 + shr t1d, 16 + mov [t2+%3*32], t0w + mov [t2+%5*32], t1w +%endmacro + +%macro DEQUANT_STORE_MMX 1 + DEQUANT_MMX m0, m1, %1 + STORE_WORDS_MMX m0, 0, 1, 4, 5 + STORE_WORDS_MMX m1, 2, 3, 6, 7 + + DEQUANT_MMX m2, m3, %1 + STORE_WORDS_MMX m2, 8, 9, 12, 13 + STORE_WORDS_MMX m3, 10, 11, 14, 15 +%endmacro + +%macro STORE_WORDS_SSE 9 + movd t0d, %1 + psrldq %1, 4 + movd t1d, %1 + psrldq %1, 4 + mov [t2+%2*32], t0w + mov [t2+%4*32], t1w + shr t0d, 16 + shr t1d, 16 + mov [t2+%3*32], t0w + mov [t2+%5*32], t1w + movd t0d, %1 + psrldq %1, 4 + movd t1d, %1 + mov [t2+%6*32], t0w + mov [t2+%8*32], t1w + shr t0d, 16 + shr t1d, 16 + mov [t2+%7*32], t0w + mov [t2+%9*32], t1w +%endmacro + +%macro DEQUANT_STORE_SSE2 1 + movd xmm4, t3d + movq xmm5, [pw_1] + pshufd xmm4, xmm4, 0 + movq2dq xmm0, m0 + movq2dq xmm1, m1 + movq2dq xmm2, m2 + movq2dq xmm3, m3 + punpcklwd xmm0, xmm5 + punpcklwd xmm1, xmm5 + punpcklwd xmm2, xmm5 + punpcklwd xmm3, xmm5 + pmaddwd xmm0, xmm4 + pmaddwd xmm1, xmm4 + pmaddwd xmm2, xmm4 + pmaddwd xmm3, xmm4 + psrad xmm0, %1 + psrad xmm1, %1 + psrad xmm2, %1 + psrad xmm3, %1 + packssdw xmm0, xmm1 + packssdw xmm2, xmm3 + STORE_WORDS_SSE xmm0, 0, 1, 4, 5, 2, 3, 6, 7 + STORE_WORDS_SSE xmm2, 8, 9, 12, 13, 10, 11, 14, 15 +%endmacro + +%macro IDCT_DC_DEQUANT 2 +cglobal h264_luma_dc_dequant_idct_%1, 3,4,%2 + movq m3, [r1+24] + movq m2, [r1+16] + movq m1, [r1+ 8] + movq m0, [r1+ 0] + WALSH4_1D 0,1,2,3,4 + TRANSPOSE4x4W 0,1,2,3,4 + WALSH4_1D 0,1,2,3,4 + +; shift, tmp, output, qmul +%ifdef WIN64 + DECLARE_REG_TMP 0,3,1,2 + ; we can't avoid this, because r0 is the shift register (ecx) on win64 + xchg r0, t2 +%elifdef ARCH_X86_64 + DECLARE_REG_TMP 3,1,0,2 +%else + DECLARE_REG_TMP 1,3,0,2 +%endif + + cmp t3d, 32767 + jg .big_qmul + add t3d, 128 << 16 +%ifidn %1,mmx + DEQUANT_STORE_MMX 8 +%else + DEQUANT_STORE_SSE2 8 +%endif + RET +.big_qmul: + bsr t0d, t3d + add t3d, 128 << 16 + mov t1d, 7 + cmp t0d, t1d + cmovg t0d, t1d + inc t1d + shr t3d, t0b + sub t1d, t0d +%ifidn %1,mmx + movd m6, t1d + DEQUANT_STORE_MMX m6 +%else + movd xmm6, t1d + DEQUANT_STORE_SSE2 xmm6 +%endif + RET +%endmacro + +INIT_MMX +IDCT_DC_DEQUANT mmx, 0 +IDCT_DC_DEQUANT sse2, 7 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_intrapred.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_intrapred.asm new file mode 100644 index 00000000..28c2f399 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_intrapred.asm @@ -0,0 +1,2789 @@ +;****************************************************************************** +;* H.264 intra prediction asm optimizations +;* Copyright (c) 2010 Jason Garrett-Glaser +;* Copyright (c) 2010 Holger Lubitz +;* Copyright (c) 2010 Loren Merritt +;* Copyright (c) 2010 Ronald S. Bultje +;* +;* 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 +;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;****************************************************************************** + +%include "x86inc.asm" +%include "x86util.asm" + +SECTION_RODATA + +tm_shuf: times 8 db 0x03, 0x80 +pw_ff00: times 8 dw 0xff00 +plane_shuf: db -8, -7, -6, -5, -4, -3, -2, -1 + db 1, 2, 3, 4, 5, 6, 7, 8 +plane8_shuf: db -4, -3, -2, -1, 0, 0, 0, 0 + db 1, 2, 3, 4, 0, 0, 0, 0 +pw_0to7: dw 0, 1, 2, 3, 4, 5, 6, 7 +pw_1to8: dw 1, 2, 3, 4, 5, 6, 7, 8 +pw_m8tom1: dw -8, -7, -6, -5, -4, -3, -2, -1 +pw_m4to4: dw -4, -3, -2, -1, 1, 2, 3, 4 + +SECTION .text + +cextern pb_1 +cextern pb_3 +cextern pw_4 +cextern pw_5 +cextern pw_8 +cextern pw_16 +cextern pw_17 +cextern pw_32 + +;----------------------------------------------------------------------------- +; void pred16x16_vertical(uint8_t *src, int stride) +;----------------------------------------------------------------------------- + +cglobal pred16x16_vertical_mmx, 2,3 + sub r0, r1 + mov r2, 8 + movq mm0, [r0+0] + movq mm1, [r0+8] +.loop: + movq [r0+r1*1+0], mm0 + movq [r0+r1*1+8], mm1 + movq [r0+r1*2+0], mm0 + movq [r0+r1*2+8], mm1 + lea r0, [r0+r1*2] + dec r2 + jg .loop + REP_RET + +cglobal pred16x16_vertical_sse, 2,3 + sub r0, r1 + mov r2, 4 + movaps xmm0, [r0] +.loop: + movaps [r0+r1*1], xmm0 + movaps [r0+r1*2], xmm0 + lea r0, [r0+r1*2] + movaps [r0+r1*1], xmm0 + movaps [r0+r1*2], xmm0 + lea r0, [r0+r1*2] + dec r2 + jg .loop + REP_RET + +;----------------------------------------------------------------------------- +; void pred16x16_horizontal(uint8_t *src, int stride) +;----------------------------------------------------------------------------- + +%macro PRED16x16_H 1 +cglobal pred16x16_horizontal_%1, 2,3 + mov r2, 8 +%ifidn %1, ssse3 + mova m2, [pb_3] +%endif +.loop: + movd m0, [r0+r1*0-4] + movd m1, [r0+r1*1-4] + +%ifidn %1, ssse3 + pshufb m0, m2 + pshufb m1, m2 +%else + punpcklbw m0, m0 + punpcklbw m1, m1 +%ifidn %1, mmxext + pshufw m0, m0, 0xff + pshufw m1, m1, 0xff +%else + punpckhwd m0, m0 + punpckhwd m1, m1 + punpckhdq m0, m0 + punpckhdq m1, m1 +%endif + mova [r0+r1*0+8], m0 + mova [r0+r1*1+8], m1 +%endif + + mova [r0+r1*0], m0 + mova [r0+r1*1], m1 + lea r0, [r0+r1*2] + dec r2 + jg .loop + REP_RET +%endmacro + +INIT_MMX +PRED16x16_H mmx +PRED16x16_H mmxext +INIT_XMM +PRED16x16_H ssse3 + +;----------------------------------------------------------------------------- +; void pred16x16_dc(uint8_t *src, int stride) +;----------------------------------------------------------------------------- + +%macro PRED16x16_DC 1 +cglobal pred16x16_dc_%1, 2,7 + mov r4, r0 + sub r0, r1 + pxor mm0, mm0 + pxor mm1, mm1 + psadbw mm0, [r0+0] + psadbw mm1, [r0+8] + dec r0 + movzx r5d, byte [r0+r1*1] + paddw mm0, mm1 + movd r6d, mm0 + lea r0, [r0+r1*2] +%rep 7 + movzx r2d, byte [r0+r1*0] + movzx r3d, byte [r0+r1*1] + add r5d, r2d + add r6d, r3d + lea r0, [r0+r1*2] +%endrep + movzx r2d, byte [r0+r1*0] + add r5d, r6d + lea r2d, [r2+r5+16] + shr r2d, 5 +%ifidn %1, mmxext + movd m0, r2d + punpcklbw m0, m0 + pshufw m0, m0, 0 +%elifidn %1, sse2 + movd m0, r2d + punpcklbw m0, m0 + pshuflw m0, m0, 0 + punpcklqdq m0, m0 +%elifidn %1, ssse3 + pxor m1, m1 + movd m0, r2d + pshufb m0, m1 +%endif + +%if mmsize==8 + mov r3d, 8 +.loop: + mova [r4+r1*0+0], m0 + mova [r4+r1*0+8], m0 + mova [r4+r1*1+0], m0 + mova [r4+r1*1+8], m0 +%else + mov r3d, 4 +.loop: + mova [r4+r1*0], m0 + mova [r4+r1*1], m0 + lea r4, [r4+r1*2] + mova [r4+r1*0], m0 + mova [r4+r1*1], m0 +%endif + lea r4, [r4+r1*2] + dec r3d + jg .loop + REP_RET +%endmacro + +INIT_MMX +PRED16x16_DC mmxext +INIT_XMM +PRED16x16_DC sse2 +PRED16x16_DC ssse3 + +;----------------------------------------------------------------------------- +; void pred16x16_tm_vp8(uint8_t *src, int stride) +;----------------------------------------------------------------------------- + +%macro PRED16x16_TM_MMX 1 +cglobal pred16x16_tm_vp8_%1, 2,5 + sub r0, r1 + pxor mm7, mm7 + movq mm0, [r0+0] + movq mm2, [r0+8] + movq mm1, mm0 + movq mm3, mm2 + punpcklbw mm0, mm7 + punpckhbw mm1, mm7 + punpcklbw mm2, mm7 + punpckhbw mm3, mm7 + movzx r3d, byte [r0-1] + mov r4d, 16 +.loop: + movzx r2d, byte [r0+r1-1] + sub r2d, r3d + movd mm4, r2d +%ifidn %1, mmx + punpcklwd mm4, mm4 + punpckldq mm4, mm4 +%else + pshufw mm4, mm4, 0 +%endif + movq mm5, mm4 + movq mm6, mm4 + movq mm7, mm4 + paddw mm4, mm0 + paddw mm5, mm1 + paddw mm6, mm2 + paddw mm7, mm3 + packuswb mm4, mm5 + packuswb mm6, mm7 + movq [r0+r1+0], mm4 + movq [r0+r1+8], mm6 + add r0, r1 + dec r4d + jg .loop + REP_RET +%endmacro + +PRED16x16_TM_MMX mmx +PRED16x16_TM_MMX mmxext + +cglobal pred16x16_tm_vp8_sse2, 2,6,6 + sub r0, r1 + pxor xmm2, xmm2 + movdqa xmm0, [r0] + movdqa xmm1, xmm0 + punpcklbw xmm0, xmm2 + punpckhbw xmm1, xmm2 + movzx r4d, byte [r0-1] + mov r5d, 8 +.loop: + movzx r2d, byte [r0+r1*1-1] + movzx r3d, byte [r0+r1*2-1] + sub r2d, r4d + sub r3d, r4d + movd xmm2, r2d + movd xmm4, r3d + pshuflw xmm2, xmm2, 0 + pshuflw xmm4, xmm4, 0 + punpcklqdq xmm2, xmm2 + punpcklqdq xmm4, xmm4 + movdqa xmm3, xmm2 + movdqa xmm5, xmm4 + paddw xmm2, xmm0 + paddw xmm3, xmm1 + paddw xmm4, xmm0 + paddw xmm5, xmm1 + packuswb xmm2, xmm3 + packuswb xmm4, xmm5 + movdqa [r0+r1*1], xmm2 + movdqa [r0+r1*2], xmm4 + lea r0, [r0+r1*2] + dec r5d + jg .loop + REP_RET + +;----------------------------------------------------------------------------- +; void pred16x16_plane(uint8_t *src, int stride) +;----------------------------------------------------------------------------- + +%macro H264_PRED16x16_PLANE 3 +cglobal pred16x16_plane_%3_%1, 2, 7, %2 + mov r2, r1 ; +stride + neg r1 ; -stride + + movh m0, [r0+r1 -1] +%if mmsize == 8 + pxor m4, m4 + movh m1, [r0+r1 +3 ] + movh m2, [r0+r1 +8 ] + movh m3, [r0+r1 +12] + punpcklbw m0, m4 + punpcklbw m1, m4 + punpcklbw m2, m4 + punpcklbw m3, m4 + pmullw m0, [pw_m8tom1 ] + pmullw m1, [pw_m8tom1+8] + pmullw m2, [pw_1to8 ] + pmullw m3, [pw_1to8 +8] + paddw m0, m2 + paddw m1, m3 +%else ; mmsize == 16 +%ifidn %1, sse2 + pxor m2, m2 + movh m1, [r0+r1 +8] + punpcklbw m0, m2 + punpcklbw m1, m2 + pmullw m0, [pw_m8tom1] + pmullw m1, [pw_1to8] + paddw m0, m1 +%else ; ssse3 + movhps m0, [r0+r1 +8] + pmaddubsw m0, [plane_shuf] ; H coefficients +%endif + movhlps m1, m0 +%endif + paddw m0, m1 +%ifidn %1, mmx + mova m1, m0 + psrlq m1, 32 +%elifidn %1, mmx2 + pshufw m1, m0, 0xE +%else ; mmsize == 16 + pshuflw m1, m0, 0xE +%endif + paddw m0, m1 +%ifidn %1, mmx + mova m1, m0 + psrlq m1, 16 +%elifidn %1, mmx2 + pshufw m1, m0, 0x1 +%else + pshuflw m1, m0, 0x1 +%endif + paddw m0, m1 ; sum of H coefficients + + lea r4, [r0+r2*8-1] + lea r3, [r0+r2*4-1] + add r4, r2 + +%ifdef ARCH_X86_64 +%define e_reg r11 +%else +%define e_reg r0 +%endif + + movzx e_reg, byte [r3+r2*2 ] + movzx r5, byte [r4+r1 ] + sub r5, e_reg + + movzx e_reg, byte [r3+r2 ] + movzx r6, byte [r4 ] + sub r6, e_reg + lea r5, [r5+r6*2] + + movzx e_reg, byte [r3+r1 ] + movzx r6, byte [r4+r2*2 ] + sub r6, e_reg + lea r5, [r5+r6*4] + + movzx e_reg, byte [r3 ] +%ifdef ARCH_X86_64 + movzx r10, byte [r4+r2 ] + sub r10, e_reg +%else + movzx r6, byte [r4+r2 ] + sub r6, e_reg + lea r5, [r5+r6*4] + sub r5, r6 +%endif + + lea e_reg, [r3+r1*4] + lea r3, [r4+r2*4] + + movzx r4, byte [e_reg+r2 ] + movzx r6, byte [r3 ] + sub r6, r4 +%ifdef ARCH_X86_64 + lea r6, [r10+r6*2] + lea r5, [r5+r6*2] + add r5, r6 +%else + lea r5, [r5+r6*4] + lea r5, [r5+r6*2] +%endif + + movzx r4, byte [e_reg ] +%ifdef ARCH_X86_64 + movzx r10, byte [r3 +r2 ] + sub r10, r4 + sub r5, r10 +%else + movzx r6, byte [r3 +r2 ] + sub r6, r4 + lea r5, [r5+r6*8] + sub r5, r6 +%endif + + movzx r4, byte [e_reg+r1 ] + movzx r6, byte [r3 +r2*2] + sub r6, r4 +%ifdef ARCH_X86_64 + add r6, r10 +%endif + lea r5, [r5+r6*8] + + movzx r4, byte [e_reg+r2*2] + movzx r6, byte [r3 +r1 ] + sub r6, r4 + lea r5, [r5+r6*4] + add r5, r6 ; sum of V coefficients + +%ifndef ARCH_X86_64 + mov r0, r0m +%endif + +%ifidn %3, h264 + lea r5, [r5*5+32] + sar r5, 6 +%elifidn %3, rv40 + lea r5, [r5*5] + sar r5, 6 +%elifidn %3, svq3 + test r5, r5 + lea r6, [r5+3] + cmovs r5, r6 + sar r5, 2 ; V/4 + lea r5, [r5*5] ; 5*(V/4) + test r5, r5 + lea r6, [r5+15] + cmovs r5, r6 + sar r5, 4 ; (5*(V/4))/16 +%endif + + movzx r4, byte [r0+r1 +15] + movzx r3, byte [r3+r2*2 ] + lea r3, [r3+r4+1] + shl r3, 4 + + movd r1d, m0 + movsx r1d, r1w +%ifnidn %3, svq3 +%ifidn %3, h264 + lea r1d, [r1d*5+32] +%else ; rv40 + lea r1d, [r1d*5] +%endif + sar r1d, 6 +%else ; svq3 + test r1d, r1d + lea r4d, [r1d+3] + cmovs r1d, r4d + sar r1d, 2 ; H/4 + lea r1d, [r1d*5] ; 5*(H/4) + test r1d, r1d + lea r4d, [r1d+15] + cmovs r1d, r4d + sar r1d, 4 ; (5*(H/4))/16 +%endif + movd m0, r1d + + add r1d, r5d + add r3d, r1d + shl r1d, 3 + sub r3d, r1d ; a + + movd m1, r5d + movd m3, r3d +%ifidn %1, mmx + punpcklwd m0, m0 + punpcklwd m1, m1 + punpcklwd m3, m3 + punpckldq m0, m0 + punpckldq m1, m1 + punpckldq m3, m3 +%elifidn %1, mmx2 + pshufw m0, m0, 0x0 + pshufw m1, m1, 0x0 + pshufw m3, m3, 0x0 +%else + pshuflw m0, m0, 0x0 + pshuflw m1, m1, 0x0 + pshuflw m3, m3, 0x0 + punpcklqdq m0, m0 ; splat H (words) + punpcklqdq m1, m1 ; splat V (words) + punpcklqdq m3, m3 ; splat a (words) +%endif +%ifidn %3, svq3 + SWAP 0, 1 +%endif + mova m2, m0 +%if mmsize == 8 + mova m5, m0 +%endif + pmullw m0, [pw_0to7] ; 0*H, 1*H, ..., 7*H (words) +%if mmsize == 16 + psllw m2, 3 +%else + psllw m5, 3 + psllw m2, 2 + mova m6, m5 + paddw m6, m2 +%endif + paddw m0, m3 ; a + {0,1,2,3,4,5,6,7}*H + paddw m2, m0 ; a + {8,9,10,11,12,13,14,15}*H +%if mmsize == 8 + paddw m5, m0 ; a + {8,9,10,11}*H + paddw m6, m0 ; a + {12,13,14,15}*H +%endif + + mov r4, 8 +.loop + mova m3, m0 ; b[0..7] + mova m4, m2 ; b[8..15] + psraw m3, 5 + psraw m4, 5 + packuswb m3, m4 + mova [r0], m3 +%if mmsize == 8 + mova m3, m5 ; b[8..11] + mova m4, m6 ; b[12..15] + psraw m3, 5 + psraw m4, 5 + packuswb m3, m4 + mova [r0+8], m3 +%endif + paddw m0, m1 + paddw m2, m1 +%if mmsize == 8 + paddw m5, m1 + paddw m6, m1 +%endif + + mova m3, m0 ; b[0..7] + mova m4, m2 ; b[8..15] + psraw m3, 5 + psraw m4, 5 + packuswb m3, m4 + mova [r0+r2], m3 +%if mmsize == 8 + mova m3, m5 ; b[8..11] + mova m4, m6 ; b[12..15] + psraw m3, 5 + psraw m4, 5 + packuswb m3, m4 + mova [r0+r2+8], m3 +%endif + paddw m0, m1 + paddw m2, m1 +%if mmsize == 8 + paddw m5, m1 + paddw m6, m1 +%endif + + lea r0, [r0+r2*2] + dec r4 + jg .loop + REP_RET +%endmacro + +INIT_MMX +H264_PRED16x16_PLANE mmx, 0, h264 +H264_PRED16x16_PLANE mmx, 0, rv40 +H264_PRED16x16_PLANE mmx, 0, svq3 +H264_PRED16x16_PLANE mmx2, 0, h264 +H264_PRED16x16_PLANE mmx2, 0, rv40 +H264_PRED16x16_PLANE mmx2, 0, svq3 +INIT_XMM +H264_PRED16x16_PLANE sse2, 8, h264 +H264_PRED16x16_PLANE sse2, 8, rv40 +H264_PRED16x16_PLANE sse2, 8, svq3 +H264_PRED16x16_PLANE ssse3, 8, h264 +H264_PRED16x16_PLANE ssse3, 8, rv40 +H264_PRED16x16_PLANE ssse3, 8, svq3 + +;----------------------------------------------------------------------------- +; void pred8x8_plane(uint8_t *src, int stride) +;----------------------------------------------------------------------------- + +%macro H264_PRED8x8_PLANE 2 +cglobal pred8x8_plane_%1, 2, 7, %2 + mov r2, r1 ; +stride + neg r1 ; -stride + + movd m0, [r0+r1 -1] +%if mmsize == 8 + pxor m2, m2 + movh m1, [r0+r1 +4 ] + punpcklbw m0, m2 + punpcklbw m1, m2 + pmullw m0, [pw_m4to4] + pmullw m1, [pw_m4to4+8] +%else ; mmsize == 16 +%ifidn %1, sse2 + pxor m2, m2 + movd m1, [r0+r1 +4] + punpckldq m0, m1 + punpcklbw m0, m2 + pmullw m0, [pw_m4to4] +%else ; ssse3 + movhps m0, [r0+r1 +4] ; this reads 4 bytes more than necessary + pmaddubsw m0, [plane8_shuf] ; H coefficients +%endif + movhlps m1, m0 +%endif + paddw m0, m1 + +%ifnidn %1, ssse3 +%ifidn %1, mmx + mova m1, m0 + psrlq m1, 32 +%elifidn %1, mmx2 + pshufw m1, m0, 0xE +%else ; mmsize == 16 + pshuflw m1, m0, 0xE +%endif + paddw m0, m1 +%endif ; !ssse3 + +%ifidn %1, mmx + mova m1, m0 + psrlq m1, 16 +%elifidn %1, mmx2 + pshufw m1, m0, 0x1 +%else + pshuflw m1, m0, 0x1 +%endif + paddw m0, m1 ; sum of H coefficients + + lea r4, [r0+r2*4-1] + lea r3, [r0 -1] + add r4, r2 + +%ifdef ARCH_X86_64 +%define e_reg r11 +%else +%define e_reg r0 +%endif + + movzx e_reg, byte [r3+r2*2 ] + movzx r5, byte [r4+r1 ] + sub r5, e_reg + + movzx e_reg, byte [r3 ] +%ifdef ARCH_X86_64 + movzx r10, byte [r4+r2 ] + sub r10, e_reg + sub r5, r10 +%else + movzx r6, byte [r4+r2 ] + sub r6, e_reg + lea r5, [r5+r6*4] + sub r5, r6 +%endif + + movzx e_reg, byte [r3+r1 ] + movzx r6, byte [r4+r2*2 ] + sub r6, e_reg +%ifdef ARCH_X86_64 + add r6, r10 +%endif + lea r5, [r5+r6*4] + + movzx e_reg, byte [r3+r2 ] + movzx r6, byte [r4 ] + sub r6, e_reg + lea r6, [r5+r6*2] + + lea r5, [r6*9+16] + lea r5, [r5+r6*8] + sar r5, 5 + +%ifndef ARCH_X86_64 + mov r0, r0m +%endif + + movzx r3, byte [r4+r2*2 ] + movzx r4, byte [r0+r1 +7] + lea r3, [r3+r4+1] + shl r3, 4 + movd r1d, m0 + movsx r1d, r1w + imul r1d, 17 + add r1d, 16 + sar r1d, 5 + movd m0, r1d + add r1d, r5d + sub r3d, r1d + add r1d, r1d + sub r3d, r1d ; a + + movd m1, r5d + movd m3, r3d +%ifidn %1, mmx + punpcklwd m0, m0 + punpcklwd m1, m1 + punpcklwd m3, m3 + punpckldq m0, m0 + punpckldq m1, m1 + punpckldq m3, m3 +%elifidn %1, mmx2 + pshufw m0, m0, 0x0 + pshufw m1, m1, 0x0 + pshufw m3, m3, 0x0 +%else + pshuflw m0, m0, 0x0 + pshuflw m1, m1, 0x0 + pshuflw m3, m3, 0x0 + punpcklqdq m0, m0 ; splat H (words) + punpcklqdq m1, m1 ; splat V (words) + punpcklqdq m3, m3 ; splat a (words) +%endif +%if mmsize == 8 + mova m2, m0 +%endif + pmullw m0, [pw_0to7] ; 0*H, 1*H, ..., 7*H (words) + paddw m0, m3 ; a + {0,1,2,3,4,5,6,7}*H +%if mmsize == 8 + psllw m2, 2 + paddw m2, m0 ; a + {4,5,6,7}*H +%endif + + mov r4, 4 +ALIGN 16 +.loop +%if mmsize == 16 + mova m3, m0 ; b[0..7] + paddw m0, m1 + psraw m3, 5 + mova m4, m0 ; V+b[0..7] + paddw m0, m1 + psraw m4, 5 + packuswb m3, m4 + movh [r0], m3 + movhps [r0+r2], m3 +%else ; mmsize == 8 + mova m3, m0 ; b[0..3] + mova m4, m2 ; b[4..7] + paddw m0, m1 + paddw m2, m1 + psraw m3, 5 + psraw m4, 5 + mova m5, m0 ; V+b[0..3] + mova m6, m2 ; V+b[4..7] + paddw m0, m1 + paddw m2, m1 + psraw m5, 5 + psraw m6, 5 + packuswb m3, m4 + packuswb m5, m6 + mova [r0], m3 + mova [r0+r2], m5 +%endif + + lea r0, [r0+r2*2] + dec r4 + jg .loop + REP_RET +%endmacro + +INIT_MMX +H264_PRED8x8_PLANE mmx, 0 +H264_PRED8x8_PLANE mmx2, 0 +INIT_XMM +H264_PRED8x8_PLANE sse2, 8 +H264_PRED8x8_PLANE ssse3, 8 + +;----------------------------------------------------------------------------- +; void pred8x8_vertical(uint8_t *src, int stride) +;----------------------------------------------------------------------------- + +cglobal pred8x8_vertical_mmx, 2,2 + sub r0, r1 + movq mm0, [r0] +%rep 3 + movq [r0+r1*1], mm0 + movq [r0+r1*2], mm0 + lea r0, [r0+r1*2] +%endrep + movq [r0+r1*1], mm0 + movq [r0+r1*2], mm0 + RET + +;----------------------------------------------------------------------------- +; void pred8x8_horizontal(uint8_t *src, int stride) +;----------------------------------------------------------------------------- + +%macro PRED8x8_H 1 +cglobal pred8x8_horizontal_%1, 2,3 + mov r2, 4 +%ifidn %1, ssse3 + mova m2, [pb_3] +%endif +.loop: + movd m0, [r0+r1*0-4] + movd m1, [r0+r1*1-4] +%ifidn %1, ssse3 + pshufb m0, m2 + pshufb m1, m2 +%else + punpcklbw m0, m0 + punpcklbw m1, m1 +%ifidn %1, mmxext + pshufw m0, m0, 0xff + pshufw m1, m1, 0xff +%else + punpckhwd m0, m0 + punpckhwd m1, m1 + punpckhdq m0, m0 + punpckhdq m1, m1 +%endif +%endif + mova [r0+r1*0], m0 + mova [r0+r1*1], m1 + lea r0, [r0+r1*2] + dec r2 + jg .loop + REP_RET +%endmacro + +INIT_MMX +PRED8x8_H mmx +PRED8x8_H mmxext +PRED8x8_H ssse3 + +;----------------------------------------------------------------------------- +; void pred8x8_top_dc_mmxext(uint8_t *src, int stride) +;----------------------------------------------------------------------------- +%ifdef CONFIG_GPL +cglobal pred8x8_top_dc_mmxext, 2,5 + sub r0, r1 + movq mm0, [r0] + pxor mm1, mm1 + pxor mm2, mm2 + lea r2, [r0+r1*2] + punpckhbw mm1, mm0 + punpcklbw mm0, mm2 + psadbw mm1, mm2 ; s1 + lea r3, [r2+r1*2] + psadbw mm0, mm2 ; s0 + psrlw mm1, 1 + psrlw mm0, 1 + pavgw mm1, mm2 + lea r4, [r3+r1*2] + pavgw mm0, mm2 + pshufw mm1, mm1, 0 + pshufw mm0, mm0, 0 ; dc0 (w) + packuswb mm0, mm1 ; dc0,dc1 (b) + movq [r0+r1*1], mm0 + movq [r0+r1*2], mm0 + lea r0, [r3+r1*2] + movq [r2+r1*1], mm0 + movq [r2+r1*2], mm0 + movq [r3+r1*1], mm0 + movq [r3+r1*2], mm0 + movq [r0+r1*1], mm0 + movq [r0+r1*2], mm0 + RET + +;----------------------------------------------------------------------------- +; void pred8x8_dc_mmxext(uint8_t *src, int stride) +;----------------------------------------------------------------------------- + +INIT_MMX +cglobal pred8x8_dc_mmxext, 2,5 + sub r0, r1 + pxor m7, m7 + movd m0, [r0+0] + movd m1, [r0+4] + psadbw m0, m7 ; s0 + mov r4, r0 + psadbw m1, m7 ; s1 + + movzx r2d, byte [r0+r1*1-1] + movzx r3d, byte [r0+r1*2-1] + lea r0, [r0+r1*2] + add r2d, r3d + movzx r3d, byte [r0+r1*1-1] + add r2d, r3d + movzx r3d, byte [r0+r1*2-1] + add r2d, r3d + lea r0, [r0+r1*2] + movd m2, r2d ; s2 + movzx r2d, byte [r0+r1*1-1] + movzx r3d, byte [r0+r1*2-1] + lea r0, [r0+r1*2] + add r2d, r3d + movzx r3d, byte [r0+r1*1-1] + add r2d, r3d + movzx r3d, byte [r0+r1*2-1] + add r2d, r3d + movd m3, r2d ; s3 + + punpcklwd m0, m1 + mov r0, r4 + punpcklwd m2, m3 + punpckldq m0, m2 ; s0, s1, s2, s3 + pshufw m3, m0, 11110110b ; s2, s1, s3, s3 + lea r2, [r0+r1*2] + pshufw m0, m0, 01110100b ; s0, s1, s3, s1 + paddw m0, m3 + lea r3, [r2+r1*2] + psrlw m0, 2 + pavgw m0, m7 ; s0+s2, s1, s3, s1+s3 + lea r4, [r3+r1*2] + packuswb m0, m0 + punpcklbw m0, m0 + movq m1, m0 + punpcklbw m0, m0 + punpckhbw m1, m1 + movq [r0+r1*1], m0 + movq [r0+r1*2], m0 + movq [r2+r1*1], m0 + movq [r2+r1*2], m0 + movq [r3+r1*1], m1 + movq [r3+r1*2], m1 + movq [r4+r1*1], m1 + movq [r4+r1*2], m1 + RET +%endif + +;----------------------------------------------------------------------------- +; void pred8x8_dc_rv40(uint8_t *src, int stride) +;----------------------------------------------------------------------------- + +cglobal pred8x8_dc_rv40_mmxext, 2,7 + mov r4, r0 + sub r0, r1 + pxor mm0, mm0 + psadbw mm0, [r0] + dec r0 + movzx r5d, byte [r0+r1*1] + movd r6d, mm0 + lea r0, [r0+r1*2] +%rep 3 + movzx r2d, byte [r0+r1*0] + movzx r3d, byte [r0+r1*1] + add r5d, r2d + add r6d, r3d + lea r0, [r0+r1*2] +%endrep + movzx r2d, byte [r0+r1*0] + add r5d, r6d + lea r2d, [r2+r5+8] + shr r2d, 4 + movd mm0, r2d + punpcklbw mm0, mm0 + pshufw mm0, mm0, 0 + mov r3d, 4 +.loop: + movq [r4+r1*0], mm0 + movq [r4+r1*1], mm0 + lea r4, [r4+r1*2] + dec r3d + jg .loop + REP_RET + +;----------------------------------------------------------------------------- +; void pred8x8_tm_vp8(uint8_t *src, int stride) +;----------------------------------------------------------------------------- + +%macro PRED8x8_TM_MMX 1 +cglobal pred8x8_tm_vp8_%1, 2,6 + sub r0, r1 + pxor mm7, mm7 + movq mm0, [r0] + movq mm1, mm0 + punpcklbw mm0, mm7 + punpckhbw mm1, mm7 + movzx r4d, byte [r0-1] + mov r5d, 4 +.loop: + movzx r2d, byte [r0+r1*1-1] + movzx r3d, byte [r0+r1*2-1] + sub r2d, r4d + sub r3d, r4d + movd mm2, r2d + movd mm4, r3d +%ifidn %1, mmx + punpcklwd mm2, mm2 + punpcklwd mm4, mm4 + punpckldq mm2, mm2 + punpckldq mm4, mm4 +%else + pshufw mm2, mm2, 0 + pshufw mm4, mm4, 0 +%endif + movq mm3, mm2 + movq mm5, mm4 + paddw mm2, mm0 + paddw mm3, mm1 + paddw mm4, mm0 + paddw mm5, mm1 + packuswb mm2, mm3 + packuswb mm4, mm5 + movq [r0+r1*1], mm2 + movq [r0+r1*2], mm4 + lea r0, [r0+r1*2] + dec r5d + jg .loop + REP_RET +%endmacro + +PRED8x8_TM_MMX mmx +PRED8x8_TM_MMX mmxext + +cglobal pred8x8_tm_vp8_sse2, 2,6,4 + sub r0, r1 + pxor xmm1, xmm1 + movq xmm0, [r0] + punpcklbw xmm0, xmm1 + movzx r4d, byte [r0-1] + mov r5d, 4 +.loop: + movzx r2d, byte [r0+r1*1-1] + movzx r3d, byte [r0+r1*2-1] + sub r2d, r4d + sub r3d, r4d + movd xmm2, r2d + movd xmm3, r3d + pshuflw xmm2, xmm2, 0 + pshuflw xmm3, xmm3, 0 + punpcklqdq xmm2, xmm2 + punpcklqdq xmm3, xmm3 + paddw xmm2, xmm0 + paddw xmm3, xmm0 + packuswb xmm2, xmm3 + movq [r0+r1*1], xmm2 + movhps [r0+r1*2], xmm2 + lea r0, [r0+r1*2] + dec r5d + jg .loop + REP_RET + +cglobal pred8x8_tm_vp8_ssse3, 2,3,6 + sub r0, r1 + movdqa xmm4, [tm_shuf] + pxor xmm1, xmm1 + movq xmm0, [r0] + punpcklbw xmm0, xmm1 + movd xmm5, [r0-4] + pshufb xmm5, xmm4 + mov r2d, 4 +.loop: + movd xmm2, [r0+r1*1-4] + movd xmm3, [r0+r1*2-4] + pshufb xmm2, xmm4 + pshufb xmm3, xmm4 + psubw xmm2, xmm5 + psubw xmm3, xmm5 + paddw xmm2, xmm0 + paddw xmm3, xmm0 + packuswb xmm2, xmm3 + movq [r0+r1*1], xmm2 + movhps [r0+r1*2], xmm2 + lea r0, [r0+r1*2] + dec r2d + jg .loop + REP_RET + +; dest, left, right, src, tmp +; output: %1 = (t[n-1] + t[n]*2 + t[n+1] + 2) >> 2 +%macro PRED4x4_LOWPASS 5 + mova %5, %2 + pavgb %2, %3 + pxor %3, %5 + mova %1, %4 + pand %3, [pb_1] + psubusb %2, %3 + pavgb %1, %2 +%endmacro + +;----------------------------------------------------------------------------- +; void pred8x8l_top_dc(uint8_t *src, int has_topleft, int has_topright, int stride) +;----------------------------------------------------------------------------- +%ifdef CONFIG_GPL +%macro PRED8x8L_TOP_DC 1 +cglobal pred8x8l_top_dc_%1, 4,4 + sub r0, r3 + pxor mm7, mm7 + movq mm0, [r0-8] + movq mm3, [r0] + movq mm1, [r0+8] + movq mm2, mm3 + movq mm4, mm3 + PALIGNR mm2, mm0, 7, mm0 + PALIGNR mm1, mm4, 1, mm4 + test r1, r1 ; top_left + jz .fix_lt_2 + test r2, r2 ; top_right + jz .fix_tr_1 + jmp .body +.fix_lt_2: + movq mm5, mm3 + pxor mm5, mm2 + psllq mm5, 56 + psrlq mm5, 56 + pxor mm2, mm5 + test r2, r2 ; top_right + jnz .body +.fix_tr_1: + movq mm5, mm3 + pxor mm5, mm1 + psrlq mm5, 56 + psllq mm5, 56 + pxor mm1, mm5 +.body + PRED4x4_LOWPASS mm0, mm2, mm1, mm3, mm5 + psadbw mm7, mm0 + paddw mm7, [pw_4] + psrlw mm7, 3 + pshufw mm7, mm7, 0 + packuswb mm7, mm7 +%rep 3 + movq [r0+r3*1], mm7 + movq [r0+r3*2], mm7 + lea r0, [r0+r3*2] +%endrep + movq [r0+r3*1], mm7 + movq [r0+r3*2], mm7 + RET +%endmacro + +INIT_MMX +%define PALIGNR PALIGNR_MMX +PRED8x8L_TOP_DC mmxext +%define PALIGNR PALIGNR_SSSE3 +PRED8x8L_TOP_DC ssse3 + +;----------------------------------------------------------------------------- +;void pred8x8l_dc(uint8_t *src, int has_topleft, int has_topright, int stride) +;----------------------------------------------------------------------------- + +%macro PRED8x8L_DC 1 +cglobal pred8x8l_dc_%1, 4,5 + sub r0, r3 + lea r4, [r0+r3*2] + movq mm0, [r0+r3*1-8] + punpckhbw mm0, [r0+r3*0-8] + movq mm1, [r4+r3*1-8] + punpckhbw mm1, [r0+r3*2-8] + mov r4, r0 + punpckhwd mm1, mm0 + lea r0, [r0+r3*4] + movq mm2, [r0+r3*1-8] + punpckhbw mm2, [r0+r3*0-8] + lea r0, [r0+r3*2] + movq mm3, [r0+r3*1-8] + punpckhbw mm3, [r0+r3*0-8] + punpckhwd mm3, mm2 + punpckhdq mm3, mm1 + lea r0, [r0+r3*2] + movq mm0, [r0+r3*0-8] + movq mm1, [r4] + mov r0, r4 + movq mm4, mm3 + movq mm2, mm3 + PALIGNR mm4, mm0, 7, mm0 + PALIGNR mm1, mm2, 1, mm2 + test r1, r1 + jnz .do_left +.fix_lt_1: + movq mm5, mm3 + pxor mm5, mm4 + psrlq mm5, 56 + psllq mm5, 48 + pxor mm1, mm5 + jmp .do_left +.fix_lt_2: + movq mm5, mm3 + pxor mm5, mm2 + psllq mm5, 56 + psrlq mm5, 56 + pxor mm2, mm5 + test r2, r2 + jnz .body +.fix_tr_1: + movq mm5, mm3 + pxor mm5, mm1 + psrlq mm5, 56 + psllq mm5, 56 + pxor mm1, mm5 + jmp .body +.do_left: + movq mm0, mm4 + PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5 + movq mm4, mm0 + movq mm7, mm2 + PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5 + psllq mm1, 56 + PALIGNR mm7, mm1, 7, mm3 + movq mm0, [r0-8] + movq mm3, [r0] + movq mm1, [r0+8] + movq mm2, mm3 + movq mm4, mm3 + PALIGNR mm2, mm0, 7, mm0 + PALIGNR mm1, mm4, 1, mm4 + test r1, r1 + jz .fix_lt_2 + test r2, r2 + jz .fix_tr_1 +.body + lea r1, [r0+r3*2] + PRED4x4_LOWPASS mm6, mm2, mm1, mm3, mm5 + pxor mm0, mm0 + pxor mm1, mm1 + lea r2, [r1+r3*2] + psadbw mm0, mm7 + psadbw mm1, mm6 + paddw mm0, [pw_8] + paddw mm0, mm1 + lea r4, [r2+r3*2] + psrlw mm0, 4 + pshufw mm0, mm0, 0 + packuswb mm0, mm0 + movq [r0+r3*1], mm0 + movq [r0+r3*2], mm0 + movq [r1+r3*1], mm0 + movq [r1+r3*2], mm0 + movq [r2+r3*1], mm0 + movq [r2+r3*2], mm0 + movq [r4+r3*1], mm0 + movq [r4+r3*2], mm0 + RET +%endmacro +INIT_MMX +%define PALIGNR PALIGNR_MMX +PRED8x8L_DC mmxext +%define PALIGNR PALIGNR_SSSE3 +PRED8x8L_DC ssse3 + +;----------------------------------------------------------------------------- +; void pred8x8l_horizontal(uint8_t *src, int has_topleft, int has_topright, int stride) +;----------------------------------------------------------------------------- + +%macro PRED8x8L_HORIZONTAL 1 +cglobal pred8x8l_horizontal_%1, 4,4 + sub r0, r3 + lea r2, [r0+r3*2] + movq mm0, [r0+r3*1-8] + test r1, r1 + lea r1, [r0+r3] + cmovnz r1, r0 + punpckhbw mm0, [r1+r3*0-8] + movq mm1, [r2+r3*1-8] + punpckhbw mm1, [r0+r3*2-8] + mov r2, r0 + punpckhwd mm1, mm0 + lea r0, [r0+r3*4] + movq mm2, [r0+r3*1-8] + punpckhbw mm2, [r0+r3*0-8] + lea r0, [r0+r3*2] + movq mm3, [r0+r3*1-8] + punpckhbw mm3, [r0+r3*0-8] + punpckhwd mm3, mm2 + punpckhdq mm3, mm1 + lea r0, [r0+r3*2] + movq mm0, [r0+r3*0-8] + movq mm1, [r1+r3*0-8] + mov r0, r2 + movq mm4, mm3 + movq mm2, mm3 + PALIGNR mm4, mm0, 7, mm0 + PALIGNR mm1, mm2, 1, mm2 + movq mm0, mm4 + PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5 + movq mm4, mm0 + movq mm7, mm2 + PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5 + psllq mm1, 56 + PALIGNR mm7, mm1, 7, mm3 + movq mm3, mm7 + lea r1, [r0+r3*2] + movq mm7, mm3 + punpckhbw mm3, mm3 + punpcklbw mm7, mm7 + pshufw mm0, mm3, 0xff + pshufw mm1, mm3, 0xaa + lea r2, [r1+r3*2] + pshufw mm2, mm3, 0x55 + pshufw mm3, mm3, 0x00 + pshufw mm4, mm7, 0xff + pshufw mm5, mm7, 0xaa + pshufw mm6, mm7, 0x55 + pshufw mm7, mm7, 0x00 + movq [r0+r3*1], mm0 + movq [r0+r3*2], mm1 + movq [r1+r3*1], mm2 + movq [r1+r3*2], mm3 + movq [r2+r3*1], mm4 + movq [r2+r3*2], mm5 + lea r0, [r2+r3*2] + movq [r0+r3*1], mm6 + movq [r0+r3*2], mm7 + RET +%endmacro + +INIT_MMX +%define PALIGNR PALIGNR_MMX +PRED8x8L_HORIZONTAL mmxext +%define PALIGNR PALIGNR_SSSE3 +PRED8x8L_HORIZONTAL ssse3 + +;----------------------------------------------------------------------------- +; void pred8x8l_vertical(uint8_t *src, int has_topleft, int has_topright, int stride) +;----------------------------------------------------------------------------- + +%macro PRED8x8L_VERTICAL 1 +cglobal pred8x8l_vertical_%1, 4,4 + sub r0, r3 + movq mm0, [r0-8] + movq mm3, [r0] + movq mm1, [r0+8] + movq mm2, mm3 + movq mm4, mm3 + PALIGNR mm2, mm0, 7, mm0 + PALIGNR mm1, mm4, 1, mm4 + test r1, r1 ; top_left + jz .fix_lt_2 + test r2, r2 ; top_right + jz .fix_tr_1 + jmp .body +.fix_lt_2: + movq mm5, mm3 + pxor mm5, mm2 + psllq mm5, 56 + psrlq mm5, 56 + pxor mm2, mm5 + test r2, r2 ; top_right + jnz .body +.fix_tr_1: + movq mm5, mm3 + pxor mm5, mm1 + psrlq mm5, 56 + psllq mm5, 56 + pxor mm1, mm5 +.body + PRED4x4_LOWPASS mm0, mm2, mm1, mm3, mm5 +%rep 3 + movq [r0+r3*1], mm0 + movq [r0+r3*2], mm0 + lea r0, [r0+r3*2] +%endrep + movq [r0+r3*1], mm0 + movq [r0+r3*2], mm0 + RET +%endmacro + +INIT_MMX +%define PALIGNR PALIGNR_MMX +PRED8x8L_VERTICAL mmxext +%define PALIGNR PALIGNR_SSSE3 +PRED8x8L_VERTICAL ssse3 + +;----------------------------------------------------------------------------- +;void pred8x8l_down_left(uint8_t *src, int has_topleft, int has_topright, int stride) +;----------------------------------------------------------------------------- + +INIT_MMX +%define PALIGNR PALIGNR_MMX +cglobal pred8x8l_down_left_mmxext, 4,5 + sub r0, r3 + movq mm0, [r0-8] + movq mm3, [r0] + movq mm1, [r0+8] + movq mm2, mm3 + movq mm4, mm3 + PALIGNR mm2, mm0, 7, mm0 + PALIGNR mm1, mm4, 1, mm4 + test r1, r1 + jz .fix_lt_2 + test r2, r2 + jz .fix_tr_1 + jmp .do_top +.fix_lt_2: + movq mm5, mm3 + pxor mm5, mm2 + psllq mm5, 56 + psrlq mm5, 56 + pxor mm2, mm5 + test r2, r2 + jnz .do_top +.fix_tr_1: + movq mm5, mm3 + pxor mm5, mm1 + psrlq mm5, 56 + psllq mm5, 56 + pxor mm1, mm5 + jmp .do_top +.fix_tr_2: + punpckhbw mm3, mm3 + pshufw mm1, mm3, 0xFF + jmp .do_topright +.do_top: + PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5 + movq mm7, mm4 + test r2, r2 + jz .fix_tr_2 + movq mm0, [r0+8] + movq mm5, mm0 + movq mm2, mm0 + movq mm4, mm0 + psrlq mm5, 56 + PALIGNR mm2, mm3, 7, mm3 + PALIGNR mm5, mm4, 1, mm4 + PRED4x4_LOWPASS mm1, mm2, mm5, mm0, mm4 +.do_topright: + lea r1, [r0+r3*2] + movq mm6, mm1 + psrlq mm1, 56 + movq mm4, mm1 + lea r2, [r1+r3*2] + movq mm2, mm6 + PALIGNR mm2, mm7, 1, mm0 + movq mm3, mm6 + PALIGNR mm3, mm7, 7, mm0 + PALIGNR mm4, mm6, 1, mm0 + movq mm5, mm7 + movq mm1, mm7 + movq mm7, mm6 + lea r4, [r2+r3*2] + psllq mm1, 8 + PRED4x4_LOWPASS mm0, mm1, mm2, mm5, mm6 + PRED4x4_LOWPASS mm1, mm3, mm4, mm7, mm6 + movq [r4+r3*2], mm1 + movq mm2, mm0 + psllq mm1, 8 + psrlq mm2, 56 + psllq mm0, 8 + por mm1, mm2 + movq [r4+r3*1], mm1 + movq mm2, mm0 + psllq mm1, 8 + psrlq mm2, 56 + psllq mm0, 8 + por mm1, mm2 + movq [r2+r3*2], mm1 + movq mm2, mm0 + psllq mm1, 8 + psrlq mm2, 56 + psllq mm0, 8 + por mm1, mm2 + movq [r2+r3*1], mm1 + movq mm2, mm0 + psllq mm1, 8 + psrlq mm2, 56 + psllq mm0, 8 + por mm1, mm2 + movq [r1+r3*2], mm1 + movq mm2, mm0 + psllq mm1, 8 + psrlq mm2, 56 + psllq mm0, 8 + por mm1, mm2 + movq [r1+r3*1], mm1 + movq mm2, mm0 + psllq mm1, 8 + psrlq mm2, 56 + psllq mm0, 8 + por mm1, mm2 + movq [r0+r3*2], mm1 + psllq mm1, 8 + psrlq mm0, 56 + por mm1, mm0 + movq [r0+r3*1], mm1 + RET + +%macro PRED8x8L_DOWN_LEFT 1 +cglobal pred8x8l_down_left_%1, 4,4 + sub r0, r3 + movq mm0, [r0-8] + movq mm3, [r0] + movq mm1, [r0+8] + movq mm2, mm3 + movq mm4, mm3 + PALIGNR mm2, mm0, 7, mm0 + PALIGNR mm1, mm4, 1, mm4 + test r1, r1 ; top_left + jz .fix_lt_2 + test r2, r2 ; top_right + jz .fix_tr_1 + jmp .do_top +.fix_lt_2: + movq mm5, mm3 + pxor mm5, mm2 + psllq mm5, 56 + psrlq mm5, 56 + pxor mm2, mm5 + test r2, r2 ; top_right + jnz .do_top +.fix_tr_1: + movq mm5, mm3 + pxor mm5, mm1 + psrlq mm5, 56 + psllq mm5, 56 + pxor mm1, mm5 + jmp .do_top +.fix_tr_2: + punpckhbw mm3, mm3 + pshufw mm1, mm3, 0xFF + jmp .do_topright +.do_top: + PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5 + movq2dq xmm3, mm4 + test r2, r2 ; top_right + jz .fix_tr_2 + movq mm0, [r0+8] + movq mm5, mm0 + movq mm2, mm0 + movq mm4, mm0 + psrlq mm5, 56 + PALIGNR mm2, mm3, 7, mm3 + PALIGNR mm5, mm4, 1, mm4 + PRED4x4_LOWPASS mm1, mm2, mm5, mm0, mm4 +.do_topright: + movq2dq xmm4, mm1 + psrlq mm1, 56 + movq2dq xmm5, mm1 + lea r1, [r0+r3*2] + pslldq xmm4, 8 + por xmm3, xmm4 + movdqa xmm2, xmm3 + psrldq xmm2, 1 + pslldq xmm5, 15 + por xmm2, xmm5 + lea r2, [r1+r3*2] + movdqa xmm1, xmm3 + pslldq xmm1, 1 +INIT_XMM + PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm3, xmm4 + psrldq xmm0, 1 + movq [r0+r3*1], xmm0 + psrldq xmm0, 1 + movq [r0+r3*2], xmm0 + psrldq xmm0, 1 + lea r0, [r2+r3*2] + movq [r1+r3*1], xmm0 + psrldq xmm0, 1 + movq [r1+r3*2], xmm0 + psrldq xmm0, 1 + movq [r2+r3*1], xmm0 + psrldq xmm0, 1 + movq [r2+r3*2], xmm0 + psrldq xmm0, 1 + movq [r0+r3*1], xmm0 + psrldq xmm0, 1 + movq [r0+r3*2], xmm0 + RET +%endmacro + +INIT_MMX +%define PALIGNR PALIGNR_MMX +PRED8x8L_DOWN_LEFT sse2 +INIT_MMX +%define PALIGNR PALIGNR_SSSE3 +PRED8x8L_DOWN_LEFT ssse3 + +;----------------------------------------------------------------------------- +;void pred8x8l_down_right_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride) +;----------------------------------------------------------------------------- + +INIT_MMX +%define PALIGNR PALIGNR_MMX +cglobal pred8x8l_down_right_mmxext, 4,5 + sub r0, r3 + lea r4, [r0+r3*2] + movq mm0, [r0+r3*1-8] + punpckhbw mm0, [r0+r3*0-8] + movq mm1, [r4+r3*1-8] + punpckhbw mm1, [r0+r3*2-8] + mov r4, r0 + punpckhwd mm1, mm0 + lea r0, [r0+r3*4] + movq mm2, [r0+r3*1-8] + punpckhbw mm2, [r0+r3*0-8] + lea r0, [r0+r3*2] + movq mm3, [r0+r3*1-8] + punpckhbw mm3, [r0+r3*0-8] + punpckhwd mm3, mm2 + punpckhdq mm3, mm1 + lea r0, [r0+r3*2] + movq mm0, [r0+r3*0-8] + movq mm1, [r4] + mov r0, r4 + movq mm4, mm3 + movq mm2, mm3 + PALIGNR mm4, mm0, 7, mm0 + PALIGNR mm1, mm2, 1, mm2 + test r1, r1 ; top_left + jz .fix_lt_1 +.do_left: + movq mm0, mm4 + PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5 + movq mm4, mm0 + movq mm7, mm2 + movq mm6, mm2 + PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5 + psllq mm1, 56 + PALIGNR mm7, mm1, 7, mm3 + movq mm0, [r0-8] + movq mm3, [r0] + movq mm1, [r0+8] + movq mm2, mm3 + movq mm4, mm3 + PALIGNR mm2, mm0, 7, mm0 + PALIGNR mm1, mm4, 1, mm4 + test r1, r1 ; top_left + jz .fix_lt_2 + test r2, r2 ; top_right + jz .fix_tr_1 +.do_top: + PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5 + movq mm5, mm4 + jmp .body +.fix_lt_1: + movq mm5, mm3 + pxor mm5, mm4 + psrlq mm5, 56 + psllq mm5, 48 + pxor mm1, mm5 + jmp .do_left +.fix_lt_2: + movq mm5, mm3 + pxor mm5, mm2 + psllq mm5, 56 + psrlq mm5, 56 + pxor mm2, mm5 + test r2, r2 ; top_right + jnz .do_top +.fix_tr_1: + movq mm5, mm3 + pxor mm5, mm1 + psrlq mm5, 56 + psllq mm5, 56 + pxor mm1, mm5 + jmp .do_top +.body + lea r1, [r0+r3*2] + movq mm1, mm7 + movq mm7, mm5 + movq mm5, mm6 + movq mm2, mm7 + lea r2, [r1+r3*2] + PALIGNR mm2, mm6, 1, mm0 + movq mm3, mm7 + PALIGNR mm3, mm6, 7, mm0 + movq mm4, mm7 + lea r4, [r2+r3*2] + psrlq mm4, 8 + PRED4x4_LOWPASS mm0, mm1, mm2, mm5, mm6 + PRED4x4_LOWPASS mm1, mm3, mm4, mm7, mm6 + movq [r4+r3*2], mm0 + movq mm2, mm1 + psrlq mm0, 8 + psllq mm2, 56 + psrlq mm1, 8 + por mm0, mm2 + movq [r4+r3*1], mm0 + movq mm2, mm1 + psrlq mm0, 8 + psllq mm2, 56 + psrlq mm1, 8 + por mm0, mm2 + movq [r2+r3*2], mm0 + movq mm2, mm1 + psrlq mm0, 8 + psllq mm2, 56 + psrlq mm1, 8 + por mm0, mm2 + movq [r2+r3*1], mm0 + movq mm2, mm1 + psrlq mm0, 8 + psllq mm2, 56 + psrlq mm1, 8 + por mm0, mm2 + movq [r1+r3*2], mm0 + movq mm2, mm1 + psrlq mm0, 8 + psllq mm2, 56 + psrlq mm1, 8 + por mm0, mm2 + movq [r1+r3*1], mm0 + movq mm2, mm1 + psrlq mm0, 8 + psllq mm2, 56 + psrlq mm1, 8 + por mm0, mm2 + movq [r0+r3*2], mm0 + psrlq mm0, 8 + psllq mm1, 56 + por mm0, mm1 + movq [r0+r3*1], mm0 + RET + +%macro PRED8x8L_DOWN_RIGHT 1 +cglobal pred8x8l_down_right_%1, 4,5 + sub r0, r3 + lea r4, [r0+r3*2] + movq mm0, [r0+r3*1-8] + punpckhbw mm0, [r0+r3*0-8] + movq mm1, [r4+r3*1-8] + punpckhbw mm1, [r0+r3*2-8] + mov r4, r0 + punpckhwd mm1, mm0 + lea r0, [r0+r3*4] + movq mm2, [r0+r3*1-8] + punpckhbw mm2, [r0+r3*0-8] + lea r0, [r0+r3*2] + movq mm3, [r0+r3*1-8] + punpckhbw mm3, [r0+r3*0-8] + punpckhwd mm3, mm2 + punpckhdq mm3, mm1 + lea r0, [r0+r3*2] + movq mm0, [r0+r3*0-8] + movq mm1, [r4] + mov r0, r4 + movq mm4, mm3 + movq mm2, mm3 + PALIGNR mm4, mm0, 7, mm0 + PALIGNR mm1, mm2, 1, mm2 + test r1, r1 + jz .fix_lt_1 + jmp .do_left +.fix_lt_1: + movq mm5, mm3 + pxor mm5, mm4 + psrlq mm5, 56 + psllq mm5, 48 + pxor mm1, mm5 + jmp .do_left +.fix_lt_2: + movq mm5, mm3 + pxor mm5, mm2 + psllq mm5, 56 + psrlq mm5, 56 + pxor mm2, mm5 + test r2, r2 + jnz .do_top +.fix_tr_1: + movq mm5, mm3 + pxor mm5, mm1 + psrlq mm5, 56 + psllq mm5, 56 + pxor mm1, mm5 + jmp .do_top +.do_left: + movq mm0, mm4 + PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5 + movq mm4, mm0 + movq mm7, mm2 + movq2dq xmm3, mm2 + PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5 + psllq mm1, 56 + PALIGNR mm7, mm1, 7, mm3 + movq2dq xmm1, mm7 + movq mm0, [r0-8] + movq mm3, [r0] + movq mm1, [r0+8] + movq mm2, mm3 + movq mm4, mm3 + PALIGNR mm2, mm0, 7, mm0 + PALIGNR mm1, mm4, 1, mm4 + test r1, r1 + jz .fix_lt_2 + test r2, r2 + jz .fix_tr_1 +.do_top: + PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5 + movq2dq xmm4, mm4 + lea r1, [r0+r3*2] + movdqa xmm0, xmm3 + pslldq xmm4, 8 + por xmm3, xmm4 + lea r2, [r1+r3*2] + pslldq xmm4, 1 + por xmm1, xmm4 + psrldq xmm0, 7 + pslldq xmm0, 15 + psrldq xmm0, 7 + por xmm1, xmm0 + lea r0, [r2+r3*2] + movdqa xmm2, xmm3 + psrldq xmm2, 1 +INIT_XMM + PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm3, xmm4 + movdqa xmm1, xmm0 + psrldq xmm1, 1 + movq [r0+r3*2], xmm0 + movq [r0+r3*1], xmm1 + psrldq xmm0, 2 + psrldq xmm1, 2 + movq [r2+r3*2], xmm0 + movq [r2+r3*1], xmm1 + psrldq xmm0, 2 + psrldq xmm1, 2 + movq [r1+r3*2], xmm0 + movq [r1+r3*1], xmm1 + psrldq xmm0, 2 + psrldq xmm1, 2 + movq [r4+r3*2], xmm0 + movq [r4+r3*1], xmm1 + RET +%endmacro + +INIT_MMX +%define PALIGNR PALIGNR_MMX +PRED8x8L_DOWN_RIGHT sse2 +INIT_MMX +%define PALIGNR PALIGNR_SSSE3 +PRED8x8L_DOWN_RIGHT ssse3 + +;----------------------------------------------------------------------------- +; void pred8x8l_vertical_right(uint8_t *src, int has_topleft, int has_topright, int stride) +;----------------------------------------------------------------------------- + +INIT_MMX +%define PALIGNR PALIGNR_MMX +cglobal pred8x8l_vertical_right_mmxext, 4,5 + sub r0, r3 + lea r4, [r0+r3*2] + movq mm0, [r0+r3*1-8] + punpckhbw mm0, [r0+r3*0-8] + movq mm1, [r4+r3*1-8] + punpckhbw mm1, [r0+r3*2-8] + mov r4, r0 + punpckhwd mm1, mm0 + lea r0, [r0+r3*4] + movq mm2, [r0+r3*1-8] + punpckhbw mm2, [r0+r3*0-8] + lea r0, [r0+r3*2] + movq mm3, [r0+r3*1-8] + punpckhbw mm3, [r0+r3*0-8] + punpckhwd mm3, mm2 + punpckhdq mm3, mm1 + lea r0, [r0+r3*2] + movq mm0, [r0+r3*0-8] + movq mm1, [r4] + mov r0, r4 + movq mm4, mm3 + movq mm2, mm3 + PALIGNR mm4, mm0, 7, mm0 + PALIGNR mm1, mm2, 1, mm2 + test r1, r1 + jz .fix_lt_1 + jmp .do_left +.fix_lt_1: + movq mm5, mm3 + pxor mm5, mm4 + psrlq mm5, 56 + psllq mm5, 48 + pxor mm1, mm5 + jmp .do_left +.fix_lt_2: + movq mm5, mm3 + pxor mm5, mm2 + psllq mm5, 56 + psrlq mm5, 56 + pxor mm2, mm5 + test r2, r2 + jnz .do_top +.fix_tr_1: + movq mm5, mm3 + pxor mm5, mm1 + psrlq mm5, 56 + psllq mm5, 56 + pxor mm1, mm5 + jmp .do_top +.do_left: + movq mm0, mm4 + PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5 + movq mm7, mm2 + movq mm0, [r0-8] + movq mm3, [r0] + movq mm1, [r0+8] + movq mm2, mm3 + movq mm4, mm3 + PALIGNR mm2, mm0, 7, mm0 + PALIGNR mm1, mm4, 1, mm4 + test r1, r1 + jz .fix_lt_2 + test r2, r2 + jz .fix_tr_1 +.do_top + PRED4x4_LOWPASS mm6, mm2, mm1, mm3, mm5 + lea r1, [r0+r3*2] + movq mm2, mm6 + movq mm3, mm6 + PALIGNR mm3, mm7, 7, mm0 + PALIGNR mm6, mm7, 6, mm1 + movq mm4, mm3 + pavgb mm3, mm2 + lea r2, [r1+r3*2] + PRED4x4_LOWPASS mm0, mm6, mm2, mm4, mm5 + movq [r0+r3*1], mm3 + movq [r0+r3*2], mm0 + movq mm5, mm0 + movq mm6, mm3 + movq mm1, mm7 + movq mm2, mm1 + psllq mm2, 8 + movq mm3, mm1 + psllq mm3, 16 + lea r4, [r2+r3*2] + PRED4x4_LOWPASS mm0, mm1, mm3, mm2, mm4 + PALIGNR mm6, mm0, 7, mm2 + movq [r1+r3*1], mm6 + psllq mm0, 8 + PALIGNR mm5, mm0, 7, mm1 + movq [r1+r3*2], mm5 + psllq mm0, 8 + PALIGNR mm6, mm0, 7, mm2 + movq [r2+r3*1], mm6 + psllq mm0, 8 + PALIGNR mm5, mm0, 7, mm1 + movq [r2+r3*2], mm5 + psllq mm0, 8 + PALIGNR mm6, mm0, 7, mm2 + movq [r4+r3*1], mm6 + psllq mm0, 8 + PALIGNR mm5, mm0, 7, mm1 + movq [r4+r3*2], mm5 + RET + +%macro PRED8x8L_VERTICAL_RIGHT 1 +cglobal pred8x8l_vertical_right_%1, 4,5,7 + sub r0, r3 + lea r4, [r0+r3*2] + movq mm0, [r0+r3*1-8] + punpckhbw mm0, [r0+r3*0-8] + movq mm1, [r4+r3*1-8] + punpckhbw mm1, [r0+r3*2-8] + mov r4, r0 + punpckhwd mm1, mm0 + lea r0, [r0+r3*4] + movq mm2, [r0+r3*1-8] + punpckhbw mm2, [r0+r3*0-8] + lea r0, [r0+r3*2] + movq mm3, [r0+r3*1-8] + punpckhbw mm3, [r0+r3*0-8] + punpckhwd mm3, mm2 + punpckhdq mm3, mm1 + lea r0, [r0+r3*2] + movq mm0, [r0+r3*0-8] + movq mm1, [r4] + mov r0, r4 + movq mm4, mm3 + movq mm2, mm3 + PALIGNR mm4, mm0, 7, mm0 + PALIGNR mm1, mm2, 1, mm2 + test r1, r1 + jnz .do_left +.fix_lt_1: + movq mm5, mm3 + pxor mm5, mm4 + psrlq mm5, 56 + psllq mm5, 48 + pxor mm1, mm5 + jmp .do_left +.fix_lt_2: + movq mm5, mm3 + pxor mm5, mm2 + psllq mm5, 56 + psrlq mm5, 56 + pxor mm2, mm5 + test r2, r2 + jnz .do_top +.fix_tr_1: + movq mm5, mm3 + pxor mm5, mm1 + psrlq mm5, 56 + psllq mm5, 56 + pxor mm1, mm5 + jmp .do_top +.do_left: + movq mm0, mm4 + PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5 + movq2dq xmm0, mm2 + movq mm0, [r0-8] + movq mm3, [r0] + movq mm1, [r0+8] + movq mm2, mm3 + movq mm4, mm3 + PALIGNR mm2, mm0, 7, mm0 + PALIGNR mm1, mm4, 1, mm4 + test r1, r1 + jz .fix_lt_2 + test r2, r2 + jz .fix_tr_1 +.do_top + PRED4x4_LOWPASS mm6, mm2, mm1, mm3, mm5 + lea r1, [r0+r3*2] + movq2dq xmm4, mm6 + pslldq xmm4, 8 + por xmm0, xmm4 + movdqa xmm6, [pw_ff00] + movdqa xmm1, xmm0 + lea r2, [r1+r3*2] + movdqa xmm2, xmm0 + movdqa xmm3, xmm0 + pslldq xmm0, 1 + pslldq xmm1, 2 + pavgb xmm2, xmm0 +INIT_XMM + PRED4x4_LOWPASS xmm4, xmm3, xmm1, xmm0, xmm5 + pandn xmm6, xmm4 + movdqa xmm5, xmm4 + psrlw xmm4, 8 + packuswb xmm6, xmm4 + movhlps xmm4, xmm6 + movhps [r0+r3*2], xmm5 + movhps [r0+r3*1], xmm2 + psrldq xmm5, 4 + movss xmm5, xmm6 + psrldq xmm2, 4 + movss xmm2, xmm4 + lea r0, [r2+r3*2] + psrldq xmm5, 1 + psrldq xmm2, 1 + movq [r0+r3*2], xmm5 + movq [r0+r3*1], xmm2 + psrldq xmm5, 1 + psrldq xmm2, 1 + movq [r2+r3*2], xmm5 + movq [r2+r3*1], xmm2 + psrldq xmm5, 1 + psrldq xmm2, 1 + movq [r1+r3*2], xmm5 + movq [r1+r3*1], xmm2 + RET +%endmacro + +INIT_MMX +%define PALIGNR PALIGNR_MMX +PRED8x8L_VERTICAL_RIGHT sse2 +INIT_MMX +%define PALIGNR PALIGNR_SSSE3 +PRED8x8L_VERTICAL_RIGHT ssse3 + +;----------------------------------------------------------------------------- +;void pred8x8l_vertical_left(uint8_t *src, int has_topleft, int has_topright, int stride) +;----------------------------------------------------------------------------- + +%macro PRED8x8L_VERTICAL_LEFT 1 +cglobal pred8x8l_vertical_left_%1, 4,4 + sub r0, r3 + movq mm0, [r0-8] + movq mm3, [r0] + movq mm1, [r0+8] + movq mm2, mm3 + movq mm4, mm3 + PALIGNR mm2, mm0, 7, mm0 + PALIGNR mm1, mm4, 1, mm4 + test r1, r1 + jz .fix_lt_2 + test r2, r2 + jz .fix_tr_1 + jmp .do_top +.fix_lt_2: + movq mm5, mm3 + pxor mm5, mm2 + psllq mm5, 56 + psrlq mm5, 56 + pxor mm2, mm5 + test r2, r2 + jnz .do_top +.fix_tr_1: + movq mm5, mm3 + pxor mm5, mm1 + psrlq mm5, 56 + psllq mm5, 56 + pxor mm1, mm5 + jmp .do_top +.fix_tr_2: + punpckhbw mm3, mm3 + pshufw mm1, mm3, 0xFF + jmp .do_topright +.do_top: + PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5 + movq2dq xmm4, mm4 + test r2, r2 + jz .fix_tr_2 + movq mm0, [r0+8] + movq mm5, mm0 + movq mm2, mm0 + movq mm4, mm0 + psrlq mm5, 56 + PALIGNR mm2, mm3, 7, mm3 + PALIGNR mm5, mm4, 1, mm4 + PRED4x4_LOWPASS mm1, mm2, mm5, mm0, mm4 +.do_topright: + movq2dq xmm3, mm1 + lea r1, [r0+r3*2] + pslldq xmm3, 8 + por xmm4, xmm3 + movdqa xmm2, xmm4 + movdqa xmm1, xmm4 + movdqa xmm3, xmm4 + psrldq xmm2, 1 + pslldq xmm1, 1 + pavgb xmm3, xmm2 + lea r2, [r1+r3*2] +INIT_XMM + PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm4, xmm5 + psrldq xmm0, 1 + movq [r0+r3*1], xmm3 + movq [r0+r3*2], xmm0 + lea r0, [r2+r3*2] + psrldq xmm3, 1 + psrldq xmm0, 1 + movq [r1+r3*1], xmm3 + movq [r1+r3*2], xmm0 + psrldq xmm3, 1 + psrldq xmm0, 1 + movq [r2+r3*1], xmm3 + movq [r2+r3*2], xmm0 + psrldq xmm3, 1 + psrldq xmm0, 1 + movq [r0+r3*1], xmm3 + movq [r0+r3*2], xmm0 + RET +%endmacro + +INIT_MMX +%define PALIGNR PALIGNR_MMX +PRED8x8L_VERTICAL_LEFT sse2 +%define PALIGNR PALIGNR_SSSE3 +INIT_MMX +PRED8x8L_VERTICAL_LEFT ssse3 + +;----------------------------------------------------------------------------- +; void pred8x8l_horizontal_up(uint8_t *src, int has_topleft, int has_topright, int stride) +;----------------------------------------------------------------------------- + +%macro PRED8x8L_HORIZONTAL_UP 1 +cglobal pred8x8l_horizontal_up_%1, 4,4 + sub r0, r3 + lea r2, [r0+r3*2] + movq mm0, [r0+r3*1-8] + test r1, r1 + lea r1, [r0+r3] + cmovnz r1, r0 + punpckhbw mm0, [r1+r3*0-8] + movq mm1, [r2+r3*1-8] + punpckhbw mm1, [r0+r3*2-8] + mov r2, r0 + punpckhwd mm1, mm0 + lea r0, [r0+r3*4] + movq mm2, [r0+r3*1-8] + punpckhbw mm2, [r0+r3*0-8] + lea r0, [r0+r3*2] + movq mm3, [r0+r3*1-8] + punpckhbw mm3, [r0+r3*0-8] + punpckhwd mm3, mm2 + punpckhdq mm3, mm1 + lea r0, [r0+r3*2] + movq mm0, [r0+r3*0-8] + movq mm1, [r1+r3*0-8] + mov r0, r2 + movq mm4, mm3 + movq mm2, mm3 + PALIGNR mm4, mm0, 7, mm0 + PALIGNR mm1, mm2, 1, mm2 + movq mm0, mm4 + PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5 + movq mm4, mm0 + movq mm7, mm2 + PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5 + psllq mm1, 56 + PALIGNR mm7, mm1, 7, mm3 + lea r1, [r0+r3*2] + pshufw mm0, mm7, 00011011b ; l6 l7 l4 l5 l2 l3 l0 l1 + psllq mm7, 56 ; l7 .. .. .. .. .. .. .. + movq mm2, mm0 + psllw mm0, 8 + psrlw mm2, 8 + por mm2, mm0 ; l7 l6 l5 l4 l3 l2 l1 l0 + movq mm3, mm2 + movq mm4, mm2 + movq mm5, mm2 + psrlq mm2, 8 + psrlq mm3, 16 + lea r2, [r1+r3*2] + por mm2, mm7 ; l7 l7 l6 l5 l4 l3 l2 l1 + punpckhbw mm7, mm7 + por mm3, mm7 ; l7 l7 l7 l6 l5 l4 l3 l2 + pavgb mm4, mm2 + PRED4x4_LOWPASS mm1, mm3, mm5, mm2, mm6 + movq mm5, mm4 + punpcklbw mm4, mm1 ; p4 p3 p2 p1 + punpckhbw mm5, mm1 ; p8 p7 p6 p5 + movq mm6, mm5 + movq mm7, mm5 + movq mm0, mm5 + PALIGNR mm5, mm4, 2, mm1 + pshufw mm1, mm6, 11111001b + PALIGNR mm6, mm4, 4, mm2 + pshufw mm2, mm7, 11111110b + PALIGNR mm7, mm4, 6, mm3 + pshufw mm3, mm0, 11111111b + movq [r0+r3*1], mm4 + movq [r0+r3*2], mm5 + lea r0, [r2+r3*2] + movq [r1+r3*1], mm6 + movq [r1+r3*2], mm7 + movq [r2+r3*1], mm0 + movq [r2+r3*2], mm1 + movq [r0+r3*1], mm2 + movq [r0+r3*2], mm3 + RET +%endmacro + +INIT_MMX +%define PALIGNR PALIGNR_MMX +PRED8x8L_HORIZONTAL_UP mmxext +%define PALIGNR PALIGNR_SSSE3 +PRED8x8L_HORIZONTAL_UP ssse3 + +;----------------------------------------------------------------------------- +;void pred8x8l_horizontal_down(uint8_t *src, int has_topleft, int has_topright, int stride) +;----------------------------------------------------------------------------- + +INIT_MMX +%define PALIGNR PALIGNR_MMX +cglobal pred8x8l_horizontal_down_mmxext, 4,5 + sub r0, r3 + lea r4, [r0+r3*2] + movq mm0, [r0+r3*1-8] + punpckhbw mm0, [r0+r3*0-8] + movq mm1, [r4+r3*1-8] + punpckhbw mm1, [r0+r3*2-8] + mov r4, r0 + punpckhwd mm1, mm0 + lea r0, [r0+r3*4] + movq mm2, [r0+r3*1-8] + punpckhbw mm2, [r0+r3*0-8] + lea r0, [r0+r3*2] + movq mm3, [r0+r3*1-8] + punpckhbw mm3, [r0+r3*0-8] + punpckhwd mm3, mm2 + punpckhdq mm3, mm1 + lea r0, [r0+r3*2] + movq mm0, [r0+r3*0-8] + movq mm1, [r4] + mov r0, r4 + movq mm4, mm3 + movq mm2, mm3 + PALIGNR mm4, mm0, 7, mm0 + PALIGNR mm1, mm2, 1, mm2 + test r1, r1 + jnz .do_left +.fix_lt_1: + movq mm5, mm3 + pxor mm5, mm4 + psrlq mm5, 56 + psllq mm5, 48 + pxor mm1, mm5 + jmp .do_left +.fix_lt_2: + movq mm5, mm3 + pxor mm5, mm2 + psllq mm5, 56 + psrlq mm5, 56 + pxor mm2, mm5 + test r2, r2 + jnz .do_top +.fix_tr_1: + movq mm5, mm3 + pxor mm5, mm1 + psrlq mm5, 56 + psllq mm5, 56 + pxor mm1, mm5 + jmp .do_top +.do_left: + movq mm0, mm4 + PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5 + movq mm4, mm0 + movq mm7, mm2 + movq mm6, mm2 + PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5 + psllq mm1, 56 + PALIGNR mm7, mm1, 7, mm3 + movq mm0, [r0-8] + movq mm3, [r0] + movq mm1, [r0+8] + movq mm2, mm3 + movq mm4, mm3 + PALIGNR mm2, mm0, 7, mm0 + PALIGNR mm1, mm4, 1, mm4 + test r1, r1 + jz .fix_lt_2 + test r2, r2 + jz .fix_tr_1 +.do_top: + PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5 + movq mm5, mm4 + lea r1, [r0+r3*2] + psllq mm7, 56 + movq mm2, mm5 + movq mm3, mm6 + movq mm4, mm2 + PALIGNR mm2, mm6, 7, mm5 + PALIGNR mm6, mm7, 7, mm0 + lea r2, [r1+r3*2] + PALIGNR mm4, mm3, 1, mm7 + movq mm5, mm3 + pavgb mm3, mm6 + PRED4x4_LOWPASS mm0, mm4, mm6, mm5, mm7 + movq mm4, mm2 + movq mm1, mm2 + lea r4, [r2+r3*2] + psrlq mm4, 16 + psrlq mm1, 8 + PRED4x4_LOWPASS mm6, mm4, mm2, mm1, mm5 + movq mm7, mm3 + punpcklbw mm3, mm0 + punpckhbw mm7, mm0 + movq mm1, mm7 + movq mm0, mm7 + movq mm4, mm7 + movq [r4+r3*2], mm3 + PALIGNR mm7, mm3, 2, mm5 + movq [r4+r3*1], mm7 + PALIGNR mm1, mm3, 4, mm5 + movq [r2+r3*2], mm1 + PALIGNR mm0, mm3, 6, mm3 + movq [r2+r3*1], mm0 + movq mm2, mm6 + movq mm3, mm6 + movq [r1+r3*2], mm4 + PALIGNR mm6, mm4, 2, mm5 + movq [r1+r3*1], mm6 + PALIGNR mm2, mm4, 4, mm5 + movq [r0+r3*2], mm2 + PALIGNR mm3, mm4, 6, mm4 + movq [r0+r3*1], mm3 + RET + +%macro PRED8x8L_HORIZONTAL_DOWN 1 +cglobal pred8x8l_horizontal_down_%1, 4,5 + sub r0, r3 + lea r4, [r0+r3*2] + movq mm0, [r0+r3*1-8] + punpckhbw mm0, [r0+r3*0-8] + movq mm1, [r4+r3*1-8] + punpckhbw mm1, [r0+r3*2-8] + mov r4, r0 + punpckhwd mm1, mm0 + lea r0, [r0+r3*4] + movq mm2, [r0+r3*1-8] + punpckhbw mm2, [r0+r3*0-8] + lea r0, [r0+r3*2] + movq mm3, [r0+r3*1-8] + punpckhbw mm3, [r0+r3*0-8] + punpckhwd mm3, mm2 + punpckhdq mm3, mm1 + lea r0, [r0+r3*2] + movq mm0, [r0+r3*0-8] + movq mm1, [r4] + mov r0, r4 + movq mm4, mm3 + movq mm2, mm3 + PALIGNR mm4, mm0, 7, mm0 + PALIGNR mm1, mm2, 1, mm2 + test r1, r1 + jnz .do_left +.fix_lt_1: + movq mm5, mm3 + pxor mm5, mm4 + psrlq mm5, 56 + psllq mm5, 48 + pxor mm1, mm5 + jmp .do_left +.fix_lt_2: + movq mm5, mm3 + pxor mm5, mm2 + psllq mm5, 56 + psrlq mm5, 56 + pxor mm2, mm5 + test r2, r2 + jnz .do_top +.fix_tr_1: + movq mm5, mm3 + pxor mm5, mm1 + psrlq mm5, 56 + psllq mm5, 56 + pxor mm1, mm5 + jmp .do_top +.fix_tr_2: + punpckhbw mm3, mm3 + pshufw mm1, mm3, 0xFF + jmp .do_topright +.do_left: + movq mm0, mm4 + PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5 + movq2dq xmm0, mm2 + pslldq xmm0, 8 + movq mm4, mm0 + PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5 + movq2dq xmm2, mm1 + pslldq xmm2, 15 + psrldq xmm2, 8 + por xmm0, xmm2 + movq mm0, [r0-8] + movq mm3, [r0] + movq mm1, [r0+8] + movq mm2, mm3 + movq mm4, mm3 + PALIGNR mm2, mm0, 7, mm0 + PALIGNR mm1, mm4, 1, mm4 + test r1, r1 + jz .fix_lt_2 + test r2, r2 + jz .fix_tr_1 +.do_top: + PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5 + movq2dq xmm1, mm4 + test r2, r2 + jz .fix_tr_2 + movq mm0, [r0+8] + movq mm5, mm0 + movq mm2, mm0 + movq mm4, mm0 + psrlq mm5, 56 + PALIGNR mm2, mm3, 7, mm3 + PALIGNR mm5, mm4, 1, mm4 + PRED4x4_LOWPASS mm1, mm2, mm5, mm0, mm4 +.do_topright: + movq2dq xmm5, mm1 + pslldq xmm5, 8 + por xmm1, xmm5 +INIT_XMM + lea r2, [r4+r3*2] + movdqa xmm2, xmm1 + movdqa xmm3, xmm1 + PALIGNR xmm1, xmm0, 7, xmm4 + PALIGNR xmm2, xmm0, 9, xmm5 + lea r1, [r2+r3*2] + PALIGNR xmm3, xmm0, 8, xmm0 + movdqa xmm4, xmm1 + pavgb xmm4, xmm3 + lea r0, [r1+r3*2] + PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm3, xmm5 + punpcklbw xmm4, xmm0 + movhlps xmm0, xmm4 + movq [r0+r3*2], xmm4 + movq [r2+r3*2], xmm0 + psrldq xmm4, 2 + psrldq xmm0, 2 + movq [r0+r3*1], xmm4 + movq [r2+r3*1], xmm0 + psrldq xmm4, 2 + psrldq xmm0, 2 + movq [r1+r3*2], xmm4 + movq [r4+r3*2], xmm0 + psrldq xmm4, 2 + psrldq xmm0, 2 + movq [r1+r3*1], xmm4 + movq [r4+r3*1], xmm0 + RET +%endmacro + +INIT_MMX +%define PALIGNR PALIGNR_MMX +PRED8x8L_HORIZONTAL_DOWN sse2 +INIT_MMX +%define PALIGNR PALIGNR_SSSE3 +PRED8x8L_HORIZONTAL_DOWN ssse3 +%endif + +;----------------------------------------------------------------------------- +; void pred4x4_dc_mmxext(uint8_t *src, const uint8_t *topright, int stride) +;----------------------------------------------------------------------------- + +cglobal pred4x4_dc_mmxext, 3,5 + pxor mm7, mm7 + mov r4, r0 + sub r0, r2 + movd mm0, [r0] + psadbw mm0, mm7 + movzx r1d, byte [r0+r2*1-1] + movd r3d, mm0 + add r3d, r1d + movzx r1d, byte [r0+r2*2-1] + lea r0, [r0+r2*2] + add r3d, r1d + movzx r1d, byte [r0+r2*1-1] + add r3d, r1d + movzx r1d, byte [r0+r2*2-1] + add r3d, r1d + add r3d, 4 + shr r3d, 3 + imul r3d, 0x01010101 + mov [r4+r2*0], r3d + mov [r0+r2*0], r3d + mov [r0+r2*1], r3d + mov [r0+r2*2], r3d + RET + +;----------------------------------------------------------------------------- +; void pred4x4_tm_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride) +;----------------------------------------------------------------------------- + +%macro PRED4x4_TM_MMX 1 +cglobal pred4x4_tm_vp8_%1, 3,6 + sub r0, r2 + pxor mm7, mm7 + movd mm0, [r0] + punpcklbw mm0, mm7 + movzx r4d, byte [r0-1] + mov r5d, 2 +.loop: + movzx r1d, byte [r0+r2*1-1] + movzx r3d, byte [r0+r2*2-1] + sub r1d, r4d + sub r3d, r4d + movd mm2, r1d + movd mm4, r3d +%ifidn %1, mmx + punpcklwd mm2, mm2 + punpcklwd mm4, mm4 + punpckldq mm2, mm2 + punpckldq mm4, mm4 +%else + pshufw mm2, mm2, 0 + pshufw mm4, mm4, 0 +%endif + paddw mm2, mm0 + paddw mm4, mm0 + packuswb mm2, mm2 + packuswb mm4, mm4 + movd [r0+r2*1], mm2 + movd [r0+r2*2], mm4 + lea r0, [r0+r2*2] + dec r5d + jg .loop + REP_RET +%endmacro + +PRED4x4_TM_MMX mmx +PRED4x4_TM_MMX mmxext + +cglobal pred4x4_tm_vp8_ssse3, 3,3 + sub r0, r2 + movq mm6, [tm_shuf] + pxor mm1, mm1 + movd mm0, [r0] + punpcklbw mm0, mm1 + movd mm7, [r0-4] + pshufb mm7, mm6 + lea r1, [r0+r2*2] + movd mm2, [r0+r2*1-4] + movd mm3, [r0+r2*2-4] + movd mm4, [r1+r2*1-4] + movd mm5, [r1+r2*2-4] + pshufb mm2, mm6 + pshufb mm3, mm6 + pshufb mm4, mm6 + pshufb mm5, mm6 + psubw mm2, mm7 + psubw mm3, mm7 + psubw mm4, mm7 + psubw mm5, mm7 + paddw mm2, mm0 + paddw mm3, mm0 + paddw mm4, mm0 + paddw mm5, mm0 + packuswb mm2, mm2 + packuswb mm3, mm3 + packuswb mm4, mm4 + packuswb mm5, mm5 + movd [r0+r2*1], mm2 + movd [r0+r2*2], mm3 + movd [r1+r2*1], mm4 + movd [r1+r2*2], mm5 + RET + +;----------------------------------------------------------------------------- +; void pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride) +;----------------------------------------------------------------------------- + +INIT_MMX +cglobal pred4x4_vertical_vp8_mmxext, 3,3 + sub r0, r2 + movd m1, [r0-1] + movd m0, [r0] + mova m2, m0 ;t0 t1 t2 t3 + punpckldq m0, [r1] ;t0 t1 t2 t3 t4 t5 t6 t7 + lea r1, [r0+r2*2] + psrlq m0, 8 ;t1 t2 t3 t4 + PRED4x4_LOWPASS m3, m1, m0, m2, m4 + movd [r0+r2*1], m3 + movd [r0+r2*2], m3 + movd [r1+r2*1], m3 + movd [r1+r2*2], m3 + RET + +;----------------------------------------------------------------------------- +; void pred4x4_down_left_mmxext(uint8_t *src, const uint8_t *topright, int stride) +;----------------------------------------------------------------------------- +%ifdef CONFIG_GPL +INIT_MMX +cglobal pred4x4_down_left_mmxext, 3,3 + sub r0, r2 + movq m1, [r0] + punpckldq m1, [r1] + movq m2, m1 + movq m3, m1 + movq m4, m1 + psllq m1, 8 + pxor m2, m1 + psrlq m2, 8 + pxor m3, m2 + PRED4x4_LOWPASS m0, m1, m3, m4, m5 + lea r1, [r0+r2*2] + psrlq m0, 8 + movd [r0+r2*1], m0 + psrlq m0, 8 + movd [r0+r2*2], m0 + psrlq m0, 8 + movd [r1+r2*1], m0 + psrlq m0, 8 + movd [r1+r2*2], m0 + RET + +;----------------------------------------------------------------------------- +; void pred4x4_vertical_left_mmxext(uint8_t *src, const uint8_t *topright, int stride) +;----------------------------------------------------------------------------- + +INIT_MMX +cglobal pred4x4_vertical_left_mmxext, 3,3 + sub r0, r2 + movq m1, [r0] + punpckldq m1, [r1] + movq m3, m1 + movq m2, m1 + psrlq m3, 8 + psrlq m2, 16 + movq m4, m3 + pavgb m4, m1 + PRED4x4_LOWPASS m0, m1, m2, m3, m5 + lea r1, [r0+r2*2] + movh [r0+r2*1], m4 + movh [r0+r2*2], m0 + psrlq m4, 8 + psrlq m0, 8 + movh [r1+r2*1], m4 + movh [r1+r2*2], m0 + RET + +;----------------------------------------------------------------------------- +; void pred4x4_horizontal_up_mmxext(uint8_t *src, const uint8_t *topright, int stride) +;----------------------------------------------------------------------------- + +INIT_MMX +cglobal pred4x4_horizontal_up_mmxext, 3,3 + sub r0, r2 + lea r1, [r0+r2*2] + movd m0, [r0+r2*1-4] + punpcklbw m0, [r0+r2*2-4] + movd m1, [r1+r2*1-4] + punpcklbw m1, [r1+r2*2-4] + punpckhwd m0, m1 + movq m1, m0 + punpckhbw m1, m1 + pshufw m1, m1, 0xFF + punpckhdq m0, m1 + movq m2, m0 + movq m3, m0 + movq m7, m0 + psrlq m2, 16 + psrlq m3, 8 + pavgb m7, m3 + PRED4x4_LOWPASS m4, m0, m2, m3, m5 + punpcklbw m7, m4 + movd [r0+r2*1], m7 + psrlq m7, 16 + movd [r0+r2*2], m7 + psrlq m7, 16 + movd [r1+r2*1], m7 + movd [r1+r2*2], m1 + RET + +;----------------------------------------------------------------------------- +; void pred4x4_horizontal_down_mmxext(uint8_t *src, const uint8_t *topright, int stride) +;----------------------------------------------------------------------------- + +INIT_MMX +%define PALIGNR PALIGNR_MMX +cglobal pred4x4_horizontal_down_mmxext, 3,3 + sub r0, r2 + lea r1, [r0+r2*2] + movh m0, [r0-4] ; lt .. + punpckldq m0, [r0] ; t3 t2 t1 t0 lt .. .. .. + psllq m0, 8 ; t2 t1 t0 lt .. .. .. .. + movd m1, [r1+r2*2-4] ; l3 + punpcklbw m1, [r1+r2*1-4] ; l2 l3 + movd m2, [r0+r2*2-4] ; l1 + punpcklbw m2, [r0+r2*1-4] ; l0 l1 + punpckhwd m1, m2 ; l0 l1 l2 l3 + punpckhdq m1, m0 ; t2 t1 t0 lt l0 l1 l2 l3 + movq m0, m1 + movq m2, m1 + movq m5, m1 + psrlq m0, 16 ; .. .. t2 t1 t0 lt l0 l1 + psrlq m2, 8 ; .. t2 t1 t0 lt l0 l1 l2 + pavgb m5, m2 + PRED4x4_LOWPASS m3, m1, m0, m2, m4 + punpcklbw m5, m3 + psrlq m3, 32 + PALIGNR m3, m5, 6, m4 + movh [r1+r2*2], m5 + psrlq m5, 16 + movh [r1+r2*1], m5 + psrlq m5, 16 + movh [r0+r2*2], m5 + movh [r0+r2*1], m3 + RET + +;----------------------------------------------------------------------------- +; void pred4x4_vertical_right_mmxext(uint8_t *src, const uint8_t *topright, int stride) +;----------------------------------------------------------------------------- + +INIT_MMX +%define PALIGNR PALIGNR_MMX +cglobal pred4x4_vertical_right_mmxext, 3,3 + sub r0, r2 + lea r1, [r0+r2*2] + movh m0, [r0] ; ........t3t2t1t0 + movq m5, m0 + PALIGNR m0, [r0-8], 7, m1 ; ......t3t2t1t0lt + pavgb m5, m0 + PALIGNR m0, [r0+r2*1-8], 7, m1 ; ....t3t2t1t0ltl0 + movq m1, m0 + PALIGNR m0, [r0+r2*2-8], 7, m2 ; ..t3t2t1t0ltl0l1 + movq m2, m0 + PALIGNR m0, [r1+r2*1-8], 7, m3 ; t3t2t1t0ltl0l1l2 + PRED4x4_LOWPASS m3, m1, m0, m2, m4 + movq m1, m3 + psrlq m3, 16 + psllq m1, 48 + movh [r0+r2*1], m5 + movh [r0+r2*2], m3 + PALIGNR m5, m1, 7, m2 + psllq m1, 8 + movh [r1+r2*1], m5 + PALIGNR m3, m1, 7, m1 + movh [r1+r2*2], m3 + RET + +;----------------------------------------------------------------------------- +; void pred4x4_down_right_mmxext(uint8_t *src, const uint8_t *topright, int stride) +;----------------------------------------------------------------------------- + +INIT_MMX +%define PALIGNR PALIGNR_MMX +cglobal pred4x4_down_right_mmxext, 3,3 + sub r0, r2 + lea r1, [r0+r2*2] + movq m1, [r1-8] + movq m2, [r0+r2*1-8] + punpckhbw m2, [r0-8] + movh m3, [r0] + punpckhwd m1, m2 + PALIGNR m3, m1, 5, m1 + movq m1, m3 + PALIGNR m3, [r1+r2*1-8], 7, m4 + movq m2, m3 + PALIGNR m3, [r1+r2*2-8], 7, m4 + PRED4x4_LOWPASS m0, m3, m1, m2, m4 + movh [r1+r2*2], m0 + psrlq m0, 8 + movh [r1+r2*1], m0 + psrlq m0, 8 + movh [r0+r2*2], m0 + psrlq m0, 8 + movh [r0+r2*1], m0 + RET +%endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_intrapred_init.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_intrapred_init.c new file mode 100644 index 00000000..e93fb917 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_intrapred_init.c @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2010 Jason Garrett-Glaser + * + * 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 + */ + +#include "libavutil/cpu.h" +#include "libavcodec/h264pred.h" + +void ff_pred16x16_vertical_mmx (uint8_t *src, int stride); +void ff_pred16x16_vertical_sse (uint8_t *src, int stride); +void ff_pred16x16_horizontal_mmx (uint8_t *src, int stride); +void ff_pred16x16_horizontal_mmxext(uint8_t *src, int stride); +void ff_pred16x16_horizontal_ssse3 (uint8_t *src, int stride); +void ff_pred16x16_dc_mmxext (uint8_t *src, int stride); +void ff_pred16x16_dc_sse2 (uint8_t *src, int stride); +void ff_pred16x16_dc_ssse3 (uint8_t *src, int stride); +void ff_pred16x16_plane_h264_mmx (uint8_t *src, int stride); +void ff_pred16x16_plane_h264_mmx2 (uint8_t *src, int stride); +void ff_pred16x16_plane_h264_sse2 (uint8_t *src, int stride); +void ff_pred16x16_plane_h264_ssse3 (uint8_t *src, int stride); +void ff_pred16x16_plane_rv40_mmx (uint8_t *src, int stride); +void ff_pred16x16_plane_rv40_mmx2 (uint8_t *src, int stride); +void ff_pred16x16_plane_rv40_sse2 (uint8_t *src, int stride); +void ff_pred16x16_plane_rv40_ssse3 (uint8_t *src, int stride); +void ff_pred16x16_plane_svq3_mmx (uint8_t *src, int stride); +void ff_pred16x16_plane_svq3_mmx2 (uint8_t *src, int stride); +void ff_pred16x16_plane_svq3_sse2 (uint8_t *src, int stride); +void ff_pred16x16_plane_svq3_ssse3 (uint8_t *src, int stride); +void ff_pred16x16_tm_vp8_mmx (uint8_t *src, int stride); +void ff_pred16x16_tm_vp8_mmxext (uint8_t *src, int stride); +void ff_pred16x16_tm_vp8_sse2 (uint8_t *src, int stride); +void ff_pred8x8_top_dc_mmxext (uint8_t *src, int stride); +void ff_pred8x8_dc_rv40_mmxext (uint8_t *src, int stride); +void ff_pred8x8_dc_mmxext (uint8_t *src, int stride); +void ff_pred8x8_vertical_mmx (uint8_t *src, int stride); +void ff_pred8x8_horizontal_mmx (uint8_t *src, int stride); +void ff_pred8x8_horizontal_mmxext (uint8_t *src, int stride); +void ff_pred8x8_horizontal_ssse3 (uint8_t *src, int stride); +void ff_pred8x8_plane_mmx (uint8_t *src, int stride); +void ff_pred8x8_plane_mmx2 (uint8_t *src, int stride); +void ff_pred8x8_plane_sse2 (uint8_t *src, int stride); +void ff_pred8x8_plane_ssse3 (uint8_t *src, int stride); +void ff_pred8x8_tm_vp8_mmx (uint8_t *src, int stride); +void ff_pred8x8_tm_vp8_mmxext (uint8_t *src, int stride); +void ff_pred8x8_tm_vp8_sse2 (uint8_t *src, int stride); +void ff_pred8x8_tm_vp8_ssse3 (uint8_t *src, int stride); +void ff_pred8x8l_top_dc_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_top_dc_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_dc_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_dc_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_horizontal_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_horizontal_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_vertical_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_vertical_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_down_left_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_down_left_sse2 (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_down_left_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_down_right_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_down_right_sse2 (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_down_right_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_vertical_right_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_vertical_right_sse2(uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_vertical_right_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_vertical_left_sse2(uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_vertical_left_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_horizontal_up_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_horizontal_up_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_horizontal_down_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_horizontal_down_sse2(uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred8x8l_horizontal_down_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride); +void ff_pred4x4_dc_mmxext (uint8_t *src, const uint8_t *topright, int stride); +void ff_pred4x4_down_left_mmxext (uint8_t *src, const uint8_t *topright, int stride); +void ff_pred4x4_down_right_mmxext (uint8_t *src, const uint8_t *topright, int stride); +void ff_pred4x4_vertical_left_mmxext(uint8_t *src, const uint8_t *topright, int stride); +void ff_pred4x4_vertical_right_mmxext(uint8_t *src, const uint8_t *topright, int stride); +void ff_pred4x4_horizontal_up_mmxext(uint8_t *src, const uint8_t *topright, int stride); +void ff_pred4x4_horizontal_down_mmxext(uint8_t *src, const uint8_t *topright, int stride); +void ff_pred4x4_tm_vp8_mmx (uint8_t *src, const uint8_t *topright, int stride); +void ff_pred4x4_tm_vp8_mmxext (uint8_t *src, const uint8_t *topright, int stride); +void ff_pred4x4_tm_vp8_ssse3 (uint8_t *src, const uint8_t *topright, int stride); +void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride); + +void ff_h264_pred_init_x86(H264PredContext *h, int codec_id) +{ + int mm_flags = av_get_cpu_flags(); + +#if HAVE_YASM + if (mm_flags & AV_CPU_FLAG_MMX) { + h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_mmx; + h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmx; + h->pred8x8 [VERT_PRED8x8] = ff_pred8x8_vertical_mmx; + h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmx; + if (codec_id == CODEC_ID_VP8) { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmx; + h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmx; + h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_mmx; + } else { + h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_mmx; + if (codec_id == CODEC_ID_SVQ3) { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_mmx; + } else if (codec_id == CODEC_ID_RV40) { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_mmx; + } else { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_mmx; + } + } + } + + if (mm_flags & AV_CPU_FLAG_MMX2) { + h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmxext; + h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_mmxext; + h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmxext; +#if CONFIG_GPL + h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_mmxext; + h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_mmxext; + h->pred8x8l [HOR_PRED ] = ff_pred8x8l_horizontal_mmxext; + h->pred8x8l [VERT_PRED ] = ff_pred8x8l_vertical_mmxext; + h->pred8x8l [DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_mmxext; + h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_mmxext; + h->pred8x8l [HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_mmxext; + h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_mmxext; + h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_mmxext; + h->pred4x4 [DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_mmxext; + h->pred4x4 [VERT_RIGHT_PRED ] = ff_pred4x4_vertical_right_mmxext; + h->pred4x4 [HOR_DOWN_PRED ] = ff_pred4x4_horizontal_down_mmxext; +#endif + h->pred4x4 [DC_PRED ] = ff_pred4x4_dc_mmxext; +#if CONFIG_GPL + if (codec_id == CODEC_ID_VP8 || codec_id == CODEC_ID_H264) + h->pred4x4 [DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_mmxext; + if (codec_id == CODEC_ID_SVQ3 || codec_id == CODEC_ID_H264) + h->pred4x4 [VERT_LEFT_PRED ] = ff_pred4x4_vertical_left_mmxext; + if (codec_id != CODEC_ID_RV40) { + h->pred4x4 [HOR_UP_PRED ] = ff_pred4x4_horizontal_up_mmxext; + } + if (codec_id == CODEC_ID_SVQ3 || codec_id == CODEC_ID_H264) { + h->pred8x8 [TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_mmxext; + h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_mmxext; + } +#endif + if (codec_id == CODEC_ID_VP8) { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmxext; + h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_rv40_mmxext; + h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmxext; + h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_mmxext; + h->pred4x4 [VERT_PRED ] = ff_pred4x4_vertical_vp8_mmxext; + } else { + h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_mmx2; + if (codec_id == CODEC_ID_SVQ3) { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_mmx2; + } else if (codec_id == CODEC_ID_RV40) { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_mmx2; + } else { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_mmx2; + } + } + } + + if (mm_flags & AV_CPU_FLAG_SSE) { + h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_sse; + } + + if (mm_flags & AV_CPU_FLAG_SSE2) { + h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_sse2; +#if CONFIG_GPL + h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_sse2; + h->pred8x8l [DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_sse2; + h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_sse2; + h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_sse2; + h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_sse2; +#endif + if (codec_id == CODEC_ID_VP8) { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_sse2; + h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_sse2; + } else { + h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_sse2; + if (codec_id == CODEC_ID_SVQ3) { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_sse2; + } else if (codec_id == CODEC_ID_RV40) { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_sse2; + } else { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_sse2; + } + } + } + + if (mm_flags & AV_CPU_FLAG_SSSE3) { + h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_ssse3; + h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_ssse3; + h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_ssse3; +#if CONFIG_GPL + h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_ssse3; + h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_ssse3; + h->pred8x8l [HOR_PRED ] = ff_pred8x8l_horizontal_ssse3; + h->pred8x8l [VERT_PRED ] = ff_pred8x8l_vertical_ssse3; + h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_ssse3; + h->pred8x8l [DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_ssse3; + h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_ssse3; + h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_ssse3; + h->pred8x8l [HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_ssse3; + h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_ssse3; +#endif + if (codec_id == CODEC_ID_VP8) { + h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_ssse3; + h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_ssse3; + } else { + h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_ssse3; + if (codec_id == CODEC_ID_SVQ3) { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_ssse3; + } else if (codec_id == CODEC_ID_RV40) { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_ssse3; + } else { + h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_ssse3; + } + } + } +#endif +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_qpel_mmx.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_qpel_mmx.c new file mode 100644 index 00000000..d8ceca18 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_qpel_mmx.c @@ -0,0 +1,1201 @@ +/* + * Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt + * + * 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 + */ + +#include "dsputil_mmx.h" + +/***********************************/ +/* motion compensation */ + +#define QPEL_H264V_MM(A,B,C,D,E,F,OP,T,Z,d,q)\ + "mov"#q" "#C", "#T" \n\t"\ + "mov"#d" (%0), "#F" \n\t"\ + "paddw "#D", "#T" \n\t"\ + "psllw $2, "#T" \n\t"\ + "psubw "#B", "#T" \n\t"\ + "psubw "#E", "#T" \n\t"\ + "punpcklbw "#Z", "#F" \n\t"\ + "pmullw "MANGLE(ff_pw_5)", "#T"\n\t"\ + "paddw "MANGLE(ff_pw_16)", "#A"\n\t"\ + "add %2, %0 \n\t"\ + "paddw "#F", "#A" \n\t"\ + "paddw "#A", "#T" \n\t"\ + "psraw $5, "#T" \n\t"\ + "packuswb "#T", "#T" \n\t"\ + OP(T, (%1), A, d)\ + "add %3, %1 \n\t" + +#define QPEL_H264HV_MM(A,B,C,D,E,F,OF,T,Z,d,q)\ + "mov"#q" "#C", "#T" \n\t"\ + "mov"#d" (%0), "#F" \n\t"\ + "paddw "#D", "#T" \n\t"\ + "psllw $2, "#T" \n\t"\ + "paddw "MANGLE(ff_pw_16)", "#A"\n\t"\ + "psubw "#B", "#T" \n\t"\ + "psubw "#E", "#T" \n\t"\ + "punpcklbw "#Z", "#F" \n\t"\ + "pmullw "MANGLE(ff_pw_5)", "#T"\n\t"\ + "paddw "#F", "#A" \n\t"\ + "add %2, %0 \n\t"\ + "paddw "#A", "#T" \n\t"\ + "mov"#q" "#T", "#OF"(%1) \n\t" + +#define QPEL_H264V(A,B,C,D,E,F,OP) QPEL_H264V_MM(A,B,C,D,E,F,OP,%%mm6,%%mm7,d,q) +#define QPEL_H264HV(A,B,C,D,E,F,OF) QPEL_H264HV_MM(A,B,C,D,E,F,OF,%%mm6,%%mm7,d,q) +#define QPEL_H264V_XMM(A,B,C,D,E,F,OP) QPEL_H264V_MM(A,B,C,D,E,F,OP,%%xmm6,%%xmm7,q,dqa) +#define QPEL_H264HV_XMM(A,B,C,D,E,F,OF) QPEL_H264HV_MM(A,B,C,D,E,F,OF,%%xmm6,%%xmm7,q,dqa) + + +#define QPEL_H264(OPNAME, OP, MMX)\ +static av_noinline void OPNAME ## h264_qpel4_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ + int h=4;\ +\ + __asm__ volatile(\ + "pxor %%mm7, %%mm7 \n\t"\ + "movq "MANGLE(ff_pw_5) ", %%mm4\n\t"\ + "movq "MANGLE(ff_pw_16)", %%mm5\n\t"\ + "1: \n\t"\ + "movd -1(%0), %%mm1 \n\t"\ + "movd (%0), %%mm2 \n\t"\ + "movd 1(%0), %%mm3 \n\t"\ + "movd 2(%0), %%mm0 \n\t"\ + "punpcklbw %%mm7, %%mm1 \n\t"\ + "punpcklbw %%mm7, %%mm2 \n\t"\ + "punpcklbw %%mm7, %%mm3 \n\t"\ + "punpcklbw %%mm7, %%mm0 \n\t"\ + "paddw %%mm0, %%mm1 \n\t"\ + "paddw %%mm3, %%mm2 \n\t"\ + "movd -2(%0), %%mm0 \n\t"\ + "movd 3(%0), %%mm3 \n\t"\ + "punpcklbw %%mm7, %%mm0 \n\t"\ + "punpcklbw %%mm7, %%mm3 \n\t"\ + "paddw %%mm3, %%mm0 \n\t"\ + "psllw $2, %%mm2 \n\t"\ + "psubw %%mm1, %%mm2 \n\t"\ + "pmullw %%mm4, %%mm2 \n\t"\ + "paddw %%mm5, %%mm0 \n\t"\ + "paddw %%mm2, %%mm0 \n\t"\ + "psraw $5, %%mm0 \n\t"\ + "packuswb %%mm0, %%mm0 \n\t"\ + OP(%%mm0, (%1),%%mm6, d)\ + "add %3, %0 \n\t"\ + "add %4, %1 \n\t"\ + "decl %2 \n\t"\ + " jnz 1b \n\t"\ + : "+a"(src), "+c"(dst), "+g"(h)\ + : "d"((x86_reg)srcStride), "S"((x86_reg)dstStride)\ + : "memory"\ + );\ +}\ +static av_noinline void OPNAME ## h264_qpel4_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\ + int h=4;\ + __asm__ volatile(\ + "pxor %%mm7, %%mm7 \n\t"\ + "movq %0, %%mm4 \n\t"\ + "movq %1, %%mm5 \n\t"\ + :: "m"(ff_pw_5), "m"(ff_pw_16)\ + );\ + do{\ + __asm__ volatile(\ + "movd -1(%0), %%mm1 \n\t"\ + "movd (%0), %%mm2 \n\t"\ + "movd 1(%0), %%mm3 \n\t"\ + "movd 2(%0), %%mm0 \n\t"\ + "punpcklbw %%mm7, %%mm1 \n\t"\ + "punpcklbw %%mm7, %%mm2 \n\t"\ + "punpcklbw %%mm7, %%mm3 \n\t"\ + "punpcklbw %%mm7, %%mm0 \n\t"\ + "paddw %%mm0, %%mm1 \n\t"\ + "paddw %%mm3, %%mm2 \n\t"\ + "movd -2(%0), %%mm0 \n\t"\ + "movd 3(%0), %%mm3 \n\t"\ + "punpcklbw %%mm7, %%mm0 \n\t"\ + "punpcklbw %%mm7, %%mm3 \n\t"\ + "paddw %%mm3, %%mm0 \n\t"\ + "psllw $2, %%mm2 \n\t"\ + "psubw %%mm1, %%mm2 \n\t"\ + "pmullw %%mm4, %%mm2 \n\t"\ + "paddw %%mm5, %%mm0 \n\t"\ + "paddw %%mm2, %%mm0 \n\t"\ + "movd (%2), %%mm3 \n\t"\ + "psraw $5, %%mm0 \n\t"\ + "packuswb %%mm0, %%mm0 \n\t"\ + PAVGB" %%mm3, %%mm0 \n\t"\ + OP(%%mm0, (%1),%%mm6, d)\ + "add %4, %0 \n\t"\ + "add %4, %1 \n\t"\ + "add %3, %2 \n\t"\ + : "+a"(src), "+c"(dst), "+d"(src2)\ + : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride)\ + : "memory"\ + );\ + }while(--h);\ +}\ +static av_noinline void OPNAME ## h264_qpel4_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ + src -= 2*srcStride;\ + __asm__ volatile(\ + "pxor %%mm7, %%mm7 \n\t"\ + "movd (%0), %%mm0 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm1 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm2 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm3 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm4 \n\t"\ + "add %2, %0 \n\t"\ + "punpcklbw %%mm7, %%mm0 \n\t"\ + "punpcklbw %%mm7, %%mm1 \n\t"\ + "punpcklbw %%mm7, %%mm2 \n\t"\ + "punpcklbw %%mm7, %%mm3 \n\t"\ + "punpcklbw %%mm7, %%mm4 \n\t"\ + QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\ + QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\ + QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\ + QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\ + \ + : "+a"(src), "+c"(dst)\ + : "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\ + : "memory"\ + );\ +}\ +static av_noinline void OPNAME ## h264_qpel4_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\ + int h=4;\ + int w=3;\ + src -= 2*srcStride+2;\ + while(w--){\ + __asm__ volatile(\ + "pxor %%mm7, %%mm7 \n\t"\ + "movd (%0), %%mm0 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm1 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm2 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm3 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm4 \n\t"\ + "add %2, %0 \n\t"\ + "punpcklbw %%mm7, %%mm0 \n\t"\ + "punpcklbw %%mm7, %%mm1 \n\t"\ + "punpcklbw %%mm7, %%mm2 \n\t"\ + "punpcklbw %%mm7, %%mm3 \n\t"\ + "punpcklbw %%mm7, %%mm4 \n\t"\ + QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 0*8*3)\ + QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 1*8*3)\ + QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 2*8*3)\ + QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 3*8*3)\ + \ + : "+a"(src)\ + : "c"(tmp), "S"((x86_reg)srcStride)\ + : "memory"\ + );\ + tmp += 4;\ + src += 4 - 9*srcStride;\ + }\ + tmp -= 3*4;\ + __asm__ volatile(\ + "1: \n\t"\ + "movq (%0), %%mm0 \n\t"\ + "paddw 10(%0), %%mm0 \n\t"\ + "movq 2(%0), %%mm1 \n\t"\ + "paddw 8(%0), %%mm1 \n\t"\ + "movq 4(%0), %%mm2 \n\t"\ + "paddw 6(%0), %%mm2 \n\t"\ + "psubw %%mm1, %%mm0 \n\t"/*a-b (abccba)*/\ + "psraw $2, %%mm0 \n\t"/*(a-b)/4 */\ + "psubw %%mm1, %%mm0 \n\t"/*(a-b)/4-b */\ + "paddsw %%mm2, %%mm0 \n\t"\ + "psraw $2, %%mm0 \n\t"/*((a-b)/4-b+c)/4 */\ + "paddw %%mm2, %%mm0 \n\t"/*(a-5*b+20*c)/16 */\ + "psraw $6, %%mm0 \n\t"\ + "packuswb %%mm0, %%mm0 \n\t"\ + OP(%%mm0, (%1),%%mm7, d)\ + "add $24, %0 \n\t"\ + "add %3, %1 \n\t"\ + "decl %2 \n\t"\ + " jnz 1b \n\t"\ + : "+a"(tmp), "+c"(dst), "+g"(h)\ + : "S"((x86_reg)dstStride)\ + : "memory"\ + );\ +}\ +\ +static av_noinline void OPNAME ## h264_qpel8_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ + int h=8;\ + __asm__ volatile(\ + "pxor %%mm7, %%mm7 \n\t"\ + "movq "MANGLE(ff_pw_5)", %%mm6\n\t"\ + "1: \n\t"\ + "movq (%0), %%mm0 \n\t"\ + "movq 1(%0), %%mm2 \n\t"\ + "movq %%mm0, %%mm1 \n\t"\ + "movq %%mm2, %%mm3 \n\t"\ + "punpcklbw %%mm7, %%mm0 \n\t"\ + "punpckhbw %%mm7, %%mm1 \n\t"\ + "punpcklbw %%mm7, %%mm2 \n\t"\ + "punpckhbw %%mm7, %%mm3 \n\t"\ + "paddw %%mm2, %%mm0 \n\t"\ + "paddw %%mm3, %%mm1 \n\t"\ + "psllw $2, %%mm0 \n\t"\ + "psllw $2, %%mm1 \n\t"\ + "movq -1(%0), %%mm2 \n\t"\ + "movq 2(%0), %%mm4 \n\t"\ + "movq %%mm2, %%mm3 \n\t"\ + "movq %%mm4, %%mm5 \n\t"\ + "punpcklbw %%mm7, %%mm2 \n\t"\ + "punpckhbw %%mm7, %%mm3 \n\t"\ + "punpcklbw %%mm7, %%mm4 \n\t"\ + "punpckhbw %%mm7, %%mm5 \n\t"\ + "paddw %%mm4, %%mm2 \n\t"\ + "paddw %%mm3, %%mm5 \n\t"\ + "psubw %%mm2, %%mm0 \n\t"\ + "psubw %%mm5, %%mm1 \n\t"\ + "pmullw %%mm6, %%mm0 \n\t"\ + "pmullw %%mm6, %%mm1 \n\t"\ + "movd -2(%0), %%mm2 \n\t"\ + "movd 7(%0), %%mm5 \n\t"\ + "punpcklbw %%mm7, %%mm2 \n\t"\ + "punpcklbw %%mm7, %%mm5 \n\t"\ + "paddw %%mm3, %%mm2 \n\t"\ + "paddw %%mm5, %%mm4 \n\t"\ + "movq "MANGLE(ff_pw_16)", %%mm5\n\t"\ + "paddw %%mm5, %%mm2 \n\t"\ + "paddw %%mm5, %%mm4 \n\t"\ + "paddw %%mm2, %%mm0 \n\t"\ + "paddw %%mm4, %%mm1 \n\t"\ + "psraw $5, %%mm0 \n\t"\ + "psraw $5, %%mm1 \n\t"\ + "packuswb %%mm1, %%mm0 \n\t"\ + OP(%%mm0, (%1),%%mm5, q)\ + "add %3, %0 \n\t"\ + "add %4, %1 \n\t"\ + "decl %2 \n\t"\ + " jnz 1b \n\t"\ + : "+a"(src), "+c"(dst), "+g"(h)\ + : "d"((x86_reg)srcStride), "S"((x86_reg)dstStride)\ + : "memory"\ + );\ +}\ +\ +static av_noinline void OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\ + int h=8;\ + __asm__ volatile(\ + "pxor %%mm7, %%mm7 \n\t"\ + "movq "MANGLE(ff_pw_5)", %%mm6\n\t"\ + "1: \n\t"\ + "movq (%0), %%mm0 \n\t"\ + "movq 1(%0), %%mm2 \n\t"\ + "movq %%mm0, %%mm1 \n\t"\ + "movq %%mm2, %%mm3 \n\t"\ + "punpcklbw %%mm7, %%mm0 \n\t"\ + "punpckhbw %%mm7, %%mm1 \n\t"\ + "punpcklbw %%mm7, %%mm2 \n\t"\ + "punpckhbw %%mm7, %%mm3 \n\t"\ + "paddw %%mm2, %%mm0 \n\t"\ + "paddw %%mm3, %%mm1 \n\t"\ + "psllw $2, %%mm0 \n\t"\ + "psllw $2, %%mm1 \n\t"\ + "movq -1(%0), %%mm2 \n\t"\ + "movq 2(%0), %%mm4 \n\t"\ + "movq %%mm2, %%mm3 \n\t"\ + "movq %%mm4, %%mm5 \n\t"\ + "punpcklbw %%mm7, %%mm2 \n\t"\ + "punpckhbw %%mm7, %%mm3 \n\t"\ + "punpcklbw %%mm7, %%mm4 \n\t"\ + "punpckhbw %%mm7, %%mm5 \n\t"\ + "paddw %%mm4, %%mm2 \n\t"\ + "paddw %%mm3, %%mm5 \n\t"\ + "psubw %%mm2, %%mm0 \n\t"\ + "psubw %%mm5, %%mm1 \n\t"\ + "pmullw %%mm6, %%mm0 \n\t"\ + "pmullw %%mm6, %%mm1 \n\t"\ + "movd -2(%0), %%mm2 \n\t"\ + "movd 7(%0), %%mm5 \n\t"\ + "punpcklbw %%mm7, %%mm2 \n\t"\ + "punpcklbw %%mm7, %%mm5 \n\t"\ + "paddw %%mm3, %%mm2 \n\t"\ + "paddw %%mm5, %%mm4 \n\t"\ + "movq "MANGLE(ff_pw_16)", %%mm5\n\t"\ + "paddw %%mm5, %%mm2 \n\t"\ + "paddw %%mm5, %%mm4 \n\t"\ + "paddw %%mm2, %%mm0 \n\t"\ + "paddw %%mm4, %%mm1 \n\t"\ + "psraw $5, %%mm0 \n\t"\ + "psraw $5, %%mm1 \n\t"\ + "movq (%2), %%mm4 \n\t"\ + "packuswb %%mm1, %%mm0 \n\t"\ + PAVGB" %%mm4, %%mm0 \n\t"\ + OP(%%mm0, (%1),%%mm5, q)\ + "add %5, %0 \n\t"\ + "add %5, %1 \n\t"\ + "add %4, %2 \n\t"\ + "decl %3 \n\t"\ + "jg 1b \n\t"\ + : "+a"(src), "+c"(dst), "+d"(src2), "+g"(h)\ + : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride)\ + : "memory"\ + );\ +}\ +\ +static av_noinline void OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ + int w= 2;\ + src -= 2*srcStride;\ + \ + while(w--){\ + __asm__ volatile(\ + "pxor %%mm7, %%mm7 \n\t"\ + "movd (%0), %%mm0 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm1 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm2 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm3 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm4 \n\t"\ + "add %2, %0 \n\t"\ + "punpcklbw %%mm7, %%mm0 \n\t"\ + "punpcklbw %%mm7, %%mm1 \n\t"\ + "punpcklbw %%mm7, %%mm2 \n\t"\ + "punpcklbw %%mm7, %%mm3 \n\t"\ + "punpcklbw %%mm7, %%mm4 \n\t"\ + QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\ + QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\ + QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\ + QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\ + QPEL_H264V(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP)\ + QPEL_H264V(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP)\ + QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\ + QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\ + "cmpl $16, %4 \n\t"\ + "jne 2f \n\t"\ + QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\ + QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\ + QPEL_H264V(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP)\ + QPEL_H264V(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP)\ + QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\ + QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\ + QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\ + QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\ + "2: \n\t"\ + \ + : "+a"(src), "+c"(dst)\ + : "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "g"(h)\ + : "memory"\ + );\ + src += 4-(h+5)*srcStride;\ + dst += 4-h*dstStride;\ + }\ +}\ +static av_always_inline void OPNAME ## h264_qpel8or16_hv1_lowpass_ ## MMX(int16_t *tmp, uint8_t *src, int tmpStride, int srcStride, int size){\ + int w = (size+8)>>2;\ + src -= 2*srcStride+2;\ + while(w--){\ + __asm__ volatile(\ + "pxor %%mm7, %%mm7 \n\t"\ + "movd (%0), %%mm0 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm1 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm2 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm3 \n\t"\ + "add %2, %0 \n\t"\ + "movd (%0), %%mm4 \n\t"\ + "add %2, %0 \n\t"\ + "punpcklbw %%mm7, %%mm0 \n\t"\ + "punpcklbw %%mm7, %%mm1 \n\t"\ + "punpcklbw %%mm7, %%mm2 \n\t"\ + "punpcklbw %%mm7, %%mm3 \n\t"\ + "punpcklbw %%mm7, %%mm4 \n\t"\ + QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 0*48)\ + QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 1*48)\ + QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 2*48)\ + QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 3*48)\ + QPEL_H264HV(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, 4*48)\ + QPEL_H264HV(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, 5*48)\ + QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 6*48)\ + QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 7*48)\ + "cmpl $16, %3 \n\t"\ + "jne 2f \n\t"\ + QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 8*48)\ + QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 9*48)\ + QPEL_H264HV(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, 10*48)\ + QPEL_H264HV(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, 11*48)\ + QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 12*48)\ + QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 13*48)\ + QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 14*48)\ + QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 15*48)\ + "2: \n\t"\ + : "+a"(src)\ + : "c"(tmp), "S"((x86_reg)srcStride), "g"(size)\ + : "memory"\ + );\ + tmp += 4;\ + src += 4 - (size+5)*srcStride;\ + }\ +}\ +static av_always_inline void OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, int dstStride, int tmpStride, int size){\ + int w = size>>4;\ + do{\ + int h = size;\ + __asm__ volatile(\ + "1: \n\t"\ + "movq (%0), %%mm0 \n\t"\ + "movq 8(%0), %%mm3 \n\t"\ + "movq 2(%0), %%mm1 \n\t"\ + "movq 10(%0), %%mm4 \n\t"\ + "paddw %%mm4, %%mm0 \n\t"\ + "paddw %%mm3, %%mm1 \n\t"\ + "paddw 18(%0), %%mm3 \n\t"\ + "paddw 16(%0), %%mm4 \n\t"\ + "movq 4(%0), %%mm2 \n\t"\ + "movq 12(%0), %%mm5 \n\t"\ + "paddw 6(%0), %%mm2 \n\t"\ + "paddw 14(%0), %%mm5 \n\t"\ + "psubw %%mm1, %%mm0 \n\t"\ + "psubw %%mm4, %%mm3 \n\t"\ + "psraw $2, %%mm0 \n\t"\ + "psraw $2, %%mm3 \n\t"\ + "psubw %%mm1, %%mm0 \n\t"\ + "psubw %%mm4, %%mm3 \n\t"\ + "paddsw %%mm2, %%mm0 \n\t"\ + "paddsw %%mm5, %%mm3 \n\t"\ + "psraw $2, %%mm0 \n\t"\ + "psraw $2, %%mm3 \n\t"\ + "paddw %%mm2, %%mm0 \n\t"\ + "paddw %%mm5, %%mm3 \n\t"\ + "psraw $6, %%mm0 \n\t"\ + "psraw $6, %%mm3 \n\t"\ + "packuswb %%mm3, %%mm0 \n\t"\ + OP(%%mm0, (%1),%%mm7, q)\ + "add $48, %0 \n\t"\ + "add %3, %1 \n\t"\ + "decl %2 \n\t"\ + " jnz 1b \n\t"\ + : "+a"(tmp), "+c"(dst), "+g"(h)\ + : "S"((x86_reg)dstStride)\ + : "memory"\ + );\ + tmp += 8 - size*24;\ + dst += 8 - size*dstStride;\ + }while(w--);\ +}\ +\ +static void OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ + OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 8);\ +}\ +static av_noinline void OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ + OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 16);\ + OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\ +}\ +\ +static void OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ + OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\ + OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\ + src += 8*srcStride;\ + dst += 8*dstStride;\ + OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\ + OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\ +}\ +\ +static av_noinline void OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\ + OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\ + OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\ + src += 8*dstStride;\ + dst += 8*dstStride;\ + src2 += 8*src2Stride;\ + OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\ + OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\ +}\ +\ +static av_noinline void OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride, int size){\ + put_h264_qpel8or16_hv1_lowpass_ ## MMX(tmp, src, tmpStride, srcStride, size);\ + OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(dst, tmp, dstStride, tmpStride, size);\ +}\ +static void OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\ + OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride, 8);\ +}\ +\ +static void OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\ + OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride, 16);\ +}\ +\ +static av_noinline void OPNAME ## pixels4_l2_shift5_ ## MMX(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h)\ +{\ + __asm__ volatile(\ + "movq (%1), %%mm0 \n\t"\ + "movq 24(%1), %%mm1 \n\t"\ + "psraw $5, %%mm0 \n\t"\ + "psraw $5, %%mm1 \n\t"\ + "packuswb %%mm0, %%mm0 \n\t"\ + "packuswb %%mm1, %%mm1 \n\t"\ + PAVGB" (%0), %%mm0 \n\t"\ + PAVGB" (%0,%3), %%mm1 \n\t"\ + OP(%%mm0, (%2), %%mm4, d)\ + OP(%%mm1, (%2,%4), %%mm5, d)\ + "lea (%0,%3,2), %0 \n\t"\ + "lea (%2,%4,2), %2 \n\t"\ + "movq 48(%1), %%mm0 \n\t"\ + "movq 72(%1), %%mm1 \n\t"\ + "psraw $5, %%mm0 \n\t"\ + "psraw $5, %%mm1 \n\t"\ + "packuswb %%mm0, %%mm0 \n\t"\ + "packuswb %%mm1, %%mm1 \n\t"\ + PAVGB" (%0), %%mm0 \n\t"\ + PAVGB" (%0,%3), %%mm1 \n\t"\ + OP(%%mm0, (%2), %%mm4, d)\ + OP(%%mm1, (%2,%4), %%mm5, d)\ + :"+a"(src8), "+c"(src16), "+d"(dst)\ + :"S"((x86_reg)src8Stride), "D"((x86_reg)dstStride)\ + :"memory");\ +}\ +static av_noinline void OPNAME ## pixels8_l2_shift5_ ## MMX(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h)\ +{\ + do{\ + __asm__ volatile(\ + "movq (%1), %%mm0 \n\t"\ + "movq 8(%1), %%mm1 \n\t"\ + "movq 48(%1), %%mm2 \n\t"\ + "movq 8+48(%1), %%mm3 \n\t"\ + "psraw $5, %%mm0 \n\t"\ + "psraw $5, %%mm1 \n\t"\ + "psraw $5, %%mm2 \n\t"\ + "psraw $5, %%mm3 \n\t"\ + "packuswb %%mm1, %%mm0 \n\t"\ + "packuswb %%mm3, %%mm2 \n\t"\ + PAVGB" (%0), %%mm0 \n\t"\ + PAVGB" (%0,%3), %%mm2 \n\t"\ + OP(%%mm0, (%2), %%mm5, q)\ + OP(%%mm2, (%2,%4), %%mm5, q)\ + ::"a"(src8), "c"(src16), "d"(dst),\ + "r"((x86_reg)src8Stride), "r"((x86_reg)dstStride)\ + :"memory");\ + src8 += 2L*src8Stride;\ + src16 += 48;\ + dst += 2L*dstStride;\ + }while(h-=2);\ +}\ +static void OPNAME ## pixels16_l2_shift5_ ## MMX(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h)\ +{\ + OPNAME ## pixels8_l2_shift5_ ## MMX(dst , src16 , src8 , dstStride, src8Stride, h);\ + OPNAME ## pixels8_l2_shift5_ ## MMX(dst+8, src16+8, src8+8, dstStride, src8Stride, h);\ +}\ + + +#if ARCH_X86_64 +#define QPEL_H264_H16_XMM(OPNAME, OP, MMX)\ +static av_noinline void OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\ + int h=16;\ + __asm__ volatile(\ + "pxor %%xmm15, %%xmm15 \n\t"\ + "movdqa %6, %%xmm14 \n\t"\ + "movdqa %7, %%xmm13 \n\t"\ + "1: \n\t"\ + "lddqu 6(%0), %%xmm1 \n\t"\ + "lddqu -2(%0), %%xmm7 \n\t"\ + "movdqa %%xmm1, %%xmm0 \n\t"\ + "punpckhbw %%xmm15, %%xmm1 \n\t"\ + "punpcklbw %%xmm15, %%xmm0 \n\t"\ + "punpcklbw %%xmm15, %%xmm7 \n\t"\ + "movdqa %%xmm1, %%xmm2 \n\t"\ + "movdqa %%xmm0, %%xmm6 \n\t"\ + "movdqa %%xmm1, %%xmm3 \n\t"\ + "movdqa %%xmm0, %%xmm8 \n\t"\ + "movdqa %%xmm1, %%xmm4 \n\t"\ + "movdqa %%xmm0, %%xmm9 \n\t"\ + "movdqa %%xmm0, %%xmm12 \n\t"\ + "movdqa %%xmm1, %%xmm11 \n\t"\ + "palignr $10,%%xmm0, %%xmm11\n\t"\ + "palignr $10,%%xmm7, %%xmm12\n\t"\ + "palignr $2, %%xmm0, %%xmm4 \n\t"\ + "palignr $2, %%xmm7, %%xmm9 \n\t"\ + "palignr $4, %%xmm0, %%xmm3 \n\t"\ + "palignr $4, %%xmm7, %%xmm8 \n\t"\ + "palignr $6, %%xmm0, %%xmm2 \n\t"\ + "palignr $6, %%xmm7, %%xmm6 \n\t"\ + "paddw %%xmm0 ,%%xmm11 \n\t"\ + "palignr $8, %%xmm0, %%xmm1 \n\t"\ + "palignr $8, %%xmm7, %%xmm0 \n\t"\ + "paddw %%xmm12,%%xmm7 \n\t"\ + "paddw %%xmm3, %%xmm2 \n\t"\ + "paddw %%xmm8, %%xmm6 \n\t"\ + "paddw %%xmm4, %%xmm1 \n\t"\ + "paddw %%xmm9, %%xmm0 \n\t"\ + "psllw $2, %%xmm2 \n\t"\ + "psllw $2, %%xmm6 \n\t"\ + "psubw %%xmm1, %%xmm2 \n\t"\ + "psubw %%xmm0, %%xmm6 \n\t"\ + "paddw %%xmm13,%%xmm11 \n\t"\ + "paddw %%xmm13,%%xmm7 \n\t"\ + "pmullw %%xmm14,%%xmm2 \n\t"\ + "pmullw %%xmm14,%%xmm6 \n\t"\ + "lddqu (%2), %%xmm3 \n\t"\ + "paddw %%xmm11,%%xmm2 \n\t"\ + "paddw %%xmm7, %%xmm6 \n\t"\ + "psraw $5, %%xmm2 \n\t"\ + "psraw $5, %%xmm6 \n\t"\ + "packuswb %%xmm2,%%xmm6 \n\t"\ + "pavgb %%xmm3, %%xmm6 \n\t"\ + OP(%%xmm6, (%1), %%xmm4, dqa)\ + "add %5, %0 \n\t"\ + "add %5, %1 \n\t"\ + "add %4, %2 \n\t"\ + "decl %3 \n\t"\ + "jg 1b \n\t"\ + : "+a"(src), "+c"(dst), "+d"(src2), "+g"(h)\ + : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride),\ + "m"(ff_pw_5), "m"(ff_pw_16)\ + : XMM_CLOBBERS("%xmm0" , "%xmm1" , "%xmm2" , "%xmm3" , \ + "%xmm4" , "%xmm5" , "%xmm6" , "%xmm7" , \ + "%xmm8" , "%xmm9" , "%xmm10", "%xmm11", \ + "%xmm12", "%xmm13", "%xmm14", "%xmm15",)\ + "memory"\ + );\ +} +#else // ARCH_X86_64 +#define QPEL_H264_H16_XMM(OPNAME, OP, MMX)\ +static av_noinline void OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\ + OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\ + OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\ + src += 8*dstStride;\ + dst += 8*dstStride;\ + src2 += 8*src2Stride;\ + OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\ + OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\ +} +#endif // ARCH_X86_64 + +#define QPEL_H264_H_XMM(OPNAME, OP, MMX)\ +static av_noinline void OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\ + int h=8;\ + __asm__ volatile(\ + "pxor %%xmm7, %%xmm7 \n\t"\ + "movdqa "MANGLE(ff_pw_5)", %%xmm6\n\t"\ + "1: \n\t"\ + "lddqu -2(%0), %%xmm1 \n\t"\ + "movdqa %%xmm1, %%xmm0 \n\t"\ + "punpckhbw %%xmm7, %%xmm1 \n\t"\ + "punpcklbw %%xmm7, %%xmm0 \n\t"\ + "movdqa %%xmm1, %%xmm2 \n\t"\ + "movdqa %%xmm1, %%xmm3 \n\t"\ + "movdqa %%xmm1, %%xmm4 \n\t"\ + "movdqa %%xmm1, %%xmm5 \n\t"\ + "palignr $2, %%xmm0, %%xmm4 \n\t"\ + "palignr $4, %%xmm0, %%xmm3 \n\t"\ + "palignr $6, %%xmm0, %%xmm2 \n\t"\ + "palignr $8, %%xmm0, %%xmm1 \n\t"\ + "palignr $10,%%xmm0, %%xmm5 \n\t"\ + "paddw %%xmm5, %%xmm0 \n\t"\ + "paddw %%xmm3, %%xmm2 \n\t"\ + "paddw %%xmm4, %%xmm1 \n\t"\ + "psllw $2, %%xmm2 \n\t"\ + "movq (%2), %%xmm3 \n\t"\ + "psubw %%xmm1, %%xmm2 \n\t"\ + "paddw "MANGLE(ff_pw_16)", %%xmm0\n\t"\ + "pmullw %%xmm6, %%xmm2 \n\t"\ + "paddw %%xmm0, %%xmm2 \n\t"\ + "psraw $5, %%xmm2 \n\t"\ + "packuswb %%xmm2, %%xmm2 \n\t"\ + "pavgb %%xmm3, %%xmm2 \n\t"\ + OP(%%xmm2, (%1), %%xmm4, q)\ + "add %5, %0 \n\t"\ + "add %5, %1 \n\t"\ + "add %4, %2 \n\t"\ + "decl %3 \n\t"\ + "jg 1b \n\t"\ + : "+a"(src), "+c"(dst), "+d"(src2), "+g"(h)\ + : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride)\ + : XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", \ + "%xmm4", "%xmm5", "%xmm6", "%xmm7",)\ + "memory"\ + );\ +}\ +QPEL_H264_H16_XMM(OPNAME, OP, MMX)\ +\ +static av_noinline void OPNAME ## h264_qpel8_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ + int h=8;\ + __asm__ volatile(\ + "pxor %%xmm7, %%xmm7 \n\t"\ + "movdqa "MANGLE(ff_pw_5)", %%xmm6\n\t"\ + "1: \n\t"\ + "lddqu -2(%0), %%xmm1 \n\t"\ + "movdqa %%xmm1, %%xmm0 \n\t"\ + "punpckhbw %%xmm7, %%xmm1 \n\t"\ + "punpcklbw %%xmm7, %%xmm0 \n\t"\ + "movdqa %%xmm1, %%xmm2 \n\t"\ + "movdqa %%xmm1, %%xmm3 \n\t"\ + "movdqa %%xmm1, %%xmm4 \n\t"\ + "movdqa %%xmm1, %%xmm5 \n\t"\ + "palignr $2, %%xmm0, %%xmm4 \n\t"\ + "palignr $4, %%xmm0, %%xmm3 \n\t"\ + "palignr $6, %%xmm0, %%xmm2 \n\t"\ + "palignr $8, %%xmm0, %%xmm1 \n\t"\ + "palignr $10,%%xmm0, %%xmm5 \n\t"\ + "paddw %%xmm5, %%xmm0 \n\t"\ + "paddw %%xmm3, %%xmm2 \n\t"\ + "paddw %%xmm4, %%xmm1 \n\t"\ + "psllw $2, %%xmm2 \n\t"\ + "psubw %%xmm1, %%xmm2 \n\t"\ + "paddw "MANGLE(ff_pw_16)", %%xmm0\n\t"\ + "pmullw %%xmm6, %%xmm2 \n\t"\ + "paddw %%xmm0, %%xmm2 \n\t"\ + "psraw $5, %%xmm2 \n\t"\ + "packuswb %%xmm2, %%xmm2 \n\t"\ + OP(%%xmm2, (%1), %%xmm4, q)\ + "add %3, %0 \n\t"\ + "add %4, %1 \n\t"\ + "decl %2 \n\t"\ + " jnz 1b \n\t"\ + : "+a"(src), "+c"(dst), "+g"(h)\ + : "D"((x86_reg)srcStride), "S"((x86_reg)dstStride)\ + : XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", \ + "%xmm4", "%xmm5", "%xmm6", "%xmm7",)\ + "memory"\ + );\ +}\ +static void OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ + OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\ + OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\ + src += 8*srcStride;\ + dst += 8*dstStride;\ + OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\ + OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\ +}\ + +#define QPEL_H264_V_XMM(OPNAME, OP, MMX)\ +static av_noinline void OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ + src -= 2*srcStride;\ + \ + __asm__ volatile(\ + "pxor %%xmm7, %%xmm7 \n\t"\ + "movq (%0), %%xmm0 \n\t"\ + "add %2, %0 \n\t"\ + "movq (%0), %%xmm1 \n\t"\ + "add %2, %0 \n\t"\ + "movq (%0), %%xmm2 \n\t"\ + "add %2, %0 \n\t"\ + "movq (%0), %%xmm3 \n\t"\ + "add %2, %0 \n\t"\ + "movq (%0), %%xmm4 \n\t"\ + "add %2, %0 \n\t"\ + "punpcklbw %%xmm7, %%xmm0 \n\t"\ + "punpcklbw %%xmm7, %%xmm1 \n\t"\ + "punpcklbw %%xmm7, %%xmm2 \n\t"\ + "punpcklbw %%xmm7, %%xmm3 \n\t"\ + "punpcklbw %%xmm7, %%xmm4 \n\t"\ + QPEL_H264V_XMM(%%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, OP)\ + QPEL_H264V_XMM(%%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, OP)\ + QPEL_H264V_XMM(%%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, OP)\ + QPEL_H264V_XMM(%%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, OP)\ + QPEL_H264V_XMM(%%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, OP)\ + QPEL_H264V_XMM(%%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, OP)\ + QPEL_H264V_XMM(%%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, OP)\ + QPEL_H264V_XMM(%%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, OP)\ + "cmpl $16, %4 \n\t"\ + "jne 2f \n\t"\ + QPEL_H264V_XMM(%%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, OP)\ + QPEL_H264V_XMM(%%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, OP)\ + QPEL_H264V_XMM(%%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, OP)\ + QPEL_H264V_XMM(%%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, OP)\ + QPEL_H264V_XMM(%%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, OP)\ + QPEL_H264V_XMM(%%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, OP)\ + QPEL_H264V_XMM(%%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, OP)\ + QPEL_H264V_XMM(%%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, OP)\ + "2: \n\t"\ + \ + : "+a"(src), "+c"(dst)\ + : "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "g"(h)\ + : XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", \ + "%xmm4", "%xmm5", "%xmm6", "%xmm7",)\ + "memory"\ + );\ +}\ +static void OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ + OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 8);\ +}\ +static av_noinline void OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ + OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 16);\ + OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\ +} + +static av_always_inline void put_h264_qpel8or16_hv1_lowpass_sse2(int16_t *tmp, uint8_t *src, int tmpStride, int srcStride, int size){ + int w = (size+8)>>3; + src -= 2*srcStride+2; + while(w--){ + __asm__ volatile( + "pxor %%xmm7, %%xmm7 \n\t" + "movq (%0), %%xmm0 \n\t" + "add %2, %0 \n\t" + "movq (%0), %%xmm1 \n\t" + "add %2, %0 \n\t" + "movq (%0), %%xmm2 \n\t" + "add %2, %0 \n\t" + "movq (%0), %%xmm3 \n\t" + "add %2, %0 \n\t" + "movq (%0), %%xmm4 \n\t" + "add %2, %0 \n\t" + "punpcklbw %%xmm7, %%xmm0 \n\t" + "punpcklbw %%xmm7, %%xmm1 \n\t" + "punpcklbw %%xmm7, %%xmm2 \n\t" + "punpcklbw %%xmm7, %%xmm3 \n\t" + "punpcklbw %%xmm7, %%xmm4 \n\t" + QPEL_H264HV_XMM(%%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, 0*48) + QPEL_H264HV_XMM(%%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, 1*48) + QPEL_H264HV_XMM(%%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, 2*48) + QPEL_H264HV_XMM(%%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, 3*48) + QPEL_H264HV_XMM(%%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, 4*48) + QPEL_H264HV_XMM(%%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, 5*48) + QPEL_H264HV_XMM(%%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, 6*48) + QPEL_H264HV_XMM(%%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, 7*48) + "cmpl $16, %3 \n\t" + "jne 2f \n\t" + QPEL_H264HV_XMM(%%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, 8*48) + QPEL_H264HV_XMM(%%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, 9*48) + QPEL_H264HV_XMM(%%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, 10*48) + QPEL_H264HV_XMM(%%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, 11*48) + QPEL_H264HV_XMM(%%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, 12*48) + QPEL_H264HV_XMM(%%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, 13*48) + QPEL_H264HV_XMM(%%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, 14*48) + QPEL_H264HV_XMM(%%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, 15*48) + "2: \n\t" + : "+a"(src) + : "c"(tmp), "S"((x86_reg)srcStride), "g"(size) + : XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", + "%xmm4", "%xmm5", "%xmm6", "%xmm7",) + "memory" + ); + tmp += 8; + src += 8 - (size+5)*srcStride; + } +} + +#define QPEL_H264_HV2_XMM(OPNAME, OP, MMX)\ +static av_always_inline void OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, int dstStride, int tmpStride, int size){\ + int h = size;\ + if(size == 16){\ + __asm__ volatile(\ + "1: \n\t"\ + "movdqa 32(%0), %%xmm4 \n\t"\ + "movdqa 16(%0), %%xmm5 \n\t"\ + "movdqa (%0), %%xmm7 \n\t"\ + "movdqa %%xmm4, %%xmm3 \n\t"\ + "movdqa %%xmm4, %%xmm2 \n\t"\ + "movdqa %%xmm4, %%xmm1 \n\t"\ + "movdqa %%xmm4, %%xmm0 \n\t"\ + "palignr $10, %%xmm5, %%xmm0 \n\t"\ + "palignr $8, %%xmm5, %%xmm1 \n\t"\ + "palignr $6, %%xmm5, %%xmm2 \n\t"\ + "palignr $4, %%xmm5, %%xmm3 \n\t"\ + "palignr $2, %%xmm5, %%xmm4 \n\t"\ + "paddw %%xmm5, %%xmm0 \n\t"\ + "paddw %%xmm4, %%xmm1 \n\t"\ + "paddw %%xmm3, %%xmm2 \n\t"\ + "movdqa %%xmm5, %%xmm6 \n\t"\ + "movdqa %%xmm5, %%xmm4 \n\t"\ + "movdqa %%xmm5, %%xmm3 \n\t"\ + "palignr $8, %%xmm7, %%xmm4 \n\t"\ + "palignr $2, %%xmm7, %%xmm6 \n\t"\ + "palignr $10, %%xmm7, %%xmm3 \n\t"\ + "paddw %%xmm6, %%xmm4 \n\t"\ + "movdqa %%xmm5, %%xmm6 \n\t"\ + "palignr $6, %%xmm7, %%xmm5 \n\t"\ + "palignr $4, %%xmm7, %%xmm6 \n\t"\ + "paddw %%xmm7, %%xmm3 \n\t"\ + "paddw %%xmm6, %%xmm5 \n\t"\ + \ + "psubw %%xmm1, %%xmm0 \n\t"\ + "psubw %%xmm4, %%xmm3 \n\t"\ + "psraw $2, %%xmm0 \n\t"\ + "psraw $2, %%xmm3 \n\t"\ + "psubw %%xmm1, %%xmm0 \n\t"\ + "psubw %%xmm4, %%xmm3 \n\t"\ + "paddw %%xmm2, %%xmm0 \n\t"\ + "paddw %%xmm5, %%xmm3 \n\t"\ + "psraw $2, %%xmm0 \n\t"\ + "psraw $2, %%xmm3 \n\t"\ + "paddw %%xmm2, %%xmm0 \n\t"\ + "paddw %%xmm5, %%xmm3 \n\t"\ + "psraw $6, %%xmm0 \n\t"\ + "psraw $6, %%xmm3 \n\t"\ + "packuswb %%xmm0, %%xmm3 \n\t"\ + OP(%%xmm3, (%1), %%xmm7, dqa)\ + "add $48, %0 \n\t"\ + "add %3, %1 \n\t"\ + "decl %2 \n\t"\ + " jnz 1b \n\t"\ + : "+a"(tmp), "+c"(dst), "+g"(h)\ + : "S"((x86_reg)dstStride)\ + : XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", \ + "%xmm4", "%xmm5", "%xmm6", "%xmm7",)\ + "memory"\ + );\ + }else{\ + __asm__ volatile(\ + "1: \n\t"\ + "movdqa 16(%0), %%xmm1 \n\t"\ + "movdqa (%0), %%xmm0 \n\t"\ + "movdqa %%xmm1, %%xmm2 \n\t"\ + "movdqa %%xmm1, %%xmm3 \n\t"\ + "movdqa %%xmm1, %%xmm4 \n\t"\ + "movdqa %%xmm1, %%xmm5 \n\t"\ + "palignr $10, %%xmm0, %%xmm5 \n\t"\ + "palignr $8, %%xmm0, %%xmm4 \n\t"\ + "palignr $6, %%xmm0, %%xmm3 \n\t"\ + "palignr $4, %%xmm0, %%xmm2 \n\t"\ + "palignr $2, %%xmm0, %%xmm1 \n\t"\ + "paddw %%xmm5, %%xmm0 \n\t"\ + "paddw %%xmm4, %%xmm1 \n\t"\ + "paddw %%xmm3, %%xmm2 \n\t"\ + "psubw %%xmm1, %%xmm0 \n\t"\ + "psraw $2, %%xmm0 \n\t"\ + "psubw %%xmm1, %%xmm0 \n\t"\ + "paddw %%xmm2, %%xmm0 \n\t"\ + "psraw $2, %%xmm0 \n\t"\ + "paddw %%xmm2, %%xmm0 \n\t"\ + "psraw $6, %%xmm0 \n\t"\ + "packuswb %%xmm0, %%xmm0 \n\t"\ + OP(%%xmm0, (%1), %%xmm7, q)\ + "add $48, %0 \n\t"\ + "add %3, %1 \n\t"\ + "decl %2 \n\t"\ + " jnz 1b \n\t"\ + : "+a"(tmp), "+c"(dst), "+g"(h)\ + : "S"((x86_reg)dstStride)\ + : XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", \ + "%xmm4", "%xmm5", "%xmm6", "%xmm7",)\ + "memory"\ + );\ + }\ +} + +#define QPEL_H264_HV_XMM(OPNAME, OP, MMX)\ +static av_noinline void OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride, int size){\ + put_h264_qpel8or16_hv1_lowpass_sse2(tmp, src, tmpStride, srcStride, size);\ + OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(dst, tmp, dstStride, tmpStride, size);\ +}\ +static void OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\ + OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst, tmp, src, dstStride, tmpStride, srcStride, 8);\ +}\ +static void OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\ + OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst, tmp, src, dstStride, tmpStride, srcStride, 16);\ +}\ + +#define put_pixels8_l2_sse2 put_pixels8_l2_mmx2 +#define avg_pixels8_l2_sse2 avg_pixels8_l2_mmx2 +#define put_pixels16_l2_sse2 put_pixels16_l2_mmx2 +#define avg_pixels16_l2_sse2 avg_pixels16_l2_mmx2 +#define put_pixels8_l2_ssse3 put_pixels8_l2_mmx2 +#define avg_pixels8_l2_ssse3 avg_pixels8_l2_mmx2 +#define put_pixels16_l2_ssse3 put_pixels16_l2_mmx2 +#define avg_pixels16_l2_ssse3 avg_pixels16_l2_mmx2 + +#define put_pixels8_l2_shift5_sse2 put_pixels8_l2_shift5_mmx2 +#define avg_pixels8_l2_shift5_sse2 avg_pixels8_l2_shift5_mmx2 +#define put_pixels16_l2_shift5_sse2 put_pixels16_l2_shift5_mmx2 +#define avg_pixels16_l2_shift5_sse2 avg_pixels16_l2_shift5_mmx2 +#define put_pixels8_l2_shift5_ssse3 put_pixels8_l2_shift5_mmx2 +#define avg_pixels8_l2_shift5_ssse3 avg_pixels8_l2_shift5_mmx2 +#define put_pixels16_l2_shift5_ssse3 put_pixels16_l2_shift5_mmx2 +#define avg_pixels16_l2_shift5_ssse3 avg_pixels16_l2_shift5_mmx2 + +#define put_h264_qpel8_h_lowpass_l2_sse2 put_h264_qpel8_h_lowpass_l2_mmx2 +#define avg_h264_qpel8_h_lowpass_l2_sse2 avg_h264_qpel8_h_lowpass_l2_mmx2 +#define put_h264_qpel16_h_lowpass_l2_sse2 put_h264_qpel16_h_lowpass_l2_mmx2 +#define avg_h264_qpel16_h_lowpass_l2_sse2 avg_h264_qpel16_h_lowpass_l2_mmx2 + +#define put_h264_qpel8_v_lowpass_ssse3 put_h264_qpel8_v_lowpass_sse2 +#define avg_h264_qpel8_v_lowpass_ssse3 avg_h264_qpel8_v_lowpass_sse2 +#define put_h264_qpel16_v_lowpass_ssse3 put_h264_qpel16_v_lowpass_sse2 +#define avg_h264_qpel16_v_lowpass_ssse3 avg_h264_qpel16_v_lowpass_sse2 + +#define put_h264_qpel8or16_hv2_lowpass_sse2 put_h264_qpel8or16_hv2_lowpass_mmx2 +#define avg_h264_qpel8or16_hv2_lowpass_sse2 avg_h264_qpel8or16_hv2_lowpass_mmx2 + +#define H264_MC(OPNAME, SIZE, MMX, ALIGN) \ +H264_MC_C(OPNAME, SIZE, MMX, ALIGN)\ +H264_MC_V(OPNAME, SIZE, MMX, ALIGN)\ +H264_MC_H(OPNAME, SIZE, MMX, ALIGN)\ +H264_MC_HV(OPNAME, SIZE, MMX, ALIGN)\ + +static void put_h264_qpel16_mc00_sse2 (uint8_t *dst, uint8_t *src, int stride){ + put_pixels16_sse2(dst, src, stride, 16); +} +static void avg_h264_qpel16_mc00_sse2 (uint8_t *dst, uint8_t *src, int stride){ + avg_pixels16_sse2(dst, src, stride, 16); +} +#define put_h264_qpel8_mc00_sse2 put_h264_qpel8_mc00_mmx2 +#define avg_h264_qpel8_mc00_sse2 avg_h264_qpel8_mc00_mmx2 + +#define H264_MC_C(OPNAME, SIZE, MMX, ALIGN) \ +static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\ + OPNAME ## pixels ## SIZE ## _ ## MMX(dst, src, stride, SIZE);\ +}\ + +#define H264_MC_H(OPNAME, SIZE, MMX, ALIGN) \ +static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, src, stride, stride);\ +}\ +\ +static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## MMX(dst, src, stride, stride);\ +}\ +\ +static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, src+1, stride, stride);\ +}\ + +#define H264_MC_V(OPNAME, SIZE, MMX, ALIGN) \ +static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ + put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ + OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, temp, stride, stride, SIZE);\ +}\ +\ +static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## MMX(dst, src, stride, stride);\ +}\ +\ +static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ + put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ + OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, temp, stride, stride, SIZE);\ +}\ + +#define H264_MC_HV(OPNAME, SIZE, MMX, ALIGN) \ +static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ + put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ + OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\ +}\ +\ +static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ + put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\ + OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\ +}\ +\ +static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ + put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ + OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, temp, stride, SIZE);\ +}\ +\ +static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ + put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\ + OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, temp, stride, SIZE);\ +}\ +\ +static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + DECLARE_ALIGNED(ALIGN, uint16_t, temp)[SIZE*(SIZE<8?12:24)];\ + OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(dst, temp, src, stride, SIZE, stride);\ +}\ +\ +static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\ + uint8_t * const halfHV= temp;\ + int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\ + assert(((int)temp & 7) == 0);\ + put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\ + OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, halfHV, stride, SIZE);\ +}\ +\ +static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\ + uint8_t * const halfHV= temp;\ + int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\ + assert(((int)temp & 7) == 0);\ + put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\ + OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, halfHV, stride, SIZE);\ +}\ +\ +static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\ + uint8_t * const halfHV= temp;\ + int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\ + assert(((int)temp & 7) == 0);\ + put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\ + OPNAME ## pixels ## SIZE ## _l2_shift5_ ## MMX(dst, halfV+2, halfHV, stride, SIZE, SIZE);\ +}\ +\ +static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ + DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\ + uint8_t * const halfHV= temp;\ + int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\ + assert(((int)temp & 7) == 0);\ + put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\ + OPNAME ## pixels ## SIZE ## _l2_shift5_ ## MMX(dst, halfV+3, halfHV, stride, SIZE, SIZE);\ +}\ + +#define H264_MC_4816(MMX)\ +H264_MC(put_, 4, MMX, 8)\ +H264_MC(put_, 8, MMX, 8)\ +H264_MC(put_, 16,MMX, 8)\ +H264_MC(avg_, 4, MMX, 8)\ +H264_MC(avg_, 8, MMX, 8)\ +H264_MC(avg_, 16,MMX, 8)\ + +#define H264_MC_816(QPEL, XMM)\ +QPEL(put_, 8, XMM, 16)\ +QPEL(put_, 16,XMM, 16)\ +QPEL(avg_, 8, XMM, 16)\ +QPEL(avg_, 16,XMM, 16)\ + + +#define AVG_3DNOW_OP(a,b,temp, size) \ +"mov" #size " " #b ", " #temp " \n\t"\ +"pavgusb " #temp ", " #a " \n\t"\ +"mov" #size " " #a ", " #b " \n\t" +#define AVG_MMX2_OP(a,b,temp, size) \ +"mov" #size " " #b ", " #temp " \n\t"\ +"pavgb " #temp ", " #a " \n\t"\ +"mov" #size " " #a ", " #b " \n\t" + +#define PAVGB "pavgusb" +QPEL_H264(put_, PUT_OP, 3dnow) +QPEL_H264(avg_, AVG_3DNOW_OP, 3dnow) +#undef PAVGB +#define PAVGB "pavgb" +QPEL_H264(put_, PUT_OP, mmx2) +QPEL_H264(avg_, AVG_MMX2_OP, mmx2) +QPEL_H264_V_XMM(put_, PUT_OP, sse2) +QPEL_H264_V_XMM(avg_, AVG_MMX2_OP, sse2) +QPEL_H264_HV_XMM(put_, PUT_OP, sse2) +QPEL_H264_HV_XMM(avg_, AVG_MMX2_OP, sse2) +#if HAVE_SSSE3 +QPEL_H264_H_XMM(put_, PUT_OP, ssse3) +QPEL_H264_H_XMM(avg_, AVG_MMX2_OP, ssse3) +QPEL_H264_HV2_XMM(put_, PUT_OP, ssse3) +QPEL_H264_HV2_XMM(avg_, AVG_MMX2_OP, ssse3) +QPEL_H264_HV_XMM(put_, PUT_OP, ssse3) +QPEL_H264_HV_XMM(avg_, AVG_MMX2_OP, ssse3) +#endif +#undef PAVGB + +H264_MC_4816(3dnow) +H264_MC_4816(mmx2) +H264_MC_816(H264_MC_V, sse2) +H264_MC_816(H264_MC_HV, sse2) +#if HAVE_SSSE3 +H264_MC_816(H264_MC_H, ssse3) +H264_MC_816(H264_MC_HV, ssse3) +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_weight.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_weight.asm new file mode 100644 index 00000000..53aa2104 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/h264_weight.asm @@ -0,0 +1,375 @@ +;***************************************************************************** +;* SSE2-optimized weighted prediction code +;***************************************************************************** +;* Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt +;* Copyright (C) 2010 Eli Friedman +;* +;* 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 +;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;****************************************************************************** + +%include "x86inc.asm" + +SECTION .text + +;----------------------------------------------------------------------------- +; biweight pred: +; +; void h264_biweight_16x16_sse2(uint8_t *dst, uint8_t *src, int stride, +; int log2_denom, int weightd, int weights, +; int offset); +; and +; void h264_weight_16x16_sse2(uint8_t *dst, int stride, +; int log2_denom, int weight, +; int offset); +;----------------------------------------------------------------------------- + +%macro WEIGHT_SETUP 0 + add r4, r4 + inc r4 + movd m3, r3d + movd m5, r4d + movd m6, r2d + pslld m5, m6 + psrld m5, 1 +%if mmsize == 16 + pshuflw m3, m3, 0 + pshuflw m5, m5, 0 + punpcklqdq m3, m3 + punpcklqdq m5, m5 +%else + pshufw m3, m3, 0 + pshufw m5, m5, 0 +%endif + pxor m7, m7 +%endmacro + +%macro WEIGHT_OP 2 + movh m0, [r0+%1] + movh m1, [r0+%2] + punpcklbw m0, m7 + punpcklbw m1, m7 + pmullw m0, m3 + pmullw m1, m3 + paddsw m0, m5 + paddsw m1, m5 + psraw m0, m6 + psraw m1, m6 + packuswb m0, m1 +%endmacro + +%macro WEIGHT_FUNC_DBL_MM 1 +cglobal h264_weight_16x%1_mmx2, 5, 5, 0 + WEIGHT_SETUP + mov r2, %1 +%if %1 == 16 +.nextrow + WEIGHT_OP 0, 4 + mova [r0 ], m0 + WEIGHT_OP 8, 12 + mova [r0+8], m0 + add r0, r1 + dec r2 + jnz .nextrow + REP_RET +%else + jmp mangle(ff_h264_weight_16x16_mmx2.nextrow) +%endif +%endmacro + +INIT_MMX +WEIGHT_FUNC_DBL_MM 16 +WEIGHT_FUNC_DBL_MM 8 + +%macro WEIGHT_FUNC_MM 4 +cglobal h264_weight_%1x%2_%4, 7, 7, %3 + WEIGHT_SETUP + mov r2, %2 +%if %2 == 16 +.nextrow + WEIGHT_OP 0, mmsize/2 + mova [r0], m0 + add r0, r1 + dec r2 + jnz .nextrow + REP_RET +%else + jmp mangle(ff_h264_weight_%1x16_%4.nextrow) +%endif +%endmacro + +INIT_MMX +WEIGHT_FUNC_MM 8, 16, 0, mmx2 +WEIGHT_FUNC_MM 8, 8, 0, mmx2 +WEIGHT_FUNC_MM 8, 4, 0, mmx2 +INIT_XMM +WEIGHT_FUNC_MM 16, 16, 8, sse2 +WEIGHT_FUNC_MM 16, 8, 8, sse2 + +%macro WEIGHT_FUNC_HALF_MM 5 +cglobal h264_weight_%1x%2_%5, 5, 5, %4 + WEIGHT_SETUP + mov r2, %2/2 + lea r3, [r1*2] +%if %2 == mmsize +.nextrow + WEIGHT_OP 0, r1 + movh [r0], m0 +%if mmsize == 16 + movhps [r0+r1], m0 +%else + psrlq m0, 32 + movh [r0+r1], m0 +%endif + add r0, r3 + dec r2 + jnz .nextrow + REP_RET +%else + jmp mangle(ff_h264_weight_%1x%3_%5.nextrow) +%endif +%endmacro + +INIT_MMX +WEIGHT_FUNC_HALF_MM 4, 8, 8, 0, mmx2 +WEIGHT_FUNC_HALF_MM 4, 4, 8, 0, mmx2 +WEIGHT_FUNC_HALF_MM 4, 2, 8, 0, mmx2 +INIT_XMM +WEIGHT_FUNC_HALF_MM 8, 16, 16, 8, sse2 +WEIGHT_FUNC_HALF_MM 8, 8, 16, 8, sse2 +WEIGHT_FUNC_HALF_MM 8, 4, 16, 8, sse2 + +%macro BIWEIGHT_SETUP 0 + add r6, 1 + or r6, 1 + add r3, 1 + movd m3, r4d + movd m4, r5d + movd m5, r6d + movd m6, r3d + pslld m5, m6 + psrld m5, 1 +%if mmsize == 16 + pshuflw m3, m3, 0 + pshuflw m4, m4, 0 + pshuflw m5, m5, 0 + punpcklqdq m3, m3 + punpcklqdq m4, m4 + punpcklqdq m5, m5 +%else + pshufw m3, m3, 0 + pshufw m4, m4, 0 + pshufw m5, m5, 0 +%endif + pxor m7, m7 +%endmacro + +%macro BIWEIGHT_STEPA 3 + movh m%1, [r0+%3] + movh m%2, [r1+%3] + punpcklbw m%1, m7 + punpcklbw m%2, m7 + pmullw m%1, m3 + pmullw m%2, m4 + paddsw m%1, m%2 +%endmacro + +%macro BIWEIGHT_STEPB 0 + paddsw m0, m5 + paddsw m1, m5 + psraw m0, m6 + psraw m1, m6 + packuswb m0, m1 +%endmacro + +%macro BIWEIGHT_FUNC_DBL_MM 1 +cglobal h264_biweight_16x%1_mmx2, 7, 7, 0 + BIWEIGHT_SETUP + mov r3, %1 +%if %1 == 16 +.nextrow + BIWEIGHT_STEPA 0, 1, 0 + BIWEIGHT_STEPA 1, 2, 4 + BIWEIGHT_STEPB + mova [r0], m0 + BIWEIGHT_STEPA 0, 1, 8 + BIWEIGHT_STEPA 1, 2, 12 + BIWEIGHT_STEPB + mova [r0+8], m0 + add r0, r2 + add r1, r2 + dec r3 + jnz .nextrow + REP_RET +%else + jmp mangle(ff_h264_biweight_16x16_mmx2.nextrow) +%endif +%endmacro + +INIT_MMX +BIWEIGHT_FUNC_DBL_MM 16 +BIWEIGHT_FUNC_DBL_MM 8 + +%macro BIWEIGHT_FUNC_MM 4 +cglobal h264_biweight_%1x%2_%4, 7, 7, %3 + BIWEIGHT_SETUP + mov r3, %2 +%if %2 == 16 +.nextrow + BIWEIGHT_STEPA 0, 1, 0 + BIWEIGHT_STEPA 1, 2, mmsize/2 + BIWEIGHT_STEPB + mova [r0], m0 + add r0, r2 + add r1, r2 + dec r3 + jnz .nextrow + REP_RET +%else + jmp mangle(ff_h264_biweight_%1x16_%4.nextrow) +%endif +%endmacro + +INIT_MMX +BIWEIGHT_FUNC_MM 8, 16, 0, mmx2 +BIWEIGHT_FUNC_MM 8, 8, 0, mmx2 +BIWEIGHT_FUNC_MM 8, 4, 0, mmx2 +INIT_XMM +BIWEIGHT_FUNC_MM 16, 16, 8, sse2 +BIWEIGHT_FUNC_MM 16, 8, 8, sse2 + +%macro BIWEIGHT_FUNC_HALF_MM 5 +cglobal h264_biweight_%1x%2_%5, 7, 7, %4 + BIWEIGHT_SETUP + mov r3, %2/2 + lea r4, [r2*2] +%if %2 == mmsize +.nextrow + BIWEIGHT_STEPA 0, 1, 0 + BIWEIGHT_STEPA 1, 2, r2 + BIWEIGHT_STEPB + movh [r0], m0 +%if mmsize == 16 + movhps [r0+r2], m0 +%else + psrlq m0, 32 + movh [r0+r2], m0 +%endif + add r0, r4 + add r1, r4 + dec r3 + jnz .nextrow + REP_RET +%else + jmp mangle(ff_h264_biweight_%1x%3_%5.nextrow) +%endif +%endmacro + +INIT_MMX +BIWEIGHT_FUNC_HALF_MM 4, 8, 8, 0, mmx2 +BIWEIGHT_FUNC_HALF_MM 4, 4, 8, 0, mmx2 +BIWEIGHT_FUNC_HALF_MM 4, 2, 8, 0, mmx2 +INIT_XMM +BIWEIGHT_FUNC_HALF_MM 8, 16, 16, 8, sse2 +BIWEIGHT_FUNC_HALF_MM 8, 8, 16, 8, sse2 +BIWEIGHT_FUNC_HALF_MM 8, 4, 16, 8, sse2 + +%macro BIWEIGHT_SSSE3_SETUP 0 + add r6, 1 + or r6, 1 + add r3, 1 + movd m4, r4d + movd m0, r5d + movd m5, r6d + movd m6, r3d + pslld m5, m6 + psrld m5, 1 + punpcklbw m4, m0 + pshuflw m4, m4, 0 + pshuflw m5, m5, 0 + punpcklqdq m4, m4 + punpcklqdq m5, m5 +%endmacro + +%macro BIWEIGHT_SSSE3_OP 0 + pmaddubsw m0, m4 + pmaddubsw m2, m4 + paddsw m0, m5 + paddsw m2, m5 + psraw m0, m6 + psraw m2, m6 + packuswb m0, m2 +%endmacro + +%macro BIWEIGHT_SSSE3_16 1 +cglobal h264_biweight_16x%1_ssse3, 7, 7, 8 + BIWEIGHT_SSSE3_SETUP + mov r3, %1 + +%if %1 == 16 +.nextrow + movh m0, [r0] + movh m2, [r0+8] + movh m3, [r1+8] + punpcklbw m0, [r1] + punpcklbw m2, m3 + BIWEIGHT_SSSE3_OP + mova [r0], m0 + add r0, r2 + add r1, r2 + dec r3 + jnz .nextrow + REP_RET +%else + jmp mangle(ff_h264_biweight_16x16_ssse3.nextrow) +%endif +%endmacro + +INIT_XMM +BIWEIGHT_SSSE3_16 16 +BIWEIGHT_SSSE3_16 8 + +%macro BIWEIGHT_SSSE3_8 1 +cglobal h264_biweight_8x%1_ssse3, 7, 7, 8 + BIWEIGHT_SSSE3_SETUP + mov r3, %1/2 + lea r4, [r2*2] + +%if %1 == 16 +.nextrow + movh m0, [r0] + movh m1, [r1] + movh m2, [r0+r2] + movh m3, [r1+r2] + punpcklbw m0, m1 + punpcklbw m2, m3 + BIWEIGHT_SSSE3_OP + movh [r0], m0 + movhps [r0+r2], m0 + add r0, r4 + add r1, r4 + dec r3 + jnz .nextrow + REP_RET +%else + jmp mangle(ff_h264_biweight_8x16_ssse3.nextrow) +%endif +%endmacro + +INIT_XMM +BIWEIGHT_SSSE3_8 16 +BIWEIGHT_SSSE3_8 8 +BIWEIGHT_SSSE3_8 4 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/lpc_mmx.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/lpc_mmx.c new file mode 100644 index 00000000..1c202e2c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/lpc_mmx.c @@ -0,0 +1,147 @@ +/* + * MMX optimized LPC DSP utils + * Copyright (c) 2007 Loren Merritt + * + * 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 + */ + +#include "libavutil/x86_cpu.h" +#include "libavutil/cpu.h" +#include "libavcodec/lpc.h" + +static void lpc_apply_welch_window_sse2(const int32_t *data, int len, + double *w_data) +{ + double c = 2.0 / (len-1.0); + int n2 = len>>1; + x86_reg i = -n2*sizeof(int32_t); + x86_reg j = n2*sizeof(int32_t); + __asm__ volatile( + "movsd %4, %%xmm7 \n\t" + "movapd "MANGLE(ff_pd_1)", %%xmm6 \n\t" + "movapd "MANGLE(ff_pd_2)", %%xmm5 \n\t" + "movlhps %%xmm7, %%xmm7 \n\t" + "subpd %%xmm5, %%xmm7 \n\t" + "addsd %%xmm6, %%xmm7 \n\t" + "test $1, %5 \n\t" + "jz 2f \n\t" +#define WELCH(MOVPD, offset)\ + "1: \n\t"\ + "movapd %%xmm7, %%xmm1 \n\t"\ + "mulpd %%xmm1, %%xmm1 \n\t"\ + "movapd %%xmm6, %%xmm0 \n\t"\ + "subpd %%xmm1, %%xmm0 \n\t"\ + "pshufd $0x4e, %%xmm0, %%xmm1 \n\t"\ + "cvtpi2pd (%3,%0), %%xmm2 \n\t"\ + "cvtpi2pd "#offset"*4(%3,%1), %%xmm3 \n\t"\ + "mulpd %%xmm0, %%xmm2 \n\t"\ + "mulpd %%xmm1, %%xmm3 \n\t"\ + "movapd %%xmm2, (%2,%0,2) \n\t"\ + MOVPD" %%xmm3, "#offset"*8(%2,%1,2) \n\t"\ + "subpd %%xmm5, %%xmm7 \n\t"\ + "sub $8, %1 \n\t"\ + "add $8, %0 \n\t"\ + "jl 1b \n\t"\ + + WELCH("movupd", -1) + "jmp 3f \n\t" + "2: \n\t" + WELCH("movapd", -2) + "3: \n\t" + :"+&r"(i), "+&r"(j) + :"r"(w_data+n2), "r"(data+n2), "m"(c), "r"(len) + XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3", + "%xmm5", "%xmm6", "%xmm7") + ); +#undef WELCH +} + +static void lpc_compute_autocorr_sse2(const double *data, int len, int lag, + double *autoc) +{ + int j; + + if((x86_reg)data & 15) + data++; + + for(j=0; jlpc_apply_welch_window = lpc_apply_welch_window_sse2; + c->lpc_compute_autocorr = lpc_compute_autocorr_sse2; + } +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/mpegaudiodec_mmx.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/mpegaudiodec_mmx.c new file mode 100644 index 00000000..2f342815 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/mpegaudiodec_mmx.c @@ -0,0 +1,158 @@ +/* + * MMX optimized MP3 decoding functions + * Copyright (c) 2010 Vitor Sessak + * + * 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 + */ + +#include "libavutil/cpu.h" +#include "libavutil/x86_cpu.h" + +#define CONFIG_FLOAT 1 +#include "libavcodec/mpegaudio.h" + +#define MACS(rt, ra, rb) rt+=(ra)*(rb) +#define MLSS(rt, ra, rb) rt-=(ra)*(rb) + +#define SUM8(op, sum, w, p) \ +{ \ + op(sum, (w)[0 * 64], (p)[0 * 64]); \ + op(sum, (w)[1 * 64], (p)[1 * 64]); \ + op(sum, (w)[2 * 64], (p)[2 * 64]); \ + op(sum, (w)[3 * 64], (p)[3 * 64]); \ + op(sum, (w)[4 * 64], (p)[4 * 64]); \ + op(sum, (w)[5 * 64], (p)[5 * 64]); \ + op(sum, (w)[6 * 64], (p)[6 * 64]); \ + op(sum, (w)[7 * 64], (p)[7 * 64]); \ +} + +static void apply_window(const float *buf, const float *win1, + const float *win2, float *sum1, float *sum2, int len) +{ + x86_reg count = - 4*len; + const float *win1a = win1+len; + const float *win2a = win2+len; + const float *bufa = buf+len; + float *sum1a = sum1+len; + float *sum2a = sum2+len; + + +#define MULT(a, b) \ + "movaps " #a "(%1,%0), %%xmm1 \n\t" \ + "movaps " #a "(%3,%0), %%xmm2 \n\t" \ + "mulps %%xmm2, %%xmm1 \n\t" \ + "subps %%xmm1, %%xmm0 \n\t" \ + "mulps " #b "(%2,%0), %%xmm2 \n\t" \ + "subps %%xmm2, %%xmm4 \n\t" \ + + __asm__ volatile( + "1: \n\t" + "xorps %%xmm0, %%xmm0 \n\t" + "xorps %%xmm4, %%xmm4 \n\t" + + MULT( 0, 0) + MULT( 256, 64) + MULT( 512, 128) + MULT( 768, 192) + MULT(1024, 256) + MULT(1280, 320) + MULT(1536, 384) + MULT(1792, 448) + + "movaps %%xmm0, (%4,%0) \n\t" + "movaps %%xmm4, (%5,%0) \n\t" + "add $16, %0 \n\t" + "jl 1b \n\t" + :"+&r"(count) + :"r"(win1a), "r"(win2a), "r"(bufa), "r"(sum1a), "r"(sum2a) + ); + +#undef MULT +} + +static void apply_window_mp3(float *in, float *win, int *unused, float *out, + int incr) +{ + LOCAL_ALIGNED_16(float, suma, [17]); + LOCAL_ALIGNED_16(float, sumb, [17]); + LOCAL_ALIGNED_16(float, sumc, [17]); + LOCAL_ALIGNED_16(float, sumd, [17]); + + float sum; + + /* copy to avoid wrap */ + memcpy(in + 512, in, 32 * sizeof(*in)); + + apply_window(in + 16, win , win + 512, suma, sumc, 16); + apply_window(in + 32, win + 48, win + 640, sumb, sumd, 16); + + SUM8(MACS, suma[0], win + 32, in + 48); + + sumc[ 0] = 0; + sumb[16] = 0; + sumd[16] = 0; + +#define SUMS(suma, sumb, sumc, sumd, out1, out2) \ + "movups " #sumd "(%4), %%xmm0 \n\t" \ + "shufps $0x1b, %%xmm0, %%xmm0 \n\t" \ + "subps " #suma "(%1), %%xmm0 \n\t" \ + "movaps %%xmm0," #out1 "(%0) \n\t" \ +\ + "movups " #sumc "(%3), %%xmm0 \n\t" \ + "shufps $0x1b, %%xmm0, %%xmm0 \n\t" \ + "addps " #sumb "(%2), %%xmm0 \n\t" \ + "movaps %%xmm0," #out2 "(%0) \n\t" + + if (incr == 1) { + __asm__ volatile( + SUMS( 0, 48, 4, 52, 0, 112) + SUMS(16, 32, 20, 36, 16, 96) + SUMS(32, 16, 36, 20, 32, 80) + SUMS(48, 0, 52, 4, 48, 64) + + :"+&r"(out) + :"r"(&suma[0]), "r"(&sumb[0]), "r"(&sumc[0]), "r"(&sumd[0]) + :"memory" + ); + out += 16*incr; + } else { + int j; + float *out2 = out + 32 * incr; + out[0 ] = -suma[ 0]; + out += incr; + out2 -= incr; + for(j=1;j<16;j++) { + *out = -suma[ j] + sumd[16-j]; + *out2 = sumb[16-j] + sumc[ j]; + out += incr; + out2 -= incr; + } + } + + sum = 0; + SUM8(MLSS, sum, win + 16 + 32, in + 32); + *out = sum; +} + +void ff_mpegaudiodec_init_mmx(MPADecodeContext *s) +{ + int mm_flags = av_get_cpu_flags(); + + if (mm_flags & AV_CPU_FLAG_SSE2) { + s->apply_window_mp3 = apply_window_mp3; + } +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vc1dsp_yasm.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vc1dsp_yasm.asm new file mode 100644 index 00000000..3ea9d8db --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vc1dsp_yasm.asm @@ -0,0 +1,330 @@ +;****************************************************************************** +;* VC1 deblocking optimizations +;* Copyright (c) 2009 David Conrad +;* +;* 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 +;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;****************************************************************************** + +%include "x86inc.asm" +%include "x86util.asm" + +cextern pw_4 +cextern pw_5 + +section .text + +; dst_low, dst_high (src), zero +; zero-extends one vector from 8 to 16 bits +%macro UNPACK_8TO16 4 + mova m%2, m%3 + punpckh%1 m%3, m%4 + punpckl%1 m%2, m%4 +%endmacro + +%macro STORE_4_WORDS_MMX 6 + movd %6d, %5 +%if mmsize==16 + psrldq %5, 4 +%else + psrlq %5, 32 +%endif + mov %1, %6w + shr %6, 16 + mov %2, %6w + movd %6d, %5 + mov %3, %6w + shr %6, 16 + mov %4, %6w +%endmacro + +%macro STORE_4_WORDS_SSE4 6 + pextrw %1, %5, %6+0 + pextrw %2, %5, %6+1 + pextrw %3, %5, %6+2 + pextrw %4, %5, %6+3 +%endmacro + +; in: p1 p0 q0 q1, clobbers p0 +; out: p1 = (2*(p1 - q1) - 5*(p0 - q0) + 4) >> 3 +%macro VC1_LOOP_FILTER_A0 4 + psubw %1, %4 + psubw %2, %3 + paddw %1, %1 + pmullw %2, [pw_5] + psubw %1, %2 + paddw %1, [pw_4] + psraw %1, 3 +%endmacro + +; in: p0 q0 a0 a1 a2 +; m0 m1 m7 m6 m5 +; %1: size +; out: m0=p0' m1=q0' +%macro VC1_FILTER 1 + PABSW m4, m7 + PABSW m3, m6 + PABSW m2, m5 + mova m6, m4 + pminsw m3, m2 + pcmpgtw m6, m3 ; if (a2 < a0 || a1 < a0) + psubw m3, m4 + pmullw m3, [pw_5] ; 5*(a3 - a0) + PABSW m2, m3 + psraw m2, 3 ; abs(d/8) + pxor m7, m3 ; d_sign ^= a0_sign + + pxor m5, m5 + movd m3, r2d +%if %1 > 4 + punpcklbw m3, m3 +%endif + punpcklbw m3, m5 + pcmpgtw m3, m4 ; if (a0 < pq) + pand m6, m3 + + mova m3, m0 + psubw m3, m1 + PABSW m4, m3 + psraw m4, 1 + pxor m3, m7 ; d_sign ^ clip_sign + psraw m3, 15 + pminsw m2, m4 ; min(d, clip) + pcmpgtw m4, m5 + pand m6, m4 ; filt3 (C return value) + +; each set of 4 pixels is not filtered if the 3rd is not +%if mmsize==16 + pshuflw m4, m6, 0xaa +%if %1 > 4 + pshufhw m4, m4, 0xaa +%endif +%else + pshufw m4, m6, 0xaa +%endif + pandn m3, m4 + pand m2, m6 + pand m3, m2 ; d final + + PSIGNW m3, m7 + psubw m0, m3 + paddw m1, m3 + packuswb m0, m0 + packuswb m1, m1 +%endmacro + +; 1st param: size of filter +; 2nd param: mov suffix equivalent to the filter size +%macro VC1_V_LOOP_FILTER 2 + pxor m5, m5 + mov%2 m6, [r4] + mov%2 m4, [r4+r1] + mov%2 m7, [r4+2*r1] + mov%2 m0, [r4+r3] + punpcklbw m6, m5 + punpcklbw m4, m5 + punpcklbw m7, m5 + punpcklbw m0, m5 + + VC1_LOOP_FILTER_A0 m6, m4, m7, m0 + mov%2 m1, [r0] + mov%2 m2, [r0+r1] + punpcklbw m1, m5 + punpcklbw m2, m5 + mova m4, m0 + VC1_LOOP_FILTER_A0 m7, m4, m1, m2 + mov%2 m3, [r0+2*r1] + mov%2 m4, [r0+r3] + punpcklbw m3, m5 + punpcklbw m4, m5 + mova m5, m1 + VC1_LOOP_FILTER_A0 m5, m2, m3, m4 + + VC1_FILTER %1 + mov%2 [r4+r3], m0 + mov%2 [r0], m1 +%endmacro + +; 1st param: size of filter +; NOTE: UNPACK_8TO16 this number of 8 bit numbers are in half a register +; 2nd (optional) param: temp register to use for storing words +%macro VC1_H_LOOP_FILTER 1-2 +%if %1 == 4 + movq m0, [r0 -4] + movq m1, [r0+ r1-4] + movq m2, [r0+2*r1-4] + movq m3, [r0+ r3-4] + TRANSPOSE4x4B 0, 1, 2, 3, 4 +%else + movq m0, [r0 -4] + movq m4, [r0+ r1-4] + movq m1, [r0+2*r1-4] + movq m5, [r0+ r3-4] + movq m2, [r4 -4] + movq m6, [r4+ r1-4] + movq m3, [r4+2*r1-4] + movq m7, [r4+ r3-4] + punpcklbw m0, m4 + punpcklbw m1, m5 + punpcklbw m2, m6 + punpcklbw m3, m7 + TRANSPOSE4x4W 0, 1, 2, 3, 4 +%endif + pxor m5, m5 + + UNPACK_8TO16 bw, 6, 0, 5 + UNPACK_8TO16 bw, 7, 1, 5 + VC1_LOOP_FILTER_A0 m6, m0, m7, m1 + UNPACK_8TO16 bw, 4, 2, 5 + mova m0, m1 ; m0 = p0 + VC1_LOOP_FILTER_A0 m7, m1, m4, m2 + UNPACK_8TO16 bw, 1, 3, 5 + mova m5, m4 + VC1_LOOP_FILTER_A0 m5, m2, m1, m3 + SWAP 1, 4 ; m1 = q0 + + VC1_FILTER %1 + punpcklbw m0, m1 +%if %0 > 1 + STORE_4_WORDS_MMX [r0-1], [r0+r1-1], [r0+2*r1-1], [r0+r3-1], m0, %2 +%if %1 > 4 + psrldq m0, 4 + STORE_4_WORDS_MMX [r4-1], [r4+r1-1], [r4+2*r1-1], [r4+r3-1], m0, %2 +%endif +%else + STORE_4_WORDS_SSE4 [r0-1], [r0+r1-1], [r0+2*r1-1], [r0+r3-1], m0, 0 + STORE_4_WORDS_SSE4 [r4-1], [r4+r1-1], [r4+2*r1-1], [r4+r3-1], m0, 4 +%endif +%endmacro + + +%macro START_V_FILTER 0 + mov r4, r0 + lea r3, [4*r1] + sub r4, r3 + lea r3, [r1+2*r1] + imul r2, 0x01010101 +%endmacro + +%macro START_H_FILTER 1 + lea r3, [r1+2*r1] +%if %1 > 4 + lea r4, [r0+4*r1] +%endif + imul r2, 0x01010101 +%endmacro + +; I dont know why the sign extension is needed... +%macro PSIGNW_SRA_MMX 2 + psraw %2, 15 + PSIGNW_MMX %1, %2 +%endmacro + + +%macro VC1_LF_MMX 1 +INIT_MMX +cglobal vc1_v_loop_filter_internal_%1 + VC1_V_LOOP_FILTER 4, d + ret + +cglobal vc1_h_loop_filter_internal_%1 + VC1_H_LOOP_FILTER 4, r4 + ret + +; void ff_vc1_v_loop_filter4_mmx2(uint8_t *src, int stride, int pq) +cglobal vc1_v_loop_filter4_%1, 3,5,0 + START_V_FILTER + call vc1_v_loop_filter_internal_%1 + RET + +; void ff_vc1_h_loop_filter4_mmx2(uint8_t *src, int stride, int pq) +cglobal vc1_h_loop_filter4_%1, 3,5,0 + START_H_FILTER 4 + call vc1_h_loop_filter_internal_%1 + RET + +; void ff_vc1_v_loop_filter8_mmx2(uint8_t *src, int stride, int pq) +cglobal vc1_v_loop_filter8_%1, 3,5,0 + START_V_FILTER + call vc1_v_loop_filter_internal_%1 + add r4, 4 + add r0, 4 + call vc1_v_loop_filter_internal_%1 + RET + +; void ff_vc1_h_loop_filter8_mmx2(uint8_t *src, int stride, int pq) +cglobal vc1_h_loop_filter8_%1, 3,5,0 + START_H_FILTER 4 + call vc1_h_loop_filter_internal_%1 + lea r0, [r0+4*r1] + call vc1_h_loop_filter_internal_%1 + RET +%endmacro + +%define PABSW PABSW_MMX +%define PSIGNW PSIGNW_SRA_MMX +VC1_LF_MMX mmx + +%define PABSW PABSW_MMX2 +VC1_LF_MMX mmx2 + +INIT_XMM +; void ff_vc1_v_loop_filter8_sse2(uint8_t *src, int stride, int pq) +cglobal vc1_v_loop_filter8_sse2, 3,5,8 + START_V_FILTER + VC1_V_LOOP_FILTER 8, q + RET + +; void ff_vc1_h_loop_filter8_sse2(uint8_t *src, int stride, int pq) +cglobal vc1_h_loop_filter8_sse2, 3,6,8 + START_H_FILTER 8 + VC1_H_LOOP_FILTER 8, r5 + RET + +%define PABSW PABSW_SSSE3 +%define PSIGNW PSIGNW_SSSE3 + +INIT_MMX +; void ff_vc1_v_loop_filter4_ssse3(uint8_t *src, int stride, int pq) +cglobal vc1_v_loop_filter4_ssse3, 3,5,0 + START_V_FILTER + VC1_V_LOOP_FILTER 4, d + RET + +; void ff_vc1_h_loop_filter4_ssse3(uint8_t *src, int stride, int pq) +cglobal vc1_h_loop_filter4_ssse3, 3,5,0 + START_H_FILTER 4 + VC1_H_LOOP_FILTER 4, r4 + RET + +INIT_XMM +; void ff_vc1_v_loop_filter8_ssse3(uint8_t *src, int stride, int pq) +cglobal vc1_v_loop_filter8_ssse3, 3,5,8 + START_V_FILTER + VC1_V_LOOP_FILTER 8, q + RET + +; void ff_vc1_h_loop_filter8_ssse3(uint8_t *src, int stride, int pq) +cglobal vc1_h_loop_filter8_ssse3, 3,6,8 + START_H_FILTER 8 + VC1_H_LOOP_FILTER 8, r5 + RET + +; void ff_vc1_h_loop_filter8_sse4(uint8_t *src, int stride, int pq) +cglobal vc1_h_loop_filter8_sse4, 3,5,8 + START_H_FILTER 8 + VC1_H_LOOP_FILTER 8 + RET diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp3dsp.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp3dsp.asm new file mode 100644 index 00000000..f2b0af32 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp3dsp.asm @@ -0,0 +1,618 @@ +;****************************************************************************** +;* MMX/SSE2-optimized functions for the VP3 decoder +;* Copyright (c) 2007 Aurelien Jacobs +;* +;* 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 +;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;****************************************************************************** + +%include "x86inc.asm" +%include "x86util.asm" + +; MMX-optimized functions cribbed from the original VP3 source code. + +SECTION_RODATA + +vp3_idct_data: times 8 dw 64277 + times 8 dw 60547 + times 8 dw 54491 + times 8 dw 46341 + times 8 dw 36410 + times 8 dw 25080 + times 8 dw 12785 + +cextern pb_1 +cextern pb_3 +cextern pb_7 +cextern pb_1F +cextern pb_81 + +cextern pw_8 + +cextern put_signed_pixels_clamped_mmx +cextern add_pixels_clamped_mmx + +SECTION .text + +; this is off by one or two for some cases when filter_limit is greater than 63 +; in: p0 in mm6, p1 in mm4, p2 in mm2, p3 in mm1 +; out: p1 in mm4, p2 in mm3 +%macro VP3_LOOP_FILTER 0 + movq m7, m6 + pand m6, [pb_7] ; p0&7 + psrlw m7, 3 + pand m7, [pb_1F] ; p0>>3 + movq m3, m2 ; p2 + pxor m2, m4 + pand m2, [pb_1] ; (p2^p1)&1 + movq m5, m2 + paddb m2, m2 + paddb m2, m5 ; 3*(p2^p1)&1 + paddb m2, m6 ; extra bits lost in shifts + pcmpeqb m0, m0 + pxor m1, m0 ; 255 - p3 + pavgb m1, m2 ; (256 - p3 + extrabits) >> 1 + pxor m0, m4 ; 255 - p1 + pavgb m0, m3 ; (256 + p2-p1) >> 1 + paddb m1, [pb_3] + pavgb m1, m0 ; 128+2+( p2-p1 - p3) >> 2 + pavgb m1, m0 ; 128+1+(3*(p2-p1) - p3) >> 3 + paddusb m7, m1 ; d+128+1 + movq m6, [pb_81] + psubusb m6, m7 + psubusb m7, [pb_81] + + movq m5, [r2+516] ; flim + pminub m6, m5 + pminub m7, m5 + movq m0, m6 + movq m1, m7 + paddb m6, m6 + paddb m7, m7 + pminub m6, m5 + pminub m7, m5 + psubb m6, m0 + psubb m7, m1 + paddusb m4, m7 + psubusb m4, m6 + psubusb m3, m7 + paddusb m3, m6 +%endmacro + +%macro STORE_4_WORDS 1 + movd r2d, %1 + mov [r0 -1], r2w + psrlq %1, 32 + shr r2, 16 + mov [r0+r1 -1], r2w + movd r2d, %1 + mov [r0+r1*2-1], r2w + shr r2, 16 + mov [r0+r3 -1], r2w +%endmacro + +INIT_MMX +cglobal vp3_v_loop_filter_mmx2, 3, 4 +%ifdef ARCH_X86_64 + movsxd r1, r1d +%endif + mov r3, r1 + neg r1 + movq m6, [r0+r1*2] + movq m4, [r0+r1 ] + movq m2, [r0 ] + movq m1, [r0+r3 ] + + VP3_LOOP_FILTER + + movq [r0+r1], m4 + movq [r0 ], m3 + RET + +cglobal vp3_h_loop_filter_mmx2, 3, 4 +%ifdef ARCH_X86_64 + movsxd r1, r1d +%endif + lea r3, [r1*3] + + movd m6, [r0 -2] + movd m4, [r0+r1 -2] + movd m2, [r0+r1*2-2] + movd m1, [r0+r3 -2] + lea r0, [r0+r1*4 ] + punpcklbw m6, [r0 -2] + punpcklbw m4, [r0+r1 -2] + punpcklbw m2, [r0+r1*2-2] + punpcklbw m1, [r0+r3 -2] + sub r0, r3 + sub r0, r1 + + TRANSPOSE4x4B 6, 4, 2, 1, 0 + VP3_LOOP_FILTER + SBUTTERFLY bw, 4, 3, 5 + + STORE_4_WORDS m4 + lea r0, [r0+r1*4 ] + STORE_4_WORDS m3 + RET + +; from original comments: The Macro does IDct on 4 1-D Dcts +%macro BeginIDCT 0 + movq m2, I(3) + movq m6, C(3) + movq m4, m2 + movq m7, J(5) + pmulhw m4, m6 ; r4 = c3*i3 - i3 + movq m1, C(5) + pmulhw m6, m7 ; r6 = c3*i5 - i5 + movq m5, m1 + pmulhw m1, m2 ; r1 = c5*i3 - i3 + movq m3, I(1) + pmulhw m5, m7 ; r5 = c5*i5 - i5 + movq m0, C(1) + paddw m4, m2 ; r4 = c3*i3 + paddw m6, m7 ; r6 = c3*i5 + paddw m2, m1 ; r2 = c5*i3 + movq m1, J(7) + paddw m7, m5 ; r7 = c5*i5 + movq m5, m0 ; r5 = c1 + pmulhw m0, m3 ; r0 = c1*i1 - i1 + paddsw m4, m7 ; r4 = C = c3*i3 + c5*i5 + pmulhw m5, m1 ; r5 = c1*i7 - i7 + movq m7, C(7) + psubsw m6, m2 ; r6 = D = c3*i5 - c5*i3 + paddw m0, m3 ; r0 = c1*i1 + pmulhw m3, m7 ; r3 = c7*i1 + movq m2, I(2) + pmulhw m7, m1 ; r7 = c7*i7 + paddw m5, m1 ; r5 = c1*i7 + movq m1, m2 ; r1 = i2 + pmulhw m2, C(2) ; r2 = c2*i2 - i2 + psubsw m3, m5 ; r3 = B = c7*i1 - c1*i7 + movq m5, J(6) + paddsw m0, m7 ; r0 = A = c1*i1 + c7*i7 + movq m7, m5 ; r7 = i6 + psubsw m0, m4 ; r0 = A - C + pmulhw m5, C(2) ; r5 = c2*i6 - i6 + paddw m2, m1 ; r2 = c2*i2 + pmulhw m1, C(6) ; r1 = c6*i2 + paddsw m4, m4 ; r4 = C + C + paddsw m4, m0 ; r4 = C. = A + C + psubsw m3, m6 ; r3 = B - D + paddw m5, m7 ; r5 = c2*i6 + paddsw m6, m6 ; r6 = D + D + pmulhw m7, C(6) ; r7 = c6*i6 + paddsw m6, m3 ; r6 = D. = B + D + movq I(1), m4 ; save C. at I(1) + psubsw m1, m5 ; r1 = H = c6*i2 - c2*i6 + movq m4, C(4) + movq m5, m3 ; r5 = B - D + pmulhw m3, m4 ; r3 = (c4 - 1) * (B - D) + paddsw m7, m2 ; r3 = (c4 - 1) * (B - D) + movq I(2), m6 ; save D. at I(2) + movq m2, m0 ; r2 = A - C + movq m6, I(0) + pmulhw m0, m4 ; r0 = (c4 - 1) * (A - C) + paddw m5, m3 ; r5 = B. = c4 * (B - D) + movq m3, J(4) + psubsw m5, m1 ; r5 = B.. = B. - H + paddw m2, m0 ; r0 = A. = c4 * (A - C) + psubsw m6, m3 ; r6 = i0 - i4 + movq m0, m6 + pmulhw m6, m4 ; r6 = (c4 - 1) * (i0 - i4) + paddsw m3, m3 ; r3 = i4 + i4 + paddsw m1, m1 ; r1 = H + H + paddsw m3, m0 ; r3 = i0 + i4 + paddsw m1, m5 ; r1 = H. = B + H + pmulhw m4, m3 ; r4 = (c4 - 1) * (i0 + i4) + paddsw m6, m0 ; r6 = F = c4 * (i0 - i4) + psubsw m6, m2 ; r6 = F. = F - A. + paddsw m2, m2 ; r2 = A. + A. + movq m0, I(1) ; r0 = C. + paddsw m2, m6 ; r2 = A.. = F + A. + paddw m4, m3 ; r4 = E = c4 * (i0 + i4) + psubsw m2, m1 ; r2 = R2 = A.. - H. +%endmacro + +; RowIDCT gets ready to transpose +%macro RowIDCT 0 + BeginIDCT + movq m3, I(2) ; r3 = D. + psubsw m4, m7 ; r4 = E. = E - G + paddsw m1, m1 ; r1 = H. + H. + paddsw m7, m7 ; r7 = G + G + paddsw m1, m2 ; r1 = R1 = A.. + H. + paddsw m7, m4 ; r1 = R1 = A.. + H. + psubsw m4, m3 ; r4 = R4 = E. - D. + paddsw m3, m3 + psubsw m6, m5 ; r6 = R6 = F. - B.. + paddsw m5, m5 + paddsw m3, m4 ; r3 = R3 = E. + D. + paddsw m5, m6 ; r5 = R5 = F. + B.. + psubsw m7, m0 ; r7 = R7 = G. - C. + paddsw m0, m0 + movq I(1), m1 ; save R1 + paddsw m0, m7 ; r0 = R0 = G. + C. +%endmacro + +; Column IDCT normalizes and stores final results +%macro ColumnIDCT 0 + BeginIDCT + paddsw m2, OC_8 ; adjust R2 (and R1) for shift + paddsw m1, m1 ; r1 = H. + H. + paddsw m1, m2 ; r1 = R1 = A.. + H. + psraw m2, 4 ; r2 = NR2 + psubsw m4, m7 ; r4 = E. = E - G + psraw m1, 4 ; r1 = NR2 + movq m3, I(2) ; r3 = D. + paddsw m7, m7 ; r7 = G + G + movq I(2), m2 ; store NR2 at I2 + paddsw m7, m4 ; r7 = G. = E + G + movq I(1), m1 ; store NR1 at I1 + psubsw m4, m3 ; r4 = R4 = E. - D. + paddsw m4, OC_8 ; adjust R4 (and R3) for shift + paddsw m3, m3 ; r3 = D. + D. + paddsw m3, m4 ; r3 = R3 = E. + D. + psraw m4, 4 ; r4 = NR4 + psubsw m6, m5 ; r6 = R6 = F. - B.. + psraw m3, 4 ; r3 = NR3 + paddsw m6, OC_8 ; adjust R6 (and R5) for shift + paddsw m5, m5 ; r5 = B.. + B.. + paddsw m5, m6 ; r5 = R5 = F. + B.. + psraw m6, 4 ; r6 = NR6 + movq J(4), m4 ; store NR4 at J4 + psraw m5, 4 ; r5 = NR5 + movq I(3), m3 ; store NR3 at I3 + psubsw m7, m0 ; r7 = R7 = G. - C. + paddsw m7, OC_8 ; adjust R7 (and R0) for shift + paddsw m0, m0 ; r0 = C. + C. + paddsw m0, m7 ; r0 = R0 = G. + C. + psraw m7, 4 ; r7 = NR7 + movq J(6), m6 ; store NR6 at J6 + psraw m0, 4 ; r0 = NR0 + movq J(5), m5 ; store NR5 at J5 + movq J(7), m7 ; store NR7 at J7 + movq I(0), m0 ; store NR0 at I0 +%endmacro + +; Following macro does two 4x4 transposes in place. +; +; At entry (we assume): +; +; r0 = a3 a2 a1 a0 +; I(1) = b3 b2 b1 b0 +; r2 = c3 c2 c1 c0 +; r3 = d3 d2 d1 d0 +; +; r4 = e3 e2 e1 e0 +; r5 = f3 f2 f1 f0 +; r6 = g3 g2 g1 g0 +; r7 = h3 h2 h1 h0 +; +; At exit, we have: +; +; I(0) = d0 c0 b0 a0 +; I(1) = d1 c1 b1 a1 +; I(2) = d2 c2 b2 a2 +; I(3) = d3 c3 b3 a3 +; +; J(4) = h0 g0 f0 e0 +; J(5) = h1 g1 f1 e1 +; J(6) = h2 g2 f2 e2 +; J(7) = h3 g3 f3 e3 +; +; I(0) I(1) I(2) I(3) is the transpose of r0 I(1) r2 r3. +; J(4) J(5) J(6) J(7) is the transpose of r4 r5 r6 r7. +; +; Since r1 is free at entry, we calculate the Js first. +%macro Transpose 0 + movq m1, m4 ; r1 = e3 e2 e1 e0 + punpcklwd m4, m5 ; r4 = f1 e1 f0 e0 + movq I(0), m0 ; save a3 a2 a1 a0 + punpckhwd m1, m5 ; r1 = f3 e3 f2 e2 + movq m0, m6 ; r0 = g3 g2 g1 g0 + punpcklwd m6, m7 ; r6 = h1 g1 h0 g0 + movq m5, m4 ; r5 = f1 e1 f0 e0 + punpckldq m4, m6 ; r4 = h0 g0 f0 e0 = R4 + punpckhdq m5, m6 ; r5 = h1 g1 f1 e1 = R5 + movq m6, m1 ; r6 = f3 e3 f2 e2 + movq J(4), m4 + punpckhwd m0, m7 ; r0 = h3 g3 h2 g2 + movq J(5), m5 + punpckhdq m6, m0 ; r6 = h3 g3 f3 e3 = R7 + movq m4, I(0) ; r4 = a3 a2 a1 a0 + punpckldq m1, m0 ; r1 = h2 g2 f2 e2 = R6 + movq m5, I(1) ; r5 = b3 b2 b1 b0 + movq m0, m4 ; r0 = a3 a2 a1 a0 + movq J(7), m6 + punpcklwd m0, m5 ; r0 = b1 a1 b0 a0 + movq J(6), m1 + punpckhwd m4, m5 ; r4 = b3 a3 b2 a2 + movq m5, m2 ; r5 = c3 c2 c1 c0 + punpcklwd m2, m3 ; r2 = d1 c1 d0 c0 + movq m1, m0 ; r1 = b1 a1 b0 a0 + punpckldq m0, m2 ; r0 = d0 c0 b0 a0 = R0 + punpckhdq m1, m2 ; r1 = d1 c1 b1 a1 = R1 + movq m2, m4 ; r2 = b3 a3 b2 a2 + movq I(0), m0 + punpckhwd m5, m3 ; r5 = d3 c3 d2 c2 + movq I(1), m1 + punpckhdq m4, m5 ; r4 = d3 c3 b3 a3 = R3 + punpckldq m2, m5 ; r2 = d2 c2 b2 a2 = R2 + movq I(3), m4 + movq I(2), m2 +%endmacro + +%macro VP3_IDCT_mmx 1 + ; eax = quantized input + ; ebx = dequantizer matrix + ; ecx = IDCT constants + ; M(I) = ecx + MaskOffset(0) + I * 8 + ; C(I) = ecx + CosineOffset(32) + (I-1) * 8 + ; edx = output + ; r0..r7 = mm0..mm7 +%define OC_8 [pw_8] +%define C(x) [vp3_idct_data+16*(x-1)] + + ; at this point, function has completed dequantization + dezigzag + + ; partial transposition; now do the idct itself +%define I(x) [%1+16* x ] +%define J(x) [%1+16*(x-4)+8] + RowIDCT + Transpose + +%define I(x) [%1+16* x +64] +%define J(x) [%1+16*(x-4)+72] + RowIDCT + Transpose + +%define I(x) [%1+16*x] +%define J(x) [%1+16*x] + ColumnIDCT + +%define I(x) [%1+16*x+8] +%define J(x) [%1+16*x+8] + ColumnIDCT +%endmacro + +%macro VP3_1D_IDCT_SSE2 0 + movdqa m2, I(3) ; xmm2 = i3 + movdqa m6, C(3) ; xmm6 = c3 + movdqa m4, m2 ; xmm4 = i3 + movdqa m7, I(5) ; xmm7 = i5 + pmulhw m4, m6 ; xmm4 = c3 * i3 - i3 + movdqa m1, C(5) ; xmm1 = c5 + pmulhw m6, m7 ; xmm6 = c3 * i5 - i5 + movdqa m5, m1 ; xmm5 = c5 + pmulhw m1, m2 ; xmm1 = c5 * i3 - i3 + movdqa m3, I(1) ; xmm3 = i1 + pmulhw m5, m7 ; xmm5 = c5 * i5 - i5 + movdqa m0, C(1) ; xmm0 = c1 + paddw m4, m2 ; xmm4 = c3 * i3 + paddw m6, m7 ; xmm6 = c3 * i5 + paddw m2, m1 ; xmm2 = c5 * i3 + movdqa m1, I(7) ; xmm1 = i7 + paddw m7, m5 ; xmm7 = c5 * i5 + movdqa m5, m0 ; xmm5 = c1 + pmulhw m0, m3 ; xmm0 = c1 * i1 - i1 + paddsw m4, m7 ; xmm4 = c3 * i3 + c5 * i5 = C + pmulhw m5, m1 ; xmm5 = c1 * i7 - i7 + movdqa m7, C(7) ; xmm7 = c7 + psubsw m6, m2 ; xmm6 = c3 * i5 - c5 * i3 = D + paddw m0, m3 ; xmm0 = c1 * i1 + pmulhw m3, m7 ; xmm3 = c7 * i1 + movdqa m2, I(2) ; xmm2 = i2 + pmulhw m7, m1 ; xmm7 = c7 * i7 + paddw m5, m1 ; xmm5 = c1 * i7 + movdqa m1, m2 ; xmm1 = i2 + pmulhw m2, C(2) ; xmm2 = i2 * c2 -i2 + psubsw m3, m5 ; xmm3 = c7 * i1 - c1 * i7 = B + movdqa m5, I(6) ; xmm5 = i6 + paddsw m0, m7 ; xmm0 = c1 * i1 + c7 * i7 = A + movdqa m7, m5 ; xmm7 = i6 + psubsw m0, m4 ; xmm0 = A - C + pmulhw m5, C(2) ; xmm5 = c2 * i6 - i6 + paddw m2, m1 ; xmm2 = i2 * c2 + pmulhw m1, C(6) ; xmm1 = c6 * i2 + paddsw m4, m4 ; xmm4 = C + C + paddsw m4, m0 ; xmm4 = A + C = C. + psubsw m3, m6 ; xmm3 = B - D + paddw m5, m7 ; xmm5 = c2 * i6 + paddsw m6, m6 ; xmm6 = D + D + pmulhw m7, C(6) ; xmm7 = c6 * i6 + paddsw m6, m3 ; xmm6 = B + D = D. + movdqa I(1), m4 ; Save C. at I(1) + psubsw m1, m5 ; xmm1 = c6 * i2 - c2 * i6 = H + movdqa m4, C(4) ; xmm4 = C4 + movdqa m5, m3 ; xmm5 = B - D + pmulhw m3, m4 ; xmm3 = ( c4 -1 ) * ( B - D ) + paddsw m7, m2 ; xmm7 = c2 * i2 + c6 * i6 = G + movdqa I(2), m6 ; save D. at I(2) + movdqa m2, m0 ; xmm2 = A - C + movdqa m6, I(0) ; xmm6 = i0 + pmulhw m0, m4 ; xmm0 = ( c4 - 1 ) * ( A - C ) = A. + paddw m5, m3 ; xmm5 = c4 * ( B - D ) = B. + movdqa m3, I(4) ; xmm3 = i4 + psubsw m5, m1 ; xmm5 = B. - H = B.. + paddw m2, m0 ; xmm2 = c4 * ( A - C) = A. + psubsw m6, m3 ; xmm6 = i0 - i4 + movdqa m0, m6 ; xmm0 = i0 - i4 + pmulhw m6, m4 ; xmm6 = (c4 - 1) * (i0 - i4) = F + paddsw m3, m3 ; xmm3 = i4 + i4 + paddsw m1, m1 ; xmm1 = H + H + paddsw m3, m0 ; xmm3 = i0 + i4 + paddsw m1, m5 ; xmm1 = B. + H = H. + pmulhw m4, m3 ; xmm4 = ( c4 - 1 ) * ( i0 + i4 ) + paddw m6, m0 ; xmm6 = c4 * ( i0 - i4 ) + psubsw m6, m2 ; xmm6 = F - A. = F. + paddsw m2, m2 ; xmm2 = A. + A. + movdqa m0, I(1) ; Load C. from I(1) + paddsw m2, m6 ; xmm2 = F + A. = A.. + paddw m4, m3 ; xmm4 = c4 * ( i0 + i4 ) = 3 + psubsw m2, m1 ; xmm2 = A.. - H. = R2 + ADD(m2) ; Adjust R2 and R1 before shifting + paddsw m1, m1 ; xmm1 = H. + H. + paddsw m1, m2 ; xmm1 = A.. + H. = R1 + SHIFT(m2) ; xmm2 = op2 + psubsw m4, m7 ; xmm4 = E - G = E. + SHIFT(m1) ; xmm1 = op1 + movdqa m3, I(2) ; Load D. from I(2) + paddsw m7, m7 ; xmm7 = G + G + paddsw m7, m4 ; xmm7 = E + G = G. + psubsw m4, m3 ; xmm4 = E. - D. = R4 + ADD(m4) ; Adjust R4 and R3 before shifting + paddsw m3, m3 ; xmm3 = D. + D. + paddsw m3, m4 ; xmm3 = E. + D. = R3 + SHIFT(m4) ; xmm4 = op4 + psubsw m6, m5 ; xmm6 = F. - B..= R6 + SHIFT(m3) ; xmm3 = op3 + ADD(m6) ; Adjust R6 and R5 before shifting + paddsw m5, m5 ; xmm5 = B.. + B.. + paddsw m5, m6 ; xmm5 = F. + B.. = R5 + SHIFT(m6) ; xmm6 = op6 + SHIFT(m5) ; xmm5 = op5 + psubsw m7, m0 ; xmm7 = G. - C. = R7 + ADD(m7) ; Adjust R7 and R0 before shifting + paddsw m0, m0 ; xmm0 = C. + C. + paddsw m0, m7 ; xmm0 = G. + C. + SHIFT(m7) ; xmm7 = op7 + SHIFT(m0) ; xmm0 = op0 +%endmacro + +%macro PUT_BLOCK 8 + movdqa O(0), m%1 + movdqa O(1), m%2 + movdqa O(2), m%3 + movdqa O(3), m%4 + movdqa O(4), m%5 + movdqa O(5), m%6 + movdqa O(6), m%7 + movdqa O(7), m%8 +%endmacro + +%macro VP3_IDCT_sse2 1 +%define I(x) [%1+16*x] +%define O(x) [%1+16*x] +%define C(x) [vp3_idct_data+16*(x-1)] +%define SHIFT(x) +%define ADD(x) + VP3_1D_IDCT_SSE2 +%ifdef ARCH_X86_64 + TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, 8 +%else + TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, [%1], [%1+16] +%endif + PUT_BLOCK 0, 1, 2, 3, 4, 5, 6, 7 + +%define SHIFT(x) psraw x, 4 +%define ADD(x) paddsw x, [pw_8] + VP3_1D_IDCT_SSE2 + PUT_BLOCK 0, 1, 2, 3, 4, 5, 6, 7 +%endmacro + +%macro vp3_idct_funcs 3 +cglobal vp3_idct_%1, 1, 1, %2 + VP3_IDCT_%1 r0 + RET + +cglobal vp3_idct_put_%1, 3, %3, %2 + VP3_IDCT_%1 r2 +%ifdef ARCH_X86_64 + mov r3, r2 + mov r2, r1 + mov r1, r0 + mov r0, r3 +%else + mov r0m, r2 + mov r1m, r0 + mov r2m, r1 +%endif +%ifdef WIN64 + call put_signed_pixels_clamped_mmx + RET +%else + jmp put_signed_pixels_clamped_mmx +%endif + +cglobal vp3_idct_add_%1, 3, %3, %2 + VP3_IDCT_%1 r2 +%ifdef ARCH_X86_64 + mov r3, r2 + mov r2, r1 + mov r1, r0 + mov r0, r3 +%else + mov r0m, r2 + mov r1m, r0 + mov r2m, r1 +%endif +%ifdef WIN64 + call add_pixels_clamped_mmx + RET +%else + jmp add_pixels_clamped_mmx +%endif +%endmacro + +%ifdef ARCH_X86_64 +%define REGS 4 +%else +%define REGS 3 +%endif +INIT_MMX +vp3_idct_funcs mmx, 0, REGS +INIT_XMM +vp3_idct_funcs sse2, 9, REGS +%undef REGS + +%macro DC_ADD 0 + movq m2, [r0 ] + movq m3, [r0+r1 ] + paddusb m2, m0 + movq m4, [r0+r1*2] + paddusb m3, m0 + movq m5, [r0+r3 ] + paddusb m4, m0 + paddusb m5, m0 + psubusb m2, m1 + psubusb m3, m1 + movq [r0 ], m2 + psubusb m4, m1 + movq [r0+r1 ], m3 + psubusb m5, m1 + movq [r0+r1*2], m4 + movq [r0+r3 ], m5 +%endmacro + +INIT_MMX +cglobal vp3_idct_dc_add_mmx2, 3, 4 +%ifdef ARCH_X86_64 + movsxd r1, r1d +%endif + lea r3, [r1*3] + movsx r2, word [r2] + add r2, 15 + sar r2, 5 + movd m0, r2d + pshufw m0, m0, 0x0 + pxor m1, m1 + psubw m1, m0 + packuswb m0, m0 + packuswb m1, m1 + DC_ADD + lea r0, [r0+r1*4] + DC_ADD + RET diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp56_arith.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp56_arith.h new file mode 100644 index 00000000..ddbf38b1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp56_arith.h @@ -0,0 +1,54 @@ +/** + * VP5 and VP6 compatible video decoder (arith decoder) + * + * Copyright (C) 2006 Aurelien Jacobs + * Copyright (C) 2010 Eli Friedman + * + * 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 + */ + +#ifndef AVCODEC_X86_VP56_ARITH_H +#define AVCODEC_X86_VP56_ARITH_H + +#if HAVE_FAST_CMOV +#define vp56_rac_get_prob vp56_rac_get_prob +static av_always_inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob) +{ + unsigned int code_word = vp56_rac_renorm(c); + unsigned int high = c->high; + unsigned int low = 1 + (((high - 1) * prob) >> 8); + unsigned int low_shift = low << 16; + int bit = 0; + + __asm__( + "subl %4, %1 \n\t" + "subl %3, %2 \n\t" + "leal (%2, %3), %3 \n\t" + "setae %b0 \n\t" + "cmovb %4, %1 \n\t" + "cmovb %3, %2 \n\t" + : "+q"(bit), "+r"(high), "+r"(code_word), "+r"(low_shift) + : "r"(low) + ); + + c->high = high; + c->code_word = code_word; + return bit; +} +#endif + +#endif /* AVCODEC_X86_VP56_ARITH_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp56dsp.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp56dsp.asm new file mode 100644 index 00000000..0543ba00 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp56dsp.asm @@ -0,0 +1,173 @@ +;****************************************************************************** +;* MMX/SSE2-optimized functions for the VP6 decoder +;* Copyright (C) 2009 Sebastien Lucas +;* Copyright (C) 2009 Zuxy Meng +;* +;* 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 +;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;****************************************************************************** + +%include "x86inc.asm" +%include "x86util.asm" + +cextern pw_64 + +SECTION .text + +%macro DIAG4_MMX 6 + movq m0, [%1+%2] + movq m1, [%1+%3] + movq m3, m0 + movq m4, m1 + punpcklbw m0, m7 + punpcklbw m1, m7 + punpckhbw m3, m7 + punpckhbw m4, m7 + pmullw m0, [rsp+8*11] ; src[x-8 ] * biweight [0] + pmullw m1, [rsp+8*12] ; src[x ] * biweight [1] + pmullw m3, [rsp+8*11] ; src[x-8 ] * biweight [0] + pmullw m4, [rsp+8*12] ; src[x ] * biweight [1] + paddw m0, m1 + paddw m3, m4 + movq m1, [%1+%4] + movq m2, [%1+%5] + movq m4, m1 + movq m5, m2 + punpcklbw m1, m7 + punpcklbw m2, m7 + punpckhbw m4, m7 + punpckhbw m5, m7 + pmullw m1, [rsp+8*13] ; src[x+8 ] * biweight [2] + pmullw m2, [rsp+8*14] ; src[x+16] * biweight [3] + pmullw m4, [rsp+8*13] ; src[x+8 ] * biweight [2] + pmullw m5, [rsp+8*14] ; src[x+16] * biweight [3] + paddw m1, m2 + paddw m4, m5 + paddsw m0, m1 + paddsw m3, m4 + paddsw m0, m6 ; Add 64 + paddsw m3, m6 ; Add 64 + psraw m0, 7 + psraw m3, 7 + packuswb m0, m3 + movq [%6], m0 +%endmacro + +%macro DIAG4_SSE2 6 + movq m0, [%1+%2] + movq m1, [%1+%3] + punpcklbw m0, m7 + punpcklbw m1, m7 + pmullw m0, m4 ; src[x-8 ] * biweight [0] + pmullw m1, m5 ; src[x ] * biweight [1] + paddw m0, m1 + movq m1, [%1+%4] + movq m2, [%1+%5] + punpcklbw m1, m7 + punpcklbw m2, m7 + pmullw m1, m6 ; src[x+8 ] * biweight [2] + pmullw m2, m3 ; src[x+16] * biweight [3] + paddw m1, m2 + paddsw m0, m1 + paddsw m0, [pw_64] ; Add 64 + psraw m0, 7 + packuswb m0, m0 + movq [%6], m0 +%endmacro + +%macro SPLAT4REGS_MMX 0 + movq m5, m3 + punpcklwd m3, m3 + movq m4, m3 + punpckldq m3, m3 + punpckhdq m4, m4 + punpckhwd m5, m5 + movq m2, m5 + punpckhdq m2, m2 + punpckldq m5, m5 + movq [rsp+8*11], m3 + movq [rsp+8*12], m4 + movq [rsp+8*13], m5 + movq [rsp+8*14], m2 +%endmacro + +%macro SPLAT4REGS_SSE2 0 + pshuflw m4, m3, 0x0 + pshuflw m5, m3, 0x55 + pshuflw m6, m3, 0xAA + pshuflw m3, m3, 0xFF + punpcklqdq m4, m4 + punpcklqdq m5, m5 + punpcklqdq m6, m6 + punpcklqdq m3, m3 +%endmacro + +%macro vp6_filter_diag4 2 +; void ff_vp6_filter_diag4_(uint8_t *dst, uint8_t *src, int stride, +; const int16_t h_weight[4], const int16_t v_weights[4]) +cglobal vp6_filter_diag4_%1, 5, 7, %2 + mov r5, rsp ; backup stack pointer + and rsp, ~(mmsize-1) ; align stack +%ifidn %1, sse2 + sub rsp, 8*11 +%else + sub rsp, 8*15 + movq m6, [pw_64] +%endif +%ifdef ARCH_X86_64 + movsxd r2, r2d +%endif + + sub r1, r2 + + pxor m7, m7 + movq m3, [r3] + SPLAT4REGS + + mov r3, rsp + mov r6, 11 +.nextrow + DIAG4 r1, -1, 0, 1, 2, r3 + add r3, 8 + add r1, r2 + dec r6 + jnz .nextrow + + movq m3, [r4] + SPLAT4REGS + + lea r3, [rsp+8] + mov r6, 8 +.nextcol + DIAG4 r3, -8, 0, 8, 16, r0 + add r3, 8 + add r0, r2 + dec r6 + jnz .nextcol + + mov rsp, r5 ; restore stack pointer + RET +%endmacro + +INIT_MMX +%define DIAG4 DIAG4_MMX +%define SPLAT4REGS SPLAT4REGS_MMX +vp6_filter_diag4 mmx, 0 + +INIT_XMM +%define DIAG4 DIAG4_SSE2 +%define SPLAT4REGS SPLAT4REGS_SSE2 +vp6_filter_diag4 sse2, 8 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp56dsp_init.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp56dsp_init.c new file mode 100644 index 00000000..87fc9353 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp56dsp_init.c @@ -0,0 +1,48 @@ +/* + * VP6 MMX/SSE2 optimizations + * Copyright (C) 2009 Sebastien Lucas + * Copyright (C) 2009 Zuxy Meng + * + * 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 + */ + +#include "libavutil/cpu.h" +#include "libavutil/x86_cpu.h" +#include "libavcodec/dsputil.h" +#include "libavcodec/vp56dsp.h" + +void ff_vp6_filter_diag4_mmx(uint8_t *dst, uint8_t *src, int stride, + const int16_t *h_weights,const int16_t *v_weights); +void ff_vp6_filter_diag4_sse2(uint8_t *dst, uint8_t *src, int stride, + const int16_t *h_weights,const int16_t *v_weights); + +av_cold void ff_vp56dsp_init_x86(VP56DSPContext* c, enum CodecID codec) +{ +#if HAVE_YASM + int mm_flags = av_get_cpu_flags(); + + if (CONFIG_VP6_DECODER && codec == CODEC_ID_VP6) { + if (mm_flags & AV_CPU_FLAG_MMX) { + c->vp6_filter_diag4 = ff_vp6_filter_diag4_mmx; + } + + if (mm_flags & AV_CPU_FLAG_SSE2) { + c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2; + } + } +#endif +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp8dsp-init.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp8dsp-init.c new file mode 100644 index 00000000..201b34e2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp8dsp-init.c @@ -0,0 +1,402 @@ +/* + * VP8 DSP functions x86-optimized + * Copyright (c) 2010 Ronald S. Bultje + * Copyright (c) 2010 Jason Garrett-Glaser + * + * 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 + */ + +#include "libavutil/cpu.h" +#include "libavutil/x86_cpu.h" +#include "libavcodec/vp8dsp.h" + +#if HAVE_YASM + +/* + * MC functions + */ +extern void ff_put_vp8_epel4_h4_mmxext(uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_epel4_h6_mmxext(uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_epel4_v4_mmxext(uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_epel4_v6_mmxext(uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); + +extern void ff_put_vp8_epel8_h4_sse2 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_epel8_h6_sse2 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_epel8_v4_sse2 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_epel8_v6_sse2 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); + +extern void ff_put_vp8_epel4_h4_ssse3 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_epel4_h6_ssse3 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_epel4_v4_ssse3 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_epel4_v6_ssse3 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_epel8_h4_ssse3 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_epel8_h6_ssse3 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_epel8_v4_ssse3 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_epel8_v6_ssse3 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); + +extern void ff_put_vp8_bilinear4_h_mmxext(uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_bilinear8_h_sse2 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_bilinear4_h_ssse3 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_bilinear8_h_ssse3 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); + +extern void ff_put_vp8_bilinear4_v_mmxext(uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_bilinear8_v_sse2 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_bilinear4_v_ssse3 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_bilinear8_v_ssse3 (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); + + +extern void ff_put_vp8_pixels8_mmx (uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_pixels16_mmx(uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); +extern void ff_put_vp8_pixels16_sse(uint8_t *dst, int dststride, + uint8_t *src, int srcstride, + int height, int mx, int my); + +#define TAP_W16(OPT, FILTERTYPE, TAPTYPE) \ +static void ff_put_vp8_ ## FILTERTYPE ## 16_ ## TAPTYPE ## _ ## OPT( \ + uint8_t *dst, int dststride, uint8_t *src, \ + int srcstride, int height, int mx, int my) \ +{ \ + ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \ + dst, dststride, src, srcstride, height, mx, my); \ + ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \ + dst + 8, dststride, src + 8, srcstride, height, mx, my); \ +} +#define TAP_W8(OPT, FILTERTYPE, TAPTYPE) \ +static void ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \ + uint8_t *dst, int dststride, uint8_t *src, \ + int srcstride, int height, int mx, int my) \ +{ \ + ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \ + dst, dststride, src, srcstride, height, mx, my); \ + ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \ + dst + 4, dststride, src + 4, srcstride, height, mx, my); \ +} + +TAP_W8 (mmxext, epel, h4) +TAP_W8 (mmxext, epel, h6) +TAP_W16(mmxext, epel, h6) +TAP_W8 (mmxext, epel, v4) +TAP_W8 (mmxext, epel, v6) +TAP_W16(mmxext, epel, v6) +TAP_W8 (mmxext, bilinear, h) +TAP_W16(mmxext, bilinear, h) +TAP_W8 (mmxext, bilinear, v) +TAP_W16(mmxext, bilinear, v) + +TAP_W16(sse2, epel, h6) +TAP_W16(sse2, epel, v6) +TAP_W16(sse2, bilinear, h) +TAP_W16(sse2, bilinear, v) + +TAP_W16(ssse3, epel, h6) +TAP_W16(ssse3, epel, v6) +TAP_W16(ssse3, bilinear, h) +TAP_W16(ssse3, bilinear, v) + +#define HVTAP(OPT, ALIGN, TAPNUMX, TAPNUMY, SIZE, MAXHEIGHT) \ +static void ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## v ## TAPNUMY ## _ ## OPT( \ + uint8_t *dst, int dststride, uint8_t *src, \ + int srcstride, int height, int mx, int my) \ +{ \ + DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + TAPNUMY - 1)]; \ + uint8_t *tmpptr = tmp + SIZE * (TAPNUMY / 2 - 1); \ + src -= srcstride * (TAPNUMY / 2 - 1); \ + ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## _ ## OPT( \ + tmp, SIZE, src, srcstride, height + TAPNUMY - 1, mx, my); \ + ff_put_vp8_epel ## SIZE ## _v ## TAPNUMY ## _ ## OPT( \ + dst, dststride, tmpptr, SIZE, height, mx, my); \ +} + +#define HVTAPMMX(x, y) \ +HVTAP(mmxext, 8, x, y, 4, 8) \ +HVTAP(mmxext, 8, x, y, 8, 16) + +HVTAPMMX(4, 4) +HVTAPMMX(4, 6) +HVTAPMMX(6, 4) +HVTAPMMX(6, 6) +HVTAP(mmxext, 8, 6, 6, 16, 16) + +#define HVTAPSSE2(x, y, w) \ +HVTAP(sse2, 16, x, y, w, 16) \ +HVTAP(ssse3, 16, x, y, w, 16) + +HVTAPSSE2(4, 4, 8) +HVTAPSSE2(4, 6, 8) +HVTAPSSE2(6, 4, 8) +HVTAPSSE2(6, 6, 8) +HVTAPSSE2(6, 6, 16) + +HVTAP(ssse3, 16, 4, 4, 4, 8) +HVTAP(ssse3, 16, 4, 6, 4, 8) +HVTAP(ssse3, 16, 6, 4, 4, 8) +HVTAP(ssse3, 16, 6, 6, 4, 8) + +#define HVBILIN(OPT, ALIGN, SIZE, MAXHEIGHT) \ +static void ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT( \ + uint8_t *dst, int dststride, uint8_t *src, \ + int srcstride, int height, int mx, int my) \ +{ \ + DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + 2)]; \ + ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT( \ + tmp, SIZE, src, srcstride, height + 1, mx, my); \ + ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT( \ + dst, dststride, tmp, SIZE, height, mx, my); \ +} + +HVBILIN(mmxext, 8, 4, 8) +HVBILIN(mmxext, 8, 8, 16) +HVBILIN(mmxext, 8, 16, 16) +HVBILIN(sse2, 8, 8, 16) +HVBILIN(sse2, 8, 16, 16) +HVBILIN(ssse3, 8, 4, 8) +HVBILIN(ssse3, 8, 8, 16) +HVBILIN(ssse3, 8, 16, 16) + +extern void ff_vp8_idct_dc_add_mmx(uint8_t *dst, DCTELEM block[16], int stride); +extern void ff_vp8_idct_dc_add_sse4(uint8_t *dst, DCTELEM block[16], int stride); +extern void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, DCTELEM block[4][16], int stride); +extern void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, DCTELEM block[4][16], int stride); +extern void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, DCTELEM block[2][16], int stride); +extern void ff_vp8_luma_dc_wht_mmx(DCTELEM block[4][4][16], DCTELEM dc[16]); +extern void ff_vp8_luma_dc_wht_sse(DCTELEM block[4][4][16], DCTELEM dc[16]); +extern void ff_vp8_idct_add_mmx(uint8_t *dst, DCTELEM block[16], int stride); +extern void ff_vp8_idct_add_sse(uint8_t *dst, DCTELEM block[16], int stride); + +#define DECLARE_LOOP_FILTER(NAME)\ +extern void ff_vp8_v_loop_filter_simple_ ## NAME(uint8_t *dst, int stride, int flim);\ +extern void ff_vp8_h_loop_filter_simple_ ## NAME(uint8_t *dst, int stride, int flim);\ +extern void ff_vp8_v_loop_filter16y_inner_ ## NAME (uint8_t *dst, int stride,\ + int e, int i, int hvt);\ +extern void ff_vp8_h_loop_filter16y_inner_ ## NAME (uint8_t *dst, int stride,\ + int e, int i, int hvt);\ +extern void ff_vp8_v_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, uint8_t *dstV,\ + int s, int e, int i, int hvt);\ +extern void ff_vp8_h_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, uint8_t *dstV,\ + int s, int e, int i, int hvt);\ +extern void ff_vp8_v_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, int stride,\ + int e, int i, int hvt);\ +extern void ff_vp8_h_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, int stride,\ + int e, int i, int hvt);\ +extern void ff_vp8_v_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, uint8_t *dstV,\ + int s, int e, int i, int hvt);\ +extern void ff_vp8_h_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, uint8_t *dstV,\ + int s, int e, int i, int hvt); + +DECLARE_LOOP_FILTER(mmx) +DECLARE_LOOP_FILTER(mmxext) +DECLARE_LOOP_FILTER(sse2) +DECLARE_LOOP_FILTER(ssse3) +DECLARE_LOOP_FILTER(sse4) + +#endif + +#define VP8_LUMA_MC_FUNC(IDX, SIZE, OPT) \ + c->put_vp8_epel_pixels_tab[IDX][0][2] = ff_put_vp8_epel ## SIZE ## _h6_ ## OPT; \ + c->put_vp8_epel_pixels_tab[IDX][2][0] = ff_put_vp8_epel ## SIZE ## _v6_ ## OPT; \ + c->put_vp8_epel_pixels_tab[IDX][2][2] = ff_put_vp8_epel ## SIZE ## _h6v6_ ## OPT + +#define VP8_MC_FUNC(IDX, SIZE, OPT) \ + c->put_vp8_epel_pixels_tab[IDX][0][1] = ff_put_vp8_epel ## SIZE ## _h4_ ## OPT; \ + c->put_vp8_epel_pixels_tab[IDX][1][0] = ff_put_vp8_epel ## SIZE ## _v4_ ## OPT; \ + c->put_vp8_epel_pixels_tab[IDX][1][1] = ff_put_vp8_epel ## SIZE ## _h4v4_ ## OPT; \ + c->put_vp8_epel_pixels_tab[IDX][1][2] = ff_put_vp8_epel ## SIZE ## _h6v4_ ## OPT; \ + c->put_vp8_epel_pixels_tab[IDX][2][1] = ff_put_vp8_epel ## SIZE ## _h4v6_ ## OPT; \ + VP8_LUMA_MC_FUNC(IDX, SIZE, OPT) + +#define VP8_BILINEAR_MC_FUNC(IDX, SIZE, OPT) \ + c->put_vp8_bilinear_pixels_tab[IDX][0][1] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \ + c->put_vp8_bilinear_pixels_tab[IDX][0][2] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \ + c->put_vp8_bilinear_pixels_tab[IDX][1][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \ + c->put_vp8_bilinear_pixels_tab[IDX][1][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \ + c->put_vp8_bilinear_pixels_tab[IDX][1][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \ + c->put_vp8_bilinear_pixels_tab[IDX][2][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \ + c->put_vp8_bilinear_pixels_tab[IDX][2][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \ + c->put_vp8_bilinear_pixels_tab[IDX][2][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT + + +av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c) +{ + int mm_flags = av_get_cpu_flags(); + +#if HAVE_YASM + if (mm_flags & AV_CPU_FLAG_MMX) { + c->vp8_idct_dc_add = ff_vp8_idct_dc_add_mmx; + c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_mmx; + c->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_mmx; + c->vp8_idct_add = ff_vp8_idct_add_mmx; + c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_mmx; + c->put_vp8_epel_pixels_tab[0][0][0] = + c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_mmx; + c->put_vp8_epel_pixels_tab[1][0][0] = + c->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_mmx; + + c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmx; + c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmx; + + c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmx; + c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmx; + c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmx; + c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmx; + + c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_mmx; + c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_mmx; + c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_mmx; + c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_mmx; + } + + /* note that 4-tap width=16 functions are missing because w=16 + * is only used for luma, and luma is always a copy or sixtap. */ + if (mm_flags & AV_CPU_FLAG_MMX2) { + VP8_LUMA_MC_FUNC(0, 16, mmxext); + VP8_MC_FUNC(1, 8, mmxext); + VP8_MC_FUNC(2, 4, mmxext); + VP8_BILINEAR_MC_FUNC(0, 16, mmxext); + VP8_BILINEAR_MC_FUNC(1, 8, mmxext); + VP8_BILINEAR_MC_FUNC(2, 4, mmxext); + + c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmxext; + c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmxext; + + c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmxext; + c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmxext; + c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmxext; + c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmxext; + + c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_mmxext; + c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_mmxext; + c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_mmxext; + c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_mmxext; + } + + if (mm_flags & AV_CPU_FLAG_SSE) { + c->vp8_idct_add = ff_vp8_idct_add_sse; + c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_sse; + c->put_vp8_epel_pixels_tab[0][0][0] = + c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_sse; + } + + if (mm_flags & (AV_CPU_FLAG_SSE2|AV_CPU_FLAG_SSE2SLOW)) { + VP8_LUMA_MC_FUNC(0, 16, sse2); + VP8_MC_FUNC(1, 8, sse2); + VP8_BILINEAR_MC_FUNC(0, 16, sse2); + VP8_BILINEAR_MC_FUNC(1, 8, sse2); + + c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_sse2; + + c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_sse2; + c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_sse2; + + c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_sse2; + c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_sse2; + } + + if (mm_flags & AV_CPU_FLAG_SSE2) { + c->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_sse2; + + c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse2; + + c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_sse2; + c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_sse2; + + c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_sse2; + c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_sse2; + } + + if (mm_flags & AV_CPU_FLAG_SSSE3) { + VP8_LUMA_MC_FUNC(0, 16, ssse3); + VP8_MC_FUNC(1, 8, ssse3); + VP8_MC_FUNC(2, 4, ssse3); + VP8_BILINEAR_MC_FUNC(0, 16, ssse3); + VP8_BILINEAR_MC_FUNC(1, 8, ssse3); + VP8_BILINEAR_MC_FUNC(2, 4, ssse3); + + c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_ssse3; + c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_ssse3; + + c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_ssse3; + c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_ssse3; + c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_ssse3; + c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_ssse3; + + c->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16y_mbedge_ssse3; + c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_ssse3; + c->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mbedge_ssse3; + c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_ssse3; + } + + if (mm_flags & AV_CPU_FLAG_SSE4) { + c->vp8_idct_dc_add = ff_vp8_idct_dc_add_sse4; + + c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse4; + c->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16y_mbedge_sse4; + c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_sse4; + } +#endif +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp8dsp.asm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp8dsp.asm new file mode 100644 index 00000000..bc5ccc8e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/x86/vp8dsp.asm @@ -0,0 +1,2858 @@ +;****************************************************************************** +;* VP8 MMXEXT optimizations +;* Copyright (c) 2010 Ronald S. Bultje +;* Copyright (c) 2010 Jason Garrett-Glaser +;* +;* 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 +;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;****************************************************************************** + +%include "x86inc.asm" +%include "x86util.asm" + +SECTION_RODATA + +fourtap_filter_hw_m: times 4 dw -6, 123 + times 4 dw 12, -1 + times 4 dw -9, 93 + times 4 dw 50, -6 + times 4 dw -6, 50 + times 4 dw 93, -9 + times 4 dw -1, 12 + times 4 dw 123, -6 + +sixtap_filter_hw_m: times 4 dw 2, -11 + times 4 dw 108, 36 + times 4 dw -8, 1 + times 4 dw 3, -16 + times 4 dw 77, 77 + times 4 dw -16, 3 + times 4 dw 1, -8 + times 4 dw 36, 108 + times 4 dw -11, 2 + +fourtap_filter_hb_m: times 8 db -6, 123 + times 8 db 12, -1 + times 8 db -9, 93 + times 8 db 50, -6 + times 8 db -6, 50 + times 8 db 93, -9 + times 8 db -1, 12 + times 8 db 123, -6 + +sixtap_filter_hb_m: times 8 db 2, 1 + times 8 db -11, 108 + times 8 db 36, -8 + times 8 db 3, 3 + times 8 db -16, 77 + times 8 db 77, -16 + times 8 db 1, 2 + times 8 db -8, 36 + times 8 db 108, -11 + +fourtap_filter_v_m: times 8 dw -6 + times 8 dw 123 + times 8 dw 12 + times 8 dw -1 + times 8 dw -9 + times 8 dw 93 + times 8 dw 50 + times 8 dw -6 + times 8 dw -6 + times 8 dw 50 + times 8 dw 93 + times 8 dw -9 + times 8 dw -1 + times 8 dw 12 + times 8 dw 123 + times 8 dw -6 + +sixtap_filter_v_m: times 8 dw 2 + times 8 dw -11 + times 8 dw 108 + times 8 dw 36 + times 8 dw -8 + times 8 dw 1 + times 8 dw 3 + times 8 dw -16 + times 8 dw 77 + times 8 dw 77 + times 8 dw -16 + times 8 dw 3 + times 8 dw 1 + times 8 dw -8 + times 8 dw 36 + times 8 dw 108 + times 8 dw -11 + times 8 dw 2 + +bilinear_filter_vw_m: times 8 dw 1 + times 8 dw 2 + times 8 dw 3 + times 8 dw 4 + times 8 dw 5 + times 8 dw 6 + times 8 dw 7 + +bilinear_filter_vb_m: times 8 db 7, 1 + times 8 db 6, 2 + times 8 db 5, 3 + times 8 db 4, 4 + times 8 db 3, 5 + times 8 db 2, 6 + times 8 db 1, 7 + +%ifdef PIC +%define fourtap_filter_hw r11 +%define sixtap_filter_hw r11 +%define fourtap_filter_hb r11 +%define sixtap_filter_hb r11 +%define fourtap_filter_v r11 +%define sixtap_filter_v r11 +%define bilinear_filter_vw r11 +%define bilinear_filter_vb r11 +%else +%define fourtap_filter_hw fourtap_filter_hw_m +%define sixtap_filter_hw sixtap_filter_hw_m +%define fourtap_filter_hb fourtap_filter_hb_m +%define sixtap_filter_hb sixtap_filter_hb_m +%define fourtap_filter_v fourtap_filter_v_m +%define sixtap_filter_v sixtap_filter_v_m +%define bilinear_filter_vw bilinear_filter_vw_m +%define bilinear_filter_vb bilinear_filter_vb_m +%endif + +filter_h2_shuf: db 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 +filter_h4_shuf: db 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10 + +filter_h6_shuf1: db 0, 5, 1, 6, 2, 7, 3, 8, 4, 9, 5, 10, 6, 11, 7, 12 +filter_h6_shuf2: db 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9 +filter_h6_shuf3: db 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11 + +pw_20091: times 4 dw 20091 +pw_17734: times 4 dw 17734 + +pb_27_63: times 8 db 27, 63 +pb_18_63: times 8 db 18, 63 +pb_9_63: times 8 db 9, 63 + +cextern pb_1 +cextern pw_3 +cextern pb_3 +cextern pw_4 +cextern pb_4 +cextern pw_9 +cextern pw_18 +cextern pw_27 +cextern pw_63 +cextern pw_64 +cextern pb_80 +cextern pb_F8 +cextern pb_FE + +SECTION .text + +;----------------------------------------------------------------------------- +; subpel MC functions: +; +; void put_vp8_epel_hv_(uint8_t *dst, int deststride, +; uint8_t *src, int srcstride, +; int height, int mx, int my); +;----------------------------------------------------------------------------- + +%macro FILTER_SSSE3 3 +cglobal put_vp8_epel%1_h6_ssse3, 6, 6, %2 + lea r5d, [r5*3] + mova m3, [filter_h6_shuf2] + mova m4, [filter_h6_shuf3] +%ifdef PIC + lea r11, [sixtap_filter_hb_m] +%endif + mova m5, [sixtap_filter_hb+r5*8-48] ; set up 6tap filter in bytes + mova m6, [sixtap_filter_hb+r5*8-32] + mova m7, [sixtap_filter_hb+r5*8-16] + +.nextrow + movu m0, [r2-2] + mova m1, m0 + mova m2, m0 +%ifidn %1, 4 +; For epel4, we need 9 bytes, but only 8 get loaded; to compensate, do the +; shuffle with a memory operand + punpcklbw m0, [r2+3] +%else + pshufb m0, [filter_h6_shuf1] +%endif + pshufb m1, m3 + pshufb m2, m4 + pmaddubsw m0, m5 + pmaddubsw m1, m6 + pmaddubsw m2, m7 + paddsw m0, m1 + paddsw m0, m2 + paddsw m0, [pw_64] + psraw m0, 7 + packuswb m0, m0 + movh [r0], m0 ; store + + ; go to next line + add r0, r1 + add r2, r3 + dec r4d ; next row + jg .nextrow + REP_RET + +cglobal put_vp8_epel%1_h4_ssse3, 6, 6, %3 + shl r5d, 4 + mova m2, [pw_64] + mova m3, [filter_h2_shuf] + mova m4, [filter_h4_shuf] +%ifdef PIC + lea r11, [fourtap_filter_hb_m] +%endif + mova m5, [fourtap_filter_hb+r5-16] ; set up 4tap filter in bytes + mova m6, [fourtap_filter_hb+r5] + +.nextrow + movu m0, [r2-1] + mova m1, m0 + pshufb m0, m3 + pshufb m1, m4 + pmaddubsw m0, m5 + pmaddubsw m1, m6 + paddsw m0, m2 + paddsw m0, m1 + psraw m0, 7 + packuswb m0, m0 + movh [r0], m0 ; store + + ; go to next line + add r0, r1 + add r2, r3 + dec r4d ; next row + jg .nextrow + REP_RET + +cglobal put_vp8_epel%1_v4_ssse3, 7, 7, %2 + shl r6d, 4 +%ifdef PIC + lea r11, [fourtap_filter_hb_m] +%endif + mova m5, [fourtap_filter_hb+r6-16] + mova m6, [fourtap_filter_hb+r6] + mova m7, [pw_64] + + ; read 3 lines + sub r2, r3 + movh m0, [r2] + movh m1, [r2+ r3] + movh m2, [r2+2*r3] + add r2, r3 + +.nextrow + movh m3, [r2+2*r3] ; read new row + mova m4, m0 + mova m0, m1 + punpcklbw m4, m1 + mova m1, m2 + punpcklbw m2, m3 + pmaddubsw m4, m5 + pmaddubsw m2, m6 + paddsw m4, m2 + mova m2, m3 + paddsw m4, m7 + psraw m4, 7 + packuswb m4, m4 + movh [r0], m4 + + ; go to next line + add r0, r1 + add r2, r3 + dec r4d ; next row + jg .nextrow + REP_RET + +cglobal put_vp8_epel%1_v6_ssse3, 7, 7, %2 + lea r6d, [r6*3] +%ifdef PIC + lea r11, [sixtap_filter_hb_m] +%endif + lea r6, [sixtap_filter_hb+r6*8] + + ; read 5 lines + sub r2, r3 + sub r2, r3 + movh m0, [r2] + movh m1, [r2+r3] + movh m2, [r2+r3*2] + lea r2, [r2+r3*2] + add r2, r3 + movh m3, [r2] + movh m4, [r2+r3] + +.nextrow + movh m5, [r2+2*r3] ; read new row + mova m6, m0 + punpcklbw m6, m5 + mova m0, m1 + punpcklbw m1, m2 + mova m7, m3 + punpcklbw m7, m4 + pmaddubsw m6, [r6-48] + pmaddubsw m1, [r6-32] + pmaddubsw m7, [r6-16] + paddsw m6, m1 + paddsw m6, m7 + mova m1, m2 + paddsw m6, [pw_64] + mova m2, m3 + psraw m6, 7 + mova m3, m4 + packuswb m6, m6 + mova m4, m5 + movh [r0], m6 + + ; go to next line + add r0, r1 + add r2, r3 + dec r4d ; next row + jg .nextrow + REP_RET +%endmacro + +INIT_MMX +FILTER_SSSE3 4, 0, 0 +INIT_XMM +FILTER_SSSE3 8, 8, 7 + +; 4x4 block, H-only 4-tap filter +cglobal put_vp8_epel4_h4_mmxext, 6, 6 + shl r5d, 4 +%ifdef PIC + lea r11, [fourtap_filter_hw_m] +%endif + movq mm4, [fourtap_filter_hw+r5-16] ; set up 4tap filter in words + movq mm5, [fourtap_filter_hw+r5] + movq mm7, [pw_64] + pxor mm6, mm6 + +.nextrow + movq mm1, [r2-1] ; (ABCDEFGH) load 8 horizontal pixels + + ; first set of 2 pixels + movq mm2, mm1 ; byte ABCD.. + punpcklbw mm1, mm6 ; byte->word ABCD + pshufw mm0, mm2, 9 ; byte CDEF.. + punpcklbw mm0, mm6 ; byte->word CDEF + pshufw mm3, mm1, 0x94 ; word ABBC + pshufw mm1, mm0, 0x94 ; word CDDE + pmaddwd mm3, mm4 ; multiply 2px with F0/F1 + movq mm0, mm1 ; backup for second set of pixels + pmaddwd mm1, mm5 ; multiply 2px with F2/F3 + paddd mm3, mm1 ; finish 1st 2px + + ; second set of 2 pixels, use backup of above + punpckhbw mm2, mm6 ; byte->word EFGH + pmaddwd mm0, mm4 ; multiply backed up 2px with F0/F1 + pshufw mm1, mm2, 0x94 ; word EFFG + pmaddwd mm1, mm5 ; multiply 2px with F2/F3 + paddd mm0, mm1 ; finish 2nd 2px + + ; merge two sets of 2 pixels into one set of 4, round/clip/store + packssdw mm3, mm0 ; merge dword->word (4px) + paddsw mm3, mm7 ; rounding + psraw mm3, 7 + packuswb mm3, mm6 ; clip and word->bytes + movd [r0], mm3 ; store + + ; go to next line + add r0, r1 + add r2, r3 + dec r4d ; next row + jg .nextrow + REP_RET + +; 4x4 block, H-only 6-tap filter +cglobal put_vp8_epel4_h6_mmxext, 6, 6 + lea r5d, [r5*3] +%ifdef PIC + lea r11, [sixtap_filter_hw_m] +%endif + movq mm4, [sixtap_filter_hw+r5*8-48] ; set up 4tap filter in words + movq mm5, [sixtap_filter_hw+r5*8-32] + movq mm6, [sixtap_filter_hw+r5*8-16] + movq mm7, [pw_64] + pxor mm3, mm3 + +.nextrow + movq mm1, [r2-2] ; (ABCDEFGH) load 8 horizontal pixels + + ; first set of 2 pixels + movq mm2, mm1 ; byte ABCD.. + punpcklbw mm1, mm3 ; byte->word ABCD + pshufw mm0, mm2, 0x9 ; byte CDEF.. + punpckhbw mm2, mm3 ; byte->word EFGH + punpcklbw mm0, mm3 ; byte->word CDEF + pshufw mm1, mm1, 0x94 ; word ABBC + pshufw mm2, mm2, 0x94 ; word EFFG + pmaddwd mm1, mm4 ; multiply 2px with F0/F1 + pshufw mm3, mm0, 0x94 ; word CDDE + movq mm0, mm3 ; backup for second set of pixels + pmaddwd mm3, mm5 ; multiply 2px with F2/F3 + paddd mm1, mm3 ; add to 1st 2px cache + movq mm3, mm2 ; backup for second set of pixels + pmaddwd mm2, mm6 ; multiply 2px with F4/F5 + paddd mm1, mm2 ; finish 1st 2px + + ; second set of 2 pixels, use backup of above + movd mm2, [r2+3] ; byte FGHI (prevent overreads) + pmaddwd mm0, mm4 ; multiply 1st backed up 2px with F0/F1 + pmaddwd mm3, mm5 ; multiply 2nd backed up 2px with F2/F3 + paddd mm0, mm3 ; add to 2nd 2px cache + pxor mm3, mm3 + punpcklbw mm2, mm3 ; byte->word FGHI + pshufw mm2, mm2, 0xE9 ; word GHHI + pmaddwd mm2, mm6 ; multiply 2px with F4/F5 + paddd mm0, mm2 ; finish 2nd 2px + + ; merge two sets of 2 pixels into one set of 4, round/clip/store + packssdw mm1, mm0 ; merge dword->word (4px) + paddsw mm1, mm7 ; rounding + psraw mm1, 7 + packuswb mm1, mm3 ; clip and word->bytes + movd [r0], mm1 ; store + + ; go to next line + add r0, r1 + add r2, r3 + dec r4d ; next row + jg .nextrow + REP_RET + +INIT_XMM +cglobal put_vp8_epel8_h4_sse2, 6, 6, 10 + shl r5d, 5 +%ifdef PIC + lea r11, [fourtap_filter_v_m] +%endif + lea r5, [fourtap_filter_v+r5-32] + pxor m7, m7 + mova m4, [pw_64] + mova m5, [r5+ 0] + mova m6, [r5+16] +%ifdef m8 + mova m8, [r5+32] + mova m9, [r5+48] +%endif +.nextrow + movq m0, [r2-1] + movq m1, [r2-0] + movq m2, [r2+1] + movq m3, [r2+2] + punpcklbw m0, m7 + punpcklbw m1, m7 + punpcklbw m2, m7 + punpcklbw m3, m7 + pmullw m0, m5 + pmullw m1, m6 +%ifdef m8 + pmullw m2, m8 + pmullw m3, m9 +%else + pmullw m2, [r5+32] + pmullw m3, [r5+48] +%endif + paddsw m0, m1 + paddsw m2, m3 + paddsw m0, m2 + paddsw m0, m4 + psraw m0, 7 + packuswb m0, m7 + movh [r0], m0 ; store + + ; go to next line + add r0, r1 + add r2, r3 + dec r4d ; next row + jg .nextrow + REP_RET + +cglobal put_vp8_epel8_h6_sse2, 6, 6, 14 + lea r5d, [r5*3] + shl r5d, 4 +%ifdef PIC + lea r11, [sixtap_filter_v_m] +%endif + lea r5, [sixtap_filter_v+r5-96] + pxor m7, m7 + mova m6, [pw_64] +%ifdef m8 + mova m8, [r5+ 0] + mova m9, [r5+16] + mova m10, [r5+32] + mova m11, [r5+48] + mova m12, [r5+64] + mova m13, [r5+80] +%endif +.nextrow + movq m0, [r2-2] + movq m1, [r2-1] + movq m2, [r2-0] + movq m3, [r2+1] + movq m4, [r2+2] + movq m5, [r2+3] + punpcklbw m0, m7 + punpcklbw m1, m7 + punpcklbw m2, m7 + punpcklbw m3, m7 + punpcklbw m4, m7 + punpcklbw m5, m7 +%ifdef m8 + pmullw m0, m8 + pmullw m1, m9 + pmullw m2, m10 + pmullw m3, m11 + pmullw m4, m12 + pmullw m5, m13 +%else + pmullw m0, [r5+ 0] + pmullw m1, [r5+16] + pmullw m2, [r5+32] + pmullw m3, [r5+48] + pmullw m4, [r5+64] + pmullw m5, [r5+80] +%endif + paddsw m1, m4 + paddsw m0, m5 + paddsw m1, m2 + paddsw m0, m3 + paddsw m0, m1 + paddsw m0, m6 + psraw m0, 7 + packuswb m0, m7 + movh [r0], m0 ; store + + ; go to next line + add r0, r1 + add r2, r3 + dec r4d ; next row + jg .nextrow + REP_RET + +%macro FILTER_V 3 +; 4x4 block, V-only 4-tap filter +cglobal put_vp8_epel%2_v4_%1, 7, 7, %3 + shl r6d, 5 +%ifdef PIC + lea r11, [fourtap_filter_v_m] +%endif + lea r6, [fourtap_filter_v+r6-32] + mova m6, [pw_64] + pxor m7, m7 + mova m5, [r6+48] + + ; read 3 lines + sub r2, r3 + movh m0, [r2] + movh m1, [r2+ r3] + movh m2, [r2+2*r3] + add r2, r3 + punpcklbw m0, m7 + punpcklbw m1, m7 + punpcklbw m2, m7 + +.nextrow + ; first calculate negative taps (to prevent losing positive overflows) + movh m4, [r2+2*r3] ; read new row + punpcklbw m4, m7 + mova m3, m4 + pmullw m0, [r6+0] + pmullw m4, m5 + paddsw m4, m0 + + ; then calculate positive taps + mova m0, m1 + pmullw m1, [r6+16] + paddsw m4, m1 + mova m1, m2 + pmullw m2, [r6+32] + paddsw m4, m2 + mova m2, m3 + + ; round/clip/store + paddsw m4, m6 + psraw m4, 7 + packuswb m4, m7 + movh [r0], m4 + + ; go to next line + add r0, r1 + add r2, r3 + dec r4d ; next row + jg .nextrow + REP_RET + + +; 4x4 block, V-only 6-tap filter +cglobal put_vp8_epel%2_v6_%1, 7, 7, %3 + shl r6d, 4 + lea r6, [r6*3] +%ifdef PIC + lea r11, [sixtap_filter_v_m] +%endif + lea r6, [sixtap_filter_v+r6-96] + pxor m7, m7 + + ; read 5 lines + sub r2, r3 + sub r2, r3 + movh m0, [r2] + movh m1, [r2+r3] + movh m2, [r2+r3*2] + lea r2, [r2+r3*2] + add r2, r3 + movh m3, [r2] + movh m4, [r2+r3] + punpcklbw m0, m7 + punpcklbw m1, m7 + punpcklbw m2, m7 + punpcklbw m3, m7 + punpcklbw m4, m7 + +.nextrow + ; first calculate negative taps (to prevent losing positive overflows) + mova m5, m1 + pmullw m5, [r6+16] + mova m6, m4 + pmullw m6, [r6+64] + paddsw m6, m5 + + ; then calculate positive taps + movh m5, [r2+2*r3] ; read new row + punpcklbw m5, m7 + pmullw m0, [r6+0] + paddsw m6, m0 + mova m0, m1 + mova m1, m2 + pmullw m2, [r6+32] + paddsw m6, m2 + mova m2, m3 + pmullw m3, [r6+48] + paddsw m6, m3 + mova m3, m4 + mova m4, m5 + pmullw m5, [r6+80] + paddsw m6, m5 + + ; round/clip/store + paddsw m6, [pw_64] + psraw m6, 7 + packuswb m6, m7 + movh [r0], m6 + + ; go to next line + add r0, r1 + add r2, r3 + dec r4d ; next row + jg .nextrow + REP_RET +%endmacro + +INIT_MMX +FILTER_V mmxext, 4, 0 +INIT_XMM +FILTER_V sse2, 8, 8 + +%macro FILTER_BILINEAR 3 +cglobal put_vp8_bilinear%2_v_%1, 7,7,%3 + mov r5d, 8*16 + shl r6d, 4 + sub r5d, r6d +%ifdef PIC + lea r11, [bilinear_filter_vw_m] +%endif + pxor m6, m6 + mova m4, [bilinear_filter_vw+r5-16] + mova m5, [bilinear_filter_vw+r6-16] +.nextrow + movh m0, [r2+r3*0] + movh m1, [r2+r3*1] + movh m3, [r2+r3*2] + punpcklbw m0, m6 + punpcklbw m1, m6 + punpcklbw m3, m6 + mova m2, m1 + pmullw m0, m4 + pmullw m1, m5 + pmullw m2, m4 + pmullw m3, m5 + paddsw m0, m1 + paddsw m2, m3 + psraw m0, 2 + psraw m2, 2 + pavgw m0, m6 + pavgw m2, m6 +%ifidn %1, mmxext + packuswb m0, m0 + packuswb m2, m2 + movh [r0+r1*0], m0 + movh [r0+r1*1], m2 +%else + packuswb m0, m2 + movh [r0+r1*0], m0 + movhps [r0+r1*1], m0 +%endif + + lea r0, [r0+r1*2] + lea r2, [r2+r3*2] + sub r4d, 2 + jg .nextrow + REP_RET + +cglobal put_vp8_bilinear%2_h_%1, 7,7,%3 + mov r6d, 8*16 + shl r5d, 4 + sub r6d, r5d +%ifdef PIC + lea r11, [bilinear_filter_vw_m] +%endif + pxor m6, m6 + mova m4, [bilinear_filter_vw+r6-16] + mova m5, [bilinear_filter_vw+r5-16] +.nextrow + movh m0, [r2+r3*0+0] + movh m1, [r2+r3*0+1] + movh m2, [r2+r3*1+0] + movh m3, [r2+r3*1+1] + punpcklbw m0, m6 + punpcklbw m1, m6 + punpcklbw m2, m6 + punpcklbw m3, m6 + pmullw m0, m4 + pmullw m1, m5 + pmullw m2, m4 + pmullw m3, m5 + paddsw m0, m1 + paddsw m2, m3 + psraw m0, 2 + psraw m2, 2 + pavgw m0, m6 + pavgw m2, m6 +%ifidn %1, mmxext + packuswb m0, m0 + packuswb m2, m2 + movh [r0+r1*0], m0 + movh [r0+r1*1], m2 +%else + packuswb m0, m2 + movh [r0+r1*0], m0 + movhps [r0+r1*1], m0 +%endif + + lea r0, [r0+r1*2] + lea r2, [r2+r3*2] + sub r4d, 2 + jg .nextrow + REP_RET +%endmacro + +INIT_MMX +FILTER_BILINEAR mmxext, 4, 0 +INIT_XMM +FILTER_BILINEAR sse2, 8, 7 + +%macro FILTER_BILINEAR_SSSE3 1 +cglobal put_vp8_bilinear%1_v_ssse3, 7,7 + shl r6d, 4 +%ifdef PIC + lea r11, [bilinear_filter_vb_m] +%endif + pxor m4, m4 + mova m3, [bilinear_filter_vb+r6-16] +.nextrow + movh m0, [r2+r3*0] + movh m1, [r2+r3*1] + movh m2, [r2+r3*2] + punpcklbw m0, m1 + punpcklbw m1, m2 + pmaddubsw m0, m3 + pmaddubsw m1, m3 + psraw m0, 2 + psraw m1, 2 + pavgw m0, m4 + pavgw m1, m4 +%if mmsize==8 + packuswb m0, m0 + packuswb m1, m1 + movh [r0+r1*0], m0 + movh [r0+r1*1], m1 +%else + packuswb m0, m1 + movh [r0+r1*0], m0 + movhps [r0+r1*1], m0 +%endif + + lea r0, [r0+r1*2] + lea r2, [r2+r3*2] + sub r4d, 2 + jg .nextrow + REP_RET + +cglobal put_vp8_bilinear%1_h_ssse3, 7,7 + shl r5d, 4 +%ifdef PIC + lea r11, [bilinear_filter_vb_m] +%endif + pxor m4, m4 + mova m2, [filter_h2_shuf] + mova m3, [bilinear_filter_vb+r5-16] +.nextrow + movu m0, [r2+r3*0] + movu m1, [r2+r3*1] + pshufb m0, m2 + pshufb m1, m2 + pmaddubsw m0, m3 + pmaddubsw m1, m3 + psraw m0, 2 + psraw m1, 2 + pavgw m0, m4 + pavgw m1, m4 +%if mmsize==8 + packuswb m0, m0 + packuswb m1, m1 + movh [r0+r1*0], m0 + movh [r0+r1*1], m1 +%else + packuswb m0, m1 + movh [r0+r1*0], m0 + movhps [r0+r1*1], m0 +%endif + + lea r0, [r0+r1*2] + lea r2, [r2+r3*2] + sub r4d, 2 + jg .nextrow + REP_RET +%endmacro + +INIT_MMX +FILTER_BILINEAR_SSSE3 4 +INIT_XMM +FILTER_BILINEAR_SSSE3 8 + +cglobal put_vp8_pixels8_mmx, 5,5 +.nextrow: + movq mm0, [r2+r3*0] + movq mm1, [r2+r3*1] + lea r2, [r2+r3*2] + movq [r0+r1*0], mm0 + movq [r0+r1*1], mm1 + lea r0, [r0+r1*2] + sub r4d, 2 + jg .nextrow + REP_RET + +cglobal put_vp8_pixels16_mmx, 5,5 +.nextrow: + movq mm0, [r2+r3*0+0] + movq mm1, [r2+r3*0+8] + movq mm2, [r2+r3*1+0] + movq mm3, [r2+r3*1+8] + lea r2, [r2+r3*2] + movq [r0+r1*0+0], mm0 + movq [r0+r1*0+8], mm1 + movq [r0+r1*1+0], mm2 + movq [r0+r1*1+8], mm3 + lea r0, [r0+r1*2] + sub r4d, 2 + jg .nextrow + REP_RET + +cglobal put_vp8_pixels16_sse, 5,5,2 +.nextrow: + movups xmm0, [r2+r3*0] + movups xmm1, [r2+r3*1] + lea r2, [r2+r3*2] + movaps [r0+r1*0], xmm0 + movaps [r0+r1*1], xmm1 + lea r0, [r0+r1*2] + sub r4d, 2 + jg .nextrow + REP_RET + +;----------------------------------------------------------------------------- +; void vp8_idct_dc_add_(uint8_t *dst, DCTELEM block[16], int stride); +;----------------------------------------------------------------------------- + +%macro ADD_DC 4 + %4 m2, [r0+%3] + %4 m3, [r0+r2+%3] + %4 m4, [r1+%3] + %4 m5, [r1+r2+%3] + paddusb m2, %1 + paddusb m3, %1 + paddusb m4, %1 + paddusb m5, %1 + psubusb m2, %2 + psubusb m3, %2 + psubusb m4, %2 + psubusb m5, %2 + %4 [r0+%3], m2 + %4 [r0+r2+%3], m3 + %4 [r1+%3], m4 + %4 [r1+r2+%3], m5 +%endmacro + +INIT_MMX +cglobal vp8_idct_dc_add_mmx, 3, 3 + ; load data + movd m0, [r1] + + ; calculate DC + paddw m0, [pw_4] + pxor m1, m1 + psraw m0, 3 + movd [r1], m1 + psubw m1, m0 + packuswb m0, m0 + packuswb m1, m1 + punpcklbw m0, m0 + punpcklbw m1, m1 + punpcklwd m0, m0 + punpcklwd m1, m1 + + ; add DC + lea r1, [r0+r2*2] + ADD_DC m0, m1, 0, movh + RET + +INIT_XMM +cglobal vp8_idct_dc_add_sse4, 3, 3, 6 + ; load data + movd m0, [r1] + pxor m1, m1 + + ; calculate DC + paddw m0, [pw_4] + movd [r1], m1 + lea r1, [r0+r2*2] + movd m2, [r0] + movd m3, [r0+r2] + movd m4, [r1] + movd m5, [r1+r2] + psraw m0, 3 + pshuflw m0, m0, 0 + punpcklqdq m0, m0 + punpckldq m2, m3 + punpckldq m4, m5 + punpcklbw m2, m1 + punpcklbw m4, m1 + paddw m2, m0 + paddw m4, m0 + packuswb m2, m4 + movd [r0], m2 + pextrd [r0+r2], m2, 1 + pextrd [r1], m2, 2 + pextrd [r1+r2], m2, 3 + RET + +;----------------------------------------------------------------------------- +; void vp8_idct_dc_add4y_(uint8_t *dst, DCTELEM block[4][16], int stride); +;----------------------------------------------------------------------------- + +INIT_MMX +cglobal vp8_idct_dc_add4y_mmx, 3, 3 + ; load data + movd m0, [r1+32*0] ; A + movd m1, [r1+32*2] ; C + punpcklwd m0, [r1+32*1] ; A B + punpcklwd m1, [r1+32*3] ; C D + punpckldq m0, m1 ; A B C D + pxor m6, m6 + + ; calculate DC + paddw m0, [pw_4] + movd [r1+32*0], m6 + movd [r1+32*1], m6 + movd [r1+32*2], m6 + movd [r1+32*3], m6 + psraw m0, 3 + psubw m6, m0 + packuswb m0, m0 + packuswb m6, m6 + punpcklbw m0, m0 ; AABBCCDD + punpcklbw m6, m6 ; AABBCCDD + movq m1, m0 + movq m7, m6 + punpcklbw m0, m0 ; AAAABBBB + punpckhbw m1, m1 ; CCCCDDDD + punpcklbw m6, m6 ; AAAABBBB + punpckhbw m7, m7 ; CCCCDDDD + + ; add DC + lea r1, [r0+r2*2] + ADD_DC m0, m6, 0, mova + ADD_DC m1, m7, 8, mova + RET + +INIT_XMM +cglobal vp8_idct_dc_add4y_sse2, 3, 3, 6 + ; load data + movd m0, [r1+32*0] ; A + movd m1, [r1+32*2] ; C + punpcklwd m0, [r1+32*1] ; A B + punpcklwd m1, [r1+32*3] ; C D + punpckldq m0, m1 ; A B C D + pxor m1, m1 + + ; calculate DC + paddw m0, [pw_4] + movd [r1+32*0], m1 + movd [r1+32*1], m1 + movd [r1+32*2], m1 + movd [r1+32*3], m1 + psraw m0, 3 + psubw m1, m0 + packuswb m0, m0 + packuswb m1, m1 + punpcklbw m0, m0 + punpcklbw m1, m1 + punpcklbw m0, m0 + punpcklbw m1, m1 + + ; add DC + lea r1, [r0+r2*2] + ADD_DC m0, m1, 0, mova + RET + +;----------------------------------------------------------------------------- +; void vp8_idct_dc_add4uv_(uint8_t *dst, DCTELEM block[4][16], int stride); +;----------------------------------------------------------------------------- + +INIT_MMX +cglobal vp8_idct_dc_add4uv_mmx, 3, 3 + ; load data + movd m0, [r1+32*0] ; A + movd m1, [r1+32*2] ; C + punpcklwd m0, [r1+32*1] ; A B + punpcklwd m1, [r1+32*3] ; C D + punpckldq m0, m1 ; A B C D + pxor m6, m6 + + ; calculate DC + paddw m0, [pw_4] + movd [r1+32*0], m6 + movd [r1+32*1], m6 + movd [r1+32*2], m6 + movd [r1+32*3], m6 + psraw m0, 3 + psubw m6, m0 + packuswb m0, m0 + packuswb m6, m6 + punpcklbw m0, m0 ; AABBCCDD + punpcklbw m6, m6 ; AABBCCDD + movq m1, m0 + movq m7, m6 + punpcklbw m0, m0 ; AAAABBBB + punpckhbw m1, m1 ; CCCCDDDD + punpcklbw m6, m6 ; AAAABBBB + punpckhbw m7, m7 ; CCCCDDDD + + ; add DC + lea r1, [r0+r2*2] + ADD_DC m0, m6, 0, mova + lea r0, [r0+r2*4] + lea r1, [r1+r2*4] + ADD_DC m1, m7, 0, mova + RET + +;----------------------------------------------------------------------------- +; void vp8_idct_add_(uint8_t *dst, DCTELEM block[16], int stride); +;----------------------------------------------------------------------------- + +; calculate %1=mul_35468(%1)-mul_20091(%2); %2=mul_20091(%1)+mul_35468(%2) +; this macro assumes that m6/m7 have words for 20091/17734 loaded +%macro VP8_MULTIPLY_SUMSUB 4 + mova %3, %1 + mova %4, %2 + pmulhw %3, m6 ;20091(1) + pmulhw %4, m6 ;20091(2) + paddw %3, %1 + paddw %4, %2 + paddw %1, %1 + paddw %2, %2 + pmulhw %1, m7 ;35468(1) + pmulhw %2, m7 ;35468(2) + psubw %1, %4 + paddw %2, %3 +%endmacro + +; calculate x0=%1+%3; x1=%1-%3 +; x2=mul_35468(%2)-mul_20091(%4); x3=mul_20091(%2)+mul_35468(%4) +; %1=x0+x3 (tmp0); %2=x1+x2 (tmp1); %3=x1-x2 (tmp2); %4=x0-x3 (tmp3) +; %5/%6 are temporary registers +; we assume m6/m7 have constant words 20091/17734 loaded in them +%macro VP8_IDCT_TRANSFORM4x4_1D 6 + SUMSUB_BA m%3, m%1, m%5 ;t0, t1 + VP8_MULTIPLY_SUMSUB m%2, m%4, m%5,m%6 ;t2, t3 + SUMSUB_BA m%4, m%3, m%5 ;tmp0, tmp3 + SUMSUB_BA m%2, m%1, m%5 ;tmp1, tmp2 + SWAP %4, %1 + SWAP %4, %3 +%endmacro + +INIT_MMX +%macro VP8_IDCT_ADD 1 +cglobal vp8_idct_add_%1, 3, 3 + ; load block data + movq m0, [r1+ 0] + movq m1, [r1+ 8] + movq m2, [r1+16] + movq m3, [r1+24] + movq m6, [pw_20091] + movq m7, [pw_17734] +%ifidn %1, sse + xorps xmm0, xmm0 + movaps [r1+ 0], xmm0 + movaps [r1+16], xmm0 +%else + pxor m4, m4 + movq [r1+ 0], m4 + movq [r1+ 8], m4 + movq [r1+16], m4 + movq [r1+24], m4 +%endif + + ; actual IDCT + VP8_IDCT_TRANSFORM4x4_1D 0, 1, 2, 3, 4, 5 + TRANSPOSE4x4W 0, 1, 2, 3, 4 + paddw m0, [pw_4] + VP8_IDCT_TRANSFORM4x4_1D 0, 1, 2, 3, 4, 5 + TRANSPOSE4x4W 0, 1, 2, 3, 4 + + ; store + pxor m4, m4 + lea r1, [r0+2*r2] + STORE_DIFFx2 m0, m1, m6, m7, m4, 3, r0, r2 + STORE_DIFFx2 m2, m3, m6, m7, m4, 3, r1, r2 + + RET +%endmacro + +VP8_IDCT_ADD mmx +VP8_IDCT_ADD sse + +;----------------------------------------------------------------------------- +; void vp8_luma_dc_wht_mmxext(DCTELEM block[4][4][16], DCTELEM dc[16]) +;----------------------------------------------------------------------------- + +%macro SCATTER_WHT 3 + movd r1d, m%1 + movd r2d, m%2 + mov [r0+2*16*(0+%3)], r1w + mov [r0+2*16*(1+%3)], r2w + shr r1d, 16 + shr r2d, 16 + psrlq m%1, 32 + psrlq m%2, 32 + mov [r0+2*16*(4+%3)], r1w + mov [r0+2*16*(5+%3)], r2w + movd r1d, m%1 + movd r2d, m%2 + mov [r0+2*16*(8+%3)], r1w + mov [r0+2*16*(9+%3)], r2w + shr r1d, 16 + shr r2d, 16 + mov [r0+2*16*(12+%3)], r1w + mov [r0+2*16*(13+%3)], r2w +%endmacro + +%macro HADAMARD4_1D 4 + SUMSUB_BADC m%2, m%1, m%4, m%3 + SUMSUB_BADC m%4, m%2, m%3, m%1 + SWAP %1, %4, %3 +%endmacro + +%macro VP8_DC_WHT 1 +cglobal vp8_luma_dc_wht_%1, 2,3 + movq m0, [r1] + movq m1, [r1+8] + movq m2, [r1+16] + movq m3, [r1+24] +%ifidn %1, sse + xorps xmm0, xmm0 + movaps [r1+ 0], xmm0 + movaps [r1+16], xmm0 +%else + pxor m4, m4 + movq [r1+ 0], m4 + movq [r1+ 8], m4 + movq [r1+16], m4 + movq [r1+24], m4 +%endif + HADAMARD4_1D 0, 1, 2, 3 + TRANSPOSE4x4W 0, 1, 2, 3, 4 + paddw m0, [pw_3] + HADAMARD4_1D 0, 1, 2, 3 + psraw m0, 3 + psraw m1, 3 + psraw m2, 3 + psraw m3, 3 + SCATTER_WHT 0, 1, 0 + SCATTER_WHT 2, 3, 2 + RET +%endmacro + +INIT_MMX +VP8_DC_WHT mmx +VP8_DC_WHT sse + +;----------------------------------------------------------------------------- +; void vp8_h/v_loop_filter_simple_(uint8_t *dst, int stride, int flim); +;----------------------------------------------------------------------------- + +; macro called with 7 mm register indexes as argument, and 4 regular registers +; +; first 4 mm registers will carry the transposed pixel data +; the other three are scratchspace (one would be sufficient, but this allows +; for more spreading/pipelining and thus faster execution on OOE CPUs) +; +; first two regular registers are buf+4*stride and buf+5*stride +; third is -stride, fourth is +stride +%macro READ_8x4_INTERLEAVED 11 + ; interleave 8 (A-H) rows of 4 pixels each + movd m%1, [%8+%10*4] ; A0-3 + movd m%5, [%9+%10*4] ; B0-3 + movd m%2, [%8+%10*2] ; C0-3 + movd m%6, [%8+%10] ; D0-3 + movd m%3, [%8] ; E0-3 + movd m%7, [%9] ; F0-3 + movd m%4, [%9+%11] ; G0-3 + punpcklbw m%1, m%5 ; A/B interleaved + movd m%5, [%9+%11*2] ; H0-3 + punpcklbw m%2, m%6 ; C/D interleaved + punpcklbw m%3, m%7 ; E/F interleaved + punpcklbw m%4, m%5 ; G/H interleaved +%endmacro + +; macro called with 7 mm register indexes as argument, and 5 regular registers +; first 11 mean the same as READ_8x4_TRANSPOSED above +; fifth regular register is scratchspace to reach the bottom 8 rows, it +; will be set to second regular register + 8*stride at the end +%macro READ_16x4_INTERLEAVED 12 + ; transpose 16 (A-P) rows of 4 pixels each + lea %12, [r0+8*r2] + + ; read (and interleave) those addressable by %8 (=r0), A/C/D/E/I/K/L/M + movd m%1, [%8+%10*4] ; A0-3 + movd m%3, [%12+%10*4] ; I0-3 + movd m%2, [%8+%10*2] ; C0-3 + movd m%4, [%12+%10*2] ; K0-3 + movd m%6, [%8+%10] ; D0-3 + movd m%5, [%12+%10] ; L0-3 + movd m%7, [%12] ; M0-3 + add %12, %11 + punpcklbw m%1, m%3 ; A/I + movd m%3, [%8] ; E0-3 + punpcklbw m%2, m%4 ; C/K + punpcklbw m%6, m%5 ; D/L + punpcklbw m%3, m%7 ; E/M + punpcklbw m%2, m%6 ; C/D/K/L interleaved + + ; read (and interleave) those addressable by %9 (=r4), B/F/G/H/J/N/O/P + movd m%5, [%9+%10*4] ; B0-3 + movd m%4, [%12+%10*4] ; J0-3 + movd m%7, [%9] ; F0-3 + movd m%6, [%12] ; N0-3 + punpcklbw m%5, m%4 ; B/J + punpcklbw m%7, m%6 ; F/N + punpcklbw m%1, m%5 ; A/B/I/J interleaved + punpcklbw m%3, m%7 ; E/F/M/N interleaved + movd m%4, [%9+%11] ; G0-3 + movd m%6, [%12+%11] ; O0-3 + movd m%5, [%9+%11*2] ; H0-3 + movd m%7, [%12+%11*2] ; P0-3 + punpcklbw m%4, m%6 ; G/O + punpcklbw m%5, m%7 ; H/P + punpcklbw m%4, m%5 ; G/H/O/P interleaved +%endmacro + +; write 4 mm registers of 2 dwords each +; first four arguments are mm register indexes containing source data +; last four are registers containing buf+4*stride, buf+5*stride, +; -stride and +stride +%macro WRITE_4x2D 8 + ; write out (2 dwords per register) + movd [%5+%7*4], m%1 + movd [%5+%7*2], m%2 + movd [%5], m%3 + movd [%6+%8], m%4 + punpckhdq m%1, m%1 + punpckhdq m%2, m%2 + punpckhdq m%3, m%3 + punpckhdq m%4, m%4 + movd [%6+%7*4], m%1 + movd [%5+%7], m%2 + movd [%6], m%3 + movd [%6+%8*2], m%4 +%endmacro + +; write 4 xmm registers of 4 dwords each +; arguments same as WRITE_2x4D, but with an extra register, so that the 5 regular +; registers contain buf+4*stride, buf+5*stride, buf+12*stride, -stride and +stride +; we add 1*stride to the third regular registry in the process +; the 10th argument is 16 if it's a Y filter (i.e. all regular registers cover the +; same memory region), or 8 if they cover two separate buffers (third one points to +; a different memory region than the first two), allowing for more optimal code for +; the 16-width case +%macro WRITE_4x4D 10 + ; write out (4 dwords per register), start with dwords zero + movd [%5+%8*4], m%1 + movd [%5], m%2 + movd [%7+%8*4], m%3 + movd [%7], m%4 + + ; store dwords 1 + psrldq m%1, 4 + psrldq m%2, 4 + psrldq m%3, 4 + psrldq m%4, 4 + movd [%6+%8*4], m%1 + movd [%6], m%2 +%if %10 == 16 + movd [%6+%9*4], m%3 +%endif + movd [%7+%9], m%4 + + ; write dwords 2 + psrldq m%1, 4 + psrldq m%2, 4 +%if %10 == 8 + movd [%5+%8*2], m%1 + movd %5d, m%3 +%endif + psrldq m%3, 4 + psrldq m%4, 4 +%if %10 == 16 + movd [%5+%8*2], m%1 +%endif + movd [%6+%9], m%2 + movd [%7+%8*2], m%3 + movd [%7+%9*2], m%4 + add %7, %9 + + ; store dwords 3 + psrldq m%1, 4 + psrldq m%2, 4 + psrldq m%3, 4 + psrldq m%4, 4 +%if %10 == 8 + mov [%7+%8*4], %5d + movd [%6+%8*2], m%1 +%else + movd [%5+%8], m%1 +%endif + movd [%6+%9*2], m%2 + movd [%7+%8*2], m%3 + movd [%7+%9*2], m%4 +%endmacro + +; write 4 or 8 words in the mmx/xmm registers as 8 lines +; 1 and 2 are the registers to write, this can be the same (for SSE2) +; for pre-SSE4: +; 3 is a general-purpose register that we will clobber +; for SSE4: +; 3 is a pointer to the destination's 5th line +; 4 is a pointer to the destination's 4th line +; 5/6 is -stride and +stride +%macro WRITE_2x4W 6 + movd %3d, %1 + punpckhdq %1, %1 + mov [%4+%5*4], %3w + shr %3, 16 + add %4, %6 + mov [%4+%5*4], %3w + + movd %3d, %1 + add %4, %5 + mov [%4+%5*2], %3w + shr %3, 16 + mov [%4+%5 ], %3w + + movd %3d, %2 + punpckhdq %2, %2 + mov [%4 ], %3w + shr %3, 16 + mov [%4+%6 ], %3w + + movd %3d, %2 + add %4, %6 + mov [%4+%6 ], %3w + shr %3, 16 + mov [%4+%6*2], %3w + add %4, %5 +%endmacro + +%macro WRITE_8W_SSE2 5 + movd %2d, %1 + psrldq %1, 4 + mov [%3+%4*4], %2w + shr %2, 16 + add %3, %5 + mov [%3+%4*4], %2w + + movd %2d, %1 + psrldq %1, 4 + add %3, %4 + mov [%3+%4*2], %2w + shr %2, 16 + mov [%3+%4 ], %2w + + movd %2d, %1 + psrldq %1, 4 + mov [%3 ], %2w + shr %2, 16 + mov [%3+%5 ], %2w + + movd %2d, %1 + add %3, %5 + mov [%3+%5 ], %2w + shr %2, 16 + mov [%3+%5*2], %2w +%endmacro + +%macro WRITE_8W_SSE4 5 + pextrw [%3+%4*4], %1, 0 + pextrw [%2+%4*4], %1, 1 + pextrw [%3+%4*2], %1, 2 + pextrw [%3+%4 ], %1, 3 + pextrw [%3 ], %1, 4 + pextrw [%2 ], %1, 5 + pextrw [%2+%5 ], %1, 6 + pextrw [%2+%5*2], %1, 7 +%endmacro + +%macro SPLATB_REG_MMX 2-3 + movd %1, %2d + punpcklbw %1, %1 + punpcklwd %1, %1 + punpckldq %1, %1 +%endmacro + +%macro SPLATB_REG_MMXEXT 2-3 + movd %1, %2d + punpcklbw %1, %1 + pshufw %1, %1, 0x0 +%endmacro + +%macro SPLATB_REG_SSE2 2-3 + movd %1, %2d + punpcklbw %1, %1 + pshuflw %1, %1, 0x0 + punpcklqdq %1, %1 +%endmacro + +%macro SPLATB_REG_SSSE3 3 + movd %1, %2d + pshufb %1, %3 +%endmacro + +%macro SIMPLE_LOOPFILTER 4 +cglobal vp8_%2_loop_filter_simple_%1, 3, %3, %4 +%if mmsize == 8 ; mmx/mmxext + mov r3, 2 +%endif +%ifnidn %1, sse2 +%if mmsize == 16 + pxor m0, m0 +%endif +%endif + SPLATB_REG m7, r2, m0 ; splat "flim" into register + + ; set up indexes to address 4 rows + mov r2, r1 + neg r1 +%ifidn %2, h + lea r0, [r0+4*r2-2] +%endif + +%if mmsize == 8 ; mmx / mmxext +.next8px +%endif +%ifidn %2, v + ; read 4 half/full rows of pixels + mova m0, [r0+r1*2] ; p1 + mova m1, [r0+r1] ; p0 + mova m2, [r0] ; q0 + mova m3, [r0+r2] ; q1 +%else ; h + lea r4, [r0+r2] + +%if mmsize == 8 ; mmx/mmxext + READ_8x4_INTERLEAVED 0, 1, 2, 3, 4, 5, 6, r0, r4, r1, r2 +%else ; sse2 + READ_16x4_INTERLEAVED 0, 1, 2, 3, 4, 5, 6, r0, r4, r1, r2, r3 +%endif + TRANSPOSE4x4W 0, 1, 2, 3, 4 +%endif + + ; simple_limit + mova m5, m2 ; m5=backup of q0 + mova m6, m1 ; m6=backup of p0 + psubusb m1, m2 ; p0-q0 + psubusb m2, m6 ; q0-p0 + por m1, m2 ; FFABS(p0-q0) + paddusb m1, m1 ; m1=FFABS(p0-q0)*2 + + mova m4, m3 + mova m2, m0 + psubusb m3, m0 ; q1-p1 + psubusb m0, m4 ; p1-q1 + por m3, m0 ; FFABS(p1-q1) + mova m0, [pb_80] + pxor m2, m0 + pxor m4, m0 + psubsb m2, m4 ; m2=p1-q1 (signed) backup for below + pand m3, [pb_FE] + psrlq m3, 1 ; m3=FFABS(p1-q1)/2, this can be used signed + paddusb m3, m1 + psubusb m3, m7 + pxor m1, m1 + pcmpeqb m3, m1 ; abs(p0-q0)*2+abs(p1-q1)/2<=flim mask(0xff/0x0) + + ; filter_common (use m2/p1-q1, m4=q0, m6=p0, m5/q0-p0 and m3/mask) + mova m4, m5 + pxor m5, m0 + pxor m0, m6 + psubsb m5, m0 ; q0-p0 (signed) + paddsb m2, m5 + paddsb m2, m5 + paddsb m2, m5 ; a=(p1-q1) + 3*(q0-p0) + pand m2, m3 ; apply filter mask (m3) + + mova m3, [pb_F8] + mova m1, m2 + paddsb m2, [pb_4] ; f1<<3=a+4 + paddsb m1, [pb_3] ; f2<<3=a+3 + pand m2, m3 + pand m1, m3 ; cache f2<<3 + + pxor m0, m0 + pxor m3, m3 + pcmpgtb m0, m2 ; which values are <0? + psubb m3, m2 ; -f1<<3 + psrlq m2, 3 ; +f1 + psrlq m3, 3 ; -f1 + pand m3, m0 + pandn m0, m2 + psubusb m4, m0 + paddusb m4, m3 ; q0-f1 + + pxor m0, m0 + pxor m3, m3 + pcmpgtb m0, m1 ; which values are <0? + psubb m3, m1 ; -f2<<3 + psrlq m1, 3 ; +f2 + psrlq m3, 3 ; -f2 + pand m3, m0 + pandn m0, m1 + paddusb m6, m0 + psubusb m6, m3 ; p0+f2 + + ; store +%ifidn %2, v + mova [r0], m4 + mova [r0+r1], m6 +%else ; h + inc r0 + SBUTTERFLY bw, 6, 4, 0 + +%if mmsize == 16 ; sse2 +%ifidn %1, sse4 + inc r4 +%endif + WRITE_8W m6, r4, r0, r1, r2 + lea r4, [r3+r1+1] +%ifidn %1, sse4 + inc r3 +%endif + WRITE_8W m4, r3, r4, r1, r2 +%else ; mmx/mmxext + WRITE_2x4W m6, m4, r4, r0, r1, r2 +%endif +%endif + +%if mmsize == 8 ; mmx/mmxext + ; next 8 pixels +%ifidn %2, v + add r0, 8 ; advance 8 cols = pixels +%else ; h + lea r0, [r0+r2*8-1] ; advance 8 rows = lines +%endif + dec r3 + jg .next8px + REP_RET +%else ; sse2 + RET +%endif +%endmacro + +INIT_MMX +%define SPLATB_REG SPLATB_REG_MMX +SIMPLE_LOOPFILTER mmx, v, 4, 0 +SIMPLE_LOOPFILTER mmx, h, 5, 0 +%define SPLATB_REG SPLATB_REG_MMXEXT +SIMPLE_LOOPFILTER mmxext, v, 4, 0 +SIMPLE_LOOPFILTER mmxext, h, 5, 0 +INIT_XMM +%define SPLATB_REG SPLATB_REG_SSE2 +%define WRITE_8W WRITE_8W_SSE2 +SIMPLE_LOOPFILTER sse2, v, 3, 8 +SIMPLE_LOOPFILTER sse2, h, 5, 8 +%define SPLATB_REG SPLATB_REG_SSSE3 +SIMPLE_LOOPFILTER ssse3, v, 3, 8 +SIMPLE_LOOPFILTER ssse3, h, 5, 8 +%define WRITE_8W WRITE_8W_SSE4 +SIMPLE_LOOPFILTER sse4, h, 5, 8 + +;----------------------------------------------------------------------------- +; void vp8_h/v_loop_filter_inner_(uint8_t *dst, [uint8_t *v,] int stride, +; int flimE, int flimI, int hev_thr); +;----------------------------------------------------------------------------- + +%macro INNER_LOOPFILTER 5 +%if %4 == 8 ; chroma +cglobal vp8_%2_loop_filter8uv_inner_%1, 6, %3, %5 +%define dst8_reg r1 +%define mstride_reg r2 +%define E_reg r3 +%define I_reg r4 +%define hev_thr_reg r5 +%else ; luma +cglobal vp8_%2_loop_filter16y_inner_%1, 5, %3, %5 +%define mstride_reg r1 +%define E_reg r2 +%define I_reg r3 +%define hev_thr_reg r4 +%ifdef m8 ; x86-64, sse2 +%define dst8_reg r4 +%elif mmsize == 16 ; x86-32, sse2 +%define dst8_reg r5 +%else ; x86-32, mmx/mmxext +%define cnt_reg r5 +%endif +%endif +%define dst_reg r0 +%define stride_reg E_reg +%define dst2_reg I_reg +%ifndef m8 +%define stack_reg hev_thr_reg +%endif + +%ifnidn %1, sse2 +%if mmsize == 16 + pxor m7, m7 +%endif +%endif + +%ifndef m8 ; mmx/mmxext or sse2 on x86-32 + ; splat function arguments + SPLATB_REG m0, E_reg, m7 ; E + SPLATB_REG m1, I_reg, m7 ; I + SPLATB_REG m2, hev_thr_reg, m7 ; hev_thresh + + ; align stack + mov stack_reg, rsp ; backup stack pointer + and rsp, ~(mmsize-1) ; align stack +%ifidn %2, v + sub rsp, mmsize * 4 ; stack layout: [0]=E, [1]=I, [2]=hev_thr + ; [3]=hev() result +%else ; h + sub rsp, mmsize * 5 ; extra storage space for transposes +%endif + +%define flim_E [rsp] +%define flim_I [rsp+mmsize] +%define hev_thr [rsp+mmsize*2] +%define mask_res [rsp+mmsize*3] +%define p0backup [rsp+mmsize*3] +%define q0backup [rsp+mmsize*4] + + mova flim_E, m0 + mova flim_I, m1 + mova hev_thr, m2 + +%else ; sse2 on x86-64 + +%define flim_E m9 +%define flim_I m10 +%define hev_thr m11 +%define mask_res m12 +%define p0backup m12 +%define q0backup m8 + + ; splat function arguments + SPLATB_REG flim_E, E_reg, m7 ; E + SPLATB_REG flim_I, I_reg, m7 ; I + SPLATB_REG hev_thr, hev_thr_reg, m7 ; hev_thresh +%endif + +%if mmsize == 8 && %4 == 16 ; mmx/mmxext + mov cnt_reg, 2 +%endif + mov stride_reg, mstride_reg + neg mstride_reg +%ifidn %2, h + lea dst_reg, [dst_reg + stride_reg*4-4] +%if %4 == 8 + lea dst8_reg, [dst8_reg+ stride_reg*4-4] +%endif +%endif + +%if mmsize == 8 +.next8px +%endif + ; read + lea dst2_reg, [dst_reg + stride_reg] +%ifidn %2, v +%if %4 == 8 && mmsize == 16 +%define movrow movh +%else +%define movrow mova +%endif + movrow m0, [dst_reg +mstride_reg*4] ; p3 + movrow m1, [dst2_reg+mstride_reg*4] ; p2 + movrow m2, [dst_reg +mstride_reg*2] ; p1 + movrow m5, [dst2_reg] ; q1 + movrow m6, [dst2_reg+ stride_reg] ; q2 + movrow m7, [dst2_reg+ stride_reg*2] ; q3 +%if mmsize == 16 && %4 == 8 + movhps m0, [dst8_reg+mstride_reg*4] + movhps m2, [dst8_reg+mstride_reg*2] + add dst8_reg, stride_reg + movhps m1, [dst8_reg+mstride_reg*4] + movhps m5, [dst8_reg] + movhps m6, [dst8_reg+ stride_reg] + movhps m7, [dst8_reg+ stride_reg*2] + add dst8_reg, mstride_reg +%endif +%elif mmsize == 8 ; mmx/mmxext (h) + ; read 8 rows of 8px each + movu m0, [dst_reg +mstride_reg*4] + movu m1, [dst2_reg+mstride_reg*4] + movu m2, [dst_reg +mstride_reg*2] + movu m3, [dst_reg +mstride_reg] + movu m4, [dst_reg] + movu m5, [dst2_reg] + movu m6, [dst2_reg+ stride_reg] + + ; 8x8 transpose + TRANSPOSE4x4B 0, 1, 2, 3, 7 + mova q0backup, m1 + movu m7, [dst2_reg+ stride_reg*2] + TRANSPOSE4x4B 4, 5, 6, 7, 1 + SBUTTERFLY dq, 0, 4, 1 ; p3/p2 + SBUTTERFLY dq, 2, 6, 1 ; q0/q1 + SBUTTERFLY dq, 3, 7, 1 ; q2/q3 + mova m1, q0backup + mova q0backup, m2 ; store q0 + SBUTTERFLY dq, 1, 5, 2 ; p1/p0 + mova p0backup, m5 ; store p0 + SWAP 1, 4 + SWAP 2, 4 + SWAP 6, 3 + SWAP 5, 3 +%else ; sse2 (h) +%if %4 == 16 + lea dst8_reg, [dst_reg + stride_reg*8] +%endif + + ; read 16 rows of 8px each, interleave + movh m0, [dst_reg +mstride_reg*4] + movh m1, [dst8_reg+mstride_reg*4] + movh m2, [dst_reg +mstride_reg*2] + movh m5, [dst8_reg+mstride_reg*2] + movh m3, [dst_reg +mstride_reg] + movh m6, [dst8_reg+mstride_reg] + movh m4, [dst_reg] + movh m7, [dst8_reg] + punpcklbw m0, m1 ; A/I + punpcklbw m2, m5 ; C/K + punpcklbw m3, m6 ; D/L + punpcklbw m4, m7 ; E/M + + add dst8_reg, stride_reg + movh m1, [dst2_reg+mstride_reg*4] + movh m6, [dst8_reg+mstride_reg*4] + movh m5, [dst2_reg] + movh m7, [dst8_reg] + punpcklbw m1, m6 ; B/J + punpcklbw m5, m7 ; F/N + movh m6, [dst2_reg+ stride_reg] + movh m7, [dst8_reg+ stride_reg] + punpcklbw m6, m7 ; G/O + + ; 8x16 transpose + TRANSPOSE4x4B 0, 1, 2, 3, 7 +%ifdef m8 + SWAP 1, 8 +%else + mova q0backup, m1 +%endif + movh m7, [dst2_reg+ stride_reg*2] + movh m1, [dst8_reg+ stride_reg*2] + punpcklbw m7, m1 ; H/P + TRANSPOSE4x4B 4, 5, 6, 7, 1 + SBUTTERFLY dq, 0, 4, 1 ; p3/p2 + SBUTTERFLY dq, 2, 6, 1 ; q0/q1 + SBUTTERFLY dq, 3, 7, 1 ; q2/q3 +%ifdef m8 + SWAP 1, 8 + SWAP 2, 8 +%else + mova m1, q0backup + mova q0backup, m2 ; store q0 +%endif + SBUTTERFLY dq, 1, 5, 2 ; p1/p0 +%ifdef m12 + SWAP 5, 12 +%else + mova p0backup, m5 ; store p0 +%endif + SWAP 1, 4 + SWAP 2, 4 + SWAP 6, 3 + SWAP 5, 3 +%endif + + ; normal_limit for p3-p2, p2-p1, q3-q2 and q2-q1 + mova m4, m1 + SWAP 4, 1 + psubusb m4, m0 ; p2-p3 + psubusb m0, m1 ; p3-p2 + por m0, m4 ; abs(p3-p2) + + mova m4, m2 + SWAP 4, 2 + psubusb m4, m1 ; p1-p2 + psubusb m1, m2 ; p2-p1 + por m1, m4 ; abs(p2-p1) + + mova m4, m6 + SWAP 4, 6 + psubusb m4, m7 ; q2-q3 + psubusb m7, m6 ; q3-q2 + por m7, m4 ; abs(q3-q2) + + mova m4, m5 + SWAP 4, 5 + psubusb m4, m6 ; q1-q2 + psubusb m6, m5 ; q2-q1 + por m6, m4 ; abs(q2-q1) + +%ifidn %1, mmx + mova m4, flim_I + pxor m3, m3 + psubusb m0, m4 + psubusb m1, m4 + psubusb m7, m4 + psubusb m6, m4 + pcmpeqb m0, m3 ; abs(p3-p2) <= I + pcmpeqb m1, m3 ; abs(p2-p1) <= I + pcmpeqb m7, m3 ; abs(q3-q2) <= I + pcmpeqb m6, m3 ; abs(q2-q1) <= I + pand m0, m1 + pand m7, m6 + pand m0, m7 +%else ; mmxext/sse2 + pmaxub m0, m1 + pmaxub m6, m7 + pmaxub m0, m6 +%endif + + ; normal_limit and high_edge_variance for p1-p0, q1-q0 + SWAP 7, 3 ; now m7 is zero +%ifidn %2, v + movrow m3, [dst_reg +mstride_reg] ; p0 +%if mmsize == 16 && %4 == 8 + movhps m3, [dst8_reg+mstride_reg] +%endif +%elifdef m12 + SWAP 3, 12 +%else + mova m3, p0backup +%endif + + mova m1, m2 + SWAP 1, 2 + mova m6, m3 + SWAP 3, 6 + psubusb m1, m3 ; p1-p0 + psubusb m6, m2 ; p0-p1 + por m1, m6 ; abs(p1-p0) +%ifidn %1, mmx + mova m6, m1 + psubusb m1, m4 + psubusb m6, hev_thr + pcmpeqb m1, m7 ; abs(p1-p0) <= I + pcmpeqb m6, m7 ; abs(p1-p0) <= hev_thresh + pand m0, m1 + mova mask_res, m6 +%else ; mmxext/sse2 + pmaxub m0, m1 ; max_I + SWAP 1, 4 ; max_hev_thresh +%endif + + SWAP 6, 4 ; now m6 is I +%ifidn %2, v + movrow m4, [dst_reg] ; q0 +%if mmsize == 16 && %4 == 8 + movhps m4, [dst8_reg] +%endif +%elifdef m8 + SWAP 4, 8 +%else + mova m4, q0backup +%endif + mova m1, m4 + SWAP 1, 4 + mova m7, m5 + SWAP 7, 5 + psubusb m1, m5 ; q0-q1 + psubusb m7, m4 ; q1-q0 + por m1, m7 ; abs(q1-q0) +%ifidn %1, mmx + mova m7, m1 + psubusb m1, m6 + psubusb m7, hev_thr + pxor m6, m6 + pcmpeqb m1, m6 ; abs(q1-q0) <= I + pcmpeqb m7, m6 ; abs(q1-q0) <= hev_thresh + mova m6, mask_res + pand m0, m1 ; abs([pq][321]-[pq][210]) <= I + pand m6, m7 +%else ; mmxext/sse2 + pxor m7, m7 + pmaxub m0, m1 + pmaxub m6, m1 + psubusb m0, flim_I + psubusb m6, hev_thr + pcmpeqb m0, m7 ; max(abs(..)) <= I + pcmpeqb m6, m7 ; !(max(abs..) > thresh) +%endif +%ifdef m12 + SWAP 6, 12 +%else + mova mask_res, m6 ; !(abs(p1-p0) > hev_t || abs(q1-q0) > hev_t) +%endif + + ; simple_limit + mova m1, m3 + SWAP 1, 3 + mova m6, m4 ; keep copies of p0/q0 around for later use + SWAP 6, 4 + psubusb m1, m4 ; p0-q0 + psubusb m6, m3 ; q0-p0 + por m1, m6 ; abs(q0-p0) + paddusb m1, m1 ; m1=2*abs(q0-p0) + + mova m7, m2 + SWAP 7, 2 + mova m6, m5 + SWAP 6, 5 + psubusb m7, m5 ; p1-q1 + psubusb m6, m2 ; q1-p1 + por m7, m6 ; abs(q1-p1) + pxor m6, m6 + pand m7, [pb_FE] + psrlq m7, 1 ; abs(q1-p1)/2 + paddusb m7, m1 ; abs(q0-p0)*2+abs(q1-p1)/2 + psubusb m7, flim_E + pcmpeqb m7, m6 ; abs(q0-p0)*2+abs(q1-p1)/2 <= E + pand m0, m7 ; normal_limit result + + ; filter_common; at this point, m2-m5=p1-q1 and m0 is filter_mask +%ifdef m8 ; x86-64 && sse2 + mova m8, [pb_80] +%define pb_80_var m8 +%else ; x86-32 or mmx/mmxext +%define pb_80_var [pb_80] +%endif + mova m1, m4 + mova m7, m3 + pxor m1, pb_80_var + pxor m7, pb_80_var + psubsb m1, m7 ; (signed) q0-p0 + mova m6, m2 + mova m7, m5 + pxor m6, pb_80_var + pxor m7, pb_80_var + psubsb m6, m7 ; (signed) p1-q1 + mova m7, mask_res + pandn m7, m6 + paddsb m7, m1 + paddsb m7, m1 + paddsb m7, m1 ; 3*(q0-p0)+is4tap?(p1-q1) + + pand m7, m0 + mova m1, [pb_F8] + mova m6, m7 + paddsb m7, [pb_3] + paddsb m6, [pb_4] + pand m7, m1 + pand m6, m1 + + pxor m1, m1 + pxor m0, m0 + pcmpgtb m1, m7 + psubb m0, m7 + psrlq m7, 3 ; +f2 + psrlq m0, 3 ; -f2 + pand m0, m1 + pandn m1, m7 + psubusb m3, m0 + paddusb m3, m1 ; p0+f2 + + pxor m1, m1 + pxor m0, m0 + pcmpgtb m0, m6 + psubb m1, m6 + psrlq m6, 3 ; +f1 + psrlq m1, 3 ; -f1 + pand m1, m0 + pandn m0, m6 + psubusb m4, m0 + paddusb m4, m1 ; q0-f1 + +%ifdef m12 + SWAP 6, 12 +%else + mova m6, mask_res +%endif +%ifidn %1, mmx + mova m7, [pb_1] +%else ; mmxext/sse2 + pxor m7, m7 +%endif + pand m0, m6 + pand m1, m6 +%ifidn %1, mmx + paddusb m0, m7 + pand m1, [pb_FE] + pandn m7, m0 + psrlq m1, 1 + psrlq m7, 1 + SWAP 0, 7 +%else ; mmxext/sse2 + psubusb m1, [pb_1] + pavgb m0, m7 ; a + pavgb m1, m7 ; -a +%endif + psubusb m5, m0 + psubusb m2, m1 + paddusb m5, m1 ; q1-a + paddusb m2, m0 ; p1+a + + ; store +%ifidn %2, v + movrow [dst_reg +mstride_reg*2], m2 + movrow [dst_reg +mstride_reg ], m3 + movrow [dst_reg], m4 + movrow [dst_reg + stride_reg ], m5 +%if mmsize == 16 && %4 == 8 + movhps [dst8_reg+mstride_reg*2], m2 + movhps [dst8_reg+mstride_reg ], m3 + movhps [dst8_reg], m4 + movhps [dst8_reg+ stride_reg ], m5 +%endif +%else ; h + add dst_reg, 2 + add dst2_reg, 2 + + ; 4x8/16 transpose + TRANSPOSE4x4B 2, 3, 4, 5, 6 + +%if mmsize == 8 ; mmx/mmxext (h) + WRITE_4x2D 2, 3, 4, 5, dst_reg, dst2_reg, mstride_reg, stride_reg +%else ; sse2 (h) + lea dst8_reg, [dst8_reg+mstride_reg+2] + WRITE_4x4D 2, 3, 4, 5, dst_reg, dst2_reg, dst8_reg, mstride_reg, stride_reg, %4 +%endif +%endif + +%if mmsize == 8 +%if %4 == 8 ; chroma +%ifidn %2, h + sub dst_reg, 2 +%endif + cmp dst_reg, dst8_reg + mov dst_reg, dst8_reg + jnz .next8px +%else +%ifidn %2, h + lea dst_reg, [dst_reg + stride_reg*8-2] +%else ; v + add dst_reg, 8 +%endif + dec cnt_reg + jg .next8px +%endif +%endif + +%ifndef m8 ; sse2 on x86-32 or mmx/mmxext + mov rsp, stack_reg ; restore stack pointer +%endif + RET +%endmacro + +INIT_MMX +%define SPLATB_REG SPLATB_REG_MMX +INNER_LOOPFILTER mmx, v, 6, 16, 0 +INNER_LOOPFILTER mmx, h, 6, 16, 0 +INNER_LOOPFILTER mmx, v, 6, 8, 0 +INNER_LOOPFILTER mmx, h, 6, 8, 0 + +%define SPLATB_REG SPLATB_REG_MMXEXT +INNER_LOOPFILTER mmxext, v, 6, 16, 0 +INNER_LOOPFILTER mmxext, h, 6, 16, 0 +INNER_LOOPFILTER mmxext, v, 6, 8, 0 +INNER_LOOPFILTER mmxext, h, 6, 8, 0 + +INIT_XMM +%define SPLATB_REG SPLATB_REG_SSE2 +INNER_LOOPFILTER sse2, v, 5, 16, 13 +%ifdef m8 +INNER_LOOPFILTER sse2, h, 5, 16, 13 +%else +INNER_LOOPFILTER sse2, h, 6, 16, 13 +%endif +INNER_LOOPFILTER sse2, v, 6, 8, 13 +INNER_LOOPFILTER sse2, h, 6, 8, 13 + +%define SPLATB_REG SPLATB_REG_SSSE3 +INNER_LOOPFILTER ssse3, v, 5, 16, 13 +%ifdef m8 +INNER_LOOPFILTER ssse3, h, 5, 16, 13 +%else +INNER_LOOPFILTER ssse3, h, 6, 16, 13 +%endif +INNER_LOOPFILTER ssse3, v, 6, 8, 13 +INNER_LOOPFILTER ssse3, h, 6, 8, 13 + +;----------------------------------------------------------------------------- +; void vp8_h/v_loop_filter_mbedge_(uint8_t *dst, [uint8_t *v,] int stride, +; int flimE, int flimI, int hev_thr); +;----------------------------------------------------------------------------- + +%macro MBEDGE_LOOPFILTER 5 +%if %4 == 8 ; chroma +cglobal vp8_%2_loop_filter8uv_mbedge_%1, 6, %3, %5 +%define dst8_reg r1 +%define mstride_reg r2 +%define E_reg r3 +%define I_reg r4 +%define hev_thr_reg r5 +%else ; luma +cglobal vp8_%2_loop_filter16y_mbedge_%1, 5, %3, %5 +%define mstride_reg r1 +%define E_reg r2 +%define I_reg r3 +%define hev_thr_reg r4 +%ifdef m8 ; x86-64, sse2 +%define dst8_reg r4 +%elif mmsize == 16 ; x86-32, sse2 +%define dst8_reg r5 +%else ; x86-32, mmx/mmxext +%define cnt_reg r5 +%endif +%endif +%define dst_reg r0 +%define stride_reg E_reg +%define dst2_reg I_reg +%ifndef m8 +%define stack_reg hev_thr_reg +%endif + +%define ssse3_or_higher 0 +%ifnidn %1, sse2 +%if mmsize == 16 +%define ssse3_or_higher 1 +%endif +%endif + +%if ssse3_or_higher + pxor m7, m7 +%endif + +%ifndef m8 ; mmx/mmxext or sse2 on x86-32 + ; splat function arguments + SPLATB_REG m0, E_reg, m7 ; E + SPLATB_REG m1, I_reg, m7 ; I + SPLATB_REG m2, hev_thr_reg, m7 ; hev_thresh + + ; align stack + mov stack_reg, rsp ; backup stack pointer + and rsp, ~(mmsize-1) ; align stack +%if mmsize == 16 + sub rsp, mmsize * 7 +%else + sub rsp, mmsize * 8 ; stack layout: [0]=E, [1]=I, [2]=hev_thr + ; [3]=hev() result + ; [4]=filter tmp result + ; [5]/[6] = p2/q2 backup + ; [7]=lim_res sign result +%endif + +%define flim_E [rsp] +%define flim_I [rsp+mmsize] +%define hev_thr [rsp+mmsize*2] +%define mask_res [rsp+mmsize*3] +%define lim_res [rsp+mmsize*4] +%define p0backup [rsp+mmsize*3] +%define q0backup [rsp+mmsize*4] +%define p2backup [rsp+mmsize*5] +%define q2backup [rsp+mmsize*6] +%if mmsize == 16 +%define lim_sign [rsp] +%else +%define lim_sign [rsp+mmsize*7] +%endif + + mova flim_E, m0 + mova flim_I, m1 + mova hev_thr, m2 + +%else ; sse2 on x86-64 + +%define flim_E m9 +%define flim_I m10 +%define hev_thr m11 +%define mask_res m12 +%define lim_res m8 +%define p0backup m12 +%define q0backup m8 +%define p2backup m13 +%define q2backup m14 +%define lim_sign m9 + + ; splat function arguments + SPLATB_REG flim_E, E_reg, m7 ; E + SPLATB_REG flim_I, I_reg, m7 ; I + SPLATB_REG hev_thr, hev_thr_reg, m7 ; hev_thresh +%endif + +%if mmsize == 8 && %4 == 16 ; mmx/mmxext + mov cnt_reg, 2 +%endif + mov stride_reg, mstride_reg + neg mstride_reg +%ifidn %2, h + lea dst_reg, [dst_reg + stride_reg*4-4] +%if %4 == 8 + lea dst8_reg, [dst8_reg+ stride_reg*4-4] +%endif +%endif + +%if mmsize == 8 +.next8px +%endif + ; read + lea dst2_reg, [dst_reg + stride_reg] +%ifidn %2, v +%if %4 == 8 && mmsize == 16 +%define movrow movh +%else +%define movrow mova +%endif + movrow m0, [dst_reg +mstride_reg*4] ; p3 + movrow m1, [dst2_reg+mstride_reg*4] ; p2 + movrow m2, [dst_reg +mstride_reg*2] ; p1 + movrow m5, [dst2_reg] ; q1 + movrow m6, [dst2_reg+ stride_reg] ; q2 + movrow m7, [dst2_reg+ stride_reg*2] ; q3 +%if mmsize == 16 && %4 == 8 + movhps m0, [dst8_reg+mstride_reg*4] + movhps m2, [dst8_reg+mstride_reg*2] + add dst8_reg, stride_reg + movhps m1, [dst8_reg+mstride_reg*4] + movhps m5, [dst8_reg] + movhps m6, [dst8_reg+ stride_reg] + movhps m7, [dst8_reg+ stride_reg*2] + add dst8_reg, mstride_reg +%endif +%elif mmsize == 8 ; mmx/mmxext (h) + ; read 8 rows of 8px each + movu m0, [dst_reg +mstride_reg*4] + movu m1, [dst2_reg+mstride_reg*4] + movu m2, [dst_reg +mstride_reg*2] + movu m3, [dst_reg +mstride_reg] + movu m4, [dst_reg] + movu m5, [dst2_reg] + movu m6, [dst2_reg+ stride_reg] + + ; 8x8 transpose + TRANSPOSE4x4B 0, 1, 2, 3, 7 + mova q0backup, m1 + movu m7, [dst2_reg+ stride_reg*2] + TRANSPOSE4x4B 4, 5, 6, 7, 1 + SBUTTERFLY dq, 0, 4, 1 ; p3/p2 + SBUTTERFLY dq, 2, 6, 1 ; q0/q1 + SBUTTERFLY dq, 3, 7, 1 ; q2/q3 + mova m1, q0backup + mova q0backup, m2 ; store q0 + SBUTTERFLY dq, 1, 5, 2 ; p1/p0 + mova p0backup, m5 ; store p0 + SWAP 1, 4 + SWAP 2, 4 + SWAP 6, 3 + SWAP 5, 3 +%else ; sse2 (h) +%if %4 == 16 + lea dst8_reg, [dst_reg + stride_reg*8] +%endif + + ; read 16 rows of 8px each, interleave + movh m0, [dst_reg +mstride_reg*4] + movh m1, [dst8_reg+mstride_reg*4] + movh m2, [dst_reg +mstride_reg*2] + movh m5, [dst8_reg+mstride_reg*2] + movh m3, [dst_reg +mstride_reg] + movh m6, [dst8_reg+mstride_reg] + movh m4, [dst_reg] + movh m7, [dst8_reg] + punpcklbw m0, m1 ; A/I + punpcklbw m2, m5 ; C/K + punpcklbw m3, m6 ; D/L + punpcklbw m4, m7 ; E/M + + add dst8_reg, stride_reg + movh m1, [dst2_reg+mstride_reg*4] + movh m6, [dst8_reg+mstride_reg*4] + movh m5, [dst2_reg] + movh m7, [dst8_reg] + punpcklbw m1, m6 ; B/J + punpcklbw m5, m7 ; F/N + movh m6, [dst2_reg+ stride_reg] + movh m7, [dst8_reg+ stride_reg] + punpcklbw m6, m7 ; G/O + + ; 8x16 transpose + TRANSPOSE4x4B 0, 1, 2, 3, 7 +%ifdef m8 + SWAP 1, 8 +%else + mova q0backup, m1 +%endif + movh m7, [dst2_reg+ stride_reg*2] + movh m1, [dst8_reg+ stride_reg*2] + punpcklbw m7, m1 ; H/P + TRANSPOSE4x4B 4, 5, 6, 7, 1 + SBUTTERFLY dq, 0, 4, 1 ; p3/p2 + SBUTTERFLY dq, 2, 6, 1 ; q0/q1 + SBUTTERFLY dq, 3, 7, 1 ; q2/q3 +%ifdef m8 + SWAP 1, 8 + SWAP 2, 8 +%else + mova m1, q0backup + mova q0backup, m2 ; store q0 +%endif + SBUTTERFLY dq, 1, 5, 2 ; p1/p0 +%ifdef m12 + SWAP 5, 12 +%else + mova p0backup, m5 ; store p0 +%endif + SWAP 1, 4 + SWAP 2, 4 + SWAP 6, 3 + SWAP 5, 3 +%endif + + ; normal_limit for p3-p2, p2-p1, q3-q2 and q2-q1 + mova m4, m1 + SWAP 4, 1 + psubusb m4, m0 ; p2-p3 + psubusb m0, m1 ; p3-p2 + por m0, m4 ; abs(p3-p2) + + mova m4, m2 + SWAP 4, 2 + psubusb m4, m1 ; p1-p2 + mova p2backup, m1 + psubusb m1, m2 ; p2-p1 + por m1, m4 ; abs(p2-p1) + + mova m4, m6 + SWAP 4, 6 + psubusb m4, m7 ; q2-q3 + psubusb m7, m6 ; q3-q2 + por m7, m4 ; abs(q3-q2) + + mova m4, m5 + SWAP 4, 5 + psubusb m4, m6 ; q1-q2 + mova q2backup, m6 + psubusb m6, m5 ; q2-q1 + por m6, m4 ; abs(q2-q1) + +%ifidn %1, mmx + mova m4, flim_I + pxor m3, m3 + psubusb m0, m4 + psubusb m1, m4 + psubusb m7, m4 + psubusb m6, m4 + pcmpeqb m0, m3 ; abs(p3-p2) <= I + pcmpeqb m1, m3 ; abs(p2-p1) <= I + pcmpeqb m7, m3 ; abs(q3-q2) <= I + pcmpeqb m6, m3 ; abs(q2-q1) <= I + pand m0, m1 + pand m7, m6 + pand m0, m7 +%else ; mmxext/sse2 + pmaxub m0, m1 + pmaxub m6, m7 + pmaxub m0, m6 +%endif + + ; normal_limit and high_edge_variance for p1-p0, q1-q0 + SWAP 7, 3 ; now m7 is zero +%ifidn %2, v + movrow m3, [dst_reg +mstride_reg] ; p0 +%if mmsize == 16 && %4 == 8 + movhps m3, [dst8_reg+mstride_reg] +%endif +%elifdef m12 + SWAP 3, 12 +%else + mova m3, p0backup +%endif + + mova m1, m2 + SWAP 1, 2 + mova m6, m3 + SWAP 3, 6 + psubusb m1, m3 ; p1-p0 + psubusb m6, m2 ; p0-p1 + por m1, m6 ; abs(p1-p0) +%ifidn %1, mmx + mova m6, m1 + psubusb m1, m4 + psubusb m6, hev_thr + pcmpeqb m1, m7 ; abs(p1-p0) <= I + pcmpeqb m6, m7 ; abs(p1-p0) <= hev_thresh + pand m0, m1 + mova mask_res, m6 +%else ; mmxext/sse2 + pmaxub m0, m1 ; max_I + SWAP 1, 4 ; max_hev_thresh +%endif + + SWAP 6, 4 ; now m6 is I +%ifidn %2, v + movrow m4, [dst_reg] ; q0 +%if mmsize == 16 && %4 == 8 + movhps m4, [dst8_reg] +%endif +%elifdef m8 + SWAP 4, 8 +%else + mova m4, q0backup +%endif + mova m1, m4 + SWAP 1, 4 + mova m7, m5 + SWAP 7, 5 + psubusb m1, m5 ; q0-q1 + psubusb m7, m4 ; q1-q0 + por m1, m7 ; abs(q1-q0) +%ifidn %1, mmx + mova m7, m1 + psubusb m1, m6 + psubusb m7, hev_thr + pxor m6, m6 + pcmpeqb m1, m6 ; abs(q1-q0) <= I + pcmpeqb m7, m6 ; abs(q1-q0) <= hev_thresh + mova m6, mask_res + pand m0, m1 ; abs([pq][321]-[pq][210]) <= I + pand m6, m7 +%else ; mmxext/sse2 + pxor m7, m7 + pmaxub m0, m1 + pmaxub m6, m1 + psubusb m0, flim_I + psubusb m6, hev_thr + pcmpeqb m0, m7 ; max(abs(..)) <= I + pcmpeqb m6, m7 ; !(max(abs..) > thresh) +%endif +%ifdef m12 + SWAP 6, 12 +%else + mova mask_res, m6 ; !(abs(p1-p0) > hev_t || abs(q1-q0) > hev_t) +%endif + + ; simple_limit + mova m1, m3 + SWAP 1, 3 + mova m6, m4 ; keep copies of p0/q0 around for later use + SWAP 6, 4 + psubusb m1, m4 ; p0-q0 + psubusb m6, m3 ; q0-p0 + por m1, m6 ; abs(q0-p0) + paddusb m1, m1 ; m1=2*abs(q0-p0) + + mova m7, m2 + SWAP 7, 2 + mova m6, m5 + SWAP 6, 5 + psubusb m7, m5 ; p1-q1 + psubusb m6, m2 ; q1-p1 + por m7, m6 ; abs(q1-p1) + pxor m6, m6 + pand m7, [pb_FE] + psrlq m7, 1 ; abs(q1-p1)/2 + paddusb m7, m1 ; abs(q0-p0)*2+abs(q1-p1)/2 + psubusb m7, flim_E + pcmpeqb m7, m6 ; abs(q0-p0)*2+abs(q1-p1)/2 <= E + pand m0, m7 ; normal_limit result + + ; filter_common; at this point, m2-m5=p1-q1 and m0 is filter_mask +%ifdef m8 ; x86-64 && sse2 + mova m8, [pb_80] +%define pb_80_var m8 +%else ; x86-32 or mmx/mmxext +%define pb_80_var [pb_80] +%endif + mova m1, m4 + mova m7, m3 + pxor m1, pb_80_var + pxor m7, pb_80_var + psubsb m1, m7 ; (signed) q0-p0 + mova m6, m2 + mova m7, m5 + pxor m6, pb_80_var + pxor m7, pb_80_var + psubsb m6, m7 ; (signed) p1-q1 + mova m7, mask_res + paddsb m6, m1 + paddsb m6, m1 + paddsb m6, m1 + pand m6, m0 +%ifdef m8 + mova lim_res, m6 ; 3*(qp-p0)+(p1-q1) masked for filter_mbedge + pand lim_res, m7 +%else + mova m0, m6 + pand m0, m7 + mova lim_res, m0 +%endif + pandn m7, m6 ; 3*(q0-p0)+(p1-q1) masked for filter_common + + mova m1, [pb_F8] + mova m6, m7 + paddsb m7, [pb_3] + paddsb m6, [pb_4] + pand m7, m1 + pand m6, m1 + + pxor m1, m1 + pxor m0, m0 + pcmpgtb m1, m7 + psubb m0, m7 + psrlq m7, 3 ; +f2 + psrlq m0, 3 ; -f2 + pand m0, m1 + pandn m1, m7 + psubusb m3, m0 + paddusb m3, m1 ; p0+f2 + + pxor m1, m1 + pxor m0, m0 + pcmpgtb m0, m6 + psubb m1, m6 + psrlq m6, 3 ; +f1 + psrlq m1, 3 ; -f1 + pand m1, m0 + pandn m0, m6 + psubusb m4, m0 + paddusb m4, m1 ; q0-f1 + + ; filter_mbedge (m2-m5 = p1-q1; lim_res carries w) +%if ssse3_or_higher + mova m7, [pb_1] +%else + mova m7, [pw_63] +%endif +%ifdef m8 + SWAP 1, 8 +%else + mova m1, lim_res +%endif + pxor m0, m0 + mova m6, m1 + pcmpgtb m0, m1 ; which are negative +%if ssse3_or_higher + punpcklbw m6, m7 ; interleave with "1" for rounding + punpckhbw m1, m7 +%else + punpcklbw m6, m0 ; signed byte->word + punpckhbw m1, m0 +%endif + mova lim_sign, m0 +%if ssse3_or_higher + mova m7, [pb_27_63] +%ifndef m8 + mova lim_res, m1 +%endif +%ifdef m10 + SWAP 0, 10 ; don't lose lim_sign copy +%endif + mova m0, m7 + pmaddubsw m7, m6 + SWAP 6, 7 + pmaddubsw m0, m1 + SWAP 1, 0 +%ifdef m10 + SWAP 0, 10 +%else + mova m0, lim_sign +%endif +%else + mova mask_res, m6 ; backup for later in filter + mova lim_res, m1 + pmullw m6, [pw_27] + pmullw m1, [pw_27] + paddw m6, m7 + paddw m1, m7 +%endif + psraw m6, 7 + psraw m1, 7 + packsswb m6, m1 ; a0 + pxor m1, m1 + psubb m1, m6 + pand m1, m0 ; -a0 + pandn m0, m6 ; +a0 +%if ssse3_or_higher + mova m6, [pb_18_63] ; pipelining +%endif + psubusb m3, m1 + paddusb m4, m1 + paddusb m3, m0 ; p0+a0 + psubusb m4, m0 ; q0-a0 + +%if ssse3_or_higher + SWAP 6, 7 +%ifdef m10 + SWAP 1, 10 +%else + mova m1, lim_res +%endif + mova m0, m7 + pmaddubsw m7, m6 + SWAP 6, 7 + pmaddubsw m0, m1 + SWAP 1, 0 +%ifdef m10 + SWAP 0, 10 +%endif + mova m0, lim_sign +%else + mova m6, mask_res + mova m1, lim_res + pmullw m6, [pw_18] + pmullw m1, [pw_18] + paddw m6, m7 + paddw m1, m7 +%endif + mova m0, lim_sign + psraw m6, 7 + psraw m1, 7 + packsswb m6, m1 ; a1 + pxor m1, m1 + psubb m1, m6 + pand m1, m0 ; -a1 + pandn m0, m6 ; +a1 +%if ssse3_or_higher + mova m6, [pb_9_63] +%endif + psubusb m2, m1 + paddusb m5, m1 + paddusb m2, m0 ; p1+a1 + psubusb m5, m0 ; q1-a1 + +%if ssse3_or_higher + SWAP 6, 7 +%ifdef m10 + SWAP 1, 10 +%else + mova m1, lim_res +%endif + mova m0, m7 + pmaddubsw m7, m6 + SWAP 6, 7 + pmaddubsw m0, m1 + SWAP 1, 0 +%else +%ifdef m8 + SWAP 6, 12 + SWAP 1, 8 +%else + mova m6, mask_res + mova m1, lim_res +%endif + pmullw m6, [pw_9] + pmullw m1, [pw_9] + paddw m6, m7 + paddw m1, m7 +%endif +%ifdef m9 + SWAP 7, 9 +%else + mova m7, lim_sign +%endif + psraw m6, 7 + psraw m1, 7 + packsswb m6, m1 ; a1 + pxor m0, m0 + psubb m0, m6 + pand m0, m7 ; -a1 + pandn m7, m6 ; +a1 +%ifdef m8 + SWAP 1, 13 + SWAP 6, 14 +%else + mova m1, p2backup + mova m6, q2backup +%endif + psubusb m1, m0 + paddusb m6, m0 + paddusb m1, m7 ; p1+a1 + psubusb m6, m7 ; q1-a1 + + ; store +%ifidn %2, v + movrow [dst2_reg+mstride_reg*4], m1 + movrow [dst_reg +mstride_reg*2], m2 + movrow [dst_reg +mstride_reg ], m3 + movrow [dst_reg], m4 + movrow [dst2_reg], m5 + movrow [dst2_reg+ stride_reg ], m6 +%if mmsize == 16 && %4 == 8 + add dst8_reg, mstride_reg + movhps [dst8_reg+mstride_reg*2], m1 + movhps [dst8_reg+mstride_reg ], m2 + movhps [dst8_reg], m3 + add dst8_reg, stride_reg + movhps [dst8_reg], m4 + movhps [dst8_reg+ stride_reg ], m5 + movhps [dst8_reg+ stride_reg*2], m6 +%endif +%else ; h + inc dst_reg + inc dst2_reg + + ; 4x8/16 transpose + TRANSPOSE4x4B 1, 2, 3, 4, 0 + SBUTTERFLY bw, 5, 6, 0 + +%if mmsize == 8 ; mmx/mmxext (h) + WRITE_4x2D 1, 2, 3, 4, dst_reg, dst2_reg, mstride_reg, stride_reg + add dst_reg, 4 + WRITE_2x4W m5, m6, dst2_reg, dst_reg, mstride_reg, stride_reg +%else ; sse2 (h) + lea dst8_reg, [dst8_reg+mstride_reg+1] + WRITE_4x4D 1, 2, 3, 4, dst_reg, dst2_reg, dst8_reg, mstride_reg, stride_reg, %4 + lea dst_reg, [dst2_reg+mstride_reg+4] + lea dst8_reg, [dst8_reg+mstride_reg+4] +%ifidn %1, sse4 + add dst2_reg, 4 +%endif + WRITE_8W m5, dst2_reg, dst_reg, mstride_reg, stride_reg +%ifidn %1, sse4 + lea dst2_reg, [dst8_reg+ stride_reg] +%endif + WRITE_8W m6, dst2_reg, dst8_reg, mstride_reg, stride_reg +%endif +%endif + +%if mmsize == 8 +%if %4 == 8 ; chroma +%ifidn %2, h + sub dst_reg, 5 +%endif + cmp dst_reg, dst8_reg + mov dst_reg, dst8_reg + jnz .next8px +%else +%ifidn %2, h + lea dst_reg, [dst_reg + stride_reg*8-5] +%else ; v + add dst_reg, 8 +%endif + dec cnt_reg + jg .next8px +%endif +%endif + +%ifndef m8 ; sse2 on x86-32 or mmx/mmxext + mov rsp, stack_reg ; restore stack pointer +%endif + RET +%endmacro + +INIT_MMX +%define SPLATB_REG SPLATB_REG_MMX +MBEDGE_LOOPFILTER mmx, v, 6, 16, 0 +MBEDGE_LOOPFILTER mmx, h, 6, 16, 0 +MBEDGE_LOOPFILTER mmx, v, 6, 8, 0 +MBEDGE_LOOPFILTER mmx, h, 6, 8, 0 + +%define SPLATB_REG SPLATB_REG_MMXEXT +MBEDGE_LOOPFILTER mmxext, v, 6, 16, 0 +MBEDGE_LOOPFILTER mmxext, h, 6, 16, 0 +MBEDGE_LOOPFILTER mmxext, v, 6, 8, 0 +MBEDGE_LOOPFILTER mmxext, h, 6, 8, 0 + +INIT_XMM +%define SPLATB_REG SPLATB_REG_SSE2 +%define WRITE_8W WRITE_8W_SSE2 +MBEDGE_LOOPFILTER sse2, v, 5, 16, 15 +%ifdef m8 +MBEDGE_LOOPFILTER sse2, h, 5, 16, 15 +%else +MBEDGE_LOOPFILTER sse2, h, 6, 16, 15 +%endif +MBEDGE_LOOPFILTER sse2, v, 6, 8, 15 +MBEDGE_LOOPFILTER sse2, h, 6, 8, 15 + +%define SPLATB_REG SPLATB_REG_SSSE3 +MBEDGE_LOOPFILTER ssse3, v, 5, 16, 15 +%ifdef m8 +MBEDGE_LOOPFILTER ssse3, h, 5, 16, 15 +%else +MBEDGE_LOOPFILTER ssse3, h, 6, 16, 15 +%endif +MBEDGE_LOOPFILTER ssse3, v, 6, 8, 15 +MBEDGE_LOOPFILTER ssse3, h, 6, 8, 15 + +%define WRITE_8W WRITE_8W_SSE4 +%ifdef m8 +MBEDGE_LOOPFILTER sse4, h, 5, 16, 15 +%else +MBEDGE_LOOPFILTER sse4, h, 6, 16, 15 +%endif +MBEDGE_LOOPFILTER sse4, h, 6, 8, 15 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/yop.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/yop.c new file mode 100644 index 00000000..6a75e74b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/yop.c @@ -0,0 +1,261 @@ +/** + * @file + * Psygnosis YOP decoder + * + * Copyright (C) 2010 Mohamed Naufal Basheer + * derived from the code by + * Copyright (C) 2009 Thomas P. Higdon + * + * 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 + */ + +#include "libavutil/intreadwrite.h" +#include "libavcore/imgutils.h" + +#include "avcodec.h" +#include "get_bits.h" + +typedef struct YopDecContext { + AVFrame frame; + AVCodecContext *avctx; + + int num_pal_colors; + int first_color[2]; + int frame_data_length; + int row_pos; + + uint8_t *low_nibble; + uint8_t *srcptr; + uint8_t *dstptr; + uint8_t *dstbuf; +} YopDecContext; + +// These tables are taken directly from: +// http://wiki.multimedia.cx/index.php?title=Psygnosis_YOP + +/** + * Lookup table for painting macroblocks. Bytes 0-2 of each entry contain + * the macroblock positions to be painted (taken as (0, B0, B1, B2)). + * Byte 3 contains the number of bytes consumed on the input, + * equal to max(bytes 0-2) + 1. + */ +static const uint8_t paint_lut[15][4] = + {{1, 2, 3, 4}, {1, 2, 0, 3}, + {1, 2, 1, 3}, {1, 2, 2, 3}, + {1, 0, 2, 3}, {1, 0, 0, 2}, + {1, 0, 1, 2}, {1, 1, 2, 3}, + {0, 1, 2, 3}, {0, 1, 0, 2}, + {1, 1, 0, 2}, {0, 1, 1, 2}, + {0, 0, 1, 2}, {0, 0, 0, 1}, + {1, 1, 1, 2}, + }; + +/** + * Lookup table for copying macroblocks. Each entry contains the respective + * x and y pixel offset for the copy source. + */ +static const int8_t motion_vector[16][2] = + {{-4, -4}, {-2, -4}, + { 0, -4}, { 2, -4}, + {-4, -2}, {-4, 0}, + {-3, -3}, {-1, -3}, + { 1, -3}, { 3, -3}, + {-3, -1}, {-2, -2}, + { 0, -2}, { 2, -2}, + { 4, -2}, {-2, 0}, + }; + +static av_cold int yop_decode_init(AVCodecContext *avctx) +{ + YopDecContext *s = avctx->priv_data; + s->avctx = avctx; + + if (avctx->width & 1 || avctx->height & 1 || + av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0) { + av_log(avctx, AV_LOG_ERROR, "YOP has invalid dimensions\n"); + return -1; + } + + avctx->pix_fmt = PIX_FMT_PAL8; + + s->num_pal_colors = avctx->extradata[0]; + s->first_color[0] = avctx->extradata[1]; + s->first_color[1] = avctx->extradata[2]; + + if (s->num_pal_colors + s->first_color[0] > 256 || + s->num_pal_colors + s->first_color[1] > 256) { + av_log(avctx, AV_LOG_ERROR, + "YOP: palette parameters invalid, header probably corrupt\n"); + return AVERROR_INVALIDDATA; + } + + return 0; +} + +static av_cold int yop_decode_close(AVCodecContext *avctx) +{ + YopDecContext *s = avctx->priv_data; + if (s->frame.data[0]) + avctx->release_buffer(avctx, &s->frame); + return 0; +} + +/** + * Paint a macroblock using the pattern in paint_lut. + * @param s codec context + * @param tag the tag that was in the nibble + */ +static void yop_paint_block(YopDecContext *s, int tag) +{ + s->dstptr[0] = s->srcptr[0]; + s->dstptr[1] = s->srcptr[paint_lut[tag][0]]; + s->dstptr[s->frame.linesize[0]] = s->srcptr[paint_lut[tag][1]]; + s->dstptr[s->frame.linesize[0] + 1] = s->srcptr[paint_lut[tag][2]]; + + // The number of src bytes consumed is in the last part of the lut entry. + s->srcptr += paint_lut[tag][3]; +} + +/** + * Copy a previously painted macroblock to the current_block. + * @param copy_tag the tag that was in the nibble + */ +static int yop_copy_previous_block(YopDecContext *s, int copy_tag) +{ + uint8_t *bufptr; + + // Calculate position for the copy source + bufptr = s->dstptr + motion_vector[copy_tag][0] + + s->frame.linesize[0] * motion_vector[copy_tag][1]; + if (bufptr < s->dstbuf) { + av_log(s->avctx, AV_LOG_ERROR, + "YOP: cannot decode, file probably corrupt\n"); + return AVERROR_INVALIDDATA; + } + + s->dstptr[0] = bufptr[0]; + s->dstptr[1] = bufptr[1]; + s->dstptr[s->frame.linesize[0]] = bufptr[s->frame.linesize[0]]; + s->dstptr[s->frame.linesize[0] + 1] = bufptr[s->frame.linesize[0] + 1]; + + return 0; +} + +/** + * Return the next nibble in sequence, consuming a new byte on the input + * only if necessary. + */ +static uint8_t yop_get_next_nibble(YopDecContext *s) +{ + int ret; + + if (s->low_nibble) { + ret = *s->low_nibble & 0xf; + s->low_nibble = NULL; + }else { + s->low_nibble = s->srcptr++; + ret = *s->low_nibble >> 4; + } + return ret; +} + +/** + * Take s->dstptr to the next macroblock in sequence. + */ +static void yop_next_macroblock(YopDecContext *s) +{ + // If we are advancing to the next row of macroblocks + if (s->row_pos == s->frame.linesize[0] - 2) { + s->dstptr += s->frame.linesize[0]; + s->row_pos = 0; + }else { + s->row_pos += 2; + } + s->dstptr += 2; +} + +static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size, + AVPacket *avpkt) +{ + YopDecContext *s = avctx->priv_data; + int tag, firstcolor, is_odd_frame; + int ret, i; + uint32_t *palette; + + if (s->frame.data[0]) + avctx->release_buffer(avctx, &s->frame); + + ret = avctx->get_buffer(avctx, &s->frame); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return ret; + } + + s->frame.linesize[0] = avctx->width; + + s->dstbuf = s->frame.data[0]; + s->dstptr = s->frame.data[0]; + s->srcptr = avpkt->data + 4; + s->row_pos = 0; + s->low_nibble = NULL; + + is_odd_frame = avpkt->data[0]; + firstcolor = s->first_color[is_odd_frame]; + palette = (uint32_t *)s->frame.data[1]; + + for (i = 0; i < s->num_pal_colors; i++, s->srcptr += 3) + palette[i + firstcolor] = (s->srcptr[0] << 18) | + (s->srcptr[1] << 10) | + (s->srcptr[2] << 2); + + s->frame.palette_has_changed = 1; + + while (s->dstptr - s->dstbuf < + avctx->width * avctx->height && + s->srcptr - avpkt->data < avpkt->size) { + + tag = yop_get_next_nibble(s); + + if (tag != 0xf) { + yop_paint_block(s, tag); + }else { + tag = yop_get_next_nibble(s); + ret = yop_copy_previous_block(s, tag); + if (ret < 0) { + avctx->release_buffer(avctx, &s->frame); + return ret; + } + } + yop_next_macroblock(s); + } + + *data_size = sizeof(AVFrame); + *(AVFrame *) data = s->frame; + return avpkt->size; +} + +AVCodec ff_yop_decoder = { + "yop", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_YOP, + sizeof(YopDecContext), + yop_decode_init, + NULL, + yop_decode_close, + yop_decode_frame, + .long_name = NULL_IF_CONFIG_SMALL("Psygnosis YOP Video"), +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/Makefile new file mode 100644 index 00000000..f2e82970 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/Makefile @@ -0,0 +1,20 @@ +include $(SUBDIR)../config.mak + +NAME = avcore +FFLIBS = avutil + +HEADERS = \ + audioconvert.h \ + avcore.h \ + imgutils.h \ + parseutils.h \ + samplefmt.h \ + +OBJS = \ + audioconvert.o \ + imgutils.o \ + parseutils.o \ + samplefmt.o \ + utils.o \ + +include $(SUBDIR)../subdir.mak diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/audioconvert.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/audioconvert.c new file mode 100644 index 00000000..c7207338 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/audioconvert.c @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2006 Michael Niedermayer + * + * 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 + * audio conversion routines + */ + +#include "libavutil/avstring.h" +#include "audioconvert.h" + +static const char * const channel_names[] = { + "FL", "FR", "FC", "LFE", "BL", "BR", "FLC", "FRC", + "BC", "SL", "SR", "TC", "TFL", "TFC", "TFR", "TBL", + "TBC", "TBR", + [29] = "DL", + [30] = "DR", +}; + +static const char *get_channel_name(int channel_id) +{ + if (channel_id < 0 || channel_id >= FF_ARRAY_ELEMS(channel_names)) + return NULL; + return channel_names[channel_id]; +} + +static const struct { + const char *name; + int nb_channels; + int64_t layout; +} channel_layout_map[] = { + { "mono", 1, AV_CH_LAYOUT_MONO }, + { "stereo", 2, AV_CH_LAYOUT_STEREO }, + { "4.0", 4, AV_CH_LAYOUT_4POINT0 }, + { "quad", 4, AV_CH_LAYOUT_QUAD }, + { "5.0", 5, AV_CH_LAYOUT_5POINT0 }, + { "5.0", 5, AV_CH_LAYOUT_5POINT0_BACK }, + { "5.1", 6, AV_CH_LAYOUT_5POINT1 }, + { "5.1", 6, AV_CH_LAYOUT_5POINT1_BACK }, + { "5.1+downmix", 8, AV_CH_LAYOUT_5POINT1|AV_CH_LAYOUT_STEREO_DOWNMIX, }, + { "7.1", 8, AV_CH_LAYOUT_7POINT1 }, + { "7.1(wide)", 8, AV_CH_LAYOUT_7POINT1_WIDE }, + { "7.1+downmix", 10, AV_CH_LAYOUT_7POINT1|AV_CH_LAYOUT_STEREO_DOWNMIX, }, + { 0 } +}; + +int64_t av_get_channel_layout(const char *name) +{ + int i = 0; + do { + if (!strcmp(channel_layout_map[i].name, name)) + return channel_layout_map[i].layout; + i++; + } while (channel_layout_map[i].name); + + return 0; +} + +void av_get_channel_layout_string(char *buf, int buf_size, + int nb_channels, int64_t channel_layout) +{ + int i; + + if (nb_channels <= 0) + nb_channels = av_get_channel_layout_nb_channels(channel_layout); + + for (i = 0; channel_layout_map[i].name; i++) + if (nb_channels == channel_layout_map[i].nb_channels && + channel_layout == channel_layout_map[i].layout) { + av_strlcpy(buf, channel_layout_map[i].name, buf_size); + return; + } + + snprintf(buf, buf_size, "%d channels", nb_channels); + if (channel_layout) { + int i,ch; + av_strlcat(buf, " (", buf_size); + for(i=0,ch=0; i<64; i++) { + if ((channel_layout & (1L<0) av_strlcat(buf, "|", buf_size); + av_strlcat(buf, name, buf_size); + } + ch++; + } + } + av_strlcat(buf, ")", buf_size); + } +} + +int av_get_channel_layout_nb_channels(int64_t channel_layout) +{ + int count; + uint64_t x = channel_layout; + for (count = 0; x; count++) + x &= x-1; // unset lowest set bit + return count; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/audioconvert.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/audioconvert.h new file mode 100644 index 00000000..89e9c55d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/audioconvert.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2006 Michael Niedermayer + * Copyright (c) 2008 Peter Ross + * + * 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 + */ + +#ifndef AVCORE_AUDIOCONVERT_H +#define AVCORE_AUDIOCONVERT_H + +/** + * @file + * audio conversion routines + */ + +#include "avcore.h" + +/* Audio channel masks */ +#define AV_CH_FRONT_LEFT 0x00000001 +#define AV_CH_FRONT_RIGHT 0x00000002 +#define AV_CH_FRONT_CENTER 0x00000004 +#define AV_CH_LOW_FREQUENCY 0x00000008 +#define AV_CH_BACK_LEFT 0x00000010 +#define AV_CH_BACK_RIGHT 0x00000020 +#define AV_CH_FRONT_LEFT_OF_CENTER 0x00000040 +#define AV_CH_FRONT_RIGHT_OF_CENTER 0x00000080 +#define AV_CH_BACK_CENTER 0x00000100 +#define AV_CH_SIDE_LEFT 0x00000200 +#define AV_CH_SIDE_RIGHT 0x00000400 +#define AV_CH_TOP_CENTER 0x00000800 +#define AV_CH_TOP_FRONT_LEFT 0x00001000 +#define AV_CH_TOP_FRONT_CENTER 0x00002000 +#define AV_CH_TOP_FRONT_RIGHT 0x00004000 +#define AV_CH_TOP_BACK_LEFT 0x00008000 +#define AV_CH_TOP_BACK_CENTER 0x00010000 +#define AV_CH_TOP_BACK_RIGHT 0x00020000 +#define AV_CH_STEREO_LEFT 0x20000000 ///< Stereo downmix. +#define AV_CH_STEREO_RIGHT 0x40000000 ///< See AV_CH_STEREO_LEFT. + +/** Channel mask value used for AVCodecContext.request_channel_layout + to indicate that the user requests the channel order of the decoder output + to be the native codec channel order. */ +#define AV_CH_LAYOUT_NATIVE 0x8000000000000000LL + +/* Audio channel convenience macros */ +#define AV_CH_LAYOUT_MONO (AV_CH_FRONT_CENTER) +#define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT) +#define AV_CH_LAYOUT_2_1 (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER) +#define AV_CH_LAYOUT_SURROUND (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER) +#define AV_CH_LAYOUT_4POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER) +#define AV_CH_LAYOUT_2_2 (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT) +#define AV_CH_LAYOUT_QUAD (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_5POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT) +#define AV_CH_LAYOUT_5POINT1 (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY) +#define AV_CH_LAYOUT_5POINT0_BACK (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_5POINT1_BACK (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY) +#define AV_CH_LAYOUT_7POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) +#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT) + +/** + * Return a channel layout id that matches name, 0 if no match. + */ +int64_t av_get_channel_layout(const char *name); + +/** + * Return a description of a channel layout. + * If nb_channels is <= 0, it is guessed from the channel_layout. + * + * @param buf put here the string containing the channel layout + * @param buf_size size in bytes of the buffer + */ +void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout); + +/** + * Return the number of channels in the channel layout. + */ +int av_get_channel_layout_nb_channels(int64_t channel_layout); + +#endif /* AVCORE_AUDIOCONVERT_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/avcore.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/avcore.h new file mode 100644 index 00000000..9b02c3b5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/avcore.h @@ -0,0 +1,70 @@ +/* + * 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 + */ + +#ifndef AVCORE_AVCORE_H +#define AVCORE_AVCORE_H + +/** + * @file + * shared media utilities for the libav* libraries + */ + +#include "libavutil/avutil.h" + +#define LIBAVCORE_VERSION_MAJOR 0 +#define LIBAVCORE_VERSION_MINOR 16 +#define LIBAVCORE_VERSION_MICRO 1 + +#define LIBAVCORE_VERSION_INT AV_VERSION_INT(LIBAVCORE_VERSION_MAJOR, \ + LIBAVCORE_VERSION_MINOR, \ + LIBAVCORE_VERSION_MICRO) +#define LIBAVCORE_VERSION AV_VERSION(LIBAVCORE_VERSION_MAJOR, \ + LIBAVCORE_VERSION_MINOR, \ + LIBAVCORE_VERSION_MICRO) +#define LIBAVCORE_BUILD LIBAVCORE_VERSION_INT + +#define LIBAVCORE_IDENT "Lavcore" AV_STRINGIFY(LIBAVCORE_VERSION) + +/** + * Return the LIBAVCORE_VERSION_INT constant. + */ +unsigned avcore_version(void); + +/** + * Return the libavcore build-time configuration. + */ +const char *avcore_configuration(void); + +/** + * Return the libavcore license. + */ +const char *avcore_license(void); + +#define AV_NOPTS_VALUE INT64_C(0x8000000000000000) +#define AV_TIME_BASE 1000000 +#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} + +/** + * Those FF_API_* defines are not part of public API. + * They may change, break or disappear at any time. + */ +#ifndef FF_API_OLD_IMAGE_NAMES +#define FF_API_OLD_IMAGE_NAMES (LIBAVCORE_VERSION_MAJOR < 1) +#endif + +#endif /* AVCORE_AVCORE_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/imgutils.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/imgutils.c new file mode 100644 index 00000000..0f449ff4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/imgutils.c @@ -0,0 +1,297 @@ +/* + * 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 + * misc image utilities + */ + +#include "imgutils.h" +#include "internal.h" +#include "libavutil/pixdesc.h" + +void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], + const AVPixFmtDescriptor *pixdesc) +{ + int i; + memset(max_pixsteps, 0, 4*sizeof(max_pixsteps[0])); + if (max_pixstep_comps) + memset(max_pixstep_comps, 0, 4*sizeof(max_pixstep_comps[0])); + + for (i = 0; i < 4; i++) { + const AVComponentDescriptor *comp = &(pixdesc->comp[i]); + if ((comp->step_minus1+1) > max_pixsteps[comp->plane]) { + max_pixsteps[comp->plane] = comp->step_minus1+1; + if (max_pixstep_comps) + max_pixstep_comps[comp->plane] = i; + } + } +} + +int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane) +{ + const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; + int max_step [4]; /* max pixel step for each plane */ + int max_step_comp[4]; /* the component for each plane which has the max pixel step */ + int s; + + if (desc->flags & PIX_FMT_BITSTREAM) + return (width * (desc->comp[0].step_minus1+1) + 7) >> 3; + + av_image_fill_max_pixsteps(max_step, max_step_comp, desc); + s = (max_step_comp[plane] == 1 || max_step_comp[plane] == 2) ? desc->log2_chroma_w : 0; + return max_step[plane] * (((width + (1 << s) - 1)) >> s); +} + +int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width) +{ + int i; + const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; + int max_step [4]; /* max pixel step for each plane */ + int max_step_comp[4]; /* the component for each plane which has the max pixel step */ + + memset(linesizes, 0, 4*sizeof(linesizes[0])); + + if ((unsigned)pix_fmt >= PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL) + return AVERROR(EINVAL); + + if (desc->flags & PIX_FMT_BITSTREAM) { + if (width > (INT_MAX -7) / (desc->comp[0].step_minus1+1)) + return AVERROR(EINVAL); + linesizes[0] = (width * (desc->comp[0].step_minus1+1) + 7) >> 3; + return 0; + } + + av_image_fill_max_pixsteps(max_step, max_step_comp, desc); + for (i = 0; i < 4; i++) { + int s = (max_step_comp[i] == 1 || max_step_comp[i] == 2) ? desc->log2_chroma_w : 0; + int shifted_w = ((width + (1 << s) - 1)) >> s; + if (max_step[i] > INT_MAX / shifted_w) + return AVERROR(EINVAL); + linesizes[i] = max_step[i] * shifted_w; + } + + return 0; +} + +int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height, + uint8_t *ptr, const int linesizes[4]) +{ + int i, total_size, size[4], has_plane[4]; + + const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; + memset(data , 0, sizeof(data[0])*4); + memset(size , 0, sizeof(size)); + memset(has_plane, 0, sizeof(has_plane)); + + if ((unsigned)pix_fmt >= PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL) + return AVERROR(EINVAL); + + data[0] = ptr; + if (linesizes[0] > (INT_MAX - 1024) / height) + return AVERROR(EINVAL); + size[0] = linesizes[0] * height; + + if (desc->flags & PIX_FMT_PAL) { + size[0] = (size[0] + 3) & ~3; + data[1] = ptr + size[0]; /* palette is stored here as 256 32 bits words */ + return size[0] + 256 * 4; + } + + for (i = 0; i < 4; i++) + has_plane[desc->comp[i].plane] = 1; + + total_size = size[0]; + for (i = 1; has_plane[i] && i < 4; i++) { + int h, s = (i == 1 || i == 2) ? desc->log2_chroma_h : 0; + data[i] = data[i-1] + size[i-1]; + h = (height + (1 << s) - 1) >> s; + if (linesizes[i] > INT_MAX / h) + return AVERROR(EINVAL); + size[i] = h * linesizes[i]; + if (total_size > INT_MAX - size[i]) + return AVERROR(EINVAL); + total_size += size[i]; + } + + return total_size; +} + +int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt) +{ + int i; + + for (i = 0; i < 256; i++) { + int r, g, b; + + switch (pix_fmt) { + case PIX_FMT_RGB8: + r = (i>>5 )*36; + g = ((i>>2)&7)*36; + b = (i&3 )*85; + break; + case PIX_FMT_BGR8: + b = (i>>6 )*85; + g = ((i>>3)&7)*36; + r = (i&7 )*36; + break; + case PIX_FMT_RGB4_BYTE: + r = (i>>3 )*255; + g = ((i>>1)&3)*85; + b = (i&1 )*255; + break; + case PIX_FMT_BGR4_BYTE: + b = (i>>3 )*255; + g = ((i>>1)&3)*85; + r = (i&1 )*255; + break; + case PIX_FMT_GRAY8: + r = b = g = i; + break; + default: + return AVERROR(EINVAL); + } + pal[i] = b + (g<<8) + (r<<16); + } + + return 0; +} + +int av_image_alloc(uint8_t *pointers[4], int linesizes[4], + int w, int h, enum PixelFormat pix_fmt, int align) +{ + int i, ret; + uint8_t *buf; + + if ((ret = av_image_check_size(w, h, 0, NULL)) < 0) + return ret; + if ((ret = av_image_fill_linesizes(linesizes, pix_fmt, w)) < 0) + return ret; + + for (i = 0; i < 4; i++) + linesizes[i] = FFALIGN(linesizes[i], align); + + if ((ret = av_image_fill_pointers(pointers, pix_fmt, h, NULL, linesizes)) < 0) + return ret; + buf = av_malloc(ret + align); + if (!buf) + return AVERROR(ENOMEM); + if ((ret = av_image_fill_pointers(pointers, pix_fmt, h, buf, linesizes)) < 0) { + av_free(buf); + return ret; + } + if (av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_PAL) + ff_set_systematic_pal2((uint32_t*)pointers[1], pix_fmt); + + return ret; +} + +typedef struct ImgUtils { + const AVClass *class; + int log_offset; + void *log_ctx; +} ImgUtils; + +static const AVClass imgutils_class = { "IMGUTILS", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, offsetof(ImgUtils, log_offset), offsetof(ImgUtils, log_ctx) }; + +int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx) +{ + ImgUtils imgutils = { &imgutils_class, log_offset, log_ctx }; + + if ((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8) + return 0; + + av_log(&imgutils, AV_LOG_ERROR, "Picture size %ux%u is invalid\n", w, h); + return AVERROR(EINVAL); +} + +void av_image_copy_plane(uint8_t *dst, int dst_linesize, + const uint8_t *src, int src_linesize, + int bytewidth, int height) +{ + if (!dst || !src) + return; + for (;height > 0; height--) { + memcpy(dst, src, bytewidth); + dst += dst_linesize; + src += src_linesize; + } +} + +void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], + const uint8_t *src_data[4], const int src_linesizes[4], + enum PixelFormat pix_fmt, int width, int height) +{ + const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; + + if (desc->flags & PIX_FMT_HWACCEL) + return; + + if (desc->flags & PIX_FMT_PAL) { + av_image_copy_plane(dst_data[0], dst_linesizes[0], + src_data[0], src_linesizes[0], + width, height); + /* copy the palette */ + memcpy(dst_data[1], src_data[1], 4*256); + } else { + int i, planes_nb = 0; + + for (i = 0; i < desc->nb_components; i++) + planes_nb = FFMAX(planes_nb, desc->comp[i].plane + 1); + + for (i = 0; i < planes_nb; i++) { + int h = height; + int bwidth = av_image_get_linesize(pix_fmt, width, i); + if (i == 1 || i == 2) { + h= -((-height)>>desc->log2_chroma_h); + } + av_image_copy_plane(dst_data[i], dst_linesizes[i], + src_data[i], src_linesizes[i], + bwidth, h); + } + } +} + +#if FF_API_OLD_IMAGE_NAMES +void av_fill_image_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], + const AVPixFmtDescriptor *pixdesc) +{ + av_image_fill_max_pixsteps(max_pixsteps, max_pixstep_comps, pixdesc); +} + +int av_get_image_linesize(enum PixelFormat pix_fmt, int width, int plane) +{ + return av_image_get_linesize(pix_fmt, width, plane); +} + +int av_fill_image_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width) +{ + return av_image_fill_linesizes(linesizes, pix_fmt, width); +} + +int av_fill_image_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height, + uint8_t *ptr, const int linesizes[4]) +{ + return av_image_fill_pointers(data, pix_fmt, height, ptr, linesizes); +} + +int av_check_image_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx) +{ + return av_image_check_size(w, h, log_offset, log_ctx); +} +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/imgutils.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/imgutils.h new file mode 100644 index 00000000..6c39d531 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/imgutils.h @@ -0,0 +1,147 @@ +/* + * 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 + */ + +#ifndef AVCORE_IMGUTILS_H +#define AVCORE_IMGUTILS_H + +/** + * @file + * misc image utilities + */ + +#include "libavutil/pixdesc.h" +#include "avcore.h" + +/** + * Compute the max pixel step for each plane of an image with a + * format described by pixdesc. + * + * The pixel step is the distance in bytes between the first byte of + * the group of bytes which describe a pixel component and the first + * byte of the successive group in the same plane for the same + * component. + * + * @param max_pixsteps an array which is filled with the max pixel step + * for each plane. Since a plane may contain different pixel + * components, the computed max_pixsteps[plane] is relative to the + * component in the plane with the max pixel step. + * @param max_pixstep_comps an array which is filled with the component + * for each plane which has the max pixel step. May be NULL. + */ +void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], + const AVPixFmtDescriptor *pixdesc); + +/** + * Compute the size of an image line with format pix_fmt and width + * width for the plane plane. + * + * @return the computed size in bytes + */ +int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane); + +/** + * Fill plane linesizes for an image with pixel format pix_fmt and + * width width. + * + * @param linesizes array to be filled with the linesize for each plane + * @return >= 0 in case of success, a negative error code otherwise + */ +int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width); + +/** + * Fill plane data pointers for an image with pixel format pix_fmt and + * height height. + * + * @param data pointers array to be filled with the pointer for each image plane + * @param ptr the pointer to a buffer which will contain the image + * @param linesizes[4] the array containing the linesize for each + * plane, should be filled by av_image_fill_linesizes() + * @return the size in bytes required for the image buffer, a negative + * error code in case of failure + */ +int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height, + uint8_t *ptr, const int linesizes[4]); + +/** + * Allocate an image with size w and h and pixel format pix_fmt, and + * fill pointers and linesizes accordingly. + * The allocated image buffer has to be freed by using + * av_freep(&pointers[0]). + * + * @param align the value to use for buffer size alignment + * @return the size in bytes required for the image buffer, a negative + * error code in case of failure + */ +int av_image_alloc(uint8_t *pointers[4], int linesizes[4], + int w, int h, enum PixelFormat pix_fmt, int align); + +/** + * Copy image plane from src to dst. + * That is, copy "height" number of lines of "bytewidth" bytes each. + * The first byte of each successive line is separated by *_linesize + * bytes. + * + * @param dst_linesize linesize for the image plane in dst + * @param src_linesize linesize for the image plane in src + */ +void av_image_copy_plane(uint8_t *dst, int dst_linesize, + const uint8_t *src, int src_linesize, + int bytewidth, int height); + +/** + * Copy image in src_data to dst_data. + * + * @param dst_linesize linesizes for the image in dst_data + * @param src_linesize linesizes for the image in src_data + */ +void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], + const uint8_t *src_data[4], const int src_linesizes[4], + enum PixelFormat pix_fmt, int width, int height); + +/** + * Check if the given dimension of an image is valid, meaning that all + * bytes of the image can be addressed with a signed int. + * + * @param w the width of the picture + * @param h the height of the picture + * @param log_offset the offset to sum to the log level for logging with log_ctx + * @param log_ctx the parent logging context, it may be NULL + * @return >= 0 if valid, a negative error code otherwise + */ +int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx); + +#if FF_API_OLD_IMAGE_NAMES +attribute_deprecated +void av_fill_image_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], + const AVPixFmtDescriptor *pixdesc); + +attribute_deprecated +int av_get_image_linesize(enum PixelFormat pix_fmt, int width, int plane); + +attribute_deprecated +int av_fill_image_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width); + +attribute_deprecated +int av_fill_image_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height, + uint8_t *ptr, const int linesizes[4]); + +attribute_deprecated +int av_check_image_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx); +#endif + +#endif /* AVCORE_IMGUTILS_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/internal.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/internal.h new file mode 100644 index 00000000..3960bd39 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/internal.h @@ -0,0 +1,31 @@ +/* + * 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 + */ + +#ifndef AVCORE_INTERNAL_H +#define AVCORE_INTERNAL_H + +/** + * @file + * internal functions + */ + +#include "avcore.h" + +int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt); + +#endif /* AVCORE_INTERNAL_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/parseutils.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/parseutils.c new file mode 100644 index 00000000..abf0422f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/parseutils.c @@ -0,0 +1,474 @@ +/* + * 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 + * misc parsing utilities for libavcore + */ + +#include +#include "parseutils.h" +#include "libavutil/avutil.h" +#include "libavutil/eval.h" +#include "libavutil/avstring.h" +#include "libavutil/random_seed.h" + +typedef struct { + const char *abbr; + int width, height; +} VideoSizeAbbr; + +typedef struct { + const char *abbr; + AVRational rate; +} VideoRateAbbr; + +static const VideoSizeAbbr video_size_abbrs[] = { + { "ntsc", 720, 480 }, + { "pal", 720, 576 }, + { "qntsc", 352, 240 }, /* VCD compliant NTSC */ + { "qpal", 352, 288 }, /* VCD compliant PAL */ + { "sntsc", 640, 480 }, /* square pixel NTSC */ + { "spal", 768, 576 }, /* square pixel PAL */ + { "film", 352, 240 }, + { "ntsc-film", 352, 240 }, + { "sqcif", 128, 96 }, + { "qcif", 176, 144 }, + { "cif", 352, 288 }, + { "4cif", 704, 576 }, + { "16cif", 1408,1152 }, + { "qqvga", 160, 120 }, + { "qvga", 320, 240 }, + { "vga", 640, 480 }, + { "svga", 800, 600 }, + { "xga", 1024, 768 }, + { "uxga", 1600,1200 }, + { "qxga", 2048,1536 }, + { "sxga", 1280,1024 }, + { "qsxga", 2560,2048 }, + { "hsxga", 5120,4096 }, + { "wvga", 852, 480 }, + { "wxga", 1366, 768 }, + { "wsxga", 1600,1024 }, + { "wuxga", 1920,1200 }, + { "woxga", 2560,1600 }, + { "wqsxga", 3200,2048 }, + { "wquxga", 3840,2400 }, + { "whsxga", 6400,4096 }, + { "whuxga", 7680,4800 }, + { "cga", 320, 200 }, + { "ega", 640, 350 }, + { "hd480", 852, 480 }, + { "hd720", 1280, 720 }, + { "hd1080", 1920,1080 }, +}; + +static const VideoRateAbbr video_rate_abbrs[]= { + { "ntsc", { 30000, 1001 } }, + { "pal", { 25, 1 } }, + { "qntsc", { 30000, 1001 } }, /* VCD compliant NTSC */ + { "qpal", { 25, 1 } }, /* VCD compliant PAL */ + { "sntsc", { 30000, 1001 } }, /* square pixel NTSC */ + { "spal", { 25, 1 } }, /* square pixel PAL */ + { "film", { 24, 1 } }, + { "ntsc-film", { 24000, 1001 } }, +}; + +int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str) +{ + int i; + int n = FF_ARRAY_ELEMS(video_size_abbrs); + char *p; + int width = 0, height = 0; + + for (i = 0; i < n; i++) { + if (!strcmp(video_size_abbrs[i].abbr, str)) { + width = video_size_abbrs[i].width; + height = video_size_abbrs[i].height; + break; + } + } + if (i == n) { + p = str; + width = strtol(p, &p, 10); + if (*p) + p++; + height = strtol(p, &p, 10); + } + if (width <= 0 || height <= 0) + return AVERROR(EINVAL); + *width_ptr = width; + *height_ptr = height; + return 0; +} + +int av_parse_video_rate(AVRational *rate, const char *arg) +{ + int i, ret; + int n = FF_ARRAY_ELEMS(video_rate_abbrs); + double res; + + /* First, we check our abbreviation table */ + for (i = 0; i < n; ++i) + if (!strcmp(video_rate_abbrs[i].abbr, arg)) { + *rate = video_rate_abbrs[i].rate; + return 0; + } + + /* Then, we try to parse it as fraction */ + if ((ret = av_expr_parse_and_eval(&res, arg, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, 0, NULL)) < 0) + return ret; + *rate = av_d2q(res, 1001000); + if (rate->num <= 0 || rate->den <= 0) + return AVERROR(EINVAL); + return 0; +} + +typedef struct { + const char *name; ///< a string representing the name of the color + uint8_t rgb_color[3]; ///< RGB values for the color +} ColorEntry; + +static ColorEntry color_table[] = { + { "AliceBlue", { 0xF0, 0xF8, 0xFF } }, + { "AntiqueWhite", { 0xFA, 0xEB, 0xD7 } }, + { "Aqua", { 0x00, 0xFF, 0xFF } }, + { "Aquamarine", { 0x7F, 0xFF, 0xD4 } }, + { "Azure", { 0xF0, 0xFF, 0xFF } }, + { "Beige", { 0xF5, 0xF5, 0xDC } }, + { "Bisque", { 0xFF, 0xE4, 0xC4 } }, + { "Black", { 0x00, 0x00, 0x00 } }, + { "BlanchedAlmond", { 0xFF, 0xEB, 0xCD } }, + { "Blue", { 0x00, 0x00, 0xFF } }, + { "BlueViolet", { 0x8A, 0x2B, 0xE2 } }, + { "Brown", { 0xA5, 0x2A, 0x2A } }, + { "BurlyWood", { 0xDE, 0xB8, 0x87 } }, + { "CadetBlue", { 0x5F, 0x9E, 0xA0 } }, + { "Chartreuse", { 0x7F, 0xFF, 0x00 } }, + { "Chocolate", { 0xD2, 0x69, 0x1E } }, + { "Coral", { 0xFF, 0x7F, 0x50 } }, + { "CornflowerBlue", { 0x64, 0x95, 0xED } }, + { "Cornsilk", { 0xFF, 0xF8, 0xDC } }, + { "Crimson", { 0xDC, 0x14, 0x3C } }, + { "Cyan", { 0x00, 0xFF, 0xFF } }, + { "DarkBlue", { 0x00, 0x00, 0x8B } }, + { "DarkCyan", { 0x00, 0x8B, 0x8B } }, + { "DarkGoldenRod", { 0xB8, 0x86, 0x0B } }, + { "DarkGray", { 0xA9, 0xA9, 0xA9 } }, + { "DarkGreen", { 0x00, 0x64, 0x00 } }, + { "DarkKhaki", { 0xBD, 0xB7, 0x6B } }, + { "DarkMagenta", { 0x8B, 0x00, 0x8B } }, + { "DarkOliveGreen", { 0x55, 0x6B, 0x2F } }, + { "Darkorange", { 0xFF, 0x8C, 0x00 } }, + { "DarkOrchid", { 0x99, 0x32, 0xCC } }, + { "DarkRed", { 0x8B, 0x00, 0x00 } }, + { "DarkSalmon", { 0xE9, 0x96, 0x7A } }, + { "DarkSeaGreen", { 0x8F, 0xBC, 0x8F } }, + { "DarkSlateBlue", { 0x48, 0x3D, 0x8B } }, + { "DarkSlateGray", { 0x2F, 0x4F, 0x4F } }, + { "DarkTurquoise", { 0x00, 0xCE, 0xD1 } }, + { "DarkViolet", { 0x94, 0x00, 0xD3 } }, + { "DeepPink", { 0xFF, 0x14, 0x93 } }, + { "DeepSkyBlue", { 0x00, 0xBF, 0xFF } }, + { "DimGray", { 0x69, 0x69, 0x69 } }, + { "DodgerBlue", { 0x1E, 0x90, 0xFF } }, + { "FireBrick", { 0xB2, 0x22, 0x22 } }, + { "FloralWhite", { 0xFF, 0xFA, 0xF0 } }, + { "ForestGreen", { 0x22, 0x8B, 0x22 } }, + { "Fuchsia", { 0xFF, 0x00, 0xFF } }, + { "Gainsboro", { 0xDC, 0xDC, 0xDC } }, + { "GhostWhite", { 0xF8, 0xF8, 0xFF } }, + { "Gold", { 0xFF, 0xD7, 0x00 } }, + { "GoldenRod", { 0xDA, 0xA5, 0x20 } }, + { "Gray", { 0x80, 0x80, 0x80 } }, + { "Green", { 0x00, 0x80, 0x00 } }, + { "GreenYellow", { 0xAD, 0xFF, 0x2F } }, + { "HoneyDew", { 0xF0, 0xFF, 0xF0 } }, + { "HotPink", { 0xFF, 0x69, 0xB4 } }, + { "IndianRed", { 0xCD, 0x5C, 0x5C } }, + { "Indigo", { 0x4B, 0x00, 0x82 } }, + { "Ivory", { 0xFF, 0xFF, 0xF0 } }, + { "Khaki", { 0xF0, 0xE6, 0x8C } }, + { "Lavender", { 0xE6, 0xE6, 0xFA } }, + { "LavenderBlush", { 0xFF, 0xF0, 0xF5 } }, + { "LawnGreen", { 0x7C, 0xFC, 0x00 } }, + { "LemonChiffon", { 0xFF, 0xFA, 0xCD } }, + { "LightBlue", { 0xAD, 0xD8, 0xE6 } }, + { "LightCoral", { 0xF0, 0x80, 0x80 } }, + { "LightCyan", { 0xE0, 0xFF, 0xFF } }, + { "LightGoldenRodYellow", { 0xFA, 0xFA, 0xD2 } }, + { "LightGrey", { 0xD3, 0xD3, 0xD3 } }, + { "LightGreen", { 0x90, 0xEE, 0x90 } }, + { "LightPink", { 0xFF, 0xB6, 0xC1 } }, + { "LightSalmon", { 0xFF, 0xA0, 0x7A } }, + { "LightSeaGreen", { 0x20, 0xB2, 0xAA } }, + { "LightSkyBlue", { 0x87, 0xCE, 0xFA } }, + { "LightSlateGray", { 0x77, 0x88, 0x99 } }, + { "LightSteelBlue", { 0xB0, 0xC4, 0xDE } }, + { "LightYellow", { 0xFF, 0xFF, 0xE0 } }, + { "Lime", { 0x00, 0xFF, 0x00 } }, + { "LimeGreen", { 0x32, 0xCD, 0x32 } }, + { "Linen", { 0xFA, 0xF0, 0xE6 } }, + { "Magenta", { 0xFF, 0x00, 0xFF } }, + { "Maroon", { 0x80, 0x00, 0x00 } }, + { "MediumAquaMarine", { 0x66, 0xCD, 0xAA } }, + { "MediumBlue", { 0x00, 0x00, 0xCD } }, + { "MediumOrchid", { 0xBA, 0x55, 0xD3 } }, + { "MediumPurple", { 0x93, 0x70, 0xD8 } }, + { "MediumSeaGreen", { 0x3C, 0xB3, 0x71 } }, + { "MediumSlateBlue", { 0x7B, 0x68, 0xEE } }, + { "MediumSpringGreen", { 0x00, 0xFA, 0x9A } }, + { "MediumTurquoise", { 0x48, 0xD1, 0xCC } }, + { "MediumVioletRed", { 0xC7, 0x15, 0x85 } }, + { "MidnightBlue", { 0x19, 0x19, 0x70 } }, + { "MintCream", { 0xF5, 0xFF, 0xFA } }, + { "MistyRose", { 0xFF, 0xE4, 0xE1 } }, + { "Moccasin", { 0xFF, 0xE4, 0xB5 } }, + { "NavajoWhite", { 0xFF, 0xDE, 0xAD } }, + { "Navy", { 0x00, 0x00, 0x80 } }, + { "OldLace", { 0xFD, 0xF5, 0xE6 } }, + { "Olive", { 0x80, 0x80, 0x00 } }, + { "OliveDrab", { 0x6B, 0x8E, 0x23 } }, + { "Orange", { 0xFF, 0xA5, 0x00 } }, + { "OrangeRed", { 0xFF, 0x45, 0x00 } }, + { "Orchid", { 0xDA, 0x70, 0xD6 } }, + { "PaleGoldenRod", { 0xEE, 0xE8, 0xAA } }, + { "PaleGreen", { 0x98, 0xFB, 0x98 } }, + { "PaleTurquoise", { 0xAF, 0xEE, 0xEE } }, + { "PaleVioletRed", { 0xD8, 0x70, 0x93 } }, + { "PapayaWhip", { 0xFF, 0xEF, 0xD5 } }, + { "PeachPuff", { 0xFF, 0xDA, 0xB9 } }, + { "Peru", { 0xCD, 0x85, 0x3F } }, + { "Pink", { 0xFF, 0xC0, 0xCB } }, + { "Plum", { 0xDD, 0xA0, 0xDD } }, + { "PowderBlue", { 0xB0, 0xE0, 0xE6 } }, + { "Purple", { 0x80, 0x00, 0x80 } }, + { "Red", { 0xFF, 0x00, 0x00 } }, + { "RosyBrown", { 0xBC, 0x8F, 0x8F } }, + { "RoyalBlue", { 0x41, 0x69, 0xE1 } }, + { "SaddleBrown", { 0x8B, 0x45, 0x13 } }, + { "Salmon", { 0xFA, 0x80, 0x72 } }, + { "SandyBrown", { 0xF4, 0xA4, 0x60 } }, + { "SeaGreen", { 0x2E, 0x8B, 0x57 } }, + { "SeaShell", { 0xFF, 0xF5, 0xEE } }, + { "Sienna", { 0xA0, 0x52, 0x2D } }, + { "Silver", { 0xC0, 0xC0, 0xC0 } }, + { "SkyBlue", { 0x87, 0xCE, 0xEB } }, + { "SlateBlue", { 0x6A, 0x5A, 0xCD } }, + { "SlateGray", { 0x70, 0x80, 0x90 } }, + { "Snow", { 0xFF, 0xFA, 0xFA } }, + { "SpringGreen", { 0x00, 0xFF, 0x7F } }, + { "SteelBlue", { 0x46, 0x82, 0xB4 } }, + { "Tan", { 0xD2, 0xB4, 0x8C } }, + { "Teal", { 0x00, 0x80, 0x80 } }, + { "Thistle", { 0xD8, 0xBF, 0xD8 } }, + { "Tomato", { 0xFF, 0x63, 0x47 } }, + { "Turquoise", { 0x40, 0xE0, 0xD0 } }, + { "Violet", { 0xEE, 0x82, 0xEE } }, + { "Wheat", { 0xF5, 0xDE, 0xB3 } }, + { "White", { 0xFF, 0xFF, 0xFF } }, + { "WhiteSmoke", { 0xF5, 0xF5, 0xF5 } }, + { "Yellow", { 0xFF, 0xFF, 0x00 } }, + { "YellowGreen", { 0x9A, 0xCD, 0x32 } }, +}; + +static int color_table_compare(const void *lhs, const void *rhs) +{ + return strcasecmp(lhs, ((const ColorEntry *)rhs)->name); +} + +#define ALPHA_SEP '@' + +int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, + void *log_ctx) +{ + char *tail, color_string2[128]; + const ColorEntry *entry; + int len, hex_offset = 0; + + if (color_string[0] == '#') { + hex_offset = 1; + } else if (!strncmp(color_string, "0x", 2)) + hex_offset = 2; + + if (slen < 0) + slen = strlen(color_string); + av_strlcpy(color_string2, color_string + hex_offset, + FFMIN(slen-hex_offset+1, sizeof(color_string2))); + if ((tail = strchr(color_string2, ALPHA_SEP))) + *tail++ = 0; + len = strlen(color_string2); + rgba_color[3] = 255; + + if (!strcasecmp(color_string2, "random") || !strcasecmp(color_string2, "bikeshed")) { + int rgba = av_get_random_seed(); + rgba_color[0] = rgba >> 24; + rgba_color[1] = rgba >> 16; + rgba_color[2] = rgba >> 8; + rgba_color[3] = rgba; + } else if (hex_offset || + strspn(color_string2, "0123456789ABCDEFabcdef") == len) { + char *tail; + unsigned int rgba = strtoul(color_string2, &tail, 16); + + if (*tail || (len != 6 && len != 8)) { + av_log(log_ctx, AV_LOG_ERROR, "Invalid 0xRRGGBB[AA] color string: '%s'\n", color_string2); + return AVERROR(EINVAL); + } + if (len == 8) { + rgba_color[3] = rgba; + rgba >>= 8; + } + rgba_color[0] = rgba >> 16; + rgba_color[1] = rgba >> 8; + rgba_color[2] = rgba; + } else { + entry = bsearch(color_string2, + color_table, + FF_ARRAY_ELEMS(color_table), + sizeof(ColorEntry), + color_table_compare); + if (!entry) { + av_log(log_ctx, AV_LOG_ERROR, "Cannot find color '%s'\n", color_string2); + return AVERROR(EINVAL); + } + memcpy(rgba_color, entry->rgb_color, 3); + } + + if (tail) { + unsigned long int alpha; + const char *alpha_string = tail; + if (!strncmp(alpha_string, "0x", 2)) { + alpha = strtoul(alpha_string, &tail, 16); + } else { + alpha = 255 * strtod(alpha_string, &tail); + } + + if (tail == alpha_string || *tail || alpha > 255) { + av_log(log_ctx, AV_LOG_ERROR, "Invalid alpha value specifier '%s' in '%s'\n", + alpha_string, color_string); + return AVERROR(EINVAL); + } + rgba_color[3] = alpha; + } + + return 0; +} + +#ifdef TEST + +#undef printf + +int main(void) +{ + printf("Testing av_parse_video_rate()\n"); + { + int i; + const char *rates[] = { + "-inf", + "inf", + "nan", + "123/0", + "-123 / 0", + "", + "/", + " 123 / 321", + "foo/foo", + "foo/1", + "1/foo", + "0/0", + "/0", + "1/", + "1", + "0", + "-123/123", + "-foo", + "123.23", + ".23", + "-.23", + "-0.234", + "-0.0000001", + " 21332.2324 ", + " -21332.2324 ", + }; + + for (i = 0; i < FF_ARRAY_ELEMS(rates); i++) { + int ret; + AVRational q = (AVRational){0, 0}; + ret = av_parse_video_rate(&q, rates[i]), + printf("'%s' -> %d/%d ret:%d\n", + rates[i], q.num, q.den, ret); + } + } + + printf("\nTesting av_parse_color()\n"); + { + int i; + uint8_t rgba[4]; + const char *color_names[] = { + "bikeshed", + "RaNdOm", + "foo", + "red", + "Red ", + "RED", + "Violet", + "Yellow", + "Red", + "0x000000", + "0x0000000", + "0xff000000", + "0x3e34ff", + "0x3e34ffaa", + "0xffXXee", + "0xfoobar", + "0xffffeeeeeeee", + "#ff0000", + "#ffXX00", + "ff0000", + "ffXX00", + "red@foo", + "random@10", + "0xff0000@1.0", + "red@", + "red@0xfff", + "red@0xf", + "red@2", + "red@0.1", + "red@-1", + "red@0.5", + "red@1.0", + "red@256", + "red@10foo", + "red@-1.0", + "red@-0.0", + }; + + av_log_set_level(AV_LOG_DEBUG); + + for (i = 0; i < FF_ARRAY_ELEMS(color_names); i++) { + if (av_parse_color(rgba, color_names[i], -1, NULL) >= 0) + printf("%s -> R(%d) G(%d) B(%d) A(%d)\n", color_names[i], rgba[0], rgba[1], rgba[2], rgba[3]); + } + } + + return 0; +} + +#endif /* TEST */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/parseutils.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/parseutils.h new file mode 100644 index 00000000..052427bb --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/parseutils.h @@ -0,0 +1,75 @@ +/* + * 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 + */ + +#ifndef AVCORE_PARSEUTILS_H +#define AVCORE_PARSEUTILS_H + +#include "libavutil/rational.h" + +/** + * @file + * misc parsing utilities for libavcore + */ + +/** + * Parse str and put in width_ptr and height_ptr the detected values. + * + * @param[in,out] width_ptr pointer to the variable which will contain the detected + * width value + * @param[in,out] height_ptr pointer to the variable which will contain the detected + * height value + * @param[in] str the string to parse: it has to be a string in the format + * width x height or a valid video size abbreviation. + * @return >= 0 on success, a negative error code otherwise + */ +int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str); + +/** + * Parse str and store the detected values in *rate. + * + * @param[in,out] rate pointer to the AVRational which will contain the detected + * frame rate + * @param[in] str the string to parse: it has to be a string in the format + * rate_num / rate_den, a float number or a valid video rate abbreviation + * @return >= 0 on success, a negative error code otherwise + */ +int av_parse_video_rate(AVRational *rate, const char *str); + +/** + * Put the RGBA values that correspond to color_string in rgba_color. + * + * @param color_string a string specifying a color. It can be the name of + * a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence, + * possibly followed by "@" and a string representing the alpha + * component. + * The alpha component may be a string composed by "0x" followed by an + * hexadecimal number or a decimal number between 0.0 and 1.0, which + * represents the opacity value (0x00/0.0 means completely transparent, + * 0xff/1.0 completely opaque). + * If the alpha component is not specified then 0xff is assumed. + * The string "random" will result in a random color. + * @param slen length of the initial part of color_string containing the + * color. It can be set to -1 if color_string is a null terminated string + * containing nothing else than the color. + * @return >= 0 in case of success, a negative value in case of + * failure (for example if color_string cannot be parsed). + */ +int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, + void *log_ctx); + +#endif /* AVCORE_PARSEUTILS_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/samplefmt.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/samplefmt.c new file mode 100644 index 00000000..532acd95 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/samplefmt.c @@ -0,0 +1,70 @@ +/* + * 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 + */ + +#include "avcore.h" +#include "samplefmt.h" + +typedef struct SampleFmtInfo { + const char *name; + int bits; +} SampleFmtInfo; + +/** this table gives more information about formats */ +static const SampleFmtInfo sample_fmt_info[AV_SAMPLE_FMT_NB] = { + [AV_SAMPLE_FMT_U8] = { .name = "u8", .bits = 8 }, + [AV_SAMPLE_FMT_S16] = { .name = "s16", .bits = 16 }, + [AV_SAMPLE_FMT_S32] = { .name = "s32", .bits = 32 }, + [AV_SAMPLE_FMT_FLT] = { .name = "flt", .bits = 32 }, + [AV_SAMPLE_FMT_DBL] = { .name = "dbl", .bits = 64 }, +}; + +const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt) +{ + if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB) + return NULL; + return sample_fmt_info[sample_fmt].name; +} + +enum AVSampleFormat av_get_sample_fmt(const char *name) +{ + int i; + + for (i = 0; i < AV_SAMPLE_FMT_NB; i++) + if (!strcmp(sample_fmt_info[i].name, name)) + return i; + return AV_SAMPLE_FMT_NONE; +} + +char *av_get_sample_fmt_string (char *buf, int buf_size, enum AVSampleFormat sample_fmt) +{ + /* print header */ + if (sample_fmt < 0) + snprintf(buf, buf_size, "name " " depth"); + else if (sample_fmt < AV_SAMPLE_FMT_NB) { + SampleFmtInfo info = sample_fmt_info[sample_fmt]; + snprintf (buf, buf_size, "%-6s" " %2d ", info.name, info.bits); + } + + return buf; +} + +int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt) +{ + return sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB ? + 0 : sample_fmt_info[sample_fmt].bits; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/samplefmt.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/samplefmt.h new file mode 100644 index 00000000..9701efe7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/samplefmt.h @@ -0,0 +1,72 @@ +/* + * 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 + */ + +#ifndef AVCORE_SAMPLEFMT_H +#define AVCORE_SAMPLEFMT_H + +#include "avcore.h" + +/** + * all in native-endian format + */ +enum AVSampleFormat { + AV_SAMPLE_FMT_NONE = -1, + AV_SAMPLE_FMT_U8, ///< unsigned 8 bits + AV_SAMPLE_FMT_S16, ///< signed 16 bits + AV_SAMPLE_FMT_S32, ///< signed 32 bits + AV_SAMPLE_FMT_FLT, ///< float + AV_SAMPLE_FMT_DBL, ///< double + AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if dynamically linking to libavcore +}; + +/** + * Return the name of sample_fmt, or NULL if sample_fmt is not + * recognized. + */ +const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt); + +/** + * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE + * on error. + */ +enum AVSampleFormat av_get_sample_fmt(const char *name); + +/** + * Generate a string corresponding to the sample format with + * sample_fmt, or a header if sample_fmt is negative. + * + * @param buf the buffer where to write the string + * @param buf_size the size of buf + * @param sample_fmt the number of the sample format to print the + * corresponding info string, or a negative value to print the + * corresponding header. + * @return the pointer to the filled buffer or NULL if sample_fmt is + * unknown or in case of other errors + */ +char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt); + +/** + * Return sample format bits per sample. + * + * @param sample_fmt the sample format + * @return number of bits per sample or zero if unknown for the given + * sample format + */ +int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt); + +#endif /* AVCORE_SAMPLEFMT_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/utils.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/utils.c new file mode 100644 index 00000000..8350a9bc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcore/utils.c @@ -0,0 +1,41 @@ +/* + * 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 + */ + +#include "config.h" +#include "avcore.h" + +/** + * @file + * various utility functions + */ + +unsigned avcore_version(void) +{ + return LIBAVCORE_VERSION_INT; +} + +const char *avcore_configuration(void) +{ + return FFMPEG_CONFIGURATION; +} + +const char *avcore_license(void) +{ +#define LICENSE_PREFIX "libavcore license: " + return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/avdevice.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/avdevice.c new file mode 100644 index 00000000..3d67b4b8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavdevice/avdevice.c @@ -0,0 +1,35 @@ +/* + * 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 + */ + +#include "avdevice.h" + +unsigned avdevice_version(void) +{ + return LIBAVDEVICE_VERSION_INT; +} + +const char * avdevice_configuration(void) +{ + return FFMPEG_CONFIGURATION; +} + +const char * avdevice_license(void) +{ +#define LICENSE_PREFIX "libavdevice license: " + return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/af_anull.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/af_anull.c new file mode 100644 index 00000000..94e7e17b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/af_anull.c @@ -0,0 +1,41 @@ +/* + * 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 + * null audio filter + */ + +#include "avfilter.h" + +AVFilter avfilter_af_anull = { + .name = "anull", + .description = NULL_IF_CONFIG_SMALL("Pass the source unchanged to the output."), + + .priv_size = 0, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_AUDIO, + .get_audio_buffer = avfilter_null_get_audio_buffer, + .filter_samples = avfilter_null_filter_samples }, + { .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_AUDIO, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/asink_anullsink.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/asink_anullsink.c new file mode 100644 index 00000000..5a89c279 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/asink_anullsink.c @@ -0,0 +1,38 @@ +/* + * 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 + */ + +#include "avfilter.h" + +static void null_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) { } + +AVFilter avfilter_asink_anullsink = { + .name = "anullsink", + .description = NULL_IF_CONFIG_SMALL("Do absolutely nothing with the input audio."), + + .priv_size = 0, + + .inputs = (AVFilterPad[]) { + { + .name = "default", + .type = AVMEDIA_TYPE_AUDIO, + .filter_samples = null_filter_samples, + }, + { .name = NULL}, + }, + .outputs = (AVFilterPad[]) {{ .name = NULL }}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/asrc_anullsrc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/asrc_anullsrc.c new file mode 100644 index 00000000..306e0a3d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/asrc_anullsrc.c @@ -0,0 +1,96 @@ +/* + * 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 + * null audio source + */ + +#include "avfilter.h" +#include "libavcore/audioconvert.h" + +typedef struct { + int64_t channel_layout; + int64_t sample_rate; +} ANullContext; + +static int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + ANullContext *priv = ctx->priv; + char channel_layout_str[128] = ""; + + priv->sample_rate = 44100; + priv->channel_layout = AV_CH_LAYOUT_STEREO; + + if (args) + sscanf(args, "%"PRId64":%s", &priv->sample_rate, channel_layout_str); + + if (priv->sample_rate < 0) { + av_log(ctx, AV_LOG_ERROR, "Invalid negative sample rate: %"PRId64"\n", priv->sample_rate); + return AVERROR(EINVAL); + } + + if (*channel_layout_str) + if (!(priv->channel_layout = av_get_channel_layout(channel_layout_str)) + && sscanf(channel_layout_str, "%"PRId64, &priv->channel_layout) != 1) { + av_log(ctx, AV_LOG_ERROR, "Invalid value '%s' for channel layout\n", + channel_layout_str); + return AVERROR(EINVAL); + } + + return 0; +} + +static int config_props(AVFilterLink *outlink) +{ + ANullContext *priv = outlink->src->priv; + char buf[128]; + int chans_nb; + + outlink->sample_rate = priv->sample_rate; + outlink->channel_layout = priv->channel_layout; + + chans_nb = av_get_channel_layout_nb_channels(priv->channel_layout); + av_get_channel_layout_string(buf, sizeof(buf), chans_nb, priv->channel_layout); + av_log(outlink->src, AV_LOG_INFO, + "sample_rate:%"PRId64 " channel_layout:%"PRId64 " channel_layout_description:'%s'\n", + priv->sample_rate, priv->channel_layout, buf); + + return 0; +} + +static int request_frame(AVFilterLink *link) +{ + return -1; +} + +AVFilter avfilter_asrc_anullsrc = { + .name = "anullsrc", + .description = NULL_IF_CONFIG_SMALL("Null audio source, never return audio frames."), + + .init = init, + .priv_size = sizeof(ANullContext), + + .inputs = (AVFilterPad[]) {{ .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_AUDIO, + .config_props = config_props, + .request_frame = request_frame, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/gradfun.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/gradfun.h new file mode 100644 index 00000000..3dacbcb2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/gradfun.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2010 Nolan Lum + * Copyright (c) 2009 Loren Merritt + * + * 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 + */ + +#ifndef AVFILTER_GRADFUN_H +#define AVFILTER_GRADFUN_H + +#include "avfilter.h" + +/// Holds instance-specific information for gradfun. +typedef struct { + int thresh; ///< threshold for gradient algorithm + int radius; ///< blur radius + int chroma_w; ///< width of the chroma planes + int chroma_h; ///< weight of the chroma planes + int chroma_r; ///< blur radius for the chroma planes + uint16_t *buf; ///< holds image data for blur algorithm passed into filter. + /// DSP functions. + void (*filter_line) (uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers); + void (*blur_line) (uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width); +} GradFunContext; + +void ff_gradfun_filter_line_c(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers); +void ff_gradfun_blur_line_c(uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width); + +void ff_gradfun_filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers); +void ff_gradfun_filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers); + +void ff_gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width); + +#endif /* AVFILTER_GRADFUN_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/internal.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/internal.h new file mode 100644 index 00000000..188da870 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/internal.h @@ -0,0 +1,55 @@ +/* + * 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 + */ + +#ifndef AVFILTER_INTERNAL_H +#define AVFILTER_INTERNAL_H + +/** + * @file + * internal API functions + */ + +#include "avfilter.h" +#include "avfiltergraph.h" + +/** + * Check for the validity of graph. + * + * A graph is considered valid if all its input and output pads are + * connected. + * + * @return 0 in case of success, a negative value otherwise + */ +int ff_avfilter_graph_check_validity(AVFilterGraph *graphctx, AVClass *log_ctx); + +/** + * Configure all the links of graphctx. + * + * @return 0 in case of success, a negative value otherwise + */ +int ff_avfilter_graph_config_links(AVFilterGraph *graphctx, AVClass *log_ctx); + +/** + * Configure the formats of all the links in the graph. + */ +int ff_avfilter_graph_config_formats(AVFilterGraph *graphctx, AVClass *log_ctx); + +/** default handler for freeing audio/video buffer when there are no references left */ +void ff_avfilter_default_free_buffer(AVFilterBuffer *buf); + +#endif /* AVFILTER_INTERNAL_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_aspect.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_aspect.c new file mode 100644 index 00000000..6f86bf29 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_aspect.c @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2010 Bobby Bingham + + * 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 + * aspect ratio modification video filters + */ + +#include "avfilter.h" + +typedef struct { + AVRational aspect; +} AspectContext; + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + AspectContext *aspect = ctx->priv; + double ratio; + int64_t gcd; + char c = 0; + + if (args) { + if (sscanf(args, "%d:%d%c", &aspect->aspect.num, &aspect->aspect.den, &c) != 2) + if (sscanf(args, "%lf%c", &ratio, &c) == 1) + aspect->aspect = av_d2q(ratio, 100); + + if (c || aspect->aspect.num <= 0 || aspect->aspect.den <= 0) { + av_log(ctx, AV_LOG_ERROR, + "Invalid string '%s' for aspect ratio.\n", args); + return AVERROR(EINVAL); + } + + gcd = av_gcd(FFABS(aspect->aspect.num), FFABS(aspect->aspect.den)); + if (gcd) { + aspect->aspect.num /= gcd; + aspect->aspect.den /= gcd; + } + } + + if (aspect->aspect.den == 0) + aspect->aspect = (AVRational) {0, 1}; + + av_log(ctx, AV_LOG_INFO, "a:%d/%d\n", aspect->aspect.num, aspect->aspect.den); + return 0; +} + +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) +{ + AspectContext *aspect = link->dst->priv; + + picref->video->pixel_aspect = aspect->aspect; + avfilter_start_frame(link->dst->outputs[0], picref); +} + +#if CONFIG_SETDAR_FILTER +/* for setdar filter, convert from frame aspect ratio to pixel aspect ratio */ +static int setdar_config_props(AVFilterLink *inlink) +{ + AspectContext *aspect = inlink->dst->priv; + AVRational dar = aspect->aspect; + + av_reduce(&aspect->aspect.num, &aspect->aspect.den, + aspect->aspect.num * inlink->h, + aspect->aspect.den * inlink->w, 100); + + av_log(inlink->dst, AV_LOG_INFO, "w:%d h:%d -> dar:%d/%d par:%d/%d\n", + inlink->w, inlink->h, dar.num, dar.den, aspect->aspect.num, aspect->aspect.den); + return 0; +} + +AVFilter avfilter_vf_setdar = { + .name = "setdar", + .description = NULL_IF_CONFIG_SMALL("Set the frame display aspect ratio."), + + .init = init, + + .priv_size = sizeof(AspectContext), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = setdar_config_props, + .get_video_buffer = avfilter_null_get_video_buffer, + .start_frame = start_frame, + .end_frame = avfilter_null_end_frame }, + { .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; +#endif /* CONFIG_SETDAR_FILTER */ + +#if CONFIG_SETSAR_FILTER +AVFilter avfilter_vf_setsar = { + .name = "setsar", + .description = NULL_IF_CONFIG_SMALL("Set the pixel sample aspect ratio."), + + .init = init, + + .priv_size = sizeof(AspectContext), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = avfilter_null_get_video_buffer, + .start_frame = start_frame, + .end_frame = avfilter_null_end_frame }, + { .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; +#endif /* CONFIG_SETSAR_FILTER */ + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_blackframe.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_blackframe.c new file mode 100644 index 00000000..658c30fd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_blackframe.c @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2010 Stefano Sabatini + * Copyright (c) 2006 Ivo van Poorten + * Copyright (c) 2006 Julian Hall + * Copyright (c) 2002-2003 Brian J. Murrell + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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 General Public License for more details. + * + * You should have received a copy of the GNU 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 + * Search for black frames to detect scene transitions. + * Ported from MPlayer libmpcodecs/vf_blackframe.c. + */ + +#include "avfilter.h" + +typedef struct { + unsigned int bamount; ///< black amount + unsigned int bthresh; ///< black threshold + unsigned int frame; ///< frame number + unsigned int nblack; ///< number of black pixels counted so far +} BlackFrameContext; + +static int query_formats(AVFilterContext *ctx) +{ + static const enum PixelFormat pix_fmts[] = { + PIX_FMT_YUV410P, PIX_FMT_YUV420P, PIX_FMT_GRAY8, PIX_FMT_NV12, + PIX_FMT_NV21, PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, + PIX_FMT_NONE + }; + + avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + return 0; +} + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + BlackFrameContext *blackframe = ctx->priv; + + blackframe->bamount = 98; + blackframe->bthresh = 32; + blackframe->nblack = 0; + blackframe->frame = 0; + + if (args) + sscanf(args, "%u:%u", &blackframe->bamount, &blackframe->bthresh); + + av_log(ctx, AV_LOG_INFO, "bamount:%u bthresh:%u\n", + blackframe->bamount, blackframe->bthresh); + + if (blackframe->bamount > 100 || blackframe->bthresh > 255) { + av_log(ctx, AV_LOG_ERROR, "Too big value for bamount (max is 100) or bthresh (max is 255)\n"); + return AVERROR(EINVAL); + } + + return 0; +} + +static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) +{ + AVFilterContext *ctx = inlink->dst; + BlackFrameContext *blackframe = ctx->priv; + AVFilterBufferRef *picref = inlink->cur_buf; + int x, i; + uint8_t *p = picref->data[0] + y * picref->linesize[0]; + + for (i = 0; i < h; i++) { + for (x = 0; x < inlink->w; x++) + blackframe->nblack += p[x] < blackframe->bthresh; + p += picref->linesize[0]; + } + + avfilter_draw_slice(ctx->outputs[0], y, h, slice_dir); +} + +static void end_frame(AVFilterLink *inlink) +{ + AVFilterContext *ctx = inlink->dst; + BlackFrameContext *blackframe = ctx->priv; + AVFilterBufferRef *picref = inlink->cur_buf; + int pblack = 0; + + pblack = blackframe->nblack * 100 / (inlink->w * inlink->h); + if (pblack >= blackframe->bamount) + av_log(ctx, AV_LOG_INFO, "frame:%u pblack:%u pos:%"PRId64" pts:%"PRId64" t:%f\n", + blackframe->frame, pblack, picref->pos, picref->pts, + picref->pts == AV_NOPTS_VALUE ? -1 : picref->pts * av_q2d(inlink->time_base)); + + blackframe->frame++; + blackframe->nblack = 0; + avfilter_end_frame(inlink->dst->outputs[0]); +} + +AVFilter avfilter_vf_blackframe = { + .name = "blackframe", + .description = NULL_IF_CONFIG_SMALL("Detect frames that are (almost) black."), + + .priv_size = sizeof(BlackFrameContext), + .init = init, + + .query_formats = query_formats, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .draw_slice = draw_slice, + .get_video_buffer = avfilter_null_get_video_buffer, + .start_frame = avfilter_null_start_frame, + .end_frame = end_frame, }, + { .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_copy.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_copy.c new file mode 100644 index 00000000..480ebcc0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_copy.c @@ -0,0 +1,40 @@ +/* + * 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 + * copy video filter + */ + +#include "avfilter.h" + +AVFilter avfilter_vf_copy = { + .name = "copy", + .description = NULL_IF_CONFIG_SMALL("Copy the input video unchanged to the output."), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = avfilter_null_get_video_buffer, + .start_frame = avfilter_null_start_frame, + .end_frame = avfilter_null_end_frame, + .rej_perms = ~0 }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_crop.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_crop.c new file mode 100644 index 00000000..e768fbb5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_crop.c @@ -0,0 +1,342 @@ +/* + * Copyright (c) 2007 Bobby Bingham + * + * 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 + * video crop filter + */ + +/* #define DEBUG */ + +#include "avfilter.h" +#include "libavutil/eval.h" +#include "libavutil/avstring.h" +#include "libavutil/libm.h" +#include "libavcore/imgutils.h" + +static const char *var_names[] = { + "E", + "PHI", + "PI", + "in_w", "iw", ///< width of the input video + "in_h", "ih", ///< height of the input video + "out_w", "ow", ///< width of the cropped video + "out_h", "oh", ///< height of the cropped video + "x", + "y", + "n", ///< number of frame + "pos", ///< position in the file + "t", ///< timestamp expressed in seconds + NULL +}; + +enum var_name { + VAR_E, + VAR_PHI, + VAR_PI, + VAR_IN_W, VAR_IW, + VAR_IN_H, VAR_IH, + VAR_OUT_W, VAR_OW, + VAR_OUT_H, VAR_OH, + VAR_X, + VAR_Y, + VAR_N, + VAR_POS, + VAR_T, + VAR_VARS_NB +}; + +typedef struct { + int x; ///< x offset of the non-cropped area with respect to the input area + int y; ///< y offset of the non-cropped area with respect to the input area + int w; ///< width of the cropped area + int h; ///< height of the cropped area + + int max_step[4]; ///< max pixel step for each plane, expressed as a number of bytes + int hsub, vsub; ///< chroma subsampling + char x_expr[256], y_expr[256], ow_expr[256], oh_expr[256]; + AVExpr *x_pexpr, *y_pexpr; /* parsed expressions for x and y */ + double var_values[VAR_VARS_NB]; +} CropContext; + +static int query_formats(AVFilterContext *ctx) +{ + static const enum PixelFormat pix_fmts[] = { + PIX_FMT_RGB48BE, PIX_FMT_RGB48LE, + PIX_FMT_ARGB, PIX_FMT_RGBA, + PIX_FMT_ABGR, PIX_FMT_BGRA, + PIX_FMT_RGB24, PIX_FMT_BGR24, + PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, + PIX_FMT_RGB555BE, PIX_FMT_RGB555LE, + PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, + PIX_FMT_BGR555BE, PIX_FMT_BGR555LE, + PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE, + PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE, + PIX_FMT_YUV422P16LE, PIX_FMT_YUV422P16BE, + PIX_FMT_YUV444P16LE, PIX_FMT_YUV444P16BE, + PIX_FMT_YUV444P, PIX_FMT_YUV422P, + PIX_FMT_YUV420P, PIX_FMT_YUV411P, + PIX_FMT_YUV410P, PIX_FMT_YUV440P, + PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, + PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P, + PIX_FMT_YUVA420P, + PIX_FMT_RGB8, PIX_FMT_BGR8, + PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, + PIX_FMT_PAL8, PIX_FMT_GRAY8, + PIX_FMT_NONE + }; + + avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + + return 0; +} + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + CropContext *crop = ctx->priv; + + av_strlcpy(crop->ow_expr, "iw", sizeof(crop->ow_expr)); + av_strlcpy(crop->oh_expr, "ih", sizeof(crop->oh_expr)); + av_strlcpy(crop->x_expr, "(in_w-out_w)/2", sizeof(crop->x_expr)); + av_strlcpy(crop->y_expr, "(in_h-out_h)/2", sizeof(crop->y_expr)); + + if (args) + sscanf(args, "%255[^:]:%255[^:]:%255[^:]:%255[^:]", crop->ow_expr, crop->oh_expr, crop->x_expr, crop->y_expr); + + return 0; +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + CropContext *crop = ctx->priv; + + av_expr_free(crop->x_pexpr); crop->x_pexpr = NULL; + av_expr_free(crop->y_pexpr); crop->y_pexpr = NULL; +} + +static inline int normalize_double(int *n, double d) +{ + int ret = 0; + + if (isnan(d)) { + ret = AVERROR(EINVAL); + } else if (d > INT_MAX || d < INT_MIN) { + *n = d > INT_MAX ? INT_MAX : INT_MIN; + ret = AVERROR(EINVAL); + } else + *n = round(d); + + return ret; +} + +static int config_input(AVFilterLink *link) +{ + AVFilterContext *ctx = link->dst; + CropContext *crop = ctx->priv; + const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[link->format]; + int ret; + const char *expr; + double res; + + crop->var_values[VAR_E] = M_E; + crop->var_values[VAR_PHI] = M_PHI; + crop->var_values[VAR_PI] = M_PI; + crop->var_values[VAR_IN_W] = crop->var_values[VAR_IW] = ctx->inputs[0]->w; + crop->var_values[VAR_IN_H] = crop->var_values[VAR_IH] = ctx->inputs[0]->h; + crop->var_values[VAR_X] = NAN; + crop->var_values[VAR_Y] = NAN; + crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = NAN; + crop->var_values[VAR_OUT_H] = crop->var_values[VAR_OH] = NAN; + crop->var_values[VAR_N] = 0; + crop->var_values[VAR_T] = NAN; + crop->var_values[VAR_POS] = NAN; + + av_image_fill_max_pixsteps(crop->max_step, NULL, pix_desc); + crop->hsub = av_pix_fmt_descriptors[link->format].log2_chroma_w; + crop->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h; + + if ((ret = av_expr_parse_and_eval(&res, (expr = crop->ow_expr), + var_names, crop->var_values, + NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr; + crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = res; + if ((ret = av_expr_parse_and_eval(&res, (expr = crop->oh_expr), + var_names, crop->var_values, + NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr; + crop->var_values[VAR_OUT_H] = crop->var_values[VAR_OH] = res; + /* evaluate again ow as it may depend on oh */ + if ((ret = av_expr_parse_and_eval(&res, (expr = crop->ow_expr), + var_names, crop->var_values, + NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr; + crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = res; + if (normalize_double(&crop->w, crop->var_values[VAR_OUT_W]) < 0 || + normalize_double(&crop->h, crop->var_values[VAR_OUT_H]) < 0) { + av_log(ctx, AV_LOG_ERROR, + "Too big value or invalid expression for out_w/ow or out_h/oh. " + "Maybe the expression for out_w:'%s' or for out_h:'%s' is self-referencing.\n", + crop->ow_expr, crop->oh_expr); + return AVERROR(EINVAL); + } + crop->w &= ~((1 << crop->hsub) - 1); + crop->h &= ~((1 << crop->vsub) - 1); + + if ((ret = av_expr_parse(&crop->x_pexpr, crop->x_expr, var_names, + NULL, NULL, NULL, NULL, 0, ctx)) < 0 || + (ret = av_expr_parse(&crop->y_pexpr, crop->y_expr, var_names, + NULL, NULL, NULL, NULL, 0, ctx)) < 0) + return AVERROR(EINVAL); + + av_log(ctx, AV_LOG_INFO, "w:%d h:%d -> w:%d h:%d\n", + link->w, link->h, crop->w, crop->h); + + if (crop->w <= 0 || crop->h <= 0 || + crop->w > link->w || crop->h > link->h) { + av_log(ctx, AV_LOG_ERROR, + "Invalid too big or non positive size for width '%d' or height '%d'\n", + crop->w, crop->h); + return AVERROR(EINVAL); + } + + /* set default, required in the case the first computed value for x/y is NAN */ + crop->x = (link->w - crop->w) / 2; + crop->y = (link->h - crop->h) / 2; + crop->x &= ~((1 << crop->hsub) - 1); + crop->y &= ~((1 << crop->vsub) - 1); + return 0; + +fail_expr: + av_log(NULL, AV_LOG_ERROR, "Error when evaluating the expression '%s'\n", expr); + return ret; +} + +static int config_output(AVFilterLink *link) +{ + CropContext *crop = link->src->priv; + + link->w = crop->w; + link->h = crop->h; + + return 0; +} + +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) +{ + AVFilterContext *ctx = link->dst; + CropContext *crop = ctx->priv; + AVFilterBufferRef *ref2; + int i; + + ref2 = avfilter_ref_buffer(picref, ~0); + ref2->video->w = crop->w; + ref2->video->h = crop->h; + + crop->var_values[VAR_T] = picref->pts == AV_NOPTS_VALUE ? + NAN : picref->pts * av_q2d(link->time_base); + crop->var_values[VAR_POS] = picref->pos == -1 ? NAN : picref->pos; + crop->var_values[VAR_X] = av_expr_eval(crop->x_pexpr, crop->var_values, NULL); + crop->var_values[VAR_Y] = av_expr_eval(crop->y_pexpr, crop->var_values, NULL); + crop->var_values[VAR_X] = av_expr_eval(crop->x_pexpr, crop->var_values, NULL); + + normalize_double(&crop->x, crop->var_values[VAR_X]); + normalize_double(&crop->y, crop->var_values[VAR_Y]); + + if (crop->x < 0) crop->x = 0; + if (crop->y < 0) crop->y = 0; + if ((unsigned)crop->x + (unsigned)crop->w > link->w) crop->x = link->w - crop->w; + if ((unsigned)crop->y + (unsigned)crop->h > link->h) crop->y = link->h - crop->h; + crop->x &= ~((1 << crop->hsub) - 1); + crop->y &= ~((1 << crop->vsub) - 1); + +#ifdef DEBUG + av_log(ctx, AV_LOG_DEBUG, + "n:%d t:%f x:%d y:%d x+w:%d y+h:%d\n", + (int)crop->var_values[VAR_N], crop->var_values[VAR_T], crop->x, crop->y, crop->x+crop->w, crop->y+crop->h); +#endif + + ref2->data[0] += crop->y * ref2->linesize[0]; + ref2->data[0] += crop->x * crop->max_step[0]; + + if (!(av_pix_fmt_descriptors[link->format].flags & PIX_FMT_PAL)) { + for (i = 1; i < 3; i ++) { + if (ref2->data[i]) { + ref2->data[i] += (crop->y >> crop->vsub) * ref2->linesize[i]; + ref2->data[i] += (crop->x * crop->max_step[i]) >> crop->hsub; + } + } + } + + /* alpha plane */ + if (ref2->data[3]) { + ref2->data[3] += crop->y * ref2->linesize[3]; + ref2->data[3] += crop->x * crop->max_step[3]; + } + + avfilter_start_frame(link->dst->outputs[0], ref2); +} + +static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir) +{ + AVFilterContext *ctx = link->dst; + CropContext *crop = ctx->priv; + + if (y >= crop->y + crop->h || y + h <= crop->y) + return; + + if (y < crop->y) { + h -= crop->y - y; + y = crop->y; + } + if (y + h > crop->y + crop->h) + h = crop->y + crop->h - y; + + avfilter_draw_slice(ctx->outputs[0], y - crop->y, h, slice_dir); +} + +static void end_frame(AVFilterLink *link) +{ + CropContext *crop = link->dst->priv; + + crop->var_values[VAR_N] += 1.0; + avfilter_unref_buffer(link->cur_buf); + avfilter_end_frame(link->dst->outputs[0]); +} + +AVFilter avfilter_vf_crop = { + .name = "crop", + .description = NULL_IF_CONFIG_SMALL("Crop the input video to width:height:x:y."), + + .priv_size = sizeof(CropContext), + + .query_formats = query_formats, + .init = init, + .uninit = uninit, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame, + .draw_slice = draw_slice, + .end_frame = end_frame, + .get_video_buffer = avfilter_null_get_video_buffer, + .config_props = config_input, }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_cropdetect.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_cropdetect.c new file mode 100644 index 00000000..62c68640 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_cropdetect.c @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2002 A'rpi + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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 General Public License for more details. + * + * You should have received a copy of the GNU 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 + * border detection filter + * Ported from MPlayer libmpcodecs/vf_cropdetect.c. + */ + +#include "libavcore/imgutils.h" +#include "avfilter.h" + +typedef struct { + int x1, y1, x2, y2; + int limit; + int round; + int reset_count; + int frame_nb; + int max_pixsteps[4]; +} CropDetectContext; + +static int query_formats(AVFilterContext *ctx) +{ + static const enum PixelFormat pix_fmts[] = { + PIX_FMT_YUV420P, PIX_FMT_YUVJ420P, + PIX_FMT_YUV422P, PIX_FMT_YUVJ422P, + PIX_FMT_YUV444P, PIX_FMT_YUVJ444P, + PIX_FMT_YUV411P, PIX_FMT_GRAY8, + PIX_FMT_NV12, PIX_FMT_NV21, + PIX_FMT_NONE + }; + + avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + return 0; +} + +static int checkline(void *ctx, const unsigned char *src, int stride, int len, int bpp) +{ + int total = 0; + int div = len; + + switch (bpp) { + case 1: + while (--len >= 0) { + total += src[0]; + src += stride; + } + break; + case 3: + case 4: + while (--len >= 0) { + total += src[0] + src[1] + src[2]; + src += stride; + } + div *= 3; + break; + } + total /= div; + + av_log(ctx, AV_LOG_DEBUG, "total:%d\n", total); + return total; +} + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + CropDetectContext *cd = ctx->priv; + + cd->limit = 24; + cd->round = 0; + cd->reset_count = 0; + cd->frame_nb = -2; + + if (args) + sscanf(args, "%d:%d:%d", &cd->limit, &cd->round, &cd->reset_count); + + av_log(ctx, AV_LOG_INFO, "limit:%d round:%d reset_count:%d\n", + cd->limit, cd->round, cd->reset_count); + + return 0; +} + +static int config_input(AVFilterLink *inlink) +{ + AVFilterContext *ctx = inlink->dst; + CropDetectContext *cd = ctx->priv; + + av_image_fill_max_pixsteps(cd->max_pixsteps, NULL, + &av_pix_fmt_descriptors[inlink->format]); + + cd->x1 = inlink->w - 1; + cd->y1 = inlink->h - 1; + cd->x2 = 0; + cd->y2 = 0; + + return 0; +} + +static void end_frame(AVFilterLink *inlink) +{ + AVFilterContext *ctx = inlink->dst; + CropDetectContext *cd = ctx->priv; + AVFilterBufferRef *picref = inlink->cur_buf; + int bpp = cd->max_pixsteps[0]; + int w, h, x, y, shrink_by; + + // ignore first 2 frames - they may be empty + if (++cd->frame_nb > 0) { + // Reset the crop area every reset_count frames, if reset_count is > 0 + if (cd->reset_count > 0 && cd->frame_nb > cd->reset_count) { + cd->x1 = picref->video->w-1; + cd->y1 = picref->video->h-1; + cd->x2 = 0; + cd->y2 = 0; + cd->frame_nb = 1; + } + + for (y = 0; y < cd->y1; y++) { + if (checkline(ctx, picref->data[0] + picref->linesize[0] * y, bpp, picref->video->w, bpp) > cd->limit) { + cd->y1 = y; + break; + } + } + + for (y = picref->video->h-1; y > cd->y2; y--) { + if (checkline(ctx, picref->data[0] + picref->linesize[0] * y, bpp, picref->video->w, bpp) > cd->limit) { + cd->y2 = y; + break; + } + } + + for (y = 0; y < cd->x1; y++) { + if (checkline(ctx, picref->data[0] + bpp*y, picref->linesize[0], picref->video->h, bpp) > cd->limit) { + cd->x1 = y; + break; + } + } + + for (y = picref->video->w-1; y > cd->x2; y--) { + if (checkline(ctx, picref->data[0] + bpp*y, picref->linesize[0], picref->video->h, bpp) > cd->limit) { + cd->x2 = y; + break; + } + } + + // round x and y (up), important for yuv colorspaces + // make sure they stay rounded! + x = (cd->x1+1) & ~1; + y = (cd->y1+1) & ~1; + + w = cd->x2 - x + 1; + h = cd->y2 - y + 1; + + // w and h must be divisible by 2 as well because of yuv + // colorspace problems. + if (cd->round <= 1) + cd->round = 16; + if (cd->round % 2) + cd->round *= 2; + + shrink_by = w % cd->round; + w -= shrink_by; + x += (shrink_by/2 + 1) & ~1; + + shrink_by = h % cd->round; + h -= shrink_by; + y += (shrink_by/2 + 1) & ~1; + + av_log(ctx, AV_LOG_INFO, + "x1:%d x2:%d y1:%d y2:%d w:%d h:%d x:%d y:%d pos:%"PRId64" pts:%"PRId64" t:%f crop=%d:%d:%d:%d\n", + cd->x1, cd->x2, cd->y1, cd->y2, w, h, x, y, picref->pos, picref->pts, + picref->pts == AV_NOPTS_VALUE ? -1 : picref->pts * av_q2d(inlink->time_base), + w, h, x, y); + } + + avfilter_end_frame(inlink->dst->outputs[0]); +} + +AVFilter avfilter_vf_cropdetect = { + .name = "cropdetect", + .description = NULL_IF_CONFIG_SMALL("Auto-detect crop size."), + + .priv_size = sizeof(CropDetectContext), + .init = init, + + .query_formats = query_formats, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input, + .get_video_buffer = avfilter_null_get_video_buffer, + .start_frame = avfilter_null_start_frame, + .end_frame = end_frame, }, + { .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_drawbox.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_drawbox.c new file mode 100644 index 00000000..40d5e16e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_drawbox.c @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2008 Affine Systems, Inc (Michael Sullivan, Bobby Impollonia) + * + * 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 + * Box drawing filter. Also a nice template for a filter that needs to + * write in the input frame. + */ + +#include "libavutil/colorspace.h" +#include "libavutil/pixdesc.h" +#include "libavcore/parseutils.h" +#include "avfilter.h" + +enum { Y, U, V, A }; + +typedef struct { + int x, y, w, h; + unsigned char yuv_color[4]; + int vsub, hsub; //< chroma subsampling +} DrawBoxContext; + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + DrawBoxContext *drawbox= ctx->priv; + char color_str[1024] = "black"; + uint8_t rgba_color[4]; + + drawbox->x = drawbox->y = drawbox->w = drawbox->h = 0; + + if (args) + sscanf(args, "%d:%d:%d:%d:%s", + &drawbox->x, &drawbox->y, &drawbox->w, &drawbox->h, color_str); + + if (av_parse_color(rgba_color, color_str, -1, ctx) < 0) + return AVERROR(EINVAL); + + drawbox->yuv_color[Y] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]); + drawbox->yuv_color[U] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0); + drawbox->yuv_color[V] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0); + drawbox->yuv_color[A] = rgba_color[3]; + + return 0; +} + +static int query_formats(AVFilterContext *ctx) +{ + enum PixelFormat pix_fmts[] = { + PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, + PIX_FMT_YUV411P, PIX_FMT_YUV410P, + PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P, + PIX_FMT_YUV440P, PIX_FMT_YUVJ440P, + PIX_FMT_NONE + }; + + avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + return 0; +} + +static int config_input(AVFilterLink *inlink) +{ + DrawBoxContext *drawbox = inlink->dst->priv; + + drawbox->hsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_w; + drawbox->vsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_h; + + if (drawbox->w == 0) drawbox->w = inlink->w; + if (drawbox->h == 0) drawbox->h = inlink->h; + + av_log(inlink->dst, AV_LOG_INFO, "x:%d y:%d w:%d h:%d color:0x%02X%02X%02X%02X\n", + drawbox->w, drawbox->y, drawbox->w, drawbox->h, + drawbox->yuv_color[Y], drawbox->yuv_color[U], drawbox->yuv_color[V], drawbox->yuv_color[A]); + + return 0; +} + +static void draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir) +{ + DrawBoxContext *drawbox = inlink->dst->priv; + int plane, x, y, xb = drawbox->x, yb = drawbox->y; + unsigned char *row[4]; + AVFilterBufferRef *picref = inlink->cur_buf; + + for (y = FFMAX(yb, y0); y < (y0 + h) && y < (yb + drawbox->h); y++) { + row[0] = picref->data[0] + y * picref->linesize[0]; + + for (plane = 1; plane < 3; plane++) + row[plane] = picref->data[plane] + + picref->linesize[plane] * (y >> drawbox->vsub); + + for (x = FFMAX(xb, 0); x < (xb + drawbox->w) && x < picref->video->w; x++) { + double alpha = (double)drawbox->yuv_color[A] / 255; + + if ((y - yb < 3) || (yb + drawbox->h - y < 4) || + (x - xb < 3) || (xb + drawbox->w - x < 4)) { + row[0][x ] = (1 - alpha) * row[0][x ] + alpha * drawbox->yuv_color[Y]; + row[1][x >> drawbox->hsub] = (1 - alpha) * row[1][x >> drawbox->hsub] + alpha * drawbox->yuv_color[U]; + row[2][x >> drawbox->hsub] = (1 - alpha) * row[2][x >> drawbox->hsub] + alpha * drawbox->yuv_color[V]; + } + } + } + + avfilter_draw_slice(inlink->dst->outputs[0], y0, h, 1); +} + +AVFilter avfilter_vf_drawbox = { + .name = "drawbox", + .description = NULL_IF_CONFIG_SMALL("Draw a colored box on the input video."), + .priv_size = sizeof(DrawBoxContext), + .init = init, + + .query_formats = query_formats, + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input, + .get_video_buffer = avfilter_null_get_video_buffer, + .start_frame = avfilter_null_start_frame, + .draw_slice = draw_slice, + .end_frame = avfilter_null_end_frame, + .min_perms = AV_PERM_WRITE | AV_PERM_READ, + .rej_perms = AV_PERM_PRESERVE }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_fifo.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_fifo.c new file mode 100644 index 00000000..32199edd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_fifo.c @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2007 Bobby Bingham + * + * 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 + * FIFO buffering video filter + */ + +#include "avfilter.h" + +typedef struct BufPic { + AVFilterBufferRef *picref; + struct BufPic *next; +} BufPic; + +typedef struct { + BufPic root; + BufPic *last; ///< last buffered picture +} FifoContext; + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + FifoContext *fifo = ctx->priv; + fifo->last = &fifo->root; + + av_log(ctx, AV_LOG_INFO, "\n"); + return 0; +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + FifoContext *fifo = ctx->priv; + BufPic *pic, *tmp; + + for (pic = fifo->root.next; pic; pic = tmp) { + tmp = pic->next; + avfilter_unref_buffer(pic->picref); + av_free(pic); + } +} + +static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) +{ + FifoContext *fifo = inlink->dst->priv; + + fifo->last->next = av_mallocz(sizeof(BufPic)); + fifo->last = fifo->last->next; + fifo->last->picref = picref; +} + +static void end_frame(AVFilterLink *inlink) { } + +static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) { } + +static int request_frame(AVFilterLink *outlink) +{ + FifoContext *fifo = outlink->src->priv; + BufPic *tmp; + int ret; + + if (!fifo->root.next) { + if ((ret = avfilter_request_frame(outlink->src->inputs[0]) < 0)) + return ret; + } + + /* by doing this, we give ownership of the reference to the next filter, + * so we don't have to worry about dereferencing it ourselves. */ + avfilter_start_frame(outlink, fifo->root.next->picref); + avfilter_draw_slice (outlink, 0, outlink->h, 1); + avfilter_end_frame (outlink); + + if (fifo->last == fifo->root.next) + fifo->last = &fifo->root; + tmp = fifo->root.next->next; + av_free(fifo->root.next); + fifo->root.next = tmp; + + return 0; +} + +AVFilter avfilter_vf_fifo = { + .name = "fifo", + .description = NULL_IF_CONFIG_SMALL("Buffer input images and send them when they are requested."), + + .init = init, + .uninit = uninit, + + .priv_size = sizeof(FifoContext), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer= avfilter_null_get_video_buffer, + .start_frame = start_frame, + .draw_slice = draw_slice, + .end_frame = end_frame, + .rej_perms = AV_PERM_REUSE2, }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .request_frame = request_frame, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_format.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_format.c new file mode 100644 index 00000000..c42e0bb3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_format.c @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2007 Bobby Bingham + * + * 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 + * format and noformat video filters + */ + +#include "libavutil/pixdesc.h" +#include "avfilter.h" + +typedef struct { + /** + * List of flags telling if a given image format has been listed + * as argument to the filter. + */ + int listed_pix_fmt_flags[PIX_FMT_NB]; +} FormatContext; + +#define PIX_FMT_NAME_MAXSIZE 32 + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + FormatContext *format = ctx->priv; + const char *cur, *sep; + char pix_fmt_name[PIX_FMT_NAME_MAXSIZE]; + int pix_fmt_name_len; + enum PixelFormat pix_fmt; + + /* parse the list of formats */ + for (cur = args; cur; cur = sep ? sep+1 : NULL) { + if (!(sep = strchr(cur, ':'))) + pix_fmt_name_len = strlen(cur); + else + pix_fmt_name_len = sep - cur; + if (pix_fmt_name_len >= PIX_FMT_NAME_MAXSIZE) { + av_log(ctx, AV_LOG_ERROR, "Format name too long\n"); + return -1; + } + + memcpy(pix_fmt_name, cur, pix_fmt_name_len); + pix_fmt_name[pix_fmt_name_len] = 0; + pix_fmt = av_get_pix_fmt(pix_fmt_name); + + if (pix_fmt == PIX_FMT_NONE) { + av_log(ctx, AV_LOG_ERROR, "Unknown pixel format: %s\n", pix_fmt_name); + return -1; + } + + format->listed_pix_fmt_flags[pix_fmt] = 1; + } + + return 0; +} + +static AVFilterFormats *make_format_list(FormatContext *format, int flag) +{ + AVFilterFormats *formats; + enum PixelFormat pix_fmt; + + formats = av_mallocz(sizeof(AVFilterFormats)); + formats->formats = av_malloc(sizeof(enum PixelFormat) * PIX_FMT_NB); + + for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) + if (format->listed_pix_fmt_flags[pix_fmt] == flag) + formats->formats[formats->format_count++] = pix_fmt; + + return formats; +} + +#if CONFIG_FORMAT_FILTER +static int query_formats_format(AVFilterContext *ctx) +{ + avfilter_set_common_formats(ctx, make_format_list(ctx->priv, 1)); + return 0; +} + +AVFilter avfilter_vf_format = { + .name = "format", + .description = NULL_IF_CONFIG_SMALL("Convert the input video to one of the specified pixel formats."), + + .init = init, + + .query_formats = query_formats_format, + + .priv_size = sizeof(FormatContext), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer= avfilter_null_get_video_buffer, + .start_frame = avfilter_null_start_frame, + .draw_slice = avfilter_null_draw_slice, + .end_frame = avfilter_null_end_frame, }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO }, + { .name = NULL}}, +}; +#endif /* CONFIG_FORMAT_FILTER */ + +#if CONFIG_NOFORMAT_FILTER +static int query_formats_noformat(AVFilterContext *ctx) +{ + avfilter_set_common_formats(ctx, make_format_list(ctx->priv, 0)); + return 0; +} + +AVFilter avfilter_vf_noformat = { + .name = "noformat", + .description = NULL_IF_CONFIG_SMALL("Force libavfilter not to use any of the specified pixel formats for the input to the next filter."), + + .init = init, + + .query_formats = query_formats_noformat, + + .priv_size = sizeof(FormatContext), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer= avfilter_null_get_video_buffer, + .start_frame = avfilter_null_start_frame, + .draw_slice = avfilter_null_draw_slice, + .end_frame = avfilter_null_end_frame, }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO }, + { .name = NULL}}, +}; +#endif /* CONFIG_NOFORMAT_FILTER */ + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_frei0r.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_frei0r.c new file mode 100644 index 00000000..03d4f28f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_frei0r.c @@ -0,0 +1,464 @@ +/* + * Copyright (c) 2010 Stefano Sabatini + * 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 + * frei0r wrapper + */ + +/* #define DEBUG */ + +#include +#include +#include "libavutil/avstring.h" +#include "libavcore/imgutils.h" +#include "libavcore/parseutils.h" +#include "avfilter.h" + +typedef f0r_instance_t (*f0r_construct_f)(unsigned int width, unsigned int height); +typedef void (*f0r_destruct_f)(f0r_instance_t instance); +typedef void (*f0r_deinit_f)(void); +typedef int (*f0r_init_f)(void); +typedef void (*f0r_get_plugin_info_f)(f0r_plugin_info_t *info); +typedef void (*f0r_get_param_info_f)(f0r_param_info_t *info, int param_index); +typedef void (*f0r_update_f)(f0r_instance_t instance, double time, const uint32_t *inframe, uint32_t *outframe); +typedef void (*f0r_update2_f)(f0r_instance_t instance, double time, const uint32_t *inframe1, const uint32_t *inframe2, const uint32_t *inframe3, uint32_t *outframe); +typedef void (*f0r_set_param_value_f)(f0r_instance_t instance, f0r_param_t param, int param_index); +typedef void (*f0r_get_param_value_f)(f0r_instance_t instance, f0r_param_t param, int param_index); + +typedef struct Frei0rContext { + f0r_update_f update; + void *dl_handle; /* dynamic library handle */ + f0r_instance_t instance; + f0r_plugin_info_t plugin_info; + + f0r_get_param_info_f get_param_info; + f0r_get_param_value_f get_param_value; + f0r_set_param_value_f set_param_value; + f0r_construct_f construct; + f0r_destruct_f destruct; + f0r_deinit_f deinit; + char params[256]; + + /* only used by the source */ + int w, h; + AVRational time_base; + uint64_t pts; +} Frei0rContext; + +static void *load_sym(AVFilterContext *ctx, const char *sym_name) +{ + Frei0rContext *frei0r = ctx->priv; + void *sym = dlsym(frei0r->dl_handle, sym_name); + if (!sym) + av_log(ctx, AV_LOG_ERROR, "Could not find symbol '%s' in loaded module\n", sym_name); + return sym; +} + +static int set_param(AVFilterContext *ctx, f0r_param_info_t info, int index, char *param) +{ + Frei0rContext *frei0r = ctx->priv; + union { + double d; + f0r_param_color_t col; + f0r_param_position_t pos; + } val; + char *tail; + uint8_t rgba[4]; + + switch (info.type) { + case F0R_PARAM_BOOL: + if (!strcmp(param, "y")) val.d = 1.0; + else if (!strcmp(param, "n")) val.d = 0.0; + else goto fail; + break; + + case F0R_PARAM_DOUBLE: + val.d = strtod(param, &tail); + if (*tail || val.d == HUGE_VAL) + goto fail; + break; + + case F0R_PARAM_COLOR: + if (sscanf(param, "%f/%f/%f", &val.col.r, &val.col.g, &val.col.b) != 3) { + if (av_parse_color(rgba, param, -1, ctx) < 0) + goto fail; + val.col.r = rgba[0] / 255.0; + val.col.g = rgba[1] / 255.0; + val.col.b = rgba[2] / 255.0; + } + break; + + case F0R_PARAM_POSITION: + if (sscanf(param, "%lf/%lf", &val.pos.x, &val.pos.y) != 2) + goto fail; + break; + } + + frei0r->set_param_value(frei0r->instance, &val, index); + return 0; + +fail: + av_log(ctx, AV_LOG_ERROR, "Invalid value '%s' for parameter '%s'\n", + param, info.name); + return AVERROR(EINVAL); +} + +static int set_params(AVFilterContext *ctx, const char *params) +{ + Frei0rContext *frei0r = ctx->priv; + int i; + + for (i = 0; i < frei0r->plugin_info.num_params; i++) { + f0r_param_info_t info; + char *param; + int ret; + + frei0r->get_param_info(&info, i); + + if (*params) { + if (!(param = av_get_token(¶ms, ":"))) + return AVERROR(ENOMEM); + params++; /* skip ':' */ + ret = set_param(ctx, info, i, param); + av_free(param); + if (ret < 0) + return ret; + } + + av_log(ctx, AV_LOG_INFO, + "idx:%d name:'%s' type:%s explanation:'%s' ", + i, info.name, + info.type == F0R_PARAM_BOOL ? "bool" : + info.type == F0R_PARAM_DOUBLE ? "double" : + info.type == F0R_PARAM_COLOR ? "color" : + info.type == F0R_PARAM_POSITION ? "position" : + info.type == F0R_PARAM_STRING ? "string" : "unknown", + info.explanation); + +#ifdef DEBUG + av_log(ctx, AV_LOG_INFO, "value:"); + switch (info.type) { + void *v; + double d; + char s[128]; + f0r_param_color_t col; + f0r_param_position_t pos; + + case F0R_PARAM_BOOL: + v = &d; + frei0r->get_param_value(frei0r->instance, v, i); + av_log(ctx, AV_LOG_INFO, "%s", d >= 0.5 && d <= 1.0 ? "y" : "n"); + break; + case F0R_PARAM_DOUBLE: + v = &d; + frei0r->get_param_value(frei0r->instance, v, i); + av_log(ctx, AV_LOG_INFO, "%f", d); + break; + case F0R_PARAM_COLOR: + v = &col; + frei0r->get_param_value(frei0r->instance, v, i); + av_log(ctx, AV_LOG_INFO, "%f/%f/%f", col.r, col.g, col.b); + break; + case F0R_PARAM_POSITION: + v = &pos; + frei0r->get_param_value(frei0r->instance, v, i); + av_log(ctx, AV_LOG_INFO, "%lf/%lf", pos.x, pos.y); + break; + default: /* F0R_PARAM_STRING */ + v = s; + frei0r->get_param_value(frei0r->instance, v, i); + av_log(ctx, AV_LOG_INFO, "'%s'\n", s); + break; + } +#endif + av_log(ctx, AV_LOG_INFO, "\n"); + } + + return 0; +} + +static void *load_path(AVFilterContext *ctx, const char *prefix, const char *name) +{ + char path[1024]; + + snprintf(path, sizeof(path), "%s%s%s", prefix, name, SLIBSUF); + av_log(ctx, AV_LOG_DEBUG, "Looking for frei0r effect in '%s'\n", path); + return dlopen(path, RTLD_NOW|RTLD_LOCAL); +} + +static av_cold int frei0r_init(AVFilterContext *ctx, + const char *dl_name, int type) +{ + Frei0rContext *frei0r = ctx->priv; + f0r_init_f f0r_init; + f0r_get_plugin_info_f f0r_get_plugin_info; + f0r_plugin_info_t *pi; + char *path; + + /* see: http://piksel.org/frei0r/1.2/spec/1.2/spec/group__pluglocations.html */ + if ((path = av_strdup(getenv("FREI0R_PATH")))) { + char *p, *ptr = NULL; + for (p = path; p = strtok_r(p, ":", &ptr); p = NULL) + if (frei0r->dl_handle = load_path(ctx, p, dl_name)) + break; + av_free(path); + } + if (!frei0r->dl_handle && (path = getenv("HOME"))) { + char prefix[1024]; + snprintf(prefix, sizeof(prefix), "%s/.frei0r-1/lib/", path); + frei0r->dl_handle = load_path(ctx, prefix, dl_name); + } + if (!frei0r->dl_handle) + frei0r->dl_handle = load_path(ctx, "/usr/local/lib/frei0r-1/", dl_name); + if (!frei0r->dl_handle) + frei0r->dl_handle = load_path(ctx, "/usr/lib/frei0r-1/", dl_name); + if (!frei0r->dl_handle) { + av_log(ctx, AV_LOG_ERROR, "Could not find module '%s'\n", dl_name); + return AVERROR(EINVAL); + } + + if (!(f0r_init = load_sym(ctx, "f0r_init" )) || + !(f0r_get_plugin_info = load_sym(ctx, "f0r_get_plugin_info")) || + !(frei0r->get_param_info = load_sym(ctx, "f0r_get_param_info" )) || + !(frei0r->get_param_value = load_sym(ctx, "f0r_get_param_value")) || + !(frei0r->set_param_value = load_sym(ctx, "f0r_set_param_value")) || + !(frei0r->update = load_sym(ctx, "f0r_update" )) || + !(frei0r->construct = load_sym(ctx, "f0r_construct" )) || + !(frei0r->destruct = load_sym(ctx, "f0r_destruct" )) || + !(frei0r->deinit = load_sym(ctx, "f0r_deinit" ))) + return AVERROR(EINVAL); + + if (f0r_init() < 0) { + av_log(ctx, AV_LOG_ERROR, "Could not init the frei0r module"); + return AVERROR(EINVAL); + } + + f0r_get_plugin_info(&frei0r->plugin_info); + pi = &frei0r->plugin_info; + if (pi->plugin_type != type) { + av_log(ctx, AV_LOG_ERROR, + "Invalid type '%s' for the plugin\n", + pi->plugin_type == F0R_PLUGIN_TYPE_FILTER ? "filter" : + pi->plugin_type == F0R_PLUGIN_TYPE_SOURCE ? "source" : + pi->plugin_type == F0R_PLUGIN_TYPE_MIXER2 ? "mixer2" : + pi->plugin_type == F0R_PLUGIN_TYPE_MIXER3 ? "mixer3" : "unknown"); + return AVERROR(EINVAL); + } + + av_log(ctx, AV_LOG_INFO, + "name:%s author:'%s' explanation:'%s' color_model:%s " + "frei0r_version:%d version:%d.%d num_params:%d\n", + pi->name, pi->author, pi->explanation, + pi->color_model == F0R_COLOR_MODEL_BGRA8888 ? "bgra8888" : + pi->color_model == F0R_COLOR_MODEL_RGBA8888 ? "rgba8888" : + pi->color_model == F0R_COLOR_MODEL_PACKED32 ? "packed32" : "unknown", + pi->frei0r_version, pi->major_version, pi->minor_version, pi->num_params); + + return 0; +} + +static av_cold int filter_init(AVFilterContext *ctx, const char *args, void *opaque) +{ + Frei0rContext *frei0r = ctx->priv; + char dl_name[1024], c; + *frei0r->params = 0; + + if (args) + sscanf(args, "%1023[^:=]%c%255c", dl_name, &c, frei0r->params); + + return frei0r_init(ctx, dl_name, F0R_PLUGIN_TYPE_FILTER); +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + Frei0rContext *frei0r = ctx->priv; + + if (frei0r->destruct && frei0r->instance) + frei0r->destruct(frei0r->instance); + if (frei0r->deinit) + frei0r->deinit(); + if (frei0r->dl_handle) + dlclose(frei0r->dl_handle); + + memset(frei0r, 0, sizeof(*frei0r)); +} + +static int config_input_props(AVFilterLink *inlink) +{ + AVFilterContext *ctx = inlink->dst; + Frei0rContext *frei0r = ctx->priv; + + if (!(frei0r->instance = frei0r->construct(inlink->w, inlink->h))) { + av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance"); + return AVERROR(EINVAL); + } + + return set_params(ctx, frei0r->params); +} + +static int query_formats(AVFilterContext *ctx) +{ + Frei0rContext *frei0r = ctx->priv; + AVFilterFormats *formats = NULL; + + if (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_BGRA8888) { + avfilter_add_format(&formats, PIX_FMT_BGRA); + } else if (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_RGBA8888) { + avfilter_add_format(&formats, PIX_FMT_RGBA); + } else { /* F0R_COLOR_MODEL_PACKED32 */ + static const enum PixelFormat pix_fmts[] = { + PIX_FMT_BGRA, PIX_FMT_ARGB, PIX_FMT_ABGR, PIX_FMT_ARGB, PIX_FMT_NONE + }; + formats = avfilter_make_format_list(pix_fmts); + } + + if (!formats) + return AVERROR(ENOMEM); + + avfilter_set_common_formats(ctx, formats); + return 0; +} + +static void null_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) { } + +static void end_frame(AVFilterLink *inlink) +{ + Frei0rContext *frei0r = inlink->dst->priv; + AVFilterLink *outlink = inlink->dst->outputs[0]; + AVFilterBufferRef *inpicref = inlink->cur_buf; + AVFilterBufferRef *outpicref = outlink->out_buf; + + frei0r->update(frei0r->instance, inpicref->pts * av_q2d(inlink->time_base) * 1000, + (const uint32_t *)inpicref->data[0], + (uint32_t *)outpicref->data[0]); + avfilter_unref_buffer(inpicref); + avfilter_draw_slice(outlink, 0, outlink->h, 1); + avfilter_end_frame(outlink); + avfilter_unref_buffer(outpicref); +} + +AVFilter avfilter_vf_frei0r = { + .name = "frei0r", + .description = NULL_IF_CONFIG_SMALL("Apply a frei0r effect."), + + .query_formats = query_formats, + .init = filter_init, + .uninit = uninit, + + .priv_size = sizeof(Frei0rContext), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .draw_slice = null_draw_slice, + .config_props = config_input_props, + .end_frame = end_frame, + .min_perms = AV_PERM_READ }, + { .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; + +static av_cold int source_init(AVFilterContext *ctx, const char *args, void *opaque) +{ + Frei0rContext *frei0r = ctx->priv; + char dl_name[1024], c; + char frame_size[128] = ""; + char frame_rate[128] = ""; + AVRational frame_rate_q; + + memset(frei0r->params, 0, sizeof(frei0r->params)); + + if (args) + sscanf(args, "%127[^:]:%127[^:]:%1023[^:=]%c%255c", + frame_size, frame_rate, dl_name, &c, frei0r->params); + + if (av_parse_video_size(&frei0r->w, &frei0r->h, frame_size) < 0) { + av_log(ctx, AV_LOG_ERROR, "Invalid frame size: '%s'\n", frame_size); + return AVERROR(EINVAL); + } + + if (av_parse_video_rate(&frame_rate_q, frame_rate) < 0 || + frame_rate_q.den <= 0 || frame_rate_q.num <= 0) { + av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: '%s'\n", frame_rate); + return AVERROR(EINVAL); + } + frei0r->time_base.num = frame_rate_q.den; + frei0r->time_base.den = frame_rate_q.num; + + return frei0r_init(ctx, dl_name, F0R_PLUGIN_TYPE_SOURCE); +} + +static int source_config_props(AVFilterLink *outlink) +{ + AVFilterContext *ctx = outlink->src; + Frei0rContext *frei0r = ctx->priv; + + if (av_image_check_size(frei0r->w, frei0r->h, 0, ctx) < 0) + return AVERROR(EINVAL); + outlink->w = frei0r->w; + outlink->h = frei0r->h; + outlink->time_base = frei0r->time_base; + + if (!(frei0r->instance = frei0r->construct(outlink->w, outlink->h))) { + av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance"); + return AVERROR(EINVAL); + } + + return set_params(ctx, frei0r->params); +} + +static int source_request_frame(AVFilterLink *outlink) +{ + Frei0rContext *frei0r = outlink->src->priv; + AVFilterBufferRef *picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); + picref->video->pixel_aspect = (AVRational) {1, 1}; + picref->pts = frei0r->pts++; + picref->pos = -1; + + avfilter_start_frame(outlink, avfilter_ref_buffer(picref, ~0)); + frei0r->update(frei0r->instance, av_rescale_q(picref->pts, frei0r->time_base, (AVRational){1,1000}), + NULL, (uint32_t *)picref->data[0]); + avfilter_draw_slice(outlink, 0, outlink->h, 1); + avfilter_end_frame(outlink); + avfilter_unref_buffer(picref); + + return 0; +} + +AVFilter avfilter_vsrc_frei0r_src = { + .name = "frei0r_src", + .description = NULL_IF_CONFIG_SMALL("Generate a frei0r source."), + + .priv_size = sizeof(Frei0rContext), + .init = source_init, + .uninit = uninit, + + .query_formats = query_formats, + + .inputs = (AVFilterPad[]) {{ .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .request_frame = source_request_frame, + .config_props = source_config_props }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_gradfun.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_gradfun.c new file mode 100644 index 00000000..3a400a04 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_gradfun.c @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2010 Nolan Lum + * Copyright (c) 2009 Loren Merritt + * + * 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 + * gradfun debanding filter, ported from MPlayer + * libmpcodecs/vf_gradfun.c + * + * Apply a boxblur debanding algorithm (based on the gradfun2db + * Avisynth filter by prunedtree). + * Foreach pixel, if it's within threshold of the blurred value, make it closer. + * So now we have a smoothed and higher bitdepth version of all the shallow + * gradients, while leaving detailed areas untouched. + * Dither it back to 8bit. + */ + +#include "libavcore/imgutils.h" +#include "libavutil/cpu.h" +#include "libavutil/pixdesc.h" +#include "avfilter.h" +#include "gradfun.h" + +DECLARE_ALIGNED(16, static const uint16_t, dither)[8][8] = { + {0x00,0x60,0x18,0x78,0x06,0x66,0x1E,0x7E}, + {0x40,0x20,0x58,0x38,0x46,0x26,0x5E,0x3E}, + {0x10,0x70,0x08,0x68,0x16,0x76,0x0E,0x6E}, + {0x50,0x30,0x48,0x28,0x56,0x36,0x4E,0x2E}, + {0x04,0x64,0x1C,0x7C,0x02,0x62,0x1A,0x7A}, + {0x44,0x24,0x5C,0x3C,0x42,0x22,0x5A,0x3A}, + {0x14,0x74,0x0C,0x6C,0x12,0x72,0x0A,0x6A}, + {0x54,0x34,0x4C,0x2C,0x52,0x32,0x4A,0x2A}, +}; + +void ff_gradfun_filter_line_c(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers) +{ + int x; + for (x = 0; x < width; x++, dc += x & 1) { + int pix = src[x] << 7; + int delta = dc[0] - pix; + int m = abs(delta) * thresh >> 16; + m = FFMAX(0, 127 - m); + m = m * m * delta >> 14; + pix += m + dithers[x & 7]; + dst[x] = av_clip_uint8(pix >> 7); + } +} + +void ff_gradfun_blur_line_c(uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width) +{ + int x, v, old; + for (x = 0; x < width; x++) { + v = buf1[x] + src[2 * x] + src[2 * x + 1] + src[2 * x + src_linesize] + src[2 * x + 1 + src_linesize]; + old = buf[x]; + buf[x] = v; + dc[x] = v - old; + } +} + +static void filter(GradFunContext *ctx, uint8_t *dst, uint8_t *src, int width, int height, int dst_linesize, int src_linesize, int r) +{ + int bstride = FFALIGN(width, 16) / 2; + int y; + uint32_t dc_factor = (1 << 21) / (r * r); + uint16_t *dc = ctx->buf + 16; + uint16_t *buf = ctx->buf + bstride + 32; + int thresh = ctx->thresh; + + memset(dc, 0, (bstride + 16) * sizeof(*buf)); + for (y = 0; y < r; y++) + ctx->blur_line(dc, buf + y * bstride, buf + (y - 1) * bstride, src + 2 * y * src_linesize, src_linesize, width / 2); + for (;;) { + if (y < height - r) { + int mod = ((y + r) / 2) % r; + uint16_t *buf0 = buf + mod * bstride; + uint16_t *buf1 = buf + (mod ? mod - 1 : r - 1) * bstride; + int x, v; + ctx->blur_line(dc, buf0, buf1, src + (y + r) * src_linesize, src_linesize, width / 2); + for (x = v = 0; x < r; x++) + v += dc[x]; + for (; x < width / 2; x++) { + v += dc[x] - dc[x-r]; + dc[x-r] = v * dc_factor >> 16; + } + for (; x < (width + r + 1) / 2; x++) + dc[x-r] = v * dc_factor >> 16; + for (x = -r / 2; x < 0; x++) + dc[x] = dc[0]; + } + if (y == r) { + for (y = 0; y < r; y++) + ctx->filter_line(dst + y * dst_linesize, src + y * src_linesize, dc - r / 2, width, thresh, dither[y & 7]); + } + ctx->filter_line(dst + y * dst_linesize, src + y * src_linesize, dc - r / 2, width, thresh, dither[y & 7]); + if (++y >= height) break; + ctx->filter_line(dst + y * dst_linesize, src + y * src_linesize, dc - r / 2, width, thresh, dither[y & 7]); + if (++y >= height) break; + } +} + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + GradFunContext *gf = ctx->priv; + float thresh = 1.2; + int radius = 16; + av_unused int cpu_flags = av_get_cpu_flags(); + + if (args) + sscanf(args, "%f:%d", &thresh, &radius); + + thresh = av_clipf(thresh, 0.51, 255); + gf->thresh = (1 << 15) / thresh; + gf->radius = av_clip((radius + 1) & ~1, 4, 32); + + gf->blur_line = ff_gradfun_blur_line_c; + gf->filter_line = ff_gradfun_filter_line_c; + + if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX2) + gf->filter_line = ff_gradfun_filter_line_mmx2; + if (HAVE_SSSE3 && cpu_flags & AV_CPU_FLAG_SSSE3) + gf->filter_line = ff_gradfun_filter_line_ssse3; + if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2) + gf->blur_line = ff_gradfun_blur_line_sse2; + + av_log(ctx, AV_LOG_INFO, "threshold:%.2f radius:%d\n", thresh, gf->radius); + + return 0; +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + GradFunContext *gf = ctx->priv; + av_freep(&gf->buf); +} + +static int query_formats(AVFilterContext *ctx) +{ + static const enum PixelFormat pix_fmts[] = { + PIX_FMT_YUV410P, PIX_FMT_YUV420P, + PIX_FMT_GRAY8, PIX_FMT_NV12, + PIX_FMT_NV21, PIX_FMT_YUV444P, + PIX_FMT_YUV422P, PIX_FMT_YUV411P, + PIX_FMT_NONE + }; + + avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + + return 0; +} + +static int config_input(AVFilterLink *inlink) +{ + GradFunContext *gf = inlink->dst->priv; + int hsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_w; + int vsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_h; + + gf->buf = av_mallocz((FFALIGN(inlink->w, 16) * (gf->radius + 1) / 2 + 32) * sizeof(uint16_t)); + if (!gf->buf) + return AVERROR(ENOMEM); + + gf->chroma_w = -((-inlink->w) >> hsub); + gf->chroma_h = -((-inlink->h) >> vsub); + gf->chroma_r = av_clip(((((gf->radius >> hsub) + (gf->radius >> vsub)) / 2 ) + 1) & ~1, 4, 32); + + return 0; +} + +static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) +{ + AVFilterLink *outlink = inlink->dst->outputs[0]; + AVFilterBufferRef *outpicref; + + if (inpicref->perms & AV_PERM_PRESERVE) { + outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); + avfilter_copy_buffer_ref_props(outpicref, inpicref); + outpicref->video->w = outlink->w; + outpicref->video->h = outlink->h; + } else + outpicref = inpicref; + + outlink->out_buf = outpicref; + avfilter_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0)); +} + +static void null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { } + +static void end_frame(AVFilterLink *inlink) +{ + GradFunContext *gf = inlink->dst->priv; + AVFilterBufferRef *inpic = inlink->cur_buf; + AVFilterLink *outlink = inlink->dst->outputs[0]; + AVFilterBufferRef *outpic = outlink->out_buf; + int p; + + for (p = 0; p < 4 && inpic->data[p]; p++) { + int w = inlink->w; + int h = inlink->h; + int r = gf->radius; + if (p) { + w = gf->chroma_w; + h = gf->chroma_h; + r = gf->chroma_r; + } + + if (FFMIN(w, h) > 2 * r) + filter(gf, outpic->data[p], inpic->data[p], w, h, outpic->linesize[p], inpic->linesize[p], r); + else if (outpic->data[p] != inpic->data[p]) + av_image_copy_plane(outpic->data[p], outpic->linesize[p], inpic->data[p], inpic->linesize[p], w, h); + } + + avfilter_draw_slice(outlink, 0, inlink->h, 1); + avfilter_end_frame(outlink); + avfilter_unref_buffer(inpic); + if (outpic != inpic) + avfilter_unref_buffer(outpic); +} + +AVFilter avfilter_vf_gradfun = { + .name = "gradfun", + .description = NULL_IF_CONFIG_SMALL("Debands video quickly using gradients."), + .priv_size = sizeof(GradFunContext), + .init = init, + .uninit = uninit, + .query_formats = query_formats, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input, + .start_frame = start_frame, + .draw_slice = null_draw_slice, + .end_frame = end_frame, + .min_perms = AV_PERM_READ, }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_hflip.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_hflip.c new file mode 100644 index 00000000..4deb14a5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_hflip.c @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2007 Benoit Fouet + * Copyright (c) 2010 Stefano Sabatini + * + * 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 + * horizontal flip filter + */ + +#include "avfilter.h" +#include "libavutil/pixdesc.h" +#include "libavutil/intreadwrite.h" +#include "libavcore/imgutils.h" + +typedef struct { + int max_step[4]; ///< max pixel step for each plane, expressed as a number of bytes + int hsub, vsub; ///< chroma subsampling +} FlipContext; + +static int query_formats(AVFilterContext *ctx) +{ + static const enum PixelFormat pix_fmts[] = { + PIX_FMT_RGB48BE, PIX_FMT_RGB48LE, + PIX_FMT_ARGB, PIX_FMT_RGBA, + PIX_FMT_ABGR, PIX_FMT_BGRA, + PIX_FMT_RGB24, PIX_FMT_BGR24, + PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, + PIX_FMT_RGB555BE, PIX_FMT_RGB555LE, + PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, + PIX_FMT_BGR555BE, PIX_FMT_BGR555LE, + PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE, + PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE, + PIX_FMT_YUV422P16LE, PIX_FMT_YUV422P16BE, + PIX_FMT_YUV444P16LE, PIX_FMT_YUV444P16BE, + PIX_FMT_YUV444P, PIX_FMT_YUV422P, + PIX_FMT_YUV420P, PIX_FMT_YUV411P, + PIX_FMT_YUV410P, PIX_FMT_YUV440P, + PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, + PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P, + PIX_FMT_YUVA420P, + PIX_FMT_RGB8, PIX_FMT_BGR8, + PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, + PIX_FMT_PAL8, PIX_FMT_GRAY8, + PIX_FMT_NONE + }; + + avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + return 0; +} + +static int config_props(AVFilterLink *inlink) +{ + FlipContext *flip = inlink->dst->priv; + const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[inlink->format]; + + av_image_fill_max_pixsteps(flip->max_step, NULL, pix_desc); + flip->hsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_w; + flip->vsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_h; + + return 0; +} + +static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) +{ + FlipContext *flip = inlink->dst->priv; + AVFilterBufferRef *inpic = inlink->cur_buf; + AVFilterBufferRef *outpic = inlink->dst->outputs[0]->out_buf; + uint8_t *inrow, *outrow; + int i, j, plane, step, hsub, vsub; + + for (plane = 0; plane < 4 && inpic->data[plane]; plane++) { + step = flip->max_step[plane]; + hsub = (plane == 1 || plane == 2) ? flip->hsub : 0; + vsub = (plane == 1 || plane == 2) ? flip->vsub : 0; + + outrow = outpic->data[plane] + (y>>vsub) * outpic->linesize[plane]; + inrow = inpic ->data[plane] + (y>>vsub) * inpic ->linesize[plane] + ((inlink->w >> hsub) - 1) * step; + for (i = 0; i < h>>vsub; i++) { + switch (step) { + case 1: + { + for (j = 0; j < (inlink->w >> hsub); j++) + outrow[j] = inrow[-j]; + } + break; + + case 2: + { + uint16_t *outrow16 = (uint16_t *)outrow; + uint16_t * inrow16 = (uint16_t *) inrow; + for (j = 0; j < (inlink->w >> hsub); j++) + outrow16[j] = inrow16[-j]; + } + break; + + case 3: + { + uint8_t *in = inrow; + uint8_t *out = outrow; + for (j = 0; j < (inlink->w >> hsub); j++, out += 3, in -= 3) { + int32_t v = AV_RB24(in); + AV_WB24(out, v); + } + } + break; + + case 4: + { + uint32_t *outrow32 = (uint32_t *)outrow; + uint32_t * inrow32 = (uint32_t *) inrow; + for (j = 0; j < (inlink->w >> hsub); j++) + outrow32[j] = inrow32[-j]; + } + break; + + default: + for (j = 0; j < (inlink->w >> hsub); j++) + memcpy(outrow + j*step, inrow - j*step, step); + } + + inrow += inpic ->linesize[plane]; + outrow += outpic->linesize[plane]; + } + } + + avfilter_draw_slice(inlink->dst->outputs[0], y, h, slice_dir); +} + +AVFilter avfilter_vf_hflip = { + .name = "hflip", + .description = NULL_IF_CONFIG_SMALL("Horizontally flip the input video."), + .priv_size = sizeof(FlipContext), + .query_formats = query_formats, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .draw_slice = draw_slice, + .config_props = config_props, + .min_perms = AV_PERM_READ, }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_hqdn3d.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_hqdn3d.c new file mode 100644 index 00000000..78a7bf71 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_hqdn3d.c @@ -0,0 +1,345 @@ +/* + * Copyright (c) 2003 Daniel Moreno + * Copyright (c) 2010 Baptiste Coudurier + * + * This file is part of FFmpeg, ported from MPlayer. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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 General Public License for more details. + * + * You should have received a copy of the GNU 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 + * high quality 3d video denoiser, ported from MPlayer + * libmpcodecs/vf_hqdn3d.c. + */ + +#include "libavutil/pixdesc.h" +#include "avfilter.h" + +typedef struct { + int Coefs[4][512*16]; + unsigned int *Line; + unsigned short *Frame[3]; + int hsub, vsub; +} HQDN3DContext; + +static inline unsigned int LowPassMul(unsigned int PrevMul, unsigned int CurrMul, int *Coef) +{ + // int dMul= (PrevMul&0xFFFFFF)-(CurrMul&0xFFFFFF); + int dMul= PrevMul-CurrMul; + unsigned int d=((dMul+0x10007FF)>>12); + return CurrMul + Coef[d]; +} + +static void deNoiseTemporal(unsigned char *FrameSrc, + unsigned char *FrameDest, + unsigned short *FrameAnt, + int W, int H, int sStride, int dStride, + int *Temporal) +{ + long X, Y; + unsigned int PixelDst; + + for (Y = 0; Y < H; Y++) { + for (X = 0; X < W; X++) { + PixelDst = LowPassMul(FrameAnt[X]<<8, FrameSrc[X]<<16, Temporal); + FrameAnt[X] = ((PixelDst+0x1000007F)>>8); + FrameDest[X]= ((PixelDst+0x10007FFF)>>16); + } + FrameSrc += sStride; + FrameDest += dStride; + FrameAnt += W; + } +} + +static void deNoiseSpacial(unsigned char *Frame, + unsigned char *FrameDest, + unsigned int *LineAnt, + int W, int H, int sStride, int dStride, + int *Horizontal, int *Vertical) +{ + long X, Y; + long sLineOffs = 0, dLineOffs = 0; + unsigned int PixelAnt; + unsigned int PixelDst; + + /* First pixel has no left nor top neighbor. */ + PixelDst = LineAnt[0] = PixelAnt = Frame[0]<<16; + FrameDest[0]= ((PixelDst+0x10007FFF)>>16); + + /* First line has no top neighbor, only left. */ + for (X = 1; X < W; X++) { + PixelDst = LineAnt[X] = LowPassMul(PixelAnt, Frame[X]<<16, Horizontal); + FrameDest[X]= ((PixelDst+0x10007FFF)>>16); + } + + for (Y = 1; Y < H; Y++) { + unsigned int PixelAnt; + sLineOffs += sStride, dLineOffs += dStride; + /* First pixel on each line doesn't have previous pixel */ + PixelAnt = Frame[sLineOffs]<<16; + PixelDst = LineAnt[0] = LowPassMul(LineAnt[0], PixelAnt, Vertical); + FrameDest[dLineOffs]= ((PixelDst+0x10007FFF)>>16); + + for (X = 1; X < W; X++) { + unsigned int PixelDst; + /* The rest are normal */ + PixelAnt = LowPassMul(PixelAnt, Frame[sLineOffs+X]<<16, Horizontal); + PixelDst = LineAnt[X] = LowPassMul(LineAnt[X], PixelAnt, Vertical); + FrameDest[dLineOffs+X]= ((PixelDst+0x10007FFF)>>16); + } + } +} + +static void deNoise(unsigned char *Frame, + unsigned char *FrameDest, + unsigned int *LineAnt, + unsigned short **FrameAntPtr, + int W, int H, int sStride, int dStride, + int *Horizontal, int *Vertical, int *Temporal) +{ + long X, Y; + long sLineOffs = 0, dLineOffs = 0; + unsigned int PixelAnt; + unsigned int PixelDst; + unsigned short* FrameAnt=(*FrameAntPtr); + + if (!FrameAnt) { + (*FrameAntPtr) = FrameAnt = av_malloc(W*H*sizeof(unsigned short)); + for (Y = 0; Y < H; Y++) { + unsigned short* dst=&FrameAnt[Y*W]; + unsigned char* src=Frame+Y*sStride; + for (X = 0; X < W; X++) dst[X]=src[X]<<8; + } + } + + if (!Horizontal[0] && !Vertical[0]) { + deNoiseTemporal(Frame, FrameDest, FrameAnt, + W, H, sStride, dStride, Temporal); + return; + } + if (!Temporal[0]) { + deNoiseSpacial(Frame, FrameDest, LineAnt, + W, H, sStride, dStride, Horizontal, Vertical); + return; + } + + /* First pixel has no left nor top neighbor. Only previous frame */ + LineAnt[0] = PixelAnt = Frame[0]<<16; + PixelDst = LowPassMul(FrameAnt[0]<<8, PixelAnt, Temporal); + FrameAnt[0] = ((PixelDst+0x1000007F)>>8); + FrameDest[0]= ((PixelDst+0x10007FFF)>>16); + + /* First line has no top neighbor. Only left one for each pixel and + * last frame */ + for (X = 1; X < W; X++) { + LineAnt[X] = PixelAnt = LowPassMul(PixelAnt, Frame[X]<<16, Horizontal); + PixelDst = LowPassMul(FrameAnt[X]<<8, PixelAnt, Temporal); + FrameAnt[X] = ((PixelDst+0x1000007F)>>8); + FrameDest[X]= ((PixelDst+0x10007FFF)>>16); + } + + for (Y = 1; Y < H; Y++) { + unsigned int PixelAnt; + unsigned short* LinePrev=&FrameAnt[Y*W]; + sLineOffs += sStride, dLineOffs += dStride; + /* First pixel on each line doesn't have previous pixel */ + PixelAnt = Frame[sLineOffs]<<16; + LineAnt[0] = LowPassMul(LineAnt[0], PixelAnt, Vertical); + PixelDst = LowPassMul(LinePrev[0]<<8, LineAnt[0], Temporal); + LinePrev[0] = ((PixelDst+0x1000007F)>>8); + FrameDest[dLineOffs]= ((PixelDst+0x10007FFF)>>16); + + for (X = 1; X < W; X++) { + unsigned int PixelDst; + /* The rest are normal */ + PixelAnt = LowPassMul(PixelAnt, Frame[sLineOffs+X]<<16, Horizontal); + LineAnt[X] = LowPassMul(LineAnt[X], PixelAnt, Vertical); + PixelDst = LowPassMul(LinePrev[X]<<8, LineAnt[X], Temporal); + LinePrev[X] = ((PixelDst+0x1000007F)>>8); + FrameDest[dLineOffs+X]= ((PixelDst+0x10007FFF)>>16); + } + } +} + +static void PrecalcCoefs(int *Ct, double Dist25) +{ + int i; + double Gamma, Simil, C; + + Gamma = log(0.25) / log(1.0 - Dist25/255.0 - 0.00001); + + for (i = -255*16; i <= 255*16; i++) { + Simil = 1.0 - FFABS(i) / (16*255.0); + C = pow(Simil, Gamma) * 65536.0 * i / 16.0; + Ct[16*256+i] = lrint(C); + } + + Ct[0] = !!Dist25; +} + +#define PARAM1_DEFAULT 4.0 +#define PARAM2_DEFAULT 3.0 +#define PARAM3_DEFAULT 6.0 + +static int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + HQDN3DContext *hqdn3d = ctx->priv; + double LumSpac, LumTmp, ChromSpac, ChromTmp; + double Param1, Param2, Param3, Param4; + + LumSpac = PARAM1_DEFAULT; + ChromSpac = PARAM2_DEFAULT; + LumTmp = PARAM3_DEFAULT; + ChromTmp = LumTmp * ChromSpac / LumSpac; + + if (args) { + switch (sscanf(args, "%lf:%lf:%lf:%lf", + &Param1, &Param2, &Param3, &Param4)) { + case 1: + LumSpac = Param1; + ChromSpac = PARAM2_DEFAULT * Param1 / PARAM1_DEFAULT; + LumTmp = PARAM3_DEFAULT * Param1 / PARAM1_DEFAULT; + ChromTmp = LumTmp * ChromSpac / LumSpac; + break; + case 2: + LumSpac = Param1; + ChromSpac = Param2; + LumTmp = PARAM3_DEFAULT * Param1 / PARAM1_DEFAULT; + ChromTmp = LumTmp * ChromSpac / LumSpac; + break; + case 3: + LumSpac = Param1; + ChromSpac = Param2; + LumTmp = Param3; + ChromTmp = LumTmp * ChromSpac / LumSpac; + break; + case 4: + LumSpac = Param1; + ChromSpac = Param2; + LumTmp = Param3; + ChromTmp = Param4; + break; + } + } + + av_log(ctx, AV_LOG_INFO, "ls:%lf cs:%lf lt:%lf ct:%lf\n", + LumSpac, ChromSpac, LumTmp, ChromTmp); + if (LumSpac < 0 || ChromSpac < 0 || isnan(ChromTmp)) { + av_log(ctx, AV_LOG_ERROR, + "Invalid negative value for luma or chroma spatial strength, " + "or resulting value for chroma temporal strength is nan.\n"); + return AVERROR(EINVAL); + } + + PrecalcCoefs(hqdn3d->Coefs[0], LumSpac); + PrecalcCoefs(hqdn3d->Coefs[1], LumTmp); + PrecalcCoefs(hqdn3d->Coefs[2], ChromSpac); + PrecalcCoefs(hqdn3d->Coefs[3], ChromTmp); + + return 0; +} + +static void uninit(AVFilterContext *ctx) +{ + HQDN3DContext *hqdn3d = ctx->priv; + + av_freep(&hqdn3d->Line); + av_freep(&hqdn3d->Frame[0]); + av_freep(&hqdn3d->Frame[1]); + av_freep(&hqdn3d->Frame[2]); +} + +static int query_formats(AVFilterContext *ctx) +{ + static const enum PixelFormat pix_fmts[] = { + PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, PIX_FMT_NONE + }; + + avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + + return 0; +} + +static int config_input(AVFilterLink *inlink) +{ + HQDN3DContext *hqdn3d = inlink->dst->priv; + + hqdn3d->hsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_w; + hqdn3d->vsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_h; + + hqdn3d->Line = av_malloc(inlink->w * sizeof(*hqdn3d->Line)); + if (!hqdn3d->Line) + return AVERROR(ENOMEM); + + return 0; +} + +static void null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { } + +static void end_frame(AVFilterLink *inlink) +{ + HQDN3DContext *hqdn3d = inlink->dst->priv; + AVFilterLink *outlink = inlink->dst->outputs[0]; + AVFilterBufferRef *inpic = inlink ->cur_buf; + AVFilterBufferRef *outpic = outlink->out_buf; + int cw = inpic->video->w >> hqdn3d->hsub; + int ch = inpic->video->h >> hqdn3d->vsub; + + deNoise(inpic->data[0], outpic->data[0], + hqdn3d->Line, &hqdn3d->Frame[0], inpic->video->w, inpic->video->h, + inpic->linesize[0], outpic->linesize[0], + hqdn3d->Coefs[0], + hqdn3d->Coefs[0], + hqdn3d->Coefs[1]); + deNoise(inpic->data[1], outpic->data[1], + hqdn3d->Line, &hqdn3d->Frame[1], cw, ch, + inpic->linesize[1], outpic->linesize[1], + hqdn3d->Coefs[2], + hqdn3d->Coefs[2], + hqdn3d->Coefs[3]); + deNoise(inpic->data[2], outpic->data[2], + hqdn3d->Line, &hqdn3d->Frame[2], cw, ch, + inpic->linesize[2], outpic->linesize[2], + hqdn3d->Coefs[2], + hqdn3d->Coefs[2], + hqdn3d->Coefs[3]); + + avfilter_draw_slice(outlink, 0, inpic->video->h, 1); + avfilter_end_frame(outlink); + avfilter_unref_buffer(inpic); + avfilter_unref_buffer(outpic); +} + +AVFilter avfilter_vf_hqdn3d = { + .name = "hqdn3d", + .description = NULL_IF_CONFIG_SMALL("Apply a High Quality 3D Denoiser."), + + .priv_size = sizeof(HQDN3DContext), + .init = init, + .uninit = uninit, + .query_formats = query_formats, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .draw_slice = null_draw_slice, + .config_props = config_input, + .end_frame = end_frame }, + { .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_libopencv.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_libopencv.c new file mode 100644 index 00000000..8401b4dc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_libopencv.c @@ -0,0 +1,392 @@ +/* + * Copyright (c) 2010 Stefano Sabatini + * + * 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 + * libopencv wrapper functions + */ + +/* #define DEBUG */ + +#include +#include +#include "libavutil/avstring.h" +#include "libavutil/file.h" +#include "avfilter.h" + +static void fill_iplimage_from_picref(IplImage *img, const AVFilterBufferRef *picref, enum PixelFormat pixfmt) +{ + IplImage *tmpimg; + int depth, channels_nb; + + if (pixfmt == PIX_FMT_GRAY8) { depth = IPL_DEPTH_8U; channels_nb = 1; } + else if (pixfmt == PIX_FMT_BGRA) { depth = IPL_DEPTH_8U; channels_nb = 4; } + else if (pixfmt == PIX_FMT_BGR24) { depth = IPL_DEPTH_8U; channels_nb = 3; } + else return; + + tmpimg = cvCreateImageHeader((CvSize){picref->video->w, picref->video->h}, depth, channels_nb); + *img = *tmpimg; + img->imageData = img->imageDataOrigin = picref->data[0]; + img->dataOrder = IPL_DATA_ORDER_PIXEL; + img->origin = IPL_ORIGIN_TL; + img->widthStep = picref->linesize[0]; +} + +static void fill_picref_from_iplimage(AVFilterBufferRef *picref, const IplImage *img, enum PixelFormat pixfmt) +{ + picref->linesize[0] = img->widthStep; + picref->data[0] = img->imageData; +} + +static int query_formats(AVFilterContext *ctx) +{ + static const enum PixelFormat pix_fmts[] = { + PIX_FMT_BGR24, PIX_FMT_BGRA, PIX_FMT_GRAY8, PIX_FMT_NONE + }; + + avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + return 0; +} + +static void null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { } + +typedef struct { + const char *name; + int (*init)(AVFilterContext *ctx, const char *args, void *opaque); + void (*uninit)(AVFilterContext *ctx); + void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg); + void *priv; +} OCVContext; + +typedef struct { + int type; + int param1, param2; + double param3, param4; +} SmoothContext; + +static av_cold int smooth_init(AVFilterContext *ctx, const char *args, void *opaque) +{ + OCVContext *ocv = ctx->priv; + SmoothContext *smooth = ocv->priv; + char type_str[128] = "gaussian"; + + smooth->param1 = 3; + smooth->param2 = 0; + smooth->param3 = 0.0; + smooth->param4 = 0.0; + + if (args) + sscanf(args, "%127[^:]:%d:%d:%lf:%lf", type_str, &smooth->param1, &smooth->param2, &smooth->param3, &smooth->param4); + + if (!strcmp(type_str, "blur" )) smooth->type = CV_BLUR; + else if (!strcmp(type_str, "blur_no_scale")) smooth->type = CV_BLUR_NO_SCALE; + else if (!strcmp(type_str, "median" )) smooth->type = CV_MEDIAN; + else if (!strcmp(type_str, "gaussian" )) smooth->type = CV_GAUSSIAN; + else if (!strcmp(type_str, "bilateral" )) smooth->type = CV_BILATERAL; + else { + av_log(ctx, AV_LOG_ERROR, "Smoothing type '%s' unknown\n.", type_str); + return AVERROR(EINVAL); + } + + if (smooth->param1 < 0 || !(smooth->param1%2)) { + av_log(ctx, AV_LOG_ERROR, + "Invalid value '%d' for param1, it has to be a positive odd number\n", + smooth->param1); + return AVERROR(EINVAL); + } + if ((smooth->type == CV_BLUR || smooth->type == CV_BLUR_NO_SCALE || smooth->type == CV_GAUSSIAN) && + (smooth->param2 < 0 || (smooth->param2 && !(smooth->param2%2)))) { + av_log(ctx, AV_LOG_ERROR, + "Invalid value '%d' for param2, it has to be zero or a positive odd number\n", + smooth->param2); + return AVERROR(EINVAL); + } + + av_log(ctx, AV_LOG_INFO, "type:%s param1:%d param2:%d param3:%f param4:%f\n", + type_str, smooth->param1, smooth->param2, smooth->param3, smooth->param4); + return 0; +} + +static void smooth_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg) +{ + OCVContext *ocv = ctx->priv; + SmoothContext *smooth = ocv->priv; + cvSmooth(inimg, outimg, smooth->type, smooth->param1, smooth->param2, smooth->param3, smooth->param4); +} + +static int read_shape_from_file(int *cols, int *rows, int **values, const char *filename, + void *log_ctx) +{ + uint8_t *buf, *p, *pend; + size_t size; + int ret, i, j, w; + + if ((ret = av_file_map(filename, &buf, &size, 0, log_ctx)) < 0) + return ret; + + /* prescan file to get the number of lines and the maximum width */ + w = 0; + for (i = 0; i < size; i++) { + if (buf[i] == '\n') { + if (*rows == INT_MAX) { + av_log(log_ctx, AV_LOG_ERROR, "Overflow on the number of rows in the file\n"); + return AVERROR_INVALIDDATA; + } + ++(*rows); + *cols = FFMAX(*cols, w); + w = 0; + } else if (w == INT_MAX) { + av_log(log_ctx, AV_LOG_ERROR, "Overflow on the number of columns in the file\n"); + return AVERROR_INVALIDDATA; + } + w++; + } + if (*rows > (FF_INTERNAL_MEM_TYPE_MAX_VALUE / (sizeof(int)) / *cols)) { + av_log(log_ctx, AV_LOG_ERROR, "File with size %dx%d is too big\n", + *rows, *cols); + return AVERROR_INVALIDDATA; + } + if (!(*values = av_mallocz(sizeof(int) * *rows * *cols))) + return AVERROR(ENOMEM); + + /* fill *values */ + p = buf; + pend = buf + size-1; + for (i = 0; i < *rows; i++) { + for (j = 0;; j++) { + if (p > pend || *p == '\n') { + p++; + break; + } else + (*values)[*cols*i + j] = !!isgraph(*(p++)); + } + } + av_file_unmap(buf, size); + +#ifdef DEBUG + { + char *line; + if (!(line = av_malloc(*cols + 1))) + return AVERROR(ENOMEM); + for (i = 0; i < *rows; i++) { + for (j = 0; j < *cols; j++) + line[j] = (*values)[i * *cols + j] ? '@' : ' '; + line[j] = 0; + av_log(log_ctx, AV_LOG_DEBUG, "%3d: %s\n", i, line); + } + av_free(line); + } +#endif + + return 0; +} + +static int parse_iplconvkernel(IplConvKernel **kernel, char *buf, void *log_ctx) +{ + char shape_filename[128] = "", shape_str[32] = "rect"; + int cols = 0, rows = 0, anchor_x = 0, anchor_y = 0, shape = CV_SHAPE_RECT; + int *values = NULL, ret; + + sscanf(buf, "%dx%d+%dx%d/%32[^=]=%127s", &cols, &rows, &anchor_x, &anchor_y, shape_str, shape_filename); + + if (!strcmp(shape_str, "rect" )) shape = CV_SHAPE_RECT; + else if (!strcmp(shape_str, "cross" )) shape = CV_SHAPE_CROSS; + else if (!strcmp(shape_str, "ellipse")) shape = CV_SHAPE_ELLIPSE; + else if (!strcmp(shape_str, "custom" )) { + shape = CV_SHAPE_CUSTOM; + if ((ret = read_shape_from_file(&cols, &rows, &values, shape_filename, log_ctx)) < 0) + return ret; + } else { + av_log(log_ctx, AV_LOG_ERROR, + "Shape unspecified or type '%s' unknown\n.", shape_str); + return AVERROR(EINVAL); + } + + if (rows <= 0 || cols <= 0) { + av_log(log_ctx, AV_LOG_ERROR, + "Invalid non-positive values for shape size %dx%d\n", cols, rows); + return AVERROR(EINVAL); + } + + if (anchor_x < 0 || anchor_y < 0 || anchor_x >= cols || anchor_y >= rows) { + av_log(log_ctx, AV_LOG_ERROR, + "Shape anchor %dx%d is not inside the rectangle with size %dx%d.\n", + anchor_x, anchor_y, cols, rows); + return AVERROR(EINVAL); + } + + *kernel = cvCreateStructuringElementEx(cols, rows, anchor_x, anchor_y, shape, values); + av_freep(&values); + if (!*kernel) + return AVERROR(ENOMEM); + + av_log(log_ctx, AV_LOG_INFO, "Structuring element: w:%d h:%d x:%d y:%d shape:%s\n", + rows, cols, anchor_x, anchor_y, shape_str); + return 0; +} + +typedef struct { + int nb_iterations; + IplConvKernel *kernel; +} DilateContext; + +static av_cold int dilate_init(AVFilterContext *ctx, const char *args, void *opaque) +{ + OCVContext *ocv = ctx->priv; + DilateContext *dilate = ocv->priv; + char default_kernel_str[] = "3x3+0x0/rect"; + char *kernel_str; + const char *buf = args; + int ret; + + dilate->nb_iterations = 1; + + if (args) + kernel_str = av_get_token(&buf, ":"); + if ((ret = parse_iplconvkernel(&dilate->kernel, + *kernel_str ? kernel_str : default_kernel_str, + ctx)) < 0) + return ret; + av_free(kernel_str); + + sscanf(buf, ":%d", &dilate->nb_iterations); + av_log(ctx, AV_LOG_INFO, "iterations_nb:%d\n", dilate->nb_iterations); + if (dilate->nb_iterations <= 0) { + av_log(ctx, AV_LOG_ERROR, "Invalid non-positive value '%d' for nb_iterations\n", + dilate->nb_iterations); + return AVERROR(EINVAL); + } + return 0; +} + +static av_cold void dilate_uninit(AVFilterContext *ctx) +{ + OCVContext *ocv = ctx->priv; + DilateContext *dilate = ocv->priv; + + cvReleaseStructuringElement(&dilate->kernel); +} + +static void dilate_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg) +{ + OCVContext *ocv = ctx->priv; + DilateContext *dilate = ocv->priv; + cvDilate(inimg, outimg, dilate->kernel, dilate->nb_iterations); +} + +static void erode_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg) +{ + OCVContext *ocv = ctx->priv; + DilateContext *dilate = ocv->priv; + cvErode(inimg, outimg, dilate->kernel, dilate->nb_iterations); +} + +typedef struct { + const char *name; + size_t priv_size; + int (*init)(AVFilterContext *ctx, const char *args, void *opaque); + void (*uninit)(AVFilterContext *ctx); + void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg); +} OCVFilterEntry; + +static OCVFilterEntry ocv_filter_entries[] = { + { "dilate", sizeof(DilateContext), dilate_init, dilate_uninit, dilate_end_frame_filter }, + { "erode", sizeof(DilateContext), dilate_init, dilate_uninit, erode_end_frame_filter }, + { "smooth", sizeof(SmoothContext), smooth_init, NULL, smooth_end_frame_filter }, +}; + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + OCVContext *ocv = ctx->priv; + char name[128], priv_args[1024]; + int i; + char c; + + sscanf(args, "%127[^=:]%c%1023s", name, &c, priv_args); + + for (i = 0; i < FF_ARRAY_ELEMS(ocv_filter_entries); i++) { + OCVFilterEntry *entry = &ocv_filter_entries[i]; + if (!strcmp(name, entry->name)) { + ocv->name = entry->name; + ocv->init = entry->init; + ocv->uninit = entry->uninit; + ocv->end_frame_filter = entry->end_frame_filter; + + if (!(ocv->priv = av_mallocz(entry->priv_size))) + return AVERROR(ENOMEM); + return ocv->init(ctx, priv_args, opaque); + } + } + + av_log(ctx, AV_LOG_ERROR, "No libopencv filter named '%s'\n", name); + return AVERROR(EINVAL); +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + OCVContext *ocv = ctx->priv; + + if (ocv->uninit) + ocv->uninit(ctx); + av_free(ocv->priv); + memset(ocv, 0, sizeof(*ocv)); +} + +static void end_frame(AVFilterLink *inlink) +{ + AVFilterContext *ctx = inlink->dst; + OCVContext *ocv = ctx->priv; + AVFilterLink *outlink= inlink->dst->outputs[0]; + AVFilterBufferRef *inpicref = inlink ->cur_buf; + AVFilterBufferRef *outpicref = outlink->out_buf; + IplImage inimg, outimg; + + fill_iplimage_from_picref(&inimg , inpicref , inlink->format); + fill_iplimage_from_picref(&outimg, outpicref, inlink->format); + ocv->end_frame_filter(ctx, &inimg, &outimg); + fill_picref_from_iplimage(outpicref, &outimg, inlink->format); + + avfilter_unref_buffer(inpicref); + avfilter_draw_slice(outlink, 0, outlink->h, 1); + avfilter_end_frame(outlink); + avfilter_unref_buffer(outpicref); +} + +AVFilter avfilter_vf_ocv = { + .name = "ocv", + .description = NULL_IF_CONFIG_SMALL("Apply transform using libopencv."), + + .priv_size = sizeof(OCVContext), + + .query_formats = query_formats, + .init = init, + .uninit = uninit, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .draw_slice = null_draw_slice, + .end_frame = end_frame, + .min_perms = AV_PERM_READ }, + { .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_null.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_null.c new file mode 100644 index 00000000..989cd86f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_null.c @@ -0,0 +1,42 @@ +/* + * 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 + * null video filter + */ + +#include "avfilter.h" + +AVFilter avfilter_vf_null = { + .name = "null", + .description = NULL_IF_CONFIG_SMALL("Pass the source unchanged to the output."), + + .priv_size = 0, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = avfilter_null_get_video_buffer, + .start_frame = avfilter_null_start_frame, + .end_frame = avfilter_null_end_frame }, + { .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_overlay.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_overlay.c new file mode 100644 index 00000000..a170e817 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_overlay.c @@ -0,0 +1,380 @@ +/* + * Copyright (c) 2010 Stefano Sabatini + * Copyright (c) 2010 Baptiste Coudurier + * Copyright (c) 2007 Bobby Bingham + * + * 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 + * overlay one video on top of another + */ + +#include "avfilter.h" +#include "libavutil/eval.h" +#include "libavutil/avstring.h" +#include "libavutil/pixdesc.h" +#include "libavcore/imgutils.h" +#include "internal.h" + +static const char *var_names[] = { + "E", + "PHI", + "PI", + "main_w", "W", ///< width of the main video + "main_h", "H", ///< height of the main video + "overlay_w", "w", ///< width of the overlay video + "overlay_h", "h", ///< height of the overlay video + NULL +}; + +enum var_name { + VAR_E, + VAR_PHI, + VAR_PI, + VAR_MAIN_W, VAR_MW, + VAR_MAIN_H, VAR_MH, + VAR_OVERLAY_W, VAR_OW, + VAR_OVERLAY_H, VAR_OH, + VAR_VARS_NB +}; + +#define MAIN 0 +#define OVERLAY 1 + +typedef struct { + int x, y; ///< position of overlayed picture + + AVFilterBufferRef *overpicref; + + int max_plane_step[4]; ///< steps per pixel for each plane + int hsub, vsub; ///< chroma subsampling values + + char x_expr[256], y_expr[256]; +} OverlayContext; + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + OverlayContext *over = ctx->priv; + + av_strlcpy(over->x_expr, "0", sizeof(over->x_expr)); + av_strlcpy(over->y_expr, "0", sizeof(over->y_expr)); + + if (args) + sscanf(args, "%255[^:]:%255[^:]", over->x_expr, over->y_expr); + + return 0; +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + OverlayContext *over = ctx->priv; + + if (over->overpicref) + avfilter_unref_buffer(over->overpicref); +} + +static int query_formats(AVFilterContext *ctx) +{ + const enum PixelFormat inout_pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE }; + const enum PixelFormat blend_pix_fmts[] = { PIX_FMT_YUVA420P, PIX_FMT_NONE }; + AVFilterFormats *inout_formats = avfilter_make_format_list(inout_pix_fmts); + AVFilterFormats *blend_formats = avfilter_make_format_list(blend_pix_fmts); + + avfilter_formats_ref(inout_formats, &ctx->inputs [MAIN ]->out_formats); + avfilter_formats_ref(blend_formats, &ctx->inputs [OVERLAY]->out_formats); + avfilter_formats_ref(inout_formats, &ctx->outputs[MAIN ]->in_formats ); + + return 0; +} + +static int config_input_main(AVFilterLink *inlink) +{ + OverlayContext *over = inlink->dst->priv; + const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[inlink->format]; + + av_image_fill_max_pixsteps(over->max_plane_step, NULL, pix_desc); + over->hsub = pix_desc->log2_chroma_w; + over->vsub = pix_desc->log2_chroma_h; + + return 0; +} + +static int config_input_overlay(AVFilterLink *inlink) +{ + AVFilterContext *ctx = inlink->dst; + OverlayContext *over = inlink->dst->priv; + char *expr; + double var_values[VAR_VARS_NB], res; + int ret; + + /* Finish the configuration by evaluating the expressions + now when both inputs are configured. */ + var_values[VAR_E ] = M_E; + var_values[VAR_PHI] = M_PHI; + var_values[VAR_PI ] = M_PI; + + var_values[VAR_MAIN_W ] = var_values[VAR_MW] = ctx->inputs[MAIN ]->w; + var_values[VAR_MAIN_H ] = var_values[VAR_MH] = ctx->inputs[MAIN ]->h; + var_values[VAR_OVERLAY_W] = var_values[VAR_OW] = ctx->inputs[OVERLAY]->w; + var_values[VAR_OVERLAY_H] = var_values[VAR_OH] = ctx->inputs[OVERLAY]->h; + + if ((ret = av_expr_parse_and_eval(&res, (expr = over->x_expr), var_names, var_values, + NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) + goto fail; + over->x = res; + if ((ret = av_expr_parse_and_eval(&res, (expr = over->y_expr), var_names, var_values, + NULL, NULL, NULL, NULL, NULL, 0, ctx))) + goto fail; + over->y = res; + /* x may depend on y */ + if ((ret = av_expr_parse_and_eval(&res, (expr = over->x_expr), var_names, var_values, + NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) + goto fail; + over->x = res; + + av_log(ctx, AV_LOG_INFO, + "main w:%d h:%d fmt:%s overlay x:%d y:%d w:%d h:%d fmt:%s\n", + ctx->inputs[MAIN]->w, ctx->inputs[MAIN]->h, + av_pix_fmt_descriptors[ctx->inputs[MAIN]->format].name, + over->x, over->y, + ctx->inputs[OVERLAY]->w, ctx->inputs[OVERLAY]->h, + av_pix_fmt_descriptors[ctx->inputs[OVERLAY]->format].name); + + if (over->x < 0 || over->y < 0 || + over->x + var_values[VAR_OVERLAY_W] > var_values[VAR_MAIN_W] || + over->y + var_values[VAR_OVERLAY_H] > var_values[VAR_MAIN_H]) { + av_log(ctx, AV_LOG_ERROR, + "Overlay area (%d,%d)<->(%d,%d) not within the main area (0,0)<->(%d,%d) or zero-sized\n", + over->x, over->y, + (int)(over->x + var_values[VAR_OVERLAY_W]), + (int)(over->y + var_values[VAR_OVERLAY_H]), + (int)var_values[VAR_MAIN_W], (int)var_values[VAR_MAIN_H]); + return AVERROR(EINVAL); + } + return 0; + +fail: + av_log(NULL, AV_LOG_ERROR, + "Error when evaluating the expression '%s'\n", expr); + return ret; +} + +static int config_output(AVFilterLink *outlink) +{ + AVFilterContext *ctx = outlink->src; + int exact; + // common timebase computation: + AVRational tb1 = ctx->inputs[MAIN ]->time_base; + AVRational tb2 = ctx->inputs[OVERLAY]->time_base; + AVRational *tb = &ctx->outputs[0]->time_base; + exact = av_reduce(&tb->num, &tb->den, + av_gcd((int64_t)tb1.num * tb2.den, + (int64_t)tb2.num * tb1.den), + (int64_t)tb1.den * tb2.den, INT_MAX); + av_log(ctx, AV_LOG_INFO, + "main_tb:%d/%d overlay_tb:%d/%d -> tb:%d/%d exact:%d\n", + tb1.num, tb1.den, tb2.num, tb2.den, tb->num, tb->den, exact); + if (!exact) + av_log(ctx, AV_LOG_WARNING, + "Timestamp conversion inexact, timestamp information loss may occurr\n"); + + outlink->w = ctx->inputs[MAIN]->w; + outlink->h = ctx->inputs[MAIN]->h; + + return 0; +} + +static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, int w, int h) +{ + return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h); +} + +static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) +{ + AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0); + AVFilterContext *ctx = inlink->dst; + OverlayContext *over = ctx->priv; + + inlink->dst->outputs[0]->out_buf = outpicref; + outpicref->pts = av_rescale_q(outpicref->pts, ctx->inputs[MAIN]->time_base, + ctx->outputs[0]->time_base); + + if (!over->overpicref || over->overpicref->pts < outpicref->pts) { + AVFilterBufferRef *old = over->overpicref; + over->overpicref = NULL; + avfilter_request_frame(ctx->inputs[OVERLAY]); + if (over->overpicref) { + if (old) + avfilter_unref_buffer(old); + } else + over->overpicref = old; + } + + avfilter_start_frame(inlink->dst->outputs[0], outpicref); +} + +static void start_frame_overlay(AVFilterLink *inlink, AVFilterBufferRef *inpicref) +{ + AVFilterContext *ctx = inlink->dst; + OverlayContext *over = ctx->priv; + + over->overpicref = inpicref; + over->overpicref->pts = av_rescale_q(inpicref->pts, ctx->inputs[OVERLAY]->time_base, + ctx->outputs[0]->time_base); +} + +static void blend_slice(AVFilterContext *ctx, + AVFilterBufferRef *dst, AVFilterBufferRef *src, + int x, int y, int w, int h, + int slice_y, int slice_w, int slice_h) +{ + OverlayContext *over = ctx->priv; + int i, j, k; + int width, height; + int overlay_end_y = y+h; + int slice_end_y = slice_y+slice_h; + int end_y, start_y; + + width = FFMIN(slice_w - x, w); + end_y = FFMIN(slice_end_y, overlay_end_y); + start_y = FFMAX(y, slice_y); + height = end_y - start_y; + + if (dst->format == PIX_FMT_BGR24 || dst->format == PIX_FMT_RGB24) { + uint8_t *dp = dst->data[0] + x * 3 + start_y * dst->linesize[0]; + uint8_t *sp = src->data[0]; + int b = dst->format == PIX_FMT_BGR24 ? 2 : 0; + int r = dst->format == PIX_FMT_BGR24 ? 0 : 2; + if (slice_y > y) + sp += (slice_y - y) * src->linesize[0]; + for (i = 0; i < height; i++) { + uint8_t *d = dp, *s = sp; + for (j = 0; j < width; j++) { + d[r] = (d[r] * (0xff - s[3]) + s[0] * s[3] + 128) >> 8; + d[1] = (d[1] * (0xff - s[3]) + s[1] * s[3] + 128) >> 8; + d[b] = (d[b] * (0xff - s[3]) + s[2] * s[3] + 128) >> 8; + d += 3; + s += 4; + } + dp += dst->linesize[0]; + sp += src->linesize[0]; + } + } else { + for (i = 0; i < 3; i++) { + int hsub = i ? over->hsub : 0; + int vsub = i ? over->vsub : 0; + uint8_t *dp = dst->data[i] + (x >> hsub) + + (start_y >> vsub) * dst->linesize[i]; + uint8_t *sp = src->data[i]; + uint8_t *ap = src->data[3]; + int wp = FFALIGN(width, 1<> hsub; + int hp = FFALIGN(height, 1<> vsub; + if (slice_y > y) { + sp += ((slice_y - y) >> vsub) * src->linesize[i]; + ap += (slice_y - y) * src->linesize[3]; + } + for (j = 0; j < hp; j++) { + uint8_t *d = dp, *s = sp, *a = ap; + for (k = 0; k < wp; k++) { + // average alpha for color components, improve quality + int alpha_v, alpha_h, alpha; + if (hsub && vsub && j+1 < hp && k+1 < wp) { + alpha = (a[0] + a[src->linesize[3]] + + a[1] + a[src->linesize[3]+1]) >> 2; + } else if (hsub || vsub) { + alpha_h = hsub && k+1 < wp ? + (a[0] + a[1]) >> 1 : a[0]; + alpha_v = vsub && j+1 < hp ? + (a[0] + a[src->linesize[3]]) >> 1 : a[0]; + alpha = (alpha_v + alpha_h) >> 1; + } else + alpha = a[0]; + *d = (*d * (0xff - alpha) + *s++ * alpha + 128) >> 8; + d++; + a += 1 << hsub; + } + dp += dst->linesize[i]; + sp += src->linesize[i]; + ap += (1 << vsub) * src->linesize[3]; + } + } + } +} + +static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) +{ + AVFilterContext *ctx = inlink->dst; + AVFilterLink *outlink = ctx->outputs[0]; + AVFilterBufferRef *outpicref = outlink->out_buf; + OverlayContext *over = ctx->priv; + + if (over->overpicref && + !(over->x >= outpicref->video->w || over->y >= outpicref->video->h || + y+h < over->y || y >= over->y + over->overpicref->video->h)) { + blend_slice(ctx, outpicref, over->overpicref, over->x, over->y, + over->overpicref->video->w, over->overpicref->video->h, + y, outpicref->video->w, h); + } + avfilter_draw_slice(outlink, y, h, slice_dir); +} + +static void end_frame(AVFilterLink *inlink) +{ + avfilter_end_frame(inlink->dst->outputs[0]); + avfilter_unref_buffer(inlink->cur_buf); +} + +static void null_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) { } + +static void null_end_frame(AVFilterLink *inlink) { } + +AVFilter avfilter_vf_overlay = { + .name = "overlay", + .description = NULL_IF_CONFIG_SMALL("Overlay a video source on top of the input."), + + .init = init, + .uninit = uninit, + + .priv_size = sizeof(OverlayContext), + + .query_formats = query_formats, + + .inputs = (AVFilterPad[]) {{ .name = "main", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame, + .get_video_buffer= get_video_buffer, + .config_props = config_input_main, + .draw_slice = draw_slice, + .end_frame = end_frame, + .min_perms = AV_PERM_READ, + .rej_perms = AV_PERM_REUSE2|AV_PERM_PRESERVE, }, + { .name = "overlay", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame_overlay, + .config_props = config_input_overlay, + .draw_slice = null_draw_slice, + .end_frame = null_end_frame, + .min_perms = AV_PERM_READ, + .rej_perms = AV_PERM_REUSE2, }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_pad.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_pad.c new file mode 100644 index 00000000..467db5bf --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_pad.c @@ -0,0 +1,542 @@ +/* + * Copyright (c) 2008 vmrsss + * Copyright (c) 2009 Stefano Sabatini + * + * 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 + * video padding filter and color source + */ + +#include "avfilter.h" +#include "libavutil/pixdesc.h" +#include "libavutil/colorspace.h" +#include "libavutil/avassert.h" +#include "libavcore/imgutils.h" +#include "libavcore/parseutils.h" + +enum { RED = 0, GREEN, BLUE, ALPHA }; + +static int fill_line_with_color(uint8_t *line[4], int line_step[4], int w, uint8_t color[4], + enum PixelFormat pix_fmt, uint8_t rgba_color[4], int *is_packed_rgba) +{ + uint8_t rgba_map[4] = {0}; + int i; + const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt]; + int hsub = pix_desc->log2_chroma_w; + + *is_packed_rgba = 1; + switch (pix_fmt) { + case PIX_FMT_ARGB: rgba_map[ALPHA] = 0; rgba_map[RED ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break; + case PIX_FMT_ABGR: rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED ] = 3; break; + case PIX_FMT_RGBA: + case PIX_FMT_RGB24: rgba_map[RED ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break; + case PIX_FMT_BGRA: + case PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED ] = 2; rgba_map[ALPHA] = 3; break; + default: + *is_packed_rgba = 0; + } + + if (*is_packed_rgba) { + line_step[0] = (av_get_bits_per_pixel(pix_desc))>>3; + for (i = 0; i < 4; i++) + color[rgba_map[i]] = rgba_color[i]; + + line[0] = av_malloc(w * line_step[0]); + for (i = 0; i < w; i++) + memcpy(line[0] + i * line_step[0], color, line_step[0]); + } else { + int plane; + + color[RED ] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]); + color[GREEN] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0); + color[BLUE ] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0); + color[ALPHA] = rgba_color[3]; + + for (plane = 0; plane < 4; plane++) { + int line_size; + int hsub1 = (plane == 1 || plane == 2) ? hsub : 0; + + line_step[plane] = 1; + line_size = (w >> hsub1) * line_step[plane]; + line[plane] = av_malloc(line_size); + memset(line[plane], color[plane], line_size); + } + } + + return 0; +} + +static void draw_rectangle(AVFilterBufferRef *outpic, uint8_t *line[4], int line_step[4], + int hsub, int vsub, int x, int y, int w, int h) +{ + int i, plane; + uint8_t *p; + + for (plane = 0; plane < 4 && outpic->data[plane]; plane++) { + int hsub1 = plane == 1 || plane == 2 ? hsub : 0; + int vsub1 = plane == 1 || plane == 2 ? vsub : 0; + + p = outpic->data[plane] + (y >> vsub1) * outpic->linesize[plane]; + for (i = 0; i < (h >> vsub1); i++) { + memcpy(p + (x >> hsub1) * line_step[plane], line[plane], (w >> hsub1) * line_step[plane]); + p += outpic->linesize[plane]; + } + } +} + +static void copy_rectangle(AVFilterBufferRef *outpic,uint8_t *line[4], int line_step[4], int linesize[4], + int hsub, int vsub, int x, int y, int y2, int w, int h) +{ + int i, plane; + uint8_t *p; + + for (plane = 0; plane < 4 && outpic->data[plane]; plane++) { + int hsub1 = plane == 1 || plane == 2 ? hsub : 0; + int vsub1 = plane == 1 || plane == 2 ? vsub : 0; + + p = outpic->data[plane] + (y >> vsub1) * outpic->linesize[plane]; + for (i = 0; i < (h >> vsub1); i++) { + memcpy(p + (x >> hsub1) * line_step[plane], line[plane] + linesize[plane]*(i+(y2>>vsub1)), (w >> hsub1) * line_step[plane]); + p += outpic->linesize[plane]; + } + } +} + +static int query_formats(AVFilterContext *ctx) +{ + static const enum PixelFormat pix_fmts[] = { + PIX_FMT_ARGB, PIX_FMT_RGBA, + PIX_FMT_ABGR, PIX_FMT_BGRA, + PIX_FMT_RGB24, PIX_FMT_BGR24, + + PIX_FMT_YUV444P, PIX_FMT_YUV422P, + PIX_FMT_YUV420P, PIX_FMT_YUV411P, + PIX_FMT_YUV410P, PIX_FMT_YUV440P, + PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, + PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P, + PIX_FMT_YUVA420P, + + PIX_FMT_NONE + }; + + avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + return 0; +} + +#if CONFIG_PAD_FILTER + +typedef struct { + int w, h; ///< output dimensions, a value of 0 will result in the input size + int x, y; ///< offsets of the input area with respect to the padded area + int in_w, in_h; ///< width and height for the padded input video, which has to be aligned to the chroma values in order to avoid chroma issues + + uint8_t color[4]; ///< color expressed either in YUVA or RGBA colorspace for the padding area + uint8_t *line[4]; + int line_step[4]; + int hsub, vsub; ///< chroma subsampling values + int needs_copy; +} PadContext; + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + PadContext *pad = ctx->priv; + char color_string[128] = "black"; + + if (args) + sscanf(args, "%d:%d:%d:%d:%s", &pad->w, &pad->h, &pad->x, &pad->y, color_string); + + if (av_parse_color(pad->color, color_string, -1, ctx) < 0) + return AVERROR(EINVAL); + + /* sanity check params */ + if (pad->w < 0 || pad->h < 0) { + av_log(ctx, AV_LOG_ERROR, "Negative size values are not acceptable.\n"); + return AVERROR(EINVAL); + } + + return 0; +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + PadContext *pad = ctx->priv; + int i; + + for (i = 0; i < 4; i++) { + av_freep(&pad->line[i]); + pad->line_step[i] = 0; + } +} + +static int config_input(AVFilterLink *inlink) +{ + AVFilterContext *ctx = inlink->dst; + PadContext *pad = ctx->priv; + const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[inlink->format]; + uint8_t rgba_color[4]; + int is_packed_rgba; + + pad->hsub = pix_desc->log2_chroma_w; + pad->vsub = pix_desc->log2_chroma_h; + + if (!pad->w) + pad->w = inlink->w; + if (!pad->h) + pad->h = inlink->h; + + pad->w &= ~((1 << pad->hsub) - 1); + pad->h &= ~((1 << pad->vsub) - 1); + pad->x &= ~((1 << pad->hsub) - 1); + pad->y &= ~((1 << pad->vsub) - 1); + + pad->in_w = inlink->w & ~((1 << pad->hsub) - 1); + pad->in_h = inlink->h & ~((1 << pad->vsub) - 1); + + memcpy(rgba_color, pad->color, sizeof(rgba_color)); + fill_line_with_color(pad->line, pad->line_step, pad->w, pad->color, + inlink->format, rgba_color, &is_packed_rgba); + + av_log(ctx, AV_LOG_INFO, "w:%d h:%d -> w:%d h:%d x:%d y:%d color:0x%02X%02X%02X%02X[%s]\n", + inlink->w, inlink->h, pad->w, pad->h, pad->x, pad->y, + pad->color[0], pad->color[1], pad->color[2], pad->color[3], + is_packed_rgba ? "rgba" : "yuva"); + + if (pad->x < 0 || pad->y < 0 || + pad->w <= 0 || pad->h <= 0 || + (unsigned)pad->x + (unsigned)inlink->w > pad->w || + (unsigned)pad->y + (unsigned)inlink->h > pad->h) { + av_log(ctx, AV_LOG_ERROR, + "Input area %d:%d:%d:%d not within the padded area 0:0:%d:%d or zero-sized\n", + pad->x, pad->y, pad->x + inlink->w, pad->y + inlink->h, pad->w, pad->h); + return AVERROR(EINVAL); + } + + return 0; +} + +static int config_output(AVFilterLink *outlink) +{ + PadContext *pad = outlink->src->priv; + + outlink->w = pad->w; + outlink->h = pad->h; + return 0; +} + +static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int w, int h) +{ + PadContext *pad = inlink->dst->priv; + + AVFilterBufferRef *picref = avfilter_get_video_buffer(inlink->dst->outputs[0], perms, + w + (pad->w - pad->in_w), + h + (pad->h - pad->in_h)); + int plane; + + picref->video->w = w; + picref->video->h = h; + + for (plane = 0; plane < 4 && picref->data[plane]; plane++) { + int hsub = (plane == 1 || plane == 2) ? pad->hsub : 0; + int vsub = (plane == 1 || plane == 2) ? pad->vsub : 0; + + picref->data[plane] += (pad->x >> hsub) * pad->line_step[plane] + + (pad->y >> vsub) * picref->linesize[plane]; + } + + return picref; +} + +static int does_clip(PadContext *pad, AVFilterBufferRef *outpicref, int plane, int hsub, int vsub, int x, int y) +{ + int64_t x_in_buf, y_in_buf; + + x_in_buf = outpicref->data[plane] - outpicref->buf->data[plane] + + (x >> hsub) * pad ->line_step[plane] + + (y >> vsub) * outpicref->linesize [plane]; + + if(x_in_buf < 0 || x_in_buf % pad->line_step[plane]) + return 1; + x_in_buf /= pad->line_step[plane]; + + av_assert0(outpicref->buf->linesize[plane]>0); //while reference can use negative linesize the main buffer should not + + y_in_buf = x_in_buf / outpicref->buf->linesize[plane]; + x_in_buf %= outpicref->buf->linesize[plane]; + + if( y_in_buf<= outpicref->buf->h + || x_in_buf<= outpicref->buf->w) + return 1; + return 0; +} + +static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) +{ + PadContext *pad = inlink->dst->priv; + AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0); + int plane; + + for (plane = 0; plane < 4 && outpicref->data[plane]; plane++) { + int hsub = (plane == 1 || plane == 2) ? pad->hsub : 0; + int vsub = (plane == 1 || plane == 2) ? pad->vsub : 0; + + av_assert0(outpicref->buf->w>0 && outpicref->buf->h>0); + + if(outpicref->format != outpicref->buf->format) //unsupported currently + break; + + outpicref->data[plane] -= (pad->x >> hsub) * pad ->line_step[plane] + + (pad->y >> vsub) * outpicref->linesize [plane]; + + if( does_clip(pad, outpicref, plane, hsub, vsub, 0, 0) + || does_clip(pad, outpicref, plane, hsub, vsub, 0, pad->h-1) + || does_clip(pad, outpicref, plane, hsub, vsub, pad->w-1, 0) + || does_clip(pad, outpicref, plane, hsub, vsub, pad->w-1, pad->h-1) + ) + break; + } + pad->needs_copy= plane < 4 && outpicref->data[plane]; + if(pad->needs_copy){ + av_log(inlink->dst, AV_LOG_DEBUG, "Direct padding impossible allocating new frame\n"); + avfilter_unref_buffer(outpicref); + outpicref = avfilter_get_video_buffer(inlink->dst->outputs[0], AV_PERM_WRITE | AV_PERM_NEG_LINESIZES, + FFMAX(inlink->w, pad->w), + FFMAX(inlink->h, pad->h)); + avfilter_copy_buffer_ref_props(outpicref, inpicref); + } + + inlink->dst->outputs[0]->out_buf = outpicref; + + outpicref->video->w = pad->w; + outpicref->video->h = pad->h; + + avfilter_start_frame(inlink->dst->outputs[0], outpicref); +} + +static void end_frame(AVFilterLink *link) +{ + avfilter_end_frame(link->dst->outputs[0]); + avfilter_unref_buffer(link->cur_buf); +} + +static void draw_send_bar_slice(AVFilterLink *link, int y, int h, int slice_dir, int before_slice) +{ + PadContext *pad = link->dst->priv; + int bar_y, bar_h = 0; + + if (slice_dir * before_slice == 1 && y == pad->y) { + /* top bar */ + bar_y = 0; + bar_h = pad->y; + } else if (slice_dir * before_slice == -1 && (y + h) == (pad->y + pad->in_h)) { + /* bottom bar */ + bar_y = pad->y + pad->in_h; + bar_h = pad->h - pad->in_h - pad->y; + } + + if (bar_h) { + draw_rectangle(link->dst->outputs[0]->out_buf, + pad->line, pad->line_step, pad->hsub, pad->vsub, + 0, bar_y, pad->w, bar_h); + avfilter_draw_slice(link->dst->outputs[0], bar_y, bar_h, slice_dir); + } +} + +static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir) +{ + PadContext *pad = link->dst->priv; + AVFilterBufferRef *outpic = link->dst->outputs[0]->out_buf; + AVFilterBufferRef *inpic = link->cur_buf; + + y += pad->y; + + y &= ~((1 << pad->vsub) - 1); + h &= ~((1 << pad->vsub) - 1); + + if (!h) + return; + draw_send_bar_slice(link, y, h, slice_dir, 1); + + /* left border */ + draw_rectangle(outpic, pad->line, pad->line_step, pad->hsub, pad->vsub, + 0, y, pad->x, h); + + if(pad->needs_copy){ + copy_rectangle(outpic, + inpic->data, pad->line_step, inpic->linesize, pad->hsub, pad->vsub, + pad->x, y, y-pad->y, inpic->video->w, h); + } + + /* right border */ + draw_rectangle(outpic, pad->line, pad->line_step, pad->hsub, pad->vsub, + pad->x + pad->in_w, y, pad->w - pad->x - pad->in_w, h); + avfilter_draw_slice(link->dst->outputs[0], y, h, slice_dir); + + draw_send_bar_slice(link, y, h, slice_dir, -1); +} + +AVFilter avfilter_vf_pad = { + .name = "pad", + .description = NULL_IF_CONFIG_SMALL("Pad input image to width:height[:x:y[:color]] (default x and y: 0, default color: black)."), + + .priv_size = sizeof(PadContext), + .init = init, + .uninit = uninit, + .query_formats = query_formats, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input, + .get_video_buffer = get_video_buffer, + .start_frame = start_frame, + .draw_slice = draw_slice, + .end_frame = end_frame, }, + { .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, }, + { .name = NULL}}, +}; + +#endif /* CONFIG_PAD_FILTER */ + +#if CONFIG_COLOR_FILTER + +typedef struct { + int w, h; + uint8_t color[4]; + AVRational time_base; + uint8_t *line[4]; + int line_step[4]; + int hsub, vsub; ///< chroma subsampling values + uint64_t pts; +} ColorContext; + +static av_cold int color_init(AVFilterContext *ctx, const char *args, void *opaque) +{ + ColorContext *color = ctx->priv; + char color_string[128] = "black"; + char frame_size [128] = "320x240"; + char frame_rate [128] = "25"; + AVRational frame_rate_q; + int ret; + + if (args) + sscanf(args, "%127[^:]:%127[^:]:%127s", color_string, frame_size, frame_rate); + + if (av_parse_video_size(&color->w, &color->h, frame_size) < 0) { + av_log(ctx, AV_LOG_ERROR, "Invalid frame size: %s\n", frame_size); + return AVERROR(EINVAL); + } + + if (av_parse_video_rate(&frame_rate_q, frame_rate) < 0 || + frame_rate_q.den <= 0 || frame_rate_q.num <= 0) { + av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: %s\n", frame_rate); + return AVERROR(EINVAL); + } + color->time_base.num = frame_rate_q.den; + color->time_base.den = frame_rate_q.num; + + if ((ret = av_parse_color(color->color, color_string, -1, ctx)) < 0) + return ret; + + return 0; +} + +static av_cold void color_uninit(AVFilterContext *ctx) +{ + ColorContext *color = ctx->priv; + int i; + + for (i = 0; i < 4; i++) { + av_freep(&color->line[i]); + color->line_step[i] = 0; + } +} + +static int color_config_props(AVFilterLink *inlink) +{ + AVFilterContext *ctx = inlink->src; + ColorContext *color = ctx->priv; + uint8_t rgba_color[4]; + int is_packed_rgba; + const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[inlink->format]; + + color->hsub = pix_desc->log2_chroma_w; + color->vsub = pix_desc->log2_chroma_h; + + color->w &= ~((1 << color->hsub) - 1); + color->h &= ~((1 << color->vsub) - 1); + if (av_image_check_size(color->w, color->h, 0, ctx) < 0) + return AVERROR(EINVAL); + + memcpy(rgba_color, color->color, sizeof(rgba_color)); + fill_line_with_color(color->line, color->line_step, color->w, color->color, + inlink->format, rgba_color, &is_packed_rgba); + + av_log(ctx, AV_LOG_INFO, "w:%d h:%d r:%d/%d color:0x%02x%02x%02x%02x[%s]\n", + color->w, color->h, color->time_base.den, color->time_base.num, + color->color[0], color->color[1], color->color[2], color->color[3], + is_packed_rgba ? "rgba" : "yuva"); + inlink->w = color->w; + inlink->h = color->h; + + return 0; +} + +static int color_request_frame(AVFilterLink *link) +{ + ColorContext *color = link->src->priv; + AVFilterBufferRef *picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h); + picref->video->pixel_aspect = (AVRational) {1, 1}; + picref->pts = av_rescale_q(color->pts++, color->time_base, AV_TIME_BASE_Q); + picref->pos = 0; + + avfilter_start_frame(link, avfilter_ref_buffer(picref, ~0)); + draw_rectangle(picref, + color->line, color->line_step, color->hsub, color->vsub, + 0, 0, color->w, color->h); + avfilter_draw_slice(link, 0, color->h, 1); + avfilter_end_frame(link); + avfilter_unref_buffer(picref); + + return 0; +} + +AVFilter avfilter_vsrc_color = { + .name = "color", + .description = NULL_IF_CONFIG_SMALL("Provide an uniformly colored input, syntax is: [color[:size[:rate]]]"), + + .priv_size = sizeof(ColorContext), + .init = color_init, + .uninit = color_uninit, + + .query_formats = query_formats, + + .inputs = (AVFilterPad[]) {{ .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .request_frame = color_request_frame, + .config_props = color_config_props }, + { .name = NULL}}, +}; + +#endif /* CONFIG_COLOR_FILTER */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_pixdesctest.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_pixdesctest.c new file mode 100644 index 00000000..1fb577e7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_pixdesctest.c @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2009 Stefano Sabatini + * + * 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 + * pixdesc test filter + */ + +#include "libavutil/pixdesc.h" +#include "avfilter.h" + +typedef struct { + const AVPixFmtDescriptor *pix_desc; + uint16_t *line; +} PixdescTestContext; + +static av_cold void uninit(AVFilterContext *ctx) +{ + PixdescTestContext *priv = ctx->priv; + av_freep(&priv->line); +} + +static int config_props(AVFilterLink *inlink) +{ + PixdescTestContext *priv = inlink->dst->priv; + + priv->pix_desc = &av_pix_fmt_descriptors[inlink->format]; + + if (!(priv->line = av_malloc(sizeof(*priv->line) * inlink->w))) + return AVERROR(ENOMEM); + + return 0; +} + +static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) +{ + PixdescTestContext *priv = inlink->dst->priv; + AVFilterLink *outlink = inlink->dst->outputs[0]; + AVFilterBufferRef *outpicref; + int i; + + outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, + outlink->w, outlink->h); + outpicref = outlink->out_buf; + avfilter_copy_buffer_ref_props(outpicref, picref); + + for (i = 0; i < 4; i++) { + int h = outlink->h; + h = i == 1 || i == 2 ? h>>priv->pix_desc->log2_chroma_h : h; + if (outpicref->data[i]) { + uint8_t *data = outpicref->data[i] + + (outpicref->linesize[i] > 0 ? 0 : outpicref->linesize[i] * (h-1)); + memset(data, 0, FFABS(outpicref->linesize[i]) * h); + } + } + + /* copy palette */ + if (priv->pix_desc->flags & PIX_FMT_PAL) + memcpy(outpicref->data[1], outpicref->data[1], 256*4); + + avfilter_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0)); +} + +static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) +{ + PixdescTestContext *priv = inlink->dst->priv; + AVFilterBufferRef *inpic = inlink->cur_buf; + AVFilterBufferRef *outpic = inlink->dst->outputs[0]->out_buf; + int i, c, w = inlink->w; + + for (c = 0; c < priv->pix_desc->nb_components; c++) { + int w1 = c == 1 || c == 2 ? w>>priv->pix_desc->log2_chroma_w : w; + int h1 = c == 1 || c == 2 ? h>>priv->pix_desc->log2_chroma_h : h; + int y1 = c == 1 || c == 2 ? y>>priv->pix_desc->log2_chroma_h : y; + + for (i = y1; i < y1 + h1; i++) { + av_read_image_line(priv->line, + inpic->data, + inpic->linesize, + priv->pix_desc, + 0, i, c, w1, 0); + + av_write_image_line(priv->line, + outpic->data, + outpic->linesize, + priv->pix_desc, + 0, i, c, w1); + } + } + + avfilter_draw_slice(inlink->dst->outputs[0], y, h, slice_dir); +} + +AVFilter avfilter_vf_pixdesctest = { + .name = "pixdesctest", + .description = NULL_IF_CONFIG_SMALL("Test pixel format definitions."), + + .priv_size = sizeof(PixdescTestContext), + .uninit = uninit, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame, + .draw_slice = draw_slice, + .config_props = config_props, + .min_perms = AV_PERM_READ, }, + { .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_scale.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_scale.c new file mode 100644 index 00000000..3f549132 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_scale.c @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2007 Bobby Bingham + * + * 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 + * scale video filter + */ + +#include "avfilter.h" +#include "libavutil/pixdesc.h" +#include "libswscale/swscale.h" + +typedef struct { + struct SwsContext *sws; ///< software scaler context + + /** + * New dimensions. Special values are: + * 0 = original width/height + * -1 = keep original aspect + */ + int w, h; + unsigned int flags; ///sws flags + + int hsub, vsub; ///< chroma subsampling + int slice_y; ///< top of current output slice + int input_is_pal; ///< set to 1 if the input format is paletted +} ScaleContext; + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + ScaleContext *scale = ctx->priv; + const char *p; + + scale->flags = SWS_BILINEAR; + if (args) { + sscanf(args, "%d:%d", &scale->w, &scale->h); + p = strstr(args,"flags="); + if (p) scale->flags = strtoul(p+6, NULL, 0); + } + + /* sanity check params */ + if (scale->w < -1 || scale->h < -1) { + av_log(ctx, AV_LOG_ERROR, "Size values less than -1 are not acceptable.\n"); + return AVERROR(EINVAL); + } + if (scale->w == -1 && scale->h == -1) + scale->w = scale->h = 0; + + return 0; +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + ScaleContext *scale = ctx->priv; + sws_freeContext(scale->sws); + scale->sws = NULL; +} + +static int query_formats(AVFilterContext *ctx) +{ + AVFilterFormats *formats; + enum PixelFormat pix_fmt; + int ret; + + if (ctx->inputs[0]) { + formats = NULL; + for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) + if ( sws_isSupportedInput(pix_fmt) + && (ret = avfilter_add_format(&formats, pix_fmt)) < 0) { + avfilter_formats_unref(&formats); + return ret; + } + avfilter_formats_ref(formats, &ctx->inputs[0]->out_formats); + } + if (ctx->outputs[0]) { + formats = NULL; + for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) + if ( sws_isSupportedOutput(pix_fmt) + && (ret = avfilter_add_format(&formats, pix_fmt)) < 0) { + avfilter_formats_unref(&formats); + return ret; + } + avfilter_formats_ref(formats, &ctx->outputs[0]->in_formats); + } + + return 0; +} + +static int config_props(AVFilterLink *outlink) +{ + AVFilterContext *ctx = outlink->src; + AVFilterLink *inlink = outlink->src->inputs[0]; + ScaleContext *scale = ctx->priv; + int64_t w, h; + + if (!(w = scale->w)) + w = inlink->w; + if (!(h = scale->h)) + h = inlink->h; + if (w == -1) + w = av_rescale(h, inlink->w, inlink->h); + if (h == -1) + h = av_rescale(w, inlink->h, inlink->w); + + if (w > INT_MAX || h > INT_MAX || + (h * inlink->w) > INT_MAX || + (w * inlink->h) > INT_MAX) + av_log(ctx, AV_LOG_ERROR, "Rescaled value for width or height is too big.\n"); + + outlink->w = w; + outlink->h = h; + + /* TODO: make algorithm configurable */ + av_log(ctx, AV_LOG_INFO, "w:%d h:%d fmt:%s -> w:%d h:%d fmt:%s flags:0x%0x\n", + inlink ->w, inlink ->h, av_pix_fmt_descriptors[ inlink->format].name, + outlink->w, outlink->h, av_pix_fmt_descriptors[outlink->format].name, + scale->flags); + + scale->input_is_pal = av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL; + + scale->sws = sws_getContext(inlink ->w, inlink ->h, inlink ->format, + outlink->w, outlink->h, outlink->format, + scale->flags, NULL, NULL, NULL); + if (!scale->sws) + return AVERROR(EINVAL); + + return 0; +} + +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) +{ + ScaleContext *scale = link->dst->priv; + AVFilterLink *outlink = link->dst->outputs[0]; + AVFilterBufferRef *outpicref; + + scale->hsub = av_pix_fmt_descriptors[link->format].log2_chroma_w; + scale->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h; + + outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); + avfilter_copy_buffer_ref_props(outpicref, picref); + outpicref->video->w = outlink->w; + outpicref->video->h = outlink->h; + + outlink->out_buf = outpicref; + + av_reduce(&outpicref->video->pixel_aspect.num, &outpicref->video->pixel_aspect.den, + (int64_t)picref->video->pixel_aspect.num * outlink->h * link->w, + (int64_t)picref->video->pixel_aspect.den * outlink->w * link->h, + INT_MAX); + + scale->slice_y = 0; + avfilter_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0)); +} + +static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir) +{ + ScaleContext *scale = link->dst->priv; + int out_h; + AVFilterBufferRef *cur_pic = link->cur_buf; + const uint8_t *data[4]; + + if (scale->slice_y == 0 && slice_dir == -1) + scale->slice_y = link->dst->outputs[0]->h; + + data[0] = cur_pic->data[0] + y * cur_pic->linesize[0]; + data[1] = scale->input_is_pal ? + cur_pic->data[1] : + cur_pic->data[1] + (y>>scale->vsub) * cur_pic->linesize[1]; + data[2] = cur_pic->data[2] + (y>>scale->vsub) * cur_pic->linesize[2]; + data[3] = cur_pic->data[3] + y * cur_pic->linesize[3]; + + out_h = sws_scale(scale->sws, data, cur_pic->linesize, y, h, + link->dst->outputs[0]->out_buf->data, + link->dst->outputs[0]->out_buf->linesize); + + if (slice_dir == -1) + scale->slice_y -= out_h; + avfilter_draw_slice(link->dst->outputs[0], scale->slice_y, out_h, slice_dir); + if (slice_dir == 1) + scale->slice_y += out_h; +} + +AVFilter avfilter_vf_scale = { + .name = "scale", + .description = NULL_IF_CONFIG_SMALL("Scale the input video to width:height size and/or convert the image format."), + + .init = init, + .uninit = uninit, + + .query_formats = query_formats, + + .priv_size = sizeof(ScaleContext), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame, + .draw_slice = draw_slice, + .min_perms = AV_PERM_READ, }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_props, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_setpts.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_setpts.c new file mode 100644 index 00000000..31fa1ef6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_setpts.c @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2010 Stefano Sabatini + * Copyright (c) 2008 Victor Paesa + * + * 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 + * video presentation timestamp (PTS) modification filter + */ + +/* #define DEBUG */ + +#include "libavutil/eval.h" +#include "avfilter.h" + +static const char *var_names[] = { + "E", ///< Euler number + "INTERLACED", ///< tell if the current frame is interlaced + "N", ///< frame number (starting at zero) + "PHI", ///< golden ratio + "PI", ///< greek pi + "POS", ///< original position in the file of the frame + "PREV_INPTS", ///< previous input PTS + "PREV_OUTPTS", ///< previous output PTS + "PTS", ///< original pts in the file of the frame + "STARTPTS", ///< PTS at start of movie + "TB", ///< timebase + NULL +}; + +enum var_name { + VAR_E, + VAR_INTERLACED, + VAR_N, + VAR_PHI, + VAR_PI, + VAR_POS, + VAR_PREV_INPTS, + VAR_PREV_OUTPTS, + VAR_PTS, + VAR_STARTPTS, + VAR_TB, + VAR_VARS_NB +}; + +typedef struct { + AVExpr *expr; + double var_values[VAR_VARS_NB]; +} SetPTSContext; + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + SetPTSContext *setpts = ctx->priv; + int ret; + + if ((ret = av_expr_parse(&setpts->expr, args ? args : "PTS", + var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0) { + av_log(ctx, AV_LOG_ERROR, "Error while parsing expression '%s'\n", args); + return ret; + } + + setpts->var_values[VAR_E ] = M_E; + setpts->var_values[VAR_N ] = 0.0; + setpts->var_values[VAR_PHI ] = M_PHI; + setpts->var_values[VAR_PI ] = M_PI; + setpts->var_values[VAR_PREV_INPTS ] = NAN; + setpts->var_values[VAR_PREV_OUTPTS] = NAN; + setpts->var_values[VAR_STARTPTS ] = NAN; + return 0; +} + +static int config_input(AVFilterLink *inlink) +{ + SetPTSContext *setpts = inlink->dst->priv; + + setpts->var_values[VAR_TB] = av_q2d(inlink->time_base); + + av_log(inlink->src, AV_LOG_INFO, "TB:%f\n", setpts->var_values[VAR_TB]); + return 0; +} + +#define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d)) +#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)) + +static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) +{ + SetPTSContext *setpts = inlink->dst->priv; + double d; + AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0); + + if (isnan(setpts->var_values[VAR_STARTPTS])) + setpts->var_values[VAR_STARTPTS] = TS2D(inpicref->pts); + + setpts->var_values[VAR_INTERLACED] = inpicref->video->interlaced; + setpts->var_values[VAR_PTS ] = TS2D(inpicref->pts); + setpts->var_values[VAR_POS ] = inpicref->pos == -1 ? NAN : inpicref->pos; + + d = av_expr_eval(setpts->expr, setpts->var_values, NULL); + outpicref->pts = D2TS(d); + +#ifdef DEBUG + av_log(inlink->dst, AV_LOG_DEBUG, + "n:%"PRId64" interlaced:%d pos:%"PRId64" pts:%"PRId64" t:%f -> pts:%"PRId64" t:%f\n", + (int64_t)setpts->var_values[VAR_N], + (int)setpts->var_values[VAR_INTERLACED], + inpicref ->pos, + inpicref ->pts, inpicref ->pts * av_q2d(inlink->time_base), + outpicref->pts, outpicref->pts * av_q2d(inlink->time_base)); +#endif + + setpts->var_values[VAR_N] += 1.0; + setpts->var_values[VAR_PREV_INPTS ] = TS2D(inpicref ->pts); + setpts->var_values[VAR_PREV_OUTPTS] = TS2D(outpicref->pts); + avfilter_start_frame(inlink->dst->outputs[0], outpicref); +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + SetPTSContext *setpts = ctx->priv; + av_expr_free(setpts->expr); + setpts->expr = NULL; +} + +AVFilter avfilter_vf_setpts = { + .name = "setpts", + .description = NULL_IF_CONFIG_SMALL("Set PTS for the output video frame."), + .init = init, + .uninit = uninit, + + .priv_size = sizeof(SetPTSContext), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = avfilter_null_get_video_buffer, + .config_props = config_input, + .start_frame = start_frame, }, + { .name = NULL }}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_settb.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_settb.c new file mode 100644 index 00000000..3e48ac41 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_settb.c @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2010 Stefano Sabatini + * + * 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 + * Set timebase for the output link. + */ + +#include "libavutil/avstring.h" +#include "libavutil/eval.h" +#include "libavutil/rational.h" +#include "avfilter.h" +#include "internal.h" + +static const char *var_names[] = { + "E", + "PHI", + "PI", + "AVTB", /* default timebase 1/AV_TIME_BASE */ + "intb", /* input timebase */ + NULL +}; + +enum var_name { + VAR_E, + VAR_PHI, + VAR_PI, + VAR_AVTB, + VAR_INTB, + VAR_VARS_NB +}; + +typedef struct { + char tb_expr[256]; + double var_values[VAR_VARS_NB]; +} SetTBContext; + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + SetTBContext *settb = ctx->priv; + av_strlcpy(settb->tb_expr, "intb", sizeof(settb->tb_expr)); + + if (args) + sscanf(args, "%255[^:]", settb->tb_expr); + + return 0; +} + +static int config_output_props(AVFilterLink *outlink) +{ + AVFilterContext *ctx = outlink->src; + SetTBContext *settb = ctx->priv; + AVFilterLink *inlink = ctx->inputs[0]; + AVRational time_base; + int ret; + double res; + + settb->var_values[VAR_E] = M_E; + settb->var_values[VAR_PHI] = M_PHI; + settb->var_values[VAR_PI] = M_PI; + settb->var_values[VAR_AVTB] = av_q2d(AV_TIME_BASE_Q); + settb->var_values[VAR_INTB] = av_q2d(inlink->time_base); + + outlink->w = inlink->w; + outlink->h = inlink->h; + + if ((ret = av_expr_parse_and_eval(&res, settb->tb_expr, var_names, settb->var_values, + NULL, NULL, NULL, NULL, NULL, 0, NULL)) < 0) { + av_log(ctx, AV_LOG_ERROR, "Invalid expression '%s' for timebase.\n", settb->tb_expr); + return ret; + } + time_base = av_d2q(res, INT_MAX); + if (time_base.num <= 0 || time_base.den <= 0) { + av_log(ctx, AV_LOG_ERROR, + "Invalid non-positive values for the timebase num:%d or den:%d.\n", + time_base.num, time_base.den); + return AVERROR(EINVAL); + } + + outlink->time_base = time_base; + av_log(outlink->src, AV_LOG_INFO, "tb:%d/%d -> tb:%d/%d\n", + inlink ->time_base.num, inlink ->time_base.den, + outlink->time_base.num, outlink->time_base.den); + + return 0; +} + +static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) +{ + AVFilterContext *ctx = inlink->dst; + AVFilterLink *outlink = ctx->outputs[0]; + AVFilterBufferRef *picref2 = picref; + + if (av_cmp_q(inlink->time_base, outlink->time_base)) { + picref2 = avfilter_ref_buffer(picref, ~0); + picref2->pts = av_rescale_q(picref->pts, inlink->time_base, outlink->time_base); + av_log(ctx, AV_LOG_DEBUG, "tb:%d/%d pts:%"PRId64" -> tb:%d/%d pts:%"PRId64"\n", + inlink ->time_base.num, inlink ->time_base.den, picref ->pts, + outlink->time_base.num, outlink->time_base.den, picref2->pts); + avfilter_unref_buffer(picref); + } + + avfilter_start_frame(outlink, picref2); +} + +AVFilter avfilter_vf_settb = { + .name = "settb", + .description = NULL_IF_CONFIG_SMALL("Set timebase for the output link."), + .init = init, + + .priv_size = sizeof(SetTBContext), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = avfilter_null_get_video_buffer, + .start_frame = start_frame, + .end_frame = avfilter_null_end_frame }, + { .name = NULL }}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output_props, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_slicify.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_slicify.c new file mode 100644 index 00000000..177ac1f2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_slicify.c @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2007 Bobby Bingham + * + * 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 + * video slicing filter + */ + +#include "avfilter.h" +#include "libavutil/pixdesc.h" + +typedef struct { + int h; ///< output slice height + int vshift; ///< vertical chroma subsampling shift + uint32_t lcg_state; ///< LCG state used to compute random slice height + int use_random_h; ///< enable the use of random slice height values +} SliceContext; + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + SliceContext *slice = ctx->priv; + + slice->h = 16; + if (args) { + if (!strcmp(args, "random")) { + slice->use_random_h = 1; + } else { + sscanf(args, "%d", &slice->h); + } + } + return 0; +} + +static int config_props(AVFilterLink *link) +{ + SliceContext *slice = link->dst->priv; + + slice->vshift = av_pix_fmt_descriptors[link->format].log2_chroma_h; + + return 0; +} + +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) +{ + SliceContext *slice = link->dst->priv; + + if (slice->use_random_h) { + slice->lcg_state = slice->lcg_state * 1664525 + 1013904223; + slice->h = 8 + (uint64_t)slice->lcg_state * 25 / UINT32_MAX; + } + + /* ensure that slices play nice with chroma subsampling, and enforce + * a reasonable minimum size for the slices */ + slice->h = FFMAX(8, slice->h & (-1 << slice->vshift)); + + av_log(link->dst, AV_LOG_DEBUG, "h:%d\n", slice->h); + + avfilter_start_frame(link->dst->outputs[0], picref); +} + +static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir) +{ + SliceContext *slice = link->dst->priv; + int y2; + + if (slice_dir == 1) { + for (y2 = y; y2 + slice->h <= y + h; y2 += slice->h) + avfilter_draw_slice(link->dst->outputs[0], y2, slice->h, slice_dir); + + if (y2 < y + h) + avfilter_draw_slice(link->dst->outputs[0], y2, y + h - y2, slice_dir); + } else if (slice_dir == -1) { + for (y2 = y + h; y2 - slice->h >= y; y2 -= slice->h) + avfilter_draw_slice(link->dst->outputs[0], y2 - slice->h, slice->h, slice_dir); + + if (y2 > y) + avfilter_draw_slice(link->dst->outputs[0], y, y2 - y, slice_dir); + } +} + +AVFilter avfilter_vf_slicify = { + .name = "slicify", + .description = NULL_IF_CONFIG_SMALL("Pass the images of input video on to next video filter as multiple slices."), + + .init = init, + + .priv_size = sizeof(SliceContext), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = avfilter_null_get_video_buffer, + .start_frame = start_frame, + .draw_slice = draw_slice, + .config_props = config_props, + .end_frame = avfilter_null_end_frame, }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_transpose.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_transpose.c new file mode 100644 index 00000000..970c3812 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_transpose.c @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2010 Stefano Sabatini + * Copyright (c) 2008 Vitor Sessak + * + * 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 + * transposition filter + * Based on MPlayer libmpcodecs/vf_rotate.c. + */ + +#include "libavutil/intreadwrite.h" +#include "libavutil/pixdesc.h" +#include "libavcore/imgutils.h" +#include "avfilter.h" + +typedef struct { + int hsub, vsub; + int pixsteps[4]; + + /* 0 Rotate by 90 degrees counterclockwise and vflip. */ + /* 1 Rotate by 90 degrees clockwise. */ + /* 2 Rotate by 90 degrees counterclockwise. */ + /* 3 Rotate by 90 degrees clockwise and vflip. */ + int dir; +} TransContext; + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + TransContext *trans = ctx->priv; + trans->dir = 0; + + if (args) + sscanf(args, "%d", &trans->dir); + + if (trans->dir < 0 || trans->dir > 3) { + av_log(ctx, AV_LOG_ERROR, "Invalid value %d not between 0 and 3.\n", + trans->dir); + return AVERROR(EINVAL); + } + return 0; +} + +static int query_formats(AVFilterContext *ctx) +{ + enum PixelFormat pix_fmts[] = { + PIX_FMT_ARGB, PIX_FMT_RGBA, + PIX_FMT_ABGR, PIX_FMT_BGRA, + PIX_FMT_RGB24, PIX_FMT_BGR24, + PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, + PIX_FMT_RGB555BE, PIX_FMT_RGB555LE, + PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, + PIX_FMT_BGR555BE, PIX_FMT_BGR555LE, + PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE, + PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE, + PIX_FMT_YUV422P16LE, PIX_FMT_YUV422P16BE, + PIX_FMT_YUV444P16LE, PIX_FMT_YUV444P16BE, + PIX_FMT_NV12, PIX_FMT_NV21, + PIX_FMT_RGB8, PIX_FMT_BGR8, + PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, + PIX_FMT_YUV444P, PIX_FMT_YUV422P, + PIX_FMT_YUV420P, PIX_FMT_YUVJ420P, + PIX_FMT_YUV411P, PIX_FMT_YUV410P, + PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, + PIX_FMT_YUV440P, PIX_FMT_YUVJ440P, + PIX_FMT_YUVA420P, PIX_FMT_GRAY8, + PIX_FMT_NONE + }; + + avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + return 0; +} + +static int config_props_output(AVFilterLink *outlink) +{ + AVFilterContext *ctx = outlink->src; + TransContext *trans = ctx->priv; + AVFilterLink *inlink = ctx->inputs[0]; + const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[outlink->format]; + + trans->hsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_w; + trans->vsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_h; + + av_image_fill_max_pixsteps(trans->pixsteps, NULL, pixdesc); + + outlink->w = inlink->h; + outlink->h = inlink->w; + + av_log(ctx, AV_LOG_INFO, "w:%d h:%d dir:%d -> w:%d h:%d rotation:%s vflip:%d\n", + inlink->w, inlink->h, trans->dir, outlink->w, outlink->h, + trans->dir == 1 || trans->dir == 3 ? "clockwise" : "counterclockwise", + trans->dir == 0 || trans->dir == 3); + return 0; +} + +static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) +{ + AVFilterLink *outlink = inlink->dst->outputs[0]; + + outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, + outlink->w, outlink->h); + outlink->out_buf->pts = picref->pts; + + if (picref->video->pixel_aspect.num == 0) { + outlink->out_buf->video->pixel_aspect = picref->video->pixel_aspect; + } else { + outlink->out_buf->video->pixel_aspect.num = picref->video->pixel_aspect.den; + outlink->out_buf->video->pixel_aspect.den = picref->video->pixel_aspect.num; + } + + avfilter_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0)); +} + +static void end_frame(AVFilterLink *inlink) +{ + TransContext *trans = inlink->dst->priv; + AVFilterBufferRef *inpic = inlink->cur_buf; + AVFilterBufferRef *outpic = inlink->dst->outputs[0]->out_buf; + AVFilterLink *outlink = inlink->dst->outputs[0]; + int plane; + + for (plane = 0; outpic->data[plane]; plane++) { + int hsub = plane == 1 || plane == 2 ? trans->hsub : 0; + int vsub = plane == 1 || plane == 2 ? trans->vsub : 0; + int pixstep = trans->pixsteps[plane]; + int inh = inpic->video->h>>vsub; + int outw = outpic->video->w>>hsub; + int outh = outpic->video->h>>vsub; + uint8_t *out, *in; + int outlinesize, inlinesize; + int x, y; + + out = outpic->data[plane]; outlinesize = outpic->linesize[plane]; + in = inpic ->data[plane]; inlinesize = inpic ->linesize[plane]; + + if (trans->dir&1) { + in += inpic->linesize[plane] * (inh-1); + inlinesize *= -1; + } + + if (trans->dir&2) { + out += outpic->linesize[plane] * (outh-1); + outlinesize *= -1; + } + + for (y = 0; y < outh; y++) { + switch (pixstep) { + case 1: + for (x = 0; x < outw; x++) + out[x] = in[x*inlinesize + y]; + break; + case 2: + for (x = 0; x < outw; x++) + *((uint16_t *)(out + 2*x)) = *((uint16_t *)(in + x*inlinesize + y*2)); + break; + case 3: + for (x = 0; x < outw; x++) { + int32_t v = AV_RB24(in + x*inlinesize + y*3); + AV_WB24(out + 3*x, v); + } + break; + case 4: + for (x = 0; x < outw; x++) + *((uint32_t *)(out + 4*x)) = *((uint32_t *)(in + x*inlinesize + y*4)); + break; + } + out += outlinesize; + } + } + + avfilter_unref_buffer(inpic); + avfilter_draw_slice(outlink, 0, outpic->video->h, 1); + avfilter_end_frame(outlink); + avfilter_unref_buffer(outpic); +} + +AVFilter avfilter_vf_transpose = { + .name = "transpose", + .description = NULL_IF_CONFIG_SMALL("Transpose input video."), + + .init = init, + .priv_size = sizeof(TransContext), + + .query_formats = query_formats, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame, + .end_frame = end_frame, + .min_perms = AV_PERM_READ, }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .config_props = config_props_output, + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_unsharp.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_unsharp.c new file mode 100644 index 00000000..7aa7a436 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_unsharp.c @@ -0,0 +1,244 @@ +/* + * Original copyright (c) 2002 Remi Guyomarch + * Port copyright (c) 2010 Daniel G. Taylor + * Relicensed to the LGPL with permission from Remi Guyomarch. + * + * 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 + * blur / sharpen filter, ported to FFmpeg from MPlayer + * libmpcodecs/unsharp.c. + * + * This code is based on: + * + * An Efficient algorithm for Gaussian blur using finite-state machines + * Frederick M. Waltz and John W. V. Miller + * + * SPIE Conf. on Machine Vision Systems for Inspection and Metrology VII + * Originally published Boston, Nov 98 + * + * http://www.engin.umd.umich.edu/~jwvm/ece581/21_GBlur.pdf + */ + +#include "avfilter.h" +#include "libavutil/common.h" +#include "libavutil/mem.h" +#include "libavutil/pixdesc.h" + +#define MIN_SIZE 3 +#define MAX_SIZE 13 + +#define CHROMA_WIDTH(link) -((-link->w) >> av_pix_fmt_descriptors[link->format].log2_chroma_w) +#define CHROMA_HEIGHT(link) -((-link->h) >> av_pix_fmt_descriptors[link->format].log2_chroma_h) + +typedef struct FilterParam { + int msize_x; ///< matrix width + int msize_y; ///< matrix height + int amount; ///< effect amount + int steps_x; ///< horizontal step count + int steps_y; ///< vertical step count + int scalebits; ///< bits to shift pixel + int32_t halfscale; ///< amount to add to pixel + uint32_t *sc[(MAX_SIZE * MAX_SIZE) - 1]; ///< finite state machine storage +} FilterParam; + +typedef struct { + FilterParam luma; ///< luma parameters (width, height, amount) + FilterParam chroma; ///< chroma parameters (width, height, amount) +} UnsharpContext; + +static void unsharpen(uint8_t *dst, uint8_t *src, int dst_stride, int src_stride, int width, int height, FilterParam *fp) +{ + uint32_t **sc = fp->sc; + uint32_t sr[(MAX_SIZE * MAX_SIZE) - 1], tmp1, tmp2; + + int32_t res; + int x, y, z; + + if (!fp->amount) { + if (dst_stride == src_stride) + memcpy(dst, src, src_stride * height); + else + for (y = 0; y < height; y++, dst += dst_stride, src += src_stride) + memcpy(dst, src, width); + return; + } + + for (y = 0; y < 2 * fp->steps_y; y++) + memset(sc[y], 0, sizeof(sc[y][0]) * (width + 2 * fp->steps_x)); + + for (y = -fp->steps_y; y < height + fp->steps_y; y++) { + memset(sr, 0, sizeof(sr[0]) * (2 * fp->steps_x - 1)); + for (x = -fp->steps_x; x < width + fp->steps_x; x++) { + tmp1 = x <= 0 ? src[0] : x >= width ? src[width-1] : src[x]; + for (z = 0; z < fp->steps_x * 2; z += 2) { + tmp2 = sr[z + 0] + tmp1; sr[z + 0] = tmp1; + tmp1 = sr[z + 1] + tmp2; sr[z + 1] = tmp2; + } + for (z = 0; z < fp->steps_y * 2; z += 2) { + tmp2 = sc[z + 0][x + fp->steps_x] + tmp1; sc[z + 0][x + fp->steps_x] = tmp1; + tmp1 = sc[z + 1][x + fp->steps_x] + tmp2; sc[z + 1][x + fp->steps_x] = tmp2; + } + if (x >= fp->steps_x && y >= fp->steps_y) { + uint8_t* srx = src - fp->steps_y * src_stride + x - fp->steps_x; + uint8_t* dsx = dst - fp->steps_y * dst_stride + x - fp->steps_x; + + res = (int32_t)*srx + ((((int32_t) * srx - (int32_t)((tmp1 + fp->halfscale) >> fp->scalebits)) * fp->amount) >> 16); + *dsx = av_clip_uint8(res); + } + } + if (y >= 0) { + dst += dst_stride; + src += src_stride; + } + } +} + +static void set_filter_param(FilterParam *fp, int msize_x, int msize_y, double amount) +{ + fp->msize_x = msize_x; + fp->msize_y = msize_y; + fp->amount = amount * 65536.0; + + fp->steps_x = msize_x / 2; + fp->steps_y = msize_y / 2; + fp->scalebits = (fp->steps_x + fp->steps_y) * 2; + fp->halfscale = 1 << (fp->scalebits - 1); +} + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + UnsharpContext *unsharp = ctx->priv; + int lmsize_x = 5, cmsize_x = 0; + int lmsize_y = 5, cmsize_y = 0; + double lamount = 1.0f, camount = 0.0f; + + if (args) + sscanf(args, "%d:%d:%lf:%d:%d:%lf", &lmsize_x, &lmsize_y, &lamount, + &cmsize_x, &cmsize_y, &camount); + + if ((lamount && (lmsize_x < 2 || lmsize_y < 2)) || + (camount && (cmsize_x < 2 || cmsize_y < 2))) { + av_log(ctx, AV_LOG_ERROR, + "Invalid value <2 for lmsize_x:%d or lmsize_y:%d or cmsize_x:%d or cmsize_y:%d\n", + lmsize_x, lmsize_y, cmsize_x, cmsize_y); + return AVERROR(EINVAL); + } + + set_filter_param(&unsharp->luma, lmsize_x, lmsize_y, lamount); + set_filter_param(&unsharp->chroma, cmsize_x, cmsize_y, camount); + + return 0; +} + +static int query_formats(AVFilterContext *ctx) +{ + enum PixelFormat pix_fmts[] = { + PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_YUV410P, + PIX_FMT_YUV411P, PIX_FMT_YUV440P, PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, + PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P, PIX_FMT_NONE + }; + + avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + + return 0; +} + +static void init_filter_param(AVFilterContext *ctx, FilterParam *fp, const char *effect_type, int width) +{ + int z; + const char *effect; + + effect = fp->amount == 0 ? "none" : fp->amount < 0 ? "blur" : "sharpen"; + + av_log(ctx, AV_LOG_INFO, "effect:%s type:%s msize_x:%d msize_y:%d amount:%0.2f\n", + effect, effect_type, fp->msize_x, fp->msize_y, fp->amount / 65535.0); + + for (z = 0; z < 2 * fp->steps_y; z++) + fp->sc[z] = av_malloc(sizeof(*(fp->sc[z])) * (width + 2 * fp->steps_x)); +} + +static int config_props(AVFilterLink *link) +{ + UnsharpContext *unsharp = link->dst->priv; + + init_filter_param(link->dst, &unsharp->luma, "luma", link->w); + init_filter_param(link->dst, &unsharp->chroma, "chroma", CHROMA_WIDTH(link)); + + return 0; +} + +static void free_filter_param(FilterParam *fp) +{ + int z; + + for (z = 0; z < 2 * fp->steps_y; z++) + av_free(fp->sc[z]); +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + UnsharpContext *unsharp = ctx->priv; + + free_filter_param(&unsharp->luma); + free_filter_param(&unsharp->chroma); +} + +static void end_frame(AVFilterLink *link) +{ + UnsharpContext *unsharp = link->dst->priv; + AVFilterBufferRef *in = link->cur_buf; + AVFilterBufferRef *out = link->dst->outputs[0]->out_buf; + + unsharpen(out->data[0], in->data[0], out->linesize[0], in->linesize[0], link->w, link->h, &unsharp->luma); + unsharpen(out->data[1], in->data[1], out->linesize[1], in->linesize[1], CHROMA_WIDTH(link), CHROMA_HEIGHT(link), &unsharp->chroma); + unsharpen(out->data[2], in->data[2], out->linesize[2], in->linesize[2], CHROMA_WIDTH(link), CHROMA_HEIGHT(link), &unsharp->chroma); + + avfilter_unref_buffer(in); + avfilter_draw_slice(link->dst->outputs[0], 0, link->h, 1); + avfilter_end_frame(link->dst->outputs[0]); + avfilter_unref_buffer(out); +} + +static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir) +{ +} + +AVFilter avfilter_vf_unsharp = { + .name = "unsharp", + .description = NULL_IF_CONFIG_SMALL("Sharpen or blur the input video."), + + .priv_size = sizeof(UnsharpContext), + + .init = init, + .uninit = uninit, + .query_formats = query_formats, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .draw_slice = draw_slice, + .end_frame = end_frame, + .config_props = config_props, + .min_perms = AV_PERM_READ, }, + { .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_vflip.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_vflip.c new file mode 100644 index 00000000..e5cede81 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_vflip.c @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2007 Bobby Bingham + * + * 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 + * video vertical flip filter + */ + +#include "libavutil/pixdesc.h" +#include "avfilter.h" + +typedef struct { + int vsub; ///< vertical chroma subsampling +} FlipContext; + +static int config_input(AVFilterLink *link) +{ + FlipContext *flip = link->dst->priv; + + flip->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h; + + return 0; +} + +static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, + int w, int h) +{ + FlipContext *flip = link->dst->priv; + AVFilterBufferRef *picref; + int i; + + if (!(perms & AV_PERM_NEG_LINESIZES)) + return avfilter_default_get_video_buffer(link, perms, w, h); + + picref = avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h); + for (i = 0; i < 4; i ++) { + int vsub = i == 1 || i == 2 ? flip->vsub : 0; + + if (picref->data[i]) { + picref->data[i] += ((h >> vsub)-1) * picref->linesize[i]; + picref->linesize[i] = -picref->linesize[i]; + } + } + + return picref; +} + +static void start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref) +{ + FlipContext *flip = link->dst->priv; + AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0); + int i; + + for (i = 0; i < 4; i ++) { + int vsub = i == 1 || i == 2 ? flip->vsub : 0; + + if (outpicref->data[i]) { + outpicref->data[i] += ((link->h >> vsub)-1) * outpicref->linesize[i]; + outpicref->linesize[i] = -outpicref->linesize[i]; + } + } + + avfilter_start_frame(link->dst->outputs[0], outpicref); +} + +static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir) +{ + AVFilterContext *ctx = link->dst; + + avfilter_draw_slice(ctx->outputs[0], link->h - (y+h), h, -1 * slice_dir); +} + +AVFilter avfilter_vf_vflip = { + .name = "vflip", + .description = NULL_IF_CONFIG_SMALL("Flip the input video vertically."), + + .priv_size = sizeof(FlipContext), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer = get_video_buffer, + .start_frame = start_frame, + .draw_slice = draw_slice, + .config_props = config_input, }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_yadif.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_yadif.c new file mode 100644 index 00000000..bd0a9de8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vf_yadif.c @@ -0,0 +1,350 @@ +/* + * Copyright (C) 2006-2010 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + */ + +#include "libavutil/cpu.h" +#include "libavutil/common.h" +#include "avfilter.h" +#include "yadif.h" + +#undef NDEBUG +#include + +typedef struct { + /** + * 0: send 1 frame for each frame + * 1: send 1 frame for each field + * 2: like 0 but skips spatial interlacing check + * 3: like 1 but skips spatial interlacing check + */ + int mode; + + /** + * 0: bottom field first + * 1: top field first + * -1: auto-detection + */ + int parity; + + int frame_pending; + + AVFilterBufferRef *cur; + AVFilterBufferRef *next; + AVFilterBufferRef *prev; + AVFilterBufferRef *out; + void (*filter_line)(uint8_t *dst, + uint8_t *prev, uint8_t *cur, uint8_t *next, + int w, int refs, int parity, int mode); +} YADIFContext; + +static void filter_line_c(uint8_t *dst, + uint8_t *prev, uint8_t *cur, uint8_t *next, + int w, int refs, int parity, int mode) +{ + int x; + uint8_t *prev2 = parity ? prev : cur ; + uint8_t *next2 = parity ? cur : next; + for (x = 0; x < w; x++) { + int c = cur[-refs]; + int d = (prev2[0] + next2[0])>>1; + int e = cur[+refs]; + int temporal_diff0 = FFABS(prev2[0] - next2[0]); + int temporal_diff1 =(FFABS(prev[-refs] - c) + FFABS(prev[+refs] - e) )>>1; + int temporal_diff2 =(FFABS(next[-refs] - c) + FFABS(next[+refs] - e) )>>1; + int diff = FFMAX3(temporal_diff0>>1, temporal_diff1, temporal_diff2); + int spatial_pred = (c+e)>>1; + int spatial_score = FFABS(cur[-refs-1] - cur[+refs-1]) + FFABS(c-e) + + FFABS(cur[-refs+1] - cur[+refs+1]) - 1; + +#define CHECK(j)\ + { int score = FFABS(cur[-refs-1+j] - cur[+refs-1-j])\ + + FFABS(cur[-refs +j] - cur[+refs -j])\ + + FFABS(cur[-refs+1+j] - cur[+refs+1-j]);\ + if (score < spatial_score) {\ + spatial_score= score;\ + spatial_pred= (cur[-refs +j] + cur[+refs -j])>>1;\ + + CHECK(-1) CHECK(-2) }} }} + CHECK( 1) CHECK( 2) }} }} + + if (mode < 2) { + int b = (prev2[-2*refs] + next2[-2*refs])>>1; + int f = (prev2[+2*refs] + next2[+2*refs])>>1; +#if 0 + int a = cur[-3*refs]; + int g = cur[+3*refs]; + int max = FFMAX3(d-e, d-c, FFMIN3(FFMAX(b-c,f-e),FFMAX(b-c,b-a),FFMAX(f-g,f-e)) ); + int min = FFMIN3(d-e, d-c, FFMAX3(FFMIN(b-c,f-e),FFMIN(b-c,b-a),FFMIN(f-g,f-e)) ); +#else + int max = FFMAX3(d-e, d-c, FFMIN(b-c, f-e)); + int min = FFMIN3(d-e, d-c, FFMAX(b-c, f-e)); +#endif + + diff = FFMAX3(diff, min, -max); + } + + if (spatial_pred > d + diff) + spatial_pred = d + diff; + else if (spatial_pred < d - diff) + spatial_pred = d - diff; + + dst[0] = spatial_pred; + + dst++; + cur++; + prev++; + next++; + prev2++; + next2++; + } +} + +static void filter(AVFilterContext *ctx, AVFilterBufferRef *dstpic, + int parity, int tff) +{ + YADIFContext *yadif = ctx->priv; + int y, i; + + for (i = 0; i < 3; i++) { + int is_chroma = !!i; + int w = dstpic->video->w >> is_chroma; + int h = dstpic->video->h >> is_chroma; + int refs = yadif->cur->linesize[i]; + + for (y = 0; y < h; y++) { + if ((y ^ parity) & 1) { + uint8_t *prev = &yadif->prev->data[i][y*refs]; + uint8_t *cur = &yadif->cur ->data[i][y*refs]; + uint8_t *next = &yadif->next->data[i][y*refs]; + uint8_t *dst = &dstpic->data[i][y*dstpic->linesize[i]]; + yadif->filter_line(dst, prev, cur, next, w, refs, parity ^ tff, yadif->mode); + } else { + memcpy(&dstpic->data[i][y*dstpic->linesize[i]], + &yadif->cur->data[i][y*refs], w); + } + } + } +#if HAVE_MMX + __asm__ volatile("emms \n\t" : : : "memory"); +#endif +} + +static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, int w, int h) +{ + AVFilterBufferRef *picref; + int width = FFALIGN(w, 32); + int height= FFALIGN(h+6, 32); + int i; + + picref = avfilter_default_get_video_buffer(link, perms, width, height); + + picref->video->w = w; + picref->video->h = h; + + for (i = 0; i < 3; i++) + picref->data[i] += 3 * picref->linesize[i]; + + return picref; +} + +static void return_frame(AVFilterContext *ctx, int is_second) +{ + YADIFContext *yadif = ctx->priv; + AVFilterLink *link= ctx->outputs[0]; + int tff; + + if (yadif->parity == -1) { + tff = yadif->cur->video->interlaced ? + yadif->cur->video->top_field_first : 1; + } else { + tff = yadif->parity^1; + } + + if (is_second) + yadif->out = avfilter_get_video_buffer(link, AV_PERM_WRITE | AV_PERM_PRESERVE | + AV_PERM_REUSE, link->w, link->h); + + filter(ctx, yadif->out, tff ^ !is_second, tff); + + if (is_second) { + if (yadif->next->pts != AV_NOPTS_VALUE && + yadif->cur->pts != AV_NOPTS_VALUE) { + yadif->out->pts = + (yadif->next->pts&yadif->cur->pts) + + ((yadif->next->pts^yadif->cur->pts)>>1); + } else { + yadif->out->pts = AV_NOPTS_VALUE; + } + avfilter_start_frame(ctx->outputs[0], yadif->out); + } + avfilter_draw_slice(ctx->outputs[0], 0, link->h, 1); + avfilter_end_frame(ctx->outputs[0]); + + yadif->frame_pending = (yadif->mode&1) && !is_second; +} + +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) +{ + AVFilterContext *ctx = link->dst; + YADIFContext *yadif = ctx->priv; + + if (yadif->frame_pending) + return_frame(ctx, 1); + + if (yadif->prev) + avfilter_unref_buffer(yadif->prev); + yadif->prev = yadif->cur; + yadif->cur = yadif->next; + yadif->next = picref; + + if (!yadif->cur) + return; + + if (!yadif->prev) + yadif->prev = avfilter_ref_buffer(yadif->cur, AV_PERM_READ); + + yadif->out = avfilter_get_video_buffer(ctx->outputs[0], AV_PERM_WRITE | AV_PERM_PRESERVE | + AV_PERM_REUSE, link->w, link->h); + + avfilter_copy_buffer_ref_props(yadif->out, yadif->cur); + yadif->out->video->interlaced = 0; + avfilter_start_frame(ctx->outputs[0], yadif->out); +} + +static void end_frame(AVFilterLink *link) +{ + AVFilterContext *ctx = link->dst; + YADIFContext *yadif = ctx->priv; + + if (!yadif->out) + return; + + return_frame(ctx, 0); +} + +static int request_frame(AVFilterLink *link) +{ + AVFilterContext *ctx = link->src; + YADIFContext *yadif = ctx->priv; + + if (yadif->frame_pending) { + return_frame(ctx, 1); + return 0; + } + + do { + int ret; + + if ((ret = avfilter_request_frame(link->src->inputs[0]))) + return ret; + } while (!yadif->cur); + + return 0; +} + +static int poll_frame(AVFilterLink *link) +{ + YADIFContext *yadif = link->src->priv; + int ret, val; + + if (yadif->frame_pending) + return 1; + + val = avfilter_poll_frame(link->src->inputs[0]); + + if (val==1 && !yadif->next) { //FIXME change API to not requre this red tape + if ((ret = avfilter_request_frame(link->src->inputs[0])) < 0) + return ret; + val = avfilter_poll_frame(link->src->inputs[0]); + } + assert(yadif->next); + + return val * ((yadif->mode&1)+1); +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + YADIFContext *yadif = ctx->priv; + + if (yadif->prev) avfilter_unref_buffer(yadif->prev); + if (yadif->cur ) avfilter_unref_buffer(yadif->cur ); + if (yadif->next) avfilter_unref_buffer(yadif->next); +} + +static int query_formats(AVFilterContext *ctx) +{ + static const enum PixelFormat pix_fmts[] = { + PIX_FMT_YUV420P, + PIX_FMT_GRAY8, + PIX_FMT_NONE + }; + + avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + + return 0; +} + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + YADIFContext *yadif = ctx->priv; + av_unused int cpu_flags = av_get_cpu_flags(); + + yadif->mode = 0; + yadif->parity = -1; + + if (args) sscanf(args, "%d:%d", &yadif->mode, &yadif->parity); + + yadif->filter_line = filter_line_c; + if (HAVE_SSSE3 && cpu_flags & AV_CPU_FLAG_SSSE3) + yadif->filter_line = ff_yadif_filter_line_ssse3; + else if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2) + yadif->filter_line = ff_yadif_filter_line_sse2; + else if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX) + yadif->filter_line = ff_yadif_filter_line_mmx; + + av_log(ctx, AV_LOG_INFO, "mode:%d parity:%d\n", yadif->mode, yadif->parity); + + return 0; +} + +static void null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { } + +AVFilter avfilter_vf_yadif = { + .name = "yadif", + .description = NULL_IF_CONFIG_SMALL("Deinterlace the input image"), + + .priv_size = sizeof(YADIFContext), + .init = init, + .uninit = uninit, + .query_formats = query_formats, + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame, + .get_video_buffer = get_video_buffer, + .draw_slice = null_draw_slice, + .end_frame = end_frame, }, + { .name = NULL}}, + + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .poll_frame = poll_frame, + .request_frame = request_frame, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vsink_nullsink.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vsink_nullsink.c new file mode 100644 index 00000000..0998bd0f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vsink_nullsink.c @@ -0,0 +1,45 @@ +/* + * 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 + */ + +#include "avfilter.h" + +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) +{ +} + +static void end_frame(AVFilterLink *link) +{ +} + +AVFilter avfilter_vsink_nullsink = { + .name = "nullsink", + .description = NULL_IF_CONFIG_SMALL("Do absolutely nothing with the input video."), + + .priv_size = 0, + + .inputs = (AVFilterPad[]) { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .start_frame = start_frame, + .end_frame = end_frame, + }, + { .name = NULL}, + }, + .outputs = (AVFilterPad[]) {{ .name = NULL }}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vsrc_buffer.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vsrc_buffer.c new file mode 100644 index 00000000..74d9bf62 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vsrc_buffer.c @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2008 Vitor Sessak + * + * 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 + * memory buffer source filter + */ + +#include "avfilter.h" +#include "vsrc_buffer.h" +#include "libavcore/imgutils.h" + +typedef struct { + int64_t pts; + AVFrame frame; + int has_frame; + int h, w; + enum PixelFormat pix_fmt; + AVRational time_base; ///< time_base to set in the output link + AVRational pixel_aspect; +} BufferSourceContext; + +int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, + int64_t pts, AVRational pixel_aspect) +{ + BufferSourceContext *c = buffer_filter->priv; + + if (c->has_frame) { + av_log(buffer_filter, AV_LOG_ERROR, + "Buffering several frames is not supported. " + "Please consume all available frames before adding a new one.\n" + ); + //return -1; + } + + memcpy(c->frame.data , frame->data , sizeof(frame->data)); + memcpy(c->frame.linesize, frame->linesize, sizeof(frame->linesize)); + c->frame.interlaced_frame= frame->interlaced_frame; + c->frame.top_field_first = frame->top_field_first; + c->pts = pts; + c->pixel_aspect = pixel_aspect; + c->has_frame = 1; + + return 0; +} + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + BufferSourceContext *c = ctx->priv; + char pix_fmt_str[128]; + int n = 0; + + if (!args || + (n = sscanf(args, "%d:%d:%127[^:]:%d:%d", &c->w, &c->h, pix_fmt_str, &c->time_base.num, &c->time_base.den)) != 5) { + av_log(ctx, AV_LOG_ERROR, "Expected 5 arguments, but only %d found in '%s'\n", n, args); + return AVERROR(EINVAL); + } + if ((c->pix_fmt = av_get_pix_fmt(pix_fmt_str)) == PIX_FMT_NONE) { + char *tail; + c->pix_fmt = strtol(pix_fmt_str, &tail, 10); + if (*tail || c->pix_fmt < 0 || c->pix_fmt >= PIX_FMT_NB) { + av_log(ctx, AV_LOG_ERROR, "Invalid pixel format string '%s'\n", pix_fmt_str); + return AVERROR(EINVAL); + } + } + + av_log(ctx, AV_LOG_INFO, "w:%d h:%d pixfmt:%s\n", c->w, c->h, av_pix_fmt_descriptors[c->pix_fmt].name); + return 0; +} + +static int query_formats(AVFilterContext *ctx) +{ + BufferSourceContext *c = ctx->priv; + enum PixelFormat pix_fmts[] = { c->pix_fmt, PIX_FMT_NONE }; + + avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + return 0; +} + +static int config_props(AVFilterLink *link) +{ + BufferSourceContext *c = link->src->priv; + + link->w = c->w; + link->h = c->h; + link->time_base = c->time_base; + + return 0; +} + +static int request_frame(AVFilterLink *link) +{ + BufferSourceContext *c = link->src->priv; + AVFilterBufferRef *picref; + + if (!c->has_frame) { + av_log(link->src, AV_LOG_ERROR, + "request_frame() called with no available frame!\n"); + //return -1; + } + + /* This picture will be needed unmodified later for decoding the next + * frame */ + picref = avfilter_get_video_buffer(link, AV_PERM_WRITE | AV_PERM_PRESERVE | + AV_PERM_REUSE2, + link->w, link->h); + + av_image_copy(picref->data, picref->linesize, + c->frame.data, c->frame.linesize, + picref->format, link->w, link->h); + + picref->pts = c->pts; + picref->video->pixel_aspect = c->pixel_aspect; + picref->video->interlaced = c->frame.interlaced_frame; + picref->video->top_field_first = c->frame.top_field_first; + avfilter_start_frame(link, avfilter_ref_buffer(picref, ~0)); + avfilter_draw_slice(link, 0, link->h, 1); + avfilter_end_frame(link); + avfilter_unref_buffer(picref); + + c->has_frame = 0; + + return 0; +} + +static int poll_frame(AVFilterLink *link) +{ + BufferSourceContext *c = link->src->priv; + return !!(c->has_frame); +} + +AVFilter avfilter_vsrc_buffer = { + .name = "buffer", + .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them accessible to the filterchain."), + .priv_size = sizeof(BufferSourceContext), + .query_formats = query_formats, + + .init = init, + + .inputs = (AVFilterPad[]) {{ .name = NULL }}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .request_frame = request_frame, + .poll_frame = poll_frame, + .config_props = config_props, }, + { .name = NULL}}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vsrc_buffer.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vsrc_buffer.h new file mode 100644 index 00000000..a77e42f3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vsrc_buffer.h @@ -0,0 +1,27 @@ +/* + * Memory buffer source filter + * Copyright (c) 2008 Vitor Sessak + * + * 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 + */ + +#include "libavcodec/avcodec.h" /* AVFrame */ +#include "avfilter.h" + +int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, + int64_t pts, AVRational pixel_aspect); + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vsrc_nullsrc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vsrc_nullsrc.c new file mode 100644 index 00000000..1cd06e13 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/vsrc_nullsrc.c @@ -0,0 +1,129 @@ +/* + * 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 + * null video source + */ + +#include "libavutil/avstring.h" +#include "libavutil/eval.h" +#include "libavcore/parseutils.h" +#include "avfilter.h" + +static const char *var_names[] = { + "E", + "PHI", + "PI", + "AVTB", /* default timebase 1/AV_TIME_BASE */ + NULL +}; + +enum var_name { + VAR_E, + VAR_PHI, + VAR_PI, + VAR_AVTB, + VAR_VARS_NB +}; + +typedef struct { + int w, h; + char tb_expr[256]; + double var_values[VAR_VARS_NB]; +} NullContext; + +static int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + NullContext *priv = ctx->priv; + + priv->w = 352; + priv->h = 288; + av_strlcpy(priv->tb_expr, "AVTB", sizeof(priv->tb_expr)); + + if (args) + sscanf(args, "%d:%d:%255[^:]", &priv->w, &priv->h, priv->tb_expr); + + if (priv->w <= 0 || priv->h <= 0) { + av_log(ctx, AV_LOG_ERROR, "Non-positive size values are not acceptable.\n"); + return AVERROR(EINVAL); + } + + return 0; +} + +static int config_props(AVFilterLink *outlink) +{ + AVFilterContext *ctx = outlink->src; + NullContext *priv = ctx->priv; + AVRational tb; + int ret; + double res; + + priv->var_values[VAR_E] = M_E; + priv->var_values[VAR_PHI] = M_PHI; + priv->var_values[VAR_PI] = M_PI; + priv->var_values[VAR_AVTB] = av_q2d(AV_TIME_BASE_Q); + + if ((ret = av_expr_parse_and_eval(&res, priv->tb_expr, var_names, priv->var_values, + NULL, NULL, NULL, NULL, NULL, 0, NULL)) < 0) { + av_log(ctx, AV_LOG_ERROR, "Invalid expression '%s' for timebase.\n", priv->tb_expr); + return ret; + } + tb = av_d2q(res, INT_MAX); + if (tb.num <= 0 || tb.den <= 0) { + av_log(ctx, AV_LOG_ERROR, + "Invalid non-positive value for the timebase %d/%d.\n", + tb.num, tb.den); + return AVERROR(EINVAL); + } + + outlink->w = priv->w; + outlink->h = priv->h; + outlink->time_base = tb; + + av_log(outlink->src, AV_LOG_INFO, "w:%d h:%d tb:%d/%d\n", priv->w, priv->h, + tb.num, tb.den); + + return 0; +} + +static int request_frame(AVFilterLink *link) +{ + return -1; +} + +AVFilter avfilter_vsrc_nullsrc = { + .name = "nullsrc", + .description = NULL_IF_CONFIG_SMALL("Null video source, never return images."), + + .init = init, + .priv_size = sizeof(NullContext), + + .inputs = (AVFilterPad[]) {{ .name = NULL}}, + + .outputs = (AVFilterPad[]) { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_props, + .request_frame = request_frame, + }, + { .name = NULL} + }, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/x86/Makefile b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/x86/Makefile new file mode 100644 index 00000000..e98693d6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/x86/Makefile @@ -0,0 +1,2 @@ +MMX-OBJS-$(CONFIG_YADIF_FILTER) += x86/yadif.o +MMX-OBJS-$(CONFIG_GRADFUN_FILTER) += x86/gradfun.o diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/x86/gradfun.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/x86/gradfun.c new file mode 100644 index 00000000..894a44b9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/x86/gradfun.c @@ -0,0 +1,162 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + */ + +#include "libavutil/cpu.h" +#include "libavutil/x86_cpu.h" +#include "libavfilter/gradfun.h" + +DECLARE_ALIGNED(16, static const uint16_t, pw_7f)[8] = {0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F}; +DECLARE_ALIGNED(16, static const uint16_t, pw_ff)[8] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; + +void ff_gradfun_filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers) +{ +#if HAVE_MMX + intptr_t x; + if (width & 3) { + x = width & ~3; + ff_gradfun_filter_line_c(dst + x, src + x, dc + x / 2, width - x, thresh, dithers); + width = x; + } + x = -width; + __asm__ volatile( + "movd %4, %%mm5 \n" + "pxor %%mm7, %%mm7 \n" + "pshufw $0, %%mm5, %%mm5 \n" + "movq %6, %%mm6 \n" + "movq %5, %%mm4 \n" + "1: \n" + "movd (%2,%0), %%mm0 \n" + "movd (%3,%0), %%mm1 \n" + "punpcklbw %%mm7, %%mm0 \n" + "punpcklwd %%mm1, %%mm1 \n" + "psllw $7, %%mm0 \n" + "pxor %%mm2, %%mm2 \n" + "psubw %%mm0, %%mm1 \n" // delta = dc - pix + "psubw %%mm1, %%mm2 \n" + "pmaxsw %%mm1, %%mm2 \n" + "pmulhuw %%mm5, %%mm2 \n" // m = abs(delta) * thresh >> 16 + "psubw %%mm6, %%mm2 \n" + "pminsw %%mm7, %%mm2 \n" // m = -max(0, 127-m) + "pmullw %%mm2, %%mm2 \n" + "paddw %%mm4, %%mm0 \n" // pix += dither + "pmulhw %%mm2, %%mm1 \n" + "psllw $2, %%mm1 \n" // m = m*m*delta >> 14 + "paddw %%mm1, %%mm0 \n" // pix += m + "psraw $7, %%mm0 \n" + "packuswb %%mm0, %%mm0 \n" + "movd %%mm0, (%1,%0) \n" // dst = clip(pix>>7) + "add $4, %0 \n" + "jl 1b \n" + "emms \n" + :"+r"(x) + :"r"(dst+width), "r"(src+width), "r"(dc+width/2), + "rm"(thresh), "m"(*dithers), "m"(*pw_7f) + :"memory" + ); +#endif +} + +void ff_gradfun_filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers) +{ +#if HAVE_SSSE3 + intptr_t x; + if (width & 7) { + // could be 10% faster if I somehow eliminated this + x = width & ~7; + ff_gradfun_filter_line_c(dst + x, src + x, dc + x / 2, width - x, thresh, dithers); + width = x; + } + x = -width; + __asm__ volatile( + "movd %4, %%xmm5 \n" + "pxor %%xmm7, %%xmm7 \n" + "pshuflw $0,%%xmm5, %%xmm5 \n" + "movdqa %6, %%xmm6 \n" + "punpcklqdq %%xmm5, %%xmm5 \n" + "movdqa %5, %%xmm4 \n" + "1: \n" + "movq (%2,%0), %%xmm0 \n" + "movq (%3,%0), %%xmm1 \n" + "punpcklbw %%xmm7, %%xmm0 \n" + "punpcklwd %%xmm1, %%xmm1 \n" + "psllw $7, %%xmm0 \n" + "psubw %%xmm0, %%xmm1 \n" // delta = dc - pix + "pabsw %%xmm1, %%xmm2 \n" + "pmulhuw %%xmm5, %%xmm2 \n" // m = abs(delta) * thresh >> 16 + "psubw %%xmm6, %%xmm2 \n" + "pminsw %%xmm7, %%xmm2 \n" // m = -max(0, 127-m) + "pmullw %%xmm2, %%xmm2 \n" + "psllw $1, %%xmm2 \n" + "paddw %%xmm4, %%xmm0 \n" // pix += dither + "pmulhrsw %%xmm2, %%xmm1 \n" // m = m*m*delta >> 14 + "paddw %%xmm1, %%xmm0 \n" // pix += m + "psraw $7, %%xmm0 \n" + "packuswb %%xmm0, %%xmm0 \n" + "movq %%xmm0, (%1,%0) \n" // dst = clip(pix>>7) + "add $8, %0 \n" + "jl 1b \n" + :"+&r"(x) + :"r"(dst+width), "r"(src+width), "r"(dc+width/2), + "rm"(thresh), "m"(*dithers), "m"(*pw_7f) + :"memory" + ); +#endif // HAVE_SSSE3 +} + +void ff_gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width) +{ +#if HAVE_SSE +#define BLURV(load)\ + intptr_t x = -2*width;\ + __asm__ volatile(\ + "movdqa %6, %%xmm7 \n"\ + "1: \n"\ + load" (%4,%0), %%xmm0 \n"\ + load" (%5,%0), %%xmm1 \n"\ + "movdqa %%xmm0, %%xmm2 \n"\ + "movdqa %%xmm1, %%xmm3 \n"\ + "psrlw $8, %%xmm0 \n"\ + "psrlw $8, %%xmm1 \n"\ + "pand %%xmm7, %%xmm2 \n"\ + "pand %%xmm7, %%xmm3 \n"\ + "paddw %%xmm1, %%xmm0 \n"\ + "paddw %%xmm3, %%xmm2 \n"\ + "paddw %%xmm2, %%xmm0 \n"\ + "paddw (%2,%0), %%xmm0 \n"\ + "movdqa (%1,%0), %%xmm1 \n"\ + "movdqa %%xmm0, (%1,%0) \n"\ + "psubw %%xmm1, %%xmm0 \n"\ + "movdqa %%xmm0, (%3,%0) \n"\ + "add $16, %0 \n"\ + "jl 1b \n"\ + :"+&r"(x)\ + :"r"(buf+width),\ + "r"(buf1+width),\ + "r"(dc+width),\ + "r"(src+width*2),\ + "r"(src+width*2+src_linesize),\ + "m"(*pw_ff)\ + :"memory"\ + ); + if (((intptr_t) src | src_linesize) & 15) { + BLURV("movdqu"); + } else { + BLURV("movdqa"); + } +#endif // HAVE_SSE +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/x86/yadif.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/x86/yadif.c new file mode 100644 index 00000000..2b55c007 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/x86/yadif.c @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + */ + +#include "libavutil/cpu.h" +#include "libavutil/x86_cpu.h" +#include "libavcodec/x86/dsputil_mmx.h" +#include "libavfilter/yadif.h" + +DECLARE_ASM_CONST(16, const xmm_reg, pb_1) = {0x0101010101010101ULL, 0x0101010101010101ULL}; +DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x0001000100010001ULL}; + +#if HAVE_SSSE3 +#define COMPILE_TEMPLATE_SSE 1 +#define COMPILE_TEMPLATE_SSSE3 1 +#undef RENAME +#define RENAME(a) a ## _ssse3 +#include "yadif_template.c" +#undef COMPILE_TEMPLATE_SSSE3 +#endif + +#if HAVE_SSE +#undef RENAME +#define RENAME(a) a ## _sse2 +#include "yadif_template.c" +#undef COMPILE_TEMPLATE_SSE +#endif + +#if HAVE_MMX +#undef RENAME +#define RENAME(a) a ## _mmx +#include "yadif_template.c" +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/x86/yadif_template.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/x86/yadif_template.c new file mode 100644 index 00000000..3e520cb1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/x86/yadif_template.c @@ -0,0 +1,268 @@ +/* + * Copyright (C) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + */ + +#ifdef COMPILE_TEMPLATE_SSE +#define MM "%%xmm" +#define MOV "movq" +#define MOVQ "movdqa" +#define MOVQU "movdqu" +#define STEP 8 +#define LOAD(mem,dst) \ + MOV" "mem", "dst" \n\t"\ + "punpcklbw "MM"7, "dst" \n\t" +#define PSRL1(reg) "psrldq $1, "reg" \n\t" +#define PSRL2(reg) "psrldq $2, "reg" \n\t" +#define PSHUF(src,dst) "movdqa "dst", "src" \n\t"\ + "psrldq $2, "src" \n\t" +#else +#define MM "%%mm" +#define MOV "movd" +#define MOVQ "movq" +#define MOVQU "movq" +#define STEP 4 +#define LOAD(mem,dst) \ + MOV" "mem", "dst" \n\t"\ + "punpcklbw "MM"7, "dst" \n\t" +#define PSRL1(reg) "psrlq $8, "reg" \n\t" +#define PSRL2(reg) "psrlq $16, "reg" \n\t" +#define PSHUF(src,dst) "pshufw $9, "dst", "src" \n\t" +#endif + +#ifdef COMPILE_TEMPLATE_SSSE3 +#define PABS(tmp,dst) \ + "pabsw "dst", "dst" \n\t" +#else +#define PABS(tmp,dst) \ + "pxor "tmp", "tmp" \n\t"\ + "psubw "dst", "tmp" \n\t"\ + "pmaxsw "tmp", "dst" \n\t" +#endif + +#define CHECK(pj,mj) \ + MOVQU" "#pj"(%[cur],%[mrefs]), "MM"2 \n\t" /* cur[x-refs-1+j] */\ + MOVQU" "#mj"(%[cur],%[prefs]), "MM"3 \n\t" /* cur[x+refs-1-j] */\ + MOVQ" "MM"2, "MM"4 \n\t"\ + MOVQ" "MM"2, "MM"5 \n\t"\ + "pxor "MM"3, "MM"4 \n\t"\ + "pavgb "MM"3, "MM"5 \n\t"\ + "pand "MANGLE(pb_1)", "MM"4 \n\t"\ + "psubusb "MM"4, "MM"5 \n\t"\ + PSRL1(MM"5") \ + "punpcklbw "MM"7, "MM"5 \n\t" /* (cur[x-refs+j] + cur[x+refs-j])>>1 */\ + MOVQ" "MM"2, "MM"4 \n\t"\ + "psubusb "MM"3, "MM"2 \n\t"\ + "psubusb "MM"4, "MM"3 \n\t"\ + "pmaxub "MM"3, "MM"2 \n\t"\ + MOVQ" "MM"2, "MM"3 \n\t"\ + MOVQ" "MM"2, "MM"4 \n\t" /* ABS(cur[x-refs-1+j] - cur[x+refs-1-j]) */\ + PSRL1(MM"3") /* ABS(cur[x-refs +j] - cur[x+refs -j]) */\ + PSRL2(MM"4") /* ABS(cur[x-refs+1+j] - cur[x+refs+1-j]) */\ + "punpcklbw "MM"7, "MM"2 \n\t"\ + "punpcklbw "MM"7, "MM"3 \n\t"\ + "punpcklbw "MM"7, "MM"4 \n\t"\ + "paddw "MM"3, "MM"2 \n\t"\ + "paddw "MM"4, "MM"2 \n\t" /* score */ + +#define CHECK1 \ + MOVQ" "MM"0, "MM"3 \n\t"\ + "pcmpgtw "MM"2, "MM"3 \n\t" /* if(score < spatial_score) */\ + "pminsw "MM"2, "MM"0 \n\t" /* spatial_score= score; */\ + MOVQ" "MM"3, "MM"6 \n\t"\ + "pand "MM"3, "MM"5 \n\t"\ + "pandn "MM"1, "MM"3 \n\t"\ + "por "MM"5, "MM"3 \n\t"\ + MOVQ" "MM"3, "MM"1 \n\t" /* spatial_pred= (cur[x-refs+j] + cur[x+refs-j])>>1; */ + +#define CHECK2 /* pretend not to have checked dir=2 if dir=1 was bad.\ + hurts both quality and speed, but matches the C version. */\ + "paddw "MANGLE(pw_1)", "MM"6 \n\t"\ + "psllw $14, "MM"6 \n\t"\ + "paddsw "MM"6, "MM"2 \n\t"\ + MOVQ" "MM"0, "MM"3 \n\t"\ + "pcmpgtw "MM"2, "MM"3 \n\t"\ + "pminsw "MM"2, "MM"0 \n\t"\ + "pand "MM"3, "MM"5 \n\t"\ + "pandn "MM"1, "MM"3 \n\t"\ + "por "MM"5, "MM"3 \n\t"\ + MOVQ" "MM"3, "MM"1 \n\t" + +void RENAME(ff_yadif_filter_line)(uint8_t *dst, + uint8_t *prev, uint8_t *cur, uint8_t *next, + int w, int refs, int parity, int mode) +{ + DECLARE_ALIGNED(16, uint8_t, tmp0[16]); + DECLARE_ALIGNED(16, uint8_t, tmp1[16]); + DECLARE_ALIGNED(16, uint8_t, tmp2[16]); + DECLARE_ALIGNED(16, uint8_t, tmp3[16]); + int x; + +#define FILTER\ + for(x=0; x>1 */\ + MOVQ" "MM"0, %[tmp0] \n\t" /* c */\ + MOVQ" "MM"3, %[tmp1] \n\t" /* d */\ + MOVQ" "MM"1, %[tmp2] \n\t" /* e */\ + "psubw "MM"4, "MM"2 \n\t"\ + PABS( MM"4", MM"2") /* temporal_diff0 */\ + LOAD("(%[prev],%[mrefs])", MM"3") /* prev[x-refs] */\ + LOAD("(%[prev],%[prefs])", MM"4") /* prev[x+refs] */\ + "psubw "MM"0, "MM"3 \n\t"\ + "psubw "MM"1, "MM"4 \n\t"\ + PABS( MM"5", MM"3")\ + PABS( MM"5", MM"4")\ + "paddw "MM"4, "MM"3 \n\t" /* temporal_diff1 */\ + "psrlw $1, "MM"2 \n\t"\ + "psrlw $1, "MM"3 \n\t"\ + "pmaxsw "MM"3, "MM"2 \n\t"\ + LOAD("(%[next],%[mrefs])", MM"3") /* next[x-refs] */\ + LOAD("(%[next],%[prefs])", MM"4") /* next[x+refs] */\ + "psubw "MM"0, "MM"3 \n\t"\ + "psubw "MM"1, "MM"4 \n\t"\ + PABS( MM"5", MM"3")\ + PABS( MM"5", MM"4")\ + "paddw "MM"4, "MM"3 \n\t" /* temporal_diff2 */\ + "psrlw $1, "MM"3 \n\t"\ + "pmaxsw "MM"3, "MM"2 \n\t"\ + MOVQ" "MM"2, %[tmp3] \n\t" /* diff */\ +\ + "paddw "MM"0, "MM"1 \n\t"\ + "paddw "MM"0, "MM"0 \n\t"\ + "psubw "MM"1, "MM"0 \n\t"\ + "psrlw $1, "MM"1 \n\t" /* spatial_pred */\ + PABS( MM"2", MM"0") /* ABS(c-e) */\ +\ + MOVQU" -1(%[cur],%[mrefs]), "MM"2 \n\t" /* cur[x-refs-1] */\ + MOVQU" -1(%[cur],%[prefs]), "MM"3 \n\t" /* cur[x+refs-1] */\ + MOVQ" "MM"2, "MM"4 \n\t"\ + "psubusb "MM"3, "MM"2 \n\t"\ + "psubusb "MM"4, "MM"3 \n\t"\ + "pmaxub "MM"3, "MM"2 \n\t"\ + PSHUF(MM"3", MM"2") \ + "punpcklbw "MM"7, "MM"2 \n\t" /* ABS(cur[x-refs-1] - cur[x+refs-1]) */\ + "punpcklbw "MM"7, "MM"3 \n\t" /* ABS(cur[x-refs+1] - cur[x+refs+1]) */\ + "paddw "MM"2, "MM"0 \n\t"\ + "paddw "MM"3, "MM"0 \n\t"\ + "psubw "MANGLE(pw_1)", "MM"0 \n\t" /* spatial_score */\ +\ + CHECK(-2,0)\ + CHECK1\ + CHECK(-3,1)\ + CHECK2\ + CHECK(0,-2)\ + CHECK1\ + CHECK(1,-3)\ + CHECK2\ +\ + /* if(p->mode<2) ... */\ + MOVQ" %[tmp3], "MM"6 \n\t" /* diff */\ + "cmpl $2, %[mode] \n\t"\ + "jge 1f \n\t"\ + LOAD("(%["prev2"],%[mrefs],2)", MM"2") /* prev2[x-2*refs] */\ + LOAD("(%["next2"],%[mrefs],2)", MM"4") /* next2[x-2*refs] */\ + LOAD("(%["prev2"],%[prefs],2)", MM"3") /* prev2[x+2*refs] */\ + LOAD("(%["next2"],%[prefs],2)", MM"5") /* next2[x+2*refs] */\ + "paddw "MM"4, "MM"2 \n\t"\ + "paddw "MM"5, "MM"3 \n\t"\ + "psrlw $1, "MM"2 \n\t" /* b */\ + "psrlw $1, "MM"3 \n\t" /* f */\ + MOVQ" %[tmp0], "MM"4 \n\t" /* c */\ + MOVQ" %[tmp1], "MM"5 \n\t" /* d */\ + MOVQ" %[tmp2], "MM"7 \n\t" /* e */\ + "psubw "MM"4, "MM"2 \n\t" /* b-c */\ + "psubw "MM"7, "MM"3 \n\t" /* f-e */\ + MOVQ" "MM"5, "MM"0 \n\t"\ + "psubw "MM"4, "MM"5 \n\t" /* d-c */\ + "psubw "MM"7, "MM"0 \n\t" /* d-e */\ + MOVQ" "MM"2, "MM"4 \n\t"\ + "pminsw "MM"3, "MM"2 \n\t"\ + "pmaxsw "MM"4, "MM"3 \n\t"\ + "pmaxsw "MM"5, "MM"2 \n\t"\ + "pminsw "MM"5, "MM"3 \n\t"\ + "pmaxsw "MM"0, "MM"2 \n\t" /* max */\ + "pminsw "MM"0, "MM"3 \n\t" /* min */\ + "pxor "MM"4, "MM"4 \n\t"\ + "pmaxsw "MM"3, "MM"6 \n\t"\ + "psubw "MM"2, "MM"4 \n\t" /* -max */\ + "pmaxsw "MM"4, "MM"6 \n\t" /* diff= MAX3(diff, min, -max); */\ + "1: \n\t"\ +\ + MOVQ" %[tmp1], "MM"2 \n\t" /* d */\ + MOVQ" "MM"2, "MM"3 \n\t"\ + "psubw "MM"6, "MM"2 \n\t" /* d-diff */\ + "paddw "MM"6, "MM"3 \n\t" /* d+diff */\ + "pmaxsw "MM"2, "MM"1 \n\t"\ + "pminsw "MM"3, "MM"1 \n\t" /* d = clip(spatial_pred, d-diff, d+diff); */\ + "packuswb "MM"1, "MM"1 \n\t"\ +\ + :[tmp0]"=m"(tmp0),\ + [tmp1]"=m"(tmp1),\ + [tmp2]"=m"(tmp2),\ + [tmp3]"=m"(tmp3)\ + :[prev] "r"(prev),\ + [cur] "r"(cur),\ + [next] "r"(next),\ + [prefs]"r"((x86_reg)refs),\ + [mrefs]"r"((x86_reg)-refs),\ + [mode] "g"(mode)\ + );\ + __asm__ volatile(MOV" "MM"1, %0" :"=m"(*dst));\ + dst += STEP;\ + prev+= STEP;\ + cur += STEP;\ + next+= STEP;\ + } + + if (parity) { +#define prev2 "prev" +#define next2 "cur" + FILTER +#undef prev2 +#undef next2 + } else { +#define prev2 "cur" +#define next2 "next" + FILTER +#undef prev2 +#undef next2 + } +} +#undef STEP +#undef MM +#undef MOV +#undef MOVQ +#undef MOVQU +#undef PSHUF +#undef PSRL1 +#undef PSRL2 +#undef LOAD +#undef PABS +#undef CHECK +#undef CHECK1 +#undef CHECK2 +#undef FILTER + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/yadif.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/yadif.h new file mode 100644 index 00000000..072812c5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavfilter/yadif.h @@ -0,0 +1,36 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + */ + +#ifndef AVFILTER_YADIF_H +#define AVFILTER_YADIF_H + +#include "avfilter.h" + +void ff_yadif_filter_line_mmx(uint8_t *dst, + uint8_t *prev, uint8_t *cur, uint8_t *next, + int w, int refs, int parity, int mode); + +void ff_yadif_filter_line_sse2(uint8_t *dst, + uint8_t *prev, uint8_t *cur, uint8_t *next, + int w, int refs, int parity, int mode); + +void ff_yadif_filter_line_ssse3(uint8_t *dst, + uint8_t *prev, uint8_t *cur, uint8_t *next, + int w, int refs, int parity, int mode); + +#endif /* AVFILTER_YADIF_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/a64.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/a64.c new file mode 100644 index 00000000..46441b23 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/a64.c @@ -0,0 +1,177 @@ +/* + * a64 muxer + * Copyright (c) 2009 Tobias Bindhammer + * + * 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 + */ + +#include "libavcodec/avcodec.h" +#include "libavcodec/a64enc.h" +#include "libavcodec/bytestream.h" +#include "avformat.h" + +typedef struct A64MuxerContext { + int interleaved; + AVPacket prev_pkt; + int prev_frame_count; +} A64MuxerContext; + +static int a64_write_header(struct AVFormatContext *s) +{ + AVCodecContext *avctx = s->streams[0]->codec; + A64MuxerContext *c = s->priv_data; + uint8_t header[5] = { + 0x00, //load + 0x40, //address + 0x00, //mode + 0x00, //charset_lifetime (multi only) + 0x00 //fps in 50/fps; + }; + c->interleaved = 0; + switch (avctx->codec->id) { + case CODEC_ID_A64_MULTI: + header[2] = 0x00; + header[3] = AV_RB32(avctx->extradata+0); + header[4] = 2; + break; + case CODEC_ID_A64_MULTI5: + header[2] = 0x01; + header[3] = AV_RB32(avctx->extradata+0); + header[4] = 3; + break; + default: + return AVERROR(EINVAL); + break; + } + put_buffer(s->pb, header, 2); + c->prev_pkt.size = 0; + c->prev_frame_count = 0; + return 0; +} + +static int a64_write_packet(struct AVFormatContext *s, AVPacket *pkt) +{ + AVCodecContext *avctx = s->streams[0]->codec; + A64MuxerContext *c = s->priv_data; + int i, j; + int ch_chunksize; + int lifetime; + int frame_count; + int charset_size; + int frame_size; + int num_frames; + + /* fetch values from extradata */ + switch (avctx->codec->id) { + case CODEC_ID_A64_MULTI: + case CODEC_ID_A64_MULTI5: + if(c->interleaved) { + /* Write interleaved, means we insert chunks of the future charset before each current frame. + * Reason: if we load 1 charset + corresponding frames in one block on c64, we need to store + * them first and then display frame by frame to keep in sync. Thus we would read and write + * the data for colram from/to ram first and waste too much time. If we interleave and send the + * charset beforehand, we assemble a new charset chunk by chunk, write current screen data to + * screen-ram to be displayed and decode the colram directly to colram-location $d800 during + * the overscan, while reading directly from source. + * This is the only way so far, to achieve 25fps on c64 */ + if(avctx->extradata) { + /* fetch values from extradata */ + lifetime = AV_RB32(avctx->extradata + 0); + frame_count = AV_RB32(avctx->extradata + 4); + charset_size = AV_RB32(avctx->extradata + 8); + frame_size = AV_RB32(avctx->extradata + 12); + + /* TODO: sanity checks? */ + } else { + av_log(avctx, AV_LOG_ERROR, "extradata not set\n"); + return AVERROR(EINVAL); + } + + ch_chunksize=charset_size/lifetime; + /* TODO: check if charset/size is % lifetime, but maybe check in codec */ + + if(pkt->data) num_frames = lifetime; + else num_frames = c->prev_frame_count; + + for(i = 0; i < num_frames; i++) { + if(pkt->data) { + /* if available, put newest charset chunk into buffer */ + put_buffer(s->pb, pkt->data + ch_chunksize * i, ch_chunksize); + } else { + /* a bit ugly, but is there an alternative to put many zeros? */ + for(j = 0; j < ch_chunksize; j++) put_byte(s->pb, 0); + } + + if(c->prev_pkt.data) { + /* put frame (screen + colram) from last packet into buffer */ + put_buffer(s->pb, c->prev_pkt.data + charset_size + frame_size * i, frame_size); + } else { + /* a bit ugly, but is there an alternative to put many zeros? */ + for(j = 0; j < frame_size; j++) put_byte(s->pb, 0); + } + } + + /* backup current packet for next turn */ + if(pkt->data) { + /* no backup packet yet? create one! */ + if(!c->prev_pkt.data) av_new_packet(&c->prev_pkt, pkt->size); + /* we have a packet and data is big enough, reuse it */ + if(c->prev_pkt.data && c->prev_pkt.size >= pkt->size) { + memcpy(c->prev_pkt.data, pkt->data, pkt->size); + c->prev_pkt.size = pkt->size; + } else { + av_log(avctx, AV_LOG_ERROR, "Too less memory for prev_pkt.\n"); + return AVERROR(ENOMEM); + } + } + + c->prev_frame_count = frame_count; + break; + } + default: + /* Write things as is. Nice for self-contained frames from non-multicolor modes or if played + * directly from ram and not from a streaming device (rrnet/mmc) */ + if(pkt) put_buffer(s->pb, pkt->data, pkt->size); + break; + } + + put_flush_packet(s->pb); + return 0; +} + +static int a64_write_trailer(struct AVFormatContext *s) +{ + A64MuxerContext *c = s->priv_data; + AVPacket pkt = {0}; + /* need to flush last packet? */ + if(c->interleaved) a64_write_packet(s, &pkt); + /* discard backed up packet */ + if(c->prev_pkt.data) av_destruct_packet(&c->prev_pkt); + return 0; +} + +AVOutputFormat ff_a64_muxer = { + .name = "a64", + .long_name = NULL_IF_CONFIG_SMALL("a64 - video for Commodore 64"), + .mime_type = NULL, + .extensions = "a64, A64", + .priv_data_size = sizeof (A64Context), + .video_codec = CODEC_ID_A64_MULTI, + a64_write_header, + a64_write_packet, + a64_write_trailer +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aacdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aacdec.c new file mode 100644 index 00000000..47e9bf3a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aacdec.c @@ -0,0 +1,94 @@ +/* + * raw ADTS AAC demuxer + * Copyright (c) 2008 Michael Niedermayer + * Copyright (c) 2009 Robert Swain ( rob opendot cl ) + * + * 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 + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "rawdec.h" +#include "id3v1.h" + + +static int adts_aac_probe(AVProbeData *p) +{ + int max_frames = 0, first_frames = 0; + int fsize, frames; + uint8_t *buf0 = p->buf; + uint8_t *buf2; + uint8_t *buf; + uint8_t *end = buf0 + p->buf_size - 7; + + buf = buf0; + + for(; buf < end; buf= buf2+1) { + buf2 = buf; + + for(frames = 0; buf2 < end; frames++) { + uint32_t header = AV_RB16(buf2); + if((header&0xFFF6) != 0xFFF0) + break; + fsize = (AV_RB32(buf2+3)>>13) & 0x8FFF; + if(fsize < 7) + break; + buf2 += fsize; + } + max_frames = FFMAX(max_frames, frames); + if(buf == buf0) + first_frames= frames; + } + if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1; + else if(max_frames>500)return AVPROBE_SCORE_MAX/2; + else if(max_frames>=3) return AVPROBE_SCORE_MAX/4; + else if(max_frames>=1) return 1; + else return 0; +} + +static int adts_aac_read_header(AVFormatContext *s, + AVFormatParameters *ap) +{ + AVStream *st; + + st = av_new_stream(s, 0); + if (!st) + return AVERROR(ENOMEM); + + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; + st->codec->codec_id = s->iformat->value; + st->need_parsing = AVSTREAM_PARSE_FULL; + + ff_id3v1_read(s); + + //LCM of all possible ADTS sample rates + av_set_pts_info(st, 64, 1, 28224000); + + return 0; +} + +AVInputFormat ff_aac_demuxer = { + "aac", + NULL_IF_CONFIG_SMALL("raw ADTS AAC"), + 0, + adts_aac_probe, + adts_aac_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "aac", + .value = CODEC_ID_AAC, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ac3dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ac3dec.c new file mode 100644 index 00000000..fcf99363 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ac3dec.c @@ -0,0 +1,103 @@ +/* + * RAW AC-3 and E-AC-3 demuxer + * Copyright (c) 2007 Justin Ruggles + * + * 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 + */ + +#include "libavutil/crc.h" +#include "libavcodec/ac3_parser.h" +#include "avformat.h" +#include "rawdec.h" + +static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id) +{ + int max_frames, first_frames = 0, frames; + uint8_t *buf, *buf2, *end; + AC3HeaderInfo hdr; + GetBitContext gbc; + enum CodecID codec_id = CODEC_ID_AC3; + + max_frames = 0; + buf = p->buf; + end = buf + p->buf_size; + + for(; buf < end; buf++) { + buf2 = buf; + + for(frames = 0; buf2 < end; frames++) { + init_get_bits(&gbc, buf2, 54); + if(ff_ac3_parse_header(&gbc, &hdr) < 0) + break; + if(buf2 + hdr.frame_size > end || + av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, buf2 + 2, hdr.frame_size - 2)) + break; + if (hdr.bitstream_id > 10) + codec_id = CODEC_ID_EAC3; + buf2 += hdr.frame_size; + } + max_frames = FFMAX(max_frames, frames); + if(buf == p->buf) + first_frames = frames; + } + if(codec_id != expected_codec_id) return 0; + // keep this in sync with mp3 probe, both need to avoid + // issues with MPEG-files! + if (first_frames>=4) return AVPROBE_SCORE_MAX/2+1; + else if(max_frames>500)return AVPROBE_SCORE_MAX/2; + else if(max_frames>=4) return AVPROBE_SCORE_MAX/4; + else if(max_frames>=1) return 1; + else return 0; +} + +#if CONFIG_AC3_DEMUXER +static int ac3_probe(AVProbeData *p) +{ + return ac3_eac3_probe(p, CODEC_ID_AC3); +} + +AVInputFormat ff_ac3_demuxer = { + "ac3", + NULL_IF_CONFIG_SMALL("raw AC-3"), + 0, + ac3_probe, + ff_raw_audio_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "ac3", + .value = CODEC_ID_AC3, +}; +#endif + +#if CONFIG_EAC3_DEMUXER +static int eac3_probe(AVProbeData *p) +{ + return ac3_eac3_probe(p, CODEC_ID_EAC3); +} + +AVInputFormat ff_eac3_demuxer = { + "eac3", + NULL_IF_CONFIG_SMALL("raw E-AC-3"), + 0, + eac3_probe, + ff_raw_audio_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "eac3", + .value = CODEC_ID_EAC3, +}; +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/adts.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/adts.h new file mode 100644 index 00000000..1da57bef --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/adts.h @@ -0,0 +1,45 @@ +/* + * ADTS muxer. + * Copyright (c) 2006 Baptiste Coudurier + * Mans Rullgard + * + * 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 + */ + +#ifndef AVFORMAT_ADTS_H +#define AVFORMAT_ADTS_H + +#include "avformat.h" +#include "libavcodec/mpeg4audio.h" + +#define ADTS_HEADER_SIZE 7 + +typedef struct { + int write_adts; + int objecttype; + int sample_rate_index; + int channel_conf; + int pce_size; + uint8_t pce_data[MAX_PCE_SIZE]; +} ADTSContext; + +int ff_adts_write_frame_header(ADTSContext *ctx, uint8_t *buf, + int size, int pce_size); +int ff_adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, + uint8_t *buf, int size); + +#endif /* AVFORMAT_ADTS_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiff.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiff.h new file mode 100644 index 00000000..047f81dc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiff.h @@ -0,0 +1,53 @@ +/* + * AIFF/AIFF-C muxer/demuxer common header + * Copyright (c) 2006 Patrick Guimond + * + * 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 + * common header for AIFF muxer and demuxer + */ + +#ifndef AVFORMAT_AIFF_H +#define AVFORMAT_AIFF_H + +#include "avformat.h" +#include "riff.h" + +static const AVCodecTag ff_codec_aiff_tags[] = { + { CODEC_ID_PCM_S16BE, MKTAG('N','O','N','E') }, + { CODEC_ID_PCM_S8, MKTAG('N','O','N','E') }, + { CODEC_ID_PCM_S24BE, MKTAG('N','O','N','E') }, + { CODEC_ID_PCM_S32BE, MKTAG('N','O','N','E') }, + { CODEC_ID_PCM_F32BE, MKTAG('f','l','3','2') }, + { CODEC_ID_PCM_F64BE, MKTAG('f','l','6','4') }, + { CODEC_ID_PCM_ALAW, MKTAG('a','l','a','w') }, + { CODEC_ID_PCM_MULAW, MKTAG('u','l','a','w') }, + { CODEC_ID_MACE3, MKTAG('M','A','C','3') }, + { CODEC_ID_MACE6, MKTAG('M','A','C','6') }, + { CODEC_ID_GSM, MKTAG('G','S','M',' ') }, + { CODEC_ID_ADPCM_G726, MKTAG('G','7','2','6') }, + { CODEC_ID_PCM_S16LE, MKTAG('s','o','w','t') }, + { CODEC_ID_ADPCM_IMA_QT, MKTAG('i','m','a','4') }, + { CODEC_ID_QDM2, MKTAG('Q','D','M','2') }, + { CODEC_ID_QCELP, MKTAG('Q','c','l','p') }, + { CODEC_ID_NONE, 0 }, +}; + +#endif /* AVFORMAT_AIFF_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiffdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiffdec.c new file mode 100644 index 00000000..b8410237 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiffdec.c @@ -0,0 +1,324 @@ +/* + * AIFF/AIFF-C demuxer + * Copyright (c) 2006 Patrick Guimond + * + * 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 + */ + +#include "libavutil/intfloat_readwrite.h" +#include "avformat.h" +#include "pcm.h" +#include "aiff.h" + +#define AIFF 0 +#define AIFF_C_VERSION1 0xA2805140 + +typedef struct { + int64_t data_end; +} AIFFInputContext; + +static enum CodecID aiff_codec_get_id(int bps) +{ + if (bps <= 8) + return CODEC_ID_PCM_S8; + if (bps <= 16) + return CODEC_ID_PCM_S16BE; + if (bps <= 24) + return CODEC_ID_PCM_S24BE; + if (bps <= 32) + return CODEC_ID_PCM_S32BE; + + /* bigger than 32 isn't allowed */ + return CODEC_ID_NONE; +} + +/* returns the size of the found tag */ +static int get_tag(ByteIOContext *pb, uint32_t * tag) +{ + int size; + + if (url_feof(pb)) + return AVERROR(EIO); + + *tag = get_le32(pb); + size = get_be32(pb); + + if (size < 0) + size = 0x7fffffff; + + return size; +} + +/* Metadata string read */ +static void get_meta(AVFormatContext *s, const char *key, int size) +{ + uint8_t *str = av_malloc(size+1); + int res; + + if (!str) { + url_fskip(s->pb, size); + return; + } + + res = get_buffer(s->pb, str, size); + if (res < 0) + return; + + str[res] = 0; + av_metadata_set2(&s->metadata, key, str, AV_METADATA_DONT_STRDUP_VAL); +} + +/* Returns the number of sound data frames or negative on error */ +static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec, + int size, unsigned version) +{ + AVExtFloat ext; + double sample_rate; + unsigned int num_frames; + + if (size & 1) + size++; + codec->codec_type = AVMEDIA_TYPE_AUDIO; + codec->channels = get_be16(pb); + num_frames = get_be32(pb); + codec->bits_per_coded_sample = get_be16(pb); + + get_buffer(pb, (uint8_t*)&ext, sizeof(ext));/* Sample rate is in */ + sample_rate = av_ext2dbl(ext); /* 80 bits BE IEEE extended float */ + codec->sample_rate = sample_rate; + size -= 18; + + /* Got an AIFF-C? */ + if (version == AIFF_C_VERSION1) { + codec->codec_tag = get_le32(pb); + codec->codec_id = ff_codec_get_id(ff_codec_aiff_tags, codec->codec_tag); + + switch (codec->codec_id) { + case CODEC_ID_PCM_S16BE: + codec->codec_id = aiff_codec_get_id(codec->bits_per_coded_sample); + codec->bits_per_coded_sample = av_get_bits_per_sample(codec->codec_id); + break; + case CODEC_ID_ADPCM_IMA_QT: + codec->block_align = 34*codec->channels; + codec->frame_size = 64; + break; + case CODEC_ID_MACE3: + codec->block_align = 2*codec->channels; + codec->frame_size = 6; + break; + case CODEC_ID_MACE6: + codec->block_align = 1*codec->channels; + codec->frame_size = 6; + break; + case CODEC_ID_GSM: + codec->block_align = 33; + codec->frame_size = 160; + break; + case CODEC_ID_QCELP: + codec->block_align = 35; + codec->frame_size= 160; + break; + default: + break; + } + size -= 4; + } else { + /* Need the codec type */ + codec->codec_id = aiff_codec_get_id(codec->bits_per_coded_sample); + codec->bits_per_coded_sample = av_get_bits_per_sample(codec->codec_id); + } + + /* Block align needs to be computed in all cases, as the definition + * is specific to applications -> here we use the WAVE format definition */ + if (!codec->block_align) + codec->block_align = (codec->bits_per_coded_sample * codec->channels) >> 3; + + codec->bit_rate = (codec->frame_size ? codec->sample_rate/codec->frame_size : + codec->sample_rate) * (codec->block_align << 3); + + /* Chunk is over */ + if (size) + url_fseek(pb, size, SEEK_CUR); + + return num_frames; +} + +static int aiff_probe(AVProbeData *p) +{ + /* check file header */ + if (p->buf[0] == 'F' && p->buf[1] == 'O' && + p->buf[2] == 'R' && p->buf[3] == 'M' && + p->buf[8] == 'A' && p->buf[9] == 'I' && + p->buf[10] == 'F' && (p->buf[11] == 'F' || p->buf[11] == 'C')) + return AVPROBE_SCORE_MAX; + else + return 0; +} + +/* aiff input */ +static int aiff_read_header(AVFormatContext *s, + AVFormatParameters *ap) +{ + int size, filesize; + int64_t offset = 0; + uint32_t tag; + unsigned version = AIFF_C_VERSION1; + ByteIOContext *pb = s->pb; + AVStream * st; + AIFFInputContext *aiff = s->priv_data; + + /* check FORM header */ + filesize = get_tag(pb, &tag); + if (filesize < 0 || tag != MKTAG('F', 'O', 'R', 'M')) + return AVERROR_INVALIDDATA; + + /* AIFF data type */ + tag = get_le32(pb); + if (tag == MKTAG('A', 'I', 'F', 'F')) /* Got an AIFF file */ + version = AIFF; + else if (tag != MKTAG('A', 'I', 'F', 'C')) /* An AIFF-C file then */ + return AVERROR_INVALIDDATA; + + filesize -= 4; + + st = av_new_stream(s, 0); + if (!st) + return AVERROR(ENOMEM); + + while (filesize > 0) { + /* parse different chunks */ + size = get_tag(pb, &tag); + if (size < 0) + return size; + + filesize -= size + 8; + + switch (tag) { + case MKTAG('C', 'O', 'M', 'M'): /* Common chunk */ + /* Then for the complete header info */ + st->nb_frames = get_aiff_header(pb, st->codec, size, version); + if (st->nb_frames < 0) + return st->nb_frames; + if (offset > 0) // COMM is after SSND + goto got_sound; + break; + case MKTAG('F', 'V', 'E', 'R'): /* Version chunk */ + version = get_be32(pb); + break; + case MKTAG('N', 'A', 'M', 'E'): /* Sample name chunk */ + get_meta(s, "title" , size); + break; + case MKTAG('A', 'U', 'T', 'H'): /* Author chunk */ + get_meta(s, "author" , size); + break; + case MKTAG('(', 'c', ')', ' '): /* Copyright chunk */ + get_meta(s, "copyright", size); + break; + case MKTAG('A', 'N', 'N', 'O'): /* Annotation chunk */ + get_meta(s, "comment" , size); + break; + case MKTAG('S', 'S', 'N', 'D'): /* Sampled sound chunk */ + aiff->data_end = url_ftell(pb) + size; + offset = get_be32(pb); /* Offset of sound data */ + get_be32(pb); /* BlockSize... don't care */ + offset += url_ftell(pb); /* Compute absolute data offset */ + if (st->codec->block_align) /* Assume COMM already parsed */ + goto got_sound; + if (url_is_streamed(pb)) { + av_log(s, AV_LOG_ERROR, "file is not seekable\n"); + return -1; + } + url_fskip(pb, size - 8); + break; + case MKTAG('w', 'a', 'v', 'e'): + if ((uint64_t)size > (1<<30)) + return -1; + st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE); + if (!st->codec->extradata) + return AVERROR(ENOMEM); + st->codec->extradata_size = size; + get_buffer(pb, st->codec->extradata, size); + break; + default: /* Jump */ + if (size & 1) /* Always even aligned */ + size++; + url_fskip (pb, size); + } + } + + if (!st->codec->block_align) { + av_log(s, AV_LOG_ERROR, "could not find COMM tag\n"); + return -1; + } + +got_sound: + /* Now positioned, get the sound data start and end */ + if (st->nb_frames) + s->file_size = st->nb_frames * st->codec->block_align; + + av_set_pts_info(st, 64, 1, st->codec->sample_rate); + st->start_time = 0; + st->duration = st->codec->frame_size ? + st->nb_frames * st->codec->frame_size : st->nb_frames; + + /* Position the stream at the first block */ + url_fseek(pb, offset, SEEK_SET); + + return 0; +} + +#define MAX_SIZE 4096 + +static int aiff_read_packet(AVFormatContext *s, + AVPacket *pkt) +{ + AVStream *st = s->streams[0]; + AIFFInputContext *aiff = s->priv_data; + int64_t max_size; + int res, size; + + /* calculate size of remaining data */ + max_size = aiff->data_end - url_ftell(s->pb); + if (max_size <= 0) + return AVERROR_EOF; + + /* Now for that packet */ + if (st->codec->block_align >= 33) // GSM, QCLP, IMA4 + size = st->codec->block_align; + else + size = (MAX_SIZE / st->codec->block_align) * st->codec->block_align; + size = FFMIN(max_size, size); + res = av_get_packet(s->pb, pkt, size); + if (res < 0) + return res; + + /* Only one stream in an AIFF file */ + pkt->stream_index = 0; + return 0; +} + +AVInputFormat ff_aiff_demuxer = { + "aiff", + NULL_IF_CONFIG_SMALL("Audio IFF"), + sizeof(AIFFInputContext), + aiff_probe, + aiff_read_header, + aiff_read_packet, + NULL, + pcm_read_seek, + .codec_tag= (const AVCodecTag* const []){ff_codec_aiff_tags, 0}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiffenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiffenc.c new file mode 100644 index 00000000..6e473907 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/aiffenc.c @@ -0,0 +1,160 @@ +/* + * AIFF/AIFF-C muxer + * Copyright (c) 2006 Patrick Guimond + * + * 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 + */ + +#include "avformat.h" +#include "aiff.h" + +typedef struct { + int64_t form; + int64_t frames; + int64_t ssnd; +} AIFFOutputContext; + +static int aiff_write_header(AVFormatContext *s) +{ + AIFFOutputContext *aiff = s->priv_data; + ByteIOContext *pb = s->pb; + AVCodecContext *enc = s->streams[0]->codec; + AVExtFloat sample_rate; + int aifc = 0; + + /* First verify if format is ok */ + if (!enc->codec_tag) + return -1; + if (enc->codec_tag != MKTAG('N','O','N','E')) + aifc = 1; + + /* FORM AIFF header */ + put_tag(pb, "FORM"); + aiff->form = url_ftell(pb); + put_be32(pb, 0); /* file length */ + put_tag(pb, aifc ? "AIFC" : "AIFF"); + + if (aifc) { // compressed audio + enc->bits_per_coded_sample = 16; + if (!enc->block_align) { + av_log(s, AV_LOG_ERROR, "block align not set\n"); + return -1; + } + /* Version chunk */ + put_tag(pb, "FVER"); + put_be32(pb, 4); + put_be32(pb, 0xA2805140); + } + + /* Common chunk */ + put_tag(pb, "COMM"); + put_be32(pb, aifc ? 24 : 18); /* size */ + put_be16(pb, enc->channels); /* Number of channels */ + + aiff->frames = url_ftell(pb); + put_be32(pb, 0); /* Number of frames */ + + if (!enc->bits_per_coded_sample) + enc->bits_per_coded_sample = av_get_bits_per_sample(enc->codec_id); + if (!enc->bits_per_coded_sample) { + av_log(s, AV_LOG_ERROR, "could not compute bits per sample\n"); + return -1; + } + if (!enc->block_align) + enc->block_align = (enc->bits_per_coded_sample * enc->channels) >> 3; + + put_be16(pb, enc->bits_per_coded_sample); /* Sample size */ + + sample_rate = av_dbl2ext((double)enc->sample_rate); + put_buffer(pb, (uint8_t*)&sample_rate, sizeof(sample_rate)); + + if (aifc) { + put_le32(pb, enc->codec_tag); + put_be16(pb, 0); + } + + /* Sound data chunk */ + put_tag(pb, "SSND"); + aiff->ssnd = url_ftell(pb); /* Sound chunk size */ + put_be32(pb, 0); /* Sound samples data size */ + put_be32(pb, 0); /* Data offset */ + put_be32(pb, 0); /* Block-size (block align) */ + + av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate); + + /* Data is starting here */ + put_flush_packet(pb); + + return 0; +} + +static int aiff_write_packet(AVFormatContext *s, AVPacket *pkt) +{ + ByteIOContext *pb = s->pb; + put_buffer(pb, pkt->data, pkt->size); + return 0; +} + +static int aiff_write_trailer(AVFormatContext *s) +{ + ByteIOContext *pb = s->pb; + AIFFOutputContext *aiff = s->priv_data; + AVCodecContext *enc = s->streams[0]->codec; + + /* Chunks sizes must be even */ + int64_t file_size, end_size; + end_size = file_size = url_ftell(pb); + if (file_size & 1) { + put_byte(pb, 0); + end_size++; + } + + if (!url_is_streamed(s->pb)) { + /* File length */ + url_fseek(pb, aiff->form, SEEK_SET); + put_be32(pb, file_size - aiff->form - 4); + + /* Number of sample frames */ + url_fseek(pb, aiff->frames, SEEK_SET); + put_be32(pb, (file_size-aiff->ssnd-12)/enc->block_align); + + /* Sound Data chunk size */ + url_fseek(pb, aiff->ssnd, SEEK_SET); + put_be32(pb, file_size - aiff->ssnd - 4); + + /* return to the end */ + url_fseek(pb, end_size, SEEK_SET); + + put_flush_packet(pb); + } + + return 0; +} + +AVOutputFormat ff_aiff_muxer = { + "aiff", + NULL_IF_CONFIG_SMALL("Audio IFF"), + "audio/aiff", + "aif,aiff,afc,aifc", + sizeof(AIFFOutputContext), + CODEC_ID_PCM_S16BE, + CODEC_ID_NONE, + aiff_write_header, + aiff_write_packet, + aiff_write_trailer, + .codec_tag= (const AVCodecTag* const []){ff_codec_aiff_tags, 0}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/anm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/anm.c new file mode 100644 index 00000000..dbe1b688 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/anm.c @@ -0,0 +1,235 @@ +/* + * Deluxe Paint Animation demuxer + * Copyright (c) 2009 Peter Ross + * + * 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 + * Deluxe Paint Animation demuxer + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" + +typedef struct { + int base_record; + unsigned int nb_records; + int size; +} Page; + +typedef struct { + unsigned int nb_pages; /**< total pages in file */ + unsigned int nb_records; /**< total records in file */ + int page_table_offset; +#define MAX_PAGES 256 /**< Deluxe Paint hardcoded value */ + Page pt[MAX_PAGES]; /**< page table */ + int page; /**< current page (or AVERROR_xxx code) */ + int record; /**< current record (with in page) */ +} AnmDemuxContext; + +#define LPF_TAG MKTAG('L','P','F',' ') +#define ANIM_TAG MKTAG('A','N','I','M') + +static int probe(AVProbeData *p) +{ + /* verify tags and video dimensions */ + if (AV_RL32(&p->buf[0]) == LPF_TAG && + AV_RL32(&p->buf[16]) == ANIM_TAG && + AV_RL16(&p->buf[20]) && AV_RL16(&p->buf[22])) + return AVPROBE_SCORE_MAX; + return 0; +} + +/** + * @return page containing the requested record or AVERROR_XXX + */ +static int find_record(const AnmDemuxContext *anm, int record) +{ + int i; + + if (record >= anm->nb_records) + return AVERROR_EOF; + + for (i = 0; i < MAX_PAGES; i++) { + const Page *p = &anm->pt[i]; + if (p->nb_records > 0 && record >= p->base_record && record < p->base_record + p->nb_records) + return i; + } + + return AVERROR_INVALIDDATA; +} + +static int read_header(AVFormatContext *s, + AVFormatParameters *ap) +{ + AnmDemuxContext *anm = s->priv_data; + ByteIOContext *pb = s->pb; + AVStream *st; + int i, ret; + + url_fskip(pb, 4); /* magic number */ + if (get_le16(pb) != MAX_PAGES) { + av_log_ask_for_sample(s, "max_pages != " AV_STRINGIFY(MAX_PAGES) "\n"); + return AVERROR_INVALIDDATA; + } + + anm->nb_pages = get_le16(pb); + anm->nb_records = get_le32(pb); + url_fskip(pb, 2); /* max records per page */ + anm->page_table_offset = get_le16(pb); + if (get_le32(pb) != ANIM_TAG) + return AVERROR_INVALIDDATA; + + /* video stream */ + st = av_new_stream(s, 0); + if (!st) + return AVERROR(ENOMEM); + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + st->codec->codec_id = CODEC_ID_ANM; + st->codec->codec_tag = 0; /* no fourcc */ + st->codec->width = get_le16(pb); + st->codec->height = get_le16(pb); + if (get_byte(pb) != 0) + goto invalid; + url_fskip(pb, 1); /* frame rate multiplier info */ + + /* ignore last delta record (used for looping) */ + if (get_byte(pb)) /* has_last_delta */ + anm->nb_records = FFMAX(anm->nb_records - 1, 0); + + url_fskip(pb, 1); /* last_delta_valid */ + + if (get_byte(pb) != 0) + goto invalid; + + if (get_byte(pb) != 1) + goto invalid; + + url_fskip(pb, 1); /* other recs per frame */ + + if (get_byte(pb) != 1) + goto invalid; + + url_fskip(pb, 32); /* record_types */ + st->nb_frames = get_le32(pb); + av_set_pts_info(st, 64, 1, get_le16(pb)); + url_fskip(pb, 58); + + /* color cycling and palette data */ + st->codec->extradata_size = 16*8 + 4*256; + st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); + if (!st->codec->extradata) { + ret = AVERROR(ENOMEM); + goto close_and_return; + } + ret = get_buffer(pb, st->codec->extradata, st->codec->extradata_size); + if (ret < 0) + goto close_and_return; + + /* read page table */ + ret = url_fseek(pb, anm->page_table_offset, SEEK_SET); + if (ret < 0) + goto close_and_return; + + for (i = 0; i < MAX_PAGES; i++) { + Page *p = &anm->pt[i]; + p->base_record = get_le16(pb); + p->nb_records = get_le16(pb); + p->size = get_le16(pb); + } + + /* find page of first frame */ + anm->page = find_record(anm, 0); + if (anm->page < 0) { + ret = anm->page; + goto close_and_return; + } + + anm->record = -1; + return 0; + +invalid: + av_log_ask_for_sample(s, NULL); + ret = AVERROR_INVALIDDATA; + +close_and_return: + av_close_input_stream(s); + return ret; +} + +static int read_packet(AVFormatContext *s, + AVPacket *pkt) +{ + AnmDemuxContext *anm = s->priv_data; + ByteIOContext *pb = s->pb; + Page *p; + int tmp, record_size; + + if (url_feof(s->pb)) + return AVERROR(EIO); + + if (anm->page < 0) + return anm->page; + +repeat: + p = &anm->pt[anm->page]; + + /* parse page header */ + if (anm->record < 0) { + url_fseek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16), SEEK_SET); + url_fskip(pb, 8 + 2*p->nb_records); + anm->record = 0; + } + + /* if we have fetched all records in this page, then find the + next page and repeat */ + if (anm->record >= p->nb_records) { + anm->page = find_record(anm, p->base_record + p->nb_records); + if (anm->page < 0) + return anm->page; + anm->record = -1; + goto repeat; + } + + /* fetch record size */ + tmp = url_ftell(pb); + url_fseek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16) + + 8 + anm->record * 2, SEEK_SET); + record_size = get_le16(pb); + url_fseek(pb, tmp, SEEK_SET); + + /* fetch record */ + pkt->size = av_get_packet(s->pb, pkt, record_size); + if (pkt->size < 0) + return pkt->size; + if (p->base_record + anm->record == 0) + pkt->flags |= AV_PKT_FLAG_KEY; + + anm->record++; + return 0; +} + +AVInputFormat ff_anm_demuxer = { + "anm", + NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"), + sizeof(AnmDemuxContext), + probe, + read_header, + read_packet, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/applehttp.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/applehttp.c new file mode 100644 index 00000000..50466faf --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/applehttp.c @@ -0,0 +1,591 @@ +/* + * Apple HTTP Live Streaming demuxer + * Copyright (c) 2010 Martin Storsjo + * + * 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 + * Apple HTTP Live Streaming demuxer + * http://tools.ietf.org/html/draft-pantos-http-live-streaming + */ + +#define _XOPEN_SOURCE 600 +#include "libavutil/avstring.h" +#include "avformat.h" +#include "internal.h" +#include + +/* + * An apple http stream consists of a playlist with media segment files, + * played sequentially. There may be several playlists with the same + * video content, in different bandwidth variants, that are played in + * parallel (preferrably only one bandwidth variant at a time). In this case, + * the user supplied the url to a main playlist that only lists the variant + * playlists. + * + * If the main playlist doesn't point at any variants, we still create + * one anonymous toplevel variant for this, to maintain the structure. + */ + +struct segment { + int duration; + char url[MAX_URL_SIZE]; +}; + +/* + * Each variant has its own demuxer. If it currently is active, + * it has an open ByteIOContext too, and potentially an AVPacket + * containing the next packet from this stream. + */ +struct variant { + int bandwidth; + char url[MAX_URL_SIZE]; + ByteIOContext *pb; + AVFormatContext *ctx; + AVPacket pkt; + int stream_offset; + + int start_seq_no; + int n_segments; + struct segment **segments; + int needed; +}; + +typedef struct AppleHTTPContext { + int target_duration; + int finished; + int n_variants; + struct variant **variants; + int cur_seq_no; + int64_t last_load_time; + int64_t last_packet_dts; + int max_start_seq, min_end_seq; +} AppleHTTPContext; + +static int read_chomp_line(ByteIOContext *s, char *buf, int maxlen) +{ + int len = ff_get_line(s, buf, maxlen); + while (len > 0 && isspace(buf[len - 1])) + buf[--len] = '\0'; + return len; +} + +static void make_absolute_url(char *buf, int size, const char *base, + const char *rel) +{ + char *sep; + /* If rel actually is an absolute url, just copy it */ + if (!base || strstr(rel, "://") || rel[0] == '/') { + av_strlcpy(buf, rel, size); + return; + } + if (base != buf) + av_strlcpy(buf, base, size); + /* Remove the file name from the base url */ + sep = strrchr(buf, '/'); + if (sep) + sep[1] = '\0'; + else + buf[0] = '\0'; + while (av_strstart(rel, "../", NULL) && sep) { + /* Remove the path delimiter at the end */ + sep[0] = '\0'; + sep = strrchr(buf, '/'); + /* If the next directory name to pop off is "..", break here */ + if (!strcmp(sep ? &sep[1] : buf, "..")) { + /* Readd the slash we just removed */ + av_strlcat(buf, "/", size); + break; + } + /* Cut off the directory name */ + if (sep) + sep[1] = '\0'; + else + buf[0] = '\0'; + rel += 3; + } + av_strlcat(buf, rel, size); +} + +static void free_segment_list(struct variant *var) +{ + int i; + for (i = 0; i < var->n_segments; i++) + av_free(var->segments[i]); + av_freep(&var->segments); + var->n_segments = 0; +} + +static void free_variant_list(AppleHTTPContext *c) +{ + int i; + for (i = 0; i < c->n_variants; i++) { + struct variant *var = c->variants[i]; + free_segment_list(var); + av_free_packet(&var->pkt); + if (var->pb) + url_fclose(var->pb); + if (var->ctx) { + var->ctx->pb = NULL; + av_close_input_file(var->ctx); + } + av_free(var); + } + av_freep(&c->variants); + c->n_variants = 0; +} + +/* + * Used to reset a statically allocated AVPacket to a clean slate, + * containing no data. + */ +static void reset_packet(AVPacket *pkt) +{ + av_init_packet(pkt); + pkt->data = NULL; +} + +static struct variant *new_variant(AppleHTTPContext *c, int bandwidth, + const char *url, const char *base) +{ + struct variant *var = av_mallocz(sizeof(struct variant)); + if (!var) + return NULL; + reset_packet(&var->pkt); + var->bandwidth = bandwidth; + make_absolute_url(var->url, sizeof(var->url), base, url); + dynarray_add(&c->variants, &c->n_variants, var); + return var; +} + +struct variant_info { + char bandwidth[20]; +}; + +static void handle_variant_args(struct variant_info *info, const char *key, + int key_len, char **dest, int *dest_len) +{ + if (!strncmp(key, "BANDWIDTH=", key_len)) { + *dest = info->bandwidth; + *dest_len = sizeof(info->bandwidth); + } +} + +static int parse_playlist(AppleHTTPContext *c, const char *url, + struct variant *var, ByteIOContext *in) +{ + int ret = 0, duration = 0, is_segment = 0, is_variant = 0, bandwidth = 0; + char line[1024]; + const char *ptr; + int close_in = 0; + + if (!in) { + close_in = 1; + if ((ret = url_fopen(&in, url, URL_RDONLY)) < 0) + return ret; + } + + read_chomp_line(in, line, sizeof(line)); + if (strcmp(line, "#EXTM3U")) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + + if (var) + free_segment_list(var); + c->finished = 0; + while (!url_feof(in)) { + read_chomp_line(in, line, sizeof(line)); + if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) { + struct variant_info info = {{0}}; + is_variant = 1; + ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_variant_args, + &info); + bandwidth = atoi(info.bandwidth); + } else if (av_strstart(line, "#EXT-X-TARGETDURATION:", &ptr)) { + c->target_duration = atoi(ptr); + } else if (av_strstart(line, "#EXT-X-MEDIA-SEQUENCE:", &ptr)) { + if (!var) { + var = new_variant(c, 0, url, NULL); + if (!var) { + ret = AVERROR(ENOMEM); + goto fail; + } + } + var->start_seq_no = atoi(ptr); + } else if (av_strstart(line, "#EXT-X-ENDLIST", &ptr)) { + c->finished = 1; + } else if (av_strstart(line, "#EXTINF:", &ptr)) { + is_segment = 1; + duration = atoi(ptr); + } else if (av_strstart(line, "#", NULL)) { + continue; + } else if (line[0]) { + if (is_variant) { + if (!new_variant(c, bandwidth, line, url)) { + ret = AVERROR(ENOMEM); + goto fail; + } + is_variant = 0; + bandwidth = 0; + } + if (is_segment) { + struct segment *seg; + if (!var) { + var = new_variant(c, 0, url, NULL); + if (!var) { + ret = AVERROR(ENOMEM); + goto fail; + } + } + seg = av_malloc(sizeof(struct segment)); + if (!seg) { + ret = AVERROR(ENOMEM); + goto fail; + } + seg->duration = duration; + make_absolute_url(seg->url, sizeof(seg->url), url, line); + dynarray_add(&var->segments, &var->n_segments, seg); + is_segment = 0; + } + } + } + c->last_load_time = av_gettime(); + +fail: + if (close_in) + url_fclose(in); + return ret; +} + +static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + AppleHTTPContext *c = s->priv_data; + int ret = 0, i, j, stream_offset = 0; + + if ((ret = parse_playlist(c, s->filename, NULL, s->pb)) < 0) + goto fail; + + if (c->n_variants == 0) { + av_log(NULL, AV_LOG_WARNING, "Empty playlist\n"); + ret = AVERROR_EOF; + goto fail; + } + /* If the playlist only contained variants, parse each individual + * variant playlist. */ + if (c->n_variants > 1 || c->variants[0]->n_segments == 0) { + for (i = 0; i < c->n_variants; i++) { + struct variant *v = c->variants[i]; + if ((ret = parse_playlist(c, v->url, v, NULL)) < 0) + goto fail; + } + } + + if (c->variants[0]->n_segments == 0) { + av_log(NULL, AV_LOG_WARNING, "Empty playlist\n"); + ret = AVERROR_EOF; + goto fail; + } + + /* If this isn't a live stream, calculate the total duration of the + * stream. */ + if (c->finished) { + int64_t duration = 0; + for (i = 0; i < c->variants[0]->n_segments; i++) + duration += c->variants[0]->segments[i]->duration; + s->duration = duration * AV_TIME_BASE; + } + + c->min_end_seq = INT_MAX; + /* Open the demuxer for each variant */ + for (i = 0; i < c->n_variants; i++) { + struct variant *v = c->variants[i]; + if (v->n_segments == 0) + continue; + c->max_start_seq = FFMAX(c->max_start_seq, v->start_seq_no); + c->min_end_seq = FFMIN(c->min_end_seq, v->start_seq_no + + v->n_segments); + ret = av_open_input_file(&v->ctx, v->segments[0]->url, NULL, 0, NULL); + if (ret < 0) + goto fail; + url_fclose(v->ctx->pb); + v->ctx->pb = NULL; + v->stream_offset = stream_offset; + /* Create new AVStreams for each stream in this variant */ + for (j = 0; j < v->ctx->nb_streams; j++) { + AVStream *st = av_new_stream(s, i); + if (!st) { + ret = AVERROR(ENOMEM); + goto fail; + } + avcodec_copy_context(st->codec, v->ctx->streams[j]->codec); + } + stream_offset += v->ctx->nb_streams; + } + c->last_packet_dts = AV_NOPTS_VALUE; + + c->cur_seq_no = c->max_start_seq; + /* If this is a live stream with more than 3 segments, start at the + * third last segment. */ + if (!c->finished && c->min_end_seq - c->max_start_seq > 3) + c->cur_seq_no = c->min_end_seq - 2; + + return 0; +fail: + free_variant_list(c); + return ret; +} + +static int open_variant(AppleHTTPContext *c, struct variant *var, int skip) +{ + int ret; + + if (c->cur_seq_no < var->start_seq_no) { + av_log(NULL, AV_LOG_WARNING, + "seq %d not available in variant %s, skipping\n", + var->start_seq_no, var->url); + return 0; + } + if (c->cur_seq_no - var->start_seq_no >= var->n_segments) + return c->finished ? AVERROR_EOF : 0; + ret = url_fopen(&var->pb, + var->segments[c->cur_seq_no - var->start_seq_no]->url, + URL_RDONLY); + if (ret < 0) + return ret; + var->ctx->pb = var->pb; + /* If this is a new segment in parallel with another one already opened, + * skip ahead so they're all at the same dts. */ + if (skip && c->last_packet_dts != AV_NOPTS_VALUE) { + while (1) { + ret = av_read_frame(var->ctx, &var->pkt); + if (ret < 0) { + if (ret == AVERROR_EOF) { + reset_packet(&var->pkt); + return 0; + } + return ret; + } + if (var->pkt.dts >= c->last_packet_dts) + break; + av_free_packet(&var->pkt); + } + } + return 0; +} + +static int applehttp_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + AppleHTTPContext *c = s->priv_data; + int ret, i, minvariant = -1, first = 1, needed = 0, changed = 0, + variants = 0; + + /* Recheck the discard flags - which streams are desired at the moment */ + for (i = 0; i < c->n_variants; i++) + c->variants[i]->needed = 0; + for (i = 0; i < s->nb_streams; i++) { + AVStream *st = s->streams[i]; + struct variant *var = c->variants[s->streams[i]->id]; + if (st->discard < AVDISCARD_ALL) { + var->needed = 1; + needed++; + } + /* Copy the discard flag to the chained demuxer, to indicate which + * streams are desired. */ + var->ctx->streams[i - var->stream_offset]->discard = st->discard; + } + if (!needed) + return AVERROR_EOF; +start: + for (i = 0; i < c->n_variants; i++) { + struct variant *var = c->variants[i]; + /* Close unneeded streams, open newly requested streams */ + if (var->pb && !var->needed) { + av_log(s, AV_LOG_DEBUG, + "Closing variant stream %d, no longer needed\n", i); + av_free_packet(&var->pkt); + reset_packet(&var->pkt); + url_fclose(var->pb); + var->pb = NULL; + changed = 1; + } else if (!var->pb && var->needed) { + if (first) + av_log(s, AV_LOG_DEBUG, "Opening variant stream %d\n", i); + if (first && !c->finished) + if ((ret = parse_playlist(c, var->url, var, NULL)) < 0) + return ret; + ret = open_variant(c, var, first); + if (ret < 0) + return ret; + changed = 1; + } + /* Count the number of open variants */ + if (var->pb) + variants++; + /* Make sure we've got one buffered packet from each open variant + * stream */ + if (var->pb && !var->pkt.data) { + ret = av_read_frame(var->ctx, &var->pkt); + if (ret < 0) { + if (!url_feof(var->pb)) + return ret; + reset_packet(&var->pkt); + } + } + /* Check if this stream has the packet with the lowest dts */ + if (var->pkt.data) { + if (minvariant < 0 || + var->pkt.dts < c->variants[minvariant]->pkt.dts) + minvariant = i; + } + } + if (first && changed) + av_log(s, AV_LOG_INFO, "Receiving %d variant streams\n", variants); + /* If we got a packet, return it */ + if (minvariant >= 0) { + *pkt = c->variants[minvariant]->pkt; + pkt->stream_index += c->variants[minvariant]->stream_offset; + reset_packet(&c->variants[minvariant]->pkt); + c->last_packet_dts = pkt->dts; + return 0; + } + /* No more packets - eof reached in all variant streams, close the + * current segments. */ + for (i = 0; i < c->n_variants; i++) { + struct variant *var = c->variants[i]; + if (var->pb) { + url_fclose(var->pb); + var->pb = NULL; + } + } + /* Indicate that we're opening the next segment, not opening a new + * variant stream in parallel, so we shouldn't try to skip ahead. */ + first = 0; + c->cur_seq_no++; +reload: + if (!c->finished) { + /* If this is a live stream and target_duration has elapsed since + * the last playlist reload, reload the variant playlists now. */ + int64_t now = av_gettime(); + if (now - c->last_load_time >= c->target_duration*1000000) { + c->max_start_seq = 0; + c->min_end_seq = INT_MAX; + for (i = 0; i < c->n_variants; i++) { + struct variant *var = c->variants[i]; + if (var->needed) { + if ((ret = parse_playlist(c, var->url, var, NULL)) < 0) + return ret; + c->max_start_seq = FFMAX(c->max_start_seq, + var->start_seq_no); + c->min_end_seq = FFMIN(c->min_end_seq, + var->start_seq_no + var->n_segments); + } + } + } + } + if (c->cur_seq_no < c->max_start_seq) { + av_log(NULL, AV_LOG_WARNING, + "skipping %d segments ahead, expired from playlists\n", + c->max_start_seq - c->cur_seq_no); + c->cur_seq_no = c->max_start_seq; + } + /* If more segments exit, open the next one */ + if (c->cur_seq_no < c->min_end_seq) + goto start; + /* We've reached the end of the playlists - return eof if this is a + * non-live stream, wait until the next playlist reload if it is live. */ + if (c->finished) + return AVERROR_EOF; + while (av_gettime() - c->last_load_time < c->target_duration*1000000) { + if (url_interrupt_cb()) + return AVERROR(EINTR); + usleep(100*1000); + } + /* Enough time has elapsed since the last reload */ + goto reload; +} + +static int applehttp_close(AVFormatContext *s) +{ + AppleHTTPContext *c = s->priv_data; + + free_variant_list(c); + return 0; +} + +static int applehttp_read_seek(AVFormatContext *s, int stream_index, + int64_t timestamp, int flags) +{ + AppleHTTPContext *c = s->priv_data; + int pos = 0, i; + struct variant *var = c->variants[0]; + + if ((flags & AVSEEK_FLAG_BYTE) || !c->finished) + return AVERROR(ENOSYS); + + /* Reset the variants */ + c->last_packet_dts = AV_NOPTS_VALUE; + for (i = 0; i < c->n_variants; i++) { + struct variant *var = c->variants[i]; + if (var->pb) { + url_fclose(var->pb); + var->pb = NULL; + } + av_free_packet(&var->pkt); + reset_packet(&var->pkt); + } + + timestamp = av_rescale_rnd(timestamp, 1, stream_index >= 0 ? + s->streams[stream_index]->time_base.den : + AV_TIME_BASE, flags & AVSEEK_FLAG_BACKWARD ? + AV_ROUND_DOWN : AV_ROUND_UP); + /* Locate the segment that contains the target timestamp */ + for (i = 0; i < var->n_segments; i++) { + if (timestamp >= pos && timestamp < pos + var->segments[i]->duration) { + c->cur_seq_no = var->start_seq_no + i; + return 0; + } + pos += var->segments[i]->duration; + } + return AVERROR(EIO); +} + +static int applehttp_probe(AVProbeData *p) +{ + /* Require #EXTM3U at the start, and either one of the ones below + * somewhere for a proper match. */ + if (strncmp(p->buf, "#EXTM3U", 7)) + return 0; + if (strstr(p->buf, "#EXT-X-STREAM-INF:") || + strstr(p->buf, "#EXT-X-TARGETDURATION:") || + strstr(p->buf, "#EXT-X-MEDIA-SEQUENCE:")) + return AVPROBE_SCORE_MAX; + return 0; +} + +AVInputFormat ff_applehttp_demuxer = { + "applehttp", + NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming format"), + sizeof(AppleHTTPContext), + applehttp_probe, + applehttp_read_header, + applehttp_read_packet, + applehttp_close, + applehttp_read_seek, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avi.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avi.c new file mode 100644 index 00000000..705ad03a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/avi.c @@ -0,0 +1,45 @@ +/* + * AVI common data + * Copyright (c) 2010 Anton Khirnov + * + * 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 + */ + +#include "avi.h" + +const AVMetadataConv ff_avi_metadata_conv[] = { + { "IART", "artist" }, + { "ICMT", "comment" }, + { "ICOP", "copyright" }, + { "ICRD", "date" }, + { "IGNR", "genre" }, + { "ILNG", "language" }, + { "INAM", "title" }, + { "IPRD", "album" }, + { "IPRT", "track" }, + { "ISFT", "encoder" }, + { "ITCH", "encoded_by"}, + { "strn", "title" }, + { 0 }, +}; + +const char ff_avi_tags[][5] = { + "IARL", "IART", "ICMS", "ICMT", "ICOP", "ICRD", "ICRP", "IDIM", "IDPI", + "IENG", "IGNR", "IKEY", "ILGT", "ILNG", "IMED", "INAM", "IPLT", "IPRD", + "IPRT", "ISBJ", "ISFT", "ISHP", "ISRC", "ISRF", "ITCH", + {0} +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/bink.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/bink.c new file mode 100644 index 00000000..c134dd80 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/bink.c @@ -0,0 +1,269 @@ +/* + * Bink demuxer + * Copyright (c) 2008-2010 Peter Ross (pross@xvid.org) + * Copyright (c) 2009 Daniel Verkamp (daniel@drv.nu) + * + * 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 + * Bink demuxer + * + * Technical details here: + * http://wiki.multimedia.cx/index.php?title=Bink_Container + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" + +enum BinkAudFlags { + BINK_AUD_16BITS = 0x4000, ///< prefer 16-bit output + BINK_AUD_STEREO = 0x2000, + BINK_AUD_USEDCT = 0x1000, +}; + +#define BINK_EXTRADATA_SIZE 1 +#define BINK_MAX_AUDIO_TRACKS 256 +#define BINK_MAX_WIDTH 7680 +#define BINK_MAX_HEIGHT 4800 + +typedef struct { + uint32_t file_size; + + uint32_t num_audio_tracks; + int current_track; ///< audio track to return in next packet + int64_t video_pts; + int64_t audio_pts[BINK_MAX_AUDIO_TRACKS]; + + uint32_t remain_packet_size; +} BinkDemuxContext; + +static int probe(AVProbeData *p) +{ + const uint8_t *b = p->buf; + + if ( b[0] == 'B' && b[1] == 'I' && b[2] == 'K' && + (b[3] == 'b' || b[3] == 'f' || b[3] == 'g' || b[3] == 'h' || b[3] == 'i') && + AV_RL32(b+8) > 0 && // num_frames + AV_RL32(b+20) > 0 && AV_RL32(b+20) <= BINK_MAX_WIDTH && + AV_RL32(b+24) > 0 && AV_RL32(b+24) <= BINK_MAX_HEIGHT && + AV_RL32(b+28) > 0 && AV_RL32(b+32) > 0) // fps num,den + return AVPROBE_SCORE_MAX; + return 0; +} + +static int read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + BinkDemuxContext *bink = s->priv_data; + ByteIOContext *pb = s->pb; + uint32_t fps_num, fps_den; + AVStream *vst, *ast; + unsigned int i; + uint32_t pos, next_pos; + uint16_t flags; + int keyframe; + + vst = av_new_stream(s, 0); + if (!vst) + return AVERROR(ENOMEM); + + vst->codec->codec_tag = get_le32(pb); + + bink->file_size = get_le32(pb) + 8; + vst->duration = get_le32(pb); + + if (vst->duration > 1000000) { + av_log(s, AV_LOG_ERROR, "invalid header: more than 1000000 frames\n"); + return AVERROR(EIO); + } + + if (get_le32(pb) > bink->file_size) { + av_log(s, AV_LOG_ERROR, + "invalid header: largest frame size greater than file size\n"); + return AVERROR(EIO); + } + + url_fskip(pb, 4); + + vst->codec->width = get_le32(pb); + vst->codec->height = get_le32(pb); + + fps_num = get_le32(pb); + fps_den = get_le32(pb); + if (fps_num == 0 || fps_den == 0) { + av_log(s, AV_LOG_ERROR, "invalid header: invalid fps (%d/%d)\n", fps_num, fps_den); + return AVERROR(EIO); + } + av_set_pts_info(vst, 64, fps_den, fps_num); + + vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; + vst->codec->codec_id = CODEC_ID_BINKVIDEO; + vst->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE); + vst->codec->extradata_size = 4; + get_buffer(pb, vst->codec->extradata, 4); + + bink->num_audio_tracks = get_le32(pb); + + if (bink->num_audio_tracks > BINK_MAX_AUDIO_TRACKS) { + av_log(s, AV_LOG_ERROR, + "invalid header: more than "AV_STRINGIFY(BINK_MAX_AUDIO_TRACKS)" audio tracks (%d)\n", + bink->num_audio_tracks); + return AVERROR(EIO); + } + + if (bink->num_audio_tracks) { + url_fskip(pb, 4 * bink->num_audio_tracks); + + for (i = 0; i < bink->num_audio_tracks; i++) { + ast = av_new_stream(s, 1); + if (!ast) + return AVERROR(ENOMEM); + ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; + ast->codec->codec_tag = 0; + ast->codec->sample_rate = get_le16(pb); + av_set_pts_info(ast, 64, 1, ast->codec->sample_rate); + flags = get_le16(pb); + ast->codec->codec_id = flags & BINK_AUD_USEDCT ? + CODEC_ID_BINKAUDIO_DCT : CODEC_ID_BINKAUDIO_RDFT; + ast->codec->channels = flags & BINK_AUD_STEREO ? 2 : 1; + } + + url_fskip(pb, 4 * bink->num_audio_tracks); + } + + /* frame index table */ + next_pos = get_le32(pb); + for (i = 0; i < vst->duration; i++) { + pos = next_pos; + if (i == vst->duration - 1) { + next_pos = bink->file_size; + keyframe = 0; + } else { + next_pos = get_le32(pb); + keyframe = pos & 1; + } + pos &= ~1; + next_pos &= ~1; + + if (next_pos <= pos) { + av_log(s, AV_LOG_ERROR, "invalid frame index table\n"); + return AVERROR(EIO); + } + av_add_index_entry(vst, pos, i, next_pos - pos, 0, + keyframe ? AVINDEX_KEYFRAME : 0); + } + + url_fskip(pb, 4); + + bink->current_track = -1; + return 0; +} + +static int read_packet(AVFormatContext *s, AVPacket *pkt) +{ + BinkDemuxContext *bink = s->priv_data; + ByteIOContext *pb = s->pb; + int ret; + + if (bink->current_track < 0) { + int index_entry; + AVStream *st = s->streams[0]; // stream 0 is video stream with index + + if (bink->video_pts >= st->duration) + return AVERROR(EIO); + + index_entry = av_index_search_timestamp(st, bink->video_pts, + AVSEEK_FLAG_ANY); + if (index_entry < 0) { + av_log(s, AV_LOG_ERROR, + "could not find index entry for frame %"PRId64"\n", + bink->video_pts); + return AVERROR(EIO); + } + + bink->remain_packet_size = st->index_entries[index_entry].size; + bink->current_track = 0; + } + + while (bink->current_track < bink->num_audio_tracks) { + uint32_t audio_size = get_le32(pb); + if (audio_size > bink->remain_packet_size - 4) { + av_log(s, AV_LOG_ERROR, + "frame %"PRId64": audio size in header (%u) > size of packet left (%u)\n", + bink->video_pts, audio_size, bink->remain_packet_size); + return AVERROR(EIO); + } + bink->remain_packet_size -= 4 + audio_size; + bink->current_track++; + if (audio_size >= 4) { + /* get one audio packet per track */ + if ((ret = av_get_packet(pb, pkt, audio_size)) < 0) + return ret; + pkt->stream_index = bink->current_track; + pkt->pts = bink->audio_pts[bink->current_track - 1]; + + /* Each audio packet reports the number of decompressed samples + (in bytes). We use this value to calcuate the audio PTS */ + if (pkt->size >= 4) + bink->audio_pts[bink->current_track -1] += + AV_RL32(pkt->data) / (2 * s->streams[bink->current_track]->codec->channels); + return 0; + } else { + url_fseek(pb, audio_size, SEEK_CUR); + } + } + + /* get video packet */ + if ((ret = av_get_packet(pb, pkt, bink->remain_packet_size)) < 0) + return ret; + pkt->stream_index = 0; + pkt->pts = bink->video_pts++; + pkt->flags |= AV_PKT_FLAG_KEY; + + /* -1 instructs the next call to read_packet() to read the next frame */ + bink->current_track = -1; + + return 0; +} + +static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) +{ + BinkDemuxContext *bink = s->priv_data; + AVStream *vst = s->streams[0]; + + if (url_is_streamed(s->pb)) + return -1; + + /* seek to the first frame */ + url_fseek(s->pb, vst->index_entries[0].pos, SEEK_SET); + bink->video_pts = 0; + memset(bink->audio_pts, 0, sizeof(bink->audio_pts)); + bink->current_track = -1; + return 0; +} + +AVInputFormat ff_bink_demuxer = { + "bink", + NULL_IF_CONFIG_SMALL("Bink"), + sizeof(BinkDemuxContext), + probe, + read_header, + read_packet, + NULL, + read_seek, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/cavsvideodec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/cavsvideodec.c new file mode 100644 index 00000000..6db9ad9f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/cavsvideodec.c @@ -0,0 +1,77 @@ +/* + * RAW Chinese AVS video demuxer + * Copyright (c) 2009 Stefan Gehrer + * + * 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 + */ + +#include "avformat.h" +#include "rawdec.h" + +#define CAVS_SEQ_START_CODE 0x000001b0 +#define CAVS_PIC_I_START_CODE 0x000001b3 +#define CAVS_UNDEF_START_CODE 0x000001b4 +#define CAVS_PIC_PB_START_CODE 0x000001b6 +#define CAVS_VIDEO_EDIT_CODE 0x000001b7 +#define CAVS_PROFILE_JIZHUN 0x20 + +static int cavsvideo_probe(AVProbeData *p) +{ + uint32_t code= -1; + int pic=0, seq=0, slice_pos = 0; + int i; + + for(i=0; ibuf_size; i++){ + code = (code<<8) + p->buf[i]; + if ((code & 0xffffff00) == 0x100) { + if(code < CAVS_SEQ_START_CODE) { + /* slices have to be consecutive */ + if(code < slice_pos) + return 0; + slice_pos = code; + } else { + slice_pos = 0; + } + if (code == CAVS_SEQ_START_CODE) { + seq++; + /* check for the only currently supported profile */ + if(p->buf[i+1] != CAVS_PROFILE_JIZHUN) + return 0; + } else if ((code == CAVS_PIC_I_START_CODE) || + (code == CAVS_PIC_PB_START_CODE)) { + pic++; + } else if ((code == CAVS_UNDEF_START_CODE) || + (code > CAVS_VIDEO_EDIT_CODE)) { + return 0; + } + } + } + if(seq && seq*9<=pic*10) + return AVPROBE_SCORE_MAX/2; + return 0; +} + +AVInputFormat ff_cavsvideo_demuxer = { + "cavsvideo", + NULL_IF_CONFIG_SMALL("raw Chinese AVS video"), + 0, + cavsvideo_probe, + ff_raw_video_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .value = CODEC_ID_CAVS, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/cdg.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/cdg.c new file mode 100644 index 00000000..ed3d7828 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/cdg.c @@ -0,0 +1,66 @@ +/* + * CD Graphics Demuxer + * Copyright (c) 2009 Michael Tison + * + * 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 + */ + +#include "avformat.h" + +#define CDG_PACKET_SIZE 24 + +static int read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + AVStream *vst; + int ret; + + vst = av_new_stream(s, 0); + if (!vst) + return AVERROR(ENOMEM); + + vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; + vst->codec->codec_id = CODEC_ID_CDGRAPHICS; + + /// 75 sectors/sec * 4 packets/sector = 300 packets/sec + av_set_pts_info(vst, 32, 1, 300); + + ret = url_fsize(s->pb); + if (ret > 0) + vst->duration = (ret * vst->time_base.den) / (CDG_PACKET_SIZE * 300); + + return 0; +} + +static int read_packet(AVFormatContext *s, AVPacket *pkt) +{ + int ret; + + ret = av_get_packet(s->pb, pkt, CDG_PACKET_SIZE); + + pkt->stream_index = 0; + return ret; +} + +AVInputFormat ff_cdg_demuxer = { + "cdg", + NULL_IF_CONFIG_SMALL("CD Graphics Format"), + 0, + NULL, + read_header, + read_packet, + .extensions = "cdg" +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/concat.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/concat.c new file mode 100644 index 00000000..36590791 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/concat.c @@ -0,0 +1,198 @@ +/* + * Concat URL protocol + * Copyright (c) 2006 Steve Lhomme + * Copyright (c) 2007 Wolfram Gloger + * Copyright (c) 2010 Michele OrrÃđ + * + * 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 + */ + +#include "avformat.h" +#include "libavutil/avstring.h" +#include "libavutil/mem.h" + +#define AV_CAT_SEPARATOR "|" + +struct concat_nodes { + URLContext *uc; ///< node's URLContext + int64_t size; ///< url filesize +}; + +struct concat_data { + struct concat_nodes *nodes; ///< list of nodes to concat + size_t length; ///< number of cat'ed nodes + size_t current; ///< index of currently read node +}; + +static av_cold int concat_close(URLContext *h) +{ + int err = 0; + size_t i; + struct concat_data *data = h->priv_data; + struct concat_nodes *nodes = data->nodes; + + for (i = 0; i != data->length; i++) + err |= url_close(nodes[i].uc); + + av_freep(&data->nodes); + av_freep(&h->priv_data); + + return err < 0 ? -1 : 0; +} + +static av_cold int concat_open(URLContext *h, const char *uri, int flags) +{ + char *node_uri = NULL, *tmp_uri; + int err = 0; + int64_t size; + size_t len, i; + URLContext *uc; + struct concat_data *data; + struct concat_nodes *nodes; + + av_strstart(uri, "concat:", &uri); + + /* creating data */ + if (!(data = av_mallocz(sizeof(*data)))) + return AVERROR(ENOMEM); + h->priv_data = data; + + for (i = 0, len = 1; uri[i]; i++) + if (uri[i] == *AV_CAT_SEPARATOR) + /* integer overflow */ + if (++len == UINT_MAX / sizeof(*nodes)) { + av_freep(&h->priv_data); + return AVERROR(ENAMETOOLONG); + } + + if (!(nodes = av_malloc(sizeof(*nodes) * len))) { + av_freep(&h->priv_data); + return AVERROR(ENOMEM); + } else + data->nodes = nodes; + + /* handle input */ + if (!*uri) + err = AVERROR(ENOENT); + for (i = 0; *uri; i++) { + /* parsing uri */ + len = strcspn(uri, AV_CAT_SEPARATOR); + if (!(tmp_uri = av_realloc(node_uri, len+1))) { + err = AVERROR(ENOMEM); + break; + } else + node_uri = tmp_uri; + av_strlcpy(node_uri, uri, len+1); + uri += len + strspn(uri+len, AV_CAT_SEPARATOR); + + /* creating URLContext */ + if ((err = url_open(&uc, node_uri, flags)) < 0) + break; + + /* creating size */ + if ((size = url_filesize(uc)) < 0) { + url_close(uc); + err = AVERROR(ENOSYS); + break; + } + + /* assembling */ + nodes[i].uc = uc; + nodes[i].size = size; + } + av_free(node_uri); + data->length = i; + + if (err < 0) + concat_close(h); + else if (!(nodes = av_realloc(nodes, data->length * sizeof(*nodes)))) { + concat_close(h); + err = AVERROR(ENOMEM); + } else + data->nodes = nodes; + return err; +} + +static int concat_read(URLContext *h, unsigned char *buf, int size) +{ + int result, total = 0; + struct concat_data *data = h->priv_data; + struct concat_nodes *nodes = data->nodes; + size_t i = data->current; + + while (size > 0) { + result = url_read(nodes[i].uc, buf, size); + if (result < 0) + return total ? total : result; + if (!result) + if (i + 1 == data->length || + url_seek(nodes[++i].uc, 0, SEEK_SET) < 0) + break; + total += result; + buf += result; + size -= result; + } + data->current = i; + return total; +} + +static int64_t concat_seek(URLContext *h, int64_t pos, int whence) +{ + int64_t result; + struct concat_data *data = h->priv_data; + struct concat_nodes *nodes = data->nodes; + size_t i; + + switch (whence) { + case SEEK_END: + for (i = data->length - 1; + i && pos < -nodes[i].size; + i--) + pos += nodes[i].size; + break; + case SEEK_CUR: + /* get the absolute position */ + for (i = 0; i != data->current; i++) + pos += nodes[i].size; + pos += url_seek(nodes[i].uc, 0, SEEK_CUR); + whence = SEEK_SET; + /* fall through with the absolute position */ + case SEEK_SET: + for (i = 0; i != data->length - 1 && pos >= nodes[i].size; i++) + pos -= nodes[i].size; + break; + default: + return AVERROR(EINVAL); + } + + result = url_seek(nodes[i].uc, pos, whence); + if (result >= 0) { + data->current = i; + while (i) + result += nodes[--i].size; + } + return result; +} + +URLProtocol ff_concat_protocol = { + "concat", + concat_open, + concat_read, + NULL, + concat_seek, + concat_close, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/diracdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/diracdec.c new file mode 100644 index 00000000..6c689616 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/diracdec.c @@ -0,0 +1,43 @@ +/* + * RAW Dirac demuxer + * Copyright (c) 2007 Marco Gerards + * + * 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 + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "rawdec.h" + +static int dirac_probe(AVProbeData *p) +{ + if (AV_RL32(p->buf) == MKTAG('B', 'B', 'C', 'D')) + return AVPROBE_SCORE_MAX; + else + return 0; +} + +AVInputFormat ff_dirac_demuxer = { + "dirac", + NULL_IF_CONFIG_SMALL("raw Dirac"), + 0, + dirac_probe, + ff_raw_video_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .value = CODEC_ID_DIRAC, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dnxhddec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dnxhddec.c new file mode 100644 index 00000000..035e1c4b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dnxhddec.c @@ -0,0 +1,54 @@ +/* + * RAW DNxHD (SMPTE VC-3) demuxer + * Copyright (c) 2008 Baptiste Coudurier + * Copyright (c) 2009 Reimar DÃķffinger + * + * 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 + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "rawdec.h" + +static int dnxhd_probe(AVProbeData *p) +{ + static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01}; + int w, h, compression_id; + if (p->buf_size < 0x2c) + return 0; + if (memcmp(p->buf, header, 5)) + return 0; + h = AV_RB16(p->buf + 0x18); + w = AV_RB16(p->buf + 0x1a); + if (!w || !h) + return 0; + compression_id = AV_RB32(p->buf + 0x28); + if (compression_id < 1237 || compression_id > 1253) + return 0; + return AVPROBE_SCORE_MAX; +} + +AVInputFormat ff_dnxhd_demuxer = { + "dnxhd", + NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"), + 0, + dnxhd_probe, + ff_raw_video_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .value = CODEC_ID_DNXHD, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dtsdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dtsdec.c new file mode 100644 index 00000000..b2035972 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/dtsdec.c @@ -0,0 +1,78 @@ +/* + * RAW DTS demuxer + * Copyright (c) 2008 Benjamin Larsson + * + * 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 + */ + +#include "libavcodec/bytestream.h" +#include "avformat.h" +#include "rawdec.h" + +#define DCA_MARKER_14B_BE 0x1FFFE800 +#define DCA_MARKER_14B_LE 0xFF1F00E8 +#define DCA_MARKER_RAW_BE 0x7FFE8001 +#define DCA_MARKER_RAW_LE 0xFE7F0180 + +static int dts_probe(AVProbeData *p) +{ + const uint8_t *buf, *bufp; + uint32_t state = -1; + int markers[3] = {0}; + int sum, max; + + buf = p->buf; + + for(; buf < (p->buf+p->buf_size)-2; buf+=2) { + bufp = buf; + state = (state << 16) | bytestream_get_be16(&bufp); + + /* regular bitstream */ + if (state == DCA_MARKER_RAW_BE || state == DCA_MARKER_RAW_LE) + markers[0]++; + + /* 14 bits big-endian bitstream */ + if (state == DCA_MARKER_14B_BE) + if ((bytestream_get_be16(&bufp) & 0xFFF0) == 0x07F0) + markers[1]++; + + /* 14 bits little-endian bitstream */ + if (state == DCA_MARKER_14B_LE) + if ((bytestream_get_be16(&bufp) & 0xF0FF) == 0xF007) + markers[2]++; + } + sum = markers[0] + markers[1] + markers[2]; + max = markers[1] > markers[0]; + max = markers[2] > markers[max] ? 2 : max; + if (markers[max] > 3 && p->buf_size / markers[max] < 32*1024 && + markers[max] * 4 > sum * 3) + return AVPROBE_SCORE_MAX/2+1; + + return 0; +} + +AVInputFormat ff_dts_demuxer = { + "dts", + NULL_IF_CONFIG_SMALL("raw DTS"), + 0, + dts_probe, + ff_raw_audio_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "dts", + .value = CODEC_ID_DTS, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmeta.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmeta.h new file mode 100644 index 00000000..f96dbb2e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmeta.h @@ -0,0 +1,29 @@ +/* + * Common data for metadata muxer/demuxer + * Copyright (c) 2010 Anton Khirnov + * + * 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 + */ + +#ifndef AVFORMAT_META_H +#define AVFORMAT_META_H + +#define ID_STRING ";FFMETADATA" +#define ID_CHAPTER "[CHAPTER]" +#define ID_STREAM "[STREAM]" + +#endif /* AVFORMAT_META_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmetadec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmetadec.c new file mode 100644 index 00000000..ab35746e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmetadec.c @@ -0,0 +1,172 @@ +/* + * Metadata demuxer + * Copyright (c) 2010 Anton Khirnov + * + * 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 + */ + +#include "avformat.h" +#include "ffmeta.h" + +static int probe(AVProbeData *p) +{ + if(!memcmp(p->buf, ID_STRING, strlen(ID_STRING))) + return AVPROBE_SCORE_MAX; + return 0; +} + +static void get_line(ByteIOContext *s, uint8_t *buf, int size) +{ + do { + uint8_t c; + int i = 0; + + while ((c = get_byte(s))) { + if (c == '\\') { + if (i < size - 1) + buf[i++] = c; + c = get_byte(s); + } else if (c == '\n') + break; + + if (i < size - 1) + buf[i++] = c; + } + buf[i] = 0; + } while (!url_feof(s) && (buf[0] == ';' || buf[0] == '#' || buf[0] == 0)); +} + +static AVChapter *read_chapter(AVFormatContext *s) +{ + uint8_t line[256]; + int64_t start, end; + AVRational tb = {1, 1e9}; + + get_line(s->pb, line, sizeof(line)); + + if (sscanf(line, "TIMEBASE=%d/%d", &tb.num, &tb.den)) + get_line(s->pb, line, sizeof(line)); + if (!sscanf(line, "START=%lld", &start)) { + av_log(s, AV_LOG_ERROR, "Expected chapter start timestamp, found %s.\n", line); + start = (s->nb_chapters && s->chapters[s->nb_chapters - 1]->end != AV_NOPTS_VALUE) ? + s->chapters[s->nb_chapters - 1]->end : 0; + } else + get_line(s->pb, line, sizeof(line)); + + if (!sscanf(line, "END=%lld", &end)) { + av_log(s, AV_LOG_ERROR, "Expected chapter end timestamp, found %s.\n", line); + end = AV_NOPTS_VALUE; + } + + return ff_new_chapter(s, s->nb_chapters, tb, start, end, NULL); +} + +static uint8_t *unescape(uint8_t *buf, int size) +{ + uint8_t *ret = av_malloc(size + 1); + uint8_t *p1 = ret, *p2 = buf; + + if (!ret) + return NULL; + + while (p2 < buf + size) { + if (*p2 == '\\') + p2++; + *p1++ = *p2++; + } + *p1 = 0; + return ret; +} + +static int read_tag(uint8_t *line, AVMetadata **m) +{ + uint8_t *key, *value, *p = line; + + /* find first not escaped '=' */ + while (1) { + if (*p == '=') + break; + else if (*p == '\\') + p++; + + if (*p++) + continue; + + return 0; + } + + if (!(key = unescape(line, p - line))) + return AVERROR(ENOMEM); + if (!(value = unescape(p + 1, strlen(p + 1)))) { + av_free(key); + return AVERROR(ENOMEM); + } + + av_metadata_set2(m, key, value, AV_METADATA_DONT_STRDUP_KEY | AV_METADATA_DONT_STRDUP_VAL); + return 0; +} + +static int read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + AVMetadata **m = &s->metadata; + uint8_t line[1024]; + + while(!url_feof(s->pb)) { + get_line(s->pb, line, sizeof(line)); + + if (!memcmp(line, ID_STREAM, strlen(ID_STREAM))) { + AVStream *st = av_new_stream(s, 0); + + if (!st) + return -1; + + st->codec->codec_type = AVMEDIA_TYPE_DATA; + st->codec->codec_id = CODEC_ID_FFMETADATA; + + m = &st->metadata; + } else if (!memcmp(line, ID_CHAPTER, strlen(ID_CHAPTER))) { + AVChapter *ch = read_chapter(s); + + if (!ch) + return -1; + + m = &ch->metadata; + } else + read_tag(line, m); + } + + s->start_time = 0; + if (s->nb_chapters) + s->duration = av_rescale_q(s->chapters[s->nb_chapters - 1]->end, + s->chapters[s->nb_chapters - 1]->time_base, + AV_TIME_BASE_Q); + + return 0; +} + +static int read_packet(AVFormatContext *s, AVPacket *pkt) +{ + return AVERROR_EOF; +} + +AVInputFormat ff_ffmetadata_demuxer = { + .name = "ffmetadata", + .long_name = NULL_IF_CONFIG_SMALL("FFmpeg metadata in text format"), + .read_probe = probe, + .read_header = read_header, + .read_packet = read_packet, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmetaenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmetaenc.c new file mode 100644 index 00000000..b20abc90 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ffmetaenc.c @@ -0,0 +1,100 @@ +/* + * Metadata muxer + * Copyright (c) 2010 Anton Khirnov + * + * 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 + */ + +#include + +#include "avformat.h" +#include "ffmeta.h" + + +static void write_escape_str(ByteIOContext *s, const uint8_t *str) +{ + const uint8_t *p = str; + + while (*p) { + if (*p == '#' || *p == ';' || *p == '=' || *p == '\\' || *p == '\n') + put_byte(s, '\\'); + put_byte(s, *p); + p++; + } +} + +static void write_tags(ByteIOContext *s, AVMetadata *m) +{ + AVMetadataTag *t = NULL; + while ((t = av_metadata_get(m, "", t, AV_METADATA_IGNORE_SUFFIX))) { + write_escape_str(s, t->key); + put_byte(s, '='); + write_escape_str(s, t->value); + put_byte(s, '\n'); + } +} + +static int write_header(AVFormatContext *s) +{ + put_tag(s->pb, ID_STRING); + put_byte(s->pb, '1'); // version + put_byte(s->pb, '\n'); + put_flush_packet(s->pb); + return 0; +} + +static int write_trailer(AVFormatContext *s) +{ + int i; + + write_tags(s->pb, s->metadata); + + for (i = 0; i < s->nb_streams; i++) { + put_tag(s->pb, ID_STREAM); + put_byte(s->pb, '\n'); + write_tags(s->pb, s->streams[i]->metadata); + } + + for (i = 0; i < s->nb_chapters; i++) { + AVChapter *ch = s->chapters[i]; + put_tag(s->pb, ID_CHAPTER); + put_byte(s->pb, '\n'); + url_fprintf(s->pb, "TIMEBASE=%d/%d\n", ch->time_base.num, ch->time_base.den); + url_fprintf(s->pb, "START=%"PRId64"\n", ch->start); + url_fprintf(s->pb, "END=%"PRId64"\n", ch->end); + write_tags(s->pb, ch->metadata); + } + + put_flush_packet(s->pb); + + return 0; +} + +static int write_packet(AVFormatContext *s, AVPacket *pkt) +{ + return 0; +} + +AVOutputFormat ff_ffmetadata_muxer = { + .name = "ffmetadata", + .long_name = NULL_IF_CONFIG_SMALL("FFmpeg metadata in text format"), + .extensions = "ffmeta", + .write_header = write_header, + .write_packet = write_packet, + .write_trailer = write_trailer, + .flags = AVFMT_NOTIMESTAMPS | AVFMT_NOSTREAMS, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/filmstripdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/filmstripdec.c new file mode 100644 index 00000000..805ca991 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/filmstripdec.c @@ -0,0 +1,111 @@ +/* + * Adobe Filmstrip demuxer + * Copyright (c) 2010 Peter Ross + * + * 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 + * Adobe Filmstrip demuxer + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" + +#define RAND_TAG MKBETAG('R','a','n','d') + +typedef struct { + int leading; +} FilmstripDemuxContext; + +static int read_header(AVFormatContext *s, + AVFormatParameters *ap) +{ + FilmstripDemuxContext *film = s->priv_data; + ByteIOContext *pb = s->pb; + AVStream *st; + + if (url_is_streamed(s->pb)) + return AVERROR(EIO); + + url_fseek(pb, url_fsize(pb) - 36, SEEK_SET); + if (get_be32(pb) != RAND_TAG) { + av_log(s, AV_LOG_ERROR, "magic number not found"); + return AVERROR_INVALIDDATA; + } + + st = av_new_stream(s, 0); + if (!st) + return AVERROR(ENOMEM); + + st->nb_frames = get_be32(pb); + if (get_be16(pb) != 0) { + av_log_ask_for_sample(s, "unsupported packing method\n"); + return AVERROR_INVALIDDATA; + } + + url_fskip(pb, 2); + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + st->codec->codec_id = CODEC_ID_RAWVIDEO; + st->codec->pix_fmt = PIX_FMT_RGBA; + st->codec->codec_tag = 0; /* no fourcc */ + st->codec->width = get_be16(pb); + st->codec->height = get_be16(pb); + film->leading = get_be16(pb); + av_set_pts_info(st, 64, 1, get_be16(pb)); + + url_fseek(pb, 0, SEEK_SET); + + return 0; +} + +static int read_packet(AVFormatContext *s, + AVPacket *pkt) +{ + FilmstripDemuxContext *film = s->priv_data; + AVStream *st = s->streams[0]; + + if (url_feof(s->pb)) + return AVERROR(EIO); + pkt->dts = url_ftell(s->pb) / (st->codec->width * (st->codec->height + film->leading) * 4); + pkt->size = av_get_packet(s->pb, pkt, st->codec->width * st->codec->height * 4); + url_fskip(s->pb, st->codec->width * film->leading * 4); + if (pkt->size < 0) + return pkt->size; + pkt->flags |= AV_PKT_FLAG_KEY; + return 0; +} + +static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) +{ + AVStream *st = s->streams[stream_index]; + url_fseek(s->pb, FFMAX(timestamp, 0) * st->codec->width * st->codec->height * 4, SEEK_SET); + return 0; +} + +AVInputFormat ff_filmstrip_demuxer = { + "filmstrip", + NULL_IF_CONFIG_SMALL("Adobe Filmstrip"), + sizeof(FilmstripDemuxContext), + NULL, + read_header, + read_packet, + NULL, + read_seek, + .extensions = "flm", +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/filmstripenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/filmstripenc.c new file mode 100644 index 00000000..6da575cc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/filmstripenc.c @@ -0,0 +1,85 @@ +/* + * Adobe Filmstrip muxer + * Copyright (c) 2010 Peter Ross + * + * 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 + * Adobe Filmstrip muxer + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" + +#define RAND_TAG MKBETAG('R','a','n','d') + +typedef struct { + int nb_frames; +} FilmstripMuxContext; + +static int write_header(AVFormatContext *s) +{ + if (s->streams[0]->codec->pix_fmt != PIX_FMT_RGBA) { + av_log(s, AV_LOG_ERROR, "only PIX_FMT_RGBA is supported\n"); + return AVERROR_INVALIDDATA; + } + return 0; +} + +static int write_packet(AVFormatContext *s, AVPacket *pkt) +{ + FilmstripMuxContext *film = s->priv_data; + put_buffer(s->pb, pkt->data, pkt->size); + film->nb_frames++; + return 0; +} + +static int write_trailer(AVFormatContext *s) +{ + FilmstripMuxContext *film = s->priv_data; + ByteIOContext *pb = s->pb; + AVStream *st = s->streams[0]; + int i; + + put_be32(pb, RAND_TAG); + put_be32(pb, film->nb_frames); + put_be16(pb, 0); // packing method + put_be16(pb, 0); // reserved + put_be16(pb, st->codec->width); + put_be16(pb, st->codec->height); + put_be16(pb, 0); // leading + put_be16(pb, 1/av_q2d(st->codec->time_base)); + for (i = 0; i < 16; i++) + put_byte(pb, 0x00); // reserved + put_flush_packet(pb); + return 0; +} + +AVOutputFormat ff_filmstrip_muxer = { + "filmstrip", + NULL_IF_CONFIG_SMALL("Adobe Filmstrip"), + NULL, + "flm", + sizeof(FilmstripMuxContext), + CODEC_ID_NONE, + CODEC_ID_RAWVIDEO, + write_header, + write_packet, + write_trailer, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/flacenc_header.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/flacenc_header.c new file mode 100644 index 00000000..92a129a7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/flacenc_header.c @@ -0,0 +1,49 @@ +/* + * raw FLAC muxer + * Copyright (C) 2009 Justin Ruggles + * + * 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 + */ + +#include "libavcodec/flac.h" +#include "libavcodec/bytestream.h" +#include "avformat.h" +#include "flacenc.h" + +int ff_flac_write_header(ByteIOContext *pb, AVCodecContext *codec, + int last_block) +{ + uint8_t header[8] = { + 0x66, 0x4C, 0x61, 0x43, 0x00, 0x00, 0x00, 0x22 + }; + uint8_t *streaminfo; + enum FLACExtradataFormat format; + + header[4] = last_block ? 0x80 : 0x00; + if (!ff_flac_is_extradata_valid(codec, &format, &streaminfo)) + return -1; + + /* write "fLaC" stream marker and first metadata block header if needed */ + if (format == FLAC_EXTRADATA_FORMAT_STREAMINFO) { + put_buffer(pb, header, 8); + } + + /* write STREAMINFO or full header */ + put_buffer(pb, codec->extradata, codec->extradata_size); + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/h261dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/h261dec.c new file mode 100644 index 00000000..1478ed66 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/h261dec.c @@ -0,0 +1,75 @@ +/* + * RAW H.261 video demuxer + * Copyright (c) 2009 Michael Niedermayer + * + * 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 + */ + +#include "libavcodec/get_bits.h" +#include "avformat.h" +#include "rawdec.h" + +static int h261_probe(AVProbeData *p) +{ + uint32_t code= -1; + int i; + int valid_psc=0; + int invalid_psc=0; + int next_gn=0; + int src_fmt=0; + GetBitContext gb; + + init_get_bits(&gb, p->buf, p->buf_size*8); + + for(i=0; ibuf_size*8; i++){ + if ((code & 0x01ff0000) || !(code & 0xff00)) { + code = (code<<8) + get_bits(&gb, 8); + i += 7; + } else + code = (code<<1) + get_bits1(&gb); + if ((code & 0xffff0000) == 0x10000) { + int gn= (code>>12)&0xf; + if(!gn) + src_fmt= code&8; + if(gn != next_gn) invalid_psc++; + else valid_psc++; + + if(src_fmt){ // CIF + next_gn= (gn+1 )%13; + }else{ //QCIF + next_gn= (gn+1+!!gn)% 7; + } + } + } + if(valid_psc > 2*invalid_psc + 6){ + return 50; + }else if(valid_psc > 2*invalid_psc + 2) + return 25; + return 0; +} + +AVInputFormat ff_h261_demuxer = { + "h261", + NULL_IF_CONFIG_SMALL("raw H.261"), + 0, + h261_probe, + ff_raw_video_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "h261", + .value = CODEC_ID_H261, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/h263dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/h263dec.c new file mode 100644 index 00000000..634923d8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/h263dec.c @@ -0,0 +1,77 @@ +/* + * RAW H.263 video demuxer + * Copyright (c) 2009 Michael Niedermayer + * + * 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 + */ + +#include "avformat.h" +#include "rawdec.h" + +static int h263_probe(AVProbeData *p) +{ + uint64_t code= -1; + int i; + int valid_psc=0; + int invalid_psc=0; + int res_change=0; + int src_fmt, last_src_fmt=-1; + int last_gn=0; + + for(i=0; ibuf_size; i++){ + code = (code<<8) + p->buf[i]; + if ((code & 0xfffffc0000) == 0x800000) { + src_fmt= (code>>2)&3; + if( src_fmt != last_src_fmt + && last_src_fmt>0 && last_src_fmt<6 + && src_fmt<6) + res_change++; + + if((code&0x300)==0x200 && src_fmt){ + valid_psc++; + last_gn=0; + }else + invalid_psc++; + last_src_fmt= src_fmt; + } else if((code & 0xffff800000) == 0x800000) { + int gn= (code>>(23-5)) & 0x1F; + if(gn 2*invalid_psc + 2*res_change + 3){ + return 50; + }else if(valid_psc > 2*invalid_psc) + return 25; + return 0; +} + +AVInputFormat ff_h263_demuxer = { + "h263", + NULL_IF_CONFIG_SMALL("raw H.263"), + 0, + h263_probe, + ff_raw_video_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, +// .extensions = "h263", //FIXME remove after writing mpeg4_probe + .value = CODEC_ID_H263, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/h264dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/h264dec.c new file mode 100644 index 00000000..3f5ed5ea --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/h264dec.c @@ -0,0 +1,80 @@ +/* + * RAW H.264 video demuxer + * Copyright (c) 2008 Michael Niedermayer + * + * 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 + */ + +#include "avformat.h" +#include "rawdec.h" + +static int h264_probe(AVProbeData *p) +{ + uint32_t code= -1; + int sps=0, pps=0, idr=0, res=0, sli=0; + int i; + + for(i=0; ibuf_size; i++){ + code = (code<<8) + p->buf[i]; + if ((code & 0xffffff00) == 0x100) { + int ref_idc= (code>>5)&3; + int type = code & 0x1F; + static const int8_t ref_zero[32]={ + 2, 0, 0, 0, 0,-1, 1,-1, + -1, 1, 1, 1, 1,-1, 2, 2, + 2, 2, 2, 0, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2 + }; + + if(code & 0x80) //forbidden bit + return 0; + + if(ref_zero[type] == 1 && ref_idc) + return 0; + if(ref_zero[type] ==-1 && !ref_idc) + return 0; + if(ref_zero[type] == 2) + res++; + + switch(type){ + case 1: sli++; break; + case 5: idr++; break; + case 7: + if(p->buf[i+2]&0x0F) + return 0; + sps++; + break; + case 8: pps++; break; + } + } + } + if(sps && pps && (idr||sli>3) && res<(sps+pps+idr)) + return AVPROBE_SCORE_MAX/2+1; // +1 for .mpg + return 0; +} + +AVInputFormat ff_h264_demuxer = { + "h264", + NULL_IF_CONFIG_SMALL("raw H.264 video format"), + 0, + h264_probe, + ff_raw_video_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "h26l,h264,264", //FIXME remove after writing mpeg4_probe + .value = CODEC_ID_H264, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/http.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/http.h new file mode 100644 index 00000000..cd003bba --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/http.h @@ -0,0 +1,64 @@ +/* + * HTTP definitions + * Copyright (c) 2010 Josh Allmann + * + * 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 + */ + +#ifndef AVFORMAT_HTTP_H +#define AVFORMAT_HTTP_H + +#include "avio.h" + +/** + * Set custom HTTP headers. + * A trailing CRLF ("\r\n") is required for custom headers. + * Passing in an empty header string ("\0") will reset to defaults. + * + * The following headers can be overriden by custom values, + * otherwise they will be set to their defaults. + * -User-Agent + * -Accept + * -Range + * -Host + * -Connection + * + * @param h URL context for this HTTP connection + * @param headers the custom headers to set + */ +void ff_http_set_headers(URLContext *h, const char *headers); + +/** + * Enable or disable chunked transfer encoding. (default is enabled) + * + * @param h URL context for this HTTP connection + * @param is_chunked 0 to disable chunking, nonzero otherwise. + */ +void ff_http_set_chunked_transfer_encoding(URLContext *h, int is_chunked); + +/** + * Initialize the authentication state based on another HTTP URLContext. + * This can be used to pre-initialize the authentication parameters if + * they are known beforehand, to avoid having to do an initial failing + * request just to get the parameters. + * + * @param dest URL context whose authentication state gets updated + * @param src URL context whose authentication state gets copied + */ +void ff_http_init_auth_state(URLContext *dest, const URLContext *src); + +#endif /* AVFORMAT_HTTP_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/httpauth.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/httpauth.c new file mode 100644 index 00000000..58e0e82e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/httpauth.c @@ -0,0 +1,268 @@ +/* + * HTTP authentication + * Copyright (c) 2010 Martin Storsjo + * + * 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 + */ + +#include "httpauth.h" +#include "libavutil/base64.h" +#include "libavutil/avstring.h" +#include "internal.h" +#include "libavutil/random_seed.h" +#include "libavutil/md5.h" +#include "avformat.h" +#include + +static void handle_basic_params(HTTPAuthState *state, const char *key, + int key_len, char **dest, int *dest_len) +{ + if (!strncmp(key, "realm=", key_len)) { + *dest = state->realm; + *dest_len = sizeof(state->realm); + } +} + +static void handle_digest_params(HTTPAuthState *state, const char *key, + int key_len, char **dest, int *dest_len) +{ + DigestParams *digest = &state->digest_params; + + if (!strncmp(key, "realm=", key_len)) { + *dest = state->realm; + *dest_len = sizeof(state->realm); + } else if (!strncmp(key, "nonce=", key_len)) { + *dest = digest->nonce; + *dest_len = sizeof(digest->nonce); + } else if (!strncmp(key, "opaque=", key_len)) { + *dest = digest->opaque; + *dest_len = sizeof(digest->opaque); + } else if (!strncmp(key, "algorithm=", key_len)) { + *dest = digest->algorithm; + *dest_len = sizeof(digest->algorithm); + } else if (!strncmp(key, "qop=", key_len)) { + *dest = digest->qop; + *dest_len = sizeof(digest->qop); + } +} + +static void handle_digest_update(HTTPAuthState *state, const char *key, + int key_len, char **dest, int *dest_len) +{ + DigestParams *digest = &state->digest_params; + + if (!strncmp(key, "nextnonce=", key_len)) { + *dest = digest->nonce; + *dest_len = sizeof(digest->nonce); + } +} + +static void choose_qop(char *qop, int size) +{ + char *ptr = strstr(qop, "auth"); + char *end = ptr + strlen("auth"); + + if (ptr && (!*end || isspace(*end) || *end == ',') && + (ptr == qop || isspace(ptr[-1]) || ptr[-1] == ',')) { + av_strlcpy(qop, "auth", size); + } else { + qop[0] = 0; + } +} + +void ff_http_auth_handle_header(HTTPAuthState *state, const char *key, + const char *value) +{ + if (!strcmp(key, "WWW-Authenticate")) { + const char *p; + if (av_stristart(value, "Basic ", &p) && + state->auth_type <= HTTP_AUTH_BASIC) { + state->auth_type = HTTP_AUTH_BASIC; + state->realm[0] = 0; + ff_parse_key_value(p, (ff_parse_key_val_cb) handle_basic_params, + state); + } else if (av_stristart(value, "Digest ", &p) && + state->auth_type <= HTTP_AUTH_DIGEST) { + state->auth_type = HTTP_AUTH_DIGEST; + memset(&state->digest_params, 0, sizeof(DigestParams)); + state->realm[0] = 0; + ff_parse_key_value(p, (ff_parse_key_val_cb) handle_digest_params, + state); + choose_qop(state->digest_params.qop, + sizeof(state->digest_params.qop)); + } + } else if (!strcmp(key, "Authentication-Info")) { + ff_parse_key_value(value, (ff_parse_key_val_cb) handle_digest_update, + state); + } +} + + +static void update_md5_strings(struct AVMD5 *md5ctx, ...) +{ + va_list vl; + + va_start(vl, md5ctx); + while (1) { + const char* str = va_arg(vl, const char*); + if (!str) + break; + av_md5_update(md5ctx, str, strlen(str)); + } + va_end(vl); +} + +/* Generate a digest reply, according to RFC 2617. */ +static char *make_digest_auth(HTTPAuthState *state, const char *username, + const char *password, const char *uri, + const char *method) +{ + DigestParams *digest = &state->digest_params; + int len; + uint32_t cnonce_buf[2]; + char cnonce[17]; + char nc[9]; + int i; + char A1hash[33], A2hash[33], response[33]; + struct AVMD5 *md5ctx; + uint8_t hash[16]; + char *authstr; + + digest->nc++; + snprintf(nc, sizeof(nc), "%08x", digest->nc); + + /* Generate a client nonce. */ + for (i = 0; i < 2; i++) + cnonce_buf[i] = av_get_random_seed(); + ff_data_to_hex(cnonce, (const uint8_t*) cnonce_buf, sizeof(cnonce_buf), 1); + cnonce[2*sizeof(cnonce_buf)] = 0; + + md5ctx = av_malloc(av_md5_size); + if (!md5ctx) + return NULL; + + av_md5_init(md5ctx); + update_md5_strings(md5ctx, username, ":", state->realm, ":", password, NULL); + av_md5_final(md5ctx, hash); + ff_data_to_hex(A1hash, hash, 16, 1); + A1hash[32] = 0; + + if (!strcmp(digest->algorithm, "") || !strcmp(digest->algorithm, "MD5")) { + } else if (!strcmp(digest->algorithm, "MD5-sess")) { + av_md5_init(md5ctx); + update_md5_strings(md5ctx, A1hash, ":", digest->nonce, ":", cnonce, NULL); + av_md5_final(md5ctx, hash); + ff_data_to_hex(A1hash, hash, 16, 1); + A1hash[32] = 0; + } else { + /* Unsupported algorithm */ + av_free(md5ctx); + return NULL; + } + + av_md5_init(md5ctx); + update_md5_strings(md5ctx, method, ":", uri, NULL); + av_md5_final(md5ctx, hash); + ff_data_to_hex(A2hash, hash, 16, 1); + A2hash[32] = 0; + + av_md5_init(md5ctx); + update_md5_strings(md5ctx, A1hash, ":", digest->nonce, NULL); + if (!strcmp(digest->qop, "auth") || !strcmp(digest->qop, "auth-int")) { + update_md5_strings(md5ctx, ":", nc, ":", cnonce, ":", digest->qop, NULL); + } + update_md5_strings(md5ctx, ":", A2hash, NULL); + av_md5_final(md5ctx, hash); + ff_data_to_hex(response, hash, 16, 1); + response[32] = 0; + + av_free(md5ctx); + + if (!strcmp(digest->qop, "") || !strcmp(digest->qop, "auth")) { + } else if (!strcmp(digest->qop, "auth-int")) { + /* qop=auth-int not supported */ + return NULL; + } else { + /* Unsupported qop value. */ + return NULL; + } + + len = strlen(username) + strlen(state->realm) + strlen(digest->nonce) + + strlen(uri) + strlen(response) + strlen(digest->algorithm) + + strlen(digest->opaque) + strlen(digest->qop) + strlen(cnonce) + + strlen(nc) + 150; + + authstr = av_malloc(len); + if (!authstr) + return NULL; + snprintf(authstr, len, "Authorization: Digest "); + + /* TODO: Escape the quoted strings properly. */ + av_strlcatf(authstr, len, "username=\"%s\"", username); + av_strlcatf(authstr, len, ",realm=\"%s\"", state->realm); + av_strlcatf(authstr, len, ",nonce=\"%s\"", digest->nonce); + av_strlcatf(authstr, len, ",uri=\"%s\"", uri); + av_strlcatf(authstr, len, ",response=\"%s\"", response); + if (digest->algorithm[0]) + av_strlcatf(authstr, len, ",algorithm=%s", digest->algorithm); + if (digest->opaque[0]) + av_strlcatf(authstr, len, ",opaque=\"%s\"", digest->opaque); + if (digest->qop[0]) { + av_strlcatf(authstr, len, ",qop=\"%s\"", digest->qop); + av_strlcatf(authstr, len, ",cnonce=\"%s\"", cnonce); + av_strlcatf(authstr, len, ",nc=%s", nc); + } + + av_strlcatf(authstr, len, "\r\n"); + + return authstr; +} + +char *ff_http_auth_create_response(HTTPAuthState *state, const char *auth, + const char *path, const char *method) +{ + char *authstr = NULL; + + if (!auth || !strchr(auth, ':')) + return NULL; + + if (state->auth_type == HTTP_AUTH_BASIC) { + int auth_b64_len = AV_BASE64_SIZE(strlen(auth)); + int len = auth_b64_len + 30; + char *ptr; + authstr = av_malloc(len); + if (!authstr) + return NULL; + snprintf(authstr, len, "Authorization: Basic "); + ptr = authstr + strlen(authstr); + av_base64_encode(ptr, auth_b64_len, auth, strlen(auth)); + av_strlcat(ptr, "\r\n", len - (ptr - authstr)); + } else if (state->auth_type == HTTP_AUTH_DIGEST) { + char *username = av_strdup(auth), *password; + + if (!username) + return NULL; + + if ((password = strchr(username, ':'))) { + *password++ = 0; + authstr = make_digest_auth(state, username, password, path, method); + } + av_free(username); + } + return authstr; +} + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/httpauth.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/httpauth.h new file mode 100644 index 00000000..ebab3fca --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/httpauth.h @@ -0,0 +1,72 @@ +/* + * HTTP authentication + * Copyright (c) 2010 Martin Storsjo + * + * 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 + */ + +#ifndef AVFORMAT_HTTPAUTH_H +#define AVFORMAT_HTTPAUTH_H + +/** + * Authentication types, ordered from weakest to strongest. + */ +typedef enum HTTPAuthType { + HTTP_AUTH_NONE = 0, /**< No authentication specified */ + HTTP_AUTH_BASIC, /**< HTTP 1.0 Basic auth from RFC 1945 + * (also in RFC 2617) */ + HTTP_AUTH_DIGEST, /**< HTTP 1.1 Digest auth from RFC 2617 */ +} HTTPAuthType; + +typedef struct { + char nonce[300]; /**< Server specified nonce */ + char algorithm[10]; /**< Server specified digest algorithm */ + char qop[30]; /**< Quality of protection, containing the one + * that we've chosen to use, from the + * alternatives that the server offered. */ + char opaque[300]; /**< A server-specified string that should be + * included in authentication responses, not + * included in the actual digest calculation. */ + int nc; /**< Nonce count, the number of earlier replies + * where this particular nonce has been used. */ +} DigestParams; + +/** + * HTTP Authentication state structure. Must be zero-initialized + * before used with the functions below. + */ +typedef struct { + /** + * The currently chosen auth type. + */ + HTTPAuthType auth_type; + /** + * Authentication realm + */ + char realm[200]; + /** + * The parameters specifiec to digest authentication. + */ + DigestParams digest_params; +} HTTPAuthState; + +void ff_http_auth_handle_header(HTTPAuthState *state, const char *key, + const char *value); +char *ff_http_auth_create_response(HTTPAuthState *state, const char *auth, + const char *path, const char *method); + +#endif /* AVFORMAT_HTTPAUTH_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/idroqdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/idroqdec.c new file mode 100644 index 00000000..285a3e1e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/idroqdec.c @@ -0,0 +1,226 @@ +/* + * id RoQ (.roq) File Demuxer + * Copyright (c) 2003 The ffmpeg Project + * + * 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 + * id RoQ format file demuxer + * by Mike Melanson (melanson@pcisys.net) + * for more information on the .roq file format, visit: + * http://www.csse.monash.edu.au/~timf/ + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" + +#define RoQ_MAGIC_NUMBER 0x1084 +#define RoQ_CHUNK_PREAMBLE_SIZE 8 +#define RoQ_AUDIO_SAMPLE_RATE 22050 +#define RoQ_CHUNKS_TO_SCAN 30 + +#define RoQ_INFO 0x1001 +#define RoQ_QUAD_CODEBOOK 0x1002 +#define RoQ_QUAD_VQ 0x1011 +#define RoQ_SOUND_MONO 0x1020 +#define RoQ_SOUND_STEREO 0x1021 + +typedef struct RoqDemuxContext { + + int width; + int height; + int audio_channels; + + int video_stream_index; + int audio_stream_index; + + int64_t video_pts; + unsigned int audio_frame_count; + +} RoqDemuxContext; + +static int roq_probe(AVProbeData *p) +{ + if ((AV_RL16(&p->buf[0]) != RoQ_MAGIC_NUMBER) || + (AV_RL32(&p->buf[2]) != 0xFFFFFFFF)) + return 0; + + return AVPROBE_SCORE_MAX; +} + +static int roq_read_header(AVFormatContext *s, + AVFormatParameters *ap) +{ + RoqDemuxContext *roq = s->priv_data; + ByteIOContext *pb = s->pb; + int framerate; + AVStream *st; + unsigned char preamble[RoQ_CHUNK_PREAMBLE_SIZE]; + + /* get the main header */ + if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) != + RoQ_CHUNK_PREAMBLE_SIZE) + return AVERROR(EIO); + framerate = AV_RL16(&preamble[6]); + + /* init private context parameters */ + roq->width = roq->height = roq->audio_channels = roq->video_pts = + roq->audio_frame_count = 0; + roq->audio_stream_index = -1; + + st = av_new_stream(s, 0); + if (!st) + return AVERROR(ENOMEM); + av_set_pts_info(st, 63, 1, framerate); + roq->video_stream_index = st->index; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + st->codec->codec_id = CODEC_ID_ROQ; + st->codec->codec_tag = 0; /* no fourcc */ + + return 0; +} + +static int roq_read_packet(AVFormatContext *s, + AVPacket *pkt) +{ + RoqDemuxContext *roq = s->priv_data; + ByteIOContext *pb = s->pb; + int ret = 0; + unsigned int chunk_size; + unsigned int chunk_type; + unsigned int codebook_size; + unsigned char preamble[RoQ_CHUNK_PREAMBLE_SIZE]; + int packet_read = 0; + int64_t codebook_offset; + + while (!packet_read) { + + if (url_feof(s->pb)) + return AVERROR(EIO); + + /* get the next chunk preamble */ + if ((ret = get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE)) != + RoQ_CHUNK_PREAMBLE_SIZE) + return AVERROR(EIO); + + chunk_type = AV_RL16(&preamble[0]); + chunk_size = AV_RL32(&preamble[2]); + if(chunk_size > INT_MAX) + return AVERROR_INVALIDDATA; + + switch (chunk_type) { + + case RoQ_INFO: + if (!roq->width || !roq->height) { + AVStream *st = s->streams[roq->video_stream_index]; + if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) != RoQ_CHUNK_PREAMBLE_SIZE) + return AVERROR(EIO); + st->codec->width = roq->width = AV_RL16(preamble); + st->codec->height = roq->height = AV_RL16(preamble + 2); + break; + } + /* don't care about this chunk anymore */ + url_fseek(pb, RoQ_CHUNK_PREAMBLE_SIZE, SEEK_CUR); + break; + + case RoQ_QUAD_CODEBOOK: + /* packet needs to contain both this codebook and next VQ chunk */ + codebook_offset = url_ftell(pb) - RoQ_CHUNK_PREAMBLE_SIZE; + codebook_size = chunk_size; + url_fseek(pb, codebook_size, SEEK_CUR); + if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) != + RoQ_CHUNK_PREAMBLE_SIZE) + return AVERROR(EIO); + chunk_size = AV_RL32(&preamble[2]) + RoQ_CHUNK_PREAMBLE_SIZE * 2 + + codebook_size; + + /* rewind */ + url_fseek(pb, codebook_offset, SEEK_SET); + + /* load up the packet */ + ret= av_get_packet(pb, pkt, chunk_size); + if (ret != chunk_size) + return AVERROR(EIO); + pkt->stream_index = roq->video_stream_index; + pkt->pts = roq->video_pts++; + + packet_read = 1; + break; + + case RoQ_SOUND_MONO: + case RoQ_SOUND_STEREO: + if (roq->audio_stream_index == -1) { + AVStream *st = av_new_stream(s, 1); + if (!st) + return AVERROR(ENOMEM); + av_set_pts_info(st, 32, 1, RoQ_AUDIO_SAMPLE_RATE); + roq->audio_stream_index = st->index; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; + st->codec->codec_id = CODEC_ID_ROQ_DPCM; + st->codec->codec_tag = 0; /* no tag */ + st->codec->channels = roq->audio_channels = chunk_type == RoQ_SOUND_STEREO ? 2 : 1; + st->codec->sample_rate = RoQ_AUDIO_SAMPLE_RATE; + st->codec->bits_per_coded_sample = 16; + st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * + st->codec->bits_per_coded_sample; + st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; + } + case RoQ_QUAD_VQ: + /* load up the packet */ + if (av_new_packet(pkt, chunk_size + RoQ_CHUNK_PREAMBLE_SIZE)) + return AVERROR(EIO); + /* copy over preamble */ + memcpy(pkt->data, preamble, RoQ_CHUNK_PREAMBLE_SIZE); + + if (chunk_type == RoQ_QUAD_VQ) { + pkt->stream_index = roq->video_stream_index; + pkt->pts = roq->video_pts++; + } else { + pkt->stream_index = roq->audio_stream_index; + pkt->pts = roq->audio_frame_count; + roq->audio_frame_count += (chunk_size / roq->audio_channels); + } + + pkt->pos= url_ftell(pb); + ret = get_buffer(pb, pkt->data + RoQ_CHUNK_PREAMBLE_SIZE, + chunk_size); + if (ret != chunk_size) + ret = AVERROR(EIO); + + packet_read = 1; + break; + + default: + av_log(s, AV_LOG_ERROR, " unknown RoQ chunk (%04X)\n", chunk_type); + return AVERROR_INVALIDDATA; + break; + } + } + + return ret; +} + +AVInputFormat ff_roq_demuxer = { + "RoQ", + NULL_IF_CONFIG_SMALL("id RoQ format"), + sizeof(RoqDemuxContext), + roq_probe, + roq_read_header, + roq_read_packet, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/idroqenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/idroqenc.c new file mode 100644 index 00000000..8859c98a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/idroqenc.c @@ -0,0 +1,49 @@ +/* + * id RoQ (.roq) File muxer + * Copyright (c) 2007 Vitor Sessak + * + * 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 + */ + +#include "avformat.h" +#include "rawenc.h" + + +static int roq_write_header(struct AVFormatContext *s) +{ + static const uint8_t header[] = { + 0x84, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00 + }; + + put_buffer(s->pb, header, 8); + put_flush_packet(s->pb); + + return 0; +} + +AVOutputFormat ff_roq_muxer = +{ + "RoQ", + NULL_IF_CONFIG_SMALL("raw id RoQ format"), + NULL, + "roq", + 0, + CODEC_ID_ROQ_DPCM, + CODEC_ID_ROQ, + roq_write_header, + ff_raw_write_packet, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ingenientdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ingenientdec.c new file mode 100644 index 00000000..79587b51 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ingenientdec.c @@ -0,0 +1,71 @@ +/* + * RAW Ingenient MJPEG demuxer + * Copyright (c) 2005 Alex Beregszaszi + * + * 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 + */ + +#include "avformat.h" +#include "rawdec.h" + +// http://www.artificis.hu/files/texts/ingenient.txt +static int ingenient_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + int ret, size, w, h, unk1, unk2; + + if (get_le32(s->pb) != MKTAG('M', 'J', 'P', 'G')) + return AVERROR(EIO); // FIXME + + size = get_le32(s->pb); + + w = get_le16(s->pb); + h = get_le16(s->pb); + + url_fskip(s->pb, 8); // zero + size (padded?) + url_fskip(s->pb, 2); + unk1 = get_le16(s->pb); + unk2 = get_le16(s->pb); + url_fskip(s->pb, 22); // ASCII timestamp + + av_log(s, AV_LOG_DEBUG, "Ingenient packet: size=%d, width=%d, height=%d, unk1=%d unk2=%d\n", + size, w, h, unk1, unk2); + + if (av_new_packet(pkt, size) < 0) + return AVERROR(ENOMEM); + + pkt->pos = url_ftell(s->pb); + pkt->stream_index = 0; + ret = get_buffer(s->pb, pkt->data, size); + if (ret < 0) { + av_free_packet(pkt); + return ret; + } + pkt->size = ret; + return ret; +} + +AVInputFormat ff_ingenient_demuxer = { + "ingenient", + NULL_IF_CONFIG_SMALL("raw Ingenient MJPEG"), + 0, + NULL, + ff_raw_video_read_header, + ingenient_read_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "cgi", // FIXME + .value = CODEC_ID_MJPEG, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/iv8.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/iv8.c new file mode 100644 index 00000000..07659cf8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/iv8.c @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2009 Michael Niedermayer + * + * 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 + */ + +#include "avformat.h" + + +static int probe(AVProbeData *p) +{ + // the single file i have starts with that, i dont know if others do too + if( p->buf[0] == 1 + && p->buf[1] == 1 + && p->buf[2] == 3 + && p->buf[3] == 0xB8 + && p->buf[4] == 0x80 + && p->buf[5] == 0x60 + ) + return AVPROBE_SCORE_MAX-2; + + return 0; +} + +static int read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + AVStream *st; + + st = av_new_stream(s, 0); + if (!st) + return AVERROR(ENOMEM); + + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + st->codec->codec_id = CODEC_ID_MPEG4; + st->need_parsing = AVSTREAM_PARSE_FULL; + av_set_pts_info(st, 64, 1, 90000); + + return 0; + +} + +static int read_packet(AVFormatContext *s, AVPacket *pkt) +{ + int ret, size, pts, type; +retry: + type= get_be16(s->pb); // 257 or 258 + size= get_be16(s->pb); + + get_be16(s->pb); //some flags, 0x80 indicates end of frame + get_be16(s->pb); //packet number + pts=get_be32(s->pb); + get_be32(s->pb); //6A 13 E3 88 + + size -= 12; + if(size<1) + return -1; + + if(type==258){ + url_fskip(s->pb, size); + goto retry; + } + + ret= av_get_packet(s->pb, pkt, size); + + pkt->pts= pts; + pkt->pos-=16; + + pkt->stream_index = 0; + + return ret; +} + +AVInputFormat ff_iv8_demuxer = { + "iv8", + NULL_IF_CONFIG_SMALL("A format generated by IndigoVision 8000 video server"), + 0, + probe, + read_header, + read_packet, + .flags= AVFMT_GENERIC_INDEX, + .value = CODEC_ID_MPEG4, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ivfdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ivfdec.c new file mode 100644 index 00000000..94b8b82a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ivfdec.c @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2010 David Conrad + * + * 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 + */ + +#include "avformat.h" +#include "riff.h" +#include "libavutil/intreadwrite.h" + +static int probe(AVProbeData *p) +{ + if (AV_RL32(p->buf) == MKTAG('D','K','I','F') + && !AV_RL16(p->buf+4) && AV_RL16(p->buf+6) == 32) + return AVPROBE_SCORE_MAX-2; + + return 0; +} + +static int read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + AVStream *st; + AVRational time_base; + + get_le32(s->pb); // DKIF + get_le16(s->pb); // version + get_le16(s->pb); // header size + + st = av_new_stream(s, 0); + if (!st) + return AVERROR(ENOMEM); + + + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + st->codec->codec_tag = get_le32(s->pb); + st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, st->codec->codec_tag); + st->codec->width = get_le16(s->pb); + st->codec->height = get_le16(s->pb); + time_base.den = get_le32(s->pb); + time_base.num = get_le32(s->pb); + st->duration = get_le64(s->pb); + + st->need_parsing = AVSTREAM_PARSE_HEADERS; + + if (!time_base.den || !time_base.num) { + av_log(s, AV_LOG_ERROR, "Invalid frame rate\n"); + return AVERROR_INVALIDDATA; + } + + av_set_pts_info(st, 64, time_base.num, time_base.den); + + return 0; +} + +static int read_packet(AVFormatContext *s, AVPacket *pkt) +{ + int ret, size = get_le32(s->pb); + int64_t pts = get_le64(s->pb); + + ret = av_get_packet(s->pb, pkt, size); + pkt->stream_index = 0; + pkt->pts = pts; + pkt->pos -= 12; + + return ret; +} + +AVInputFormat ff_ivf_demuxer = { + "ivf", + NULL_IF_CONFIG_SMALL("On2 IVF"), + 0, + probe, + read_header, + read_packet, + .flags= AVFMT_GENERIC_INDEX, + .codec_tag = (const AVCodecTag*[]){ff_codec_bmp_tags, 0}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ivfenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ivfenc.c new file mode 100644 index 00000000..b3b28419 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/ivfenc.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010 Reimar DÃķffinger + * + * 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 + */ +#include "avformat.h" +#include "libavutil/intreadwrite.h" + +static int ivf_write_header(AVFormatContext *s) +{ + AVCodecContext *ctx; + ByteIOContext *pb = s->pb; + + if (s->nb_streams != 1) { + av_log(s, AV_LOG_ERROR, "Format supports only exactly one video stream\n"); + return AVERROR(EINVAL); + } + ctx = s->streams[0]->codec; + if (ctx->codec_type != CODEC_TYPE_VIDEO || ctx->codec_id != CODEC_ID_VP8) { + av_log(s, AV_LOG_ERROR, "Currently only VP8 is supported!\n"); + return AVERROR(EINVAL); + } + put_buffer(pb, "DKIF", 4); + put_le16(pb, 0); // version + put_le16(pb, 32); // header length + put_le32(pb, ctx->codec_tag ? ctx->codec_tag : AV_RL32("VP80")); + put_le16(pb, ctx->width); + put_le16(pb, ctx->height); + put_le32(pb, s->streams[0]->time_base.den); + put_le32(pb, s->streams[0]->time_base.num); + put_le64(pb, s->streams[0]->duration); // TODO: duration or number of frames?!? + + return 0; +} + +static int ivf_write_packet(AVFormatContext *s, AVPacket *pkt) +{ + ByteIOContext *pb = s->pb; + put_le32(pb, pkt->size); + put_le64(pb, pkt->pts); + put_buffer(pb, pkt->data, pkt->size); + put_flush_packet(pb); + + return 0; +} + +AVOutputFormat ff_ivf_muxer = { + .name = "ivf", + .long_name = NULL_IF_CONFIG_SMALL("On2 IVF"), + .extensions = "ivf", + .audio_codec = CODEC_ID_NONE, + .video_codec = CODEC_ID_VP8, + .write_header = ivf_write_header, + .write_packet = ivf_write_packet, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/librtmp.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/librtmp.c new file mode 100644 index 00000000..632ac95d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/librtmp.c @@ -0,0 +1,223 @@ +/* + * RTMP network protocol + * Copyright (c) 2010 Howard Chu + * + * 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 + * RTMP protocol based on http://rtmpdump.mplayerhq.hu/ librtmp + */ + +#include "avformat.h" + +#include +#include + +static void rtmp_log(int level, const char *fmt, va_list args) +{ + switch (level) { + default: + case RTMP_LOGCRIT: level = AV_LOG_FATAL; break; + case RTMP_LOGERROR: level = AV_LOG_ERROR; break; + case RTMP_LOGWARNING: level = AV_LOG_WARNING; break; + case RTMP_LOGINFO: level = AV_LOG_INFO; break; + case RTMP_LOGDEBUG: level = AV_LOG_VERBOSE; break; + case RTMP_LOGDEBUG2: level = AV_LOG_DEBUG; break; + } + + av_vlog(NULL, level, fmt, args); + av_log(NULL, level, "\n"); +} + +static int rtmp_close(URLContext *s) +{ + RTMP *r = s->priv_data; + + RTMP_Close(r); + av_free(r); + return 0; +} + +/** + * Open RTMP connection and verify that the stream can be played. + * + * URL syntax: rtmp://server[:port][/app][/playpath][ keyword=value]... + * where 'app' is first one or two directories in the path + * (e.g. /ondemand/, /flash/live/, etc.) + * and 'playpath' is a file name (the rest of the path, + * may be prefixed with "mp4:") + * + * Additional RTMP library options may be appended as + * space-separated key-value pairs. + */ +static int rtmp_open(URLContext *s, const char *uri, int flags) +{ + RTMP *r; + int rc; + + r = av_mallocz(sizeof(RTMP)); + if (!r) + return AVERROR(ENOMEM); + + switch (av_log_get_level()) { + default: + case AV_LOG_FATAL: rc = RTMP_LOGCRIT; break; + case AV_LOG_ERROR: rc = RTMP_LOGERROR; break; + case AV_LOG_WARNING: rc = RTMP_LOGWARNING; break; + case AV_LOG_INFO: rc = RTMP_LOGINFO; break; + case AV_LOG_VERBOSE: rc = RTMP_LOGDEBUG; break; + case AV_LOG_DEBUG: rc = RTMP_LOGDEBUG2; break; + } + RTMP_LogSetLevel(rc); + RTMP_LogSetCallback(rtmp_log); + + RTMP_Init(r); + if (!RTMP_SetupURL(r, s->filename)) { + rc = -1; + goto fail; + } + + if (flags & URL_WRONLY) + RTMP_EnableWrite(r); + + if (!RTMP_Connect(r, NULL) || !RTMP_ConnectStream(r, 0)) { + rc = -1; + goto fail; + } + + s->priv_data = r; + s->is_streamed = 1; + return 0; +fail: + av_free(r); + return rc; +} + +static int rtmp_write(URLContext *s, const uint8_t *buf, int size) +{ + RTMP *r = s->priv_data; + + return RTMP_Write(r, buf, size); +} + +static int rtmp_read(URLContext *s, uint8_t *buf, int size) +{ + RTMP *r = s->priv_data; + + return RTMP_Read(r, buf, size); +} + +static int rtmp_read_pause(URLContext *s, int pause) +{ + RTMP *r = s->priv_data; + + if (!RTMP_Pause(r, pause)) + return -1; + return 0; +} + +static int64_t rtmp_read_seek(URLContext *s, int stream_index, + int64_t timestamp, int flags) +{ + RTMP *r = s->priv_data; + + if (flags & AVSEEK_FLAG_BYTE) + return AVERROR(ENOSYS); + + /* seeks are in milliseconds */ + if (stream_index < 0) + timestamp = av_rescale_rnd(timestamp, 1000, AV_TIME_BASE, + flags & AVSEEK_FLAG_BACKWARD ? AV_ROUND_DOWN : AV_ROUND_UP); + + if (!RTMP_SendSeek(r, timestamp)) + return -1; + return timestamp; +} + +static int rtmp_get_file_handle(URLContext *s) +{ + RTMP *r = s->priv_data; + + return RTMP_Socket(r); +} + +URLProtocol ff_rtmp_protocol = { + "rtmp", + rtmp_open, + rtmp_read, + rtmp_write, + NULL, /* seek */ + rtmp_close, + NULL, /* next */ + rtmp_read_pause, + rtmp_read_seek, + rtmp_get_file_handle +}; + +URLProtocol ff_rtmpt_protocol = { + "rtmpt", + rtmp_open, + rtmp_read, + rtmp_write, + NULL, /* seek */ + rtmp_close, + NULL, /* next */ + rtmp_read_pause, + rtmp_read_seek, + rtmp_get_file_handle +}; + +URLProtocol ff_rtmpe_protocol = { + "rtmpe", + rtmp_open, + rtmp_read, + rtmp_write, + NULL, /* seek */ + rtmp_close, + NULL, /* next */ + rtmp_read_pause, + rtmp_read_seek, + rtmp_get_file_handle +}; + +URLProtocol ff_rtmpte_protocol = { + "rtmpte", + rtmp_open, + rtmp_read, + rtmp_write, + NULL, /* seek */ + rtmp_close, + NULL, /* next */ + rtmp_read_pause, + rtmp_read_seek, + rtmp_get_file_handle +}; + +URLProtocol ff_rtmps_protocol = { + "rtmps", + rtmp_open, + rtmp_read, + rtmp_write, + NULL, /* seek */ + rtmp_close, + NULL, /* next */ + rtmp_read_pause, + rtmp_read_seek, + rtmp_get_file_handle +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/lxfdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/lxfdec.c new file mode 100644 index 00000000..1d4d269d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/lxfdec.c @@ -0,0 +1,348 @@ +/* + * LXF demuxer + * Copyright (c) 2010 Tomas HÃĪrdin + * + * 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 + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "riff.h" + +#define LXF_PACKET_HEADER_SIZE 60 +#define LXF_HEADER_DATA_SIZE 120 +#define LXF_IDENT "LEITCH\0" +#define LXF_IDENT_LENGTH 8 +#define LXF_SAMPLERATE 48000 +#define LXF_MAX_AUDIO_PACKET (8008*15*4) ///< 15-channel 32-bit NTSC audio frame + +static const AVCodecTag lxf_tags[] = { + { CODEC_ID_MJPEG, 0 }, + { CODEC_ID_MPEG1VIDEO, 1 }, + { CODEC_ID_MPEG2VIDEO, 2 }, //MpMl, 4:2:0 + { CODEC_ID_MPEG2VIDEO, 3 }, //MpPl, 4:2:2 + { CODEC_ID_DVVIDEO, 4 }, //DV25 + { CODEC_ID_DVVIDEO, 5 }, //DVCPRO + { CODEC_ID_DVVIDEO, 6 }, //DVCPRO50 + { CODEC_ID_RAWVIDEO, 7 }, //PIX_FMT_ARGB, where alpha is used for chroma keying + { CODEC_ID_RAWVIDEO, 8 }, //16-bit chroma key + { CODEC_ID_MPEG2VIDEO, 9 }, //4:2:2 CBP ("Constrained Bytes per Gop") + { CODEC_ID_NONE, 0 }, +}; + +typedef struct { + int channels; ///< number of audio channels. zero means no audio + uint8_t temp[LXF_MAX_AUDIO_PACKET]; ///< temp buffer for de-planarizing the audio data + int frame_number; ///< current video frame +} LXFDemuxContext; + +static int lxf_probe(AVProbeData *p) +{ + if (!memcmp(p->buf, LXF_IDENT, LXF_IDENT_LENGTH)) + return AVPROBE_SCORE_MAX; + + return 0; +} + +/** + * Verify the checksum of an LXF packet header + * + * @param[in] header the packet header to check + * @return zero if the checksum is OK, non-zero otherwise + */ +static int check_checksum(const uint8_t *header) +{ + int x; + uint32_t sum = 0; + + for (x = 0; x < LXF_PACKET_HEADER_SIZE; x += 4) + sum += AV_RL32(&header[x]); + + return sum; +} + +/** + * Read input until we find the next ident. If found, copy it to the header buffer + * + * @param[out] header where to copy the ident to + * @return 0 if an ident was found, < 0 on I/O error + */ +static int sync(AVFormatContext *s, uint8_t *header) +{ + uint8_t buf[LXF_IDENT_LENGTH]; + int ret; + + if ((ret = get_buffer(s->pb, buf, LXF_IDENT_LENGTH)) != LXF_IDENT_LENGTH) + return ret < 0 ? ret : AVERROR_EOF; + + while (memcmp(buf, LXF_IDENT, LXF_IDENT_LENGTH)) { + if (url_feof(s->pb)) + return AVERROR_EOF; + + memmove(buf, &buf[1], LXF_IDENT_LENGTH-1); + buf[LXF_IDENT_LENGTH-1] = get_byte(s->pb); + } + + memcpy(header, LXF_IDENT, LXF_IDENT_LENGTH); + + return 0; +} + +/** + * Read and checksum the next packet header + * + * @param[out] header the read packet header + * @param[out] format context dependent format information + * @return the size of the payload following the header or < 0 on failure + */ +static int get_packet_header(AVFormatContext *s, uint8_t *header, uint32_t *format) +{ + ByteIOContext *pb = s->pb; + int track_size, samples, ret; + AVStream *st; + + //find and read the ident + if ((ret = sync(s, header)) < 0) + return ret; + + //read the rest of the packet header + if ((ret = get_buffer(pb, header + LXF_IDENT_LENGTH, + LXF_PACKET_HEADER_SIZE - LXF_IDENT_LENGTH)) != + LXF_PACKET_HEADER_SIZE - LXF_IDENT_LENGTH) { + return ret < 0 ? ret : AVERROR_EOF; + } + + if (check_checksum(header)) + av_log(s, AV_LOG_ERROR, "checksum error\n"); + + *format = AV_RL32(&header[32]); + ret = AV_RL32(&header[36]); + + //type + switch (AV_RL32(&header[16])) { + case 0: + //video + //skip VBI data and metadata + url_fskip(pb, (int64_t)(uint32_t)AV_RL32(&header[44]) + + (int64_t)(uint32_t)AV_RL32(&header[52])); + break; + case 1: + //audio + if (!(st = s->streams[1])) { + av_log(s, AV_LOG_INFO, "got audio packet, but no audio stream present\n"); + break; + } + + //set codec based on specified audio bitdepth + //we only support tightly packed 16-, 20-, 24- and 32-bit PCM at the moment + *format = AV_RL32(&header[40]); + st->codec->bits_per_coded_sample = (*format >> 6) & 0x3F; + + if (st->codec->bits_per_coded_sample != (*format & 0x3F)) { + av_log(s, AV_LOG_WARNING, "only tightly packed PCM currently supported\n"); + return AVERROR_PATCHWELCOME; + } + + switch (st->codec->bits_per_coded_sample) { + case 16: st->codec->codec_id = CODEC_ID_PCM_S16LE; break; + case 20: st->codec->codec_id = CODEC_ID_PCM_LXF; break; + case 24: st->codec->codec_id = CODEC_ID_PCM_S24LE; break; + case 32: st->codec->codec_id = CODEC_ID_PCM_S32LE; break; + default: + av_log(s, AV_LOG_WARNING, + "only 16-, 20-, 24- and 32-bit PCM currently supported\n"); + return AVERROR_PATCHWELCOME; + } + + track_size = AV_RL32(&header[48]); + samples = track_size * 8 / st->codec->bits_per_coded_sample; + + //use audio packet size to determine video standard + //for NTSC we have one 8008-sample audio frame per five video frames + if (samples == LXF_SAMPLERATE * 5005 / 30000) { + av_set_pts_info(s->streams[0], 64, 1001, 30000); + } else { + //assume PAL, but warn if we don't have 1920 samples + if (samples != LXF_SAMPLERATE / 25) + av_log(s, AV_LOG_WARNING, + "video doesn't seem to be PAL or NTSC. guessing PAL\n"); + + av_set_pts_info(s->streams[0], 64, 1, 25); + } + + //TODO: warning if track mask != (1 << channels) - 1? + ret = av_popcount(AV_RL32(&header[44])) * track_size; + + break; + default: + break; + } + + return ret; +} + +static int lxf_read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + LXFDemuxContext *lxf = s->priv_data; + ByteIOContext *pb = s->pb; + uint8_t header[LXF_PACKET_HEADER_SIZE], header_data[LXF_HEADER_DATA_SIZE]; + int ret; + AVStream *st; + uint32_t format, video_params, disk_params; + uint16_t record_date, expiration_date; + + if ((ret = get_packet_header(s, header, &format)) < 0) + return ret; + + if (ret != LXF_HEADER_DATA_SIZE) { + av_log(s, AV_LOG_ERROR, "expected %d B size header, got %d\n", + LXF_HEADER_DATA_SIZE, ret); + return AVERROR_INVALIDDATA; + } + + if ((ret = get_buffer(pb, header_data, LXF_HEADER_DATA_SIZE)) != LXF_HEADER_DATA_SIZE) + return ret < 0 ? ret : AVERROR_EOF; + + if (!(st = av_new_stream(s, 0))) + return AVERROR_NOMEM; + + st->duration = AV_RL32(&header_data[32]); + video_params = AV_RL32(&header_data[40]); + record_date = AV_RL16(&header_data[56]); + expiration_date = AV_RL16(&header_data[58]); + disk_params = AV_RL32(&header_data[116]); + + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + st->codec->bit_rate = 1000000 * ((video_params >> 14) & 0xFF); + st->codec->codec_tag = video_params & 0xF; + st->codec->codec_id = ff_codec_get_id(lxf_tags, st->codec->codec_tag); + + av_log(s, AV_LOG_DEBUG, "record: %x = %i-%02i-%02i\n", + record_date, 1900 + (record_date & 0x7F), (record_date >> 7) & 0xF, + (record_date >> 11) & 0x1F); + + av_log(s, AV_LOG_DEBUG, "expire: %x = %i-%02i-%02i\n", + expiration_date, 1900 + (expiration_date & 0x7F), (expiration_date >> 7) & 0xF, + (expiration_date >> 11) & 0x1F); + + if ((video_params >> 22) & 1) + av_log(s, AV_LOG_WARNING, "VBI data not yet supported\n"); + + if ((lxf->channels = (disk_params >> 2) & 0xF)) { + if (!(st = av_new_stream(s, 1))) + return AVERROR_NOMEM; + + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; + st->codec->sample_rate = LXF_SAMPLERATE; + st->codec->channels = lxf->channels; + + av_set_pts_info(st, 64, 1, st->codec->sample_rate); + } + + if (format == 1) { + //skip extended field data + url_fskip(s->pb, (uint32_t)AV_RL32(&header[40])); + } + + return 0; +} + +/** + * De-planerize the PCM data in lxf->temp + * FIXME: remove this once support for planar audio is added to libavcodec + * + * @param[out] out where to write the de-planerized data to + * @param[in] bytes the total size of the PCM data + */ +static void deplanarize(LXFDemuxContext *lxf, AVStream *ast, uint8_t *out, int bytes) +{ + int x, y, z, i, bytes_per_sample = ast->codec->bits_per_coded_sample >> 3; + + for (z = i = 0; z < lxf->channels; z++) + for (y = 0; y < bytes / bytes_per_sample / lxf->channels; y++) + for (x = 0; x < bytes_per_sample; x++, i++) + out[x + bytes_per_sample*(z + y*lxf->channels)] = lxf->temp[i]; +} + +static int lxf_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + LXFDemuxContext *lxf = s->priv_data; + ByteIOContext *pb = s->pb; + uint8_t header[LXF_PACKET_HEADER_SIZE], *buf; + AVStream *ast = NULL; + uint32_t stream, format; + int ret, ret2; + + if ((ret = get_packet_header(s, header, &format)) < 0) + return ret; + + stream = AV_RL32(&header[16]); + + if (stream > 1) { + av_log(s, AV_LOG_WARNING, "got packet with illegal stream index %u\n", stream); + return AVERROR(EAGAIN); + } + + if (stream == 1 && !(ast = s->streams[1])) { + av_log(s, AV_LOG_ERROR, "got audio packet without having an audio stream\n"); + return AVERROR_INVALIDDATA; + } + + //make sure the data fits in the de-planerization buffer + if (ast && ret > LXF_MAX_AUDIO_PACKET) { + av_log(s, AV_LOG_ERROR, "audio packet too large (%i > %i)\n", + ret, LXF_MAX_AUDIO_PACKET); + return AVERROR_INVALIDDATA; + } + + if ((ret2 = av_new_packet(pkt, ret)) < 0) + return ret2; + + //read non-20-bit audio data into lxf->temp so we can deplanarize it + buf = ast && ast->codec->codec_id != CODEC_ID_PCM_LXF ? lxf->temp : pkt->data; + + if ((ret2 = get_buffer(pb, buf, ret)) != ret) { + av_free_packet(pkt); + return ret2 < 0 ? ret2 : AVERROR_EOF; + } + + pkt->stream_index = stream; + + if (ast) { + if(ast->codec->codec_id != CODEC_ID_PCM_LXF) + deplanarize(lxf, ast, pkt->data, ret); + } else { + //picture type (0 = closed I, 1 = open I, 2 = P, 3 = B) + if (((format >> 22) & 0x3) < 2) + pkt->flags |= AV_PKT_FLAG_KEY; + + pkt->dts = lxf->frame_number++; + } + + return ret; +} + +AVInputFormat ff_lxf_demuxer = { + .name = "lxf", + .long_name = NULL_IF_CONFIG_SMALL("VR native stream format (LXF)"), + .priv_data_size = sizeof(LXFDemuxContext), + .read_probe = lxf_probe, + .read_header = lxf_read_header, + .read_packet = lxf_read_packet, + .codec_tag = (const AVCodecTag* const []){lxf_tags, 0}, +}; + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/m4vdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/m4vdec.c new file mode 100644 index 00000000..4b0154ed --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/m4vdec.c @@ -0,0 +1,62 @@ +/* + * RAW MPEG-4 video demuxer + * Copyright (c) 2006 Thijs Vermeir + * + * 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 + */ + +#include "avformat.h" +#include "rawdec.h" + +#define VISUAL_OBJECT_START_CODE 0x000001b5 +#define VOP_START_CODE 0x000001b6 + +static int mpeg4video_probe(AVProbeData *probe_packet) +{ + uint32_t temp_buffer= -1; + int VO=0, VOL=0, VOP = 0, VISO = 0, res=0; + int i; + + for(i=0; ibuf_size; i++){ + temp_buffer = (temp_buffer<<8) + probe_packet->buf[i]; + if ((temp_buffer & 0xffffff00) != 0x100) + continue; + + if (temp_buffer == VOP_START_CODE) VOP++; + else if (temp_buffer == VISUAL_OBJECT_START_CODE) VISO++; + else if (temp_buffer < 0x120) VO++; + else if (temp_buffer < 0x130) VOL++; + else if ( !(0x1AF < temp_buffer && temp_buffer < 0x1B7) + && !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++; + } + + if (VOP >= VISO && VOP >= VOL && VO >= VOL && VOL > 0 && res==0) + return AVPROBE_SCORE_MAX/2; + return 0; +} + +AVInputFormat ff_m4v_demuxer = { + "m4v", + NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"), + 0, + mpeg4video_probe, /** probing for MPEG-4 data */ + ff_raw_video_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "m4v", + .value = CODEC_ID_MPEG4, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/md5enc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/md5enc.c new file mode 100644 index 00000000..dd2f7c03 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/md5enc.c @@ -0,0 +1,110 @@ +/* + * MD5 encoder (for codec/format testing) + * Copyright (c) 2009 Reimar DÃķffinger, based on crcenc (c) 2002 Fabrice Bellard + * + * 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 + */ + +#include "libavutil/md5.h" +#include "avformat.h" + +#define PRIVSIZE 512 + +static void md5_finish(struct AVFormatContext *s, char *buf) +{ + uint8_t md5[16]; + int i, offset = strlen(buf); + av_md5_final(s->priv_data, md5); + for (i = 0; i < sizeof(md5); i++) { + snprintf(buf + offset, 3, "%02"PRIx8, md5[i]); + offset += 2; + } + buf[offset] = '\n'; + buf[offset+1] = 0; + + put_buffer(s->pb, buf, strlen(buf)); + put_flush_packet(s->pb); +} + +#if CONFIG_MD5_MUXER +static int write_header(struct AVFormatContext *s) +{ + if (PRIVSIZE < av_md5_size) { + av_log(s, AV_LOG_ERROR, "Insuffient size for md5 context\n"); + return -1; + } + av_md5_init(s->priv_data); + return 0; +} + +static int write_packet(struct AVFormatContext *s, AVPacket *pkt) +{ + av_md5_update(s->priv_data, pkt->data, pkt->size); + return 0; +} + +static int write_trailer(struct AVFormatContext *s) +{ + char buf[64] = "MD5="; + + md5_finish(s, buf); + return 0; +} + +AVOutputFormat ff_md5_muxer = { + "md5", + NULL_IF_CONFIG_SMALL("MD5 testing format"), + NULL, + "", + PRIVSIZE, + CODEC_ID_PCM_S16LE, + CODEC_ID_RAWVIDEO, + write_header, + write_packet, + write_trailer, +}; +#endif + +#if CONFIG_FRAMEMD5_MUXER +static int framemd5_write_packet(struct AVFormatContext *s, AVPacket *pkt) +{ + char buf[256]; + if (PRIVSIZE < av_md5_size) { + av_log(s, AV_LOG_ERROR, "Insuffient size for md5 context\n"); + return -1; + } + av_md5_init(s->priv_data); + av_md5_update(s->priv_data, pkt->data, pkt->size); + + snprintf(buf, sizeof(buf) - 64, "%d, %"PRId64", %d, ", pkt->stream_index, pkt->dts, pkt->size); + md5_finish(s, buf); + return 0; +} + +AVOutputFormat ff_framemd5_muxer = { + "framemd5", + NULL_IF_CONFIG_SMALL("Per-frame MD5 testing format"), + NULL, + "", + PRIVSIZE, + CODEC_ID_PCM_S16LE, + CODEC_ID_RAWVIDEO, + NULL, + framemd5_write_packet, + NULL, +}; +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/md5proto.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/md5proto.c new file mode 100644 index 00000000..c391dffe --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/md5proto.c @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#include +#include "libavutil/avstring.h" +#include "libavutil/md5.h" +#include "libavutil/mem.h" +#include "libavutil/error.h" +#include "avformat.h" +#include "avio.h" + +#define PRIV_SIZE 128 + +static int md5_open(URLContext *h, const char *filename, int flags) +{ + if (PRIV_SIZE < av_md5_size) { + av_log(NULL, AV_LOG_ERROR, "Insuffient size for MD5 context\n"); + return -1; + } + + if (flags != URL_WRONLY) + return AVERROR(EINVAL); + + av_md5_init(h->priv_data); + + return 0; +} + +static int md5_write(URLContext *h, const unsigned char *buf, int size) +{ + av_md5_update(h->priv_data, buf, size); + return size; +} + +static int md5_close(URLContext *h) +{ + const char *filename = h->filename; + uint8_t md5[16], buf[64]; + URLContext *out; + int i, err = 0; + + av_md5_final(h->priv_data, md5); + for (i = 0; i < sizeof(md5); i++) + snprintf(buf + i*2, 3, "%02x", md5[i]); + buf[i*2] = '\n'; + + av_strstart(filename, "md5:", &filename); + + if (*filename) { + err = url_open(&out, filename, URL_WRONLY); + if (err) + return err; + err = url_write(out, buf, i*2+1); + url_close(out); + } else { + if (fwrite(buf, 1, i*2+1, stdout) < i*2+1) + err = AVERROR(errno); + } + + return err; +} + +static int md5_get_handle(URLContext *h) +{ + return (intptr_t)h->priv_data; +} + +URLProtocol ff_md5_protocol = { + .name = "md5", + .url_open = md5_open, + .url_write = md5_write, + .url_close = md5_close, + .url_get_file_handle = md5_get_handle, + .priv_data_size = PRIV_SIZE, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mms.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mms.c new file mode 100644 index 00000000..b541208e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mms.c @@ -0,0 +1,153 @@ +/* + * MMS protocol common definitions. + * Copyright (c) 2006,2007 Ryan Martell + * Copyright (c) 2007 Björn Axelsson + * Copyright (c) 2010 Zhentan Feng + * + * 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 + */ +#include "mms.h" +#include "asf.h" +#include "libavutil/intreadwrite.h" + +#if FF_API_MAX_STREAMS +#define MMS_MAX_STREAMS MAX_STREAMS +#else +#define MMS_MAX_STREAMS 256 /**< arbitrary sanity check value */ +#endif + +int ff_mms_read_header(MMSContext *mms, uint8_t *buf, const int size) +{ + char *pos; + int size_to_copy; + int remaining_size = mms->asf_header_size - mms->asf_header_read_size; + size_to_copy = FFMIN(size, remaining_size); + pos = mms->asf_header + mms->asf_header_read_size; + memcpy(buf, pos, size_to_copy); + if (mms->asf_header_read_size == mms->asf_header_size) { + av_freep(&mms->asf_header); // which contains asf header + } + mms->asf_header_read_size += size_to_copy; + return size_to_copy; +} + +int ff_mms_read_data(MMSContext *mms, uint8_t *buf, const int size) +{ + int read_size; + read_size = FFMIN(size, mms->remaining_in_len); + memcpy(buf, mms->read_in_ptr, read_size); + mms->remaining_in_len -= read_size; + mms->read_in_ptr += read_size; + return read_size; +} + +int ff_mms_asf_header_parser(MMSContext *mms) +{ + uint8_t *p = mms->asf_header; + uint8_t *end; + int flags, stream_id; + mms->stream_num = 0; + + if (mms->asf_header_size < sizeof(ff_asf_guid) * 2 + 22 || + memcmp(p, ff_asf_header, sizeof(ff_asf_guid))) { + av_log(NULL, AV_LOG_ERROR, + "Corrupt stream (invalid ASF header, size=%d)\n", + mms->asf_header_size); + return AVERROR_INVALIDDATA; + } + + end = mms->asf_header + mms->asf_header_size; + + p += sizeof(ff_asf_guid) + 14; + while(end - p >= sizeof(ff_asf_guid) + 8) { + uint64_t chunksize; + if (!memcmp(p, ff_asf_data_header, sizeof(ff_asf_guid))) { + chunksize = 50; // see Reference [2] section 5.1 + } else { + chunksize = AV_RL64(p + sizeof(ff_asf_guid)); + } + if (!chunksize || chunksize > end - p) { + av_log(NULL, AV_LOG_ERROR, + "Corrupt stream (header chunksize %"PRId64" is invalid)\n", + chunksize); + return AVERROR_INVALIDDATA; + } + if (!memcmp(p, ff_asf_file_header, sizeof(ff_asf_guid))) { + /* read packet size */ + if (end - p > sizeof(ff_asf_guid) * 2 + 68) { + mms->asf_packet_len = AV_RL32(p + sizeof(ff_asf_guid) * 2 + 64); + if (mms->asf_packet_len <= 0 || mms->asf_packet_len > sizeof(mms->in_buffer)) { + av_log(NULL, AV_LOG_ERROR, + "Corrupt stream (too large pkt_len %d)\n", + mms->asf_packet_len); + return AVERROR_INVALIDDATA; + } + } + } else if (!memcmp(p, ff_asf_stream_header, sizeof(ff_asf_guid))) { + flags = AV_RL16(p + sizeof(ff_asf_guid)*3 + 24); + stream_id = flags & 0x7F; + //The second condition is for checking CS_PKT_STREAM_ID_REQUEST packet size, + //we can calcuate the packet size by stream_num. + //Please see function send_stream_selection_request(). + if (mms->stream_num < MMS_MAX_STREAMS && + 46 + mms->stream_num * 6 < sizeof(mms->out_buffer)) { + mms->streams = av_fast_realloc(mms->streams, + &mms->nb_streams_allocated, + (mms->stream_num + 1) * sizeof(MMSStream)); + mms->streams[mms->stream_num].id = stream_id; + mms->stream_num++; + } else { + av_log(NULL, AV_LOG_ERROR, + "Corrupt stream (too many A/V streams)\n"); + return AVERROR_INVALIDDATA; + } + } else if (!memcmp(p, ff_asf_ext_stream_header, sizeof(ff_asf_guid))) { + if (end - p >= 88) { + int stream_count = AV_RL16(p + 84), ext_len_count = AV_RL16(p + 86); + uint64_t skip_bytes = 88; + while (stream_count--) { + if (end - p < skip_bytes + 4) { + av_log(NULL, AV_LOG_ERROR, + "Corrupt stream (next stream name length is not in the buffer)\n"); + return AVERROR_INVALIDDATA; + } + skip_bytes += 4 + AV_RL16(p + skip_bytes + 2); + } + while (ext_len_count--) { + if (end - p < skip_bytes + 22) { + av_log(NULL, AV_LOG_ERROR, + "Corrupt stream (next extension system info length is not in the buffer)\n"); + return AVERROR_INVALIDDATA; + } + skip_bytes += 22 + AV_RL32(p + skip_bytes + 18); + } + if (end - p < skip_bytes) { + av_log(NULL, AV_LOG_ERROR, + "Corrupt stream (the last extension system info length is invalid)\n"); + return AVERROR_INVALIDDATA; + } + if (chunksize - skip_bytes > 24) + chunksize = skip_bytes; + } + } else if (!memcmp(p, ff_asf_head1_guid, sizeof(ff_asf_guid))) { + chunksize = 46; // see references [2] section 3.4. This should be set 46. + } + p += chunksize; + } + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mms.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mms.h new file mode 100644 index 00000000..31d71b4e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mms.h @@ -0,0 +1,63 @@ +/* + * MMS protocol common definitions. + * Copyright (c) 2010 Zhentan Feng + * + * 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 + */ +#ifndef AVFORMAT_MMS_H +#define AVFORMAT_MMS_H + +#include "avformat.h" + +typedef struct { + int id; +}MMSStream; + +typedef struct { + URLContext *mms_hd; ///< TCP connection handle + MMSStream *streams; + + /** Buffer for outgoing packets. */ + /*@{*/ + uint8_t *write_out_ptr; ///< Pointer for writting the buffer. + uint8_t out_buffer[512]; ///< Buffer for outgoing packet. + /*@}*/ + + /** Buffer for incoming packets. */ + /*@{*/ + uint8_t in_buffer[65536]; ///< Buffer for incoming packets. + uint8_t *read_in_ptr; ///< Pointer for reading from incoming buffer. + int remaining_in_len; ///< Reading length from incoming buffer. + /*@}*/ + + /** Internal handling of the ASF header */ + /*@{*/ + uint8_t *asf_header; ///< Stored ASF header. + int asf_header_size; ///< Size of stored ASF header. + int header_parsed; ///< The header has been received and parsed. + int asf_packet_len; + int asf_header_read_size; + /*@}*/ + + int stream_num; ///< stream numbers. + unsigned int nb_streams_allocated; ///< allocated size of streams +} MMSContext; + +int ff_mms_asf_header_parser(MMSContext * mms); +int ff_mms_read_data(MMSContext *mms, uint8_t *buf, const int size); +int ff_mms_read_header(MMSContext * mms, uint8_t * buf, const int size); +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mmsh.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mmsh.c new file mode 100644 index 00000000..257b9732 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mmsh.c @@ -0,0 +1,369 @@ +/* + * MMS protocol over HTTP + * Copyright (c) 2010 Zhentan Feng + * + * 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 + */ + +/* + * Reference + * Windows Media HTTP Streaming Protocol. + * http://msdn.microsoft.com/en-us/library/cc251059(PROT.10).aspx + */ + +#include +#include "libavutil/intreadwrite.h" +#include "libavutil/avstring.h" +#include "libavformat/internal.h" +#include "mms.h" +#include "asf.h" +#include "http.h" + +#define CHUNK_HEADER_LENGTH 4 // 2bytes chunk type and 2bytes chunk length. +#define EXT_HEADER_LENGTH 8 // 4bytes sequence, 2bytes useless and 2bytes chunk length. + +// see Ref 2.2.1.8 +#define USERAGENT "User-Agent: NSPlayer/4.1.0.3856\r\n" +// see Ref 2.2.1.4.33 +// the guid value can be changed to any valid value. +#define CLIENTGUID "Pragma: xClientGUID={c77e7400-738a-11d2-9add-0020af0a3278}\r\n" + +// see Ref 2.2.3 for packet type define: +// chunk type contains 2 fields: Frame and PacketID. +// Frame is 0x24 or 0xA4(rarely), different PacketID indicates different packet type. +typedef enum { + CHUNK_TYPE_DATA = 0x4424, + CHUNK_TYPE_ASF_HEADER = 0x4824, + CHUNK_TYPE_END = 0x4524, + CHUNK_TYPE_STREAM_CHANGE = 0x4324, +} ChunkType; + +typedef struct { + MMSContext mms; + int request_seq; ///< request packet sequence + int chunk_seq; ///< data packet sequence +} MMSHContext; + +static int mmsh_close(URLContext *h) +{ + MMSHContext *mmsh = (MMSHContext *)h->priv_data; + MMSContext *mms = &mmsh->mms; + if (mms->mms_hd) + url_close(mms->mms_hd); + av_free(mms->streams); + av_free(mms->asf_header); + av_freep(&h->priv_data); + return 0; +} + +static ChunkType get_chunk_header(MMSHContext *mmsh, int *len) +{ + MMSContext *mms = &mmsh->mms; + uint8_t chunk_header[CHUNK_HEADER_LENGTH]; + uint8_t ext_header[EXT_HEADER_LENGTH]; + ChunkType chunk_type; + int chunk_len, res, ext_header_len; + + res = url_read_complete(mms->mms_hd, chunk_header, CHUNK_HEADER_LENGTH); + if (res != CHUNK_HEADER_LENGTH) { + av_log(NULL, AV_LOG_ERROR, "Read data packet header failed!\n"); + return AVERROR(EIO); + } + chunk_type = AV_RL16(chunk_header); + chunk_len = AV_RL16(chunk_header + 2); + + switch (chunk_type) { + case CHUNK_TYPE_END: + case CHUNK_TYPE_STREAM_CHANGE: + ext_header_len = 4; + break; + case CHUNK_TYPE_ASF_HEADER: + case CHUNK_TYPE_DATA: + ext_header_len = 8; + break; + default: + av_log(NULL, AV_LOG_ERROR, "Strange chunk type %d\n", chunk_type); + return AVERROR_INVALIDDATA; + } + + res = url_read_complete(mms->mms_hd, ext_header, ext_header_len); + if (res != ext_header_len) { + av_log(NULL, AV_LOG_ERROR, "Read ext header failed!\n"); + return AVERROR(EIO); + } + *len = chunk_len - ext_header_len; + if (chunk_type == CHUNK_TYPE_END || chunk_type == CHUNK_TYPE_DATA) + mmsh->chunk_seq = AV_RL32(ext_header); + return chunk_type; +} + +static int read_data_packet(MMSHContext *mmsh, const int len) +{ + MMSContext *mms = &mmsh->mms; + int res; + if (len > sizeof(mms->in_buffer)) { + av_log(NULL, AV_LOG_ERROR, + "Data packet length %d exceeds the in_buffer size %zu\n", + len, sizeof(mms->in_buffer)); + return AVERROR(EIO); + } + res = url_read_complete(mms->mms_hd, mms->in_buffer, len); + av_dlog(NULL, "Data packet len = %d\n", len); + if (res != len) { + av_log(NULL, AV_LOG_ERROR, "Read data packet failed!\n"); + return AVERROR(EIO); + } + if (len > mms->asf_packet_len) { + av_log(NULL, AV_LOG_ERROR, + "Chunk length %d exceed packet length %d\n",len, mms->asf_packet_len); + return AVERROR_INVALIDDATA; + } else { + memset(mms->in_buffer + len, 0, mms->asf_packet_len - len); // padding + } + mms->read_in_ptr = mms->in_buffer; + mms->remaining_in_len = mms->asf_packet_len; + return 0; +} + +static int get_http_header_data(MMSHContext *mmsh) +{ + MMSContext *mms = &mmsh->mms; + int res, len; + ChunkType chunk_type; + + for (;;) { + len = 0; + res = chunk_type = get_chunk_header(mmsh, &len); + if (res < 0) { + return res; + } else if (chunk_type == CHUNK_TYPE_ASF_HEADER){ + // get asf header and stored it + if (!mms->header_parsed) { + if (mms->asf_header) { + if (len != mms->asf_header_size) { + mms->asf_header_size = len; + av_dlog(NULL, "Header len changed from %d to %d\n", + mms->asf_header_size, len); + av_freep(&mms->asf_header); + } + } + mms->asf_header = av_mallocz(len); + if (!mms->asf_header) { + return AVERROR(ENOMEM); + } + mms->asf_header_size = len; + } + if (len > mms->asf_header_size) { + av_log(NULL, AV_LOG_ERROR, + "Asf header packet len = %d exceed the asf header buf size %d\n", + len, mms->asf_header_size); + return AVERROR(EIO); + } + res = url_read_complete(mms->mms_hd, mms->asf_header, len); + if (res != len) { + av_log(NULL, AV_LOG_ERROR, + "Recv asf header data len %d != expected len %d\n", res, len); + return AVERROR(EIO); + } + mms->asf_header_size = len; + if (!mms->header_parsed) { + res = ff_mms_asf_header_parser(mms); + mms->header_parsed = 1; + return res; + } + } else if (chunk_type == CHUNK_TYPE_DATA) { + // read data packet and do padding + return read_data_packet(mmsh, len); + } else { + if (len) { + if (len > sizeof(mms->in_buffer)) { + av_log(NULL, AV_LOG_ERROR, + "Other packet len = %d exceed the in_buffer size %zu\n", + len, sizeof(mms->in_buffer)); + return AVERROR(EIO); + } + res = url_read_complete(mms->mms_hd, mms->in_buffer, len); + if (res != len) { + av_log(NULL, AV_LOG_ERROR, "Read other chunk type data failed!\n"); + return AVERROR(EIO); + } else { + av_dlog(NULL, "Skip chunk type %d \n", chunk_type); + continue; + } + } + } + } + return 0; +} + +static int mmsh_open(URLContext *h, const char *uri, int flags) +{ + int i, port, err; + char httpname[256], path[256], host[128], location[1024]; + char *stream_selection = NULL; + char headers[1024]; + MMSHContext *mmsh; + MMSContext *mms; + + mmsh = h->priv_data = av_mallocz(sizeof(MMSHContext)); + if (!h->priv_data) + return AVERROR(ENOMEM); + mmsh->request_seq = h->is_streamed = 1; + mms = &mmsh->mms; + av_strlcpy(location, uri, sizeof(location)); + + av_url_split(NULL, 0, NULL, 0, + host, sizeof(host), &port, path, sizeof(path), location); + if (port<0) + port = 80; // default mmsh protocol port + ff_url_join(httpname, sizeof(httpname), "http", NULL, host, port, path); + + if (url_alloc(&mms->mms_hd, httpname, URL_RDONLY) < 0) { + return AVERROR(EIO); + } + + snprintf(headers, sizeof(headers), + "Accept: */*\r\n" + USERAGENT + "Host: %s:%d\r\n" + "Pragma: no-cache,rate=1.000000,stream-time=0," + "stream-offset=0:0,request-context=%u,max-duration=0\r\n" + CLIENTGUID + "Connection: Close\r\n\r\n", + host, port, mmsh->request_seq++); + ff_http_set_headers(mms->mms_hd, headers); + + err = url_connect(mms->mms_hd); + if (err) { + goto fail; + } + err = get_http_header_data(mmsh); + if (err) { + av_log(NULL, AV_LOG_ERROR, "Get http header data failed!\n"); + goto fail; + } + + // close the socket and then reopen it for sending the second play request. + url_close(mms->mms_hd); + memset(headers, 0, sizeof(headers)); + if (url_alloc(&mms->mms_hd, httpname, URL_RDONLY) < 0) { + return AVERROR(EIO); + } + stream_selection = av_mallocz(mms->stream_num * 19 + 1); + if (!stream_selection) + return AVERROR(ENOMEM); + for (i = 0; i < mms->stream_num; i++) { + char tmp[20]; + err = snprintf(tmp, sizeof(tmp), "ffff:%d:0 ", mms->streams[i].id); + if (err < 0) + goto fail; + av_strlcat(stream_selection, tmp, mms->stream_num * 19 + 1); + } + // send play request + err = snprintf(headers, sizeof(headers), + "Accept: */*\r\n" + USERAGENT + "Host: %s:%d\r\n" + "Pragma: no-cache,rate=1.000000,request-context=%u\r\n" + "Pragma: xPlayStrm=1\r\n" + CLIENTGUID + "Pragma: stream-switch-count=%d\r\n" + "Pragma: stream-switch-entry=%s\r\n" + "Connection: Close\r\n\r\n", + host, port, mmsh->request_seq++, mms->stream_num, stream_selection); + av_freep(&stream_selection); + if (err < 0) { + av_log(NULL, AV_LOG_ERROR, "Build play request failed!\n"); + goto fail; + } + av_dlog(NULL, "out_buffer is %s", headers); + ff_http_set_headers(mms->mms_hd, headers); + + err = url_connect(mms->mms_hd); + if (err) { + goto fail; + } + + err = get_http_header_data(mmsh); + if (err) { + av_log(NULL, AV_LOG_ERROR, "Get http header data failed!\n"); + goto fail; + } + + av_dlog(NULL, "Connection successfully open\n"); + return 0; +fail: + av_freep(&stream_selection); + mmsh_close(h); + av_dlog(NULL, "Connection failed with error %d\n", err); + return err; +} + +static int handle_chunk_type(MMSHContext *mmsh) +{ + MMSContext *mms = &mmsh->mms; + int res, len = 0; + ChunkType chunk_type; + chunk_type = get_chunk_header(mmsh, &len); + + switch (chunk_type) { + case CHUNK_TYPE_END: + mmsh->chunk_seq = 0; + av_log(NULL, AV_LOG_ERROR, "Stream ended!\n"); + return AVERROR(EIO); + case CHUNK_TYPE_STREAM_CHANGE: + mms->header_parsed = 0; + if (res = get_http_header_data(mmsh)) { + av_log(NULL, AV_LOG_ERROR,"Stream changed! Failed to get new header!\n"); + return res; + } + break; + case CHUNK_TYPE_DATA: + return read_data_packet(mmsh, len); + default: + av_log(NULL, AV_LOG_ERROR, "Recv other type packet %d\n", chunk_type); + return AVERROR_INVALIDDATA; + } + return 0; +} + +static int mmsh_read(URLContext *h, uint8_t *buf, int size) +{ + int res = 0; + MMSHContext *mmsh = h->priv_data; + MMSContext *mms = &mmsh->mms; + do { + if (mms->asf_header_read_size < mms->asf_header_size) { + // copy asf header into buffer + res = ff_mms_read_header(mms, buf, size); + } else { + if (!mms->remaining_in_len && (res = handle_chunk_type(mmsh))) + return res; + res = ff_mms_read_data(mms, buf, size); + } + } while (!res); + return res; +} + +URLProtocol ff_mmsh_protocol = { + .name = "mmsh", + .url_open = mmsh_open, + .url_read = mmsh_read, + .url_write = NULL, + .url_seek = NULL, + .url_close = mmsh_close, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mmst.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mmst.c new file mode 100644 index 00000000..8464d3b3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mmst.c @@ -0,0 +1,631 @@ +/* + * MMS protocol over TCP + * Copyright (c) 2006,2007 Ryan Martell + * Copyright (c) 2007 Björn Axelsson + * Copyright (c) 2010 Zhentan Feng + * + * 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 + */ + +/* References + * MMS protocol specification: + * [1]http://msdn.microsoft.com/en-us/library/cc234711(PROT.10).aspx + * ASF specification. Revision 01.20.03. + * [2]http://msdn.microsoft.com/en-us/library/bb643323.aspx + */ + +#include "avformat.h" +#include "mms.h" +#include "internal.h" +#include "libavutil/intreadwrite.h" +#include "libavcodec/bytestream.h" +#include "network.h" + +#define LOCAL_ADDRESS 0xc0a80081 // FIXME get and use correct local ip address. +#define LOCAL_PORT 1037 // as above. +/** Client to server packet types. */ +typedef enum { + CS_PKT_INITIAL = 0x01, + CS_PKT_PROTOCOL_SELECT = 0x02, + CS_PKT_MEDIA_FILE_REQUEST = 0x05, + CS_PKT_START_FROM_PKT_ID = 0x07, + CS_PKT_STREAM_PAUSE = 0x09, + CS_PKT_STREAM_CLOSE = 0x0d, + CS_PKT_MEDIA_HEADER_REQUEST = 0x15, + CS_PKT_TIMING_DATA_REQUEST = 0x18, + CS_PKT_USER_PASSWORD = 0x1a, + CS_PKT_KEEPALIVE = 0x1b, + CS_PKT_STREAM_ID_REQUEST = 0x33, +} MMSCSPacketType; + +/** Server to client packet types. */ +typedef enum { + /** Control packets. */ + /*@{*/ + SC_PKT_CLIENT_ACCEPTED = 0x01, + SC_PKT_PROTOCOL_ACCEPTED = 0x02, + SC_PKT_PROTOCOL_FAILED = 0x03, + SC_PKT_MEDIA_PKT_FOLLOWS = 0x05, + SC_PKT_MEDIA_FILE_DETAILS = 0x06, + SC_PKT_HEADER_REQUEST_ACCEPTED = 0x11, + SC_PKT_TIMING_TEST_REPLY = 0x15, + SC_PKT_PASSWORD_REQUIRED = 0x1a, + SC_PKT_KEEPALIVE = 0x1b, + SC_PKT_STREAM_STOPPED = 0x1e, + SC_PKT_STREAM_CHANGING = 0x20, + SC_PKT_STREAM_ID_ACCEPTED = 0x21, + /*@}*/ + + /** Pseudo packets. */ + /*@{*/ + SC_PKT_CANCEL = -1, + SC_PKT_NO_DATA = -2, + /*@}*/ + + /** Data packets. */ + /*@{*/ + SC_PKT_ASF_HEADER = 0x010000,// make it bigger than 0xFF in case of + SC_PKT_ASF_MEDIA = 0x010001,// receiving false data packets. + /*@}*/ +} MMSSCPacketType; + +typedef struct { + MMSContext mms; + int outgoing_packet_seq; ///< Outgoing packet sequence number. + char path[256]; ///< Path of the resource being asked for. + char host[128]; ///< Host of the resources. + int incoming_packet_seq; ///< Incoming packet sequence number. + int incoming_flags; ///< Incoming packet flags. + int packet_id; ///< Identifier for packets in the current stream. + unsigned int header_packet_id; ///< default is 2. +} MMSTContext; + +/** Create MMST command packet header */ +static void start_command_packet(MMSTContext *mmst, MMSCSPacketType packet_type) +{ + MMSContext *mms = &mmst->mms; + mms->write_out_ptr = mms->out_buffer; + + bytestream_put_le32(&mms->write_out_ptr, 1); // start sequence + bytestream_put_le32(&mms->write_out_ptr, 0xb00bface); + bytestream_put_le32(&mms->write_out_ptr, 0); // Length starts from after the protocol type bytes + bytestream_put_le32(&mms->write_out_ptr, MKTAG('M','M','S',' ')); + bytestream_put_le32(&mms->write_out_ptr, 0); + bytestream_put_le32(&mms->write_out_ptr, mmst->outgoing_packet_seq++); + bytestream_put_le64(&mms->write_out_ptr, 0); // timestamp + bytestream_put_le32(&mms->write_out_ptr, 0); + bytestream_put_le16(&mms->write_out_ptr, packet_type); + bytestream_put_le16(&mms->write_out_ptr, 3); // direction to server +} + +/** Add prefixes to MMST command packet. */ +static void insert_command_prefixes(MMSContext *mms, + uint32_t prefix1, uint32_t prefix2) +{ + bytestream_put_le32(&mms->write_out_ptr, prefix1); // first prefix + bytestream_put_le32(&mms->write_out_ptr, prefix2); // second prefix +} + +/** Send a prepared MMST command packet. */ +static int send_command_packet(MMSTContext *mmst) +{ + MMSContext *mms = &mmst->mms; + int len= mms->write_out_ptr - mms->out_buffer; + int exact_length = FFALIGN(len, 8); + int first_length= exact_length - 16; + int len8= first_length/8; + int write_result; + + // update packet length fields. + AV_WL32(mms->out_buffer + 8, first_length); + AV_WL32(mms->out_buffer + 16, len8); + AV_WL32(mms->out_buffer + 32, len8-2); + memset(mms->write_out_ptr, 0, exact_length - len); + + // write it out. + write_result= url_write(mms->mms_hd, mms->out_buffer, exact_length); + if(write_result != exact_length) { + av_log(NULL, AV_LOG_ERROR, + "Failed to write data of length %d: %d (%s)\n", + exact_length, write_result, + write_result < 0 ? strerror(write_result) : + "The server closed the connection"); + return AVERROR_IO; + } + + return 0; +} + +static void mms_put_utf16(MMSContext *mms, uint8_t *src) +{ + ByteIOContext bic; + int size = mms->write_out_ptr - mms->out_buffer; + int len; + init_put_byte(&bic, mms->write_out_ptr, + sizeof(mms->out_buffer) - size, 1, NULL, NULL, NULL, NULL); + + len = avio_put_str16le(&bic, src); + mms->write_out_ptr += len; +} + +static int send_time_test_data(MMSTContext *mmst) +{ + start_command_packet(mmst, CS_PKT_TIMING_DATA_REQUEST); + insert_command_prefixes(&mmst->mms, 0x00f0f0f0, 0x0004000b); + return send_command_packet(mmst); +} + +static int send_protocol_select(MMSTContext *mmst) +{ + char data_string[256]; + MMSContext *mms = &mmst->mms; + + start_command_packet(mmst, CS_PKT_PROTOCOL_SELECT); + insert_command_prefixes(mms, 0, 0xffffffff); + bytestream_put_le32(&mms->write_out_ptr, 0); // maxFunnelBytes + bytestream_put_le32(&mms->write_out_ptr, 0x00989680); // maxbitRate + bytestream_put_le32(&mms->write_out_ptr, 2); // funnelMode + snprintf(data_string, sizeof(data_string), "\\\\%d.%d.%d.%d\\%s\\%d", + (LOCAL_ADDRESS>>24)&0xff, + (LOCAL_ADDRESS>>16)&0xff, + (LOCAL_ADDRESS>>8)&0xff, + LOCAL_ADDRESS&0xff, + "TCP", // or UDP + LOCAL_PORT); + + mms_put_utf16(mms, data_string); + return send_command_packet(mmst); +} + +static int send_media_file_request(MMSTContext *mmst) +{ + MMSContext *mms = &mmst->mms; + start_command_packet(mmst, CS_PKT_MEDIA_FILE_REQUEST); + insert_command_prefixes(mms, 1, 0xffffffff); + bytestream_put_le32(&mms->write_out_ptr, 0); + bytestream_put_le32(&mms->write_out_ptr, 0); + mms_put_utf16(mms, mmst->path + 1); // +1 for skip "/" + + return send_command_packet(mmst); +} + +static void handle_packet_stream_changing_type(MMSTContext *mmst) +{ + MMSContext *mms = &mmst->mms; + av_dlog(NULL, "Stream changing!\n"); + + // 40 is the packet header size, 7 is the prefix size. + mmst->header_packet_id= AV_RL32(mms->in_buffer + 40 + 7); + av_dlog(NULL, "Changed header prefix to 0x%x", mmst->header_packet_id); +} + +static int send_keepalive_packet(MMSTContext *mmst) +{ + // respond to a keepalive with a keepalive... + start_command_packet(mmst, CS_PKT_KEEPALIVE); + insert_command_prefixes(&mmst->mms, 1, 0x100FFFF); + return send_command_packet(mmst); +} + +/** Pad media packets smaller than max_packet_size and/or adjust read position + * after a seek. */ +static void pad_media_packet(MMSContext *mms) +{ + if(mms->remaining_in_lenasf_packet_len) { + int padding_size = mms->asf_packet_len - mms->remaining_in_len; + memset(mms->in_buffer + mms->remaining_in_len, 0, padding_size); + mms->remaining_in_len += padding_size; + } +} + +/** Read incoming MMST media, header or command packet. */ +static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst) +{ + int read_result; + MMSSCPacketType packet_type= -1; + MMSContext *mms = &mmst->mms; + for(;;) { + read_result = url_read_complete(mms->mms_hd, mms->in_buffer, 8); + if (read_result != 8) { + if(read_result < 0) { + av_log(NULL, AV_LOG_ERROR, + "Error reading packet header: %d (%s)\n", + read_result, strerror(read_result)); + packet_type = SC_PKT_CANCEL; + } else { + av_log(NULL, AV_LOG_ERROR, + "The server closed the connection\n"); + packet_type = SC_PKT_NO_DATA; + } + return packet_type; + } + + // handle command packet. + if(AV_RL32(mms->in_buffer + 4)==0xb00bface) { + int length_remaining, hr; + + mmst->incoming_flags= mms->in_buffer[3]; + read_result= url_read_complete(mms->mms_hd, mms->in_buffer+8, 4); + if(read_result != 4) { + av_log(NULL, AV_LOG_ERROR, + "Reading command packet length failed: %d (%s)\n", + read_result, + read_result < 0 ? strerror(read_result) : + "The server closed the connection"); + return read_result < 0 ? read_result : AVERROR_IO; + } + + length_remaining= AV_RL32(mms->in_buffer+8) + 4; + av_dlog(NULL, "Length remaining is %d\n", length_remaining); + // read the rest of the packet. + if (length_remaining < 0 + || length_remaining > sizeof(mms->in_buffer) - 12) { + av_log(NULL, AV_LOG_ERROR, + "Incoming packet length %d exceeds bufsize %zu\n", + length_remaining, sizeof(mms->in_buffer) - 12); + return AVERROR_INVALIDDATA; + } + read_result = url_read_complete(mms->mms_hd, mms->in_buffer + 12, + length_remaining) ; + if (read_result != length_remaining) { + av_log(NULL, AV_LOG_ERROR, + "Reading pkt data (length=%d) failed: %d (%s)\n", + length_remaining, read_result, + read_result < 0 ? strerror(read_result) : + "The server closed the connection"); + return read_result < 0 ? read_result : AVERROR_IO; + } + packet_type= AV_RL16(mms->in_buffer+36); + hr = AV_RL32(mms->in_buffer + 40); + if (hr) { + av_log(NULL, AV_LOG_ERROR, + "Server sent an error status code: 0x%08x\n", hr); + return AVERROR_UNKNOWN; + } + } else { + int length_remaining; + int packet_id_type; + int tmp; + + // note we cache the first 8 bytes, + // then fill up the buffer with the others + tmp = AV_RL16(mms->in_buffer + 6); + length_remaining = (tmp - 8) & 0xffff; + mmst->incoming_packet_seq = AV_RL32(mms->in_buffer); + packet_id_type = mms->in_buffer[4]; + mmst->incoming_flags = mms->in_buffer[5]; + + if (length_remaining < 0 + || length_remaining > sizeof(mms->in_buffer) - 8) { + av_log(NULL, AV_LOG_ERROR, + "Data length %d is invalid or too large (max=%zu)\n", + length_remaining, sizeof(mms->in_buffer)); + return AVERROR_INVALIDDATA; + } + mms->remaining_in_len = length_remaining; + mms->read_in_ptr = mms->in_buffer; + read_result= url_read_complete(mms->mms_hd, mms->in_buffer, length_remaining); + if(read_result != length_remaining) { + av_log(NULL, AV_LOG_ERROR, + "Failed to read packet data of size %d: %d (%s)\n", + length_remaining, read_result, + read_result < 0 ? strerror(read_result) : + "The server closed the connection"); + return read_result < 0 ? read_result : AVERROR_IO; + } + + // if we successfully read everything. + if(packet_id_type == mmst->header_packet_id) { + packet_type = SC_PKT_ASF_HEADER; + // Store the asf header + if(!mms->header_parsed) { + void *p = av_realloc(mms->asf_header, + mms->asf_header_size + mms->remaining_in_len); + if (!p) { + av_freep(&mms->asf_header); + return AVERROR(ENOMEM); + } + mms->asf_header = p; + memcpy(mms->asf_header + mms->asf_header_size, + mms->read_in_ptr, mms->remaining_in_len); + mms->asf_header_size += mms->remaining_in_len; + } + // 0x04 means asf header is sent in multiple packets. + if (mmst->incoming_flags == 0x04) + continue; + } else if(packet_id_type == mmst->packet_id) { + packet_type = SC_PKT_ASF_MEDIA; + } else { + av_dlog(NULL, "packet id type %d is old.", packet_id_type); + continue; + } + } + + // preprocess some packet type + if(packet_type == SC_PKT_KEEPALIVE) { + send_keepalive_packet(mmst); + continue; + } else if(packet_type == SC_PKT_STREAM_CHANGING) { + handle_packet_stream_changing_type(mmst); + } else if(packet_type == SC_PKT_ASF_MEDIA) { + pad_media_packet(mms); + } + return packet_type; + } +} + +static int mms_safe_send_recv(MMSTContext *mmst, + int (*send_fun)(MMSTContext *mmst), + const MMSSCPacketType expect_type) +{ + MMSSCPacketType type; + if(send_fun) { + int ret = send_fun(mmst); + if (ret < 0) { + av_dlog(NULL, "Send Packet error before expecting recv packet %d\n", expect_type); + return ret; + } + } + + if ((type = get_tcp_server_response(mmst)) != expect_type) { + av_log(NULL, AV_LOG_ERROR, + "Corrupt stream (unexpected packet type 0x%x, expected 0x%x)\n", + type, expect_type); + return AVERROR_INVALIDDATA; + } else { + return 0; + } +} + +static int send_media_header_request(MMSTContext *mmst) +{ + MMSContext *mms = &mmst->mms; + start_command_packet(mmst, CS_PKT_MEDIA_HEADER_REQUEST); + insert_command_prefixes(mms, 1, 0); + bytestream_put_le32(&mms->write_out_ptr, 0); + bytestream_put_le32(&mms->write_out_ptr, 0x00800000); + bytestream_put_le32(&mms->write_out_ptr, 0xffffffff); + bytestream_put_le32(&mms->write_out_ptr, 0); + bytestream_put_le32(&mms->write_out_ptr, 0); + bytestream_put_le32(&mms->write_out_ptr, 0); + + // the media preroll value in milliseconds? + bytestream_put_le32(&mms->write_out_ptr, 0); + bytestream_put_le32(&mms->write_out_ptr, 0x40AC2000); + bytestream_put_le32(&mms->write_out_ptr, 2); + bytestream_put_le32(&mms->write_out_ptr, 0); + + return send_command_packet(mmst); +} + +/** Send the initial handshake. */ +static int send_startup_packet(MMSTContext *mmst) +{ + char data_string[256]; + MMSContext *mms = &mmst->mms; + // SubscriberName is defined in MS specification linked below. + // The guid value can be any valid value. + // http://download.microsoft.com/ + // download/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/%5BMS-WMSP%5D.pdf + snprintf(data_string, sizeof(data_string), + "NSPlayer/7.0.0.1956; {%s}; Host: %s", + "7E667F5D-A661-495E-A512-F55686DDA178", mmst->host); + + start_command_packet(mmst, CS_PKT_INITIAL); + insert_command_prefixes(mms, 0, 0x0004000b); + bytestream_put_le32(&mms->write_out_ptr, 0x0003001c); + mms_put_utf16(mms, data_string); + return send_command_packet(mmst); +} + +/** Send MMST stream selection command based on the AVStream->discard values. */ +static int send_stream_selection_request(MMSTContext *mmst) +{ + int i; + MMSContext *mms = &mmst->mms; + // send the streams we want back... + start_command_packet(mmst, CS_PKT_STREAM_ID_REQUEST); + bytestream_put_le32(&mms->write_out_ptr, mms->stream_num); // stream nums + for(i= 0; istream_num; i++) { + bytestream_put_le16(&mms->write_out_ptr, 0xffff); // flags + bytestream_put_le16(&mms->write_out_ptr, mms->streams[i].id); // stream id + bytestream_put_le16(&mms->write_out_ptr, 0); // selection + } + return send_command_packet(mmst); +} + +static int send_close_packet(MMSTContext *mmst) +{ + start_command_packet(mmst, CS_PKT_STREAM_CLOSE); + insert_command_prefixes(&mmst->mms, 1, 1); + + return send_command_packet(mmst); +} + +/** Close the MMSH/MMST connection */ +static int mms_close(URLContext *h) +{ + MMSTContext *mmst = (MMSTContext *)h->priv_data; + MMSContext *mms = &mmst->mms; + if(mms->mms_hd) { + send_close_packet(mmst); + url_close(mms->mms_hd); + } + + /* free all separately allocated pointers in mms */ + av_free(mms->streams); + av_free(mms->asf_header); + av_freep(&h->priv_data); + + return 0; +} + +static int send_media_packet_request(MMSTContext *mmst) +{ + MMSContext *mms = &mmst->mms; + start_command_packet(mmst, CS_PKT_START_FROM_PKT_ID); + insert_command_prefixes(mms, 1, 0x0001FFFF); + bytestream_put_le64(&mms->write_out_ptr, 0); // seek timestamp + bytestream_put_le32(&mms->write_out_ptr, 0xffffffff); // unknown + bytestream_put_le32(&mms->write_out_ptr, 0xffffffff); // packet offset + bytestream_put_byte(&mms->write_out_ptr, 0xff); // max stream time limit + bytestream_put_byte(&mms->write_out_ptr, 0xff); // max stream time limit + bytestream_put_byte(&mms->write_out_ptr, 0xff); // max stream time limit + bytestream_put_byte(&mms->write_out_ptr, 0x00); // stream time limit flag + + mmst->packet_id++; // new packet_id + bytestream_put_le32(&mms->write_out_ptr, mmst->packet_id); + return send_command_packet(mmst); +} + + +static void clear_stream_buffers(MMSContext *mms) +{ + mms->remaining_in_len = 0; + mms->read_in_ptr = mms->in_buffer; +} + +static int mms_open(URLContext *h, const char *uri, int flags) +{ + MMSTContext *mmst; + MMSContext *mms; + int port, err; + char tcpname[256]; + + h->is_streamed = 1; + mmst = h->priv_data = av_mallocz(sizeof(MMSTContext)); + if (!h->priv_data) + return AVERROR(ENOMEM); + mms = &mmst->mms; + + // only for MMS over TCP, so set proto = NULL + av_url_split(NULL, 0, NULL, 0, + mmst->host, sizeof(mmst->host), &port, mmst->path, + sizeof(mmst->path), uri); + + if(port<0) + port = 1755; // defaut mms protocol port + + // establish tcp connection. + ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, mmst->host, port, NULL); + err = url_open(&mms->mms_hd, tcpname, URL_RDWR); + if (err) + goto fail; + + mmst->packet_id = 3; // default, initial value. + mmst->header_packet_id = 2; // default, initial value. + err = mms_safe_send_recv(mmst, send_startup_packet, SC_PKT_CLIENT_ACCEPTED); + if (err) + goto fail; + err = mms_safe_send_recv(mmst, send_time_test_data, SC_PKT_TIMING_TEST_REPLY); + if (err) + goto fail; + err = mms_safe_send_recv(mmst, send_protocol_select, SC_PKT_PROTOCOL_ACCEPTED); + if (err) + goto fail; + err = mms_safe_send_recv(mmst, send_media_file_request, SC_PKT_MEDIA_FILE_DETAILS); + if (err) + goto fail; + err = mms_safe_send_recv(mmst, send_media_header_request, SC_PKT_HEADER_REQUEST_ACCEPTED); + if (err) + goto fail; + err = mms_safe_send_recv(mmst, NULL, SC_PKT_ASF_HEADER); + if (err) + goto fail; + if((mmst->incoming_flags != 0X08) && (mmst->incoming_flags != 0X0C)) { + av_log(NULL, AV_LOG_ERROR, + "The server does not support MMST (try MMSH or RTSP)\n"); + err = AVERROR_NOFMT; + goto fail; + } + err = ff_mms_asf_header_parser(mms); + if (err) { + av_dlog(NULL, "asf header parsed failed!\n"); + goto fail; + } + mms->header_parsed = 1; + + if (!mms->asf_packet_len || !mms->stream_num) + goto fail; + + clear_stream_buffers(mms); + err = mms_safe_send_recv(mmst, send_stream_selection_request, SC_PKT_STREAM_ID_ACCEPTED); + if (err) + goto fail; + // send media packet request + err = mms_safe_send_recv(mmst, send_media_packet_request, SC_PKT_MEDIA_PKT_FOLLOWS); + if (err) { + goto fail; + } + av_dlog(NULL, "Leaving open (success)\n"); + return 0; +fail: + mms_close(h); + av_dlog(NULL, "Leaving open (failure: %d)\n", err); + return err; +} + +/** Read ASF data through the protocol. */ +static int mms_read(URLContext *h, uint8_t *buf, int size) +{ + /* TODO: see tcp.c:tcp_read() about a possible timeout scheme */ + MMSTContext *mmst = h->priv_data; + MMSContext *mms = &mmst->mms; + int result = 0; + + do { + if(mms->asf_header_read_size < mms->asf_header_size) { + /* Read from ASF header buffer */ + result = ff_mms_read_header(mms, buf, size); + } else if(mms->remaining_in_len) { + /* Read remaining packet data to buffer. + * the result can not be zero because remaining_in_len is positive.*/ + result = ff_mms_read_data(mms, buf, size); + } else { + /* Read from network */ + int err = mms_safe_send_recv(mmst, NULL, SC_PKT_ASF_MEDIA); + if (err == 0) { + if(mms->remaining_in_len>mms->asf_packet_len) { + av_log(NULL, AV_LOG_ERROR, + "Incoming pktlen %d is larger than ASF pktsize %d\n", + mms->remaining_in_len, mms->asf_packet_len); + result= AVERROR_IO; + } else { + // copy the data to the packet buffer. + result = ff_mms_read_data(mms, buf, size); + if (result == 0) { + av_dlog(NULL, "read asf media paket size is zero!\n"); + break; + } + } + } else { + av_dlog(NULL, "read packet error!\n"); + break; + } + } + } while(!result); // only return one packet. + return result; +} + +URLProtocol ff_mmst_protocol = { + "mmst", + mms_open, + mms_read, + NULL, // write + NULL, // seek + mms_close, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/movenc.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/movenc.h new file mode 100644 index 00000000..182c5edc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/movenc.h @@ -0,0 +1,120 @@ +/* + * MOV, 3GP, MP4 muxer + * Copyright (c) 2003 Thomas Raivio + * Copyright (c) 2004 Gildas Bazin + * Copyright (c) 2009 Baptiste Coudurier + * + * 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 + */ + +#ifndef AVFORMAT_MOVENC_H +#define AVFORMAT_MOVENC_H + +#include "avformat.h" + +#define MOV_INDEX_CLUSTER_SIZE 16384 +#define MOV_TIMESCALE 1000 + +#define RTP_MAX_PACKET_SIZE 1450 + +#define MODE_MP4 0x01 +#define MODE_MOV 0x02 +#define MODE_3GP 0x04 +#define MODE_PSP 0x08 // example working PSP command line: +// ffmpeg -i testinput.avi -f psp -r 14.985 -s 320x240 -b 768 -ar 24000 -ab 32 M4V00001.MP4 +#define MODE_3G2 0x10 +#define MODE_IPOD 0x20 + +typedef struct MOVIentry { + unsigned int size; + uint64_t pos; + unsigned int samplesInChunk; + unsigned int entries; + int cts; + int64_t dts; +#define MOV_SYNC_SAMPLE 0x0001 +#define MOV_PARTIAL_SYNC_SAMPLE 0x0002 + uint32_t flags; +} MOVIentry; + +typedef struct HintSample { + uint8_t *data; + int size; + int sample_number; + int offset; + int own_data; +} HintSample; + +typedef struct { + int size; + int len; + HintSample *samples; +} HintSampleQueue; + +typedef struct MOVIndex { + int mode; + int entry; + unsigned timescale; + uint64_t time; + int64_t trackDuration; + long sampleCount; + long sampleSize; + int hasKeyframes; +#define MOV_TRACK_CTTS 0x0001 +#define MOV_TRACK_STPS 0x0002 + uint32_t flags; + int language; + int trackID; + int tag; ///< stsd fourcc + AVCodecContext *enc; + + int vosLen; + uint8_t *vosData; + MOVIentry *cluster; + int audio_vbr; + int height; ///< active picture (w/o VBI) height for D-10/IMX + uint32_t tref_tag; + int tref_id; ///< trackID of the referenced track + + int hint_track; ///< the track that hints this track, -1 if no hint track is set + int src_track; ///< the track that this hint track describes + AVFormatContext *rtp_ctx; ///< the format context for the hinting rtp muxer + uint32_t prev_rtp_ts; + int64_t cur_rtp_ts_unwrapped; + uint32_t max_packet_size; + + HintSampleQueue sample_queue; +} MOVTrack; + +typedef struct MOVMuxContext { + int mode; + int64_t time; + int nb_streams; + int chapter_track; ///< qt chapter track number + int64_t mdat_pos; + uint64_t mdat_size; + MOVTrack *tracks; +} MOVMuxContext; + +int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt); + +int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index); +int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt, + int track_index, int sample); +void ff_mov_close_hinting(MOVTrack *track); + +#endif /* AVFORMAT_MOVENC_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/movenchint.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/movenchint.c new file mode 100644 index 00000000..2ebe8b80 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/movenchint.c @@ -0,0 +1,496 @@ +/* + * MOV, 3GP, MP4 muxer RTP hinting + * Copyright (c) 2010 Martin Storsjo + * + * 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 + */ + +#include "movenc.h" +#include "libavutil/intreadwrite.h" +#include "internal.h" + +int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index) +{ + MOVMuxContext *mov = s->priv_data; + MOVTrack *track = &mov->tracks[index]; + MOVTrack *src_track = &mov->tracks[src_index]; + AVStream *src_st = s->streams[src_index]; + int ret = AVERROR(ENOMEM); + AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL); + + track->tag = MKTAG('r','t','p',' '); + track->src_track = src_index; + + if (!rtp_format) { + ret = AVERROR(ENOENT); + goto fail; + } + + track->enc = avcodec_alloc_context(); + if (!track->enc) + goto fail; + track->enc->codec_type = AVMEDIA_TYPE_DATA; + track->enc->codec_tag = track->tag; + + track->rtp_ctx = avformat_alloc_context(); + if (!track->rtp_ctx) + goto fail; + track->rtp_ctx->oformat = rtp_format; + if (!av_new_stream(track->rtp_ctx, 0)) + goto fail; + + /* Copy stream parameters */ + track->rtp_ctx->streams[0]->sample_aspect_ratio = + src_st->sample_aspect_ratio; + + /* Remove the allocated codec context, link to the original one + * instead, to give the rtp muxer access to codec parameters. */ + av_free(track->rtp_ctx->streams[0]->codec); + track->rtp_ctx->streams[0]->codec = src_st->codec; + + if ((ret = url_open_dyn_packet_buf(&track->rtp_ctx->pb, + RTP_MAX_PACKET_SIZE)) < 0) + goto fail; + ret = av_write_header(track->rtp_ctx); + if (ret) + goto fail; + + /* Copy the RTP AVStream timebase back to the hint AVStream */ + track->timescale = track->rtp_ctx->streams[0]->time_base.den; + + /* Mark the hinted track that packets written to it should be + * sent to this track for hinting. */ + src_track->hint_track = index; + return 0; +fail: + av_log(s, AV_LOG_WARNING, + "Unable to initialize hinting of stream %d\n", src_index); + if (track->rtp_ctx && track->rtp_ctx->pb) { + uint8_t *buf; + url_close_dyn_buf(track->rtp_ctx->pb, &buf); + av_free(buf); + } + if (track->rtp_ctx && track->rtp_ctx->streams[0]) { + av_metadata_free(&track->rtp_ctx->streams[0]->metadata); + av_free(track->rtp_ctx->streams[0]); + } + if (track->rtp_ctx) { + av_metadata_free(&track->rtp_ctx->metadata); + av_free(track->rtp_ctx->priv_data); + av_freep(&track->rtp_ctx); + } + av_freep(&track->enc); + /* Set a default timescale, to avoid crashes in dump_format */ + track->timescale = 90000; + return ret; +} + +/** + * Remove the first sample from the sample queue. + */ +static void sample_queue_pop(HintSampleQueue *queue) +{ + if (queue->len <= 0) + return; + if (queue->samples[0].own_data) + av_free(queue->samples[0].data); + queue->len--; + memmove(queue->samples, queue->samples + 1, sizeof(HintSample)*queue->len); +} + +/** + * Empty the sample queue, releasing all memory. + */ +static void sample_queue_free(HintSampleQueue *queue) +{ + int i; + for (i = 0; i < queue->len; i++) + if (queue->samples[i].own_data) + av_free(queue->samples[i].data); + av_freep(&queue->samples); + queue->len = 0; + queue->size = 0; +} + +/** + * Add a reference to the sample data to the sample queue. The data is + * not copied. sample_queue_retain should be called before pkt->data + * is reused/freed. + */ +static void sample_queue_push(HintSampleQueue *queue, AVPacket *pkt, int sample) +{ + /* No need to keep track of smaller samples, since describing them + * with immediates is more efficient. */ + if (pkt->size <= 14) + return; + if (!queue->samples || queue->len >= queue->size) { + HintSample* samples; + queue->size += 10; + samples = av_realloc(queue->samples, sizeof(HintSample)*queue->size); + if (!samples) + return; + queue->samples = samples; + } + queue->samples[queue->len].data = pkt->data; + queue->samples[queue->len].size = pkt->size; + queue->samples[queue->len].sample_number = sample; + queue->samples[queue->len].offset = 0; + queue->samples[queue->len].own_data = 0; + queue->len++; +} + +/** + * Make local copies of all referenced sample data in the queue. + */ +static void sample_queue_retain(HintSampleQueue *queue) +{ + int i; + for (i = 0; i < queue->len; ) { + HintSample *sample = &queue->samples[i]; + if (!sample->own_data) { + uint8_t* ptr = av_malloc(sample->size); + if (!ptr) { + /* Unable to allocate memory for this one, remove it */ + memmove(queue->samples + i, queue->samples + i + 1, + sizeof(HintSample)*(queue->len - i - 1)); + queue->len--; + continue; + } + memcpy(ptr, sample->data, sample->size); + sample->data = ptr; + sample->own_data = 1; + } + i++; + } +} + +/** + * Find matches of needle[n_pos ->] within haystack. If a sufficiently + * large match is found, matching bytes before n_pos are included + * in the match, too (within the limits of the arrays). + * + * @param haystack buffer that may contain parts of needle + * @param h_len length of the haystack buffer + * @param needle buffer containing source data that have been used to + * construct haystack + * @param n_pos start position in needle used for looking for matches + * @param n_len length of the needle buffer + * @param match_h_offset_ptr offset of the first matching byte within haystack + * @param match_n_offset_ptr offset of the first matching byte within needle + * @param match_len_ptr length of the matched segment + * @return 0 if a match was found, < 0 if no match was found + */ +static int match_segments(const uint8_t *haystack, int h_len, + const uint8_t *needle, int n_pos, int n_len, + int *match_h_offset_ptr, int *match_n_offset_ptr, + int *match_len_ptr) +{ + int h_pos; + for (h_pos = 0; h_pos < h_len; h_pos++) { + int match_len = 0; + int match_h_pos, match_n_pos; + + /* Check how many bytes match at needle[n_pos] and haystack[h_pos] */ + while (h_pos + match_len < h_len && n_pos + match_len < n_len && + needle[n_pos + match_len] == haystack[h_pos + match_len]) + match_len++; + if (match_len <= 8) + continue; + + /* If a sufficiently large match was found, try to expand + * the matched segment backwards. */ + match_h_pos = h_pos; + match_n_pos = n_pos; + while (match_n_pos > 0 && match_h_pos > 0 && + needle[match_n_pos - 1] == haystack[match_h_pos - 1]) { + match_n_pos--; + match_h_pos--; + match_len++; + } + if (match_len <= 14) + continue; + *match_h_offset_ptr = match_h_pos; + *match_n_offset_ptr = match_n_pos; + *match_len_ptr = match_len; + return 0; + } + return -1; +} + +/** + * Look for segments in samples in the sample queue matching the data + * in ptr. Samples not matching are removed from the queue. If a match + * is found, the next time it will look for matches starting from the + * end of the previous matched segment. + * + * @param data data to find matches for in the sample queue + * @param len length of the data buffer + * @param queue samples used for looking for matching segments + * @param pos the offset in data of the matched segment + * @param match_sample the number of the sample that contained the match + * @param match_offset the offset of the matched segment within the sample + * @param match_len the length of the matched segment + * @return 0 if a match was found, < 0 if no match was found + */ +static int find_sample_match(const uint8_t *data, int len, + HintSampleQueue *queue, int *pos, + int *match_sample, int *match_offset, + int *match_len) +{ + while (queue->len > 0) { + HintSample *sample = &queue->samples[0]; + /* If looking for matches in a new sample, skip the first 5 bytes, + * since they often may be modified/removed in the output packet. */ + if (sample->offset == 0 && sample->size > 5) + sample->offset = 5; + + if (match_segments(data, len, sample->data, sample->offset, + sample->size, pos, match_offset, match_len) == 0) { + *match_sample = sample->sample_number; + /* Next time, look for matches at this offset, with a little + * margin to this match. */ + sample->offset = *match_offset + *match_len + 5; + if (sample->offset + 10 >= sample->size) + sample_queue_pop(queue); /* Not enough useful data left */ + return 0; + } + + if (sample->offset < 10 && sample->size > 20) { + /* No match found from the start of the sample, + * try from the middle of the sample instead. */ + sample->offset = sample->size/2; + } else { + /* No match for this sample, remove it */ + sample_queue_pop(queue); + } + } + return -1; +} + +static void output_immediate(const uint8_t *data, int size, + ByteIOContext *out, int *entries) +{ + while (size > 0) { + int len = size; + if (len > 14) + len = 14; + put_byte(out, 1); /* immediate constructor */ + put_byte(out, len); /* amount of valid data */ + put_buffer(out, data, len); + data += len; + size -= len; + + for (; len < 14; len++) + put_byte(out, 0); + + (*entries)++; + } +} + +static void output_match(ByteIOContext *out, int match_sample, + int match_offset, int match_len, int *entries) +{ + put_byte(out, 2); /* sample constructor */ + put_byte(out, 0); /* track reference */ + put_be16(out, match_len); + put_be32(out, match_sample); + put_be32(out, match_offset); + put_be16(out, 1); /* bytes per block */ + put_be16(out, 1); /* samples per block */ + (*entries)++; +} + +static void describe_payload(const uint8_t *data, int size, + ByteIOContext *out, int *entries, + HintSampleQueue *queue) +{ + /* Describe the payload using different constructors */ + while (size > 0) { + int match_sample, match_offset, match_len, pos; + if (find_sample_match(data, size, queue, &pos, &match_sample, + &match_offset, &match_len) < 0) + break; + output_immediate(data, pos, out, entries); + data += pos; + size -= pos; + output_match(out, match_sample, match_offset, match_len, entries); + data += match_len; + size -= match_len; + } + output_immediate(data, size, out, entries); +} + +/** + * Write an RTP hint (that may contain one or more RTP packets) + * for the packets in data. data contains one or more packets with a + * BE32 size header. + * + * @param out buffer where the hints are written + * @param data buffer containing RTP packets + * @param size the size of the data buffer + * @param trk the MOVTrack for the hint track + * @param pts pointer where the timestamp for the written RTP hint is stored + * @return the number of RTP packets in the written hint + */ +static int write_hint_packets(ByteIOContext *out, const uint8_t *data, + int size, MOVTrack *trk, int64_t *pts) +{ + int64_t curpos; + int64_t count_pos, entries_pos; + int count = 0, entries; + + count_pos = url_ftell(out); + /* RTPsample header */ + put_be16(out, 0); /* packet count */ + put_be16(out, 0); /* reserved */ + + while (size > 4) { + uint32_t packet_len = AV_RB32(data); + uint16_t seq; + uint32_t ts; + + data += 4; + size -= 4; + if (packet_len > size || packet_len <= 12) + break; + if (data[1] >= 200 && data[1] <= 204) { + /* RTCP packet, just skip */ + data += packet_len; + size -= packet_len; + continue; + } + + if (packet_len > trk->max_packet_size) + trk->max_packet_size = packet_len; + + seq = AV_RB16(&data[2]); + ts = AV_RB32(&data[4]); + + if (trk->prev_rtp_ts == 0) + trk->prev_rtp_ts = ts; + /* Unwrap the 32-bit RTP timestamp that wraps around often + * into a not (as often) wrapping 64-bit timestamp. */ + trk->cur_rtp_ts_unwrapped += (int32_t) (ts - trk->prev_rtp_ts); + trk->prev_rtp_ts = ts; + if (*pts == AV_NOPTS_VALUE) + *pts = trk->cur_rtp_ts_unwrapped; + + count++; + /* RTPpacket header */ + put_be32(out, 0); /* relative_time */ + put_buffer(out, data, 2); /* RTP header */ + put_be16(out, seq); /* RTPsequenceseed */ + put_be16(out, 0); /* reserved + flags */ + entries_pos = url_ftell(out); + put_be16(out, 0); /* entry count */ + + data += 12; + size -= 12; + packet_len -= 12; + + entries = 0; + /* Write one or more constructors describing the payload data */ + describe_payload(data, packet_len, out, &entries, &trk->sample_queue); + data += packet_len; + size -= packet_len; + + curpos = url_ftell(out); + url_fseek(out, entries_pos, SEEK_SET); + put_be16(out, entries); + url_fseek(out, curpos, SEEK_SET); + } + + curpos = url_ftell(out); + url_fseek(out, count_pos, SEEK_SET); + put_be16(out, count); + url_fseek(out, curpos, SEEK_SET); + return count; +} + +int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt, + int track_index, int sample) +{ + MOVMuxContext *mov = s->priv_data; + MOVTrack *trk = &mov->tracks[track_index]; + AVFormatContext *rtp_ctx = trk->rtp_ctx; + uint8_t *buf = NULL; + int size; + ByteIOContext *hintbuf = NULL; + AVPacket hint_pkt; + int ret = 0, count; + + if (!rtp_ctx) + return AVERROR(ENOENT); + if (!rtp_ctx->pb) + return AVERROR(ENOMEM); + + sample_queue_push(&trk->sample_queue, pkt, sample); + + /* Feed the packet to the RTP muxer */ + ff_write_chained(rtp_ctx, 0, pkt, s); + + /* Fetch the output from the RTP muxer, open a new output buffer + * for next time. */ + size = url_close_dyn_buf(rtp_ctx->pb, &buf); + if ((ret = url_open_dyn_packet_buf(&rtp_ctx->pb, + RTP_MAX_PACKET_SIZE)) < 0) + goto done; + + if (size <= 0) + goto done; + + /* Open a buffer for writing the hint */ + if ((ret = url_open_dyn_buf(&hintbuf)) < 0) + goto done; + av_init_packet(&hint_pkt); + count = write_hint_packets(hintbuf, buf, size, trk, &hint_pkt.dts); + av_freep(&buf); + + /* Write the hint data into the hint track */ + hint_pkt.size = size = url_close_dyn_buf(hintbuf, &buf); + hint_pkt.data = buf; + hint_pkt.pts = hint_pkt.dts; + hint_pkt.stream_index = track_index; + if (pkt->flags & AV_PKT_FLAG_KEY) + hint_pkt.flags |= AV_PKT_FLAG_KEY; + if (count > 0) + ff_mov_write_packet(s, &hint_pkt); +done: + av_free(buf); + sample_queue_retain(&trk->sample_queue); + return ret; +} + +void ff_mov_close_hinting(MOVTrack *track) { + AVFormatContext* rtp_ctx = track->rtp_ctx; + uint8_t *ptr; + + av_freep(&track->enc); + sample_queue_free(&track->sample_queue); + if (!rtp_ctx) + return; + if (rtp_ctx->pb) { + av_write_trailer(rtp_ctx); + url_close_dyn_buf(rtp_ctx->pb, &ptr); + av_free(ptr); + } + av_metadata_free(&rtp_ctx->streams[0]->metadata); + av_metadata_free(&rtp_ctx->metadata); + av_free(rtp_ctx->streams[0]); + av_freep(&rtp_ctx); +} + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mp3dec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mp3dec.c new file mode 100644 index 00000000..5bc4ce64 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mp3dec.c @@ -0,0 +1,197 @@ +/* + * MP3 demuxer + * Copyright (c) 2003 Fabrice Bellard + * + * 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 + */ + +#include "libavutil/avstring.h" +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "id3v2.h" +#include "id3v1.h" +#include "libavcodec/mpegaudiodecheader.h" + +/* mp3 read */ + +static int mp3_read_probe(AVProbeData *p) +{ + int max_frames, first_frames = 0; + int fsize, frames, sample_rate; + uint32_t header; + uint8_t *buf, *buf0, *buf2, *end; + AVCodecContext avctx; + + buf0 = p->buf; + end = p->buf + p->buf_size - sizeof(uint32_t); + while(buf0 < end && !*buf0) + buf0++; + + max_frames = 0; + buf = buf0; + + for(; buf < end; buf= buf2+1) { + buf2 = buf; + + for(frames = 0; buf2 < end; frames++) { + header = AV_RB32(buf2); + fsize = ff_mpa_decode_header(&avctx, header, &sample_rate, &sample_rate, &sample_rate, &sample_rate); + if(fsize < 0) + break; + buf2 += fsize; + } + max_frames = FFMAX(max_frames, frames); + if(buf == buf0) + first_frames= frames; + } + // keep this in sync with ac3 probe, both need to avoid + // issues with MPEG-files! + if (first_frames>=4) return AVPROBE_SCORE_MAX/2+1; + else if(max_frames>500)return AVPROBE_SCORE_MAX/2; + else if(max_frames>=4) return AVPROBE_SCORE_MAX/4; + else if(max_frames>=1) return 1; + else return 0; +//mpegps_mp3_unrecognized_format.mpg has max_frames=3 +} + +/** + * Try to find Xing/Info/VBRI tags and compute duration from info therein + */ +static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base) +{ + uint32_t v, spf; + unsigned frames = 0; /* Total number of frames in file */ + unsigned size = 0; /* Total number of bytes in the stream */ + const int64_t xing_offtbl[2][2] = {{32, 17}, {17,9}}; + MPADecodeHeader c; + int vbrtag_size = 0; + + v = get_be32(s->pb); + if(ff_mpa_check_header(v) < 0) + return -1; + + if (ff_mpegaudio_decode_header(&c, v) == 0) + vbrtag_size = c.frame_size; + if(c.layer != 3) + return -1; + + /* Check for Xing / Info tag */ + url_fseek(s->pb, xing_offtbl[c.lsf == 1][c.nb_channels == 1], SEEK_CUR); + v = get_be32(s->pb); + if(v == MKBETAG('X', 'i', 'n', 'g') || v == MKBETAG('I', 'n', 'f', 'o')) { + v = get_be32(s->pb); + if(v & 0x1) + frames = get_be32(s->pb); + if(v & 0x2) + size = get_be32(s->pb); + } + + /* Check for VBRI tag (always 32 bytes after end of mpegaudio header) */ + url_fseek(s->pb, base + 4 + 32, SEEK_SET); + v = get_be32(s->pb); + if(v == MKBETAG('V', 'B', 'R', 'I')) { + /* Check tag version */ + if(get_be16(s->pb) == 1) { + /* skip delay and quality */ + url_fseek(s->pb, 4, SEEK_CUR); + frames = get_be32(s->pb); + size = get_be32(s->pb); + } + } + + if(!frames && !size) + return -1; + + /* Skip the vbr tag frame */ + url_fseek(s->pb, base + vbrtag_size, SEEK_SET); + + spf = c.lsf ? 576 : 1152; /* Samples per frame, layer 3 */ + if(frames) + st->duration = av_rescale_q(frames, (AVRational){spf, c.sample_rate}, + st->time_base); + if(size && frames) + st->codec->bit_rate = av_rescale(size, 8 * c.sample_rate, frames * (int64_t)spf); + + return 0; +} + +static int mp3_read_header(AVFormatContext *s, + AVFormatParameters *ap) +{ + AVStream *st; + int64_t off; + + st = av_new_stream(s, 0); + if (!st) + return AVERROR(ENOMEM); + + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; + st->codec->codec_id = CODEC_ID_MP3; + st->need_parsing = AVSTREAM_PARSE_FULL; + st->start_time = 0; + + // lcm of all mp3 sample rates + av_set_pts_info(st, 64, 1, 14112000); + + off = url_ftell(s->pb); + + if (!av_metadata_get(s->metadata, "", NULL, AV_METADATA_IGNORE_SUFFIX)) + ff_id3v1_read(s); + + if (mp3_parse_vbr_tags(s, st, off) < 0) + url_fseek(s->pb, off, SEEK_SET); + + /* the parameters will be extracted from the compressed bitstream */ + return 0; +} + +#define MP3_PACKET_SIZE 1024 + +static int mp3_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + int ret, size; + // AVStream *st = s->streams[0]; + + size= MP3_PACKET_SIZE; + + ret= av_get_packet(s->pb, pkt, size); + + pkt->stream_index = 0; + if (ret <= 0) { + return AVERROR(EIO); + } + + if (ret > ID3v1_TAG_SIZE && + memcmp(&pkt->data[ret - ID3v1_TAG_SIZE], "TAG", 3) == 0) + ret -= ID3v1_TAG_SIZE; + + /* note: we need to modify the packet size here to handle the last + packet */ + pkt->size = ret; + return ret; +} + +AVInputFormat ff_mp3_demuxer = { + "mp3", + NULL_IF_CONFIG_SMALL("MPEG audio layer 2/3"), + 0, + mp3_read_probe, + mp3_read_header, + mp3_read_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "mp2,mp3,m2a", /* XXX: use probe */ +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mp3enc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mp3enc.c new file mode 100644 index 00000000..b2c0a7e6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mp3enc.c @@ -0,0 +1,250 @@ +/* + * MP3 muxer + * Copyright (c) 2003 Fabrice Bellard + * + * 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 + */ + +#include +#include "avformat.h" +#include "id3v1.h" +#include "id3v2.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/opt.h" + +static int id3v1_set_string(AVFormatContext *s, const char *key, + uint8_t *buf, int buf_size) +{ + AVMetadataTag *tag; + if ((tag = av_metadata_get(s->metadata, key, NULL, 0))) + strncpy(buf, tag->value, buf_size); + return !!tag; +} + +static int id3v1_create_tag(AVFormatContext *s, uint8_t *buf) +{ + AVMetadataTag *tag; + int i, count = 0; + + memset(buf, 0, ID3v1_TAG_SIZE); /* fail safe */ + buf[0] = 'T'; + buf[1] = 'A'; + buf[2] = 'G'; + count += id3v1_set_string(s, "TIT2", buf + 3, 30); //title + count += id3v1_set_string(s, "TPE1", buf + 33, 30); //author|artist + count += id3v1_set_string(s, "TALB", buf + 63, 30); //album + count += id3v1_set_string(s, "TDRL", buf + 93, 4); //date + count += id3v1_set_string(s, "comment", buf + 97, 30); + if ((tag = av_metadata_get(s->metadata, "TRCK", NULL, 0))) { //track + buf[125] = 0; + buf[126] = atoi(tag->value); + count++; + } + buf[127] = 0xFF; /* default to unknown genre */ + if ((tag = av_metadata_get(s->metadata, "TCON", NULL, 0))) { //genre + for(i = 0; i <= ID3v1_GENRE_MAX; i++) { + if (!strcasecmp(tag->value, ff_id3v1_genre_str[i])) { + buf[127] = i; + count++; + break; + } + } + } + return count; +} + +/* simple formats */ + +static void id3v2_put_size(AVFormatContext *s, int size) +{ + put_byte(s->pb, size >> 21 & 0x7f); + put_byte(s->pb, size >> 14 & 0x7f); + put_byte(s->pb, size >> 7 & 0x7f); + put_byte(s->pb, size & 0x7f); +} + +/** + * Write a text frame with one (normal frames) or two (TXXX frames) strings + * according to encoding (only UTF-8 or UTF-16+BOM supported). + * @return number of bytes written or a negative error code. + */ +static int id3v2_put_ttag(AVFormatContext *s, const char *str1, const char *str2, + uint32_t tag, enum ID3v2Encoding enc) +{ + int len; + uint8_t *pb; + int (*put)(ByteIOContext*, const char*); + ByteIOContext *dyn_buf; + if (url_open_dyn_buf(&dyn_buf) < 0) + return AVERROR(ENOMEM); + + put_byte(dyn_buf, enc); + if (enc == ID3v2_ENCODING_UTF16BOM) { + put_le16(dyn_buf, 0xFEFF); /* BOM */ + put = avio_put_str16le; + } else + put = avio_put_str; + + put(dyn_buf, str1); + if (str2) + put(dyn_buf, str2); + len = url_close_dyn_buf(dyn_buf, &pb); + + put_be32(s->pb, tag); + id3v2_put_size(s, len); + put_be16(s->pb, 0); + put_buffer(s->pb, pb, len); + + av_freep(&pb); + return len + ID3v2_HEADER_SIZE; +} + + +static int mp3_write_packet(struct AVFormatContext *s, AVPacket *pkt) +{ + put_buffer(s->pb, pkt->data, pkt->size); + put_flush_packet(s->pb); + return 0; +} + +static int mp3_write_trailer(struct AVFormatContext *s) +{ + uint8_t buf[ID3v1_TAG_SIZE]; + + /* write the id3v1 tag */ + if (id3v1_create_tag(s, buf) > 0) { + put_buffer(s->pb, buf, ID3v1_TAG_SIZE); + put_flush_packet(s->pb); + } + return 0; +} + +#if CONFIG_MP2_MUXER +AVOutputFormat ff_mp2_muxer = { + "mp2", + NULL_IF_CONFIG_SMALL("MPEG audio layer 2"), + "audio/x-mpeg", + "mp2,m2a", + 0, + CODEC_ID_MP2, + CODEC_ID_NONE, + NULL, + mp3_write_packet, + mp3_write_trailer, +}; +#endif + +#if CONFIG_MP3_MUXER +typedef struct MP3Context { + const AVClass *class; + int id3v2_version; +} MP3Context; + +static const AVOption options[] = { + { "id3v2_version", "Select ID3v2 version to write. Currently 3 and 4 are supported.", + offsetof(MP3Context, id3v2_version), FF_OPT_TYPE_INT, 4, 3, 4, AV_OPT_FLAG_ENCODING_PARAM}, + { NULL }, +}; + +static const AVClass mp3_muxer_class = { + "MP3 muxer", + av_default_item_name, + options, + LIBAVUTIL_VERSION_INT, +}; + +static int id3v2_check_write_tag(AVFormatContext *s, AVMetadataTag *t, const char table[][4], + enum ID3v2Encoding enc) +{ + uint32_t tag; + int i; + + if (t->key[0] != 'T' || strlen(t->key) != 4) + return -1; + tag = AV_RB32(t->key); + for (i = 0; *table[i]; i++) + if (tag == AV_RB32(table[i])) + return id3v2_put_ttag(s, t->value, NULL, tag, enc); + return -1; +} + +/** + * Write an ID3v2 header at beginning of stream + */ + +static int mp3_write_header(struct AVFormatContext *s) +{ + MP3Context *mp3 = s->priv_data; + AVMetadataTag *t = NULL; + int totlen = 0, enc = mp3->id3v2_version == 3 ? ID3v2_ENCODING_UTF16BOM : + ID3v2_ENCODING_UTF8; + int64_t size_pos, cur_pos; + + put_be32(s->pb, MKBETAG('I', 'D', '3', mp3->id3v2_version)); + put_byte(s->pb, 0); + put_byte(s->pb, 0); /* flags */ + + /* reserve space for size */ + size_pos = url_ftell(s->pb); + put_be32(s->pb, 0); + + ff_metadata_conv(&s->metadata, ff_id3v2_34_metadata_conv, NULL); + if (mp3->id3v2_version == 4) + ff_metadata_conv(&s->metadata, ff_id3v2_4_metadata_conv, NULL); + + while ((t = av_metadata_get(s->metadata, "", t, AV_METADATA_IGNORE_SUFFIX))) { + int ret; + + if ((ret = id3v2_check_write_tag(s, t, ff_id3v2_tags, enc)) > 0) { + totlen += ret; + continue; + } + if ((ret = id3v2_check_write_tag(s, t, mp3->id3v2_version == 3 ? + ff_id3v2_3_tags : ff_id3v2_4_tags, enc)) > 0) { + totlen += ret; + continue; + } + + /* unknown tag, write as TXXX frame */ + if ((ret = id3v2_put_ttag(s, t->key, t->value, MKBETAG('T', 'X', 'X', 'X'), enc)) < 0) + return ret; + totlen += ret; + } + + cur_pos = url_ftell(s->pb); + url_fseek(s->pb, size_pos, SEEK_SET); + id3v2_put_size(s, totlen); + url_fseek(s->pb, cur_pos, SEEK_SET); + + return 0; +} + +AVOutputFormat ff_mp3_muxer = { + "mp3", + NULL_IF_CONFIG_SMALL("MPEG audio layer 3"), + "audio/x-mpeg", + "mp3", + sizeof(MP3Context), + CODEC_ID_MP3, + CODEC_ID_NONE, + mp3_write_header, + mp3_write_packet, + mp3_write_trailer, + AVFMT_NOTIMESTAMPS, + .priv_class = &mp3_muxer_class, +}; +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpegvideodec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpegvideodec.c new file mode 100644 index 00000000..d1ba1f8c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mpegvideodec.c @@ -0,0 +1,67 @@ +/* + * RAW MPEG video demuxer + * Copyright (c) 2002-2003 Fabrice Bellard + * Copyright (c) 2006 Michael Niedermayer + * + * 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 + */ + +#include "avformat.h" +#include "rawdec.h" + +#define SEQ_START_CODE 0x000001b3 +#define GOP_START_CODE 0x000001b8 +#define PICTURE_START_CODE 0x00000100 +#define SLICE_START_CODE 0x00000101 +#define PACK_START_CODE 0x000001ba +#define VIDEO_ID 0x000001e0 +#define AUDIO_ID 0x000001c0 + +static int mpegvideo_probe(AVProbeData *p) +{ + uint32_t code= -1; + int pic=0, seq=0, slice=0, pspack=0, pes=0; + int i; + + for(i=0; ibuf_size; i++){ + code = (code<<8) + p->buf[i]; + if ((code & 0xffffff00) == 0x100) { + switch(code){ + case SEQ_START_CODE: seq++; break; + case PICTURE_START_CODE: pic++; break; + case SLICE_START_CODE: slice++; break; + case PACK_START_CODE: pspack++; break; + } + if ((code & 0x1f0) == VIDEO_ID) pes++; + else if((code & 0x1e0) == AUDIO_ID) pes++; + } + } + if(seq && seq*9<=pic*10 && pic*9<=slice*10 && !pspack && !pes) + return pic>1 ? AVPROBE_SCORE_MAX/2+1 : AVPROBE_SCORE_MAX/4; // +1 for .mpg + return 0; +} + +AVInputFormat ff_mpegvideo_demuxer = { + "mpegvideo", + NULL_IF_CONFIG_SMALL("raw MPEG video"), + 0, + mpegvideo_probe, + ff_raw_video_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .value = CODEC_ID_MPEG1VIDEO, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mxg.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mxg.c new file mode 100644 index 00000000..9be97d0d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/mxg.c @@ -0,0 +1,251 @@ +/* + * MxPEG clip file demuxer + * Copyright (c) 2010 Anatoly Nenashev + * + * 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 + */ + +#include "libavutil/intreadwrite.h" +#include "libavcodec/mjpeg.h" +#include "avformat.h" +#include "avio.h" + +#define VIDEO_STREAM_INDEX 0 +#define AUDIO_STREAM_INDEX 1 +#define DEFAULT_PACKET_SIZE 1024 +#define OVERREAD_SIZE 3 + +typedef struct MXGContext { + uint8_t *buffer; + uint8_t *buffer_ptr; + uint8_t *soi_ptr; + unsigned int buffer_size; + int64_t dts; + unsigned int cache_size; +} MXGContext; + +static int mxg_read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + AVStream *video_st, *audio_st; + MXGContext *mxg = s->priv_data; + + /* video parameters will be extracted from the compressed bitstream */ + video_st = av_new_stream(s, VIDEO_STREAM_INDEX); + if (!video_st) + return AVERROR(ENOMEM); + video_st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + video_st->codec->codec_id = CODEC_ID_MXPEG; + av_set_pts_info(video_st, 64, 1, 1000000); + + audio_st = av_new_stream(s, AUDIO_STREAM_INDEX); + if (!audio_st) + return AVERROR(ENOMEM); + audio_st->codec->codec_type = AVMEDIA_TYPE_AUDIO; + audio_st->codec->codec_id = CODEC_ID_PCM_ALAW; + audio_st->codec->channels = 1; + audio_st->codec->sample_rate = 8000; + audio_st->codec->bits_per_coded_sample = 8; + audio_st->codec->block_align = 1; + av_set_pts_info(audio_st, 64, 1, 1000000); + + mxg->soi_ptr = mxg->buffer_ptr = mxg->buffer = 0; + mxg->buffer_size = 0; + mxg->dts = AV_NOPTS_VALUE; + mxg->cache_size = 0; + + return 0; +} + +static uint8_t* mxg_find_startmarker(uint8_t *p, uint8_t *end) +{ + for (; p < end - 3; p += 4) { + uint32_t x = *(uint32_t*)p; + + if (x & (~(x+0x01010101)) & 0x80808080) { + if (p[0] == 0xff) { + return p; + } else if (p[1] == 0xff) { + return p+1; + } else if (p[2] == 0xff) { + return p+2; + } else if (p[3] == 0xff) { + return p+3; + } + } + } + + for (; p < end; ++p) { + if (*p == 0xff) return p; + } + + return end; +} + +static int mxg_update_cache(AVFormatContext *s, unsigned int cache_size) +{ + MXGContext *mxg = s->priv_data; + unsigned int current_pos = mxg->buffer_ptr - mxg->buffer; + unsigned int soi_pos; + int ret; + + /* reallocate internal buffer */ + if (current_pos > current_pos + cache_size) + return AVERROR(ENOMEM); + if (mxg->soi_ptr) soi_pos = mxg->soi_ptr - mxg->buffer; + mxg->buffer = av_fast_realloc(mxg->buffer, &mxg->buffer_size, + current_pos + cache_size + + FF_INPUT_BUFFER_PADDING_SIZE); + if (!mxg->buffer) + return AVERROR(ENOMEM); + mxg->buffer_ptr = mxg->buffer + current_pos; + if (mxg->soi_ptr) mxg->soi_ptr = mxg->buffer + soi_pos; + + /* get data */ + ret = get_buffer(s->pb, mxg->buffer_ptr + mxg->cache_size, + cache_size - mxg->cache_size); + if (ret < 0) + return ret; + + mxg->cache_size += ret; + + return ret; +} + +static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + int ret; + unsigned int size; + uint8_t *startmarker_ptr, *end, *search_end, marker; + MXGContext *mxg = s->priv_data; + + while (!url_feof(s->pb) && !url_ferror(s->pb)){ + if (mxg->cache_size <= OVERREAD_SIZE) { + /* update internal buffer */ + ret = mxg_update_cache(s, DEFAULT_PACKET_SIZE + OVERREAD_SIZE); + if (ret < 0) + return ret; + } + end = mxg->buffer_ptr + mxg->cache_size; + + /* find start marker - 0xff */ + if (mxg->cache_size > OVERREAD_SIZE) { + search_end = end - OVERREAD_SIZE; + startmarker_ptr = mxg_find_startmarker(mxg->buffer_ptr, search_end); + } else { + search_end = end; + startmarker_ptr = mxg_find_startmarker(mxg->buffer_ptr, search_end); + if (startmarker_ptr >= search_end - 1 || + *(startmarker_ptr + 1) != EOI) break; + } + + if (startmarker_ptr != search_end) { /* start marker found */ + marker = *(startmarker_ptr + 1); + mxg->buffer_ptr = startmarker_ptr + 2; + mxg->cache_size = end - mxg->buffer_ptr; + + if (marker == SOI) { + mxg->soi_ptr = startmarker_ptr; + } else if (marker == EOI) { + if (!mxg->soi_ptr) { + av_log(s, AV_LOG_WARNING, "Found EOI before SOI, skipping\n"); + continue; + } + + pkt->pts = pkt->dts = mxg->dts; + pkt->stream_index = VIDEO_STREAM_INDEX; + pkt->destruct = NULL; + pkt->size = mxg->buffer_ptr - mxg->soi_ptr; + pkt->data = mxg->soi_ptr; + + if (mxg->soi_ptr - mxg->buffer > mxg->cache_size) { + if (mxg->cache_size > 0) { + memcpy(mxg->buffer, mxg->buffer_ptr, mxg->cache_size); + } + + mxg->buffer_ptr = mxg->buffer; + } + mxg->soi_ptr = 0; + + return pkt->size; + } else if ( (SOF0 <= marker && marker <= SOF15) || + (SOS <= marker && marker <= COM) ) { + /* all other markers that start marker segment also contain + length value (see specification for JPEG Annex B.1) */ + size = AV_RB16(mxg->buffer_ptr); + if (size < 2) + return AVERROR(EINVAL); + + if (mxg->cache_size < size) { + ret = mxg_update_cache(s, size); + if (ret < 0) + return ret; + startmarker_ptr = mxg->buffer_ptr - 2; + mxg->cache_size = 0; + } else { + mxg->cache_size -= size; + } + + mxg->buffer_ptr += size; + + if (marker == APP13 && size >= 16) { /* audio data */ + /* time (GMT) of first sample in usec since 1970, little-endian */ + pkt->pts = pkt->dts = AV_RL64(startmarker_ptr + 8); + pkt->stream_index = AUDIO_STREAM_INDEX; + pkt->destruct = NULL; + pkt->size = size - 14; + pkt->data = startmarker_ptr + 16; + + if (startmarker_ptr - mxg->buffer > mxg->cache_size) { + if (mxg->cache_size > 0) { + memcpy(mxg->buffer, mxg->buffer_ptr, mxg->cache_size); + } + mxg->buffer_ptr = mxg->buffer; + } + + return pkt->size; + } else if (marker == COM && size >= 18 && + !strncmp(startmarker_ptr + 4, "MXF", 3)) { + /* time (GMT) of video frame in usec since 1970, little-endian */ + mxg->dts = AV_RL64(startmarker_ptr + 12); + } + } + } else { + /* start marker not found */ + mxg->buffer_ptr = search_end; + mxg->cache_size = OVERREAD_SIZE; + } + } + + return AVERROR_EOF; +} + +static int mxg_close(struct AVFormatContext *s) +{ + MXGContext *mxg = s->priv_data; + av_freep(&mxg->buffer); + return 0; +} + +AVInputFormat ff_mxg_demuxer = { + .name = "mxg", + .long_name = NULL_IF_CONFIG_SMALL("MxPEG clip file format"), + .priv_data_size = sizeof(MXGContext), + .read_header = mxg_read_header, + .read_packet = mxg_read_packet, + .read_close = mxg_close, + .extensions = "mxg" +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/nullenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/nullenc.c new file mode 100644 index 00000000..1a7d42e9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/nullenc.c @@ -0,0 +1,40 @@ +/* + * RAW null muxer + * Copyright (c) 2002 Fabrice Bellard + * + * 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 + */ + +#include "avformat.h" + +static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt) +{ + return 0; +} + +AVOutputFormat ff_null_muxer = { + "null", + NULL_IF_CONFIG_SMALL("raw null video format"), + NULL, + NULL, + 0, + AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE), + CODEC_ID_RAWVIDEO, + NULL, + null_write_packet, + .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE | AVFMT_NOTIMESTAMPS, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparseskeleton.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparseskeleton.c new file mode 100644 index 00000000..ad0dded0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/oggparseskeleton.c @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2010 David Conrad + * + * 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 + */ + +#include "libavcodec/bytestream.h" +#include "avformat.h" +#include "oggdec.h" + +static int skeleton_header(AVFormatContext *s, int idx) +{ + struct ogg *ogg = s->priv_data; + struct ogg_stream *os = ogg->streams + idx; + AVStream *st = s->streams[idx]; + uint8_t *buf = os->buf + os->pstart; + int version_major, version_minor; + int64_t start_num, start_den, start_granule; + int target_idx, start_time; + + strcpy(st->codec->codec_name, "skeleton"); + st->codec->codec_type = AVMEDIA_TYPE_DATA; + + if (os->psize < 8) + return -1; + + if (!strncmp(buf, "fishead", 8)) { + if (os->psize < 64) + return -1; + + version_major = AV_RL16(buf+8); + version_minor = AV_RL16(buf+10); + + if (version_major != 3) { + av_log(s, AV_LOG_WARNING, "Unknown skeleton version %d.%d\n", + version_major, version_minor); + return -1; + } + + // This is the overall start time. We use it for the start time of + // of the skeleton stream since if left unset lavf assumes 0, + // which we don't want since skeleton is timeless + // FIXME: the real meaning of this field is "start playback at + // this time which can be in the middle of a packet + start_num = AV_RL64(buf+12); + start_den = AV_RL64(buf+20); + + if (start_den) { + av_reduce(&start_time, &st->time_base.den, start_num, start_den, INT_MAX); + st->time_base.num = 1; + os->lastpts = + st->start_time = start_time; + } + } else if (!strncmp(buf, "fisbone", 8)) { + if (os->psize < 52) + return -1; + + target_idx = ogg_find_stream(ogg, AV_RL32(buf+12)); + start_granule = AV_RL64(buf+36); + if (target_idx >= 0 && start_granule != -1) { + ogg->streams[target_idx].lastpts = + s->streams[target_idx]->start_time = ogg_gptopts(s, target_idx, start_granule, NULL); + } + } + + return 1; +} + +const struct ogg_codec ff_skeleton_codec = { + .magic = "fishead", + .magicsize = 8, + .header = skeleton_header, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/pcm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/pcm.c new file mode 100644 index 00000000..5de23af1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/pcm.c @@ -0,0 +1,55 @@ +/* + * PCM common functions + * Copyright (c) 2003 Fabrice Bellard + * + * 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 + */ + +#include "avformat.h" +#include "pcm.h" + +int pcm_read_seek(AVFormatContext *s, + int stream_index, int64_t timestamp, int flags) +{ + AVStream *st; + int block_align, byte_rate; + int64_t pos, ret; + + st = s->streams[0]; + + block_align = st->codec->block_align ? st->codec->block_align : + (av_get_bits_per_sample(st->codec->codec_id) * st->codec->channels) >> 3; + byte_rate = st->codec->bit_rate ? st->codec->bit_rate >> 3 : + block_align * st->codec->sample_rate; + + if (block_align <= 0 || byte_rate <= 0) + return -1; + if (timestamp < 0) timestamp = 0; + + /* compute the position by aligning it to block_align */ + pos = av_rescale_rnd(timestamp * byte_rate, + st->time_base.num, + st->time_base.den * (int64_t)block_align, + (flags & AVSEEK_FLAG_BACKWARD) ? AV_ROUND_DOWN : AV_ROUND_UP); + pos *= block_align; + + /* recompute exact position */ + st->cur_dts = av_rescale(pos, st->time_base.den, byte_rate * (int64_t)st->time_base.num); + if ((ret = url_fseek(s->pb, pos + s->data_offset, SEEK_SET)) < 0) + return ret; + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/pcm.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/pcm.h new file mode 100644 index 00000000..7c0b7d70 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/pcm.h @@ -0,0 +1,30 @@ +/* + * PCM common functions + * Copyright (C) 2007 Aurelien Jacobs + * + * 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 + */ + +#ifndef AVFORMAT_PCM_H +#define AVFORMAT_PCM_H + +#include "avformat.h" + +int pcm_read_seek(AVFormatContext *s, + int stream_index, int64_t timestamp, int flags); + +#endif /* AVFORMAT_PCM_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/pcmdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/pcmdec.c new file mode 100644 index 00000000..6441d89c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/pcmdec.c @@ -0,0 +1,122 @@ +/* + * RAW PCM demuxers + * Copyright (c) 2002 Fabrice Bellard + * + * 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 + */ + +#include "avformat.h" +#include "rawdec.h" +#include "pcm.h" + +#define RAW_SAMPLES 1024 + +static int raw_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + int ret, size, bps; + // AVStream *st = s->streams[0]; + + size= RAW_SAMPLES*s->streams[0]->codec->block_align; + + ret= av_get_packet(s->pb, pkt, size); + + pkt->stream_index = 0; + if (ret < 0) + return ret; + + bps= av_get_bits_per_sample(s->streams[0]->codec->codec_id); + assert(bps); // if false there IS a bug elsewhere (NOT in this function) + pkt->dts= + pkt->pts= pkt->pos*8 / (bps * s->streams[0]->codec->channels); + + return ret; +} + +#define PCMDEF(name, long_name, ext, codec) \ +AVInputFormat ff_pcm_ ## name ## _demuxer = {\ + #name,\ + NULL_IF_CONFIG_SMALL(long_name),\ + 0,\ + NULL,\ + ff_raw_read_header,\ + raw_read_packet,\ + NULL,\ + pcm_read_seek,\ + .flags= AVFMT_GENERIC_INDEX,\ + .extensions = ext,\ + .value = codec,\ +}; + +PCMDEF(f64be, "PCM 64 bit floating-point big-endian format", + NULL, CODEC_ID_PCM_F64BE) + +PCMDEF(f64le, "PCM 64 bit floating-point little-endian format", + NULL, CODEC_ID_PCM_F64LE) + +PCMDEF(f32be, "PCM 32 bit floating-point big-endian format", + NULL, CODEC_ID_PCM_F32BE) + +PCMDEF(f32le, "PCM 32 bit floating-point little-endian format", + NULL, CODEC_ID_PCM_F32LE) + +PCMDEF(s32be, "PCM signed 32 bit big-endian format", + NULL, CODEC_ID_PCM_S32BE) + +PCMDEF(s32le, "PCM signed 32 bit little-endian format", + NULL, CODEC_ID_PCM_S32LE) + +PCMDEF(s24be, "PCM signed 24 bit big-endian format", + NULL, CODEC_ID_PCM_S24BE) + +PCMDEF(s24le, "PCM signed 24 bit little-endian format", + NULL, CODEC_ID_PCM_S24LE) + +PCMDEF(s16be, "PCM signed 16 bit big-endian format", + AV_NE("sw", NULL), CODEC_ID_PCM_S16BE) + +PCMDEF(s16le, "PCM signed 16 bit little-endian format", + AV_NE(NULL, "sw"), CODEC_ID_PCM_S16LE) + +PCMDEF(s8, "PCM signed 8 bit format", + "sb", CODEC_ID_PCM_S8) + +PCMDEF(u32be, "PCM unsigned 32 bit big-endian format", + NULL, CODEC_ID_PCM_U32BE) + +PCMDEF(u32le, "PCM unsigned 32 bit little-endian format", + NULL, CODEC_ID_PCM_U32LE) + +PCMDEF(u24be, "PCM unsigned 24 bit big-endian format", + NULL, CODEC_ID_PCM_U24BE) + +PCMDEF(u24le, "PCM unsigned 24 bit little-endian format", + NULL, CODEC_ID_PCM_U24LE) + +PCMDEF(u16be, "PCM unsigned 16 bit big-endian format", + AV_NE("uw", NULL), CODEC_ID_PCM_U16BE) + +PCMDEF(u16le, "PCM unsigned 16 bit little-endian format", + AV_NE(NULL, "uw"), CODEC_ID_PCM_U16LE) + +PCMDEF(u8, "PCM unsigned 8 bit format", + "ub", CODEC_ID_PCM_U8) + +PCMDEF(alaw, "PCM A-law format", + "al", CODEC_ID_PCM_ALAW) + +PCMDEF(mulaw, "PCM mu-law format", + "ul", CODEC_ID_PCM_MULAW) diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/pcmenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/pcmenc.c new file mode 100644 index 00000000..385425ce --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/pcmenc.c @@ -0,0 +1,97 @@ +/* + * RAW PCM muxers + * Copyright (c) 2002 Fabrice Bellard + * + * 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 + */ + +#include "avformat.h" +#include "rawenc.h" + +#define PCMDEF(name, long_name, ext, codec) \ +AVOutputFormat ff_pcm_ ## name ## _muxer = {\ + #name,\ + NULL_IF_CONFIG_SMALL(long_name),\ + NULL,\ + ext,\ + 0,\ + codec,\ + CODEC_ID_NONE,\ + NULL,\ + ff_raw_write_packet,\ + .flags= AVFMT_NOTIMESTAMPS,\ +}; + +PCMDEF(f64be, "PCM 64 bit floating-point big-endian format", + NULL, CODEC_ID_PCM_F64BE) + +PCMDEF(f64le, "PCM 64 bit floating-point little-endian format", + NULL, CODEC_ID_PCM_F64LE) + +PCMDEF(f32be, "PCM 32 bit floating-point big-endian format", + NULL, CODEC_ID_PCM_F32BE) + +PCMDEF(f32le, "PCM 32 bit floating-point little-endian format", + NULL, CODEC_ID_PCM_F32LE) + +PCMDEF(s32be, "PCM signed 32 bit big-endian format", + NULL, CODEC_ID_PCM_S32BE) + +PCMDEF(s32le, "PCM signed 32 bit little-endian format", + NULL, CODEC_ID_PCM_S32LE) + +PCMDEF(s24be, "PCM signed 24 bit big-endian format", + NULL, CODEC_ID_PCM_S24BE) + +PCMDEF(s24le, "PCM signed 24 bit little-endian format", + NULL, CODEC_ID_PCM_S24LE) + +PCMDEF(s16be, "PCM signed 16 bit big-endian format", + AV_NE("sw", NULL), CODEC_ID_PCM_S16BE) + +PCMDEF(s16le, "PCM signed 16 bit little-endian format", + AV_NE(NULL, "sw"), CODEC_ID_PCM_S16LE) + +PCMDEF(s8, "PCM signed 8 bit format", + "sb", CODEC_ID_PCM_S8) + +PCMDEF(u32be, "PCM unsigned 32 bit big-endian format", + NULL, CODEC_ID_PCM_U32BE) + +PCMDEF(u32le, "PCM unsigned 32 bit little-endian format", + NULL, CODEC_ID_PCM_U32LE) + +PCMDEF(u24be, "PCM unsigned 24 bit big-endian format", + NULL, CODEC_ID_PCM_U24BE) + +PCMDEF(u24le, "PCM unsigned 24 bit little-endian format", + NULL, CODEC_ID_PCM_U24LE) + +PCMDEF(u16be, "PCM unsigned 16 bit big-endian format", + AV_NE("uw", NULL), CODEC_ID_PCM_U16BE) + +PCMDEF(u16le, "PCM unsigned 16 bit little-endian format", + AV_NE(NULL, "uw"), CODEC_ID_PCM_U16LE) + +PCMDEF(u8, "PCM unsigned 8 bit format", + "ub", CODEC_ID_PCM_U8) + +PCMDEF(alaw, "PCM A-law format", + "al", CODEC_ID_PCM_ALAW) + +PCMDEF(mulaw, "PCM mu-law format", + "ul", CODEC_ID_PCM_MULAW) diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawdec.c new file mode 100644 index 00000000..4f830e3c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawdec.c @@ -0,0 +1,235 @@ +/* + * RAW demuxers + * Copyright (c) 2001 Fabrice Bellard + * Copyright (c) 2005 Alex Beregszaszi + * + * 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 + */ + +#include "avformat.h" +#include "rawdec.h" + +/* raw input */ +int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + AVStream *st; + enum CodecID id; + + st = av_new_stream(s, 0); + if (!st) + return AVERROR(ENOMEM); + + id = s->iformat->value; + if (id == CODEC_ID_RAWVIDEO) { + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + } else { + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; + } + st->codec->codec_id = id; + + switch(st->codec->codec_type) { + case AVMEDIA_TYPE_AUDIO: + st->codec->sample_rate = ap->sample_rate; + if(ap->channels) st->codec->channels = ap->channels; + else st->codec->channels = 1; + st->codec->bits_per_coded_sample = av_get_bits_per_sample(st->codec->codec_id); + assert(st->codec->bits_per_coded_sample > 0); + st->codec->block_align = st->codec->bits_per_coded_sample*st->codec->channels/8; + av_set_pts_info(st, 64, 1, st->codec->sample_rate); + break; + case AVMEDIA_TYPE_VIDEO: + if(ap->time_base.num) + av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den); + else + av_set_pts_info(st, 64, 1, 25); + st->codec->width = ap->width; + st->codec->height = ap->height; + st->codec->pix_fmt = ap->pix_fmt; + if(st->codec->pix_fmt == PIX_FMT_NONE) + st->codec->pix_fmt= PIX_FMT_YUV420P; + break; + default: + return -1; + } + return 0; +} + +#define RAW_PACKET_SIZE 1024 + +int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt) +{ + int ret, size; + + size = RAW_PACKET_SIZE; + + if (av_new_packet(pkt, size) < 0) + return AVERROR(ENOMEM); + + pkt->pos= url_ftell(s->pb); + pkt->stream_index = 0; + ret = get_partial_buffer(s->pb, pkt->data, size); + if (ret < 0) { + av_free_packet(pkt); + return ret; + } + pkt->size = ret; + return ret; +} + +int ff_raw_audio_read_header(AVFormatContext *s, + AVFormatParameters *ap) +{ + AVStream *st = av_new_stream(s, 0); + if (!st) + return AVERROR(ENOMEM); + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; + st->codec->codec_id = s->iformat->value; + st->need_parsing = AVSTREAM_PARSE_FULL; + /* the parameters will be extracted from the compressed bitstream */ + + return 0; +} + +/* MPEG-1/H.263 input */ +int ff_raw_video_read_header(AVFormatContext *s, + AVFormatParameters *ap) +{ + AVStream *st; + + st = av_new_stream(s, 0); + if (!st) + return AVERROR(ENOMEM); + + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + st->codec->codec_id = s->iformat->value; + st->need_parsing = AVSTREAM_PARSE_FULL; + + /* for MJPEG, specify frame rate */ + /* for MPEG-4 specify it, too (most MPEG-4 streams do not have the fixed_vop_rate set ...)*/ + if (ap->time_base.num) { + st->codec->time_base= ap->time_base; + } else if ( st->codec->codec_id == CODEC_ID_MJPEG || + st->codec->codec_id == CODEC_ID_MPEG4 || + st->codec->codec_id == CODEC_ID_DIRAC || + st->codec->codec_id == CODEC_ID_DNXHD || + st->codec->codec_id == CODEC_ID_VC1 || + st->codec->codec_id == CODEC_ID_H264) { + st->codec->time_base= (AVRational){1,25}; + } + av_set_pts_info(st, 64, 1, 1200000); + + return 0; +} + +/* Note: Do not forget to add new entries to the Makefile as well. */ + +#if CONFIG_G722_DEMUXER +AVInputFormat ff_g722_demuxer = { + "g722", + NULL_IF_CONFIG_SMALL("raw G.722"), + 0, + NULL, + ff_raw_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "g722,722", + .value = CODEC_ID_ADPCM_G722, +}; +#endif + +#if CONFIG_GSM_DEMUXER +AVInputFormat ff_gsm_demuxer = { + "gsm", + NULL_IF_CONFIG_SMALL("raw GSM"), + 0, + NULL, + ff_raw_audio_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "gsm", + .value = CODEC_ID_GSM, +}; +#endif + +#if CONFIG_MJPEG_DEMUXER +AVInputFormat ff_mjpeg_demuxer = { + "mjpeg", + NULL_IF_CONFIG_SMALL("raw MJPEG video"), + 0, + NULL, + ff_raw_video_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "mjpg,mjpeg", + .value = CODEC_ID_MJPEG, +}; +#endif + +#if CONFIG_MLP_DEMUXER +AVInputFormat ff_mlp_demuxer = { + "mlp", + NULL_IF_CONFIG_SMALL("raw MLP"), + 0, + NULL, + ff_raw_audio_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "mlp", + .value = CODEC_ID_MLP, +}; +#endif + +#if CONFIG_TRUEHD_DEMUXER +AVInputFormat ff_truehd_demuxer = { + "truehd", + NULL_IF_CONFIG_SMALL("raw TrueHD"), + 0, + NULL, + ff_raw_audio_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "thd", + .value = CODEC_ID_TRUEHD, +}; +#endif + +#if CONFIG_SHORTEN_DEMUXER +AVInputFormat ff_shorten_demuxer = { + "shn", + NULL_IF_CONFIG_SMALL("raw Shorten"), + 0, + NULL, + ff_raw_audio_read_header, + ff_raw_read_partial_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "shn", + .value = CODEC_ID_SHORTEN, +}; +#endif + +#if CONFIG_VC1_DEMUXER +AVInputFormat ff_vc1_demuxer = { + "vc1", + NULL_IF_CONFIG_SMALL("raw VC-1"), + 0, + NULL /* vc1_probe */, + ff_raw_video_read_header, + ff_raw_read_partial_packet, + .extensions = "vc1", + .value = CODEC_ID_VC1, +}; +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawdec.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawdec.h new file mode 100644 index 00000000..0b0cf1be --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawdec.h @@ -0,0 +1,35 @@ +/* + * RAW demuxers + * Copyright (C) 2007 Aurelien Jacobs + * + * 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 + */ + +#ifndef AVFORMAT_RAWDEC_H +#define AVFORMAT_RAWDEC_H + +#include "avformat.h" + +int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap); + +int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt); + +int ff_raw_audio_read_header(AVFormatContext *s, AVFormatParameters *ap); + +int ff_raw_video_read_header(AVFormatContext *s, AVFormatParameters *ap); + +#endif /* AVFORMAT_RAWDEC_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawenc.c new file mode 100644 index 00000000..6f9fdce4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawenc.c @@ -0,0 +1,300 @@ +/* + * RAW muxers + * Copyright (c) 2001 Fabrice Bellard + * Copyright (c) 2005 Alex Beregszaszi + * + * 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 + */ + +#include "avformat.h" +#include "rawenc.h" + +int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt) +{ + put_buffer(s->pb, pkt->data, pkt->size); + put_flush_packet(s->pb); + return 0; +} + +/* Note: Do not forget to add new entries to the Makefile as well. */ + +#if CONFIG_AC3_MUXER +AVOutputFormat ff_ac3_muxer = { + "ac3", + NULL_IF_CONFIG_SMALL("raw AC-3"), + "audio/x-ac3", + "ac3", + 0, + CODEC_ID_AC3, + CODEC_ID_NONE, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_DIRAC_MUXER +AVOutputFormat ff_dirac_muxer = { + "dirac", + NULL_IF_CONFIG_SMALL("raw Dirac"), + NULL, + "drc", + 0, + CODEC_ID_NONE, + CODEC_ID_DIRAC, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_DNXHD_MUXER +AVOutputFormat ff_dnxhd_muxer = { + "dnxhd", + NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"), + NULL, + "dnxhd", + 0, + CODEC_ID_NONE, + CODEC_ID_DNXHD, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_DTS_MUXER +AVOutputFormat ff_dts_muxer = { + "dts", + NULL_IF_CONFIG_SMALL("raw DTS"), + "audio/x-dca", + "dts", + 0, + CODEC_ID_DTS, + CODEC_ID_NONE, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_EAC3_MUXER +AVOutputFormat ff_eac3_muxer = { + "eac3", + NULL_IF_CONFIG_SMALL("raw E-AC-3"), + "audio/x-eac3", + "eac3", + 0, + CODEC_ID_EAC3, + CODEC_ID_NONE, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_G722_MUXER +AVOutputFormat ff_g722_muxer = { + "g722", + NULL_IF_CONFIG_SMALL("raw G.722"), + "audio/G722", + "g722", + 0, + CODEC_ID_ADPCM_G722, + CODEC_ID_NONE, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_H261_MUXER +AVOutputFormat ff_h261_muxer = { + "h261", + NULL_IF_CONFIG_SMALL("raw H.261"), + "video/x-h261", + "h261", + 0, + CODEC_ID_NONE, + CODEC_ID_H261, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_H263_MUXER +AVOutputFormat ff_h263_muxer = { + "h263", + NULL_IF_CONFIG_SMALL("raw H.263"), + "video/x-h263", + "h263", + 0, + CODEC_ID_NONE, + CODEC_ID_H263, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_H264_MUXER +AVOutputFormat ff_h264_muxer = { + "h264", + NULL_IF_CONFIG_SMALL("raw H.264 video format"), + NULL, + "h264", + 0, + CODEC_ID_NONE, + CODEC_ID_H264, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_CAVSVIDEO_MUXER +AVOutputFormat ff_cavsvideo_muxer = { + "cavsvideo", + NULL_IF_CONFIG_SMALL("raw Chinese AVS video"), + NULL, + "cavs", + 0, + CODEC_ID_NONE, + CODEC_ID_CAVS, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_M4V_MUXER +AVOutputFormat ff_m4v_muxer = { + "m4v", + NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"), + NULL, + "m4v", + 0, + CODEC_ID_NONE, + CODEC_ID_MPEG4, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_MJPEG_MUXER +AVOutputFormat ff_mjpeg_muxer = { + "mjpeg", + NULL_IF_CONFIG_SMALL("raw MJPEG video"), + "video/x-mjpeg", + "mjpg,mjpeg", + 0, + CODEC_ID_NONE, + CODEC_ID_MJPEG, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_MLP_MUXER +AVOutputFormat ff_mlp_muxer = { + "mlp", + NULL_IF_CONFIG_SMALL("raw MLP"), + NULL, + "mlp", + 0, + CODEC_ID_MLP, + CODEC_ID_NONE, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_SRT_MUXER +AVOutputFormat ff_srt_muxer = { + .name = "srt", + .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle format"), + .mime_type = "application/x-subrip", + .extensions = "srt", + .write_packet = ff_raw_write_packet, + .flags = AVFMT_NOTIMESTAMPS, + .subtitle_codec = CODEC_ID_SRT, +}; +#endif + +#if CONFIG_TRUEHD_MUXER +AVOutputFormat ff_truehd_muxer = { + "truehd", + NULL_IF_CONFIG_SMALL("raw TrueHD"), + NULL, + "thd", + 0, + CODEC_ID_TRUEHD, + CODEC_ID_NONE, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_MPEG1VIDEO_MUXER +AVOutputFormat ff_mpeg1video_muxer = { + "mpeg1video", + NULL_IF_CONFIG_SMALL("raw MPEG-1 video"), + "video/x-mpeg", + "mpg,mpeg,m1v", + 0, + CODEC_ID_NONE, + CODEC_ID_MPEG1VIDEO, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_MPEG2VIDEO_MUXER +AVOutputFormat ff_mpeg2video_muxer = { + "mpeg2video", + NULL_IF_CONFIG_SMALL("raw MPEG-2 video"), + NULL, + "m2v", + 0, + CODEC_ID_NONE, + CODEC_ID_MPEG2VIDEO, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif + +#if CONFIG_RAWVIDEO_MUXER +AVOutputFormat ff_rawvideo_muxer = { + "rawvideo", + NULL_IF_CONFIG_SMALL("raw video format"), + NULL, + "yuv,rgb", + 0, + CODEC_ID_NONE, + CODEC_ID_RAWVIDEO, + NULL, + ff_raw_write_packet, + .flags= AVFMT_NOTIMESTAMPS, +}; +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawenc.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawenc.h new file mode 100644 index 00000000..b5523090 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawenc.h @@ -0,0 +1,29 @@ +/* + * RAW muxers + * Copyright (C) 2007 Aurelien Jacobs + * + * 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 + */ + +#ifndef AVFORMAT_RAWENC_H +#define AVFORMAT_RAWENC_H + +#include "avformat.h" + +int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt); + +#endif /* AVFORMAT_RAWENC_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawvideodec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawvideodec.c new file mode 100644 index 00000000..127119f1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rawvideodec.c @@ -0,0 +1,57 @@ +/* + * RAW video demuxer + * Copyright (c) 2001 Fabrice Bellard + * + * 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 + */ + +#include "avformat.h" +#include "rawdec.h" + +static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + int packet_size, ret, width, height; + AVStream *st = s->streams[0]; + + width = st->codec->width; + height = st->codec->height; + + packet_size = avpicture_get_size(st->codec->pix_fmt, width, height); + if (packet_size < 0) + return -1; + + ret= av_get_packet(s->pb, pkt, packet_size); + pkt->pts= + pkt->dts= pkt->pos / packet_size; + + pkt->stream_index = 0; + if (ret < 0) + return ret; + return 0; +} + +AVInputFormat ff_rawvideo_demuxer = { + "rawvideo", + NULL_IF_CONFIG_SMALL("raw video format"), + 0, + NULL, + ff_raw_read_header, + rawvideo_read_packet, + .flags= AVFMT_GENERIC_INDEX, + .extensions = "yuv,cif,qcif,rgb", + .value = CODEC_ID_RAWVIDEO, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rso.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rso.c new file mode 100644 index 00000000..178fd3f2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rso.c @@ -0,0 +1,30 @@ +/* + * RSO format common data + * Copyright (c) 2010 Rafael Carre + * + * 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 + */ + +#include "avformat.h" +#include "internal.h" +#include "rso.h" + +const AVCodecTag ff_codec_rso_tags[] = { + { CODEC_ID_PCM_U8, 0x0100 }, + { CODEC_ID_ADPCM_IMA_WAV, 0x0101 }, + { CODEC_ID_NONE, 0 }, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rso.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rso.h new file mode 100644 index 00000000..acb0f140 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rso.h @@ -0,0 +1,32 @@ +/* + * RSO format common data + * Copyright (c) 2010 Rafael Carre + * + * 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 + */ + +#ifndef AVFORMAT_RSO_H +#define AVFORMAT_RSO_H + +#include "internal.h" + +#define RSO_HEADER_SIZE 8 + +/* The ffmpeg codecs we support, and the IDs they have in the file */ +extern const AVCodecTag ff_codec_rso_tags[]; + +#endif /* AVFORMAT_RSO_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rsodec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rsodec.c new file mode 100644 index 00000000..698f82ed --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rsodec.c @@ -0,0 +1,102 @@ +/* + * RSO demuxer + * Copyright (c) 2001 Fabrice Bellard (original AU code) + * Copyright (c) 2010 Rafael Carre + * + * 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 + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "internal.h" +#include "pcm.h" +#include "riff.h" +#include "rso.h" + +static int rso_read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + ByteIOContext *pb = s->pb; + int id, rate, bps; + unsigned int size; + enum CodecID codec; + AVStream *st; + + id = get_be16(pb); + size = get_be16(pb); + rate = get_be16(pb); + get_be16(pb); /* play mode ? (0x0000 = don't loop) */ + + codec = ff_codec_get_id(ff_codec_rso_tags, id); + + if (codec == CODEC_ID_ADPCM_IMA_WAV) { + av_log(s, AV_LOG_ERROR, "ADPCM in RSO not implemented\n"); + return AVERROR_PATCHWELCOME; + } + + bps = av_get_bits_per_sample(codec); + if (!bps) { + av_log_ask_for_sample(s, "could not determine bits per sample\n"); + return AVERROR_INVALIDDATA; + } + + /* now we are ready: build format streams */ + st = av_new_stream(s, 0); + if (!st) + return AVERROR(ENOMEM); + + st->duration = (size * 8) / bps; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; + st->codec->codec_tag = id; + st->codec->codec_id = codec; + st->codec->channels = 1; + st->codec->sample_rate = rate; + + av_set_pts_info(st, 64, 1, rate); + + return 0; +} + +#define BLOCK_SIZE 1024 /* in samples */ + +static int rso_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + int bps = av_get_bits_per_sample(s->streams[0]->codec->codec_id); + int ret = av_get_packet(s->pb, pkt, BLOCK_SIZE * bps >> 3); + + if (ret < 0) + return ret; + + pkt->stream_index = 0; + + /* note: we need to modify the packet size here to handle the last packet */ + pkt->size = ret; + + return 0; +} + +AVInputFormat ff_rso_demuxer = { + .name = "rso", + .long_name = NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO format"), + .extensions = "rso", + .priv_data_size = 0, + .read_probe = NULL, /* no magic value in this format */ + .read_header = rso_read_header, + .read_packet = rso_read_packet, + .read_close = NULL, + .read_seek = pcm_read_seek, + .codec_tag = (const AVCodecTag* const []){ff_codec_rso_tags, 0}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rsoenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rsoenc.c new file mode 100644 index 00000000..7b138986 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rsoenc.c @@ -0,0 +1,114 @@ +/* + * RSO muxer + * Copyright (c) 2001 Fabrice Bellard (original AU code) + * Copyright (c) 2010 Rafael Carre + * + * 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 + */ + +#include "avformat.h" +#include "internal.h" +#include "riff.h" +#include "rso.h" + +static int rso_write_header(AVFormatContext *s) +{ + ByteIOContext *pb = s->pb; + AVCodecContext *enc = s->streams[0]->codec; + + if (!enc->codec_tag) + return AVERROR_INVALIDDATA; + + if (enc->channels != 1) { + av_log(s, AV_LOG_ERROR, "RSO only supports mono\n"); + return AVERROR_INVALIDDATA; + } + + if (url_is_streamed(s->pb)) { + av_log(s, AV_LOG_ERROR, "muxer does not support non seekable output\n"); + return AVERROR_INVALIDDATA; + } + + /* XXX: find legal sample rates (if any) */ + if (enc->sample_rate >= 1u<<16) { + av_log(s, AV_LOG_ERROR, "Sample rate must be < 65536\n"); + return AVERROR_INVALIDDATA; + } + + if (enc->codec_id == CODEC_ID_ADPCM_IMA_WAV) { + av_log(s, AV_LOG_ERROR, "ADPCM in RSO not implemented\n"); + return AVERROR_PATCHWELCOME; + } + + /* format header */ + put_be16(pb, enc->codec_tag); /* codec ID */ + put_be16(pb, 0); /* data size, will be written at EOF */ + put_be16(pb, enc->sample_rate); + put_be16(pb, 0x0000); /* play mode ? (0x0000 = don't loop) */ + + put_flush_packet(pb); + + return 0; +} + +static int rso_write_packet(AVFormatContext *s, AVPacket *pkt) +{ + put_buffer(s->pb, pkt->data, pkt->size); + return 0; +} + +static int rso_write_trailer(AVFormatContext *s) +{ + ByteIOContext *pb = s->pb; + int64_t file_size; + uint16_t coded_file_size; + + file_size = url_ftell(pb); + + if (file_size < 0) + return file_size; + + if (file_size > 0xffff + RSO_HEADER_SIZE) { + av_log(s, AV_LOG_WARNING, + "Output file is too big (%"PRId64" bytes >= 64kB)\n", file_size); + coded_file_size = 0xffff; + } else { + coded_file_size = file_size - RSO_HEADER_SIZE; + } + + /* update file size */ + url_fseek(pb, 2, SEEK_SET); + put_be16(pb, coded_file_size); + url_fseek(pb, file_size, SEEK_SET); + + put_flush_packet(pb); + + return 0; +} + +AVOutputFormat ff_rso_muxer = { + .name = "rso", + .long_name = NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO format"), + .extensions = "rso", + .priv_data_size = 0, + .audio_codec = CODEC_ID_PCM_U8, + .video_codec = CODEC_ID_NONE, + .write_header = rso_write_header, + .write_packet = rso_write_packet, + .write_trailer = rso_write_trailer, + .codec_tag = (const AVCodecTag* const []){ff_codec_rso_tags, 0}, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_amr.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_amr.c new file mode 100644 index 00000000..016d2165 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_amr.c @@ -0,0 +1,208 @@ +/* + * RTP AMR Depacketizer, RFC 3267 + * Copyright (c) 2010 Martin Storsjo + * + * 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 + */ + +#include "avformat.h" +#include "rtpdec_formats.h" +#include "libavutil/avstring.h" + +static const uint8_t frame_sizes_nb[16] = { + 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 +}; +static const uint8_t frame_sizes_wb[16] = { + 17, 23, 32, 36, 40, 46, 50, 58, 60, 5, 5, 0, 0, 0, 0, 0 +}; + +struct PayloadContext { + int octet_align; + int crc; + int interleaving; + int channels; +}; + +static PayloadContext *amr_new_context(void) +{ + PayloadContext *data = av_mallocz(sizeof(PayloadContext)); + if(!data) return data; + data->channels = 1; + return data; +} + +static void amr_free_context(PayloadContext *data) +{ + av_free(data); +} + +static int amr_handle_packet(AVFormatContext *ctx, + PayloadContext *data, + AVStream *st, + AVPacket * pkt, + uint32_t * timestamp, + const uint8_t * buf, + int len, int flags) +{ + const uint8_t *frame_sizes = NULL; + int frames; + int i; + const uint8_t *speech_data; + uint8_t *ptr; + + if (st->codec->codec_id == CODEC_ID_AMR_NB) { + frame_sizes = frame_sizes_nb; + } else if (st->codec->codec_id == CODEC_ID_AMR_WB) { + frame_sizes = frame_sizes_wb; + } else { + av_log(ctx, AV_LOG_ERROR, "Bad codec ID\n"); + return AVERROR_INVALIDDATA; + } + + if (st->codec->channels != 1) { + av_log(ctx, AV_LOG_ERROR, "Only mono AMR is supported\n"); + return AVERROR_INVALIDDATA; + } + + /* The AMR RTP packet consists of one header byte, followed + * by one TOC byte for each AMR frame in the packet, followed + * by the speech data for all the AMR frames. + * + * The header byte contains only a codec mode request, for + * requesting what kind of AMR data the sender wants to + * receive. Not used at the moment. + */ + + /* Count the number of frames in the packet. The highest bit + * is set in a TOC byte if there are more frames following. + */ + for (frames = 1; frames < len && (buf[frames] & 0x80); frames++) ; + + if (1 + frames >= len) { + /* We hit the end of the packet while counting frames. */ + av_log(ctx, AV_LOG_ERROR, "No speech data found\n"); + return AVERROR_INVALIDDATA; + } + + speech_data = buf + 1 + frames; + + /* Everything except the codec mode request byte should be output. */ + if (av_new_packet(pkt, len - 1)) { + av_log(ctx, AV_LOG_ERROR, "Out of memory\n"); + return AVERROR(ENOMEM); + } + pkt->stream_index = st->index; + ptr = pkt->data; + + for (i = 0; i < frames; i++) { + uint8_t toc = buf[1 + i]; + int frame_size = frame_sizes[(toc >> 3) & 0x0f]; + + if (speech_data + frame_size > buf + len) { + /* Too little speech data */ + av_log(ctx, AV_LOG_WARNING, "Too little speech data in the RTP packet\n"); + /* Set the unwritten part of the packet to zero. */ + memset(ptr, 0, pkt->data + pkt->size - ptr); + pkt->size = ptr - pkt->data; + return 0; + } + + /* Extract the AMR frame mode from the TOC byte */ + *ptr++ = toc & 0x7C; + + /* Copy the speech data */ + memcpy(ptr, speech_data, frame_size); + speech_data += frame_size; + ptr += frame_size; + } + + if (speech_data < buf + len) { + av_log(ctx, AV_LOG_WARNING, "Too much speech data in the RTP packet?\n"); + /* Set the unwritten part of the packet to zero. */ + memset(ptr, 0, pkt->data + pkt->size - ptr); + pkt->size = ptr - pkt->data; + } + + return 0; +} + +static int amr_parse_fmtp(AVStream *stream, PayloadContext *data, + char *attr, char *value) +{ + /* Some AMR SDP configurations contain "octet-align", without + * the trailing =1. Therefore, if the value is empty, + * interpret it as "1". + */ + if (!strcmp(value, "")) { + av_log(NULL, AV_LOG_WARNING, "AMR fmtp attribute %s had " + "nonstandard empty value\n", attr); + strcpy(value, "1"); + } + if (!strcmp(attr, "octet-align")) + data->octet_align = atoi(value); + else if (!strcmp(attr, "crc")) + data->crc = atoi(value); + else if (!strcmp(attr, "interleaving")) + data->interleaving = atoi(value); + else if (!strcmp(attr, "channels")) + data->channels = atoi(value); + return 0; +} + +static int amr_parse_sdp_line(AVFormatContext *s, int st_index, + PayloadContext *data, const char *line) +{ + const char *p; + int ret; + + /* Parse an fmtp line this one: + * a=fmtp:97 octet-align=1; interleaving=0 + * That is, a normal fmtp: line followed by semicolon & space + * separated key/value pairs. + */ + if (av_strstart(line, "fmtp:", &p)) { + ret = ff_parse_fmtp(s->streams[st_index], data, p, amr_parse_fmtp); + if (!data->octet_align || data->crc || + data->interleaving || data->channels != 1) { + av_log(s, AV_LOG_ERROR, "Unsupported RTP/AMR configuration!\n"); + return -1; + } + return ret; + } + return 0; +} + +RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler = { + .enc_name = "AMR", + .codec_type = AVMEDIA_TYPE_AUDIO, + .codec_id = CODEC_ID_AMR_NB, + .parse_sdp_a_line = amr_parse_sdp_line, + .open = amr_new_context, + .close = amr_free_context, + .parse_packet = amr_handle_packet, +}; + +RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler = { + .enc_name = "AMR-WB", + .codec_type = AVMEDIA_TYPE_AUDIO, + .codec_id = CODEC_ID_AMR_WB, + .parse_sdp_a_line = amr_parse_sdp_line, + .open = amr_new_context, + .close = amr_free_context, + .parse_packet = amr_handle_packet, +}; + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_asf.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_asf.c new file mode 100644 index 00000000..db09f8f3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_asf.c @@ -0,0 +1,294 @@ +/* + * Microsoft RTP/ASF support. + * Copyright (c) 2008 Ronald S. Bultje + * + * 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 + * @brief Microsoft RTP/ASF support + * @author Ronald S. Bultje + */ + +#include "libavutil/base64.h" +#include "libavutil/avstring.h" +#include "libavutil/intreadwrite.h" +#include "rtp.h" +#include "rtpdec_formats.h" +#include "rtsp.h" +#include "asf.h" + +/** + * From MSDN 2.2.1.4, we learn that ASF data packets over RTP should not + * contain any padding. Unfortunately, the header min/max_pktsize are not + * updated (thus making min_pktsize invalid). Here, we "fix" these faulty + * min_pktsize values in the ASF file header. + * @return 0 on success, <0 on failure (currently -1). + */ +static int rtp_asf_fix_header(uint8_t *buf, int len) +{ + uint8_t *p = buf, *end = buf + len; + + if (len < sizeof(ff_asf_guid) * 2 + 22 || + memcmp(p, ff_asf_header, sizeof(ff_asf_guid))) { + return -1; + } + p += sizeof(ff_asf_guid) + 14; + do { + uint64_t chunksize = AV_RL64(p + sizeof(ff_asf_guid)); + if (memcmp(p, ff_asf_file_header, sizeof(ff_asf_guid))) { + if (chunksize > end - p) + return -1; + p += chunksize; + continue; + } + + /* skip most of the file header, to min_pktsize */ + p += 6 * 8 + 3 * 4 + sizeof(ff_asf_guid) * 2; + if (p + 8 <= end && AV_RL32(p) == AV_RL32(p + 4)) { + /* and set that to zero */ + AV_WL32(p, 0); + return 0; + } + break; + } while (end - p >= sizeof(ff_asf_guid) + 8); + + return -1; +} + +/** + * The following code is basically a buffered ByteIOContext, + * with the added benefit of returning -EAGAIN (instead of 0) + * on packet boundaries, such that the ASF demuxer can return + * safely and resume business at the next packet. + */ +static int packetizer_read(void *opaque, uint8_t *buf, int buf_size) +{ + return AVERROR(EAGAIN); +} + +static void init_packetizer(ByteIOContext *pb, uint8_t *buf, int len) +{ + init_put_byte(pb, buf, len, 0, NULL, packetizer_read, NULL, NULL); + + /* this "fills" the buffer with its current content */ + pb->pos = len; + pb->buf_end = buf + len; +} + +int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p) +{ + int ret = 0; + if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) { + ByteIOContext pb; + RTSPState *rt = s->priv_data; + int len = strlen(p) * 6 / 8; + char *buf = av_mallocz(len); + av_base64_decode(buf, p, len); + + if (rtp_asf_fix_header(buf, len) < 0) + av_log(s, AV_LOG_ERROR, + "Failed to fix invalid RTSP-MS/ASF min_pktsize\n"); + init_packetizer(&pb, buf, len); + if (rt->asf_ctx) { + av_close_input_stream(rt->asf_ctx); + rt->asf_ctx = NULL; + } + ret = av_open_input_stream(&rt->asf_ctx, &pb, "", &ff_asf_demuxer, NULL); + if (ret < 0) + return ret; + av_metadata_copy(&s->metadata, rt->asf_ctx->metadata, 0); + rt->asf_pb_pos = url_ftell(&pb); + av_free(buf); + rt->asf_ctx->pb = NULL; + } + return ret; +} + +static int asfrtp_parse_sdp_line(AVFormatContext *s, int stream_index, + PayloadContext *asf, const char *line) +{ + if (av_strstart(line, "stream:", &line)) { + RTSPState *rt = s->priv_data; + + s->streams[stream_index]->id = strtol(line, NULL, 10); + + if (rt->asf_ctx) { + int i; + + for (i = 0; i < rt->asf_ctx->nb_streams; i++) { + if (s->streams[stream_index]->id == rt->asf_ctx->streams[i]->id) { + *s->streams[stream_index]->codec = + *rt->asf_ctx->streams[i]->codec; + rt->asf_ctx->streams[i]->codec->extradata_size = 0; + rt->asf_ctx->streams[i]->codec->extradata = NULL; + av_set_pts_info(s->streams[stream_index], 32, 1, 1000); + } + } + } + } + + return 0; +} + +struct PayloadContext { + ByteIOContext *pktbuf, pb; + uint8_t *buf; +}; + +/** + * @return 0 when a packet was written into /p pkt, and no more data is left; + * 1 when a packet was written into /p pkt, and more packets might be left; + * <0 when not enough data was provided to return a full packet, or on error. + */ +static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf, + AVStream *st, AVPacket *pkt, + uint32_t *timestamp, + const uint8_t *buf, int len, int flags) +{ + ByteIOContext *pb = &asf->pb; + int res, mflags, len_off; + RTSPState *rt = s->priv_data; + + if (!rt->asf_ctx) + return -1; + + if (len > 0) { + int off, out_len = 0; + + if (len < 4) + return -1; + + av_freep(&asf->buf); + + init_put_byte(pb, buf, len, 0, NULL, NULL, NULL, NULL); + + while (url_ftell(pb) + 4 < len) { + int start_off = url_ftell(pb); + + mflags = get_byte(pb); + if (mflags & 0x80) + flags |= RTP_FLAG_KEY; + len_off = get_be24(pb); + if (mflags & 0x20) /**< relative timestamp */ + url_fskip(pb, 4); + if (mflags & 0x10) /**< has duration */ + url_fskip(pb, 4); + if (mflags & 0x8) /**< has location ID */ + url_fskip(pb, 4); + off = url_ftell(pb); + + if (!(mflags & 0x40)) { + /** + * If 0x40 is not set, the len_off field specifies an offset + * of this packet's payload data in the complete (reassembled) + * ASF packet. This is used to spread one ASF packet over + * multiple RTP packets. + */ + if (asf->pktbuf && len_off != url_ftell(asf->pktbuf)) { + uint8_t *p; + url_close_dyn_buf(asf->pktbuf, &p); + asf->pktbuf = NULL; + av_free(p); + } + if (!len_off && !asf->pktbuf && + (res = url_open_dyn_buf(&asf->pktbuf)) < 0) + return res; + if (!asf->pktbuf) + return AVERROR(EIO); + + put_buffer(asf->pktbuf, buf + off, len - off); + url_fskip(pb, len - off); + if (!(flags & RTP_FLAG_MARKER)) + return -1; + out_len = url_close_dyn_buf(asf->pktbuf, &asf->buf); + asf->pktbuf = NULL; + } else { + /** + * If 0x40 is set, the len_off field specifies the length of + * the next ASF packet that can be read from this payload + * data alone. This is commonly the same as the payload size, + * but could be less in case of packet splitting (i.e. + * multiple ASF packets in one RTP packet). + */ + + int cur_len = start_off + len_off - off; + int prev_len = out_len; + out_len += cur_len; + asf->buf = av_realloc(asf->buf, out_len); + memcpy(asf->buf + prev_len, buf + off, + FFMIN(cur_len, len - off)); + url_fskip(pb, cur_len); + } + } + + init_packetizer(pb, asf->buf, out_len); + pb->pos += rt->asf_pb_pos; + pb->eof_reached = 0; + rt->asf_ctx->pb = pb; + } + + for (;;) { + int i; + + res = av_read_packet(rt->asf_ctx, pkt); + rt->asf_pb_pos = url_ftell(pb); + if (res != 0) + break; + for (i = 0; i < s->nb_streams; i++) { + if (s->streams[i]->id == rt->asf_ctx->streams[pkt->stream_index]->id) { + pkt->stream_index = i; + return 1; // FIXME: return 0 if last packet + } + } + av_free_packet(pkt); + } + + return res == 1 ? -1 : res; +} + +static PayloadContext *asfrtp_new_context(void) +{ + return av_mallocz(sizeof(PayloadContext)); +} + +static void asfrtp_free_context(PayloadContext *asf) +{ + if (asf->pktbuf) { + uint8_t *p = NULL; + url_close_dyn_buf(asf->pktbuf, &p); + asf->pktbuf = NULL; + av_free(p); + } + av_freep(&asf->buf); + av_free(asf); +} + +#define RTP_ASF_HANDLER(n, s, t) \ +RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler = { \ + .enc_name = s, \ + .codec_type = t, \ + .codec_id = CODEC_ID_NONE, \ + .parse_sdp_a_line = asfrtp_parse_sdp_line, \ + .open = asfrtp_new_context, \ + .close = asfrtp_free_context, \ + .parse_packet = asfrtp_parse_packet, \ +}; + +RTP_ASF_HANDLER(asf_pfv, "x-asf-pf", AVMEDIA_TYPE_VIDEO); +RTP_ASF_HANDLER(asf_pfa, "x-asf-pf", AVMEDIA_TYPE_AUDIO); diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_formats.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_formats.h new file mode 100644 index 00000000..16f5a9d3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_formats.h @@ -0,0 +1,55 @@ +/* + * RTP depacketizer declarations + * Copyright (c) 2010 Martin Storsjo + * + * 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 + */ + +#ifndef AVFORMAT_RTPDEC_FORMATS_H +#define AVFORMAT_RTPDEC_FORMATS_H + +#include "rtpdec.h" + +/** + * Parse a Windows Media Server-specific SDP line + * + * @param s RTSP demux context + */ +int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p); + +extern RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler; +extern RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler; +extern RTPDynamicProtocolHandler ff_h263_1998_dynamic_handler; +extern RTPDynamicProtocolHandler ff_h263_2000_dynamic_handler; +extern RTPDynamicProtocolHandler ff_h264_dynamic_handler; +extern RTPDynamicProtocolHandler ff_mp4a_latm_dynamic_handler; +extern RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler; +extern RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler; +extern RTPDynamicProtocolHandler ff_ms_rtp_asf_pfa_handler; +extern RTPDynamicProtocolHandler ff_ms_rtp_asf_pfv_handler; +extern RTPDynamicProtocolHandler ff_qcelp_dynamic_handler; +extern RTPDynamicProtocolHandler ff_qdm2_dynamic_handler; +extern RTPDynamicProtocolHandler ff_qt_rtp_aud_handler; +extern RTPDynamicProtocolHandler ff_qt_rtp_vid_handler; +extern RTPDynamicProtocolHandler ff_quicktime_rtp_aud_handler; +extern RTPDynamicProtocolHandler ff_quicktime_rtp_vid_handler; +extern RTPDynamicProtocolHandler ff_svq3_dynamic_handler; +extern RTPDynamicProtocolHandler ff_theora_dynamic_handler; +extern RTPDynamicProtocolHandler ff_vorbis_dynamic_handler; +extern RTPDynamicProtocolHandler ff_vp8_dynamic_handler; + +#endif /* AVFORMAT_RTPDEC_FORMATS_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_h263.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_h263.c new file mode 100644 index 00000000..ea42fff3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_h263.c @@ -0,0 +1,108 @@ +/* + * RTP H.263 Depacketizer, RFC 4629 + * Copyright (c) 2010 Martin Storsjo + * + * 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 + */ + +#include "avformat.h" +#include "rtpdec_formats.h" +#include "libavutil/intreadwrite.h" + +static int h263_handle_packet(AVFormatContext *ctx, + PayloadContext *data, + AVStream *st, + AVPacket * pkt, + uint32_t * timestamp, + const uint8_t * buf, + int len, int flags) +{ + uint8_t *ptr; + uint16_t header; + int startcode, vrc, picture_header; + + if (len < 2) { + av_log(ctx, AV_LOG_ERROR, "Too short H.263 RTP packet\n"); + return AVERROR_INVALIDDATA; + } + + /* Decode the 16 bit H.263+ payload header, as described in section + * 5.1 of RFC 4629. The fields of this header are: + * - 5 reserved bits, should be ignored. + * - One bit (P, startcode), indicating a picture start, picture segment + * start or video sequence end. If set, two zero bytes should be + * prepended to the payload. + * - One bit (V, vrc), indicating the presence of an 8 bit Video + * Redundancy Coding field after this 16 bit header. + * - 6 bits (PLEN, picture_header), the length (in bytes) of an extra + * picture header, following the VRC field. + * - 3 bits (PEBIT), the number of bits to ignore of the last byte + * of the extra picture header. (Not used at the moment.) + */ + header = AV_RB16(buf); + startcode = (header & 0x0400) >> 9; + vrc = header & 0x0200; + picture_header = (header & 0x01f8) >> 3; + buf += 2; + len -= 2; + + if (vrc) { + /* Skip VRC header if present, not used at the moment. */ + buf += 1; + len -= 1; + } + if (picture_header) { + /* Skip extra picture header if present, not used at the moment. */ + buf += picture_header; + len -= picture_header; + } + + if (len < 0) { + av_log(ctx, AV_LOG_ERROR, "Too short H.263 RTP packet\n"); + return AVERROR_INVALIDDATA; + } + + if (av_new_packet(pkt, len + startcode)) { + av_log(ctx, AV_LOG_ERROR, "Out of memory\n"); + return AVERROR(ENOMEM); + } + pkt->stream_index = st->index; + ptr = pkt->data; + + if (startcode) { + *ptr++ = 0; + *ptr++ = 0; + } + memcpy(ptr, buf, len); + + return 0; +} + +RTPDynamicProtocolHandler ff_h263_1998_dynamic_handler = { + .enc_name = "H263-1998", + .codec_type = AVMEDIA_TYPE_VIDEO, + .codec_id = CODEC_ID_H263, + .parse_packet = h263_handle_packet, +}; + +RTPDynamicProtocolHandler ff_h263_2000_dynamic_handler = { + .enc_name = "H263-2000", + .codec_type = AVMEDIA_TYPE_VIDEO, + .codec_id = CODEC_ID_H263, + .parse_packet = h263_handle_packet, +}; + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_h264.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_h264.c new file mode 100644 index 00000000..75db14c1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_h264.c @@ -0,0 +1,404 @@ +/* + * RTP H264 Protocol (RFC3984) + * Copyright (c) 2006 Ryan Martell + * + * 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 + * @brief H.264 / RTP Code (RFC3984) + * @author Ryan Martell + * + * @note Notes: + * Notes: + * This currently supports packetization mode: + * Single Nal Unit Mode (0), or + * Non-Interleaved Mode (1). It currently does not support + * Interleaved Mode (2). (This requires implementing STAP-B, MTAP16, MTAP24, FU-B packet types) + * + * @note TODO: + * 1) RTCP sender reports for udp streams are required.. + * + */ + +#include "libavutil/base64.h" +#include "libavutil/avstring.h" +#include "libavcodec/get_bits.h" +#include "avformat.h" +#include "mpegts.h" + +#include +#include "network.h" +#include + +#include "rtpdec.h" +#include "rtpdec_formats.h" + +/** + RTP/H264 specific private data. +*/ +struct PayloadContext { + unsigned long cookie; ///< sanity check, to make sure we get the pointer we're expecting. + + //sdp setup parameters + uint8_t profile_idc; ///< from the sdp setup parameters. + uint8_t profile_iop; ///< from the sdp setup parameters. + uint8_t level_idc; ///< from the sdp setup parameters. + int packetization_mode; ///< from the sdp setup parameters. +#ifdef DEBUG + int packet_types_received[32]; +#endif +}; + +#define MAGIC_COOKIE (0xdeadbeef) ///< Cookie for the extradata; to verify we are what we think we are, and that we haven't been freed. +#define DEAD_COOKIE (0xdeaddead) ///< Cookie for the extradata; once it is freed. + +/* ---------------- private code */ +static int sdp_parse_fmtp_config_h264(AVStream * stream, + PayloadContext * h264_data, + char *attr, char *value) +{ + AVCodecContext *codec = stream->codec; + assert(codec->codec_id == CODEC_ID_H264); + assert(h264_data != NULL); + + if (!strcmp(attr, "packetization-mode")) { + av_log(codec, AV_LOG_DEBUG, "RTP Packetization Mode: %d\n", atoi(value)); + h264_data->packetization_mode = atoi(value); + /* + Packetization Mode: + 0 or not present: Single NAL mode (Only nals from 1-23 are allowed) + 1: Non-interleaved Mode: 1-23, 24 (STAP-A), 28 (FU-A) are allowed. + 2: Interleaved Mode: 25 (STAP-B), 26 (MTAP16), 27 (MTAP24), 28 (FU-A), and 29 (FU-B) are allowed. + */ + if (h264_data->packetization_mode > 1) + av_log(codec, AV_LOG_ERROR, + "Interleaved RTP mode is not supported yet."); + } else if (!strcmp(attr, "profile-level-id")) { + if (strlen(value) == 6) { + char buffer[3]; + // 6 characters=3 bytes, in hex. + uint8_t profile_idc; + uint8_t profile_iop; + uint8_t level_idc; + + buffer[0] = value[0]; buffer[1] = value[1]; buffer[2] = '\0'; + profile_idc = strtol(buffer, NULL, 16); + buffer[0] = value[2]; buffer[1] = value[3]; + profile_iop = strtol(buffer, NULL, 16); + buffer[0] = value[4]; buffer[1] = value[5]; + level_idc = strtol(buffer, NULL, 16); + + // set the parameters... + av_log(codec, AV_LOG_DEBUG, + "RTP Profile IDC: %x Profile IOP: %x Level: %x\n", + profile_idc, profile_iop, level_idc); + h264_data->profile_idc = profile_idc; + h264_data->profile_iop = profile_iop; + h264_data->level_idc = level_idc; + } + } else if (!strcmp(attr, "sprop-parameter-sets")) { + uint8_t start_sequence[]= { 0, 0, 1 }; + codec->extradata_size= 0; + codec->extradata= NULL; + + while (*value) { + char base64packet[1024]; + uint8_t decoded_packet[1024]; + int packet_size; + char *dst = base64packet; + + while (*value && *value != ',' + && (dst - base64packet) < sizeof(base64packet) - 1) { + *dst++ = *value++; + } + *dst++ = '\0'; + + if (*value == ',') + value++; + + packet_size= av_base64_decode(decoded_packet, base64packet, sizeof(decoded_packet)); + if (packet_size > 0) { + uint8_t *dest = av_malloc(packet_size + sizeof(start_sequence) + + codec->extradata_size + + FF_INPUT_BUFFER_PADDING_SIZE); + if(dest) + { + if(codec->extradata_size) + { + // av_realloc? + memcpy(dest, codec->extradata, codec->extradata_size); + av_free(codec->extradata); + } + + memcpy(dest+codec->extradata_size, start_sequence, sizeof(start_sequence)); + memcpy(dest+codec->extradata_size+sizeof(start_sequence), decoded_packet, packet_size); + memset(dest+codec->extradata_size+sizeof(start_sequence)+ + packet_size, 0, FF_INPUT_BUFFER_PADDING_SIZE); + + codec->extradata= dest; + codec->extradata_size+= sizeof(start_sequence)+packet_size; + } else { + av_log(codec, AV_LOG_ERROR, "Unable to allocate memory for extradata!"); + return AVERROR(ENOMEM); + } + } + } + av_log(codec, AV_LOG_DEBUG, "Extradata set to %p (size: %d)!", codec->extradata, codec->extradata_size); + } + return 0; +} + +// return 0 on packet, no more left, 1 on packet, 1 on partial packet... +static int h264_handle_packet(AVFormatContext *ctx, + PayloadContext *data, + AVStream *st, + AVPacket * pkt, + uint32_t * timestamp, + const uint8_t * buf, + int len, int flags) +{ + uint8_t nal = buf[0]; + uint8_t type = (nal & 0x1f); + int result= 0; + uint8_t start_sequence[]= {0, 0, 1}; + +#ifdef DEBUG + assert(data); + assert(data->cookie == MAGIC_COOKIE); +#endif + assert(buf); + + if (type >= 1 && type <= 23) + type = 1; // simplify the case. (these are all the nal types used internally by the h264 codec) + switch (type) { + case 0: // undefined, but pass them through + case 1: + av_new_packet(pkt, len+sizeof(start_sequence)); + memcpy(pkt->data, start_sequence, sizeof(start_sequence)); + memcpy(pkt->data+sizeof(start_sequence), buf, len); +#ifdef DEBUG + data->packet_types_received[nal & 0x1f]++; +#endif + break; + + case 24: // STAP-A (one packet, multiple nals) + // consume the STAP-A NAL + buf++; + len--; + // first we are going to figure out the total size.... + { + int pass= 0; + int total_length= 0; + uint8_t *dst= NULL; + + for(pass= 0; pass<2; pass++) { + const uint8_t *src= buf; + int src_len= len; + + do { + uint16_t nal_size = AV_RB16(src); // this going to be a problem if unaligned (can it be?) + + // consume the length of the aggregate... + src += 2; + src_len -= 2; + + if (nal_size <= src_len) { + if(pass==0) { + // counting... + total_length+= sizeof(start_sequence)+nal_size; + } else { + // copying + assert(dst); + memcpy(dst, start_sequence, sizeof(start_sequence)); + dst+= sizeof(start_sequence); + memcpy(dst, src, nal_size); +#ifdef DEBUG + data->packet_types_received[*src & 0x1f]++; +#endif + dst+= nal_size; + } + } else { + av_log(ctx, AV_LOG_ERROR, + "nal size exceeds length: %d %d\n", nal_size, src_len); + } + + // eat what we handled... + src += nal_size; + src_len -= nal_size; + + if (src_len < 0) + av_log(ctx, AV_LOG_ERROR, + "Consumed more bytes than we got! (%d)\n", src_len); + } while (src_len > 2); // because there could be rtp padding.. + + if(pass==0) { + // now we know the total size of the packet (with the start sequences added) + av_new_packet(pkt, total_length); + dst= pkt->data; + } else { + assert(dst-pkt->data==total_length); + } + } + } + break; + + case 25: // STAP-B + case 26: // MTAP-16 + case 27: // MTAP-24 + case 29: // FU-B + av_log(ctx, AV_LOG_ERROR, + "Unhandled type (%d) (See RFC for implementation details\n", + type); + result= -1; + break; + + case 28: // FU-A (fragmented nal) + buf++; + len--; // skip the fu_indicator + { + // these are the same as above, we just redo them here for clarity... + uint8_t fu_indicator = nal; + uint8_t fu_header = *buf; // read the fu_header. + uint8_t start_bit = fu_header >> 7; +// uint8_t end_bit = (fu_header & 0x40) >> 6; + uint8_t nal_type = (fu_header & 0x1f); + uint8_t reconstructed_nal; + + // reconstruct this packet's true nal; only the data follows.. + reconstructed_nal = fu_indicator & (0xe0); // the original nal forbidden bit and NRI are stored in this packet's nal; + reconstructed_nal |= nal_type; + + // skip the fu_header... + buf++; + len--; + +#ifdef DEBUG + if (start_bit) + data->packet_types_received[nal_type]++; +#endif + if(start_bit) { + // copy in the start sequence, and the reconstructed nal.... + av_new_packet(pkt, sizeof(start_sequence)+sizeof(nal)+len); + memcpy(pkt->data, start_sequence, sizeof(start_sequence)); + pkt->data[sizeof(start_sequence)]= reconstructed_nal; + memcpy(pkt->data+sizeof(start_sequence)+sizeof(nal), buf, len); + } else { + av_new_packet(pkt, len); + memcpy(pkt->data, buf, len); + } + } + break; + + case 30: // undefined + case 31: // undefined + default: + av_log(ctx, AV_LOG_ERROR, "Undefined type (%d)", type); + result= -1; + break; + } + + pkt->stream_index = st->index; + + return result; +} + +/* ---------------- public code */ +static PayloadContext *h264_new_context(void) +{ + PayloadContext *data = + av_mallocz(sizeof(PayloadContext) + + FF_INPUT_BUFFER_PADDING_SIZE); + + if (data) { + data->cookie = MAGIC_COOKIE; + } + + return data; +} + +static void h264_free_context(PayloadContext *data) +{ +#ifdef DEBUG + int ii; + + for (ii = 0; ii < 32; ii++) { + if (data->packet_types_received[ii]) + av_log(NULL, AV_LOG_DEBUG, "Received %d packets of type %d\n", + data->packet_types_received[ii], ii); + } +#endif + + assert(data); + assert(data->cookie == MAGIC_COOKIE); + + // avoid stale pointers (assert) + data->cookie = DEAD_COOKIE; + + // and clear out this... + av_free(data); +} + +static int parse_h264_sdp_line(AVFormatContext *s, int st_index, + PayloadContext *h264_data, const char *line) +{ + AVStream *stream = s->streams[st_index]; + AVCodecContext *codec = stream->codec; + const char *p = line; + + assert(h264_data->cookie == MAGIC_COOKIE); + + if (av_strstart(p, "framesize:", &p)) { + char buf1[50]; + char *dst = buf1; + + // remove the protocol identifier.. + while (*p && *p == ' ') p++; // strip spaces. + while (*p && *p != ' ') p++; // eat protocol identifier + while (*p && *p == ' ') p++; // strip trailing spaces. + while (*p && *p != '-' && (dst - buf1) < sizeof(buf1) - 1) { + *dst++ = *p++; + } + *dst = '\0'; + + // a='framesize:96 320-240' + // set our parameters.. + codec->width = atoi(buf1); + codec->height = atoi(p + 1); // skip the - + codec->pix_fmt = PIX_FMT_YUV420P; + } else if (av_strstart(p, "fmtp:", &p)) { + return ff_parse_fmtp(stream, h264_data, p, sdp_parse_fmtp_config_h264); + } else if (av_strstart(p, "cliprect:", &p)) { + // could use this if we wanted. + } + + return 0; // keep processing it the normal way... +} + +/** +This is the structure for expanding on the dynamic rtp protocols (makes everything static. yay!) +*/ +RTPDynamicProtocolHandler ff_h264_dynamic_handler = { + .enc_name = "H264", + .codec_type = AVMEDIA_TYPE_VIDEO, + .codec_id = CODEC_ID_H264, + .parse_sdp_a_line = parse_h264_sdp_line, + .open = h264_new_context, + .close = h264_free_context, + .parse_packet = h264_handle_packet +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_latm.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_latm.c new file mode 100644 index 00000000..8ed42a7a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_latm.c @@ -0,0 +1,187 @@ +/** + * RTP Depacketization of MP4A-LATM, RFC 3016 + * Copyright (c) 2010 Martin Storsjo + * + * 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 + */ + +#include "rtpdec_formats.h" +#include "internal.h" +#include "libavutil/avstring.h" +#include "libavcodec/get_bits.h" +#include + +struct PayloadContext { + ByteIOContext *dyn_buf; + uint8_t *buf; + int pos, len; + uint32_t timestamp; +}; + +static PayloadContext *latm_new_context(void) +{ + return av_mallocz(sizeof(PayloadContext)); +} + +static void latm_free_context(PayloadContext *data) +{ + if (!data) + return; + if (data->dyn_buf) { + uint8_t *p; + url_close_dyn_buf(data->dyn_buf, &p); + av_free(p); + } + av_free(data->buf); + av_free(data); +} + +static int latm_parse_packet(AVFormatContext *ctx, PayloadContext *data, + AVStream *st, AVPacket *pkt, uint32_t *timestamp, + const uint8_t *buf, int len, int flags) +{ + int ret, cur_len; + + if (buf) { + if (!data->dyn_buf || data->timestamp != *timestamp) { + av_freep(&data->buf); + if (data->dyn_buf) + url_close_dyn_buf(data->dyn_buf, &data->buf); + data->dyn_buf = NULL; + av_freep(&data->buf); + + data->timestamp = *timestamp; + if ((ret = url_open_dyn_buf(&data->dyn_buf)) < 0) + return ret; + } + put_buffer(data->dyn_buf, buf, len); + + if (!(flags & RTP_FLAG_MARKER)) + return AVERROR(EAGAIN); + av_free(data->buf); + data->len = url_close_dyn_buf(data->dyn_buf, &data->buf); + data->dyn_buf = NULL; + data->pos = 0; + } + + if (!data->buf) { + av_log(ctx, AV_LOG_ERROR, "No data available yet\n"); + return AVERROR(EIO); + } + + cur_len = 0; + while (data->pos < data->len) { + uint8_t val = data->buf[data->pos++]; + cur_len += val; + if (val != 0xff) + break; + } + if (data->pos + cur_len > data->len) { + av_log(ctx, AV_LOG_ERROR, "Malformed LATM packet\n"); + return AVERROR(EIO); + } + + if ((ret = av_new_packet(pkt, cur_len)) < 0) + return ret; + memcpy(pkt->data, data->buf + data->pos, cur_len); + data->pos += cur_len; + pkt->stream_index = st->index; + return data->pos < data->len; +} + +static int parse_fmtp_config(AVStream *st, char *value) +{ + int len = ff_hex_to_data(NULL, value), i, ret = 0; + GetBitContext gb; + uint8_t *config; + int audio_mux_version, same_time_framing, num_sub_frames, + num_programs, num_layers; + + /* Pad this buffer, too, to avoid out of bounds reads with get_bits below */ + config = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE); + if (!config) + return AVERROR(ENOMEM); + ff_hex_to_data(config, value); + init_get_bits(&gb, config, len*8); + audio_mux_version = get_bits(&gb, 1); + same_time_framing = get_bits(&gb, 1); + num_sub_frames = get_bits(&gb, 6); + num_programs = get_bits(&gb, 4); + num_layers = get_bits(&gb, 3); + if (audio_mux_version != 0 || same_time_framing != 1 || num_programs != 0 || + num_layers != 0) { + av_log(NULL, AV_LOG_WARNING, "Unsupported LATM config (%d,%d,%d,%d)\n", + audio_mux_version, same_time_framing, + num_programs, num_layers); + ret = AVERROR_PATCHWELCOME; + goto end; + } + av_freep(&st->codec->extradata); + st->codec->extradata_size = (get_bits_left(&gb) + 7)/8; + st->codec->extradata = av_mallocz(st->codec->extradata_size + + FF_INPUT_BUFFER_PADDING_SIZE); + if (!st->codec->extradata) { + ret = AVERROR(ENOMEM); + goto end; + } + for (i = 0; i < st->codec->extradata_size; i++) + st->codec->extradata[i] = get_bits(&gb, 8); + +end: + av_free(config); + return ret; +} + +static int parse_fmtp(AVStream *stream, PayloadContext *data, + char *attr, char *value) +{ + int res; + + if (!strcmp(attr, "config")) { + res = parse_fmtp_config(stream, value); + if (res < 0) + return res; + } else if (!strcmp(attr, "cpresent")) { + int cpresent = atoi(value); + if (cpresent != 0) + av_log_missing_feature(NULL, "RTP MP4A-LATM with in-band " + "configuration", 1); + } + + return 0; +} + +static int latm_parse_sdp_line(AVFormatContext *s, int st_index, + PayloadContext *data, const char *line) +{ + const char *p; + + if (av_strstart(line, "fmtp:", &p)) + return ff_parse_fmtp(s->streams[st_index], data, p, parse_fmtp); + + return 0; +} + +RTPDynamicProtocolHandler ff_mp4a_latm_dynamic_handler = { + .enc_name = "MP4A-LATM", + .codec_type = AVMEDIA_TYPE_AUDIO, + .codec_id = CODEC_ID_AAC, + .parse_sdp_a_line = latm_parse_sdp_line, + .open = latm_new_context, + .close = latm_free_context, + .parse_packet = latm_parse_packet +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_mpeg4.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_mpeg4.c new file mode 100644 index 00000000..137dbd26 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_mpeg4.c @@ -0,0 +1,252 @@ +/** + * Common code for the RTP depacketization of MPEG-4 formats. + * Copyright (c) 2010 Fabrice Bellard + * Romain Degez + * + * 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 + * @brief MPEG4 / RTP Code + * @author Fabrice Bellard + * @author Romain Degez + */ + +#include "rtpdec_formats.h" +#include "internal.h" +#include "libavutil/avstring.h" +#include "libavcodec/get_bits.h" +#include + +/** Structure listing useful vars to parse RTP packet payload*/ +struct PayloadContext +{ + int sizelength; + int indexlength; + int indexdeltalength; + int profile_level_id; + int streamtype; + int objecttype; + char *mode; + + /** mpeg 4 AU headers */ + struct AUHeaders { + int size; + int index; + int cts_flag; + int cts; + int dts_flag; + int dts; + int rap_flag; + int streamstate; + } *au_headers; + int au_headers_allocated; + int nb_au_headers; + int au_headers_length_bytes; + int cur_au_index; +}; + +typedef struct { + const char *str; + uint16_t type; + uint32_t offset; +} AttrNameMap; + +/* All known fmtp parameters and the corresponding RTPAttrTypeEnum */ +#define ATTR_NAME_TYPE_INT 0 +#define ATTR_NAME_TYPE_STR 1 +static const AttrNameMap attr_names[]= +{ + { "SizeLength", ATTR_NAME_TYPE_INT, + offsetof(PayloadContext, sizelength) }, + { "IndexLength", ATTR_NAME_TYPE_INT, + offsetof(PayloadContext, indexlength) }, + { "IndexDeltaLength", ATTR_NAME_TYPE_INT, + offsetof(PayloadContext, indexdeltalength) }, + { "profile-level-id", ATTR_NAME_TYPE_INT, + offsetof(PayloadContext, profile_level_id) }, + { "StreamType", ATTR_NAME_TYPE_INT, + offsetof(PayloadContext, streamtype) }, + { "mode", ATTR_NAME_TYPE_STR, + offsetof(PayloadContext, mode) }, + { NULL, -1, -1 }, +}; + +static PayloadContext *new_context(void) +{ + return av_mallocz(sizeof(PayloadContext)); +} + +static void free_context(PayloadContext * data) +{ + int i; + for (i = 0; i < data->nb_au_headers; i++) { + /* according to rtp_parse_mp4_au, we treat multiple + * au headers as one, so nb_au_headers is always 1. + * loop anyway in case this changes. + * (note: changes done carelessly might lead to a double free) + */ + av_free(&data->au_headers[i]); + } + av_free(data->mode); + av_free(data); +} + +static int parse_fmtp_config(AVCodecContext * codec, char *value) +{ + /* decode the hexa encoded parameter */ + int len = ff_hex_to_data(NULL, value); + if (codec->extradata) + av_free(codec->extradata); + codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE); + if (!codec->extradata) + return AVERROR(ENOMEM); + codec->extradata_size = len; + ff_hex_to_data(codec->extradata, value); + return 0; +} + +static int rtp_parse_mp4_au(PayloadContext *data, const uint8_t *buf) +{ + int au_headers_length, au_header_size, i; + GetBitContext getbitcontext; + + /* decode the first 2 bytes where the AUHeader sections are stored + length in bits */ + au_headers_length = AV_RB16(buf); + + if (au_headers_length > RTP_MAX_PACKET_LENGTH) + return -1; + + data->au_headers_length_bytes = (au_headers_length + 7) / 8; + + /* skip AU headers length section (2 bytes) */ + buf += 2; + + init_get_bits(&getbitcontext, buf, data->au_headers_length_bytes * 8); + + /* XXX: Wrong if optionnal additional sections are present (cts, dts etc...) */ + au_header_size = data->sizelength + data->indexlength; + if (au_header_size <= 0 || (au_headers_length % au_header_size != 0)) + return -1; + + data->nb_au_headers = au_headers_length / au_header_size; + if (!data->au_headers || data->au_headers_allocated < data->nb_au_headers) { + av_free(data->au_headers); + data->au_headers = av_malloc(sizeof(struct AUHeaders) * data->nb_au_headers); + data->au_headers_allocated = data->nb_au_headers; + } + + /* XXX: We handle multiple AU Section as only one (need to fix this for interleaving) + In my test, the FAAD decoder does not behave correctly when sending each AU one by one + but does when sending the whole as one big packet... */ + data->au_headers[0].size = 0; + data->au_headers[0].index = 0; + for (i = 0; i < data->nb_au_headers; ++i) { + data->au_headers[0].size += get_bits_long(&getbitcontext, data->sizelength); + data->au_headers[0].index = get_bits_long(&getbitcontext, data->indexlength); + } + + data->nb_au_headers = 1; + + return 0; +} + + +/* Follows RFC 3640 */ +static int aac_parse_packet(AVFormatContext *ctx, + PayloadContext *data, + AVStream *st, + AVPacket *pkt, + uint32_t *timestamp, + const uint8_t *buf, int len, int flags) +{ + if (rtp_parse_mp4_au(data, buf)) + return -1; + + buf += data->au_headers_length_bytes + 2; + len -= data->au_headers_length_bytes + 2; + + /* XXX: Fixme we only handle the case where rtp_parse_mp4_au define + one au_header */ + av_new_packet(pkt, data->au_headers[0].size); + memcpy(pkt->data, buf, data->au_headers[0].size); + + pkt->stream_index = st->index; + return 0; +} + +static int parse_fmtp(AVStream *stream, PayloadContext *data, + char *attr, char *value) +{ + AVCodecContext *codec = stream->codec; + int res, i; + + if (!strcmp(attr, "config")) { + res = parse_fmtp_config(codec, value); + + if (res < 0) + return res; + } + + if (codec->codec_id == CODEC_ID_AAC) { + /* Looking for a known attribute */ + for (i = 0; attr_names[i].str; ++i) { + if (!strcasecmp(attr, attr_names[i].str)) { + if (attr_names[i].type == ATTR_NAME_TYPE_INT) { + *(int *)((char *)data+ + attr_names[i].offset) = atoi(value); + } else if (attr_names[i].type == ATTR_NAME_TYPE_STR) + *(char **)((char *)data+ + attr_names[i].offset) = av_strdup(value); + } + } + } + return 0; +} + +static int parse_sdp_line(AVFormatContext *s, int st_index, + PayloadContext *data, const char *line) +{ + const char *p; + + if (av_strstart(line, "fmtp:", &p)) + return ff_parse_fmtp(s->streams[st_index], data, p, parse_fmtp); + + return 0; +} + +RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler = { + .enc_name = "MP4V-ES", + .codec_type = AVMEDIA_TYPE_VIDEO, + .codec_id = CODEC_ID_MPEG4, + .parse_sdp_a_line = parse_sdp_line, + .open = NULL, + .close = NULL, + .parse_packet = NULL +}; + +RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler = { + .enc_name = "mpeg4-generic", + .codec_type = AVMEDIA_TYPE_AUDIO, + .codec_id = CODEC_ID_AAC, + .parse_sdp_a_line = parse_sdp_line, + .open = new_context, + .close = free_context, + .parse_packet = aac_parse_packet +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_qcelp.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_qcelp.c new file mode 100644 index 00000000..ceae5042 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_qcelp.c @@ -0,0 +1,229 @@ +/** + * RTP Depacketization of QCELP/PureVoice, RFC 2658 + * Copyright (c) 2010 Martin Storsjo + * + * 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 + */ + +#include "rtpdec_formats.h" + +static const uint8_t frame_sizes[] = { + 1, 4, 8, 17, 35 +}; + +typedef struct { + int pos; + int size; + /* The largest frame is 35 bytes, only 10 frames are allowed per + * packet, and we return the first one immediately, so allocate + * space for 9 frames */ + uint8_t data[35*9]; +} InterleavePacket; + +struct PayloadContext { + int interleave_size; + int interleave_index; + InterleavePacket group[6]; + int group_finished; + + /* The maximum packet size, 10 frames of 35 bytes each, and one + * packet header byte. */ + uint8_t next_data[1 + 35*10]; + int next_size; + uint32_t next_timestamp; +}; + +static PayloadContext *qcelp_new_context(void) +{ + return av_mallocz(sizeof(PayloadContext)); +} + +static void qcelp_free_context(PayloadContext *data) +{ + av_free(data); +} + +static int return_stored_frame(AVFormatContext *ctx, PayloadContext *data, + AVStream *st, AVPacket *pkt, uint32_t *timestamp, + const uint8_t *buf, int len); + +static int store_packet(AVFormatContext *ctx, PayloadContext *data, + AVStream *st, AVPacket *pkt, uint32_t *timestamp, + const uint8_t *buf, int len) +{ + int interleave_size, interleave_index; + int frame_size, ret; + InterleavePacket* ip; + + if (len < 2) + return AVERROR_INVALIDDATA; + + interleave_size = buf[0] >> 3 & 7; + interleave_index = buf[0] & 7; + + if (interleave_size > 5) { + av_log(ctx, AV_LOG_ERROR, "Invalid interleave size %d\n", + interleave_size); + return AVERROR_INVALIDDATA; + } + if (interleave_index > interleave_size) { + av_log(ctx, AV_LOG_ERROR, "Invalid interleave index %d/%d\n", + interleave_index, interleave_size); + return AVERROR_INVALIDDATA; + } + if (interleave_size != data->interleave_size) { + int i; + /* First packet, or changed interleave size */ + data->interleave_size = interleave_size; + data->interleave_index = 0; + for (i = 0; i < 6; i++) + data->group[i].size = 0; + } + + if (interleave_index < data->interleave_index) { + /* Wrapped around - missed the last packet of the previous group. */ + if (data->group_finished) { + /* No more data in the packets in this interleaving group, just + * start processing the next one */ + data->interleave_index = 0; + } else { + /* Stash away the current packet, emit everything we have of the + * previous group. */ + for (; data->interleave_index <= interleave_size; + data->interleave_index++) + data->group[data->interleave_index].size = 0; + + if (len > sizeof(data->next_data)) + return AVERROR_INVALIDDATA; + memcpy(data->next_data, buf, len); + data->next_size = len; + data->next_timestamp = *timestamp; + *timestamp = RTP_NOTS_VALUE; + + data->interleave_index = 0; + return return_stored_frame(ctx, data, st, pkt, timestamp, buf, len); + } + } + if (interleave_index > data->interleave_index) { + /* We missed a packet */ + for (; data->interleave_index < interleave_index; + data->interleave_index++) + data->group[data->interleave_index].size = 0; + } + data->interleave_index = interleave_index; + + if (buf[1] >= FF_ARRAY_ELEMS(frame_sizes)) + return AVERROR_INVALIDDATA; + frame_size = frame_sizes[buf[1]]; + if (1 + frame_size > len) + return AVERROR_INVALIDDATA; + + if (len - 1 - frame_size > sizeof(data->group[0].data)) + return AVERROR_INVALIDDATA; + + if ((ret = av_new_packet(pkt, frame_size)) < 0) + return ret; + memcpy(pkt->data, &buf[1], frame_size); + pkt->stream_index = st->index; + + ip = &data->group[data->interleave_index]; + ip->size = len - 1 - frame_size; + ip->pos = 0; + memcpy(ip->data, &buf[1 + frame_size], ip->size); + /* Each packet must contain the same number of frames according to the + * RFC. If there's no data left in this packet, there shouldn't be any + * in any of the other frames in the interleaving group either. */ + data->group_finished = ip->size == 0; + + if (interleave_index == interleave_size) { + data->interleave_index = 0; + return !data->group_finished; + } else { + data->interleave_index++; + return 0; + } +} + +static int return_stored_frame(AVFormatContext *ctx, PayloadContext *data, + AVStream *st, AVPacket *pkt, uint32_t *timestamp, + const uint8_t *buf, int len) +{ + InterleavePacket* ip = &data->group[data->interleave_index]; + int frame_size, ret; + + if (data->group_finished && data->interleave_index == 0) { + *timestamp = data->next_timestamp; + ret = store_packet(ctx, data, st, pkt, timestamp, data->next_data, + data->next_size); + data->next_size = 0; + return ret; + } + + if (ip->size == 0) { + /* No stored data for this interleave block, output an empty packet */ + if ((ret = av_new_packet(pkt, 1)) < 0) + return ret; + pkt->data[0] = 0; // Blank - could also be 14, Erasure + } else { + if (ip->pos >= ip->size) + return AVERROR_INVALIDDATA; + if (ip->data[ip->pos] >= FF_ARRAY_ELEMS(frame_sizes)) + return AVERROR_INVALIDDATA; + frame_size = frame_sizes[ip->data[ip->pos]]; + if (ip->pos + frame_size > ip->size) + return AVERROR_INVALIDDATA; + + if ((ret = av_new_packet(pkt, frame_size)) < 0) + return ret; + memcpy(pkt->data, &ip->data[ip->pos], frame_size); + + ip->pos += frame_size; + data->group_finished = ip->pos >= ip->size; + } + pkt->stream_index = st->index; + + if (data->interleave_index == data->interleave_size) { + data->interleave_index = 0; + if (!data->group_finished) + return 1; + else + return data->next_size > 0; + } else { + data->interleave_index++; + return 1; + } +} + +static int qcelp_parse_packet(AVFormatContext *ctx, PayloadContext *data, + AVStream *st, AVPacket *pkt, uint32_t *timestamp, + const uint8_t *buf, int len, int flags) +{ + if (buf) + return store_packet(ctx, data, st, pkt, timestamp, buf, len); + else + return return_stored_frame(ctx, data, st, pkt, timestamp, buf, len); +} + +RTPDynamicProtocolHandler ff_qcelp_dynamic_handler = { + .enc_name = "x-Purevoice", + .codec_type = AVMEDIA_TYPE_AUDIO, + .codec_id = CODEC_ID_QCELP, + .static_payload_id = 12, + .open = qcelp_new_context, + .close = qcelp_free_context, + .parse_packet = qcelp_parse_packet +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_qdm2.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_qdm2.c new file mode 100644 index 00000000..aa94b1f7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_qdm2.c @@ -0,0 +1,315 @@ +/* + * QDesign Music 2 (QDM2) payload for RTP + * Copyright (c) 2010 Ronald S. Bultje + * + * 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 + * @brief RTP support for the QDM2 payload (todo: wiki) + * @author Ronald S. Bultje + */ + +#include +#include "libavutil/intreadwrite.h" +#include "libavcodec/avcodec.h" +#include "rtp.h" +#include "rtpdec.h" +#include "rtpdec_formats.h" + +struct PayloadContext { + /** values read from the config header, used as packet headers */ + //@{ + int block_type; ///< superblock type, value 2 .. 8 + int block_size; ///< from extradata, used as pkt length + int subpkts_per_block; ///< max. nr. of subpackets to add per output buffer + //@} + + /** Temporary storage for superblock restoring, per packet ID (0x80 total) */ + //@{ + uint16_t len[0x80]; ///< how much the temporary buffer is filled + uint8_t buf[0x80][0x800]; ///< the temporary storage buffer + + unsigned int cache; ///< number of data packets that we have cached right now + unsigned int n_pkts; ///< number of RTP packets received since last packet output / config + uint32_t timestamp; ///< timestamp of next-to-be-returned packet + //@} +}; + +/** + * Parses configuration (basically the codec-specific extradata) from + * a RTP config subpacket (starts with 0xff). + * + * Layout of the config subpacket (in bytes): + * 1: 0xFF <- config ID + * then an array { + * 1: size <- of the current item + * 1: item type <- 0 .. 4 + * size-2: data <- data depends on the item type + * } + * + * Item 0 implies the end of the config subpacket, and has no data. + * Item 1 implies a stream configuration without extradata. + * Item 2 max. nr. of subpackets per superblock + * Item 3 superblock type for the stream + * Item 4 implies a stream configuration with extradata (size >= 0x1c). + * + * @return <0 on error, otherwise the number of bytes parsed from the + * input buffer. + */ +static int qdm2_parse_config(PayloadContext *qdm, AVStream *st, + const uint8_t *buf, const uint8_t *end) +{ + const uint8_t *p = buf; + + while (end - p >= 2) { + unsigned int item_len = p[0], config_item = p[1]; + + if (item_len < 2 || end - p < item_len || config_item > 4) + return AVERROR_INVALIDDATA; + + switch (config_item) { + case 0: /* end of config block */ + return p - buf + item_len; + case 1: /* stream without extradata */ + /* FIXME: set default qdm->block_size */ + break; + case 2: /**< subpackets per block */ + if (item_len < 3) + return AVERROR_INVALIDDATA; + qdm->subpkts_per_block = p[2]; + break; + case 3: /* superblock type */ + if (item_len < 4) + return AVERROR_INVALIDDATA; + qdm->block_type = AV_RB16(p + 2); + break; + case 4: /* stream with extradata */ + if (item_len < 30) + return AVERROR_INVALIDDATA; + av_freep(&st->codec->extradata); + st->codec->extradata_size = 26 + item_len; + if (!(st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE))) { + st->codec->extradata_size = 0; + return AVERROR(ENOMEM); + } + AV_WB32(st->codec->extradata, 12); + memcpy(st->codec->extradata + 4, "frma", 4); + memcpy(st->codec->extradata + 8, "QDM2", 4); + AV_WB32(st->codec->extradata + 12, 6 + item_len); + memcpy(st->codec->extradata + 16, "QDCA", 4); + memcpy(st->codec->extradata + 20, p + 2, item_len - 2); + AV_WB32(st->codec->extradata + 18 + item_len, 8); + AV_WB32(st->codec->extradata + 22 + item_len, 0); + + qdm->block_size = AV_RB32(p + 26); + break; + } + + p += item_len; + } + + return AVERROR(EAGAIN); /* not enough data */ +} + +/** + * Parses a single subpacket. We store this subpacket in an intermediate + * buffer (position depends on the ID (byte[0]). When called, at least + * 4 bytes are available for reading (see qdm2_parse_packet()). + * + * Layout of a single subpacket (RTP packets commonly contain multiple + * such subpackets) - length in bytes: + * 1: ordering ID <- 0 .. 0x7F + * 1: subpacket type <- 0 .. 0x7F; value & 0x80 means subpacket length = 2 bytes, else 1 byte + * 1/2: subpacket length <- length of the data following the flags/length fields + * if (subpacket type & 0x7F) == 0x7F + * 1: subpacket type, higher bits + * size: subpacket data + * + * The subpackets come in randomly, and should be encapsulated into 1 + * or more superblocks (containing qdm->subpkts_per_block subpackets + * each) per RTP packet, in order of ascending "ordering ID", see + * qdm2_restore_block(). + * + * @return <0 on error, otherwise the number of bytes parsed from the + * input buffer. + */ +static int qdm2_parse_subpacket(PayloadContext *qdm, AVStream *st, + const uint8_t *buf, const uint8_t *end) +{ + const uint8_t *p = buf; + unsigned int id, len, type, to_copy; + + /* parse header so we know the size of the header/data */ + id = *p++; + type = *p++; + if (type & 0x80) { + len = AV_RB16(p); + p += 2; + type &= 0x7F; + } else + len = *p++; + + if (end - p < len + (type == 0x7F) || id >= 0x80) + return AVERROR_INVALIDDATA; + if (type == 0x7F) + type |= *p++ << 8; + + /* copy data into a temporary buffer */ + to_copy = FFMIN(len + (p - &buf[1]), 0x800 - qdm->len[id]); + memcpy(&qdm->buf[id][qdm->len[id]], buf + 1, to_copy); + qdm->len[id] += to_copy; + + return p + len - buf; +} + +/** + * Adds a superblock header around a set of subpackets. + * + * @return <0 on error, else 0. + */ +static int qdm2_restore_block(PayloadContext *qdm, AVStream *st, AVPacket *pkt) +{ + int to_copy, n, res, include_csum; + uint8_t *p, *csum_pos = NULL; + + /* create packet to hold subpkts into a superblock */ + assert(qdm->cache > 0); + for (n = 0; n < 0x80; n++) + if (qdm->len[n] > 0) + break; + assert(n < 0x80); + + if ((res = av_new_packet(pkt, qdm->block_size)) < 0) + return res; + memset(pkt->data, 0, pkt->size); + pkt->stream_index = st->index; + p = pkt->data; + + /* superblock header */ + if (qdm->len[n] > 0xff) { + *p++ = qdm->block_type | 0x80; + AV_WB16(p, qdm->len[n]); + p += 2; + } else { + *p++ = qdm->block_type; + *p++ = qdm->len[n]; + } + if ((include_csum = (qdm->block_type == 2 || qdm->block_type == 4))) { + csum_pos = p; + p += 2; + } + + /* subpacket data */ + to_copy = FFMIN(qdm->len[n], pkt->size - (p - pkt->data)); + memcpy(p, qdm->buf[n], to_copy); + qdm->len[n] = 0; + + /* checksum header */ + if (include_csum) { + unsigned int total = 0; + uint8_t *q; + + for (q = pkt->data; q < &pkt->data[qdm->block_size]; q++) + total += *q; + AV_WB16(csum_pos, (uint16_t) total); + } + + return 0; +} + +/** return 0 on packet, no more left, 1 on packet, -1 on partial packet... */ +static int qdm2_parse_packet(AVFormatContext *s, PayloadContext *qdm, + AVStream *st, AVPacket *pkt, + uint32_t *timestamp, + const uint8_t *buf, int len, int flags) +{ + int res = AVERROR_INVALIDDATA, n; + const uint8_t *end = buf + len, *p = buf; + + if (len > 0) { + if (len < 2) + return AVERROR_INVALIDDATA; + + /* configuration block */ + if (*p == 0xff) { + if (qdm->n_pkts > 0) { + av_log(s, AV_LOG_WARNING, + "Out of sequence config - dropping queue\n"); + qdm->n_pkts = 0; + memset(qdm->len, 0, sizeof(qdm->len)); + } + + if ((res = qdm2_parse_config(qdm, st, ++p, end)) < 0) + return res; + p += res; + + /* We set codec_id to CODEC_ID_NONE initially to + * delay decoder initialization since extradata is + * carried within the RTP stream, not SDP. Here, + * by setting codec_id to CODEC_ID_QDM2, we are signalling + * to the decoder that it is OK to initialize. */ + st->codec->codec_id = CODEC_ID_QDM2; + } + + /* subpackets */ + while (end - p >= 4) { + if ((res = qdm2_parse_subpacket(qdm, st, p, end)) < 0) + return res; + p += res; + } + + qdm->timestamp = *timestamp; + if (++qdm->n_pkts < qdm->subpkts_per_block) + return AVERROR(EAGAIN); + qdm->cache = 0; + for (n = 0; n < 0x80; n++) + if (qdm->len[n] > 0) + qdm->cache++; + } + + /* output the subpackets into freshly created superblock structures */ + if (!qdm->cache || (res = qdm2_restore_block(qdm, st, pkt)) < 0) + return res; + if (--qdm->cache == 0) + qdm->n_pkts = 0; + + *timestamp = qdm->timestamp; + qdm->timestamp = RTP_NOTS_VALUE; + + return (qdm->cache > 0) ? 1 : 0; +} + +static PayloadContext *qdm2_extradata_new(void) +{ + return av_mallocz(sizeof(PayloadContext)); +} + +static void qdm2_extradata_free(PayloadContext *qdm) +{ + av_free(qdm); +} + +RTPDynamicProtocolHandler ff_qdm2_dynamic_handler = { + .enc_name = "X-QDM", + .codec_type = AVMEDIA_TYPE_AUDIO, + .codec_id = CODEC_ID_NONE, + .open = qdm2_extradata_new, + .close = qdm2_extradata_free, + .parse_packet = qdm2_parse_packet, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_qt.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_qt.c new file mode 100644 index 00000000..5cca0760 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_qt.c @@ -0,0 +1,254 @@ +/* + * RTP/Quicktime support. + * Copyright (c) 2009 Ronald S. Bultje + * + * 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 + * @brief Quicktime-style RTP support + * @author Ronald S. Bultje + */ + +#include "avformat.h" +#include "rtp.h" +#include "rtpdec.h" +#include "isom.h" +#include "libavcodec/get_bits.h" + +struct PayloadContext { + AVPacket pkt; + int bytes_per_frame, remaining; + uint32_t timestamp; +}; + +static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt, + AVStream *st, AVPacket *pkt, + uint32_t *timestamp, const uint8_t *buf, + int len, int flags) +{ + ByteIOContext pb; + GetBitContext gb; + int packing_scheme, has_payload_desc, has_packet_info, alen, + has_marker_bit = flags & RTP_FLAG_MARKER; + + if (qt->remaining) { + int num = qt->pkt.size / qt->bytes_per_frame; + + if (av_new_packet(pkt, qt->bytes_per_frame)) + return AVERROR(ENOMEM); + pkt->stream_index = st->index; + pkt->flags = qt->pkt.flags; + memcpy(pkt->data, + &qt->pkt.data[(num - qt->remaining) * qt->bytes_per_frame], + qt->bytes_per_frame); + if (--qt->remaining == 0) { + av_freep(&qt->pkt.data); + qt->pkt.size = 0; + } + return qt->remaining > 0; + } + + /** + * The RTP payload is described in: + * http://developer.apple.com/quicktime/icefloe/dispatch026.html + */ + init_get_bits(&gb, buf, len << 3); + init_put_byte(&pb, buf, len, 0, NULL, NULL, NULL, NULL); + + if (len < 4) + return AVERROR_INVALIDDATA; + + skip_bits(&gb, 4); // version + if ((packing_scheme = get_bits(&gb, 2)) == 0) + return AVERROR_INVALIDDATA; + if (get_bits1(&gb)) + flags |= RTP_FLAG_KEY; + has_payload_desc = get_bits1(&gb); + has_packet_info = get_bits1(&gb); + skip_bits(&gb, 23); // reserved:7, cache payload info:1, payload ID:15 + + if (has_payload_desc) { + int data_len, pos, is_start, is_finish; + uint32_t tag; + + pos = get_bits_count(&gb) >> 3; + if (pos + 12 > len) + return AVERROR_INVALIDDATA; + + skip_bits(&gb, 2); // has non-I frames:1, is sparse:1 + is_start = get_bits1(&gb); + is_finish = get_bits1(&gb); + if (!is_start || !is_finish) { + av_log_missing_feature(s, "RTP-X-QT with payload description " + "split over several packets", 1); + return AVERROR_NOTSUPP; + } + skip_bits(&gb, 12); // reserved + data_len = get_bits(&gb, 16); + + url_fseek(&pb, pos + 4, SEEK_SET); + tag = get_le32(&pb); + if ((st->codec->codec_type == CODEC_TYPE_VIDEO && + tag != MKTAG('v','i','d','e')) || + (st->codec->codec_type == CODEC_TYPE_AUDIO && + tag != MKTAG('s','o','u','n'))) + return AVERROR_INVALIDDATA; + av_set_pts_info(st, 32, 1, get_be32(&pb)); + + if (pos + data_len > len) + return AVERROR_INVALIDDATA; + /* TLVs */ + while (url_ftell(&pb) + 4 < pos + data_len) { + int tlv_len = get_be16(&pb); + tag = get_le16(&pb); + if (url_ftell(&pb) + tlv_len > pos + data_len) + return AVERROR_INVALIDDATA; + +#define MKTAG16(a,b) MKTAG(a,b,0,0) + switch (tag) { + case MKTAG16('s','d'): { + MOVStreamContext *msc; + void *priv_data = st->priv_data; + int nb_streams = s->nb_streams; + MOVContext *mc = av_mallocz(sizeof(*mc)); + if (!mc) + return AVERROR(ENOMEM); + mc->fc = s; + st->priv_data = msc = av_mallocz(sizeof(MOVStreamContext)); + if (!msc) { + av_free(mc); + st->priv_data = priv_data; + return AVERROR(ENOMEM); + } + /* ff_mov_read_stsd_entries updates stream s->nb_streams-1, + * so set it temporarily to indicate which stream to update. */ + s->nb_streams = st->index + 1; + ff_mov_read_stsd_entries(mc, &pb, 1); + qt->bytes_per_frame = msc->bytes_per_frame; + av_free(msc); + av_free(mc); + st->priv_data = priv_data; + s->nb_streams = nb_streams; + break; + } + default: + url_fskip(&pb, tlv_len); + break; + } + } + + /* 32-bit alignment */ + url_fskip(&pb, ((url_ftell(&pb) + 3) & ~3) - url_ftell(&pb)); + } else + url_fseek(&pb, 4, SEEK_SET); + + if (has_packet_info) { + av_log_missing_feature(s, "RTP-X-QT with packet specific info", 1); + return AVERROR_NOTSUPP; + } + + alen = len - url_ftell(&pb); + if (alen <= 0) + return AVERROR_INVALIDDATA; + + switch (packing_scheme) { + case 3: /* one data packet spread over 1 or multiple RTP packets */ + if (qt->pkt.size > 0 && qt->timestamp == *timestamp) { + qt->pkt.data = av_realloc(qt->pkt.data, qt->pkt.size + alen + + FF_INPUT_BUFFER_PADDING_SIZE); + } else { + av_freep(&qt->pkt.data); + av_init_packet(&qt->pkt); + qt->pkt.data = av_malloc(alen + FF_INPUT_BUFFER_PADDING_SIZE); + qt->pkt.size = 0; + qt->timestamp = *timestamp; + } + if (!qt->pkt.data) + return AVERROR(ENOMEM); + memcpy(qt->pkt.data + qt->pkt.size, buf + url_ftell(&pb), alen); + qt->pkt.size += alen; + if (has_marker_bit) { + *pkt = qt->pkt; + qt->pkt.size = 0; + qt->pkt.data = NULL; + pkt->flags = flags & RTP_FLAG_KEY ? AV_PKT_FLAG_KEY : 0; + pkt->stream_index = st->index; + pkt->destruct = av_destruct_packet; + memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE); + return 0; + } + return AVERROR(EAGAIN); + + case 1: /* constant packet size, multiple packets per RTP packet */ + if (qt->bytes_per_frame == 0 || + alen % qt->bytes_per_frame != 0) + return AVERROR_INVALIDDATA; /* wrongly padded */ + qt->remaining = (alen / qt->bytes_per_frame) - 1; + if (av_new_packet(pkt, qt->bytes_per_frame)) + return AVERROR(ENOMEM); + memcpy(pkt->data, buf + url_ftell(&pb), qt->bytes_per_frame); + pkt->flags = flags & RTP_FLAG_KEY ? AV_PKT_FLAG_KEY : 0; + pkt->stream_index = st->index; + if (qt->remaining > 0) { + av_freep(&qt->pkt.data); + qt->pkt.data = av_malloc(qt->remaining * qt->bytes_per_frame); + if (!qt->pkt.data) { + av_free_packet(pkt); + return AVERROR(ENOMEM); + } + qt->pkt.size = qt->remaining * qt->bytes_per_frame; + memcpy(qt->pkt.data, + buf + url_ftell(&pb) + qt->bytes_per_frame, + qt->remaining * qt->bytes_per_frame); + qt->pkt.flags = pkt->flags; + return 1; + } + return 0; + + default: /* unimplemented */ + av_log_missing_feature(NULL, "RTP-X-QT with packing scheme 2", 1); + return AVERROR_NOTSUPP; + } +} + +static PayloadContext *qt_rtp_new(void) +{ + return av_mallocz(sizeof(PayloadContext)); +} + +static void qt_rtp_free(PayloadContext *qt) +{ + av_freep(&qt->pkt.data); + av_free(qt); +} + +#define RTP_QT_HANDLER(m, n, s, t) \ +RTPDynamicProtocolHandler ff_ ## m ## _rtp_ ## n ## _handler = { \ + .enc_name = s, \ + .codec_type = t, \ + .codec_id = CODEC_ID_NONE, \ + .open = qt_rtp_new, \ + .close = qt_rtp_free, \ + .parse_packet = qt_rtp_parse_packet, \ +}; + +RTP_QT_HANDLER(qt, vid, "X-QT", CODEC_TYPE_VIDEO); +RTP_QT_HANDLER(qt, aud, "X-QT", CODEC_TYPE_AUDIO); +RTP_QT_HANDLER(quicktime, vid, "X-QUICKTIME", CODEC_TYPE_VIDEO); +RTP_QT_HANDLER(quicktime, aud, "X-QUICKTIME", CODEC_TYPE_AUDIO); diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_svq3.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_svq3.c new file mode 100644 index 00000000..79a57758 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_svq3.c @@ -0,0 +1,134 @@ +/* + * Sorenson-3 (SVQ3/SV3V) payload for RTP + * Copyright (c) 2010 Ronald S. Bultje + * + * 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 + * @brief RTP support for the SV3V (SVQ3) payload + * (http://wiki.multimedia.cx/index.php?title=Sorenson_Video_3#Packetization) + * @author Ronald S. Bultje + */ + +#include +#include "libavutil/intreadwrite.h" +#include "rtp.h" +#include "rtpdec.h" +#include "rtpdec_formats.h" + +struct PayloadContext { + ByteIOContext *pktbuf; + int64_t timestamp; +}; + +/** return 0 on packet, <0 on partial packet or error... */ +static int svq3_parse_packet (AVFormatContext *s, PayloadContext *sv, + AVStream *st, AVPacket *pkt, + uint32_t *timestamp, + const uint8_t *buf, int len, int flags) +{ + int config_packet, start_packet, end_packet; + + if (len < 2) + return AVERROR_INVALIDDATA; + + config_packet = buf[0] & 0x40; + start_packet = buf[0] & 0x20; + end_packet = buf[0] & 0x10; + buf += 2; // ignore buf[1] + len -= 2; + + if (config_packet) { + + av_freep(&st->codec->extradata); + st->codec->extradata_size = 0; + + if (len < 2 || !(st->codec->extradata = + av_malloc(len + 8 + FF_INPUT_BUFFER_PADDING_SIZE))) + return AVERROR_INVALIDDATA; + + st->codec->extradata_size = len + 8; + memcpy(st->codec->extradata, "SEQH", 4); + AV_WB32(st->codec->extradata + 4, len); + memcpy(st->codec->extradata + 8, buf, len); + + /* We set codec_id to CODEC_ID_NONE initially to + * delay decoder initialization since extradata is + * carried within the RTP stream, not SDP. Here, + * by setting codec_id to CODEC_ID_SVQ3, we are signalling + * to the decoder that it is OK to initialize. */ + st->codec->codec_id = CODEC_ID_SVQ3; + + return AVERROR(EAGAIN); + } + + if (start_packet) { + int res; + + if (sv->pktbuf) { + uint8_t *tmp; + url_close_dyn_buf(sv->pktbuf, &tmp); + av_free(tmp); + } + if ((res = url_open_dyn_buf(&sv->pktbuf)) < 0) + return res; + sv->timestamp = *timestamp; + } + + if (!sv->pktbuf) + return AVERROR_INVALIDDATA; + + put_buffer(sv->pktbuf, buf, len); + + if (end_packet) { + av_init_packet(pkt); + pkt->stream_index = st->index; + *timestamp = sv->timestamp; + pkt->size = url_close_dyn_buf(sv->pktbuf, &pkt->data); + pkt->destruct = av_destruct_packet; + sv->pktbuf = NULL; + return 0; + } + + return AVERROR(EAGAIN); +} + +static PayloadContext *svq3_extradata_new(void) +{ + return av_mallocz(sizeof(PayloadContext)); +} + +static void svq3_extradata_free(PayloadContext *sv) +{ + if (sv->pktbuf) { + uint8_t *buf; + url_close_dyn_buf(sv->pktbuf, &buf); + av_free(buf); + } + av_free(sv); +} + +RTPDynamicProtocolHandler ff_svq3_dynamic_handler = { + .enc_name = "X-SV3V-ES", + .codec_type = AVMEDIA_TYPE_VIDEO, + .codec_id = CODEC_ID_NONE, // see if (config_packet) above + .open = svq3_extradata_new, + .close = svq3_extradata_free, + .parse_packet = svq3_parse_packet, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_vp8.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_vp8.c new file mode 100644 index 00000000..b18017b2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_vp8.c @@ -0,0 +1,154 @@ +/* + * RTP VP8 Depacketizer + * Copyright (c) 2010 Josh Allmann + * + * 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 + * @brief RTP support for the VP8 payload + * @author Josh Allmann + * ( http://www.webmproject.org/code/specs/rtp/ ) + */ + +#include "libavcodec/bytestream.h" + +#include "rtpdec_formats.h" + +struct PayloadContext { + ByteIOContext *data; + uint32_t timestamp; + int is_keyframe; +}; + +static void prepare_packet(AVPacket *pkt, PayloadContext *vp8, int stream) +{ + av_init_packet(pkt); + pkt->stream_index = stream; + pkt->flags = vp8->is_keyframe ? AV_PKT_FLAG_KEY : 0; + pkt->size = url_close_dyn_buf(vp8->data, &pkt->data); + pkt->destruct = av_destruct_packet; + vp8->data = NULL; +} + +static int vp8_handle_packet(AVFormatContext *ctx, + PayloadContext *vp8, + AVStream *st, + AVPacket *pkt, + uint32_t *timestamp, + const uint8_t *buf, + int len, int flags) +{ + int start_packet, end_packet, has_au, ret = AVERROR(EAGAIN); + + if (!buf) { + // only called when vp8_handle_packet returns 1 + if (!vp8->data) { + av_log(ctx, AV_LOG_ERROR, "Invalid VP8 data passed\n"); + return AVERROR_INVALIDDATA; + } + prepare_packet(pkt, vp8, st->index); + *timestamp = vp8->timestamp; + return 0; + } + + start_packet = *buf & 1; + end_packet = flags & RTP_FLAG_MARKER; + has_au = *buf & 2; + buf++; + len--; + + if (start_packet) { + int res; + uint32_t ts = *timestamp; + if (vp8->data) { + // missing end marker; return old frame anyway. untested + prepare_packet(pkt, vp8, st->index); + *timestamp = vp8->timestamp; // reset timestamp from old frame + + // if current frame fits into one rtp packet, need to hold + // that for the next av_get_packet call + ret = end_packet ? 1 : 0; + } + if ((res = url_open_dyn_buf(&vp8->data)) < 0) + return res; + vp8->is_keyframe = *buf & 1; + vp8->timestamp = ts; + } + + if (!vp8->data || vp8->timestamp != *timestamp && ret == AVERROR(EAGAIN)) { + av_log(ctx, AV_LOG_WARNING, + "Received no start marker; dropping frame\n"); + return AVERROR(EAGAIN); + } + + // cycle through VP8AU headers if needed + // not tested with actual VP8AUs + while (len) { + int au_len = len; + if (has_au && len > 2) { + au_len = AV_RB16(buf); + buf += 2; + len -= 2; + if (buf + au_len > buf + len) { + av_log(ctx, AV_LOG_ERROR, "Invalid VP8AU length\n"); + return AVERROR_INVALIDDATA; + } + } + + put_buffer(vp8->data, buf, au_len); + buf += au_len; + len -= au_len; + } + + if (ret != AVERROR(EAGAIN)) // did we miss a end marker? + return ret; + + if (end_packet) { + prepare_packet(pkt, vp8, st->index); + return 0; + } + + return AVERROR(EAGAIN); +} + +static PayloadContext *vp8_new_context(void) +{ + av_log(NULL, AV_LOG_ERROR, "RTP VP8 payload implementation is incompatible " + "with the latest spec drafts.\n"); + return av_mallocz(sizeof(PayloadContext)); +} + +static void vp8_free_context(PayloadContext *vp8) +{ + if (vp8->data) { + uint8_t *tmp; + url_close_dyn_buf(vp8->data, &tmp); + av_free(tmp); + } + av_free(vp8); +} + +RTPDynamicProtocolHandler ff_vp8_dynamic_handler = { + .enc_name = "VP8", + .codec_type = AVMEDIA_TYPE_VIDEO, + .codec_id = CODEC_ID_VP8, + .open = vp8_new_context, + .close = vp8_free_context, + .parse_packet = vp8_handle_packet, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_xiph.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_xiph.c new file mode 100644 index 00000000..fe17a42b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpdec_xiph.c @@ -0,0 +1,405 @@ +/* + * Xiph RTP Protocols + * Copyright (c) 2009 Colin McQuillian + * Copyright (c) 2010 Josh Allmann + * + * 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 + * @brief Xiph / RTP Code + * @author Colin McQuillan + * @author Josh Allmann + */ + +#include "libavutil/avstring.h" +#include "libavutil/base64.h" +#include "libavcodec/bytestream.h" + +#include + +#include "rtpdec.h" +#include "rtpdec_formats.h" + +/** + * RTP/Xiph specific private data. + */ +struct PayloadContext { + unsigned ident; ///< 24-bit stream configuration identifier + uint32_t timestamp; + ByteIOContext* fragment; ///< buffer for split payloads + uint8_t *split_buf; + int split_pos, split_buf_len, split_buf_size; + int split_pkts; +}; + +static PayloadContext *xiph_new_context(void) +{ + return av_mallocz(sizeof(PayloadContext)); +} + +static inline void free_fragment_if_needed(PayloadContext * data) +{ + if (data->fragment) { + uint8_t* p; + url_close_dyn_buf(data->fragment, &p); + av_free(p); + data->fragment = NULL; + } +} + +static void xiph_free_context(PayloadContext * data) +{ + free_fragment_if_needed(data); + av_free(data->split_buf); + av_free(data); +} + +static int xiph_handle_packet(AVFormatContext * ctx, + PayloadContext * data, + AVStream * st, + AVPacket * pkt, + uint32_t * timestamp, + const uint8_t * buf, int len, int flags) +{ + + int ident, fragmented, tdt, num_pkts, pkt_len; + + if (!buf) { + if (!data->split_buf || data->split_pos + 2 > data->split_buf_len || + data->split_pkts <= 0) { + av_log(ctx, AV_LOG_ERROR, "No more data to return\n"); + return AVERROR_INVALIDDATA; + } + pkt_len = AV_RB16(data->split_buf + data->split_pos); + data->split_pos += 2; + if (data->split_pos + pkt_len > data->split_buf_len) { + av_log(ctx, AV_LOG_ERROR, "Not enough data to return\n"); + return AVERROR_INVALIDDATA; + } + if (av_new_packet(pkt, pkt_len)) { + av_log(ctx, AV_LOG_ERROR, "Out of memory.\n"); + return AVERROR(ENOMEM); + } + pkt->stream_index = st->index; + memcpy(pkt->data, data->split_buf + data->split_pos, pkt_len); + data->split_pos += pkt_len; + data->split_pkts--; + return data->split_pkts > 0; + } + + if (len < 6) { + av_log(ctx, AV_LOG_ERROR, "Invalid %d byte packet\n", len); + return AVERROR_INVALIDDATA; + } + + // read xiph rtp headers + ident = AV_RB24(buf); + fragmented = buf[3] >> 6; + tdt = (buf[3] >> 4) & 3; + num_pkts = buf[3] & 0xf; + pkt_len = AV_RB16(buf + 4); + + if (pkt_len > len - 6) { + av_log(ctx, AV_LOG_ERROR, + "Invalid packet length %d in %d byte packet\n", pkt_len, + len); + return AVERROR_INVALIDDATA; + } + + if (ident != data->ident) { + av_log(ctx, AV_LOG_ERROR, + "Unimplemented Xiph SDP configuration change detected\n"); + return AVERROR_PATCHWELCOME; + } + + if (tdt) { + av_log(ctx, AV_LOG_ERROR, + "Unimplemented RTP Xiph packet settings (%d,%d,%d)\n", + fragmented, tdt, num_pkts); + return AVERROR_PATCHWELCOME; + } + + buf += 6; // move past header bits + len -= 6; + + if (fragmented == 0) { + if (av_new_packet(pkt, pkt_len)) { + av_log(ctx, AV_LOG_ERROR, "Out of memory.\n"); + return AVERROR(ENOMEM); + } + pkt->stream_index = st->index; + memcpy(pkt->data, buf, pkt_len); + buf += pkt_len; + len -= pkt_len; + num_pkts--; + + if (num_pkts > 0) { + if (len > data->split_buf_size || !data->split_buf) { + av_freep(&data->split_buf); + data->split_buf_size = 2 * len; + data->split_buf = av_malloc(data->split_buf_size); + if (!data->split_buf) { + av_log(ctx, AV_LOG_ERROR, "Out of memory.\n"); + av_free_packet(pkt); + return AVERROR(ENOMEM); + } + } + memcpy(data->split_buf, buf, len); + data->split_buf_len = len; + data->split_pos = 0; + data->split_pkts = num_pkts; + return 1; + } + + return 0; + + } else if (fragmented == 1) { + // start of xiph data fragment + int res; + + // end packet has been lost somewhere, so drop buffered data + free_fragment_if_needed(data); + + if((res = url_open_dyn_buf(&data->fragment)) < 0) + return res; + + put_buffer(data->fragment, buf, pkt_len); + data->timestamp = *timestamp; + + } else { + assert(fragmented < 4); + if (data->timestamp != *timestamp) { + // skip if fragmented timestamp is incorrect; + // a start packet has been lost somewhere + free_fragment_if_needed(data); + av_log(ctx, AV_LOG_ERROR, "RTP timestamps don't match!\n"); + return AVERROR_INVALIDDATA; + } + if (!data->fragment) { + av_log(ctx, AV_LOG_WARNING, + "Received packet without a start fragment; dropping.\n"); + return AVERROR(EAGAIN); + } + + // copy data to fragment buffer + put_buffer(data->fragment, buf, pkt_len); + + if (fragmented == 3) { + // end of xiph data packet + av_init_packet(pkt); + pkt->size = url_close_dyn_buf(data->fragment, &pkt->data); + + if (pkt->size < 0) { + av_log(ctx, AV_LOG_ERROR, + "Error occurred when getting fragment buffer."); + return pkt->size; + } + + pkt->stream_index = st->index; + pkt->destruct = av_destruct_packet; + + data->fragment = NULL; + + return 0; + } + } + + return AVERROR(EAGAIN); +} + +/** + * Length encoding described in RFC5215 section 3.1.1. + */ +static int get_base128(const uint8_t ** buf, const uint8_t * buf_end) +{ + int n = 0; + for (; *buf < buf_end; ++*buf) { + n <<= 7; + n += **buf & 0x7f; + if (!(**buf & 0x80)) { + ++*buf; + return n; + } + } + return 0; +} + +/** + * Based off parse_packed_headers in Vorbis RTP + */ +static unsigned int +parse_packed_headers(const uint8_t * packed_headers, + const uint8_t * packed_headers_end, + AVCodecContext * codec, PayloadContext * xiph_data) +{ + + unsigned num_packed, num_headers, length, length1, length2, extradata_alloc; + uint8_t *ptr; + + if (packed_headers_end - packed_headers < 9) { + av_log(codec, AV_LOG_ERROR, + "Invalid %td byte packed header.", + packed_headers_end - packed_headers); + return AVERROR_INVALIDDATA; + } + + num_packed = bytestream_get_be32(&packed_headers); + xiph_data->ident = bytestream_get_be24(&packed_headers); + length = bytestream_get_be16(&packed_headers); + num_headers = get_base128(&packed_headers, packed_headers_end); + length1 = get_base128(&packed_headers, packed_headers_end); + length2 = get_base128(&packed_headers, packed_headers_end); + + if (num_packed != 1 || num_headers > 3) { + av_log(codec, AV_LOG_ERROR, + "Unimplemented number of headers: %d packed headers, %d headers\n", + num_packed, num_headers); + return AVERROR_PATCHWELCOME; + } + + if (packed_headers_end - packed_headers != length || + length1 > length || length2 > length - length1) { + av_log(codec, AV_LOG_ERROR, + "Bad packed header lengths (%d,%d,%td,%d)\n", length1, + length2, packed_headers_end - packed_headers, length); + return AVERROR_INVALIDDATA; + } + + /* allocate extra space: + * -- length/255 +2 for xiphlacing + * -- one for the '2' marker + * -- FF_INPUT_BUFFER_PADDING_SIZE required */ + extradata_alloc = length + length/255 + 3 + FF_INPUT_BUFFER_PADDING_SIZE; + + ptr = codec->extradata = av_malloc(extradata_alloc); + if (!ptr) { + av_log(codec, AV_LOG_ERROR, "Out of memory\n"); + return AVERROR(ENOMEM); + } + *ptr++ = 2; + ptr += av_xiphlacing(ptr, length1); + ptr += av_xiphlacing(ptr, length2); + memcpy(ptr, packed_headers, length); + ptr += length; + codec->extradata_size = ptr - codec->extradata; + // clear out remaining parts of the buffer + memset(ptr, 0, extradata_alloc - codec->extradata_size); + + return 0; +} + +static int xiph_parse_fmtp_pair(AVStream* stream, + PayloadContext *xiph_data, + char *attr, char *value) +{ + AVCodecContext *codec = stream->codec; + int result = 0; + + if (!strcmp(attr, "sampling")) { + if (!strcmp(value, "YCbCr-4:2:0")) { + codec->pix_fmt = PIX_FMT_YUV420P; + } else if (!strcmp(value, "YCbCr-4:4:2")) { + codec->pix_fmt = PIX_FMT_YUV422P; + } else if (!strcmp(value, "YCbCr-4:4:4")) { + codec->pix_fmt = PIX_FMT_YUV444P; + } else { + av_log(codec, AV_LOG_ERROR, + "Unsupported pixel format %s\n", attr); + return AVERROR_INVALIDDATA; + } + } else if (!strcmp(attr, "width")) { + /* This is an integer between 1 and 1048561 + * and MUST be in multiples of 16. */ + codec->width = atoi(value); + return 0; + } else if (!strcmp(attr, "height")) { + /* This is an integer between 1 and 1048561 + * and MUST be in multiples of 16. */ + codec->height = atoi(value); + return 0; + } else if (!strcmp(attr, "delivery-method")) { + /* Possible values are: inline, in_band, out_band/specific_name. */ + return AVERROR_PATCHWELCOME; + } else if (!strcmp(attr, "configuration-uri")) { + /* NOTE: configuration-uri is supported only under 2 conditions: + *--after the delivery-method tag + * --with a delivery-method value of out_band */ + return AVERROR_PATCHWELCOME; + } else if (!strcmp(attr, "configuration")) { + /* NOTE: configuration is supported only AFTER the delivery-method tag + * The configuration value is a base64 encoded packed header */ + uint8_t *decoded_packet = NULL; + int packet_size; + size_t decoded_alloc = strlen(value) / 4 * 3 + 4; + + if (decoded_alloc <= INT_MAX) { + decoded_packet = av_malloc(decoded_alloc); + if (decoded_packet) { + packet_size = + av_base64_decode(decoded_packet, value, decoded_alloc); + + result = parse_packed_headers + (decoded_packet, decoded_packet + packet_size, codec, + xiph_data); + } else { + av_log(codec, AV_LOG_ERROR, + "Out of memory while decoding SDP configuration.\n"); + result = AVERROR(ENOMEM); + } + } else { + av_log(codec, AV_LOG_ERROR, "Packet too large\n"); + result = AVERROR_INVALIDDATA; + } + av_free(decoded_packet); + } + return result; +} + +static int xiph_parse_sdp_line(AVFormatContext *s, int st_index, + PayloadContext *data, const char *line) +{ + const char *p; + + if (av_strstart(line, "fmtp:", &p)) { + return ff_parse_fmtp(s->streams[st_index], data, p, + xiph_parse_fmtp_pair); + } + + return 0; +} + +RTPDynamicProtocolHandler ff_theora_dynamic_handler = { + .enc_name = "theora", + .codec_type = AVMEDIA_TYPE_VIDEO, + .codec_id = CODEC_ID_THEORA, + .parse_sdp_a_line = xiph_parse_sdp_line, + .open = xiph_new_context, + .close = xiph_free_context, + .parse_packet = xiph_handle_packet +}; + +RTPDynamicProtocolHandler ff_vorbis_dynamic_handler = { + .enc_name = "vorbis", + .codec_type = AVMEDIA_TYPE_AUDIO, + .codec_id = CODEC_ID_VORBIS, + .parse_sdp_a_line = xiph_parse_sdp_line, + .open = xiph_new_context, + .close = xiph_free_context, + .parse_packet = xiph_handle_packet +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_aac.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_aac.c new file mode 100644 index 00000000..e19b2869 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_aac.c @@ -0,0 +1,85 @@ +/* + * copyright (c) 2007 Luca Abeni + * + * 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 + */ + +#include "avformat.h" +#include "rtpenc.h" + + +void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size) +{ + RTPMuxContext *s = s1->priv_data; + int len, max_packet_size; + uint8_t *p; + const int max_frames_per_packet = s->max_frames_per_packet ? s->max_frames_per_packet : 5; + const int max_au_headers_size = 2 + 2 * max_frames_per_packet; + + /* skip ADTS header, if present */ + if ((s1->streams[0]->codec->extradata_size) == 0) { + size -= 7; + buff += 7; + } + max_packet_size = s->max_payload_size - max_au_headers_size; + + /* test if the packet must be sent */ + len = (s->buf_ptr - s->buf); + if ((s->num_frames == max_frames_per_packet) || (len && (len + size) > s->max_payload_size)) { + int au_size = s->num_frames * 2; + + p = s->buf + max_au_headers_size - au_size - 2; + if (p != s->buf) { + memmove(p + 2, s->buf + 2, au_size); + } + /* Write the AU header size */ + p[0] = ((au_size * 8) & 0xFF) >> 8; + p[1] = (au_size * 8) & 0xFF; + + ff_rtp_send_data(s1, p, s->buf_ptr - p, 1); + + s->num_frames = 0; + } + if (s->num_frames == 0) { + s->buf_ptr = s->buf + max_au_headers_size; + s->timestamp = s->cur_timestamp; + } + + if (size <= max_packet_size) { + p = s->buf + s->num_frames++ * 2 + 2; + *p++ = size >> 5; + *p = (size & 0x1F) << 3; + memcpy(s->buf_ptr, buff, size); + s->buf_ptr += size; + } else { + int au_size = size; + + max_packet_size = s->max_payload_size - 4; + p = s->buf; + p[0] = 0; + p[1] = 16; + while (size > 0) { + len = FFMIN(size, max_packet_size); + p[2] = au_size >> 5; + p[3] = (au_size & 0x1F) << 3; + memcpy(p + 4, buff, len); + ff_rtp_send_data(s1, p, len + 4, len == size); + size -= len; + buff += len; + } + } +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_amr.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_amr.c new file mode 100644 index 00000000..367789fc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_amr.c @@ -0,0 +1,66 @@ +/* + * RTP packetization for AMR audio + * Copyright (c) 2007 Luca Abeni + * Copyright (c) 2009 Martin Storsjo + * + * 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 + */ + +#include "avformat.h" +#include "rtpenc.h" + +/** + * Packetize AMR frames into RTP packets according to RFC 3267, + * in octet-aligned mode. + */ +void ff_rtp_send_amr(AVFormatContext *s1, const uint8_t *buff, int size) +{ + RTPMuxContext *s = s1->priv_data; + int max_header_toc_size = 1 + s->max_frames_per_packet; + uint8_t *p; + int len; + + /* Test if the packet must be sent. */ + len = s->buf_ptr - s->buf; + if (s->num_frames == s->max_frames_per_packet || (len && len + size - 1 > s->max_payload_size)) { + int header_size = s->num_frames + 1; + p = s->buf + max_header_toc_size - header_size; + if (p != s->buf) + memmove(p, s->buf, header_size); + + ff_rtp_send_data(s1, p, s->buf_ptr - p, 1); + + s->num_frames = 0; + } + + if (!s->num_frames) { + s->buf[0] = 0xf0; + s->buf_ptr = s->buf + max_header_toc_size; + s->timestamp = s->cur_timestamp; + } else { + /* Mark the previous TOC entry as having more entries following. */ + s->buf[1 + s->num_frames - 1] |= 0x80; + } + + /* Copy the frame type and quality bits. */ + s->buf[1 + s->num_frames++] = buff[0] & 0x7C; + buff++; + size--; + memcpy(s->buf_ptr, buff, size); + s->buf_ptr += size; +} + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_chain.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_chain.c new file mode 100644 index 00000000..10d9df20 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_chain.c @@ -0,0 +1,82 @@ +/* + * RTP muxer chaining code + * Copyright (c) 2010 Martin Storsjo + * + * 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 + */ + +#include "avformat.h" +#include "rtpenc_chain.h" + +AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, + URLContext *handle, int packet_size) +{ + AVFormatContext *rtpctx; + int ret; + AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL); + + if (!rtp_format) + return NULL; + + /* Allocate an AVFormatContext for each output stream */ + rtpctx = avformat_alloc_context(); + if (!rtpctx) + return NULL; + + rtpctx->oformat = rtp_format; + if (!av_new_stream(rtpctx, 0)) { + av_free(rtpctx); + return NULL; + } + /* Copy the max delay setting; the rtp muxer reads this. */ + rtpctx->max_delay = s->max_delay; + /* Copy other stream parameters. */ + rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio; + + /* Set the synchronized start time. */ + rtpctx->start_time_realtime = s->start_time_realtime; + + /* Remove the local codec, link to the original codec + * context instead, to give the rtp muxer access to + * codec parameters. */ + av_free(rtpctx->streams[0]->codec); + rtpctx->streams[0]->codec = st->codec; + + if (handle) { + url_fdopen(&rtpctx->pb, handle); + } else + url_open_dyn_packet_buf(&rtpctx->pb, packet_size); + ret = av_write_header(rtpctx); + + if (ret) { + if (handle) { + url_fclose(rtpctx->pb); + } else { + uint8_t *ptr; + url_close_dyn_buf(rtpctx->pb, &ptr); + av_free(ptr); + } + av_free(rtpctx->streams[0]); + av_free(rtpctx); + return NULL; + } + + /* Copy the RTP AVStream timebase back to the original AVStream */ + st->time_base = rtpctx->streams[0]->time_base; + return rtpctx; +} + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_chain.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_chain.h new file mode 100644 index 00000000..9e19b64d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_chain.h @@ -0,0 +1,30 @@ +/* + * RTP muxer chaining code + * Copyright (c) 2010 Martin Storsjo + * + * 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 + */ + +#ifndef AVFORMAT_RTPENC_CHAIN_H +#define AVFORMAT_RTPENC_CHAIN_H + +#include "avformat.h" + +AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, + URLContext *handle, int packet_size); + +#endif /* AVFORMAT_RTPENC_CHAIN_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_h263.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_h263.c new file mode 100644 index 00000000..84403a10 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_h263.c @@ -0,0 +1,80 @@ +/* + * RTP packetization for H.263 video + * Copyright (c) 2009 Luca Abeni + * Copyright (c) 2009 Martin Storsjo + * + * 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 + */ + +#include "avformat.h" +#include "rtpenc.h" + +static const uint8_t *find_resync_marker_reverse(const uint8_t *restrict start, + const uint8_t *restrict end) +{ + const uint8_t *p = end - 1; + start += 1; /* Make sure we never return the original start. */ + for (; p > start; p -= 2) { + if (!*p) { + if (!p[ 1] && p[2]) return p; + else if (!p[-1] && p[1]) return p - 1; + } + } + return end; +} + +/** + * Packetize H.263 frames into RTP packets according to RFC 4629 + */ +void ff_rtp_send_h263(AVFormatContext *s1, const uint8_t *buf1, int size) +{ + RTPMuxContext *s = s1->priv_data; + int len, max_packet_size; + uint8_t *q; + + max_packet_size = s->max_payload_size; + + while (size > 0) { + q = s->buf; + if (size >= 2 && (buf1[0] == 0) && (buf1[1] == 0)) { + *q++ = 0x04; + buf1 += 2; + size -= 2; + } else { + *q++ = 0; + } + *q++ = 0; + + len = FFMIN(max_packet_size - 2, size); + + /* Look for a better place to split the frame into packets. */ + if (len < size) { + const uint8_t *end = find_resync_marker_reverse(buf1, buf1 + len); + len = end - buf1; + } + + memcpy(q, buf1, len); + q += len; + + /* 90 KHz time stamp */ + s->timestamp = s->cur_timestamp; + ff_rtp_send_data(s1, s->buf, q - s->buf, (len == size)); + + buf1 += len; + size -= len; + } +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_mpv.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_mpv.c new file mode 100644 index 00000000..b23c8f86 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_mpv.c @@ -0,0 +1,119 @@ +/* + * RTP packetization for MPEG video + * Copyright (c) 2002 Fabrice Bellard + * Copyright (c) 2007 Luca Abeni + * + * 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 + */ + +#include "libavcodec/mpegvideo.h" +#include "avformat.h" +#include "rtpenc.h" + +/* NOTE: a single frame must be passed with sequence header if + needed. XXX: use slices. */ +void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size) +{ + RTPMuxContext *s = s1->priv_data; + int len, h, max_packet_size; + uint8_t *q; + const uint8_t *end = buf1 + size; + int begin_of_slice, end_of_slice, frame_type, temporal_reference; + + max_packet_size = s->max_payload_size; + begin_of_slice = 1; + end_of_slice = 0; + frame_type = 0; + temporal_reference = 0; + + while (size > 0) { + int begin_of_sequence; + + begin_of_sequence = 0; + len = max_packet_size - 4; + + if (len >= size) { + len = size; + end_of_slice = 1; + } else { + const uint8_t *r, *r1; + int start_code; + + r1 = buf1; + while (1) { + start_code = -1; + r = ff_find_start_code(r1, end, &start_code); + if((start_code & 0xFFFFFF00) == 0x100) { + /* New start code found */ + if (start_code == 0x100) { + frame_type = (r[1] & 0x38) >> 3; + temporal_reference = (int)r[0] << 2 | r[1] >> 6; + } + if (start_code == 0x1B8) { + begin_of_sequence = 1; + } + + if (r - buf1 - 4 <= len) { + /* The current slice fits in the packet */ + if (begin_of_slice == 0) { + /* no slice at the beginning of the packet... */ + end_of_slice = 1; + len = r - buf1 - 4; + break; + } + r1 = r; + } else { + if ((r1 - buf1 > 4) && (r - r1 < max_packet_size)) { + len = r1 - buf1 - 4; + end_of_slice = 1; + } + break; + } + } else { + break; + } + } + } + + h = 0; + h |= temporal_reference << 16; + h |= begin_of_sequence << 13; + h |= begin_of_slice << 12; + h |= end_of_slice << 11; + h |= frame_type << 8; + + q = s->buf; + *q++ = h >> 24; + *q++ = h >> 16; + *q++ = h >> 8; + *q++ = h; + + memcpy(q, buf1, len); + q += len; + + /* 90kHz time stamp */ + s->timestamp = s->cur_timestamp; + ff_rtp_send_data(s1, s->buf, q - s->buf, (len == size)); + + buf1 += len; + size -= len; + begin_of_slice = end_of_slice; + end_of_slice = 0; + } +} + + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_vp8.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_vp8.c new file mode 100644 index 00000000..e865514c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_vp8.c @@ -0,0 +1,47 @@ +/* + * RTP VP8 Packetizer + * Copyright (c) 2010 Josh Allmann + * + * 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 + */ + +#include "rtpenc.h" + +/* Based on a draft spec for VP8 RTP. + * ( http://www.webmproject.org/code/specs/rtp/ ) */ +void ff_rtp_send_vp8(AVFormatContext *s1, const uint8_t *buf, int size) +{ + RTPMuxContext *s = s1->priv_data; + int len, max_packet_size; + + s->buf_ptr = s->buf; + s->timestamp = s->cur_timestamp; + max_packet_size = s->max_payload_size - 1; // minus one for header byte + + *s->buf_ptr++ = 1; // 0b1 indicates start of frame + while (size > 0) { + len = FFMIN(size, max_packet_size); + + memcpy(s->buf_ptr, buf, len); + ff_rtp_send_data(s1, s->buf, len+1, size == len); // marker bit is last packet in frame + + size -= len; + buf += len; + s->buf_ptr = s->buf; + *s->buf_ptr++ = 0; // payload descriptor + } +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_xiph.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_xiph.c new file mode 100644 index 00000000..57686326 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtpenc_xiph.c @@ -0,0 +1,126 @@ +/* + * RTP packetization for Xiph audio and video + * Copyright (c) 2010 Josh Allmann + * + * 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 + */ + +#include "avformat.h" +#include "rtpenc.h" + +/** + * Packetize Xiph frames into RTP according to + * RFC 5215 (Vorbis) and the Theora RFC draft. + * (http://svn.xiph.org/trunk/theora/doc/draft-ietf-avt-rtp-theora-00.txt) + */ +void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size) +{ + RTPMuxContext *s = s1->priv_data; + int max_pkt_size, xdt, frag; + uint8_t *q; + + max_pkt_size = s->max_payload_size; + + // set xiph data type + switch (*buff) { + case 0x01: // vorbis id + case 0x05: // vorbis setup + case 0x80: // theora header + case 0x82: // theora tables + xdt = 1; // packed config payload + break; + case 0x03: // vorbis comments + case 0x81: // theora comments + xdt = 2; // comment payload + break; + default: + xdt = 0; // raw data payload + break; + } + + // Set ident. + // Probably need a non-fixed way of generating + // this, but it has to be done in SDP and passed in from there. + q = s->buf; + *q++ = (RTP_XIPH_IDENT >> 16) & 0xff; + *q++ = (RTP_XIPH_IDENT >> 8) & 0xff; + *q++ = (RTP_XIPH_IDENT ) & 0xff; + + // set fragment + // 0 - whole frame (possibly multiple frames) + // 1 - first fragment + // 2 - fragment continuation + // 3 - last fragmement + frag = size <= max_pkt_size ? 0 : 1; + + if (!frag && !xdt) { // do we have a whole frame of raw data? + uint8_t *end_ptr = s->buf + 6 + max_pkt_size; // what we're allowed to write + uint8_t *ptr = s->buf_ptr + 2 + size; // what we're going to write + int remaining = end_ptr - ptr; + + assert(s->num_frames <= s->max_frames_per_packet); + if ((s->num_frames > 0 && remaining < 0) || + s->num_frames == s->max_frames_per_packet) { + // send previous packets now; no room for new data + ff_rtp_send_data(s1, s->buf, s->buf_ptr - s->buf, 0); + s->num_frames = 0; + } + + // buffer current frame to send later + if (0 == s->num_frames) s->timestamp = s->cur_timestamp; + s->num_frames++; + + // Set packet header. Normally, this is OR'd with frag and xdt, + // but those are zero, so omitted here + *q++ = s->num_frames; + + if (s->num_frames > 1) q = s->buf_ptr; // jump ahead if needed + *q++ = (size >> 8) & 0xff; + *q++ = size & 0xff; + memcpy(q, buff, size); + q += size; + s->buf_ptr = q; + + return; + } else if (s->num_frames) { + // immediately send buffered frames if buffer is not raw data, + // or if current frame is fragmented. + ff_rtp_send_data(s1, s->buf, s->buf_ptr - s->buf, 0); + } + + s->timestamp = s->cur_timestamp; + s->num_frames = 0; + s->buf_ptr = q; + while (size > 0) { + int len = (!frag || frag == 3) ? size : max_pkt_size; + q = s->buf_ptr; + + // set packet headers + *q++ = (frag << 6) | (xdt << 4); // num_frames = 0 + *q++ = (len >> 8) & 0xff; + *q++ = len & 0xff; + // set packet body + memcpy(q, buff, len); + q += len; + buff += len; + size -= len; + + ff_rtp_send_data(s1, s->buf, q - s->buf, 0); + + frag = size <= max_pkt_size ? 3 : 2; + } +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtspdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtspdec.c new file mode 100644 index 00000000..45ed7bb9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtspdec.c @@ -0,0 +1,410 @@ +/* + * RTSP demuxer + * Copyright (c) 2002 Fabrice Bellard + * + * 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 + */ + +#include "libavutil/avstring.h" +#include "libavutil/intreadwrite.h" +#include "avformat.h" + +#include "internal.h" +#include "network.h" +#include "os_support.h" +#include "rtsp.h" +#include "rdt.h" + +//#define DEBUG +//#define DEBUG_RTP_TCP + +static int rtsp_read_play(AVFormatContext *s) +{ + RTSPState *rt = s->priv_data; + RTSPMessageHeader reply1, *reply = &reply1; + int i; + char cmd[1024]; + + av_log(s, AV_LOG_DEBUG, "hello state=%d\n", rt->state); + rt->nb_byes = 0; + + if (!(rt->server_type == RTSP_SERVER_REAL && rt->need_subscription)) { + if (rt->transport == RTSP_TRANSPORT_RTP) { + for (i = 0; i < rt->nb_rtsp_streams; i++) { + RTSPStream *rtsp_st = rt->rtsp_streams[i]; + RTPDemuxContext *rtpctx = rtsp_st->transport_priv; + if (!rtpctx) + continue; + ff_rtp_reset_packet_queue(rtpctx); + rtpctx->last_rtcp_ntp_time = AV_NOPTS_VALUE; + rtpctx->first_rtcp_ntp_time = AV_NOPTS_VALUE; + rtpctx->base_timestamp = 0; + rtpctx->rtcp_ts_offset = 0; + } + } + if (rt->state == RTSP_STATE_PAUSED) { + cmd[0] = 0; + } else { + snprintf(cmd, sizeof(cmd), + "Range: npt=%0.3f-\r\n", + (double)rt->seek_timestamp / AV_TIME_BASE); + } + ff_rtsp_send_cmd(s, "PLAY", rt->control_uri, cmd, reply, NULL); + if (reply->status_code != RTSP_STATUS_OK) { + return -1; + } + if (rt->transport == RTSP_TRANSPORT_RTP && + reply->range_start != AV_NOPTS_VALUE) { + for (i = 0; i < rt->nb_rtsp_streams; i++) { + RTSPStream *rtsp_st = rt->rtsp_streams[i]; + RTPDemuxContext *rtpctx = rtsp_st->transport_priv; + AVStream *st = NULL; + if (!rtpctx || rtsp_st->stream_index < 0) + continue; + st = s->streams[rtsp_st->stream_index]; + rtpctx->range_start_offset = + av_rescale_q(reply->range_start, AV_TIME_BASE_Q, + st->time_base); + } + } + } + rt->state = RTSP_STATE_STREAMING; + return 0; +} + +/* pause the stream */ +static int rtsp_read_pause(AVFormatContext *s) +{ + RTSPState *rt = s->priv_data; + RTSPMessageHeader reply1, *reply = &reply1; + + if (rt->state != RTSP_STATE_STREAMING) + return 0; + else if (!(rt->server_type == RTSP_SERVER_REAL && rt->need_subscription)) { + ff_rtsp_send_cmd(s, "PAUSE", rt->control_uri, NULL, reply, NULL); + if (reply->status_code != RTSP_STATUS_OK) { + return -1; + } + } + rt->state = RTSP_STATE_PAUSED; + return 0; +} + +int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply) +{ + RTSPState *rt = s->priv_data; + char cmd[1024]; + unsigned char *content = NULL; + int ret; + + /* describe the stream */ + snprintf(cmd, sizeof(cmd), + "Accept: application/sdp\r\n"); + if (rt->server_type == RTSP_SERVER_REAL) { + /** + * The Require: attribute is needed for proper streaming from + * Realmedia servers. + */ + av_strlcat(cmd, + "Require: com.real.retain-entity-for-setup\r\n", + sizeof(cmd)); + } + ff_rtsp_send_cmd(s, "DESCRIBE", rt->control_uri, cmd, reply, &content); + if (!content) + return AVERROR_INVALIDDATA; + if (reply->status_code != RTSP_STATUS_OK) { + av_freep(&content); + return AVERROR_INVALIDDATA; + } + + av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", content); + /* now we got the SDP description, we parse it */ + ret = ff_sdp_parse(s, (const char *)content); + av_freep(&content); + if (ret < 0) + return ret; + + return 0; +} + +static int rtsp_probe(AVProbeData *p) +{ + if (av_strstart(p->filename, "rtsp:", NULL)) + return AVPROBE_SCORE_MAX; + return 0; +} + +static int rtsp_read_header(AVFormatContext *s, + AVFormatParameters *ap) +{ + RTSPState *rt = s->priv_data; + int ret; + + ret = ff_rtsp_connect(s); + if (ret) + return ret; + + rt->real_setup_cache = av_mallocz(2 * s->nb_streams * sizeof(*rt->real_setup_cache)); + if (!rt->real_setup_cache) + return AVERROR(ENOMEM); + rt->real_setup = rt->real_setup_cache + s->nb_streams; + + if (ap->initial_pause) { + /* do not start immediately */ + } else { + if (rtsp_read_play(s) < 0) { + ff_rtsp_close_streams(s); + ff_rtsp_close_connections(s); + return AVERROR_INVALIDDATA; + } + } + + return 0; +} + +int ff_rtsp_tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, + uint8_t *buf, int buf_size) +{ + RTSPState *rt = s->priv_data; + int id, len, i, ret; + RTSPStream *rtsp_st; + +#ifdef DEBUG_RTP_TCP + av_dlog(s, "tcp_read_packet:\n"); +#endif +redo: + for (;;) { + RTSPMessageHeader reply; + + ret = ff_rtsp_read_reply(s, &reply, NULL, 1, NULL); + if (ret < 0) + return ret; + if (ret == 1) /* received '$' */ + break; + /* XXX: parse message */ + if (rt->state != RTSP_STATE_STREAMING) + return 0; + } + ret = url_read_complete(rt->rtsp_hd, buf, 3); + if (ret != 3) + return -1; + id = buf[0]; + len = AV_RB16(buf + 1); +#ifdef DEBUG_RTP_TCP + av_dlog(s, "id=%d len=%d\n", id, len); +#endif + if (len > buf_size || len < 12) + goto redo; + /* get the data */ + ret = url_read_complete(rt->rtsp_hd, buf, len); + if (ret != len) + return -1; + if (rt->transport == RTSP_TRANSPORT_RDT && + ff_rdt_parse_header(buf, len, &id, NULL, NULL, NULL, NULL) < 0) + return -1; + + /* find the matching stream */ + for (i = 0; i < rt->nb_rtsp_streams; i++) { + rtsp_st = rt->rtsp_streams[i]; + if (id >= rtsp_st->interleaved_min && + id <= rtsp_st->interleaved_max) + goto found; + } + goto redo; +found: + *prtsp_st = rtsp_st; + return len; +} + +static int resetup_tcp(AVFormatContext *s) +{ + RTSPState *rt = s->priv_data; + char host[1024]; + int port; + + av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port, NULL, 0, + s->filename); + ff_rtsp_undo_setup(s); + return ff_rtsp_make_setup_request(s, host, port, RTSP_LOWER_TRANSPORT_TCP, + rt->real_challenge); +} + +static int rtsp_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + RTSPState *rt = s->priv_data; + int ret; + RTSPMessageHeader reply1, *reply = &reply1; + char cmd[1024]; + +retry: + if (rt->server_type == RTSP_SERVER_REAL) { + int i; + + for (i = 0; i < s->nb_streams; i++) + rt->real_setup[i] = s->streams[i]->discard; + + if (!rt->need_subscription) { + if (memcmp (rt->real_setup, rt->real_setup_cache, + sizeof(enum AVDiscard) * s->nb_streams)) { + snprintf(cmd, sizeof(cmd), + "Unsubscribe: %s\r\n", + rt->last_subscription); + ff_rtsp_send_cmd(s, "SET_PARAMETER", rt->control_uri, + cmd, reply, NULL); + if (reply->status_code != RTSP_STATUS_OK) + return AVERROR_INVALIDDATA; + rt->need_subscription = 1; + } + } + + if (rt->need_subscription) { + int r, rule_nr, first = 1; + + memcpy(rt->real_setup_cache, rt->real_setup, + sizeof(enum AVDiscard) * s->nb_streams); + rt->last_subscription[0] = 0; + + snprintf(cmd, sizeof(cmd), + "Subscribe: "); + for (i = 0; i < rt->nb_rtsp_streams; i++) { + rule_nr = 0; + for (r = 0; r < s->nb_streams; r++) { + if (s->streams[r]->priv_data == rt->rtsp_streams[i]) { + if (s->streams[r]->discard != AVDISCARD_ALL) { + if (!first) + av_strlcat(rt->last_subscription, ",", + sizeof(rt->last_subscription)); + ff_rdt_subscribe_rule( + rt->last_subscription, + sizeof(rt->last_subscription), i, rule_nr); + first = 0; + } + rule_nr++; + } + } + } + av_strlcatf(cmd, sizeof(cmd), "%s\r\n", rt->last_subscription); + ff_rtsp_send_cmd(s, "SET_PARAMETER", rt->control_uri, + cmd, reply, NULL); + if (reply->status_code != RTSP_STATUS_OK) + return AVERROR_INVALIDDATA; + rt->need_subscription = 0; + + if (rt->state == RTSP_STATE_STREAMING) + rtsp_read_play (s); + } + } + + ret = ff_rtsp_fetch_packet(s, pkt); + if (ret < 0) { + if (ret == FF_NETERROR(ETIMEDOUT) && !rt->packets) { + if (rt->lower_transport == RTSP_LOWER_TRANSPORT_UDP && + rt->lower_transport_mask & (1 << RTSP_LOWER_TRANSPORT_TCP)) { + RTSPMessageHeader reply1, *reply = &reply1; + av_log(s, AV_LOG_WARNING, "UDP timeout, retrying with TCP\n"); + if (rtsp_read_pause(s) != 0) + return -1; + // TEARDOWN is required on Real-RTSP, but might make + // other servers close the connection. + if (rt->server_type == RTSP_SERVER_REAL) + ff_rtsp_send_cmd(s, "TEARDOWN", rt->control_uri, NULL, + reply, NULL); + rt->session_id[0] = '\0'; + if (resetup_tcp(s) == 0) { + rt->state = RTSP_STATE_IDLE; + rt->need_subscription = 1; + if (rtsp_read_play(s) != 0) + return -1; + goto retry; + } + } + } + return ret; + } + rt->packets++; + + /* send dummy request to keep TCP connection alive */ + if ((av_gettime() - rt->last_cmd_time) / 1000000 >= rt->timeout / 2) { + if (rt->server_type == RTSP_SERVER_WMS) { + ff_rtsp_send_cmd_async(s, "GET_PARAMETER", rt->control_uri, NULL); + } else { + ff_rtsp_send_cmd_async(s, "OPTIONS", "*", NULL); + } + } + + return 0; +} + +static int rtsp_read_seek(AVFormatContext *s, int stream_index, + int64_t timestamp, int flags) +{ + RTSPState *rt = s->priv_data; + + rt->seek_timestamp = av_rescale_q(timestamp, + s->streams[stream_index]->time_base, + AV_TIME_BASE_Q); + switch(rt->state) { + default: + case RTSP_STATE_IDLE: + break; + case RTSP_STATE_STREAMING: + if (rtsp_read_pause(s) != 0) + return -1; + rt->state = RTSP_STATE_SEEKING; + if (rtsp_read_play(s) != 0) + return -1; + break; + case RTSP_STATE_PAUSED: + rt->state = RTSP_STATE_IDLE; + break; + } + return 0; +} + +static int rtsp_read_close(AVFormatContext *s) +{ + RTSPState *rt = s->priv_data; + +#if 0 + /* NOTE: it is valid to flush the buffer here */ + if (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP) { + url_fclose(&rt->rtsp_gb); + } +#endif + ff_rtsp_send_cmd_async(s, "TEARDOWN", rt->control_uri, NULL); + + ff_rtsp_close_streams(s); + ff_rtsp_close_connections(s); + ff_network_close(); + rt->real_setup = NULL; + av_freep(&rt->real_setup_cache); + return 0; +} + +AVInputFormat ff_rtsp_demuxer = { + "rtsp", + NULL_IF_CONFIG_SMALL("RTSP input format"), + sizeof(RTSPState), + rtsp_probe, + rtsp_read_header, + rtsp_read_packet, + rtsp_read_close, + rtsp_read_seek, + .flags = AVFMT_NOFILE, + .read_play = rtsp_read_play, + .read_pause = rtsp_read_pause, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtspenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtspenc.c new file mode 100644 index 00000000..34deeeb6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/rtspenc.c @@ -0,0 +1,241 @@ +/* + * RTSP muxer + * Copyright (c) 2010 Martin Storsjo + * + * 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 + */ + +#include "avformat.h" + +#include +#if HAVE_POLL_H +#include +#endif +#include "network.h" +#include "os_support.h" +#include "rtsp.h" +#include "internal.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/avstring.h" + +#define SDP_MAX_SIZE 16384 + +int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr) +{ + RTSPState *rt = s->priv_data; + RTSPMessageHeader reply1, *reply = &reply1; + int i; + char *sdp; + AVFormatContext sdp_ctx, *ctx_array[1]; + + s->start_time_realtime = av_gettime(); + + /* Announce the stream */ + sdp = av_mallocz(SDP_MAX_SIZE); + if (sdp == NULL) + return AVERROR(ENOMEM); + /* We create the SDP based on the RTSP AVFormatContext where we + * aren't allowed to change the filename field. (We create the SDP + * based on the RTSP context since the contexts for the RTP streams + * don't exist yet.) In order to specify a custom URL with the actual + * peer IP instead of the originally specified hostname, we create + * a temporary copy of the AVFormatContext, where the custom URL is set. + * + * FIXME: Create the SDP without copying the AVFormatContext. + * This either requires setting up the RTP stream AVFormatContexts + * already here (complicating things immensely) or getting a more + * flexible SDP creation interface. + */ + sdp_ctx = *s; + ff_url_join(sdp_ctx.filename, sizeof(sdp_ctx.filename), + "rtsp", NULL, addr, -1, NULL); + ctx_array[0] = &sdp_ctx; + if (avf_sdp_create(ctx_array, 1, sdp, SDP_MAX_SIZE)) { + av_free(sdp); + return AVERROR_INVALIDDATA; + } + av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp); + ff_rtsp_send_cmd_with_content(s, "ANNOUNCE", rt->control_uri, + "Content-Type: application/sdp\r\n", + reply, NULL, sdp, strlen(sdp)); + av_free(sdp); + if (reply->status_code != RTSP_STATUS_OK) + return AVERROR_INVALIDDATA; + + /* Set up the RTSPStreams for each AVStream */ + for (i = 0; i < s->nb_streams; i++) { + RTSPStream *rtsp_st; + + rtsp_st = av_mallocz(sizeof(RTSPStream)); + if (!rtsp_st) + return AVERROR(ENOMEM); + dynarray_add(&rt->rtsp_streams, &rt->nb_rtsp_streams, rtsp_st); + + rtsp_st->stream_index = i; + + av_strlcpy(rtsp_st->control_url, rt->control_uri, sizeof(rtsp_st->control_url)); + /* Note, this must match the relative uri set in the sdp content */ + av_strlcatf(rtsp_st->control_url, sizeof(rtsp_st->control_url), + "/streamid=%d", i); + } + + return 0; +} + +static int rtsp_write_record(AVFormatContext *s) +{ + RTSPState *rt = s->priv_data; + RTSPMessageHeader reply1, *reply = &reply1; + char cmd[1024]; + + snprintf(cmd, sizeof(cmd), + "Range: npt=%0.3f-\r\n", + (double) 0); + ff_rtsp_send_cmd(s, "RECORD", rt->control_uri, cmd, reply, NULL); + if (reply->status_code != RTSP_STATUS_OK) + return -1; + rt->state = RTSP_STATE_STREAMING; + return 0; +} + +static int rtsp_write_header(AVFormatContext *s) +{ + int ret; + + ret = ff_rtsp_connect(s); + if (ret) + return ret; + + if (rtsp_write_record(s) < 0) { + ff_rtsp_close_streams(s); + ff_rtsp_close_connections(s); + return AVERROR_INVALIDDATA; + } + return 0; +} + +static int tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st) +{ + RTSPState *rt = s->priv_data; + AVFormatContext *rtpctx = rtsp_st->transport_priv; + uint8_t *buf, *ptr; + int size; + uint8_t *interleave_header, *interleaved_packet; + + size = url_close_dyn_buf(rtpctx->pb, &buf); + ptr = buf; + while (size > 4) { + uint32_t packet_len = AV_RB32(ptr); + int id; + /* The interleaving header is exactly 4 bytes, which happens to be + * the same size as the packet length header from + * url_open_dyn_packet_buf. So by writing the interleaving header + * over these bytes, we get a consecutive interleaved packet + * that can be written in one call. */ + interleaved_packet = interleave_header = ptr; + ptr += 4; + size -= 4; + if (packet_len > size || packet_len < 2) + break; + if (ptr[1] >= RTCP_SR && ptr[1] <= RTCP_APP) + id = rtsp_st->interleaved_max; /* RTCP */ + else + id = rtsp_st->interleaved_min; /* RTP */ + interleave_header[0] = '$'; + interleave_header[1] = id; + AV_WB16(interleave_header + 2, packet_len); + url_write(rt->rtsp_hd_out, interleaved_packet, 4 + packet_len); + ptr += packet_len; + size -= packet_len; + } + av_free(buf); + url_open_dyn_packet_buf(&rtpctx->pb, RTSP_TCP_MAX_PACKET_SIZE); + return 0; +} + +static int rtsp_write_packet(AVFormatContext *s, AVPacket *pkt) +{ + RTSPState *rt = s->priv_data; + RTSPStream *rtsp_st; + int n; + struct pollfd p = {url_get_file_handle(rt->rtsp_hd), POLLIN, 0}; + AVFormatContext *rtpctx; + int ret; + + while (1) { + n = poll(&p, 1, 0); + if (n <= 0) + break; + if (p.revents & POLLIN) { + RTSPMessageHeader reply; + + /* Don't let ff_rtsp_read_reply handle interleaved packets, + * since it would block and wait for an RTSP reply on the socket + * (which may not be coming any time soon) if it handles + * interleaved packets internally. */ + ret = ff_rtsp_read_reply(s, &reply, NULL, 1, NULL); + if (ret < 0) + return AVERROR(EPIPE); + if (ret == 1) + ff_rtsp_skip_packet(s); + /* XXX: parse message */ + if (rt->state != RTSP_STATE_STREAMING) + return AVERROR(EPIPE); + } + } + + if (pkt->stream_index < 0 || pkt->stream_index >= rt->nb_rtsp_streams) + return AVERROR_INVALIDDATA; + rtsp_st = rt->rtsp_streams[pkt->stream_index]; + rtpctx = rtsp_st->transport_priv; + + ret = ff_write_chained(rtpctx, 0, pkt, s); + /* ff_write_chained does all the RTP packetization. If using TCP as + * transport, rtpctx->pb is only a dyn_packet_buf that queues up the + * packets, so we need to send them out on the TCP connection separately. + */ + if (!ret && rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP) + ret = tcp_write_packet(s, rtsp_st); + return ret; +} + +static int rtsp_write_close(AVFormatContext *s) +{ + RTSPState *rt = s->priv_data; + + ff_rtsp_send_cmd_async(s, "TEARDOWN", rt->control_uri, NULL); + + ff_rtsp_close_streams(s); + ff_rtsp_close_connections(s); + ff_network_close(); + return 0; +} + +AVOutputFormat ff_rtsp_muxer = { + "rtsp", + NULL_IF_CONFIG_SMALL("RTSP output format"), + NULL, + NULL, + sizeof(RTSPState), + CODEC_ID_AAC, + CODEC_ID_MPEG4, + rtsp_write_header, + rtsp_write_packet, + rtsp_write_close, + .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER, +}; + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sapdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sapdec.c new file mode 100644 index 00000000..73525f5d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sapdec.c @@ -0,0 +1,235 @@ +/* + * Session Announcement Protocol (RFC 2974) demuxer + * Copyright (c) 2010 Martin Storsjo + * + * 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 + */ + +#include "avformat.h" +#include "libavutil/avstring.h" +#include "libavutil/intreadwrite.h" +#include "network.h" +#include "os_support.h" +#include "internal.h" +#if HAVE_POLL_H +#include +#endif +#include + +struct SAPState { + URLContext *ann_fd; + AVFormatContext *sdp_ctx; + ByteIOContext sdp_pb; + uint16_t hash; + char *sdp; + int eof; +}; + +static int sap_probe(AVProbeData *p) +{ + if (av_strstart(p->filename, "sap:", NULL)) + return AVPROBE_SCORE_MAX; + return 0; +} + +static int sap_read_close(AVFormatContext *s) +{ + struct SAPState *sap = s->priv_data; + if (sap->sdp_ctx) + av_close_input_stream(sap->sdp_ctx); + if (sap->ann_fd) + url_close(sap->ann_fd); + av_freep(&sap->sdp); + ff_network_close(); + return 0; +} + +static int sap_read_header(AVFormatContext *s, + AVFormatParameters *ap) +{ + struct SAPState *sap = s->priv_data; + char host[1024], path[1024], url[1024]; + uint8_t recvbuf[1500]; + int port; + int ret, i; + AVInputFormat* infmt; + + if (!ff_network_init()) + return AVERROR(EIO); + + av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port, + path, sizeof(path), s->filename); + if (port < 0) + port = 9875; + + if (!host[0]) { + /* Listen for announcements on sap.mcast.net if no host was specified */ + av_strlcpy(host, "224.2.127.254", sizeof(host)); + } + + ff_url_join(url, sizeof(url), "udp", NULL, host, port, "?localport=%d", + port); + ret = url_open(&sap->ann_fd, url, URL_RDONLY); + if (ret) + goto fail; + + while (1) { + int addr_type, auth_len; + int pos; + + ret = url_read(sap->ann_fd, recvbuf, sizeof(recvbuf) - 1); + if (ret == AVERROR(EAGAIN)) + continue; + if (ret < 0) + goto fail; + recvbuf[ret] = '\0'; /* Null terminate for easier parsing */ + if (ret < 8) { + av_log(s, AV_LOG_WARNING, "Received too short packet\n"); + continue; + } + + if ((recvbuf[0] & 0xe0) != 0x20) { + av_log(s, AV_LOG_WARNING, "Unsupported SAP version packet " + "received\n"); + continue; + } + + if (recvbuf[0] & 0x04) { + av_log(s, AV_LOG_WARNING, "Received stream deletion " + "announcement\n"); + continue; + } + addr_type = recvbuf[0] & 0x10; + auth_len = recvbuf[1]; + sap->hash = AV_RB16(&recvbuf[2]); + pos = 4; + if (addr_type) + pos += 16; /* IPv6 */ + else + pos += 4; /* IPv4 */ + pos += auth_len * 4; + if (pos + 4 >= ret) { + av_log(s, AV_LOG_WARNING, "Received too short packet\n"); + continue; + } +#define MIME "application/sdp" + if (strcmp(&recvbuf[pos], MIME) == 0) { + pos += strlen(MIME) + 1; + } else if (strncmp(&recvbuf[pos], "v=0\r\n", 5) == 0) { + // Direct SDP without a mime type + } else { + av_log(s, AV_LOG_WARNING, "Unsupported mime type %s\n", + &recvbuf[pos]); + continue; + } + + sap->sdp = av_strdup(&recvbuf[pos]); + break; + } + + av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sap->sdp); + init_put_byte(&sap->sdp_pb, sap->sdp, strlen(sap->sdp), 0, NULL, NULL, + NULL, NULL); + + infmt = av_find_input_format("sdp"); + if (!infmt) + goto fail; + sap->sdp_ctx = avformat_alloc_context(); + if (!sap->sdp_ctx) { + ret = AVERROR(ENOMEM); + goto fail; + } + sap->sdp_ctx->max_delay = s->max_delay; + ap->prealloced_context = 1; + ret = av_open_input_stream(&sap->sdp_ctx, &sap->sdp_pb, "temp.sdp", + infmt, ap); + if (ret < 0) + goto fail; + if (sap->sdp_ctx->ctx_flags & AVFMTCTX_NOHEADER) + s->ctx_flags |= AVFMTCTX_NOHEADER; + for (i = 0; i < sap->sdp_ctx->nb_streams; i++) { + AVStream *st = av_new_stream(s, i); + if (!st) { + ret = AVERROR(ENOMEM); + goto fail; + } + avcodec_copy_context(st->codec, sap->sdp_ctx->streams[i]->codec); + st->time_base = sap->sdp_ctx->streams[i]->time_base; + } + + return 0; + +fail: + sap_read_close(s); + return ret; +} + +static int sap_fetch_packet(AVFormatContext *s, AVPacket *pkt) +{ + struct SAPState *sap = s->priv_data; + int fd = url_get_file_handle(sap->ann_fd); + int n, ret; + struct pollfd p = {fd, POLLIN, 0}; + uint8_t recvbuf[1500]; + + if (sap->eof) + return AVERROR_EOF; + + while (1) { + n = poll(&p, 1, 0); + if (n <= 0 || !(p.revents & POLLIN)) + break; + ret = url_read(sap->ann_fd, recvbuf, sizeof(recvbuf)); + if (ret >= 8) { + uint16_t hash = AV_RB16(&recvbuf[2]); + /* Should ideally check the source IP address, too */ + if (recvbuf[0] & 0x04 && hash == sap->hash) { + /* Stream deletion */ + sap->eof = 1; + return AVERROR_EOF; + } + } + } + ret = av_read_frame(sap->sdp_ctx, pkt); + if (ret < 0) + return ret; + if (s->ctx_flags & AVFMTCTX_NOHEADER) { + while (sap->sdp_ctx->nb_streams > s->nb_streams) { + int i = s->nb_streams; + AVStream *st = av_new_stream(s, i); + if (!st) { + av_free_packet(pkt); + return AVERROR(ENOMEM); + } + avcodec_copy_context(st->codec, sap->sdp_ctx->streams[i]->codec); + st->time_base = sap->sdp_ctx->streams[i]->time_base; + } + } + return ret; +} + +AVInputFormat ff_sap_demuxer = { + "sap", + NULL_IF_CONFIG_SMALL("SAP input format"), + sizeof(struct SAPState), + sap_probe, + sap_read_header, + sap_fetch_packet, + sap_read_close, + .flags = AVFMT_NOFILE, +}; + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sapenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sapenc.c new file mode 100644 index 00000000..b14c511c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sapenc.c @@ -0,0 +1,266 @@ +/* + * Session Announcement Protocol (RFC 2974) muxer + * Copyright (c) 2010 Martin Storsjo + * + * 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 + */ + +#include "avformat.h" +#include "libavutil/random_seed.h" +#include "libavutil/avstring.h" +#include "libavutil/intreadwrite.h" +#include "internal.h" +#include "network.h" +#include "os_support.h" +#include "rtpenc_chain.h" + +struct SAPState { + uint8_t *ann; + int ann_size; + URLContext *ann_fd; + int64_t last_time; +}; + +static int sap_write_close(AVFormatContext *s) +{ + struct SAPState *sap = s->priv_data; + int i; + + for (i = 0; i < s->nb_streams; i++) { + AVFormatContext *rtpctx = s->streams[i]->priv_data; + if (!rtpctx) + continue; + av_write_trailer(rtpctx); + url_fclose(rtpctx->pb); + av_metadata_free(&rtpctx->streams[0]->metadata); + av_metadata_free(&rtpctx->metadata); + av_free(rtpctx->streams[0]); + av_free(rtpctx); + s->streams[i]->priv_data = NULL; + } + + if (sap->last_time && sap->ann && sap->ann_fd) { + sap->ann[0] |= 4; /* Session deletion*/ + url_write(sap->ann_fd, sap->ann, sap->ann_size); + } + + av_freep(&sap->ann); + if (sap->ann_fd) + url_close(sap->ann_fd); + ff_network_close(); + return 0; +} + +static int sap_write_header(AVFormatContext *s) +{ + struct SAPState *sap = s->priv_data; + char host[1024], path[1024], url[1024], announce_addr[50] = ""; + char *option_list; + int port = 9875, base_port = 5004, i, pos = 0, same_port = 0, ttl = 255; + AVFormatContext **contexts = NULL; + int ret = 0; + struct sockaddr_storage localaddr; + socklen_t addrlen = sizeof(localaddr); + int udp_fd; + + if (!ff_network_init()) + return AVERROR(EIO); + + /* extract hostname and port */ + av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &base_port, + path, sizeof(path), s->filename); + if (base_port < 0) + base_port = 5004; + + /* search for options */ + option_list = strrchr(path, '?'); + if (option_list) { + char buf[50]; + if (find_info_tag(buf, sizeof(buf), "announce_port", option_list)) { + port = strtol(buf, NULL, 10); + } + if (find_info_tag(buf, sizeof(buf), "same_port", option_list)) { + same_port = strtol(buf, NULL, 10); + } + if (find_info_tag(buf, sizeof(buf), "ttl", option_list)) { + ttl = strtol(buf, NULL, 10); + } + if (find_info_tag(buf, sizeof(buf), "announce_addr", option_list)) { + av_strlcpy(announce_addr, buf, sizeof(announce_addr)); + } + } + + if (!announce_addr[0]) { + struct addrinfo hints, *ai = NULL; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + if (getaddrinfo(host, NULL, &hints, &ai)) { + av_log(s, AV_LOG_ERROR, "Unable to resolve %s\n", host); + ret = AVERROR(EIO); + goto fail; + } + if (ai->ai_family == AF_INET) { + /* Also known as sap.mcast.net */ + av_strlcpy(announce_addr, "224.2.127.254", sizeof(announce_addr)); +#if HAVE_STRUCT_SOCKADDR_IN6 + } else if (ai->ai_family == AF_INET6) { + /* With IPv6, you can use the same destination in many different + * multicast subnets, to choose how far you want it routed. + * This one is intended to be routed globally. */ + av_strlcpy(announce_addr, "ff0e::2:7ffe", sizeof(announce_addr)); +#endif + } else { + freeaddrinfo(ai); + av_log(s, AV_LOG_ERROR, "Host %s resolved to unsupported " + "address family\n", host); + ret = AVERROR(EIO); + goto fail; + } + freeaddrinfo(ai); + } + + contexts = av_mallocz(sizeof(AVFormatContext*) * s->nb_streams); + if (!contexts) { + ret = AVERROR(ENOMEM); + goto fail; + } + + s->start_time_realtime = av_gettime(); + for (i = 0; i < s->nb_streams; i++) { + URLContext *fd; + + ff_url_join(url, sizeof(url), "rtp", NULL, host, base_port, + "?ttl=%d", ttl); + if (!same_port) + base_port += 2; + ret = url_open(&fd, url, URL_WRONLY); + if (ret) { + ret = AVERROR(EIO); + goto fail; + } + s->streams[i]->priv_data = contexts[i] = + ff_rtp_chain_mux_open(s, s->streams[i], fd, 0); + av_strlcpy(contexts[i]->filename, url, sizeof(contexts[i]->filename)); + } + + ff_url_join(url, sizeof(url), "udp", NULL, announce_addr, port, + "?ttl=%d&connect=1", ttl); + ret = url_open(&sap->ann_fd, url, URL_WRONLY); + if (ret) { + ret = AVERROR(EIO); + goto fail; + } + + udp_fd = url_get_file_handle(sap->ann_fd); + if (getsockname(udp_fd, (struct sockaddr*) &localaddr, &addrlen)) { + ret = AVERROR(EIO); + goto fail; + } + if (localaddr.ss_family != AF_INET +#if HAVE_STRUCT_SOCKADDR_IN6 + && localaddr.ss_family != AF_INET6 +#endif + ) { + av_log(s, AV_LOG_ERROR, "Unsupported protocol family\n"); + ret = AVERROR(EIO); + goto fail; + } + sap->ann_size = 8192; + sap->ann = av_mallocz(sap->ann_size); + if (!sap->ann) { + ret = AVERROR(EIO); + goto fail; + } + sap->ann[pos] = (1 << 5); +#if HAVE_STRUCT_SOCKADDR_IN6 + if (localaddr.ss_family == AF_INET6) + sap->ann[pos] |= 0x10; +#endif + pos++; + sap->ann[pos++] = 0; /* Authentication length */ + AV_WB16(&sap->ann[pos], av_get_random_seed()); + pos += 2; + if (localaddr.ss_family == AF_INET) { + memcpy(&sap->ann[pos], &((struct sockaddr_in*)&localaddr)->sin_addr, + sizeof(struct in_addr)); + pos += sizeof(struct in_addr); +#if HAVE_STRUCT_SOCKADDR_IN6 + } else { + memcpy(&sap->ann[pos], &((struct sockaddr_in6*)&localaddr)->sin6_addr, + sizeof(struct in6_addr)); + pos += sizeof(struct in6_addr); +#endif + } + + av_strlcpy(&sap->ann[pos], "application/sdp", sap->ann_size - pos); + pos += strlen(&sap->ann[pos]) + 1; + + if (avf_sdp_create(contexts, s->nb_streams, &sap->ann[pos], + sap->ann_size - pos)) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + av_freep(&contexts); + av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", &sap->ann[pos]); + pos += strlen(&sap->ann[pos]); + sap->ann_size = pos; + + if (sap->ann_size > url_get_max_packet_size(sap->ann_fd)) { + av_log(s, AV_LOG_ERROR, "Announcement too large to send in one " + "packet\n"); + goto fail; + } + + return 0; + +fail: + av_free(contexts); + sap_write_close(s); + return ret; +} + +static int sap_write_packet(AVFormatContext *s, AVPacket *pkt) +{ + AVFormatContext *rtpctx; + struct SAPState *sap = s->priv_data; + int64_t now = av_gettime(); + + if (!sap->last_time || now - sap->last_time > 5000000) { + int ret = url_write(sap->ann_fd, sap->ann, sap->ann_size); + /* Don't abort even if we get "Destination unreachable" */ + if (ret < 0 && ret != FF_NETERROR(ECONNREFUSED)) + return ret; + sap->last_time = now; + } + rtpctx = s->streams[pkt->stream_index]->priv_data; + return ff_write_chained(rtpctx, 0, pkt, s); +} + +AVOutputFormat ff_sap_muxer = { + "sap", + NULL_IF_CONFIG_SMALL("SAP output format"), + NULL, + NULL, + sizeof(struct SAPState), + CODEC_ID_AAC, + CODEC_ID_MPEG4, + sap_write_header, + sap_write_packet, + sap_write_close, + .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER, +}; + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sauce.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sauce.c new file mode 100644 index 00000000..4972d339 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sauce.c @@ -0,0 +1,103 @@ +/* + * SAUCE header parser + * Copyright (c) 2010 Peter Ross + * + * 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 + * SAUCE header parser + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "sauce.h" + +int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int get_height) +{ + ByteIOContext *pb = avctx->pb; + char buf[36]; + int datatype, filetype, t1, t2, nb_comments, flags; + uint64_t start_pos = url_fsize(pb) - 128; + + url_fseek(pb, start_pos, SEEK_SET); + if (get_buffer(pb, buf, 7) != 7) + return -1; + if (memcmp(buf, "SAUCE00", 7)) + return -1; + +#define GET_SAUCE_META(name,size) \ + if (get_buffer(pb, buf, size) == size && buf[0]) { \ + buf[size] = 0; \ + av_metadata_set2(&avctx->metadata, name, buf, 0); \ + } + + GET_SAUCE_META("title", 35) + GET_SAUCE_META("artist", 20) + GET_SAUCE_META("publisher", 20) + GET_SAUCE_META("date", 8) + url_fskip(pb, 4); + datatype = get_byte(pb); + filetype = get_byte(pb); + t1 = get_le16(pb); + t2 = get_le16(pb); + nb_comments = get_byte(pb); + flags = get_byte(pb); + url_fskip(pb, 4); + GET_SAUCE_META("encoder", 22); + + if (got_width && datatype && filetype) { + if ((datatype == 1 && filetype <=2) || (datatype == 5 && filetype == 255) || datatype == 6) { + if (t1) { + avctx->streams[0]->codec->width = t1<<3; + *got_width = 1; + } + if (get_height && t2) + avctx->streams[0]->codec->height = t2<<4; + } else if (datatype == 5) { + if (filetype > 1) { + avctx->streams[0]->codec->width = (filetype == 1 ? t1 : filetype) << 4; + *got_width = 1; + } + if (get_height && t2) + avctx->streams[0]->codec->height = t2<<4; + } + } + + *fsize -= 128; + + if (nb_comments > 0) { + url_fseek(pb, start_pos - 64*nb_comments - 5, SEEK_SET); + if (get_buffer(pb, buf, 5) == 5 && !memcmp(buf, "COMNT", 5)) { + int i; + char *str = av_malloc(65*nb_comments + 1); + *fsize -= 64*nb_comments + 5; + if (!str) + return 0; + for (i = 0; i < nb_comments; i++) { + if (get_buffer(pb, str + 65*i, 64) != 64) + break; + str[65*i + 64] = '\n'; + } + str[65*i] = 0; + av_metadata_set2(&avctx->metadata, "comment", str, AV_METADATA_DONT_STRDUP_VAL); + } + } + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sauce.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sauce.h new file mode 100644 index 00000000..0ba9ae5b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/sauce.h @@ -0,0 +1,40 @@ +/* + * SAUCE header parser + * Copyright (c) 2010 Peter Ross + * + * 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 + * SAUCE header parser + */ + +#ifndef AVFORMAT_SAUCE_H +#define AVFORMAT_SAUCE_H + +#include "avformat.h" + +/** + * @param avctx AVFormatContext + * @param[out] fsize return length of file, less SAUCE header + * @param[out] got_width set to non-zero if SAUCE header reported height + * @param get_height Tell SAUCE header to parse height + */ +int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int get_height); + +#endif /* AVFORMAT_SAUCE_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/spdif.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/spdif.h new file mode 100644 index 00000000..ac5be7c3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/spdif.h @@ -0,0 +1,57 @@ +/* + * IEC 61937 common header + * Copyright (c) 2009 Bartlomiej Wolowiec + * + * 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 + */ + +#include + +#define SYNCWORD1 0xF872 +#define SYNCWORD2 0x4E1F +#define BURST_HEADER_SIZE 0x8 + +enum IEC61937DataType { + IEC61937_AC3 = 0x01, ///< AC-3 data + IEC61937_MPEG1_LAYER1 = 0x04, ///< MPEG-1 layer 1 + IEC61937_MPEG1_LAYER23 = 0x05, ///< MPEG-1 layer 2 or 3 data or MPEG-2 without extension + IEC61937_MPEG2_EXT = 0x06, ///< MPEG-2 data with extension + IEC61937_MPEG2_AAC = 0x07, ///< MPEG-2 AAC ADTS + IEC61937_MPEG2_LAYER1_LSF = 0x08, ///< MPEG-2, layer-1 low sampling frequency + IEC61937_MPEG2_LAYER2_LSF = 0x09, ///< MPEG-2, layer-2 low sampling frequency + IEC61937_MPEG2_LAYER3_LSF = 0x0A, ///< MPEG-2, layer-3 low sampling frequency + IEC61937_DTS1 = 0x0B, ///< DTS type I (512 samples) + IEC61937_DTS2 = 0x0C, ///< DTS type II (1024 samples) + IEC61937_DTS3 = 0x0D, ///< DTS type III (2048 samples) + IEC61937_ATRAC = 0x0E, ///< Atrac data + IEC61937_ATRAC3 = 0x0F, ///< Atrac 3 data + IEC61937_ATRACX = 0x10, ///< Atrac 3 plus data + IEC61937_DTSHD = 0x11, ///< DTS HD data + IEC61937_WMAPRO = 0x12, ///< WMA 9 Professional data + IEC61937_MPEG2_AAC_LSF_2048 = 0x13, ///< MPEG-2 AAC ADTS half-rate low sampling frequency + IEC61937_MPEG2_AAC_LSF_4096 = 0x13 | 0x20, ///< MPEG-2 AAC ADTS quarter-rate low sampling frequency + IEC61937_EAC3 = 0x15, ///< E-AC-3 data + IEC61937_TRUEHD = 0x16, ///< TrueHD data +}; + +static const uint16_t spdif_mpeg_pkt_offset[2][3] = { + //LAYER1 LAYER2 LAYER3 + { 3072, 9216, 4608 }, // MPEG2 LSF + { 1536, 4608, 4608 }, // MPEG1 +}; + +void ff_spdif_bswap_buf16(uint16_t *dst, const uint16_t *src, int w); diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/spdifdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/spdifdec.c new file mode 100644 index 00000000..5c4dba08 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/spdifdec.c @@ -0,0 +1,236 @@ +/* + * IEC 61937 demuxer + * Copyright (c) 2010 Anssi Hannula + * + * 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 + * IEC 61937 demuxer, used for compressed data in S/PDIF + * @author Anssi Hannula + */ + +#include "avformat.h" +#include "spdif.h" +#include "libavcodec/ac3.h" +#include "libavcodec/aacadtsdec.h" + +static int spdif_get_offset_and_codec(AVFormatContext *s, + enum IEC61937DataType data_type, + const char *buf, int *offset, + enum CodecID *codec) +{ + AACADTSHeaderInfo aac_hdr; + GetBitContext gbc; + + switch (data_type & 0xff) { + case IEC61937_AC3: + *offset = AC3_FRAME_SIZE << 2; + *codec = CODEC_ID_AC3; + break; + case IEC61937_MPEG1_LAYER1: + *offset = spdif_mpeg_pkt_offset[1][0]; + *codec = CODEC_ID_MP1; + break; + case IEC61937_MPEG1_LAYER23: + *offset = spdif_mpeg_pkt_offset[1][0]; + *codec = CODEC_ID_MP3; + break; + case IEC61937_MPEG2_EXT: + *offset = 4608; + *codec = CODEC_ID_MP3; + break; + case IEC61937_MPEG2_AAC: + init_get_bits(&gbc, buf, AAC_ADTS_HEADER_SIZE * 8); + if (ff_aac_parse_header(&gbc, &aac_hdr)) { + if (s) /* be silent during a probe */ + av_log(s, AV_LOG_ERROR, "Invalid AAC packet in IEC 61937\n"); + return AVERROR_INVALIDDATA; + } + *offset = aac_hdr.samples << 2; + *codec = CODEC_ID_AAC; + break; + case IEC61937_MPEG2_LAYER1_LSF: + *offset = spdif_mpeg_pkt_offset[0][0]; + *codec = CODEC_ID_MP1; + break; + case IEC61937_MPEG2_LAYER2_LSF: + *offset = spdif_mpeg_pkt_offset[0][1]; + *codec = CODEC_ID_MP2; + break; + case IEC61937_MPEG2_LAYER3_LSF: + *offset = spdif_mpeg_pkt_offset[0][2]; + *codec = CODEC_ID_MP3; + break; + case IEC61937_DTS1: + *offset = 2048; + *codec = CODEC_ID_DTS; + break; + case IEC61937_DTS2: + *offset = 4096; + *codec = CODEC_ID_DTS; + break; + case IEC61937_DTS3: + *offset = 8192; + *codec = CODEC_ID_DTS; + break; + default: + if (s) { /* be silent during a probe */ + av_log(s, AV_LOG_WARNING, "Data type 0x%04x", data_type); + av_log_missing_feature(s, " in IEC 61937 is", 1); + } + return AVERROR_PATCHWELCOME; + } + return 0; +} + +/* Largest offset between bursts we currently handle, i.e. AAC with + aac_hdr.samples = 4096 */ +#define SPDIF_MAX_OFFSET 16384 + +static int spdif_probe(AVProbeData *p) +{ + const uint8_t *buf = p->buf; + const uint8_t *probe_end = p->buf + FFMIN(2 * SPDIF_MAX_OFFSET, p->buf_size - 1); + const uint8_t *expected_code = buf + 7; + uint32_t state = 0; + int sync_codes = 0; + int consecutive_codes = 0; + int offset; + enum CodecID codec; + + for (; buf < probe_end; buf++) { + state = (state << 8) | *buf; + + if (state == (AV_BSWAP16C(SYNCWORD1) << 16 | AV_BSWAP16C(SYNCWORD2)) + && buf[1] < 0x37) { + sync_codes++; + + if (buf == expected_code) { + if (++consecutive_codes >= 2) + return AVPROBE_SCORE_MAX; + } else + consecutive_codes = 0; + + if (buf + 4 + AAC_ADTS_HEADER_SIZE > p->buf + p->buf_size) + break; + + /* continue probing to find more sync codes */ + probe_end = FFMIN(buf + SPDIF_MAX_OFFSET, p->buf + p->buf_size - 1); + + /* skip directly to the next sync code */ + if (!spdif_get_offset_and_codec(NULL, (buf[2] << 8) | buf[1], + &buf[5], &offset, &codec)) { + if (buf + offset >= p->buf + p->buf_size) + break; + expected_code = buf + offset; + buf = expected_code - 7; + } + } + } + + if (!sync_codes) + return 0; + + if (sync_codes >= 6) + /* good amount of sync codes but with unexpected offsets */ + return AVPROBE_SCORE_MAX / 2; + + /* some sync codes were found */ + return AVPROBE_SCORE_MAX / 8; +} + +static int spdif_read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + s->ctx_flags |= AVFMTCTX_NOHEADER; + return 0; +} + +static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + ByteIOContext *pb = s->pb; + enum IEC61937DataType data_type; + enum CodecID codec_id; + uint32_t state = 0; + int pkt_size_bits, offset, ret; + + while (state != (AV_BSWAP16C(SYNCWORD1) << 16 | AV_BSWAP16C(SYNCWORD2))) { + state = (state << 8) | get_byte(pb); + if (url_feof(pb)) + return AVERROR_EOF; + } + + data_type = get_le16(pb); + pkt_size_bits = get_le16(pb); + + if (pkt_size_bits % 16) + av_log_ask_for_sample(s, "Packet does not end to a 16-bit boundary."); + + ret = av_new_packet(pkt, FFALIGN(pkt_size_bits, 16) >> 3); + if (ret) + return ret; + + pkt->pos = url_ftell(pb) - BURST_HEADER_SIZE; + + if (get_buffer(pb, pkt->data, pkt->size) < pkt->size) { + av_free_packet(pkt); + return AVERROR_EOF; + } + ff_spdif_bswap_buf16((uint16_t *)pkt->data, (uint16_t *)pkt->data, pkt->size >> 1); + + ret = spdif_get_offset_and_codec(s, data_type, pkt->data, + &offset, &codec_id); + if (ret) { + av_free_packet(pkt); + return ret; + } + + /* skip over the padding to the beginning of the next frame */ + url_fskip(pb, offset - pkt->size - BURST_HEADER_SIZE); + + if (!s->nb_streams) { + /* first packet, create a stream */ + AVStream *st = av_new_stream(s, 0); + if (!st) { + av_free_packet(pkt); + return AVERROR(ENOMEM); + } + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; + st->codec->codec_id = codec_id; + } else if (codec_id != s->streams[0]->codec->codec_id) { + av_log_missing_feature(s, "codec change in IEC 61937", 0); + return AVERROR_PATCHWELCOME; + } + + if (!s->bit_rate && s->streams[0]->codec->sample_rate) + /* stream bitrate matches 16-bit stereo PCM bitrate for currently + supported codecs */ + s->bit_rate = 2 * 16 * s->streams[0]->codec->sample_rate; + + return 0; +} + +AVInputFormat ff_spdif_demuxer = { + "spdif", + NULL_IF_CONFIG_SMALL("IEC 61937 (compressed data in S/PDIF)"), + 0, + spdif_probe, + spdif_read_header, + spdif_read_packet, + .flags = AVFMT_GENERIC_INDEX, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/spdifenc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/spdifenc.c new file mode 100644 index 00000000..9b0001cd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/spdifenc.c @@ -0,0 +1,419 @@ +/* + * IEC 61937 muxer + * Copyright (c) 2009 Bartlomiej Wolowiec + * Copyright (c) 2010 Anssi Hannula + * Copyright (c) 2010 Carl Eugen Hoyos + * + * 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 + * IEC-61937 encapsulation of various formats, used by S/PDIF + * @author Bartlomiej Wolowiec + * @author Anssi Hannula + * @author Carl Eugen Hoyos + */ + +/* + * Terminology used in specification: + * data-burst - IEC61937 frame, contains header and encapsuled frame + * burst-preambule - IEC61937 frame header, contains 16-bits words named Pa, Pb, Pc and Pd + * burst-payload - encapsuled frame + * Pa, Pb - syncword - 0xF872, 0x4E1F + * Pc - burst-info, contains data-type (bits 0-6), error flag (bit 7), data-type-dependent info (bits 8-12) + * and bitstream number (bits 13-15) + * data-type - determines type of encapsuled frames + * Pd - length code (number of bits or bytes of encapsuled frame - according to data_type) + * + * IEC 61937 frames at normal usage start every specific count of bytes, + * dependent from data-type (spaces between packets are filled by zeros) + */ + +#include "avformat.h" +#include "spdif.h" +#include "libavcodec/ac3.h" +#include "libavcodec/dca.h" +#include "libavcodec/aacadtsdec.h" +#include "libavutil/opt.h" + +typedef struct IEC61937Context { + enum IEC61937DataType data_type;///< burst info - reference to type of payload of the data-burst + int length_code; ///< length code in bits or bytes, depending on data type + int pkt_offset; ///< data burst repetition period in bytes + uint8_t *buffer; ///< allocated buffer, used for swap bytes + int buffer_size; ///< size of allocated buffer + + uint8_t *out_buf; ///< pointer to the outgoing data before byte-swapping + int out_bytes; ///< amount of outgoing bytes + + int use_preamble; ///< preamble enabled (disabled for exactly pre-padded DTS) + int extra_bswap; ///< extra bswap for payload (for LE DTS => standard BE DTS) + + uint8_t *hd_buf; ///< allocated buffer to concatenate hd audio frames + int hd_buf_size; ///< size of the hd audio buffer + int hd_buf_count; ///< number of frames in the hd audio buffer + int hd_buf_filled; ///< amount of bytes in the hd audio buffer + + /* AVOptions: */ +#define SPDIF_FLAG_BIGENDIAN 0x01 + int spdif_flags; + + /// function, which generates codec dependent header information. + /// Sets data_type and pkt_offset, and length_code, out_bytes, out_buf if necessary + int (*header_info) (AVFormatContext *s, AVPacket *pkt); +} IEC61937Context; + +static const AVOption options[] = { +{ "spdif_flags", "IEC 61937 encapsulation flags", offsetof(IEC61937Context, spdif_flags), FF_OPT_TYPE_FLAGS, 0, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "spdif_flags" }, +{ "be", "output in big-endian format (for use as s16be)", 0, FF_OPT_TYPE_CONST, SPDIF_FLAG_BIGENDIAN, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "spdif_flags" }, +{ NULL }, +}; + +static const AVClass class = { "spdif", av_default_item_name, options, LIBAVUTIL_VERSION_INT }; + +static int spdif_header_ac3(AVFormatContext *s, AVPacket *pkt) +{ + IEC61937Context *ctx = s->priv_data; + int bitstream_mode = pkt->data[5] & 0x7; + + ctx->data_type = IEC61937_AC3 | (bitstream_mode << 8); + ctx->pkt_offset = AC3_FRAME_SIZE << 2; + return 0; +} + +static int spdif_header_eac3(AVFormatContext *s, AVPacket *pkt) +{ + IEC61937Context *ctx = s->priv_data; + static const uint8_t eac3_repeat[4] = {6, 3, 2, 1}; + int repeat = 1; + + if ((pkt->data[4] & 0xc0) != 0xc0) /* fscod */ + repeat = eac3_repeat[(pkt->data[4] & 0x30) >> 4]; /* numblkscod */ + + ctx->hd_buf = av_fast_realloc(ctx->hd_buf, &ctx->hd_buf_size, ctx->hd_buf_filled + pkt->size); + if (!ctx->hd_buf) + return AVERROR(ENOMEM); + + memcpy(&ctx->hd_buf[ctx->hd_buf_filled], pkt->data, pkt->size); + + ctx->hd_buf_filled += pkt->size; + if (++ctx->hd_buf_count < repeat){ + ctx->pkt_offset = 0; + return 0; + } + ctx->data_type = IEC61937_EAC3; + ctx->pkt_offset = 24576; + ctx->out_buf = ctx->hd_buf; + ctx->out_bytes = ctx->hd_buf_filled; + ctx->length_code = ctx->hd_buf_filled; + + ctx->hd_buf_count = 0; + ctx->hd_buf_filled = 0; + return 0; +} + +static int spdif_header_dts(AVFormatContext *s, AVPacket *pkt) +{ + IEC61937Context *ctx = s->priv_data; + uint32_t syncword_dts = AV_RB32(pkt->data); + int blocks; + + switch (syncword_dts) { + case DCA_MARKER_RAW_BE: + blocks = (AV_RB16(pkt->data + 4) >> 2) & 0x7f; + break; + case DCA_MARKER_RAW_LE: + blocks = (AV_RL16(pkt->data + 4) >> 2) & 0x7f; + ctx->extra_bswap = 1; + break; + case DCA_MARKER_14B_BE: + blocks = + (((pkt->data[5] & 0x07) << 4) | ((pkt->data[6] & 0x3f) >> 2)); + break; + case DCA_MARKER_14B_LE: + blocks = + (((pkt->data[4] & 0x07) << 4) | ((pkt->data[7] & 0x3f) >> 2)); + ctx->extra_bswap = 1; + break; + default: + av_log(s, AV_LOG_ERROR, "bad DTS syncword 0x%x\n", syncword_dts); + return AVERROR_INVALIDDATA; + } + blocks++; + switch (blocks) { + case 512 >> 5: ctx->data_type = IEC61937_DTS1; break; + case 1024 >> 5: ctx->data_type = IEC61937_DTS2; break; + case 2048 >> 5: ctx->data_type = IEC61937_DTS3; break; + default: + av_log(s, AV_LOG_ERROR, "%i samples in DTS frame not supported\n", + blocks << 5); + return AVERROR(ENOSYS); + } + ctx->pkt_offset = blocks << 7; + + if (ctx->out_bytes == ctx->pkt_offset) { + /* The DTS stream fits exactly into the output stream, so skip the + * preamble as it would not fit in there. This is the case for dts + * discs and dts-in-wav. */ + ctx->use_preamble = 0; + } + + return 0; +} + +static const enum IEC61937DataType mpeg_data_type[2][3] = { + // LAYER1 LAYER2 LAYER3 + { IEC61937_MPEG2_LAYER1_LSF, IEC61937_MPEG2_LAYER2_LSF, IEC61937_MPEG2_LAYER3_LSF },//MPEG2 LSF + { IEC61937_MPEG1_LAYER1, IEC61937_MPEG1_LAYER23, IEC61937_MPEG1_LAYER23 }, //MPEG1 +}; + +static int spdif_header_mpeg(AVFormatContext *s, AVPacket *pkt) +{ + IEC61937Context *ctx = s->priv_data; + int version = (pkt->data[1] >> 3) & 3; + int layer = 3 - ((pkt->data[1] >> 1) & 3); + int extension = pkt->data[2] & 1; + + if (layer == 3 || version == 1) { + av_log(s, AV_LOG_ERROR, "Wrong MPEG file format\n"); + return AVERROR_INVALIDDATA; + } + av_log(s, AV_LOG_DEBUG, "version: %i layer: %i extension: %i\n", version, layer, extension); + if (version == 2 && extension) { + ctx->data_type = IEC61937_MPEG2_EXT; + ctx->pkt_offset = 4608; + } else { + ctx->data_type = mpeg_data_type [version & 1][layer]; + ctx->pkt_offset = spdif_mpeg_pkt_offset[version & 1][layer]; + } + // TODO Data type dependant info (normal/karaoke, dynamic range control) + return 0; +} + +static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt) +{ + IEC61937Context *ctx = s->priv_data; + AACADTSHeaderInfo hdr; + GetBitContext gbc; + int ret; + + init_get_bits(&gbc, pkt->data, AAC_ADTS_HEADER_SIZE * 8); + ret = ff_aac_parse_header(&gbc, &hdr); + if (ret < 0) { + av_log(s, AV_LOG_ERROR, "Wrong AAC file format\n"); + return AVERROR_INVALIDDATA; + } + + ctx->pkt_offset = hdr.samples << 2; + switch (hdr.num_aac_frames) { + case 1: + ctx->data_type = IEC61937_MPEG2_AAC; + break; + case 2: + ctx->data_type = IEC61937_MPEG2_AAC_LSF_2048; + break; + case 4: + ctx->data_type = IEC61937_MPEG2_AAC_LSF_4096; + break; + default: + av_log(s, AV_LOG_ERROR, "%i samples in AAC frame not supported\n", + hdr.samples); + return AVERROR(EINVAL); + } + //TODO Data type dependent info (LC profile/SBR) + return 0; +} + + +/* + * It seems Dolby TrueHD frames have to be encapsulated in MAT frames before + * they can be encapsulated in IEC 61937. + * Here we encapsulate 24 TrueHD frames in a single MAT frame, padding them + * to achieve constant rate. + * The actual format of a MAT frame is unknown, but the below seems to work. + * However, it seems it is not actually necessary for the 24 TrueHD frames to + * be in an exact alignment with the MAT frame. + */ +#define MAT_FRAME_SIZE 61424 +#define TRUEHD_FRAME_OFFSET 2560 +#define MAT_MIDDLE_CODE_OFFSET -4 + +static int spdif_header_truehd(AVFormatContext *s, AVPacket *pkt) +{ + IEC61937Context *ctx = s->priv_data; + int mat_code_length = 0; + const char mat_end_code[16] = { 0xC3, 0xC2, 0xC0, 0xC4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x11 }; + + if (!ctx->hd_buf_count) { + const char mat_start_code[20] = { 0x07, 0x9E, 0x00, 0x03, 0x84, 0x01, 0x01, 0x01, 0x80, 0x00, 0x56, 0xA5, 0x3B, 0xF4, 0x81, 0x83, 0x49, 0x80, 0x77, 0xE0 }; + mat_code_length = sizeof(mat_start_code) + BURST_HEADER_SIZE; + memcpy(ctx->hd_buf, mat_start_code, sizeof(mat_start_code)); + + } else if (ctx->hd_buf_count == 12) { + const char mat_middle_code[12] = { 0xC3, 0xC1, 0x42, 0x49, 0x3B, 0xFA, 0x82, 0x83, 0x49, 0x80, 0x77, 0xE0 }; + mat_code_length = sizeof(mat_middle_code) + MAT_MIDDLE_CODE_OFFSET; + memcpy(&ctx->hd_buf[12 * TRUEHD_FRAME_OFFSET - BURST_HEADER_SIZE + MAT_MIDDLE_CODE_OFFSET], + mat_middle_code, sizeof(mat_middle_code)); + } + + if (pkt->size > TRUEHD_FRAME_OFFSET - mat_code_length) { + /* if such frames exist, we'd need some more complex logic to + * distribute the TrueHD frames in the MAT frame */ + av_log(s, AV_LOG_ERROR, "TrueHD frame too big, %d bytes\n", pkt->size); + av_log_ask_for_sample(s, NULL); + return AVERROR_INVALIDDATA; + } + + memcpy(&ctx->hd_buf[ctx->hd_buf_count * TRUEHD_FRAME_OFFSET - BURST_HEADER_SIZE + mat_code_length], + pkt->data, pkt->size); + memset(&ctx->hd_buf[ctx->hd_buf_count * TRUEHD_FRAME_OFFSET - BURST_HEADER_SIZE + mat_code_length + pkt->size], + 0, TRUEHD_FRAME_OFFSET - pkt->size - mat_code_length); + + if (++ctx->hd_buf_count < 24){ + ctx->pkt_offset = 0; + return 0; + } + memcpy(&ctx->hd_buf[MAT_FRAME_SIZE - sizeof(mat_end_code)], mat_end_code, sizeof(mat_end_code)); + ctx->hd_buf_count = 0; + + ctx->data_type = IEC61937_TRUEHD; + ctx->pkt_offset = 61440; + ctx->out_buf = ctx->hd_buf; + ctx->out_bytes = MAT_FRAME_SIZE; + ctx->length_code = MAT_FRAME_SIZE; + return 0; +} + +static int spdif_write_header(AVFormatContext *s) +{ + IEC61937Context *ctx = s->priv_data; + + switch (s->streams[0]->codec->codec_id) { + case CODEC_ID_AC3: + ctx->header_info = spdif_header_ac3; + break; + case CODEC_ID_EAC3: + ctx->header_info = spdif_header_eac3; + break; + case CODEC_ID_MP1: + case CODEC_ID_MP2: + case CODEC_ID_MP3: + ctx->header_info = spdif_header_mpeg; + break; + case CODEC_ID_DTS: + ctx->header_info = spdif_header_dts; + break; + case CODEC_ID_AAC: + ctx->header_info = spdif_header_aac; + break; + case CODEC_ID_TRUEHD: + ctx->header_info = spdif_header_truehd; + ctx->hd_buf = av_malloc(MAT_FRAME_SIZE); + if (!ctx->hd_buf) + return AVERROR(ENOMEM); + break; + default: + av_log(s, AV_LOG_ERROR, "codec not supported\n"); + return AVERROR_PATCHWELCOME; + } + return 0; +} + +static int spdif_write_trailer(AVFormatContext *s) +{ + IEC61937Context *ctx = s->priv_data; + av_freep(&ctx->buffer); + av_freep(&ctx->hd_buf); + return 0; +} + +static void spdif_put_16(struct AVFormatContext *s, unsigned int val) +{ + IEC61937Context *ctx = s->priv_data; + if (ctx->spdif_flags & SPDIF_FLAG_BIGENDIAN) + put_be16(s->pb, val); + else + put_le16(s->pb, val); +} + +static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt) +{ + IEC61937Context *ctx = s->priv_data; + int ret, padding; + + ctx->out_buf = pkt->data; + ctx->out_bytes = pkt->size; + ctx->length_code = FFALIGN(pkt->size, 2) << 3; + ctx->use_preamble = 1; + ctx->extra_bswap = 0; + + ret = ctx->header_info(s, pkt); + if (ret < 0) + return ret; + if (!ctx->pkt_offset) + return 0; + + padding = (ctx->pkt_offset - ctx->use_preamble * BURST_HEADER_SIZE - ctx->out_bytes) & ~1; + if (padding < 0) { + av_log(s, AV_LOG_ERROR, "bitrate is too high\n"); + return AVERROR(EINVAL); + } + + if (ctx->use_preamble) { + spdif_put_16(s, SYNCWORD1); //Pa + spdif_put_16(s, SYNCWORD2); //Pb + spdif_put_16(s, ctx->data_type); //Pc + spdif_put_16(s, ctx->length_code);//Pd + } + + if (ctx->extra_bswap ^ (ctx->spdif_flags & SPDIF_FLAG_BIGENDIAN)) { + put_buffer(s->pb, ctx->out_buf, ctx->out_bytes & ~1); + } else { + av_fast_malloc(&ctx->buffer, &ctx->buffer_size, ctx->out_bytes + FF_INPUT_BUFFER_PADDING_SIZE); + if (!ctx->buffer) + return AVERROR(ENOMEM); + ff_spdif_bswap_buf16((uint16_t *)ctx->buffer, (uint16_t *)ctx->out_buf, ctx->out_bytes >> 1); + put_buffer(s->pb, ctx->buffer, ctx->out_bytes & ~1); + } + + /* a final lone byte has to be MSB aligned */ + if (ctx->out_bytes & 1) + spdif_put_16(s, ctx->out_buf[ctx->out_bytes - 1] << 8); + + put_nbyte(s->pb, 0, padding); + + av_log(s, AV_LOG_DEBUG, "type=%x len=%i pkt_offset=%i\n", + ctx->data_type, ctx->out_bytes, ctx->pkt_offset); + + put_flush_packet(s->pb); + return 0; +} + +AVOutputFormat ff_spdif_muxer = { + "spdif", + NULL_IF_CONFIG_SMALL("IEC 61937 (used on S/PDIF - IEC958)"), + NULL, + "spdif", + sizeof(IEC61937Context), + CODEC_ID_AC3, + CODEC_ID_NONE, + spdif_write_header, + spdif_write_packet, + spdif_write_trailer, + .priv_class = &class, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/srtdec.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/srtdec.c new file mode 100644 index 00000000..17de8c91 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/srtdec.c @@ -0,0 +1,102 @@ +/* + * SubRip subtitle demuxer + * Copyright (c) 2010 Aurelien Jacobs + * + * 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 + */ + +#include "avformat.h" +#include "internal.h" +#include "libavutil/intreadwrite.h" + +static int srt_probe(AVProbeData *p) +{ + unsigned char *ptr = p->buf; + int i, v, num = 0; + + if (AV_RB24(ptr) == 0xEFBBBF) + ptr += 3; /* skip UTF-8 BOM */ + + for (i=0; i<2; i++) { + if (num == i && sscanf(ptr, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1) + return AVPROBE_SCORE_MAX; + num = atoi(ptr); + ptr += strcspn(ptr, "\n") + 1; + } + return 0; +} + +static int srt_read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + AVStream *st = av_new_stream(s, 0); + if (!st) + return -1; + av_set_pts_info(st, 64, 1, 1000); + st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; + st->codec->codec_id = CODEC_ID_SRT; + return 0; +} + +static int64_t get_pts(const char *buf) +{ + int i, v, hour, min, sec, hsec; + + for (i=0; i<2; i++) { + if (sscanf(buf, "%d:%2d:%2d%*1[,.]%3d --> %*d:%*2d:%*2d%*1[,.]%3d", + &hour, &min, &sec, &hsec, &v) == 5) { + min += 60*hour; + sec += 60*min; + return sec*1000+hsec; + } + buf += strcspn(buf, "\n") + 1; + } + return AV_NOPTS_VALUE; +} + +static inline int is_eol(char c) +{ + return c == '\r' || c == '\n'; +} + +static int srt_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + char buffer[2048], *ptr = buffer, *ptr2; + int64_t pos = url_ftell(s->pb); + int res = AVERROR_EOF; + + do { + ptr2 = ptr; + ptr += ff_get_line(s->pb, ptr, sizeof(buffer)+buffer-ptr); + } while (!is_eol(*ptr2) && !url_feof(s->pb) && ptr-bufferdata, buffer, pkt->size); + pkt->flags |= AV_PKT_FLAG_KEY; + pkt->pos = pos; + pkt->pts = pkt->dts = get_pts(pkt->data); + } + return res; +} + +AVInputFormat ff_srt_demuxer = { + .name = "srt", + .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle format"), + .read_probe = srt_probe, + .read_header = srt_read_header, + .read_packet = srt_read_packet, + .flags = AVFMT_GENERIC_INDEX, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/tty.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/tty.c new file mode 100644 index 00000000..0adbaf1f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/tty.c @@ -0,0 +1,134 @@ +/* + * Tele-typewriter demuxer + * Copyright (c) 2010 Peter Ross + * + * 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 + * Tele-typewriter demuxer + */ + +#include "libavutil/intreadwrite.h" +#include "libavutil/avstring.h" +#include "avformat.h" +#include "sauce.h" + +#define LINE_RATE 6000 /* characters per second */ + +typedef struct { + int chars_per_frame; + uint64_t fsize; /**< file size less metadata buffer */ +} TtyDemuxContext; + +/** + * Parse EFI header + */ +static int efi_read(AVFormatContext *avctx, uint64_t start_pos) +{ + TtyDemuxContext *s = avctx->priv_data; + ByteIOContext *pb = avctx->pb; + char buf[37]; + int len; + + url_fseek(pb, start_pos, SEEK_SET); + if (get_byte(pb) != 0x1A) + return -1; + +#define GET_EFI_META(name,size) \ + len = get_byte(pb); \ + if (len < 1 || len > size) \ + return -1; \ + if (get_buffer(pb, buf, size) == size) { \ + buf[len] = 0; \ + av_metadata_set2(&avctx->metadata, name, buf, 0); \ + } + + GET_EFI_META("filename", 12) + GET_EFI_META("title", 36) + + s->fsize = start_pos; + return 0; +} + +static int read_header(AVFormatContext *avctx, + AVFormatParameters *ap) +{ + TtyDemuxContext *s = avctx->priv_data; + AVStream *st = av_new_stream(avctx, 0); + if (!st) + return AVERROR(ENOMEM); + st->codec->codec_tag = 0; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + st->codec->codec_id = CODEC_ID_ANSI; + if (ap->width) st->codec->width = ap->width; + if (ap->height) st->codec->height = ap->height; + + if (!ap->time_base.num) { + av_set_pts_info(st, 60, 1, 25); + } else { + av_set_pts_info(st, 60, ap->time_base.num, ap->time_base.den); + } + + /* simulate tty display speed */ + s->chars_per_frame = FFMAX(av_q2d(st->time_base) * (ap->sample_rate ? ap->sample_rate : LINE_RATE), 1); + + if (!url_is_streamed(avctx->pb)) { + s->fsize = url_fsize(avctx->pb); + st->duration = (s->fsize + s->chars_per_frame - 1) / s->chars_per_frame; + + if (ff_sauce_read(avctx, &s->fsize, 0, 0) < 0) + efi_read(avctx, s->fsize - 51); + + url_fseek(avctx->pb, 0, SEEK_SET); + } + + return 0; +} + +static int read_packet(AVFormatContext *avctx, AVPacket *pkt) +{ + TtyDemuxContext *s = avctx->priv_data; + int n; + + if (url_feof(avctx->pb)) + return AVERROR_EOF; + + n = s->chars_per_frame; + if (s->fsize) { + // ignore metadata buffer + uint64_t p = url_ftell(avctx->pb); + if (p + s->chars_per_frame > s->fsize) + n = s->fsize - p; + } + + pkt->size = av_get_packet(avctx->pb, pkt, n); + if (pkt->size <= 0) + return AVERROR(EIO); + pkt->flags |= PKT_FLAG_KEY; + return 0; +} + +AVInputFormat ff_tty_demuxer = { + .name = "tty", + .long_name = NULL_IF_CONFIG_SMALL("Tele-typewriter"), + .priv_data_size = sizeof(TtyDemuxContext), + .read_header = read_header, + .read_packet = read_packet, + .extensions = "ans,art,asc,diz,ice,nfo,txt,vt", +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vorbiscomment.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vorbiscomment.c new file mode 100644 index 00000000..59a403f2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vorbiscomment.c @@ -0,0 +1,74 @@ +/* + * VorbisComment writer + * Copyright (c) 2009 James Darnley + * + * 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 + */ + +#include "avformat.h" +#include "metadata.h" +#include "vorbiscomment.h" +#include "libavcodec/bytestream.h" + +/** + * VorbisComment metadata conversion mapping. + * from Ogg Vorbis I format specification: comment field and header specification + * http://xiph.org/vorbis/doc/v-comment.html + */ +const AVMetadataConv ff_vorbiscomment_metadata_conv[] = { + { "ALBUMARTIST", "album_artist"}, + { "TRACKNUMBER", "track" }, + { "DISCNUMBER", "disc" }, + { 0 } +}; + +int ff_vorbiscomment_length(AVMetadata *m, const char *vendor_string, + unsigned *count) +{ + int len = 8; + len += strlen(vendor_string); + *count = 0; + if (m) { + AVMetadataTag *tag = NULL; + while ((tag = av_metadata_get(m, "", tag, AV_METADATA_IGNORE_SUFFIX))) { + len += 4 +strlen(tag->key) + 1 + strlen(tag->value); + (*count)++; + } + } + return len; +} + +int ff_vorbiscomment_write(uint8_t **p, AVMetadata **m, + const char *vendor_string, const unsigned count) +{ + bytestream_put_le32(p, strlen(vendor_string)); + bytestream_put_buffer(p, vendor_string, strlen(vendor_string)); + if (*m) { + AVMetadataTag *tag = NULL; + bytestream_put_le32(p, count); + while ((tag = av_metadata_get(*m, "", tag, AV_METADATA_IGNORE_SUFFIX))) { + unsigned int len1 = strlen(tag->key); + unsigned int len2 = strlen(tag->value); + bytestream_put_le32(p, len1+1+len2); + bytestream_put_buffer(p, tag->key, len1); + bytestream_put_byte(p, '='); + bytestream_put_buffer(p, tag->value, len2); + } + } else + bytestream_put_le32(p, 0); + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vorbiscomment.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vorbiscomment.h new file mode 100644 index 00000000..3dfe9d22 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/vorbiscomment.h @@ -0,0 +1,57 @@ +/* + * VorbisComment writer + * Copyright (c) 2009 James Darnley + * + * 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 + */ + +#ifndef AVFORMAT_VORBISCOMMENT_H +#define AVFORMAT_VORBISCOMMENT_H + +#include "avformat.h" +#include "metadata.h" + +/** + * Calculate the length in bytes of a VorbisComment. This is the minimum + * size required by ff_vorbiscomment_write(). + * + * @param m The metadata structure to be parsed. For no metadata, set to NULL. + * @param vendor_string The vendor string to be added into the VorbisComment. + * For no string, set to an empty string. + * @param count Pointer to store the number of tags in m because m->count is "not allowed" + * @return The length in bytes. + */ +int ff_vorbiscomment_length(AVMetadata *m, const char *vendor_string, + unsigned *count); + +/** + * Writes a VorbisComment into a buffer. The buffer, p, must have enough + * data to hold the whole VorbisComment. The minimum size required can be + * obtained by passing the same AVMetadata and vendor_string to + * ff_vorbiscomment_length() + * + * @param p The buffer in which to write. + * @param m The metadata struct to write. + * @param vendor_string The vendor string to write. + * @param count The number of tags in m because m->count is "not allowed" + */ +int ff_vorbiscomment_write(uint8_t **p, AVMetadata **m, + const char *vendor_string, const unsigned count); + +extern const AVMetadataConv ff_vorbiscomment_metadata_conv[]; + +#endif /* AVFORMAT_VORBISCOMMENT_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/wtv.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/wtv.c new file mode 100644 index 00000000..816c4062 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/wtv.c @@ -0,0 +1,607 @@ +/* + * Windows Television (WTV) demuxer + * Copyright (c) 2010 Peter Ross + * + * 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 + * Windows Television (WTV) demuxer + * @author Peter Ross + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "riff.h" +#include "asf.h" +#include "mpegts.h" + +/* Macros for formating GUIDs */ +#define PRI_GUID \ + "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" +#define ARG_GUID(g) \ + g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15] + +typedef struct { + int seen_data; +} WtvStream; + +typedef struct WtvContext { + uint64_t pts; +} WtvContext; + +static int is_zero(uint8_t *v, int n) +{ + int i; + for (i = 0; i < n; i++) + if (v[i]) return 0; + return 1; +} + +typedef struct { + enum CodecID id; + ff_asf_guid guid; +} AVCodecGuid; + +static enum CodecID ff_codec_guid_get_id(const AVCodecGuid *guids, ff_asf_guid guid) +{ + int i; + for (i = 0; guids[i].id != CODEC_ID_NONE; i++) { + if (!ff_guidcmp(guids[i].guid, guid)) + return guids[i].id; + } + return CODEC_ID_NONE; +} + +/* WTV GUIDs */ +static const ff_asf_guid wtv_guid = + {0xB7,0xD8,0x00,0x20,0x37,0x49,0xDA,0x11,0xA6,0x4E,0x00,0x07,0xE9,0x5E,0xAD,0x8D}; +static const ff_asf_guid meta_guid = + {0x5A,0xFE,0xD7,0x6D,0xC8,0x1D,0x8F,0x4A,0x99,0x22,0xFA,0xB1,0x1C,0x38,0x14,0x53}; +static const ff_asf_guid timestamp_guid = + {0x5B,0x05,0xE6,0x1B,0x97,0xA9,0x49,0x43,0x88,0x17,0x1A,0x65,0x5A,0x29,0x8A,0x97}; +static const ff_asf_guid data_guid = + {0x95,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D}; +static const ff_asf_guid stream_guid = + {0xED,0xA4,0x13,0x23,0x2D,0xBF,0x4F,0x45,0xAD,0x8A,0xD9,0x5B,0xA7,0xF9,0x1F,0xEE}; +static const ff_asf_guid stream2_guid = + {0xA2,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D}; +static const ff_asf_guid EVENTID_SubtitleSpanningEvent = + {0x48,0xC0,0xCE,0x5D,0xB9,0xD0,0x63,0x41,0x87,0x2C,0x4F,0x32,0x22,0x3B,0xE8,0x8A}; +static const ff_asf_guid EVENTID_LanguageSpanningEvent = + {0x6D,0x66,0x92,0xE2,0x02,0x9C,0x8D,0x44,0xAA,0x8D,0x78,0x1A,0x93,0xFD,0xC3,0x95}; +static const ff_asf_guid EVENTID_AudioDescriptorSpanningEvent = + {0x1C,0xD4,0x7B,0x10,0xDA,0xA6,0x91,0x46,0x83,0x69,0x11,0xB2,0xCD,0xAA,0x28,0x8E}; +static const ff_asf_guid EVENTID_CtxADescriptorSpanningEvent = + {0xE6,0xA2,0xB4,0x3A,0x47,0x42,0x34,0x4B,0x89,0x6C,0x30,0xAF,0xA5,0xD2,0x1C,0x24}; +static const ff_asf_guid EVENTID_CSDescriptorSpanningEvent = + {0xD9,0x79,0xE7,0xEf,0xF0,0x97,0x86,0x47,0x80,0x0D,0x95,0xCF,0x50,0x5D,0xDC,0x66}; +static const ff_asf_guid EVENTID_DVBScramblingControlSpanningEvent = + {0xC4,0xE1,0xD4,0x4B,0xA1,0x90,0x09,0x41,0x82,0x36,0x27,0xF0,0x0E,0x7D,0xCC,0x5B}; +static const ff_asf_guid EVENTID_StreamIDSpanningEvent = + {0x68,0xAB,0xF1,0xCA,0x53,0xE1,0x41,0x4D,0xA6,0xB3,0xA7,0xC9,0x98,0xDB,0x75,0xEE}; +static const ff_asf_guid EVENTID_TeletextSpanningEvent = + {0x50,0xD9,0x99,0x95,0x33,0x5F,0x17,0x46,0xAF,0x7C,0x1E,0x54,0xB5,0x10,0xDA,0xA3}; + +/* Windows media GUIDs */ + +#define MEDIASUBTYPE_BASE_GUID \ + 0x00,0x00,0x10,0x00,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71 + +/* Media types */ +static const ff_asf_guid mediatype_audio = + {'a','u','d','s',MEDIASUBTYPE_BASE_GUID}; +static const ff_asf_guid mediatype_video = + {'v','i','d','s',MEDIASUBTYPE_BASE_GUID}; +static const ff_asf_guid mediasubtype_mpeg1payload = + {0x81,0xEB,0x36,0xE4,0x4F,0x52,0xCE,0x11,0x9F,0x53,0x00,0x20,0xAF,0x0B,0xA7,0x70}; +static const ff_asf_guid mediatype_mpeg2_sections = + {0x6C,0x17,0x5F,0x45,0x06,0x4B,0xCE,0x47,0x9A,0xEF,0x8C,0xAE,0xF7,0x3D,0xF7,0xB5}; +static const ff_asf_guid mediatype_mpeg2_pes = + {0x20,0x80,0x6D,0xE0,0x46,0xDB,0xCF,0x11,0xB4,0xD1,0x00,0x80,0x5F,0x6C,0xBB,0xEA}; +static const ff_asf_guid mediatype_mstvcaption = + {0x89,0x8A,0x8B,0xB8,0x49,0xB0,0x80,0x4C,0xAD,0xCF,0x58,0x98,0x98,0x5E,0x22,0xC1}; + +/* Media subtypes */ +static const ff_asf_guid mediasubtype_cpfilters_processed = + {0x28,0xBD,0xAD,0x46,0xD0,0x6F,0x96,0x47,0x93,0xB2,0x15,0x5C,0x51,0xDC,0x04,0x8D}; +static const ff_asf_guid mediasubtype_dvb_subtitle = + {0xC3,0xCB,0xFF,0x34,0xB3,0xD5,0x71,0x41,0x90,0x02,0xD4,0xC6,0x03,0x01,0x69,0x7F}; +static const ff_asf_guid mediasubtype_teletext = + {0xE3,0x76,0x2A,0xF7,0x0A,0xEB,0xD0,0x11,0xAC,0xE4,0x00,0x00,0xC0,0xCC,0x16,0xBA}; +static const ff_asf_guid mediasubtype_dtvccdata = + {0xAA,0xDD,0x2A,0xF5,0xF0,0x36,0xF5,0x43,0x95,0xEA,0x6D,0x86,0x64,0x84,0x26,0x2A}; +static const ff_asf_guid mediasubtype_mpeg2_sections = + {0x79,0x85,0x9F,0x4A,0xF8,0x6B,0x92,0x43,0x8A,0x6D,0xD2,0xDD,0x09,0xFA,0x78,0x61}; + +/* Formats */ +static const ff_asf_guid format_cpfilters_processed = + {0x6F,0xB3,0x39,0x67,0x5F,0x1D,0xC2,0x4A,0x81,0x92,0x28,0xBB,0x0E,0x73,0xD1,0x6A}; +static const ff_asf_guid format_waveformatex = + {0x81,0x9F,0x58,0x05,0x56,0xC3,0xCE,0x11,0xBF,0x01,0x00,0xAA,0x00,0x55,0x59,0x5A}; +static const ff_asf_guid format_videoinfo2 = + {0xA0,0x76,0x2A,0xF7,0x0A,0xEB,0xD0,0x11,0xAC,0xE4,0x00,0x00,0xC0,0xCC,0x16,0xBA}; +static const ff_asf_guid format_mpeg2_video = + {0xE3,0x80,0x6D,0xE0,0x46,0xDB,0xCF,0x11,0xB4,0xD1,0x00,0x80,0x5F,0x6C,0xBB,0xEA}; +static const ff_asf_guid format_none = + {0xD6,0x17,0x64,0x0F,0x18,0xC3,0xD0,0x11,0xA4,0x3F,0x00,0xA0,0xC9,0x22,0x31,0x96}; + +static const AVCodecGuid video_guids[] = { + {CODEC_ID_MPEG2VIDEO, {0x26,0x80,0x6D,0xE0,0x46,0xDB,0xCF,0x11,0xB4,0xD1,0x00,0x80,0x5F,0x6C,0xBB,0xEA}}, + {CODEC_ID_NONE} +}; + +static const AVCodecGuid audio_guids[] = { + {CODEC_ID_AC3, {0x2C,0x80,0x6D,0xE0,0x46,0xDB,0xCF,0x11,0xB4,0xD1,0x00,0x80,0x5F,0x6C,0xBB,0xEA}}, + {CODEC_ID_EAC3, {0xAF,0x87,0xFB,0xA7,0x02,0x2D,0xFB,0x42,0xA4,0xD4,0x05,0xCD,0x93,0x84,0x3B,0xDD}}, + {CODEC_ID_MP2, {0x2B,0x80,0x6D,0xE0,0x46,0xDB,0xCF,0x11,0xB4,0xD1,0x00,0x80,0x5F,0x6C,0xBB,0xEA}}, + {CODEC_ID_NONE} +}; + +static int read_probe(AVProbeData *p) +{ + return ff_guidcmp(p->buf, wtv_guid) ? 0 : AVPROBE_SCORE_MAX; +} + +/** + * parse VIDEOINFOHEADER2 structure + * @return bytes consumed + */ +static int parse_videoinfoheader2(AVFormatContext *s, AVStream *st) +{ + ByteIOContext *pb = s->pb; + + url_fskip(pb, 72); // picture aspect ratio is unreliable + ff_get_bmp_header(pb, st); + + return 72 + 40; +} + +/** + * Parse MPEG1WAVEFORMATEX extradata structure + */ +static void parse_mpeg1waveformatex(AVStream *st) +{ + /* fwHeadLayer */ + switch (AV_RL16(st->codec->extradata)) { + case 0x0001 : st->codec->codec_id = CODEC_ID_MP1; break; + case 0x0002 : st->codec->codec_id = CODEC_ID_MP2; break; + case 0x0004 : st->codec->codec_id = CODEC_ID_MP3; break; + } + + st->codec->bit_rate = AV_RL32(st->codec->extradata + 2); /* dwHeadBitrate */ + + /* dwHeadMode */ + switch (AV_RL16(st->codec->extradata + 6)) { + case 1 : case 2 : case 4 : st->codec->channels = 2; break; + case 8 : st->codec->channels = 1; break; + } +} + +/** + * Initialise stream + * @param st Stream to initialise, or NULL to create and initialise new stream + * @return NULL on error + */ +static AVStream * new_stream(AVFormatContext *s, AVStream *st, int sid, int codec_type) +{ + if (st) { + if (st->codec->extradata) { + av_freep(&st->codec->extradata); + st->codec->extradata_size = 0; + } + } else { + WtvStream *wst = av_mallocz(sizeof(WtvStream)); + if (!wst) + return NULL; + st = av_new_stream(s, sid); + if (!st) + return NULL; + st->priv_data = wst; + } + st->codec->codec_type = codec_type; + st->need_parsing = AVSTREAM_PARSE_FULL; + av_set_pts_info(st, 64, 1, 10000000); + return st; +} + +/** + * parse Media Type structure and populate stream + * @param st Stream, or NULL to create new stream + * @param mediatype Mediatype GUID + * @param subtype Subtype GUID + * @param formattype Format GUID + * @param size Size of format buffer + * @return NULL on error + */ +static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid, + ff_asf_guid mediatype, ff_asf_guid subtype, + ff_asf_guid formattype, int size) +{ + ByteIOContext *pb = s->pb; + if (!ff_guidcmp(subtype, mediasubtype_cpfilters_processed) && + !ff_guidcmp(formattype, format_cpfilters_processed)) { + ff_asf_guid actual_subtype; + ff_asf_guid actual_formattype; + + if (size < 32) { + av_log(s, AV_LOG_WARNING, "format buffer size underflow\n"); + url_fskip(pb, size); + return NULL; + } + + url_fskip(pb, size - 32); + ff_get_guid(pb, &actual_subtype); + ff_get_guid(pb, &actual_formattype); + url_fseek(pb, -size, SEEK_CUR); + + st = parse_media_type(s, st, sid, mediatype, actual_subtype, actual_formattype, size - 32); + url_fskip(pb, 32); + return st; + } else if (!ff_guidcmp(mediatype, mediatype_audio)) { + st = new_stream(s, st, sid, AVMEDIA_TYPE_AUDIO); + if (!st) + return NULL; + if (!ff_guidcmp(formattype, format_waveformatex)) { + ff_get_wav_header(pb, st->codec, size); + } else { + if (ff_guidcmp(formattype, format_none)) + av_log(s, AV_LOG_WARNING, "unknown formattype:"PRI_GUID"\n", ARG_GUID(formattype)); + url_fskip(pb, size); + } + + if (!memcmp(subtype + 4, (const uint8_t[]){MEDIASUBTYPE_BASE_GUID}, 12)) { + st->codec->codec_id = ff_wav_codec_get_id(AV_RL32(subtype), st->codec->bits_per_coded_sample); + } else if (!ff_guidcmp(subtype, mediasubtype_mpeg1payload)) { + if (st->codec->extradata && st->codec->extradata_size >= 22) + parse_mpeg1waveformatex(st); + else + av_log(s, AV_LOG_WARNING, "MPEG1WAVEFORMATEX underflow\n"); + } else { + st->codec->codec_id = ff_codec_guid_get_id(audio_guids, subtype); + if (st->codec->codec_id == CODEC_ID_NONE) + av_log(s, AV_LOG_WARNING, "unknown subtype:"PRI_GUID"\n", ARG_GUID(subtype)); + } + return st; + } else if (!ff_guidcmp(mediatype, mediatype_video)) { + st = new_stream(s, st, sid, AVMEDIA_TYPE_VIDEO); + if (!st) + return NULL; + if (!ff_guidcmp(formattype, format_videoinfo2)) { + int consumed = parse_videoinfoheader2(s, st); + url_fskip(pb, FFMAX(size - consumed, 0)); + } else if (!ff_guidcmp(formattype, format_mpeg2_video)) { + int consumed = parse_videoinfoheader2(s, st); + url_fskip(pb, FFMAX(size - consumed, 0)); + } else { + if (ff_guidcmp(formattype, format_none)) + av_log(s, AV_LOG_WARNING, "unknown formattype:"PRI_GUID"\n", ARG_GUID(formattype)); + url_fskip(pb, size); + } + + if (!memcmp(subtype + 4, (const uint8_t[]){MEDIASUBTYPE_BASE_GUID}, 12)) { + st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, AV_RL32(subtype)); + } else { + st->codec->codec_id = ff_codec_guid_get_id(video_guids, subtype); + } + if (st->codec->codec_id == CODEC_ID_NONE) + av_log(s, AV_LOG_WARNING, "unknown subtype:"PRI_GUID"\n", ARG_GUID(subtype)); + return st; + } else if (!ff_guidcmp(mediatype, mediatype_mpeg2_pes) && + !ff_guidcmp(subtype, mediasubtype_dvb_subtitle)) { + st = new_stream(s, st, sid, AVMEDIA_TYPE_SUBTITLE); + if (!st) + return NULL; + if (ff_guidcmp(formattype, format_none)) + av_log(s, AV_LOG_WARNING, "unknown formattype:"PRI_GUID"\n", ARG_GUID(formattype)); + url_fskip(pb, size); + st->codec->codec_id = CODEC_ID_DVB_SUBTITLE; + return st; + } else if (!ff_guidcmp(mediatype, mediatype_mstvcaption) && + (!ff_guidcmp(subtype, mediasubtype_teletext) || !ff_guidcmp(subtype, mediasubtype_dtvccdata))) { + st = new_stream(s, st, sid, AVMEDIA_TYPE_SUBTITLE); + if (!st) + return NULL; + if (ff_guidcmp(formattype, format_none)) + av_log(s, AV_LOG_WARNING, "unknown formattype:"PRI_GUID"\n", ARG_GUID(formattype)); + url_fskip(pb, size); + st->codec->codec_id = CODEC_ID_DVB_TELETEXT; + return st; + } else if (!ff_guidcmp(mediatype, mediatype_mpeg2_sections) && + !ff_guidcmp(subtype, mediasubtype_mpeg2_sections)) { + if (ff_guidcmp(formattype, format_none)) + av_log(s, AV_LOG_WARNING, "unknown formattype:"PRI_GUID"\n", ARG_GUID(formattype)); + url_fskip(pb, size); + return NULL; + } + + av_log(s, AV_LOG_WARNING, "unknown media type, mediatype:"PRI_GUID + ", subtype:"PRI_GUID", formattype:"PRI_GUID"\n", + ARG_GUID(mediatype), ARG_GUID(subtype), ARG_GUID(formattype)); + url_fskip(pb, size); + return NULL; +} + +enum { + SEEK_TO_DATA = 0, + SEEK_TO_BYTE, + SEEK_TO_PTS, +}; + +/** + * Parse WTV chunks + * @param mode SEEK_TO_DATA, SEEK_TO_BYTE, SEEK_TO_PTS + * @param seekts either byte position or timestamp + * @param[out] len Length of data chunk + * @return stream index of data chunk, or <0 on error + */ +static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_ptr) +{ + WtvContext *wtv = s->priv_data; + ByteIOContext *pb = s->pb; + while (!url_feof(pb)) { + ff_asf_guid g; + int len, sid, consumed; + + if (mode == SEEK_TO_BYTE && url_ftell(pb) >= seekts) + return 0; + + ff_get_guid(pb, &g); + if (is_zero(g, sizeof(ff_asf_guid))) + return AVERROR_EOF; + + len = get_le32(pb); + if (len < 32) + break; + sid = get_le32(pb) & 0x7FFF; + url_fskip(pb, 8); + consumed = 32; + + if (!ff_guidcmp(g, stream_guid)) { + if (ff_find_stream_index(s, sid) < 0) { + ff_asf_guid mediatype, subtype, formattype; + int size; + consumed += 20; + url_fskip(pb, 16); + if (get_le32(pb)) { + url_fskip(pb, 8); + ff_get_guid(pb, &mediatype); + ff_get_guid(pb, &subtype); + url_fskip(pb, 12); + ff_get_guid(pb, &formattype); + size = get_le32(pb); + parse_media_type(s, 0, sid, mediatype, subtype, formattype, size); + consumed += 72 + size; + } + } + } else if (!ff_guidcmp(g, stream2_guid)) { + int stream_index = ff_find_stream_index(s, sid); + if (stream_index >= 0 && !((WtvStream*)s->streams[stream_index]->priv_data)->seen_data) { + ff_asf_guid mediatype, subtype, formattype; + int size; + url_fskip(pb, 12); + ff_get_guid(pb, &mediatype); + ff_get_guid(pb, &subtype); + url_fskip(pb, 12); + ff_get_guid(pb, &formattype); + size = get_le32(pb); + parse_media_type(s, s->streams[stream_index], sid, mediatype, subtype, formattype, size); + consumed += 76 + size; + } + } else if (!ff_guidcmp(g, EVENTID_AudioDescriptorSpanningEvent) || + !ff_guidcmp(g, EVENTID_CtxADescriptorSpanningEvent) || + !ff_guidcmp(g, EVENTID_CSDescriptorSpanningEvent) || + !ff_guidcmp(g, EVENTID_StreamIDSpanningEvent) || + !ff_guidcmp(g, EVENTID_SubtitleSpanningEvent) || + !ff_guidcmp(g, EVENTID_TeletextSpanningEvent)) { + int stream_index = ff_find_stream_index(s, sid); + if (stream_index >= 0) { + AVStream *st = s->streams[stream_index]; + uint8_t buf[258]; + const uint8_t *pbuf = buf; + int buf_size; + + url_fskip(pb, 8); + consumed += 8; + if (!ff_guidcmp(g, EVENTID_CtxADescriptorSpanningEvent) || + !ff_guidcmp(g, EVENTID_CSDescriptorSpanningEvent)) { + url_fskip(pb, 6); + consumed += 6; + } + + buf_size = FFMIN(len - consumed, sizeof(buf)); + get_buffer(pb, buf, buf_size); + consumed += buf_size; + ff_parse_mpeg2_descriptor(s, st, 0, &pbuf, buf + buf_size, 0, 0, 0, 0); + } + } else if (!ff_guidcmp(g, EVENTID_DVBScramblingControlSpanningEvent)) { + int stream_index = ff_find_stream_index(s, sid); + if (stream_index >= 0) { + url_fskip(pb, 12); + if (get_le32(pb)) + av_log(s, AV_LOG_WARNING, "DVB scrambled stream detected (st:%d), decoding will likely fail\n", stream_index); + consumed += 16; + } + } else if (!ff_guidcmp(g, EVENTID_LanguageSpanningEvent)) { + int stream_index = ff_find_stream_index(s, sid); + if (stream_index >= 0) { + AVStream *st = s->streams[stream_index]; + uint8_t language[4]; + url_fskip(pb, 12); + get_buffer(pb, language, 3); + if (language[0]) { + language[3] = 0; + av_metadata_set2(&st->metadata, "language", language, 0); + } + consumed += 15; + } + } else if (!ff_guidcmp(g, timestamp_guid)) { + int stream_index = ff_find_stream_index(s, sid); + if (stream_index >= 0) { + url_fskip(pb, 8); + wtv->pts = get_le64(pb); + consumed += 16; + if (wtv->pts == -1) + wtv->pts = AV_NOPTS_VALUE; + if (mode == SEEK_TO_PTS && wtv->pts >= seekts) { +#define WTV_PAD8(x) (((x) + 7) & ~7) + url_fskip(pb, WTV_PAD8(len) - consumed); + return 0; + } + } + } else if (!ff_guidcmp(g, data_guid)) { + int stream_index = ff_find_stream_index(s, sid); + if (mode == SEEK_TO_DATA && stream_index >= 0) { + WtvStream *wst = s->streams[stream_index]->priv_data; + wst->seen_data = 1; + if (len_ptr) { + *len_ptr = len; + } + if (wtv->pts != AV_NOPTS_VALUE) + av_add_index_entry(s->streams[stream_index], url_ftell(pb) - consumed, wtv->pts, 0, 0, AVINDEX_KEYFRAME); + return stream_index; + } + } else if ( + !ff_guidcmp(g, /* DSATTRIB_CAPTURE_STREAMTIME */ (const ff_asf_guid){0x14,0x56,0x1A,0x0C,0xCD,0x30,0x40,0x4F,0xBC,0xBF,0xD0,0x3E,0x52,0x30,0x62,0x07}) || + !ff_guidcmp(g, /* DSATTRIB_PicSampleSeq */ (const ff_asf_guid){0x02,0xAE,0x5B,0x2F,0x8F,0x7B,0x60,0x4F,0x82,0xD6,0xE4,0xEA,0x2F,0x1F,0x4C,0x99}) || + !ff_guidcmp(g, /* DSATTRIB_TRANSPORT_PROPERTIES */ (const ff_asf_guid){0x12,0xF6,0x22,0xB6,0xAD,0x47,0x71,0x46,0xAD,0x6C,0x05,0xA9,0x8E,0x65,0xDE,0x3A}) || + !ff_guidcmp(g, /* dvr_ms_vid_frame_rep_data */ (const ff_asf_guid){0xCC,0x32,0x64,0xDD,0x29,0xE2,0xDB,0x40,0x80,0xF6,0xD2,0x63,0x28,0xD2,0x76,0x1F}) || + !ff_guidcmp(g, /* EVENTID_AudioTypeSpanningEvent */ (const ff_asf_guid){0xBE,0xBF,0x1C,0x50,0x49,0xB8,0xCE,0x42,0x9B,0xE9,0x3D,0xB8,0x69,0xFB,0x82,0xB3}) || + !ff_guidcmp(g, /* EVENTID_ChannelChangeSpanningEvent */ (const ff_asf_guid){0xE5,0xC5,0x67,0x90,0x5C,0x4C,0x05,0x42,0x86,0xC8,0x7A,0xFE,0x20,0xFE,0x1E,0xFA}) || + !ff_guidcmp(g, /* EVENTID_ChannelInfoSpanningEvent */ (const ff_asf_guid){0x80,0x6D,0xF3,0x41,0x32,0x41,0xC2,0x4C,0xB1,0x21,0x01,0xA4,0x32,0x19,0xD8,0x1B}) || + !ff_guidcmp(g, /* EVENTID_ChannelTypeSpanningEvent */ (const ff_asf_guid){0x51,0x1D,0xAB,0x72,0xD2,0x87,0x9B,0x48,0xBA,0x11,0x0E,0x08,0xDC,0x21,0x02,0x43}) || + !ff_guidcmp(g, /* EVENTID_PIDListSpanningEvent */ (const ff_asf_guid){0x65,0x8F,0xFC,0x47,0xBB,0xE2,0x34,0x46,0x9C,0xEF,0xFD,0xBF,0xE6,0x26,0x1D,0x5C}) || + !ff_guidcmp(g, /* EVENTID_SignalAndServiceStatusSpanningEvent */ (const ff_asf_guid){0xCB,0xC5,0x68,0x80,0x04,0x3C,0x2B,0x49,0xB4,0x7D,0x03,0x08,0x82,0x0D,0xCE,0x51}) || + !ff_guidcmp(g, /* EVENTID_StreamTypeSpanningEvent */ (const ff_asf_guid){0xBC,0x2E,0xAF,0x82,0xA6,0x30,0x64,0x42,0xA8,0x0B,0xAD,0x2E,0x13,0x72,0xAC,0x60}) || + !ff_guidcmp(g, (const ff_asf_guid){0x1E,0xBE,0xC3,0xC5,0x43,0x92,0xDC,0x11,0x85,0xE5,0x00,0x12,0x3F,0x6F,0x73,0xB9}) || + !ff_guidcmp(g, (const ff_asf_guid){0x3B,0x86,0xA2,0xB1,0xEB,0x1E,0xC3,0x44,0x8C,0x88,0x1C,0xA3,0xFF,0xE3,0xE7,0x6A}) || + !ff_guidcmp(g, (const ff_asf_guid){0x4E,0x7F,0x4C,0x5B,0xC4,0xD0,0x38,0x4B,0xA8,0x3E,0x21,0x7F,0x7B,0xBF,0x52,0xE7}) || + !ff_guidcmp(g, (const ff_asf_guid){0x63,0x36,0xEB,0xFE,0xA1,0x7E,0xD9,0x11,0x83,0x08,0x00,0x07,0xE9,0x5E,0xAD,0x8D}) || + !ff_guidcmp(g, (const ff_asf_guid){0x70,0xE9,0xF1,0xF8,0x89,0xA4,0x4C,0x4D,0x83,0x73,0xB8,0x12,0xE0,0xD5,0xF8,0x1E}) || + !ff_guidcmp(g, (const ff_asf_guid){0x96,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D}) || + !ff_guidcmp(g, (const ff_asf_guid){0x97,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D}) || + !ff_guidcmp(g, (const ff_asf_guid){0xA1,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D})) { + //ignore known guids + } else + av_log(s, AV_LOG_WARNING, "unsupported chunk:"PRI_GUID"\n", ARG_GUID(g)); + + url_fskip(pb, WTV_PAD8(len) - consumed); + } + return AVERROR_EOF; +} + +#define WTV_CHUNK_START 0x40000 + +static int read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + ByteIOContext *pb = s->pb; + int ret; + + url_fseek(pb, WTV_CHUNK_START, SEEK_SET); + ret = parse_chunks(s, SEEK_TO_DATA, 0, 0); + if (ret < 0) + return ret; + + url_fseek(pb, -32, SEEK_CUR); + return 0; +} + +static int read_packet(AVFormatContext *s, AVPacket *pkt) +{ + WtvContext *wtv = s->priv_data; + ByteIOContext *pb = s->pb; + int stream_index, len, ret; + + stream_index = parse_chunks(s, SEEK_TO_DATA, 0, &len); + if (stream_index < 0) + return stream_index; + + ret = av_get_packet(pb, pkt, len - 32); + if (ret < 0) + return ret; + pkt->stream_index = stream_index; + pkt->pts = wtv->pts; + url_fskip(pb, WTV_PAD8(len) - len); + return 0; +} + +static int read_seek2(AVFormatContext *s, int stream_index, + int64_t min_ts, int64_t ts, int64_t max_ts, int flags) +{ + WtvContext *wtv = s->priv_data; + ByteIOContext *pb = s->pb; + AVStream *st; + int i; + + if (stream_index < 0) { + stream_index = av_find_default_stream_index(s); + if (stream_index < 0) + return -1; + } + st = s->streams[stream_index]; + + if ((flags & AVSEEK_FLAG_FRAME)) { + return AVERROR_NOTSUPP; + } else if ((flags & AVSEEK_FLAG_BYTE)) { + if (ts < url_ftell(pb)) { + for (i = st->nb_index_entries - 1; i >= 0; i--) { + if (st->index_entries[i].pos <= ts) { + wtv->pts = st->index_entries[i].timestamp; + url_fseek(pb, st->index_entries[i].pos, SEEK_SET); + break; + } + } + if (i < 0) { + wtv->pts = 0; + url_fseek(pb, WTV_CHUNK_START, SEEK_SET); + } + } + if (parse_chunks(s, SEEK_TO_BYTE, ts, 0) < 0) + return AVERROR(ERANGE); + return 0; + } else { + ts *= 10; + i = av_index_search_timestamp(st, ts, flags); + if (i < 0) { + if (st->nb_index_entries > 0) { + wtv->pts = st->index_entries[st->nb_index_entries - 1].timestamp; + url_fseek(pb, st->index_entries[st->nb_index_entries - 1].pos, SEEK_SET); + } else { + wtv->pts = 0; + url_fseek(pb, WTV_CHUNK_START, SEEK_SET); + } + if (parse_chunks(s, SEEK_TO_PTS, ts, 0) < 0) + return AVERROR(ERANGE); + return 0; + } + wtv->pts = st->index_entries[i].timestamp; + url_fseek(pb, st->index_entries[i].pos, SEEK_SET); + return 0; + } +} + +AVInputFormat ff_wtv_demuxer = { + .name = "wtv", + .long_name = NULL_IF_CONFIG_SMALL("Windows Television (WTV)"), + .priv_data_size = sizeof(WtvContext), + .read_probe = read_probe, + .read_header = read_header, + .read_packet = read_packet, + .read_seek2 = read_seek2, + .flags = AVFMT_SHOW_IDS|AVFMT_TS_DISCONT, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/yop.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/yop.c new file mode 100644 index 00000000..ae909254 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavformat/yop.c @@ -0,0 +1,216 @@ +/** + * @file + * Psygnosis YOP demuxer + * + * Copyright (C) 2010 Mohamed Naufal Basheer + * derived from the code by + * Copyright (C) 2009 Thomas P. Higdon + * + * 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 + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" + +typedef struct yop_dec_context { + AVPacket video_packet; + + int odd_frame; + int frame_size; + int audio_block_length; + int palette_size; +} YopDecContext; + +static int yop_probe(AVProbeData *probe_packet) +{ + if (AV_RB16(probe_packet->buf) == AV_RB16("YO") && + probe_packet->buf[6] && + probe_packet->buf[7] && + !(probe_packet->buf[8] & 1) && + !(probe_packet->buf[10] & 1)) + return AVPROBE_SCORE_MAX * 3 / 4; + + return 0; +} + +static int yop_read_header(AVFormatContext *s, AVFormatParameters *ap) +{ + YopDecContext *yop = s->priv_data; + ByteIOContext *pb = s->pb; + + AVCodecContext *audio_dec, *video_dec; + AVStream *audio_stream, *video_stream; + + int frame_rate, ret; + + audio_stream = av_new_stream(s, 0); + video_stream = av_new_stream(s, 1); + + // Extra data that will be passed to the decoder + video_stream->codec->extradata_size = 8; + + video_stream->codec->extradata = av_mallocz(video_stream->codec->extradata_size + + FF_INPUT_BUFFER_PADDING_SIZE); + + if (!video_stream->codec->extradata) + return AVERROR(ENOMEM); + + // Audio + audio_dec = audio_stream->codec; + audio_dec->codec_type = AVMEDIA_TYPE_AUDIO; + audio_dec->codec_id = CODEC_ID_ADPCM_IMA_WS; + audio_dec->channels = 1; + audio_dec->sample_rate = 22050; + + // Video + video_dec = video_stream->codec; + video_dec->codec_type = AVMEDIA_TYPE_VIDEO; + video_dec->codec_id = CODEC_ID_YOP; + + url_fskip(pb, 6); + + frame_rate = get_byte(pb); + yop->frame_size = get_byte(pb) * 2048; + video_dec->width = get_le16(pb); + video_dec->height = get_le16(pb); + + video_stream->sample_aspect_ratio = (AVRational){1, 2}; + + ret = get_buffer(pb, video_dec->extradata, 8); + if (ret < 8) + return ret < 0 ? ret : AVERROR_EOF; + + yop->palette_size = video_dec->extradata[0] * 3 + 4; + yop->audio_block_length = AV_RL16(video_dec->extradata + 6); + + // 1840 samples per frame, 1 nibble per sample; hence 1840/2 = 920 + if (yop->audio_block_length < 920 || + yop->audio_block_length + yop->palette_size >= yop->frame_size) { + av_log(s, AV_LOG_ERROR, "YOP has invalid header\n"); + return AVERROR_INVALIDDATA; + } + + url_fseek(pb, 2048, SEEK_SET); + + av_set_pts_info(video_stream, 32, 1, frame_rate); + + return 0; +} + +static int yop_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + YopDecContext *yop = s->priv_data; + ByteIOContext *pb = s->pb; + + int ret; + int actual_video_data_size = yop->frame_size - + yop->audio_block_length - yop->palette_size; + + yop->video_packet.stream_index = 1; + + if (yop->video_packet.data) { + *pkt = yop->video_packet; + yop->video_packet.data = NULL; + yop->video_packet.size = 0; + pkt->data[0] = yop->odd_frame; + pkt->flags |= AV_PKT_FLAG_KEY; + yop->odd_frame ^= 1; + return pkt->size; + } + ret = av_new_packet(&yop->video_packet, + yop->frame_size - yop->audio_block_length); + if (ret < 0) + return ret; + + yop->video_packet.pos = url_ftell(pb); + + ret = get_buffer(pb, yop->video_packet.data, yop->palette_size); + if (ret < 0) { + goto err_out; + }else if (ret < yop->palette_size) { + ret = AVERROR_EOF; + goto err_out; + } + + ret = av_get_packet(pb, pkt, 920); + if (ret < 0) + goto err_out; + + // Set position to the start of the frame + pkt->pos = yop->video_packet.pos; + + url_fskip(pb, yop->audio_block_length - ret); + + ret = get_buffer(pb, yop->video_packet.data + yop->palette_size, + actual_video_data_size); + if (ret < 0) + goto err_out; + else if (ret < actual_video_data_size) + av_shrink_packet(&yop->video_packet, yop->palette_size + ret); + + // Arbitrarily return the audio data first + return yop->audio_block_length; + +err_out: + av_free_packet(&yop->video_packet); + return ret; +} + +static int yop_read_close(AVFormatContext *s) +{ + YopDecContext *yop = s->priv_data; + av_free_packet(&yop->video_packet); + return 0; +} + +static int yop_read_seek(AVFormatContext *s, int stream_index, + int64_t timestamp, int flags) +{ + YopDecContext *yop = s->priv_data; + int64_t frame_pos, pos_min, pos_max; + int frame_count; + + av_free_packet(&yop->video_packet); + + if (!stream_index) + return -1; + + pos_min = s->data_offset; + pos_max = url_fsize(s->pb) - yop->frame_size; + frame_count = (pos_max - pos_min) / yop->frame_size; + + timestamp = FFMAX(0, FFMIN(frame_count, timestamp)); + + frame_pos = timestamp * yop->frame_size + pos_min; + yop->odd_frame = timestamp & 1; + + url_fseek(s->pb, frame_pos, SEEK_SET); + return 0; +} + +AVInputFormat ff_yop_demuxer = { + "yop", + NULL_IF_CONFIG_SMALL("Psygnosis YOP Format"), + sizeof(YopDecContext), + yop_probe, + yop_read_header, + yop_read_packet, + yop_read_close, + yop_read_seek, + .extensions = "yop", + .flags = AVFMT_GENERIC_INDEX, +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/arm/cpu.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/arm/cpu.c new file mode 100644 index 00000000..742c3e49 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/arm/cpu.c @@ -0,0 +1,25 @@ +/* + * 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 + */ + +#include "libavutil/cpu.h" +#include "config.h" + +int ff_get_cpu_flags_arm(void) +{ + return HAVE_IWMMXT * AV_CPU_FLAG_IWMMXT; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/arm/intmath.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/arm/intmath.h new file mode 100644 index 00000000..2c0aa3b1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/arm/intmath.h @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#ifndef AVUTIL_ARM_INTMATH_H +#define AVUTIL_ARM_INTMATH_H + +#include + +#include "config.h" +#include "libavutil/attributes.h" + +#if HAVE_INLINE_ASM + +#if HAVE_ARMV6 + +#define FASTDIV FASTDIV +static inline av_const int FASTDIV(int a, int b) +{ + int r, t; + __asm__ volatile("cmp %3, #2 \n\t" + "ldr %1, [%4, %3, lsl #2] \n\t" + "lsrle %0, %2, #1 \n\t" + "smmulgt %0, %1, %2 \n\t" + : "=&r"(r), "=&r"(t) : "r"(a), "r"(b), "r"(ff_inverse)); + return r; +} + +#define av_clip_uint8 av_clip_uint8_arm +static inline av_const uint8_t av_clip_uint8_arm(int a) +{ + unsigned x; + __asm__ volatile ("usat %0, #8, %1" : "=r"(x) : "r"(a)); + return x; +} + +#define av_clip_int8 av_clip_int8_arm +static inline av_const uint8_t av_clip_int8_arm(int a) +{ + unsigned x; + __asm__ volatile ("ssat %0, #8, %1" : "=r"(x) : "r"(a)); + return x; +} + +#define av_clip_uint16 av_clip_uint16_arm +static inline av_const uint16_t av_clip_uint16_arm(int a) +{ + unsigned x; + __asm__ volatile ("usat %0, #16, %1" : "=r"(x) : "r"(a)); + return x; +} + +#define av_clip_int16 av_clip_int16_arm +static inline av_const int16_t av_clip_int16_arm(int a) +{ + int x; + __asm__ volatile ("ssat %0, #16, %1" : "=r"(x) : "r"(a)); + return x; +} + +#else /* HAVE_ARMV6 */ + +#define FASTDIV FASTDIV +static inline av_const int FASTDIV(int a, int b) +{ + int r, t; + __asm__ volatile("umull %1, %0, %2, %3" + : "=&r"(r), "=&r"(t) : "r"(a), "r"(ff_inverse[b])); + return r; +} + +#endif /* HAVE_ARMV6 */ + +#define av_clipl_int32 av_clipl_int32_arm +static inline av_const int32_t av_clipl_int32_arm(int64_t a) +{ + int x, y; + __asm__ volatile ("adds %1, %R2, %Q2, lsr #31 \n\t" + "mvnne %1, #1<<31 \n\t" + "eorne %0, %1, %R2, asr #31 \n\t" + : "=r"(x), "=&r"(y) : "r"(a)); + return x; +} + +#endif /* HAVE_INLINE_ASM */ + +#endif /* AVUTIL_ARM_INTMATH_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/attributes.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/attributes.h new file mode 100644 index 00000000..65a9249c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/attributes.h @@ -0,0 +1,134 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * 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 + * Macro definitions for various function/variable attributes + */ + +#ifndef AVUTIL_ATTRIBUTES_H +#define AVUTIL_ATTRIBUTES_H + +#ifdef __GNUC__ +# define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y) +#else +# define AV_GCC_VERSION_AT_LEAST(x,y) 0 +#endif + +#ifndef av_always_inline +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define av_always_inline __attribute__((always_inline)) inline +#else +# define av_always_inline inline +#endif +#endif + +#ifndef av_noinline +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define av_noinline __attribute__((noinline)) +#else +# define av_noinline +#endif +#endif + +#ifndef av_pure +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define av_pure __attribute__((pure)) +#else +# define av_pure +#endif +#endif + +#ifndef av_const +#if AV_GCC_VERSION_AT_LEAST(2,6) +# define av_const __attribute__((const)) +#else +# define av_const +#endif +#endif + +#ifndef av_cold +#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,3) +# define av_cold __attribute__((cold)) +#else +# define av_cold +#endif +#endif + +#ifndef av_flatten +#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,1) +# define av_flatten __attribute__((flatten)) +#else +# define av_flatten +#endif +#endif + +#ifndef attribute_deprecated +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define attribute_deprecated __attribute__((deprecated)) +#else +# define attribute_deprecated +#endif +#endif + +#ifndef av_unused +#if defined(__GNUC__) +# define av_unused __attribute__((unused)) +#else +# define av_unused +#endif +#endif + +/** + * Mark a variable as used and prevent the compiler from optimizing it + * away. This is useful for variables accessed only from inline + * assembler without the compiler being aware. + */ +#ifndef av_used +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define av_used __attribute__((used)) +#else +# define av_used +#endif +#endif + +#ifndef av_alias +#if (!defined(__ICC) || __ICC > 1200) && AV_GCC_VERSION_AT_LEAST(3,3) +# define av_alias __attribute__((may_alias)) +#else +# define av_alias +#endif +#endif + +#ifndef av_uninit +#if defined(__GNUC__) && !defined(__ICC) +# define av_uninit(x) x=x +#else +# define av_uninit(x) x +#endif +#endif + +#ifdef __GNUC__ +# define av_builtin_constant_p __builtin_constant_p +#else +# define av_builtin_constant_p(x) 0 +#endif + +#endif /* AVUTIL_ATTRIBUTES_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avassert.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avassert.h new file mode 100644 index 00000000..8dd4878c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/avassert.h @@ -0,0 +1,66 @@ +/* + * copyright (c) 2010 Michael Niedermayer + * + * 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 + * simple assert() macros that are a bit more flexible than ISO C assert(). + * @author Michael Niedermayer + */ + +#ifndef AVUTIL_AVASSERT_H +#define AVUTIL_AVASSERT_H + +#include +#include "avutil.h" +#include "log.h" + +/** + * assert() equivalent, that is always enabled. + */ +#define av_assert0(cond) do { \ + if (!(cond)) { \ + av_log(NULL, AV_LOG_FATAL, "Assertion %s failed at %s:%d\n", \ + AV_STRINGIFY(cond), __FILE__, __LINE__); \ + abort(); \ + } \ +} while (0) + + +/** + * assert() equivalent, that does not lie in speed critical code. + * These asserts() thus can be enabled without fearing speedloss. + */ +#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0 +#define av_assert1(cond) av_assert0(cond) +#else +#define av_assert1(cond) ((void)0) +#endif + + +/** + * assert() equivalent, that does lie in speed critical code. + */ +#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1 +#define av_assert2(cond) av_assert0(cond) +#else +#define av_assert2(cond) ((void)0) +#endif + +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/colorspace.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/colorspace.h new file mode 100644 index 00000000..f4381598 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/colorspace.h @@ -0,0 +1,111 @@ +/* + * Colorspace conversion defines + * Copyright (c) 2001, 2002, 2003 Fabrice Bellard + * + * 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 + * Various defines for YUV<->RGB conversion + */ + +#ifndef AVUTIL_COLORSPACE_H +#define AVUTIL_COLORSPACE_H + +#define SCALEBITS 10 +#define ONE_HALF (1 << (SCALEBITS - 1)) +#define FIX(x) ((int) ((x) * (1<> SCALEBITS];\ + g = cm[(y + g_add) >> SCALEBITS];\ + b = cm[(y + b_add) >> SCALEBITS];\ +} + +#define YUV_TO_RGB1(cb1, cr1)\ +{\ + cb = (cb1) - 128;\ + cr = (cr1) - 128;\ + r_add = FIX(1.40200) * cr + ONE_HALF;\ + g_add = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;\ + b_add = FIX(1.77200) * cb + ONE_HALF;\ +} + +#define YUV_TO_RGB2(r, g, b, y1)\ +{\ + y = (y1) << SCALEBITS;\ + r = cm[(y + r_add) >> SCALEBITS];\ + g = cm[(y + g_add) >> SCALEBITS];\ + b = cm[(y + b_add) >> SCALEBITS];\ +} + +#define Y_CCIR_TO_JPEG(y)\ + cm[((y) * FIX(255.0/219.0) + (ONE_HALF - 16 * FIX(255.0/219.0))) >> SCALEBITS] + +#define Y_JPEG_TO_CCIR(y)\ + (((y) * FIX(219.0/255.0) + (ONE_HALF + (16 << SCALEBITS))) >> SCALEBITS) + +#define C_CCIR_TO_JPEG(y)\ + cm[(((y) - 128) * FIX(127.0/112.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS] + +/* NOTE: the clamp is really necessary! */ +static inline int C_JPEG_TO_CCIR(int y) { + y = (((y - 128) * FIX(112.0/127.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS); + if (y < 16) + y = 16; + return y; +} + + +#define RGB_TO_Y(r, g, b) \ +((FIX(0.29900) * (r) + FIX(0.58700) * (g) + \ + FIX(0.11400) * (b) + ONE_HALF) >> SCALEBITS) + +#define RGB_TO_U(r1, g1, b1, shift)\ +(((- FIX(0.16874) * r1 - FIX(0.33126) * g1 + \ + FIX(0.50000) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128) + +#define RGB_TO_V(r1, g1, b1, shift)\ +(((FIX(0.50000) * r1 - FIX(0.41869) * g1 - \ + FIX(0.08131) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128) + +#define RGB_TO_Y_CCIR(r, g, b) \ +((FIX(0.29900*219.0/255.0) * (r) + FIX(0.58700*219.0/255.0) * (g) + \ + FIX(0.11400*219.0/255.0) * (b) + (ONE_HALF + (16 << SCALEBITS))) >> SCALEBITS) + +#define RGB_TO_U_CCIR(r1, g1, b1, shift)\ +(((- FIX(0.16874*224.0/255.0) * r1 - FIX(0.33126*224.0/255.0) * g1 + \ + FIX(0.50000*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128) + +#define RGB_TO_V_CCIR(r1, g1, b1, shift)\ +(((FIX(0.50000*224.0/255.0) * r1 - FIX(0.41869*224.0/255.0) * g1 - \ + FIX(0.08131*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128) + +#endif /* AVUTIL_COLORSPACE_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/cpu.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/cpu.c new file mode 100644 index 00000000..1e034914 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/cpu.c @@ -0,0 +1,69 @@ +/* + * 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 + */ + +#include "cpu.h" +#include "config.h" + +int av_get_cpu_flags(void) +{ + static int flags, checked; + + if (checked) + return flags; + + if (ARCH_ARM) flags = ff_get_cpu_flags_arm(); + if (ARCH_PPC) flags = ff_get_cpu_flags_ppc(); + if (ARCH_X86) flags = ff_get_cpu_flags_x86(); + + checked = 1; + return flags; +} + +#ifdef TEST + +#undef printf +#include + +int main(void) +{ + int cpu_flags = av_get_cpu_flags(); + + printf("cpu_flags = 0x%08X\n", cpu_flags); + printf("cpu_flags = %s%s%s%s%s%s%s%s%s%s%s%s\n", +#if ARCH_ARM + cpu_flags & AV_CPU_FLAG_IWMMXT ? "IWMMXT " : "", +#elif ARCH_PPC + cpu_flags & AV_CPU_FLAG_ALTIVEC ? "ALTIVEC " : "", +#elif ARCH_X86 + cpu_flags & AV_CPU_FLAG_MMX ? "MMX " : "", + cpu_flags & AV_CPU_FLAG_MMX2 ? "MMX2 " : "", + cpu_flags & AV_CPU_FLAG_SSE ? "SSE " : "", + cpu_flags & AV_CPU_FLAG_SSE2 ? "SSE2 " : "", + cpu_flags & AV_CPU_FLAG_SSE2SLOW ? "SSE2(slow) " : "", + cpu_flags & AV_CPU_FLAG_SSE3 ? "SSE3 " : "", + cpu_flags & AV_CPU_FLAG_SSE3SLOW ? "SSE3(slow) " : "", + cpu_flags & AV_CPU_FLAG_SSSE3 ? "SSSE3 " : "", + cpu_flags & AV_CPU_FLAG_SSE4 ? "SSE4.1 " : "", + cpu_flags & AV_CPU_FLAG_SSE42 ? "SSE4.2 " : "", + cpu_flags & AV_CPU_FLAG_3DNOW ? "3DNow " : "", + cpu_flags & AV_CPU_FLAG_3DNOWEXT ? "3DNowExt " : ""); +#endif + return 0; +} + +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/cpu.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/cpu.h new file mode 100644 index 00000000..71cc2652 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/cpu.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * + * 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 + */ + +#ifndef AVUTIL_CPU_H +#define AVUTIL_CPU_H + +#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */ + + /* lower 16 bits - CPU features */ +#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX +#define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext +#define AV_CPU_FLAG_3DNOW 0x0004 ///< AMD 3DNOW +#define AV_CPU_FLAG_SSE 0x0008 ///< SSE functions +#define AV_CPU_FLAG_SSE2 0x0010 ///< PIV SSE2 functions +#define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster +#define AV_CPU_FLAG_3DNOWEXT 0x0020 ///< AMD 3DNowExt +#define AV_CPU_FLAG_SSE3 0x0040 ///< Prescott SSE3 functions +#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster +#define AV_CPU_FLAG_SSSE3 0x0080 ///< Conroe SSSE3 functions +#define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions +#define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions +#define AV_CPU_FLAG_IWMMXT 0x0100 ///< XScale IWMMXT +#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard + +/** + * Return the flags which specify extensions supported by the CPU. + */ +int av_get_cpu_flags(void); + +/* The following CPU-specific functions shall not be called directly. */ +int ff_get_cpu_flags_arm(void); +int ff_get_cpu_flags_ppc(void); +int ff_get_cpu_flags_x86(void); + +#endif /* AVUTIL_CPU_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/error.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/error.c new file mode 100644 index 00000000..5cf54aad --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/error.c @@ -0,0 +1,55 @@ +/* + * 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 + */ + +#include "avutil.h" +#include "avstring.h" + +int av_strerror(int errnum, char *errbuf, size_t errbuf_size) +{ + int ret = 0; + const char *errstr = NULL; + + switch (errnum) { + case AVERROR_EOF: errstr = "End of file"; break; + case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break; + case AVERROR_NUMEXPECTED: errstr = "Number syntax expected in filename"; break; + case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in FFmpeg, patches welcome"; break; + case AVERROR_DEMUXER_NOT_FOUND: errstr = "Demuxer not found"; break; + case AVERROR_MUXER_NOT_FOUND: errstr = "Muxer not found"; break; + case AVERROR_DECODER_NOT_FOUND: errstr = "Decoder not found"; break; + case AVERROR_ENCODER_NOT_FOUND: errstr = "Encoder not found"; break; + case AVERROR_PROTOCOL_NOT_FOUND:errstr = "Protocol not found"; break; + case AVERROR_FILTER_NOT_FOUND: errstr = "Filter not found"; break; + case AVERROR_BSF_NOT_FOUND: errstr = "Bitstream filter not found"; break; + case AVERROR_STREAM_NOT_FOUND: errstr = "Stream not found"; break; + } + + if (errstr) { + av_strlcpy(errbuf, errstr, errbuf_size); + } else { +#if HAVE_STRERROR_R + ret = strerror_r(AVUNERROR(errnum), errbuf, errbuf_size); +#else + ret = -1; +#endif + if (ret < 0) + snprintf(errbuf, errbuf_size, "Error number %d occurred", errnum); + } + + return ret; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/error.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/error.h new file mode 100644 index 00000000..290487f3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/error.h @@ -0,0 +1,83 @@ +/* + * 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 + * error code definitions + */ + +#ifndef AVUTIL_ERROR_H +#define AVUTIL_ERROR_H + +#include +#include "avutil.h" + +/* error handling */ +#if EDOM > 0 +#define AVERROR(e) (-(e)) ///< Returns a negative error code from a POSIX error code, to return from library functions. +#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value. +#else +/* Some platforms have E* and errno already negated. */ +#define AVERROR(e) (e) +#define AVUNERROR(e) (e) +#endif + +#if LIBAVUTIL_VERSION_MAJOR < 51 +#define AVERROR_INVALIDDATA AVERROR(EINVAL) ///< Invalid data found when processing input +#define AVERROR_IO AVERROR(EIO) ///< I/O error +#define AVERROR_NOENT AVERROR(ENOENT) ///< No such file or directory +#define AVERROR_NOFMT AVERROR(EILSEQ) ///< Unknown format +#define AVERROR_NOMEM AVERROR(ENOMEM) ///< Not enough memory +#define AVERROR_NOTSUPP AVERROR(ENOSYS) ///< Operation not supported +#define AVERROR_NUMEXPECTED AVERROR(EDOM) ///< Number syntax expected in filename +#define AVERROR_UNKNOWN AVERROR(EINVAL) ///< Unknown error +#endif + +#define AVERROR_EOF AVERROR(EPIPE) ///< End of file + +#define AVERROR_PATCHWELCOME (-MKTAG('P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome + +#if LIBAVUTIL_VERSION_MAJOR > 50 +#define AVERROR_INVALIDDATA (-MKTAG('I','N','D','A')) ///< Invalid data found when processing input +#define AVERROR_NUMEXPECTED (-MKTAG('N','U','E','X')) ///< Number syntax expected in filename +#endif + +#define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found +#define AVERROR_MUXER_NOT_FOUND (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found +#define AVERROR_DECODER_NOT_FOUND (-MKTAG(0xF8,'D','E','C')) ///< Decoder not found +#define AVERROR_ENCODER_NOT_FOUND (-MKTAG(0xF8,'E','N','C')) ///< Encoder not found +#define AVERROR_PROTOCOL_NOT_FOUND (-MKTAG(0xF8,'P','R','O')) ///< Protocol not found +#define AVERROR_FILTER_NOT_FOUND (-MKTAG(0xF8,'F','I','L')) ///< Filter not found +#define AVERROR_BSF_NOT_FOUND (-MKTAG(0xF8,'B','S','F')) ///< Bitstream filter not found +#define AVERROR_STREAM_NOT_FOUND (-MKTAG(0xF8,'S','T','R')) ///< Stream not found + +/** + * Put a description of the AVERROR code errnum in errbuf. + * In case of failure the global variable errno is set to indicate the + * error. Even in case of failure av_strerror() will print a generic + * error message indicating the errnum provided to errbuf. + * + * @param errnum error code to describe + * @param errbuf buffer to which description is written + * @param errbuf_size the size in bytes of errbuf + * @return 0 on success, a negative value if a description for errnum + * cannot be found + */ +int av_strerror(int errnum, char *errbuf, size_t errbuf_size); + +#endif /* AVUTIL_ERROR_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/eval.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/eval.c new file mode 100644 index 00000000..0fef97bd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/eval.c @@ -0,0 +1,643 @@ +/* + * Copyright (c) 2002-2006 Michael Niedermayer + * Copyright (c) 2006 Oded Shimon + * + * 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 + * simple arithmetic expression evaluator. + * + * see http://joe.hotchkiss.com/programming/eval/eval.html + */ + +#include "libavutil/avutil.h" +#include "eval.h" + +typedef struct Parser { + const AVClass *class; + int stack_index; + char *s; + const double *const_values; + const char * const *const_names; // NULL terminated + double (* const *funcs1)(void *, double a); // NULL terminated + const char * const *func1_names; // NULL terminated + double (* const *funcs2)(void *, double a, double b); // NULL terminated + const char * const *func2_names; // NULL terminated + void *opaque; + int log_offset; + void *log_ctx; +#define VARS 10 + double var[VARS]; +} Parser; + +static const AVClass class = { "Eval", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, offsetof(Parser,log_offset), offsetof(Parser,log_ctx) }; + +static const int8_t si_prefixes['z' - 'E' + 1] = { + ['y'-'E']= -24, + ['z'-'E']= -21, + ['a'-'E']= -18, + ['f'-'E']= -15, + ['p'-'E']= -12, + ['n'-'E']= - 9, + ['u'-'E']= - 6, + ['m'-'E']= - 3, + ['c'-'E']= - 2, + ['d'-'E']= - 1, + ['h'-'E']= 2, + ['k'-'E']= 3, + ['K'-'E']= 3, + ['M'-'E']= 6, + ['G'-'E']= 9, + ['T'-'E']= 12, + ['P'-'E']= 15, + ['E'-'E']= 18, + ['Z'-'E']= 21, + ['Y'-'E']= 24, +}; + +double av_strtod(const char *numstr, char **tail) +{ + double d; + char *next; + d = strtod(numstr, &next); + /* if parsing succeeded, check for and interpret postfixes */ + if (next!=numstr) { + if (*next >= 'E' && *next <= 'z') { + int e= si_prefixes[*next - 'E']; + if (e) { + if (next[1] == 'i') { + d*= pow( 2, e/0.3); + next+=2; + } else { + d*= pow(10, e); + next++; + } + } + } + + if (*next=='B') { + d*=8; + next++; + } + } + /* if requested, fill in tail with the position after the last parsed + character */ + if (tail) + *tail = next; + return d; +} + +#define IS_IDENTIFIER_CHAR(c) ((c) - '0' <= 9U || (c) - 'a' <= 25U || (c) - 'A' <= 25U || (c) == '_') + +static int strmatch(const char *s, const char *prefix) +{ + int i; + for (i=0; prefix[i]; i++) { + if (prefix[i] != s[i]) return 0; + } + /* return 1 only if the s identifier is terminated */ + return !IS_IDENTIFIER_CHAR(s[i]); +} + +struct AVExpr { + enum { + e_value, e_const, e_func0, e_func1, e_func2, + e_squish, e_gauss, e_ld, e_isnan, + e_mod, e_max, e_min, e_eq, e_gt, e_gte, + e_pow, e_mul, e_div, e_add, + e_last, e_st, e_while, + } type; + double value; // is sign in other types + union { + int const_index; + double (*func0)(double); + double (*func1)(void *, double); + double (*func2)(void *, double, double); + } a; + struct AVExpr *param[2]; +}; + +static double eval_expr(Parser *p, AVExpr *e) +{ + switch (e->type) { + case e_value: return e->value; + case e_const: return e->value * p->const_values[e->a.const_index]; + case e_func0: return e->value * e->a.func0(eval_expr(p, e->param[0])); + case e_func1: return e->value * e->a.func1(p->opaque, eval_expr(p, e->param[0])); + case e_func2: return e->value * e->a.func2(p->opaque, eval_expr(p, e->param[0]), eval_expr(p, e->param[1])); + case e_squish: return 1/(1+exp(4*eval_expr(p, e->param[0]))); + case e_gauss: { double d = eval_expr(p, e->param[0]); return exp(-d*d/2)/sqrt(2*M_PI); } + case e_ld: return e->value * p->var[av_clip(eval_expr(p, e->param[0]), 0, VARS-1)]; + case e_isnan: return e->value * !!isnan(eval_expr(p, e->param[0])); + case e_while: { + double d = NAN; + while (eval_expr(p, e->param[0])) + d=eval_expr(p, e->param[1]); + return d; + } + default: { + double d = eval_expr(p, e->param[0]); + double d2 = eval_expr(p, e->param[1]); + switch (e->type) { + case e_mod: return e->value * (d - floor(d/d2)*d2); + case e_max: return e->value * (d > d2 ? d : d2); + case e_min: return e->value * (d < d2 ? d : d2); + case e_eq: return e->value * (d == d2 ? 1.0 : 0.0); + case e_gt: return e->value * (d > d2 ? 1.0 : 0.0); + case e_gte: return e->value * (d >= d2 ? 1.0 : 0.0); + case e_pow: return e->value * pow(d, d2); + case e_mul: return e->value * (d * d2); + case e_div: return e->value * (d / d2); + case e_add: return e->value * (d + d2); + case e_last:return e->value * d2; + case e_st : return e->value * (p->var[av_clip(d, 0, VARS-1)]= d2); + } + } + } + return NAN; +} + +static int parse_expr(AVExpr **e, Parser *p); + +void av_expr_free(AVExpr *e) +{ + if (!e) return; + av_expr_free(e->param[0]); + av_expr_free(e->param[1]); + av_freep(&e); +} + +static int parse_primary(AVExpr **e, Parser *p) +{ + AVExpr *d = av_mallocz(sizeof(AVExpr)); + char *next = p->s, *s0 = p->s; + int ret, i; + + if (!d) + return AVERROR(ENOMEM); + + /* number */ + d->value = av_strtod(p->s, &next); + if (next != p->s) { + d->type = e_value; + p->s= next; + *e = d; + return 0; + } + d->value = 1; + + /* named constants */ + for (i=0; p->const_names && p->const_names[i]; i++) { + if (strmatch(p->s, p->const_names[i])) { + p->s+= strlen(p->const_names[i]); + d->type = e_const; + d->a.const_index = i; + *e = d; + return 0; + } + } + + p->s= strchr(p->s, '('); + if (p->s==NULL) { + av_log(p, AV_LOG_ERROR, "Undefined constant or missing '(' in '%s'\n", s0); + p->s= next; + av_expr_free(d); + return AVERROR(EINVAL); + } + p->s++; // "(" + if (*next == '(') { // special case do-nothing + av_freep(&d); + if ((ret = parse_expr(&d, p)) < 0) + return ret; + if (p->s[0] != ')') { + av_log(p, AV_LOG_ERROR, "Missing ')' in '%s'\n", s0); + av_expr_free(d); + return AVERROR(EINVAL); + } + p->s++; // ")" + *e = d; + return 0; + } + if ((ret = parse_expr(&(d->param[0]), p)) < 0) { + av_expr_free(d); + return ret; + } + if (p->s[0]== ',') { + p->s++; // "," + parse_expr(&d->param[1], p); + } + if (p->s[0] != ')') { + av_log(p, AV_LOG_ERROR, "Missing ')' or too many args in '%s'\n", s0); + av_expr_free(d); + return AVERROR(EINVAL); + } + p->s++; // ")" + + d->type = e_func0; + if (strmatch(next, "sinh" )) d->a.func0 = sinh; + else if (strmatch(next, "cosh" )) d->a.func0 = cosh; + else if (strmatch(next, "tanh" )) d->a.func0 = tanh; + else if (strmatch(next, "sin" )) d->a.func0 = sin; + else if (strmatch(next, "cos" )) d->a.func0 = cos; + else if (strmatch(next, "tan" )) d->a.func0 = tan; + else if (strmatch(next, "atan" )) d->a.func0 = atan; + else if (strmatch(next, "asin" )) d->a.func0 = asin; + else if (strmatch(next, "acos" )) d->a.func0 = acos; + else if (strmatch(next, "exp" )) d->a.func0 = exp; + else if (strmatch(next, "log" )) d->a.func0 = log; + else if (strmatch(next, "abs" )) d->a.func0 = fabs; + else if (strmatch(next, "squish")) d->type = e_squish; + else if (strmatch(next, "gauss" )) d->type = e_gauss; + else if (strmatch(next, "mod" )) d->type = e_mod; + else if (strmatch(next, "max" )) d->type = e_max; + else if (strmatch(next, "min" )) d->type = e_min; + else if (strmatch(next, "eq" )) d->type = e_eq; + else if (strmatch(next, "gte" )) d->type = e_gte; + else if (strmatch(next, "gt" )) d->type = e_gt; + else if (strmatch(next, "lte" )) { AVExpr *tmp = d->param[1]; d->param[1] = d->param[0]; d->param[0] = tmp; d->type = e_gt; } + else if (strmatch(next, "lt" )) { AVExpr *tmp = d->param[1]; d->param[1] = d->param[0]; d->param[0] = tmp; d->type = e_gte; } + else if (strmatch(next, "ld" )) d->type = e_ld; + else if (strmatch(next, "isnan" )) d->type = e_isnan; + else if (strmatch(next, "st" )) d->type = e_st; + else if (strmatch(next, "while" )) d->type = e_while; + else { + for (i=0; p->func1_names && p->func1_names[i]; i++) { + if (strmatch(next, p->func1_names[i])) { + d->a.func1 = p->funcs1[i]; + d->type = e_func1; + *e = d; + return 0; + } + } + + for (i=0; p->func2_names && p->func2_names[i]; i++) { + if (strmatch(next, p->func2_names[i])) { + d->a.func2 = p->funcs2[i]; + d->type = e_func2; + *e = d; + return 0; + } + } + + av_log(p, AV_LOG_ERROR, "Unknown function in '%s'\n", s0); + av_expr_free(d); + return AVERROR(EINVAL); + } + + *e = d; + return 0; +} + +static AVExpr *new_eval_expr(int type, int value, AVExpr *p0, AVExpr *p1) +{ + AVExpr *e = av_mallocz(sizeof(AVExpr)); + if (!e) + return NULL; + e->type =type ; + e->value =value ; + e->param[0] =p0 ; + e->param[1] =p1 ; + return e; +} + +static int parse_pow(AVExpr **e, Parser *p, int *sign) +{ + *sign= (*p->s == '+') - (*p->s == '-'); + p->s += *sign&1; + return parse_primary(e, p); +} + +static int parse_factor(AVExpr **e, Parser *p) +{ + int sign, sign2, ret; + AVExpr *e0, *e1, *e2; + if ((ret = parse_pow(&e0, p, &sign)) < 0) + return ret; + while(p->s[0]=='^'){ + e1 = e0; + p->s++; + if ((ret = parse_pow(&e2, p, &sign2)) < 0) { + av_expr_free(e1); + return ret; + } + e0 = new_eval_expr(e_pow, 1, e1, e2); + if (!e0) { + av_expr_free(e1); + av_expr_free(e2); + return AVERROR(ENOMEM); + } + if (e0->param[1]) e0->param[1]->value *= (sign2|1); + } + if (e0) e0->value *= (sign|1); + + *e = e0; + return 0; +} + +static int parse_term(AVExpr **e, Parser *p) +{ + int ret; + AVExpr *e0, *e1, *e2; + if ((ret = parse_factor(&e0, p)) < 0) + return ret; + while (p->s[0]=='*' || p->s[0]=='/') { + int c= *p->s++; + e1 = e0; + if ((ret = parse_factor(&e2, p)) < 0) { + av_expr_free(e1); + return ret; + } + e0 = new_eval_expr(c == '*' ? e_mul : e_div, 1, e1, e2); + if (!e0) { + av_expr_free(e1); + av_expr_free(e2); + return AVERROR(ENOMEM); + } + } + *e = e0; + return 0; +} + +static int parse_subexpr(AVExpr **e, Parser *p) +{ + int ret; + AVExpr *e0, *e1, *e2; + if ((ret = parse_term(&e0, p)) < 0) + return ret; + while (*p->s == '+' || *p->s == '-') { + e1 = e0; + if ((ret = parse_term(&e2, p)) < 0) { + av_expr_free(e1); + return ret; + } + e0 = new_eval_expr(e_add, 1, e1, e2); + if (!e0) { + av_expr_free(e1); + av_expr_free(e2); + return AVERROR(ENOMEM); + } + }; + + *e = e0; + return 0; +} + +static int parse_expr(AVExpr **e, Parser *p) +{ + int ret; + AVExpr *e0, *e1, *e2; + if (p->stack_index <= 0) //protect against stack overflows + return AVERROR(EINVAL); + p->stack_index--; + + if ((ret = parse_subexpr(&e0, p)) < 0) + return ret; + while (*p->s == ';') { + p->s++; + e1 = e0; + if ((ret = parse_subexpr(&e2, p)) < 0) { + av_expr_free(e1); + return ret; + } + e0 = new_eval_expr(e_last, 1, e1, e2); + if (!e0) { + av_expr_free(e1); + av_expr_free(e2); + return AVERROR(ENOMEM); + } + }; + + p->stack_index++; + *e = e0; + return 0; +} + +static int verify_expr(AVExpr *e) +{ + if (!e) return 0; + switch (e->type) { + case e_value: + case e_const: return 1; + case e_func0: + case e_func1: + case e_squish: + case e_ld: + case e_gauss: + case e_isnan: return verify_expr(e->param[0]); + default: return verify_expr(e->param[0]) && verify_expr(e->param[1]); + } +} + +int av_expr_parse(AVExpr **expr, const char *s, + const char * const *const_names, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + int log_offset, void *log_ctx) +{ + Parser p; + AVExpr *e = NULL; + char *w = av_malloc(strlen(s) + 1); + char *wp = w; + const char *s0 = s; + int ret = 0; + + if (!w) + return AVERROR(ENOMEM); + + while (*s) + if (!isspace(*s++)) *wp++ = s[-1]; + *wp++ = 0; + + p.class = &class; + p.stack_index=100; + p.s= w; + p.const_names = const_names; + p.funcs1 = funcs1; + p.func1_names = func1_names; + p.funcs2 = funcs2; + p.func2_names = func2_names; + p.log_offset = log_offset; + p.log_ctx = log_ctx; + + if ((ret = parse_expr(&e, &p)) < 0) + goto end; + if (*p.s) { + av_log(&p, AV_LOG_ERROR, "Invalid chars '%s' at the end of expression '%s'\n", p.s, s0); + ret = AVERROR(EINVAL); + goto end; + } + if (!verify_expr(e)) { + av_expr_free(e); + ret = AVERROR(EINVAL); + goto end; + } + *expr = e; +end: + av_free(w); + return ret; +} + +double av_expr_eval(AVExpr *e, const double *const_values, void *opaque) +{ + Parser p; + + p.const_values = const_values; + p.opaque = opaque; + return eval_expr(&p, e); +} + +int av_expr_parse_and_eval(double *d, const char *s, + const char * const *const_names, const double *const_values, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + void *opaque, int log_offset, void *log_ctx) +{ + AVExpr *e = NULL; + int ret = av_expr_parse(&e, s, const_names, func1_names, funcs1, func2_names, funcs2, log_offset, log_ctx); + + if (ret < 0) { + *d = NAN; + return ret; + } + *d = av_expr_eval(e, const_values, opaque); + av_expr_free(e); + return isnan(*d) ? AVERROR(EINVAL) : 0; +} + +#if FF_API_OLD_EVAL_NAMES +int av_parse_expr(AVExpr **expr, const char *s, + const char * const *const_names, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + int log_offset, void *log_ctx) +{ + return av_expr_parse(expr, s, const_names, func1_names, funcs1, func2_names, funcs2, + log_offset, log_ctx); +} + +double av_eval_expr(AVExpr *e, const double *const_values, void *opaque) +{ + return av_expr_eval(e, const_values, opaque); +} + +int av_parse_and_eval_expr(double *res, const char *s, + const char * const *const_names, const double *const_values, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + void *opaque, int log_offset, void *log_ctx) +{ + return av_expr_parse_and_eval(res, s, const_names, const_values, func1_names, funcs1, func2_names, funcs2, + opaque, log_offset, log_ctx); +} + +void av_free_expr(AVExpr *e) +{ + av_expr_free(e); +} +#endif /* FF_API_OLD_EVAL_NAMES */ + +#ifdef TEST +#undef printf +static double const_values[] = { + M_PI, + M_E, + 0 +}; + +static const char *const_names[] = { + "PI", + "E", + 0 +}; + +int main(void) +{ + int i; + double d; + const char **expr, *exprs[] = { + "", + "1;2", + "-20", + "-PI", + "+PI", + "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", + "80G/80Gi" + "1k", + "1Gi", + "1gi", + "1GiFoo", + "1k+1k", + "1Gi*3foo", + "foo", + "foo(", + "foo()", + "foo)", + "sin", + "sin(", + "sin()", + "sin)", + "sin 10", + "sin(1,2,3)", + "sin(1 )", + "1", + "1foo", + "bar + PI + E + 100f*2 + foo", + "13k + 12f - foo(1, 2)", + "1gi", + "1Gi", + "st(0, 123)", + "st(1, 123); ld(1)", + /* compute 1+2+...+N */ + "st(0, 1); while(lte(ld(0), 100), st(1, ld(1)+ld(0));st(0, ld(0)+1)); ld(1)", + /* compute Fib(N) */ + "st(1, 1); st(2, 2); st(0, 1); while(lte(ld(0),10), st(3, ld(1)+ld(2)); st(1, ld(2)); st(2, ld(3)); st(0, ld(0)+1)); ld(3)", + "while(0, 10)", + "st(0, 1); while(lte(ld(0),100), st(1, ld(1)+ld(0)); st(0, ld(0)+1))", + "isnan(1)", + "isnan(NAN)", + NULL + }; + + for (expr = exprs; *expr; expr++) { + printf("Evaluating '%s'\n", *expr); + av_expr_parse_and_eval(&d, *expr, + const_names, const_values, + NULL, NULL, NULL, NULL, NULL, 0, NULL); + printf("'%s' -> %f\n\n", *expr, d); + } + + av_expr_parse_and_eval(&d, "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", + const_names, const_values, + NULL, NULL, NULL, NULL, NULL, 0, NULL); + printf("%f == 12.7\n", d); + av_expr_parse_and_eval(&d, "80G/80Gi", + const_names, const_values, + NULL, NULL, NULL, NULL, NULL, 0, NULL); + printf("%f == 0.931322575\n", d); + + for (i=0; i<1050; i++) { + START_TIMER + av_expr_parse_and_eval(&d, "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", + const_names, const_values, + NULL, NULL, NULL, NULL, NULL, 0, NULL); + STOP_TIMER("av_expr_parse_and_eval") + } + return 0; +} +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/eval.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/eval.h new file mode 100644 index 00000000..ee378a29 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/eval.h @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2002 Michael Niedermayer + * + * 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 + * simple arithmetic expression evaluator + */ + +#ifndef AVUTIL_EVAL_H +#define AVUTIL_EVAL_H + +#include "avutil.h" + +typedef struct AVExpr AVExpr; + +/** + * Parse and evaluate an expression. + * Note, this is significantly slower than av_expr_eval(). + * + * @param res a pointer to a double where is put the result value of + * the expression, or NAN in case of error + * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)" + * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0} + * @param const_values a zero terminated array of values for the identifiers from const_names + * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers + * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument + * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers + * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments + * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2 + * @param log_ctx parent logging context + * @return 0 in case of success, a negative value corresponding to an + * AVERROR code otherwise + */ +int av_expr_parse_and_eval(double *res, const char *s, + const char * const *const_names, const double *const_values, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + void *opaque, int log_offset, void *log_ctx); + +/** + * Parse an expression. + * + * @param expr a pointer where is put an AVExpr containing the parsed + * value in case of successfull parsing, or NULL otherwise. + * The pointed to AVExpr must be freed with av_expr_free() by the user + * when it is not needed anymore. + * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)" + * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0} + * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers + * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument + * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers + * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments + * @param log_ctx parent logging context + * @return 0 in case of success, a negative value corresponding to an + * AVERROR code otherwise + */ +int av_expr_parse(AVExpr **expr, const char *s, + const char * const *const_names, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + int log_offset, void *log_ctx); + +/** + * Evaluate a previously parsed expression. + * + * @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names + * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2 + * @return the value of the expression + */ +double av_expr_eval(AVExpr *e, const double *const_values, void *opaque); + +/** + * Free a parsed expression previously created with av_expr_parse(). + */ +void av_expr_free(AVExpr *e); + +#if FF_API_OLD_EVAL_NAMES +/** + * @deprecated Deprecated in favor of av_expr_parse_and_eval(). + */ +attribute_deprecated +int av_parse_and_eval_expr(double *res, const char *s, + const char * const *const_names, const double *const_values, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + void *opaque, int log_offset, void *log_ctx); + +/** + * @deprecated Deprecated in favor of av_expr_parse(). + */ +attribute_deprecated +int av_parse_expr(AVExpr **expr, const char *s, + const char * const *const_names, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + int log_offset, void *log_ctx); +/** + * @deprecated Deprecated in favor of av_expr_eval(). + */ +attribute_deprecated +double av_eval_expr(AVExpr *e, const double *const_values, void *opaque); + +/** + * @deprecated Deprecated in favor of av_expr_free(). + */ +attribute_deprecated +void av_free_expr(AVExpr *e); +#endif /* FF_API_OLD_EVAL_NAMES */ + +/** + * Parse the string in numstr and return its value as a double. If + * the string is empty, contains only whitespaces, or does not contain + * an initial substring that has the expected syntax for a + * floating-point number, no conversion is performed. In this case, + * returns a value of zero and the value returned in tail is the value + * of numstr. + * + * @param numstr a string representing a number, may contain one of + * the International System number postfixes, for example 'K', 'M', + * 'G'. If 'i' is appended after the postfix, powers of 2 are used + * instead of powers of 10. The 'B' postfix multiplies the value for + * 8, and can be appended after another postfix or used alone. This + * allows using for example 'KB', 'MiB', 'G' and 'B' as postfix. + * @param tail if non-NULL puts here the pointer to the char next + * after the last parsed character + */ +double av_strtod(const char *numstr, char **tail); + +#endif /* AVUTIL_EVAL_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/file.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/file.c new file mode 100644 index 00000000..c79f68aa --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/file.c @@ -0,0 +1,149 @@ +/* + * 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 + */ + +#include "file.h" +#include +#include +#include +#if HAVE_MMAP +#include +#elif HAVE_MAPVIEWOFFILE +#include +#include +#endif + +typedef struct { + const AVClass *class; + int log_offset; + void *log_ctx; +} FileLogContext; + +static const AVClass file_log_ctx_class = { + "FILE", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, + offsetof(FileLogContext, log_offset), offsetof(FileLogContext, log_ctx) +}; + +int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, + int log_offset, void *log_ctx) +{ + FileLogContext file_log_ctx = { &file_log_ctx_class, log_offset, log_ctx }; + int err, fd = open(filename, O_RDONLY); + struct stat st; + av_unused void *ptr; + off_t off_size; + char errbuf[128]; + size_t max_size = HAVE_MMAP ? SIZE_MAX : FF_INTERNAL_MEM_TYPE_MAX_VALUE; + *bufptr = NULL; + + if (fd < 0) { + err = AVERROR(errno); + av_strerror(err, errbuf, sizeof(errbuf)); + av_log(&file_log_ctx, AV_LOG_ERROR, "Cannot read file '%s': %s\n", filename, errbuf); + return err; + } + + if (fstat(fd, &st) < 0) { + err = AVERROR(errno); + av_strerror(err, errbuf, sizeof(errbuf)); + av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in fstat(): %s\n", errbuf); + close(fd); + return err; + } + + off_size = st.st_size; + if (off_size > max_size) { + av_log(&file_log_ctx, AV_LOG_ERROR, + "File size for file '%s' is too big\n", filename); + close(fd); + return AVERROR(EINVAL); + } + *size = off_size; + +#if HAVE_MMAP + ptr = mmap(NULL, *size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); + if ((int)(ptr) == -1) { + err = AVERROR(errno); + av_strerror(err, errbuf, sizeof(errbuf)); + av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in mmap(): %s\n", errbuf); + close(fd); + return err; + } + *bufptr = ptr; +#elif HAVE_MAPVIEWOFFILE + { + HANDLE mh, fh = (HANDLE)_get_osfhandle(fd); + + mh = CreateFileMapping(fh, NULL, PAGE_READONLY, 0, 0, NULL); + if (!mh) { + av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in CreateFileMapping()\n"); + close(fd); + return -1; + } + + ptr = MapViewOfFile(mh, FILE_MAP_READ, 0, 0, *size); + CloseHandle(mh); + if (!ptr) { + av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in MapViewOfFile()\n"); + close(fd); + return -1; + } + + *bufptr = ptr; + } +#else + *bufptr = av_malloc(*size); + if (!*bufptr) { + av_log(&file_log_ctx, AV_LOG_ERROR, "Memory allocation error occurred\n"); + close(fd); + return AVERROR(ENOMEM); + } + read(fd, *bufptr, *size); +#endif + + close(fd); + return 0; +} + +void av_file_unmap(uint8_t *bufptr, size_t size) +{ +#if HAVE_MMAP + munmap(bufptr, size); +#elif HAVE_MAPVIEWOFFILE + UnmapViewOfFile(bufptr); +#else + av_free(bufptr); +#endif +} + +#ifdef TEST + +#undef printf + +int main(void) +{ + uint8_t *buf; + size_t size; + if (av_file_map("file.c", &buf, &size, 0, NULL) < 0) + return 1; + + buf[0] = 's'; + printf("%s", buf); + av_file_unmap(buf, size); + return 0; +} +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/file.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/file.h new file mode 100644 index 00000000..f94d7803 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/file.h @@ -0,0 +1,51 @@ +/* + * 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 + */ + +#ifndef AVUTIL_FILE_H +#define AVUTIL_FILE_H + +#include "avutil.h" + +/** + * @file misc file utilities + */ + +/** + * Read the file with name filename, and put its content in a newly + * allocated buffer or map it with mmap() when available. + * In case of success set *bufptr to the read or mmapped buffer, and + * *size to the size in bytes of the buffer in *bufptr. + * The returned buffer must be released with av_file_unmap(). + * + * @param log_offset loglevel offset used for logging + * @param log_ctx context used for logging + * @return a non negative number in case of success, a negative value + * corresponding to an AVERROR error code in case of failure + */ +int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, + int log_offset, void *log_ctx); + +/** + * Unmap or free the buffer bufptr created by av_file_map(). + * + * @param size size in bytes of bufptr, must be the same as returned + * by av_file_map() + */ +void av_file_unmap(uint8_t *bufptr, size_t size); + +#endif /* AVUTIL_FILE_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/intmath.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/intmath.h new file mode 100644 index 00000000..8b400ef0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/intmath.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#ifndef AVUTIL_INTMATH_H +#define AVUTIL_INTMATH_H + +#include +#include "config.h" +#include "attributes.h" + +extern const uint32_t ff_inverse[257]; + +#if ARCH_ARM +# include "arm/intmath.h" +#elif ARCH_X86 +# include "x86/intmath.h" +#endif + +#if HAVE_FAST_CLZ && AV_GCC_VERSION_AT_LEAST(3,4) + +#ifndef av_log2 +# define av_log2(x) (31 - __builtin_clz((x)|1)) +# ifndef av_log2_16bit +# define av_log2_16bit av_log2 +# endif +#endif /* av_log2 */ + +#endif /* AV_GCC_VERSION_AT_LEAST(3,4) */ + +#ifndef FASTDIV +# if CONFIG_FASTDIV +# define FASTDIV(a,b) ((uint32_t)((((uint64_t)a) * ff_inverse[b]) >> 32)) +# else +# define FASTDIV(a,b) ((a) / (b)) +# endif +#endif /* FASTDIV */ + +#include "common.h" + +extern const uint8_t ff_sqrt_tab[256]; + +static inline av_const unsigned int ff_sqrt(unsigned int a) +{ + unsigned int b; + + if (a < 255) return (ff_sqrt_tab[a + 1] - 1) >> 4; + else if (a < (1 << 12)) b = ff_sqrt_tab[a >> 4] >> 2; +#if !CONFIG_SMALL + else if (a < (1 << 14)) b = ff_sqrt_tab[a >> 6] >> 1; + else if (a < (1 << 16)) b = ff_sqrt_tab[a >> 8] ; +#endif + else { + int s = av_log2_16bit(a >> 16) >> 1; + unsigned int c = a >> (s + 2); + b = ff_sqrt_tab[c >> (s + 8)]; + b = FASTDIV(c,b) + (b << s); + } + + return b - (a < b * b); +} + +#endif /* AVUTIL_INTMATH_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/inverse.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/inverse.c new file mode 100644 index 00000000..74df1c24 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/inverse.c @@ -0,0 +1,60 @@ +/* + * Inverse table + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + */ + +#include "libavutil/intmath.h" + +/* a*inverse[b]>>32 == a/b for all 0<=a<=16909558 && 2<=b<=256 + * for a>16909558, is an overestimate by less than 1 part in 1<<24 */ +const uint32_t ff_inverse[257]={ + 0, 4294967295U,2147483648U,1431655766, 1073741824, 858993460, 715827883, 613566757, + 536870912, 477218589, 429496730, 390451573, 357913942, 330382100, 306783379, 286331154, + 268435456, 252645136, 238609295, 226050911, 214748365, 204522253, 195225787, 186737709, + 178956971, 171798692, 165191050, 159072863, 153391690, 148102321, 143165577, 138547333, + 134217728, 130150525, 126322568, 122713352, 119304648, 116080198, 113025456, 110127367, + 107374183, 104755300, 102261127, 99882961, 97612894, 95443718, 93368855, 91382283, + 89478486, 87652394, 85899346, 84215046, 82595525, 81037119, 79536432, 78090315, + 76695845, 75350304, 74051161, 72796056, 71582789, 70409300, 69273667, 68174085, + 67108864, 66076420, 65075263, 64103990, 63161284, 62245903, 61356676, 60492498, + 59652324, 58835169, 58040099, 57266231, 56512728, 55778797, 55063684, 54366675, + 53687092, 53024288, 52377650, 51746594, 51130564, 50529028, 49941481, 49367441, + 48806447, 48258060, 47721859, 47197443, 46684428, 46182445, 45691142, 45210183, + 44739243, 44278014, 43826197, 43383509, 42949673, 42524429, 42107523, 41698712, + 41297763, 40904451, 40518560, 40139882, 39768216, 39403370, 39045158, 38693400, + 38347923, 38008561, 37675152, 37347542, 37025581, 36709123, 36398028, 36092163, + 35791395, 35495598, 35204650, 34918434, 34636834, 34359739, 34087043, 33818641, + 33554432, 33294321, 33038210, 32786010, 32537632, 32292988, 32051995, 31814573, + 31580642, 31350127, 31122952, 30899046, 30678338, 30460761, 30246249, 30034737, + 29826162, 29620465, 29417585, 29217465, 29020050, 28825284, 28633116, 28443493, + 28256364, 28071682, 27889399, 27709467, 27531842, 27356480, 27183338, 27012373, + 26843546, 26676816, 26512144, 26349493, 26188825, 26030105, 25873297, 25718368, + 25565282, 25414008, 25264514, 25116768, 24970741, 24826401, 24683721, 24542671, + 24403224, 24265352, 24129030, 23994231, 23860930, 23729102, 23598722, 23469767, + 23342214, 23216040, 23091223, 22967740, 22845571, 22724695, 22605092, 22486740, + 22369622, 22253717, 22139007, 22025474, 21913099, 21801865, 21691755, 21582751, + 21474837, 21367997, 21262215, 21157475, 21053762, 20951060, 20849356, 20748635, + 20648882, 20550083, 20452226, 20355296, 20259280, 20164166, 20069941, 19976593, + 19884108, 19792477, 19701685, 19611723, 19522579, 19434242, 19346700, 19259944, + 19173962, 19088744, 19004281, 18920561, 18837576, 18755316, 18673771, 18592933, + 18512791, 18433337, 18354562, 18276457, 18199014, 18122225, 18046082, 17970575, + 17895698, 17821442, 17747799, 17674763, 17602325, 17530479, 17459217, 17388532, + 17318417, 17248865, 17179870, 17111424, 17043522, 16976156, 16909321, 16843010, + 16777216 +}; diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/libm.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/libm.h new file mode 100644 index 00000000..c7c28ac2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/libm.h @@ -0,0 +1,96 @@ +/* + * 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 + * Replacements for frequently missing libm functions + */ + +#ifndef AVUTIL_LIBM_H +#define AVUTIL_LIBM_H + +#include +#include "config.h" +#include "attributes.h" + +#if !HAVE_EXP2 +#undef exp2 +#define exp2(x) exp((x) * 0.693147180559945) +#endif /* HAVE_EXP2 */ + +#if !HAVE_EXP2F +#undef exp2f +#define exp2f(x) ((float)exp2(x)) +#endif /* HAVE_EXP2F */ + +#if !HAVE_LLRINT +#undef llrint +#define llrint(x) ((long long)rint(x)) +#endif /* HAVE_LLRINT */ + +#if !HAVE_LLRINTF +#undef llrintf +#define llrintf(x) ((long long)rint(x)) +#endif /* HAVE_LLRINT */ + +#if !HAVE_LOG2 +#undef log2 +#define log2(x) (log(x) * 1.44269504088896340736) +#endif /* HAVE_LOG2 */ + +#if !HAVE_LOG2F +#undef log2f +#define log2f(x) ((float)log2(x)) +#endif /* HAVE_LOG2F */ + +#if !HAVE_LRINT +static av_always_inline av_const long int lrint(double x) +{ + return rint(x); +} +#endif /* HAVE_LRINT */ + +#if !HAVE_LRINTF +static av_always_inline av_const long int lrintf(float x) +{ + return (int)(rint(x)); +} +#endif /* HAVE_LRINTF */ + +#if !HAVE_ROUND +static av_always_inline av_const double round(double x) +{ + return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5); +} +#endif /* HAVE_ROUND */ + +#if !HAVE_ROUNDF +static av_always_inline av_const float roundf(float x) +{ + return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5); +} +#endif /* HAVE_ROUNDF */ + +#if !HAVE_TRUNCF +static av_always_inline av_const float truncf(float x) +{ + return (x > 0) ? floor(x) : ceil(x); +} +#endif /* HAVE_TRUNCF */ + +#endif /* AVUTIL_LIBM_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/opt.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/opt.c new file mode 100644 index 00000000..ab6021c7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/opt.c @@ -0,0 +1,607 @@ +/* + * AVOptions + * Copyright (c) 2005 Michael Niedermayer + * + * 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 + * AVOptions + * @author Michael Niedermayer + */ + +#include "avutil.h" +#include "avstring.h" +#include "opt.h" +#include "eval.h" + +//FIXME order them and do a bin search +const AVOption *av_find_opt(void *v, const char *name, const char *unit, int mask, int flags) +{ + AVClass *c= *(AVClass**)v; //FIXME silly way of storing AVClass + const AVOption *o= c->option; + + for (; o && o->name; o++) { + if (!strcmp(o->name, name) && (!unit || (o->unit && !strcmp(o->unit, unit))) && (o->flags & mask) == flags) + return o; + } + return NULL; +} + +const AVOption *av_next_option(void *obj, const AVOption *last) +{ + if (last && last[1].name) return ++last; + else if (last) return NULL; + else return (*(AVClass**)obj)->option; +} + +static int av_set_number2(void *obj, const char *name, double num, int den, int64_t intnum, const AVOption **o_out) +{ + const AVOption *o= av_find_opt(obj, name, NULL, 0, 0); + void *dst; + if (o_out) + *o_out= o; + if (!o || o->offset<=0) + return AVERROR(ENOENT); + + if (o->max*den < num*intnum || o->min*den > num*intnum) { + av_log(obj, AV_LOG_ERROR, "Value %lf for parameter '%s' out of range\n", num, name); + return AVERROR(ERANGE); + } + + dst= ((uint8_t*)obj) + o->offset; + + switch (o->type) { + case FF_OPT_TYPE_FLAGS: + case FF_OPT_TYPE_INT: *(int *)dst= llrint(num/den)*intnum; break; + case FF_OPT_TYPE_INT64: *(int64_t *)dst= llrint(num/den)*intnum; break; + case FF_OPT_TYPE_FLOAT: *(float *)dst= num*intnum/den; break; + case FF_OPT_TYPE_DOUBLE:*(double *)dst= num*intnum/den; break; + case FF_OPT_TYPE_RATIONAL: + if ((int)num == num) *(AVRational*)dst= (AVRational){num*intnum, den}; + else *(AVRational*)dst= av_d2q(num*intnum/den, 1<<24); + break; + default: + return AVERROR(EINVAL); + } + return 0; +} + +static const AVOption *av_set_number(void *obj, const char *name, double num, int den, int64_t intnum) +{ + const AVOption *o = NULL; + if (av_set_number2(obj, name, num, den, intnum, &o) < 0) + return NULL; + else + return o; +} + +static const double const_values[] = { + M_PI, + M_E, + FF_QP2LAMBDA, + 0 +}; + +static const char * const const_names[] = { + "PI", + "E", + "QP2LAMBDA", + 0 +}; + +static int hexchar2int(char c) { + if (c >= '0' && c <= '9') return c - '0'; + if (c >= 'a' && c <= 'f') return c - 'a' + 10; + if (c >= 'A' && c <= 'F') return c - 'A' + 10; + return -1; +} + +int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out) +{ + int ret; + const AVOption *o= av_find_opt(obj, name, NULL, 0, 0); + if (o_out) + *o_out = o; + if (!o) + return AVERROR(ENOENT); + if (!val || o->offset<=0) + return AVERROR(EINVAL); + + if (o->type == FF_OPT_TYPE_BINARY) { + uint8_t **dst = (uint8_t **)(((uint8_t*)obj) + o->offset); + int *lendst = (int *)(dst + 1); + uint8_t *bin, *ptr; + int len = strlen(val); + av_freep(dst); + *lendst = 0; + if (len & 1) return AVERROR(EINVAL); + len /= 2; + ptr = bin = av_malloc(len); + while (*val) { + int a = hexchar2int(*val++); + int b = hexchar2int(*val++); + if (a < 0 || b < 0) { + av_free(bin); + return AVERROR(EINVAL); + } + *ptr++ = (a << 4) | b; + } + *dst = bin; + *lendst = len; + return 0; + } + if (o->type != FF_OPT_TYPE_STRING) { + int notfirst=0; + for (;;) { + int i; + char buf[256]; + int cmd=0; + double d; + + if (*val == '+' || *val == '-') + cmd= *(val++); + + for (i=0; iunit, 0, 0); + if (o_named && o_named->type == FF_OPT_TYPE_CONST) + d= o_named->default_val; + else if (!strcmp(buf, "default")) d= o->default_val; + else if (!strcmp(buf, "max" )) d= o->max; + else if (!strcmp(buf, "min" )) d= o->min; + else if (!strcmp(buf, "none" )) d= 0; + else if (!strcmp(buf, "all" )) d= ~0; + else { + int res = av_expr_parse_and_eval(&d, buf, const_names, const_values, NULL, NULL, NULL, NULL, NULL, 0, obj); + if (res < 0) { + av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\"\n", val); + return res; + } + } + } + if (o->type == FF_OPT_TYPE_FLAGS) { + if (cmd=='+') d= av_get_int(obj, name, NULL) | (int64_t)d; + else if (cmd=='-') d= av_get_int(obj, name, NULL) &~(int64_t)d; + } else { + if (cmd=='+') d= notfirst*av_get_double(obj, name, NULL) + d; + else if (cmd=='-') d= notfirst*av_get_double(obj, name, NULL) - d; + } + + if ((ret = av_set_number2(obj, name, d, 1, 1, o_out)) < 0) + return ret; + val+= i; + if (!*val) + return 0; + notfirst=1; + } + return AVERROR(EINVAL); + } + + if (alloc) { + av_free(*(void**)(((uint8_t*)obj) + o->offset)); + val= av_strdup(val); + } + + memcpy(((uint8_t*)obj) + o->offset, &val, sizeof(val)); + return 0; +} + +const AVOption *av_set_double(void *obj, const char *name, double n) +{ + return av_set_number(obj, name, n, 1, 1); +} + +const AVOption *av_set_q(void *obj, const char *name, AVRational n) +{ + return av_set_number(obj, name, n.num, n.den, 1); +} + +const AVOption *av_set_int(void *obj, const char *name, int64_t n) +{ + return av_set_number(obj, name, 1, 1, n); +} + +/** + * + * @param buf a buffer which is used for returning non string values as strings, can be NULL + * @param buf_len allocated length in bytes of buf + */ +const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len) +{ + const AVOption *o= av_find_opt(obj, name, NULL, 0, 0); + void *dst; + uint8_t *bin; + int len, i; + if (!o || o->offset<=0) + return NULL; + if (o->type != FF_OPT_TYPE_STRING && (!buf || !buf_len)) + return NULL; + + dst= ((uint8_t*)obj) + o->offset; + if (o_out) *o_out= o; + + switch (o->type) { + case FF_OPT_TYPE_FLAGS: snprintf(buf, buf_len, "0x%08X",*(int *)dst);break; + case FF_OPT_TYPE_INT: snprintf(buf, buf_len, "%d" , *(int *)dst);break; + case FF_OPT_TYPE_INT64: snprintf(buf, buf_len, "%"PRId64, *(int64_t*)dst);break; + case FF_OPT_TYPE_FLOAT: snprintf(buf, buf_len, "%f" , *(float *)dst);break; + case FF_OPT_TYPE_DOUBLE: snprintf(buf, buf_len, "%f" , *(double *)dst);break; + case FF_OPT_TYPE_RATIONAL: snprintf(buf, buf_len, "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break; + case FF_OPT_TYPE_STRING: return *(void**)dst; + case FF_OPT_TYPE_BINARY: + len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *)); + if (len >= (buf_len + 1)/2) return NULL; + bin = *(uint8_t**)dst; + for (i = 0; i < len; i++) snprintf(buf + i*2, 3, "%02X", bin[i]); + break; + default: return NULL; + } + return buf; +} + +static int av_get_number(void *obj, const char *name, const AVOption **o_out, double *num, int *den, int64_t *intnum) +{ + const AVOption *o= av_find_opt(obj, name, NULL, 0, 0); + void *dst; + if (!o || o->offset<=0) + goto error; + + dst= ((uint8_t*)obj) + o->offset; + + if (o_out) *o_out= o; + + switch (o->type) { + case FF_OPT_TYPE_FLAGS: *intnum= *(unsigned int*)dst;return 0; + case FF_OPT_TYPE_INT: *intnum= *(int *)dst;return 0; + case FF_OPT_TYPE_INT64: *intnum= *(int64_t*)dst;return 0; + case FF_OPT_TYPE_FLOAT: *num= *(float *)dst;return 0; + case FF_OPT_TYPE_DOUBLE: *num= *(double *)dst;return 0; + case FF_OPT_TYPE_RATIONAL: *intnum= ((AVRational*)dst)->num; + *den = ((AVRational*)dst)->den; + return 0; + } +error: + *den=*intnum=0; + return -1; +} + +double av_get_double(void *obj, const char *name, const AVOption **o_out) +{ + int64_t intnum=1; + double num=1; + int den=1; + + av_get_number(obj, name, o_out, &num, &den, &intnum); + return num*intnum/den; +} + +AVRational av_get_q(void *obj, const char *name, const AVOption **o_out) +{ + int64_t intnum=1; + double num=1; + int den=1; + + av_get_number(obj, name, o_out, &num, &den, &intnum); + if (num == 1.0 && (int)intnum == intnum) + return (AVRational){intnum, den}; + else + return av_d2q(num*intnum/den, 1<<24); +} + +int64_t av_get_int(void *obj, const char *name, const AVOption **o_out) +{ + int64_t intnum=1; + double num=1; + int den=1; + + av_get_number(obj, name, o_out, &num, &den, &intnum); + return num*intnum/den; +} + +static void opt_list(void *obj, void *av_log_obj, const char *unit, + int req_flags, int rej_flags) +{ + const AVOption *opt=NULL; + + while ((opt= av_next_option(obj, opt))) { + if (!(opt->flags & req_flags) || (opt->flags & rej_flags)) + continue; + + /* Don't print CONST's on level one. + * Don't print anything but CONST's on level two. + * Only print items from the requested unit. + */ + if (!unit && opt->type==FF_OPT_TYPE_CONST) + continue; + else if (unit && opt->type!=FF_OPT_TYPE_CONST) + continue; + else if (unit && opt->type==FF_OPT_TYPE_CONST && strcmp(unit, opt->unit)) + continue; + else if (unit && opt->type == FF_OPT_TYPE_CONST) + av_log(av_log_obj, AV_LOG_INFO, " %-15s ", opt->name); + else + av_log(av_log_obj, AV_LOG_INFO, "-%-17s ", opt->name); + + switch (opt->type) { + case FF_OPT_TYPE_FLAGS: + av_log(av_log_obj, AV_LOG_INFO, "%-7s ", ""); + break; + case FF_OPT_TYPE_INT: + av_log(av_log_obj, AV_LOG_INFO, "%-7s ", ""); + break; + case FF_OPT_TYPE_INT64: + av_log(av_log_obj, AV_LOG_INFO, "%-7s ", ""); + break; + case FF_OPT_TYPE_DOUBLE: + av_log(av_log_obj, AV_LOG_INFO, "%-7s ", ""); + break; + case FF_OPT_TYPE_FLOAT: + av_log(av_log_obj, AV_LOG_INFO, "%-7s ", ""); + break; + case FF_OPT_TYPE_STRING: + av_log(av_log_obj, AV_LOG_INFO, "%-7s ", ""); + break; + case FF_OPT_TYPE_RATIONAL: + av_log(av_log_obj, AV_LOG_INFO, "%-7s ", ""); + break; + case FF_OPT_TYPE_BINARY: + av_log(av_log_obj, AV_LOG_INFO, "%-7s ", ""); + break; + case FF_OPT_TYPE_CONST: + default: + av_log(av_log_obj, AV_LOG_INFO, "%-7s ", ""); + break; + } + av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_ENCODING_PARAM) ? 'E' : '.'); + av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_DECODING_PARAM) ? 'D' : '.'); + av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_VIDEO_PARAM ) ? 'V' : '.'); + av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_AUDIO_PARAM ) ? 'A' : '.'); + av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_SUBTITLE_PARAM) ? 'S' : '.'); + + if (opt->help) + av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help); + av_log(av_log_obj, AV_LOG_INFO, "\n"); + if (opt->unit && opt->type != FF_OPT_TYPE_CONST) { + opt_list(obj, av_log_obj, opt->unit, req_flags, rej_flags); + } + } +} + +int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags) +{ + if (!obj) + return -1; + + av_log(av_log_obj, AV_LOG_INFO, "%s AVOptions:\n", (*(AVClass**)obj)->class_name); + + opt_list(obj, av_log_obj, NULL, req_flags, rej_flags); + + return 0; +} + +/** Set the values of the AVCodecContext or AVFormatContext structure. + * They are set to the defaults specified in the according AVOption options + * array default_val field. + * + * @param s AVCodecContext or AVFormatContext for which the defaults will be set + */ +void av_opt_set_defaults2(void *s, int mask, int flags) +{ + const AVOption *opt = NULL; + while ((opt = av_next_option(s, opt)) != NULL) { + if ((opt->flags & mask) != flags) + continue; + switch (opt->type) { + case FF_OPT_TYPE_CONST: + /* Nothing to be done here */ + break; + case FF_OPT_TYPE_FLAGS: + case FF_OPT_TYPE_INT: { + int val; + val = opt->default_val; + av_set_int(s, opt->name, val); + } + break; + case FF_OPT_TYPE_INT64: + if ((double)(opt->default_val+0.6) == opt->default_val) + av_log(s, AV_LOG_DEBUG, "loss of precision in default of %s\n", opt->name); + av_set_int(s, opt->name, opt->default_val); + break; + case FF_OPT_TYPE_DOUBLE: + case FF_OPT_TYPE_FLOAT: { + double val; + val = opt->default_val; + av_set_double(s, opt->name, val); + } + break; + case FF_OPT_TYPE_RATIONAL: { + AVRational val; + val = av_d2q(opt->default_val, INT_MAX); + av_set_q(s, opt->name, val); + } + break; + case FF_OPT_TYPE_STRING: + case FF_OPT_TYPE_BINARY: + /* Cannot set default for string as default_val is of type * double */ + break; + default: + av_log(s, AV_LOG_DEBUG, "AVOption type %d of option %s not implemented yet\n", opt->type, opt->name); + } + } +} + +void av_opt_set_defaults(void *s) +{ + av_opt_set_defaults2(s, 0, 0); +} + +/** + * Store the value in the field in ctx that is named like key. + * ctx must be an AVClass context, storing is done using AVOptions. + * + * @param buf the string to parse, buf will be updated to point at the + * separator just after the parsed key/value pair + * @param key_val_sep a 0-terminated list of characters used to + * separate key from value + * @param pairs_sep a 0-terminated list of characters used to separate + * two pairs from each other + * @return 0 if the key/value pair has been successfully parsed and + * set, or a negative value corresponding to an AVERROR code in case + * of error: + * AVERROR(EINVAL) if the key/value pair cannot be parsed, + * the error code issued by av_set_string3() if the key/value pair + * cannot be set + */ +static int parse_key_value_pair(void *ctx, const char **buf, + const char *key_val_sep, const char *pairs_sep) +{ + char *key = av_get_token(buf, key_val_sep); + char *val; + int ret; + + if (*key && strspn(*buf, key_val_sep)) { + (*buf)++; + val = av_get_token(buf, pairs_sep); + } else { + av_log(ctx, AV_LOG_ERROR, "Missing key or no key/value separator found after key '%s'\n", key); + av_free(key); + return AVERROR(EINVAL); + } + + av_log(ctx, AV_LOG_DEBUG, "Setting value '%s' for key '%s'\n", val, key); + + ret = av_set_string3(ctx, key, val, 1, NULL); + if (ret == AVERROR(ENOENT)) + av_log(ctx, AV_LOG_ERROR, "Key '%s' not found.\n", key); + + av_free(key); + av_free(val); + return ret; +} + +int av_set_options_string(void *ctx, const char *opts, + const char *key_val_sep, const char *pairs_sep) +{ + int ret, count = 0; + + while (*opts) { + if ((ret = parse_key_value_pair(ctx, &opts, key_val_sep, pairs_sep)) < 0) + return ret; + count++; + + if (*opts) + opts++; + } + + return count; +} + +#ifdef TEST + +#undef printf + +typedef struct TestContext +{ + const AVClass *class; + int num; + int toggle; + char *string; + int flags; + AVRational rational; +} TestContext; + +#define OFFSET(x) offsetof(TestContext, x) + +#define TEST_FLAG_COOL 01 +#define TEST_FLAG_LAME 02 +#define TEST_FLAG_MU 04 + +static const AVOption test_options[]= { +{"num", "set num", OFFSET(num), FF_OPT_TYPE_INT, 0, 0, 100 }, +{"toggle", "set toggle", OFFSET(toggle), FF_OPT_TYPE_INT, 0, 0, 1 }, +{"rational", "set rational", OFFSET(rational), FF_OPT_TYPE_RATIONAL, 0, 0, 10 }, +{"string", "set string", OFFSET(string), FF_OPT_TYPE_STRING, 0, CHAR_MIN, CHAR_MAX }, +{"flags", "set flags", OFFSET(flags), FF_OPT_TYPE_FLAGS, 0, 0, INT_MAX, 0, "flags" }, +{"cool", "set cool flag ", 0, FF_OPT_TYPE_CONST, TEST_FLAG_COOL, INT_MIN, INT_MAX, 0, "flags" }, +{"lame", "set lame flag ", 0, FF_OPT_TYPE_CONST, TEST_FLAG_LAME, INT_MIN, INT_MAX, 0, "flags" }, +{"mu", "set mu flag ", 0, FF_OPT_TYPE_CONST, TEST_FLAG_MU, INT_MIN, INT_MAX, 0, "flags" }, +{NULL}, +}; + +static const char *test_get_name(void *ctx) +{ + return "test"; +} + +static const AVClass test_class = { + "TestContext", + test_get_name, + test_options +}; + +int main(void) +{ + int i; + + printf("\nTesting av_set_options_string()\n"); + { + TestContext test_ctx; + const char *options[] = { + "", + ":", + "=", + "foo=:", + ":=foo", + "=foo", + "foo=", + "foo", + "foo=val", + "foo==val", + "toggle=:", + "string=:", + "toggle=1 : foo", + "toggle=100", + "toggle==1", + "flags=+mu-lame : num=42: toggle=0", + "num=42 : string=blahblah", + "rational=0 : rational=1/2 : rational=1/-1", + "rational=-1/0", + }; + + test_ctx.class = &test_class; + av_opt_set_defaults2(&test_ctx, 0, 0); + test_ctx.string = av_strdup("default"); + + av_log_set_level(AV_LOG_DEBUG); + + for (i=0; i < FF_ARRAY_ELEMS(options); i++) { + av_log(&test_ctx, AV_LOG_DEBUG, "Setting options string '%s'\n", options[i]); + if (av_set_options_string(&test_ctx, options[i], "=", ":") < 0) + av_log(&test_ctx, AV_LOG_ERROR, "Error setting options string: '%s'\n", options[i]); + printf("\n"); + } + } + + return 0; +} + +#endif diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/opt.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/opt.h new file mode 100644 index 00000000..67c2dd7c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/opt.h @@ -0,0 +1,226 @@ +/* + * AVOptions + * copyright (c) 2005 Michael Niedermayer + * + * 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 + */ + +#ifndef AVUTIL_OPT_H +#define AVUTIL_OPT_H + +/** + * @file + * AVOptions + */ + +#include "rational.h" +#include "avutil.h" + +enum AVOptionType{ + FF_OPT_TYPE_FLAGS, + FF_OPT_TYPE_INT, + FF_OPT_TYPE_INT64, + FF_OPT_TYPE_DOUBLE, + FF_OPT_TYPE_FLOAT, + FF_OPT_TYPE_STRING, + FF_OPT_TYPE_RATIONAL, + FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length + FF_OPT_TYPE_CONST=128, +}; + +/** + * AVOption + */ +typedef struct AVOption { + const char *name; + + /** + * short English help text + * @todo What about other languages? + */ + const char *help; + + /** + * The offset relative to the context structure where the option + * value is stored. It should be 0 for named constants. + */ + int offset; + enum AVOptionType type; + + /** + * the default value for scalar options + */ + double default_val; + double min; ///< minimum valid value for the option + double max; ///< maximum valid value for the option + + int flags; +#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding +#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding +#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ... +#define AV_OPT_FLAG_AUDIO_PARAM 8 +#define AV_OPT_FLAG_VIDEO_PARAM 16 +#define AV_OPT_FLAG_SUBTITLE_PARAM 32 +//FIXME think about enc-audio, ... style flags + + /** + * The logical unit to which the option belongs. Non-constant + * options and corresponding named constants share the same + * unit. May be NULL. + */ + const char *unit; +} AVOption; + +/** + * AVOption2. + * THIS IS NOT PART OF THE API/ABI YET! + * This is identical to AVOption except that default_val was replaced by + * an union, it should be compatible with AVOption on normal platforms. + */ +typedef struct AVOption2 { + const char *name; + + /** + * short English help text + * @todo What about other languages? + */ + const char *help; + + /** + * The offset relative to the context structure where the option + * value is stored. It should be 0 for named constants. + */ + int offset; + enum AVOptionType type; + + /** + * the default value for scalar options + */ + union { + double dbl; + const char *str; + } default_val; + + double min; ///< minimum valid value for the option + double max; ///< maximum valid value for the option + + int flags; +/* +#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding +#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding +#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ... +#define AV_OPT_FLAG_AUDIO_PARAM 8 +#define AV_OPT_FLAG_VIDEO_PARAM 16 +#define AV_OPT_FLAG_SUBTITLE_PARAM 32 +*/ +//FIXME think about enc-audio, ... style flags + + /** + * The logical unit to which the option belongs. Non-constant + * options and corresponding named constants share the same + * unit. May be NULL. + */ + const char *unit; +} AVOption2; + + +/** + * Look for an option in obj. Look only for the options which + * have the flags set as specified in mask and flags (that is, + * for which it is the case that opt->flags & mask == flags). + * + * @param[in] obj a pointer to a struct whose first element is a + * pointer to an AVClass + * @param[in] name the name of the option to look for + * @param[in] unit the unit of the option to look for, or any if NULL + * @return a pointer to the option found, or NULL if no option + * has been found + */ +const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags); + +/** + * Set the field of obj with the given name to value. + * + * @param[in] obj A struct whose first element is a pointer to an + * AVClass. + * @param[in] name the name of the field to set + * @param[in] val The value to set. If the field is not of a string + * type, then the given string is parsed. + * SI postfixes and some named scalars are supported. + * If the field is of a numeric type, it has to be a numeric or named + * scalar. Behavior with more than one scalar and +- infix operators + * is undefined. + * If the field is of a flags type, it has to be a sequence of numeric + * scalars or named flags separated by '+' or '-'. Prefixing a flag + * with '+' causes it to be set without affecting the other flags; + * similarly, '-' unsets a flag. + * @param[out] o_out if non-NULL put here a pointer to the AVOption + * found + * @param alloc when 1 then the old value will be av_freed() and the + * new av_strduped() + * when 0 then no av_free() nor av_strdup() will be used + * @return 0 if the value has been set, or an AVERROR code in case of + * error: + * AVERROR(ENOENT) if no matching option exists + * AVERROR(ERANGE) if the value is out of range + * AVERROR(EINVAL) if the value is not valid + */ +int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out); + +const AVOption *av_set_double(void *obj, const char *name, double n); +const AVOption *av_set_q(void *obj, const char *name, AVRational n); +const AVOption *av_set_int(void *obj, const char *name, int64_t n); +double av_get_double(void *obj, const char *name, const AVOption **o_out); +AVRational av_get_q(void *obj, const char *name, const AVOption **o_out); +int64_t av_get_int(void *obj, const char *name, const AVOption **o_out); +const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len); +const AVOption *av_next_option(void *obj, const AVOption *last); + +/** + * Show the obj options. + * + * @param req_flags requested flags for the options to show. Show only the + * options for which it is opt->flags & req_flags. + * @param rej_flags rejected flags for the options to show. Show only the + * options for which it is !(opt->flags & req_flags). + * @param av_log_obj log context to use for showing the options + */ +int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags); + +void av_opt_set_defaults(void *s); +void av_opt_set_defaults2(void *s, int mask, int flags); + +/** + * Parse the key/value pairs list in opts. For each key/value pair + * found, stores the value in the field in ctx that is named like the + * key. ctx must be an AVClass context, storing is done using + * AVOptions. + * + * @param key_val_sep a 0-terminated list of characters used to + * separate key from value + * @param pairs_sep a 0-terminated list of characters used to separate + * two pairs from each other + * @return the number of successfully set key/value pairs, or a negative + * value corresponding to an AVERROR code in case of error: + * AVERROR(EINVAL) if opts cannot be parsed, + * the error code issued by av_set_string3() if a key/value pair + * cannot be set + */ +int av_set_options_string(void *ctx, const char *opts, + const char *key_val_sep, const char *pairs_sep); + +#endif /* AVUTIL_OPT_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixdesc.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixdesc.c new file mode 100644 index 00000000..83aa8b01 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixdesc.c @@ -0,0 +1,867 @@ +/* + * pixel format descriptor + * Copyright (c) 2009 Michael Niedermayer + * + * 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 + */ + +#include +#include +#include "pixfmt.h" +#include "pixdesc.h" + +#include "intreadwrite.h" + +void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4], + const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component) +{ + AVComponentDescriptor comp= desc->comp[c]; + int plane= comp.plane; + int depth= comp.depth_minus1+1; + int mask = (1<flags; + + if (flags & PIX_FMT_BITSTREAM){ + int skip = x*step + comp.offset_plus1-1; + const uint8_t *p = data[plane] + y*linesize[plane] + (skip>>3); + int shift = 8 - depth - (skip&7); + + while(w--){ + int val = (*p >> shift) & mask; + if(read_pal_component) + val= data[1][4*val + c]; + shift -= step; + p -= shift>>3; + shift &= 7; + *dst++= val; + } + } else { + const uint8_t *p = data[plane]+ y*linesize[plane] + x*step + comp.offset_plus1-1; + int is_8bit = shift + depth <= 8; + + if (is_8bit) + p += !!(flags & PIX_FMT_BE); + + while(w--){ + int val = is_8bit ? *p : + flags & PIX_FMT_BE ? AV_RB16(p) : AV_RL16(p); + val = (val>>shift) & mask; + if(read_pal_component) + val= data[1][4*val + c]; + p+= step; + *dst++= val; + } + } +} + +void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4], + const AVPixFmtDescriptor *desc, int x, int y, int c, int w) +{ + AVComponentDescriptor comp = desc->comp[c]; + int plane = comp.plane; + int depth = comp.depth_minus1+1; + int step = comp.step_minus1+1; + int flags = desc->flags; + + if (flags & PIX_FMT_BITSTREAM) { + int skip = x*step + comp.offset_plus1-1; + uint8_t *p = data[plane] + y*linesize[plane] + (skip>>3); + int shift = 8 - depth - (skip&7); + + while (w--) { + *p |= *src++ << shift; + shift -= step; + p -= shift>>3; + shift &= 7; + } + } else { + int shift = comp.shift; + uint8_t *p = data[plane]+ y*linesize[plane] + x*step + comp.offset_plus1-1; + + if (shift + depth <= 8) { + p += !!(flags & PIX_FMT_BE); + while (w--) { + *p |= (*src++<log2_chroma_w + pixdesc->log2_chroma_h; + + for (c = 0; c < pixdesc->nb_components; c++) { + int s = c==1 || c==2 ? 0 : log2_pixels; + bits += (pixdesc->comp[c].depth_minus1+1) << s; + } + + return bits >> log2_pixels; +} + +char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt) +{ + /* print header */ + if (pix_fmt < 0) { + snprintf (buf, buf_size, "name " " nb_components" " nb_bits"); + } else { + const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt]; + snprintf(buf, buf_size, "%-11s %7d %10d", + pixdesc->name, pixdesc->nb_components, av_get_bits_per_pixel(pixdesc)); + } + + return buf; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixdesc.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixdesc.h new file mode 100644 index 00000000..727e47f0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/pixdesc.h @@ -0,0 +1,166 @@ +/* + * pixel format descriptor + * Copyright (c) 2009 Michael Niedermayer + * + * 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 + */ + +#ifndef AVUTIL_PIXDESC_H +#define AVUTIL_PIXDESC_H + +#include + +typedef struct AVComponentDescriptor{ + uint16_t plane :2; ///< which of the 4 planes contains the component + + /** + * Number of elements between 2 horizontally consecutive pixels minus 1. + * Elements are bits for bitstream formats, bytes otherwise. + */ + uint16_t step_minus1 :3; + + /** + * Number of elements before the component of the first pixel plus 1. + * Elements are bits for bitstream formats, bytes otherwise. + */ + uint16_t offset_plus1 :3; + uint16_t shift :3; ///< number of least significant bits that must be shifted away to get the value + uint16_t depth_minus1 :4; ///< number of bits in the component minus 1 +}AVComponentDescriptor; + +/** + * Descriptor that unambiguously describes how the bits of a pixel are + * stored in the up to 4 data planes of an image. It also stores the + * subsampling factors and number of components. + * + * @note This is separate of the colorspace (RGB, YCbCr, YPbPr, JPEG-style YUV + * and all the YUV variants) AVPixFmtDescriptor just stores how values + * are stored not what these values represent. + */ +typedef struct AVPixFmtDescriptor{ + const char *name; + uint8_t nb_components; ///< The number of components each pixel has, (1-4) + + /** + * Amount to shift the luma width right to find the chroma width. + * For YV12 this is 1 for example. + * chroma_width = -((-luma_width) >> log2_chroma_w) + * The note above is needed to ensure rounding up. + * This value only refers to the chroma components. + */ + uint8_t log2_chroma_w; ///< chroma_width = -((-luma_width )>>log2_chroma_w) + + /** + * Amount to shift the luma height right to find the chroma height. + * For YV12 this is 1 for example. + * chroma_height= -((-luma_height) >> log2_chroma_h) + * The note above is needed to ensure rounding up. + * This value only refers to the chroma components. + */ + uint8_t log2_chroma_h; + uint8_t flags; + + /** + * Parameters that describe how pixels are packed. If the format + * has chroma components, they must be stored in comp[1] and + * comp[2]. + */ + AVComponentDescriptor comp[4]; +}AVPixFmtDescriptor; + +#define PIX_FMT_BE 1 ///< Pixel format is big-endian. +#define PIX_FMT_PAL 2 ///< Pixel format has a palette in data[1], values are indexes in this palette. +#define PIX_FMT_BITSTREAM 4 ///< All values of a component are bit-wise packed end to end. +#define PIX_FMT_HWACCEL 8 ///< Pixel format is an HW accelerated format. + +/** + * The array of all the pixel format descriptors. + */ +extern const AVPixFmtDescriptor av_pix_fmt_descriptors[]; + +/** + * Read a line from an image, and write the values of the + * pixel format component c to dst. + * + * @param data the array containing the pointers to the planes of the image + * @param linesize the array containing the linesizes of the image + * @param desc the pixel format descriptor for the image + * @param x the horizontal coordinate of the first pixel to read + * @param y the vertical coordinate of the first pixel to read + * @param w the width of the line to read, that is the number of + * values to write to dst + * @param read_pal_component if not zero and the format is a paletted + * format writes the values corresponding to the palette + * component c in data[1] to dst, rather than the palette indexes in + * data[0]. The behavior is undefined if the format is not paletted. + */ +void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4], + const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component); + +/** + * Write the values from src to the pixel format component c of an + * image line. + * + * @param src array containing the values to write + * @param data the array containing the pointers to the planes of the + * image to write into. It is supposed to be zeroed. + * @param linesize the array containing the linesizes of the image + * @param desc the pixel format descriptor for the image + * @param x the horizontal coordinate of the first pixel to write + * @param y the vertical coordinate of the first pixel to write + * @param w the width of the line to write, that is the number of + * values to write to the image line + */ +void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4], + const AVPixFmtDescriptor *desc, int x, int y, int c, int w); + +/** + * Return the pixel format corresponding to name. + * + * If there is no pixel format with name name, then looks for a + * pixel format with the name corresponding to the native endian + * format of name. + * For example in a little-endian system, first looks for "gray16", + * then for "gray16le". + * + * Finally if no pixel format has been found, returns PIX_FMT_NONE. + */ +enum PixelFormat av_get_pix_fmt(const char *name); + +/** + * Print in buf the string corresponding to the pixel format with + * number pix_fmt, or an header if pix_fmt is negative. + * + * @param buf the buffer where to write the string + * @param buf_size the size of buf + * @param pix_fmt the number of the pixel format to print the + * corresponding info string, or a negative value to print the + * corresponding header. + */ +char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt); + +/** + * Return the number of bits per pixel used by the pixel format + * described by pixdesc. + * + * The returned number of bits refers to the number of bits actually + * used for storing the pixel information, that is padding bits are + * not counted. + */ +int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc); + +#endif /* AVUTIL_PIXDESC_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/ppc/cpu.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/ppc/cpu.c new file mode 100644 index 00000000..9dc9471b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/ppc/cpu.c @@ -0,0 +1,84 @@ +/* + * 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 + */ + +#ifdef __APPLE__ +#undef _POSIX_C_SOURCE +#include +#elif defined(__OpenBSD__) +#include +#include +#include +#elif defined(__AMIGAOS4__) +#include +#include +#include +#endif /* __APPLE__ */ + +#include "libavutil/cpu.h" +#include "config.h" + +/** + * This function MAY rely on signal() or fork() in order to make sure AltiVec + * is present. + */ +int ff_get_cpu_flags_ppc(void) +{ +#if HAVE_ALTIVEC +#ifdef __AMIGAOS4__ + ULONG result = 0; + extern struct ExecIFace *IExec; + + IExec->GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE); + if (result == VECTORTYPE_ALTIVEC) + return AV_CPU_FLAG_ALTIVEC; + return 0; +#elif defined(__APPLE__) || defined(__OpenBSD__) +#ifdef __OpenBSD__ + int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC}; +#else + int sels[2] = {CTL_HW, HW_VECTORUNIT}; +#endif + int has_vu = 0; + size_t len = sizeof(has_vu); + int err; + + err = sysctl(sels, 2, &has_vu, &len, NULL, 0); + + if (err == 0) + return has_vu ? AV_CPU_FLAG_ALTIVEC : 0; + return 0; +#elif CONFIG_RUNTIME_CPUDETECT + int proc_ver; + // Support of mfspr PVR emulation added in Linux 2.6.17. + __asm__ volatile("mfspr %0, 287" : "=r" (proc_ver)); + proc_ver >>= 16; + if (proc_ver & 0x8000 || + proc_ver == 0x000c || + proc_ver == 0x0039 || proc_ver == 0x003c || + proc_ver == 0x0044 || proc_ver == 0x0045 || + proc_ver == 0x0070) + return AV_CPU_FLAG_ALTIVEC; + return 0; +#else + // Since we were compiled for AltiVec, just assume we have it + // until someone comes up with a proper way (not involving signal hacks). + return AV_CPU_FLAG_ALTIVEC; +#endif /* __AMIGAOS4__ */ +#endif /* HAVE_ALTIVEC */ + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/tomi/intreadwrite.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/tomi/intreadwrite.h new file mode 100644 index 00000000..778b804c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/tomi/intreadwrite.h @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#ifndef AVUTIL_TOMI_INTREADWRITE_H +#define AVUTIL_TOMI_INTREADWRITE_H + +#include +#include "config.h" + +#define AV_RB16 AV_RB16 +static av_always_inline uint16_t AV_RB16(const void *p) +{ + uint16_t v; + __asm__ ("loadacc, (%1+) \n\t" + "rol8 \n\t" + "storeacc, %0 \n\t" + "loadacc, (%1+) \n\t" + "add, %0 \n\t" + : "=r"(v), "+a"(p)); + return v; +} + +#define AV_WB16 AV_WB16 +static av_always_inline void AV_WB16(void *p, uint16_t v) +{ + __asm__ volatile ("loadacc, %1 \n\t" + "lsr8 \n\t" + "storeacc, (%0+) \n\t" + "loadacc, %1 \n\t" + "storeacc, (%0+) \n\t" + : "+&a"(p) : "r"(v)); +} + +#define AV_RL16 AV_RL16 +static av_always_inline uint16_t AV_RL16(const void *p) +{ + uint16_t v; + __asm__ ("loadacc, (%1+) \n\t" + "storeacc, %0 \n\t" + "loadacc, (%1+) \n\t" + "rol8 \n\t" + "add, %0 \n\t" + : "=r"(v), "+a"(p)); + return v; +} + +#define AV_WL16 AV_WL16 +static av_always_inline void AV_WL16(void *p, uint16_t v) +{ + __asm__ volatile ("loadacc, %1 \n\t" + "storeacc, (%0+) \n\t" + "lsr8 \n\t" + "storeacc, (%0+) \n\t" + : "+&a"(p) : "r"(v)); +} + +#define AV_RB32 AV_RB32 +static av_always_inline uint32_t AV_RB32(const void *p) +{ + uint32_t v; + __asm__ ("loadacc, (%1+) \n\t" + "rol8 \n\t" + "rol8 \n\t" + "rol8 \n\t" + "storeacc, %0 \n\t" + "loadacc, (%1+) \n\t" + "rol8 \n\t" + "rol8 \n\t" + "add, %0 \n\t" + "loadacc, (%1+) \n\t" + "rol8 \n\t" + "add, %0 \n\t" + "loadacc, (%1+) \n\t" + "add, %0 \n\t" + : "=r"(v), "+a"(p)); + return v; +} + +#define AV_WB32 AV_WB32 +static av_always_inline void AV_WB32(void *p, uint32_t v) +{ + __asm__ volatile ("loadacc, #4 \n\t" + "add, %0 \n\t" + "loadacc, %1 \n\t" + "storeacc, (-%0) \n\t" + "lsr8 \n\t" + "storeacc, (-%0) \n\t" + "lsr8 \n\t" + "storeacc, (-%0) \n\t" + "lsr8 \n\t" + "storeacc, (-%0) \n\t" + : "+&a"(p) : "r"(v)); +} + +#define AV_RL32 AV_RL32 +static av_always_inline uint32_t AV_RL32(const void *p) +{ + uint32_t v; + __asm__ ("loadacc, (%1+) \n\t" + "storeacc, %0 \n\t" + "loadacc, (%1+) \n\t" + "rol8 \n\t" + "add, %0 \n\t" + "loadacc, (%1+) \n\t" + "rol8 \n\t" + "rol8 \n\t" + "add, %0 \n\t" + "loadacc, (%1+) \n\t" + "rol8 \n\t" + "rol8 \n\t" + "rol8 \n\t" + "add, %0 \n\t" + : "=r"(v), "+a"(p)); + return v; +} + +#define AV_WL32 AV_WL32 +static av_always_inline void AV_WL32(void *p, uint32_t v) +{ + __asm__ volatile ("loadacc, %1 \n\t" + "storeacc, (%0+) \n\t" + "lsr8 \n\t" + "storeacc, (%0+) \n\t" + "lsr8 \n\t" + "storeacc, (%0+) \n\t" + "lsr8 \n\t" + "storeacc, (%0+) \n\t" + : "+&a"(p) : "r"(v)); +} + +#endif /* AVUTIL_TOMI_INTREADWRITE_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/x86/cpu.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/x86/cpu.c new file mode 100644 index 00000000..4b6cb0df --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/x86/cpu.c @@ -0,0 +1,124 @@ +/* + * CPU detection code, extracted from mmx.h + * (c)1997-99 by H. Dietz and R. Fisher + * Converted to C and improved by Fabrice Bellard. + * + * 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 + */ + +#include +#include +#include "libavutil/x86_cpu.h" +#include "libavutil/cpu.h" + +/* ebx saving is necessary for PIC. gcc seems unable to see it alone */ +#define cpuid(index,eax,ebx,ecx,edx)\ + __asm__ volatile\ + ("mov %%"REG_b", %%"REG_S"\n\t"\ + "cpuid\n\t"\ + "xchg %%"REG_b", %%"REG_S\ + : "=a" (eax), "=S" (ebx),\ + "=c" (ecx), "=d" (edx)\ + : "0" (index)); + +/* Function to test if multimedia instructions are supported... */ +int ff_get_cpu_flags_x86(void) +{ + int rval = 0; + int eax, ebx, ecx, edx; + int max_std_level, max_ext_level, std_caps=0, ext_caps=0; + int family=0, model=0; + union { int i[3]; char c[12]; } vendor; + +#if ARCH_X86_32 + x86_reg a, c; + __asm__ volatile ( + /* See if CPUID instruction is supported ... */ + /* ... Get copies of EFLAGS into eax and ecx */ + "pushfl\n\t" + "pop %0\n\t" + "mov %0, %1\n\t" + + /* ... Toggle the ID bit in one copy and store */ + /* to the EFLAGS reg */ + "xor $0x200000, %0\n\t" + "push %0\n\t" + "popfl\n\t" + + /* ... Get the (hopefully modified) EFLAGS */ + "pushfl\n\t" + "pop %0\n\t" + : "=a" (a), "=c" (c) + : + : "cc" + ); + + if (a == c) + return 0; /* CPUID not supported */ +#endif + + cpuid(0, max_std_level, vendor.i[0], vendor.i[2], vendor.i[1]); + + if(max_std_level >= 1){ + cpuid(1, eax, ebx, ecx, std_caps); + family = ((eax>>8)&0xf) + ((eax>>20)&0xff); + model = ((eax>>4)&0xf) + ((eax>>12)&0xf0); + if (std_caps & (1<<23)) + rval |= AV_CPU_FLAG_MMX; + if (std_caps & (1<<25)) + rval |= AV_CPU_FLAG_MMX2 +#if HAVE_SSE + | AV_CPU_FLAG_SSE; + if (std_caps & (1<<26)) + rval |= AV_CPU_FLAG_SSE2; + if (ecx & 1) + rval |= AV_CPU_FLAG_SSE3; + if (ecx & 0x00000200 ) + rval |= AV_CPU_FLAG_SSSE3; + if (ecx & 0x00080000 ) + rval |= AV_CPU_FLAG_SSE4; + if (ecx & 0x00100000 ) + rval |= AV_CPU_FLAG_SSE42; +#endif + ; + } + + cpuid(0x80000000, max_ext_level, ebx, ecx, edx); + + if(max_ext_level >= 0x80000001){ + cpuid(0x80000001, eax, ebx, ecx, ext_caps); + if (ext_caps & (1<<31)) + rval |= AV_CPU_FLAG_3DNOW; + if (ext_caps & (1<<30)) + rval |= AV_CPU_FLAG_3DNOWEXT; + if (ext_caps & (1<<23)) + rval |= AV_CPU_FLAG_MMX; + if (ext_caps & (1<<22)) + rval |= AV_CPU_FLAG_MMX2; + } + + if (!strncmp(vendor.c, "GenuineIntel", 12) && + family == 6 && (model == 9 || model == 13 || model == 14)) { + /* 6/9 (pentium-m "banias"), 6/13 (pentium-m "dothan"), and 6/14 (core1 "yonah") + * theoretically support sse2, but it's usually slower than mmx, + * so let's just pretend they don't. */ + if (rval & AV_CPU_FLAG_SSE2) rval ^= AV_CPU_FLAG_SSE2SLOW|AV_CPU_FLAG_SSE2; + if (rval & AV_CPU_FLAG_SSE3) rval ^= AV_CPU_FLAG_SSE3SLOW|AV_CPU_FLAG_SSE3; + } + + return rval; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/x86/intmath.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/x86/intmath.h new file mode 100644 index 00000000..f3acddc0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/x86/intmath.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 + */ + +#ifndef AVUTIL_X86_INTMATH_H +#define AVUTIL_X86_INTMATH_H + +#define FASTDIV(a,b) \ + ({\ + int ret, dmy;\ + __asm__ volatile(\ + "mull %3"\ + :"=d"(ret), "=a"(dmy)\ + :"1"(a), "g"(ff_inverse[b])\ + );\ + ret;\ + }) + +#endif /* AVUTIL_X86_INTMATH_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/x86/intreadwrite.h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/x86/intreadwrite.h new file mode 100644 index 00000000..4061d192 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavutil/x86/intreadwrite.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2010 Alexander Strange + * + * 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 + */ + +#ifndef AVUTIL_X86_INTREADWRITE_H +#define AVUTIL_X86_INTREADWRITE_H + +#include +#include "config.h" +#include "libavutil/attributes.h" + +#if HAVE_MMX + +#if !HAVE_FAST_64BIT && defined(__MMX__) + +#define AV_COPY64 AV_COPY64 +static av_always_inline void AV_COPY64(void *d, const void *s) +{ + __asm__("movq %1, %%mm0 \n\t" + "movq %%mm0, %0 \n\t" + : "=m"(*(uint64_t*)d) + : "m" (*(const uint64_t*)s) + : "mm0"); +} + +#define AV_SWAP64 AV_SWAP64 +static av_always_inline void AV_SWAP64(void *a, void *b) +{ + __asm__("movq %1, %%mm0 \n\t" + "movq %0, %%mm1 \n\t" + "movq %%mm0, %0 \n\t" + "movq %%mm1, %1 \n\t" + : "+m"(*(uint64_t*)a), "+m"(*(uint64_t*)b) + ::"mm0", "mm1"); +} + +#define AV_ZERO64 AV_ZERO64 +static av_always_inline void AV_ZERO64(void *d) +{ + __asm__("pxor %%mm0, %%mm0 \n\t" + "movq %%mm0, %0 \n\t" + : "=m"(*(uint64_t*)d) + :: "mm0"); +} + +#endif /* !HAVE_FAST_64BIT && defined(__MMX__) */ + +#ifdef __SSE__ + +#define AV_COPY128 AV_COPY128 +static av_always_inline void AV_COPY128(void *d, const void *s) +{ + struct v {uint64_t v[2];}; + + __asm__("movaps %1, %%xmm0 \n\t" + "movaps %%xmm0, %0 \n\t" + : "=m"(*(struct v*)d) + : "m" (*(const struct v*)s) + : "xmm0"); +} + +#endif /* __SSE__ */ + +#ifdef __SSE2__ + +#define AV_ZERO128 AV_ZERO128 +static av_always_inline void AV_ZERO128(void *d) +{ + struct v {uint64_t v[2];}; + + __asm__("pxor %%xmm0, %%xmm0 \n\t" + "movdqa %%xmm0, %0 \n\t" + : "=m"(*(struct v*)d) + :: "xmm0"); +} + +#endif /* __SSE2__ */ + +#endif /* HAVE_MMX */ + +#endif /* AVUTIL_X86_INTREADWRITE_H */ diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale-test.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale-test.c new file mode 100644 index 00000000..ae5f8b70 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libswscale/swscale-test.c @@ -0,0 +1,415 @@ +/* + * Copyright (C) 2003 Michael Niedermayer + * + * 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 + */ + +#include +#include +#include +#include +#include + +#undef HAVE_AV_CONFIG_H +#include "libavcore/imgutils.h" +#include "libavutil/mem.h" +#include "libavutil/avutil.h" +#include "libavutil/crc.h" +#include "libavutil/pixdesc.h" +#include "libavutil/lfg.h" +#include "swscale.h" + +/* HACK Duplicated from swscale_internal.h. + * Should be removed when a cleaner pixel format system exists. */ +#define isGray(x) ( \ + (x)==PIX_FMT_GRAY8 \ + || (x)==PIX_FMT_GRAY16BE \ + || (x)==PIX_FMT_GRAY16LE \ + ) +#define hasChroma(x) (!( \ + isGray(x) \ + || (x)==PIX_FMT_MONOBLACK \ + || (x)==PIX_FMT_MONOWHITE \ + )) +#define isALPHA(x) ( \ + (x)==PIX_FMT_BGR32 \ + || (x)==PIX_FMT_BGR32_1 \ + || (x)==PIX_FMT_RGB32 \ + || (x)==PIX_FMT_RGB32_1 \ + || (x)==PIX_FMT_YUVA420P \ + ) + +static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1, int stride2, int w, int h) +{ + int x,y; + uint64_t ssd=0; + +//printf("%d %d\n", w, h); + + for (y=0; y src -> dst -> out & compare out against ref +// ref & out are YV12 +static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, + enum PixelFormat srcFormat, enum PixelFormat dstFormat, + int srcW, int srcH, int dstW, int dstH, int flags, + struct Results *r) +{ + static enum PixelFormat cur_srcFormat; + static int cur_srcW, cur_srcH; + static uint8_t *src[4]; + static int srcStride[4]; + uint8_t *dst[4] = {0}; + uint8_t *out[4] = {0}; + int dstStride[4]; + int i; + uint64_t ssdY, ssdU=0, ssdV=0, ssdA=0; + struct SwsContext *dstContext = NULL, *outContext = NULL; + uint32_t crc = 0; + int res = 0; + + if (cur_srcFormat != srcFormat || cur_srcW != srcW || cur_srcH != srcH) { + struct SwsContext *srcContext = NULL; + int p; + + for (p = 0; p < 4; p++) + if (src[p]) + av_freep(&src[p]); + + av_image_fill_linesizes(srcStride, srcFormat, srcW); + for (p = 0; p < 4; p++) { + if (srcStride[p]) + src[p] = av_mallocz(srcStride[p]*srcH+16); + if (srcStride[p] && !src[p]) { + perror("Malloc"); + res = -1; + + goto end; + } + } + srcContext = sws_getContext(w, h, PIX_FMT_YUVA420P, srcW, srcH, + srcFormat, SWS_BILINEAR, NULL, NULL, NULL); + if (!srcContext) { + fprintf(stderr, "Failed to get %s ---> %s\n", + av_pix_fmt_descriptors[PIX_FMT_YUVA420P].name, + av_pix_fmt_descriptors[srcFormat].name); + res = -1; + + goto end; + } + sws_scale(srcContext, ref, refStride, 0, h, src, srcStride); + sws_freeContext(srcContext); + + cur_srcFormat = srcFormat; + cur_srcW = srcW; + cur_srcH = srcH; + } + + av_image_fill_linesizes(dstStride, dstFormat, dstW); + for (i=0; i<4; i++) { + /* Image buffers passed into libswscale can be allocated any way you + * prefer, as long as they're aligned enough for the architecture, and + * they're freed appropriately (such as using av_free for buffers + * allocated with av_malloc). */ + /* An extra 16 bytes is being allocated because some scalers may write + * out of bounds. */ + if (dstStride[i]) + dst[i]= av_mallocz(dstStride[i]*dstH+16); + if (dstStride[i] && !dst[i]) { + perror("Malloc"); + res = -1; + + goto end; + } + } + + dstContext= sws_getContext(srcW, srcH, srcFormat, dstW, dstH, dstFormat, flags, NULL, NULL, NULL); + if (!dstContext) { + fprintf(stderr, "Failed to get %s ---> %s\n", + av_pix_fmt_descriptors[srcFormat].name, + av_pix_fmt_descriptors[dstFormat].name); + res = -1; + + goto end; + } +// printf("test %X %X %X -> %X %X %X\n", (int)ref[0], (int)ref[1], (int)ref[2], +// (int)src[0], (int)src[1], (int)src[2]); + + printf(" %s %dx%d -> %s %3dx%3d flags=%2d", + av_pix_fmt_descriptors[srcFormat].name, srcW, srcH, + av_pix_fmt_descriptors[dstFormat].name, dstW, dstH, + flags); + fflush(stdout); + + sws_scale(dstContext, src, srcStride, 0, srcH, dst, dstStride); + + for (i = 0; i < 4 && dstStride[i]; i++) { + crc = av_crc(av_crc_get_table(AV_CRC_32_IEEE), crc, dst[i], dstStride[i] * dstH); + } + + if (r && crc == r->crc) { + ssdY = r->ssdY; + ssdU = r->ssdU; + ssdV = r->ssdV; + ssdA = r->ssdA; + } else { + for (i=0; i<4; i++) { + if (refStride[i]) + out[i]= av_mallocz(refStride[i]*h); + if (refStride[i] && !out[i]) { + perror("Malloc"); + res = -1; + + goto end; + } + } + outContext= sws_getContext(dstW, dstH, dstFormat, w, h, PIX_FMT_YUVA420P, SWS_BILINEAR, NULL, NULL, NULL); + if (!outContext) { + fprintf(stderr, "Failed to get %s ---> %s\n", + av_pix_fmt_descriptors[dstFormat].name, + av_pix_fmt_descriptors[PIX_FMT_YUVA420P].name); + res = -1; + + goto end; + } + sws_scale(outContext, dst, dstStride, 0, dstH, out, refStride); + + ssdY= getSSD(ref[0], out[0], refStride[0], refStride[0], w, h); + if (hasChroma(srcFormat) && hasChroma(dstFormat)) { + //FIXME check that output is really gray + ssdU= getSSD(ref[1], out[1], refStride[1], refStride[1], (w+1)>>1, (h+1)>>1); + ssdV= getSSD(ref[2], out[2], refStride[2], refStride[2], (w+1)>>1, (h+1)>>1); + } + if (isALPHA(srcFormat) && isALPHA(dstFormat)) + ssdA= getSSD(ref[3], out[3], refStride[3], refStride[3], w, h); + + ssdY/= w*h; + ssdU/= w*h/4; + ssdV/= w*h/4; + ssdA/= w*h; + + sws_freeContext(outContext); + + for (i=0; i<4; i++) { + if (refStride[i]) + av_free(out[i]); + } + } + + printf(" CRC=%08x SSD=%5"PRId64",%5"PRId64",%5"PRId64",%5"PRId64"\n", + crc, ssdY, ssdU, ssdV, ssdA); + +end: + + sws_freeContext(dstContext); + + for (i=0; i<4; i++) { + if (dstStride[i]) + av_free(dst[i]); + } + + return res; +} + +static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h, + enum PixelFormat srcFormat_in, + enum PixelFormat dstFormat_in) +{ + const int flags[] = { SWS_FAST_BILINEAR, + SWS_BILINEAR, SWS_BICUBIC, + SWS_X , SWS_POINT , SWS_AREA, 0 }; + const int srcW = w; + const int srcH = h; + const int dstW[] = { srcW - srcW/3, srcW, srcW + srcW/3, 0 }; + const int dstH[] = { srcH - srcH/3, srcH, srcH + srcH/3, 0 }; + enum PixelFormat srcFormat, dstFormat; + + for (srcFormat = srcFormat_in != PIX_FMT_NONE ? srcFormat_in : 0; + srcFormat < PIX_FMT_NB; srcFormat++) { + if (!sws_isSupportedInput(srcFormat) || !sws_isSupportedOutput(srcFormat)) + continue; + + for (dstFormat = dstFormat_in != PIX_FMT_NONE ? dstFormat_in : 0; + dstFormat < PIX_FMT_NB; dstFormat++) { + int i, j, k; + int res = 0; + + if (!sws_isSupportedInput(dstFormat) || !sws_isSupportedOutput(dstFormat)) + continue; + + printf("%s -> %s\n", + av_pix_fmt_descriptors[srcFormat].name, + av_pix_fmt_descriptors[dstFormat].name); + fflush(stdout); + + for (k = 0; flags[k] && !res; k++) { + for (i = 0; dstW[i] && !res; i++) + for (j = 0; dstH[j] && !res; j++) + res = doTest(ref, refStride, w, h, + srcFormat, dstFormat, + srcW, srcH, dstW[i], dstH[j], flags[k], + NULL); + } + if (dstFormat_in != PIX_FMT_NONE) + break; + } + if (srcFormat_in != PIX_FMT_NONE) + break; + } +} + +static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp, + enum PixelFormat srcFormat_in, + enum PixelFormat dstFormat_in) +{ + char buf[256]; + + while (fgets(buf, sizeof(buf), fp)) { + struct Results r; + enum PixelFormat srcFormat; + char srcStr[12]; + int srcW, srcH; + enum PixelFormat dstFormat; + char dstStr[12]; + int dstW, dstH; + int flags; + int ret; + + ret = sscanf(buf, " %12s %dx%d -> %12s %dx%d flags=%d CRC=%x" + " SSD=%"PRId64", %"PRId64", %"PRId64", %"PRId64"\n", + srcStr, &srcW, &srcH, dstStr, &dstW, &dstH, + &flags, &r.crc, &r.ssdY, &r.ssdU, &r.ssdV, &r.ssdA); + if (ret != 12) { + srcStr[0] = dstStr[0] = 0; + ret = sscanf(buf, "%12s -> %12s\n", srcStr, dstStr); + } + + srcFormat = av_get_pix_fmt(srcStr); + dstFormat = av_get_pix_fmt(dstStr); + + if (srcFormat == PIX_FMT_NONE || dstFormat == PIX_FMT_NONE) { + fprintf(stderr, "malformed input file\n"); + return -1; + } + if ((srcFormat_in != PIX_FMT_NONE && srcFormat_in != srcFormat) || + (dstFormat_in != PIX_FMT_NONE && dstFormat_in != dstFormat)) + continue; + if (ret != 12) { + printf("%s", buf); + continue; + } + + doTest(ref, refStride, w, h, + srcFormat, dstFormat, + srcW, srcH, dstW, dstH, flags, + &r); + } + + return 0; +} + +#define W 96 +#define H 96 + +int main(int argc, char **argv) +{ + enum PixelFormat srcFormat = PIX_FMT_NONE; + enum PixelFormat dstFormat = PIX_FMT_NONE; + uint8_t *rgb_data = av_malloc (W*H*4); + uint8_t *rgb_src[3]= {rgb_data, NULL, NULL}; + int rgb_stride[3]={4*W, 0, 0}; + uint8_t *data = av_malloc (4*W*H); + uint8_t *src[4]= {data, data+W*H, data+W*H*2, data+W*H*3}; + int stride[4]={W, W, W, W}; + int x, y; + struct SwsContext *sws; + AVLFG rand; + int res = -1; + int i; + + if (!rgb_data || !data) + return -1; + + sws= sws_getContext(W/12, H/12, PIX_FMT_RGB32, W, H, PIX_FMT_YUVA420P, SWS_BILINEAR, NULL, NULL, NULL); + + av_lfg_init(&rand, 1); + + for (y=0; y + * + * 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 + */ + +#define _SVID_SOURCE //needed for MAP_ANONYMOUS +#define _DARWIN_C_SOURCE // needed for MAP_ANON +#include +#include +#include +#include +#include "config.h" +#include +#if HAVE_SYS_MMAN_H +#include +#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS) +#define MAP_ANONYMOUS MAP_ANON +#endif +#endif +#if HAVE_VIRTUALALLOC +#define WIN32_LEAN_AND_MEAN +#include +#endif +#include "swscale.h" +#include "swscale_internal.h" +#include "rgb2rgb.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/x86_cpu.h" +#include "libavutil/avutil.h" +#include "libavutil/bswap.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" + +unsigned swscale_version(void) +{ + return LIBSWSCALE_VERSION_INT; +} + +const char *swscale_configuration(void) +{ + return FFMPEG_CONFIGURATION; +} + +const char *swscale_license(void) +{ +#define LICENSE_PREFIX "libswscale license: " + return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; +} + +#define RET 0xC3 //near return opcode for x86 + +#define isSupportedIn(x) ( \ + (x)==PIX_FMT_YUV420P \ + || (x)==PIX_FMT_YUVA420P \ + || (x)==PIX_FMT_YUYV422 \ + || (x)==PIX_FMT_UYVY422 \ + || (x)==PIX_FMT_RGB48BE \ + || (x)==PIX_FMT_RGB48LE \ + || (x)==PIX_FMT_RGB32 \ + || (x)==PIX_FMT_RGB32_1 \ + || (x)==PIX_FMT_BGR24 \ + || (x)==PIX_FMT_BGR565 \ + || (x)==PIX_FMT_BGR555 \ + || (x)==PIX_FMT_BGR32 \ + || (x)==PIX_FMT_BGR32_1 \ + || (x)==PIX_FMT_RGB24 \ + || (x)==PIX_FMT_RGB565 \ + || (x)==PIX_FMT_RGB555 \ + || (x)==PIX_FMT_GRAY8 \ + || (x)==PIX_FMT_Y400A \ + || (x)==PIX_FMT_YUV410P \ + || (x)==PIX_FMT_YUV440P \ + || (x)==PIX_FMT_NV12 \ + || (x)==PIX_FMT_NV21 \ + || (x)==PIX_FMT_GRAY16BE \ + || (x)==PIX_FMT_GRAY16LE \ + || (x)==PIX_FMT_YUV444P \ + || (x)==PIX_FMT_YUV422P \ + || (x)==PIX_FMT_YUV411P \ + || (x)==PIX_FMT_YUVJ420P \ + || (x)==PIX_FMT_YUVJ422P \ + || (x)==PIX_FMT_YUVJ440P \ + || (x)==PIX_FMT_YUVJ444P \ + || (x)==PIX_FMT_PAL8 \ + || (x)==PIX_FMT_BGR8 \ + || (x)==PIX_FMT_RGB8 \ + || (x)==PIX_FMT_BGR4_BYTE \ + || (x)==PIX_FMT_RGB4_BYTE \ + || (x)==PIX_FMT_YUV440P \ + || (x)==PIX_FMT_MONOWHITE \ + || (x)==PIX_FMT_MONOBLACK \ + || (x)==PIX_FMT_YUV420P16LE \ + || (x)==PIX_FMT_YUV422P16LE \ + || (x)==PIX_FMT_YUV444P16LE \ + || (x)==PIX_FMT_YUV420P16BE \ + || (x)==PIX_FMT_YUV422P16BE \ + || (x)==PIX_FMT_YUV444P16BE \ + ) + +int sws_isSupportedInput(enum PixelFormat pix_fmt) +{ + return isSupportedIn(pix_fmt); +} + +#define isSupportedOut(x) ( \ + (x)==PIX_FMT_YUV420P \ + || (x)==PIX_FMT_YUVA420P \ + || (x)==PIX_FMT_YUYV422 \ + || (x)==PIX_FMT_UYVY422 \ + || (x)==PIX_FMT_YUV444P \ + || (x)==PIX_FMT_YUV422P \ + || (x)==PIX_FMT_YUV411P \ + || (x)==PIX_FMT_YUVJ420P \ + || (x)==PIX_FMT_YUVJ422P \ + || (x)==PIX_FMT_YUVJ440P \ + || (x)==PIX_FMT_YUVJ444P \ + || isAnyRGB(x) \ + || (x)==PIX_FMT_NV12 \ + || (x)==PIX_FMT_NV21 \ + || (x)==PIX_FMT_GRAY16BE \ + || (x)==PIX_FMT_GRAY16LE \ + || (x)==PIX_FMT_GRAY8 \ + || (x)==PIX_FMT_YUV410P \ + || (x)==PIX_FMT_YUV440P \ + || (x)==PIX_FMT_YUV420P16LE \ + || (x)==PIX_FMT_YUV422P16LE \ + || (x)==PIX_FMT_YUV444P16LE \ + || (x)==PIX_FMT_YUV420P16BE \ + || (x)==PIX_FMT_YUV422P16BE \ + || (x)==PIX_FMT_YUV444P16BE \ + ) + +int sws_isSupportedOutput(enum PixelFormat pix_fmt) +{ + return isSupportedOut(pix_fmt); +} + +extern const int32_t ff_yuv2rgb_coeffs[8][4]; + +const char *sws_format_name(enum PixelFormat format) +{ + if ((unsigned)format < PIX_FMT_NB && av_pix_fmt_descriptors[format].name) + return av_pix_fmt_descriptors[format].name; + else + return "Unknown format"; +} + +static double getSplineCoeff(double a, double b, double c, double d, double dist) +{ +// printf("%f %f %f %f %f\n", a,b,c,d,dist); + if (dist<=1.0) return ((d*dist + c)*dist + b)*dist +a; + else return getSplineCoeff( 0.0, + b+ 2.0*c + 3.0*d, + c + 3.0*d, + -b- 3.0*c - 6.0*d, + dist-1.0); +} + +static int initFilter(int16_t **outFilter, int16_t **filterPos, int *outFilterSize, int xInc, + int srcW, int dstW, int filterAlign, int one, int flags, + SwsVector *srcFilter, SwsVector *dstFilter, double param[2]) +{ + int i; + int filterSize; + int filter2Size; + int minFilterSize; + int64_t *filter=NULL; + int64_t *filter2=NULL; + const int64_t fone= 1LL<<54; + int ret= -1; +#if ARCH_X86 + if (flags & SWS_CPU_CAPS_MMX) + __asm__ volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions) +#endif + + // NOTE: the +1 is for the MMX scaler which reads over the end + FF_ALLOC_OR_GOTO(NULL, *filterPos, (dstW+1)*sizeof(int16_t), fail); + + if (FFABS(xInc - 0x10000) <10) { // unscaled + int i; + filterSize= 1; + FF_ALLOCZ_OR_GOTO(NULL, filter, dstW*sizeof(*filter)*filterSize, fail); + + for (i=0; i>16; + + (*filterPos)[i]= xx; + filter[i]= fone; + xDstInSrc+= xInc; + } + } else if ((xInc <= (1<<16) && (flags&SWS_AREA)) || (flags&SWS_FAST_BILINEAR)) { // bilinear upscale + int i; + int xDstInSrc; + filterSize= 2; + FF_ALLOC_OR_GOTO(NULL, filter, dstW*sizeof(*filter)*filterSize, fail); + + xDstInSrc= xInc/2 - 0x8000; + for (i=0; i>16; + int j; + + (*filterPos)[i]= xx; + //bilinear upscale / linear interpolate / area averaging + for (j=0; j>16); + if (coeff<0) coeff=0; + filter[i*filterSize + j]= coeff; + xx++; + } + xDstInSrc+= xInc; + } + } else { + int xDstInSrc; + int sizeFactor; + + if (flags&SWS_BICUBIC) sizeFactor= 4; + else if (flags&SWS_X) sizeFactor= 8; + else if (flags&SWS_AREA) sizeFactor= 1; //downscale only, for upscale it is bilinear + else if (flags&SWS_GAUSS) sizeFactor= 8; // infinite ;) + else if (flags&SWS_LANCZOS) sizeFactor= param[0] != SWS_PARAM_DEFAULT ? ceil(2*param[0]) : 6; + else if (flags&SWS_SINC) sizeFactor= 20; // infinite ;) + else if (flags&SWS_SPLINE) sizeFactor= 20; // infinite ;) + else if (flags&SWS_BILINEAR) sizeFactor= 2; + else { + sizeFactor= 0; //GCC warning killer + assert(0); + } + + if (xInc <= 1<<16) filterSize= 1 + sizeFactor; // upscale + else filterSize= 1 + (sizeFactor*srcW + dstW - 1)/ dstW; + + if (filterSize > srcW-2) filterSize=srcW-2; + + FF_ALLOC_OR_GOTO(NULL, filter, dstW*sizeof(*filter)*filterSize, fail); + + xDstInSrc= xInc - 0x10000; + for (i=0; i 1<<16) + d= d*dstW/srcW; + floatd= d * (1.0/(1<<30)); + + if (flags & SWS_BICUBIC) { + int64_t B= (param[0] != SWS_PARAM_DEFAULT ? param[0] : 0) * (1<<24); + int64_t C= (param[1] != SWS_PARAM_DEFAULT ? param[1] : 0.6) * (1<<24); + int64_t dd = ( d*d)>>30; + int64_t ddd= (dd*d)>>30; + + if (d < 1LL<<30) + coeff = (12*(1<<24)-9*B-6*C)*ddd + (-18*(1<<24)+12*B+6*C)*dd + (6*(1<<24)-2*B)*(1<<30); + else if (d < 1LL<<31) + coeff = (-B-6*C)*ddd + (6*B+30*C)*dd + (-12*B-48*C)*d + (8*B+24*C)*(1<<30); + else + coeff=0.0; + coeff *= fone>>(30+24); + } +/* else if (flags & SWS_X) { + double p= param ? param*0.01 : 0.3; + coeff = d ? sin(d*M_PI)/(d*M_PI) : 1.0; + coeff*= pow(2.0, - p*d*d); + }*/ + else if (flags & SWS_X) { + double A= param[0] != SWS_PARAM_DEFAULT ? param[0] : 1.0; + double c; + + if (floatd<1.0) + c = cos(floatd*M_PI); + else + c=-1.0; + if (c<0.0) c= -pow(-c, A); + else c= pow( c, A); + coeff= (c*0.5 + 0.5)*fone; + } else if (flags & SWS_AREA) { + int64_t d2= d - (1<<29); + if (d2*xInc < -(1LL<<(29+16))) coeff= 1.0 * (1LL<<(30+16)); + else if (d2*xInc < (1LL<<(29+16))) coeff= -d2*xInc + (1LL<<(29+16)); + else coeff=0.0; + coeff *= fone>>(30+16); + } else if (flags & SWS_GAUSS) { + double p= param[0] != SWS_PARAM_DEFAULT ? param[0] : 3.0; + coeff = (pow(2.0, - p*floatd*floatd))*fone; + } else if (flags & SWS_SINC) { + coeff = (d ? sin(floatd*M_PI)/(floatd*M_PI) : 1.0)*fone; + } else if (flags & SWS_LANCZOS) { + double p= param[0] != SWS_PARAM_DEFAULT ? param[0] : 3.0; + coeff = (d ? sin(floatd*M_PI)*sin(floatd*M_PI/p)/(floatd*floatd*M_PI*M_PI/p) : 1.0)*fone; + if (floatd>p) coeff=0; + } else if (flags & SWS_BILINEAR) { + coeff= (1<<30) - d; + if (coeff<0) coeff=0; + coeff *= fone >> 30; + } else if (flags & SWS_SPLINE) { + double p=-2.196152422706632; + coeff = getSplineCoeff(1.0, 0.0, p, -p-1.0, floatd) * fone; + } else { + coeff= 0.0; //GCC warning killer + assert(0); + } + + filter[i*filterSize + j]= coeff; + xx++; + } + xDstInSrc+= 2*xInc; + } + } + + /* apply src & dst Filter to filter -> filter2 + av_free(filter); + */ + assert(filterSize>0); + filter2Size= filterSize; + if (srcFilter) filter2Size+= srcFilter->length - 1; + if (dstFilter) filter2Size+= dstFilter->length - 1; + assert(filter2Size>0); + FF_ALLOCZ_OR_GOTO(NULL, filter2, filter2Size*dstW*sizeof(*filter2), fail); + + for (i=0; ilength; k++) { + for (j=0; jcoeff[k]*filter[i*filterSize + j]; + } + } else { + for (j=0; j=0; i--) { + int min= filter2Size; + int j; + int64_t cutOff=0.0; + + /* get rid of near zero elements on the left by shifting left */ + for (j=0; j SWS_MAX_REDUCE_CUTOFF*fone) break; + + /* preserve monotonicity because the core can't handle the filter otherwise */ + if (i= (*filterPos)[i+1]) break; + + // move filter coefficients left + for (k=1; k0; j--) { + cutOff += FFABS(filter2[i*filter2Size + j]); + + if (cutOff > SWS_MAX_REDUCE_CUTOFF*fone) break; + min--; + } + + if (min>minFilterSize) minFilterSize= min; + } + + if (flags & SWS_CPU_CAPS_ALTIVEC) { + // we can handle the special case 4, + // so we don't want to go to the full 8 + if (minFilterSize < 5) + filterAlign = 4; + + // We really don't want to waste our time + // doing useless computation, so fall back on + // the scalar C code for very small filters. + // Vectorizing is worth it only if you have a + // decent-sized vector. + if (minFilterSize < 3) + filterAlign = 1; + } + + if (flags & SWS_CPU_CAPS_MMX) { + // special case for unscaled vertical filtering + if (minFilterSize == 1 && filterAlign == 2) + filterAlign= 1; + } + + assert(minFilterSize > 0); + filterSize= (minFilterSize +(filterAlign-1)) & (~(filterAlign-1)); + assert(filterSize > 0); + filter= av_malloc(filterSize*dstW*sizeof(*filter)); + if (filterSize >= MAX_FILTER_SIZE*16/((flags&SWS_ACCURATE_RND) ? APCK_SIZE : 16) || !filter) + goto fail; + *outFilterSize= filterSize; + + if (flags&SWS_PRINT_INFO) + av_log(NULL, AV_LOG_VERBOSE, "SwScaler: reducing / aligning filtersize %d -> %d\n", filter2Size, filterSize); + /* try to reduce the filter-size (step2 reduce it) */ + for (i=0; i=filter2Size) filter[i*filterSize + j]= 0; + else filter[i*filterSize + j]= filter2[i*filter2Size + j]; + if((flags & SWS_BITEXACT) && j>=minFilterSize) + filter[i*filterSize + j]= 0; + } + } + + //FIXME try to align filterPos if possible + + //fix borders + for (i=0; i srcW) { + int shift= (*filterPos)[i] + filterSize - srcW; + // move filter coefficients right to compensate for filterPos + for (j=filterSize-2; j>=0; j--) { + int right= FFMIN(j + shift, filterSize-1); + filter[i*filterSize +right] += filter[i*filterSize +j]; + filter[i*filterSize +j]=0; + } + (*filterPos)[i]= srcW - filterSize; + } + } + + // Note the +1 is for the MMX scaler which reads over the end + /* align at 16 for AltiVec (needed by hScale_altivec_real) */ + FF_ALLOCZ_OR_GOTO(NULL, *outFilter, *outFilterSize*(dstW+1)*sizeof(int16_t), fail); + + /* normalize & store in outFilter */ + for (i=0; i>16; + + if ((i&3) == 0) { + int a=0; + int b=((xpos+xInc)>>16) - xx; + int c=((xpos+xInc*2)>>16) - xx; + int d=((xpos+xInc*3)>>16) - xx; + int inc = (d+1<4); + uint8_t *fragment = (d+1<4) ? fragmentB : fragmentA; + x86_reg imm8OfPShufW1 = (d+1<4) ? imm8OfPShufW1B : imm8OfPShufW1A; + x86_reg imm8OfPShufW2 = (d+1<4) ? imm8OfPShufW2B : imm8OfPShufW2A; + x86_reg fragmentLength = (d+1<4) ? fragmentLengthB : fragmentLengthA; + int maxShift= 3-(d+inc); + int shift=0; + + if (filterCode) { + filter[i ] = (( xpos & 0xFFFF) ^ 0xFFFF)>>9; + filter[i+1] = (((xpos+xInc ) & 0xFFFF) ^ 0xFFFF)>>9; + filter[i+2] = (((xpos+xInc*2) & 0xFFFF) ^ 0xFFFF)>>9; + filter[i+3] = (((xpos+xInc*3) & 0xFFFF) ^ 0xFFFF)>>9; + filterPos[i/2]= xx; + + memcpy(filterCode + fragmentPos, fragment, fragmentLength); + + filterCode[fragmentPos + imm8OfPShufW1]= + (a+inc) | ((b+inc)<<2) | ((c+inc)<<4) | ((d+inc)<<6); + filterCode[fragmentPos + imm8OfPShufW2]= + a | (b<<2) | (c<<4) | (d<<6); + + if (i+4-inc>=dstW) shift=maxShift; //avoid overread + else if ((filterPos[i/2]&3) <= maxShift) shift=filterPos[i/2]&3; //Align + + if (shift && i>=shift) { + filterCode[fragmentPos + imm8OfPShufW1]+= 0x55*shift; + filterCode[fragmentPos + imm8OfPShufW2]+= 0x55*shift; + filterPos[i/2]-=shift; + } + } + + fragmentPos+= fragmentLength; + + if (filterCode) + filterCode[fragmentPos]= RET; + } + xpos+=xInc; + } + if (filterCode) + filterPos[((i/2)+1)&(~1)]= xpos>>16; // needed to jump to the next part + + return fragmentPos + 1; +} +#endif /* ARCH_X86 && (HAVE_MMX2 || CONFIG_RUNTIME_CPUDETECT) */ + +static void getSubSampleFactors(int *h, int *v, enum PixelFormat format) +{ + *h = av_pix_fmt_descriptors[format].log2_chroma_w; + *v = av_pix_fmt_descriptors[format].log2_chroma_h; +} + +static int update_flags_cpu(int flags); + +int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation) +{ + memcpy(c->srcColorspaceTable, inv_table, sizeof(int)*4); + memcpy(c->dstColorspaceTable, table, sizeof(int)*4); + + c->brightness= brightness; + c->contrast = contrast; + c->saturation= saturation; + c->srcRange = srcRange; + c->dstRange = dstRange; + if (isYUV(c->dstFormat) || isGray(c->dstFormat)) return -1; + + c->dstFormatBpp = av_get_bits_per_pixel(&av_pix_fmt_descriptors[c->dstFormat]); + c->srcFormatBpp = av_get_bits_per_pixel(&av_pix_fmt_descriptors[c->srcFormat]); + c->flags = update_flags_cpu(c->flags); + + ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness, contrast, saturation); + //FIXME factorize + +#if HAVE_ALTIVEC + if (c->flags & SWS_CPU_CAPS_ALTIVEC) + ff_yuv2rgb_init_tables_altivec(c, inv_table, brightness, contrast, saturation); +#endif + return 0; +} + +int sws_getColorspaceDetails(SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation) +{ + if (isYUV(c->dstFormat) || isGray(c->dstFormat)) return -1; + + *inv_table = c->srcColorspaceTable; + *table = c->dstColorspaceTable; + *srcRange = c->srcRange; + *dstRange = c->dstRange; + *brightness= c->brightness; + *contrast = c->contrast; + *saturation= c->saturation; + + return 0; +} + +static int handle_jpeg(enum PixelFormat *format) +{ + switch (*format) { + case PIX_FMT_YUVJ420P: *format = PIX_FMT_YUV420P; return 1; + case PIX_FMT_YUVJ422P: *format = PIX_FMT_YUV422P; return 1; + case PIX_FMT_YUVJ444P: *format = PIX_FMT_YUV444P; return 1; + case PIX_FMT_YUVJ440P: *format = PIX_FMT_YUV440P; return 1; + default: return 0; + } +} + +static int update_flags_cpu(int flags) +{ +#if !CONFIG_RUNTIME_CPUDETECT //ensure that the flags match the compiled variant if cpudetect is off + flags &= ~( SWS_CPU_CAPS_MMX + |SWS_CPU_CAPS_MMX2 + |SWS_CPU_CAPS_3DNOW + |SWS_CPU_CAPS_SSE2 + |SWS_CPU_CAPS_ALTIVEC + |SWS_CPU_CAPS_BFIN); + flags |= ff_hardcodedcpuflags(); +#endif /* CONFIG_RUNTIME_CPUDETECT */ + return flags; +} + +SwsContext *sws_alloc_context(void) +{ + SwsContext *c= av_mallocz(sizeof(SwsContext)); + + c->av_class = &sws_context_class; + av_opt_set_defaults(c); + + return c; +} + +int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) +{ + int i; + int usesVFilter, usesHFilter; + int unscaled; + SwsFilter dummyFilter= {NULL, NULL, NULL, NULL}; + int srcW= c->srcW; + int srcH= c->srcH; + int dstW= c->dstW; + int dstH= c->dstH; + int flags; + enum PixelFormat srcFormat= c->srcFormat; + enum PixelFormat dstFormat= c->dstFormat; + + flags= c->flags = update_flags_cpu(c->flags); +#if ARCH_X86 + if (flags & SWS_CPU_CAPS_MMX) + __asm__ volatile("emms\n\t"::: "memory"); +#endif + if (!rgb15to16) sws_rgb2rgb_init(flags); + + unscaled = (srcW == dstW && srcH == dstH); + + if (!isSupportedIn(srcFormat)) { + av_log(NULL, AV_LOG_ERROR, "swScaler: %s is not supported as input pixel format\n", sws_format_name(srcFormat)); + return AVERROR(EINVAL); + } + if (!isSupportedOut(dstFormat)) { + av_log(NULL, AV_LOG_ERROR, "swScaler: %s is not supported as output pixel format\n", sws_format_name(dstFormat)); + return AVERROR(EINVAL); + } + + i= flags & ( SWS_POINT + |SWS_AREA + |SWS_BILINEAR + |SWS_FAST_BILINEAR + |SWS_BICUBIC + |SWS_X + |SWS_GAUSS + |SWS_LANCZOS + |SWS_SINC + |SWS_SPLINE + |SWS_BICUBLIN); + if(!i || (i & (i-1))) { + av_log(NULL, AV_LOG_ERROR, "swScaler: Exactly one scaler algorithm must be chosen\n"); + return AVERROR(EINVAL); + } + /* sanity check */ + if (srcW<4 || srcH<1 || dstW<8 || dstH<1) { //FIXME check if these are enough and try to lowwer them after fixing the relevant parts of the code + av_log(NULL, AV_LOG_ERROR, "swScaler: %dx%d -> %dx%d is invalid scaling dimension\n", + srcW, srcH, dstW, dstH); + return AVERROR(EINVAL); + } + if(srcW > VOFW || dstW > VOFW) { + av_log(NULL, AV_LOG_ERROR, "swScaler: Compile-time maximum width is "AV_STRINGIFY(VOFW)" change VOF/VOFW and recompile\n"); + return AVERROR(EINVAL); + } + + if (!dstFilter) dstFilter= &dummyFilter; + if (!srcFilter) srcFilter= &dummyFilter; + + c->lumXInc= ((srcW<<16) + (dstW>>1))/dstW; + c->lumYInc= ((srcH<<16) + (dstH>>1))/dstH; + c->dstFormatBpp = av_get_bits_per_pixel(&av_pix_fmt_descriptors[dstFormat]); + c->srcFormatBpp = av_get_bits_per_pixel(&av_pix_fmt_descriptors[srcFormat]); + c->vRounder= 4* 0x0001000100010001ULL; + + usesVFilter = (srcFilter->lumV && srcFilter->lumV->length>1) || + (srcFilter->chrV && srcFilter->chrV->length>1) || + (dstFilter->lumV && dstFilter->lumV->length>1) || + (dstFilter->chrV && dstFilter->chrV->length>1); + usesHFilter = (srcFilter->lumH && srcFilter->lumH->length>1) || + (srcFilter->chrH && srcFilter->chrH->length>1) || + (dstFilter->lumH && dstFilter->lumH->length>1) || + (dstFilter->chrH && dstFilter->chrH->length>1); + + getSubSampleFactors(&c->chrSrcHSubSample, &c->chrSrcVSubSample, srcFormat); + getSubSampleFactors(&c->chrDstHSubSample, &c->chrDstVSubSample, dstFormat); + + // reuse chroma for 2 pixels RGB/BGR unless user wants full chroma interpolation + if (isAnyRGB(dstFormat) && !(flags&SWS_FULL_CHR_H_INT)) c->chrDstHSubSample=1; + + // drop some chroma lines if the user wants it + c->vChrDrop= (flags&SWS_SRC_V_CHR_DROP_MASK)>>SWS_SRC_V_CHR_DROP_SHIFT; + c->chrSrcVSubSample+= c->vChrDrop; + + // drop every other pixel for chroma calculation unless user wants full chroma + if (isAnyRGB(srcFormat) && !(flags&SWS_FULL_CHR_H_INP) + && srcFormat!=PIX_FMT_RGB8 && srcFormat!=PIX_FMT_BGR8 + && srcFormat!=PIX_FMT_RGB4 && srcFormat!=PIX_FMT_BGR4 + && srcFormat!=PIX_FMT_RGB4_BYTE && srcFormat!=PIX_FMT_BGR4_BYTE + && ((dstW>>c->chrDstHSubSample) <= (srcW>>1) || (flags&SWS_FAST_BILINEAR))) + c->chrSrcHSubSample=1; + + // Note the -((-x)>>y) is so that we always round toward +inf. + c->chrSrcW= -((-srcW) >> c->chrSrcHSubSample); + c->chrSrcH= -((-srcH) >> c->chrSrcVSubSample); + c->chrDstW= -((-dstW) >> c->chrDstHSubSample); + c->chrDstH= -((-dstH) >> c->chrDstVSubSample); + + /* unscaled special cases */ + if (unscaled && !usesHFilter && !usesVFilter && (c->srcRange == c->dstRange || isAnyRGB(dstFormat))) { + ff_get_unscaled_swscale(c); + + if (c->swScale) { + if (flags&SWS_PRINT_INFO) + av_log(c, AV_LOG_INFO, "using unscaled %s -> %s special converter\n", + sws_format_name(srcFormat), sws_format_name(dstFormat)); + return 0; + } + } + + if (flags & SWS_CPU_CAPS_MMX2) { + c->canMMX2BeUsed= (dstW >=srcW && (dstW&31)==0 && (srcW&15)==0) ? 1 : 0; + if (!c->canMMX2BeUsed && dstW >=srcW && (srcW&15)==0 && (flags&SWS_FAST_BILINEAR)) { + if (flags&SWS_PRINT_INFO) + av_log(c, AV_LOG_INFO, "output width is not a multiple of 32 -> no MMX2 scaler\n"); + } + if (usesHFilter) c->canMMX2BeUsed=0; + } + else + c->canMMX2BeUsed=0; + + c->chrXInc= ((c->chrSrcW<<16) + (c->chrDstW>>1))/c->chrDstW; + c->chrYInc= ((c->chrSrcH<<16) + (c->chrDstH>>1))/c->chrDstH; + + // match pixel 0 of the src to pixel 0 of dst and match pixel n-2 of src to pixel n-2 of dst + // but only for the FAST_BILINEAR mode otherwise do correct scaling + // n-2 is the last chrominance sample available + // this is not perfect, but no one should notice the difference, the more correct variant + // would be like the vertical one, but that would require some special code for the + // first and last pixel + if (flags&SWS_FAST_BILINEAR) { + if (c->canMMX2BeUsed) { + c->lumXInc+= 20; + c->chrXInc+= 20; + } + //we don't use the x86 asm scaler if MMX is available + else if (flags & SWS_CPU_CAPS_MMX) { + c->lumXInc = ((srcW-2)<<16)/(dstW-2) - 20; + c->chrXInc = ((c->chrSrcW-2)<<16)/(c->chrDstW-2) - 20; + } + } + + /* precalculate horizontal scaler filter coefficients */ + { +#if ARCH_X86 && (HAVE_MMX2 || CONFIG_RUNTIME_CPUDETECT) +// can't downscale !!! + if (c->canMMX2BeUsed && (flags & SWS_FAST_BILINEAR)) { + c->lumMmx2FilterCodeSize = initMMX2HScaler( dstW, c->lumXInc, NULL, NULL, NULL, 8); + c->chrMmx2FilterCodeSize = initMMX2HScaler(c->chrDstW, c->chrXInc, NULL, NULL, NULL, 4); + +#ifdef MAP_ANONYMOUS + c->lumMmx2FilterCode = mmap(NULL, c->lumMmx2FilterCodeSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + c->chrMmx2FilterCode = mmap(NULL, c->chrMmx2FilterCodeSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +#elif HAVE_VIRTUALALLOC + c->lumMmx2FilterCode = VirtualAlloc(NULL, c->lumMmx2FilterCodeSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE); + c->chrMmx2FilterCode = VirtualAlloc(NULL, c->chrMmx2FilterCodeSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE); +#else + c->lumMmx2FilterCode = av_malloc(c->lumMmx2FilterCodeSize); + c->chrMmx2FilterCode = av_malloc(c->chrMmx2FilterCodeSize); +#endif + + if (!c->lumMmx2FilterCode || !c->chrMmx2FilterCode) + return AVERROR(ENOMEM); + FF_ALLOCZ_OR_GOTO(c, c->hLumFilter , (dstW /8+8)*sizeof(int16_t), fail); + FF_ALLOCZ_OR_GOTO(c, c->hChrFilter , (c->chrDstW /4+8)*sizeof(int16_t), fail); + FF_ALLOCZ_OR_GOTO(c, c->hLumFilterPos, (dstW /2/8+8)*sizeof(int32_t), fail); + FF_ALLOCZ_OR_GOTO(c, c->hChrFilterPos, (c->chrDstW/2/4+8)*sizeof(int32_t), fail); + + initMMX2HScaler( dstW, c->lumXInc, c->lumMmx2FilterCode, c->hLumFilter, c->hLumFilterPos, 8); + initMMX2HScaler(c->chrDstW, c->chrXInc, c->chrMmx2FilterCode, c->hChrFilter, c->hChrFilterPos, 4); + +#ifdef MAP_ANONYMOUS + mprotect(c->lumMmx2FilterCode, c->lumMmx2FilterCodeSize, PROT_EXEC | PROT_READ); + mprotect(c->chrMmx2FilterCode, c->chrMmx2FilterCodeSize, PROT_EXEC | PROT_READ); +#endif + } else +#endif /* ARCH_X86 && (HAVE_MMX2 || CONFIG_RUNTIME_CPUDETECT) */ + { + const int filterAlign= + (flags & SWS_CPU_CAPS_MMX) ? 4 : + (flags & SWS_CPU_CAPS_ALTIVEC) ? 8 : + 1; + + if (initFilter(&c->hLumFilter, &c->hLumFilterPos, &c->hLumFilterSize, c->lumXInc, + srcW , dstW, filterAlign, 1<<14, + (flags&SWS_BICUBLIN) ? (flags|SWS_BICUBIC) : flags, + srcFilter->lumH, dstFilter->lumH, c->param) < 0) + goto fail; + if (initFilter(&c->hChrFilter, &c->hChrFilterPos, &c->hChrFilterSize, c->chrXInc, + c->chrSrcW, c->chrDstW, filterAlign, 1<<14, + (flags&SWS_BICUBLIN) ? (flags|SWS_BILINEAR) : flags, + srcFilter->chrH, dstFilter->chrH, c->param) < 0) + goto fail; + } + } // initialize horizontal stuff + + /* precalculate vertical scaler filter coefficients */ + { + const int filterAlign= + (flags & SWS_CPU_CAPS_MMX) && (flags & SWS_ACCURATE_RND) ? 2 : + (flags & SWS_CPU_CAPS_ALTIVEC) ? 8 : + 1; + + if (initFilter(&c->vLumFilter, &c->vLumFilterPos, &c->vLumFilterSize, c->lumYInc, + srcH , dstH, filterAlign, (1<<12), + (flags&SWS_BICUBLIN) ? (flags|SWS_BICUBIC) : flags, + srcFilter->lumV, dstFilter->lumV, c->param) < 0) + goto fail; + if (initFilter(&c->vChrFilter, &c->vChrFilterPos, &c->vChrFilterSize, c->chrYInc, + c->chrSrcH, c->chrDstH, filterAlign, (1<<12), + (flags&SWS_BICUBLIN) ? (flags|SWS_BILINEAR) : flags, + srcFilter->chrV, dstFilter->chrV, c->param) < 0) + goto fail; + +#if HAVE_ALTIVEC + FF_ALLOC_OR_GOTO(c, c->vYCoeffsBank, sizeof (vector signed short)*c->vLumFilterSize*c->dstH, fail); + FF_ALLOC_OR_GOTO(c, c->vCCoeffsBank, sizeof (vector signed short)*c->vChrFilterSize*c->chrDstH, fail); + + for (i=0;ivLumFilterSize*c->dstH;i++) { + int j; + short *p = (short *)&c->vYCoeffsBank[i]; + for (j=0;j<8;j++) + p[j] = c->vLumFilter[i]; + } + + for (i=0;ivChrFilterSize*c->chrDstH;i++) { + int j; + short *p = (short *)&c->vCCoeffsBank[i]; + for (j=0;j<8;j++) + p[j] = c->vChrFilter[i]; + } +#endif + } + + // calculate buffer sizes so that they won't run out while handling these damn slices + c->vLumBufSize= c->vLumFilterSize; + c->vChrBufSize= c->vChrFilterSize; + for (i=0; ichrDstH / dstH; + int nextSlice= FFMAX(c->vLumFilterPos[i ] + c->vLumFilterSize - 1, + ((c->vChrFilterPos[chrI] + c->vChrFilterSize - 1)<chrSrcVSubSample)); + + nextSlice>>= c->chrSrcVSubSample; + nextSlice<<= c->chrSrcVSubSample; + if (c->vLumFilterPos[i ] + c->vLumBufSize < nextSlice) + c->vLumBufSize= nextSlice - c->vLumFilterPos[i]; + if (c->vChrFilterPos[chrI] + c->vChrBufSize < (nextSlice>>c->chrSrcVSubSample)) + c->vChrBufSize= (nextSlice>>c->chrSrcVSubSample) - c->vChrFilterPos[chrI]; + } + + // allocate pixbufs (we use dynamic allocation because otherwise we would need to + // allocate several megabytes to handle all possible cases) + FF_ALLOC_OR_GOTO(c, c->lumPixBuf, c->vLumBufSize*2*sizeof(int16_t*), fail); + FF_ALLOC_OR_GOTO(c, c->chrPixBuf, c->vChrBufSize*2*sizeof(int16_t*), fail); + if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat) && isALPHA(c->dstFormat)) + FF_ALLOCZ_OR_GOTO(c, c->alpPixBuf, c->vLumBufSize*2*sizeof(int16_t*), fail); + //Note we need at least one pixel more at the end because of the MMX code (just in case someone wanna replace the 4000/8000) + /* align at 16 bytes for AltiVec */ + for (i=0; ivLumBufSize; i++) { + FF_ALLOCZ_OR_GOTO(c, c->lumPixBuf[i+c->vLumBufSize], VOF+1, fail); + c->lumPixBuf[i] = c->lumPixBuf[i+c->vLumBufSize]; + } + for (i=0; ivChrBufSize; i++) { + FF_ALLOC_OR_GOTO(c, c->chrPixBuf[i+c->vChrBufSize], (VOF+1)*2, fail); + c->chrPixBuf[i] = c->chrPixBuf[i+c->vChrBufSize]; + } + if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) + for (i=0; ivLumBufSize; i++) { + FF_ALLOCZ_OR_GOTO(c, c->alpPixBuf[i+c->vLumBufSize], VOF+1, fail); + c->alpPixBuf[i] = c->alpPixBuf[i+c->vLumBufSize]; + } + + //try to avoid drawing green stuff between the right end and the stride end + for (i=0; ivChrBufSize; i++) memset(c->chrPixBuf[i], 64, (VOF+1)*2); + + assert(2*VOFW == VOF); + + assert(c->chrDstH <= dstH); + + if (flags&SWS_PRINT_INFO) { + if (flags&SWS_FAST_BILINEAR) av_log(c, AV_LOG_INFO, "FAST_BILINEAR scaler, "); + else if (flags&SWS_BILINEAR) av_log(c, AV_LOG_INFO, "BILINEAR scaler, "); + else if (flags&SWS_BICUBIC) av_log(c, AV_LOG_INFO, "BICUBIC scaler, "); + else if (flags&SWS_X) av_log(c, AV_LOG_INFO, "Experimental scaler, "); + else if (flags&SWS_POINT) av_log(c, AV_LOG_INFO, "Nearest Neighbor / POINT scaler, "); + else if (flags&SWS_AREA) av_log(c, AV_LOG_INFO, "Area Averaging scaler, "); + else if (flags&SWS_BICUBLIN) av_log(c, AV_LOG_INFO, "luma BICUBIC / chroma BILINEAR scaler, "); + else if (flags&SWS_GAUSS) av_log(c, AV_LOG_INFO, "Gaussian scaler, "); + else if (flags&SWS_SINC) av_log(c, AV_LOG_INFO, "Sinc scaler, "); + else if (flags&SWS_LANCZOS) av_log(c, AV_LOG_INFO, "Lanczos scaler, "); + else if (flags&SWS_SPLINE) av_log(c, AV_LOG_INFO, "Bicubic spline scaler, "); + else av_log(c, AV_LOG_INFO, "ehh flags invalid?! "); + + av_log(c, AV_LOG_INFO, "from %s to %s%s ", + sws_format_name(srcFormat), +#ifdef DITHER1XBPP + dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 || + dstFormat == PIX_FMT_RGB444BE || dstFormat == PIX_FMT_RGB444LE || + dstFormat == PIX_FMT_BGR444BE || dstFormat == PIX_FMT_BGR444LE ? "dithered " : "", +#else + "", +#endif + sws_format_name(dstFormat)); + + if (flags & SWS_CPU_CAPS_MMX2) av_log(c, AV_LOG_INFO, "using MMX2\n"); + else if (flags & SWS_CPU_CAPS_3DNOW) av_log(c, AV_LOG_INFO, "using 3DNOW\n"); + else if (flags & SWS_CPU_CAPS_MMX) av_log(c, AV_LOG_INFO, "using MMX\n"); + else if (flags & SWS_CPU_CAPS_ALTIVEC) av_log(c, AV_LOG_INFO, "using AltiVec\n"); + else av_log(c, AV_LOG_INFO, "using C\n"); + + if (flags & SWS_CPU_CAPS_MMX) { + if (c->canMMX2BeUsed && (flags&SWS_FAST_BILINEAR)) + av_log(c, AV_LOG_VERBOSE, "using FAST_BILINEAR MMX2 scaler for horizontal scaling\n"); + else { + if (c->hLumFilterSize==4) + av_log(c, AV_LOG_VERBOSE, "using 4-tap MMX scaler for horizontal luminance scaling\n"); + else if (c->hLumFilterSize==8) + av_log(c, AV_LOG_VERBOSE, "using 8-tap MMX scaler for horizontal luminance scaling\n"); + else + av_log(c, AV_LOG_VERBOSE, "using n-tap MMX scaler for horizontal luminance scaling\n"); + + if (c->hChrFilterSize==4) + av_log(c, AV_LOG_VERBOSE, "using 4-tap MMX scaler for horizontal chrominance scaling\n"); + else if (c->hChrFilterSize==8) + av_log(c, AV_LOG_VERBOSE, "using 8-tap MMX scaler for horizontal chrominance scaling\n"); + else + av_log(c, AV_LOG_VERBOSE, "using n-tap MMX scaler for horizontal chrominance scaling\n"); + } + } else { +#if ARCH_X86 + av_log(c, AV_LOG_VERBOSE, "using x86 asm scaler for horizontal scaling\n"); +#else + if (flags & SWS_FAST_BILINEAR) + av_log(c, AV_LOG_VERBOSE, "using FAST_BILINEAR C scaler for horizontal scaling\n"); + else + av_log(c, AV_LOG_VERBOSE, "using C scaler for horizontal scaling\n"); +#endif + } + if (isPlanarYUV(dstFormat)) { + if (c->vLumFilterSize==1) + av_log(c, AV_LOG_VERBOSE, "using 1-tap %s \"scaler\" for vertical scaling (YV12 like)\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C"); + else + av_log(c, AV_LOG_VERBOSE, "using n-tap %s scaler for vertical scaling (YV12 like)\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C"); + } else { + if (c->vLumFilterSize==1 && c->vChrFilterSize==2) + av_log(c, AV_LOG_VERBOSE, "using 1-tap %s \"scaler\" for vertical luminance scaling (BGR)\n" + " 2-tap scaler for vertical chrominance scaling (BGR)\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C"); + else if (c->vLumFilterSize==2 && c->vChrFilterSize==2) + av_log(c, AV_LOG_VERBOSE, "using 2-tap linear %s scaler for vertical scaling (BGR)\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C"); + else + av_log(c, AV_LOG_VERBOSE, "using n-tap %s scaler for vertical scaling (BGR)\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C"); + } + + if (dstFormat==PIX_FMT_BGR24) + av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR24 converter\n", + (flags & SWS_CPU_CAPS_MMX2) ? "MMX2" : ((flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C")); + else if (dstFormat==PIX_FMT_RGB32) + av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR32 converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C"); + else if (dstFormat==PIX_FMT_BGR565) + av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR16 converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C"); + else if (dstFormat==PIX_FMT_BGR555) + av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR15 converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C"); + else if (dstFormat == PIX_FMT_RGB444BE || dstFormat == PIX_FMT_RGB444LE || + dstFormat == PIX_FMT_BGR444BE || dstFormat == PIX_FMT_BGR444LE) + av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR12 converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C"); + + av_log(c, AV_LOG_VERBOSE, "%dx%d -> %dx%d\n", srcW, srcH, dstW, dstH); + av_log(c, AV_LOG_DEBUG, "lum srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n", + c->srcW, c->srcH, c->dstW, c->dstH, c->lumXInc, c->lumYInc); + av_log(c, AV_LOG_DEBUG, "chr srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n", + c->chrSrcW, c->chrSrcH, c->chrDstW, c->chrDstH, c->chrXInc, c->chrYInc); + } + + c->swScale= ff_getSwsFunc(c); + return 0; +fail: //FIXME replace things by appropriate error codes + return -1; +} + +#if FF_API_SWS_GETCONTEXT +SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, + int dstW, int dstH, enum PixelFormat dstFormat, int flags, + SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param) +{ + SwsContext *c; + + if(!(c=sws_alloc_context())) + return NULL; + + c->flags= flags; + c->srcW= srcW; + c->srcH= srcH; + c->dstW= dstW; + c->dstH= dstH; + c->srcRange = handle_jpeg(&srcFormat); + c->dstRange = handle_jpeg(&dstFormat); + c->srcFormat= srcFormat; + c->dstFormat= dstFormat; + + if (param) { + c->param[0] = param[0]; + c->param[1] = param[1]; + } + sws_setColorspaceDetails(c, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT], c->srcRange, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT] /* FIXME*/, c->dstRange, 0, 1<<16, 1<<16); + + if(sws_init_context(c, srcFilter, dstFilter) < 0){ + sws_freeContext(c); + return NULL; + } + + return c; +} +#endif + +SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, + float lumaSharpen, float chromaSharpen, + float chromaHShift, float chromaVShift, + int verbose) +{ + SwsFilter *filter= av_malloc(sizeof(SwsFilter)); + if (!filter) + return NULL; + + if (lumaGBlur!=0.0) { + filter->lumH= sws_getGaussianVec(lumaGBlur, 3.0); + filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0); + } else { + filter->lumH= sws_getIdentityVec(); + filter->lumV= sws_getIdentityVec(); + } + + if (chromaGBlur!=0.0) { + filter->chrH= sws_getGaussianVec(chromaGBlur, 3.0); + filter->chrV= sws_getGaussianVec(chromaGBlur, 3.0); + } else { + filter->chrH= sws_getIdentityVec(); + filter->chrV= sws_getIdentityVec(); + } + + if (chromaSharpen!=0.0) { + SwsVector *id= sws_getIdentityVec(); + sws_scaleVec(filter->chrH, -chromaSharpen); + sws_scaleVec(filter->chrV, -chromaSharpen); + sws_addVec(filter->chrH, id); + sws_addVec(filter->chrV, id); + sws_freeVec(id); + } + + if (lumaSharpen!=0.0) { + SwsVector *id= sws_getIdentityVec(); + sws_scaleVec(filter->lumH, -lumaSharpen); + sws_scaleVec(filter->lumV, -lumaSharpen); + sws_addVec(filter->lumH, id); + sws_addVec(filter->lumV, id); + sws_freeVec(id); + } + + if (chromaHShift != 0.0) + sws_shiftVec(filter->chrH, (int)(chromaHShift+0.5)); + + if (chromaVShift != 0.0) + sws_shiftVec(filter->chrV, (int)(chromaVShift+0.5)); + + sws_normalizeVec(filter->chrH, 1.0); + sws_normalizeVec(filter->chrV, 1.0); + sws_normalizeVec(filter->lumH, 1.0); + sws_normalizeVec(filter->lumV, 1.0); + + if (verbose) sws_printVec2(filter->chrH, NULL, AV_LOG_DEBUG); + if (verbose) sws_printVec2(filter->lumH, NULL, AV_LOG_DEBUG); + + return filter; +} + +SwsVector *sws_allocVec(int length) +{ + SwsVector *vec = av_malloc(sizeof(SwsVector)); + if (!vec) + return NULL; + vec->length = length; + vec->coeff = av_malloc(sizeof(double) * length); + if (!vec->coeff) + av_freep(&vec); + return vec; +} + +SwsVector *sws_getGaussianVec(double variance, double quality) +{ + const int length= (int)(variance*quality + 0.5) | 1; + int i; + double middle= (length-1)*0.5; + SwsVector *vec= sws_allocVec(length); + + if (!vec) + return NULL; + + for (i=0; icoeff[i]= exp(-dist*dist/(2*variance*variance)) / sqrt(2*variance*M_PI); + } + + sws_normalizeVec(vec, 1.0); + + return vec; +} + +SwsVector *sws_getConstVec(double c, int length) +{ + int i; + SwsVector *vec= sws_allocVec(length); + + if (!vec) + return NULL; + + for (i=0; icoeff[i]= c; + + return vec; +} + +SwsVector *sws_getIdentityVec(void) +{ + return sws_getConstVec(1.0, 1); +} + +static double sws_dcVec(SwsVector *a) +{ + int i; + double sum=0; + + for (i=0; ilength; i++) + sum+= a->coeff[i]; + + return sum; +} + +void sws_scaleVec(SwsVector *a, double scalar) +{ + int i; + + for (i=0; ilength; i++) + a->coeff[i]*= scalar; +} + +void sws_normalizeVec(SwsVector *a, double height) +{ + sws_scaleVec(a, height/sws_dcVec(a)); +} + +static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b) +{ + int length= a->length + b->length - 1; + int i, j; + SwsVector *vec= sws_getConstVec(0.0, length); + + if (!vec) + return NULL; + + for (i=0; ilength; i++) { + for (j=0; jlength; j++) { + vec->coeff[i+j]+= a->coeff[i]*b->coeff[j]; + } + } + + return vec; +} + +static SwsVector *sws_sumVec(SwsVector *a, SwsVector *b) +{ + int length= FFMAX(a->length, b->length); + int i; + SwsVector *vec= sws_getConstVec(0.0, length); + + if (!vec) + return NULL; + + for (i=0; ilength; i++) vec->coeff[i + (length-1)/2 - (a->length-1)/2]+= a->coeff[i]; + for (i=0; ilength; i++) vec->coeff[i + (length-1)/2 - (b->length-1)/2]+= b->coeff[i]; + + return vec; +} + +static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b) +{ + int length= FFMAX(a->length, b->length); + int i; + SwsVector *vec= sws_getConstVec(0.0, length); + + if (!vec) + return NULL; + + for (i=0; ilength; i++) vec->coeff[i + (length-1)/2 - (a->length-1)/2]+= a->coeff[i]; + for (i=0; ilength; i++) vec->coeff[i + (length-1)/2 - (b->length-1)/2]-= b->coeff[i]; + + return vec; +} + +/* shift left / or right if "shift" is negative */ +static SwsVector *sws_getShiftedVec(SwsVector *a, int shift) +{ + int length= a->length + FFABS(shift)*2; + int i; + SwsVector *vec= sws_getConstVec(0.0, length); + + if (!vec) + return NULL; + + for (i=0; ilength; i++) { + vec->coeff[i + (length-1)/2 - (a->length-1)/2 - shift]= a->coeff[i]; + } + + return vec; +} + +void sws_shiftVec(SwsVector *a, int shift) +{ + SwsVector *shifted= sws_getShiftedVec(a, shift); + av_free(a->coeff); + a->coeff= shifted->coeff; + a->length= shifted->length; + av_free(shifted); +} + +void sws_addVec(SwsVector *a, SwsVector *b) +{ + SwsVector *sum= sws_sumVec(a, b); + av_free(a->coeff); + a->coeff= sum->coeff; + a->length= sum->length; + av_free(sum); +} + +void sws_subVec(SwsVector *a, SwsVector *b) +{ + SwsVector *diff= sws_diffVec(a, b); + av_free(a->coeff); + a->coeff= diff->coeff; + a->length= diff->length; + av_free(diff); +} + +void sws_convVec(SwsVector *a, SwsVector *b) +{ + SwsVector *conv= sws_getConvVec(a, b); + av_free(a->coeff); + a->coeff= conv->coeff; + a->length= conv->length; + av_free(conv); +} + +SwsVector *sws_cloneVec(SwsVector *a) +{ + int i; + SwsVector *vec= sws_allocVec(a->length); + + if (!vec) + return NULL; + + for (i=0; ilength; i++) vec->coeff[i]= a->coeff[i]; + + return vec; +} + +void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level) +{ + int i; + double max=0; + double min=0; + double range; + + for (i=0; ilength; i++) + if (a->coeff[i]>max) max= a->coeff[i]; + + for (i=0; ilength; i++) + if (a->coeff[i]coeff[i]; + + range= max - min; + + for (i=0; ilength; i++) { + int x= (int)((a->coeff[i]-min)*60.0/range +0.5); + av_log(log_ctx, log_level, "%1.3f ", a->coeff[i]); + for (;x>0; x--) av_log(log_ctx, log_level, " "); + av_log(log_ctx, log_level, "|\n"); + } +} + +#if LIBSWSCALE_VERSION_MAJOR < 1 +void sws_printVec(SwsVector *a) +{ + sws_printVec2(a, NULL, AV_LOG_DEBUG); +} +#endif + +void sws_freeVec(SwsVector *a) +{ + if (!a) return; + av_freep(&a->coeff); + a->length=0; + av_free(a); +} + +void sws_freeFilter(SwsFilter *filter) +{ + if (!filter) return; + + if (filter->lumH) sws_freeVec(filter->lumH); + if (filter->lumV) sws_freeVec(filter->lumV); + if (filter->chrH) sws_freeVec(filter->chrH); + if (filter->chrV) sws_freeVec(filter->chrV); + av_free(filter); +} + +void sws_freeContext(SwsContext *c) +{ + int i; + if (!c) return; + + if (c->lumPixBuf) { + for (i=0; ivLumBufSize; i++) + av_freep(&c->lumPixBuf[i]); + av_freep(&c->lumPixBuf); + } + + if (c->chrPixBuf) { + for (i=0; ivChrBufSize; i++) + av_freep(&c->chrPixBuf[i]); + av_freep(&c->chrPixBuf); + } + + if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) { + for (i=0; ivLumBufSize; i++) + av_freep(&c->alpPixBuf[i]); + av_freep(&c->alpPixBuf); + } + + av_freep(&c->vLumFilter); + av_freep(&c->vChrFilter); + av_freep(&c->hLumFilter); + av_freep(&c->hChrFilter); +#if HAVE_ALTIVEC + av_freep(&c->vYCoeffsBank); + av_freep(&c->vCCoeffsBank); +#endif + + av_freep(&c->vLumFilterPos); + av_freep(&c->vChrFilterPos); + av_freep(&c->hLumFilterPos); + av_freep(&c->hChrFilterPos); + +#if ARCH_X86 +#ifdef MAP_ANONYMOUS + if (c->lumMmx2FilterCode) munmap(c->lumMmx2FilterCode, c->lumMmx2FilterCodeSize); + if (c->chrMmx2FilterCode) munmap(c->chrMmx2FilterCode, c->chrMmx2FilterCodeSize); +#elif HAVE_VIRTUALALLOC + if (c->lumMmx2FilterCode) VirtualFree(c->lumMmx2FilterCode, 0, MEM_RELEASE); + if (c->chrMmx2FilterCode) VirtualFree(c->chrMmx2FilterCode, 0, MEM_RELEASE); +#else + av_free(c->lumMmx2FilterCode); + av_free(c->chrMmx2FilterCode); +#endif + c->lumMmx2FilterCode=NULL; + c->chrMmx2FilterCode=NULL; +#endif /* ARCH_X86 */ + + av_freep(&c->yuvTable); + + av_free(c); +} + +struct SwsContext *sws_getCachedContext(struct SwsContext *context, + int srcW, int srcH, enum PixelFormat srcFormat, + int dstW, int dstH, enum PixelFormat dstFormat, int flags, + SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param) +{ + static const double default_param[2] = {SWS_PARAM_DEFAULT, SWS_PARAM_DEFAULT}; + + if (!param) + param = default_param; + + flags = update_flags_cpu(flags); + + if (context && + (context->srcW != srcW || + context->srcH != srcH || + context->srcFormat != srcFormat || + context->dstW != dstW || + context->dstH != dstH || + context->dstFormat != dstFormat || + context->flags != flags || + context->param[0] != param[0] || + context->param[1] != param[1])) { + sws_freeContext(context); + context = NULL; + } + + if (!context) { + if (!(context = sws_alloc_context())) + return NULL; + context->srcW = srcW; + context->srcH = srcH; + context->srcRange = handle_jpeg(&srcFormat); + context->srcFormat = srcFormat; + context->dstW = dstW; + context->dstH = dstH; + context->dstRange = handle_jpeg(&dstFormat); + context->dstFormat = dstFormat; + context->flags = flags; + context->param[0] = param[0]; + context->param[1] = param[1]; + sws_setColorspaceDetails(context, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT], context->srcRange, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT] /* FIXME*/, context->dstRange, 0, 1<<16, 1<<16); + if (sws_init_context(context, srcFilter, dstFilter) < 0) { + sws_freeContext(context); + return NULL; + } + } + return context; +} + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0001-changed-allow-reading-of-growing-avi-files-ie-curren.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0001-changed-allow-reading-of-growing-avi-files-ie-curren.patch new file mode 100644 index 00000000..72af9806 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0001-changed-allow-reading-of-growing-avi-files-ie-curren.patch @@ -0,0 +1,52 @@ +From 4cb1a5a9e6a7258a5c4026c57f3e2bae9df292d0 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 01:28:27 -0400 +Subject: [PATCH 01/36] changed: allow reading of growing avi files (ie currently being written) + +--- + libavformat/avidec.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libavformat/avidec.c b/libavformat/avidec.c +index d8d4726..6b3e927 100644 +--- a/libavformat/avidec.c ++++ b/libavformat/avidec.c +@@ -139,7 +139,7 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){ + AVIStream *ast; + int i; + int64_t last_pos= -1; +- int64_t filesize= url_fsize(s->pb); ++ int64_t filesize= avi->fsize; + + #ifdef DEBUG_SEEK + av_log(s, AV_LOG_ERROR, "longs_pre_entry:%d index_type:%d entries_in_use:%d chunk_id:%X base:%16"PRIX64"\n", +@@ -353,7 +353,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) + return -1; + + avi->fsize = url_fsize(pb); +- if(avi->fsize<=0) ++ if(avi->fsize<=0 || avi->fsize < avi->riff_end) + avi->fsize= avi->riff_end == 8 ? INT64_MAX : avi->riff_end; + + /* first list tag */ +@@ -379,7 +379,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) + if (tag1 == MKTAG('m', 'o', 'v', 'i')) { + avi->movi_list = url_ftell(pb) - 4; + if(size) avi->movi_end = avi->movi_list + size + (size & 1); +- else avi->movi_end = url_fsize(pb); ++ else avi->movi_end = avi->fsize; + av_dlog(NULL, "movi end=%"PRIx64"\n", avi->movi_end); + goto end_of_header; + } +@@ -706,7 +706,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) + av_log(s, AV_LOG_ERROR, "Something went wrong during header parsing, " + "I will ignore it and try to continue anyway.\n"); + avi->movi_list = url_ftell(pb) - 4; +- avi->movi_end = url_fsize(pb); ++ avi->movi_end = avi->fsize; + goto end_of_header; + } + /* skip tag */ +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0002-w32thread-add-logging.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0002-w32thread-add-logging.patch new file mode 100644 index 00000000..1767f87b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0002-w32thread-add-logging.patch @@ -0,0 +1,46 @@ +From c564d6ba80e9c27c0fa95835cf09efd08fc6d570 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 01:30:34 -0400 +Subject: [PATCH 02/36] w32thread: add logging + +--- + libavcodec/w32thread.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/libavcodec/w32thread.c b/libavcodec/w32thread.c +index f7a1430..5654334 100644 +--- a/libavcodec/w32thread.c ++++ b/libavcodec/w32thread.c +@@ -130,7 +130,7 @@ int avcodec_thread_init(AVCodecContext *s, int thread_count){ + uint32_t threadid; + + s->thread_count= thread_count; +- ++av_log(NULL, AV_LOG_INFO, "[w32thread] thread count = %d\n", thread_count); + if (thread_count <= 1) + return 0; + +@@ -147,17 +147,19 @@ int avcodec_thread_init(AVCodecContext *s, int thread_count){ + for(i=0; iexecute= avcodec_thread_execute; + s->execute2= avcodec_thread_execute2; + +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0003-asf-hacks.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0003-asf-hacks.patch new file mode 100644 index 00000000..d5f10a6e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0003-asf-hacks.patch @@ -0,0 +1,55 @@ +From abf62ced1700fda797e839bc8be5dfb43bd2e67a Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 01:34:29 -0400 +Subject: [PATCH 03/36] asf hacks + +--- + libavformat/asfdec.c | 15 ++++++++++++++- + 1 files changed, 14 insertions(+), 1 deletions(-) + +diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c +index 35e892c..2bda885 100644 +--- a/libavformat/asfdec.c ++++ b/libavformat/asfdec.c +@@ -1109,6 +1109,7 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index) + int64_t gsize= get_le64(s->pb); + if (gsize < 24 || url_feof(s->pb)) { + url_fseek(s->pb, current_pos, SEEK_SET); ++ asf->index_read= -1; + return; + } + url_fseek(s->pb, gsize-24, SEEK_CUR); +@@ -1149,9 +1150,20 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int + int64_t pos; + int index; + ++ if (pts == 0) { ++ // this is a hack since av_gen_search searches the entire file in this case ++ av_log(s, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", s->data_offset); ++ if (url_fseek(s->pb, s->data_offset, SEEK_SET) < 0) ++ return -1; ++ return 0; ++ } ++ + if (s->packet_size <= 0) + return -1; + ++ if (st->codec->codec_type != AVMEDIA_TYPE_VIDEO) ++ return -1; ++ + /* Try using the protocol's read_seek if available */ + if(s->pb) { + int ret = av_url_read_fseek(s->pb, stream_index, pts, flags); +@@ -1198,7 +1210,8 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int + + /* do the seek */ + av_log(s, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos); +- url_fseek(s->pb, pos, SEEK_SET); ++ if(url_fseek(s->pb, pos, SEEK_SET)<0) ++ return -1; + } + asf_reset_header(s); + return 0; +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0004-support-seeking-in-nuv-files.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0004-support-seeking-in-nuv-files.patch new file mode 100644 index 00000000..593427fc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0004-support-seeking-in-nuv-files.patch @@ -0,0 +1,126 @@ +From 2433fbdc04fd5497f71b1e3d5f9a184048616734 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 01:36:50 -0400 +Subject: [PATCH 04/36] support seeking in nuv files + +--- + libavformat/nuv.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 84 insertions(+), 0 deletions(-) + +diff --git a/libavformat/nuv.c b/libavformat/nuv.c +index 58a00df..04b256c 100644 +--- a/libavformat/nuv.c ++++ b/libavformat/nuv.c +@@ -218,12 +218,18 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) { + ret = av_new_packet(pkt, copyhdrsize + size); + if (ret < 0) + return ret; ++ + // HACK: we have no idea if it is a keyframe, + // but if we mark none seeking will not work at all. + pkt->flags |= AV_PKT_FLAG_KEY; + pkt->pos = pos; + pkt->pts = AV_RL32(&hdr[4]); + pkt->stream_index = ctx->v_id; ++ if(hdr[2] == 0) { ++ AVStream *st = s->streams[pkt->stream_index]; ++ pkt->flags |= PKT_FLAG_KEY; ++ av_add_index_entry(st, pkt->pos, pkt->pts, size + HDRSIZE, 0, AVINDEX_KEYFRAME); ++ } + memcpy(pkt->data, hdr, copyhdrsize); + ret = get_buffer(pb, pkt->data + copyhdrsize, size); + if (ret < 0) { +@@ -257,6 +263,83 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) { + return AVERROR(EIO); + } + ++/** ++ * \brief looks for the string RTjjjjjjjjjj in the stream too resync reading ++ * \return TRUE if the syncword is found. ++ */ ++static int nuv_resync(AVFormatContext *s, int64_t pos_limit) { ++ ByteIOContext *pb = s->pb; ++ uint32_t tag; ++ ++ tag = get_be32(pb); ++ while(!url_feof(pb) && url_ftell(pb) < pos_limit) { ++ if(tag != MKBETAG('R','T','j','j')) { ++ tag = (tag << 8) | get_byte(pb); ++ continue; ++ } ++ tag = get_be32(pb); ++ if(tag != MKBETAG('j','j','j','j')) ++ continue; ++ ++ tag = get_be32(pb); ++ if(tag != MKBETAG('j','j','j','j')) ++ continue; ++ ++ return 1; ++ } ++ return 0; ++} ++ ++/** ++ * \brief attempts to read a timestamp from stream at the given stream position ++ * \return timestamp if successfull and AV_NOPTS_VALUE if failure ++ */ ++static int64_t nuv_read_dts(AVFormatContext *s, int stream_index, ++ int64_t *ppos, int64_t pos_limit) ++{ ++ NUVContext *ctx = s->priv_data; ++ ByteIOContext *pb = s->pb; ++ uint8_t hdr[HDRSIZE]; ++ nuv_frametype frametype; ++ int size; ++ int64_t pos, dts; ++ ++ if (url_fseek(pb, *ppos, SEEK_SET) < 0) ++ return AV_NOPTS_VALUE; ++ ++ if (!nuv_resync(s, pos_limit)) ++ return AV_NOPTS_VALUE; ++ ++ while (!url_feof(pb) && url_ftell(pb) < pos_limit) { ++ if (get_buffer(pb, hdr, HDRSIZE) <= 0) ++ return AV_NOPTS_VALUE; ++ frametype = hdr[0]; ++ size = PKTSIZE(AV_RL32(&hdr[8])); ++ switch (frametype) { ++ case NUV_SEEKP: ++ break; ++ case NUV_AUDIO: ++ case NUV_VIDEO: ++ pos = url_ftell(s->pb) - HDRSIZE; ++ dts = AV_RL32(&hdr[4]); ++ // TODO - add general support in av_gen_search, so it adds positions after reading timestamps ++ av_add_index_entry(s->streams[frametype == NUV_VIDEO ? ctx->v_id : ctx->a_id] ++ , pos, dts, size + HDRSIZE, 0, hdr[2] == 0 ? AVINDEX_KEYFRAME : 0); ++ ++ if ((frametype == NUV_VIDEO && stream_index == ctx->v_id) || ++ (frametype == NUV_AUDIO && stream_index == ctx->a_id)) { ++ *ppos = pos; ++ return dts; ++ } ++ default: ++ url_fskip(pb, size); ++ break; ++ } ++ } ++ return AV_NOPTS_VALUE; ++} ++ ++ + AVInputFormat ff_nuv_demuxer = { + "nuv", + NULL_IF_CONFIG_SMALL("NuppelVideo format"), +@@ -266,5 +349,6 @@ AVInputFormat ff_nuv_demuxer = { + nuv_packet, + NULL, + NULL, ++ nuv_read_dts, + .flags = AVFMT_GENERIC_INDEX, + }; +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0005-fixed-5585-Media-file-gets-played-twice.-we-assume-a.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0005-fixed-5585-Media-file-gets-played-twice.-we-assume-a.patch new file mode 100644 index 00000000..29f2d9c2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0005-fixed-5585-Media-file-gets-played-twice.-we-assume-a.patch @@ -0,0 +1,35 @@ +From 0c18eecd120fac527942cd8609545bfba7566b27 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 01:45:48 -0400 +Subject: [PATCH 05/36] fixed: #5585 Media file gets played twice. we assume avi EOF when we can't find the next streams index entry for non interleaved files. + +--- + libavformat/avidec.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/libavformat/avidec.c b/libavformat/avidec.c +index 6b3e927..3d223b7 100644 +--- a/libavformat/avidec.c ++++ b/libavformat/avidec.c +@@ -898,7 +898,8 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt) + if(i>=0){ + int64_t pos= best_st->index_entries[i].pos; + pos += best_ast->packet_size - best_ast->remaining; +- url_fseek(s->pb, pos + 8, SEEK_SET); ++ if(url_fseek(s->pb, pos + 8, SEEK_SET) < 0) ++ return AVERROR_EOF; + // av_log(s, AV_LOG_DEBUG, "pos=%"PRId64"\n", pos); + + assert(best_ast->remaining <= best_ast->packet_size); +@@ -908,6 +909,8 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt) + best_ast->packet_size= + best_ast->remaining= best_st->index_entries[i].size; + } ++ else ++ return AVERROR_EOF; + } + + resync: +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0006-added-probe-file-header-for-cdxa.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0006-added-probe-file-header-for-cdxa.patch new file mode 100644 index 00000000..32177502 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0006-added-probe-file-header-for-cdxa.patch @@ -0,0 +1,46 @@ +From 88b4df4530410cd70ab0017a4415e2d040d16c1a Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 01:53:34 -0400 +Subject: [PATCH 06/36] added: probe file header for cdxa + +--- + libavformat/mpeg.c | 16 ++++++++++++++++ + 1 files changed, 16 insertions(+), 0 deletions(-) + +diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c +index 135482b..d3b849c 100644 +--- a/libavformat/mpeg.c ++++ b/libavformat/mpeg.c +@@ -50,6 +50,18 @@ static int check_pes(uint8_t *p, uint8_t *end){ + return pes1||pes2; + } + ++static int cdxa_probe(AVProbeData *p) ++{ ++ /* check file header */ ++ if (p->buf[0] == 'R' && p->buf[1] == 'I' && ++ p->buf[2] == 'F' && p->buf[3] == 'F' && ++ p->buf[8] == 'C' && p->buf[9] == 'D' && ++ p->buf[10] == 'X' && p->buf[11] == 'A') ++ return AVPROBE_SCORE_MAX; ++ else ++ return 0; ++} ++ + static int mpegps_probe(AVProbeData *p) + { + uint32_t code= -1; +@@ -57,6 +69,10 @@ static int mpegps_probe(AVProbeData *p) + int i; + int score=0; + ++ score = cdxa_probe(p); ++ if (score > 0) return score; ++ ++ /* Search for MPEG stream */ + for(i=0; ibuf_size; i++){ + code = (code<<8) + p->buf[i]; + if ((code & 0xffffff00) == 0x100) { +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0007-if-av_read_packet-returns-AVERROR_IO-we-are-done.-ff.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0007-if-av_read_packet-returns-AVERROR_IO-we-are-done.-ff.patch new file mode 100644 index 00000000..3c007aee --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0007-if-av_read_packet-returns-AVERROR_IO-we-are-done.-ff.patch @@ -0,0 +1,25 @@ +From d684ae10f93158ff4497187cc70bcaa2257a8639 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 01:55:31 -0400 +Subject: [PATCH 07/36] if av_read_packet returns AVERROR_IO, we are done. ffmpeg's codecs might or might not handle returning any completed demuxed packets correctly + +--- + libavformat/utils.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/libavformat/utils.c b/libavformat/utils.c +index 4f51c26..9fffaef 100644 +--- a/libavformat/utils.c ++++ b/libavformat/utils.c +@@ -1142,6 +1142,8 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) + if (ret < 0) { + if (ret == AVERROR(EAGAIN)) + return ret; ++ if (ret == AVERROR_IO) ++ return ret; + /* return the last frames, if any */ + for(i = 0; i < s->nb_streams; i++) { + st = s->streams[i]; +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0008-added-Ticket-7187-TV-Teletext-support-for-DVB-EBU-Te.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0008-added-Ticket-7187-TV-Teletext-support-for-DVB-EBU-Te.patch new file mode 100644 index 00000000..36ccab3e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0008-added-Ticket-7187-TV-Teletext-support-for-DVB-EBU-Te.patch @@ -0,0 +1,41 @@ +From d6d3554d4c312a739b71ac67db594fde2e297d46 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 02:10:50 -0400 +Subject: [PATCH 08/36] added: Ticket #7187, TV Teletext support for DVB EBU Teletext streams + +--- + libavcodec/avcodec.h | 4 ++++ + libavformat/mpegts.c | 2 ++ + 2 files changed, 6 insertions(+), 0 deletions(-) + +diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h +index d0de610..4745980 100644 +--- a/libavcodec/avcodec.h ++++ b/libavcodec/avcodec.h +@@ -400,6 +400,10 @@ enum CodecID { + CODEC_ID_DVB_TELETEXT, + CODEC_ID_SRT, + ++ /* data codecs */ ++ CODEC_ID_VBI_DATA= 0x17500, ++ CODEC_ID_VBI_TELETEXT, ++ + /* other specific kind of codecs (generally used for attachments) */ + CODEC_ID_TTF= 0x18000, + +diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c +index 8467e85..d550e3e 100644 +--- a/libavformat/mpegts.c ++++ b/libavformat/mpegts.c +@@ -536,6 +536,8 @@ static const StreamType DESC_types[] = { + { 0x7b, AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS }, + { 0x56, AVMEDIA_TYPE_SUBTITLE, CODEC_ID_DVB_TELETEXT }, + { 0x59, AVMEDIA_TYPE_SUBTITLE, CODEC_ID_DVB_SUBTITLE }, /* subtitling descriptor */ ++ { 0x45, AVMEDIA_TYPE_DATA, CODEC_ID_VBI_DATA }, /* VBI Data descriptor */ ++ { 0x46, AVMEDIA_TYPE_DATA, CODEC_ID_VBI_TELETEXT }, /* VBI Teletext descriptor */ + { 0 }, + }; + +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0009-additional-HDMV-types-and-reg-descriptors.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0009-additional-HDMV-types-and-reg-descriptors.patch new file mode 100644 index 00000000..cfa85ca7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0009-additional-HDMV-types-and-reg-descriptors.patch @@ -0,0 +1,36 @@ +From 576a80321fbb6a6f4c4e69af75440e94990498bc Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 02:15:41 -0400 +Subject: [PATCH 09/36] additional HDMV types and reg descriptors + +--- + libavformat/mpegts.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c +index d550e3e..74b0886 100644 +--- a/libavformat/mpegts.c ++++ b/libavformat/mpegts.c +@@ -512,6 +512,8 @@ static const StreamType HDMV_types[] = { + { 0x82, AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS }, + { 0x83, AVMEDIA_TYPE_AUDIO, CODEC_ID_TRUEHD }, + { 0x84, AVMEDIA_TYPE_AUDIO, CODEC_ID_EAC3 }, ++ { 0x85, AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS }, /* DTS HD */ ++ { 0x86, AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS }, /* DTS HD MASTER*/ + { 0x90, AVMEDIA_TYPE_SUBTITLE, CODEC_ID_HDMV_PGS_SUBTITLE }, + { 0 }, + }; +@@ -526,6 +528,10 @@ static const StreamType MISC_types[] = { + static const StreamType REGD_types[] = { + { MKTAG('d','r','a','c'), AVMEDIA_TYPE_VIDEO, CODEC_ID_DIRAC }, + { MKTAG('A','C','-','3'), AVMEDIA_TYPE_AUDIO, CODEC_ID_AC3 }, ++ { MKTAG('D','T','S','1'), AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS }, ++ { MKTAG('D','T','S','2'), AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS }, ++ { MKTAG('D','T','S','3'), AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS }, ++ { MKTAG('V','C','-','1'), AVMEDIA_TYPE_VIDEO, CODEC_ID_VC1 }, + { 0 }, + }; + +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0010-don-t-reparse-PMT-unless-it-s-version-has-changed-re.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0010-don-t-reparse-PMT-unless-it-s-version-has-changed-re.patch new file mode 100644 index 00000000..36389ff7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0010-don-t-reparse-PMT-unless-it-s-version-has-changed-re.patch @@ -0,0 +1,61 @@ +From 45f65bca80b6d4cfd52a141c0d666c5050419960 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 02:40:23 -0400 +Subject: [PATCH 10/36] don't reparse PMT unless it's version has changed readded: don't accept PMT that isn't current + +--- + libavformat/mpegts.c | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c +index 74b0886..c355852 100644 +--- a/libavformat/mpegts.c ++++ b/libavformat/mpegts.c +@@ -73,6 +73,7 @@ typedef struct MpegTSSectionFilter { + struct MpegTSFilter { + int pid; + int last_cc; /* last cc code (-1 if first packet) */ ++ int last_version; /* last version of data on this pid */ + enum MpegTSFilterType type; + union { + MpegTSPESFilter pes_filter; +@@ -301,6 +302,7 @@ static MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int + filter->type = MPEGTS_SECTION; + filter->pid = pid; + filter->last_cc = -1; ++ filter->last_version = -1; + sec = &filter->u.section_filter; + sec->section_cb = section_cb; + sec->opaque = opaque; +@@ -403,6 +405,7 @@ typedef struct SectionHeader { + uint8_t tid; + uint16_t id; + uint8_t version; ++ uint8_t current; + uint8_t sec_num; + uint8_t last_sec_num; + } SectionHeader; +@@ -474,6 +477,7 @@ static int parse_section_header(SectionHeader *h, + val = get8(pp, p_end); + if (val < 0) + return -1; ++ h->current = val & 0x1; + h->version = (val >> 1) & 0x1f; + val = get8(pp, p_end); + if (val < 0) +@@ -1124,6 +1128,12 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len + return; + if (h->tid != PAT_TID) + return; ++ if (!h->current) ++ return; ++ if (h->version == filter->last_version) ++ return; ++ filter->last_version = h->version; ++ av_dlog(ts->stream, "version=%d\n", filter->last_version); + + clear_programs(ts); + for(;;) { +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0011-mingw-workaround.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0011-mingw-workaround.patch new file mode 100644 index 00000000..9b84de14 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0011-mingw-workaround.patch @@ -0,0 +1,36 @@ +From c39cf2c1c78b4d1485adb0b6c7e1566beecc1e9f Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 02:49:03 -0400 +Subject: [PATCH 11/36] mingw workaround + +--- + configure | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 46f4e44..5931f35 100755 +--- a/configure ++++ b/configure +@@ -2921,7 +2921,8 @@ check_cflags -Wcast-qual + check_cflags -Wwrite-strings + check_cflags -Wtype-limits + check_cflags -Wundef +-check_cflags -Wmissing-prototypes ++# some gcc compilers (mingw 4.2.1-sjlj) are b0rk so for now skip this ++# check_cflags -Wmissing-prototypes + enabled extra_warnings && check_cflags -Winline + + # add some linker flags +@@ -2986,7 +2987,8 @@ elif enabled ccc; then + elif enabled gcc; then + check_cflags -fno-tree-vectorize + check_cflags -Werror=implicit-function-declaration +- check_cflags -Werror=missing-prototypes ++# some gcc compilers (mingw 4.2.1-sjlj) are b0rk so for now skip this ++# check_cflags -Werror=missing-prototypes + elif enabled llvm_gcc; then + check_cflags -mllvm -stack-alignment=16 + elif enabled clang; then +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0012-dvdsub-hacks.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0012-dvdsub-hacks.patch new file mode 100644 index 00000000..df3bccf6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0012-dvdsub-hacks.patch @@ -0,0 +1,181 @@ +From 61baf585e90935869b4c71b406f5ba70a75211e8 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 02:50:45 -0400 +Subject: [PATCH 12/36] dvdsub hacks + +--- + libavcodec/dvdsubdec.c | 99 ++++++++++++++++++++++++++++++++++++++++++----- + 1 files changed, 88 insertions(+), 11 deletions(-) + +diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c +index bea2646..e713e24 100644 +--- a/libavcodec/dvdsubdec.c ++++ b/libavcodec/dvdsubdec.c +@@ -25,6 +25,14 @@ + + //#define DEBUG + ++typedef struct DVDSubContext ++{ ++ uint8_t colormap[4]; ++ uint8_t alpha[4]; ++ uint32_t palette[16]; ++ int has_palette; ++} DVDSubContext; ++ + static void yuv_a_to_rgba(const uint8_t *ycbcr, const uint8_t *alpha, uint32_t *rgba, int num_values) + { + uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; +@@ -42,6 +50,24 @@ static void yuv_a_to_rgba(const uint8_t *ycbcr, const uint8_t *alpha, uint32_t * + } + } + ++static void ayvu_to_argb(const uint8_t *ayvu, uint32_t *argb, int num_values) ++{ ++ uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; ++ uint8_t r, g, b; ++ int i, y, cb, cr, a; ++ int r_add, g_add, b_add; ++ ++ for (i = num_values; i > 0; i--) { ++ a = *ayvu++; ++ y = *ayvu++; ++ cr = *ayvu++; ++ cb = *ayvu++; ++ YUV_TO_RGB1_CCIR(cb, cr); ++ YUV_TO_RGB2_CCIR(r, g, b, y); ++ *argb++ = (a << 24) | (r << 16) | (g << 8) | b; ++ } ++} ++ + static int decode_run_2bit(GetBitContext *gb, int *color) + { + unsigned int v, t; +@@ -115,13 +141,21 @@ static int decode_rle(uint8_t *bitmap, int linesize, int w, int h, + return 0; + } + +-static void guess_palette(uint32_t *rgba_palette, +- uint8_t *colormap, +- uint8_t *alpha, +- uint32_t subtitle_color) ++static void fill_palette(DVDSubContext* ctx, ++ uint32_t *rgba_palette, ++ uint32_t subtitle_color) + { + uint8_t color_used[16]; + int nb_opaque_colors, i, level, j, r, g, b; ++ uint8_t *colormap = ctx->colormap; ++ uint8_t *alpha = ctx->alpha; ++ ++ if(ctx->has_palette) { ++ for(i = 0; i < 4; i++) ++ rgba_palette[i] = (ctx->palette[ctx->colormap[i]] & 0x00ffffff) ++ | ((alpha[i] * 17) << 24); ++ return; ++ } + + for(i = 0; i < 4; i++) + rgba_palette[i] = 0; +@@ -160,13 +194,14 @@ static void guess_palette(uint32_t *rgba_palette, + + #define READ_OFFSET(a) (big_offsets ? AV_RB32(a) : AV_RB16(a)) + +-static int decode_dvd_subtitles(AVSubtitle *sub_header, ++static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header, + const uint8_t *buf, int buf_size) + { + int cmd_pos, pos, cmd, x1, y1, x2, y2, offset1, offset2, next_cmd_pos; + int big_offsets, offset_size, is_8bit = 0; + const uint8_t *yuv_palette = 0; +- uint8_t colormap[4], alpha[256]; ++ uint8_t *colormap = ctx->colormap; ++ uint8_t *alpha = ctx->alpha; + int date; + int i; + int is_menu = 0; +@@ -326,8 +361,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header, + yuv_a_to_rgba(yuv_palette, alpha, (uint32_t*)sub_header->rects[0]->pict.data[1], 256); + } else { + sub_header->rects[0]->nb_colors = 4; +- guess_palette((uint32_t*)sub_header->rects[0]->pict.data[1], +- colormap, alpha, 0xffff00); ++ fill_palette(ctx, sub_header->rects[0]->pict.data[1], 0xffff00); + } + sub_header->rects[0]->x = x1; + sub_header->rects[0]->y = y1; +@@ -458,12 +492,13 @@ static int dvdsub_decode(AVCodecContext *avctx, + void *data, int *data_size, + AVPacket *avpkt) + { ++ DVDSubContext *ctx = (DVDSubContext*) avctx->priv_data; + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + AVSubtitle *sub = data; + int is_menu; + +- is_menu = decode_dvd_subtitles(sub, buf, buf_size); ++ is_menu = decode_dvd_subtitles(ctx, sub, buf, buf_size); + + if (is_menu < 0) { + no_subtitle: +@@ -486,12 +521,54 @@ static int dvdsub_decode(AVCodecContext *avctx, + return buf_size; + } + ++static int dvdsub_init(AVCodecContext *avctx) ++{ ++ DVDSubContext *ctx = (DVDSubContext*) avctx->priv_data; ++ char *data = avctx->extradata; ++ ++ if (!avctx->extradata || !avctx->extradata_size) ++ return 1; ++ ++ data[avctx->extradata_size] = '\0'; ++ ++ for(;;) { ++ int pos = strcspn(data, "\n\r"); ++ if (pos==0 && *data==0) ++ break; ++ ++ if (strncmp("palette:", data, 8) == 0) { ++ int i; ++ char *p = data+8; ++ ctx->has_palette = 1; ++ for(i=0;i<16;i++) { ++ ctx->palette[i] = strtoul(p, &p, 16); ++ while(*p == ',' || isspace(*p)) ++ p++; ++ } ++#if defined(DEBUG) ++ av_log(avctx, AV_LOG_INFO, "palette:"); ++ for(i=0;i<16;i++) ++ av_log(avctx, AV_LOG_WARNING, " 0x%06x", ctx->palette[i]); ++ av_log(avctx, AV_LOG_INFO, "\n"); ++#endif ++ } ++ ++ data += pos; ++ data += strspn(data, "\n\r"); ++ } ++ ++ if(!ctx->has_palette && avctx->extradata_size == 64) ++ ayvu_to_argb((uint8_t*)avctx->extradata, ctx->palette, 16); ++ ++ return 1; ++} ++ + AVCodec ff_dvdsub_decoder = { + "dvdsub", + AVMEDIA_TYPE_SUBTITLE, + CODEC_ID_DVD_SUBTITLE, +- 0, +- NULL, ++ sizeof(DVDSubContext), ++ dvdsub_init, + NULL, + NULL, + dvdsub_decode, +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0013-fixed-compile-with-VDPAU-header-versions-without-MPE.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0013-fixed-compile-with-VDPAU-header-versions-without-MPE.patch new file mode 100644 index 00000000..aab4bd41 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0013-fixed-compile-with-VDPAU-header-versions-without-MPE.patch @@ -0,0 +1,69 @@ +From fc37326404fffb66fefd03ec5057b3864954e693 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 03:04:26 -0400 +Subject: [PATCH 13/36] fixed: compile with VDPAU header versions without MPEG4 support. + +See http://repo.or.cz/w/FFMpeg-mirror/mplayer-patches.git/commitdiff/136c16af11076153717d3de31c9d84360644e006 +--- + configure | 3 +++ + libavcodec/vdpau.c | 2 ++ + libavcodec/vdpau.h | 2 ++ + 3 files changed, 7 insertions(+), 0 deletions(-) + +diff --git a/configure b/configure +index 5931f35..83d9b87 100755 +--- a/configure ++++ b/configure +@@ -1261,6 +1261,7 @@ mpeg2_dxva2_hwaccel_deps="dxva2api_h" + mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder" + mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder" + mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder" ++mpeg4_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h vdpau_mpeg4_support" + mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder" + mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h" + mpeg_xvmc_decoder_select="mpegvideo_decoder" +@@ -2757,6 +2758,8 @@ check_header sys/select.h + check_header termios.h + check_header vdpau/vdpau.h + check_header vdpau/vdpau_x11.h ++check_cpp_condition vdpau/vdpau.h "defined(VDP_DECODER_PROFILE_MPEG4_PART2_SP)" && enable vdpau_mpeg4_support ++ + check_header X11/extensions/XvMClib.h + + check_struct dxva2api.h DXVA_PictureParameters wDecodedPictureIndex +diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c +index bd721e8..54fdcd6 100644 +--- a/libavcodec/vdpau.c ++++ b/libavcodec/vdpau.c +@@ -315,6 +315,7 @@ void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf, + render->bitstream_buffers_used = 0; + } + ++#ifdef VDP_DECODER_PROFILE_MPEG4_PART2_SP + void ff_vdpau_mpeg4_decode_picture(MpegEncContext *s, const uint8_t *buf, + int buf_size) + { +@@ -368,5 +369,6 @@ void ff_vdpau_mpeg4_decode_picture(MpegEncContext *s, const uint8_t *buf, + ff_draw_horiz_band(s, 0, s->avctx->height); + render->bitstream_buffers_used = 0; + } ++#endif + + /* @}*/ +diff --git a/libavcodec/vdpau.h b/libavcodec/vdpau.h +index ab5f682..b8cc37d 100644 +--- a/libavcodec/vdpau.h ++++ b/libavcodec/vdpau.h +@@ -72,7 +72,9 @@ struct vdpau_render_state { + VdpPictureInfoH264 h264; + VdpPictureInfoMPEG1Or2 mpeg; + VdpPictureInfoVC1 vc1; ++#ifdef VDP_DECODER_PROFILE_MPEG4_PART2_SP + VdpPictureInfoMPEG4Part2 mpeg4; ++#endif + } info; + + /** Describe size/location of the compressed video data. +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0014-changed-check-some-more-url_fseeks-in-asf-demuxer-to.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0014-changed-check-some-more-url_fseeks-in-asf-demuxer-to.patch new file mode 100644 index 00000000..c1960410 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0014-changed-check-some-more-url_fseeks-in-asf-demuxer-to.patch @@ -0,0 +1,39 @@ +From 9f19ad85257c413cf6c1facb6dc49efa8a10b6b3 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 22:27:09 -0400 +Subject: [PATCH 14/36] changed: check some more url_fseeks in asf demuxer to avoid problems if file system is unseekable + +--- + libavformat/asfdec.c | 9 +++++++-- + 1 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c +index 2bda885..4347601 100644 +--- a/libavformat/asfdec.c ++++ b/libavformat/asfdec.c +@@ -1058,7 +1058,8 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos, + if (s->packet_size > 0) + pos= (pos+s->packet_size-1-s->data_offset)/s->packet_size*s->packet_size+ s->data_offset; + *ppos= pos; +- url_fseek(s->pb, pos, SEEK_SET); ++ if (url_fseek(s->pb, pos, SEEK_SET) < 0) ++ return AV_NOPTS_VALUE; + + //printf("asf_read_pts\n"); + asf_reset_header(s); +@@ -1100,7 +1101,11 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index) + int64_t current_pos= url_ftell(s->pb); + int i; + +- url_fseek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET); ++ if(url_fseek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET) < 0) { ++ asf->index_read= -1; ++ return; ++ } ++ + ff_get_guid(s->pb, &g); + + /* the data object can be followed by other top-level objects, +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0015-Fix-7956-Adds-DTS-detection-to-MOV-files-ffmpeg-issu.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0015-Fix-7956-Adds-DTS-detection-to-MOV-files-ffmpeg-issu.patch new file mode 100644 index 00000000..113d42a7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0015-Fix-7956-Adds-DTS-detection-to-MOV-files-ffmpeg-issu.patch @@ -0,0 +1,24 @@ +From ead553179b4b145c4fd10af1bc9f827877bc559f Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 22:33:07 -0400 +Subject: [PATCH 15/36] Fix #7956 - Adds DTS detection to MOV files (ffmpeg issue 1726) + +--- + libavformat/isom.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/libavformat/isom.c b/libavformat/isom.c +index 23ef82a..013cca7 100644 +--- a/libavformat/isom.c ++++ b/libavformat/isom.c +@@ -230,6 +230,7 @@ const AVCodecTag codec_movaudio_tags[] = { + { CODEC_ID_AAC, MKTAG('m', 'p', '4', 'a') }, /* MPEG-4 AAC */ + { CODEC_ID_AC3, MKTAG('a', 'c', '-', '3') }, /* ETSI TS 102 366 Annex F */ + { CODEC_ID_AC3, MKTAG('s', 'a', 'c', '3') }, /* Nero Recode */ ++ { CODEC_ID_DTS, MKTAG('D', 'T', 'S', ' ') }, /* DTS */ + + { CODEC_ID_AMR_NB, MKTAG('s', 'a', 'm', 'r') }, /* AMR-NB 3gp */ + { CODEC_ID_AMR_WB, MKTAG('s', 'a', 'w', 'b') }, /* AMR-WB 3gp */ +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0016-changed-only-require-first-packet-to-be-known-for-al.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0016-changed-only-require-first-packet-to-be-known-for-al.patch new file mode 100644 index 00000000..10710c3f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0016-changed-only-require-first-packet-to-be-known-for-al.patch @@ -0,0 +1,25 @@ +From f532df8280652147a86c12ce3701060b1d130d45 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 22:45:32 -0400 +Subject: [PATCH 16/36] changed: only require first packet to be known for all audio and video streams + +--- + libavformat/utils.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libavformat/utils.c b/libavformat/utils.c +index 9fffaef..ddb0ae3 100644 +--- a/libavformat/utils.c ++++ b/libavformat/utils.c +@@ -2263,7 +2263,7 @@ int av_find_stream_info(AVFormatContext *ic) + break; + if(st->parser && st->parser->parser->split && !st->codec->extradata) + break; +- if(st->first_dts == AV_NOPTS_VALUE) ++ if(st->first_dts == AV_NOPTS_VALUE && (st->codec->codec_type == AVMEDIA_TYPE_VIDEO || st->codec->codec_type == AVMEDIA_TYPE_AUDIO)) + break; + } + if (i == ic->nb_streams) { +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0017-Don-t-assume-reading-more-frames-in-av_find_stream_i.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0017-Don-t-assume-reading-more-frames-in-av_find_stream_i.patch new file mode 100644 index 00000000..6ab417da --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0017-Don-t-assume-reading-more-frames-in-av_find_stream_i.patch @@ -0,0 +1,25 @@ +From d3fb4761b262301398e013c703382d3f54f7a1f5 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 22:46:49 -0400 +Subject: [PATCH 17/36] Don't assume reading more frames in av_find_stream_info will change a CODEC_ID_NONE into something better + +--- + libavformat/utils.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libavformat/utils.c b/libavformat/utils.c +index ddb0ae3..26072c4 100644 +--- a/libavformat/utils.c ++++ b/libavformat/utils.c +@@ -2050,7 +2050,7 @@ static int has_codec_parameters(AVCodecContext *enc) + val = 1; + break; + } +- return enc->codec_id != CODEC_ID_NONE && val != 0; ++ return enc->codec_id != CODEC_ID_PROBE && val != 0; + } + + static int has_decode_delay_been_guessed(AVStream *st) +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0018-changed-don-t-override-file-duration-with-bitrate-du.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0018-changed-don-t-override-file-duration-with-bitrate-du.patch new file mode 100644 index 00000000..e36518cf --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0018-changed-don-t-override-file-duration-with-bitrate-du.patch @@ -0,0 +1,43 @@ +From 9bbf094291649cf50d3e2c67f28185126f402b55 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Mon, 28 Jun 2010 22:49:06 -0400 +Subject: [PATCH 18/36] changed: don't override file duration with bitrate duration for matroska files + +--- + libavformat/utils.c | 8 +++++--- + 1 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/libavformat/utils.c b/libavformat/utils.c +index 26072c4..ad5fb83 100644 +--- a/libavformat/utils.c ++++ b/libavformat/utils.c +@@ -1788,6 +1788,8 @@ static int av_has_duration(AVFormatContext *ic) + { + int i; + AVStream *st; ++ if(ic->duration != AV_NOPTS_VALUE) ++ return 1; + + for(i = 0;i < ic->nb_streams; i++) { + st = ic->streams[i]; +@@ -1838,14 +1840,14 @@ static void av_update_stream_timings(AVFormatContext *ic) + duration = end_time - start_time; + } + } +- if (duration != INT64_MIN) { ++ if (duration != INT64_MIN && ic->duration == AV_NOPTS_VALUE) { + ic->duration = duration; +- if (ic->file_size > 0) { ++ } ++ if (ic->file_size > 0 && ic->duration != AV_NOPTS_VALUE) { + /* compute the bitrate */ + ic->bit_rate = (double)ic->file_size * 8.0 * AV_TIME_BASE / + (double)ic->duration; + } +- } + } + + static void fill_all_stream_timings(AVFormatContext *ic) +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0019-changed-check-for-seek-error-when-attempting-to-read.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0019-changed-check-for-seek-error-when-attempting-to-read.patch new file mode 100644 index 00000000..2dcc85c6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0019-changed-check-for-seek-error-when-attempting-to-read.patch @@ -0,0 +1,27 @@ +From d4a0766af6b82ab3c99a56c726ec66cada0da6de Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Fri, 9 Jul 2010 15:21:10 -0400 +Subject: [PATCH 19/36] changed: check for seek error when attempting to read timestamp in rm demuxer + +--- + libavformat/rmdec.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c +index da7e6b2..94bfc43 100644 +--- a/libavformat/rmdec.c ++++ b/libavformat/rmdec.c +@@ -904,7 +904,9 @@ static int64_t rm_read_dts(AVFormatContext *s, int stream_index, + if(rm->old_format) + return AV_NOPTS_VALUE; + +- url_fseek(s->pb, pos, SEEK_SET); ++ if (url_fseek(s->pb, pos, SEEK_SET) < 0) ++ return AV_NOPTS_VALUE; ++ + rm->remaining_len=0; + for(;;){ + int seq=1; +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0020-fixed-wrong-fps-for-rmvb-files-patch-by-taxigps.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0020-fixed-wrong-fps-for-rmvb-files-patch-by-taxigps.patch new file mode 100644 index 00000000..cde7f7a6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0020-fixed-wrong-fps-for-rmvb-files-patch-by-taxigps.patch @@ -0,0 +1,38 @@ +From a10bd5edd13e8aff5e81bd1c8dddebde1698ed36 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Fri, 9 Jul 2010 15:22:09 -0400 +Subject: [PATCH 20/36] fixed: wrong fps for rmvb files (patch by taxigps) + +--- + libavformat/rmdec.c | 7 +++---- + 1 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c +index 94bfc43..8b59b1d 100644 +--- a/libavformat/rmdec.c ++++ b/libavformat/rmdec.c +@@ -294,18 +294,17 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, ByteIOContext *pb, + goto fail1; + st->codec->width = get_be16(pb); + st->codec->height = get_be16(pb); +- st->codec->time_base.num= 1; ++ st->codec->time_base.num= 1 << 16; + fps= get_be16(pb); + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + get_be32(pb); +- fps2= get_be16(pb); +- get_be16(pb); ++ fps2= get_be32(pb); + + if ((ret = rm_read_extradata(pb, st->codec, codec_data_size - (url_ftell(pb) - codec_pos))) < 0) + return ret; + + // av_log(s, AV_LOG_DEBUG, "fps= %d fps2= %d\n", fps, fps2); +- st->codec->time_base.den = fps * st->codec->time_base.num; ++ st->codec->time_base.den = fps2; + //XXX: do we really need that? + switch(st->codec->extradata[4]>>4){ + case 1: st->codec->codec_id = CODEC_ID_RV10; break; +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0021-fixed-when-playing-mpegts-over-rtp-rtsp-sdp-lavf-mus.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0021-fixed-when-playing-mpegts-over-rtp-rtsp-sdp-lavf-mus.patch new file mode 100644 index 00000000..d1b3f2c9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0021-fixed-when-playing-mpegts-over-rtp-rtsp-sdp-lavf-mus.patch @@ -0,0 +1,26 @@ +From f8a01f09195302ca630c28d3cabe7a6682c85f96 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Fri, 9 Jul 2010 15:24:00 -0400 +Subject: [PATCH 21/36] fixed: when playing mpegts over rtp/rtsp/sdp, lavf must still read PAT/SDT to get available streams + +--- + libavformat/mpegts.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c +index c355852..3f7098f 100644 +--- a/libavformat/mpegts.c ++++ b/libavformat/mpegts.c +@@ -1817,6 +1817,9 @@ MpegTSContext *ff_mpegts_parse_open(AVFormatContext *s) + ts->raw_packet_size = TS_PACKET_SIZE; + ts->stream = s; + ts->auto_guess = 1; ++ mpegts_open_section_filter(ts, SDT_PID, sdt_cb, ts, 1); ++ mpegts_open_section_filter(ts, PAT_PID, pat_cb, ts, 1); ++ + return ts; + } + +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0022-don-t-hardcode-subtitle-colors-to-16.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0022-don-t-hardcode-subtitle-colors-to-16.patch new file mode 100644 index 00000000..bd5755bf --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0022-don-t-hardcode-subtitle-colors-to-16.patch @@ -0,0 +1,25 @@ +From 31ec1522bb763dac0e77788a989ac3690de5a7ca Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Fri, 9 Jul 2010 16:15:55 -0400 +Subject: [PATCH 22/36] don't hardcode subtitle colors to 16 + +--- + libavcodec/dvbsubdec.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c +index 0f1e004..e68a0b3 100644 +--- a/libavcodec/dvbsubdec.c ++++ b/libavcodec/dvbsubdec.c +@@ -1357,7 +1357,7 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf, + rect->y = display->y_pos + offset_y; + rect->w = region->width; + rect->h = region->height; +- rect->nb_colors = 16; ++ rect->nb_colors = (1 << region->depth); + rect->type = SUBTITLE_BITMAP; + rect->pict.linesize[0] = region->width; + +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0023-improved-mpegts-seeking.-NEEDS-REVIEW.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0023-improved-mpegts-seeking.-NEEDS-REVIEW.patch new file mode 100644 index 00000000..096c51f6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0023-improved-mpegts-seeking.-NEEDS-REVIEW.patch @@ -0,0 +1,147 @@ +From 5670d7996bbe5489ee02cd87dc44280af8d30cd4 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Fri, 9 Jul 2010 16:43:31 -0400 +Subject: [PATCH 23/36] improved mpegts seeking. NEEDS REVIEW + +--- + libavformat/mpegts.c | 84 ++++++++++++++++++++++++++++++++++++------------- + 1 files changed, 61 insertions(+), 23 deletions(-) + +diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c +index 3f7098f..2fc0089 100644 +--- a/libavformat/mpegts.c ++++ b/libavformat/mpegts.c +@@ -1451,6 +1451,44 @@ static int parse_pcr(int64_t *ppcr_high, int *ppcr_low, + return 0; + } + ++static int parse_timestamp(int64_t *ts, const uint8_t *buf) ++{ ++ int afc, flags; ++ const uint8_t *p; ++ ++ if(!(buf[1] & 0x40)) /* must be a start packet */ ++ return -1; ++ ++ afc = (buf[3] >> 4) & 3; ++ p = buf + 4; ++ if (afc == 0 || afc == 2) /* invalid or only adaption field */ ++ return -1; ++ if (afc == 3) ++ p += p[0] + 1; ++ if (p >= buf + TS_PACKET_SIZE) ++ return -1; ++ ++ if (p[0] != 0x00 || p[1] != 0x00 || p[2] != 0x01) /* packet_start_code_prefix */ ++ return -1; ++ ++ flags = p[3] | 0x100; /* stream type */ ++ if (!((flags >= 0x1c0 && flags <= 0x1df) || ++ (flags >= 0x1e0 && flags <= 0x1ef) || ++ (flags == 0x1bd) || (flags == 0x1fd))) ++ return -1; ++ ++ flags = p[7]; ++ if ((flags & 0xc0) == 0x80) { ++ *ts = ff_parse_pes_pts(p+9); ++ return 0; ++ } else if ((flags & 0xc0) == 0xc0) { ++ *ts = ff_parse_pes_pts(p+9+5); ++ return 0; ++ } ++ return -1; ++} ++ ++ + static int mpegts_read_header(AVFormatContext *s, + AVFormatParameters *ap) + { +@@ -1660,38 +1698,39 @@ static int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index, + int64_t pos, timestamp; + uint8_t buf[TS_PACKET_SIZE]; + int pcr_l, pcr_pid = ((PESContext*)s->streams[stream_index]->priv_data)->pcr_pid; +- const int find_next= 1; ++ int pid = ((PESContext*)s->streams[stream_index]->priv_data)->pid; + pos = ((*ppos + ts->raw_packet_size - 1 - ts->pos47) / ts->raw_packet_size) * ts->raw_packet_size + ts->pos47; +- if (find_next) { +- for(;;) { +- url_fseek(s->pb, pos, SEEK_SET); ++ while(pos < pos_limit) { ++ if (url_fseek(s->pb, pos, SEEK_SET) < 0) ++ return AV_NOPTS_VALUE; + if (get_buffer(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE) + return AV_NOPTS_VALUE; +- if ((pcr_pid < 0 || (AV_RB16(buf + 1) & 0x1fff) == pcr_pid) && +- parse_pcr(×tamp, &pcr_l, buf) == 0) { +- break; +- } +- pos += ts->raw_packet_size; +- } +- } else { +- for(;;) { +- pos -= ts->raw_packet_size; +- if (pos < 0) +- return AV_NOPTS_VALUE; +- url_fseek(s->pb, pos, SEEK_SET); +- if (get_buffer(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE) ++ if (buf[0] != 0x47) { ++ url_fseek(s->pb, -TS_PACKET_SIZE, SEEK_CUR); ++ if (mpegts_resync(s) < 0) + return AV_NOPTS_VALUE; ++ pos = url_ftell(s->pb); ++ continue; ++ } + if ((pcr_pid < 0 || (AV_RB16(buf + 1) & 0x1fff) == pcr_pid) && + parse_pcr(×tamp, &pcr_l, buf) == 0) { +- break; +- } +- } ++ *ppos = pos; ++ return timestamp; + } ++ ++ if ((pid < 0 || (AV_RB16(buf + 1) & 0x1fff) == pid) && ++ parse_timestamp(×tamp, buf) == 0) { + *ppos = pos; + + return timestamp; + } + ++ pos += ts->raw_packet_size; ++ } ++ ++ return AV_NOPTS_VALUE; ++} ++ + #ifdef USE_SYNCPOINT_SEARCH + + static int read_seek2(AVFormatContext *s, +@@ -1796,7 +1835,6 @@ static int read_seek(AVFormatContext *s, int stream_index, int64_t target_ts, in + if(buf[1] & 0x40) break; + pos += ts->raw_packet_size; + } +- url_fseek(s->pb, pos, SEEK_SET); + + return 0; + } +@@ -1867,7 +1905,7 @@ AVInputFormat ff_mpegts_demuxer = { + mpegts_read_header, + mpegts_read_packet, + mpegts_read_close, +- read_seek, ++ NULL, + mpegts_get_pcr, + .flags = AVFMT_SHOW_IDS|AVFMT_TS_DISCONT, + #ifdef USE_SYNCPOINT_SEARCH +@@ -1883,7 +1921,7 @@ AVInputFormat ff_mpegtsraw_demuxer = { + mpegts_read_header, + mpegts_raw_read_packet, + mpegts_read_close, +- read_seek, ++ NULL, + mpegts_get_pcr, + .flags = AVFMT_SHOW_IDS|AVFMT_TS_DISCONT, + #ifdef USE_SYNCPOINT_SEARCH +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0024-get-accurate-estimate-from-the-PTSes.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0024-get-accurate-estimate-from-the-PTSes.patch new file mode 100644 index 00000000..101687b5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0024-get-accurate-estimate-from-the-PTSes.patch @@ -0,0 +1,71 @@ +From 3f7dbc76fbb3d13cc5816ef29771c125f701f142 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Fri, 9 Jul 2010 16:47:58 -0400 +Subject: [PATCH 24/36] get accurate estimate from the PTSes + +--- + libavformat/utils.c | 41 +++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 41 insertions(+), 0 deletions(-) + +diff --git a/libavformat/utils.c b/libavformat/utils.c +index ad5fb83..fe3b453 100644 +--- a/libavformat/utils.c ++++ b/libavformat/utils.c +@@ -1982,6 +1982,43 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset + } + } + ++static void av_estimate_timings_from_pts2(AVFormatContext *ic, int64_t old_offset) ++{ ++ AVStream *st; ++ int i, step= 1024; ++ int64_t ts, pos; ++ ++ for(i=0;inb_streams;i++) { ++ st = ic->streams[i]; ++ ++ pos = 0; ++ ts = ic->iformat->read_timestamp(ic, i, &pos, DURATION_MAX_READ_SIZE); ++ if (ts == AV_NOPTS_VALUE) ++ continue; ++ if (st->start_time == AV_NOPTS_VALUE || ++ st->start_time > ts) ++ st->start_time = ts; ++ ++ pos = url_fsize(ic->pb) - 1; ++ do { ++ pos -= step; ++ ts = ic->iformat->read_timestamp(ic, i, &pos, pos + step); ++ step += step; ++ } while (ts == AV_NOPTS_VALUE && pos >= step && step < DURATION_MAX_READ_SIZE); ++ ++ if (ts == AV_NOPTS_VALUE) ++ continue; ++ ++ if (st->duration == AV_NOPTS_VALUE ++ || st->duration < ts - st->start_time) ++ st->duration = ts - st->start_time; ++ } ++ ++ fill_all_stream_timings(ic); ++ ++ url_fseek(ic->pb, old_offset, SEEK_SET); ++} ++ + static void av_estimate_timings(AVFormatContext *ic, int64_t old_offset) + { + int64_t file_size; +@@ -2005,6 +2042,10 @@ static void av_estimate_timings(AVFormatContext *ic, int64_t old_offset) + /* at least one component has timings - we use them for all + the components */ + fill_all_stream_timings(ic); ++ } else if (ic->iformat->read_timestamp && ++ file_size && !url_is_streamed(ic->pb)) { ++ /* get accurate estimate from the PTSes */ ++ av_estimate_timings_from_pts2(ic, old_offset); + } else { + av_log(ic, AV_LOG_WARNING, "Estimating duration from bitrate, this may be inaccurate\n"); + /* less precise: use bitrate info */ +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0025-include-stdint.h.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0025-include-stdint.h.patch new file mode 100644 index 00000000..c3a21916 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0025-include-stdint.h.patch @@ -0,0 +1,24 @@ +From d4fac342fd23faeb47a3f9c453a7af14c28de158 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Fri, 9 Jul 2010 16:49:01 -0400 +Subject: [PATCH 25/36] include stdint.h + +--- + libavutil/common.h | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/libavutil/common.h b/libavutil/common.h +index 6404076..b5cd8df 100644 +--- a/libavutil/common.h ++++ b/libavutil/common.h +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + #include +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0026-add-files-needed-for-xbmc-win32-build.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0026-add-files-needed-for-xbmc-win32-build.patch new file mode 100644 index 00000000..a0344ef2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0026-add-files-needed-for-xbmc-win32-build.patch @@ -0,0 +1,606 @@ +From 5931c5bb05da02fa495d99b3b7e86239a2b79374 Mon Sep 17 00:00:00 2001 +From: Anssi Hannula +Date: Fri, 4 Feb 2011 12:38:15 +0200 +Subject: [PATCH] add files needed for xbmc win32 build + +--- + .gitignore | 5 + + build_xbmc_win32.sh | 49 +++ + include-xbmc-win32/dxva2/dxva2api.h | 502 +++++++++++++++++++++++++++++++ + include-xbmc-win32/libavutil/avconfig.h | 6 + + 4 files changed, 562 insertions(+), 0 deletions(-) + create mode 100644 build_xbmc_win32.sh + create mode 100644 include-xbmc-win32/dxva2/dxva2api.h + create mode 100644 include-xbmc-win32/libavutil/avconfig.h + +diff --git a/.gitignore b/.gitignore +index eac1758..70b94fc 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -43,3 +43,8 @@ tools/qt-faststart + tools/trasher + tools/trasher*.d + version.h ++ ++# ignore Windows build files ++*.def ++*.dll ++*.lib +diff --git a/build_xbmc_win32.sh b/build_xbmc_win32.sh +new file mode 100644 +index 0000000..5befc5a +--- /dev/null ++++ b/build_xbmc_win32.sh +@@ -0,0 +1,49 @@ ++#!/bin/bash ++ ++if [ -d .libs ] ++then ++rm -r .libs ++fi ++ ++if [ -f config.mak ] ++then ++make distclean ++fi ++ ++OPTIONS=" ++--enable-shared \ ++--enable-memalign-hack \ ++--enable-gpl \ ++--enable-w32threads \ ++--enable-postproc \ ++--enable-zlib \ ++--disable-static \ ++--disable-altivec \ ++--disable-muxers \ ++--disable-encoders \ ++--disable-debug \ ++--disable-ffplay \ ++--disable-ffserver \ ++--disable-ffmpeg \ ++--disable-ffprobe \ ++--disable-devices \ ++--enable-muxer=spdif \ ++--enable-muxer=adts \ ++--enable-encoder=ac3 \ ++--enable-encoder=aac \ ++--enable-runtime-cpudetect \ ++--disable-debug \ ++--disable-doc" ++ ++./configure --extra-cflags="-fno-common -Iinclude-xbmc-win32/dxva2" --extra-ldflags="-L/xbmc/system/players/dvdplayer" ${OPTIONS} && ++ ++make && ++mkdir .libs && ++cp lib*/*.dll .libs/ && ++mv .libs/swscale-0.dll .libs/swscale-0.6.1.dll && ++cp .libs/avcodec-52.dll /xbmc/system/players/dvdplayer/ && ++cp .libs/avcore-0.dll /xbmc/system/players/dvdplayer/ && ++cp .libs/avformat-52.dll /xbmc/system/players/dvdplayer/ && ++cp .libs/avutil-50.dll /xbmc/system/players/dvdplayer/ && ++cp .libs/postproc-51.dll /xbmc/system/players/dvdplayer/ && ++cp .libs/swscale-0.6.1.dll /xbmc/system/players/dvdplayer/ +diff --git a/include-xbmc-win32/dxva2/dxva2api.h b/include-xbmc-win32/dxva2/dxva2api.h +new file mode 100644 +index 0000000..28e54c8 +--- /dev/null ++++ b/include-xbmc-win32/dxva2/dxva2api.h +@@ -0,0 +1,502 @@ ++/***************************************************************************** ++ * dxva2api.h: DXVA 2 interface ++ ***************************************************************************** ++ * Copyright (C) 2009 Geoffroy Couprie ++ * Copyright (C) 2009 Laurent Aimar ++ * $Id$ ++ * ++ * Authors: Geoffroy Couprie ++ * Laurent Aimar ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. ++ *****************************************************************************/ ++ ++#ifndef _DXVA2API_H ++#define _DXVA2API_H ++ ++#define MINGW_DXVA2API_H_VERSION (2) ++ ++#if __GNUC__ >=3 ++#pragma GCC system_header ++#endif ++ ++#include ++#include ++ ++/* Define it to allow using nameless struct/union (non C99 compliant) to match ++ * the official documentation. */ ++//#define DXVA2API_USE_BITFIELDS ++ ++/****************STRUCTURES******************/ ++#pragma pack(push, 1) ++ ++typedef struct _DXVA2_ExtendedFormat { ++#ifdef DXVA2API_USE_BITFIELDS ++ union { ++ struct { ++ UINT SampleFormat : 8; ++ UINT VideoChromaSubsampling : 4; ++ UINT NominalRange : 3; ++ UINT VideoTransferMatrix : 3; ++ UINT VideoLighting : 4; ++ UINT VideoPrimaries : 5; ++ UINT VideoTransferFunction : 5; ++ }; ++ UINT value; ++ }; ++#else ++ UINT value; ++#endif ++} DXVA2_ExtendedFormat; ++ ++typedef struct _DXVA2_Frequency { ++ UINT Numerator; ++ UINT Denominator; ++} DXVA2_Frequency; ++ ++typedef struct _DXVA2_VideoDesc { ++ UINT SampleWidth; ++ UINT SampleHeight; ++ DXVA2_ExtendedFormat SampleFormat; ++ D3DFORMAT Format; ++ DXVA2_Frequency InputSampleFreq; ++ DXVA2_Frequency OutputFrameFreq; ++ UINT UABProtectionLevel; ++ UINT Reserved; ++} DXVA2_VideoDesc; ++ ++typedef struct _DXVA2_ConfigPictureDecode { ++ GUID guidConfigBitstreamEncryption; ++ GUID guidConfigMBcontrolEncryption; ++ GUID guidConfigResidDiffEncryption; ++ UINT ConfigBitstreamRaw; ++ UINT ConfigMBcontrolRasterOrder; ++ UINT ConfigResidDiffHost; ++ UINT ConfigSpatialResid8; ++ UINT ConfigResid8Subtraction; ++ UINT ConfigSpatialHost8or9Clipping; ++ UINT ConfigSpatialResidInterleaved; ++ UINT ConfigIntraResidUnsigned; ++ UINT ConfigResidDiffAccelerator; ++ UINT ConfigHostInverseScan; ++ UINT ConfigSpecificIDCT; ++ UINT Config4GroupedCoefs; ++ USHORT ConfigMinRenderTargetBuffCount; ++ USHORT ConfigDecoderSpecific; ++} DXVA2_ConfigPictureDecode; ++ ++typedef struct _DXVA2_DecodeBufferDesc { ++ DWORD CompressedBufferType; ++ UINT BufferIndex; ++ UINT DataOffset; ++ UINT DataSize; ++ UINT FirstMBaddress; ++ UINT NumMBsInBuffer; ++ UINT Width; ++ UINT Height; ++ UINT Stride; ++ UINT ReservedBits; ++ PVOID pvPVPState; ++} DXVA2_DecodeBufferDesc; ++ ++typedef struct _DXVA2_DecodeExtensionData { ++ UINT Function; ++ PVOID pPrivateInputData; ++ UINT PrivateInputDataSize; ++ PVOID pPrivateOutputData; ++ UINT PrivateOutputDataSize; ++} DXVA2_DecodeExtensionData; ++ ++typedef struct _DXVA2_DecodeExecuteParams { ++ UINT NumCompBuffers; ++ DXVA2_DecodeBufferDesc *pCompressedBuffers; ++ DXVA2_DecodeExtensionData *pExtensionData; ++} DXVA2_DecodeExecuteParams; ++ ++enum { ++ DXVA2_VideoDecoderRenderTarget = 0, ++ DXVA2_VideoProcessorRenderTarget = 1, ++ DXVA2_VideoSoftwareRenderTarget = 2 ++}; ++ ++enum { ++ DXVA2_PictureParametersBufferType = 0, ++ DXVA2_MacroBlockControlBufferType = 1, ++ DXVA2_ResidualDifferenceBufferType = 2, ++ DXVA2_DeblockingControlBufferType = 3, ++ DXVA2_InverseQuantizationMatrixBufferType = 4, ++ DXVA2_SliceControlBufferType = 5, ++ DXVA2_BitStreamDateBufferType = 6, ++ DXVA2_MotionVectorBuffer = 7, ++ DXVA2_FilmGrainBuffer = 8 ++}; ++ ++/* DXVA MPEG-I/II and VC-1 */ ++typedef struct _DXVA_PictureParameters { ++ USHORT wDecodedPictureIndex; ++ USHORT wDeblockedPictureIndex; ++ USHORT wForwardRefPictureIndex; ++ USHORT wBackwardRefPictureIndex; ++ USHORT wPicWidthInMBminus1; ++ USHORT wPicHeightInMBminus1; ++ UCHAR bMacroblockWidthMinus1; ++ UCHAR bMacroblockHeightMinus1; ++ UCHAR bBlockWidthMinus1; ++ UCHAR bBlockHeightMinus1; ++ UCHAR bBPPminus1; ++ UCHAR bPicStructure; ++ UCHAR bSecondField; ++ UCHAR bPicIntra; ++ UCHAR bPicBackwardPrediction; ++ UCHAR bBidirectionalAveragingMode; ++ UCHAR bMVprecisionAndChromaRelation; ++ UCHAR bChromaFormat; ++ UCHAR bPicScanFixed; ++ UCHAR bPicScanMethod; ++ UCHAR bPicReadbackRequests; ++ UCHAR bRcontrol; ++ UCHAR bPicSpatialResid8; ++ UCHAR bPicOverflowBlocks; ++ UCHAR bPicExtrapolation; ++ UCHAR bPicDeblocked; ++ UCHAR bPicDeblockConfined; ++ UCHAR bPic4MVallowed; ++ UCHAR bPicOBMC; ++ UCHAR bPicBinPB; ++ UCHAR bMV_RPS; ++ UCHAR bReservedBits; ++ USHORT wBitstreamFcodes; ++ USHORT wBitstreamPCEelements; ++ UCHAR bBitstreamConcealmentNeed; ++ UCHAR bBitstreamConcealmentMethod; ++} DXVA_PictureParameters, *LPDXVA_PictureParameters; ++ ++typedef struct _DXVA_QmatrixData { ++ BYTE bNewQmatrix[4]; ++ WORD Qmatrix[4][8 * 8]; ++} DXVA_QmatrixData, *LPDXVA_QmatrixData; ++ ++typedef struct _DXVA_SliceInfo { ++ USHORT wHorizontalPosition; ++ USHORT wVerticalPosition; ++ UINT dwSliceBitsInBuffer; ++ UINT dwSliceDataLocation; ++ UCHAR bStartCodeBitOffset; ++ UCHAR bReservedBits; ++ USHORT wMBbitOffset; ++ USHORT wNumberMBsInSlice; ++ USHORT wQuantizerScaleCode; ++ USHORT wBadSliceChopping; ++} DXVA_SliceInfo, *LPDXVA_SliceInfo; ++ ++/* DXVA H264 */ ++typedef struct { ++#ifdef DXVA2API_USE_BITFIELDS ++ union { ++ struct { ++ UCHAR Index7Bits : 7; ++ UCHAR AssociatedFlag : 1; ++ }; ++ UCHAR bPicEntry; ++ }; ++#else ++ UCHAR bPicEntry; ++#endif ++} DXVA_PicEntry_H264; ++ ++ ++typedef struct { ++ USHORT wFrameWidthInMbsMinus1; ++ USHORT wFrameHeightInMbsMinus1; ++ DXVA_PicEntry_H264 CurrPic; ++ UCHAR num_ref_frames; ++#ifdef DXVA2API_USE_BITFIELDS ++ union { ++ struct { ++ USHORT field_pic_flag : 1; ++ USHORT MbaffFrameFlag : 1; ++ USHORT residual_colour_transform_flag : 1; ++ USHORT sp_for_switch_flag : 1; ++ USHORT chroma_format_idc : 2; ++ USHORT RefPicFlag : 1; ++ USHORT constrained_intra_pred_flag : 1; ++ USHORT weighted_pred_flag : 1; ++ USHORT weighted_bipred_idc : 2; ++ USHORT MbsConsecutiveFlag : 1; ++ USHORT frame_mbs_only_flag : 1; ++ USHORT transform_8x8_mode_flag : 1; ++ USHORT MinLumaBipredSize8x8Flag : 1; ++ USHORT IntraPicFlag : 1; ++ }; ++ USHORT wBitFields; ++ }; ++#else ++ USHORT wBitFields; ++#endif ++ UCHAR bit_depth_luma_minus8; ++ UCHAR bit_depth_chroma_minus8; ++ USHORT Reserved16Bits; ++ UINT StatusReportFeedbackNumber; ++ DXVA_PicEntry_H264 RefFrameList[16]; ++ INT CurrFieldOrderCnt[2]; ++ INT FieldOrderCntList[16][2]; ++ CHAR pic_init_qs_minus26; ++ CHAR chroma_qp_index_offset; ++ CHAR second_chroma_qp_index_offset; ++ UCHAR ContinuationFlag; ++ CHAR pic_init_qp_minus26; ++ UCHAR num_ref_idx_l0_active_minus1; ++ UCHAR num_ref_idx_l1_active_minus1; ++ UCHAR Reserved8BitsA; ++ USHORT FrameNumList[16]; ++ ++ UINT UsedForReferenceFlags; ++ USHORT NonExistingFrameFlags; ++ USHORT frame_num; ++ UCHAR log2_max_frame_num_minus4; ++ UCHAR pic_order_cnt_type; ++ UCHAR log2_max_pic_order_cnt_lsb_minus4; ++ UCHAR delta_pic_order_always_zero_flag; ++ UCHAR direct_8x8_inference_flag; ++ UCHAR entropy_coding_mode_flag; ++ UCHAR pic_order_present_flag; ++ UCHAR num_slice_groups_minus1; ++ UCHAR slice_group_map_type; ++ UCHAR deblocking_filter_control_present_flag; ++ UCHAR redundant_pic_cnt_present_flag; ++ UCHAR Reserved8BitsB; ++ USHORT slice_group_change_rate_minus1; ++ UCHAR SliceGroupMap[810]; ++} DXVA_PicParams_H264; ++ ++typedef struct { ++ UCHAR bScalingLists4x4[6][16]; ++ UCHAR bScalingLists8x8[2][64]; ++} DXVA_Qmatrix_H264; ++ ++ ++typedef struct { ++ UINT BSNALunitDataLocation; ++ UINT SliceBytesInBuffer; ++ USHORT wBadSliceChopping; ++ USHORT first_mb_in_slice; ++ USHORT NumMbsForSlice; ++ USHORT BitOffsetToSliceData; ++ UCHAR slice_type; ++ UCHAR luma_log2_weight_denom; ++ UCHAR chroma_log2_weight_denom; ++ ++ UCHAR num_ref_idx_l0_active_minus1; ++ UCHAR num_ref_idx_l1_active_minus1; ++ CHAR slice_alpha_c0_offset_div2; ++ CHAR slice_beta_offset_div2; ++ UCHAR Reserved8Bits; ++ DXVA_PicEntry_H264 RefPicList[2][32]; ++ SHORT Weights[2][32][3][2]; ++ CHAR slice_qs_delta; ++ CHAR slice_qp_delta; ++ UCHAR redundant_pic_cnt; ++ UCHAR direct_spatial_mv_pred_flag; ++ UCHAR cabac_init_idc; ++ UCHAR disable_deblocking_filter_idc; ++ USHORT slice_id; ++} DXVA_Slice_H264_Long; ++ ++typedef struct { ++ UINT BSNALunitDataLocation; ++ UINT SliceBytesInBuffer; ++ USHORT wBadSliceChopping; ++} DXVA_Slice_H264_Short; ++ ++typedef struct { ++ USHORT wFrameWidthInMbsMinus1; ++ USHORT wFrameHeightInMbsMinus1; ++ DXVA_PicEntry_H264 InPic; ++ DXVA_PicEntry_H264 OutPic; ++ USHORT PicOrderCnt_offset; ++ INT CurrPicOrderCnt; ++ UINT StatusReportFeedbackNumber; ++ UCHAR model_id; ++ UCHAR separate_colour_description_present_flag; ++ UCHAR film_grain_bit_depth_luma_minus8; ++ UCHAR film_grain_bit_depth_chroma_minus8; ++ UCHAR film_grain_full_range_flag; ++ UCHAR film_grain_colour_primaries; ++ UCHAR film_grain_transfer_characteristics; ++ UCHAR film_grain_matrix_coefficients; ++ UCHAR blending_mode_id; ++ UCHAR log2_scale_factor; ++ UCHAR comp_model_present_flag[4]; ++ UCHAR num_intensity_intervals_minus1[4]; ++ UCHAR num_model_values_minus1[4]; ++ UCHAR intensity_interval_lower_bound[3][16]; ++ UCHAR intensity_interval_upper_bound[3][16]; ++ SHORT comp_model_value[3][16][8]; ++} DXVA_FilmGrainChar_H264; ++ ++#pragma pack(pop) ++ ++/*************INTERFACES************/ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++typedef _COM_interface IDirectXVideoDecoderService IDirectXVideoDecoderService; ++typedef _COM_interface IDirectXVideoDecoder IDirectXVideoDecoder; ++ ++#undef INTERFACE ++#define INTERFACE IDirectXVideoDecoder ++DECLARE_INTERFACE_(IDirectXVideoDecoder,IUnknown) ++{ ++ STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; ++ STDMETHOD_(ULONG,AddRef)(THIS) PURE; ++ STDMETHOD_(ULONG,Release)(THIS) PURE; ++ STDMETHOD(GetVideoDecoderService)(THIS_ IDirectXVideoDecoderService**) PURE; ++ STDMETHOD(GetCreationParameters)(THIS_ GUID*,DXVA2_VideoDesc*,DXVA2_ConfigPictureDecode*,IDirect3DSurface9***,UINT*) PURE; ++ STDMETHOD(GetBuffer)(THIS_ UINT,void**,UINT*) PURE; ++ STDMETHOD(ReleaseBuffer)(THIS_ UINT) PURE; ++ STDMETHOD(BeginFrame)(THIS_ IDirect3DSurface9 *,void*) PURE; ++ STDMETHOD(EndFrame)(THIS_ HANDLE *) PURE; ++ STDMETHOD(Execute)(THIS_ const DXVA2_DecodeExecuteParams*) PURE; ++ ++ ++}; ++ ++#if !defined(__cplusplus) || defined(CINTERFACE) ++#define IDirectXVideoDecoder_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) ++#define IDirectXVideoDecoder_AddRef(p) (p)->lpVtbl->AddRef(p) ++#define IDirectXVideoDecoder_Release(p) (p)->lpVtbl->Release(p) ++#define IDirectXVideoDecoder_BeginFrame(p,a,b) (p)->lpVtbl->BeginFrame(p,a,b) ++#define IDirectXVideoDecoder_EndFrame(p,a) (p)->lpVtbl->EndFrame(p,a) ++#define IDirectXVideoDecoder_Execute(p,a) (p)->lpVtbl->Execute(p,a) ++#define IDirectXVideoDecoder_GetBuffer(p,a,b,c) (p)->lpVtbl->GetBuffer(p,a,b,c) ++#define IDirectXVideoDecoder_GetCreationParameters(p,a,b,c,d,e) (p)->lpVtbl->GetCreationParameters(p,a,b,c,d,e) ++#define IDirectXVideoDecoder_GetVideoDecoderService(p,a) (p)->lpVtbl->GetVideoDecoderService(p,a) ++#define IDirectXVideoDecoder_ReleaseBuffer(p,a) (p)->lpVtbl->ReleaseBuffer(p,a) ++#else ++#define IDirectXVideoDecoder_QueryInterface(p,a,b) (p)->QueryInterface(a,b) ++#define IDirectXVideoDecoder_AddRef(p) (p)->AddRef() ++#define IDirectXVideoDecoder_Release(p) (p)->Release() ++#define IDirectXVideoDecoder_BeginFrame(p,a,b) (p)->BeginFrame(a,b) ++#define IDirectXVideoDecoder_EndFrame(p,a) (p)->EndFrame(a) ++#define IDirectXVideoDecoder_Execute(p,a) (p)->Execute(a) ++#define IDirectXVideoDecoder_GetBuffer(p,a,b,c) (p)->GetBuffer(a,b,c) ++#define IDirectXVideoDecoder_GetCreationParameters(p,a,b,c,d,e) (p)->GetCreationParameters(a,b,c,d,e) ++#define IDirectXVideoDecoder_GetVideoDecoderService(p,a) (p)->GetVideoDecoderService(a) ++#define IDirectXVideoDecoder_ReleaseBuffer(p,a) (p)->ReleaseBuffer(a) ++#endif ++ ++#undef INTERFACE ++#define INTERFACE IDirectXVideoAccelerationService ++DECLARE_INTERFACE_(IDirectXVideoAccelerationService,IUnknown) ++{ ++ STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; ++ STDMETHOD_(ULONG,AddRef)(THIS) PURE; ++ STDMETHOD_(ULONG,Release)(THIS) PURE; ++ STDMETHOD(CreateSurface)(THIS_ UINT,UINT,UINT,D3DFORMAT,D3DPOOL,DWORD,DWORD,IDirect3DSurface9**,HANDLE*) PURE; ++ ++}; ++ ++#if !defined(__cplusplus) || defined(CINTERFACE) ++#define IDirectXVideoAccelerationService_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) ++#define IDirectXVideoAccelerationService_AddRef(p) (p)->lpVtbl->AddRef(p) ++#define IDirectXVideoAccelerationService_Release(p) (p)->lpVtbl->Release(p) ++#define IDirectXVideoAccelerationService_CreateSurface(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateSurface(p,a,b,c,d,e,f,g,h,i) ++#else ++#define IDirectXVideoAccelerationService_QueryInterface(p,a,b) (p)->QueryInterface(a,b) ++#define IDirectXVideoAccelerationService_AddRef(p) (p)->AddRef() ++#define IDirectXVideoAccelerationService_Release(p) (p)->Release() ++#define IDirectXVideoAccelerationService_CreateSurface(p,a,b,c,d,e,f,g,h,i) (p)->CreateSurface(a,b,c,d,e,f,g,h,i) ++#endif ++ ++#undef INTERFACE ++#define INTERFACE IDirectXVideoDecoderService ++DECLARE_INTERFACE_(IDirectXVideoDecoderService,IDirectXVideoAccelerationService) ++{ ++ STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; ++ STDMETHOD_(ULONG,AddRef)(THIS) PURE; ++ STDMETHOD_(ULONG,Release)(THIS) PURE; ++ STDMETHOD(CreateSurface)(THIS_ UINT,UINT,UINT,D3DFORMAT,D3DPOOL,DWORD,DWORD,IDirect3DSurface9**,HANDLE*) PURE; ++ STDMETHOD(GetDecoderDeviceGuids)(THIS_ UINT*,GUID **) PURE; ++ STDMETHOD(GetDecoderRenderTargets)(THIS_ REFGUID,UINT*,D3DFORMAT**) PURE; ++ STDMETHOD(GetDecoderConfigurations)(THIS_ REFGUID,const DXVA2_VideoDesc*,IUnknown*,UINT*,DXVA2_ConfigPictureDecode**) PURE; ++ STDMETHOD(CreateVideoDecoder)(THIS_ REFGUID,const DXVA2_VideoDesc*,DXVA2_ConfigPictureDecode*,IDirect3DSurface9**,UINT,IDirectXVideoDecoder**) PURE; ++}; ++ ++#if !defined(__cplusplus) || defined(CINTERFACE) ++#define IDirectXVideoDecoderService_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) ++#define IDirectXVideoDecoderService_AddRef(p) (p)->lpVtbl->AddRef(p) ++#define IDirectXVideoDecoderService_Release(p) (p)->lpVtbl->Release(p) ++#define IDirectXVideoDecoderService_CreateSurface(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateSurface(p,a,b,c,d,e,f,g,h,i) ++#define IDirectXVideoDecoderService_CreateVideoDecoder(p,a,b,c,d,e,f) (p)->lpVtbl->CreateVideoDecoder(p,a,b,c,d,e,f) ++#define IDirectXVideoDecoderService_GetDecoderConfigurations(p,a,b,c,d,e) (p)->lpVtbl->GetDecoderConfigurations(p,a,b,c,d,e) ++#define IDirectXVideoDecoderService_GetDecoderDeviceGuids(p,a,b) (p)->lpVtbl->GetDecoderDeviceGuids(p,a,b) ++#define IDirectXVideoDecoderService_GetDecoderRenderTargets(p,a,b,c) (p)->lpVtbl->GetDecoderRenderTargets(p,a,b,c) ++#else ++#define IDirectXVideoDecoderService_QueryInterface(p,a,b) (p)->QueryInterface(a,b) ++#define IDirectXVideoDecoderService_AddRef(p) (p)->AddRef() ++#define IDirectXVideoDecoderService_Release(p) (p)->Release() ++#define IDirectXVideoDecoderService_CreateSurface(p,a,b,c,d,e,f,g,h,i) (p)->CreateSurface(a,b,c,d,e,f,g,h,i) ++#define IDirectXVideoDecoderService_CreateVideoDecoder(p,a,b,c,d,e,f) (p)->CreateVideoDecoder(a,b,c,d,e,f) ++#define IDirectXVideoDecoderService_GetDecoderConfigurations(p,a,b,c,d,e) (p)->GetDecoderConfigurations(a,b,c,d,e) ++#define IDirectXVideoDecoderService_GetDecoderDeviceGuids(p,a,b) (p)->GetDecoderDeviceGuids(a,b) ++#define IDirectXVideoDecoderService_GetDecoderRenderTargets(p,a,b,c) (p)->GetDecoderRenderTargets(a,b,c) ++#endif ++ ++#undef INTERFACE ++#define INTERFACE IDirect3DDeviceManager9 ++DECLARE_INTERFACE_(IDirect3DDeviceManager9,IUnknown) ++{ ++ STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; ++ STDMETHOD_(ULONG,AddRef)(THIS) PURE; ++ STDMETHOD_(ULONG,Release)(THIS) PURE; ++ STDMETHOD(ResetDevice)(THIS_ IDirect3DDevice9*,UINT) PURE; ++ STDMETHOD(OpenDeviceHandle)(THIS_ HANDLE*) PURE; ++ STDMETHOD(CloseDeviceHandle)( THIS_ HANDLE) PURE; ++ STDMETHOD(TestDevice)( THIS_ HANDLE) PURE; ++ STDMETHOD(LockDevice)( THIS_ HANDLE,IDirect3DDevice9**,BOOL) PURE; ++ STDMETHOD(UnlockDevice)( THIS_ HANDLE,BOOL) PURE; ++ STDMETHOD(GetVideoService)( THIS_ HANDLE,REFIID,void**) PURE; ++}; ++ ++#if !defined(__cplusplus) || defined(CINTERFACE) ++#define IDirect3DDeviceManager9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) ++#define IDirect3DDeviceManager9_AddRef(p) (p)->lpVtbl->AddRef(p) ++#define IDirect3DDeviceManager9_Release(p) (p)->lpVtbl->Release(p) ++#define IDirect3DDeviceManager9_ResetDevice(p,a,b) (p)->lpVtbl->ResetDevice(p,a,b) ++#define IDirect3DDeviceManager9_OpenDeviceHandle(p,a) (p)->lpVtbl->OpenDeviceHandle(p,a) ++#define IDirect3DDeviceManager9_CloseDeviceHandle(p,a) (p)->lpVtbl->CloseDeviceHandle(p,a) ++#define IDirect3DDeviceManager9_TestDevice(p,a) (p)->lpVtbl->TestDevice(p,a) ++#define IDirect3DDeviceManager9_LockDevice(p,a,b,c) (p)->lpVtbl->LockDevice(p,a,b,c) ++#define IDirect3DDeviceManager9_UnlockDevice(p,a,b) (p)->lpVtbl->UnlockDevice(p,a,b) ++#define IDirect3DDeviceManager9_GetVideoService(p,a,b,c) (p)->lpVtbl->GetVideoService(p,a,b,c) ++#else ++#define IDirect3DDeviceManager9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) ++#define IDirect3DDeviceManager9_AddRef(p) (p)->AddRef() ++#define IDirect3DDeviceManager9_Release(p) (p)->Release() ++#define IDirect3DDeviceManager9_ResetDevice(p,a,b) (p)->ResetDevice(a,b) ++#define IDirect3DDeviceManager9_OpenDeviceHandle(p,a) (p)->OpenDeviceHandle(a) ++#define IDirect3DDeviceManager9_CloseDeviceHandle(p,a) (p)->CloseDeviceHandle(a) ++#define IDirect3DDeviceManager9_TestDevice(p,a) (p)->TestDevice(a) ++#define IDirect3DDeviceManager9_LockDevice(p,a,b,c) (p)->LockDevice(a,b,c) ++#define IDirect3DDeviceManager9_UnlockDevice(p,a,b) (p)->UnlockDevice(a,b) ++#define IDirect3DDeviceManager9_GetVideoService(p,a,b,c) (p)->GetVideoService(a,b,c) ++#endif ++ ++#ifdef __cplusplus ++}; ++#endif ++ ++#endif //_DXVA2API_H +diff --git a/include-xbmc-win32/libavutil/avconfig.h b/include-xbmc-win32/libavutil/avconfig.h +new file mode 100644 +index 0000000..f10aa61 +--- /dev/null ++++ b/include-xbmc-win32/libavutil/avconfig.h +@@ -0,0 +1,6 @@ ++/* Generated by ffconf */ ++#ifndef AVUTIL_AVCONFIG_H ++#define AVUTIL_AVCONFIG_H ++#define AV_HAVE_BIGENDIAN 0 ++#define AV_HAVE_FAST_UNALIGNED 1 ++#endif /* AVUTIL_AVCONFIG_H */ +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0027-changed-check-return-value-of-seeks-to-avoid-messing.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0027-changed-check-return-value-of-seeks-to-avoid-messing.patch new file mode 100644 index 00000000..f62cd67d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0027-changed-check-return-value-of-seeks-to-avoid-messing.patch @@ -0,0 +1,62 @@ +From 470e2804c01b609532d95539c66ebb6d13c7f805 Mon Sep 17 00:00:00 2001 +From: Cory Fields +Date: Fri, 9 Jul 2010 17:36:00 -0400 +Subject: [PATCH 27/36] changed: check return value of seeks to avoid messing up current stream location + +--- + libavformat/avidec.c | 16 ++++++++++++---- + 1 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/libavformat/avidec.c b/libavformat/avidec.c +index 3d223b7..45ed8be 100644 +--- a/libavformat/avidec.c ++++ b/libavformat/avidec.c +@@ -206,13 +206,18 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){ + return -1; + } + +- url_fseek(pb, offset+8, SEEK_SET); ++ if(url_fseek(pb, offset+8, SEEK_SET) < 0) ++ return -1; + avi->odml_depth++; + read_braindead_odml_indx(s, frame_num); + avi->odml_depth--; + frame_num += duration; + +- url_fseek(pb, pos, SEEK_SET); ++ if(url_fseek(pb, pos, SEEK_SET) < 0) { ++ av_log(s, AV_LOG_ERROR, "Failed to restore position after reading index"); ++ return -1; ++ } ++ + } + } + avi->index_loaded=1; +@@ -1287,11 +1292,13 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp + /* the av_index_search_timestamp call above. */ + assert(stream_index == 0); + ++ if(url_fseek(s->pb, pos, SEEK_SET) < 0) ++ return -1; ++ + /* Feed the DV video stream version of the timestamp to the */ + /* DV demux so it can synthesize correct timestamps. */ + dv_offset_reset(avi->dv_demux, timestamp); + +- url_fseek(s->pb, pos, SEEK_SET); + avi->stream_index= -1; + return 0; + } +@@ -1333,7 +1340,8 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp + } + + /* do the seek */ +- url_fseek(s->pb, pos, SEEK_SET); ++ if(url_fseek(s->pb, pos, SEEK_SET) < 0) ++ return -1; + avi->stream_index= -1; + return 0; + } +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0028-fixed-if-lavc-s-mpeg2-decoder-was-asked-to-drop-a-fr.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0028-fixed-if-lavc-s-mpeg2-decoder-was-asked-to-drop-a-fr.patch new file mode 100644 index 00000000..2c1ef303 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0028-fixed-if-lavc-s-mpeg2-decoder-was-asked-to-drop-a-fr.patch @@ -0,0 +1,26 @@ +From 937ab2b921e37b8e17edef2bb5a8b3a476d20fd8 Mon Sep 17 00:00:00 2001 +From: elupus +Date: Wed, 29 Sep 2010 21:18:03 +0000 +Subject: [PATCH 28/36] fixed: if lavc's mpeg2 decoder was asked to drop a frame, it would still output an old frame, and mess up timestamps + +git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@34307 568bbfeb-2a22-0410-94d2-cc84cf5bfa90 +--- + libavcodec/mpeg12.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c +index 3c73627..6254abb 100644 +--- a/libavcodec/mpeg12.c ++++ b/libavcodec/mpeg12.c +@@ -1911,7 +1911,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) + ff_xvmc_field_end(s); + + /* end of slice reached */ +- if (/*s->mb_y<mb_height &&*/ !s->first_field) { ++ if (/*s->mb_y<mb_height &&*/ !s->first_field && !s->first_slice) { + /* end of image */ + + s->current_picture_ptr->qscale_type= FF_QSCALE_TYPE_MPEG2; +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0029-fixed-if-container-doesn-t-contain-timestamps-for-al.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0029-fixed-if-container-doesn-t-contain-timestamps-for-al.patch new file mode 100644 index 00000000..62fda88e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0029-fixed-if-container-doesn-t-contain-timestamps-for-al.patch @@ -0,0 +1,29 @@ +From ab91f9fecf9ac6e38dbf5d9ed65a5bd123a4c031 Mon Sep 17 00:00:00 2001 +From: elupus +Date: Tue, 19 Oct 2010 21:07:10 +0000 +Subject: [PATCH 29/36] fixed: if container doesn't contain timestamps for all dts packets, lavf used wrong duration of packet to fill in the blanks + +The issue was discussed here: http://forum.xbmc.org/showthread.php?t=82896 + +Ps. The DTS parser is really lacking. It doesn't fill in anything, it only slices up the frames. So if this value changes mid stream, we will start calculating this wrong again. I'm pondering if we should just stop trying to fill in the blanks. + +git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@34863 568bbfeb-2a22-0410-94d2-cc84cf5bfa90 +--- + libavcodec/dca.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/libavcodec/dca.c b/libavcodec/dca.c +index 63ea329..2e2b37f 100644 +--- a/libavcodec/dca.c ++++ b/libavcodec/dca.c +@@ -1642,6 +1642,7 @@ static int dca_decode_frame(AVCodecContext * avctx, + //set AVCodec values with parsed data + avctx->sample_rate = s->sample_rate; + avctx->bit_rate = s->bit_rate; ++ avctx->frame_size = s->sample_blocks * 32; + + s->profile = FF_PROFILE_DTS; + +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0030-aacenc-add-recognized-profiles-array.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0030-aacenc-add-recognized-profiles-array.patch new file mode 100644 index 00000000..b8f38615 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0030-aacenc-add-recognized-profiles-array.patch @@ -0,0 +1,35 @@ +From fcdd099e3df44d7e577b2bfc0d03c2617d0dd870 Mon Sep 17 00:00:00 2001 +From: Anssi Hannula +Date: Fri, 21 Jan 2011 20:44:02 +0200 +Subject: [PATCH 30/36] aacenc: add recognized profiles array + +Submitted upstream. +--- + libavcodec/aacenc.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c +index 50dab1c..237f338 100644 +--- a/libavcodec/aacenc.c ++++ b/libavcodec/aacenc.c +@@ -641,6 +641,11 @@ static av_cold int aac_encode_end(AVCodecContext *avctx) + return 0; + } + ++static const AVProfile profiles[] = { ++ { FF_PROFILE_AAC_LOW, "Low" }, ++ { FF_PROFILE_UNKNOWN }, ++}; ++ + AVCodec ff_aac_encoder = { + "aac", + AVMEDIA_TYPE_AUDIO, +@@ -652,4 +657,5 @@ AVCodec ff_aac_encoder = { + .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL, + .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE}, + .long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"), ++ .profiles = profiles, + }; +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0031-fixed-vp3-decoder-should-set-key_frame-field-of-AVFr.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0031-fixed-vp3-decoder-should-set-key_frame-field-of-AVFr.patch new file mode 100644 index 00000000..55650c06 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0031-fixed-vp3-decoder-should-set-key_frame-field-of-AVFr.patch @@ -0,0 +1,25 @@ +From 23c286841dda2df21bb05917ff6895bec1854f61 Mon Sep 17 00:00:00 2001 +From: elupus +Date: Tue, 14 Sep 2010 00:42:57 +0000 +Subject: [PATCH 31/36] fixed: vp3 decoder should set key_frame field of AVFrame + +git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@33768 568bbfeb-2a22-0410-94d2-cc84cf5bfa90 +--- + libavcodec/vp3.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c +index 06f55f6..d634fca 100644 +--- a/libavcodec/vp3.c ++++ b/libavcodec/vp3.c +@@ -1765,6 +1765,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, + + s->current_frame.reference = 3; + s->current_frame.pict_type = s->keyframe ? FF_I_TYPE : FF_P_TYPE; ++ s->current_frame.key_frame = s->keyframe; + if (avctx->get_buffer(avctx, &s->current_frame) < 0) { + av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + goto error; +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0032-changed-allow-8-second-skew-between-streams-in-mov-b.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0032-changed-allow-8-second-skew-between-streams-in-mov-b.patch new file mode 100644 index 00000000..737dbeea --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0032-changed-allow-8-second-skew-between-streams-in-mov-b.patch @@ -0,0 +1,28 @@ +From 4dbb736cc971f8b4e305b2c2d44353f53235bb25 Mon Sep 17 00:00:00 2001 +From: elupus +Date: Wed, 8 Dec 2010 14:03:43 +0000 +Subject: [PATCH 32/36] changed: allow 8 second skew between streams in mov before attempting to seek + +git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@35598 568bbfeb-2a22-0410-94d2-cc84cf5bfa90 +--- + libavformat/mov.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libavformat/mov.c b/libavformat/mov.c +index a48000f..18ecbb9 100644 +--- a/libavformat/mov.c ++++ b/libavformat/mov.c +@@ -2386,8 +2386,8 @@ static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st) + if (!sample || (url_is_streamed(s->pb) && current_sample->pos < sample->pos) || + (!url_is_streamed(s->pb) && + ((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb && +- ((FFABS(best_dts - dts) <= AV_TIME_BASE && current_sample->pos < sample->pos) || +- (FFABS(best_dts - dts) > AV_TIME_BASE && dts < best_dts)))))) { ++ ((FFABS(best_dts - dts) <= 8*AV_TIME_BASE && current_sample->pos < sample->pos) || ++ (FFABS(best_dts - dts) > 8*AV_TIME_BASE && dts < best_dts)))))) { + sample = current_sample; + best_dts = dts; + *st = avst; +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0033-fixed-memleak-in-mpegts-demuxer-on-some-malformed-mp.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0033-fixed-memleak-in-mpegts-demuxer-on-some-malformed-mp.patch new file mode 100644 index 00000000..c6c9fc2b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0033-fixed-memleak-in-mpegts-demuxer-on-some-malformed-mp.patch @@ -0,0 +1,39 @@ +From c8c185cc7890cc2bbcc285810f5ac801a8d7ef1e Mon Sep 17 00:00:00 2001 +From: elupus +Date: Fri, 26 Nov 2010 20:56:48 +0000 +Subject: [PATCH 33/36] fixed: memleak in mpegts demuxer on some malformed (??) mpegts files with too large pes packets + +at-visions sample file brokenStream.mpg + +git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@35475 568bbfeb-2a22-0410-94d2-cc84cf5bfa90 +--- + libavformat/mpegts.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c +index 2fc0089..112ff50 100644 +--- a/libavformat/mpegts.c ++++ b/libavformat/mpegts.c +@@ -616,6 +616,10 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes, + + static void new_pes_packet(PESContext *pes, AVPacket *pkt) + { ++ if(pkt->data) { ++ av_log(pes->stream, AV_LOG_ERROR, "ignoring previously allocated packet on stream %d\n", pkt->stream_index); ++ av_free_packet(pkt); ++ } + av_init_packet(pkt); + + pkt->destruct = av_destruct_packet; +@@ -1657,6 +1661,8 @@ static int mpegts_read_packet(AVFormatContext *s, + } + + ts->pkt = pkt; ++ ts->pkt->data = NULL; ++ + ret = handle_packets(ts, 0); + if (ret < 0) { + /* flush pes data left */ +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0034-fixed-dvd-still-frames-as-first-frame-caused-lavf-to.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0034-fixed-dvd-still-frames-as-first-frame-caused-lavf-to.patch new file mode 100644 index 00000000..77a24394 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0034-fixed-dvd-still-frames-as-first-frame-caused-lavf-to.patch @@ -0,0 +1,28 @@ +From 91aab72bc6f677a96471de18bbf2ccc1363441be Mon Sep 17 00:00:00 2001 +From: elupus +Date: Thu, 15 Jul 2010 22:24:57 +0000 +Subject: [PATCH 34/36] fixed: dvd still frames as first frame caused lavf to return CODEC_ID_PROBE, aswell as put the whole menu into an internal buffer. + +This fixes #9470 aswell as makes our (incomplete) hacks in DVDDemuxerFFMpeg for this case redundant. Getting this upstream would be good, but we'd need a mpeg sample file. One can be generated by chopping a .vob file at a location where there is only a singular still frame available. + +git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@31831 568bbfeb-2a22-0410-94d2-cc84cf5bfa90 +--- + libavformat/utils.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libavformat/utils.c b/libavformat/utils.c +index fe3b453..e2881ba 100644 +--- a/libavformat/utils.c ++++ b/libavformat/utils.c +@@ -739,7 +739,7 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt) + + if(av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)){ + //FIXME we dont reduce score to 0 for the case of running out of buffer space in bytes +- set_codec_from_probe_data(s, st, pd, st->probe_packets > 0 ? AVPROBE_SCORE_MAX/4 : 0); ++ set_codec_from_probe_data(s, st, pd, st->probe_packets > 0 ? AVPROBE_SCORE_MAX/4-1 : 0); + if(st->codec->codec_id != CODEC_ID_PROBE){ + pd->buf_size=0; + av_freep(&pd->buf); +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0035-Speed-up-mpegts-av_find_stream_info.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0035-Speed-up-mpegts-av_find_stream_info.patch new file mode 100644 index 00000000..d4446164 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0035-Speed-up-mpegts-av_find_stream_info.patch @@ -0,0 +1,38 @@ +From b3b5bde15444655b238ba68c5052c3e41b2e7cf6 Mon Sep 17 00:00:00 2001 +From: elupus +Date: Mon, 28 Jun 2010 21:26:54 +0000 +Subject: [PATCH 35/36] Speed up mpegts av_find_stream_info + +git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@31478 568bbfeb-2a22-0410-94d2-cc84cf5bfa90 +--- + libavformat/mpegts.c | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c +index 112ff50..9c25e37 100644 +--- a/libavformat/mpegts.c ++++ b/libavformat/mpegts.c +@@ -699,7 +699,7 @@ static int mpegts_push_data(MpegTSFilter *filter, + #endif + + /* stream not present in PMT */ +- if (!pes->st) { ++ if (ts->auto_guess && !pes->st) { + pes->st = av_new_stream(ts->stream, pes->pid); + if (!pes->st) + return AVERROR(ENOMEM); +@@ -1539,7 +1539,10 @@ static int mpegts_read_header(AVFormatContext *s, + + av_dlog(ts->stream, "tuning done\n"); + +- s->ctx_flags |= AVFMTCTX_NOHEADER; ++ /* only flag NOHEADER if we are in file mode, ++ in streaming mode scanning may take too long for users */ ++ if (!url_is_streamed(pb)) ++ s->ctx_flags |= AVFMTCTX_NOHEADER; + } else { + AVStream *st; + int pcr_pid, pid, nb_packets, nb_pcrs, ret, pcr_l; +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0036-swscale-fix-build-with-enable-runtime-cpudetect-disa.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0036-swscale-fix-build-with-enable-runtime-cpudetect-disa.patch new file mode 100644 index 00000000..3c4a8b77 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0036-swscale-fix-build-with-enable-runtime-cpudetect-disa.patch @@ -0,0 +1,56 @@ +From 189505c7a47007ae25fe9d4c46787c3ef9378dc9 Mon Sep 17 00:00:00 2001 +From: Anssi Hannula +Date: Wed, 2 Feb 2011 19:36:23 +0200 +Subject: [PATCH 36/36] swscale: fix build with --enable-runtime-cpudetect --disable-mmx/mmx2/amd3dnow + +Commit 0fc29f2708a "swscale: simplify selection of optimizations to +compile." (25 Aug 2010) changed the behaviour so that with +--enable-runtime-cpudetect --disable-mmx/mmx2/amd3dnow the instruction +sets are actually disabled. + +However, ff_getSwsFunc() still calls the respective initialization +functions which no longer exist, causing a build failure. + +Fix that by putting those calls under #if as well. +--- + libswscale/swscale.c | 15 +++++++++++---- + 1 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/libswscale/swscale.c b/libswscale/swscale.c +index 375171f..8d7bb73 100644 +--- a/libswscale/swscale.c ++++ b/libswscale/swscale.c +@@ -1262,19 +1262,26 @@ SwsFunc ff_getSwsFunc(SwsContext *c) + + #if ARCH_X86 + // ordered per speed fastest first ++#if COMPILE_MMX2 + if (flags & SWS_CPU_CAPS_MMX2) { + sws_init_swScale_MMX2(c); + return swScale_MMX2; +- } else if (flags & SWS_CPU_CAPS_3DNOW) { ++ } ++#endif ++#if COMPILE_3DNOW ++ if (flags & SWS_CPU_CAPS_3DNOW) { + sws_init_swScale_3DNow(c); + return swScale_3DNow; +- } else if (flags & SWS_CPU_CAPS_MMX) { ++ } ++#endif ++#if COMPILE_MMX ++ if (flags & SWS_CPU_CAPS_MMX) { + sws_init_swScale_MMX(c); + return swScale_MMX; +- } else { ++ } ++#endif + sws_init_swScale_C(c); + return swScale_C; +- } + + #else + #if COMPILE_ALTIVEC +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0037-configure-check-yasm-nasm-for-working-pextrd-opcode.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0037-configure-check-yasm-nasm-for-working-pextrd-opcode.patch new file mode 100644 index 00000000..f2ffe4e9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0037-configure-check-yasm-nasm-for-working-pextrd-opcode.patch @@ -0,0 +1,41 @@ +From f35c0b93a336edb04149c76105480fb1076a5f6c Mon Sep 17 00:00:00 2001 +From: Anssi Hannula +Date: Sun, 6 Feb 2011 07:42:55 +0200 +Subject: [PATCH] configure: check yasm/nasm for working pextrd opcode + +NASM versions older than 2.08 fail to build ffmpeg with several +"error: operation size not specified" errors but this is not caught in +configure. + +Fix that by checking if "pextrd [eax], xmm0, 1" works in configure. + +--- + +For the record, here are (some of?) the errors: +libavcodec/x86/vc1dsp_yasm.asm:329: error: operation size not specified +libavcodec/x86/vp8dsp.asm:967: error: operation size not specified +libavcodec/x86/vp8dsp.asm:968: error: operation size not specified +libavcodec/x86/vp8dsp.asm:969: error: operation size not specified +libavcodec/x86/vp8dsp.asm:1629: error: operation size not specified +libavcodec/x86/vp8dsp.asm:2854: error: operation size not specified +libavcodec/x86/vp8dsp.asm:2858: error: operation size not specified +--- + configure | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/configure b/configure +index 83d9b87..a62e131 100755 +--- a/configure ++++ b/configure +@@ -2672,7 +2672,7 @@ EOF + elf*) enabled debug && append YASMFLAGS $yasm_debug ;; + esac + +- check_yasm "pabsw xmm0, xmm0" && enable yasm || ++ check_yasm "pextrd [eax], xmm0, 1" && enable yasm || + die "yasm not found, use --disable-yasm for a crippled build" + fi + +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0038-rtsp-Don-t-store-RTSPStream-in-AVStream-priv_data.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0038-rtsp-Don-t-store-RTSPStream-in-AVStream-priv_data.patch new file mode 100644 index 00000000..d87a1cfd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0038-rtsp-Don-t-store-RTSPStream-in-AVStream-priv_data.patch @@ -0,0 +1,108 @@ +From b1eb9860a582ec9459e871c00f23b5fc2500aaf4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Martin=20Storsj=C3=B6?= +Date: Wed, 2 Feb 2011 11:08:01 +0200 +Subject: [PATCH] rtsp: Don't store RTSPStream in AVStream->priv_data + +For mpegts in RTP, there isn't a direct mapping between RTSPStreams +and AVStreams, and the RTSPStream isn't ever stored in +AVStream->priv_data, which was earlier leaked. The fix for this +leak, in ea7f080749d68a431226ce196014da38761a0d82, lead to +double frees for other, normal RTP streams. + +This patch avoids storing RTSPStreams in AVStream->priv_data, thus +avoiding the double free. The RTSPStreams are always available via +RTSPState->rtsp_streams anyway. + +Tested with MS-RTSP, RealRTSP, DSS and mpegts/RTP. + +Signed-off-by: Luca Barbato +(cherry picked from commit d9c0510e22821baa364306d867ffac45da0620c8) +--- + libavformat/rtsp.c | 16 ++++++---------- + libavformat/rtspenc.c | 2 -- + 2 files changed, 6 insertions(+), 12 deletions(-) + +diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c +index 09e2f1e..e1d7503 100644 +--- a/libavformat/rtsp.c ++++ b/libavformat/rtsp.c +@@ -273,8 +273,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, + s1->default_ip = sdp_ip; + s1->default_ttl = ttl; + } else { +- st = s->streams[s->nb_streams - 1]; +- rtsp_st = st->priv_data; ++ rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1]; + rtsp_st->sdp_ip = sdp_ip; + rtsp_st->sdp_ttl = ttl; + } +@@ -326,7 +325,6 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, + st = av_new_stream(s, 0); + if (!st) + return; +- st->priv_data = rtsp_st; + rtsp_st->stream_index = st->index; + st->codec->codec_type = codec_type; + if (rtsp_st->sdp_payload_type < RTP_PT_PRIVATE) { +@@ -355,8 +353,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, + } else { + char proto[32]; + /* get the control url */ +- st = s->streams[s->nb_streams - 1]; +- rtsp_st = st->priv_data; ++ rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1]; + + /* XXX: may need to add full url resolution */ + av_url_split(proto, sizeof(proto), NULL, 0, NULL, 0, +@@ -377,7 +374,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, + get_word(buf1, sizeof(buf1), &p); + payload_type = atoi(buf1); + st = s->streams[s->nb_streams - 1]; +- rtsp_st = st->priv_data; ++ rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1]; + sdp_parse_rtpmap(s, st, rtsp_st, payload_type, p); + } else if (av_strstart(p, "fmtp:", &p) || + av_strstart(p, "framesize:", &p)) { +@@ -385,9 +382,8 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, + // let dynamic protocol handlers have a stab at the line. + get_word(buf1, sizeof(buf1), &p); + payload_type = atoi(buf1); +- for (i = 0; i < s->nb_streams; i++) { +- st = s->streams[i]; +- rtsp_st = st->priv_data; ++ for (i = 0; i < rt->nb_rtsp_streams; i++) { ++ rtsp_st = rt->rtsp_streams[i]; + if (rtsp_st->sdp_payload_type == payload_type && + rtsp_st->dynamic_handler && + rtsp_st->dynamic_handler->parse_sdp_a_line) +@@ -417,7 +413,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, + if (rt->server_type == RTSP_SERVER_REAL) + ff_real_parse_sdp_a_line(s, s->nb_streams - 1, p); + +- rtsp_st = s->streams[s->nb_streams - 1]->priv_data; ++ rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1]; + if (rtsp_st->dynamic_handler && + rtsp_st->dynamic_handler->parse_sdp_a_line) + rtsp_st->dynamic_handler->parse_sdp_a_line(s, +diff --git a/libavformat/rtspenc.c b/libavformat/rtspenc.c +index d54be1a..34deeeb 100644 +--- a/libavformat/rtspenc.c ++++ b/libavformat/rtspenc.c +@@ -79,14 +79,12 @@ int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr) + /* Set up the RTSPStreams for each AVStream */ + for (i = 0; i < s->nb_streams; i++) { + RTSPStream *rtsp_st; +- AVStream *st = s->streams[i]; + + rtsp_st = av_mallocz(sizeof(RTSPStream)); + if (!rtsp_st) + return AVERROR(ENOMEM); + dynarray_add(&rt->rtsp_streams, &rt->nb_rtsp_streams, rtsp_st); + +- st->priv_data = rtsp_st; + rtsp_st->stream_index = i; + + av_strlcpy(rtsp_st->control_url, rt->control_uri, sizeof(rtsp_st->control_url)); +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0039-spdifenc-fix-byte-order-on-big-endian-systems.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0039-spdifenc-fix-byte-order-on-big-endian-systems.patch new file mode 100644 index 00000000..fb8bc680 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0039-spdifenc-fix-byte-order-on-big-endian-systems.patch @@ -0,0 +1,121 @@ +From a8dd9e056114a80d11c77efbdfe4b22610f452db Mon Sep 17 00:00:00 2001 +From: Anssi Hannula +Date: Mon, 27 Dec 2010 05:16:54 +0200 +Subject: [PATCH] spdifenc: fix byte order on big-endian systems + +There is a check for HAVE_BIGENDIAN when outputting the IEC 61937 +stream. On big-endian systems the payload data is not byteswapped, +causing in effect the outputted payload data to be in a different byte +order on big-endian than on little-endian systems. + +However, the IEC 61937 preamble (and the final odd byte if present) is +always outputted in the same byte order. This means that on big-endian +systems the headers have a different byte order than the payload, +preventing useful use of the output. + +Fix that by outputting the data in a format suitable for sending to an +audio device in S16LE format by default. Output as big-endian (S16BE) +is added as an AVOption. This makes the muxer output the same on all +archs by default. + +--- + +Other ways to fix this would be to +a) simply always output in little-endian format, or +b) always output in native-endian format (i.e. different muxer output +depending on arch), or +c) have two different logical muxers. +--- + libavformat/spdifenc.c | 35 +++++++++++++++++++++++++++++------ + 1 files changed, 29 insertions(+), 6 deletions(-) + +diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c +index 3eea31e..9b0001c 100644 +--- a/libavformat/spdifenc.c ++++ b/libavformat/spdifenc.c +@@ -49,6 +49,7 @@ + #include "libavcodec/ac3.h" + #include "libavcodec/dca.h" + #include "libavcodec/aacadtsdec.h" ++#include "libavutil/opt.h" + + typedef struct IEC61937Context { + enum IEC61937DataType data_type;///< burst info - reference to type of payload of the data-burst +@@ -68,11 +69,22 @@ typedef struct IEC61937Context { + int hd_buf_count; ///< number of frames in the hd audio buffer + int hd_buf_filled; ///< amount of bytes in the hd audio buffer + ++ /* AVOptions: */ ++#define SPDIF_FLAG_BIGENDIAN 0x01 ++ int spdif_flags; ++ + /// function, which generates codec dependent header information. + /// Sets data_type and pkt_offset, and length_code, out_bytes, out_buf if necessary + int (*header_info) (AVFormatContext *s, AVPacket *pkt); + } IEC61937Context; + ++static const AVOption options[] = { ++{ "spdif_flags", "IEC 61937 encapsulation flags", offsetof(IEC61937Context, spdif_flags), FF_OPT_TYPE_FLAGS, 0, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "spdif_flags" }, ++{ "be", "output in big-endian format (for use as s16be)", 0, FF_OPT_TYPE_CONST, SPDIF_FLAG_BIGENDIAN, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "spdif_flags" }, ++{ NULL }, ++}; ++ ++static const AVClass class = { "spdif", av_default_item_name, options, LIBAVUTIL_VERSION_INT }; + + static int spdif_header_ac3(AVFormatContext *s, AVPacket *pkt) + { +@@ -330,6 +342,15 @@ static int spdif_write_trailer(AVFormatContext *s) + return 0; + } + ++static void spdif_put_16(struct AVFormatContext *s, unsigned int val) ++{ ++ IEC61937Context *ctx = s->priv_data; ++ if (ctx->spdif_flags & SPDIF_FLAG_BIGENDIAN) ++ put_be16(s->pb, val); ++ else ++ put_le16(s->pb, val); ++} ++ + static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt) + { + IEC61937Context *ctx = s->priv_data; +@@ -354,13 +375,13 @@ static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt) + } + + if (ctx->use_preamble) { +- put_le16(s->pb, SYNCWORD1); //Pa +- put_le16(s->pb, SYNCWORD2); //Pb +- put_le16(s->pb, ctx->data_type); //Pc +- put_le16(s->pb, ctx->length_code);//Pd ++ spdif_put_16(s, SYNCWORD1); //Pa ++ spdif_put_16(s, SYNCWORD2); //Pb ++ spdif_put_16(s, ctx->data_type); //Pc ++ spdif_put_16(s, ctx->length_code);//Pd + } + +- if (HAVE_BIGENDIAN ^ ctx->extra_bswap) { ++ if (ctx->extra_bswap ^ (ctx->spdif_flags & SPDIF_FLAG_BIGENDIAN)) { + put_buffer(s->pb, ctx->out_buf, ctx->out_bytes & ~1); + } else { + av_fast_malloc(&ctx->buffer, &ctx->buffer_size, ctx->out_bytes + FF_INPUT_BUFFER_PADDING_SIZE); +@@ -370,8 +391,9 @@ static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt) + put_buffer(s->pb, ctx->buffer, ctx->out_bytes & ~1); + } + ++ /* a final lone byte has to be MSB aligned */ + if (ctx->out_bytes & 1) +- put_be16(s->pb, ctx->out_buf[ctx->out_bytes - 1]); ++ spdif_put_16(s, ctx->out_buf[ctx->out_bytes - 1] << 8); + + put_nbyte(s->pb, 0, padding); + +@@ -393,4 +415,5 @@ AVOutputFormat ff_spdif_muxer = { + spdif_write_header, + spdif_write_packet, + spdif_write_trailer, ++ .priv_class = &class, + }; +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0040-Add-our-MAX_STREAMS-hack-back-it-was-lost-after-the-.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0040-Add-our-MAX_STREAMS-hack-back-it-was-lost-after-the-.patch new file mode 100644 index 00000000..25b05416 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0040-Add-our-MAX_STREAMS-hack-back-it-was-lost-after-the-.patch @@ -0,0 +1,28 @@ +From 03e5595ec1d5a87d61a67443634b0c56af7cd22c Mon Sep 17 00:00:00 2001 +From: theuni +Date: Mon, 7 Feb 2011 16:00:50 -0500 +Subject: [PATCH] Add our MAX_STREAMS hack back, it was lost after the ffmpeg update. + +Fixes playback of some streams (one of my test mkvs). + +This should be removed on ffmpeg major version bump. +--- + lib/ffmpeg/libavformat/avformat.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/lib/ffmpeg/libavformat/avformat.h b/lib/ffmpeg/libavformat/avformat.h +index f9f9be5..dec8091 100644 +--- a/lib/ffmpeg/libavformat/avformat.h ++++ b/lib/ffmpeg/libavformat/avformat.h +@@ -667,7 +667,7 @@ typedef struct AVChapter { + } AVChapter; + + #if FF_API_MAX_STREAMS +-#define MAX_STREAMS 20 ++#define MAX_STREAMS 100 + #endif + + /** +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0041-lavf-update-ff_probe_input_buffer-documentation.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0041-lavf-update-ff_probe_input_buffer-documentation.patch new file mode 100644 index 00000000..392fdabb --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0041-lavf-update-ff_probe_input_buffer-documentation.patch @@ -0,0 +1,29 @@ +From acdac292f7c1691d21e19c1e9a993e501883fd6b Mon Sep 17 00:00:00 2001 +From: Anssi Hannula +Date: Tue, 8 Feb 2011 00:46:51 +0200 +Subject: [PATCH 41/43] lavf: update ff_probe_input_buffer documentation + +It never reopens the bytestream anymore. + +Signed-off-by: Ronald S. Bultje +(cherry picked from commit 4d016dd4e5b288b3c0c7396935326cb07a289ac2) +--- + libavformat/internal.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libavformat/internal.h b/libavformat/internal.h +index b401d35..a17d9c6 100644 +--- a/libavformat/internal.h ++++ b/libavformat/internal.h +@@ -88,7 +88,7 @@ uint64_t ff_ntp_time(void); + * attempt is made. When the maximum probe size is reached, the input format + * with the highest score is returned. + * +- * @param pb the bytestream to probe, it may be closed and opened again ++ * @param pb the bytestream to probe + * @param fmt the input format is put here + * @param filename the filename of the stream + * @param logctx the log context +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0042-lavf-simplify-pb-parameter-of-ff_probe_input_buffer.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0042-lavf-simplify-pb-parameter-of-ff_probe_input_buffer.patch new file mode 100644 index 00000000..f2b8baf7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0042-lavf-simplify-pb-parameter-of-ff_probe_input_buffer.patch @@ -0,0 +1,71 @@ +From c0cbd02d3bcd49f4258a9ba86004e70a56bb3a64 Mon Sep 17 00:00:00 2001 +From: Anssi Hannula +Date: Tue, 8 Feb 2011 00:46:52 +0200 +Subject: [PATCH 42/43] lavf: simplify pb parameter of ff_probe_input_buffer + +There is no need to pass the ByteIOContext via a pointer to a pointer +anymore. + +Signed-off-by: Ronald S. Bultje +(cherry picked from commit aad216fd7e3209fe0a865d8751e680925f6654d3) +--- + libavformat/internal.h | 2 +- + libavformat/utils.c | 8 ++++---- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/libavformat/internal.h b/libavformat/internal.h +index a17d9c6..f2f3ddc 100644 +--- a/libavformat/internal.h ++++ b/libavformat/internal.h +@@ -97,7 +97,7 @@ uint64_t ff_ntp_time(void); + * @return 0 in case of success, a negative value corresponding to an + * AVERROR code otherwise + */ +-int ff_probe_input_buffer(ByteIOContext **pb, AVInputFormat **fmt, ++int ff_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt, + const char *filename, void *logctx, + unsigned int offset, unsigned int max_probe_size); + +diff --git a/libavformat/utils.c b/libavformat/utils.c +index e2881ba..f5b22a2 100644 +--- a/libavformat/utils.c ++++ b/libavformat/utils.c +@@ -524,7 +524,7 @@ int av_open_input_stream(AVFormatContext **ic_ptr, + #define PROBE_BUF_MIN 2048 + #define PROBE_BUF_MAX (1<<20) + +-int ff_probe_input_buffer(ByteIOContext **pb, AVInputFormat **fmt, ++int ff_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt, + const char *filename, void *logctx, + unsigned int offset, unsigned int max_probe_size) + { +@@ -555,7 +555,7 @@ int ff_probe_input_buffer(ByteIOContext **pb, AVInputFormat **fmt, + + /* read probe data */ + buf = av_realloc(buf, probe_size + AVPROBE_PADDING_SIZE); +- if ((ret = get_buffer(*pb, buf + buf_offset, probe_size - buf_offset)) < 0) { ++ if ((ret = get_buffer(pb, buf + buf_offset, probe_size - buf_offset)) < 0) { + /* fail if error was not end of file, otherwise, lower score */ + if (ret != AVERROR_EOF) { + av_free(buf); +@@ -585,7 +585,7 @@ int ff_probe_input_buffer(ByteIOContext **pb, AVInputFormat **fmt, + } + + /* rewind. reuse probe buffer to avoid seeking */ +- if ((ret = ff_rewind_with_probe_data(*pb, buf, pd.buf_size)) < 0) ++ if ((ret = ff_rewind_with_probe_data(pb, buf, pd.buf_size)) < 0) + av_free(buf); + + return ret; +@@ -622,7 +622,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, + if (buf_size > 0) { + url_setbufsize(pb, buf_size); + } +- if (!fmt && (err = ff_probe_input_buffer(&pb, &fmt, filename, logctx, 0, logctx ? (*ic_ptr)->probesize : 0)) < 0) { ++ if (!fmt && (err = ff_probe_input_buffer(pb, &fmt, filename, logctx, 0, logctx ? (*ic_ptr)->probesize : 0)) < 0) { + goto fail; + } + } +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0043-lavf-rename-ff_probe_input_buffer-to-make-it-public.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0043-lavf-rename-ff_probe_input_buffer-to-make-it-public.patch new file mode 100644 index 00000000..d70e2726 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0043-lavf-rename-ff_probe_input_buffer-to-make-it-public.patch @@ -0,0 +1,100 @@ +From 90a931ab9378be64cdffb33f8490b6891ebb9ad8 Mon Sep 17 00:00:00 2001 +From: Anssi Hannula +Date: Tue, 8 Feb 2011 00:46:53 +0200 +Subject: [PATCH 43/43] lavf: rename ff_probe_input_buffer to make it public + +It is useful for applications that hand input data directly to lavf via +a ByteIOContext. + +Signed-off-by: Ronald S. Bultje +--- + libavformat/avformat.h | 19 +++++++++++++++++++ + libavformat/internal.h | 19 ------------------- + libavformat/utils.c | 4 ++-- + 3 files changed, 21 insertions(+), 21 deletions(-) + +diff --git a/libavformat/avformat.h b/libavformat/avformat.h +index dec8091..a08d843 100644 +--- a/libavformat/avformat.h ++++ b/libavformat/avformat.h +@@ -1039,6 +1039,25 @@ AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened); + AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max); + + /** ++ * Probe a bytestream to determine the input format. Each time a probe returns ++ * with a score that is too low, the probe buffer size is increased and another ++ * attempt is made. When the maximum probe size is reached, the input format ++ * with the highest score is returned. ++ * ++ * @param pb the bytestream to probe ++ * @param fmt the input format is put here ++ * @param filename the filename of the stream ++ * @param logctx the log context ++ * @param offset the offset within the bytestream to probe from ++ * @param max_probe_size the maximum probe buffer size (zero for default) ++ * @return 0 in case of success, a negative value corresponding to an ++ * AVERROR code otherwise ++ */ ++int av_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt, ++ const char *filename, void *logctx, ++ unsigned int offset, unsigned int max_probe_size); ++ ++/** + * Allocate all the structures needed to read an input stream. + * This does not open the needed codecs for decoding the stream[s]. + */ +diff --git a/libavformat/internal.h b/libavformat/internal.h +index f2f3ddc..738b59d 100644 +--- a/libavformat/internal.h ++++ b/libavformat/internal.h +@@ -82,25 +82,6 @@ void ff_read_frame_flush(AVFormatContext *s); + /** Get the current time since NTP epoch in microseconds. */ + uint64_t ff_ntp_time(void); + +-/** +- * Probe a bytestream to determine the input format. Each time a probe returns +- * with a score that is too low, the probe buffer size is increased and another +- * attempt is made. When the maximum probe size is reached, the input format +- * with the highest score is returned. +- * +- * @param pb the bytestream to probe +- * @param fmt the input format is put here +- * @param filename the filename of the stream +- * @param logctx the log context +- * @param offset the offset within the bytestream to probe from +- * @param max_probe_size the maximum probe buffer size (zero for default) +- * @return 0 in case of success, a negative value corresponding to an +- * AVERROR code otherwise +- */ +-int ff_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt, +- const char *filename, void *logctx, +- unsigned int offset, unsigned int max_probe_size); +- + #if FF_API_URL_SPLIT + /** + * @deprecated use av_url_split() instead +diff --git a/libavformat/utils.c b/libavformat/utils.c +index f5b22a2..bee0475 100644 +--- a/libavformat/utils.c ++++ b/libavformat/utils.c +@@ -524,7 +524,7 @@ int av_open_input_stream(AVFormatContext **ic_ptr, + #define PROBE_BUF_MIN 2048 + #define PROBE_BUF_MAX (1<<20) + +-int ff_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt, ++int av_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt, + const char *filename, void *logctx, + unsigned int offset, unsigned int max_probe_size) + { +@@ -622,7 +622,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, + if (buf_size > 0) { + url_setbufsize(pb, buf_size); + } +- if (!fmt && (err = ff_probe_input_buffer(pb, &fmt, filename, logctx, 0, logctx ? (*ic_ptr)->probesize : 0)) < 0) { ++ if (!fmt && (err = av_probe_input_buffer(pb, &fmt, filename, logctx, 0, logctx ? (*ic_ptr)->probesize : 0)) < 0) { + goto fail; + } + } +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0044-MMS-also-discover-streams-in-extended-stream-propert.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0044-MMS-also-discover-streams-in-extended-stream-propert.patch new file mode 100644 index 00000000..287b1fed --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0044-MMS-also-discover-streams-in-extended-stream-propert.patch @@ -0,0 +1,56 @@ +From 91861ce25c7f19c38afdb0f115bf90118fc19428 Mon Sep 17 00:00:00 2001 +From: Marton Balint +Date: Sat, 19 Feb 2011 17:33:15 +0100 +Subject: [PATCH] MMS: also discover streams in extended stream properties object + +Allows playback of nonprimary audio streams in multiple bitrate sources, +such as mmsh://wmscr1.dr.dk/e02ch03m + +Signed-off-by: Ronald S. Bultje +(cherry picked from commit 74d6871d6244865b5863a01c3dab16a2f06a1706) +--- + libavformat/mms.c | 28 ++++++++++++++++++++++++++++ + 1 files changed, 28 insertions(+), 0 deletions(-) + +diff --git a/lib/ffmpeg/libavformat/mms.c b/lib/ffmpeg/libavformat/mms.c +index d995a43..b541208 100644 +--- a/lib/ffmpeg/libavformat/mms.c ++++ b/lib/ffmpeg/libavformat/mms.c +@@ -115,6 +115,34 @@ int ff_mms_asf_header_parser(MMSContext *mms) + "Corrupt stream (too many A/V streams)\n"); + return AVERROR_INVALIDDATA; + } ++ } else if (!memcmp(p, ff_asf_ext_stream_header, sizeof(ff_asf_guid))) { ++ if (end - p >= 88) { ++ int stream_count = AV_RL16(p + 84), ext_len_count = AV_RL16(p + 86); ++ uint64_t skip_bytes = 88; ++ while (stream_count--) { ++ if (end - p < skip_bytes + 4) { ++ av_log(NULL, AV_LOG_ERROR, ++ "Corrupt stream (next stream name length is not in the buffer)\n"); ++ return AVERROR_INVALIDDATA; ++ } ++ skip_bytes += 4 + AV_RL16(p + skip_bytes + 2); ++ } ++ while (ext_len_count--) { ++ if (end - p < skip_bytes + 22) { ++ av_log(NULL, AV_LOG_ERROR, ++ "Corrupt stream (next extension system info length is not in the buffer)\n"); ++ return AVERROR_INVALIDDATA; ++ } ++ skip_bytes += 22 + AV_RL32(p + skip_bytes + 18); ++ } ++ if (end - p < skip_bytes) { ++ av_log(NULL, AV_LOG_ERROR, ++ "Corrupt stream (the last extension system info length is invalid)\n"); ++ return AVERROR_INVALIDDATA; ++ } ++ if (chunksize - skip_bytes > 24) ++ chunksize = skip_bytes; ++ } + } else if (!memcmp(p, ff_asf_head1_guid, sizeof(ff_asf_guid))) { + chunksize = 46; // see references [2] section 3.4. This should be set 46. + } +-- +1.7.0.4 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0045-allow-customizing-shared-library-soname-name-with-ma.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0045-allow-customizing-shared-library-soname-name-with-ma.patch new file mode 100644 index 00000000..bea1d1c7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0045-allow-customizing-shared-library-soname-name-with-ma.patch @@ -0,0 +1,42 @@ +From c2a0201aa2a34114f0588a95840ce3ff86554769 Mon Sep 17 00:00:00 2001 +From: Anssi Hannula +Date: Wed, 23 Feb 2011 19:24:07 +0200 +Subject: [PATCH] allow customizing shared library soname (name with major) + +This is a hack. +--- + configure | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/configure b/configure +index a62e131..fec801c 100755 +--- a/configure ++++ b/configure +@@ -215,6 +215,7 @@ Advanced options (experts only): + --arch=ARCH select architecture [$arch] + --cpu=CPU select the minimum required CPU (affects + instruction selection, may crash on older CPUs) ++ --custom-libname-with-major=NAME custom library name with major [$SLIBNAME_WITH_MAJOR] + --disable-asm disable all assembler optimizations + --disable-altivec disable AltiVec optimizations + --disable-amd3dnow disable 3DNow! optimizations +@@ -1131,6 +1132,7 @@ CMDLINE_SET=" + cc + cpu + cross_prefix ++ custom_libname_with_major + dep_cc + extra_version + host_cc +@@ -2477,6 +2479,8 @@ fi + + disabled static && LIBNAME="" + ++test -n "$custom_libname_with_major" && SLIBNAME_WITH_MAJOR="$custom_libname_with_major" ++ + die_license_disabled() { + enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; } + } +-- +1.7.3 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0046-os_support-fix-poll-implementation.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0046-os_support-fix-poll-implementation.patch new file mode 100644 index 00000000..262a0862 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0046-os_support-fix-poll-implementation.patch @@ -0,0 +1,29 @@ +From 9ac2085dbf1821b7995fe360038c1bf0f3940032 Mon Sep 17 00:00:00 2001 +From: Max Shakhmetov +Date: Tue, 15 Feb 2011 17:49:27 +0100 +Subject: [PATCH] os_support: fix poll() implementation + +Our poll implementation does not iterate over the pollfd array properly +while setting the revents. + +Signed-off-by: Luca Barbato +--- + libavformat/os_support.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/lib/ffmpeg/libavformat/os_support.c b/lib/ffmpeg/libavformat/os_support.c +index 4f73011..0b7b59e 100644 +--- a/lib/ffmpeg/libavformat/os_support.c ++++ b/lib/ffmpeg/libavformat/os_support.c +@@ -292,7 +292,7 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout) + if (rc < 0) + return rc; + +- for(i = 0; i < (nfds_t) n; i++) { ++ for(i = 0; i < numfds; i++) { + fds[i].revents = 0; + + if (FD_ISSET(fds[i].fd, &read_set)) fds[i].revents |= POLLIN; +-- +1.7.0.4 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0047-Backporting-ffmpeg-feature-to-parse-flv-fileposition.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0047-Backporting-ffmpeg-feature-to-parse-flv-fileposition.patch new file mode 100644 index 00000000..500aa47c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0047-Backporting-ffmpeg-feature-to-parse-flv-fileposition.patch @@ -0,0 +1,105 @@ +From 7f608129d581ce028033e399a412cde7f37bc938 Mon Sep 17 00:00:00 2001 +From: Dani +Date: Fri, 3 Jun 2011 00:02:06 -0400 +Subject: [PATCH] Backporting ffmpeg feature to parse flv filepositions so we can seek to certain points in the stream without waiting to buffer, aka pseudostreaming + +--- + lib/ffmpeg/libavformat/flvdec.c | 68 +++++++++++++++++++++++++++++++++++++++ + 1 files changed, 68 insertions(+), 0 deletions(-) + +diff --git a/lib/ffmpeg/libavformat/flvdec.c b/lib/ffmpeg/libavformat/flvdec.c +index e6081d9..f1c9eda 100644 +--- a/lib/ffmpeg/libavformat/flvdec.c ++++ b/lib/ffmpeg/libavformat/flvdec.c +@@ -30,6 +30,10 @@ + #include "avformat.h" + #include "flv.h" + ++#define KEYFRAMES_TAG "keyframes" ++#define KEYFRAMES_TIMESTAMP_TAG "times" ++#define KEYFRAMES_BYTEOFFSET_TAG "filepositions" ++ + typedef struct { + int wrong_dts; ///< wrong dts due to negative cts + } FLVContext; +@@ -124,6 +128,66 @@ static int amf_get_string(ByteIOContext *ioc, char *buffer, int buffsize) { + return length; + } + ++static int parse_keyframes_index(AVFormatContext *s, ByteIOContext *ioc, AVStream *vstream, int64_t max_pos) { ++ unsigned int timeslen = 0, fileposlen = 0, i; ++ char str_val[256]; ++ int64_t *times = NULL; ++ int64_t *filepositions = NULL; ++ int ret = AVERROR(ENOSYS); ++ int64_t initial_pos = url_ftell(ioc); ++ ++ while (url_ftell(ioc) < max_pos - 2 && amf_get_string(ioc, str_val, sizeof(str_val)) > 0) { ++ int64_t** current_array; ++ unsigned int arraylen; ++ ++ // Expect array object in context ++ if (get_byte(ioc) != AMF_DATA_TYPE_ARRAY) ++ break; ++ ++ arraylen = get_be32(ioc); ++ if(arraylen>>28) ++ break; ++ ++ if (!strcmp(KEYFRAMES_TIMESTAMP_TAG , str_val) && !times){ ++ current_array= × ++ timeslen= arraylen; ++ }else if (!strcmp(KEYFRAMES_BYTEOFFSET_TAG, str_val) && !filepositions){ ++ current_array= &filepositions; ++ fileposlen= arraylen; ++ }else // unexpected metatag inside keyframes, will not use such metadata for indexing ++ break; ++ ++ if (!(*current_array = av_mallocz(sizeof(**current_array) * arraylen))) { ++ ret = AVERROR(ENOMEM); ++ goto finish; ++ } ++ ++ for (i = 0; i < arraylen && url_ftell(ioc) < max_pos - 1; i++) { ++ if (get_byte(ioc) != AMF_DATA_TYPE_NUMBER) ++ goto finish; ++ current_array[0][i] = av_int2dbl(get_be64(ioc)); ++ } ++ if (times && filepositions) { ++ // All done, exiting at a position allowing amf_parse_object ++ // to finish parsing the object ++ ret = 0; ++ break; ++ } ++ } ++ ++ if (timeslen == fileposlen) { ++ for(i = 0; i < timeslen; i++) ++ av_add_index_entry(vstream, filepositions[i], times[i]*1000, 0, 0, AVINDEX_KEYFRAME); ++ } else ++ av_log(s, AV_LOG_WARNING, "Invalid keyframes object, skipping.\n"); ++ ++finish: ++ av_freep(×); ++ av_freep(&filepositions); ++ url_fseek(ioc, initial_pos, SEEK_SET); ++ return ret; ++} ++ + static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vstream, const char *key, int64_t max_pos, int depth) { + AVCodecContext *acodec, *vcodec; + ByteIOContext *ioc; +@@ -148,6 +212,10 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst + case AMF_DATA_TYPE_OBJECT: { + unsigned int keylen; + ++ if (!url_is_streamed(s->pb) && key && !strcmp(KEYFRAMES_TAG, key) && depth == 1) ++ if (parse_keyframes_index(s, ioc, vstream, max_pos) < 0) ++ av_log(s, AV_LOG_ERROR, "Keyframe index parsing failed\n"); ++ + while(url_ftell(ioc) < max_pos - 2 && (keylen = get_be16(ioc))) { + url_fskip(ioc, keylen); //skip key string + if(amf_parse_object(s, NULL, NULL, NULL, max_pos, depth + 1) < 0) +-- +1.7.0.4 + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0048-pgs-subtitles-forced-support.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0048-pgs-subtitles-forced-support.patch new file mode 100644 index 00000000..e5fd6c3b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0048-pgs-subtitles-forced-support.patch @@ -0,0 +1,52 @@ +Index: libavcodec/avcodec.h +=================================================================== +--- libavcodec/avcodec.h 2010-12-05 13:57:43 UTC (rev 16515) ++++ libavcodec/avcodec.h 2010-12-05 15:04:11 UTC (rev 16516) +@@ -2924,6 +2924,7 @@ + unsigned num_rects; + AVSubtitleRect **rects; + int64_t pts; ///< Same as packet pts, in AV_TIME_BASE ++ unsigned flags; + } AVSubtitle; + + /* packet functions */ + +Index: libavcodec/pgssubdec.c +=================================================================== +--- libavcodec/pgssubdec.c 2010-12-05 13:57:43 UTC (rev 16515) ++++ libavcodec/pgssubdec.c 2010-12-05 15:04:11 UTC (rev 16516) +@@ -46,6 +46,7 @@ + int y; + int id_number; + int object_number; ++ uint8_t composition_flag; + } PGSSubPresentation; + + typedef struct PGSSubPicture { +@@ -289,13 +290,14 @@ + return; + + /* +- * Skip 4 bytes of unknown: ++ * Skip 3 bytes of unknown: + * object_id_ref (2 bytes), +- * window_id_ref, +- * composition_flag (0x80 - object cropped, 0x40 - object forced) ++ * window_id_ref + */ +- buf += 4; ++ buf += 3; + ++ ctx->presentation.composition_flag = bytestream_get_byte(&buf); ++ + x = bytestream_get_be16(&buf); + y = bytestream_get_be16(&buf); + +@@ -372,6 +374,8 @@ + + memcpy(sub->rects[0]->pict.data[1], ctx->clut, sub->rects[0]->nb_colors * sizeof(uint32_t)); + ++ sub->flags = ctx->presentation.composition_flag; ++ + return 1; + } diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0049--mkv-dca-fix.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0049--mkv-dca-fix.patch new file mode 100644 index 00000000..9791e966 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0049--mkv-dca-fix.patch @@ -0,0 +1,16 @@ +Index: libavformat/matroskadec.c +=================================================================== +--- libavformat/matroskadec.c (revision 24796) ++++ libavformat/matroskadec.c (working copy) +@@ -1435,6 +1435,10 @@ + st->codec->channels = track->audio.channels; + if (st->codec->codec_id != CODEC_ID_AAC) + st->need_parsing = AVSTREAM_PARSE_HEADERS; ++ if (st->codec->codec_id == CODEC_ID_DTS) { ++ st->need_parsing = AVSTREAM_PARSE_FULL; ++ st->codec->channels = 0; ++ } + } else if (track->type == MATROSKA_TRACK_TYPE_SUBTITLE) { + st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; + } + diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0050-h264-mpegts-no-bframes.patch b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0050-h264-mpegts-no-bframes.patch new file mode 100644 index 00000000..c405ffef --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/patches/0050-h264-mpegts-no-bframes.patch @@ -0,0 +1,17 @@ +diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_parser.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_parser.c +index c5728e2..3075b8b 100644 +--- a/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_parser.c ++++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/libavcodec/h264_parser.c +@@ -251,6 +251,12 @@ static int h264_parse(AVCodecParserContext *s, + h->got_first = 1; + if (avctx->extradata_size) { + h->s.avctx = avctx; ++ // must be done like in decoder, otherwise opening the parser, ++ // letting it create extradata and then closing and opening again ++ // will cause has_b_frames to be always set. ++ // Note that estimate_timings_from_pts does exactly this. ++ if (!avctx->has_b_frames) ++ h->s.low_delay = 1; + ff_h264_decode_extradata(h); + } + } diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/base64.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/base64.c new file mode 100644 index 00000000..75ba8bc5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/base64.c @@ -0,0 +1,53 @@ +/* + * 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 + */ + +/* + * Based on libavutil/base64.c + */ + +#include + +int main(void) +{ + static const char b64[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + unsigned i_bits = 0; + int i_shift = 0; + int out_len = 0; + int in; + +#define putb64() do { \ + putchar(b64[(i_bits << 6 >> i_shift) & 0x3f]); \ + out_len++; \ + i_shift -= 6; \ + } while (0) + + while ((in = getchar()) != EOF) { + i_bits = (i_bits << 8) + in; + i_shift += 8; + while (i_shift > 6) + putb64(); + } + while (i_shift > 0) + putb64(); + while (out_len++ & 3) + putchar('='); + putchar('\n'); + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/copy.regression.ref b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/copy.regression.ref new file mode 100644 index 00000000..0f62a7be --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/copy.regression.ref @@ -0,0 +1,465 @@ +---------------- +./tests/data/a-ac3.rm +first.nut second.nut differ: char 34, line 1 +1dd5a62b7edb3a1bcf77626af0a85bc1 first.nut +---------------- +./tests/data/a-adpcm_ima.wav +first.nut second.nut differ: char 34, line 1 +c95390143078f08db8a3bfba5789c2da first.nut +---------------- +./tests/data/a-adpcm_ms.wav +first.nut second.nut differ: char 34, line 1 +05e4d8842f4001fed506423e1a8ef963 first.nut +---------------- +./tests/data/a-adpcm_qt.aiff +first.nut second.nut differ: char 34, line 1 +7455d87f626f05e20030f4c93ec91e69 first.nut +---------------- +./tests/data/a-adpcm_swf.flv +c0402ee010a483403a655f353e184df1 first.nut +---------------- +./tests/data/a-adpcm_yam.wav +first.nut second.nut differ: char 34, line 1 +f861047f6c6f75cdf3ce7bb78a4003ad first.nut +---------------- +./tests/data/a-alac.m4a +first.nut second.nut differ: char 34, line 1 +ab152b0b01e540e74b04a807e3882083 first.nut +---------------- +./tests/data/a-asv1.avi +636fc0dfef1830cc51cf2c182bd4a7b2 first.nut +---------------- +./tests/data/a-asv2.avi +bbfc299390378c7bdbd7463434d8fcbe first.nut +---------------- +./tests/data/a-dnxhd-1080i.mov +first.nut second.nut differ: char 113, line 1 +037e31900e6cdf7161c2a0df23d9dc9d first.nut +---------------- +./tests/data/a-dnxhd-720p-rd.dnxhd +first.nut second.nut differ: char 113, line 1 +1237abac554ea9adb2a926641eec0de0 first.nut +---------------- +./tests/data/a-dnxhd-720p.dnxhd +first.nut second.nut differ: char 113, line 1 +6694322cefa2f482bc3dac8be22eb5d5 first.nut +---------------- +./tests/data/a-dv.dv +1aa367a56d31bb45f98d820121820909 first.nut +---------------- +./tests/data/a-dv411.dv +7ef296512960e00d96850f2606b4b683 first.nut +---------------- +./tests/data/a-dv50.dv +6424dd39e22a1789a8182d7e8da224a9 first.nut +---------------- +./tests/data/a-error-mpeg4-adv.avi +715b262e3e7c9be2b59525ba0289f30e first.nut +---------------- +./tests/data/a-ffv1.avi +edada4da2170ffd3386636cff67a90f0 first.nut +---------------- +./tests/data/a-flac.flac +d5e0a6d87034c21627afb2a904412a21 first.nut +---------------- +./tests/data/a-flashsv.flv +985076a8a87df1f91b34cbb81ce96217 first.nut +---------------- +./tests/data/a-flv.flv +6d01a0eb07c15ec3d0a70bfad0615bec first.nut +---------------- +./tests/data/a-g726.wav +first.nut second.nut differ: char 34, line 1 +59540b44c97b8e1eafc53ebdaeaf3eb8 first.nut +---------------- +./tests/data/a-h261.avi +18d47cc50e05e5c855a8aec1a5d8d9ec first.nut +---------------- +./tests/data/a-h263.avi +91b67a478420a30cf10c3d872f7e799b first.nut +---------------- +./tests/data/a-h263p.avi +1e9f108181dca2dd3bb621bb45fc5834 first.nut +---------------- +./tests/data/a-huffyuv.avi +62dccc2a428b561c08497f8378ea1567 first.nut +---------------- +./tests/data/a-jpegls.avi +35f1bb0f9b14bf3eb29134784f278c4f first.nut +---------------- +./tests/data/a-ljpeg.avi +45ec1072d8e55d6cfa784cc732830f3c first.nut +---------------- +./tests/data/a-mjpeg.avi +4e6d42fdda880661de8308cfa45652ee first.nut +---------------- +./tests/data/a-mp2.mp2 +6c8d1a33dd994d63c68e5c9953b5cb8c first.nut +---------------- +./tests/data/a-mpeg1.mpg +first.nut second.nut differ: char 34, line 1 +9d444c67713ef70c06d35fd355200ed5 first.nut +---------------- +./tests/data/a-mpeg1b.mpg +first.nut second.nut differ: char 34, line 1 +9d444c67713ef70c06d35fd355200ed5 first.nut +---------------- +./tests/data/a-mpeg2.mpg +first.nut second.nut differ: char 34, line 1 +328f6a0069b76397c5ed0dcea8b69b50 first.nut +---------------- +./tests/data/a-mpeg2.mpg +first.nut second.nut differ: char 34, line 1 +328f6a0069b76397c5ed0dcea8b69b50 first.nut +---------------- +./tests/data/a-mpeg2_422.mpg +first.nut second.nut differ: char 34, line 1 +d27035bcf30801cd1bee6ac59e8f5e3e first.nut +---------------- +./tests/data/a-mpeg2i.mpg +first.nut second.nut differ: char 34, line 1 +c3351b79649825a6b9f62a2a1db633c1 first.nut +---------------- +./tests/data/a-mpeg2ivlc-qprd.mpg +first.nut second.nut differ: char 34, line 1 +d910da52fa10eb1deca10fa9443132d2 first.nut +---------------- +./tests/data/a-mpeg2reuse.mpg +first.nut second.nut differ: char 34, line 1 +c3351b79649825a6b9f62a2a1db633c1 first.nut +---------------- +./tests/data/a-mpeg2thread.mpg +first.nut second.nut differ: char 34, line 1 +c3351b79649825a6b9f62a2a1db633c1 first.nut +---------------- +./tests/data/a-mpeg2threadivlc.mpg +first.nut second.nut differ: char 34, line 1 +c3351b79649825a6b9f62a2a1db633c1 first.nut +---------------- +./tests/data/a-mpeg4-Q.avi +first.nut second.nut differ: char 34, line 1 +305bab90451e2c3b741e3aef51bc2a4c first.nut +---------------- +./tests/data/a-mpeg4-adap.avi +first.nut second.nut differ: char 34, line 1 +5d9315ec49c4122f6f23cf84cab5fc53 first.nut +---------------- +./tests/data/a-mpeg4-adv.avi +5d672bf4c2e879d6a20e349cb4dc09a6 first.nut +---------------- +./tests/data/a-mpeg4-nr.avi +0243b2e03115fe948f99da1ee10ae588 first.nut +---------------- +./tests/data/a-mpeg4-qprd.avi +first.nut second.nut differ: char 34, line 1 +5d9315ec49c4122f6f23cf84cab5fc53 first.nut +---------------- +./tests/data/a-mpeg4-rc.avi +first.nut second.nut differ: char 34, line 1 +5d9315ec49c4122f6f23cf84cab5fc53 first.nut +---------------- +./tests/data/a-mpeg4-thread.avi +first.nut second.nut differ: char 34, line 1 +6aa94d589e9e7626e51575d8a2aec6e7 first.nut +---------------- +./tests/data/a-msmpeg4.avi +836d432509ff22fd363237ef1dced5f3 first.nut +---------------- +./tests/data/a-msmpeg4v2.avi +37f253da3666fb057edecb86ed2dba39 first.nut +---------------- +./tests/data/a-odivx.mp4 +e3bd9d8a3417abc749c489e64119dbf3 first.nut +---------------- +./tests/data/a-pcm_alaw.wav +first.nut second.nut differ: char 34, line 1 +22853e7806b0f0162fd5e2573e34b03c first.nut +---------------- +./tests/data/a-pcm_f32be.au +first.nut second.nut differ: char 34, line 1 +94cb60c3107ec509af79191e86099a0e first.nut +---------------- +./tests/data/a-pcm_f32le.wav +first.nut second.nut differ: char 34, line 1 +8d887b27a8531390af5b682557631986 first.nut +---------------- +./tests/data/a-pcm_f64be.au +first.nut second.nut differ: char 34, line 1 +e0c7b64e13bb9398a57dac60806515fb first.nut +---------------- +./tests/data/a-pcm_f64le.wav +first.nut second.nut differ: char 34, line 1 +9dbb9bda0c990502e910e082a008433f first.nut +---------------- +./tests/data/a-pcm_mulaw.wav +first.nut second.nut differ: char 34, line 1 +78c4aae32fdddaba4f9caa5683018c94 first.nut +---------------- +./tests/data/a-pcm_s16be.mkv +first.nut second.nut differ: char 34, line 1 +279810a0c30a06c4ab7de154e3de140d first.nut +---------------- +./tests/data/a-pcm_s16be.mov +first.nut second.nut differ: char 42, line 1 +0a8ede3d121f17a98e9038771eb98e1a first.nut +---------------- +./tests/data/a-pcm_s16le.mkv +47942f5188f8d081bcbe7fb82550b135 first.nut +---------------- +./tests/data/a-pcm_s16le.wav +first.nut second.nut differ: char 34, line 1 +9f868acb99ba107750f165431f95c382 first.nut +---------------- +./tests/data/a-pcm_s24be.mov +first.nut second.nut differ: char 34, line 1 +9c96762f631851014dec14b506091cc1 first.nut +---------------- +./tests/data/a-pcm_s24daud.302 +60ecb7037b205e2013490fdadab9697b first.nut +---------------- +./tests/data/a-pcm_s24le.wav +first.nut second.nut differ: char 34, line 1 +5805a2e6e2eddede4757fd488d0d6adb first.nut +---------------- +./tests/data/a-pcm_s32be.mov +first.nut second.nut differ: char 34, line 1 +d6c868a1130be573bbe0cfc88913a60c first.nut +---------------- +./tests/data/a-pcm_s32le.wav +first.nut second.nut differ: char 34, line 1 +3e0a81669647739c490f12521f897527 first.nut +---------------- +./tests/data/a-pcm_s8.mov +first.nut second.nut differ: char 34, line 1 +a6fe0827966ee4515f27c7053d579229 first.nut +---------------- +./tests/data/a-pcm_u8.wav +first.nut second.nut differ: char 34, line 1 +f0d398fd651cdedfd7b4c5433c08fd79 first.nut +---------------- +./tests/data/a-pcm_zork.wav +first.nut second.nut differ: char 34, line 1 +69e40cc9266836a7101000677ee14a87 first.nut +---------------- +./tests/data/a-roqav.roq +first.nut second.nut differ: char 34, line 1 +0e7a57bb28054b7e319eac2ba0a4be23 first.nut +---------------- +./tests/data/a-rv10.rm +first.nut second.nut differ: char 34, line 1 +80f982c6bffea91ff45a9b320cb93c14 first.nut +---------------- +./tests/data/a-rv20.rm +first.nut second.nut differ: char 34, line 1 +5b02113c0941578ca6918215eed8a728 first.nut +---------------- +./tests/data/a-snow.avi +e73b88690aa491491ede5970641134ad first.nut +---------------- +./tests/data/a-snow53.avi +18a6b061252c8c74bd22b42a7d5b2bae first.nut +---------------- +./tests/data/a-svq1.mov +first.nut second.nut differ: char 197, line 1 +6bbe90d47c1763654e8388ce51ab911e first.nut +---------------- +./tests/data/a-wmav1.asf +first.nut second.nut differ: char 34, line 1 +c3f7bc239ff166d738b29252b47bd437 first.nut +---------------- +./tests/data/a-wmav2.asf +first.nut second.nut differ: char 34, line 1 +930f1824b9677f0b6b714f1c6ddcf825 first.nut +---------------- +./tests/data/a-wmv1.avi +206bd9985b575f61a8a580656af39beb first.nut +---------------- +./tests/data/a-wmv2.avi +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-bgr24.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-gray.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-monob.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-monow.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-rgb24.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-rgb32.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-rgb555.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-rgb565.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-yuv410p.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-yuv411p.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-yuv420p.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-yuv422p.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-yuv440p.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-yuv444p.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-yuvj420p.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-yuvj422p.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-yuvj440p.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-yuvj444p.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf-yuyv422.yuv +09178a3c2b99d4f7ad1f7a761a2b803a first.nut +---------------- +./tests/data/b-lavf.aif +first.nut second.nut differ: char 34, line 1 +3f1d3faae1671f1cf862ddb66a5c59d1 first.nut +---------------- +./tests/data/b-lavf.al +e6d4b977e74a535b039a6a1dfed2dbc1 first.nut +---------------- +./tests/data/b-lavf.asf +first.nut second.nut differ: char 34, line 1 +57727c41b3974697c0a79cfd08515ddd first.nut +---------------- +./tests/data/b-lavf.au +first.nut second.nut differ: char 34, line 1 +1da12f41bc5ea1fd851e8a48b222c204 first.nut +---------------- +./tests/data/b-lavf.avi +a88edf9fb8e02e658ba3cae9313a3cdc first.nut +---------------- +./tests/data/b-lavf.dv +first.nut second.nut differ: char 34, line 1 +819018a5d91c55312ffe784e8712ac4b first.nut +---------------- +./tests/data/b-lavf.ffm +first.nut second.nut differ: char 34, line 1 +17f8894a05c71adb51c9a0ff1b9040bb first.nut +---------------- +./tests/data/b-lavf.flv +d74edb56e74e0eea748863f3aeeafa61 first.nut +---------------- +./tests/data/b-lavf.gif +first.nut second.nut differ: char 34, line 1 +ef9ba6bf88f44d9d326049ef2872a4d3 first.nut +---------------- +./tests/data/b-lavf.gxf +first.nut second.nut differ: char 44, line 1 +522957f46ba46051fd03a0868c905e54 first.nut +---------------- +./tests/data/b-lavf.mkv +8c9427bb75c96210d6580d9b881d9e4d first.nut +---------------- +./tests/data/b-lavf.mmf +first.nut second.nut differ: char 42, line 1 +298136aef02389fc5b0844995fe6ac72 first.nut +---------------- +./tests/data/b-lavf.mov +ce895b33ff206fafbae89fd5a8f959d2 first.nut +---------------- +./tests/data/b-lavf.mpg +d279e3343993267241c2fac4f4563cdb first.nut +---------------- +./tests/data/b-lavf.mxf +first.nut second.nut differ: char 34, line 1 +3e98a90d40986b8ea4305be06175927a first.nut +---------------- +./tests/data/b-lavf.mxf_d10 +1ee69644165344a096ddfaaac951a0e9 first.nut +---------------- +./tests/data/b-lavf.nut +1426bca4c65796516a3e94b6bebc5a58 first.nut +---------------- +./tests/data/b-lavf.ogg +c986ce79045f2068ae1bedc2b8702884 first.nut +---------------- +./tests/data/b-lavf.rm +first.nut second.nut differ: char 34, line 1 +a3b2c9d3ec2c86b6d4c3bf0ed91391c3 first.nut +---------------- +./tests/data/b-lavf.swf +first.nut second.nut differ: char 34, line 1 +d4a5c5e6343dc17bed49397d889e0799 first.nut +---------------- +./tests/data/b-lavf.ts +40fd2ece0c8386d3a250943eab023795 first.nut +---------------- +./tests/data/b-lavf.ul +1c4c747e2e9c0fd195656359341eef76 first.nut +---------------- +./tests/data/b-lavf.voc +first.nut second.nut differ: char 42, line 1 +500ef42830c5bc2af849dbdcc4380f1b first.nut +---------------- +./tests/data/b-lavf.wav +first.nut second.nut differ: char 42, line 1 +8d4c6a79af442610ad912625c9b85d02 first.nut +---------------- +./tests/data/b-lavf.y4m +f42a6ff4488de306925b057ecee75b0e first.nut +---------------- +./tests/data/b-lavf02.bmp +first.nut second.nut differ: char 113, line 1 +02e3c782ef3a0c96e820201d4d4b8268 first.nut +---------------- +./tests/data/b-lavf02.jpg +61a19c3012a5aa056d8e9a589e29de2e first.nut +---------------- +./tests/data/b-lavf02.pcx +first.nut second.nut differ: char 113, line 1 +3c4e1b9c8d5dd2bedb8eebd1edc7a2f5 first.nut +---------------- +./tests/data/b-lavf02.pgm +first.nut second.nut differ: char 113, line 1 +cc36bdadd7aef501a6d5d588dec2188b first.nut +---------------- +./tests/data/b-lavf02.ppm +first.nut second.nut differ: char 113, line 1 +453ec690bea6c3668e2b65e0b7ad14c8 first.nut +---------------- +./tests/data/b-lavf02.sgi +first.nut second.nut differ: char 113, line 1 +6cdadd58aaa5ad196697352e96723e52 first.nut +---------------- +./tests/data/b-lavf02.tga +4144d2b4ee2948c1a16f7fc31b381be3 first.nut +---------------- +./tests/data/b-lavf02.tiff +first.nut second.nut differ: char 113, line 1 +237fa2da2d5f4930dae9825c9cf928a6 first.nut +---------------- +./tests/data/b-pbmpipe.pbm +first.nut second.nut differ: char 113, line 1 +2c65ef7188398da8a5f107b9dd5fb998 first.nut +---------------- +./tests/data/b-pgmpipe.pgm +first.nut second.nut differ: char 113, line 1 +b7e98248ada1e6f7170bc7fedee3825c first.nut +---------------- +./tests/data/b-ppmpipe.ppm +first.nut second.nut differ: char 113, line 1 +869fcefe430c35a9a8e46fd5f040b62e first.nut diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/copycooker.sh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/copycooker.sh new file mode 100755 index 00000000..4b5811dc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/copycooker.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +LC_ALL=C +export LC_ALL + +datadir="tests/data" + +logfile="$datadir/copy.regression" +reffile="$1" + +list=$(grep -oh ' ./tests/data/.*' tests/ref/{acodec,lavf,vsynth1}/*| sort) +rm -f $logfile +for i in $list ; do + echo ---------------- >> $logfile + echo $i >> $logfile + ./ffmpeg_g -flags +bitexact -i $i -acodec copy -vcodec copy -y first.nut + ./ffmpeg_g -flags +bitexact -i first.nut -acodec copy -vcodec copy -y second.nut + cmp first.nut second.nut >> $logfile + md5sum first.nut >> $logfile +done + +if diff -u -w "$reffile" "$logfile" ; then + echo + echo copy regression test: success + exit 0 +else + echo + echo copy regression test: error + exit 1 +fi diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate-run.sh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate-run.sh new file mode 100755 index 00000000..c4a9a13e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate-run.sh @@ -0,0 +1,139 @@ +#! /bin/sh + +export LC_ALL=C + +base=$(dirname $0) +. "${base}/md5.sh" + +base64=tests/base64 + +test="${1#fate-}" +samples=$2 +target_exec=$3 +target_path=$4 +command=$5 +cmp=${6:-diff} +ref=${7:-"${base}/ref/fate/${test}"} +fuzz=$8 + +outdir="tests/data/fate" +outfile="${outdir}/${test}" +errfile="${outdir}/${test}.err" +cmpfile="${outdir}/${test}.diff" +repfile="${outdir}/${test}.rep" + +do_tiny_psnr(){ + psnr=$(tests/tiny_psnr "$1" "$2" 2 0 0) + val=$(expr "$psnr" : ".*$3: *\([0-9.]*\)") + size1=$(expr "$psnr" : '.*bytes: *\([0-9]*\)') + size2=$(expr "$psnr" : '.*bytes:[ 0-9]*/ *\([0-9]*\)') + res=$(echo "if ($val $4 $5) 1" | bc) + if [ "$res" != 1 ] || [ $size1 != $size2 ]; then + echo "$psnr" + return 1 + fi +} + +oneoff(){ + do_tiny_psnr "$1" "$2" MAXDIFF '<=' ${fuzz:-1} +} + +stddev(){ + do_tiny_psnr "$1" "$2" stddev '<=' ${fuzz:-1} +} + +run(){ + test "${V:-0}" -gt 0 && echo "$target_exec" $target_path/"$@" >&3 + $target_exec $target_path/"$@" +} + +ffmpeg(){ + run ffmpeg -v 0 "$@" +} + +framecrc(){ + ffmpeg "$@" -f framecrc - +} + +framemd5(){ + ffmpeg "$@" -f framemd5 - +} + +crc(){ + ffmpeg "$@" -f crc - +} + +md5(){ + ffmpeg "$@" md5: +} + +pcm(){ + ffmpeg "$@" -vn -f s16le - +} + +regtest(){ + t="${test#$2-}" + ref=${base}/ref/$2/$t + cleanfiles="$cleanfiles $outfile $errfile" + outfile=tests/data/regression/$2/$t + errfile=tests/data/$t.$2.err + ${base}/${1}-regression.sh $t $2 $3 "$target_exec" "$target_path" +} + +codectest(){ + regtest codec $1 tests/$1 +} + +lavftest(){ + regtest lavf lavf tests/vsynth1 +} + +lavfitest(){ + cleanfiles="tests/data/lavfi/${test#lavfi-}.nut" + regtest lavfi lavfi tests/vsynth1 +} + +seektest(){ + t="${test#seek-}" + ref=${base}/ref/seek/$t + case $t in + image_*) file="tests/data/images/${t#image_}/%02d.${t#image_}" ;; + *) file=$(echo $t | tr _ '?') + for d in acodec vsynth2 lavf; do + test -f tests/data/$d/$file && break + done + file=$(echo tests/data/$d/$file) + ;; + esac + $target_exec $target_path/tests/seek_test $target_path/$file +} + +mkdir -p "$outdir" + +exec 3>&2 +$command > "$outfile" 2>$errfile +err=$? + +if [ $err -gt 128 ]; then + sig=$(kill -l $err 2>/dev/null) + test "${sig}" = "${sig%[!A-Za-z]*}" || unset sig +fi + +if test -e "$ref"; then + case $cmp in + diff) diff -u -w "$ref" "$outfile" >$cmpfile ;; + oneoff) oneoff "$ref" "$outfile" "$fuzz" >$cmpfile ;; + stddev) stddev "$ref" "$outfile" "$fuzz" >$cmpfile ;; + esac + cmperr=$? + test $err = 0 && err=$cmperr + test $err = 0 || cat $cmpfile +else + echo "reference file '$ref' not found" + err=1 +fi + +echo "${test}:${sig:-$err}:$($base64 <$cmpfile):$($base64 <$errfile)" >$repfile + +test $err = 0 && rm -f $outfile $errfile $cmpfile $cleanfiles +exit $err diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate-update.sh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate-update.sh new file mode 100755 index 00000000..6b4668fc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate-update.sh @@ -0,0 +1,55 @@ +#! /bin/sh + +set -e + +base=$(dirname $0) +ref="${base}/ref/fate" + +FATE_DB_URL="http://fate.multimedia.cx/fate-tests.sqlite.bz2" +FATE_DB=$(mktemp fate-db.XXXXXX) +SQL_TESTS='SELECT id,short_name,command FROM test_spec WHERE active=1 ORDER BY short_name' + +do_sql(){ + sqlite3 -noheader -separator ' ' "$FATE_DB" "$@" +} + +wget -q -O - "$FATE_DB_URL" | bunzip2 > "$FATE_DB" +mkdir -p "$ref" +exec 3>"$base/fate.mak" + +do_sql "$SQL_TESTS" | while read id name command; do + case "$name" in + 00-full-regression|ffmpeg-help|binsize-*) continue ;; + esac + case "$command" in + {MD5}*) + command="${command#*ffmpeg}"; command="${command% -}" + command="md5 $command" + ;; + {*}*) continue ;; + *-f\ framecrc\ -) + command="${command#*ffmpeg}"; command="${command% -f *}" + command="framecrc $command" + ;; + *-f\ framemd5\ -) + command="${command#*ffmpeg}"; command="${command% -f *}" + command="framemd5 $command" + ;; + *-f\ crc\ -) + command="${command#*ffmpeg}"; command="${command% -f *}" + command="crc $command" + ;; + *) + echo "Unhandled command '$command'" + exit 1 + ;; + esac + command=$(echo "$command" | sed 's/\$SAMPLES_PATH/$(SAMPLES)/g') + command=$(echo "$command" | sed 's/ *$//') + do_sql "SELECT expected_stdout FROM test_spec WHERE id=$id" | awk '/./{print}' > "$ref/$name" + printf "FATE_TESTS += fate-${name}\n" >&3 + printf "fate-${name}: CMD = %s\n" "$command" >&3 +done + +exec 3<&- +rm -f "$FATE_DB" diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate.mak b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate.mak new file mode 100644 index 00000000..21158fc1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate.mak @@ -0,0 +1,362 @@ +FATE_TESTS += fate-4xm-1 +fate-4xm-1: CMD = framecrc -i $(SAMPLES)/4xm/version1.4xm -pix_fmt rgb24 -an +FATE_TESTS += fate-4xm-2 +fate-4xm-2: CMD = framecrc -i $(SAMPLES)/4xm/version2.4xm -pix_fmt rgb24 -an +FATE_TESTS += fate-8bps +fate-8bps: CMD = framecrc -i $(SAMPLES)/8bps/full9iron-partial.mov -pix_fmt rgb24 +FATE_TESTS += fate-aac-demux +fate-aac-demux: CMD = crc -i $(SAMPLES)/aac/ct_faac-adts.aac -acodec copy +FATE_TESTS += fate-aasc +fate-aasc: CMD = framecrc -i $(SAMPLES)/aasc/AASC-1.5MB.AVI -pix_fmt rgb24 +FATE_TESTS += fate-adpcm-ea-r2 +fate-adpcm-ea-r2: CMD = crc -i $(SAMPLES)/ea-mpc/THX_logo.mpc -vn +FATE_TESTS += fate-adpcm-ea-r3 +fate-adpcm-ea-r3: CMD = crc -i $(SAMPLES)/ea-vp6/THX_logo.vp6 -vn +FATE_TESTS += fate-aea-demux +fate-aea-demux: CMD = crc -i $(SAMPLES)/aea/chirp.aea -acodec copy +FATE_TESTS += fate-alg-mm +fate-alg-mm: CMD = framecrc -i $(SAMPLES)/alg-mm/ibmlogo.mm -an -pix_fmt rgb24 +FATE_TESTS += fate-amv +fate-amv: CMD = framecrc -idct simple -i $(SAMPLES)/amv/MTV_high_res_320x240_sample_Penguin_Joke_MTV_from_WMV.amv -t 10 +FATE_TESTS += fate-armovie-escape124 +fate-armovie-escape124: CMD = framecrc -i $(SAMPLES)/rpl/ESCAPE.RPL -pix_fmt rgb24 +FATE_TESTS += fate-auravision +fate-auravision: CMD = framecrc -i $(SAMPLES)/auravision/SOUVIDEO.AVI -an +FATE_TESTS += fate-auravision-v2 +fate-auravision-v2: CMD = framecrc -i $(SAMPLES)/auravision/salma-hayek-in-ugly-betty-partial-avi -an +FATE_TESTS += fate-bethsoft-vid +fate-bethsoft-vid: CMD = framecrc -i $(SAMPLES)/bethsoft-vid/ANIM0001.VID -vsync 0 -t 5 -pix_fmt rgb24 +FATE_TESTS += fate-bfi +fate-bfi: CMD = framecrc -i $(SAMPLES)/bfi/2287.bfi -pix_fmt rgb24 +FATE_TESTS += fate-bink-demux +fate-bink-demux: CMD = crc -i $(SAMPLES)/bink/Snd0a7d9b58.dee -vn -acodec copy +FATE_TESTS += fate-bink-demux-video +fate-bink-demux-video: CMD = framecrc -i $(SAMPLES)/bink/hol2br.bik +FATE_TESTS += fate-caf +fate-caf: CMD = crc -i $(SAMPLES)/caf/caf-pcm16.caf +FATE_TESTS += fate-cdgraphics +fate-cdgraphics: CMD = framecrc -t 1 -i $(SAMPLES)/cdgraphics/BrotherJohn.cdg -pix_fmt rgb24 +FATE_TESTS += fate-cljr +fate-cljr: CMD = framecrc -i $(SAMPLES)/cljr/testcljr-partial.avi +FATE_TESTS += fate-corepng +fate-corepng: CMD = framecrc -i $(SAMPLES)/png1/corepng-partial.avi +FATE_TESTS += fate-creative-adpcm +fate-creative-adpcm: CMD = md5 -i $(SAMPLES)/creative/intro-partial.wav -f s16le +FATE_TESTS += fate-creative-adpcm-8-2.6bit +fate-creative-adpcm-8-2.6bit: CMD = md5 -i $(SAMPLES)/creative/BBC_3BIT.VOC -f s16le +FATE_TESTS += fate-creative-adpcm-8-2bit +fate-creative-adpcm-8-2bit: CMD = md5 -i $(SAMPLES)/creative/BBC_2BIT.VOC -f s16le +FATE_TESTS += fate-creative-adpcm-8-4bit +fate-creative-adpcm-8-4bit: CMD = md5 -i $(SAMPLES)/creative/BBC_4BIT.VOC -f s16le +FATE_TESTS += fate-creatureshock-avs +fate-creatureshock-avs: CMD = framecrc -i $(SAMPLES)/creatureshock-avs/OUTATIME.AVS -pix_fmt rgb24 +FATE_TESTS += fate-cryo-apc +fate-cryo-apc: CMD = md5 -i $(SAMPLES)/cryo-apc/cine007.APC -f s16le +FATE_TESTS += fate-cscd +fate-cscd: CMD = framecrc -i $(SAMPLES)/CSCD/sample_video.avi -an -vsync 0 -pix_fmt rgb24 +FATE_TESTS += fate-cvid +fate-cvid: CMD = framecrc -i $(SAMPLES)/cvid/laracroft-cinepak-partial.avi -an +FATE_TESTS += fate-cvid-palette +fate-cvid-palette: CMD = framecrc -i $(SAMPLES)/cvid/catfight-cvid-pal8-partial.mov -pix_fmt rgb24 -an +FATE_TESTS += fate-cyberia-c93 +fate-cyberia-c93: CMD = framecrc -i $(SAMPLES)/cyberia-c93/intro1.c93 -t 3 -pix_fmt rgb24 +FATE_TESTS += fate-cyuv +fate-cyuv: CMD = framecrc -i $(SAMPLES)/cyuv/cyuv.avi +FATE_TESTS += fate-d-cinema-demux +fate-d-cinema-demux: CMD = framecrc -i $(SAMPLES)/d-cinema/THX_Science_FLT_1920-partial.302 -acodec copy -pix_fmt rgb24 +FATE_TESTS += fate-delphine-cin +fate-delphine-cin: CMD = framecrc -i $(SAMPLES)/delphine-cin/LOGO-partial.CIN -pix_fmt rgb24 -vsync 0 +FATE_TESTS += fate-deluxepaint-anm +fate-deluxepaint-anm: CMD = framecrc -i $(SAMPLES)/deluxepaint-anm/INTRO1.ANM -pix_fmt rgb24 +FATE_TESTS += fate-dpx +fate-dpx: CMD = framecrc -i $(SAMPLES)/dpx/lighthouse_rgb48.dpx +FATE_TESTS += fate-duck-dk3 +fate-duck-dk3: CMD = md5 -i $(SAMPLES)/duck/sop-audio-only.avi -f s16le +FATE_TESTS += fate-duck-dk4 +fate-duck-dk4: CMD = md5 -i $(SAMPLES)/duck/salsa-audio-only.avi -f s16le +FATE_TESTS += fate-duck-tm2 +fate-duck-tm2: CMD = framecrc -i $(SAMPLES)/duck/tm20.avi +FATE_TESTS += fate-ea-cdata +fate-ea-cdata: CMD = md5 -i $(SAMPLES)/ea-cdata/166b084d.46410f77.0009b440.24be960c.cdata -f s16le +FATE_TESTS += fate-ea-cmv +fate-ea-cmv: CMD = framecrc -i $(SAMPLES)/ea-cmv/TITLE.CMV -vsync 0 -pix_fmt rgb24 +FATE_TESTS += fate-ea-dct +fate-ea-dct: CMD = framecrc -idct simple -i $(SAMPLES)/ea-dct/NFS2Esprit-partial.dct +FATE_TESTS += fate-ea-mad-adpcm-ea-r1 +fate-ea-mad-adpcm-ea-r1: CMD = framecrc -i $(SAMPLES)/ea-mad/NFS6LogoE.mad +FATE_TESTS += fate-ea-mad-pcm-planar +fate-ea-mad-pcm-planar: CMD = framecrc -i $(SAMPLES)/ea-mad/xeasport.mad +FATE_TESTS += fate-ea-tgq +fate-ea-tgq: CMD = framecrc -i $(SAMPLES)/ea-tgq/v27.tgq -an +FATE_TESTS += fate-ea-tgv-ima-ea-eacs +fate-ea-tgv-ima-ea-eacs: CMD = framecrc -i $(SAMPLES)/ea-tgv/INTRO8K-partial.TGV -pix_fmt rgb24 +FATE_TESTS += fate-ea-tgv-ima-ea-sead +fate-ea-tgv-ima-ea-sead: CMD = framecrc -i $(SAMPLES)/ea-tgv/INTEL_S.TGV -pix_fmt rgb24 +FATE_TESTS += fate-ea-tqi-adpcm +fate-ea-tqi-adpcm: CMD = framecrc -i $(SAMPLES)/ea-wve/networkBackbone-partial.wve +FATE_TESTS += fate-ea-vp60 +fate-ea-vp60: CMD = framecrc -i $(SAMPLES)/ea-vp6/g36.vp6 +FATE_TESTS += fate-ea-vp61 +fate-ea-vp61: CMD = framecrc -i $(SAMPLES)/ea-vp6/MovieSkirmishGondor.vp6 -t 4 +FATE_TESTS += fate-feeble-dxa +fate-feeble-dxa: CMD = framecrc -i $(SAMPLES)/dxa/meetsquid.dxa -t 2 -pix_fmt rgb24 +FATE_TESTS += fate-film-cvid-pcm-stereo-8bit +fate-film-cvid-pcm-stereo-8bit: CMD = framecrc -i $(SAMPLES)/film/logo-capcom.cpk +FATE_TESTS += fate-flic-af11-palette-change +fate-flic-af11-palette-change: CMD = framecrc -i $(SAMPLES)/fli/fli-engines.fli -t 3.3 -pix_fmt rgb24 +FATE_TESTS += fate-flic-af12 +fate-flic-af12: CMD = framecrc -i $(SAMPLES)/fli/jj00c2.fli -pix_fmt rgb24 +FATE_TESTS += fate-flic-magiccarpet +fate-flic-magiccarpet: CMD = framecrc -i $(SAMPLES)/fli/intel.dat -pix_fmt rgb24 +FATE_TESTS += fate-fraps-v0 +fate-fraps-v0: CMD = framecrc -i $(SAMPLES)/fraps/Griffin_Ragdoll01-partial.avi +FATE_TESTS += fate-fraps-v1 +fate-fraps-v1: CMD = framecrc -i $(SAMPLES)/fraps/sample-v1.avi -an +FATE_TESTS += fate-fraps-v2 +fate-fraps-v2: CMD = framecrc -i $(SAMPLES)/fraps/test3-nosound-partial.avi +FATE_TESTS += fate-fraps-v3 +fate-fraps-v3: CMD = framecrc -i $(SAMPLES)/fraps/psclient-partial.avi -pix_fmt rgb24 +FATE_TESTS += fate-fraps-v4 +fate-fraps-v4: CMD = framecrc -i $(SAMPLES)/fraps/WoW_2006-11-03_14-58-17-19-nosound-partial.avi +FATE_TESTS += fate-fraps-v5 +fate-fraps-v5: CMD = framecrc -i $(SAMPLES)/fraps/fraps-v5-bouncing-balls-partial.avi +FATE_TESTS += fate-frwu +fate-frwu: CMD = framecrc -i $(SAMPLES)/frwu/frwu.avi +FATE_TESTS += fate-funcom-iss +fate-funcom-iss: CMD = md5 -i $(SAMPLES)/funcom-iss/0004010100.iss -f s16le +FATE_TESTS += fate-id-cin-video +fate-id-cin-video: CMD = framecrc -i $(SAMPLES)/idcin/idlog-2MB.cin -pix_fmt rgb24 +FATE_TESTS += fate-idroq-video-dpcm +fate-idroq-video-dpcm: CMD = framecrc -i $(SAMPLES)/idroq/idlogo.roq +FATE_TESTS += fate-idroq-video-encode +fate-idroq-video-encode: CMD = md5 -t 0.2 -f image2 -vcodec pgmyuv -i $(SAMPLES)/ffmpeg-synthetic/vsynth1/%02d.pgm -sws_flags +bitexact -vf pad=512:512:80:112 -f RoQ +FATE_TESTS += fate-iff-byterun1 +fate-iff-byterun1: CMD = framecrc -i $(SAMPLES)/iff/ASH.LBM -pix_fmt rgb24 +FATE_TESTS += fate-iff-fibonacci +fate-iff-fibonacci: CMD = md5 -i $(SAMPLES)/iff/dasboot-in-compressed -f s16le +FATE_TESTS += fate-iff-ilbm +fate-iff-ilbm: CMD = framecrc -i $(SAMPLES)/iff/lms-matriks.ilbm -pix_fmt rgb24 +FATE_TESTS += fate-iff-pcm +fate-iff-pcm: CMD = md5 -i $(SAMPLES)/iff/Bells -f s16le +FATE_TESTS += fate-indeo2 +fate-indeo2: CMD = framecrc -i $(SAMPLES)/rt21/VPAR0026.AVI +FATE_TESTS += fate-indeo3 +fate-indeo3: CMD = framecrc -i $(SAMPLES)/iv32/cubes.mov +FATE_TESTS += fate-indeo5 +fate-indeo5: CMD = framecrc -i $(SAMPLES)/iv50/Educ_Movie_DeadlyForce.avi -an +FATE_TESTS += fate-interplay-mve-16bit +fate-interplay-mve-16bit: CMD = framecrc -i $(SAMPLES)/interplay-mve/descent3-level5-16bit-partial.mve -pix_fmt rgb24 +FATE_TESTS += fate-interplay-mve-8bit +fate-interplay-mve-8bit: CMD = framecrc -i $(SAMPLES)/interplay-mve/interplay-logo-2MB.mve -pix_fmt rgb24 +FATE_TESTS += fate-iv8-demux +fate-iv8-demux: CMD = framecrc -i $(SAMPLES)/iv8/zzz-partial.mpg -vsync 0 -vcodec copy +FATE_TESTS += fate-kmvc +fate-kmvc: CMD = framecrc -i $(SAMPLES)/KMVC/LOGO1.AVI -an -t 3 -pix_fmt rgb24 +FATE_TESTS += fate-lmlm4-demux +fate-lmlm4-demux: CMD = framecrc -i $(SAMPLES)/lmlm4/LMLM4_CIFat30fps.divx -t 3 -acodec copy -vcodec copy +FATE_TESTS += fate-loco-rgb +fate-loco-rgb: CMD = framecrc -i $(SAMPLES)/loco/pig-loco-rgb.avi +FATE_TESTS += fate-loco-yuy2 +fate-loco-yuy2: CMD = framecrc -i $(SAMPLES)/loco/pig-loco-0.avi +FATE_TESTS += fate-lossless-appleaudio +fate-lossless-appleaudio: CMD = md5 -i $(SAMPLES)/lossless-audio/inside.m4a -f s16le +FATE_TESTS += fate-lossless-meridianaudio +fate-lossless-meridianaudio: CMD = md5 -i $(SAMPLES)/lossless-audio/luckynight-partial.mlp -f s16le +FATE_TESTS += fate-lossless-monkeysaudio +fate-lossless-monkeysaudio: CMD = md5 -i $(SAMPLES)/lossless-audio/luckynight-partial.ape -f s16le +FATE_TESTS += fate-lossless-shortenaudio +fate-lossless-shortenaudio: CMD = md5 -i $(SAMPLES)/lossless-audio/luckynight-partial.shn -f s16le +FATE_TESTS += fate-lossless-tta +fate-lossless-tta: CMD = crc -i $(SAMPLES)/lossless-audio/inside.tta +FATE_TESTS += fate-lossless-wavpackaudio +fate-lossless-wavpackaudio: CMD = md5 -i $(SAMPLES)/lossless-audio/luckynight-partial.wv -f s16le +FATE_TESTS += fate-maxis-xa +fate-maxis-xa: CMD = md5 -i $(SAMPLES)/maxis-xa/SC2KBUG.XA -f s16le +FATE_TESTS += fate-mimic +fate-mimic: CMD = framecrc -idct simple -i $(SAMPLES)/mimic/mimic2-womanloveffmpeg.cam -vsync 0 +FATE_TESTS += fate-motionpixels +fate-motionpixels: CMD = framecrc -i $(SAMPLES)/motion-pixels/INTRO-partial.MVI -an -pix_fmt rgb24 +FATE_TESTS += fate-mpc7-demux +fate-mpc7-demux: CMD = crc -i $(SAMPLES)/musepack/inside-mp7.mpc -acodec copy +FATE_TESTS += fate-mpc8-demux +fate-mpc8-demux: CMD = crc -i $(SAMPLES)/musepack/inside-mp8.mpc -acodec copy +FATE_TESTS += fate-msrle-8bit +fate-msrle-8bit: CMD = framecrc -i $(SAMPLES)/msrle/Search-RLE.avi -pix_fmt rgb24 +FATE_TESTS += fate-msvideo1-16bit +fate-msvideo1-16bit: CMD = framecrc -i $(SAMPLES)/cram/clock-cram16.avi -pix_fmt rgb24 +FATE_TESTS += fate-msvideo1-8bit +fate-msvideo1-8bit: CMD = framecrc -i $(SAMPLES)/cram/skating.avi -t 1 -pix_fmt rgb24 +FATE_TESTS += fate-mszh +fate-mszh: CMD = framecrc -i $(SAMPLES)/lcl/mszh-1frame.avi +FATE_TESTS += fate-mtv +fate-mtv: CMD = framecrc -i $(SAMPLES)/mtv/comedian_auto-partial.mtv -acodec copy -pix_fmt rgb24 +FATE_TESTS += fate-mxf-demux +fate-mxf-demux: CMD = framecrc -i $(SAMPLES)/mxf/C0023S01.mxf -acodec copy -vcodec copy +FATE_TESTS += fate-nc-demux +fate-nc-demux: CMD = framecrc -i $(SAMPLES)/nc-camera/nc-sample-partial -vcodec copy +FATE_TESTS += fate-nsv-demux +fate-nsv-demux: CMD = framecrc -i $(SAMPLES)/nsv/witchblade-51kbps.nsv -t 6 -vcodec copy -acodec copy +FATE_TESTS += fate-nuv +fate-nuv: CMD = framecrc -idct simple -i $(SAMPLES)/nuv/Today.nuv +FATE_TESTS += fate-oma-demux +fate-oma-demux: CMD = crc -i $(SAMPLES)/oma/01-Untitled-partial.oma -acodec copy +FATE_TESTS += fate-pcm_dvd +fate-pcm_dvd: CMD = framecrc -i $(SAMPLES)/pcm-dvd/coolitnow-partial.vob -vn +FATE_TESTS += fate-psx-str +fate-psx-str: CMD = framecrc -i $(SAMPLES)/psx-str/descent-partial.str +FATE_TESTS += fate-psx-str-v3 +fate-psx-str-v3: CMD = framecrc -i $(SAMPLES)/psx-str/abc000_cut.str +FATE_TESTS += fate-ptx +fate-ptx: CMD = framecrc -i $(SAMPLES)/ptx/_113kw_pic.ptx -pix_fmt rgb24 +FATE_TESTS += fate-pva-demux +fate-pva-demux: CMD = framecrc -idct simple -i $(SAMPLES)/pva/PVA_test-partial.pva -t 0.6 -acodec copy +FATE_TESTS += fate-qcp-demux +fate-qcp-demux: CMD = crc -i $(SAMPLES)/qcp/0036580847.QCP -acodec copy +FATE_TESTS += fate-qpeg +fate-qpeg: CMD = framecrc -i $(SAMPLES)/qpeg/Clock.avi -an -pix_fmt rgb24 +FATE_TESTS += fate-qt-alaw-mono +fate-qt-alaw-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-16-B-alaw.mov -f s16le +FATE_TESTS += fate-qt-alaw-stereo +fate-qt-alaw-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-16-B-alaw.mov -f s16le +FATE_TESTS += fate-qt-ima4-mono +fate-qt-ima4-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-16-B-ima4.mov -f s16le +FATE_TESTS += fate-qt-ima4-stereo +fate-qt-ima4-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-16-B-ima4.mov -f s16le +FATE_TESTS += fate-qt-mac3-mono +fate-qt-mac3-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-8-MAC3.mov -f s16le +FATE_TESTS += fate-qt-mac3-stereo +fate-qt-mac3-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-8-MAC3.mov -f s16le +FATE_TESTS += fate-qt-mac6-mono +fate-qt-mac6-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-8-MAC6.mov -f s16le +FATE_TESTS += fate-qt-mac6-stereo +fate-qt-mac6-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-8-MAC6.mov -f s16le +FATE_TESTS += fate-qt-msadpcm-stereo +fate-qt-msadpcm-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-16-L-ms02.mov -f s16le +FATE_TESTS += fate-qt-msimaadpcm-stereo +fate-qt-msimaadpcm-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-16-L-ms11.mov -f s16le +FATE_TESTS += fate-qt-rawpcm-16bit-stereo-signed-be +fate-qt-rawpcm-16bit-stereo-signed-be: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-16-B-twos.mov -f s16le +FATE_TESTS += fate-qt-rawpcm-16bit-stereo-signed-le +fate-qt-rawpcm-16bit-stereo-signed-le: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-16-L-sowt.mov -f s16le +FATE_TESTS += fate-qt-rawpcm-8bit-mono-unsigned +fate-qt-rawpcm-8bit-mono-unsigned: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-8-raw.mov -f s16le +FATE_TESTS += fate-qt-rawpcm-8bit-stereo-unsigned +fate-qt-rawpcm-8bit-stereo-unsigned: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-8-raw.mov -f s16le +FATE_TESTS += fate-qt-ulaw-mono +fate-qt-ulaw-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-16-B-ulaw.mov -f s16le +FATE_TESTS += fate-qt-ulaw-stereo +fate-qt-ulaw-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-16-B-ulaw.mov -f s16le +FATE_TESTS += fate-qtrle-16bit +fate-qtrle-16bit: CMD = framecrc -i $(SAMPLES)/qtrle/mr-cork-rle.mov -pix_fmt rgb24 +FATE_TESTS += fate-qtrle-1bit +fate-qtrle-1bit: CMD = framecrc -i $(SAMPLES)/qtrle/Animation-Monochrome.mov +FATE_TESTS += fate-qtrle-24bit +fate-qtrle-24bit: CMD = framecrc -i $(SAMPLES)/qtrle/aletrek-rle.mov -vsync 0 +FATE_TESTS += fate-qtrle-2bit +fate-qtrle-2bit: CMD = framecrc -i $(SAMPLES)/qtrle/Animation-4Greys.mov -pix_fmt rgb24 +FATE_TESTS += fate-qtrle-32bit +fate-qtrle-32bit: CMD = framecrc -i $(SAMPLES)/qtrle/ultra_demo_720_480_32bpp_rle.mov -pix_fmt rgb24 +FATE_TESTS += fate-qtrle-4bit +fate-qtrle-4bit: CMD = framecrc -i $(SAMPLES)/qtrle/Animation-16Greys.mov -pix_fmt rgb24 -an +FATE_TESTS += fate-qtrle-8bit +fate-qtrle-8bit: CMD = framecrc -i $(SAMPLES)/qtrle/criticalpath-credits.mov -vsync 0 -pix_fmt rgb24 -an +FATE_TESTS += fate-quickdraw +fate-quickdraw: CMD = framecrc -i $(SAMPLES)/quickdraw/Airplane.mov -pix_fmt rgb24 +FATE_TESTS += fate-real-14_4 +fate-real-14_4: CMD = md5 -i $(SAMPLES)/real/ra3_in_rm_file.rm -f s16le +FATE_TESTS += fate-real-rv40 +fate-real-rv40: CMD = framecrc -i $(SAMPLES)/real/spygames-2MB.rmvb -t 10 -an +FATE_TESTS += fate-redcode-demux +fate-redcode-demux: CMD = framecrc -i $(SAMPLES)/r3d/4MB-sample.r3d -vcodec copy -acodec copy +FATE_TESTS += fate-rl2 +fate-rl2: CMD = framecrc -i $(SAMPLES)/rl2/Z4915300.RL2 -pix_fmt rgb24 -an -vsync 0 +FATE_TESTS += fate-rpza +fate-rpza: CMD = framecrc -i $(SAMPLES)/rpza/rpza2.mov -t 2 -pix_fmt rgb24 +FATE_TESTS += fate-sierra-audio +fate-sierra-audio: CMD = md5 -i $(SAMPLES)/sol/lsl7sample.sol -f s16le +FATE_TESTS += fate-sierra-vmd +fate-sierra-vmd: CMD = framecrc -i $(SAMPLES)/vmd/12.vmd -vsync 0 -pix_fmt rgb24 +FATE_TESTS += fate-siff +fate-siff: CMD = framecrc -i $(SAMPLES)/SIFF/INTRO_B.VB -t 3 -pix_fmt rgb24 +FATE_TESTS += fate-smacker +fate-smacker: CMD = framecrc -i $(SAMPLES)/smacker/wetlogo.smk -pix_fmt rgb24 +FATE_TESTS += fate-smc +fate-smc: CMD = framecrc -i $(SAMPLES)/smc/cass_schi.qt -vsync 0 -pix_fmt rgb24 +FATE_TESTS += fate-sp5x +fate-sp5x: CMD = framecrc -idct simple -i $(SAMPLES)/sp5x/sp5x_problem.avi +FATE_TESTS += fate-sub-srt +fate-sub-srt: CMD = md5 -i $(SAMPLES)/sub/SubRip_capability_tester.srt -f ass +FATE_TESTS += fate-sunraster-1bit-raw +fate-sunraster-1bit-raw: CMD = framecrc -i $(SAMPLES)/sunraster/lena-1bit-raw.sun +FATE_TESTS += fate-sunraster-1bit-rle +fate-sunraster-1bit-rle: CMD = framecrc -i $(SAMPLES)/sunraster/lena-1bit-rle.sun +FATE_TESTS += fate-sunraster-24bit-raw +fate-sunraster-24bit-raw: CMD = framecrc -i $(SAMPLES)/sunraster/lena-24bit-raw.sun +FATE_TESTS += fate-sunraster-24bit-rle +fate-sunraster-24bit-rle: CMD = framecrc -i $(SAMPLES)/sunraster/lena-24bit-rle.sun +FATE_TESTS += fate-sunraster-8bit-raw +fate-sunraster-8bit-raw: CMD = framecrc -i $(SAMPLES)/sunraster/lena-8bit-raw.sun -pix_fmt rgb24 +FATE_TESTS += fate-sunraster-8bit-rle +fate-sunraster-8bit-rle: CMD = framecrc -i $(SAMPLES)/sunraster/lena-8bit-rle.sun -pix_fmt rgb24 +FATE_TESTS += fate-svq1 +fate-svq1: CMD = framecrc -i $(SAMPLES)/svq1/marymary-shackles.mov -an -t 10 +FATE_TESTS += fate-svq3 +fate-svq3: CMD = framecrc -i $(SAMPLES)/svq3/Vertical400kbit.sorenson3.mov -t 6 -an +FATE_TESTS += fate-thp-mjpeg-adpcm +fate-thp-mjpeg-adpcm: CMD = framecrc -idct simple -i $(SAMPLES)/thp/pikmin2-opening1-partial.thp +FATE_TESTS += fate-tiertex-seq +fate-tiertex-seq: CMD = framecrc -i $(SAMPLES)/tiertex-seq/Gameover.seq -pix_fmt rgb24 +FATE_TESTS += fate-tmv +fate-tmv: CMD = framecrc -i $(SAMPLES)/tmv/pop-partial.tmv -pix_fmt rgb24 +FATE_TESTS += fate-truemotion1-15 +fate-truemotion1-15: CMD = framecrc -i $(SAMPLES)/duck/phant2-940.duk -pix_fmt rgb24 +FATE_TESTS += fate-truemotion1-24 +fate-truemotion1-24: CMD = framecrc -i $(SAMPLES)/duck/sonic3dblast_intro-partial.avi -pix_fmt rgb24 +FATE_TESTS += fate-tscc-15bit +fate-tscc-15bit: CMD = framecrc -i $(SAMPLES)/tscc/oneminute.avi -t 15 -pix_fmt rgb24 +FATE_TESTS += fate-tscc-32bit +fate-tscc-32bit: CMD = framecrc -i $(SAMPLES)/tscc/2004-12-17-uebung9-partial.avi -pix_fmt rgb24 -an +FATE_TESTS += fate-ulti +fate-ulti: CMD = framecrc -i $(SAMPLES)/ulti/hit12w.avi -an +FATE_TESTS += fate-v210 +fate-v210: CMD = framecrc -i $(SAMPLES)/v210/v210_720p-partial.avi -pix_fmt yuv422p16be -an +FATE_TESTS += fate-vc1 +fate-vc1: CMD = framecrc -i $(SAMPLES)/vc1/SA00040.vc1 +FATE_TESTS += fate-vcr1 +fate-vcr1: CMD = framecrc -i $(SAMPLES)/vcr1/VCR1test.avi -an +FATE_TESTS += fate-video-xl +fate-video-xl: CMD = framecrc -i $(SAMPLES)/vixl/pig-vixl.avi +FATE_TESTS += fate-vmnc-16bit +fate-vmnc-16bit: CMD = framecrc -i $(SAMPLES)/VMnc/test.avi -pix_fmt rgb24 +FATE_TESTS += fate-vmnc-32bit +fate-vmnc-32bit: CMD = framecrc -i $(SAMPLES)/VMnc/VS2k5DebugDemo-01-partial.avi -pix_fmt rgb24 +FATE_TESTS += fate-vp5 +fate-vp5: CMD = framecrc -i $(SAMPLES)/vp5/potter512-400-partial.avi -an +FATE_TESTS += fate-vp6a +fate-vp6a: CMD = framecrc -i $(SAMPLES)/flash-vp6/300x180-Scr-f8-056alpha.flv +FATE_TESTS += fate-vp6f +fate-vp6f: CMD = framecrc -i $(SAMPLES)/flash-vp6/clip1024.flv +FATE_TESTS += fate-vqa-cc +fate-vqa-cc: CMD = framecrc -i $(SAMPLES)/vqa/cc-demo1-partial.vqa -pix_fmt rgb24 +FATE_TESTS += fate-vqf-demux +fate-vqf-demux: CMD = md5 -i $(SAMPLES)/vqf/achterba.vqf -acodec copy -f framecrc +FATE_TESTS += fate-w64 +fate-w64: CMD = crc -i $(SAMPLES)/w64/w64-pcm16.w64 +FATE_TESTS += fate-wc3movie-xan +fate-wc3movie-xan: CMD = framecrc -i $(SAMPLES)/wc3movie/SC_32-part.MVE -pix_fmt rgb24 +FATE_TESTS += fate-westwood-aud +fate-westwood-aud: CMD = md5 -i $(SAMPLES)/westwood-aud/excellent.aud -f s16le +FATE_TESTS += fate-wnv1 +fate-wnv1: CMD = framecrc -i $(SAMPLES)/wnv1/wnv1-codec.avi -an +FATE_TESTS += fate-xan-dpcm +fate-xan-dpcm: CMD = md5 -i $(SAMPLES)/wc4-xan/wc4_2.avi -vn -f s16le +FATE_TESTS += fate-zlib +fate-zlib: CMD = framecrc -i $(SAMPLES)/lcl/zlib-1frame.avi +FATE_TESTS += fate-zmbv-15bit +fate-zmbv-15bit: CMD = framecrc -i $(SAMPLES)/zmbv/zmbv_15bit.avi -pix_fmt rgb24 -t 25 +FATE_TESTS += fate-zmbv-16bit +fate-zmbv-16bit: CMD = framecrc -i $(SAMPLES)/zmbv/zmbv_16bit.avi -pix_fmt rgb24 -t 25 +FATE_TESTS += fate-zmbv-32bit +fate-zmbv-32bit: CMD = framecrc -i $(SAMPLES)/zmbv/zmbv_32bit.avi -pix_fmt rgb24 -t 25 +FATE_TESTS += fate-zmbv-8bit +fate-zmbv-8bit: CMD = framecrc -i $(SAMPLES)/zmbv/wc2_001-partial.avi -an -pix_fmt rgb24 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate.sh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate.sh new file mode 100755 index 00000000..56729d88 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate.sh @@ -0,0 +1,114 @@ +#! /bin/sh + +config=$1 + +die(){ + echo "$@" + exit 1 +} + +test -r "$config" || die "usage: fate.sh " + +workdir=$(cd $(dirname $config) && pwd) +make=make +tar='tar c' + +. "$config" + +test -n "$slot" || die "slot not specified" +test -n "$repo" || die "repo not specified" +test -d "$samples" || die "samples location not specified" + +lock(){ + lock=$1/fate.lock + (set -C; exec >$lock) 2>/dev/null || return + trap 'rm $lock' EXIT +} + +checkout(){ + case "$repo" in + file:*|/*) src="${repo#file:}" ;; + git:*) git clone "$repo" "$src" ;; + svn:*) svn co "$repo" "$src" ;; + esac +} + +update()( + cd ${src} || return + case "$repo" in + git:*) git pull ;; + svn:*) svn up ;; + esac +) + +configure()( + cd ${build} || return + ${src}/configure \ + --prefix="${inst}" \ + --samples="${samples}" \ + --enable-gpl \ + ${arch:+--arch=$arch} \ + ${cpu:+--cpu="$cpu"} \ + ${cross_prefix:+--cross-prefix="$cross_prefix"} \ + ${cc:+--cc="$cc"} \ + ${target_os:+--target-os="$target_os"} \ + ${sysroot:+--sysroot="$sysroot"} \ + ${target_exec:+--target-exec="$target_exec"} \ + ${target_path:+--target-path="$target_path"} \ + ${extra_cflags:+--extra-cflags="$extra_cflags"} \ + ${extra_ldflags:+--extra-ldflags="$extra_ldflags"} \ + ${extra_libs:+--extra-libs="$extra_libs"} \ + ${extra_conf} +) + +compile()( + cd ${build} || return + ${make} ${makeopts} && ${make} install +) + +fate()( + cd ${build} || return + ${make} ${makeopts} -k fate +) + +clean(){ + rm -r ${build} ${inst} +} + +report(){ + date=$(date -u +%Y%m%d%H%M%S) + echo "fate:0:${date}:${slot}:${version}:$1:$2" >report + cat ${build}/config.fate ${build}/tests/data/fate/*.rep >>report + test -n "$fate_recv" && $tar report *.log | gzip | $fate_recv +} + +fail(){ + report "$@" + clean + exit +} + +mkdir -p ${workdir} || die "Error creating ${workdir}" +lock ${workdir} || die "${workdir} locked" +cd ${workdir} || die "cd ${workdir} failed" + +src=${workdir}/src +build=${workdir}/build +inst=${workdir}/install + +test -d "$src" && update || checkout || die "Error fetching source" + +cd ${workdir} + +version=$(${src}/version.sh ${src}) +test "$version" = "$(cat version-$slot 2>/dev/null)" && exit 0 +echo ${version} >version-$slot + +rm -rf "${build}" *.log +mkdir -p ${build} + +configure >configure.log 2>&1 || fail $? "error configuring" +compile >compile.log 2>&1 || fail $? "error compiling" +fate >test.log 2>&1 || fail $? "error testing" +report 0 success +clean diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/aac.mak b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/aac.mak new file mode 100644 index 00000000..05835f8f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/aac.mak @@ -0,0 +1,24 @@ +FATE_AAC += fate-aac-al04_44 +fate-aac-al04_44: CMD = pcm -i $(SAMPLES)/aac/al04_44.mp4 +fate-aac-al04_44: REF = $(SAMPLES)/aac/al04_44.s16 + +FATE_AAC += fate-aac-al07_96 +fate-aac-al07_96: CMD = pcm -i $(SAMPLES)/aac/al07_96.mp4 +fate-aac-al07_96: REF = $(SAMPLES)/aac/al07_96.s16 + +FATE_AAC += fate-aac-am00_88 +fate-aac-am00_88: CMD = pcm -i $(SAMPLES)/aac/am00_88.mp4 +fate-aac-am00_88: REF = $(SAMPLES)/aac/am00_88.s16 + +FATE_AAC += fate-aac-al_sbr_hq_cm_48_2 +fate-aac-al_sbr_hq_cm_48_2: CMD = pcm -i $(SAMPLES)/aac/al_sbr_cm_48_2.mp4 +fate-aac-al_sbr_hq_cm_48_2: REF = $(SAMPLES)/aac/al_sbr_hq_cm_48_2.s16 + +FATE_AAC += fate-aac-al_sbr_ps_06_ur +fate-aac-al_sbr_ps_06_ur: CMD = pcm -i $(SAMPLES)/aac/al_sbr_ps_06_new.mp4 +fate-aac-al_sbr_ps_06_ur: REF = $(SAMPLES)/aac/al_sbr_ps_06_ur.s16 + +FATE_TESTS += $(FATE_AAC) +fate-aac: $(FATE_AAC) +$(FATE_AAC): CMP = oneoff +$(FATE_AAC): FUZZ = 2 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/als.mak b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/als.mak new file mode 100644 index 00000000..26740342 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/als.mak @@ -0,0 +1,11 @@ +ALS_SUITE = 00 01 02 03 04 05 + +define FATE_ALS_SUITE +FATE_ALS += fate-mpeg4-als-conformance-$(1) +fate-mpeg4-als-conformance-$(1): CMD = crc -i $(SAMPLES)/lossless-audio/als_$(1)_2ch48k16b.mp4 +endef + +$(foreach N,$(ALS_SUITE),$(eval $(call FATE_ALS_SUITE,$(N)))) + +FATE_TESTS += $(FATE_ALS) +fate-als: $(FATE_ALS) diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/fft.mak b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/fft.mak new file mode 100644 index 00000000..97da53ff --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/fft.mak @@ -0,0 +1,35 @@ +FATE_FFT += fate-fft +fate-fft: libavcodec/fft-test$(EXESUF) +fate-fft: CMD = run libavcodec/fft-test + +FATE_FFT += fate-ifft +fate-ifft: libavcodec/fft-test$(EXESUF) +fate-ifft: CMD = run libavcodec/fft-test -i + +FATE_FFT += fate-mdct +fate-mdct: libavcodec/fft-test$(EXESUF) +fate-mdct: CMD = run libavcodec/fft-test -m + +FATE_FFT += fate-imdct +fate-imdct: libavcodec/fft-test$(EXESUF) +fate-imdct: CMD = run libavcodec/fft-test -m -i + +FATE_FFT += fate-rdft +fate-rdft: libavcodec/fft-test$(EXESUF) +fate-rdft: CMD = run libavcodec/fft-test -r + +FATE_FFT += fate-irdft +fate-irdft: libavcodec/fft-test$(EXESUF) +fate-irdft: CMD = run libavcodec/fft-test -r -i + +FATE_FFT += fate-dct1d +fate-dct1d: libavcodec/fft-test$(EXESUF) +fate-dct1d: CMD = run libavcodec/fft-test -d + +FATE_FFT += fate-idct1d +fate-idct1d: libavcodec/fft-test$(EXESUF) +fate-idct1d: CMD = run libavcodec/fft-test -d -i + +FATE_TESTS += $(FATE_FFT) +fate-fft-test: $(FATE_FFT) +$(FATE_FFT): REF = /dev/null diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/h264.mak b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/h264.mak new file mode 100644 index 00000000..259e1e0e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/h264.mak @@ -0,0 +1,343 @@ +FATE_H264 = aud_mw_e \ + ba1_ft_c \ + ba1_sony_d \ + ba2_sony_f \ + ba3_sva_c \ + ba_mw_d \ + bamq1_jvc_c \ + bamq2_jvc_c \ + banm_mw_d \ + basqp1_sony_c \ + caba1_sony_d \ + caba1_sva_b \ + caba2_sony_e \ + caba2_sva_b \ + caba3_sony_c \ + caba3_sva_b \ + caba3_toshiba_e \ + cabac_mot_fld0_full \ + cabac_mot_frm0_full \ + cabac_mot_mbaff0_full \ + cabac_mot_picaff0_full \ + cabaci3_sony_b \ + cabast3_sony_e \ + cabastbr3_sony_b \ + cabref3_sand_d \ + cacqp3_sony_d \ + cafi1_sva_c \ + cama1_sony_c \ + cama1_toshiba_b \ + cama1_vtc_c \ + cama2_vtc_b \ + cama3_sand_e \ + cama3_vtc_b \ + camaci3_sony_c \ + camanl1_toshiba_b \ + camanl2_toshiba_b \ + camanl3_sand_e \ + camasl3_sony_b \ + camp_mot_mbaff_l30 \ + camp_mot_mbaff_l31 \ + canl1_sony_e \ + canl1_sva_b \ + canl1_toshiba_g \ + canl2_sony_e \ + canl2_sva_b \ + canl3_sony_c \ + canl3_sva_b \ + canl4_sva_b \ + canlma2_sony_c \ + canlma3_sony_c \ + capa1_toshiba_b \ + capama3_sand_f \ + capcm1_sand_e \ + capcmnl1_sand_e \ + capm3_sony_d \ + caqp1_sony_b \ + cavlc_mot_fld0_full_b \ + cavlc_mot_frm0_full_b \ + cavlc_mot_mbaff0_full_b \ + cavlc_mot_picaff0_full_b \ + cawp1_toshiba_e \ + cawp5_toshiba_e \ + ci1_ft_b \ + ci_mw_d \ + cvbs3_sony_c \ + cvcanlma2_sony_c \ + cvfi1_sony_d \ + cvfi1_sva_c \ + cvfi2_sony_h \ + cvfi2_sva_c \ + cvma1_sony_d \ + cvma1_toshiba_b \ + cvmanl1_toshiba_b \ + cvmanl2_toshiba_b \ + cvmapaqp3_sony_e \ + cvmaqp2_sony_g \ + cvmaqp3_sony_d \ + cvmp_mot_fld_l30_b \ + cvmp_mot_frm_l31_b \ + cvnlfi1_sony_c \ + cvnlfi2_sony_h \ + cvpa1_toshiba_b \ + cvpcmnl1_sva_c \ + cvpcmnl2_sva_c \ + cvwp1_toshiba_e \ + cvwp2_toshiba_e \ + cvwp3_toshiba_e \ + cvwp5_toshiba_e \ + fi1_sony_e \ + frext-alphaconformanceg \ + frext-bcrm_freh10 \ + frext-brcm_freh11 \ + frext-brcm_freh3 \ + frext-brcm_freh4 \ + frext-brcm_freh5 \ + frext-brcm_freh8 \ + frext-brcm_freh9 \ + frext-freh12_b \ + frext-freh1_b \ + frext-freh2_b \ + frext-freh6 \ + frext-freh7_b \ + frext-frext01_jvc_d \ + frext-frext02_jvc_c \ + frext-frext1_panasonic_c \ + frext-frext2_panasonic_b \ + frext-frext3_panasonic_d \ + frext-frext4_panasonic_a \ + frext-frext_mmco4_sony_b \ + frext-hcaff1_hhi_b \ + frext-hcafr1_hhi_c \ + frext-hcafr2_hhi_a \ + frext-hcafr3_hhi_a \ + frext-hcafr4_hhi_a \ + frext-hcamff1_hhi_b \ + frext-hpca_brcm_c \ + frext-hpcadq_brcm_b \ + frext-hpcafl_bcrm_c \ + frext-hpcaflnl_bcrm_c \ + frext-hpcalq_brcm_b \ + frext-hpcamapalq_bcrm_b \ + frext-hpcamolq_brcm_b \ + frext-hpcanl_brcm_c \ + frext-hpcaq2lq_brcm_b \ + frext-hpcv_brcm_a \ + frext-hpcvfl_bcrm_a \ + frext-hpcvflnl_bcrm_a \ + frext-hpcvmolq_brcm_b \ + frext-hpcvnl_brcm_a \ + hcbp2_hhi_a \ + hcmp1_hhi_a \ + ls_sva_d \ + midr_mw_d \ + mps_mw_a \ + mr1_bt_a \ + mr1_mw_a \ + mr2_mw_a \ + mr2_tandberg_e \ + mr3_tandberg_b \ + mr4_tandberg_c \ + mr5_tandberg_c \ + mr6_bt_b \ + mr7_bt_b \ + mr8_bt_b \ + mr9_bt_b \ + mv1_brcm_d \ + nl1_sony_d \ + nl2_sony_h \ + nl3_sva_e \ + nlmq1_jvc_c \ + nlmq2_jvc_c \ + nrf_mw_e \ + sharp_mp_field_1_b \ + sharp_mp_field_2_b \ + sharp_mp_field_3_b \ + sharp_mp_paff_1r2 \ + sharp_mp_paff_2r \ + sl1_sva_b \ + sva_ba1_b \ + sva_ba2_d \ + sva_base_b \ + sva_cl1_e \ + sva_fm1_e \ + sva_nl1_b \ + sva_nl2_e \ + +FATE_H264 := $(FATE_H264:%=fate-h264-conformance-%) \ + fate-h264-interlace-crop \ + fate-h264-lossless \ + fate-h264-extreme-plane-pred \ + +FATE_TESTS += $(FATE_H264) +fate-h264: $(FATE_H264) + +fate-h264-conformance-aud_mw_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/AUD_MW_E.264 +fate-h264-conformance-ba1_ft_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/BA1_FT_C.264 +fate-h264-conformance-ba1_sony_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/BA1_Sony_D.jsv +fate-h264-conformance-ba2_sony_f: CMD = framecrc -i $(SAMPLES)/h264-conformance/BA2_Sony_F.jsv +fate-h264-conformance-ba3_sva_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/BA3_SVA_C.264 +fate-h264-conformance-ba_mw_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/BA_MW_D.264 +fate-h264-conformance-bamq1_jvc_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/BAMQ1_JVC_C.264 +fate-h264-conformance-bamq2_jvc_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/BAMQ2_JVC_C.264 +fate-h264-conformance-banm_mw_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/BANM_MW_D.264 +fate-h264-conformance-basqp1_sony_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/BASQP1_Sony_C.jsv +fate-h264-conformance-caba1_sony_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/CABA1_Sony_D.jsv +fate-h264-conformance-caba1_sva_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CABA1_SVA_B.264 +fate-h264-conformance-caba2_sony_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CABA2_Sony_E.jsv +fate-h264-conformance-caba2_sva_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CABA2_SVA_B.264 +fate-h264-conformance-caba3_sony_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CABA3_Sony_C.jsv +fate-h264-conformance-caba3_sva_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CABA3_SVA_B.264 +fate-h264-conformance-caba3_toshiba_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CABA3_TOSHIBA_E.264 +fate-h264-conformance-cabac_mot_fld0_full: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/camp_mot_fld0_full.26l +fate-h264-conformance-cabac_mot_frm0_full: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/camp_mot_frm0_full.26l +fate-h264-conformance-cabac_mot_mbaff0_full: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/camp_mot_mbaff0_full.26l +fate-h264-conformance-cabac_mot_picaff0_full: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/camp_mot_picaff0_full.26l +fate-h264-conformance-cabaci3_sony_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CABACI3_Sony_B.jsv +fate-h264-conformance-cabast3_sony_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CABAST3_Sony_E.jsv +fate-h264-conformance-cabastbr3_sony_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CABASTBR3_Sony_B.jsv +fate-h264-conformance-cabref3_sand_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CABREF3_Sand_D.264 +fate-h264-conformance-cacqp3_sony_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CACQP3_Sony_D.jsv +fate-h264-conformance-cafi1_sva_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAFI1_SVA_C.264 +fate-h264-conformance-cama1_sony_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/CAMA1_Sony_C.jsv +fate-h264-conformance-cama1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMA1_TOSHIBA_B.264 +fate-h264-conformance-cama1_vtc_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cama1_vtc_c.avc +fate-h264-conformance-cama2_vtc_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/cama2_vtc_b.avc +fate-h264-conformance-cama3_sand_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMA3_Sand_E.264 +fate-h264-conformance-cama3_vtc_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cama3_vtc_b.avc +fate-h264-conformance-camaci3_sony_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMACI3_Sony_C.jsv +fate-h264-conformance-camanl1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMANL1_TOSHIBA_B.264 +fate-h264-conformance-camanl2_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMANL2_TOSHIBA_B.264 +fate-h264-conformance-camanl3_sand_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMANL3_Sand_E.264 +fate-h264-conformance-camasl3_sony_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMASL3_Sony_B.jsv +fate-h264-conformance-camp_mot_mbaff_l30: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMP_MOT_MBAFF_L30.26l +fate-h264-conformance-camp_mot_mbaff_l31: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMP_MOT_MBAFF_L31.26l +fate-h264-conformance-canl1_sony_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL1_Sony_E.jsv +fate-h264-conformance-canl1_sva_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL1_SVA_B.264 +fate-h264-conformance-canl1_toshiba_g: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL1_TOSHIBA_G.264 +fate-h264-conformance-canl2_sony_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL2_Sony_E.jsv +fate-h264-conformance-canl2_sva_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL2_SVA_B.264 +fate-h264-conformance-canl3_sony_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CANL3_Sony_C.jsv +fate-h264-conformance-canl3_sva_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL3_SVA_B.264 +fate-h264-conformance-canl4_sva_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL4_SVA_B.264 +fate-h264-conformance-canlma2_sony_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANLMA2_Sony_C.jsv +fate-h264-conformance-canlma3_sony_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANLMA3_Sony_C.jsv +fate-h264-conformance-capa1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAPA1_TOSHIBA_B.264 +fate-h264-conformance-capama3_sand_f: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAPAMA3_Sand_F.264 +fate-h264-conformance-capcm1_sand_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CAPCM1_Sand_E.264 +fate-h264-conformance-capcmnl1_sand_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CAPCMNL1_Sand_E.264 +fate-h264-conformance-capm3_sony_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAPM3_Sony_D.jsv +fate-h264-conformance-caqp1_sony_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CAQP1_Sony_B.jsv +fate-h264-conformance-cavlc_mot_fld0_full_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cvmp_mot_fld0_full_B.26l +fate-h264-conformance-cavlc_mot_frm0_full_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cvmp_mot_frm0_full_B.26l +fate-h264-conformance-cavlc_mot_mbaff0_full_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cvmp_mot_mbaff0_full_B.26l +fate-h264-conformance-cavlc_mot_picaff0_full_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cvmp_mot_picaff0_full_B.26l +fate-h264-conformance-cawp1_toshiba_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CAWP1_TOSHIBA_E.264 +fate-h264-conformance-cawp5_toshiba_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAWP5_TOSHIBA_E.264 +fate-h264-conformance-ci1_ft_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CI1_FT_B.264 +fate-h264-conformance-ci_mw_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/CI_MW_D.264 +fate-h264-conformance-cvbs3_sony_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVBS3_Sony_C.jsv +fate-h264-conformance-cvcanlma2_sony_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/CVCANLMA2_Sony_C.jsv +fate-h264-conformance-cvfi1_sony_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVFI1_Sony_D.jsv +fate-h264-conformance-cvfi1_sva_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVFI1_SVA_C.264 +fate-h264-conformance-cvfi2_sony_h: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVFI2_Sony_H.jsv +fate-h264-conformance-cvfi2_sva_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVFI2_SVA_C.264 +fate-h264-conformance-cvma1_sony_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/CVMA1_Sony_D.jsv +fate-h264-conformance-cvma1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVMA1_TOSHIBA_B.264 +fate-h264-conformance-cvmanl1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVMANL1_TOSHIBA_B.264 +fate-h264-conformance-cvmanl2_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVMANL2_TOSHIBA_B.264 +fate-h264-conformance-cvmapaqp3_sony_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVMAPAQP3_Sony_E.jsv +fate-h264-conformance-cvmaqp2_sony_g: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVMAQP2_Sony_G.jsv +fate-h264-conformance-cvmaqp3_sony_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVMAQP3_Sony_D.jsv +fate-h264-conformance-cvmp_mot_fld_l30_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVMP_MOT_FLD_L30_B.26l +fate-h264-conformance-cvmp_mot_frm_l31_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVMP_MOT_FRM_L31_B.26l +fate-h264-conformance-cvnlfi1_sony_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CVNLFI1_Sony_C.jsv +fate-h264-conformance-cvnlfi2_sony_h: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVNLFI2_Sony_H.jsv +fate-h264-conformance-cvpa1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVPA1_TOSHIBA_B.264 +fate-h264-conformance-cvpcmnl1_sva_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/CVPCMNL1_SVA_C.264 +fate-h264-conformance-cvpcmnl2_sva_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/CVPCMNL2_SVA_C.264 +fate-h264-conformance-cvwp1_toshiba_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CVWP1_TOSHIBA_E.264 +fate-h264-conformance-cvwp2_toshiba_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVWP2_TOSHIBA_E.264 +fate-h264-conformance-cvwp3_toshiba_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVWP3_TOSHIBA_E.264 +fate-h264-conformance-cvwp5_toshiba_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVWP5_TOSHIBA_E.264 +fate-h264-conformance-fi1_sony_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FI1_Sony_E.jsv +fate-h264-conformance-frext-alphaconformanceg: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/test8b43.264 +fate-h264-conformance-frext-bcrm_freh10: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh10.264 -vsync 0 +fate-h264-conformance-frext-brcm_freh11: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh11.264 -vsync 0 +fate-h264-conformance-frext-brcm_freh3: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh3.264 +fate-h264-conformance-frext-brcm_freh4: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh4.264 -vsync 0 +fate-h264-conformance-frext-brcm_freh5: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh5.264 +fate-h264-conformance-frext-brcm_freh8: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh8.264 +fate-h264-conformance-frext-brcm_freh9: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh9.264 +fate-h264-conformance-frext-freh12_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/Freh12_B.264 +fate-h264-conformance-frext-freh1_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/Freh1_B.264 +fate-h264-conformance-frext-freh2_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/Freh2_B.264 +fate-h264-conformance-frext-freh6: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh6.264 -vsync 0 +fate-h264-conformance-frext-freh7_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/Freh7_B.264 -vsync 0 +fate-h264-conformance-frext-frext01_jvc_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/FREXT01_JVC_D.264 +fate-h264-conformance-frext-frext02_jvc_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/FREXT02_JVC_C.264 +fate-h264-conformance-frext-frext1_panasonic_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/FRExt1_Panasonic.avc +fate-h264-conformance-frext-frext2_panasonic_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/FRExt2_Panasonic.avc -vsync 0 +fate-h264-conformance-frext-frext3_panasonic_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/FRExt3_Panasonic.avc +fate-h264-conformance-frext-frext4_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/FRExt4_Panasonic.avc +fate-h264-conformance-frext-frext_mmco4_sony_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/FRExt_MMCO4_Sony_B.264 +fate-h264-conformance-frext-hcaff1_hhi_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HCAFF1_HHI.264 +fate-h264-conformance-frext-hcafr1_hhi_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HCAFR1_HHI.264 +fate-h264-conformance-frext-hcafr2_hhi_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HCAFR2_HHI.264 +fate-h264-conformance-frext-hcafr3_hhi_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HCAFR3_HHI.264 +fate-h264-conformance-frext-hcafr4_hhi_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HCAFR4_HHI.264 +fate-h264-conformance-frext-hcamff1_hhi_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HCAMFF1_HHI.264 +fate-h264-conformance-frext-hpca_brcm_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCA_BRCM_C.264 +fate-h264-conformance-frext-hpcadq_brcm_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCADQ_BRCM_B.264 +fate-h264-conformance-frext-hpcafl_bcrm_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCAFL_BRCM_C.264 -vsync 0 +fate-h264-conformance-frext-hpcaflnl_bcrm_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCAFLNL_BRCM_C.264 -vsync 0 +fate-h264-conformance-frext-hpcalq_brcm_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCALQ_BRCM_B.264 +fate-h264-conformance-frext-hpcamapalq_bcrm_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCAMAPALQ_BRCM_B.264 -vsync 0 +fate-h264-conformance-frext-hpcamolq_brcm_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCAMOLQ_BRCM_B.264 +fate-h264-conformance-frext-hpcanl_brcm_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCANL_BRCM_C.264 +fate-h264-conformance-frext-hpcaq2lq_brcm_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCAQ2LQ_BRCM_B.264 +fate-h264-conformance-frext-hpcv_brcm_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCV_BRCM_A.264 +fate-h264-conformance-frext-hpcvfl_bcrm_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCVFL_BRCM_A.264 -vsync 0 +fate-h264-conformance-frext-hpcvflnl_bcrm_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCVFLNL_BRCM_A.264 -vsync 0 +fate-h264-conformance-frext-hpcvmolq_brcm_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCVMOLQ_BRCM_B.264 +fate-h264-conformance-frext-hpcvnl_brcm_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCVNL_BRCM_A.264 +fate-h264-conformance-hcbp2_hhi_a: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/HCBP2_HHI_A.264 +fate-h264-conformance-hcmp1_hhi_a: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/HCMP1_HHI_A.264 +fate-h264-conformance-ls_sva_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/LS_SVA_D.264 +fate-h264-conformance-midr_mw_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/MIDR_MW_D.264 +fate-h264-conformance-mps_mw_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/MPS_MW_A.264 +fate-h264-conformance-mr1_bt_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/MR1_BT_A.h264 +fate-h264-conformance-mr1_mw_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/MR1_MW_A.264 +fate-h264-conformance-mr2_mw_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/MR2_MW_A.264 +fate-h264-conformance-mr2_tandberg_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR2_TANDBERG_E.264 +fate-h264-conformance-mr3_tandberg_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR3_TANDBERG_B.264 +fate-h264-conformance-mr4_tandberg_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR4_TANDBERG_C.264 +fate-h264-conformance-mr5_tandberg_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR5_TANDBERG_C.264 +fate-h264-conformance-mr6_bt_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR6_BT_B.h264 +fate-h264-conformance-mr7_bt_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR7_BT_B.h264 +fate-h264-conformance-mr8_bt_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR8_BT_B.h264 +fate-h264-conformance-mr9_bt_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR9_BT_B.h264 +fate-h264-conformance-mv1_brcm_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/src19td.IBP.264 +fate-h264-conformance-nl1_sony_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/NL1_Sony_D.jsv +fate-h264-conformance-nl2_sony_h: CMD = framecrc -i $(SAMPLES)/h264-conformance/NL2_Sony_H.jsv +fate-h264-conformance-nl3_sva_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/NL3_SVA_E.264 +fate-h264-conformance-nlmq1_jvc_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/NLMQ1_JVC_C.264 +fate-h264-conformance-nlmq2_jvc_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/NLMQ2_JVC_C.264 +fate-h264-conformance-nrf_mw_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/NRF_MW_E.264 +fate-h264-conformance-sharp_mp_field_1_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/Sharp_MP_Field_1_B.jvt +fate-h264-conformance-sharp_mp_field_2_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/Sharp_MP_Field_2_B.jvt +fate-h264-conformance-sharp_mp_field_3_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/Sharp_MP_Field_3_B.jvt +fate-h264-conformance-sharp_mp_paff_1r2: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/Sharp_MP_PAFF_1r2.jvt +fate-h264-conformance-sharp_mp_paff_2r: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/Sharp_MP_PAFF_2.jvt +fate-h264-conformance-sl1_sva_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/SL1_SVA_B.264 +fate-h264-conformance-sva_ba1_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_BA1_B.264 +fate-h264-conformance-sva_ba2_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_BA2_D.264 +fate-h264-conformance-sva_base_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_Base_B.264 +fate-h264-conformance-sva_cl1_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_CL1_E.264 +fate-h264-conformance-sva_fm1_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_FM1_E.264 +fate-h264-conformance-sva_nl1_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_NL1_B.264 +fate-h264-conformance-sva_nl2_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_NL2_E.264 + +fate-h264-interlace-crop: CMD = framecrc -vframes 3 -i $(SAMPLES)/h264/interlaced_crop.mp4 +fate-h264-lossless: CMD = framecrc -i $(SAMPLES)/h264/lossless.h264 +fate-h264-extreme-plane-pred: CMD = framemd5 -strict 1 -vsync 0 -i $(SAMPLES)/h264/extreme-plane-pred.h264 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/mp3.mak b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/mp3.mak new file mode 100644 index 00000000..859a4f38 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/mp3.mak @@ -0,0 +1,39 @@ +FATE_MP3 += fate-mp3-float-conf-compl +fate-mp3-float-conf-compl: CMD = pcm -acodec mp3float -i $(SAMPLES)/mp3-conformance/compl.bit +fate-mp3-float-conf-compl: CMP = stddev +fate-mp3-float-conf-compl: REF = $(SAMPLES)/mp3-conformance/compl.pcm + +FATE_MP3 += fate-mp3-float-conf-he_32khz +fate-mp3-float-conf-he_32khz: CMD = pcm -acodec mp3float -fs 343296 -i $(SAMPLES)/mp3-conformance/he_32khz.bit +fate-mp3-float-conf-he_32khz: CMP = stddev +fate-mp3-float-conf-he_32khz: REF = $(SAMPLES)/mp3-conformance/he_32khz.pcm + +FATE_MP3 += fate-mp3-float-conf-he_44khz +fate-mp3-float-conf-he_44khz: CMD = pcm -acodec mp3float -fs 942336 -i $(SAMPLES)/mp3-conformance/he_44khz.bit +fate-mp3-float-conf-he_44khz: CMP = stddev +fate-mp3-float-conf-he_44khz: REF = $(SAMPLES)/mp3-conformance/he_44khz.pcm + +FATE_MP3 += fate-mp3-float-conf-he_48khz +fate-mp3-float-conf-he_48khz: CMD = pcm -acodec mp3float -fs 343296 -i $(SAMPLES)/mp3-conformance/he_48khz.bit +fate-mp3-float-conf-he_48khz: CMP = stddev +fate-mp3-float-conf-he_48khz: REF = $(SAMPLES)/mp3-conformance/he_48khz.pcm + +FATE_MP3 += fate-mp3-float-conf-hecommon +fate-mp3-float-conf-hecommon: CMD = pcm -acodec mp3float -fs 133632 -i $(SAMPLES)/mp3-conformance/hecommon.bit +fate-mp3-float-conf-hecommon: CMP = stddev +fate-mp3-float-conf-hecommon: REF = $(SAMPLES)/mp3-conformance/hecommon.pcm + +FATE_MP3 += fate-mp3-float-conf-si +fate-mp3-float-conf-si: CMD = pcm -acodec mp3float -fs 269568 -i $(SAMPLES)/mp3-conformance/si.bit +fate-mp3-float-conf-si: CMP = stddev +fate-mp3-float-conf-si: REF = $(SAMPLES)/mp3-conformance/si.pcm + +FATE_MP3 += fate-mp3-float-conf-si_block +fate-mp3-float-conf-si_block: CMD = pcm -acodec mp3float -fs 145152 -i $(SAMPLES)/mp3-conformance/si_block.bit +fate-mp3-float-conf-si_block: CMP = stddev +fate-mp3-float-conf-si_block: REF = $(SAMPLES)/mp3-conformance/si_block.pcm + +FATE_TESTS += $(FATE_MP3) +fate-mp3: $(FATE_MP3) +$(FATE_MP3): CMP = stddev +$(FATE_MP3): FUZZ = 0.07 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/vorbis.mak b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/vorbis.mak new file mode 100644 index 00000000..5452b74a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/vorbis.mak @@ -0,0 +1,80 @@ +FATE_VORBIS += fate-vorbis-1 +fate-vorbis-1: CMD = pcm -i $(SAMPLES)/vorbis/1.0.1-test_small.ogg +fate-vorbis-1: REF = $(SAMPLES)/vorbis/1.0.1-test_small.pcm + +FATE_VORBIS += fate-vorbis-2 +fate-vorbis-2: CMD = pcm -i $(SAMPLES)/vorbis/1.0-test_small.ogg +fate-vorbis-2: REF = $(SAMPLES)/vorbis/1.0-test_small.pcm + +FATE_VORBIS += fate-vorbis-3 +fate-vorbis-3: CMD = pcm -i $(SAMPLES)/vorbis/beta3-test_small.ogg +fate-vorbis-3: REF = $(SAMPLES)/vorbis/beta3-test_small.pcm + +FATE_VORBIS += fate-vorbis-4 +fate-vorbis-4: CMD = pcm -i $(SAMPLES)/vorbis/beta4-test_small.ogg +fate-vorbis-4: REF = $(SAMPLES)/vorbis/beta4-test_small.pcm + +FATE_VORBIS += fate-vorbis-5 +fate-vorbis-5: CMD = pcm -i $(SAMPLES)/vorbis/chain-test1_small.ogg +fate-vorbis-5: REF = $(SAMPLES)/vorbis/chain-test1_small.pcm + +FATE_VORBIS += fate-vorbis-6 +fate-vorbis-6: CMD = pcm -i $(SAMPLES)/vorbis/chain-test2_small.ogg +fate-vorbis-6: REF = $(SAMPLES)/vorbis/chain-test2_small.pcm + +FATE_VORBIS += fate-vorbis-7 +fate-vorbis-7: CMD = pcm -i $(SAMPLES)/vorbis/highrate-test_small.ogg +fate-vorbis-7: REF = $(SAMPLES)/vorbis/highrate-test_small.pcm + +FATE_VORBIS += fate-vorbis-8 +fate-vorbis-8: CMD = pcm -i $(SAMPLES)/vorbis/lsp-test2_small.ogg +fate-vorbis-8: REF = $(SAMPLES)/vorbis/lsp-test2_small.pcm + +FATE_VORBIS += fate-vorbis-9 +fate-vorbis-9: CMD = pcm -i $(SAMPLES)/vorbis/lsp-test3_small.ogg +fate-vorbis-9: REF = $(SAMPLES)/vorbis/lsp-test3_small.pcm + +FATE_VORBIS += fate-vorbis-10 +fate-vorbis-10: CMD = pcm -i $(SAMPLES)/vorbis/lsp-test4_small.ogg +fate-vorbis-10: REF = $(SAMPLES)/vorbis/lsp-test4_small.pcm + +FATE_VORBIS += fate-vorbis-11 +fate-vorbis-11: CMD = pcm -i $(SAMPLES)/vorbis/lsp-test_small.ogg +fate-vorbis-11: REF = $(SAMPLES)/vorbis/lsp-test_small.pcm + +FATE_VORBIS += fate-vorbis-12 +fate-vorbis-12: CMD = pcm -i $(SAMPLES)/vorbis/mono_small.ogg +fate-vorbis-12: REF = $(SAMPLES)/vorbis/mono_small.pcm + +FATE_VORBIS += fate-vorbis-13 +fate-vorbis-13: CMD = pcm -i $(SAMPLES)/vorbis/moog_small.ogg +fate-vorbis-13: REF = $(SAMPLES)/vorbis/moog_small.pcm + +FATE_VORBIS += fate-vorbis-14 +fate-vorbis-14: CMD = pcm -i $(SAMPLES)/vorbis/rc1-test_small.ogg +fate-vorbis-14: REF = $(SAMPLES)/vorbis/rc1-test_small.pcm + +FATE_VORBIS += fate-vorbis-15 +fate-vorbis-15: CMD = pcm -i $(SAMPLES)/vorbis/rc2-test2_small.ogg +fate-vorbis-15: REF = $(SAMPLES)/vorbis/rc2-test2_small.pcm + +FATE_VORBIS += fate-vorbis-16 +fate-vorbis-16: CMD = pcm -i $(SAMPLES)/vorbis/rc2-test_small.ogg +fate-vorbis-16: REF = $(SAMPLES)/vorbis/rc2-test_small.pcm + +FATE_VORBIS += fate-vorbis-17 +fate-vorbis-17: CMD = pcm -i $(SAMPLES)/vorbis/rc3-test_small.ogg +fate-vorbis-17: REF = $(SAMPLES)/vorbis/rc3-test_small.pcm + +FATE_VORBIS += fate-vorbis-18 +fate-vorbis-18: CMD = pcm -i $(SAMPLES)/vorbis/sleepzor_small.ogg +fate-vorbis-18: REF = $(SAMPLES)/vorbis/sleepzor_small.pcm +fate-vorbis-18: FUZZ = 2 + +FATE_VORBIS += fate-vorbis-19 +fate-vorbis-19: CMD = pcm -i $(SAMPLES)/vorbis/test-short2_small.ogg +fate-vorbis-19: REF = $(SAMPLES)/vorbis/test-short2_small.pcm + +FATE_TESTS += $(FATE_VORBIS) +fate-vorbis: $(FATE_VORBIS) +$(FATE_VORBIS): CMP = oneoff diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/vp8.mak b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/vp8.mak new file mode 100644 index 00000000..2b171305 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate/vp8.mak @@ -0,0 +1,20 @@ +VP8_SUITE = 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 + +define FATE_VP8_SUITE +FATE_VP8 += fate-vp8-test-vector$(2)-$(1) +fate-vp8-test-vector$(2)-$(1): CMD = framemd5 $(3) -i $(SAMPLES)/vp8-test-vectors-r1/vp80-00-comprehensive-$(1).ivf +fate-vp8-test-vector$(2)-$(1): REF = $(SRC_PATH_BARE)/tests/ref/fate/vp8-test-vector-$(1) +endef + +define FATE_VP8_FULL +$(foreach N,$(VP8_SUITE),$(eval $(call FATE_VP8_SUITE,$(N),$(1),$(2)))) + +FATE_VP8 += fate-vp8-sign-bias$(1) +fate-vp8-sign-bias$(1): CMD = framemd5 $(2) -i $(SAMPLES)/vp8/sintel-signbias.ivf +fate-vp8-sign-bias$(1): REF = $(SRC_PATH_BARE)/tests/ref/fate/vp8-sign-bias +endef + +$(eval $(call FATE_VP8_FULL)) +$(eval $(call FATE_VP8_FULL,-emu-edge,-flags emu_edge)) +FATE_TESTS += $(FATE_VP8) +fate-vp8: $(FATE_VP8) diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate2.mak b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate2.mak new file mode 100644 index 00000000..6a9448fa --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/fate2.mak @@ -0,0 +1,332 @@ +FATE_TESTS += fate-twinvq +fate-twinvq: CMD = pcm -i $(SAMPLES)/vqf/achterba.vqf +fate-twinvq: CMP = oneoff +fate-twinvq: REF = $(SAMPLES)/vqf/achterba.pcm + +FATE_TESTS += fate-sipr-16k +fate-sipr-16k: CMD = pcm -i $(SAMPLES)/sipr/sipr_16k.rm +fate-sipr-16k: CMP = oneoff +fate-sipr-16k: REF = $(SAMPLES)/sipr/sipr_16k.pcm + +FATE_TESTS += fate-sipr-8k5 +fate-sipr-8k5: CMD = pcm -i $(SAMPLES)/sipr/sipr_8k5.rm +fate-sipr-8k5: CMP = oneoff +fate-sipr-8k5: REF = $(SAMPLES)/sipr/sipr_8k5.pcm + +FATE_TESTS += fate-sipr-6k5 +fate-sipr-6k5: CMD = pcm -i $(SAMPLES)/sipr/sipr_6k5.rm +fate-sipr-6k5: CMP = oneoff +fate-sipr-6k5: REF = $(SAMPLES)/sipr/sipr_6k5.pcm + +FATE_TESTS += fate-sipr-5k0 +fate-sipr-5k0: CMD = pcm -i $(SAMPLES)/sipr/sipr_5k0.rm +fate-sipr-5k0: CMP = oneoff +fate-sipr-5k0: REF = $(SAMPLES)/sipr/sipr_5k0.pcm + +FATE_TESTS += fate-ra-288 +fate-ra-288: CMD = pcm -i $(SAMPLES)/real/ra_288.rm +fate-ra-288: CMP = oneoff +fate-ra-288: REF = $(SAMPLES)/real/ra_288.pcm +fate-ra-288: FUZZ = 2 + +FATE_TESTS += fate-ra-cook +fate-ra-cook: CMD = pcm -i $(SAMPLES)/real/ra_cook.rm +fate-ra-cook: CMP = oneoff +fate-ra-cook: REF = $(SAMPLES)/real/ra_cook.pcm + +FATE_TESTS += fate-mpeg2-field-enc +fate-mpeg2-field-enc: CMD = framecrc -flags +bitexact -dct fastint -idct simple -i $(SAMPLES)/mpeg2/mpeg2_field_encoding.ts -an + +FATE_TESTS += fate-qcelp +fate-qcelp: CMD = pcm -i $(SAMPLES)/qcp/0036580847.QCP +fate-qcelp: CMP = oneoff +fate-qcelp: REF = $(SAMPLES)/qcp/0036580847.pcm + +FATE_TESTS += fate-qdm2 +fate-qdm2: CMD = pcm -i $(SAMPLES)/qt-surge-suite/surge-2-16-B-QDM2.mov +fate-qdm2: CMP = oneoff +fate-qdm2: REF = $(SAMPLES)/qt-surge-suite/surge-2-16-B-QDM2.pcm +fate-qdm2: FUZZ = 2 + +FATE_TESTS += fate-imc +fate-imc: CMD = pcm -i $(SAMPLES)/imc/imc.avi +fate-imc: CMP = oneoff +fate-imc: REF = $(SAMPLES)/imc/imc.pcm + +FATE_TESTS += fate-yop +fate-yop: CMD = framecrc -i $(SAMPLES)/yop/test1.yop -pix_fmt rgb24 -an + +FATE_TESTS += fate-pictor +fate-pictor: CMD = framecrc -i $(SAMPLES)/pictor/MFISH.PIC -pix_fmt rgb24 -an + +FATE_TESTS += fate-dts +fate-dts: CMD = pcm -i $(SAMPLES)/dts/dts.ts +fate-dts: CMP = oneoff +fate-dts: REF = $(SAMPLES)/dts/dts.pcm + +FATE_TESTS += fate-nellymoser +fate-nellymoser: CMD = pcm -i $(SAMPLES)/nellymoser/nellymoser.flv +fate-nellymoser: CMP = oneoff +fate-nellymoser: REF = $(SAMPLES)/nellymoser/nellymoser.pcm + +FATE_TESTS += fate-truespeech +fate-truespeech: CMD = pcm -i $(SAMPLES)/truespeech/a6.wav +fate-truespeech: CMP = oneoff +fate-truespeech: REF = $(SAMPLES)/truespeech/a6.pcm + +FATE_TESTS += fate-ac3-2.0 +fate-ac3-2.0: CMD = pcm -i $(SAMPLES)/ac3/monsters_inc_2.0_192_small.ac3 +fate-ac3-2.0: CMP = oneoff +fate-ac3-2.0: REF = $(SAMPLES)/ac3/monsters_inc_2.0_192_small.pcm + +FATE_TESTS += fate-ac3-5.1 +fate-ac3-5.1: CMD = pcm -i $(SAMPLES)/ac3/monsters_inc_5.1_448_small.ac3 +fate-ac3-5.1: CMP = oneoff +fate-ac3-5.1: REF = $(SAMPLES)/ac3/monsters_inc_5.1_448_small.pcm + +FATE_TESTS += fate-eac3-1 +fate-eac3-1: CMD = pcm -i $(SAMPLES)/eac3/csi_miami_5.1_256_spx_small.eac3 +fate-eac3-1: CMP = oneoff +fate-eac3-1: REF = $(SAMPLES)/eac3/csi_miami_5.1_256_spx_small.pcm + +FATE_TESTS += fate-eac3-2 +fate-eac3-2: CMD = pcm -i $(SAMPLES)/eac3/csi_miami_stereo_128_spx_small.eac3 +fate-eac3-2: CMP = oneoff +fate-eac3-2: REF = $(SAMPLES)/eac3/csi_miami_stereo_128_spx_small.pcm + +FATE_TESTS += fate-eac3-3 +fate-eac3-3: CMD = pcm -i $(SAMPLES)/eac3/matrix2_commentary1_stereo_192_small.eac3 +fate-eac3-3: CMP = oneoff +fate-eac3-3: REF = $(SAMPLES)/eac3/matrix2_commentary1_stereo_192_small.pcm + +FATE_TESTS += fate-eac3-4 +fate-eac3-4: CMD = pcm -i $(SAMPLES)/eac3/serenity_english_5.1_1536_small.eac3 +fate-eac3-4: CMP = oneoff +fate-eac3-4: REF = $(SAMPLES)/eac3/serenity_english_5.1_1536_small.pcm + +FATE_TESTS += fate-atrac1 +fate-atrac1: CMD = pcm -i $(SAMPLES)/atrac1/test_tones_small.aea +fate-atrac1: CMP = oneoff +fate-atrac1: REF = $(SAMPLES)/atrac1/test_tones_small.pcm + +FATE_TESTS += fate-atrac3-1 +fate-atrac3-1: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_066_small.wav +fate-atrac3-1: CMP = oneoff +fate-atrac3-1: REF = $(SAMPLES)/atrac3/mc_sich_at3_066_small.pcm + +FATE_TESTS += fate-atrac3-2 +fate-atrac3-2: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_105_small.wav +fate-atrac3-2: CMP = oneoff +fate-atrac3-2: REF = $(SAMPLES)/atrac3/mc_sich_at3_105_small.pcm + +FATE_TESTS += fate-atrac3-3 +fate-atrac3-3: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_132_small.wav +fate-atrac3-3: CMP = oneoff +fate-atrac3-3: REF = $(SAMPLES)/atrac3/mc_sich_at3_132_small.pcm + +FATE_TESTS += fate-gsm +fate-gsm: CMD = framecrc -t 10 -i $(SAMPLES)/gsm/sample-gsm-8000.mov + +FATE_TESTS += fate-gsm-ms +fate-gsm-ms: CMD = framecrc -i $(SAMPLES)/gsm/ciao.wav + +FATE_TESTS += fate-g722dec-1 +fate-g722dec-1: CMD = framecrc -ar 16000 -i $(SAMPLES)/g722/conf-adminmenu-162.g722 + +FATE_TESTS += fate-msmpeg4v1 +fate-msmpeg4v1: CMD = framecrc -flags +bitexact -dct fastint -idct simple -i $(SAMPLES)/msmpeg4v1/mpg4.avi -an + +FATE_TESTS += fate-wmavoice-7k +fate-wmavoice-7k: CMD = pcm -i $(SAMPLES)/wmavoice/streaming_CBR-7K.wma +fate-wmavoice-7k: CMP = stddev +fate-wmavoice-7k: REF = $(SAMPLES)/wmavoice/streaming_CBR-7K.pcm +fate-wmavoice-7k: FUZZ = 3 + +FATE_TESTS += fate-wmavoice-11k +fate-wmavoice-11k: CMD = pcm -i $(SAMPLES)/wmavoice/streaming_CBR-11K.wma +fate-wmavoice-11k: CMP = stddev +fate-wmavoice-11k: REF = $(SAMPLES)/wmavoice/streaming_CBR-11K.pcm +fate-wmavoice-11k: FUZZ = 3 + +FATE_TESTS += fate-wmavoice-19k +fate-wmavoice-19k: CMD = pcm -i $(SAMPLES)/wmavoice/streaming_CBR-19K.wma +fate-wmavoice-19k: CMP = stddev +fate-wmavoice-19k: REF = $(SAMPLES)/wmavoice/streaming_CBR-19K.pcm +fate-wmavoice-19k: FUZZ = 3 + +FATE_TESTS += fate-wmapro-5.1 +fate-wmapro-5.1: CMD = pcm -i $(SAMPLES)/wmapro/latin_192_mulitchannel_cut.wma +fate-wmapro-5.1: CMP = oneoff +fate-wmapro-5.1: REF = $(SAMPLES)/wmapro/latin_192_mulitchannel_cut.pcm + +FATE_TESTS += fate-wmapro-2ch +fate-wmapro-2ch: CMD = pcm -i $(SAMPLES)/wmapro/Beethovens_9th-1_small.wma +fate-wmapro-2ch: CMP = oneoff +fate-wmapro-2ch: REF = $(SAMPLES)/wmapro/Beethovens_9th-1_small.pcm + +FATE_TESTS += fate-ansi +fate-ansi: CMD = framecrc -i $(SAMPLES)/ansi/TRE-IOM5.ANS -pix_fmt rgb24 + +FATE_TESTS += fate-wmv8-drm +# discard last packet to avoid fails due to overread of VC-1 decoder +fate-wmv8-drm: CMD = framecrc -cryptokey 137381538c84c068111902a59c5cf6c340247c39 -i $(SAMPLES)/wmv8/wmv_drm.wmv -an -vframes 162 + +FATE_TESTS += fate-wmv8-drm-nodec +fate-wmv8-drm-nodec: CMD = framecrc -cryptokey 137381538c84c068111902a59c5cf6c340247c39 -i $(SAMPLES)/wmv8/wmv_drm.wmv -acodec copy -vcodec copy + +FATE_TESTS += fate-binkaudio-dct +fate-binkaudio-dct: CMD = pcm -i $(SAMPLES)/bink/binkaudio_dct.bik +fate-binkaudio-dct: CMP = oneoff +fate-binkaudio-dct: REF = $(SAMPLES)/bink/binkaudio_dct.pcm +fate-binkaudio-dct: FUZZ = 2 + +FATE_TESTS += fate-binkaudio-rdft +fate-binkaudio-rdft: CMD = pcm -i $(SAMPLES)/bink/binkaudio_rdft.bik +fate-binkaudio-rdft: CMP = oneoff +fate-binkaudio-rdft: REF = $(SAMPLES)/bink/binkaudio_rdft.pcm +fate-binkaudio-rdft: FUZZ = 2 + +FATE_TESTS += fate-txd-pal8 +fate-txd-pal8: CMD = framecrc -i $(SAMPLES)/txd/outro.txd -pix_fmt rgb24 -an + +FATE_TESTS += fate-txd-16bpp +fate-txd-16bpp: CMD = framecrc -i $(SAMPLES)/txd/misc.txd -pix_fmt bgra -an + +FATE_TESTS += fate-vp3 +fate-vp3: CMD = framecrc -i $(SAMPLES)/vp3/vp31.avi + +FATE_TESTS += fate-fax-g3 +fate-fax-g3: CMD = framecrc -i $(SAMPLES)/CCITT_fax/G31D.TIF + +FATE_TESTS += fate-fax-g3s +fate-fax-g3s: CMD = framecrc -i $(SAMPLES)/CCITT_fax/G31DS.TIF + +FATE_TESTS += fate-ws_snd +fate-ws_snd: CMD = md5 -i $(SAMPLES)/vqa/ws_snd.vqa -f s16le + +FATE_TESTS += fate-dxa-scummvm +fate-dxa-scummvm: CMD = framecrc -i $(SAMPLES)/dxa/scummvm.dxa -pix_fmt rgb24 + +FATE_TESTS += fate-mjpegb +fate-mjpegb: CMD = framecrc -idct simple -flags +bitexact -i $(SAMPLES)/mjpegb/mjpegb_part.mov -an + +FATE_TESTS += fate-rv30 +fate-rv30: CMD = framecrc -flags +bitexact -dct fastint -idct simple -i $(SAMPLES)/real/rv30.rm -an + +FATE_TESTS += fate-sha +fate-sha: libavutil/sha-test$(EXESUF) +fate-sha: CMD = run libavutil/sha-test + +FATE_TESTS += fate-musepack7 +fate-musepack7: CMD = pcm -i $(SAMPLES)/musepack/inside-mp7.mpc +fate-musepack7: CMP = oneoff +fate-musepack7: REF = $(SAMPLES)/musepack/inside-mp7.pcm +fate-musepack7: FUZZ = 1 + +FATE_TESTS += fate-amrnb-4k75 +fate-amrnb-4k75: CMD = pcm -i $(SAMPLES)/amrnb/4.75k.amr +fate-amrnb-4k75: CMP = stddev +fate-amrnb-4k75: REF = $(SAMPLES)/amrnb/4.75k.pcm +fate-amrnb-4k75: FUZZ = 1 + +FATE_TESTS += fate-amrnb-5k15 +fate-amrnb-5k15: CMD = pcm -i $(SAMPLES)/amrnb/5.15k.amr +fate-amrnb-5k15: CMP = stddev +fate-amrnb-5k15: REF = $(SAMPLES)/amrnb/5.15k.pcm +fate-amrnb-5k15: FUZZ = 1 + +FATE_TESTS += fate-amrnb-5k9 +fate-amrnb-5k9: CMD = pcm -i $(SAMPLES)/amrnb/5.9k.amr +fate-amrnb-5k9: CMP = stddev +fate-amrnb-5k9: REF = $(SAMPLES)/amrnb/5.9k.pcm +fate-amrnb-5k9: FUZZ = 1 + +FATE_TESTS += fate-amrnb-6k7 +fate-amrnb-6k7: CMD = pcm -i $(SAMPLES)/amrnb/6.7k.amr +fate-amrnb-6k7: CMP = stddev +fate-amrnb-6k7: REF = $(SAMPLES)/amrnb/6.7k.pcm +fate-amrnb-6k7: FUZZ = 1 + +FATE_TESTS += fate-amrnb-7k4 +fate-amrnb-7k4: CMD = pcm -i $(SAMPLES)/amrnb/7.4k.amr +fate-amrnb-7k4: CMP = stddev +fate-amrnb-7k4: REF = $(SAMPLES)/amrnb/7.4k.pcm +fate-amrnb-7k4: FUZZ = 1 + +FATE_TESTS += fate-amrnb-7k95 +fate-amrnb-7k95: CMD = pcm -i $(SAMPLES)/amrnb/7.95k.amr +fate-amrnb-7k95: CMP = stddev +fate-amrnb-7k95: REF = $(SAMPLES)/amrnb/7.95k.pcm +fate-amrnb-7k95: FUZZ = 1 + +FATE_TESTS += fate-amrnb-10k2 +fate-amrnb-10k2: CMD = pcm -i $(SAMPLES)/amrnb/10.2k.amr +fate-amrnb-10k2: CMP = stddev +fate-amrnb-10k2: REF = $(SAMPLES)/amrnb/10.2k.pcm +fate-amrnb-10k2: FUZZ = 1 + +FATE_TESTS += fate-amrnb-12k2 +fate-amrnb-12k2: CMD = pcm -i $(SAMPLES)/amrnb/12.2k.amr +fate-amrnb-12k2: CMP = stddev +fate-amrnb-12k2: REF = $(SAMPLES)/amrnb/12.2k.pcm +fate-amrnb-12k2: FUZZ = 1 + +FATE_TESTS += fate-amrwb-6k60 +fate-amrwb-6k60: CMD = pcm -i $(SAMPLES)/amrwb/seed-6k60.awb +fate-amrwb-6k60: CMP = stddev +fate-amrwb-6k60: REF = $(SAMPLES)/amrwb/seed-6k60.pcm +fate-amrwb-6k60: FUZZ = 1 + +FATE_TESTS += fate-amrwb-8k85 +fate-amrwb-8k85: CMD = pcm -i $(SAMPLES)/amrwb/seed-8k85.awb +fate-amrwb-8k85: CMP = stddev +fate-amrwb-8k85: REF = $(SAMPLES)/amrwb/seed-8k85.pcm +fate-amrwb-8k85: FUZZ = 1 + +FATE_TESTS += fate-amrwb-12k65 +fate-amrwb-12k65: CMD = pcm -i $(SAMPLES)/amrwb/seed-12k65.awb +fate-amrwb-12k65: CMP = stddev +fate-amrwb-12k65: REF = $(SAMPLES)/amrwb/seed-12k65.pcm +fate-amrwb-12k65: FUZZ = 1 + +FATE_TESTS += fate-amrwb-14k25 +fate-amrwb-14k25: CMD = pcm -i $(SAMPLES)/amrwb/seed-14k25.awb +fate-amrwb-14k25: CMP = stddev +fate-amrwb-14k25: REF = $(SAMPLES)/amrwb/seed-14k25.pcm +fate-amrwb-14k25: FUZZ = 2.6 + +FATE_TESTS += fate-amrwb-15k85 +fate-amrwb-15k85: CMD = pcm -i $(SAMPLES)/amrwb/seed-15k85.awb +fate-amrwb-15k85: CMP = stddev +fate-amrwb-15k85: REF = $(SAMPLES)/amrwb/seed-15k85.pcm +fate-amrwb-15k85: FUZZ = 1 + +FATE_TESTS += fate-amrwb-18k25 +fate-amrwb-18k25: CMD = pcm -i $(SAMPLES)/amrwb/seed-18k25.awb +fate-amrwb-18k25: CMP = stddev +fate-amrwb-18k25: REF = $(SAMPLES)/amrwb/seed-18k25.pcm +fate-amrwb-18k25: FUZZ = 1 + +FATE_TESTS += fate-amrwb-19k85 +fate-amrwb-19k85: CMD = pcm -i $(SAMPLES)/amrwb/seed-19k85.awb +fate-amrwb-19k85: CMP = stddev +fate-amrwb-19k85: REF = $(SAMPLES)/amrwb/seed-19k85.pcm +fate-amrwb-19k85: FUZZ = 1 + +FATE_TESTS += fate-amrwb-23k05 +fate-amrwb-23k05: CMD = pcm -i $(SAMPLES)/amrwb/seed-23k05.awb +fate-amrwb-23k05: CMP = stddev +fate-amrwb-23k05: REF = $(SAMPLES)/amrwb/seed-23k05.pcm +fate-amrwb-23k05: FUZZ = 2 + +FATE_TESTS += fate-amrwb-23k85 +fate-amrwb-23k85: CMD = pcm -i $(SAMPLES)/amrwb/seed-23k85.awb +fate-amrwb-23k85: CMP = stddev +fate-amrwb-23k85: REF = $(SAMPLES)/amrwb/seed-23k85.pcm +fate-amrwb-23k85: FUZZ = 2 + +FATE_TESTS += fate-amrwb-23k85-2 +fate-amrwb-23k85-2: CMD = pcm -i $(SAMPLES)/amrwb/deus-23k85.awb +fate-amrwb-23k85-2: CMP = stddev +fate-amrwb-23k85-2: REF = $(SAMPLES)/amrwb/deus-23k85.pcm +fate-amrwb-23k85-2: FUZZ = 1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavf-regression.sh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavf-regression.sh new file mode 100755 index 00000000..b14a58ef --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavf-regression.sh @@ -0,0 +1,236 @@ +#!/bin/sh +# +# automatic regression test for libavformat +# +# +#set -x + +set -e + +. $(dirname $0)/regression-funcs.sh + +eval do_$test=y + +do_lavf() +{ + file=${outfile}lavf.$1 + do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $2 + do_ffmpeg_crc $file -i $target_path/$file $3 +} + +do_streamed_images() +{ + file=${outfile}${1}pipe.$1 + do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe + do_ffmpeg_crc $file -f image2pipe -i $target_path/$file +} + +do_image_formats() +{ + outfile="$datadir/images/$1/" + mkdir -p "$outfile" + file=${outfile}%02d.$1 + $echov $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file + $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file + do_md5sum ${outfile}02.$1 >> $logfile + do_ffmpeg_crc $file $3 -i $target_path/$file + wc -c ${outfile}02.$1 >> $logfile +} + +do_audio_only() +{ + file=${outfile}lavf.$1 + do_ffmpeg $file -t 1 -qscale 10 $2 -f s16le -i $pcm_src $3 + do_ffmpeg_crc $file -i $target_path/$file +} + +rm -f "$logfile" +rm -f "$benchfile" + +if [ -n "$do_avi" ] ; then +do_lavf avi +fi + +if [ -n "$do_asf" ] ; then +do_lavf asf "-acodec mp2" "-r 25" +fi + +if [ -n "$do_rm" ] ; then +file=${outfile}lavf.rm +do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec ac3_fixed +# broken +#do_ffmpeg_crc $file -i $target_path/$file +fi + +if [ -n "$do_mpg" ] ; then +do_lavf mpg +fi + +if [ -n "$do_mxf" ] ; then +do_lavf mxf "-ar 48000 -bf 2 -timecode_frame_start 264363" +do_lavf mxf_d10 "-ar 48000 -ac 2 -r 25 -s 720x576 -vf pad=720:608:0:32 -vcodec mpeg2video -intra -flags +ildct+low_delay -dc 10 -flags2 +ivlc+non_linear_q -qscale 1 -ps 1 -qmin 1 -rc_max_vbv_use 1 -rc_min_vbv_use 1 -pix_fmt yuv422p -minrate 30000k -maxrate 30000k -b 30000k -bufsize 1200000 -top 1 -rc_init_occupancy 1200000 -qmax 12 -f mxf_d10" +fi + +if [ -n "$do_ts" ] ; then +do_lavf ts +fi + +if [ -n "$do_swf" ] ; then +do_lavf swf -an +fi + +if [ -n "$do_ffm" ] ; then +do_lavf ffm +fi + +if [ -n "$do_flv_fmt" ] ; then +do_lavf flv -an +fi + +if [ -n "$do_mov" ] ; then +do_lavf mov "-acodec pcm_alaw" +fi + +if [ -n "$do_dv_fmt" ] ; then +do_lavf dv "-ar 48000 -r 25 -s pal -ac 2" +fi + +if [ -n "$do_gxf" ] ; then +do_lavf gxf "-ar 48000 -r 25 -s pal -ac 1" +fi + +if [ -n "$do_nut" ] ; then +do_lavf nut "-acodec mp2" +fi + +if [ -n "$do_mkv" ] ; then +do_lavf mkv +fi + + +# streamed images +# mjpeg +#file=${outfile}lavf.mjpeg +#do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src +#do_ffmpeg_crc $file -i $target_path/$file + +if [ -n "$do_pbmpipe" ] ; then +do_streamed_images pbm +fi + +if [ -n "$do_pgmpipe" ] ; then +do_streamed_images pgm +fi + +if [ -n "$do_ppmpipe" ] ; then +do_streamed_images ppm +fi + +if [ -n "$do_gif" ] ; then +file=${outfile}lavf.gif +do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -pix_fmt rgb24 +do_ffmpeg_crc $file -i $target_path/$file -pix_fmt rgb24 +fi + +if [ -n "$do_yuv4mpeg" ] ; then +file=${outfile}lavf.y4m +do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src +#do_ffmpeg_crc $file -i $target_path/$file +fi + +# image formats + +if [ -n "$do_pgm" ] ; then +do_image_formats pgm +fi + +if [ -n "$do_ppm" ] ; then +do_image_formats ppm +fi + +if [ -n "$do_png" ] ; then +do_image_formats png +fi + +if [ -n "$do_bmp" ] ; then +do_image_formats bmp +fi + +if [ -n "$do_tga" ] ; then +do_image_formats tga +fi + +if [ -n "$do_tiff" ] ; then +do_image_formats tiff "-pix_fmt rgb24" +fi + +if [ -n "$do_sgi" ] ; then +do_image_formats sgi +fi + +if [ -n "$do_jpg" ] ; then +do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2" +fi + +if [ -n "$do_pcx" ] ; then +do_image_formats pcx +fi + +# audio only + +if [ -n "$do_wav" ] ; then +do_audio_only wav +fi + +if [ -n "$do_alaw" ] ; then +do_audio_only al +fi + +if [ -n "$do_mulaw" ] ; then +do_audio_only ul +fi + +if [ -n "$do_au" ] ; then +do_audio_only au +fi + +if [ -n "$do_mmf" ] ; then +do_audio_only mmf +fi + +if [ -n "$do_aiff" ] ; then +do_audio_only aif +fi + +if [ -n "$do_voc" ] ; then +do_audio_only voc +fi + +if [ -n "$do_voc_s16" ] ; then +do_audio_only s16.voc "-ac 2" "-acodec pcm_s16le" +fi + +if [ -n "$do_ogg" ] ; then +do_audio_only ogg +fi + +if [ -n "$do_rso" ] ; then +do_audio_only rso +fi + +# pix_fmt conversions + +if [ -n "$do_pixfmt" ] ; then +outfile="$datadir/pixfmt/" +mkdir -p "$outfile" +conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \ + yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \ + monob yuv440p yuvj440p" +for pix_fmt in $conversions ; do + file=${outfile}${pix_fmt}.yuv + do_ffmpeg_nocheck $file -r 1 -t 1 -f image2 -vcodec pgmyuv -i $raw_src \ + -f rawvideo -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst + do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \ + -f rawvideo -s 352x288 -pix_fmt yuv444p +done +fi diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavfi-regression.sh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavfi-regression.sh new file mode 100755 index 00000000..ed13f705 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/lavfi-regression.sh @@ -0,0 +1,84 @@ +#!/bin/sh +# +# automatic regression test for libavfilter +# +# +#set -x + +set -e + +. $(dirname $0)/regression-funcs.sh + +eval do_$test=y + +rm -f "$logfile" +rm -f "$benchfile" + +do_video_filter() { + label=$1 + filters=$2 + shift 2 + printf '%-20s' $label >>$logfile + run_ffmpeg -f image2 -vcodec pgmyuv -i $raw_src \ + -vf "$filters" -vcodec rawvideo $* -f nut md5: >>$logfile +} + +do_lavfi() { + vfilters="slicify=random,$2" + + if [ $test = $1 ] ; then + do_video_filter $test "$vfilters" + fi +} + +do_lavfi "crop" "crop=iw-100:ih-100:100:100" +do_lavfi "crop_scale" "crop=iw-100:ih-100:100:100,scale=400:-1" +do_lavfi "crop_scale_vflip" "null,null,crop=iw-200:ih-200:200:200,crop=iw-20:ih-20:20:20,scale=200:200,scale=250:250,vflip,vflip,null,scale=200:200,crop=iw-100:ih-100:100:100,vflip,scale=200:200,null,vflip,crop=iw-100:ih-100:100:100,null" +do_lavfi "crop_vflip" "crop=iw-100:ih-100:100:100,vflip" +do_lavfi "null" "null" +do_lavfi "scale200" "scale=200:200" +do_lavfi "scale500" "scale=500:500" +do_lavfi "vflip" "vflip" +do_lavfi "vflip_crop" "vflip,crop=iw-100:ih-100:100:100" +do_lavfi "vflip_vflip" "vflip,vflip" + +do_lavfi_pixfmts(){ + test ${test%_[bl]e} = pixfmts_$1 || return 0 + filter=$1 + filter_args=$2 + + showfiltfmts="$target_exec $target_path/tools/lavfi-showfiltfmts" + exclude_fmts=${outfile}${1}_exclude_fmts + out_fmts=${outfile}${1}_out_fmts + + # exclude pixel formats which are not supported as input + $ffmpeg -pix_fmts list 2>/dev/null | sed -ne '9,$p' | grep '^\..\.' | cut -d' ' -f2 | sort >$exclude_fmts + $showfiltfmts scale | awk -F '[ \r]' '/^OUTPUT/{ print $3 }' | sort | comm -23 - $exclude_fmts >$out_fmts + + pix_fmts=$($showfiltfmts $filter | awk -F '[ \r]' '/^INPUT/{ print $3 }' | sort | comm -12 - $out_fmts) + for pix_fmt in $pix_fmts; do + do_video_filter $pix_fmt "slicify=random,format=$pix_fmt,$filter=$filter_args" -pix_fmt $pix_fmt + done + + rm $exclude_fmts $out_fmts +} + +# all these filters have exactly one input and exactly one output +do_lavfi_pixfmts "copy" "" +do_lavfi_pixfmts "crop" "100:100:100:100" +do_lavfi_pixfmts "hflip" "" +do_lavfi_pixfmts "null" "" +do_lavfi_pixfmts "pad" "500:400:20:20" +do_lavfi_pixfmts "scale" "200:100" +do_lavfi_pixfmts "vflip" "" + +if [ -n "$do_pixdesc_be" ] || [ -n "$do_pixdesc_le" ]; then + pix_fmts="$($ffmpeg -pix_fmts list 2>/dev/null | sed -ne '9,$p' | grep '^IO' | cut -d' ' -f2 | sort)" + for pix_fmt in $pix_fmts; do + do_video_filter $pix_fmt "slicify=random,format=$pix_fmt,pixdesctest" -pix_fmt $pix_fmt + done +fi + +# TODO: add tests for +# direct rendering, +# chains with feedback loops diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/md5.sh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/md5.sh new file mode 100644 index 00000000..16b0281c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/md5.sh @@ -0,0 +1,13 @@ +# try to find an md5 program + +if [ X"$(echo | md5sum 2> /dev/null)" != X ]; then + do_md5sum() { md5sum -b $1; } +elif [ X"$(echo | md5 2> /dev/null)" != X ]; then + do_md5sum() { md5 $1 | sed 's#MD5 (\(.*\)) = \(.*\)#\2 *\1#'; } +elif [ -x /sbin/md5 ]; then + do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; } +elif openssl version >/dev/null 2>&1; then + do_md5sum() { openssl md5 $1 | sed 's/MD5(\(.*\))= \(.*\)/\2 *\1/'; } +else + do_md5sum() { echo No md5sum program found; } +fi diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/ac3_fixed b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/ac3_fixed new file mode 100644 index 00000000..5c75ecd0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/ac3_fixed @@ -0,0 +1,2 @@ +37e119c644ba0472c079d0e907bf78df *./tests/data/acodec/ac3.rm +98751 ./tests/data/acodec/ac3.rm diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_ima_qt b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_ima_qt new file mode 100644 index 00000000..6e441566 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_ima_qt @@ -0,0 +1,4 @@ +3c06fd2f7831e3e8735b936e23ca220c *./tests/data/acodec/adpcm_qt.aiff +281252 ./tests/data/acodec/adpcm_qt.aiff +9580492803ba1c1a3746367b24b751c8 *./tests/data/adpcm_ima_qt.acodec.out.wav +stddev: 914.65 PSNR: 37.10 MAXDIFF:34026 bytes: 1058560/ 1058400 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_ima_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_ima_wav new file mode 100644 index 00000000..29f5836f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_ima_wav @@ -0,0 +1,4 @@ +56b75c3a6dacedcf2ce7b0586aa33594 *./tests/data/acodec/adpcm_ima.wav +267324 ./tests/data/acodec/adpcm_ima.wav +78a2af1c895792d0c221d127bdd48ece *./tests/data/adpcm_ima_wav.acodec.out.wav +stddev: 903.51 PSNR: 37.21 MAXDIFF:34026 bytes: 1061748/ 1058400 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_ms b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_ms new file mode 100644 index 00000000..65d2a6ca --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_ms @@ -0,0 +1,4 @@ +a407b87daeef5b25dfb6c5b3f519e9c1 *./tests/data/acodec/adpcm_ms.wav +268378 ./tests/data/acodec/adpcm_ms.wav +7be370f937c51e8a967e6a3d08d5156a *./tests/data/adpcm_ms.acodec.out.wav +stddev: 1050.01 PSNR: 35.91 MAXDIFF:29806 bytes: 1060576/ 1058400 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_swf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_swf new file mode 100644 index 00000000..27a5da51 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_swf @@ -0,0 +1,4 @@ +42d4639866ed4d692eaf126228a4fa2a *./tests/data/acodec/adpcm_swf.flv +269166 ./tests/data/acodec/adpcm_swf.flv +628089745a7059ae4055c2515b6d668b *./tests/data/adpcm_swf.acodec.out.wav +stddev: 933.58 PSNR: 36.93 MAXDIFF:51119 bytes: 1064960/ 1058400 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_yam b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_yam new file mode 100644 index 00000000..d7076e72 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/adpcm_yam @@ -0,0 +1,4 @@ +2546d72df736b5ffa1557e8c9c9ef788 *./tests/data/acodec/adpcm_yam.wav +266296 ./tests/data/acodec/adpcm_yam.wav +c80c847a53a0fee17a88fa889ec34a4e *./tests/data/adpcm_yam.acodec.out.wav +stddev: 1247.60 PSNR: 34.41 MAXDIFF:39895 bytes: 1064960/ 1058400 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/alac b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/alac new file mode 100644 index 00000000..1f4b264b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/alac @@ -0,0 +1,4 @@ +c68f649777ab8e7c9a0f1f221451d3ad *./tests/data/acodec/alac.m4a +389386 ./tests/data/acodec/alac.m4a +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/alac.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/flac b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/flac new file mode 100644 index 00000000..e9d7cfc0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/flac @@ -0,0 +1,4 @@ +151eef9097f944726968bec48649f00a *./tests/data/acodec/flac.flac +361582 ./tests/data/acodec/flac.flac +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/flac.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/g726 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/g726 new file mode 100644 index 00000000..d2dbe504 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/g726 @@ -0,0 +1,4 @@ +fd090ddf05cc3401cc75c4a5ace1d05a *./tests/data/acodec/g726.wav +24052 ./tests/data/acodec/g726.wav +74abea06027375111eeac1b2f8c7d3af *./tests/data/g726.acodec.out.wav +stddev: 8554.55 PSNR: 17.69 MAXDIFF:29353 bytes: 95984/ 1058400 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/mp2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/mp2 new file mode 100644 index 00000000..df21be2b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/mp2 @@ -0,0 +1,5 @@ +f6eb0a205350bbd7fb1028a01c7ae8aa *./tests/data/acodec/mp2.mp2 +96130 ./tests/data/acodec/mp2.mp2 +74c7b6b15a001add199619fafe4059a1 *./tests/data/mp2.acodec.out.wav +stddev: 9315.99 PSNR: 16.94 MAXDIFF:65388 bytes: 1059840/ 1058400 +stddev: 4384.33 PSNR: 23.49 MAXDIFF:52631 bytes: 1057916/ 1058400 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/pcm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/pcm new file mode 100644 index 00000000..1d876e4a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/pcm @@ -0,0 +1,72 @@ +89f5b8dd97e0dddbe59af0d44fd229f3 *./tests/data/acodec/pcm_alaw.wav +529256 ./tests/data/acodec/pcm_alaw.wav +0568b0b9a72e31559e150e7e09d301cd *./tests/data/pcm.acodec.out.wav +stddev: 101.67 PSNR: 56.19 MAXDIFF: 515 bytes: 1058400/ 1058400 +f443a8eeb1647ec1eeb8370c939e52d4 *./tests/data/acodec/pcm_mulaw.wav +529256 ./tests/data/acodec/pcm_mulaw.wav +1c3eeaa8814ebd4916780dff80ed6dc5 *./tests/data/pcm.acodec.out.wav +stddev: 103.38 PSNR: 56.04 MAXDIFF: 644 bytes: 1058400/ 1058400 +b7936d7170e0efefb379349d81aed360 *./tests/data/acodec/pcm_s8.mov +530837 ./tests/data/acodec/pcm_s8.mov +652edf30f35ad89bf27bcc9d2f9c7b53 *./tests/data/pcm.acodec.out.wav +stddev: 147.89 PSNR: 52.93 MAXDIFF: 255 bytes: 1058400/ 1058400 +98cadb3502dbdc99e6e077c28b1a036c *./tests/data/acodec/pcm_u8.wav +529244 ./tests/data/acodec/pcm_u8.wav +652edf30f35ad89bf27bcc9d2f9c7b53 *./tests/data/pcm.acodec.out.wav +stddev: 147.89 PSNR: 52.93 MAXDIFF: 255 bytes: 1058400/ 1058400 +c42b9c04305455250366c84e17c1023f *./tests/data/acodec/pcm_s16be.mov +1060037 ./tests/data/acodec/pcm_s16be.mov +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/acodec/pcm_s16le.wav +1058444 ./tests/data/acodec/pcm_s16le.wav +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 +352a6bcf51d0f3ca4bf27c423a3d4d14 *./tests/data/acodec/pcm_s16be.mkv + 1060650 ./tests/data/acodec/pcm_s16be.mkv +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 +2c089d83b2699c02c9358415e00a9707 *./tests/data/acodec/pcm_s16le.mkv + 1060650 ./tests/data/acodec/pcm_s16le.mkv +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 +07ffe7ffb78f3648b6524debdde5aec1 *./tests/data/acodec/pcm_s24be.mov +1589237 ./tests/data/acodec/pcm_s24be.mov +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 +a85380fb79b0d4fff38e24ac1e34bb94 *./tests/data/acodec/pcm_s24le.wav +1587668 ./tests/data/acodec/pcm_s24le.wav +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 +d7792f0343cd66fda8b50b569e2bcc48 *./tests/data/acodec/pcm_s32be.mov +2118437 ./tests/data/acodec/pcm_s32be.mov +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 +da6ed80f4f40f0082577dea80827e014 *./tests/data/acodec/pcm_s32le.wav +2116868 ./tests/data/acodec/pcm_s32le.wav +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 +118ff3dc83c62ce9ce669eef57e55bb2 *./tests/data/acodec/pcm_f32be.au +2116824 ./tests/data/acodec/pcm_f32be.au +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 +46f44f86a18984a832206ab9e29a79f2 *./tests/data/acodec/pcm_f32le.wav +2116880 ./tests/data/acodec/pcm_f32le.wav +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 +8112296b1ed94f72f20d04b1a54850a7 *./tests/data/acodec/pcm_f64be.au +4233624 ./tests/data/acodec/pcm_f64be.au +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 +ba17c6d1a270e1333e981f239bf7eb45 *./tests/data/acodec/pcm_f64le.wav +4233680 ./tests/data/acodec/pcm_f64le.wav +95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 +8c74234928ed425b1171211a89f67ead *./tests/data/acodec/pcm_zork.wav +529256 ./tests/data/acodec/pcm_zork.wav +864c8c866ac25642c29a13b122c70709 *./tests/data/pcm.acodec.out.wav +stddev: 633.11 PSNR: 40.30 MAXDIFF:32768 bytes: 1058400/ 1058400 +8168a5c1343553ef027541830f2cb879 *./tests/data/acodec/pcm_s24daud.302 +10368730 ./tests/data/acodec/pcm_s24daud.302 +f552afadfdfcd6348a07095da6382de5 *./tests/data/pcm.acodec.out.wav +stddev: 9416.28 PSNR: 16.85 MAXDIFF:42744 bytes: 6911796/ 1058400 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/wmav1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/wmav1 new file mode 100644 index 00000000..916e4a8a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/wmav1 @@ -0,0 +1,4 @@ +26a7f6b0f0b7181df8df3fa589f6bf81 *./tests/data/acodec/wmav1.asf +106004 ./tests/data/acodec/wmav1.asf +stddev:12245.52 PSNR: 14.57 MAXDIFF:65521 bytes: 1064960/ 1058400 +stddev: 2095.89 PSNR: 29.90 MAXDIFF:27658 bytes: 1056768/ 1058400 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/wmav2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/wmav2 new file mode 100644 index 00000000..622b6fcc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/acodec/wmav2 @@ -0,0 +1,4 @@ +7c6c0cb692af01b312ae345723674b5f *./tests/data/acodec/wmav2.asf +106044 ./tests/data/acodec/wmav2.asf +stddev:12249.93 PSNR: 14.57 MAXDIFF:65521 bytes: 1064960/ 1058400 +stddev: 2089.21 PSNR: 29.93 MAXDIFF:27650 bytes: 1056768/ 1058400 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/4xm-1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/4xm-1 new file mode 100644 index 00000000..5e66dcce --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/4xm-1 @@ -0,0 +1,15 @@ +0, 0, 921600, 0xd08f97c7 +0, 6000, 921600, 0xc433a85b +0, 12000, 921600, 0x7ffeee42 +0, 18000, 921600, 0xc0ad9f52 +0, 24000, 921600, 0xb0235112 +0, 30000, 921600, 0xcbdd9805 +0, 36000, 921600, 0x5468bdb9 +0, 42000, 921600, 0x2f0c63fd +0, 48000, 921600, 0xf1de04f0 +0, 54000, 921600, 0x95709ce2 +0, 60000, 921600, 0x69037c4a +0, 66000, 921600, 0x513f8a98 +0, 72000, 921600, 0x55b82fa1 +0, 78000, 921600, 0x5c8ace28 +0, 84000, 921600, 0xb019770a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/4xm-2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/4xm-2 new file mode 100644 index 00000000..4037f28f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/4xm-2 @@ -0,0 +1,174 @@ +0, 0, 80640, 0x00000000 +0, 15000, 80640, 0x3a942680 +0, 30000, 80640, 0x3a942680 +0, 45000, 80640, 0x3a942680 +0, 60000, 80640, 0x3a942680 +0, 75000, 80640, 0x3a942680 +0, 90000, 80640, 0x3a942680 +0, 105000, 80640, 0x1956ebfc +0, 120000, 80640, 0x61686290 +0, 135000, 80640, 0x7e2c2753 +0, 150000, 80640, 0x63e5e14f +0, 165000, 80640, 0xa775947a +0, 180000, 80640, 0x4b91b93d +0, 195000, 80640, 0x83345f32 +0, 210000, 80640, 0x5d3a3374 +0, 225000, 80640, 0x164808c5 +0, 240000, 80640, 0xfd0189af +0, 255000, 80640, 0x062f9389 +0, 270000, 80640, 0xe4dcaff8 +0, 285000, 80640, 0xb2d9ec51 +0, 300000, 80640, 0x3b4d5331 +0, 315000, 80640, 0xfcbd8da1 +0, 330000, 80640, 0xa0732142 +0, 345000, 80640, 0x6438df5f +0, 360000, 80640, 0x614302fa +0, 375000, 80640, 0x53edf986 +0, 390000, 80640, 0x6dfe13f0 +0, 405000, 80640, 0x0b2194c3 +0, 420000, 80640, 0xe0436945 +0, 435000, 80640, 0x8d8ba77f +0, 450000, 80640, 0x9c723388 +0, 465000, 80640, 0x336bd2a2 +0, 480000, 80640, 0x5905fd0b +0, 495000, 80640, 0x2ca368bb +0, 510000, 80640, 0x38c1e5ec +0, 525000, 80640, 0xe439a194 +0, 540000, 80640, 0xe7a19a64 +0, 555000, 80640, 0xbe7f9094 +0, 570000, 80640, 0x0b2cbec9 +0, 585000, 80640, 0x8050bf7d +0, 600000, 80640, 0x4e9d4e78 +0, 615000, 80640, 0xaa7bb85d +0, 630000, 80640, 0x6e42b1a6 +0, 645000, 80640, 0x27043fe0 +0, 660000, 80640, 0xe04bd5e6 +0, 675000, 80640, 0xd60762d6 +0, 690000, 80640, 0x2729df8f +0, 705000, 80640, 0x1b62c4f7 +0, 720000, 80640, 0xe6b5d2f7 +0, 735000, 80640, 0xf5885096 +0, 750000, 80640, 0xe7625cf6 +0, 765000, 80640, 0xed804de6 +0, 780000, 80640, 0x3f92728e +0, 795000, 80640, 0x353e4b0d +0, 810000, 80640, 0x70b0228c +0, 825000, 80640, 0x851bd554 +0, 840000, 80640, 0x594f22eb +0, 855000, 80640, 0xa2267c0b +0, 870000, 80640, 0xdc0fbafb +0, 885000, 80640, 0xd596b763 +0, 900000, 80640, 0x3b9c4b1b +0, 915000, 80640, 0x218ac4b4 +0, 930000, 80640, 0x4af393a4 +0, 945000, 80640, 0x66c098c5 +0, 960000, 80640, 0x7cc91e86 +0, 975000, 80640, 0xba282a2e +0, 990000, 80640, 0x50932be6 +0, 1005000, 80640, 0x6531386e +0, 1020000, 80640, 0x2616235f +0, 1035000, 80640, 0x27aad18a +0, 1050000, 80640, 0x67491df3 +0, 1065000, 80640, 0x167028f1 +0, 1080000, 80640, 0xa4229420 +0, 1095000, 80640, 0x77eaed07 +0, 1110000, 80640, 0xbdf7d8e8 +0, 1125000, 80640, 0xc2ac8545 +0, 1140000, 80640, 0xf3fe64ec +0, 1155000, 80640, 0x66451d43 +0, 1170000, 80640, 0x1af2f05e +0, 1185000, 80640, 0x2a63c2c4 +0, 1200000, 80640, 0xe4e07a0f +0, 1215000, 80640, 0x598e8b11 +0, 1230000, 80640, 0xb2ebb868 +0, 1245000, 80640, 0xa4b6bb8a +0, 1260000, 80640, 0x5037e910 +0, 1275000, 80640, 0x0c55f6c0 +0, 1290000, 80640, 0x3f4704f7 +0, 1305000, 80640, 0xa6a8e810 +0, 1320000, 80640, 0xedbfcfb0 +0, 1335000, 80640, 0xe568caa0 +0, 1350000, 80640, 0xdf21cc20 +0, 1365000, 80640, 0xb66cd4a8 +0, 1380000, 80640, 0xcd26c9c8 +0, 1395000, 80640, 0x5fe8d598 +0, 1410000, 80640, 0xed0dc9c8 +0, 1425000, 80640, 0x8313d288 +0, 1440000, 80640, 0x9ccdd4a0 +0, 1455000, 80640, 0x66ffe970 +0, 1470000, 80640, 0xf68ad1c8 +0, 1485000, 80640, 0xd570f658 +0, 1500000, 80640, 0x8c39d998 +0, 1515000, 80640, 0xe18fe5e0 +0, 1530000, 80640, 0xbbe7e340 +0, 1545000, 80640, 0x9a90d470 +0, 1560000, 80640, 0xd2bbced0 +0, 1575000, 80640, 0xbbf9dce0 +0, 1590000, 80640, 0x4ff7c888 +0, 1605000, 80640, 0xc2e7e1f0 +0, 1620000, 80640, 0x2104e3b0 +0, 1635000, 80640, 0xaef5e8f0 +0, 1650000, 80640, 0xc477e890 +0, 1665000, 80640, 0xb12df778 +0, 1680000, 80640, 0xd2115720 +0, 1695000, 80640, 0x620b6538 +0, 1710000, 80640, 0x894a8db8 +0, 1725000, 80640, 0x8da3bcb0 +0, 1740000, 80640, 0x96be8930 +0, 1755000, 80640, 0xe69dc1f0 +0, 1770000, 80640, 0x42b8d4e0 +0, 1785000, 80640, 0x0a8da4f0 +0, 1800000, 80640, 0x245fd3d8 +0, 1815000, 80640, 0x3fd1e858 +0, 1830000, 80640, 0xe2c299f0 +0, 1845000, 80640, 0xda1cddd0 +0, 1860000, 80640, 0xf126e498 +0, 1875000, 80640, 0xc85ab920 +0, 1890000, 80640, 0x52f39de8 +0, 1905000, 80640, 0xd0daac60 +0, 1920000, 80640, 0xef323347 +0, 1935000, 80640, 0xcc063317 +0, 1950000, 80640, 0xb6f53057 +0, 1965000, 80640, 0x5fe53b07 +0, 1980000, 80640, 0x63183d7f +0, 1995000, 80640, 0x91a44bbf +0, 2010000, 80640, 0xa433480f +0, 2025000, 80640, 0xe90652ef +0, 2040000, 80640, 0xe96e35bf +0, 2055000, 80640, 0x84ff2ccf +0, 2070000, 80640, 0x930f2b07 +0, 2085000, 80640, 0x5a1228d7 +0, 2100000, 80640, 0x29f226ef +0, 2115000, 80640, 0xd35136df +0, 2130000, 80640, 0x0e2d407f +0, 2145000, 80640, 0x34a93267 +0, 2160000, 80640, 0x7ae82af7 +0, 2175000, 80640, 0xb20c2477 +0, 2190000, 80640, 0xa104218f +0, 2205000, 80640, 0xcb1121e7 +0, 2220000, 80640, 0xaca04751 +0, 2235000, 80640, 0x3a51c704 +0, 2250000, 80640, 0xfa632e3d +0, 2265000, 80640, 0x61c9407c +0, 2280000, 80640, 0xe9a08dd9 +0, 2295000, 80640, 0xebf3c623 +0, 2310000, 80640, 0x00000000 +0, 2325000, 80640, 0x0f412500 +0, 2340000, 80640, 0x0f412500 +0, 2355000, 80640, 0x0f412500 +0, 2370000, 80640, 0xb6634270 +0, 2385000, 80640, 0x9e43a4a0 +0, 2400000, 80640, 0x136ab60b +0, 2415000, 80640, 0x6ce3254e +0, 2430000, 80640, 0xf4340d15 +0, 2445000, 80640, 0x73861114 +0, 2460000, 80640, 0x36b300d3 +0, 2475000, 80640, 0x2ddde523 +0, 2490000, 80640, 0xfdd79c02 +0, 2505000, 80640, 0xe6cc4fe9 +0, 2520000, 80640, 0x5b13e2b9 +0, 2535000, 80640, 0x0d588e70 +0, 2550000, 80640, 0xc6e4023f +0, 2565000, 80640, 0xf54c496f +0, 2580000, 80640, 0xa315a5cf +0, 2595000, 80640, 0x2d2ac9c7 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/8bps b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/8bps new file mode 100644 index 00000000..6ee96177 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/8bps @@ -0,0 +1,35 @@ +1, 0, 2048, 0x3d042426 +0, 0, 259200, 0x7e91df07 +1, 4180, 2048, 0x5bcae456 +0, 7200, 259200, 0x7e91df07 +1, 8359, 2048, 0xb6043655 +1, 12539, 2048, 0x6fdaffad +0, 14400, 259200, 0xc468c119 +1, 16718, 2048, 0xf86700cb +1, 20898, 2048, 0x045e46c1 +0, 21600, 259200, 0x0e058930 +1, 25078, 2048, 0x000df0e5 +0, 28800, 259200, 0xa0261310 +1, 29257, 2048, 0x8f5f12fb +1, 33437, 2048, 0xd516f6b0 +0, 36000, 259200, 0x78ca9aba +1, 37616, 2048, 0xa1fe2bd3 +1, 41796, 2048, 0x3647087a +0, 43200, 259200, 0x4971f7b3 +1, 45976, 2048, 0xd2ee584e +1, 50155, 2048, 0xf132088c +0, 50400, 259200, 0x7dc2cff7 +1, 54335, 2048, 0x1efc0eb1 +0, 57600, 259200, 0x8cbc53d5 +1, 58514, 2048, 0xeb73f402 +1, 62694, 2048, 0x75cb3d20 +0, 64800, 259200, 0xcccd77e3 +1, 66873, 2048, 0x85a501b6 +1, 71053, 2048, 0xa4eb312d +0, 72000, 259200, 0x6b3e0fb3 +1, 75233, 2048, 0xf0aaf8c7 +0, 79200, 259200, 0x281dd175 +1, 79412, 2048, 0x65371cda +1, 83592, 2048, 0x25512cd6 +1, 87771, 2048, 0xc81410e3 +1, 91951, 514, 0x57d77b94 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/aac-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/aac-demux new file mode 100644 index 00000000..744ae64d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/aac-demux @@ -0,0 +1 @@ +CRC=0xbda37454 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/aasc b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/aasc new file mode 100644 index 00000000..7ec02ba5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/aasc @@ -0,0 +1,23 @@ +0, 0, 168000, 0x45addf8f +0, 3600, 168000, 0x45addf8f +0, 7200, 168000, 0x45addf8f +0, 10800, 168000, 0x45addf8f +0, 14400, 168000, 0x45addf8f +0, 18000, 168000, 0x45addf8f +0, 21600, 168000, 0x45addf8f +0, 25200, 168000, 0x45addf8f +0, 28800, 168000, 0x45addf8f +0, 32400, 168000, 0x45addf8f +0, 36000, 168000, 0x45addf8f +0, 39600, 168000, 0x45addf8f +0, 43200, 168000, 0x8730699b +0, 46800, 168000, 0x08b095df +0, 50400, 168000, 0x203526e3 +0, 54000, 168000, 0x0ebc5142 +0, 57600, 168000, 0xd168e7c2 +0, 61200, 168000, 0xcc7da0e6 +0, 64800, 168000, 0x72ac60b8 +0, 68400, 168000, 0xb691e27c +0, 72000, 168000, 0x646fa087 +0, 75600, 168000, 0x404450a2 +0, 79200, 168000, 0x5214c456 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/adpcm-ea-r2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/adpcm-ea-r2 new file mode 100644 index 00000000..4bca11f6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/adpcm-ea-r2 @@ -0,0 +1 @@ +CRC=0xa1158634 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/adpcm-ea-r3 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/adpcm-ea-r3 new file mode 100644 index 00000000..920a4d00 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/adpcm-ea-r3 @@ -0,0 +1 @@ +CRC=0x9ea2507f diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/aea-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/aea-demux new file mode 100644 index 00000000..18ec8b88 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/aea-demux @@ -0,0 +1 @@ +CRC=0xc1312082 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/alg-mm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/alg-mm new file mode 100644 index 00000000..6e245ac0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/alg-mm @@ -0,0 +1,31 @@ +0, 0, 122880, 0x4ed8123f +0, 9000, 122880, 0xc4c35304 +0, 18000, 122880, 0xbd3015fd +0, 27000, 122880, 0xece5dbab +0, 36000, 122880, 0x13249f3f +0, 45000, 122880, 0x58f75895 +0, 54000, 122880, 0xe6570f7d +0, 63000, 122880, 0xcce88145 +0, 72000, 122880, 0x796f633c +0, 81000, 122880, 0x182c3cd3 +0, 90000, 122880, 0x04b2513b +0, 99000, 122880, 0x6b7e2e42 +0, 108000, 122880, 0x2fa47070 +0, 117000, 122880, 0x7142919e +0, 126000, 122880, 0x8995337e +0, 135000, 122880, 0x5146ca20 +0, 144000, 122880, 0x9aadb491 +0, 153000, 122880, 0x2d5b0032 +0, 162000, 122880, 0x5c7c8314 +0, 171000, 122880, 0x2ba8253c +0, 180000, 122880, 0xd19d504b +0, 189000, 122880, 0x4ff15fd1 +0, 198000, 122880, 0x76039f9f +0, 207000, 122880, 0xcce84d35 +0, 216000, 122880, 0x68c5797c +0, 225000, 122880, 0xf1da4293 +0, 234000, 122880, 0xf5f537f3 +0, 243000, 122880, 0x8d3ffa94 +0, 252000, 122880, 0x3ca9b69c +0, 261000, 122880, 0x21187f6c +0, 270000, 122880, 0xe5136e34 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/amv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/amv new file mode 100644 index 00000000..a8e7136e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/amv @@ -0,0 +1,320 @@ +0, 0, 28800, 0x026058a9 +1, 0, 2756, 0x0af35034 +1, 5624, 2756, 0x8462443f +0, 5625, 28800, 0x5dc728de +1, 11249, 2756, 0x9f493ba6 +0, 11250, 28800, 0x83e19a2c +1, 16873, 2756, 0x634e5f06 +0, 16875, 28800, 0xb029f94a +1, 22498, 2760, 0x51f35cd4 +0, 22500, 28800, 0x735a6b15 +0, 28125, 28800, 0xf7e9dc8b +1, 28131, 2756, 0x011c51e5 +0, 33750, 28800, 0xa108b0cf +1, 33755, 2756, 0x8c2c198c +0, 39375, 28800, 0x3d11c138 +1, 39380, 2756, 0x2b4a3397 +0, 45000, 28800, 0xed23afda +1, 45004, 2756, 0x63794f22 +0, 50625, 28800, 0x713bb2dc +1, 50629, 2756, 0xfc363898 +0, 56250, 28800, 0x551ad51e +1, 56253, 2756, 0x0da5486e +0, 61875, 28800, 0x49dfcf2d +1, 61878, 2756, 0xbae17a5f +0, 67500, 28800, 0x6399d5b3 +1, 67502, 2760, 0xba266e1b +0, 73125, 28800, 0x520ad812 +1, 73135, 2756, 0xdfb61002 +0, 78750, 28800, 0xc46ad9da +1, 78759, 2756, 0x15d029da +0, 84375, 28800, 0xe79edb9e +1, 84384, 2756, 0x7bc82012 +0, 90000, 28800, 0xdb1acb30 +1, 90008, 2756, 0x002e6999 +0, 95625, 28800, 0x050fb669 +1, 95633, 2756, 0x96346ba6 +0, 101250, 28800, 0x096ca687 +1, 101257, 2756, 0x3d54543b +0, 106875, 28800, 0x0054a6bd +1, 106882, 2760, 0x601786e1 +0, 112500, 28800, 0x6d7daad2 +1, 112514, 2756, 0xf22a5793 +0, 118125, 28800, 0x9c10a9dc +1, 118139, 2756, 0x21f54d49 +0, 123750, 28800, 0x89b1a623 +1, 123763, 2756, 0x0c6d4399 +0, 129375, 28800, 0xa0a19c3f +1, 129388, 2756, 0x17282f8e +0, 135000, 28800, 0x26c898ad +1, 135012, 2756, 0xeb698f75 +0, 140625, 28800, 0x6f639dae +1, 140637, 2756, 0x935e1de2 +0, 146250, 28800, 0xa173a9b5 +1, 146261, 2760, 0xb6fb4293 +0, 151875, 28800, 0xa309aa08 +1, 151894, 2756, 0x485053dc +0, 157500, 28800, 0x2059b6c4 +1, 157518, 2756, 0x24c35027 +0, 163125, 28800, 0x5ae8c761 +1, 163143, 2756, 0x09f323ee +0, 168750, 28800, 0xb780c9c5 +1, 168767, 2756, 0xbc7d58d5 +0, 174375, 28800, 0xf58ac8fe +1, 174392, 2756, 0xaefd487c +0, 180000, 28800, 0x9bb307e7 +1, 180016, 2756, 0xaca16cc0 +0, 185625, 28800, 0xd32c3e81 +1, 185641, 2760, 0x98a76091 +0, 191250, 28800, 0x4edd51d2 +1, 191273, 2756, 0x5d357141 +0, 196875, 28800, 0x5a88684d +1, 196898, 2756, 0x65ea2657 +0, 202500, 28800, 0x5bd97f0e +1, 202522, 2756, 0xb5e1334a +0, 208125, 28800, 0x36d67843 +1, 208147, 2756, 0x32cd5d91 +0, 213750, 28800, 0x0e18781d +1, 213771, 2756, 0xdc23722b +0, 219375, 28800, 0xa3168807 +1, 219396, 2756, 0x2ba34684 +0, 225000, 28800, 0xa7c575b8 +1, 225020, 2756, 0xf9755ba8 +0, 230625, 28800, 0x86367c37 +1, 230645, 2760, 0x24221ddb +0, 236250, 28800, 0xb0f79180 +1, 236278, 2756, 0xef843aa4 +0, 241875, 28800, 0x61da8c0f +1, 241902, 2756, 0x420442fe +0, 247500, 28800, 0x9b11948a +1, 247527, 2756, 0x5a0933cb +0, 253125, 28800, 0xc53d9b44 +1, 253151, 2756, 0xef5f6d61 +0, 258750, 28800, 0xdc699185 +1, 258776, 2756, 0xe57e6dc0 +0, 264375, 28800, 0x7b4f92b5 +1, 264400, 2756, 0xc0f0495a +0, 270000, 28800, 0x40469065 +1, 270024, 2760, 0x2c3b55df +0, 275625, 28800, 0x737ea07e +1, 275657, 2756, 0x39c2586c +0, 281250, 28800, 0x0db49c8b +1, 281282, 2756, 0x7ffc46e5 +0, 286875, 28800, 0x39249f10 +1, 286906, 2756, 0xa2766664 +0, 292500, 28800, 0xc182ab99 +1, 292531, 2756, 0xacb50c6c +0, 298125, 28800, 0xd8f7a7c9 +1, 298155, 2756, 0x7f659084 +0, 303750, 28800, 0x46789caa +1, 303780, 2756, 0xc72e6a12 +0, 309375, 28800, 0x4759a374 +1, 309404, 2760, 0xdb6944df +0, 315000, 28800, 0xe621b16a +1, 315037, 2756, 0x954f45c1 +0, 320625, 28800, 0xcf47a999 +1, 320661, 2756, 0xa9484240 +0, 326250, 28800, 0x801dacd4 +1, 326286, 2756, 0x1d595349 +0, 331875, 28800, 0xe580af51 +1, 331910, 2756, 0xcf2a565e +0, 337500, 28800, 0x03d7a887 +1, 337535, 2756, 0x391028d5 +0, 343125, 28800, 0xa67ea51d +1, 343159, 2756, 0x348db7ad +0, 348750, 28800, 0x9fee0ec8 +1, 348784, 2760, 0xb69b5e3a +0, 354375, 28800, 0x7f602a5e +1, 354416, 2756, 0xe3635fbe +0, 360000, 28800, 0x100d432a +1, 360041, 2756, 0xdcad3654 +0, 365625, 28800, 0x42164dfb +1, 365665, 2756, 0x5c17abef +0, 371250, 28800, 0x86c05196 +1, 371290, 2756, 0xb3235184 +0, 376875, 28800, 0xfc225938 +1, 376914, 2756, 0xdabb64a6 +0, 382500, 28800, 0x81085e87 +1, 382539, 2756, 0xa95dc58d +0, 388125, 28800, 0xaa8f5d0a +1, 388163, 2760, 0x8e7ac9eb +0, 393750, 28800, 0x605a5f9f +1, 393796, 2756, 0x492b658e +0, 399375, 28800, 0x68dc64b2 +1, 399420, 2756, 0x377483ab +0, 405000, 28800, 0xd08e710b +1, 405045, 2756, 0x2c250279 +0, 410625, 28800, 0xf8567939 +1, 410669, 2756, 0x704dbdb3 +0, 416250, 28800, 0x8dad7a4f +1, 416294, 2756, 0x800d7da2 +0, 421875, 28800, 0x1a19813c +1, 421918, 2756, 0x872aa32e +0, 427500, 28800, 0x8a157f0e +1, 427543, 2756, 0x2d4837fe +0, 433125, 28800, 0xa4fa7b9d +1, 433167, 2760, 0xc89ea57e +0, 438750, 28800, 0x093b7b36 +1, 438800, 2756, 0x6447d7ef +0, 444375, 28800, 0xa925755b +1, 444424, 2756, 0x144f59cc +0, 450000, 28800, 0xa5968138 +1, 450049, 2756, 0xc667154e +0, 455625, 28800, 0xe00877ac +1, 455673, 2756, 0xf0de66ae +0, 461250, 28800, 0xd736183e +1, 461298, 2756, 0xeabf3c32 +0, 466875, 28800, 0x356f2068 +1, 466922, 2756, 0xe98e81d1 +0, 472500, 28800, 0xf9a50f22 +1, 472547, 2760, 0x56aa5889 +0, 478125, 28800, 0x92df2ae8 +1, 478180, 2756, 0x4fd34c0e +0, 483750, 28800, 0x67a43dc8 +1, 483804, 2756, 0x67cf6912 +0, 489375, 28800, 0xf8ce2ead +1, 489429, 2756, 0xfa944def +0, 495000, 28800, 0xf42f37ee +1, 495053, 2756, 0xc12f23b2 +0, 500625, 28800, 0x03611f37 +1, 500678, 2756, 0x5ea325a2 +0, 506250, 28800, 0xddda2327 +1, 506302, 2756, 0x2b245824 +0, 511875, 28800, 0xdf073d85 +1, 511927, 2760, 0x90ac533e +0, 517500, 28800, 0xa8331fee +1, 517559, 2756, 0xcca34d26 +0, 523125, 28800, 0x59d3490a +1, 523184, 2756, 0xb5f820d0 +0, 528750, 28800, 0xa8335be6 +1, 528808, 2756, 0x27f24335 +0, 534375, 28800, 0xd5483b43 +1, 534433, 2756, 0x4a9e87b7 +0, 540000, 28800, 0x23422dc9 +1, 540057, 2756, 0xbd076129 +0, 545625, 28800, 0xc04e4689 +1, 545682, 2756, 0x2e0e3f2e +0, 551250, 28800, 0xd4d96372 +1, 551306, 2760, 0xdf534478 +0, 556875, 28800, 0x9c814e96 +1, 556939, 2756, 0xca000a2e +0, 562500, 28800, 0x7c4b5d3b +1, 562563, 2756, 0x87472df3 +0, 568125, 28800, 0x6bf66c04 +1, 568188, 2756, 0x16733810 +0, 573750, 28800, 0x6e8d4bb6 +1, 573812, 2756, 0xfa0734b4 +0, 579375, 28800, 0xad964d00 +1, 579437, 2756, 0x5eff3fc4 +0, 585000, 28800, 0x1ff36bd1 +1, 585061, 2756, 0xf35346bd +0, 590625, 28800, 0xa4664c76 +1, 590686, 2756, 0xac6411c5 +0, 596250, 28800, 0x50626d82 +1, 596310, 2760, 0x478c3c56 +0, 601875, 28800, 0x81906c5c +1, 601943, 2756, 0xebd30bdd +0, 607500, 28800, 0x5060543f +1, 607567, 2756, 0xaef95a31 +0, 613125, 28800, 0x231c5a86 +1, 613192, 2756, 0x8aad29d1 +0, 618750, 28800, 0x79775d48 +1, 618816, 2756, 0x626863f0 +0, 624375, 28800, 0xbb893571 +1, 624441, 2756, 0x68c05707 +0, 630000, 28800, 0x794c49ed +1, 630065, 2756, 0x437c5e8d +0, 635625, 28800, 0x70464bac +1, 635690, 2760, 0x8eca4bdb +0, 641250, 28800, 0xe79549ce +1, 641322, 2756, 0x62bd4162 +0, 646875, 28800, 0xa6565555 +1, 646947, 2756, 0x9f744aa4 +0, 652500, 28800, 0x2ef1ad6d +1, 652571, 2756, 0x0f3f6409 +0, 658125, 28800, 0xdd22b9aa +1, 658196, 2756, 0x3fee827a +0, 663750, 28800, 0x26ebaa97 +1, 663820, 2756, 0x48a0ac19 +0, 669375, 28800, 0x32bd979e +1, 669445, 2756, 0x8e4ce0d0 +0, 675000, 28800, 0x4c167c9a +1, 675069, 2760, 0xcda82236 +0, 680625, 28800, 0xfdf76051 +1, 680702, 2756, 0x0e523255 +0, 686250, 28800, 0x966938a8 +1, 686327, 2756, 0x84103d30 +0, 691875, 28800, 0xcea3fbde +1, 691951, 2756, 0x13941cde +0, 697500, 28800, 0x29a0c213 +1, 697576, 2756, 0x9fc834c5 +0, 703125, 28800, 0x5633a1c2 +1, 703200, 2756, 0xc0217a77 +0, 708750, 28800, 0xdc0b9af8 +1, 708824, 2756, 0x3f643659 +0, 714375, 28800, 0x92138848 +1, 714449, 2760, 0x9dbd6002 +0, 720000, 28800, 0xd7308da5 +1, 720082, 2756, 0x94f046fb +0, 725625, 28800, 0x0c8f9b3f +1, 725706, 2756, 0xab01fb12 +0, 731250, 28800, 0xd059b5d1 +1, 731331, 2756, 0x04cffe5c +0, 736875, 28800, 0xba6ed9cd +1, 736955, 2756, 0xef661c5e +0, 742500, 28800, 0x896c1064 +1, 742580, 2756, 0x094c5fc5 +0, 748125, 28800, 0x986e2fc9 +1, 748204, 2756, 0xe0c1486a +0, 753750, 28800, 0xcba94e4b +1, 753829, 2760, 0x8c3535b7 +0, 759375, 28800, 0xf3e778ed +1, 759461, 2756, 0x594934aa +0, 765000, 28800, 0xc6cd7d48 +1, 765086, 2756, 0x74007238 +0, 770625, 28800, 0xd9bd84d8 +1, 770710, 2756, 0x61f1394d +0, 776250, 28800, 0x391197b4 +1, 776335, 2756, 0x72584f07 +0, 781875, 28800, 0xf361a1d9 +1, 781959, 2756, 0xced9acf9 +0, 787500, 28800, 0x9a1ea54e +1, 787584, 2756, 0x7d2e3ea1 +0, 793125, 28800, 0x551aab57 +1, 793208, 2756, 0x56c06897 +0, 798750, 28800, 0x3af8577d +1, 798833, 2760, 0x19983bbf +0, 804375, 28800, 0x10f76ed0 +1, 804465, 2756, 0x4f884f27 +0, 810000, 28800, 0x026a7fde +1, 810090, 2756, 0x81ab2f63 +0, 815625, 28800, 0x3e0e8db8 +1, 815714, 2756, 0x448e681d +0, 821250, 28800, 0x22998d2d +1, 821339, 2756, 0x0ba9826e +0, 826875, 28800, 0x05978b12 +1, 826963, 2756, 0x049f36fa +0, 832500, 28800, 0x38b88294 +1, 832588, 2756, 0x096a2b62 +0, 838125, 28800, 0x2ef677d6 +1, 838212, 2760, 0x579e2035 +0, 843750, 28800, 0x0b9a8894 +1, 843845, 2756, 0xd13e30e1 +0, 849375, 28800, 0x2dcb6718 +1, 849469, 2756, 0x30b6412b +0, 855000, 28800, 0xa31b6679 +1, 855094, 2756, 0xbb1c3268 +0, 860625, 28800, 0x262d6a50 +1, 860718, 2756, 0xbc175b6a +0, 866250, 28800, 0xff3d6d0d +1, 866343, 2756, 0xf8d160e2 +0, 871875, 28800, 0x159d7045 +1, 871967, 2756, 0xc1048154 +0, 877500, 28800, 0xf0df7800 +1, 877592, 2760, 0xb83548f4 +0, 883125, 28800, 0xbe825ea5 +1, 883224, 2756, 0x22647962 +0, 888750, 28800, 0x80e25d5a +1, 888849, 2756, 0x14ca54d3 +0, 894375, 28800, 0x8cbe263f +1, 894473, 2756, 0x58754b3a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ansi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ansi new file mode 100644 index 00000000..bb9f35f7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ansi @@ -0,0 +1,17 @@ +0, 0, 768000, 0x3032d0de +0, 3600, 768000, 0xc3be5922 +0, 7200, 768000, 0xf530c476 +0, 10800, 768000, 0x11c1fb8e +0, 14400, 768000, 0x72d12da9 +0, 18000, 768000, 0x39c7a70d +0, 21600, 768000, 0x94bd32a4 +0, 25200, 768000, 0x06dd5ba1 +0, 28800, 768000, 0x9616ec95 +0, 32400, 768000, 0x6df5b9e2 +0, 36000, 768000, 0x7be7f60a +0, 39600, 768000, 0x2abc8623 +0, 43200, 768000, 0x5678bfff +0, 46800, 768000, 0x24a03042 +0, 50400, 768000, 0xfb011b23 +0, 54000, 768000, 0x925ff5e9 +0, 57600, 768000, 0x890e2a56 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/armovie-escape124 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/armovie-escape124 new file mode 100644 index 00000000..19e67953 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/armovie-escape124 @@ -0,0 +1,104 @@ +0, 0, 230400, 0x5288d70f +1, 0, 176400, 0xdd61578c +0, 3600, 230400, 0x2d3c1066 +0, 7200, 230400, 0x89eb5b4a +0, 10800, 230400, 0x24c2d2e7 +0, 14400, 230400, 0x9271cb38 +0, 18000, 230400, 0xc74a5009 +0, 21600, 230400, 0x61d70705 +0, 25200, 230400, 0x6bb2c252 +0, 28800, 230400, 0x6b3ac910 +0, 32400, 230400, 0x44071f28 +0, 36000, 230400, 0x8abd00fe +0, 39600, 230400, 0xcbe3395d +0, 43200, 230400, 0x603e7b7a +0, 46800, 230400, 0x2ca8865b +0, 50400, 230400, 0x11b4c665 +0, 54000, 230400, 0x3f19787c +0, 57600, 230400, 0x651d24b6 +0, 61200, 230400, 0x325d05af +0, 64800, 230400, 0x4f89d8a8 +0, 68400, 230400, 0xb07647f0 +0, 72000, 230400, 0x71141237 +0, 75600, 230400, 0xa848a2d2 +0, 79200, 230400, 0x3fbe4b58 +0, 82800, 230400, 0xa1e235a0 +0, 86400, 230400, 0x9bcf607a +0, 90000, 230400, 0x3302e9eb +1, 90000, 176400, 0x0b9e6d67 +0, 93600, 230400, 0xd731ba90 +0, 97200, 230400, 0x821eedcf +0, 100800, 230400, 0xd068a93d +0, 104400, 230400, 0x2811d46e +0, 108000, 230400, 0xd9740446 +0, 111600, 230400, 0x1bce0df6 +0, 115200, 230400, 0x44bc60ad +0, 118800, 230400, 0xf56f6200 +0, 122400, 230400, 0x874a2264 +0, 126000, 230400, 0xaa155c0e +0, 129600, 230400, 0x595392d4 +0, 133200, 230400, 0x58dc57de +0, 136800, 230400, 0x1c06733e +0, 140400, 230400, 0x6807b1db +0, 144000, 230400, 0x3fedff87 +0, 147600, 230400, 0x3e38cc13 +0, 151200, 230400, 0x6685ec35 +0, 154800, 230400, 0x6c0742fd +0, 158400, 230400, 0x8108f83c +0, 162000, 230400, 0xc0e217c8 +0, 165600, 230400, 0xb22ca65d +0, 169200, 230400, 0xd54cec93 +0, 172800, 230400, 0xd9d61de3 +0, 176400, 230400, 0x7e0f9675 +0, 180000, 230400, 0x9869f5b7 +1, 180000, 176400, 0x2793fad7 +0, 183600, 230400, 0x22f33400 +0, 187200, 230400, 0x31b999bd +0, 190800, 230400, 0x36c23878 +0, 194400, 230400, 0x06093a30 +0, 198000, 230400, 0x213f1718 +0, 201600, 230400, 0x83683006 +0, 205200, 230400, 0x0bfcec36 +0, 208800, 230400, 0x01b77825 +0, 212400, 230400, 0x650a5ea2 +0, 216000, 230400, 0xd8b2c559 +0, 219600, 230400, 0xb012eb10 +0, 223200, 230400, 0x135d53a4 +0, 226800, 230400, 0x98dd0712 +0, 230400, 230400, 0x75240ac0 +0, 234000, 230400, 0xa16769d5 +0, 237600, 230400, 0x3e08cda3 +0, 241200, 230400, 0xcd20d561 +0, 244800, 230400, 0x3531577d +0, 248400, 230400, 0x65ff4c82 +0, 252000, 230400, 0x8fd4a580 +0, 255600, 230400, 0x3cf7af4c +0, 259200, 230400, 0xda7a9202 +0, 262800, 230400, 0x4bebc138 +0, 266400, 230400, 0x5517e685 +0, 270000, 230400, 0x95f6c7a3 +1, 270000, 176400, 0xe2649a4a +0, 273600, 230400, 0x9849ebf9 +0, 277200, 230400, 0xd77e1c7d +0, 280800, 230400, 0x4dc6c923 +0, 284400, 230400, 0x7ce817c8 +0, 288000, 230400, 0xafb4acde +0, 291600, 230400, 0xd0030b2c +0, 295200, 230400, 0xb3acb77c +0, 298800, 230400, 0x4d32b61c +0, 302400, 230400, 0x2436a915 +0, 306000, 230400, 0xa6fd831f +0, 309600, 230400, 0x6c6edfca +0, 313200, 230400, 0x4b30d72e +0, 316800, 230400, 0x59f46a8a +0, 320400, 230400, 0xa2d0435f +0, 324000, 230400, 0x463872c4 +0, 327600, 230400, 0x1d7e870a +0, 331200, 230400, 0x74f4e530 +0, 334800, 230400, 0xbc61053d +0, 338400, 230400, 0x5fb238dc +0, 342000, 230400, 0x14a29d83 +0, 345600, 230400, 0x3fd1d09b +0, 349200, 230400, 0x098afc13 +0, 352800, 230400, 0x9bd12a62 +0, 356400, 230400, 0x7bf71419 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/auravision b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/auravision new file mode 100644 index 00000000..a7bccc0d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/auravision @@ -0,0 +1,24 @@ +0, 0, 28800, 0x4a4efbbc +0, 6001, 28800, 0xc6c7e26a +0, 12002, 28800, 0x6cd40913 +0, 18003, 28800, 0xa7b40fe9 +0, 24004, 28800, 0x5e77fcc6 +0, 30005, 28800, 0x9b3ef3f0 +0, 36006, 28800, 0xe7031845 +0, 42007, 28800, 0x2c15458d +0, 48008, 28800, 0xbc3d4abf +0, 54009, 28800, 0xf8755ac7 +0, 60010, 28800, 0x64d0405b +0, 66011, 28800, 0x1e0c341d +0, 72012, 28800, 0x05ca3c2b +0, 78013, 28800, 0x28cb307f +0, 84014, 28800, 0x3a9855af +0, 90015, 28800, 0x92b63321 +0, 96016, 28800, 0x85585151 +0, 102017, 28800, 0x1ff01bf9 +0, 108018, 28800, 0x4bab200f +0, 114019, 28800, 0xcf732ad7 +0, 120020, 28800, 0xced00cff +0, 126021, 28800, 0xa69046fd +0, 132022, 28800, 0x5aa341c3 +0, 138023, 28800, 0x87ef6219 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/auravision-v2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/auravision-v2 new file mode 100644 index 00000000..a4b6e82c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/auravision-v2 @@ -0,0 +1,2 @@ +0, 0, 115200, 0x2f247f66 +0, 3000, 115200, 0xf492929e diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/bethsoft-vid b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/bethsoft-vid new file mode 100644 index 00000000..4c252bdf --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/bethsoft-vid @@ -0,0 +1,141 @@ +1, 0, 1480, 0x00000000 +0, 0, 192000, 0x00000000 +0, 1500, 192000, 0x01a6cf45 +0, 3000, 192000, 0xd07d57e9 +0, 4500, 192000, 0x3cb1dff5 +1, 5994, 1480, 0x20a92bd4 +0, 6000, 192000, 0xd1aaa8fb +0, 7500, 192000, 0x75f526cd +0, 9000, 192000, 0x0f673577 +0, 10500, 192000, 0x897b6781 +1, 11988, 1850, 0xa9e48a74 +0, 12000, 192000, 0x81e6b7f7 +0, 13500, 192000, 0x1f45ce61 +0, 15000, 192000, 0x5a0772a6 +0, 16500, 192000, 0xf78732b3 +0, 18000, 192000, 0x8427f9e5 +1, 19481, 1480, 0x23ecd018 +0, 19500, 192000, 0x40473f11 +0, 21000, 192000, 0x173ceebe +0, 22500, 192000, 0x136b9516 +0, 24000, 192000, 0x138d11ae +1, 25475, 1480, 0x206bb915 +0, 25500, 192000, 0x063dbff3 +0, 27000, 192000, 0x5280852f +0, 28500, 192000, 0x99943a8f +0, 30000, 192000, 0x0330a728 +1, 31469, 1850, 0xb0e10e75 +0, 31500, 192000, 0x5d35467d +0, 33000, 192000, 0xfd436343 +0, 34500, 192000, 0xc323fcfe +0, 36000, 192000, 0x2a1530a0 +0, 37500, 192000, 0xbd43bb60 +1, 38961, 1480, 0x8d9baedd +0, 39000, 192000, 0xa47f5eab +0, 40500, 192000, 0xff17f5f7 +0, 42000, 192000, 0xb4140b55 +0, 43500, 192000, 0xb8782cc4 +1, 44955, 1480, 0xb802aae1 +0, 45000, 192000, 0x92975b8b +0, 46500, 192000, 0xf42a64d6 +0, 48000, 192000, 0x2cc7077d +0, 49500, 192000, 0x00080cc8 +1, 50950, 1480, 0xecd7b5cc +0, 51000, 192000, 0x584b48f3 +0, 52500, 192000, 0xd68f57da +0, 54000, 192000, 0x60158422 +0, 55500, 192000, 0xd7fb89e6 +1, 56944, 1850, 0x16861355 +0, 57000, 192000, 0x97f1c76a +0, 58500, 192000, 0x46c4bb9e +0, 60000, 192000, 0xd32f9b66 +0, 61500, 192000, 0x74f43886 +0, 63000, 192000, 0x3c4e47df +1, 64436, 1480, 0xa51690bd +0, 64500, 192000, 0xb5ac0a58 +0, 66000, 192000, 0xcc572b31 +0, 67500, 192000, 0xb1739d26 +0, 69000, 192000, 0x73da5473 +1, 70430, 1480, 0xdd0b90d1 +0, 70500, 192000, 0x5f79f5bc +0, 72000, 192000, 0x0affc0a0 +0, 73500, 192000, 0x2b4d5c1c +0, 75000, 192000, 0x309b41bc +1, 76424, 1850, 0x3ce6e333 +0, 76500, 192000, 0xd42b6424 +0, 78000, 192000, 0x4795c948 +0, 79500, 192000, 0xbc1a3a8b +0, 81000, 192000, 0x16529c5b +0, 82500, 192000, 0x6b1b31ba +1, 83917, 1480, 0xf8ce8ea3 +0, 84000, 192000, 0x569182ce +0, 85500, 192000, 0xe6ea9866 +0, 87000, 192000, 0x102c6076 +0, 88500, 192000, 0xb29f527a +1, 89911, 1480, 0xda4597af +0, 90000, 192000, 0x040b4eee +0, 91500, 192000, 0x92574f4a +0, 93000, 192000, 0x1e8acdce +0, 94500, 192000, 0x1becf516 +1, 95905, 1480, 0x918f7cb3 +0, 96000, 192000, 0xb62e9776 +0, 97500, 192000, 0xed37a08e +0, 99000, 192000, 0xc0719912 +0, 100500, 192000, 0x24cf7a7e +1, 101899, 1850, 0xca6edb15 +0, 102000, 192000, 0x0307f62f +0, 103500, 192000, 0x79b7417b +1, 109392, 1480, 0xba279597 +1, 115386, 1480, 0xc5a38a9e +1, 121380, 1850, 0x8147eef5 +1, 128872, 1480, 0xce2c7cb5 +1, 134866, 1480, 0x4282819f +1, 140860, 1480, 0xbdbb8da6 +1, 146854, 1850, 0xdbbeea10 +1, 154347, 1480, 0xbe6a77c2 +1, 160341, 1480, 0xa85c75b2 +1, 166335, 1850, 0xa45bde21 +1, 173828, 1480, 0x84aa7895 +1, 179822, 1480, 0x147f7d9f +1, 185816, 1480, 0xc8e77b85 +1, 191810, 1850, 0x10d4d81b +1, 199302, 1480, 0xb4ae8bb1 +1, 205297, 1480, 0x3ef782a5 +1, 211291, 1850, 0xdeebda14 +1, 218783, 1480, 0x4c7e7bbb +1, 224777, 1480, 0x0e0e9198 +1, 230771, 1480, 0x5c1f819f +1, 236765, 1850, 0x0e4cf6ff +1, 244258, 1480, 0x374388a7 +1, 250252, 1480, 0xed729389 +1, 256246, 1850, 0xe0f1e43f +1, 263739, 1480, 0x3b27839a +1, 269733, 1480, 0xe6287e94 +1, 275727, 1480, 0x7e0d84b5 +1, 281721, 1850, 0xf08bebf7 +1, 289213, 1480, 0x94cf73a0 +1, 295207, 1480, 0xfef384ae +1, 301202, 1850, 0x3b93e0f7 +1, 308694, 1480, 0x28d27bae +1, 314688, 1480, 0x94d57da5 +1, 320682, 1480, 0xc9327db5 +1, 326676, 1850, 0xe781f604 +1, 334169, 1480, 0x752f8c5b +1, 340163, 1480, 0x30068032 +1, 346157, 1850, 0x7895023e +1, 353650, 1480, 0xa1e0a6e1 +1, 359644, 1480, 0x6af4b500 +1, 365638, 1480, 0xc26ea4c7 +1, 371632, 1850, 0x16a72419 +1, 379124, 1480, 0x1794aacc +1, 385118, 1480, 0x2ecad8d0 +1, 391112, 1850, 0x2e645e07 +1, 398605, 1480, 0x1c54dfe7 +1, 404599, 1480, 0xbd35feec +1, 410593, 1480, 0x419403d6 +1, 416587, 1850, 0x78699d2a +1, 424080, 1480, 0x74ec68e0 +1, 430074, 1480, 0x76af64d9 +1, 436068, 1850, 0x5a303d1a +1, 443560, 1074, 0x142ce7ba +1, 447910, 1850, 0x7ff682f7 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/bfi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/bfi new file mode 100644 index 00000000..b0d853b9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/bfi @@ -0,0 +1,114 @@ +1, 0, 17768, 0x07df135c +0, 0, 134400, 0xc218b00c +0, 10000, 134400, 0x114daf7c +0, 20000, 134400, 0xe14db24c +0, 30000, 134400, 0x88c71df7 +0, 40000, 134400, 0xc98c09fc +0, 50000, 134400, 0xf7c2e7a9 +0, 60000, 134400, 0xf54f304f +0, 70000, 134400, 0x67370fdd +1, 72522, 2220, 0x44953646 +0, 80000, 134400, 0xe70f43cd +1, 81584, 2220, 0x256b3329 +0, 90000, 134400, 0xad74c06f +1, 90645, 2222, 0x344d20c6 +1, 99714, 2220, 0xd8ee20db +0, 100000, 134400, 0xef42fdf2 +1, 108776, 2222, 0x46d70aa2 +0, 110000, 134400, 0xa14cc4b8 +1, 117845, 2220, 0xbe0a2213 +0, 120000, 134400, 0xc6e57381 +1, 126906, 2222, 0x4ee0fd07 +0, 130000, 134400, 0x74b4804b +1, 135976, 2220, 0x709dfe87 +0, 140000, 134400, 0xe0863d6f +1, 145037, 2222, 0xbb382521 +0, 150000, 134400, 0x90b6d03c +1, 154106, 2220, 0x6dba1d2d +0, 160000, 134400, 0x3d0409fd +1, 163167, 2222, 0xbc4cdd6d +0, 170000, 134400, 0xc02e09a4 +1, 172237, 2220, 0x54340d2c +0, 180000, 134400, 0xa3515997 +1, 181298, 2220, 0x8925d335 +0, 190000, 134400, 0xc0fda122 +1, 190359, 2222, 0xa39bd15f +1, 199429, 2220, 0x6875f632 +0, 200000, 134400, 0x5380d707 +1, 208490, 2222, 0xda46be57 +0, 210000, 134400, 0xcc19c085 +1, 217559, 2220, 0xd591eb44 +0, 220000, 134400, 0x8041e977 +1, 226620, 2222, 0x33afd17f +0, 230000, 134400, 0xb96b2bea +1, 235690, 2220, 0xd97be03b +0, 240000, 134400, 0xcc977ca7 +1, 244751, 2222, 0x3b71e82e +0, 250000, 134400, 0xe37abb34 +1, 253820, 2220, 0x95fbec2b +0, 260000, 134400, 0xce488baa +1, 262882, 2220, 0xae3a1c1e +0, 270000, 134400, 0xa0734e8a +1, 271943, 2222, 0x46cd0973 +0, 280000, 134400, 0x6b5ce0b0 +1, 281012, 2220, 0x7b28f3f6 +0, 290000, 134400, 0xf207f938 +1, 290073, 2222, 0xa2a5bc47 +1, 299143, 2220, 0x4727df63 +0, 300000, 134400, 0xe10060f8 +1, 308204, 2222, 0xdf53f4e2 +0, 310000, 134400, 0xaebe6b37 +1, 317273, 2220, 0x469c1e8f +0, 320000, 134400, 0x08ea5c75 +1, 326335, 2222, 0x3c541799 +0, 330000, 134400, 0x05c6b514 +1, 335404, 2220, 0xc8d21fee +0, 340000, 134400, 0x68cb3703 +1, 344465, 2222, 0x5f52126f +0, 350000, 134400, 0x48867fd0 +1, 353535, 2220, 0x06a9ff18 +0, 360000, 134400, 0xc53eda30 +1, 362596, 2220, 0x84f9aa2b +0, 370000, 134400, 0x0c1b198d +1, 371657, 2222, 0xe0518c83 +0, 380000, 134400, 0xc8ac5bc8 +1, 380727, 2220, 0xc85ee26c +1, 389788, 2222, 0xda23fd2d +0, 390000, 134400, 0x9e35240d +1, 398857, 2220, 0x7ee2e818 +0, 400000, 134400, 0x885d142f +1, 407918, 2222, 0x45eb0465 +0, 410000, 134400, 0x207cb4ac +1, 416988, 2220, 0xf3e90549 +0, 420000, 134400, 0x0abe748b +1, 426049, 2222, 0x17aacf3d +0, 430000, 134400, 0xf13e991b +1, 435118, 2220, 0x6cb7e325 +0, 440000, 134400, 0x2544248d +1, 444180, 2220, 0x20164553 +0, 450000, 134400, 0x5444bb22 +1, 453241, 2222, 0x00000000 +0, 460000, 134400, 0xc5a8f55a +1, 462310, 2220, 0x00000000 +0, 470000, 134400, 0xe6006820 +1, 471371, 2222, 0x00000000 +0, 480000, 134400, 0x2a34239d +1, 480441, 2220, 0x00000000 +1, 489502, 2222, 0x00000000 +0, 490000, 134400, 0x26deac5b +1, 498571, 2220, 0x00000000 +0, 500000, 134400, 0x82c2c0a9 +1, 507633, 2222, 0x00000000 +0, 510000, 134400, 0xcdd8daba +1, 516702, 2450, 0x00000000 +0, 520000, 134400, 0x5a1a2105 +1, 526702, 2450, 0x00000000 +0, 530000, 134400, 0x2ad43604 +1, 536702, 2450, 0x00000000 +0, 540000, 134400, 0xa9b58f35 +1, 546702, 2450, 0x00000000 +0, 550000, 134400, 0x0e37a7a8 +1, 556702, 2450, 0x00000000 +0, 560000, 134400, 0xd288eef7 +1, 566702, 2450, 0x00000000 +1, 576702, 2450, 0x00000000 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/bink-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/bink-demux new file mode 100644 index 00000000..b721f0d6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/bink-demux @@ -0,0 +1 @@ +CRC=0x839f34e6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/bink-demux-video b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/bink-demux-video new file mode 100644 index 00000000..22fb3c5a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/bink-demux-video @@ -0,0 +1,20 @@ +0, 0, 460800, 0xb06f7841 +0, 6000, 460800, 0x7ed06412 +0, 12000, 460800, 0xe82b5c3d +0, 18000, 460800, 0x67284940 +0, 24000, 460800, 0x17e2c544 +0, 30000, 460800, 0x5dc65d36 +0, 36000, 460800, 0x7de63f90 +0, 42000, 460800, 0x15c8cf7d +0, 48000, 460800, 0xbffe4047 +0, 54000, 460800, 0xcabcc150 +0, 60000, 460800, 0xe8a17ebe +0, 66000, 460800, 0x27e94c03 +0, 72000, 460800, 0x71c0f48e +0, 78000, 460800, 0x5fc8f783 +0, 84000, 460800, 0xd23d336a +0, 90000, 460800, 0xa7aca9e0 +0, 96000, 460800, 0x1dff2144 +0, 102000, 460800, 0x82cf8b2b +0, 108000, 460800, 0x4cbe3544 +0, 114000, 460800, 0x7e724731 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/caf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/caf new file mode 100644 index 00000000..a400501e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/caf @@ -0,0 +1 @@ +CRC=0x5b74195c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cdgraphics b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cdgraphics new file mode 100644 index 00000000..0f9e74ee --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cdgraphics @@ -0,0 +1,299 @@ +0, 0, 194400, 0xd919c635 +0, 300, 194400, 0xd919c635 +0, 600, 194400, 0x516a1007 +0, 900, 194400, 0x516a1007 +0, 1200, 194400, 0x516a1007 +0, 1500, 194400, 0x516a1007 +0, 1800, 194400, 0x516a1007 +0, 2100, 194400, 0x516a1007 +0, 2400, 194400, 0x516a1007 +0, 2700, 194400, 0x516a1007 +0, 3000, 194400, 0x516a1007 +0, 3300, 194400, 0x516a1007 +0, 3600, 194400, 0x516a1007 +0, 3900, 194400, 0x516a1007 +0, 4200, 194400, 0x516a1007 +0, 4500, 194400, 0x516a1007 +0, 4800, 194400, 0x46ad80da +0, 5100, 194400, 0x46ad80da +0, 5400, 194400, 0x46ad80da +0, 5700, 194400, 0x46ad80da +0, 6000, 194400, 0x46ad80da +0, 6300, 194400, 0x46ad80da +0, 6600, 194400, 0x46ad80da +0, 6900, 194400, 0x46ad80da +0, 7200, 194400, 0x46ad80da +0, 7500, 194400, 0x46ad80da +0, 7800, 194400, 0x46ad80da +0, 8100, 194400, 0x46ad80da +0, 8400, 194400, 0x46ad80da +0, 8700, 194400, 0x46ad80da +0, 9000, 194400, 0x46ad80da +0, 9300, 194400, 0x46ad80da +0, 9600, 194400, 0x9392c3b9 +0, 9900, 194400, 0x9ff8cbb1 +0, 10200, 194400, 0xd015dba1 +0, 10500, 194400, 0x6a39f18b +0, 10800, 194400, 0x7b8cf983 +0, 11100, 194400, 0x07a20f7c +0, 11400, 194400, 0xa63e2962 +0, 11700, 194400, 0xa63e2962 +0, 12000, 194400, 0x2dd54447 +0, 12300, 194400, 0x90735e2d +0, 12600, 194400, 0x90735e2d +0, 12900, 194400, 0x90d98506 +0, 13200, 194400, 0xe5b08ffb +0, 13500, 194400, 0xe5b08ffb +0, 13800, 194400, 0x7a0d95f5 +0, 14100, 194400, 0xff6bacde +0, 14400, 194400, 0xff6bacde +0, 14700, 194400, 0xd998c2c8 +0, 15000, 194400, 0x3d1ddfab +0, 15300, 194400, 0x3d1ddfab +0, 15600, 194400, 0x817de4a6 +0, 15900, 194400, 0xfa3ef694 +0, 16200, 194400, 0xfa3ef694 +0, 16500, 194400, 0x0b5bfb8f +0, 16800, 194400, 0x00f62376 +0, 17100, 194400, 0x00f62376 +0, 17400, 194400, 0x2f6b2d6c +0, 17700, 194400, 0x40cb4752 +0, 18000, 194400, 0x40cb4752 +0, 18300, 194400, 0xd8456435 +0, 18600, 194400, 0x459f6a2f +0, 18900, 194400, 0x459f6a2f +0, 19200, 194400, 0x9b678910 +0, 19500, 194400, 0x8791a1f7 +0, 19800, 194400, 0x8791a1f7 +0, 20100, 194400, 0xdb4ac5d3 +0, 20400, 194400, 0xb223c8d0 +0, 20700, 194400, 0xb223c8d0 +0, 21000, 194400, 0x4a9ce7b1 +0, 21300, 194400, 0x187eeaae +0, 21600, 194400, 0x187eeaae +0, 21900, 194400, 0xc712f8a0 +0, 22200, 194400, 0x549c00a7 +0, 22500, 194400, 0x549c00a7 +0, 22800, 194400, 0x4d991295 +0, 23100, 194400, 0xc41b2681 +0, 23400, 194400, 0xc41b2681 +0, 23700, 194400, 0xed5a3077 +0, 24000, 194400, 0x85ad4463 +0, 24300, 194400, 0x85ad4463 +0, 24600, 194400, 0xb98f4760 +0, 24900, 194400, 0x87ef5e49 +0, 25200, 194400, 0x87ef5e49 +0, 25500, 194400, 0x830a6146 +0, 25800, 194400, 0xe33a792e +0, 26100, 194400, 0xe33a792e +0, 26400, 194400, 0x83517a2d +0, 26700, 194400, 0xa97e9314 +0, 27000, 194400, 0xa97e9314 +0, 27300, 194400, 0x39059611 +0, 27600, 194400, 0xbf4eb9ed +0, 27900, 194400, 0xbf4eb9ed +0, 28200, 194400, 0xe5afc4e2 +0, 28500, 194400, 0x35d4cdd9 +0, 28800, 194400, 0x35d4cdd9 +0, 29100, 194400, 0xb376e1c5 +0, 29400, 194400, 0x6128e3c3 +0, 29700, 194400, 0x6128e3c3 +0, 30000, 194400, 0x30b7f7af +0, 30300, 194400, 0xf1effaac +0, 30600, 194400, 0xf1effaac +0, 30900, 194400, 0x483914a1 +0, 31200, 194400, 0xbd48199c +0, 31500, 194400, 0xbd48199c +0, 31800, 194400, 0x382f2d88 +0, 32100, 194400, 0x5a573085 +0, 32400, 194400, 0x5a573085 +0, 32700, 194400, 0x89733580 +0, 33000, 194400, 0xd1325a5b +0, 33300, 194400, 0xd1325a5b +0, 33600, 194400, 0x655b6253 +0, 33900, 194400, 0x55146352 +0, 34200, 194400, 0x55146352 +0, 34500, 194400, 0xda527c39 +0, 34800, 194400, 0xb0cd7e37 +0, 35100, 194400, 0xb0cd7e37 +0, 35400, 194400, 0x25e7991c +0, 35700, 194400, 0x5c22a411 +0, 36000, 194400, 0x5c22a411 +0, 36300, 194400, 0x1e2abdf7 +0, 36600, 194400, 0x8308bff5 +0, 36900, 194400, 0x8308bff5 +0, 37200, 194400, 0xfdbfd6de +0, 37500, 194400, 0xd4d4d9db +0, 37800, 194400, 0xd4d4d9db +0, 38100, 194400, 0xa449fbb9 +0, 38400, 194400, 0x3dcafdb7 +0, 38700, 194400, 0x3dcafdb7 +0, 39000, 194400, 0x6f1f01c2 +0, 39300, 194400, 0xf54a1da6 +0, 39600, 194400, 0xf54a1da6 +0, 39900, 194400, 0x88d11fa4 +0, 40200, 194400, 0x59642d96 +0, 40500, 194400, 0x59642d96 +0, 40800, 194400, 0x8ba44182 +0, 41100, 194400, 0x88f56360 +0, 41400, 194400, 0x88f56360 +0, 41700, 194400, 0xfb246d56 +0, 42000, 194400, 0xad128043 +0, 42300, 194400, 0xad128043 +0, 42600, 194400, 0x3a4f8a39 +0, 42900, 194400, 0x563d9d26 +0, 43200, 194400, 0x563d9d26 +0, 43500, 194400, 0x6ff8a320 +0, 43800, 194400, 0xcdb9b70c +0, 44100, 194400, 0xcdb9b70c +0, 44400, 194400, 0x99c2bd06 +0, 44700, 194400, 0x4b47cef4 +0, 45000, 194400, 0x4b47cef4 +0, 45300, 194400, 0x10b9dce6 +0, 45600, 194400, 0xdd39f1d1 +0, 45900, 194400, 0xdd39f1d1 +0, 46200, 194400, 0xbcf104cd +0, 46500, 194400, 0x85ec17ba +0, 46800, 194400, 0x85ec17ba +0, 47100, 194400, 0x069219b8 +0, 47400, 194400, 0x84dd3899 +0, 47700, 194400, 0x84dd3899 +0, 48000, 194400, 0xacca4190 +0, 48300, 194400, 0xcf5b5d74 +0, 48600, 194400, 0xcf5b5d74 +0, 48900, 194400, 0x4b8c626f +0, 49200, 194400, 0xf0817958 +0, 49500, 194400, 0xf0817958 +0, 49800, 194400, 0xc0887e53 +0, 50100, 194400, 0x42e6854c +0, 50400, 194400, 0x42e6854c +0, 50700, 194400, 0x036c9140 +0, 51000, 194400, 0x0f21a62b +0, 51300, 194400, 0x0f21a62b +0, 51600, 194400, 0xcdaeaa27 +0, 51900, 194400, 0xe425bc15 +0, 52200, 194400, 0xe425bc15 +0, 52500, 194400, 0x8e18c20f +0, 52800, 194400, 0x767cd5fb +0, 53100, 194400, 0x767cd5fb +0, 53400, 194400, 0x554ae6ea +0, 53700, 194400, 0xeac1f9d7 +0, 54000, 194400, 0xeac1f9d7 +0, 54300, 194400, 0x0b32fed2 +0, 54600, 194400, 0xe30c19c6 +0, 54900, 194400, 0xe30c19c6 +0, 55200, 194400, 0x6a8a23bc +0, 55500, 194400, 0x26bf36a9 +0, 55800, 194400, 0x26bf36a9 +0, 56100, 194400, 0x1e4f3fa0 +0, 56400, 194400, 0x231f5986 +0, 56700, 194400, 0x231f5986 +0, 57000, 194400, 0xf557756a +0, 57300, 194400, 0x6bce805f +0, 57600, 194400, 0x6bce805f +0, 57900, 194400, 0xcd80924d +0, 58200, 194400, 0x65dc9f40 +0, 58500, 194400, 0x65dc9f40 +0, 58800, 194400, 0x2ab7af30 +0, 59100, 194400, 0xd43cb728 +0, 59400, 194400, 0xd43cb728 +0, 59700, 194400, 0x05d9c916 +0, 60000, 194400, 0x43cad10e +0, 60300, 194400, 0x43cad10e +0, 60600, 194400, 0x06b5e0fe +0, 60900, 194400, 0xa142f0ee +0, 61200, 194400, 0xa142f0ee +0, 61500, 194400, 0xed7f03ea +0, 61800, 194400, 0xf26019d4 +0, 62100, 194400, 0xf26019d4 +0, 62400, 194400, 0x3b7f29c4 +0, 62700, 194400, 0x30282ebf +0, 63000, 194400, 0x30282ebf +0, 63300, 194400, 0xaeff4aa3 +0, 63600, 194400, 0x1d355697 +0, 63900, 194400, 0x1d355697 +0, 64200, 194400, 0x2ead6f7e +0, 64500, 194400, 0xf1b67776 +0, 64800, 194400, 0xf1b67776 +0, 65100, 194400, 0x93b38b62 +0, 65400, 194400, 0x9469905d +0, 65700, 194400, 0x9469905d +0, 66000, 194400, 0x27bf9756 +0, 66300, 194400, 0xd016a548 +0, 66600, 194400, 0xd016a548 +0, 66900, 194400, 0x6889b835 +0, 67200, 194400, 0x6a05be2f +0, 67500, 194400, 0x6a05be2f +0, 67800, 194400, 0xe0a1ce1f +0, 68100, 194400, 0x8fdbd617 +0, 68400, 194400, 0x8fdbd617 +0, 68700, 194400, 0xd68fe805 +0, 69000, 194400, 0x0d1dfbf1 +0, 69300, 194400, 0x0d1dfbf1 +0, 69600, 194400, 0x0fe70bf0 +0, 69900, 194400, 0x0a8f13e8 +0, 70200, 194400, 0x0a8f13e8 +0, 70500, 194400, 0x0ca42bd0 +0, 70800, 194400, 0x6f3838c3 +0, 71100, 194400, 0x6f3838c3 +0, 71400, 194400, 0x045448b3 +0, 71700, 194400, 0x764349b2 +0, 72000, 194400, 0x764349b2 +0, 72300, 194400, 0xed1651aa +0, 72600, 194400, 0xbb376398 +0, 72900, 194400, 0xbb376398 +0, 73200, 194400, 0xd0d5718a +0, 73500, 194400, 0xcd977e7d +0, 73800, 194400, 0xcd977e7d +0, 74100, 194400, 0x8cb39665 +0, 74400, 194400, 0xb935b04b +0, 74700, 194400, 0xb935b04b +0, 75000, 194400, 0x0292be3d +0, 75300, 194400, 0x4f21c833 +0, 75600, 194400, 0x4f21c833 +0, 75900, 194400, 0xa5c7d823 +0, 76200, 194400, 0xfb8ee01b +0, 76500, 194400, 0xfb8ee01b +0, 76800, 194400, 0xea53ee0d +0, 77100, 194400, 0x803efcfe +0, 77400, 194400, 0x803efcfe +0, 77700, 194400, 0x2c0e0aff +0, 78000, 194400, 0x3df318f1 +0, 78300, 194400, 0x3df318f1 +0, 78600, 194400, 0xc4cb26e3 +0, 78900, 194400, 0x92a033d6 +0, 79200, 194400, 0x92a033d6 +0, 79500, 194400, 0x1b2048c1 +0, 79800, 194400, 0x236858b1 +0, 80100, 194400, 0x236858b1 +0, 80400, 194400, 0x482f6d9c +0, 80700, 194400, 0x9ee97891 +0, 81000, 194400, 0x9ee97891 +0, 81300, 194400, 0xe0dc8683 +0, 81600, 194400, 0x461b9079 +0, 81900, 194400, 0x461b9079 +0, 82200, 194400, 0xd346a960 +0, 82500, 194400, 0xa384b554 +0, 82800, 194400, 0xa384b554 +0, 83100, 194400, 0x3246cf3a +0, 83400, 194400, 0xa53fe722 +0, 83700, 194400, 0xa53fe722 +0, 84000, 194400, 0xe620fd0c +0, 84300, 194400, 0xd6370414 +0, 84600, 194400, 0xd6370414 +0, 84900, 194400, 0xf57f1404 +0, 85200, 194400, 0x8c6420f7 +0, 85500, 194400, 0x8c6420f7 +0, 85800, 194400, 0xd4be3add +0, 86100, 194400, 0xa8dc4ec9 +0, 86400, 194400, 0xa8dc4ec9 +0, 86700, 194400, 0xda1563b4 +0, 87000, 194400, 0xd51873a4 +0, 87300, 194400, 0xd51873a4 +0, 87600, 194400, 0x68588196 +0, 87900, 194400, 0x40d18e89 +0, 88200, 194400, 0x40d18e89 +0, 88500, 194400, 0x1b75a275 +0, 88800, 194400, 0xedd1a572 +0, 89100, 194400, 0xedd1a572 +0, 89400, 194400, 0x55daad6a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cljr b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cljr new file mode 100644 index 00000000..7221b9e4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cljr @@ -0,0 +1,36 @@ +0, 0, 64800, 0x44a1c47c +0, 3169, 64800, 0x649cc3a4 +0, 6338, 64800, 0xcab1b88c +0, 9507, 64800, 0xf56cb788 +0, 12676, 64800, 0x5336b618 +0, 15845, 64800, 0x2704b438 +0, 19013, 64800, 0x04c7b8e4 +0, 22182, 64800, 0x3185b288 +0, 25351, 64800, 0xa537c410 +0, 28520, 64800, 0x6495c0f8 +0, 31689, 64800, 0x06a1ca14 +0, 34858, 64800, 0x69cdd2a0 +0, 38027, 64800, 0x4ad2d828 +0, 41196, 64800, 0x9604dea4 +0, 44365, 64800, 0x1c00e430 +0, 47534, 64800, 0x9afeefe0 +0, 50702, 64800, 0xc13fdd78 +0, 53871, 64800, 0x8438da7c +0, 57040, 64800, 0xa0ead278 +0, 60209, 64800, 0xbeced2d8 +0, 63378, 64800, 0x85bbd7dc +0, 66547, 64800, 0xbe59ce34 +0, 69716, 64800, 0xd76ecccc +0, 72885, 64800, 0xe182b474 +0, 76054, 64800, 0x916cc394 +0, 79223, 64800, 0x7efebd14 +0, 82391, 64800, 0x8d28c9f0 +0, 85560, 64800, 0x00a1c960 +0, 88729, 64800, 0xc164c400 +0, 91898, 64800, 0xfd4dc544 +0, 95067, 64800, 0x01bfbe38 +0, 98236, 64800, 0xff11b5d0 +0, 101405, 64800, 0x4876bb20 +0, 104574, 64800, 0x756ecb04 +0, 107743, 64800, 0x3b8cd540 +0, 110912, 64800, 0x063ed444 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/corepng b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/corepng new file mode 100644 index 00000000..7b01e7ab --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/corepng @@ -0,0 +1,37 @@ +1, 0, 11026, 0x27ad637c +0, 0, 230400, 0x03e25ead +0, 6000, 230400, 0x0a520ffd +0, 12000, 230400, 0x0b11a671 +0, 18000, 230400, 0x7d3fce32 +0, 24000, 230400, 0x1edb18cc +0, 30000, 230400, 0x1d470493 +0, 36000, 230400, 0xe53ba01d +0, 42000, 230400, 0xc4df13c2 +1, 45004, 1470, 0x4af4b7a3 +0, 48000, 230400, 0x5febe6c9 +1, 51004, 1470, 0x2601fc3b +0, 54000, 230400, 0xb0de2ed9 +1, 57004, 1470, 0xd94ec488 +0, 60000, 230400, 0x4991ee21 +1, 63004, 1470, 0x5ffb6bdd +0, 66000, 230400, 0x6b367a75 +1, 69004, 1470, 0xc5fece50 +0, 72000, 230400, 0x1d406b55 +1, 75004, 1470, 0xf4988a98 +0, 78000, 230400, 0x2bbbf1d3 +1, 81004, 1470, 0xa839620f +0, 84000, 230400, 0x2a5ee265 +1, 87004, 1470, 0x800a77ff +0, 90000, 230400, 0x0ae9de8d +1, 93004, 1470, 0x8fc8a729 +0, 96000, 230400, 0x567eabf8 +1, 99004, 1470, 0x78708001 +0, 102000, 230400, 0x00260e67 +1, 105004, 1470, 0xb601958b +1, 111004, 1470, 0xb054d1d3 +1, 117004, 1470, 0xce18bb41 +1, 123004, 1470, 0x43d182f9 +1, 129004, 1470, 0xe9448449 +1, 135004, 1470, 0x175ea4b3 +1, 141004, 1470, 0xf96b0e6a +1, 147004, 1470, 0x12cc42fb diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creative-adpcm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creative-adpcm new file mode 100644 index 00000000..039ca3ab --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creative-adpcm @@ -0,0 +1 @@ +66004779a5e51ca659b21a4197e019e6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creative-adpcm-8-2.6bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creative-adpcm-8-2.6bit new file mode 100644 index 00000000..83576044 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creative-adpcm-8-2.6bit @@ -0,0 +1 @@ +dee4417597abc2db70a175d6809870e7 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creative-adpcm-8-2bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creative-adpcm-8-2bit new file mode 100644 index 00000000..4166846d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creative-adpcm-8-2bit @@ -0,0 +1 @@ +832846066fbce28821b7f0717c4d3a90 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creative-adpcm-8-4bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creative-adpcm-8-4bit new file mode 100644 index 00000000..2d579aa9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creative-adpcm-8-4bit @@ -0,0 +1 @@ +1813d196cef83f7030bb150399b2903e diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creatureshock-avs b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creatureshock-avs new file mode 100644 index 00000000..54ed2f80 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/creatureshock-avs @@ -0,0 +1,92 @@ +1, 0, 16372, 0xfaaab59d +0, 0, 188892, 0xcb5be3dd +0, 6000, 188892, 0x0f313ebc +0, 12000, 188892, 0xc0da25cc +0, 18000, 188892, 0xad6e1d44 +0, 24000, 188892, 0xb1103b40 +0, 30000, 188892, 0xae033450 +1, 33154, 4028, 0xc2daed72 +0, 36000, 188892, 0xb31f03b4 +1, 41310, 5486, 0xf7fd794d +0, 42000, 188892, 0xacb2d3f9 +0, 48000, 188892, 0x7d77ecbd +1, 52420, 5790, 0xfd5a369f +0, 54000, 188892, 0x7faa2f6c +0, 60000, 188892, 0x28f4fdf1 +1, 64145, 1068, 0x0b602cd0 +0, 66000, 188892, 0x4b53f3b9 +1, 66307, 4908, 0xfe870aad +0, 72000, 188892, 0x1f09bb29 +1, 76246, 6062, 0x8a4d6e0f +0, 78000, 188892, 0x3afcc11d +0, 84000, 188892, 0x6b918e49 +1, 88522, 5402, 0x71fd352f +0, 90000, 188892, 0x9630a04d +0, 96000, 188892, 0x9381b4c1 +1, 99461, 544, 0xeb766d34 +1, 100563, 5906, 0x47ac7e08 +0, 102000, 188892, 0xa7dea7e5 +0, 108000, 188892, 0xd277c41d +1, 112522, 5916, 0x0d26eb56 +0, 114000, 188892, 0xafa2a6c9 +0, 120000, 188892, 0x13a38839 +1, 124502, 4006, 0x9941c71a +0, 126000, 188892, 0xcd5e5a6d +0, 132000, 188892, 0xe7da71e9 +1, 132615, 2100, 0xc9a2ee36 +1, 136867, 5894, 0xd2ba4eaa +0, 138000, 188892, 0x06928add +0, 144000, 188892, 0x4a108eb9 +1, 148803, 6090, 0xf43e73d0 +0, 150000, 188892, 0xea2598f5 +0, 156000, 188892, 0x17ed6839 +1, 161135, 2288, 0x5a8b7aa0 +0, 162000, 188892, 0x9de6ab65 +1, 165768, 3850, 0x7f66eb2c +0, 168000, 188892, 0xb4ee326f +1, 173564, 5796, 0xc5cf3ee8 +0, 174000, 188892, 0x3f85095b +0, 180000, 188892, 0xaab7e331 +1, 185302, 6042, 0xed80136d +0, 186000, 188892, 0xc2a079e1 +0, 192000, 188892, 0x612080c2 +1, 197537, 684, 0xc42bd137 +0, 198000, 188892, 0xa7232d47 +1, 198922, 5436, 0xb7f8a6fd +0, 204000, 188892, 0xc053297d +1, 209930, 6098, 0xee6354a2 +0, 210000, 188892, 0x1ecc3bfe +0, 216000, 188892, 0xcc4ac803 +0, 222000, 188892, 0x4b90047b +1, 222278, 4838, 0x129e61d0 +0, 228000, 188892, 0xd863b643 +1, 232075, 1074, 0x9da90634 +0, 234000, 188892, 0x93a25fb1 +1, 234250, 6084, 0x8ffed952 +0, 240000, 188892, 0xf969e131 +0, 246000, 188892, 0x73bd2469 +1, 246571, 6038, 0xa07b4276 +0, 252000, 188892, 0x265a9ce2 +0, 258000, 188892, 0xd59ccd39 +1, 258798, 3176, 0xebef63c1 +0, 264000, 188892, 0xe50fc068 +1, 265229, 2794, 0xbe1000db +0, 270000, 188892, 0x83113a86 +1, 270887, 6020, 0xd8e34961 +0, 276000, 188892, 0xa0203504 +0, 282000, 188892, 0x9e2d518c +1, 283078, 6020, 0xc07cf461 +0, 288000, 188892, 0x5f610e66 +0, 294000, 188892, 0x9b77f900 +1, 295268, 1538, 0xc975ae02 +1, 298383, 4230, 0x0827111b +0, 300000, 188892, 0xaaf279c2 +0, 306000, 188892, 0x4ac97cc2 +1, 306949, 6084, 0x2cf0a407 +0, 312000, 188892, 0xddd91642 +0, 318000, 188892, 0x4f32dcd1 +1, 319269, 5828, 0x12750279 +0, 324000, 188892, 0xdc126b42 +0, 330000, 188892, 0x00000000 +1, 331071, 230, 0xc9c03f3b +1, 331536, 768, 0x6137a04d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cryo-apc b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cryo-apc new file mode 100644 index 00000000..16e1dd6a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cryo-apc @@ -0,0 +1 @@ +6dcee91d3364f389f804da7a25934b36 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cscd b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cscd new file mode 100644 index 00000000..75a7725c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cscd @@ -0,0 +1,208 @@ +0, 0, 270000, 0xf90015d8 +0, 2880, 270000, 0xf90015d8 +0, 5760, 270000, 0xf90015d8 +0, 8640, 270000, 0xf90015d8 +0, 11520, 270000, 0xf90015d8 +0, 14400, 270000, 0xf90015d8 +0, 17280, 270000, 0xf90015d8 +0, 20160, 270000, 0xf90015d8 +0, 23040, 270000, 0xf90015d8 +0, 25920, 270000, 0xf90015d8 +0, 28800, 270000, 0xf90015d8 +0, 31680, 270000, 0xf90015d8 +0, 34560, 270000, 0xf90015d8 +0, 37440, 270000, 0xf90015d8 +0, 40320, 270000, 0xf90015d8 +0, 43200, 270000, 0xf90015d8 +0, 46080, 270000, 0xf90015d8 +0, 48960, 270000, 0xf90015d8 +0, 51840, 270000, 0xf90015d8 +0, 54720, 270000, 0xf90015d8 +0, 57600, 270000, 0xf90015d8 +0, 60480, 270000, 0xf90015d8 +0, 63360, 270000, 0xf90015d8 +0, 66240, 270000, 0xf90015d8 +0, 69120, 270000, 0xf90015d8 +0, 72000, 270000, 0xf90015d8 +0, 74880, 270000, 0xf90015d8 +0, 77760, 270000, 0xf90015d8 +0, 80640, 270000, 0xf90015d8 +0, 83520, 270000, 0xf90015d8 +0, 86400, 270000, 0xf90015d8 +0, 89280, 270000, 0xf90015d8 +0, 92160, 270000, 0xf90015d8 +0, 95040, 270000, 0xf90015d8 +0, 97920, 270000, 0xf90015d8 +0, 100800, 270000, 0xf90015d8 +0, 103680, 270000, 0xf90015d8 +0, 106560, 270000, 0xf90015d8 +0, 109440, 270000, 0xf90015d8 +0, 112320, 270000, 0x1f9c15d8 +0, 115200, 270000, 0x436f15d8 +0, 118080, 270000, 0xe90115d8 +0, 120960, 270000, 0xe90115d8 +0, 123840, 270000, 0x8ea215d8 +0, 126720, 270000, 0x424015d8 +0, 129600, 270000, 0x0ce315d8 +0, 132480, 270000, 0x14bc15d8 +0, 135360, 270000, 0x2a9215d8 +0, 138240, 270000, 0x233f15d8 +0, 141120, 270000, 0x764b15d8 +0, 144000, 270000, 0xf76115d8 +0, 146880, 270000, 0xbbe015d8 +0, 149760, 270000, 0x95af15d8 +0, 152640, 270000, 0x324815d8 +0, 155520, 270000, 0x311915d8 +0, 158400, 270000, 0x090ef191 +0, 161280, 270000, 0xd88974dc +0, 164160, 270000, 0xfa7f58df +0, 167040, 270000, 0x78f849c3 +0, 169920, 270000, 0xae174892 +0, 172800, 270000, 0x9d4e2332 +0, 175680, 270000, 0x874b09b4 +0, 178560, 270000, 0x4069fed6 +0, 181440, 270000, 0x4069fed6 +0, 184320, 270000, 0x4069fed6 +0, 187200, 270000, 0x4069fed6 +0, 190080, 270000, 0x4069fed6 +0, 192960, 270000, 0x4069fed6 +0, 195840, 270000, 0x4069fed6 +0, 198720, 270000, 0x4069fed6 +0, 201600, 270000, 0x4069fed6 +0, 204480, 270000, 0x4069fed6 +0, 207360, 270000, 0x4069fed6 +0, 210240, 270000, 0x773db046 +0, 213120, 270000, 0x773db046 +0, 216000, 270000, 0x773db046 +0, 218880, 270000, 0x773db046 +0, 221760, 270000, 0x773db046 +0, 224640, 270000, 0x773db046 +0, 227520, 270000, 0x773db046 +0, 230400, 270000, 0x773db046 +0, 233280, 270000, 0x773db046 +0, 236160, 270000, 0x773db046 +0, 239040, 270000, 0x773db046 +0, 241920, 270000, 0x773db046 +0, 244800, 270000, 0x773db046 +0, 247680, 270000, 0x773db046 +0, 250560, 270000, 0x773db046 +0, 253440, 270000, 0x773db046 +0, 256320, 270000, 0x773db046 +0, 259200, 270000, 0x17b9aec9 +0, 262080, 270000, 0x622fad4c +0, 264960, 270000, 0xdaea3aef +0, 267840, 270000, 0x61bb10e3 +0, 270720, 270000, 0xfc37ee0c +0, 273600, 270000, 0x50dbd01e +0, 276480, 270000, 0xcd66c27c +0, 279360, 270000, 0xd13f1e4f +0, 282240, 270000, 0xa4a2dbf5 +0, 285120, 270000, 0xf302c9ab +0, 288000, 270000, 0x4479f7fe +0, 290880, 270000, 0x1afe92c8 +0, 293760, 270000, 0x3007f4c3 +0, 296640, 270000, 0x5834c096 +0, 299520, 270000, 0x40109126 +0, 302400, 270000, 0x0a7b8882 +0, 305280, 270000, 0x15b8635d +0, 308160, 270000, 0xeaa5598e +0, 311040, 270000, 0x0b7b5489 +0, 313920, 270000, 0x0b7b5489 +0, 316800, 270000, 0x0b7b5489 +0, 319680, 270000, 0x0b7b5489 +0, 322560, 270000, 0x8f0e6eaa +0, 325440, 270000, 0xc46fc0f2 +0, 328320, 270000, 0xadd7e605 +0, 331200, 270000, 0x9d23a056 +0, 334080, 270000, 0x365afa63 +0, 336960, 270000, 0x6ac3bda2 +0, 339840, 270000, 0x14f5daf2 +0, 342720, 270000, 0x4b3afb6a +0, 345600, 270000, 0x1a3302e3 +0, 348480, 270000, 0x1a3302e3 +0, 351360, 270000, 0x1a3302e3 +0, 354240, 270000, 0x1a3302e3 +0, 357120, 270000, 0xc15526e2 +0, 360000, 270000, 0x3dd73006 +0, 362880, 270000, 0x60abb5bc +0, 365760, 270000, 0xb960c27c +0, 368640, 270000, 0x8fa4c01c +0, 371520, 270000, 0x8fa4c01c +0, 374400, 270000, 0x8fa4c01c +0, 377280, 270000, 0xb20dcc38 +0, 380160, 270000, 0x03c6ad3c +0, 383040, 270000, 0xe550b194 +0, 385920, 270000, 0xe550b194 +0, 388800, 270000, 0xe550b194 +0, 391680, 270000, 0xe550b194 +0, 394560, 270000, 0xe550b194 +0, 397440, 270000, 0xe550b194 +0, 400320, 270000, 0xe550b194 +0, 403200, 270000, 0xe550b194 +0, 406080, 270000, 0xe550b194 +0, 408960, 270000, 0xe550b194 +0, 411840, 270000, 0xe550b194 +0, 414720, 270000, 0xe550b194 +0, 417600, 270000, 0xe550b194 +0, 420480, 270000, 0xe550b194 +0, 423360, 270000, 0x4550a014 +0, 426240, 270000, 0xaf639da8 +0, 429120, 270000, 0xe4229da8 +0, 432000, 270000, 0x315d9da8 +0, 434880, 270000, 0x7e899da8 +0, 437760, 270000, 0x99b9a8a0 +0, 440640, 270000, 0x4588ac2a +0, 443520, 270000, 0x1e79ae6e +0, 446400, 270000, 0xa003cb14 +0, 449280, 270000, 0x03ef1bb8 +0, 452160, 270000, 0x3b3f30fc +0, 455040, 270000, 0x4dad3525 +0, 457920, 270000, 0x5b600c12 +0, 460800, 270000, 0x75a1fab3 +0, 463680, 270000, 0xc9f7d9ad +0, 466560, 270000, 0x9eaec58d +0, 469440, 270000, 0xb91bc3e8 +0, 472320, 270000, 0x77bdbbfb +0, 475200, 270000, 0x77bdbbfb +0, 478080, 270000, 0x77bdbbfb +0, 480960, 270000, 0x77bdbbfb +0, 483840, 270000, 0x77bdbbfb +0, 486720, 270000, 0x77bdbbfb +0, 489600, 270000, 0x3d54eac2 +0, 492480, 270000, 0x3d54eac2 +0, 495360, 270000, 0x3d54eac2 +0, 498240, 270000, 0x3d54eac2 +0, 501120, 270000, 0x3d54eac2 +0, 504000, 270000, 0x3d54eac2 +0, 506880, 270000, 0x3d54eac2 +0, 509760, 270000, 0x3d54eac2 +0, 512640, 270000, 0x3d54eac2 +0, 515520, 270000, 0x3d54eac2 +0, 518400, 270000, 0x3d54eac2 +0, 521280, 270000, 0x3d54eac2 +0, 524160, 270000, 0x3d54eac2 +0, 527040, 270000, 0x3d54eac2 +0, 529920, 270000, 0x3d54eac2 +0, 532800, 270000, 0x3d54eac2 +0, 535680, 270000, 0x3d54eac2 +0, 538560, 270000, 0x3d54eac2 +0, 541440, 270000, 0x3d54eac2 +0, 544320, 270000, 0x5f3609ba +0, 547200, 270000, 0x80921b0c +0, 550080, 270000, 0x80921b0c +0, 552960, 270000, 0x80921b0c +0, 555840, 270000, 0x80921b0c +0, 558720, 270000, 0x80921b0c +0, 561600, 270000, 0x80921b0c +0, 564480, 270000, 0x80921b0c +0, 567360, 270000, 0x80921b0c +0, 570240, 270000, 0x80921b0c +0, 573120, 270000, 0x80921b0c +0, 576000, 270000, 0x80921b0c +0, 578880, 270000, 0x80921b0c +0, 581760, 270000, 0x80921b0c +0, 584640, 270000, 0x80921b0c +0, 587520, 270000, 0x80921b0c +0, 590400, 270000, 0x80921b0c +0, 593280, 270000, 0xf0e626a8 +0, 596160, 270000, 0xf0e626a8 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cvid b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cvid new file mode 100644 index 00000000..d7ebe119 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cvid @@ -0,0 +1,78 @@ +0, 0, 112400, 0x829180d8 +0, 7500, 112400, 0xdbebac5b +0, 15000, 112400, 0xc5adc0f7 +0, 22500, 112400, 0xbe1fc030 +0, 30000, 112400, 0xe08ab460 +0, 37500, 112400, 0xfde0dbc5 +0, 45000, 112400, 0xed9242b0 +0, 52500, 112400, 0x1ae3933a +0, 60000, 112400, 0xc82d2f5b +0, 67500, 112400, 0xbae9ddfc +0, 75000, 112400, 0xa350a1f7 +0, 82500, 112400, 0x3cf78029 +0, 90000, 112400, 0xaa0b82bf +0, 97500, 112400, 0x71aa4794 +0, 105000, 112400, 0x2fe57373 +0, 112500, 112400, 0x429c6f82 +0, 120000, 112400, 0xfb2d917d +0, 127500, 112400, 0xcc84cb9a +0, 135000, 112400, 0xc68f0613 +0, 142500, 112400, 0x05f30e6a +0, 150000, 112400, 0x5c5d853d +0, 157500, 112400, 0x01e0aff2 +0, 165000, 112400, 0xc3b2cf4a +0, 172500, 112400, 0xc0a3cf19 +0, 180000, 112400, 0xc743abda +0, 187500, 112400, 0x54bd17a2 +0, 195000, 112400, 0x616ef28d +0, 202500, 112400, 0x04b51f59 +0, 210000, 112400, 0x857511a2 +0, 217500, 112400, 0x25c62440 +0, 225000, 112400, 0x8c78198d +0, 232500, 112400, 0xc046c912 +0, 240000, 112400, 0x0d828630 +0, 247500, 112400, 0x48999b80 +0, 255000, 112400, 0x9a869e77 +0, 262500, 112400, 0x16d893df +0, 270000, 112400, 0xf6b86132 +0, 277500, 112400, 0xfa564ea4 +0, 285000, 112400, 0xdd473f69 +0, 292500, 112400, 0xf89625a6 +0, 300000, 112400, 0x823a58aa +0, 307500, 112400, 0x25e0fe43 +0, 315000, 112400, 0x41034522 +0, 322500, 112400, 0xb8da4f00 +0, 330000, 112400, 0x9f684fce +0, 337500, 112400, 0xf7188710 +0, 345000, 112400, 0x428fbfc6 +0, 352500, 112400, 0x535bace0 +0, 360000, 112400, 0x23216059 +0, 367500, 112400, 0x9b8bbfa6 +0, 375000, 112400, 0x932be522 +0, 382500, 112400, 0xdbd31409 +0, 390000, 112400, 0x0a69bf18 +0, 397500, 112400, 0xa15ef128 +0, 405000, 112400, 0x49a1fa92 +0, 412500, 112400, 0xadeeaf62 +0, 420000, 112400, 0xc1ce636e +0, 427500, 112400, 0x5ca544eb +0, 435000, 112400, 0x07230a36 +0, 442500, 112400, 0x12ae2b53 +0, 450000, 112400, 0x62453ef6 +0, 457500, 112400, 0xe0588a98 +0, 465000, 112400, 0xacd3927a +0, 472500, 112400, 0x5d3c6b01 +0, 480000, 112400, 0xda671808 +0, 487500, 112400, 0x61d0b492 +0, 495000, 112400, 0x068b1293 +0, 502500, 112400, 0x75b99287 +0, 510000, 112400, 0xe657e7d6 +0, 517500, 112400, 0x17873df6 +0, 525000, 112400, 0xa8db5e31 +0, 532500, 112400, 0x4f633b8e +0, 540000, 112400, 0x22266252 +0, 547500, 112400, 0x308a6282 +0, 555000, 112400, 0xfdb356ce +0, 562500, 112400, 0xe4394f1f +0, 570000, 112400, 0x8ca8649f +0, 577500, 112400, 0x804d44eb diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cvid-palette b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cvid-palette new file mode 100644 index 00000000..6f6ba112 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cvid-palette @@ -0,0 +1,56 @@ +0, 0, 57600, 0x1f5c89b7 +0, 6006, 57600, 0xd2055aaf +0, 12012, 57600, 0x22336052 +0, 18018, 57600, 0xf7135e2a +0, 24024, 57600, 0xd9de126a +0, 30030, 57600, 0xe5a9e1de +0, 36036, 57600, 0x253f1702 +0, 42042, 57600, 0xcb8679c9 +0, 48048, 57600, 0x96cb5fa8 +0, 54054, 57600, 0xbe03528a +0, 60060, 57600, 0x120a097d +0, 66066, 57600, 0xaf562041 +0, 72072, 57600, 0x15b2d8c9 +0, 78078, 57600, 0x95f60e58 +0, 84084, 57600, 0x5ace5a6b +0, 90090, 57600, 0x2f80b8e3 +0, 96096, 57600, 0x5c49c915 +0, 102102, 57600, 0xb91efe60 +0, 108108, 57600, 0xa80d29e8 +0, 114114, 57600, 0x6e72d03a +0, 120120, 57600, 0x4f716a9e +0, 126126, 57600, 0x3a43b9c9 +0, 132132, 57600, 0x65002db3 +0, 138138, 57600, 0x70edc765 +0, 144144, 57600, 0x9dc54abd +0, 150150, 57600, 0xd17bda86 +0, 156156, 57600, 0xc5d2d458 +0, 162162, 57600, 0x32313c79 +0, 168168, 57600, 0x2e537e8d +0, 174174, 57600, 0xe77d5d9e +0, 180180, 57600, 0x9cc2599a +0, 186186, 57600, 0x8a9be76e +0, 192192, 57600, 0x47447eef +0, 198198, 57600, 0xbf5f84fa +0, 204204, 57600, 0xacd49c07 +0, 210210, 57600, 0xdc628975 +0, 216216, 57600, 0x97d7964e +0, 222222, 57600, 0xd0a19b6b +0, 228228, 57600, 0x5ea3d78c +0, 234234, 57600, 0x39b59be0 +0, 240240, 57600, 0x6501a2d2 +0, 246246, 57600, 0x0ee7e36d +0, 252252, 57600, 0x354ddd1d +0, 258258, 57600, 0x9b8f22d3 +0, 264264, 57600, 0x0aadfb8c +0, 270270, 57600, 0x322e2785 +0, 276276, 57600, 0x78a6467e +0, 282282, 57600, 0x1757f3b1 +0, 288288, 57600, 0xe874ceb7 +0, 294294, 57600, 0xc40f9e4d +0, 300300, 57600, 0x89f6a735 +0, 306306, 57600, 0xe3635393 +0, 312312, 57600, 0xdae585c7 +0, 318318, 57600, 0xf99baa60 +0, 324324, 57600, 0x28a8b1ee +0, 330330, 57600, 0xcd5587f8 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cyberia-c93 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cyberia-c93 new file mode 100644 index 00000000..a0dacb76 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cyberia-c93 @@ -0,0 +1,42 @@ +0, 0, 184320, 0x8433f0f8 +1, 0, 28368, 0xaacc96a5 +0, 7200, 184320, 0xd0d480f7 +0, 14400, 184320, 0xaec85413 +0, 21600, 184320, 0x29d134dc +0, 28800, 184320, 0xeac07175 +0, 36000, 184320, 0x21426b49 +0, 43200, 184320, 0xe500a37d +0, 50400, 184320, 0x1d9cae21 +0, 57600, 184320, 0xda65309d +0, 64800, 184320, 0xb64c331d +0, 72000, 184320, 0xcb832741 +1, 79147, 28368, 0x6d1099bd +0, 79200, 184320, 0xe573b565 +0, 86400, 184320, 0xa40c92d1 +0, 93600, 184320, 0x6d04ea3f +0, 100800, 184320, 0xc438ae56 +0, 108000, 184320, 0xc6405523 +0, 115200, 184320, 0xaefef0b3 +0, 122400, 184320, 0x3e4526c6 +0, 129600, 184320, 0x2b164323 +0, 136800, 184320, 0x89b22193 +0, 144000, 184320, 0x3b73611b +0, 151200, 184320, 0x42b33583 +1, 158294, 28368, 0x93033ae1 +0, 158400, 184320, 0x43e79dff +0, 165600, 184320, 0xe389a377 +0, 172800, 184320, 0x09cb65f0 +0, 180000, 184320, 0x64b27755 +0, 187200, 184320, 0xdd25d6c6 +0, 194400, 184320, 0x082a80c9 +0, 201600, 184320, 0x41a8d7f4 +0, 208800, 184320, 0x6227d8d4 +0, 216000, 184320, 0x54975910 +0, 223200, 184320, 0xf4857db9 +0, 230400, 184320, 0x82d18161 +1, 237441, 28368, 0x9101e519 +0, 237600, 184320, 0x06d93bd0 +0, 244800, 184320, 0xa4304c00 +0, 252000, 184320, 0x5f77d9cd +0, 259200, 184320, 0x95cb84e9 +0, 266400, 184320, 0x7c979475 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cyuv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cyuv new file mode 100644 index 00000000..f7123231 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/cyuv @@ -0,0 +1,150 @@ +0, 0, 38016, 0x501e6abe +0, 3000, 38016, 0x84976f13 +0, 6000, 38016, 0x8c487acb +0, 9000, 38016, 0x70998800 +0, 12000, 38016, 0x51ac9416 +0, 15000, 38016, 0xd1da94b7 +0, 18000, 38016, 0x52d691e8 +0, 21000, 38016, 0x3ca3907a +0, 24000, 38016, 0x5f62929f +0, 27000, 38016, 0x81ec98ac +0, 30000, 38016, 0x72499f12 +0, 33000, 38016, 0x7598a716 +0, 36000, 38016, 0x38ada96f +0, 39000, 38016, 0x78c8a727 +0, 42000, 38016, 0xe2d79d2d +0, 45000, 38016, 0x84a2925a +0, 48000, 38016, 0x131b8d70 +0, 50999, 38016, 0x32a78242 +0, 53999, 38016, 0x29f583e5 +0, 56999, 38016, 0x4a7f7305 +0, 59999, 38016, 0x80885f56 +0, 62999, 38016, 0xa73c4f61 +0, 65999, 38016, 0xe54d422b +0, 68999, 38016, 0xa8c03188 +0, 71999, 38016, 0xa02a294e +0, 74999, 38016, 0xc84e2366 +0, 77999, 38016, 0xe21112ca +0, 80999, 38016, 0x3e450594 +0, 83999, 38016, 0x2499017c +0, 86999, 38016, 0xecb1effa +0, 89999, 38016, 0xa0f8eb28 +0, 92999, 38016, 0xa396e800 +0, 95999, 38016, 0xae1be010 +0, 98999, 38016, 0x4b41dff5 +0, 101999, 38016, 0x9172e319 +0, 104999, 38016, 0xb82ee262 +0, 107999, 38016, 0x151de59f +0, 110999, 38016, 0x799deabd +0, 113999, 38016, 0x008dee95 +0, 116999, 38016, 0x5ad502ce +0, 119999, 38016, 0xdeb321f1 +0, 122999, 38016, 0x82734a09 +0, 125999, 38016, 0x1ccb6ddd +0, 128999, 38016, 0x266584f0 +0, 131999, 38016, 0x46349e73 +0, 134999, 38016, 0x0b8cac83 +0, 137999, 38016, 0x7bcd9f49 +0, 140999, 38016, 0x4f5d7521 +0, 143999, 38016, 0x7709250c +0, 146999, 38016, 0xf8eef5ad +0, 149999, 38016, 0x2c5d28e3 +0, 152998, 38016, 0xdb116d69 +0, 155998, 38016, 0xb66c39d6 +0, 158998, 38016, 0xacecc966 +0, 161998, 38016, 0xaffd76af +0, 164998, 38016, 0xd2b05d04 +0, 167998, 38016, 0x4d18582a +0, 170998, 38016, 0x23635ca7 +0, 173998, 38016, 0x7ccc58f1 +0, 176998, 38016, 0xce9a4cc6 +0, 179998, 38016, 0xbeb259d3 +0, 182998, 38016, 0x0b28714c +0, 185998, 38016, 0x642a8fdd +0, 188998, 38016, 0x937bb589 +0, 191998, 38016, 0x1a48c407 +0, 194998, 38016, 0x8b44cd79 +0, 197998, 38016, 0xf35cde31 +0, 200998, 38016, 0xfc05fad9 +0, 203998, 38016, 0x44102111 +0, 206998, 38016, 0x832f5041 +0, 209998, 38016, 0x41177c71 +0, 212998, 38016, 0x723b88b5 +0, 215998, 38016, 0x05548f81 +0, 218998, 38016, 0xd9dd7995 +0, 221998, 38016, 0xed0d6226 +0, 224998, 38016, 0x458b5ce2 +0, 227998, 38016, 0xc7ef69af +0, 230998, 38016, 0x936a7022 +0, 233998, 38016, 0x7a446c3d +0, 236998, 38016, 0x9b2b73ee +0, 239998, 38016, 0xa47779cd +0, 242998, 38016, 0x7be47981 +0, 245998, 38016, 0x5d1778ac +0, 248998, 38016, 0xf1f578fc +0, 251997, 38016, 0x865b7edf +0, 254997, 38016, 0x0a208252 +0, 257997, 38016, 0x22f07570 +0, 260997, 38016, 0x93036cef +0, 263997, 38016, 0xa04b6120 +0, 266997, 38016, 0x80b249fe +0, 269997, 38016, 0x5fe5317e +0, 272997, 38016, 0x75bd0770 +0, 275997, 38016, 0x0607da6e +0, 278997, 38016, 0x11cbb3a7 +0, 281997, 38016, 0xbb8b9335 +0, 284997, 38016, 0xa2bc75d9 +0, 287997, 38016, 0x58c160dd +0, 290997, 38016, 0x742b55dc +0, 293997, 38016, 0x62b24540 +0, 296997, 38016, 0x14f4381b +0, 299997, 38016, 0x6494334d +0, 302997, 38016, 0xb3772676 +0, 305997, 38016, 0x0c312715 +0, 308997, 38016, 0x8b401fc9 +0, 311997, 38016, 0xa851125a +0, 314997, 38016, 0x3171092b +0, 317997, 38016, 0x5c3603aa +0, 320997, 38016, 0xab56fc95 +0, 323997, 38016, 0x5c76fcb5 +0, 326997, 38016, 0xbf13f3b4 +0, 329997, 38016, 0xbdb5ed1b +0, 332997, 38016, 0xb511ea7c +0, 335997, 38016, 0xec84df90 +0, 338997, 38016, 0x69aed672 +0, 341997, 38016, 0x72a6d334 +0, 344997, 38016, 0x7ec5c6a7 +0, 347997, 38016, 0x837abc3e +0, 350996, 38016, 0x5ef7be01 +0, 353996, 38016, 0x173bb950 +0, 356996, 38016, 0xf572ab31 +0, 359996, 38016, 0xe704a2d9 +0, 362996, 38016, 0x26359bb5 +0, 365996, 38016, 0x00868e2d +0, 368996, 38016, 0x72ef879e +0, 371996, 38016, 0x510b7b07 +0, 374996, 38016, 0x947876ff +0, 377996, 38016, 0x934073a7 +0, 380996, 38016, 0xf7c36a15 +0, 383996, 38016, 0xbcc86424 +0, 386996, 38016, 0x55b65fb0 +0, 389996, 38016, 0x6c4b5c4e +0, 392996, 38016, 0xb315557a +0, 395996, 38016, 0x154f503e +0, 398996, 38016, 0x7abd44da +0, 401996, 38016, 0x291940c6 +0, 404996, 38016, 0xc2264202 +0, 407996, 38016, 0xbd703e12 +0, 410996, 38016, 0x39193a9c +0, 413996, 38016, 0x086637de +0, 416996, 38016, 0x494c3be2 +0, 419996, 38016, 0x2d523e06 +0, 422996, 38016, 0x3843448a +0, 425996, 38016, 0x307f4bd3 +0, 428996, 38016, 0xee074e3f +0, 431996, 38016, 0x760d534a +0, 434996, 38016, 0xbfa251cc +0, 437996, 38016, 0x49094e22 +0, 440996, 38016, 0xda6a4f16 +0, 443996, 38016, 0xa3304fd5 +0, 446996, 38016, 0x99995068 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/d-cinema-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/d-cinema-demux new file mode 100644 index 00000000..169f54fb --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/d-cinema-demux @@ -0,0 +1,4 @@ +0, 0, 36000, 0xd592781d +0, 1875, 36000, 0xd592781d +0, 3750, 36000, 0xd592781d +0, 5625, 23056, 0xde81f0d6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/delphine-cin b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/delphine-cin new file mode 100644 index 00000000..c8894d17 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/delphine-cin @@ -0,0 +1,183 @@ +0, 0, 153600, 0x00000000 +1, 0, 176448, 0x541ddc55 +0, 7500, 153600, 0x9c77862c +0, 15000, 153600, 0xd487c33c +0, 22500, 153600, 0x5c00c01c +0, 30000, 153600, 0x5496c2a2 +0, 37500, 153600, 0x858ac5c0 +0, 45000, 153600, 0xe32fc7d9 +0, 52500, 153600, 0xabffc965 +0, 60000, 153600, 0x4171c8e7 +0, 67500, 153600, 0xaec4ca90 +0, 75000, 153600, 0x3cb4cb5d +0, 82500, 153600, 0x3aedcdc0 +0, 90000, 153600, 0x0fa4cf55 +0, 97500, 153600, 0x66a1d146 +0, 105000, 153600, 0x3828d3ad +0, 112500, 153600, 0x73ccd7a4 +0, 120000, 153600, 0xb815d983 +0, 127500, 153600, 0x11a5a54f +0, 135000, 153600, 0x337d8bff +0, 142500, 153600, 0x0a1c8e5c +0, 150000, 153600, 0x09648a57 +0, 157500, 153600, 0xf7398ba4 +0, 165000, 153600, 0x836d8aaf +0, 172500, 153600, 0x4ee385bf +0, 180000, 153600, 0xacf2c4d6 +0, 187500, 153600, 0x0610f426 +0, 195000, 153600, 0xb798e4a1 +0, 202500, 153600, 0xdaabe17e +0, 210000, 153600, 0x7b82def5 +0, 217500, 153600, 0x56afe483 +0, 225000, 153600, 0x4640acef +0, 232500, 153600, 0x4415f46c +0, 240000, 153600, 0x258d01d0 +0, 247500, 153600, 0x18a55ba1 +0, 255000, 153600, 0x165a7173 +0, 262500, 153600, 0xfa8a438b +0, 270000, 153600, 0x57083a34 +0, 277500, 153600, 0xb39923cd +0, 285000, 153600, 0x3e32fd70 +0, 292500, 153600, 0xa7e9eb7f +0, 300000, 153600, 0x8c20ed88 +0, 307500, 153600, 0x8c9bed27 +0, 315000, 153600, 0xc79af188 +0, 322500, 153600, 0x3bda00c8 +0, 330000, 153600, 0x03f837a7 +0, 337500, 153600, 0x550b83e3 +0, 345000, 153600, 0xc0bc6080 +0, 352500, 153600, 0xb8d968ed +0, 360000, 153600, 0x893e2348 +1, 360098, 3676, 0xaf455081 +0, 367500, 153600, 0x6cd01834 +1, 367600, 3676, 0x27ef4e91 +0, 375000, 153600, 0x9e6926c5 +1, 375102, 3676, 0xd1d986a3 +0, 382500, 153600, 0x4b57a4ea +1, 382604, 3676, 0xaaa2b589 +0, 390000, 153600, 0xaab2cfcd +1, 390106, 3676, 0x6e794ff9 +0, 397500, 153600, 0xffbb334d +1, 397608, 3676, 0x266351f1 +0, 405000, 153600, 0x4b37e5a9 +1, 405110, 3676, 0xdeae50b2 +0, 412500, 153600, 0x3486dee0 +1, 412612, 3676, 0x90f1f96a +0, 420000, 153600, 0xa7185454 +1, 420114, 3676, 0xea07adf9 +0, 427500, 153600, 0xec29b8c2 +1, 427616, 3676, 0xb80a8925 +0, 435000, 153600, 0x01e562ba +1, 435118, 3676, 0xc392a1da +0, 442500, 153600, 0xe695cda3 +1, 442620, 3676, 0xa076bdda +0, 450000, 153600, 0xf6b59dac +1, 450122, 3676, 0x8f40b4cc +0, 457500, 153600, 0xb308206b +1, 457624, 3676, 0x4227fe30 +0, 465000, 153600, 0xcc6ede4a +1, 465127, 3676, 0x82b31ec8 +0, 472500, 153600, 0xd9f8071c +1, 472629, 3676, 0x3ba04042 +0, 480000, 153600, 0xfb434821 +1, 480131, 3676, 0x6fe7440a +0, 487500, 153600, 0x84c97077 +1, 487633, 3676, 0x23e33177 +0, 495000, 153600, 0x82dc5217 +1, 495135, 3676, 0x1f14242c +0, 502500, 153600, 0xdbfd0ba8 +1, 502637, 3676, 0x72931fb0 +0, 510000, 153600, 0x3d71058e +1, 510139, 3676, 0x2b1351c2 +0, 517500, 153600, 0x3027b928 +1, 517641, 3676, 0x6aee7070 +0, 525000, 153600, 0x792ae3bd +1, 525143, 3676, 0x237658fa +0, 532500, 153600, 0x36db00a7 +1, 532645, 3676, 0xac001143 +0, 540000, 153600, 0x4484e720 +1, 540147, 3676, 0x1921ee21 +0, 547500, 153600, 0xfaa76cdc +1, 547649, 3676, 0x80186091 +0, 555000, 153600, 0x9f1e4c7e +1, 555151, 3676, 0xb7f37ede +0, 562500, 153600, 0x4b545d88 +1, 562653, 3676, 0x355227ef +0, 570000, 153600, 0xa11cfd15 +1, 570155, 3676, 0xb0411f35 +0, 577500, 153600, 0x9f5d49c4 +1, 577657, 3676, 0xe7c4fe0e +0, 585000, 153600, 0x7a496740 +1, 585159, 3676, 0x0425984d +0, 592500, 153600, 0x98477803 +1, 592661, 3676, 0xfd59dea1 +0, 600000, 153600, 0xa5fc20f8 +1, 600163, 3676, 0xa53d5aab +0, 607500, 153600, 0x344ff96e +1, 607665, 3676, 0x8bc403c2 +0, 615000, 153600, 0x20c91746 +1, 615167, 3676, 0x7dd638c2 +0, 622500, 153600, 0x7c59b379 +1, 622669, 3676, 0x284913eb +0, 630000, 153600, 0x38e3b86d +1, 630171, 3676, 0xec17e83c +0, 637500, 153600, 0xff25a440 +1, 637673, 3676, 0x40543463 +0, 645000, 153600, 0xa1f66533 +1, 645176, 3676, 0x92d81bf8 +0, 652500, 153600, 0xe136260a +1, 652678, 3676, 0x44ef161d +0, 660000, 153600, 0x048ccf56 +1, 660180, 3676, 0x499df3d5 +0, 667500, 153600, 0x65f68a24 +1, 667682, 3676, 0xf98f4d75 +0, 675000, 153600, 0xf32b385a +1, 675184, 3676, 0x8ffe2681 +0, 682500, 153600, 0x3e930a8f +1, 682686, 3676, 0x84093bfd +1, 690188, 3676, 0x5f9c2e32 +1, 697690, 3676, 0x8f93c29b +1, 705192, 3676, 0xf0ada687 +1, 712694, 3676, 0x30019db2 +1, 720196, 3676, 0x06ebace3 +1, 727698, 3676, 0xc293d944 +1, 735200, 3676, 0x789ff65e +1, 742702, 3676, 0xa2ae13c1 +1, 750204, 3676, 0xb64f1cd9 +1, 757706, 3676, 0x18f4e36a +1, 765208, 3676, 0xe9ccd0f0 +1, 772710, 3676, 0xc215b4ab +1, 780212, 3676, 0x45b5c410 +1, 787714, 3676, 0xf84a9939 +1, 795216, 3676, 0xc8aff71e +1, 802718, 3676, 0x76cc3afc +1, 810220, 3676, 0x524e1dd6 +1, 817722, 3676, 0x115a3f10 +1, 825224, 3676, 0xd2bb51d1 +1, 832727, 3676, 0xe1dbfca5 +1, 840229, 3676, 0xc428f070 +1, 847731, 3676, 0x6aa4dddf +1, 855233, 3676, 0xa0428f08 +1, 862735, 3676, 0x8fd7e256 +1, 870237, 3676, 0x41cb1787 +1, 877739, 3676, 0xe348568e +1, 885241, 3676, 0x79091a0c +1, 892743, 3676, 0x592f6f2e +1, 900245, 3676, 0xa151448f +1, 907747, 3676, 0xb3402e7a +1, 915249, 3676, 0x74112e27 +1, 922751, 3676, 0xba090659 +1, 930253, 3676, 0xa0451f81 +1, 937755, 3676, 0x09c7393a +1, 945257, 3676, 0xceb4e340 +1, 952759, 3676, 0x0440291a +1, 960261, 3676, 0xb7b930c4 +1, 967763, 3676, 0x1a2afa4a +1, 975265, 3676, 0x414fee56 +1, 982767, 3676, 0x5e26bc97 +1, 990269, 3676, 0x780e0481 +1, 997771, 3676, 0xb6dfb9c5 +1, 1005273, 3676, 0x447b36ca +1, 1012776, 3676, 0x601c3067 +1, 1020278, 3676, 0x199f2f8d +1, 1027780, 3676, 0x98645b08 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/deluxepaint-anm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/deluxepaint-anm new file mode 100644 index 00000000..2a606066 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/deluxepaint-anm @@ -0,0 +1,155 @@ +0, 0, 192000, 0x82a79641 +0, 3000, 192000, 0x43079971 +0, 6000, 192000, 0x6311f1e5 +0, 9000, 192000, 0x9e1ef4dc +0, 12000, 192000, 0x6f81049b +0, 15000, 192000, 0xe696fb12 +0, 18000, 192000, 0x1ef4d160 +0, 21000, 192000, 0x2f1bf0d4 +0, 24000, 192000, 0xcfed92da +0, 27000, 192000, 0xbd409978 +0, 30000, 192000, 0x50f76f07 +0, 33000, 192000, 0xc8d52062 +0, 36000, 192000, 0x75061d0e +0, 39000, 192000, 0x01b2a711 +0, 42000, 192000, 0x541ca739 +0, 45000, 192000, 0xe931ad85 +0, 48000, 192000, 0xb7e4d4a5 +0, 51000, 192000, 0xfc20d475 +0, 54000, 192000, 0x7a5eefe5 +0, 57000, 192000, 0x95a3ef97 +0, 60000, 192000, 0x021d7f69 +0, 63000, 192000, 0x108e7ed9 +0, 66000, 192000, 0x021d7f69 +0, 69000, 192000, 0x681817d8 +0, 72000, 192000, 0x653e19d2 +0, 75000, 192000, 0x56d9b14a +0, 78000, 192000, 0x82240846 +0, 81000, 192000, 0xa2e90840 +0, 84000, 192000, 0x8e031416 +0, 87000, 192000, 0xe23813a6 +0, 90000, 192000, 0xb2451aa1 +0, 93000, 192000, 0x92eec7d2 +0, 96000, 192000, 0x6400c80e +0, 99000, 192000, 0x24f01fce +0, 102000, 192000, 0x7c1b201c +0, 105000, 192000, 0xe2c878a1 +0, 108000, 192000, 0xf6006739 +0, 111000, 192000, 0x726b6677 +0, 114000, 192000, 0xca61a01d +0, 117000, 192000, 0x87e49f69 +0, 120000, 192000, 0x57120bd4 +0, 123000, 192000, 0x50171c4b +0, 126000, 192000, 0x8ace1c49 +0, 129000, 192000, 0x83082a8c +0, 132000, 192000, 0x6e092b58 +0, 135000, 192000, 0x207a9af4 +0, 138000, 192000, 0xedf193f0 +0, 141000, 192000, 0x531793f0 +0, 144000, 192000, 0x24e2a406 +0, 147000, 192000, 0x6c34a1e5 +0, 150000, 192000, 0x8e7acdae +0, 153000, 192000, 0x1f941805 +0, 156000, 192000, 0x0c391218 +0, 159000, 192000, 0xf25aa1fd +0, 162000, 192000, 0xcb2aa40e +0, 165000, 192000, 0x69701e49 +0, 168000, 192000, 0x0dd719d3 +0, 171000, 192000, 0x5ef71955 +0, 174000, 192000, 0xac2063ca +0, 177000, 192000, 0xce7d601c +0, 180000, 192000, 0x43003946 +0, 183000, 192000, 0xa72a38ee +0, 186000, 192000, 0x98023933 +0, 189000, 192000, 0xa72a38ee +0, 192000, 192000, 0x98023933 +0, 195000, 192000, 0xa72a38ee +0, 198000, 192000, 0x98023933 +0, 201000, 192000, 0xa72a38ee +0, 204000, 192000, 0xdd7f371d +0, 207000, 192000, 0xeed134c6 +0, 210000, 192000, 0x362931f5 +0, 213000, 192000, 0x362931f5 +0, 216000, 192000, 0x362931f5 +0, 219000, 192000, 0x362931f5 +0, 222000, 192000, 0x362931f5 +0, 225000, 192000, 0x362931f5 +0, 228000, 192000, 0x362931f5 +0, 231000, 192000, 0x362931f5 +0, 234000, 192000, 0x362931f5 +0, 237000, 192000, 0x362931f5 +0, 240000, 192000, 0x362931f5 +0, 243000, 192000, 0x362931f5 +0, 246000, 192000, 0x362931f5 +0, 249000, 192000, 0x362931f5 +0, 252000, 192000, 0x362931f5 +0, 255000, 192000, 0x362931f5 +0, 258000, 192000, 0x362931f5 +0, 261000, 192000, 0x362931f5 +0, 264000, 192000, 0x362931f5 +0, 267000, 192000, 0x362931f5 +0, 270000, 192000, 0x362931f5 +0, 273000, 192000, 0x362931f5 +0, 276000, 192000, 0x362931f5 +0, 279000, 192000, 0x362931f5 +0, 282000, 192000, 0x362931f5 +0, 285000, 192000, 0x362931f5 +0, 288000, 192000, 0x362931f5 +0, 291000, 192000, 0x362931f5 +0, 294000, 192000, 0x362931f5 +0, 297000, 192000, 0x362931f5 +0, 300000, 192000, 0x362931f5 +0, 303000, 192000, 0x362931f5 +0, 306000, 192000, 0x362931f5 +0, 309000, 192000, 0xfb41331d +0, 312000, 192000, 0x087433f8 +0, 315000, 192000, 0xf36b34a6 +0, 318000, 192000, 0x652a33cd +0, 321000, 192000, 0x652a33cd +0, 324000, 192000, 0xe50c336a +0, 327000, 192000, 0x652a33cd +0, 330000, 192000, 0xeed134c6 +0, 333000, 192000, 0x652a33cd +0, 336000, 192000, 0x5d7633e5 +0, 339000, 192000, 0x845233b5 +0, 342000, 192000, 0x9d1c349b +0, 345000, 192000, 0x25843317 +0, 348000, 192000, 0xc84b375c +0, 351000, 192000, 0xaf2b3410 +0, 354000, 192000, 0xaf2b3410 +0, 357000, 192000, 0x26d23594 +0, 360000, 192000, 0xaf2b3410 +0, 363000, 192000, 0x26d23594 +0, 366000, 192000, 0xaf2b3410 +0, 369000, 192000, 0x72c4dfb9 +0, 372000, 192000, 0x3c72e390 +0, 375000, 192000, 0xb4466634 +0, 378000, 192000, 0x84f064f5 +0, 381000, 192000, 0xad43f3f5 +0, 384000, 192000, 0xa8644d57 +0, 387000, 192000, 0xfac35238 +0, 390000, 192000, 0xe9374d1e +0, 393000, 192000, 0x0bd14cfa +0, 396000, 192000, 0x7e51a437 +0, 399000, 192000, 0x92678dfa +0, 402000, 192000, 0x43338d41 +0, 405000, 192000, 0x00000000 +0, 408000, 192000, 0x00000000 +0, 411000, 192000, 0x00000000 +0, 414000, 192000, 0x00000000 +0, 417000, 192000, 0x00000000 +0, 420000, 192000, 0x00000000 +0, 423000, 192000, 0x00000000 +0, 426000, 192000, 0x00000000 +0, 429000, 192000, 0x00000000 +0, 432000, 192000, 0x00000000 +0, 435000, 192000, 0x00000000 +0, 438000, 192000, 0x00000000 +0, 441000, 192000, 0x00000000 +0, 444000, 192000, 0x00000000 +0, 447000, 192000, 0x00000000 +0, 450000, 192000, 0x00000000 +0, 453000, 192000, 0x00000000 +0, 456000, 192000, 0x00000000 +0, 459000, 192000, 0x00000000 +0, 462000, 192000, 0x82a79641 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/dpx b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/dpx new file mode 100644 index 00000000..9260977c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/dpx @@ -0,0 +1 @@ +0, 0, 2359296, 0x30d4d24f diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/duck-dk3 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/duck-dk3 new file mode 100644 index 00000000..08c0fd19 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/duck-dk3 @@ -0,0 +1 @@ +62fbe4db4a49cb044f57f92cce9993c5 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/duck-dk4 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/duck-dk4 new file mode 100644 index 00000000..d47ef207 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/duck-dk4 @@ -0,0 +1 @@ +5234b53dde4961dd715a2524d6a8eb75 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/duck-tm2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/duck-tm2 new file mode 100644 index 00000000..e7c4ee47 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/duck-tm2 @@ -0,0 +1,30 @@ +0, 0, 230400, 0x135cb509 +0, 6000, 230400, 0x919a1ab7 +0, 12000, 230400, 0x0af8722b +0, 18000, 230400, 0xc9616809 +0, 24000, 230400, 0xe16ecaf7 +0, 30000, 230400, 0xa86f8d1b +0, 36000, 230400, 0xd351b5a4 +0, 42000, 230400, 0xd112b5b7 +0, 48000, 230400, 0xc9c3c9b1 +0, 54000, 230400, 0x4f91e572 +0, 60000, 230400, 0xb1d8c4d3 +0, 66000, 230400, 0x34de10c1 +0, 72000, 230400, 0xbd4f3b29 +0, 78000, 230400, 0xfeaf1477 +0, 84000, 230400, 0x718ffa17 +0, 90000, 230400, 0x23b46ef3 +0, 96000, 230400, 0x6346d9b8 +0, 102000, 230400, 0xdb66bf57 +0, 108000, 230400, 0xeb74a2ff +0, 114000, 230400, 0xe0750470 +0, 120000, 230400, 0x645eb109 +0, 126000, 230400, 0xbb96489a +0, 132000, 230400, 0x58a70e35 +0, 138000, 230400, 0xc7563441 +0, 144000, 230400, 0x6098f07e +0, 150000, 230400, 0x579ece15 +0, 156000, 230400, 0xe1ca8d03 +0, 162000, 230400, 0x8928cf34 +0, 168000, 230400, 0xf621620e +0, 174000, 230400, 0x98a344ea diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/dxa-scummvm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/dxa-scummvm new file mode 100644 index 00000000..79bc1d04 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/dxa-scummvm @@ -0,0 +1,12 @@ +0, 0, 384000, 0xef37f34b +0, 7500, 384000, 0xef37f34b +0, 14999, 384000, 0xfca3cd8b +0, 22499, 384000, 0xfca3cd8b +0, 29999, 384000, 0x6dd34bb7 +0, 37499, 384000, 0x6dd34bb7 +0, 44998, 384000, 0xfd518717 +0, 52498, 384000, 0xfd518717 +0, 59998, 384000, 0x82db5c7b +0, 67497, 384000, 0x82db5c7b +0, 74997, 384000, 0xe280a5a6 +0, 82497, 384000, 0xe280a5a6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-cdata b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-cdata new file mode 100644 index 00000000..cbfc1f52 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-cdata @@ -0,0 +1 @@ +db441b7f9c8767ee675002763cd3ae46 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-cmv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-cmv new file mode 100644 index 00000000..36d88898 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-cmv @@ -0,0 +1,194 @@ +0, 0, 120000, 0x34ac91d2 +0, 9000, 120000, 0x17150729 +0, 18000, 120000, 0xc3f510bb +0, 27000, 120000, 0xb3b14a3b +0, 36000, 120000, 0x26a7f3d1 +0, 45000, 120000, 0xd161af6f +0, 54000, 120000, 0x459fc92d +0, 63000, 120000, 0x05c3fa94 +0, 72000, 120000, 0x6630cd8c +0, 81000, 120000, 0x60cd39d4 +0, 90000, 120000, 0xc8854d1c +0, 99000, 120000, 0xe55e8e6d +0, 108000, 120000, 0xbeab201f +0, 117000, 120000, 0x70744b0b +0, 126000, 120000, 0x80dea5d0 +0, 135000, 120000, 0x769bfa1c +0, 144000, 120000, 0x04e25bbe +0, 153000, 120000, 0x48abc5a5 +0, 162000, 120000, 0xda5c4e2a +0, 171000, 120000, 0x8de96d38 +0, 180000, 120000, 0xe96418b0 +0, 189000, 120000, 0x1c2f272b +0, 198000, 120000, 0x4b755804 +0, 207000, 120000, 0xc92f96fd +0, 216000, 120000, 0x69e90ebb +0, 225000, 120000, 0x78d4bd1a +0, 234000, 120000, 0xaf2edf55 +0, 243000, 120000, 0x94161c78 +0, 252000, 120000, 0x1109094d +0, 261000, 120000, 0xc61b0392 +0, 270000, 120000, 0xc157d003 +0, 279000, 120000, 0xf2747e7b +0, 288000, 120000, 0xa36299c2 +0, 297000, 120000, 0x49bc788c +0, 306000, 120000, 0x3bee336e +0, 315000, 120000, 0xa316b9d1 +0, 324000, 120000, 0x5cc32e9c +0, 333000, 120000, 0x9f7eca16 +0, 342000, 120000, 0x958e2988 +0, 351000, 120000, 0xebcba2f1 +0, 360000, 120000, 0x281f1e60 +0, 369000, 120000, 0x82256c4d +0, 378000, 120000, 0xddc8be56 +0, 387000, 120000, 0x64ff2ed0 +0, 396000, 120000, 0x3e63ab02 +0, 405000, 120000, 0x43f78b37 +0, 414000, 120000, 0xb7cc62d4 +0, 423000, 120000, 0x694f1764 +0, 432000, 120000, 0x2264c483 +0, 441000, 120000, 0xb6680b4a +0, 450000, 120000, 0x2a92626a +0, 459000, 120000, 0x8da02509 +0, 468000, 120000, 0xa976c382 +0, 477000, 120000, 0x749e822b +0, 486000, 120000, 0xe9e7fc8c +0, 495000, 120000, 0xfdc05a0c +0, 504000, 120000, 0x7d5a856d +0, 513000, 120000, 0xcc344937 +0, 522000, 120000, 0x9d90bc67 +0, 531000, 120000, 0x3f527712 +0, 540000, 120000, 0xf0f57f97 +0, 549000, 120000, 0xc29535cd +0, 558000, 120000, 0x9a64598b +0, 567000, 120000, 0x0d1ddf7c +0, 576000, 120000, 0xb580ec24 +0, 585000, 120000, 0xf0db5bbc +0, 594000, 120000, 0x6b980b61 +0, 603000, 120000, 0xc29f30b5 +0, 612000, 120000, 0xaf2c4bcd +0, 621000, 120000, 0x1e725645 +0, 630000, 120000, 0x295c4c96 +0, 639000, 120000, 0x7ea121a2 +0, 648000, 120000, 0xdb9e9cec +0, 657000, 120000, 0x1da47c80 +0, 666000, 120000, 0x9d0c1345 +0, 675000, 120000, 0x88058527 +0, 684000, 120000, 0x46766aed +0, 693000, 120000, 0xba520bd3 +0, 702000, 120000, 0x7fb6373c +0, 711000, 120000, 0x05a86f4d +0, 720000, 120000, 0x7fb47cbd +0, 729000, 120000, 0x6814d8ca +0, 738000, 120000, 0x9c13acb8 +0, 747000, 120000, 0xad0edbfe +0, 756000, 120000, 0x352fde81 +0, 765000, 120000, 0xa654b386 +0, 774000, 120000, 0xd3b3dc72 +0, 783000, 120000, 0x01572668 +0, 792000, 120000, 0x30189e03 +0, 801000, 120000, 0x26126d30 +0, 810000, 120000, 0x4f376c7d +0, 819000, 120000, 0xd3667bcf +0, 828000, 120000, 0x0b46b3d5 +0, 837000, 120000, 0x893415ef +0, 846000, 120000, 0x99a78749 +0, 855000, 120000, 0x6da0d8e9 +0, 864000, 120000, 0x22d8ceb6 +0, 873000, 120000, 0x67ef9be8 +0, 882000, 120000, 0xb696fb53 +0, 891000, 120000, 0x70339dab +0, 900000, 120000, 0xc1876efa +0, 909000, 120000, 0x80e78c92 +0, 918000, 120000, 0x18d2f2ac +0, 927000, 120000, 0x28be9ae4 +0, 936000, 120000, 0xc3c2c190 +0, 945000, 120000, 0xd6a859d8 +0, 954000, 120000, 0x40b9046d +0, 963000, 120000, 0x7f8d5999 +0, 972000, 120000, 0x89724027 +0, 981000, 120000, 0x4c15c988 +0, 990000, 120000, 0x812ebe08 +0, 999000, 120000, 0x273ef8e2 +0, 1008000, 120000, 0xe029de06 +0, 1017000, 120000, 0x5846127c +0, 1026000, 120000, 0x6c5df8e3 +0, 1035000, 120000, 0x7424919f +0, 1044000, 120000, 0xa8313015 +0, 1053000, 120000, 0x28878ab4 +0, 1062000, 120000, 0x126d0746 +0, 1071000, 120000, 0xee3f7138 +0, 1080000, 120000, 0xd4b2e0a1 +0, 1089000, 120000, 0x8d60bfff +0, 1098000, 120000, 0x701c23d0 +0, 1107000, 120000, 0x1cbb5654 +0, 1116000, 120000, 0x0f5853e9 +0, 1125000, 120000, 0x2a5c3339 +0, 1134000, 120000, 0x86b00350 +0, 1143000, 120000, 0xe8cc6931 +0, 1152000, 120000, 0xf1cad983 +0, 1161000, 120000, 0xabcd8704 +0, 1170000, 120000, 0x89592f94 +0, 1179000, 120000, 0x100486d9 +0, 1188000, 120000, 0x60ef9e2d +0, 1197000, 120000, 0x2485176a +0, 1206000, 120000, 0x6b8c360d +0, 1215000, 120000, 0xe2e1bf4f +0, 1224000, 120000, 0xe17b65c3 +0, 1233000, 120000, 0x2a42821a +0, 1242000, 120000, 0xbe9ddba7 +0, 1251000, 120000, 0x19f937fe +0, 1260000, 120000, 0xb7e0c600 +0, 1269000, 120000, 0xfbf8c5f6 +0, 1278000, 120000, 0x93b62f93 +0, 1287000, 120000, 0xb6ddec93 +0, 1296000, 120000, 0xa04d031b +0, 1305000, 120000, 0x61c986c0 +0, 1314000, 120000, 0x3516e54a +0, 1323000, 120000, 0x3489eb2c +0, 1332000, 120000, 0xb75a4827 +0, 1341000, 120000, 0x76031a80 +0, 1350000, 120000, 0x867c3969 +0, 1359000, 120000, 0x9b63a093 +0, 1368000, 120000, 0xcb253d8a +0, 1377000, 120000, 0x354ba3b2 +0, 1386000, 120000, 0x4d5ead8c +0, 1395000, 120000, 0x7b7029ae +0, 1404000, 120000, 0x4765ab9d +0, 1413000, 120000, 0x747cdee9 +0, 1422000, 120000, 0x20989b08 +0, 1431000, 120000, 0x3a957085 +0, 1440000, 120000, 0xdd49e8ad +0, 1449000, 120000, 0x00e89719 +0, 1458000, 120000, 0x2822aa76 +0, 1467000, 120000, 0x492388f3 +0, 1476000, 120000, 0x4dffa6ee +0, 1485000, 120000, 0xc382bb83 +0, 1494000, 120000, 0xb59aaa74 +0, 1503000, 120000, 0x7c7885d3 +0, 1512000, 120000, 0xc05ee219 +0, 1521000, 120000, 0xc3df6b73 +0, 1530000, 120000, 0x8ae31170 +0, 1539000, 120000, 0xb979fdce +0, 1548000, 120000, 0xb8f9e407 +0, 1557000, 120000, 0x56675b80 +0, 1566000, 120000, 0x1aad1ce2 +0, 1575000, 120000, 0xa050a52b +0, 1584000, 120000, 0x49f8c32f +0, 1593000, 120000, 0x8e7f4d2c +0, 1602000, 120000, 0x5c07f751 +0, 1611000, 120000, 0x67fa5523 +0, 1620000, 120000, 0xf38b933a +0, 1629000, 120000, 0xb113e202 +0, 1638000, 120000, 0xb8d99ff4 +0, 1647000, 120000, 0x15ab6cc6 +0, 1656000, 120000, 0xd64a51c9 +0, 1665000, 120000, 0x2088b53c +0, 1674000, 120000, 0xdd78d40a +0, 1683000, 120000, 0x2fb58848 +0, 1692000, 120000, 0xf775d36a +0, 1701000, 120000, 0xa03987e9 +0, 1710000, 120000, 0x457322ad +0, 1719000, 120000, 0x0f6c3d1c +0, 1728000, 120000, 0xbdf2f1a5 +0, 1737000, 120000, 0x5828ee1d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-dct b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-dct new file mode 100644 index 00000000..98a28170 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-dct @@ -0,0 +1,267 @@ +0, 0, 102144, 0x6edc83de +1, 0, 5936, 0xea261a29 +0, 6000, 102144, 0xd0534fda +1, 6057, 5824, 0x253df061 +0, 12000, 102144, 0x6447911f +1, 12000, 5936, 0x603a5bd7 +0, 18000, 102144, 0xf21f3b46 +1, 18057, 5824, 0x9d283f59 +0, 24000, 102144, 0x0975077a +1, 24000, 5936, 0x49323497 +0, 30000, 102144, 0xb9a12d8e +1, 30057, 5824, 0x7c299939 +0, 36000, 102144, 0x17413513 +1, 36000, 5936, 0x9f918e9a +0, 42000, 102144, 0x1e622a04 +1, 42057, 5824, 0x1226b534 +0, 48000, 102144, 0x7489224e +1, 48000, 5936, 0xdd159326 +0, 54000, 102144, 0xae14956e +1, 54057, 5824, 0x361ad10f +0, 60000, 102144, 0x104fd3a0 +1, 60000, 5936, 0x6ccac9e3 +0, 66000, 102144, 0xea63a940 +1, 66057, 5824, 0x1861efef +0, 72000, 102144, 0x0cf81588 +1, 72000, 5936, 0x5f718eb9 +0, 78000, 102144, 0xe4a5b2fd +1, 78057, 5824, 0xd4ca72ba +0, 84000, 102144, 0x0c9aaf77 +1, 84000, 5936, 0xbf2b27e6 +0, 90000, 102144, 0x065007d7 +1, 90057, 5824, 0xcb6f024e +0, 96000, 102144, 0x54c0c29b +1, 96000, 5936, 0x7dfb7e05 +0, 102000, 102144, 0x1114cb8e +1, 102057, 5824, 0x80e16f13 +0, 108000, 102144, 0xe4270462 +1, 108000, 5936, 0x0fb59227 +0, 114000, 102144, 0x61e5b7fd +1, 114057, 5824, 0x4d6f1fdb +0, 120000, 102144, 0x7cbeaca6 +1, 120000, 5936, 0x505a5103 +0, 126000, 102144, 0xed92daa4 +1, 126057, 5824, 0x47ef4c13 +0, 132000, 102144, 0xd8654d0d +1, 132000, 5936, 0xbe4795fb +0, 138000, 102144, 0x854e842b +1, 138057, 5824, 0xb82cc4ff +0, 144000, 102144, 0x56407c3a +1, 144000, 5936, 0xf7c6ab8d +0, 150000, 102144, 0x17db3f90 +1, 150057, 5824, 0x1442f5e0 +0, 156000, 102144, 0x8b133b9a +1, 156000, 5936, 0x64659389 +0, 162000, 102144, 0xe4899db9 +1, 162057, 5824, 0xdd81725c +0, 168000, 102144, 0x579cf092 +1, 168000, 5936, 0x7f7c604f +0, 174000, 102144, 0x19fa5062 +1, 174057, 5824, 0xafc77beb +0, 180000, 102144, 0x71339792 +1, 180000, 5936, 0x24f88e4d +0, 186000, 102144, 0x970e5c0c +1, 186057, 5824, 0xa31956ca +0, 192000, 102144, 0x84ee616a +1, 192000, 5936, 0x958e02b9 +0, 198000, 102144, 0x1d6f9a23 +1, 198057, 5824, 0xcfc79890 +0, 204000, 102144, 0xc28e19db +1, 204000, 5936, 0xc7e788ae +0, 210000, 102144, 0x0e898967 +1, 210057, 5824, 0x4b6b1acc +0, 216000, 102144, 0x52a8b671 +1, 216000, 5936, 0xa74496dc +0, 222000, 102144, 0x3f45ea83 +1, 222057, 5824, 0x719e6171 +0, 228000, 102144, 0x7b0fc603 +1, 228000, 5936, 0x9346222d +0, 234000, 102144, 0x14f94469 +1, 234057, 5824, 0x9e2a876e +0, 240000, 102144, 0x5b9f37cc +1, 240000, 5936, 0xeca6ea64 +0, 246000, 102144, 0xf902b7c7 +1, 246057, 5824, 0x07d8174f +0, 252000, 102144, 0x326836e0 +1, 252000, 5936, 0x2df5aa6b +0, 258000, 102144, 0x2e4aebba +1, 258057, 5824, 0x314e7034 +0, 264000, 102144, 0xd10ae58c +1, 264000, 5936, 0x5a328768 +0, 270000, 102144, 0xbd084ecf +1, 270057, 5824, 0x32b92446 +0, 276000, 102144, 0xb2157c0a +1, 276000, 5936, 0x20ecbc9b +0, 282000, 102144, 0xd7f158d4 +1, 282057, 5824, 0x76019c14 +0, 288000, 102144, 0x3cf86462 +1, 288000, 5936, 0x8c3ef8a6 +0, 294000, 102144, 0x53ecddab +1, 294057, 5824, 0xcdaab50b +0, 300000, 102144, 0xcdaba8ef +1, 300000, 5936, 0xb2f87f4f +0, 306000, 102144, 0xab9ede18 +1, 306057, 5824, 0x70c26379 +0, 312000, 102144, 0xb6706e79 +1, 312000, 5936, 0x5691ecfd +0, 318000, 102144, 0x76371069 +1, 318057, 5824, 0x61e208fe +0, 324000, 102144, 0x3a365016 +1, 324000, 5936, 0x87d1a5e0 +0, 330000, 102144, 0x52177c09 +1, 330057, 5824, 0x02054cfd +0, 336000, 102144, 0xc33eb4fb +1, 336000, 5936, 0x22ff1c4b +0, 342000, 102144, 0x16098436 +1, 342057, 5824, 0xc6d87fef +0, 348000, 102144, 0x715d6a2b +1, 348000, 5936, 0x9028bb3b +0, 354000, 102144, 0xd3abc960 +1, 354057, 5824, 0xbadde406 +0, 360000, 102144, 0x7f34b0d4 +1, 360000, 5936, 0x6e88ddf1 +0, 366000, 102144, 0xe3219b9c +1, 366057, 5824, 0x5bb8be6e +0, 372000, 102144, 0x5fa54f54 +1, 372000, 5936, 0xe1f8d7fc +0, 378000, 102144, 0x0fb746cb +1, 378057, 5824, 0xc824e388 +0, 384000, 102144, 0xa6bd2da2 +1, 384000, 5936, 0x654371a9 +0, 390000, 102144, 0x04579119 +1, 390057, 5824, 0xae6ee9ec +0, 396000, 102144, 0xda818691 +1, 396000, 5936, 0x9aa4550d +0, 402000, 102144, 0xe9d44445 +1, 402057, 5824, 0xdce210ac +0, 408000, 102144, 0x94868dc9 +1, 408000, 5936, 0xb12641c8 +0, 414000, 102144, 0x3ca52ce6 +1, 414057, 5824, 0x277e014b +0, 420000, 102144, 0xd7eb4c4f +1, 420000, 5936, 0xb0d262de +0, 426000, 102144, 0xfcdfafca +1, 426057, 5824, 0xf94d6f49 +0, 432000, 102144, 0x473a4a5a +1, 432000, 5936, 0x3d7848cb +0, 438000, 102144, 0xe5a5f3cb +1, 438057, 5824, 0xe67fc08e +0, 444000, 102144, 0x34070219 +1, 444000, 5936, 0x0475e0d6 +0, 450000, 102144, 0x0faa965a +1, 450057, 5824, 0x8a9a4a2e +0, 456000, 102144, 0xe2c6acda +1, 456000, 5936, 0x82576204 +0, 462000, 102144, 0xe22776d5 +1, 462057, 5824, 0x3017b648 +0, 468000, 102144, 0x80d85602 +1, 468000, 5936, 0xca4c3e04 +0, 474000, 102144, 0x2f3fa190 +1, 474057, 5824, 0x340077d1 +0, 480000, 102144, 0x70b461b1 +1, 480000, 5936, 0x805bea6e +0, 486000, 102144, 0x366c8b27 +1, 486057, 5824, 0x2cf6c87b +0, 492000, 102144, 0x65cc0866 +1, 492000, 5936, 0x3635bc5f +0, 498000, 102144, 0x903beb14 +1, 498057, 5824, 0x0d7a81c7 +0, 504000, 102144, 0xb6c5f5c7 +1, 504000, 5936, 0x26179764 +0, 510000, 102144, 0xaa813725 +1, 510057, 5824, 0xa0b2454f +0, 516000, 102144, 0x014a84a0 +1, 516000, 5936, 0x91d24608 +0, 522000, 102144, 0xd286ece1 +1, 522057, 5824, 0x6509b3e1 +0, 528000, 102144, 0x48b1c27d +1, 528000, 5936, 0xa0e3c9fc +0, 534000, 102144, 0xa611ef42 +1, 534057, 5824, 0x18682a2f +0, 540000, 102144, 0x98627584 +1, 540000, 5936, 0x89cea4ff +0, 546000, 102144, 0x43de7c75 +1, 546057, 5824, 0x7dd22b85 +0, 552000, 102144, 0xa9e22c68 +1, 552000, 5936, 0x8b2eeb8d +0, 558000, 102144, 0x84ac34d4 +1, 558057, 5824, 0x0c21af82 +0, 564000, 102144, 0x6abd00ba +1, 564000, 5936, 0x9c5a748d +0, 570000, 102144, 0x5d11066e +1, 570057, 5824, 0x1dc72c5c +0, 576000, 102144, 0xb6b083aa +1, 576000, 5936, 0xe6129383 +0, 582000, 102144, 0x5d152a11 +1, 582057, 5824, 0x0a44312a +0, 588000, 102144, 0x0c0aec67 +1, 588000, 5936, 0x7ed30640 +0, 594000, 102144, 0xa248bd10 +1, 594057, 5824, 0xede15f25 +0, 600000, 102144, 0x4e6c12cc +1, 600000, 5936, 0x0096d0f3 +0, 606000, 102144, 0xca1d6753 +1, 606057, 5824, 0x13764b4b +0, 612000, 102144, 0x116310c3 +1, 612000, 5936, 0xd4608756 +0, 618000, 102144, 0x16903cd0 +1, 618057, 5824, 0x254b5f2a +0, 624000, 102144, 0x239adfed +1, 624000, 5936, 0x7705b830 +0, 630000, 102144, 0x0970ce49 +1, 630057, 5824, 0x64a63d78 +0, 636000, 102144, 0xb628adc1 +1, 636000, 5936, 0xc02d81a6 +0, 642000, 102144, 0x473613f7 +1, 642057, 5824, 0xd239e55e +0, 648000, 102144, 0x3eef3987 +1, 648000, 5936, 0x8018cd3a +0, 654000, 102144, 0x935b99ca +1, 654057, 5824, 0xf86b8a98 +0, 660000, 102144, 0xb9f4d6ee +1, 660000, 5936, 0x2a0078bc +0, 666000, 102144, 0xac811656 +1, 666057, 5824, 0x058d4e1b +0, 672000, 102144, 0xd1f84af0 +1, 672000, 5936, 0xbc718309 +0, 678000, 102144, 0xf2fd25f4 +1, 678057, 5824, 0xaf6c29e5 +0, 684000, 102144, 0x935bbed9 +1, 684000, 5936, 0x80df004d +0, 690000, 102144, 0x8c8c3e53 +1, 690057, 5824, 0xeca5aa57 +0, 696000, 102144, 0x24afc20f +1, 696000, 5936, 0xb793a8f8 +0, 702000, 102144, 0xad20a451 +1, 702057, 5824, 0x70fa6aff +0, 708000, 102144, 0xd1a0df13 +1, 708000, 5936, 0xda8d4cc6 +0, 714000, 102144, 0xb0ee53f8 +1, 714057, 5824, 0xa70088eb +0, 720000, 102144, 0x08cdb591 +1, 720000, 5936, 0x1c0b0aab +0, 726000, 102144, 0x89b985b0 +1, 726057, 5824, 0x234d2436 +0, 732000, 102144, 0xdd27d51f +1, 732000, 5936, 0xf79d731e +0, 738000, 102144, 0xa783fce0 +1, 738057, 5824, 0x5a4e454a +0, 744000, 102144, 0xfe5602e8 +1, 744000, 5936, 0xccf6d042 +0, 750000, 102144, 0xfb989934 +1, 750057, 5824, 0x4e524d14 +0, 756000, 102144, 0xf857eb2b +1, 756000, 5936, 0xf8f2fcc3 +0, 762000, 102144, 0x987a7098 +1, 762057, 5824, 0x08f12491 +0, 768000, 102144, 0xbc749f42 +1, 768000, 5936, 0x506e0a42 +0, 774000, 102144, 0x221e48a6 +1, 774057, 5824, 0x7cf05049 +0, 780000, 102144, 0x4c4b5da2 +1, 780000, 5936, 0xdeb9d295 +0, 786000, 102144, 0x32140027 +1, 786057, 5824, 0x758ef642 +0, 792000, 102144, 0xbeb4bf18 +1, 792000, 5936, 0x91903980 +0, 798000, 102144, 0x523012e5 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-mad-adpcm-ea-r1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-mad-adpcm-ea-r1 new file mode 100644 index 00000000..b75de55f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-mad-adpcm-ea-r1 @@ -0,0 +1,191 @@ +0, 0, 535680, 0x889c32cf +1, 0, 6496, 0x00000000 +0, 2970, 535680, 0x0b1ef044 +1, 3045, 6384, 0x00000000 +0, 5940, 535680, 0xa7d0818b +1, 6038, 6384, 0x00000000 +0, 8910, 535680, 0xf392e4e1 +1, 9030, 6384, 0x00000000 +0, 11880, 535680, 0x08480c69 +1, 12023, 6384, 0x00000000 +0, 14850, 535680, 0x2b8af1ed +1, 15015, 6496, 0xe2034d04 +0, 17820, 535680, 0x0d58e062 +1, 18060, 6384, 0x089c9157 +0, 20790, 535680, 0xd140ced0 +1, 21053, 6384, 0xeed5743c +0, 23760, 535680, 0xbd0e6652 +1, 24045, 6384, 0x71de6b34 +0, 26730, 535680, 0xdc2f2a6b +1, 27038, 6384, 0xc0d67710 +0, 29700, 535680, 0x97c31a38 +1, 30030, 6496, 0x35786490 +0, 32670, 535680, 0x1a2bdf38 +1, 33075, 6384, 0xdf1c99a2 +0, 35640, 535680, 0xb3af3ac4 +1, 36068, 6384, 0xca9591ad +0, 38610, 535680, 0x07a52577 +1, 39060, 6384, 0x6f0d9c3d +0, 41580, 535680, 0x78407368 +1, 42053, 6384, 0xfacbbaee +0, 44550, 535680, 0xd2a9efc3 +1, 45045, 6496, 0x927fb136 +0, 47520, 535680, 0x36df2f29 +1, 48090, 6384, 0x9d4f2572 +0, 50490, 535680, 0x9821d8f7 +1, 51083, 6384, 0x2a3c6d08 +0, 53460, 535680, 0xf64321aa +1, 54075, 6384, 0x4282b1e0 +0, 56430, 535680, 0x53e4d9aa +1, 57068, 6384, 0xc4a77b9f +0, 59400, 535680, 0xdbd6f853 +1, 60060, 6496, 0x2af6a14f +0, 62370, 535680, 0x5d40cf8b +1, 63105, 6384, 0x4d734169 +0, 65340, 535680, 0xe624af9d +1, 66098, 6384, 0xb91b5865 +0, 68310, 535680, 0xd9dbb4cd +1, 69090, 6384, 0x9dce2417 +0, 71280, 535680, 0xf14e72ec +1, 72083, 6384, 0xb7c4e1ce +0, 74250, 535680, 0xb35c18f6 +1, 75075, 6496, 0xef0dc07a +0, 77220, 535680, 0xc96d7757 +1, 78120, 6384, 0x4ad21d10 +0, 80190, 535680, 0xdfb937df +1, 81113, 6384, 0xcfe14682 +0, 83160, 535680, 0x40cd71d7 +1, 84105, 6384, 0x07be48eb +0, 86130, 535680, 0x15e176d6 +1, 87098, 6384, 0x09de3498 +0, 89100, 535680, 0x7f891b24 +1, 90090, 6496, 0xab2e9686 +0, 92070, 535680, 0xb87a8c32 +1, 93135, 6384, 0x3aba3ccc +0, 95040, 535680, 0x0c01541f +1, 96128, 6384, 0x0a905ec3 +0, 98010, 535680, 0x9eee99b3 +1, 99120, 6384, 0x76a93ce4 +0, 100980, 535680, 0xd65eb689 +1, 102113, 6384, 0xa99063a4 +0, 103950, 535680, 0x6e733cfa +1, 105105, 6496, 0xc16bb88d +0, 106920, 535680, 0xac536670 +1, 108150, 6384, 0x650379bf +0, 109890, 535680, 0x002275b8 +1, 111143, 6384, 0x4e0749fe +0, 112860, 535680, 0x6a5385cb +1, 114135, 6384, 0x778e8d12 +0, 115830, 535680, 0xd129ade3 +1, 117128, 6384, 0x9fa8c494 +0, 118800, 535680, 0x32cab5d7 +1, 120120, 6496, 0x61d5bead +0, 121770, 535680, 0x08be1c8f +1, 123165, 6384, 0x4da9bc3c +0, 124740, 535680, 0x59e1fba0 +1, 126158, 6384, 0xa72b6f93 +0, 127710, 535680, 0x138aee3a +1, 129150, 6384, 0x811f5f77 +0, 130680, 535680, 0x4cfbcd5e +1, 132143, 6384, 0x83ea5e3d +0, 133650, 535680, 0xf6cf0fb4 +1, 135135, 6496, 0x78bab460 +0, 136620, 535680, 0xb13a06de +1, 138180, 6384, 0xc9a07432 +0, 139590, 535680, 0x59176f00 +1, 141173, 6384, 0x4b4f2a34 +0, 142560, 535680, 0xf84b4ca3 +1, 144165, 6384, 0x4d707a53 +0, 145530, 535680, 0x7fd09f73 +1, 147158, 6384, 0x703efb60 +0, 148500, 535680, 0x3be383b8 +1, 150150, 6496, 0x319a77bb +0, 151470, 535680, 0xa7118e51 +1, 153195, 6384, 0xbdfd82ec +0, 154440, 535680, 0xbd83120c +1, 156188, 6384, 0x413c3503 +0, 157410, 535680, 0x3bc9d256 +1, 159180, 6384, 0xe6e666b3 +0, 160380, 535680, 0xb6c87f87 +1, 162173, 6384, 0xa09c7342 +0, 163350, 535680, 0xe80d110a +1, 165165, 6496, 0x60cba846 +0, 166320, 535680, 0xb3a83362 +1, 168210, 6384, 0x0ba34308 +0, 169290, 535680, 0xfb39eb52 +1, 171203, 6384, 0xdc3a65f0 +0, 172260, 535680, 0xbf6e1220 +1, 174195, 6384, 0x1ebf9dc4 +0, 175230, 535680, 0x9ecdfbae +1, 177188, 6384, 0xbbcb1449 +0, 178200, 535680, 0x069a65f5 +1, 180180, 6496, 0x926574eb +0, 181170, 535680, 0x206e372c +1, 183225, 6384, 0xb4da92f1 +0, 184140, 535680, 0x58c83dd4 +1, 186218, 6384, 0xdbbd21e0 +0, 187110, 535680, 0xc3562b03 +1, 189210, 6384, 0x08510eff +0, 190080, 535680, 0xd1ed85a0 +1, 192203, 6384, 0x9534b7ca +0, 193050, 535680, 0xb6205f4b +1, 195195, 6496, 0x50a5ed30 +0, 196020, 535680, 0xaedf8bfa +1, 198240, 6384, 0xf5ac2f7c +0, 198990, 535680, 0xa48d5dea +1, 201233, 6384, 0x4fe1fa55 +0, 201960, 535680, 0xff82e7c1 +1, 204225, 6384, 0xd61c4c05 +0, 204930, 535680, 0xc9560222 +1, 207218, 6384, 0x56d11b45 +0, 207900, 535680, 0x0fafa549 +1, 210210, 6496, 0x3906084b +0, 210870, 535680, 0x8d556ccb +1, 213255, 6384, 0x1ef31fed +0, 213840, 535680, 0x802aac1f +1, 216248, 6384, 0x58ed82f5 +0, 216810, 535680, 0x7d0fa168 +1, 219240, 6384, 0xb31ccd1f +0, 219780, 535680, 0x1a9255c9 +1, 222233, 6384, 0xfb648285 +0, 222750, 535680, 0xb4ec7e35 +1, 225225, 6496, 0xfae2950b +0, 225720, 535680, 0x48fac072 +1, 228270, 6384, 0xe28c8357 +0, 228690, 535680, 0x1e260135 +1, 231263, 6384, 0xda718e60 +0, 231660, 535680, 0xce4d5079 +1, 234255, 6384, 0x27516999 +0, 234630, 535680, 0x13e5e4ed +1, 237248, 6384, 0x0ba07921 +0, 237600, 535680, 0x592305ec +1, 240240, 6496, 0xcfbecfab +0, 240570, 535680, 0x9e227508 +1, 243285, 6384, 0xae4cedcd +0, 243540, 535680, 0x1d37e5ea +1, 246278, 6384, 0x917b4707 +0, 246510, 535680, 0x7eae7692 +1, 249270, 6384, 0x8671b28e +0, 249480, 535680, 0xf452e4b9 +1, 252263, 6384, 0x9a1238fa +0, 252450, 535680, 0x1460e7e9 +1, 255255, 6496, 0x23b8f8ca +0, 255420, 535680, 0xc6d8a638 +1, 258300, 6384, 0x3903bcd6 +0, 258390, 535680, 0x854f5fb0 +1, 261293, 6384, 0x0532b267 +0, 261360, 535680, 0x854f5fb0 +1, 264285, 6384, 0xde931220 +0, 264330, 535680, 0x70a02d87 +1, 267278, 6384, 0x4ed70a80 +0, 267300, 535680, 0x9a4ad464 +0, 270270, 535680, 0x9a4ad464 +1, 270270, 6496, 0x4a52d5a1 +0, 273240, 535680, 0x9a4ad464 +1, 273315, 6384, 0xc1be5760 +0, 276210, 535680, 0x9a4ad464 +1, 276308, 6384, 0x790d69ba +0, 279180, 535680, 0x9a4ad464 +1, 279300, 6384, 0x9d73e6cf +0, 282150, 535680, 0x9a4ad464 +1, 282293, 6272, 0xbc0fc725 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-mad-pcm-planar b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-mad-pcm-planar new file mode 100644 index 00000000..dc47354f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-mad-pcm-planar @@ -0,0 +1,292 @@ +0, 0, 196608, 0x75d22292 +1, 0, 5884, 0x00000000 +0, 2970, 196608, 0x75d22292 +1, 3002, 5884, 0x00000000 +0, 5940, 196608, 0x75d22292 +1, 6004, 5888, 0x00000000 +0, 8910, 196608, 0x75d22292 +1, 9008, 5884, 0x00000000 +0, 11880, 196608, 0x75d22292 +1, 12010, 5888, 0x00000000 +0, 14850, 196608, 0x75d22292 +1, 15014, 5884, 0x00000000 +0, 17820, 196608, 0x75d22292 +1, 18016, 5888, 0x00000000 +0, 20790, 196608, 0x75d22292 +1, 21020, 5884, 0x00000000 +0, 23760, 196608, 0x75d22292 +1, 24022, 5888, 0x00000000 +0, 26730, 196608, 0xd3f66981 +1, 27027, 5884, 0x00000000 +0, 29700, 196608, 0xed37c4c3 +1, 30029, 5888, 0x174b2bd4 +0, 32670, 196608, 0x6ce01dc4 +1, 33033, 5884, 0xfab9563d +0, 35640, 196608, 0x2874fc9a +1, 36035, 5888, 0x0129a4f5 +0, 38610, 196608, 0x9b65bbc8 +1, 39039, 5884, 0xf12b15dd +0, 41580, 196608, 0x8f9af811 +1, 42041, 5888, 0x60c8c922 +0, 44550, 196608, 0x04aeb0b0 +1, 45045, 5884, 0x85693c81 +0, 47520, 196608, 0x0df037a1 +1, 48047, 5888, 0xcefcf0e0 +0, 50490, 196608, 0xa32c5515 +1, 51051, 5884, 0x243974ff +0, 53460, 196608, 0xf3b11a1b +1, 54053, 5884, 0x9101b901 +0, 56430, 196608, 0xaf945190 +1, 57055, 5888, 0xe3c68cb9 +0, 59400, 196608, 0xabee8b24 +1, 60059, 5884, 0x80f2ff5f +0, 62370, 196608, 0x1d7b3df0 +1, 63061, 5888, 0xfc2d19dc +0, 65340, 196608, 0x1347d787 +1, 66065, 5884, 0xb6e0af21 +0, 68310, 196608, 0x654c4a9b +1, 69067, 5888, 0x476e74ff +0, 71280, 196608, 0xa2a6596a +1, 72071, 5884, 0x3921bc7f +0, 74250, 196608, 0x50d04d8e +1, 75073, 5888, 0x44180a3f +0, 77220, 196608, 0x4f9f9352 +1, 78078, 5884, 0x01b5a119 +0, 80190, 196608, 0xbb358281 +1, 81080, 5888, 0xdd7ad621 +0, 83160, 196608, 0xcd91a50a +1, 84084, 5884, 0xadabe898 +0, 86130, 196608, 0xb665bb76 +1, 87086, 5888, 0x2141ff8e +0, 89100, 196608, 0xec924ee7 +1, 90090, 5884, 0xfb5118fb +0, 92070, 196608, 0x9c4aa4ad +1, 93092, 5888, 0x06d31461 +0, 95040, 196608, 0x27ccdf86 +1, 96096, 5884, 0x80ce34c1 +0, 98010, 196608, 0x93778cc8 +1, 99098, 5888, 0x72bf392f +0, 100980, 196608, 0x3d68e826 +1, 102102, 5884, 0x9d9237cf +0, 103950, 196608, 0x9240b751 +1, 105104, 5884, 0xf5c9ce23 +0, 106920, 196608, 0xd77ec46b +1, 108106, 5888, 0x12a05dc5 +0, 109890, 196608, 0x4a303ef1 +1, 111110, 5884, 0xd3ed5d4b +0, 112860, 196608, 0x2508bacf +1, 114112, 5888, 0x06557401 +0, 115830, 196608, 0xb74cb5bf +1, 117116, 5884, 0x53d81662 +0, 118800, 196608, 0x9c4a9719 +1, 120118, 5888, 0xd7e0d98d +0, 121770, 196608, 0xc34a7924 +1, 123122, 5884, 0xdf00752e +0, 124740, 196608, 0x9d8428bd +1, 126124, 5888, 0x82f1d7a9 +0, 127710, 196608, 0x019eebf7 +1, 129129, 5884, 0x9cb3aba9 +0, 130680, 196608, 0x36e58d6b +1, 132131, 5888, 0xd6f98e91 +0, 133650, 196608, 0xc7038ceb +1, 135135, 5884, 0xaa7f7c09 +0, 136620, 196608, 0xb041fd50 +1, 138137, 5888, 0xb97a82a7 +0, 139590, 196608, 0x76934674 +1, 141141, 5884, 0x375a3d53 +0, 142560, 196608, 0x22afa88b +1, 144143, 5888, 0xa0a460cb +0, 145530, 196608, 0x22158960 +1, 147147, 5884, 0xe05efbab +0, 148500, 196608, 0x75ab0895 +1, 150149, 5888, 0x95e151f0 +0, 151470, 196608, 0xcaab6c6d +1, 153153, 5884, 0x44ac688d +0, 154440, 196608, 0xe64d8b91 +1, 156155, 5884, 0xfc6d929f +0, 157410, 196608, 0x1e8aa17a +1, 159157, 5888, 0x6406c5f1 +0, 160380, 196608, 0x7dd94fdb +1, 162161, 5884, 0x4ee9e48c +0, 163350, 196608, 0xab74566c +1, 165163, 5888, 0xd55d43d0 +0, 166320, 196608, 0xec962966 +1, 168167, 5884, 0xcae69baf +0, 169290, 196608, 0xf5bfd751 +1, 171169, 5888, 0x4c01f1f5 +0, 172260, 196608, 0xc7f46e0e +1, 174173, 5884, 0xf7d6dab6 +0, 175230, 196608, 0xe641f676 +1, 177176, 5888, 0x1affdeb5 +0, 178200, 196608, 0xea7c7b75 +1, 180180, 5884, 0x6db72487 +0, 181170, 196608, 0x69120371 +1, 183182, 5888, 0x4f344e49 +0, 184140, 196608, 0xb2319175 +1, 186186, 5884, 0x2df3827b +0, 187110, 196608, 0xd2d73b56 +1, 189188, 5888, 0x1d1fc283 +0, 190080, 196608, 0x74aafac0 +1, 192192, 5884, 0x22eb1dd5 +0, 193050, 196608, 0x15e8ddbc +1, 195194, 5888, 0x734e7093 +0, 196020, 196608, 0xd4e2c90c +1, 198198, 5884, 0x357c9531 +0, 198990, 196608, 0x86eaf31c +1, 201200, 5888, 0x108c102d +0, 201960, 196608, 0x8004291b +1, 204204, 5884, 0x96ad26c6 +0, 204930, 196608, 0xbbf6954a +1, 207206, 5888, 0x7bea1996 +0, 207900, 196608, 0x2f24f0e1 +1, 210210, 5884, 0x124a1f8e +0, 210870, 196608, 0x59d56dfb +1, 213212, 5884, 0x08d272fb +0, 213840, 196608, 0x1377c9cb +1, 216214, 5888, 0x88832c6b +0, 216810, 196608, 0x07582cc3 +1, 219218, 5884, 0xedf41493 +0, 219780, 196608, 0xa5a853fc +1, 222220, 5888, 0xc4f226d7 +0, 222750, 196608, 0x3b01856a +1, 225224, 5884, 0x97730397 +0, 225720, 196608, 0x64927496 +1, 228227, 5888, 0xbc3540e9 +0, 228690, 196608, 0xf24c6f8a +1, 231231, 5884, 0x8adfa135 +0, 231660, 196608, 0xc92c3c46 +1, 234233, 5888, 0x6d4be121 +0, 234630, 196608, 0xa50d07fb +1, 237237, 5884, 0xc3daea85 +0, 237600, 196608, 0xb1d4a092 +1, 240239, 5888, 0x5498e9f0 +0, 240570, 196608, 0x20c5526b +1, 243243, 5884, 0xa0eb691f +0, 243540, 196608, 0x6127fbbd +1, 246245, 5888, 0x775c7c59 +0, 246510, 196608, 0xc168a747 +1, 249249, 5884, 0x9f108fd1 +0, 249480, 196608, 0x9c0d3241 +1, 252251, 5888, 0x72d53062 +0, 252450, 196608, 0x5466dd21 +1, 255255, 5884, 0x13a93faa +0, 255420, 196608, 0x5bba67cc +1, 258257, 5888, 0x64773c8e +0, 258390, 196608, 0x4c1a1c18 +1, 261261, 5884, 0xaf696999 +0, 261360, 196608, 0x22c0a537 +1, 264263, 5884, 0xf45e7e81 +0, 264330, 196608, 0x4ffc5ea6 +1, 267265, 5888, 0x00000000 +0, 267300, 196608, 0x7e8e2395 +1, 270269, 5884, 0x00000000 +0, 270270, 196608, 0xa3b6f198 +0, 273240, 196608, 0xf6aac4d1 +1, 273271, 5888, 0x00000000 +0, 276210, 196608, 0x1a6ea9ee +1, 276276, 5884, 0x00000000 +0, 279180, 196608, 0xfd729443 +1, 279278, 5888, 0x00000000 +0, 282150, 196608, 0xc6a69012 +1, 282282, 5884, 0x00000000 +0, 285120, 196608, 0x576f9270 +1, 285284, 5888, 0x00000000 +0, 288090, 196608, 0x0d539fe5 +1, 288288, 5884, 0x00000000 +0, 291060, 196608, 0x191db7d6 +1, 291290, 5888, 0x00000000 +0, 294030, 196608, 0x80cddedd +1, 294294, 5884, 0x00000000 +0, 297000, 196608, 0xccf5fd39 +1, 297296, 5888, 0x00000000 +0, 299970, 196608, 0x521d33b6 +1, 300300, 5884, 0x00000000 +0, 302940, 196608, 0xb75e59ee +1, 303302, 5888, 0x00000000 +0, 305910, 196608, 0xbba68972 +1, 306306, 5884, 0x00000000 +0, 308880, 196608, 0x368fb86a +1, 309308, 5888, 0x00000000 +0, 311850, 196608, 0x99e6e94a +1, 312312, 5884, 0x00000000 +0, 314820, 196608, 0xe4021296 +1, 315314, 5884, 0x00000000 +0, 317790, 196608, 0xbc993b10 +1, 318316, 5888, 0x00000000 +0, 320760, 196608, 0xf2765d22 +1, 321320, 5884, 0x00000000 +0, 323730, 196608, 0xc6257db5 +1, 324322, 5888, 0x00000000 +0, 326700, 196608, 0xa832782f +1, 327327, 5884, 0x00000000 +0, 329670, 196608, 0xa832782f +1, 330329, 5888, 0x00000000 +0, 332640, 196608, 0xa832782f +1, 333333, 5884, 0x00000000 +0, 335610, 196608, 0xa832782f +1, 336335, 5888, 0x00000000 +0, 338580, 196608, 0xa832782f +1, 339339, 5884, 0x00000000 +0, 341550, 196608, 0xa832782f +1, 342341, 5888, 0x00000000 +0, 344520, 196608, 0xa832782f +1, 345345, 5884, 0x00000000 +0, 347490, 196608, 0xa832782f +1, 348347, 5888, 0x00000000 +0, 350460, 196608, 0xa832782f +1, 351351, 5884, 0xfe4b2bd4 +0, 353430, 196608, 0xa832782f +1, 354353, 5888, 0x00000000 +0, 356400, 196608, 0xa832782f +1, 357357, 5884, 0x00000000 +0, 359370, 196608, 0xa832782f +1, 360359, 5888, 0x00000000 +0, 362340, 196608, 0xa832782f +1, 363363, 5884, 0x00000000 +0, 365310, 196608, 0xa832782f +1, 366365, 5884, 0x00000000 +0, 368280, 196608, 0xa832782f +1, 369367, 5888, 0x00000000 +0, 371250, 196608, 0xa832782f +1, 372371, 5884, 0x00000000 +0, 374220, 196608, 0xa832782f +1, 375373, 5888, 0x00000000 +0, 377190, 196608, 0xa832782f +1, 378378, 5884, 0x00000000 +0, 380160, 196608, 0xa832782f +1, 381380, 5888, 0x00000000 +0, 383130, 196608, 0xa832782f +1, 384384, 5884, 0x00000000 +0, 386100, 196608, 0xa832782f +1, 387386, 5888, 0x00000000 +0, 389070, 196608, 0xa832782f +1, 390390, 5884, 0x00000000 +0, 392040, 196608, 0xa832782f +1, 393392, 5888, 0x00000000 +0, 395010, 196608, 0xa832782f +1, 396396, 5884, 0x00000000 +0, 397980, 196608, 0xa832782f +1, 399398, 5888, 0x00000000 +0, 400950, 196608, 0xa832782f +1, 402402, 5884, 0x00000000 +0, 403920, 196608, 0xa832782f +1, 405404, 5888, 0x00000000 +0, 406890, 196608, 0xa832782f +1, 408408, 5884, 0x00000000 +0, 409860, 196608, 0xa832782f +1, 411410, 5888, 0x00000000 +0, 412830, 196608, 0xa832782f +1, 414414, 5884, 0x00000000 +0, 415800, 196608, 0xa832782f +1, 417416, 5888, 0x00000000 +0, 418770, 196608, 0xa832782f +1, 420420, 5884, 0x00000000 +0, 421740, 196608, 0xa832782f +1, 423422, 5048, 0x00000000 +0, 424710, 196608, 0xa832782f +0, 427680, 196608, 0xa832782f +0, 430650, 196608, 0xa832782f +0, 433620, 196608, 0xa832782f +0, 436590, 196608, 0xa832782f +0, 439560, 196608, 0xa832782f +0, 442530, 196608, 0xa832782f diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-tgq b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-tgq new file mode 100644 index 00000000..993c08ea --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-tgq @@ -0,0 +1,278 @@ +0, 0, 34944, 0xe33671a4 +0, 6000, 34944, 0xe33671a4 +0, 12000, 34944, 0xe33671a4 +0, 18000, 34944, 0xe33671a4 +0, 24000, 34944, 0xe33671a4 +0, 30000, 34944, 0xe33671a4 +0, 36000, 34944, 0xe33671a4 +0, 42000, 34944, 0xe33671a4 +0, 48000, 34944, 0xe33671a4 +0, 54000, 34944, 0xe33671a4 +0, 60000, 34944, 0xe33671a4 +0, 66000, 34944, 0xe33671a4 +0, 72000, 34944, 0xe33671a4 +0, 78000, 34944, 0xe33671a4 +0, 84000, 34944, 0xe33671a4 +0, 90000, 34944, 0x63196b41 +0, 96000, 34944, 0x308d6f10 +0, 102000, 34944, 0x86026ced +0, 108000, 34944, 0xaa6a6bc9 +0, 114000, 34944, 0x58276ee3 +0, 120000, 34944, 0x402d70c2 +0, 126000, 34944, 0x948d74bf +0, 132000, 34944, 0x3d31759c +0, 138000, 34944, 0x638c734e +0, 144000, 34944, 0xe218768a +0, 150000, 34944, 0xed6678ff +0, 156000, 34944, 0x381b7dda +0, 162000, 34944, 0x216680e7 +0, 168000, 34944, 0xaca5810f +0, 174000, 34944, 0xf70b81eb +0, 180000, 34944, 0x3675858b +0, 186000, 34944, 0xa51188c3 +0, 192000, 34944, 0x3a848bf1 +0, 198000, 34944, 0x67608d4d +0, 204000, 34944, 0xafe49165 +0, 210000, 34944, 0x7e8a94a7 +0, 216000, 34944, 0x3b889432 +0, 222000, 34944, 0x97e89623 +0, 228000, 34944, 0x07819793 +0, 234000, 34944, 0xdac39b87 +0, 240000, 34944, 0x4d8c9d93 +0, 246000, 34944, 0xcf009fa7 +0, 252000, 34944, 0x2f109f6e +0, 258000, 34944, 0xcedda4eb +0, 264000, 34944, 0xfe89a6df +0, 270000, 34944, 0x195ea7a9 +0, 276000, 34944, 0x9287ab92 +0, 282000, 34944, 0x6d21af54 +0, 288000, 34944, 0xd627b28b +0, 294000, 34944, 0x3ad5b6fd +0, 300000, 34944, 0x5101b64d +0, 306000, 34944, 0xb968b8ca +0, 312000, 34944, 0xa105b74a +0, 318000, 34944, 0xc056bdd6 +0, 324000, 34944, 0xec7fc1d9 +0, 330000, 34944, 0x92c3c3e0 +0, 336000, 34944, 0x9bffc45c +0, 342000, 34944, 0x5aabca4b +0, 348000, 34944, 0xcbdacb26 +0, 354000, 34944, 0xed6cce3f +0, 360000, 34944, 0xcc61cfb8 +0, 366000, 34944, 0x7a97d427 +0, 372000, 34944, 0x7cdbd5ec +0, 378000, 34944, 0x5851d9c4 +0, 384000, 34944, 0x69d5dd1d +0, 390000, 34944, 0xdf30dcf4 +0, 396000, 34944, 0x2359e084 +0, 402000, 34944, 0xe0bae491 +0, 408000, 34944, 0xa716e4fd +0, 414000, 34944, 0xe48aeaf4 +0, 420000, 34944, 0x0a0deb21 +0, 426000, 34944, 0xe8a56e12 +0, 432000, 34944, 0x0d72c98e +0, 438000, 34944, 0x71a7bb9d +0, 444000, 34944, 0xc0c8c108 +0, 450000, 34944, 0x1d1fc3ba +0, 456000, 34944, 0xebcfc67f +0, 462000, 34944, 0x2921cb5b +0, 468000, 34944, 0x793ed099 +0, 474000, 34944, 0xefebd9e8 +0, 480000, 34944, 0x163c2330 +0, 486000, 34944, 0x35155672 +0, 492000, 34944, 0x05474e2e +0, 498000, 34944, 0x9433542f +0, 504000, 34944, 0x777d5a13 +0, 510000, 34944, 0x87526776 +0, 516000, 34944, 0x4c3c72c1 +0, 522000, 34944, 0x70407b87 +0, 528000, 34944, 0x2358861d +0, 534000, 34944, 0xec61923f +0, 540000, 34944, 0x0bb2a0d4 +0, 546000, 34944, 0x6b6d8624 +0, 552000, 34944, 0x624761ec +0, 558000, 34944, 0xff23b926 +0, 564000, 34944, 0x07fc7ca5 +0, 570000, 34944, 0xa8d3ffda +0, 576000, 34944, 0xa2d31265 +0, 582000, 34944, 0x5e58225e +0, 588000, 34944, 0x284b2fb0 +0, 594000, 34944, 0x205b3cb1 +0, 600000, 34944, 0x3fa64a09 +0, 606000, 34944, 0xa5de5097 +0, 612000, 34944, 0x00686cea +0, 618000, 34944, 0x465a8282 +0, 624000, 34944, 0x4ceb8189 +0, 630000, 34944, 0x14698509 +0, 636000, 34944, 0x232c830d +0, 642000, 34944, 0x0739807c +0, 648000, 34944, 0x83b0861e +0, 654000, 34944, 0xbdc094b1 +0, 660000, 34944, 0xc4c0a605 +0, 666000, 34944, 0x8376b059 +0, 672000, 34944, 0x2035b939 +0, 678000, 34944, 0xb6bfc812 +0, 684000, 34944, 0xc5d4d5c4 +0, 690000, 34944, 0x492c954e +0, 696000, 34944, 0xd23f0dcc +0, 702000, 34944, 0x22d7ff6c +0, 708000, 34944, 0xd08b4168 +0, 714000, 34944, 0xa82e4062 +0, 720000, 34944, 0xcc4f2f31 +0, 726000, 34944, 0x964b0307 +0, 732000, 34944, 0xe8130606 +0, 738000, 34944, 0x5fb744bf +0, 744000, 34944, 0x1546a88b +0, 750000, 34944, 0xe6e4d94d +0, 756000, 34944, 0x8d1ea97e +0, 762000, 34944, 0x3bb1fb55 +0, 768000, 34944, 0x3c37e9cc +0, 774000, 34944, 0xe2d22521 +0, 780000, 34944, 0x7c0ec8cc +0, 786000, 34944, 0x7c2dc956 +0, 792000, 34944, 0x7fe3c263 +0, 798000, 34944, 0x9a65b813 +0, 804000, 34944, 0x7ea7cb14 +0, 810000, 34944, 0x31ded64e +0, 816000, 34944, 0x50f30ad1 +0, 822000, 34944, 0x12eac45c +0, 828000, 34944, 0x984b6335 +0, 834000, 34944, 0x3b9b02f0 +0, 840000, 34944, 0x4629d2a4 +0, 846000, 34944, 0x38687e89 +0, 852000, 34944, 0xb76620fe +0, 858000, 34944, 0x66347155 +0, 864000, 34944, 0x6e6bc297 +0, 870000, 34944, 0x452a653a +0, 876000, 34944, 0x8c8a0683 +0, 882000, 34944, 0xaf5d7c2d +0, 888000, 34944, 0x3064a7e1 +0, 894000, 34944, 0xc0657fc4 +0, 900000, 34944, 0x1f129266 +0, 906000, 34944, 0x35adedfb +0, 912000, 34944, 0x40a3db0d +0, 918000, 34944, 0x87bebb37 +0, 924000, 34944, 0x04d7ffed +0, 930000, 34944, 0x9bde3180 +0, 936000, 34944, 0xc35c25bd +0, 942000, 34944, 0x820bf4bb +0, 948000, 34944, 0x876163ef +0, 954000, 34944, 0x3ab6dac0 +0, 960000, 34944, 0x69a9ef73 +0, 966000, 34944, 0x0df3813c +0, 972000, 34944, 0x1bba0947 +0, 978000, 34944, 0x0b7883d4 +0, 984000, 34944, 0xa9972f7e +0, 990000, 34944, 0x603d08fe +0, 996000, 34944, 0x05f4f111 +0, 1002000, 34944, 0xb24fdb42 +0, 1008000, 34944, 0xfe2ad344 +0, 1014000, 34944, 0xda4bcb8f +0, 1020000, 34944, 0xd28aca6b +0, 1026000, 34944, 0x9486c260 +0, 1032000, 34944, 0xad9fc04d +0, 1038000, 34944, 0x9333c0ca +0, 1044000, 34944, 0x96e9c226 +0, 1050000, 34944, 0x3e89bd6f +0, 1056000, 34944, 0x7a2dbd32 +0, 1062000, 34944, 0xe578ba53 +0, 1068000, 34944, 0xb77ebab1 +0, 1074000, 34944, 0xd8bfbcb1 +0, 1080000, 34944, 0x15d9bc97 +0, 1086000, 34944, 0x09c3b9f0 +0, 1092000, 34944, 0xd8c8b944 +0, 1098000, 34944, 0x2c2fb996 +0, 1104000, 34944, 0xd7a8b7e7 +0, 1110000, 34944, 0xce34b843 +0, 1116000, 34944, 0xba69e9fd +0, 1122000, 34944, 0x1b3f1adc +0, 1128000, 34944, 0x48f515aa +0, 1134000, 34944, 0x864e12bb +0, 1140000, 34944, 0xca571996 +0, 1146000, 34944, 0x1d5a1af0 +0, 1152000, 34944, 0x3d1e171f +0, 1158000, 34944, 0xb57417ca +0, 1164000, 34944, 0x6e6d1e9d +0, 1170000, 34944, 0xc9971899 +0, 1176000, 34944, 0xe0b112c8 +0, 1182000, 34944, 0x121b0cd9 +0, 1188000, 34944, 0x418e0eff +0, 1194000, 34944, 0x9e1b07d8 +0, 1200000, 34944, 0x5590064a +0, 1206000, 34944, 0x7a170b14 +0, 1212000, 34944, 0xf25709f0 +0, 1218000, 34944, 0x94fa099a +0, 1224000, 34944, 0x081e06ae +0, 1230000, 34944, 0xcfc40417 +0, 1236000, 34944, 0xed33096f +0, 1242000, 34944, 0xd73a07e2 +0, 1248000, 34944, 0xc512077d +0, 1254000, 34944, 0x27d7021d +0, 1260000, 34944, 0xab59fd20 +0, 1266000, 34944, 0xcc2400b7 +0, 1272000, 34944, 0xcb3bfb99 +0, 1278000, 34944, 0x0974fb1a +0, 1284000, 34944, 0xef79f8ba +0, 1290000, 34944, 0xf932f3a2 +0, 1296000, 34944, 0xa32df1bc +0, 1302000, 34944, 0xdbe0f532 +0, 1308000, 34944, 0x234cf142 +0, 1314000, 34944, 0xe68befd0 +0, 1320000, 34944, 0xe4e7ee45 +0, 1326000, 34944, 0x0283eff1 +0, 1332000, 34944, 0xc8d3f6db +0, 1338000, 34944, 0x0aa6ee88 +0, 1344000, 34944, 0xcc3de527 +0, 1350000, 34944, 0x9db0ebef +0, 1356000, 34944, 0xa207e9db +0, 1362000, 34944, 0x35b3e74a +0, 1368000, 34944, 0x1988e848 +0, 1374000, 34944, 0x727de73c +0, 1380000, 34944, 0x05d5e709 +0, 1386000, 34944, 0x3214e4b2 +0, 1392000, 34944, 0xed85e0a9 +0, 1398000, 34944, 0xf6c9e100 +0, 1404000, 34944, 0x57a8dbaf +0, 1410000, 34944, 0xc75fdf41 +0, 1416000, 34944, 0x736fde24 +0, 1422000, 34944, 0x8d4bde80 +0, 1428000, 34944, 0x3220dc86 +0, 1434000, 34944, 0xe498da85 +0, 1440000, 34944, 0x0655daed +0, 1446000, 34944, 0xb22ad874 +0, 1452000, 34944, 0x8198d411 +0, 1458000, 34944, 0xd0d2d557 +0, 1464000, 34944, 0xd740d1ff +0, 1470000, 34944, 0x2783d00e +0, 1476000, 34944, 0x7abdcd6b +0, 1482000, 34944, 0x2e47d1eb +0, 1488000, 34944, 0xfe1bcf60 +0, 1494000, 34944, 0xf0f0d5bb +0, 1500000, 34944, 0x9af7d581 +0, 1506000, 34944, 0xb325ca3d +0, 1512000, 34944, 0xd88abfbd +0, 1518000, 34944, 0xf2bab746 +0, 1524000, 34944, 0xac44a7dd +0, 1530000, 34944, 0x609e9ea3 +0, 1536000, 34944, 0xa39993b9 +0, 1542000, 34944, 0x9c948911 +0, 1548000, 34944, 0x72f8822d +0, 1554000, 34944, 0x7f3f7a8c +0, 1560000, 34944, 0x7ab475f9 +0, 1566000, 34944, 0x536f73aa +0, 1572000, 34944, 0x86cb71e5 +0, 1578000, 34944, 0x17157186 +0, 1584000, 34944, 0xe33671a4 +0, 1590000, 34944, 0xe33671a4 +0, 1596000, 34944, 0xe33671a4 +0, 1602000, 34944, 0xe33671a4 +0, 1608000, 34944, 0xe33671a4 +0, 1614000, 34944, 0xe33671a4 +0, 1620000, 34944, 0xe33671a4 +0, 1626000, 34944, 0xe33671a4 +0, 1632000, 34944, 0xe33671a4 +0, 1638000, 34944, 0xe33671a4 +0, 1644000, 34944, 0xe33671a4 +0, 1650000, 34944, 0xe33671a4 +0, 1656000, 34944, 0xe33671a4 +0, 1662000, 34944, 0xe33671a4 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-tgv-ima-ea-eacs b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-tgv-ima-ea-eacs new file mode 100644 index 00000000..de73eefc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-tgv-ima-ea-eacs @@ -0,0 +1,94 @@ +0, 0, 230400, 0xfbf2581e +1, 0, 5872, 0x00000000 +1, 5992, 5872, 0x00000000 +0, 6000, 230400, 0xfbf2581e +1, 11984, 5872, 0x00000000 +0, 12000, 230400, 0xfbf2581e +1, 17976, 5872, 0x00000000 +0, 18000, 230400, 0xfbf2581e +1, 23967, 5872, 0x00000000 +0, 24000, 230400, 0xfbf2581e +1, 29959, 5872, 0x00000000 +0, 30000, 230400, 0xfbf2581e +1, 35951, 5872, 0x00000000 +0, 36000, 230400, 0xfbf2581e +1, 41943, 5872, 0x00000000 +0, 42000, 230400, 0xfbf2581e +1, 47935, 5872, 0x00000000 +0, 48000, 230400, 0xfbf2581e +1, 53927, 5872, 0x00000000 +0, 54000, 230400, 0xfbf2581e +1, 59918, 5872, 0x00000000 +0, 60000, 230400, 0xfbf2581e +1, 65910, 5872, 0x00000000 +0, 66000, 230400, 0xfbf2581e +1, 71902, 5872, 0x00000000 +0, 72000, 230400, 0xfbf2581e +1, 77894, 5872, 0x00000000 +0, 78000, 230400, 0xfbf2581e +1, 83886, 5872, 0x00000000 +0, 84000, 230400, 0xfbf2581e +1, 89878, 5872, 0xc6f64777 +0, 90000, 230400, 0xf5a0a21d +1, 95869, 5872, 0x7c9e60e8 +0, 96000, 230400, 0x909cc039 +1, 101861, 5872, 0x46525c54 +0, 102000, 230400, 0x14d899dd +1, 107853, 5872, 0x842796bb +0, 108000, 230400, 0x0d246edf +1, 113845, 5872, 0xb1f6cbd5 +0, 114000, 230400, 0x5345fe0d +1, 119837, 5872, 0x0261a74b +0, 120000, 230400, 0x5abdff9a +1, 125829, 5872, 0x8218b1f9 +0, 126000, 230400, 0x1730d973 +1, 131820, 5872, 0xd7a2cae6 +0, 132000, 230400, 0xec881be9 +1, 137812, 5872, 0x69d34562 +0, 138000, 230400, 0xf4216895 +1, 143804, 5872, 0x9303ec65 +0, 144000, 230400, 0x529d7a52 +1, 149796, 5872, 0xd5d963a1 +0, 150000, 230400, 0x93b4c7b9 +1, 155788, 5872, 0x0557e06f +0, 156000, 230400, 0xedc65bcd +1, 161780, 5872, 0x1eb48b41 +0, 162000, 230400, 0xf0fb54ae +1, 167771, 5872, 0x70f5ca3f +0, 168000, 230400, 0x27864ce9 +1, 173763, 5872, 0xd39e5c5e +0, 174000, 230400, 0xcd05012d +1, 179755, 5872, 0x29c59140 +0, 180000, 230400, 0x019b6d84 +1, 185747, 5872, 0x7d95e643 +0, 186000, 230400, 0xcc05d416 +1, 191739, 5872, 0x45353fd8 +0, 192000, 230400, 0xb04c0248 +1, 197731, 5872, 0xad7b1b27 +0, 198000, 230400, 0x6806eb92 +1, 203722, 5872, 0x1f0377b3 +0, 204000, 230400, 0x60e9c001 +1, 209714, 5872, 0x6074541e +0, 210000, 230400, 0x9b040261 +1, 215706, 5872, 0xa4f5e892 +0, 216000, 230400, 0x6961fb90 +1, 221698, 5872, 0x084bc696 +0, 222000, 230400, 0xbf67ad24 +1, 227690, 5872, 0x67fdafce +0, 228000, 230400, 0x2270f328 +1, 233682, 5872, 0x8dfd249d +0, 234000, 230400, 0xd0c345f6 +1, 239673, 5872, 0x514184ee +0, 240000, 230400, 0xfd159212 +1, 245665, 5872, 0xc0090b0d +0, 246000, 230400, 0x085578ff +1, 251657, 5872, 0xc1171cc8 +0, 252000, 230400, 0xcca8afa6 +1, 257649, 5872, 0x7d7dd07e +0, 258000, 230400, 0x901ec91c +1, 263641, 5872, 0xe6aa619c +0, 264000, 230400, 0xf1cb99f3 +1, 269633, 5872, 0xd5aac0df +0, 270000, 230400, 0x86d98f0c +1, 275624, 5872, 0x3b68b390 +0, 276000, 230400, 0x52970700 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-tgv-ima-ea-sead b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-tgv-ima-ea-sead new file mode 100644 index 00000000..bfa84194 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-tgv-ima-ea-sead @@ -0,0 +1,87 @@ +0, 0, 192000, 0xdfc2f225 +1, 0, 2944, 0x00000000 +1, 3004, 5888, 0x5ae3c2a4 +0, 6000, 192000, 0x059b57bd +1, 9012, 5888, 0x158fbcb4 +0, 12000, 192000, 0x766cb086 +1, 15020, 5888, 0x3fc85d35 +0, 18000, 192000, 0x459e3bac +1, 21029, 5888, 0x4667ec2b +0, 24000, 192000, 0x5293e622 +1, 27037, 5888, 0x82744494 +0, 30000, 192000, 0x898b03f4 +1, 33045, 5888, 0x3b0cb86f +0, 36000, 192000, 0xb184a627 +1, 39053, 5888, 0x29493fbb +0, 42000, 192000, 0xa3fc650a +1, 45061, 5888, 0xaa2d8595 +0, 48000, 192000, 0xea448589 +1, 51069, 5888, 0x2e563de6 +0, 54000, 192000, 0x700e2b76 +1, 57078, 5888, 0x225cca99 +0, 60000, 192000, 0xa1a1d66d +1, 63086, 5888, 0x2b577599 +0, 66000, 192000, 0xd63bc8a1 +1, 69094, 5888, 0x3d967f32 +0, 72000, 192000, 0x5f08c023 +1, 75102, 5888, 0x16639a84 +0, 78000, 192000, 0x8b75ec3b +1, 81110, 5888, 0x90549ba0 +0, 84000, 192000, 0x62728ce4 +1, 87118, 5888, 0xf46e6644 +0, 90000, 192000, 0xaa007941 +1, 93127, 5888, 0x39a073ec +0, 96000, 192000, 0x55dc5b3b +1, 99135, 5888, 0xb1d7a93a +0, 102000, 192000, 0x72d836c2 +1, 105143, 5888, 0x25e9795b +0, 108000, 192000, 0x1f2de2fc +1, 111151, 5888, 0xbbc07644 +0, 114000, 192000, 0xb295dfdb +1, 117159, 5888, 0x323f6a1b +0, 120000, 192000, 0xe5c5f634 +1, 123167, 5888, 0x7cae130b +0, 126000, 192000, 0x455a0464 +1, 129176, 5888, 0xd23bf9c6 +0, 132000, 192000, 0x3bf2340d +1, 135184, 5888, 0x5f73ef35 +0, 138000, 192000, 0xe368f0fc +1, 141192, 5888, 0xc66026be +0, 144000, 192000, 0xfa7549c0 +1, 147200, 5888, 0xc8fdb539 +0, 150000, 192000, 0x4dd76f3d +1, 153208, 5888, 0x94c6bfbd +0, 156000, 192000, 0x50a49f6c +1, 159216, 5888, 0xb77e1b83 +0, 162000, 192000, 0xb6072f65 +1, 165224, 5888, 0x6c6d6693 +0, 168000, 192000, 0x093ce1a8 +1, 171233, 5888, 0xd9f064d4 +0, 174000, 192000, 0x55afe3db +1, 177241, 5888, 0x85dd990d +0, 180000, 192000, 0x81c3bfab +1, 183249, 5888, 0x385e021b +0, 186000, 192000, 0x583ebd3d +1, 189257, 5888, 0xac09fd02 +0, 192000, 192000, 0x2504f003 +1, 195265, 5888, 0xc6dcdff2 +0, 198000, 192000, 0x44ade2af +1, 201273, 5888, 0x86a6944d +0, 204000, 192000, 0x77cbcfd8 +1, 207282, 5888, 0x8587b964 +0, 210000, 192000, 0xac7ddfa1 +1, 213290, 5888, 0x2b0355ff +0, 216000, 192000, 0x79f7cfe8 +1, 219298, 5888, 0xe4148a85 +0, 222000, 192000, 0xdf2898fd +1, 225306, 5888, 0xdf02ed4f +1, 231314, 5888, 0x87a54b15 +1, 237322, 5888, 0x3ad2be45 +1, 243331, 5888, 0x3a49c2c3 +1, 249339, 5888, 0xc2b66404 +1, 255347, 5888, 0xac3e234a +1, 261355, 5888, 0x5dcf523b +1, 267363, 5888, 0x2034b5d6 +1, 273371, 5888, 0x96882832 +1, 279380, 5888, 0x2be3d534 +1, 285388, 5888, 0xa841a49d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-tqi-adpcm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-tqi-adpcm new file mode 100644 index 00000000..c79eed52 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-tqi-adpcm @@ -0,0 +1,52 @@ +0, 0, 115200, 0x375ec573 +1, 0, 5936, 0x00000000 +0, 6000, 115200, 0x375ec573 +1, 6057, 5824, 0x00000000 +0, 12000, 115200, 0x375ec573 +1, 12000, 5936, 0x00000000 +0, 18000, 115200, 0x375ec573 +1, 18057, 5824, 0x00000000 +0, 24000, 115200, 0x375ec573 +1, 24000, 5936, 0x00000000 +0, 30000, 115200, 0x375ec573 +1, 30057, 5824, 0x00000000 +0, 36000, 115200, 0x375ec573 +1, 36000, 5936, 0x00000000 +0, 42000, 115200, 0x375ec573 +1, 42057, 5824, 0x0f06f5bb +0, 48000, 115200, 0x0b4d31bf +1, 48000, 5936, 0xb0dbfc46 +0, 54000, 115200, 0xdd724598 +1, 54057, 5824, 0x9daa9f9c +0, 60000, 115200, 0xc3077e75 +1, 60000, 5936, 0x61400d2f +0, 66000, 115200, 0xbf70778a +1, 66057, 5824, 0x34a5b0e3 +0, 72000, 115200, 0x117eb766 +1, 72000, 5936, 0x6e546f72 +0, 78000, 115200, 0x4617fbad +1, 78057, 5824, 0x4f093b35 +0, 84000, 115200, 0x5f5b02d2 +1, 84000, 5936, 0x95b5b599 +0, 90000, 115200, 0x2a9c5325 +1, 90057, 5824, 0x75e15e60 +0, 96000, 115200, 0x14a89e2a +1, 96000, 5936, 0xd1077d39 +0, 102000, 115200, 0xe69aa994 +1, 102057, 5824, 0x956e21ca +0, 108000, 115200, 0xfbacf589 +1, 108000, 5936, 0x33bac234 +0, 114000, 115200, 0x1d714c6e +1, 114057, 5824, 0x5df37824 +0, 120000, 115200, 0x6eff66cb +1, 120000, 5936, 0xc174af24 +0, 126000, 115200, 0xee21c1cb +1, 126057, 5824, 0xe5dc2159 +0, 132000, 115200, 0xce714ada +1, 132000, 5936, 0x63ffc8b1 +0, 138000, 115200, 0xf89d56c3 +1, 138057, 5824, 0xefe4c365 +0, 144000, 115200, 0x65fd5e60 +1, 144000, 5936, 0x2174304d +0, 150000, 115200, 0x0c256424 +0, 156000, 115200, 0xa9cdd8d2 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-vp60 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-vp60 new file mode 100644 index 00000000..b5a70c3a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-vp60 @@ -0,0 +1,133 @@ +0, 0, 55296, 0x6a3202a3 +0, 3003, 55296, 0x2af202eb +0, 6006, 55296, 0xa1a40388 +0, 9009, 55296, 0x61c90426 +0, 12012, 55296, 0x17720594 +0, 15015, 55296, 0x49440805 +0, 18018, 55296, 0x5b2e0d32 +0, 21021, 55296, 0x207891c1 +0, 24024, 55296, 0x502da4cd +0, 27027, 55296, 0x75a22a75 +0, 30030, 55296, 0xd55099af +0, 33033, 55296, 0x48778bb6 +0, 36036, 55296, 0xe76b7df7 +0, 39039, 55296, 0x5a049f33 +0, 42042, 55296, 0xc83d9b90 +0, 45045, 55296, 0x567877b8 +0, 48048, 55296, 0x334c7f6e +0, 51051, 55296, 0x8717945c +0, 54054, 55296, 0xe432831e +0, 57057, 55296, 0x032e8d2d +0, 60060, 55296, 0x37109fd6 +0, 63063, 55296, 0xe9b0b61b +0, 66066, 55296, 0x7385dae8 +0, 69069, 55296, 0x74b8a9f5 +0, 72072, 55296, 0xbce2e218 +0, 75075, 55296, 0x0ab6c623 +0, 78078, 55296, 0x2234d6d6 +0, 81081, 55296, 0xd18be4d6 +0, 84084, 55296, 0x5247ecc9 +0, 87087, 55296, 0xc89f10ca +0, 90090, 55296, 0x16181f87 +0, 93093, 55296, 0x893bfa85 +0, 96096, 55296, 0x1fd9f1c0 +0, 99099, 55296, 0xa2e8e6a9 +0, 102102, 55296, 0x1b42dfd5 +0, 105105, 55296, 0x0fa9f509 +0, 108108, 55296, 0x4449c216 +0, 111111, 55296, 0xb66baa36 +0, 114114, 55296, 0x38c19f3b +0, 117117, 55296, 0xcdce83a0 +0, 120120, 55296, 0xac4ea82b +0, 123123, 55296, 0xb77a6979 +0, 126126, 55296, 0xc8834ec2 +0, 129129, 55296, 0x181d3f0f +0, 132132, 55296, 0x2ae04252 +0, 135135, 55296, 0x07633c18 +0, 138138, 55296, 0xdc6a3340 +0, 141141, 55296, 0xa456ebb1 +0, 144144, 55296, 0xbf7de5e2 +0, 147147, 55296, 0x54a1c39b +0, 150150, 55296, 0x08fc9423 +0, 153153, 55296, 0x926f968a +0, 156156, 55296, 0x5c908481 +0, 159159, 55296, 0x6b257f16 +0, 162162, 55296, 0xbaf8658a +0, 165165, 55296, 0x61c957b1 +0, 168168, 55296, 0xa6d181ff +0, 171171, 55296, 0xef476e69 +0, 174174, 55296, 0x74f72f9a +0, 177177, 55296, 0x3a9328e9 +0, 180180, 55296, 0xbe962874 +0, 183183, 55296, 0x5f8b58cc +0, 186186, 55296, 0x1e066d22 +0, 189189, 55296, 0x9ef72b34 +0, 192192, 55296, 0x525c2bb1 +0, 195195, 55296, 0x8e5a20a3 +0, 198198, 55296, 0x1c6723d0 +0, 201201, 55296, 0x2b1023c8 +0, 204204, 55296, 0x8f682691 +0, 207207, 55296, 0x3a0624f5 +0, 210210, 55296, 0xbc1046fb +0, 213213, 55296, 0x2859470e +0, 216216, 55296, 0x61d45a12 +0, 219219, 55296, 0xa68853b6 +0, 222222, 55296, 0x36543ce4 +0, 225225, 55296, 0x95b953d4 +0, 228228, 55296, 0x804b3c53 +0, 231231, 55296, 0x743960f6 +0, 234234, 55296, 0x23916b9c +0, 237237, 55296, 0x8f5a59e3 +0, 240240, 55296, 0xf1285f83 +0, 243243, 55296, 0xde75640f +0, 246246, 55296, 0xde146188 +0, 249249, 55296, 0xb5315cc9 +0, 252252, 55296, 0xa85f6861 +0, 255255, 55296, 0x4fda562f +0, 258258, 55296, 0xa0185863 +0, 261261, 55296, 0xe4dc5a5f +0, 264264, 55296, 0x8a2aabb6 +0, 267267, 55296, 0x3ba89b4f +0, 270270, 55296, 0x82b07c21 +0, 273273, 55296, 0xb7998478 +0, 276276, 55296, 0xceca8046 +0, 279279, 55296, 0xe652b325 +0, 282282, 55296, 0xc26bb607 +0, 285285, 55296, 0x40c99200 +0, 288288, 55296, 0x61bc9b27 +0, 291291, 55296, 0x1e4baa30 +0, 294294, 55296, 0xd8a7adb0 +0, 297297, 55296, 0x0d0aa8fb +0, 300300, 55296, 0x1f1ba33c +0, 303303, 55296, 0xa000a80b +0, 306306, 55296, 0xb49dd332 +0, 309309, 55296, 0x6b8ac499 +0, 312312, 55296, 0x9636ed15 +0, 315315, 55296, 0xa152f03d +0, 318318, 55296, 0x47a8cfc7 +0, 321321, 55296, 0x9f94c82a +0, 324324, 55296, 0xe208d626 +0, 327327, 55296, 0x28cc0616 +0, 330330, 55296, 0xc545179e +0, 333333, 55296, 0xdf9205af +0, 336336, 55296, 0x31d6ed99 +0, 339339, 55296, 0x866bf86e +0, 342342, 55296, 0x0490fbd1 +0, 345345, 55296, 0xe1102987 +0, 348348, 55296, 0x7f860c29 +0, 351351, 55296, 0xc3a91f7a +0, 354354, 55296, 0x69641a52 +0, 357357, 55296, 0x05b12204 +0, 360360, 55296, 0x715b6206 +0, 363363, 55296, 0xdcf55139 +0, 366366, 55296, 0x1369f746 +0, 369369, 55296, 0xc1533ef5 +0, 372372, 55296, 0xc00ff85f +0, 375375, 55296, 0x4f5f70dc +0, 378378, 55296, 0x85720ccc +0, 381381, 55296, 0xfdff0780 +0, 384384, 55296, 0x57ef04ff +0, 387387, 55296, 0xbf94041f +0, 390390, 55296, 0x4cee0392 +0, 393393, 55296, 0x80160314 +0, 396396, 55296, 0x396802af diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-vp61 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-vp61 new file mode 100644 index 00000000..bddaf42d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ea-vp61 @@ -0,0 +1,120 @@ +0, 0, 18816, 0xc3fe9fc7 +0, 3003, 18816, 0x6ddf972f +0, 6006, 18816, 0x72808b6e +0, 9009, 18816, 0x8f09857f +0, 12012, 18816, 0xe8027c00 +0, 15015, 18816, 0x308670cf +0, 18018, 18816, 0x0e656170 +0, 21021, 18816, 0x594e54a4 +0, 24024, 18816, 0x36944b05 +0, 27027, 18816, 0x87013a34 +0, 30030, 18816, 0xc0f32f0d +0, 33033, 18816, 0x911f1951 +0, 36036, 18816, 0xad590d59 +0, 39039, 18816, 0x943afff0 +0, 42042, 18816, 0x7f5ef719 +0, 45045, 18816, 0x889feafc +0, 48048, 18816, 0x4334e12b +0, 51051, 18816, 0xd080cc67 +0, 54054, 18816, 0xc3c1c04c +0, 57057, 18816, 0x816bae4b +0, 60060, 18816, 0xed23a5c7 +0, 63063, 18816, 0x86689c2f +0, 66066, 18816, 0x63408c52 +0, 69069, 18816, 0x399c79d6 +0, 72072, 18816, 0xf0ff63bf +0, 75075, 18816, 0xa6185353 +0, 78078, 18816, 0xe33d46fc +0, 81081, 18816, 0xd58d3c6d +0, 84084, 18816, 0xc94a27ea +0, 87087, 18816, 0x62f31c59 +0, 90090, 18816, 0x71880825 +0, 93093, 18816, 0xa6ce01d7 +0, 96096, 18816, 0xa1d4fc06 +0, 99099, 18816, 0xc208f570 +0, 102102, 18816, 0xc862e637 +0, 105105, 18816, 0xcf9ed93a +0, 108108, 18816, 0x85a8cbcc +0, 111111, 18816, 0x650ac6c1 +0, 114114, 18816, 0xb418c12b +0, 117117, 18816, 0x9fe5b412 +0, 120120, 18816, 0x80f6a7c1 +0, 123123, 18816, 0x283299e4 +0, 126126, 18816, 0x15429202 +0, 129129, 18816, 0x9f0f8c8a +0, 132132, 18816, 0x8e828811 +0, 135135, 18816, 0xaac67993 +0, 138138, 18816, 0x8f3b6f4f +0, 141141, 18816, 0x0b125f95 +0, 144144, 18816, 0xb4e75d14 +0, 147147, 18816, 0x1bac5933 +0, 150150, 18816, 0x300b521b +0, 153153, 18816, 0x51174590 +0, 156156, 18816, 0x03df3d70 +0, 159159, 18816, 0x338a344a +0, 162162, 18816, 0x45ad328d +0, 165165, 18816, 0x2d4e321a +0, 168168, 18816, 0x15932563 +0, 171171, 18816, 0x9b4f1c76 +0, 174174, 18816, 0x8e31153c +0, 177177, 18816, 0xfb391185 +0, 180180, 18816, 0x93ee0cdc +0, 183183, 18816, 0xddeb0642 +0, 186186, 18816, 0xda6cf529 +0, 189189, 18816, 0xdbd6f085 +0, 192192, 18816, 0x357aec81 +0, 195195, 18816, 0x36eaecca +0, 198198, 18816, 0x6535ee02 +0, 201201, 18816, 0xb7dfe466 +0, 204204, 18816, 0x58d3d86b +0, 207207, 18816, 0xd8aad64b +0, 210210, 18816, 0x37ecd588 +0, 213213, 18816, 0xe2f9cee4 +0, 216216, 18816, 0xcd1ac93e +0, 219219, 18816, 0x18e1be81 +0, 222222, 18816, 0xa05bb9d7 +0, 225225, 18816, 0xe0ebb663 +0, 228228, 18816, 0x7d61b39a +0, 231231, 18816, 0x01b8acb5 +0, 234234, 18816, 0x7577aa8b +0, 237237, 18816, 0x6bbda4b5 +0, 240240, 18816, 0xd0cc9b29 +0, 243243, 18816, 0xb2858cbb +0, 246246, 18816, 0x93608c9d +0, 249249, 18816, 0x80c38e03 +0, 252252, 18816, 0x37d6843c +0, 255255, 18816, 0xacc47b9a +0, 258258, 18816, 0xc4317178 +0, 261261, 18816, 0xc92f6ebd +0, 264264, 18816, 0xc1217a3b +0, 267267, 18816, 0x03a37ccb +0, 270270, 18816, 0xf38c71a2 +0, 273273, 18816, 0x68ff697d +0, 276276, 18816, 0x0fe358e5 +0, 279279, 18816, 0x58455870 +0, 282282, 18816, 0xc9075ce7 +0, 285285, 18816, 0x16685773 +0, 288288, 18816, 0x1b434c0e +0, 291291, 18816, 0x008e4c97 +0, 294294, 18816, 0xb4d04f4f +0, 297297, 18816, 0xc8c94848 +0, 300300, 18816, 0x64664191 +0, 303303, 18816, 0xd591367f +0, 306306, 18816, 0xc70d3141 +0, 309309, 18816, 0x8d492655 +0, 312312, 18816, 0x7e7f22c8 +0, 315315, 18816, 0x335d23f9 +0, 318318, 18816, 0x0a7f22b6 +0, 321321, 18816, 0x6cf51cb2 +0, 324324, 18816, 0x312516e1 +0, 327327, 18816, 0x8a3c0c7a +0, 330330, 18816, 0x997d0d20 +0, 333333, 18816, 0xffbd117e +0, 336336, 18816, 0x855808ca +0, 339339, 18816, 0xe335fb94 +0, 342342, 18816, 0x12e6f95c +0, 345345, 18816, 0x2d62f845 +0, 348348, 18816, 0x7e63f591 +0, 351351, 18816, 0x7463f175 +0, 354354, 18816, 0x1521e0d2 +0, 357357, 18816, 0x96a8dbce diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fax-g3 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fax-g3 new file mode 100644 index 00000000..b712dd2a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fax-g3 @@ -0,0 +1 @@ +0, 0, 1000384, 0xb758eb8b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fax-g3s b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fax-g3s new file mode 100644 index 00000000..b712dd2a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fax-g3s @@ -0,0 +1 @@ +0, 0, 1000384, 0xb758eb8b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/feeble-dxa b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/feeble-dxa new file mode 100644 index 00000000..30960323 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/feeble-dxa @@ -0,0 +1,65 @@ +1, 0, 1000, 0x64cd9403 +0, 0, 921600, 0x0d03844f +1, 4082, 1000, 0xa4ef8a9d +1, 8163, 1000, 0x75c19868 +0, 9000, 921600, 0x0d03844f +1, 12245, 1000, 0x93db6f79 +1, 16327, 1000, 0x6835625d +0, 18000, 921600, 0x649cdcea +1, 20408, 1000, 0xb3affa8f +1, 24490, 1000, 0x159fdcc8 +0, 27000, 921600, 0x649cdcea +1, 28571, 1000, 0x79f9f7f1 +1, 32653, 1000, 0xd7d1131e +0, 36000, 921600, 0x9c7f22e8 +1, 36735, 1000, 0x52a6f797 +1, 40816, 1000, 0x748202ca +1, 44898, 1000, 0x0ef92449 +0, 45000, 921600, 0x9c7f22e8 +1, 48980, 1000, 0x6a3760ab +1, 53061, 1000, 0xce5c5abf +0, 54000, 921600, 0x3451514a +1, 57143, 1000, 0x23396792 +1, 61224, 1000, 0xa5276238 +0, 63000, 921600, 0x3451514a +1, 65306, 1000, 0x288adf1b +1, 69388, 1000, 0xe7de6fb2 +0, 72000, 921600, 0x8f19f600 +1, 73469, 1000, 0x2c2c707f +1, 77551, 1000, 0xd66d6daf +0, 81000, 921600, 0x8f19f600 +1, 81633, 1000, 0xbcea7d64 +1, 85714, 1000, 0x766feea5 +1, 89796, 1000, 0xd2e1d63a +0, 90000, 921600, 0x07e7445b +1, 93878, 1000, 0x2f7ef4ed +1, 97959, 1000, 0xb655cba4 +0, 99000, 921600, 0x07e7445b +1, 102041, 1000, 0x4507d37b +1, 106122, 1000, 0x0c57f794 +0, 108000, 921600, 0x873d1227 +1, 110204, 1000, 0x0ecbe5cc +1, 114286, 1000, 0x9bf6e345 +0, 117000, 921600, 0x873d1227 +1, 118367, 1000, 0xc461443c +1, 122449, 1000, 0xad9657bf +0, 126000, 921600, 0xbef62d86 +1, 126531, 1000, 0x466fe91c +1, 130612, 1000, 0x9ee377fe +1, 134694, 1000, 0x09956428 +0, 135000, 921600, 0xbef62d86 +1, 138776, 1000, 0x9b285f0a +1, 142857, 1000, 0x0a3e61a6 +0, 144000, 921600, 0xcf84fee4 +1, 146939, 1000, 0xacc25d6b +1, 151020, 1000, 0x377be319 +0, 153000, 921600, 0xcf84fee4 +1, 155102, 1000, 0xe4890504 +1, 159184, 1000, 0xe90a6497 +0, 162000, 921600, 0x5639e670 +1, 163265, 1000, 0xd00fe950 +1, 167347, 1000, 0xf195eb44 +0, 171000, 921600, 0x5639e670 +1, 171429, 1000, 0xa491f3ef +1, 175510, 1000, 0x2c036e18 +1, 179592, 1000, 0x52d65e2a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/film-cvid-pcm-stereo-8bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/film-cvid-pcm-stereo-8bit new file mode 100644 index 00000000..ebe0fc45 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/film-cvid-pcm-stereo-8bit @@ -0,0 +1,247 @@ +1, 0, 88192, 0x23bb50ae +0, 0, 107520, 0xa6c9fdd2 +0, 3000, 107520, 0x61eb28c1 +0, 6000, 107520, 0x45e20af7 +0, 9000, 107520, 0x45e20af7 +0, 12000, 107520, 0x366970fc +0, 15000, 107520, 0x366970fc +0, 18000, 107520, 0xa392bcb3 +0, 21000, 107520, 0xa392bcb3 +0, 24000, 107520, 0xcf7bac98 +0, 27000, 107520, 0xcf7bac98 +0, 30000, 107520, 0x222eba53 +0, 33000, 107520, 0x222eba53 +0, 36000, 107520, 0x74e255a1 +0, 39000, 107520, 0x74e255a1 +0, 42000, 107520, 0xc19eec6f +1, 44996, 44112, 0x79600f01 +0, 45000, 107520, 0xc19eec6f +0, 48000, 107520, 0xa3880681 +0, 51000, 107520, 0xa3880681 +0, 54000, 107520, 0x957878db +0, 57000, 107520, 0x957878db +0, 60000, 107520, 0x18340692 +0, 63000, 107520, 0x18340692 +0, 66000, 107520, 0x9970f24d +1, 67502, 44096, 0x09dbf7aa +0, 69000, 107520, 0x9970f24d +0, 72000, 107520, 0xf08618aa +0, 75000, 107520, 0xf08618aa +0, 78000, 107520, 0xee7324f0 +0, 81000, 107520, 0xee7324f0 +0, 84000, 107520, 0xe15025b3 +0, 87000, 107520, 0xe15025b3 +1, 90000, 44112, 0x18fed048 +0, 90000, 107520, 0x8afa312e +0, 93000, 107520, 0x8afa312e +0, 96000, 107520, 0x717a7d0f +0, 99000, 107520, 0x717a7d0f +0, 102000, 107520, 0x355c6e23 +0, 105000, 107520, 0x355c6e23 +0, 108000, 107520, 0x7015a50f +0, 111000, 107520, 0x7015a50f +1, 112506, 44112, 0x030d35ef +0, 114000, 107520, 0xcdfc1a16 +0, 117000, 107520, 0xcdfc1a16 +0, 120000, 107520, 0x38d929e7 +0, 123000, 107520, 0x38d929e7 +0, 126000, 107520, 0x52913423 +0, 129000, 107520, 0x52913423 +0, 132000, 107520, 0xe2c91c10 +0, 135000, 107520, 0xe2c91c10 +1, 135012, 44112, 0xc23154d5 +0, 138000, 107520, 0x85516e9c +0, 141000, 107520, 0x85516e9c +0, 144000, 107520, 0xd1626030 +0, 147000, 107520, 0xd1626030 +0, 150000, 107520, 0xea7b16de +0, 153000, 107520, 0xea7b16de +0, 156000, 107520, 0xa33eaa0d +1, 157518, 44064, 0xe4713ee7 +0, 159000, 107520, 0xa33eaa0d +0, 162000, 107520, 0x8e3be6a6 +0, 165000, 107520, 0x8e3be6a6 +0, 168000, 107520, 0x14147bd6 +0, 171000, 107520, 0x14147bd6 +0, 174000, 107520, 0x07d54bec +0, 177000, 107520, 0x07d54bec +1, 180000, 44112, 0xddc19d91 +0, 180000, 107520, 0xe287a0a7 +0, 183000, 107520, 0xe287a0a7 +0, 186000, 107520, 0xc023a14d +0, 189000, 107520, 0xc023a14d +0, 192000, 107520, 0x2437085d +0, 195000, 107520, 0x2437085d +0, 198000, 107520, 0x63823918 +0, 201000, 107520, 0x63823918 +1, 202506, 44112, 0x9591522d +0, 204000, 107520, 0xbc17e198 +0, 207000, 107520, 0xbc17e198 +0, 210000, 107520, 0x9d99bc81 +0, 213000, 107520, 0x9d99bc81 +0, 216000, 107520, 0x7e4ec71e +0, 219000, 107520, 0x7e4ec71e +0, 222000, 107520, 0x55b98376 +0, 225000, 107520, 0x55b98376 +1, 225012, 44112, 0x90deb013 +0, 228000, 107520, 0x356d8e9e +0, 231000, 107520, 0x356d8e9e +0, 234000, 107520, 0xf77e8a61 +0, 237000, 107520, 0xf77e8a61 +0, 240000, 107520, 0x5ae7c8c7 +0, 243000, 107520, 0x5ae7c8c7 +0, 246000, 107520, 0x8acf9322 +1, 247518, 44064, 0x3842d420 +0, 249000, 107520, 0x8acf9322 +0, 252000, 107520, 0x40a9177e +0, 255000, 107520, 0x40a9177e +0, 258000, 107520, 0x3e0e4d8d +0, 261000, 107520, 0x3e0e4d8d +0, 264000, 107520, 0xd268865b +0, 267000, 107520, 0xd268865b +1, 270000, 44112, 0x99c8c3d9 +0, 270000, 107520, 0x89a4efeb +0, 273000, 107520, 0x89a4efeb +0, 276000, 107520, 0x70ca2478 +0, 279000, 107520, 0x70ca2478 +0, 282000, 107520, 0xcc9ec981 +0, 285000, 107520, 0xcc9ec981 +0, 288000, 107520, 0xf0648459 +0, 291000, 107520, 0xf0648459 +1, 292506, 44112, 0xffaf3824 +0, 294000, 107520, 0x7e4a4cca +0, 297000, 107520, 0x7e4a4cca +0, 300000, 107520, 0xb315dc65 +0, 303000, 107520, 0xb315dc65 +0, 306000, 107520, 0x2aecc7b4 +0, 309000, 107520, 0x2aecc7b4 +0, 312000, 107520, 0x81742f51 +0, 315000, 107520, 0x81742f51 +1, 315012, 44112, 0x3dbe1aef +0, 318000, 107520, 0x3a1d7571 +0, 321000, 107520, 0x3a1d7571 +0, 324000, 107520, 0x3a1d7571 +0, 327000, 107520, 0x3a1d7571 +0, 330000, 107520, 0x3a1d7571 +0, 333000, 107520, 0x3a1d7571 +0, 336000, 107520, 0x3a1d7571 +1, 337518, 44064, 0xed2c7dfb +0, 339000, 107520, 0x3a1d7571 +0, 342000, 107520, 0x3a1d7571 +0, 345000, 107520, 0x3a1d7571 +0, 348000, 107520, 0x3a1d7571 +0, 351000, 107520, 0x3a1d7571 +0, 354000, 107520, 0x3a1d7571 +0, 357000, 107520, 0x3a1d7571 +1, 360000, 44112, 0x9e475274 +0, 360000, 107520, 0xe974733e +0, 363000, 107520, 0xe974733e +0, 366000, 107520, 0x999c6fbf +0, 369000, 107520, 0x999c6fbf +0, 372000, 107520, 0x26b56b6e +0, 375000, 107520, 0x26b56b6e +0, 378000, 107520, 0xc9f9647b +0, 381000, 107520, 0xc9f9647b +1, 382506, 44112, 0x541f05d4 +0, 384000, 107520, 0x6d025d00 +0, 387000, 107520, 0x6d025d00 +0, 390000, 107520, 0xf9c056c1 +0, 393000, 107520, 0xf9c056c1 +0, 396000, 107520, 0xa5cc4d0b +0, 399000, 107520, 0xa5cc4d0b +0, 402000, 107520, 0x1a4c4236 +0, 405000, 107520, 0x1a4c4236 +1, 405012, 44112, 0x09e39025 +0, 408000, 107520, 0xa9d538b6 +0, 411000, 107520, 0xa9d538b6 +0, 414000, 107520, 0x14682d00 +0, 417000, 107520, 0x14682d00 +0, 420000, 107520, 0x6236204f +0, 423000, 107520, 0x6236204f +0, 426000, 107520, 0x303e14aa +1, 427518, 44064, 0xdc111087 +0, 429000, 107520, 0x303e14aa +0, 432000, 107520, 0x943b0837 +0, 435000, 107520, 0x943b0837 +0, 438000, 107520, 0xfce5fd07 +0, 441000, 107520, 0xfce5fd07 +0, 444000, 107520, 0xd993f193 +0, 447000, 107520, 0xd993f193 +1, 450000, 44112, 0xb8f86e48 +0, 450000, 107520, 0x4d48e7b4 +0, 453000, 107520, 0x4d48e7b4 +0, 456000, 107520, 0x61ccdf83 +0, 459000, 107520, 0x61ccdf83 +0, 462000, 107520, 0xfb4fd608 +0, 465000, 107520, 0xfb4fd608 +0, 468000, 107520, 0x5efdcdb3 +0, 471000, 107520, 0x5efdcdb3 +1, 472506, 44112, 0xa1e0c75c +0, 474000, 107520, 0xb03ec886 +0, 477000, 107520, 0xb03ec886 +0, 480000, 107520, 0xf464c343 +0, 483000, 107520, 0xf464c343 +0, 486000, 107520, 0xf464c343 +0, 489000, 107520, 0xf464c343 +0, 492000, 107520, 0xf464c343 +0, 495000, 107520, 0xf464c343 +1, 495012, 44112, 0x0654dcb0 +0, 498000, 107520, 0xf464c343 +0, 501000, 107520, 0xf464c343 +0, 504000, 107520, 0xf464c343 +0, 507000, 107520, 0xf464c343 +0, 510000, 107520, 0xf464c343 +0, 513000, 107520, 0xf464c343 +0, 516000, 107520, 0xf464c343 +1, 517518, 44064, 0xb921e11a +0, 519000, 107520, 0xf464c343 +0, 522000, 107520, 0xf464c343 +0, 525000, 107520, 0xf464c343 +0, 528000, 107520, 0xf464c343 +0, 531000, 107520, 0xf464c343 +0, 534000, 107520, 0xf464c343 +0, 537000, 107520, 0xf464c343 +1, 540000, 44112, 0xe0ac619f +0, 540000, 107520, 0xf464c343 +0, 543000, 107520, 0xf464c343 +0, 546000, 107520, 0xf2b2c712 +0, 549000, 107520, 0xf2b2c712 +0, 552000, 107520, 0xf2b2c712 +0, 555000, 107520, 0xf2b2c712 +0, 558000, 107520, 0xf2b2c712 +0, 561000, 107520, 0xf2b2c712 +1, 562506, 44112, 0xb07aa65c +0, 564000, 107520, 0xf2b2c712 +0, 567000, 107520, 0xf2b2c712 +0, 570000, 107520, 0xb95e6bc8 +0, 573000, 107520, 0xb95e6bc8 +0, 576000, 107520, 0x33feee37 +0, 579000, 107520, 0x33feee37 +0, 582000, 107520, 0x36ee3cd5 +0, 585000, 107520, 0x36ee3cd5 +1, 585012, 44112, 0x24610ff0 +0, 588000, 107520, 0x59096471 +0, 591000, 107520, 0x59096471 +0, 594000, 107520, 0x53b470c6 +0, 597000, 107520, 0x53b470c6 +0, 600000, 107520, 0xdb7c64ff +0, 603000, 107520, 0xdb7c64ff +0, 606000, 107520, 0xe5a1596a +1, 607518, 44064, 0x00000000 +0, 609000, 107520, 0xe5a1596a +0, 612000, 107520, 0x8c8942eb +0, 615000, 107520, 0x8c8942eb +0, 618000, 107520, 0x5ecc379e +0, 621000, 107520, 0x5ecc379e +0, 624000, 107520, 0xea09432a +0, 627000, 107520, 0xea09432a +1, 630000, 44112, 0x00000000 +0, 630000, 107520, 0xe01e6b73 +0, 633000, 107520, 0xe01e6b73 +0, 636000, 107520, 0x1d13bba8 +0, 639000, 107520, 0x1d13bba8 +0, 642000, 107520, 0x3a993a6c +0, 645000, 107520, 0x3a993a6c +0, 648000, 107520, 0x2ede041a +0, 651000, 107520, 0x2ede041a +1, 652506, 8800, 0x00000000 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/flic-af11-palette-change b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/flic-af11-palette-change new file mode 100644 index 00000000..ac609b8f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/flic-af11-palette-change @@ -0,0 +1,116 @@ +0, 0, 192000, 0x64da83e8 +0, 2571, 192000, 0xf59ccccc +0, 5143, 192000, 0xaaa06c5c +0, 7714, 192000, 0xa98f82c0 +0, 10286, 192000, 0x164fbbdc +0, 12857, 192000, 0x0b3abc0c +0, 15429, 192000, 0x47661943 +0, 18000, 192000, 0x30711074 +0, 20571, 192000, 0x67684a84 +0, 23143, 192000, 0x1d9afa70 +0, 25714, 192000, 0x4fd28e78 +0, 28286, 192000, 0x9bc5c8cc +0, 30857, 192000, 0xcf268b6c +0, 33429, 192000, 0xdfe65fd4 +0, 36000, 192000, 0x47e75404 +0, 38571, 192000, 0xb3b5b448 +0, 41143, 192000, 0x826c94b4 +0, 43714, 192000, 0x158e95f8 +0, 46286, 192000, 0x576f031f +0, 48857, 192000, 0xea3399e8 +0, 51429, 192000, 0x76b1e224 +0, 54000, 192000, 0x290073db +0, 56571, 192000, 0x83741abf +0, 59143, 192000, 0x50f9c4ec +0, 61714, 192000, 0x6d8fdac0 +0, 64286, 192000, 0xe26e2600 +0, 66857, 192000, 0xbeb0e11c +0, 69429, 192000, 0x38282fd4 +0, 72000, 192000, 0x13d0b790 +0, 74571, 192000, 0x0cf8fca9 +0, 77143, 192000, 0x64da83e8 +0, 79714, 192000, 0xf59ccccc +0, 82286, 192000, 0xaaa06c5c +0, 84857, 192000, 0xa98f82c0 +0, 87429, 192000, 0x164fbbdc +0, 90000, 192000, 0x0b3abc0c +0, 92571, 192000, 0x47661943 +0, 95143, 192000, 0x30711074 +0, 97714, 192000, 0x67684a84 +0, 100286, 192000, 0x1d9afa70 +0, 102857, 192000, 0x4fd28e78 +0, 105429, 192000, 0x9bc5c8cc +0, 108000, 192000, 0xcf268b6c +0, 110571, 192000, 0xdfe65fd4 +0, 113143, 192000, 0x47e75404 +0, 115714, 192000, 0xb3b5b448 +0, 118286, 192000, 0x826c94b4 +0, 120857, 192000, 0x158e95f8 +0, 123429, 192000, 0x576f031f +0, 126000, 192000, 0xea3399e8 +0, 128571, 192000, 0x76b1e224 +0, 131143, 192000, 0x290073db +0, 133714, 192000, 0x83741abf +0, 136286, 192000, 0x50f9c4ec +0, 138857, 192000, 0x6d8fdac0 +0, 141429, 192000, 0xe26e2600 +0, 144000, 192000, 0xbeb0e11c +0, 146571, 192000, 0x38282fd4 +0, 149143, 192000, 0x13d0b790 +0, 151714, 192000, 0x0cf8fca9 +0, 154286, 192000, 0x64da83e8 +0, 156857, 192000, 0xf59ccccc +0, 159429, 192000, 0xaaa06c5c +0, 162000, 192000, 0xa98f82c0 +0, 164571, 192000, 0x164fbbdc +0, 167143, 192000, 0x0b3abc0c +0, 169714, 192000, 0x47661943 +0, 172286, 192000, 0x30711074 +0, 174857, 192000, 0x67684a84 +0, 177429, 192000, 0x1d9afa70 +0, 180000, 192000, 0x4fd28e78 +0, 182571, 192000, 0x9bc5c8cc +0, 185143, 192000, 0xcf268b6c +0, 187714, 192000, 0xdfe65fd4 +0, 190286, 192000, 0x47e75404 +0, 192857, 192000, 0xb3b5b448 +0, 195429, 192000, 0x826c94b4 +0, 198000, 192000, 0x158e95f8 +0, 200571, 192000, 0x576f031f +0, 203143, 192000, 0xea3399e8 +0, 205714, 192000, 0x76b1e224 +0, 208286, 192000, 0x290073db +0, 210857, 192000, 0x83741abf +0, 213429, 192000, 0x50f9c4ec +0, 216000, 192000, 0x6d8fdac0 +0, 218571, 192000, 0xe26e2600 +0, 221143, 192000, 0xbeb0e11c +0, 223714, 192000, 0x38282fd4 +0, 226286, 192000, 0x13d0b790 +0, 228857, 192000, 0x0cf8fca9 +0, 231429, 192000, 0xfcb10883 +0, 234000, 192000, 0xfcb10883 +0, 236571, 192000, 0xd0ba80c4 +0, 239143, 192000, 0xd0ba80c4 +0, 241714, 192000, 0x690520d9 +0, 244286, 192000, 0x690520d9 +0, 246857, 192000, 0x5b621c3f +0, 249429, 192000, 0x5b621c3f +0, 252000, 192000, 0x689e231f +0, 254571, 192000, 0x689e231f +0, 257143, 192000, 0x20653ff2 +0, 259714, 192000, 0x20653ff2 +0, 262286, 192000, 0xc18b3231 +0, 264857, 192000, 0xc18b3231 +0, 267429, 192000, 0x6d87ec3d +0, 270000, 192000, 0x6d87ec3d +0, 272571, 192000, 0x1c5b53d6 +0, 275143, 192000, 0x1c5b53d6 +0, 277714, 192000, 0x152fdf12 +0, 280286, 192000, 0xde187291 +0, 282857, 192000, 0x167617a5 +0, 285429, 192000, 0x5067b8de +0, 288000, 192000, 0xd02ae54e +0, 290571, 192000, 0x0d6e9402 +0, 293143, 192000, 0xa8e98616 +0, 295714, 192000, 0x04762d1a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/flic-af12 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/flic-af12 new file mode 100644 index 00000000..4c3c5359 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/flic-af12 @@ -0,0 +1,27 @@ +0, 0, 921600, 0x50a87396 +0, 6480, 921600, 0xa6e65d9e +0, 12960, 921600, 0x05956f62 +0, 19440, 921600, 0xffd6a5d7 +0, 25920, 921600, 0xaab0a179 +0, 32400, 921600, 0x289db2db +0, 38880, 921600, 0x3d3840cf +0, 45360, 921600, 0xec0a4142 +0, 51840, 921600, 0x713a9f65 +0, 58320, 921600, 0x28a8f0cd +0, 64800, 921600, 0x0fd95ba9 +0, 71280, 921600, 0xa744bdfd +0, 77760, 921600, 0x3cdea2a5 +0, 84240, 921600, 0xe7d671e4 +0, 90720, 921600, 0x75824cdf +0, 97200, 921600, 0x82067d95 +0, 103680, 921600, 0xee143a4c +0, 110160, 921600, 0xa53d3f2b +0, 116640, 921600, 0xb491c0c5 +0, 123120, 921600, 0x6aaaef07 +0, 129600, 921600, 0xad23cca8 +0, 136080, 921600, 0xdce91bd8 +0, 142560, 921600, 0x1a1499bc +0, 149040, 921600, 0x4cbe505a +0, 155520, 921600, 0x24006f65 +0, 162000, 921600, 0x0711906e +0, 168480, 921600, 0x50a87396 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/flic-magiccarpet b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/flic-magiccarpet new file mode 100644 index 00000000..a7d9ab9c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/flic-magiccarpet @@ -0,0 +1,42 @@ +0, 0, 192000, 0x00000000 +0, 6429, 192000, 0x9c057d9c +0, 12857, 192000, 0xab1aacaf +0, 19286, 192000, 0x49a1dccd +0, 25714, 192000, 0xebb7e245 +0, 32143, 192000, 0x6287759e +0, 38571, 192000, 0xbf007410 +0, 45000, 192000, 0x6c72b247 +0, 51429, 192000, 0x4c26a8c3 +0, 57857, 192000, 0x99f06050 +0, 64286, 192000, 0x663f2d23 +0, 70714, 192000, 0x813c3a1f +0, 77143, 192000, 0x6d6cfbe7 +0, 83571, 192000, 0x7b04163a +0, 90000, 192000, 0x6792e679 +0, 96429, 192000, 0x939ac626 +0, 102857, 192000, 0xc7a139c0 +0, 109286, 192000, 0xcac7ef0c +0, 115714, 192000, 0xf4ec59e0 +0, 122143, 192000, 0x56060f59 +0, 128571, 192000, 0xf45ecb3b +0, 135000, 192000, 0xe7e634ff +0, 141429, 192000, 0x7ac04aa4 +0, 147857, 192000, 0x4eaba5a1 +0, 154286, 192000, 0x89b84e25 +0, 160714, 192000, 0xc368ec1e +0, 167143, 192000, 0xeeafb59e +0, 173571, 192000, 0x0b630619 +0, 180000, 192000, 0x59cb8954 +0, 186429, 192000, 0x16b2875f +0, 192857, 192000, 0x524e32bd +0, 199286, 192000, 0x96000ba2 +0, 205714, 192000, 0x18ec28af +0, 212143, 192000, 0x2609c56c +0, 218571, 192000, 0xff25bb5a +0, 225000, 192000, 0xb19a8819 +0, 231429, 192000, 0xa5ff8727 +0, 237857, 192000, 0xe83f6289 +0, 244286, 192000, 0xc6cb4903 +0, 250714, 192000, 0xa4d93eb5 +0, 257143, 192000, 0xec84ef6c +0, 263571, 192000, 0x00000000 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v0 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v0 new file mode 100644 index 00000000..bcf6e2ec --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v0 @@ -0,0 +1,20 @@ +0, 0, 101088, 0x7bf448f8 +0, 3600, 101088, 0x1ba749ec +0, 7200, 101088, 0x94eb4dc4 +0, 10800, 101088, 0xd80b4f54 +0, 14400, 101088, 0x6fd44fff +0, 18000, 101088, 0xf30e4f12 +0, 21600, 101088, 0x67a04fef +0, 25200, 101088, 0xd92b4f8e +0, 28800, 101088, 0x92cd4cde +0, 32400, 101088, 0x93a34973 +0, 36000, 101088, 0x79a646cb +0, 39600, 101088, 0x5d9c4227 +0, 43200, 101088, 0x239941ff +0, 46800, 101088, 0x147e11de +0, 50400, 101088, 0x3943cbd5 +0, 54000, 101088, 0x2ce1c01f +0, 57600, 101088, 0xe0b7ec06 +0, 61200, 101088, 0xfe5b9baa +0, 64800, 101088, 0x9acb4d37 +0, 68400, 101088, 0xbdbd9af5 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v1 new file mode 100644 index 00000000..7d09310a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v1 @@ -0,0 +1 @@ +0, 0, 230400, 0x6bc891ff diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v2 new file mode 100644 index 00000000..63a01f20 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v2 @@ -0,0 +1,10 @@ +0, 0, 1179648, 0x99f80436 +0, 3000, 1179648, 0x99f80436 +0, 6000, 1179648, 0x99f80436 +0, 9000, 1179648, 0x99f80436 +0, 12000, 1179648, 0x99f80436 +0, 15000, 1179648, 0xe8ae7a30 +0, 18000, 1179648, 0xe8ae7a30 +0, 21000, 1179648, 0xe8ae7a30 +0, 24000, 1179648, 0xe8ae7a30 +0, 27000, 1179648, 0xe8ae7a30 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v3 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v3 new file mode 100644 index 00000000..ba662067 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v3 @@ -0,0 +1,9 @@ +0, 0, 589824, 0x0b181bbf +0, 3000, 589824, 0xcd740f79 +0, 6000, 589824, 0x16f8f90e +0, 9000, 589824, 0x1aaaceba +0, 12000, 589824, 0x1aaaceba +0, 15000, 589824, 0x902e8fe4 +0, 18000, 589824, 0x019a4443 +0, 21000, 589824, 0x019a4443 +0, 24000, 589824, 0x04eff6c6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v4 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v4 new file mode 100644 index 00000000..4c9377e8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v4 @@ -0,0 +1,7 @@ +0, 0, 491520, 0x68ff12c0 +0, 3000, 491520, 0x22d36f0d +0, 6000, 491520, 0xce6f877d +0, 9000, 491520, 0x85d6744c +0, 12000, 491520, 0x1aa85794 +0, 15000, 491520, 0x528d1274 +0, 18000, 491520, 0x357ec61c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v5 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v5 new file mode 100644 index 00000000..3fe1c493 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/fraps-v5 @@ -0,0 +1,58 @@ +0, 0, 145152, 0x8458d4cb +0, 3000, 145152, 0xa694d7c7 +0, 6000, 145152, 0x2bd4bfc9 +0, 9000, 145152, 0xe53b1616 +0, 12000, 145152, 0x6a0a806a +0, 15000, 145152, 0x45f7b8e6 +0, 18000, 145152, 0x4e14150e +0, 21000, 145152, 0xe1cd9b6f +0, 24000, 145152, 0x5b5802d7 +0, 27000, 145152, 0xb03da5e7 +0, 30000, 145152, 0x3436b06e +0, 33000, 145152, 0x4535e638 +0, 36000, 145152, 0x72934af1 +0, 39000, 145152, 0xb672d459 +0, 42000, 145152, 0xab57491b +0, 45000, 145152, 0xdbac3480 +0, 48000, 145152, 0x54215962 +0, 51000, 145152, 0x451f456e +0, 54000, 145152, 0xa17655d1 +0, 57000, 145152, 0xce95422c +0, 60000, 145152, 0xe0ee8e77 +0, 63000, 145152, 0xdaabe277 +0, 66000, 145152, 0xc21bb665 +0, 69000, 145152, 0x1e74270e +0, 72000, 145152, 0xae7bac5f +0, 75000, 145152, 0xf62442ed +0, 78000, 145152, 0x5c8d8984 +0, 81000, 145152, 0x97a69fe7 +0, 84000, 145152, 0x1f244d19 +0, 87000, 145152, 0x2758bc25 +0, 90000, 145152, 0xf43ddb89 +0, 93000, 145152, 0x086a524e +0, 96000, 145152, 0x8b464d4d +0, 99000, 145152, 0xb77b63d2 +0, 102000, 145152, 0xfd842fa8 +0, 105000, 145152, 0xa98b6dbe +0, 108000, 145152, 0xdedbab2c +0, 111000, 145152, 0x24e19172 +0, 114000, 145152, 0x1ef456f6 +0, 117000, 145152, 0xaceabdf0 +0, 120000, 145152, 0xb54de3d9 +0, 123000, 145152, 0x3af0df9b +0, 126000, 145152, 0xf89fbd9a +0, 129000, 145152, 0xc6a9673c +0, 132000, 145152, 0x6d5a929e +0, 135000, 145152, 0x879e7d9b +0, 138000, 145152, 0x233c14eb +0, 141000, 145152, 0x8246f081 +0, 144000, 145152, 0x3366c4bf +0, 147000, 145152, 0x6b0203da +0, 150000, 145152, 0x48a00163 +0, 153000, 145152, 0xe956ac2c +0, 156000, 145152, 0xa2511283 +0, 159000, 145152, 0x7e03222d +0, 162000, 145152, 0xc31a7a40 +0, 165000, 145152, 0x80448031 +0, 168000, 145152, 0xe3b1fbf7 +0, 171000, 145152, 0xa00395a4 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/frwu b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/frwu new file mode 100644 index 00000000..6877b8bc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/frwu @@ -0,0 +1,10 @@ +0, 0, 153600, 0x050422c0 +0, 6000, 153600, 0x0cf35359 +0, 12000, 153600, 0x2ae95db0 +0, 18000, 153600, 0x8c855b14 +0, 24000, 153600, 0xc7a890b4 +0, 30000, 153600, 0x755bed3b +0, 36000, 153600, 0x454a4e27 +0, 42000, 153600, 0xdc3eaecb +0, 48000, 153600, 0x190f9a82 +0, 54000, 153600, 0x4f67511f diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/funcom-iss b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/funcom-iss new file mode 100644 index 00000000..341ef246 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/funcom-iss @@ -0,0 +1 @@ +816ca37c22e42f488fd787e3155e59ff diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/g722dec-1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/g722dec-1 new file mode 100644 index 00000000..4c4b2b53 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/g722dec-1 @@ -0,0 +1,167 @@ +0, 0, 4096, 0xde68394d +0, 11520, 4096, 0xa5c28cb7 +0, 23040, 4096, 0x2e3c2f23 +0, 34560, 4096, 0xd7757825 +0, 46080, 4096, 0xafd1fd61 +0, 57600, 4096, 0x686afcbe +0, 69120, 4096, 0x2290e848 +0, 80640, 4096, 0xddd484ad +0, 92160, 4096, 0x148811a6 +0, 103680, 4096, 0x8b965613 +0, 115200, 4096, 0x8b095d51 +0, 126720, 4096, 0xf7625485 +0, 138240, 4096, 0x982a688c +0, 149760, 4096, 0xc290dcfc +0, 161280, 4096, 0x8bdef225 +0, 172800, 4096, 0xfca27fdc +0, 184320, 4096, 0x95eff313 +0, 195840, 4096, 0x691ed4f7 +0, 207360, 4096, 0xd7e7b492 +0, 218880, 4096, 0xb0416bfe +0, 230400, 4096, 0xf94b3ebd +0, 241920, 4096, 0x7f73ca12 +0, 253440, 4096, 0xe91da4a3 +0, 264960, 4096, 0x1f74dc0e +0, 276480, 4096, 0xd95b35e8 +0, 288000, 4096, 0x6dcdde1a +0, 299520, 4096, 0x614fd4e4 +0, 311040, 4096, 0xe38d0fd5 +0, 322560, 4096, 0xfeba2999 +0, 334080, 4096, 0x1bf541e1 +0, 345600, 4096, 0x689f50d8 +0, 357120, 4096, 0x0aa60f5f +0, 368640, 4096, 0x60ac3116 +0, 380160, 4096, 0xfa60e5e6 +0, 391680, 4096, 0xc7207c5b +0, 403200, 4096, 0x01196277 +0, 414720, 4096, 0x609ca46c +0, 426240, 4096, 0xfb799142 +0, 437760, 4096, 0x720910df +0, 449280, 4096, 0xe21a8662 +0, 460800, 4096, 0x07105120 +0, 472320, 4096, 0x593f627e +0, 483840, 4096, 0x28ddc80c +0, 495360, 4096, 0xc69ef356 +0, 506880, 4096, 0x2defc5bd +0, 518400, 4096, 0x82a4f418 +0, 529920, 4096, 0x424cb997 +0, 541440, 4096, 0x167a49b7 +0, 552960, 4096, 0x32a3e0d4 +0, 564480, 4096, 0x08a353ae +0, 576000, 4096, 0x9543577b +0, 587520, 4096, 0x2ed137cf +0, 599040, 4096, 0xd80b0538 +0, 610560, 4096, 0x2ad31bef +0, 622080, 4096, 0x1060cff8 +0, 633600, 4096, 0x76ab5ab8 +0, 645120, 4096, 0x8eedb68d +0, 656640, 4096, 0xf4e2dc46 +0, 668160, 4096, 0xc52d3326 +0, 679680, 4096, 0x25201a26 +0, 691200, 4096, 0x16419378 +0, 702720, 4096, 0x97061f3c +0, 714240, 4096, 0xd54edecd +0, 725760, 4096, 0xc830b07b +0, 737280, 4096, 0x804bae00 +0, 748800, 4096, 0xbb279150 +0, 760320, 4096, 0x95c4d5aa +0, 771840, 4096, 0xc51d5259 +0, 783360, 4096, 0x856e1ab0 +0, 794880, 4096, 0x9e6ccb12 +0, 806400, 4096, 0xa2e5c1bb +0, 817920, 4096, 0xe62fb62f +0, 829440, 4096, 0xf10e3df0 +0, 840960, 4096, 0x76def18b +0, 852480, 4096, 0xc9c3a26d +0, 864000, 4096, 0x8ec0e061 +0, 875520, 4096, 0x3d4e8512 +0, 887040, 4096, 0xec45cd46 +0, 898560, 4096, 0xa34f3ddf +0, 910080, 4096, 0x52b81c53 +0, 921600, 4096, 0xd0f0397a +0, 933120, 4096, 0x7c0de231 +0, 944640, 4096, 0xfe86c032 +0, 956160, 4096, 0x67cdb848 +0, 967680, 4096, 0x90532cc0 +0, 979200, 4096, 0x03bca9e9 +0, 990720, 4096, 0x73169fd1 +0, 1002240, 4096, 0x0b93967d +0, 1013760, 4096, 0x6486d8be +0, 1025280, 4096, 0x555cc2ac +0, 1036800, 4096, 0x07c1912e +0, 1048320, 4096, 0xe0423c66 +0, 1059840, 4096, 0xc12d0fa1 +0, 1071360, 4096, 0xdf497c2f +0, 1082880, 4096, 0x9298d1ba +0, 1094400, 4096, 0x691a4e15 +0, 1105920, 4096, 0x725adc6e +0, 1117440, 4096, 0xf68e88de +0, 1128960, 4096, 0x37a234aa +0, 1140480, 4096, 0x43fb0558 +0, 1152000, 4096, 0x653e4320 +0, 1163520, 4096, 0x651e2f13 +0, 1175040, 4096, 0x179049f9 +0, 1186560, 4096, 0xe02fbb9d +0, 1198080, 4096, 0xb7e9f2a0 +0, 1209600, 4096, 0x94ee81df +0, 1221120, 4096, 0x398a98de +0, 1232640, 4096, 0x1267594a +0, 1244160, 4096, 0x715adbaf +0, 1255680, 4096, 0x28ce1a20 +0, 1267200, 4096, 0x4f8073d0 +0, 1278720, 4096, 0x536846d3 +0, 1290240, 4096, 0x7dc7defe +0, 1301760, 4096, 0x08a28e2a +0, 1313280, 4096, 0xd717c5cd +0, 1324800, 4096, 0x5d6e1efd +0, 1336320, 4096, 0x4d0eea27 +0, 1347840, 4096, 0x70fff90c +0, 1359360, 4096, 0xd5cc8207 +0, 1370880, 4096, 0xf87cae0e +0, 1382400, 4096, 0x26814ab5 +0, 1393920, 4096, 0x9569fb8d +0, 1405440, 4096, 0x7835122e +0, 1416960, 4096, 0xa38840dd +0, 1428480, 4096, 0xfc499ba3 +0, 1440000, 4096, 0x0aa60cb0 +0, 1451520, 4096, 0x530ef56e +0, 1463040, 4096, 0xead968db +0, 1474560, 4096, 0x64484214 +0, 1486080, 4096, 0xfd0cc89e +0, 1497600, 4096, 0x0d452a5d +0, 1509120, 4096, 0x36ef8482 +0, 1520640, 4096, 0x462b641b +0, 1532160, 4096, 0x2a5c1c0c +0, 1543680, 4096, 0x8837ff80 +0, 1555200, 4096, 0x27a3de22 +0, 1566720, 4096, 0xf88d28c1 +0, 1578240, 4096, 0xed85ea97 +0, 1589760, 4096, 0x50c3e7db +0, 1601280, 4096, 0x82bcb480 +0, 1612800, 4096, 0xc50ee536 +0, 1624320, 4096, 0x086280ee +0, 1635840, 4096, 0x6f18f2b2 +0, 1647360, 4096, 0x1c7c0856 +0, 1658880, 4096, 0xc576268a +0, 1670400, 4096, 0x7a9af56d +0, 1681920, 4096, 0x6d058fc5 +0, 1693440, 4096, 0x8fb1107b +0, 1704960, 4096, 0x807588d1 +0, 1716480, 4096, 0x56178443 +0, 1728000, 4096, 0xf2460763 +0, 1739520, 4096, 0x284255f2 +0, 1751040, 4096, 0xb29d17fb +0, 1762560, 4096, 0x5e7e4633 +0, 1774080, 4096, 0x57704db1 +0, 1785600, 4096, 0xd87dcc1d +0, 1797120, 4096, 0x28d4bb93 +0, 1808640, 4096, 0x3a2e5c6c +0, 1820160, 4096, 0xf3581656 +0, 1831680, 4096, 0x42f1942f +0, 1843200, 4096, 0xe75c5092 +0, 1854720, 4096, 0x3fae7f6d +0, 1866240, 4096, 0xf99ad73e +0, 1877760, 4096, 0x80564e3e +0, 1889280, 4096, 0x8ff6ebe5 +0, 1900800, 4096, 0x436d5e69 +0, 1912320, 1368, 0xe0ebeda3 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/gsm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/gsm new file mode 100644 index 00000000..89f87d42 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/gsm @@ -0,0 +1,500 @@ +0, 0, 320, 0x4c32ab06 +0, 1800, 320, 0x2052a4e7 +0, 3600, 320, 0xe9aeafca +0, 5400, 320, 0xde83b450 +0, 7200, 320, 0x06a6a80e +0, 9000, 320, 0xf6aeb1e2 +0, 10800, 320, 0x2623b40c +0, 12600, 320, 0x8ec69f25 +0, 14400, 320, 0xddaaac88 +0, 16200, 320, 0x9e60b713 +0, 18000, 320, 0xb738ab30 +0, 19800, 320, 0xdb4bbb92 +0, 21600, 320, 0x0370ae8b +0, 23400, 320, 0xb611a3fb +0, 25200, 320, 0x07ee8e3b +0, 27000, 320, 0xdb1ec628 +0, 28800, 320, 0xd5f1bda2 +0, 30600, 320, 0xcabb9a9c +0, 32400, 320, 0x16c8ad61 +0, 34200, 320, 0xf76fc25e +0, 36000, 320, 0x7118a10d +0, 37800, 320, 0x29f9a0db +0, 39600, 320, 0x41f2a4ef +0, 41400, 320, 0x36dfb231 +0, 43200, 320, 0xc5399eda +0, 45000, 320, 0x17d4b9e0 +0, 46800, 320, 0x2b5797ac +0, 48600, 320, 0x0128c5e7 +0, 50400, 320, 0xf4f38037 +0, 52200, 320, 0x77d6b5f2 +0, 54000, 320, 0xd94a93e0 +0, 55800, 320, 0x968daae3 +0, 57600, 320, 0xda5ba0ec +0, 59400, 320, 0x316da1ec +0, 61200, 320, 0x3a35b2d2 +0, 63000, 320, 0xca0b988f +0, 64800, 320, 0x1295b0b1 +0, 66600, 320, 0xe121ae72 +0, 68400, 320, 0x7da7ad43 +0, 70200, 320, 0x96a49cfe +0, 72000, 320, 0x70c2b1de +0, 73800, 320, 0x668d88c0 +0, 75600, 320, 0x5460b5a8 +0, 77400, 320, 0x6ac78eab +0, 79200, 320, 0x0d8dab87 +0, 81000, 320, 0xe2be94af +0, 82800, 320, 0x3487acdc +0, 84600, 320, 0x5048955a +0, 86400, 320, 0x2ef4ae0d +0, 88200, 320, 0xc765b773 +0, 90000, 320, 0xad96a486 +0, 91800, 320, 0xb9fdbf1f +0, 93600, 320, 0xf26c9ecf +0, 95400, 320, 0xbcadb535 +0, 97200, 320, 0xa8c897bc +0, 99000, 320, 0xaa58b520 +0, 100800, 320, 0xcb48a716 +0, 102600, 320, 0x4d5da564 +0, 104400, 320, 0x9809ae28 +0, 106200, 320, 0x5baeb1e4 +0, 108000, 320, 0x6a719b63 +0, 109800, 320, 0xc27d92f0 +0, 111600, 320, 0x0e9b9fe9 +0, 113400, 320, 0xbf9d9bf7 +0, 115200, 320, 0xf35aa64d +0, 117000, 320, 0x26449ce8 +0, 118800, 320, 0x58f4a997 +0, 120600, 320, 0x155da289 +0, 122400, 320, 0x63b19a5c +0, 124200, 320, 0xe01aad38 +0, 126000, 320, 0x4e0f9c43 +0, 127800, 320, 0x9447a284 +0, 129600, 320, 0xdb36a433 +0, 131400, 320, 0x799a9b2c +0, 133200, 320, 0x1526a162 +0, 135000, 320, 0x0a4ea140 +0, 136800, 320, 0xb08f9ed7 +0, 138600, 320, 0x221bab76 +0, 140400, 320, 0x4befacf0 +0, 142200, 320, 0xac489509 +0, 144000, 320, 0x57a1a5b4 +0, 145800, 320, 0x81e8ab97 +0, 147600, 320, 0xc6ada4d6 +0, 149400, 320, 0x12489975 +0, 151200, 320, 0x1da59ba9 +0, 153000, 320, 0xf225ac62 +0, 154800, 320, 0x8c8e9eab +0, 156600, 320, 0x10599dec +0, 158400, 320, 0x06c39fa5 +0, 160200, 320, 0xb0efa3c4 +0, 162000, 320, 0x72caadab +0, 163800, 320, 0xe4619ff0 +0, 165600, 320, 0x49bca017 +0, 167400, 320, 0x413f9fbe +0, 169200, 320, 0x6eaed0ee +0, 171000, 320, 0x27e4b1eb +0, 172800, 320, 0x8c42a30f +0, 174600, 320, 0x0afaa0f4 +0, 176400, 320, 0x0f74b76b +0, 178200, 320, 0xa9a2b9d5 +0, 180000, 320, 0xde2a8712 +0, 181800, 320, 0xcfc8b3a2 +0, 183600, 320, 0x768cadce +0, 185400, 320, 0x3a8a97f1 +0, 187200, 320, 0x502fa59b +0, 189000, 320, 0x4c3e9b0f +0, 190800, 320, 0x1cd2b111 +0, 192600, 320, 0xa845a5a3 +0, 194400, 320, 0xa6b8b982 +0, 196200, 320, 0x4d5caab9 +0, 198000, 320, 0x7993b604 +0, 199800, 320, 0x8d19b37b +0, 201600, 320, 0xbe48adb6 +0, 203400, 320, 0x7d68ab8e +0, 205200, 320, 0xbfffb0e2 +0, 207000, 320, 0x90b5b7e3 +0, 208800, 320, 0x9fa1b016 +0, 210600, 320, 0x70abafc9 +0, 212400, 320, 0x82cfad9c +0, 214200, 320, 0x05f6aa2c +0, 216000, 320, 0x511cbb5b +0, 217800, 320, 0xd27caaa6 +0, 219600, 320, 0x781ca481 +0, 221400, 320, 0x12e9ad1a +0, 223200, 320, 0xe46b989d +0, 225000, 320, 0x76dbb0a7 +0, 226800, 320, 0x10eba486 +0, 228600, 320, 0x2269a7c8 +0, 230400, 320, 0x084a9c7e +0, 232200, 320, 0x84eda891 +0, 234000, 320, 0x2ef9a639 +0, 235800, 320, 0x8bb2a0dd +0, 237600, 320, 0x47e5a169 +0, 239400, 320, 0x98faae42 +0, 241200, 320, 0x81d2aba4 +0, 243000, 320, 0x5af8bb33 +0, 244800, 320, 0x331e8d9f +0, 246600, 320, 0xd9b0c09a +0, 248400, 320, 0xbaf9bfcf +0, 250200, 320, 0x54e89ab5 +0, 252000, 320, 0x1d62c1d2 +0, 253800, 320, 0xead6b436 +0, 255600, 320, 0x465f98bc +0, 257400, 320, 0xe707a346 +0, 259200, 320, 0xf66cb1c2 +0, 261000, 320, 0xcfc89ae6 +0, 262800, 320, 0x0b10b796 +0, 264600, 320, 0xb29caf2c +0, 266400, 320, 0x0284a9d1 +0, 268200, 320, 0xb966b5fc +0, 270000, 320, 0x2defa630 +0, 271800, 320, 0xcdcd8ef3 +0, 273600, 320, 0xa81bba2b +0, 275400, 320, 0x6bc0aeb1 +0, 277200, 320, 0x38d8ac82 +0, 279000, 320, 0xeb66a865 +0, 280800, 320, 0x4fff9cd9 +0, 282600, 320, 0x6819a19b +0, 284400, 320, 0xfd7c93ce +0, 286200, 320, 0xa7419f63 +0, 288000, 320, 0x572caacb +0, 289800, 320, 0x918fb1de +0, 291600, 320, 0x0088a675 +0, 293400, 320, 0x19229cf7 +0, 295200, 320, 0x827ea812 +0, 297000, 320, 0x6c258ef7 +0, 298800, 320, 0x6a89b8fe +0, 300600, 320, 0x166c9ce0 +0, 302400, 320, 0x68b39db7 +0, 304200, 320, 0x3d5aa8ec +0, 306000, 320, 0x25e09ff3 +0, 307800, 320, 0x759aa4ce +0, 309600, 320, 0xe5aab0ea +0, 311400, 320, 0xf0359e9a +0, 313200, 320, 0x51199fff +0, 315000, 320, 0xb04aa236 +0, 316800, 320, 0xe09da0e3 +0, 318600, 320, 0x144f98a9 +0, 320400, 320, 0x0b4e9f8d +0, 322200, 320, 0xbb69a090 +0, 324000, 320, 0xec6e9b5b +0, 325800, 320, 0x4f86a477 +0, 327600, 320, 0x4a179d04 +0, 329400, 320, 0x9682a375 +0, 331200, 320, 0x3c6ba55e +0, 333000, 320, 0x50c0ab50 +0, 334800, 320, 0xe58ea907 +0, 336600, 320, 0xc5eaa021 +0, 338400, 320, 0x38859f01 +0, 340200, 320, 0x73f8a540 +0, 342000, 320, 0x395da234 +0, 343800, 320, 0x7f50b144 +0, 345600, 320, 0x45568ceb +0, 347400, 320, 0xd0508dec +0, 349200, 320, 0x60aba7e4 +0, 351000, 320, 0x4b24b15f +0, 352800, 320, 0xbfc9afd6 +0, 354600, 320, 0xf0f2ad49 +0, 356400, 320, 0xeea0a426 +0, 358200, 320, 0xff07a7c9 +0, 360000, 320, 0xce1fc788 +0, 361800, 320, 0xc074ae9b +0, 363600, 320, 0x51649696 +0, 365400, 320, 0x24399744 +0, 367200, 320, 0xfb0eb920 +0, 369000, 320, 0x3bf8af5c +0, 370800, 320, 0xeab69ee0 +0, 372600, 320, 0x182696bb +0, 374400, 320, 0x36e6af72 +0, 376200, 320, 0x48cc9ecc +0, 378000, 320, 0xfb3ca7b8 +0, 379800, 320, 0xe01aa4b4 +0, 381600, 320, 0x5c6dac8c +0, 383400, 320, 0x072fbd93 +0, 385200, 320, 0xc8899ccc +0, 387000, 320, 0xdcc990ac +0, 388800, 320, 0x28e0a9d0 +0, 390600, 320, 0x0cdbaa11 +0, 392400, 320, 0x8f4ca093 +0, 394200, 320, 0x7ee79ea9 +0, 396000, 320, 0xa762b695 +0, 397800, 320, 0x9af0b5da +0, 399600, 320, 0x1f2cb0e7 +0, 401400, 320, 0x6029b8bb +0, 403200, 320, 0xf2f7acec +0, 405000, 320, 0xb3e5b5be +0, 406800, 320, 0x266ba8a6 +0, 408600, 320, 0x4ff59296 +0, 410400, 320, 0x11d1b9ac +0, 412200, 320, 0x749197f7 +0, 414000, 320, 0x8192b517 +0, 415800, 320, 0xde129dbe +0, 417600, 320, 0x85e4a096 +0, 419400, 320, 0xdebf9182 +0, 421200, 320, 0x7a4ba0bf +0, 423000, 320, 0x55fe9fcd +0, 424800, 320, 0xd242adec +0, 426600, 320, 0xeaf5b159 +0, 428400, 320, 0xfcb1a571 +0, 430200, 320, 0x62fabda0 +0, 432000, 320, 0x45a9abcc +0, 433800, 320, 0x07af974b +0, 435600, 320, 0xc2a0b4fd +0, 437400, 320, 0xc30abccd +0, 439200, 320, 0xd33ca61c +0, 441000, 320, 0x3c33d11a +0, 442800, 320, 0x9c2ca0ac +0, 444600, 320, 0xa5d69777 +0, 446400, 320, 0xb7d2c6b8 +0, 448200, 320, 0x34bbaab9 +0, 450000, 320, 0x3e7baccb +0, 451800, 320, 0x92c6b7e6 +0, 453600, 320, 0xc810a18a +0, 455400, 320, 0x06a09f56 +0, 457200, 320, 0x8804a504 +0, 459000, 320, 0x783ba7d5 +0, 460800, 320, 0x24dcada6 +0, 462600, 320, 0x4af796be +0, 464400, 320, 0x1454b19c +0, 466200, 320, 0x0ad0a56e +0, 468000, 320, 0x8944a44e +0, 469800, 320, 0x31069ebd +0, 471600, 320, 0x19cb9812 +0, 473400, 320, 0xac75abe2 +0, 475200, 320, 0x0162a200 +0, 477000, 320, 0xa2d7a4b2 +0, 478800, 320, 0x078ca611 +0, 480600, 320, 0x0ec39b40 +0, 482400, 320, 0xe8f794b2 +0, 484200, 320, 0xc2cfb258 +0, 486000, 320, 0xe4759061 +0, 487800, 320, 0xb1b6aea4 +0, 489600, 320, 0x9bfb96df +0, 491400, 320, 0xcc61b5d3 +0, 493200, 320, 0xd14e8df9 +0, 495000, 320, 0xd9d5bbf5 +0, 496800, 320, 0x4d9fa9b0 +0, 498600, 320, 0xf606abfc +0, 500400, 320, 0x720baa19 +0, 502200, 320, 0x7f7cac49 +0, 504000, 320, 0xceab9b54 +0, 505800, 320, 0x645fa70a +0, 507600, 320, 0xa081a40f +0, 509400, 320, 0x21d78f8c +0, 511200, 320, 0xedf3abc6 +0, 513000, 320, 0x17679637 +0, 514800, 320, 0x1cb1ae04 +0, 516600, 320, 0x17cd9f62 +0, 518400, 320, 0xf4bca3ab +0, 520200, 320, 0xb3bd9152 +0, 522000, 320, 0x4e1e9825 +0, 523800, 320, 0x037e9a56 +0, 525600, 320, 0xd7589fcc +0, 527400, 320, 0x5f949e90 +0, 529200, 320, 0xe133a495 +0, 531000, 320, 0x7cb7a52c +0, 532800, 320, 0xb8b29d95 +0, 534600, 320, 0x01bca472 +0, 536400, 320, 0xbcc69895 +0, 538200, 320, 0xabffa0ee +0, 540000, 320, 0xe6629eca +0, 541800, 320, 0x572da7cd +0, 543600, 320, 0x3017972d +0, 545400, 320, 0xac4e9c78 +0, 547200, 320, 0x112f9c45 +0, 549000, 320, 0x05e9a64d +0, 550800, 320, 0x8f7394d4 +0, 552600, 320, 0xbaeea07e +0, 554400, 320, 0xd757c00e +0, 556200, 320, 0x8aa09783 +0, 558000, 320, 0x31d4ae7a +0, 559800, 320, 0x221493e8 +0, 561600, 320, 0x92f4a3a7 +0, 563400, 320, 0xbd5bafd9 +0, 565200, 320, 0x1895b760 +0, 567000, 320, 0x7a4eacdd +0, 568800, 320, 0xc9f7a1c3 +0, 570600, 320, 0xd750be06 +0, 572400, 320, 0x641d9a6f +0, 574200, 320, 0x70d6b6ff +0, 576000, 320, 0x1fd3a546 +0, 577800, 320, 0x72cfaabe +0, 579600, 320, 0x2e61b6ce +0, 581400, 320, 0x4813a091 +0, 583200, 320, 0xbfe7bc0f +0, 585000, 320, 0x8c759c1f +0, 586800, 320, 0xf4c1c952 +0, 588600, 320, 0x00fdaa79 +0, 590400, 320, 0x2ffda252 +0, 592200, 320, 0x841aa523 +0, 594000, 320, 0x8c079e5e +0, 595800, 320, 0x96e9a83f +0, 597600, 320, 0x5926a639 +0, 599400, 320, 0x02e1a07b +0, 601200, 320, 0x2972a999 +0, 603000, 320, 0x30c89c62 +0, 604800, 320, 0x83f5a263 +0, 606600, 320, 0xa3909667 +0, 608400, 320, 0xd5309fd4 +0, 610200, 320, 0x3154a571 +0, 612000, 320, 0x51039a5e +0, 613800, 320, 0xf167a344 +0, 615600, 320, 0x8e709d7d +0, 617400, 320, 0x936fa0fd +0, 619200, 320, 0x024b9e3c +0, 621000, 320, 0x2ea1aa75 +0, 622800, 320, 0x33f0a2bb +0, 624600, 320, 0xbf079d2d +0, 626400, 320, 0x847ba2c8 +0, 628200, 320, 0x37e1a767 +0, 630000, 320, 0xb607acbb +0, 631800, 320, 0x1288ac6d +0, 633600, 320, 0xf60e98b3 +0, 635400, 320, 0xc6b5abdd +0, 637200, 320, 0x7feaa710 +0, 639000, 320, 0x77329fcd +0, 640800, 320, 0x91a6a715 +0, 642600, 320, 0xd0e99f24 +0, 644400, 320, 0x07089f61 +0, 646200, 320, 0x2bbda900 +0, 648000, 320, 0xad3da0d5 +0, 649800, 320, 0x997ba6d2 +0, 651600, 320, 0xb15b9dcb +0, 653400, 320, 0x17cea82f +0, 655200, 320, 0xab51a73e +0, 657000, 320, 0x77a1abd6 +0, 658800, 320, 0x0bddacad +0, 660600, 320, 0x43b3bdc4 +0, 662400, 320, 0xefe0a9ba +0, 664200, 320, 0x8eb4bc2f +0, 666000, 320, 0x39cdc190 +0, 667800, 320, 0x1ef3baff +0, 669600, 320, 0x1a6ab7e2 +0, 671400, 320, 0x444ccc69 +0, 673200, 320, 0x05ebb598 +0, 675000, 320, 0x4ac5b0ad +0, 676800, 320, 0x0ee5ba52 +0, 678600, 320, 0x501d9fa0 +0, 680400, 320, 0x2038a9f4 +0, 682200, 320, 0xa61cb8b3 +0, 684000, 320, 0xdd009777 +0, 685800, 320, 0x2a2db86d +0, 687600, 320, 0xe9bab3bc +0, 689400, 320, 0xf7f8a056 +0, 691200, 320, 0x514caf14 +0, 693000, 320, 0xa220b149 +0, 694800, 320, 0xbf7ea183 +0, 696600, 320, 0x1d8dc5c6 +0, 698400, 320, 0x9182a8ea +0, 700200, 320, 0x31eba026 +0, 702000, 320, 0xcfbcc3df +0, 703800, 320, 0x3d8cb7ae +0, 705600, 320, 0xbe39aec0 +0, 707400, 320, 0xd236bf71 +0, 709200, 320, 0x9377b0b2 +0, 711000, 320, 0xb5e6b2df +0, 712800, 320, 0xa3b9bbce +0, 714600, 320, 0xa7bda251 +0, 716400, 320, 0xbf9ab162 +0, 718200, 320, 0x6928b9cb +0, 720000, 320, 0xf5cca209 +0, 721800, 320, 0xfdf4afad +0, 723600, 320, 0xe7e7c216 +0, 725400, 320, 0x0c5797c6 +0, 727200, 320, 0x66c1a9ca +0, 729000, 320, 0x6b5ca48d +0, 730800, 320, 0xec04968a +0, 732600, 320, 0xaaada691 +0, 734400, 320, 0x77c3a624 +0, 736200, 320, 0xaed9a5d5 +0, 738000, 320, 0x360fac41 +0, 739800, 320, 0xa05ea727 +0, 741600, 320, 0x9f7b9f83 +0, 743400, 320, 0x474bc4c2 +0, 745200, 320, 0xb6078d3b +0, 747000, 320, 0x8e15a8f9 +0, 748800, 320, 0x7dc7d4a8 +0, 750600, 320, 0x55ceab6b +0, 752400, 320, 0x982cc94f +0, 754200, 320, 0x6153948f +0, 756000, 320, 0x5338c621 +0, 757800, 320, 0x2e2db6e8 +0, 759600, 320, 0x28e3a9c3 +0, 761400, 320, 0x74d7b435 +0, 763200, 320, 0xcf17a10c +0, 765000, 320, 0xf1f9ac8c +0, 766800, 320, 0x35e0b480 +0, 768600, 320, 0x5e60b3a4 +0, 770400, 320, 0x20579b26 +0, 772200, 320, 0x3e27b89b +0, 774000, 320, 0x02e4af94 +0, 775800, 320, 0x6d6897f1 +0, 777600, 320, 0x1582b267 +0, 779400, 320, 0x33ba9eb3 +0, 781200, 320, 0xb6acad7d +0, 783000, 320, 0x1969a6c2 +0, 784800, 320, 0x363fa350 +0, 786600, 320, 0xae50bf65 +0, 788400, 320, 0x0877a50f +0, 790200, 320, 0x66e2a42f +0, 792000, 320, 0x0b0abcb3 +0, 793800, 320, 0x23a9afaa +0, 795600, 320, 0xc3729b40 +0, 797400, 320, 0xdd3fc7e2 +0, 799200, 320, 0x7e0494af +0, 801000, 320, 0xcbd096fb +0, 802800, 320, 0x5d71b303 +0, 804600, 320, 0xeedca04a +0, 806400, 320, 0x2836a47d +0, 808200, 320, 0x7237c2a0 +0, 810000, 320, 0x7c009bc0 +0, 811800, 320, 0xc9dcb366 +0, 813600, 320, 0x4993aac8 +0, 815400, 320, 0x05ec9954 +0, 817200, 320, 0xa955bd5c +0, 819000, 320, 0x9018aea3 +0, 820800, 320, 0x780cca52 +0, 822600, 320, 0x9b8f95f6 +0, 824400, 320, 0xcd7bb178 +0, 826200, 320, 0xfec6b443 +0, 828000, 320, 0xe214abb6 +0, 829800, 320, 0xdcbebb38 +0, 831600, 320, 0xe683a30d +0, 833400, 320, 0xe4cdb197 +0, 835200, 320, 0xa426c432 +0, 837000, 320, 0x761ba6cc +0, 838800, 320, 0xcc9aa6aa +0, 840600, 320, 0x742bd03d +0, 842400, 320, 0x61d9a511 +0, 844200, 320, 0x3021a4dd +0, 846000, 320, 0x6970bbc0 +0, 847800, 320, 0x76f5a037 +0, 849600, 320, 0x758d91f2 +0, 851400, 320, 0xe854a2f1 +0, 853200, 320, 0xf994a6f8 +0, 855000, 320, 0x31ebaf40 +0, 856800, 320, 0x24699970 +0, 858600, 320, 0x37dda53e +0, 860400, 320, 0xa857a752 +0, 862200, 320, 0xc483ad1d +0, 864000, 320, 0x5966add9 +0, 865800, 320, 0x4dbab89c +0, 867600, 320, 0x2f0bb0e6 +0, 869400, 320, 0x913aaa88 +0, 871200, 320, 0x245dc1c3 +0, 873000, 320, 0xb085c5ad +0, 874800, 320, 0x9cf1b0fa +0, 876600, 320, 0x6887b543 +0, 878400, 320, 0xcad69feb +0, 880200, 320, 0xc12a8ddb +0, 882000, 320, 0x01d1bc5a +0, 883800, 320, 0x3018b7e8 +0, 885600, 320, 0x6431b0ef +0, 887400, 320, 0x3a53998e +0, 889200, 320, 0x1c80a6c6 +0, 891000, 320, 0x6639adc5 +0, 892800, 320, 0x92489f9a +0, 894600, 320, 0x8cafad00 +0, 896400, 320, 0xca0392e1 +0, 898200, 320, 0x30a9ae88 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/gsm-ms b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/gsm-ms new file mode 100644 index 00000000..76a6f295 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/gsm-ms @@ -0,0 +1,89 @@ +0, 0, 640, 0xf79c59ee +0, 3600, 640, 0x6e6248be +0, 7200, 640, 0x2a5b3aed +0, 10800, 640, 0xf7012e06 +0, 14400, 640, 0x626645cd +0, 18000, 640, 0x9f482b66 +0, 21600, 640, 0xea443886 +0, 25200, 640, 0xa79b3dc0 +0, 28800, 640, 0x0161263f +0, 32400, 640, 0x61b33154 +0, 36000, 640, 0xf7fa388c +0, 39600, 640, 0xb63038e9 +0, 43200, 640, 0x61b03506 +0, 46800, 640, 0xed4e2eac +0, 50400, 640, 0x9b8127f1 +0, 54000, 640, 0xe50627be +0, 57600, 640, 0x6b5038f9 +0, 61200, 640, 0x8e794c10 +0, 64800, 640, 0x426d2c93 +0, 68400, 640, 0x9a373111 +0, 72000, 640, 0x94132ccb +0, 75600, 640, 0x610b3788 +0, 79200, 640, 0x27204206 +0, 82800, 640, 0xbdf82268 +0, 86400, 640, 0x2e653066 +0, 90000, 640, 0xccfd2328 +0, 93600, 640, 0xf2431e04 +0, 97200, 640, 0x7b412094 +0, 100800, 640, 0x5c2635fa +0, 104400, 640, 0xdcbd2c60 +0, 108000, 640, 0x65173699 +0, 111600, 640, 0xbcff19ed +0, 115200, 640, 0xf5b2206c +0, 118800, 640, 0x587e460c +0, 122400, 640, 0x2418382d +0, 126000, 640, 0xbfad2f9b +0, 129600, 640, 0x87d92d6c +0, 133200, 640, 0xdc582c69 +0, 136800, 640, 0xcfe52ebf +0, 140400, 640, 0xe0032e70 +0, 144000, 640, 0xf8a61b57 +0, 147600, 640, 0xa9ef2ee5 +0, 151200, 640, 0x7f513313 +0, 154800, 640, 0x93731177 +0, 158400, 640, 0xed2c2340 +0, 162000, 640, 0x85b02913 +0, 165600, 640, 0xa5a92f3e +0, 169200, 640, 0x72472490 +0, 172800, 640, 0x856231fc +0, 176400, 640, 0xda2e3c22 +0, 180000, 640, 0xcce84c36 +0, 183600, 640, 0x39312c78 +0, 187200, 640, 0xf1aa2365 +0, 190800, 640, 0x1dba3f7e +0, 194400, 640, 0x21953579 +0, 198000, 640, 0xbbd52c22 +0, 201600, 640, 0x45c71537 +0, 205200, 640, 0x26051cec +0, 208800, 640, 0x27ae223e +0, 212400, 640, 0x223c0bb8 +0, 216000, 640, 0xc5b72796 +0, 219600, 640, 0xe7fd294d +0, 223200, 640, 0x19042293 +0, 226800, 640, 0xa6572c6b +0, 230400, 640, 0x58ac1d16 +0, 234000, 640, 0xd0631bd6 +0, 237600, 640, 0xe74f276c +0, 241200, 640, 0x87d0295f +0, 244800, 640, 0x054e3dc8 +0, 248400, 640, 0x0ca51c2d +0, 252000, 640, 0x17a02616 +0, 255600, 640, 0x56b2235d +0, 259200, 640, 0x1cd93302 +0, 262800, 640, 0xe3672352 +0, 266400, 640, 0xc99f2e45 +0, 270000, 640, 0x36a43e9d +0, 273600, 640, 0xfcd73e87 +0, 277200, 640, 0x813b2e20 +0, 280800, 640, 0x8f7a4cac +0, 284400, 640, 0xcf3e4106 +0, 288000, 640, 0x8a752b07 +0, 291600, 640, 0xe5013dcd +0, 295200, 640, 0xda4a3d03 +0, 298800, 640, 0x05ce2c64 +0, 302400, 640, 0x1e0f42b5 +0, 306000, 640, 0xe4bd326a +0, 309600, 640, 0x701c28de +0, 313200, 640, 0xd0b02f97 +0, 316800, 640, 0x7950419b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-aud_mw_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-aud_mw_e new file mode 100644 index 00000000..202e14ec --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-aud_mw_e @@ -0,0 +1,100 @@ +0, 0, 38016, 0xa6d63b2e +0, 3600, 38016, 0x28bae101 +0, 7200, 38016, 0x139f9b29 +0, 10800, 38016, 0xa7b463e8 +0, 14400, 38016, 0xdcdc5130 +0, 18000, 38016, 0x3cf17039 +0, 21600, 38016, 0xdeeb9ae9 +0, 25200, 38016, 0xdc8da889 +0, 28800, 38016, 0x7a32a81c +0, 32400, 38016, 0xaf15908b +0, 36000, 38016, 0x4c8b5461 +0, 39600, 38016, 0x1d4826db +0, 43200, 38016, 0x5ca72731 +0, 46800, 38016, 0xb09732e6 +0, 50400, 38016, 0xa65252eb +0, 54000, 38016, 0x09fa7644 +0, 57600, 38016, 0x5262af8f +0, 61200, 38016, 0x50d6c6ac +0, 64800, 38016, 0x6895c300 +0, 68400, 38016, 0x2d58bf4f +0, 72000, 38016, 0x50dfc4c0 +0, 75600, 38016, 0x12d2cb90 +0, 79200, 38016, 0xe465c7d7 +0, 82800, 38016, 0x47c5c615 +0, 86400, 38016, 0x76fdc6e6 +0, 90000, 38016, 0xefeec7ae +0, 93600, 38016, 0x2cebcdf7 +0, 97200, 38016, 0x49abd265 +0, 100800, 38016, 0x157bdfe4 +0, 104400, 38016, 0x3635e5da +0, 108000, 38016, 0x6263aace +0, 111600, 38016, 0x7fff72f0 +0, 115200, 38016, 0x83994b85 +0, 118800, 38016, 0xa8c990a7 +0, 122400, 38016, 0xce5204c4 +0, 126000, 38016, 0xf1176131 +0, 129600, 38016, 0x4252bdca +0, 133200, 38016, 0xd8f447c3 +0, 136800, 38016, 0xc5e79075 +0, 140400, 38016, 0x5291ca60 +0, 144000, 38016, 0x5dffe889 +0, 147600, 38016, 0x6dc4fad6 +0, 151200, 38016, 0xbcc7f16a +0, 154800, 38016, 0xcd5c059a +0, 158400, 38016, 0x452314ad +0, 162000, 38016, 0x19d1fd99 +0, 165600, 38016, 0x93f4ca3c +0, 169200, 38016, 0x23dd9d81 +0, 172800, 38016, 0x4a4cabdb +0, 176400, 38016, 0x15a3d785 +0, 180000, 38016, 0xaa34e055 +0, 183600, 38016, 0x8a34b88d +0, 187200, 38016, 0x1955d649 +0, 190800, 38016, 0xf6dc0782 +0, 194400, 38016, 0x66cb360a +0, 198000, 38016, 0xf3615cfb +0, 201600, 38016, 0xca466b6d +0, 205200, 38016, 0xe0ad3523 +0, 208800, 38016, 0x8181323e +0, 212400, 38016, 0x93324bab +0, 216000, 38016, 0xce2c38b6 +0, 219600, 38016, 0xe50a20fc +0, 223200, 38016, 0x8a74ce30 +0, 226800, 38016, 0x893ca7d8 +0, 230400, 38016, 0x716fd810 +0, 234000, 38016, 0x352aeb3c +0, 237600, 38016, 0xdf14e4d1 +0, 241200, 38016, 0x7e87dd42 +0, 244800, 38016, 0xe084c706 +0, 248400, 38016, 0x4000ba1f +0, 252000, 38016, 0x10679f5a +0, 255600, 38016, 0x5cb686b2 +0, 259200, 38016, 0x5dea8ffe +0, 262800, 38016, 0x8bd27fc8 +0, 266400, 38016, 0x72912b15 +0, 270000, 38016, 0xb86be965 +0, 273600, 38016, 0x7a42da39 +0, 277200, 38016, 0x9ddacae0 +0, 280800, 38016, 0xb767ff5b +0, 284400, 38016, 0xa3c64887 +0, 288000, 38016, 0xbc6981f2 +0, 291600, 38016, 0xc2506c22 +0, 295200, 38016, 0x6e785862 +0, 298800, 38016, 0xfade2b2d +0, 302400, 38016, 0xada1d917 +0, 306000, 38016, 0x459beba1 +0, 309600, 38016, 0x8b491f3c +0, 313200, 38016, 0x917b0fab +0, 316800, 38016, 0x053fb1d2 +0, 320400, 38016, 0x96e44e17 +0, 324000, 38016, 0x4d34f7e0 +0, 327600, 38016, 0x2265c386 +0, 331200, 38016, 0xc45dd284 +0, 334800, 38016, 0x0638fca3 +0, 338400, 38016, 0xcd9c2bbc +0, 342000, 38016, 0x3220dea3 +0, 345600, 38016, 0x72dfb576 +0, 349200, 38016, 0xb804ee86 +0, 352800, 38016, 0xbd516400 +0, 356400, 38016, 0x737fa296 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba1_ft_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba1_ft_c new file mode 100644 index 00000000..e97e05c3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba1_ft_c @@ -0,0 +1,299 @@ +0, 0, 152064, 0xa6f9b2a8 +0, 3600, 152064, 0x936a8ed6 +0, 7200, 152064, 0xa9f47652 +0, 10800, 152064, 0xf53ea804 +0, 14400, 152064, 0xc951304d +0, 18000, 152064, 0x59b786b9 +0, 21600, 152064, 0x01b3d9e9 +0, 25200, 152064, 0x94db5883 +0, 28800, 152064, 0xef01ce6c +0, 32400, 152064, 0x18401484 +0, 36000, 152064, 0xf8773e58 +0, 39600, 152064, 0x09d07ae7 +0, 43200, 152064, 0xbbec5291 +0, 46800, 152064, 0x1ddcbb1e +0, 50400, 152064, 0x51b257f2 +0, 54000, 152064, 0x2e537d43 +0, 57600, 152064, 0xc4d3c391 +0, 61200, 152064, 0xe6d0ed1c +0, 64800, 152064, 0x99d81859 +0, 68400, 152064, 0xba1c1693 +0, 72000, 152064, 0x60a22321 +0, 75600, 152064, 0xfe000aee +0, 79200, 152064, 0x3b056f2d +0, 82800, 152064, 0xf735caf9 +0, 86400, 152064, 0x81b94a66 +0, 90000, 152064, 0x28ad08af +0, 93600, 152064, 0x69b316f5 +0, 97200, 152064, 0xa90e6480 +0, 100800, 152064, 0x2600a97a +0, 104400, 152064, 0x28b1e894 +0, 108000, 152064, 0x8caaeb3c +0, 111600, 152064, 0xeaa3cd5d +0, 115200, 152064, 0x2aeab842 +0, 118800, 152064, 0x8781b8fe +0, 122400, 152064, 0xd5829de5 +0, 126000, 152064, 0xd04489cd +0, 129600, 152064, 0xfe268158 +0, 133200, 152064, 0x43917137 +0, 136800, 152064, 0x99963053 +0, 140400, 152064, 0xe085087d +0, 144000, 152064, 0x0344f8d3 +0, 147600, 152064, 0xe353b02a +0, 151200, 152064, 0x3f84816d +0, 154800, 152064, 0x3c3a8145 +0, 158400, 152064, 0x478caf10 +0, 162000, 152064, 0xdc879176 +0, 165600, 152064, 0x502f3b81 +0, 169200, 152064, 0x49997d1a +0, 172800, 152064, 0x6375e30f +0, 176400, 152064, 0x2abd5994 +0, 180000, 152064, 0xa32a06a0 +0, 183600, 152064, 0x9a2aed47 +0, 187200, 152064, 0x1963fa9d +0, 190800, 152064, 0xa429cc58 +0, 194400, 152064, 0x8f08abca +0, 198000, 152064, 0xdabe3408 +0, 201600, 152064, 0x5b94b0f1 +0, 205200, 152064, 0xb2565ba5 +0, 208800, 152064, 0x6eaf3500 +0, 212400, 152064, 0x04d79374 +0, 216000, 152064, 0x0a9281d7 +0, 219600, 152064, 0x97bf672b +0, 223200, 152064, 0x996d0b1a +0, 226800, 152064, 0xb5c4d52d +0, 230400, 152064, 0x8ab3897b +0, 234000, 152064, 0xd3303ae0 +0, 237600, 152064, 0x2c217280 +0, 241200, 152064, 0xcc21c7ff +0, 244800, 152064, 0xf9ae50ea +0, 248400, 152064, 0xa8af67a2 +0, 252000, 152064, 0xba2cbf40 +0, 255600, 152064, 0x80364875 +0, 259200, 152064, 0xe7028c24 +0, 262800, 152064, 0x6730636d +0, 266400, 152064, 0xd5d9bf5f +0, 270000, 152064, 0x2ec4cf74 +0, 273600, 152064, 0x47c0e7ec +0, 277200, 152064, 0x0e1741fb +0, 280800, 152064, 0x4b39d9b6 +0, 284400, 152064, 0x30737f2e +0, 288000, 152064, 0xce133061 +0, 291600, 152064, 0x3b7ce6b9 +0, 295200, 152064, 0x5b11d100 +0, 298800, 152064, 0x8bd801ca +0, 302400, 152064, 0x5d322cf6 +0, 306000, 152064, 0xdd47a0a3 +0, 309600, 152064, 0x0e3b3c60 +0, 313200, 152064, 0x8b69ac27 +0, 316800, 152064, 0xef66b267 +0, 320400, 152064, 0x29140655 +0, 324000, 152064, 0x25f6ae5c +0, 327600, 152064, 0xc1a48b89 +0, 331200, 152064, 0xc3eee9e4 +0, 334800, 152064, 0xec23534a +0, 338400, 152064, 0x9eed2a2e +0, 342000, 152064, 0x7e5de8e7 +0, 345600, 152064, 0x8d824e10 +0, 349200, 152064, 0x841ebdc5 +0, 352800, 152064, 0x9bc03542 +0, 356400, 152064, 0xd77d5b14 +0, 360000, 152064, 0x2b4597ed +0, 363600, 152064, 0xf460a0c5 +0, 367200, 152064, 0x01f58bf9 +0, 370800, 152064, 0xa5cb8dd9 +0, 374400, 152064, 0x12e49e6f +0, 378000, 152064, 0x6aaac311 +0, 381600, 152064, 0x0ff1d37a +0, 385200, 152064, 0x0e5ca8ce +0, 388800, 152064, 0x997c3a1f +0, 392400, 152064, 0x83c1d64e +0, 396000, 152064, 0xed2379a3 +0, 399600, 152064, 0xe6b83696 +0, 403200, 152064, 0x1a7c1864 +0, 406800, 152064, 0xb0bcf08e +0, 410400, 152064, 0x74deb96f +0, 414000, 152064, 0xe86a9396 +0, 417600, 152064, 0xf78a916b +0, 421200, 152064, 0x8d35a888 +0, 424800, 152064, 0xb01a956d +0, 428400, 152064, 0xc8d37b7d +0, 432000, 152064, 0x903251c9 +0, 435600, 152064, 0x93b819ac +0, 439200, 152064, 0xb949f48f +0, 442800, 152064, 0x7dbfeaba +0, 446400, 152064, 0x951903ae +0, 450000, 152064, 0x05742b8e +0, 453600, 152064, 0xb270514a +0, 457200, 152064, 0xf729867a +0, 460800, 152064, 0x7e05f652 +0, 464400, 152064, 0x32a99f23 +0, 468000, 152064, 0x57e7394b +0, 471600, 152064, 0xc0ffc453 +0, 475200, 152064, 0x7b1e79fa +0, 478800, 152064, 0x90ee1d52 +0, 482400, 152064, 0xaed672a8 +0, 486000, 152064, 0xa253ccc4 +0, 489600, 152064, 0x2d0807f9 +0, 493200, 152064, 0xdc7ec4cc +0, 496800, 152064, 0x3c624e2e +0, 500400, 152064, 0xfa4a91dd +0, 504000, 152064, 0xcaa83992 +0, 507600, 152064, 0x81e5c52d +0, 511200, 152064, 0x46ab76f8 +0, 514800, 152064, 0x4ab115d8 +0, 518400, 152064, 0x65d8c9d7 +0, 522000, 152064, 0xcb1e16b1 +0, 525600, 152064, 0xb766c029 +0, 529200, 152064, 0x2a49c7c0 +0, 532800, 152064, 0x37f35440 +0, 536400, 152064, 0x33b4940f +0, 540000, 152064, 0x6b22fb9a +0, 543600, 152064, 0x785e138a +0, 547200, 152064, 0xc7a1954a +0, 550800, 152064, 0x6f325026 +0, 554400, 152064, 0x23d6bf8d +0, 558000, 152064, 0x8e6f5815 +0, 561600, 152064, 0x434c4770 +0, 565200, 152064, 0x22319908 +0, 568800, 152064, 0xec368ac8 +0, 572400, 152064, 0xc69d7306 +0, 576000, 152064, 0xc10ab1c8 +0, 579600, 152064, 0x2497f329 +0, 583200, 152064, 0x95782b50 +0, 586800, 152064, 0xe0481c57 +0, 590400, 152064, 0xa656f1e6 +0, 594000, 152064, 0x562da8a1 +0, 597600, 152064, 0x21716296 +0, 601200, 152064, 0xb1ffd9de +0, 604800, 152064, 0x49204932 +0, 608400, 152064, 0x88e1ac93 +0, 612000, 152064, 0x6abb5dfb +0, 615600, 152064, 0xacdede42 +0, 619200, 152064, 0xca28f448 +0, 622800, 152064, 0x6b7e5e84 +0, 626400, 152064, 0x464d4b58 +0, 630000, 152064, 0xd39620f1 +0, 633600, 152064, 0x67336772 +0, 637200, 152064, 0x6de386c2 +0, 640800, 152064, 0x6d8fbc97 +0, 644400, 152064, 0x09fbc88d +0, 648000, 152064, 0x08dfa188 +0, 651600, 152064, 0xf3461401 +0, 655200, 152064, 0xdd6d1ce5 +0, 658800, 152064, 0x90182ee8 +0, 662400, 152064, 0xcb7cf9a2 +0, 666000, 152064, 0x237e59bd +0, 669600, 152064, 0xf2efa664 +0, 673200, 152064, 0x6565d69b +0, 676800, 152064, 0x321ce6e5 +0, 680400, 152064, 0xc7035cb7 +0, 684000, 152064, 0xbfcf2ecc +0, 687600, 152064, 0x8a2eb353 +0, 691200, 152064, 0x5224b608 +0, 694800, 152064, 0xc0c51491 +0, 698400, 152064, 0xdeadac32 +0, 702000, 152064, 0x8ffd15fe +0, 705600, 152064, 0x6a7fda8c +0, 709200, 152064, 0x32ae6c5a +0, 712800, 152064, 0x9668d580 +0, 716400, 152064, 0xb10325d6 +0, 720000, 152064, 0x1cfa4e12 +0, 723600, 152064, 0x87cb2dc6 +0, 727200, 152064, 0x03636041 +0, 730800, 152064, 0x266df3d6 +0, 734400, 152064, 0x48cd5b1b +0, 738000, 152064, 0xf42e4dde +0, 741600, 152064, 0x63b21de2 +0, 745200, 152064, 0xef377b16 +0, 748800, 152064, 0x540a3c21 +0, 752400, 152064, 0xbc7576a4 +0, 756000, 152064, 0x38508049 +0, 759600, 152064, 0x5c120e6f +0, 763200, 152064, 0x5f7dae8a +0, 766800, 152064, 0x84632e15 +0, 770400, 152064, 0xe6200a58 +0, 774000, 152064, 0xeef9c63d +0, 777600, 152064, 0xe5c60794 +0, 781200, 152064, 0x387849c9 +0, 784800, 152064, 0x165744e6 +0, 788400, 152064, 0xdc9cce84 +0, 792000, 152064, 0xea3604e0 +0, 795600, 152064, 0xaf9f5a76 +0, 799200, 152064, 0x05ee7254 +0, 802800, 152064, 0x62ed20cf +0, 806400, 152064, 0x6e038a86 +0, 810000, 152064, 0xc782f21c +0, 813600, 152064, 0x9d214e66 +0, 817200, 152064, 0xd33ad489 +0, 820800, 152064, 0x5b04dd7a +0, 824400, 152064, 0xaf9a865d +0, 828000, 152064, 0x9eb4912a +0, 831600, 152064, 0x677628d8 +0, 835200, 152064, 0x0b15e1b6 +0, 838800, 152064, 0xda66848a +0, 842400, 152064, 0xd29a27a8 +0, 846000, 152064, 0x2d74c6a2 +0, 849600, 152064, 0xafa69b91 +0, 853200, 152064, 0xf065a24b +0, 856800, 152064, 0xe9d5fe63 +0, 860400, 152064, 0xe0428668 +0, 864000, 152064, 0x2cfe6235 +0, 867600, 152064, 0x6506229d +0, 871200, 152064, 0xc8cddb6b +0, 874800, 152064, 0x1b827b12 +0, 878400, 152064, 0x366af54b +0, 882000, 152064, 0x810b5998 +0, 885600, 152064, 0x40d8d09e +0, 889200, 152064, 0xf5bd32c5 +0, 892800, 152064, 0xb7af7607 +0, 896400, 152064, 0x005ac53b +0, 900000, 152064, 0x1a28f754 +0, 903600, 152064, 0x8e15108e +0, 907200, 152064, 0xb40515ec +0, 910800, 152064, 0x43a30620 +0, 914400, 152064, 0x000beec8 +0, 918000, 152064, 0x1f6e9253 +0, 921600, 152064, 0x14695f50 +0, 925200, 152064, 0x056359d6 +0, 928800, 152064, 0xdc4360e5 +0, 932400, 152064, 0x3716abb2 +0, 936000, 152064, 0xee1cff6a +0, 939600, 152064, 0x7b251ba9 +0, 943200, 152064, 0xe4f81d2e +0, 946800, 152064, 0x01411136 +0, 950400, 152064, 0xcff2f30a +0, 954000, 152064, 0xc8bcd80d +0, 957600, 152064, 0x94e8a397 +0, 961200, 152064, 0x6fd071c8 +0, 964800, 152064, 0xb6145d60 +0, 968400, 152064, 0x593f5f70 +0, 972000, 152064, 0xb5133bb7 +0, 975600, 152064, 0x40ad1ae8 +0, 979200, 152064, 0xedfc0faa +0, 982800, 152064, 0xa2ab0578 +0, 986400, 152064, 0x3038fb4f +0, 990000, 152064, 0xdf10fb53 +0, 993600, 152064, 0x6b63ff01 +0, 997200, 152064, 0xb34af6cd +0, 1000800, 152064, 0xc7e9cfb0 +0, 1004400, 152064, 0x22ffb57c +0, 1008000, 152064, 0xf429b3eb +0, 1011600, 152064, 0x3861e0db +0, 1015200, 152064, 0x166321b7 +0, 1018800, 152064, 0x3058744c +0, 1022400, 152064, 0x6e1dc37a +0, 1026000, 152064, 0xef2aee63 +0, 1029600, 152064, 0x1a9c3957 +0, 1033200, 152064, 0x93807ed4 +0, 1036800, 152064, 0x117fcbe1 +0, 1040400, 152064, 0x80502017 +0, 1044000, 152064, 0xba5a3dac +0, 1047600, 152064, 0x157764f1 +0, 1051200, 152064, 0xc7577daf +0, 1054800, 152064, 0xe9e8ae69 +0, 1058400, 152064, 0x04f9ddac +0, 1062000, 152064, 0x90441226 +0, 1065600, 152064, 0xaa594ed2 +0, 1069200, 152064, 0x59258b49 +0, 1072800, 152064, 0x13ec85c6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba1_sony_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba1_sony_d new file mode 100644 index 00000000..9eefa538 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba1_sony_d @@ -0,0 +1,17 @@ +0, 0, 38016, 0xb3883478 +0, 3600, 38016, 0x99e1fe60 +0, 7200, 38016, 0x65eace24 +0, 10800, 38016, 0xb2b0a513 +0, 14400, 38016, 0x8af47c64 +0, 18000, 38016, 0xa56670c6 +0, 21600, 38016, 0x11d45ac9 +0, 25200, 38016, 0xcd4e4f18 +0, 28800, 38016, 0x399934b2 +0, 32400, 38016, 0xedd23f7b +0, 36000, 38016, 0x38c350b9 +0, 39600, 38016, 0xdd937244 +0, 43200, 38016, 0x39c67be6 +0, 46800, 38016, 0xabb7a34d +0, 50400, 38016, 0x535d971f +0, 54000, 38016, 0xd41c9cf7 +0, 57600, 38016, 0xfddda183 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba2_sony_f b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba2_sony_f new file mode 100644 index 00000000..126b6e6c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba2_sony_f @@ -0,0 +1,300 @@ +0, 0, 38016, 0xb3883478 +0, 3600, 38016, 0x47b90d4b +0, 7200, 38016, 0x3e99dfcf +0, 10800, 38016, 0xeb18bb85 +0, 14400, 38016, 0xcf1e9658 +0, 18000, 38016, 0xf01b7bf1 +0, 21600, 38016, 0x92e06ac5 +0, 25200, 38016, 0x8ae35c1f +0, 28800, 38016, 0x4bda52c8 +0, 32400, 38016, 0xbffe59e5 +0, 36000, 38016, 0x56c96cad +0, 39600, 38016, 0x8a278da1 +0, 43200, 38016, 0xce6f97d6 +0, 46800, 38016, 0x69edad2e +0, 50400, 38016, 0x5134a67c +0, 54000, 38016, 0x1abfb2a1 +0, 57600, 38016, 0x4a37b185 +0, 61200, 38016, 0x5270a90e +0, 64800, 38016, 0xe28f9d5d +0, 68400, 38016, 0x3fcc87b0 +0, 72000, 38016, 0x719e6605 +0, 75600, 38016, 0x8b824ca3 +0, 79200, 38016, 0x5f6a3544 +0, 82800, 38016, 0x2ecd2ada +0, 86400, 38016, 0x5d4f3055 +0, 90000, 38016, 0xc54441d3 +0, 93600, 38016, 0x93f83f2c +0, 97200, 38016, 0xaa4d46a8 +0, 100800, 38016, 0x7ca45c1f +0, 104400, 38016, 0x59de7854 +0, 108000, 38016, 0xc8f98709 +0, 111600, 38016, 0x9a199eeb +0, 115200, 38016, 0xfd82b785 +0, 118800, 38016, 0x319fd17f +0, 122400, 38016, 0xc6ebd362 +0, 126000, 38016, 0xbd60d5dc +0, 129600, 38016, 0x6e27d260 +0, 133200, 38016, 0x96b7cf93 +0, 136800, 38016, 0x6787cbcf +0, 140400, 38016, 0x48dacd76 +0, 144000, 38016, 0xbef1d08e +0, 147600, 38016, 0xbb1bd9a4 +0, 151200, 38016, 0xa420d63b +0, 154800, 38016, 0xfa26d0ab +0, 158400, 38016, 0xa349d2e0 +0, 162000, 38016, 0x9946ce09 +0, 165600, 38016, 0xb101cabe +0, 169200, 38016, 0x9e18c6b2 +0, 172800, 38016, 0xe7cccbd9 +0, 176400, 38016, 0x1067d145 +0, 180000, 38016, 0xae13cd75 +0, 183600, 38016, 0x8e06cce5 +0, 187200, 38016, 0x0b3dcbf8 +0, 190800, 38016, 0xc6cbcfbe +0, 194400, 38016, 0x1eced2f7 +0, 198000, 38016, 0x5d72da04 +0, 201600, 38016, 0x0643e191 +0, 205200, 38016, 0x3cace7f7 +0, 208800, 38016, 0x5e31f1f0 +0, 212400, 38016, 0x04d1ef46 +0, 216000, 38016, 0xffdbe794 +0, 219600, 38016, 0x106ad275 +0, 223200, 38016, 0x5c64a147 +0, 226800, 38016, 0xb7676212 +0, 230400, 38016, 0x86ea653e +0, 234000, 38016, 0xabb48937 +0, 237600, 38016, 0x6b1cadc4 +0, 241200, 38016, 0xa4eaf34b +0, 244800, 38016, 0x4174280f +0, 248400, 38016, 0xfe845818 +0, 252000, 38016, 0xc64a838e +0, 255600, 38016, 0x5e24aaf0 +0, 259200, 38016, 0x8bffd9d8 +0, 262800, 38016, 0x00d912c9 +0, 266400, 38016, 0x0dba50f0 +0, 270000, 38016, 0x80958628 +0, 273600, 38016, 0x4e81a356 +0, 277200, 38016, 0x121dc289 +0, 280800, 38016, 0x4885de6f +0, 284400, 38016, 0x5329e4f9 +0, 288000, 38016, 0xa129ef6b +0, 291600, 38016, 0x3ea6fd46 +0, 295200, 38016, 0x9a68fbb4 +0, 298800, 38016, 0xea1dffdd +0, 302400, 38016, 0x7bf9f719 +0, 306000, 38016, 0x9aa5ff2a +0, 309600, 38016, 0xf050fe90 +0, 313200, 38016, 0xb6f50938 +0, 316800, 38016, 0xbe900b57 +0, 320400, 38016, 0x27b90a6b +0, 324000, 38016, 0xe87bf703 +0, 327600, 38016, 0xaf0fdbe1 +0, 331200, 38016, 0x3f2cc304 +0, 334800, 38016, 0x0114b42f +0, 338400, 38016, 0x7f739915 +0, 342000, 38016, 0xcc3da414 +0, 345600, 38016, 0x57e2afe8 +0, 349200, 38016, 0x59b6bdc5 +0, 352800, 38016, 0xb3eacf6a +0, 356400, 38016, 0xa10ddcd8 +0, 360000, 38016, 0xae05e697 +0, 363600, 38016, 0x8cb9d81c +0, 367200, 38016, 0x5d5cc3b1 +0, 370800, 38016, 0x8f89c0c0 +0, 374400, 38016, 0x593cda26 +0, 378000, 38016, 0xd5d1f2fc +0, 381600, 38016, 0x2586ff00 +0, 385200, 38016, 0x1c2613f0 +0, 388800, 38016, 0x236133bd +0, 392400, 38016, 0x92c5439b +0, 396000, 38016, 0xd1145724 +0, 399600, 38016, 0xf2fa5c12 +0, 403200, 38016, 0x810d5f50 +0, 406800, 38016, 0x196f4470 +0, 410400, 38016, 0xcba71d6b +0, 414000, 38016, 0x58ab17b0 +0, 417600, 38016, 0x4a96278d +0, 421200, 38016, 0x4afe2f7d +0, 424800, 38016, 0xe1ca3d55 +0, 428400, 38016, 0x4f6844ab +0, 432000, 38016, 0x7ad24bc5 +0, 435600, 38016, 0x068c49f0 +0, 439200, 38016, 0x23b92dae +0, 442800, 38016, 0x0e9a0793 +0, 446400, 38016, 0xc1d2dd4a +0, 450000, 38016, 0x1b5cbc00 +0, 453600, 38016, 0xa951b88d +0, 457200, 38016, 0x8b4ac1df +0, 460800, 38016, 0x91d3d98d +0, 464400, 38016, 0xa42aeb49 +0, 468000, 38016, 0x21b5f1f6 +0, 471600, 38016, 0xd632f07f +0, 475200, 38016, 0x6566ec26 +0, 478800, 38016, 0x03f4ee70 +0, 482400, 38016, 0x62b6e999 +0, 486000, 38016, 0xfd1de6fb +0, 489600, 38016, 0xb07bdc79 +0, 493200, 38016, 0xace9d441 +0, 496800, 38016, 0x7d98c788 +0, 500400, 38016, 0x3c7dbae4 +0, 504000, 38016, 0x6e85b20f +0, 507600, 38016, 0x86a5a6bc +0, 511200, 38016, 0xacbe93ca +0, 514800, 38016, 0x8e438bde +0, 518400, 38016, 0x88b4963d +0, 522000, 38016, 0x86119504 +0, 525600, 38016, 0x0ccc8932 +0, 529200, 38016, 0x69a45f01 +0, 532800, 38016, 0x8f173148 +0, 536400, 38016, 0x1e320daf +0, 540000, 38016, 0x3957e834 +0, 543600, 38016, 0x57c1dcee +0, 547200, 38016, 0x2a9edf52 +0, 550800, 38016, 0x116ed4bc +0, 554400, 38016, 0x81cfc686 +0, 558000, 38016, 0x6685db47 +0, 561600, 38016, 0xab79fd2f +0, 565200, 38016, 0x65201bdd +0, 568800, 38016, 0x06e64eb6 +0, 572400, 38016, 0xbcb77ac0 +0, 576000, 38016, 0x65679028 +0, 579600, 38016, 0xf33e837e +0, 583200, 38016, 0xa77d7b6c +0, 586800, 38016, 0x0e7b64f6 +0, 590400, 38016, 0x2d1f597c +0, 594000, 38016, 0x1b6748a1 +0, 597600, 38016, 0x12a91f4f +0, 601200, 38016, 0xc09df3ee +0, 604800, 38016, 0x1b9dcd6f +0, 608400, 38016, 0xf3c2bce4 +0, 612000, 38016, 0xfe05d34b +0, 615600, 38016, 0x421deb25 +0, 619200, 38016, 0x0f8d0725 +0, 622800, 38016, 0xa03d0a3d +0, 626400, 38016, 0xe00cf88f +0, 630000, 38016, 0xa55abfdf +0, 633600, 38016, 0x11618891 +0, 637200, 38016, 0x45835caf +0, 640800, 38016, 0x7be63a3b +0, 644400, 38016, 0x1ebb2104 +0, 648000, 38016, 0x055b0b26 +0, 651600, 38016, 0x076ef47e +0, 655200, 38016, 0xa828e6e1 +0, 658800, 38016, 0x0de5eb60 +0, 662400, 38016, 0x5238f229 +0, 666000, 38016, 0x332cff7c +0, 669600, 38016, 0x74072063 +0, 673200, 38016, 0x1e623ceb +0, 676800, 38016, 0xad2448c9 +0, 680400, 38016, 0x32065043 +0, 684000, 38016, 0x2e7ff976 +0, 687600, 38016, 0xf1a8c805 +0, 691200, 38016, 0x3f64d1cc +0, 694800, 38016, 0xc855efbd +0, 698400, 38016, 0x152b0fed +0, 702000, 38016, 0x43335881 +0, 705600, 38016, 0xec5c7979 +0, 709200, 38016, 0x150e9488 +0, 712800, 38016, 0x1a63b67a +0, 716400, 38016, 0x24a4cca6 +0, 720000, 38016, 0x3838dba2 +0, 723600, 38016, 0xef1bec71 +0, 727200, 38016, 0x0478f12a +0, 730800, 38016, 0x478fee17 +0, 734400, 38016, 0x1d09f0ac +0, 738000, 38016, 0x3daef591 +0, 741600, 38016, 0xf7f3033c +0, 745200, 38016, 0xfb09faa0 +0, 748800, 38016, 0xd87de6c9 +0, 752400, 38016, 0xbd99d6bc +0, 756000, 38016, 0x87d8bd7d +0, 759600, 38016, 0xf244b18a +0, 763200, 38016, 0x3a34a2da +0, 766800, 38016, 0x25739701 +0, 770400, 38016, 0x346b8b9a +0, 774000, 38016, 0xc67379ec +0, 777600, 38016, 0xbd30780d +0, 781200, 38016, 0xc5197c2b +0, 784800, 38016, 0xd5ce73e8 +0, 788400, 38016, 0x63ce72d1 +0, 792000, 38016, 0x140d688d +0, 795600, 38016, 0x027158aa +0, 799200, 38016, 0x90884ce3 +0, 802800, 38016, 0x4faa38c5 +0, 806400, 38016, 0x78693f54 +0, 810000, 38016, 0xe1fa41c1 +0, 813600, 38016, 0x9b524771 +0, 817200, 38016, 0xbb3056c8 +0, 820800, 38016, 0xa93b67df +0, 824400, 38016, 0xe661909f +0, 828000, 38016, 0x55a0af6d +0, 831600, 38016, 0xa5f6d0a8 +0, 835200, 38016, 0xa44300f8 +0, 838800, 38016, 0xc7cc265e +0, 842400, 38016, 0xe7384598 +0, 846000, 38016, 0x77e4589a +0, 849600, 38016, 0x073c7054 +0, 853200, 38016, 0xe50e6ea8 +0, 856800, 38016, 0xcedf518f +0, 860400, 38016, 0x8674266b +0, 864000, 38016, 0x360e0517 +0, 867600, 38016, 0x19acdb3a +0, 871200, 38016, 0xd029d91b +0, 874800, 38016, 0x3101277f +0, 878400, 38016, 0x3a919153 +0, 882000, 38016, 0x0646ffaf +0, 885600, 38016, 0xffdd13a5 +0, 889200, 38016, 0x13e2e641 +0, 892800, 38016, 0xc6f6a13b +0, 896400, 38016, 0x984f2ecd +0, 900000, 38016, 0xafaec63a +0, 903600, 38016, 0x9025817a +0, 907200, 38016, 0x20d574d7 +0, 910800, 38016, 0x72eacc49 +0, 914400, 38016, 0x6297335a +0, 918000, 38016, 0xc69adba1 +0, 921600, 38016, 0x7852d515 +0, 925200, 38016, 0x0e846003 +0, 928800, 38016, 0xeb294c5e +0, 932400, 38016, 0x0913448f +0, 936000, 38016, 0xea2c4fc1 +0, 939600, 38016, 0xb8165b3f +0, 943200, 38016, 0x5f596c9d +0, 946800, 38016, 0x3a1370d1 +0, 950400, 38016, 0x25dd6a9a +0, 954000, 38016, 0x70075f7a +0, 957600, 38016, 0xaf6749f0 +0, 961200, 38016, 0xd5c22d02 +0, 964800, 38016, 0xf6e80af2 +0, 968400, 38016, 0x42d1dcf7 +0, 972000, 38016, 0x232cb536 +0, 975600, 38016, 0x7c848ebf +0, 979200, 38016, 0x4c756c28 +0, 982800, 38016, 0x720e1f07 +0, 986400, 38016, 0x2385ccb2 +0, 990000, 38016, 0xcd97bf76 +0, 993600, 38016, 0xebcad10b +0, 997200, 38016, 0xbed8ceeb +0, 1000800, 38016, 0x660ffaf8 +0, 1004400, 38016, 0x6a1662a9 +0, 1008000, 38016, 0x71f20775 +0, 1011600, 38016, 0x597ecf26 +0, 1015200, 38016, 0x7a81a050 +0, 1018800, 38016, 0x05f6676a +0, 1022400, 38016, 0xd0065042 +0, 1026000, 38016, 0x17ca9cd9 +0, 1029600, 38016, 0x76956633 +0, 1033200, 38016, 0x9211a2b0 +0, 1036800, 38016, 0xc134b304 +0, 1040400, 38016, 0xdaca9260 +0, 1044000, 38016, 0x10252d19 +0, 1047600, 38016, 0xf52a44af +0, 1051200, 38016, 0x4053d2d1 +0, 1054800, 38016, 0x165e0bed +0, 1058400, 38016, 0x577352d0 +0, 1062000, 38016, 0xf9564a09 +0, 1065600, 38016, 0x78a8295f +0, 1069200, 38016, 0xb2d7182a +0, 1072800, 38016, 0x9a0c2487 +0, 1076400, 38016, 0x1b044efa diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba3_sva_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba3_sva_c new file mode 100644 index 00000000..2b36542b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba3_sva_c @@ -0,0 +1,33 @@ +0, 0, 38016, 0xbf5f1df5 +0, 3600, 38016, 0x8de61f39 +0, 7200, 38016, 0xaeec0a18 +0, 10800, 38016, 0x386c2599 +0, 14400, 38016, 0x8fcf2df0 +0, 18000, 38016, 0x34fe57ec +0, 21600, 38016, 0x7e6c5e1a +0, 25200, 38016, 0x8f319659 +0, 28800, 38016, 0x1e1291e2 +0, 32400, 38016, 0x97e9bf55 +0, 36000, 38016, 0x35bcad1a +0, 39600, 38016, 0xea39d354 +0, 43200, 38016, 0xca7db081 +0, 46800, 38016, 0x2c069b6c +0, 50400, 38016, 0x32f86a99 +0, 54000, 38016, 0xb4019668 +0, 57600, 38016, 0x04038324 +0, 61200, 38016, 0xe4f0b032 +0, 64800, 38016, 0xe6119a63 +0, 68400, 38016, 0xdf17b9fa +0, 72000, 38016, 0xe199a348 +0, 75600, 38016, 0x6704b749 +0, 79200, 38016, 0x33fc7592 +0, 82800, 38016, 0xc0c371b2 +0, 86400, 38016, 0x017628aa +0, 90000, 38016, 0xa46b3ab5 +0, 93600, 38016, 0x216f1fdb +0, 97200, 38016, 0x28c54669 +0, 100800, 38016, 0x070c4ac1 +0, 104400, 38016, 0x4d4c6765 +0, 108000, 38016, 0xb496626c +0, 111600, 38016, 0x9f767057 +0, 115200, 38016, 0xe2bc4de1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba_mw_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba_mw_d new file mode 100644 index 00000000..b5fbd692 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ba_mw_d @@ -0,0 +1,100 @@ +0, 0, 38016, 0x3ae838ee +0, 3600, 38016, 0x9ed7e141 +0, 7200, 38016, 0x393097f9 +0, 10800, 38016, 0x8fb56676 +0, 14400, 38016, 0x39d64fd2 +0, 18000, 38016, 0x7fad729a +0, 21600, 38016, 0x7e25955f +0, 25200, 38016, 0xc4d9a359 +0, 28800, 38016, 0x30afaca4 +0, 32400, 38016, 0x9ee195ea +0, 36000, 38016, 0x09f65805 +0, 39600, 38016, 0x58d126ab +0, 43200, 38016, 0x4f29282c +0, 46800, 38016, 0x8af235a1 +0, 50400, 38016, 0x6dfe525a +0, 54000, 38016, 0xd51c793f +0, 57600, 38016, 0x4e90abba +0, 61200, 38016, 0xe706c5b7 +0, 64800, 38016, 0x35fab7ef +0, 68400, 38016, 0xed78b8fc +0, 72000, 38016, 0x2907bb4e +0, 75600, 38016, 0x1749bb47 +0, 79200, 38016, 0x284ec688 +0, 82800, 38016, 0x534abc24 +0, 86400, 38016, 0xcd01bd13 +0, 90000, 38016, 0xe97bbd51 +0, 93600, 38016, 0xac1cb9e9 +0, 97200, 38016, 0xd861c0a3 +0, 100800, 38016, 0xf0f1ced4 +0, 104400, 38016, 0xa9e8d2bf +0, 108000, 38016, 0x4c6aa7c5 +0, 111600, 38016, 0xe2eb6bde +0, 115200, 38016, 0x92eb44a1 +0, 118800, 38016, 0x376b8919 +0, 122400, 38016, 0x291bfdd9 +0, 126000, 38016, 0xed0c60a0 +0, 129600, 38016, 0xf505b70d +0, 133200, 38016, 0x26b33a9b +0, 136800, 38016, 0xc9269664 +0, 140400, 38016, 0xe21dc61e +0, 144000, 38016, 0xe88fe653 +0, 147600, 38016, 0xd4cff39c +0, 151200, 38016, 0x02bdecdf +0, 154800, 38016, 0xec48fc13 +0, 158400, 38016, 0x363f071c +0, 162000, 38016, 0x7fcbf2fd +0, 165600, 38016, 0xc3d1c265 +0, 169200, 38016, 0x818a94e9 +0, 172800, 38016, 0x30b5a52f +0, 176400, 38016, 0x7a1acd17 +0, 180000, 38016, 0xb5a6dc91 +0, 183600, 38016, 0x7d39b673 +0, 187200, 38016, 0x341ad3f9 +0, 190800, 38016, 0x264cff5f +0, 194400, 38016, 0x613a445b +0, 198000, 38016, 0x42a55cd6 +0, 201600, 38016, 0xe84f6a39 +0, 205200, 38016, 0xd8e93151 +0, 208800, 38016, 0xc7333ac4 +0, 212400, 38016, 0xa08a4b2c +0, 216000, 38016, 0xeb8a3531 +0, 219600, 38016, 0x88bf1883 +0, 223200, 38016, 0x0043c104 +0, 226800, 38016, 0xa9d6a35d +0, 230400, 38016, 0x01dec5af +0, 234000, 38016, 0x673cdf0e +0, 237600, 38016, 0xc8d0ce67 +0, 241200, 38016, 0xcac2d0bd +0, 244800, 38016, 0x8575c7b9 +0, 248400, 38016, 0x71c1b4f4 +0, 252000, 38016, 0x2affa1d4 +0, 255600, 38016, 0xae947cfd +0, 259200, 38016, 0x48b2821d +0, 262800, 38016, 0x1c5d77f4 +0, 266400, 38016, 0x3625233b +0, 270000, 38016, 0xcfc8e3ff +0, 273600, 38016, 0x6d04cfa5 +0, 277200, 38016, 0x2c4ec463 +0, 280800, 38016, 0x72b1ea07 +0, 284400, 38016, 0x448d3996 +0, 288000, 38016, 0x89256b87 +0, 291600, 38016, 0x69af5fea +0, 295200, 38016, 0x908f46b0 +0, 298800, 38016, 0x56e11a8b +0, 302400, 38016, 0x7fd4c5f5 +0, 306000, 38016, 0x560bd701 +0, 309600, 38016, 0x71570820 +0, 313200, 38016, 0x11b20b14 +0, 316800, 38016, 0xa3fd9f19 +0, 320400, 38016, 0x4a564d33 +0, 324000, 38016, 0x1722db32 +0, 327600, 38016, 0xf853a971 +0, 331200, 38016, 0xb136bf89 +0, 334800, 38016, 0xb686e8c3 +0, 338400, 38016, 0x8afc1a4c +0, 342000, 38016, 0xa24adb65 +0, 345600, 38016, 0xd951ae27 +0, 349200, 38016, 0xa731f04e +0, 352800, 38016, 0xabd65795 +0, 356400, 38016, 0x46bc95e1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-bamq1_jvc_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-bamq1_jvc_c new file mode 100644 index 00000000..11f43521 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-bamq1_jvc_c @@ -0,0 +1,30 @@ +0, 0, 38016, 0x6951213f +0, 3600, 38016, 0x82ddf39d +0, 7200, 38016, 0x3f81c6b1 +0, 10800, 38016, 0x55149f23 +0, 14400, 38016, 0x366a74e1 +0, 18000, 38016, 0xe6f465cf +0, 21600, 38016, 0x14fd4999 +0, 25200, 38016, 0x49273f0f +0, 28800, 38016, 0xa20a2ebe +0, 32400, 38016, 0x701b32a4 +0, 36000, 38016, 0x8a394066 +0, 39600, 38016, 0xe9b766a6 +0, 43200, 38016, 0x4e7f766d +0, 46800, 38016, 0x2c159585 +0, 50400, 38016, 0x31b38c2b +0, 54000, 38016, 0xde58937f +0, 57600, 38016, 0xf69e94f9 +0, 61200, 38016, 0x849e8a08 +0, 64800, 38016, 0xe53f79e9 +0, 68400, 38016, 0xf2ce6103 +0, 72000, 38016, 0xe98d3c96 +0, 75600, 38016, 0xea8c17c5 +0, 79200, 38016, 0xea0a01d8 +0, 82800, 38016, 0x6a45fd53 +0, 86400, 38016, 0xaad9fd47 +0, 90000, 38016, 0xabc603b7 +0, 93600, 38016, 0x89410350 +0, 97200, 38016, 0x1fac129b +0, 100800, 38016, 0x1af529ee +0, 104400, 38016, 0x384141b6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-bamq2_jvc_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-bamq2_jvc_c new file mode 100644 index 00000000..a16cb051 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-bamq2_jvc_c @@ -0,0 +1,30 @@ +0, 0, 38016, 0x6951213f +0, 3600, 38016, 0xd1bbf830 +0, 7200, 38016, 0x79dcc8cb +0, 10800, 38016, 0xa426a50e +0, 14400, 38016, 0x002275d6 +0, 18000, 38016, 0xab9a666e +0, 21600, 38016, 0x9bd54be9 +0, 25200, 38016, 0x09003ed1 +0, 28800, 38016, 0x75e0340a +0, 32400, 38016, 0x65ae3b23 +0, 36000, 38016, 0x4c1049a8 +0, 39600, 38016, 0x6e336a25 +0, 43200, 38016, 0x4d3579ee +0, 46800, 38016, 0x81f89545 +0, 50400, 38016, 0xc9358e56 +0, 54000, 38016, 0x3fa69885 +0, 57600, 38016, 0x1ea49bea +0, 61200, 38016, 0xce939241 +0, 64800, 38016, 0xbc278236 +0, 68400, 38016, 0xf11868d2 +0, 72000, 38016, 0xe4124537 +0, 75600, 38016, 0xd5831e16 +0, 79200, 38016, 0x9f5608e8 +0, 82800, 38016, 0x30ad0448 +0, 86400, 38016, 0x06a00523 +0, 90000, 38016, 0x25e50e24 +0, 93600, 38016, 0x2c220a92 +0, 97200, 38016, 0xd4b7185e +0, 100800, 38016, 0x80f92d07 +0, 104400, 38016, 0x285a4586 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-banm_mw_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-banm_mw_d new file mode 100644 index 00000000..188d7a72 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-banm_mw_d @@ -0,0 +1,100 @@ +0, 0, 38016, 0x3ae838ee +0, 3600, 38016, 0x9ed7e141 +0, 7200, 38016, 0xaf9d9753 +0, 10800, 38016, 0x8a6f6906 +0, 14400, 38016, 0xcfe85810 +0, 18000, 38016, 0x00ed737f +0, 21600, 38016, 0x93509e20 +0, 25200, 38016, 0xa02ba402 +0, 28800, 38016, 0xce09afd9 +0, 32400, 38016, 0xc7a49dcf +0, 36000, 38016, 0x0da163c6 +0, 39600, 38016, 0xb3be2fcf +0, 43200, 38016, 0x0d564479 +0, 46800, 38016, 0x5c554f55 +0, 50400, 38016, 0x05d06d25 +0, 54000, 38016, 0x352687bc +0, 57600, 38016, 0x9e13b74d +0, 61200, 38016, 0x1c3dd2af +0, 64800, 38016, 0x3c1ad091 +0, 68400, 38016, 0x0461cad8 +0, 72000, 38016, 0xa002cc91 +0, 75600, 38016, 0x9c06d06e +0, 79200, 38016, 0xfad0cee0 +0, 82800, 38016, 0x5cbbd4a5 +0, 86400, 38016, 0x9a99d463 +0, 90000, 38016, 0xa115d051 +0, 93600, 38016, 0x5b63cc22 +0, 97200, 38016, 0x53b3cfd2 +0, 100800, 38016, 0x7b22db61 +0, 104400, 38016, 0x4f28e319 +0, 108000, 38016, 0x4c6aa7c5 +0, 111600, 38016, 0xe2eb6bde +0, 115200, 38016, 0xdfc84927 +0, 118800, 38016, 0xa0098eab +0, 122400, 38016, 0x607a00e2 +0, 126000, 38016, 0x58da68d0 +0, 129600, 38016, 0x1290c8c6 +0, 133200, 38016, 0x40615120 +0, 136800, 38016, 0x070e9d9c +0, 140400, 38016, 0x5295d213 +0, 144000, 38016, 0xaaa0f00a +0, 147600, 38016, 0x0ef7f99d +0, 151200, 38016, 0x018cf596 +0, 154800, 38016, 0xb9010555 +0, 158400, 38016, 0x54b10d05 +0, 162000, 38016, 0xa06ff53b +0, 165600, 38016, 0x9a2ec1aa +0, 169200, 38016, 0x75999938 +0, 172800, 38016, 0xda6ba315 +0, 176400, 38016, 0xaa38cc4e +0, 180000, 38016, 0x87f6e751 +0, 183600, 38016, 0x2318c2b9 +0, 187200, 38016, 0xdebfd9c8 +0, 190800, 38016, 0xdc9a115f +0, 194400, 38016, 0x6d1e495d +0, 198000, 38016, 0x53d46db4 +0, 201600, 38016, 0x53287856 +0, 205200, 38016, 0x0ce93af7 +0, 208800, 38016, 0x44974b42 +0, 212400, 38016, 0x65a16170 +0, 216000, 38016, 0xeb8a3531 +0, 219600, 38016, 0x65da180b +0, 223200, 38016, 0x6eb1cd77 +0, 226800, 38016, 0xc890b0c1 +0, 230400, 38016, 0x359ad301 +0, 234000, 38016, 0x4be2e140 +0, 237600, 38016, 0x5094da18 +0, 241200, 38016, 0x9ef9d904 +0, 244800, 38016, 0x0ad8cbb4 +0, 248400, 38016, 0xd68cb3db +0, 252000, 38016, 0x7fcd9d3c +0, 255600, 38016, 0x017385aa +0, 259200, 38016, 0xa2328d96 +0, 262800, 38016, 0x18858630 +0, 266400, 38016, 0x795228e0 +0, 270000, 38016, 0xb70ce750 +0, 273600, 38016, 0x55d9da49 +0, 277200, 38016, 0x7714cc94 +0, 280800, 38016, 0xec39f711 +0, 284400, 38016, 0x561e4366 +0, 288000, 38016, 0xd91c83e0 +0, 291600, 38016, 0x8b3379e2 +0, 295200, 38016, 0xdee36b36 +0, 298800, 38016, 0x1b4940fd +0, 302400, 38016, 0x9b13e7b2 +0, 306000, 38016, 0xb0b2f2eb +0, 309600, 38016, 0x0e7c2373 +0, 313200, 38016, 0x87401fb0 +0, 316800, 38016, 0xc4bdb8be +0, 320400, 38016, 0xbbfc4f40 +0, 324000, 38016, 0x1722db32 +0, 327600, 38016, 0xf7e8a749 +0, 331200, 38016, 0x8c66b366 +0, 334800, 38016, 0x9823f33e +0, 338400, 38016, 0x5013240a +0, 342000, 38016, 0xf174d83a +0, 345600, 38016, 0xe49cae19 +0, 349200, 38016, 0xadc2f8f7 +0, 352800, 38016, 0x667961b0 +0, 356400, 38016, 0xcb6d9bcd diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-basqp1_sony_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-basqp1_sony_c new file mode 100644 index 00000000..f8565472 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-basqp1_sony_c @@ -0,0 +1,4 @@ +0, 0, 38016, 0xe2d73230 +0, 3600, 38016, 0xda4dfc8e +0, 7200, 38016, 0x7334cb99 +0, 10800, 38016, 0xd8feab7d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba1_sony_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba1_sony_d new file mode 100644 index 00000000..62232d23 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba1_sony_d @@ -0,0 +1,50 @@ +0, 0, 38016, 0xb3883478 +0, 3600, 38016, 0x99e1fe60 +0, 7200, 38016, 0x65eace24 +0, 10800, 38016, 0xb2b0a513 +0, 14400, 38016, 0x8af47c64 +0, 18000, 38016, 0xa56670c6 +0, 21600, 38016, 0x11d45ac9 +0, 25200, 38016, 0xcd4e4f18 +0, 28800, 38016, 0x399934b2 +0, 32400, 38016, 0xedd23f7b +0, 36000, 38016, 0x38c350b9 +0, 39600, 38016, 0xdd937244 +0, 43200, 38016, 0x39c67be6 +0, 46800, 38016, 0xabb7a34d +0, 50400, 38016, 0x535d971f +0, 54000, 38016, 0xd41c9cf7 +0, 57600, 38016, 0xfddda183 +0, 61200, 38016, 0x7b659dc5 +0, 64800, 38016, 0x06978b0c +0, 68400, 38016, 0x62596b00 +0, 72000, 38016, 0x5e504719 +0, 75600, 38016, 0x55252349 +0, 79200, 38016, 0xdbdd0d9e +0, 82800, 38016, 0x550a0918 +0, 86400, 38016, 0xb890feeb +0, 90000, 38016, 0x8aa01221 +0, 93600, 38016, 0xfcc01085 +0, 97200, 38016, 0x78f11d7d +0, 100800, 38016, 0xfcd33487 +0, 104400, 38016, 0x9b444cfc +0, 108000, 38016, 0xed9563d3 +0, 111600, 38016, 0x07e17628 +0, 115200, 38016, 0x9bb792fd +0, 118800, 38016, 0xa6aea73d +0, 122400, 38016, 0x4b90b778 +0, 126000, 38016, 0x6df2b998 +0, 129600, 38016, 0x799eb2db +0, 133200, 38016, 0x48dab272 +0, 136800, 38016, 0x9877b4eb +0, 140400, 38016, 0x901ab58e +0, 144000, 38016, 0x32c2beb1 +0, 147600, 38016, 0xe542b56e +0, 151200, 38016, 0x1edf9ff4 +0, 154800, 38016, 0xf103942c +0, 158400, 38016, 0x097a8dc7 +0, 162000, 38016, 0xe3728780 +0, 165600, 38016, 0xce9a9026 +0, 169200, 38016, 0x78ba841b +0, 172800, 38016, 0x5fc687ab +0, 176400, 38016, 0x03a49472 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba1_sva_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba1_sva_b new file mode 100644 index 00000000..f5b426b8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba1_sva_b @@ -0,0 +1,17 @@ +0, 0, 38016, 0xee831fe4 +0, 3600, 38016, 0x1098ff23 +0, 7200, 38016, 0x8fc3e078 +0, 10800, 38016, 0x86530991 +0, 14400, 38016, 0xdc8e279e +0, 18000, 38016, 0x54ea3234 +0, 21600, 38016, 0x79014662 +0, 25200, 38016, 0x5d0a5a88 +0, 28800, 38016, 0xf712805d +0, 32400, 38016, 0x0a09937e +0, 36000, 38016, 0xfa62a1d7 +0, 39600, 38016, 0x67c6a41b +0, 43200, 38016, 0x6452ab94 +0, 46800, 38016, 0xdb269049 +0, 50400, 38016, 0xc7ab8864 +0, 54000, 38016, 0xbb828f4a +0, 57600, 38016, 0x4fb3a61a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba2_sony_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba2_sony_e new file mode 100644 index 00000000..07320275 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba2_sony_e @@ -0,0 +1,300 @@ +0, 0, 38016, 0xb3883478 +0, 3600, 38016, 0x23a30e47 +0, 7200, 38016, 0xa0b7df0f +0, 10800, 38016, 0x5cd9beed +0, 14400, 38016, 0x13b09699 +0, 18000, 38016, 0x66697d65 +0, 21600, 38016, 0xf0486d0d +0, 25200, 38016, 0xaf94644e +0, 28800, 38016, 0x43c45981 +0, 32400, 38016, 0x8f655e70 +0, 36000, 38016, 0x3d747a52 +0, 39600, 38016, 0x906e95f9 +0, 43200, 38016, 0xdd3ea1a0 +0, 46800, 38016, 0x216eb0ee +0, 50400, 38016, 0x06cbabfe +0, 54000, 38016, 0xd41c9cf7 +0, 57600, 38016, 0x6d2fa58e +0, 61200, 38016, 0x0adca6fc +0, 64800, 38016, 0x51c49ad9 +0, 68400, 38016, 0x83e57a42 +0, 72000, 38016, 0xe47b5dad +0, 75600, 38016, 0x5e123c13 +0, 79200, 38016, 0xad682f93 +0, 82800, 38016, 0x77b02d2c +0, 86400, 38016, 0x976d316e +0, 90000, 38016, 0x3d923c72 +0, 93600, 38016, 0xf073398d +0, 97200, 38016, 0x6dc547b4 +0, 100800, 38016, 0xfa9859b3 +0, 104400, 38016, 0xfc3f77b9 +0, 108000, 38016, 0xed9563d3 +0, 111600, 38016, 0xc040929e +0, 115200, 38016, 0x5562af3c +0, 118800, 38016, 0xa56abc78 +0, 122400, 38016, 0x702ec702 +0, 126000, 38016, 0x8ee7c909 +0, 129600, 38016, 0x9065c44f +0, 133200, 38016, 0x11e3c40b +0, 136800, 38016, 0x20fbc27a +0, 140400, 38016, 0xaeecc582 +0, 144000, 38016, 0x3b32ca4f +0, 147600, 38016, 0x5464ce6c +0, 151200, 38016, 0x41d4cd66 +0, 154800, 38016, 0x8a69c6ef +0, 158400, 38016, 0x2c63c59e +0, 162000, 38016, 0xe3728780 +0, 165600, 38016, 0xc60c9ca3 +0, 169200, 38016, 0x8299a65a +0, 172800, 38016, 0x67d4b3d5 +0, 176400, 38016, 0xd650bd19 +0, 180000, 38016, 0xe8c9b285 +0, 183600, 38016, 0x9a3dba0c +0, 187200, 38016, 0xb3f4bfc3 +0, 190800, 38016, 0xe3edbe71 +0, 194400, 38016, 0xea7fc14f +0, 198000, 38016, 0x4560cb94 +0, 201600, 38016, 0x3b48ce1b +0, 205200, 38016, 0xc668d24c +0, 208800, 38016, 0x8bdcd514 +0, 212400, 38016, 0xd0f8d380 +0, 216000, 38016, 0x98a59a5a +0, 219600, 38016, 0x086d9c52 +0, 223200, 38016, 0x50417af3 +0, 226800, 38016, 0xe8ae428b +0, 230400, 38016, 0xb5663f68 +0, 234000, 38016, 0x452e6045 +0, 237600, 38016, 0x0412991e +0, 241200, 38016, 0xa791d0c8 +0, 244800, 38016, 0x952c13e8 +0, 248400, 38016, 0x9356462c +0, 252000, 38016, 0x34026bf3 +0, 255600, 38016, 0x3a109e70 +0, 259200, 38016, 0xc28dccb1 +0, 262800, 38016, 0x445f08e7 +0, 266400, 38016, 0x1e0c4781 +0, 270000, 38016, 0x4c0b3afa +0, 273600, 38016, 0x90147b21 +0, 277200, 38016, 0xe6fb9ee6 +0, 280800, 38016, 0x3bbac15a +0, 284400, 38016, 0x113ecc97 +0, 288000, 38016, 0xa271e248 +0, 291600, 38016, 0xbc97f36a +0, 295200, 38016, 0x2a5af366 +0, 298800, 38016, 0xc171ec49 +0, 302400, 38016, 0x2393e85e +0, 306000, 38016, 0xbf59eeb0 +0, 309600, 38016, 0xcec2f989 +0, 313200, 38016, 0x3cb8fcb3 +0, 316800, 38016, 0x28150278 +0, 320400, 38016, 0x27f70026 +0, 324000, 38016, 0x8fa69f07 +0, 327600, 38016, 0x198b9a79 +0, 331200, 38016, 0x40928d52 +0, 334800, 38016, 0x1504834e +0, 338400, 38016, 0xb53677ab +0, 342000, 38016, 0x2e2c783d +0, 345600, 38016, 0x5fd38e3a +0, 349200, 38016, 0x697e9cd3 +0, 352800, 38016, 0x0b18ad4b +0, 356400, 38016, 0x6ad7b78f +0, 360000, 38016, 0x6af3c654 +0, 363600, 38016, 0x5aabb804 +0, 367200, 38016, 0x9b5aa6e5 +0, 370800, 38016, 0x2993a311 +0, 374400, 38016, 0x1382b8e5 +0, 378000, 38016, 0xf294a253 +0, 381600, 38016, 0xafa5c2a5 +0, 385200, 38016, 0x621ce2b5 +0, 388800, 38016, 0x676c0440 +0, 392400, 38016, 0xa7c31e07 +0, 396000, 38016, 0x29612ba2 +0, 399600, 38016, 0xb38c3920 +0, 403200, 38016, 0xfcce3ee5 +0, 406800, 38016, 0x3ee81fac +0, 410400, 38016, 0x635cfdb0 +0, 414000, 38016, 0x222afa63 +0, 417600, 38016, 0x230c09cb +0, 421200, 38016, 0x2b491802 +0, 424800, 38016, 0x9cac2164 +0, 428400, 38016, 0xa0532de8 +0, 432000, 38016, 0x32e93592 +0, 435600, 38016, 0x724033a9 +0, 439200, 38016, 0x74411884 +0, 442800, 38016, 0xae14efcf +0, 446400, 38016, 0x0188cdc7 +0, 450000, 38016, 0x5708b5c1 +0, 453600, 38016, 0x54aba6da +0, 457200, 38016, 0x7364b397 +0, 460800, 38016, 0xf676c547 +0, 464400, 38016, 0x6926db3a +0, 468000, 38016, 0xccdbe5be +0, 471600, 38016, 0x8fc8e490 +0, 475200, 38016, 0x5d7fdd35 +0, 478800, 38016, 0x0e27e010 +0, 482400, 38016, 0x8120dd43 +0, 486000, 38016, 0x1612a173 +0, 489600, 38016, 0x3f1cb4b7 +0, 493200, 38016, 0xd1c7b0a6 +0, 496800, 38016, 0x472baad5 +0, 500400, 38016, 0xfe37a1f3 +0, 504000, 38016, 0x42a391ba +0, 507600, 38016, 0xdb618cac +0, 511200, 38016, 0x7af879bf +0, 514800, 38016, 0xe6f27644 +0, 518400, 38016, 0x550a7f0c +0, 522000, 38016, 0x7d297eaa +0, 525600, 38016, 0xaeb57623 +0, 529200, 38016, 0x6d5e4995 +0, 532800, 38016, 0x57df1be0 +0, 536400, 38016, 0x7617f825 +0, 540000, 38016, 0xf731aef2 +0, 543600, 38016, 0x489aae6c +0, 547200, 38016, 0x2d80b7a4 +0, 550800, 38016, 0xe4b6ac4e +0, 554400, 38016, 0xd243a374 +0, 558000, 38016, 0x5cf9b85b +0, 561600, 38016, 0xe824d798 +0, 565200, 38016, 0x8a46f630 +0, 568800, 38016, 0x4a03337f +0, 572400, 38016, 0xefe25cf7 +0, 576000, 38016, 0xed876efa +0, 579600, 38016, 0xdf1b6b65 +0, 583200, 38016, 0xd3225d8c +0, 586800, 38016, 0x0cf04d8d +0, 590400, 38016, 0x0fdc3bb3 +0, 594000, 38016, 0xc31bf5da +0, 597600, 38016, 0x09e0ec79 +0, 601200, 38016, 0x6521c8fb +0, 604800, 38016, 0x6f67a94c +0, 608400, 38016, 0xa0a49f38 +0, 612000, 38016, 0x759fb6f2 +0, 615600, 38016, 0xea41ddf8 +0, 619200, 38016, 0xe559f0a6 +0, 622800, 38016, 0x1dcbec38 +0, 626400, 38016, 0xfb62dc6a +0, 630000, 38016, 0x3d0fac24 +0, 633600, 38016, 0x87c373a1 +0, 637200, 38016, 0x97a84562 +0, 640800, 38016, 0xe4361c2e +0, 644400, 38016, 0x21170c47 +0, 648000, 38016, 0x0769ec52 +0, 651600, 38016, 0xac1ad44d +0, 655200, 38016, 0xdf87cb3e +0, 658800, 38016, 0x95c0d66f +0, 662400, 38016, 0xba33da6f +0, 666000, 38016, 0x71b2e866 +0, 669600, 38016, 0x64540dd1 +0, 673200, 38016, 0x79cb2d92 +0, 676800, 38016, 0xfe8e394b +0, 680400, 38016, 0x648f443f +0, 684000, 38016, 0x491eee56 +0, 687600, 38016, 0x6195b91b +0, 691200, 38016, 0x3935c2b0 +0, 694800, 38016, 0x2408e296 +0, 698400, 38016, 0xe17106b5 +0, 702000, 38016, 0xd8d01ad1 +0, 705600, 38016, 0x85d15104 +0, 709200, 38016, 0xacc16731 +0, 712800, 38016, 0xb6a990b7 +0, 716400, 38016, 0x8153a9cd +0, 720000, 38016, 0xef5ab92a +0, 723600, 38016, 0x392acfab +0, 727200, 38016, 0x7031d48e +0, 730800, 38016, 0x5d3ed39f +0, 734400, 38016, 0x004fd516 +0, 738000, 38016, 0x8de7dc94 +0, 741600, 38016, 0x7e21db4a +0, 745200, 38016, 0x518dd829 +0, 748800, 38016, 0xf780cf45 +0, 752400, 38016, 0x0a49bd6f +0, 756000, 38016, 0xadb65d17 +0, 759600, 38016, 0xbe79629d +0, 763200, 38016, 0x2daa65c8 +0, 766800, 38016, 0x0b4a6737 +0, 770400, 38016, 0x8e705885 +0, 774000, 38016, 0x6d2a4af2 +0, 777600, 38016, 0x89fe4b54 +0, 781200, 38016, 0x90cb4dde +0, 784800, 38016, 0x2d9e4f4e +0, 788400, 38016, 0x5fcd4a7b +0, 792000, 38016, 0xdb4143e7 +0, 795600, 38016, 0xd9343662 +0, 799200, 38016, 0xdf4a2af2 +0, 802800, 38016, 0xbe8f1fd2 +0, 806400, 38016, 0x4658200f +0, 810000, 38016, 0x92b51315 +0, 813600, 38016, 0x441f1576 +0, 817200, 38016, 0x970b29b4 +0, 820800, 38016, 0x93ac40f2 +0, 824400, 38016, 0xa0ac6b06 +0, 828000, 38016, 0xdd5b8f01 +0, 831600, 38016, 0xa921b3d5 +0, 835200, 38016, 0xdd6fdf01 +0, 838800, 38016, 0x1c6c0306 +0, 842400, 38016, 0xcea2235d +0, 846000, 38016, 0x43853758 +0, 849600, 38016, 0xa0234e29 +0, 853200, 38016, 0x94c85022 +0, 856800, 38016, 0xaf4e33ab +0, 860400, 38016, 0x07f90e0c +0, 864000, 38016, 0x99cee4bd +0, 867600, 38016, 0xb7cdcf79 +0, 871200, 38016, 0x5923c14c +0, 874800, 38016, 0x771f15d4 +0, 878400, 38016, 0x20f08043 +0, 882000, 38016, 0xb7bfeab2 +0, 885600, 38016, 0x53440996 +0, 889200, 38016, 0x6452d384 +0, 892800, 38016, 0xabcb975e +0, 896400, 38016, 0x146123b9 +0, 900000, 38016, 0xbeddbfff +0, 903600, 38016, 0xa0c97c47 +0, 907200, 38016, 0x1dca7308 +0, 910800, 38016, 0x16c5c832 +0, 914400, 38016, 0xcab326b9 +0, 918000, 38016, 0xe952c9bd +0, 921600, 38016, 0x216ec182 +0, 925200, 38016, 0xb21a5074 +0, 928800, 38016, 0xcbe73c15 +0, 932400, 38016, 0xb5e532de +0, 936000, 38016, 0x3a693aa5 +0, 939600, 38016, 0x157f4a20 +0, 943200, 38016, 0x9f9a5868 +0, 946800, 38016, 0x50f65ea1 +0, 950400, 38016, 0xe1735d4f +0, 954000, 38016, 0x15284ec7 +0, 957600, 38016, 0x32433d94 +0, 961200, 38016, 0x768f2092 +0, 964800, 38016, 0x6b01f5ad +0, 968400, 38016, 0xadcbce27 +0, 972000, 38016, 0x6faca613 +0, 975600, 38016, 0xd9327d40 +0, 979200, 38016, 0xbc1060ef +0, 982800, 38016, 0xbe071251 +0, 986400, 38016, 0x47abbfaa +0, 990000, 38016, 0x4851af88 +0, 993600, 38016, 0xff53c772 +0, 997200, 38016, 0xa1dcbef5 +0, 1000800, 38016, 0x106df309 +0, 1004400, 38016, 0x92e65f13 +0, 1008000, 38016, 0x7e8ffdb9 +0, 1011600, 38016, 0x0ba4d317 +0, 1015200, 38016, 0xe038a2a2 +0, 1018800, 38016, 0xc479675b +0, 1022400, 38016, 0xadbc4d18 +0, 1026000, 38016, 0x2d41a44b +0, 1029600, 38016, 0x3240617d +0, 1033200, 38016, 0xa60f9b98 +0, 1036800, 38016, 0x3aeea379 +0, 1040400, 38016, 0x45a0936c +0, 1044000, 38016, 0xf0c42d2f +0, 1047600, 38016, 0x930343ee +0, 1051200, 38016, 0xe074d631 +0, 1054800, 38016, 0xc6f20ab5 +0, 1058400, 38016, 0x3f5a4ef7 +0, 1062000, 38016, 0x94d44b16 +0, 1065600, 38016, 0xa52427da +0, 1069200, 38016, 0x2f2116a1 +0, 1072800, 38016, 0x566c2541 +0, 1076400, 38016, 0x0b894c8b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba2_sva_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba2_sva_b new file mode 100644 index 00000000..af25df70 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba2_sva_b @@ -0,0 +1,17 @@ +0, 0, 38016, 0xee831fe4 +0, 3600, 38016, 0xd9130e19 +0, 7200, 38016, 0x8ad70cae +0, 10800, 38016, 0x98f11d0e +0, 14400, 38016, 0x311d46ea +0, 18000, 38016, 0xe2f15cc5 +0, 21600, 38016, 0xb4c174c6 +0, 25200, 38016, 0x22708406 +0, 28800, 38016, 0x7116a2d2 +0, 32400, 38016, 0x7937b29b +0, 36000, 38016, 0xfa62a1d7 +0, 39600, 38016, 0x2066b1c6 +0, 43200, 38016, 0x18ecaa40 +0, 46800, 38016, 0xe5dc8d99 +0, 50400, 38016, 0x77046f4a +0, 54000, 38016, 0x1c50704f +0, 57600, 38016, 0x87f1879d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba3_sony_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba3_sony_c new file mode 100644 index 00000000..d5465b38 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba3_sony_c @@ -0,0 +1,300 @@ +0, 0, 38016, 0xb3883478 +0, 3600, 38016, 0xb6261cdd +0, 7200, 38016, 0x42ecede9 +0, 10800, 38016, 0xfcd6aec1 +0, 14400, 38016, 0xb3ffa014 +0, 18000, 38016, 0xc65383e3 +0, 21600, 38016, 0xa8494fb1 +0, 25200, 38016, 0x7fb14e0f +0, 28800, 38016, 0x7dd3462a +0, 32400, 38016, 0x4bd43dda +0, 36000, 38016, 0x717e736f +0, 39600, 38016, 0x2a9b8e47 +0, 43200, 38016, 0x1bc272be +0, 46800, 38016, 0x0127afb5 +0, 50400, 38016, 0xfd7aacda +0, 54000, 38016, 0xd41c9cf7 +0, 57600, 38016, 0xd205b1ee +0, 61200, 38016, 0x967ca895 +0, 64800, 38016, 0x25978063 +0, 68400, 38016, 0x632081b3 +0, 72000, 38016, 0x8ccf5f0b +0, 75600, 38016, 0x21cc2141 +0, 79200, 38016, 0x477d2543 +0, 82800, 38016, 0xff971bb8 +0, 86400, 38016, 0x0dc21005 +0, 90000, 38016, 0xc69c2d90 +0, 93600, 38016, 0xd7922b5d +0, 97200, 38016, 0x59a3278f +0, 100800, 38016, 0x83c55d4d +0, 104400, 38016, 0xaac96f23 +0, 108000, 38016, 0xed9563d3 +0, 111600, 38016, 0xf86b9ef4 +0, 115200, 38016, 0xe616b81c +0, 118800, 38016, 0xde60a57b +0, 122400, 38016, 0x5fe8d130 +0, 126000, 38016, 0x11decaca +0, 129600, 38016, 0x526fa8e2 +0, 133200, 38016, 0xc5e7ccfb +0, 136800, 38016, 0x10e1c588 +0, 140400, 38016, 0x78aeb05b +0, 144000, 38016, 0xff85c717 +0, 147600, 38016, 0x3f02c1b2 +0, 151200, 38016, 0xf45eb015 +0, 154800, 38016, 0x0211b84d +0, 158400, 38016, 0x3864ba1f +0, 162000, 38016, 0xe3728780 +0, 165600, 38016, 0x575da8b5 +0, 169200, 38016, 0xc841ad98 +0, 172800, 38016, 0xe69ea78f +0, 176400, 38016, 0x45cabf16 +0, 180000, 38016, 0x0e00b8eb +0, 183600, 38016, 0xa774a808 +0, 187200, 38016, 0xfb1bbc2b +0, 190800, 38016, 0xcfb4b41d +0, 194400, 38016, 0x66abaff8 +0, 198000, 38016, 0xc39ac9a9 +0, 201600, 38016, 0xbec0cc9a +0, 205200, 38016, 0xf393c7fc +0, 208800, 38016, 0xedb5d4ef +0, 212400, 38016, 0x4b0fd4fe +0, 216000, 38016, 0x98a59a5a +0, 219600, 38016, 0x0a69a4f3 +0, 223200, 38016, 0x72bc89ce +0, 226800, 38016, 0xfe8538b6 +0, 230400, 38016, 0xc8a158a3 +0, 234000, 38016, 0x1cb57fcd +0, 237600, 38016, 0x76c29215 +0, 241200, 38016, 0xdb36ec21 +0, 244800, 38016, 0xc2e22427 +0, 248400, 38016, 0xafb433cd +0, 252000, 38016, 0x4d736e28 +0, 255600, 38016, 0xc6ab9949 +0, 259200, 38016, 0xaa9bb9e6 +0, 262800, 38016, 0x0d41f894 +0, 266400, 38016, 0x603332b0 +0, 270000, 38016, 0x4c0b3afa +0, 273600, 38016, 0x8fd3845e +0, 277200, 38016, 0x8cf09ae3 +0, 280800, 38016, 0x1e02adfb +0, 284400, 38016, 0x3c9ac38e +0, 288000, 38016, 0xb5fdd2d9 +0, 291600, 38016, 0x82c5dd7f +0, 295200, 38016, 0x4b6ee80a +0, 298800, 38016, 0xaeaee46f +0, 302400, 38016, 0x390ed382 +0, 306000, 38016, 0xedbfde44 +0, 309600, 38016, 0xabf6eba0 +0, 313200, 38016, 0x5bf5efd0 +0, 316800, 38016, 0x9a88ebe3 +0, 320400, 38016, 0x2af7ec3b +0, 324000, 38016, 0x8fa69f07 +0, 327600, 38016, 0xff8fb3b5 +0, 331200, 38016, 0xd06fa3c1 +0, 334800, 38016, 0xe5a97d39 +0, 338400, 38016, 0x961e7c6f +0, 342000, 38016, 0x18b278af +0, 345600, 38016, 0x9a0d73d2 +0, 349200, 38016, 0x378f9d74 +0, 352800, 38016, 0x42e5a7a3 +0, 356400, 38016, 0x4595a78e +0, 360000, 38016, 0x6c09c035 +0, 363600, 38016, 0xec58ab98 +0, 367200, 38016, 0x1b4b8d2b +0, 370800, 38016, 0xf5199117 +0, 374400, 38016, 0xcd31af4d +0, 378000, 38016, 0xf294a253 +0, 381600, 38016, 0x360dde6b +0, 385200, 38016, 0x101cf70c +0, 388800, 38016, 0x4b34ff17 +0, 392400, 38016, 0x520639c0 +0, 396000, 38016, 0x901840a9 +0, 399600, 38016, 0x4cb03284 +0, 403200, 38016, 0x6929470c +0, 406800, 38016, 0x21282bdf +0, 410400, 38016, 0xee8df0ec +0, 414000, 38016, 0x24970e16 +0, 417600, 38016, 0x280118e3 +0, 421200, 38016, 0x00a10b64 +0, 424800, 38016, 0xb0673f83 +0, 428400, 38016, 0x838644de +0, 432000, 38016, 0x32e93592 +0, 435600, 38016, 0xedfc477a +0, 439200, 38016, 0x41062501 +0, 442800, 38016, 0xf218ebf2 +0, 446400, 38016, 0x3430dc73 +0, 450000, 38016, 0xb2fab8f0 +0, 453600, 38016, 0x11b19bab +0, 457200, 38016, 0x8e30b8e7 +0, 460800, 38016, 0xc8b9c646 +0, 464400, 38016, 0xc902d559 +0, 468000, 38016, 0x3a24ec30 +0, 471600, 38016, 0x744de424 +0, 475200, 38016, 0xc40cd059 +0, 478800, 38016, 0xd98dd9ec +0, 482400, 38016, 0x9719d698 +0, 486000, 38016, 0x1612a173 +0, 489600, 38016, 0xc044b9f1 +0, 493200, 38016, 0xc433af2f +0, 496800, 38016, 0x559891e3 +0, 500400, 38016, 0x969e9a33 +0, 504000, 38016, 0x8a6a8e77 +0, 507600, 38016, 0x9d7b76bf +0, 511200, 38016, 0x3725711a +0, 514800, 38016, 0x5b316bd0 +0, 518400, 38016, 0x4c616abd +0, 522000, 38016, 0x43637e2b +0, 525600, 38016, 0xd9e36c4c +0, 529200, 38016, 0x823d3596 +0, 532800, 38016, 0x57361a59 +0, 536400, 38016, 0x4a91f007 +0, 540000, 38016, 0xf731aef2 +0, 543600, 38016, 0x8ed2c618 +0, 547200, 38016, 0x6f1cc918 +0, 550800, 38016, 0x2a8ba336 +0, 554400, 38016, 0x8159b595 +0, 558000, 38016, 0x07cfced9 +0, 561600, 38016, 0x8804c878 +0, 565200, 38016, 0x624e0656 +0, 568800, 38016, 0x8628302b +0, 572400, 38016, 0xd155461e +0, 576000, 38016, 0x3c1c647c +0, 579600, 38016, 0x8a485727 +0, 583200, 38016, 0x144934f7 +0, 586800, 38016, 0x43183494 +0, 590400, 38016, 0x20fd2ef2 +0, 594000, 38016, 0xc31bf5da +0, 597600, 38016, 0x4c70f0f2 +0, 601200, 38016, 0xba1bcbcc +0, 604800, 38016, 0x11039c6c +0, 608400, 38016, 0x67c59b61 +0, 612000, 38016, 0xdc0aa2ba +0, 615600, 38016, 0x1e2dbec9 +0, 619200, 38016, 0xacacdc6c +0, 622800, 38016, 0x2049defe +0, 626400, 38016, 0x7488cc3e +0, 630000, 38016, 0x14bca829 +0, 633600, 38016, 0xc19c76ee +0, 637200, 38016, 0xeca33612 +0, 640800, 38016, 0x93b027a5 +0, 644400, 38016, 0x82ae1e62 +0, 648000, 38016, 0x0769ec52 +0, 651600, 38016, 0x7cdee8dd +0, 655200, 38016, 0x7d22d43d +0, 658800, 38016, 0x65d8cd49 +0, 662400, 38016, 0xa7d2ede4 +0, 666000, 38016, 0x6bd2ffa1 +0, 669600, 38016, 0xb4db0734 +0, 673200, 38016, 0x69cb35ac +0, 676800, 38016, 0x05e52e88 +0, 680400, 38016, 0x4dc92a43 +0, 684000, 38016, 0x8ca0e858 +0, 687600, 38016, 0x74fbae53 +0, 691200, 38016, 0x19f0aa17 +0, 694800, 38016, 0x04c9dc83 +0, 698400, 38016, 0x0a8ff4b9 +0, 702000, 38016, 0xd8d01ad1 +0, 705600, 38016, 0xa41b5100 +0, 709200, 38016, 0xfaf96547 +0, 712800, 38016, 0xadab8265 +0, 716400, 38016, 0x6e12a9c3 +0, 720000, 38016, 0x1de7b7d1 +0, 723600, 38016, 0x2279bc4a +0, 727200, 38016, 0x4f62ca0f +0, 730800, 38016, 0xfaf2cc43 +0, 734400, 38016, 0xbf68c7df +0, 738000, 38016, 0xb927d1ea +0, 741600, 38016, 0x8b93d7c6 +0, 745200, 38016, 0x13f3d7d6 +0, 748800, 38016, 0x9ee4cc7b +0, 752400, 38016, 0x16deb1a0 +0, 756000, 38016, 0xadb65d17 +0, 759600, 38016, 0x0b9e7542 +0, 763200, 38016, 0x05777490 +0, 766800, 38016, 0x6805549f +0, 770400, 38016, 0xe3246225 +0, 774000, 38016, 0x4003551b +0, 777600, 38016, 0x1e083a01 +0, 781200, 38016, 0x756e4f22 +0, 784800, 38016, 0xf2f24967 +0, 788400, 38016, 0x680d37f2 +0, 792000, 38016, 0x85b34185 +0, 795600, 38016, 0xefa32eeb +0, 799200, 38016, 0xca791448 +0, 802800, 38016, 0x7c6b2b13 +0, 806400, 38016, 0x0d8232a6 +0, 810000, 38016, 0x92b51315 +0, 813600, 38016, 0xcfde349c +0, 817200, 38016, 0xdc1a488b +0, 820800, 38016, 0xdcf94106 +0, 824400, 38016, 0xc205829b +0, 828000, 38016, 0x0aff9da3 +0, 831600, 38016, 0x3295b04e +0, 835200, 38016, 0xc42dfaab +0, 838800, 38016, 0x799e14a2 +0, 842400, 38016, 0xf658150c +0, 846000, 38016, 0x4c8751fe +0, 849600, 38016, 0xe57d58ed +0, 853200, 38016, 0x28f83c49 +0, 856800, 38016, 0x9760453c +0, 860400, 38016, 0x1d550fcf +0, 864000, 38016, 0x99cee4bd +0, 867600, 38016, 0x743ad122 +0, 871200, 38016, 0xb533ab7c +0, 874800, 38016, 0x5ca5fc65 +0, 878400, 38016, 0x491c7076 +0, 882000, 38016, 0x8a96d9e5 +0, 885600, 38016, 0x23c3f207 +0, 889200, 38016, 0x3181d62d +0, 892800, 38016, 0xc72e9636 +0, 896400, 38016, 0xe0c31ae9 +0, 900000, 38016, 0x2f91c0ce +0, 903600, 38016, 0x17937763 +0, 907200, 38016, 0x61986c20 +0, 910800, 38016, 0x6adeca83 +0, 914400, 38016, 0x894a376b +0, 918000, 38016, 0xe952c9bd +0, 921600, 38016, 0x0418d8e9 +0, 925200, 38016, 0x30de606e +0, 928800, 38016, 0xd15e3116 +0, 932400, 38016, 0xee0446ac +0, 936000, 38016, 0x34ee44f7 +0, 939600, 38016, 0x825745d4 +0, 943200, 38016, 0xb8046176 +0, 946800, 38016, 0xa812588a +0, 950400, 38016, 0xed754b26 +0, 954000, 38016, 0xa39c51cd +0, 957600, 38016, 0x315b38d5 +0, 961200, 38016, 0x12550e05 +0, 964800, 38016, 0xbda6fd9a +0, 968400, 38016, 0xd10bd86c +0, 972000, 38016, 0x6faca613 +0, 975600, 38016, 0x6268848a +0, 979200, 38016, 0x2b8367e6 +0, 982800, 38016, 0xdb6806fd +0, 986400, 38016, 0x4f58d418 +0, 990000, 38016, 0x59beb628 +0, 993600, 38016, 0x8017aae2 +0, 997200, 38016, 0xb26ad1b3 +0, 1000800, 38016, 0xa058f3a3 +0, 1004400, 38016, 0x4fee4ac2 +0, 1008000, 38016, 0x5dd20ae9 +0, 1011600, 38016, 0x6365dbda +0, 1015200, 38016, 0x25b47f80 +0, 1018800, 38016, 0x468b8ecb +0, 1022400, 38016, 0x0b0760f9 +0, 1026000, 38016, 0x2d41a44b +0, 1029600, 38016, 0x4bb47357 +0, 1033200, 38016, 0x2c0ca74c +0, 1036800, 38016, 0x6484a271 +0, 1040400, 38016, 0xa55871df +0, 1044000, 38016, 0xa617ecd8 +0, 1047600, 38016, 0xf7231cc5 +0, 1051200, 38016, 0x15dba20b +0, 1054800, 38016, 0x56a7d8c7 +0, 1058400, 38016, 0x5e78382b +0, 1062000, 38016, 0x8edf243b +0, 1065600, 38016, 0x571effaf +0, 1069200, 38016, 0x274302d2 +0, 1072800, 38016, 0xc950203d +0, 1076400, 38016, 0x4a744324 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba3_sva_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba3_sva_b new file mode 100644 index 00000000..449fb754 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba3_sva_b @@ -0,0 +1,33 @@ +0, 0, 38016, 0x0e091175 +0, 3600, 38016, 0xe8f81506 +0, 7200, 38016, 0xf706f5cd +0, 10800, 38016, 0x9aeb21b1 +0, 14400, 38016, 0xdc533379 +0, 18000, 38016, 0xd26d534b +0, 21600, 38016, 0xdcb25dc5 +0, 25200, 38016, 0x1b258cc2 +0, 28800, 38016, 0xdfb58ff8 +0, 32400, 38016, 0x143abf85 +0, 36000, 38016, 0xace399ea +0, 39600, 38016, 0x1ad6bb8e +0, 43200, 38016, 0xf01d9b78 +0, 46800, 38016, 0x5a0c99ed +0, 50400, 38016, 0x9d4e684c +0, 54000, 38016, 0xca3d811f +0, 57600, 38016, 0x388c7bc4 +0, 61200, 38016, 0x36329ae0 +0, 64800, 38016, 0x7ca686ac +0, 68400, 38016, 0x9d7ababf +0, 72000, 38016, 0x563eaf2a +0, 75600, 38016, 0xce22a4be +0, 79200, 38016, 0xb7cb719a +0, 82800, 38016, 0x7b706edf +0, 86400, 38016, 0x009a30b5 +0, 90000, 38016, 0xf1fe3fbc +0, 93600, 38016, 0x7f732436 +0, 97200, 38016, 0x055147ec +0, 100800, 38016, 0x1670494c +0, 104400, 38016, 0xfede7bab +0, 108000, 38016, 0xa3b660d8 +0, 111600, 38016, 0x33db7209 +0, 115200, 38016, 0xb7b25559 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba3_toshiba_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba3_toshiba_e new file mode 100644 index 00000000..e8746591 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caba3_toshiba_e @@ -0,0 +1,300 @@ +0, 0, 38016, 0x72723ce4 +0, 3600, 38016, 0x347219d7 +0, 7200, 38016, 0x813ff182 +0, 10800, 38016, 0x4e69d41a +0, 14400, 38016, 0x5e56acb6 +0, 18000, 38016, 0xe72197e5 +0, 21600, 38016, 0xd035807a +0, 25200, 38016, 0x9ee57559 +0, 28800, 38016, 0xd0f56f28 +0, 32400, 38016, 0xa5097788 +0, 36000, 38016, 0xf108978d +0, 39600, 38016, 0xf76cb475 +0, 43200, 38016, 0x0184cc3a +0, 46800, 38016, 0xa4b5dc15 +0, 50400, 38016, 0x209cdc42 +0, 54000, 38016, 0xd9e69a8c +0, 57600, 38016, 0xa2c3a9ba +0, 61200, 38016, 0xdf84a52e +0, 64800, 38016, 0xfe48a7f0 +0, 68400, 38016, 0xb0279a19 +0, 72000, 38016, 0xf3b48652 +0, 75600, 38016, 0xc12b61b5 +0, 79200, 38016, 0x13065a22 +0, 82800, 38016, 0x804853d4 +0, 86400, 38016, 0x40935736 +0, 90000, 38016, 0x1a135ecb +0, 93600, 38016, 0x125f6116 +0, 97200, 38016, 0x53286da3 +0, 100800, 38016, 0xd49287ac +0, 104400, 38016, 0xc70a9c2c +0, 108000, 38016, 0x0c0c6998 +0, 111600, 38016, 0xf37d9141 +0, 115200, 38016, 0xd36eafa2 +0, 118800, 38016, 0x0d1fc298 +0, 122400, 38016, 0xf84ad5d9 +0, 126000, 38016, 0xc1e8d93d +0, 129600, 38016, 0xe190dabd +0, 133200, 38016, 0x9542db28 +0, 136800, 38016, 0xa67edc7f +0, 140400, 38016, 0x65efdfa7 +0, 144000, 38016, 0x7039e6c6 +0, 147600, 38016, 0x8307ee87 +0, 151200, 38016, 0x1f83ec00 +0, 154800, 38016, 0x9e33ea6e +0, 158400, 38016, 0xb53ef238 +0, 162000, 38016, 0x6d04930c +0, 165600, 38016, 0xed90a50e +0, 169200, 38016, 0xd98cb4a6 +0, 172800, 38016, 0xa7f5bd5e +0, 176400, 38016, 0x4df9ca95 +0, 180000, 38016, 0xc8e7cb40 +0, 183600, 38016, 0x93d9d23c +0, 187200, 38016, 0xc07fd34f +0, 190800, 38016, 0xf7c5d645 +0, 194400, 38016, 0x3c1ddf53 +0, 198000, 38016, 0x0bafe394 +0, 201600, 38016, 0x9179ec6f +0, 205200, 38016, 0x3483efc3 +0, 208800, 38016, 0xf7ccf70d +0, 212400, 38016, 0x289ef13b +0, 216000, 38016, 0xb00c99dc +0, 219600, 38016, 0x59409b34 +0, 223200, 38016, 0x3fc079a2 +0, 226800, 38016, 0x90ad49d9 +0, 230400, 38016, 0x8e7751e2 +0, 234000, 38016, 0xed20743d +0, 237600, 38016, 0x66a1a470 +0, 241200, 38016, 0x7a77e252 +0, 244800, 38016, 0x6bb427fe +0, 248400, 38016, 0x87126360 +0, 252000, 38016, 0x330789d0 +0, 255600, 38016, 0xc298b987 +0, 259200, 38016, 0x4959f143 +0, 262800, 38016, 0xa66e3082 +0, 266400, 38016, 0xb9f67824 +0, 270000, 38016, 0x27fe46a2 +0, 273600, 38016, 0xc50c87ed +0, 277200, 38016, 0x9523a9f6 +0, 280800, 38016, 0xbe28d1d7 +0, 284400, 38016, 0x3c0ee964 +0, 288000, 38016, 0x65c7f36c +0, 291600, 38016, 0xe5030946 +0, 295200, 38016, 0x4bbb11fa +0, 298800, 38016, 0xeaf209ed +0, 302400, 38016, 0x96c80987 +0, 306000, 38016, 0x69820c58 +0, 309600, 38016, 0x5f951aa7 +0, 313200, 38016, 0xfe6122d9 +0, 316800, 38016, 0xa202301a +0, 320400, 38016, 0xdd2628fb +0, 324000, 38016, 0xe081a5ff +0, 327600, 38016, 0x5b858e9e +0, 331200, 38016, 0x7a368229 +0, 334800, 38016, 0x3791829a +0, 338400, 38016, 0x9c68723d +0, 342000, 38016, 0xef26778e +0, 345600, 38016, 0x39a491cf +0, 349200, 38016, 0x776ea867 +0, 352800, 38016, 0xda9ac03b +0, 356400, 38016, 0x653bc9a3 +0, 360000, 38016, 0x79e1da19 +0, 363600, 38016, 0x3b98c6eb +0, 367200, 38016, 0x42cdb846 +0, 370800, 38016, 0x7872ada1 +0, 374400, 38016, 0xb2f6d2ef +0, 378000, 38016, 0x9468b16a +0, 381600, 38016, 0xe793c91a +0, 385200, 38016, 0x80bde366 +0, 388800, 38016, 0xa7250446 +0, 392400, 38016, 0x7039280b +0, 396000, 38016, 0x1665350c +0, 399600, 38016, 0xb5c93f1f +0, 403200, 38016, 0xf77a4c44 +0, 406800, 38016, 0x3a093143 +0, 410400, 38016, 0x1d6b1005 +0, 414000, 38016, 0xe1a10c01 +0, 417600, 38016, 0x2d4d1d54 +0, 421200, 38016, 0x902f2b14 +0, 424800, 38016, 0xb26e3e73 +0, 428400, 38016, 0xed7a469e +0, 432000, 38016, 0xbc663d2a +0, 435600, 38016, 0x60a5488e +0, 439200, 38016, 0x451b31ca +0, 442800, 38016, 0x54311166 +0, 446400, 38016, 0x57d9f31e +0, 450000, 38016, 0x567dd693 +0, 453600, 38016, 0x0e58d88c +0, 457200, 38016, 0xa555e124 +0, 460800, 38016, 0x94e2f835 +0, 464400, 38016, 0xe49e0ec0 +0, 468000, 38016, 0x585d188e +0, 471600, 38016, 0x696e1a0d +0, 475200, 38016, 0xac9014b1 +0, 478800, 38016, 0x915413c6 +0, 482400, 38016, 0x5fa30be7 +0, 486000, 38016, 0x8fbfb69c +0, 489600, 38016, 0xcaeabfab +0, 493200, 38016, 0xe494bf5c +0, 496800, 38016, 0xae03be55 +0, 500400, 38016, 0xb734b4d3 +0, 504000, 38016, 0xdc6fb56f +0, 507600, 38016, 0xfea0a853 +0, 511200, 38016, 0xb4919381 +0, 514800, 38016, 0x13a792fe +0, 518400, 38016, 0xc8829fd8 +0, 522000, 38016, 0x2113a62b +0, 525600, 38016, 0x171f98d2 +0, 529200, 38016, 0x1a6d6d17 +0, 532800, 38016, 0xd4ab41c3 +0, 536400, 38016, 0xd2df1c80 +0, 540000, 38016, 0x14cdbb35 +0, 543600, 38016, 0x2b74b829 +0, 547200, 38016, 0x6433bd55 +0, 550800, 38016, 0xd11dbc28 +0, 554400, 38016, 0x4981ad33 +0, 558000, 38016, 0xc38bbbad +0, 561600, 38016, 0x048de367 +0, 565200, 38016, 0x6c9a0c5a +0, 568800, 38016, 0x384c4255 +0, 572400, 38016, 0x3e9873ba +0, 576000, 38016, 0xe4988671 +0, 579600, 38016, 0x05b4843c +0, 583200, 38016, 0xed0a7e13 +0, 586800, 38016, 0x750c6f90 +0, 590400, 38016, 0x9d296035 +0, 594000, 38016, 0xbaa006bd +0, 597600, 38016, 0x8289f8ae +0, 601200, 38016, 0x3f3de147 +0, 604800, 38016, 0xc5debc49 +0, 608400, 38016, 0x1fe9bbfc +0, 612000, 38016, 0x006cd4a9 +0, 615600, 38016, 0xe551f2b3 +0, 619200, 38016, 0xb370140e +0, 622800, 38016, 0xc9441c24 +0, 626400, 38016, 0x7f5c01c5 +0, 630000, 38016, 0x352ad9f6 +0, 633600, 38016, 0xe0909a17 +0, 637200, 38016, 0x49bf5ea8 +0, 640800, 38016, 0x7f1d387b +0, 644400, 38016, 0x30812233 +0, 648000, 38016, 0xb0bdf16f +0, 651600, 38016, 0x5372d0e9 +0, 655200, 38016, 0xbf1bc91c +0, 658800, 38016, 0xaef5d647 +0, 662400, 38016, 0xf007e86c +0, 666000, 38016, 0x683bf72b +0, 669600, 38016, 0xbb722114 +0, 673200, 38016, 0xc5864b63 +0, 676800, 38016, 0xfefd5cf4 +0, 680400, 38016, 0xa0f263d5 +0, 684000, 38016, 0x18401a02 +0, 687600, 38016, 0x55cdd97b +0, 691200, 38016, 0x5a4ee22d +0, 694800, 38016, 0xa60706b3 +0, 698400, 38016, 0x644422bb +0, 702000, 38016, 0xc22421c9 +0, 705600, 38016, 0x1d6b54e4 +0, 709200, 38016, 0xc7627820 +0, 712800, 38016, 0x0a6ea609 +0, 716400, 38016, 0x4315c087 +0, 720000, 38016, 0x3164d978 +0, 723600, 38016, 0x08e3e7eb +0, 727200, 38016, 0x4f04eaed +0, 730800, 38016, 0x9f83eb5a +0, 734400, 38016, 0xfbbcf0b2 +0, 738000, 38016, 0xee1efb8a +0, 741600, 38016, 0x87710ba0 +0, 745200, 38016, 0xb96b05c1 +0, 748800, 38016, 0xd5a4fc50 +0, 752400, 38016, 0xad85ea19 +0, 756000, 38016, 0x5f606058 +0, 759600, 38016, 0xdaf55ad0 +0, 763200, 38016, 0xee8564d6 +0, 766800, 38016, 0xa1846cad +0, 770400, 38016, 0xcd316a62 +0, 774000, 38016, 0xdcf5638f +0, 777600, 38016, 0xc5e36d1d +0, 781200, 38016, 0x958369a6 +0, 784800, 38016, 0x05826bf0 +0, 788400, 38016, 0x22146914 +0, 792000, 38016, 0xf5086111 +0, 795600, 38016, 0x88f35468 +0, 799200, 38016, 0x3ae94126 +0, 802800, 38016, 0xf4473aa8 +0, 806400, 38016, 0x430c3da2 +0, 810000, 38016, 0xaf95113e +0, 813600, 38016, 0xa8a216d6 +0, 817200, 38016, 0xad2f328c +0, 820800, 38016, 0xea724415 +0, 824400, 38016, 0x34016af4 +0, 828000, 38016, 0x4829a4cb +0, 831600, 38016, 0x4b24bc67 +0, 835200, 38016, 0xb523f023 +0, 838800, 38016, 0x5c6d2305 +0, 842400, 38016, 0x39e63adc +0, 846000, 38016, 0xf7c64a7c +0, 849600, 38016, 0xd601680a +0, 853200, 38016, 0xbbad6a12 +0, 856800, 38016, 0xddc1500f +0, 860400, 38016, 0x1f1726e6 +0, 864000, 38016, 0x48aee68f +0, 867600, 38016, 0xc1fbd4f0 +0, 871200, 38016, 0x4a89dc83 +0, 874800, 38016, 0xa7cd2b02 +0, 878400, 38016, 0xf52aa0b8 +0, 882000, 38016, 0x1f260626 +0, 885600, 38016, 0x80561eac +0, 889200, 38016, 0x6687f8ef +0, 892800, 38016, 0x986ab08f +0, 896400, 38016, 0xb4923773 +0, 900000, 38016, 0x5cc2d603 +0, 903600, 38016, 0x9e8d93db +0, 907200, 38016, 0x33fd8981 +0, 910800, 38016, 0xaf45e630 +0, 914400, 38016, 0x1227448e +0, 918000, 38016, 0x424cccf0 +0, 921600, 38016, 0x03b0cb3e +0, 925200, 38016, 0x7aad547d +0, 928800, 38016, 0xbf8544b2 +0, 932400, 38016, 0x54a843ca +0, 936000, 38016, 0x759d4dd0 +0, 939600, 38016, 0x000162da +0, 943200, 38016, 0x87ec74b0 +0, 946800, 38016, 0xefee8259 +0, 950400, 38016, 0x7b547eea +0, 954000, 38016, 0xcae96b73 +0, 957600, 38016, 0x730f59c3 +0, 961200, 38016, 0x7d9b3e82 +0, 964800, 38016, 0x3bb11ef0 +0, 968400, 38016, 0x7581fa6b +0, 972000, 38016, 0xe594a982 +0, 975600, 38016, 0xde3888d6 +0, 979200, 38016, 0x0e096d6b +0, 982800, 38016, 0x297c20dc +0, 986400, 38016, 0x51f7ce7f +0, 990000, 38016, 0x23d2c247 +0, 993600, 38016, 0x0bdcd0d0 +0, 997200, 38016, 0x63cfd4f3 +0, 1000800, 38016, 0x6d4b01f8 +0, 1004400, 38016, 0xa50d72f0 +0, 1008000, 38016, 0xccad0d72 +0, 1011600, 38016, 0x10c9e33e +0, 1015200, 38016, 0xba6daf97 +0, 1018800, 38016, 0xd65074e0 +0, 1022400, 38016, 0xd36954aa +0, 1026000, 38016, 0xd9a2a642 +0, 1029600, 38016, 0xce755f9f +0, 1033200, 38016, 0x81d29c44 +0, 1036800, 38016, 0x23b0aef5 +0, 1040400, 38016, 0xb0ef9efa +0, 1044000, 38016, 0xf20d4a7a +0, 1047600, 38016, 0xa0c86899 +0, 1051200, 38016, 0x1ae4f865 +0, 1054800, 38016, 0x3a5731c8 +0, 1058400, 38016, 0x75f17ec5 +0, 1062000, 38016, 0x8f447aa9 +0, 1065600, 38016, 0x71615441 +0, 1069200, 38016, 0x90c13e26 +0, 1072800, 38016, 0x08d04aaf +0, 1076400, 38016, 0x14fd7b04 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabac_mot_fld0_full b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabac_mot_fld0_full new file mode 100644 index 00000000..a88e0c10 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabac_mot_fld0_full @@ -0,0 +1,30 @@ +0, 0, 518400, 0xbf168f4e +0, 3600, 518400, 0xeda5e54f +0, 7200, 518400, 0xef496d43 +0, 10800, 518400, 0x6b68dad5 +0, 14400, 518400, 0x9a40a7de +0, 18000, 518400, 0x0c21c018 +0, 21600, 518400, 0x4ac5a846 +0, 25200, 518400, 0x3a1aa817 +0, 28800, 518400, 0xcc4eb434 +0, 32400, 518400, 0x4368a3c2 +0, 36000, 518400, 0xb923682f +0, 39600, 518400, 0xd95460a8 +0, 43200, 518400, 0x8e8518aa +0, 46800, 518400, 0x292a1a80 +0, 50400, 518400, 0xbada388e +0, 54000, 518400, 0xa67f63c9 +0, 57600, 518400, 0x9fc77e21 +0, 61200, 518400, 0xe99dc2ac +0, 64800, 518400, 0x17d7d080 +0, 68400, 518400, 0x41760c0b +0, 72000, 518400, 0x3c70f34d +0, 75600, 518400, 0x0d640285 +0, 79200, 518400, 0x448893e8 +0, 82800, 518400, 0x08194490 +0, 86400, 518400, 0xcf227031 +0, 90000, 518400, 0x8d94587d +0, 93600, 518400, 0x696fca01 +0, 97200, 518400, 0xe0ab234b +0, 100800, 518400, 0x0620153b +0, 104400, 518400, 0xb78c146c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabac_mot_frm0_full b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabac_mot_frm0_full new file mode 100644 index 00000000..437a86be --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabac_mot_frm0_full @@ -0,0 +1,30 @@ +0, 0, 518400, 0x40c7e2d9 +0, 3600, 518400, 0xb16701a5 +0, 7200, 518400, 0x12c2f5b1 +0, 10800, 518400, 0x9832aecc +0, 14400, 518400, 0x2b8bcdec +0, 18000, 518400, 0x04448f3a +0, 21600, 518400, 0xc7ac82d8 +0, 25200, 518400, 0xe746bb8a +0, 28800, 518400, 0xc7ac92d3 +0, 32400, 518400, 0x38d89443 +0, 36000, 518400, 0xcb9fbe74 +0, 39600, 518400, 0x5543867d +0, 43200, 518400, 0xaf1b147f +0, 46800, 518400, 0xe5f07e40 +0, 50400, 518400, 0x66dc6734 +0, 54000, 518400, 0x0f9491be +0, 57600, 518400, 0xbcdaacac +0, 61200, 518400, 0xf4480ae7 +0, 64800, 518400, 0xa5cef4d5 +0, 68400, 518400, 0x9e4e4320 +0, 72000, 518400, 0x620c3212 +0, 75600, 518400, 0x4350df1d +0, 79200, 518400, 0x6360ef84 +0, 82800, 518400, 0xc1866d03 +0, 86400, 518400, 0x38eb3b5b +0, 90000, 518400, 0x00166df1 +0, 93600, 518400, 0x841ea87c +0, 97200, 518400, 0x8b40f836 +0, 100800, 518400, 0x3b380ddf +0, 104400, 518400, 0x275adf46 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabac_mot_mbaff0_full b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabac_mot_mbaff0_full new file mode 100644 index 00000000..0e582f39 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabac_mot_mbaff0_full @@ -0,0 +1,30 @@ +0, 0, 518400, 0x8336b7db +0, 3600, 518400, 0x9818c309 +0, 7200, 518400, 0x5417b6f9 +0, 10800, 518400, 0x8f0a5de4 +0, 14400, 518400, 0xa4ce43f3 +0, 18000, 518400, 0xfe748339 +0, 21600, 518400, 0xeab93a93 +0, 25200, 518400, 0x095176e4 +0, 28800, 518400, 0x99a45050 +0, 32400, 518400, 0xad3766e8 +0, 36000, 518400, 0xea133c1b +0, 39600, 518400, 0xdcb2188b +0, 43200, 518400, 0xec08c8ce +0, 46800, 518400, 0xf38cd4f2 +0, 50400, 518400, 0x06177f80 +0, 54000, 518400, 0x2c68b642 +0, 57600, 518400, 0x7d290881 +0, 61200, 518400, 0x26c939d8 +0, 64800, 518400, 0xa0391a6e +0, 68400, 518400, 0x3b9f02c1 +0, 72000, 518400, 0x335a0ff9 +0, 75600, 518400, 0x0deafb41 +0, 79200, 518400, 0xbf00bfe4 +0, 82800, 518400, 0xc9145210 +0, 86400, 518400, 0xb6e16a54 +0, 90000, 518400, 0xc31664da +0, 93600, 518400, 0xfd3be55d +0, 97200, 518400, 0xf33b134c +0, 100800, 518400, 0xc6977304 +0, 104400, 518400, 0xa605bdb6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabac_mot_picaff0_full b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabac_mot_picaff0_full new file mode 100644 index 00000000..f2d6358a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabac_mot_picaff0_full @@ -0,0 +1,30 @@ +0, 0, 518400, 0xd8b58a23 +0, 3600, 518400, 0xe53b4aba +0, 7200, 518400, 0x6cbca47a +0, 10800, 518400, 0xceb51253 +0, 14400, 518400, 0x60cb3cdd +0, 18000, 518400, 0x7b633553 +0, 21600, 518400, 0x10c012c9 +0, 25200, 518400, 0xa340ee20 +0, 28800, 518400, 0x574c22c2 +0, 32400, 518400, 0xbcdb1bf7 +0, 36000, 518400, 0x57811e9a +0, 39600, 518400, 0xdd4af748 +0, 43200, 518400, 0xb931a637 +0, 46800, 518400, 0xcef6ce95 +0, 50400, 518400, 0xd28c7085 +0, 54000, 518400, 0xae9daf53 +0, 57600, 518400, 0xca29d819 +0, 61200, 518400, 0x3c4bd7eb +0, 64800, 518400, 0x912ee227 +0, 68400, 518400, 0xb67d0e27 +0, 72000, 518400, 0x8cf7309d +0, 75600, 518400, 0x358ad344 +0, 79200, 518400, 0x4462c642 +0, 82800, 518400, 0x3bb43428 +0, 86400, 518400, 0x12d6f8ca +0, 90000, 518400, 0x003f13aa +0, 93600, 518400, 0x6cd8c432 +0, 97200, 518400, 0xee5ff01b +0, 100800, 518400, 0xba0616ee +0, 104400, 518400, 0x37fa7891 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabaci3_sony_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabaci3_sony_b new file mode 100644 index 00000000..f0ea8c23 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabaci3_sony_b @@ -0,0 +1,300 @@ +0, 0, 38016, 0x705f2f41 +0, 3600, 38016, 0xa76d1766 +0, 7200, 38016, 0xf367e6f4 +0, 10800, 38016, 0xdce8a69a +0, 14400, 38016, 0xda9d986e +0, 18000, 38016, 0x50117ea5 +0, 21600, 38016, 0x07a848eb +0, 25200, 38016, 0x28ab4f59 +0, 28800, 38016, 0xf6913e4c +0, 32400, 38016, 0x3daa3500 +0, 36000, 38016, 0xe9f67703 +0, 39600, 38016, 0x9a5289e6 +0, 43200, 38016, 0x9efd705f +0, 46800, 38016, 0x1193b01d +0, 50400, 38016, 0x30a5acd7 +0, 54000, 38016, 0x7e3da07d +0, 57600, 38016, 0x0f85afc6 +0, 61200, 38016, 0x8b7ba455 +0, 64800, 38016, 0xac327dfb +0, 68400, 38016, 0x3eee7fdb +0, 72000, 38016, 0x37fa626b +0, 75600, 38016, 0x2c4f2501 +0, 79200, 38016, 0xa25a239a +0, 82800, 38016, 0xe69b2327 +0, 86400, 38016, 0x6bd6164e +0, 90000, 38016, 0xae9c2daa +0, 93600, 38016, 0xe115331d +0, 97200, 38016, 0xde8f2833 +0, 100800, 38016, 0xd0b45915 +0, 104400, 38016, 0x3ab16824 +0, 108000, 38016, 0x4df45e8d +0, 111600, 38016, 0x48569b82 +0, 115200, 38016, 0x75c5b1ee +0, 118800, 38016, 0x64e5a3ba +0, 122400, 38016, 0x3190d133 +0, 126000, 38016, 0x4825ce86 +0, 129600, 38016, 0x8f85ab8e +0, 133200, 38016, 0x3fb1cbc5 +0, 136800, 38016, 0x2b2cbe7d +0, 140400, 38016, 0xa905a6a6 +0, 144000, 38016, 0x6365c188 +0, 147600, 38016, 0xff23c08d +0, 151200, 38016, 0x73edada6 +0, 154800, 38016, 0x6be0b8a9 +0, 158400, 38016, 0x604bb6c9 +0, 162000, 38016, 0x62468a3b +0, 165600, 38016, 0x994aad7a +0, 169200, 38016, 0xfee1b59e +0, 172800, 38016, 0xf722aa78 +0, 176400, 38016, 0x0ddfbf68 +0, 180000, 38016, 0x510ab7b1 +0, 183600, 38016, 0x156ca919 +0, 187200, 38016, 0xb176b488 +0, 190800, 38016, 0xd70cb8f8 +0, 194400, 38016, 0x3844b2d2 +0, 198000, 38016, 0x0ed8c6ee +0, 201600, 38016, 0x0c6ac5ff +0, 205200, 38016, 0x1284c442 +0, 208800, 38016, 0x0486d06c +0, 212400, 38016, 0x0d42d1c1 +0, 216000, 38016, 0xd24297f3 +0, 219600, 38016, 0xe05cab59 +0, 223200, 38016, 0x12f1921f +0, 226800, 38016, 0x0dc6403e +0, 230400, 38016, 0x277f593c +0, 234000, 38016, 0xfb7c81f8 +0, 237600, 38016, 0xb31b90b0 +0, 241200, 38016, 0x8be3e8ae +0, 244800, 38016, 0x9aaa1ff1 +0, 248400, 38016, 0x4e6832b9 +0, 252000, 38016, 0x93fd6a5e +0, 255600, 38016, 0xd9438f08 +0, 259200, 38016, 0x5e41b067 +0, 262800, 38016, 0xee80f32a +0, 266400, 38016, 0x75632fe3 +0, 270000, 38016, 0xc0a93ec1 +0, 273600, 38016, 0x4e3e80c4 +0, 277200, 38016, 0x9e5398d6 +0, 280800, 38016, 0xd20aac32 +0, 284400, 38016, 0xacf5c5da +0, 288000, 38016, 0xbe6bca1a +0, 291600, 38016, 0x098bdac2 +0, 295200, 38016, 0xe706e491 +0, 298800, 38016, 0xcda7d8ee +0, 302400, 38016, 0xb1d4d3f4 +0, 306000, 38016, 0x3e20d6cd +0, 309600, 38016, 0xf368e66a +0, 313200, 38016, 0xbfbee5b1 +0, 316800, 38016, 0xb580ec3d +0, 320400, 38016, 0xce8dec65 +0, 324000, 38016, 0xb6fda1c2 +0, 327600, 38016, 0xb2d5ad04 +0, 331200, 38016, 0x28959c5a +0, 334800, 38016, 0x7b1d7c65 +0, 338400, 38016, 0x357e79cd +0, 342000, 38016, 0x08f57396 +0, 345600, 38016, 0xe59973b8 +0, 349200, 38016, 0x288a9c28 +0, 352800, 38016, 0x09a4a82f +0, 356400, 38016, 0x61b5a518 +0, 360000, 38016, 0xddbfb88d +0, 363600, 38016, 0x14b5a41e +0, 367200, 38016, 0x56588add +0, 370800, 38016, 0x7e3890c1 +0, 374400, 38016, 0xbb1eb4df +0, 378000, 38016, 0x3b34a7d8 +0, 381600, 38016, 0xe15ddc56 +0, 385200, 38016, 0x9ed7ff21 +0, 388800, 38016, 0x03200458 +0, 392400, 38016, 0x74493572 +0, 396000, 38016, 0x73d14274 +0, 399600, 38016, 0x02933587 +0, 403200, 38016, 0x5ea74e05 +0, 406800, 38016, 0xd73d303e +0, 410400, 38016, 0x0a17f1ea +0, 414000, 38016, 0x915f0dcd +0, 417600, 38016, 0xca041a88 +0, 421200, 38016, 0xc6a303b2 +0, 424800, 38016, 0x2c903df2 +0, 428400, 38016, 0x2dd04691 +0, 432000, 38016, 0xfe783551 +0, 435600, 38016, 0x900c419c +0, 439200, 38016, 0x01b92a15 +0, 442800, 38016, 0xcce4e851 +0, 446400, 38016, 0x0167d6f6 +0, 450000, 38016, 0x023eb3fa +0, 453600, 38016, 0xafc29caa +0, 457200, 38016, 0xf205b88c +0, 460800, 38016, 0x5518cc46 +0, 464400, 38016, 0x64cdd1d5 +0, 468000, 38016, 0x8e9eecb4 +0, 471600, 38016, 0xd1e0e2f8 +0, 475200, 38016, 0xb849cf3c +0, 478800, 38016, 0xb5e4d916 +0, 482400, 38016, 0xc6c5da7e +0, 486000, 38016, 0xcbcda68d +0, 489600, 38016, 0x21d7bd73 +0, 493200, 38016, 0x6737b4b9 +0, 496800, 38016, 0x379f9a5f +0, 500400, 38016, 0xa13da6cc +0, 504000, 38016, 0x06fc941a +0, 507600, 38016, 0x78c57e95 +0, 511200, 38016, 0x2f6674d4 +0, 514800, 38016, 0x37776db9 +0, 518400, 38016, 0x257268db +0, 522000, 38016, 0x1dbe7e72 +0, 525600, 38016, 0x2cb96bb0 +0, 529200, 38016, 0x46a840f2 +0, 532800, 38016, 0x95951fd6 +0, 536400, 38016, 0x627ef7b2 +0, 540000, 38016, 0xa5b0b2d3 +0, 543600, 38016, 0x69fdcae9 +0, 547200, 38016, 0x0c25c873 +0, 550800, 38016, 0x3533a2cc +0, 554400, 38016, 0x3a74b6c2 +0, 558000, 38016, 0x9d1dcbc1 +0, 561600, 38016, 0xce33cf86 +0, 565200, 38016, 0xf34201f5 +0, 568800, 38016, 0xab5f2e2b +0, 572400, 38016, 0xf062405d +0, 576000, 38016, 0xe7f85f7c +0, 579600, 38016, 0x684f4ee4 +0, 583200, 38016, 0x41b83014 +0, 586800, 38016, 0x70142f5f +0, 590400, 38016, 0x3cb229b1 +0, 594000, 38016, 0x6bd1f24c +0, 597600, 38016, 0x9366ec77 +0, 601200, 38016, 0x6af0c1ec +0, 604800, 38016, 0xb11a9005 +0, 608400, 38016, 0x83e390b7 +0, 612000, 38016, 0x97679ab5 +0, 615600, 38016, 0xabe3b114 +0, 619200, 38016, 0x2efed19f +0, 622800, 38016, 0x18eddb2e +0, 626400, 38016, 0x0a37c6fb +0, 630000, 38016, 0xddb0a2fe +0, 633600, 38016, 0xf8627091 +0, 637200, 38016, 0x97123074 +0, 640800, 38016, 0x33af3174 +0, 644400, 38016, 0x5caa22fe +0, 648000, 38016, 0xa203eccf +0, 651600, 38016, 0x506eee0c +0, 655200, 38016, 0x2066d541 +0, 658800, 38016, 0xe08acab1 +0, 662400, 38016, 0x6740ecc4 +0, 666000, 38016, 0x954dfd6d +0, 669600, 38016, 0xbd7ffef8 +0, 673200, 38016, 0x629f2cca +0, 676800, 38016, 0xebd92f12 +0, 680400, 38016, 0xe5bd297f +0, 684000, 38016, 0xcb2be670 +0, 687600, 38016, 0x51d7b529 +0, 691200, 38016, 0x95d7ab30 +0, 694800, 38016, 0x18e3df99 +0, 698400, 38016, 0xae3af726 +0, 702000, 38016, 0x9b831ee3 +0, 705600, 38016, 0x3c614e45 +0, 709200, 38016, 0x3c0a600c +0, 712800, 38016, 0xdade838b +0, 716400, 38016, 0xbbe3a0a7 +0, 720000, 38016, 0xd4d5b780 +0, 723600, 38016, 0xceebb4b7 +0, 727200, 38016, 0x1a8ccbb3 +0, 730800, 38016, 0x95dccfab +0, 734400, 38016, 0xea9bc737 +0, 738000, 38016, 0xa0f6d561 +0, 741600, 38016, 0x7877d698 +0, 745200, 38016, 0xd6aad54c +0, 748800, 38016, 0xca62c8b7 +0, 752400, 38016, 0xebc9ae1c +0, 756000, 38016, 0x46c96194 +0, 759600, 38016, 0x61197fc4 +0, 763200, 38016, 0x9ae97570 +0, 766800, 38016, 0x7cd254da +0, 770400, 38016, 0xe4816953 +0, 774000, 38016, 0x68685b2c +0, 777600, 38016, 0x08d93f79 +0, 781200, 38016, 0xb4cc526b +0, 784800, 38016, 0xc0d253d9 +0, 788400, 38016, 0x95b83d64 +0, 792000, 38016, 0xadf7454f +0, 795600, 38016, 0xaa1d339b +0, 799200, 38016, 0xae0417f8 +0, 802800, 38016, 0x09d2294d +0, 806400, 38016, 0xbd892e9d +0, 810000, 38016, 0xbccd0f97 +0, 813600, 38016, 0x03c13bd3 +0, 817200, 38016, 0x09d045d7 +0, 820800, 38016, 0xaa484278 +0, 824400, 38016, 0x054b8639 +0, 828000, 38016, 0x45e29e62 +0, 831600, 38016, 0x38bbb067 +0, 835200, 38016, 0x9f5cfc30 +0, 838800, 38016, 0x38551b76 +0, 842400, 38016, 0x3e1b18ee +0, 846000, 38016, 0x7baf4e34 +0, 849600, 38016, 0xff6458d1 +0, 853200, 38016, 0xb7963c49 +0, 856800, 38016, 0xdaee3f6a +0, 860400, 38016, 0xc88e09c9 +0, 864000, 38016, 0x88a7de38 +0, 867600, 38016, 0x9e81cb62 +0, 871200, 38016, 0x84d0aca7 +0, 874800, 38016, 0x3312f41e +0, 878400, 38016, 0x550065dc +0, 882000, 38016, 0x7e88d07e +0, 885600, 38016, 0x9370ed4f +0, 889200, 38016, 0xd9c9d592 +0, 892800, 38016, 0xec7589ce +0, 896400, 38016, 0xeca71251 +0, 900000, 38016, 0xf183b951 +0, 903600, 38016, 0x9a1b740a +0, 907200, 38016, 0x97ea5ffc +0, 910800, 38016, 0x058dc572 +0, 914400, 38016, 0xae44345a +0, 918000, 38016, 0xef22c82e +0, 921600, 38016, 0x8364d583 +0, 925200, 38016, 0x2f725dfa +0, 928800, 38016, 0x5eda3160 +0, 932400, 38016, 0x4a464613 +0, 936000, 38016, 0x447f444d +0, 939600, 38016, 0x076b3dd8 +0, 943200, 38016, 0x690f58de +0, 946800, 38016, 0xf4635e91 +0, 950400, 38016, 0xd5db44e7 +0, 954000, 38016, 0xced25176 +0, 957600, 38016, 0x227a2f9a +0, 961200, 38016, 0x72100520 +0, 964800, 38016, 0x6549f9b4 +0, 968400, 38016, 0x3f77cef4 +0, 972000, 38016, 0x3d1ba72f +0, 975600, 38016, 0xa1dd85d2 +0, 979200, 38016, 0x9a35655e +0, 982800, 38016, 0xdc900dc6 +0, 986400, 38016, 0xca05d5cb +0, 990000, 38016, 0xeff0be86 +0, 993600, 38016, 0xdcceb22e +0, 997200, 38016, 0x5952d133 +0, 1000800, 38016, 0x3ab3facb +0, 1004400, 38016, 0xdb8d4de4 +0, 1008000, 38016, 0x0afc170d +0, 1011600, 38016, 0xd14ddc59 +0, 1015200, 38016, 0xbabf89eb +0, 1018800, 38016, 0x09d38f7b +0, 1022400, 38016, 0xe4805dba +0, 1026000, 38016, 0x4d919dcf +0, 1029600, 38016, 0x3e8c60be +0, 1033200, 38016, 0x6c1fa94b +0, 1036800, 38016, 0x6b68a320 +0, 1040400, 38016, 0x9de774f6 +0, 1044000, 38016, 0x38d0ecc6 +0, 1047600, 38016, 0x0623207f +0, 1051200, 38016, 0x36429915 +0, 1054800, 38016, 0x659fdd42 +0, 1058400, 38016, 0x59c93475 +0, 1062000, 38016, 0xecd1200d +0, 1065600, 38016, 0x3b2af9c2 +0, 1069200, 38016, 0xd00600da +0, 1072800, 38016, 0xb0bc21ee +0, 1076400, 38016, 0xc11f3ec2 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabast3_sony_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabast3_sony_e new file mode 100644 index 00000000..06c9f1c2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabast3_sony_e @@ -0,0 +1,25 @@ +0, 0, 152064, 0x96ebb3a2 +0, 3600, 152064, 0x5184d912 +0, 7200, 152064, 0xfa0c9abe +0, 10800, 152064, 0x6dd81860 +0, 14400, 152064, 0xc5202966 +0, 18000, 152064, 0xa7dfdf71 +0, 21600, 152064, 0xffa5609f +0, 25200, 152064, 0x352e7ce5 +0, 28800, 152064, 0xc9e52c2a +0, 32400, 152064, 0x12dfd28d +0, 36000, 152064, 0x962af5fe +0, 39600, 152064, 0xa8459cb1 +0, 43200, 152064, 0xc0771945 +0, 46800, 152064, 0xfcbc351d +0, 50400, 152064, 0xd925dfa3 +0, 54000, 152064, 0x7c627c21 +0, 57600, 152064, 0x617d8d96 +0, 61200, 152064, 0x91816b34 +0, 64800, 152064, 0xece0eaf8 +0, 68400, 152064, 0x7b1408ef +0, 72000, 152064, 0x7430c4d2 +0, 75600, 152064, 0xdb5844fa +0, 79200, 152064, 0xcc874ff7 +0, 82800, 152064, 0x97630fb8 +0, 86400, 152064, 0x16ae9c92 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabastbr3_sony_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabastbr3_sony_b new file mode 100644 index 00000000..d51959b8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabastbr3_sony_b @@ -0,0 +1,25 @@ +0, 0, 152064, 0x96ebb3a2 +0, 3600, 152064, 0x5184d912 +0, 7200, 152064, 0xb7b5ba68 +0, 10800, 152064, 0x6dd81860 +0, 14400, 152064, 0xcffe2ff0 +0, 18000, 152064, 0x27740140 +0, 21600, 152064, 0xffa5609f +0, 25200, 152064, 0x05e9a6c6 +0, 28800, 152064, 0xa5ea5692 +0, 32400, 152064, 0x78a9dd79 +0, 36000, 152064, 0x2bf218b3 +0, 39600, 152064, 0x4591cadc +0, 43200, 152064, 0x075428a8 +0, 46800, 152064, 0xbbda56d8 +0, 50400, 152064, 0xc8fa1a28 +0, 54000, 152064, 0x7c627c21 +0, 57600, 152064, 0x9043ba42 +0, 61200, 152064, 0xb426940d +0, 64800, 152064, 0x51d4058b +0, 68400, 152064, 0xb7513536 +0, 72000, 152064, 0xe906ffab +0, 75600, 152064, 0x3d075443 +0, 79200, 152064, 0x85c37afd +0, 82800, 152064, 0x2ac74040 +0, 86400, 152064, 0x3a08aa90 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabref3_sand_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabref3_sand_d new file mode 100644 index 00000000..7d75e018 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cabref3_sand_d @@ -0,0 +1,50 @@ +0, 0, 152064, 0x2061bbd0 +0, 3600, 152064, 0x41adb750 +0, 7200, 152064, 0x6e889e90 +0, 10800, 152064, 0xbb5e60f5 +0, 14400, 152064, 0x5a32eca7 +0, 18000, 152064, 0x5cb05e88 +0, 21600, 152064, 0x2fff3e6c +0, 25200, 152064, 0xd917c85e +0, 28800, 152064, 0x6eac446f +0, 32400, 152064, 0x238b24b0 +0, 36000, 152064, 0x3f3bd44c +0, 39600, 152064, 0x73982bc5 +0, 43200, 152064, 0xf6188a82 +0, 46800, 152064, 0x818c5b41 +0, 50400, 152064, 0x000d1012 +0, 54000, 152064, 0xc4a8750e +0, 57600, 152064, 0x1689bb77 +0, 61200, 152064, 0x8f52f338 +0, 64800, 152064, 0xbf5ee06b +0, 68400, 152064, 0x89508ad7 +0, 72000, 152064, 0x2b1986a6 +0, 75600, 152064, 0xe6fd6b0e +0, 79200, 152064, 0x883e2e4e +0, 82800, 152064, 0xd133db07 +0, 86400, 152064, 0x39b3bb22 +0, 90000, 152064, 0x8447410a +0, 93600, 152064, 0x9c66c6e5 +0, 97200, 152064, 0x514de9cc +0, 100800, 152064, 0x08d9f1da +0, 104400, 152064, 0x8f10f536 +0, 108000, 152064, 0x57d4b27b +0, 111600, 152064, 0x46f56d3c +0, 115200, 152064, 0x5d260230 +0, 118800, 152064, 0x4a72aeac +0, 122400, 152064, 0x5cfe187f +0, 126000, 152064, 0x08e55cb2 +0, 129600, 152064, 0x4727f34f +0, 133200, 152064, 0xd6a26f1c +0, 136800, 152064, 0xcc1fcf9c +0, 140400, 152064, 0x3681b775 +0, 144000, 152064, 0xf580c7d9 +0, 147600, 152064, 0xaa6747fb +0, 151200, 152064, 0x2e22f9f9 +0, 154800, 152064, 0xb3ee6d81 +0, 158400, 152064, 0x930b0145 +0, 162000, 152064, 0xae36af99 +0, 165600, 152064, 0xeb58fd26 +0, 169200, 152064, 0xb9004da3 +0, 172800, 152064, 0x2b25e444 +0, 176400, 152064, 0xb36927de diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cacqp3_sony_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cacqp3_sony_d new file mode 100644 index 00000000..56881b3d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cacqp3_sony_d @@ -0,0 +1,50 @@ +0, 0, 38016, 0x295a375c +0, 3600, 38016, 0xd0da1f37 +0, 7200, 38016, 0x0e5ed514 +0, 10800, 38016, 0x477dcbe7 +0, 14400, 38016, 0x2e0980f3 +0, 18000, 38016, 0xf6d0888f +0, 21600, 38016, 0x884f4bf2 +0, 25200, 38016, 0x75135ea9 +0, 28800, 38016, 0xc85031bd +0, 32400, 38016, 0x4dde6353 +0, 36000, 38016, 0x8c8f4f2a +0, 39600, 38016, 0xbdae892b +0, 43200, 38016, 0x4898783a +0, 46800, 38016, 0xb4cc9d6b +0, 50400, 38016, 0xd24f8797 +0, 54000, 38016, 0x74c4a0df +0, 57600, 38016, 0x43e58a83 +0, 61200, 38016, 0x05bba901 +0, 64800, 38016, 0xe2d57f63 +0, 68400, 38016, 0xdb398611 +0, 72000, 38016, 0x7f143de2 +0, 75600, 38016, 0xff39406f +0, 79200, 38016, 0xfed61162 +0, 82800, 38016, 0xb9e62a1e +0, 86400, 38016, 0x65f316d1 +0, 90000, 38016, 0xda782b9c +0, 93600, 38016, 0xb64b202c +0, 97200, 38016, 0xb2b141ea +0, 100800, 38016, 0xdb6b421b +0, 104400, 38016, 0xf3287342 +0, 108000, 38016, 0xfbb35b92 +0, 111600, 38016, 0x8c77a0de +0, 115200, 38016, 0x326c9cb4 +0, 118800, 38016, 0x7e73cc0c +0, 122400, 38016, 0xb948b8e9 +0, 126000, 38016, 0x6f7adb29 +0, 129600, 38016, 0xb629b8c5 +0, 133200, 38016, 0xf798ccd4 +0, 136800, 38016, 0xde5bb331 +0, 140400, 38016, 0xbca4d8dc +0, 144000, 38016, 0x9369ba10 +0, 147600, 38016, 0x581ed965 +0, 151200, 38016, 0xce7bbd59 +0, 154800, 38016, 0x95d9ce3d +0, 158400, 38016, 0x6154bd98 +0, 162000, 38016, 0xa279c487 +0, 165600, 38016, 0x8169b5a6 +0, 169200, 38016, 0x709dc334 +0, 172800, 38016, 0x82aabea1 +0, 176400, 38016, 0x6923c4c3 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cafi1_sva_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cafi1_sva_c new file mode 100644 index 00000000..c652ce26 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cafi1_sva_c @@ -0,0 +1,33 @@ +0, 0, 518400, 0x47bd73fa +0, 3600, 518400, 0xfe3ea7cc +0, 7200, 518400, 0x9bc549ae +0, 10800, 518400, 0x7bb7f0a1 +0, 14400, 518400, 0x328903d4 +0, 18000, 518400, 0x96ab366b +0, 21600, 518400, 0xa923eed3 +0, 25200, 518400, 0x162b08f6 +0, 28800, 518400, 0xe711bd8b +0, 32400, 518400, 0x55e2d4ed +0, 36000, 518400, 0x7dd3107b +0, 39600, 518400, 0x0ed20bcf +0, 43200, 518400, 0x352f5743 +0, 46800, 518400, 0x0a3aeb5e +0, 50400, 518400, 0xc458eda3 +0, 54000, 518400, 0xe8d5fec5 +0, 57600, 518400, 0x18fc6c37 +0, 61200, 518400, 0x448add76 +0, 64800, 518400, 0x8741ead7 +0, 68400, 518400, 0x7008a751 +0, 72000, 518400, 0x4ca0633d +0, 75600, 518400, 0x021ab800 +0, 79200, 518400, 0xfb91ba57 +0, 82800, 518400, 0x90e71dd0 +0, 86400, 518400, 0xac859de5 +0, 90000, 518400, 0xce9790bd +0, 93600, 518400, 0x010ade8b +0, 97200, 518400, 0xd0b3a399 +0, 100800, 518400, 0x6cafcff3 +0, 104400, 518400, 0xc32284c0 +0, 108000, 518400, 0x1af8f73e +0, 111600, 518400, 0x3babd71e +0, 115200, 518400, 0xd77cb86b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama1_sony_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama1_sony_c new file mode 100644 index 00000000..6b309aab --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama1_sony_c @@ -0,0 +1,5 @@ +0, 0, 518400, 0x75701511 +0, 3600, 518400, 0xa7eeaa16 +0, 7200, 518400, 0xe0f32e35 +0, 10800, 518400, 0x7a1dadd9 +0, 14400, 518400, 0x4a1672a6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama1_toshiba_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama1_toshiba_b new file mode 100644 index 00000000..897e915e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama1_toshiba_b @@ -0,0 +1,90 @@ +0, 0, 152064, 0x9a9ce366 +0, 3600, 152064, 0xf4639828 +0, 7200, 152064, 0x625024a3 +0, 10800, 152064, 0x80dc2f9d +0, 14400, 152064, 0xb2c4feea +0, 18000, 152064, 0x4ec6ad64 +0, 21600, 152064, 0x1957bec3 +0, 25200, 152064, 0xb682799d +0, 28800, 152064, 0x34cd2053 +0, 32400, 152064, 0x81490b4c +0, 36000, 152064, 0x242dc943 +0, 39600, 152064, 0x3e126734 +0, 43200, 152064, 0x8e474ff8 +0, 46800, 152064, 0x239d2fbd +0, 50400, 152064, 0x0ca3e16f +0, 54000, 152064, 0x6161d7c2 +0, 57600, 152064, 0xca7ad1af +0, 61200, 152064, 0xf8ef9026 +0, 64800, 152064, 0x01f2f4c1 +0, 68400, 152064, 0x510b19ec +0, 72000, 152064, 0xe489028b +0, 75600, 152064, 0x7a693c1e +0, 79200, 152064, 0x276b23fe +0, 82800, 152064, 0x0e9ced3a +0, 86400, 152064, 0x658228f7 +0, 90000, 152064, 0x6a271bc3 +0, 93600, 152064, 0x431ecd8b +0, 97200, 152064, 0x23a5ed14 +0, 100800, 152064, 0x76fbe121 +0, 104400, 152064, 0x471f919d +0, 108000, 152064, 0x16bfabbc +0, 111600, 152064, 0x0762993f +0, 115200, 152064, 0x5a2b0b0e +0, 118800, 152064, 0x81415ef7 +0, 122400, 152064, 0xb96e4164 +0, 126000, 152064, 0xf77aee83 +0, 129600, 152064, 0x6af81633 +0, 133200, 152064, 0xed78e5b5 +0, 136800, 152064, 0x67e38e2c +0, 140400, 152064, 0x0417ae01 +0, 144000, 152064, 0x3887b312 +0, 147600, 152064, 0x3a4b70fb +0, 151200, 152064, 0xcaae9e7f +0, 154800, 152064, 0xaf9597be +0, 158400, 152064, 0x9bae63d3 +0, 162000, 152064, 0x0e80825f +0, 165600, 152064, 0x915661fd +0, 169200, 152064, 0x67d3dc94 +0, 172800, 152064, 0x3dcf240c +0, 176400, 152064, 0x127ff832 +0, 180000, 152064, 0xc8969981 +0, 183600, 152064, 0x57179c77 +0, 187200, 152064, 0x9f88656c +0, 190800, 152064, 0xc28ff5d3 +0, 194400, 152064, 0xf100fad9 +0, 198000, 152064, 0xb570ce12 +0, 201600, 152064, 0xe8f28955 +0, 205200, 152064, 0x1f0a9549 +0, 208800, 152064, 0x22b17e9b +0, 212400, 152064, 0x7cf1400e +0, 216000, 152064, 0xafd273b7 +0, 219600, 152064, 0xeb9b712e +0, 223200, 152064, 0x0f81de24 +0, 226800, 152064, 0x8f4e1953 +0, 230400, 152064, 0x682e2170 +0, 234000, 152064, 0xc32ad1b2 +0, 237600, 152064, 0x53a81d79 +0, 241200, 152064, 0x54002596 +0, 244800, 152064, 0x4b5fdbd9 +0, 248400, 152064, 0x96613368 +0, 252000, 152064, 0xd6ac0171 +0, 255600, 152064, 0xf1c1b7b7 +0, 259200, 152064, 0xc730d82f +0, 262800, 152064, 0x0415d934 +0, 266400, 152064, 0x5338915e +0, 270000, 152064, 0x8e9dda6d +0, 273600, 152064, 0xe3a8b0a0 +0, 277200, 152064, 0x5fa36e44 +0, 280800, 152064, 0x0e63dc72 +0, 284400, 152064, 0xd0dad71f +0, 288000, 152064, 0x0c4aac94 +0, 291600, 152064, 0x60d50e8d +0, 295200, 152064, 0x96872d7c +0, 298800, 152064, 0x4fcefc33 +0, 302400, 152064, 0x6b8157c9 +0, 306000, 152064, 0xa40d527d +0, 309600, 152064, 0x9884480a +0, 313200, 152064, 0xff5d9754 +0, 316800, 152064, 0x4a26a74d +0, 320400, 152064, 0x81059e82 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama1_vtc_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama1_vtc_c new file mode 100644 index 00000000..8c0e2268 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama1_vtc_c @@ -0,0 +1,4 @@ +0, 0, 518400, 0x41c2ce17 +0, 3600, 518400, 0x39f217da +0, 7200, 518400, 0x5a108db9 +0, 10800, 518400, 0x20cb214c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama2_vtc_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama2_vtc_b new file mode 100644 index 00000000..8320f1f6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama2_vtc_b @@ -0,0 +1,4 @@ +0, 0, 622080, 0x004bb93f +0, 3600, 622080, 0xe70e193c +0, 7200, 622080, 0xd394cf17 +0, 10800, 622080, 0x9e4cc924 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama3_sand_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama3_sand_e new file mode 100644 index 00000000..77927c9a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama3_sand_e @@ -0,0 +1,50 @@ +0, 0, 152064, 0xf772f152 +0, 3600, 152064, 0x7c501772 +0, 7200, 152064, 0x98ed0a07 +0, 10800, 152064, 0x8f9289ae +0, 14400, 152064, 0x4047c5e6 +0, 18000, 152064, 0xf1f11922 +0, 21600, 152064, 0xef8d8130 +0, 25200, 152064, 0x6cef489d +0, 28800, 152064, 0x3743a97f +0, 32400, 152064, 0x9d6b9846 +0, 36000, 152064, 0x332e05a7 +0, 39600, 152064, 0x7dad10af +0, 43200, 152064, 0x835c99de +0, 46800, 152064, 0x2ba3f9bb +0, 50400, 152064, 0xf8ab5286 +0, 54000, 152064, 0x76624cca +0, 57600, 152064, 0x8ebf6342 +0, 61200, 152064, 0x8756f87b +0, 64800, 152064, 0xf005bc2f +0, 68400, 152064, 0x9b1ae18e +0, 72000, 152064, 0x3e1154aa +0, 75600, 152064, 0x851e28d6 +0, 79200, 152064, 0x940a2518 +0, 82800, 152064, 0x861be99c +0, 86400, 152064, 0x21a788a7 +0, 90000, 152064, 0x53e216eb +0, 93600, 152064, 0x053cb9ec +0, 97200, 152064, 0x3bb5cfc6 +0, 100800, 152064, 0x92b250c3 +0, 104400, 152064, 0xacc20f1c +0, 108000, 152064, 0xb01256d3 +0, 111600, 152064, 0x6db62cf2 +0, 115200, 152064, 0x7fa3074d +0, 118800, 152064, 0x63385103 +0, 122400, 152064, 0x83ba02b6 +0, 126000, 152064, 0x3731edbb +0, 129600, 152064, 0xb73d5b99 +0, 133200, 152064, 0xd2e743e2 +0, 136800, 152064, 0x4bcd5bf2 +0, 140400, 152064, 0x45ef7b97 +0, 144000, 152064, 0x757952c6 +0, 147600, 152064, 0xed73e3db +0, 151200, 152064, 0x8cf41b15 +0, 154800, 152064, 0x86e2b02d +0, 158400, 152064, 0xf8d16c87 +0, 162000, 152064, 0x6720db65 +0, 165600, 152064, 0x67a5a150 +0, 169200, 152064, 0x1849fa2a +0, 172800, 152064, 0xb0156742 +0, 176400, 152064, 0xde75b1fd diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama3_vtc_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama3_vtc_b new file mode 100644 index 00000000..8e7a3517 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cama3_vtc_b @@ -0,0 +1,4 @@ +0, 0, 622080, 0xf3f0bf86 +0, 3600, 622080, 0x6aaf3d42 +0, 7200, 622080, 0xe53bcd5d +0, 10800, 622080, 0x8dabca9d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camaci3_sony_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camaci3_sony_c new file mode 100644 index 00000000..643d8039 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camaci3_sony_c @@ -0,0 +1,17 @@ +0, 0, 36864, 0x9b5dcf28 +0, 3600, 36864, 0xb13d4fee +0, 7200, 36864, 0x11c512ac +0, 10800, 36864, 0xc013b0e3 +0, 14400, 36864, 0x25002dae +0, 18000, 36864, 0xefd0055a +0, 21600, 36864, 0x6be2d3b2 +0, 25200, 36864, 0xa8a0d525 +0, 28800, 36864, 0x1bf942e8 +0, 32400, 36864, 0x5c08c94f +0, 36000, 36864, 0x5555e762 +0, 39600, 36864, 0xcc1429c7 +0, 43200, 36864, 0xa3cc1535 +0, 46800, 36864, 0x14dc2b75 +0, 50400, 36864, 0x6b965ce9 +0, 54000, 36864, 0x7424d19b +0, 57600, 36864, 0xcada6a7f diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camanl1_toshiba_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camanl1_toshiba_b new file mode 100644 index 00000000..07422b8d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camanl1_toshiba_b @@ -0,0 +1,90 @@ +0, 0, 152064, 0xb1edd842 +0, 3600, 152064, 0x551f8f45 +0, 7200, 152064, 0xb4931cb2 +0, 10800, 152064, 0x78882b27 +0, 14400, 152064, 0x3afef36d +0, 18000, 152064, 0x85afad0a +0, 21600, 152064, 0x3a8bab81 +0, 25200, 152064, 0x2a437174 +0, 28800, 152064, 0x22421437 +0, 32400, 152064, 0x39c5f125 +0, 36000, 152064, 0x256eaad2 +0, 39600, 152064, 0x668a5d31 +0, 43200, 152064, 0x412a4aa7 +0, 46800, 152064, 0x3f091baf +0, 50400, 152064, 0xbf16d262 +0, 54000, 152064, 0x2fc4ce67 +0, 57600, 152064, 0x119cde3e +0, 61200, 152064, 0xb40b8632 +0, 64800, 152064, 0x4be4f192 +0, 68400, 152064, 0x906c1237 +0, 72000, 152064, 0x95380024 +0, 75600, 152064, 0x6a833025 +0, 79200, 152064, 0x681d1c4f +0, 82800, 152064, 0x08c8dea4 +0, 86400, 152064, 0xc69226f0 +0, 90000, 152064, 0x86631102 +0, 93600, 152064, 0x7f40c77a +0, 97200, 152064, 0xc746ddd4 +0, 100800, 152064, 0x5f2bd3cb +0, 104400, 152064, 0x643c8316 +0, 108000, 152064, 0x5b7fa380 +0, 111600, 152064, 0x82438cf7 +0, 115200, 152064, 0xdee0f7e7 +0, 118800, 152064, 0xc50d41f1 +0, 122400, 152064, 0xf3453631 +0, 126000, 152064, 0x90bce66b +0, 129600, 152064, 0x045b03f7 +0, 133200, 152064, 0xf64bd756 +0, 136800, 152064, 0xff997ef2 +0, 140400, 152064, 0x3613a0a5 +0, 144000, 152064, 0xe6a7a8d6 +0, 147600, 152064, 0xb0906c42 +0, 151200, 152064, 0x4dfc912b +0, 154800, 152064, 0x81e3991c +0, 158400, 152064, 0x4efc61fb +0, 162000, 152064, 0xed478395 +0, 165600, 152064, 0x4cb25ab6 +0, 169200, 152064, 0x28e7d51f +0, 172800, 152064, 0x8bcc1a8d +0, 176400, 152064, 0x2fe1f240 +0, 180000, 152064, 0xb4978ef8 +0, 183600, 152064, 0xe3929556 +0, 187200, 152064, 0xd370632a +0, 190800, 152064, 0xba86ffb2 +0, 194400, 152064, 0x444bf18c +0, 198000, 152064, 0xab40bd14 +0, 201600, 152064, 0xfd488a5d +0, 205200, 152064, 0xe1f09568 +0, 208800, 152064, 0x09ee7a7e +0, 212400, 152064, 0x9360397c +0, 216000, 152064, 0xdbd467e9 +0, 219600, 152064, 0x99726777 +0, 223200, 152064, 0x009fd46c +0, 226800, 152064, 0xcf770fdb +0, 230400, 152064, 0x2a890fd9 +0, 234000, 152064, 0x7f40de4b +0, 237600, 152064, 0x04191304 +0, 241200, 152064, 0x15722022 +0, 244800, 152064, 0x59f4ea93 +0, 248400, 152064, 0x28ba373f +0, 252000, 152064, 0xf9e400b8 +0, 255600, 152064, 0x85c4bd98 +0, 259200, 152064, 0x6917d2a5 +0, 262800, 152064, 0x61cae234 +0, 266400, 152064, 0x752a9a2d +0, 270000, 152064, 0x1ee2d9bd +0, 273600, 152064, 0xdce9ab8e +0, 277200, 152064, 0x51225fd0 +0, 280800, 152064, 0x10e8cb60 +0, 284400, 152064, 0x8d07cd25 +0, 288000, 152064, 0xb18ba61b +0, 291600, 152064, 0xb0f10280 +0, 295200, 152064, 0x76a71f13 +0, 298800, 152064, 0x3004f5a1 +0, 302400, 152064, 0x9aba5724 +0, 306000, 152064, 0x5db85385 +0, 309600, 152064, 0xbe9d3f5b +0, 313200, 152064, 0xa71e85bb +0, 316800, 152064, 0xdcf59cd7 +0, 320400, 152064, 0x5e319459 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camanl2_toshiba_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camanl2_toshiba_b new file mode 100644 index 00000000..d8959a33 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camanl2_toshiba_b @@ -0,0 +1,90 @@ +0, 0, 152064, 0xb1edd842 +0, 3600, 152064, 0x551f8f45 +0, 7200, 152064, 0xb4931cb2 +0, 10800, 152064, 0x5f352e98 +0, 14400, 152064, 0xeba5fe28 +0, 18000, 152064, 0x85afad0a +0, 21600, 152064, 0x1120b6a4 +0, 25200, 152064, 0x67506e16 +0, 28800, 152064, 0x22421437 +0, 32400, 152064, 0x929becd6 +0, 36000, 152064, 0x6ffcb4b0 +0, 39600, 152064, 0x668a5d31 +0, 43200, 152064, 0x1b034ebb +0, 46800, 152064, 0x7e2d213c +0, 50400, 152064, 0xbf16d262 +0, 54000, 152064, 0xdeaecab3 +0, 57600, 152064, 0xd220d704 +0, 61200, 152064, 0xb40b8632 +0, 64800, 152064, 0xbdf0ef57 +0, 68400, 152064, 0x7e2e10df +0, 72000, 152064, 0x95380024 +0, 75600, 152064, 0xdb80256d +0, 79200, 152064, 0xa4561c61 +0, 82800, 152064, 0x08c8dea4 +0, 86400, 152064, 0x7bb917d6 +0, 90000, 152064, 0x796f0e2b +0, 93600, 152064, 0x7f40c77a +0, 97200, 152064, 0xda32de2e +0, 100800, 152064, 0x00ffc15a +0, 104400, 152064, 0x643c8316 +0, 108000, 152064, 0xb7588f7f +0, 111600, 152064, 0xa4e07c02 +0, 115200, 152064, 0xdee0f7e7 +0, 118800, 152064, 0x2c3245ee +0, 122400, 152064, 0x6565355b +0, 126000, 152064, 0x90bce66b +0, 129600, 152064, 0x0abffe08 +0, 133200, 152064, 0x119ccc3e +0, 136800, 152064, 0xff997ef2 +0, 140400, 152064, 0xba4b9820 +0, 144000, 152064, 0xb6dfa596 +0, 147600, 152064, 0xb0906c42 +0, 151200, 152064, 0xf3c29133 +0, 154800, 152064, 0x08cd8e2b +0, 158400, 152064, 0x4efc61fb +0, 162000, 152064, 0x5b7c6e48 +0, 165600, 152064, 0xd28a47c2 +0, 169200, 152064, 0x28e7d51f +0, 172800, 152064, 0x3a5619b1 +0, 176400, 152064, 0xa517e7f2 +0, 180000, 152064, 0xb4978ef8 +0, 183600, 152064, 0x25929175 +0, 187200, 152064, 0x20f05834 +0, 190800, 152064, 0xba86ffb2 +0, 194400, 152064, 0xa265f06f +0, 198000, 152064, 0x97bbbfb7 +0, 201600, 152064, 0xfd488a5d +0, 205200, 152064, 0x1b0989da +0, 208800, 152064, 0xfd1878ce +0, 212400, 152064, 0x9360397c +0, 216000, 152064, 0x0d8151a7 +0, 219600, 152064, 0xe7a05bb8 +0, 223200, 152064, 0x009fd46c +0, 226800, 152064, 0x8751123f +0, 230400, 152064, 0x8252101a +0, 234000, 152064, 0x7f40de4b +0, 237600, 152064, 0x4ea317fe +0, 241200, 152064, 0x519224d9 +0, 244800, 152064, 0x59f4ea93 +0, 248400, 152064, 0xc93c1dba +0, 252000, 152064, 0xe3c9fb61 +0, 255600, 152064, 0x85c4bd98 +0, 259200, 152064, 0xcebacfd3 +0, 262800, 152064, 0x7327da99 +0, 266400, 152064, 0x752a9a2d +0, 270000, 152064, 0x5ea6c8d2 +0, 273600, 152064, 0x66fd8c6f +0, 277200, 152064, 0x51225fd0 +0, 280800, 152064, 0x58b9be96 +0, 284400, 152064, 0xa5abcdb7 +0, 288000, 152064, 0xb18ba61b +0, 291600, 152064, 0xc7d20190 +0, 295200, 152064, 0xb6da14aa +0, 298800, 152064, 0x3004f5a1 +0, 302400, 152064, 0x129354e2 +0, 306000, 152064, 0xffa148d5 +0, 309600, 152064, 0xbe9d3f5b +0, 313200, 152064, 0x1c7f8976 +0, 316800, 152064, 0xa107a54d +0, 320400, 152064, 0x5e319459 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camanl3_sand_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camanl3_sand_e new file mode 100644 index 00000000..ac8be191 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camanl3_sand_e @@ -0,0 +1,50 @@ +0, 0, 152064, 0x6c1ff6a7 +0, 3600, 152064, 0x17f1ff3a +0, 7200, 152064, 0xf7ddcda8 +0, 10800, 152064, 0xdcb64a37 +0, 14400, 152064, 0x4d2ad1db +0, 18000, 152064, 0x2e49028a +0, 21600, 152064, 0xcebb0f39 +0, 25200, 152064, 0xac74e574 +0, 28800, 152064, 0x8cd667e5 +0, 32400, 152064, 0xda511cf6 +0, 36000, 152064, 0x795c45c1 +0, 39600, 152064, 0x6034397c +0, 43200, 152064, 0xafb4b03d +0, 46800, 152064, 0xd73b1785 +0, 50400, 152064, 0xd873a98f +0, 54000, 152064, 0x07ac191e +0, 57600, 152064, 0x14fa5413 +0, 61200, 152064, 0xe6d1667e +0, 64800, 152064, 0x1cc2a92e +0, 68400, 152064, 0x4a878e35 +0, 72000, 152064, 0x4adfa52c +0, 75600, 152064, 0x8dbb370b +0, 79200, 152064, 0x4d66a69a +0, 82800, 152064, 0x2dcb66da +0, 86400, 152064, 0x74591150 +0, 90000, 152064, 0x259eb13f +0, 93600, 152064, 0xe5c96dd3 +0, 97200, 152064, 0x0fb52fe3 +0, 100800, 152064, 0x47c506a0 +0, 104400, 152064, 0xcc09ca7a +0, 108000, 152064, 0xc3430f03 +0, 111600, 152064, 0x702b1a73 +0, 115200, 152064, 0x4f385186 +0, 118800, 152064, 0x07a34aa5 +0, 122400, 152064, 0x698310b0 +0, 126000, 152064, 0x5fa469bc +0, 129600, 152064, 0xb6ab39ef +0, 133200, 152064, 0xbb6dc59d +0, 136800, 152064, 0xe5fa7503 +0, 140400, 152064, 0xd367512a +0, 144000, 152064, 0x215c0ca7 +0, 147600, 152064, 0x6bea4847 +0, 151200, 152064, 0xba03f875 +0, 154800, 152064, 0x3ac282cd +0, 158400, 152064, 0x23aee807 +0, 162000, 152064, 0x4274c84c +0, 165600, 152064, 0xdfdacf4b +0, 169200, 152064, 0xb2de9e6e +0, 172800, 152064, 0x456b684e +0, 176400, 152064, 0xa6297c83 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camasl3_sony_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camasl3_sony_b new file mode 100644 index 00000000..73f9b7fd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camasl3_sony_b @@ -0,0 +1,17 @@ +0, 0, 36864, 0xfe2ad849 +0, 3600, 36864, 0x37954ba1 +0, 7200, 36864, 0xaf0e0877 +0, 10800, 36864, 0xf28cadd1 +0, 14400, 36864, 0xe182365a +0, 18000, 36864, 0xdcdc03b7 +0, 21600, 36864, 0x2eded02f +0, 25200, 36864, 0xa706ca87 +0, 28800, 36864, 0x446f4c83 +0, 32400, 36864, 0x766acab3 +0, 36000, 36864, 0x651feaed +0, 39600, 36864, 0x834a2a75 +0, 43200, 36864, 0xb1811822 +0, 46800, 36864, 0xd8e12e21 +0, 50400, 36864, 0x6b445b13 +0, 54000, 36864, 0xa4ded223 +0, 57600, 36864, 0xbd1161b5 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camp_mot_mbaff_l30 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camp_mot_mbaff_l30 new file mode 100644 index 00000000..f8a1b8c9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camp_mot_mbaff_l30 @@ -0,0 +1,30 @@ +0, 0, 518400, 0x672279df +0, 3600, 518400, 0xb248a762 +0, 7200, 518400, 0x4399de88 +0, 10800, 518400, 0x14200d2d +0, 14400, 518400, 0x14a704cf +0, 18000, 518400, 0xcaac5431 +0, 21600, 518400, 0x69d77cee +0, 25200, 518400, 0x420d5f92 +0, 28800, 518400, 0x083a357d +0, 32400, 518400, 0x01777426 +0, 36000, 518400, 0x474640e9 +0, 39600, 518400, 0x3d690eab +0, 43200, 518400, 0x58074830 +0, 46800, 518400, 0x3e3f0fcc +0, 50400, 518400, 0x8c72de01 +0, 54000, 518400, 0xbf0a4f6f +0, 57600, 518400, 0xbdea010d +0, 61200, 518400, 0x54bdc458 +0, 64800, 518400, 0xdcd00ed0 +0, 68400, 518400, 0x64ba9ba9 +0, 72000, 518400, 0x5c0c6790 +0, 75600, 518400, 0x178674ed +0, 79200, 518400, 0x9ebec8d3 +0, 82800, 518400, 0x375c5426 +0, 86400, 518400, 0x19987af8 +0, 90000, 518400, 0x347ec12c +0, 93600, 518400, 0x96856c36 +0, 97200, 518400, 0xb81264a6 +0, 100800, 518400, 0xde0a08d6 +0, 104400, 518400, 0x19cb10be diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camp_mot_mbaff_l31 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camp_mot_mbaff_l31 new file mode 100644 index 00000000..baccdb8a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-camp_mot_mbaff_l31 @@ -0,0 +1,30 @@ +0, 0, 518400, 0x077637bf +0, 3600, 518400, 0xbd096d55 +0, 7200, 518400, 0x58b58820 +0, 10800, 518400, 0xdf24aced +0, 14400, 518400, 0x2354c6a2 +0, 18000, 518400, 0xedaaffdf +0, 21600, 518400, 0x28a8f027 +0, 25200, 518400, 0x05dee3d2 +0, 28800, 518400, 0x2ae9dbe4 +0, 32400, 518400, 0x361fec4a +0, 36000, 518400, 0xd9c7b07d +0, 39600, 518400, 0xa9d69c9f +0, 43200, 518400, 0x7f44c08c +0, 46800, 518400, 0xbfed83b4 +0, 50400, 518400, 0x65a5588c +0, 54000, 518400, 0xf4859855 +0, 57600, 518400, 0xcba96df9 +0, 61200, 518400, 0x8ae11dfd +0, 64800, 518400, 0xf0e36904 +0, 68400, 518400, 0x45cf1cb3 +0, 72000, 518400, 0xffefde04 +0, 75600, 518400, 0xc2a8edef +0, 79200, 518400, 0x72b15456 +0, 82800, 518400, 0x67b8dd35 +0, 86400, 518400, 0x8b91f38e +0, 90000, 518400, 0xe7055df1 +0, 93600, 518400, 0x5c32200d +0, 97200, 518400, 0xfbb709dc +0, 100800, 518400, 0x5c45b17f +0, 104400, 518400, 0x3a25903f diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl1_sony_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl1_sony_e new file mode 100644 index 00000000..552caa85 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl1_sony_e @@ -0,0 +1,50 @@ +0, 0, 38016, 0xc805351d +0, 3600, 38016, 0x3809fec3 +0, 7200, 38016, 0xf698ce3c +0, 10800, 38016, 0x7e3da603 +0, 14400, 38016, 0x68b07d81 +0, 18000, 38016, 0xd91f717a +0, 21600, 38016, 0x48885dd6 +0, 25200, 38016, 0x27e64e8e +0, 28800, 38016, 0x955835ce +0, 32400, 38016, 0xf19940a0 +0, 36000, 38016, 0x9a1c51e4 +0, 39600, 38016, 0xf59373af +0, 43200, 38016, 0x5d6c7d06 +0, 46800, 38016, 0x32fca533 +0, 50400, 38016, 0x37e69987 +0, 54000, 38016, 0x96929e05 +0, 57600, 38016, 0xee37a1f9 +0, 61200, 38016, 0xc6279d8f +0, 64800, 38016, 0x33d28b0a +0, 68400, 38016, 0x42946b72 +0, 72000, 38016, 0x51e947bf +0, 75600, 38016, 0xb10b2399 +0, 79200, 38016, 0x250c0fe4 +0, 82800, 38016, 0x81e20b18 +0, 86400, 38016, 0xb93f00db +0, 90000, 38016, 0x4f9d13d8 +0, 93600, 38016, 0x7d9c1184 +0, 97200, 38016, 0xd3271d2c +0, 100800, 38016, 0x9b253539 +0, 104400, 38016, 0xc4fd4d89 +0, 108000, 38016, 0x006f63cc +0, 111600, 38016, 0xa7d976b4 +0, 115200, 38016, 0x30de94d6 +0, 118800, 38016, 0x2cb7a745 +0, 122400, 38016, 0xa7a2b854 +0, 126000, 38016, 0x1ca1ba1a +0, 129600, 38016, 0x13b2b430 +0, 133200, 38016, 0x82bbb2de +0, 136800, 38016, 0x5fa0b4f9 +0, 140400, 38016, 0xedefb64d +0, 144000, 38016, 0x5ccdbf33 +0, 147600, 38016, 0x4fd0b4bb +0, 151200, 38016, 0x195fa008 +0, 154800, 38016, 0xda1494e0 +0, 158400, 38016, 0x98ac8fa6 +0, 162000, 38016, 0xd1548835 +0, 165600, 38016, 0x35c790ee +0, 169200, 38016, 0xecda84f1 +0, 172800, 38016, 0x9d9f8710 +0, 176400, 38016, 0x72d89581 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl1_sva_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl1_sva_b new file mode 100644 index 00000000..85945535 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl1_sva_b @@ -0,0 +1,17 @@ +0, 0, 38016, 0x0bd22424 +0, 3600, 38016, 0x4eb601f0 +0, 7200, 38016, 0xe16de459 +0, 10800, 38016, 0xde2e0c37 +0, 14400, 38016, 0x14a0286b +0, 18000, 38016, 0x37bc35b5 +0, 21600, 38016, 0xcfa24923 +0, 25200, 38016, 0xac755ba0 +0, 28800, 38016, 0x27d1822a +0, 32400, 38016, 0xa8039548 +0, 36000, 38016, 0x400ea1fb +0, 39600, 38016, 0x7d2ca44a +0, 43200, 38016, 0xd42dae4f +0, 46800, 38016, 0x39ce9599 +0, 50400, 38016, 0x37498aa1 +0, 54000, 38016, 0x8558911f +0, 57600, 38016, 0x06a8a9ad diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl2_sony_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl2_sony_e new file mode 100644 index 00000000..327e9259 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl2_sony_e @@ -0,0 +1,300 @@ +0, 0, 38016, 0xc805351d +0, 3600, 38016, 0x3017107e +0, 7200, 38016, 0xe172e2d2 +0, 10800, 38016, 0x7fefbb5b +0, 14400, 38016, 0x331097e6 +0, 18000, 38016, 0x47de825a +0, 21600, 38016, 0x0bf36d87 +0, 25200, 38016, 0x03ae60c5 +0, 28800, 38016, 0x986b5930 +0, 32400, 38016, 0x398b6450 +0, 36000, 38016, 0x8e1b77e7 +0, 39600, 38016, 0xefb198a6 +0, 43200, 38016, 0x395aa9ee +0, 46800, 38016, 0x1918b963 +0, 50400, 38016, 0xe6cab421 +0, 54000, 38016, 0x96929e05 +0, 57600, 38016, 0xf076abc7 +0, 61200, 38016, 0xd0f4ab70 +0, 64800, 38016, 0x7a39a75c +0, 68400, 38016, 0xb04f8bad +0, 72000, 38016, 0xe4996ff5 +0, 75600, 38016, 0x096e549a +0, 79200, 38016, 0x36d73f1a +0, 82800, 38016, 0x25f53bbf +0, 86400, 38016, 0x7ebd3f9f +0, 90000, 38016, 0x464c4b4c +0, 93600, 38016, 0x2d794a40 +0, 97200, 38016, 0x1599532d +0, 100800, 38016, 0xf8326999 +0, 104400, 38016, 0x858e789b +0, 108000, 38016, 0x006f63cc +0, 111600, 38016, 0x488a9614 +0, 115200, 38016, 0x950fb7cc +0, 118800, 38016, 0x6deac9dd +0, 122400, 38016, 0x0a82d725 +0, 126000, 38016, 0x2702d5fe +0, 129600, 38016, 0xf7ead782 +0, 133200, 38016, 0x560fd1f1 +0, 136800, 38016, 0xa3cdd31a +0, 140400, 38016, 0xa19ed45c +0, 144000, 38016, 0x8d85d757 +0, 147600, 38016, 0x7fa6e1b5 +0, 151200, 38016, 0x8a31db0e +0, 154800, 38016, 0x9dead6ff +0, 158400, 38016, 0x8a8adf44 +0, 162000, 38016, 0xd1548835 +0, 165600, 38016, 0xf696a62c +0, 169200, 38016, 0x5edbb219 +0, 172800, 38016, 0x0d9db749 +0, 176400, 38016, 0xc109c379 +0, 180000, 38016, 0xe814c2b1 +0, 183600, 38016, 0x4a8dc84b +0, 187200, 38016, 0x6bcac28c +0, 190800, 38016, 0xa37ec8da +0, 194400, 38016, 0x3202d5e9 +0, 198000, 38016, 0x3d65ddb6 +0, 201600, 38016, 0x165de082 +0, 205200, 38016, 0x5702e231 +0, 208800, 38016, 0x034fe8f4 +0, 212400, 38016, 0x96f0ea58 +0, 216000, 38016, 0x65539ad7 +0, 219600, 38016, 0xdf98a7cf +0, 223200, 38016, 0xda007de0 +0, 226800, 38016, 0xdf43520e +0, 230400, 38016, 0xc5d553d2 +0, 234000, 38016, 0xc3327450 +0, 237600, 38016, 0x81c4a2e0 +0, 241200, 38016, 0x7c56e2d1 +0, 244800, 38016, 0x813f20a4 +0, 248400, 38016, 0xe48257ad +0, 252000, 38016, 0x261b812f +0, 255600, 38016, 0x8836ae43 +0, 259200, 38016, 0x4c52e30f +0, 262800, 38016, 0x0614245f +0, 266400, 38016, 0xbf275e2e +0, 270000, 38016, 0x2f0f3e49 +0, 273600, 38016, 0xfaf57eb1 +0, 277200, 38016, 0xd1b49f95 +0, 280800, 38016, 0x10f4c2f6 +0, 284400, 38016, 0x2322d359 +0, 288000, 38016, 0x994de596 +0, 291600, 38016, 0x2a0df115 +0, 295200, 38016, 0xfcb7f1ec +0, 298800, 38016, 0xcbc2ee10 +0, 302400, 38016, 0x49f5ee5c +0, 306000, 38016, 0x4eb9f286 +0, 309600, 38016, 0xe5d80039 +0, 313200, 38016, 0xfa57fa81 +0, 316800, 38016, 0x2bea01f7 +0, 320400, 38016, 0x4e7c07a0 +0, 324000, 38016, 0x43b6a0f7 +0, 327600, 38016, 0x996e93cc +0, 331200, 38016, 0x8e5c8a40 +0, 334800, 38016, 0x15cc7fe7 +0, 338400, 38016, 0x7f0a6c35 +0, 342000, 38016, 0x031677a4 +0, 345600, 38016, 0x14dd8b6d +0, 349200, 38016, 0x143ca592 +0, 352800, 38016, 0x8e56b262 +0, 356400, 38016, 0x01c7c2b9 +0, 360000, 38016, 0xc117cbfa +0, 363600, 38016, 0x609bbe4b +0, 367200, 38016, 0x9a9fad05 +0, 370800, 38016, 0xba959d79 +0, 374400, 38016, 0x8773c00e +0, 378000, 38016, 0xea22a35b +0, 381600, 38016, 0x4b76c5fa +0, 385200, 38016, 0x5088e610 +0, 388800, 38016, 0xb6db1234 +0, 392400, 38016, 0xef631cf7 +0, 396000, 38016, 0x7d993030 +0, 399600, 38016, 0xa9b24013 +0, 403200, 38016, 0xc3a14055 +0, 406800, 38016, 0x5e7e2b4c +0, 410400, 38016, 0xae3505e0 +0, 414000, 38016, 0x48880369 +0, 417600, 38016, 0x844e1316 +0, 421200, 38016, 0x1d501951 +0, 424800, 38016, 0x36ae2e34 +0, 428400, 38016, 0xe48b385f +0, 432000, 38016, 0xd88d3691 +0, 435600, 38016, 0xf38f3ad4 +0, 439200, 38016, 0x2a0e256e +0, 442800, 38016, 0x0c25fbbd +0, 446400, 38016, 0x13dbd8fc +0, 450000, 38016, 0x8c4dc0b1 +0, 453600, 38016, 0x054bb5d5 +0, 457200, 38016, 0x19f8c259 +0, 460800, 38016, 0x4037d8fd +0, 464400, 38016, 0x13f4ecda +0, 468000, 38016, 0xde8af5a1 +0, 471600, 38016, 0x5997f541 +0, 475200, 38016, 0x876bebfe +0, 478800, 38016, 0x7322ef36 +0, 482400, 38016, 0xe6a7ecc3 +0, 486000, 38016, 0x20e5a1eb +0, 489600, 38016, 0xd1e5b985 +0, 493200, 38016, 0xe83cb437 +0, 496800, 38016, 0x8928a6f2 +0, 500400, 38016, 0xc6b1a7f4 +0, 504000, 38016, 0xcaf79531 +0, 507600, 38016, 0x3ded956e +0, 511200, 38016, 0x494b82c5 +0, 514800, 38016, 0x86cb794a +0, 518400, 38016, 0x548687e6 +0, 522000, 38016, 0x8f478a9f +0, 525600, 38016, 0x32a97cbb +0, 529200, 38016, 0x587b56cf +0, 532800, 38016, 0x933428a9 +0, 536400, 38016, 0xcb610212 +0, 540000, 38016, 0x0d27b12d +0, 543600, 38016, 0xf5a9b7e0 +0, 547200, 38016, 0x5287bdb7 +0, 550800, 38016, 0xa4e9b762 +0, 554400, 38016, 0x289da6d8 +0, 558000, 38016, 0x1969bb3e +0, 561600, 38016, 0x29cbe019 +0, 565200, 38016, 0xe01403c6 +0, 568800, 38016, 0xce003f90 +0, 572400, 38016, 0x455d67e1 +0, 576000, 38016, 0xb57f7724 +0, 579600, 38016, 0x7fce73b9 +0, 583200, 38016, 0x7f136bbe +0, 586800, 38016, 0xf096599f +0, 590400, 38016, 0xe6df4c3a +0, 594000, 38016, 0x98d2f70e +0, 597600, 38016, 0xb500f2d7 +0, 601200, 38016, 0x95d3ce30 +0, 604800, 38016, 0x02a9ae41 +0, 608400, 38016, 0xb146a958 +0, 612000, 38016, 0x86a0bf3d +0, 615600, 38016, 0x0c58d90a +0, 619200, 38016, 0x27aef37f +0, 622800, 38016, 0x3933fc3e +0, 626400, 38016, 0x9ce9dc1c +0, 630000, 38016, 0x3161ac45 +0, 633600, 38016, 0x4e8174cd +0, 637200, 38016, 0xd8904d4b +0, 640800, 38016, 0x933c2a55 +0, 644400, 38016, 0x85371555 +0, 648000, 38016, 0x3bb3ecd3 +0, 651600, 38016, 0x6b6ad873 +0, 655200, 38016, 0xa04dcf64 +0, 658800, 38016, 0x7869dc82 +0, 662400, 38016, 0x1c11e371 +0, 666000, 38016, 0x91eef557 +0, 669600, 38016, 0x27a30e42 +0, 673200, 38016, 0xcba73491 +0, 676800, 38016, 0xdffc402e +0, 680400, 38016, 0x49b543c6 +0, 684000, 38016, 0xe3f7f438 +0, 687600, 38016, 0xed3ec663 +0, 691200, 38016, 0x174ad199 +0, 694800, 38016, 0x5330eef8 +0, 698400, 38016, 0x19d9074b +0, 702000, 38016, 0x25961ad1 +0, 705600, 38016, 0x63024e80 +0, 709200, 38016, 0x25de6e2e +0, 712800, 38016, 0x4cc594e8 +0, 716400, 38016, 0x8b25afcf +0, 720000, 38016, 0x7b29bfcf +0, 723600, 38016, 0x93abce16 +0, 727200, 38016, 0xc7f1d8fb +0, 730800, 38016, 0x277ed79e +0, 734400, 38016, 0x30dbdfe4 +0, 738000, 38016, 0xbd8be711 +0, 741600, 38016, 0xf072ea62 +0, 745200, 38016, 0xbfd0e5a5 +0, 748800, 38016, 0xedffdb3d +0, 752400, 38016, 0x5238cb59 +0, 756000, 38016, 0x39305ec1 +0, 759600, 38016, 0x07816d20 +0, 763200, 38016, 0x61416e5b +0, 766800, 38016, 0xc39d6ae2 +0, 770400, 38016, 0x1de95fe1 +0, 774000, 38016, 0x0530552f +0, 777600, 38016, 0xa48f5b19 +0, 781200, 38016, 0x11305e31 +0, 784800, 38016, 0x9ae25bda +0, 788400, 38016, 0xf16e5b67 +0, 792000, 38016, 0x9a375284 +0, 795600, 38016, 0x5a744019 +0, 799200, 38016, 0x811631e5 +0, 802800, 38016, 0x178a20e6 +0, 806400, 38016, 0xcab02bf2 +0, 810000, 38016, 0x6fca13cb +0, 813600, 38016, 0xa1a71ba8 +0, 817200, 38016, 0x95f52de5 +0, 820800, 38016, 0xd2744451 +0, 824400, 38016, 0x717f6ef6 +0, 828000, 38016, 0x1f9e8ca9 +0, 831600, 38016, 0xc931b115 +0, 835200, 38016, 0xa4c1db05 +0, 838800, 38016, 0x92e80cc1 +0, 842400, 38016, 0x5ac5276c +0, 846000, 38016, 0x624340ca +0, 849600, 38016, 0x774a5a7c +0, 853200, 38016, 0x1da55863 +0, 856800, 38016, 0x1bbc3b98 +0, 860400, 38016, 0x953b1479 +0, 864000, 38016, 0x8b11e5a8 +0, 867600, 38016, 0xf749d359 +0, 871200, 38016, 0xb54fcb8a +0, 874800, 38016, 0xb64b1951 +0, 878400, 38016, 0x99778550 +0, 882000, 38016, 0x5e70e9e2 +0, 885600, 38016, 0x22550b80 +0, 889200, 38016, 0xfe3ddcde +0, 892800, 38016, 0x1e28989e +0, 896400, 38016, 0x25b926a4 +0, 900000, 38016, 0xf2c3c536 +0, 903600, 38016, 0x534a8643 +0, 907200, 38016, 0xf44b7f07 +0, 910800, 38016, 0x2873c895 +0, 914400, 38016, 0x67a7388d +0, 918000, 38016, 0x0e5eca3b +0, 921600, 38016, 0xc50dc747 +0, 925200, 38016, 0x6a3a4f1e +0, 928800, 38016, 0x77d83b5f +0, 932400, 38016, 0x91213d43 +0, 936000, 38016, 0x28344889 +0, 939600, 38016, 0xd1155a3f +0, 943200, 38016, 0x5c7a65c5 +0, 946800, 38016, 0x3d4e7104 +0, 950400, 38016, 0x91d96a37 +0, 954000, 38016, 0xbc7f63f3 +0, 957600, 38016, 0x79275184 +0, 961200, 38016, 0xa6b43348 +0, 964800, 38016, 0x9e1d105a +0, 968400, 38016, 0x14bce053 +0, 972000, 38016, 0x0ce3a7ca +0, 975600, 38016, 0x4b5980fe +0, 979200, 38016, 0x32745e1c +0, 982800, 38016, 0x85b91358 +0, 986400, 38016, 0x9e26c66c +0, 990000, 38016, 0x9735b157 +0, 993600, 38016, 0xfeaac3d1 +0, 997200, 38016, 0x8c95ca9f +0, 1000800, 38016, 0x1336fa92 +0, 1004400, 38016, 0x37bb65f8 +0, 1008000, 38016, 0x830c078a +0, 1011600, 38016, 0x088dd912 +0, 1015200, 38016, 0x8ef1a5a0 +0, 1018800, 38016, 0x9a1e642d +0, 1022400, 38016, 0xa165517e +0, 1026000, 38016, 0x0a34a67f +0, 1029600, 38016, 0xaf0a662a +0, 1033200, 38016, 0x3a5fa553 +0, 1036800, 38016, 0xda92b1f8 +0, 1040400, 38016, 0xac2997f4 +0, 1044000, 38016, 0x5df32cfc +0, 1047600, 38016, 0x5cea491d +0, 1051200, 38016, 0xeafbd139 +0, 1054800, 38016, 0x9ced0e69 +0, 1058400, 38016, 0x89514e3f +0, 1062000, 38016, 0x3f0b4842 +0, 1065600, 38016, 0xc9902325 +0, 1069200, 38016, 0xdb3e1585 +0, 1072800, 38016, 0x3cf31e95 +0, 1076400, 38016, 0x60f14679 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl2_sva_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl2_sva_b new file mode 100644 index 00000000..85945535 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl2_sva_b @@ -0,0 +1,17 @@ +0, 0, 38016, 0x0bd22424 +0, 3600, 38016, 0x4eb601f0 +0, 7200, 38016, 0xe16de459 +0, 10800, 38016, 0xde2e0c37 +0, 14400, 38016, 0x14a0286b +0, 18000, 38016, 0x37bc35b5 +0, 21600, 38016, 0xcfa24923 +0, 25200, 38016, 0xac755ba0 +0, 28800, 38016, 0x27d1822a +0, 32400, 38016, 0xa8039548 +0, 36000, 38016, 0x400ea1fb +0, 39600, 38016, 0x7d2ca44a +0, 43200, 38016, 0xd42dae4f +0, 46800, 38016, 0x39ce9599 +0, 50400, 38016, 0x37498aa1 +0, 54000, 38016, 0x8558911f +0, 57600, 38016, 0x06a8a9ad diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl3_sony_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl3_sony_c new file mode 100644 index 00000000..4d7f0eb0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl3_sony_c @@ -0,0 +1,300 @@ +0, 0, 38016, 0xc805351d +0, 3600, 38016, 0xa0b41fef +0, 7200, 38016, 0x965cf070 +0, 10800, 38016, 0x4552af45 +0, 14400, 38016, 0x8429a576 +0, 18000, 38016, 0xf6df8fc0 +0, 21600, 38016, 0x5d85554c +0, 25200, 38016, 0x9c9d5b96 +0, 28800, 38016, 0xbc4a4b71 +0, 32400, 38016, 0xae4d3fc8 +0, 36000, 38016, 0xf4da7f25 +0, 39600, 38016, 0xf7d89a46 +0, 43200, 38016, 0x204977fd +0, 46800, 38016, 0xa505b626 +0, 50400, 38016, 0xc7b8b3f8 +0, 54000, 38016, 0x96929e05 +0, 57600, 38016, 0xfcfab8cc +0, 61200, 38016, 0x750caf2d +0, 64800, 38016, 0xa2c682ca +0, 68400, 38016, 0x3dcd8f07 +0, 72000, 38016, 0x48fb69b3 +0, 75600, 38016, 0x128e3310 +0, 79200, 38016, 0x03803338 +0, 82800, 38016, 0x11362bda +0, 86400, 38016, 0xc672229a +0, 90000, 38016, 0x68e540d0 +0, 93600, 38016, 0x9d3a3deb +0, 97200, 38016, 0x53b233af +0, 100800, 38016, 0x3c6767eb +0, 104400, 38016, 0x2a8d75f2 +0, 108000, 38016, 0x006f63cc +0, 111600, 38016, 0x3652a79e +0, 115200, 38016, 0x42f8c0fa +0, 118800, 38016, 0x052eb292 +0, 122400, 38016, 0xbe7de0e7 +0, 126000, 38016, 0xf9f9d46f +0, 129600, 38016, 0xb6d9b200 +0, 133200, 38016, 0xc3bcd2d2 +0, 136800, 38016, 0x23b5c8c2 +0, 140400, 38016, 0x67caaf99 +0, 144000, 38016, 0xb365cd31 +0, 147600, 38016, 0x7cabc68f +0, 151200, 38016, 0xca8bb87a +0, 154800, 38016, 0x66a4be22 +0, 158400, 38016, 0x2d10c1b0 +0, 162000, 38016, 0xd1548835 +0, 165600, 38016, 0x8b15b359 +0, 169200, 38016, 0x2337b654 +0, 172800, 38016, 0x56cfac2b +0, 176400, 38016, 0x7ad4c642 +0, 180000, 38016, 0x6666c353 +0, 183600, 38016, 0x053fb0f2 +0, 187200, 38016, 0x2547c115 +0, 190800, 38016, 0xf202c045 +0, 194400, 38016, 0x94a8b95f +0, 198000, 38016, 0x439ccb13 +0, 201600, 38016, 0xdfe4d54f +0, 205200, 38016, 0x2a0aceae +0, 208800, 38016, 0x1293dbd5 +0, 212400, 38016, 0x9a62d994 +0, 216000, 38016, 0x65539ad7 +0, 219600, 38016, 0xc415ad58 +0, 223200, 38016, 0x47bb9417 +0, 226800, 38016, 0x92b745ea +0, 230400, 38016, 0x8fe8646e +0, 234000, 38016, 0x2b94857a +0, 237600, 38016, 0x12ac9aa4 +0, 241200, 38016, 0x856bf0ea +0, 244800, 38016, 0xdbb32674 +0, 248400, 38016, 0x96b53747 +0, 252000, 38016, 0x875a7548 +0, 255600, 38016, 0xdba4985c +0, 259200, 38016, 0x47cbb86c +0, 262800, 38016, 0x32dcfb99 +0, 266400, 38016, 0x18b53b26 +0, 270000, 38016, 0x2f0f3e49 +0, 273600, 38016, 0x27b1880d +0, 277200, 38016, 0xbcc19dac +0, 280800, 38016, 0x7b6caeb1 +0, 284400, 38016, 0xf3eece06 +0, 288000, 38016, 0x7d93d4c9 +0, 291600, 38016, 0xe6b8d923 +0, 295200, 38016, 0xf47ce844 +0, 298800, 38016, 0x74fce21c +0, 302400, 38016, 0x8e87d8cd +0, 306000, 38016, 0x9675d3ce +0, 309600, 38016, 0xd797ec75 +0, 313200, 38016, 0x70aeeef1 +0, 316800, 38016, 0x47baef32 +0, 320400, 38016, 0x5054ec56 +0, 324000, 38016, 0x43b6a0f7 +0, 327600, 38016, 0x95dfb688 +0, 331200, 38016, 0xc878a574 +0, 334800, 38016, 0xeb928019 +0, 338400, 38016, 0x304b7fec +0, 342000, 38016, 0x02cd7ea4 +0, 345600, 38016, 0x505f7a7a +0, 349200, 38016, 0x09f59eaf +0, 352800, 38016, 0x513faaf7 +0, 356400, 38016, 0xbd0daaa8 +0, 360000, 38016, 0x8012be0f +0, 363600, 38016, 0xb663aa15 +0, 367200, 38016, 0xd138981a +0, 370800, 38016, 0xc16b98a2 +0, 374400, 38016, 0xf43eb8f8 +0, 378000, 38016, 0xea22a35b +0, 381600, 38016, 0x9a0be0bb +0, 385200, 38016, 0x2a77ff9d +0, 388800, 38016, 0x2e350431 +0, 392400, 38016, 0x9d0335ba +0, 396000, 38016, 0x62f23f21 +0, 399600, 38016, 0x3e973351 +0, 403200, 38016, 0x9d8f4ac5 +0, 406800, 38016, 0x91e132ba +0, 410400, 38016, 0xfd04f69a +0, 414000, 38016, 0x481a1778 +0, 417600, 38016, 0x27fa1dc4 +0, 421200, 38016, 0x23ae0a6a +0, 424800, 38016, 0xc3ec426a +0, 428400, 38016, 0xc2a54ac1 +0, 432000, 38016, 0xd88d3691 +0, 435600, 38016, 0x46014ba7 +0, 439200, 38016, 0xbf902815 +0, 442800, 38016, 0x2af5ee16 +0, 446400, 38016, 0xd183dc64 +0, 450000, 38016, 0xf0c5bdd8 +0, 453600, 38016, 0xb21aa102 +0, 457200, 38016, 0xb35bbec2 +0, 460800, 38016, 0x7efad1ce +0, 464400, 38016, 0x04e3d71d +0, 468000, 38016, 0x901ff71b +0, 471600, 38016, 0xc6c6e640 +0, 475200, 38016, 0xd292d5d3 +0, 478800, 38016, 0x2ce4e3fe +0, 482400, 38016, 0xe7fedf8a +0, 486000, 38016, 0x20e5a1eb +0, 489600, 38016, 0xbc39be76 +0, 493200, 38016, 0xf749b4dd +0, 496800, 38016, 0xbc3f97a4 +0, 500400, 38016, 0xa058a244 +0, 504000, 38016, 0x77eb961b +0, 507600, 38016, 0xa92e7f25 +0, 511200, 38016, 0xc75e796f +0, 514800, 38016, 0x114c79bd +0, 518400, 38016, 0x3fb96da3 +0, 522000, 38016, 0x1c6f87b8 +0, 525600, 38016, 0x25567ae4 +0, 529200, 38016, 0xf5dd42b2 +0, 532800, 38016, 0xe6172d0c +0, 536400, 38016, 0xcec0fd48 +0, 540000, 38016, 0x0d27b12d +0, 543600, 38016, 0x3ec7cd24 +0, 547200, 38016, 0xb2dccabe +0, 550800, 38016, 0xa977a844 +0, 554400, 38016, 0x4b3bbfed +0, 558000, 38016, 0xed6dd876 +0, 561600, 38016, 0x751bd34e +0, 565200, 38016, 0x80160cf9 +0, 568800, 38016, 0xfbf53be8 +0, 572400, 38016, 0x726e4f3b +0, 576000, 38016, 0x8ebb730c +0, 579600, 38016, 0x2c0c5fe6 +0, 583200, 38016, 0x450940c0 +0, 586800, 38016, 0xeed63ff8 +0, 590400, 38016, 0x6f233d75 +0, 594000, 38016, 0x98d2f70e +0, 597600, 38016, 0x8d38f2e8 +0, 601200, 38016, 0x905dcbc9 +0, 604800, 38016, 0x68c3a0f7 +0, 608400, 38016, 0x4bb8a40c +0, 612000, 38016, 0x3650b08e +0, 615600, 38016, 0x3c3bbfd7 +0, 619200, 38016, 0xcbc9da56 +0, 622800, 38016, 0x576de6cd +0, 626400, 38016, 0x95f5c8c1 +0, 630000, 38016, 0xbbcaacc8 +0, 633600, 38016, 0x1b547ba4 +0, 637200, 38016, 0x8f5238b2 +0, 640800, 38016, 0x4c0f35c4 +0, 644400, 38016, 0x894f278d +0, 648000, 38016, 0x3bb3ecd3 +0, 651600, 38016, 0x177bf317 +0, 655200, 38016, 0xdb1fdada +0, 658800, 38016, 0xec27cc28 +0, 662400, 38016, 0x6a12eec7 +0, 666000, 38016, 0x0168ff3f +0, 669600, 38016, 0x3fa206ba +0, 673200, 38016, 0x47cc30b5 +0, 676800, 38016, 0xb2d02ddd +0, 680400, 38016, 0x306626bb +0, 684000, 38016, 0xfb06eb5b +0, 687600, 38016, 0x5881b60e +0, 691200, 38016, 0xd58caaf8 +0, 694800, 38016, 0x840bdd0c +0, 698400, 38016, 0xb71efac1 +0, 702000, 38016, 0x25961ad1 +0, 705600, 38016, 0xbec156eb +0, 709200, 38016, 0xe2d1695c +0, 712800, 38016, 0x3fbe83d4 +0, 716400, 38016, 0x10d8afe2 +0, 720000, 38016, 0xa61fb9aa +0, 723600, 38016, 0x0c20be29 +0, 727200, 38016, 0xc273cdd4 +0, 730800, 38016, 0xfb21cfa0 +0, 734400, 38016, 0xb1ccc643 +0, 738000, 38016, 0x30f5d7a2 +0, 741600, 38016, 0xe742da0f +0, 745200, 38016, 0x0a08d6a3 +0, 748800, 38016, 0x85c4cf6c +0, 752400, 38016, 0xc117b8f4 +0, 756000, 38016, 0x39305ec1 +0, 759600, 38016, 0xf2867b2d +0, 763200, 38016, 0x81147a22 +0, 766800, 38016, 0x308b59c3 +0, 770400, 38016, 0xfd076bbd +0, 774000, 38016, 0x11bf57f5 +0, 777600, 38016, 0x8c103fb7 +0, 781200, 38016, 0x4f5e5a48 +0, 784800, 38016, 0xa0fd54dc +0, 788400, 38016, 0x69d7429b +0, 792000, 38016, 0x93154a7c +0, 795600, 38016, 0xc72e3995 +0, 799200, 38016, 0x86541ae0 +0, 802800, 38016, 0xa9c93120 +0, 806400, 38016, 0x602d368a +0, 810000, 38016, 0x6fca13cb +0, 813600, 38016, 0x314f3702 +0, 817200, 38016, 0x4d1647bd +0, 820800, 38016, 0x73673c96 +0, 824400, 38016, 0x62897c6f +0, 828000, 38016, 0x918e9a7d +0, 831600, 38016, 0x9fb9ad4f +0, 835200, 38016, 0xc4c30339 +0, 838800, 38016, 0x137017df +0, 842400, 38016, 0xa98a1b61 +0, 846000, 38016, 0xf74c4b4f +0, 849600, 38016, 0x3eac5cb1 +0, 853200, 38016, 0x5d403e50 +0, 856800, 38016, 0xa33a4eb6 +0, 860400, 38016, 0x3f0a13fb +0, 864000, 38016, 0x8b11e5a8 +0, 867600, 38016, 0x536bca4b +0, 871200, 38016, 0xe1daa789 +0, 874800, 38016, 0xab37f6d1 +0, 878400, 38016, 0xbefe6f58 +0, 882000, 38016, 0xa5fdd2ff +0, 885600, 38016, 0x6065ec01 +0, 889200, 38016, 0x939dd93a +0, 892800, 38016, 0x3a7593d5 +0, 896400, 38016, 0x30fe19fe +0, 900000, 38016, 0xb507c21c +0, 903600, 38016, 0xf47f73ac +0, 907200, 38016, 0xe9fc669a +0, 910800, 38016, 0x2b85d19a +0, 914400, 38016, 0x57033999 +0, 918000, 38016, 0x0e5eca3b +0, 921600, 38016, 0x6a7bda2c +0, 925200, 38016, 0x3517638d +0, 928800, 38016, 0x1f5432e3 +0, 932400, 38016, 0x584d4c96 +0, 936000, 38016, 0x92474c0c +0, 939600, 38016, 0x8c5e44a5 +0, 943200, 38016, 0x07dd64d4 +0, 946800, 38016, 0x828d632b +0, 950400, 38016, 0x142254b6 +0, 954000, 38016, 0x8f9b60a4 +0, 957600, 38016, 0x44f745dd +0, 961200, 38016, 0xc3321666 +0, 964800, 38016, 0x95520396 +0, 968400, 38016, 0x3eb3de27 +0, 972000, 38016, 0x0ce3a7ca +0, 975600, 38016, 0x58258838 +0, 979200, 38016, 0x5725627a +0, 982800, 38016, 0x901907ab +0, 986400, 38016, 0xf965da2f +0, 990000, 38016, 0xf542bae9 +0, 993600, 38016, 0x3dc4b3c3 +0, 997200, 38016, 0x8a1dd1e9 +0, 1000800, 38016, 0x4f6ef803 +0, 1004400, 38016, 0xde384800 +0, 1008000, 38016, 0x7251116f +0, 1011600, 38016, 0x89f9e1ca +0, 1015200, 38016, 0xc9818624 +0, 1018800, 38016, 0x30e391a6 +0, 1022400, 38016, 0x7aab6887 +0, 1026000, 38016, 0x0a34a67f +0, 1029600, 38016, 0xe1258086 +0, 1033200, 38016, 0x5b16a887 +0, 1036800, 38016, 0x3297a135 +0, 1040400, 38016, 0x45a77236 +0, 1044000, 38016, 0xa414013a +0, 1047600, 38016, 0xfab52c7e +0, 1051200, 38016, 0x9074aca1 +0, 1054800, 38016, 0x843ad8a6 +0, 1058400, 38016, 0xccc63573 +0, 1062000, 38016, 0x3ba52a5f +0, 1065600, 38016, 0x2f7b0236 +0, 1069200, 38016, 0x0ad407ec +0, 1072800, 38016, 0x42082369 +0, 1076400, 38016, 0x5a9d3f63 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl3_sva_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl3_sva_b new file mode 100644 index 00000000..1c575c83 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl3_sva_b @@ -0,0 +1,17 @@ +0, 0, 38016, 0x0bd22424 +0, 3600, 38016, 0xc45d1947 +0, 7200, 38016, 0x9d3d1218 +0, 10800, 38016, 0x79b71e03 +0, 14400, 38016, 0xd11e4a14 +0, 18000, 38016, 0x44c66b22 +0, 21600, 38016, 0xb9cc7acf +0, 25200, 38016, 0x8ccd92a1 +0, 28800, 38016, 0x4a76aec4 +0, 32400, 38016, 0x6e2fc27e +0, 36000, 38016, 0x400ea1fb +0, 39600, 38016, 0xd1e2b7c4 +0, 43200, 38016, 0xb45eb08d +0, 46800, 38016, 0x15079991 +0, 50400, 38016, 0x0fc97188 +0, 54000, 38016, 0xf9fc81af +0, 57600, 38016, 0x020f992d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl4_sva_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl4_sva_b new file mode 100644 index 00000000..65555fac --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canl4_sva_b @@ -0,0 +1,33 @@ +0, 0, 38016, 0x5d9514e3 +0, 3600, 38016, 0xf5e8155c +0, 7200, 38016, 0xc0a5f88b +0, 10800, 38016, 0x421d2610 +0, 14400, 38016, 0x971838af +0, 18000, 38016, 0xbd645dfc +0, 21600, 38016, 0xaab5626a +0, 25200, 38016, 0xc8fc9b6b +0, 28800, 38016, 0x8be593f4 +0, 32400, 38016, 0x6560c0f4 +0, 36000, 38016, 0x29009b56 +0, 39600, 38016, 0x20b4bd2a +0, 43200, 38016, 0xe8a7a51e +0, 46800, 38016, 0x8c5e906a +0, 50400, 38016, 0x15496f1e +0, 54000, 38016, 0xdc788399 +0, 57600, 38016, 0x2b1e89b2 +0, 61200, 38016, 0xe9fda9bd +0, 64800, 38016, 0x7c319f69 +0, 68400, 38016, 0x2921cbc4 +0, 72000, 38016, 0xb4fab1e2 +0, 75600, 38016, 0x6af6ba57 +0, 79200, 38016, 0xb36e7df5 +0, 82800, 38016, 0x57517aec +0, 86400, 38016, 0x9f5f331a +0, 90000, 38016, 0xafde3f8a +0, 93600, 38016, 0x97f32b54 +0, 97200, 38016, 0x0c194bf7 +0, 100800, 38016, 0x58a054c2 +0, 104400, 38016, 0x6a637e5f +0, 108000, 38016, 0x8b2d63d0 +0, 111600, 38016, 0x521772c5 +0, 115200, 38016, 0xae555677 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canlma2_sony_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canlma2_sony_c new file mode 100644 index 00000000..5eff64e5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canlma2_sony_c @@ -0,0 +1,17 @@ +0, 0, 518400, 0xfbca00c6 +0, 3600, 518400, 0x82b80adf +0, 7200, 518400, 0x87ecdf4a +0, 10800, 518400, 0xf6ca8cbe +0, 14400, 518400, 0x8e9bb8a0 +0, 18000, 518400, 0x6512caa2 +0, 21600, 518400, 0xc015e43e +0, 25200, 518400, 0x5f504a5c +0, 28800, 518400, 0x4c7458a4 +0, 32400, 518400, 0x630f4004 +0, 36000, 518400, 0x889af20e +0, 39600, 518400, 0x4437a5a4 +0, 43200, 518400, 0x1e19a254 +0, 46800, 518400, 0xb7ef1763 +0, 50400, 518400, 0xc966c95a +0, 54000, 518400, 0x0c9074d6 +0, 57600, 518400, 0x24c906c9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canlma3_sony_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canlma3_sony_c new file mode 100644 index 00000000..9ee15ddd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-canlma3_sony_c @@ -0,0 +1,17 @@ +0, 0, 518400, 0xfbca00c6 +0, 3600, 518400, 0x82b80adf +0, 7200, 518400, 0x4874c24c +0, 10800, 518400, 0xdb19528a +0, 14400, 518400, 0x27888656 +0, 18000, 518400, 0x5e7aa98f +0, 21600, 518400, 0xb43ecd8b +0, 25200, 518400, 0xef772cbd +0, 28800, 518400, 0x4f1e1d7e +0, 32400, 518400, 0x0e9fe921 +0, 36000, 518400, 0xe4dab3d2 +0, 39600, 518400, 0x9279587b +0, 43200, 518400, 0xa8248296 +0, 46800, 518400, 0x7be6c0d6 +0, 50400, 518400, 0x85ea92b1 +0, 54000, 518400, 0x0c9074d6 +0, 57600, 518400, 0x5c95bf41 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capa1_toshiba_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capa1_toshiba_b new file mode 100644 index 00000000..9f1d91f8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capa1_toshiba_b @@ -0,0 +1,90 @@ +0, 0, 152064, 0x4040d2fc +0, 3600, 152064, 0x0d8f9897 +0, 7200, 152064, 0xc23321cd +0, 10800, 152064, 0x3c9225eb +0, 14400, 152064, 0x8927006f +0, 18000, 152064, 0xf706a302 +0, 21600, 152064, 0x8219c106 +0, 25200, 152064, 0x06c990ea +0, 28800, 152064, 0x3a0f1135 +0, 32400, 152064, 0x4cff21d3 +0, 36000, 152064, 0x6be0e050 +0, 39600, 152064, 0x718b6c7b +0, 43200, 152064, 0x24b38713 +0, 46800, 152064, 0x500553fb +0, 50400, 152064, 0x531ae610 +0, 54000, 152064, 0x46f4ff1b +0, 57600, 152064, 0xe5abe5ff +0, 61200, 152064, 0x97daa351 +0, 64800, 152064, 0xfbef0a8f +0, 68400, 152064, 0xbe76134f +0, 72000, 152064, 0xa4bf10ea +0, 75600, 152064, 0xb2fb32af +0, 79200, 152064, 0xd33027a5 +0, 82800, 152064, 0x78e20c2b +0, 86400, 152064, 0xefda2d6f +0, 90000, 152064, 0xb99126f0 +0, 93600, 152064, 0x89d7e465 +0, 97200, 152064, 0x6150ff97 +0, 100800, 152064, 0xde03d937 +0, 104400, 152064, 0xd90ca874 +0, 108000, 152064, 0xb120b294 +0, 111600, 152064, 0x644eade4 +0, 115200, 152064, 0xd1bb004f +0, 118800, 152064, 0x99806a8b +0, 122400, 152064, 0x8c6b635f +0, 126000, 152064, 0xa269fa8b +0, 129600, 152064, 0xc11c0e64 +0, 133200, 152064, 0xac13f5eb +0, 136800, 152064, 0x895799cf +0, 140400, 152064, 0x95a9bea1 +0, 144000, 152064, 0xe998dfba +0, 147600, 152064, 0xc72d8460 +0, 151200, 152064, 0xd1cb9b9a +0, 154800, 152064, 0xb49aadd3 +0, 158400, 152064, 0x8bc38547 +0, 162000, 152064, 0x3485984b +0, 165600, 152064, 0xdf305c0a +0, 169200, 152064, 0x6a1ec990 +0, 172800, 152064, 0x595e0de4 +0, 176400, 152064, 0xe1baf7c4 +0, 180000, 152064, 0xf08b9b47 +0, 183600, 152064, 0x6532ba6f +0, 187200, 152064, 0x3de67da6 +0, 190800, 152064, 0x439ffd04 +0, 194400, 152064, 0x6e6c1e97 +0, 198000, 152064, 0x8e5aee7a +0, 201600, 152064, 0xd634999a +0, 205200, 152064, 0xadfa9e8b +0, 208800, 152064, 0x1b9090f5 +0, 212400, 152064, 0x29094dfc +0, 216000, 152064, 0x56748851 +0, 219600, 152064, 0x2316719d +0, 223200, 152064, 0x2ee0060b +0, 226800, 152064, 0x3edb36d4 +0, 230400, 152064, 0x9ef437a3 +0, 234000, 152064, 0x8d9af72e +0, 237600, 152064, 0xab86389c +0, 241200, 152064, 0xd3b34576 +0, 244800, 152064, 0x9e5b04f4 +0, 248400, 152064, 0x6a164c17 +0, 252000, 152064, 0xcecf20ab +0, 255600, 152064, 0x07c8e273 +0, 259200, 152064, 0x9b46fe6a +0, 262800, 152064, 0xc1e8002b +0, 266400, 152064, 0xdebdbe53 +0, 270000, 152064, 0x0d2dfd99 +0, 273600, 152064, 0xe8ae925f +0, 277200, 152064, 0xe1fe6272 +0, 280800, 152064, 0xbb74d5e6 +0, 284400, 152064, 0xc7b5d949 +0, 288000, 152064, 0x9b15b020 +0, 291600, 152064, 0xc8201f44 +0, 295200, 152064, 0x30d03303 +0, 298800, 152064, 0x9f66fbc2 +0, 302400, 152064, 0x482b71ec +0, 306000, 152064, 0x1c9e50bf +0, 309600, 152064, 0x89f247e4 +0, 313200, 152064, 0xaa5f9141 +0, 316800, 152064, 0xb816aa8c +0, 320400, 152064, 0x3112a619 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capama3_sand_f b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capama3_sand_f new file mode 100644 index 00000000..5fb9756d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capama3_sand_f @@ -0,0 +1,50 @@ +0, 0, 152064, 0xf772f152 +0, 3600, 152064, 0xc416d300 +0, 7200, 152064, 0xc2275c94 +0, 10800, 152064, 0x1bd35645 +0, 14400, 152064, 0x60327bf5 +0, 18000, 152064, 0x7f5541bd +0, 21600, 152064, 0x52e5ebad +0, 25200, 152064, 0xb8e5c1f3 +0, 28800, 152064, 0x2b4e3653 +0, 32400, 152064, 0x9a8f8499 +0, 36000, 152064, 0x32d4e9fb +0, 39600, 152064, 0x0bc73d7a +0, 43200, 152064, 0xb58a8b87 +0, 46800, 152064, 0xddbc5468 +0, 50400, 152064, 0xcfa30b64 +0, 54000, 152064, 0xad411f36 +0, 57600, 152064, 0x2f8c4d9b +0, 61200, 152064, 0xc8523359 +0, 64800, 152064, 0x86be9861 +0, 68400, 152064, 0x7518d731 +0, 72000, 152064, 0x425fbfab +0, 75600, 152064, 0x4f00250d +0, 79200, 152064, 0x12b40617 +0, 82800, 152064, 0x65ff925d +0, 86400, 152064, 0xc76a94c9 +0, 90000, 152064, 0x640170d5 +0, 93600, 152064, 0xd338a090 +0, 97200, 152064, 0xce715174 +0, 100800, 152064, 0x7bded195 +0, 104400, 152064, 0x09e7d3b9 +0, 108000, 152064, 0x651e1518 +0, 111600, 152064, 0x03cadc5f +0, 115200, 152064, 0x08906919 +0, 118800, 152064, 0x3303ebe0 +0, 122400, 152064, 0xa28676c5 +0, 126000, 152064, 0x3900ecaf +0, 129600, 152064, 0xeb795a05 +0, 133200, 152064, 0x870034df +0, 136800, 152064, 0x69b0527a +0, 140400, 152064, 0xb2b314f9 +0, 144000, 152064, 0x1a44ea1a +0, 147600, 152064, 0xe6eaec87 +0, 151200, 152064, 0xd9ad818e +0, 154800, 152064, 0x9c7ff76e +0, 158400, 152064, 0x74c45abb +0, 162000, 152064, 0x2f4fa5c6 +0, 165600, 152064, 0x19620702 +0, 169200, 152064, 0xfc9601f3 +0, 172800, 152064, 0x33e0d8e7 +0, 176400, 152064, 0xdf7f2a80 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capcm1_sand_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capcm1_sand_e new file mode 100644 index 00000000..3a90eaf3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capcm1_sand_e @@ -0,0 +1,30 @@ +0, 0, 152064, 0x9989b588 +0, 3600, 152064, 0x7cbf85d4 +0, 7200, 152064, 0x72615cf1 +0, 10800, 152064, 0xcf98053c +0, 14400, 152064, 0x42daddb0 +0, 18000, 152064, 0x460ca616 +0, 21600, 152064, 0x54cc5ab1 +0, 25200, 152064, 0xd146396e +0, 28800, 152064, 0xefbbffc3 +0, 32400, 152064, 0x41ecd870 +0, 36000, 152064, 0x57bba322 +0, 39600, 152064, 0x7e7270f8 +0, 43200, 152064, 0x1f5d1f0e +0, 46800, 152064, 0x5478eb60 +0, 50400, 152064, 0xd9abb62a +0, 54000, 152064, 0x97997f6d +0, 57600, 152064, 0xfc405569 +0, 61200, 152064, 0x4e49329b +0, 64800, 152064, 0x6b98f9c6 +0, 68400, 152064, 0xa872cf59 +0, 72000, 152064, 0x478a897d +0, 75600, 152064, 0xf6744e5d +0, 79200, 152064, 0x7ddf110d +0, 82800, 152064, 0xe6bde4be +0, 86400, 152064, 0x5c3ba029 +0, 90000, 152064, 0x07759146 +0, 93600, 152064, 0x4beb510f +0, 97200, 152064, 0x5b063ad9 +0, 100800, 152064, 0xc2930366 +0, 104400, 152064, 0x5435e658 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capcmnl1_sand_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capcmnl1_sand_e new file mode 100644 index 00000000..02f6a902 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capcmnl1_sand_e @@ -0,0 +1,30 @@ +0, 0, 152064, 0xf973b384 +0, 3600, 152064, 0x84418532 +0, 7200, 152064, 0x63165bc0 +0, 10800, 152064, 0x54b5049d +0, 14400, 152064, 0xde66dbbc +0, 18000, 152064, 0x8001a4f5 +0, 21600, 152064, 0x6b5259b7 +0, 25200, 152064, 0xd15137a1 +0, 28800, 152064, 0x1d19fdb9 +0, 32400, 152064, 0x3533d5a1 +0, 36000, 152064, 0xf82ba039 +0, 39600, 152064, 0x04366ee9 +0, 43200, 152064, 0xf7ac1dfb +0, 46800, 152064, 0x6d0aebd7 +0, 50400, 152064, 0x4f2bb62d +0, 54000, 152064, 0x6a7a7d50 +0, 57600, 152064, 0xc9c95422 +0, 61200, 152064, 0x35a13150 +0, 64800, 152064, 0xb576f7e4 +0, 68400, 152064, 0x5ad3cde5 +0, 72000, 152064, 0xbcb18908 +0, 75600, 152064, 0xa2a24ca7 +0, 79200, 152064, 0x95700ea5 +0, 82800, 152064, 0xfdb5e316 +0, 86400, 152064, 0x56e3a003 +0, 90000, 152064, 0x09ae905c +0, 93600, 152064, 0xa1175024 +0, 97200, 152064, 0x8b82395e +0, 100800, 152064, 0x032202da +0, 104400, 152064, 0xae15e5e7 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capm3_sony_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capm3_sony_d new file mode 100644 index 00000000..4080b65f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-capm3_sony_d @@ -0,0 +1,300 @@ +0, 0, 38016, 0xa3b72d2f +0, 3600, 38016, 0x77d918ae +0, 7200, 38016, 0x181ad684 +0, 10800, 38016, 0x0dafa49c +0, 14400, 38016, 0x8250a733 +0, 18000, 38016, 0x5d4f79b5 +0, 21600, 38016, 0x59664665 +0, 25200, 38016, 0xdce3491c +0, 28800, 38016, 0xaffc395f +0, 32400, 38016, 0xfb09320d +0, 36000, 38016, 0x9b776724 +0, 39600, 38016, 0x30497da7 +0, 43200, 38016, 0xffd16ea0 +0, 46800, 38016, 0x5b7da1b5 +0, 50400, 38016, 0x764a9cc4 +0, 54000, 38016, 0xc4c79c41 +0, 57600, 38016, 0x883299dd +0, 61200, 38016, 0xd5f39350 +0, 64800, 38016, 0x892f6808 +0, 68400, 38016, 0x5b0572d7 +0, 72000, 38016, 0x53c84a0c +0, 75600, 38016, 0xe6ff14e2 +0, 79200, 38016, 0xd66d1924 +0, 82800, 38016, 0x7bec105f +0, 86400, 38016, 0x405ffc8d +0, 90000, 38016, 0xfccc2019 +0, 93600, 38016, 0x639f25a2 +0, 97200, 38016, 0xf89e179b +0, 100800, 38016, 0x3e49456e +0, 104400, 38016, 0x8d7d5d8e +0, 108000, 38016, 0x89d15f1e +0, 111600, 38016, 0x413d8c6a +0, 115200, 38016, 0xf1a0a555 +0, 118800, 38016, 0x61249a1f +0, 122400, 38016, 0xbd91c000 +0, 126000, 38016, 0x3209c225 +0, 129600, 38016, 0xfebca72f +0, 133200, 38016, 0x839abdfd +0, 136800, 38016, 0xa47cbc00 +0, 140400, 38016, 0x4537a269 +0, 144000, 38016, 0xbf19c0b2 +0, 147600, 38016, 0x7487c290 +0, 151200, 38016, 0xfbf8ab0c +0, 154800, 38016, 0xce2ab41e +0, 158400, 38016, 0xb505acf2 +0, 162000, 38016, 0x758489bc +0, 165600, 38016, 0x7eae9aca +0, 169200, 38016, 0x67b59692 +0, 172800, 38016, 0x074d9354 +0, 176400, 38016, 0xb6f6ae8a +0, 180000, 38016, 0xe3b9a825 +0, 183600, 38016, 0x5f4e9cb2 +0, 187200, 38016, 0x88b3abcd +0, 190800, 38016, 0x0cd7acdb +0, 194400, 38016, 0xa731a3e4 +0, 198000, 38016, 0x9414c055 +0, 201600, 38016, 0x6cfec34a +0, 205200, 38016, 0x6c89bce0 +0, 208800, 38016, 0xdabdc781 +0, 212400, 38016, 0x1afcc587 +0, 216000, 38016, 0xb4e79851 +0, 219600, 38016, 0x383ca78a +0, 223200, 38016, 0x461f83fb +0, 226800, 38016, 0x55f039e3 +0, 230400, 38016, 0xb6ec5d3f +0, 234000, 38016, 0x645888af +0, 237600, 38016, 0x37bc9e52 +0, 241200, 38016, 0x12a4f603 +0, 244800, 38016, 0x63e92df7 +0, 248400, 38016, 0x1a0246e3 +0, 252000, 38016, 0x1a6282fe +0, 255600, 38016, 0x4e99a785 +0, 259200, 38016, 0xdaefbf23 +0, 262800, 38016, 0x9e8f00f1 +0, 266400, 38016, 0x85ea26c5 +0, 270000, 38016, 0x495e2ddb +0, 273600, 38016, 0xab6278a4 +0, 277200, 38016, 0x48a78708 +0, 280800, 38016, 0x6fe99535 +0, 284400, 38016, 0xc3d9b8eb +0, 288000, 38016, 0x4491c577 +0, 291600, 38016, 0x4d42cc30 +0, 295200, 38016, 0x3469d8bd +0, 298800, 38016, 0x563dd0ad +0, 302400, 38016, 0x681dbdef +0, 306000, 38016, 0x5da9d2a7 +0, 309600, 38016, 0x75abdf2e +0, 313200, 38016, 0x9bf0d13a +0, 316800, 38016, 0x3c24dd7c +0, 320400, 38016, 0x5132df96 +0, 324000, 38016, 0x01bd9d86 +0, 327600, 38016, 0x2b97bdfe +0, 331200, 38016, 0xa7fdb2f1 +0, 334800, 38016, 0xcf908cfd +0, 338400, 38016, 0xd18e7e52 +0, 342000, 38016, 0x6a1d78d3 +0, 345600, 38016, 0xd9cc83af +0, 349200, 38016, 0xf6329ca1 +0, 352800, 38016, 0x1976aaeb +0, 356400, 38016, 0xa3e8a3ce +0, 360000, 38016, 0x73a2bd65 +0, 363600, 38016, 0xfd00a552 +0, 367200, 38016, 0x2df18642 +0, 370800, 38016, 0x85ad82fb +0, 374400, 38016, 0x0456a864 +0, 378000, 38016, 0x0d6da3b6 +0, 381600, 38016, 0xabf0de94 +0, 385200, 38016, 0x68aef77e +0, 388800, 38016, 0xd6aefd84 +0, 392400, 38016, 0x01953184 +0, 396000, 38016, 0xff324067 +0, 399600, 38016, 0x49aa300f +0, 403200, 38016, 0xc146456b +0, 406800, 38016, 0xfe5c2980 +0, 410400, 38016, 0x8f4df7eb +0, 414000, 38016, 0x137c1373 +0, 417600, 38016, 0xfb9d1006 +0, 421200, 38016, 0x7f5409f9 +0, 424800, 38016, 0xa6ff29fc +0, 428400, 38016, 0xc63e3807 +0, 432000, 38016, 0xd77c313a +0, 435600, 38016, 0xdd3832dd +0, 439200, 38016, 0xe70d140c +0, 442800, 38016, 0xa559d731 +0, 446400, 38016, 0x3593d345 +0, 450000, 38016, 0x7497ad8a +0, 453600, 38016, 0x9906919f +0, 457200, 38016, 0x18bfb034 +0, 460800, 38016, 0xa4fbbd76 +0, 464400, 38016, 0xbd6cc31c +0, 468000, 38016, 0x6ddde005 +0, 471600, 38016, 0x0072dd5f +0, 475200, 38016, 0x62c5c5c0 +0, 478800, 38016, 0x1093cf81 +0, 482400, 38016, 0x46dbc9ff +0, 486000, 38016, 0x0269a169 +0, 489600, 38016, 0xc96daa27 +0, 493200, 38016, 0xa0319cf4 +0, 496800, 38016, 0x1cae87fd +0, 500400, 38016, 0xf1a0977f +0, 504000, 38016, 0xc4d48a56 +0, 507600, 38016, 0xd3b1704c +0, 511200, 38016, 0xd5e46a6c +0, 514800, 38016, 0xb73e68fb +0, 518400, 38016, 0xc0585fcf +0, 522000, 38016, 0x1b3978fe +0, 525600, 38016, 0xdda66c02 +0, 529200, 38016, 0x581033d6 +0, 532800, 38016, 0x0737185f +0, 536400, 38016, 0xa0c9f494 +0, 540000, 38016, 0x916eae22 +0, 543600, 38016, 0xfdf7d6cd +0, 547200, 38016, 0x6978ce4c +0, 550800, 38016, 0x6783b016 +0, 554400, 38016, 0x528ac304 +0, 558000, 38016, 0x245de0ae +0, 561600, 38016, 0x1dade956 +0, 565200, 38016, 0xa8f316da +0, 568800, 38016, 0x95f04ca6 +0, 572400, 38016, 0x76615822 +0, 576000, 38016, 0x21de6ff4 +0, 579600, 38016, 0x12be5e8b +0, 583200, 38016, 0x47ea3cbd +0, 586800, 38016, 0x113631b5 +0, 590400, 38016, 0x546b2789 +0, 594000, 38016, 0x0505f2bb +0, 597600, 38016, 0x90eee299 +0, 601200, 38016, 0x305cb341 +0, 604800, 38016, 0x5921841b +0, 608400, 38016, 0x1449922d +0, 612000, 38016, 0xca8f9f0a +0, 615600, 38016, 0x0daeab19 +0, 619200, 38016, 0xde20dc27 +0, 622800, 38016, 0xb6ffd92c +0, 626400, 38016, 0xedb1bc49 +0, 630000, 38016, 0x4ccf9ff5 +0, 633600, 38016, 0xfb636cd5 +0, 637200, 38016, 0x9c562c3d +0, 640800, 38016, 0x0b021c95 +0, 644400, 38016, 0x8da50f21 +0, 648000, 38016, 0xa043ec8c +0, 651600, 38016, 0x0143f4f2 +0, 655200, 38016, 0x77bece5b +0, 658800, 38016, 0x147ccc68 +0, 662400, 38016, 0xa90cf948 +0, 666000, 38016, 0x8764066e +0, 669600, 38016, 0x26c61821 +0, 673200, 38016, 0x39dd3be4 +0, 676800, 38016, 0xe2203c69 +0, 680400, 38016, 0x00e73014 +0, 684000, 38016, 0x0024f9eb +0, 687600, 38016, 0x3a0da880 +0, 691200, 38016, 0x0336a353 +0, 694800, 38016, 0x721ed897 +0, 698400, 38016, 0x1c51f53f +0, 702000, 38016, 0xeec91a00 +0, 705600, 38016, 0x73074864 +0, 709200, 38016, 0x672e5ff8 +0, 712800, 38016, 0xe7ea7aba +0, 716400, 38016, 0x11899f08 +0, 720000, 38016, 0xa98daf03 +0, 723600, 38016, 0x4553af5c +0, 727200, 38016, 0x4892c5d5 +0, 730800, 38016, 0x0ddbc2eb +0, 734400, 38016, 0x0ce5b867 +0, 738000, 38016, 0xb0e6ce2c +0, 741600, 38016, 0x8a2bd4da +0, 745200, 38016, 0xf9f4cbec +0, 748800, 38016, 0x77aeba8f +0, 752400, 38016, 0xc1839e46 +0, 756000, 38016, 0x34845d3a +0, 759600, 38016, 0xc3227ad7 +0, 763200, 38016, 0x2dad7051 +0, 766800, 38016, 0x7145565a +0, 770400, 38016, 0x1e056ef1 +0, 774000, 38016, 0x9baa5195 +0, 777600, 38016, 0xacb53a1a +0, 781200, 38016, 0x825d4fb7 +0, 784800, 38016, 0x63194b14 +0, 788400, 38016, 0xcb16360e +0, 792000, 38016, 0x35104320 +0, 795600, 38016, 0x7e4c33dc +0, 799200, 38016, 0x84811693 +0, 802800, 38016, 0x242b1811 +0, 806400, 38016, 0xb4af2667 +0, 810000, 38016, 0x77a20da2 +0, 813600, 38016, 0x8e4f36a8 +0, 817200, 38016, 0xe72435cb +0, 820800, 38016, 0xf38a381b +0, 824400, 38016, 0xb2b876d6 +0, 828000, 38016, 0x1c359b35 +0, 831600, 38016, 0x4fb8b180 +0, 835200, 38016, 0x90fdf94b +0, 838800, 38016, 0xb8680c40 +0, 842400, 38016, 0x99331edd +0, 846000, 38016, 0xd8e3433d +0, 849600, 38016, 0x6d4d5aa2 +0, 853200, 38016, 0x4c3545c4 +0, 856800, 38016, 0x25b8376f +0, 860400, 38016, 0xc4fe09df +0, 864000, 38016, 0x6a9fe4f8 +0, 867600, 38016, 0x8fd2c2f3 +0, 871200, 38016, 0x78199f41 +0, 874800, 38016, 0x27b6e9f0 +0, 878400, 38016, 0xd8316400 +0, 882000, 38016, 0x0a70cd14 +0, 885600, 38016, 0x2075e91c +0, 889200, 38016, 0xcd3cd7cb +0, 892800, 38016, 0x4edc8cf5 +0, 896400, 38016, 0xf02e0bc7 +0, 900000, 38016, 0xcdd1b487 +0, 903600, 38016, 0xea5f6c8f +0, 907200, 38016, 0x6b635e22 +0, 910800, 38016, 0xd548c435 +0, 914400, 38016, 0x455826ee +0, 918000, 38016, 0x120ac7ed +0, 921600, 38016, 0xf86adc5a +0, 925200, 38016, 0x8dbd5c4e +0, 928800, 38016, 0xe4c62dae +0, 932400, 38016, 0x0a2a3be7 +0, 936000, 38016, 0xf8a243d7 +0, 939600, 38016, 0x898a3afb +0, 943200, 38016, 0x39e661bb +0, 946800, 38016, 0xe4e65f22 +0, 950400, 38016, 0x014846ff +0, 954000, 38016, 0xf392509c +0, 957600, 38016, 0x34623207 +0, 961200, 38016, 0xac4a09ed +0, 964800, 38016, 0x9d18eb07 +0, 968400, 38016, 0x4594c90e +0, 972000, 38016, 0x624f9b6b +0, 975600, 38016, 0x8adc89d3 +0, 979200, 38016, 0xf4dd64f6 +0, 982800, 38016, 0x4c121386 +0, 986400, 38016, 0xfb5ddc7e +0, 990000, 38016, 0x837fc31e +0, 993600, 38016, 0xa4f4bd31 +0, 997200, 38016, 0x0445def7 +0, 1000800, 38016, 0xbac0fe62 +0, 1004400, 38016, 0x050b5778 +0, 1008000, 38016, 0x3d0723e5 +0, 1011600, 38016, 0x9967eae7 +0, 1015200, 38016, 0xf4be9ec7 +0, 1018800, 38016, 0x870377d2 +0, 1022400, 38016, 0x5c9d648a +0, 1026000, 38016, 0x2d41a44b +0, 1029600, 38016, 0xa50e7c6f +0, 1033200, 38016, 0x2bd1b477 +0, 1036800, 38016, 0xd123ae8d +0, 1040400, 38016, 0xf2fc7a6b +0, 1044000, 38016, 0xaa3ee416 +0, 1047600, 38016, 0x5f8801d6 +0, 1051200, 38016, 0xbee7924a +0, 1054800, 38016, 0x6e47c3e1 +0, 1058400, 38016, 0xf34f1223 +0, 1062000, 38016, 0x7a610876 +0, 1065600, 38016, 0x15e9e47f +0, 1069200, 38016, 0x557ddcf1 +0, 1072800, 38016, 0xf0cd02e2 +0, 1076400, 38016, 0xe98f1deb diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caqp1_sony_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caqp1_sony_b new file mode 100644 index 00000000..fe023eb4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-caqp1_sony_b @@ -0,0 +1,50 @@ +0, 0, 38016, 0x25f92b0e +0, 3600, 38016, 0x2ecbe752 +0, 7200, 38016, 0x3432e744 +0, 10800, 38016, 0x7970aa2e +0, 14400, 38016, 0x250787bf +0, 18000, 38016, 0xd58e5e56 +0, 21600, 38016, 0xf4b8580f +0, 25200, 38016, 0x9acb4096 +0, 28800, 38016, 0xeed0476f +0, 32400, 38016, 0xe33846ef +0, 36000, 38016, 0x02da4e76 +0, 39600, 38016, 0xd3e572f8 +0, 43200, 38016, 0x5fd27f8a +0, 46800, 38016, 0xfa169823 +0, 50400, 38016, 0xcc6b8d76 +0, 54000, 38016, 0xcc4da11f +0, 57600, 38016, 0x32259b9d +0, 61200, 38016, 0xf1e39b70 +0, 64800, 38016, 0xb49d7480 +0, 68400, 38016, 0x3dc158e9 +0, 72000, 38016, 0x4ce134db +0, 75600, 38016, 0x4fb30b43 +0, 79200, 38016, 0xda49fe5f +0, 82800, 38016, 0x7fda0d68 +0, 86400, 38016, 0x3a8b25e3 +0, 90000, 38016, 0x3df11d4e +0, 93600, 38016, 0x26e11107 +0, 97200, 38016, 0xdc3b03a7 +0, 100800, 38016, 0x72b2434d +0, 104400, 38016, 0x2a013e27 +0, 108000, 38016, 0xf95a4c2e +0, 111600, 38016, 0x1e7b6656 +0, 115200, 38016, 0x776a81c8 +0, 118800, 38016, 0x162cb0bf +0, 122400, 38016, 0x7ff4aaf5 +0, 126000, 38016, 0x7150b50b +0, 129600, 38016, 0xf7d0b889 +0, 133200, 38016, 0xbe09b5c2 +0, 136800, 38016, 0xf6f7d29c +0, 140400, 38016, 0x4356b996 +0, 144000, 38016, 0xb056c4b4 +0, 147600, 38016, 0x38e9c6e6 +0, 151200, 38016, 0x9c64ab45 +0, 154800, 38016, 0x31189eef +0, 158400, 38016, 0x1ee3a3b1 +0, 162000, 38016, 0x8bed7c95 +0, 165600, 38016, 0x30357cee +0, 169200, 38016, 0x5d828428 +0, 172800, 38016, 0xc06388b3 +0, 176400, 38016, 0x2af597b4 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cavlc_mot_fld0_full_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cavlc_mot_fld0_full_b new file mode 100644 index 00000000..6a77690f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cavlc_mot_fld0_full_b @@ -0,0 +1,30 @@ +0, 0, 518400, 0x99d0df36 +0, 3600, 518400, 0xa8601c1a +0, 7200, 518400, 0x4a17d235 +0, 10800, 518400, 0x75f23abf +0, 14400, 518400, 0x746aad53 +0, 18000, 518400, 0xb0b8913e +0, 21600, 518400, 0x60a27f57 +0, 25200, 518400, 0xfa227f3e +0, 28800, 518400, 0x7a1e57c2 +0, 32400, 518400, 0xcbbaa84f +0, 36000, 518400, 0xf9c1bd13 +0, 39600, 518400, 0x9e80caaf +0, 43200, 518400, 0x14cc6928 +0, 46800, 518400, 0xca0353ef +0, 50400, 518400, 0xcad65e5f +0, 54000, 518400, 0xd5bc47b3 +0, 57600, 518400, 0xa9893d36 +0, 61200, 518400, 0x69bd9085 +0, 64800, 518400, 0xff33c476 +0, 68400, 518400, 0x9538adf7 +0, 72000, 518400, 0xd4ff3b62 +0, 75600, 518400, 0x021a11fd +0, 79200, 518400, 0x293e6f9f +0, 82800, 518400, 0x5d38e4c3 +0, 86400, 518400, 0xd1f4ad49 +0, 90000, 518400, 0xf13dd946 +0, 93600, 518400, 0x0359e9ff +0, 97200, 518400, 0xb61098ad +0, 100800, 518400, 0xa855b11c +0, 104400, 518400, 0x7fcf9343 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cavlc_mot_frm0_full_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cavlc_mot_frm0_full_b new file mode 100644 index 00000000..5d29a405 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cavlc_mot_frm0_full_b @@ -0,0 +1,30 @@ +0, 0, 518400, 0x21baedbf +0, 3600, 518400, 0x6003273c +0, 7200, 518400, 0x935d45d7 +0, 10800, 518400, 0x00485000 +0, 14400, 518400, 0x31b191ff +0, 18000, 518400, 0xe334135a +0, 21600, 518400, 0xc4d7bf2c +0, 25200, 518400, 0x7106ac82 +0, 28800, 518400, 0xeb277b07 +0, 32400, 518400, 0xaf1ee80f +0, 36000, 518400, 0x8c7d1bad +0, 39600, 518400, 0x0e24ae6c +0, 43200, 518400, 0x89c216b4 +0, 46800, 518400, 0x991fbcb1 +0, 50400, 518400, 0x87411486 +0, 54000, 518400, 0x0151b48f +0, 57600, 518400, 0x3f4d5a91 +0, 61200, 518400, 0x48ea911b +0, 64800, 518400, 0x6bec19a0 +0, 68400, 518400, 0x10233bf6 +0, 72000, 518400, 0x2a36ae4d +0, 75600, 518400, 0xd8d3224b +0, 79200, 518400, 0xf5c5f81f +0, 82800, 518400, 0x30054561 +0, 86400, 518400, 0x67ea1c9f +0, 90000, 518400, 0xbbda3984 +0, 93600, 518400, 0x9af40c71 +0, 97200, 518400, 0xb0cf0d12 +0, 100800, 518400, 0x569b9866 +0, 104400, 518400, 0xffd72ee5 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cavlc_mot_mbaff0_full_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cavlc_mot_mbaff0_full_b new file mode 100644 index 00000000..2b6d0d3c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cavlc_mot_mbaff0_full_b @@ -0,0 +1,30 @@ +0, 0, 518400, 0x4cecc821 +0, 3600, 518400, 0xee49ea81 +0, 7200, 518400, 0x78b0d65f +0, 10800, 518400, 0x7fa72010 +0, 14400, 518400, 0xbc7fecdb +0, 18000, 518400, 0xe54cf951 +0, 21600, 518400, 0x1e2795e0 +0, 25200, 518400, 0x7db968b9 +0, 28800, 518400, 0xcecb446b +0, 32400, 518400, 0x4f813fc5 +0, 36000, 518400, 0xd0816131 +0, 39600, 518400, 0x6cf66cb7 +0, 43200, 518400, 0xac9913a1 +0, 46800, 518400, 0x0a2dd6ae +0, 50400, 518400, 0x5de1acef +0, 54000, 518400, 0x5ac7741e +0, 57600, 518400, 0x4d2726de +0, 61200, 518400, 0x6b9b2677 +0, 64800, 518400, 0x99b70e82 +0, 68400, 518400, 0x6a01ed56 +0, 72000, 518400, 0xa6976f95 +0, 75600, 518400, 0x645f6562 +0, 79200, 518400, 0xf750796b +0, 82800, 518400, 0xe381ee9c +0, 86400, 518400, 0xb7d45f84 +0, 90000, 518400, 0x7c9d79df +0, 93600, 518400, 0x8a306a11 +0, 97200, 518400, 0x766fcf15 +0, 100800, 518400, 0x45c3cbdd +0, 104400, 518400, 0x6a22610e diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cavlc_mot_picaff0_full_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cavlc_mot_picaff0_full_b new file mode 100644 index 00000000..741b94ca --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cavlc_mot_picaff0_full_b @@ -0,0 +1,30 @@ +0, 0, 518400, 0xf6b83a0e +0, 3600, 518400, 0xc5e8b8ee +0, 7200, 518400, 0xb3bc6e43 +0, 10800, 518400, 0x5b08dc73 +0, 14400, 518400, 0x4a7f7690 +0, 18000, 518400, 0x8a9f4275 +0, 21600, 518400, 0xc7cb92fd +0, 25200, 518400, 0xc721e231 +0, 28800, 518400, 0xfb31371b +0, 32400, 518400, 0xac57f5d9 +0, 36000, 518400, 0x92b7debc +0, 39600, 518400, 0xfe3e533e +0, 43200, 518400, 0x1b3a7a72 +0, 46800, 518400, 0x98df2d81 +0, 50400, 518400, 0xe0ce9c52 +0, 54000, 518400, 0x6a31166d +0, 57600, 518400, 0x64ffd4d2 +0, 61200, 518400, 0x3ec062ef +0, 64800, 518400, 0x3480fae1 +0, 68400, 518400, 0xa87ae4b7 +0, 72000, 518400, 0xd301319f +0, 75600, 518400, 0xa9284989 +0, 79200, 518400, 0x3de73b50 +0, 82800, 518400, 0x30a79f84 +0, 86400, 518400, 0x7d5152d4 +0, 90000, 518400, 0x25514095 +0, 93600, 518400, 0x1749a05f +0, 97200, 518400, 0x598139a7 +0, 100800, 518400, 0x3cece862 +0, 104400, 518400, 0xe1c27efe diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cawp1_toshiba_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cawp1_toshiba_e new file mode 100644 index 00000000..36223a35 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cawp1_toshiba_e @@ -0,0 +1,90 @@ +0, 0, 152064, 0xabf9ae05 +0, 3600, 152064, 0x20418b16 +0, 7200, 152064, 0xc26760ae +0, 10800, 152064, 0x7ed0c861 +0, 14400, 152064, 0x1a13d207 +0, 18000, 152064, 0x700bdb09 +0, 21600, 152064, 0x7fa6476e +0, 25200, 152064, 0x951158c6 +0, 28800, 152064, 0x263a2dfc +0, 32400, 152064, 0xa25c5371 +0, 36000, 152064, 0xd67bd5c5 +0, 39600, 152064, 0x73e6d7c0 +0, 43200, 152064, 0x509967e4 +0, 46800, 152064, 0x27574b8f +0, 50400, 152064, 0xa701d36f +0, 54000, 152064, 0x3d457728 +0, 57600, 152064, 0xe9977098 +0, 61200, 152064, 0x33b3542b +0, 64800, 152064, 0x5635d3fa +0, 68400, 152064, 0x51dbc0bd +0, 72000, 152064, 0xa2287df1 +0, 75600, 152064, 0x24533377 +0, 79200, 152064, 0xfd05e083 +0, 82800, 152064, 0xfadce02d +0, 86400, 152064, 0xf67cc1da +0, 90000, 152064, 0x4e7bc654 +0, 93600, 152064, 0x5b686f11 +0, 97200, 152064, 0xb8e33dc8 +0, 100800, 152064, 0x0ff224ca +0, 104400, 152064, 0xcd98c152 +0, 108000, 152064, 0x4fdfb595 +0, 111600, 152064, 0xb1b7f4fc +0, 115200, 152064, 0x666ccd6a +0, 118800, 152064, 0x80e9c1a3 +0, 122400, 152064, 0x304b9be3 +0, 126000, 152064, 0x9741fb13 +0, 129600, 152064, 0x5e016501 +0, 133200, 152064, 0x50dd4139 +0, 136800, 152064, 0x9a4ef972 +0, 140400, 152064, 0x03b7da4e +0, 144000, 152064, 0x17fd7d8a +0, 147600, 152064, 0xc0137bb0 +0, 151200, 152064, 0xaf167d40 +0, 154800, 152064, 0xde191051 +0, 158400, 152064, 0x1cdcee05 +0, 162000, 152064, 0xa8d1b139 +0, 165600, 152064, 0xade6bf62 +0, 169200, 152064, 0x4515a552 +0, 172800, 152064, 0xb05036fe +0, 176400, 152064, 0xfa500b17 +0, 180000, 152064, 0x512dec06 +0, 183600, 152064, 0x0e77ff69 +0, 187200, 152064, 0x06f7b2cd +0, 190800, 152064, 0x9bc99b67 +0, 194400, 152064, 0x6b68301b +0, 198000, 152064, 0xe31321ba +0, 201600, 152064, 0x9ad0192e +0, 205200, 152064, 0xcc14d7c8 +0, 208800, 152064, 0xf6ab91ec +0, 212400, 152064, 0xf76afbce +0, 216000, 152064, 0xb7d7f1dc +0, 219600, 152064, 0xca95e688 +0, 223200, 152064, 0xc36bb8ac +0, 226800, 152064, 0xc1c06a2e +0, 230400, 152064, 0xf2a08f2a +0, 234000, 152064, 0xb81013d2 +0, 237600, 152064, 0xf30cee41 +0, 241200, 152064, 0xad85c0d6 +0, 244800, 152064, 0x087b7807 +0, 248400, 152064, 0x178c39f0 +0, 252000, 152064, 0x6e0e3e66 +0, 255600, 152064, 0x9a020bcf +0, 259200, 152064, 0xc33d4749 +0, 262800, 152064, 0x6370dbad +0, 266400, 152064, 0x928cbe47 +0, 270000, 152064, 0xb8b036cc +0, 273600, 152064, 0x79d92c37 +0, 277200, 152064, 0xc4cf0d8f +0, 280800, 152064, 0xfe706c76 +0, 284400, 152064, 0x6a37de81 +0, 288000, 152064, 0x659eb2c1 +0, 291600, 152064, 0x0630855f +0, 295200, 152064, 0xfa964f67 +0, 298800, 152064, 0xc5a1ff95 +0, 302400, 152064, 0xa131b89f +0, 306000, 152064, 0x73007c16 +0, 309600, 152064, 0x4d237a3b +0, 313200, 152064, 0xe68f44be +0, 316800, 152064, 0x065f0be3 +0, 320400, 152064, 0x39cab454 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cawp5_toshiba_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cawp5_toshiba_e new file mode 100644 index 00000000..30f69125 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cawp5_toshiba_e @@ -0,0 +1,90 @@ +0, 0, 152064, 0xabf9ae05 +0, 3600, 152064, 0x20418b16 +0, 7200, 152064, 0x20f72775 +0, 10800, 152064, 0x57c07111 +0, 14400, 152064, 0x1b49267f +0, 18000, 152064, 0x024cd238 +0, 21600, 152064, 0x044d1ae0 +0, 25200, 152064, 0xbfec1b59 +0, 28800, 152064, 0x1a91f935 +0, 32400, 152064, 0x9ee184dc +0, 36000, 152064, 0x65047dbe +0, 39600, 152064, 0xd1632fb5 +0, 43200, 152064, 0x56f64c3e +0, 46800, 152064, 0xe6122f37 +0, 50400, 152064, 0x0575e670 +0, 54000, 152064, 0x3d457728 +0, 57600, 152064, 0x6b508105 +0, 61200, 152064, 0xcaaf5ea7 +0, 64800, 152064, 0x9f4e4501 +0, 68400, 152064, 0x1c661a73 +0, 72000, 152064, 0x2fd9d1c8 +0, 75600, 152064, 0x4ac99ab1 +0, 79200, 152064, 0xf2d36809 +0, 82800, 152064, 0xa8e32ffb +0, 86400, 152064, 0xd4da2fd2 +0, 90000, 152064, 0xac3adde0 +0, 93600, 152064, 0xf014ed0f +0, 97200, 152064, 0xca2e7d28 +0, 100800, 152064, 0x3a875e51 +0, 104400, 152064, 0xc03e4bda +0, 108000, 152064, 0x4fdfb595 +0, 111600, 152064, 0x9243f098 +0, 115200, 152064, 0x9361bae6 +0, 118800, 152064, 0x7a1dadee +0, 122400, 152064, 0x72a59e15 +0, 126000, 152064, 0xb5b47170 +0, 129600, 152064, 0x5eb16651 +0, 133200, 152064, 0xe7894af7 +0, 136800, 152064, 0x2683bb0b +0, 140400, 152064, 0x90b4c8c5 +0, 144000, 152064, 0xf800c5b5 +0, 147600, 152064, 0xc2f5a895 +0, 151200, 152064, 0x213c65d4 +0, 154800, 152064, 0x01c65a19 +0, 158400, 152064, 0xd9f1b04b +0, 162000, 152064, 0xa8d1b139 +0, 165600, 152064, 0x2d0cb0cd +0, 169200, 152064, 0x5b0783fe +0, 172800, 152064, 0x29e628ec +0, 176400, 152064, 0x1b8527e5 +0, 180000, 152064, 0x4b46d179 +0, 183600, 152064, 0x6184c708 +0, 187200, 152064, 0x697bb8e2 +0, 190800, 152064, 0x5fd3a772 +0, 194400, 152064, 0x91456c86 +0, 198000, 152064, 0x376c4dae +0, 201600, 152064, 0x00ba2b3f +0, 205200, 152064, 0xf6f0f553 +0, 208800, 152064, 0xc0020855 +0, 212400, 152064, 0xec3d13d2 +0, 216000, 152064, 0xb7d7f1dc +0, 219600, 152064, 0xf9dae37b +0, 223200, 152064, 0x50d9cc93 +0, 226800, 152064, 0xba1eb592 +0, 230400, 152064, 0x67616557 +0, 234000, 152064, 0x09804760 +0, 237600, 152064, 0xc2ffba00 +0, 241200, 152064, 0xb71fcf46 +0, 244800, 152064, 0x6cd975af +0, 248400, 152064, 0x19189167 +0, 252000, 152064, 0xbca8fe71 +0, 255600, 152064, 0xb0b3f607 +0, 259200, 152064, 0x7614d73a +0, 262800, 152064, 0x7de9d87d +0, 266400, 152064, 0x81f58cf2 +0, 270000, 152064, 0xb8b036cc +0, 273600, 152064, 0x26d1e2e4 +0, 277200, 152064, 0xb41a1e6c +0, 280800, 152064, 0x4f9be4a9 +0, 284400, 152064, 0xe95ad5d3 +0, 288000, 152064, 0xdffc9335 +0, 291600, 152064, 0x01d658c0 +0, 295200, 152064, 0x631b4b75 +0, 298800, 152064, 0x80ae282f +0, 302400, 152064, 0xb34bf688 +0, 306000, 152064, 0xd0cc7d65 +0, 309600, 152064, 0x86aa4590 +0, 313200, 152064, 0xcb515a57 +0, 316800, 152064, 0x68650834 +0, 320400, 152064, 0x444ee2a4 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ci1_ft_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ci1_ft_b new file mode 100644 index 00000000..b2dca703 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ci1_ft_b @@ -0,0 +1,291 @@ +0, 0, 152064, 0xb291a678 +0, 3600, 152064, 0x913c5a5d +0, 7200, 152064, 0x9558a372 +0, 10800, 152064, 0x5e521e9b +0, 14400, 152064, 0xbc2c7bd7 +0, 18000, 152064, 0x8867cc80 +0, 21600, 152064, 0xae394b0b +0, 25200, 152064, 0x15d9c120 +0, 28800, 152064, 0xffe01d0f +0, 32400, 152064, 0xf90a1d50 +0, 36000, 152064, 0x7b9b6a02 +0, 39600, 152064, 0x687f5afa +0, 43200, 152064, 0x6bf7b8a2 +0, 46800, 152064, 0x45cb58e9 +0, 50400, 152064, 0xc4246ef0 +0, 54000, 152064, 0xa19dbe0a +0, 57600, 152064, 0xe297eaa9 +0, 61200, 152064, 0x8f4300bc +0, 64800, 152064, 0x9a541a18 +0, 68400, 152064, 0xf3b51480 +0, 72000, 152064, 0x5a191303 +0, 75600, 152064, 0x2e887f27 +0, 79200, 152064, 0xf050d46d +0, 82800, 152064, 0xc31c6716 +0, 86400, 152064, 0x37761725 +0, 90000, 152064, 0x81141cf6 +0, 93600, 152064, 0x181f7e61 +0, 97200, 152064, 0x9fc2b668 +0, 100800, 152064, 0x3716f5da +0, 104400, 152064, 0x3b28f0c9 +0, 108000, 152064, 0xe33bd972 +0, 111600, 152064, 0x948ccdaa +0, 115200, 152064, 0x21fdc6c2 +0, 118800, 152064, 0x3874b6fc +0, 122400, 152064, 0x07b7a748 +0, 126000, 152064, 0x7aee8b8d +0, 129600, 152064, 0x013d7552 +0, 133200, 152064, 0x9631487e +0, 136800, 152064, 0xd9a109d6 +0, 140400, 152064, 0x7b450b1b +0, 144000, 152064, 0x25f0cb06 +0, 147600, 152064, 0x6542aa9c +0, 151200, 152064, 0x40ba9bd7 +0, 154800, 152064, 0x2dc7d564 +0, 158400, 152064, 0x4534a83f +0, 162000, 152064, 0x671551a3 +0, 165600, 152064, 0xc69a9a28 +0, 169200, 152064, 0x899be59a +0, 172800, 152064, 0x1adb6455 +0, 176400, 152064, 0x5d34066b +0, 180000, 152064, 0x17f4dcec +0, 183600, 152064, 0xcc9fd4b1 +0, 187200, 152064, 0x329aaeb5 +0, 190800, 152064, 0x4532a3f0 +0, 194400, 152064, 0xb0440be3 +0, 198000, 152064, 0x9055a9e2 +0, 201600, 152064, 0x1f5b4730 +0, 205200, 152064, 0x55fc2ba8 +0, 208800, 152064, 0x6adc911a +0, 212400, 152064, 0x4968851f +0, 216000, 152064, 0x31a86628 +0, 219600, 152064, 0x7223240a +0, 223200, 152064, 0xb982e88e +0, 226800, 152064, 0xba45b5ea +0, 230400, 152064, 0x72f55121 +0, 234000, 152064, 0x36c59af9 +0, 237600, 152064, 0x6fc51449 +0, 241200, 152064, 0xbd9d99b7 +0, 244800, 152064, 0x0bd3a6e7 +0, 248400, 152064, 0x5a5d0203 +0, 252000, 152064, 0x44a26951 +0, 255600, 152064, 0xfe9fcff5 +0, 259200, 152064, 0xce25a939 +0, 262800, 152064, 0xdf7c1b79 +0, 266400, 152064, 0xe82a1c4c +0, 270000, 152064, 0x946b20d7 +0, 273600, 152064, 0x5d4887d2 +0, 277200, 152064, 0xadfe1034 +0, 280800, 152064, 0x6d20b119 +0, 284400, 152064, 0x8e414e12 +0, 288000, 152064, 0x06effdf9 +0, 291600, 152064, 0x3073e4f5 +0, 295200, 152064, 0xa0ef2291 +0, 298800, 152064, 0x3feb2cf6 +0, 302400, 152064, 0x3e77b0c8 +0, 306000, 152064, 0xdbce3b7a +0, 309600, 152064, 0x15e0b088 +0, 313200, 152064, 0xb05bb465 +0, 316800, 152064, 0x63423915 +0, 320400, 152064, 0x290210f4 +0, 324000, 152064, 0x4d14cc43 +0, 327600, 152064, 0x4a5509fe +0, 331200, 152064, 0x110c6420 +0, 334800, 152064, 0xbe614dfb +0, 338400, 152064, 0xa6311469 +0, 342000, 152064, 0x198b6b73 +0, 345600, 152064, 0xe96fe872 +0, 349200, 152064, 0x7a7a6937 +0, 352800, 152064, 0xfe2b868d +0, 356400, 152064, 0x9e0bbb2b +0, 360000, 152064, 0x53dbdf39 +0, 363600, 152064, 0xee90ba8e +0, 367200, 152064, 0x38bcb94d +0, 370800, 152064, 0x16a6d9bb +0, 374400, 152064, 0x450ae454 +0, 378000, 152064, 0x7d98fcf4 +0, 381600, 152064, 0xc54ed4cf +0, 385200, 152064, 0x560d74ac +0, 388800, 152064, 0xb203fc98 +0, 392400, 152064, 0xb085b576 +0, 396000, 152064, 0x05e16f79 +0, 399600, 152064, 0x90cd4c73 +0, 403200, 152064, 0x4dd42a7f +0, 406800, 152064, 0x26b9e35c +0, 410400, 152064, 0x70cbb417 +0, 414000, 152064, 0x0a1bc4a9 +0, 417600, 152064, 0xe08fdbc9 +0, 421200, 152064, 0x8768cd49 +0, 424800, 152064, 0x80a4b575 +0, 428400, 152064, 0x68478ea6 +0, 432000, 152064, 0x8f8c589d +0, 435600, 152064, 0x8ee4345c +0, 439200, 152064, 0x93911901 +0, 442800, 152064, 0x38fb4298 +0, 446400, 152064, 0x8bee60e7 +0, 450000, 152064, 0x3f906dbd +0, 453600, 152064, 0x9de2a984 +0, 457200, 152064, 0x64c804e0 +0, 460800, 152064, 0x4757c864 +0, 464400, 152064, 0xe6f43905 +0, 468000, 152064, 0x8ad2e577 +0, 471600, 152064, 0x1b06977e +0, 475200, 152064, 0xe92a2dfa +0, 478800, 152064, 0x97b993fa +0, 482400, 152064, 0x1602de2d +0, 486000, 152064, 0x6dda24f1 +0, 489600, 152064, 0x5552ec9d +0, 493200, 152064, 0xcce058e8 +0, 496800, 152064, 0x4359bccd +0, 500400, 152064, 0xe41d77d0 +0, 504000, 152064, 0x05730d21 +0, 507600, 152064, 0xa963bf92 +0, 511200, 152064, 0x3f4d8e29 +0, 514800, 152064, 0x385d2403 +0, 518400, 152064, 0xd8e279d6 +0, 522000, 152064, 0xcfcb3713 +0, 525600, 152064, 0xd68d57d4 +0, 529200, 152064, 0xdaecd2d6 +0, 532800, 152064, 0x7c1805cf +0, 536400, 152064, 0x19969137 +0, 540000, 152064, 0x15007e0c +0, 543600, 152064, 0xf4f5011a +0, 547200, 152064, 0x792793e3 +0, 550800, 152064, 0x1c4126f9 +0, 554400, 152064, 0xfaeb9465 +0, 558000, 152064, 0x3366c5c6 +0, 561600, 152064, 0x8efa29ed +0, 565200, 152064, 0x2b36d937 +0, 568800, 152064, 0x4cfc993f +0, 572400, 152064, 0x0809f8f8 +0, 576000, 152064, 0x5be26710 +0, 579600, 152064, 0x6d757860 +0, 583200, 152064, 0xf4e8706d +0, 586800, 152064, 0xec42387d +0, 590400, 152064, 0x828f02e1 +0, 594000, 152064, 0x45a0954c +0, 597600, 152064, 0xbcca1065 +0, 601200, 152064, 0xd5946707 +0, 604800, 152064, 0x6887cbcb +0, 608400, 152064, 0x63fc7423 +0, 612000, 152064, 0x3339ebc2 +0, 615600, 152064, 0x6419e277 +0, 619200, 152064, 0xe9cd70aa +0, 622800, 152064, 0x23903b35 +0, 626400, 152064, 0xd83d028a +0, 630000, 152064, 0x79e21536 +0, 633600, 152064, 0x81cc6027 +0, 637200, 152064, 0x56334e89 +0, 640800, 152064, 0xe32e532e +0, 644400, 152064, 0x528832b4 +0, 648000, 152064, 0x348da007 +0, 651600, 152064, 0x5104b2e8 +0, 655200, 152064, 0x7b0d1f8f +0, 658800, 152064, 0x6750c77c +0, 662400, 152064, 0x3a8f2faa +0, 666000, 152064, 0x8a24a116 +0, 669600, 152064, 0x82d00d82 +0, 673200, 152064, 0xc6f5b11a +0, 676800, 152064, 0x2b352039 +0, 680400, 152064, 0x7c067e22 +0, 684000, 152064, 0xc975d80d +0, 687600, 152064, 0xa49978ed +0, 691200, 152064, 0x441f703e +0, 694800, 152064, 0x5cb150c5 +0, 698400, 152064, 0xeeda6c8e +0, 702000, 152064, 0xe9e0ce47 +0, 705600, 152064, 0xba55acbd +0, 709200, 152064, 0xae8250e5 +0, 712800, 152064, 0xf438f2e8 +0, 716400, 152064, 0xe6263d10 +0, 720000, 152064, 0x8d13277a +0, 723600, 152064, 0x4bfb4aab +0, 727200, 152064, 0x1c0a78ea +0, 730800, 152064, 0xa0651778 +0, 734400, 152064, 0xa309ca66 +0, 738000, 152064, 0x294c750b +0, 741600, 152064, 0xd55d6881 +0, 745200, 152064, 0x8d002b72 +0, 748800, 152064, 0xe0ae5976 +0, 752400, 152064, 0xc6f28961 +0, 756000, 152064, 0x6fb5899d +0, 759600, 152064, 0x046f3445 +0, 763200, 152064, 0x9b2d5779 +0, 766800, 152064, 0xeb9db946 +0, 770400, 152064, 0x190bdc3b +0, 774000, 152064, 0xb9ae5c7b +0, 777600, 152064, 0xca07ad32 +0, 781200, 152064, 0x8d1fee22 +0, 784800, 152064, 0x446470dd +0, 788400, 152064, 0x8802cf93 +0, 792000, 152064, 0x8bbaeb30 +0, 795600, 152064, 0xfe4e7fdf +0, 799200, 152064, 0xc6379dc7 +0, 802800, 152064, 0xaa53198b +0, 806400, 152064, 0x88d6d37c +0, 810000, 152064, 0xd1b89370 +0, 813600, 152064, 0xdab349f4 +0, 817200, 152064, 0x4702c238 +0, 820800, 152064, 0xfaa893bb +0, 824400, 152064, 0x515b940e +0, 828000, 152064, 0x4d86d838 +0, 831600, 152064, 0xe3815641 +0, 835200, 152064, 0x0e501c17 +0, 838800, 152064, 0x449df073 +0, 842400, 152064, 0xc06daa27 +0, 846000, 152064, 0x72f5394c +0, 849600, 152064, 0x18be9f70 +0, 853200, 152064, 0xc508213a +0, 856800, 152064, 0xa616a322 +0, 860400, 152064, 0x1a5d09e5 +0, 864000, 152064, 0xf6e78051 +0, 867600, 152064, 0x8945ad83 +0, 871200, 152064, 0xa06fd95d +0, 874800, 152064, 0x7d86f015 +0, 878400, 152064, 0x768af87c +0, 882000, 152064, 0xffa2e8d9 +0, 885600, 152064, 0x2ac0d2df +0, 889200, 152064, 0x40c27662 +0, 892800, 152064, 0xfcc7580a +0, 896400, 152064, 0xcdbd51f0 +0, 900000, 152064, 0xe0d754ec +0, 903600, 152064, 0xbfb59395 +0, 907200, 152064, 0x26f6db71 +0, 910800, 152064, 0x1d85f144 +0, 914400, 152064, 0xfacbfbd9 +0, 918000, 152064, 0x55bdf6b8 +0, 921600, 152064, 0x9c89e3f8 +0, 925200, 152064, 0x6e90c4bd +0, 928800, 152064, 0x3b19a944 +0, 932400, 152064, 0xcb527670 +0, 936000, 152064, 0xc0ec5c7b +0, 939600, 152064, 0x7f5f4814 +0, 943200, 152064, 0xb0983900 +0, 946800, 152064, 0xc57534a6 +0, 950400, 152064, 0xd37b30b9 +0, 954000, 152064, 0x61fe2e9f +0, 957600, 152064, 0x613d2e8a +0, 961200, 152064, 0x9bc5224b +0, 964800, 152064, 0x246122c2 +0, 968400, 152064, 0x28811a8f +0, 972000, 152064, 0x609cfcbf +0, 975600, 152064, 0x9c5aee70 +0, 979200, 152064, 0x06d7e997 +0, 982800, 152064, 0xcb3e1e4a +0, 986400, 152064, 0x65e36256 +0, 990000, 152064, 0x571eb628 +0, 993600, 152064, 0x9e940be8 +0, 997200, 152064, 0x425a374b +0, 1000800, 152064, 0xbeed72a2 +0, 1004400, 152064, 0x295bb61d +0, 1008000, 152064, 0xfe2df639 +0, 1011600, 152064, 0xbd4f441a +0, 1015200, 152064, 0x61ce59bc +0, 1018800, 152064, 0xd5eb825f +0, 1022400, 152064, 0xc03cb656 +0, 1026000, 152064, 0xfc10c1f6 +0, 1029600, 152064, 0xb93908dc +0, 1033200, 152064, 0xbc2d3209 +0, 1036800, 152064, 0xcc267ab3 +0, 1040400, 152064, 0x32629fa0 +0, 1044000, 152064, 0x5d5bb942 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ci_mw_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ci_mw_d new file mode 100644 index 00000000..193c5c80 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ci_mw_d @@ -0,0 +1,100 @@ +0, 0, 38016, 0x3ae838ee +0, 3600, 38016, 0x8523e136 +0, 7200, 38016, 0xcffc99dd +0, 10800, 38016, 0xd42c63b0 +0, 14400, 38016, 0x6ba94f84 +0, 18000, 38016, 0xa5c56dd3 +0, 21600, 38016, 0x6f6a929e +0, 25200, 38016, 0x84f89b27 +0, 28800, 38016, 0x35bd9f0f +0, 32400, 38016, 0x69058ed2 +0, 36000, 38016, 0x44c05088 +0, 39600, 38016, 0xed9725f0 +0, 43200, 38016, 0x37b92a40 +0, 46800, 38016, 0xbeed3c7c +0, 50400, 38016, 0x833a5669 +0, 54000, 38016, 0xf37b78b1 +0, 57600, 38016, 0x84e2aff4 +0, 61200, 38016, 0x8c69c59c +0, 64800, 38016, 0x40fdbe25 +0, 68400, 38016, 0x1c7cba40 +0, 72000, 38016, 0x052abe29 +0, 75600, 38016, 0x398ec317 +0, 79200, 38016, 0xa157bb47 +0, 82800, 38016, 0x6acfc1a0 +0, 86400, 38016, 0xfa77bdba +0, 90000, 38016, 0x2254bb0d +0, 93600, 38016, 0xefdfbdb3 +0, 97200, 38016, 0x80eec1f4 +0, 100800, 38016, 0x48b6c903 +0, 104400, 38016, 0x277dd23b +0, 108000, 38016, 0x4c6aa7c5 +0, 111600, 38016, 0x223f6bb7 +0, 115200, 38016, 0xdbee4420 +0, 118800, 38016, 0x5f888bdc +0, 122400, 38016, 0xe5aef9b8 +0, 126000, 38016, 0x6a68596e +0, 129600, 38016, 0x47feb0d4 +0, 133200, 38016, 0x46d13363 +0, 136800, 38016, 0x31758ae0 +0, 140400, 38016, 0xa9b3c513 +0, 144000, 38016, 0x041ce805 +0, 147600, 38016, 0xd3aef1e9 +0, 151200, 38016, 0x8c51ecf8 +0, 154800, 38016, 0x60a5f20d +0, 158400, 38016, 0xf3c80bfb +0, 162000, 38016, 0xcec4f6af +0, 165600, 38016, 0x70a1c28c +0, 169200, 38016, 0x1c579938 +0, 172800, 38016, 0x07a8a63d +0, 176400, 38016, 0xd16ccd4e +0, 180000, 38016, 0xceb5e478 +0, 183600, 38016, 0x81c0bf00 +0, 187200, 38016, 0x4867d846 +0, 190800, 38016, 0xd8650fd3 +0, 194400, 38016, 0x1d8f375c +0, 198000, 38016, 0x5ce65ef5 +0, 201600, 38016, 0xbc766bf0 +0, 205200, 38016, 0x73cd27ee +0, 208800, 38016, 0xd1433004 +0, 212400, 38016, 0xc5bc4798 +0, 216000, 38016, 0xeb8a3531 +0, 219600, 38016, 0xd4b014b8 +0, 223200, 38016, 0xaaa2c77e +0, 226800, 38016, 0xa0a5a94e +0, 230400, 38016, 0x74edcf2e +0, 234000, 38016, 0x2925e32a +0, 237600, 38016, 0x5400da3a +0, 241200, 38016, 0xc50eda9b +0, 244800, 38016, 0xfd4acbe7 +0, 248400, 38016, 0xa75eb6ee +0, 252000, 38016, 0xc0dca463 +0, 255600, 38016, 0xfd1b83b7 +0, 259200, 38016, 0x5b378f02 +0, 262800, 38016, 0x608983d5 +0, 266400, 38016, 0x6f6f2cda +0, 270000, 38016, 0x9367e1b2 +0, 273600, 38016, 0x12d7d677 +0, 277200, 38016, 0xd02cc0c5 +0, 280800, 38016, 0xbe2fed59 +0, 284400, 38016, 0x66c1402d +0, 288000, 38016, 0x150e75cf +0, 291600, 38016, 0x83c959ea +0, 295200, 38016, 0xa9c048f4 +0, 298800, 38016, 0xffa9237f +0, 302400, 38016, 0x0ab0d668 +0, 306000, 38016, 0xae4de2a4 +0, 309600, 38016, 0xfc4322e8 +0, 313200, 38016, 0x21f026dd +0, 316800, 38016, 0x7582b6a6 +0, 320400, 38016, 0x4ddc5306 +0, 324000, 38016, 0x1722db32 +0, 327600, 38016, 0x33a0ace6 +0, 331200, 38016, 0xe96ebd07 +0, 334800, 38016, 0xdff2e5ef +0, 338400, 38016, 0xbf941880 +0, 342000, 38016, 0x12ffcea4 +0, 345600, 38016, 0x1ef6aaef +0, 349200, 38016, 0x2b01f811 +0, 352800, 38016, 0x422b5992 +0, 356400, 38016, 0x68ba9d2d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvbs3_sony_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvbs3_sony_c new file mode 100644 index 00000000..7a5db82d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvbs3_sony_c @@ -0,0 +1,300 @@ +0, 0, 38016, 0xb3883478 +0, 3600, 38016, 0xddf01d9d +0, 7200, 38016, 0xb177ece2 +0, 10800, 38016, 0xfcd6aec1 +0, 14400, 38016, 0x5cb5a017 +0, 18000, 38016, 0xeb3884e7 +0, 21600, 38016, 0xa8494fb1 +0, 25200, 38016, 0xe0084edb +0, 28800, 38016, 0x605845e7 +0, 32400, 38016, 0xe2103e96 +0, 36000, 38016, 0x3b057699 +0, 39600, 38016, 0x130b9413 +0, 43200, 38016, 0x1af773f6 +0, 46800, 38016, 0x1a77b1f3 +0, 50400, 38016, 0xbb5bac34 +0, 54000, 38016, 0xd41c9cf7 +0, 57600, 38016, 0x6df3ac7f +0, 61200, 38016, 0xba44a850 +0, 64800, 38016, 0xe8887fc4 +0, 68400, 38016, 0xa50387fa +0, 72000, 38016, 0x164c6317 +0, 75600, 38016, 0xb9c52925 +0, 79200, 38016, 0xfbcc2f11 +0, 82800, 38016, 0x5c0f258c +0, 86400, 38016, 0x0d61186e +0, 90000, 38016, 0xec173b07 +0, 93600, 38016, 0x322c353a +0, 97200, 38016, 0x30f72be0 +0, 100800, 38016, 0xb0aa5d52 +0, 104400, 38016, 0x915a70e2 +0, 108000, 38016, 0xed9563d3 +0, 111600, 38016, 0x2122a450 +0, 115200, 38016, 0xc8a6ba0a +0, 118800, 38016, 0x7fbaad08 +0, 122400, 38016, 0xef19d83b +0, 126000, 38016, 0x4fb1d339 +0, 129600, 38016, 0xe73eb1a3 +0, 133200, 38016, 0xfd23d6f0 +0, 136800, 38016, 0xfc21ca53 +0, 140400, 38016, 0xa6c7b2c9 +0, 144000, 38016, 0x4fb3c8e0 +0, 147600, 38016, 0xdb7acc62 +0, 151200, 38016, 0x281db765 +0, 154800, 38016, 0x2e11b6e9 +0, 158400, 38016, 0x8237b906 +0, 162000, 38016, 0xe3728780 +0, 165600, 38016, 0x2932a82c +0, 169200, 38016, 0x8a0ab2ca +0, 172800, 38016, 0xdb38a893 +0, 176400, 38016, 0xd64cbfc3 +0, 180000, 38016, 0x8a53b992 +0, 183600, 38016, 0xef29abc9 +0, 187200, 38016, 0x6d64baf6 +0, 190800, 38016, 0xc402bf13 +0, 194400, 38016, 0x00c7b709 +0, 198000, 38016, 0x55ddcb84 +0, 201600, 38016, 0x22cac705 +0, 205200, 38016, 0xfa1bc59d +0, 208800, 38016, 0x82a1d3d0 +0, 212400, 38016, 0x7db8d411 +0, 216000, 38016, 0x98a59a5a +0, 219600, 38016, 0x02bda814 +0, 223200, 38016, 0xc4a288d9 +0, 226800, 38016, 0x799a3804 +0, 230400, 38016, 0x11474f82 +0, 234000, 38016, 0x0b807846 +0, 237600, 38016, 0x2a118c7e +0, 241200, 38016, 0xa076e441 +0, 244800, 38016, 0x9b2c1c2b +0, 248400, 38016, 0xf1433098 +0, 252000, 38016, 0xbf68697b +0, 255600, 38016, 0x0c2c94de +0, 259200, 38016, 0x5fdcb88b +0, 262800, 38016, 0x543dfb09 +0, 266400, 38016, 0x4c602fc8 +0, 270000, 38016, 0x4c0b3afa +0, 273600, 38016, 0x97dd846b +0, 277200, 38016, 0xb5cb97f7 +0, 280800, 38016, 0x42dba91c +0, 284400, 38016, 0x827cc117 +0, 288000, 38016, 0xd589cd88 +0, 291600, 38016, 0x15bfdd09 +0, 295200, 38016, 0x77cbe929 +0, 298800, 38016, 0x499edfb2 +0, 302400, 38016, 0x3bd5d22c +0, 306000, 38016, 0xed0ed545 +0, 309600, 38016, 0x1751e754 +0, 313200, 38016, 0x042feed4 +0, 316800, 38016, 0x24dde6b3 +0, 320400, 38016, 0x8aa2ed66 +0, 324000, 38016, 0x8fa69f07 +0, 327600, 38016, 0xe018ad28 +0, 331200, 38016, 0x0b31992e +0, 334800, 38016, 0xf8aa6dbc +0, 338400, 38016, 0x0eb36da4 +0, 342000, 38016, 0x392b6658 +0, 345600, 38016, 0xb8056967 +0, 349200, 38016, 0x16899181 +0, 352800, 38016, 0x44b9a1b2 +0, 356400, 38016, 0x20ee9b98 +0, 360000, 38016, 0x42cdad98 +0, 363600, 38016, 0xd438a3d6 +0, 367200, 38016, 0x551e8751 +0, 370800, 38016, 0x68428f39 +0, 374400, 38016, 0x7449b249 +0, 378000, 38016, 0xf294a253 +0, 381600, 38016, 0x8628d899 +0, 385200, 38016, 0xba05f633 +0, 388800, 38016, 0x329bfacb +0, 392400, 38016, 0xaa5c33dd +0, 396000, 38016, 0x2b9437d9 +0, 399600, 38016, 0x8bd8273b +0, 403200, 38016, 0xc6d541fb +0, 406800, 38016, 0xb42c1e45 +0, 410400, 38016, 0xdd39e610 +0, 414000, 38016, 0xae56fe66 +0, 417600, 38016, 0x812a16e4 +0, 421200, 38016, 0x47fdff0f +0, 424800, 38016, 0xfbb33b56 +0, 428400, 38016, 0x792a486f +0, 432000, 38016, 0x32e93592 +0, 435600, 38016, 0xbd2142ca +0, 439200, 38016, 0x2d412532 +0, 442800, 38016, 0x5ee8e957 +0, 446400, 38016, 0x57c3de13 +0, 450000, 38016, 0xad94b6f1 +0, 453600, 38016, 0x8cda97a1 +0, 457200, 38016, 0x3563b54e +0, 460800, 38016, 0x1d2bc4fb +0, 464400, 38016, 0xada2cf01 +0, 468000, 38016, 0x8dabed0a +0, 471600, 38016, 0x441ae3c0 +0, 475200, 38016, 0x5514cc85 +0, 478800, 38016, 0xd20cddad +0, 482400, 38016, 0x5286d569 +0, 486000, 38016, 0x1612a173 +0, 489600, 38016, 0x5946be84 +0, 493200, 38016, 0x1925b1fe +0, 496800, 38016, 0xf34f93eb +0, 500400, 38016, 0xac3d9add +0, 504000, 38016, 0x12d18ba6 +0, 507600, 38016, 0xcc7f7e5a +0, 511200, 38016, 0x449270ec +0, 514800, 38016, 0x04416f83 +0, 518400, 38016, 0x50d36abf +0, 522000, 38016, 0x8605799f +0, 525600, 38016, 0xe6ec6cfd +0, 529200, 38016, 0x1f2d3baf +0, 532800, 38016, 0x9f3e1a4c +0, 536400, 38016, 0x5c3ef4c8 +0, 540000, 38016, 0xf731aef2 +0, 543600, 38016, 0x90b4c921 +0, 547200, 38016, 0xa12dc74f +0, 550800, 38016, 0x1fe2a278 +0, 554400, 38016, 0xa6b0b432 +0, 558000, 38016, 0xf9e9cb79 +0, 561600, 38016, 0xef58d10e +0, 565200, 38016, 0x957805c0 +0, 568800, 38016, 0x76e03b1f +0, 572400, 38016, 0xcb2a4905 +0, 576000, 38016, 0xb863646d +0, 579600, 38016, 0x3e5f57fe +0, 583200, 38016, 0xbe7d3d77 +0, 586800, 38016, 0x4f3c3ce5 +0, 590400, 38016, 0x806033d0 +0, 594000, 38016, 0xc31bf5da +0, 597600, 38016, 0x6f8ef69e +0, 601200, 38016, 0x010ac670 +0, 604800, 38016, 0x374e9bdd +0, 608400, 38016, 0xd8499c26 +0, 612000, 38016, 0x5901a512 +0, 615600, 38016, 0x31b2bcdf +0, 619200, 38016, 0x972cdda0 +0, 622800, 38016, 0x10c8ded1 +0, 626400, 38016, 0xc6e3c839 +0, 630000, 38016, 0xf661aa12 +0, 633600, 38016, 0x6ca379d0 +0, 637200, 38016, 0xc5a53d41 +0, 640800, 38016, 0x317d353c +0, 644400, 38016, 0xb9962522 +0, 648000, 38016, 0x0769ec52 +0, 651600, 38016, 0x4463ea8b +0, 655200, 38016, 0xdd7dd585 +0, 658800, 38016, 0x6039ca99 +0, 662400, 38016, 0x87beeba1 +0, 666000, 38016, 0x2503fd5d +0, 669600, 38016, 0xde950c40 +0, 673200, 38016, 0xd6f5332f +0, 676800, 38016, 0xa95b3137 +0, 680400, 38016, 0x37c026b4 +0, 684000, 38016, 0x93f9e3e3 +0, 687600, 38016, 0x5826b471 +0, 691200, 38016, 0xef81ac84 +0, 694800, 38016, 0x6361dfa0 +0, 698400, 38016, 0x9774f041 +0, 702000, 38016, 0xd8d01ad1 +0, 705600, 38016, 0x456252f3 +0, 709200, 38016, 0x448c6119 +0, 712800, 38016, 0x12157fca +0, 716400, 38016, 0x145ca727 +0, 720000, 38016, 0x17a5b174 +0, 723600, 38016, 0xc0c0bb0c +0, 727200, 38016, 0x9afbc5e8 +0, 730800, 38016, 0xc8c7cc3a +0, 734400, 38016, 0x489dc5dd +0, 738000, 38016, 0x6da6c7c8 +0, 741600, 38016, 0x6408d491 +0, 745200, 38016, 0x0820d9ce +0, 748800, 38016, 0xebcfc8d6 +0, 752400, 38016, 0xf462b2a2 +0, 756000, 38016, 0xadb65d17 +0, 759600, 38016, 0xecde79e9 +0, 763200, 38016, 0x81786ed0 +0, 766800, 38016, 0x3cfc51f8 +0, 770400, 38016, 0x307560ba +0, 774000, 38016, 0xc4f95361 +0, 777600, 38016, 0xe2fe384b +0, 781200, 38016, 0x95de4e60 +0, 784800, 38016, 0x1b6147f9 +0, 788400, 38016, 0xe1bc385b +0, 792000, 38016, 0x14cc446a +0, 795600, 38016, 0x5fcb313f +0, 799200, 38016, 0xf33f1721 +0, 802800, 38016, 0x49fc2fbb +0, 806400, 38016, 0x33ad3314 +0, 810000, 38016, 0x92b51315 +0, 813600, 38016, 0x7e4d3139 +0, 817200, 38016, 0xb99e432b +0, 820800, 38016, 0x52cb3c30 +0, 824400, 38016, 0xe5e48199 +0, 828000, 38016, 0x59419769 +0, 831600, 38016, 0x3e90b130 +0, 835200, 38016, 0x85fbfbd6 +0, 838800, 38016, 0xba8912ac +0, 842400, 38016, 0x3fc3128c +0, 846000, 38016, 0x61db4d37 +0, 849600, 38016, 0x3c405a46 +0, 853200, 38016, 0x9c113b43 +0, 856800, 38016, 0x739c43f4 +0, 860400, 38016, 0xffab0fe6 +0, 864000, 38016, 0x99cee4bd +0, 867600, 38016, 0xd76dcff5 +0, 871200, 38016, 0xe8ccb16c +0, 874800, 38016, 0x43d8ff1f +0, 878400, 38016, 0xffde708b +0, 882000, 38016, 0xe5cfd3d4 +0, 885600, 38016, 0x0b67ef9f +0, 889200, 38016, 0xd54cd697 +0, 892800, 38016, 0x5879926e +0, 896400, 38016, 0x9cb01428 +0, 900000, 38016, 0x09b0c0b7 +0, 903600, 38016, 0xbbef721e +0, 907200, 38016, 0xcebd66ea +0, 910800, 38016, 0x7492c956 +0, 914400, 38016, 0xeaa5317b +0, 918000, 38016, 0xe952c9bd +0, 921600, 38016, 0xb4cfd878 +0, 925200, 38016, 0xa8675f14 +0, 928800, 38016, 0x24653121 +0, 932400, 38016, 0xeec9425e +0, 936000, 38016, 0x14413e58 +0, 939600, 38016, 0xc8e13f0a +0, 943200, 38016, 0x09045f0f +0, 946800, 38016, 0xa021583e +0, 950400, 38016, 0x26384591 +0, 954000, 38016, 0x157b55d2 +0, 957600, 38016, 0x22973c65 +0, 961200, 38016, 0x2fe30f64 +0, 964800, 38016, 0xf640fab4 +0, 968400, 38016, 0x2b82d807 +0, 972000, 38016, 0x6faca613 +0, 975600, 38016, 0x8a5b89c3 +0, 979200, 38016, 0xb7d76316 +0, 982800, 38016, 0x3e3a0a82 +0, 986400, 38016, 0x7d93d78b +0, 990000, 38016, 0xa3bcc050 +0, 993600, 38016, 0x41d4b2ba +0, 997200, 38016, 0x7a08d518 +0, 1000800, 38016, 0xd6b0f72b +0, 1004400, 38016, 0x9c794c7b +0, 1008000, 38016, 0xc2680d18 +0, 1011600, 38016, 0x9fa6db96 +0, 1015200, 38016, 0xd90c83c3 +0, 1018800, 38016, 0xf1278cf5 +0, 1022400, 38016, 0xf2ce5e19 +0, 1026000, 38016, 0x2d41a44b +0, 1029600, 38016, 0xade2715b +0, 1033200, 38016, 0xd21da6fe +0, 1036800, 38016, 0x37c89e7f +0, 1040400, 38016, 0x6bad76e8 +0, 1044000, 38016, 0xfefce893 +0, 1047600, 38016, 0xcd301b29 +0, 1051200, 38016, 0x0e80a08d +0, 1054800, 38016, 0x88f3d605 +0, 1058400, 38016, 0x80273791 +0, 1062000, 38016, 0x36472009 +0, 1065600, 38016, 0xe8b6fc54 +0, 1069200, 38016, 0x5d9bfd2d +0, 1072800, 38016, 0x61df1820 +0, 1076400, 38016, 0x8db23b5c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvcanlma2_sony_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvcanlma2_sony_c new file mode 100644 index 00000000..5eff64e5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvcanlma2_sony_c @@ -0,0 +1,17 @@ +0, 0, 518400, 0xfbca00c6 +0, 3600, 518400, 0x82b80adf +0, 7200, 518400, 0x87ecdf4a +0, 10800, 518400, 0xf6ca8cbe +0, 14400, 518400, 0x8e9bb8a0 +0, 18000, 518400, 0x6512caa2 +0, 21600, 518400, 0xc015e43e +0, 25200, 518400, 0x5f504a5c +0, 28800, 518400, 0x4c7458a4 +0, 32400, 518400, 0x630f4004 +0, 36000, 518400, 0x889af20e +0, 39600, 518400, 0x4437a5a4 +0, 43200, 518400, 0x1e19a254 +0, 46800, 518400, 0xb7ef1763 +0, 50400, 518400, 0xc966c95a +0, 54000, 518400, 0x0c9074d6 +0, 57600, 518400, 0x24c906c9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvfi1_sony_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvfi1_sony_d new file mode 100644 index 00000000..aaf0e7b0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvfi1_sony_d @@ -0,0 +1,17 @@ +0, 0, 518400, 0xd9444d71 +0, 3600, 518400, 0x5d8928cd +0, 7200, 518400, 0xea5bc08b +0, 10800, 518400, 0xb4465d31 +0, 14400, 518400, 0x983b5dbb +0, 18000, 518400, 0x54936746 +0, 21600, 518400, 0x7ae38b02 +0, 25200, 518400, 0xc2a0dd83 +0, 28800, 518400, 0x61cac7a6 +0, 32400, 518400, 0xb0038443 +0, 36000, 518400, 0x16514296 +0, 39600, 518400, 0xa68dd470 +0, 43200, 518400, 0x2572f868 +0, 46800, 518400, 0x770a3239 +0, 50400, 518400, 0xdd04f6d2 +0, 54000, 518400, 0xa5e5d01e +0, 57600, 518400, 0x5fe25c86 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvfi1_sva_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvfi1_sva_c new file mode 100644 index 00000000..bcff3ea0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvfi1_sva_c @@ -0,0 +1,7 @@ +0, 0, 518400, 0x8f022263 +0, 3600, 518400, 0x02692654 +0, 7200, 518400, 0x55eff579 +0, 10800, 518400, 0x6c1bdf1d +0, 14400, 518400, 0xbbedf5e4 +0, 18000, 518400, 0xb90d740d +0, 21600, 518400, 0x81300adb diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvfi2_sony_h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvfi2_sony_h new file mode 100644 index 00000000..1a7743ad --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvfi2_sony_h @@ -0,0 +1,17 @@ +0, 0, 518400, 0xd9444d71 +0, 3600, 518400, 0x491faf75 +0, 7200, 518400, 0xf8b4d15c +0, 10800, 518400, 0x99d9f60c +0, 14400, 518400, 0x46c17a6d +0, 18000, 518400, 0x30b9447d +0, 21600, 518400, 0x135d0c76 +0, 25200, 518400, 0x1b831a3c +0, 28800, 518400, 0x5910def8 +0, 32400, 518400, 0x8db90147 +0, 36000, 518400, 0x6a2b79c7 +0, 39600, 518400, 0xc8d302e5 +0, 43200, 518400, 0x515bb024 +0, 46800, 518400, 0xedf7836c +0, 50400, 518400, 0x7e247b9d +0, 54000, 518400, 0x10c9bb10 +0, 57600, 518400, 0xe38e2807 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvfi2_sva_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvfi2_sva_c new file mode 100644 index 00000000..ffb0a836 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvfi2_sva_c @@ -0,0 +1,13 @@ +0, 0, 518400, 0x4073cc0b +0, 3600, 518400, 0x5f599a48 +0, 7200, 518400, 0xc6fe555a +0, 10800, 518400, 0xe63ac345 +0, 14400, 518400, 0x9b4f0c5c +0, 18000, 518400, 0x98aaba2d +0, 21600, 518400, 0xd629bd09 +0, 25200, 518400, 0xe9796c37 +0, 28800, 518400, 0xba54d16e +0, 32400, 518400, 0xe396c3eb +0, 36000, 518400, 0x63ee4b81 +0, 39600, 518400, 0x68ac6986 +0, 43200, 518400, 0xe0d53000 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvma1_sony_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvma1_sony_d new file mode 100644 index 00000000..6b309aab --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvma1_sony_d @@ -0,0 +1,5 @@ +0, 0, 518400, 0x75701511 +0, 3600, 518400, 0xa7eeaa16 +0, 7200, 518400, 0xe0f32e35 +0, 10800, 518400, 0x7a1dadd9 +0, 14400, 518400, 0x4a1672a6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvma1_toshiba_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvma1_toshiba_b new file mode 100644 index 00000000..897e915e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvma1_toshiba_b @@ -0,0 +1,90 @@ +0, 0, 152064, 0x9a9ce366 +0, 3600, 152064, 0xf4639828 +0, 7200, 152064, 0x625024a3 +0, 10800, 152064, 0x80dc2f9d +0, 14400, 152064, 0xb2c4feea +0, 18000, 152064, 0x4ec6ad64 +0, 21600, 152064, 0x1957bec3 +0, 25200, 152064, 0xb682799d +0, 28800, 152064, 0x34cd2053 +0, 32400, 152064, 0x81490b4c +0, 36000, 152064, 0x242dc943 +0, 39600, 152064, 0x3e126734 +0, 43200, 152064, 0x8e474ff8 +0, 46800, 152064, 0x239d2fbd +0, 50400, 152064, 0x0ca3e16f +0, 54000, 152064, 0x6161d7c2 +0, 57600, 152064, 0xca7ad1af +0, 61200, 152064, 0xf8ef9026 +0, 64800, 152064, 0x01f2f4c1 +0, 68400, 152064, 0x510b19ec +0, 72000, 152064, 0xe489028b +0, 75600, 152064, 0x7a693c1e +0, 79200, 152064, 0x276b23fe +0, 82800, 152064, 0x0e9ced3a +0, 86400, 152064, 0x658228f7 +0, 90000, 152064, 0x6a271bc3 +0, 93600, 152064, 0x431ecd8b +0, 97200, 152064, 0x23a5ed14 +0, 100800, 152064, 0x76fbe121 +0, 104400, 152064, 0x471f919d +0, 108000, 152064, 0x16bfabbc +0, 111600, 152064, 0x0762993f +0, 115200, 152064, 0x5a2b0b0e +0, 118800, 152064, 0x81415ef7 +0, 122400, 152064, 0xb96e4164 +0, 126000, 152064, 0xf77aee83 +0, 129600, 152064, 0x6af81633 +0, 133200, 152064, 0xed78e5b5 +0, 136800, 152064, 0x67e38e2c +0, 140400, 152064, 0x0417ae01 +0, 144000, 152064, 0x3887b312 +0, 147600, 152064, 0x3a4b70fb +0, 151200, 152064, 0xcaae9e7f +0, 154800, 152064, 0xaf9597be +0, 158400, 152064, 0x9bae63d3 +0, 162000, 152064, 0x0e80825f +0, 165600, 152064, 0x915661fd +0, 169200, 152064, 0x67d3dc94 +0, 172800, 152064, 0x3dcf240c +0, 176400, 152064, 0x127ff832 +0, 180000, 152064, 0xc8969981 +0, 183600, 152064, 0x57179c77 +0, 187200, 152064, 0x9f88656c +0, 190800, 152064, 0xc28ff5d3 +0, 194400, 152064, 0xf100fad9 +0, 198000, 152064, 0xb570ce12 +0, 201600, 152064, 0xe8f28955 +0, 205200, 152064, 0x1f0a9549 +0, 208800, 152064, 0x22b17e9b +0, 212400, 152064, 0x7cf1400e +0, 216000, 152064, 0xafd273b7 +0, 219600, 152064, 0xeb9b712e +0, 223200, 152064, 0x0f81de24 +0, 226800, 152064, 0x8f4e1953 +0, 230400, 152064, 0x682e2170 +0, 234000, 152064, 0xc32ad1b2 +0, 237600, 152064, 0x53a81d79 +0, 241200, 152064, 0x54002596 +0, 244800, 152064, 0x4b5fdbd9 +0, 248400, 152064, 0x96613368 +0, 252000, 152064, 0xd6ac0171 +0, 255600, 152064, 0xf1c1b7b7 +0, 259200, 152064, 0xc730d82f +0, 262800, 152064, 0x0415d934 +0, 266400, 152064, 0x5338915e +0, 270000, 152064, 0x8e9dda6d +0, 273600, 152064, 0xe3a8b0a0 +0, 277200, 152064, 0x5fa36e44 +0, 280800, 152064, 0x0e63dc72 +0, 284400, 152064, 0xd0dad71f +0, 288000, 152064, 0x0c4aac94 +0, 291600, 152064, 0x60d50e8d +0, 295200, 152064, 0x96872d7c +0, 298800, 152064, 0x4fcefc33 +0, 302400, 152064, 0x6b8157c9 +0, 306000, 152064, 0xa40d527d +0, 309600, 152064, 0x9884480a +0, 313200, 152064, 0xff5d9754 +0, 316800, 152064, 0x4a26a74d +0, 320400, 152064, 0x81059e82 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmanl1_toshiba_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmanl1_toshiba_b new file mode 100644 index 00000000..07422b8d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmanl1_toshiba_b @@ -0,0 +1,90 @@ +0, 0, 152064, 0xb1edd842 +0, 3600, 152064, 0x551f8f45 +0, 7200, 152064, 0xb4931cb2 +0, 10800, 152064, 0x78882b27 +0, 14400, 152064, 0x3afef36d +0, 18000, 152064, 0x85afad0a +0, 21600, 152064, 0x3a8bab81 +0, 25200, 152064, 0x2a437174 +0, 28800, 152064, 0x22421437 +0, 32400, 152064, 0x39c5f125 +0, 36000, 152064, 0x256eaad2 +0, 39600, 152064, 0x668a5d31 +0, 43200, 152064, 0x412a4aa7 +0, 46800, 152064, 0x3f091baf +0, 50400, 152064, 0xbf16d262 +0, 54000, 152064, 0x2fc4ce67 +0, 57600, 152064, 0x119cde3e +0, 61200, 152064, 0xb40b8632 +0, 64800, 152064, 0x4be4f192 +0, 68400, 152064, 0x906c1237 +0, 72000, 152064, 0x95380024 +0, 75600, 152064, 0x6a833025 +0, 79200, 152064, 0x681d1c4f +0, 82800, 152064, 0x08c8dea4 +0, 86400, 152064, 0xc69226f0 +0, 90000, 152064, 0x86631102 +0, 93600, 152064, 0x7f40c77a +0, 97200, 152064, 0xc746ddd4 +0, 100800, 152064, 0x5f2bd3cb +0, 104400, 152064, 0x643c8316 +0, 108000, 152064, 0x5b7fa380 +0, 111600, 152064, 0x82438cf7 +0, 115200, 152064, 0xdee0f7e7 +0, 118800, 152064, 0xc50d41f1 +0, 122400, 152064, 0xf3453631 +0, 126000, 152064, 0x90bce66b +0, 129600, 152064, 0x045b03f7 +0, 133200, 152064, 0xf64bd756 +0, 136800, 152064, 0xff997ef2 +0, 140400, 152064, 0x3613a0a5 +0, 144000, 152064, 0xe6a7a8d6 +0, 147600, 152064, 0xb0906c42 +0, 151200, 152064, 0x4dfc912b +0, 154800, 152064, 0x81e3991c +0, 158400, 152064, 0x4efc61fb +0, 162000, 152064, 0xed478395 +0, 165600, 152064, 0x4cb25ab6 +0, 169200, 152064, 0x28e7d51f +0, 172800, 152064, 0x8bcc1a8d +0, 176400, 152064, 0x2fe1f240 +0, 180000, 152064, 0xb4978ef8 +0, 183600, 152064, 0xe3929556 +0, 187200, 152064, 0xd370632a +0, 190800, 152064, 0xba86ffb2 +0, 194400, 152064, 0x444bf18c +0, 198000, 152064, 0xab40bd14 +0, 201600, 152064, 0xfd488a5d +0, 205200, 152064, 0xe1f09568 +0, 208800, 152064, 0x09ee7a7e +0, 212400, 152064, 0x9360397c +0, 216000, 152064, 0xdbd467e9 +0, 219600, 152064, 0x99726777 +0, 223200, 152064, 0x009fd46c +0, 226800, 152064, 0xcf770fdb +0, 230400, 152064, 0x2a890fd9 +0, 234000, 152064, 0x7f40de4b +0, 237600, 152064, 0x04191304 +0, 241200, 152064, 0x15722022 +0, 244800, 152064, 0x59f4ea93 +0, 248400, 152064, 0x28ba373f +0, 252000, 152064, 0xf9e400b8 +0, 255600, 152064, 0x85c4bd98 +0, 259200, 152064, 0x6917d2a5 +0, 262800, 152064, 0x61cae234 +0, 266400, 152064, 0x752a9a2d +0, 270000, 152064, 0x1ee2d9bd +0, 273600, 152064, 0xdce9ab8e +0, 277200, 152064, 0x51225fd0 +0, 280800, 152064, 0x10e8cb60 +0, 284400, 152064, 0x8d07cd25 +0, 288000, 152064, 0xb18ba61b +0, 291600, 152064, 0xb0f10280 +0, 295200, 152064, 0x76a71f13 +0, 298800, 152064, 0x3004f5a1 +0, 302400, 152064, 0x9aba5724 +0, 306000, 152064, 0x5db85385 +0, 309600, 152064, 0xbe9d3f5b +0, 313200, 152064, 0xa71e85bb +0, 316800, 152064, 0xdcf59cd7 +0, 320400, 152064, 0x5e319459 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmanl2_toshiba_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmanl2_toshiba_b new file mode 100644 index 00000000..d8959a33 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmanl2_toshiba_b @@ -0,0 +1,90 @@ +0, 0, 152064, 0xb1edd842 +0, 3600, 152064, 0x551f8f45 +0, 7200, 152064, 0xb4931cb2 +0, 10800, 152064, 0x5f352e98 +0, 14400, 152064, 0xeba5fe28 +0, 18000, 152064, 0x85afad0a +0, 21600, 152064, 0x1120b6a4 +0, 25200, 152064, 0x67506e16 +0, 28800, 152064, 0x22421437 +0, 32400, 152064, 0x929becd6 +0, 36000, 152064, 0x6ffcb4b0 +0, 39600, 152064, 0x668a5d31 +0, 43200, 152064, 0x1b034ebb +0, 46800, 152064, 0x7e2d213c +0, 50400, 152064, 0xbf16d262 +0, 54000, 152064, 0xdeaecab3 +0, 57600, 152064, 0xd220d704 +0, 61200, 152064, 0xb40b8632 +0, 64800, 152064, 0xbdf0ef57 +0, 68400, 152064, 0x7e2e10df +0, 72000, 152064, 0x95380024 +0, 75600, 152064, 0xdb80256d +0, 79200, 152064, 0xa4561c61 +0, 82800, 152064, 0x08c8dea4 +0, 86400, 152064, 0x7bb917d6 +0, 90000, 152064, 0x796f0e2b +0, 93600, 152064, 0x7f40c77a +0, 97200, 152064, 0xda32de2e +0, 100800, 152064, 0x00ffc15a +0, 104400, 152064, 0x643c8316 +0, 108000, 152064, 0xb7588f7f +0, 111600, 152064, 0xa4e07c02 +0, 115200, 152064, 0xdee0f7e7 +0, 118800, 152064, 0x2c3245ee +0, 122400, 152064, 0x6565355b +0, 126000, 152064, 0x90bce66b +0, 129600, 152064, 0x0abffe08 +0, 133200, 152064, 0x119ccc3e +0, 136800, 152064, 0xff997ef2 +0, 140400, 152064, 0xba4b9820 +0, 144000, 152064, 0xb6dfa596 +0, 147600, 152064, 0xb0906c42 +0, 151200, 152064, 0xf3c29133 +0, 154800, 152064, 0x08cd8e2b +0, 158400, 152064, 0x4efc61fb +0, 162000, 152064, 0x5b7c6e48 +0, 165600, 152064, 0xd28a47c2 +0, 169200, 152064, 0x28e7d51f +0, 172800, 152064, 0x3a5619b1 +0, 176400, 152064, 0xa517e7f2 +0, 180000, 152064, 0xb4978ef8 +0, 183600, 152064, 0x25929175 +0, 187200, 152064, 0x20f05834 +0, 190800, 152064, 0xba86ffb2 +0, 194400, 152064, 0xa265f06f +0, 198000, 152064, 0x97bbbfb7 +0, 201600, 152064, 0xfd488a5d +0, 205200, 152064, 0x1b0989da +0, 208800, 152064, 0xfd1878ce +0, 212400, 152064, 0x9360397c +0, 216000, 152064, 0x0d8151a7 +0, 219600, 152064, 0xe7a05bb8 +0, 223200, 152064, 0x009fd46c +0, 226800, 152064, 0x8751123f +0, 230400, 152064, 0x8252101a +0, 234000, 152064, 0x7f40de4b +0, 237600, 152064, 0x4ea317fe +0, 241200, 152064, 0x519224d9 +0, 244800, 152064, 0x59f4ea93 +0, 248400, 152064, 0xc93c1dba +0, 252000, 152064, 0xe3c9fb61 +0, 255600, 152064, 0x85c4bd98 +0, 259200, 152064, 0xcebacfd3 +0, 262800, 152064, 0x7327da99 +0, 266400, 152064, 0x752a9a2d +0, 270000, 152064, 0x5ea6c8d2 +0, 273600, 152064, 0x66fd8c6f +0, 277200, 152064, 0x51225fd0 +0, 280800, 152064, 0x58b9be96 +0, 284400, 152064, 0xa5abcdb7 +0, 288000, 152064, 0xb18ba61b +0, 291600, 152064, 0xc7d20190 +0, 295200, 152064, 0xb6da14aa +0, 298800, 152064, 0x3004f5a1 +0, 302400, 152064, 0x129354e2 +0, 306000, 152064, 0xffa148d5 +0, 309600, 152064, 0xbe9d3f5b +0, 313200, 152064, 0x1c7f8976 +0, 316800, 152064, 0xa107a54d +0, 320400, 152064, 0x5e319459 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmapaqp3_sony_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmapaqp3_sony_e new file mode 100644 index 00000000..ba89dfc1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmapaqp3_sony_e @@ -0,0 +1,8 @@ +0, 0, 518400, 0x80dffda2 +0, 3600, 518400, 0x9450183b +0, 7200, 518400, 0x85d429a7 +0, 10800, 518400, 0xe1f3b686 +0, 14400, 518400, 0x2180c761 +0, 18000, 518400, 0x30269c7c +0, 21600, 518400, 0xe9aa575a +0, 25200, 518400, 0x7b815a0a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmaqp3_sony_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmaqp3_sony_d new file mode 100644 index 00000000..c029f456 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmaqp3_sony_d @@ -0,0 +1,17 @@ +0, 0, 36864, 0xdee3d4e3 +0, 3600, 36864, 0xabec8d44 +0, 7200, 36864, 0x95d029fe +0, 10800, 36864, 0x4daeb4b9 +0, 14400, 36864, 0x320a6301 +0, 18000, 36864, 0x6b881d0c +0, 21600, 36864, 0xfe6eda15 +0, 25200, 36864, 0xda72d0b2 +0, 28800, 36864, 0x3232651b +0, 32400, 36864, 0x9f20cbf1 +0, 36000, 36864, 0x5dfbd085 +0, 39600, 36864, 0x2bb62dd1 +0, 43200, 36864, 0xf8ed11cf +0, 46800, 36864, 0x1ed62476 +0, 50400, 36864, 0x65b18976 +0, 54000, 36864, 0x1658c18b +0, 57600, 36864, 0x76073a08 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmp_mot_fld_l30_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmp_mot_fld_l30_b new file mode 100644 index 00000000..ba7caaf1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmp_mot_fld_l30_b @@ -0,0 +1,30 @@ +0, 0, 518400, 0xe9c7643e +0, 3600, 518400, 0xba7456ec +0, 7200, 518400, 0xdeb96749 +0, 10800, 518400, 0xa101a986 +0, 14400, 518400, 0x3db7baa5 +0, 18000, 518400, 0xf3dfcec7 +0, 21600, 518400, 0x79b4f537 +0, 25200, 518400, 0x9e64fe68 +0, 28800, 518400, 0x0e810b53 +0, 32400, 518400, 0x20baf3b8 +0, 36000, 518400, 0x0a49d341 +0, 39600, 518400, 0xa8304ab5 +0, 43200, 518400, 0x2600e98f +0, 46800, 518400, 0x9253e3e8 +0, 50400, 518400, 0xd6e12783 +0, 54000, 518400, 0x6894fc79 +0, 57600, 518400, 0xfb60d3e3 +0, 61200, 518400, 0x523602be +0, 64800, 518400, 0x4979f409 +0, 68400, 518400, 0x50d4e2ab +0, 72000, 518400, 0xa8c2140a +0, 75600, 518400, 0x45c0bc15 +0, 79200, 518400, 0xaef78cab +0, 82800, 518400, 0xec539d02 +0, 86400, 518400, 0x602585ea +0, 90000, 518400, 0xda263463 +0, 93600, 518400, 0xa03d8922 +0, 97200, 518400, 0x43ea1c1d +0, 100800, 518400, 0xb1e055a6 +0, 104400, 518400, 0x6fff9398 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmp_mot_frm_l31_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmp_mot_frm_l31_b new file mode 100644 index 00000000..05827ef5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvmp_mot_frm_l31_b @@ -0,0 +1,30 @@ +0, 0, 518400, 0x7b2475e3 +0, 3600, 518400, 0xda786a87 +0, 7200, 518400, 0xb1dd8108 +0, 10800, 518400, 0x760ed65d +0, 14400, 518400, 0x8632d20c +0, 18000, 518400, 0xdd81e625 +0, 21600, 518400, 0x853f1c41 +0, 25200, 518400, 0x20191585 +0, 28800, 518400, 0x0367e357 +0, 32400, 518400, 0x60521167 +0, 36000, 518400, 0xa887d4cc +0, 39600, 518400, 0x9a450f9e +0, 43200, 518400, 0xe9620841 +0, 46800, 518400, 0xb482fb0e +0, 50400, 518400, 0x7b79f670 +0, 54000, 518400, 0x9d37f1d1 +0, 57600, 518400, 0xe358d323 +0, 61200, 518400, 0x62ade59c +0, 64800, 518400, 0xdd78da66 +0, 68400, 518400, 0xd97b867b +0, 72000, 518400, 0x8a90cf8c +0, 75600, 518400, 0x9d386610 +0, 79200, 518400, 0x2c590f46 +0, 82800, 518400, 0x92662861 +0, 86400, 518400, 0x6979f563 +0, 90000, 518400, 0xdd0fa1b2 +0, 93600, 518400, 0xccbf1c1c +0, 97200, 518400, 0x7e358112 +0, 100800, 518400, 0xb7c0d89d +0, 104400, 518400, 0xc6b03973 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvnlfi1_sony_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvnlfi1_sony_c new file mode 100644 index 00000000..26fa93a8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvnlfi1_sony_c @@ -0,0 +1,17 @@ +0, 0, 518400, 0x0fbb4e71 +0, 3600, 518400, 0x4b816734 +0, 7200, 518400, 0x0c350f19 +0, 10800, 518400, 0xda049cb6 +0, 14400, 518400, 0x1f3e7bb9 +0, 18000, 518400, 0x995cbe66 +0, 21600, 518400, 0x07f7e65c +0, 25200, 518400, 0xfcb7487f +0, 28800, 518400, 0xb080f48a +0, 32400, 518400, 0x3ef5b7e4 +0, 36000, 518400, 0xa1518e1c +0, 39600, 518400, 0xb36f1cc9 +0, 43200, 518400, 0x86ea48af +0, 46800, 518400, 0xe42373b7 +0, 50400, 518400, 0xa8435828 +0, 54000, 518400, 0xc942ea0e +0, 57600, 518400, 0xcc597514 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvnlfi2_sony_h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvnlfi2_sony_h new file mode 100644 index 00000000..045929b0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvnlfi2_sony_h @@ -0,0 +1,17 @@ +0, 0, 518400, 0x0fbb4e71 +0, 3600, 518400, 0xc46bec04 +0, 7200, 518400, 0xc50ffc1d +0, 10800, 518400, 0x684b07b7 +0, 14400, 518400, 0xde799af0 +0, 18000, 518400, 0xed497b27 +0, 21600, 518400, 0x3e9d1e3a +0, 25200, 518400, 0x154d3c5c +0, 28800, 518400, 0x5257e37c +0, 32400, 518400, 0x6e15139a +0, 36000, 518400, 0x5dc39c59 +0, 39600, 518400, 0xe1803100 +0, 43200, 518400, 0xb4d4d535 +0, 46800, 518400, 0x7a97a25d +0, 50400, 518400, 0xf86b8923 +0, 54000, 518400, 0x3355be98 +0, 57600, 518400, 0x8f555830 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvpa1_toshiba_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvpa1_toshiba_b new file mode 100644 index 00000000..6f94315c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvpa1_toshiba_b @@ -0,0 +1,90 @@ +0, 0, 152064, 0x128cd77a +0, 3600, 152064, 0x565b9fc1 +0, 7200, 152064, 0xbe322679 +0, 10800, 152064, 0x0ea4238f +0, 14400, 152064, 0x1e08fb3c +0, 18000, 152064, 0x6da3a93c +0, 21600, 152064, 0x75e5b181 +0, 25200, 152064, 0xa0b39334 +0, 28800, 152064, 0xa0d10d6d +0, 32400, 152064, 0x33842bcb +0, 36000, 152064, 0x9a74e1e4 +0, 39600, 152064, 0xc2037244 +0, 43200, 152064, 0x364b8ae4 +0, 46800, 152064, 0x18c04971 +0, 50400, 152064, 0x7234ecb5 +0, 54000, 152064, 0x3719f8bc +0, 57600, 152064, 0x1285ead1 +0, 61200, 152064, 0xd3bfab18 +0, 64800, 152064, 0x898111e2 +0, 68400, 152064, 0x681c15fc +0, 72000, 152064, 0x8e501572 +0, 75600, 152064, 0xd7c838be +0, 79200, 152064, 0xede424b2 +0, 82800, 152064, 0xcfc20240 +0, 86400, 152064, 0x13992e86 +0, 90000, 152064, 0x56fb251a +0, 93600, 152064, 0xee9be320 +0, 97200, 152064, 0xea650153 +0, 100800, 152064, 0x2cb6dabe +0, 104400, 152064, 0xf44fa4b5 +0, 108000, 152064, 0xdac2adff +0, 111600, 152064, 0x9e15a1dc +0, 115200, 152064, 0x28d00970 +0, 118800, 152064, 0xe4277347 +0, 122400, 152064, 0xebd25ad1 +0, 126000, 152064, 0x029402da +0, 129600, 152064, 0x1a2311ef +0, 133200, 152064, 0xb86bf96a +0, 136800, 152064, 0x67d7a5b0 +0, 140400, 152064, 0x573abc2d +0, 144000, 152064, 0xbe97dec0 +0, 147600, 152064, 0x592b91a4 +0, 151200, 152064, 0x9adda65e +0, 154800, 152064, 0x0354b2cb +0, 158400, 152064, 0x91e27ff9 +0, 162000, 152064, 0x389f8625 +0, 165600, 152064, 0x90175850 +0, 169200, 152064, 0x2d36c427 +0, 172800, 152064, 0xc0dd14ab +0, 176400, 152064, 0xd49bf131 +0, 180000, 152064, 0x0d4a9b92 +0, 183600, 152064, 0xae9bb2f1 +0, 187200, 152064, 0x36847ade +0, 190800, 152064, 0x74810382 +0, 194400, 152064, 0xc56d1d9f +0, 198000, 152064, 0xcfefe3ae +0, 201600, 152064, 0xeaa39353 +0, 205200, 152064, 0x14289aef +0, 208800, 152064, 0x74ba8f3b +0, 212400, 152064, 0xdcaa518d +0, 216000, 152064, 0x6e4881c2 +0, 219600, 152064, 0xa4db767d +0, 223200, 152064, 0x239b0b19 +0, 226800, 152064, 0x5d054236 +0, 230400, 152064, 0x6f392d7c +0, 234000, 152064, 0x5c2af146 +0, 237600, 152064, 0x26b439af +0, 241200, 152064, 0xba7043ab +0, 244800, 152064, 0x0816000c +0, 248400, 152064, 0x3a713c05 +0, 252000, 152064, 0xb3111f6d +0, 255600, 152064, 0xdbf8dae2 +0, 259200, 152064, 0x09ddf22e +0, 262800, 152064, 0x8871fa7e +0, 266400, 152064, 0x9f5db7a1 +0, 270000, 152064, 0xcc38f225 +0, 273600, 152064, 0xa1d18df9 +0, 277200, 152064, 0x9b1c5d6a +0, 280800, 152064, 0x9f2bc696 +0, 284400, 152064, 0xc39bd11a +0, 288000, 152064, 0x4ceca7d0 +0, 291600, 152064, 0x63a60f1d +0, 295200, 152064, 0x4cd31f28 +0, 298800, 152064, 0x9c9af5d1 +0, 302400, 152064, 0x6def65fc +0, 306000, 152064, 0x1011466d +0, 309600, 152064, 0xfeca406d +0, 313200, 152064, 0xd1ca8a1e +0, 316800, 152064, 0x30caa195 +0, 320400, 152064, 0x31a09a48 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvpcmnl1_sva_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvpcmnl1_sva_c new file mode 100644 index 00000000..feb30109 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvpcmnl1_sva_c @@ -0,0 +1,30 @@ +0, 0, 152064, 0x19b8407d +0, 3600, 152064, 0xab8bede6 +0, 7200, 152064, 0xf59acd09 +0, 10800, 152064, 0xc905853b +0, 14400, 152064, 0x1c3d32f8 +0, 18000, 152064, 0x26a91508 +0, 21600, 152064, 0x9443e44a +0, 25200, 152064, 0x0d158c55 +0, 28800, 152064, 0x4b207062 +0, 32400, 152064, 0x31d8543f +0, 36000, 152064, 0x43520337 +0, 39600, 152064, 0x4676dd14 +0, 43200, 152064, 0x8b4291d4 +0, 46800, 152064, 0xb35e4950 +0, 50400, 152064, 0xd7164390 +0, 54000, 152064, 0x7cce0af7 +0, 57600, 152064, 0x4f67ca7d +0, 61200, 152064, 0xd517af08 +0, 64800, 152064, 0x519b8322 +0, 68400, 152064, 0xa87d2987 +0, 72000, 152064, 0xfe8cfd89 +0, 75600, 152064, 0x3b40b919 +0, 79200, 152064, 0x83398526 +0, 82800, 152064, 0x309b6168 +0, 86400, 152064, 0xa8351c37 +0, 90000, 152064, 0x7977f8fd +0, 93600, 152064, 0x5b24e5a7 +0, 97200, 152064, 0x0ad0a48e +0, 100800, 152064, 0xd93a7d3e +0, 104400, 152064, 0xae0f6631 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvpcmnl2_sva_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvpcmnl2_sva_c new file mode 100644 index 00000000..16a46503 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvpcmnl2_sva_c @@ -0,0 +1,2 @@ +0, 0, 1382400, 0xccbe6bf8 +0, 3600, 1382400, 0x49c0cfd7 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvwp1_toshiba_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvwp1_toshiba_e new file mode 100644 index 00000000..6c9b2278 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvwp1_toshiba_e @@ -0,0 +1,90 @@ +0, 0, 152064, 0xabf9ae05 +0, 3600, 152064, 0x20418b16 +0, 7200, 152064, 0xe941572f +0, 10800, 152064, 0xcf63e20e +0, 14400, 152064, 0x57dedcde +0, 18000, 152064, 0x4de7bf34 +0, 21600, 152064, 0xc8014983 +0, 25200, 152064, 0x5ab946fc +0, 28800, 152064, 0x2ca02582 +0, 32400, 152064, 0x9c95435d +0, 36000, 152064, 0x8371b963 +0, 39600, 152064, 0xa0f1af67 +0, 43200, 152064, 0xf1155345 +0, 46800, 152064, 0x66a71c79 +0, 50400, 152064, 0x509db08a +0, 54000, 152064, 0x3d457728 +0, 57600, 152064, 0x66035e2b +0, 61200, 152064, 0xa4113115 +0, 64800, 152064, 0x3d35d3c0 +0, 68400, 152064, 0x5117d324 +0, 72000, 152064, 0x7b0c7660 +0, 75600, 152064, 0x0eacf9ba +0, 79200, 152064, 0x358d0486 +0, 82800, 152064, 0xc2dbeadc +0, 86400, 152064, 0x61b2c275 +0, 90000, 152064, 0xbb3697d2 +0, 93600, 152064, 0x44e58e8a +0, 97200, 152064, 0x21f6464f +0, 100800, 152064, 0xdb3416f2 +0, 104400, 152064, 0x8201d928 +0, 108000, 152064, 0x4fdfb595 +0, 111600, 152064, 0x28cff0a5 +0, 115200, 152064, 0x5d77cab2 +0, 118800, 152064, 0x2218b509 +0, 122400, 152064, 0xaf40790a +0, 126000, 152064, 0xaed42b3b +0, 129600, 152064, 0x866d2462 +0, 133200, 152064, 0x23a7111a +0, 136800, 152064, 0xceefc9d0 +0, 140400, 152064, 0x88dba819 +0, 144000, 152064, 0x19b350f3 +0, 147600, 152064, 0x85a857e5 +0, 151200, 152064, 0x02ca7c6f +0, 154800, 152064, 0xe2de12d0 +0, 158400, 152064, 0x84a36173 +0, 162000, 152064, 0xa8d1b139 +0, 165600, 152064, 0x6b72ab43 +0, 169200, 152064, 0x5fba909e +0, 172800, 152064, 0x43ab27f2 +0, 176400, 152064, 0x414cdd60 +0, 180000, 152064, 0x080fde7b +0, 183600, 152064, 0xb1b7e4db +0, 187200, 152064, 0xf17db2da +0, 190800, 152064, 0x248b88e9 +0, 194400, 152064, 0x6b68301b +0, 198000, 152064, 0xc581100d +0, 201600, 152064, 0x8e9cf443 +0, 205200, 152064, 0x3c4ec87a +0, 208800, 152064, 0x6e417a1f +0, 212400, 152064, 0x02c7ecc4 +0, 216000, 152064, 0xb7d7f1dc +0, 219600, 152064, 0xc44cf3fa +0, 223200, 152064, 0x0f8db331 +0, 226800, 152064, 0x71fe651b +0, 230400, 152064, 0xdd0b9b70 +0, 234000, 152064, 0x4f6114c3 +0, 237600, 152064, 0x5a64e819 +0, 241200, 152064, 0x20bce1a1 +0, 244800, 152064, 0x6b196d49 +0, 248400, 152064, 0x7c1535a6 +0, 252000, 152064, 0x9b5225a4 +0, 255600, 152064, 0x72c5f185 +0, 259200, 152064, 0x3da4f50d +0, 262800, 152064, 0xd7f7af48 +0, 266400, 152064, 0x0e1a8f2e +0, 270000, 152064, 0xb8b036cc +0, 273600, 152064, 0x003a2b62 +0, 277200, 152064, 0x7777f6bd +0, 280800, 152064, 0x91003021 +0, 284400, 152064, 0xb2e1af8c +0, 288000, 152064, 0xae6676bc +0, 291600, 152064, 0x72f55c98 +0, 295200, 152064, 0x9dfb52bc +0, 298800, 152064, 0x4b6b0db4 +0, 302400, 152064, 0xba8bab86 +0, 306000, 152064, 0x775a8da0 +0, 309600, 152064, 0x96a35194 +0, 313200, 152064, 0x17732a58 +0, 316800, 152064, 0x45eef560 +0, 320400, 152064, 0x95c79208 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvwp2_toshiba_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvwp2_toshiba_e new file mode 100644 index 00000000..4e904bc7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvwp2_toshiba_e @@ -0,0 +1,90 @@ +0, 0, 152064, 0xf503fb79 +0, 3600, 152064, 0xeaa4ba5d +0, 7200, 152064, 0x50865a33 +0, 10800, 152064, 0x34125f86 +0, 14400, 152064, 0xc5a8bb68 +0, 18000, 152064, 0xe6e9b376 +0, 21600, 152064, 0x4e41d48e +0, 25200, 152064, 0xea73cc5d +0, 28800, 152064, 0xc0c60ac0 +0, 32400, 152064, 0xd7110670 +0, 36000, 152064, 0x00465d0d +0, 39600, 152064, 0xa37a726b +0, 43200, 152064, 0x5dd13b2a +0, 46800, 152064, 0x08471f31 +0, 50400, 152064, 0x2bb2b055 +0, 54000, 152064, 0xd06d7f1c +0, 57600, 152064, 0x91fde84a +0, 61200, 152064, 0xdbb52d2b +0, 64800, 152064, 0x505c08b4 +0, 68400, 152064, 0xd8aeef9f +0, 72000, 152064, 0x4e3f8721 +0, 75600, 152064, 0xce534aee +0, 79200, 152064, 0x51f80737 +0, 82800, 152064, 0x8fa0e443 +0, 86400, 152064, 0xe8c9db17 +0, 90000, 152064, 0xc84bcee6 +0, 93600, 152064, 0xa7916158 +0, 97200, 152064, 0x16149c36 +0, 100800, 152064, 0xe55213fd +0, 104400, 152064, 0xa701e59d +0, 108000, 152064, 0xad65e200 +0, 111600, 152064, 0x4606dc82 +0, 115200, 152064, 0x582f9f64 +0, 118800, 152064, 0xc630662a +0, 122400, 152064, 0xe54bacf5 +0, 126000, 152064, 0x230e387f +0, 129600, 152064, 0x1a9c746c +0, 133200, 152064, 0xfa002d7c +0, 136800, 152064, 0xe617c4a9 +0, 140400, 152064, 0xd3a4df19 +0, 144000, 152064, 0x25b9ca8c +0, 147600, 152064, 0x0c505f7c +0, 151200, 152064, 0x43f84f88 +0, 154800, 152064, 0x859fb3af +0, 158400, 152064, 0x9680fc13 +0, 162000, 152064, 0x3fe6ecb6 +0, 165600, 152064, 0xf4c05a9c +0, 169200, 152064, 0x16ba3b13 +0, 172800, 152064, 0x72f33fb9 +0, 176400, 152064, 0x3076e567 +0, 180000, 152064, 0x4e69b604 +0, 183600, 152064, 0x9c37a98b +0, 187200, 152064, 0x0d5756c7 +0, 190800, 152064, 0xa4a46a81 +0, 194400, 152064, 0xadfc89d7 +0, 198000, 152064, 0x35693493 +0, 201600, 152064, 0xe3baedbf +0, 205200, 152064, 0x78cfb405 +0, 208800, 152064, 0xd85c7074 +0, 212400, 152064, 0x14ab350e +0, 216000, 152064, 0xaf55433e +0, 219600, 152064, 0x75a8e79f +0, 223200, 152064, 0x2fb599f6 +0, 226800, 152064, 0xbe30bdfe +0, 230400, 152064, 0x8b07a5ce +0, 234000, 152064, 0x99b32730 +0, 237600, 152064, 0x9265182d +0, 241200, 152064, 0x91e789fd +0, 244800, 152064, 0x1c1e6d16 +0, 248400, 152064, 0xfa06bdaa +0, 252000, 152064, 0x7177041f +0, 255600, 152064, 0xd902f99d +0, 259200, 152064, 0x29bdc134 +0, 262800, 152064, 0xd713ab76 +0, 266400, 152064, 0x60e4788e +0, 270000, 152064, 0xb18c7789 +0, 273600, 152064, 0x0b7829a5 +0, 277200, 152064, 0xf676d780 +0, 280800, 152064, 0xa88a3a57 +0, 284400, 152064, 0x825cf289 +0, 288000, 152064, 0x78928201 +0, 291600, 152064, 0x013a589c +0, 295200, 152064, 0x9269fa64 +0, 298800, 152064, 0x6db5f5fa +0, 302400, 152064, 0x49ad9d6a +0, 306000, 152064, 0x1b7c290f +0, 309600, 152064, 0x99716ad1 +0, 313200, 152064, 0x371527c2 +0, 316800, 152064, 0x9f351841 +0, 320400, 152064, 0x884bb432 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvwp3_toshiba_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvwp3_toshiba_e new file mode 100644 index 00000000..e78f2090 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvwp3_toshiba_e @@ -0,0 +1,90 @@ +0, 0, 152064, 0x3b3ffd31 +0, 3600, 152064, 0x14e0b899 +0, 7200, 152064, 0x50865a33 +0, 10800, 152064, 0x12e749e5 +0, 14400, 152064, 0xe5921130 +0, 18000, 152064, 0x2ca3b10d +0, 21600, 152064, 0xa9a39f04 +0, 25200, 152064, 0x2c78761a +0, 28800, 152064, 0x70890ad7 +0, 32400, 152064, 0x4fc30132 +0, 36000, 152064, 0x10e4d2c9 +0, 39600, 152064, 0xa3326b50 +0, 43200, 152064, 0x8e054bf1 +0, 46800, 152064, 0x5bd91687 +0, 50400, 152064, 0x70bab119 +0, 54000, 152064, 0x9a1ab472 +0, 57600, 152064, 0x490776a0 +0, 61200, 152064, 0xdbb52d2b +0, 64800, 152064, 0x142714b9 +0, 68400, 152064, 0xa051ee6f +0, 72000, 152064, 0xafa97fdf +0, 75600, 152064, 0x1ae67347 +0, 79200, 152064, 0xc4f42ed6 +0, 82800, 152064, 0x4445dc60 +0, 86400, 152064, 0xaef4d04b +0, 90000, 152064, 0x6a51be82 +0, 93600, 152064, 0x48356190 +0, 97200, 152064, 0xc09b5f5d +0, 100800, 152064, 0x933d3379 +0, 104400, 152064, 0xfb57e471 +0, 108000, 152064, 0xb5b2f45c +0, 111600, 152064, 0xce36e45e +0, 115200, 152064, 0x582f9f64 +0, 118800, 152064, 0x2f45b1fd +0, 122400, 152064, 0x90708fa0 +0, 126000, 152064, 0xee483b8f +0, 129600, 152064, 0xd2163e6c +0, 133200, 152064, 0x39492dfe +0, 136800, 152064, 0xf89cc57f +0, 140400, 152064, 0xbfc3c411 +0, 144000, 152064, 0x919eb007 +0, 147600, 152064, 0x2c526309 +0, 151200, 152064, 0x39f067a2 +0, 154800, 152064, 0xb7653abb +0, 158400, 152064, 0xe26a035c +0, 162000, 152064, 0xcef1eb3b +0, 165600, 152064, 0xb8b3c55f +0, 169200, 152064, 0x16ba3b13 +0, 172800, 152064, 0x153a3117 +0, 176400, 152064, 0x90a21859 +0, 180000, 152064, 0x9231b756 +0, 183600, 152064, 0x65fcbcb9 +0, 187200, 152064, 0x447eaf44 +0, 190800, 152064, 0xa26b6a8e +0, 194400, 152064, 0x100464f8 +0, 198000, 152064, 0x479648ec +0, 201600, 152064, 0x6742f51f +0, 205200, 152064, 0x14e9d906 +0, 208800, 152064, 0xa058ab87 +0, 212400, 152064, 0x8d093874 +0, 216000, 152064, 0xef7f2965 +0, 219600, 152064, 0x200d02bd +0, 223200, 152064, 0x2fb599f6 +0, 226800, 152064, 0xf65fb6e4 +0, 230400, 152064, 0x489a9152 +0, 234000, 152064, 0xbe8a2fc2 +0, 237600, 152064, 0xea04097e +0, 241200, 152064, 0xaf0cd627 +0, 244800, 152064, 0xc0a26b27 +0, 248400, 152064, 0x985f67e7 +0, 252000, 152064, 0x7d1b4c4c +0, 255600, 152064, 0x9908f838 +0, 259200, 152064, 0xb8fef131 +0, 262800, 152064, 0xb1feaf6c +0, 266400, 152064, 0x37b16bda +0, 270000, 152064, 0x242471aa +0, 273600, 152064, 0xf18c3839 +0, 277200, 152064, 0xf676d780 +0, 280800, 152064, 0x17bd0f76 +0, 284400, 152064, 0x3703e7a6 +0, 288000, 152064, 0x69ba8a8a +0, 291600, 152064, 0x205281b3 +0, 295200, 152064, 0x54bf51e1 +0, 298800, 152064, 0xf6daf8ed +0, 302400, 152064, 0x8728e805 +0, 306000, 152064, 0xe98cd2b0 +0, 309600, 152064, 0x7ef76e26 +0, 313200, 152064, 0x0fbf5230 +0, 316800, 152064, 0x9e4d104b +0, 320400, 152064, 0xd562b815 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvwp5_toshiba_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvwp5_toshiba_e new file mode 100644 index 00000000..30f69125 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-cvwp5_toshiba_e @@ -0,0 +1,90 @@ +0, 0, 152064, 0xabf9ae05 +0, 3600, 152064, 0x20418b16 +0, 7200, 152064, 0x20f72775 +0, 10800, 152064, 0x57c07111 +0, 14400, 152064, 0x1b49267f +0, 18000, 152064, 0x024cd238 +0, 21600, 152064, 0x044d1ae0 +0, 25200, 152064, 0xbfec1b59 +0, 28800, 152064, 0x1a91f935 +0, 32400, 152064, 0x9ee184dc +0, 36000, 152064, 0x65047dbe +0, 39600, 152064, 0xd1632fb5 +0, 43200, 152064, 0x56f64c3e +0, 46800, 152064, 0xe6122f37 +0, 50400, 152064, 0x0575e670 +0, 54000, 152064, 0x3d457728 +0, 57600, 152064, 0x6b508105 +0, 61200, 152064, 0xcaaf5ea7 +0, 64800, 152064, 0x9f4e4501 +0, 68400, 152064, 0x1c661a73 +0, 72000, 152064, 0x2fd9d1c8 +0, 75600, 152064, 0x4ac99ab1 +0, 79200, 152064, 0xf2d36809 +0, 82800, 152064, 0xa8e32ffb +0, 86400, 152064, 0xd4da2fd2 +0, 90000, 152064, 0xac3adde0 +0, 93600, 152064, 0xf014ed0f +0, 97200, 152064, 0xca2e7d28 +0, 100800, 152064, 0x3a875e51 +0, 104400, 152064, 0xc03e4bda +0, 108000, 152064, 0x4fdfb595 +0, 111600, 152064, 0x9243f098 +0, 115200, 152064, 0x9361bae6 +0, 118800, 152064, 0x7a1dadee +0, 122400, 152064, 0x72a59e15 +0, 126000, 152064, 0xb5b47170 +0, 129600, 152064, 0x5eb16651 +0, 133200, 152064, 0xe7894af7 +0, 136800, 152064, 0x2683bb0b +0, 140400, 152064, 0x90b4c8c5 +0, 144000, 152064, 0xf800c5b5 +0, 147600, 152064, 0xc2f5a895 +0, 151200, 152064, 0x213c65d4 +0, 154800, 152064, 0x01c65a19 +0, 158400, 152064, 0xd9f1b04b +0, 162000, 152064, 0xa8d1b139 +0, 165600, 152064, 0x2d0cb0cd +0, 169200, 152064, 0x5b0783fe +0, 172800, 152064, 0x29e628ec +0, 176400, 152064, 0x1b8527e5 +0, 180000, 152064, 0x4b46d179 +0, 183600, 152064, 0x6184c708 +0, 187200, 152064, 0x697bb8e2 +0, 190800, 152064, 0x5fd3a772 +0, 194400, 152064, 0x91456c86 +0, 198000, 152064, 0x376c4dae +0, 201600, 152064, 0x00ba2b3f +0, 205200, 152064, 0xf6f0f553 +0, 208800, 152064, 0xc0020855 +0, 212400, 152064, 0xec3d13d2 +0, 216000, 152064, 0xb7d7f1dc +0, 219600, 152064, 0xf9dae37b +0, 223200, 152064, 0x50d9cc93 +0, 226800, 152064, 0xba1eb592 +0, 230400, 152064, 0x67616557 +0, 234000, 152064, 0x09804760 +0, 237600, 152064, 0xc2ffba00 +0, 241200, 152064, 0xb71fcf46 +0, 244800, 152064, 0x6cd975af +0, 248400, 152064, 0x19189167 +0, 252000, 152064, 0xbca8fe71 +0, 255600, 152064, 0xb0b3f607 +0, 259200, 152064, 0x7614d73a +0, 262800, 152064, 0x7de9d87d +0, 266400, 152064, 0x81f58cf2 +0, 270000, 152064, 0xb8b036cc +0, 273600, 152064, 0x26d1e2e4 +0, 277200, 152064, 0xb41a1e6c +0, 280800, 152064, 0x4f9be4a9 +0, 284400, 152064, 0xe95ad5d3 +0, 288000, 152064, 0xdffc9335 +0, 291600, 152064, 0x01d658c0 +0, 295200, 152064, 0x631b4b75 +0, 298800, 152064, 0x80ae282f +0, 302400, 152064, 0xb34bf688 +0, 306000, 152064, 0xd0cc7d65 +0, 309600, 152064, 0x86aa4590 +0, 313200, 152064, 0xcb515a57 +0, 316800, 152064, 0x68650834 +0, 320400, 152064, 0x444ee2a4 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-fi1_sony_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-fi1_sony_e new file mode 100644 index 00000000..5b7f4c88 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-fi1_sony_e @@ -0,0 +1,17 @@ +0, 0, 36864, 0x3d54d3e3 +0, 3600, 36864, 0xa9573ef0 +0, 7200, 36864, 0x0ea5f263 +0, 10800, 36864, 0x5a849fb9 +0, 14400, 36864, 0x7ddb1eff +0, 18000, 36864, 0x5e73e3b7 +0, 21600, 36864, 0x7d50d329 +0, 25200, 36864, 0xf2c2cd27 +0, 28800, 36864, 0xdf4f4628 +0, 32400, 36864, 0xddd6d5be +0, 36000, 36864, 0xb530e1aa +0, 39600, 36864, 0xeca42470 +0, 43200, 36864, 0xa5701caf +0, 46800, 36864, 0x6f5d28fc +0, 50400, 36864, 0xd4ab4ab2 +0, 54000, 36864, 0xf2dfcc22 +0, 57600, 36864, 0xcaa87e79 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-alphaconformanceg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-alphaconformanceg new file mode 100644 index 00000000..02a72742 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-alphaconformanceg @@ -0,0 +1,43 @@ +0, 0, 783360, 0xbc458a9a +0, 3600, 783360, 0xc2b4a765 +0, 7200, 783360, 0x40a8ca87 +0, 10800, 783360, 0xdd0cbc2c +0, 14400, 783360, 0xecf8e434 +0, 18000, 783360, 0xcc87e3d4 +0, 21600, 783360, 0x386e1a34 +0, 25200, 783360, 0x6ac4a62e +0, 28800, 783360, 0xf23d89bb +0, 32400, 783360, 0x52f7b94c +0, 36000, 783360, 0x2b4ea2c2 +0, 39600, 783360, 0x0a43839c +0, 43200, 783360, 0xad4b81ea +0, 46800, 783360, 0xcb4fe0d4 +0, 50400, 783360, 0x6c3ca755 +0, 54000, 783360, 0x17d37f49 +0, 57600, 783360, 0x8fdfebec +0, 61200, 783360, 0x1a177b49 +0, 64800, 783360, 0x72d230ad +0, 68400, 783360, 0x62147d69 +0, 72000, 783360, 0xeed9b62c +0, 75600, 783360, 0x7fc45b23 +0, 79200, 783360, 0x5dc60681 +0, 82800, 783360, 0x2d91c001 +0, 86400, 783360, 0x259ab608 +0, 90000, 783360, 0x29112b29 +0, 93600, 783360, 0x7e4d497e +0, 97200, 783360, 0x616e5507 +0, 100800, 783360, 0x299473c9 +0, 104400, 783360, 0x4d63d722 +0, 108000, 783360, 0xa89e4bc6 +0, 111600, 783360, 0xbdef585a +0, 115200, 783360, 0x5b12c72c +0, 118800, 783360, 0x5a884bd8 +0, 122400, 783360, 0x97728ade +0, 126000, 783360, 0x27dd8999 +0, 129600, 783360, 0x94104d66 +0, 133200, 783360, 0xf30244f1 +0, 136800, 783360, 0xfc98c63e +0, 140400, 783360, 0x8b27de2e +0, 144000, 783360, 0xfc6bbbf2 +0, 147600, 783360, 0x4527b6a3 +0, 151200, 783360, 0x4070daf0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-bcrm_freh10 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-bcrm_freh10 new file mode 100644 index 00000000..252214eb --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-bcrm_freh10 @@ -0,0 +1,100 @@ +0, 0, 152064, 0xbdc2b880 +0, 3600, 152064, 0x4ebf93fe +0, 7200, 152064, 0xe30d6871 +0, 10800, 152064, 0x04f46b9b +0, 14400, 152064, 0xd7dd219a +0, 18000, 152064, 0x02fc6511 +0, 21600, 152064, 0x98868faa +0, 25200, 152064, 0x54b94f92 +0, 28800, 152064, 0xe3b6be4b +0, 32400, 152064, 0xf148cf10 +0, 36000, 152064, 0xda3239b8 +0, 39600, 152064, 0x6c5d7331 +0, 43200, 152064, 0x825f1fea +0, 46800, 152064, 0x47791056 +0, 50400, 152064, 0xc08e8a58 +0, 54000, 152064, 0x020299f3 +0, 57600, 152064, 0x0dfd4457 +0, 61200, 152064, 0xcf005e68 +0, 64800, 152064, 0x1f9e2c32 +0, 68400, 152064, 0xa8359324 +0, 72000, 152064, 0x4b03752d +0, 75600, 152064, 0xd6281621 +0, 79200, 152064, 0xc97ac928 +0, 82800, 152064, 0xded90dcd +0, 86400, 152064, 0xd6883255 +0, 90000, 152064, 0x6edb4d4f +0, 93600, 152064, 0xd6f93a80 +0, 97200, 152064, 0x163d6153 +0, 100800, 152064, 0x04b90c06 +0, 104400, 152064, 0xee8730c1 +0, 108000, 152064, 0xd5f5c669 +0, 111600, 152064, 0xcc600b1f +0, 115200, 152064, 0x15ddde03 +0, 118800, 152064, 0xd0388dd0 +0, 122400, 152064, 0xa292ab7d +0, 126000, 152064, 0xacf584e9 +0, 129600, 152064, 0xcef42714 +0, 133200, 152064, 0xeb162f35 +0, 136800, 152064, 0x0a07de7b +0, 140400, 152064, 0x7ae76c81 +0, 144000, 152064, 0x139c8fda +0, 147600, 152064, 0x43724411 +0, 151200, 152064, 0x07b2ddea +0, 154800, 152064, 0x831a1cc7 +0, 158400, 152064, 0x092f5073 +0, 162000, 152064, 0xe5b6d380 +0, 165600, 152064, 0xdd30d69e +0, 169200, 152064, 0x887020b2 +0, 172800, 152064, 0x84436510 +0, 176400, 152064, 0x49f63606 +0, 180000, 152064, 0x6b96e959 +0, 183600, 152064, 0xc6247cc7 +0, 187200, 152064, 0x7a67c532 +0, 190800, 152064, 0x93f4c476 +0, 194400, 152064, 0x3c119654 +0, 198000, 152064, 0xa45f7c72 +0, 201600, 152064, 0x2ac50cb0 +0, 205200, 152064, 0x9bf16d06 +0, 208800, 152064, 0xfa0750d9 +0, 212400, 152064, 0x02197630 +0, 216000, 152064, 0x6d44f9b5 +0, 219600, 152064, 0x86b211f5 +0, 223200, 152064, 0xf4fda5d0 +0, 226800, 152064, 0x36f840a7 +0, 230400, 152064, 0x42412992 +0, 234000, 152064, 0xd0c9ba37 +0, 237600, 152064, 0xc40eba62 +0, 241200, 152064, 0x2d093b53 +0, 244800, 152064, 0xee39c69c +0, 248400, 152064, 0xcbbf8968 +0, 252000, 152064, 0xfddc1704 +0, 255600, 152064, 0x8dc47c61 +0, 259200, 152064, 0xf15580bf +0, 262800, 152064, 0x9c71a8b0 +0, 266400, 152064, 0x19b90b9f +0, 270000, 152064, 0xb65ae287 +0, 273600, 152064, 0xf265693d +0, 277200, 152064, 0x721714a1 +0, 280800, 152064, 0x383e8ac5 +0, 284400, 152064, 0x02558677 +0, 288000, 152064, 0xdaab3cdf +0, 291600, 152064, 0xc939a2f6 +0, 295200, 152064, 0x977afa7f +0, 298800, 152064, 0xe5e65f35 +0, 302400, 152064, 0x247546fa +0, 306000, 152064, 0x49ff2094 +0, 309600, 152064, 0x9fd58cda +0, 313200, 152064, 0x3e31b6e3 +0, 316800, 152064, 0x75c6d796 +0, 320400, 152064, 0x4ab3e7bb +0, 324000, 152064, 0x393935ea +0, 327600, 152064, 0xc8e62905 +0, 331200, 152064, 0xbb149e61 +0, 334800, 152064, 0x2553c4c5 +0, 338400, 152064, 0x7f82a8b4 +0, 342000, 152064, 0x26ef31e6 +0, 345600, 152064, 0xf029744a +0, 349200, 152064, 0x0a6f191a +0, 352800, 152064, 0x55808643 +0, 356400, 152064, 0x27576172 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh11 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh11 new file mode 100644 index 00000000..fa2e708d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh11 @@ -0,0 +1,100 @@ +0, 0, 152064, 0x9744ac59 +0, 3600, 152064, 0x3eba88bf +0, 7200, 152064, 0xd4105c5a +0, 10800, 152064, 0x452966a3 +0, 14400, 152064, 0x30071add +0, 18000, 152064, 0x0eb75245 +0, 21600, 152064, 0x4daa80fa +0, 25200, 152064, 0xf53a43a1 +0, 28800, 152064, 0xa55ab43d +0, 32400, 152064, 0x915ec82e +0, 36000, 152064, 0xadce2f9a +0, 39600, 152064, 0xf7a25715 +0, 43200, 152064, 0x90c91c7d +0, 46800, 152064, 0x4f0df4ef +0, 50400, 152064, 0xf6e0783c +0, 54000, 152064, 0x417c8ca8 +0, 57600, 152064, 0xd33d29d8 +0, 61200, 152064, 0xc9723fa3 +0, 64800, 152064, 0x3e4f22f4 +0, 68400, 152064, 0xd5aa7bd8 +0, 72000, 152064, 0x2a425b54 +0, 75600, 152064, 0x2d400788 +0, 79200, 152064, 0x12fab3a4 +0, 82800, 152064, 0x5544f881 +0, 86400, 152064, 0xd0612cc5 +0, 90000, 152064, 0x157b3654 +0, 93600, 152064, 0x04b61fe0 +0, 97200, 152064, 0x897d600a +0, 100800, 152064, 0x0d94fa29 +0, 104400, 152064, 0xc0fe249d +0, 108000, 152064, 0x65abc1d6 +0, 111600, 152064, 0x2bd5f09d +0, 115200, 152064, 0xd3eebd28 +0, 118800, 152064, 0x93458649 +0, 122400, 152064, 0x55e793a6 +0, 126000, 152064, 0x9fc378ce +0, 129600, 152064, 0x24c32731 +0, 133200, 152064, 0x3c321c50 +0, 136800, 152064, 0xcef3ca8b +0, 140400, 152064, 0x97116676 +0, 144000, 152064, 0x73ae78f6 +0, 147600, 152064, 0xdeec219e +0, 151200, 152064, 0xc061d584 +0, 154800, 152064, 0xcf47f6c9 +0, 158400, 152064, 0x280d3a2d +0, 162000, 152064, 0xb660c846 +0, 165600, 152064, 0xe167c588 +0, 169200, 152064, 0x08f808de +0, 172800, 152064, 0x9de65c0b +0, 176400, 152064, 0xc52a1937 +0, 180000, 152064, 0xf5a4d86f +0, 183600, 152064, 0xbef86d37 +0, 187200, 152064, 0xa227b21b +0, 190800, 152064, 0x0601ad35 +0, 194400, 152064, 0x15198730 +0, 198000, 152064, 0x9af764c6 +0, 201600, 152064, 0x1a95e99a +0, 205200, 152064, 0x6bef5aa8 +0, 208800, 152064, 0x92f03267 +0, 212400, 152064, 0x0a3d56cb +0, 216000, 152064, 0xd9c9f62e +0, 219600, 152064, 0xcd81ea16 +0, 223200, 152064, 0x8ed789c0 +0, 226800, 152064, 0x5a5e356f +0, 230400, 152064, 0x2f260ebf +0, 234000, 152064, 0xa0379c89 +0, 237600, 152064, 0x100cb40c +0, 241200, 152064, 0xaad2220a +0, 244800, 152064, 0xec82aa8d +0, 248400, 152064, 0x91088303 +0, 252000, 152064, 0x0cce0e9e +0, 255600, 152064, 0xf3bc716a +0, 259200, 152064, 0x989879c5 +0, 262800, 152064, 0x491297a0 +0, 266400, 152064, 0xdc16f30d +0, 270000, 152064, 0xb9bfdd57 +0, 273600, 152064, 0x5fba59c2 +0, 277200, 152064, 0x89c40529 +0, 280800, 152064, 0x1b3e7b54 +0, 284400, 152064, 0x5d0d7903 +0, 288000, 152064, 0x2e3434e1 +0, 291600, 152064, 0x1f47a276 +0, 295200, 152064, 0xa22de2b1 +0, 298800, 152064, 0x77344844 +0, 302400, 152064, 0x6a6b3fce +0, 306000, 152064, 0x82660651 +0, 309600, 152064, 0x51e67cc9 +0, 313200, 152064, 0xb790ae51 +0, 316800, 152064, 0x906bc6b6 +0, 320400, 152064, 0x55c5dc21 +0, 324000, 152064, 0xb51f3004 +0, 327600, 152064, 0x68500a25 +0, 331200, 152064, 0x5dbc812e +0, 334800, 152064, 0x895eb6ed +0, 338400, 152064, 0x2f5594fc +0, 342000, 152064, 0x04a222a9 +0, 345600, 152064, 0x90036f6a +0, 349200, 152064, 0x8b8b064c +0, 352800, 152064, 0xd47c7334 +0, 356400, 152064, 0x13f06213 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh3 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh3 new file mode 100644 index 00000000..4a567102 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh3 @@ -0,0 +1,100 @@ +0, 0, 152064, 0x9f9caf3c +0, 3600, 152064, 0x4e8e9dc4 +0, 7200, 152064, 0x7eab62be +0, 10800, 152064, 0x79de6e48 +0, 14400, 152064, 0x6bb843f3 +0, 18000, 152064, 0xd0e96c36 +0, 21600, 152064, 0x061a9036 +0, 25200, 152064, 0x342c42ea +0, 28800, 152064, 0x9835cfc3 +0, 32400, 152064, 0x129ed3dd +0, 36000, 152064, 0x81413cf7 +0, 39600, 152064, 0xcd16539e +0, 43200, 152064, 0x927728cd +0, 46800, 152064, 0x5ebd1126 +0, 50400, 152064, 0x9ad29eb3 +0, 54000, 152064, 0x0ae5a447 +0, 57600, 152064, 0xaf275266 +0, 61200, 152064, 0x98f96209 +0, 64800, 152064, 0x5fcf241f +0, 68400, 152064, 0x17507ee5 +0, 72000, 152064, 0xb4ad5f2d +0, 75600, 152064, 0x02fff6da +0, 79200, 152064, 0x8726c662 +0, 82800, 152064, 0x8ca707d5 +0, 86400, 152064, 0xe41f3946 +0, 90000, 152064, 0xc7b34d1e +0, 93600, 152064, 0x25146571 +0, 97200, 152064, 0xeb4868f4 +0, 100800, 152064, 0xd0fe149d +0, 104400, 152064, 0x31043d0a +0, 108000, 152064, 0xdaf2ba1c +0, 111600, 152064, 0xb474076c +0, 115200, 152064, 0x0cf7f1a2 +0, 118800, 152064, 0x2e427793 +0, 122400, 152064, 0x08d9a655 +0, 126000, 152064, 0x79bc8fc9 +0, 129600, 152064, 0xb9871e5c +0, 133200, 152064, 0xca1246df +0, 136800, 152064, 0x08c8d524 +0, 140400, 152064, 0xb9be5ecb +0, 144000, 152064, 0x807f87f0 +0, 147600, 152064, 0x72eb3ab2 +0, 151200, 152064, 0xf463d15f +0, 154800, 152064, 0x857d0471 +0, 158400, 152064, 0x5dda5ede +0, 162000, 152064, 0xec33b550 +0, 165600, 152064, 0x2217b9bb +0, 169200, 152064, 0x060b0fa4 +0, 172800, 152064, 0x5a785b49 +0, 176400, 152064, 0x6969268b +0, 180000, 152064, 0xe145d3a4 +0, 183600, 152064, 0xb7256e99 +0, 187200, 152064, 0x5bbebf16 +0, 190800, 152064, 0x9234b31e +0, 194400, 152064, 0x9f0f8c7e +0, 198000, 152064, 0x15e271c4 +0, 201600, 152064, 0xe8110297 +0, 205200, 152064, 0x1a4364f3 +0, 208800, 152064, 0xb7b336f8 +0, 212400, 152064, 0x31657acb +0, 216000, 152064, 0xd8e1de00 +0, 219600, 152064, 0x9a57117a +0, 223200, 152064, 0xfb828be8 +0, 226800, 152064, 0x30bf2ab7 +0, 230400, 152064, 0xaf840b27 +0, 234000, 152064, 0x900cbcd4 +0, 237600, 152064, 0x6439acfc +0, 241200, 152064, 0x716036fd +0, 244800, 152064, 0xc3d9baa8 +0, 248400, 152064, 0x455f7d1f +0, 252000, 152064, 0x84c10d78 +0, 255600, 152064, 0x2cd76642 +0, 259200, 152064, 0x5c746b3a +0, 262800, 152064, 0x92e39e7d +0, 266400, 152064, 0xae610df8 +0, 270000, 152064, 0xc8bac3fa +0, 273600, 152064, 0x04be8a35 +0, 277200, 152064, 0xaaf91b17 +0, 280800, 152064, 0x5afa8764 +0, 284400, 152064, 0x31828a12 +0, 288000, 152064, 0xf1bd3da9 +0, 291600, 152064, 0xbbb2aaef +0, 295200, 152064, 0xcf69efa1 +0, 298800, 152064, 0x54e85e1b +0, 302400, 152064, 0x89ff3a1a +0, 306000, 152064, 0x86c80511 +0, 309600, 152064, 0x41c886f2 +0, 313200, 152064, 0x9f2ebd74 +0, 316800, 152064, 0x74d3d0e0 +0, 320400, 152064, 0xc79501cc +0, 324000, 152064, 0x123e23e2 +0, 327600, 152064, 0xb6122ea0 +0, 331200, 152064, 0x551f95df +0, 334800, 152064, 0x0652ac2d +0, 338400, 152064, 0x6483a8ad +0, 342000, 152064, 0x7f632ae2 +0, 345600, 152064, 0xae74622f +0, 349200, 152064, 0xdd411339 +0, 352800, 152064, 0xff0e7f69 +0, 356400, 152064, 0x8b3a5933 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh4 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh4 new file mode 100644 index 00000000..8f0305a3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh4 @@ -0,0 +1,100 @@ +0, 0, 152064, 0x9744ac59 +0, 3600, 152064, 0xe1c69d97 +0, 7200, 152064, 0x9ae85f93 +0, 10800, 152064, 0x452966a3 +0, 14400, 152064, 0xe8192823 +0, 18000, 152064, 0x58b764eb +0, 21600, 152064, 0x51b686b1 +0, 25200, 152064, 0x4bca5822 +0, 28800, 152064, 0x29abc41c +0, 32400, 152064, 0x850ec94f +0, 36000, 152064, 0xac2c34f8 +0, 39600, 152064, 0x080c6e67 +0, 43200, 152064, 0x5e4e14d2 +0, 46800, 152064, 0x978b054c +0, 50400, 152064, 0x861d8c3c +0, 54000, 152064, 0xe0818918 +0, 57600, 152064, 0x8b834511 +0, 61200, 152064, 0x223f567c +0, 64800, 152064, 0x6d61298d +0, 68400, 152064, 0xfe30826e +0, 72000, 152064, 0x4bad4f98 +0, 75600, 152064, 0x69d5fdca +0, 79200, 152064, 0xe45bba1b +0, 82800, 152064, 0xa6d81298 +0, 86400, 152064, 0x7f3f2c91 +0, 90000, 152064, 0x658754b9 +0, 93600, 152064, 0x2c6d3eba +0, 97200, 152064, 0x4500600c +0, 100800, 152064, 0xa745f74b +0, 104400, 152064, 0x2bf21fca +0, 108000, 152064, 0x08b8bdb3 +0, 111600, 152064, 0x5a9d0a8b +0, 115200, 152064, 0x3a57d523 +0, 118800, 152064, 0x3606826e +0, 122400, 152064, 0x3b91a8fb +0, 126000, 152064, 0x37c28959 +0, 129600, 152064, 0xb51d1e75 +0, 133200, 152064, 0x13be3f58 +0, 136800, 152064, 0x0ed0e7cf +0, 140400, 152064, 0x298560d4 +0, 144000, 152064, 0x62b68373 +0, 147600, 152064, 0xf8bb4520 +0, 151200, 152064, 0x90dfd6af +0, 154800, 152064, 0xf4770d20 +0, 158400, 152064, 0x0d9549a0 +0, 162000, 152064, 0x004eccb1 +0, 165600, 152064, 0x3146d46b +0, 169200, 152064, 0x078d1808 +0, 172800, 152064, 0x5d8d60cd +0, 176400, 152064, 0x8ff52dd8 +0, 180000, 152064, 0x5aa3ccf7 +0, 183600, 152064, 0x5bec6c39 +0, 187200, 152064, 0xd44cae9d +0, 190800, 152064, 0xa1b0a151 +0, 194400, 152064, 0xe3be7bb2 +0, 198000, 152064, 0x50096775 +0, 201600, 152064, 0xdffff851 +0, 205200, 152064, 0x1d7250eb +0, 208800, 152064, 0x69663ca7 +0, 212400, 152064, 0x62f77fc7 +0, 216000, 152064, 0xbab8f471 +0, 219600, 152064, 0x6af31785 +0, 223200, 152064, 0xcbb2a9aa +0, 226800, 152064, 0xc57c32b9 +0, 230400, 152064, 0xecbe2ce0 +0, 234000, 152064, 0x2fbebf81 +0, 237600, 152064, 0xa168af68 +0, 241200, 152064, 0x1e5631ac +0, 244800, 152064, 0xe69fc927 +0, 248400, 152064, 0x8e5c81d8 +0, 252000, 152064, 0x42402010 +0, 255600, 152064, 0xd7267482 +0, 259200, 152064, 0x64b280df +0, 262800, 152064, 0xc4cbafcc +0, 266400, 152064, 0xcf2f1e8b +0, 270000, 152064, 0x4d6fdb3f +0, 273600, 152064, 0xf22d6fed +0, 277200, 152064, 0x625b167c +0, 280800, 152064, 0x41348089 +0, 284400, 152064, 0x6db2779b +0, 288000, 152064, 0xe87030a8 +0, 291600, 152064, 0x91b29cdd +0, 295200, 152064, 0xe824f242 +0, 298800, 152064, 0xac995380 +0, 302400, 152064, 0x7efe361b +0, 306000, 152064, 0xe10c0c26 +0, 309600, 152064, 0x93108260 +0, 313200, 152064, 0xbf4caed7 +0, 316800, 152064, 0xb6a4d826 +0, 320400, 152064, 0x78beea4e +0, 324000, 152064, 0xdf612df9 +0, 327600, 152064, 0xa9ef2830 +0, 331200, 152064, 0x06448895 +0, 334800, 152064, 0x332eb6d5 +0, 338400, 152064, 0x935ba2c5 +0, 342000, 152064, 0x62a22656 +0, 345600, 152064, 0x06a670a7 +0, 349200, 152064, 0xf60b1af0 +0, 352800, 152064, 0x85177c10 +0, 356400, 152064, 0x5e4e5c4b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh5 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh5 new file mode 100644 index 00000000..dc7efef6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh5 @@ -0,0 +1,100 @@ +0, 0, 152064, 0xd816ae9a +0, 3600, 152064, 0x970e9c33 +0, 7200, 152064, 0xbdd14635 +0, 10800, 152064, 0x103f667c +0, 14400, 152064, 0x752b1ebb +0, 18000, 152064, 0x1e9d59d4 +0, 21600, 152064, 0x4b9d89b6 +0, 25200, 152064, 0x16c1362e +0, 28800, 152064, 0x3ea9a977 +0, 32400, 152064, 0x24e3c7fe +0, 36000, 152064, 0xe64132fa +0, 39600, 152064, 0xb2074e31 +0, 43200, 152064, 0x87e61824 +0, 46800, 152064, 0xf3e7f2d3 +0, 50400, 152064, 0x36856b98 +0, 54000, 152064, 0xe2be97dd +0, 57600, 152064, 0xb99a3a3d +0, 61200, 152064, 0xf4d04afa +0, 64800, 152064, 0x20a92205 +0, 68400, 152064, 0x5f6272ca +0, 72000, 152064, 0xe1f45d11 +0, 75600, 152064, 0x7ff113ee +0, 79200, 152064, 0x47e8befb +0, 82800, 152064, 0x562c03c6 +0, 86400, 152064, 0x197a311c +0, 90000, 152064, 0x30017402 +0, 93600, 152064, 0x27e6384e +0, 97200, 152064, 0x456f6152 +0, 100800, 152064, 0x368810d1 +0, 104400, 152064, 0x7be61b5f +0, 108000, 152064, 0x5fa9aaef +0, 111600, 152064, 0x957de9da +0, 115200, 152064, 0x47c6bc4f +0, 118800, 152064, 0xb2247b98 +0, 122400, 152064, 0xd045a416 +0, 126000, 152064, 0xa0b16da9 +0, 129600, 152064, 0xe9bd1d8f +0, 133200, 152064, 0xe7881f4d +0, 136800, 152064, 0x85e2d4a9 +0, 140400, 152064, 0x00a967cd +0, 144000, 152064, 0x02507278 +0, 147600, 152064, 0xc511370e +0, 151200, 152064, 0x7963cf0b +0, 154800, 152064, 0xf99ef0fd +0, 158400, 152064, 0x00813540 +0, 162000, 152064, 0xa9aeaf2b +0, 165600, 152064, 0x559eb849 +0, 169200, 152064, 0x315605c1 +0, 172800, 152064, 0xe2594b7c +0, 176400, 152064, 0x844ef85c +0, 180000, 152064, 0x5012c785 +0, 183600, 152064, 0x239f600d +0, 187200, 152064, 0x80a2a156 +0, 190800, 152064, 0xec239895 +0, 194400, 152064, 0xd7387dbe +0, 198000, 152064, 0xe8aa6125 +0, 201600, 152064, 0x4742d997 +0, 205200, 152064, 0x88515422 +0, 208800, 152064, 0x3dd02167 +0, 212400, 152064, 0xe36855d1 +0, 216000, 152064, 0x202edeb9 +0, 219600, 152064, 0xf5a5eed3 +0, 223200, 152064, 0xd3bc6e68 +0, 226800, 152064, 0xba902a0a +0, 230400, 152064, 0x4db4f721 +0, 234000, 152064, 0x293c90bd +0, 237600, 152064, 0xa651a49f +0, 241200, 152064, 0x5c1a2a7d +0, 244800, 152064, 0xa67986de +0, 248400, 152064, 0xe5fe7d26 +0, 252000, 152064, 0xde191b31 +0, 255600, 152064, 0x5e303cb1 +0, 259200, 152064, 0x657f6d5d +0, 262800, 152064, 0x5c44adaa +0, 266400, 152064, 0x8c3c0422 +0, 270000, 152064, 0x161cb54f +0, 273600, 152064, 0xc96355c8 +0, 277200, 152064, 0xeb02fdec +0, 280800, 152064, 0xd18a7989 +0, 284400, 152064, 0xc7d671bf +0, 288000, 152064, 0x2e1637cc +0, 291600, 152064, 0xd0d5958a +0, 295200, 152064, 0x2f9dd79c +0, 298800, 152064, 0xa96b4dd1 +0, 302400, 152064, 0x7bfc2eb9 +0, 306000, 152064, 0xc3c91809 +0, 309600, 152064, 0x9e167aa3 +0, 313200, 152064, 0xb47e9f6e +0, 316800, 152064, 0x70e6c184 +0, 320400, 152064, 0x0d92e4e7 +0, 324000, 152064, 0xf4891b11 +0, 327600, 152064, 0x93f912c7 +0, 331200, 152064, 0xa3bc52c5 +0, 334800, 152064, 0xc6fca440 +0, 338400, 152064, 0x045aa5d4 +0, 342000, 152064, 0x15ba1dd0 +0, 345600, 152064, 0x59f45a8b +0, 349200, 152064, 0x9dc20832 +0, 352800, 152064, 0x36316eb4 +0, 356400, 152064, 0x28ba54f4 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh8 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh8 new file mode 100644 index 00000000..69a55e1b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh8 @@ -0,0 +1,100 @@ +0, 0, 152064, 0xdcc4ac76 +0, 3600, 152064, 0xfde6871a +0, 7200, 152064, 0xe8a351b5 +0, 10800, 152064, 0x0e586608 +0, 14400, 152064, 0xbe3c2adc +0, 18000, 152064, 0x244a5b3c +0, 21600, 152064, 0x7cad919e +0, 25200, 152064, 0x24c452c0 +0, 28800, 152064, 0x089dc7f0 +0, 32400, 152064, 0x6ee5d1dd +0, 36000, 152064, 0x177430f0 +0, 39600, 152064, 0xf2af65f6 +0, 43200, 152064, 0x4c4626a7 +0, 46800, 152064, 0x897af1da +0, 50400, 152064, 0xf16199b1 +0, 54000, 152064, 0x2979a469 +0, 57600, 152064, 0x5ce345a0 +0, 61200, 152064, 0x1a044ff3 +0, 64800, 152064, 0x9075241f +0, 68400, 152064, 0xd1457558 +0, 72000, 152064, 0xdfe3669f +0, 75600, 152064, 0x4961fc7a +0, 79200, 152064, 0xb84daee5 +0, 82800, 152064, 0xc4efe5c3 +0, 86400, 152064, 0x35f73410 +0, 90000, 152064, 0xf99a2c73 +0, 93600, 152064, 0xe5c12391 +0, 97200, 152064, 0xc2056236 +0, 100800, 152064, 0xce2bff90 +0, 104400, 152064, 0x01d92bb1 +0, 108000, 152064, 0xc55eb558 +0, 111600, 152064, 0xf02ef0ff +0, 115200, 152064, 0x069dd1c6 +0, 118800, 152064, 0x49718229 +0, 122400, 152064, 0x0e9ea401 +0, 126000, 152064, 0x307e7f8b +0, 129600, 152064, 0xf5071e31 +0, 133200, 152064, 0xac2c2ad0 +0, 136800, 152064, 0x5586d665 +0, 140400, 152064, 0xa62a6a2b +0, 144000, 152064, 0xff167d1b +0, 147600, 152064, 0x02d225c2 +0, 151200, 152064, 0x868ccb0b +0, 154800, 152064, 0x36edfa29 +0, 158400, 152064, 0xb6244864 +0, 162000, 152064, 0xd891b5dc +0, 165600, 152064, 0x9246b763 +0, 169200, 152064, 0xea240b61 +0, 172800, 152064, 0x2d985877 +0, 176400, 152064, 0xe6b92603 +0, 180000, 152064, 0x102ac84f +0, 183600, 152064, 0xddaf709b +0, 187200, 152064, 0x48dfb25e +0, 190800, 152064, 0xf2acadbb +0, 194400, 152064, 0x647685f5 +0, 198000, 152064, 0x893874c9 +0, 201600, 152064, 0xdfd7ed77 +0, 205200, 152064, 0x97b36277 +0, 208800, 152064, 0x59f33282 +0, 212400, 152064, 0xba5c6a0e +0, 216000, 152064, 0x7856ddf0 +0, 219600, 152064, 0x74e5f095 +0, 223200, 152064, 0x76167a60 +0, 226800, 152064, 0xa6cf2255 +0, 230400, 152064, 0x9f8b1446 +0, 234000, 152064, 0xa775aa79 +0, 237600, 152064, 0x5662a698 +0, 241200, 152064, 0xe6321e5b +0, 244800, 152064, 0xdaea9a83 +0, 248400, 152064, 0xd89d835f +0, 252000, 152064, 0x0b1503e2 +0, 255600, 152064, 0x7fef6395 +0, 259200, 152064, 0xc27273f2 +0, 262800, 152064, 0xff9288fd +0, 266400, 152064, 0xb76aee35 +0, 270000, 152064, 0xbd0dc4b2 +0, 273600, 152064, 0x3085598e +0, 277200, 152064, 0x22e408f6 +0, 280800, 152064, 0xc054866d +0, 284400, 152064, 0x881377f8 +0, 288000, 152064, 0x0dd7311e +0, 291600, 152064, 0x627ea688 +0, 295200, 152064, 0x95bbe693 +0, 298800, 152064, 0x806c480f +0, 302400, 152064, 0x6feb3d47 +0, 306000, 152064, 0x639f0a72 +0, 309600, 152064, 0x4922909d +0, 313200, 152064, 0x44bbc195 +0, 316800, 152064, 0xf119ca8f +0, 320400, 152064, 0x6f46e9c8 +0, 324000, 152064, 0xd68e222a +0, 327600, 152064, 0xedc716eb +0, 331200, 152064, 0x090a7702 +0, 334800, 152064, 0xc94eac7a +0, 338400, 152064, 0x629d8823 +0, 342000, 152064, 0x30a51f8c +0, 345600, 152064, 0x4265666b +0, 349200, 152064, 0x766dfd25 +0, 352800, 152064, 0x7dc37c52 +0, 356400, 152064, 0x07c65fbe diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh9 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh9 new file mode 100644 index 00000000..5b21b7f1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-brcm_freh9 @@ -0,0 +1,100 @@ +0, 0, 152064, 0x9f9caf3c +0, 3600, 152064, 0x68f285b1 +0, 7200, 152064, 0x28bd4987 +0, 10800, 152064, 0x79de6e48 +0, 14400, 152064, 0x48301bf9 +0, 18000, 152064, 0x2c9e516c +0, 21600, 152064, 0xf774946a +0, 25200, 152064, 0x36534317 +0, 28800, 152064, 0x98b7bd86 +0, 32400, 152064, 0x2aa3d50b +0, 36000, 152064, 0xc4343429 +0, 39600, 152064, 0x276c5f04 +0, 43200, 152064, 0x042d2916 +0, 46800, 152064, 0x777ee739 +0, 50400, 152064, 0x1ce186d8 +0, 54000, 152064, 0x0ae5a447 +0, 57600, 152064, 0x179435a8 +0, 61200, 152064, 0x96d743b8 +0, 64800, 152064, 0x7dcc26b7 +0, 68400, 152064, 0x72c860c8 +0, 72000, 152064, 0x12a95052 +0, 75600, 152064, 0x1ed00304 +0, 79200, 152064, 0xf9f698be +0, 82800, 152064, 0x768ef04d +0, 86400, 152064, 0x873833ee +0, 90000, 152064, 0x1b4a1e1e +0, 93600, 152064, 0x67462224 +0, 97200, 152064, 0x0206612a +0, 100800, 152064, 0xd203f197 +0, 104400, 152064, 0x5dc020b0 +0, 108000, 152064, 0xdaf2ba1c +0, 111600, 152064, 0xad54e4b2 +0, 115200, 152064, 0x4273c281 +0, 118800, 152064, 0x0655817d +0, 122400, 152064, 0xdea79e1c +0, 126000, 152064, 0x60ae6d1e +0, 129600, 152064, 0x45401d1b +0, 133200, 152064, 0xc6b12160 +0, 136800, 152064, 0x163fbde9 +0, 140400, 152064, 0x91636a0c +0, 144000, 152064, 0x442173a4 +0, 147600, 152064, 0x0f941379 +0, 151200, 152064, 0x0649caad +0, 154800, 152064, 0x1238eaa4 +0, 158400, 152064, 0x86013d55 +0, 162000, 152064, 0xec33b550 +0, 165600, 152064, 0x4cc7b33d +0, 169200, 152064, 0x4c93f8ab +0, 172800, 152064, 0x0cf15a34 +0, 176400, 152064, 0x04b71770 +0, 180000, 152064, 0xf860cea8 +0, 183600, 152064, 0x77fb76a3 +0, 187200, 152064, 0xa494b27c +0, 190800, 152064, 0xf7a0b0b2 +0, 194400, 152064, 0x4cae843b +0, 198000, 152064, 0x590e6403 +0, 201600, 152064, 0xe439e63e +0, 205200, 152064, 0xbeca5f92 +0, 208800, 152064, 0x31d9164f +0, 212400, 152064, 0xedab54a9 +0, 216000, 152064, 0xd8e1de00 +0, 219600, 152064, 0xd04fe391 +0, 223200, 152064, 0xef6568b3 +0, 226800, 152064, 0x859a2811 +0, 230400, 152064, 0x9d5ffe6f +0, 234000, 152064, 0x5a679908 +0, 237600, 152064, 0xc264a830 +0, 241200, 152064, 0xbfdf08c0 +0, 244800, 152064, 0x4fd68cb7 +0, 248400, 152064, 0x0a7b86f3 +0, 252000, 152064, 0xe4fe043b +0, 255600, 152064, 0x8b186a22 +0, 259200, 152064, 0xf715765a +0, 262800, 152064, 0xfd7b77e5 +0, 266400, 152064, 0x9e3fdd06 +0, 270000, 152064, 0xc8bac3fa +0, 273600, 152064, 0x4e83449f +0, 277200, 152064, 0xe5fefcff +0, 280800, 152064, 0x89d77b09 +0, 284400, 152064, 0x77fd6f7e +0, 288000, 152064, 0xa7ec356c +0, 291600, 152064, 0x2000aa87 +0, 295200, 152064, 0xa9a1e267 +0, 298800, 152064, 0xf67c3fcc +0, 302400, 152064, 0x10143acc +0, 306000, 152064, 0xa5fa0476 +0, 309600, 152064, 0x2e8d8966 +0, 313200, 152064, 0x74ccbbde +0, 316800, 152064, 0xf903b2cf +0, 320400, 152064, 0x66a8d7ab +0, 324000, 152064, 0x123e23e2 +0, 327600, 152064, 0x8bd70865 +0, 331200, 152064, 0x2b017249 +0, 334800, 152064, 0x17f1aba6 +0, 338400, 152064, 0x38368449 +0, 342000, 152064, 0x72ee1b69 +0, 345600, 152064, 0x0f1c6a1d +0, 349200, 152064, 0xbeea0040 +0, 352800, 152064, 0x4a9e73b9 +0, 356400, 152064, 0x51a46120 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh12_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh12_b new file mode 100644 index 00000000..12c19598 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh12_b @@ -0,0 +1,100 @@ +0, 0, 152064, 0x9f9caf3c +0, 3600, 152064, 0x0ff688a6 +0, 7200, 152064, 0x247d4215 +0, 10800, 152064, 0x6d075b1b +0, 14400, 152064, 0x23893f77 +0, 18000, 152064, 0x46db7dfc +0, 21600, 152064, 0x6438c4b9 +0, 25200, 152064, 0x1f468257 +0, 28800, 152064, 0xd534ff36 +0, 32400, 152064, 0xb230f7b8 +0, 36000, 152064, 0xd8f66983 +0, 39600, 152064, 0x2068b7a9 +0, 43200, 152064, 0xd5748d8c +0, 46800, 152064, 0x1d701770 +0, 50400, 152064, 0xe505c973 +0, 54000, 152064, 0x0ae5a447 +0, 57600, 152064, 0x3cf356bc +0, 61200, 152064, 0x7d735625 +0, 64800, 152064, 0x3ce6438f +0, 68400, 152064, 0xef3d947c +0, 72000, 152064, 0xa35872be +0, 75600, 152064, 0xcb9d1a37 +0, 79200, 152064, 0x9ad4cda1 +0, 82800, 152064, 0xc8d00a24 +0, 86400, 152064, 0xadab390b +0, 90000, 152064, 0x530837a5 +0, 93600, 152064, 0xfda73274 +0, 97200, 152064, 0x7a297022 +0, 100800, 152064, 0x0d5f16a1 +0, 104400, 152064, 0xb0453e15 +0, 108000, 152064, 0xdaf2ba1c +0, 111600, 152064, 0x55e5f451 +0, 115200, 152064, 0x723ecbce +0, 118800, 152064, 0xb8376dfa +0, 122400, 152064, 0xf53d97b7 +0, 126000, 152064, 0x1e2065cb +0, 129600, 152064, 0x79ab0d75 +0, 133200, 152064, 0xc5da27ed +0, 136800, 152064, 0x37c9d744 +0, 140400, 152064, 0xa8ab8bc3 +0, 144000, 152064, 0xab16a630 +0, 147600, 152064, 0xbbd76705 +0, 151200, 152064, 0xe67b2032 +0, 154800, 152064, 0xe1e02979 +0, 158400, 152064, 0xe79260b2 +0, 162000, 152064, 0xec33b550 +0, 165600, 152064, 0x679cca25 +0, 169200, 152064, 0x464b0935 +0, 172800, 152064, 0xa4c36a2a +0, 176400, 152064, 0xe9593764 +0, 180000, 152064, 0x10f9ff42 +0, 183600, 152064, 0x6518a6fa +0, 187200, 152064, 0xd161e4f3 +0, 190800, 152064, 0xc9d9be11 +0, 194400, 152064, 0x0db78ff6 +0, 198000, 152064, 0xd47d7e0f +0, 201600, 152064, 0xdf34e3a3 +0, 205200, 152064, 0x13b68bd6 +0, 208800, 152064, 0x90e845bd +0, 212400, 152064, 0xb434883a +0, 216000, 152064, 0xd8e1de00 +0, 219600, 152064, 0xc9a3df1f +0, 223200, 152064, 0x01476f54 +0, 226800, 152064, 0xd52824a4 +0, 230400, 152064, 0x63d43662 +0, 234000, 152064, 0x40a90d0f +0, 237600, 152064, 0x332b22eb +0, 241200, 152064, 0x1c267e8c +0, 244800, 152064, 0x9be230d3 +0, 248400, 152064, 0x0ca308e8 +0, 252000, 152064, 0xfb5c5fdd +0, 255600, 152064, 0x0d386358 +0, 259200, 152064, 0x3c7148b3 +0, 262800, 152064, 0xc2c07dab +0, 266400, 152064, 0x76bbf8eb +0, 270000, 152064, 0xc8bac3fa +0, 273600, 152064, 0x35ef5e12 +0, 277200, 152064, 0x5d1fea8d +0, 280800, 152064, 0xafbb54ef +0, 284400, 152064, 0xf5d3396e +0, 288000, 152064, 0xc4f4f8eb +0, 291600, 152064, 0x60a17fa1 +0, 295200, 152064, 0x8804cdf9 +0, 298800, 152064, 0x3227412f +0, 302400, 152064, 0x130e5026 +0, 306000, 152064, 0xcb17344e +0, 309600, 152064, 0x4f0dde70 +0, 313200, 152064, 0x57422405 +0, 316800, 152064, 0x48070e40 +0, 320400, 152064, 0x5c2f134d +0, 324000, 152064, 0x123e23e2 +0, 327600, 152064, 0x393c1185 +0, 331200, 152064, 0x59919a69 +0, 334800, 152064, 0xc1dad5c4 +0, 338400, 152064, 0x49b8c9a9 +0, 342000, 152064, 0x8dab7b1c +0, 345600, 152064, 0x3a63c0c0 +0, 349200, 152064, 0x224860bc +0, 352800, 152064, 0xdc40c9b2 +0, 356400, 152064, 0xd3a0b8a1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh1_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh1_b new file mode 100644 index 00000000..4e35e13b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh1_b @@ -0,0 +1,100 @@ +0, 0, 152064, 0x42a3d9ce +0, 3600, 152064, 0xa95cc2ed +0, 7200, 152064, 0xc48f8fdc +0, 10800, 152064, 0x1584b7e8 +0, 14400, 152064, 0xd6f34b7e +0, 18000, 152064, 0xbb196ee4 +0, 21600, 152064, 0xdfe79cbd +0, 25200, 152064, 0x023799b7 +0, 28800, 152064, 0x156b1932 +0, 32400, 152064, 0x6dd14765 +0, 36000, 152064, 0xd2bd86b9 +0, 39600, 152064, 0xee62c71d +0, 43200, 152064, 0x60667d48 +0, 46800, 152064, 0x09df084c +0, 50400, 152064, 0xc1a0b8d7 +0, 54000, 152064, 0x55adc538 +0, 57600, 152064, 0xf6d28a14 +0, 61200, 152064, 0x1adab322 +0, 64800, 152064, 0xa6c796aa +0, 68400, 152064, 0x60d8dc6a +0, 72000, 152064, 0x20f9c609 +0, 75600, 152064, 0x299f4059 +0, 79200, 152064, 0x93eb0fea +0, 82800, 152064, 0x76e7547e +0, 86400, 152064, 0xc4b76f90 +0, 90000, 152064, 0x4b7a85ea +0, 93600, 152064, 0x2e138df4 +0, 97200, 152064, 0x7df1a421 +0, 100800, 152064, 0x0e9a1a3e +0, 104400, 152064, 0x56124293 +0, 108000, 152064, 0x1faee8f7 +0, 111600, 152064, 0x7f551572 +0, 115200, 152064, 0x8974cbf0 +0, 118800, 152064, 0x1c5dc5e9 +0, 122400, 152064, 0x2498eb5b +0, 126000, 152064, 0x861ed634 +0, 129600, 152064, 0x0e62a433 +0, 133200, 152064, 0xf3648cc0 +0, 136800, 152064, 0x69bc344b +0, 140400, 152064, 0x797eaafe +0, 144000, 152064, 0x722fbff8 +0, 147600, 152064, 0xa8895582 +0, 151200, 152064, 0xde1bcffb +0, 154800, 152064, 0xf558ed3f +0, 158400, 152064, 0xa5173e0e +0, 162000, 152064, 0x6872d018 +0, 165600, 152064, 0x6af6c55d +0, 169200, 152064, 0x7c6b1f26 +0, 172800, 152064, 0xa8086db3 +0, 176400, 152064, 0x70b762e1 +0, 180000, 152064, 0x85b7eb76 +0, 183600, 152064, 0x3a4393f1 +0, 187200, 152064, 0xdabdda42 +0, 190800, 152064, 0xbb84b84c +0, 194400, 152064, 0xabe880d8 +0, 198000, 152064, 0xe7303cc5 +0, 201600, 152064, 0xecdcc142 +0, 205200, 152064, 0x591118db +0, 208800, 152064, 0x37a715c6 +0, 212400, 152064, 0x9106221e +0, 216000, 152064, 0xb1821a2e +0, 219600, 152064, 0x3adeccdb +0, 223200, 152064, 0xd4ac64a8 +0, 226800, 152064, 0x8f34134f +0, 230400, 152064, 0x1f3cf03d +0, 234000, 152064, 0x7b5da3b0 +0, 237600, 152064, 0x23f69e68 +0, 241200, 152064, 0x67e62093 +0, 244800, 152064, 0xf226d12e +0, 248400, 152064, 0x2eb08a1f +0, 252000, 152064, 0x5bb70c54 +0, 255600, 152064, 0x2edb3578 +0, 259200, 152064, 0x9d0c1b30 +0, 262800, 152064, 0xd8266732 +0, 266400, 152064, 0xad67cd45 +0, 270000, 152064, 0x7a11d3cc +0, 273600, 152064, 0xac534ec1 +0, 277200, 152064, 0x7ff6ba17 +0, 280800, 152064, 0xf9741b77 +0, 284400, 152064, 0x318d25fa +0, 288000, 152064, 0xff4ae686 +0, 291600, 152064, 0x26a05ae2 +0, 295200, 152064, 0x95619a34 +0, 298800, 152064, 0xec2b1136 +0, 302400, 152064, 0xf93ebeca +0, 306000, 152064, 0xd8237aaa +0, 309600, 152064, 0x1c362a05 +0, 313200, 152064, 0x6fc74faa +0, 316800, 152064, 0x875e5b67 +0, 320400, 152064, 0xc04093be +0, 324000, 152064, 0x4c2340a1 +0, 327600, 152064, 0x7af99e63 +0, 331200, 152064, 0xf5b89a4e +0, 334800, 152064, 0xb7759e48 +0, 338400, 152064, 0x61a15c06 +0, 342000, 152064, 0x91a5ae4c +0, 345600, 152064, 0x6aedf226 +0, 349200, 152064, 0x870dbf36 +0, 352800, 152064, 0x814d04a3 +0, 356400, 152064, 0xd5a30892 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh2_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh2_b new file mode 100644 index 00000000..ac9a48c4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh2_b @@ -0,0 +1,100 @@ +0, 0, 152064, 0x1668b41a +0, 3600, 152064, 0x953ca7fb +0, 7200, 152064, 0x3e38bc6e +0, 10800, 152064, 0x18dff6cc +0, 14400, 152064, 0x03105f7a +0, 18000, 152064, 0x6fe79efb +0, 21600, 152064, 0xbd4ccb6f +0, 25200, 152064, 0xaf398a10 +0, 28800, 152064, 0x4f281075 +0, 32400, 152064, 0x88f63791 +0, 36000, 152064, 0x7500b606 +0, 39600, 152064, 0xebebd6e6 +0, 43200, 152064, 0x3ed7c35e +0, 46800, 152064, 0xc95826d6 +0, 50400, 152064, 0x0989ab63 +0, 54000, 152064, 0xddd5d22b +0, 57600, 152064, 0x11683b8a +0, 61200, 152064, 0x5ce36d50 +0, 64800, 152064, 0xa5185ccf +0, 68400, 152064, 0xf47583b5 +0, 72000, 152064, 0xac6e82b6 +0, 75600, 152064, 0xf8dc25c0 +0, 79200, 152064, 0x5a6aba8e +0, 82800, 152064, 0x43790f6d +0, 86400, 152064, 0x787c4377 +0, 90000, 152064, 0xe6833159 +0, 93600, 152064, 0xe5c21131 +0, 97200, 152064, 0x16ae69bb +0, 100800, 152064, 0x754fcc9e +0, 104400, 152064, 0x71aaf1e1 +0, 108000, 152064, 0xce9de9ee +0, 111600, 152064, 0x05e6d832 +0, 115200, 152064, 0x5773b413 +0, 118800, 152064, 0xe518881c +0, 122400, 152064, 0xe248bce9 +0, 126000, 152064, 0x421e8c0d +0, 129600, 152064, 0x30135143 +0, 133200, 152064, 0xf02347f4 +0, 136800, 152064, 0x3fa71a0e +0, 140400, 152064, 0x2c14d955 +0, 144000, 152064, 0x18b2d558 +0, 147600, 152064, 0x54cb7fa2 +0, 151200, 152064, 0x90ae2332 +0, 154800, 152064, 0x7957129a +0, 158400, 152064, 0x6c9b463e +0, 162000, 152064, 0x8c44e126 +0, 165600, 152064, 0xde3ba475 +0, 169200, 152064, 0x9823e3ed +0, 172800, 152064, 0x3ce03b21 +0, 176400, 152064, 0x930007a2 +0, 180000, 152064, 0x6f94bf67 +0, 183600, 152064, 0x3e113ce9 +0, 187200, 152064, 0xa31c8828 +0, 190800, 152064, 0xe65260e0 +0, 194400, 152064, 0x4c612620 +0, 198000, 152064, 0xdc41f17f +0, 201600, 152064, 0x6d3f6a84 +0, 205200, 152064, 0xfb55e9e9 +0, 208800, 152064, 0x21e2c8b5 +0, 212400, 152064, 0x2d0939a9 +0, 216000, 152064, 0xe1f422d2 +0, 219600, 152064, 0xab0ad4a3 +0, 223200, 152064, 0x948f46df +0, 226800, 152064, 0x61f50c16 +0, 230400, 152064, 0x7f5edb05 +0, 234000, 152064, 0x8d8c4782 +0, 237600, 152064, 0xe8644529 +0, 241200, 152064, 0x1e7ce779 +0, 244800, 152064, 0x22f355a9 +0, 248400, 152064, 0x4dd736d4 +0, 252000, 152064, 0x3d968c63 +0, 255600, 152064, 0xa629c711 +0, 259200, 152064, 0xae87c4c6 +0, 262800, 152064, 0xcd482dd2 +0, 266400, 152064, 0x6bbbbd25 +0, 270000, 152064, 0x4f0ad3d2 +0, 273600, 152064, 0x66052e88 +0, 277200, 152064, 0xa09dff03 +0, 280800, 152064, 0xb3837263 +0, 284400, 152064, 0x3c91fdde +0, 288000, 152064, 0x4d9309a9 +0, 291600, 152064, 0x6b624164 +0, 295200, 152064, 0xaa425ecb +0, 298800, 152064, 0x37aec7c9 +0, 302400, 152064, 0xf4b3d359 +0, 306000, 152064, 0x85d3af2b +0, 309600, 152064, 0xe5c1f190 +0, 313200, 152064, 0x8cb00e09 +0, 316800, 152064, 0x59406ebc +0, 320400, 152064, 0xd7ac351f +0, 324000, 152064, 0x998238b6 +0, 327600, 152064, 0x8e89d064 +0, 331200, 152064, 0x644223c5 +0, 334800, 152064, 0x90ad366f +0, 338400, 152064, 0x40a12122 +0, 342000, 152064, 0x3045024c +0, 345600, 152064, 0x58673cfb +0, 349200, 152064, 0x567cf1fe +0, 352800, 152064, 0x2d236e41 +0, 356400, 152064, 0xc493577d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh6 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh6 new file mode 100644 index 00000000..4dd3afde --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh6 @@ -0,0 +1,100 @@ +0, 0, 152064, 0x3b21d6cd +0, 3600, 152064, 0xc32088c6 +0, 7200, 152064, 0x65a64cee +0, 10800, 152064, 0x0bd45a5b +0, 14400, 152064, 0xb2210d4d +0, 18000, 152064, 0xf5b15527 +0, 21600, 152064, 0x806572ad +0, 25200, 152064, 0x6ecb1fc8 +0, 28800, 152064, 0xc25e96d5 +0, 32400, 152064, 0x5593b825 +0, 36000, 152064, 0xf3be1cff +0, 39600, 152064, 0xa9155072 +0, 43200, 152064, 0xd5552e26 +0, 46800, 152064, 0x7bf0dbee +0, 50400, 152064, 0x998b4911 +0, 54000, 152064, 0xcc71bbe0 +0, 57600, 152064, 0x602415b8 +0, 61200, 152064, 0xcfff37cf +0, 64800, 152064, 0x7cf824a8 +0, 68400, 152064, 0x34816ee5 +0, 72000, 152064, 0x1480540c +0, 75600, 152064, 0xc2351aaf +0, 79200, 152064, 0x3b8eac9f +0, 82800, 152064, 0x92a8faf8 +0, 86400, 152064, 0x7b6121c8 +0, 90000, 152064, 0xe73a3bac +0, 93600, 152064, 0xcd6e1e36 +0, 97200, 152064, 0xb24660b1 +0, 100800, 152064, 0xa290ec25 +0, 104400, 152064, 0x308915ff +0, 108000, 152064, 0x1e8dd4db +0, 111600, 152064, 0x1372f2e0 +0, 115200, 152064, 0xa07cc1d0 +0, 118800, 152064, 0x34bb872c +0, 122400, 152064, 0x59e6a565 +0, 126000, 152064, 0x9a097932 +0, 129600, 152064, 0x938f2e20 +0, 133200, 152064, 0x59a8157d +0, 136800, 152064, 0x5cacd404 +0, 140400, 152064, 0xdad068f5 +0, 144000, 152064, 0x7ba67d47 +0, 147600, 152064, 0xc2a11e2d +0, 151200, 152064, 0xd37fdef7 +0, 154800, 152064, 0x19a3f80a +0, 158400, 152064, 0x7ec7426a +0, 162000, 152064, 0x8ffedb61 +0, 165600, 152064, 0x82aebdd0 +0, 169200, 152064, 0xdfc920cc +0, 172800, 152064, 0x2a467698 +0, 176400, 152064, 0xd08a37d5 +0, 180000, 152064, 0xe606e66a +0, 183600, 152064, 0x0e7b8bd8 +0, 187200, 152064, 0xf983c732 +0, 190800, 152064, 0x9b82c2e7 +0, 194400, 152064, 0xa990a47e +0, 198000, 152064, 0x2d5679f1 +0, 201600, 152064, 0x7f1c0201 +0, 205200, 152064, 0xc38b709d +0, 208800, 152064, 0x040246d8 +0, 212400, 152064, 0xbc856021 +0, 216000, 152064, 0x81e01a78 +0, 219600, 152064, 0xaff1e7f1 +0, 223200, 152064, 0x1fee7715 +0, 226800, 152064, 0x65053711 +0, 230400, 152064, 0x238a0118 +0, 234000, 152064, 0x563491b4 +0, 237600, 152064, 0x5974a6cc +0, 241200, 152064, 0xd8682c35 +0, 244800, 152064, 0x85c49e96 +0, 248400, 152064, 0x29486faa +0, 252000, 152064, 0x1a4f0579 +0, 255600, 152064, 0x6ab86c2f +0, 259200, 152064, 0x36a36d2b +0, 262800, 152064, 0x3bd77543 +0, 266400, 152064, 0x8fbddc41 +0, 270000, 152064, 0xccc6e0a5 +0, 273600, 152064, 0x00a9539e +0, 277200, 152064, 0x07ba0714 +0, 280800, 152064, 0xbab2735d +0, 284400, 152064, 0x79cb5ba0 +0, 288000, 152064, 0xdbcc1c92 +0, 291600, 152064, 0xffec952c +0, 295200, 152064, 0xc31ac68e +0, 298800, 152064, 0x24293eb9 +0, 302400, 152064, 0x7b9b2cb4 +0, 306000, 152064, 0x9dd4fe95 +0, 309600, 152064, 0xb62e8baf +0, 313200, 152064, 0x9fefc174 +0, 316800, 152064, 0xe027c24e +0, 320400, 152064, 0xe38adc70 +0, 324000, 152064, 0xc7bf536f +0, 327600, 152064, 0x4448f330 +0, 331200, 152064, 0x4dad5339 +0, 334800, 152064, 0x48fbab15 +0, 338400, 152064, 0xe6c97b2c +0, 342000, 152064, 0x3c3829ee +0, 345600, 152064, 0x927772c0 +0, 349200, 152064, 0xbb0f0ef4 +0, 352800, 152064, 0xe65780a7 +0, 356400, 152064, 0xaf8f6d72 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh7_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh7_b new file mode 100644 index 00000000..8c397f2d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-freh7_b @@ -0,0 +1,100 @@ +0, 0, 152064, 0x89f2e8d5 +0, 3600, 152064, 0x35b99397 +0, 7200, 152064, 0x6ef46744 +0, 10800, 152064, 0xec4d6c1c +0, 14400, 152064, 0xad6e0c70 +0, 18000, 152064, 0x2db534b3 +0, 21600, 152064, 0xcbd25ddd +0, 25200, 152064, 0xd90708b4 +0, 28800, 152064, 0xc2aa52df +0, 32400, 152064, 0xbcfc84dc +0, 36000, 152064, 0xa5a6d269 +0, 39600, 152064, 0x27220ce9 +0, 43200, 152064, 0xf075ee6d +0, 46800, 152064, 0x9fd3c2ac +0, 50400, 152064, 0xcba24c2d +0, 54000, 152064, 0x41cd9441 +0, 57600, 152064, 0x0126efa3 +0, 61200, 152064, 0xf62112af +0, 64800, 152064, 0x35aff50f +0, 68400, 152064, 0xcb0b276f +0, 72000, 152064, 0xc7ef0214 +0, 75600, 152064, 0x7f78d387 +0, 79200, 152064, 0x266c673d +0, 82800, 152064, 0x1d39c073 +0, 86400, 152064, 0x6a3ae455 +0, 90000, 152064, 0xe4ce0230 +0, 93600, 152064, 0x7f95e87b +0, 97200, 152064, 0x7c552236 +0, 100800, 152064, 0x24c799b9 +0, 104400, 152064, 0x5042d974 +0, 108000, 152064, 0xe934a5b8 +0, 111600, 152064, 0x6d59c884 +0, 115200, 152064, 0xd00f7fdb +0, 118800, 152064, 0x62ac3ebd +0, 122400, 152064, 0xb40a6c25 +0, 126000, 152064, 0x8706188c +0, 129600, 152064, 0x7682e339 +0, 133200, 152064, 0x1061d943 +0, 136800, 152064, 0x50fa684a +0, 140400, 152064, 0xab4b1975 +0, 144000, 152064, 0x2d043acb +0, 147600, 152064, 0xe3c2ec0a +0, 151200, 152064, 0xb9bc99dc +0, 154800, 152064, 0x051fb857 +0, 158400, 152064, 0x71d1fe52 +0, 162000, 152064, 0x4230c694 +0, 165600, 152064, 0xb412a137 +0, 169200, 152064, 0x2f50f90d +0, 172800, 152064, 0x68a1466f +0, 176400, 152064, 0x77e3f47b +0, 180000, 152064, 0x4d08de2b +0, 183600, 152064, 0x1fc663be +0, 187200, 152064, 0x2c8ba712 +0, 190800, 152064, 0xd50d85b9 +0, 194400, 152064, 0xe8483437 +0, 198000, 152064, 0x4e331e4c +0, 201600, 152064, 0x0f64a7a0 +0, 205200, 152064, 0x797b0b8c +0, 208800, 152064, 0x1b91e6d8 +0, 212400, 152064, 0xf3a1f3b6 +0, 216000, 152064, 0x2b94bd52 +0, 219600, 152064, 0x1f30962e +0, 223200, 152064, 0x853321cf +0, 226800, 152064, 0x8266c0ac +0, 230400, 152064, 0x25498be0 +0, 234000, 152064, 0x0f653af9 +0, 237600, 152064, 0x0a025f7e +0, 241200, 152064, 0x1cfbae04 +0, 244800, 152064, 0x3a874757 +0, 248400, 152064, 0x2c67006e +0, 252000, 152064, 0x1d409bce +0, 255600, 152064, 0xfe43121f +0, 259200, 152064, 0x43411830 +0, 262800, 152064, 0x536d26ca +0, 266400, 152064, 0x9eb873ea +0, 270000, 152064, 0x093f93ec +0, 273600, 152064, 0xdf6f0381 +0, 277200, 152064, 0xa9f4b5e5 +0, 280800, 152064, 0x08f71ef8 +0, 284400, 152064, 0x7a68f820 +0, 288000, 152064, 0xae0c73e7 +0, 291600, 152064, 0x886ae6c7 +0, 295200, 152064, 0x9357f433 +0, 298800, 152064, 0xcc335068 +0, 302400, 152064, 0x2ea108ab +0, 306000, 152064, 0x06d7dcb0 +0, 309600, 152064, 0x81dc81bc +0, 313200, 152064, 0xfb32b626 +0, 316800, 152064, 0x2787d1c7 +0, 320400, 152064, 0x69e51118 +0, 324000, 152064, 0xba15d94d +0, 327600, 152064, 0xc41c09cf +0, 331200, 152064, 0x7e50e12f +0, 334800, 152064, 0x0763ddbe +0, 338400, 152064, 0x8a09bb88 +0, 342000, 152064, 0x530752b7 +0, 345600, 152064, 0x9b159923 +0, 349200, 152064, 0xcbb83ed3 +0, 352800, 152064, 0xdeb5ac0e +0, 356400, 152064, 0x189299d4 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext01_jvc_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext01_jvc_d new file mode 100644 index 00000000..ae71a634 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext01_jvc_d @@ -0,0 +1,16 @@ +0, 0, 152064, 0x31bc935e +0, 3600, 152064, 0x501ea92a +0, 7200, 152064, 0x8b2f6ead +0, 10800, 152064, 0xa86277e3 +0, 14400, 152064, 0xe5936250 +0, 18000, 152064, 0x497794cb +0, 21600, 152064, 0xcb34c39a +0, 25200, 152064, 0xa739994d +0, 28800, 152064, 0x01e804b7 +0, 32400, 152064, 0xfcf00627 +0, 36000, 152064, 0xcd747bda +0, 39600, 152064, 0x1d979394 +0, 43200, 152064, 0xd5d52a6a +0, 46800, 152064, 0xd7fb147b +0, 50400, 152064, 0x5d7cb44a +0, 54000, 152064, 0x9b87803b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext02_jvc_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext02_jvc_c new file mode 100644 index 00000000..ae71a634 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext02_jvc_c @@ -0,0 +1,16 @@ +0, 0, 152064, 0x31bc935e +0, 3600, 152064, 0x501ea92a +0, 7200, 152064, 0x8b2f6ead +0, 10800, 152064, 0xa86277e3 +0, 14400, 152064, 0xe5936250 +0, 18000, 152064, 0x497794cb +0, 21600, 152064, 0xcb34c39a +0, 25200, 152064, 0xa739994d +0, 28800, 152064, 0x01e804b7 +0, 32400, 152064, 0xfcf00627 +0, 36000, 152064, 0xcd747bda +0, 39600, 152064, 0x1d979394 +0, 43200, 152064, 0xd5d52a6a +0, 46800, 152064, 0xd7fb147b +0, 50400, 152064, 0x5d7cb44a +0, 54000, 152064, 0x9b87803b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext1_panasonic_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext1_panasonic_c new file mode 100644 index 00000000..ec01250d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext1_panasonic_c @@ -0,0 +1,8 @@ +0, 0, 152064, 0xf9c30518 +0, 3600, 152064, 0x509dd18f +0, 7200, 152064, 0x7f5c8f07 +0, 10800, 152064, 0x8ce42210 +0, 14400, 152064, 0x59fd527a +0, 18000, 152064, 0xd987ceea +0, 21600, 152064, 0xc53167fa +0, 25200, 152064, 0xb3179926 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext2_panasonic_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext2_panasonic_b new file mode 100644 index 00000000..a980a9dc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext2_panasonic_b @@ -0,0 +1,15 @@ +0, 0, 152064, 0x0147a2a9 +0, 3600, 152064, 0xe2365351 +0, 7200, 152064, 0xb5f9daee +0, 10800, 152064, 0xd60818b2 +0, 14400, 152064, 0x21b528e5 +0, 18000, 152064, 0x9c9dda18 +0, 21600, 152064, 0x387fe7de +0, 25200, 152064, 0x8f0c5a1e +0, 28800, 152064, 0x02409694 +0, 32400, 152064, 0x2b36a7a7 +0, 36000, 152064, 0x3c6d3863 +0, 39600, 152064, 0xaa7835e1 +0, 43200, 152064, 0x6d105fe7 +0, 46800, 152064, 0x9a348732 +0, 50400, 152064, 0x96a3af13 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext3_panasonic_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext3_panasonic_d new file mode 100644 index 00000000..94590b3f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext3_panasonic_d @@ -0,0 +1,11 @@ +0, 0, 152064, 0xdd346292 +0, 3600, 152064, 0xb07e6efd +0, 7200, 152064, 0x81b4d540 +0, 10800, 152064, 0xc50066cf +0, 14400, 152064, 0x30a49588 +0, 18000, 152064, 0x57520bfa +0, 21600, 152064, 0xc0409dd9 +0, 25200, 152064, 0x8e6453e9 +0, 28800, 152064, 0x7ca86d86 +0, 32400, 152064, 0xf937b3b5 +0, 36000, 152064, 0x6c1f4604 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext4_panasonic_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext4_panasonic_a new file mode 100644 index 00000000..3cf454ce --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext4_panasonic_a @@ -0,0 +1,10 @@ +0, 0, 152064, 0xd604d440 +0, 3600, 152064, 0x08ef262c +0, 7200, 152064, 0x992fca8e +0, 10800, 152064, 0x5a02ee15 +0, 14400, 152064, 0xf15d5c66 +0, 18000, 152064, 0x360dda12 +0, 21600, 152064, 0x18b54985 +0, 25200, 152064, 0xf12b6cde +0, 28800, 152064, 0x3b2e63f7 +0, 32400, 152064, 0x140abcfd diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext_mmco4_sony_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext_mmco4_sony_b new file mode 100644 index 00000000..117b48b5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-frext_mmco4_sony_b @@ -0,0 +1,60 @@ +0, 0, 152064, 0x24846654 +0, 3600, 152064, 0xd33945be +0, 7200, 152064, 0x961cbbfb +0, 10800, 152064, 0x91eb854d +0, 14400, 152064, 0x998351b4 +0, 18000, 152064, 0xe7515c67 +0, 21600, 152064, 0xd32058ae +0, 25200, 152064, 0x99cb5695 +0, 28800, 152064, 0x281de175 +0, 32400, 152064, 0xf4146f55 +0, 36000, 152064, 0x63abbb61 +0, 39600, 152064, 0xf44550c5 +0, 43200, 152064, 0x5797a5c2 +0, 46800, 152064, 0x13b15c60 +0, 50400, 152064, 0x6521e682 +0, 54000, 152064, 0x780c32a4 +0, 57600, 152064, 0x6289f37c +0, 61200, 152064, 0x96d64d81 +0, 64800, 152064, 0x12ac80ef +0, 68400, 152064, 0x470956e4 +0, 72000, 152064, 0x3954f944 +0, 75600, 152064, 0x2147f0db +0, 79200, 152064, 0xca7c9a39 +0, 82800, 152064, 0x727e7772 +0, 86400, 152064, 0xb3b0f8c8 +0, 90000, 152064, 0x6d6eb7ba +0, 93600, 152064, 0x1eaf5734 +0, 97200, 152064, 0xd7938056 +0, 100800, 152064, 0xcae1ead3 +0, 104400, 152064, 0x6411b82c +0, 108000, 152064, 0x6f001718 +0, 111600, 152064, 0x3724d9b8 +0, 115200, 152064, 0x04501fec +0, 118800, 152064, 0x3f4d13bb +0, 122400, 152064, 0x38f2510a +0, 126000, 152064, 0x5bb71106 +0, 129600, 152064, 0xe888b09d +0, 133200, 152064, 0xca6f5f6a +0, 136800, 152064, 0x01c7d329 +0, 140400, 152064, 0x4e670932 +0, 144000, 152064, 0x651b4984 +0, 147600, 152064, 0x76371fa3 +0, 151200, 152064, 0x60574af0 +0, 154800, 152064, 0xcc1f2080 +0, 158400, 152064, 0xdbf29eb6 +0, 162000, 152064, 0x8ff870be +0, 165600, 152064, 0x5d39ea56 +0, 169200, 152064, 0xabb7c0a5 +0, 172800, 152064, 0xecb15771 +0, 176400, 152064, 0x571ab1ae +0, 180000, 152064, 0xc0f22bad +0, 183600, 152064, 0x22e7593f +0, 187200, 152064, 0x3c3dee75 +0, 190800, 152064, 0x1c80b995 +0, 194400, 152064, 0x5ba442fa +0, 198000, 152064, 0xe2291c05 +0, 201600, 152064, 0xa780b11e +0, 205200, 152064, 0x15bf83fa +0, 208800, 152064, 0x60fb7c11 +0, 212400, 152064, 0x3fb8cee5 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcaff1_hhi_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcaff1_hhi_b new file mode 100644 index 00000000..5e366b44 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcaff1_hhi_b @@ -0,0 +1,10 @@ +0, 0, 152064, 0xb055a9bd +0, 3600, 152064, 0x9e1eadb6 +0, 7200, 152064, 0x48f117d2 +0, 10800, 152064, 0x3e3ff049 +0, 14400, 152064, 0x2ff80943 +0, 18000, 152064, 0xc5ee16a6 +0, 21600, 152064, 0x38c33f28 +0, 25200, 152064, 0x3e8444c7 +0, 28800, 152064, 0x14ca4ab2 +0, 32400, 152064, 0xe20e78f7 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcafr1_hhi_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcafr1_hhi_c new file mode 100644 index 00000000..102fe894 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcafr1_hhi_c @@ -0,0 +1,10 @@ +0, 0, 152064, 0xd48c87b3 +0, 3600, 152064, 0xb7a67f8f +0, 7200, 152064, 0x3c3f3c11 +0, 10800, 152064, 0xc411af54 +0, 14400, 152064, 0xde2efb95 +0, 18000, 152064, 0xa4787125 +0, 21600, 152064, 0x3c17085a +0, 25200, 152064, 0xee217266 +0, 28800, 152064, 0xa23a8e9d +0, 32400, 152064, 0x70a06d90 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcafr2_hhi_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcafr2_hhi_a new file mode 100644 index 00000000..516b39de --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcafr2_hhi_a @@ -0,0 +1,10 @@ +0, 0, 152064, 0xd5448f0e +0, 3600, 152064, 0x93d022ba +0, 7200, 152064, 0x1eaed76e +0, 10800, 152064, 0xbbd54f09 +0, 14400, 152064, 0x175d6316 +0, 18000, 152064, 0x15ede384 +0, 21600, 152064, 0xb785e9ac +0, 25200, 152064, 0xdbbb4ee6 +0, 28800, 152064, 0xaf27c827 +0, 32400, 152064, 0xbf3eeed4 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcafr3_hhi_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcafr3_hhi_a new file mode 100644 index 00000000..da60e638 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcafr3_hhi_a @@ -0,0 +1,10 @@ +0, 0, 152064, 0xd5448f0e +0, 3600, 152064, 0x665e33b5 +0, 7200, 152064, 0x6648e99d +0, 10800, 152064, 0xbbd54f09 +0, 14400, 152064, 0x3dac7644 +0, 18000, 152064, 0xe980f078 +0, 21600, 152064, 0xb785e9ac +0, 25200, 152064, 0xa500630e +0, 28800, 152064, 0x6dade9b0 +0, 32400, 152064, 0xbf3eeed4 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcafr4_hhi_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcafr4_hhi_a new file mode 100644 index 00000000..0dcf5a59 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcafr4_hhi_a @@ -0,0 +1,10 @@ +0, 0, 152064, 0xc7d8832d +0, 3600, 152064, 0x8d9ffc59 +0, 7200, 152064, 0xaf3ea0d1 +0, 10800, 152064, 0x6805671e +0, 14400, 152064, 0x49202ab8 +0, 18000, 152064, 0x6b06b1ad +0, 21600, 152064, 0x909f3e4e +0, 25200, 152064, 0xa4ce28ec +0, 28800, 152064, 0xc3c5b8bc +0, 32400, 152064, 0x78744dac diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcamff1_hhi_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcamff1_hhi_b new file mode 100644 index 00000000..1dc66a17 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hcamff1_hhi_b @@ -0,0 +1,10 @@ +0, 0, 152064, 0x18f494ec +0, 3600, 152064, 0x7515e6d7 +0, 7200, 152064, 0xaa8ee665 +0, 10800, 152064, 0xa946e180 +0, 14400, 152064, 0xd1467f7e +0, 18000, 152064, 0xd779f4c2 +0, 21600, 152064, 0xed456fed +0, 25200, 152064, 0x4ca23a72 +0, 28800, 152064, 0x26381cd2 +0, 32400, 152064, 0x50df40fa diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpca_brcm_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpca_brcm_c new file mode 100644 index 00000000..cbfc5681 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpca_brcm_c @@ -0,0 +1,300 @@ +0, 0, 152064, 0x995bb4bd +0, 3600, 152064, 0xad287357 +0, 7200, 152064, 0x38fa4661 +0, 10800, 152064, 0x8aae73cf +0, 14400, 152064, 0x4a13eada +0, 18000, 152064, 0x48b33901 +0, 21600, 152064, 0x011487bc +0, 25200, 152064, 0xd4ce1925 +0, 28800, 152064, 0x5d679ddd +0, 32400, 152064, 0x276cd5cf +0, 36000, 152064, 0x99c625f0 +0, 39600, 152064, 0xb2f756d1 +0, 43200, 152064, 0xb19c2978 +0, 46800, 152064, 0xdac0ff3c +0, 50400, 152064, 0x3c1c8d63 +0, 54000, 152064, 0x818ea0a8 +0, 57600, 152064, 0xa7c122a5 +0, 61200, 152064, 0x67ad3519 +0, 64800, 152064, 0xc81b2a88 +0, 68400, 152064, 0x8ae6633e +0, 72000, 152064, 0xed945788 +0, 75600, 152064, 0x4c740bcb +0, 79200, 152064, 0xd8408d09 +0, 82800, 152064, 0xb710e8b8 +0, 86400, 152064, 0xb8c647b9 +0, 90000, 152064, 0x802b2e23 +0, 93600, 152064, 0x30672529 +0, 97200, 152064, 0x328a72b6 +0, 100800, 152064, 0xeb6dbe94 +0, 104400, 152064, 0x1c19dcc5 +0, 108000, 152064, 0xfdc6b998 +0, 111600, 152064, 0xf9e2cd80 +0, 115200, 152064, 0x025eb15e +0, 118800, 152064, 0xfd998ad8 +0, 122400, 152064, 0x8fdf736f +0, 126000, 152064, 0xa5a7554a +0, 129600, 152064, 0xcea63304 +0, 133200, 152064, 0xcb28ec28 +0, 136800, 152064, 0x92efb591 +0, 140400, 152064, 0x0f2376c3 +0, 144000, 152064, 0xe9cb5ecf +0, 147600, 152064, 0xcd2d0eba +0, 151200, 152064, 0xd57fe4fd +0, 154800, 152064, 0xc486ab8e +0, 158400, 152064, 0x01a1f709 +0, 162000, 152064, 0x7ac5b13a +0, 165600, 152064, 0x6f519279 +0, 169200, 152064, 0xfd7cd9a0 +0, 172800, 152064, 0xfae649d2 +0, 176400, 152064, 0x618507ca +0, 180000, 152064, 0xb177bc15 +0, 183600, 152064, 0x6fa36854 +0, 187200, 152064, 0xc13cb77d +0, 190800, 152064, 0x6d40cb01 +0, 194400, 152064, 0xa3db96a2 +0, 198000, 152064, 0xe5ba6c99 +0, 201600, 152064, 0xca9ff3ee +0, 205200, 152064, 0x6c016c65 +0, 208800, 152064, 0xdf93ed80 +0, 212400, 152064, 0x93112ec8 +0, 216000, 152064, 0x8ab3ea14 +0, 219600, 152064, 0x02f5b891 +0, 223200, 152064, 0xdafd562b +0, 226800, 152064, 0xa96a2bd7 +0, 230400, 152064, 0xdff8bc68 +0, 234000, 152064, 0x8d956b4b +0, 237600, 152064, 0xb4aeb960 +0, 241200, 152064, 0x391cf0dd +0, 244800, 152064, 0x03137de9 +0, 248400, 152064, 0x2bfa8c4b +0, 252000, 152064, 0xfb54d3a5 +0, 255600, 152064, 0x650146e7 +0, 259200, 152064, 0xd3a7765f +0, 262800, 152064, 0x49d72b90 +0, 266400, 152064, 0xf089b357 +0, 270000, 152064, 0x23a2be41 +0, 273600, 152064, 0x2ea86592 +0, 277200, 152064, 0x99d6f56b +0, 280800, 152064, 0xc2ca75b9 +0, 284400, 152064, 0x390b7278 +0, 288000, 152064, 0x0f6d1f1e +0, 291600, 152064, 0x79e2a3f4 +0, 295200, 152064, 0x51d5e1da +0, 298800, 152064, 0xdb57419a +0, 302400, 152064, 0xf90a4153 +0, 306000, 152064, 0xd192f6c6 +0, 309600, 152064, 0x8cd3895a +0, 313200, 152064, 0x0d3ec577 +0, 316800, 152064, 0x146e8492 +0, 320400, 152064, 0xc9939c22 +0, 324000, 152064, 0xf1f4275e +0, 327600, 152064, 0xb898eb35 +0, 331200, 152064, 0xed315ee9 +0, 334800, 152064, 0x9046b760 +0, 338400, 152064, 0x599a736b +0, 342000, 152064, 0xaef20726 +0, 345600, 152064, 0x0d136768 +0, 349200, 152064, 0xfe4ed2a8 +0, 352800, 152064, 0x5a85524b +0, 356400, 152064, 0x6d495dd2 +0, 360000, 152064, 0x04bdb815 +0, 363600, 152064, 0x28aae1c5 +0, 367200, 152064, 0xc20bc8d9 +0, 370800, 152064, 0xa33d9b41 +0, 374400, 152064, 0x6269cb43 +0, 378000, 152064, 0x4f81d636 +0, 381600, 152064, 0xc6062166 +0, 385200, 152064, 0xb027fbcc +0, 388800, 152064, 0x73a7a584 +0, 392400, 152064, 0xf67e520a +0, 396000, 152064, 0x94eff023 +0, 399600, 152064, 0xef1da8e5 +0, 403200, 152064, 0x2d9ab411 +0, 406800, 152064, 0xf0c39b5d +0, 410400, 152064, 0xb2374724 +0, 414000, 152064, 0x939a5243 +0, 417600, 152064, 0xee3438db +0, 421200, 152064, 0x7da04012 +0, 424800, 152064, 0xac611668 +0, 428400, 152064, 0xdce3062e +0, 432000, 152064, 0xb57cc00e +0, 435600, 152064, 0xaf96b59e +0, 439200, 152064, 0x56789c13 +0, 442800, 152064, 0xb1f678b5 +0, 446400, 152064, 0xb340b8c4 +0, 450000, 152064, 0x86e6e304 +0, 453600, 152064, 0xa056e037 +0, 457200, 152064, 0x16885d27 +0, 460800, 152064, 0x9c5ac065 +0, 464400, 152064, 0x563d5335 +0, 468000, 152064, 0x3ca71c1e +0, 471600, 152064, 0xad34e16c +0, 475200, 152064, 0x6d074b27 +0, 478800, 152064, 0x9b1c4909 +0, 482400, 152064, 0xdbced198 +0, 486000, 152064, 0x8a0ded00 +0, 489600, 152064, 0x5ffc209b +0, 493200, 152064, 0x47cfd269 +0, 496800, 152064, 0xe3c0137e +0, 500400, 152064, 0xcb6a5e53 +0, 504000, 152064, 0x87cec05f +0, 507600, 152064, 0x92721dd2 +0, 511200, 152064, 0x3f7d7b3b +0, 514800, 152064, 0xd63ef417 +0, 518400, 152064, 0xf8e4b05a +0, 522000, 152064, 0xb5dcb421 +0, 525600, 152064, 0x53c96f6a +0, 529200, 152064, 0x24ae98a3 +0, 532800, 152064, 0x2e9b5fff +0, 536400, 152064, 0x7795bf12 +0, 540000, 152064, 0x499d37ca +0, 543600, 152064, 0xfe478487 +0, 547200, 152064, 0xcd661afb +0, 550800, 152064, 0x44f8bf00 +0, 554400, 152064, 0x90b67809 +0, 558000, 152064, 0x8f5726d1 +0, 561600, 152064, 0x2e3c39d5 +0, 565200, 152064, 0x4b67c4e6 +0, 568800, 152064, 0x9fecb7cf +0, 572400, 152064, 0x207766ea +0, 576000, 152064, 0x5846bf7b +0, 579600, 152064, 0x4237fba1 +0, 583200, 152064, 0x983e0cbd +0, 586800, 152064, 0x6be100d1 +0, 590400, 152064, 0x9d0beb8f +0, 594000, 152064, 0x234b82e7 +0, 597600, 152064, 0x83fb5ef1 +0, 601200, 152064, 0xf503dcb2 +0, 604800, 152064, 0x031a27f2 +0, 608400, 152064, 0x2f1abf24 +0, 612000, 152064, 0x54d77010 +0, 615600, 152064, 0x049fc0fc +0, 619200, 152064, 0x20f2f7e7 +0, 622800, 152064, 0xc0d57467 +0, 626400, 152064, 0xbe464eef +0, 630000, 152064, 0x035c9052 +0, 633600, 152064, 0x91cba4fb +0, 637200, 152064, 0x11cdbbfb +0, 640800, 152064, 0xe61116d5 +0, 644400, 152064, 0x16db46b8 +0, 648000, 152064, 0x54f30d9f +0, 651600, 152064, 0x211a8d2d +0, 655200, 152064, 0x5a74a56b +0, 658800, 152064, 0x0ff4ba72 +0, 662400, 152064, 0x4c398ad6 +0, 666000, 152064, 0x830814f0 +0, 669600, 152064, 0xa51f4bab +0, 673200, 152064, 0xf3460de6 +0, 676800, 152064, 0x7e1979a1 +0, 680400, 152064, 0x4b3ebb3a +0, 684000, 152064, 0x83d1f4f8 +0, 687600, 152064, 0xfbf08683 +0, 691200, 152064, 0x901c07ec +0, 694800, 152064, 0xbc2dc1c7 +0, 698400, 152064, 0x6e646b3b +0, 702000, 152064, 0x51a25aab +0, 705600, 152064, 0xa042ab78 +0, 709200, 152064, 0xb972af58 +0, 712800, 152064, 0xcdca9568 +0, 716400, 152064, 0x17b69d1c +0, 720000, 152064, 0x41c43ea2 +0, 723600, 152064, 0x195fc7a0 +0, 727200, 152064, 0xf4cec580 +0, 730800, 152064, 0xb3b10936 +0, 734400, 152064, 0x102bc2ec +0, 738000, 152064, 0xc99d4767 +0, 741600, 152064, 0x60c745b0 +0, 745200, 152064, 0x8176e0cf +0, 748800, 152064, 0xd47e69b5 +0, 752400, 152064, 0xacce674c +0, 756000, 152064, 0x031b51f8 +0, 759600, 152064, 0x0eb681ef +0, 763200, 152064, 0x0b69334b +0, 766800, 152064, 0xda819c1f +0, 770400, 152064, 0xa93f62d2 +0, 774000, 152064, 0x51374db5 +0, 777600, 152064, 0x885dccff +0, 781200, 152064, 0xd0780444 +0, 784800, 152064, 0xa31733ca +0, 788400, 152064, 0x3f3de84e +0, 792000, 152064, 0x2af2b2c3 +0, 795600, 152064, 0xa62dceae +0, 799200, 152064, 0xca1cffd1 +0, 802800, 152064, 0x3c7d561b +0, 806400, 152064, 0xbc04130a +0, 810000, 152064, 0xbd2829ae +0, 813600, 152064, 0xdbbb9820 +0, 817200, 152064, 0xfc3ef628 +0, 820800, 152064, 0xd5da3ec3 +0, 824400, 152064, 0x62d5fcc1 +0, 828000, 152064, 0x455a8dae +0, 831600, 152064, 0x421c9147 +0, 835200, 152064, 0x6a168484 +0, 838800, 152064, 0x7ba15d32 +0, 842400, 152064, 0xd089ed27 +0, 846000, 152064, 0x8fc4d894 +0, 849600, 152064, 0x99e47125 +0, 853200, 152064, 0xf55dda68 +0, 856800, 152064, 0x6bf06cf1 +0, 860400, 152064, 0x7dc41a9d +0, 864000, 152064, 0x78b84019 +0, 867600, 152064, 0x85ae8973 +0, 871200, 152064, 0x7b7aeabe +0, 874800, 152064, 0xf9a8f6bf +0, 878400, 152064, 0xe195ddcd +0, 882000, 152064, 0x83edffe9 +0, 885600, 152064, 0x59cce97a +0, 889200, 152064, 0x15268af1 +0, 892800, 152064, 0x270cca95 +0, 896400, 152064, 0x8bced1f9 +0, 900000, 152064, 0x08ee5cec +0, 903600, 152064, 0x01e74f95 +0, 907200, 152064, 0x7e19238f +0, 910800, 152064, 0x6bcb2b9d +0, 914400, 152064, 0x58111385 +0, 918000, 152064, 0x6c7aa1f7 +0, 921600, 152064, 0xb713a822 +0, 925200, 152064, 0x1d645cee +0, 928800, 152064, 0x9c592969 +0, 932400, 152064, 0x2472769e +0, 936000, 152064, 0x71b7a5ad +0, 939600, 152064, 0xc6bba1c6 +0, 943200, 152064, 0x7351f305 +0, 946800, 152064, 0x579edbba +0, 950400, 152064, 0x90eda919 +0, 954000, 152064, 0x2833b10d +0, 957600, 152064, 0x4b967d65 +0, 961200, 152064, 0x6e7d1702 +0, 964800, 152064, 0x59dbcf5b +0, 968400, 152064, 0xa138847b +0, 972000, 152064, 0xb2414e8d +0, 975600, 152064, 0xb90497f6 +0, 979200, 152064, 0xcd728159 +0, 982800, 152064, 0x005d5bdd +0, 986400, 152064, 0x27c88fb6 +0, 990000, 152064, 0x3ccb8a93 +0, 993600, 152064, 0xc50256dd +0, 997200, 152064, 0x111e7dee +0, 1000800, 152064, 0x259d4a5d +0, 1004400, 152064, 0x9385148b +0, 1008000, 152064, 0x74002ab0 +0, 1011600, 152064, 0xd2c74adc +0, 1015200, 152064, 0x72854b2a +0, 1018800, 152064, 0x638e5c08 +0, 1022400, 152064, 0x9626bbb3 +0, 1026000, 152064, 0xc107c18f +0, 1029600, 152064, 0x8bd04578 +0, 1033200, 152064, 0xbcdb6db6 +0, 1036800, 152064, 0x9d0c81be +0, 1040400, 152064, 0xf25106b6 +0, 1044000, 152064, 0x54c25254 +0, 1047600, 152064, 0x4bf74663 +0, 1051200, 152064, 0x0051b054 +0, 1054800, 152064, 0x5193d3d4 +0, 1058400, 152064, 0xb5d0d045 +0, 1062000, 152064, 0x350a31ca +0, 1065600, 152064, 0xb8fb7264 +0, 1069200, 152064, 0x7fb97645 +0, 1072800, 152064, 0xcd948c41 +0, 1076400, 152064, 0x38c7570a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcadq_brcm_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcadq_brcm_b new file mode 100644 index 00000000..b5778dd3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcadq_brcm_b @@ -0,0 +1,300 @@ +0, 0, 152064, 0xf3c68dea +0, 3600, 152064, 0xf52d483f +0, 7200, 152064, 0x612f1792 +0, 10800, 152064, 0x4df34726 +0, 14400, 152064, 0xfed7c058 +0, 18000, 152064, 0x2d48025c +0, 21600, 152064, 0x03544ab9 +0, 25200, 152064, 0x20cadfc5 +0, 28800, 152064, 0x7cd3672e +0, 32400, 152064, 0x5f2b9ede +0, 36000, 152064, 0xc0bbdf75 +0, 39600, 152064, 0x95571e7c +0, 43200, 152064, 0x0d1afc5b +0, 46800, 152064, 0x9c91c11f +0, 50400, 152064, 0x73e667e4 +0, 54000, 152064, 0xfb7f8892 +0, 57600, 152064, 0x5707f566 +0, 61200, 152064, 0x21032449 +0, 64800, 152064, 0x199e20b7 +0, 68400, 152064, 0x23213179 +0, 72000, 152064, 0x29812daa +0, 75600, 152064, 0x04e3eb6b +0, 79200, 152064, 0xab206165 +0, 82800, 152064, 0x392fbf7b +0, 86400, 152064, 0x137a1c6a +0, 90000, 152064, 0x9caff265 +0, 93600, 152064, 0x6becf046 +0, 97200, 152064, 0xfc2c3ba6 +0, 100800, 152064, 0xcf4b9b4c +0, 104400, 152064, 0x4e2ebd37 +0, 108000, 152064, 0xcd419daa +0, 111600, 152064, 0xe12294b0 +0, 115200, 152064, 0x6bda7493 +0, 118800, 152064, 0xefbf5d0b +0, 122400, 152064, 0x9500458a +0, 126000, 152064, 0x6b5d212e +0, 129600, 152064, 0xb928fc31 +0, 133200, 152064, 0x64f2bb2f +0, 136800, 152064, 0xf93a724d +0, 140400, 152064, 0xdd0d32c0 +0, 144000, 152064, 0xe1b51d95 +0, 147600, 152064, 0xbb43d295 +0, 151200, 152064, 0x6dcea069 +0, 154800, 152064, 0x89d79805 +0, 158400, 152064, 0x50b5dd43 +0, 162000, 152064, 0xe3099e3f +0, 165600, 152064, 0x003b6ace +0, 169200, 152064, 0x2213b672 +0, 172800, 152064, 0x5b273093 +0, 176400, 152064, 0xdbfbd9bf +0, 180000, 152064, 0xf26b89d0 +0, 183600, 152064, 0x1470527e +0, 187200, 152064, 0x0e668970 +0, 190800, 152064, 0x00218692 +0, 194400, 152064, 0xaabf79a8 +0, 198000, 152064, 0xf68b4663 +0, 201600, 152064, 0x4c08d01f +0, 205200, 152064, 0x48e75380 +0, 208800, 152064, 0x4b8be58f +0, 212400, 152064, 0x8a6c1365 +0, 216000, 152064, 0x9439ca02 +0, 219600, 152064, 0x831d9855 +0, 223200, 152064, 0xff031ffd +0, 226800, 152064, 0x3680f4bc +0, 230400, 152064, 0x794c95a4 +0, 234000, 152064, 0x23e53349 +0, 237600, 152064, 0x85307117 +0, 241200, 152064, 0x0bc0bf5a +0, 244800, 152064, 0xc79f46c8 +0, 248400, 152064, 0x48be4e21 +0, 252000, 152064, 0x2ad89b4f +0, 255600, 152064, 0xd454f9a9 +0, 259200, 152064, 0x64852f6d +0, 262800, 152064, 0xcb7b0c05 +0, 266400, 152064, 0x4e108ced +0, 270000, 152064, 0xf5e5a37b +0, 273600, 152064, 0x224e29c7 +0, 277200, 152064, 0xad90d3c2 +0, 280800, 152064, 0x5ddb5d05 +0, 284400, 152064, 0x4ebf4337 +0, 288000, 152064, 0x7e2bfeed +0, 291600, 152064, 0x00e884c7 +0, 295200, 152064, 0xa4f6a534 +0, 298800, 152064, 0x622f1511 +0, 302400, 152064, 0x8d99233d +0, 306000, 152064, 0x5910d02c +0, 309600, 152064, 0x20d6706c +0, 313200, 152064, 0x8e30a417 +0, 316800, 152064, 0x180d745a +0, 320400, 152064, 0xc25189b9 +0, 324000, 152064, 0x909101ad +0, 327600, 152064, 0x9967be1c +0, 331200, 152064, 0x72ff3206 +0, 334800, 152064, 0x48d07f48 +0, 338400, 152064, 0x7f8244b7 +0, 342000, 152064, 0xf871e21e +0, 345600, 152064, 0xd4743610 +0, 349200, 152064, 0xc2c7a7b1 +0, 352800, 152064, 0x95be1a75 +0, 356400, 152064, 0x44972b2e +0, 360000, 152064, 0xa6036c4f +0, 363600, 152064, 0xecdd8dd6 +0, 367200, 152064, 0xbb7e8551 +0, 370800, 152064, 0x42916e6c +0, 374400, 152064, 0x972db010 +0, 378000, 152064, 0x80dab6a0 +0, 381600, 152064, 0xc753ecdb +0, 385200, 152064, 0x0823bffa +0, 388800, 152064, 0x80876b2d +0, 392400, 152064, 0x4a8b2118 +0, 396000, 152064, 0x0be2c13d +0, 399600, 152064, 0xa6966e4f +0, 403200, 152064, 0xf6a57650 +0, 406800, 152064, 0x49d66fd4 +0, 410400, 152064, 0x21d92047 +0, 414000, 152064, 0x155f20a8 +0, 417600, 152064, 0x5ab90c1d +0, 421200, 152064, 0xa0c31337 +0, 424800, 152064, 0xd20de1d6 +0, 428400, 152064, 0x300ad916 +0, 432000, 152064, 0xbcb89eb5 +0, 435600, 152064, 0x08759342 +0, 439200, 152064, 0xa5d06e72 +0, 442800, 152064, 0x3b4c537f +0, 446400, 152064, 0x7f48912b +0, 450000, 152064, 0x200dbd1f +0, 453600, 152064, 0x918abfde +0, 457200, 152064, 0xd8072cdf +0, 460800, 152064, 0x89d2902b +0, 464400, 152064, 0xcd2e2e3c +0, 468000, 152064, 0xf343e4a2 +0, 471600, 152064, 0xc424acad +0, 475200, 152064, 0xf71e3031 +0, 478800, 152064, 0xf1bc1179 +0, 482400, 152064, 0x9af58d24 +0, 486000, 152064, 0x48a4d01e +0, 489600, 152064, 0xcf24f721 +0, 493200, 152064, 0x5bc7b4f3 +0, 496800, 152064, 0x8763fc59 +0, 500400, 152064, 0xb6954051 +0, 504000, 152064, 0x044ba446 +0, 507600, 152064, 0xdaaaee7e +0, 511200, 152064, 0x8eac550d +0, 514800, 152064, 0x5191d08c +0, 518400, 152064, 0x3cd76d43 +0, 522000, 152064, 0xf01f8fa9 +0, 525600, 152064, 0x0e283e9b +0, 529200, 152064, 0x7cef69ee +0, 532800, 152064, 0xc8e332bc +0, 536400, 152064, 0x5b1aa484 +0, 540000, 152064, 0x3975234f +0, 543600, 152064, 0x52b8661e +0, 547200, 152064, 0xb4b8fed8 +0, 550800, 152064, 0x5aff9f70 +0, 554400, 152064, 0x7b575735 +0, 558000, 152064, 0x77d51523 +0, 561600, 152064, 0xf5131eba +0, 565200, 152064, 0x4bd2b1ad +0, 568800, 152064, 0xccfc8dca +0, 572400, 152064, 0xcf245472 +0, 576000, 152064, 0xe055adf5 +0, 579600, 152064, 0x2a90e171 +0, 583200, 152064, 0x1bd8ea64 +0, 586800, 152064, 0x32f1d794 +0, 590400, 152064, 0xc938c42a +0, 594000, 152064, 0x12b5644f +0, 597600, 152064, 0x99003711 +0, 601200, 152064, 0xaecfad1c +0, 604800, 152064, 0x94b00ae1 +0, 608400, 152064, 0xbb4f982f +0, 612000, 152064, 0x6f7f5dc1 +0, 615600, 152064, 0x7be7c2cb +0, 619200, 152064, 0x3b2ee4d3 +0, 622800, 152064, 0xc75f5666 +0, 626400, 152064, 0xff7a3ede +0, 630000, 152064, 0x55866b59 +0, 633600, 152064, 0x408b8455 +0, 637200, 152064, 0x96c4ab66 +0, 640800, 152064, 0x1d87f575 +0, 644400, 152064, 0x3a3b17ac +0, 648000, 152064, 0x9c99e591 +0, 651600, 152064, 0xc1fc663d +0, 655200, 152064, 0x17b982dd +0, 658800, 152064, 0x24fe9dad +0, 662400, 152064, 0xea8760ee +0, 666000, 152064, 0x23dcefad +0, 669600, 152064, 0xee6d23f0 +0, 673200, 152064, 0xfddc1962 +0, 676800, 152064, 0xb23190df +0, 680400, 152064, 0xf066a595 +0, 684000, 152064, 0x2200fef8 +0, 687600, 152064, 0x5491ab2f +0, 691200, 152064, 0xea93fa58 +0, 694800, 152064, 0x3e13d4f4 +0, 698400, 152064, 0x3dda841d +0, 702000, 152064, 0xfc243577 +0, 705600, 152064, 0xca4a9127 +0, 709200, 152064, 0x41908ec0 +0, 712800, 152064, 0x10a758bd +0, 716400, 152064, 0x6a849e5b +0, 720000, 152064, 0xb55a1f2b +0, 723600, 152064, 0x2bfe9627 +0, 727200, 152064, 0x2bfca28c +0, 730800, 152064, 0xd166f336 +0, 734400, 152064, 0x9facb32b +0, 738000, 152064, 0x6a672475 +0, 741600, 152064, 0xc7b219cf +0, 745200, 152064, 0x2b43ca53 +0, 748800, 152064, 0x43b542c4 +0, 752400, 152064, 0xdc654337 +0, 756000, 152064, 0x68003d7c +0, 759600, 152064, 0x3cb85724 +0, 763200, 152064, 0x422701c2 +0, 766800, 152064, 0x1c667870 +0, 770400, 152064, 0x75ef3230 +0, 774000, 152064, 0x0ac82643 +0, 777600, 152064, 0x3eb3a0be +0, 781200, 152064, 0x482bd77e +0, 784800, 152064, 0xd3ce1171 +0, 788400, 152064, 0xeaefc7e4 +0, 792000, 152064, 0xa9c67939 +0, 795600, 152064, 0x0af0a25b +0, 799200, 152064, 0xd094d95a +0, 802800, 152064, 0xfda42fc6 +0, 806400, 152064, 0x4669f952 +0, 810000, 152064, 0x52d40e98 +0, 813600, 152064, 0x27c36cd1 +0, 817200, 152064, 0xa103b6ce +0, 820800, 152064, 0x2be9026d +0, 824400, 152064, 0x2f4ecc59 +0, 828000, 152064, 0x53144cef +0, 831600, 152064, 0x15d54fc9 +0, 835200, 152064, 0x7e302db7 +0, 838800, 152064, 0x82521901 +0, 842400, 152064, 0x1123cdb6 +0, 846000, 152064, 0x3185878a +0, 849600, 152064, 0xbb294983 +0, 853200, 152064, 0x83d9fe66 +0, 856800, 152064, 0xede9fb08 +0, 860400, 152064, 0xa543b551 +0, 864000, 152064, 0x39e82734 +0, 867600, 152064, 0xd0447fb5 +0, 871200, 152064, 0x8cc6f502 +0, 874800, 152064, 0xda8d1da8 +0, 878400, 152064, 0xcafdccca +0, 882000, 152064, 0xbf0e04f4 +0, 885600, 152064, 0x0c6eefec +0, 889200, 152064, 0xb9026d39 +0, 892800, 152064, 0x0121a7a8 +0, 896400, 152064, 0x453ebbc6 +0, 900000, 152064, 0x14ae15e3 +0, 903600, 152064, 0x51d618e1 +0, 907200, 152064, 0x2254f452 +0, 910800, 152064, 0x8c360633 +0, 914400, 152064, 0x8704d9bc +0, 918000, 152064, 0xe5d48301 +0, 921600, 152064, 0xf25b7b3f +0, 925200, 152064, 0xd2ad3b73 +0, 928800, 152064, 0x53db0387 +0, 932400, 152064, 0x2486341c +0, 936000, 152064, 0x4a24570b +0, 939600, 152064, 0x0694620a +0, 943200, 152064, 0xbbc2a302 +0, 946800, 152064, 0x08ad9c02 +0, 950400, 152064, 0x601a63ab +0, 954000, 152064, 0xe4234a48 +0, 957600, 152064, 0x07702235 +0, 961200, 152064, 0x719dbecf +0, 964800, 152064, 0xf301a7ad +0, 968400, 152064, 0xf15c70c3 +0, 972000, 152064, 0x0ab93386 +0, 975600, 152064, 0x99c05adb +0, 979200, 152064, 0x9ed43530 +0, 982800, 152064, 0xa2f62122 +0, 986400, 152064, 0xf16f4525 +0, 990000, 152064, 0xa3403b4a +0, 993600, 152064, 0x95521096 +0, 997200, 152064, 0x0d412988 +0, 1000800, 152064, 0x829e080a +0, 1004400, 152064, 0x0805c1b5 +0, 1008000, 152064, 0xa136be48 +0, 1011600, 152064, 0x0f8de228 +0, 1015200, 152064, 0x272cf2d3 +0, 1018800, 152064, 0xa1df2a5e +0, 1022400, 152064, 0xf9db8350 +0, 1026000, 152064, 0x5536997d +0, 1029600, 152064, 0xab83e81e +0, 1033200, 152064, 0xec791b49 +0, 1036800, 152064, 0x04d03e19 +0, 1040400, 152064, 0xd6a2bd21 +0, 1044000, 152064, 0x2d35f0aa +0, 1047600, 152064, 0x137bf715 +0, 1051200, 152064, 0x56ef5ae1 +0, 1054800, 152064, 0x9bb5821e +0, 1058400, 152064, 0x533c7fff +0, 1062000, 152064, 0x469ad380 +0, 1065600, 152064, 0x75710e84 +0, 1069200, 152064, 0xbbd72551 +0, 1072800, 152064, 0xf1137026 +0, 1076400, 152064, 0x6238412b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcafl_bcrm_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcafl_bcrm_c new file mode 100644 index 00000000..a67b4bae --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcafl_bcrm_c @@ -0,0 +1,300 @@ +0, 0, 152064, 0x502ec077 +0, 3600, 152064, 0x84807243 +0, 7200, 152064, 0xd7474a6e +0, 10800, 152064, 0x793469bb +0, 14400, 152064, 0xb7a0faf7 +0, 18000, 152064, 0x1d3d3cba +0, 21600, 152064, 0xb62583de +0, 25200, 152064, 0xc8422fb1 +0, 28800, 152064, 0x321dc699 +0, 32400, 152064, 0x7a34d350 +0, 36000, 152064, 0xaa4c302d +0, 39600, 152064, 0x45fa7ab0 +0, 43200, 152064, 0xc7262e41 +0, 46800, 152064, 0x3550000c +0, 50400, 152064, 0xf4bab54b +0, 54000, 152064, 0xaccf9c1a +0, 57600, 152064, 0x9bee20e9 +0, 61200, 152064, 0x47fb7720 +0, 64800, 152064, 0x12c63ffb +0, 68400, 152064, 0xfa2b8b4d +0, 72000, 152064, 0x279964bd +0, 75600, 152064, 0xb8b01c7e +0, 79200, 152064, 0x816fa010 +0, 82800, 152064, 0x59fe1c8c +0, 86400, 152064, 0x13393fad +0, 90000, 152064, 0x991a50a4 +0, 93600, 152064, 0x57df3eb7 +0, 97200, 152064, 0x744371df +0, 100800, 152064, 0xe9f6d3ff +0, 104400, 152064, 0xc506fba0 +0, 108000, 152064, 0x6295b90e +0, 111600, 152064, 0xa19cee2d +0, 115200, 152064, 0xf8c1b3ca +0, 118800, 152064, 0x69f68ce0 +0, 122400, 152064, 0x80558bb6 +0, 126000, 152064, 0x27824fa5 +0, 129600, 152064, 0x27c929a1 +0, 133200, 152064, 0xc0fe06d1 +0, 136800, 152064, 0xc52bc58c +0, 140400, 152064, 0x0a5363c7 +0, 144000, 152064, 0xd0f45a0d +0, 147600, 152064, 0x274710f9 +0, 151200, 152064, 0x89d2d390 +0, 154800, 152064, 0x12a9bfb0 +0, 158400, 152064, 0x04501a93 +0, 162000, 152064, 0xf92cbbf4 +0, 165600, 152064, 0xf6d1b27d +0, 169200, 152064, 0xe3e904c3 +0, 172800, 152064, 0x58f8516d +0, 176400, 152064, 0x70370c2b +0, 180000, 152064, 0xfeebc88c +0, 183600, 152064, 0x974c6ed6 +0, 187200, 152064, 0x401bdcf2 +0, 190800, 152064, 0xfe61e278 +0, 194400, 152064, 0x96ba8bb9 +0, 198000, 152064, 0x988492fd +0, 201600, 152064, 0xd1d913a9 +0, 205200, 152064, 0x6bc46f0e +0, 208800, 152064, 0x695ef706 +0, 212400, 152064, 0x142045c9 +0, 216000, 152064, 0xb390ed87 +0, 219600, 152064, 0xb9e6d2e5 +0, 223200, 152064, 0xe348797f +0, 226800, 152064, 0x1cbd29d6 +0, 230400, 152064, 0xbd7dd694 +0, 234000, 152064, 0x516873c3 +0, 237600, 152064, 0x27bba182 +0, 241200, 152064, 0x7541f920 +0, 244800, 152064, 0xfdf67042 +0, 248400, 152064, 0x6c3c7896 +0, 252000, 152064, 0xed86c467 +0, 255600, 152064, 0x4ea83ca2 +0, 259200, 152064, 0xa3e6725b +0, 262800, 152064, 0x917f5f16 +0, 266400, 152064, 0x8cf2d2e1 +0, 270000, 152064, 0x57a8d116 +0, 273600, 152064, 0x0db267d4 +0, 277200, 152064, 0xce782ac5 +0, 280800, 152064, 0x1c9d8518 +0, 284400, 152064, 0x47598ac7 +0, 288000, 152064, 0xc5033d97 +0, 291600, 152064, 0xd7aaa3a4 +0, 295200, 152064, 0x078afc96 +0, 298800, 152064, 0xc9fe673d +0, 302400, 152064, 0xe9284066 +0, 306000, 152064, 0xbc570982 +0, 309600, 152064, 0x0aac8574 +0, 313200, 152064, 0x098cbeee +0, 316800, 152064, 0x19c36a9d +0, 320400, 152064, 0x8fe4a893 +0, 324000, 152064, 0x0b652f17 +0, 327600, 152064, 0x10f2e6bf +0, 331200, 152064, 0x7ce5634e +0, 334800, 152064, 0x8fe4ac6c +0, 338400, 152064, 0xcaba749e +0, 342000, 152064, 0x5f8a0d5c +0, 345600, 152064, 0xcaa66bbc +0, 349200, 152064, 0xc87ae617 +0, 352800, 152064, 0xe8ef4dd7 +0, 356400, 152064, 0xdfca5a07 +0, 360000, 152064, 0x5f7eab7d +0, 363600, 152064, 0x8a65ebbb +0, 367200, 152064, 0x4beab4a0 +0, 370800, 152064, 0xb5e6ab30 +0, 374400, 152064, 0x8fe4f4d4 +0, 378000, 152064, 0x95bde1ca +0, 381600, 152064, 0xcc5e3a53 +0, 385200, 152064, 0xf09f1dd7 +0, 388800, 152064, 0x10179672 +0, 392400, 152064, 0x4ad16184 +0, 396000, 152064, 0x9efa0e23 +0, 399600, 152064, 0x22f59522 +0, 403200, 152064, 0x4d38f09d +0, 406800, 152064, 0x4c5ebf56 +0, 410400, 152064, 0xb19d5077 +0, 414000, 152064, 0xa98576b9 +0, 417600, 152064, 0x65324239 +0, 421200, 152064, 0x709e4031 +0, 424800, 152064, 0xf8e81681 +0, 428400, 152064, 0x058514e5 +0, 432000, 152064, 0xd1d1c806 +0, 435600, 152064, 0x0e4dde57 +0, 439200, 152064, 0x49e9c2bb +0, 442800, 152064, 0x01417ce6 +0, 446400, 152064, 0xda7ebbf1 +0, 450000, 152064, 0xa22906b7 +0, 453600, 152064, 0x32e2df87 +0, 457200, 152064, 0x69917c8f +0, 460800, 152064, 0xea8ed2cc +0, 464400, 152064, 0x0b8d57f1 +0, 468000, 152064, 0x5f683bcd +0, 471600, 152064, 0x5162fe2f +0, 475200, 152064, 0x49c052f8 +0, 478800, 152064, 0x990b69ba +0, 482400, 152064, 0xa6d4f99f +0, 486000, 152064, 0xe79ef4da +0, 489600, 152064, 0x5e8a3847 +0, 493200, 152064, 0x38b1e75f +0, 496800, 152064, 0xf5c91bed +0, 500400, 152064, 0xd59a6d26 +0, 504000, 152064, 0xc361de06 +0, 507600, 152064, 0x63ed2229 +0, 511200, 152064, 0xb8229205 +0, 514800, 152064, 0x7c6619af +0, 518400, 152064, 0x4126b02f +0, 522000, 152064, 0x9250b99b +0, 525600, 152064, 0x589778f9 +0, 529200, 152064, 0xed1fa45b +0, 532800, 152064, 0x700b6f32 +0, 536400, 152064, 0x0590df55 +0, 540000, 152064, 0x3e9c4018 +0, 543600, 152064, 0x957b8860 +0, 547200, 152064, 0x56161560 +0, 550800, 152064, 0xbc43bc3b +0, 554400, 152064, 0x508d8632 +0, 558000, 152064, 0xbc5736d8 +0, 561600, 152064, 0xed7d3aef +0, 565200, 152064, 0x1dcdda9f +0, 568800, 152064, 0x8ef6d5c9 +0, 572400, 152064, 0x15466acc +0, 576000, 152064, 0x45d4cf67 +0, 579600, 152064, 0x8c900b9d +0, 583200, 152064, 0x747006e0 +0, 586800, 152064, 0xac920a0c +0, 590400, 152064, 0xb8210c27 +0, 594000, 152064, 0x7dbb873a +0, 597600, 152064, 0x0d4d7584 +0, 601200, 152064, 0xefb3fe60 +0, 604800, 152064, 0x905e2644 +0, 608400, 152064, 0x7c04e534 +0, 612000, 152064, 0x8889972a +0, 615600, 152064, 0x21c7d8ad +0, 619200, 152064, 0x1c641176 +0, 622800, 152064, 0xf71489a4 +0, 626400, 152064, 0xd7ac5555 +0, 630000, 152064, 0xb4609c6d +0, 633600, 152064, 0xf5b2bd5e +0, 637200, 152064, 0x9f43ce57 +0, 640800, 152064, 0x77642dd3 +0, 644400, 152064, 0x3e79565c +0, 648000, 152064, 0x95f40b8e +0, 651600, 152064, 0x3c8ca4d4 +0, 655200, 152064, 0xa02ac497 +0, 658800, 152064, 0x4c93b377 +0, 662400, 152064, 0x55f5ac68 +0, 666000, 152064, 0xf8652eca +0, 669600, 152064, 0x56e94574 +0, 673200, 152064, 0x6d8302e1 +0, 676800, 152064, 0x29a57061 +0, 680400, 152064, 0x24e4cfdc +0, 684000, 152064, 0xf5a5d62a +0, 687600, 152064, 0x998870c1 +0, 691200, 152064, 0xa15b1f4e +0, 694800, 152064, 0xb0ccb51f +0, 698400, 152064, 0xeaaf59ab +0, 702000, 152064, 0x7e2b4fe6 +0, 705600, 152064, 0x72299fea +0, 709200, 152064, 0x769da8b2 +0, 712800, 152064, 0xefad7ef8 +0, 716400, 152064, 0x24819983 +0, 720000, 152064, 0x2aad32ab +0, 723600, 152064, 0xc80cac79 +0, 727200, 152064, 0x1659d628 +0, 730800, 152064, 0xef941f66 +0, 734400, 152064, 0x0d7fcdb5 +0, 738000, 152064, 0x7c1853fa +0, 741600, 152064, 0xb94c4d3c +0, 745200, 152064, 0xc47adfc2 +0, 748800, 152064, 0x366a6729 +0, 752400, 152064, 0x7eb37b70 +0, 756000, 152064, 0xafd54c27 +0, 759600, 152064, 0x67b18636 +0, 763200, 152064, 0x93b22dcf +0, 766800, 152064, 0xa64991f1 +0, 770400, 152064, 0xd32a7102 +0, 774000, 152064, 0xff665d1c +0, 777600, 152064, 0xf107cc31 +0, 781200, 152064, 0xf5b25652 +0, 784800, 152064, 0x8caf783d +0, 788400, 152064, 0x72f3eb00 +0, 792000, 152064, 0xb5aea5f8 +0, 795600, 152064, 0xee70e870 +0, 799200, 152064, 0x7c3a0156 +0, 802800, 152064, 0x871b6383 +0, 806400, 152064, 0x48d831ff +0, 810000, 152064, 0xca233913 +0, 813600, 152064, 0xe14bc5eb +0, 817200, 152064, 0x9b1d27e7 +0, 820800, 152064, 0xfb9637f7 +0, 824400, 152064, 0x0c022157 +0, 828000, 152064, 0x16d35fc9 +0, 831600, 152064, 0x6d935f71 +0, 835200, 152064, 0xae4066fa +0, 838800, 152064, 0xcef94fdc +0, 842400, 152064, 0xc234edb9 +0, 846000, 152064, 0x26a4f2e2 +0, 849600, 152064, 0xd29ac23e +0, 853200, 152064, 0xb7604395 +0, 856800, 152064, 0x408084f6 +0, 860400, 152064, 0x0a02026c +0, 864000, 152064, 0x78b33c7c +0, 867600, 152064, 0xcb02b874 +0, 871200, 152064, 0xf566513b +0, 874800, 152064, 0xb34e52b1 +0, 878400, 152064, 0xf55ff493 +0, 882000, 152064, 0xb0e8282a +0, 885600, 152064, 0xe9510bbe +0, 889200, 152064, 0x292e8c5a +0, 892800, 152064, 0x62b9d2b0 +0, 896400, 152064, 0x3a8cc827 +0, 900000, 152064, 0x25cc465e +0, 903600, 152064, 0xf2bc32e2 +0, 907200, 152064, 0x6141f914 +0, 910800, 152064, 0x1171256f +0, 914400, 152064, 0x13cb2ded +0, 918000, 152064, 0x3d4ca557 +0, 921600, 152064, 0xf2b9e72e +0, 925200, 152064, 0x03f7547a +0, 928800, 152064, 0xc7302955 +0, 932400, 152064, 0xe78a46d3 +0, 936000, 152064, 0x3726a270 +0, 939600, 152064, 0x2f65722a +0, 943200, 152064, 0x55acce40 +0, 946800, 152064, 0xf6fa9db2 +0, 950400, 152064, 0x70a36937 +0, 954000, 152064, 0x9313742d +0, 957600, 152064, 0x2eb14e53 +0, 961200, 152064, 0x3d47c9c3 +0, 964800, 152064, 0xd0a90348 +0, 968400, 152064, 0x6ad48088 +0, 972000, 152064, 0x68e64738 +0, 975600, 152064, 0x04c3735a +0, 979200, 152064, 0x51d0593f +0, 982800, 152064, 0x42cf2b48 +0, 986400, 152064, 0xa5496a0c +0, 990000, 152064, 0x84c25549 +0, 993600, 152064, 0x96691600 +0, 997200, 152064, 0x423135db +0, 1000800, 152064, 0x8d2e08b6 +0, 1004400, 152064, 0xaeb4c840 +0, 1008000, 152064, 0xf3e71780 +0, 1011600, 152064, 0x8858228b +0, 1015200, 152064, 0xf28613f8 +0, 1018800, 152064, 0xb5327882 +0, 1022400, 152064, 0xbb60bb85 +0, 1026000, 152064, 0x345ab1c9 +0, 1029600, 152064, 0x8aac2cba +0, 1033200, 152064, 0x7ce15b4c +0, 1036800, 152064, 0xc09c55c0 +0, 1040400, 152064, 0x8482ddd6 +0, 1044000, 152064, 0xab222a13 +0, 1047600, 152064, 0xd39b0dea +0, 1051200, 152064, 0x6dab6e06 +0, 1054800, 152064, 0xec0891bd +0, 1058400, 152064, 0x88bd9701 +0, 1062000, 152064, 0xdf13072a +0, 1065600, 152064, 0x23b33081 +0, 1069200, 152064, 0x63943137 +0, 1072800, 152064, 0xab6a9052 +0, 1076400, 152064, 0x05485494 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcaflnl_bcrm_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcaflnl_bcrm_c new file mode 100644 index 00000000..97d76770 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcaflnl_bcrm_c @@ -0,0 +1,300 @@ +0, 0, 152064, 0x3e39c08b +0, 3600, 152064, 0xabc67990 +0, 7200, 152064, 0x19614e74 +0, 10800, 152064, 0xa3776beb +0, 14400, 152064, 0xcce6ffdf +0, 18000, 152064, 0xb0e94746 +0, 21600, 152064, 0xdb1a84ef +0, 25200, 152064, 0xb2624509 +0, 28800, 152064, 0x32e2d826 +0, 32400, 152064, 0xb3bddf0b +0, 36000, 152064, 0x2e273ce3 +0, 39600, 152064, 0x67af7e4d +0, 43200, 152064, 0x505c3261 +0, 46800, 152064, 0xa43d015e +0, 50400, 152064, 0xad41c1f6 +0, 54000, 152064, 0x633ba55f +0, 57600, 152064, 0xe80634f0 +0, 61200, 152064, 0x80a07dc9 +0, 64800, 152064, 0x0e7a3bbf +0, 68400, 152064, 0xcb099196 +0, 72000, 152064, 0x57c96db5 +0, 75600, 152064, 0xccd422fa +0, 79200, 152064, 0x0850b7a7 +0, 82800, 152064, 0x30e33156 +0, 86400, 152064, 0x34e13f9a +0, 90000, 152064, 0x03d36000 +0, 93600, 152064, 0xbf7d49da +0, 97200, 152064, 0x77336d09 +0, 100800, 152064, 0xca8be5a9 +0, 104400, 152064, 0xe57c0b08 +0, 108000, 152064, 0xbe77c093 +0, 111600, 152064, 0x6bf1ff05 +0, 115200, 152064, 0x9142babf +0, 118800, 152064, 0x08db8e67 +0, 122400, 152064, 0x69ac8cb6 +0, 126000, 152064, 0xaa3b5c88 +0, 129600, 152064, 0x9bd32638 +0, 133200, 152064, 0x7972115a +0, 136800, 152064, 0x5c1dd47b +0, 140400, 152064, 0x8a196e02 +0, 144000, 152064, 0xa89672bc +0, 147600, 152064, 0x27b220e4 +0, 151200, 152064, 0xfa38dc4a +0, 154800, 152064, 0x4784c639 +0, 158400, 152064, 0xa5e4229a +0, 162000, 152064, 0xa986bdfc +0, 165600, 152064, 0x2951b47b +0, 169200, 152064, 0x4df404a6 +0, 172800, 152064, 0xc75155e8 +0, 176400, 152064, 0xfc05248c +0, 180000, 152064, 0x5d53da10 +0, 183600, 152064, 0x284376ec +0, 187200, 152064, 0x19fce380 +0, 190800, 152064, 0x876be6c9 +0, 194400, 152064, 0x39eb8ff9 +0, 198000, 152064, 0x289c9543 +0, 201600, 152064, 0x24dd2356 +0, 205200, 152064, 0x1dc17d3c +0, 208800, 152064, 0xd17c00ac +0, 212400, 152064, 0xc2ad54de +0, 216000, 152064, 0xbe11ee2f +0, 219600, 152064, 0x3db9dc89 +0, 223200, 152064, 0xac0d7bc2 +0, 226800, 152064, 0x8dab2dde +0, 230400, 152064, 0x566ad225 +0, 234000, 152064, 0x587c7853 +0, 237600, 152064, 0x601c9c80 +0, 241200, 152064, 0x2afaf751 +0, 244800, 152064, 0x1c9f7e3a +0, 248400, 152064, 0x899475bf +0, 252000, 152064, 0x0d65c7d9 +0, 255600, 152064, 0xafd63d12 +0, 259200, 152064, 0x162e62b9 +0, 262800, 152064, 0x5c9554be +0, 266400, 152064, 0x35fbdaa2 +0, 270000, 152064, 0x6438cbd8 +0, 273600, 152064, 0xde0772c9 +0, 277200, 152064, 0x79f82854 +0, 280800, 152064, 0x86957840 +0, 284400, 152064, 0xd9468cbf +0, 288000, 152064, 0x23e74609 +0, 291600, 152064, 0x3919a146 +0, 295200, 152064, 0xd641078b +0, 298800, 152064, 0x24397220 +0, 302400, 152064, 0xe7fc3a7c +0, 306000, 152064, 0x3997154a +0, 309600, 152064, 0x2af3952c +0, 313200, 152064, 0x274ac07a +0, 316800, 152064, 0x288f7b09 +0, 320400, 152064, 0xe6f9b022 +0, 324000, 152064, 0xf09e2fbb +0, 327600, 152064, 0x7244e477 +0, 331200, 152064, 0x0dfc72eb +0, 334800, 152064, 0x0322b21f +0, 338400, 152064, 0x18b08205 +0, 342000, 152064, 0x6606153e +0, 345600, 152064, 0x85186272 +0, 349200, 152064, 0x3369f064 +0, 352800, 152064, 0xbe0d5a44 +0, 356400, 152064, 0x320258bb +0, 360000, 152064, 0x4d6fb091 +0, 363600, 152064, 0xc9bbf5e7 +0, 367200, 152064, 0x0aa1b69b +0, 370800, 152064, 0x85b9ac11 +0, 374400, 152064, 0xb25ff818 +0, 378000, 152064, 0xa155dc25 +0, 381600, 152064, 0xa8e03bfd +0, 385200, 152064, 0x0a862956 +0, 388800, 152064, 0x11b49264 +0, 392400, 152064, 0xa94e664e +0, 396000, 152064, 0x330e0fa2 +0, 399600, 152064, 0xaf3d9518 +0, 403200, 152064, 0x0836f2e8 +0, 406800, 152064, 0xbf6dc578 +0, 410400, 152064, 0x7b524d20 +0, 414000, 152064, 0x9ef7677f +0, 417600, 152064, 0xeacf3f34 +0, 421200, 152064, 0xfb4e3dbe +0, 424800, 152064, 0xb46e25cb +0, 428400, 152064, 0x363c1603 +0, 432000, 152064, 0x263fc542 +0, 435600, 152064, 0xf106e548 +0, 439200, 152064, 0xde43c56a +0, 442800, 152064, 0xc2c4770a +0, 446400, 152064, 0x122fce19 +0, 450000, 152064, 0x3ba01434 +0, 453600, 152064, 0x0e8ce5ee +0, 457200, 152064, 0x6ceb82e1 +0, 460800, 152064, 0xa23ee21c +0, 464400, 152064, 0xc6d960f9 +0, 468000, 152064, 0x0de15258 +0, 471600, 152064, 0x187b0333 +0, 475200, 152064, 0x92e6582f +0, 478800, 152064, 0xb9586ce0 +0, 482400, 152064, 0xefd803b5 +0, 486000, 152064, 0x24eafb29 +0, 489600, 152064, 0x20c73b14 +0, 493200, 152064, 0xbd7ceaaa +0, 496800, 152064, 0x775216c8 +0, 500400, 152064, 0xa08971c7 +0, 504000, 152064, 0xef0ee865 +0, 507600, 152064, 0x9ac61c2f +0, 511200, 152064, 0x52ae8ea9 +0, 514800, 152064, 0x06571c14 +0, 518400, 152064, 0x6e78ad33 +0, 522000, 152064, 0xad01c627 +0, 525600, 152064, 0xbfe074d3 +0, 529200, 152064, 0x9357a183 +0, 532800, 152064, 0x8de7767f +0, 536400, 152064, 0xa5e6e76e +0, 540000, 152064, 0xa6f646fe +0, 543600, 152064, 0x132e99f8 +0, 547200, 152064, 0xb79f27de +0, 550800, 152064, 0x36d3cdcf +0, 554400, 152064, 0xdc938336 +0, 558000, 152064, 0xacaa3a7f +0, 561600, 152064, 0xc61a37fd +0, 565200, 152064, 0x4fe1ddf0 +0, 568800, 152064, 0xc0f7d660 +0, 572400, 152064, 0xd72458ea +0, 576000, 152064, 0x6978d123 +0, 579600, 152064, 0x64e60ccf +0, 583200, 152064, 0xaa07004c +0, 586800, 152064, 0x07cd1064 +0, 590400, 152064, 0xa82320e5 +0, 594000, 152064, 0xaedd8d30 +0, 597600, 152064, 0x79b082ea +0, 601200, 152064, 0x9ed800ab +0, 604800, 152064, 0xde592bb4 +0, 608400, 152064, 0xd966df88 +0, 612000, 152064, 0xf921988a +0, 615600, 152064, 0x557ad9ae +0, 619200, 152064, 0xc3f31a9a +0, 622800, 152064, 0x65248561 +0, 626400, 152064, 0x63df4aa6 +0, 630000, 152064, 0x618da0a9 +0, 633600, 152064, 0xe6f1c435 +0, 637200, 152064, 0x9f90c38f +0, 640800, 152064, 0xd2853e14 +0, 644400, 152064, 0x6e0268a9 +0, 648000, 152064, 0x393712d1 +0, 651600, 152064, 0x470da25f +0, 655200, 152064, 0xaf55cb3d +0, 658800, 152064, 0x6935b8b9 +0, 662400, 152064, 0x5409a15f +0, 666000, 152064, 0x09073fee +0, 669600, 152064, 0xfb274e82 +0, 673200, 152064, 0x1a770581 +0, 676800, 152064, 0x17277d0d +0, 680400, 152064, 0xd4dcd982 +0, 684000, 152064, 0x6b04eaf3 +0, 687600, 152064, 0x8a3d822e +0, 691200, 152064, 0x1b971ec9 +0, 694800, 152064, 0x14e0c0f6 +0, 698400, 152064, 0x00667450 +0, 702000, 152064, 0xd2385902 +0, 705600, 152064, 0x905da6ab +0, 709200, 152064, 0xa3ffb18b +0, 712800, 152064, 0x10d48b19 +0, 716400, 152064, 0xb2c7a3bd +0, 720000, 152064, 0x45593e96 +0, 723600, 152064, 0x47a0b60c +0, 727200, 152064, 0x68c6d1b9 +0, 730800, 152064, 0xbc881fcc +0, 734400, 152064, 0x422cc6f2 +0, 738000, 152064, 0x9b686410 +0, 741600, 152064, 0x35dc5e86 +0, 745200, 152064, 0x247bedaa +0, 748800, 152064, 0x22b76fd1 +0, 752400, 152064, 0x67cc7a75 +0, 756000, 152064, 0xa197521e +0, 759600, 152064, 0x428c8662 +0, 763200, 152064, 0x33dc2c73 +0, 766800, 152064, 0x5b538903 +0, 770400, 152064, 0x3c4176b6 +0, 774000, 152064, 0x774364ba +0, 777600, 152064, 0xf237d03e +0, 781200, 152064, 0xac8746fb +0, 784800, 152064, 0x6b306a84 +0, 788400, 152064, 0xa2ace513 +0, 792000, 152064, 0x709c9be7 +0, 795600, 152064, 0x2403f373 +0, 799200, 152064, 0x147bf717 +0, 802800, 152064, 0xe58964c8 +0, 806400, 152064, 0xa0da36fc +0, 810000, 152064, 0x1ac1355c +0, 813600, 152064, 0x8a31c9f2 +0, 817200, 152064, 0x42ba205c +0, 820800, 152064, 0xa11b3575 +0, 824400, 152064, 0xcb35207c +0, 828000, 152064, 0x528f6189 +0, 831600, 152064, 0x34f05bd7 +0, 835200, 152064, 0x72317356 +0, 838800, 152064, 0xaabd5028 +0, 842400, 152064, 0x13dbeb7b +0, 846000, 152064, 0x62f1e8a8 +0, 849600, 152064, 0x1723bfcd +0, 853200, 152064, 0x5c083c00 +0, 856800, 152064, 0x52137894 +0, 860400, 152064, 0xef1e082c +0, 864000, 152064, 0x664b3d53 +0, 867600, 152064, 0x2eb9b296 +0, 871200, 152064, 0xd0ca511e +0, 874800, 152064, 0x012d4724 +0, 878400, 152064, 0xa847f5af +0, 882000, 152064, 0x483a2fde +0, 885600, 152064, 0xd1ab0257 +0, 889200, 152064, 0x414692c7 +0, 892800, 152064, 0x0b79df88 +0, 896400, 152064, 0xdaa2c4a3 +0, 900000, 152064, 0xd1b44500 +0, 903600, 152064, 0xfd3d2cf3 +0, 907200, 152064, 0xfdc0f748 +0, 910800, 152064, 0xce762a2a +0, 914400, 152064, 0x08b63572 +0, 918000, 152064, 0x5a46a38d +0, 921600, 152064, 0x03cee9c0 +0, 925200, 152064, 0x9ee45473 +0, 928800, 152064, 0x5a432386 +0, 932400, 152064, 0x54c83d87 +0, 936000, 152064, 0xc9caa1de +0, 939600, 152064, 0xa28367f1 +0, 943200, 152064, 0x2607cdf1 +0, 946800, 152064, 0x06baa8de +0, 950400, 152064, 0xf5346e32 +0, 954000, 152064, 0x6d3e732b +0, 957600, 152064, 0x798c584b +0, 961200, 152064, 0x4076c948 +0, 964800, 152064, 0x868cf63a +0, 968400, 152064, 0x23107ac5 +0, 972000, 152064, 0x306f3fe2 +0, 975600, 152064, 0xbd1d71d6 +0, 979200, 152064, 0x1429545f +0, 982800, 152064, 0xaded29aa +0, 986400, 152064, 0x9b455a94 +0, 990000, 152064, 0xb3774ce7 +0, 993600, 152064, 0x92580986 +0, 997200, 152064, 0x0eae2f95 +0, 1000800, 152064, 0x599208b2 +0, 1004400, 152064, 0x4804c04c +0, 1008000, 152064, 0x5f730e8f +0, 1011600, 152064, 0x3e501d1e +0, 1015200, 152064, 0x32100740 +0, 1018800, 152064, 0x62226ff8 +0, 1022400, 152064, 0x7683b622 +0, 1026000, 152064, 0xc3e0aec1 +0, 1029600, 152064, 0xfac12608 +0, 1033200, 152064, 0xb21a5781 +0, 1036800, 152064, 0x8f1e4964 +0, 1040400, 152064, 0x0f62dd6e +0, 1044000, 152064, 0xac062ac4 +0, 1047600, 152064, 0x1b320f7a +0, 1051200, 152064, 0x346e7211 +0, 1054800, 152064, 0xe47592f3 +0, 1058400, 152064, 0xa3a7919c +0, 1062000, 152064, 0xa3580fa6 +0, 1065600, 152064, 0xc73430c1 +0, 1069200, 152064, 0x994a2c18 +0, 1072800, 152064, 0x0b5d8d45 +0, 1076400, 152064, 0x9eed5109 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcalq_brcm_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcalq_brcm_b new file mode 100644 index 00000000..b5778dd3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcalq_brcm_b @@ -0,0 +1,300 @@ +0, 0, 152064, 0xf3c68dea +0, 3600, 152064, 0xf52d483f +0, 7200, 152064, 0x612f1792 +0, 10800, 152064, 0x4df34726 +0, 14400, 152064, 0xfed7c058 +0, 18000, 152064, 0x2d48025c +0, 21600, 152064, 0x03544ab9 +0, 25200, 152064, 0x20cadfc5 +0, 28800, 152064, 0x7cd3672e +0, 32400, 152064, 0x5f2b9ede +0, 36000, 152064, 0xc0bbdf75 +0, 39600, 152064, 0x95571e7c +0, 43200, 152064, 0x0d1afc5b +0, 46800, 152064, 0x9c91c11f +0, 50400, 152064, 0x73e667e4 +0, 54000, 152064, 0xfb7f8892 +0, 57600, 152064, 0x5707f566 +0, 61200, 152064, 0x21032449 +0, 64800, 152064, 0x199e20b7 +0, 68400, 152064, 0x23213179 +0, 72000, 152064, 0x29812daa +0, 75600, 152064, 0x04e3eb6b +0, 79200, 152064, 0xab206165 +0, 82800, 152064, 0x392fbf7b +0, 86400, 152064, 0x137a1c6a +0, 90000, 152064, 0x9caff265 +0, 93600, 152064, 0x6becf046 +0, 97200, 152064, 0xfc2c3ba6 +0, 100800, 152064, 0xcf4b9b4c +0, 104400, 152064, 0x4e2ebd37 +0, 108000, 152064, 0xcd419daa +0, 111600, 152064, 0xe12294b0 +0, 115200, 152064, 0x6bda7493 +0, 118800, 152064, 0xefbf5d0b +0, 122400, 152064, 0x9500458a +0, 126000, 152064, 0x6b5d212e +0, 129600, 152064, 0xb928fc31 +0, 133200, 152064, 0x64f2bb2f +0, 136800, 152064, 0xf93a724d +0, 140400, 152064, 0xdd0d32c0 +0, 144000, 152064, 0xe1b51d95 +0, 147600, 152064, 0xbb43d295 +0, 151200, 152064, 0x6dcea069 +0, 154800, 152064, 0x89d79805 +0, 158400, 152064, 0x50b5dd43 +0, 162000, 152064, 0xe3099e3f +0, 165600, 152064, 0x003b6ace +0, 169200, 152064, 0x2213b672 +0, 172800, 152064, 0x5b273093 +0, 176400, 152064, 0xdbfbd9bf +0, 180000, 152064, 0xf26b89d0 +0, 183600, 152064, 0x1470527e +0, 187200, 152064, 0x0e668970 +0, 190800, 152064, 0x00218692 +0, 194400, 152064, 0xaabf79a8 +0, 198000, 152064, 0xf68b4663 +0, 201600, 152064, 0x4c08d01f +0, 205200, 152064, 0x48e75380 +0, 208800, 152064, 0x4b8be58f +0, 212400, 152064, 0x8a6c1365 +0, 216000, 152064, 0x9439ca02 +0, 219600, 152064, 0x831d9855 +0, 223200, 152064, 0xff031ffd +0, 226800, 152064, 0x3680f4bc +0, 230400, 152064, 0x794c95a4 +0, 234000, 152064, 0x23e53349 +0, 237600, 152064, 0x85307117 +0, 241200, 152064, 0x0bc0bf5a +0, 244800, 152064, 0xc79f46c8 +0, 248400, 152064, 0x48be4e21 +0, 252000, 152064, 0x2ad89b4f +0, 255600, 152064, 0xd454f9a9 +0, 259200, 152064, 0x64852f6d +0, 262800, 152064, 0xcb7b0c05 +0, 266400, 152064, 0x4e108ced +0, 270000, 152064, 0xf5e5a37b +0, 273600, 152064, 0x224e29c7 +0, 277200, 152064, 0xad90d3c2 +0, 280800, 152064, 0x5ddb5d05 +0, 284400, 152064, 0x4ebf4337 +0, 288000, 152064, 0x7e2bfeed +0, 291600, 152064, 0x00e884c7 +0, 295200, 152064, 0xa4f6a534 +0, 298800, 152064, 0x622f1511 +0, 302400, 152064, 0x8d99233d +0, 306000, 152064, 0x5910d02c +0, 309600, 152064, 0x20d6706c +0, 313200, 152064, 0x8e30a417 +0, 316800, 152064, 0x180d745a +0, 320400, 152064, 0xc25189b9 +0, 324000, 152064, 0x909101ad +0, 327600, 152064, 0x9967be1c +0, 331200, 152064, 0x72ff3206 +0, 334800, 152064, 0x48d07f48 +0, 338400, 152064, 0x7f8244b7 +0, 342000, 152064, 0xf871e21e +0, 345600, 152064, 0xd4743610 +0, 349200, 152064, 0xc2c7a7b1 +0, 352800, 152064, 0x95be1a75 +0, 356400, 152064, 0x44972b2e +0, 360000, 152064, 0xa6036c4f +0, 363600, 152064, 0xecdd8dd6 +0, 367200, 152064, 0xbb7e8551 +0, 370800, 152064, 0x42916e6c +0, 374400, 152064, 0x972db010 +0, 378000, 152064, 0x80dab6a0 +0, 381600, 152064, 0xc753ecdb +0, 385200, 152064, 0x0823bffa +0, 388800, 152064, 0x80876b2d +0, 392400, 152064, 0x4a8b2118 +0, 396000, 152064, 0x0be2c13d +0, 399600, 152064, 0xa6966e4f +0, 403200, 152064, 0xf6a57650 +0, 406800, 152064, 0x49d66fd4 +0, 410400, 152064, 0x21d92047 +0, 414000, 152064, 0x155f20a8 +0, 417600, 152064, 0x5ab90c1d +0, 421200, 152064, 0xa0c31337 +0, 424800, 152064, 0xd20de1d6 +0, 428400, 152064, 0x300ad916 +0, 432000, 152064, 0xbcb89eb5 +0, 435600, 152064, 0x08759342 +0, 439200, 152064, 0xa5d06e72 +0, 442800, 152064, 0x3b4c537f +0, 446400, 152064, 0x7f48912b +0, 450000, 152064, 0x200dbd1f +0, 453600, 152064, 0x918abfde +0, 457200, 152064, 0xd8072cdf +0, 460800, 152064, 0x89d2902b +0, 464400, 152064, 0xcd2e2e3c +0, 468000, 152064, 0xf343e4a2 +0, 471600, 152064, 0xc424acad +0, 475200, 152064, 0xf71e3031 +0, 478800, 152064, 0xf1bc1179 +0, 482400, 152064, 0x9af58d24 +0, 486000, 152064, 0x48a4d01e +0, 489600, 152064, 0xcf24f721 +0, 493200, 152064, 0x5bc7b4f3 +0, 496800, 152064, 0x8763fc59 +0, 500400, 152064, 0xb6954051 +0, 504000, 152064, 0x044ba446 +0, 507600, 152064, 0xdaaaee7e +0, 511200, 152064, 0x8eac550d +0, 514800, 152064, 0x5191d08c +0, 518400, 152064, 0x3cd76d43 +0, 522000, 152064, 0xf01f8fa9 +0, 525600, 152064, 0x0e283e9b +0, 529200, 152064, 0x7cef69ee +0, 532800, 152064, 0xc8e332bc +0, 536400, 152064, 0x5b1aa484 +0, 540000, 152064, 0x3975234f +0, 543600, 152064, 0x52b8661e +0, 547200, 152064, 0xb4b8fed8 +0, 550800, 152064, 0x5aff9f70 +0, 554400, 152064, 0x7b575735 +0, 558000, 152064, 0x77d51523 +0, 561600, 152064, 0xf5131eba +0, 565200, 152064, 0x4bd2b1ad +0, 568800, 152064, 0xccfc8dca +0, 572400, 152064, 0xcf245472 +0, 576000, 152064, 0xe055adf5 +0, 579600, 152064, 0x2a90e171 +0, 583200, 152064, 0x1bd8ea64 +0, 586800, 152064, 0x32f1d794 +0, 590400, 152064, 0xc938c42a +0, 594000, 152064, 0x12b5644f +0, 597600, 152064, 0x99003711 +0, 601200, 152064, 0xaecfad1c +0, 604800, 152064, 0x94b00ae1 +0, 608400, 152064, 0xbb4f982f +0, 612000, 152064, 0x6f7f5dc1 +0, 615600, 152064, 0x7be7c2cb +0, 619200, 152064, 0x3b2ee4d3 +0, 622800, 152064, 0xc75f5666 +0, 626400, 152064, 0xff7a3ede +0, 630000, 152064, 0x55866b59 +0, 633600, 152064, 0x408b8455 +0, 637200, 152064, 0x96c4ab66 +0, 640800, 152064, 0x1d87f575 +0, 644400, 152064, 0x3a3b17ac +0, 648000, 152064, 0x9c99e591 +0, 651600, 152064, 0xc1fc663d +0, 655200, 152064, 0x17b982dd +0, 658800, 152064, 0x24fe9dad +0, 662400, 152064, 0xea8760ee +0, 666000, 152064, 0x23dcefad +0, 669600, 152064, 0xee6d23f0 +0, 673200, 152064, 0xfddc1962 +0, 676800, 152064, 0xb23190df +0, 680400, 152064, 0xf066a595 +0, 684000, 152064, 0x2200fef8 +0, 687600, 152064, 0x5491ab2f +0, 691200, 152064, 0xea93fa58 +0, 694800, 152064, 0x3e13d4f4 +0, 698400, 152064, 0x3dda841d +0, 702000, 152064, 0xfc243577 +0, 705600, 152064, 0xca4a9127 +0, 709200, 152064, 0x41908ec0 +0, 712800, 152064, 0x10a758bd +0, 716400, 152064, 0x6a849e5b +0, 720000, 152064, 0xb55a1f2b +0, 723600, 152064, 0x2bfe9627 +0, 727200, 152064, 0x2bfca28c +0, 730800, 152064, 0xd166f336 +0, 734400, 152064, 0x9facb32b +0, 738000, 152064, 0x6a672475 +0, 741600, 152064, 0xc7b219cf +0, 745200, 152064, 0x2b43ca53 +0, 748800, 152064, 0x43b542c4 +0, 752400, 152064, 0xdc654337 +0, 756000, 152064, 0x68003d7c +0, 759600, 152064, 0x3cb85724 +0, 763200, 152064, 0x422701c2 +0, 766800, 152064, 0x1c667870 +0, 770400, 152064, 0x75ef3230 +0, 774000, 152064, 0x0ac82643 +0, 777600, 152064, 0x3eb3a0be +0, 781200, 152064, 0x482bd77e +0, 784800, 152064, 0xd3ce1171 +0, 788400, 152064, 0xeaefc7e4 +0, 792000, 152064, 0xa9c67939 +0, 795600, 152064, 0x0af0a25b +0, 799200, 152064, 0xd094d95a +0, 802800, 152064, 0xfda42fc6 +0, 806400, 152064, 0x4669f952 +0, 810000, 152064, 0x52d40e98 +0, 813600, 152064, 0x27c36cd1 +0, 817200, 152064, 0xa103b6ce +0, 820800, 152064, 0x2be9026d +0, 824400, 152064, 0x2f4ecc59 +0, 828000, 152064, 0x53144cef +0, 831600, 152064, 0x15d54fc9 +0, 835200, 152064, 0x7e302db7 +0, 838800, 152064, 0x82521901 +0, 842400, 152064, 0x1123cdb6 +0, 846000, 152064, 0x3185878a +0, 849600, 152064, 0xbb294983 +0, 853200, 152064, 0x83d9fe66 +0, 856800, 152064, 0xede9fb08 +0, 860400, 152064, 0xa543b551 +0, 864000, 152064, 0x39e82734 +0, 867600, 152064, 0xd0447fb5 +0, 871200, 152064, 0x8cc6f502 +0, 874800, 152064, 0xda8d1da8 +0, 878400, 152064, 0xcafdccca +0, 882000, 152064, 0xbf0e04f4 +0, 885600, 152064, 0x0c6eefec +0, 889200, 152064, 0xb9026d39 +0, 892800, 152064, 0x0121a7a8 +0, 896400, 152064, 0x453ebbc6 +0, 900000, 152064, 0x14ae15e3 +0, 903600, 152064, 0x51d618e1 +0, 907200, 152064, 0x2254f452 +0, 910800, 152064, 0x8c360633 +0, 914400, 152064, 0x8704d9bc +0, 918000, 152064, 0xe5d48301 +0, 921600, 152064, 0xf25b7b3f +0, 925200, 152064, 0xd2ad3b73 +0, 928800, 152064, 0x53db0387 +0, 932400, 152064, 0x2486341c +0, 936000, 152064, 0x4a24570b +0, 939600, 152064, 0x0694620a +0, 943200, 152064, 0xbbc2a302 +0, 946800, 152064, 0x08ad9c02 +0, 950400, 152064, 0x601a63ab +0, 954000, 152064, 0xe4234a48 +0, 957600, 152064, 0x07702235 +0, 961200, 152064, 0x719dbecf +0, 964800, 152064, 0xf301a7ad +0, 968400, 152064, 0xf15c70c3 +0, 972000, 152064, 0x0ab93386 +0, 975600, 152064, 0x99c05adb +0, 979200, 152064, 0x9ed43530 +0, 982800, 152064, 0xa2f62122 +0, 986400, 152064, 0xf16f4525 +0, 990000, 152064, 0xa3403b4a +0, 993600, 152064, 0x95521096 +0, 997200, 152064, 0x0d412988 +0, 1000800, 152064, 0x829e080a +0, 1004400, 152064, 0x0805c1b5 +0, 1008000, 152064, 0xa136be48 +0, 1011600, 152064, 0x0f8de228 +0, 1015200, 152064, 0x272cf2d3 +0, 1018800, 152064, 0xa1df2a5e +0, 1022400, 152064, 0xf9db8350 +0, 1026000, 152064, 0x5536997d +0, 1029600, 152064, 0xab83e81e +0, 1033200, 152064, 0xec791b49 +0, 1036800, 152064, 0x04d03e19 +0, 1040400, 152064, 0xd6a2bd21 +0, 1044000, 152064, 0x2d35f0aa +0, 1047600, 152064, 0x137bf715 +0, 1051200, 152064, 0x56ef5ae1 +0, 1054800, 152064, 0x9bb5821e +0, 1058400, 152064, 0x533c7fff +0, 1062000, 152064, 0x469ad380 +0, 1065600, 152064, 0x75710e84 +0, 1069200, 152064, 0xbbd72551 +0, 1072800, 152064, 0xf1137026 +0, 1076400, 152064, 0x6238412b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcamapalq_bcrm_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcamapalq_bcrm_b new file mode 100644 index 00000000..4f6f2baa --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcamapalq_bcrm_b @@ -0,0 +1,300 @@ +0, 0, 152064, 0xf8248ceb +0, 3600, 152064, 0xb6204c81 +0, 7200, 152064, 0x22fb1737 +0, 10800, 152064, 0xce8c3fd7 +0, 14400, 152064, 0xee88cedc +0, 18000, 152064, 0x1d4209ca +0, 21600, 152064, 0x6fb15238 +0, 25200, 152064, 0x505200c2 +0, 28800, 152064, 0xb73574ba +0, 32400, 152064, 0x0586a097 +0, 36000, 152064, 0xed50fe02 +0, 39600, 152064, 0x222221ab +0, 43200, 152064, 0x8afefd46 +0, 46800, 152064, 0x6832c5cc +0, 50400, 152064, 0xba4c8110 +0, 54000, 152064, 0x95c07e1e +0, 57600, 152064, 0xc5d6fde9 +0, 61200, 152064, 0xe75a4921 +0, 64800, 152064, 0x53b61688 +0, 68400, 152064, 0x0335424b +0, 72000, 152064, 0x621742c7 +0, 75600, 152064, 0x4f69f41b +0, 79200, 152064, 0x6b3f65d7 +0, 82800, 152064, 0x8dfde04f +0, 86400, 152064, 0x30750ff5 +0, 90000, 152064, 0xe3d70f3c +0, 93600, 152064, 0x0c1af825 +0, 97200, 152064, 0x58a53935 +0, 100800, 152064, 0xc63d9e98 +0, 104400, 152064, 0xa85fdc48 +0, 108000, 152064, 0x01bb9784 +0, 111600, 152064, 0xdd5cb509 +0, 115200, 152064, 0x29ae7d2b +0, 118800, 152064, 0xdb08593e +0, 122400, 152064, 0x372d5d4e +0, 126000, 152064, 0x31522664 +0, 129600, 152064, 0x3f13f335 +0, 133200, 152064, 0xfd10c19a +0, 136800, 152064, 0xef728975 +0, 140400, 152064, 0x8e79234d +0, 144000, 152064, 0x47022791 +0, 147600, 152064, 0x1ef9d297 +0, 151200, 152064, 0x77bf9738 +0, 154800, 152064, 0xd6bc8f03 +0, 158400, 152064, 0x283ded4a +0, 162000, 152064, 0xd87098d1 +0, 165600, 152064, 0x300077a2 +0, 169200, 152064, 0x30ffbea4 +0, 172800, 152064, 0x5dc5356b +0, 176400, 152064, 0x31cce185 +0, 180000, 152064, 0x47fc9148 +0, 183600, 152064, 0x1641491e +0, 187200, 152064, 0x2184937d +0, 190800, 152064, 0x126eb74a +0, 194400, 152064, 0x25c07593 +0, 198000, 152064, 0xb1294e7e +0, 201600, 152064, 0x8b35f45d +0, 205200, 152064, 0x54765025 +0, 208800, 152064, 0x1d17e901 +0, 212400, 152064, 0xaeab358d +0, 216000, 152064, 0xf682c91f +0, 219600, 152064, 0x0b4c9b06 +0, 223200, 152064, 0x45f326dc +0, 226800, 152064, 0x132eeda3 +0, 230400, 152064, 0x3c9b8e16 +0, 234000, 152064, 0x1be133c1 +0, 237600, 152064, 0xfa876720 +0, 241200, 152064, 0x1666cdb8 +0, 244800, 152064, 0x362f418f +0, 248400, 152064, 0x926b4a96 +0, 252000, 152064, 0xee3da1df +0, 255600, 152064, 0xc11f025d +0, 259200, 152064, 0x9ba62c19 +0, 262800, 152064, 0x0d66194f +0, 266400, 152064, 0x2fd09340 +0, 270000, 152064, 0x3dfb9e4d +0, 273600, 152064, 0xa3192ce6 +0, 277200, 152064, 0x6bfce0e1 +0, 280800, 152064, 0x3b7c5286 +0, 284400, 152064, 0xb52f4bf5 +0, 288000, 152064, 0x30870027 +0, 291600, 152064, 0x6f8e71c3 +0, 295200, 152064, 0x8d41b09a +0, 298800, 152064, 0xc1ff1d05 +0, 302400, 152064, 0xca54125c +0, 306000, 152064, 0x3342d823 +0, 309600, 152064, 0xcc4a7542 +0, 313200, 152064, 0x21fc9a9d +0, 316800, 152064, 0x91587574 +0, 320400, 152064, 0x30929cc2 +0, 324000, 152064, 0xf07606b7 +0, 327600, 152064, 0x0476b876 +0, 331200, 152064, 0x213333dc +0, 334800, 152064, 0x87c67597 +0, 338400, 152064, 0x05434641 +0, 342000, 152064, 0x959eeffc +0, 345600, 152064, 0x92a130b4 +0, 349200, 152064, 0x53d0b544 +0, 352800, 152064, 0xaf8c233e +0, 356400, 152064, 0xd3d4259a +0, 360000, 152064, 0xa0287753 +0, 363600, 152064, 0xfa23972a +0, 367200, 152064, 0xacae756d +0, 370800, 152064, 0xd8b58b5c +0, 374400, 152064, 0x7db2c755 +0, 378000, 152064, 0x31e7b79a +0, 381600, 152064, 0xd8660d98 +0, 385200, 152064, 0xdcf0d10d +0, 388800, 152064, 0x3e6567e6 +0, 392400, 152064, 0xec3530fd +0, 396000, 152064, 0xf686c61a +0, 399600, 152064, 0x6e706804 +0, 403200, 152064, 0x5fd4a1a3 +0, 406800, 152064, 0xbb3384f7 +0, 410400, 152064, 0x8ffb14dd +0, 414000, 152064, 0x01253a73 +0, 417600, 152064, 0xf89c15df +0, 421200, 152064, 0xda2b0b4c +0, 424800, 152064, 0xfc9dfcc1 +0, 428400, 152064, 0xfef4f0fa +0, 432000, 152064, 0x91669bea +0, 435600, 152064, 0x3664a565 +0, 439200, 152064, 0x32dd7923 +0, 442800, 152064, 0x26825231 +0, 446400, 152064, 0x5f81896e +0, 450000, 152064, 0x0c64ca2f +0, 453600, 152064, 0x488bb665 +0, 457200, 152064, 0x4d183a0f +0, 460800, 152064, 0xed169321 +0, 464400, 152064, 0xcec22917 +0, 468000, 152064, 0xbe04ea6c +0, 471600, 152064, 0x32b8bf9f +0, 475200, 152064, 0x9c7c2e13 +0, 478800, 152064, 0x232e3016 +0, 482400, 152064, 0x1b76c08e +0, 486000, 152064, 0x7425d821 +0, 489600, 152064, 0x0818ff3c +0, 493200, 152064, 0xb4f2c42b +0, 496800, 152064, 0xe029f979 +0, 500400, 152064, 0x97c54c2f +0, 504000, 152064, 0xd101c3b5 +0, 507600, 152064, 0x5ed1f5d4 +0, 511200, 152064, 0xc28264d1 +0, 514800, 152064, 0xa162dd31 +0, 518400, 152064, 0x2ee872ce +0, 522000, 152064, 0x809a8fce +0, 525600, 152064, 0xcfcc3ef9 +0, 529200, 152064, 0xa5be6ce3 +0, 532800, 152064, 0xd75930a0 +0, 536400, 152064, 0x28acb80f +0, 540000, 152064, 0x223f2152 +0, 543600, 152064, 0x0cf070cb +0, 547200, 152064, 0xcc7d011e +0, 550800, 152064, 0xb2c2a63c +0, 554400, 152064, 0x15514caa +0, 558000, 152064, 0x0c6d18ee +0, 561600, 152064, 0x33b4265d +0, 565200, 152064, 0xb4abaaaf +0, 568800, 152064, 0x26a7a856 +0, 572400, 152064, 0xc75249cc +0, 576000, 152064, 0x59ccb0e1 +0, 579600, 152064, 0xc613f202 +0, 583200, 152064, 0xd1c0e171 +0, 586800, 152064, 0xa195da2b +0, 590400, 152064, 0xbc7ed475 +0, 594000, 152064, 0x99206e2c +0, 597600, 152064, 0x0ef04e03 +0, 601200, 152064, 0x68cbc6a1 +0, 604800, 152064, 0x2a5304b1 +0, 608400, 152064, 0xf017978b +0, 612000, 152064, 0x94f5641a +0, 615600, 152064, 0xd681bd8f +0, 619200, 152064, 0x16e1e3a3 +0, 622800, 152064, 0xe4486c7e +0, 626400, 152064, 0xa1bd394e +0, 630000, 152064, 0x49ad5959 +0, 633600, 152064, 0x82219b70 +0, 637200, 152064, 0x64e2abcf +0, 640800, 152064, 0x6d7d05d8 +0, 644400, 152064, 0xd9ac2251 +0, 648000, 152064, 0xf477eee5 +0, 651600, 152064, 0xb9826a78 +0, 655200, 152064, 0x97828a37 +0, 658800, 152064, 0x12099b1f +0, 662400, 152064, 0x1ec45fa7 +0, 666000, 152064, 0xfd5501c9 +0, 669600, 152064, 0x6a8b26a3 +0, 673200, 152064, 0xae58ff40 +0, 676800, 152064, 0xc0f47aa1 +0, 680400, 152064, 0x08bfa548 +0, 684000, 152064, 0x7f2ff5ef +0, 687600, 152064, 0x5efa94a3 +0, 691200, 152064, 0xf786f970 +0, 694800, 152064, 0xab6bc712 +0, 698400, 152064, 0x25647bee +0, 702000, 152064, 0x54333ad5 +0, 705600, 152064, 0xb3a99413 +0, 709200, 152064, 0xe7a78a0d +0, 712800, 152064, 0xa5054abc +0, 716400, 152064, 0xb94896ea +0, 720000, 152064, 0x9f641bca +0, 723600, 152064, 0x7363901c +0, 727200, 152064, 0xd340a000 +0, 730800, 152064, 0x0217f413 +0, 734400, 152064, 0xbbdba6e6 +0, 738000, 152064, 0xabc42617 +0, 741600, 152064, 0xa3442925 +0, 745200, 152064, 0x7d06c7e9 +0, 748800, 152064, 0xa45e32df +0, 752400, 152064, 0xf5ed407f +0, 756000, 152064, 0x5ec235d5 +0, 759600, 152064, 0xa5706635 +0, 763200, 152064, 0xa44a209b +0, 766800, 152064, 0xf2137e37 +0, 770400, 152064, 0x5220508f +0, 774000, 152064, 0xae6b37da +0, 777600, 152064, 0xdf09b6cd +0, 781200, 152064, 0x2d39e1c0 +0, 784800, 152064, 0xc8284a76 +0, 788400, 152064, 0x7d7bbe76 +0, 792000, 152064, 0xcfed7416 +0, 795600, 152064, 0x81caaedd +0, 799200, 152064, 0x9dcdd771 +0, 802800, 152064, 0x46c1331b +0, 806400, 152064, 0xace60efa +0, 810000, 152064, 0x9e0909f7 +0, 813600, 152064, 0x72f5a321 +0, 817200, 152064, 0x68f8cdcc +0, 820800, 152064, 0xcc59fdd9 +0, 824400, 152064, 0xc0a700c6 +0, 828000, 152064, 0xf4254dcf +0, 831600, 152064, 0xc59b46d1 +0, 835200, 152064, 0x2e5b2524 +0, 838800, 152064, 0x46051293 +0, 842400, 152064, 0x3cbcd1cd +0, 846000, 152064, 0x9f308587 +0, 849600, 152064, 0x6b91633f +0, 853200, 152064, 0xb7191012 +0, 856800, 152064, 0xd2fd030f +0, 860400, 152064, 0x15a0ae2e +0, 864000, 152064, 0xac3920d0 +0, 867600, 152064, 0x0eef80aa +0, 871200, 152064, 0x319008f1 +0, 874800, 152064, 0x7734450c +0, 878400, 152064, 0xf112df62 +0, 882000, 152064, 0x1dd8ffae +0, 885600, 152064, 0x655ef429 +0, 889200, 152064, 0x27026213 +0, 892800, 152064, 0x5c14b015 +0, 896400, 152064, 0x9512abeb +0, 900000, 152064, 0x961812b2 +0, 903600, 152064, 0xb8890aea +0, 907200, 152064, 0x4519db9a +0, 910800, 152064, 0xf358034a +0, 914400, 152064, 0x45d9f2ab +0, 918000, 152064, 0xebd47e7d +0, 921600, 152064, 0x15578be9 +0, 925200, 152064, 0x1b373b2d +0, 928800, 152064, 0xbbe707e5 +0, 932400, 152064, 0x5bf62385 +0, 936000, 152064, 0x832e6ef5 +0, 939600, 152064, 0x761e5968 +0, 943200, 152064, 0x251f984d +0, 946800, 152064, 0xbda48899 +0, 950400, 152064, 0x3fd843b9 +0, 954000, 152064, 0x00485425 +0, 957600, 152064, 0x4e282b39 +0, 961200, 152064, 0x2630a8ea +0, 964800, 152064, 0x5ea5c973 +0, 968400, 152064, 0xfc436d21 +0, 972000, 152064, 0x69852ef5 +0, 975600, 152064, 0x44cb5589 +0, 979200, 152064, 0x32f32725 +0, 982800, 152064, 0x54d50aca +0, 986400, 152064, 0xe7a639bb +0, 990000, 152064, 0x01be2ad5 +0, 993600, 152064, 0x5c63eca4 +0, 997200, 152064, 0x94e91116 +0, 1000800, 152064, 0x9a8be637 +0, 1004400, 152064, 0x165d9a12 +0, 1008000, 152064, 0x8c25ca0a +0, 1011600, 152064, 0x4ee2ed32 +0, 1015200, 152064, 0x4b2fe0c6 +0, 1018800, 152064, 0x521e434e +0, 1022400, 152064, 0x97679d7e +0, 1026000, 152064, 0x886b9506 +0, 1029600, 152064, 0x4283eda8 +0, 1033200, 152064, 0xef793c49 +0, 1036800, 152064, 0x68ac2afe +0, 1040400, 152064, 0x3d1ab510 +0, 1044000, 152064, 0x98d3ec95 +0, 1047600, 152064, 0x09f7e512 +0, 1051200, 152064, 0x801355dd +0, 1054800, 152064, 0xf2e87a11 +0, 1058400, 152064, 0x16757601 +0, 1062000, 152064, 0x3074d74a +0, 1065600, 152064, 0xec8c1290 +0, 1069200, 152064, 0x46fb1877 +0, 1072800, 152064, 0xf0b662c4 +0, 1076400, 152064, 0xf8683940 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcamolq_brcm_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcamolq_brcm_b new file mode 100644 index 00000000..6d2e27a6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcamolq_brcm_b @@ -0,0 +1,100 @@ +0, 0, 152064, 0xac83f54f +0, 3600, 152064, 0x4d673b43 +0, 7200, 152064, 0x9050731f +0, 10800, 152064, 0x4a0741f3 +0, 14400, 152064, 0xb2371c28 +0, 18000, 152064, 0x42210524 +0, 21600, 152064, 0x385f4be5 +0, 25200, 152064, 0xe44ec27a +0, 28800, 152064, 0xfc668399 +0, 32400, 152064, 0x903fe200 +0, 36000, 152064, 0x4da1deaa +0, 39600, 152064, 0x68c956ab +0, 43200, 152064, 0x9cfad799 +0, 46800, 152064, 0x841ed3cd +0, 50400, 152064, 0x99e66b48 +0, 54000, 152064, 0xcfa28482 +0, 57600, 152064, 0x72f2c717 +0, 61200, 152064, 0xd1d92c80 +0, 64800, 152064, 0x595063eb +0, 68400, 152064, 0x87373979 +0, 72000, 152064, 0xfa0e75ac +0, 75600, 152064, 0x0cef3592 +0, 79200, 152064, 0xecfc9c9a +0, 82800, 152064, 0x5776ff23 +0, 86400, 152064, 0x83419e37 +0, 90000, 152064, 0x4bb31524 +0, 93600, 152064, 0xad8e1bdc +0, 97200, 152064, 0x7243b6cb +0, 100800, 152064, 0xf016cda0 +0, 104400, 152064, 0xa2c1d730 +0, 108000, 152064, 0x7999d704 +0, 111600, 152064, 0x86ad0baf +0, 115200, 152064, 0x35dafe62 +0, 118800, 152064, 0xcb2f5de2 +0, 122400, 152064, 0x3542eb82 +0, 126000, 152064, 0xa704dd92 +0, 129600, 152064, 0x3e50ed92 +0, 133200, 152064, 0x2fe5428a +0, 136800, 152064, 0xf05dab9d +0, 140400, 152064, 0xef40c2a3 +0, 144000, 152064, 0x2df8983f +0, 147600, 152064, 0x0a205c93 +0, 151200, 152064, 0x505562ea +0, 154800, 152064, 0x24114860 +0, 158400, 152064, 0x2eecccc1 +0, 162000, 152064, 0xc809105f +0, 165600, 152064, 0x394ab285 +0, 169200, 152064, 0xfda68f17 +0, 172800, 152064, 0x2fd66a51 +0, 176400, 152064, 0x3abb891a +0, 180000, 152064, 0x62266682 +0, 183600, 152064, 0x68fb38e9 +0, 187200, 152064, 0xae4b9d9b +0, 190800, 152064, 0xdaf8e150 +0, 194400, 152064, 0x2fd8bf74 +0, 198000, 152064, 0xd2ad6c38 +0, 201600, 152064, 0x76290574 +0, 205200, 152064, 0xaea6b9be +0, 208800, 152064, 0xd0d797d7 +0, 212400, 152064, 0x87ad00b2 +0, 216000, 152064, 0xe57d11d0 +0, 219600, 152064, 0x25a5c567 +0, 223200, 152064, 0x477e2202 +0, 226800, 152064, 0xaa0618ca +0, 230400, 152064, 0xb5d2262b +0, 234000, 152064, 0xae7c135d +0, 237600, 152064, 0xddb86a7c +0, 241200, 152064, 0x59bad3ba +0, 244800, 152064, 0x0b155178 +0, 248400, 152064, 0xc2f265d9 +0, 252000, 152064, 0xb550e8a8 +0, 255600, 152064, 0x1fef6cbc +0, 259200, 152064, 0xd3d4e578 +0, 262800, 152064, 0x70d20c0d +0, 266400, 152064, 0xbb8e95a9 +0, 270000, 152064, 0x2a92cda3 +0, 273600, 152064, 0xc0a5e7e0 +0, 277200, 152064, 0x15b99dab +0, 280800, 152064, 0x536d44e8 +0, 284400, 152064, 0xe43fb4fa +0, 288000, 152064, 0xdb0873b0 +0, 291600, 152064, 0xc7901e9b +0, 295200, 152064, 0x36b69923 +0, 298800, 152064, 0xc6a8ac8d +0, 302400, 152064, 0xd7e4c595 +0, 306000, 152064, 0x2d64cf38 +0, 309600, 152064, 0x007878b1 +0, 313200, 152064, 0xc9c997d4 +0, 316800, 152064, 0xf9de12de +0, 320400, 152064, 0x25982d54 +0, 324000, 152064, 0xea5eef7c +0, 327600, 152064, 0x108aceb2 +0, 331200, 152064, 0x3cbac8c8 +0, 334800, 152064, 0x581ec9e1 +0, 338400, 152064, 0xc898bd7d +0, 342000, 152064, 0x142a0235 +0, 345600, 152064, 0xf9d0aa7e +0, 349200, 152064, 0xb9fe0bc4 +0, 352800, 152064, 0x21889912 +0, 356400, 152064, 0x3fb2ab18 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcanl_brcm_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcanl_brcm_c new file mode 100644 index 00000000..fe474650 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcanl_brcm_c @@ -0,0 +1,300 @@ +0, 0, 152064, 0x2744afa1 +0, 3600, 152064, 0x17246583 +0, 7200, 152064, 0x501836ed +0, 10800, 152064, 0xe90d6961 +0, 14400, 152064, 0x27abe1ad +0, 18000, 152064, 0xcfc730e4 +0, 21600, 152064, 0xeaaa83ee +0, 25200, 152064, 0xb5d80ebd +0, 28800, 152064, 0x1e1b9d03 +0, 32400, 152064, 0x60e7cf33 +0, 36000, 152064, 0xc44616b1 +0, 39600, 152064, 0x0a2a5906 +0, 43200, 152064, 0xf101309c +0, 46800, 152064, 0x0b57f348 +0, 50400, 152064, 0x4f018c05 +0, 54000, 152064, 0x22359c60 +0, 57600, 152064, 0x020f1cc3 +0, 61200, 152064, 0x15be3892 +0, 64800, 152064, 0x834a2e23 +0, 68400, 152064, 0x1176586c +0, 72000, 152064, 0x9cf25641 +0, 75600, 152064, 0xc1c4051d +0, 79200, 152064, 0x790d8bfa +0, 82800, 152064, 0x4dcbe7d7 +0, 86400, 152064, 0xe81d3b7b +0, 90000, 152064, 0xe9e21309 +0, 93600, 152064, 0x22021dbc +0, 97200, 152064, 0x430c5ecb +0, 100800, 152064, 0xf524be8b +0, 104400, 152064, 0xa437dadc +0, 108000, 152064, 0xff00b440 +0, 111600, 152064, 0x4bd1bf15 +0, 115200, 152064, 0x1f46a3ea +0, 118800, 152064, 0x60b47c5e +0, 122400, 152064, 0x45117ac6 +0, 126000, 152064, 0x43894fca +0, 129600, 152064, 0x21572b55 +0, 133200, 152064, 0xe96def09 +0, 136800, 152064, 0x4d2ab41f +0, 140400, 152064, 0x072d6b06 +0, 144000, 152064, 0x81865687 +0, 147600, 152064, 0x8d9a0ea6 +0, 151200, 152064, 0x1484d3cd +0, 154800, 152064, 0xbdabae6b +0, 158400, 152064, 0x4211edbe +0, 162000, 152064, 0xd84dad6d +0, 165600, 152064, 0xe4e79344 +0, 169200, 152064, 0x9c1addd7 +0, 172800, 152064, 0xdcf94283 +0, 176400, 152064, 0x6bd005b2 +0, 180000, 152064, 0x9679bd10 +0, 183600, 152064, 0x052064ab +0, 187200, 152064, 0x915db3f3 +0, 190800, 152064, 0xec2fbd58 +0, 194400, 152064, 0x26728258 +0, 198000, 152064, 0x2b2b617f +0, 201600, 152064, 0x2339eb3d +0, 205200, 152064, 0xcf6e6773 +0, 208800, 152064, 0xb993efe4 +0, 212400, 152064, 0x4054253d +0, 216000, 152064, 0x4befe5b5 +0, 219600, 152064, 0x0678c0fa +0, 223200, 152064, 0xe3c54a03 +0, 226800, 152064, 0xffa3210c +0, 230400, 152064, 0xed04b823 +0, 234000, 152064, 0x00926457 +0, 237600, 152064, 0xd56aaaf0 +0, 241200, 152064, 0x6047ef6e +0, 244800, 152064, 0x44316d07 +0, 248400, 152064, 0xe8a879b7 +0, 252000, 152064, 0x1856cd86 +0, 255600, 152064, 0x6528349a +0, 259200, 152064, 0xdeff676e +0, 262800, 152064, 0xda412e47 +0, 266400, 152064, 0xa2c2a96f +0, 270000, 152064, 0xc703b8cd +0, 273600, 152064, 0x20b0650b +0, 277200, 152064, 0x8c14faa5 +0, 280800, 152064, 0xa442706c +0, 284400, 152064, 0x6e456137 +0, 288000, 152064, 0x6dde11c6 +0, 291600, 152064, 0xb017978a +0, 295200, 152064, 0xc0bad34b +0, 298800, 152064, 0x8bd439ee +0, 302400, 152064, 0xa92735e4 +0, 306000, 152064, 0x1623f501 +0, 309600, 152064, 0x5be980b2 +0, 313200, 152064, 0x4306b9bf +0, 316800, 152064, 0xb4f18976 +0, 320400, 152064, 0x4ffb9b46 +0, 324000, 152064, 0x23082275 +0, 327600, 152064, 0xc7f0e087 +0, 331200, 152064, 0x68b95327 +0, 334800, 152064, 0xd030a8e4 +0, 338400, 152064, 0xf8f9615c +0, 342000, 152064, 0x1b26fe3e +0, 345600, 152064, 0x3381608d +0, 349200, 152064, 0x9939d49d +0, 352800, 152064, 0x575f4f94 +0, 356400, 152064, 0x436c581c +0, 360000, 152064, 0x8f47aa58 +0, 363600, 152064, 0xd251d95a +0, 367200, 152064, 0x3c33b32c +0, 370800, 152064, 0xa1e19413 +0, 374400, 152064, 0x8d95cbad +0, 378000, 152064, 0x98cbd35e +0, 381600, 152064, 0xceb81a0f +0, 385200, 152064, 0x5490fab1 +0, 388800, 152064, 0x8e57a38c +0, 392400, 152064, 0xc379517a +0, 396000, 152064, 0xafc4f747 +0, 399600, 152064, 0xbc9c9be4 +0, 403200, 152064, 0xd602b2f5 +0, 406800, 152064, 0x8d85a450 +0, 410400, 152064, 0x48183c74 +0, 414000, 152064, 0xd1725590 +0, 417600, 152064, 0x5ef42ed7 +0, 421200, 152064, 0xad3a3883 +0, 424800, 152064, 0x7a3e0ddd +0, 428400, 152064, 0x59bdfd38 +0, 432000, 152064, 0x5ac3ba9f +0, 435600, 152064, 0x266cbd00 +0, 439200, 152064, 0x97d29e00 +0, 442800, 152064, 0x620774c2 +0, 446400, 152064, 0xaae8b96f +0, 450000, 152064, 0x5f6bdfb6 +0, 453600, 152064, 0xb239da53 +0, 457200, 152064, 0x654b5680 +0, 460800, 152064, 0xd796b723 +0, 464400, 152064, 0xd5c84a81 +0, 468000, 152064, 0x2a761652 +0, 471600, 152064, 0x1137e145 +0, 475200, 152064, 0x1a9a451b +0, 478800, 152064, 0x5ca751c4 +0, 482400, 152064, 0x074acec7 +0, 486000, 152064, 0x9ddfe77d +0, 489600, 152064, 0xfb211c29 +0, 493200, 152064, 0x681ad4dd +0, 496800, 152064, 0x702c12cc +0, 500400, 152064, 0x556c5101 +0, 504000, 152064, 0x39d4bb54 +0, 507600, 152064, 0xa3a118d6 +0, 511200, 152064, 0xb78b7db1 +0, 514800, 152064, 0x4e20eed5 +0, 518400, 152064, 0x6555a9df +0, 522000, 152064, 0xb607a9a4 +0, 525600, 152064, 0x3cf96a94 +0, 529200, 152064, 0xb2679007 +0, 532800, 152064, 0xf09d5b85 +0, 536400, 152064, 0x3961ba07 +0, 540000, 152064, 0x0c28363a +0, 543600, 152064, 0x0a017c2d +0, 547200, 152064, 0x3a661de3 +0, 550800, 152064, 0xf8d1bdee +0, 554400, 152064, 0x6f47791b +0, 558000, 152064, 0xe05b22c6 +0, 561600, 152064, 0x7cc93bb0 +0, 565200, 152064, 0xeb90c3d8 +0, 568800, 152064, 0x1a1eac98 +0, 572400, 152064, 0x92985671 +0, 576000, 152064, 0x2fe3ce53 +0, 579600, 152064, 0x61def691 +0, 583200, 152064, 0x90820730 +0, 586800, 152064, 0x17630372 +0, 590400, 152064, 0xaf6cea12 +0, 594000, 152064, 0xfe3b7ecc +0, 597600, 152064, 0x904a5b2e +0, 601200, 152064, 0x0d88d5f2 +0, 604800, 152064, 0x498d22b1 +0, 608400, 152064, 0x56baba83 +0, 612000, 152064, 0xda4d6dfa +0, 615600, 152064, 0xaa38cbdd +0, 619200, 152064, 0x4077f15d +0, 622800, 152064, 0x7e006ec2 +0, 626400, 152064, 0x59964a89 +0, 630000, 152064, 0x04c078e3 +0, 633600, 152064, 0x7a5faf97 +0, 637200, 152064, 0xc517b3e9 +0, 640800, 152064, 0xfcc81af5 +0, 644400, 152064, 0xdcb44f62 +0, 648000, 152064, 0x2a080b72 +0, 651600, 152064, 0x91f88c67 +0, 655200, 152064, 0xd39caf81 +0, 658800, 152064, 0x0764ae31 +0, 662400, 152064, 0x0ddb82ed +0, 666000, 152064, 0xed6d17e4 +0, 669600, 152064, 0xb4f74712 +0, 673200, 152064, 0x23a20787 +0, 676800, 152064, 0x853e7b33 +0, 680400, 152064, 0xc6bac173 +0, 684000, 152064, 0xb590ec15 +0, 687600, 152064, 0xfdd2943c +0, 691200, 152064, 0xba5d1160 +0, 694800, 152064, 0xe732c5a7 +0, 698400, 152064, 0x279f6ce9 +0, 702000, 152064, 0xb3835829 +0, 705600, 152064, 0x0901b2a1 +0, 709200, 152064, 0x3df2b8f8 +0, 712800, 152064, 0x374496a4 +0, 716400, 152064, 0x1bc6a4ae +0, 720000, 152064, 0xdb4b372e +0, 723600, 152064, 0x8c11c214 +0, 727200, 152064, 0xd2d5c093 +0, 730800, 152064, 0x8dda094e +0, 734400, 152064, 0x9b2cc401 +0, 738000, 152064, 0x1a3b49d5 +0, 741600, 152064, 0xaf5342ff +0, 745200, 152064, 0x74c0de83 +0, 748800, 152064, 0xcf486137 +0, 752400, 152064, 0xcf005b3b +0, 756000, 152064, 0x86a64c55 +0, 759600, 152064, 0xdd3f7ae9 +0, 763200, 152064, 0xb0d01e53 +0, 766800, 152064, 0x83219065 +0, 770400, 152064, 0x17a35d27 +0, 774000, 152064, 0xf92645b5 +0, 777600, 152064, 0x8322bdbf +0, 781200, 152064, 0xd589f6a2 +0, 784800, 152064, 0x80a62d9e +0, 788400, 152064, 0x05b3e0d1 +0, 792000, 152064, 0xd657aa0b +0, 795600, 152064, 0xec5ac2dd +0, 799200, 152064, 0xbf0ff969 +0, 802800, 152064, 0xc34a5140 +0, 806400, 152064, 0x814705c4 +0, 810000, 152064, 0xe9592008 +0, 813600, 152064, 0xf12c933c +0, 817200, 152064, 0x2daee178 +0, 820800, 152064, 0xa2573028 +0, 824400, 152064, 0x6109f58d +0, 828000, 152064, 0x64ab8ce4 +0, 831600, 152064, 0x13a88b6e +0, 835200, 152064, 0x8f0181a9 +0, 838800, 152064, 0xd5295fd4 +0, 842400, 152064, 0xfdbeeb0d +0, 846000, 152064, 0x05ecd231 +0, 849600, 152064, 0x48d164cd +0, 853200, 152064, 0xc279cf63 +0, 856800, 152064, 0x1d5e6a03 +0, 860400, 152064, 0xd9dc1807 +0, 864000, 152064, 0xbcc83676 +0, 867600, 152064, 0x65a9811e +0, 871200, 152064, 0x3ccfe5a8 +0, 874800, 152064, 0x2f2ff051 +0, 878400, 152064, 0x9193e093 +0, 882000, 152064, 0x9a30fdc6 +0, 885600, 152064, 0x90b7ea10 +0, 889200, 152064, 0x3291910c +0, 892800, 152064, 0x2335d186 +0, 896400, 152064, 0x2890cf1d +0, 900000, 152064, 0x8c8b6245 +0, 903600, 152064, 0x24b84eda +0, 907200, 152064, 0x04a12446 +0, 910800, 152064, 0xd9d91d51 +0, 914400, 152064, 0xbf450adf +0, 918000, 152064, 0xa19a9a41 +0, 921600, 152064, 0x2211ab01 +0, 925200, 152064, 0x8fe85430 +0, 928800, 152064, 0x5a152861 +0, 932400, 152064, 0x7fe76995 +0, 936000, 152064, 0x508b99cd +0, 939600, 152064, 0x92e79437 +0, 943200, 152064, 0x8572eac9 +0, 946800, 152064, 0x42e3d513 +0, 950400, 152064, 0x6bee9e38 +0, 954000, 152064, 0x2858ad4b +0, 957600, 152064, 0x96d87d00 +0, 961200, 152064, 0x749f1032 +0, 964800, 152064, 0x668fca6c +0, 968400, 152064, 0x11d278d9 +0, 972000, 152064, 0x10fd46ea +0, 975600, 152064, 0xc8b193c8 +0, 979200, 152064, 0x035e7d02 +0, 982800, 152064, 0x067f583c +0, 986400, 152064, 0xd9648a1e +0, 990000, 152064, 0x92487b7e +0, 993600, 152064, 0xc7b35421 +0, 997200, 152064, 0x2ed57c1c +0, 1000800, 152064, 0xefe24c5f +0, 1004400, 152064, 0x8df0118b +0, 1008000, 152064, 0x18f0278d +0, 1011600, 152064, 0x63ac45ad +0, 1015200, 152064, 0xd79849f0 +0, 1018800, 152064, 0x1f1d4dab +0, 1022400, 152064, 0x736fb5b8 +0, 1026000, 152064, 0xc24eb80c +0, 1029600, 152064, 0x64ca3b11 +0, 1033200, 152064, 0x35d8674c +0, 1036800, 152064, 0x3c5a7b51 +0, 1040400, 152064, 0x97550b81 +0, 1044000, 152064, 0x731454b5 +0, 1047600, 152064, 0x01de43bc +0, 1051200, 152064, 0xbda7afae +0, 1054800, 152064, 0xeb34d714 +0, 1058400, 152064, 0x1260cc98 +0, 1062000, 152064, 0x7e592c36 +0, 1065600, 152064, 0x40b3676e +0, 1069200, 152064, 0x8c9d6b94 +0, 1072800, 152064, 0xc7988665 +0, 1076400, 152064, 0xf2994d52 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcaq2lq_brcm_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcaq2lq_brcm_b new file mode 100644 index 00000000..bc41f24e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcaq2lq_brcm_b @@ -0,0 +1,100 @@ +0, 0, 152064, 0x712a2ad3 +0, 3600, 152064, 0x83420c9d +0, 7200, 152064, 0xf3d77f46 +0, 10800, 152064, 0x67eab1a2 +0, 14400, 152064, 0x41df4534 +0, 18000, 152064, 0x68f268ce +0, 21600, 152064, 0x288debdf +0, 25200, 152064, 0x46ae56a7 +0, 28800, 152064, 0x1720f327 +0, 32400, 152064, 0x64752592 +0, 36000, 152064, 0x43e17a27 +0, 39600, 152064, 0x39f7cc52 +0, 43200, 152064, 0xc19a785c +0, 46800, 152064, 0x562df0d4 +0, 50400, 152064, 0x50c96da0 +0, 54000, 152064, 0x1da8bdb5 +0, 57600, 152064, 0x02ddfb59 +0, 61200, 152064, 0x4d0c3e0e +0, 64800, 152064, 0x1605371b +0, 68400, 152064, 0x9772464d +0, 72000, 152064, 0xc603441c +0, 75600, 152064, 0xf9581917 +0, 79200, 152064, 0x4dbf74af +0, 82800, 152064, 0x04b8b820 +0, 86400, 152064, 0x75061cdf +0, 90000, 152064, 0x760bea90 +0, 93600, 152064, 0x7114cab3 +0, 97200, 152064, 0x89e14328 +0, 100800, 152064, 0x402ba116 +0, 104400, 152064, 0x8af2ccc6 +0, 108000, 152064, 0x1294333a +0, 111600, 152064, 0xe466aa9f +0, 115200, 152064, 0x7ce28426 +0, 118800, 152064, 0x21c16487 +0, 122400, 152064, 0xde3d5fc9 +0, 126000, 152064, 0x58cb2906 +0, 129600, 152064, 0x1df514ec +0, 133200, 152064, 0x7e45bfb6 +0, 136800, 152064, 0xcdaaafc0 +0, 140400, 152064, 0x70a58eac +0, 144000, 152064, 0xca7263b0 +0, 147600, 152064, 0x022621e0 +0, 151200, 152064, 0x938901c2 +0, 154800, 152064, 0x8c099e47 +0, 158400, 152064, 0xebfecda0 +0, 162000, 152064, 0x5a3aff71 +0, 165600, 152064, 0xb47c6692 +0, 169200, 152064, 0xde04b626 +0, 172800, 152064, 0xb1c61c94 +0, 176400, 152064, 0xbcc7eb35 +0, 180000, 152064, 0x801b958d +0, 183600, 152064, 0xf5254f5d +0, 187200, 152064, 0x4336da49 +0, 190800, 152064, 0x3139bcaf +0, 194400, 152064, 0xb8359026 +0, 198000, 152064, 0xb6d39756 +0, 201600, 152064, 0xdf5c1c14 +0, 205200, 152064, 0x3f587336 +0, 208800, 152064, 0x105eeb74 +0, 212400, 152064, 0xffe23c19 +0, 216000, 152064, 0xfb1a1c5e +0, 219600, 152064, 0xb8edb942 +0, 223200, 152064, 0x7ca92b27 +0, 226800, 152064, 0xd2fe1e24 +0, 230400, 152064, 0xd6b8939a +0, 234000, 152064, 0xd59743da +0, 237600, 152064, 0x005d9e7a +0, 241200, 152064, 0x4c5cb03e +0, 244800, 152064, 0x4a7c363a +0, 248400, 152064, 0x627c88a8 +0, 252000, 152064, 0x3fcd8650 +0, 255600, 152064, 0x75b7f0b3 +0, 259200, 152064, 0xcbb95a00 +0, 262800, 152064, 0xc9871783 +0, 266400, 152064, 0xe9c2b471 +0, 270000, 152064, 0x513f0eb3 +0, 273600, 152064, 0x5a5c4fdc +0, 277200, 152064, 0xdc8cbab6 +0, 280800, 152064, 0x86fe75d2 +0, 284400, 152064, 0xa6d52ce2 +0, 288000, 152064, 0xde74a975 +0, 291600, 152064, 0xc1bf3ef2 +0, 295200, 152064, 0xa1a1b832 +0, 298800, 152064, 0x0b23f718 +0, 302400, 152064, 0x842eed85 +0, 306000, 152064, 0xda96923b +0, 309600, 152064, 0x7d011f83 +0, 313200, 152064, 0x26a25528 +0, 316800, 152064, 0x117b7971 +0, 320400, 152064, 0x3f17b29d +0, 324000, 152064, 0x428654c0 +0, 327600, 152064, 0xc2343316 +0, 331200, 152064, 0x284371fe +0, 334800, 152064, 0x388ef972 +0, 338400, 152064, 0x5f046560 +0, 342000, 152064, 0x6e9ac7e9 +0, 345600, 152064, 0x0cd6277c +0, 349200, 152064, 0xfc7ba0b1 +0, 352800, 152064, 0x4d840475 +0, 356400, 152064, 0xd4cb26a6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcv_brcm_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcv_brcm_a new file mode 100644 index 00000000..cbfc5681 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcv_brcm_a @@ -0,0 +1,300 @@ +0, 0, 152064, 0x995bb4bd +0, 3600, 152064, 0xad287357 +0, 7200, 152064, 0x38fa4661 +0, 10800, 152064, 0x8aae73cf +0, 14400, 152064, 0x4a13eada +0, 18000, 152064, 0x48b33901 +0, 21600, 152064, 0x011487bc +0, 25200, 152064, 0xd4ce1925 +0, 28800, 152064, 0x5d679ddd +0, 32400, 152064, 0x276cd5cf +0, 36000, 152064, 0x99c625f0 +0, 39600, 152064, 0xb2f756d1 +0, 43200, 152064, 0xb19c2978 +0, 46800, 152064, 0xdac0ff3c +0, 50400, 152064, 0x3c1c8d63 +0, 54000, 152064, 0x818ea0a8 +0, 57600, 152064, 0xa7c122a5 +0, 61200, 152064, 0x67ad3519 +0, 64800, 152064, 0xc81b2a88 +0, 68400, 152064, 0x8ae6633e +0, 72000, 152064, 0xed945788 +0, 75600, 152064, 0x4c740bcb +0, 79200, 152064, 0xd8408d09 +0, 82800, 152064, 0xb710e8b8 +0, 86400, 152064, 0xb8c647b9 +0, 90000, 152064, 0x802b2e23 +0, 93600, 152064, 0x30672529 +0, 97200, 152064, 0x328a72b6 +0, 100800, 152064, 0xeb6dbe94 +0, 104400, 152064, 0x1c19dcc5 +0, 108000, 152064, 0xfdc6b998 +0, 111600, 152064, 0xf9e2cd80 +0, 115200, 152064, 0x025eb15e +0, 118800, 152064, 0xfd998ad8 +0, 122400, 152064, 0x8fdf736f +0, 126000, 152064, 0xa5a7554a +0, 129600, 152064, 0xcea63304 +0, 133200, 152064, 0xcb28ec28 +0, 136800, 152064, 0x92efb591 +0, 140400, 152064, 0x0f2376c3 +0, 144000, 152064, 0xe9cb5ecf +0, 147600, 152064, 0xcd2d0eba +0, 151200, 152064, 0xd57fe4fd +0, 154800, 152064, 0xc486ab8e +0, 158400, 152064, 0x01a1f709 +0, 162000, 152064, 0x7ac5b13a +0, 165600, 152064, 0x6f519279 +0, 169200, 152064, 0xfd7cd9a0 +0, 172800, 152064, 0xfae649d2 +0, 176400, 152064, 0x618507ca +0, 180000, 152064, 0xb177bc15 +0, 183600, 152064, 0x6fa36854 +0, 187200, 152064, 0xc13cb77d +0, 190800, 152064, 0x6d40cb01 +0, 194400, 152064, 0xa3db96a2 +0, 198000, 152064, 0xe5ba6c99 +0, 201600, 152064, 0xca9ff3ee +0, 205200, 152064, 0x6c016c65 +0, 208800, 152064, 0xdf93ed80 +0, 212400, 152064, 0x93112ec8 +0, 216000, 152064, 0x8ab3ea14 +0, 219600, 152064, 0x02f5b891 +0, 223200, 152064, 0xdafd562b +0, 226800, 152064, 0xa96a2bd7 +0, 230400, 152064, 0xdff8bc68 +0, 234000, 152064, 0x8d956b4b +0, 237600, 152064, 0xb4aeb960 +0, 241200, 152064, 0x391cf0dd +0, 244800, 152064, 0x03137de9 +0, 248400, 152064, 0x2bfa8c4b +0, 252000, 152064, 0xfb54d3a5 +0, 255600, 152064, 0x650146e7 +0, 259200, 152064, 0xd3a7765f +0, 262800, 152064, 0x49d72b90 +0, 266400, 152064, 0xf089b357 +0, 270000, 152064, 0x23a2be41 +0, 273600, 152064, 0x2ea86592 +0, 277200, 152064, 0x99d6f56b +0, 280800, 152064, 0xc2ca75b9 +0, 284400, 152064, 0x390b7278 +0, 288000, 152064, 0x0f6d1f1e +0, 291600, 152064, 0x79e2a3f4 +0, 295200, 152064, 0x51d5e1da +0, 298800, 152064, 0xdb57419a +0, 302400, 152064, 0xf90a4153 +0, 306000, 152064, 0xd192f6c6 +0, 309600, 152064, 0x8cd3895a +0, 313200, 152064, 0x0d3ec577 +0, 316800, 152064, 0x146e8492 +0, 320400, 152064, 0xc9939c22 +0, 324000, 152064, 0xf1f4275e +0, 327600, 152064, 0xb898eb35 +0, 331200, 152064, 0xed315ee9 +0, 334800, 152064, 0x9046b760 +0, 338400, 152064, 0x599a736b +0, 342000, 152064, 0xaef20726 +0, 345600, 152064, 0x0d136768 +0, 349200, 152064, 0xfe4ed2a8 +0, 352800, 152064, 0x5a85524b +0, 356400, 152064, 0x6d495dd2 +0, 360000, 152064, 0x04bdb815 +0, 363600, 152064, 0x28aae1c5 +0, 367200, 152064, 0xc20bc8d9 +0, 370800, 152064, 0xa33d9b41 +0, 374400, 152064, 0x6269cb43 +0, 378000, 152064, 0x4f81d636 +0, 381600, 152064, 0xc6062166 +0, 385200, 152064, 0xb027fbcc +0, 388800, 152064, 0x73a7a584 +0, 392400, 152064, 0xf67e520a +0, 396000, 152064, 0x94eff023 +0, 399600, 152064, 0xef1da8e5 +0, 403200, 152064, 0x2d9ab411 +0, 406800, 152064, 0xf0c39b5d +0, 410400, 152064, 0xb2374724 +0, 414000, 152064, 0x939a5243 +0, 417600, 152064, 0xee3438db +0, 421200, 152064, 0x7da04012 +0, 424800, 152064, 0xac611668 +0, 428400, 152064, 0xdce3062e +0, 432000, 152064, 0xb57cc00e +0, 435600, 152064, 0xaf96b59e +0, 439200, 152064, 0x56789c13 +0, 442800, 152064, 0xb1f678b5 +0, 446400, 152064, 0xb340b8c4 +0, 450000, 152064, 0x86e6e304 +0, 453600, 152064, 0xa056e037 +0, 457200, 152064, 0x16885d27 +0, 460800, 152064, 0x9c5ac065 +0, 464400, 152064, 0x563d5335 +0, 468000, 152064, 0x3ca71c1e +0, 471600, 152064, 0xad34e16c +0, 475200, 152064, 0x6d074b27 +0, 478800, 152064, 0x9b1c4909 +0, 482400, 152064, 0xdbced198 +0, 486000, 152064, 0x8a0ded00 +0, 489600, 152064, 0x5ffc209b +0, 493200, 152064, 0x47cfd269 +0, 496800, 152064, 0xe3c0137e +0, 500400, 152064, 0xcb6a5e53 +0, 504000, 152064, 0x87cec05f +0, 507600, 152064, 0x92721dd2 +0, 511200, 152064, 0x3f7d7b3b +0, 514800, 152064, 0xd63ef417 +0, 518400, 152064, 0xf8e4b05a +0, 522000, 152064, 0xb5dcb421 +0, 525600, 152064, 0x53c96f6a +0, 529200, 152064, 0x24ae98a3 +0, 532800, 152064, 0x2e9b5fff +0, 536400, 152064, 0x7795bf12 +0, 540000, 152064, 0x499d37ca +0, 543600, 152064, 0xfe478487 +0, 547200, 152064, 0xcd661afb +0, 550800, 152064, 0x44f8bf00 +0, 554400, 152064, 0x90b67809 +0, 558000, 152064, 0x8f5726d1 +0, 561600, 152064, 0x2e3c39d5 +0, 565200, 152064, 0x4b67c4e6 +0, 568800, 152064, 0x9fecb7cf +0, 572400, 152064, 0x207766ea +0, 576000, 152064, 0x5846bf7b +0, 579600, 152064, 0x4237fba1 +0, 583200, 152064, 0x983e0cbd +0, 586800, 152064, 0x6be100d1 +0, 590400, 152064, 0x9d0beb8f +0, 594000, 152064, 0x234b82e7 +0, 597600, 152064, 0x83fb5ef1 +0, 601200, 152064, 0xf503dcb2 +0, 604800, 152064, 0x031a27f2 +0, 608400, 152064, 0x2f1abf24 +0, 612000, 152064, 0x54d77010 +0, 615600, 152064, 0x049fc0fc +0, 619200, 152064, 0x20f2f7e7 +0, 622800, 152064, 0xc0d57467 +0, 626400, 152064, 0xbe464eef +0, 630000, 152064, 0x035c9052 +0, 633600, 152064, 0x91cba4fb +0, 637200, 152064, 0x11cdbbfb +0, 640800, 152064, 0xe61116d5 +0, 644400, 152064, 0x16db46b8 +0, 648000, 152064, 0x54f30d9f +0, 651600, 152064, 0x211a8d2d +0, 655200, 152064, 0x5a74a56b +0, 658800, 152064, 0x0ff4ba72 +0, 662400, 152064, 0x4c398ad6 +0, 666000, 152064, 0x830814f0 +0, 669600, 152064, 0xa51f4bab +0, 673200, 152064, 0xf3460de6 +0, 676800, 152064, 0x7e1979a1 +0, 680400, 152064, 0x4b3ebb3a +0, 684000, 152064, 0x83d1f4f8 +0, 687600, 152064, 0xfbf08683 +0, 691200, 152064, 0x901c07ec +0, 694800, 152064, 0xbc2dc1c7 +0, 698400, 152064, 0x6e646b3b +0, 702000, 152064, 0x51a25aab +0, 705600, 152064, 0xa042ab78 +0, 709200, 152064, 0xb972af58 +0, 712800, 152064, 0xcdca9568 +0, 716400, 152064, 0x17b69d1c +0, 720000, 152064, 0x41c43ea2 +0, 723600, 152064, 0x195fc7a0 +0, 727200, 152064, 0xf4cec580 +0, 730800, 152064, 0xb3b10936 +0, 734400, 152064, 0x102bc2ec +0, 738000, 152064, 0xc99d4767 +0, 741600, 152064, 0x60c745b0 +0, 745200, 152064, 0x8176e0cf +0, 748800, 152064, 0xd47e69b5 +0, 752400, 152064, 0xacce674c +0, 756000, 152064, 0x031b51f8 +0, 759600, 152064, 0x0eb681ef +0, 763200, 152064, 0x0b69334b +0, 766800, 152064, 0xda819c1f +0, 770400, 152064, 0xa93f62d2 +0, 774000, 152064, 0x51374db5 +0, 777600, 152064, 0x885dccff +0, 781200, 152064, 0xd0780444 +0, 784800, 152064, 0xa31733ca +0, 788400, 152064, 0x3f3de84e +0, 792000, 152064, 0x2af2b2c3 +0, 795600, 152064, 0xa62dceae +0, 799200, 152064, 0xca1cffd1 +0, 802800, 152064, 0x3c7d561b +0, 806400, 152064, 0xbc04130a +0, 810000, 152064, 0xbd2829ae +0, 813600, 152064, 0xdbbb9820 +0, 817200, 152064, 0xfc3ef628 +0, 820800, 152064, 0xd5da3ec3 +0, 824400, 152064, 0x62d5fcc1 +0, 828000, 152064, 0x455a8dae +0, 831600, 152064, 0x421c9147 +0, 835200, 152064, 0x6a168484 +0, 838800, 152064, 0x7ba15d32 +0, 842400, 152064, 0xd089ed27 +0, 846000, 152064, 0x8fc4d894 +0, 849600, 152064, 0x99e47125 +0, 853200, 152064, 0xf55dda68 +0, 856800, 152064, 0x6bf06cf1 +0, 860400, 152064, 0x7dc41a9d +0, 864000, 152064, 0x78b84019 +0, 867600, 152064, 0x85ae8973 +0, 871200, 152064, 0x7b7aeabe +0, 874800, 152064, 0xf9a8f6bf +0, 878400, 152064, 0xe195ddcd +0, 882000, 152064, 0x83edffe9 +0, 885600, 152064, 0x59cce97a +0, 889200, 152064, 0x15268af1 +0, 892800, 152064, 0x270cca95 +0, 896400, 152064, 0x8bced1f9 +0, 900000, 152064, 0x08ee5cec +0, 903600, 152064, 0x01e74f95 +0, 907200, 152064, 0x7e19238f +0, 910800, 152064, 0x6bcb2b9d +0, 914400, 152064, 0x58111385 +0, 918000, 152064, 0x6c7aa1f7 +0, 921600, 152064, 0xb713a822 +0, 925200, 152064, 0x1d645cee +0, 928800, 152064, 0x9c592969 +0, 932400, 152064, 0x2472769e +0, 936000, 152064, 0x71b7a5ad +0, 939600, 152064, 0xc6bba1c6 +0, 943200, 152064, 0x7351f305 +0, 946800, 152064, 0x579edbba +0, 950400, 152064, 0x90eda919 +0, 954000, 152064, 0x2833b10d +0, 957600, 152064, 0x4b967d65 +0, 961200, 152064, 0x6e7d1702 +0, 964800, 152064, 0x59dbcf5b +0, 968400, 152064, 0xa138847b +0, 972000, 152064, 0xb2414e8d +0, 975600, 152064, 0xb90497f6 +0, 979200, 152064, 0xcd728159 +0, 982800, 152064, 0x005d5bdd +0, 986400, 152064, 0x27c88fb6 +0, 990000, 152064, 0x3ccb8a93 +0, 993600, 152064, 0xc50256dd +0, 997200, 152064, 0x111e7dee +0, 1000800, 152064, 0x259d4a5d +0, 1004400, 152064, 0x9385148b +0, 1008000, 152064, 0x74002ab0 +0, 1011600, 152064, 0xd2c74adc +0, 1015200, 152064, 0x72854b2a +0, 1018800, 152064, 0x638e5c08 +0, 1022400, 152064, 0x9626bbb3 +0, 1026000, 152064, 0xc107c18f +0, 1029600, 152064, 0x8bd04578 +0, 1033200, 152064, 0xbcdb6db6 +0, 1036800, 152064, 0x9d0c81be +0, 1040400, 152064, 0xf25106b6 +0, 1044000, 152064, 0x54c25254 +0, 1047600, 152064, 0x4bf74663 +0, 1051200, 152064, 0x0051b054 +0, 1054800, 152064, 0x5193d3d4 +0, 1058400, 152064, 0xb5d0d045 +0, 1062000, 152064, 0x350a31ca +0, 1065600, 152064, 0xb8fb7264 +0, 1069200, 152064, 0x7fb97645 +0, 1072800, 152064, 0xcd948c41 +0, 1076400, 152064, 0x38c7570a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcvfl_bcrm_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcvfl_bcrm_a new file mode 100644 index 00000000..a67b4bae --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcvfl_bcrm_a @@ -0,0 +1,300 @@ +0, 0, 152064, 0x502ec077 +0, 3600, 152064, 0x84807243 +0, 7200, 152064, 0xd7474a6e +0, 10800, 152064, 0x793469bb +0, 14400, 152064, 0xb7a0faf7 +0, 18000, 152064, 0x1d3d3cba +0, 21600, 152064, 0xb62583de +0, 25200, 152064, 0xc8422fb1 +0, 28800, 152064, 0x321dc699 +0, 32400, 152064, 0x7a34d350 +0, 36000, 152064, 0xaa4c302d +0, 39600, 152064, 0x45fa7ab0 +0, 43200, 152064, 0xc7262e41 +0, 46800, 152064, 0x3550000c +0, 50400, 152064, 0xf4bab54b +0, 54000, 152064, 0xaccf9c1a +0, 57600, 152064, 0x9bee20e9 +0, 61200, 152064, 0x47fb7720 +0, 64800, 152064, 0x12c63ffb +0, 68400, 152064, 0xfa2b8b4d +0, 72000, 152064, 0x279964bd +0, 75600, 152064, 0xb8b01c7e +0, 79200, 152064, 0x816fa010 +0, 82800, 152064, 0x59fe1c8c +0, 86400, 152064, 0x13393fad +0, 90000, 152064, 0x991a50a4 +0, 93600, 152064, 0x57df3eb7 +0, 97200, 152064, 0x744371df +0, 100800, 152064, 0xe9f6d3ff +0, 104400, 152064, 0xc506fba0 +0, 108000, 152064, 0x6295b90e +0, 111600, 152064, 0xa19cee2d +0, 115200, 152064, 0xf8c1b3ca +0, 118800, 152064, 0x69f68ce0 +0, 122400, 152064, 0x80558bb6 +0, 126000, 152064, 0x27824fa5 +0, 129600, 152064, 0x27c929a1 +0, 133200, 152064, 0xc0fe06d1 +0, 136800, 152064, 0xc52bc58c +0, 140400, 152064, 0x0a5363c7 +0, 144000, 152064, 0xd0f45a0d +0, 147600, 152064, 0x274710f9 +0, 151200, 152064, 0x89d2d390 +0, 154800, 152064, 0x12a9bfb0 +0, 158400, 152064, 0x04501a93 +0, 162000, 152064, 0xf92cbbf4 +0, 165600, 152064, 0xf6d1b27d +0, 169200, 152064, 0xe3e904c3 +0, 172800, 152064, 0x58f8516d +0, 176400, 152064, 0x70370c2b +0, 180000, 152064, 0xfeebc88c +0, 183600, 152064, 0x974c6ed6 +0, 187200, 152064, 0x401bdcf2 +0, 190800, 152064, 0xfe61e278 +0, 194400, 152064, 0x96ba8bb9 +0, 198000, 152064, 0x988492fd +0, 201600, 152064, 0xd1d913a9 +0, 205200, 152064, 0x6bc46f0e +0, 208800, 152064, 0x695ef706 +0, 212400, 152064, 0x142045c9 +0, 216000, 152064, 0xb390ed87 +0, 219600, 152064, 0xb9e6d2e5 +0, 223200, 152064, 0xe348797f +0, 226800, 152064, 0x1cbd29d6 +0, 230400, 152064, 0xbd7dd694 +0, 234000, 152064, 0x516873c3 +0, 237600, 152064, 0x27bba182 +0, 241200, 152064, 0x7541f920 +0, 244800, 152064, 0xfdf67042 +0, 248400, 152064, 0x6c3c7896 +0, 252000, 152064, 0xed86c467 +0, 255600, 152064, 0x4ea83ca2 +0, 259200, 152064, 0xa3e6725b +0, 262800, 152064, 0x917f5f16 +0, 266400, 152064, 0x8cf2d2e1 +0, 270000, 152064, 0x57a8d116 +0, 273600, 152064, 0x0db267d4 +0, 277200, 152064, 0xce782ac5 +0, 280800, 152064, 0x1c9d8518 +0, 284400, 152064, 0x47598ac7 +0, 288000, 152064, 0xc5033d97 +0, 291600, 152064, 0xd7aaa3a4 +0, 295200, 152064, 0x078afc96 +0, 298800, 152064, 0xc9fe673d +0, 302400, 152064, 0xe9284066 +0, 306000, 152064, 0xbc570982 +0, 309600, 152064, 0x0aac8574 +0, 313200, 152064, 0x098cbeee +0, 316800, 152064, 0x19c36a9d +0, 320400, 152064, 0x8fe4a893 +0, 324000, 152064, 0x0b652f17 +0, 327600, 152064, 0x10f2e6bf +0, 331200, 152064, 0x7ce5634e +0, 334800, 152064, 0x8fe4ac6c +0, 338400, 152064, 0xcaba749e +0, 342000, 152064, 0x5f8a0d5c +0, 345600, 152064, 0xcaa66bbc +0, 349200, 152064, 0xc87ae617 +0, 352800, 152064, 0xe8ef4dd7 +0, 356400, 152064, 0xdfca5a07 +0, 360000, 152064, 0x5f7eab7d +0, 363600, 152064, 0x8a65ebbb +0, 367200, 152064, 0x4beab4a0 +0, 370800, 152064, 0xb5e6ab30 +0, 374400, 152064, 0x8fe4f4d4 +0, 378000, 152064, 0x95bde1ca +0, 381600, 152064, 0xcc5e3a53 +0, 385200, 152064, 0xf09f1dd7 +0, 388800, 152064, 0x10179672 +0, 392400, 152064, 0x4ad16184 +0, 396000, 152064, 0x9efa0e23 +0, 399600, 152064, 0x22f59522 +0, 403200, 152064, 0x4d38f09d +0, 406800, 152064, 0x4c5ebf56 +0, 410400, 152064, 0xb19d5077 +0, 414000, 152064, 0xa98576b9 +0, 417600, 152064, 0x65324239 +0, 421200, 152064, 0x709e4031 +0, 424800, 152064, 0xf8e81681 +0, 428400, 152064, 0x058514e5 +0, 432000, 152064, 0xd1d1c806 +0, 435600, 152064, 0x0e4dde57 +0, 439200, 152064, 0x49e9c2bb +0, 442800, 152064, 0x01417ce6 +0, 446400, 152064, 0xda7ebbf1 +0, 450000, 152064, 0xa22906b7 +0, 453600, 152064, 0x32e2df87 +0, 457200, 152064, 0x69917c8f +0, 460800, 152064, 0xea8ed2cc +0, 464400, 152064, 0x0b8d57f1 +0, 468000, 152064, 0x5f683bcd +0, 471600, 152064, 0x5162fe2f +0, 475200, 152064, 0x49c052f8 +0, 478800, 152064, 0x990b69ba +0, 482400, 152064, 0xa6d4f99f +0, 486000, 152064, 0xe79ef4da +0, 489600, 152064, 0x5e8a3847 +0, 493200, 152064, 0x38b1e75f +0, 496800, 152064, 0xf5c91bed +0, 500400, 152064, 0xd59a6d26 +0, 504000, 152064, 0xc361de06 +0, 507600, 152064, 0x63ed2229 +0, 511200, 152064, 0xb8229205 +0, 514800, 152064, 0x7c6619af +0, 518400, 152064, 0x4126b02f +0, 522000, 152064, 0x9250b99b +0, 525600, 152064, 0x589778f9 +0, 529200, 152064, 0xed1fa45b +0, 532800, 152064, 0x700b6f32 +0, 536400, 152064, 0x0590df55 +0, 540000, 152064, 0x3e9c4018 +0, 543600, 152064, 0x957b8860 +0, 547200, 152064, 0x56161560 +0, 550800, 152064, 0xbc43bc3b +0, 554400, 152064, 0x508d8632 +0, 558000, 152064, 0xbc5736d8 +0, 561600, 152064, 0xed7d3aef +0, 565200, 152064, 0x1dcdda9f +0, 568800, 152064, 0x8ef6d5c9 +0, 572400, 152064, 0x15466acc +0, 576000, 152064, 0x45d4cf67 +0, 579600, 152064, 0x8c900b9d +0, 583200, 152064, 0x747006e0 +0, 586800, 152064, 0xac920a0c +0, 590400, 152064, 0xb8210c27 +0, 594000, 152064, 0x7dbb873a +0, 597600, 152064, 0x0d4d7584 +0, 601200, 152064, 0xefb3fe60 +0, 604800, 152064, 0x905e2644 +0, 608400, 152064, 0x7c04e534 +0, 612000, 152064, 0x8889972a +0, 615600, 152064, 0x21c7d8ad +0, 619200, 152064, 0x1c641176 +0, 622800, 152064, 0xf71489a4 +0, 626400, 152064, 0xd7ac5555 +0, 630000, 152064, 0xb4609c6d +0, 633600, 152064, 0xf5b2bd5e +0, 637200, 152064, 0x9f43ce57 +0, 640800, 152064, 0x77642dd3 +0, 644400, 152064, 0x3e79565c +0, 648000, 152064, 0x95f40b8e +0, 651600, 152064, 0x3c8ca4d4 +0, 655200, 152064, 0xa02ac497 +0, 658800, 152064, 0x4c93b377 +0, 662400, 152064, 0x55f5ac68 +0, 666000, 152064, 0xf8652eca +0, 669600, 152064, 0x56e94574 +0, 673200, 152064, 0x6d8302e1 +0, 676800, 152064, 0x29a57061 +0, 680400, 152064, 0x24e4cfdc +0, 684000, 152064, 0xf5a5d62a +0, 687600, 152064, 0x998870c1 +0, 691200, 152064, 0xa15b1f4e +0, 694800, 152064, 0xb0ccb51f +0, 698400, 152064, 0xeaaf59ab +0, 702000, 152064, 0x7e2b4fe6 +0, 705600, 152064, 0x72299fea +0, 709200, 152064, 0x769da8b2 +0, 712800, 152064, 0xefad7ef8 +0, 716400, 152064, 0x24819983 +0, 720000, 152064, 0x2aad32ab +0, 723600, 152064, 0xc80cac79 +0, 727200, 152064, 0x1659d628 +0, 730800, 152064, 0xef941f66 +0, 734400, 152064, 0x0d7fcdb5 +0, 738000, 152064, 0x7c1853fa +0, 741600, 152064, 0xb94c4d3c +0, 745200, 152064, 0xc47adfc2 +0, 748800, 152064, 0x366a6729 +0, 752400, 152064, 0x7eb37b70 +0, 756000, 152064, 0xafd54c27 +0, 759600, 152064, 0x67b18636 +0, 763200, 152064, 0x93b22dcf +0, 766800, 152064, 0xa64991f1 +0, 770400, 152064, 0xd32a7102 +0, 774000, 152064, 0xff665d1c +0, 777600, 152064, 0xf107cc31 +0, 781200, 152064, 0xf5b25652 +0, 784800, 152064, 0x8caf783d +0, 788400, 152064, 0x72f3eb00 +0, 792000, 152064, 0xb5aea5f8 +0, 795600, 152064, 0xee70e870 +0, 799200, 152064, 0x7c3a0156 +0, 802800, 152064, 0x871b6383 +0, 806400, 152064, 0x48d831ff +0, 810000, 152064, 0xca233913 +0, 813600, 152064, 0xe14bc5eb +0, 817200, 152064, 0x9b1d27e7 +0, 820800, 152064, 0xfb9637f7 +0, 824400, 152064, 0x0c022157 +0, 828000, 152064, 0x16d35fc9 +0, 831600, 152064, 0x6d935f71 +0, 835200, 152064, 0xae4066fa +0, 838800, 152064, 0xcef94fdc +0, 842400, 152064, 0xc234edb9 +0, 846000, 152064, 0x26a4f2e2 +0, 849600, 152064, 0xd29ac23e +0, 853200, 152064, 0xb7604395 +0, 856800, 152064, 0x408084f6 +0, 860400, 152064, 0x0a02026c +0, 864000, 152064, 0x78b33c7c +0, 867600, 152064, 0xcb02b874 +0, 871200, 152064, 0xf566513b +0, 874800, 152064, 0xb34e52b1 +0, 878400, 152064, 0xf55ff493 +0, 882000, 152064, 0xb0e8282a +0, 885600, 152064, 0xe9510bbe +0, 889200, 152064, 0x292e8c5a +0, 892800, 152064, 0x62b9d2b0 +0, 896400, 152064, 0x3a8cc827 +0, 900000, 152064, 0x25cc465e +0, 903600, 152064, 0xf2bc32e2 +0, 907200, 152064, 0x6141f914 +0, 910800, 152064, 0x1171256f +0, 914400, 152064, 0x13cb2ded +0, 918000, 152064, 0x3d4ca557 +0, 921600, 152064, 0xf2b9e72e +0, 925200, 152064, 0x03f7547a +0, 928800, 152064, 0xc7302955 +0, 932400, 152064, 0xe78a46d3 +0, 936000, 152064, 0x3726a270 +0, 939600, 152064, 0x2f65722a +0, 943200, 152064, 0x55acce40 +0, 946800, 152064, 0xf6fa9db2 +0, 950400, 152064, 0x70a36937 +0, 954000, 152064, 0x9313742d +0, 957600, 152064, 0x2eb14e53 +0, 961200, 152064, 0x3d47c9c3 +0, 964800, 152064, 0xd0a90348 +0, 968400, 152064, 0x6ad48088 +0, 972000, 152064, 0x68e64738 +0, 975600, 152064, 0x04c3735a +0, 979200, 152064, 0x51d0593f +0, 982800, 152064, 0x42cf2b48 +0, 986400, 152064, 0xa5496a0c +0, 990000, 152064, 0x84c25549 +0, 993600, 152064, 0x96691600 +0, 997200, 152064, 0x423135db +0, 1000800, 152064, 0x8d2e08b6 +0, 1004400, 152064, 0xaeb4c840 +0, 1008000, 152064, 0xf3e71780 +0, 1011600, 152064, 0x8858228b +0, 1015200, 152064, 0xf28613f8 +0, 1018800, 152064, 0xb5327882 +0, 1022400, 152064, 0xbb60bb85 +0, 1026000, 152064, 0x345ab1c9 +0, 1029600, 152064, 0x8aac2cba +0, 1033200, 152064, 0x7ce15b4c +0, 1036800, 152064, 0xc09c55c0 +0, 1040400, 152064, 0x8482ddd6 +0, 1044000, 152064, 0xab222a13 +0, 1047600, 152064, 0xd39b0dea +0, 1051200, 152064, 0x6dab6e06 +0, 1054800, 152064, 0xec0891bd +0, 1058400, 152064, 0x88bd9701 +0, 1062000, 152064, 0xdf13072a +0, 1065600, 152064, 0x23b33081 +0, 1069200, 152064, 0x63943137 +0, 1072800, 152064, 0xab6a9052 +0, 1076400, 152064, 0x05485494 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcvflnl_bcrm_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcvflnl_bcrm_a new file mode 100644 index 00000000..97d76770 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcvflnl_bcrm_a @@ -0,0 +1,300 @@ +0, 0, 152064, 0x3e39c08b +0, 3600, 152064, 0xabc67990 +0, 7200, 152064, 0x19614e74 +0, 10800, 152064, 0xa3776beb +0, 14400, 152064, 0xcce6ffdf +0, 18000, 152064, 0xb0e94746 +0, 21600, 152064, 0xdb1a84ef +0, 25200, 152064, 0xb2624509 +0, 28800, 152064, 0x32e2d826 +0, 32400, 152064, 0xb3bddf0b +0, 36000, 152064, 0x2e273ce3 +0, 39600, 152064, 0x67af7e4d +0, 43200, 152064, 0x505c3261 +0, 46800, 152064, 0xa43d015e +0, 50400, 152064, 0xad41c1f6 +0, 54000, 152064, 0x633ba55f +0, 57600, 152064, 0xe80634f0 +0, 61200, 152064, 0x80a07dc9 +0, 64800, 152064, 0x0e7a3bbf +0, 68400, 152064, 0xcb099196 +0, 72000, 152064, 0x57c96db5 +0, 75600, 152064, 0xccd422fa +0, 79200, 152064, 0x0850b7a7 +0, 82800, 152064, 0x30e33156 +0, 86400, 152064, 0x34e13f9a +0, 90000, 152064, 0x03d36000 +0, 93600, 152064, 0xbf7d49da +0, 97200, 152064, 0x77336d09 +0, 100800, 152064, 0xca8be5a9 +0, 104400, 152064, 0xe57c0b08 +0, 108000, 152064, 0xbe77c093 +0, 111600, 152064, 0x6bf1ff05 +0, 115200, 152064, 0x9142babf +0, 118800, 152064, 0x08db8e67 +0, 122400, 152064, 0x69ac8cb6 +0, 126000, 152064, 0xaa3b5c88 +0, 129600, 152064, 0x9bd32638 +0, 133200, 152064, 0x7972115a +0, 136800, 152064, 0x5c1dd47b +0, 140400, 152064, 0x8a196e02 +0, 144000, 152064, 0xa89672bc +0, 147600, 152064, 0x27b220e4 +0, 151200, 152064, 0xfa38dc4a +0, 154800, 152064, 0x4784c639 +0, 158400, 152064, 0xa5e4229a +0, 162000, 152064, 0xa986bdfc +0, 165600, 152064, 0x2951b47b +0, 169200, 152064, 0x4df404a6 +0, 172800, 152064, 0xc75155e8 +0, 176400, 152064, 0xfc05248c +0, 180000, 152064, 0x5d53da10 +0, 183600, 152064, 0x284376ec +0, 187200, 152064, 0x19fce380 +0, 190800, 152064, 0x876be6c9 +0, 194400, 152064, 0x39eb8ff9 +0, 198000, 152064, 0x289c9543 +0, 201600, 152064, 0x24dd2356 +0, 205200, 152064, 0x1dc17d3c +0, 208800, 152064, 0xd17c00ac +0, 212400, 152064, 0xc2ad54de +0, 216000, 152064, 0xbe11ee2f +0, 219600, 152064, 0x3db9dc89 +0, 223200, 152064, 0xac0d7bc2 +0, 226800, 152064, 0x8dab2dde +0, 230400, 152064, 0x566ad225 +0, 234000, 152064, 0x587c7853 +0, 237600, 152064, 0x601c9c80 +0, 241200, 152064, 0x2afaf751 +0, 244800, 152064, 0x1c9f7e3a +0, 248400, 152064, 0x899475bf +0, 252000, 152064, 0x0d65c7d9 +0, 255600, 152064, 0xafd63d12 +0, 259200, 152064, 0x162e62b9 +0, 262800, 152064, 0x5c9554be +0, 266400, 152064, 0x35fbdaa2 +0, 270000, 152064, 0x6438cbd8 +0, 273600, 152064, 0xde0772c9 +0, 277200, 152064, 0x79f82854 +0, 280800, 152064, 0x86957840 +0, 284400, 152064, 0xd9468cbf +0, 288000, 152064, 0x23e74609 +0, 291600, 152064, 0x3919a146 +0, 295200, 152064, 0xd641078b +0, 298800, 152064, 0x24397220 +0, 302400, 152064, 0xe7fc3a7c +0, 306000, 152064, 0x3997154a +0, 309600, 152064, 0x2af3952c +0, 313200, 152064, 0x274ac07a +0, 316800, 152064, 0x288f7b09 +0, 320400, 152064, 0xe6f9b022 +0, 324000, 152064, 0xf09e2fbb +0, 327600, 152064, 0x7244e477 +0, 331200, 152064, 0x0dfc72eb +0, 334800, 152064, 0x0322b21f +0, 338400, 152064, 0x18b08205 +0, 342000, 152064, 0x6606153e +0, 345600, 152064, 0x85186272 +0, 349200, 152064, 0x3369f064 +0, 352800, 152064, 0xbe0d5a44 +0, 356400, 152064, 0x320258bb +0, 360000, 152064, 0x4d6fb091 +0, 363600, 152064, 0xc9bbf5e7 +0, 367200, 152064, 0x0aa1b69b +0, 370800, 152064, 0x85b9ac11 +0, 374400, 152064, 0xb25ff818 +0, 378000, 152064, 0xa155dc25 +0, 381600, 152064, 0xa8e03bfd +0, 385200, 152064, 0x0a862956 +0, 388800, 152064, 0x11b49264 +0, 392400, 152064, 0xa94e664e +0, 396000, 152064, 0x330e0fa2 +0, 399600, 152064, 0xaf3d9518 +0, 403200, 152064, 0x0836f2e8 +0, 406800, 152064, 0xbf6dc578 +0, 410400, 152064, 0x7b524d20 +0, 414000, 152064, 0x9ef7677f +0, 417600, 152064, 0xeacf3f34 +0, 421200, 152064, 0xfb4e3dbe +0, 424800, 152064, 0xb46e25cb +0, 428400, 152064, 0x363c1603 +0, 432000, 152064, 0x263fc542 +0, 435600, 152064, 0xf106e548 +0, 439200, 152064, 0xde43c56a +0, 442800, 152064, 0xc2c4770a +0, 446400, 152064, 0x122fce19 +0, 450000, 152064, 0x3ba01434 +0, 453600, 152064, 0x0e8ce5ee +0, 457200, 152064, 0x6ceb82e1 +0, 460800, 152064, 0xa23ee21c +0, 464400, 152064, 0xc6d960f9 +0, 468000, 152064, 0x0de15258 +0, 471600, 152064, 0x187b0333 +0, 475200, 152064, 0x92e6582f +0, 478800, 152064, 0xb9586ce0 +0, 482400, 152064, 0xefd803b5 +0, 486000, 152064, 0x24eafb29 +0, 489600, 152064, 0x20c73b14 +0, 493200, 152064, 0xbd7ceaaa +0, 496800, 152064, 0x775216c8 +0, 500400, 152064, 0xa08971c7 +0, 504000, 152064, 0xef0ee865 +0, 507600, 152064, 0x9ac61c2f +0, 511200, 152064, 0x52ae8ea9 +0, 514800, 152064, 0x06571c14 +0, 518400, 152064, 0x6e78ad33 +0, 522000, 152064, 0xad01c627 +0, 525600, 152064, 0xbfe074d3 +0, 529200, 152064, 0x9357a183 +0, 532800, 152064, 0x8de7767f +0, 536400, 152064, 0xa5e6e76e +0, 540000, 152064, 0xa6f646fe +0, 543600, 152064, 0x132e99f8 +0, 547200, 152064, 0xb79f27de +0, 550800, 152064, 0x36d3cdcf +0, 554400, 152064, 0xdc938336 +0, 558000, 152064, 0xacaa3a7f +0, 561600, 152064, 0xc61a37fd +0, 565200, 152064, 0x4fe1ddf0 +0, 568800, 152064, 0xc0f7d660 +0, 572400, 152064, 0xd72458ea +0, 576000, 152064, 0x6978d123 +0, 579600, 152064, 0x64e60ccf +0, 583200, 152064, 0xaa07004c +0, 586800, 152064, 0x07cd1064 +0, 590400, 152064, 0xa82320e5 +0, 594000, 152064, 0xaedd8d30 +0, 597600, 152064, 0x79b082ea +0, 601200, 152064, 0x9ed800ab +0, 604800, 152064, 0xde592bb4 +0, 608400, 152064, 0xd966df88 +0, 612000, 152064, 0xf921988a +0, 615600, 152064, 0x557ad9ae +0, 619200, 152064, 0xc3f31a9a +0, 622800, 152064, 0x65248561 +0, 626400, 152064, 0x63df4aa6 +0, 630000, 152064, 0x618da0a9 +0, 633600, 152064, 0xe6f1c435 +0, 637200, 152064, 0x9f90c38f +0, 640800, 152064, 0xd2853e14 +0, 644400, 152064, 0x6e0268a9 +0, 648000, 152064, 0x393712d1 +0, 651600, 152064, 0x470da25f +0, 655200, 152064, 0xaf55cb3d +0, 658800, 152064, 0x6935b8b9 +0, 662400, 152064, 0x5409a15f +0, 666000, 152064, 0x09073fee +0, 669600, 152064, 0xfb274e82 +0, 673200, 152064, 0x1a770581 +0, 676800, 152064, 0x17277d0d +0, 680400, 152064, 0xd4dcd982 +0, 684000, 152064, 0x6b04eaf3 +0, 687600, 152064, 0x8a3d822e +0, 691200, 152064, 0x1b971ec9 +0, 694800, 152064, 0x14e0c0f6 +0, 698400, 152064, 0x00667450 +0, 702000, 152064, 0xd2385902 +0, 705600, 152064, 0x905da6ab +0, 709200, 152064, 0xa3ffb18b +0, 712800, 152064, 0x10d48b19 +0, 716400, 152064, 0xb2c7a3bd +0, 720000, 152064, 0x45593e96 +0, 723600, 152064, 0x47a0b60c +0, 727200, 152064, 0x68c6d1b9 +0, 730800, 152064, 0xbc881fcc +0, 734400, 152064, 0x422cc6f2 +0, 738000, 152064, 0x9b686410 +0, 741600, 152064, 0x35dc5e86 +0, 745200, 152064, 0x247bedaa +0, 748800, 152064, 0x22b76fd1 +0, 752400, 152064, 0x67cc7a75 +0, 756000, 152064, 0xa197521e +0, 759600, 152064, 0x428c8662 +0, 763200, 152064, 0x33dc2c73 +0, 766800, 152064, 0x5b538903 +0, 770400, 152064, 0x3c4176b6 +0, 774000, 152064, 0x774364ba +0, 777600, 152064, 0xf237d03e +0, 781200, 152064, 0xac8746fb +0, 784800, 152064, 0x6b306a84 +0, 788400, 152064, 0xa2ace513 +0, 792000, 152064, 0x709c9be7 +0, 795600, 152064, 0x2403f373 +0, 799200, 152064, 0x147bf717 +0, 802800, 152064, 0xe58964c8 +0, 806400, 152064, 0xa0da36fc +0, 810000, 152064, 0x1ac1355c +0, 813600, 152064, 0x8a31c9f2 +0, 817200, 152064, 0x42ba205c +0, 820800, 152064, 0xa11b3575 +0, 824400, 152064, 0xcb35207c +0, 828000, 152064, 0x528f6189 +0, 831600, 152064, 0x34f05bd7 +0, 835200, 152064, 0x72317356 +0, 838800, 152064, 0xaabd5028 +0, 842400, 152064, 0x13dbeb7b +0, 846000, 152064, 0x62f1e8a8 +0, 849600, 152064, 0x1723bfcd +0, 853200, 152064, 0x5c083c00 +0, 856800, 152064, 0x52137894 +0, 860400, 152064, 0xef1e082c +0, 864000, 152064, 0x664b3d53 +0, 867600, 152064, 0x2eb9b296 +0, 871200, 152064, 0xd0ca511e +0, 874800, 152064, 0x012d4724 +0, 878400, 152064, 0xa847f5af +0, 882000, 152064, 0x483a2fde +0, 885600, 152064, 0xd1ab0257 +0, 889200, 152064, 0x414692c7 +0, 892800, 152064, 0x0b79df88 +0, 896400, 152064, 0xdaa2c4a3 +0, 900000, 152064, 0xd1b44500 +0, 903600, 152064, 0xfd3d2cf3 +0, 907200, 152064, 0xfdc0f748 +0, 910800, 152064, 0xce762a2a +0, 914400, 152064, 0x08b63572 +0, 918000, 152064, 0x5a46a38d +0, 921600, 152064, 0x03cee9c0 +0, 925200, 152064, 0x9ee45473 +0, 928800, 152064, 0x5a432386 +0, 932400, 152064, 0x54c83d87 +0, 936000, 152064, 0xc9caa1de +0, 939600, 152064, 0xa28367f1 +0, 943200, 152064, 0x2607cdf1 +0, 946800, 152064, 0x06baa8de +0, 950400, 152064, 0xf5346e32 +0, 954000, 152064, 0x6d3e732b +0, 957600, 152064, 0x798c584b +0, 961200, 152064, 0x4076c948 +0, 964800, 152064, 0x868cf63a +0, 968400, 152064, 0x23107ac5 +0, 972000, 152064, 0x306f3fe2 +0, 975600, 152064, 0xbd1d71d6 +0, 979200, 152064, 0x1429545f +0, 982800, 152064, 0xaded29aa +0, 986400, 152064, 0x9b455a94 +0, 990000, 152064, 0xb3774ce7 +0, 993600, 152064, 0x92580986 +0, 997200, 152064, 0x0eae2f95 +0, 1000800, 152064, 0x599208b2 +0, 1004400, 152064, 0x4804c04c +0, 1008000, 152064, 0x5f730e8f +0, 1011600, 152064, 0x3e501d1e +0, 1015200, 152064, 0x32100740 +0, 1018800, 152064, 0x62226ff8 +0, 1022400, 152064, 0x7683b622 +0, 1026000, 152064, 0xc3e0aec1 +0, 1029600, 152064, 0xfac12608 +0, 1033200, 152064, 0xb21a5781 +0, 1036800, 152064, 0x8f1e4964 +0, 1040400, 152064, 0x0f62dd6e +0, 1044000, 152064, 0xac062ac4 +0, 1047600, 152064, 0x1b320f7a +0, 1051200, 152064, 0x346e7211 +0, 1054800, 152064, 0xe47592f3 +0, 1058400, 152064, 0xa3a7919c +0, 1062000, 152064, 0xa3580fa6 +0, 1065600, 152064, 0xc73430c1 +0, 1069200, 152064, 0x994a2c18 +0, 1072800, 152064, 0x0b5d8d45 +0, 1076400, 152064, 0x9eed5109 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcvmolq_brcm_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcvmolq_brcm_b new file mode 100644 index 00000000..9db3fe59 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcvmolq_brcm_b @@ -0,0 +1,100 @@ +0, 0, 152064, 0xa18cfb97 +0, 3600, 152064, 0x509b54d2 +0, 7200, 152064, 0x1ba0fb8e +0, 10800, 152064, 0x43e7721f +0, 14400, 152064, 0xed196624 +0, 18000, 152064, 0x4277f1e8 +0, 21600, 152064, 0x88015cd6 +0, 25200, 152064, 0x0f230af3 +0, 28800, 152064, 0x91bbd664 +0, 32400, 152064, 0x117c65dd +0, 36000, 152064, 0x8eebe5e8 +0, 39600, 152064, 0xd205cc10 +0, 43200, 152064, 0x4084a356 +0, 46800, 152064, 0x37385081 +0, 50400, 152064, 0xb7d34d8a +0, 54000, 152064, 0x96648874 +0, 57600, 152064, 0x0623e65b +0, 61200, 152064, 0x7d5b0173 +0, 64800, 152064, 0x0b6428e4 +0, 68400, 152064, 0xf3ca22a8 +0, 72000, 152064, 0x092e322c +0, 75600, 152064, 0xe82c2971 +0, 79200, 152064, 0x29bf6111 +0, 82800, 152064, 0x84f1ea0d +0, 86400, 152064, 0x45f822eb +0, 90000, 152064, 0x9672b2a7 +0, 93600, 152064, 0xdb98e020 +0, 97200, 152064, 0x729879eb +0, 100800, 152064, 0x3f629eae +0, 104400, 152064, 0x02e0ddb7 +0, 108000, 152064, 0xbb1a0bb1 +0, 111600, 152064, 0x9b85b55b +0, 115200, 152064, 0x2bae448b +0, 118800, 152064, 0xa8f28bfa +0, 122400, 152064, 0x687479da +0, 126000, 152064, 0xe1ec3111 +0, 129600, 152064, 0x8afa37f1 +0, 133200, 152064, 0x4af89faf +0, 136800, 152064, 0x1d9da53a +0, 140400, 152064, 0xdc599bcd +0, 144000, 152064, 0x01fb2e11 +0, 147600, 152064, 0x2a33498e +0, 151200, 152064, 0x87874877 +0, 154800, 152064, 0xdcd095c6 +0, 158400, 152064, 0x4f14e6fb +0, 162000, 152064, 0x65fd165e +0, 165600, 152064, 0x4c267122 +0, 169200, 152064, 0x18adf3aa +0, 172800, 152064, 0x74044daa +0, 176400, 152064, 0xa03bca1e +0, 180000, 152064, 0x7c1463fe +0, 183600, 152064, 0x688a14e3 +0, 187200, 152064, 0x35c91c4e +0, 190800, 152064, 0xeaf51d07 +0, 194400, 152064, 0xee61b9b1 +0, 198000, 152064, 0xbab75db3 +0, 201600, 152064, 0x199af472 +0, 205200, 152064, 0x3bcf96db +0, 208800, 152064, 0x3fecdb09 +0, 212400, 152064, 0x07be2431 +0, 216000, 152064, 0x61432984 +0, 219600, 152064, 0xdb12a3b9 +0, 223200, 152064, 0xc2b8403e +0, 226800, 152064, 0x34c60bde +0, 230400, 152064, 0x08639859 +0, 234000, 152064, 0xfc0fc556 +0, 237600, 152064, 0x9cc27272 +0, 241200, 152064, 0x3ef7dbb0 +0, 244800, 152064, 0xbb74d9a3 +0, 248400, 152064, 0x4007fc6e +0, 252000, 152064, 0x3d902f9b +0, 255600, 152064, 0xfbd0a76a +0, 259200, 152064, 0x4f1a4631 +0, 262800, 152064, 0x4f58ee25 +0, 266400, 152064, 0xd2c39501 +0, 270000, 152064, 0x23de68d5 +0, 273600, 152064, 0x4bf7d4ce +0, 277200, 152064, 0x2bdccc79 +0, 280800, 152064, 0xc26b8f81 +0, 284400, 152064, 0xe77fa90a +0, 288000, 152064, 0x48528308 +0, 291600, 152064, 0xab19b66b +0, 295200, 152064, 0x04db5b4a +0, 298800, 152064, 0x9fade901 +0, 302400, 152064, 0x1b7274ba +0, 306000, 152064, 0x387a0191 +0, 309600, 152064, 0x2b3a8128 +0, 313200, 152064, 0x2a0dab30 +0, 316800, 152064, 0x5f5fc2da +0, 320400, 152064, 0x5a5c8150 +0, 324000, 152064, 0xe0f5095e +0, 327600, 152064, 0xb87c8072 +0, 331200, 152064, 0x08155daf +0, 334800, 152064, 0xc308353f +0, 338400, 152064, 0x2a04e8e4 +0, 342000, 152064, 0xabe75987 +0, 345600, 152064, 0x8733fb98 +0, 349200, 152064, 0x810f53a0 +0, 352800, 152064, 0xb3e4ea37 +0, 356400, 152064, 0xb7a70980 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcvnl_brcm_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcvnl_brcm_a new file mode 100644 index 00000000..fe474650 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-frext-hpcvnl_brcm_a @@ -0,0 +1,300 @@ +0, 0, 152064, 0x2744afa1 +0, 3600, 152064, 0x17246583 +0, 7200, 152064, 0x501836ed +0, 10800, 152064, 0xe90d6961 +0, 14400, 152064, 0x27abe1ad +0, 18000, 152064, 0xcfc730e4 +0, 21600, 152064, 0xeaaa83ee +0, 25200, 152064, 0xb5d80ebd +0, 28800, 152064, 0x1e1b9d03 +0, 32400, 152064, 0x60e7cf33 +0, 36000, 152064, 0xc44616b1 +0, 39600, 152064, 0x0a2a5906 +0, 43200, 152064, 0xf101309c +0, 46800, 152064, 0x0b57f348 +0, 50400, 152064, 0x4f018c05 +0, 54000, 152064, 0x22359c60 +0, 57600, 152064, 0x020f1cc3 +0, 61200, 152064, 0x15be3892 +0, 64800, 152064, 0x834a2e23 +0, 68400, 152064, 0x1176586c +0, 72000, 152064, 0x9cf25641 +0, 75600, 152064, 0xc1c4051d +0, 79200, 152064, 0x790d8bfa +0, 82800, 152064, 0x4dcbe7d7 +0, 86400, 152064, 0xe81d3b7b +0, 90000, 152064, 0xe9e21309 +0, 93600, 152064, 0x22021dbc +0, 97200, 152064, 0x430c5ecb +0, 100800, 152064, 0xf524be8b +0, 104400, 152064, 0xa437dadc +0, 108000, 152064, 0xff00b440 +0, 111600, 152064, 0x4bd1bf15 +0, 115200, 152064, 0x1f46a3ea +0, 118800, 152064, 0x60b47c5e +0, 122400, 152064, 0x45117ac6 +0, 126000, 152064, 0x43894fca +0, 129600, 152064, 0x21572b55 +0, 133200, 152064, 0xe96def09 +0, 136800, 152064, 0x4d2ab41f +0, 140400, 152064, 0x072d6b06 +0, 144000, 152064, 0x81865687 +0, 147600, 152064, 0x8d9a0ea6 +0, 151200, 152064, 0x1484d3cd +0, 154800, 152064, 0xbdabae6b +0, 158400, 152064, 0x4211edbe +0, 162000, 152064, 0xd84dad6d +0, 165600, 152064, 0xe4e79344 +0, 169200, 152064, 0x9c1addd7 +0, 172800, 152064, 0xdcf94283 +0, 176400, 152064, 0x6bd005b2 +0, 180000, 152064, 0x9679bd10 +0, 183600, 152064, 0x052064ab +0, 187200, 152064, 0x915db3f3 +0, 190800, 152064, 0xec2fbd58 +0, 194400, 152064, 0x26728258 +0, 198000, 152064, 0x2b2b617f +0, 201600, 152064, 0x2339eb3d +0, 205200, 152064, 0xcf6e6773 +0, 208800, 152064, 0xb993efe4 +0, 212400, 152064, 0x4054253d +0, 216000, 152064, 0x4befe5b5 +0, 219600, 152064, 0x0678c0fa +0, 223200, 152064, 0xe3c54a03 +0, 226800, 152064, 0xffa3210c +0, 230400, 152064, 0xed04b823 +0, 234000, 152064, 0x00926457 +0, 237600, 152064, 0xd56aaaf0 +0, 241200, 152064, 0x6047ef6e +0, 244800, 152064, 0x44316d07 +0, 248400, 152064, 0xe8a879b7 +0, 252000, 152064, 0x1856cd86 +0, 255600, 152064, 0x6528349a +0, 259200, 152064, 0xdeff676e +0, 262800, 152064, 0xda412e47 +0, 266400, 152064, 0xa2c2a96f +0, 270000, 152064, 0xc703b8cd +0, 273600, 152064, 0x20b0650b +0, 277200, 152064, 0x8c14faa5 +0, 280800, 152064, 0xa442706c +0, 284400, 152064, 0x6e456137 +0, 288000, 152064, 0x6dde11c6 +0, 291600, 152064, 0xb017978a +0, 295200, 152064, 0xc0bad34b +0, 298800, 152064, 0x8bd439ee +0, 302400, 152064, 0xa92735e4 +0, 306000, 152064, 0x1623f501 +0, 309600, 152064, 0x5be980b2 +0, 313200, 152064, 0x4306b9bf +0, 316800, 152064, 0xb4f18976 +0, 320400, 152064, 0x4ffb9b46 +0, 324000, 152064, 0x23082275 +0, 327600, 152064, 0xc7f0e087 +0, 331200, 152064, 0x68b95327 +0, 334800, 152064, 0xd030a8e4 +0, 338400, 152064, 0xf8f9615c +0, 342000, 152064, 0x1b26fe3e +0, 345600, 152064, 0x3381608d +0, 349200, 152064, 0x9939d49d +0, 352800, 152064, 0x575f4f94 +0, 356400, 152064, 0x436c581c +0, 360000, 152064, 0x8f47aa58 +0, 363600, 152064, 0xd251d95a +0, 367200, 152064, 0x3c33b32c +0, 370800, 152064, 0xa1e19413 +0, 374400, 152064, 0x8d95cbad +0, 378000, 152064, 0x98cbd35e +0, 381600, 152064, 0xceb81a0f +0, 385200, 152064, 0x5490fab1 +0, 388800, 152064, 0x8e57a38c +0, 392400, 152064, 0xc379517a +0, 396000, 152064, 0xafc4f747 +0, 399600, 152064, 0xbc9c9be4 +0, 403200, 152064, 0xd602b2f5 +0, 406800, 152064, 0x8d85a450 +0, 410400, 152064, 0x48183c74 +0, 414000, 152064, 0xd1725590 +0, 417600, 152064, 0x5ef42ed7 +0, 421200, 152064, 0xad3a3883 +0, 424800, 152064, 0x7a3e0ddd +0, 428400, 152064, 0x59bdfd38 +0, 432000, 152064, 0x5ac3ba9f +0, 435600, 152064, 0x266cbd00 +0, 439200, 152064, 0x97d29e00 +0, 442800, 152064, 0x620774c2 +0, 446400, 152064, 0xaae8b96f +0, 450000, 152064, 0x5f6bdfb6 +0, 453600, 152064, 0xb239da53 +0, 457200, 152064, 0x654b5680 +0, 460800, 152064, 0xd796b723 +0, 464400, 152064, 0xd5c84a81 +0, 468000, 152064, 0x2a761652 +0, 471600, 152064, 0x1137e145 +0, 475200, 152064, 0x1a9a451b +0, 478800, 152064, 0x5ca751c4 +0, 482400, 152064, 0x074acec7 +0, 486000, 152064, 0x9ddfe77d +0, 489600, 152064, 0xfb211c29 +0, 493200, 152064, 0x681ad4dd +0, 496800, 152064, 0x702c12cc +0, 500400, 152064, 0x556c5101 +0, 504000, 152064, 0x39d4bb54 +0, 507600, 152064, 0xa3a118d6 +0, 511200, 152064, 0xb78b7db1 +0, 514800, 152064, 0x4e20eed5 +0, 518400, 152064, 0x6555a9df +0, 522000, 152064, 0xb607a9a4 +0, 525600, 152064, 0x3cf96a94 +0, 529200, 152064, 0xb2679007 +0, 532800, 152064, 0xf09d5b85 +0, 536400, 152064, 0x3961ba07 +0, 540000, 152064, 0x0c28363a +0, 543600, 152064, 0x0a017c2d +0, 547200, 152064, 0x3a661de3 +0, 550800, 152064, 0xf8d1bdee +0, 554400, 152064, 0x6f47791b +0, 558000, 152064, 0xe05b22c6 +0, 561600, 152064, 0x7cc93bb0 +0, 565200, 152064, 0xeb90c3d8 +0, 568800, 152064, 0x1a1eac98 +0, 572400, 152064, 0x92985671 +0, 576000, 152064, 0x2fe3ce53 +0, 579600, 152064, 0x61def691 +0, 583200, 152064, 0x90820730 +0, 586800, 152064, 0x17630372 +0, 590400, 152064, 0xaf6cea12 +0, 594000, 152064, 0xfe3b7ecc +0, 597600, 152064, 0x904a5b2e +0, 601200, 152064, 0x0d88d5f2 +0, 604800, 152064, 0x498d22b1 +0, 608400, 152064, 0x56baba83 +0, 612000, 152064, 0xda4d6dfa +0, 615600, 152064, 0xaa38cbdd +0, 619200, 152064, 0x4077f15d +0, 622800, 152064, 0x7e006ec2 +0, 626400, 152064, 0x59964a89 +0, 630000, 152064, 0x04c078e3 +0, 633600, 152064, 0x7a5faf97 +0, 637200, 152064, 0xc517b3e9 +0, 640800, 152064, 0xfcc81af5 +0, 644400, 152064, 0xdcb44f62 +0, 648000, 152064, 0x2a080b72 +0, 651600, 152064, 0x91f88c67 +0, 655200, 152064, 0xd39caf81 +0, 658800, 152064, 0x0764ae31 +0, 662400, 152064, 0x0ddb82ed +0, 666000, 152064, 0xed6d17e4 +0, 669600, 152064, 0xb4f74712 +0, 673200, 152064, 0x23a20787 +0, 676800, 152064, 0x853e7b33 +0, 680400, 152064, 0xc6bac173 +0, 684000, 152064, 0xb590ec15 +0, 687600, 152064, 0xfdd2943c +0, 691200, 152064, 0xba5d1160 +0, 694800, 152064, 0xe732c5a7 +0, 698400, 152064, 0x279f6ce9 +0, 702000, 152064, 0xb3835829 +0, 705600, 152064, 0x0901b2a1 +0, 709200, 152064, 0x3df2b8f8 +0, 712800, 152064, 0x374496a4 +0, 716400, 152064, 0x1bc6a4ae +0, 720000, 152064, 0xdb4b372e +0, 723600, 152064, 0x8c11c214 +0, 727200, 152064, 0xd2d5c093 +0, 730800, 152064, 0x8dda094e +0, 734400, 152064, 0x9b2cc401 +0, 738000, 152064, 0x1a3b49d5 +0, 741600, 152064, 0xaf5342ff +0, 745200, 152064, 0x74c0de83 +0, 748800, 152064, 0xcf486137 +0, 752400, 152064, 0xcf005b3b +0, 756000, 152064, 0x86a64c55 +0, 759600, 152064, 0xdd3f7ae9 +0, 763200, 152064, 0xb0d01e53 +0, 766800, 152064, 0x83219065 +0, 770400, 152064, 0x17a35d27 +0, 774000, 152064, 0xf92645b5 +0, 777600, 152064, 0x8322bdbf +0, 781200, 152064, 0xd589f6a2 +0, 784800, 152064, 0x80a62d9e +0, 788400, 152064, 0x05b3e0d1 +0, 792000, 152064, 0xd657aa0b +0, 795600, 152064, 0xec5ac2dd +0, 799200, 152064, 0xbf0ff969 +0, 802800, 152064, 0xc34a5140 +0, 806400, 152064, 0x814705c4 +0, 810000, 152064, 0xe9592008 +0, 813600, 152064, 0xf12c933c +0, 817200, 152064, 0x2daee178 +0, 820800, 152064, 0xa2573028 +0, 824400, 152064, 0x6109f58d +0, 828000, 152064, 0x64ab8ce4 +0, 831600, 152064, 0x13a88b6e +0, 835200, 152064, 0x8f0181a9 +0, 838800, 152064, 0xd5295fd4 +0, 842400, 152064, 0xfdbeeb0d +0, 846000, 152064, 0x05ecd231 +0, 849600, 152064, 0x48d164cd +0, 853200, 152064, 0xc279cf63 +0, 856800, 152064, 0x1d5e6a03 +0, 860400, 152064, 0xd9dc1807 +0, 864000, 152064, 0xbcc83676 +0, 867600, 152064, 0x65a9811e +0, 871200, 152064, 0x3ccfe5a8 +0, 874800, 152064, 0x2f2ff051 +0, 878400, 152064, 0x9193e093 +0, 882000, 152064, 0x9a30fdc6 +0, 885600, 152064, 0x90b7ea10 +0, 889200, 152064, 0x3291910c +0, 892800, 152064, 0x2335d186 +0, 896400, 152064, 0x2890cf1d +0, 900000, 152064, 0x8c8b6245 +0, 903600, 152064, 0x24b84eda +0, 907200, 152064, 0x04a12446 +0, 910800, 152064, 0xd9d91d51 +0, 914400, 152064, 0xbf450adf +0, 918000, 152064, 0xa19a9a41 +0, 921600, 152064, 0x2211ab01 +0, 925200, 152064, 0x8fe85430 +0, 928800, 152064, 0x5a152861 +0, 932400, 152064, 0x7fe76995 +0, 936000, 152064, 0x508b99cd +0, 939600, 152064, 0x92e79437 +0, 943200, 152064, 0x8572eac9 +0, 946800, 152064, 0x42e3d513 +0, 950400, 152064, 0x6bee9e38 +0, 954000, 152064, 0x2858ad4b +0, 957600, 152064, 0x96d87d00 +0, 961200, 152064, 0x749f1032 +0, 964800, 152064, 0x668fca6c +0, 968400, 152064, 0x11d278d9 +0, 972000, 152064, 0x10fd46ea +0, 975600, 152064, 0xc8b193c8 +0, 979200, 152064, 0x035e7d02 +0, 982800, 152064, 0x067f583c +0, 986400, 152064, 0xd9648a1e +0, 990000, 152064, 0x92487b7e +0, 993600, 152064, 0xc7b35421 +0, 997200, 152064, 0x2ed57c1c +0, 1000800, 152064, 0xefe24c5f +0, 1004400, 152064, 0x8df0118b +0, 1008000, 152064, 0x18f0278d +0, 1011600, 152064, 0x63ac45ad +0, 1015200, 152064, 0xd79849f0 +0, 1018800, 152064, 0x1f1d4dab +0, 1022400, 152064, 0x736fb5b8 +0, 1026000, 152064, 0xc24eb80c +0, 1029600, 152064, 0x64ca3b11 +0, 1033200, 152064, 0x35d8674c +0, 1036800, 152064, 0x3c5a7b51 +0, 1040400, 152064, 0x97550b81 +0, 1044000, 152064, 0x731454b5 +0, 1047600, 152064, 0x01de43bc +0, 1051200, 152064, 0xbda7afae +0, 1054800, 152064, 0xeb34d714 +0, 1058400, 152064, 0x1260cc98 +0, 1062000, 152064, 0x7e592c36 +0, 1065600, 152064, 0x40b3676e +0, 1069200, 152064, 0x8c9d6b94 +0, 1072800, 152064, 0xc7988665 +0, 1076400, 152064, 0xf2994d52 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-hcbp2_hhi_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-hcbp2_hhi_a new file mode 100644 index 00000000..87a9db1a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-hcbp2_hhi_a @@ -0,0 +1,250 @@ +0, 0, 152064, 0xf9deb95a +0, 3600, 152064, 0xdce9c541 +0, 7200, 152064, 0xc45a8a77 +0, 10800, 152064, 0x5132a470 +0, 14400, 152064, 0x65542c98 +0, 18000, 152064, 0x2df95883 +0, 21600, 152064, 0x9f4f1280 +0, 25200, 152064, 0x11c9f32c +0, 28800, 152064, 0x66535f0c +0, 32400, 152064, 0x5b13770c +0, 36000, 152064, 0xadcd3278 +0, 39600, 152064, 0x06e00e91 +0, 43200, 152064, 0x1fa1886f +0, 46800, 152064, 0xd524b6a3 +0, 50400, 152064, 0x45f82b73 +0, 54000, 152064, 0x0fd301aa +0, 57600, 152064, 0x2983acdd +0, 61200, 152064, 0xe74004c6 +0, 64800, 152064, 0xe279328a +0, 68400, 152064, 0x85be8f85 +0, 72000, 152064, 0xec503b6b +0, 75600, 152064, 0x3d4495db +0, 79200, 152064, 0x3a9774d2 +0, 82800, 152064, 0x80a07a42 +0, 86400, 152064, 0x484427ce +0, 90000, 152064, 0x9e6b773f +0, 93600, 152064, 0xd3be5f07 +0, 97200, 152064, 0x69a76c5e +0, 100800, 152064, 0xd448fde2 +0, 104400, 152064, 0x04a34635 +0, 108000, 152064, 0xd4e3e0e1 +0, 111600, 152064, 0x2564cf13 +0, 115200, 152064, 0x98bc5167 +0, 118800, 152064, 0xcf06991f +0, 122400, 152064, 0x3edf621f +0, 126000, 152064, 0x47039967 +0, 129600, 152064, 0x299636b5 +0, 133200, 152064, 0x2bc0849d +0, 136800, 152064, 0xe94946a6 +0, 140400, 152064, 0x5a5768ac +0, 144000, 152064, 0xfe4ce9cd +0, 147600, 152064, 0xbeb34b2e +0, 151200, 152064, 0xa26020e3 +0, 154800, 152064, 0xb2514c55 +0, 158400, 152064, 0x723be4b1 +0, 162000, 152064, 0xeef4434e +0, 165600, 152064, 0x1237e1db +0, 169200, 152064, 0x4814c1fb +0, 172800, 152064, 0xe7544446 +0, 176400, 152064, 0xd93a53d9 +0, 180000, 152064, 0x90e029c6 +0, 183600, 152064, 0xfa493dfc +0, 187200, 152064, 0x081fa2d9 +0, 190800, 152064, 0x9782ef8c +0, 194400, 152064, 0x1daf911c +0, 198000, 152064, 0xc9058a57 +0, 201600, 152064, 0x68a90f04 +0, 205200, 152064, 0xc7115091 +0, 208800, 152064, 0xe9731898 +0, 212400, 152064, 0xd7bc206e +0, 216000, 152064, 0xf760baac +0, 219600, 152064, 0x6f9700e3 +0, 223200, 152064, 0xec54b42d +0, 226800, 152064, 0x0dc5bf77 +0, 230400, 152064, 0x196e33c3 +0, 234000, 152064, 0x090cae46 +0, 237600, 152064, 0x06897499 +0, 241200, 152064, 0xf54cd959 +0, 244800, 152064, 0x24167906 +0, 248400, 152064, 0xea06e67b +0, 252000, 152064, 0xa97ed69c +0, 255600, 152064, 0x03c4ce82 +0, 259200, 152064, 0xca864ddd +0, 262800, 152064, 0x1bc9956f +0, 266400, 152064, 0x7864908c +0, 270000, 152064, 0x52f3be55 +0, 273600, 152064, 0x78b469b5 +0, 277200, 152064, 0x8b3bb23e +0, 280800, 152064, 0x5bed7f47 +0, 284400, 152064, 0x401b7e9c +0, 288000, 152064, 0x4cbc3193 +0, 291600, 152064, 0xa00b7ed2 +0, 295200, 152064, 0xda548927 +0, 298800, 152064, 0x30a5cffb +0, 302400, 152064, 0x9536bdf0 +0, 306000, 152064, 0x927e3cf4 +0, 309600, 152064, 0x95533148 +0, 313200, 152064, 0x763c553a +0, 316800, 152064, 0x7010f280 +0, 320400, 152064, 0xa537667c +0, 324000, 152064, 0xe599927a +0, 327600, 152064, 0x72dde2ab +0, 331200, 152064, 0x02089d51 +0, 334800, 152064, 0x4ca8231a +0, 338400, 152064, 0x90b126aa +0, 342000, 152064, 0x65a9260f +0, 345600, 152064, 0xf37cf34a +0, 349200, 152064, 0xf21f63f6 +0, 352800, 152064, 0x95209e85 +0, 356400, 152064, 0x0df00a65 +0, 360000, 152064, 0x0ce71e2b +0, 363600, 152064, 0x6cbf8843 +0, 367200, 152064, 0x17f29296 +0, 370800, 152064, 0x88278aa9 +0, 374400, 152064, 0x84ad74d0 +0, 378000, 152064, 0xda48eea1 +0, 381600, 152064, 0xcaf33b25 +0, 385200, 152064, 0x9b288538 +0, 388800, 152064, 0xd1b7561f +0, 392400, 152064, 0x4bfcbdac +0, 396000, 152064, 0x1dd5b920 +0, 399600, 152064, 0xde50ceeb +0, 403200, 152064, 0xa552963b +0, 406800, 152064, 0xb2f5ef15 +0, 410400, 152064, 0x5abf061c +0, 414000, 152064, 0x9b4c45f6 +0, 417600, 152064, 0xe61d1b02 +0, 421200, 152064, 0xe5728c4e +0, 424800, 152064, 0xcb944655 +0, 428400, 152064, 0x648b951a +0, 432000, 152064, 0xc3671a38 +0, 435600, 152064, 0x7d3fbcf3 +0, 439200, 152064, 0x3c0ba1c5 +0, 442800, 152064, 0xf5ac0d3a +0, 446400, 152064, 0x87faf534 +0, 450000, 152064, 0xb3f05d11 +0, 453600, 152064, 0x825e3423 +0, 457200, 152064, 0xade45431 +0, 460800, 152064, 0x7715d496 +0, 464400, 152064, 0x983c45fa +0, 468000, 152064, 0xe8d621d8 +0, 471600, 152064, 0x71ec7553 +0, 475200, 152064, 0xb20d5556 +0, 478800, 152064, 0xfa6bd00b +0, 482400, 152064, 0x2a18acf1 +0, 486000, 152064, 0xa241c342 +0, 489600, 152064, 0xa3597426 +0, 493200, 152064, 0x6f72ff61 +0, 496800, 152064, 0xceffe8af +0, 500400, 152064, 0x76853b09 +0, 504000, 152064, 0x3f58cc0c +0, 507600, 152064, 0x16080a6d +0, 511200, 152064, 0x752ae0aa +0, 514800, 152064, 0x7dadf81b +0, 518400, 152064, 0x9828aa7c +0, 522000, 152064, 0x05a51e04 +0, 525600, 152064, 0xf9a92ae6 +0, 529200, 152064, 0xce0169f9 +0, 532800, 152064, 0x784d405b +0, 536400, 152064, 0x531b9869 +0, 540000, 152064, 0xdf6a6129 +0, 543600, 152064, 0x5cdf5aac +0, 547200, 152064, 0x28dd0050 +0, 550800, 152064, 0x76bd5ea7 +0, 554400, 152064, 0xcf3036bf +0, 558000, 152064, 0x20365c0d +0, 561600, 152064, 0x171ad303 +0, 565200, 152064, 0x1388416d +0, 568800, 152064, 0x9b92f171 +0, 572400, 152064, 0xe2bc377a +0, 576000, 152064, 0x90639e6c +0, 579600, 152064, 0x1b50e759 +0, 583200, 152064, 0x43a9b680 +0, 586800, 152064, 0xb1780015 +0, 590400, 152064, 0x9a6783a6 +0, 594000, 152064, 0x1471e2e4 +0, 597600, 152064, 0xb1899be2 +0, 601200, 152064, 0x2facd37c +0, 604800, 152064, 0x197361fc +0, 608400, 152064, 0x823ffce1 +0, 612000, 152064, 0x9ce3cb14 +0, 615600, 152064, 0x16620232 +0, 619200, 152064, 0x4fedb29e +0, 622800, 152064, 0xb45cd8b4 +0, 626400, 152064, 0x84387e9d +0, 630000, 152064, 0xd5017ca0 +0, 633600, 152064, 0x106002a5 +0, 637200, 152064, 0x20c44a82 +0, 640800, 152064, 0x0694fbb2 +0, 644400, 152064, 0x849cfdf3 +0, 648000, 152064, 0xef827c85 +0, 651600, 152064, 0xc04ecde3 +0, 655200, 152064, 0x2f81bee2 +0, 658800, 152064, 0x86dbe8cc +0, 662400, 152064, 0x9ee67bcd +0, 666000, 152064, 0xa2618f39 +0, 669600, 152064, 0x35a40f36 +0, 673200, 152064, 0x9f6b0b54 +0, 676800, 152064, 0xcee2c0b5 +0, 680400, 152064, 0x3c3cb8f3 +0, 684000, 152064, 0xf3ab2e21 +0, 687600, 152064, 0xc51afcbc +0, 691200, 152064, 0x272bbb4d +0, 694800, 152064, 0x1448f2cc +0, 698400, 152064, 0xd286e217 +0, 702000, 152064, 0xd6abf89e +0, 705600, 152064, 0xf908bb8a +0, 709200, 152064, 0x8a17ddd6 +0, 712800, 152064, 0xc30d9039 +0, 716400, 152064, 0xb8c6a557 +0, 720000, 152064, 0xf1675620 +0, 723600, 152064, 0xbb41b898 +0, 727200, 152064, 0x662298b2 +0, 730800, 152064, 0x0f8271aa +0, 734400, 152064, 0x34d90197 +0, 738000, 152064, 0x15254eb2 +0, 741600, 152064, 0x4d942235 +0, 745200, 152064, 0xa2cefa6a +0, 748800, 152064, 0x909a7050 +0, 752400, 152064, 0x219abae7 +0, 756000, 152064, 0x0166bc37 +0, 759600, 152064, 0x8b960965 +0, 763200, 152064, 0x71f6af2a +0, 766800, 152064, 0x8d69f377 +0, 770400, 152064, 0x27b1a17d +0, 774000, 152064, 0x6b09b049 +0, 777600, 152064, 0x733472e7 +0, 781200, 152064, 0x986efe32 +0, 784800, 152064, 0x99a37cc5 +0, 788400, 152064, 0x82433283 +0, 792000, 152064, 0x4698c0bd +0, 795600, 152064, 0x1f6ce7f9 +0, 799200, 152064, 0x6e398d44 +0, 802800, 152064, 0x14ae5d85 +0, 806400, 152064, 0xef2f1e28 +0, 810000, 152064, 0x9dfe46ae +0, 813600, 152064, 0x91997a8f +0, 817200, 152064, 0x6c828dda +0, 820800, 152064, 0x723f3f5c +0, 824400, 152064, 0xcb86883d +0, 828000, 152064, 0x1c25cbed +0, 831600, 152064, 0x3cad814a +0, 835200, 152064, 0xe0d8f5e7 +0, 838800, 152064, 0xaefb35cc +0, 842400, 152064, 0x5dfc2181 +0, 846000, 152064, 0x13f26603 +0, 849600, 152064, 0x97a3dd0d +0, 853200, 152064, 0xbecff890 +0, 856800, 152064, 0xd226badc +0, 860400, 152064, 0x7f4adbd1 +0, 864000, 152064, 0x5da1565a +0, 867600, 152064, 0x35cbac9c +0, 871200, 152064, 0xf1b26f8a +0, 874800, 152064, 0xc8d08d07 +0, 878400, 152064, 0xa9f643c2 +0, 882000, 152064, 0xc420b0ba +0, 885600, 152064, 0x8871a4f5 +0, 889200, 152064, 0x4e7647b4 +0, 892800, 152064, 0xb4dad812 +0, 896400, 152064, 0x6a3d00d5 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-hcmp1_hhi_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-hcmp1_hhi_a new file mode 100644 index 00000000..88b758d8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-hcmp1_hhi_a @@ -0,0 +1,250 @@ +0, 0, 152064, 0xda244f3f +0, 3600, 152064, 0x35a1cb02 +0, 7200, 152064, 0xa729d9ca +0, 10800, 152064, 0x69d90602 +0, 14400, 152064, 0x4ccdae72 +0, 18000, 152064, 0x06f9d8b9 +0, 21600, 152064, 0x0a14a736 +0, 25200, 152064, 0xc344b167 +0, 28800, 152064, 0xf3303e92 +0, 32400, 152064, 0xbe28813f +0, 36000, 152064, 0x971f4980 +0, 39600, 152064, 0x69124d31 +0, 43200, 152064, 0x6d93e7f2 +0, 46800, 152064, 0x5c1315e4 +0, 50400, 152064, 0xb011cfe4 +0, 54000, 152064, 0x65a0d147 +0, 57600, 152064, 0x463d8c39 +0, 61200, 152064, 0x15f2a757 +0, 64800, 152064, 0xc2418f1f +0, 68400, 152064, 0x7a48b94c +0, 72000, 152064, 0x1c079ec9 +0, 75600, 152064, 0x348ced32 +0, 79200, 152064, 0x6014d525 +0, 82800, 152064, 0x146ed41f +0, 86400, 152064, 0x543177e6 +0, 90000, 152064, 0x79a4b44e +0, 93600, 152064, 0x4401a7ae +0, 97200, 152064, 0xc0aec3c1 +0, 100800, 152064, 0x92348852 +0, 104400, 152064, 0x90eece70 +0, 108000, 152064, 0x19efd00f +0, 111600, 152064, 0x608912ac +0, 115200, 152064, 0xa707bdb1 +0, 118800, 152064, 0x926e1ffe +0, 122400, 152064, 0x56863ca8 +0, 126000, 152064, 0xe18e81b4 +0, 129600, 152064, 0xf17466f2 +0, 133200, 152064, 0x2281feef +0, 136800, 152064, 0x33603b66 +0, 140400, 152064, 0xe30fad28 +0, 144000, 152064, 0x66efb21e +0, 147600, 152064, 0x405f32d6 +0, 151200, 152064, 0xe90f262b +0, 154800, 152064, 0xf85144b0 +0, 158400, 152064, 0xcff4feab +0, 162000, 152064, 0x02b63e49 +0, 165600, 152064, 0x91d9ff77 +0, 169200, 152064, 0x2c6c0d2a +0, 172800, 152064, 0xacad9e66 +0, 176400, 152064, 0x83951353 +0, 180000, 152064, 0x549c16e4 +0, 183600, 152064, 0xcad9610c +0, 187200, 152064, 0x264e4b57 +0, 190800, 152064, 0x9758afe8 +0, 194400, 152064, 0x0273a81d +0, 198000, 152064, 0x31c6f1a0 +0, 201600, 152064, 0x80d1c9cf +0, 205200, 152064, 0x41b861f7 +0, 208800, 152064, 0xad416fe7 +0, 212400, 152064, 0xdde59bf0 +0, 216000, 152064, 0x886c491c +0, 219600, 152064, 0x4bf4a21f +0, 223200, 152064, 0x2581a06e +0, 226800, 152064, 0x8188cf9b +0, 230400, 152064, 0xbfaf82ce +0, 234000, 152064, 0xed9ef8b1 +0, 237600, 152064, 0xf5f4e0c0 +0, 241200, 152064, 0xa24421ac +0, 244800, 152064, 0xf0cdde38 +0, 248400, 152064, 0x7f211f2c +0, 252000, 152064, 0x241ff38b +0, 255600, 152064, 0x19bc25a6 +0, 259200, 152064, 0xd9d5ede9 +0, 262800, 152064, 0x88f98579 +0, 266400, 152064, 0x630da1aa +0, 270000, 152064, 0x19abf44f +0, 273600, 152064, 0x3a95d341 +0, 277200, 152064, 0xdeb9333e +0, 280800, 152064, 0x0c994783 +0, 284400, 152064, 0xb58b7d26 +0, 288000, 152064, 0x6e392b24 +0, 291600, 152064, 0x1f7e2d63 +0, 295200, 152064, 0x732342d3 +0, 298800, 152064, 0xbda4a761 +0, 302400, 152064, 0xdc387777 +0, 306000, 152064, 0xd5d00469 +0, 309600, 152064, 0xc840cf6d +0, 313200, 152064, 0x3dfef3d9 +0, 316800, 152064, 0xf731594f +0, 320400, 152064, 0x126fef41 +0, 324000, 152064, 0x5705b1e3 +0, 327600, 152064, 0xa8ecbe94 +0, 331200, 152064, 0xcbcd0e48 +0, 334800, 152064, 0x3da860da +0, 338400, 152064, 0x97882d5f +0, 342000, 152064, 0x19803d16 +0, 345600, 152064, 0xa639b969 +0, 349200, 152064, 0xc0a00bc3 +0, 352800, 152064, 0xb12f0617 +0, 356400, 152064, 0x0e53481c +0, 360000, 152064, 0x1fa0e47d +0, 363600, 152064, 0x818119fa +0, 367200, 152064, 0xc28ffc3e +0, 370800, 152064, 0x8abdfb3c +0, 374400, 152064, 0x670cb951 +0, 378000, 152064, 0x172808bd +0, 381600, 152064, 0x6be1ea7f +0, 385200, 152064, 0x05dbfadc +0, 388800, 152064, 0xcfcfbcec +0, 392400, 152064, 0x9306e1d2 +0, 396000, 152064, 0xcf3ccc54 +0, 399600, 152064, 0xf36ad41a +0, 403200, 152064, 0x751b835b +0, 406800, 152064, 0x7ebed47b +0, 410400, 152064, 0x9659d022 +0, 414000, 152064, 0xef7701ae +0, 417600, 152064, 0x5cdee3b0 +0, 421200, 152064, 0xf6c3ed42 +0, 424800, 152064, 0x412ee2fb +0, 428400, 152064, 0x309cd2bd +0, 432000, 152064, 0x50f09af5 +0, 435600, 152064, 0x4a05087a +0, 439200, 152064, 0xaedc2125 +0, 442800, 152064, 0x54e2692a +0, 446400, 152064, 0x0403590c +0, 450000, 152064, 0x8a4c9833 +0, 453600, 152064, 0x36b6893e +0, 457200, 152064, 0x21fd9204 +0, 460800, 152064, 0xa1cd3bc7 +0, 464400, 152064, 0x3cfa3d18 +0, 468000, 152064, 0xb5f7fefd +0, 471600, 152064, 0x133cf831 +0, 475200, 152064, 0xcaabdd54 +0, 478800, 152064, 0xcab45366 +0, 482400, 152064, 0x8b6f4c90 +0, 486000, 152064, 0x4de74903 +0, 489600, 152064, 0x2dde0c4f +0, 493200, 152064, 0x09364c1d +0, 496800, 152064, 0x610318b9 +0, 500400, 152064, 0xd85109d5 +0, 504000, 152064, 0x27a1eac7 +0, 507600, 152064, 0xafd50e70 +0, 511200, 152064, 0x96ac088c +0, 514800, 152064, 0x1332091c +0, 518400, 152064, 0x9d38ce90 +0, 522000, 152064, 0xeff10d8e +0, 525600, 152064, 0x6c320de3 +0, 529200, 152064, 0xeb683437 +0, 532800, 152064, 0xe8a73715 +0, 536400, 152064, 0x53a27669 +0, 540000, 152064, 0xd5665cdc +0, 543600, 152064, 0x76bc4f86 +0, 547200, 152064, 0xb5282913 +0, 550800, 152064, 0xf788398b +0, 554400, 152064, 0xa2a74268 +0, 558000, 152064, 0x1e8c57c4 +0, 561600, 152064, 0x12c0542f +0, 565200, 152064, 0x8dbe9945 +0, 568800, 152064, 0x0f7583cd +0, 572400, 152064, 0x814e9e0b +0, 576000, 152064, 0x39575c04 +0, 579600, 152064, 0x75a07f38 +0, 583200, 152064, 0x8a6247c1 +0, 586800, 152064, 0x0f8d606e +0, 590400, 152064, 0x7dcc4169 +0, 594000, 152064, 0x039d6df2 +0, 597600, 152064, 0x16b779c4 +0, 601200, 152064, 0x8b3a9767 +0, 604800, 152064, 0x281e6d83 +0, 608400, 152064, 0x7d22a528 +0, 612000, 152064, 0x93778828 +0, 615600, 152064, 0xd54c95fc +0, 619200, 152064, 0xf4e76d9a +0, 622800, 152064, 0xaa7ba3fd +0, 626400, 152064, 0x94d88d91 +0, 630000, 152064, 0xa46b9c34 +0, 633600, 152064, 0x9dcb4d0c +0, 637200, 152064, 0x347d0983 +0, 640800, 152064, 0x870ecd2b +0, 644400, 152064, 0x5dafe6d6 +0, 648000, 152064, 0x10d77857 +0, 651600, 152064, 0xddc1d127 +0, 655200, 152064, 0x2732a13c +0, 658800, 152064, 0x3d81bac9 +0, 662400, 152064, 0x619d3dd3 +0, 666000, 152064, 0x2db3e1ac +0, 669600, 152064, 0x63a7e7e5 +0, 673200, 152064, 0x902a4c92 +0, 676800, 152064, 0x9c38e0f6 +0, 680400, 152064, 0x8ceb3a46 +0, 684000, 152064, 0x73cbb6bd +0, 687600, 152064, 0x5f6fa7d6 +0, 691200, 152064, 0x8cdad086 +0, 694800, 152064, 0xe7cf083f +0, 698400, 152064, 0x18c0f6b9 +0, 702000, 152064, 0xfe582ddf +0, 705600, 152064, 0x5fca4740 +0, 709200, 152064, 0x072981ab +0, 712800, 152064, 0xcb874172 +0, 716400, 152064, 0xfa153e05 +0, 720000, 152064, 0x259ae495 +0, 723600, 152064, 0x1714beb4 +0, 727200, 152064, 0xa051721e +0, 730800, 152064, 0x52d17b85 +0, 734400, 152064, 0x9cbf5da3 +0, 738000, 152064, 0x28d69092 +0, 741600, 152064, 0xbdb942e7 +0, 745200, 152064, 0xeefe2253 +0, 748800, 152064, 0xbef2af4d +0, 752400, 152064, 0x622dee36 +0, 756000, 152064, 0x61decf4e +0, 759600, 152064, 0x8dfefdbe +0, 763200, 152064, 0x78d67e90 +0, 766800, 152064, 0x9cddaa58 +0, 770400, 152064, 0x8d487f4d +0, 774000, 152064, 0x67f58715 +0, 777600, 152064, 0xc9203f22 +0, 781200, 152064, 0x0fec8343 +0, 784800, 152064, 0xb57e7b6a +0, 788400, 152064, 0xa2ed7700 +0, 792000, 152064, 0x34722cad +0, 795600, 152064, 0x02c83b2a +0, 799200, 152064, 0x91b11583 +0, 802800, 152064, 0x7676166d +0, 806400, 152064, 0x76a9d5fc +0, 810000, 152064, 0x4fcd1750 +0, 813600, 152064, 0xaa6ff7bf +0, 817200, 152064, 0x5e2bfab6 +0, 820800, 152064, 0x3abec811 +0, 824400, 152064, 0x0711eb85 +0, 828000, 152064, 0xb10ebf41 +0, 831600, 152064, 0x32d8cb56 +0, 835200, 152064, 0x9b1ca411 +0, 838800, 152064, 0x771f0768 +0, 842400, 152064, 0x69e1258e +0, 846000, 152064, 0xe8b352e2 +0, 849600, 152064, 0x3ee638d8 +0, 853200, 152064, 0x0bc48414 +0, 856800, 152064, 0xc1df5925 +0, 860400, 152064, 0xb30f705e +0, 864000, 152064, 0x90654127 +0, 867600, 152064, 0x000e5f43 +0, 871200, 152064, 0x1f5e5e15 +0, 874800, 152064, 0x4aa48433 +0, 878400, 152064, 0xb74a56a3 +0, 882000, 152064, 0x94347a06 +0, 885600, 152064, 0xd14e58d4 +0, 889200, 152064, 0x60116d97 +0, 892800, 152064, 0xf2962979 +0, 896400, 152064, 0x7f176514 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ls_sva_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ls_sva_d new file mode 100644 index 00000000..d4586418 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-ls_sva_d @@ -0,0 +1,1700 @@ +0, 0, 38016, 0x85d20fc6 +0, 3600, 38016, 0xc0432c21 +0, 7200, 38016, 0x1450168f +0, 10800, 38016, 0xeddb1833 +0, 14400, 38016, 0x631216d4 +0, 18000, 38016, 0xfcd1138b +0, 21600, 38016, 0x181f17d5 +0, 25200, 38016, 0x3dc91855 +0, 28800, 38016, 0x92b71924 +0, 32400, 38016, 0xfcb6228d +0, 36000, 38016, 0x11d04b4a +0, 39600, 38016, 0x743a6a06 +0, 43200, 38016, 0xac511cc3 +0, 46800, 38016, 0x66bc1e2d +0, 50400, 38016, 0x6c761ef3 +0, 54000, 38016, 0xa08a1ef5 +0, 57600, 38016, 0x777270da +0, 61200, 38016, 0x9a738d9f +0, 64800, 38016, 0x31a8afa2 +0, 68400, 38016, 0x1148cc11 +0, 72000, 38016, 0xf5fa1f26 +0, 75600, 38016, 0xc0481fbc +0, 79200, 38016, 0x461b2228 +0, 82800, 38016, 0x27bb209d +0, 86400, 38016, 0xbe921f04 +0, 90000, 38016, 0xabdbd493 +0, 93600, 38016, 0x4f6ad36e +0, 97200, 38016, 0xe2f8d0ca +0, 100800, 38016, 0xd82aaea2 +0, 104400, 38016, 0xb208854b +0, 108000, 38016, 0xfe632920 +0, 111600, 38016, 0x1a8128ce +0, 115200, 38016, 0xd9ea2be9 +0, 118800, 38016, 0x258b2ab0 +0, 122400, 38016, 0xb5812bef +0, 126000, 38016, 0x00c92cdf +0, 129600, 38016, 0x4a6b9f6f +0, 133200, 38016, 0xb589b0a1 +0, 136800, 38016, 0xf2d0bbca +0, 140400, 38016, 0xe614cce3 +0, 144000, 38016, 0x6d81d01c +0, 147600, 38016, 0x7f32d175 +0, 151200, 38016, 0x6abc2f40 +0, 154800, 38016, 0x767d2f6a +0, 158400, 38016, 0xd64b30cf +0, 162000, 38016, 0xf83d3000 +0, 165600, 38016, 0x5f3230d5 +0, 169200, 38016, 0x80b330a0 +0, 172800, 38016, 0x42c4326e +0, 176400, 38016, 0x7cb8d069 +0, 180000, 38016, 0xb7bb9d2f +0, 183600, 38016, 0xf4f47c47 +0, 187200, 38016, 0xe3455aa0 +0, 190800, 38016, 0x3b074630 +0, 194400, 38016, 0x1fd44e63 +0, 198000, 38016, 0x5ecb6a07 +0, 201600, 38016, 0xe3a130c9 +0, 205200, 38016, 0x307f311a +0, 208800, 38016, 0x4e2d3202 +0, 212400, 38016, 0x06ac31c1 +0, 216000, 38016, 0x767931ab +0, 219600, 38016, 0xcb6433aa +0, 223200, 38016, 0xc88e3597 +0, 226800, 38016, 0xfe06371f +0, 230400, 38016, 0x9e3c8a14 +0, 234000, 38016, 0xba819e5b +0, 237600, 38016, 0x0017a693 +0, 241200, 38016, 0x25aca2dd +0, 244800, 38016, 0x3bf5980d +0, 248400, 38016, 0x2a0ba2ae +0, 252000, 38016, 0x99e19853 +0, 255600, 38016, 0x5e7a9699 +0, 259200, 38016, 0x11983c1a +0, 262800, 38016, 0x5ab53cbf +0, 266400, 38016, 0x49803f12 +0, 270000, 38016, 0xf1633fdc +0, 273600, 38016, 0x91de3ff3 +0, 277200, 38016, 0x418942a1 +0, 280800, 38016, 0x670c4277 +0, 284400, 38016, 0xc04e403e +0, 288000, 38016, 0xa33e40ad +0, 291600, 38016, 0x7f959a9c +0, 295200, 38016, 0x096696ae +0, 298800, 38016, 0xdb41933c +0, 302400, 38016, 0xb26086b4 +0, 306000, 38016, 0x80c97e07 +0, 309600, 38016, 0xa7416837 +0, 313200, 38016, 0xa82f6342 +0, 316800, 38016, 0x8da16527 +0, 320400, 38016, 0x1c1965a9 +0, 324000, 38016, 0x09ad470c +0, 327600, 38016, 0x3f694725 +0, 331200, 38016, 0xa7034699 +0, 334800, 38016, 0x38104981 +0, 338400, 38016, 0x216048b7 +0, 342000, 38016, 0x24e04c22 +0, 345600, 38016, 0xbb7e4871 +0, 349200, 38016, 0x8c074b97 +0, 352800, 38016, 0x92aa4b79 +0, 356400, 38016, 0x073c4d97 +0, 360000, 38016, 0xe225f953 +0, 363600, 38016, 0xcaccf96b +0, 367200, 38016, 0xc395cd82 +0, 370800, 38016, 0x8c61ad55 +0, 374400, 38016, 0x6fb988f2 +0, 378000, 38016, 0x99fe7aea +0, 381600, 38016, 0xab3c73bf +0, 385200, 38016, 0xcdb06bc4 +0, 388800, 38016, 0x65a1540a +0, 392400, 38016, 0xc22f4fb0 +0, 396000, 38016, 0xe5ca4830 +0, 399600, 38016, 0x06b346f9 +0, 403200, 38016, 0x02154629 +0, 406800, 38016, 0x3d5e4467 +0, 410400, 38016, 0x6aa4460c +0, 414000, 38016, 0x05bc47c4 +0, 417600, 38016, 0xc46e4666 +0, 421200, 38016, 0xc28145f5 +0, 424800, 38016, 0xf57f4811 +0, 428400, 38016, 0x1bbc49f8 +0, 432000, 38016, 0x34e14c2c +0, 435600, 38016, 0x7e7d7740 +0, 439200, 38016, 0x97d798f3 +0, 442800, 38016, 0x7d71ca3b +0, 446400, 38016, 0xc6bc0776 +0, 450000, 38016, 0xda052645 +0, 453600, 38016, 0xf0b32de9 +0, 457200, 38016, 0x996f23cf +0, 460800, 38016, 0x22ea1a43 +0, 464400, 38016, 0xbde61021 +0, 468000, 38016, 0x8180079d +0, 471600, 38016, 0x3ac6f314 +0, 475200, 38016, 0x93604f67 +0, 478800, 38016, 0xb9a55213 +0, 482400, 38016, 0x89c8523c +0, 486000, 38016, 0x670a511b +0, 489600, 38016, 0x62395128 +0, 493200, 38016, 0x01605431 +0, 496800, 38016, 0x677253cd +0, 500400, 38016, 0xc57f56b1 +0, 504000, 38016, 0x767f5679 +0, 507600, 38016, 0x4abc5717 +0, 511200, 38016, 0x838657dc +0, 514800, 38016, 0x63bf56ad +0, 518400, 38016, 0x7019c8ad +0, 522000, 38016, 0xebbaa7bf +0, 525600, 38016, 0xebbc8ddb +0, 529200, 38016, 0xea609f00 +0, 532800, 38016, 0x88e6b1e4 +0, 536400, 38016, 0x7f9edd6b +0, 540000, 38016, 0xeaf354a6 +0, 543600, 38016, 0xf30274c9 +0, 547200, 38016, 0x05a756da +0, 550800, 38016, 0xacea1ca6 +0, 554400, 38016, 0x1520d86d +0, 558000, 38016, 0xb0f7afa4 +0, 561600, 38016, 0xe33c5802 +0, 565200, 38016, 0xce2a58cd +0, 568800, 38016, 0xd3ad5a30 +0, 572400, 38016, 0x29aa5955 +0, 576000, 38016, 0x59015aef +0, 579600, 38016, 0x247c5a72 +0, 583200, 38016, 0x79a85b27 +0, 586800, 38016, 0x6cf858fe +0, 590400, 38016, 0x78ec5b20 +0, 594000, 38016, 0x7cb158c5 +0, 597600, 38016, 0xc52c581f +0, 601200, 38016, 0x125c58bd +0, 604800, 38016, 0xf8b257c9 +0, 608400, 38016, 0x20329756 +0, 612000, 38016, 0x60a07c12 +0, 615600, 38016, 0xa2c26ad1 +0, 619200, 38016, 0xcbbc681b +0, 622800, 38016, 0x2c0562ad +0, 626400, 38016, 0x8a72640d +0, 630000, 38016, 0xe6e7756a +0, 633600, 38016, 0x64608a48 +0, 637200, 38016, 0xe9bea9fa +0, 640800, 38016, 0x24bac776 +0, 644400, 38016, 0x6aa9d01b +0, 648000, 38016, 0xf41ebb02 +0, 651600, 38016, 0x28017154 +0, 655200, 38016, 0x3fc55eb4 +0, 658800, 38016, 0xe7bc5f22 +0, 662400, 38016, 0xe6706162 +0, 666000, 38016, 0xee385fe2 +0, 669600, 38016, 0x79c0600b +0, 673200, 38016, 0x735a603f +0, 676800, 38016, 0xe7916199 +0, 680400, 38016, 0x542d601d +0, 684000, 38016, 0xbfaa611a +0, 687600, 38016, 0xb7504e05 +0, 691200, 38016, 0xd1964339 +0, 694800, 38016, 0x4213278a +0, 698400, 38016, 0xb503229f +0, 702000, 38016, 0x166a091c +0, 705600, 38016, 0x37176bbc +0, 709200, 38016, 0x95977cc3 +0, 712800, 38016, 0x5bab93f4 +0, 716400, 38016, 0x71d5d142 +0, 720000, 38016, 0x97d1cfa6 +0, 723600, 38016, 0xac82ff20 +0, 727200, 38016, 0x489a1fa1 +0, 730800, 38016, 0x32944930 +0, 734400, 38016, 0x72a2647c +0, 738000, 38016, 0x95b685d6 +0, 741600, 38016, 0xb7e19840 +0, 745200, 38016, 0x85569129 +0, 748800, 38016, 0x6bc6a197 +0, 752400, 38016, 0x55ccace8 +0, 756000, 38016, 0x9bbdc9c2 +0, 759600, 38016, 0xbce4ade3 +0, 763200, 38016, 0x39c7c48a +0, 766800, 38016, 0x498ac4aa +0, 770400, 38016, 0xeda3b715 +0, 774000, 38016, 0x700db089 +0, 777600, 38016, 0xf6b6bf36 +0, 781200, 38016, 0x6abebf1c +0, 784800, 38016, 0x8855c17c +0, 788400, 38016, 0xfba09dd5 +0, 792000, 38016, 0xd5868240 +0, 795600, 38016, 0x438074a2 +0, 799200, 38016, 0xc8b2c501 +0, 802800, 38016, 0xd48ec1ef +0, 806400, 38016, 0xa715c4be +0, 810000, 38016, 0xd758c281 +0, 813600, 38016, 0x07c25900 +0, 817200, 38016, 0xee7950e6 +0, 820800, 38016, 0x3e154be9 +0, 824400, 38016, 0xa8f33bb7 +0, 828000, 38016, 0xf493bc3c +0, 831600, 38016, 0x9d69bccb +0, 835200, 38016, 0xbf9fbafa +0, 838800, 38016, 0x2e62b9a8 +0, 842400, 38016, 0x2f41bae1 +0, 846000, 38016, 0xd820355d +0, 849600, 38016, 0xf3623118 +0, 853200, 38016, 0x659b4459 +0, 856800, 38016, 0xdcd74654 +0, 860400, 38016, 0x73f33f73 +0, 864000, 38016, 0xbf96b5ec +0, 867600, 38016, 0xe9ebb550 +0, 871200, 38016, 0xfe12b5dd +0, 874800, 38016, 0x9908b6d5 +0, 878400, 38016, 0xe805b8cf +0, 882000, 38016, 0x1a8eb68a +0, 885600, 38016, 0x6aed288d +0, 889200, 38016, 0x162f167f +0, 892800, 38016, 0x49110ae5 +0, 896400, 38016, 0xab060059 +0, 900000, 38016, 0x0fb8a0a8 +0, 903600, 38016, 0xf3b0b384 +0, 907200, 38016, 0x6f32bb1b +0, 910800, 38016, 0x7278bb3a +0, 914400, 38016, 0xdeb1bdcf +0, 918000, 38016, 0x90efbc5c +0, 921600, 38016, 0xd2f6bb28 +0, 925200, 38016, 0xba4dba32 +0, 928800, 38016, 0x0751ba19 +0, 932400, 38016, 0xc3f7b9db +0, 936000, 38016, 0xca22c433 +0, 939600, 38016, 0x82a7e336 +0, 943200, 38016, 0x45e90a19 +0, 946800, 38016, 0x82cd2c11 +0, 950400, 38016, 0x4e2e56cc +0, 954000, 38016, 0x0ad281c6 +0, 957600, 38016, 0x8685b8b7 +0, 961200, 38016, 0xe502b7b3 +0, 964800, 38016, 0x4898b696 +0, 968400, 38016, 0xe0fcb729 +0, 972000, 38016, 0xe5e0b822 +0, 975600, 38016, 0x9030b82c +0, 979200, 38016, 0x7dc6b93c +0, 982800, 38016, 0x727cb981 +0, 986400, 38016, 0xb08999c9 +0, 990000, 38016, 0x3e54b6d7 +0, 993600, 38016, 0x5d15c1e2 +0, 997200, 38016, 0x5840d8d7 +0, 1000800, 38016, 0x1109d730 +0, 1004400, 38016, 0xb898c47e +0, 1008000, 38016, 0xbde196c6 +0, 1011600, 38016, 0x75999430 +0, 1015200, 38016, 0xa17db11e +0, 1018800, 38016, 0xb428b220 +0, 1022400, 38016, 0x1537b1ed +0, 1026000, 38016, 0x102ab213 +0, 1029600, 38016, 0xee38af9e +0, 1033200, 38016, 0xc9c5b34e +0, 1036800, 38016, 0x8618af6d +0, 1040400, 38016, 0x97f3af7a +0, 1044000, 38016, 0x222eb095 +0, 1047600, 38016, 0xb1508324 +0, 1051200, 38016, 0x2149ad09 +0, 1054800, 38016, 0x67261443 +0, 1058400, 38016, 0x90918df5 +0, 1062000, 38016, 0x5d43e726 +0, 1065600, 38016, 0x1d77dfa3 +0, 1069200, 38016, 0xa60b941c +0, 1072800, 38016, 0x48813a99 +0, 1076400, 38016, 0x2324b77a +0, 1080000, 38016, 0xdfd99d0d +0, 1083600, 38016, 0x44129be1 +0, 1087200, 38016, 0x1137a099 +0, 1090800, 38016, 0xbd24a0a1 +0, 1094400, 38016, 0x3883a310 +0, 1098000, 38016, 0x0680a358 +0, 1101600, 38016, 0xf333a501 +0, 1105200, 38016, 0x3945a6ac +0, 1108800, 38016, 0x79eea741 +0, 1112400, 38016, 0x8c7aa6b0 +0, 1116000, 38016, 0x0342642f +0, 1119600, 38016, 0x83632b63 +0, 1123200, 38016, 0x1503ff51 +0, 1126800, 38016, 0xa4bcea0f +0, 1130400, 38016, 0x37dcd11b +0, 1134000, 38016, 0x9aa7287a +0, 1137600, 38016, 0x34deae76 +0, 1141200, 38016, 0x51710057 +0, 1144800, 38016, 0x9ee6fc0a +0, 1148400, 38016, 0xa419ea79 +0, 1152000, 38016, 0x49388f7e +0, 1155600, 38016, 0x08498b2d +0, 1159200, 38016, 0x104f8c4d +0, 1162800, 38016, 0xdb998d74 +0, 1166400, 38016, 0xd54e8c95 +0, 1170000, 38016, 0x54a48e5e +0, 1173600, 38016, 0xbe6f8cd0 +0, 1177200, 38016, 0x2a7f8ec2 +0, 1180800, 38016, 0x23848f19 +0, 1184400, 38016, 0x9b168ee3 +0, 1188000, 38016, 0xc2628fb6 +0, 1191600, 38016, 0xe2bdfd4e +0, 1195200, 38016, 0xfdae1546 +0, 1198800, 38016, 0xb1fe20db +0, 1202400, 38016, 0x5ebf23f0 +0, 1206000, 38016, 0xecbc1fcb +0, 1209600, 38016, 0xe72e141c +0, 1213200, 38016, 0xbad7f54d +0, 1216800, 38016, 0x95ead3c6 +0, 1220400, 38016, 0xf5c6b948 +0, 1224000, 38016, 0x2f8b80ab +0, 1227600, 38016, 0x0aed47a7 +0, 1231200, 38016, 0xdcb278e3 +0, 1234800, 38016, 0x2a677958 +0, 1238400, 38016, 0x45427ae8 +0, 1242000, 38016, 0xebce78de +0, 1245600, 38016, 0xaf007bb1 +0, 1249200, 38016, 0xb4677cdb +0, 1252800, 38016, 0xbf6d8024 +0, 1256400, 38016, 0xb67180de +0, 1260000, 38016, 0xb1581358 +0, 1263600, 38016, 0x258f140d +0, 1267200, 38016, 0x753d17e6 +0, 1270800, 38016, 0xf33816b4 +0, 1274400, 38016, 0x0d011c76 +0, 1278000, 38016, 0x48cfd85d +0, 1281600, 38016, 0x13ce822d +0, 1285200, 38016, 0x221a4468 +0, 1288800, 38016, 0x11364be7 +0, 1292400, 38016, 0xafc047b0 +0, 1296000, 38016, 0xeafd4217 +0, 1299600, 38016, 0x930b8a41 +0, 1303200, 38016, 0x2dda0bd2 +0, 1306800, 38016, 0x461cc3f2 +0, 1310400, 38016, 0xa99e962a +0, 1314000, 38016, 0xc1d954ba +0, 1317600, 38016, 0x0ce91a87 +0, 1321200, 38016, 0x10701e2d +0, 1324800, 38016, 0x98c22205 +0, 1328400, 38016, 0xb76622f1 +0, 1332000, 38016, 0x6d1a22d4 +0, 1335600, 38016, 0x00ee23c5 +0, 1339200, 38016, 0xc38125e6 +0, 1342800, 38016, 0x8de52597 +0, 1346400, 38016, 0xec282293 +0, 1350000, 38016, 0xb50f2238 +0, 1353600, 38016, 0xbdcf1f9f +0, 1357200, 38016, 0x5c6c1780 +0, 1360800, 38016, 0x41941237 +0, 1364400, 38016, 0x95ee1e69 +0, 1368000, 38016, 0x84b65009 +0, 1371600, 38016, 0x27bbf0ab +0, 1375200, 38016, 0xdd86f4fb +0, 1378800, 38016, 0x97733086 +0, 1382400, 38016, 0x3241472f +0, 1386000, 38016, 0x5d050c50 +0, 1389600, 38016, 0x8378aa9b +0, 1393200, 38016, 0x94f174cd +0, 1396800, 38016, 0x5825df16 +0, 1400400, 38016, 0x5f362875 +0, 1404000, 38016, 0x30704cd6 +0, 1407600, 38016, 0xc74e3614 +0, 1411200, 38016, 0xe033eb04 +0, 1414800, 38016, 0x665be967 +0, 1418400, 38016, 0x95d5ed67 +0, 1422000, 38016, 0x37dfefc1 +0, 1425600, 38016, 0x1908ee8e +0, 1429200, 38016, 0xf0cfee38 +0, 1432800, 38016, 0x871df078 +0, 1436400, 38016, 0xb2f2f0f9 +0, 1440000, 38016, 0xf955621f +0, 1443600, 38016, 0xbd2365a5 +0, 1447200, 38016, 0xe70d6bb0 +0, 1450800, 38016, 0x857e6d00 +0, 1454400, 38016, 0x000d6ee5 +0, 1458000, 38016, 0x9a2f7244 +0, 1461600, 38016, 0xe8c2f83c +0, 1465200, 38016, 0x23eb0377 +0, 1468800, 38016, 0xe0802a7f +0, 1472400, 38016, 0x5dbc4d69 +0, 1476000, 38016, 0xa3031f36 +0, 1479600, 38016, 0x27fbb378 +0, 1483200, 38016, 0xeee9a313 +0, 1486800, 38016, 0x189b1e68 +0, 1490400, 38016, 0x9a90678a +0, 1494000, 38016, 0x1a65ed20 +0, 1497600, 38016, 0x2f51beb7 +0, 1501200, 38016, 0x671ada9d +0, 1504800, 38016, 0x30af355a +0, 1508400, 38016, 0x1804d4f9 +0, 1512000, 38016, 0xee227951 +0, 1515600, 38016, 0x20dc3900 +0, 1519200, 38016, 0x334f82dc +0, 1522800, 38016, 0xb1728506 +0, 1526400, 38016, 0x2236fc10 +0, 1530000, 38016, 0x80d2964d +0, 1533600, 38016, 0x5e368712 +0, 1537200, 38016, 0x10408765 +0, 1540800, 38016, 0x4b3084c5 +0, 1544400, 38016, 0x975c473f +0, 1548000, 38016, 0x6f16efa3 +0, 1551600, 38016, 0xe73aac5e +0, 1555200, 38016, 0x996b6e24 +0, 1558800, 38016, 0x424f6f55 +0, 1562400, 38016, 0x33786d10 +0, 1566000, 38016, 0x8a0f6870 +0, 1569600, 38016, 0x5e8556d4 +0, 1573200, 38016, 0x863b2366 +0, 1576800, 38016, 0x3fa74842 +0, 1580400, 38016, 0x70208948 +0, 1584000, 38016, 0xcf005140 +0, 1587600, 38016, 0xa7585013 +0, 1591200, 38016, 0x61145096 +0, 1594800, 38016, 0x92b952a5 +0, 1598400, 38016, 0x35575235 +0, 1602000, 38016, 0x3e47ec63 +0, 1605600, 38016, 0xfce57b69 +0, 1609200, 38016, 0xf03815e6 +0, 1612800, 38016, 0xb5b6af64 +0, 1616400, 38016, 0x5e3f1b08 +0, 1620000, 38016, 0xd3f9ee61 +0, 1623600, 38016, 0xb8e2ee66 +0, 1627200, 38016, 0x86f8f4b5 +0, 1630800, 38016, 0x23c8f499 +0, 1634400, 38016, 0x634df498 +0, 1638000, 38016, 0xd2b3f570 +0, 1641600, 38016, 0x053e67d3 +0, 1645200, 38016, 0x8d2cbeb3 +0, 1648800, 38016, 0xba0b1e1c +0, 1652400, 38016, 0x0f5c7d73 +0, 1656000, 38016, 0x46b2118a +0, 1659600, 38016, 0x818ebae5 +0, 1663200, 38016, 0x4a7af8a9 +0, 1666800, 38016, 0x0c22f937 +0, 1670400, 38016, 0x967ef9b3 +0, 1674000, 38016, 0x530afd34 +0, 1677600, 38016, 0x2a00fdb6 +0, 1681200, 38016, 0xca14f913 +0, 1684800, 38016, 0x82b6f7bc +0, 1688400, 38016, 0xd32879ec +0, 1692000, 38016, 0x242b6920 +0, 1695600, 38016, 0x44fd66e4 +0, 1699200, 38016, 0x69d3479c +0, 1702800, 38016, 0x41a63899 +0, 1706400, 38016, 0xfb370720 +0, 1710000, 38016, 0x5cf0f42d +0, 1713600, 38016, 0x74e8ca33 +0, 1717200, 38016, 0x1f09cb30 +0, 1720800, 38016, 0xc5e8c1d8 +0, 1724400, 38016, 0x3a82bd74 +0, 1728000, 38016, 0xada0bd71 +0, 1731600, 38016, 0xe695bcc9 +0, 1735200, 38016, 0xc255bb45 +0, 1738800, 38016, 0x6deebbcd +0, 1742400, 38016, 0x6bf5cef2 +0, 1746000, 38016, 0x8eaed078 +0, 1749600, 38016, 0x3a8addb0 +0, 1753200, 38016, 0x0f2bfe11 +0, 1756800, 38016, 0xe13d2e3b +0, 1760400, 38016, 0x9bb7606f +0, 1764000, 38016, 0x9fcc8899 +0, 1767600, 38016, 0xfa22a313 +0, 1771200, 38016, 0xc599b318 +0, 1774800, 38016, 0x33ecb361 +0, 1778400, 38016, 0x2ba8b2df +0, 1782000, 38016, 0x0debb343 +0, 1785600, 38016, 0x8bbcb7cd +0, 1789200, 38016, 0x093fbb20 +0, 1792800, 38016, 0x4340c0d2 +0, 1796400, 38016, 0xd765bcb8 +0, 1800000, 38016, 0xe9ea3103 +0, 1803600, 38016, 0x24d7a1ae +0, 1807200, 38016, 0x9b9ac80f +0, 1810800, 38016, 0x81b7da0c +0, 1814400, 38016, 0xb7c5f017 +0, 1818000, 38016, 0xa0e9f9c1 +0, 1821600, 38016, 0x932111a9 +0, 1825200, 38016, 0x15fc17ba +0, 1828800, 38016, 0x3c7710bd +0, 1832400, 38016, 0xae1b0ba8 +0, 1836000, 38016, 0x7dc24093 +0, 1839600, 38016, 0x8b9042ad +0, 1843200, 38016, 0x257f4c1c +0, 1846800, 38016, 0xaa0442d8 +0, 1850400, 38016, 0xbedd462c +0, 1854000, 38016, 0xa9bd4905 +0, 1857600, 38016, 0x69d74f50 +0, 1861200, 38016, 0x18143c0d +0, 1864800, 38016, 0xd2eb5820 +0, 1868400, 38016, 0x94fb5e93 +0, 1872000, 38016, 0x3072f80d +0, 1875600, 38016, 0xd838f186 +0, 1879200, 38016, 0x3e41e695 +0, 1882800, 38016, 0x66eef2cd +0, 1886400, 38016, 0x3854ec56 +0, 1890000, 38016, 0x05d3f9c2 +0, 1893600, 38016, 0x53820cc3 +0, 1897200, 38016, 0x09d413ea +0, 1900800, 38016, 0x82f217f2 +0, 1904400, 38016, 0x07b21d50 +0, 1908000, 38016, 0xd72155c2 +0, 1911600, 38016, 0x20b04c74 +0, 1915200, 38016, 0x5b8962f6 +0, 1918800, 38016, 0xfb8b72c9 +0, 1922400, 38016, 0x6d0f56a7 +0, 1926000, 38016, 0x97876300 +0, 1929600, 38016, 0xfd7f655f +0, 1933200, 38016, 0x3e405ff6 +0, 1936800, 38016, 0x5ad27a20 +0, 1940400, 38016, 0x46125305 +0, 1944000, 38016, 0x91017b86 +0, 1947600, 38016, 0x5c150c66 +0, 1951200, 38016, 0xc3430969 +0, 1954800, 38016, 0x5f400689 +0, 1958400, 38016, 0x21ddf969 +0, 1962000, 38016, 0x5feff594 +0, 1965600, 38016, 0xb304f3c1 +0, 1969200, 38016, 0xa9c3f70e +0, 1972800, 38016, 0x6014fa8e +0, 1976400, 38016, 0x7198f22e +0, 1980000, 38016, 0xe338e495 +0, 1983600, 38016, 0x9a69ea32 +0, 1987200, 38016, 0xc0cc5d05 +0, 1990800, 38016, 0xefa16044 +0, 1994400, 38016, 0x3e3c6120 +0, 1998000, 38016, 0x06ef63e1 +0, 2001600, 38016, 0x25d5631f +0, 2005200, 38016, 0xbc8963ee +0, 2008800, 38016, 0xc2336218 +0, 2012400, 38016, 0xb23965fd +0, 2016000, 38016, 0x84c9651f +0, 2019600, 38016, 0x41f6647a +0, 2023200, 38016, 0xddbe6572 +0, 2026800, 38016, 0x113f65f2 +0, 2030400, 38016, 0x89beec24 +0, 2034000, 38016, 0x6490f37b +0, 2037600, 38016, 0x15ecf84d +0, 2041200, 38016, 0xa439f491 +0, 2044800, 38016, 0xda8bf5c4 +0, 2048400, 38016, 0x6bc2f96a +0, 2052000, 38016, 0x243d0bac +0, 2055600, 38016, 0xb7c611a2 +0, 2059200, 38016, 0x99243328 +0, 2062800, 38016, 0xa9534571 +0, 2066400, 38016, 0xa5a657bd +0, 2070000, 38016, 0xd8d06892 +0, 2073600, 38016, 0xb4eb6c8d +0, 2077200, 38016, 0xa3d36ca8 +0, 2080800, 38016, 0x153a6e9e +0, 2084400, 38016, 0xf2607081 +0, 2088000, 38016, 0x799d7081 +0, 2091600, 38016, 0x377570cd +0, 2095200, 38016, 0x90496e54 +0, 2098800, 38016, 0x1d4c746c +0, 2102400, 38016, 0xbe5e72bb +0, 2106000, 38016, 0x3c6a760d +0, 2109600, 38016, 0xd4097614 +0, 2113200, 38016, 0xf45a7a28 +0, 2116800, 38016, 0x8fe37bb8 +0, 2120400, 38016, 0x966295dc +0, 2124000, 38016, 0xb40da3df +0, 2127600, 38016, 0x9714b2ac +0, 2131200, 38016, 0xbdb3c61d +0, 2134800, 38016, 0x12fcd320 +0, 2138400, 38016, 0x1ee8d858 +0, 2142000, 38016, 0x49e5e217 +0, 2145600, 38016, 0x92aef38e +0, 2149200, 38016, 0xc26c0476 +0, 2152800, 38016, 0x8eed0e04 +0, 2156400, 38016, 0xe4e3118d +0, 2160000, 38016, 0x282ce796 +0, 2163600, 38016, 0xbec801e1 +0, 2167200, 38016, 0x864afaf2 +0, 2170800, 38016, 0xe0860383 +0, 2174400, 38016, 0x4261001d +0, 2178000, 38016, 0x976c0005 +0, 2181600, 38016, 0x69c40af3 +0, 2185200, 38016, 0xb3c00e18 +0, 2188800, 38016, 0x28300c2c +0, 2192400, 38016, 0xf2d9ff9d +0, 2196000, 38016, 0xcaeaf979 +0, 2199600, 38016, 0x6733f58e +0, 2203200, 38016, 0x2bb80869 +0, 2206800, 38016, 0x3c370085 +0, 2210400, 38016, 0x11a2fa2a +0, 2214000, 38016, 0x828ff770 +0, 2217600, 38016, 0x79bcf490 +0, 2221200, 38016, 0x31d5ee87 +0, 2224800, 38016, 0x6336f00d +0, 2228400, 38016, 0x058af9d1 +0, 2232000, 38016, 0xff29eb2f +0, 2235600, 38016, 0x3c3be1f4 +0, 2239200, 38016, 0xfbf5ddc2 +0, 2242800, 38016, 0x22a4d324 +0, 2246400, 38016, 0xb2d4d1d4 +0, 2250000, 38016, 0xa159171f +0, 2253600, 38016, 0x61a80251 +0, 2257200, 38016, 0xe0429283 +0, 2260800, 38016, 0x5c255bd4 +0, 2264400, 38016, 0xdb0f57ac +0, 2268000, 38016, 0x3c8bcbf0 +0, 2271600, 38016, 0x2be3d2ef +0, 2275200, 38016, 0xcd2dc8cc +0, 2278800, 38016, 0x6905c4cf +0, 2282400, 38016, 0xd9c9c590 +0, 2286000, 38016, 0xa945cb51 +0, 2289600, 38016, 0x5c8458d3 +0, 2293200, 38016, 0xa1624b6e +0, 2296800, 38016, 0xb167532e +0, 2300400, 38016, 0x149d6413 +0, 2304000, 38016, 0x85d97340 +0, 2307600, 38016, 0x8f478203 +0, 2311200, 38016, 0x1902cc8e +0, 2314800, 38016, 0x1521c5e5 +0, 2318400, 38016, 0xf2d6c7d8 +0, 2322000, 38016, 0x7150c510 +0, 2325600, 38016, 0xfc0ec330 +0, 2329200, 38016, 0x91c4c933 +0, 2332800, 38016, 0x5ec6cbc8 +0, 2336400, 38016, 0x23c0955c +0, 2340000, 38016, 0x76fb7c27 +0, 2343600, 38016, 0x33c07597 +0, 2347200, 38016, 0x797b6acd +0, 2350800, 38016, 0xc4945313 +0, 2354400, 38016, 0xa50f25da +0, 2358000, 38016, 0x7bb6096c +0, 2361600, 38016, 0x8a1acc48 +0, 2365200, 38016, 0x19a1c9b4 +0, 2368800, 38016, 0x4436cd03 +0, 2372400, 38016, 0xfd73d6fe +0, 2376000, 38016, 0x25d3d4f0 +0, 2379600, 38016, 0x3acfcd98 +0, 2383200, 38016, 0x2ed3d071 +0, 2386800, 38016, 0x246fd4bd +0, 2390400, 38016, 0x3e410c62 +0, 2394000, 38016, 0x29da1177 +0, 2397600, 38016, 0x039f1e46 +0, 2401200, 38016, 0x178d1e1a +0, 2404800, 38016, 0x75561d47 +0, 2408400, 38016, 0x7d65193c +0, 2412000, 38016, 0xd38d19a8 +0, 2415600, 38016, 0x39c92b20 +0, 2419200, 38016, 0x6c8aebc3 +0, 2422800, 38016, 0xd8d4f9be +0, 2426400, 38016, 0x7e730a4a +0, 2430000, 38016, 0xbfae1fee +0, 2433600, 38016, 0x398f3484 +0, 2437200, 38016, 0xd8e84019 +0, 2440800, 38016, 0x2cf64db3 +0, 2444400, 38016, 0x7e074f09 +0, 2448000, 38016, 0xac384b5a +0, 2451600, 38016, 0xd28b3a83 +0, 2455200, 38016, 0xa5ce5610 +0, 2458800, 38016, 0xde8565f7 +0, 2462400, 38016, 0x01397a1a +0, 2466000, 38016, 0xdbdf7fb7 +0, 2469600, 38016, 0x8c1f8ba6 +0, 2473200, 38016, 0xab2a943c +0, 2476800, 38016, 0x4f8b8421 +0, 2480400, 38016, 0x36f57b3a +0, 2484000, 38016, 0x565c4dd9 +0, 2487600, 38016, 0x53c34715 +0, 2491200, 38016, 0x38fd4aaa +0, 2494800, 38016, 0x4dca43eb +0, 2498400, 38016, 0x1afe40f3 +0, 2502000, 38016, 0xc3dc43cc +0, 2505600, 38016, 0x1d92431d +0, 2509200, 38016, 0x3f794765 +0, 2512800, 38016, 0x1c5d4a71 +0, 2516400, 38016, 0xb601531e +0, 2520000, 38016, 0x4d925d7c +0, 2523600, 38016, 0x1c605f1e +0, 2527200, 38016, 0x50ff5608 +0, 2530800, 38016, 0x8da14815 +0, 2534400, 38016, 0x53cc3007 +0, 2538000, 38016, 0x5ce82198 +0, 2541600, 38016, 0x074e15bc +0, 2545200, 38016, 0x59fb13c9 +0, 2548800, 38016, 0xe28e13a6 +0, 2552400, 38016, 0xcb4f3fa8 +0, 2556000, 38016, 0x7fad560c +0, 2559600, 38016, 0x7dbc614a +0, 2563200, 38016, 0xe96f6d9c +0, 2566800, 38016, 0xf3c47a74 +0, 2570400, 38016, 0xd2af8027 +0, 2574000, 38016, 0x504779d1 +0, 2577600, 38016, 0x876e7f5f +0, 2581200, 38016, 0x959f8c3d +0, 2584800, 38016, 0x64d690be +0, 2588400, 38016, 0xdb899760 +0, 2592000, 38016, 0xbd229ba1 +0, 2595600, 38016, 0xdace575b +0, 2599200, 38016, 0xfda46324 +0, 2602800, 38016, 0x57b75dbd +0, 2606400, 38016, 0x264a59cf +0, 2610000, 38016, 0xfde95cc8 +0, 2613600, 38016, 0x5116601b +0, 2617200, 38016, 0x72e67205 +0, 2620800, 38016, 0xf1057674 +0, 2624400, 38016, 0x7e917eb9 +0, 2628000, 38016, 0x50ed8b28 +0, 2631600, 38016, 0x357a826c +0, 2635200, 38016, 0xd68fa449 +0, 2638800, 38016, 0x3a839e39 +0, 2642400, 38016, 0x79469a1b +0, 2646000, 38016, 0xa9ca9590 +0, 2649600, 38016, 0xbf399686 +0, 2653200, 38016, 0x40499eaf +0, 2656800, 38016, 0x9972a76d +0, 2660400, 38016, 0xa3d0aff4 +0, 2664000, 38016, 0xdf27b647 +0, 2667600, 38016, 0x4147c66e +0, 2671200, 38016, 0x1378d1db +0, 2674800, 38016, 0x1ca3d444 +0, 2678400, 38016, 0x464d9538 +0, 2682000, 38016, 0xaed28de9 +0, 2685600, 38016, 0xc77a9f86 +0, 2689200, 38016, 0x0882aa10 +0, 2692800, 38016, 0x206ac330 +0, 2696400, 38016, 0x63efd763 +0, 2700000, 38016, 0xbfe2e663 +0, 2703600, 38016, 0xfe6ff1ad +0, 2707200, 38016, 0x60f9f47e +0, 2710800, 38016, 0xba1cf0c0 +0, 2714400, 38016, 0x1880eb3d +0, 2718000, 38016, 0xf0fdd350 +0, 2721600, 38016, 0xb678eedb +0, 2725200, 38016, 0xa17cf5e4 +0, 2728800, 38016, 0x567fff2a +0, 2732400, 38016, 0x52ab043b +0, 2736000, 38016, 0x8e8b0bd9 +0, 2739600, 38016, 0x0f131a7e +0, 2743200, 38016, 0x26aa2303 +0, 2746800, 38016, 0x70c12bab +0, 2750400, 38016, 0xa8a93858 +0, 2754000, 38016, 0x289f3b94 +0, 2757600, 38016, 0x3d883605 +0, 2761200, 38016, 0xe171329e +0, 2764800, 38016, 0x75292865 +0, 2768400, 38016, 0x1d2ac8dc +0, 2772000, 38016, 0xa336aa94 +0, 2775600, 38016, 0xcede9906 +0, 2779200, 38016, 0x1c9a8b52 +0, 2782800, 38016, 0x2a9c8a78 +0, 2786400, 38016, 0x920a8583 +0, 2790000, 38016, 0xb3ee7e2d +0, 2793600, 38016, 0x96be75fc +0, 2797200, 38016, 0x2a8a68d2 +0, 2800800, 38016, 0xdf8e6baf +0, 2804400, 38016, 0xd46570d1 +0, 2808000, 38016, 0x765b71af +0, 2811600, 38016, 0x25fe71df +0, 2815200, 38016, 0x9ca124e3 +0, 2818800, 38016, 0x77c51bab +0, 2822400, 38016, 0x0b380db9 +0, 2826000, 38016, 0xb0be108b +0, 2829600, 38016, 0x5c4808b8 +0, 2833200, 38016, 0x73331227 +0, 2836800, 38016, 0xce790cf2 +0, 2840400, 38016, 0x46ac0dfc +0, 2844000, 38016, 0xdc310caf +0, 2847600, 38016, 0x909c0606 +0, 2851200, 38016, 0x0756fb3e +0, 2854800, 38016, 0x4eb0fb0d +0, 2858400, 38016, 0x6276f6e2 +0, 2862000, 38016, 0x92e0f070 +0, 2865600, 38016, 0x6f2d793f +0, 2869200, 38016, 0x215f704b +0, 2872800, 38016, 0xf9b7765e +0, 2876400, 38016, 0xdb6176bf +0, 2880000, 38016, 0x2b5165eb +0, 2883600, 38016, 0xf1145c06 +0, 2887200, 38016, 0x343f698d +0, 2890800, 38016, 0xcb96713f +0, 2894400, 38016, 0xc50f775a +0, 2898000, 38016, 0xbb927e81 +0, 2901600, 38016, 0xa2497bd4 +0, 2905200, 38016, 0xe52b80fa +0, 2908800, 38016, 0x900f7ac7 +0, 2912400, 38016, 0x77e77d0e +0, 2916000, 38016, 0xdb33f302 +0, 2919600, 38016, 0xf0519288 +0, 2923200, 38016, 0x4552f487 +0, 2926800, 38016, 0xe7b5f34c +0, 2930400, 38016, 0x0db18be6 +0, 2934000, 38016, 0xb9ba87c2 +0, 2937600, 38016, 0x1dc2f805 +0, 2941200, 38016, 0x4986f535 +0, 2944800, 38016, 0xc099f301 +0, 2948400, 38016, 0x3d8c6787 +0, 2952000, 38016, 0xd3a4796f +0, 2955600, 38016, 0xfe01635f +0, 2959200, 38016, 0xba8df082 +0, 2962800, 38016, 0x55f3f017 +0, 2966400, 38016, 0xf2d7f36a +0, 2970000, 38016, 0x8bd8f7a1 +0, 2973600, 38016, 0xabcd638b +0, 2977200, 38016, 0x69ae59ea +0, 2980800, 38016, 0x5bf43408 +0, 2984400, 38016, 0x6466fd67 +0, 2988000, 38016, 0xc90effb4 +0, 2991600, 38016, 0x82110480 +0, 2995200, 38016, 0xb364f74b +0, 2998800, 38016, 0x7f1efd76 +0, 3002400, 38016, 0x1a20f30f +0, 3006000, 38016, 0x4b0fe377 +0, 3009600, 38016, 0x57b4c896 +0, 3013200, 38016, 0x92b1ab52 +0, 3016800, 38016, 0x10ceaf82 +0, 3020400, 38016, 0xc4d3b0b8 +0, 3024000, 38016, 0x68b9f314 +0, 3027600, 38016, 0xc627fd70 +0, 3031200, 38016, 0x5fc108dc +0, 3034800, 38016, 0x0f1f12d7 +0, 3038400, 38016, 0x6edc208e +0, 3042000, 38016, 0x91f824eb +0, 3045600, 38016, 0x1464b836 +0, 3049200, 38016, 0x84c7c412 +0, 3052800, 38016, 0x3e8dd049 +0, 3056400, 38016, 0x493dd1a7 +0, 3060000, 38016, 0x25dfbd00 +0, 3063600, 38016, 0x140bbd33 +0, 3067200, 38016, 0x488e2db6 +0, 3070800, 38016, 0x9e4f2c0a +0, 3074400, 38016, 0xd60928d3 +0, 3078000, 38016, 0x38b61e0b +0, 3081600, 38016, 0xb6331660 +0, 3085200, 38016, 0x0a3a0e4c +0, 3088800, 38016, 0x6ad9105b +0, 3092400, 38016, 0x29a8cd6b +0, 3096000, 38016, 0x35e1da7d +0, 3099600, 38016, 0x824de492 +0, 3103200, 38016, 0x1c76d83c +0, 3106800, 38016, 0xbe25d98d +0, 3110400, 38016, 0x5efaf222 +0, 3114000, 38016, 0x17370266 +0, 3117600, 38016, 0x417a2375 +0, 3121200, 38016, 0xb7e423d3 +0, 3124800, 38016, 0x224020fe +0, 3128400, 38016, 0x4bbe1ee9 +0, 3132000, 38016, 0x72aa1f21 +0, 3135600, 38016, 0xc810126d +0, 3139200, 38016, 0x42730cd4 +0, 3142800, 38016, 0xfd510c5d +0, 3146400, 38016, 0x7c6f1313 +0, 3150000, 38016, 0xc1b31b89 +0, 3153600, 38016, 0x57772339 +0, 3157200, 38016, 0x20922349 +0, 3160800, 38016, 0xea4f1a45 +0, 3164400, 38016, 0x79e214d2 +0, 3168000, 38016, 0x77521b5d +0, 3171600, 38016, 0x5929276c +0, 3175200, 38016, 0x40b3130d +0, 3178800, 38016, 0x040a157e +0, 3182400, 38016, 0x0de31983 +0, 3186000, 38016, 0xdb0a1852 +0, 3189600, 38016, 0x73111b91 +0, 3193200, 38016, 0xf7a61765 +0, 3196800, 38016, 0xc5dd2557 +0, 3200400, 38016, 0xabc32e16 +0, 3204000, 38016, 0x5f093823 +0, 3207600, 38016, 0x9f462f1e +0, 3211200, 38016, 0x29822c19 +0, 3214800, 38016, 0x259a2697 +0, 3218400, 38016, 0x7ad61867 +0, 3222000, 38016, 0x32fe111f +0, 3225600, 38016, 0xf65c1142 +0, 3229200, 38016, 0xc5b91a6d +0, 3232800, 38016, 0x4461191e +0, 3236400, 38016, 0x0458193a +0, 3240000, 38016, 0x3ed084a9 +0, 3243600, 38016, 0x4dd28047 +0, 3247200, 38016, 0x18dd8523 +0, 3250800, 38016, 0x4ab87d32 +0, 3254400, 38016, 0xecd0824c +0, 3258000, 38016, 0xae567d36 +0, 3261600, 38016, 0xfa2e82d0 +0, 3265200, 38016, 0xbce08c2e +0, 3268800, 38016, 0x125094c4 +0, 3272400, 38016, 0x475e9b1d +0, 3276000, 38016, 0x9b921150 +0, 3279600, 38016, 0x6f7b1124 +0, 3283200, 38016, 0xa1fe0d8b +0, 3286800, 38016, 0x12930955 +0, 3290400, 38016, 0x3d981105 +0, 3294000, 38016, 0x92d92e3b +0, 3297600, 38016, 0x29a33ed5 +0, 3301200, 38016, 0x8d0b578e +0, 3304800, 38016, 0xda5571ba +0, 3308400, 38016, 0xbc638172 +0, 3312000, 38016, 0x73fd9abb +0, 3315600, 38016, 0x53df952b +0, 3319200, 38016, 0xe1758a4c +0, 3322800, 38016, 0x064f8812 +0, 3326400, 38016, 0xd9b08971 +0, 3330000, 38016, 0xfe6688a9 +0, 3333600, 38016, 0x3b50938b +0, 3337200, 38016, 0x4e1a9c13 +0, 3340800, 38016, 0x63599bf0 +0, 3344400, 38016, 0x97e0957f +0, 3348000, 38016, 0x5a6e98d7 +0, 3351600, 38016, 0xa4be8cf2 +0, 3355200, 38016, 0x53bb901e +0, 3358800, 38016, 0x15f0994e +0, 3362400, 38016, 0x71499a4b +0, 3366000, 38016, 0xf41a87a5 +0, 3369600, 38016, 0x3e237999 +0, 3373200, 38016, 0xf77f5dd2 +0, 3376800, 38016, 0x89874799 +0, 3380400, 38016, 0x02d82294 +0, 3384000, 38016, 0xc5920154 +0, 3387600, 38016, 0x6e61f375 +0, 3391200, 38016, 0x41a6940c +0, 3394800, 38016, 0x130b97f7 +0, 3398400, 38016, 0xdff09b51 +0, 3402000, 38016, 0xb2999bd6 +0, 3405600, 38016, 0x0bb99d20 +0, 3409200, 38016, 0x9f819633 +0, 3412800, 38016, 0x5bda9640 +0, 3416400, 38016, 0xdcf29321 +0, 3420000, 38016, 0xa6838a63 +0, 3423600, 38016, 0x820a825e +0, 3427200, 38016, 0x69bb7859 +0, 3430800, 38016, 0x4a8c79c2 +0, 3434400, 38016, 0x1e97e67d +0, 3438000, 38016, 0x1ad4de1b +0, 3441600, 38016, 0xe8abeb33 +0, 3445200, 38016, 0xf3a51523 +0, 3448800, 38016, 0xb997399c +0, 3452400, 38016, 0x9fee8105 +0, 3456000, 38016, 0xf2b6ada3 +0, 3459600, 38016, 0xe6f5bbb3 +0, 3463200, 38016, 0x8ed7ca9f +0, 3466800, 38016, 0x711abc1a +0, 3470400, 38016, 0x707ab544 +0, 3474000, 38016, 0x03b8af51 +0, 3477600, 38016, 0x50497b2c +0, 3481200, 38016, 0x72b57a30 +0, 3484800, 38016, 0xfb6d8164 +0, 3488400, 38016, 0x88618e82 +0, 3492000, 38016, 0xb7369e49 +0, 3495600, 38016, 0x2502a3ca +0, 3499200, 38016, 0x793aa276 +0, 3502800, 38016, 0x883a8ec6 +0, 3506400, 38016, 0x5f7784e5 +0, 3510000, 38016, 0xddfa7e94 +0, 3513600, 38016, 0xdb877fb8 +0, 3517200, 38016, 0x07e07f39 +0, 3520800, 38016, 0x412590fb +0, 3524400, 38016, 0x1bd1b527 +0, 3528000, 38016, 0xbb6098c3 +0, 3531600, 38016, 0x5f1b8788 +0, 3535200, 38016, 0x42f068e8 +0, 3538800, 38016, 0x316b53bb +0, 3542400, 38016, 0xbdbb3fa0 +0, 3546000, 38016, 0xa68f506c +0, 3549600, 38016, 0xca355d03 +0, 3553200, 38016, 0xfafc6b88 +0, 3556800, 38016, 0x0f106535 +0, 3560400, 38016, 0xa4ae4e63 +0, 3564000, 38016, 0xb206400f +0, 3567600, 38016, 0x3a5946d1 +0, 3571200, 38016, 0xca739868 +0, 3574800, 38016, 0xe6939d41 +0, 3578400, 38016, 0x2ec19a76 +0, 3582000, 38016, 0x614e96a4 +0, 3585600, 38016, 0x2c2b9348 +0, 3589200, 38016, 0xa00c7f1f +0, 3592800, 38016, 0x95cb6eca +0, 3596400, 38016, 0x069d6c4c +0, 3600000, 38016, 0xe17e03e3 +0, 3603600, 38016, 0xa7491870 +0, 3607200, 38016, 0xacc91e48 +0, 3610800, 38016, 0x99eb1e2a +0, 3614400, 38016, 0xb2eb1279 +0, 3618000, 38016, 0xa5020c77 +0, 3621600, 38016, 0xde966613 +0, 3625200, 38016, 0xac7f6e1e +0, 3628800, 38016, 0x1c378a7a +0, 3632400, 38016, 0x32e6d8a4 +0, 3636000, 38016, 0xecb8d286 +0, 3639600, 38016, 0xa497d941 +0, 3643200, 38016, 0x8ad7d36e +0, 3646800, 38016, 0xdbd8a91a +0, 3650400, 38016, 0x718f61d7 +0, 3654000, 38016, 0x862619cf +0, 3657600, 38016, 0xaa049781 +0, 3661200, 38016, 0xd3986887 +0, 3664800, 38016, 0x9e9f5782 +0, 3668400, 38016, 0x2a9d4f70 +0, 3672000, 38016, 0x62b91421 +0, 3675600, 38016, 0x32313eaa +0, 3679200, 38016, 0xf9bf1879 +0, 3682800, 38016, 0xc33c0811 +0, 3686400, 38016, 0xe9c21227 +0, 3690000, 38016, 0xf2922db6 +0, 3693600, 38016, 0x669d0627 +0, 3697200, 38016, 0x64c1048a +0, 3700800, 38016, 0xdd28fa70 +0, 3704400, 38016, 0xd88e8b77 +0, 3708000, 38016, 0x3716bdb8 +0, 3711600, 38016, 0x1834ef57 +0, 3715200, 38016, 0xddb800b7 +0, 3718800, 38016, 0x140302cc +0, 3722400, 38016, 0x7fa60568 +0, 3726000, 38016, 0x7cc6fd4b +0, 3729600, 38016, 0xf14c2568 +0, 3733200, 38016, 0x2ee88bbc +0, 3736800, 38016, 0x915cd143 +0, 3740400, 38016, 0x13ede5fa +0, 3744000, 38016, 0x6615f63b +0, 3747600, 38016, 0x8814f54f +0, 3751200, 38016, 0xb53ef24a +0, 3754800, 38016, 0xc6a8ee80 +0, 3758400, 38016, 0x9473ee09 +0, 3762000, 38016, 0x9b77d932 +0, 3765600, 38016, 0x142fc69a +0, 3769200, 38016, 0xb238c6a2 +0, 3772800, 38016, 0x4364d302 +0, 3776400, 38016, 0xde39d174 +0, 3780000, 38016, 0x7fca7fa6 +0, 3783600, 38016, 0x77678d42 +0, 3787200, 38016, 0xaa7e8b68 +0, 3790800, 38016, 0xeecb8c89 +0, 3794400, 38016, 0x6e5e8980 +0, 3798000, 38016, 0x4f4a80de +0, 3801600, 38016, 0xb3b5cee6 +0, 3805200, 38016, 0x0c72cf1c +0, 3808800, 38016, 0xd83fd12d +0, 3812400, 38016, 0x8deeda59 +0, 3816000, 38016, 0xe7fae46e +0, 3819600, 38016, 0x8233ecd5 +0, 3823200, 38016, 0x0c32808c +0, 3826800, 38016, 0xf43f8571 +0, 3830400, 38016, 0xae898f01 +0, 3834000, 38016, 0x5a4a99e9 +0, 3837600, 38016, 0x589f9b80 +0, 3841200, 38016, 0x6ca5a33b +0, 3844800, 38016, 0x3811af0a +0, 3848400, 38016, 0x8272eda7 +0, 3852000, 38016, 0xa807f046 +0, 3855600, 38016, 0x5b4fec80 +0, 3859200, 38016, 0xb6e6e7fa +0, 3862800, 38016, 0x250cdb5c +0, 3866400, 38016, 0x3f38e876 +0, 3870000, 38016, 0x8110e94a +0, 3873600, 38016, 0x0f19abd7 +0, 3877200, 38016, 0x9e1ca9bd +0, 3880800, 38016, 0x1f33abae +0, 3884400, 38016, 0xff18ad65 +0, 3888000, 38016, 0x3d02b300 +0, 3891600, 38016, 0xb7a9b4b2 +0, 3895200, 38016, 0xd8cab454 +0, 3898800, 38016, 0xb48ab772 +0, 3902400, 38016, 0x7f98fe59 +0, 3906000, 38016, 0x786c1795 +0, 3909600, 38016, 0x013437ff +0, 3913200, 38016, 0xba28622a +0, 3916800, 38016, 0xf48486e1 +0, 3920400, 38016, 0xc13695c4 +0, 3924000, 38016, 0x1fc5a4d2 +0, 3927600, 38016, 0x016caefd +0, 3931200, 38016, 0x76b8bc54 +0, 3934800, 38016, 0xcf63bdbc +0, 3938400, 38016, 0xeb02c0e2 +0, 3942000, 38016, 0xb57dc067 +0, 3945600, 38016, 0x8ec8c058 +0, 3949200, 38016, 0xcb04be49 +0, 3952800, 38016, 0xceccbfac +0, 3956400, 38016, 0x3408c0c3 +0, 3960000, 38016, 0xee526afa +0, 3963600, 38016, 0xd7529aad +0, 3967200, 38016, 0x98bd9221 +0, 3970800, 38016, 0x2fbd7e5a +0, 3974400, 38016, 0x0fb8a8fc +0, 3978000, 38016, 0xfd28af91 +0, 3981600, 38016, 0x81db9907 +0, 3985200, 38016, 0x1f0a8ae7 +0, 3988800, 38016, 0xd91e93e3 +0, 3992400, 38016, 0x5fe6b043 +0, 3996000, 38016, 0x2a618a48 +0, 3999600, 38016, 0xef1c8cc2 +0, 4003200, 38016, 0x928595ce +0, 4006800, 38016, 0xf2a59a43 +0, 4010400, 38016, 0x61bf92d0 +0, 4014000, 38016, 0x584d840f +0, 4017600, 38016, 0x42177cb1 +0, 4021200, 38016, 0x08867c3b +0, 4024800, 38016, 0x5a89813b +0, 4028400, 38016, 0xba558022 +0, 4032000, 38016, 0x3d58878a +0, 4035600, 38016, 0x8d215911 +0, 4039200, 38016, 0xea27370c +0, 4042800, 38016, 0x7e2a1a9c +0, 4046400, 38016, 0xbb86f763 +0, 4050000, 38016, 0xf03fd3c7 +0, 4053600, 38016, 0x1eaac263 +0, 4057200, 38016, 0x8a4bd0e1 +0, 4060800, 38016, 0x5adcf66d +0, 4064400, 38016, 0xa0320a89 +0, 4068000, 38016, 0x77338f96 +0, 4071600, 38016, 0xf3498f6a +0, 4075200, 38016, 0x7e248dcf +0, 4078800, 38016, 0xf7f68dcc +0, 4082400, 38016, 0x5da597c9 +0, 4086000, 38016, 0x63db9d00 +0, 4089600, 38016, 0xd1f09e52 +0, 4093200, 38016, 0xfc7ba2e1 +0, 4096800, 38016, 0x8c26ab25 +0, 4100400, 38016, 0x6a45add3 +0, 4104000, 38016, 0x0dd7b2a2 +0, 4107600, 38016, 0x70c00c4f +0, 4111200, 38016, 0x437e255e +0, 4114800, 38016, 0x63dd455b +0, 4118400, 38016, 0x01453a2e +0, 4122000, 38016, 0x08c120af +0, 4125600, 38016, 0xf3111451 +0, 4129200, 38016, 0xf3f10603 +0, 4132800, 38016, 0xb154fa41 +0, 4136400, 38016, 0x4734ee73 +0, 4140000, 38016, 0x28ca7926 +0, 4143600, 38016, 0xbb628234 +0, 4147200, 38016, 0x0ca1b42f +0, 4150800, 38016, 0x8397b202 +0, 4154400, 38016, 0x9d92b832 +0, 4158000, 38016, 0x8fbeb4b2 +0, 4161600, 38016, 0x056aa904 +0, 4165200, 38016, 0x4e78a55c +0, 4168800, 38016, 0xe8a8a265 +0, 4172400, 38016, 0xb703a17b +0, 4176000, 38016, 0xe79e9d71 +0, 4179600, 38016, 0xbd769f5d +0, 4183200, 38016, 0x602ea70f +0, 4186800, 38016, 0x034caf76 +0, 4190400, 38016, 0x28dd9702 +0, 4194000, 38016, 0xc8879c85 +0, 4197600, 38016, 0x15b098f2 +0, 4201200, 38016, 0xf34b9ce5 +0, 4204800, 38016, 0x6d159fbf +0, 4208400, 38016, 0x22eb9cac +0, 4212000, 38016, 0xae42a220 +0, 4215600, 38016, 0x1275a131 +0, 4219200, 38016, 0x8188a057 +0, 4222800, 38016, 0x65dea0d1 +0, 4226400, 38016, 0x5bd19be2 +0, 4230000, 38016, 0xfbd99219 +0, 4233600, 38016, 0xad19b3a2 +0, 4237200, 38016, 0xa897bb92 +0, 4240800, 38016, 0x5b1fbf2e +0, 4244400, 38016, 0x02a5cb24 +0, 4248000, 38016, 0xd6ead6fe +0, 4251600, 38016, 0x3083de8a +0, 4255200, 38016, 0xbf1decb4 +0, 4258800, 38016, 0xd92af986 +0, 4262400, 38016, 0x4c520154 +0, 4266000, 38016, 0xd45805a1 +0, 4269600, 38016, 0x25e2084d +0, 4273200, 38016, 0x4e3d0960 +0, 4276800, 38016, 0x5b449ef2 +0, 4280400, 38016, 0xda15abcc +0, 4284000, 38016, 0x1b3ba622 +0, 4287600, 38016, 0xaf61a32a +0, 4291200, 38016, 0xcfa39e3d +0, 4294800, 38016, 0x8865a56c +0, 4298400, 38016, 0x3bc9af9b +0, 4302000, 38016, 0x0a83c081 +0, 4305600, 38016, 0x5ccec976 +0, 4309200, 38016, 0x1f1fc906 +0, 4312800, 38016, 0x1ef6cc46 +0, 4316400, 38016, 0x7776c39e +0, 4320000, 38016, 0x5860a212 +0, 4323600, 38016, 0x2d9092a3 +0, 4327200, 38016, 0x964d9f81 +0, 4330800, 38016, 0xc35c9691 +0, 4334400, 38016, 0x5e0dc673 +0, 4338000, 38016, 0xada3b7d6 +0, 4341600, 38016, 0x4f3a8d03 +0, 4345200, 38016, 0xfcb4861a +0, 4348800, 38016, 0xfa908149 +0, 4352400, 38016, 0x6994c514 +0, 4356000, 38016, 0x37c5aaa9 +0, 4359600, 38016, 0x207abcfe +0, 4363200, 38016, 0x778d7a2d +0, 4366800, 38016, 0x60b773ff +0, 4370400, 38016, 0x41cd67d5 +0, 4374000, 38016, 0x3c595a99 +0, 4377600, 38016, 0xd672b14c +0, 4381200, 38016, 0x7db2c0fd +0, 4384800, 38016, 0x3d21cf34 +0, 4388400, 38016, 0xdd1cf044 +0, 4392000, 38016, 0xc4594bcb +0, 4395600, 38016, 0x595e4356 +0, 4399200, 38016, 0x9cc53c0d +0, 4402800, 38016, 0x78fc325f +0, 4406400, 38016, 0xc632324f +0, 4410000, 38016, 0x18b1f5c1 +0, 4413600, 38016, 0x63aff55e +0, 4417200, 38016, 0x8a50fb04 +0, 4420800, 38016, 0x7d5e20f6 +0, 4424400, 38016, 0xc31114bb +0, 4428000, 38016, 0xf4852e6e +0, 4431600, 38016, 0x9b6927ba +0, 4435200, 38016, 0x024836c2 +0, 4438800, 38016, 0x20843b21 +0, 4442400, 38016, 0x19134055 +0, 4446000, 38016, 0x1cd843f7 +0, 4449600, 38016, 0x122705b1 +0, 4453200, 38016, 0x1880fc3d +0, 4456800, 38016, 0x78dbfeaf +0, 4460400, 38016, 0x212c273d +0, 4464000, 38016, 0xff2eb7be +0, 4467600, 38016, 0xe0bd752d +0, 4471200, 38016, 0x277b478a +0, 4474800, 38016, 0x59e84ab2 +0, 4478400, 38016, 0x338a50e4 +0, 4482000, 38016, 0xaf715a99 +0, 4485600, 38016, 0xd1e459a8 +0, 4489200, 38016, 0x70da4ac9 +0, 4492800, 38016, 0xa695540d +0, 4496400, 38016, 0x9385320b +0, 4500000, 38016, 0x9a8703cd +0, 4503600, 38016, 0xbeda239e +0, 4507200, 38016, 0x5bf262c1 +0, 4510800, 38016, 0x9b216899 +0, 4514400, 38016, 0x52f24135 +0, 4518000, 38016, 0x75a23955 +0, 4521600, 38016, 0xb92f4ea2 +0, 4525200, 38016, 0xdac95333 +0, 4528800, 38016, 0x1a2d4ed4 +0, 4532400, 38016, 0xfce25650 +0, 4536000, 38016, 0x1e264fdd +0, 4539600, 38016, 0xe77349b8 +0, 4543200, 38016, 0x7d2046b0 +0, 4546800, 38016, 0x65373899 +0, 4550400, 38016, 0x3b3569ae +0, 4554000, 38016, 0x346485d0 +0, 4557600, 38016, 0x80b93e57 +0, 4561200, 38016, 0xeb724ba5 +0, 4564800, 38016, 0x533d7459 +0, 4568400, 38016, 0x60f957a7 +0, 4572000, 38016, 0x900281b2 +0, 4575600, 38016, 0xf4489e06 +0, 4579200, 38016, 0xe77730c9 +0, 4582800, 38016, 0x41b23060 +0, 4586400, 38016, 0x4e8c3012 +0, 4590000, 38016, 0x651f2cff +0, 4593600, 38016, 0x787b2e99 +0, 4597200, 38016, 0x541e2d10 +0, 4600800, 38016, 0x27a824a3 +0, 4604400, 38016, 0xe1e72121 +0, 4608000, 38016, 0xffb52626 +0, 4611600, 38016, 0x7677c8c9 +0, 4615200, 38016, 0xa501d38f +0, 4618800, 38016, 0xa6d2c5dc +0, 4622400, 38016, 0xba94d1c1 +0, 4626000, 38016, 0x137dac4d +0, 4629600, 38016, 0x65c1bd6e +0, 4633200, 38016, 0x7a32cd65 +0, 4636800, 38016, 0x518adf61 +0, 4640400, 38016, 0x8baaee58 +0, 4644000, 38016, 0xe7642712 +0, 4647600, 38016, 0xba191b45 +0, 4651200, 38016, 0x93dd16b1 +0, 4654800, 38016, 0x22831478 +0, 4658400, 38016, 0xe48c103a +0, 4662000, 38016, 0x7c2709e7 +0, 4665600, 38016, 0xd7d8f454 +0, 4669200, 38016, 0xc504f31a +0, 4672800, 38016, 0x2510e4ae +0, 4676400, 38016, 0x0b56d119 +0, 4680000, 38016, 0x6c248150 +0, 4683600, 38016, 0xbac4be42 +0, 4687200, 38016, 0x5787c4a8 +0, 4690800, 38016, 0x65b3d0bd +0, 4694400, 38016, 0xdcc4efbd +0, 4698000, 38016, 0xfe92f78b +0, 4701600, 38016, 0xfda60c1c +0, 4705200, 38016, 0x4997238e +0, 4708800, 38016, 0xfaca43ca +0, 4712400, 38016, 0x81fe533c +0, 4716000, 38016, 0x350bcb11 +0, 4719600, 38016, 0xacfdcde4 +0, 4723200, 38016, 0xb039c663 +0, 4726800, 38016, 0x3402c942 +0, 4730400, 38016, 0x388bc3d0 +0, 4734000, 38016, 0x85dec11a +0, 4737600, 38016, 0xdfc2be86 +0, 4741200, 38016, 0x515cc1a9 +0, 4744800, 38016, 0xc7ddb990 +0, 4748400, 38016, 0x043fb332 +0, 4752000, 38016, 0x5b05b3a7 +0, 4755600, 38016, 0xacdf9836 +0, 4759200, 38016, 0x55079a49 +0, 4762800, 38016, 0x5de2d90d +0, 4766400, 38016, 0x7f9deb52 +0, 4770000, 38016, 0x83ddc6d9 +0, 4773600, 38016, 0x77ecdc93 +0, 4777200, 38016, 0x745fe832 +0, 4780800, 38016, 0x920bf8e7 +0, 4784400, 38016, 0xd9fc1803 +0, 4788000, 38016, 0x06c13052 +0, 4791600, 38016, 0x4a962b49 +0, 4795200, 38016, 0xd4a7b571 +0, 4798800, 38016, 0xdb76bd1e +0, 4802400, 38016, 0x11a4be41 +0, 4806000, 38016, 0x575eb740 +0, 4809600, 38016, 0x7f11bb5c +0, 4813200, 38016, 0x0f97b9b5 +0, 4816800, 38016, 0xa421bc1e +0, 4820400, 38016, 0x2510bda8 +0, 4824000, 38016, 0x5ec1c3c2 +0, 4827600, 38016, 0xab02c212 +0, 4831200, 38016, 0x7862c24a +0, 4834800, 38016, 0x3654c47c +0, 4838400, 38016, 0x6e4f3fd5 +0, 4842000, 38016, 0x77b54c6f +0, 4845600, 38016, 0x51016691 +0, 4849200, 38016, 0x5c2e7a7a +0, 4852800, 38016, 0x29aea461 +0, 4856400, 38016, 0x8f4397b1 +0, 4860000, 38016, 0x8af41dba +0, 4863600, 38016, 0x4c1154ca +0, 4867200, 38016, 0xe23e6e91 +0, 4870800, 38016, 0xd0617571 +0, 4874400, 38016, 0x2ab88348 +0, 4878000, 38016, 0x8bf1a109 +0, 4881600, 38016, 0xfdd4c390 +0, 4885200, 38016, 0x17b8c6bf +0, 4888800, 38016, 0xa012bd5d +0, 4892400, 38016, 0x4c16cee2 +0, 4896000, 38016, 0x739fcfae +0, 4899600, 38016, 0x3edae498 +0, 4903200, 38016, 0x0d38e4ad +0, 4906800, 38016, 0x896cea10 +0, 4910400, 38016, 0x13a0f1a9 +0, 4914000, 38016, 0xfe70eeb4 +0, 4917600, 38016, 0x540bf40e +0, 4921200, 38016, 0xee20f65e +0, 4924800, 38016, 0x8404fdf7 +0, 4928400, 38016, 0x1c71b182 +0, 4932000, 38016, 0x96e4c5cc +0, 4935600, 38016, 0x6aa1dcf1 +0, 4939200, 38016, 0x4549ed9b +0, 4942800, 38016, 0xd50bffba +0, 4946400, 38016, 0x22701379 +0, 4950000, 38016, 0x19462a6b +0, 4953600, 38016, 0x4f6b41e0 +0, 4957200, 38016, 0x9d344fcc +0, 4960800, 38016, 0x60625fa9 +0, 4964400, 38016, 0xeb377eae +0, 4968000, 38016, 0x0d9f945d +0, 4971600, 38016, 0x4d0fb1dc +0, 4975200, 38016, 0x0b580421 +0, 4978800, 38016, 0x30f3191a +0, 4982400, 38016, 0xc5f7295c +0, 4986000, 38016, 0xc4ad35e9 +0, 4989600, 38016, 0x25964387 +0, 4993200, 38016, 0x3a805820 +0, 4996800, 38016, 0x67e26985 +0, 5000400, 38016, 0x518f7941 +0, 5004000, 38016, 0x2a7982e1 +0, 5007600, 38016, 0x54aa84f0 +0, 5011200, 38016, 0x3d808f45 +0, 5014800, 38016, 0x5dae923c +0, 5018400, 38016, 0xa2a99ccf +0, 5022000, 38016, 0xefdd9a77 +0, 5025600, 38016, 0x246fcfa5 +0, 5029200, 38016, 0xe315cbcd +0, 5032800, 38016, 0x4825df58 +0, 5036400, 38016, 0x0e241554 +0, 5040000, 38016, 0x968d8433 +0, 5043600, 38016, 0x97eec628 +0, 5047200, 38016, 0x7c4cb603 +0, 5050800, 38016, 0x6d11e7bf +0, 5054400, 38016, 0xae041b61 +0, 5058000, 38016, 0x385e040c +0, 5061600, 38016, 0x449e357a +0, 5065200, 38016, 0x997f4aac +0, 5068800, 38016, 0xd68c4f8b +0, 5072400, 38016, 0xb3b962eb +0, 5076000, 38016, 0x4685adc2 +0, 5079600, 38016, 0xed0d7473 +0, 5083200, 38016, 0xd069c0bb +0, 5086800, 38016, 0x76abcd8e +0, 5090400, 38016, 0xd6c096da +0, 5094000, 38016, 0x76c2bab5 +0, 5097600, 38016, 0x1461dfb3 +0, 5101200, 38016, 0xf979f59f +0, 5104800, 38016, 0x0554f985 +0, 5108400, 38016, 0x11c6d2a3 +0, 5112000, 38016, 0xe6e3faee +0, 5115600, 38016, 0x6ceafbcc +0, 5119200, 38016, 0x429b02e1 +0, 5122800, 38016, 0x97bd03f1 +0, 5126400, 38016, 0x78330c48 +0, 5130000, 38016, 0xb2720325 +0, 5133600, 38016, 0x26d412ab +0, 5137200, 38016, 0xb6fb1b5c +0, 5140800, 38016, 0xde8d300a +0, 5144400, 38016, 0x7d28450e +0, 5148000, 38016, 0xb3c5fbef +0, 5151600, 38016, 0x2222f726 +0, 5155200, 38016, 0x66f7f42f +0, 5158800, 38016, 0xef8af722 +0, 5162400, 38016, 0x4ac0f8d7 +0, 5166000, 38016, 0x5bfe5c81 +0, 5169600, 38016, 0x4afb6df9 +0, 5173200, 38016, 0xa8128a37 +0, 5176800, 38016, 0x1fc79ed0 +0, 5180400, 38016, 0x9967a997 +0, 5184000, 38016, 0x7bb5f6e1 +0, 5187600, 38016, 0xdda90122 +0, 5191200, 38016, 0x81700c1a +0, 5194800, 38016, 0x9e121e77 +0, 5198400, 38016, 0xf58926a3 +0, 5202000, 38016, 0x4d1431a4 +0, 5205600, 38016, 0x0de6e741 +0, 5209200, 38016, 0x3ae9f601 +0, 5212800, 38016, 0xbed2e950 +0, 5216400, 38016, 0x619f100d +0, 5220000, 38016, 0x6fa4a4e2 +0, 5223600, 38016, 0x316cddcd +0, 5227200, 38016, 0x03132791 +0, 5230800, 38016, 0x10122784 +0, 5234400, 38016, 0x0e732980 +0, 5238000, 38016, 0x382d26f9 +0, 5241600, 38016, 0x651028fd +0, 5245200, 38016, 0x61732850 +0, 5248800, 38016, 0x47912dde +0, 5252400, 38016, 0xe3a12fdc +0, 5256000, 38016, 0x8bc332ff +0, 5259600, 38016, 0xcc3a3cdc +0, 5263200, 38016, 0x190e2fec +0, 5266800, 38016, 0x236c3291 +0, 5270400, 38016, 0xc0e55dd3 +0, 5274000, 38016, 0x06c85411 +0, 5277600, 38016, 0x0c0b3091 +0, 5281200, 38016, 0x8c1333cd +0, 5284800, 38016, 0x51b339a5 +0, 5288400, 38016, 0x2d5b33ef +0, 5292000, 38016, 0x73f0395b +0, 5295600, 38016, 0x505b42d3 +0, 5299200, 38016, 0x56e44c7f +0, 5302800, 38016, 0x26465781 +0, 5306400, 38016, 0x1d14800d +0, 5310000, 38016, 0x752cb297 +0, 5313600, 38016, 0x0c3ab720 +0, 5317200, 38016, 0x21c2f136 +0, 5320800, 38016, 0xbae8b293 +0, 5324400, 38016, 0xe4b2fe9b +0, 5328000, 38016, 0xfaaf0394 +0, 5331600, 38016, 0xa6f61d4b +0, 5335200, 38016, 0x0e205192 +0, 5338800, 38016, 0x9b3c5c1f +0, 5342400, 38016, 0x3b93552f +0, 5346000, 38016, 0xe56e5b54 +0, 5349600, 38016, 0xa1c26095 +0, 5353200, 38016, 0x1eb66e41 +0, 5356800, 38016, 0x83eb6e83 +0, 5360400, 38016, 0xc8a979d3 +0, 5364000, 38016, 0x81fb7b32 +0, 5367600, 38016, 0xe07928b7 +0, 5371200, 38016, 0x38591267 +0, 5374800, 38016, 0xce563165 +0, 5378400, 38016, 0x5fec3563 +0, 5382000, 38016, 0xd7402c7c +0, 5385600, 38016, 0xf2a93af4 +0, 5389200, 38016, 0x78f22fe7 +0, 5392800, 38016, 0x25554875 +0, 5396400, 38016, 0x79546ca2 +0, 5400000, 38016, 0xdae2814a +0, 5403600, 38016, 0xf1ef9a9e +0, 5407200, 38016, 0xb76d8b83 +0, 5410800, 38016, 0x1abf8fa8 +0, 5414400, 38016, 0x8f098fa4 +0, 5418000, 38016, 0xb098843c +0, 5421600, 38016, 0x1d5186d3 +0, 5425200, 38016, 0x93f4923c +0, 5428800, 38016, 0x496094e2 +0, 5432400, 38016, 0x7aea93f1 +0, 5436000, 38016, 0x556c6675 +0, 5439600, 38016, 0x90566aca +0, 5443200, 38016, 0x14899a93 +0, 5446800, 38016, 0xd269e0e7 +0, 5450400, 38016, 0x1261d2cc +0, 5454000, 38016, 0x299c9301 +0, 5457600, 38016, 0xee9c9ba5 +0, 5461200, 38016, 0xb48ab676 +0, 5464800, 38016, 0x4ef9b1c5 +0, 5468400, 38016, 0x8aae9912 +0, 5472000, 38016, 0x1bc09f53 +0, 5475600, 38016, 0x2e089c6b +0, 5479200, 38016, 0x67598f8d +0, 5482800, 38016, 0xacd394e1 +0, 5486400, 38016, 0xe2979b75 +0, 5490000, 38016, 0xb9749ff9 +0, 5493600, 38016, 0x02bda2f0 +0, 5497200, 38016, 0xe6caa499 +0, 5500800, 38016, 0xc6d9a547 +0, 5504400, 38016, 0x1c89aa34 +0, 5508000, 38016, 0x61feb4fc +0, 5511600, 38016, 0x2a40b1f4 +0, 5515200, 38016, 0x4ad3ac08 +0, 5518800, 38016, 0xf5e8b06d +0, 5522400, 38016, 0xb0eea800 +0, 5526000, 38016, 0x430cc535 +0, 5529600, 38016, 0x8e66b9cf +0, 5533200, 38016, 0x5c68b4c4 +0, 5536800, 38016, 0x9381c64b +0, 5540400, 38016, 0x4234bed7 +0, 5544000, 38016, 0xce72bf02 +0, 5547600, 38016, 0xb8cfbcd7 +0, 5551200, 38016, 0x75a5b1bd +0, 5554800, 38016, 0xc27fb9eb +0, 5558400, 38016, 0xa1b1bc62 +0, 5562000, 38016, 0x1cdeb0a3 +0, 5565600, 38016, 0xaea6a799 +0, 5569200, 38016, 0x8152ac4f +0, 5572800, 38016, 0x59c1a66d +0, 5576400, 38016, 0x6bd99f24 +0, 5580000, 38016, 0x96a73236 +0, 5583600, 38016, 0xb27e4856 +0, 5587200, 38016, 0x8b57447a +0, 5590800, 38016, 0xcef84a21 +0, 5594400, 38016, 0x5babc7cc +0, 5598000, 38016, 0x6ed2cec3 +0, 5601600, 38016, 0xa2efdc17 +0, 5605200, 38016, 0x47bad971 +0, 5608800, 38016, 0x150dffd4 +0, 5612400, 38016, 0x3ecef2ad +0, 5616000, 38016, 0x355cdade +0, 5619600, 38016, 0x3b15e809 +0, 5623200, 38016, 0x37fcf890 +0, 5626800, 38016, 0x8ca606d1 +0, 5630400, 38016, 0x51cafefe +0, 5634000, 38016, 0x736be64a +0, 5637600, 38016, 0x4f2052c1 +0, 5641200, 38016, 0xc6715e93 +0, 5644800, 38016, 0x765c5a58 +0, 5648400, 38016, 0x5abe5617 +0, 5652000, 38016, 0xb1ac540a +0, 5655600, 38016, 0xd9f75c21 +0, 5659200, 38016, 0x0c1946c0 +0, 5662800, 38016, 0x93363a34 +0, 5666400, 38016, 0x2c9f2fe4 +0, 5670000, 38016, 0x023c321a +0, 5673600, 38016, 0x1931314b +0, 5677200, 38016, 0x16782d59 +0, 5680800, 38016, 0x29aa289f +0, 5684400, 38016, 0xea0ddb85 +0, 5688000, 38016, 0xe09ae656 +0, 5691600, 38016, 0x682ff29f +0, 5695200, 38016, 0xf3ac29ca +0, 5698800, 38016, 0x95160cad +0, 5702400, 38016, 0x9afa093c +0, 5706000, 38016, 0x2ad30958 +0, 5709600, 38016, 0x4b600e3a +0, 5713200, 38016, 0x5b0e099b +0, 5716800, 38016, 0x2d2aff9b +0, 5720400, 38016, 0x8bb10aa6 +0, 5724000, 38016, 0xfebe1f1d +0, 5727600, 38016, 0xa4431abd +0, 5731200, 38016, 0xef7729a6 +0, 5734800, 38016, 0x7b5b1f78 +0, 5738400, 38016, 0x903b203e +0, 5742000, 38016, 0xbcc716a2 +0, 5745600, 38016, 0xee6c1f4c +0, 5749200, 38016, 0xc78c2ab8 +0, 5752800, 38016, 0xa77a255a +0, 5756400, 38016, 0x9d5815fc +0, 5760000, 38016, 0x7d5e7d79 +0, 5763600, 38016, 0xf7989072 +0, 5767200, 38016, 0x45499feb +0, 5770800, 38016, 0xc58aae7b +0, 5774400, 38016, 0x882aa1cb +0, 5778000, 38016, 0x56cd97bf +0, 5781600, 38016, 0x2d6af920 +0, 5785200, 38016, 0x43c312eb +0, 5788800, 38016, 0x12872b9f +0, 5792400, 38016, 0x3c623ffe +0, 5796000, 38016, 0x120e302d +0, 5799600, 38016, 0x9cb43964 +0, 5803200, 38016, 0xb371311c +0, 5806800, 38016, 0x28b523d4 +0, 5810400, 38016, 0x58031bff +0, 5814000, 38016, 0xe6691818 +0, 5817600, 38016, 0x6a9b29c3 +0, 5821200, 38016, 0x794b25ce +0, 5824800, 38016, 0xfc273119 +0, 5828400, 38016, 0x82ad2a3a +0, 5832000, 38016, 0x9d2da281 +0, 5835600, 38016, 0x11271ba1 +0, 5839200, 38016, 0x1558b618 +0, 5842800, 38016, 0xf5d8c22f +0, 5846400, 38016, 0xf20214f9 +0, 5850000, 38016, 0x15b01f3a +0, 5853600, 38016, 0x68f2b533 +0, 5857200, 38016, 0x9686a827 +0, 5860800, 38016, 0xf214a2dc +0, 5864400, 38016, 0x3d421eb0 +0, 5868000, 38016, 0x78251e60 +0, 5871600, 38016, 0xab092856 +0, 5875200, 38016, 0x5eaba7bc +0, 5878800, 38016, 0x612fb699 +0, 5882400, 38016, 0x8a83a3fd +0, 5886000, 38016, 0xbcd9919b +0, 5889600, 38016, 0xb9063049 +0, 5893200, 38016, 0x5cb22fde +0, 5896800, 38016, 0x7db92390 +0, 5900400, 38016, 0x801b241b +0, 5904000, 38016, 0x6eeb8e1b +0, 5907600, 38016, 0x660b9568 +0, 5911200, 38016, 0x2a5b8b3d +0, 5914800, 38016, 0x15098b9a +0, 5918400, 38016, 0xd29284f5 +0, 5922000, 38016, 0x839323c6 +0, 5925600, 38016, 0xd6a4212c +0, 5929200, 38016, 0x1c1c2259 +0, 5932800, 38016, 0x0b1d2ef2 +0, 5936400, 38016, 0xecd52cfc +0, 5940000, 38016, 0x419326cb +0, 5943600, 38016, 0xea813e68 +0, 5947200, 38016, 0xba9a33ba +0, 5950800, 38016, 0x703b3b25 +0, 5954400, 38016, 0x391c3cce +0, 5958000, 38016, 0xd1533fe3 +0, 5961600, 38016, 0xb9361f10 +0, 5965200, 38016, 0x8d652ea6 +0, 5968800, 38016, 0x22dc15ae +0, 5972400, 38016, 0x2e5e0ee7 +0, 5976000, 38016, 0xd6bd15cf +0, 5979600, 38016, 0xb16f198a +0, 5983200, 38016, 0xd9653e95 +0, 5986800, 38016, 0x39da2e3a +0, 5990400, 38016, 0x01b12526 +0, 5994000, 38016, 0x94a52dde +0, 5997600, 38016, 0xda0c32d8 +0, 6001200, 38016, 0x89af2566 +0, 6004800, 38016, 0x71961a43 +0, 6008400, 38016, 0x5fb91337 +0, 6012000, 38016, 0x6e430a84 +0, 6015600, 38016, 0x1defffb2 +0, 6019200, 38016, 0xcc93023f +0, 6022800, 38016, 0xfcd60168 +0, 6026400, 38016, 0x8a3201d4 +0, 6030000, 38016, 0x5235fef3 +0, 6033600, 38016, 0x989121b9 +0, 6037200, 38016, 0x067a1d36 +0, 6040800, 38016, 0xa168242b +0, 6044400, 38016, 0x425f2475 +0, 6048000, 38016, 0x298f14d9 +0, 6051600, 38016, 0x3a7c1838 +0, 6055200, 38016, 0xd173155a +0, 6058800, 38016, 0x210113ec +0, 6062400, 38016, 0xa0c2f88f +0, 6066000, 38016, 0x4fa1f4e2 +0, 6069600, 38016, 0x812df750 +0, 6073200, 38016, 0xfd5cea45 +0, 6076800, 38016, 0xb823ee4a +0, 6080400, 38016, 0x3555d6bf +0, 6084000, 38016, 0x6dabf021 +0, 6087600, 38016, 0x7ae0f191 +0, 6091200, 38016, 0xabdc1546 +0, 6094800, 38016, 0x36dd0dbb +0, 6098400, 38016, 0x008ffe5f +0, 6102000, 38016, 0xe956f9c0 +0, 6105600, 38016, 0x9823ee03 +0, 6109200, 38016, 0xf63fedde +0, 6112800, 38016, 0x67530afb +0, 6116400, 38016, 0x2da5e470 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-midr_mw_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-midr_mw_d new file mode 100644 index 00000000..afffdc85 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-midr_mw_d @@ -0,0 +1,100 @@ +0, 0, 38016, 0x3ae838ee +0, 3600, 38016, 0x9ed7e141 +0, 7200, 38016, 0x393097f9 +0, 10800, 38016, 0x8fb56676 +0, 14400, 38016, 0x39d64fd2 +0, 18000, 38016, 0x7fad729a +0, 21600, 38016, 0x7e25955f +0, 25200, 38016, 0xc4d9a359 +0, 28800, 38016, 0x30afaca4 +0, 32400, 38016, 0x9ee195ea +0, 36000, 38016, 0x09f65805 +0, 39600, 38016, 0x58d126ab +0, 43200, 38016, 0x4f29282c +0, 46800, 38016, 0x8af235a1 +0, 50400, 38016, 0x6dfe525a +0, 54000, 38016, 0xd51c793f +0, 57600, 38016, 0x4e90abba +0, 61200, 38016, 0xe706c5b7 +0, 64800, 38016, 0x35fab7ef +0, 68400, 38016, 0xed78b8fc +0, 72000, 38016, 0x2907bb4e +0, 75600, 38016, 0x1749bb47 +0, 79200, 38016, 0x284ec688 +0, 82800, 38016, 0x534abc24 +0, 86400, 38016, 0xcd01bd13 +0, 90000, 38016, 0xe97bbd51 +0, 93600, 38016, 0xac1cb9e9 +0, 97200, 38016, 0xd861c0a3 +0, 100800, 38016, 0xf0f1ced4 +0, 104400, 38016, 0xa9e8d2bf +0, 108000, 38016, 0x4c6aa7c5 +0, 111600, 38016, 0xb20079ac +0, 115200, 38016, 0xbfc3563b +0, 118800, 38016, 0x48259358 +0, 122400, 38016, 0x1bce0434 +0, 126000, 38016, 0xa0ac59db +0, 129600, 38016, 0x87bdb608 +0, 133200, 38016, 0x318037eb +0, 136800, 38016, 0x0f7d8496 +0, 140400, 38016, 0x9e65bc1e +0, 144000, 38016, 0xc56be1ea +0, 147600, 38016, 0xc31fefb7 +0, 151200, 38016, 0xcbcee4e4 +0, 154800, 38016, 0xcf03f238 +0, 158400, 38016, 0xc6a903a1 +0, 162000, 38016, 0xfdabee4f +0, 165600, 38016, 0x9054bb39 +0, 169200, 38016, 0xe9bf8cd8 +0, 172800, 38016, 0x943d9e0a +0, 176400, 38016, 0x404cc87d +0, 180000, 38016, 0x3cd9dd49 +0, 183600, 38016, 0x5eabbdf1 +0, 187200, 38016, 0xd206d9ef +0, 190800, 38016, 0x75e310ad +0, 194400, 38016, 0x01893e25 +0, 198000, 38016, 0xda5360e6 +0, 201600, 38016, 0x80656a39 +0, 205200, 38016, 0x85452c84 +0, 208800, 38016, 0x48d92ef7 +0, 212400, 38016, 0x0edc45b2 +0, 216000, 38016, 0xeb8a3531 +0, 219600, 38016, 0x7b5914b5 +0, 223200, 38016, 0xf1b6c7fa +0, 226800, 38016, 0x68fca853 +0, 230400, 38016, 0x68ebcc02 +0, 234000, 38016, 0x793edc8e +0, 237600, 38016, 0x9c86d139 +0, 241200, 38016, 0x2aeed2f9 +0, 244800, 38016, 0xb8cfc89d +0, 248400, 38016, 0x22d2b5c4 +0, 252000, 38016, 0x01ae9d2d +0, 255600, 38016, 0x4e9b7c84 +0, 259200, 38016, 0xa52c8553 +0, 262800, 38016, 0x50df78d0 +0, 266400, 38016, 0x4dc31f1c +0, 270000, 38016, 0xf24ee29a +0, 273600, 38016, 0xced0d363 +0, 277200, 38016, 0x2263bfdc +0, 280800, 38016, 0x1363f580 +0, 284400, 38016, 0xfc7f3a50 +0, 288000, 38016, 0x38427007 +0, 291600, 38016, 0xfc5757eb +0, 295200, 38016, 0xf20f4d0b +0, 298800, 38016, 0x64871ca3 +0, 302400, 38016, 0xcb66cd99 +0, 306000, 38016, 0xaacdda1f +0, 309600, 38016, 0xd52206c8 +0, 313200, 38016, 0xcb461142 +0, 316800, 38016, 0x9e36a3b3 +0, 320400, 38016, 0xf3b44a7c +0, 324000, 38016, 0x1722db32 +0, 327600, 38016, 0xa943d602 +0, 331200, 38016, 0xc899e7bf +0, 334800, 38016, 0xacd10bdc +0, 338400, 38016, 0x703b3802 +0, 342000, 38016, 0xe246efb4 +0, 345600, 38016, 0x1ebfccb2 +0, 349200, 38016, 0x57380778 +0, 352800, 38016, 0xb70e7313 +0, 356400, 38016, 0x0cd4af3d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mps_mw_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mps_mw_a new file mode 100644 index 00000000..47e7feb3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mps_mw_a @@ -0,0 +1,150 @@ +0, 0, 38016, 0x06150e88 +0, 3600, 38016, 0x32d90103 +0, 7200, 38016, 0x5b5f2fae +0, 10800, 38016, 0xba6e6302 +0, 14400, 38016, 0x6c4b8e95 +0, 18000, 38016, 0x6d51ab43 +0, 21600, 38016, 0x5582a7c5 +0, 25200, 38016, 0xf48e6545 +0, 28800, 38016, 0x083a8481 +0, 32400, 38016, 0x0576a254 +0, 36000, 38016, 0x07429a61 +0, 39600, 38016, 0xd1e26eb1 +0, 43200, 38016, 0x94032564 +0, 46800, 38016, 0xc9d217c0 +0, 50400, 38016, 0xf0ee3f46 +0, 54000, 38016, 0xe8fc4d97 +0, 57600, 38016, 0xd3b0488d +0, 61200, 38016, 0xc4243d99 +0, 64800, 38016, 0xa65b36ed +0, 68400, 38016, 0x84ca1844 +0, 72000, 38016, 0xcd6706bf +0, 75600, 38016, 0x1c03ec0a +0, 79200, 38016, 0xf1380127 +0, 82800, 38016, 0xa499e0a5 +0, 86400, 38016, 0x5fca87ce +0, 90000, 38016, 0x0b385064 +0, 93600, 38016, 0x6a4f49c4 +0, 97200, 38016, 0x97e0464b +0, 100800, 38016, 0xcbf98750 +0, 104400, 38016, 0xa9efe0cd +0, 108000, 38016, 0x9ea7d82e +0, 111600, 38016, 0x28cec5ce +0, 115200, 38016, 0xaec6ac1e +0, 118800, 38016, 0x8cba69b3 +0, 122400, 38016, 0x727720c1 +0, 126000, 38016, 0xee4f4822 +0, 129600, 38016, 0x9d456e11 +0, 133200, 38016, 0x14123f91 +0, 136800, 38016, 0xf5e1d1a3 +0, 140400, 38016, 0xaadd9435 +0, 144000, 38016, 0x94df6e5e +0, 147600, 38016, 0x18805412 +0, 151200, 38016, 0x0ba26c8c +0, 154800, 38016, 0x4548a5c1 +0, 158400, 38016, 0x9217cb5f +0, 162000, 38016, 0x2ea74a9e +0, 165600, 38016, 0xeb0c57b6 +0, 169200, 38016, 0xf968a4a5 +0, 172800, 38016, 0xa410ef43 +0, 176400, 38016, 0x55813001 +0, 180000, 38016, 0x9cea4512 +0, 183600, 38016, 0x27754fa6 +0, 187200, 38016, 0x9824548a +0, 190800, 38016, 0x7f1047eb +0, 194400, 38016, 0x75fb2e10 +0, 198000, 38016, 0xe50df970 +0, 201600, 38016, 0x6ed6dfb4 +0, 205200, 38016, 0x8e97ccee +0, 208800, 38016, 0x7f96c5f0 +0, 212400, 38016, 0x0940c200 +0, 216000, 38016, 0x86b98701 +0, 219600, 38016, 0x977d759a +0, 223200, 38016, 0xf2b17bff +0, 226800, 38016, 0xee1496d7 +0, 230400, 38016, 0x6cb1c1b5 +0, 234000, 38016, 0xa6bc0db9 +0, 237600, 38016, 0x902f660d +0, 241200, 38016, 0x7bf7a434 +0, 244800, 38016, 0x97f9c2a6 +0, 248400, 38016, 0xf8bf9241 +0, 252000, 38016, 0x8639502b +0, 255600, 38016, 0x82c2537f +0, 259200, 38016, 0x1141243a +0, 262800, 38016, 0xcaef5ae5 +0, 266400, 38016, 0xe2c4d308 +0, 270000, 38016, 0x35530a2c +0, 273600, 38016, 0x22a3b317 +0, 277200, 38016, 0xda988427 +0, 280800, 38016, 0x54616f11 +0, 284400, 38016, 0xc38fc57c +0, 288000, 38016, 0x7039d019 +0, 291600, 38016, 0x0fd6e6d9 +0, 295200, 38016, 0xc213e48e +0, 298800, 38016, 0xf469b8e1 +0, 302400, 38016, 0x1f5c706c +0, 306000, 38016, 0x69652db3 +0, 309600, 38016, 0xe1b9d46d +0, 313200, 38016, 0x4e7522aa +0, 316800, 38016, 0x8f4025a4 +0, 320400, 38016, 0xbc0483f6 +0, 324000, 38016, 0xae91d342 +0, 327600, 38016, 0xb1435578 +0, 331200, 38016, 0xf7535863 +0, 334800, 38016, 0xc16ff613 +0, 338400, 38016, 0x55bc394f +0, 342000, 38016, 0xc7b76458 +0, 345600, 38016, 0xd3fd69ae +0, 349200, 38016, 0x4b44d724 +0, 352800, 38016, 0x740b99c5 +0, 356400, 38016, 0x40c7c625 +0, 360000, 38016, 0x1691a7ef +0, 363600, 38016, 0x6ea9392e +0, 367200, 38016, 0xf958200f +0, 370800, 38016, 0x916d75eb +0, 374400, 38016, 0x6b4bee69 +0, 378000, 38016, 0x87adf9de +0, 381600, 38016, 0x92dc586e +0, 385200, 38016, 0x3c5aa531 +0, 388800, 38016, 0x00f81488 +0, 392400, 38016, 0x981aeb9f +0, 396000, 38016, 0x49cf8e5f +0, 399600, 38016, 0xfd56b231 +0, 403200, 38016, 0x419aaa2e +0, 406800, 38016, 0xae155602 +0, 410400, 38016, 0x1e530aa1 +0, 414000, 38016, 0x60ca2c1b +0, 417600, 38016, 0x0e7bdec7 +0, 421200, 38016, 0xe858b864 +0, 424800, 38016, 0x47378c1d +0, 428400, 38016, 0x90008a4d +0, 432000, 38016, 0xa1293af0 +0, 435600, 38016, 0x596964a8 +0, 439200, 38016, 0xb25d9ccf +0, 442800, 38016, 0xccdbb7a0 +0, 446400, 38016, 0x3becf25a +0, 450000, 38016, 0x918d1816 +0, 453600, 38016, 0x71d02564 +0, 457200, 38016, 0x643015fd +0, 460800, 38016, 0x3af5f577 +0, 464400, 38016, 0x77b5ecea +0, 468000, 38016, 0x7f940014 +0, 471600, 38016, 0x726f0bf3 +0, 475200, 38016, 0xb728078f +0, 478800, 38016, 0x46e1f70a +0, 482400, 38016, 0x79ccdd3e +0, 486000, 38016, 0x80d2ca75 +0, 489600, 38016, 0xc87dc034 +0, 493200, 38016, 0x7535c12a +0, 496800, 38016, 0x2d32bd77 +0, 500400, 38016, 0x2fceb360 +0, 504000, 38016, 0x8d0aa592 +0, 507600, 38016, 0xc9b9bb80 +0, 511200, 38016, 0xa667dd9c +0, 514800, 38016, 0x7b5df35b +0, 518400, 38016, 0x5feb1125 +0, 522000, 38016, 0x222a306f +0, 525600, 38016, 0x64c84c75 +0, 529200, 38016, 0x5e605c79 +0, 532800, 38016, 0x2d2f78f3 +0, 536400, 38016, 0x7b72973d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr1_bt_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr1_bt_a new file mode 100644 index 00000000..b077cd43 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr1_bt_a @@ -0,0 +1,62 @@ +0, 0, 38016, 0xc6658719 +0, 3600, 38016, 0x8a7c7423 +0, 7200, 38016, 0x97e99b66 +0, 10800, 38016, 0x73c4c4f7 +0, 14400, 38016, 0xb45bfb44 +0, 18000, 38016, 0x1bc3249c +0, 21600, 38016, 0xd98a3121 +0, 25200, 38016, 0x6f0aefc1 +0, 28800, 38016, 0x6287f651 +0, 32400, 38016, 0x2a4a1630 +0, 36000, 38016, 0x5e7b5a35 +0, 39600, 38016, 0x58847533 +0, 43200, 38016, 0x2bad942b +0, 46800, 38016, 0x17d75cb1 +0, 50400, 38016, 0x6d8e818d +0, 54000, 38016, 0xfa3165db +0, 57600, 38016, 0x6a6e249f +0, 61200, 38016, 0x2d232ece +0, 64800, 38016, 0xfba6616e +0, 68400, 38016, 0xa9e7533f +0, 72000, 38016, 0x7c4827e6 +0, 75600, 38016, 0xf570f8ca +0, 79200, 38016, 0x0dac953f +0, 82800, 38016, 0x74cb5f30 +0, 86400, 38016, 0x038ce61b +0, 90000, 38016, 0x291f8ecb +0, 93600, 38016, 0x768a6539 +0, 97200, 38016, 0x27a960e6 +0, 100800, 38016, 0x4d8ab279 +0, 104400, 38016, 0x7da78115 +0, 108000, 38016, 0x27beadcf +0, 111600, 38016, 0x98c43180 +0, 115200, 38016, 0x566d55db +0, 118800, 38016, 0xddc19fda +0, 122400, 38016, 0xe353c891 +0, 126000, 38016, 0x17e2e3ab +0, 129600, 38016, 0x8759e7c3 +0, 133200, 38016, 0x9d93bca9 +0, 136800, 38016, 0x8b77af4e +0, 140400, 38016, 0x9b799dac +0, 144000, 38016, 0xcb8bc504 +0, 147600, 38016, 0x58e989c8 +0, 151200, 38016, 0x4e4dbb7f +0, 154800, 38016, 0xdfa6934e +0, 158400, 38016, 0x14947459 +0, 162000, 38016, 0x7a31ff6a +0, 165600, 38016, 0xc044fbc3 +0, 169200, 38016, 0xcaa723d1 +0, 172800, 38016, 0x325c1dca +0, 176400, 38016, 0x62fb027d +0, 180000, 38016, 0x710f3ae9 +0, 183600, 38016, 0xdbbf1804 +0, 187200, 38016, 0x1487f491 +0, 190800, 38016, 0x6a722d73 +0, 194400, 38016, 0xeb7258dd +0, 198000, 38016, 0x685e8a68 +0, 201600, 38016, 0x1627800e +0, 205200, 38016, 0xa88a9a31 +0, 208800, 38016, 0x4d5eaf56 +0, 212400, 38016, 0xe3a9af0a +0, 216000, 38016, 0x3c38b8b2 +0, 219600, 38016, 0x991fc29e diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr1_mw_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr1_mw_a new file mode 100644 index 00000000..98f112cc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr1_mw_a @@ -0,0 +1,150 @@ +0, 0, 38016, 0xc8981780 +0, 3600, 38016, 0xf089d880 +0, 7200, 38016, 0x5eee0731 +0, 10800, 38016, 0x79604e7c +0, 14400, 38016, 0xb92186a9 +0, 18000, 38016, 0xe18ea8d9 +0, 21600, 38016, 0xedb599dd +0, 25200, 38016, 0xc2665a04 +0, 28800, 38016, 0x88387c78 +0, 32400, 38016, 0x70b09638 +0, 36000, 38016, 0xb5629ba8 +0, 39600, 38016, 0xc8ee696b +0, 43200, 38016, 0x9af12088 +0, 46800, 38016, 0x044f1510 +0, 50400, 38016, 0x04153fcc +0, 54000, 38016, 0x6a433225 +0, 57600, 38016, 0x8fb43d81 +0, 61200, 38016, 0x708c5884 +0, 64800, 38016, 0xb2fa310d +0, 68400, 38016, 0xa54f23bf +0, 72000, 38016, 0x875d12a9 +0, 75600, 38016, 0xa7c2f3e5 +0, 79200, 38016, 0xba120362 +0, 82800, 38016, 0xf922ead0 +0, 86400, 38016, 0x23c38ae4 +0, 90000, 38016, 0x8e705ad0 +0, 93600, 38016, 0x60854be9 +0, 97200, 38016, 0x63163fd9 +0, 100800, 38016, 0x6d5886bd +0, 104400, 38016, 0xd66fdaaa +0, 108000, 38016, 0xcda78bc1 +0, 111600, 38016, 0x7e11aa47 +0, 115200, 38016, 0x4ac4ceba +0, 118800, 38016, 0x80a45b77 +0, 122400, 38016, 0x6d1a19f9 +0, 126000, 38016, 0xd2b93d81 +0, 129600, 38016, 0x4532dc5a +0, 133200, 38016, 0x874c3d28 +0, 136800, 38016, 0xbeb4552c +0, 140400, 38016, 0xd85e8b6d +0, 144000, 38016, 0x4c3a6953 +0, 147600, 38016, 0xf8615235 +0, 151200, 38016, 0x9b3e613a +0, 154800, 38016, 0xfbba9dd5 +0, 158400, 38016, 0x435fbc73 +0, 162000, 38016, 0x15746d9d +0, 165600, 38016, 0xfc6c2960 +0, 169200, 38016, 0x80c41d21 +0, 172800, 38016, 0xa621c891 +0, 176400, 38016, 0x24ce0e8b +0, 180000, 38016, 0x15552d28 +0, 183600, 38016, 0xbc0b3703 +0, 187200, 38016, 0x81643dee +0, 190800, 38016, 0x479c42ea +0, 194400, 38016, 0x63d426db +0, 198000, 38016, 0x5830f8e4 +0, 201600, 38016, 0xce24d921 +0, 205200, 38016, 0x0224c7b9 +0, 208800, 38016, 0x8f44bf31 +0, 212400, 38016, 0xc3d5c00f +0, 216000, 38016, 0x13268498 +0, 219600, 38016, 0x83b99095 +0, 223200, 38016, 0xbb66a4b3 +0, 226800, 38016, 0x9b849565 +0, 230400, 38016, 0x81edbe5a +0, 234000, 38016, 0x43781090 +0, 237600, 38016, 0x449c6974 +0, 241200, 38016, 0xbe61a0e0 +0, 244800, 38016, 0x5128c18e +0, 248400, 38016, 0x2bf68f94 +0, 252000, 38016, 0x0fea4bbb +0, 255600, 38016, 0x7dd650d2 +0, 259200, 38016, 0xc4332d1d +0, 262800, 38016, 0xc7946d1c +0, 266400, 38016, 0x6856e33f +0, 270000, 38016, 0x567f7cc2 +0, 273600, 38016, 0x378bafed +0, 277200, 38016, 0x3f710f7c +0, 280800, 38016, 0x5d866a75 +0, 284400, 38016, 0xe264bdc7 +0, 288000, 38016, 0x48b2cbe9 +0, 291600, 38016, 0x0a4be700 +0, 295200, 38016, 0xcc4ed40d +0, 298800, 38016, 0x93acaf5a +0, 302400, 38016, 0xdd7465f2 +0, 306000, 38016, 0x4d492419 +0, 309600, 38016, 0xc2c2ca96 +0, 313200, 38016, 0x190324d8 +0, 316800, 38016, 0xd8962520 +0, 320400, 38016, 0x8d917eea +0, 324000, 38016, 0x08ec794f +0, 327600, 38016, 0x7ab598a6 +0, 331200, 38016, 0xaaec0ef7 +0, 334800, 38016, 0x7f6ffbe3 +0, 338400, 38016, 0x116d37cb +0, 342000, 38016, 0x7b3a59fd +0, 345600, 38016, 0xed5361cb +0, 349200, 38016, 0x9c558a98 +0, 352800, 38016, 0x292e84ea +0, 356400, 38016, 0x0d35bf44 +0, 360000, 38016, 0xaad7bedd +0, 363600, 38016, 0xa6111b87 +0, 367200, 38016, 0x3c8bfc27 +0, 370800, 38016, 0x65ce6703 +0, 374400, 38016, 0x60ece2ec +0, 378000, 38016, 0x8abbb25f +0, 381600, 38016, 0x41108b27 +0, 385200, 38016, 0xac26284e +0, 388800, 38016, 0x5f4c0db0 +0, 392400, 38016, 0xcccbee91 +0, 396000, 38016, 0x34238dc1 +0, 399600, 38016, 0x7479b326 +0, 403200, 38016, 0xaaf8a957 +0, 406800, 38016, 0xc49b55cb +0, 410400, 38016, 0x338b129f +0, 414000, 38016, 0xf0ed3328 +0, 417600, 38016, 0x39f8dcb3 +0, 421200, 38016, 0x7aecb808 +0, 424800, 38016, 0x35e8827a +0, 428400, 38016, 0x16ac8b9d +0, 432000, 38016, 0x3abdcb78 +0, 435600, 38016, 0xdfbfba7f +0, 439200, 38016, 0x692a964e +0, 442800, 38016, 0x11a5ebdb +0, 446400, 38016, 0x46bc156d +0, 450000, 38016, 0x1b153144 +0, 453600, 38016, 0xdd23349a +0, 457200, 38016, 0xbad02161 +0, 460800, 38016, 0xc5030168 +0, 464400, 38016, 0x3e4ff28d +0, 468000, 38016, 0x17faffe2 +0, 471600, 38016, 0xba04122f +0, 475200, 38016, 0x8a8e0e1e +0, 478800, 38016, 0xe5d6fc7d +0, 482400, 38016, 0x22e3e630 +0, 486000, 38016, 0x7eb1a935 +0, 489600, 38016, 0xde46bead +0, 493200, 38016, 0x34abc542 +0, 496800, 38016, 0x10ceaea3 +0, 500400, 38016, 0xb86fa676 +0, 504000, 38016, 0xbd9d9d3c +0, 507600, 38016, 0x355fb37f +0, 511200, 38016, 0xfb6fd3b0 +0, 514800, 38016, 0x3062edf4 +0, 518400, 38016, 0xf6940b60 +0, 522000, 38016, 0x78bd2f4e +0, 525600, 38016, 0x51fc444f +0, 529200, 38016, 0x118957cc +0, 532800, 38016, 0x53777a50 +0, 536400, 38016, 0xeeaa9761 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr2_mw_a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr2_mw_a new file mode 100644 index 00000000..e1728498 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr2_mw_a @@ -0,0 +1,300 @@ +0, 0, 38016, 0x06150e88 +0, 3600, 38016, 0x32d90103 +0, 7200, 38016, 0xb32d338f +0, 10800, 38016, 0x653c5fc3 +0, 14400, 38016, 0x69ec8bce +0, 18000, 38016, 0x354fa53a +0, 21600, 38016, 0x2ee79c2c +0, 25200, 38016, 0x2c50666c +0, 28800, 38016, 0x65ea824d +0, 32400, 38016, 0x7419948b +0, 36000, 38016, 0x19b298a0 +0, 39600, 38016, 0x29087291 +0, 43200, 38016, 0x92be1e95 +0, 46800, 38016, 0x9699119a +0, 50400, 38016, 0xa4863bff +0, 54000, 38016, 0x7dfc4f6b +0, 57600, 38016, 0x946e5cfa +0, 61200, 38016, 0x57287bdc +0, 64800, 38016, 0xe7ae8bbe +0, 68400, 38016, 0x21d367c7 +0, 72000, 38016, 0x9d0551c2 +0, 75600, 38016, 0xecc980b5 +0, 79200, 38016, 0x0ac4a749 +0, 82800, 38016, 0x9162262f +0, 86400, 38016, 0x4a071c14 +0, 90000, 38016, 0x8571fae8 +0, 93600, 38016, 0xc0843707 +0, 97200, 38016, 0x7b4a63b0 +0, 100800, 38016, 0x5faf5d86 +0, 104400, 38016, 0x64623f6b +0, 108000, 38016, 0xa97b523a +0, 111600, 38016, 0x4048459a +0, 115200, 38016, 0x56ba3d73 +0, 118800, 38016, 0x5394355a +0, 122400, 38016, 0xb6c0176e +0, 126000, 38016, 0x668c0772 +0, 129600, 38016, 0x86feeae8 +0, 133200, 38016, 0x9e75f9af +0, 136800, 38016, 0xd72de054 +0, 140400, 38016, 0x39eb8743 +0, 144000, 38016, 0xd07b4d8e +0, 147600, 38016, 0x89c045a9 +0, 151200, 38016, 0x209542e6 +0, 154800, 38016, 0xc43886ed +0, 158400, 38016, 0xe091e433 +0, 162000, 38016, 0x176b1f65 +0, 165600, 38016, 0xd7730c3e +0, 169200, 38016, 0x2bb90778 +0, 172800, 38016, 0x9b4540a8 +0, 176400, 38016, 0xd34c50db +0, 180000, 38016, 0xf8007af9 +0, 183600, 38016, 0x54748466 +0, 187200, 38016, 0x20ab88a5 +0, 190800, 38016, 0x6aca8887 +0, 194400, 38016, 0xa1bf899f +0, 198000, 38016, 0x8145966d +0, 201600, 38016, 0x98f5a29c +0, 205200, 38016, 0x4ed1b4d1 +0, 208800, 38016, 0x3177b95c +0, 212400, 38016, 0x2b2cc4b2 +0, 216000, 38016, 0xf389db1e +0, 219600, 38016, 0xfc6fca35 +0, 223200, 38016, 0x5f06af41 +0, 226800, 38016, 0x93a368d6 +0, 230400, 38016, 0x3de421f3 +0, 234000, 38016, 0x1e3f4b8d +0, 237600, 38016, 0x6c3e6d4a +0, 241200, 38016, 0x96ab4569 +0, 244800, 38016, 0x0de2d417 +0, 248400, 38016, 0x1a8a8d91 +0, 252000, 38016, 0xffb96503 +0, 255600, 38016, 0x1e1b4959 +0, 259200, 38016, 0x6aa267cd +0, 262800, 38016, 0xcb87a00c +0, 266400, 38016, 0x3b8ac17c +0, 270000, 38016, 0x1348bf7b +0, 273600, 38016, 0x1807b42d +0, 277200, 38016, 0x22dfa6cb +0, 280800, 38016, 0x3d23a622 +0, 284400, 38016, 0x662cb1e0 +0, 288000, 38016, 0x6ecfafaf +0, 291600, 38016, 0xbffcaa71 +0, 295200, 38016, 0xf75ab93f +0, 298800, 38016, 0xaea796bf +0, 302400, 38016, 0x4a547fe8 +0, 306000, 38016, 0x2f1a800f +0, 309600, 38016, 0xc7788261 +0, 313200, 38016, 0x8be17fd3 +0, 316800, 38016, 0xe830830c +0, 320400, 38016, 0x62345ab7 +0, 324000, 38016, 0x70f926c6 +0, 327600, 38016, 0x37e94bf0 +0, 331200, 38016, 0xb1509312 +0, 334800, 38016, 0xc70fea7a +0, 338400, 38016, 0x8062243b +0, 342000, 38016, 0xe64a48b1 +0, 345600, 38016, 0x6f0c4dd7 +0, 349200, 38016, 0x5f9c53b4 +0, 352800, 38016, 0x4c5e506c +0, 356400, 38016, 0xb7c631ef +0, 360000, 38016, 0x30f302a9 +0, 363600, 38016, 0x4f28ebf0 +0, 367200, 38016, 0x3145d3d3 +0, 370800, 38016, 0x69b6c92f +0, 374400, 38016, 0xa3b2c646 +0, 378000, 38016, 0x5ee00dec +0, 381600, 38016, 0x313ee3ea +0, 385200, 38016, 0x4002070e +0, 388800, 38016, 0x5e0106b1 +0, 392400, 38016, 0xd03b2c4d +0, 396000, 38016, 0xdd085316 +0, 399600, 38016, 0xb47a5f86 +0, 403200, 38016, 0xc25d5750 +0, 406800, 38016, 0x16ad52b3 +0, 410400, 38016, 0xa4fe2754 +0, 414000, 38016, 0xac5dfb18 +0, 417600, 38016, 0xe36ee83b +0, 421200, 38016, 0xc708e54e +0, 424800, 38016, 0x6c4beb85 +0, 428400, 38016, 0xf19fd825 +0, 432000, 38016, 0x94e7bb13 +0, 435600, 38016, 0x026e9ddf +0, 439200, 38016, 0xdc71a591 +0, 442800, 38016, 0xb46eb169 +0, 446400, 38016, 0x25f5d5f4 +0, 450000, 38016, 0x27da203d +0, 453600, 38016, 0xed217513 +0, 457200, 38016, 0x78d7bb08 +0, 460800, 38016, 0x623dd66d +0, 464400, 38016, 0xd68c9f82 +0, 468000, 38016, 0x88b059e2 +0, 471600, 38016, 0x623159aa +0, 475200, 38016, 0x1782245b +0, 478800, 38016, 0x64f55b4a +0, 482400, 38016, 0x83c7d154 +0, 486000, 38016, 0x43461c7c +0, 489600, 38016, 0xc3e38c36 +0, 493200, 38016, 0x763394b4 +0, 496800, 38016, 0xff99749d +0, 500400, 38016, 0x76ca13d0 +0, 504000, 38016, 0x29510aea +0, 507600, 38016, 0x385f4309 +0, 511200, 38016, 0x142f5339 +0, 514800, 38016, 0x980ca66e +0, 518400, 38016, 0xc330c0db +0, 522000, 38016, 0xa7dbca0f +0, 525600, 38016, 0x4261c683 +0, 529200, 38016, 0x6d467d81 +0, 532800, 38016, 0x1a107d17 +0, 536400, 38016, 0xd91e765a +0, 540000, 38016, 0x789cfb94 +0, 543600, 38016, 0xc9bc9ee1 +0, 547200, 38016, 0x32f8754c +0, 550800, 38016, 0xad906454 +0, 554400, 38016, 0xe5d6b78d +0, 558000, 38016, 0x307bc291 +0, 561600, 38016, 0x629bdec9 +0, 565200, 38016, 0xf23ccd36 +0, 568800, 38016, 0x6105aa1b +0, 572400, 38016, 0x3da66383 +0, 576000, 38016, 0x48ce2141 +0, 579600, 38016, 0x09fac5fd +0, 583200, 38016, 0xa0bc208d +0, 586800, 38016, 0x49892a74 +0, 590400, 38016, 0xfcb48093 +0, 594000, 38016, 0x850e7e4c +0, 597600, 38016, 0x7cf24f55 +0, 601200, 38016, 0x654845f4 +0, 604800, 38016, 0x35ac5d63 +0, 608400, 38016, 0x795ea726 +0, 612000, 38016, 0xf387a03d +0, 615600, 38016, 0x29279e19 +0, 619200, 38016, 0x48e3b03d +0, 622800, 38016, 0xbcfb8192 +0, 626400, 38016, 0x3fe2749a +0, 630000, 38016, 0xe0a04bbd +0, 633600, 38016, 0x9a912cd7 +0, 637200, 38016, 0x39781e59 +0, 640800, 38016, 0x90e5131a +0, 644400, 38016, 0x8bd90b4b +0, 648000, 38016, 0x410dda61 +0, 651600, 38016, 0x33eb60fd +0, 655200, 38016, 0x08e8632b +0, 658800, 38016, 0x6163fd94 +0, 662400, 38016, 0x60af34e1 +0, 666000, 38016, 0x00016227 +0, 669600, 38016, 0xe6bd71bd +0, 673200, 38016, 0xb40cdf28 +0, 676800, 38016, 0x3cdeb88e +0, 680400, 38016, 0xb9ffe0d6 +0, 684000, 38016, 0xd630ce53 +0, 687600, 38016, 0x120056c2 +0, 691200, 38016, 0x0940399e +0, 694800, 38016, 0x3d337fd0 +0, 698400, 38016, 0x6ef1f4b9 +0, 702000, 38016, 0x7e20f462 +0, 705600, 38016, 0xe397f30a +0, 709200, 38016, 0x6eadf916 +0, 712800, 38016, 0x850e07b9 +0, 716400, 38016, 0x131b10db +0, 720000, 38016, 0x17961d0e +0, 723600, 38016, 0x447557da +0, 727200, 38016, 0x93da7c0e +0, 730800, 38016, 0xd6259239 +0, 734400, 38016, 0x2db99d95 +0, 738000, 38016, 0x648ea2bd +0, 741600, 38016, 0xf8f46ef6 +0, 745200, 38016, 0xb85a7405 +0, 748800, 38016, 0x55dc7bbd +0, 752400, 38016, 0xf38d76f8 +0, 756000, 38016, 0x9e860b96 +0, 759600, 38016, 0x7c5a5da7 +0, 763200, 38016, 0xdf36a619 +0, 766800, 38016, 0x327d1144 +0, 770400, 38016, 0x4a01eabd +0, 774000, 38016, 0xee8b8717 +0, 777600, 38016, 0x874eaf23 +0, 781200, 38016, 0xddaaaf38 +0, 784800, 38016, 0xcab85271 +0, 788400, 38016, 0x970f0d3f +0, 792000, 38016, 0x2a042dcc +0, 795600, 38016, 0xa240e0e7 +0, 799200, 38016, 0x9564c081 +0, 802800, 38016, 0x894d82b4 +0, 806400, 38016, 0xb0748d24 +0, 810000, 38016, 0xafa56340 +0, 813600, 38016, 0x614287c6 +0, 817200, 38016, 0x4dfcaaac +0, 820800, 38016, 0x58dab168 +0, 824400, 38016, 0x19fbb779 +0, 828000, 38016, 0x25adb4c9 +0, 831600, 38016, 0x5fc1bdae +0, 835200, 38016, 0x6581a5d0 +0, 838800, 38016, 0x81d57061 +0, 842400, 38016, 0x43445964 +0, 846000, 38016, 0x68224a19 +0, 849600, 38016, 0xa85d390a +0, 853200, 38016, 0xb571344d +0, 856800, 38016, 0xd3632bfd +0, 860400, 38016, 0x5af52535 +0, 864000, 38016, 0x21b93882 +0, 867600, 38016, 0x8da56743 +0, 871200, 38016, 0x9e7b9da2 +0, 874800, 38016, 0xc1a6bbd9 +0, 878400, 38016, 0xd77be9aa +0, 882000, 38016, 0x2715100f +0, 885600, 38016, 0xac8c1e30 +0, 889200, 38016, 0x110c14b9 +0, 892800, 38016, 0x5a8ff5c4 +0, 896400, 38016, 0x25d4ef19 +0, 900000, 38016, 0x080ffe7f +0, 903600, 38016, 0x7f5b15ef +0, 907200, 38016, 0xf97f10e1 +0, 910800, 38016, 0xdd80f7e5 +0, 914400, 38016, 0xb177df60 +0, 918000, 38016, 0x406023f6 +0, 921600, 38016, 0xf396220f +0, 925200, 38016, 0x50fc2e7a +0, 928800, 38016, 0x959b42da +0, 932400, 38016, 0x61c7484a +0, 936000, 38016, 0x09825cd1 +0, 939600, 38016, 0x0e7b6bd9 +0, 943200, 38016, 0x4a386b9e +0, 946800, 38016, 0x817b5e14 +0, 950400, 38016, 0x51696069 +0, 954000, 38016, 0x84a35f51 +0, 957600, 38016, 0xf7758da3 +0, 961200, 38016, 0x787b6659 +0, 964800, 38016, 0xedb95942 +0, 968400, 38016, 0x4d4d8eb5 +0, 972000, 38016, 0x716cb36a +0, 975600, 38016, 0x6556b912 +0, 979200, 38016, 0xbdd8c0b6 +0, 982800, 38016, 0xd9ffbba5 +0, 986400, 38016, 0xb5d7b4a7 +0, 990000, 38016, 0x4690a4ed +0, 993600, 38016, 0x6fc8bdc4 +0, 997200, 38016, 0x827de512 +0, 1000800, 38016, 0x897bfc43 +0, 1004400, 38016, 0x41f8144a +0, 1008000, 38016, 0xff7d369e +0, 1011600, 38016, 0x526f48fa +0, 1015200, 38016, 0x53245921 +0, 1018800, 38016, 0x69a3791e +0, 1022400, 38016, 0x3de095df +0, 1026000, 38016, 0x9ae2a0f2 +0, 1029600, 38016, 0xd1668593 +0, 1033200, 38016, 0x322c4f5b +0, 1036800, 38016, 0x15882875 +0, 1040400, 38016, 0xa8886b9a +0, 1044000, 38016, 0xc6f07ac1 +0, 1047600, 38016, 0xf9446d58 +0, 1051200, 38016, 0x98ef5ffc +0, 1054800, 38016, 0x23434b21 +0, 1058400, 38016, 0xa1f353d2 +0, 1062000, 38016, 0x6b3d4452 +0, 1065600, 38016, 0xd4ac32bf +0, 1069200, 38016, 0xc577065d +0, 1072800, 38016, 0x2d01111d +0, 1076400, 38016, 0xf51721d4 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr2_tandberg_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr2_tandberg_e new file mode 100644 index 00000000..f47730f4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr2_tandberg_e @@ -0,0 +1,300 @@ +0, 0, 38016, 0xb96f1feb +0, 3600, 38016, 0xca461abd +0, 7200, 38016, 0x578a0c87 +0, 10800, 38016, 0xb3cc1ecb +0, 14400, 38016, 0xd2c84463 +0, 18000, 38016, 0x815d6363 +0, 21600, 38016, 0x7cc17319 +0, 25200, 38016, 0x0f7e8cab +0, 28800, 38016, 0x1876abee +0, 32400, 38016, 0x8f25bccd +0, 36000, 38016, 0xc1c7bb9c +0, 39600, 38016, 0xf861bdb5 +0, 43200, 38016, 0xae1ac352 +0, 46800, 38016, 0x9b6f990b +0, 50400, 38016, 0xa5217121 +0, 54000, 38016, 0x12ac8367 +0, 57600, 38016, 0x687f8526 +0, 61200, 38016, 0x9b009a01 +0, 64800, 38016, 0x9c629e04 +0, 68400, 38016, 0xfee5a366 +0, 72000, 38016, 0x264e9b00 +0, 75600, 38016, 0xf89f9508 +0, 79200, 38016, 0x19247145 +0, 82800, 38016, 0xc4cd41bd +0, 86400, 38016, 0x035c2696 +0, 90000, 38016, 0x22310e7f +0, 93600, 38016, 0xdd771898 +0, 97200, 38016, 0x61522adf +0, 100800, 38016, 0x5eee412f +0, 104400, 38016, 0x03f05077 +0, 108000, 38016, 0x69625001 +0, 111600, 38016, 0x8e025073 +0, 115200, 38016, 0x37374607 +0, 118800, 38016, 0xc90547ea +0, 122400, 38016, 0xe9eb4193 +0, 126000, 38016, 0xf7214070 +0, 129600, 38016, 0xc3ce38de +0, 133200, 38016, 0xb99933cb +0, 136800, 38016, 0x5ee12b39 +0, 140400, 38016, 0x13c921be +0, 144000, 38016, 0x66341136 +0, 147600, 38016, 0x97710eef +0, 151200, 38016, 0xe5910c52 +0, 154800, 38016, 0xbf9d0fbb +0, 158400, 38016, 0x0405177d +0, 162000, 38016, 0x25ec13da +0, 165600, 38016, 0xda29f457 +0, 169200, 38016, 0x8e7dbe67 +0, 172800, 38016, 0x64809802 +0, 176400, 38016, 0xbd45731d +0, 180000, 38016, 0xf9e75c5b +0, 183600, 38016, 0x4509551e +0, 187200, 38016, 0xd73b54c9 +0, 190800, 38016, 0x434d430e +0, 194400, 38016, 0xfbd940fe +0, 198000, 38016, 0xddb1612a +0, 201600, 38016, 0xffec797a +0, 205200, 38016, 0x4355aa0c +0, 208800, 38016, 0x1776d3e0 +0, 212400, 38016, 0x7a64dd7f +0, 216000, 38016, 0xe619e56c +0, 219600, 38016, 0x43b0d8e7 +0, 223200, 38016, 0x2103caf1 +0, 226800, 38016, 0x808fbb8d +0, 230400, 38016, 0x0654ae1e +0, 234000, 38016, 0x8b6da03f +0, 237600, 38016, 0x15ee6b73 +0, 241200, 38016, 0x8ab049c4 +0, 244800, 38016, 0x7c6d351c +0, 248400, 38016, 0xe3fa3794 +0, 252000, 38016, 0x5b3c581c +0, 255600, 38016, 0xf07a70e8 +0, 259200, 38016, 0xcc378cb4 +0, 262800, 38016, 0x15f49788 +0, 266400, 38016, 0x23de74b4 +0, 270000, 38016, 0x2e842db6 +0, 273600, 38016, 0xd23cf2b9 +0, 277200, 38016, 0xfbb7cea3 +0, 280800, 38016, 0x05039bf0 +0, 284400, 38016, 0x854d8c6c +0, 288000, 38016, 0x7d2770d7 +0, 291600, 38016, 0x7e5f6374 +0, 295200, 38016, 0x204753ee +0, 298800, 38016, 0x66906f4d +0, 302400, 38016, 0xf6ae700b +0, 306000, 38016, 0x64438aba +0, 309600, 38016, 0xc93aa41f +0, 313200, 38016, 0x27bdbdb7 +0, 316800, 38016, 0x7aceb0a3 +0, 320400, 38016, 0x751d81bd +0, 324000, 38016, 0xa86e3940 +0, 327600, 38016, 0x9d022dd6 +0, 331200, 38016, 0x0a484d7c +0, 334800, 38016, 0x6d555adb +0, 338400, 38016, 0xfe9799e0 +0, 342000, 38016, 0x245ad49b +0, 345600, 38016, 0x6d22e3e3 +0, 349200, 38016, 0xdffc00df +0, 352800, 38016, 0x34ec1984 +0, 356400, 38016, 0x15172b1a +0, 360000, 38016, 0x05d742d8 +0, 363600, 38016, 0xc94350fc +0, 367200, 38016, 0x3af65a84 +0, 370800, 38016, 0xfbf96492 +0, 374400, 38016, 0x1c8f6e2e +0, 378000, 38016, 0xe41677dc +0, 381600, 38016, 0xd36284e1 +0, 385200, 38016, 0xa5f57f14 +0, 388800, 38016, 0x6a7d70f4 +0, 392400, 38016, 0x4c1a584f +0, 396000, 38016, 0x4f093dd3 +0, 399600, 38016, 0x5a1634b3 +0, 403200, 38016, 0xdd1a29b5 +0, 406800, 38016, 0x28c81aa3 +0, 410400, 38016, 0x681a0e29 +0, 414000, 38016, 0x74110802 +0, 417600, 38016, 0x468afe8a +0, 421200, 38016, 0xfbb609e0 +0, 424800, 38016, 0x79d60da0 +0, 428400, 38016, 0x0774036d +0, 432000, 38016, 0x904bf22d +0, 435600, 38016, 0xddeaedb5 +0, 439200, 38016, 0x5de1d5af +0, 442800, 38016, 0xb9bad4cf +0, 446400, 38016, 0x452bcf0e +0, 450000, 38016, 0x9ab9cca8 +0, 453600, 38016, 0x9b77d6ba +0, 457200, 38016, 0xb9f5dfaf +0, 460800, 38016, 0x7b33fac4 +0, 464400, 38016, 0x25e41c67 +0, 468000, 38016, 0x6af749b5 +0, 471600, 38016, 0xe6576d07 +0, 475200, 38016, 0x55a49498 +0, 478800, 38016, 0x3bf4bd93 +0, 482400, 38016, 0xba65cabb +0, 486000, 38016, 0x0c02de64 +0, 489600, 38016, 0xdb86e742 +0, 493200, 38016, 0x37acdf69 +0, 496800, 38016, 0x8c1ea6be +0, 500400, 38016, 0x5295739e +0, 504000, 38016, 0xb2f85eb7 +0, 507600, 38016, 0x17394375 +0, 511200, 38016, 0x8a7f7528 +0, 514800, 38016, 0x17c3e7a5 +0, 518400, 38016, 0xbe1763ef +0, 522000, 38016, 0x236eab70 +0, 525600, 38016, 0x4b3e9bbb +0, 529200, 38016, 0xc1d664f9 +0, 532800, 38016, 0xc2300411 +0, 536400, 38016, 0x1cf2903c +0, 540000, 38016, 0xd8783451 +0, 543600, 38016, 0xf3c8ff31 +0, 547200, 38016, 0xf6dfd324 +0, 550800, 38016, 0x7b93b5d0 +0, 554400, 38016, 0xf246a0f4 +0, 558000, 38016, 0x5e970b10 +0, 561600, 38016, 0xcb98878e +0, 565200, 38016, 0xc804f169 +0, 568800, 38016, 0x801fec84 +0, 572400, 38016, 0xb242ee41 +0, 576000, 38016, 0xb8a7f3c1 +0, 579600, 38016, 0x24b10420 +0, 583200, 38016, 0x4b7601ab +0, 586800, 38016, 0x4c30f75a +0, 590400, 38016, 0x8e8cf5ae +0, 594000, 38016, 0xd94fefd2 +0, 597600, 38016, 0x31c9c604 +0, 601200, 38016, 0x09d29f6f +0, 604800, 38016, 0xa55e8075 +0, 608400, 38016, 0x482d53da +0, 612000, 38016, 0x957e36f1 +0, 615600, 38016, 0xcd261153 +0, 619200, 38016, 0xbf08d284 +0, 622800, 38016, 0x42957a37 +0, 626400, 38016, 0x28b73287 +0, 630000, 38016, 0xe6e33893 +0, 633600, 38016, 0x7f0e3db5 +0, 637200, 38016, 0xb80b46a3 +0, 640800, 38016, 0x1ccca614 +0, 644400, 38016, 0x531e2dfa +0, 648000, 38016, 0x0d95ef09 +0, 651600, 38016, 0xb631a635 +0, 655200, 38016, 0x4ed86a94 +0, 658800, 38016, 0x919832ab +0, 662400, 38016, 0x724b60d5 +0, 666000, 38016, 0x9965f58f +0, 669600, 38016, 0x7b04f567 +0, 673200, 38016, 0x774740d6 +0, 676800, 38016, 0xf8204134 +0, 680400, 38016, 0xcbadfa7a +0, 684000, 38016, 0x9748728a +0, 687600, 38016, 0x973047e7 +0, 691200, 38016, 0xcc52aa4d +0, 694800, 38016, 0x3fa7d81f +0, 698400, 38016, 0x7a33eddd +0, 702000, 38016, 0xe51ed885 +0, 705600, 38016, 0xcc93b1a2 +0, 709200, 38016, 0xf70cab47 +0, 712800, 38016, 0x983eb17e +0, 716400, 38016, 0xdb02d6bb +0, 720000, 38016, 0xad99c4f9 +0, 723600, 38016, 0xd0e5618c +0, 727200, 38016, 0x5eb05134 +0, 730800, 38016, 0x4ce0cf23 +0, 734400, 38016, 0x70de3edb +0, 738000, 38016, 0x3519c858 +0, 741600, 38016, 0x1a4e785f +0, 745200, 38016, 0x8d09b6ee +0, 748800, 38016, 0x79b2fd7e +0, 752400, 38016, 0xcd5aa9a4 +0, 756000, 38016, 0x1e1effd2 +0, 759600, 38016, 0xa1d1b497 +0, 763200, 38016, 0x5c036e34 +0, 766800, 38016, 0x937f152b +0, 770400, 38016, 0xe434bed9 +0, 774000, 38016, 0x09eb8913 +0, 777600, 38016, 0x4d671935 +0, 781200, 38016, 0x9c62f30c +0, 784800, 38016, 0x4d080e9c +0, 788400, 38016, 0x7fe23bb4 +0, 792000, 38016, 0x95399638 +0, 795600, 38016, 0x6aa41ac2 +0, 799200, 38016, 0xe748bc32 +0, 802800, 38016, 0x5fab449b +0, 806400, 38016, 0x8798bb84 +0, 810000, 38016, 0x4e700879 +0, 813600, 38016, 0x6d794fa4 +0, 817200, 38016, 0xf40c9e13 +0, 820800, 38016, 0x92330fdb +0, 824400, 38016, 0x558b899a +0, 828000, 38016, 0xec2320ed +0, 831600, 38016, 0x3179f275 +0, 835200, 38016, 0x86cfd19d +0, 838800, 38016, 0x2c88c48a +0, 842400, 38016, 0x0c84b86f +0, 846000, 38016, 0x95069c90 +0, 849600, 38016, 0x82da8061 +0, 853200, 38016, 0x847f7634 +0, 856800, 38016, 0x48d46d89 +0, 860400, 38016, 0x220d81f3 +0, 864000, 38016, 0x5cbe9a7e +0, 867600, 38016, 0xc0e9d5b9 +0, 871200, 38016, 0xcc26ff97 +0, 874800, 38016, 0x01332392 +0, 878400, 38016, 0x44e44439 +0, 882000, 38016, 0xfe8751ee +0, 885600, 38016, 0x010d74a1 +0, 889200, 38016, 0xbf4a7c2d +0, 892800, 38016, 0x77869402 +0, 896400, 38016, 0x1ae8b176 +0, 900000, 38016, 0x917cc0b8 +0, 903600, 38016, 0x3eb6d02a +0, 907200, 38016, 0x815ed568 +0, 910800, 38016, 0xcd6bcd54 +0, 914400, 38016, 0xd3e5bfcd +0, 918000, 38016, 0x95e2bd36 +0, 921600, 38016, 0x102ca664 +0, 925200, 38016, 0x95c59672 +0, 928800, 38016, 0x1d5b8845 +0, 932400, 38016, 0x3d988a4d +0, 936000, 38016, 0x4139a121 +0, 939600, 38016, 0x9eeca508 +0, 943200, 38016, 0xf9f2a9cc +0, 946800, 38016, 0x9420b177 +0, 950400, 38016, 0x13edadd7 +0, 954000, 38016, 0x3d18a416 +0, 957600, 38016, 0x88b09166 +0, 961200, 38016, 0x2e1c939c +0, 964800, 38016, 0x4f8381c3 +0, 968400, 38016, 0x36647382 +0, 972000, 38016, 0x26a272c1 +0, 975600, 38016, 0x9a5a7cc8 +0, 979200, 38016, 0xc2fc7734 +0, 982800, 38016, 0xd21b7e6c +0, 986400, 38016, 0x948c77a0 +0, 990000, 38016, 0x179e7d1a +0, 993600, 38016, 0xbfd17561 +0, 997200, 38016, 0x30f97511 +0, 1000800, 38016, 0x893e6f54 +0, 1004400, 38016, 0x76036ecb +0, 1008000, 38016, 0x3f0e6966 +0, 1011600, 38016, 0xed946afe +0, 1015200, 38016, 0x2c2676de +0, 1018800, 38016, 0x7b348c94 +0, 1022400, 38016, 0x77f5afc8 +0, 1026000, 38016, 0xdb54cea0 +0, 1029600, 38016, 0xc9fed974 +0, 1033200, 38016, 0x04bbe454 +0, 1036800, 38016, 0x7320ffb9 +0, 1040400, 38016, 0x841b199a +0, 1044000, 38016, 0x7d792ee3 +0, 1047600, 38016, 0x5ce33607 +0, 1051200, 38016, 0xec52432e +0, 1054800, 38016, 0xe6a04efe +0, 1058400, 38016, 0xc7b45cef +0, 1062000, 38016, 0xdbe76bf9 +0, 1065600, 38016, 0xd57f7e18 +0, 1069200, 38016, 0x8e03915d +0, 1072800, 38016, 0x30779ec6 +0, 1076400, 38016, 0x89b1aa42 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr3_tandberg_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr3_tandberg_b new file mode 100644 index 00000000..ce9813e5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr3_tandberg_b @@ -0,0 +1,300 @@ +0, 0, 38016, 0xb96f1feb +0, 3600, 38016, 0xca461abd +0, 7200, 38016, 0x578a0c87 +0, 10800, 38016, 0xb3cc1ecb +0, 14400, 38016, 0xd2c84463 +0, 18000, 38016, 0x815d6363 +0, 21600, 38016, 0x7cc17319 +0, 25200, 38016, 0x0f7e8cab +0, 28800, 38016, 0x1876abee +0, 32400, 38016, 0xda748c2f +0, 36000, 38016, 0x7b4dbff0 +0, 39600, 38016, 0xd4a1b24a +0, 43200, 38016, 0x714cb4cc +0, 46800, 38016, 0x2c6d80f0 +0, 50400, 38016, 0x92266151 +0, 54000, 38016, 0x6b766a23 +0, 57600, 38016, 0xb24f7efe +0, 61200, 38016, 0x8410838e +0, 64800, 38016, 0x67fe872a +0, 68400, 38016, 0x55b49d36 +0, 72000, 38016, 0x7a1c9c41 +0, 75600, 38016, 0xb4818e0e +0, 79200, 38016, 0x25f6683c +0, 82800, 38016, 0xe4d141a4 +0, 86400, 38016, 0x808216ad +0, 90000, 38016, 0x2acf0baf +0, 93600, 38016, 0xf3de13c4 +0, 97200, 38016, 0x5f412187 +0, 100800, 38016, 0xb31a340a +0, 104400, 38016, 0x019d42d1 +0, 108000, 38016, 0xeeb94b9b +0, 111600, 38016, 0xef55472e +0, 115200, 38016, 0xdb5e3697 +0, 118800, 38016, 0x8565303e +0, 122400, 38016, 0x5f9c2c1b +0, 126000, 38016, 0xeb3d27f4 +0, 129600, 38016, 0x9a43282d +0, 133200, 38016, 0xe04720c6 +0, 136800, 38016, 0x19cc0eba +0, 140400, 38016, 0x218efeb6 +0, 144000, 38016, 0x7733f491 +0, 147600, 38016, 0x7f3bede9 +0, 151200, 38016, 0x49c5ec0d +0, 154800, 38016, 0x803cf19e +0, 158400, 38016, 0x31de0d3f +0, 162000, 38016, 0xa7e30426 +0, 165600, 38016, 0xba37f068 +0, 169200, 38016, 0x2842bdf8 +0, 172800, 38016, 0x76df97dc +0, 176400, 38016, 0xf3246d26 +0, 180000, 38016, 0x0a384d72 +0, 183600, 38016, 0x40964f41 +0, 187200, 38016, 0x46364324 +0, 190800, 38016, 0x7cbf3db4 +0, 194400, 38016, 0x7a223bec +0, 198000, 38016, 0x458651c1 +0, 201600, 38016, 0xb82d7e3c +0, 205200, 38016, 0x0f50a55d +0, 208800, 38016, 0xc306cae4 +0, 212400, 38016, 0x9d6ddfcb +0, 216000, 38016, 0xb602e8e9 +0, 219600, 38016, 0xbf0ae386 +0, 223200, 38016, 0x0a8bd46e +0, 226800, 38016, 0xd437c5c1 +0, 230400, 38016, 0xd61d9959 +0, 234000, 38016, 0x70639b56 +0, 237600, 38016, 0x36fd407b +0, 241200, 38016, 0x58ce3ddd +0, 244800, 38016, 0x86cc1d8c +0, 248400, 38016, 0xee422dc2 +0, 252000, 38016, 0xab475639 +0, 255600, 38016, 0xc1327ad8 +0, 259200, 38016, 0x63d196d4 +0, 262800, 38016, 0x1aba8ebd +0, 266400, 38016, 0x74a269ac +0, 270000, 38016, 0x267f3563 +0, 273600, 38016, 0xa18ff180 +0, 277200, 38016, 0x70c9c9fd +0, 280800, 38016, 0xa6c59f9c +0, 284400, 38016, 0xd7cd8927 +0, 288000, 38016, 0xd30b7345 +0, 291600, 38016, 0x679a4dda +0, 295200, 38016, 0xeb0562de +0, 298800, 38016, 0xdd7d6cdb +0, 302400, 38016, 0xd6e26b73 +0, 306000, 38016, 0xa65a860f +0, 309600, 38016, 0xae95c71e +0, 313200, 38016, 0x1a89ca86 +0, 316800, 38016, 0xa33ecee6 +0, 320400, 38016, 0x821da6cb +0, 324000, 38016, 0xf0e1612f +0, 327600, 38016, 0x67b8516b +0, 331200, 38016, 0x62f965bc +0, 334800, 38016, 0xd1917aa6 +0, 338400, 38016, 0xe72db54d +0, 342000, 38016, 0x9b64e721 +0, 345600, 38016, 0xa819efda +0, 349200, 38016, 0xeacfdacb +0, 352800, 38016, 0x52f235e1 +0, 356400, 38016, 0x2b512cb8 +0, 360000, 38016, 0xaac73fb3 +0, 363600, 38016, 0x7d2d504f +0, 367200, 38016, 0x396d503a +0, 370800, 38016, 0x97905235 +0, 374400, 38016, 0xf0056693 +0, 378000, 38016, 0x728a6a9e +0, 381600, 38016, 0x0eed7824 +0, 385200, 38016, 0x59506237 +0, 388800, 38016, 0xd4304c93 +0, 392400, 38016, 0x7e663ee8 +0, 396000, 38016, 0x0ebc2d11 +0, 399600, 38016, 0x52db2112 +0, 403200, 38016, 0x74aa1815 +0, 406800, 38016, 0x57a60dc6 +0, 410400, 38016, 0x86e9fa32 +0, 414000, 38016, 0x67e8ff09 +0, 417600, 38016, 0x26e8f7ea +0, 421200, 38016, 0x183dff56 +0, 424800, 38016, 0xa470af8d +0, 428400, 38016, 0xe017d594 +0, 432000, 38016, 0xb899d48b +0, 435600, 38016, 0x0d3bc5f7 +0, 439200, 38016, 0xd68bbb0d +0, 442800, 38016, 0x8bf5b4cb +0, 446400, 38016, 0x6bfcaa47 +0, 450000, 38016, 0x29a9b01b +0, 453600, 38016, 0xcdedbdb7 +0, 457200, 38016, 0xdb5ad9c3 +0, 460800, 38016, 0x468aeef6 +0, 464400, 38016, 0xdc2b143e +0, 468000, 38016, 0x6776277c +0, 471600, 38016, 0xb78d5294 +0, 475200, 38016, 0x1dfb63ab +0, 478800, 38016, 0xbd1f99bc +0, 482400, 38016, 0xde16b89a +0, 486000, 38016, 0xbf46edca +0, 489600, 38016, 0x6306e8c4 +0, 493200, 38016, 0x7b09d224 +0, 496800, 38016, 0xfea1aff6 +0, 500400, 38016, 0x183686b0 +0, 504000, 38016, 0x665a61ff +0, 507600, 38016, 0xc8af42d1 +0, 511200, 38016, 0xe2326bc1 +0, 514800, 38016, 0x56dbde82 +0, 518400, 38016, 0xa0254f97 +0, 522000, 38016, 0x3b74a0b4 +0, 525600, 38016, 0x9aee9b7f +0, 529200, 38016, 0xd94b6133 +0, 532800, 38016, 0x5819f795 +0, 536400, 38016, 0xc45a8c02 +0, 540000, 38016, 0x2f9204a0 +0, 543600, 38016, 0xbe09e051 +0, 547200, 38016, 0xb542badd +0, 550800, 38016, 0x23bd9e00 +0, 554400, 38016, 0x4f338d3d +0, 558000, 38016, 0x8c91e8f3 +0, 561600, 38016, 0xa7347d57 +0, 565200, 38016, 0x6d91de4d +0, 568800, 38016, 0x3443d936 +0, 572400, 38016, 0x9d25b4e2 +0, 576000, 38016, 0xd93cd4b3 +0, 579600, 38016, 0xa1c9e9a0 +0, 583200, 38016, 0x1482f220 +0, 586800, 38016, 0x1295f270 +0, 590400, 38016, 0x399ae9da +0, 594000, 38016, 0x85dcdf28 +0, 597600, 38016, 0x4207b9e5 +0, 601200, 38016, 0xad1c9d75 +0, 604800, 38016, 0x4a266c14 +0, 608400, 38016, 0x3afc4508 +0, 612000, 38016, 0x2b1b2385 +0, 615600, 38016, 0x738f005f +0, 619200, 38016, 0xfec3d833 +0, 622800, 38016, 0x3f7f6ae9 +0, 626400, 38016, 0xd8551823 +0, 630000, 38016, 0x6df03570 +0, 633600, 38016, 0x767c3054 +0, 637200, 38016, 0x89bd342c +0, 640800, 38016, 0x77ba806c +0, 644400, 38016, 0x1c98005c +0, 648000, 38016, 0xa13ce2a3 +0, 651600, 38016, 0x1be59915 +0, 655200, 38016, 0x279c6027 +0, 658800, 38016, 0x96ac11a2 +0, 662400, 38016, 0x3ae95131 +0, 666000, 38016, 0xae19f7fe +0, 669600, 38016, 0xcde4efe6 +0, 673200, 38016, 0x5ecc3f7a +0, 676800, 38016, 0x79645152 +0, 680400, 38016, 0x1ee2e89f +0, 684000, 38016, 0x91d34bb4 +0, 687600, 38016, 0xf019d464 +0, 691200, 38016, 0x8eb07205 +0, 694800, 38016, 0x5399bb5b +0, 698400, 38016, 0x61f0c77a +0, 702000, 38016, 0xb2bd8726 +0, 705600, 38016, 0x47b89243 +0, 709200, 38016, 0xebfe4d76 +0, 712800, 38016, 0xe8f87d91 +0, 716400, 38016, 0x5e9fb239 +0, 720000, 38016, 0x357ca1f8 +0, 723600, 38016, 0x757d2e02 +0, 727200, 38016, 0x40672e7c +0, 730800, 38016, 0xd966abca +0, 734400, 38016, 0xe98d0d47 +0, 738000, 38016, 0x341babf5 +0, 741600, 38016, 0xd12d5a0c +0, 745200, 38016, 0xea2f99ab +0, 748800, 38016, 0x14bce88e +0, 752400, 38016, 0xe4bda9e8 +0, 756000, 38016, 0x2c57ec89 +0, 759600, 38016, 0x28bbb83e +0, 763200, 38016, 0xf8444b54 +0, 766800, 38016, 0x3aba03cd +0, 770400, 38016, 0x373daa20 +0, 774000, 38016, 0x69586597 +0, 777600, 38016, 0xc0c70d53 +0, 781200, 38016, 0x76a5df5a +0, 784800, 38016, 0x1afde8f0 +0, 788400, 38016, 0x9638285a +0, 792000, 38016, 0x9f0686c0 +0, 795600, 38016, 0xc65b2238 +0, 799200, 38016, 0x0d61b610 +0, 802800, 38016, 0x78e14e1f +0, 806400, 38016, 0xcf80ac4a +0, 810000, 38016, 0xe094083d +0, 813600, 38016, 0xee5e612e +0, 817200, 38016, 0x51cdad9d +0, 820800, 38016, 0xae41100e +0, 824400, 38016, 0x77558f58 +0, 828000, 38016, 0xb9503b95 +0, 831600, 38016, 0xb71dffeb +0, 835200, 38016, 0x1872e3e6 +0, 838800, 38016, 0x29c3d252 +0, 842400, 38016, 0x1c77c6ec +0, 846000, 38016, 0x26feb194 +0, 849600, 38016, 0x3307c3c4 +0, 853200, 38016, 0x8e5a8080 +0, 856800, 38016, 0x933472f7 +0, 860400, 38016, 0xd4768d84 +0, 864000, 38016, 0x3324485f +0, 867600, 38016, 0xd50af078 +0, 871200, 38016, 0x53820752 +0, 874800, 38016, 0xbe7f1c47 +0, 878400, 38016, 0xe43d3a34 +0, 882000, 38016, 0x57194b82 +0, 885600, 38016, 0x68a052ed +0, 889200, 38016, 0x5c898052 +0, 892800, 38016, 0x7104a6ad +0, 896400, 38016, 0x1676b5e8 +0, 900000, 38016, 0xe1cfd375 +0, 903600, 38016, 0x16fede04 +0, 907200, 38016, 0xca49dd4a +0, 910800, 38016, 0x7b98d9d1 +0, 914400, 38016, 0x4020d210 +0, 918000, 38016, 0x62c5d1e4 +0, 921600, 38016, 0x756abdb4 +0, 925200, 38016, 0x558fb00f +0, 928800, 38016, 0x4ab0b1f1 +0, 932400, 38016, 0x7c9fb0c2 +0, 936000, 38016, 0xcecfbdd0 +0, 939600, 38016, 0x70e6d174 +0, 943200, 38016, 0x83d7ddde +0, 946800, 38016, 0xbbcde2d9 +0, 950400, 38016, 0xc89eeaef +0, 954000, 38016, 0x8565e15c +0, 957600, 38016, 0x28e0db24 +0, 961200, 38016, 0x1d9dd334 +0, 964800, 38016, 0xce02c452 +0, 968400, 38016, 0xe29dbd0c +0, 972000, 38016, 0x4aa3b638 +0, 975600, 38016, 0x5533c135 +0, 979200, 38016, 0x6c57b65f +0, 982800, 38016, 0x23d3b851 +0, 986400, 38016, 0xd8cbb960 +0, 990000, 38016, 0x02edb916 +0, 993600, 38016, 0xa622bd42 +0, 997200, 38016, 0x4ba5be1c +0, 1000800, 38016, 0xe69bb625 +0, 1004400, 38016, 0xbca5b292 +0, 1008000, 38016, 0xde38b1c8 +0, 1011600, 38016, 0xe9e3b617 +0, 1015200, 38016, 0x216cc574 +0, 1018800, 38016, 0x3780c5ad +0, 1022400, 38016, 0x5531e3f9 +0, 1026000, 38016, 0xe2c5f5d4 +0, 1029600, 38016, 0x24cefc6e +0, 1033200, 38016, 0xa3ce003d +0, 1036800, 38016, 0x42d01c9e +0, 1040400, 38016, 0xbfc13689 +0, 1044000, 38016, 0x122647a9 +0, 1047600, 38016, 0xe45254da +0, 1051200, 38016, 0xad955b0c +0, 1054800, 38016, 0x4b086abb +0, 1058400, 38016, 0xd4857b8c +0, 1062000, 38016, 0xa71594ce +0, 1065600, 38016, 0x04e4a73d +0, 1069200, 38016, 0x295abf63 +0, 1072800, 38016, 0xbe4ed5dd +0, 1076400, 38016, 0x087bcf64 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr4_tandberg_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr4_tandberg_c new file mode 100644 index 00000000..5aceda2c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr4_tandberg_c @@ -0,0 +1,300 @@ +0, 0, 38016, 0xb96f1feb +0, 3600, 38016, 0x0ff111f0 +0, 7200, 38016, 0xbac70271 +0, 10800, 38016, 0x8c361866 +0, 14400, 38016, 0x9d9640be +0, 18000, 38016, 0xd36b563b +0, 21600, 38016, 0xe5966f5f +0, 25200, 38016, 0xb8b28ab0 +0, 28800, 38016, 0xf817a3e6 +0, 32400, 38016, 0xba26acd8 +0, 36000, 38016, 0x453dba2f +0, 39600, 38016, 0xe50bd16e +0, 43200, 38016, 0x95c2c1f7 +0, 46800, 38016, 0xc6a59679 +0, 50400, 38016, 0x9f468726 +0, 54000, 38016, 0x371091eb +0, 57600, 38016, 0xd499d26b +0, 61200, 38016, 0x172fd389 +0, 64800, 38016, 0x3c04de2a +0, 68400, 38016, 0xa461aed2 +0, 72000, 38016, 0x098cdef2 +0, 75600, 38016, 0x5d8d9c7d +0, 79200, 38016, 0x087db718 +0, 82800, 38016, 0x064191ef +0, 86400, 38016, 0x2f842ef5 +0, 90000, 38016, 0x2b5b0e77 +0, 93600, 38016, 0xcc671b7f +0, 97200, 38016, 0x859f4f75 +0, 100800, 38016, 0x132a7a48 +0, 104400, 38016, 0x6e8987ab +0, 108000, 38016, 0x02db8591 +0, 111600, 38016, 0x30567d9b +0, 115200, 38016, 0x92ea3b53 +0, 118800, 38016, 0xae807c6e +0, 122400, 38016, 0xbfbc7458 +0, 126000, 38016, 0x66294d04 +0, 129600, 38016, 0xdb2a5f10 +0, 133200, 38016, 0xb19112fe +0, 136800, 38016, 0xdd26490e +0, 140400, 38016, 0x51cd31de +0, 144000, 38016, 0xf6cc2dad +0, 147600, 38016, 0x0c302dfd +0, 151200, 38016, 0xb846245d +0, 154800, 38016, 0xd61c2e88 +0, 158400, 38016, 0xf8264117 +0, 162000, 38016, 0x13862a3d +0, 165600, 38016, 0xfb481750 +0, 169200, 38016, 0x6377e4af +0, 172800, 38016, 0x1759c1b4 +0, 176400, 38016, 0xca03942b +0, 180000, 38016, 0x0126810b +0, 183600, 38016, 0x3c8c820b +0, 187200, 38016, 0x863379ec +0, 190800, 38016, 0xaf9b6d52 +0, 194400, 38016, 0x9ba86946 +0, 198000, 38016, 0xf97980fb +0, 201600, 38016, 0x9cf4785c +0, 205200, 38016, 0x51cdcdc7 +0, 208800, 38016, 0x923de162 +0, 212400, 38016, 0xdcd3c3cb +0, 216000, 38016, 0x6f9fea31 +0, 219600, 38016, 0x7ab7b133 +0, 223200, 38016, 0xb8a2c99f +0, 226800, 38016, 0x040a99c6 +0, 230400, 38016, 0xa8c4b28f +0, 234000, 38016, 0x4c577509 +0, 237600, 38016, 0xb30f7277 +0, 241200, 38016, 0xb5f73b46 +0, 244800, 38016, 0x723f3ccc +0, 248400, 38016, 0x3e4a0cca +0, 252000, 38016, 0xe0df386e +0, 255600, 38016, 0xc4832c7b +0, 259200, 38016, 0x014a2d9f +0, 262800, 38016, 0xae4272d9 +0, 266400, 38016, 0xcde25e0f +0, 270000, 38016, 0xdecb13d6 +0, 273600, 38016, 0x9d8ae5d9 +0, 277200, 38016, 0x280abccf +0, 280800, 38016, 0x885a9fcc +0, 284400, 38016, 0x9b328b6f +0, 288000, 38016, 0x8fb7663c +0, 291600, 38016, 0x35fd4c32 +0, 295200, 38016, 0xdd484efb +0, 298800, 38016, 0xb8f576b1 +0, 302400, 38016, 0xe8016312 +0, 306000, 38016, 0x65a88d55 +0, 309600, 38016, 0x83dca3a9 +0, 313200, 38016, 0xfc3ba542 +0, 316800, 38016, 0x3d55ac26 +0, 320400, 38016, 0xb91f6bbe +0, 324000, 38016, 0x67bd2f75 +0, 327600, 38016, 0x0af12875 +0, 331200, 38016, 0xc18a2d55 +0, 334800, 38016, 0x22fd4e01 +0, 338400, 38016, 0x466b8dcd +0, 342000, 38016, 0xfe93c2d9 +0, 345600, 38016, 0x2cc0e638 +0, 349200, 38016, 0xbe550d40 +0, 352800, 38016, 0x65900ffc +0, 356400, 38016, 0xcc61228c +0, 360000, 38016, 0x8ae34904 +0, 363600, 38016, 0x74b8411a +0, 367200, 38016, 0xae36408d +0, 370800, 38016, 0x251429ad +0, 374400, 38016, 0x4d8e6dc6 +0, 378000, 38016, 0x9e07801e +0, 381600, 38016, 0x8fdd83ef +0, 385200, 38016, 0x976084a1 +0, 388800, 38016, 0x69f7609f +0, 392400, 38016, 0x48971b09 +0, 396000, 38016, 0x78e63ff4 +0, 399600, 38016, 0x0852365b +0, 403200, 38016, 0x8044232c +0, 406800, 38016, 0x9ec3178d +0, 410400, 38016, 0x6f260955 +0, 414000, 38016, 0x903cfe23 +0, 417600, 38016, 0x441afbe4 +0, 421200, 38016, 0xe4420313 +0, 424800, 38016, 0xf86d0c34 +0, 428400, 38016, 0xafe5f3c3 +0, 432000, 38016, 0x9f61e43b +0, 435600, 38016, 0x9330e186 +0, 439200, 38016, 0xc900ce86 +0, 442800, 38016, 0xffd6c4a6 +0, 446400, 38016, 0xd7b3cd79 +0, 450000, 38016, 0x8015c914 +0, 453600, 38016, 0x36d3c884 +0, 457200, 38016, 0x2981db44 +0, 460800, 38016, 0x94f40162 +0, 464400, 38016, 0x091022c5 +0, 468000, 38016, 0xd554203f +0, 471600, 38016, 0xdcf26c7e +0, 475200, 38016, 0xdc398ff4 +0, 478800, 38016, 0xeb5ca01c +0, 482400, 38016, 0x4931c311 +0, 486000, 38016, 0x0ddabf2a +0, 489600, 38016, 0x2432a265 +0, 493200, 38016, 0x65409b4f +0, 496800, 38016, 0x466e6957 +0, 500400, 38016, 0x82a08bb4 +0, 504000, 38016, 0xdb6a35c4 +0, 507600, 38016, 0xda5b0d28 +0, 511200, 38016, 0x2be76f6d +0, 514800, 38016, 0x7587a456 +0, 518400, 38016, 0x69994004 +0, 522000, 38016, 0xaefd46ec +0, 525600, 38016, 0x88094d53 +0, 529200, 38016, 0xfcb82a4c +0, 532800, 38016, 0x2877c850 +0, 536400, 38016, 0x327f5e88 +0, 540000, 38016, 0xaa1c4a3f +0, 543600, 38016, 0x1950dfbd +0, 547200, 38016, 0x8580b472 +0, 550800, 38016, 0xb5ef90c0 +0, 554400, 38016, 0x0906b3e7 +0, 558000, 38016, 0x026b12fa +0, 561600, 38016, 0xe8ef556a +0, 565200, 38016, 0x2e1afe7f +0, 568800, 38016, 0xef2ad28a +0, 572400, 38016, 0xe6d7d947 +0, 576000, 38016, 0x25ebd549 +0, 579600, 38016, 0xc443f3cf +0, 583200, 38016, 0x9dc7dcad +0, 586800, 38016, 0x8b7ce835 +0, 590400, 38016, 0x27a3e48b +0, 594000, 38016, 0x0b6bc8a9 +0, 597600, 38016, 0xdb98d21e +0, 601200, 38016, 0x4cb89812 +0, 604800, 38016, 0x41f35c5e +0, 608400, 38016, 0xfd764d91 +0, 612000, 38016, 0xb7cc313f +0, 615600, 38016, 0x51ba22d1 +0, 619200, 38016, 0x00d8deee +0, 622800, 38016, 0x50db806a +0, 626400, 38016, 0xbf022623 +0, 630000, 38016, 0xf2fe22ba +0, 633600, 38016, 0x7055191b +0, 637200, 38016, 0xbefb8590 +0, 640800, 38016, 0x90e59103 +0, 644400, 38016, 0x61d443da +0, 648000, 38016, 0x6ad0e637 +0, 651600, 38016, 0xda39f9c1 +0, 655200, 38016, 0x03408181 +0, 658800, 38016, 0xee973480 +0, 662400, 38016, 0x9674d65d +0, 666000, 38016, 0x1fdd5529 +0, 669600, 38016, 0x51a219bb +0, 673200, 38016, 0x9cd9747e +0, 676800, 38016, 0xa58a3c33 +0, 680400, 38016, 0xdf1905a9 +0, 684000, 38016, 0x44a52c69 +0, 687600, 38016, 0x0cf6e56b +0, 691200, 38016, 0xe2115e06 +0, 694800, 38016, 0x15efa840 +0, 698400, 38016, 0x0811bad8 +0, 702000, 38016, 0x8240a91d +0, 705600, 38016, 0xdfe46b7d +0, 709200, 38016, 0xcead819a +0, 712800, 38016, 0xe8f87d91 +0, 716400, 38016, 0x951ebd82 +0, 720000, 38016, 0x37d98ecb +0, 723600, 38016, 0x54fb54da +0, 727200, 38016, 0xb306302e +0, 730800, 38016, 0xa8acd0dc +0, 734400, 38016, 0x68e43757 +0, 738000, 38016, 0x7018cd48 +0, 741600, 38016, 0x1c34824e +0, 745200, 38016, 0x22e7e478 +0, 748800, 38016, 0x534a0470 +0, 752400, 38016, 0x1a65bc45 +0, 756000, 38016, 0x5e78223b +0, 759600, 38016, 0xc3c9c912 +0, 763200, 38016, 0x52557c74 +0, 766800, 38016, 0xf5ff1f9a +0, 770400, 38016, 0x56afe047 +0, 774000, 38016, 0x50259235 +0, 777600, 38016, 0xca19311d +0, 781200, 38016, 0xd96eeb53 +0, 784800, 38016, 0x21a218b7 +0, 788400, 38016, 0x24162395 +0, 792000, 38016, 0xadf9b983 +0, 795600, 38016, 0x68443df2 +0, 799200, 38016, 0xa970df8a +0, 802800, 38016, 0x8381bbee +0, 806400, 38016, 0x36fe1d22 +0, 810000, 38016, 0xa0326ddf +0, 813600, 38016, 0x01dc7ca7 +0, 817200, 38016, 0xf485d505 +0, 820800, 38016, 0xb5a8fe68 +0, 824400, 38016, 0x6385f303 +0, 828000, 38016, 0x4d099ef1 +0, 831600, 38016, 0xeaa54d25 +0, 835200, 38016, 0x5c32c503 +0, 838800, 38016, 0xd52538b3 +0, 842400, 38016, 0x1ca2e4c2 +0, 846000, 38016, 0xe3a95b82 +0, 849600, 38016, 0x14393895 +0, 853200, 38016, 0xd77cef50 +0, 856800, 38016, 0x47b901b8 +0, 860400, 38016, 0x14d70226 +0, 864000, 38016, 0xab32b360 +0, 867600, 38016, 0xb92d3090 +0, 871200, 38016, 0xbd50ae43 +0, 874800, 38016, 0x5ea8d59a +0, 878400, 38016, 0xb6d7fe63 +0, 882000, 38016, 0xe228050d +0, 885600, 38016, 0x09e251ed +0, 889200, 38016, 0xcea332d0 +0, 892800, 38016, 0x048838af +0, 896400, 38016, 0x0a625a93 +0, 900000, 38016, 0x018aa719 +0, 903600, 38016, 0x630e70a8 +0, 907200, 38016, 0x93cb4c39 +0, 910800, 38016, 0x3cdb7cf8 +0, 914400, 38016, 0x48491fb4 +0, 918000, 38016, 0x06aa4101 +0, 921600, 38016, 0x4b402d3e +0, 925200, 38016, 0x13cbf927 +0, 928800, 38016, 0xdc7528b6 +0, 932400, 38016, 0x652d0576 +0, 936000, 38016, 0xa3a504d6 +0, 939600, 38016, 0x5bd33fe4 +0, 943200, 38016, 0xae11267b +0, 946800, 38016, 0xb58b5613 +0, 950400, 38016, 0x50160d80 +0, 954000, 38016, 0x4a643ed0 +0, 957600, 38016, 0xe3983ed6 +0, 961200, 38016, 0xa1fb3338 +0, 964800, 38016, 0x48d0286d +0, 968400, 38016, 0x67043801 +0, 972000, 38016, 0x00bafaad +0, 975600, 38016, 0xf07de35a +0, 979200, 38016, 0x493e4579 +0, 982800, 38016, 0xa917532b +0, 986400, 38016, 0x463fcc89 +0, 990000, 38016, 0xd47c1b1b +0, 993600, 38016, 0x3543c596 +0, 997200, 38016, 0x65d6cd5b +0, 1000800, 38016, 0x22cbd5ef +0, 1004400, 38016, 0x08e0f250 +0, 1008000, 38016, 0x4e4aeb0a +0, 1011600, 38016, 0x7895e0bd +0, 1015200, 38016, 0xc11cea95 +0, 1018800, 38016, 0x13b3bcf8 +0, 1022400, 38016, 0xcb312186 +0, 1026000, 38016, 0x791007ca +0, 1029600, 38016, 0xaa77354f +0, 1033200, 38016, 0x1dbc2a67 +0, 1036800, 38016, 0x00646a65 +0, 1040400, 38016, 0x19db488d +0, 1044000, 38016, 0x16c155e5 +0, 1047600, 38016, 0xb760898e +0, 1051200, 38016, 0xbd6691e8 +0, 1054800, 38016, 0x06829781 +0, 1058400, 38016, 0xcebab8ad +0, 1062000, 38016, 0xe2f38e79 +0, 1065600, 38016, 0x1e00c08e +0, 1069200, 38016, 0x86d6c935 +0, 1072800, 38016, 0xaa88dfdc +0, 1076400, 38016, 0xa9029b45 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr5_tandberg_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr5_tandberg_c new file mode 100644 index 00000000..5aceda2c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr5_tandberg_c @@ -0,0 +1,300 @@ +0, 0, 38016, 0xb96f1feb +0, 3600, 38016, 0x0ff111f0 +0, 7200, 38016, 0xbac70271 +0, 10800, 38016, 0x8c361866 +0, 14400, 38016, 0x9d9640be +0, 18000, 38016, 0xd36b563b +0, 21600, 38016, 0xe5966f5f +0, 25200, 38016, 0xb8b28ab0 +0, 28800, 38016, 0xf817a3e6 +0, 32400, 38016, 0xba26acd8 +0, 36000, 38016, 0x453dba2f +0, 39600, 38016, 0xe50bd16e +0, 43200, 38016, 0x95c2c1f7 +0, 46800, 38016, 0xc6a59679 +0, 50400, 38016, 0x9f468726 +0, 54000, 38016, 0x371091eb +0, 57600, 38016, 0xd499d26b +0, 61200, 38016, 0x172fd389 +0, 64800, 38016, 0x3c04de2a +0, 68400, 38016, 0xa461aed2 +0, 72000, 38016, 0x098cdef2 +0, 75600, 38016, 0x5d8d9c7d +0, 79200, 38016, 0x087db718 +0, 82800, 38016, 0x064191ef +0, 86400, 38016, 0x2f842ef5 +0, 90000, 38016, 0x2b5b0e77 +0, 93600, 38016, 0xcc671b7f +0, 97200, 38016, 0x859f4f75 +0, 100800, 38016, 0x132a7a48 +0, 104400, 38016, 0x6e8987ab +0, 108000, 38016, 0x02db8591 +0, 111600, 38016, 0x30567d9b +0, 115200, 38016, 0x92ea3b53 +0, 118800, 38016, 0xae807c6e +0, 122400, 38016, 0xbfbc7458 +0, 126000, 38016, 0x66294d04 +0, 129600, 38016, 0xdb2a5f10 +0, 133200, 38016, 0xb19112fe +0, 136800, 38016, 0xdd26490e +0, 140400, 38016, 0x51cd31de +0, 144000, 38016, 0xf6cc2dad +0, 147600, 38016, 0x0c302dfd +0, 151200, 38016, 0xb846245d +0, 154800, 38016, 0xd61c2e88 +0, 158400, 38016, 0xf8264117 +0, 162000, 38016, 0x13862a3d +0, 165600, 38016, 0xfb481750 +0, 169200, 38016, 0x6377e4af +0, 172800, 38016, 0x1759c1b4 +0, 176400, 38016, 0xca03942b +0, 180000, 38016, 0x0126810b +0, 183600, 38016, 0x3c8c820b +0, 187200, 38016, 0x863379ec +0, 190800, 38016, 0xaf9b6d52 +0, 194400, 38016, 0x9ba86946 +0, 198000, 38016, 0xf97980fb +0, 201600, 38016, 0x9cf4785c +0, 205200, 38016, 0x51cdcdc7 +0, 208800, 38016, 0x923de162 +0, 212400, 38016, 0xdcd3c3cb +0, 216000, 38016, 0x6f9fea31 +0, 219600, 38016, 0x7ab7b133 +0, 223200, 38016, 0xb8a2c99f +0, 226800, 38016, 0x040a99c6 +0, 230400, 38016, 0xa8c4b28f +0, 234000, 38016, 0x4c577509 +0, 237600, 38016, 0xb30f7277 +0, 241200, 38016, 0xb5f73b46 +0, 244800, 38016, 0x723f3ccc +0, 248400, 38016, 0x3e4a0cca +0, 252000, 38016, 0xe0df386e +0, 255600, 38016, 0xc4832c7b +0, 259200, 38016, 0x014a2d9f +0, 262800, 38016, 0xae4272d9 +0, 266400, 38016, 0xcde25e0f +0, 270000, 38016, 0xdecb13d6 +0, 273600, 38016, 0x9d8ae5d9 +0, 277200, 38016, 0x280abccf +0, 280800, 38016, 0x885a9fcc +0, 284400, 38016, 0x9b328b6f +0, 288000, 38016, 0x8fb7663c +0, 291600, 38016, 0x35fd4c32 +0, 295200, 38016, 0xdd484efb +0, 298800, 38016, 0xb8f576b1 +0, 302400, 38016, 0xe8016312 +0, 306000, 38016, 0x65a88d55 +0, 309600, 38016, 0x83dca3a9 +0, 313200, 38016, 0xfc3ba542 +0, 316800, 38016, 0x3d55ac26 +0, 320400, 38016, 0xb91f6bbe +0, 324000, 38016, 0x67bd2f75 +0, 327600, 38016, 0x0af12875 +0, 331200, 38016, 0xc18a2d55 +0, 334800, 38016, 0x22fd4e01 +0, 338400, 38016, 0x466b8dcd +0, 342000, 38016, 0xfe93c2d9 +0, 345600, 38016, 0x2cc0e638 +0, 349200, 38016, 0xbe550d40 +0, 352800, 38016, 0x65900ffc +0, 356400, 38016, 0xcc61228c +0, 360000, 38016, 0x8ae34904 +0, 363600, 38016, 0x74b8411a +0, 367200, 38016, 0xae36408d +0, 370800, 38016, 0x251429ad +0, 374400, 38016, 0x4d8e6dc6 +0, 378000, 38016, 0x9e07801e +0, 381600, 38016, 0x8fdd83ef +0, 385200, 38016, 0x976084a1 +0, 388800, 38016, 0x69f7609f +0, 392400, 38016, 0x48971b09 +0, 396000, 38016, 0x78e63ff4 +0, 399600, 38016, 0x0852365b +0, 403200, 38016, 0x8044232c +0, 406800, 38016, 0x9ec3178d +0, 410400, 38016, 0x6f260955 +0, 414000, 38016, 0x903cfe23 +0, 417600, 38016, 0x441afbe4 +0, 421200, 38016, 0xe4420313 +0, 424800, 38016, 0xf86d0c34 +0, 428400, 38016, 0xafe5f3c3 +0, 432000, 38016, 0x9f61e43b +0, 435600, 38016, 0x9330e186 +0, 439200, 38016, 0xc900ce86 +0, 442800, 38016, 0xffd6c4a6 +0, 446400, 38016, 0xd7b3cd79 +0, 450000, 38016, 0x8015c914 +0, 453600, 38016, 0x36d3c884 +0, 457200, 38016, 0x2981db44 +0, 460800, 38016, 0x94f40162 +0, 464400, 38016, 0x091022c5 +0, 468000, 38016, 0xd554203f +0, 471600, 38016, 0xdcf26c7e +0, 475200, 38016, 0xdc398ff4 +0, 478800, 38016, 0xeb5ca01c +0, 482400, 38016, 0x4931c311 +0, 486000, 38016, 0x0ddabf2a +0, 489600, 38016, 0x2432a265 +0, 493200, 38016, 0x65409b4f +0, 496800, 38016, 0x466e6957 +0, 500400, 38016, 0x82a08bb4 +0, 504000, 38016, 0xdb6a35c4 +0, 507600, 38016, 0xda5b0d28 +0, 511200, 38016, 0x2be76f6d +0, 514800, 38016, 0x7587a456 +0, 518400, 38016, 0x69994004 +0, 522000, 38016, 0xaefd46ec +0, 525600, 38016, 0x88094d53 +0, 529200, 38016, 0xfcb82a4c +0, 532800, 38016, 0x2877c850 +0, 536400, 38016, 0x327f5e88 +0, 540000, 38016, 0xaa1c4a3f +0, 543600, 38016, 0x1950dfbd +0, 547200, 38016, 0x8580b472 +0, 550800, 38016, 0xb5ef90c0 +0, 554400, 38016, 0x0906b3e7 +0, 558000, 38016, 0x026b12fa +0, 561600, 38016, 0xe8ef556a +0, 565200, 38016, 0x2e1afe7f +0, 568800, 38016, 0xef2ad28a +0, 572400, 38016, 0xe6d7d947 +0, 576000, 38016, 0x25ebd549 +0, 579600, 38016, 0xc443f3cf +0, 583200, 38016, 0x9dc7dcad +0, 586800, 38016, 0x8b7ce835 +0, 590400, 38016, 0x27a3e48b +0, 594000, 38016, 0x0b6bc8a9 +0, 597600, 38016, 0xdb98d21e +0, 601200, 38016, 0x4cb89812 +0, 604800, 38016, 0x41f35c5e +0, 608400, 38016, 0xfd764d91 +0, 612000, 38016, 0xb7cc313f +0, 615600, 38016, 0x51ba22d1 +0, 619200, 38016, 0x00d8deee +0, 622800, 38016, 0x50db806a +0, 626400, 38016, 0xbf022623 +0, 630000, 38016, 0xf2fe22ba +0, 633600, 38016, 0x7055191b +0, 637200, 38016, 0xbefb8590 +0, 640800, 38016, 0x90e59103 +0, 644400, 38016, 0x61d443da +0, 648000, 38016, 0x6ad0e637 +0, 651600, 38016, 0xda39f9c1 +0, 655200, 38016, 0x03408181 +0, 658800, 38016, 0xee973480 +0, 662400, 38016, 0x9674d65d +0, 666000, 38016, 0x1fdd5529 +0, 669600, 38016, 0x51a219bb +0, 673200, 38016, 0x9cd9747e +0, 676800, 38016, 0xa58a3c33 +0, 680400, 38016, 0xdf1905a9 +0, 684000, 38016, 0x44a52c69 +0, 687600, 38016, 0x0cf6e56b +0, 691200, 38016, 0xe2115e06 +0, 694800, 38016, 0x15efa840 +0, 698400, 38016, 0x0811bad8 +0, 702000, 38016, 0x8240a91d +0, 705600, 38016, 0xdfe46b7d +0, 709200, 38016, 0xcead819a +0, 712800, 38016, 0xe8f87d91 +0, 716400, 38016, 0x951ebd82 +0, 720000, 38016, 0x37d98ecb +0, 723600, 38016, 0x54fb54da +0, 727200, 38016, 0xb306302e +0, 730800, 38016, 0xa8acd0dc +0, 734400, 38016, 0x68e43757 +0, 738000, 38016, 0x7018cd48 +0, 741600, 38016, 0x1c34824e +0, 745200, 38016, 0x22e7e478 +0, 748800, 38016, 0x534a0470 +0, 752400, 38016, 0x1a65bc45 +0, 756000, 38016, 0x5e78223b +0, 759600, 38016, 0xc3c9c912 +0, 763200, 38016, 0x52557c74 +0, 766800, 38016, 0xf5ff1f9a +0, 770400, 38016, 0x56afe047 +0, 774000, 38016, 0x50259235 +0, 777600, 38016, 0xca19311d +0, 781200, 38016, 0xd96eeb53 +0, 784800, 38016, 0x21a218b7 +0, 788400, 38016, 0x24162395 +0, 792000, 38016, 0xadf9b983 +0, 795600, 38016, 0x68443df2 +0, 799200, 38016, 0xa970df8a +0, 802800, 38016, 0x8381bbee +0, 806400, 38016, 0x36fe1d22 +0, 810000, 38016, 0xa0326ddf +0, 813600, 38016, 0x01dc7ca7 +0, 817200, 38016, 0xf485d505 +0, 820800, 38016, 0xb5a8fe68 +0, 824400, 38016, 0x6385f303 +0, 828000, 38016, 0x4d099ef1 +0, 831600, 38016, 0xeaa54d25 +0, 835200, 38016, 0x5c32c503 +0, 838800, 38016, 0xd52538b3 +0, 842400, 38016, 0x1ca2e4c2 +0, 846000, 38016, 0xe3a95b82 +0, 849600, 38016, 0x14393895 +0, 853200, 38016, 0xd77cef50 +0, 856800, 38016, 0x47b901b8 +0, 860400, 38016, 0x14d70226 +0, 864000, 38016, 0xab32b360 +0, 867600, 38016, 0xb92d3090 +0, 871200, 38016, 0xbd50ae43 +0, 874800, 38016, 0x5ea8d59a +0, 878400, 38016, 0xb6d7fe63 +0, 882000, 38016, 0xe228050d +0, 885600, 38016, 0x09e251ed +0, 889200, 38016, 0xcea332d0 +0, 892800, 38016, 0x048838af +0, 896400, 38016, 0x0a625a93 +0, 900000, 38016, 0x018aa719 +0, 903600, 38016, 0x630e70a8 +0, 907200, 38016, 0x93cb4c39 +0, 910800, 38016, 0x3cdb7cf8 +0, 914400, 38016, 0x48491fb4 +0, 918000, 38016, 0x06aa4101 +0, 921600, 38016, 0x4b402d3e +0, 925200, 38016, 0x13cbf927 +0, 928800, 38016, 0xdc7528b6 +0, 932400, 38016, 0x652d0576 +0, 936000, 38016, 0xa3a504d6 +0, 939600, 38016, 0x5bd33fe4 +0, 943200, 38016, 0xae11267b +0, 946800, 38016, 0xb58b5613 +0, 950400, 38016, 0x50160d80 +0, 954000, 38016, 0x4a643ed0 +0, 957600, 38016, 0xe3983ed6 +0, 961200, 38016, 0xa1fb3338 +0, 964800, 38016, 0x48d0286d +0, 968400, 38016, 0x67043801 +0, 972000, 38016, 0x00bafaad +0, 975600, 38016, 0xf07de35a +0, 979200, 38016, 0x493e4579 +0, 982800, 38016, 0xa917532b +0, 986400, 38016, 0x463fcc89 +0, 990000, 38016, 0xd47c1b1b +0, 993600, 38016, 0x3543c596 +0, 997200, 38016, 0x65d6cd5b +0, 1000800, 38016, 0x22cbd5ef +0, 1004400, 38016, 0x08e0f250 +0, 1008000, 38016, 0x4e4aeb0a +0, 1011600, 38016, 0x7895e0bd +0, 1015200, 38016, 0xc11cea95 +0, 1018800, 38016, 0x13b3bcf8 +0, 1022400, 38016, 0xcb312186 +0, 1026000, 38016, 0x791007ca +0, 1029600, 38016, 0xaa77354f +0, 1033200, 38016, 0x1dbc2a67 +0, 1036800, 38016, 0x00646a65 +0, 1040400, 38016, 0x19db488d +0, 1044000, 38016, 0x16c155e5 +0, 1047600, 38016, 0xb760898e +0, 1051200, 38016, 0xbd6691e8 +0, 1054800, 38016, 0x06829781 +0, 1058400, 38016, 0xcebab8ad +0, 1062000, 38016, 0xe2f38e79 +0, 1065600, 38016, 0x1e00c08e +0, 1069200, 38016, 0x86d6c935 +0, 1072800, 38016, 0xaa88dfdc +0, 1076400, 38016, 0xa9029b45 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr6_bt_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr6_bt_b new file mode 100644 index 00000000..8deff755 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr6_bt_b @@ -0,0 +1,60 @@ +0, 0, 36864, 0x954464be +0, 3600, 36864, 0xace1d90b +0, 7200, 36864, 0x8f149f03 +0, 10800, 36864, 0xea9b21eb +0, 14400, 36864, 0xb51d9fe3 +0, 18000, 36864, 0x61bd11d7 +0, 21600, 36864, 0x9d36980f +0, 25200, 36864, 0xa4192c5e +0, 28800, 36864, 0x11006433 +0, 32400, 36864, 0x4a243e46 +0, 36000, 36864, 0x1807b5e8 +0, 39600, 36864, 0xbe37743c +0, 43200, 36864, 0x82491319 +0, 46800, 36864, 0x006e9914 +0, 50400, 36864, 0xa5261884 +0, 54000, 36864, 0x2030c9d6 +0, 57600, 36864, 0xc80eb1ce +0, 61200, 36864, 0x4d559791 +0, 64800, 36864, 0xf5f900ee +0, 68400, 36864, 0x2cc9c0d7 +0, 72000, 36864, 0x5ba14186 +0, 75600, 36864, 0x47a46865 +0, 79200, 36864, 0x5ba180b7 +0, 82800, 36864, 0xc67c4876 +0, 86400, 36864, 0x4311d75d +0, 90000, 36864, 0x56edb851 +0, 93600, 36864, 0x7e5aa3e0 +0, 97200, 36864, 0x8df8283a +0, 100800, 36864, 0xb8583ddf +0, 104400, 36864, 0xf33fb779 +0, 108000, 36864, 0xe9942ddc +0, 111600, 36864, 0x2bc5f7fa +0, 115200, 36864, 0xc7b66c65 +0, 118800, 36864, 0x1a524319 +0, 122400, 36864, 0xf60c6141 +0, 126000, 36864, 0x113f41f2 +0, 129600, 36864, 0xad191a31 +0, 133200, 36864, 0x3898264a +0, 136800, 36864, 0x3c2f34a4 +0, 140400, 36864, 0xd0fc76aa +0, 144000, 36864, 0x2870b546 +0, 147600, 36864, 0x7d326fb4 +0, 151200, 36864, 0xd7ed14e1 +0, 154800, 36864, 0x205174aa +0, 158400, 36864, 0xa3a88be9 +0, 162000, 36864, 0xd6f01751 +0, 165600, 36864, 0x5420bb80 +0, 169200, 36864, 0xe14518f9 +0, 172800, 36864, 0x931db61e +0, 176400, 36864, 0x052ecfae +0, 180000, 36864, 0x29b1b0f5 +0, 183600, 36864, 0xa3057117 +0, 187200, 36864, 0x954464be +0, 190800, 36864, 0xace1d90b +0, 194400, 36864, 0x8f149f03 +0, 198000, 36864, 0x485722c5 +0, 201600, 36864, 0x534b18f9 +0, 205200, 36864, 0xc893a0a6 +0, 208800, 36864, 0x8b04e1dd +0, 212400, 36864, 0xaf536964 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr7_bt_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr7_bt_b new file mode 100644 index 00000000..3d40bde0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr7_bt_b @@ -0,0 +1,60 @@ +0, 0, 36864, 0x579e6274 +0, 3600, 36864, 0x8650c61c +0, 7200, 36864, 0xbc359647 +0, 10800, 36864, 0x08d91c13 +0, 14400, 36864, 0xe8b79043 +0, 18000, 36864, 0x2f16085a +0, 21600, 36864, 0x81e89739 +0, 25200, 36864, 0xf2f324dd +0, 28800, 36864, 0x592b5a01 +0, 32400, 36864, 0x4c2f2d91 +0, 36000, 36864, 0x8baeb610 +0, 39600, 36864, 0x86d47617 +0, 43200, 36864, 0xf11011cc +0, 46800, 36864, 0xe56a9daa +0, 50400, 36864, 0xd57119d6 +0, 54000, 36864, 0xe28fcde7 +0, 57600, 36864, 0x9aeeba86 +0, 61200, 36864, 0xa518a7c5 +0, 64800, 36864, 0x9af410be +0, 68400, 36864, 0x1fedd12f +0, 72000, 36864, 0xa8032e03 +0, 75600, 36864, 0x579e6274 +0, 79200, 36864, 0x99846ef6 +0, 82800, 36864, 0xb5ad3ca7 +0, 86400, 36864, 0x7845cb90 +0, 90000, 36864, 0x569fae24 +0, 93600, 36864, 0x8a3c9f98 +0, 97200, 36864, 0x0b7722af +0, 100800, 36864, 0x699c2dd8 +0, 104400, 36864, 0xd477af13 +0, 108000, 36864, 0x17b62d7c +0, 111600, 36864, 0xb1ecf6a7 +0, 115200, 36864, 0xf9c17e4c +0, 118800, 36864, 0xe7c44618 +0, 122400, 36864, 0x7e23654e +0, 126000, 36864, 0xd8a0457c +0, 129600, 36864, 0x57e11df1 +0, 133200, 36864, 0xd54d2a43 +0, 136800, 36864, 0xc6f03950 +0, 140400, 36864, 0x687e750e +0, 144000, 36864, 0x2870b546 +0, 147600, 36864, 0xda0370d0 +0, 151200, 36864, 0x5a2e0bff +0, 154800, 36864, 0xe1f07533 +0, 158400, 36864, 0x3de892b9 +0, 162000, 36864, 0xe5c31505 +0, 165600, 36864, 0x96b8c082 +0, 169200, 36864, 0x55391423 +0, 172800, 36864, 0xc285bd71 +0, 176400, 36864, 0xf702d9f3 +0, 180000, 36864, 0x7afbadf8 +0, 183600, 36864, 0xd9b568f7 +0, 187200, 36864, 0x579e6274 +0, 190800, 36864, 0x8650c61c +0, 194400, 36864, 0xbc359647 +0, 198000, 36864, 0x5522328c +0, 201600, 36864, 0x02821fd6 +0, 205200, 36864, 0xb4ee9562 +0, 208800, 36864, 0xcefedb68 +0, 212400, 36864, 0xd959782e diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr8_bt_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr8_bt_b new file mode 100644 index 00000000..ab35869b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr8_bt_b @@ -0,0 +1,58 @@ +0, 0, 36864, 0x36df68f4 +0, 3600, 36864, 0x52d4c6d9 +0, 7200, 36864, 0xad16b0be +0, 10800, 36864, 0xf8c72556 +0, 14400, 36864, 0x70aaad30 +0, 18000, 36864, 0x53cffd5e +0, 21600, 36864, 0xb3fa8abc +0, 25200, 36864, 0x9c894009 +0, 28800, 36864, 0xfbc08050 +0, 32400, 36864, 0x9d5b2d65 +0, 36000, 36864, 0x3bd8bb5d +0, 39600, 36864, 0x8d976ecf +0, 43200, 36864, 0x25010368 +0, 46800, 36864, 0xb6e6a11c +0, 50400, 36864, 0x595a3967 +0, 54000, 36864, 0x4fbcb9a8 +0, 57600, 36864, 0xc7c5c16b +0, 61200, 36864, 0x661ae1eb +0, 64800, 36864, 0x169f04a7 +0, 68400, 36864, 0xd124c93a +0, 72000, 36864, 0x3f642dba +0, 75600, 36864, 0xe7ad6956 +0, 79200, 36864, 0x47dc76d3 +0, 82800, 36864, 0x496a3917 +0, 86400, 36864, 0xa976d5f3 +0, 90000, 36864, 0x507bb685 +0, 93600, 36864, 0x2f61ac12 +0, 97200, 36864, 0x527818d8 +0, 100800, 36864, 0xa4983396 +0, 104400, 36864, 0x3ec9b07b +0, 108000, 36864, 0x7db52d99 +0, 111600, 36864, 0xe974fd00 +0, 115200, 36864, 0x9c677a4f +0, 118800, 36864, 0x108f3a05 +0, 122400, 36864, 0x23a56ba2 +0, 126000, 36864, 0x4c8d47e8 +0, 129600, 36864, 0x9e0b0f09 +0, 133200, 36864, 0x4d262b16 +0, 136800, 36864, 0x6122402e +0, 140400, 36864, 0xed037036 +0, 144000, 36864, 0x62b3ba08 +0, 147600, 36864, 0x7f876930 +0, 151200, 36864, 0x4a6c0983 +0, 154800, 36864, 0xf9787086 +0, 158400, 36864, 0x01d1b1b5 +0, 162000, 36864, 0xc1622655 +0, 165600, 36864, 0x27e8e0f7 +0, 169200, 36864, 0xc1622655 +0, 172800, 36864, 0x12c2b7e9 +0, 176400, 36864, 0xd752d2ef +0, 180000, 36864, 0xcbb1c3a7 +0, 183600, 36864, 0x18c56fba +0, 187200, 36864, 0xb1b3771c +0, 190800, 36864, 0x284ef3c4 +0, 194400, 36864, 0xda6eb5a0 +0, 198000, 36864, 0x17ad337c +0, 201600, 36864, 0xe2801e4f +0, 205200, 36864, 0x6c33bd17 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr9_bt_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr9_bt_b new file mode 100644 index 00000000..dcf0b420 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mr9_bt_b @@ -0,0 +1,58 @@ +0, 0, 36864, 0xb4c5642e +0, 3600, 36864, 0x929fd05f +0, 7200, 36864, 0x447c9b69 +0, 10800, 36864, 0xab0712da +0, 14400, 36864, 0xd9f69216 +0, 18000, 36864, 0xec04f6dc +0, 21600, 36864, 0x5ffa86cc +0, 25200, 36864, 0x75122807 +0, 28800, 36864, 0x27036a2b +0, 32400, 36864, 0x00072654 +0, 36000, 36864, 0x49fab4fd +0, 39600, 36864, 0x975a7545 +0, 43200, 36864, 0x9b080a2f +0, 46800, 36864, 0x78db960e +0, 50400, 36864, 0xd7a928d4 +0, 54000, 36864, 0x0a83ba1b +0, 57600, 36864, 0xad6bb30c +0, 61200, 36864, 0xf6addb0d +0, 64800, 36864, 0x00540a0a +0, 68400, 36864, 0x049cc748 +0, 72000, 36864, 0x5b1e2291 +0, 75600, 36864, 0x2367706e +0, 79200, 36864, 0x88ef6b11 +0, 82800, 36864, 0x85b73230 +0, 86400, 36864, 0xe46cd522 +0, 90000, 36864, 0x98489c05 +0, 93600, 36864, 0x7e439564 +0, 97200, 36864, 0x71330799 +0, 100800, 36864, 0x81a6239e +0, 104400, 36864, 0x8005a302 +0, 108000, 36864, 0xdf132e3f +0, 111600, 36864, 0x2a1d00de +0, 115200, 36864, 0x7bb57e14 +0, 118800, 36864, 0xf2a637cf +0, 122400, 36864, 0xae6f6916 +0, 126000, 36864, 0x2f1d4763 +0, 129600, 36864, 0xa4e1145e +0, 133200, 36864, 0xc1644392 +0, 136800, 36864, 0x21853537 +0, 140400, 36864, 0x0bc45bac +0, 144000, 36864, 0x84ccb8ee +0, 147600, 36864, 0x65de651c +0, 151200, 36864, 0x33ff027e +0, 154800, 36864, 0xefe47056 +0, 158400, 36864, 0x8952b47c +0, 162000, 36864, 0x78730fcf +0, 165600, 36864, 0x14bae79f +0, 169200, 36864, 0x53230fbe +0, 172800, 36864, 0x15b0b245 +0, 176400, 36864, 0x45fbd155 +0, 180000, 36864, 0x41cfbac4 +0, 183600, 36864, 0x0d635d61 +0, 187200, 36864, 0x55aa8d3c +0, 190800, 36864, 0x8f02fbaf +0, 194400, 36864, 0xb17fac3f +0, 198000, 36864, 0xc12627f9 +0, 201600, 36864, 0xa5971e4a +0, 205200, 36864, 0x3677abfe diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mv1_brcm_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mv1_brcm_d new file mode 100644 index 00000000..f7ce1d66 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-mv1_brcm_d @@ -0,0 +1,257 @@ +0, 0, 518400, 0x230d7aa6 +0, 3600, 518400, 0x9fc976e0 +0, 7200, 518400, 0x51052db9 +0, 10800, 518400, 0xad82d599 +0, 14400, 518400, 0xa122c6a7 +0, 18000, 518400, 0x0c3a81a0 +0, 21600, 518400, 0x6235364e +0, 25200, 518400, 0x4d5104f8 +0, 28800, 518400, 0x09cc49b1 +0, 32400, 518400, 0xcdb05c19 +0, 36000, 518400, 0x894be6de +0, 39600, 518400, 0x53a41fc3 +0, 43200, 518400, 0x7568ccee +0, 46800, 518400, 0x2b5ae37b +0, 50400, 518400, 0xd0b994bb +0, 54000, 518400, 0x1b161358 +0, 57600, 518400, 0xc5434edc +0, 61200, 518400, 0xc4709590 +0, 64800, 518400, 0x60c6803a +0, 68400, 518400, 0xdff3edcd +0, 72000, 518400, 0x8a02b8b4 +0, 75600, 518400, 0x478cf791 +0, 79200, 518400, 0x7c42fed0 +0, 82800, 518400, 0x12b1336d +0, 86400, 518400, 0xe16e765e +0, 90000, 518400, 0x002c291e +0, 93600, 518400, 0x50810b53 +0, 97200, 518400, 0xda7e2453 +0, 100800, 518400, 0x6e330093 +0, 104400, 518400, 0xf30740b3 +0, 108000, 518400, 0xc27ae19d +0, 111600, 518400, 0xe49da8c2 +0, 115200, 518400, 0xa739372c +0, 118800, 518400, 0x4b44788c +0, 122400, 518400, 0xfdf9e6cf +0, 126000, 518400, 0xee205413 +0, 129600, 518400, 0x8792dc0e +0, 133200, 518400, 0x6820d611 +0, 136800, 518400, 0x106cbc2c +0, 140400, 518400, 0x7d8e3e92 +0, 144000, 518400, 0xbfe48709 +0, 147600, 518400, 0xc5d5a55d +0, 151200, 518400, 0x7c234886 +0, 154800, 518400, 0x852372b0 +0, 158400, 518400, 0x43d697f9 +0, 162000, 518400, 0xc3460806 +0, 165600, 518400, 0x0600abea +0, 169200, 518400, 0xf6e3ab0e +0, 172800, 518400, 0x651f9a46 +0, 176400, 518400, 0xed467ba0 +0, 180000, 518400, 0x62312c3f +0, 183600, 518400, 0xb121898d +0, 187200, 518400, 0xb1f96406 +0, 190800, 518400, 0x78003318 +0, 194400, 518400, 0x1032b15b +0, 198000, 518400, 0x72683d37 +0, 201600, 518400, 0xd1349f12 +0, 205200, 518400, 0x4162f707 +0, 208800, 518400, 0x894711c9 +0, 212400, 518400, 0xca37429b +0, 216000, 518400, 0xb8e91eb5 +0, 219600, 518400, 0xe5eb3103 +0, 223200, 518400, 0x56a33cea +0, 226800, 518400, 0x79ef0227 +0, 230400, 518400, 0x7ceaab75 +0, 234000, 518400, 0x3f4787b2 +0, 237600, 518400, 0x9e6d2abb +0, 241200, 518400, 0xedb0cf82 +0, 244800, 518400, 0x19c8723f +0, 248400, 518400, 0x35d8399b +0, 252000, 518400, 0xe0224dc8 +0, 255600, 518400, 0xc95467bf +0, 259200, 518400, 0x99662844 +0, 262800, 518400, 0x10a322c9 +0, 266400, 518400, 0xe6313d98 +0, 270000, 518400, 0x2e2a63d1 +0, 273600, 518400, 0x2c9d0715 +0, 277200, 518400, 0xf31d9e19 +0, 280800, 518400, 0xcea1f9f8 +0, 284400, 518400, 0xece1cd92 +0, 288000, 518400, 0xa8d35347 +0, 291600, 518400, 0xd8cd2228 +0, 295200, 518400, 0xe040993a +0, 298800, 518400, 0xebc2b387 +0, 302400, 518400, 0xc3e81e85 +0, 306000, 518400, 0xcc507bc9 +0, 309600, 518400, 0xb98c4902 +0, 313200, 518400, 0x454a2a50 +0, 316800, 518400, 0x1460c5dd +0, 320400, 518400, 0x37d7a99d +0, 324000, 518400, 0x1de7a047 +0, 327600, 518400, 0xc7b83c21 +0, 331200, 518400, 0xe06d1c9b +0, 334800, 518400, 0xfd8259b5 +0, 338400, 518400, 0xc3df7e1a +0, 342000, 518400, 0x60c9ccec +0, 345600, 518400, 0x7d163c04 +0, 349200, 518400, 0x8fc61e9d +0, 352800, 518400, 0xa5f520e6 +0, 356400, 518400, 0x8d709ec1 +0, 360000, 518400, 0xca2b6287 +0, 363600, 518400, 0x8531bb18 +0, 367200, 518400, 0x830f9187 +0, 370800, 518400, 0x67c5d413 +0, 374400, 518400, 0x428aeecd +0, 378000, 518400, 0xbf8e3448 +0, 381600, 518400, 0x847389f0 +0, 385200, 518400, 0x18d0b3ba +0, 388800, 518400, 0xbee957ea +0, 392400, 518400, 0x34941f3e +0, 396000, 518400, 0x850e0126 +0, 399600, 518400, 0xab992409 +0, 403200, 518400, 0xb7d8d01f +0, 406800, 518400, 0xe602576c +0, 410400, 518400, 0x22388048 +0, 414000, 518400, 0x81ab9f4a +0, 417600, 518400, 0xc5977820 +0, 421200, 518400, 0xc43f98bd +0, 424800, 518400, 0xfd5e6d12 +0, 428400, 518400, 0xb9f12c73 +0, 432000, 518400, 0x44be16b9 +0, 435600, 518400, 0x32f0d9b9 +0, 439200, 518400, 0x6e9c3113 +0, 442800, 518400, 0x00618755 +0, 446400, 518400, 0x080c9955 +0, 450000, 518400, 0xb21d6096 +0, 453600, 518400, 0x51502f54 +0, 457200, 518400, 0xf062e38b +0, 460800, 518400, 0x66f05988 +0, 464400, 518400, 0x37d569f1 +0, 468000, 518400, 0xba78ae5e +0, 471600, 518400, 0x634a2d25 +0, 475200, 518400, 0x283e5e4a +0, 478800, 518400, 0x9344d41c +0, 482400, 518400, 0x1fdb5c18 +0, 486000, 518400, 0xd8139683 +0, 489600, 518400, 0xd27f555e +0, 493200, 518400, 0x34ed517f +0, 496800, 518400, 0x1f55ad2d +0, 500400, 518400, 0x9a8bd368 +0, 504000, 518400, 0x9726e3bf +0, 507600, 518400, 0xaf8945ee +0, 511200, 518400, 0x28c20699 +0, 514800, 518400, 0x43e180c9 +0, 518400, 518400, 0x0c88e592 +0, 522000, 518400, 0xdcb8825e +0, 525600, 518400, 0x1ec09a5e +0, 529200, 518400, 0x149768b2 +0, 532800, 518400, 0x1eeab153 +0, 536400, 518400, 0x25666d6f +0, 540000, 518400, 0x691cad89 +0, 543600, 518400, 0x2d9f8ced +0, 547200, 518400, 0xd80b768d +0, 550800, 518400, 0xe4f23a79 +0, 554400, 518400, 0xd51d0150 +0, 558000, 518400, 0x060156f4 +0, 561600, 518400, 0x800720fb +0, 565200, 518400, 0x2a433b28 +0, 568800, 518400, 0xffc79782 +0, 572400, 518400, 0x31ba693b +0, 576000, 518400, 0xd13c8395 +0, 579600, 518400, 0x07d9f752 +0, 583200, 518400, 0xabb81043 +0, 586800, 518400, 0xba0ee926 +0, 590400, 518400, 0xa17e7ea9 +0, 594000, 518400, 0x9d709e52 +0, 597600, 518400, 0x7fa02633 +0, 601200, 518400, 0x5cdc5217 +0, 604800, 518400, 0x888be0b0 +0, 608400, 518400, 0xe1bac436 +0, 612000, 518400, 0xa479b1b8 +0, 615600, 518400, 0xb61feb17 +0, 619200, 518400, 0xa0745cd4 +0, 622800, 518400, 0x871cffe5 +0, 626400, 518400, 0x01f7deea +0, 630000, 518400, 0xdaf6f9f5 +0, 633600, 518400, 0xfee4849c +0, 637200, 518400, 0xc3b9b428 +0, 640800, 518400, 0x50b4b47f +0, 644400, 518400, 0xe8e58b82 +0, 648000, 518400, 0x7c6f94e0 +0, 651600, 518400, 0x0cfe7c08 +0, 655200, 518400, 0xb2975466 +0, 658800, 518400, 0xa1245de1 +0, 662400, 518400, 0x46ae79b7 +0, 666000, 518400, 0x8344a9b2 +0, 669600, 518400, 0x1e805013 +0, 673200, 518400, 0x19b61baf +0, 676800, 518400, 0xd018383b +0, 680400, 518400, 0xc9248d31 +0, 684000, 518400, 0x838ad8ec +0, 687600, 518400, 0xa848824a +0, 691200, 518400, 0xc6a46ebd +0, 694800, 518400, 0x2a7c489c +0, 698400, 518400, 0xb1db6cef +0, 702000, 518400, 0xd24a999f +0, 705600, 518400, 0xce47efcd +0, 709200, 518400, 0xf3e058cb +0, 712800, 518400, 0x25d7f6e3 +0, 716400, 518400, 0xe3daa12d +0, 720000, 518400, 0xb3de8475 +0, 723600, 518400, 0x13efffdc +0, 727200, 518400, 0xfb37e048 +0, 730800, 518400, 0x599a6daf +0, 734400, 518400, 0x84bf6814 +0, 738000, 518400, 0x83c03a3f +0, 741600, 518400, 0x3a319ae9 +0, 745200, 518400, 0x0af252c3 +0, 748800, 518400, 0xeb8f2f43 +0, 752400, 518400, 0x3bdcd421 +0, 756000, 518400, 0x9107e0f2 +0, 759600, 518400, 0x5f4fe3cf +0, 763200, 518400, 0x38f1e8ef +0, 766800, 518400, 0xb0359a0b +0, 770400, 518400, 0xdddd4645 +0, 774000, 518400, 0xe14ffb0b +0, 777600, 518400, 0x34a31c96 +0, 781200, 518400, 0x1f4406de +0, 784800, 518400, 0x042b82b6 +0, 788400, 518400, 0x6af16a4d +0, 792000, 518400, 0x3cfba41a +0, 795600, 518400, 0xa054b6e8 +0, 799200, 518400, 0x2d55721b +0, 802800, 518400, 0x55391f75 +0, 806400, 518400, 0xc2d46fa6 +0, 810000, 518400, 0x3a2576d9 +0, 813600, 518400, 0xea9ea26d +0, 817200, 518400, 0xe2ec8962 +0, 820800, 518400, 0x47568769 +0, 824400, 518400, 0xc55e0186 +0, 828000, 518400, 0x73a44453 +0, 831600, 518400, 0xe36b1c77 +0, 835200, 518400, 0x414db365 +0, 838800, 518400, 0xfb25f7f6 +0, 842400, 518400, 0x5b4847a7 +0, 846000, 518400, 0xe96babf4 +0, 849600, 518400, 0x15edbf63 +0, 853200, 518400, 0x08a984c6 +0, 856800, 518400, 0x47ec41af +0, 860400, 518400, 0x1912eaca +0, 864000, 518400, 0xe058b0cc +0, 867600, 518400, 0x03e9660b +0, 871200, 518400, 0x85fea285 +0, 874800, 518400, 0xdf02bdd6 +0, 878400, 518400, 0xad3e6849 +0, 882000, 518400, 0x0ad866b6 +0, 885600, 518400, 0x1b994f78 +0, 889200, 518400, 0xc5916af5 +0, 892800, 518400, 0x5f66adeb +0, 896400, 518400, 0x1c9f96a1 +0, 900000, 518400, 0xfc390832 +0, 903600, 518400, 0x0352ff56 +0, 907200, 518400, 0x6803c8f4 +0, 910800, 518400, 0x0f0b8686 +0, 914400, 518400, 0xdc3a5bce +0, 918000, 518400, 0x96dd28d1 +0, 921600, 518400, 0x51d56824 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nl1_sony_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nl1_sony_d new file mode 100644 index 00000000..5528f9ec --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nl1_sony_d @@ -0,0 +1,17 @@ +0, 0, 38016, 0xc805351d +0, 3600, 38016, 0x3809fec3 +0, 7200, 38016, 0xf698ce3c +0, 10800, 38016, 0x7e3da603 +0, 14400, 38016, 0x68b07d81 +0, 18000, 38016, 0xd91f717a +0, 21600, 38016, 0x48885dd6 +0, 25200, 38016, 0x27e64e8e +0, 28800, 38016, 0x955835ce +0, 32400, 38016, 0xf19940a0 +0, 36000, 38016, 0x9a1c51e4 +0, 39600, 38016, 0xf59373af +0, 43200, 38016, 0x5d6c7d06 +0, 46800, 38016, 0x32fca533 +0, 50400, 38016, 0x37e69987 +0, 54000, 38016, 0x96929e05 +0, 57600, 38016, 0xee37a1f9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nl2_sony_h b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nl2_sony_h new file mode 100644 index 00000000..41d811fe --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nl2_sony_h @@ -0,0 +1,300 @@ +0, 0, 38016, 0xc805351d +0, 3600, 38016, 0x320510a8 +0, 7200, 38016, 0x3ef6e4c6 +0, 10800, 38016, 0x3b94c5e0 +0, 14400, 38016, 0x4be4a689 +0, 18000, 38016, 0x70919210 +0, 21600, 38016, 0x78a07b5a +0, 25200, 38016, 0x8bd86efc +0, 28800, 38016, 0xe3976cab +0, 32400, 38016, 0x77fa735e +0, 36000, 38016, 0x62488adb +0, 39600, 38016, 0x5b07a6a4 +0, 43200, 38016, 0x7058b15f +0, 46800, 38016, 0xa22dc9e2 +0, 50400, 38016, 0xc9d5cae3 +0, 54000, 38016, 0x16cbd6e1 +0, 57600, 38016, 0x4b23d9e9 +0, 61200, 38016, 0x96f7d798 +0, 64800, 38016, 0xdbcdcfdd +0, 68400, 38016, 0x9314b847 +0, 72000, 38016, 0x0a209c28 +0, 75600, 38016, 0x6c757322 +0, 79200, 38016, 0x3d1a6376 +0, 82800, 38016, 0x155f5df7 +0, 86400, 38016, 0xd4446441 +0, 90000, 38016, 0xe1006713 +0, 93600, 38016, 0x5d226a3e +0, 97200, 38016, 0xe839790c +0, 100800, 38016, 0xa28c8b9a +0, 104400, 38016, 0xde469f7a +0, 108000, 38016, 0xf800b7ad +0, 111600, 38016, 0xf2f9ccac +0, 115200, 38016, 0x60feeb52 +0, 118800, 38016, 0xad39fd4f +0, 122400, 38016, 0x4075fce6 +0, 126000, 38016, 0x5f2f036e +0, 129600, 38016, 0x3e180450 +0, 133200, 38016, 0xd806fc04 +0, 136800, 38016, 0x3f15fbc6 +0, 140400, 38016, 0xb881faa4 +0, 144000, 38016, 0xf1cafdc8 +0, 147600, 38016, 0xd881f881 +0, 151200, 38016, 0x6314fdc8 +0, 154800, 38016, 0x8fa6f0d3 +0, 158400, 38016, 0x90d0f40d +0, 162000, 38016, 0x1d30ee93 +0, 165600, 38016, 0x87f6ecca +0, 169200, 38016, 0xca9ae712 +0, 172800, 38016, 0x02c6eb47 +0, 176400, 38016, 0xc263f492 +0, 180000, 38016, 0x717def51 +0, 183600, 38016, 0x0d3af240 +0, 187200, 38016, 0xc232ea7d +0, 190800, 38016, 0x3c41f195 +0, 194400, 38016, 0x5d77f7fb +0, 198000, 38016, 0x2901fb90 +0, 201600, 38016, 0x3b35033e +0, 205200, 38016, 0xca4d034f +0, 208800, 38016, 0x1e730e22 +0, 212400, 38016, 0x69b60d52 +0, 216000, 38016, 0xe50107bc +0, 219600, 38016, 0x44b6f25f +0, 223200, 38016, 0x222ebc66 +0, 226800, 38016, 0x165b7bca +0, 230400, 38016, 0x12a37e44 +0, 234000, 38016, 0xcce9a1dc +0, 237600, 38016, 0x273dd1a9 +0, 241200, 38016, 0x72b00e90 +0, 244800, 38016, 0x449a4fa6 +0, 248400, 38016, 0x203d8582 +0, 252000, 38016, 0x3fa7aaeb +0, 255600, 38016, 0x0b47d491 +0, 259200, 38016, 0x1fa70639 +0, 262800, 38016, 0xf9fe391e +0, 266400, 38016, 0x91c6786c +0, 270000, 38016, 0x7ab99bb2 +0, 273600, 38016, 0x73f2c0f5 +0, 277200, 38016, 0xcffad748 +0, 280800, 38016, 0xe2b0ee34 +0, 284400, 38016, 0x6025f6d6 +0, 288000, 38016, 0xd722017c +0, 291600, 38016, 0x321f0c24 +0, 295200, 38016, 0x336f0e81 +0, 298800, 38016, 0x783a012f +0, 302400, 38016, 0x134cf484 +0, 306000, 38016, 0xec4bf2db +0, 309600, 38016, 0xb481012e +0, 313200, 38016, 0x76ff026c +0, 316800, 38016, 0xaf3b102a +0, 320400, 38016, 0x2eaf0bd6 +0, 324000, 38016, 0x39b8f833 +0, 327600, 38016, 0xe928d7ea +0, 331200, 38016, 0xbe7ac2f8 +0, 334800, 38016, 0x3683b5c4 +0, 338400, 38016, 0xb3559d1c +0, 342000, 38016, 0x73fb9f71 +0, 345600, 38016, 0x3e97b5aa +0, 349200, 38016, 0x0c9dc525 +0, 352800, 38016, 0xecead941 +0, 356400, 38016, 0x4999e247 +0, 360000, 38016, 0x11ddea7c +0, 363600, 38016, 0x4882cf24 +0, 367200, 38016, 0xae9ac0c6 +0, 370800, 38016, 0x4f88b589 +0, 374400, 38016, 0xc677d43f +0, 378000, 38016, 0x5f46f219 +0, 381600, 38016, 0x5c1ffa13 +0, 385200, 38016, 0x162e11a3 +0, 388800, 38016, 0xd0b631d4 +0, 392400, 38016, 0x7133441a +0, 396000, 38016, 0xbb085604 +0, 399600, 38016, 0x54a960d2 +0, 403200, 38016, 0xc0b468e7 +0, 406800, 38016, 0xe1ef485a +0, 410400, 38016, 0x025f27e6 +0, 414000, 38016, 0x14da215e +0, 417600, 38016, 0xe8f2394a +0, 421200, 38016, 0x7c7a44e8 +0, 424800, 38016, 0xdb2e54c3 +0, 428400, 38016, 0xae5c5eee +0, 432000, 38016, 0x74ae643f +0, 435600, 38016, 0x70146b61 +0, 439200, 38016, 0x545c5265 +0, 442800, 38016, 0xe5a92556 +0, 446400, 38016, 0xf19e04e8 +0, 450000, 38016, 0xda51e574 +0, 453600, 38016, 0x4c17ded9 +0, 457200, 38016, 0x51fce958 +0, 460800, 38016, 0xae96fd16 +0, 464400, 38016, 0x7a610e32 +0, 468000, 38016, 0x06f31a06 +0, 471600, 38016, 0x658a1998 +0, 475200, 38016, 0xda370e80 +0, 478800, 38016, 0xe7a00dca +0, 482400, 38016, 0xb07a0810 +0, 486000, 38016, 0x193c01a3 +0, 489600, 38016, 0xa700fd8f +0, 493200, 38016, 0x8c14ed46 +0, 496800, 38016, 0xcd81dc72 +0, 500400, 38016, 0x67acd3bb +0, 504000, 38016, 0x662cc586 +0, 507600, 38016, 0xa09ac106 +0, 511200, 38016, 0xf1abab73 +0, 514800, 38016, 0xfd9ba674 +0, 518400, 38016, 0x7686ae41 +0, 522000, 38016, 0x7185a2e9 +0, 525600, 38016, 0x2b5898da +0, 529200, 38016, 0x3cdd6c42 +0, 532800, 38016, 0x0299414d +0, 536400, 38016, 0x2b851a52 +0, 540000, 38016, 0x01c8ff7b +0, 543600, 38016, 0x55d3f715 +0, 547200, 38016, 0xbe5ff38e +0, 550800, 38016, 0xc31fe232 +0, 554400, 38016, 0x3201dc26 +0, 558000, 38016, 0xf8feed84 +0, 561600, 38016, 0x0a471009 +0, 565200, 38016, 0xef0d351d +0, 568800, 38016, 0x79de6f09 +0, 572400, 38016, 0xa5039be4 +0, 576000, 38016, 0x4e1cafa6 +0, 579600, 38016, 0x2a71aea1 +0, 583200, 38016, 0xa99e9d08 +0, 586800, 38016, 0x80aa8a6a +0, 590400, 38016, 0x9f287bb9 +0, 594000, 38016, 0x2ddc5ef7 +0, 597600, 38016, 0x31843470 +0, 601200, 38016, 0x08f3074e +0, 604800, 38016, 0xa639e58d +0, 608400, 38016, 0xcf31d61f +0, 612000, 38016, 0x1ac7e986 +0, 615600, 38016, 0x9bbbfe98 +0, 619200, 38016, 0x3e0d0ce1 +0, 622800, 38016, 0x53240e4c +0, 626400, 38016, 0xda6bf0d5 +0, 630000, 38016, 0x1701c355 +0, 633600, 38016, 0x572c8b1d +0, 637200, 38016, 0x1f4f5a14 +0, 640800, 38016, 0x0fea3e61 +0, 644400, 38016, 0xa71c29ed +0, 648000, 38016, 0xd3b218fb +0, 651600, 38016, 0x228e05f8 +0, 655200, 38016, 0x4b8bfa9e +0, 658800, 38016, 0x13d505ab +0, 662400, 38016, 0xa58808b3 +0, 666000, 38016, 0x4b2a1329 +0, 669600, 38016, 0x13c63567 +0, 673200, 38016, 0x4ece56f8 +0, 676800, 38016, 0x934f67c3 +0, 680400, 38016, 0x2b606f56 +0, 684000, 38016, 0xba481841 +0, 687600, 38016, 0x1488ea11 +0, 691200, 38016, 0x066cefeb +0, 694800, 38016, 0xb23105b7 +0, 698400, 38016, 0x64312267 +0, 702000, 38016, 0xd0cf6a37 +0, 705600, 38016, 0xb5a482c5 +0, 709200, 38016, 0x61289957 +0, 712800, 38016, 0x26a6ba47 +0, 716400, 38016, 0xb771d25e +0, 720000, 38016, 0xedb5de8d +0, 723600, 38016, 0x4fd2e829 +0, 727200, 38016, 0xbef3ef1f +0, 730800, 38016, 0x5e0ef333 +0, 734400, 38016, 0x5081f460 +0, 738000, 38016, 0x6798fe84 +0, 741600, 38016, 0x28ce0078 +0, 745200, 38016, 0x9fb4f6a1 +0, 748800, 38016, 0x0a02e822 +0, 752400, 38016, 0x5615d41e +0, 756000, 38016, 0x1a3bc214 +0, 759600, 38016, 0x5333b48a +0, 763200, 38016, 0x646da3c9 +0, 766800, 38016, 0x024fa1b1 +0, 770400, 38016, 0x7b4892de +0, 774000, 38016, 0x10ab8953 +0, 777600, 38016, 0x8aa28410 +0, 781200, 38016, 0xcbd185be +0, 784800, 38016, 0xfa49818a +0, 788400, 38016, 0x0f7a82d5 +0, 792000, 38016, 0xb86f716d +0, 795600, 38016, 0xd22a6050 +0, 799200, 38016, 0x89a4520e +0, 802800, 38016, 0x8a1147cf +0, 806400, 38016, 0xa02a4196 +0, 810000, 38016, 0xece240f7 +0, 813600, 38016, 0xa5b940ff +0, 817200, 38016, 0x9b274ce8 +0, 820800, 38016, 0xba0b68c7 +0, 824400, 38016, 0x39f28a91 +0, 828000, 38016, 0xc070af11 +0, 831600, 38016, 0x2a26d309 +0, 835200, 38016, 0xfa9afe77 +0, 838800, 38016, 0xe2f22ebf +0, 842400, 38016, 0xf8ee4a45 +0, 846000, 38016, 0x14186047 +0, 849600, 38016, 0xe3407152 +0, 853200, 38016, 0xcef578b8 +0, 856800, 38016, 0x3fc06964 +0, 860400, 38016, 0xa7da3ade +0, 864000, 38016, 0xa46d1b2b +0, 867600, 38016, 0x14abfac5 +0, 871200, 38016, 0xbffbf269 +0, 874800, 38016, 0x1d9c3ade +0, 878400, 38016, 0xc9c39c46 +0, 882000, 38016, 0x824afa80 +0, 885600, 38016, 0xc76611b8 +0, 889200, 38016, 0x31fce0d6 +0, 892800, 38016, 0x6740a03f +0, 896400, 38016, 0x91d63134 +0, 900000, 38016, 0xb0f6cc86 +0, 903600, 38016, 0x3d878a14 +0, 907200, 38016, 0x1d008063 +0, 910800, 38016, 0xe47cd260 +0, 914400, 38016, 0x56503400 +0, 918000, 38016, 0xb201dc61 +0, 921600, 38016, 0xba42de1b +0, 925200, 38016, 0x9c115ccb +0, 928800, 38016, 0xe9be47d9 +0, 932400, 38016, 0xa7684b02 +0, 936000, 38016, 0xb4d74f42 +0, 939600, 38016, 0xbe006415 +0, 943200, 38016, 0xa30c7858 +0, 946800, 38016, 0x838f7f47 +0, 950400, 38016, 0xc1c28346 +0, 954000, 38016, 0xc7737219 +0, 957600, 38016, 0xa19a5fd5 +0, 961200, 38016, 0x56a64b00 +0, 964800, 38016, 0x6b672497 +0, 968400, 38016, 0x4cfafbe2 +0, 972000, 38016, 0xbe53d51b +0, 975600, 38016, 0x4a86acc7 +0, 979200, 38016, 0x297288b0 +0, 982800, 38016, 0xd4bd2ec9 +0, 986400, 38016, 0x3697e2f6 +0, 990000, 38016, 0xa493d289 +0, 993600, 38016, 0xb2b9e324 +0, 997200, 38016, 0x998de275 +0, 1000800, 38016, 0x422a10cb +0, 1004400, 38016, 0x845383b4 +0, 1008000, 38016, 0xb4a72107 +0, 1011600, 38016, 0x0e0eef6b +0, 1015200, 38016, 0xbd8bbd01 +0, 1018800, 38016, 0x2f217c45 +0, 1022400, 38016, 0xb3515be7 +0, 1026000, 38016, 0xb633a542 +0, 1029600, 38016, 0x7e7a7086 +0, 1033200, 38016, 0xef64a834 +0, 1036800, 38016, 0x7b81bdad +0, 1040400, 38016, 0x0fc7a7d2 +0, 1044000, 38016, 0x9111351d +0, 1047600, 38016, 0x161c43dc +0, 1051200, 38016, 0x945fce2a +0, 1054800, 38016, 0x48780c38 +0, 1058400, 38016, 0x28904d31 +0, 1062000, 38016, 0x140d47d5 +0, 1065600, 38016, 0x1f5e257c +0, 1069200, 38016, 0xb36a159c +0, 1072800, 38016, 0x85ad2465 +0, 1076400, 38016, 0x973649e0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nl3_sva_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nl3_sva_e new file mode 100644 index 00000000..4664afbf --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nl3_sva_e @@ -0,0 +1,33 @@ +0, 0, 38016, 0x2fad15e2 +0, 3600, 38016, 0x7e391566 +0, 7200, 38016, 0x954001d4 +0, 10800, 38016, 0xe5ae2057 +0, 14400, 38016, 0xface3d5e +0, 18000, 38016, 0x2b2361cd +0, 21600, 38016, 0x5e906b5a +0, 25200, 38016, 0xa46398e5 +0, 28800, 38016, 0x2a3ea141 +0, 32400, 38016, 0xa2a0beac +0, 36000, 38016, 0x4830ab90 +0, 39600, 38016, 0xdd53d0fc +0, 43200, 38016, 0x4d71ae7d +0, 46800, 38016, 0x2290a25e +0, 50400, 38016, 0x8baa6cca +0, 54000, 38016, 0xc3e99458 +0, 57600, 38016, 0x5c608374 +0, 61200, 38016, 0x6443aa6c +0, 64800, 38016, 0x1ef7991c +0, 68400, 38016, 0xd246b49b +0, 72000, 38016, 0xe181a026 +0, 75600, 38016, 0x878db497 +0, 79200, 38016, 0x071079c2 +0, 82800, 38016, 0xa94a62fa +0, 86400, 38016, 0xa9da278f +0, 90000, 38016, 0x247b3195 +0, 93600, 38016, 0xd7f81a90 +0, 97200, 38016, 0x9c303cdc +0, 100800, 38016, 0x646e42a1 +0, 104400, 38016, 0x474a613d +0, 108000, 38016, 0x63255932 +0, 111600, 38016, 0x2f0569e4 +0, 115200, 38016, 0x1f525192 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nlmq1_jvc_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nlmq1_jvc_c new file mode 100644 index 00000000..e9fca861 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nlmq1_jvc_c @@ -0,0 +1,30 @@ +0, 0, 38016, 0xde1a2194 +0, 3600, 38016, 0x2957f3e5 +0, 7200, 38016, 0x9df4c6cf +0, 10800, 38016, 0xf3db9f2d +0, 14400, 38016, 0xd97474db +0, 18000, 38016, 0x8e3065fa +0, 21600, 38016, 0xc0be49b1 +0, 25200, 38016, 0xa69c3f06 +0, 28800, 38016, 0x96bb2e92 +0, 32400, 38016, 0x1ca232c1 +0, 36000, 38016, 0x3a06409d +0, 39600, 38016, 0xcdce66e5 +0, 43200, 38016, 0x96387681 +0, 46800, 38016, 0xd0309561 +0, 50400, 38016, 0xb7b08c49 +0, 54000, 38016, 0xf5709355 +0, 57600, 38016, 0x3c1594ea +0, 61200, 38016, 0x9be48a2c +0, 64800, 38016, 0xdf7279c3 +0, 68400, 38016, 0xe3b660f3 +0, 72000, 38016, 0xd72a3cbe +0, 75600, 38016, 0x06a117d1 +0, 79200, 38016, 0x8f5501b7 +0, 82800, 38016, 0x8f5afd81 +0, 86400, 38016, 0x98ecfd2b +0, 90000, 38016, 0xd0b103bf +0, 93600, 38016, 0xb9a7035c +0, 97200, 38016, 0x866c12c7 +0, 100800, 38016, 0x3a0329f3 +0, 104400, 38016, 0x725141c1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nlmq2_jvc_c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nlmq2_jvc_c new file mode 100644 index 00000000..a2c7c5a7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nlmq2_jvc_c @@ -0,0 +1,30 @@ +0, 0, 38016, 0xde1a2194 +0, 3600, 38016, 0x8b6cf842 +0, 7200, 38016, 0x6dc7c88b +0, 10800, 38016, 0xdaefa55d +0, 14400, 38016, 0x61b77631 +0, 18000, 38016, 0xfd096789 +0, 21600, 38016, 0x69204c43 +0, 25200, 38016, 0x2c8e40c0 +0, 28800, 38016, 0xa4f33298 +0, 32400, 38016, 0x67193923 +0, 36000, 38016, 0x0b634893 +0, 39600, 38016, 0x7ced69e1 +0, 43200, 38016, 0xc20179dc +0, 46800, 38016, 0x9d4d94b9 +0, 50400, 38016, 0xf4158e1a +0, 54000, 38016, 0xf24b986a +0, 57600, 38016, 0x3fd39baf +0, 61200, 38016, 0xc0f991b9 +0, 64800, 38016, 0xe3a98216 +0, 68400, 38016, 0x37246882 +0, 72000, 38016, 0xad5745b0 +0, 75600, 38016, 0x42831ea7 +0, 79200, 38016, 0x14530a1b +0, 82800, 38016, 0x1a9f03a8 +0, 86400, 38016, 0x34f905f3 +0, 90000, 38016, 0x94300e93 +0, 93600, 38016, 0xcda00be5 +0, 97200, 38016, 0x607516d6 +0, 100800, 38016, 0xabb02c3b +0, 104400, 38016, 0xcf3746bf diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nrf_mw_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nrf_mw_e new file mode 100644 index 00000000..425ee75d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-nrf_mw_e @@ -0,0 +1,100 @@ +0, 0, 38016, 0x3ae838ee +0, 3600, 38016, 0x9ed7e141 +0, 7200, 38016, 0x354e83ed +0, 10800, 38016, 0x96754ff4 +0, 14400, 38016, 0x2a013a3c +0, 18000, 38016, 0x57ab4cf2 +0, 21600, 38016, 0x55037493 +0, 25200, 38016, 0x910b8920 +0, 28800, 38016, 0x457785a1 +0, 32400, 38016, 0x9d6864ad +0, 36000, 38016, 0xe80131ce +0, 39600, 38016, 0x4cd7f487 +0, 43200, 38016, 0x030df59a +0, 46800, 38016, 0x6ea60426 +0, 50400, 38016, 0x35311f71 +0, 54000, 38016, 0x731450d8 +0, 57600, 38016, 0x29368c47 +0, 61200, 38016, 0x006292b0 +0, 64800, 38016, 0x961493b1 +0, 68400, 38016, 0xb2e99a07 +0, 72000, 38016, 0xa52f98be +0, 75600, 38016, 0x8c0a8f70 +0, 79200, 38016, 0xdc5b992c +0, 82800, 38016, 0xa4a49787 +0, 86400, 38016, 0x7a959608 +0, 90000, 38016, 0xc9619c0a +0, 93600, 38016, 0xb5519a7e +0, 97200, 38016, 0x05ea9d9b +0, 100800, 38016, 0xf73fac90 +0, 104400, 38016, 0x0cd4b3d8 +0, 108000, 38016, 0xb3119df6 +0, 111600, 38016, 0xb8db5d78 +0, 115200, 38016, 0xfb633ee0 +0, 118800, 38016, 0xed1c8935 +0, 122400, 38016, 0x421fedd1 +0, 126000, 38016, 0xa4b84473 +0, 129600, 38016, 0x25598f81 +0, 133200, 38016, 0x92de1dd7 +0, 136800, 38016, 0x776b68c5 +0, 140400, 38016, 0x07b49a7a +0, 144000, 38016, 0x883ccd79 +0, 147600, 38016, 0xb351e0fc +0, 151200, 38016, 0x5577d53b +0, 154800, 38016, 0xffd9ef7d +0, 158400, 38016, 0x38c1fc8b +0, 162000, 38016, 0xb9abf3e6 +0, 165600, 38016, 0x2191b0d6 +0, 169200, 38016, 0x313397a3 +0, 172800, 38016, 0x96bca02a +0, 176400, 38016, 0xd39ac859 +0, 180000, 38016, 0xfb31e18f +0, 183600, 38016, 0xe182b468 +0, 187200, 38016, 0x8af7dfd6 +0, 190800, 38016, 0x7c19fd4f +0, 194400, 38016, 0xa8373bae +0, 198000, 38016, 0x91055016 +0, 201600, 38016, 0x432b5d52 +0, 205200, 38016, 0x81301b3f +0, 208800, 38016, 0x0d6c2367 +0, 212400, 38016, 0xf0023ac2 +0, 216000, 38016, 0xb9f33791 +0, 219600, 38016, 0xdab62201 +0, 223200, 38016, 0xfab7cfdd +0, 226800, 38016, 0xfbb2a78f +0, 230400, 38016, 0xe317c687 +0, 234000, 38016, 0xe4f5d939 +0, 237600, 38016, 0x022dda5b +0, 241200, 38016, 0x8b5cdf2c +0, 244800, 38016, 0x3dfec699 +0, 248400, 38016, 0x9484a75c +0, 252000, 38016, 0x763a911b +0, 255600, 38016, 0xb1fb7cc8 +0, 259200, 38016, 0x56bf7f7b +0, 262800, 38016, 0x87567e3e +0, 266400, 38016, 0x1aa1209e +0, 270000, 38016, 0xe2b0da25 +0, 273600, 38016, 0xd250c706 +0, 277200, 38016, 0xbea1be9d +0, 280800, 38016, 0x02f0e6fb +0, 284400, 38016, 0xd18d382b +0, 288000, 38016, 0xd0fa57f3 +0, 291600, 38016, 0x873b43e3 +0, 295200, 38016, 0x75b33855 +0, 298800, 38016, 0xcabbe932 +0, 302400, 38016, 0xeded9c0f +0, 306000, 38016, 0x86b0b9ec +0, 309600, 38016, 0xb461e10d +0, 313200, 38016, 0x6702dbbe +0, 316800, 38016, 0xb3e47c8c +0, 320400, 38016, 0xd71333ee +0, 324000, 38016, 0x15c3f15d +0, 327600, 38016, 0xa7e6bb4e +0, 331200, 38016, 0x5d5bd15b +0, 334800, 38016, 0x2476f6b0 +0, 338400, 38016, 0xbee21b05 +0, 342000, 38016, 0x8172d7b9 +0, 345600, 38016, 0x4893b4b2 +0, 349200, 38016, 0xfda7ed23 +0, 352800, 38016, 0xc1ff4cb4 +0, 356400, 38016, 0x9fdc8cc4 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_field_1_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_field_1_b new file mode 100644 index 00000000..7fc503ed --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_field_1_b @@ -0,0 +1,15 @@ +0, 0, 518400, 0xc93c7c47 +0, 3600, 518400, 0xa3f2e502 +0, 7200, 518400, 0xb98920a4 +0, 10800, 518400, 0xad098ec1 +0, 14400, 518400, 0x3009b7aa +0, 18000, 518400, 0xcf514018 +0, 21600, 518400, 0xd869038d +0, 25200, 518400, 0x3ce5e188 +0, 28800, 518400, 0x029b4c14 +0, 32400, 518400, 0xd2224afc +0, 36000, 518400, 0xbbca027c +0, 39600, 518400, 0x1f3fa0ac +0, 43200, 518400, 0x823b0125 +0, 46800, 518400, 0xaaa27cfb +0, 50400, 518400, 0x5e926a4a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_field_2_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_field_2_b new file mode 100644 index 00000000..ec278fa3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_field_2_b @@ -0,0 +1,15 @@ +0, 0, 518400, 0xc93c7c47 +0, 3600, 518400, 0xf0c4b44a +0, 7200, 518400, 0x3f5dc91c +0, 10800, 518400, 0x03dc8453 +0, 14400, 518400, 0x5e5227af +0, 18000, 518400, 0x9e7136af +0, 21600, 518400, 0x963a2e3a +0, 25200, 518400, 0xa544be6c +0, 28800, 518400, 0xefa1f63a +0, 32400, 518400, 0x62155ff1 +0, 36000, 518400, 0x253eb857 +0, 39600, 518400, 0x73530327 +0, 43200, 518400, 0x8920c9a3 +0, 46800, 518400, 0x4bdd038c +0, 50400, 518400, 0xea6016dd diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_field_3_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_field_3_b new file mode 100644 index 00000000..efdd491a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_field_3_b @@ -0,0 +1,15 @@ +0, 0, 518400, 0xc93c7c47 +0, 3600, 518400, 0x7112ac25 +0, 7200, 518400, 0x28bc28d2 +0, 10800, 518400, 0x6fc36875 +0, 14400, 518400, 0x3de99be0 +0, 18000, 518400, 0x97125499 +0, 21600, 518400, 0xb96fca3a +0, 25200, 518400, 0x1ec56c0f +0, 28800, 518400, 0xc65901d0 +0, 32400, 518400, 0x2baa1bfa +0, 36000, 518400, 0x244fc6b7 +0, 39600, 518400, 0xc3536383 +0, 43200, 518400, 0xbcf40d5a +0, 46800, 518400, 0x955f4734 +0, 50400, 518400, 0xe1b0275e diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_paff_1r2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_paff_1r2 new file mode 100644 index 00000000..08241321 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_paff_1r2 @@ -0,0 +1,15 @@ +0, 0, 518400, 0xc93c7c47 +0, 3600, 518400, 0xfb452a9c +0, 7200, 518400, 0x2f7a35bd +0, 10800, 518400, 0xe63e30b9 +0, 14400, 518400, 0x39628205 +0, 18000, 518400, 0x17fa1ea4 +0, 21600, 518400, 0xd5ee83e2 +0, 25200, 518400, 0x611ee98d +0, 28800, 518400, 0x07c1eeb8 +0, 32400, 518400, 0x9dff3418 +0, 36000, 518400, 0x87cd2f56 +0, 39600, 518400, 0x88675628 +0, 43200, 518400, 0x9bb8c9a0 +0, 46800, 518400, 0xe6c1df00 +0, 50400, 518400, 0xfcaab7a7 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_paff_2r b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_paff_2r new file mode 100644 index 00000000..b41a1311 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sharp_mp_paff_2r @@ -0,0 +1,15 @@ +0, 0, 518400, 0xc93c7c47 +0, 3600, 518400, 0xfb452a9c +0, 7200, 518400, 0x2f7a35bd +0, 10800, 518400, 0xe63e30b9 +0, 14400, 518400, 0x39628205 +0, 18000, 518400, 0x17fa1ea4 +0, 21600, 518400, 0xd5ee83e2 +0, 25200, 518400, 0x4fd6d5c9 +0, 28800, 518400, 0x8703c999 +0, 32400, 518400, 0x1a87e2d3 +0, 36000, 518400, 0xa27fc4d0 +0, 39600, 518400, 0x6effab5d +0, 43200, 518400, 0x51ea02c9 +0, 46800, 518400, 0xbcf84c88 +0, 50400, 518400, 0x1d41076b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sl1_sva_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sl1_sva_b new file mode 100644 index 00000000..b218a588 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sl1_sva_b @@ -0,0 +1,33 @@ +0, 0, 38016, 0x666c110c +0, 3600, 38016, 0xc87421f6 +0, 7200, 38016, 0x1b74033d +0, 10800, 38016, 0x21fe21c7 +0, 14400, 38016, 0x8f03321e +0, 18000, 38016, 0xdbd46290 +0, 21600, 38016, 0x316a57d4 +0, 25200, 38016, 0x0a688f29 +0, 28800, 38016, 0x8bb890d5 +0, 32400, 38016, 0x4210c0a4 +0, 36000, 38016, 0x45f6b0e7 +0, 39600, 38016, 0x5feed346 +0, 43200, 38016, 0x22aea97e +0, 46800, 38016, 0x8d96a049 +0, 50400, 38016, 0xe623654c +0, 54000, 38016, 0xccd17c75 +0, 57600, 38016, 0x32ca7712 +0, 61200, 38016, 0x2fe49df2 +0, 64800, 38016, 0x6ee49068 +0, 68400, 38016, 0x74a0ba36 +0, 72000, 38016, 0x5079a13c +0, 75600, 38016, 0xfd20a991 +0, 79200, 38016, 0xfc987386 +0, 82800, 38016, 0xa1f66a0b +0, 86400, 38016, 0xd7112683 +0, 90000, 38016, 0xb60b3784 +0, 93600, 38016, 0x9e621ca3 +0, 97200, 38016, 0xd9264308 +0, 100800, 38016, 0x00db43fb +0, 104400, 38016, 0x665a5b34 +0, 108000, 38016, 0x582050ce +0, 111600, 38016, 0x52b95de5 +0, 115200, 38016, 0x95d8445e diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_ba1_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_ba1_b new file mode 100644 index 00000000..0cb825aa --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_ba1_b @@ -0,0 +1,17 @@ +0, 0, 38016, 0x359316a1 +0, 3600, 38016, 0xd5fafa54 +0, 7200, 38016, 0xea99e9be +0, 10800, 38016, 0xd680f3db +0, 14400, 38016, 0x8b771545 +0, 18000, 38016, 0xff8c3073 +0, 21600, 38016, 0x543d403a +0, 25200, 38016, 0xd2136010 +0, 28800, 38016, 0x11d17cd3 +0, 32400, 38016, 0xd8c69527 +0, 36000, 38016, 0x070d9a08 +0, 39600, 38016, 0xc8e3b21d +0, 43200, 38016, 0xe903b09e +0, 46800, 38016, 0x30ba9ece +0, 50400, 38016, 0xb32482a4 +0, 54000, 38016, 0x56cf8ea3 +0, 57600, 38016, 0x0b41abd0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_ba2_d b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_ba2_d new file mode 100644 index 00000000..90337a2e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_ba2_d @@ -0,0 +1,17 @@ +0, 0, 38016, 0x359316a1 +0, 3600, 38016, 0xd7bb1285 +0, 7200, 38016, 0x3c36059f +0, 10800, 38016, 0x983d195f +0, 14400, 38016, 0xba323cc5 +0, 18000, 38016, 0xc9db4f32 +0, 21600, 38016, 0xc2a06817 +0, 25200, 38016, 0x18018392 +0, 28800, 38016, 0x8b4da14c +0, 32400, 38016, 0x5a33b0f5 +0, 36000, 38016, 0x5b48b808 +0, 39600, 38016, 0xfc13c523 +0, 43200, 38016, 0xb915c169 +0, 46800, 38016, 0xfaab94ed +0, 50400, 38016, 0xe455786f +0, 54000, 38016, 0x529182a8 +0, 57600, 38016, 0xfb6893a9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_base_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_base_b new file mode 100644 index 00000000..56cc9c63 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_base_b @@ -0,0 +1,17 @@ +0, 0, 38016, 0x1c131302 +0, 3600, 38016, 0xbbca0c4f +0, 7200, 38016, 0x81f5fd7b +0, 10800, 38016, 0xc8990c96 +0, 14400, 38016, 0xd4c337ce +0, 18000, 38016, 0xc4544ee1 +0, 21600, 38016, 0x5de26832 +0, 25200, 38016, 0xc1fc7ba9 +0, 28800, 38016, 0x5fea9c67 +0, 32400, 38016, 0xfa0aaf63 +0, 36000, 38016, 0xa7f6c07d +0, 39600, 38016, 0x11a0c6ff +0, 43200, 38016, 0xfdefc3a0 +0, 46800, 38016, 0xdb729a49 +0, 50400, 38016, 0x9b5e7f0b +0, 54000, 38016, 0x6a047ea9 +0, 57600, 38016, 0xd8c29302 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_cl1_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_cl1_e new file mode 100644 index 00000000..af1dbab5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_cl1_e @@ -0,0 +1,50 @@ +0, 0, 38016, 0x6811161f +0, 3600, 38016, 0x243a0d4e +0, 7200, 38016, 0x0bc700de +0, 10800, 38016, 0x30db1659 +0, 14400, 38016, 0xf88d3f1a +0, 18000, 38016, 0xb37d5bd2 +0, 21600, 38016, 0x93f46c04 +0, 25200, 38016, 0xdb9878d0 +0, 28800, 38016, 0x92509f3a +0, 32400, 38016, 0xd63badea +0, 36000, 38016, 0xb942b664 +0, 39600, 38016, 0x703bc4ee +0, 43200, 38016, 0xa78abfcd +0, 46800, 38016, 0x4e1b96d8 +0, 50400, 38016, 0xaed371ac +0, 54000, 38016, 0x2c917f89 +0, 57600, 38016, 0x57c29c96 +0, 61200, 38016, 0xaf1fb16a +0, 64800, 38016, 0x257eb325 +0, 68400, 38016, 0x7701b0f9 +0, 72000, 38016, 0x7074c151 +0, 75600, 38016, 0x9778b1fe +0, 79200, 38016, 0x9c2e8c0c +0, 82800, 38016, 0x394276e9 +0, 86400, 38016, 0x2f5157bc +0, 90000, 38016, 0xfb313ee7 +0, 93600, 38016, 0xbc6349c3 +0, 97200, 38016, 0xdca95a0c +0, 100800, 38016, 0x53c46d45 +0, 104400, 38016, 0x62867764 +0, 108000, 38016, 0x87847fa3 +0, 111600, 38016, 0x74527d90 +0, 115200, 38016, 0x5c7a7779 +0, 118800, 38016, 0xeafd7e73 +0, 122400, 38016, 0x63aa7d06 +0, 126000, 38016, 0x2bc06fd2 +0, 129600, 38016, 0x058a7eae +0, 133200, 38016, 0xc51a6f85 +0, 136800, 38016, 0xb49e6b0b +0, 140400, 38016, 0x881a5997 +0, 144000, 38016, 0x5e4956b7 +0, 147600, 38016, 0x835441a0 +0, 151200, 38016, 0x212933cd +0, 154800, 38016, 0x914031bd +0, 158400, 38016, 0x29b63d29 +0, 162000, 38016, 0x03a03b60 +0, 165600, 38016, 0x282e1a0f +0, 169200, 38016, 0x8964f214 +0, 172800, 38016, 0x23a9c5f9 +0, 176400, 38016, 0x04f9a780 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_fm1_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_fm1_e new file mode 100644 index 00000000..f83a51b6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_fm1_e @@ -0,0 +1,17 @@ +0, 0, 38016, 0x1c131302 +0, 3600, 38016, 0x89dd0c15 +0, 7200, 38016, 0xaf7700bd +0, 10800, 38016, 0x220d1115 +0, 14400, 38016, 0x76d0354e +0, 18000, 38016, 0x9e514b93 +0, 21600, 38016, 0x20ff5e7c +0, 25200, 38016, 0xd9cb7e01 +0, 28800, 38016, 0x26b7992d +0, 32400, 38016, 0xa29dac84 +0, 36000, 38016, 0x407cb6e8 +0, 39600, 38016, 0xe82cc064 +0, 43200, 38016, 0x63ddb80f +0, 46800, 38016, 0xec6f93a1 +0, 50400, 38016, 0x5f217759 +0, 54000, 38016, 0x341982ba +0, 57600, 38016, 0x3f48980c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_nl1_b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_nl1_b new file mode 100644 index 00000000..074e656b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_nl1_b @@ -0,0 +1,17 @@ +0, 0, 38016, 0xb9ac19bd +0, 3600, 38016, 0x3898fc35 +0, 7200, 38016, 0xf6f4ed19 +0, 10800, 38016, 0xc31af64b +0, 14400, 38016, 0x42161687 +0, 18000, 38016, 0xe88133a3 +0, 21600, 38016, 0xebb5415a +0, 25200, 38016, 0x643c62ac +0, 28800, 38016, 0x7ad68041 +0, 32400, 38016, 0x2625981b +0, 36000, 38016, 0x1a839bbf +0, 39600, 38016, 0xe41db3a9 +0, 43200, 38016, 0x894eb2dd +0, 46800, 38016, 0x4633a2a2 +0, 50400, 38016, 0xeb848787 +0, 54000, 38016, 0x23c590b0 +0, 57600, 38016, 0xc7cbaf63 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_nl2_e b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_nl2_e new file mode 100644 index 00000000..6c0a40ed --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-conformance-sva_nl2_e @@ -0,0 +1,17 @@ +0, 0, 38016, 0xb9ac19bd +0, 3600, 38016, 0x53c91566 +0, 7200, 38016, 0xb5bd089f +0, 10800, 38016, 0xb81320bb +0, 14400, 38016, 0x7c793dce +0, 18000, 38016, 0x3d605b31 +0, 21600, 38016, 0x40216830 +0, 25200, 38016, 0x11c48f52 +0, 28800, 38016, 0x0f37a013 +0, 32400, 38016, 0xb06cb753 +0, 36000, 38016, 0x6233ca83 +0, 39600, 38016, 0x02b6d5a1 +0, 43200, 38016, 0xf76cc409 +0, 46800, 38016, 0xd19fa5c3 +0, 50400, 38016, 0x8d1c8a02 +0, 54000, 38016, 0x6802966d +0, 57600, 38016, 0x107fb055 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-extreme-plane-pred b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-extreme-plane-pred new file mode 100644 index 00000000..d8bee85b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-extreme-plane-pred @@ -0,0 +1,100 @@ +0, 0, 152064, 1e857d2dfeea75297e090ffe9e37a249 +0, 3600, 152064, 29d8336b4e9b77298025074dbad641d1 +0, 7200, 152064, 3f1a87d2088a7708f4ed06890c8cd018 +0, 10800, 152064, 56b8b8d9fefbd501c4f7918f21f9b015 +0, 14400, 152064, 597392c162ea79af1e5d3dd552ffeb47 +0, 18000, 152064, 064fdd170aa24463409b1cb0ddc7f5b6 +0, 21600, 152064, 9924da4026b10110fa644039e73f92c1 +0, 25200, 152064, afdb77f4a4c87faaf35988bf2d1d7c18 +0, 28800, 152064, 80714dc3bf376f38c00f8c67fc534fae +0, 32400, 152064, fb0ab4028e1e9879b0bf0e414c0ccb33 +0, 36000, 152064, 03c694f4b9e6116214078131f3edff91 +0, 39600, 152064, 22d2de0d8f9e5477230b50c50ec46269 +0, 43200, 152064, 470e9a6c5bbb15e151afbfd6b2f254a3 +0, 46800, 152064, b585555552169640b1a896094335b624 +0, 50400, 152064, e261e0f650e6d649a35773520e7f5bff +0, 54000, 152064, 2d1bf889eef057016e473a041fbceac0 +0, 57600, 152064, b1a3f8ebf1de26bc8c32d47a4a53c862 +0, 61200, 152064, d5cdb80386dbb996ca007a0e210a9905 +0, 64800, 152064, 05a200df7b8baa19d2a0309476727dd7 +0, 68400, 152064, 890d62163f4aa70a2055d50de0395a35 +0, 72000, 152064, c00bdd1c5f0d69bae66ba46a897ad0ad +0, 75600, 152064, 65f76c6d453822eb48b180ac630cbdce +0, 79200, 152064, d6b85fc02c6d8efa53a9f0f148a0520e +0, 82800, 152064, adcb1621c5100b8e201592328bcd11be +0, 86400, 152064, bad7da936734cf4304c1564d6d3e74b9 +0, 90000, 152064, a98d1232d0c22e6967415700d980c67f +0, 93600, 152064, 3fa1110c3ada7d37f0495a26774a58fb +0, 97200, 152064, 37613c65cfd3d77e8dda3b5b913e467f +0, 100800, 152064, 42a5cf583a82e722e04c04b10fd36542 +0, 104400, 152064, 41c2870e102e3584780cd0243baa1900 +0, 108000, 152064, da389397c874f5fd974c57278bd1e327 +0, 111600, 152064, 238c265971ef9144d3fe6bc95a2ea060 +0, 115200, 152064, 085c83a54aa9327e1e3ee76ffa337538 +0, 118800, 152064, f462966f59018b39c10f9a65a80a41f8 +0, 122400, 152064, 6e9697b7c8193b38551af4ef56861b7a +0, 126000, 152064, e68113abf3e81a28cafd95d91871886e +0, 129600, 152064, 35a78df5ac1ff6ee469626b750241c9b +0, 133200, 152064, b3302a87e334634a9f92ce51acf96ab3 +0, 136800, 152064, 52198528552cefe90004a2b045b33e8f +0, 140400, 152064, 12d9ad991d4bb7935342c8b6474d1726 +0, 144000, 152064, 2e6a508aba965f292c7b2e82bd0debbe +0, 147600, 152064, 8daff69112bb5fbc0158cbbf7fbe057e +0, 151200, 152064, 5495a0bb6c88a115957d98b272b0d643 +0, 154800, 152064, 955db92ab0c482381200247a207e12bc +0, 158400, 152064, c0f81c5f95fd658c153798a514fedd22 +0, 162000, 152064, 3cfc7b9c2d73621cdb04d7e7e8bc2b3b +0, 165600, 152064, e8b6d1d526d6443cba2e64ccd5393a4f +0, 169200, 152064, 7722e2420db0279c9eb7c6f7dfa89c07 +0, 172800, 152064, 41b908a50b97a2e927f2e6e285e27592 +0, 176400, 152064, e05f0ddd08debc2a0578893662c33ce0 +0, 180000, 152064, 1edcedca921dbb68c0ce53371abddd8f +0, 183600, 152064, cdbf0c89feb336e58472f0163e43b02b +0, 187200, 152064, 39c4d20ecfeee09800feae5ad783e0bd +0, 190800, 152064, f60d05d20b3f338aa5917490d2b58f77 +0, 194400, 152064, 76e5eae7a5205f6f6aaf8099197dbb1f +0, 198000, 152064, f7c4c80e79b691826915b7810ab7c2a6 +0, 201600, 152064, afbc098dcaa8c2a3f41dfc3e846e8e7b +0, 205200, 152064, 6582805bbe4ab9a9138a23deb2ca45a8 +0, 208800, 152064, 54444ce52dd1ce7bc24e9cbaba89dc59 +0, 212400, 152064, c81193469c0cd5a50c451d869e07a786 +0, 216000, 152064, 89f2295b63db3adce2961630569749a5 +0, 219600, 152064, 3f4d6dd4dd819168a358384d6b134d00 +0, 223200, 152064, 45d3b5c72609a15c1be5a45f790a24c4 +0, 226800, 152064, f2283a8bf9599754d2e251c5f0861199 +0, 230400, 152064, 06a9ccf8132c494884954bb4cc148c11 +0, 234000, 152064, e20e0143fc840db46a88a8556d887ea2 +0, 237600, 152064, bcb1ca471f70109293a15b7e1b0f3a7f +0, 241200, 152064, 0c5f59f091b3fd5ced9bb626e5b66ec8 +0, 244800, 152064, 4dd6cf80daf74390afe0423f726c2fb6 +0, 248400, 152064, fd52e6d570960cf100ac7c973dbd222e +0, 252000, 152064, 684758faa9b5517b2e5dbbabccc6125b +0, 255600, 152064, e538a3bcb2125c8ac324a5be49470960 +0, 259200, 152064, 0c91795b7f52e942a1c28b4c6510c6fa +0, 262800, 152064, b33315c61d714bd70d2adce3309633fe +0, 266400, 152064, af2554b6b1d3f215641f85494a78ad3d +0, 270000, 152064, e59b20b3b2c5ec215ea34ab4850f940e +0, 273600, 152064, fb543e874bdd9749aaa710d1551e0ebd +0, 277200, 152064, 4383abaf938da0282fecabed153bca0e +0, 280800, 152064, 4ce40ffa75b42320593e40596c34862a +0, 284400, 152064, f337d0cc81b5c1b1b92c3f367ed5f9cd +0, 288000, 152064, 0f5a8c41fb7334811a485239d9126808 +0, 291600, 152064, 0daf3d981474940bdf10a93148d69353 +0, 295200, 152064, 21a51f1686071a6af7973df92361964b +0, 298800, 152064, 1f0d471c7b1fa86f236c2dee32822464 +0, 302400, 152064, cedc6fd29d67976f899a6a8afba6b38d +0, 306000, 152064, 4af936d3d3b456953c7beb551476824a +0, 309600, 152064, bcaf539953adb1952fefc2cdec6c2f60 +0, 313200, 152064, d1dfeafa0939fddc256986c2b00f73c7 +0, 316800, 152064, 99c9a2c7b198e2c8cfe007ff4330f036 +0, 320400, 152064, 4db6a7edfc44389536983aeeb15edb66 +0, 324000, 152064, 8d840674b90e3b488a34e04645430ee7 +0, 327600, 152064, ad7b3e55a2eb62fc5102cc5af49301aa +0, 331200, 152064, f24484a975ec64acb50df3e9f9e8eddd +0, 334800, 152064, 5794617c7e40bfcb7f024bda2f2a991d +0, 338400, 152064, ae1c22fcfa7f3b3b62dd2ace4e4b4dc7 +0, 342000, 152064, ad9d13345ae5322a578e43653e9a9c16 +0, 345600, 152064, be1b86ee130ea9255d9640117559818d +0, 349200, 152064, 81ed195d2831e62fc2cd4fa886de8e20 +0, 352800, 152064, 8dde0af730b03ea8b3acd14d42daba04 +0, 356400, 152064, c8ffbd5ba1af8b881daf511e4d8c26f3 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-interlace-crop b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-interlace-crop new file mode 100644 index 00000000..2202c089 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-interlace-crop @@ -0,0 +1,3 @@ +0, 0, 345600, 0xa9cb7e5a +0, 3600, 345600, 0x73e47555 +0, 7200, 345600, 0x87aac593 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-lossless b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-lossless new file mode 100644 index 00000000..c6659ca8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/h264-lossless @@ -0,0 +1,10 @@ +0, 0, 460800, 0x7731dd2f +0, 1500, 460800, 0x944b8c64 +0, 3000, 460800, 0xbe833041 +0, 4500, 460800, 0xbe95d96a +0, 6000, 460800, 0xfe7ea5e6 +0, 7500, 460800, 0x381743c7 +0, 9000, 460800, 0x63fcc2e9 +0, 10500, 460800, 0x79574960 +0, 12000, 460800, 0xdab9e18a +0, 13500, 460800, 0xd88e8fe8 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/id-cin-video b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/id-cin-video new file mode 100644 index 00000000..174cef87 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/id-cin-video @@ -0,0 +1,105 @@ +0, 0, 230400, 0x00000000 +1, 0, 6300, 0xdd759df8 +0, 6429, 230400, 0x3a3486b4 +1, 6429, 6300, 0x43aa398c +0, 12857, 230400, 0xb6a9b772 +1, 12857, 6300, 0x61a7b9fd +0, 19286, 230400, 0x8e2d4c03 +1, 19286, 6300, 0xfc8adbc8 +0, 25714, 230400, 0x5df342a9 +1, 25714, 6300, 0x84c4dffc +0, 32143, 230400, 0x00f95cc9 +1, 32143, 6300, 0x3044ede1 +0, 38571, 230400, 0x72ee1c4c +1, 38571, 6300, 0x6de5b64c +0, 45000, 230400, 0x2bd991e8 +1, 45000, 6300, 0x1d9df1b0 +0, 51429, 230400, 0x84cf471e +1, 51429, 6300, 0xb5864b86 +0, 57857, 230400, 0x75253428 +1, 57857, 6300, 0xf2f7fbc2 +0, 64286, 230400, 0x57246d42 +1, 64286, 6300, 0xe61307a8 +0, 70714, 230400, 0x57246d42 +1, 70714, 6300, 0x07fcd607 +0, 77143, 230400, 0x57246d42 +1, 77143, 6300, 0xb8dfbdf6 +0, 83571, 230400, 0x7072be1b +1, 83571, 6300, 0xf308e40c +0, 90000, 230400, 0x2e9ffcf2 +1, 90000, 6300, 0xa6163aa8 +0, 96429, 230400, 0x2e9ffcf2 +1, 96429, 6300, 0x3f74c286 +0, 102857, 230400, 0x1a5cb24d +1, 102857, 6300, 0xcece754c +0, 109286, 230400, 0x1a06c797 +1, 109286, 6300, 0x7c5b47b9 +0, 115714, 230400, 0x9e51b953 +1, 115714, 6300, 0x3a7baf37 +0, 122143, 230400, 0x9e51b953 +1, 122143, 6300, 0x56fd368e +0, 128571, 230400, 0x9e51b953 +1, 128571, 6300, 0x68db250e +0, 135000, 230400, 0x9e51b953 +1, 135000, 6300, 0x37d2d710 +0, 141429, 230400, 0x9e51b953 +1, 141429, 6300, 0xf458b88e +0, 147857, 230400, 0xccd7c68d +1, 147857, 6300, 0xed38430f +0, 154286, 230400, 0x776da8bc +1, 154286, 6300, 0xd5982d28 +0, 160714, 230400, 0x495bec1c +1, 160714, 6300, 0x17465fb3 +0, 167143, 230400, 0x495bec1c +1, 167143, 6300, 0xe4591d73 +0, 173571, 230400, 0x495bec1c +1, 173571, 6300, 0x4cbbf957 +0, 180000, 230400, 0x495bec1c +1, 180000, 6300, 0x4f031f50 +0, 186429, 230400, 0x495bec1c +1, 186429, 6300, 0xc03f8ca1 +0, 192857, 230400, 0x495bec1c +1, 192857, 6300, 0x1f0d133c +0, 199286, 230400, 0x495bec1c +1, 199286, 6300, 0x18dbbeb4 +0, 205714, 230400, 0xa1cae3f3 +1, 205714, 6300, 0xef3fa45f +0, 212143, 230400, 0x5cd567eb +1, 212143, 6300, 0x7880f935 +0, 218571, 230400, 0x57bbfe30 +1, 218571, 6300, 0x5eeca5d5 +0, 225000, 230400, 0xc7763926 +1, 225000, 6300, 0xda99accc +0, 231429, 230400, 0xc7763926 +1, 231429, 6300, 0x90aea270 +0, 237857, 230400, 0xc7763926 +1, 237857, 6300, 0x7fc9da4e +0, 244286, 230400, 0xc7763926 +1, 244286, 6300, 0xb64d34d4 +0, 250714, 230400, 0xc7763926 +1, 250714, 6300, 0x385ed9e7 +0, 257143, 230400, 0xc7763926 +1, 257143, 6300, 0xd2f5be45 +0, 263571, 230400, 0xc7763926 +1, 263571, 6300, 0x763fa974 +0, 270000, 230400, 0x0e68cb2f +1, 270000, 6300, 0x5a785ec4 +0, 276429, 230400, 0x1a5d96ba +1, 276429, 6300, 0x2877c5a5 +0, 282857, 230400, 0xff3554f4 +1, 282857, 6300, 0x667e81a5 +0, 289286, 230400, 0x74438207 +1, 289286, 6300, 0xdcfeffeb +0, 295714, 230400, 0x488de02d +1, 295714, 6300, 0x1aae1606 +0, 302143, 230400, 0x488de02d +1, 302143, 6300, 0x37e0550f +0, 308571, 230400, 0x488de02d +1, 308571, 6300, 0x018202e9 +0, 315000, 230400, 0x488de02d +1, 315000, 6300, 0x2b13de85 +0, 321429, 230400, 0x488de02d +1, 321429, 6300, 0xe3bfa403 +0, 327857, 230400, 0x488de02d +1, 327857, 6300, 0x2c5bd9c9 +0, 334286, 230400, 0x488de02d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/idroq-video-dpcm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/idroq-video-dpcm new file mode 100644 index 00000000..cad87fe3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/idroq-video-dpcm @@ -0,0 +1,377 @@ +1, 0, 29824, 0x77e265b7 +0, 0, 393216, 0x56995aac +0, 3000, 393216, 0xf9ed5d6c +0, 6000, 393216, 0xd3285d75 +0, 9000, 393216, 0x82d15d62 +0, 12000, 393216, 0x893e5d6f +0, 15000, 393216, 0x82d15d62 +0, 18000, 393216, 0x893e5d6f +0, 21000, 393216, 0x82d15d62 +0, 24000, 393216, 0x893e5d6f +0, 27000, 393216, 0x82d15d62 +0, 30000, 393216, 0x893e5d6f +1, 30433, 2944, 0x8dcdf50b +0, 33000, 393216, 0x82d15d62 +1, 33437, 2944, 0xb135cd2a +0, 36000, 393216, 0x893e5d6f +1, 36441, 2944, 0x54a6e73f +0, 39000, 393216, 0x82d15d62 +1, 39445, 2944, 0x050ccd4e +0, 42000, 393216, 0x893e5d6f +1, 42449, 2944, 0x6b68db44 +0, 45000, 393216, 0x82d15d62 +1, 45453, 2944, 0x55d1f308 +0, 48000, 393216, 0x2ae39eca +1, 48457, 2944, 0x7e92f50b +0, 51000, 393216, 0x9254be70 +1, 51461, 2944, 0xe9e91eed +0, 54000, 393216, 0x4b2ed384 +1, 54465, 2944, 0x80af2ce0 +0, 57000, 393216, 0xbbd9d8f7 +1, 57469, 2944, 0xc67ffb07 +0, 60000, 393216, 0x1f2be0c3 +1, 60473, 2944, 0x7aaded27 +0, 63000, 393216, 0x2434eb25 +1, 63478, 2944, 0x14a024fd +0, 66000, 393216, 0xa6cced4e +1, 66482, 2944, 0x26e8df1f +0, 69000, 393216, 0xd116f38b +1, 69486, 2944, 0x2688df44 +0, 72000, 393216, 0x6b86f380 +1, 72490, 2944, 0x4b9cdd33 +0, 75000, 393216, 0xc1b3f8e9 +1, 75494, 2944, 0x10c2f11c +0, 78000, 393216, 0x2993fd5d +1, 78498, 2944, 0xc4e3ad6d +0, 81000, 393216, 0xf489fe18 +1, 81502, 2944, 0xbeb1a78e +0, 84000, 393216, 0x9ef10501 +1, 84506, 2944, 0x283d4e7f +0, 87000, 393216, 0x8faf0512 +1, 87510, 2944, 0x4acf65e0 +0, 90000, 393216, 0xa54d0736 +1, 90514, 2944, 0x0ca29b8c +0, 93000, 393216, 0xf4ef01e0 +1, 93518, 2944, 0x003fae34 +0, 96000, 393216, 0xe241ef51 +1, 96522, 2944, 0x2acfec7e +0, 99000, 393216, 0xcc38e51f +1, 99527, 2944, 0xea6fc6fe +0, 102000, 393216, 0xb1345876 +1, 102531, 2944, 0xf5daec2f +0, 105000, 393216, 0xf9b0968b +1, 105535, 2944, 0x8d33ed7a +0, 108000, 393216, 0x6bb1523f +1, 108539, 2944, 0xc328f984 +0, 111000, 393216, 0x83469a05 +1, 111543, 2944, 0x6e0b58d3 +0, 114000, 393216, 0x73e30882 +1, 114547, 2944, 0xe282dc3f +0, 117000, 393216, 0x8673da66 +1, 117551, 2944, 0xbf9bf3e6 +0, 120000, 393216, 0xb67596d3 +1, 120555, 2944, 0xd7b7d7e3 +0, 123000, 393216, 0xf7638710 +1, 123559, 2944, 0x4e87b6ab +0, 126000, 393216, 0x813a8f47 +1, 126563, 2944, 0x7b8ce8d6 +0, 129000, 393216, 0xb3526555 +1, 129567, 2944, 0xd42991a5 +0, 132000, 393216, 0x1b167be3 +1, 132571, 2944, 0x452c98ca +0, 135000, 393216, 0x99114562 +1, 135576, 2944, 0x6d27832d +0, 138000, 393216, 0xfafb0693 +1, 138580, 2944, 0xa558720e +0, 141000, 393216, 0x121d96c8 +1, 141584, 2944, 0x0a31bec0 +0, 144000, 393216, 0xb3c68c5d +1, 144588, 2944, 0x28431384 +0, 147000, 393216, 0x2035b97f +1, 147592, 2944, 0xd5e9fb3d +0, 150000, 393216, 0xfbcaeb62 +1, 150596, 2944, 0x34f0e9f8 +0, 153000, 393216, 0xfd5aea5d +1, 153600, 2944, 0x979432df +0, 156000, 393216, 0x66efbddd +1, 156604, 2944, 0xb00acd4d +0, 159000, 393216, 0xf1e17862 +1, 159608, 2944, 0x726bffd6 +0, 162000, 393216, 0x27fa584d +1, 162612, 2944, 0xa1f39a6d +0, 165000, 393216, 0xe644ec5f +1, 165616, 2944, 0xf6a8e30e +0, 168000, 393216, 0x7e3067ba +1, 168620, 2944, 0x608e9e06 +0, 171000, 393216, 0x1b6ba6fd +1, 171624, 2944, 0x4ec58bc3 +0, 174000, 393216, 0x55bdba34 +1, 174629, 2944, 0x6d5c8458 +0, 177000, 393216, 0xc67db2e4 +1, 177633, 2944, 0x76a0abbd +0, 180000, 393216, 0x359de8a2 +1, 180637, 2944, 0xf830e8a6 +0, 183000, 393216, 0x7b7a32ef +1, 183641, 2944, 0x1bdd7bec +0, 186000, 393216, 0xbe512a66 +1, 186645, 2944, 0x3c1bd187 +0, 189000, 393216, 0x681d82bf +1, 189649, 2944, 0xf52cf697 +0, 192000, 393216, 0xa2320ec5 +1, 192653, 2944, 0x8f65b773 +0, 195000, 393216, 0xcfbd9954 +1, 195657, 2944, 0xf8b5b598 +0, 198000, 393216, 0x7fee9854 +1, 198661, 2944, 0xcd87d5ed +0, 201000, 393216, 0x70eec155 +1, 201665, 2944, 0x672ac02a +0, 204000, 393216, 0x114f684e +1, 204669, 2944, 0x1d5d13ed +0, 207000, 393216, 0xe27f034f +1, 207673, 2944, 0xe298e3d4 +0, 210000, 393216, 0xfbbd89b4 +1, 210678, 2944, 0x3d2e9c32 +0, 213000, 393216, 0xcef4c58a +1, 213682, 2944, 0xf3a39259 +0, 216000, 393216, 0x9eea88e9 +1, 216686, 2944, 0x930ae8f8 +0, 219000, 393216, 0x911cea42 +1, 219690, 2944, 0x8562aff7 +0, 222000, 393216, 0xec5727ea +1, 222694, 2944, 0x9cd6c6a7 +0, 225000, 393216, 0xda998c33 +1, 225698, 2944, 0x2709dc5c +0, 228000, 393216, 0xc82140ed +1, 228702, 2944, 0xcbe31816 +0, 231000, 393216, 0x4caa8591 +1, 231706, 2944, 0xd7876ec4 +0, 234000, 393216, 0x4944206c +1, 234710, 2944, 0xc2468b6a +0, 237000, 393216, 0xd4676a94 +1, 237714, 2944, 0x76043e84 +0, 240000, 393216, 0x9e0340b3 +1, 240718, 2944, 0xd2c35bf0 +0, 243000, 393216, 0xbdef7f94 +1, 243722, 2944, 0x63de6061 +0, 246000, 393216, 0xfac05cb0 +1, 246727, 2944, 0xd8f6ed1d +0, 249000, 393216, 0xfef5a369 +1, 249731, 2944, 0xe034928a +0, 252000, 393216, 0x9fcb3711 +1, 252735, 2944, 0xa044da74 +0, 255000, 393216, 0x6d93f761 +1, 255739, 2944, 0xee410dba +0, 258000, 393216, 0xe95dc1ae +1, 258743, 2944, 0x8e020c7c +0, 261000, 393216, 0x3e561557 +1, 261747, 2944, 0x73057ddb +0, 264000, 393216, 0x0fa7a049 +1, 264751, 2944, 0xdee5cc18 +0, 267000, 393216, 0xf16afb95 +1, 267755, 2944, 0xf4d31dec +0, 270000, 393216, 0xe53a2064 +1, 270759, 2944, 0xe8131e1c +0, 273000, 393216, 0x57f046a4 +1, 273763, 2944, 0x8ae69c95 +0, 276000, 393216, 0xf6f16a0c +1, 276767, 2944, 0x791c0bf4 +0, 279000, 393216, 0xcba0c8b0 +1, 279771, 2944, 0xd45a10db +0, 282000, 393216, 0x5bdbe522 +1, 282776, 2944, 0x3a72b010 +0, 285000, 393216, 0x0fed0151 +1, 285780, 2944, 0x6a4a0411 +0, 288000, 393216, 0xbf86faf8 +1, 288784, 2944, 0xd77ab7f5 +0, 291000, 393216, 0x39854c5f +1, 291788, 2944, 0xe3bf4fe5 +0, 294000, 393216, 0xd9b7760a +1, 294792, 2944, 0x12db1be8 +0, 297000, 393216, 0x8edcc1d9 +1, 297796, 2944, 0x345210b0 +0, 300000, 393216, 0x44ae1435 +1, 300800, 2944, 0xcfc1f892 +0, 303000, 393216, 0xbc3d6d73 +1, 303804, 2944, 0x5b0a80bb +0, 306000, 393216, 0xedd82647 +1, 306808, 2944, 0x31ab1168 +0, 309000, 393216, 0x1c2e5ce3 +1, 309812, 2944, 0xd4a4bb0a +0, 312000, 393216, 0x04e29afe +1, 312816, 2944, 0x8e211c8f +0, 315000, 393216, 0xb191578e +1, 315820, 2944, 0xcf464d50 +0, 318000, 393216, 0x31d75a06 +1, 318824, 2944, 0xe74ff3d6 +0, 321000, 393216, 0xfdb6c56e +1, 321829, 2944, 0x6274635f +0, 324000, 393216, 0xf528f484 +1, 324833, 2944, 0xc34c9f64 +0, 327000, 393216, 0x87af758e +1, 327837, 2944, 0xbb997537 +0, 330000, 393216, 0xc8bdafb7 +1, 330841, 2944, 0x3600da72 +0, 333000, 393216, 0x573afe93 +1, 333845, 2944, 0x343e15f4 +0, 336000, 393216, 0xb03cb8f5 +1, 336849, 2944, 0x17bc58a8 +0, 339000, 393216, 0x6e03ac71 +1, 339853, 2944, 0x3dcbd3ff +0, 342000, 393216, 0xf919164e +1, 342857, 2944, 0x1d422371 +0, 345000, 393216, 0x80059f3c +1, 345861, 2944, 0xe2b83d9d +0, 348000, 393216, 0xf4ea0b1a +1, 348865, 2944, 0x65388409 +0, 351000, 393216, 0xe7720ffb +1, 351869, 2944, 0xafbca269 +0, 354000, 393216, 0x1ec0cd56 +1, 354873, 2944, 0x2d00c0fb +0, 357000, 393216, 0x2bc8cf18 +1, 357878, 2944, 0xbac9c503 +0, 360000, 393216, 0xe0bf17b5 +1, 360882, 2944, 0x9990768d +0, 363000, 393216, 0x660247e1 +1, 363886, 2944, 0x8ba978be +0, 366000, 393216, 0xcf66f2a9 +1, 366890, 2944, 0x5a44a2f5 +0, 369000, 393216, 0x5494d5ab +1, 369894, 2944, 0xa4b6f3b8 +0, 372000, 393216, 0x2c02f2c4 +1, 372898, 2944, 0x631b6b9f +0, 375000, 393216, 0x93fa3783 +1, 375902, 2944, 0x4c840923 +0, 378000, 393216, 0x4cc50633 +1, 378906, 2944, 0x7c105df3 +0, 381000, 393216, 0x3f179386 +1, 381910, 2944, 0x01bcb213 +0, 384000, 393216, 0x2bca9e1b +1, 384914, 2944, 0x95cffbf7 +0, 387000, 393216, 0x3e4af867 +1, 387918, 2944, 0x170a9c3a +0, 390000, 393216, 0x7e7df93c +1, 390922, 2944, 0x59e09d61 +0, 393000, 393216, 0x577e4fb0 +1, 393927, 2944, 0x3ea0f205 +0, 396000, 393216, 0x34487f0a +1, 396931, 2944, 0xd9ea1a3a +0, 399000, 393216, 0x0937bcfc +1, 399935, 2944, 0xaf32d704 +0, 402000, 393216, 0xa9e75a5e +1, 402939, 2944, 0x2d473392 +0, 405000, 393216, 0xf7bc0c89 +1, 405943, 2944, 0x2a8ec544 +0, 408000, 393216, 0x06dacca6 +1, 408947, 2944, 0x883c8838 +0, 411000, 393216, 0x7baaa4bd +1, 411951, 2944, 0xfaf4d789 +0, 414000, 393216, 0x95477f5f +1, 414955, 2944, 0xcb315b65 +0, 417000, 393216, 0x51117526 +1, 417959, 2944, 0x980c93b0 +0, 420000, 393216, 0x69656d03 +1, 420963, 2944, 0x0819583b +0, 423000, 393216, 0xcbd061bb +1, 423967, 2944, 0xf126e5b5 +0, 426000, 393216, 0x8d1d5be2 +1, 426971, 2944, 0x88836255 +0, 429000, 393216, 0x43e55930 +1, 429976, 2944, 0xc8ae8ca8 +0, 432000, 393216, 0xb56f5872 +1, 432980, 2944, 0xf0750551 +0, 435000, 393216, 0x09a255e9 +1, 435984, 2944, 0x3dfe13a3 +0, 438000, 393216, 0xcaaa5456 +1, 438988, 2944, 0xf2aa957b +0, 441000, 393216, 0xd267501f +1, 441992, 2944, 0xa77b79a3 +0, 444000, 393216, 0x7bef4eca +1, 444996, 2944, 0xb1038284 +0, 447000, 393216, 0x9aa94af3 +1, 448000, 2944, 0xf96be3ba +0, 450000, 393216, 0xd39d4a29 +1, 451004, 2944, 0x1ae6e293 +0, 453000, 393216, 0x7a754960 +1, 454008, 2944, 0x2059d020 +0, 456000, 393216, 0x3f004921 +1, 457012, 2944, 0x7e6c9996 +0, 459000, 393216, 0x0f784ca8 +1, 460016, 2944, 0x3108b540 +0, 462000, 393216, 0x2a062c70 +1, 463020, 2944, 0x75133155 +0, 465000, 393216, 0x114ef770 +1, 466024, 2944, 0x59a19226 +0, 468000, 393216, 0xfb7673bf +1, 469029, 2944, 0x3140c138 +0, 471000, 393216, 0xbaea88f7 +1, 472033, 2944, 0x7570d3be +0, 474000, 393216, 0x6fdfe2ec +1, 475037, 2944, 0x54fd4ff6 +0, 477000, 393216, 0xb7b2b398 +1, 478041, 2944, 0x23bcf6dc +0, 480000, 393216, 0x14ba127e +1, 481045, 2944, 0x2d26489b +0, 483000, 393216, 0x660b3041 +1, 484049, 2944, 0x4b37bf13 +0, 486000, 393216, 0xe3f3302a +1, 487053, 2944, 0x12812ec9 +0, 489000, 393216, 0x34c7f1c9 +1, 490057, 2944, 0xc4a609dd +0, 492000, 393216, 0xa8257bf4 +1, 493061, 2944, 0x5a8c5b20 +0, 495000, 393216, 0xd63fc649 +1, 496065, 2944, 0xd05d110f +0, 498000, 393216, 0xf8e5b79c +1, 499069, 2944, 0xceea6f1f +0, 501000, 393216, 0xa67b52ab +1, 502073, 2944, 0x4033b0a5 +0, 504000, 393216, 0xef8f9c74 +1, 505078, 2944, 0x101895ce +0, 507000, 393216, 0x6d3aa6b6 +1, 508082, 2944, 0xd6c6809f +0, 510000, 393216, 0x8c174ee6 +1, 511086, 2944, 0x197bda7e +0, 513000, 393216, 0x2dfbc524 +1, 514090, 2944, 0x96fb3e4b +0, 516000, 393216, 0x7d0808b6 +1, 517094, 2944, 0x12a6e3de +0, 519000, 393216, 0x6cbdf6f5 +1, 520098, 2944, 0xfb80e466 +0, 522000, 393216, 0xfe39bc53 +1, 523102, 2944, 0xedb8c2fc +0, 525000, 393216, 0xa3d869b0 +1, 526106, 1016, 0x30e56ca5 +0, 528000, 393216, 0x09f00057 +0, 531000, 393216, 0x6ba56343 +0, 534000, 393216, 0xb696ca3e +0, 537000, 393216, 0x4eba0225 +0, 540000, 393216, 0xdd45464b +0, 543000, 393216, 0x2909a9ea +0, 546000, 393216, 0x12aa3f85 +0, 549000, 393216, 0x59421352 +0, 552000, 393216, 0x57ea0313 +0, 555000, 393216, 0x4e5f3a38 +0, 558000, 393216, 0x55bc932d +0, 561000, 393216, 0x666ee55d +0, 564000, 393216, 0xb0f84a69 +0, 567000, 393216, 0xad3ae63f +0, 570000, 393216, 0x970fd47d +0, 573000, 393216, 0x86c418e0 +0, 576000, 393216, 0x52c9ce50 +0, 579000, 393216, 0xd54c98c8 +0, 582000, 393216, 0xb40e5fea +0, 585000, 393216, 0x2aa74875 +0, 588000, 393216, 0x305b251e +0, 591000, 393216, 0xab8c0780 +0, 594000, 393216, 0x0101dd0e +0, 597000, 393216, 0x23739cab +0, 600000, 393216, 0xf05196a0 +0, 603000, 393216, 0x932d1e00 +0, 606000, 393216, 0x932d1e00 +0, 609000, 393216, 0x932d1e00 +0, 612000, 393216, 0x932d1e00 +0, 615000, 393216, 0x932d1e00 +0, 618000, 393216, 0x932d1e00 +0, 621000, 393216, 0x932d1e00 +0, 624000, 393216, 0x932d1e00 +0, 627000, 393216, 0x932d1e00 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/idroq-video-encode b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/idroq-video-encode new file mode 100644 index 00000000..4c89de8b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/idroq-video-encode @@ -0,0 +1 @@ +75df9ce475c1b185fc3dbc219596edd3 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iff-byterun1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iff-byterun1 new file mode 100644 index 00000000..8620c863 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iff-byterun1 @@ -0,0 +1 @@ +0, 0, 230400, 0x35e51c62 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iff-fibonacci b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iff-fibonacci new file mode 100644 index 00000000..e452f31e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iff-fibonacci @@ -0,0 +1 @@ +e968a853779bb6438339e3b8d69d8d24 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iff-ilbm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iff-ilbm new file mode 100644 index 00000000..eb253a0a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iff-ilbm @@ -0,0 +1 @@ +0, 0, 230400, 0x0929e342 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iff-pcm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iff-pcm new file mode 100644 index 00000000..cffcc57d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iff-pcm @@ -0,0 +1 @@ +6dc1329541393525a60fd6b9782573f5 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/indeo2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/indeo2 new file mode 100644 index 00000000..49fabb45 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/indeo2 @@ -0,0 +1,130 @@ +0, 0, 21600, 0x57a2ba42 +0, 6000, 21600, 0x61e09615 +0, 12000, 21600, 0x826e4e63 +0, 18000, 21600, 0x107716ec +0, 24000, 21600, 0xb35ce1f4 +0, 30000, 21600, 0x12cab085 +0, 36000, 21600, 0x2f917f69 +0, 42000, 21600, 0x25aa3d6e +0, 48000, 21600, 0xab1bfbed +0, 54000, 21600, 0x9936dff9 +0, 60000, 21600, 0xc23cd8e5 +0, 66000, 21600, 0xa7ebbcaa +0, 72000, 21600, 0xd4dda045 +0, 78000, 21600, 0xcbce6d7d +0, 84000, 21600, 0x3cf35baf +0, 90000, 21600, 0x16de6008 +0, 96000, 21600, 0x49d41acf +0, 102001, 21600, 0x8c630034 +0, 108001, 21600, 0x0b310296 +0, 114001, 21600, 0x4887067d +0, 120001, 21600, 0x1219f29e +0, 126001, 21600, 0x3f3fc0c8 +0, 132001, 21600, 0x1bd1d0fc +0, 138001, 21600, 0x913f9d4c +0, 144001, 21600, 0x69e9a6b4 +0, 150001, 21600, 0xcc2e917f +0, 156001, 21600, 0xf6967e30 +0, 162001, 21600, 0xdf816593 +0, 168001, 21600, 0xfd945b75 +0, 174001, 21600, 0x7d7e0224 +0, 180001, 21600, 0x7246f584 +0, 186001, 21600, 0x07b7ce82 +0, 192001, 21600, 0xee16c291 +0, 198001, 21600, 0xf4efb53a +0, 204001, 21600, 0x2e73a208 +0, 210001, 21600, 0x1c2b6068 +0, 216001, 21600, 0x004250de +0, 222001, 21600, 0x61d957d9 +0, 228001, 21600, 0x8b5d2cb0 +0, 234001, 21600, 0xc0a91fbc +0, 240001, 21600, 0xa38108fc +0, 246001, 21600, 0x551f03b9 +0, 252001, 21600, 0x93def5ca +0, 258001, 21600, 0xe8ecf8bb +0, 264001, 21600, 0x4c04fbb0 +0, 270001, 21600, 0x0e41dae4 +0, 276001, 21600, 0xca9fb0df +0, 282001, 21600, 0xb123af19 +0, 288001, 21600, 0xfd59be7a +0, 294001, 21600, 0x2c88b7a6 +0, 300002, 21600, 0x64cc9a1f +0, 306002, 21600, 0x73d6a9ba +0, 312002, 21600, 0x79198a11 +0, 318002, 21600, 0x0d4a8610 +0, 324002, 21600, 0x352e71bc +0, 330002, 21600, 0x08aa627e +0, 336002, 21600, 0xbee36e45 +0, 342002, 21600, 0x30de5c1b +0, 348002, 21600, 0x21d75484 +0, 354002, 21600, 0xe0e91d52 +0, 360002, 21600, 0x678c2ebb +0, 366002, 21600, 0x2080397b +0, 372002, 21600, 0x7dbc1333 +0, 378002, 21600, 0x9c730ad0 +0, 384002, 21600, 0x4da50f55 +0, 390002, 21600, 0xdde5eaa7 +0, 396002, 21600, 0x949ed4fa +0, 402002, 21600, 0x5d63bc54 +0, 408002, 21600, 0xc5dcba4f +0, 414002, 21600, 0xd68caee1 +0, 420002, 21600, 0xf7409fc9 +0, 426002, 21600, 0x6b0ca3e5 +0, 432002, 21600, 0xd133a108 +0, 438002, 21600, 0xf2687b81 +0, 444002, 21600, 0x6e94645d +0, 450002, 21600, 0xff7e7524 +0, 456002, 21600, 0x8c7255dd +0, 462002, 21600, 0x84e979cf +0, 468002, 21600, 0xaa4e7127 +0, 474002, 21600, 0x0b56708c +0, 480002, 21600, 0x38f086c4 +0, 486002, 21600, 0x6a7086f6 +0, 492002, 21600, 0x57a3619d +0, 498002, 21600, 0xee27639a +0, 504003, 21600, 0x754b7ec6 +0, 510003, 21600, 0x2f7b428c +0, 516003, 21600, 0x0dc94603 +0, 522003, 21600, 0xeede54d8 +0, 528003, 21600, 0x587b4725 +0, 534003, 21600, 0xe7c72c7a +0, 540003, 21600, 0x523949cb +0, 546003, 21600, 0xeade5385 +0, 552003, 21600, 0x1a8f45c8 +0, 558003, 21600, 0x814a393c +0, 564003, 21600, 0xe7b34887 +0, 570003, 21600, 0x8eef3f5f +0, 576003, 21600, 0x56f12f08 +0, 582003, 21600, 0xb2d02448 +0, 588003, 21600, 0xb7d936db +0, 594003, 21600, 0x45f726ab +0, 600003, 21600, 0x6012404d +0, 606003, 21600, 0x273c254e +0, 612003, 21600, 0x38e82c19 +0, 618003, 21600, 0x73653274 +0, 624003, 21600, 0x2ff63b0c +0, 630003, 21600, 0x96d03611 +0, 636003, 21600, 0xee8c29d7 +0, 642003, 21600, 0xac043199 +0, 648003, 21600, 0xd2c741a7 +0, 654003, 21600, 0xdc7b2b81 +0, 660003, 21600, 0x376f438f +0, 666003, 21600, 0x55442ff7 +0, 672003, 21600, 0x653b1472 +0, 678003, 21600, 0xc4293779 +0, 684003, 21600, 0xc6553740 +0, 690003, 21600, 0xcf441053 +0, 696003, 21600, 0xb1531bce +0, 702004, 21600, 0x145323b3 +0, 708004, 21600, 0x916c2e9e +0, 714004, 21600, 0xb89bfecc +0, 720004, 21600, 0x8e2415b9 +0, 726004, 21600, 0x5af23021 +0, 732004, 21600, 0x53e81c10 +0, 738004, 21600, 0xf7f82a6f +0, 744004, 21600, 0x851121a2 +0, 750004, 21600, 0xa8432bd2 +0, 756004, 21600, 0x1a381799 +0, 762004, 21600, 0xbb761384 +0, 768004, 21600, 0xc8f328d5 +0, 774004, 21600, 0xb3742e8a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/indeo3 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/indeo3 new file mode 100644 index 00000000..ee34b278 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/indeo3 @@ -0,0 +1,40 @@ +0, 0, 21600, 0x845098fc +0, 9000, 21600, 0xc28e8bf0 +0, 18000, 21600, 0x2f418fb4 +0, 27000, 21600, 0x051d7a0e +0, 36000, 21600, 0x1b36aa7c +0, 45000, 21600, 0xb9e2ad38 +0, 54000, 21600, 0x8dc99b60 +0, 63000, 21600, 0xa3fa789a +0, 72000, 21600, 0x1fdbade2 +0, 81000, 21600, 0x4f4ac164 +0, 90000, 21600, 0x0ea5cb50 +0, 99000, 21600, 0xfb659528 +0, 108000, 21600, 0xac5790f8 +0, 117000, 21600, 0x9762beb4 +0, 126000, 21600, 0x29b0da0a +0, 135000, 21600, 0x6d88b0da +0, 144000, 21600, 0x687b8efa +0, 153000, 21600, 0xcd726220 +0, 162000, 21600, 0xa1766598 +0, 171000, 21600, 0xff4b8074 +0, 180000, 21600, 0x845098fc +0, 189000, 21600, 0xdb259e08 +0, 198000, 21600, 0xb6bda5a0 +0, 207000, 21600, 0xbb998962 +0, 216000, 21600, 0x28aa7b7c +0, 225000, 21600, 0x1ad1a15c +0, 234000, 21600, 0xb535a128 +0, 243000, 21600, 0x4dbf968a +0, 252000, 21600, 0xfe90a8d6 +0, 261000, 21600, 0xf63fabf0 +0, 270000, 21600, 0xd6fabe58 +0, 279000, 21600, 0x172eb09c +0, 288000, 21600, 0x44f8a8fe +0, 297000, 21600, 0x29429a06 +0, 306000, 21600, 0xb12f8cc4 +0, 315000, 21600, 0xd0c78cb4 +0, 324000, 21600, 0x97e17e0c +0, 333000, 21600, 0xf8ac6700 +0, 342000, 21600, 0xf9c17c94 +0, 351000, 21600, 0xb10e8c54 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/indeo5 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/indeo5 new file mode 100644 index 00000000..73fe74cf --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/indeo5 @@ -0,0 +1,134 @@ +0, 0, 48600, 0x72d4193b +0, 6000, 48600, 0x72d4193b +0, 12000, 48600, 0x36abd6f3 +0, 18000, 48600, 0x99e582f7 +0, 24000, 48600, 0xa4cb6fb7 +0, 30000, 48600, 0xf9b5657b +0, 36000, 48600, 0xb7d666a4 +0, 42000, 48600, 0xb7345308 +0, 48000, 48600, 0x4f5339b9 +0, 54000, 48600, 0x1a9a02c7 +0, 60000, 48600, 0x4ed40866 +0, 66000, 48600, 0x635bf2af +0, 72000, 48600, 0x12c02f49 +0, 78000, 48600, 0xc548a36d +0, 84000, 48600, 0x9d9ffbf0 +0, 90000, 48600, 0x4f9dba66 +0, 96000, 48600, 0x2332b0e4 +0, 102000, 48600, 0x6c64342d +0, 108000, 48600, 0x81156d54 +0, 114000, 48600, 0x8bfb9f04 +0, 120000, 48600, 0xd6bc38db +0, 126000, 48600, 0x64de39d7 +0, 132000, 48600, 0xbddb3c37 +0, 138000, 48600, 0x15b75a31 +0, 144000, 48600, 0xa2dd7bdf +0, 150000, 48600, 0xe4fb9b25 +0, 156000, 48600, 0xf2788234 +0, 162000, 48600, 0xa481a3d0 +0, 168000, 48600, 0x6087c790 +0, 174000, 48600, 0xf1dacfa1 +0, 180000, 48600, 0xe29e2e78 +0, 186000, 48600, 0x505b2db1 +0, 192000, 48600, 0x7bc56b02 +0, 198000, 48600, 0x3f7640de +0, 204000, 48600, 0xd21a3f0b +0, 210000, 48600, 0x92dc9b72 +0, 216000, 48600, 0x26e6804e +0, 222000, 48600, 0xc3867fdc +0, 228000, 48600, 0xe135c689 +0, 234000, 48600, 0xf0fda68b +0, 240000, 48600, 0x7e07a430 +0, 246000, 48600, 0xb0809c56 +0, 252000, 48600, 0xd3f3d4b0 +0, 258000, 48600, 0x068ce7b9 +0, 264000, 48600, 0x3ae5ebb7 +0, 270000, 48600, 0x2274d1d8 +0, 276000, 48600, 0x9a2b95b7 +0, 282000, 48600, 0xe864dc3d +0, 288000, 48600, 0xdf39d4db +0, 294000, 48600, 0x5155c707 +0, 300000, 48600, 0xa26e9879 +0, 306000, 48600, 0x91b5747c +0, 312000, 48600, 0xe7925589 +0, 318000, 48600, 0x582f1cb2 +0, 324000, 48600, 0x13180bdb +0, 330000, 48600, 0x1623d914 +0, 336000, 48600, 0xfeeea068 +0, 342000, 48600, 0x61f8679c +0, 348000, 48600, 0xcb678447 +0, 354000, 48600, 0xd0028749 +0, 360000, 48600, 0xec116a9c +0, 366000, 48600, 0x16926417 +0, 372000, 48600, 0x342c6014 +0, 378000, 48600, 0xb81a3ec3 +0, 384000, 48600, 0xfd0d4654 +0, 390000, 48600, 0x741cc27a +0, 396000, 48600, 0x2c53a9fe +0, 402000, 48600, 0x795dc493 +0, 408000, 48600, 0x46eebc82 +0, 414000, 48600, 0xa2b7b84b +0, 420000, 48600, 0x2274c95e +0, 426000, 48600, 0x0ba5ac69 +0, 432000, 48600, 0x8335eb20 +0, 438000, 48600, 0xca80ef55 +0, 444000, 48600, 0xbb7cec8a +0, 450000, 48600, 0x775bdde2 +0, 456000, 48600, 0x68a5a673 +0, 462000, 48600, 0x091ccca2 +0, 468000, 48600, 0xced6d065 +0, 474000, 48600, 0xed7fca50 +0, 480000, 48600, 0x5c77be3f +0, 486000, 48600, 0x84719fe6 +0, 492000, 48600, 0x571cc076 +0, 498000, 48600, 0xa3b5be2a +0, 504000, 48600, 0x0218bc6f +0, 510000, 48600, 0x5ec1fa4c +0, 516000, 48600, 0xcd3035fa +0, 522000, 48600, 0xb8d2a741 +0, 528000, 48600, 0x6d39847c +0, 534000, 48600, 0x0ffefc73 +0, 540000, 48600, 0x2bb74b68 +0, 546000, 48600, 0xf541d49f +0, 552000, 48600, 0x6f7c9066 +0, 558000, 48600, 0x70d58548 +0, 564000, 48600, 0x92d38b55 +0, 570000, 48600, 0x5f4bdaa6 +0, 576000, 48600, 0x43868008 +0, 582000, 48600, 0xddb8e551 +0, 588000, 48600, 0xcd0cbd5f +0, 594000, 48600, 0xf97e6bbd +0, 600000, 48600, 0x5f1b31eb +0, 606000, 48600, 0x10ff924d +0, 612000, 48600, 0xcc31ca3f +0, 618000, 48600, 0x5f27f9ff +0, 624000, 48600, 0xd6fe4b71 +0, 630000, 48600, 0xa7d3b2c4 +0, 636000, 48600, 0x9992d6c7 +0, 642000, 48600, 0xd283089b +0, 648000, 48600, 0x6ab52ede +0, 654000, 48600, 0x495b1bad +0, 660000, 48600, 0x3a4d1b72 +0, 666000, 48600, 0xdb421ba3 +0, 672000, 48600, 0x8ad11baa +0, 678000, 48600, 0x17701bcc +0, 684000, 48600, 0x4b771b6a +0, 690000, 48600, 0x5345067e +0, 696000, 48600, 0x2cd403a7 +0, 702000, 48600, 0x2cc5fd60 +0, 708000, 48600, 0xfa9cf1d4 +0, 714000, 48600, 0x8498e2d6 +0, 720000, 48600, 0x93dcc863 +0, 726000, 48600, 0xd46ac5d5 +0, 732000, 48600, 0x34e8c01b +0, 738000, 48600, 0x4ad3b246 +0, 744000, 48600, 0x9848a6ca +0, 750000, 48600, 0x7b7e8bee +0, 756000, 48600, 0xaee0896b +0, 762000, 48600, 0x263a812c +0, 768000, 48600, 0x5d7b7782 +0, 774000, 48600, 0x3a2b6ad2 +0, 780000, 48600, 0xcf2a4ef3 +0, 786000, 48600, 0xc0134c9b +0, 792000, 48600, 0x93c342d2 +0, 798000, 48600, 0x8d90393c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/interplay-mve-16bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/interplay-mve-16bit new file mode 100644 index 00000000..2d22cca6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/interplay-mve-16bit @@ -0,0 +1,129 @@ +1, 0, 5788, 0x916d2db8 +0, 0, 614400, 0x00000000 +1, 2953, 5888, 0xc65cb069 +0, 3002, 614400, 0x00000000 +1, 5957, 5888, 0xd8ec1acc +0, 6005, 614400, 0xa17ea4ec +1, 8961, 5888, 0xb22af0d6 +0, 9007, 614400, 0x4fd207fb +1, 11965, 5888, 0x86bb50d9 +0, 12010, 614400, 0xd7a510fb +1, 14969, 5888, 0x7674d923 +0, 15012, 614400, 0xe901e2f4 +1, 17973, 5888, 0xb97c5500 +0, 18014, 614400, 0x4ac5d3c4 +1, 20978, 5888, 0xecea1249 +0, 21017, 614400, 0x32e3e99c +1, 23982, 5888, 0x0f4fea81 +0, 24019, 614400, 0x7a2ff20c +1, 26986, 5888, 0x997914d8 +0, 27022, 614400, 0x59941193 +1, 29990, 5888, 0xd012f03a +0, 30024, 614400, 0x92773a2b +1, 32994, 5888, 0x03fd5248 +0, 33026, 614400, 0x4cd14313 +1, 35998, 5888, 0x3041a288 +0, 36029, 614400, 0x2a093fa3 +1, 39002, 5888, 0xe6105de1 +0, 39031, 614400, 0xf68b8463 +1, 42006, 5888, 0xaa38c7bd +0, 42034, 614400, 0xa9e1969b +1, 45010, 5888, 0xbfff702c +0, 45036, 614400, 0x461996bb +1, 48014, 5888, 0xbe4319a3 +0, 48038, 614400, 0xae58d053 +1, 51018, 5888, 0x2e89d262 +0, 51041, 614400, 0x7693015a +1, 54022, 5888, 0x10992b9c +0, 54043, 614400, 0x0b3507fa +1, 57027, 5888, 0x972904bf +0, 57046, 614400, 0xff5c2492 +1, 60031, 5888, 0x0093501c +0, 60048, 614400, 0x636e3e32 +1, 63035, 5888, 0x8994ad0e +0, 63050, 614400, 0x1acd6d0a +1, 66039, 5888, 0x9db37d21 +0, 66053, 614400, 0x67039232 +1, 69043, 5888, 0xa8c7300f +0, 69055, 614400, 0x8ab9c75a +1, 72047, 5888, 0x1b7073b5 +0, 72058, 614400, 0xe824bbe2 +1, 75051, 5888, 0x56ad7f7b +0, 75060, 614400, 0x5133e9ea +1, 78055, 5888, 0x9706a8fb +0, 78062, 614400, 0xcecf1249 +1, 81059, 5888, 0x16c9420e +0, 81065, 614400, 0xe6d928c1 +1, 84063, 5888, 0x3e11be0a +0, 84067, 614400, 0x8da46ff1 +1, 87067, 5888, 0x3e534a32 +0, 87070, 614400, 0x1c778319 +1, 90071, 5788, 0x0ffae5f4 +0, 90072, 614400, 0x35a19451 +1, 93024, 5888, 0xc2018f82 +0, 93074, 614400, 0x5145d1b9 +1, 96029, 5888, 0x2a11f529 +0, 96077, 614400, 0x146ee231 +1, 99033, 5888, 0xec282167 +0, 99079, 614400, 0xd9b33380 +1, 102037, 5888, 0xd61b5a05 +0, 102082, 614400, 0x8b112ef8 +1, 105041, 5888, 0x61de2741 +0, 105084, 614400, 0xb9e79ab0 +1, 108045, 5888, 0x17aaff8c +0, 108086, 614400, 0x62d3a498 +1, 111049, 5888, 0xd40cd7a6 +0, 111089, 614400, 0xaeaaaa58 +1, 114053, 5888, 0x840840d4 +0, 114091, 614400, 0x8922c440 +1, 117057, 5888, 0x7c97ddcf +0, 117094, 614400, 0xd62ef758 +1, 120061, 5888, 0xed9150f7 +0, 120096, 614400, 0x2a53149f +1, 123065, 5888, 0xbccf973e +0, 123098, 614400, 0x13da47df +1, 126069, 5888, 0x74bda5ea +0, 126101, 614400, 0x27c05c3f +1, 129073, 5888, 0xd083892a +0, 129103, 614400, 0x41ff7ca7 +1, 132078, 5888, 0x16e444b2 +0, 132106, 614400, 0x6b0e8a07 +1, 135082, 5888, 0x68a9cedb +0, 135108, 614400, 0xa200ad9f +1, 138086, 5888, 0x80849f36 +0, 138110, 614400, 0x9da7cc77 +1, 141090, 5888, 0x63cb7df9 +0, 141113, 614400, 0x2f5703be +1, 144094, 5888, 0xf90f754d +0, 144115, 614400, 0x91c720f6 +1, 147098, 5888, 0x9c2c867d +0, 147118, 614400, 0x927a882e +1, 150102, 5888, 0x337994a4 +1, 153106, 5888, 0xf354a28d +1, 156110, 5888, 0x70933738 +1, 159114, 5888, 0x3c019219 +1, 162118, 5888, 0xe0c21295 +1, 165122, 5888, 0x21869515 +1, 168127, 5888, 0xe9b1ec7d +1, 171131, 5888, 0x57825497 +1, 174135, 5888, 0xae02ebeb +1, 177139, 5888, 0x0c62e14f +1, 180143, 5788, 0x8a255f8f +1, 183096, 5888, 0x38993359 +1, 186100, 5888, 0x390baf95 +1, 189104, 5888, 0xb72c72ea +1, 192108, 5888, 0xbbd3c6fe +1, 195112, 5888, 0xefb26f0a +1, 198116, 5888, 0xcc404dd0 +1, 201120, 5888, 0xffa23082 +1, 204124, 5888, 0xd0c43567 +1, 207129, 5888, 0x4d3b7958 +1, 210133, 5888, 0x47125aa1 +1, 213137, 5888, 0x99286cf3 +1, 216141, 5888, 0x478d61e2 +1, 219145, 5888, 0xac65b47e +1, 222149, 5888, 0x333c1d1a +1, 225153, 5888, 0x8f960ecf +1, 228157, 5888, 0x58f76aec +1, 231161, 5888, 0xb5e0dded +1, 234165, 5888, 0xaf1a8f9a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/interplay-mve-8bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/interplay-mve-8bit new file mode 100644 index 00000000..0b41f352 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/interplay-mve-8bit @@ -0,0 +1,234 @@ +1, 0, 5848, 0xea04292b +0, 0, 414720, 0xa5cd50ca +1, 5967, 5888, 0x0e59e942 +0, 6006, 414720, 0x3facd321 +1, 11976, 5888, 0x56d480f6 +0, 12011, 414720, 0x849e6d4b +1, 17984, 5888, 0xcb560b22 +0, 18017, 414720, 0xe649363f +1, 23992, 5888, 0xca26865b +0, 24022, 414720, 0x5bbd7b14 +1, 30000, 5888, 0xa434392f +0, 30028, 414720, 0xe246ab51 +1, 36008, 5888, 0xa0615fe4 +0, 36033, 414720, 0x5721b22e +1, 42016, 5888, 0x85b241cd +0, 42039, 414720, 0xe391e107 +1, 48024, 5888, 0x2c417a43 +0, 48044, 414720, 0x04d851ff +1, 54033, 5888, 0x2d5ed665 +0, 54050, 414720, 0x8d80d580 +1, 60041, 5888, 0x37267a2d +0, 60055, 414720, 0x5a24b0bc +1, 66049, 5888, 0x1f803c67 +0, 66061, 414720, 0x06cd6960 +1, 72057, 5888, 0xfb7940ef +0, 72066, 414720, 0xf5ca48b4 +1, 78065, 5888, 0x1a5371e8 +0, 78072, 414720, 0x24700f94 +1, 84073, 5888, 0x37e29b21 +0, 84077, 414720, 0xb0bfe451 +1, 90082, 5848, 0x70065769 +0, 90083, 414720, 0x00e9f3d1 +1, 96049, 5888, 0xaf624f3d +0, 96088, 414720, 0x0efbffd1 +1, 102057, 5888, 0x8f5e5b57 +0, 102094, 414720, 0x2ecdfc8d +1, 108065, 5888, 0x93545968 +0, 108099, 414720, 0x94b531fc +1, 114073, 5888, 0x915f268f +0, 114105, 414720, 0x2c2579f8 +1, 120082, 5888, 0x9cd48ac4 +0, 120110, 414720, 0x6c7ecfb8 +1, 126090, 5888, 0x812c8e13 +0, 126116, 414720, 0x08982527 +1, 132098, 5888, 0xe794a2a7 +0, 132121, 414720, 0x5c0161b3 +1, 138106, 5888, 0x4a056e4b +0, 138127, 414720, 0x453ce413 +1, 144114, 5888, 0xa3589992 +0, 144132, 414720, 0x634e36b2 +1, 150122, 5888, 0x19ea7ec5 +0, 150138, 414720, 0x401a683a +1, 156131, 5888, 0x422d5097 +0, 156144, 414720, 0x3c5f442e +1, 162139, 5888, 0xc9fd963f +0, 162149, 414720, 0x075ef787 +1, 168147, 5888, 0xc556a5ea +0, 168155, 414720, 0x8501a04f +1, 174155, 5888, 0x51557e0f +0, 174160, 414720, 0x3620093b +1, 180163, 5848, 0x4903ad21 +0, 180166, 414720, 0xa42d9480 +1, 186131, 5888, 0xb1c85e85 +0, 186171, 414720, 0x09b150b4 +1, 192139, 5888, 0x68963d65 +0, 192177, 414720, 0xcad407f0 +1, 198147, 5888, 0x62a3124e +0, 198182, 414720, 0x69e5eecd +1, 204155, 5888, 0x4ff1878f +0, 204188, 414720, 0xb92ad2d9 +1, 210163, 5888, 0x8b09ac18 +0, 210193, 414720, 0xc78eaf29 +1, 216171, 5888, 0x67d85338 +0, 216199, 414720, 0x47c3fa91 +1, 222180, 5888, 0x82eca0a6 +0, 222204, 414720, 0x8847b7b8 +1, 228188, 5888, 0x81a17eb8 +0, 228210, 414720, 0x864cab2f +1, 234196, 5888, 0x7108478c +0, 234215, 414720, 0x78d653e2 +1, 240204, 5888, 0xbfc18b09 +0, 240221, 414720, 0xda15cbd2 +1, 246212, 5888, 0xad93711f +0, 246226, 414720, 0xdf9ce28a +1, 252220, 5888, 0xf8d25e39 +0, 252232, 414720, 0xe88c49ca +1, 258229, 5888, 0x41edd04e +0, 258237, 414720, 0xd6bcbc07 +1, 264237, 5888, 0xa6557ee2 +0, 264243, 414720, 0xf0b4a7bf +1, 270245, 5848, 0xc14d5456 +0, 270248, 414720, 0x74f9bfbf +1, 276212, 5888, 0x20a7821f +0, 276254, 414720, 0x904ce103 +1, 282220, 5888, 0x9f1a8f9d +0, 282259, 414720, 0xca877e4a +1, 288229, 5888, 0x2f3c6cc8 +0, 288265, 414720, 0x588effd6 +1, 294237, 5888, 0x757c894a +0, 294270, 414720, 0x6dff8b71 +1, 300245, 5888, 0x483e98bb +0, 300276, 414720, 0xbeaae788 +1, 306253, 5888, 0x84289c75 +0, 306282, 414720, 0x1a4d1242 +1, 312261, 5888, 0xf79d5a91 +0, 312287, 414720, 0x4ae98ea0 +1, 318269, 5888, 0x395b5228 +0, 318293, 414720, 0x41ed6d22 +1, 324278, 5888, 0x9c937a14 +0, 324298, 414720, 0x486e70aa +1, 330286, 5888, 0x40c169cf +0, 330304, 414720, 0xfddc103e +1, 336294, 5888, 0x3e7f99b0 +0, 336309, 414720, 0x8620f03e +1, 342302, 5888, 0xd4de993e +0, 342315, 414720, 0x0e4ec273 +1, 348310, 5888, 0xae856b09 +0, 348320, 414720, 0xb2298b3e +1, 354318, 5888, 0xa2369c95 +0, 354326, 414720, 0xb4f50176 +1, 360327, 5848, 0x992d516b +0, 360331, 414720, 0xb9c7a495 +1, 366294, 5888, 0xcd785ba9 +0, 366337, 414720, 0xed270702 +1, 372302, 5888, 0x55ea3bce +0, 372342, 414720, 0x98b72586 +1, 378310, 5888, 0xf06d4bbf +0, 378348, 414720, 0xd8977cb1 +1, 384318, 5888, 0x2a9d4c1a +0, 384353, 414720, 0xff3d3851 +1, 390327, 5888, 0xd5e348a3 +0, 390359, 414720, 0x7e4f0424 +1, 396335, 5888, 0x6431a24c +0, 396364, 414720, 0xa9e75006 +1, 402343, 5888, 0x41f9908c +0, 402370, 414720, 0x8f98cba9 +1, 408351, 5888, 0x0ed99656 +0, 408375, 414720, 0x25ecd620 +1, 414359, 5888, 0x635a6392 +0, 414381, 414720, 0x78cf5c58 +1, 420367, 5888, 0x690c750c +0, 420386, 414720, 0x3fb4b81a +1, 426376, 5888, 0xf9d97b23 +0, 426392, 414720, 0xd7b655fa +1, 432384, 5888, 0x75e1606b +0, 432397, 414720, 0xd9158db3 +1, 438392, 5888, 0x1bcb43b0 +0, 438403, 414720, 0x2e651852 +1, 444400, 5888, 0x48c295cb +0, 444408, 414720, 0x9f9adb64 +1, 450408, 5848, 0xe47f7b5d +0, 450414, 414720, 0xe9d16e81 +1, 456376, 5888, 0x20be7f3e +0, 456420, 414720, 0xbe73daf5 +1, 462384, 5888, 0x8c2428c4 +0, 462425, 414720, 0x3d164329 +1, 468392, 5888, 0x851379af +0, 468431, 414720, 0x1d5a9bc8 +1, 474400, 5888, 0x5916647d +0, 474436, 414720, 0x8e8debbe +1, 480408, 5888, 0xef9c6281 +0, 480442, 414720, 0x4e7a2bf0 +1, 486416, 5888, 0x49660d32 +0, 486447, 414720, 0x4a13804d +1, 492424, 5888, 0x62cf36a1 +0, 492453, 414720, 0x5dd188d8 +1, 498433, 5888, 0x56dff39c +0, 498458, 414720, 0xbe7f4963 +1, 504441, 5888, 0x4e6b5b02 +0, 504464, 414720, 0xcff3b767 +1, 510449, 5888, 0xb8697067 +0, 510469, 414720, 0xbbd3afa0 +1, 516457, 5888, 0xcb4e2706 +0, 516475, 414720, 0xaf9dec62 +1, 522465, 5888, 0x6eaa9669 +0, 522480, 414720, 0xc74816a1 +1, 528473, 5888, 0xfd9d7dba +0, 528486, 414720, 0x51488bfc +1, 534482, 5888, 0xfe137923 +0, 534491, 414720, 0x68c10a2c +1, 540490, 5848, 0x1931296f +0, 540497, 414720, 0x10179c4e +1, 546457, 5888, 0xa09a7c03 +0, 546502, 414720, 0x18d559b7 +1, 552465, 5888, 0xded9802d +0, 552508, 414720, 0x8257aa55 +1, 558473, 5888, 0x9f6723b7 +0, 558513, 414720, 0x9ea24501 +1, 564482, 5888, 0x3ad02476 +0, 564519, 414720, 0x238605cc +1, 570490, 5888, 0xa1647e32 +0, 570524, 414720, 0xb552deaa +1, 576498, 5888, 0x728672da +0, 576530, 414720, 0x07c3348d +1, 582506, 5888, 0x9c098090 +0, 582535, 414720, 0x82f4f9b0 +1, 588514, 5888, 0x32a65ea3 +0, 588541, 414720, 0xf5d76bc5 +1, 594522, 5888, 0xdde141d5 +0, 594546, 414720, 0x34b3a1e6 +1, 600531, 5888, 0x816c5fb4 +0, 600552, 414720, 0xda25e11b +1, 606539, 5888, 0x75e17581 +0, 606558, 414720, 0x2b19936b +1, 612547, 5888, 0x59035469 +0, 612563, 414720, 0xe91f9f73 +1, 618555, 5888, 0x20d340cd +0, 618569, 414720, 0x48d09aab +1, 624563, 5888, 0xa89a8790 +0, 624574, 414720, 0xac42bf83 +1, 630571, 5848, 0x12b74c34 +0, 630580, 414720, 0x2d8ca14e +1, 636539, 5888, 0xcd3b3bef +0, 636585, 414720, 0xe65462fd +1, 642547, 5888, 0xe5c44bf3 +0, 642591, 414720, 0xe5bfc929 +1, 648555, 5888, 0xb82c4fa4 +0, 648596, 414720, 0x66784c58 +1, 654563, 5888, 0x05b2443a +0, 654602, 414720, 0x70dbeca8 +1, 660571, 5888, 0x78028172 +1, 666580, 5888, 0xdfcac19a +1, 672588, 5888, 0x0761a0b9 +1, 678596, 5888, 0x77d88607 +1, 684604, 5888, 0xdd7f4d77 +1, 690612, 5888, 0x366bf58a +1, 696620, 5888, 0x9a3d59b5 +1, 702629, 5888, 0x16cb777f +1, 708637, 5888, 0x1d4afe64 +1, 714645, 5888, 0xc0fe1e73 +1, 720653, 5848, 0xcceb69c8 +1, 726620, 5888, 0x89449643 +1, 732629, 5888, 0x5fe595b7 +1, 738637, 5888, 0x400a8c77 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iv8-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iv8-demux new file mode 100644 index 00000000..87217f90 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/iv8-demux @@ -0,0 +1,25 @@ +0, 0, 20883, 0x347191e2 +0, 0, 20882, 0xe1573905 +0, 3600, 20894, 0xd54f516a +0, 7200, 20891, 0x1b5c5039 +0, 10800, 20883, 0x8e785b4d +0, 14400, 20870, 0xd26ca1f6 +0, 18000, 21448, 0x946f5b2b +0, 21600, 21433, 0xb18687c5 +0, 25200, 20865, 0xc0eb3fce +0, 28800, 20842, 0x9d0728ba +0, 32399, 20878, 0xf60f5dee +0, 35999, 20866, 0x3bde568f +0, 39600, 20884, 0x22736993 +0, 43200, 20860, 0xf56f2fca +0, 46800, 20872, 0xf39e3cb3 +0, 50400, 20835, 0xa3c4363b +0, 53999, 20905, 0x552853d1 +0, 57600, 20874, 0xed0b91ec +0, 61200, 20877, 0xe1623e01 +0, 64799, 20933, 0x19906564 +0, 68399, 20891, 0x3d064fd3 +0, 72000, 20834, 0xcb774dbc +0, 75600, 20870, 0xbc536589 +0, 79200, 21421, 0xc99a68e4 +0, 82800, 12869, 0x5684e304 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/kmvc b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/kmvc new file mode 100644 index 00000000..eb7bcdac --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/kmvc @@ -0,0 +1,75 @@ +0, 0, 153600, 0x00000000 +0, 3600, 153600, 0x00000000 +0, 7200, 153600, 0x00000000 +0, 10800, 153600, 0x3ad906f0 +0, 14400, 153600, 0x9f7c2e80 +0, 18000, 153600, 0x548c9e10 +0, 21600, 153600, 0xab4154e7 +0, 25200, 153600, 0x762964be +0, 28800, 153600, 0xea6beab1 +0, 32400, 153600, 0x00805c23 +0, 36000, 153600, 0x932eebd2 +0, 39600, 153600, 0x73a9a1c4 +0, 43200, 153600, 0x3ecf80a2 +0, 46800, 153600, 0xb7266fcc +0, 50400, 153600, 0xf9a75e02 +0, 54000, 153600, 0xa4cb4c00 +0, 57600, 153600, 0x8cc653fa +0, 61200, 153600, 0xf0735df0 +0, 64800, 153600, 0x46945766 +0, 68400, 153600, 0x1cf75120 +0, 72000, 153600, 0x015d4476 +0, 75600, 153600, 0x4ad6419c +0, 79200, 153600, 0xf97a1292 +0, 82800, 153600, 0x8048c6bd +0, 86400, 153600, 0x0aa97f7f +0, 90000, 153600, 0xcd1a0531 +0, 93600, 153600, 0xeb9e72b4 +0, 97200, 153600, 0x5a61d657 +0, 100800, 153600, 0xc4eb1759 +0, 104400, 153600, 0x07b05b0c +0, 108000, 153600, 0x9c417927 +0, 111600, 153600, 0xa3a28516 +0, 115200, 153600, 0x78e97511 +0, 118800, 153600, 0x05c94e38 +0, 122400, 153600, 0x0003ffa4 +0, 126000, 153600, 0x46489827 +0, 129600, 153600, 0xa6ac0ea6 +0, 133200, 153600, 0xf4ae7e9a +0, 136800, 153600, 0xe07dd526 +0, 140400, 153600, 0x5c0d0ab9 +0, 144000, 153600, 0xad542525 +0, 147600, 153600, 0xa72a35b1 +0, 151200, 153600, 0x373d3cbd +0, 154800, 153600, 0x242c3cad +0, 158400, 153600, 0xbe4f44e5 +0, 162000, 153600, 0x3b883575 +0, 165600, 153600, 0xcd7d2995 +0, 169200, 153600, 0x89a01f99 +0, 172800, 153600, 0x79ac0861 +0, 176400, 153600, 0xefb6ee22 +0, 180000, 153600, 0x4498d6b2 +0, 183600, 153600, 0x99efd0a6 +0, 187200, 153600, 0xd937c282 +0, 190800, 153600, 0xa6c6bbb2 +0, 194400, 153600, 0xf667bf0e +0, 198000, 153600, 0x83b2c12e +0, 201600, 153600, 0xcbd6c766 +0, 205200, 153600, 0xc5b3c762 +0, 208800, 153600, 0xe51fc5fa +0, 212400, 153600, 0x6542c5ee +0, 216000, 153600, 0x59d2c946 +0, 219600, 153600, 0xccaacdde +0, 223200, 153600, 0x884ec6aa +0, 226800, 153600, 0xb3d7c2de +0, 230400, 153600, 0xd4e8c1a2 +0, 234000, 153600, 0xa416c3ba +0, 237600, 153600, 0x6905b62e +0, 241200, 153600, 0xce16b456 +0, 244800, 153600, 0xcbd9a67e +0, 248400, 153600, 0x6785afd6 +0, 252000, 153600, 0x6fd7b1fa +0, 255600, 153600, 0x2a65b77e +0, 259200, 153600, 0xa162aff6 +0, 262800, 153600, 0x227ea802 +0, 266400, 153600, 0x98de79fa diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lmlm4-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lmlm4-demux new file mode 100644 index 00000000..8ecf4b2d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lmlm4-demux @@ -0,0 +1,547 @@ +1, 0, 768, 0xaebcbebb +0, 0, 5951, 0xe9118e0d +1, 2160, 768, 0xaebcbebb +0, 3003, 1672, 0x4b80d4ca +1, 4320, 768, 0xaebcbebb +0, 6006, 1604, 0x99e1b0a7 +1, 6480, 768, 0x866fe37a +1, 8640, 768, 0x05d76890 +0, 9009, 1204, 0x9559038a +1, 10800, 768, 0x858f5511 +0, 12012, 1482, 0x60056564 +1, 12960, 768, 0x97cb65ef +0, 15015, 1105, 0xf508cef4 +1, 15120, 768, 0xe269742c +1, 17280, 768, 0xa6015f8d +0, 18018, 1193, 0xc8e0fd36 +1, 19440, 768, 0x759163e0 +0, 21021, 1247, 0x8dd202e5 +1, 21600, 768, 0xb1e16082 +1, 23760, 768, 0x1b616429 +0, 24024, 1367, 0xf59435e5 +1, 25920, 768, 0x7e4364f7 +0, 27027, 1406, 0x68ba4a7e +1, 28080, 768, 0x59bd64f7 +0, 30030, 1262, 0x82c04123 +1, 30240, 768, 0xc3116fc6 +1, 32400, 768, 0x6a1c6b56 +0, 33033, 1381, 0x02335cf9 +1, 34560, 768, 0x285a64cf +0, 36036, 1450, 0x7be46fd1 +1, 36720, 768, 0x79b16d65 +1, 38880, 768, 0x09b47635 +0, 39039, 1362, 0x75cc381a +1, 41040, 768, 0x81597446 +0, 42042, 1409, 0x9ed74f3f +1, 43200, 768, 0xfeb66eee +0, 45045, 1253, 0x82400ae1 +1, 45360, 768, 0x78557618 +1, 47520, 768, 0x3af170bf +0, 48048, 5499, 0xed286805 +1, 49680, 768, 0xefbd6399 +0, 51051, 1403, 0x483c4cbc +1, 51840, 768, 0xc98e7492 +1, 54000, 768, 0x010d7149 +0, 54054, 1632, 0xa9ebcd6c +1, 56160, 768, 0xce838b07 +0, 57057, 1207, 0xc8580724 +1, 58320, 768, 0xed18726c +0, 60060, 1289, 0x61fb2fd2 +1, 60480, 768, 0x017e6712 +1, 62640, 768, 0x7f9268e9 +0, 63063, 1230, 0xf348f53c +1, 64800, 768, 0xf6f258fc +0, 66066, 1579, 0xa260b1ac +1, 66960, 768, 0x9a1a6f31 +0, 69069, 949, 0x91849002 +1, 69120, 768, 0x14b47b23 +1, 71280, 768, 0x9bdc6a50 +0, 72072, 786, 0x3e33576f +1, 73440, 768, 0x0fc46dab +0, 75075, 894, 0x9ac36a61 +1, 75600, 768, 0x6c387372 +1, 77760, 768, 0x581e71cd +0, 78078, 1186, 0x6bfc116e +1, 79920, 768, 0x00cb785f +0, 81081, 1187, 0xcfc512ae +1, 82080, 768, 0x1dda7032 +0, 84084, 1527, 0x5c2c965a +1, 84240, 768, 0xf57c7103 +1, 86400, 768, 0x2d927183 +0, 87087, 1536, 0x5ba7ac29 +1, 88560, 768, 0xdae86cdf +0, 90090, 1095, 0xce06eb96 +1, 90720, 768, 0x2a2f6c3c +1, 92880, 768, 0x44696eba +0, 93093, 1402, 0x642f6b0d +1, 95040, 768, 0xf67c71c4 +0, 96096, 5551, 0xf01a9c08 +1, 97200, 768, 0xc1ce7237 +0, 99099, 1211, 0x350206f7 +1, 99360, 768, 0xd9c36ef5 +1, 101520, 768, 0x63b06b03 +0, 102102, 887, 0x08767619 +1, 103680, 768, 0x8de97ebe +0, 105105, 1042, 0xcc81a9ed +1, 105840, 768, 0xbf117c32 +1, 108000, 768, 0x82897497 +0, 108108, 1247, 0x6f320614 +1, 110160, 768, 0x7a347abb +0, 111111, 1459, 0xd28975b5 +1, 112320, 768, 0xc99b691e +0, 114114, 1116, 0x1ab1e9db +1, 114480, 768, 0xf4fc6e74 +1, 116640, 768, 0x511d6ec4 +0, 117117, 1110, 0x6411f66a +1, 118800, 768, 0xb8c06b5f +0, 120120, 1282, 0xd468375d +1, 120960, 768, 0xf1776aed +1, 123120, 768, 0xe6fe7fb4 +0, 123123, 1077, 0x1273c6e3 +1, 125280, 768, 0x36907aff +0, 126126, 1043, 0x12dbd3ae +1, 127440, 768, 0xddf666bb +0, 129129, 1087, 0x3e70d37a +1, 129600, 768, 0x8e896ebc +1, 131760, 768, 0x0aa47dfa +0, 132132, 992, 0x0651a71c +1, 133920, 768, 0xc1736811 +0, 135135, 1012, 0x6a069f8c +1, 136080, 768, 0xb3e87009 +0, 138138, 1320, 0x92803d69 +1, 138240, 768, 0xf23e6c00 +1, 140400, 768, 0x993a71d2 +0, 141141, 1080, 0xe0ffbe95 +1, 142560, 768, 0xa53466dd +0, 144144, 5639, 0x658ca26b +1, 144720, 768, 0xb43a74b0 +1, 146880, 768, 0x348f615c +0, 147147, 1385, 0xbcb96241 +1, 149040, 768, 0x298f6e1b +0, 150150, 1142, 0x8c6df318 +1, 151200, 768, 0x5db469c8 +0, 153153, 1175, 0xcac1faef +1, 153360, 768, 0x08f16c2c +1, 155520, 768, 0x4a0474cb +0, 156156, 1091, 0xa937e32a +1, 157680, 768, 0x077c760b +0, 159159, 1174, 0xfa50040d +1, 159840, 768, 0xa5777c2e +1, 162000, 768, 0x0d157ea6 +0, 162162, 1293, 0x0c8d2740 +1, 164160, 768, 0x9bc26f86 +0, 165165, 1262, 0x502c0c35 +1, 166320, 768, 0x1a72742d +0, 168168, 1038, 0x5e98c0cd +1, 168480, 768, 0xa5bb6bbb +1, 170640, 768, 0x48496c4c +0, 171171, 1362, 0x256e43cf +1, 172800, 768, 0x800d78f0 +0, 174174, 1200, 0x29e6f055 +1, 174960, 768, 0x40db840c +1, 177120, 768, 0xadc96a6b +0, 177177, 1495, 0x88e9b973 +1, 179280, 768, 0xff986b03 +0, 180180, 1386, 0x849297d2 +1, 181440, 768, 0x152473d6 +0, 183183, 1572, 0x63b7dc79 +1, 183600, 768, 0x01567323 +1, 185760, 768, 0xe5f26fe5 +0, 186186, 1190, 0x32ccf4cb +1, 187920, 768, 0xa8fd72cd +0, 189189, 1395, 0xa6ec4ae9 +1, 190080, 768, 0x8857655b +0, 192192, 5692, 0x81aed6f3 +1, 192240, 768, 0x84017b13 +1, 194400, 768, 0xe6a968b3 +0, 195195, 1335, 0xe98a5497 +1, 196560, 768, 0xb03a7566 +0, 198198, 1361, 0x8ae15ab5 +1, 198720, 768, 0x8bea5f62 +1, 200880, 768, 0xac7570b0 +0, 201201, 1525, 0xed2bc1e8 +1, 203040, 768, 0x11306fac +0, 204204, 1570, 0xba70d74b +1, 205200, 768, 0xf2af5b28 +0, 207207, 1349, 0xd97a687d +1, 207360, 768, 0x3069681f +1, 209520, 768, 0x7ff07033 +0, 210210, 1270, 0xca8c3ca8 +1, 211680, 768, 0xd74973f2 +0, 213213, 1016, 0x32d0c81a +1, 213840, 768, 0xb3627304 +1, 216000, 768, 0x11ff7589 +0, 216216, 983, 0x536faa97 +1, 218160, 768, 0x4a156c63 +0, 219219, 1111, 0x44ade015 +1, 220320, 768, 0xcb036127 +0, 222222, 1314, 0xce7c477d +1, 222480, 768, 0x0b796bb9 +1, 224640, 768, 0x1d516c35 +0, 225225, 1005, 0x0196b491 +1, 226800, 768, 0xa9146da1 +0, 228228, 1162, 0xb8f6ebe6 +1, 228960, 768, 0x6d176392 +1, 231120, 768, 0x6f966269 +0, 231231, 1440, 0xfca67c72 +1, 233280, 768, 0x7ee17724 +0, 234234, 1437, 0x491181b1 +1, 235440, 768, 0x3f07614a +0, 237237, 1261, 0xf0cd1898 +1, 237600, 768, 0x49d56945 +1, 239760, 768, 0x68eb660a +0, 240240, 5638, 0x3a25a9f2 +1, 241920, 768, 0xe7c96677 +0, 243243, 1091, 0x67d9c693 +1, 244080, 768, 0x7dc07a35 +1, 246240, 768, 0x1e9c6397 +0, 246246, 875, 0x52147bb1 +1, 248400, 768, 0x93ef5de4 +0, 249249, 1188, 0x8522000f +1, 250560, 768, 0x34af6803 +0, 252252, 1360, 0x89b82e7b +1, 252720, 768, 0x77e068be +1, 254880, 768, 0x65e274de +0, 255255, 1378, 0xe8644914 +1, 257040, 768, 0xb7ad6a8a +0, 258258, 1194, 0x89fef83d +1, 259200, 768, 0x84b3635f +0, 261261, 1422, 0x99daa18b +1, 261360, 768, 0x066b78f2 +1, 263520, 768, 0xda137428 +0, 264264, 1049, 0x72a9cec1 +1, 265680, 768, 0xfd6c7597 +0, 267267, 1327, 0x7d15307c +1, 267840, 768, 0x8d766d40 +0, 270270, 1225, 0x1b5d0f5f +0, 273273, 1173, 0x840efed5 +0, 276276, 1215, 0xa8e0035e +0, 279279, 1295, 0x142918ca +0, 282282, 1144, 0xf50cef50 +0, 285285, 1527, 0x7d13bd9d +0, 288288, 5609, 0x1ae1921d +0, 291291, 1303, 0xabdc264f +0, 294294, 1419, 0x878169bf +0, 297297, 972, 0x00c4a257 +0, 300300, 1277, 0x87d520cf +0, 303303, 1014, 0x5946b4ee +0, 306306, 1177, 0x124e0e23 +0, 309309, 1402, 0x8e6363cc +0, 312312, 1171, 0x9bdaeda2 +0, 315315, 1389, 0x2db53b22 +0, 318318, 1056, 0xd1c3de3e +0, 321321, 1320, 0x1ea142c7 +0, 324324, 1250, 0x33612229 +0, 327327, 1477, 0xb9648b48 +0, 330330, 1522, 0x5352c318 +0, 333333, 1391, 0x5e9157e0 +0, 336336, 5545, 0x569e64c1 +0, 339339, 1354, 0xdb39469e +0, 342342, 1302, 0x79912b5d +0, 345345, 1065, 0x4befcdd2 +0, 348348, 1408, 0x7d2f65a2 +0, 351351, 1727, 0x9cac0398 +0, 354354, 1590, 0xa321b563 +0, 357357, 1039, 0xfa35cabf +0, 360360, 1184, 0xb332fde7 +0, 363363, 669, 0xb10e3783 +0, 366366, 784, 0x57275e09 +0, 369369, 1051, 0xe072cd33 +0, 372372, 1119, 0x635ee9ee +0, 375375, 1147, 0x3916f981 +0, 378378, 1086, 0x306ef895 +0, 381381, 827, 0x213f7aef +0, 384384, 5525, 0x19157827 +0, 387387, 1044, 0xb661abc5 +0, 390390, 1143, 0x032e1109 +0, 393393, 1460, 0x5a2f9503 +0, 396396, 1178, 0xd038141f +0, 399399, 1004, 0x410ec3b2 +0, 402402, 1089, 0xc89af8c9 +0, 405405, 1367, 0x52085e0a +0, 408408, 1115, 0x8bb2ee7f +0, 411411, 1325, 0xc2e05647 +0, 414414, 1295, 0x213951c9 +0, 417417, 1054, 0xbb8bdaae +0, 420420, 1210, 0x431122bd +0, 423423, 1400, 0x47526fcc +0, 426426, 1188, 0x19770b07 +0, 429429, 1301, 0x437161c8 +0, 432432, 5281, 0xc0c92b55 +0, 435435, 840, 0x67da7b2f +0, 438438, 1094, 0x3fd6d944 +0, 441441, 832, 0x0eda74bc +0, 444444, 1096, 0x3300da7b +0, 447447, 1018, 0xa208c971 +0, 450450, 1389, 0x1167724c +0, 453453, 1411, 0xe3be666b +0, 456456, 1294, 0xa8f35cc6 +0, 459459, 1232, 0xfd0d20fd +0, 462462, 1252, 0xadd83a26 +0, 465465, 844, 0xcbaf6a55 +0, 468468, 979, 0x78d9b241 +0, 471471, 1057, 0x6743e16c +0, 474474, 776, 0xfedd6615 +0, 477477, 1158, 0xa39fee34 +0, 480480, 5288, 0x5f26ee02 +0, 483483, 1029, 0xa681bee8 +0, 486486, 1106, 0xa68dea33 +0, 489489, 844, 0x42fd83ec +0, 492492, 779, 0xb5006759 +0, 495495, 951, 0xec13af4f +0, 498498, 1011, 0x90e5c86e +0, 501501, 892, 0x4db48ca4 +0, 504504, 804, 0x59bf73a7 +0, 507507, 1001, 0x10c2b3ff +0, 510510, 879, 0x65c57eaf +0, 513513, 1320, 0x80815836 +0, 516516, 1448, 0xaf457b3b +0, 519519, 1168, 0x65b9f96a +0, 522522, 1002, 0x053fafb9 +0, 525525, 1101, 0x2d30c3d5 +0, 528528, 5314, 0x87cee383 +0, 531531, 1305, 0xb19035db +0, 534534, 1240, 0xdc6a0a65 +0, 537537, 1067, 0x9c88ba67 +0, 540540, 823, 0x2f736a43 +0, 543543, 1183, 0x2ef9f3c9 +0, 546546, 899, 0x3fcc8d11 +0, 549549, 886, 0xccec8d49 +0, 552552, 1190, 0x2d020fa1 +0, 555555, 1017, 0x0776b627 +0, 558558, 1202, 0xbdd808d5 +0, 561561, 998, 0x64c7c246 +0, 564564, 1200, 0x9d6e2289 +0, 567567, 895, 0xa8a68d80 +0, 570570, 748, 0xe61a49fb +0, 573573, 929, 0x30168b50 +0, 576576, 5276, 0xceb2edf2 +0, 579579, 1127, 0xab43ddc3 +0, 582582, 1028, 0xaacfbff5 +0, 585585, 914, 0xb63c8fb0 +0, 588588, 1067, 0xbdacd1ed +0, 591591, 1109, 0x6792ddec +0, 594594, 1310, 0x71bc4da2 +0, 597597, 1098, 0xc464de9b +0, 600600, 1018, 0x6833b875 +0, 603603, 1210, 0x44faf34b +0, 606606, 1200, 0x9ee816f6 +0, 609609, 1461, 0xc76b7d2b +0, 612612, 829, 0x006677e6 +0, 615615, 1145, 0xc769fb13 +0, 618618, 1292, 0xb63225f5 +0, 621621, 1252, 0x0e2a2626 +0, 624624, 5257, 0x3877eca1 +0, 627627, 952, 0x7f708d25 +0, 630630, 1125, 0x140cd81b +0, 633633, 1095, 0x3025dade +0, 636636, 1388, 0xd7494d4e +0, 639639, 1124, 0x0c48ee92 +0, 642642, 1556, 0xa0749ee2 +0, 645645, 1461, 0xe5fd7d7f +0, 648648, 903, 0x07a58303 +0, 651651, 1049, 0x4b6cd03b +0, 654654, 1044, 0x5f47cb48 +0, 657657, 1253, 0xba281c6a +0, 660660, 1618, 0xed7cd040 +0, 663663, 981, 0x2926b6f4 +0, 666666, 1560, 0xa0e1ab73 +0, 669669, 1479, 0x41a77e88 +0, 672672, 5222, 0xc2dbd182 +0, 675675, 925, 0x967580dd +0, 678678, 1284, 0x5b7822e0 +0, 681681, 1512, 0xe84da1e0 +0, 684684, 1514, 0xc38bb09e +0, 687687, 1224, 0x8752228e +0, 690690, 1296, 0xcf053c03 +0, 693693, 1117, 0x9a81e659 +0, 696696, 1090, 0x003ed687 +0, 699699, 1196, 0x3a510937 +0, 702702, 1075, 0x05eec8d4 +0, 705705, 1048, 0x3b19cb96 +0, 708708, 944, 0xaad89770 +0, 711711, 960, 0x94649e4c +0, 714714, 1079, 0x530ddaba +0, 717717, 1150, 0x0339e696 +0, 720720, 5189, 0xb8dac0bf +0, 723723, 1129, 0x3b2cd64d +0, 726726, 962, 0xe9df9a07 +0, 729729, 1113, 0xc6ccddb2 +0, 732732, 1069, 0xf589d4a4 +0, 735735, 889, 0x5f7b8762 +0, 738738, 863, 0xe9c36be4 +0, 741741, 1021, 0xcfb5a737 +0, 744744, 1048, 0x203ac9ff +0, 747747, 1223, 0x3e30fe35 +0, 750750, 814, 0x59c076fc +0, 753753, 1157, 0x0dcf0bd0 +0, 756756, 1691, 0xdd030547 +0, 759759, 1700, 0x7641fb7e +0, 762762, 1791, 0x57ac147b +0, 765765, 2008, 0x3d4483ca +0, 768768, 4579, 0x874aa75b +0, 771771, 1647, 0xeddef621 +0, 774774, 1999, 0x61d4a23a +0, 777777, 1572, 0x1c3ae6e1 +0, 780780, 1803, 0xb31c3a11 +0, 783783, 1919, 0xccbf64e3 +0, 786786, 1720, 0xa4d010e5 +0, 789789, 1721, 0x87ee0c7b +0, 792792, 1626, 0x8211f3d0 +0, 795795, 1675, 0xef8a0b3d +0, 798798, 1609, 0x8731ce06 +0, 801801, 1691, 0xcf24038b +0, 804804, 1637, 0x21d8e1b2 +0, 807807, 1546, 0xc597a700 +0, 810810, 1518, 0xb944bc11 +0, 813813, 1403, 0x999e59a8 +0, 816816, 2467, 0xe69f2507 +0, 819819, 531, 0x3c7cea7e +0, 822822, 555, 0xdf20fb22 +0, 825825, 500, 0xebeee00d +0, 828828, 446, 0x664cc711 +0, 831831, 521, 0xf223df4b +0, 834834, 559, 0x4dc60028 +0, 837837, 593, 0xec440ba9 +0, 840840, 557, 0xef0100b1 +0, 843843, 602, 0x7b1cfd88 +0, 846846, 566, 0x77700a1d +0, 849849, 523, 0x3df7eb64 +0, 852852, 482, 0x5da1dba9 +0, 855855, 541, 0x9c8ff3d7 +0, 858858, 572, 0x3e1204b2 +0, 861861, 549, 0x0921fe3d +0, 864864, 2429, 0xba4fe5a8 +0, 867867, 495, 0xc35ade54 +0, 870870, 453, 0xcc66c9dc +0, 873873, 421, 0x3aa7ce8f +0, 876876, 448, 0x56c6d3d7 +0, 879879, 478, 0x4131d467 +0, 882882, 497, 0xac3ce3ca +0, 885885, 470, 0x41b9d9d3 +0, 888888, 454, 0x44c2d956 +0, 891891, 460, 0x6629db01 +0, 894894, 488, 0x6be2dd68 +0, 897897, 512, 0xda4cf116 +0, 900900, 550, 0x6e990da9 +0, 903903, 561, 0x81180e5e +0, 906906, 689, 0xe58a5a9a +0, 909909, 548, 0xfa1417a9 +0, 912912, 2832, 0x942495a5 +0, 915915, 610, 0x6b201ab9 +0, 918918, 1015, 0x5f36b3f9 +0, 921921, 870, 0x14e48f0c +0, 924924, 716, 0xf4034b52 +0, 927927, 763, 0xcbf4694e +0, 930930, 778, 0xb9396764 +0, 933933, 831, 0x31999005 +0, 936936, 877, 0xc95e977f +0, 939939, 836, 0xb56c7d61 +0, 942942, 853, 0x2d5980cf +0, 945945, 861, 0x25629295 +0, 948948, 897, 0x0ff78a5f +0, 951951, 1016, 0x4dd8cdfd +0, 954954, 1117, 0x763f06c4 +0, 957957, 984, 0xcf7bc906 +0, 960960, 2750, 0xd428962d +0, 963963, 995, 0x5cbdd6a4 +0, 966966, 894, 0xc42b9e25 +0, 969969, 1028, 0xdf8ad906 +0, 972972, 1059, 0x4c49f0cc +0, 975975, 1122, 0x8880eed8 +0, 978978, 1007, 0xa9b4c243 +0, 981981, 1055, 0x6051dcd6 +0, 984984, 1293, 0xc3b32fa5 +0, 987987, 1101, 0xf986f9af +0, 990990, 1272, 0x13883127 +0, 993993, 1037, 0xb97cebff +0, 996996, 980, 0x0931d807 +0, 999999, 928, 0xbc3eb30b +0, 1003002, 1068, 0x62d9e8de +0, 1006005, 852, 0x9278a49a +0, 1009008, 2841, 0x3091d12d +0, 1012011, 931, 0x60f6c26e +0, 1015014, 949, 0x31b9c856 +0, 1018017, 835, 0xfe018775 +0, 1021020, 779, 0x85356cd7 +0, 1024023, 748, 0x862756bf +0, 1027026, 768, 0x0b7d645c +0, 1030029, 786, 0x7c196f5b +0, 1033032, 716, 0x4e8252cc +0, 1036035, 671, 0x0b2d3023 +0, 1039038, 708, 0x3b2b4f25 +0, 1042041, 786, 0x523d670e +0, 1045044, 680, 0x329142ec +0, 1048047, 703, 0x841b456c +0, 1051050, 660, 0x5cf332f1 +0, 1054053, 681, 0xcd7b3915 +0, 1057056, 2445, 0x27660ecb +0, 1060059, 667, 0xf3d53d2a +0, 1063062, 652, 0xe2b037b0 +0, 1066065, 695, 0x200248fc +0, 1069068, 659, 0x7f6434c5 +0, 1072071, 682, 0x8d243afb +0, 1075074, 701, 0x16e6476f +0, 1078077, 636, 0x319a3236 +0, 1081080, 679, 0x81fa41f9 +0, 1084083, 740, 0xb32850af +0, 1087086, 694, 0xe3f832c2 +0, 1090089, 681, 0x8174353f +0, 1093092, 757, 0xebbe5a1f +0, 1096095, 683, 0x9b46383c +0, 1099098, 816, 0xd41e6bdf +0, 1102101, 1058, 0x6170d2e6 +0, 1105104, 2489, 0x58fb28e1 +0, 1108107, 804, 0xb3037da8 +0, 1111110, 1053, 0x81ffc0a8 +0, 1114113, 868, 0xf73583cb +0, 1117116, 875, 0xfa5d85bd +0, 1120119, 723, 0x0714418d +0, 1123122, 670, 0xd04333a1 +0, 1126125, 854, 0x370e730d +0, 1129128, 794, 0x3d8a5e3c +0, 1132131, 836, 0xebe26aa7 +0, 1135134, 871, 0x1da58c5e +0, 1138137, 827, 0xda1e6ccb +0, 1141140, 805, 0x10ad6a44 +0, 1144143, 831, 0x826f6fc9 +0, 1147146, 832, 0xb2517364 +0, 1150149, 887, 0x11bf8a3f +0, 1153152, 2718, 0x26a8a174 +0, 1156155, 805, 0x4d0179f9 +0, 1159158, 699, 0x176c4f45 +0, 1162161, 758, 0xc1fc5b16 +0, 1165164, 707, 0x161b4891 +0, 1168167, 733, 0x99b554c0 +0, 1171170, 671, 0xccee2f89 +0, 1174173, 762, 0xd6416c9d +0, 1177176, 721, 0x2ad94f0c +0, 1180179, 727, 0x6280572e +0, 1183182, 856, 0x0a7b797e +0, 1186185, 843, 0xc64288aa +0, 1189188, 877, 0x6d1c945d +0, 1192191, 780, 0x4ba464e8 +0, 1195194, 808, 0xb3087cca +0, 1198197, 870, 0x75809930 +0, 1201200, 2919, 0x5a80f685 +0, 1204203, 1027, 0xc98add3d +0, 1207206, 1003, 0x0d88bd54 +0, 1210209, 1189, 0xb2f91ec7 +0, 1213212, 1320, 0x5acc4db3 +0, 1216215, 1381, 0xbd585feb +0, 1219218, 1378, 0xe1a656f0 +0, 1222221, 1398, 0x88b57a5e +0, 1225224, 1449, 0x1c737698 +0, 1228227, 1420, 0x6f0f80cd +0, 1231230, 1032, 0x2d16d643 +0, 1234233, 1275, 0x38844729 +0, 1237236, 1112, 0x300207ea +0, 1240239, 1105, 0xa2b700be +0, 1243242, 1283, 0x08d04bef +0, 1246245, 1056, 0xf795d994 +0, 1249248, 3202, 0xebf07050 +0, 1252251, 1034, 0x1099dbe5 +0, 1255254, 922, 0x88be9edc +0, 1258257, 1050, 0xd3d7eb96 +0, 1261260, 979, 0x8de6b302 +0, 1264263, 1053, 0x5de2eca8 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/loco-rgb b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/loco-rgb new file mode 100644 index 00000000..4d2790b8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/loco-rgb @@ -0,0 +1,5 @@ +0, 0, 72192, 0x1847500c +0, 12780, 72192, 0x1b0e2e87 +0, 25560, 72192, 0x293276c8 +0, 38340, 72192, 0x743b9705 +0, 51120, 72192, 0xcc1b2530 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/loco-yuy2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/loco-yuy2 new file mode 100644 index 00000000..d3d68df0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/loco-yuy2 @@ -0,0 +1,3 @@ +0, 0, 48128, 0x7795782d +0, 12780, 48128, 0x3d89bcf7 +0, 25560, 48128, 0x170d200a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-appleaudio b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-appleaudio new file mode 100644 index 00000000..df270616 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-appleaudio @@ -0,0 +1 @@ +d0beb768d860b4776358077dd9fcb1e9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-meridianaudio b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-meridianaudio new file mode 100644 index 00000000..7f6f43fa --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-meridianaudio @@ -0,0 +1 @@ +b3d0c9523c42fae639f7074e60281509 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-monkeysaudio b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-monkeysaudio new file mode 100644 index 00000000..4b8caa1f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-monkeysaudio @@ -0,0 +1 @@ +a28d4e5f2192057f7d4bece870f40bd0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-shortenaudio b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-shortenaudio new file mode 100644 index 00000000..94480527 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-shortenaudio @@ -0,0 +1 @@ +9949141c405524f37ef1058b1ef4114b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-tta b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-tta new file mode 100644 index 00000000..85b7a590 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-tta @@ -0,0 +1 @@ +CRC=0xb2b8b6d9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-wavpackaudio b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-wavpackaudio new file mode 100644 index 00000000..6281924c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/lossless-wavpackaudio @@ -0,0 +1 @@ +97223f65c91213694a660d52f87f35aa diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/maxis-xa b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/maxis-xa new file mode 100644 index 00000000..0dd23db8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/maxis-xa @@ -0,0 +1 @@ +b4cd52fc080bffefeea94ce7c116046f diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mimic b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mimic new file mode 100644 index 00000000..8195cdca --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mimic @@ -0,0 +1,76 @@ +0, 0, 115200, 0xa974d407 +0, 90, 115200, 0x72618b84 +0, 180, 115200, 0x87768573 +0, 270, 115200, 0x5d218e3e +0, 360, 115200, 0x0c0db41c +0, 450, 115200, 0xb777fd48 +0, 540, 115200, 0x40765de7 +0, 630, 115200, 0x370a3c90 +0, 720, 115200, 0xc605785a +0, 810, 115200, 0x49468b23 +0, 900, 115200, 0x986b6fd4 +0, 990, 115200, 0x30f22ef8 +0, 1080, 115200, 0xa90bd608 +0, 1170, 115200, 0x9cf36518 +0, 1260, 115200, 0x4ef1a679 +0, 1350, 115200, 0x0df65873 +0, 1440, 115200, 0xfecd4233 +0, 1530, 115200, 0xee2f26cb +0, 1620, 115200, 0x795f612d +0, 1710, 115200, 0xbbb90125 +0, 1800, 115200, 0x9230fb6e +0, 1890, 115200, 0x11869996 +0, 1980, 115200, 0x6b5c892b +0, 2070, 115200, 0x88bdb9cd +0, 2160, 115200, 0x364bc5a0 +0, 2250, 115200, 0x6b66d817 +0, 2340, 115200, 0xd3a41252 +0, 2430, 115200, 0x0cf5612f +0, 2520, 115200, 0x9752d055 +0, 2610, 115200, 0x486e9f6f +0, 2700, 115200, 0x3eab62f8 +0, 2790, 115200, 0xa7f52762 +0, 2880, 115200, 0xfd4c4bbc +0, 2970, 115200, 0x194023f6 +0, 3060, 115200, 0xd4668dad +0, 3150, 115200, 0x6b20d64b +0, 3240, 115200, 0xf2572aae +0, 3330, 115200, 0xc3554f25 +0, 3420, 115200, 0xeeb5073a +0, 3510, 115200, 0xbd46291f +0, 3600, 115200, 0x0526838d +0, 3690, 115200, 0x85b2e864 +0, 3780, 115200, 0xcfd894bc +0, 3870, 115200, 0x644f10fb +0, 3960, 115200, 0x556e4d88 +0, 4050, 115200, 0x93243614 +0, 4140, 115200, 0x754275c5 +0, 4230, 115200, 0x7f648bf3 +0, 4320, 115200, 0xece18c9b +0, 4410, 115200, 0x385d52c1 +0, 4500, 115200, 0xafc58e4a +0, 4590, 115200, 0x50daf750 +0, 4680, 115200, 0xf6bc67d1 +0, 4770, 115200, 0xb64b6e07 +0, 4860, 115200, 0x8751ed15 +0, 4950, 115200, 0x329ce803 +0, 5040, 115200, 0x40b2cb05 +0, 5130, 115200, 0x60f3517d +0, 5220, 115200, 0xe0d46fdf +0, 5310, 115200, 0x204529fa +0, 5400, 115200, 0xd5afaf22 +0, 5490, 115200, 0xd3cb3d4c +0, 5580, 115200, 0x87973a79 +0, 5670, 115200, 0xe3b2f917 +0, 5760, 115200, 0xf1923238 +0, 5850, 115200, 0x51494d71 +0, 5940, 115200, 0x58bc59bb +0, 6030, 115200, 0xd0273fdb +0, 6120, 115200, 0x6cc79700 +0, 6210, 115200, 0xc8172d31 +0, 6300, 115200, 0x8eb037ef +0, 6390, 115200, 0xc0bc2d76 +0, 6480, 115200, 0x663c467a +0, 6570, 115200, 0xd085e950 +0, 6660, 115200, 0x7d198d72 +0, 6750, 115200, 0x6ebacda0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mjpegb b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mjpegb new file mode 100644 index 00000000..f2d0ec8f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mjpegb @@ -0,0 +1,10 @@ +0, 0, 38400, 0x45311080 +0, 7500, 38400, 0x9474f731 +0, 15000, 38400, 0x429ebb12 +0, 22500, 38400, 0x472c199a +0, 30000, 38400, 0xefd49dae +0, 37500, 38400, 0x78627fa9 +0, 45000, 38400, 0x2a8d9148 +0, 52500, 38400, 0x21cc6738 +0, 60000, 38400, 0x0bc4703f +0, 67500, 38400, 0x1ddcc035 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/motionpixels b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/motionpixels new file mode 100644 index 00000000..e588ed3e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/motionpixels @@ -0,0 +1,112 @@ +0, 0, 230400, 0xee05b509 +0, 6000, 230400, 0x71048964 +0, 12000, 230400, 0x2ebe4ba1 +0, 18000, 230400, 0xeedc45a6 +0, 24000, 230400, 0x218e8656 +0, 30000, 230400, 0x5792b17e +0, 36000, 230400, 0x51b0a062 +0, 42000, 230400, 0x5dc4fd9c +0, 48000, 230400, 0x9b0261b1 +0, 54000, 230400, 0x35086ffc +0, 60000, 230400, 0xcf9352ff +0, 66000, 230400, 0x0b5139a1 +0, 72000, 230400, 0x22e8a31e +0, 78000, 230400, 0x82f61a81 +0, 84000, 230400, 0xc5741ab5 +0, 90000, 230400, 0xb5e7b2ff +0, 96000, 230400, 0x583289ca +0, 102001, 230400, 0xee52afbb +0, 108001, 230400, 0xfdb4dc1a +0, 114001, 230400, 0xf5ce99c0 +0, 120001, 230400, 0xae222255 +0, 126001, 230400, 0xc4f4439d +0, 132001, 230400, 0x1758f224 +0, 138001, 230400, 0x5f517926 +0, 144001, 230400, 0x73a8bed8 +0, 150001, 230400, 0x7ef8410c +0, 156001, 230400, 0xfcb693c7 +0, 162001, 230400, 0x5292832e +0, 168001, 230400, 0x591261d7 +0, 174001, 230400, 0x28cca691 +0, 180001, 230400, 0x22cf40ef +0, 186001, 230400, 0x517b10f9 +0, 192001, 230400, 0x8197e939 +0, 198001, 230400, 0x9654ffdb +0, 204001, 230400, 0x803f10dd +0, 210001, 230400, 0xff9f67af +0, 216001, 230400, 0x4847244c +0, 222001, 230400, 0xff31638f +0, 228001, 230400, 0x9692def5 +0, 234001, 230400, 0x67f0a5fb +0, 240001, 230400, 0xce192074 +0, 246001, 230400, 0x33d6c4a5 +0, 252001, 230400, 0xaf7b5a03 +0, 258001, 230400, 0xd956b0c0 +0, 264001, 230400, 0x58ff1a65 +0, 270001, 230400, 0x044758a1 +0, 276001, 230400, 0xe8045b65 +0, 282001, 230400, 0xf504c5fb +0, 288001, 230400, 0x17a9a2b0 +0, 294001, 230400, 0xf68bab8c +0, 300002, 230400, 0xd06dd0cb +0, 306002, 230400, 0xc47d2673 +0, 312002, 230400, 0x2112f291 +0, 318002, 230400, 0x4c07c83c +0, 324002, 230400, 0x22ca0113 +0, 330002, 230400, 0x25b0c8b1 +0, 336002, 230400, 0xb6afc645 +0, 342002, 230400, 0x663b1c09 +0, 348002, 230400, 0x9006ef1f +0, 354002, 230400, 0x54f81b11 +0, 360002, 230400, 0x456b79f2 +0, 366002, 230400, 0xb08f24d0 +0, 372002, 230400, 0x652ad875 +0, 378002, 230400, 0xc6ecd67f +0, 384002, 230400, 0x78dad721 +0, 390002, 230400, 0x1d2a4f71 +0, 396002, 230400, 0xc71721d1 +0, 402002, 230400, 0x64e3a7df +0, 408002, 230400, 0x3bb18e71 +0, 414002, 230400, 0xb571d58c +0, 420002, 230400, 0xdae6ed5c +0, 426002, 230400, 0xdd91504b +0, 432002, 230400, 0xd5a807a5 +0, 438002, 230400, 0x39a67b03 +0, 444002, 230400, 0xe245c8ac +0, 450002, 230400, 0x5b0d7858 +0, 456002, 230400, 0x501b8097 +0, 462002, 230400, 0xf7b10d48 +0, 468002, 230400, 0x769db0bd +0, 474002, 230400, 0x600f1086 +0, 480002, 230400, 0x874f5565 +0, 486002, 230400, 0x14322f73 +0, 492002, 230400, 0x0eaa36a5 +0, 498002, 230400, 0x97178d13 +0, 504003, 230400, 0xd4c7a0d1 +0, 510003, 230400, 0x1d424ec8 +0, 516003, 230400, 0x695ad8d9 +0, 522003, 230400, 0xe7cc3ecf +0, 528003, 230400, 0xfd25fd8c +0, 534003, 230400, 0xef4bc203 +0, 540003, 230400, 0x2a113bec +0, 546003, 230400, 0x6e7ad403 +0, 552003, 230400, 0xc6714d2b +0, 558003, 230400, 0x77df8ba6 +0, 564003, 230400, 0xcd283106 +0, 570003, 230400, 0xcb95676f +0, 576003, 230400, 0xb0b70393 +0, 582003, 230400, 0x4c40bd63 +0, 588003, 230400, 0x557e8ccf +0, 594003, 230400, 0x9d5934b2 +0, 600003, 230400, 0x43c1793f +0, 606003, 230400, 0x0232361e +0, 612003, 230400, 0x92ed91e4 +0, 618003, 230400, 0x99769789 +0, 624003, 230400, 0xd49c2c5b +0, 630003, 230400, 0x66b03495 +0, 636003, 230400, 0xb88a4658 +0, 642003, 230400, 0x9c21e4c2 +0, 648003, 230400, 0xb343f372 +0, 654003, 230400, 0xf7f1e588 +0, 660003, 230400, 0x9682bdb2 +0, 666003, 230400, 0x538a3db8 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpc7-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpc7-demux new file mode 100644 index 00000000..f7f2f6e7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpc7-demux @@ -0,0 +1 @@ +CRC=0xdeb152dd diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpc8-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpc8-demux new file mode 100644 index 00000000..85b0aa45 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpc8-demux @@ -0,0 +1 @@ +CRC=0x5cdeaf0c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg2-field-enc b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg2-field-enc new file mode 100644 index 00000000..1ea05bd9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg2-field-enc @@ -0,0 +1,39 @@ +0, 0, 622080, 0xb3b66c5c +0, 3600, 622080, 0xb3b66c5c +0, 7200, 622080, 0xb3b66c5c +0, 10800, 622080, 0xb3b66c5c +0, 14400, 622080, 0xb3b66c5c +0, 18000, 622080, 0xb3b66c5c +0, 21600, 622080, 0xb3b66c5c +0, 25200, 622080, 0xb3b66c5c +0, 28800, 622080, 0xb3b66c5c +0, 32400, 622080, 0x088ec02b +0, 36000, 622080, 0x7a36db21 +0, 39600, 622080, 0x541b286f +0, 43200, 622080, 0xb6c3e590 +0, 46800, 622080, 0x39dbed51 +0, 50400, 622080, 0x973dc728 +0, 54000, 622080, 0xd7a4f804 +0, 57600, 622080, 0xa2484762 +0, 61200, 622080, 0x0cd268d1 +0, 64800, 622080, 0x72eb663d +0, 68400, 622080, 0x8fdbac59 +0, 72000, 622080, 0xa6f4feb9 +0, 75600, 622080, 0xadb828c6 +0, 79200, 622080, 0xea630a63 +0, 82800, 622080, 0xa901d925 +0, 86400, 622080, 0xac5e7087 +0, 90000, 622080, 0x10274a2b +0, 93600, 622080, 0x143d541c +0, 97200, 622080, 0xee94c93a +0, 100800, 622080, 0xca030208 +0, 104400, 622080, 0x26f30ead +0, 108000, 622080, 0xfc22f32c +0, 111600, 622080, 0x940a5ff8 +0, 115200, 622080, 0x2164f805 +0, 118800, 622080, 0xa76f5aba +0, 122400, 622080, 0x8c311471 +0, 126000, 622080, 0xa45e1d95 +0, 129600, 622080, 0x6cc61d6c +0, 133200, 622080, 0x6983b417 +0, 136800, 622080, 0x982363c0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-00 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-00 new file mode 100644 index 00000000..84a14c43 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-00 @@ -0,0 +1 @@ +CRC=0x7e67db0b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-01 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-01 new file mode 100644 index 00000000..84a14c43 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-01 @@ -0,0 +1 @@ +CRC=0x7e67db0b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-02 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-02 new file mode 100644 index 00000000..84a14c43 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-02 @@ -0,0 +1 @@ +CRC=0x7e67db0b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-03 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-03 new file mode 100644 index 00000000..84a14c43 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-03 @@ -0,0 +1 @@ +CRC=0x7e67db0b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-04 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-04 new file mode 100644 index 00000000..84a14c43 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-04 @@ -0,0 +1 @@ +CRC=0x7e67db0b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-05 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-05 new file mode 100644 index 00000000..84a14c43 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mpeg4-als-conformance-05 @@ -0,0 +1 @@ +CRC=0x7e67db0b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/msmpeg4v1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/msmpeg4v1 new file mode 100644 index 00000000..d6fea22d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/msmpeg4v1 @@ -0,0 +1,50 @@ +0, 0, 126720, 0x84284323 +0, 3003, 126720, 0x336fe236 +0, 6006, 126720, 0x901f1299 +0, 9009, 126720, 0x3b8be5fe +0, 12012, 126720, 0x6da06397 +0, 15015, 126720, 0xe83de744 +0, 18018, 126720, 0xef2ed2bb +0, 21021, 126720, 0x3ed1797f +0, 24024, 126720, 0xf8c81785 +0, 27027, 126720, 0xf38239e0 +0, 30030, 126720, 0x005a2d6d +0, 33033, 126720, 0xd6be525d +0, 36036, 126720, 0x39482727 +0, 39039, 126720, 0xc8d95bc5 +0, 42042, 126720, 0xbaebd1e7 +0, 45045, 126720, 0xc94d60b3 +0, 48048, 126720, 0x80886d64 +0, 51051, 126720, 0xf99a39ee +0, 54054, 126720, 0xbc8b6c26 +0, 57057, 126720, 0x2270acf1 +0, 60060, 126720, 0x754b5965 +0, 63063, 126720, 0x5312dc30 +0, 66066, 126720, 0x2254cc6e +0, 69069, 126720, 0x58b4bdcc +0, 72072, 126720, 0xd1ed63ee +0, 75075, 126720, 0x4442dec5 +0, 78078, 126720, 0x53403cef +0, 81081, 126720, 0x495d575f +0, 84084, 126720, 0x3ebfc7e8 +0, 87087, 126720, 0x8f0abe01 +0, 90090, 126720, 0x9540ba61 +0, 93093, 126720, 0xb011e3cf +0, 96096, 126720, 0x70b4b1f4 +0, 99099, 126720, 0x803b67f9 +0, 102102, 126720, 0xa1c92662 +0, 105105, 126720, 0x3a3d9e4c +0, 108108, 126720, 0x12660aa2 +0, 111111, 126720, 0xb84c7602 +0, 114114, 126720, 0x920df241 +0, 117117, 126720, 0x5f9db168 +0, 120120, 126720, 0xe3f524a6 +0, 123123, 126720, 0x5f390fa7 +0, 126126, 126720, 0xa9503b4f +0, 129129, 126720, 0x259c08e2 +0, 132132, 126720, 0xef7a0279 +0, 135135, 126720, 0x4d31ed35 +0, 138138, 126720, 0xe10e3c7e +0, 141141, 126720, 0xc35f191e +0, 144144, 126720, 0x3401e9a9 +0, 147147, 126720, 0xd50603f9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/msrle-8bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/msrle-8bit new file mode 100644 index 00000000..b2374cd2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/msrle-8bit @@ -0,0 +1,29 @@ +0, 0, 11520, 0xaf416a66 +0, 15000, 11520, 0x8ab76654 +0, 30000, 11520, 0xd22880c4 +0, 45000, 11520, 0x9d2f612a +0, 60000, 11520, 0xf538600a +0, 75000, 11520, 0x371d64e6 +0, 90000, 11520, 0x49043fbf +0, 105000, 11520, 0x49043fbf +0, 120000, 11520, 0x12d16528 +0, 134999, 11520, 0x1e0a6109 +0, 149999, 11520, 0x9d2f612a +0, 164999, 11520, 0x96e083ca +0, 179999, 11520, 0x8ab76654 +0, 194999, 11520, 0x43ac6de7 +0, 209999, 11520, 0x43ac6de7 +0, 224999, 11520, 0x5c3e6819 +0, 239999, 11520, 0x22758af0 +0, 254999, 11520, 0x88845eba +0, 269999, 11520, 0x4b38848a +0, 284999, 11520, 0x4f7495d3 +0, 299999, 11520, 0x736b702c +0, 314999, 11520, 0x736b702c +0, 329999, 11520, 0x4f7495d3 +0, 344999, 11520, 0x4b38848a +0, 359999, 11520, 0x88845eba +0, 374999, 11520, 0x22758af0 +0, 389998, 11520, 0x5c3e6819 +0, 404998, 11520, 0x43ac6de7 +0, 419998, 11520, 0x43ac6de7 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/msvideo1-16bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/msvideo1-16bit new file mode 100644 index 00000000..b4033119 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/msvideo1-16bit @@ -0,0 +1,30 @@ +0, 0, 65712, 0x917e0076 +0, 6006, 65712, 0xfe76fd1f +0, 12013, 65712, 0xd85820ee +0, 18019, 65712, 0x1b410f6e +0, 24026, 65712, 0x53c50436 +0, 30032, 65712, 0xa191044d +0, 36039, 65712, 0xcf02ff1f +0, 42045, 65712, 0xc2abf85f +0, 48051, 65712, 0xe273087e +0, 54058, 65712, 0x087d0936 +0, 60064, 65712, 0x4e4f2e96 +0, 66071, 65712, 0x91b51896 +0, 72077, 65712, 0x2798450e +0, 78083, 65712, 0x9fea1d06 +0, 84090, 65712, 0xc64a2506 +0, 90096, 65712, 0x0551fe07 +0, 96103, 65712, 0xc64a042e +0, 102109, 65712, 0xf3680dc6 +0, 108116, 65712, 0x2ea5356e +0, 114122, 65712, 0x0315ed3f +0, 120128, 65712, 0xc1d1f917 +0, 126135, 65712, 0xc0f6e607 +0, 132141, 65712, 0x5b0a092e +0, 138148, 65712, 0x1551f16f +0, 144154, 65712, 0x8440ee87 +0, 150161, 65712, 0xf7581ae6 +0, 156167, 65712, 0xee67037e +0, 162173, 65712, 0x4a212ca6 +0, 168180, 65712, 0x693e0aa6 +0, 174186, 65712, 0x13e31116 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/msvideo1-8bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/msvideo1-8bit new file mode 100644 index 00000000..e0c70338 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/msvideo1-8bit @@ -0,0 +1,31 @@ +0, 0, 57600, 0x8c3c5ee8 +0, 3000, 57600, 0xb79800b1 +0, 6000, 57600, 0x54a221be +0, 9000, 57600, 0xb377ffb3 +0, 12000, 57600, 0x46efd210 +0, 15000, 57600, 0x46efd210 +0, 18000, 57600, 0x46efd210 +0, 21000, 57600, 0x92751fbc +0, 24000, 57600, 0xd7287442 +0, 27000, 57600, 0xcf1153ee +0, 30000, 57600, 0xda5de91a +0, 33000, 57600, 0xa11cd513 +0, 36000, 57600, 0xa8edac2a +0, 39000, 57600, 0xefd2a392 +0, 42000, 57600, 0x2d7060cf +0, 45000, 57600, 0xbda3130d +0, 48000, 57600, 0xacb8e940 +0, 50999, 57600, 0x93778985 +0, 53999, 57600, 0x25ed4d97 +0, 56999, 57600, 0x5be924bf +0, 59999, 57600, 0xde5ee1f7 +0, 62999, 57600, 0x39850ab6 +0, 65999, 57600, 0x77da195d +0, 68999, 57600, 0x6dad13c0 +0, 71999, 57600, 0x69897c48 +0, 74999, 57600, 0xfbe74728 +0, 77999, 57600, 0x908af79d +0, 80999, 57600, 0x4ec4a868 +0, 83999, 57600, 0x7db370a1 +0, 86999, 57600, 0x2b1e52f6 +0, 89999, 57600, 0x2141467c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mszh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mszh new file mode 100644 index 00000000..ba6221fc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mszh @@ -0,0 +1 @@ +0, 0, 253440, 0x94af61e5 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mtv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mtv new file mode 100644 index 00000000..d7dfa94a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mtv @@ -0,0 +1,135 @@ +1, 0, 417, 0xae1cc66a +0, 0, 18432, 0xbd7e0ac8 +1, 2351, 418, 0xdc3ec850 +1, 4702, 418, 0x4e8ed05f +0, 5625, 18432, 0xbd7e0ac8 +1, 7053, 418, 0xeb43d574 +1, 9404, 418, 0x9357c91d +0, 11250, 18432, 0x902e0ab4 +1, 11755, 418, 0x5306d16b +1, 14106, 418, 0x46e0d4da +1, 16457, 418, 0xac11ce79 +0, 16875, 18432, 0xf1940b28 +1, 18808, 418, 0xffdfc4ad +1, 21159, 418, 0xf8a8c2ff +0, 22500, 18432, 0x2c180ac8 +1, 23510, 418, 0x2d66d83f +1, 25861, 418, 0x65c0da12 +0, 28125, 18432, 0x2eae0b34 +1, 28212, 418, 0x0eafd20f +1, 30563, 418, 0x8c6dd949 +1, 32914, 418, 0x9094c02d +0, 33750, 18432, 0x2eae0b34 +1, 35265, 418, 0xb47bd944 +1, 37616, 418, 0x935ccce7 +0, 39375, 18432, 0x2eae0b34 +1, 39967, 418, 0x6e3ed020 +1, 42318, 418, 0x8922cd6c +1, 44669, 418, 0xe811c8f8 +0, 45000, 18432, 0x2eae0b34 +1, 47020, 418, 0xb84adc72 +1, 49371, 418, 0xa2bbc5f4 +0, 50625, 18432, 0x2eae0b34 +1, 51722, 418, 0xec0cb67d +1, 54073, 418, 0x89d1d014 +0, 56250, 18432, 0x2eae0b34 +1, 56424, 418, 0xfb5bc872 +1, 58776, 417, 0x8bfcc7a0 +1, 61127, 418, 0xeb4ac61b +0, 61875, 18432, 0x2eae0b34 +1, 63478, 418, 0xd3cbc3c4 +1, 65829, 418, 0xa272d092 +0, 67500, 18432, 0x2eae0b34 +1, 68180, 418, 0x611ec37e +1, 70531, 418, 0x70a3d423 +1, 72882, 418, 0xeff9ccf4 +0, 73125, 18432, 0x2eae0b34 +1, 75233, 418, 0x9788c65b +1, 77584, 418, 0xe9a8cb8c +0, 78750, 18432, 0x2eae0b34 +1, 79935, 418, 0x5834c300 +1, 82286, 418, 0xa4b8cd3a +0, 84375, 18432, 0x2eae0b34 +1, 84637, 418, 0x6de2c7f9 +1, 86988, 418, 0x961bbbf3 +1, 89339, 418, 0x53edc13a +0, 90000, 18432, 0x2c180ac8 +1, 91690, 418, 0x2fedc4b0 +1, 94041, 418, 0xb756c18b +0, 95625, 18432, 0x2eae0b34 +1, 96392, 418, 0xaf0ed0e4 +1, 98743, 418, 0x019fd3f0 +1, 101094, 418, 0x6e29d83e +0, 101250, 18432, 0x2c180ac8 +1, 103445, 418, 0x2ddad6bb +1, 105796, 418, 0xafefca99 +0, 106875, 18432, 0x2eae0b34 +1, 108147, 418, 0x366ed013 +1, 110498, 418, 0x532ac7e0 +0, 112500, 18432, 0x2c180ac8 +1, 112849, 418, 0x1d0cd1ce +1, 115200, 417, 0x572ad1e3 +1, 117551, 418, 0x858cd91f +0, 118125, 18432, 0x2eae0b34 +1, 119902, 418, 0x82cacdfd +1, 122253, 418, 0xf4dcc6ed +0, 123750, 18432, 0x2c180ac8 +1, 124604, 418, 0x2cf3ca72 +1, 126955, 418, 0x5963c859 +1, 129306, 418, 0xa667c53d +0, 129375, 18432, 0x2eae0b34 +1, 131657, 418, 0xb2f1d09c +1, 134008, 418, 0x2ec1c8d3 +0, 135000, 18432, 0x2eae0b34 +1, 136359, 418, 0x5754d2e8 +1, 138710, 418, 0x1956bdba +0, 140625, 18432, 0x2eae0b34 +1, 141061, 418, 0x3e18bd55 +1, 143412, 418, 0xe4cfc339 +1, 145763, 418, 0xb426c835 +0, 146250, 18432, 0x2eae0b34 +1, 148114, 418, 0xd7b6cbcf +1, 150465, 418, 0x340ec315 +0, 151875, 18432, 0x2eae0b34 +1, 152816, 418, 0x23a9baec +1, 155167, 418, 0x9f04cd01 +0, 157500, 18432, 0x2eae0b34 +1, 157518, 418, 0xa80ec223 +1, 159869, 418, 0x23d6bd5d +1, 162220, 418, 0xcb25cf5b +0, 163125, 18432, 0x2eae0b34 +1, 164571, 418, 0xccccc217 +1, 166922, 418, 0x757abbfe +0, 168750, 18432, 0x2eae0b34 +1, 169273, 418, 0xa2e6cc68 +1, 171624, 418, 0xdf77cc05 +1, 173976, 417, 0xe9d2c5d5 +0, 174375, 18432, 0x2eae0b34 +1, 176327, 418, 0x50dec174 +1, 178678, 418, 0xf654b27e +0, 180000, 18432, 0x2c180ac8 +1, 181029, 418, 0x4d8bc26e +1, 183380, 418, 0xccd2bf37 +0, 185625, 18432, 0x2eae0b34 +1, 185731, 418, 0x6ce2c18a +1, 188082, 418, 0xb3cdcf0c +1, 190433, 418, 0x55eebe9a +0, 191250, 18432, 0x2c180ac8 +1, 192784, 418, 0x9031c9ec +1, 195135, 418, 0xb037c49d +0, 196875, 18432, 0x2eae0b34 +1, 197486, 418, 0x377bcc78 +1, 199837, 418, 0x3762c725 +1, 202188, 418, 0x39afbd4d +0, 202500, 18432, 0x2c180ac8 +1, 204539, 418, 0x655ed6cd +1, 206890, 418, 0x09aec202 +0, 208125, 18432, 0x2eae0b34 +1, 209241, 418, 0xf2d2ce55 +1, 211592, 418, 0x254ebf04 +0, 213750, 18432, 0x2c180ac8 +1, 213943, 418, 0xa105cdcc +1, 216294, 418, 0x1477ba58 +1, 218645, 418, 0x8d0dcdb2 +1, 220996, 418, 0x0d7cbef4 +1, 223347, 294, 0x5e2b87c4 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mxf-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mxf-demux new file mode 100644 index 00000000..87747531 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/mxf-demux @@ -0,0 +1,97 @@ +0, 0, 8468, 0xc0855553 +1, 0, 32000, 0x479155e6 +0, 3600, 3814, 0xa10783b4 +0, 7200, 3747, 0xb7bf6973 +0, 10800, 3705, 0x5462a600 +0, 14400, 3704, 0x1e564943 +0, 18000, 3760, 0x10464b9a +0, 21600, 3799, 0xd41d6dcf +0, 25200, 3832, 0x5cf6999e +0, 28800, 3778, 0xe5fc7b9e +0, 32400, 38193, 0xd34e5dd4 +0, 36000, 8520, 0x2a203e68 +0, 39600, 3832, 0xe4c4b2fe +0, 43200, 3787, 0x0cf95fee +0, 46800, 3766, 0x9e019d14 +0, 50400, 3785, 0x0ea9ae75 +0, 54000, 3703, 0x11d349ff +0, 57600, 3731, 0x5cf358ef +0, 61200, 3785, 0x01c8962f +0, 64800, 3741, 0xb2c47d53 +0, 68400, 38150, 0x08fa1f55 +0, 72000, 8487, 0x0c234b9a +0, 75600, 3791, 0x831192ef +0, 79200, 3612, 0x598944fb +0, 82800, 3710, 0xccbb711a +0, 86400, 3864, 0x4385966e +0, 90000, 3919, 0x24e2abc3 +0, 93600, 3777, 0x210c6219 +0, 97200, 3811, 0x23bf68c2 +0, 100800, 3802, 0x52688862 +0, 104400, 38027, 0x3d5aa8b9 +0, 108000, 8333, 0x617de950 +0, 111600, 3831, 0x13fad8fc +0, 115200, 3719, 0xbc317470 +0, 118800, 3761, 0xeac460b6 +0, 122400, 3637, 0x27d64b32 +0, 126000, 3666, 0xf0f700a5 +0, 129600, 3788, 0x1c4662a8 +0, 133200, 3960, 0xef6b9e99 +0, 136800, 3793, 0x3a6ca832 +0, 140400, 38312, 0xce1317cc +0, 144000, 8548, 0x4ca944d4 +0, 147600, 3866, 0x4e85bf0f +0, 151200, 3644, 0x030338e5 +0, 154800, 3634, 0xa95f4512 +0, 158400, 3925, 0x7583ba86 +0, 162000, 3675, 0x979f423f +0, 165600, 3703, 0x11375f7a +0, 169200, 3705, 0xb7de5d16 +0, 172800, 3688, 0x1db45852 +0, 176400, 38412, 0x2ee26a63 +0, 180000, 8385, 0x0bc20a27 +1, 180000, 32000, 0x8f7e5009 +0, 183600, 3733, 0xa3e2a9a0 +0, 187200, 3773, 0x27769caa +0, 190800, 3670, 0xc8335e98 +0, 194400, 3596, 0xd6512fb0 +0, 198000, 3579, 0xa621fbc2 +0, 201600, 3641, 0x2f4f46ca +0, 205200, 3686, 0x0a92385a +0, 208800, 3672, 0xe65137b9 +0, 212400, 39065, 0xc723bf8b +0, 216000, 8611, 0x5d177f40 +0, 219600, 3758, 0x33d59966 +0, 223200, 3674, 0x54f37902 +0, 226800, 3615, 0xa0f045fa +0, 230400, 3719, 0x41cf93ff +0, 234000, 3757, 0x3a1b7e8f +0, 237600, 3762, 0xe7f9714d +0, 241200, 3738, 0x8121805b +0, 244800, 3733, 0x13e262db +0, 248400, 38433, 0x3d58c500 +0, 252000, 8410, 0xa4f7fd2e +0, 255600, 3711, 0x0e112d3c +0, 259200, 3692, 0xb46574b2 +0, 262800, 3563, 0xad43343d +0, 266400, 3613, 0x5cd85c4f +0, 270000, 3653, 0xe15a2853 +0, 273600, 3684, 0x9ddd58cb +0, 277200, 3256, 0xd7f89f2e +0, 280800, 3698, 0x2b82624a +0, 284400, 39520, 0xd3f2b7c5 +0, 288000, 8493, 0x163559be +0, 291600, 3719, 0x6fa0916f +0, 295200, 3655, 0xa9233de1 +0, 298800, 3684, 0xa6125737 +0, 302400, 3688, 0xa9da6686 +0, 306000, 3685, 0x674d634e +0, 309600, 3677, 0x7a85535d +0, 313200, 3666, 0xce3600a2 +0, 316800, 3837, 0x3a7090e1 +0, 320400, 38696, 0x12c59cd2 +0, 324000, 8022, 0xd343433f +0, 327600, 5157, 0x440c14e5 +0, 331200, 5003, 0xf8e1daff +0, 334800, 4954, 0x89866344 +0, 338400, 53664, 0xeb0c4c42 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/nc-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/nc-demux new file mode 100644 index 00000000..adc03f0c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/nc-demux @@ -0,0 +1,91 @@ +0, 0, 19787, 0x75e463f3 +0, 900, 11913, 0x0f429c34 +0, 1800, 14225, 0xbd3c704c +0, 2700, 10357, 0xbf232393 +0, 3600, 9595, 0xf565d39e +0, 4500, 9262, 0x2afd6ce0 +0, 5400, 12214, 0x6ae81d9b +0, 6300, 13920, 0x31b5b307 +0, 7200, 10164, 0x141eca4e +0, 8100, 9516, 0xd5f2c42b +0, 9000, 10006, 0x80850a76 +0, 9900, 11791, 0x10bc2dcd +0, 10800, 13756, 0xda1fee08 +0, 11700, 10452, 0xbb3d62b0 +0, 12600, 9171, 0x64ae10f6 +0, 13500, 8816, 0x31ad8fcb +0, 14400, 13168, 0xea1085ac +0, 15300, 12797, 0x25143d22 +0, 16200, 11324, 0x3a54b38e +0, 17100, 9173, 0x8b2bf552 +0, 18000, 9247, 0x2e87226b +0, 18900, 14140, 0x1063786c +0, 19800, 14437, 0xde123a17 +0, 20700, 11938, 0x3f1168f4 +0, 21600, 11966, 0xdd6786ec +0, 22500, 13213, 0x8ab27c58 +0, 23400, 11843, 0x90415d8b +0, 24300, 13345, 0x3c0e1793 +0, 25200, 9977, 0x74fc7f4b +0, 26100, 9158, 0x0b5426a5 +0, 27000, 12715, 0x0035d569 +0, 27900, 19944, 0xe2887ba8 +0, 28800, 12762, 0xb0f17939 +0, 29700, 10260, 0x182b27aa +0, 30600, 7405, 0x227fe9bf +0, 31500, 13317, 0x1a678c62 +0, 32400, 11304, 0x3277af6d +0, 33300, 13291, 0xe267616a +0, 34200, 8975, 0xe7eeacea +0, 35100, 8473, 0x8bb1cbff +0, 36000, 13878, 0xfd3d55bb +0, 36900, 11278, 0x61c7c55e +0, 37800, 13785, 0x2acbf88f +0, 38700, 9521, 0x99e2d065 +0, 39600, 9340, 0xe5c96510 +0, 40500, 12777, 0x4c3c7844 +0, 41400, 10685, 0x39e0f42e +0, 42300, 14237, 0x9398d07f +0, 43200, 9021, 0x3343c7ec +0, 44100, 9327, 0xad489e86 +0, 45000, 13507, 0xb1344f1c +0, 45900, 10199, 0x9a8868bf +0, 46800, 14535, 0xddb13f41 +0, 47700, 8773, 0x3d8b6a79 +0, 48600, 16084, 0x5d915de4 +0, 49500, 9156, 0x5cb08a6a +0, 50400, 15027, 0xc23b1dc8 +0, 51300, 8240, 0xd6d3526c +0, 52200, 8720, 0x439c43bf +0, 53100, 13684, 0x18fc82f0 +0, 54000, 8829, 0xa3ebeb30 +0, 54900, 14650, 0x99e8678c +0, 55800, 19626, 0x80a7ee5c +0, 56700, 7762, 0x7c209a12 +0, 57600, 13636, 0xc89c1aa3 +0, 58500, 8337, 0x749bf76a +0, 59400, 15098, 0xc98bc6dc +0, 60300, 9070, 0xcd4cf7f1 +0, 61200, 8269, 0x90e95d54 +0, 62100, 12672, 0x034888d0 +0, 63000, 7519, 0x6c089672 +0, 63900, 14439, 0x5d2478b9 +0, 64800, 6928, 0x98fbaa67 +0, 65700, 8735, 0x07643f1e +0, 66600, 13522, 0x55034cdb +0, 67500, 7807, 0xf5983103 +0, 68400, 14484, 0xfc9cf260 +0, 69300, 7193, 0x170a0fa1 +0, 70200, 9444, 0x6f9be36f +0, 71100, 12598, 0x69b7609d +0, 72000, 7650, 0x1abaec9e +0, 72900, 15162, 0x2a87f723 +0, 73800, 7752, 0xcca248aa +0, 74700, 9085, 0x1ca7d7e5 +0, 75600, 13187, 0xababcc64 +0, 76500, 7968, 0x64a28f46 +0, 77400, 15474, 0xf34c587c +0, 78300, 8615, 0x61301034 +0, 79200, 14129, 0x42c88bea +0, 80100, 7223, 0x675d7500 +0, 81000, 3072, 0x4cb6254c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/nsv-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/nsv-demux new file mode 100644 index 00000000..620dfa04 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/nsv-demux @@ -0,0 +1,171 @@ +0, 0, 12, 0x1396035f +0, 6006, 24, 0x8ab80ac7 +0, 12012, 208, 0x1de1603e +1, 12522, 104, 0x8ae85dc9 +1, 17224, 105, 0xb7033847 +0, 18018, 364, 0xffb4b341 +1, 21926, 104, 0x5f853482 +0, 24024, 456, 0x7a4deaeb +1, 26628, 105, 0xfcb731fd +0, 30030, 432, 0xf4ddd813 +1, 31330, 104, 0x4f8232bb +1, 36032, 105, 0x2f543039 +0, 36036, 572, 0xc84c21ff +1, 40734, 104, 0xe4cc34a1 +0, 42042, 500, 0x0e6bf9f4 +1, 45436, 105, 0xea663711 +0, 48048, 508, 0x2d6efe2a +1, 50138, 104, 0x3c583098 +0, 54054, 436, 0x7d07d3c5 +1, 54840, 105, 0xbe6c33ff +1, 59542, 104, 0x56de2d7a +0, 60060, 620, 0xa9313342 +1, 64244, 105, 0x4e80385d +0, 66066, 1384, 0x9b97c579 +1, 68946, 104, 0x34eb340d +0, 72072, 760, 0xd1aa8183 +1, 73648, 105, 0x87e82f74 +0, 78078, 836, 0x261da980 +1, 78350, 104, 0xa546377d +1, 83052, 105, 0x92bd349d +0, 84084, 860, 0x52f0afa0 +1, 87754, 104, 0xdba53f3d +0, 90090, 696, 0x63845855 +1, 92456, 105, 0xd3c3384e +0, 96096, 460, 0x2916e7be +1, 97158, 104, 0xdf7d30ce +1, 101860, 105, 0xae20344e +0, 102102, 328, 0xab8caaca +1, 106562, 104, 0xe4cc33b7 +0, 108108, 396, 0xc775bc8e +1, 111264, 105, 0xda993806 +0, 114114, 344, 0x114ea25a +1, 115966, 104, 0xd6d12edd +1, 120668, 105, 0x6b9c2ed5 +1, 125370, 104, 0xce6c3b04 +0, 126126, 532, 0xd5650f54 +1, 130072, 105, 0x31db399e +1, 134775, 104, 0xd50b347a +0, 138138, 476, 0x77f1f3a7 +1, 139477, 105, 0xe87734d6 +1, 144179, 104, 0x21873412 +0, 150150, 976, 0x2f7cf7ae +1, 150420, 105, 0x29c03514 +1, 155122, 104, 0x91a5347a +1, 159824, 105, 0xdbbf3696 +0, 162162, 104, 0x8fbf2f65 +1, 164526, 104, 0x3b463afc +1, 169228, 105, 0xddf53845 +1, 173930, 104, 0x94c23d1a +0, 174174, 652, 0xa9244ac0 +1, 178632, 105, 0xc0fd36c4 +1, 183334, 104, 0x36d535e0 +0, 186186, 152, 0x97804cc1 +1, 188036, 105, 0xe81a35da +1, 192738, 104, 0x2b4e3699 +1, 197440, 105, 0x3978392c +0, 198198, 156, 0xca434d31 +1, 202142, 104, 0xca903459 +0, 204204, 196, 0x1ff16161 +1, 206844, 105, 0xedc4374a +0, 210210, 176, 0x9b455230 +1, 211546, 104, 0x0b3938d2 +0, 216216, 156, 0xbbbf4bf3 +1, 216249, 105, 0xb2653246 +1, 220951, 104, 0x76333479 +0, 222222, 220, 0x77a97152 +1, 225653, 105, 0x779138c4 +0, 228228, 204, 0x667d5ecf +1, 230355, 104, 0xfe142f55 +0, 234234, 232, 0x3a266ccd +1, 235057, 105, 0x39aa3410 +1, 239759, 104, 0x520f330d +0, 240240, 308, 0x844a95b7 +1, 244461, 104, 0x1aad37b0 +0, 246246, 384, 0x71d2c695 +1, 249163, 105, 0x164038eb +1, 253865, 104, 0x21d434bd +0, 258258, 520, 0x4f9d012a +1, 258567, 105, 0x9c1236d4 +1, 263269, 104, 0x6aa933c3 +1, 267971, 105, 0xec5c371e +0, 270270, 648, 0xabd13b29 +1, 272673, 104, 0xedb33251 +1, 277375, 105, 0x4f953476 +1, 282077, 104, 0x7da13400 +0, 282282, 604, 0x006b328f +1, 286779, 105, 0x57a83aaa +1, 291481, 104, 0x8b822f2f +0, 294294, 492, 0xa150fac1 +1, 296183, 105, 0x3b31341a +1, 300885, 104, 0x74a4316d +1, 305587, 105, 0x05013469 +0, 306306, 456, 0xd3e9e52c +1, 310289, 104, 0xcc8932cb +1, 314991, 105, 0xd9233422 +0, 318318, 340, 0x7229a1b7 +1, 319693, 104, 0x5c603350 +1, 324395, 105, 0x76e631bc +1, 329097, 104, 0x657e3b35 +0, 330330, 280, 0x48948b60 +1, 333799, 105, 0x9d283226 +1, 338502, 104, 0x574936ef +0, 342342, 304, 0x3ae68dcf +1, 343204, 105, 0x1b923555 +1, 347906, 104, 0x2a9f3583 +1, 352608, 105, 0xb8cd306f +0, 354354, 324, 0x005da2ab +1, 357310, 104, 0xa21d3475 +1, 362012, 105, 0x651539ea +0, 366366, 348, 0x3230a873 +1, 366714, 104, 0x7b7235b8 +1, 371416, 105, 0x2bbb337a +1, 376118, 104, 0x26c332eb +0, 378378, 336, 0x8655ad2d +1, 380820, 105, 0x990838d8 +1, 385522, 104, 0x4dc63ad4 +1, 390224, 105, 0xfb8e3418 +0, 390390, 380, 0x742ebc44 +1, 394926, 104, 0x1882388e +1, 399628, 105, 0xe6b534cc +0, 402402, 340, 0xfc1aa74e +1, 404330, 104, 0x60fe35d0 +1, 409032, 105, 0x5164354a +1, 413734, 104, 0x92ee3115 +0, 414414, 332, 0x3cfba56c +1, 418436, 105, 0x9b32327e +1, 423138, 104, 0x9b9e394a +0, 426426, 332, 0xc024ad4c +1, 427840, 105, 0xce3c337f +1, 432542, 104, 0x7a4e33c5 +0, 438438, 3432, 0xcdfcd1c9 +1, 440868, 105, 0x0e3d34eb +1, 445570, 104, 0xd23e338e +1, 450272, 105, 0x4abf340c +0, 450450, 792, 0xe7df949f +1, 454974, 104, 0xe7522e15 +1, 459676, 105, 0x995037ba +0, 462462, 912, 0xbc61d549 +1, 464378, 104, 0x5ef12e9b +1, 469080, 105, 0x5c3b3166 +1, 473782, 104, 0xfc38314b +0, 474474, 956, 0x809bdff0 +1, 478484, 104, 0x5e3636e4 +1, 483186, 105, 0xae7b3345 +0, 486486, 652, 0x88d3484f +1, 487888, 104, 0x635c317a +1, 492590, 105, 0xa90c361a +1, 497292, 104, 0x8f563594 +0, 498498, 1284, 0xecc37164 +1, 501468, 105, 0x028e3985 +1, 506170, 104, 0x4fd135f6 +0, 510510, 428, 0x4794e174 +1, 510872, 105, 0xaaf539ac +1, 515574, 104, 0x668b3265 +1, 520276, 105, 0x74ad3b4b +0, 522522, 460, 0x7253d94a +1, 524978, 104, 0xbde5332f +1, 529680, 105, 0xdc3631e7 +1, 534382, 104, 0x3e363a1e +0, 534534, 24, 0x664206ba +1, 539084, 105, 0x48b63926 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/nuv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/nuv new file mode 100644 index 00000000..204a4112 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/nuv @@ -0,0 +1,30 @@ +1, 0, 4096, 0x00000000 +0, 0, 460800, 0x54aedafe +1, 2090, 4096, 0x4dfae7a6 +0, 3003, 460800, 0x54aedafe +1, 4180, 4096, 0x3fd9f5c6 +0, 6006, 460800, 0x54aedafe +1, 6269, 4096, 0x7b86e310 +1, 8359, 4096, 0x611cece5 +0, 9009, 460800, 0x54aedafe +1, 10449, 4096, 0xb7d8e872 +0, 12012, 460800, 0xb7aa8b56 +1, 12539, 4096, 0x072ef72b +1, 14629, 4096, 0xb3560144 +0, 15015, 460800, 0x283ea3b5 +1, 16718, 4096, 0x0a3d119e +0, 18018, 460800, 0x283ea3b5 +1, 18808, 4096, 0xbe391aa4 +1, 20898, 4096, 0x28f7c6e5 +0, 21021, 460800, 0x10e577de +1, 22988, 4096, 0xca9d9df2 +0, 24024, 460800, 0x4e091ee2 +1, 25078, 4096, 0x5c6b95a9 +0, 27027, 460800, 0x2ea88828 +1, 27167, 4096, 0x0bdfc0bf +1, 29257, 4096, 0xd95a9277 +0, 30030, 460800, 0x4b7f4df0 +1, 31347, 4096, 0xae2bef2c +0, 33033, 460800, 0xb30eb322 +1, 33437, 4096, 0xbf031e83 +1, 35527, 4096, 0x4c83e2d1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/oma-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/oma-demux new file mode 100644 index 00000000..39fcf5a9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/oma-demux @@ -0,0 +1 @@ +CRC=0xdd181a1c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/pcm_dvd b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/pcm_dvd new file mode 100644 index 00000000..475fce41 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/pcm_dvd @@ -0,0 +1,123 @@ +0, 0, 1336, 0x8e3c0abc +0, 626, 1336, 0x99c41108 +0, 1253, 1336, 0xd65be322 +0, 1879, 1336, 0x15b575fb +0, 2505, 1336, 0x366f742a +0, 3131, 1336, 0xed72ad83 +0, 3758, 1336, 0x73f21c93 +0, 4384, 1336, 0x4be7a770 +0, 5010, 1336, 0x69ecf80c +0, 5636, 1336, 0x835dc0e5 +0, 6263, 1336, 0x3089458d +0, 6889, 1336, 0xc73b8cdc +0, 7515, 1336, 0xc1cdaa8f +0, 8141, 1336, 0x47a49186 +0, 8768, 1336, 0x2db387e2 +0, 9394, 1336, 0x90da9a97 +0, 10020, 1336, 0xcd34a467 +0, 10646, 1336, 0xdca8bd29 +0, 11273, 1336, 0xa09f9da3 +0, 11899, 1336, 0x47c8acf6 +0, 12525, 1336, 0x94dfa20e +0, 13151, 1336, 0x2123a5f6 +0, 13778, 1336, 0x2f1badde +0, 14404, 1336, 0x47579528 +0, 15030, 1336, 0x028daa10 +0, 15656, 1336, 0x5ed7adcd +0, 16283, 1336, 0xc5ee8f10 +0, 16909, 1336, 0xcfacb489 +0, 17535, 1336, 0x07de937b +0, 18161, 1336, 0x07bd8f8b +0, 18788, 1336, 0x4660912e +0, 19414, 1336, 0x047f97ad +0, 20040, 1336, 0xe0e8a11f +0, 20666, 1336, 0xcd9898e6 +0, 21293, 1336, 0xccfda786 +0, 21919, 1336, 0xab1b9e40 +0, 22545, 1336, 0x2ea79ea1 +0, 23171, 1336, 0xade2ad7e +0, 23798, 1336, 0xe5cf9684 +0, 24424, 1336, 0xb57184cf +0, 25050, 1336, 0x0668a5ce +0, 25676, 1336, 0x643a9d96 +0, 26303, 1336, 0x97dc8ecc +0, 26929, 1336, 0x72c2b174 +0, 27555, 1336, 0xe39d8fc3 +0, 28181, 1336, 0x56fc76d2 +0, 28808, 1336, 0x91a884b3 +0, 29434, 1336, 0x7b039a4e +0, 30060, 1336, 0x3770a9dd +0, 30686, 1336, 0x317c9cb8 +0, 31313, 1336, 0xdd97ad48 +0, 31939, 1336, 0x98066c1b +0, 32565, 1336, 0xecd3a31c +0, 33191, 1336, 0x0578b329 +0, 33818, 1336, 0x6942881c +0, 34444, 1336, 0x56b5af29 +0, 35070, 1336, 0xf111a48a +0, 35696, 1336, 0x1f5a8d45 +0, 36323, 1336, 0x39abdded +0, 36949, 1336, 0xdb997fe8 +0, 37575, 1336, 0xd7f0d0b2 +0, 38201, 1336, 0xf3219413 +0, 38828, 1336, 0x9d80899d +0, 39454, 1336, 0x7238bd63 +0, 40080, 1336, 0x7376703e +0, 40706, 1336, 0x0fd56d02 +0, 41333, 1336, 0xa6c0951e +0, 41959, 1336, 0xfacb674e +0, 42585, 1336, 0x805bd289 +0, 43211, 1336, 0xa2a51a12 +0, 43838, 1336, 0x8a75d91b +0, 44464, 1336, 0x34b1ef80 +0, 45090, 1336, 0x902921e0 +0, 45716, 1336, 0xc2db7895 +0, 46343, 1336, 0x7a0db9e1 +0, 46969, 1336, 0x66a93277 +0, 47595, 1336, 0x30830a83 +0, 48221, 1336, 0x251cf132 +0, 48848, 1336, 0x08dd852c +0, 49474, 1336, 0x22ea164c +0, 50100, 1336, 0x3bdd91c4 +0, 50726, 1336, 0xa4c0fbd7 +0, 51353, 1336, 0x83aa81bd +0, 51979, 1336, 0x8a7b0fdb +0, 52605, 1336, 0x35c37b01 +0, 53231, 1336, 0xdede811e +0, 53858, 1336, 0x7473a657 +0, 54484, 1336, 0x5b917e2b +0, 55110, 1336, 0x1c5a7cfc +0, 55736, 1336, 0xeb7bab0d +0, 56363, 1336, 0x7337795c +0, 56989, 1336, 0x68da9d08 +0, 57615, 1336, 0xe93b87fe +0, 58241, 1336, 0xd4639f00 +0, 58868, 1336, 0x1070a91d +0, 59494, 1336, 0x50e3788f +0, 60120, 1336, 0x1dac6691 +0, 60746, 1336, 0xf62c709d +0, 61373, 1336, 0x2369648d +0, 61999, 1336, 0xbfc792e6 +0, 62625, 1336, 0x975eb8e3 +0, 63251, 1336, 0x35c49ba6 +0, 63878, 1336, 0xe6198aa9 +0, 64504, 1336, 0x99f37d9d +0, 65130, 1336, 0x4815aff1 +0, 65756, 1336, 0x4fd366ca +0, 66383, 1336, 0x43cf7bb4 +0, 67009, 1336, 0x14a576ac +0, 67635, 1336, 0xc6986978 +0, 68261, 1336, 0x10f67dc4 +0, 68888, 1336, 0xcca07f7a +0, 69514, 1336, 0x6d0a5dfe +0, 70140, 1336, 0x4e0761ef +0, 70766, 1336, 0x31368e66 +0, 71393, 1336, 0x14b895c1 +0, 72019, 1336, 0x4bb7c111 +0, 72645, 1336, 0x1676a8bb +0, 73271, 1336, 0xddaaa459 +0, 73898, 1336, 0xc43eabce +0, 74524, 1336, 0x4d9f8d54 +0, 75150, 1336, 0x0ac292cb +0, 75776, 1336, 0x2d9c74e4 +0, 76403, 1336, 0xe73da38f diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/pictor b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/pictor new file mode 100644 index 00000000..3fa0f31f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/pictor @@ -0,0 +1 @@ +0, 0, 192816, 0xf97e2ba1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/psx-str b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/psx-str new file mode 100644 index 00000000..c0b99085 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/psx-str @@ -0,0 +1,200 @@ +1, 0, 8064, 0x02260037 +0, 0, 115200, 0x6b106a56 +1, 4800, 8064, 0x4ee9f4e9 +0, 6000, 115200, 0x53c16930 +1, 9600, 8064, 0xf8fd82aa +0, 12000, 115200, 0xe2126f03 +1, 14400, 8064, 0xc100792b +0, 18000, 115200, 0xc3c18ba0 +1, 19200, 8064, 0xf11a5316 +1, 24000, 8064, 0x6937f8c0 +0, 24000, 115200, 0xe281b655 +1, 28800, 8064, 0xed194e42 +0, 30000, 115200, 0x7b1e0536 +1, 33600, 8064, 0x619ce54b +0, 36000, 115200, 0xbbd868c5 +1, 38400, 8064, 0x544999ec +0, 42000, 115200, 0xfc67bf8e +1, 43200, 8064, 0x0ea877b4 +1, 48000, 8064, 0xb764d1c0 +0, 48000, 115200, 0xb463151c +1, 52800, 8064, 0x7a2fd211 +0, 54000, 115200, 0x6e686846 +1, 57600, 8064, 0xff69f6c5 +0, 60000, 115200, 0xca36b835 +1, 62400, 8064, 0x26c11ec7 +0, 66000, 115200, 0x17b91efc +1, 67200, 8064, 0xfb4ecc0c +1, 72000, 8064, 0x111d799b +0, 72000, 115200, 0xc051a49a +1, 76800, 8064, 0xc704dc91 +0, 78000, 115200, 0xc68c227b +1, 81600, 8064, 0xa9f372fb +0, 84000, 115200, 0x9ba6b521 +1, 86400, 8064, 0xa3f0ad0f +0, 90000, 115200, 0x09d56ecc +1, 91200, 8064, 0x958719b9 +1, 96000, 8064, 0x9b011bf7 +0, 96000, 115200, 0xc20e3485 +1, 100800, 8064, 0x466d96fb +0, 102000, 115200, 0xf07e2c48 +1, 105600, 8064, 0x6ed4eb29 +0, 108000, 115200, 0x551c6da1 +1, 110400, 8064, 0x066966db +0, 114000, 115200, 0xed65bacd +1, 115200, 8064, 0xf60fe0bc +1, 120000, 8064, 0x2c845167 +0, 120000, 115200, 0x51a23a3b +1, 124800, 8064, 0x7d63894f +0, 126000, 115200, 0x559ddce1 +1, 129600, 8064, 0x0682ee36 +0, 132000, 115200, 0x1fef6373 +1, 134400, 8064, 0xcaeb7c70 +0, 138000, 115200, 0x11b2dece +1, 139200, 8064, 0x93948697 +1, 144000, 8064, 0x5805f0d6 +0, 144000, 115200, 0x851b877c +1, 148800, 8064, 0xcfb641ff +0, 150000, 115200, 0x5f9a7c99 +1, 153600, 8064, 0xe3499bb1 +0, 156000, 115200, 0x9ffe6153 +1, 158400, 8064, 0x689fe483 +0, 162000, 115200, 0x950b0de8 +1, 163200, 8064, 0x1b8f2f2d +1, 168000, 8064, 0x23852e71 +0, 168000, 115200, 0x6ec4c89a +1, 172800, 8064, 0x15e7b298 +0, 174000, 115200, 0xa9234812 +1, 177600, 8064, 0x5345a9a3 +0, 180000, 115200, 0xc834f491 +1, 182400, 8064, 0x257b6ecf +0, 186000, 115200, 0x2cc1a2aa +1, 187200, 8064, 0xaf62836c +1, 192000, 8064, 0xc3a401e3 +0, 192000, 115200, 0x5df53b71 +1, 196800, 8064, 0x2b98fdf1 +0, 198000, 115200, 0xe1d0cb31 +1, 201600, 8064, 0x37168697 +0, 204000, 115200, 0xa0d2f8ab +1, 206400, 8064, 0x2d876c89 +0, 210000, 115200, 0x9342d739 +1, 211200, 8064, 0xc40a6ada +1, 216000, 8064, 0xcca6b829 +0, 216000, 115200, 0x586bc658 +1, 220800, 8064, 0x6667550a +0, 222000, 115200, 0x76902834 +1, 225600, 8064, 0x99c1b5cb +0, 228000, 115200, 0x91f25616 +1, 230400, 8064, 0xc05d3ed3 +0, 234000, 115200, 0xce8c95fb +1, 235200, 8064, 0xdd641781 +1, 240000, 8064, 0xa65d49dc +0, 240000, 115200, 0xdf0d3de6 +1, 244800, 8064, 0x2a0d5df7 +0, 246000, 115200, 0x120db7ae +1, 249600, 8064, 0xa6348438 +0, 252000, 115200, 0x2143e287 +1, 254400, 8064, 0xf2e1412d +0, 258000, 115200, 0x2498d3b6 +1, 259200, 8064, 0xc41c6a7a +1, 264000, 8064, 0x147edc3d +0, 264000, 115200, 0x99975ff8 +1, 268800, 8064, 0x17e3cfe7 +0, 270000, 115200, 0xbad65f9f +1, 273600, 8064, 0x01fe3969 +0, 276000, 115200, 0x5066605b +1, 278400, 8064, 0xc437ac11 +0, 282000, 115200, 0x6f8a61a0 +1, 283200, 8064, 0xbbf747c1 +1, 288000, 8064, 0x2a4b88c0 +0, 288000, 115200, 0x80c96143 +1, 292800, 8064, 0xcd149c80 +0, 294000, 115200, 0x663c6198 +1, 297600, 8064, 0xcf339dfc +0, 300000, 115200, 0x0354620b +1, 302400, 8064, 0xc81ff84b +0, 306000, 115200, 0xfe186346 +1, 307200, 8064, 0x4d978100 +1, 312000, 8064, 0x6da6665b +0, 312000, 115200, 0x844962f8 +1, 316800, 8064, 0x12fa354f +0, 318000, 115200, 0x917c672f +1, 321600, 8064, 0x6baedae6 +0, 324000, 115200, 0x45086647 +1, 326400, 8064, 0xddd77327 +0, 330000, 115200, 0xace06816 +1, 331200, 8064, 0x0a31c118 +1, 336000, 8064, 0x7652ee6e +0, 336000, 115200, 0x4ef26aa2 +1, 340800, 8064, 0x486a24cc +0, 342000, 115200, 0xf2046bb3 +1, 345600, 8064, 0xf6cf01ee +0, 348000, 115200, 0x846b6eb0 +1, 350400, 8064, 0x2a19e830 +0, 354000, 115200, 0x8a17716d +1, 355200, 8064, 0xde675a31 +1, 360000, 8064, 0xeefcc9af +0, 360000, 115200, 0x36127568 +1, 364800, 8064, 0xaec4c989 +0, 366000, 115200, 0x3e877b5c +1, 369600, 8064, 0x16b73de9 +0, 372000, 115200, 0xea5681e8 +1, 374400, 8064, 0x188a582a +0, 378000, 115200, 0x41bc8a39 +1, 379200, 8064, 0xc092e73d +1, 384000, 8064, 0xf7ebca97 +0, 384000, 115200, 0x6f839446 +1, 388800, 8064, 0x170ce07a +0, 390000, 115200, 0xef74a005 +1, 393600, 8064, 0xa0705384 +0, 396000, 115200, 0x4354b2c2 +1, 398400, 8064, 0xd0154a3c +0, 402000, 115200, 0x4607cf99 +1, 403200, 8064, 0x57c73c6c +1, 408000, 8064, 0x590c9ddb +0, 408000, 115200, 0x4c18e8db +1, 412800, 8064, 0x2cbe552f +0, 414000, 115200, 0x04d71efb +1, 417600, 8064, 0x0d286932 +0, 420000, 115200, 0x32f4b9ae +1, 422400, 8064, 0x5931cea3 +0, 426000, 115200, 0x4dd48d01 +1, 427200, 8064, 0xaf0fb80d +1, 432000, 8064, 0x7fb61e9b +0, 432000, 115200, 0x5fa9627f +1, 436800, 8064, 0xf17134bb +0, 438000, 115200, 0x7a413f88 +1, 441600, 8064, 0xd647859a +0, 444000, 115200, 0xf1b7e5b6 +1, 446400, 8064, 0x55a60921 +0, 450000, 115200, 0x3d720e05 +1, 451200, 8064, 0x3811fa58 +1, 456000, 8064, 0xaceeccea +0, 456000, 115200, 0x49243fd8 +1, 460800, 8064, 0x5fcedf14 +0, 462000, 115200, 0x9834b697 +1, 465600, 8064, 0xd8c64abf +0, 468000, 115200, 0x4b8bc217 +1, 470400, 8064, 0x79495e8d +0, 474000, 115200, 0x3eaf5504 +1, 475200, 8064, 0x4b7db039 +1, 480000, 8064, 0x7152f86d +0, 480000, 115200, 0x057a3701 +1, 484800, 8064, 0xd92cfc1a +0, 486000, 115200, 0x6e88f21a +1, 489600, 8064, 0x75c540ef +0, 492000, 115200, 0x236c5226 +1, 494400, 8064, 0x9c03ef5e +0, 498000, 115200, 0x92212d84 +1, 499200, 8064, 0x7b2911c8 +1, 504000, 8064, 0x69d9d553 +0, 504000, 115200, 0xf6b0a4ff +1, 508800, 8064, 0xcb45d7c5 +0, 510000, 115200, 0xb49e9b4e +1, 513600, 8064, 0x37ec8b0a +0, 516000, 115200, 0x4a252440 +1, 518400, 8064, 0xe4354221 +0, 522000, 115200, 0x65f3339a +1, 523200, 8064, 0xc0d91cdb +1, 528000, 8064, 0xea0be175 +0, 528000, 115200, 0x38e40a20 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/psx-str-v3 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/psx-str-v3 new file mode 100644 index 00000000..3ea065b2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/psx-str-v3 @@ -0,0 +1,96 @@ +0, 0, 76800, 0x2677be82 +1, 0, 8064, 0xa307ed8c +1, 4800, 8064, 0xd2551927 +0, 6000, 76800, 0x1f323c75 +1, 9600, 8064, 0x3264a799 +0, 12000, 76800, 0xc8be3be9 +1, 14400, 8064, 0x75da1393 +0, 18000, 76800, 0x1f323c75 +1, 19200, 8064, 0x68665f59 +0, 24000, 76800, 0x7e484488 +1, 24000, 8064, 0xaf266a18 +1, 28800, 8064, 0x4d4b69fd +0, 30000, 76800, 0x8bd644aa +1, 33600, 8064, 0x129d7e17 +0, 36000, 76800, 0xaa62e7b8 +1, 38400, 8064, 0x78c56725 +0, 42000, 76800, 0xaa62e7b8 +1, 43200, 8064, 0x59902cf1 +0, 48000, 76800, 0x53fadb39 +1, 48000, 8064, 0x6e699c87 +1, 52800, 8064, 0xc30692d7 +0, 54000, 76800, 0x53fadb39 +1, 57600, 8064, 0x29c043e5 +0, 60000, 76800, 0x1ff9d964 +1, 62400, 8064, 0x61907704 +0, 66000, 76800, 0x1ff9d964 +1, 67200, 8064, 0xf9210630 +0, 72000, 76800, 0xd8c8d947 +1, 72000, 8064, 0xc0bdda08 +1, 76800, 8064, 0x6171b96d +0, 78000, 76800, 0xd8c8d947 +1, 81600, 8064, 0x082947cf +0, 84000, 76800, 0x6d0bd94c +1, 86400, 8064, 0xf7bbf1ce +0, 90000, 76800, 0x6d0bd94c +1, 91200, 8064, 0xe50e4436 +0, 96000, 76800, 0x7e66d948 +1, 96000, 8064, 0x2a860844 +1, 100800, 8064, 0xedcb502c +0, 102000, 76800, 0x7e66d948 +1, 105600, 8064, 0x448e3c7f +0, 108000, 76800, 0x8eecfd72 +1, 110400, 8064, 0xf782f366 +0, 114000, 76800, 0xb15f29ab +1, 115200, 8064, 0xf57f66a5 +0, 120000, 76800, 0x08e5502e +1, 120000, 8064, 0xdcc36939 +1, 124800, 8064, 0x34959d99 +0, 126000, 76800, 0xaa58796d +1, 129600, 8064, 0xa5c20433 +0, 132000, 76800, 0xe254a27c +1, 134400, 8064, 0xf1364e9b +0, 138000, 76800, 0xeec8cf68 +1, 139200, 8064, 0x232fe9c7 +0, 144000, 76800, 0x812bf8ee +1, 144000, 8064, 0xdc068d5a +1, 148800, 8064, 0x4962e812 +0, 150000, 76800, 0x929922ef +1, 153600, 8064, 0x36a6709b +0, 156000, 76800, 0xe1174e06 +1, 158400, 8064, 0xa2837bd8 +0, 162000, 76800, 0x2da77bf1 +1, 163200, 8064, 0x68612ddb +0, 168000, 76800, 0xd0f6a727 +1, 168000, 8064, 0x8d76d1cb +1, 172800, 8064, 0x7707cfc7 +0, 174000, 76800, 0x31bfd168 +0, 180000, 76800, 0xb87af225 +0, 186000, 76800, 0xd0080859 +0, 192000, 76800, 0x99ab15ba +0, 198000, 76800, 0x99ab15ba +0, 204000, 76800, 0x99ab15ba +0, 210000, 76800, 0x99ab15ba +0, 216000, 76800, 0x99ab15ba +0, 222000, 76800, 0x99ab15ba +0, 228000, 76800, 0x99ab15ba +0, 234000, 76800, 0x99ab15ba +0, 240000, 76800, 0x99ab15ba +0, 246000, 76800, 0x99ab15ba +0, 252000, 76800, 0x99ab15ba +0, 258000, 76800, 0x99ab15ba +0, 264000, 76800, 0x99ab15ba +0, 270000, 76800, 0x99ab15ba +0, 276000, 76800, 0x99ab15ba +0, 282000, 76800, 0x99ab15ba +0, 288000, 76800, 0x0c1617d5 +0, 294000, 76800, 0xb1c81b5d +0, 300000, 76800, 0xb4e41e44 +0, 306000, 76800, 0x765725e2 +0, 312000, 76800, 0x25cd3109 +0, 318000, 76800, 0xa42b5291 +0, 324000, 76800, 0x15bb6ee4 +0, 330000, 76800, 0xb33c9f50 +0, 336000, 76800, 0x1ca1b874 +0, 342000, 76800, 0x7506e92a +0, 348000, 76800, 0x97c9030a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ptx b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ptx new file mode 100644 index 00000000..e1688bb3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ptx @@ -0,0 +1 @@ +0, 0, 393216, 0xda280efc diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/pva-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/pva-demux new file mode 100644 index 00000000..511f6522 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/pva-demux @@ -0,0 +1,25 @@ +1, 0, 384, 0x071abcc8 +1, 0, 384, 0x31c9aee0 +1, 2160, 384, 0xa50eaa94 +1, 4320, 384, 0x9e86ba0e +1, 8640, 384, 0x2321b800 +1, 10800, 384, 0x2347afa8 +1, 12960, 384, 0x0831b8d3 +1, 15120, 384, 0xd5acafa1 +1, 17280, 384, 0xc975b9d2 +1, 19440, 384, 0x2e10b02a +1, 21600, 384, 0x501eadd0 +1, 23760, 384, 0x153fc171 +1, 25920, 384, 0xc5f0b3c2 +1, 28080, 384, 0xf731b200 +1, 30240, 384, 0x2e16b713 +1, 32400, 384, 0x61f6bba9 +1, 34560, 384, 0x1b9eb0ff +1, 36720, 384, 0x2ab4b7bd +1, 38880, 384, 0xd66eb45c +1, 41040, 384, 0x145ab426 +1, 43200, 384, 0x297cb370 +1, 45360, 384, 0x287bb6b7 +1, 47520, 384, 0xfddbb7df +1, 49680, 384, 0xbbb2af0c +1, 51840, 384, 0x8f03b5fc diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qcp-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qcp-demux new file mode 100644 index 00000000..cd7157d6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qcp-demux @@ -0,0 +1 @@ +CRC=0x4f9f567a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qpeg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qpeg new file mode 100644 index 00000000..b7d698c0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qpeg @@ -0,0 +1,100 @@ +0, 0, 230400, 0x0b712fba +0, 3600, 230400, 0x30252ac7 +0, 7200, 230400, 0x6d98a787 +0, 10800, 230400, 0x5d1f6ce7 +0, 14400, 230400, 0xccb79136 +0, 18000, 230400, 0x394093e1 +0, 21600, 230400, 0x3e76c5e9 +0, 25200, 230400, 0xd6cdc8f1 +0, 28800, 230400, 0xd355371d +0, 32400, 230400, 0x2c1519ca +0, 36000, 230400, 0xd82427e1 +0, 39600, 230400, 0x4202e3b4 +0, 43200, 230400, 0x27c15cda +0, 46800, 230400, 0x3fd7d5db +0, 50400, 230400, 0x03838791 +0, 54000, 230400, 0x8253d774 +0, 57600, 230400, 0x833e9c9f +0, 61200, 230400, 0xe30aba05 +0, 64800, 230400, 0x81056b68 +0, 68400, 230400, 0xe6454d37 +0, 72000, 230400, 0x6bb65f77 +0, 75600, 230400, 0x95b652eb +0, 79200, 230400, 0x4f585a73 +0, 82800, 230400, 0x9bc2c9d8 +0, 86400, 230400, 0x09f00930 +0, 90000, 230400, 0x6be9d11a +0, 93600, 230400, 0x5cdd4ea5 +0, 97200, 230400, 0x77508d67 +0, 100800, 230400, 0x76b21fdd +0, 104400, 230400, 0x39e2dddb +0, 108000, 230400, 0x8b16d389 +0, 111600, 230400, 0xb2b329fb +0, 115200, 230400, 0x8e998c17 +0, 118800, 230400, 0x3852049f +0, 122400, 230400, 0x5a7f6302 +0, 126000, 230400, 0xdd7d9d86 +0, 129600, 230400, 0x337298bd +0, 133200, 230400, 0x2fa38668 +0, 136800, 230400, 0xfc42afcd +0, 140400, 230400, 0x20ff7b1d +0, 144000, 230400, 0xa9190f28 +0, 147600, 230400, 0x2ca26827 +0, 151200, 230400, 0x1106bd55 +0, 154800, 230400, 0xb965748e +0, 158400, 230400, 0x2c2d2691 +0, 162000, 230400, 0x8096db4d +0, 165600, 230400, 0x7b223871 +0, 169200, 230400, 0xf9edbca9 +0, 172800, 230400, 0x0e607f74 +0, 176400, 230400, 0x3e64ed79 +0, 180000, 230400, 0x2198f77a +0, 183600, 230400, 0x3cf4925a +0, 187200, 230400, 0x2de0ebdb +0, 190800, 230400, 0x5104c55f +0, 194400, 230400, 0xebd7f8f7 +0, 198000, 230400, 0xfce8a2ae +0, 201600, 230400, 0xeb073121 +0, 205200, 230400, 0x8f2ed47d +0, 208800, 230400, 0xdcb72934 +0, 212400, 230400, 0xf69e75a1 +0, 216000, 230400, 0xc45ab599 +0, 219600, 230400, 0x0d218766 +0, 223200, 230400, 0x4a6aafce +0, 226800, 230400, 0x642153ca +0, 230400, 230400, 0x8bd7a2a4 +0, 234000, 230400, 0x04abeeed +0, 237600, 230400, 0x37bf9f2c +0, 241200, 230400, 0x1d966ae5 +0, 244800, 230400, 0x3a2ef337 +0, 248400, 230400, 0x9edaf34f +0, 252000, 230400, 0x7f3c0ff8 +0, 255600, 230400, 0x403cbdee +0, 259200, 230400, 0x86b340e8 +0, 262800, 230400, 0x5a57c916 +0, 266400, 230400, 0x35763ab3 +0, 270000, 230400, 0xd135a1ba +0, 273600, 230400, 0x56a7b1db +0, 277200, 230400, 0x6e8d2910 +0, 280800, 230400, 0xc8d9c4e1 +0, 284400, 230400, 0xb61fd11f +0, 288000, 230400, 0x8949b165 +0, 291600, 230400, 0x60082f69 +0, 295200, 230400, 0xf9c74a14 +0, 298800, 230400, 0x1f0af3f4 +0, 302400, 230400, 0x1abe4a3b +0, 306000, 230400, 0xdf762ffb +0, 309600, 230400, 0x38513b73 +0, 313200, 230400, 0xf3b01fcf +0, 316800, 230400, 0xea7d486c +0, 320400, 230400, 0xfabc7a89 +0, 324000, 230400, 0xc72f6977 +0, 327600, 230400, 0x1c9e4590 +0, 331200, 230400, 0x51abf71e +0, 334800, 230400, 0x39c9d819 +0, 338400, 230400, 0xfc62d8e0 +0, 342000, 230400, 0x40bb8c0d +0, 345600, 230400, 0xa0bd86d2 +0, 349200, 230400, 0x610dfe19 +0, 352800, 230400, 0x997e1572 +0, 356400, 230400, 0x49919319 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-alaw-mono b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-alaw-mono new file mode 100644 index 00000000..fc23d574 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-alaw-mono @@ -0,0 +1 @@ +7257c296fbba7eedf688fcb667144f7b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-alaw-stereo b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-alaw-stereo new file mode 100644 index 00000000..1a9af29f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-alaw-stereo @@ -0,0 +1 @@ +011d4aecaee697cc861012b7c25b5d40 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-ima4-mono b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-ima4-mono new file mode 100644 index 00000000..66767d5d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-ima4-mono @@ -0,0 +1 @@ +721b51fd66c3bb3dc49dd88d404188eb diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-ima4-stereo b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-ima4-stereo new file mode 100644 index 00000000..5e6b1237 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-ima4-stereo @@ -0,0 +1 @@ +c9e4c21fb62eca34a533f3a9ad2e394a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-mac3-mono b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-mac3-mono new file mode 100644 index 00000000..c320e181 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-mac3-mono @@ -0,0 +1 @@ +728d89210e1c90a9185db729b0b6e8c0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-mac3-stereo b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-mac3-stereo new file mode 100644 index 00000000..7b5ce457 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-mac3-stereo @@ -0,0 +1 @@ +2eef3c68fce3d18ec757bcbc0d369698 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-mac6-mono b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-mac6-mono new file mode 100644 index 00000000..d4d5104b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-mac6-mono @@ -0,0 +1 @@ +eec238d2737365fba15da813e5a7fbc9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-mac6-stereo b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-mac6-stereo new file mode 100644 index 00000000..d018cb08 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-mac6-stereo @@ -0,0 +1 @@ +2716d66016d8230bcc0fe90586da97a9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-msadpcm-stereo b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-msadpcm-stereo new file mode 100644 index 00000000..6b131c1f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-msadpcm-stereo @@ -0,0 +1 @@ +3b7554e9a186c30adfd2a86bae950f4a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-msimaadpcm-stereo b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-msimaadpcm-stereo new file mode 100644 index 00000000..cb6a4819 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-msimaadpcm-stereo @@ -0,0 +1 @@ +1ee96f1efc09251a732621049dc5b66e diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-rawpcm-16bit-stereo-signed-be b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-rawpcm-16bit-stereo-signed-be new file mode 100644 index 00000000..2500ba26 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-rawpcm-16bit-stereo-signed-be @@ -0,0 +1 @@ +f0c0fd7615cdef66fa72f5816632ca9b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-rawpcm-16bit-stereo-signed-le b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-rawpcm-16bit-stereo-signed-le new file mode 100644 index 00000000..f0837d12 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-rawpcm-16bit-stereo-signed-le @@ -0,0 +1 @@ +0262b20b728f5bb95594e64e2173b2f2 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-rawpcm-8bit-mono-unsigned b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-rawpcm-8bit-mono-unsigned new file mode 100644 index 00000000..2b46dbc0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-rawpcm-8bit-mono-unsigned @@ -0,0 +1 @@ +c2dcec9b230dad733b6b877fbed36755 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-rawpcm-8bit-stereo-unsigned b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-rawpcm-8bit-stereo-unsigned new file mode 100644 index 00000000..701a515f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-rawpcm-8bit-stereo-unsigned @@ -0,0 +1 @@ +973cf68365c3d58ff60ba652433b3bd2 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-ulaw-mono b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-ulaw-mono new file mode 100644 index 00000000..62fbc4e7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-ulaw-mono @@ -0,0 +1 @@ +63075293c68079826146963e94f45ca6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-ulaw-stereo b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-ulaw-stereo new file mode 100644 index 00000000..642f0cb4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qt-ulaw-stereo @@ -0,0 +1 @@ +96316117d444b06b2aa20877f7de36fd diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-16bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-16bit new file mode 100644 index 00000000..2f0ca485 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-16bit @@ -0,0 +1,83 @@ +0, 0, 57600, 0xe6b0a48c +0, 6000, 57600, 0xe064d51c +0, 12000, 57600, 0xbfce6b33 +0, 18000, 57600, 0x371bab02 +0, 24000, 57600, 0x0d2d7456 +0, 30000, 57600, 0x9184eecb +0, 36000, 57600, 0xb482e8db +0, 42000, 57600, 0x0f4cd4be +0, 48000, 57600, 0xe276cccb +0, 54000, 57600, 0x04c21c62 +0, 60000, 57600, 0x848960a2 +0, 66000, 57600, 0xc4c8cf03 +0, 72000, 57600, 0xb4094866 +0, 78000, 57600, 0xf22da043 +0, 84000, 57600, 0x6517b67b +0, 90000, 57600, 0x23e39ccb +0, 96000, 57600, 0x41525ca3 +0, 102000, 57600, 0xc3edc5f3 +0, 108000, 57600, 0x8ce81c7e +0, 114000, 57600, 0x56829443 +0, 120000, 57600, 0x511ce287 +0, 126000, 57600, 0x8f029a5b +0, 132000, 57600, 0x2b47cf43 +0, 138000, 57600, 0x8e7ecf4b +0, 144000, 57600, 0xd620317e +0, 150000, 57600, 0x5987646e +0, 156000, 57600, 0xcfedb7df +0, 162000, 57600, 0x33746e7b +0, 168000, 57600, 0x1d318573 +0, 174000, 57600, 0xc851848b +0, 180000, 57600, 0x939db1d7 +0, 186000, 57600, 0x1719aed3 +0, 192000, 57600, 0x1ba3e18c +0, 198000, 57600, 0x04f355fb +0, 204000, 57600, 0x6fafd5f4 +0, 210000, 57600, 0x434f800b +0, 216000, 57600, 0xed42179b +0, 222000, 57600, 0x3b33118b +0, 228000, 57600, 0xf81880cb +0, 234000, 57600, 0xd2c58e1b +0, 240000, 57600, 0xd96f50eb +0, 246000, 57600, 0x64ef63fb +0, 252000, 57600, 0x7b14b6fc +0, 258000, 57600, 0xeb1c9054 +0, 264000, 57600, 0x3b30c97c +0, 270000, 57600, 0xc93e9484 +0, 276000, 57600, 0xe012c0cc +0, 282000, 57600, 0x48e2dda4 +0, 288000, 57600, 0x13eb55fb +0, 294000, 57600, 0xa5edbedc +0, 300000, 57600, 0x0123a484 +0, 306000, 57600, 0xc624a7ac +0, 312000, 57600, 0xd83cf45c +0, 318000, 57600, 0x8f9bf4b4 +0, 324000, 57600, 0x2d494b8c +0, 330000, 57600, 0xb246f07c +0, 336000, 57600, 0x5750e67c +0, 342000, 57600, 0x6643e9ac +0, 348000, 57600, 0x8d3b86b3 +0, 354000, 57600, 0x4bb0546b +0, 360000, 57600, 0xfe439333 +0, 366000, 57600, 0x0cc76233 +0, 372000, 57600, 0xb6fe40ae +0, 378000, 57600, 0xf79fe0d7 +0, 384000, 57600, 0xdc90dcbb +0, 390000, 57600, 0x371e7c2b +0, 396000, 57600, 0x7c4590bb +0, 402000, 57600, 0x66f5454b +0, 408000, 57600, 0x1678ae5b +0, 414000, 57600, 0x1ee8fdec +0, 420000, 57600, 0x98d2a083 +0, 426000, 57600, 0x86d29e5b +0, 432000, 57600, 0x23d2bc83 +0, 438000, 57600, 0x3fc729f2 +0, 444000, 57600, 0x821d61da +0, 450000, 57600, 0xdd549e0e +0, 456000, 57600, 0x641234e2 +0, 462000, 57600, 0x9a282112 +0, 468000, 57600, 0x6587e2fb +0, 474000, 57600, 0x043d0cb2 +0, 480000, 57600, 0x90328707 +0, 486000, 57600, 0x5744d313 +0, 492000, 57600, 0x6e1b95cb diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-1bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-1bit new file mode 100644 index 00000000..040c9bfe --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-1bit @@ -0,0 +1,107 @@ +0, 0, 9600, 0xc1632102 +1, 0, 2040, 0x0a157db4 +1, 4163, 2040, 0x00c63e08 +0, 7500, 9600, 0x0f6c0521 +1, 8327, 2040, 0xacf2a25b +1, 12490, 2040, 0xd6189e85 +0, 15000, 9600, 0x04b90b5a +1, 16653, 2040, 0x8276f843 +1, 20816, 2040, 0xadebae73 +0, 22500, 9600, 0x2ebd4500 +1, 24980, 2040, 0x5da76697 +1, 29143, 2040, 0x469d0ea7 +0, 30000, 9600, 0x726f46f4 +1, 33306, 2040, 0x0d7412e1 +1, 37469, 2040, 0x2f2cc63f +0, 37500, 9600, 0x37f6968e +1, 41633, 2040, 0x10106eb7 +0, 45000, 9600, 0x7305872e +1, 45796, 2040, 0x300124c7 +1, 49959, 2040, 0xa329f8e8 +0, 52500, 9600, 0x222eff5e +1, 54122, 2040, 0xcea35ca5 +1, 58286, 2040, 0x55105aef +0, 60000, 9600, 0x9317e227 +1, 62449, 2040, 0x08980ce1 +1, 66612, 2040, 0x367faf24 +0, 67500, 9600, 0x421eee9d +1, 70776, 2040, 0x75bfef06 +1, 74939, 2040, 0x34f1daf4 +0, 75000, 9600, 0xcbcfaaff +1, 79102, 2040, 0x97050317 +0, 82500, 9600, 0xe7d43be2 +1, 83265, 2040, 0xd297c536 +1, 87429, 2040, 0xa8abad5a +0, 90000, 9600, 0x0b71e28c +1, 91592, 2040, 0x445ce8e0 +1, 95755, 2040, 0xa3f4d940 +0, 97500, 9600, 0xd6a050ca +1, 99918, 2040, 0x0ebb7b26 +1, 104082, 2040, 0x4372f6f6 +0, 105000, 9600, 0x0ac6dbf5 +1, 108245, 2040, 0xd4365079 +1, 112408, 2040, 0x56f902f7 +0, 112500, 9600, 0x5c036038 +1, 116571, 2040, 0x4153938a +0, 120000, 9600, 0x6e417ed6 +1, 120735, 2040, 0x14996d86 +1, 124898, 2040, 0x3f99c318 +0, 127500, 9600, 0x8bd0dc22 +1, 129061, 2040, 0x939978a5 +1, 133224, 2040, 0x7086bd44 +0, 135000, 9600, 0xdf3b0877 +1, 137388, 276, 0x25b89d22 +1, 137951, 2040, 0xf3edb106 +1, 142114, 2040, 0x0ca61430 +0, 142500, 9600, 0xae6e7823 +1, 146278, 2040, 0x7229c458 +0, 150000, 9600, 0x8ff0ac32 +1, 150441, 2040, 0xc37edd31 +1, 154604, 2040, 0xa3da98b4 +0, 157500, 9600, 0xa2d9e2ce +1, 158767, 2040, 0x69704803 +1, 162931, 2040, 0xa79bf334 +0, 165000, 9600, 0x5fd92b65 +1, 167094, 2040, 0x59d8d4c4 +1, 171257, 2040, 0xf9ff0271 +0, 172500, 9600, 0x81c1c824 +1, 175420, 2040, 0xc4ced9d6 +1, 179584, 2040, 0x859f1912 +0, 180000, 9600, 0xb8a2ace4 +1, 183747, 2040, 0xe7955aa6 +0, 187500, 9600, 0x65b70404 +1, 187910, 2040, 0x374624fd +1, 192073, 2040, 0x52121097 +0, 195000, 9600, 0xc5349eb2 +1, 196237, 2040, 0x660fe645 +1, 200400, 2040, 0xf624176a +0, 202500, 9600, 0xf60cc2b8 +1, 204563, 2040, 0x1f2246dd +1, 208727, 2040, 0x940e0a32 +0, 210000, 9600, 0x31474595 +1, 212890, 2040, 0x9c6d338c +1, 217053, 2040, 0xfce0d30a +0, 217500, 9600, 0xf602635b +1, 221216, 2040, 0xd0ec9aa5 +0, 225000, 9600, 0x873cbd87 +1, 225380, 2040, 0x58012141 +1, 229543, 2040, 0xde67fc43 +0, 232500, 9600, 0xb9793ffe +1, 233706, 2040, 0x6baa0450 +1, 237869, 2040, 0xf4f80252 +0, 240000, 9600, 0x42eb2831 +1, 242033, 2040, 0x0cd47ee3 +1, 246196, 2040, 0x129cbaa7 +0, 247500, 9600, 0x44cc1dab +1, 250359, 2040, 0x5ef5c0a1 +1, 254522, 2040, 0xf660baa7 +0, 255000, 9600, 0xbdcbbb87 +1, 258686, 2040, 0xe48bc0a1 +0, 262500, 9600, 0x29c22df7 +1, 262849, 2040, 0xdfeabaa7 +1, 267012, 2040, 0xed04c0a1 +0, 270000, 9600, 0xde502ef5 +1, 271176, 2040, 0xd771baa7 +1, 275339, 300, 0x521f24e9 +1, 275951, 1476, 0x9b9394b1 +0, 277500, 9600, 0xaf311aeb diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-24bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-24bit new file mode 100644 index 00000000..da8fec4c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-24bit @@ -0,0 +1,34 @@ +0, 0, 57600, 0x3718ad00 +0, 9000, 57600, 0x54861558 +0, 18000, 57600, 0xea1d6233 +0, 27000, 57600, 0xf669a2fd +0, 36000, 57600, 0xc9f76f31 +0, 45000, 57600, 0xe23c6d7b +0, 54000, 57600, 0xbc9d6167 +0, 63000, 57600, 0x0ca63477 +0, 72000, 57600, 0xc0850d22 +0, 81000, 57600, 0x735d10b2 +0, 90000, 57600, 0x561f3c4a +0, 99000, 57600, 0x84db9cf1 +0, 108000, 57600, 0x9fb841f4 +0, 117000, 57600, 0xeaf262ab +0, 126000, 57600, 0x264886b4 +0, 135000, 57600, 0x5edc5518 +0, 144000, 57600, 0xd3e60c72 +0, 153000, 57600, 0x9cabaed7 +0, 162000, 57600, 0x616716cf +0, 171000, 57600, 0xa43f61aa +0, 180000, 57600, 0xdba3a0bd +0, 189000, 57600, 0xa7dd6dfa +0, 198000, 57600, 0xc3fa6c84 +0, 207000, 57600, 0xb1275fb8 +0, 216000, 57600, 0x2e39331f +0, 225000, 57600, 0x5b9e0bca +0, 234000, 57600, 0x0e760f5a +0, 243000, 57600, 0xc56c3e69 +0, 252000, 57600, 0x51da9fb8 +0, 261000, 57600, 0xe3a1432b +0, 270000, 57600, 0xe1b360a3 +0, 279000, 57600, 0x30b383cd +0, 288000, 57600, 0x950c5439 +0, 297000, 57600, 0x8f9d0ca2 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-2bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-2bit new file mode 100644 index 00000000..c7e3fe60 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-2bit @@ -0,0 +1,107 @@ +0, 0, 230400, 0xb1ee55dc +1, 0, 2040, 0x0a157db4 +1, 4163, 2040, 0x00c63e08 +0, 7500, 230400, 0x97c580bf +1, 8327, 2040, 0xacf2a25b +1, 12490, 2040, 0xd6189e85 +0, 15000, 230400, 0xd4bd57e8 +1, 16653, 2040, 0x8276f843 +1, 20816, 2040, 0xadebae73 +0, 22500, 230400, 0x412b79aa +1, 24980, 2040, 0x5da76697 +1, 29143, 2040, 0x469d0ea7 +0, 30000, 230400, 0x928a44d1 +1, 33306, 2040, 0x0d7412e1 +1, 37469, 2040, 0x2f2cc63f +0, 37500, 230400, 0x6bbdc0e4 +1, 41633, 2040, 0x10106eb7 +0, 45000, 230400, 0x382e960f +1, 45796, 2040, 0x300124c7 +1, 49959, 2040, 0xa329f8e8 +0, 52500, 230400, 0x62c863ea +1, 54122, 2040, 0xcea35ca5 +1, 58286, 2040, 0x55105aef +0, 60000, 230400, 0xbfccd3ce +1, 62449, 2040, 0x08980ce1 +1, 66612, 2040, 0x367faf24 +0, 67500, 230400, 0x1987cdd4 +1, 70776, 2040, 0x75bfef06 +1, 74939, 2040, 0x34f1daf4 +0, 75000, 230400, 0x40279727 +1, 79102, 2040, 0x97050317 +0, 82500, 230400, 0x9d4f6746 +1, 83265, 2040, 0xd297c536 +1, 87429, 2040, 0xa8abad5a +0, 90000, 230400, 0x7b8a77ec +1, 91592, 2040, 0x445ce8e0 +1, 95755, 2040, 0xa3f4d940 +0, 97500, 230400, 0x2ce7a781 +1, 99918, 2040, 0x0ebb7b26 +1, 104082, 2040, 0x4372f6f6 +0, 105000, 230400, 0xb749815e +1, 108245, 2040, 0xd4365079 +1, 112408, 2040, 0x56f902f7 +0, 112500, 230400, 0x61c88610 +1, 116571, 2040, 0x4153938a +0, 120000, 230400, 0x8449114d +1, 120735, 2040, 0x14996d86 +1, 124898, 2040, 0x3f99c318 +0, 127500, 230400, 0x5f73e666 +1, 129061, 2040, 0x939978a5 +1, 133224, 2040, 0x7086bd44 +0, 135000, 230400, 0xbde53ce6 +1, 137388, 276, 0x25b89d22 +1, 137951, 2040, 0xf3edb106 +1, 142114, 2040, 0x0ca61430 +0, 142500, 230400, 0x8c7406fd +1, 146278, 2040, 0x7229c458 +0, 150000, 230400, 0xf9e9a3ef +1, 150441, 2040, 0xc37edd31 +1, 154604, 2040, 0xa3da98b4 +0, 157500, 230400, 0x7e0a3077 +1, 158767, 2040, 0x69704803 +1, 162931, 2040, 0xa79bf334 +0, 165000, 230400, 0xd9245c5f +1, 167094, 2040, 0x59d8d4c4 +1, 171257, 2040, 0xf9ff0271 +0, 172500, 230400, 0x6d077ea2 +1, 175420, 2040, 0xc4ced9d6 +1, 179584, 2040, 0x859f1912 +0, 180000, 230400, 0xf622bb2a +1, 183747, 2040, 0xe7955aa6 +0, 187500, 230400, 0x35292dc8 +1, 187910, 2040, 0x374624fd +1, 192073, 2040, 0x52121097 +0, 195000, 230400, 0xc0cea946 +1, 196237, 2040, 0x660fe645 +1, 200400, 2040, 0xf624176a +0, 202500, 230400, 0x98b27b60 +1, 204563, 2040, 0x1f2246dd +1, 208727, 2040, 0x940e0a32 +0, 210000, 230400, 0x668ef6bd +1, 212890, 2040, 0x9c6d338c +1, 217053, 2040, 0xfce0d30a +0, 217500, 230400, 0x6c07a31c +1, 221216, 2040, 0xd0ec9aa5 +0, 225000, 230400, 0x0b4a6ae1 +1, 225380, 2040, 0x58012141 +1, 229543, 2040, 0xde67fc43 +0, 232500, 230400, 0x945b9878 +1, 233706, 2040, 0x6baa0450 +1, 237869, 2040, 0xf4f80252 +0, 240000, 230400, 0xab28031c +1, 242033, 2040, 0x0cd47ee3 +1, 246196, 2040, 0x129cbaa7 +0, 247500, 230400, 0x977252b0 +1, 250359, 2040, 0x5ef5c0a1 +1, 254522, 2040, 0xf660baa7 +0, 255000, 230400, 0x6c3d9706 +1, 258686, 2040, 0xe48bc0a1 +0, 262500, 230400, 0xe053bc2a +1, 262849, 2040, 0xdfeabaa7 +1, 267012, 2040, 0xed04c0a1 +0, 270000, 230400, 0x4cf2fc7c +1, 271176, 2040, 0xd771baa7 +1, 275339, 300, 0x521f24e9 +1, 275951, 1476, 0x9b9394b1 +0, 277500, 230400, 0x610beda7 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-32bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-32bit new file mode 100644 index 00000000..a5e9c8a1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-32bit @@ -0,0 +1,26 @@ +0, 0, 1036800, 0x2a90d062 +0, 3003, 1036800, 0x6565aded +0, 6006, 1036800, 0xf0b587d2 +0, 9009, 1036800, 0xf0b4e53f +0, 12012, 1036800, 0x5ba4b96a +0, 15015, 1036800, 0x501df9c1 +0, 18018, 1036800, 0xcf45b940 +0, 21021, 1036800, 0xa454df07 +0, 24024, 1036800, 0xc504d152 +0, 27027, 1036800, 0xd90ecac7 +0, 30030, 1036800, 0xe30368df +0, 33033, 1036800, 0x0ca35522 +0, 36036, 1036800, 0xe76b8d43 +0, 39039, 1036800, 0x7c85a447 +0, 42042, 1036800, 0x3e2d1b5f +0, 45045, 1036800, 0x230fa5a6 +0, 48048, 1036800, 0x4fad025e +0, 51051, 1036800, 0x7d3366ae +0, 54054, 1036800, 0xa83720f7 +0, 57057, 1036800, 0x5dbd13b1 +0, 60060, 1036800, 0xd0ebd56d +0, 63063, 1036800, 0x4d7c67f3 +0, 66066, 1036800, 0x226baa3f +0, 69069, 1036800, 0xc0e93acf +0, 72072, 1036800, 0x5a466c17 +0, 75075, 1036800, 0xfdb7d2ea diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-4bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-4bit new file mode 100644 index 00000000..56780966 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-4bit @@ -0,0 +1,38 @@ +0, 0, 230400, 0x0655b3d9 +0, 7500, 230400, 0x9c626fd3 +0, 15000, 230400, 0x5bc95868 +0, 22500, 230400, 0x55a38387 +0, 30000, 230400, 0xd3495b60 +0, 37500, 230400, 0xecdb2d15 +0, 45000, 230400, 0x7f9b373e +0, 52500, 230400, 0x51caac22 +0, 60000, 230400, 0x0f2ac153 +0, 67500, 230400, 0xe5a6f9e7 +0, 75000, 230400, 0xfc2b2250 +0, 82500, 230400, 0x24e2da1b +0, 90000, 230400, 0x2723d7dd +0, 97500, 230400, 0x024a4989 +0, 105000, 230400, 0xdbafb92d +0, 112500, 230400, 0x6b9b5056 +0, 120000, 230400, 0x010cabb4 +0, 127500, 230400, 0xf75bc1c0 +0, 135000, 230400, 0x6c7fd744 +0, 142500, 230400, 0xabe4371a +0, 150000, 230400, 0xe41fb781 +0, 157500, 230400, 0x42c5649e +0, 165000, 230400, 0xf5511deb +0, 172500, 230400, 0xebf5ab32 +0, 180000, 230400, 0x44398194 +0, 187500, 230400, 0xfd63510c +0, 195000, 230400, 0xa013975e +0, 202500, 230400, 0xe0aa028d +0, 210000, 230400, 0x349f6f3b +0, 217500, 230400, 0x2446032c +0, 225000, 230400, 0x648f122c +0, 232500, 230400, 0xbda221fd +0, 240000, 230400, 0xf0f97642 +0, 247500, 230400, 0x6a1737de +0, 255000, 230400, 0x808a8179 +0, 262500, 230400, 0x121641cf +0, 270000, 230400, 0x275d11ea +0, 277500, 230400, 0x92adf2cf diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-8bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-8bit new file mode 100644 index 00000000..62f74820 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/qtrle-8bit @@ -0,0 +1,167 @@ +0, 0, 921600, 0x1492e3ed +0, 6000, 921600, 0x1492e3ed +0, 12000, 921600, 0x1492e3ed +0, 18000, 921600, 0x23ef4fc7 +0, 24000, 921600, 0x23ef4fc7 +0, 30000, 921600, 0xe406d4be +0, 36000, 921600, 0xe406d4be +0, 42000, 921600, 0xe406d4be +0, 48000, 921600, 0x62b8b5a1 +0, 54000, 921600, 0x62b8b5a1 +0, 60000, 921600, 0x7d8ba674 +0, 66000, 921600, 0x7d8ba674 +0, 72000, 921600, 0x7d8ba674 +0, 78000, 921600, 0xfe666be7 +0, 84000, 921600, 0xfe666be7 +0, 90000, 921600, 0x721baec0 +0, 96000, 921600, 0x721baec0 +0, 102000, 921600, 0x721baec0 +0, 108000, 921600, 0xc237180a +0, 114000, 921600, 0xc237180a +0, 120000, 921600, 0xf03a7482 +0, 126000, 921600, 0xf03a7482 +0, 132000, 921600, 0xf03a7482 +0, 138000, 921600, 0x5612a391 +0, 144000, 921600, 0x5612a391 +0, 150000, 921600, 0x9dbcc46a +0, 156000, 921600, 0x9dbcc46a +0, 162000, 921600, 0x9dbcc46a +0, 168000, 921600, 0xa128a5d5 +0, 174000, 921600, 0xa128a5d5 +0, 180000, 921600, 0x63e0025c +0, 186000, 921600, 0x63e0025c +0, 192000, 921600, 0x63e0025c +0, 198000, 921600, 0x262359ed +0, 204000, 921600, 0x262359ed +0, 210000, 921600, 0x343688e8 +0, 216000, 921600, 0x343688e8 +0, 222000, 921600, 0x343688e8 +0, 228000, 921600, 0x343688e8 +0, 234000, 921600, 0x343688e8 +0, 240000, 921600, 0x343688e8 +0, 246000, 921600, 0x343688e8 +0, 252000, 921600, 0x343688e8 +0, 258000, 921600, 0x343688e8 +0, 264000, 921600, 0x343688e8 +0, 270000, 921600, 0xe4b29d57 +0, 276000, 921600, 0xe4b29d57 +0, 282000, 921600, 0xe4b29d57 +0, 288000, 921600, 0x198e8a4a +0, 294000, 921600, 0x198e8a4a +0, 300000, 921600, 0x0cad8dc9 +0, 306000, 921600, 0x0cad8dc9 +0, 312000, 921600, 0x0cad8dc9 +0, 318000, 921600, 0x1f74cf3d +0, 324000, 921600, 0x1f74cf3d +0, 330000, 921600, 0xec5b5449 +0, 336000, 921600, 0xec5b5449 +0, 342000, 921600, 0xec5b5449 +0, 348000, 921600, 0x39829711 +0, 354000, 921600, 0x39829711 +0, 360000, 921600, 0x6de5b9c6 +0, 366000, 921600, 0x6de5b9c6 +0, 372000, 921600, 0x6de5b9c6 +0, 378000, 921600, 0x47b0e9d4 +0, 384000, 921600, 0x47b0e9d4 +0, 390000, 921600, 0x756452b8 +0, 396000, 921600, 0x756452b8 +0, 402000, 921600, 0x756452b8 +0, 408000, 921600, 0x6fce3478 +0, 414000, 921600, 0x6fce3478 +0, 420000, 921600, 0x372397cd +0, 426000, 921600, 0x372397cd +0, 432000, 921600, 0x372397cd +0, 438000, 921600, 0xe3999ba1 +0, 444000, 921600, 0xe3999ba1 +0, 450000, 921600, 0x6ba26b43 +0, 456000, 921600, 0x6ba26b43 +0, 462000, 921600, 0x6ba26b43 +0, 468000, 921600, 0x4e9ee49e +0, 474000, 921600, 0x4e9ee49e +0, 480000, 921600, 0xdb5fd6e7 +0, 486000, 921600, 0xdb5fd6e7 +0, 492000, 921600, 0xdb5fd6e7 +0, 498000, 921600, 0x8f2254a5 +0, 504000, 921600, 0x8f2254a5 +0, 510000, 921600, 0x8f2254a5 +0, 516000, 921600, 0x8f2254a5 +0, 522000, 921600, 0x8f2254a5 +0, 528000, 921600, 0x8f2254a5 +0, 534000, 921600, 0x8f2254a5 +0, 540000, 921600, 0x8f2254a5 +0, 546000, 921600, 0x8f2254a5 +0, 552000, 921600, 0x8f2254a5 +0, 558000, 921600, 0x57e95c32 +0, 564000, 921600, 0x57e95c32 +0, 570000, 921600, 0x41627a9b +0, 576000, 921600, 0x41627a9b +0, 582000, 921600, 0x41627a9b +0, 588000, 921600, 0x7412dcee +0, 594000, 921600, 0x7412dcee +0, 600000, 921600, 0xaebe10ed +0, 606000, 921600, 0xaebe10ed +0, 612000, 921600, 0xaebe10ed +0, 618000, 921600, 0x411a91f6 +0, 624000, 921600, 0x411a91f6 +0, 630000, 921600, 0xb059df3f +0, 636000, 921600, 0xb059df3f +0, 642000, 921600, 0xb059df3f +0, 648000, 921600, 0x4d6f5a77 +0, 654000, 921600, 0x4d6f5a77 +0, 660000, 921600, 0xbbf06df4 +0, 666000, 921600, 0xbbf06df4 +0, 672000, 921600, 0xbbf06df4 +0, 678000, 921600, 0xe27f7bf6 +0, 684000, 921600, 0xe27f7bf6 +0, 690000, 921600, 0xd7e8360e +0, 696000, 921600, 0xd7e8360e +0, 702000, 921600, 0xd7e8360e +0, 708000, 921600, 0x1dd4c344 +0, 714000, 921600, 0x1dd4c344 +0, 720000, 921600, 0x7995a7ce +0, 726000, 921600, 0x7995a7ce +0, 732000, 921600, 0x7995a7ce +0, 738000, 921600, 0x2ef3c566 +0, 744000, 921600, 0x2ef3c566 +0, 750000, 921600, 0xf296736e +0, 756000, 921600, 0xf296736e +0, 762000, 921600, 0xf296736e +0, 768000, 921600, 0xf296736e +0, 774000, 921600, 0xf296736e +0, 780000, 921600, 0xf296736e +0, 786000, 921600, 0xf296736e +0, 792000, 921600, 0xf296736e +0, 798000, 921600, 0xf296736e +0, 804000, 921600, 0xf296736e +0, 810000, 921600, 0x1a488311 +0, 816000, 921600, 0x1a488311 +0, 822000, 921600, 0x1a488311 +0, 828000, 921600, 0x9e28011b +0, 834000, 921600, 0x9e28011b +0, 840000, 921600, 0x84d1ea80 +0, 846000, 921600, 0x84d1ea80 +0, 852000, 921600, 0x84d1ea80 +0, 858000, 921600, 0x9ed41052 +0, 864000, 921600, 0x9ed41052 +0, 870000, 921600, 0xd4db7206 +0, 876000, 921600, 0xd4db7206 +0, 882000, 921600, 0xd4db7206 +0, 888000, 921600, 0x55f695a9 +0, 894000, 921600, 0x55f695a9 +0, 900000, 921600, 0x9d8c667f +0, 906000, 921600, 0x9d8c667f +0, 912000, 921600, 0x9d8c667f +0, 918000, 921600, 0x9b6037ec +0, 924000, 921600, 0x9b6037ec +0, 930000, 921600, 0x57c5e835 +0, 936000, 921600, 0x57c5e835 +0, 942000, 921600, 0x57c5e835 +0, 948000, 921600, 0x476dad89 +0, 954000, 921600, 0x476dad89 +0, 960000, 921600, 0xcfd6ad2b +0, 966000, 921600, 0xcfd6ad2b +0, 972000, 921600, 0xcfd6ad2b +0, 978000, 921600, 0x3b372379 +0, 984000, 921600, 0x3b372379 +0, 990000, 921600, 0x36f245f5 +0, 996000, 921600, 0x36f245f5 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/quickdraw b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/quickdraw new file mode 100644 index 00000000..5d6303b7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/quickdraw @@ -0,0 +1,2 @@ +0, 0, 921600, 0xc0e68764 +0, 6000, 921600, 0x01a16629 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/real-14_4 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/real-14_4 new file mode 100644 index 00000000..4710566d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/real-14_4 @@ -0,0 +1 @@ +2da17ae831ea415592c7e6828e3fb69a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/real-rv40 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/real-rv40 new file mode 100644 index 00000000..2a445d0c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/real-rv40 @@ -0,0 +1,121 @@ +0, 0, 276480, 0x5f7a0d4f +0, 7500, 276480, 0x5f7a0d4f +0, 15000, 276480, 0x5f7a0d4f +0, 22500, 276480, 0x5f7a0d4f +0, 30000, 276480, 0x5f7a0d4f +0, 37500, 276480, 0x5f7a0d4f +0, 45000, 276480, 0x5f7a0d4f +0, 52500, 276480, 0x5f7a0d4f +0, 60000, 276480, 0x5f7a0d4f +0, 67500, 276480, 0x5f7a0d4f +0, 75000, 276480, 0x5f7a0d4f +0, 82500, 276480, 0x5f7a0d4f +0, 90000, 276480, 0x5f7a0d4f +0, 97500, 276480, 0x5f7a0d4f +0, 105000, 276480, 0x5f7a0d4f +0, 112500, 276480, 0x5f7a0d4f +0, 120000, 276480, 0x5f7a0d4f +0, 127500, 276480, 0x5f7a0d4f +0, 135000, 276480, 0x2d722f8a +0, 142500, 276480, 0xebbb3c8f +0, 150000, 276480, 0x8574c868 +0, 157500, 276480, 0x4ec1e418 +0, 165000, 276480, 0x95f22651 +0, 172500, 276480, 0x071d897e +0, 180000, 276480, 0x9f7623f9 +0, 187500, 276480, 0x86d4dedf +0, 195000, 276480, 0xc0a0be22 +0, 202500, 276480, 0xc5902aec +0, 210000, 276480, 0xe000f066 +0, 217500, 276480, 0x0b2a48d5 +0, 225000, 276480, 0xa1565256 +0, 232500, 276480, 0x8de3ceb3 +0, 240000, 276480, 0x654b564a +0, 247500, 276480, 0xc9c57884 +0, 255000, 276480, 0x89cdcdd4 +0, 262500, 276480, 0x3594fe61 +0, 270000, 276480, 0x9d082a81 +0, 277500, 276480, 0x4e6cd0c3 +0, 285000, 276480, 0xc129765f +0, 292500, 276480, 0x92a04c99 +0, 300000, 276480, 0x5ca62953 +0, 307500, 276480, 0xb7e478aa +0, 315000, 276480, 0x932735d5 +0, 322500, 276480, 0xaaa2d7aa +0, 330000, 276480, 0xd1329996 +0, 337500, 276480, 0x6de1e34b +0, 345000, 276480, 0x8c963c9b +0, 352500, 276480, 0xce6eff29 +0, 360000, 276480, 0x25412f7e +0, 367500, 276480, 0x11a5ad85 +0, 375000, 276480, 0x26ea3248 +0, 382500, 276480, 0x86c35fa4 +0, 390000, 276480, 0xa98a2d38 +0, 397500, 276480, 0xed827333 +0, 405000, 276480, 0x5d44a824 +0, 412500, 276480, 0x46d54d04 +0, 420000, 276480, 0x413fd26a +0, 427500, 276480, 0xf0b3b71b +0, 435000, 276480, 0x459bc06d +0, 442500, 276480, 0x4199cd45 +0, 450000, 276480, 0xa8d35683 +0, 457500, 276480, 0x9a3e7de0 +0, 465000, 276480, 0x5a30f666 +0, 472500, 276480, 0x40152668 +0, 480000, 276480, 0x90c4d22c +0, 487500, 276480, 0x5cbaacc9 +0, 495000, 276480, 0x72b658f1 +0, 502500, 276480, 0x0ba3dcc9 +0, 510000, 276480, 0x259ed5c1 +0, 517500, 276480, 0x7fd73a99 +0, 525000, 276480, 0x488980c5 +0, 532500, 276480, 0x1d4c96a5 +0, 540000, 276480, 0x41ced7f2 +0, 547500, 276480, 0xd62d1837 +0, 555000, 276480, 0xf5fd9d20 +0, 562500, 276480, 0x2af91fda +0, 570000, 276480, 0x38ce229d +0, 577500, 276480, 0xf3a712c0 +0, 585000, 276480, 0x57b111d2 +0, 592500, 276480, 0x8556b792 +0, 600000, 276480, 0xb32d0896 +0, 607500, 276480, 0x923b9937 +0, 615000, 276480, 0x0da1e7e3 +0, 622500, 276480, 0x7f172382 +0, 630000, 276480, 0x93622b88 +0, 637500, 276480, 0x2599d540 +0, 645000, 276480, 0xed20c105 +0, 652500, 276480, 0x62ce256e +0, 660000, 276480, 0x286a04bb +0, 667500, 276480, 0x423f7e7c +0, 675000, 276480, 0x21fc252a +0, 682500, 276480, 0xf8a8e8ee +0, 690000, 276480, 0x770d4a8d +0, 697500, 276480, 0xaa12b6fd +0, 705000, 276480, 0xdc7221a8 +0, 712500, 276480, 0x487eeb30 +0, 720000, 276480, 0x1e74f2db +0, 727500, 276480, 0x40ae2bc3 +0, 735000, 276480, 0x9ca9b930 +0, 742500, 276480, 0x9fb19b0f +0, 750000, 276480, 0x7bdf836c +0, 757500, 276480, 0x1e607ba7 +0, 765000, 276480, 0xbd96578b +0, 772500, 276480, 0x2124bf07 +0, 780000, 276480, 0x4895e27a +0, 787500, 276480, 0x694d76e3 +0, 795000, 276480, 0xe70df513 +0, 802500, 276480, 0xcacafe6b +0, 810000, 276480, 0x64087748 +0, 817500, 276480, 0x571fda23 +0, 825000, 276480, 0x8c86cbe9 +0, 832500, 276480, 0xc8ea4671 +0, 840000, 276480, 0xbfb74300 +0, 847500, 276480, 0xbe1e3770 +0, 855000, 276480, 0x757a0232 +0, 862500, 276480, 0xa5f50c84 +0, 870000, 276480, 0x6d95f808 +0, 877500, 276480, 0xf002c5ca +0, 885000, 276480, 0x1a2abb26 +0, 892500, 276480, 0x6cf69bf2 +0, 900000, 276480, 0x8f316c66 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/redcode-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/redcode-demux new file mode 100644 index 00000000..2a4db65c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/redcode-demux @@ -0,0 +1,5 @@ +0, 0, 1626280, 0x5768c7d6 +1, 0, 14816, 0xd185e8c7 +0, 3754, 1626092, 0x070bd882 +1, 6803, 32736, 0x791b737a +0, 7508, 893932, 0x8c7cd0a6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/rl2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/rl2 new file mode 100644 index 00000000..7a2146d6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/rl2 @@ -0,0 +1,108 @@ +0, 0, 192000, 0x7112a667 +0, 9559, 192000, 0x6936abf3 +0, 19118, 192000, 0xb1f08981 +0, 28678, 192000, 0x4ce7fece +0, 38237, 192000, 0xf04decde +0, 47796, 192000, 0x47fef74b +0, 57355, 192000, 0x99b42ac2 +0, 66914, 192000, 0x3c4c419d +0, 76473, 192000, 0x66bf5588 +0, 86033, 192000, 0xe1de4725 +0, 95592, 192000, 0x348b2af9 +0, 105151, 192000, 0x1ce73e83 +0, 114710, 192000, 0xcdaa6e02 +0, 124269, 192000, 0x370dc2ce +0, 133829, 192000, 0x1e1e40fe +0, 143388, 192000, 0x491470a4 +0, 152947, 192000, 0x88c43e9a +0, 162506, 192000, 0x036f3f44 +0, 172065, 192000, 0xc8be7e25 +0, 181624, 192000, 0xbedb397d +0, 191184, 192000, 0x97c410f4 +0, 200743, 192000, 0xc2c8225d +0, 210302, 192000, 0xe396bccb +0, 219861, 192000, 0x7e89c24c +0, 229420, 192000, 0xb044954c +0, 238980, 192000, 0x335890dd +0, 248539, 192000, 0x58a457c0 +0, 258098, 192000, 0xeb0f4798 +0, 267657, 192000, 0x0bfc39a1 +0, 277216, 192000, 0x06a6905a +0, 286776, 192000, 0x5300c99b +0, 296335, 192000, 0x38f3f845 +0, 305894, 192000, 0x6afa3543 +0, 315453, 192000, 0x5106a8e0 +0, 325012, 192000, 0xc76f0dab +0, 334571, 192000, 0x8efa6939 +0, 344131, 192000, 0x64ea23d7 +0, 353690, 192000, 0x421a2817 +0, 363249, 192000, 0xc854fa18 +0, 372808, 192000, 0x4a10d59c +0, 382367, 192000, 0x72637829 +0, 391927, 192000, 0xdbbe2796 +0, 401486, 192000, 0xff742e6b +0, 411045, 192000, 0xf94b9346 +0, 420604, 192000, 0xc90ea53c +0, 430163, 192000, 0x177483bb +0, 439722, 192000, 0x3510369c +0, 449282, 192000, 0x501034bf +0, 458841, 192000, 0x315c744b +0, 468400, 192000, 0xdb5048ae +0, 477959, 192000, 0x09a86221 +0, 487518, 192000, 0xb9c9568a +0, 497078, 192000, 0x5eee665b +0, 506637, 192000, 0xdef85517 +0, 516196, 192000, 0x7896b5ad +0, 525755, 192000, 0x19fbad39 +0, 535314, 192000, 0x63358748 +0, 544873, 192000, 0xca0196a3 +0, 554433, 192000, 0x0b321da3 +0, 563992, 192000, 0xa07af07e +0, 573551, 192000, 0x21f9310c +0, 583110, 192000, 0x62d59874 +0, 592669, 192000, 0x021227b4 +0, 602229, 192000, 0x01dac0c2 +0, 611788, 192000, 0xf3c33a74 +0, 621347, 192000, 0xeebe83b7 +0, 630906, 192000, 0x9ec77f97 +0, 640465, 192000, 0xc91c2e37 +0, 650024, 192000, 0x7b58751d +0, 659584, 192000, 0xb178dfbb +0, 669143, 192000, 0x2a63b5be +0, 678702, 192000, 0x44a407ac +0, 688261, 192000, 0x9a8e17dd +0, 697820, 192000, 0x5546f4c8 +0, 707380, 192000, 0xeda94586 +0, 716939, 192000, 0x941dfa6b +0, 726498, 192000, 0x9772301d +0, 736057, 192000, 0x8be16b16 +0, 745616, 192000, 0x26dd4496 +0, 755176, 192000, 0x27823797 +0, 764735, 192000, 0xacc914f7 +0, 774294, 192000, 0xcbb72c9b +0, 783853, 192000, 0x4bd3391c +0, 793412, 192000, 0x4e6adbfe +0, 802971, 192000, 0x7a791c75 +0, 812531, 192000, 0xc4f59c94 +0, 822090, 192000, 0xc4f59c94 +0, 831649, 192000, 0x984a4a0b +0, 841208, 192000, 0x3353f31f +0, 850767, 192000, 0xa9d4dc5a +0, 860327, 192000, 0xb33425d0 +0, 869886, 192000, 0x546d768a +0, 879445, 192000, 0xfefbe5c9 +0, 889004, 192000, 0xbd6be61d +0, 898563, 192000, 0xf5792731 +0, 908122, 192000, 0xccde0582 +0, 917682, 192000, 0x857d58ee +0, 927241, 192000, 0xe914ce48 +0, 936800, 192000, 0x1f736298 +0, 946359, 192000, 0xec0b4846 +0, 955918, 192000, 0xe1422624 +0, 965478, 192000, 0x56e2b0e0 +0, 975037, 192000, 0xc4190640 +0, 984596, 192000, 0x7c461977 +0, 994155, 192000, 0x34b1d5e8 +0, 1003714, 192000, 0xbdc70f7a +0, 1013273, 192000, 0xb466cd8d +0, 1022833, 192000, 0x0e86a04c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/rpza b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/rpza new file mode 100644 index 00000000..32ea1cfb --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/rpza @@ -0,0 +1,30 @@ +0, 0, 230400, 0x4aec80a3 +0, 6000, 230400, 0xb6c41452 +0, 12000, 230400, 0xa6c27f12 +0, 18000, 230400, 0x309bd2d2 +0, 24000, 230400, 0x597a7341 +0, 30000, 230400, 0x597a7341 +0, 36000, 230400, 0xd6d6c569 +0, 42000, 230400, 0x31413d89 +0, 48000, 230400, 0x464e42e9 +0, 54000, 230400, 0x502d7c71 +0, 60000, 230400, 0x502d7c71 +0, 66000, 230400, 0xc96f23d1 +0, 72000, 230400, 0xc96f23d1 +0, 78000, 230400, 0x5bfd2bc7 +0, 84000, 230400, 0x821640a7 +0, 90000, 230400, 0x8f001967 +0, 96000, 230400, 0x406ba109 +0, 102000, 230400, 0x85d99b50 +0, 108000, 230400, 0x2fdb4018 +0, 114000, 230400, 0xfa127259 +0, 120000, 230400, 0xe6427b9b +0, 126000, 230400, 0xe6427b9b +0, 132000, 230400, 0x3a279000 +0, 138000, 230400, 0x710755ee +0, 144000, 230400, 0x76549d35 +0, 150000, 230400, 0xf4d0132c +0, 156000, 230400, 0xf4d0132c +0, 162000, 230400, 0x19d7ec14 +0, 168000, 230400, 0x19d7ec14 +0, 174000, 230400, 0x5f24b7e1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/rv30 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/rv30 new file mode 100644 index 00000000..5b43588b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/rv30 @@ -0,0 +1,46 @@ +0, 0, 126720, 0xcefaec47 +0, 7500, 126720, 0xa416ece5 +0, 15000, 126720, 0xa416ece5 +0, 22500, 126720, 0xa416ece5 +0, 30000, 126720, 0xcc10f4b7 +0, 37500, 126720, 0xeb6fb8d7 +0, 45000, 126720, 0xda71b917 +0, 52500, 126720, 0xbb1abbb7 +0, 60000, 126720, 0x273fbc37 +0, 67500, 126720, 0x16eebbd7 +0, 75000, 126720, 0x105eb927 +0, 82500, 126720, 0x7fa3ae27 +0, 90000, 126720, 0xd115a757 +0, 97500, 126720, 0x04e7897c +0, 105000, 126720, 0x68cfda2b +0, 112500, 126720, 0xe572dfc9 +0, 120000, 126720, 0xbc3cc34f +0, 127500, 126720, 0xcf8cb0e2 +0, 135000, 126720, 0x6d1c630d +0, 142500, 126720, 0x4338e469 +0, 150000, 126720, 0x9d82ea38 +0, 157500, 126720, 0x55e0b559 +0, 165000, 126720, 0x5eefb5ef +0, 172500, 126720, 0x4b10b746 +0, 180000, 126720, 0x8b07a1db +0, 187500, 126720, 0x8c639b34 +0, 195000, 126720, 0x63eb0b9f +0, 202500, 126720, 0x31c80c83 +0, 210000, 126720, 0x78495352 +0, 217500, 126720, 0x63d609c4 +0, 225000, 126720, 0xcd2a62d8 +0, 232500, 126720, 0x4aea732d +0, 240000, 126720, 0xe3bb352c +0, 247500, 126720, 0x4b9036ad +0, 255000, 126720, 0x88b66e2d +0, 262500, 126720, 0x4a8a1b16 +0, 270000, 126720, 0x2e014eac +0, 277500, 126720, 0x83212c67 +0, 285000, 126720, 0x4937e897 +0, 292500, 126720, 0x2d38babe +0, 300000, 126720, 0xbcb43c09 +0, 307500, 126720, 0x955ffaf4 +0, 315000, 126720, 0x3337d4a2 +0, 322500, 126720, 0xe8f58c33 +0, 330000, 126720, 0x3a7f771f +0, 337500, 126720, 0xb67c39b9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sha b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sha new file mode 100644 index 00000000..2da06947 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sha @@ -0,0 +1,21 @@ +Testing SHA-160 +A9993E364706816ABA3E25717850C26C9CD0D89D +84983E441C3BD26EBAAE4AA1F95129E5E54670F1 +34AA973CD4C4DAA4F61EEB2BDBAD27316534016F +A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D +84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 +34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F +Testing SHA-224 +23097D223405D8228642A477BDA255B32AADBCE4BDA0B3F7E36C9DA7 +75388B16512776CC5DBA5DA1FD890150B0C6455CB4F58B1952522525 +20794655980C91D8BBB4C1EA97618A4BF03F42581948B2EE4EE7AD67 +23097d22 3405d822 8642a477 bda255b3 2aadbce4 bda0b3f7 e36c9da7 +75388b16 512776cc 5dba5da1 fd890150 b0c6455c b4f58b19 52522525 +20794655 980c91d8 bbb4c1ea 97618a4b f03f4258 1948b2ee 4ee7ad67 +Testing SHA-256 +BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD +248D6A61D20638B8E5C026930C3E6039A33CE45964FF2167F6ECEDD419DB06C1 +CDC76E5C9914FB9281A1C7E284D73E67F1809A48A497200E046D39CCC7112CD0 +ba7816bf 8f01cfea 414140de 5dae2223 b00361a3 96177a9c b410ff61 f20015ad +248d6a61 d20638b8 e5c02693 0c3e6039 a33ce459 64ff2167 f6ecedd4 19db06c1 +cdc76e5c 9914fb92 81a1c7e2 84d73e67 f1809a48 a497200e 046d39cc c7112cd0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sierra-audio b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sierra-audio new file mode 100644 index 00000000..16f226e8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sierra-audio @@ -0,0 +1 @@ +a99402e1f1a0f137608898251b3f309b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sierra-vmd b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sierra-vmd new file mode 100644 index 00000000..4d9e4cdd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sierra-vmd @@ -0,0 +1,303 @@ +0, 0, 230400, 0x0224ab01 +1, 0, 123480, 0xc1059826 +0, 9000, 230400, 0x449e4d81 +0, 18000, 230400, 0x3e15e07a +0, 27000, 230400, 0xdabe4172 +0, 36000, 230400, 0x0947b7db +0, 45000, 230400, 0x934e243b +0, 54000, 230400, 0x6b5c5b6c +0, 63000, 230400, 0x4bf7bbb5 +0, 72000, 230400, 0x423eec8e +0, 81000, 230400, 0x63663b5e +0, 90000, 230400, 0x9c258a67 +0, 99000, 230400, 0x1c92b6e0 +0, 108000, 230400, 0xdd0a0e28 +0, 117000, 230400, 0x51d64af1 +0, 126000, 230400, 0x5776ac12 +0, 135000, 230400, 0x49070132 +0, 144000, 230400, 0xa59635ab +0, 153000, 230400, 0xb1f99504 +0, 162000, 230400, 0x61fac725 +0, 171000, 230400, 0xc32c28d5 +0, 180000, 230400, 0x2b7a91d6 +0, 189000, 230400, 0x917be717 +0, 198000, 230400, 0xd3c5a2ff +0, 207000, 230400, 0x0678a707 +0, 216000, 230400, 0x122504e6 +0, 225000, 230400, 0x76aebdae +0, 234000, 230400, 0x81357545 +0, 243000, 230400, 0x38baeebd +1, 252000, 4410, 0x261a09c0 +0, 252000, 230400, 0x1c5c44d4 +1, 261000, 4410, 0x68e9489e +0, 261000, 230400, 0x60e189cc +1, 270000, 4410, 0xb830827a +0, 270000, 230400, 0xb1f4381c +1, 279000, 4410, 0xb053b70c +0, 279000, 230400, 0xb5048fed +1, 288000, 4410, 0xd8845d5d +0, 288000, 230400, 0xc947c30e +1, 297000, 4410, 0xd741f940 +0, 297000, 230400, 0xe8e31c07 +1, 306000, 4410, 0x4860193c +0, 306000, 230400, 0x6d49dd02 +1, 315000, 4410, 0x2e70df5f +0, 315000, 230400, 0x293e15d3 +1, 324000, 4410, 0x4b3e0e54 +0, 324000, 230400, 0x354d792e +1, 333000, 4410, 0x4afbf661 +0, 333000, 230400, 0x35468780 +1, 342000, 4410, 0x485c3903 +0, 342000, 230400, 0x365d3991 +1, 351000, 4410, 0xc0a1a00c +0, 351000, 230400, 0xc9debef2 +1, 360000, 4410, 0x0ce2d38e +0, 360000, 230400, 0x4c4634c2 +1, 369000, 4410, 0x5b52dfa3 +0, 369000, 230400, 0x347c2dca +1, 378000, 4410, 0x0d6c02ba +0, 378000, 230400, 0x1efa0aaa +1, 387000, 4410, 0x55f31fe1 +0, 387000, 230400, 0xa79a0b5a +1, 396000, 4410, 0x7350b1b2 +0, 396000, 230400, 0xfdb2dcdb +1, 405000, 4410, 0x2b918eea +0, 405000, 230400, 0x42dbea33 +1, 414000, 4410, 0x6df6cf92 +0, 414000, 230400, 0x2a207e43 +1, 423000, 4410, 0x2ddd1782 +0, 423000, 230400, 0x86573783 +1, 432000, 4410, 0x12265e8e +0, 432000, 230400, 0xc3968473 +1, 441000, 4410, 0x00c62139 +0, 441000, 230400, 0x8f62a7b4 +1, 450000, 4410, 0xf2579b6c +0, 450000, 230400, 0x5a2e3073 +1, 459000, 4410, 0x3bc24a12 +0, 459000, 230400, 0xd24f5e2c +1, 468000, 4410, 0x0ce25212 +0, 468000, 230400, 0x1df3c67d +1, 477000, 4410, 0xad70de9a +0, 477000, 230400, 0xe4fd884d +1, 486000, 4410, 0x232705e4 +0, 486000, 230400, 0x9a228555 +1, 495000, 4410, 0x5ceba444 +0, 495000, 230400, 0x9eba8ed5 +1, 504000, 4410, 0x17a3660b +0, 504000, 230400, 0x3d808a3d +1, 513000, 4410, 0x291bb07e +0, 513000, 230400, 0xf57e866d +1, 522000, 4410, 0xc13ccf88 +0, 522000, 230400, 0x85f594f5 +1, 531000, 4410, 0xfb0cd542 +0, 531000, 230400, 0xb09f99dd +1, 540000, 4410, 0xb6438478 +0, 540000, 230400, 0x2b368475 +1, 549000, 4410, 0x263e9df2 +0, 549000, 230400, 0xa2417afd +1, 558000, 4410, 0x81621e20 +0, 558000, 230400, 0x590b709d +1, 567000, 4410, 0xe9a51d77 +0, 567000, 230400, 0x5d617705 +1, 576000, 4410, 0x69a3c758 +0, 576000, 230400, 0xabf981ad +1, 585000, 4410, 0x725af958 +0, 585000, 230400, 0x5a8590cd +1, 594000, 4410, 0x09db995d +0, 594000, 230400, 0x1bff853d +1, 603000, 4410, 0x42963941 +0, 603000, 230400, 0x71d08055 +1, 612000, 4410, 0x33a29bc4 +0, 612000, 230400, 0x2ebd817d +1, 621000, 4410, 0x02ee2bd1 +0, 621000, 230400, 0x6e838255 +1, 630000, 4410, 0xda968535 +0, 630000, 230400, 0x043984cd +1, 639000, 4410, 0x5414a080 +0, 639000, 230400, 0x7ff18495 +1, 648000, 4410, 0x021ac433 +0, 648000, 230400, 0xa43b8385 +1, 657000, 4410, 0x50195048 +0, 657000, 230400, 0x72b5825d +1, 666000, 4410, 0xc40921c7 +0, 666000, 230400, 0x3a178085 +1, 675000, 4410, 0xdbb622e0 +0, 675000, 230400, 0x67748245 +1, 684000, 4410, 0xc8d07342 +0, 684000, 230400, 0xeddf81d5 +1, 693000, 4410, 0x6ed9b17a +0, 693000, 230400, 0x8b088665 +1, 702000, 4410, 0x39ac6a03 +0, 702000, 230400, 0x6c408e15 +1, 711000, 4410, 0x119ed51c +0, 711000, 230400, 0x81f196dd +1, 720000, 4410, 0xc9a20539 +0, 720000, 230400, 0xab9f953d +1, 729000, 4410, 0x6db5fdbd +0, 729000, 230400, 0xa5f69795 +1, 738000, 4410, 0x64c6b468 +0, 738000, 230400, 0xa772950d +1, 747000, 4410, 0x1286686e +0, 747000, 230400, 0x6a5596d5 +1, 756000, 4410, 0x76632813 +0, 756000, 230400, 0x1355958d +1, 765000, 4410, 0x9923669b +0, 765000, 230400, 0x4134981d +1, 774000, 4410, 0x1cf31b5c +0, 774000, 230400, 0x8b929515 +1, 783000, 4410, 0xa9f14389 +0, 783000, 230400, 0x482f95c5 +1, 792000, 4410, 0x9438c5cc +0, 792000, 230400, 0x7a9795d5 +1, 801000, 4410, 0x48dd0a72 +0, 801000, 230400, 0x21c29abd +1, 810000, 4410, 0xb0fe24dd +0, 810000, 230400, 0x9ae6a475 +1, 819000, 4410, 0xdb9d03ac +0, 819000, 230400, 0x3734aee5 +1, 828000, 4410, 0x487d7ac3 +0, 828000, 230400, 0xa0a1b365 +1, 837000, 4410, 0x2b61d4d5 +0, 837000, 230400, 0x2dcab1c5 +1, 846000, 4410, 0xab934d9c +0, 846000, 230400, 0x9c8b6c44 +1, 855000, 4410, 0xd2ee6f94 +0, 855000, 230400, 0x5da75feb +1, 864000, 4410, 0x012c3002 +0, 864000, 230400, 0x4d02f8e3 +1, 873000, 4410, 0xfccbd3cc +0, 873000, 230400, 0x66824f3a +1, 882000, 4410, 0xe53230d8 +0, 882000, 230400, 0x0c9257e2 +1, 891000, 4410, 0x2f6a6102 +0, 891000, 230400, 0xb2927092 +1, 900000, 4410, 0x77bb876a +0, 900000, 230400, 0xb5dc6e9a +1, 909000, 4410, 0xbcb76718 +0, 909000, 230400, 0x6e567bc6 +1, 918000, 4410, 0x51c00790 +0, 918000, 230400, 0xbf9e0f7a +1, 927000, 4410, 0x51b8fc5a +0, 927000, 230400, 0xb16f684a +1, 936000, 4410, 0x20fe9b42 +0, 936000, 230400, 0xf9e55e81 +1, 945000, 4410, 0x363c5566 +0, 945000, 230400, 0xd8d0bcba +1, 954000, 4410, 0x3424a84c +0, 954000, 230400, 0x44720ac0 +1, 963000, 4410, 0x7c3053c0 +0, 963000, 230400, 0x7d4c2058 +1, 972000, 4410, 0x368f2f30 +0, 972000, 230400, 0xb0973eb9 +1, 981000, 4410, 0x0f1e6fd2 +0, 981000, 230400, 0x405a13ce +1, 990000, 4410, 0x3a1fe07e +0, 990000, 230400, 0x6422f00a +1, 999000, 4410, 0x74afd86a +0, 999000, 230400, 0x924b6c1e +1, 1008000, 4410, 0xfdf911dd +0, 1008000, 230400, 0xcf7809c0 +1, 1017000, 4410, 0x1206a561 +0, 1017000, 230400, 0x883a3863 +1, 1026000, 4410, 0x5f0f33d5 +0, 1026000, 230400, 0x6adc9e03 +1, 1035000, 4410, 0xca3d88e0 +0, 1035000, 230400, 0x4f5ab7a8 +1, 1044000, 4410, 0xdf8f19ea +0, 1044000, 230400, 0xdc0aab94 +1, 1053000, 4410, 0xe3275b9e +1, 1062000, 4410, 0xee1945c5 +1, 1071000, 4410, 0x0afbd006 +1, 1080000, 4410, 0x90ff8f14 +1, 1089000, 4410, 0xfc0c887a +1, 1098000, 4410, 0xae9bc232 +1, 1107000, 4410, 0x5f688eb8 +1, 1116000, 4410, 0x9a307469 +1, 1125000, 4410, 0x27f1e324 +1, 1134000, 4410, 0x0c0d4ca2 +1, 1143000, 4410, 0xd7e8ce74 +1, 1152000, 4410, 0x16a4bfd6 +1, 1161000, 4410, 0xbfb02f6d +1, 1170000, 4410, 0xf4b81a79 +1, 1179000, 4410, 0x05d97288 +1, 1188000, 4410, 0x3a7db4be +1, 1197000, 4410, 0xc6bea83e +1, 1206000, 4410, 0x436f62ed +1, 1215000, 4410, 0x6fabea0c +1, 1224000, 4410, 0x954878aa +1, 1233000, 4410, 0x4d10f579 +1, 1242000, 4410, 0xac65932a +1, 1251000, 4410, 0x6889f957 +1, 1260000, 4410, 0x65cf5830 +1, 1269000, 4410, 0x87a7af71 +1, 1278000, 4410, 0x82378c13 +1, 1287000, 4410, 0x88ab6bd5 +1, 1296000, 4410, 0xf90a3342 +1, 1305000, 4410, 0xd790a1bc +1, 1314000, 4410, 0x89919d7c +1, 1323000, 4410, 0x7ffb22bf +1, 1332000, 4410, 0xfefbcce3 +1, 1341000, 4410, 0x07714e80 +1, 1350000, 4410, 0x73078f53 +1, 1359000, 4410, 0x35c23078 +1, 1368000, 4410, 0x452538bb +1, 1377000, 4410, 0x61493f33 +1, 1386000, 4410, 0x2137c390 +1, 1395000, 4410, 0x78c9393f +1, 1404000, 4410, 0x7aeaf8e1 +1, 1413000, 4410, 0x4bb8da1c +1, 1422000, 4410, 0x5995dfc2 +1, 1431000, 4410, 0xccce8872 +1, 1440000, 4410, 0xca2753a4 +1, 1449000, 4410, 0x4296ff6d +1, 1458000, 4410, 0xe582d191 +1, 1467000, 4410, 0xc40268da +1, 1476000, 4410, 0xda1d475e +1, 1485000, 4410, 0x5e91e4e0 +1, 1494000, 4410, 0xfeb44475 +1, 1503000, 4410, 0x17ff8e38 +1, 1512000, 4410, 0x3bd58bcf +1, 1521000, 4410, 0x9476e23c +1, 1530000, 4410, 0x440651ab +1, 1539000, 4410, 0xb08cdc74 +1, 1548000, 4410, 0x6fc3031f +1, 1557000, 4410, 0x197ab39a +1, 1566000, 4410, 0xf92f0e3d +1, 1575000, 4410, 0xd5f6b678 +1, 1584000, 4410, 0x8af127a6 +1, 1593000, 4410, 0xe22f585e +1, 1602000, 4410, 0x67515610 +1, 1611000, 4410, 0x21569d7a +1, 1620000, 4410, 0x114597d8 +1, 1629000, 4410, 0xba213fb6 +1, 1638000, 4410, 0x1aca9fee +1, 1647000, 4410, 0x48cdd264 +1, 1656000, 4410, 0x533619ec +1, 1665000, 4410, 0x21466244 +1, 1674000, 4410, 0x26e00e88 +1, 1683000, 4410, 0x8e51d07c +1, 1692000, 4410, 0xa6c4048a +1, 1701000, 4410, 0x98ce10e4 +1, 1710000, 4410, 0x379bc8c2 +1, 1719000, 4410, 0x404b09c6 +1, 1728000, 4410, 0xfc89da8a +1, 1737000, 4410, 0xbdbe6914 +1, 1746000, 4410, 0x2cb09f08 +1, 1755000, 4410, 0x835bf2d9 +1, 1764000, 4410, 0xa4611790 +1, 1773000, 4410, 0x67740896 +1, 1782000, 4410, 0x489f6bd0 +1, 1791000, 4410, 0x072bae9c +1, 1800000, 4410, 0xadce5a89 +1, 1809000, 4410, 0x209f2c2c +1, 1818000, 4410, 0xf5706665 +1, 1827000, 4410, 0x631841cb +1, 1836000, 4410, 0xa1a2c65f +1, 1845000, 4410, 0x8818b96b +1, 1854000, 4410, 0x63158025 +1, 1863000, 4410, 0xf6ae79f5 +1, 1872000, 4410, 0xb3dcd214 +1, 1881000, 4410, 0x7a745449 +1, 1890000, 4410, 0x5d2b15f4 +1, 1899000, 4410, 0x48764b7c +1, 1908000, 4410, 0x1294e119 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/siff b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/siff new file mode 100644 index 00000000..2f67254b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/siff @@ -0,0 +1,39 @@ +1, 0, 44100, 0xd0a49e09 +0, 0, 230400, 0x3bd1d731 +0, 7500, 230400, 0x9d0774c3 +0, 15000, 230400, 0xa0faafe2 +0, 22500, 230400, 0x38325309 +0, 30000, 230400, 0xe90a1b1e +0, 37500, 230400, 0x8efbc904 +0, 45000, 230400, 0x0a8476f3 +0, 52500, 230400, 0x5d94587d +0, 60000, 230400, 0x280b905d +0, 67500, 230400, 0x07178dd9 +0, 75000, 230400, 0xf52b8db4 +0, 82500, 230400, 0x2b70c1dc +1, 90000, 44100, 0xf151af4d +0, 90000, 230400, 0x8157a6e9 +0, 97500, 230400, 0xd4a3c357 +0, 105000, 230400, 0x703861bb +0, 112500, 230400, 0xa13cf75e +0, 120000, 230400, 0x140e487f +0, 127500, 230400, 0x05cca333 +0, 135000, 230400, 0x0506ee2b +0, 142500, 230400, 0xe3e13466 +0, 150000, 230400, 0x8a24118c +0, 157500, 230400, 0x22050962 +0, 165000, 230400, 0x0f5c8a0d +0, 172500, 230400, 0x3475df44 +1, 180000, 44100, 0xecd3cd08 +0, 180000, 230400, 0x65354e06 +0, 187500, 230400, 0xb9a01978 +0, 195000, 230400, 0x15207ee1 +0, 202500, 230400, 0x3b214f0b +0, 210000, 230400, 0xf9461bbb +0, 217500, 230400, 0x1469290f +0, 225000, 230400, 0x8ddfd514 +0, 232500, 230400, 0x1bffa6a1 +0, 240000, 230400, 0x5a04d712 +0, 247500, 230400, 0xaa8de439 +0, 255000, 230400, 0x610c5439 +0, 262500, 230400, 0xd02d3e7c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/smacker b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/smacker new file mode 100644 index 00000000..85c4a981 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/smacker @@ -0,0 +1,186 @@ +0, 0, 192000, 0x8926d7fc +1, 0, 47240, 0xad778a78 +0, 6390, 192000, 0x2506d384 +0, 12780, 192000, 0x9a8dc93a +0, 19170, 192000, 0x4badb7f2 +0, 25560, 192000, 0xc1fc9631 +0, 31950, 192000, 0xfc906592 +0, 38340, 192000, 0xeddd28e2 +0, 44730, 192000, 0xeee0dcf5 +0, 51120, 192000, 0x76798c91 +0, 57510, 192000, 0x8a034c1b +0, 63900, 192000, 0x4df3127c +0, 70290, 192000, 0x2eefd36f +0, 76680, 192000, 0x58a2a1d6 +0, 83070, 192000, 0x1a3d7971 +0, 89460, 192000, 0xa1a65bd5 +0, 95850, 192000, 0x344957b9 +1, 96408, 3128, 0x4c1564ae +0, 102240, 192000, 0xe23b5f4e +1, 102792, 3128, 0x34553309 +0, 108630, 192000, 0xb5c2710b +1, 109176, 3136, 0xb474d246 +0, 115020, 192000, 0x7a25938f +1, 115576, 3128, 0x87b868ea +0, 121410, 192000, 0x0a84e4c9 +1, 121959, 3136, 0xf1516dc3 +0, 127800, 192000, 0x94209b0d +1, 128359, 3128, 0x867563cb +0, 134190, 192000, 0xf940e51f +1, 134743, 3128, 0x5200728c +0, 140580, 192000, 0xb9fdec42 +1, 141127, 3136, 0xeda118a0 +0, 146970, 192000, 0x7b04a376 +1, 147527, 3128, 0x03e2c1d6 +0, 153360, 192000, 0x5fe0026b +1, 153910, 3136, 0xc3e862b6 +0, 159750, 192000, 0x775aca39 +1, 160310, 3128, 0x937a13be +0, 166140, 192000, 0xae14fb32 +1, 166694, 3128, 0x7b1b9577 +0, 172530, 192000, 0x661106e5 +1, 173078, 3136, 0x042c7113 +0, 178920, 192000, 0xe8658dbf +1, 179478, 3128, 0xac48f451 +0, 185310, 192000, 0x5359f0f9 +1, 185861, 3128, 0x018fbbe9 +0, 191700, 192000, 0xc1ec80f4 +1, 192245, 3136, 0xc62aa7ce +0, 198090, 192000, 0xca53806b +1, 198645, 3128, 0x106e3924 +0, 204480, 192000, 0xf0766b2e +1, 205029, 3136, 0xfeb82ecc +0, 210870, 192000, 0x39962da8 +1, 211429, 3128, 0x7e7c005b +0, 217260, 192000, 0x4171c37f +1, 217812, 3128, 0x949d3560 +0, 223650, 192000, 0x3abf3b46 +1, 224196, 3136, 0x02bd4aff +0, 230040, 192000, 0xecc68313 +1, 230596, 3128, 0x4aaf4715 +0, 236430, 192000, 0xea339baf +1, 236980, 3136, 0x2958825f +0, 242820, 192000, 0x616b8f16 +1, 243380, 3128, 0x99a5914d +0, 249210, 192000, 0xf77a8581 +1, 249763, 3128, 0xe67277a4 +0, 255600, 192000, 0xb315678b +1, 256147, 3136, 0x11296973 +0, 261990, 192000, 0x0a4a5218 +1, 262547, 3128, 0x5cc362f7 +0, 268380, 192000, 0x98802be4 +1, 268931, 3128, 0x0c5e6586 +0, 274770, 192000, 0xa2f0fd94 +1, 275314, 3136, 0xe940b0f9 +0, 281160, 192000, 0x6671c84f +1, 281714, 3128, 0x2c9292cc +0, 287550, 192000, 0x38327e31 +1, 288098, 3136, 0xa807c096 +0, 293940, 192000, 0xb85d3e08 +1, 294498, 3128, 0x9d2254d8 +0, 300330, 192000, 0xdc69eba9 +1, 300882, 3128, 0xe68015b0 +0, 306720, 192000, 0x8955a0b3 +1, 307265, 3136, 0x65d58029 +0, 313110, 192000, 0x714a548b +1, 313665, 3128, 0xcffcc48c +0, 319500, 192000, 0xc0471de9 +1, 320049, 3136, 0x8c704944 +0, 325890, 192000, 0x2e16e039 +1, 326449, 3128, 0x1459231d +0, 332280, 192000, 0x9fa4b033 +1, 332833, 3128, 0x7dde4839 +0, 338670, 192000, 0x4a0f9402 +1, 339216, 3136, 0xbb6890e2 +0, 345060, 192000, 0x1f3e6843 +1, 345616, 3128, 0xcd9a8524 +0, 351450, 192000, 0x31774850 +1, 352000, 3128, 0xa244fc31 +0, 357840, 192000, 0x9d5336a2 +1, 358384, 3136, 0x504e2bd9 +0, 364230, 192000, 0xf7de27a2 +1, 364784, 3128, 0x655858d8 +0, 370620, 192000, 0x98c717ce +1, 371167, 3136, 0x46027610 +0, 377010, 192000, 0x615b10b8 +1, 377567, 3128, 0x4192d5e3 +0, 383400, 192000, 0xd5bc0e7e +1, 383951, 3128, 0x21d2e7fe +0, 389790, 192000, 0xd5bc0e7e +1, 390335, 3136, 0x7c93e329 +0, 396180, 192000, 0xd5bc0e7e +1, 396735, 3128, 0xa67718c0 +0, 402570, 192000, 0xd5bc0e7e +1, 403118, 3136, 0x9bb6e8a3 +0, 408960, 192000, 0xd5bc0e7e +1, 409518, 3128, 0x0933b7a6 +0, 415350, 192000, 0xd5bc0e7e +1, 415902, 3128, 0x07f1fb57 +0, 421740, 192000, 0xd5bc0e7e +1, 422286, 3136, 0x8a050cfd +0, 428130, 192000, 0xd5bc0e7e +1, 428686, 3128, 0xdb773c0b +0, 434520, 192000, 0xd5bc0e7e +1, 435069, 3136, 0xd1281c53 +0, 440910, 192000, 0xd5bc0e7e +1, 441469, 3128, 0x9f395324 +0, 447300, 192000, 0xd5bc0e7e +1, 447853, 3128, 0x5f13edec +0, 453690, 192000, 0xd5bc0e7e +1, 454237, 3136, 0x871cbecf +0, 460080, 192000, 0xd5bc0e7e +1, 460637, 3128, 0x799eff3e +0, 466470, 192000, 0xd5bc0e7e +1, 467020, 3128, 0x3f902762 +0, 472860, 192000, 0xd5bc0e7e +1, 473404, 3136, 0x29f8bb04 +0, 479250, 192000, 0xd5bc0e7e +1, 479804, 3128, 0xf3523ee9 +0, 485640, 192000, 0xd5bc0e7e +1, 486188, 3136, 0x4405c435 +0, 492030, 192000, 0xd5bc0e7e +1, 492588, 3128, 0x892957cb +0, 498420, 192000, 0xd5bc0e7e +1, 498971, 3128, 0xdf483dbd +0, 504810, 192000, 0xd5bc0e7e +1, 505355, 3136, 0x5e8ab797 +0, 511200, 192000, 0xd5bc0e7e +1, 511755, 3128, 0x92e13820 +0, 517590, 192000, 0xd5bc0e7e +1, 518139, 3136, 0xfde719b6 +0, 523980, 192000, 0xd5bc0e7e +1, 524539, 3128, 0x442f17ae +0, 530370, 192000, 0xd5bc0e7e +1, 530922, 3128, 0x011af61f +0, 536760, 192000, 0xd5bc0e7e +1, 537306, 3136, 0x4e3e3a6d +0, 543150, 192000, 0xd5bc0e7e +1, 543706, 3128, 0xc11242b9 +0, 549540, 192000, 0xd5bc0e7e +1, 550090, 3128, 0x01415b59 +0, 555930, 192000, 0xd5bc0e7e +1, 556473, 3136, 0x302e0e55 +0, 562320, 192000, 0xd5bc0e7e +1, 562873, 3128, 0x20522d04 +0, 568710, 192000, 0xd5bc0e7e +1, 569257, 3136, 0x316a697d +0, 575100, 192000, 0xd5bc0e7e +1, 575657, 3128, 0x6d75ee27 +0, 581490, 192000, 0xd5bc0e7e +1, 582041, 3128, 0xcb008ae8 +0, 587880, 192000, 0xd5bc0e7e +1, 588424, 3136, 0xd2664b51 +0, 594270, 192000, 0xd5bc0e7e +1, 594824, 3128, 0xdfcab728 +0, 600660, 192000, 0xd5bc0e7e +1, 601208, 3136, 0x00000000 +0, 607050, 192000, 0xd5bc0e7e +1, 607608, 3128, 0x00000000 +0, 613440, 192000, 0xd5bc0e7e +1, 613992, 3128, 0x00000000 +0, 619830, 192000, 0xd5bc0e7e +1, 620376, 3136, 0x00000000 +0, 626220, 192000, 0xd5bc0e7e +1, 626776, 3128, 0x00000000 +0, 632610, 192000, 0xd5bc0e7e +1, 633159, 2856, 0x00000000 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/smc b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/smc new file mode 100644 index 00000000..2901b908 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/smc @@ -0,0 +1,120 @@ +0, 0, 230400, 0xf814fc90 +0, 9000, 230400, 0xe1b13137 +0, 18000, 230400, 0xa7f4d408 +0, 27000, 230400, 0x4b86e1d5 +0, 36000, 230400, 0xc663af5a +0, 45000, 230400, 0x943b5757 +0, 54000, 230400, 0x0d7ee496 +0, 63000, 230400, 0x78792de4 +0, 72000, 230400, 0xd102fb8d +0, 81000, 230400, 0xf9006139 +0, 90000, 230400, 0x216bd87d +0, 99000, 230400, 0x1e4c902c +0, 108000, 230400, 0x5aaa7742 +0, 117000, 230400, 0x48699d93 +0, 126000, 230400, 0xd1e22a5c +0, 135000, 230400, 0x18929315 +0, 144000, 230400, 0x680dd4d3 +0, 153000, 230400, 0x4cdbcbcb +0, 162000, 230400, 0x6f810d98 +0, 171000, 230400, 0xb4f68204 +0, 180000, 230400, 0xbd3bb19e +0, 189000, 230400, 0xab27b424 +0, 198000, 230400, 0xe5dd675d +0, 207000, 230400, 0x811e45a1 +0, 216000, 230400, 0x951011f7 +0, 225000, 230400, 0x2f1e2b99 +0, 234000, 230400, 0x6657c0d6 +0, 243000, 230400, 0xfd29177d +0, 252000, 230400, 0x4b4c01d7 +0, 261000, 230400, 0x9af286aa +0, 270000, 230400, 0xc4e9b193 +0, 279000, 230400, 0x05dc28ec +0, 288000, 230400, 0x68352119 +0, 297000, 230400, 0x0b87e79c +0, 306000, 230400, 0x8358b180 +0, 315000, 230400, 0x8debbc9d +0, 324000, 230400, 0x961c58ce +0, 333000, 230400, 0xd8a809c8 +0, 342000, 230400, 0x5351789d +0, 351000, 230400, 0xa7ca598c +0, 360000, 230400, 0xc5ce1812 +0, 369000, 230400, 0x74496550 +0, 378000, 230400, 0x326e366e +0, 387000, 230400, 0x27ae9a92 +0, 396000, 230400, 0xadbc8794 +0, 405000, 230400, 0x7f3587d8 +0, 414000, 230400, 0xf0400ca6 +0, 423000, 230400, 0x59a5138e +0, 432000, 230400, 0x456d62a5 +0, 441000, 230400, 0xf1a5e5f1 +0, 450000, 230400, 0x75c712e4 +0, 459000, 230400, 0xd160780a +0, 468000, 230400, 0xc6c23cf0 +0, 477000, 230400, 0x0339a2ac +0, 486000, 230400, 0x0e27a2e2 +0, 495000, 230400, 0x84976300 +0, 504000, 230400, 0xb368f3c4 +0, 513000, 230400, 0xa5231fb8 +0, 522000, 230400, 0x17c036d4 +0, 531000, 230400, 0xfc81a2c0 +0, 540000, 230400, 0x99faa403 +0, 549000, 230400, 0xff59efd3 +0, 558000, 230400, 0xcece1d23 +0, 567000, 230400, 0x56c785d9 +0, 576000, 230400, 0xe5a9f222 +0, 585000, 230400, 0xb80946f8 +0, 594000, 230400, 0xf6b642c6 +0, 603000, 230400, 0x69573aed +0, 612000, 230400, 0xfb69a1fd +0, 621000, 230400, 0x100b47f4 +0, 630000, 230400, 0x6edf9543 +0, 639000, 230400, 0x11fdf43c +0, 648000, 230400, 0xd143bf2a +0, 657000, 230400, 0x7ca747c4 +0, 666000, 230400, 0xd984bd73 +0, 675000, 230400, 0xc5477e8d +0, 684000, 230400, 0xf7d58300 +0, 693000, 230400, 0x7a1b9463 +0, 702000, 230400, 0x47a29342 +0, 711000, 230400, 0xdf437f9d +0, 720000, 230400, 0xf836ef5d +0, 729000, 230400, 0xc98937af +0, 738000, 230400, 0x9258695b +0, 747000, 230400, 0xd4fe179c +0, 756000, 230400, 0x35d524d3 +0, 765000, 230400, 0xd9ce5484 +0, 774000, 230400, 0xdef776ed +0, 783000, 230400, 0x154c4057 +0, 792000, 230400, 0xf5c764f1 +0, 801000, 230400, 0x41979b13 +0, 810000, 230400, 0xae4e83db +0, 819000, 230400, 0x09fc0f83 +0, 828000, 230400, 0x60267fdf +0, 837000, 230400, 0xeaafc525 +0, 846000, 230400, 0x80cc35e5 +0, 855000, 230400, 0xd82c6164 +0, 864000, 230400, 0xd68b8111 +0, 873000, 230400, 0x96f874a3 +0, 882000, 230400, 0x7fc861c4 +0, 891000, 230400, 0xb911f310 +0, 900000, 230400, 0x35bbf5aa +0, 909000, 230400, 0xa922b683 +0, 918000, 230400, 0xbf6ae353 +0, 927000, 230400, 0x6bd3984c +0, 936000, 230400, 0xe51768c0 +0, 945000, 230400, 0xee691624 +0, 954000, 230400, 0xd546fed7 +0, 963000, 230400, 0x98d375e6 +0, 972000, 230400, 0x3b9ca990 +0, 981000, 230400, 0x27128ad1 +0, 990000, 230400, 0x2788e38c +0, 999000, 230400, 0xb0cf3381 +0, 1008000, 230400, 0x4fc86d39 +0, 1017000, 230400, 0xf5632fff +0, 1026000, 230400, 0x7fa1e6c2 +0, 1035000, 230400, 0xffeef044 +0, 1044000, 230400, 0x932af385 +0, 1053000, 230400, 0x76738428 +0, 1062000, 230400, 0xf6771ba2 +0, 1071000, 230400, 0x17e2ff27 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sp5x b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sp5x new file mode 100644 index 00000000..ed06a771 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sp5x @@ -0,0 +1,19 @@ +0, 0, 115200, 0x8ebcb7f8 +1, 0, 2048, 0x366ee71c +0, 9234, 115200, 0x1fa8e673 +1, 11520, 2048, 0xc62f0414 +0, 18468, 115200, 0xec07fb6a +1, 23040, 2048, 0x754e0f19 +0, 27702, 115200, 0x6773a8c3 +1, 34560, 2048, 0x4a44152a +0, 36936, 115200, 0x0d279643 +1, 46080, 2048, 0x4fd3ff01 +0, 46170, 115200, 0xb33796e4 +0, 55404, 115200, 0xfe11fc79 +1, 57600, 2048, 0x11c3fa1b +0, 64638, 115200, 0x4ac8e31b +1, 69120, 2048, 0x9945fa06 +0, 73872, 115200, 0x15317942 +1, 80640, 2048, 0x12e5071a +0, 83106, 115200, 0x07803f0e +1, 92160, 44, 0x7ad110e8 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sub-srt b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sub-srt new file mode 100644 index 00000000..5a146643 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sub-srt @@ -0,0 +1 @@ +03b2a3f7e7e83624c8e4d1b5569df758 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-1bit-raw b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-1bit-raw new file mode 100644 index 00000000..40babe74 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-1bit-raw @@ -0,0 +1 @@ +0, 0, 32768, 0x6d16e246 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-1bit-rle b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-1bit-rle new file mode 100644 index 00000000..40babe74 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-1bit-rle @@ -0,0 +1 @@ +0, 0, 32768, 0x6d16e246 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-24bit-raw b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-24bit-raw new file mode 100644 index 00000000..0b0dafc6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-24bit-raw @@ -0,0 +1 @@ +0, 0, 786432, 0xb4d417bf diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-24bit-rle b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-24bit-rle new file mode 100644 index 00000000..0b0dafc6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-24bit-rle @@ -0,0 +1 @@ +0, 0, 786432, 0xb4d417bf diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-8bit-raw b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-8bit-raw new file mode 100644 index 00000000..3f22c8f8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-8bit-raw @@ -0,0 +1 @@ +0, 0, 786432, 0xf4364008 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-8bit-rle b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-8bit-rle new file mode 100644 index 00000000..3f22c8f8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/sunraster-8bit-rle @@ -0,0 +1 @@ +0, 0, 786432, 0xf4364008 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/svq1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/svq1 new file mode 100644 index 00000000..b0486819 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/svq1 @@ -0,0 +1,150 @@ +0, 0, 21600, 0x7f9389e3 +0, 6000, 21600, 0xcebb8896 +0, 12000, 21600, 0xef51860a +0, 18000, 21600, 0x88d97e7d +0, 24000, 21600, 0xc7757c88 +0, 30000, 21600, 0x2f537ade +0, 36000, 21600, 0xd50a7eff +0, 42000, 21600, 0xdcfb7fc6 +0, 48000, 21600, 0x0d608299 +0, 54000, 21600, 0x97ca81b4 +0, 60000, 21600, 0x791f80e7 +0, 66000, 21600, 0x96ae7d33 +0, 72000, 21600, 0x4d7474a8 +0, 78000, 21600, 0x2ae76f37 +0, 84000, 21600, 0x7da76265 +0, 90000, 21600, 0x93ae3eb6 +0, 96000, 21600, 0xebfd3868 +0, 102000, 21600, 0x54f82ffa +0, 108000, 21600, 0x8d5b2ad0 +0, 114000, 21600, 0xe67128e6 +0, 120000, 21600, 0xb7bf613e +0, 126000, 21600, 0xefd0f51b +0, 132000, 21600, 0x31b7da59 +0, 138000, 21600, 0x7a84a8f7 +0, 144000, 21600, 0x0351ad27 +0, 150000, 21600, 0xed6f434d +0, 156000, 21600, 0x0e771127 +0, 162000, 21600, 0x37bf0b95 +0, 168000, 21600, 0x30e10a77 +0, 174000, 21600, 0x1a48288a +0, 180000, 21600, 0xf43c6770 +0, 186000, 21600, 0x3c43ae68 +0, 192000, 21600, 0x04dc0949 +0, 198000, 21600, 0x7920758d +0, 204000, 21600, 0x6c12bab5 +0, 210000, 21600, 0x1ac23706 +0, 216000, 21600, 0x7a95cb5f +0, 222000, 21600, 0xf1bfbb46 +0, 228000, 21600, 0x773d1d0c +0, 234000, 21600, 0x2e7bea65 +0, 240000, 21600, 0xdb1a086f +0, 246000, 21600, 0x5b36b78d +0, 252000, 21600, 0x7b533ca6 +0, 258000, 21600, 0x65d75105 +0, 264000, 21600, 0xfe6f6207 +0, 270000, 21600, 0x44c4ce57 +0, 276000, 21600, 0x220f3dae +0, 282000, 21600, 0xb4d20ffb +0, 288000, 21600, 0x8907ad72 +0, 294000, 21600, 0xc6418998 +0, 300000, 21600, 0x395b6670 +0, 306000, 21600, 0x83495b88 +0, 312000, 21600, 0x8920d683 +0, 318000, 21600, 0xd7fc64ea +0, 324000, 21600, 0x21a3b222 +0, 330000, 21600, 0xc11f2dbd +0, 336000, 21600, 0xd1d5495d +0, 342000, 21600, 0x70f2de20 +0, 348000, 21600, 0x10adc9a9 +0, 354000, 21600, 0xf713c0ec +0, 360000, 21600, 0xa346b3fe +0, 366000, 21600, 0x7945c29b +0, 372000, 21600, 0xb07ceb91 +0, 378000, 21600, 0xe1eaf9ef +0, 384000, 21600, 0x6fa915c7 +0, 390000, 21600, 0x61952055 +0, 396000, 21600, 0x4bca2382 +0, 402000, 21600, 0x36161fe2 +0, 408000, 21600, 0xf93a28f7 +0, 414000, 21600, 0xa02a3d47 +0, 420000, 21600, 0x925b3609 +0, 426000, 21600, 0x5b6941db +0, 432000, 21600, 0x33154a91 +0, 438000, 21600, 0xb1d75c50 +0, 444000, 21600, 0x1cb369bd +0, 450000, 21600, 0x3be4eff2 +0, 456000, 21600, 0xbb89c301 +0, 462000, 21600, 0xc7630d85 +0, 468000, 21600, 0xf7441c67 +0, 474000, 21600, 0xc23611ef +0, 480000, 21600, 0x840efb21 +0, 486000, 21600, 0x7d470a0f +0, 492000, 21600, 0xfe093210 +0, 498000, 21600, 0x0f3ea098 +0, 504000, 21600, 0xcd72286f +0, 510000, 21600, 0x826f8030 +0, 516000, 21600, 0xcda3ace8 +0, 522000, 21600, 0x39cb4cd0 +0, 528000, 21600, 0xa86a60ac +0, 534000, 21600, 0xcd32ed8e +0, 540000, 21600, 0x769b285d +0, 546000, 21600, 0x10234cd0 +0, 552000, 21600, 0x951036b8 +0, 558000, 21600, 0xaef248fa +0, 564000, 21600, 0x74e36e84 +0, 570000, 21600, 0x3908531b +0, 576000, 21600, 0x342f2a9d +0, 582000, 21600, 0x291d58f3 +0, 588000, 21600, 0xcf24b1e5 +0, 594000, 21600, 0x3e7c7959 +0, 600000, 21600, 0x6517e573 +0, 606000, 21600, 0x304cc6db +0, 612000, 21600, 0x272895e4 +0, 618000, 21600, 0x52325837 +0, 624000, 21600, 0xd01344bd +0, 630000, 21600, 0xd25a370b +0, 636000, 21600, 0x274e0ae9 +0, 642000, 21600, 0x6f66138f +0, 648000, 21600, 0xd35a0f60 +0, 654000, 21600, 0xe0610863 +0, 660000, 21600, 0x920b05fb +0, 666000, 21600, 0x5befe39d +0, 672000, 21600, 0xd167bd58 +0, 678000, 21600, 0x653ac504 +0, 684000, 21600, 0x8372c6d7 +0, 690000, 21600, 0x0302c276 +0, 696000, 21600, 0xa176b694 +0, 702000, 21600, 0x4c2e935a +0, 708000, 21600, 0xf7ea844e +0, 714000, 21600, 0x76d6c07b +0, 720000, 21600, 0x0a14d610 +0, 726000, 21600, 0x0ec9f3f3 +0, 732000, 21600, 0xdc90f6ea +0, 738000, 21600, 0xc841f9ef +0, 744000, 21600, 0x7ab5f9b9 +0, 750000, 21600, 0xda40f3c2 +0, 756000, 21600, 0x0040fb72 +0, 762000, 21600, 0x705b0786 +0, 768000, 21600, 0x26d5198d +0, 774000, 21600, 0x6f5153ad +0, 780000, 21600, 0x9f26624b +0, 786000, 21600, 0x0d3ea7af +0, 792000, 21600, 0xb957ca79 +0, 798000, 21600, 0x03a60612 +0, 804000, 21600, 0x3ddc4ff1 +0, 810000, 21600, 0x8fe5697f +0, 816000, 21600, 0x3d199b09 +0, 822000, 21600, 0x97e2b504 +0, 828000, 21600, 0x7563f784 +0, 834000, 21600, 0x9a473879 +0, 840000, 21600, 0x2e2054e5 +0, 846000, 21600, 0x06b3658b +0, 852000, 21600, 0xa37ee249 +0, 858000, 21600, 0xa527efa1 +0, 864000, 21600, 0x12791532 +0, 870000, 21600, 0xc5350145 +0, 876000, 21600, 0xcd44f1ac +0, 882000, 21600, 0xe610edfb +0, 888000, 21600, 0x5642f672 +0, 894000, 21600, 0xf2bc3e5b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/svq3 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/svq3 new file mode 100644 index 00000000..324c363a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/svq3 @@ -0,0 +1,180 @@ +0, 0, 115200, 0x2c810465 +0, 3000, 115200, 0x010b5765 +0, 6000, 115200, 0x2be11a4e +0, 9000, 115200, 0x99445d06 +0, 12000, 115200, 0x6b54d83c +0, 15000, 115200, 0x3832b76a +0, 18000, 115200, 0x3832b76a +0, 21000, 115200, 0xe18385db +0, 24000, 115200, 0x847d4bf0 +0, 27000, 115200, 0x0d650f50 +0, 30000, 115200, 0x4b85c44c +0, 33000, 115200, 0xce1927a6 +0, 36000, 115200, 0x89353747 +0, 39000, 115200, 0x58da43f2 +0, 42000, 115200, 0xee9a4eef +0, 45000, 115200, 0xce9453d9 +0, 48000, 115200, 0x804a5eb0 +0, 51000, 115200, 0xb3d46605 +0, 54000, 115200, 0x45b5668e +0, 57000, 115200, 0xdd0d4c5a +0, 60000, 115200, 0x99101301 +0, 63000, 115200, 0xf0c3f272 +0, 66000, 115200, 0xea21f8b1 +0, 69000, 115200, 0xd8e7fbb1 +0, 72000, 115200, 0x89d90aa1 +0, 75000, 115200, 0x882e19da +0, 78000, 115200, 0xfc0f2709 +0, 81000, 115200, 0x9b732f3f +0, 84000, 115200, 0xec453cda +0, 87000, 115200, 0xa77e4989 +0, 90000, 115200, 0xad935834 +0, 93000, 115200, 0x3a5a6177 +0, 96000, 115200, 0xd3c07999 +0, 99000, 115200, 0xfad388dd +0, 102000, 115200, 0xaf6e9520 +0, 105000, 115200, 0xdb64a4b3 +0, 108000, 115200, 0xc6f9b49e +0, 111000, 115200, 0x4446c315 +0, 114000, 115200, 0x660bd01c +0, 117000, 115200, 0x963fdd7d +0, 120000, 115200, 0x8733e7b3 +0, 123000, 115200, 0x41aaf1d5 +0, 126000, 115200, 0xa803fd81 +0, 129000, 115200, 0xe2b4077f +0, 132000, 115200, 0xfe6707cb +0, 135000, 115200, 0x027c122d +0, 138000, 115200, 0xbcb81ea8 +0, 141000, 115200, 0xd2ac2405 +0, 144000, 115200, 0x3d893006 +0, 147000, 115200, 0xbdcc3ba8 +0, 150000, 115200, 0x83ed4c6b +0, 153000, 115200, 0x69ee5e7c +0, 156000, 115200, 0xfe317411 +0, 159000, 115200, 0x849e84e6 +0, 162000, 115200, 0x040f945f +0, 165000, 115200, 0x6481ac89 +0, 168000, 115200, 0x8a48be9e +0, 171000, 115200, 0xb162ce94 +0, 174000, 115200, 0x178dd69a +0, 177000, 115200, 0x64fdecaa +0, 180000, 115200, 0x4b51297e +0, 183000, 115200, 0x3d39a1ae +0, 186000, 115200, 0x900fd939 +0, 189000, 115200, 0x7704fb19 +0, 192000, 115200, 0xa426137e +0, 195000, 115200, 0x9a112706 +0, 198000, 115200, 0x294931f7 +0, 201000, 115200, 0x0d0e4372 +0, 204000, 115200, 0x33bd50e4 +0, 207000, 115200, 0x9c86e3e2 +0, 210000, 115200, 0x714af5d5 +0, 213000, 115200, 0xc5f9fcd0 +0, 216000, 115200, 0x184602bb +0, 219000, 115200, 0x6958e9e6 +0, 222000, 115200, 0x5a214952 +0, 225000, 115200, 0x706cca0e +0, 228000, 115200, 0x67689363 +0, 231000, 115200, 0x459f410c +0, 234000, 115200, 0xa8f4c365 +0, 237000, 115200, 0xf1fc50c5 +0, 240000, 115200, 0xc22af545 +0, 243000, 115200, 0xd39802a2 +0, 246000, 115200, 0xb76c04b6 +0, 249000, 115200, 0x7a548db4 +0, 252000, 115200, 0x79e56765 +0, 255000, 115200, 0x3f273a17 +0, 258000, 115200, 0xe04366db +0, 261000, 115200, 0x8e10939b +0, 264000, 115200, 0x49220ea2 +0, 267000, 115200, 0x35361889 +0, 270000, 115200, 0x9b20bdfa +0, 273000, 115200, 0x5d472eaf +0, 276000, 115200, 0xeda43081 +0, 279000, 115200, 0x59bae8b4 +0, 282000, 115200, 0xf126d6a4 +0, 285000, 115200, 0x18106464 +0, 288000, 115200, 0x85530c73 +0, 291000, 115200, 0xcef32c78 +0, 294000, 115200, 0xfd6233a0 +0, 297000, 115200, 0xae9d6fc3 +0, 300000, 115200, 0x3d0cce10 +0, 303000, 115200, 0xfce5f124 +0, 306000, 115200, 0x90b10802 +0, 309000, 115200, 0xeea44201 +0, 312000, 115200, 0x1cefb56d +0, 315000, 115200, 0xd6daa0b1 +0, 318000, 115200, 0xd700cef4 +0, 321000, 115200, 0x36dbf58f +0, 324000, 115200, 0xdb20d060 +0, 327000, 115200, 0x5ca61fd5 +0, 330000, 115200, 0x4f271361 +0, 333000, 115200, 0xcaf03743 +0, 336000, 115200, 0x520f351a +0, 339000, 115200, 0x40bc7b89 +0, 342000, 115200, 0xd0af0b08 +0, 345000, 115200, 0x6a45290c +0, 348000, 115200, 0x57210c14 +0, 351000, 115200, 0xc1e233f9 +0, 354000, 115200, 0x96fdfc54 +0, 357000, 115200, 0x43a8359c +0, 360000, 115200, 0xd493bfde +0, 363000, 115200, 0xd5339d13 +0, 366000, 115200, 0x7542baa0 +0, 369000, 115200, 0x268d2cb9 +0, 372000, 115200, 0xaf3888bb +0, 375000, 115200, 0xb82f520a +0, 378000, 115200, 0x0feb2981 +0, 381000, 115200, 0x45314b58 +0, 384000, 115200, 0xb26a193a +0, 387000, 115200, 0xdfdffc38 +0, 390000, 115200, 0xec6a55f5 +0, 393000, 115200, 0xf6e35716 +0, 396000, 115200, 0x5ce8544e +0, 399000, 115200, 0x3e38ddce +0, 402000, 115200, 0x964a2006 +0, 405000, 115200, 0xaba138d6 +0, 408000, 115200, 0x2f46949c +0, 411000, 115200, 0xbdbdb587 +0, 414000, 115200, 0x1bf11e1d +0, 417000, 115200, 0x2632f558 +0, 420000, 115200, 0x0e58078b +0, 423000, 115200, 0x2ab2f9be +0, 426000, 115200, 0x9205f1d8 +0, 429000, 115200, 0x6a4bd949 +0, 432000, 115200, 0xedc1552f +0, 435000, 115200, 0x0a60974d +0, 438000, 115200, 0xe1a1400e +0, 441000, 115200, 0x45f06952 +0, 444000, 115200, 0xc5163125 +0, 447000, 115200, 0x151da156 +0, 450000, 115200, 0x3f34b048 +0, 453000, 115200, 0xcf7c1e5d +0, 456000, 115200, 0xed9c4e1c +0, 459000, 115200, 0x47e06453 +0, 462000, 115200, 0xc8ce6f19 +0, 465000, 115200, 0xac619619 +0, 468000, 115200, 0x64711e2d +0, 471000, 115200, 0x1f502b52 +0, 474000, 115200, 0x39592c9d +0, 477000, 115200, 0x7dffb901 +0, 480000, 115200, 0xc75fa3ce +0, 483000, 115200, 0x625bc977 +0, 486000, 115200, 0x15c7fda3 +0, 489000, 115200, 0x6e5d35b5 +0, 492000, 115200, 0xf847cf88 +0, 495000, 115200, 0xc10867fe +0, 498000, 115200, 0xae07fbfc +0, 501000, 115200, 0xc1571542 +0, 504000, 115200, 0x4c7d5602 +0, 507000, 115200, 0xbe7045aa +0, 510000, 115200, 0xc8b4835b +0, 513000, 115200, 0xf9b7d427 +0, 516000, 115200, 0x7fa7c112 +0, 519000, 115200, 0xe0105feb +0, 522000, 115200, 0x70784740 +0, 525000, 115200, 0xa6801ef5 +0, 528000, 115200, 0x9cf35921 +0, 531000, 115200, 0x4d956630 +0, 534000, 115200, 0x717a25c1 +0, 537000, 115200, 0x8f5e39de diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/thp-mjpeg-adpcm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/thp-mjpeg-adpcm new file mode 100644 index 00000000..b1046d8d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/thp-mjpeg-adpcm @@ -0,0 +1,143 @@ +0, 0, 291840, 0xbd7e0b22 +1, 0, 4312, 0x469714f6 +0, 3003, 291840, 0xf6e12ca5 +1, 3032, 4256, 0xe03dd882 +0, 6006, 291840, 0x528c7049 +1, 6024, 4312, 0x46b901f7 +0, 9009, 291840, 0x93055de9 +1, 9056, 4256, 0x8d4a54e4 +0, 12012, 291840, 0xf95a51c1 +1, 12049, 4256, 0xfd616b67 +0, 15015, 291840, 0x6ad3a65a +1, 15041, 4312, 0xefe62302 +0, 18018, 291840, 0x494684a7 +1, 18073, 4256, 0xab11684e +0, 21021, 291840, 0x74c14eb1 +1, 21066, 4256, 0xb4b3feb8 +0, 24024, 291840, 0x149fcb7e +1, 24058, 4312, 0x71db6461 +0, 27027, 291840, 0x25649761 +1, 27090, 4256, 0x090e5efa +0, 30030, 291840, 0xbc3f9052 +1, 30083, 4256, 0x36f49c28 +0, 33033, 291840, 0x080edfff +1, 33075, 4312, 0x0fe3d262 +0, 36036, 291840, 0x6d7ad684 +1, 36107, 4256, 0x199ce269 +0, 39039, 291840, 0x6d53844d +1, 39099, 4256, 0x98342d05 +0, 42042, 291840, 0xf7ad5385 +1, 42092, 4312, 0xb6fb7ebe +0, 45045, 291840, 0x0241b56a +1, 45124, 4256, 0x033dd562 +0, 48048, 291840, 0x120122c8 +1, 48116, 4256, 0xc2cc17e0 +0, 51051, 291840, 0x31b0f32a +1, 51109, 4312, 0x4bb3ff50 +0, 54054, 291840, 0x14068b98 +1, 54141, 4256, 0x6f2671ef +0, 57057, 291840, 0xeeec658b +1, 57133, 4256, 0x5a337bf4 +0, 60060, 291840, 0x9376374c +1, 60126, 4312, 0xa71f6967 +0, 63063, 291840, 0x091e8c6e +1, 63158, 4256, 0x48084aa9 +0, 66066, 291840, 0x744ad07f +1, 66150, 4256, 0x3cce4218 +0, 69069, 291840, 0xf99c554e +1, 69143, 4312, 0xcbb8f73d +0, 72072, 291840, 0xc84bd677 +1, 72174, 4256, 0x36825021 +0, 75075, 291840, 0x3898d474 +1, 75167, 4256, 0xeae036c6 +0, 78078, 291840, 0x1e2910c8 +1, 78159, 4312, 0x0d650ac6 +0, 81081, 291840, 0xb11f58bc +1, 81191, 4256, 0xfba4f58c +0, 84084, 291840, 0xf89170ee +1, 84184, 4256, 0x54311f9b +0, 87087, 291840, 0x8f239dc3 +1, 87176, 4312, 0x286386b3 +0, 90090, 291840, 0x8538c76c +1, 90208, 4256, 0x871896de +0, 93093, 291840, 0x162ee66f +1, 93201, 4256, 0x9ef9f970 +0, 96096, 291840, 0x5f8708a5 +1, 96193, 4312, 0xf9ae97f1 +0, 99099, 291840, 0x95802dfb +1, 99225, 4256, 0x0ad0d765 +0, 102102, 291840, 0xc424630d +1, 102218, 4256, 0x8e6aa9b5 +0, 105105, 291840, 0xfb8a8667 +1, 105210, 4312, 0x8362787b +0, 108108, 291840, 0xbad79af5 +1, 108242, 4256, 0x9b6a5d9c +0, 111111, 291840, 0xc733b325 +1, 111234, 4256, 0xfb715d8f +0, 114114, 291840, 0x4bfbcd70 +1, 114227, 4312, 0x02bd8075 +0, 117117, 291840, 0x502cd950 +1, 117259, 4256, 0x428eb932 +0, 120120, 291840, 0x8461ca2c +1, 120251, 4256, 0x17ea8c94 +0, 123123, 291840, 0x00219b0d +1, 123244, 4312, 0xb3e761d7 +0, 126126, 291840, 0xa4de45e1 +1, 126276, 4256, 0x0919755a +0, 129129, 291840, 0xacd3f4df +1, 129268, 4256, 0x5e520edd +0, 132132, 291840, 0x2203a369 +1, 132261, 4312, 0x69aa070e +0, 135135, 291840, 0x0a66effa +1, 135293, 4256, 0xf8192f7d +0, 138138, 291840, 0x7ac1fd91 +1, 138285, 4256, 0xaad4475c +0, 141141, 291840, 0x84970aa7 +1, 141278, 4312, 0x0cabcfcb +0, 144144, 291840, 0x569d145f +1, 144309, 4256, 0x952f0f96 +0, 147147, 291840, 0xe51efe1b +1, 147302, 4256, 0x1b805a0c +0, 150150, 291840, 0x38e2cd78 +1, 150294, 4312, 0x93043d2a +0, 153153, 291840, 0x93428ea2 +1, 153326, 4256, 0x38b99e44 +0, 156156, 291840, 0x3d3f5b17 +1, 156319, 4256, 0x60cc52ff +0, 159159, 291840, 0x9546127d +1, 159311, 4312, 0x6a875849 +0, 162162, 291840, 0x4178be54 +1, 162343, 4256, 0xd08d6d0e +0, 165165, 291840, 0x0d0f8036 +1, 165336, 4256, 0x36bfe48e +0, 168168, 291840, 0xc20557b9 +1, 168328, 4312, 0x795c6134 +0, 171171, 291840, 0x6d4b2d64 +1, 171360, 4256, 0x4fd79583 +0, 174174, 291840, 0xa750125d +1, 174353, 4256, 0x65e2ab9f +0, 177177, 291840, 0x04623ce3 +1, 177345, 4312, 0xedeede4a +0, 180180, 291840, 0xc7f2bbc7 +1, 180377, 4256, 0x097e0d09 +0, 183183, 291840, 0x6e271336 +1, 183369, 4256, 0x58afa133 +0, 186186, 291840, 0xcfbd4246 +1, 186362, 4312, 0x442525b5 +0, 189189, 291840, 0xe1493be9 +1, 189394, 4256, 0x6645c591 +0, 192192, 291840, 0x6c731194 +1, 192386, 4256, 0xb0dd948a +0, 195195, 291840, 0x0fc30cc2 +1, 195379, 4312, 0x12684e69 +0, 198198, 291840, 0x967427f3 +1, 198411, 4256, 0xb45098e3 +0, 201201, 291840, 0x55ae3b00 +1, 201403, 4256, 0xb6d3c61c +0, 204204, 291840, 0xbe4f200c +1, 204396, 4312, 0xb46b5b22 +0, 207207, 291840, 0xc515e443 +1, 207428, 4256, 0x9a556830 +0, 210210, 291840, 0xd738bd69 +1, 210420, 4256, 0x67ca2b35 +0, 213213, 291840, 0xa8e0ab69 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/tiertex-seq b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/tiertex-seq new file mode 100644 index 00000000..e4ebf5a2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/tiertex-seq @@ -0,0 +1,149 @@ +1, 0, 1764, 0x00000000 +0, 0, 98304, 0x2e5db4a4 +1, 3600, 1764, 0x80a253d9 +0, 3600, 98304, 0xb20c19d0 +1, 7200, 1764, 0x95a16721 +0, 7200, 98304, 0xb20c19d0 +1, 10800, 1764, 0x0f0d4cb6 +0, 10800, 98304, 0xb20c19d0 +1, 14400, 1764, 0x75026779 +0, 14400, 98304, 0x6b8538c0 +1, 18000, 1764, 0xb4356e37 +0, 18000, 98304, 0x6b8538c0 +1, 21600, 1764, 0xfafa64cb +0, 21600, 98304, 0x6b8538c0 +1, 25200, 1764, 0xe8fd7970 +0, 25200, 98304, 0x172207e3 +1, 28800, 1764, 0x666879b7 +0, 28800, 98304, 0x172207e3 +1, 32400, 1764, 0xf2cd7770 +0, 32400, 98304, 0x172207e3 +1, 36000, 1764, 0x54317a1c +0, 36000, 98304, 0x172207e3 +1, 39600, 1764, 0x9c396930 +0, 39600, 98304, 0x63fb7dc1 +1, 43200, 1764, 0x87115ec4 +0, 43200, 98304, 0x63fb7dc1 +1, 46800, 1764, 0x0c9b69b6 +0, 46800, 98304, 0x63fb7dc1 +1, 50400, 1764, 0x8c3a758a +0, 50400, 98304, 0x37cf1601 +1, 54000, 1764, 0x605d776a +0, 54000, 98304, 0x37cf1601 +1, 57600, 1764, 0x0556852d +0, 57600, 98304, 0x37cf1601 +1, 61200, 1764, 0x7d4363f8 +0, 61200, 98304, 0x37cf1601 +1, 64800, 1764, 0xc5cd75d0 +0, 64800, 98304, 0x82941990 +1, 68400, 1764, 0x3ff3646d +0, 68400, 98304, 0x82941990 +1, 72000, 1764, 0x10136d25 +0, 72000, 98304, 0x82941990 +1, 75600, 1764, 0xeb1a6cd0 +0, 75600, 98304, 0x82941990 +1, 79200, 1764, 0xef937ed1 +0, 79200, 98304, 0xe0a5309e +1, 82800, 1764, 0x2d2b6f79 +0, 82800, 98304, 0xe0a5309e +1, 86400, 1764, 0x6f457231 +0, 86400, 98304, 0xe0a5309e +1, 90000, 1764, 0x56267c9d +0, 90000, 98304, 0x164cb67d +1, 93600, 1764, 0xd49e79c8 +0, 93600, 98304, 0x164cb67d +1, 97200, 1764, 0xc726703d +0, 97200, 98304, 0x164cb67d +1, 100800, 1764, 0x2abf8074 +0, 100800, 98304, 0x164cb67d +1, 104400, 1764, 0xb50c556d +0, 104400, 98304, 0xed2189f8 +1, 108000, 1764, 0xc1f2523c +0, 108000, 98304, 0xed2189f8 +1, 111600, 1764, 0x850a6f93 +0, 111600, 98304, 0xed2189f8 +1, 115200, 1764, 0x8da76c31 +0, 115200, 98304, 0x7215e529 +1, 118800, 1764, 0xfcccdf13 +0, 118800, 98304, 0x7215e529 +1, 122400, 1764, 0x00000000 +0, 122400, 98304, 0x7215e529 +1, 126000, 1764, 0x00000000 +0, 126000, 98304, 0x7215e529 +1, 129600, 1764, 0x00000000 +0, 129600, 98304, 0x170c783b +1, 133200, 1764, 0x00000000 +0, 133200, 98304, 0x170c783b +1, 136800, 1764, 0x00000000 +0, 136800, 98304, 0x170c783b +1, 140400, 1764, 0x00000000 +0, 140400, 98304, 0xf6bd74c7 +1, 144000, 1764, 0x00000000 +0, 144000, 98304, 0xf6bd74c7 +1, 147600, 1764, 0x00000000 +0, 147600, 98304, 0xf6bd74c7 +1, 151200, 1764, 0x00000000 +0, 151200, 98304, 0xf6bd74c7 +1, 154800, 1764, 0x00000000 +0, 154800, 98304, 0x1efd38c4 +1, 158400, 1764, 0x00000000 +0, 158400, 98304, 0x1efd38c4 +1, 162000, 1764, 0x00000000 +0, 162000, 98304, 0x1efd38c4 +1, 165600, 1764, 0x00000000 +0, 165600, 98304, 0x1efd38c4 +1, 169200, 1764, 0x00000000 +0, 169200, 98304, 0x29c26bba +1, 172800, 1764, 0x00000000 +0, 172800, 98304, 0x29c26bba +1, 176400, 1764, 0x00000000 +0, 176400, 98304, 0x29c26bba +1, 180000, 1764, 0x00000000 +0, 180000, 98304, 0x880a6313 +1, 183600, 1764, 0x00000000 +0, 183600, 98304, 0x880a6313 +1, 187200, 1764, 0x00000000 +0, 187200, 98304, 0x880a6313 +1, 190800, 1764, 0x00000000 +0, 190800, 98304, 0x880a6313 +1, 194400, 1764, 0x00000000 +0, 194400, 98304, 0x73f5bb00 +1, 198000, 1764, 0x00000000 +0, 198000, 98304, 0x73f5bb00 +1, 201600, 1764, 0x00000000 +0, 201600, 98304, 0x73f5bb00 +1, 205200, 1764, 0x00000000 +0, 205200, 98304, 0xc85b19ec +1, 208800, 1764, 0x00000000 +0, 208800, 98304, 0xc85b19ec +1, 212400, 1764, 0x00000000 +0, 212400, 98304, 0xc85b19ec +1, 216000, 1764, 0x00000000 +0, 216000, 98304, 0xc85b19ec +1, 219600, 1764, 0x00000000 +0, 219600, 98304, 0x00000000 +1, 223200, 1764, 0x00000000 +0, 223200, 98304, 0x00000000 +1, 226800, 1764, 0x00000000 +0, 226800, 98304, 0x00000000 +1, 230400, 1764, 0x00000000 +0, 230400, 98304, 0x00000000 +1, 234000, 1764, 0x00000000 +0, 234000, 98304, 0x00000000 +1, 237600, 1764, 0x00000000 +0, 237600, 98304, 0x00000000 +1, 241200, 1764, 0x00000000 +0, 241200, 98304, 0x00000000 +1, 244800, 1764, 0x00000000 +0, 244800, 98304, 0x00000000 +1, 248400, 1764, 0x00000000 +0, 248400, 98304, 0x00000000 +1, 252000, 1764, 0x00000000 +0, 252000, 98304, 0x00000000 +1, 255600, 1764, 0x00000000 +0, 255600, 98304, 0x00000000 +1, 259200, 1764, 0x00000000 +1, 262800, 1764, 0x00000000 +1, 266400, 1764, 0x00000000 +1, 270000, 1764, 0x00000000 +1, 273600, 1764, 0x00000000 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/tmv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/tmv new file mode 100644 index 00000000..feca20e0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/tmv @@ -0,0 +1,220 @@ +0, 0, 192000, 0xc698297a +1, 0, 736, 0xf63db497 +0, 1501, 192000, 0x8d5bd6be +1, 1501, 736, 0xbc42caef +0, 3003, 192000, 0x21c32083 +1, 3003, 736, 0x5619a45a +0, 4504, 192000, 0x849cd4c0 +1, 4504, 736, 0x1b8ac0f9 +0, 6006, 192000, 0x8c63a4f0 +1, 6006, 736, 0x55dcac78 +0, 7507, 192000, 0x5dbee9ab +1, 7507, 736, 0xd9f2a266 +0, 9009, 192000, 0x2b12d9bb +1, 9009, 736, 0x22f8af51 +0, 10510, 192000, 0x1a737e17 +1, 10510, 736, 0x838bacb8 +0, 12012, 192000, 0x90536c29 +1, 12012, 736, 0x7b29b4f9 +0, 13513, 192000, 0xd7795243 +1, 13513, 736, 0x5a01b505 +0, 15015, 192000, 0x08847e17 +1, 15015, 736, 0xc330abb4 +0, 16516, 192000, 0x47aa5a3b +1, 16516, 736, 0x84d6c49d +0, 18018, 192000, 0x9435266f +1, 18018, 736, 0xd0a1a588 +0, 19519, 192000, 0x87e7ea9c +1, 19519, 736, 0x9083a382 +0, 21021, 192000, 0x6dc00285 +1, 21021, 736, 0x291eb335 +0, 22522, 192000, 0xf6407ddf +1, 22522, 736, 0xdda2b452 +0, 24024, 192000, 0x55541c09 +1, 24024, 736, 0x82feab67 +0, 25525, 192000, 0xf1c4f5be +1, 25525, 736, 0xfca6b943 +0, 27027, 192000, 0xe59ff74c +1, 27027, 736, 0x2a4ea1fd +0, 28528, 192000, 0x0fedcf04 +1, 28528, 736, 0xbb4bc783 +0, 30030, 192000, 0x04b893dd +1, 30030, 736, 0x8c10a799 +0, 31531, 192000, 0xfef47d83 +1, 31531, 736, 0x8751a53b +0, 33033, 192000, 0x07bde9ed +1, 33033, 736, 0x4b3c9fc3 +0, 34534, 192000, 0xb8003fd2 +1, 34534, 736, 0x5dad9b46 +0, 36036, 192000, 0x4eb6b3ed +1, 36036, 736, 0xe106a3e6 +0, 37537, 192000, 0x320b0b34 +1, 37537, 736, 0xa42a9a3b +0, 39039, 192000, 0x5156e90f +1, 39039, 736, 0xb5069901 +0, 40540, 192000, 0x34778cde +1, 40540, 736, 0x3556c3c3 +0, 42042, 192000, 0xd8d96e44 +1, 42042, 736, 0xa870c1ee +0, 43543, 192000, 0x962ae9f3 +1, 43543, 736, 0xc388b6d8 +0, 45045, 192000, 0x3d29d85a +1, 45045, 736, 0xe167a2b0 +0, 46546, 192000, 0x838554fa +1, 46546, 736, 0x15aeb59d +0, 48048, 192000, 0xd64a3b93 +1, 48048, 736, 0xa576c0bc +0, 49549, 192000, 0x380ef140 +1, 49549, 736, 0x44f3b827 +0, 51051, 192000, 0x076b38c0 +1, 51051, 736, 0xfa5ecd84 +0, 52552, 192000, 0xd9a67c7c +1, 52552, 736, 0xb7b996f6 +0, 54054, 192000, 0xc2849a50 +1, 54054, 736, 0xb390c311 +0, 55555, 192000, 0x9b94a347 +1, 55555, 736, 0xc5a9ab0f +0, 57057, 192000, 0xe3ba9c07 +1, 57057, 736, 0x1a3aa3f6 +0, 58558, 192000, 0xef0011f5 +1, 58558, 736, 0xdaaf9e42 +0, 60060, 192000, 0xa98381e8 +1, 60060, 736, 0xad8fb0ba +0, 61561, 192000, 0x27e5ce9b +1, 61561, 736, 0x9cce9e05 +0, 63063, 192000, 0x8568e33f +1, 63063, 736, 0x70639e6f +0, 64564, 192000, 0x540633b6 +1, 64564, 736, 0xc5e1ba9b +0, 66066, 192000, 0xd8fcfbed +1, 66066, 736, 0x9e6cb422 +0, 67567, 192000, 0x15609e04 +1, 67567, 736, 0x5c559a1e +0, 69069, 192000, 0x7e4f5c9b +1, 69069, 736, 0xb071c2da +0, 70570, 192000, 0xef14950d +1, 70570, 736, 0xd9bdb9eb +0, 72072, 192000, 0x9e0b85b9 +1, 72072, 736, 0x5ecab2d5 +0, 73573, 192000, 0xf3b69b95 +1, 73573, 736, 0x0f78a8fe +0, 75075, 192000, 0x09b6db39 +1, 75075, 736, 0x74ebaccd +0, 76576, 192000, 0x4dc9a300 +1, 76576, 736, 0x2cfab78e +0, 78078, 192000, 0x29d9fdde +1, 78078, 736, 0x32c6c26e +0, 79579, 192000, 0x22e79283 +1, 79579, 736, 0xbe339d74 +0, 81081, 192000, 0x5f5c95aa +1, 81081, 736, 0x2c31b687 +0, 82582, 192000, 0x4d76efde +1, 82582, 736, 0xcbb0b8d5 +0, 84084, 192000, 0xb1d79f6a +1, 84084, 736, 0x17bcb56a +0, 85585, 192000, 0xedfe6012 +1, 85585, 736, 0x116fb70c +0, 87087, 192000, 0x4a56033a +1, 87087, 736, 0xa22eb34f +0, 88588, 192000, 0xdbc9f746 +1, 88588, 736, 0x130bc9bb +0, 90090, 192000, 0xedff8a16 +1, 90090, 736, 0xbb0b77aa +0, 91591, 192000, 0x46b5f843 +1, 91591, 736, 0xafb5a9f0 +0, 93093, 192000, 0xbd12dbfc +1, 93093, 736, 0xaf55f1a3 +0, 94594, 192000, 0xacf2a336 +1, 94594, 736, 0x988e9669 +0, 96096, 192000, 0x13843e7f +1, 96096, 736, 0x4e2cc9ab +0, 97597, 192000, 0x6fda777f +1, 97597, 736, 0x34b3b7ea +0, 99099, 192000, 0x16ffef07 +1, 99099, 736, 0x1252a16b +0, 100600, 192000, 0xb36c06c6 +1, 100600, 736, 0x04279e74 +0, 102102, 192000, 0xd65746b1 +1, 102102, 736, 0x9c2ecb2e +0, 103603, 192000, 0x2817079b +1, 103603, 736, 0x6c16945a +0, 105105, 192000, 0xadb60837 +1, 105105, 736, 0x2c0cc1f9 +0, 106606, 192000, 0x60cb0d87 +1, 106606, 736, 0x52fba868 +0, 108108, 192000, 0x14e5b02b +1, 108108, 736, 0xe2a2a5be +0, 109609, 192000, 0x574fd8f4 +1, 109609, 736, 0x2f56a95b +0, 111111, 192000, 0xffb9a8fa +1, 111111, 736, 0x573196a0 +0, 112612, 192000, 0xc2904a3e +1, 112612, 736, 0xb542c1dc +0, 114114, 192000, 0x22e77c9b +1, 114114, 736, 0x7f6a9964 +0, 115615, 192000, 0xd76d81c2 +1, 115615, 736, 0xc39db324 +0, 117117, 192000, 0xf5b0fcc8 +1, 117117, 736, 0xa2dbb058 +0, 118618, 192000, 0xc452ce4d +1, 118618, 736, 0x8bfac722 +0, 120120, 192000, 0x64a53e4f +1, 120120, 736, 0x5e679406 +0, 121621, 192000, 0xe6c115da +1, 121621, 736, 0xd7a8c2aa +0, 123123, 192000, 0x959d45fe +1, 123123, 736, 0x5ec6a7a0 +0, 124624, 192000, 0xabb270b6 +1, 124624, 736, 0x9f33c47f +0, 126126, 192000, 0x451642b8 +1, 126126, 736, 0x4c4998bf +0, 127627, 192000, 0x028b2202 +1, 127627, 736, 0x2363c344 +0, 129129, 192000, 0xf5d79b86 +1, 129129, 736, 0xecf9a09f +0, 130630, 192000, 0xebe0623e +1, 130630, 736, 0x5a069e69 +0, 132132, 192000, 0x7560d1eb +1, 132132, 736, 0xe2e5b106 +0, 133633, 192000, 0xcbf85785 +1, 133633, 736, 0x7ff4b09e +0, 135135, 192000, 0x180f6aca +1, 135135, 736, 0x0157acd2 +0, 136636, 192000, 0xea8ecb95 +1, 136636, 736, 0x64849b5a +0, 138138, 192000, 0x6a5e3639 +1, 138138, 736, 0x0399b037 +0, 139639, 192000, 0x5aa6c22c +1, 139639, 736, 0xa57ea80f +0, 141141, 192000, 0xdbb50948 +1, 141141, 736, 0x233eb2a4 +0, 142642, 192000, 0x0184a90a +1, 142642, 736, 0x8aa5dfa0 +0, 144144, 192000, 0x0efc1358 +1, 144144, 736, 0x0c9fa877 +0, 145645, 192000, 0x29053255 +1, 145645, 736, 0xbe6faef2 +0, 147147, 192000, 0x3a7e239d +1, 147147, 736, 0xf800c0f2 +0, 148648, 192000, 0x3bd99ca5 +1, 148648, 736, 0x1d68a964 +0, 150150, 192000, 0xe1b5a4d6 +1, 150150, 736, 0x0e4f8872 +0, 151651, 192000, 0xf487f8bb +1, 151651, 736, 0x31c6ed1c +0, 153153, 192000, 0x8b14387c +1, 153153, 736, 0x7448a8d2 +0, 154654, 192000, 0xdaeb9cb4 +1, 154654, 736, 0x79a2ac09 +0, 156156, 192000, 0xdc1d2f5b +1, 156156, 736, 0xbdbfa397 +0, 157657, 192000, 0x4dcab167 +1, 157657, 736, 0xa5deb8bb +0, 159159, 192000, 0x87fcf0d3 +1, 159159, 736, 0x4565d179 +0, 160660, 192000, 0x36d37542 +1, 160660, 736, 0x64d89f91 +0, 162162, 192000, 0x59ba49c5 +1, 162162, 736, 0x32319f68 +0, 163663, 192000, 0xf679b712 +1, 163663, 736, 0x3efdc04f diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/truemotion1-15 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/truemotion1-15 new file mode 100644 index 00000000..747fcb15 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/truemotion1-15 @@ -0,0 +1,218 @@ +1, 0, 10832, 0xe1a811fa +0, 0, 161280, 0x7041748d +1, 5527, 10832, 0xb47841f9 +0, 6000, 161280, 0x3cc4dfb5 +1, 11053, 10832, 0x839eedf1 +0, 12000, 161280, 0xca3af22d +1, 16580, 10832, 0xb48b1f60 +0, 18000, 161280, 0x23ad1d85 +1, 22106, 10832, 0x743936c0 +0, 24000, 161280, 0x9c9cf364 +1, 27633, 10832, 0xe1f039fb +0, 30000, 161280, 0x1551d6a8 +1, 33159, 10832, 0xef00751a +0, 36000, 161280, 0xc39f6b95 +1, 38686, 10832, 0x401ed099 +0, 42000, 161280, 0x3b036dcc +1, 44212, 10832, 0x432a53bd +0, 48000, 161280, 0xa6fac1db +1, 49739, 10832, 0xc4276bfd +0, 54000, 161280, 0x67656b62 +1, 55265, 10832, 0x51f0fa8c +0, 60000, 161280, 0xb41f47d1 +1, 60792, 10832, 0xcebae622 +0, 66000, 161280, 0xc207249e +1, 66318, 10832, 0xe9f6dc1f +1, 71845, 10832, 0xda087fee +0, 72000, 161280, 0xbee8f843 +1, 77371, 10832, 0x67a621bb +0, 78000, 161280, 0x092acf46 +1, 82898, 10832, 0xd7be207f +0, 84000, 161280, 0x8d9e2680 +1, 88424, 10832, 0x19d32507 +0, 90000, 161280, 0x8becc20c +1, 93951, 10832, 0xe1a3fbfa +0, 96000, 161280, 0x655e444e +1, 99478, 10832, 0xd10df779 +0, 102000, 161280, 0x5c112da0 +1, 105004, 10832, 0x4428e1a7 +0, 108000, 161280, 0x232fa9eb +1, 110531, 10832, 0x7ea9b33d +0, 114000, 161280, 0x9721745d +1, 116057, 10832, 0x6852a5a5 +0, 120000, 161280, 0x92f1d880 +1, 121584, 10832, 0xfeb78863 +0, 126000, 161280, 0x16233978 +1, 127110, 10832, 0xf157f928 +0, 132000, 161280, 0x19a27e69 +1, 132637, 10832, 0x86414b3e +0, 138000, 161280, 0x7b6ad73a +1, 138163, 10832, 0x2e28cdf6 +1, 143690, 10832, 0x00212e44 +0, 144000, 161280, 0xa7a674aa +1, 149216, 10832, 0x2d7f9378 +0, 150000, 161280, 0x4e434abb +1, 154743, 10832, 0x84cb25d7 +0, 156000, 161280, 0xb96eea14 +1, 160269, 10832, 0x3aca41fa +0, 162000, 161280, 0x1350188c +1, 165796, 10832, 0x27ad34b9 +0, 168000, 161280, 0x79c6f305 +1, 171322, 10832, 0xe665144a +0, 174000, 161280, 0xa9c7782d +1, 176849, 10832, 0xf9546626 +0, 180000, 161280, 0x40a4f456 +1, 182376, 10832, 0xe71c4f22 +0, 186000, 161280, 0xaf291ed6 +1, 187902, 10832, 0x5e61869c +0, 192000, 161280, 0xab29b4e1 +1, 193429, 10832, 0x571d2c10 +0, 198000, 161280, 0xbfcd2712 +1, 198955, 10832, 0xf0e08cd5 +0, 204000, 161280, 0xff22a0d7 +1, 204482, 10832, 0x66650e49 +0, 210000, 161280, 0xb0ae88a9 +1, 210008, 10832, 0x4024deaf +1, 215535, 10832, 0xda7bdb14 +0, 216000, 161280, 0x811d1259 +1, 221061, 10832, 0xc27a342f +0, 222000, 161280, 0x593c39a1 +1, 226588, 10832, 0x574fe679 +0, 228000, 161280, 0x5a5a97f8 +1, 232114, 10832, 0x37db464e +0, 234000, 161280, 0xa5639ecf +1, 237641, 10832, 0xb1fa2a83 +0, 240000, 161280, 0x543920c6 +1, 243167, 10832, 0x3d98d9b7 +0, 246000, 161280, 0xb41689ee +1, 248694, 10832, 0xb7c908e2 +0, 252000, 161280, 0xc0ad83de +1, 254220, 10832, 0x9f7e44d8 +0, 258000, 161280, 0x9e9e7456 +1, 259747, 10832, 0xae9b8774 +0, 264000, 161280, 0x777ccbfe +1, 265273, 10832, 0x36916e3f +0, 270000, 161280, 0x9c2df916 +1, 270800, 10832, 0xd785f5ef +0, 276000, 161280, 0xe0c13b35 +1, 276327, 10832, 0x2a3a5673 +1, 281853, 10832, 0x7320e379 +0, 282000, 161280, 0x39bfa5a5 +1, 287380, 10832, 0xec787be5 +0, 288000, 161280, 0x35dfb264 +1, 292906, 10832, 0xd0d13aa0 +0, 294000, 161280, 0x43018613 +1, 298433, 10832, 0x34dfcb17 +0, 300000, 161280, 0x43584b8a +1, 303959, 10832, 0x1a9c29f1 +0, 306000, 161280, 0xa5cd230a +1, 309486, 10832, 0x3e73dcc1 +0, 312000, 161280, 0x6fe2cfb3 +1, 315012, 10832, 0x7855b053 +0, 318000, 161280, 0x88a7c0db +1, 320539, 10832, 0x5588df8f +0, 324000, 161280, 0x476f1cd2 +1, 326065, 10832, 0x6f621299 +0, 330000, 161280, 0x96401d49 +1, 331592, 10832, 0xce7f39c2 +0, 336000, 161280, 0x7d932919 +1, 337118, 10832, 0xd88e6552 +0, 342000, 161280, 0x06465481 +1, 342645, 10832, 0xddc63597 +0, 348000, 161280, 0x39631520 +1, 348171, 10832, 0xe3071865 +1, 353698, 10832, 0x2a44a123 +0, 354000, 161280, 0xc3fff780 +1, 359224, 10832, 0x08d85d45 +0, 360000, 161280, 0xa81faf28 +1, 364751, 10832, 0x4dc5f83a +0, 366000, 161280, 0x7a311f4f +1, 370278, 10832, 0x89497812 +0, 372000, 161280, 0x52f9b931 +1, 375804, 10832, 0x9ee1db54 +0, 378000, 161280, 0x938cf016 +1, 381331, 10832, 0x5277d611 +0, 384000, 161280, 0xf8f6e19c +1, 386857, 10832, 0x570a619c +0, 390000, 161280, 0xca90561b +1, 392384, 10832, 0xa217d70f +0, 396000, 161280, 0x8594d06b +1, 397910, 10832, 0x6f0ecbf4 +0, 402000, 161280, 0xea32bf3b +1, 403437, 10832, 0x2704b114 +0, 408000, 161280, 0x4646111a +1, 408963, 10832, 0xf24e679f +0, 414000, 161280, 0xee891162 +1, 414490, 10832, 0x05572099 +0, 420000, 161280, 0xcfc32082 +1, 420016, 10832, 0x33942d0c +1, 425543, 10832, 0xa77ea674 +0, 426000, 161280, 0x863c281a +1, 431069, 10832, 0xeba663bc +0, 432000, 161280, 0x01b591aa +1, 436596, 10832, 0x1338524a +0, 438000, 161280, 0x211fbc62 +1, 442122, 10832, 0x6182b0b3 +0, 444000, 161280, 0xae2bafe2 +1, 447649, 10832, 0xa410a364 +0, 450000, 161280, 0xcfe46dca +1, 453176, 10832, 0x2f4374b0 +0, 456000, 161280, 0xcf8fe8a3 +1, 458702, 10832, 0xf41f3a07 +0, 462000, 161280, 0x3f8474eb +1, 464229, 10832, 0x2b1c50c6 +0, 468000, 161280, 0x06da345a +1, 469755, 10832, 0x3692ac89 +0, 474000, 161280, 0xbd4d3280 +1, 475282, 10832, 0x5d6bc87e +0, 480000, 161280, 0xb5e70fea +1, 480808, 10832, 0x1b1cda0c +0, 486000, 161280, 0x0c99c804 +1, 486335, 10832, 0x11eaa15f +1, 491861, 10832, 0x73c7d7ef +0, 492000, 161280, 0x19841ed4 +1, 497388, 10832, 0x65d7e3be +0, 498000, 161280, 0xf81dea50 +1, 502914, 10832, 0xb9c00688 +0, 504000, 161280, 0x7777d81c +1, 508441, 10832, 0x0b98c125 +0, 510000, 161280, 0x0497cfd8 +1, 513967, 10832, 0x331ed413 +0, 516000, 161280, 0x50b6eb64 +1, 519494, 10832, 0x9b68f485 +0, 522000, 161280, 0x5071fc07 +1, 525020, 10832, 0x1b865c55 +0, 528000, 161280, 0xbb7527fb +1, 530547, 10832, 0x68cef565 +0, 534000, 161280, 0x13054f1f +1, 536073, 10832, 0x3a605f15 +0, 540000, 161280, 0x4b78fb27 +1, 541600, 10832, 0xd72ff22e +0, 546000, 161280, 0xf504968f +1, 547127, 10832, 0x1c672b67 +0, 552000, 161280, 0x555b10b7 +1, 552653, 10832, 0xfd1a7e7e +0, 558000, 161280, 0xcc0dde40 +1, 558180, 10832, 0x9bf20ead +1, 563706, 10832, 0x00000000 +0, 564000, 161280, 0xcc0dde40 +1, 569233, 10832, 0x00000000 +0, 570000, 161280, 0x367f60c8 +1, 574759, 10832, 0x00000000 +0, 576000, 161280, 0x367f60c8 +1, 580286, 10832, 0x00000000 +0, 582000, 161280, 0x367f60c8 +1, 585812, 10832, 0x00000000 +0, 588000, 161280, 0x367f60c8 +1, 591339, 10832, 0x00000000 +0, 594000, 161280, 0x367f60c8 +1, 596865, 10832, 0x00000000 +0, 600000, 161280, 0x367f60c8 +1, 602392, 10832, 0x00000000 +0, 606000, 161280, 0x367f60c8 +1, 607918, 10832, 0x00000000 +0, 612000, 161280, 0x367f60c8 +1, 613445, 10832, 0x00000000 +0, 618000, 161280, 0x367f60c8 +1, 618971, 10832, 0x00000000 +0, 624000, 161280, 0x367f60c8 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/truemotion1-24 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/truemotion1-24 new file mode 100644 index 00000000..a4e12030 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/truemotion1-24 @@ -0,0 +1,43 @@ +1, 0, 10832, 0x1597b4c8 +0, 0, 69120, 0x68beb30f +1, 5527, 10832, 0xf9479f8b +0, 6000, 69120, 0x3976f5cf +1, 11053, 10832, 0x8db50e74 +0, 12000, 69120, 0xf815bc3c +1, 16580, 10832, 0x2b33ecbb +0, 18000, 69120, 0xa7cc0ae6 +1, 22106, 10832, 0x8d0f537b +0, 24000, 69120, 0xd85ac282 +1, 27633, 10832, 0x922081c7 +0, 30000, 69120, 0xf7fd7edb +1, 33159, 10832, 0x40291f19 +0, 36000, 69120, 0x433bb6f6 +1, 38686, 10832, 0x88f5271a +0, 42000, 69120, 0xdbac8bee +1, 44212, 10832, 0x55c6bbe5 +0, 48000, 69120, 0x88e2a799 +1, 49739, 10832, 0x9b51ae82 +0, 54000, 69120, 0x49617b26 +1, 55265, 10832, 0xcdf2409b +0, 60000, 69120, 0xeb44ca01 +1, 60792, 10832, 0x0933b1a4 +0, 66000, 69120, 0x6fea37e8 +1, 66318, 10832, 0x24b77006 +1, 71845, 10832, 0xf612fa8a +0, 72000, 69120, 0xf55d74c7 +1, 77371, 10832, 0x99884b06 +0, 78000, 69120, 0xb5082ca7 +1, 82898, 10832, 0x3c746fbe +0, 84000, 69120, 0x5876d758 +1, 88424, 10832, 0x05f3b08a +1, 93951, 10832, 0xa6560483 +1, 99478, 10832, 0xd98a8e19 +1, 105004, 10832, 0xf98a0b2e +1, 110531, 10832, 0xb1039582 +1, 116057, 10832, 0x85dd5c3f +1, 121584, 10832, 0x19fc801a +1, 127110, 10832, 0x95805089 +1, 132637, 10832, 0x576fdec3 +1, 138163, 10832, 0x704a0905 +1, 143690, 10832, 0xf87ce1fa +1, 149216, 10832, 0xfc0076b9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/tscc-15bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/tscc-15bit new file mode 100644 index 00000000..fb4d558e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/tscc-15bit @@ -0,0 +1,240 @@ +1, 0, 22050, 0x1740aaec +0, 0, 657600, 0xaf456809 +0, 6000, 657600, 0xaf456809 +0, 12000, 657600, 0xaf456809 +0, 18000, 657600, 0x2dbe6889 +0, 24000, 657600, 0x2dbe6889 +0, 30000, 657600, 0x2dbe6889 +0, 36000, 657600, 0x2dbe6889 +0, 42000, 657600, 0x2dbe6889 +0, 48000, 657600, 0x2dbe6889 +0, 54000, 657600, 0x2dbe6889 +0, 60000, 657600, 0x2dbe6889 +0, 66000, 657600, 0x2dbe6889 +0, 72000, 657600, 0x2dbe6889 +0, 78000, 657600, 0x2dbe6889 +0, 84000, 657600, 0x2dbe6889 +1, 90000, 22050, 0x75ed6086 +0, 90000, 657600, 0x2dbe6889 +0, 96000, 657600, 0x2dbe6889 +0, 102000, 657600, 0x2dbe6889 +0, 108000, 657600, 0x2dbe6889 +0, 114000, 657600, 0x2dbe6889 +0, 120000, 657600, 0x2dbe6889 +0, 126000, 657600, 0x92796e59 +0, 132000, 657600, 0x92796e59 +0, 138000, 657600, 0x92796e59 +0, 144000, 657600, 0x64cb6889 +0, 150000, 657600, 0x64cb6889 +0, 156000, 657600, 0x64cb6889 +0, 162000, 657600, 0x64cb6889 +0, 168000, 657600, 0x64cb6889 +0, 174000, 657600, 0x64cb6889 +1, 180000, 22050, 0xca52a4e9 +0, 180000, 657600, 0x42036b71 +0, 186000, 657600, 0x42036b71 +0, 192000, 657600, 0x42036b71 +0, 198000, 657600, 0xc40a6889 +0, 204000, 657600, 0xc40a6889 +0, 210000, 657600, 0xc40a6889 +0, 216000, 657600, 0xaa6f7429 +0, 222000, 657600, 0xaa6f7429 +0, 228000, 657600, 0xaa6f7429 +0, 234000, 657600, 0x854172d9 +0, 240000, 657600, 0x854172d9 +0, 246000, 657600, 0x854172d9 +0, 252000, 657600, 0x22d10de0 +0, 258000, 657600, 0xa75f0d60 +0, 264000, 657600, 0x7a440be0 +1, 270000, 22050, 0xb306d419 +0, 270000, 657600, 0x40095d50 +0, 276000, 657600, 0x40095d50 +0, 282000, 657600, 0x64766320 +0, 288000, 657600, 0x64766320 +0, 294000, 657600, 0x64766320 +0, 300000, 657600, 0x64766320 +0, 306000, 657600, 0x64766320 +0, 312000, 657600, 0x64766320 +0, 318000, 657600, 0x64766320 +0, 324000, 657600, 0x64766320 +0, 330000, 657600, 0x64766320 +0, 336000, 657600, 0x64766320 +0, 342000, 657600, 0xf51adc49 +0, 348000, 657600, 0xf51adc49 +0, 354000, 657600, 0xf51adc49 +1, 360000, 22050, 0x8cbb9625 +0, 360000, 657600, 0xdd47af59 +0, 366000, 657600, 0xdd47af59 +0, 372000, 657600, 0xffa8acf1 +0, 378000, 657600, 0x5994b059 +0, 384000, 657600, 0x5994b059 +0, 390000, 657600, 0x5994b059 +0, 396000, 657600, 0x03ffae71 +0, 402000, 657600, 0x03ffae71 +0, 408000, 657600, 0x03ffae71 +0, 414000, 657600, 0xe33ab89e +0, 420000, 657600, 0xe33ab89e +0, 426000, 657600, 0xe33ab89e +0, 432000, 657600, 0xbe37b549 +0, 438000, 657600, 0xbe37b549 +0, 444000, 657600, 0x1d395bf9 +1, 450000, 22050, 0x34a11f66 +0, 450000, 657600, 0x1d395bf9 +0, 456000, 657600, 0x1d395bf9 +0, 462000, 657600, 0x1d395bf9 +0, 468000, 657600, 0x2ec36f37 +0, 474000, 657600, 0x2ec36f37 +0, 480000, 657600, 0xb04a6eb7 +0, 486000, 657600, 0x66610458 +0, 492000, 657600, 0x66610458 +0, 498000, 657600, 0xaf8901f0 +0, 504000, 657600, 0x3ae41c48 +0, 510000, 657600, 0x5b870b70 +0, 516000, 657600, 0x11490c60 +0, 522000, 657600, 0x70064801 +0, 528000, 657600, 0x80d54519 +0, 534000, 657600, 0xe8c942b1 +1, 540000, 22050, 0x1ae81230 +0, 540000, 657600, 0x830d8c24 +0, 546000, 657600, 0x830d8c24 +0, 552000, 657600, 0x830d8c24 +0, 558000, 657600, 0xf3c4707c +0, 564000, 657600, 0x6ace707c +0, 570000, 657600, 0x6ace707c +0, 576000, 657600, 0x6ace707c +0, 582000, 657600, 0x6ace707c +0, 588000, 657600, 0x6ace707c +0, 594000, 657600, 0x5f461aae +0, 600000, 657600, 0x5f461aae +0, 606000, 657600, 0x221ceecf +0, 612000, 657600, 0x221ceecf +0, 618000, 657600, 0x221ceecf +0, 624000, 657600, 0x221ceecf +1, 630000, 22050, 0x1217eeba +0, 630000, 657600, 0x221ceecf +0, 636000, 657600, 0x221ceecf +0, 642000, 657600, 0x221ceecf +0, 648000, 657600, 0x3bf6f39f +0, 654000, 657600, 0x3bf6f39f +0, 660000, 657600, 0x3bf6f39f +0, 666000, 657600, 0xc2caeecf +0, 672000, 657600, 0xc2caeecf +0, 678000, 657600, 0xc2caeecf +0, 684000, 657600, 0xc316d63e +0, 690000, 657600, 0xc316d63e +0, 696000, 657600, 0xc316d63e +0, 702000, 657600, 0x41f6218d +0, 708000, 657600, 0x41f6218d +0, 714000, 657600, 0x41f6218d +1, 720000, 22050, 0x50e70baa +0, 720000, 657600, 0xff43ec36 +0, 726000, 657600, 0x0b10eb16 +0, 732000, 657600, 0x0b10eb16 +0, 738000, 657600, 0xbdf41aa5 +0, 744000, 657600, 0xbdf41aa5 +0, 750000, 657600, 0xbdf41aa5 +0, 756000, 657600, 0xd502ca06 +0, 762000, 657600, 0xd502ca06 +0, 768000, 657600, 0xd502ca06 +0, 774000, 657600, 0x8446f89e +0, 780000, 657600, 0x8446f89e +0, 786000, 657600, 0x8446f89e +0, 792000, 657600, 0x3d4ccf06 +0, 798000, 657600, 0x0897d1de +0, 804000, 657600, 0x0897d1de +1, 810000, 22050, 0xb19e89c0 +0, 810000, 657600, 0x3e27e01e +0, 816000, 657600, 0x3e27e01e +0, 822000, 657600, 0x3e27e01e +0, 828000, 657600, 0x3e27e01e +0, 834000, 657600, 0x3e27e01e +0, 840000, 657600, 0x3e27e01e +0, 846000, 657600, 0xe51078a8 +0, 852000, 657600, 0xe51078a8 +0, 858000, 657600, 0xe9967a40 +0, 864000, 657600, 0xe9967a40 +0, 870000, 657600, 0xe9967a40 +0, 876000, 657600, 0xe9967a40 +0, 882000, 657600, 0xe9967a40 +0, 888000, 657600, 0xe9967a40 +0, 894000, 657600, 0xe9967a40 +1, 900000, 22050, 0x78526696 +0, 900000, 657600, 0x726cb6b8 +0, 906000, 657600, 0x2960b6e8 +0, 912000, 657600, 0x2960b6e8 +0, 918000, 657600, 0x1637d6c8 +0, 924000, 657600, 0x6f2fd9b0 +0, 930000, 657600, 0x27a7d6c8 +0, 936000, 657600, 0xe855d6c8 +0, 942000, 657600, 0xe855d6c8 +0, 948000, 657600, 0xe855d6c8 +0, 954000, 657600, 0x1a8ad6c8 +0, 960000, 657600, 0x9c11d648 +0, 966000, 657600, 0x6136d648 +0, 972000, 657600, 0xdfa0d6c8 +0, 978000, 657600, 0xdfa0d6c8 +0, 984000, 657600, 0xdfa0d6c8 +1, 990000, 22050, 0x48e3bb21 +0, 990000, 657600, 0xdfa0d6c8 +0, 996000, 657600, 0xdfa0d6c8 +0, 1002000, 657600, 0xdfa0d6c8 +0, 1008000, 657600, 0xdfa0d6c8 +0, 1014000, 657600, 0xdfa0d6c8 +0, 1020000, 657600, 0xdfa0d6c8 +0, 1026000, 657600, 0x125cd9b0 +0, 1032000, 657600, 0x125cd9b0 +0, 1038000, 657600, 0x8a7ed6c8 +0, 1044000, 657600, 0x09a6d9b0 +0, 1050000, 657600, 0x09a6d9b0 +0, 1056000, 657600, 0x09a6d9b0 +0, 1062000, 657600, 0x85e87a68 +0, 1068000, 657600, 0x85e87a68 +0, 1074000, 657600, 0x85e87a68 +1, 1080000, 22050, 0xbc32204a +0, 1080000, 657600, 0xb0a141a8 +0, 1086000, 657600, 0xb0a141a8 +0, 1092000, 657600, 0xf3333bd8 +0, 1098000, 657600, 0xea090688 +0, 1104000, 657600, 0xa017fe41 +0, 1110000, 657600, 0xa017fe41 +0, 1116000, 657600, 0x32e93bd8 +0, 1122000, 657600, 0x7fe640c0 +0, 1128000, 657600, 0x7fe640c0 +0, 1134000, 657600, 0xcd8995b2 +0, 1140000, 657600, 0x84278a92 +0, 1146000, 657600, 0x84278a92 +0, 1152000, 657600, 0xf1d2874a +0, 1158000, 657600, 0xf1d2874a +0, 1164000, 657600, 0xf1d2874a +1, 1170000, 22050, 0xdf6f1e46 +0, 1170000, 657600, 0xa58d6742 +0, 1176000, 657600, 0xa58d6742 +0, 1182000, 657600, 0xa58d6742 +0, 1188000, 657600, 0xb0cd11bb +0, 1194000, 657600, 0xb0cd11bb +0, 1200000, 657600, 0xc55610bb +0, 1206000, 657600, 0x4ee1168b +0, 1212000, 657600, 0x61c513a3 +0, 1218000, 657600, 0xd26410bb +0, 1224000, 657600, 0xe7c410bb +0, 1230000, 657600, 0x444a0dd3 +0, 1236000, 657600, 0x444a0dd3 +0, 1242000, 657600, 0x97ac10bb +0, 1248000, 657600, 0x97ac10bb +0, 1254000, 657600, 0xe8b30dd3 +1, 1260000, 22050, 0x4c91da9d +0, 1260000, 657600, 0x3d0c10bb +0, 1266000, 657600, 0x8d2b0dd3 +0, 1272000, 657600, 0x8d2b0dd3 +0, 1278000, 657600, 0xa5760dd3 +0, 1284000, 657600, 0xa5760dd3 +0, 1290000, 657600, 0xa5760dd3 +0, 1296000, 657600, 0x31a30dd3 +0, 1302000, 657600, 0x31a30dd3 +0, 1308000, 657600, 0x31a30dd3 +0, 1314000, 657600, 0x31a30dd3 +0, 1320000, 657600, 0x31a30dd3 +0, 1326000, 657600, 0x31a30dd3 +0, 1332000, 657600, 0x31a30dd3 +0, 1338000, 657600, 0x31a30dd3 +0, 1344000, 657600, 0x31a30dd3 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/tscc-32bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/tscc-32bit new file mode 100644 index 00000000..dd888a85 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/tscc-32bit @@ -0,0 +1,159 @@ +0, 0, 2359296, 0x76cccaa7 +0, 6000, 2359296, 0x09c52bbf +0, 12000, 2359296, 0xc8746009 +0, 18000, 2359296, 0xe48ff59b +0, 24000, 2359296, 0xa2f1fddb +0, 30000, 2359296, 0xbb0e0026 +0, 36000, 2359296, 0x66a905ab +0, 42000, 2359296, 0xe990f855 +0, 48000, 2359296, 0xe990f855 +0, 54000, 2359296, 0x3ec2c64e +0, 60000, 2359296, 0xda3ba3cf +0, 66000, 2359296, 0xda3ba3cf +0, 72000, 2359296, 0xda3ba3cf +0, 78000, 2359296, 0x60a070fd +0, 84000, 2359296, 0x42e5fedc +0, 90000, 2359296, 0x42e5fedc +0, 96000, 2359296, 0x699cf990 +0, 102000, 2359296, 0x699cf990 +0, 108000, 2359296, 0x699cf990 +0, 114000, 2359296, 0x699cf990 +0, 120000, 2359296, 0x699cf990 +0, 126000, 2359296, 0x699cf990 +0, 132000, 2359296, 0x699cf990 +0, 138000, 2359296, 0x1524160c +0, 144000, 2359296, 0x1524160c +0, 150000, 2359296, 0x1524160c +0, 156000, 2359296, 0x1524160c +0, 162000, 2359296, 0x1524160c +0, 168000, 2359296, 0x1524160c +0, 174000, 2359296, 0x1524160c +0, 180000, 2359296, 0x33df0c8c +0, 186000, 2359296, 0x33df0c8c +0, 192000, 2359296, 0x33df0c8c +0, 198000, 2359296, 0x33df0c8c +0, 204000, 2359296, 0x33df0c8c +0, 210000, 2359296, 0x33df0c8c +0, 216000, 2359296, 0x33df0c8c +0, 222000, 2359296, 0xfe3d29f8 +0, 228000, 2359296, 0xfe3d29f8 +0, 234000, 2359296, 0xfe3d29f8 +0, 240000, 2359296, 0xfe3d29f8 +0, 246000, 2359296, 0xfe3d29f8 +0, 252000, 2359296, 0xfe3d29f8 +0, 258000, 2359296, 0xfe3d29f8 +0, 264000, 2359296, 0x1b9d197f +0, 270000, 2359296, 0x1b9d197f +0, 276000, 2359296, 0x1b9d197f +0, 282000, 2359296, 0x1b9d197f +0, 288000, 2359296, 0x1b9d197f +0, 294000, 2359296, 0x1b9d197f +0, 300000, 2359296, 0x1b9d197f +0, 306000, 2359296, 0x48c126fb +0, 312000, 2359296, 0x48c126fb +0, 318000, 2359296, 0x48c126fb +0, 324000, 2359296, 0x48c126fb +0, 330000, 2359296, 0x48c126fb +0, 336000, 2359296, 0x48c126fb +0, 342000, 2359296, 0x48c126fb +0, 348000, 2359296, 0xcaa31c7c +0, 354000, 2359296, 0xcaa31c7c +0, 360000, 2359296, 0xcaa31c7c +0, 366000, 2359296, 0xcaa31c7c +0, 372000, 2359296, 0xcaa31c7c +0, 378000, 2359296, 0xcaa31c7c +0, 384000, 2359296, 0xcaa31c7c +0, 390000, 2359296, 0xc6a333ee +0, 396000, 2359296, 0xc6a333ee +0, 402000, 2359296, 0xc6a333ee +0, 408000, 2359296, 0xc6a333ee +0, 414000, 2359296, 0xc6a333ee +0, 420000, 2359296, 0xc6a333ee +0, 426000, 2359296, 0xc6a333ee +0, 432000, 2359296, 0xb96d1583 +0, 438000, 2359296, 0xb96d1583 +0, 444000, 2359296, 0xb96d1583 +0, 450000, 2359296, 0xb96d1583 +0, 456000, 2359296, 0xb96d1583 +0, 462000, 2359296, 0xb96d1583 +0, 468000, 2359296, 0xb96d1583 +0, 474000, 2359296, 0x878135ec +0, 480000, 2359296, 0x878135ec +0, 486000, 2359296, 0x878135ec +0, 492000, 2359296, 0x878135ec +0, 498000, 2359296, 0x878135ec +0, 504000, 2359296, 0x878135ec +0, 510000, 2359296, 0x878135ec +0, 516000, 2359296, 0x878135ec +0, 522000, 2359296, 0x76922870 +0, 528000, 2359296, 0x76922870 +0, 534000, 2359296, 0x76922870 +0, 540000, 2359296, 0x76922870 +0, 546000, 2359296, 0x76922870 +0, 552000, 2359296, 0x76922870 +0, 558000, 2359296, 0x76922870 +0, 564000, 2359296, 0xb0e031f0 +0, 570000, 2359296, 0xb0e031f0 +0, 576000, 2359296, 0xb0e031f0 +0, 582000, 2359296, 0xb0e031f0 +0, 588000, 2359296, 0xb0e031f0 +0, 594000, 2359296, 0xb0e031f0 +0, 600000, 2359296, 0xb0e031f0 +0, 606000, 2359296, 0xb2ef2a6e +0, 612000, 2359296, 0xb2ef2a6e +0, 618000, 2359296, 0xb2ef2a6e +0, 624000, 2359296, 0x083c2474 +0, 630000, 2359296, 0x083c2474 +0, 636000, 2359296, 0x083c2474 +0, 642000, 2359296, 0x083c2474 +0, 648000, 2359296, 0xbdfe2ef3 +0, 654000, 2359296, 0xbdfe2ef3 +0, 660000, 2359296, 0xbdfe2ef3 +0, 666000, 2359296, 0xbdfe2ef3 +0, 672000, 2359296, 0xbdfe2ef3 +0, 678000, 2359296, 0xbdfe2ef3 +0, 684000, 2359296, 0xbdfe2ef3 +0, 690000, 2359296, 0x934b1484 +0, 696000, 2359296, 0x934b1484 +0, 702000, 2359296, 0x934b1484 +0, 708000, 2359296, 0x934b1484 +0, 714000, 2359296, 0x3e0d1a7e +0, 720000, 2359296, 0x3e0d1a7e +0, 726000, 2359296, 0x3e0d1a7e +0, 732000, 2359296, 0x3ce539e8 +0, 738000, 2359296, 0x3ce539e8 +0, 744000, 2359296, 0x3ce539e8 +0, 750000, 2359296, 0x3ce539e8 +0, 756000, 2359296, 0x3ce539e8 +0, 762000, 2359296, 0x3ce539e8 +0, 768000, 2359296, 0x3ce539e8 +0, 774000, 2359296, 0xd46c2f69 +0, 780000, 2359296, 0xd46c2f69 +0, 786000, 2359296, 0xd46c2f69 +0, 792000, 2359296, 0xd46c2f69 +0, 798000, 2359296, 0xd46c2f69 +0, 804000, 2359296, 0xd46c2f69 +0, 810000, 2359296, 0xd46c2f69 +0, 816000, 2359296, 0x8d2933ee +0, 822000, 2359296, 0x8d2933ee +0, 828000, 2359296, 0x8d2933ee +0, 834000, 2359296, 0x8d2933ee +0, 840000, 2359296, 0x8d2933ee +0, 846000, 2359296, 0x8d2933ee +0, 852000, 2359296, 0x8d2933ee +0, 858000, 2359296, 0xb6092b6d +0, 864000, 2359296, 0xb6092b6d +0, 870000, 2359296, 0xb6092b6d +0, 876000, 2359296, 0xb6092b6d +0, 882000, 2359296, 0xb6092b6d +0, 888000, 2359296, 0xb6092b6d +0, 894000, 2359296, 0xb6092b6d +0, 900000, 2359296, 0xe4ef27fa +0, 906000, 2359296, 0xe4ef27fa +0, 912000, 2359296, 0xe4ef27fa +0, 918000, 2359296, 0xe4ef27fa +0, 924000, 2359296, 0xe4ef27fa +0, 930000, 2359296, 0xe4ef27fa +0, 936000, 2359296, 0xe4ef27fa +0, 942000, 2359296, 0x5e5b2672 +0, 948000, 2359296, 0x5e5b2672 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/txd-16bpp b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/txd-16bpp new file mode 100644 index 00000000..aa5979e2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/txd-16bpp @@ -0,0 +1,11 @@ +0, 0, 16384, 0x213f9ea8 +0, 18000, 16384, 0x8185fdb1 +0, 36000, 16384, 0xf03581d1 +0, 54000, 16384, 0x629cd573 +0, 72000, 16384, 0xfe7a5b63 +0, 90000, 16384, 0x4afc05b2 +0, 108000, 16384, 0x074b8515 +0, 126000, 16384, 0x17fde900 +0, 144000, 16384, 0x831bac76 +0, 162000, 16384, 0x2fb579f3 +0, 180000, 16384, 0x68762bed diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/txd-pal8 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/txd-pal8 new file mode 100644 index 00000000..8d8f2a5f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/txd-pal8 @@ -0,0 +1 @@ +0, 0, 786432, 0x56654d61 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ulti b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ulti new file mode 100644 index 00000000..820dcfda --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ulti @@ -0,0 +1,62 @@ +0, 0, 86400, 0x5d58253d +0, 7500, 86400, 0x0626d90d +0, 15000, 86400, 0x4ecb5048 +0, 22500, 86400, 0xf54ea8f7 +0, 30000, 86400, 0xa777c21b +0, 37500, 86400, 0x7d71e329 +0, 45000, 86400, 0x2903252a +0, 52500, 86400, 0xbe7302c1 +0, 60000, 86400, 0x734423a8 +0, 67500, 86400, 0x4f422bab +0, 75000, 86400, 0x21fbf200 +0, 82500, 86400, 0xabf299a7 +0, 90000, 86400, 0x400b4bf8 +0, 97500, 86400, 0x61d044f9 +0, 105000, 86400, 0x72fb94af +0, 112500, 86400, 0xf522e717 +0, 120000, 86400, 0xad3e0297 +0, 127500, 86400, 0xbef57a5f +0, 135000, 86400, 0x450ca6e7 +0, 142500, 86400, 0x76ae56e6 +0, 150000, 86400, 0x7b9b7555 +0, 157500, 86400, 0xb522ce0d +0, 165000, 86400, 0xaa9b8536 +0, 172500, 86400, 0x019d00c4 +0, 180000, 86400, 0xb0f4dee5 +0, 187500, 86400, 0xa7482e52 +0, 195000, 86400, 0x3c87fc35 +0, 202500, 86400, 0xb6d1dede +0, 210000, 86400, 0x926ee647 +0, 217500, 86400, 0x8747bfc7 +0, 225000, 86400, 0x61569e9b +0, 232500, 86400, 0x9209a5f6 +0, 240000, 86400, 0x5f89ef12 +0, 247500, 86400, 0x00bfc18f +0, 255000, 86400, 0xcc6f2f62 +0, 262500, 86400, 0x3ab9cfbf +0, 270000, 86400, 0x936f2386 +0, 277500, 86400, 0x2203a76c +0, 285000, 86400, 0xd3d248a3 +0, 292500, 86400, 0x148af7b8 +0, 300000, 86400, 0x437bffae +0, 307500, 86400, 0x6876c6d5 +0, 315000, 86400, 0x49fc1429 +0, 322500, 86400, 0x181efd2c +0, 330000, 86400, 0x26ecd294 +0, 337500, 86400, 0xdcdb609e +0, 345000, 86400, 0xd3cb0ecb +0, 352500, 86400, 0x528ffc4b +0, 360000, 86400, 0xb536c7b4 +0, 367500, 86400, 0xae4ab8c5 +0, 375000, 86400, 0xe14fee77 +0, 382500, 86400, 0xcd3e9e85 +0, 390000, 86400, 0x71cfba54 +0, 397500, 86400, 0x9b309c62 +0, 405000, 86400, 0x91b31881 +0, 412500, 86400, 0xae8bda28 +0, 420000, 86400, 0x8db0f87a +0, 427500, 86400, 0xcd974e98 +0, 435000, 86400, 0x4405116e +0, 442500, 86400, 0xfe4cc7b4 +0, 450000, 86400, 0x17d27206 +0, 457500, 86400, 0x11743762 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/v210 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/v210 new file mode 100644 index 00000000..8cbf7df7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/v210 @@ -0,0 +1 @@ +0, 0, 3686400, 0x8d5c3847 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vc1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vc1 new file mode 100644 index 00000000..123237c9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vc1 @@ -0,0 +1,15 @@ +0, 0, 38016, 0xf4715db5 +0, 3600, 38016, 0xf4715db5 +0, 7200, 38016, 0xf4715db5 +0, 10800, 38016, 0xf46af0e1 +0, 14400, 38016, 0x96992cf1 +0, 18000, 38016, 0xbaadd874 +0, 21600, 38016, 0x751f4328 +0, 25200, 38016, 0x751f4328 +0, 28800, 38016, 0xf7294772 +0, 32400, 38016, 0xf7294772 +0, 36000, 38016, 0xf1d12133 +0, 39600, 38016, 0xf1d12133 +0, 43200, 38016, 0xf1d12133 +0, 46800, 38016, 0xf1d12133 +0, 50400, 38016, 0xf1d12133 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vcr1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vcr1 new file mode 100644 index 00000000..22f817c6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vcr1 @@ -0,0 +1,128 @@ +0, 0, 28512, 0x7165286d +0, 5949, 28512, 0x2b842acc +0, 11898, 28512, 0x6d1b8e85 +0, 17847, 28512, 0xc5042fab +0, 23796, 28512, 0x8b84fa8d +0, 29745, 28512, 0x2ba34ee5 +0, 35693, 28512, 0x48493c3a +0, 41642, 28512, 0xbd774ff0 +0, 47591, 28512, 0xf2e2edcd +0, 53540, 28512, 0x9364c39e +0, 59489, 28512, 0x7203d4d0 +0, 65438, 28512, 0x3771e23e +0, 71387, 28512, 0xf332b71e +0, 77336, 28512, 0x64d9aedb +0, 83285, 28512, 0xc8f9cdbe +0, 89234, 28512, 0xf077a6e8 +0, 95183, 28512, 0xa9958897 +0, 101131, 28512, 0x89fb6c6e +0, 107080, 28512, 0x05b7350c +0, 113029, 28512, 0x23cf3ec8 +0, 118978, 28512, 0xf9105aa6 +0, 124927, 28512, 0x37ed48cb +0, 130876, 28512, 0xf4b15ce3 +0, 136825, 28512, 0x64b994b8 +0, 142774, 28512, 0x6731c26b +0, 148723, 28512, 0x650d110b +0, 154672, 28512, 0xbbb248ca +0, 160621, 28512, 0x426ab4ab +0, 166569, 28512, 0xb7f2e361 +0, 172518, 28512, 0xced16599 +0, 178467, 28512, 0xebf11860 +0, 184416, 28512, 0xefe1df5f +0, 190365, 28512, 0x2afc432e +0, 196314, 28512, 0x07bd3eea +0, 202263, 28512, 0x8b133899 +0, 208212, 28512, 0x0830f148 +0, 214161, 28512, 0x871fc549 +0, 220110, 28512, 0x0082c863 +0, 226059, 28512, 0x6144bdce +0, 232007, 28512, 0x0af772ea +0, 237956, 28512, 0x982b8707 +0, 243905, 28512, 0x565a3bfe +0, 249854, 28512, 0xdf14192e +0, 255803, 28512, 0x0c5ffcc1 +0, 261752, 28512, 0x87532564 +0, 267701, 28512, 0x0ba1661b +0, 273650, 28512, 0xd0e7a750 +0, 279599, 28512, 0x5add4281 +0, 285548, 28512, 0x9f45c597 +0, 291497, 28512, 0x921736d0 +0, 297446, 28512, 0xab177a89 +0, 303394, 28512, 0xb83a6f7c +0, 309343, 28512, 0x9bf6716b +0, 315292, 28512, 0xc8ca0f4f +0, 321241, 28512, 0x2ca6c753 +0, 327190, 28512, 0xc2f67d1f +0, 333139, 28512, 0x9b0e1d7b +0, 339088, 28512, 0x5257c5d0 +0, 345037, 28512, 0xf256bd2f +0, 350986, 28512, 0x1b04bd04 +0, 356935, 28512, 0x83deb9e4 +0, 362884, 28512, 0x5f3aa6b4 +0, 368832, 28512, 0x9313c5f3 +0, 374781, 28512, 0x1cfe0c23 +0, 380730, 28512, 0x3e9b37bf +0, 386679, 28512, 0x1603b386 +0, 392628, 28512, 0x3e70da87 +0, 398577, 28512, 0xa6684712 +0, 404526, 28512, 0x0454bbb7 +0, 410475, 28512, 0x7cf2f717 +0, 416424, 28512, 0xdfbd424c +0, 422373, 28512, 0x7318a177 +0, 428322, 28512, 0xbffcd503 +0, 434270, 28512, 0x85db177d +0, 440219, 28512, 0x2a8269d1 +0, 446168, 28512, 0xb5455cd5 +0, 452117, 28512, 0x5fd79a35 +0, 458066, 28512, 0xc1a7c005 +0, 464015, 28512, 0x55230bb0 +0, 469964, 28512, 0x5acf45d9 +0, 475913, 28512, 0xdf1259bf +0, 481862, 28512, 0xe04e87eb +0, 487811, 28512, 0xfd25abc0 +0, 493760, 28512, 0x38c4d017 +0, 499708, 28512, 0x7b15d521 +0, 505657, 28512, 0xb156b981 +0, 511606, 28512, 0xcc99cd09 +0, 517555, 28512, 0x633a9cec +0, 523504, 28512, 0xf00a7c1b +0, 529453, 28512, 0x426250e9 +0, 535402, 28512, 0xfad02714 +0, 541351, 28512, 0x1ea5d8d2 +0, 547300, 28512, 0x581ea622 +0, 553249, 28512, 0x6b225f61 +0, 559198, 28512, 0x68f337e6 +0, 565146, 28512, 0x85f7060e +0, 571095, 28512, 0xaa3b1086 +0, 577044, 28512, 0x91fa1371 +0, 582993, 28512, 0x92acd34a +0, 588942, 28512, 0x0ae8c1e6 +0, 594891, 28512, 0x1335a5b3 +0, 600840, 28512, 0xc364a5e7 +0, 606789, 28512, 0x19b9819a +0, 612738, 28512, 0xd42d7045 +0, 618687, 28512, 0x4c866a18 +0, 624636, 28512, 0xf0a99685 +0, 630584, 28512, 0x47a4a1bd +0, 636533, 28512, 0x8dd09006 +0, 642482, 28512, 0x3f0b742d +0, 648431, 28512, 0x1acf52be +0, 654380, 28512, 0x9e5d1460 +0, 660329, 28512, 0xd6852de9 +0, 666278, 28512, 0x36e00f16 +0, 672227, 28512, 0xe83dea09 +0, 678176, 28512, 0xbb71daf1 +0, 684125, 28512, 0xaeedf763 +0, 690074, 28512, 0xa793ed91 +0, 696022, 28512, 0x9b0f093f +0, 701971, 28512, 0xc8504b43 +0, 707920, 28512, 0x08c68319 +0, 713869, 28512, 0x2284b24a +0, 719818, 28512, 0x5980e906 +0, 725767, 28512, 0x6ffd2c14 +0, 731716, 28512, 0x5c6c3c27 +0, 737665, 28512, 0x20d2efec +0, 743614, 28512, 0x69ffec11 +0, 749563, 28512, 0x8721f8ab +0, 755512, 28512, 0xb606e164 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/video-xl b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/video-xl new file mode 100644 index 00000000..aca08645 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/video-xl @@ -0,0 +1,40 @@ +0, 0, 36096, 0xab1c53c1 +0, 12780, 36096, 0x8b598ff3 +0, 25560, 36096, 0xe9a5f3eb +0, 38340, 36096, 0x10584b30 +0, 51120, 36096, 0x19d8c5d2 +0, 63900, 36096, 0x43a453b9 +0, 76680, 36096, 0xb32db13b +0, 89460, 36096, 0xf117e7b3 +0, 102240, 36096, 0x9171fb33 +0, 115020, 36096, 0xdf84081c +0, 127800, 36096, 0xc9d9527e +0, 140580, 36096, 0x72fa295e +0, 153360, 36096, 0xce02060e +0, 166140, 36096, 0x31f5fdbd +0, 178920, 36096, 0x4179dc07 +0, 191700, 36096, 0xf250c03f +0, 204480, 36096, 0xc4aca7c5 +0, 217260, 36096, 0xd9b1837f +0, 230040, 36096, 0x0af164ef +0, 242820, 36096, 0x90123fcd +0, 255600, 36096, 0x60392815 +0, 268380, 36096, 0x7a7b0ac9 +0, 281160, 36096, 0x36c1fe9c +0, 293940, 36096, 0x50bed8a4 +0, 306720, 36096, 0x10f3b998 +0, 319500, 36096, 0x18e5b516 +0, 332280, 36096, 0x860597dc +0, 345060, 36096, 0x05488146 +0, 357840, 36096, 0xac577cec +0, 370620, 36096, 0xc9f95550 +0, 383400, 36096, 0xa0c95270 +0, 396180, 36096, 0x977c5bf2 +0, 408960, 36096, 0xc9f95550 +0, 421740, 36096, 0xa0c95270 +0, 434520, 36096, 0x977c5bf2 +0, 447300, 36096, 0xc9f95550 +0, 460080, 36096, 0xa0c95270 +0, 472860, 36096, 0x977c5bf2 +0, 485640, 36096, 0xc9f95550 +0, 498420, 36096, 0xa0c95270 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vmnc-16bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vmnc-16bit new file mode 100644 index 00000000..a298877b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vmnc-16bit @@ -0,0 +1,192 @@ +0, 0, 864000, 0x9b1cee65 +0, 18000, 864000, 0x82950e3f +0, 36000, 864000, 0x335f9678 +0, 54000, 864000, 0x6b86b7e7 +0, 72000, 864000, 0x25618cf2 +0, 90000, 864000, 0xed2196c9 +0, 108000, 864000, 0xbeaa31ba +0, 126000, 864000, 0x14e6c8ab +0, 144000, 864000, 0x17e5c196 +0, 162000, 864000, 0x4aa15110 +0, 180000, 864000, 0x4aa15110 +0, 198000, 864000, 0x4aa15110 +0, 216000, 864000, 0x3c2d3809 +0, 234000, 864000, 0xd075f4d0 +0, 252000, 864000, 0x0c3f2833 +0, 270000, 864000, 0xe7471872 +0, 288000, 864000, 0x4300b71d +0, 306000, 864000, 0x6b5844ec +0, 324000, 864000, 0xb3ebc395 +0, 342000, 864000, 0x39aa8a7d +0, 360000, 864000, 0x52a3d93d +0, 378000, 864000, 0x73adbdac +0, 396000, 864000, 0xa9fd6cdc +0, 414000, 864000, 0x4a085344 +0, 432000, 864000, 0xc21b943c +0, 450000, 864000, 0xfaef6ed4 +0, 468000, 864000, 0xa3e9163c +0, 486000, 864000, 0x917e2be4 +0, 504000, 864000, 0x2d89d534 +0, 522000, 864000, 0x6fe5a9e4 +0, 540000, 864000, 0x71af29ec +0, 558000, 864000, 0x8f33f6ad +0, 576000, 864000, 0xe7d46a24 +0, 594000, 864000, 0xb631e044 +0, 612000, 864000, 0x77db01cb +0, 630000, 864000, 0x9861b6ec +0, 648000, 864000, 0x973bd263 +0, 666000, 864000, 0xdd4c175b +0, 684000, 864000, 0xdc28469b +0, 702000, 864000, 0x67393ebb +0, 720000, 864000, 0x01a06813 +0, 738000, 864000, 0x63e88f73 +0, 756000, 864000, 0x3ffbdd73 +0, 774000, 864000, 0xd25f790b +0, 792000, 864000, 0x14e3c5d3 +0, 810000, 864000, 0x0d3d1202 +0, 828000, 864000, 0x69decf03 +0, 846000, 864000, 0x1b20ab93 +0, 864000, 864000, 0xee2f8d4a +0, 882000, 864000, 0xaac44c52 +0, 900000, 864000, 0x3f874a5a +0, 918000, 864000, 0x239b2d7a +0, 936000, 864000, 0xb85db552 +0, 954000, 864000, 0xb12962a2 +0, 972000, 864000, 0xb8270fd9 +0, 990000, 864000, 0x14930601 +0, 1008000, 864000, 0x827a15c1 +0, 1026000, 864000, 0xe31011d1 +0, 1044000, 864000, 0xcd2154c1 +0, 1062000, 864000, 0xad02dbd9 +0, 1080000, 864000, 0x40c17d58 +0, 1098000, 864000, 0x8219e3b9 +0, 1116000, 864000, 0x2d348340 +0, 1134000, 864000, 0x6b61dfc9 +0, 1152000, 864000, 0xc8d95be1 +0, 1170000, 864000, 0x70ba0918 +0, 1188000, 864000, 0xdc728131 +0, 1206000, 864000, 0x9b054a10 +0, 1224000, 864000, 0x3983f751 +0, 1242000, 864000, 0x325fe1a9 +0, 1260000, 864000, 0x7a41eac0 +0, 1278000, 864000, 0x324372a8 +0, 1296000, 864000, 0xc014ea18 +0, 1314000, 864000, 0x1a506a1f +0, 1332000, 864000, 0x47b59557 +0, 1350000, 864000, 0x5f2e194f +0, 1368000, 864000, 0x9f6abb68 +0, 1386000, 864000, 0x831d2b97 +0, 1404000, 864000, 0x0635af7f +0, 1422000, 864000, 0xe54a5626 +0, 1440000, 864000, 0x704dca4f +0, 1458000, 864000, 0x47de6676 +0, 1476000, 864000, 0x609705fd +0, 1494000, 864000, 0x8d92e086 +0, 1512000, 864000, 0xdb7dab5e +0, 1530000, 864000, 0xe6ccb686 +0, 1548000, 864000, 0x0d137f66 +0, 1566000, 864000, 0xd200035d +0, 1584000, 864000, 0x7dcb959d +0, 1602000, 864000, 0xee849f75 +0, 1620000, 864000, 0x89d14acd +0, 1638000, 864000, 0x3738029d +0, 1656000, 864000, 0x6f4c4395 +0, 1674000, 864000, 0x06334395 +0, 1692000, 864000, 0x238b7c94 +0, 1710000, 864000, 0xfa5d1e14 +0, 1728000, 864000, 0x50b10e54 +0, 1746000, 864000, 0x9ed3b6e4 +0, 1764000, 864000, 0x68da9374 +0, 1782000, 864000, 0xb32a137c +0, 1800000, 864000, 0x577d5084 +0, 1818000, 864000, 0xd262176b +0, 1836000, 864000, 0xf58b44b3 +0, 1854000, 864000, 0xd0828edc +0, 1872000, 864000, 0xc91a7544 +0, 1890000, 864000, 0x18ae7f1c +0, 1908000, 864000, 0x82623643 +0, 1926000, 864000, 0x9cf82cfb +0, 1944000, 864000, 0x93ad116b +0, 1962000, 864000, 0xa669044b +0, 1980000, 864000, 0x8adf88c3 +0, 1998000, 864000, 0xb83fb413 +0, 2016000, 864000, 0xb9e291f3 +0, 2034000, 864000, 0x5833dcc3 +0, 2052000, 864000, 0x4ab825aa +0, 2070000, 864000, 0xb52c3b53 +0, 2088000, 864000, 0x0cb0dd53 +0, 2106000, 864000, 0x98b8dd52 +0, 2124000, 864000, 0x989230ba +0, 2142000, 864000, 0xaed4c073 +0, 2160000, 864000, 0x76a7c83a +0, 2178000, 864000, 0x02711eea +0, 2196000, 864000, 0x8de65fe2 +0, 2214000, 864000, 0xc1163689 +0, 2232000, 864000, 0xc04f8b31 +0, 2250000, 864000, 0x69218d2a +0, 2268000, 864000, 0x7e3abe62 +0, 2286000, 864000, 0x00ebe27a +0, 2304000, 864000, 0x34803f11 +0, 2322000, 864000, 0x85591cd9 +0, 2340000, 864000, 0x8422fb51 +0, 2358000, 864000, 0x67c759e1 +0, 2376000, 864000, 0x4ac36af1 +0, 2394000, 864000, 0xdf00fca2 +0, 2412000, 864000, 0x74c633d1 +0, 2430000, 864000, 0x00251c31 +0, 2448000, 864000, 0x6d12a499 +0, 2466000, 864000, 0x1b6492e1 +0, 2484000, 864000, 0xdfc9a2a1 +0, 2502000, 864000, 0x33dcac79 +0, 2520000, 864000, 0x2305a499 +0, 2538000, 864000, 0xe1f3ae71 +0, 2556000, 864000, 0xc0cc92e1 +0, 2574000, 864000, 0x53d3b261 +0, 2592000, 864000, 0xf953aa81 +0, 2610000, 864000, 0x4108da69 +0, 2628000, 864000, 0xd6acf9e9 +0, 2646000, 864000, 0xb97ed900 +0, 2664000, 864000, 0x1d8b7a80 +0, 2682000, 864000, 0xd5406cb8 +0, 2700000, 864000, 0x5aa34948 +0, 2718000, 864000, 0x328eee01 +0, 2736000, 864000, 0xac92e621 +0, 2754000, 864000, 0x4fa1f5e1 +0, 2772000, 864000, 0xf7c4e8a8 +0, 2790000, 864000, 0xc358bd58 +0, 2808000, 864000, 0x29ec4b27 +0, 2826000, 864000, 0xf7219c88 +0, 2844000, 864000, 0xe77ff130 +0, 2862000, 864000, 0x73683417 +0, 2880000, 864000, 0x08b6be77 +0, 2898000, 864000, 0x3a7eea6f +0, 2916000, 864000, 0xb319cce7 +0, 2934000, 864000, 0x9607b13e +0, 2952000, 864000, 0x30543f0d +0, 2970000, 864000, 0x56915a9e +0, 2988000, 864000, 0x79f158a6 +0, 3006000, 864000, 0x498b8bd6 +0, 3024000, 864000, 0xe9ad7046 +0, 3042000, 864000, 0xe9ad7046 +0, 3060000, 864000, 0x10317e0e +0, 3078000, 864000, 0x10317e0e +0, 3096000, 864000, 0x10317e0e +0, 3114000, 864000, 0x99ec7046 +0, 3132000, 864000, 0x924d46ee +0, 3150000, 864000, 0x98bf333e +0, 3168000, 864000, 0xb2625c96 +0, 3186000, 864000, 0xb46b3926 +0, 3204000, 864000, 0xeb4e5c96 +0, 3222000, 864000, 0x87154ece +0, 3240000, 864000, 0x9e4c666e +0, 3258000, 864000, 0x65b53d16 +0, 3276000, 864000, 0x99e85e8e +0, 3294000, 864000, 0x650ba17e +0, 3312000, 864000, 0x1ecb000e +0, 3330000, 864000, 0xb942327d +0, 3348000, 864000, 0x1bf20925 +0, 3366000, 864000, 0x61dba6a5 +0, 3384000, 864000, 0x5de16d8d +0, 3402000, 864000, 0x4eb1f75d +0, 3420000, 864000, 0x4eb1f75d +0, 3438000, 864000, 0xd0750144 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vmnc-32bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vmnc-32bit new file mode 100644 index 00000000..fa3d6a07 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vmnc-32bit @@ -0,0 +1,171 @@ +0, 0, 3655644, 0x87973530 +0, 18000, 3655644, 0x87973530 +0, 36000, 3655644, 0x3c3167fd +0, 54000, 3655644, 0x87973530 +0, 72000, 3655644, 0x87973530 +0, 90000, 3655644, 0x3c3167fd +0, 108000, 3655644, 0x3c3167fd +0, 126000, 3655644, 0x87973530 +0, 144000, 3655644, 0x87973530 +0, 162000, 3655644, 0x87973530 +0, 180000, 3655644, 0x87973530 +0, 198000, 3655644, 0x3c3167fd +0, 216000, 3655644, 0x87973530 +0, 234000, 3655644, 0x87973530 +0, 252000, 3655644, 0x87973530 +0, 270000, 3655644, 0x4f0da763 +0, 288000, 3655644, 0x4f0da763 +0, 306000, 3655644, 0x4f0da763 +0, 324000, 3655644, 0x66a4a763 +0, 342000, 3655644, 0xb20a7496 +0, 360000, 3655644, 0x66a4a763 +0, 378000, 3655644, 0x66a4a763 +0, 396000, 3655644, 0x66a4a763 +0, 414000, 3655644, 0x5600644a +0, 432000, 3655644, 0xce5880ee +0, 450000, 3655644, 0xce5880ee +0, 468000, 3655644, 0xa993ef3d +0, 486000, 3655644, 0xa993ef3d +0, 504000, 3655644, 0xa993ef3d +0, 522000, 3655644, 0xa993ef3d +0, 540000, 3655644, 0xa993ef3d +0, 558000, 3655644, 0xa993ef3d +0, 576000, 3655644, 0xa993ef3d +0, 594000, 3655644, 0xa993ef3d +0, 612000, 3655644, 0xa993ef3d +0, 630000, 3655644, 0xa993ef3d +0, 648000, 3655644, 0xa993ef3d +0, 666000, 3655644, 0xa993ef3d +0, 684000, 3655644, 0xa993ef3d +0, 702000, 3655644, 0xa993ef3d +0, 720000, 3655644, 0xa993ef3d +0, 738000, 3655644, 0xa993ef3d +0, 756000, 3655644, 0xa993ef3d +0, 774000, 3655644, 0xa993ef3d +0, 792000, 3655644, 0xa993ef3d +0, 810000, 3655644, 0xa993ef3d +0, 828000, 3655644, 0xa993ef3d +0, 846000, 3655644, 0xa993ef3d +0, 864000, 3655644, 0xa993ef3d +0, 882000, 3655644, 0x73564014 +0, 900000, 3655644, 0x73564014 +0, 918000, 3655644, 0x73564014 +0, 936000, 3655644, 0x73564014 +0, 954000, 3655644, 0x73564014 +0, 972000, 3655644, 0x73564014 +0, 990000, 3655644, 0x73564014 +0, 1008000, 3655644, 0x73564014 +0, 1026000, 3655644, 0x73564014 +0, 1044000, 3655644, 0x73564014 +0, 1062000, 3655644, 0x73564014 +0, 1080000, 3655644, 0x73564014 +0, 1098000, 3655644, 0x2a6e1e8c +0, 1116000, 3655644, 0x2a6e1e8c +0, 1134000, 3655644, 0x2a6e1e8c +0, 1152000, 3655644, 0xbae02e7c +0, 1170000, 3655644, 0xbae02e7c +0, 1188000, 3655644, 0xbae02e7c +0, 1206000, 3655644, 0xbae02e7c +0, 1224000, 3655644, 0x55af4a2d +0, 1242000, 3655644, 0x55af4a2d +0, 1260000, 3655644, 0x55af4a2d +0, 1278000, 3655644, 0x55af4a2d +0, 1296000, 3655644, 0x54b7ff2d +0, 1314000, 3655644, 0x39af1aed +0, 1332000, 3655644, 0x39af1aed +0, 1350000, 3655644, 0x39af1aed +0, 1368000, 3655644, 0x39af1aed +0, 1386000, 3655644, 0xe48dd11c +0, 1404000, 3655644, 0xe48dd11c +0, 1422000, 3655644, 0xe48dd11c +0, 1440000, 3655644, 0xe48dd11c +0, 1458000, 3655644, 0xe48dd11c +0, 1476000, 3655644, 0xba15c78d +0, 1494000, 3655644, 0xba15c78d +0, 1512000, 3655644, 0xba15c78d +0, 1530000, 3655644, 0xba15c78d +0, 1548000, 3655644, 0xba15c78d +0, 1566000, 3655644, 0xba15c78d +0, 1584000, 3655644, 0xba15c78d +0, 1602000, 3655644, 0x39af1aed +0, 1620000, 3655644, 0x39af1aed +0, 1638000, 3655644, 0x39af1aed +0, 1656000, 3655644, 0x39af1aed +0, 1674000, 3655644, 0x39af1aed +0, 1692000, 3655644, 0x39af1aed +0, 1710000, 3655644, 0x39af1aed +0, 1728000, 3655644, 0x27f96cd8 +0, 1746000, 3655644, 0x27f96cd8 +0, 1764000, 3655644, 0x27f96cd8 +0, 1782000, 3655644, 0x27f96cd8 +0, 1800000, 3655644, 0x27f96cd8 +0, 1818000, 3655644, 0x27f96cd8 +0, 1836000, 3655644, 0x27f96cd8 +0, 1854000, 3655644, 0xf4f068dc +0, 1872000, 3655644, 0xf4f068dc +0, 1890000, 3655644, 0xf4f068dc +0, 1908000, 3655644, 0xf4f068dc +0, 1926000, 3655644, 0xf4f068dc +0, 1944000, 3655644, 0xf4f068dc +0, 1962000, 3655644, 0xf4f068dc +0, 1980000, 3655644, 0xf1c55cf5 +0, 1998000, 3655644, 0xd932633d +0, 2016000, 3655644, 0xd932633d +0, 2034000, 3655644, 0xc6e95e0a +0, 2052000, 3655644, 0x9a63c9de +0, 2070000, 3655644, 0xf166ad4f +0, 2088000, 3655644, 0xe9eeba41 +0, 2106000, 3655644, 0x7e598ad7 +0, 2124000, 3655644, 0xf3bd257e +0, 2142000, 3655644, 0xf3bd257e +0, 2160000, 3655644, 0xf3bd257e +0, 2178000, 3655644, 0xf3bd257e +0, 2196000, 3655644, 0xf3bd257e +0, 2214000, 3655644, 0xf35b3852 +0, 2232000, 3655644, 0xf35b3852 +0, 2250000, 3655644, 0xf35b3852 +0, 2268000, 3655644, 0xf35b3852 +0, 2286000, 3655644, 0x9d553959 +0, 2304000, 3655644, 0x0a9de8e2 +0, 2322000, 3655644, 0xf2325b6c +0, 2340000, 3655644, 0xf2325b6c +0, 2358000, 3655644, 0xf2325b6c +0, 2376000, 3655644, 0xf2325b6c +0, 2394000, 3655644, 0xf2325b6c +0, 2412000, 3655644, 0xf2325b6c +0, 2430000, 3655644, 0xcf924028 +0, 2448000, 3655644, 0xcf924028 +0, 2466000, 3655644, 0x8dae55bc +0, 2484000, 3655644, 0x8dae55bc +0, 2502000, 3655644, 0x57b08ced +0, 2520000, 3655644, 0x57b08ced +0, 2538000, 3655644, 0xef89a1d8 +0, 2556000, 3655644, 0xef89a1d8 +0, 2574000, 3655644, 0x69e5503a +0, 2592000, 3655644, 0x69e5503a +0, 2610000, 3655644, 0xc3de7b3f +0, 2628000, 3655644, 0xc3de7b3f +0, 2646000, 3655644, 0x88eea64a +0, 2664000, 3655644, 0x88eea64a +0, 2682000, 3655644, 0xe39cce1f +0, 2700000, 3655644, 0xe39cce1f +0, 2718000, 3655644, 0xe39cce1f +0, 2736000, 3655644, 0xe39cce1f +0, 2754000, 3655644, 0xe39cce1f +0, 2772000, 3655644, 0xe39cce1f +0, 2790000, 3655644, 0xe39cce1f +0, 2808000, 3655644, 0xe39cce1f +0, 2826000, 3655644, 0xe39cce1f +0, 2844000, 3655644, 0xe39cce1f +0, 2862000, 3655644, 0xe39cce1f +0, 2880000, 3655644, 0xe39cce1f +0, 2898000, 3655644, 0xe39cce1f +0, 2916000, 3655644, 0xf0ed0d04 +0, 2934000, 3655644, 0xf0ed0d04 +0, 2952000, 3655644, 0xf0ed0d04 +0, 2970000, 3655644, 0xf0ed0d04 +0, 2988000, 3655644, 0x32490d3e +0, 3006000, 3655644, 0x32490d3e +0, 3024000, 3655644, 0x32490d3e +0, 3042000, 3655644, 0x32490d3e +0, 3060000, 3655644, 0x32490d3e diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp3 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp3 new file mode 100644 index 00000000..7c3d7d19 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp3 @@ -0,0 +1,114 @@ +0, 0, 261120, 0xc50dec2b +0, 3600, 261120, 0xaa8d4441 +0, 7200, 261120, 0x932b0d44 +0, 10800, 261120, 0x125e1af7 +0, 14400, 261120, 0x09a763a5 +0, 18000, 261120, 0x56939852 +0, 21600, 261120, 0x0eda6d35 +0, 25200, 261120, 0x2f0d3869 +0, 28800, 261120, 0xe177c34c +0, 32400, 261120, 0x5d4e833a +0, 36000, 261120, 0x42e26e7a +0, 39600, 261120, 0xf5a60b4c +0, 43200, 261120, 0x29938341 +0, 46800, 261120, 0x0a9ebb80 +0, 50400, 261120, 0xd18c6a11 +0, 54000, 261120, 0x4b8212ac +0, 57600, 261120, 0x7902aabc +0, 61200, 261120, 0x4babac44 +0, 64800, 261120, 0xf33efa46 +0, 68400, 261120, 0x110dd40a +0, 72000, 261120, 0xae327a8a +0, 75600, 261120, 0xab757d75 +0, 79200, 261120, 0xfbd1402d +0, 82800, 261120, 0x4f2c5d31 +0, 86400, 261120, 0xc7ea2149 +0, 90000, 261120, 0x86072cf7 +0, 93600, 261120, 0x37c2f2ed +0, 97200, 261120, 0x1d51ee83 +0, 100800, 261120, 0x72291b8b +0, 104400, 261120, 0xe9c8ffaf +0, 108000, 261120, 0x657a1615 +0, 111600, 261120, 0x6f832019 +0, 115200, 261120, 0xf4445a22 +0, 118800, 261120, 0x105306f0 +0, 122400, 261120, 0x34c0c36b +0, 126000, 261120, 0x7767be18 +0, 129600, 261120, 0x88a7eaeb +0, 133200, 261120, 0x797e69e4 +0, 136800, 261120, 0x78901f02 +0, 140400, 261120, 0xbc91758e +0, 144000, 261120, 0x35d47b24 +0, 147600, 261120, 0xaf0ebc82 +0, 151200, 261120, 0x40e63004 +0, 154800, 261120, 0x70d1c5c1 +0, 158400, 261120, 0x8aea2b70 +0, 162000, 261120, 0x51f3cd81 +0, 165600, 261120, 0x8f8584b7 +0, 169200, 261120, 0x921541fb +0, 172800, 261120, 0xddd3f1ea +0, 176400, 261120, 0x6be2e960 +0, 180000, 261120, 0x72997a1f +0, 183600, 261120, 0xe70fc009 +0, 187200, 261120, 0x816a0687 +0, 190800, 261120, 0x2aa79e82 +0, 194400, 261120, 0x85f2fe5c +0, 198000, 261120, 0x000dd8b6 +0, 201600, 261120, 0x1be19dd4 +0, 205200, 261120, 0xadea80e5 +0, 208800, 261120, 0x0cc2204f +0, 212400, 261120, 0xd62968a8 +0, 216000, 261120, 0x0afc75c2 +0, 219600, 261120, 0x82341f09 +0, 223200, 261120, 0xbf7e66cd +0, 226800, 261120, 0x8f3491df +0, 230400, 261120, 0xc316d383 +0, 234000, 261120, 0x3de7f632 +0, 237600, 261120, 0xda55cfb0 +0, 241200, 261120, 0xbd88bb46 +0, 244800, 261120, 0x75444b17 +0, 248400, 261120, 0x798cc498 +0, 252000, 261120, 0xf9a60fa6 +0, 255600, 261120, 0xbd8debd7 +0, 259200, 261120, 0x7c890029 +0, 262800, 261120, 0x7a75e44a +0, 266400, 261120, 0x1f04611c +0, 270000, 261120, 0x96b3ee93 +0, 273600, 261120, 0x7fc11f39 +0, 277200, 261120, 0xe87d6864 +0, 280800, 261120, 0x6797d904 +0, 284400, 261120, 0x9e3e7bde +0, 288000, 261120, 0xc31a8039 +0, 291600, 261120, 0xe3ef4cf7 +0, 295200, 261120, 0x83c56fc9 +0, 298800, 261120, 0xb304f7aa +0, 302400, 261120, 0x039a7080 +0, 306000, 261120, 0xffb08224 +0, 309600, 261120, 0xa7be783a +0, 313200, 261120, 0x572beff3 +0, 316800, 261120, 0x1bc59ae8 +0, 320400, 261120, 0x11c8feb4 +0, 324000, 261120, 0xe2398651 +0, 327600, 261120, 0x37c3efba +0, 331200, 261120, 0xb32f0dd4 +0, 334800, 261120, 0x66880c50 +0, 338400, 261120, 0x4f7392c8 +0, 342000, 261120, 0x3d5c08f6 +0, 345600, 261120, 0xfd129211 +0, 349200, 261120, 0x9b396ebe +0, 352800, 261120, 0x75ab9a4a +0, 356400, 261120, 0xf8c4e7ea +0, 360000, 261120, 0xdd48c7c3 +0, 363600, 261120, 0xdebf20e6 +0, 367200, 261120, 0x35c32091 +0, 370800, 261120, 0xce5a49c7 +0, 374400, 261120, 0x69fc8e0d +0, 378000, 261120, 0x43a08b41 +0, 381600, 261120, 0x01a0513c +0, 385200, 261120, 0x1d3f490a +0, 388800, 261120, 0xb44df252 +0, 392400, 261120, 0x1259753e +0, 396000, 261120, 0x4a1538d6 +0, 399600, 261120, 0xd5ed4bd5 +0, 403200, 261120, 0xa21590b5 +0, 406800, 261120, 0xfb2de1f7 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp5 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp5 new file mode 100644 index 00000000..bf67801a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp5 @@ -0,0 +1,246 @@ +0, 0, 233472, 0x27488413 +0, 3754, 233472, 0x4af384b5 +0, 7508, 233472, 0x948d845d +0, 11261, 233472, 0xd6ed845e +0, 15015, 233472, 0x230f8444 +0, 18769, 233472, 0x230f8444 +0, 22523, 233472, 0x230f8444 +0, 26276, 233472, 0xa5078424 +0, 30030, 233472, 0xa5078424 +0, 33784, 233472, 0xa5078424 +0, 37538, 233472, 0xa5078424 +0, 41291, 233472, 0xa5078424 +0, 45045, 233472, 0xa5078424 +0, 48799, 233472, 0xa5078424 +0, 52553, 233472, 0xa5078424 +0, 56306, 233472, 0xa5078424 +0, 60060, 233472, 0xa5078424 +0, 63814, 233472, 0xa5078424 +0, 67568, 233472, 0xa5078424 +0, 71321, 233472, 0xa5078424 +0, 75075, 233472, 0xa5078424 +0, 78829, 233472, 0xa5078424 +0, 82583, 233472, 0xa5078424 +0, 86336, 233472, 0xa5078424 +0, 90090, 233472, 0xa5078424 +0, 93844, 233472, 0xa5078424 +0, 97598, 233472, 0xa5078424 +0, 101351, 233472, 0xa5078424 +0, 105105, 233472, 0xa5078424 +0, 108859, 233472, 0xa5078424 +0, 112613, 233472, 0xa5078424 +0, 116366, 233472, 0xa5078424 +0, 120120, 233472, 0xa5078424 +0, 123874, 233472, 0xa5078424 +0, 127628, 233472, 0xa5078424 +0, 131381, 233472, 0xa5078424 +0, 135135, 233472, 0xa5078424 +0, 138889, 233472, 0xa5078424 +0, 142643, 233472, 0xa5078424 +0, 146396, 233472, 0xa5078424 +0, 150150, 233472, 0x05667dea +0, 153904, 233472, 0x6ae1823e +0, 157658, 233472, 0x3c8a7ea9 +0, 161411, 233472, 0xcae2832a +0, 165165, 233472, 0x547a7ec2 +0, 168919, 233472, 0xa6628327 +0, 172673, 233472, 0xecd77edc +0, 176426, 233472, 0xe9538356 +0, 180180, 233472, 0xca297eb1 +0, 183934, 233472, 0xe5648329 +0, 187688, 233472, 0xad8c7e94 +0, 191441, 233472, 0xca0d82fc +0, 195195, 233472, 0x62277e8d +0, 198949, 233472, 0x7ef782f5 +0, 202703, 233472, 0x09b27e8d +0, 206456, 233472, 0x66f382f5 +0, 210210, 233472, 0x0aaa7e8d +0, 213964, 233472, 0x676b82f5 +0, 217718, 233472, 0x0a8a7e8d +0, 221471, 233472, 0x670b82f5 +0, 225225, 233472, 0x09fa7e8d +0, 228979, 233472, 0x671b82f5 +0, 232733, 233472, 0x0ac27e8d +0, 236486, 233472, 0x674382f5 +0, 240240, 233472, 0x0a727e8d +0, 243994, 233472, 0x673382f5 +0, 247748, 233472, 0x0a127e8d +0, 251501, 233472, 0x66f382f5 +0, 255255, 233472, 0x0aaa7e8d +0, 259009, 233472, 0x676b82f5 +0, 262763, 233472, 0x0a8a7e8d +0, 266516, 233472, 0x670b82f5 +0, 270270, 233472, 0x09fa7e8d +0, 274024, 233472, 0x671b82f5 +0, 277778, 233472, 0x0ac27e8d +0, 281531, 233472, 0x674382f5 +0, 285285, 233472, 0x0a727e8d +0, 289039, 233472, 0x673382f5 +0, 292793, 233472, 0x0a127e8d +0, 296546, 233472, 0xa3917e7f +0, 300300, 233472, 0x0554868d +0, 304054, 233472, 0x05ba6d7a +0, 307808, 233472, 0x05ba6d7a +0, 311561, 233472, 0x05ba6d7a +0, 315315, 233472, 0x05ba6d7a +0, 319069, 233472, 0x05ba6d7a +0, 322823, 233472, 0x05ba6d7a +0, 326576, 233472, 0x05ba6d7a +0, 330330, 233472, 0x05ba6d7a +0, 334084, 233472, 0x05ba6d7a +0, 337838, 233472, 0x05ba6d7a +0, 341591, 233472, 0x05ba6d7a +0, 345345, 233472, 0x05ba6d7a +0, 349099, 233472, 0x05ba6d7a +0, 352853, 233472, 0x05ba6d7a +0, 356606, 233472, 0x05ba6d7a +0, 360360, 233472, 0x05ba6d7a +0, 364114, 233472, 0x05ba6d7a +0, 367868, 233472, 0x05ba6d7a +0, 371621, 233472, 0x05ba6d7a +0, 375375, 233472, 0x05ba6d7a +0, 379129, 233472, 0x05ba6d7a +0, 382883, 233472, 0x05ba6d7a +0, 386636, 233472, 0x05ba6d7a +0, 390390, 233472, 0x3a6a6d61 +0, 394144, 233472, 0x0bab7adc +0, 397898, 233472, 0x12b44993 +0, 401651, 233472, 0xa20ad6d1 +0, 405405, 233472, 0xfd916a4a +0, 409159, 233472, 0xd34f3e95 +0, 412913, 233472, 0x19571d5c +0, 416666, 233472, 0x7c8351ad +0, 420420, 233472, 0xea279823 +0, 424174, 233472, 0xc5011cfd +0, 427928, 233472, 0xbd7fb9af +0, 431681, 233472, 0xdfb3bb7c +0, 435435, 233472, 0x6d631236 +0, 439189, 233472, 0xdb579a7b +0, 442943, 233472, 0x47584a3e +0, 446696, 233472, 0x7a27a914 +0, 450450, 233472, 0x2996270d +0, 454204, 233472, 0xefeaa7ed +0, 457958, 233472, 0xa3e74ae1 +0, 461711, 233472, 0x8a51d61c +0, 465465, 233472, 0x25085ee7 +0, 469219, 233472, 0x0a811253 +0, 472973, 233472, 0x7d3eda84 +0, 476726, 233472, 0xd0a0887d +0, 480480, 233472, 0xc9e6702c +0, 484234, 233472, 0x0da14346 +0, 487988, 233472, 0x040f0605 +0, 491741, 233472, 0x76ea841a +0, 495495, 233472, 0x105b6600 +0, 499249, 233472, 0x73015e08 +0, 503003, 233472, 0xe77d6662 +0, 506756, 233472, 0x7514fcd1 +0, 510510, 233472, 0xb091a850 +0, 514264, 233472, 0x74ccdccd +0, 518018, 233472, 0xd1c002fc +0, 521771, 233472, 0x7bfcfdac +0, 525525, 233472, 0xf48a133f +0, 529279, 233472, 0x279c16dd +0, 533033, 233472, 0x58427907 +0, 536786, 233472, 0x4668a8f2 +0, 540540, 233472, 0x93fb555f +0, 544294, 233472, 0x49ed3cf2 +0, 548048, 233472, 0xd620fac9 +0, 551801, 233472, 0xe4efae83 +0, 555555, 233472, 0xe4d377be +0, 559309, 233472, 0x6fc229c1 +0, 563063, 233472, 0xab5a8898 +0, 566816, 233472, 0x58a493dd +0, 570570, 233472, 0x5c1c1093 +0, 574324, 233472, 0x2d831af9 +0, 578078, 233472, 0x9a0d3cdf +0, 581831, 233472, 0x2be78f0b +0, 585585, 233472, 0xfc7cc656 +0, 589339, 233472, 0xaa8624b7 +0, 593093, 233472, 0xb9c9afc1 +0, 596846, 233472, 0x709e8009 +0, 600600, 233472, 0xd2260830 +0, 604354, 233472, 0xadb3954e +0, 608108, 233472, 0x74fc3e65 +0, 611861, 233472, 0xb4bcdea4 +0, 615615, 233472, 0x60c46cf5 +0, 619369, 233472, 0x0e48eff8 +0, 623123, 233472, 0x60e46733 +0, 626876, 233472, 0x708ec89f +0, 630630, 233472, 0x1f11264e +0, 634384, 233472, 0x6cba8300 +0, 638138, 233472, 0xd1a5d756 +0, 641891, 233472, 0xb936621e +0, 645645, 233472, 0x1667b4af +0, 649399, 233472, 0xc212276d +0, 653153, 233472, 0x9d7a871d +0, 656906, 233472, 0xb52834f9 +0, 660660, 233472, 0x983bde84 +0, 664414, 233472, 0xd1c63d88 +0, 668168, 233472, 0xa38cb687 +0, 671921, 233472, 0xd81bf8ff +0, 675675, 233472, 0x688b231a +0, 679429, 233472, 0xd5ad3038 +0, 683183, 233472, 0xcd227f74 +0, 686936, 233472, 0x81ec23d6 +0, 690690, 233472, 0x52c1cd86 +0, 694444, 233472, 0xa4199853 +0, 698198, 233472, 0xe82c83e4 +0, 701951, 233472, 0xe9810f88 +0, 705705, 233472, 0x37e95ae7 +0, 709459, 233472, 0xf6974d5d +0, 713213, 233472, 0x31788551 +0, 716966, 233472, 0x00d6c539 +0, 720720, 233472, 0xdbb52151 +0, 724474, 233472, 0x594433d3 +0, 728228, 233472, 0xeec44f91 +0, 731981, 233472, 0x302894bf +0, 735735, 233472, 0x44f5ddc3 +0, 739489, 233472, 0x6c1edd28 +0, 743243, 233472, 0x7fd1e412 +0, 746996, 233472, 0xd771f11b +0, 750750, 233472, 0x09c675d5 +0, 754504, 233472, 0x8fd9112e +0, 758258, 233472, 0x602002e5 +0, 762011, 233472, 0xb9a22029 +0, 765765, 233472, 0x18e99807 +0, 769519, 233472, 0x3d8657d8 +0, 773273, 233472, 0x4cd73a85 +0, 777026, 233472, 0x84ddb474 +0, 780780, 233472, 0x69636bb8 +0, 784534, 233472, 0xa0436d50 +0, 788288, 233472, 0x93c86d78 +0, 792041, 233472, 0x05ba6d7a +0, 795795, 233472, 0x05ba6d7a +0, 799549, 233472, 0x05ba6d7a +0, 803303, 233472, 0x126c6406 +0, 807056, 233472, 0xe3885a3a +0, 810810, 233472, 0xf1256fe9 +0, 814564, 233472, 0x5a84377e +0, 818318, 233472, 0x7c392d90 +0, 822071, 233472, 0x8a74df48 +0, 825825, 233472, 0xfa394653 +0, 829579, 233472, 0xcbe0cc1b +0, 833333, 233472, 0xbf8639cf +0, 837086, 233472, 0x7dd2c935 +0, 840840, 233472, 0x1093148f +0, 844594, 233472, 0x624d7d3e +0, 848348, 233472, 0xb340cd65 +0, 852101, 233472, 0x6c0ae5c6 +0, 855855, 233472, 0x0c5eaf73 +0, 859609, 233472, 0x27be64ce +0, 863363, 233472, 0xac8990f4 +0, 867116, 233472, 0x1f935102 +0, 870870, 233472, 0x6e57d96f +0, 874624, 233472, 0xf246ea4d +0, 878378, 233472, 0x18058011 +0, 882131, 233472, 0x5951fe6e +0, 885885, 233472, 0x0f10371d +0, 889639, 233472, 0xe1481043 +0, 893393, 233472, 0xdedeefcc +0, 897146, 233472, 0xf8865db2 +0, 900900, 233472, 0xe1b3d4d6 +0, 904654, 233472, 0x81962c43 +0, 908408, 233472, 0xe903d0bb +0, 912161, 233472, 0x6f530ac6 +0, 915915, 233472, 0x94f7466c +0, 919669, 233472, 0xa8c1d365 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp6a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp6a new file mode 100644 index 00000000..e6ea0bcd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp6a @@ -0,0 +1,93 @@ +0, 0, 135000, 0x9dceed6d +0, 22500, 135000, 0xcb87787f +0, 45000, 135000, 0xdb4361ce +0, 67500, 135000, 0xb8fd81c2 +0, 90000, 135000, 0xbf86a7af +0, 112500, 135000, 0x2e7787e3 +0, 135000, 135000, 0x6cec6ebd +0, 157500, 135000, 0xa4d08c07 +0, 180000, 135000, 0x1be48faf +0, 202500, 135000, 0xf3cd8ede +0, 225000, 135000, 0x33ec8a49 +0, 247500, 135000, 0x11e887ec +0, 270000, 135000, 0x3e215c25 +0, 292500, 135000, 0x1a2cb3f8 +0, 315000, 135000, 0x7fb0e48a +0, 337500, 135000, 0x749f3738 +0, 360000, 135000, 0x686e78e9 +0, 382500, 135000, 0x29515bc7 +0, 405000, 135000, 0x987126bd +0, 427500, 135000, 0xdf77bb13 +0, 450000, 135000, 0x5fb1468a +0, 472500, 135000, 0x06ea50ea +0, 495000, 135000, 0x7bd9c715 +0, 517500, 135000, 0xdd6e6831 +0, 540000, 135000, 0x0ee3760f +0, 562500, 135000, 0xc7984dc8 +0, 585000, 135000, 0x7e385bff +0, 607500, 135000, 0xae155ab9 +0, 630000, 135000, 0xc05ee8f7 +0, 652500, 135000, 0x93de3392 +0, 675000, 135000, 0xfe45b38b +0, 697500, 135000, 0xeb5ed72c +0, 720000, 135000, 0x0794cb57 +0, 742500, 135000, 0x2578c6e5 +0, 765000, 135000, 0x78486707 +0, 787500, 135000, 0x41e1f0e6 +0, 810000, 135000, 0x4508eb76 +0, 832500, 135000, 0xd8c087f3 +0, 855000, 135000, 0x1a8db89a +0, 877500, 135000, 0x6dbd90c6 +0, 900000, 135000, 0x0845e400 +0, 922500, 135000, 0xe8b02fc2 +0, 945000, 135000, 0x8007d813 +0, 967500, 135000, 0xdfb04e69 +0, 990000, 135000, 0x5746cf71 +0, 1012500, 135000, 0xe510299f +0, 1035000, 135000, 0xeea0c829 +0, 1057500, 135000, 0x7c0578ab +0, 1080000, 135000, 0xb1569ce9 +0, 1102500, 135000, 0x6c233986 +0, 1125000, 135000, 0x95b77f3d +0, 1147500, 135000, 0xfc368d80 +0, 1170000, 135000, 0x5c73b064 +0, 1192500, 135000, 0x2206da8d +0, 1215000, 135000, 0x62bb599e +0, 1237500, 135000, 0x15a68991 +0, 1260000, 135000, 0x5f5eb810 +0, 1282500, 135000, 0x85a9634a +0, 1305000, 135000, 0xf24b5c1a +0, 1327500, 135000, 0x38034850 +0, 1350000, 135000, 0x48fd3599 +0, 1372500, 135000, 0xb9d62408 +0, 1395000, 135000, 0xaf202a21 +0, 1417500, 135000, 0x341aa582 +0, 1440000, 135000, 0x90cdc9bb +0, 1462500, 135000, 0x0b52f319 +0, 1485000, 135000, 0xce61aa5e +0, 1507500, 135000, 0x988acb45 +0, 1530000, 135000, 0xcd353664 +0, 1552500, 135000, 0xa80c8ce9 +0, 1575000, 135000, 0x15dce784 +0, 1597500, 135000, 0x16bd4519 +0, 1620000, 135000, 0x571712f3 +0, 1642500, 135000, 0x6b109f1e +0, 1665000, 135000, 0x8e4c19aa +0, 1687500, 135000, 0x4132bd4c +0, 1710000, 135000, 0x5babafe2 +0, 1732500, 135000, 0xddef6313 +0, 1755000, 135000, 0x76d6b48b +0, 1777500, 135000, 0x929e7702 +0, 1800000, 135000, 0x33f5e4a1 +0, 1822500, 135000, 0xdb7041bf +0, 1845000, 135000, 0xbc761e04 +0, 1867500, 135000, 0x0b2a81e6 +0, 1890000, 135000, 0xf6fd20ea +0, 1912500, 135000, 0x1894a26c +0, 1935000, 135000, 0xb25e216f +0, 1957500, 135000, 0x83bb02ee +0, 1980000, 135000, 0x6952a3c3 +0, 2002500, 135000, 0x372184d6 +0, 2025000, 135000, 0x2ac47afe +0, 2047500, 135000, 0x14c33a35 +0, 2070000, 135000, 0xdc08470e diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp6f b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp6f new file mode 100644 index 00000000..b942685c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp6f @@ -0,0 +1,174 @@ +0, 0, 13440, 0x7cb0a22f +0, 9000, 13440, 0xdfcea6ba +0, 18000, 13440, 0x59b2a5da +0, 27000, 13440, 0x12f1b2d8 +0, 36000, 13440, 0x280fb9f6 +0, 45000, 13440, 0x7bace8b3 +0, 54000, 13440, 0x4ec91480 +0, 63000, 13440, 0xa8010450 +0, 72000, 13440, 0x61d8fc46 +0, 81000, 13440, 0x242bb24e +0, 90000, 13440, 0x88397a36 +0, 99000, 13440, 0x10e15726 +0, 108000, 13440, 0x3018438c +0, 117000, 13440, 0xbbb94c21 +0, 126000, 13440, 0xfc3e5e2b +0, 135000, 13440, 0xeaa69354 +0, 144000, 13440, 0x96f1cc01 +0, 153000, 13440, 0x333fdaff +0, 162000, 13440, 0xb5230ed2 +0, 171000, 13440, 0x59383446 +0, 180000, 13440, 0x954939e6 +0, 189000, 13440, 0x53813d2f +0, 198000, 13440, 0x3ca53600 +0, 207000, 13440, 0x7b30227a +0, 216000, 13440, 0x5145bbfe +0, 225000, 13440, 0xa0979632 +0, 234000, 13440, 0x08026e21 +0, 243000, 13440, 0x3f456d1e +0, 252000, 13440, 0x7d036b62 +0, 261000, 13440, 0x508085fb +0, 270000, 13440, 0x251dc193 +0, 279000, 13440, 0xf3121c9b +0, 288000, 13440, 0xf5da772e +0, 297000, 13440, 0x8179ccf7 +0, 306000, 13440, 0xd57ceeb3 +0, 315000, 13440, 0xc8f2169c +0, 324000, 13440, 0xbf8296c3 +0, 333000, 13440, 0xee1927d0 +0, 342000, 13440, 0xdd84e8d1 +0, 351000, 13440, 0x7be57be2 +0, 360000, 13440, 0xae353f91 +0, 369000, 13440, 0x3ae927f2 +0, 378000, 13440, 0x417227c6 +0, 387000, 13440, 0x32572bea +0, 396000, 13440, 0x8b9e4839 +0, 405000, 13440, 0xad669441 +0, 414000, 13440, 0xc9de99a6 +0, 423000, 13440, 0xb3ffb88b +0, 432000, 13440, 0xb321b8a0 +0, 441000, 13440, 0x2efdbf53 +0, 450000, 13440, 0x9b7aa566 +0, 459000, 13440, 0x563c8d60 +0, 468000, 13440, 0xe3848ee8 +0, 477000, 13440, 0xa84b8f1d +0, 486000, 13440, 0x52da9f9f +0, 495000, 13440, 0x2ed56d97 +0, 504000, 13440, 0x4e8534c2 +0, 513000, 13440, 0x318900a6 +0, 522000, 13440, 0xda96de39 +0, 531000, 13440, 0xaae7ac0b +0, 540000, 13440, 0x7533ad99 +0, 549000, 13440, 0x4e70c2c9 +0, 558000, 13440, 0x9ce5e3fa +0, 567000, 13440, 0xc788fbbc +0, 576000, 13440, 0xd36604a9 +0, 585000, 13440, 0x246221a4 +0, 594000, 13440, 0x290c5c2b +0, 603000, 13440, 0xde6c68ec +0, 612000, 13440, 0x56248dbf +0, 621000, 13440, 0x5b898cbd +0, 630000, 13440, 0x090574b9 +0, 639000, 13440, 0x8df2814a +0, 648000, 13440, 0xd4a6b285 +0, 657000, 13440, 0xa016e921 +0, 666000, 13440, 0x7f93fdc1 +0, 675000, 13440, 0xfd0dee6f +0, 684000, 13440, 0xef04ce0e +0, 693000, 13440, 0x7560bee3 +0, 702000, 13440, 0x5a8cdc85 +0, 711000, 13440, 0x4788f7bc +0, 720000, 13440, 0xc001e34d +0, 729000, 13440, 0xc687eb74 +0, 738000, 13440, 0xbf20feba +0, 747000, 13440, 0xd32647a8 +0, 756000, 13440, 0xe69a955a +0, 765000, 13440, 0x1b56951f +0, 774000, 13440, 0xd1977378 +0, 783000, 13440, 0x1620357d +0, 792000, 13440, 0x2596116f +0, 801000, 13440, 0x7473feca +0, 810000, 13440, 0x7f92bb47 +0, 819000, 13440, 0x6866a683 +0, 828000, 13440, 0xe9b08d7e +0, 837000, 13440, 0xa3fd7546 +0, 846000, 13440, 0xa4416522 +0, 855000, 13440, 0xd8f5572e +0, 864000, 13440, 0xf5746dbd +0, 873000, 13440, 0x256a87c6 +0, 882000, 13440, 0x722aa2c8 +0, 891000, 13440, 0xb26de5f5 +0, 900000, 13440, 0x117f0841 +0, 909000, 13440, 0xda2d192c +0, 918000, 13440, 0xb022442d +0, 927000, 13440, 0xbc4044f2 +0, 936000, 13440, 0x68b330da +0, 945000, 13440, 0xc07228cf +0, 954000, 13440, 0xaa3f3d44 +0, 963000, 13440, 0x25867aad +0, 972000, 13440, 0xa3ecb432 +0, 981000, 13440, 0x93ccdcbb +0, 990000, 13440, 0x8302fa4f +0, 999000, 13440, 0x2f960f33 +0, 1008000, 13440, 0x15d41d14 +0, 1017000, 13440, 0x636529d0 +0, 1026000, 13440, 0x11035be5 +0, 1035000, 13440, 0x9b6e9167 +0, 1044000, 13440, 0x7b01adc7 +0, 1053000, 13440, 0xa237e05d +0, 1062000, 13440, 0xd2f4f134 +0, 1071000, 13440, 0x2052d368 +0, 1080000, 13440, 0x08f7ae0d +0, 1089000, 13440, 0xa89185bc +0, 1098000, 13440, 0xfa628236 +0, 1107000, 13440, 0xdf79848b +0, 1116000, 13440, 0xd19a906f +0, 1125000, 13440, 0x219f9324 +0, 1134000, 13440, 0x46509b6d +0, 1143000, 13440, 0xc5d9a568 +0, 1152000, 13440, 0xb21aaaa8 +0, 1161000, 13440, 0x925a97ed +0, 1170000, 13440, 0xc5e3557f +0, 1179000, 13440, 0x7c57155a +0, 1188000, 13440, 0x6b26d005 +0, 1197000, 13440, 0xfdc7b369 +0, 1206000, 13440, 0x99919fc2 +0, 1215000, 13440, 0xcfe889e4 +0, 1224000, 13440, 0xd1196856 +0, 1233000, 13440, 0xec8348c6 +0, 1242000, 13440, 0x5ede0d9a +0, 1251000, 13440, 0x198ef66e +0, 1260000, 13440, 0x62fcefdf +0, 1269000, 13440, 0x7791f415 +0, 1278000, 13440, 0xfbdb0029 +0, 1287000, 13440, 0xdab12b01 +0, 1296000, 13440, 0x646b2d5f +0, 1305000, 13440, 0x5410f52e +0, 1314000, 13440, 0x7186eef8 +0, 1323000, 13440, 0xca251ef6 +0, 1332000, 13440, 0x757c3b43 +0, 1341000, 13440, 0x59ff4982 +0, 1350000, 13440, 0xbe8ff084 +0, 1359000, 13440, 0xc85a9e38 +0, 1368000, 13440, 0x541b9a19 +0, 1377000, 13440, 0x274893c9 +0, 1386000, 13440, 0x7634b5d2 +0, 1395000, 13440, 0x1bd8e10c +0, 1404000, 13440, 0xa661dfb1 +0, 1413000, 13440, 0x9d01bf92 +0, 1422000, 13440, 0xcb1eb220 +0, 1431000, 13440, 0x0ce27d25 +0, 1440000, 13440, 0x523b594f +0, 1449000, 13440, 0xf0a04c4f +0, 1458000, 13440, 0x0f0ffc3d +0, 1467000, 13440, 0xb0d8b778 +0, 1476000, 13440, 0x5137a642 +0, 1485000, 13440, 0xd213a552 +0, 1494000, 13440, 0xc2fbc9b1 +0, 1503000, 13440, 0xfc2ee379 +0, 1512000, 13440, 0xfb80f737 +0, 1521000, 13440, 0xd6cb2447 +0, 1530000, 13440, 0x124b606d +0, 1539000, 13440, 0xf788a066 +0, 1548000, 13440, 0xa16eed6e +0, 1557000, 13440, 0x73ff0f82 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-sign-bias b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-sign-bias new file mode 100644 index 00000000..4e4f6c4b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-sign-bias @@ -0,0 +1,9 @@ +0, 0, 614880, 12ce23b288485be3ddbc1db28c21517f +0, 3750, 614880, ce352e1079535ea058c0e9ad50f7cdb8 +0, 7500, 614880, 9f6bf2739a027dfd12c81586cf75d3a3 +0, 11250, 614880, 7593a85ab7790eb39d65fc53f769ed8b +0, 15000, 614880, 52f47f1e0348f3297d9f233fb5405e8b +0, 18750, 614880, cd51d2c200bfd66e8e1b0fd6b404570f +0, 22500, 614880, cf535cf0a53e903cd98a9a944b72da6d +0, 26250, 614880, 1b270fd2b56daa7892102c2885d23201 +0, 30000, 614880, ff373c0c8a4a319c84e72b1c3d76b399 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-001 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-001 new file mode 100644 index 00000000..df138923 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-001 @@ -0,0 +1,29 @@ +0, 0, 38016, 83c78b5db579710f61f9354d5c51e8c8 +0, 3000, 38016, 8d089d226f52d6cdaffdb3fcc080b75b +0, 6000, 38016, acaae81ca812145e85e0be83bdf54226 +0, 9000, 38016, e94651d798b6bf5f09a9bba10cacaf7a +0, 12000, 38016, 60c2607913e528d501962bf407341731 +0, 15000, 38016, e683f2bf28b31e36db88087bd03b6917 +0, 18000, 38016, 0c2923785051bc9b90c2447a85527764 +0, 21000, 38016, 1bc97b6b2e4ca36b149c3768495747ac +0, 24000, 38016, 0586d948ed3fd479c6dd08055973bcb4 +0, 27000, 38016, c9a1198e1680487c77a2d1631695aeec +0, 30000, 38016, 547d8ffce9c085231c74717a9b815625 +0, 33000, 38016, d31c02a5591eb7bd8e73703252e1a1ab +0, 36000, 38016, 23bafc8e22b2ed7e8c5e52369095cd30 +0, 39000, 38016, 9725d52d7810a19b20dcc9bb0fa36abd +0, 42000, 38016, 7aefaabdcd2595939fd05078d01b484b +0, 45000, 38016, 828e758d6f0b29b2693b2dc6b09249a6 +0, 48000, 38016, 53f09380dde1420ba270b74d8819537c +0, 51000, 38016, 09791a7db3bc28258350cfdc95d8f224 +0, 54000, 38016, 2050271dc4ba3f3e427cf8088c96e28d +0, 57000, 38016, 4e69d3f7cea45844b740368fcd4dd815 +0, 60000, 38016, 4ed07697e239b7f12ee6a97ad09c08fb +0, 63000, 38016, 1437c129bfbda63ca1d39a94ee91b097 +0, 66000, 38016, 4fc951bf45e164b711591155a59c73fa +0, 69000, 38016, 97d1007e27b4b9072751e87e8d1f1415 +0, 72000, 38016, 18c809835dcc3d30c93ae1be569dcd24 +0, 75000, 38016, de0fd0035a542791c4dda5735657efc5 +0, 78000, 38016, 27a70ff95d0cfa10f54652c9fb8a9db2 +0, 81000, 38016, 2285b9324ec91099626191f769962e44 +0, 84000, 38016, 56794d911b02190212bca92f88ad60c6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-002 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-002 new file mode 100644 index 00000000..0ec5af81 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-002 @@ -0,0 +1,49 @@ +0, 0, 38016, 872e9922f37f0e92c767d33e0a15b8e0 +0, 3750, 38016, ea5ad6c6ee4355018fc0ba83b5172836 +0, 7500, 38016, fe744612b2167c9ba6e1dc81c031e16a +0, 11250, 38016, 744359695caee3f32307a2d7eef09e85 +0, 15000, 38016, 07211ac8d8bae4d931ade402ff6e3c12 +0, 18750, 38016, 2ce02854f228b1378d9dc34cab8d343b +0, 22500, 38016, af5222ad42c4f22f22fbf19c26c02dcb +0, 26250, 38016, 88538d39f2647df8fedf15bd1b767bbf +0, 30000, 38016, d0d936471dd4e9922eb067c0f09eacab +0, 33750, 38016, 03cb1f5c5026e96f6e686aa1fa9b1028 +0, 37500, 38016, 2ebe35e23d2244c5b0f777fbc01f8f37 +0, 41250, 38016, f9314f5ea91ebbaaed6e37ca0701ed67 +0, 45000, 38016, 37dca7530d09fd1e8bad154b9e312ea2 +0, 48750, 38016, 9841dc8ff6424abe362c4dfe03b5fbd0 +0, 52500, 38016, 72bd0b70c576dfb544f622c488217491 +0, 56250, 38016, 309b21c126153f20f312e38a8dad44e1 +0, 60000, 38016, 0acbb170ede66ebdae4e9d8e56908f75 +0, 63750, 38016, 318c9c3e531d00734b5f78433da176c9 +0, 67500, 38016, 0388dfdb2a792148b44bdb705cc2df99 +0, 71250, 38016, f440adff2b44888becbf3ca16e425441 +0, 75000, 38016, ac41431627d8d1712d40412ab8c3200c +0, 78750, 38016, 417e1abbfe2a078663dae688ae4a9bb1 +0, 82500, 38016, 73d493bdf4a29d5cfeec610109f582a8 +0, 86250, 38016, 3c026a536ef36467d4a9db6bcc20cec1 +0, 90000, 38016, 57836430f2f10862b84541d99cca062c +0, 93750, 38016, 04ad6fa97e1ff49931b574bdaaddd5db +0, 97500, 38016, e94f2ec4cbf2b9067a4a4307eadebb6f +0, 101250, 38016, e3542cdee672d97c65ab06dbe611247d +0, 105000, 38016, 6c83c6c76aa8bf73646eb7a714cb42bf +0, 108750, 38016, b5f64c6fc6d0c777a0a0b9097862f171 +0, 112500, 38016, 293dccaf5027759679bb9e8696b6381a +0, 116250, 38016, 1a3d015ff9b164cb7922aef0aeac520e +0, 120000, 38016, 93f9152d9425f0ec43160a0c01c485b2 +0, 123750, 38016, c7c4a8f78f781f70cedc44edc1d06911 +0, 127500, 38016, 21330442d5bef415fd765759d867c98b +0, 131250, 38016, 6164258040f85206a3833aeb4f27a34f +0, 135000, 38016, 3213e1405dfe6588a7334a8bc2b1e47f +0, 138750, 38016, a619fa73f0081a349dfa2b000de19045 +0, 142500, 38016, 1f3cec4bb793dc4a118ddcf500090f37 +0, 146250, 38016, 12308ec77632ca10f1451aec8e62b82f +0, 150000, 38016, 018c7f50ed4a494a9fcd32fdfed6705f +0, 153750, 38016, a7282728fbd7e0b49a6967b0ea4e1f61 +0, 157500, 38016, 6aa15ab83e82f246ee9c7b7a040bfaac +0, 161250, 38016, e4c17d2603e03753d54a142491cf5dc0 +0, 165000, 38016, 0a7331aa707e42e732f04e9175438195 +0, 168750, 38016, b522cfa3f3c706d1901231bb9e6b4b8a +0, 172500, 38016, 7b2a70e47d9af98cfa6216ed2a7d528c +0, 176250, 38016, b56e22bc9beacff9c3207b2757fc7f94 +0, 180000, 38016, a3dfc9461c0480cf56ee465ddabf0de1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-003 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-003 new file mode 100644 index 00000000..9ff42002 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-003 @@ -0,0 +1,49 @@ +0, 0, 38016, 96e6ce168b5ef377053e86ab5484e7f9 +0, 3750, 38016, 10fd750292d8522ab7ee577043604789 +0, 7500, 38016, e040995173dc5c85abbbe38f6823ff9a +0, 11250, 38016, 5aa18f4fbd8b5b887d74f84cc92075dc +0, 15000, 38016, f0dc7f520e88b94e5cb924d804b0472a +0, 18750, 38016, 2375955dce3bb0a824779a800cd1555b +0, 22500, 38016, 3e96a0e477de39530e1950cff284a854 +0, 26250, 38016, 6cd40fa8a89221f2b990bd8af2a9ee14 +0, 30000, 38016, 0b929243ceeffce836279e2aa84647cd +0, 33750, 38016, 1e95f0ad25fe033076b57c3852bb3550 +0, 37500, 38016, 81aa93a3f9c56d2aa4b8285d3507e6b4 +0, 41250, 38016, cf9947a302dec306d7f487cf3a2731b0 +0, 45000, 38016, 3b9ca47752db95a049678da07974b476 +0, 48750, 38016, aa6788405dc47dd44867fca6c95ba3d9 +0, 52500, 38016, 276d1c62b908c081c7bbb78f943b0de1 +0, 56250, 38016, eb006b6218e457fd794e9b3a5dfbf638 +0, 60000, 38016, 9dd5312833e770286c5aa5436a00376e +0, 63750, 38016, 7899278e66aa255ce5bf69a6e1137d0f +0, 67500, 38016, 0ac7d062ea7550fa0717723b1272abc2 +0, 71250, 38016, d8f1bb881a46ecafcbbe457a004a71f1 +0, 75000, 38016, cc3a04b98159189a74b5241df540d8fb +0, 78750, 38016, 4e29eb2c8c465ae9ffcfa28ec0b3694b +0, 82500, 38016, 608fb6ba526e6aa4ad1c0290aedaa69d +0, 86250, 38016, 4acc6a73547be6310b9a275436c55805 +0, 90000, 38016, 482cf409b86242d30f3a78a6c85364df +0, 93750, 38016, a22cb76770f112eb1169218cc87c1e4f +0, 97500, 38016, e74675b051ff05e178a9a24893721d99 +0, 101250, 38016, ee5061bff62c8c8603b7bc2bb2bb29e8 +0, 105000, 38016, a3c0ab11f338bd488c69f2b62e1e5a74 +0, 108750, 38016, 9f6b7e30e0ed4e272393b9a9957752e1 +0, 112500, 38016, 9cce9f2ffff1766d05bda04e46eff997 +0, 116250, 38016, 5105a2ba923bc6f21ea3d32ab1bc7bf8 +0, 120000, 38016, 957d619a1001e2b5e52db166b66b7f50 +0, 123750, 38016, fdb4e71cddeec8a321d9c8d4ffc506ce +0, 127500, 38016, 9ee646940fb8ac2312d29e9f1c3b6d40 +0, 131250, 38016, a110e81d2105beae81cd36b15bc5ac2f +0, 135000, 38016, 804b6d8fc99fadb9c6bfdae3becee6b5 +0, 138750, 38016, e217627bbaeebf30456e38aeb1f0746b +0, 142500, 38016, 56468a2c548dd3085b4bce88c4a1e41d +0, 146250, 38016, ef170e7f21e2b262525b43d6b25dec4c +0, 150000, 38016, 3acc3c47def8a0fa0561eaacaf9e41a1 +0, 153750, 38016, 0c3e2187f13e4504fb4b246706bba83c +0, 157500, 38016, 397326a22e6e49487309c39d64037df8 +0, 161250, 38016, 95236c1319b6f1f692b3998547811ee7 +0, 165000, 38016, 5aff1957504884abf74d6fb74b74b032 +0, 168750, 38016, 6de06343435a8926a746037cab5f633c +0, 172500, 38016, 3de68e05ddf2c60ee9110048ceefeb6a +0, 176250, 38016, e637fef689edad6ffd6eeb4a29004bf7 +0, 180000, 38016, bb809114af8df5cb4ed82d3a1d11a673 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-004 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-004 new file mode 100644 index 00000000..56e05b29 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-004 @@ -0,0 +1,29 @@ +0, 0, 38016, 83c78b5db579710f61f9354d5c51e8c8 +0, 3000, 38016, d173eb8a8211a05672b43206609c9034 +0, 6000, 38016, 204e3e91613d647d30244c00fa2b9563 +0, 9000, 38016, 3cc1a395bd10a49b006741778285925b +0, 12000, 38016, 024548b00dea4f104d6b9a728be05786 +0, 15000, 38016, 01401e9418f2e00ab4ffdb3296d40ffa +0, 18000, 38016, 35d8b3c1ef9cb864315b7502b93629b2 +0, 21000, 38016, aeb44f0fe4c2eecb26c0bd657d65b00b +0, 24000, 38016, 42e40bed012bacf59f0c41d4cfd3e52a +0, 27000, 38016, 9796191fa2bd4572123ea043396e8485 +0, 30000, 38016, 2d6d68b902129f3c3f1730e73b98f9c9 +0, 33000, 38016, ba348b89248b92d0b86d794dc413e6a0 +0, 36000, 38016, 5ce49bf164033d49bef1b23120d202d6 +0, 39000, 38016, 54837a426c63a9c40ef8750232615dad +0, 42000, 38016, 350bcddf9a34f5003f6f655aaa020a00 +0, 45000, 38016, babb82b1e2ca9315816b6f43b8ef84a0 +0, 48000, 38016, c770825785c51fa374fd5bb08ff9f536 +0, 51000, 38016, e9e0f92e416fcd27ca2e93a0804ac938 +0, 54000, 38016, e0f2b89423da549eaa8b2b89f956f0f8 +0, 57000, 38016, 9926b7e13b51115735eb0af8bb5e4ea1 +0, 60000, 38016, d6b30a058b854c54068ebfc2b05f8fa0 +0, 63000, 38016, a03048df79e41ada8a3ecc15a85e3f94 +0, 66000, 38016, 34bef9af0633a43434841fd5189c161c +0, 69000, 38016, 219b447552b1ee409c1b9b56176d36bf +0, 72000, 38016, 95ea99459eaebc2f7233feeaf0549224 +0, 75000, 38016, 34e08ce4067ca67ee9014cf628b6bb1c +0, 78000, 38016, 066c09a20d11b9dc3fa6972fd7f242c4 +0, 81000, 38016, aed02c1951070ae5febea21ad54add55 +0, 84000, 38016, f5a0fde2d818c4aaabd29b069ced6aea diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-005 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-005 new file mode 100644 index 00000000..b672ee9b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-005 @@ -0,0 +1,49 @@ +0, 0, 38016, e7a4be434df4bb524ba56a03cba901f4 +0, 3750, 38016, d903ade6d49e51485627c044fbb2190c +0, 7500, 38016, af07ee39629b852870104cb9a9dde9e3 +0, 11250, 38016, 388a5f736db2de15342b62294fda4c82 +0, 15000, 38016, a072600936aa77738fa2fa88ba212849 +0, 18750, 38016, 0f96b1fb05b92498c0e1fcb6552e7e79 +0, 22500, 38016, 68b0db002a0127ee79a7c70062aa8c3a +0, 26250, 38016, f9bc8edfeb9ceca9227a20cdab6788de +0, 30000, 38016, bfe2115b000565abc3dce1d38f804ed7 +0, 33750, 38016, 67f17f96177f5464af1b97452560d2af +0, 37500, 38016, 658278016e5409b69d014fab0d94d0ea +0, 41250, 38016, 04dfd36afa0ddf22993d21c0a0fc715e +0, 45000, 38016, 088e5a7cc75a895f01f7a4362f104bc1 +0, 48750, 38016, fb622a1a421b3689950f1adde9296dbb +0, 52500, 38016, 3711ac7adc816614a2efda9e138f53fc +0, 56250, 38016, 8e6fe3e68ccf53f23dd430b611fbfa6d +0, 60000, 38016, 1c77dd651cd38d3308671f0705d29926 +0, 63750, 38016, bb5d7afccebc5d8a29f5980d21530d61 +0, 67500, 38016, e51f2eeb39afa50ea243eaca39974f82 +0, 71250, 38016, 7a73b1546fb5d8d4b05ebd4c839f74f8 +0, 75000, 38016, 62a0db46717d7fb6523c62968fd3bc85 +0, 78750, 38016, 98d6e520a164c42c5d19167c0ad48b22 +0, 82500, 38016, 9749a21ea432221323c1a6b61ea59d51 +0, 86250, 38016, 45fa9a9583db0139611b860bed8f6bc1 +0, 90000, 38016, aac06fe351759ca81a5028f2f4a7b534 +0, 93750, 38016, 7b7c7c16a377d61b6fe474541a18f0cd +0, 97500, 38016, 2a84883fdfa8450d46b8b9352b7d5a87 +0, 101250, 38016, 3fc42d7dd6fa25ec17d8f2881f81b376 +0, 105000, 38016, bfb243be1eada17adab5580b748248e7 +0, 108750, 38016, 531fd799989db62210efc1999397d280 +0, 112500, 38016, 1c1e68673b295e17fca1b14d1eb1995e +0, 116250, 38016, 12ee0f8810a1a3574337ef98987cf919 +0, 120000, 38016, 0c6ef1cec243c552e83054d5ac56a8c1 +0, 123750, 38016, cf0af3fb96e57143d335086485fbfa5c +0, 127500, 38016, f5df68bb123d1f2f59ba471fbd118a9e +0, 131250, 38016, 0b4a0cf5dd7968fd26959ad2849655b0 +0, 135000, 38016, 0ba766224688a95bfa43ac2453555972 +0, 138750, 38016, ef3f9fd7e5509bb880377fa1997d318c +0, 142500, 38016, d7486c3176cef98c0046522acbdaa4f0 +0, 146250, 38016, f8dd15973993f4a2acd1d34b3610622e +0, 150000, 38016, e99b7f294e6bdd9ae18f013f62174fcd +0, 153750, 38016, 68ccf7e14a1055b24c5faf1b3a1888e7 +0, 157500, 38016, 2f230afb6e5c67e4b7e000317638e919 +0, 161250, 38016, 9cab31ac76ed26a879ac8b88bf7d33a1 +0, 165000, 38016, 1e2affc0f458808b4564bd0453565a81 +0, 168750, 38016, 79669092f6c73053c3de6d0d1408cc8c +0, 172500, 38016, 7b27977ba84341b9af4d58a7864f763a +0, 176250, 38016, 2481a387d65e7a16fe831b8da2200985 +0, 180000, 38016, fa5e3bc265877b30ca71de0a2b14663b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-006 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-006 new file mode 100644 index 00000000..bbdf8142 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-006 @@ -0,0 +1,48 @@ +0, 0, 37697, 9ca5df27b0158aca2a38dff946f58c41 +0, 3750, 37697, 627129a99538ec1ac51be910ca92ebc4 +0, 7500, 37697, 6c2df1f21af317aa5bb68b161ca96c70 +0, 11250, 37697, d66db823863838ca5b7f9125609e7de3 +0, 15000, 37697, ecc970f8846290c0b7bf8d0865975cb7 +0, 18750, 37697, 2fe7575c448562e291933e297335e1c8 +0, 22500, 37697, e2a6fb8af11f65ce1153d6021df39e5f +0, 26250, 37697, 4536008cd0a425c9a9d93cbb3e8ba640 +0, 30000, 37697, 478f042fff1cf0b6fd2eed391879c7ba +0, 33750, 37697, f079ee39021b1dd730f80bfaff9a6ae4 +0, 37500, 37697, cb9b166c785ceabecf79e12e6068d4e4 +0, 41250, 37697, 6bd6f77dc9c45cec08949a42aa1c2653 +0, 45000, 37697, 1433577eb50b3270c0f1d6d26fb26277 +0, 48750, 37697, 2765b207d230efd9a3e2e93c641b8553 +0, 52500, 37697, a67e2f6bcf3b03e250c0ad8f1384ffb6 +0, 56250, 37697, b5ea80e2dbffefdd8a613c25ee7f5f0c +0, 60000, 37697, e4b58bf735a8258842ad3c364eb9418c +0, 63750, 37697, 8e5fc5d4c78eb495f62e4a014a6a2a6c +0, 67500, 37697, 53bee2faf4cfae16037cda36a6194a57 +0, 71250, 37697, e5c2e1de872a7107f80966ae857557d4 +0, 75000, 37697, 882e46851681e6e3b376b5d1d9e139fb +0, 78750, 37697, 40b199fe02b5885947af22ce1314a085 +0, 82500, 37697, 942b79dd5360c2a114db760424620a84 +0, 86250, 37697, fe9f69dd6fc113ceec9127d9e12b3958 +0, 90000, 37697, db13edae7e8e8a91d1ec84227c8f818f +0, 93750, 37697, 1963ea61c3e93150f7604ee6fa09b12c +0, 97500, 37697, 8cf43556160454d2353cedb9ba5675aa +0, 101250, 37697, a5e6b5b00fea3d9b1bdbd01fda712f27 +0, 105000, 37697, 35f006cb6e570999b9011282c49c6d22 +0, 108750, 37697, d884d482371cb2727e26475bb390d38b +0, 112500, 37697, a7233206056d3af69c6cff343b57de84 +0, 116250, 37697, 437492f3e594576e1c17065e0091aa2d +0, 120000, 37697, 47f0677d9aff054056a194755628fdb8 +0, 123750, 37697, fc93105a16501763a6e6ba3445ee6f32 +0, 127500, 37697, 68612903d08399e0f0d9e28c1f18f6ea +0, 131250, 37697, a340fbba24c73372e6248f10e878f11b +0, 135000, 37697, 58c3561b06f9d866587f728877c08860 +0, 138750, 37697, f2dd2a029515ad9c0655ccf86a2c524b +0, 142500, 37697, 789d43f63cbb302dad9f3e4b33713746 +0, 146250, 37697, d8f979aca1774470269283da048a505b +0, 150000, 37697, ecc06e2175290319cb36614370c8ad62 +0, 153750, 37697, 5ba26b83766b666007b502a7194170e3 +0, 157500, 37697, 8163a20e9a345b70579c625c50e7ec73 +0, 161250, 37697, 1f1a497d768c4bcd57de11b21baf9138 +0, 165000, 37697, a21e9a52a982675815c9937b49ebb0ff +0, 168750, 37697, dcc0bd83ce31ac99577cd2f9ced69096 +0, 172500, 37697, df36b27588b8515580d5015e5f66dbf9 +0, 176250, 37697, 156a6351549949953ce3197b990760a9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-007 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-007 new file mode 100644 index 00000000..d4aa997c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-007 @@ -0,0 +1,29 @@ +0, 0, 38016, 98bd0af6928c144888a9c320270e9f0e +0, 3000, 38016, 9ff7cff703d58481acd233451388377c +0, 6000, 38016, e4cd8815527846cc782ea61ef5a46e49 +0, 9000, 38016, db45275b87e194e5b505dd8c47da4f5d +0, 12000, 38016, c889d0f7bd34faf4df0e0a9eb9fc292a +0, 15000, 38016, 4dbfb1727baf9b75980e7fdd44ca0924 +0, 18000, 38016, 5f217ac95c891dc81f7193fc5352d582 +0, 21000, 38016, 11166789635e472f629510f551b11e2c +0, 24000, 38016, 336e6e42e67e1ccb7cda6298cb63f192 +0, 27000, 38016, 02dbcff56882e304d5043d0f9b1ff9ff +0, 30000, 38016, fe033ea2c6b8b81a9328b470f8b0d6bb +0, 33000, 38016, 0e3330fe9a7c0439ff53f18f0d15eb48 +0, 36000, 38016, 6c0d7e042a3bb32a128c4a405f59b426 +0, 39000, 38016, 7e51afc33dbf4b77fc5735f5d9ec0248 +0, 42000, 38016, a8381f193f34a5071b8eeba7f5cd1968 +0, 45000, 38016, 501a7914b47ff85c24f0533ee98b9fe9 +0, 48000, 38016, 00bd5fbb7e3b66514e6c77c3a5f118c3 +0, 51000, 38016, 23e296d12a45909cadda252b9f4e67bd +0, 54000, 38016, fa0b5c69bacf766551bebdde0910eb9f +0, 57000, 38016, f5cc24d10d58ebc50503ca321db708cc +0, 60000, 38016, 3997eb9ff6231dee9e23752776113cd6 +0, 63000, 38016, 68d4c9cd494d91dd70e7a94c7a4b9a12 +0, 66000, 38016, 647b34f3aa7318adce68803ba00104fb +0, 69000, 38016, ffed5301bd6fddd1d24d12e6096cc8a6 +0, 72000, 38016, 9511388180811c10d166886868d6e71c +0, 75000, 38016, a9b330803b8ccd91596591c0449423ab +0, 78000, 38016, 69b192888cda09dac658d5820183a2e8 +0, 81000, 38016, 8886e5851e60a7474cc9e214ba6373ad +0, 84000, 38016, f59e354deedb129a90ab3922838b03d3 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-008 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-008 new file mode 100644 index 00000000..105b6b49 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-008 @@ -0,0 +1,2 @@ +0, 0, 1907424, 7146d3a72b6cb8e43ee5280ef8d661fe +0, 3913, 1907424, 5a537e9710158efb5ad2683a1d3b4c72 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-009 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-009 new file mode 100644 index 00000000..c65210e0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-009 @@ -0,0 +1,49 @@ +0, 0, 38016, b3a3121c796a60c88988fef5240a07fe +0, 3750, 38016, f25147764829cf837e00b8fd6383e2c4 +0, 7500, 38016, 1b1552291a89c97d5deea145ab0ac0cd +0, 11250, 38016, 0b2e75bbbe8f4248eb1519b6542efc96 +0, 15000, 38016, 99e8fc68547e119253ee3b8d79efa774 +0, 18750, 38016, 3aaf9210819238da7f704339bd8f262c +0, 22500, 38016, de80b11f4c325e6d467d4abe5ad0db51 +0, 26250, 38016, 93d2fba68721768018b35ccac27b6bb1 +0, 30000, 38016, 07d7d4f8ad4151a013b652bec21ea9b8 +0, 33750, 38016, aaa95e4d39aa31cf68fdb8da268827e5 +0, 37500, 38016, 3607fcda0733e0b0fd10a8f7fbe6e39e +0, 41250, 38016, 6d8cc24ea3b9827ef0147c8b7cc6938d +0, 45000, 38016, 977a6b65d41b1b70dd4df9f526045675 +0, 48750, 38016, 9258b0e5fc2217c3aebbd96bb06c937a +0, 52500, 38016, 887378a3aad18346a3827cd0aadc6873 +0, 56250, 38016, c2a3ff302d74eefd0855f2c862766aca +0, 60000, 38016, 1a7d835f5a977e1fd8cc37bdd8d029ca +0, 63750, 38016, 232be1f7e334001c3abbed550cc60c34 +0, 67500, 38016, e8cb3470b9a3ffbc7014793514dc89cf +0, 71250, 38016, 54b20adca41910f003790a975ff7b50d +0, 75000, 38016, 2c5fce4dcdd538f1d9377fa071f3d615 +0, 78750, 38016, d559840da8cef1f0b1379a592f708f0a +0, 82500, 38016, ffab5f1060938a62cf8ef9df30ec8a33 +0, 86250, 38016, b7d93c8eda8cce4d387f2ea78c415704 +0, 90000, 38016, 7840aa27333e6350d114b256ab4304f1 +0, 93750, 38016, dc1f3b125177d0ad7f53dd058bba03e7 +0, 97500, 38016, 37134fcaad963a22f4df04c0765af455 +0, 101250, 38016, 4dc062fb76943a75e7b2428e5babbb3c +0, 105000, 38016, dfda91bc05efc72073a2b6b62f294327 +0, 108750, 38016, 7ffc690c63a1c54e35978336dc5828a3 +0, 112500, 38016, 9ae31bacbc097c2ccf1500ff89882e46 +0, 116250, 38016, 1450c24713dcad41aeba1c44007bf12f +0, 120000, 38016, f125bb52b8a1b11e076de55cca1069ee +0, 123750, 38016, 555e1f2a6d293a0bdc9f92e9c3b3118d +0, 127500, 38016, ec9a8d577a07a4f0d5deae63b3cea6dd +0, 131250, 38016, a54f74e0ee329db4a78851bb7e54b2ba +0, 135000, 38016, 99fcfe7ed9028bc443a790f9cf8eb812 +0, 138750, 38016, b9b994ffbe0150945b752a2120b4a475 +0, 142500, 38016, f00d70d8a28cecaaec1eb84592e3f6c3 +0, 146250, 38016, 3bc8ed07fc92c4d339164891e6624306 +0, 150000, 38016, d755777560d745d6bdfa01b9e9cbbcc0 +0, 153750, 38016, bcefb5ef8fae173e413406b4a60e2255 +0, 157500, 38016, fb47098c334b82764e30819066b13096 +0, 161250, 38016, 9e31f68fc96045bba43cf1253eedc419 +0, 165000, 38016, 53522d46d2ba91ab23693db7d41ecda7 +0, 168750, 38016, d66a074ebe6123590622e5cb308d75e5 +0, 172500, 38016, 6574fce175632a22fcc05b47157318e4 +0, 176250, 38016, 31f7fb05d060c1dea46044787772baaf +0, 180000, 38016, cec733062ae526ae71b39ae0dc402482 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-010 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-010 new file mode 100644 index 00000000..ea5c8f39 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-010 @@ -0,0 +1,57 @@ +0, 0, 115200, 3441ec1a9b9d325c9aeda44e3b68377d +0, 3000, 115200, bff86a84fd673394f45c09d19a1ee0ac +0, 6000, 115200, 8cd920f0de408e8cd883f9241680ff80 +0, 9000, 115200, d1b27cbb40859bbbb6da40dce6ddbf1b +0, 12000, 115200, ca102ed86e45fe452f55a2cf0253de21 +0, 15000, 115200, ac7630be64017becd6e958df360263b5 +0, 18000, 115200, a044041ede746687d33ba6342d8d3edb +0, 21000, 115200, 75d7c0eec357afd0c2d54e769f551b20 +0, 24000, 115200, eebd916e4fba53a66fc8e6ab98091a0f +0, 27000, 115200, c0044160a944dcac81efe9f63def4bc2 +0, 30000, 115200, 9ba8b2ccbea045b39bd150ea383abc00 +0, 33000, 115200, 8d7654804fc62f7d52d5bf3d47f536e9 +0, 36000, 115200, 9fd6cd81fbe6cfc43e03cdf166c7ea93 +0, 39000, 115200, a1a494064dba27238005227c0808c5f6 +0, 42000, 115200, b8dca72164ea72b3f257c97c3ad87416 +0, 45000, 115200, 90ae005c0f3ddb4318318805b8fc29cf +0, 48000, 115200, 8183e7b60f18887a9530a7905db4b417 +0, 51000, 115200, 1650ad1fff9076141f59b660c562f0f2 +0, 54000, 115200, e9ee675cafd270c366ac9d3ced5af879 +0, 57000, 115200, 2257172d6e8628b4dd4d9bf97e9ee2c3 +0, 60000, 115200, 577438f88feca7a876381a6fcf094684 +0, 63000, 115200, 4b37e90eb35cba66d31616169020c039 +0, 66000, 115200, 2c631ab87b8d3b7df13f888e3d6f1690 +0, 69000, 115200, e0d46e04d6a57b20c2b056cd0a0ca1ec +0, 72000, 115200, 65bd3e207b8ed966b71f40a04f1900b8 +0, 75000, 115200, fd842606a20fb297463b7b3dd6efa2c2 +0, 78000, 115200, 778cd96eabe785320254db7692583f47 +0, 81000, 115200, 094272ad385a64fbc70a62f958e27eff +0, 84000, 115200, cf5f7b3b94a00938b633ea1d9aa8e8dc +0, 87000, 115200, 032e2f3649484ca17c739cf89052de77 +0, 90000, 115200, 9afe92189c21675745609e3b21a75941 +0, 93000, 115200, a5e087c496798bfbc64d6c26eee0b3af +0, 96000, 115200, efb2716347ba2e01f7dc103d2a6cebb4 +0, 99000, 115200, c83541678dcca8937e372102bc4d1f68 +0, 102000, 115200, 3401ed97a9296610c8473dcf03e13f20 +0, 105000, 115200, 35af1327fafe026b6539951a9baee282 +0, 108000, 115200, f320e2d64192849c08c4c5e6d79e4ecf +0, 111000, 115200, 5a661af83f451d8651cf081399d451b2 +0, 114000, 115200, 625d271b60d91229699f1de35d232b13 +0, 117000, 115200, 8e504154fa8eba5f9807bf40c647eea8 +0, 120000, 115200, 094ecb39a65c71e85d15a587472bb336 +0, 123000, 115200, 4d08bfe5771f00e13646be49e3471c4c +0, 126000, 115200, 20841206e07721fb631088d492622543 +0, 129000, 115200, edf969142e1b053f951c1a5756f2b5d9 +0, 132000, 115200, 4959a13f20311d9b435e501fd753c94b +0, 135000, 115200, a7f34e6c985d630af07a9f6dc47ea50e +0, 138000, 115200, 96f6667d849f3abe4e85e3ce368b76ee +0, 141000, 115200, a47d443c8aa5f2d2e3b44deab3f4f8e7 +0, 144000, 115200, 4ebda78d96facc4472ecdb4f667be0c6 +0, 147000, 115200, 6ba744c47edab85c6e77584e35e1b735 +0, 150000, 115200, 4d2e6882f15356171e4383111ec70e6e +0, 153000, 115200, 85077fc81dff947b1251bfbd981aaf52 +0, 156000, 115200, f03e8879a5218387c502eaab31682df9 +0, 159000, 115200, 90f6128298cb52f769d697f9f842df27 +0, 162000, 115200, 700a705680c1a940141bc03ae5de391b +0, 165000, 115200, 049b3df3ed9673ab8e0f0d0d896f65c2 +0, 168000, 115200, ca8c3e5509211dc92078371f06dc8635 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-011 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-011 new file mode 100644 index 00000000..99409cd4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-011 @@ -0,0 +1,29 @@ +0, 0, 38016, 83c78b5db579710f61f9354d5c51e8c8 +0, 3000, 38016, 9b755a63c7c5352660a265f6e24991e1 +0, 6000, 38016, a591f0b04447d6d6dd9bb990502594aa +0, 9000, 38016, 6ebbd38d20a4104a842c66df53a8b86e +0, 12000, 38016, a114c37e74a4252ed66c5c4e7c8df84b +0, 15000, 38016, 4bad182348dcfb627b3e15bc228a3c8f +0, 18000, 38016, a843b5c80266f890044a4ba1f59de8ed +0, 21000, 38016, 34816d9129f252afcbd56d6ad1df94c7 +0, 24000, 38016, 7d7d46cd08e18aea6fc52c0ec58a4803 +0, 27000, 38016, c96c3357d89534fce32251a0d52c68c5 +0, 30000, 38016, 5eb1329f955ab80696d8220605a51552 +0, 33000, 38016, 68b3d5162cd5b004a6dfeac705c75afa +0, 36000, 38016, b79647c678fbbb9ffbd8c4ff63c05e43 +0, 39000, 38016, 4566eb5f995852d72b6913d2ca2e321c +0, 42000, 38016, 02e7e951ac9e42eafb1260defaecf685 +0, 45000, 38016, ddbfa0f81a009c41271c9aa587e88baa +0, 48000, 38016, 27d31dba74cb2170c456830a9f888c0b +0, 51000, 38016, 0537650a41bb087a5fd33d6347fe9036 +0, 54000, 38016, df2205297d4f00164a3440c8fa1ac4ee +0, 57000, 38016, 9942b757bd3839c1cd6b1068c68967f2 +0, 60000, 38016, d9284e1e989cd38d0226b1a3c6e89409 +0, 63000, 38016, 12427a3fdc22461fe9d6ff9dd5863bef +0, 66000, 38016, 63f75f2a63630347671c0e6dd2f88bcb +0, 69000, 38016, b161169a678e3959b492d83a03d47dee +0, 72000, 38016, 50a6d4c8722197f0abd1028b968dce58 +0, 75000, 38016, c0f81ef6b25034cff00db1e3c369be97 +0, 78000, 38016, 01b502a4b69d5be7a82f292e735aa087 +0, 81000, 38016, 6bbff03307f93a654e4529e2a5092887 +0, 84000, 38016, 17ef5fd4bd1cc6030e1370a43f1d19bf diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-012 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-012 new file mode 100644 index 00000000..5af0e4c1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-012 @@ -0,0 +1,29 @@ +0, 0, 38016, cc3069a59b6f4319761af2b39923a6e5 +0, 3000, 38016, c0bc935941d994c6af6a864f02a90a62 +0, 6000, 38016, 5b6073ce4a03967aa87e56dfa27e32c2 +0, 9000, 38016, 5310a9d6bf938ed89b10727f11e131c4 +0, 12000, 38016, 290fb1310ea10b862b51d37ff9d79f7c +0, 15000, 38016, 0ca1accba77dc867df682b8e3768d6e2 +0, 18000, 38016, 2a90659dd4cd5d2f825641be55609d97 +0, 21000, 38016, e003db31fbfeab54385252e8c64197fc +0, 24000, 38016, 0778609bd9626652e8a8dd07d5ef9f45 +0, 27000, 38016, 36eecf49c4aa2d8c3f232a1dbbb5f4ca +0, 30000, 38016, f69f30dd8ebb7db4c51e0371f6a23736 +0, 33000, 38016, e9d5293db5122b9683a0853c2ef678cb +0, 36000, 38016, 75d6a09bca67a82c8aacabb710558330 +0, 39000, 38016, 973d73aa4bb4e3de2cb1ba97685e08ca +0, 42000, 38016, daf9ce67baaaa02bc56f49b540f22a30 +0, 45000, 38016, d08fd3b942e1219132015819c553f2c2 +0, 48000, 38016, 0aeea73b030e47bbd80bb0fb33fb6ebd +0, 51000, 38016, 6e9f5f98fffe27abfae52304c693ae44 +0, 54000, 38016, 961c71a47741a1ac47fcaebf958647c8 +0, 57000, 38016, e75e53160b9f33eca0dfba999d8002eb +0, 60000, 38016, ebb5d79336f75c44a09971dbba6947f3 +0, 63000, 38016, f02317fae5e143103a114ca692b58c25 +0, 66000, 38016, 8282867aa63fa23c48cc0216e21933cc +0, 69000, 38016, d0d74ebbf56ca62825641028b66cdb20 +0, 72000, 38016, a8df24b0a22fe4fb334ea7063cba8754 +0, 75000, 38016, 8a570e42ad6ab42ead80b5022c2eb2f1 +0, 78000, 38016, dae566f13fa69de11db3ba7673e6211d +0, 81000, 38016, 914ed8403cdbf4c54d0b9cb1eeee6832 +0, 84000, 38016, 18aa8d4bfe06a04ec4e9ccf9c7a92643 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-013 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-013 new file mode 100644 index 00000000..fbb11177 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-013 @@ -0,0 +1,29 @@ +0, 0, 38016, ad137b9eae93daed28fe31fd5165b4d0 +0, 3000, 38016, 7cd527f647680c0eb305050d27fb8092 +0, 6000, 38016, f306e07a2e86c82a8cc1333be3812326 +0, 9000, 38016, 4ffd6065ef6af716fdb7388479cf300e +0, 12000, 38016, e776c698ae335107d5794c02cf00d3ee +0, 15000, 38016, c0043e3283b96a4aa58d2265b007e67e +0, 18000, 38016, 235dd358e6adb3e144d7d957458e74a0 +0, 21000, 38016, 4d34b966a406e7c2d5cef029ddc76021 +0, 24000, 38016, 65f9eb823a63e17710b111892c415b70 +0, 27000, 38016, 84d4a1d510d1c1aa8f3e7232d574ba9d +0, 30000, 38016, f3218df364f0e283df56b5d4a9cdfca9 +0, 33000, 38016, 3079d93a140b51fe3e7b4889fd5fdd24 +0, 36000, 38016, 4b76d7f904960792b78378c95453b77a +0, 39000, 38016, 26cdd39f9cd862b383352bf769d212a0 +0, 42000, 38016, d98dbe7d7b8a5ccc50cb3a2e3dcacec8 +0, 45000, 38016, a931f142064062d7d2d1245278c6edd9 +0, 48000, 38016, 0c6dae06c59c040801be386d7e883f52 +0, 51000, 38016, cec4a68182fb14185360f57de81e73cb +0, 54000, 38016, 7e819d1d928f974f25d45023a89a6765 +0, 57000, 38016, 6d9a9fd28212940497f881ef4886d756 +0, 60000, 38016, f22969fc06edc0c9190cae8bb22243ae +0, 63000, 38016, 2fcd676dbf66f842e91649a3d6c80f50 +0, 66000, 38016, ce16e8920e91ec208dfb241addfc612b +0, 69000, 38016, 3a205f364751ff5e72d7da20e5713f53 +0, 72000, 38016, 2305bcde500197d7697eec4ba89f1533 +0, 75000, 38016, 23712ae207ea2381f886ed038ec3852b +0, 78000, 38016, 7197e717541573be07f9cda50ba524a9 +0, 81000, 38016, 3f3e3ec6d1d6f49021affbadb75c1fda +0, 84000, 38016, 424fe8391a419b005a6f142ec65d802b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-014 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-014 new file mode 100644 index 00000000..5ce3cef0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-014 @@ -0,0 +1,49 @@ +0, 0, 37697, 7a0356dc950e79744d79c98e391ebee9 +0, 3000, 37697, 96e221e75c290dd847b8e55865073366 +0, 6000, 37697, 67638290841837c90f180a01094f9191 +0, 9000, 37697, 93c8e234e123f7a641c5eb44903b75ab +0, 12000, 37697, b4fa5ce6089221863002019d99ae7f9d +0, 15000, 37697, 5d3b48fbb681ef2b6a0a5e60c03ee5bd +0, 18000, 37697, 26635956a9ed343428b36947723b4b94 +0, 21000, 37697, 18e9b11e10350ab20b89482c5d1c5cea +0, 24000, 37697, 44fe40a7ce85552ccf95a451c5732e57 +0, 27000, 37697, f38758bf6d522023961d08719e92d3ce +0, 30000, 37697, 28a2a9ebb3633a0822c9a283ab1ddea6 +0, 33000, 37697, 4b4485c9419710ad6d3e6aa11fe3a91b +0, 36000, 37697, e3f6850a934c6e3e2fed3026e1e53066 +0, 39000, 37697, 4acff1abe788a4944474b82d10af172d +0, 42000, 37697, 4cbfcc008923e8303df170d4e7b1cf34 +0, 45000, 37697, dde5de0c676f60b4cea26bbf024bbfb7 +0, 48000, 37697, fe1b0890eef18cd4989d251dbc3b7ef2 +0, 51000, 37697, 462303741de9904a13bd46534010f588 +0, 54000, 37697, 7ab2068505dbccdf522a08a65373b6b6 +0, 57000, 37697, cb63092b6880bbdbaa40b40d738aa4dd +0, 60000, 37697, dca7556869370de600afbda82bb45fae +0, 63000, 37697, 5f5cae9db9e3aa3f300706ebc3874987 +0, 66000, 37697, eaf7ba4f48eb5722c09420f2be4bc5f3 +0, 69000, 37697, dd5b43b72c8b9c3ad53afef0f8869a68 +0, 72000, 37697, f5d81cadb4b1f69e9700293e38ea36a2 +0, 75000, 37697, 1e56a6becf3099db71fbc7a996c4fbba +0, 78000, 37697, 7e0676c4af74b59d9560d8b42d400de2 +0, 81000, 37697, 6717c3c344b45e9e202e808d19c9baa8 +0, 84000, 37697, 42b92f6fbd4cc5d4cf4f9b364a8a7741 +0, 87000, 37697, 6caca9fcc03e8b9d326aec18eaaae928 +0, 90000, 37697, cfa2798d156cabe81160c00939102d90 +0, 93000, 37697, 5d018cfac7da660819da2e5d25e8126e +0, 96000, 37697, 761b7b2b64b22abadb89c58ab294520b +0, 99000, 37697, 4e066fa627d4dbf3635148eb6b2a0477 +0, 102000, 37697, e0d6dd242cb99c7bc9826a05895344c5 +0, 105000, 37697, 84e7beedcba6da53feb722f30211d2f8 +0, 108000, 37697, af49b3fcc56b02ca746792b1d3bbe1c8 +0, 111000, 37697, cdd9f17b4501bc7f7bedb70f2e33f282 +0, 114000, 37697, 69d853dfd9b09d299faec521acb4e765 +0, 117000, 37697, c3497292359c1a1de81cd5fb062e5175 +0, 120000, 37697, 0e3994e4a62d8c922dbde51186615ea7 +0, 123000, 37697, 86bc5561c72bd17e7473f54f6b6311f1 +0, 126000, 37697, 0c747481e3dc575c6aad4507f8e62d8e +0, 129000, 37697, 6779dfe5b6a7d4ba5ae5355058f54bc9 +0, 132000, 37697, d7d4e85f48d38c1106a031bd9b57d909 +0, 135000, 37697, a0ab20a38891925fd77ac2b075f0046f +0, 138000, 37697, 88655045ce8c5cb4c4aa3a5071f1beba +0, 141000, 37697, 7e849d493185a8f782b53a71151bae26 +0, 144000, 37697, a5b9a0cbfac73d2227118c0718cf9d14 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-015 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-015 new file mode 100644 index 00000000..7e97342f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-015 @@ -0,0 +1,260 @@ +0, 0, 115200, 6b4c7cc0c6a7218362e43cffef6618c9 +0, 3000, 115200, e132a7b1bb4fb15b1019092aedc0e599 +0, 6000, 115200, b36975db60f24088d95385ff7e8b7b8a +0, 9000, 115200, 4ae6a13ae0435afb2eac66f15a07b143 +0, 12000, 115200, d1de33515e29053171c9fbe969a33fa1 +0, 15000, 115200, cf01450481865c10765995a3b92b440f +0, 18000, 115200, 274461d33aeab30885b23bf2818ad150 +0, 21000, 115200, cb434c5a829b3d6d15a6e76f05abd51f +0, 24000, 115200, 512019fa16b1cd6bf308c91d6577cf2a +0, 27000, 115200, 2d1174741c144b2162806373d0092739 +0, 30000, 115200, 8ec38a17566342a35598bd5ab6d290d5 +0, 33000, 115200, 262b71c9874cc7a5138b12b294575572 +0, 36000, 115200, bfe5e37095dc450dc717fda5ef77b6fe +0, 39000, 115200, 7fbcdb00872206a597bb69ebe9221b03 +0, 42000, 115200, b599ac8568b6780dec25de4211e071ef +0, 45000, 115200, 797085b07f4c1e4f4b0116d329403cf8 +0, 48000, 115200, a0d0821365658bee14767698877cc066 +0, 51000, 115200, 286a917e787d474eb78b4797a0909a5e +0, 54000, 115200, 3548a320f6954c40a00ddf2e4ee212bd +0, 57000, 115200, 80af737ca733afa28fdae06421b3cf8d +0, 60000, 115200, f31a2b62cb69bc680b314a033f91881b +0, 63000, 115200, 02e4a780b3a0d83a8897988ef17b548c +0, 66000, 115200, 844929e7492b389fc520c5f75d37aa77 +0, 69000, 115200, 558ac4c1c11da425baf832a73e1ac2da +0, 72000, 115200, 41b21109a7aa5f163ac0967ecd11f792 +0, 75000, 115200, a2a050c04eaa97db43a5a0a96d20a143 +0, 78000, 115200, 18d1881d44ab9dc959c34d92c0cabd36 +0, 81000, 115200, 53618af318cd187b4fcd5a3c22d3ab79 +0, 84000, 115200, 8028e6a6a6dadc8331e39cff1ba2b899 +0, 87000, 115200, 2c32a58d68595ff4100cec4fc1637c55 +0, 90000, 115200, 8ecc02d32f36edd167cabe2a7bc66683 +0, 93000, 115200, 7caa9ce69ac9f71170a69fbcef4c4b34 +0, 96000, 115200, df06a6a8a81979c39f2c3546eb03a3c2 +0, 99000, 115200, 2bfd578fa08335e975d498e11eadc8bc +0, 102000, 115200, 0d78c5656d56e423ff31cab09855a335 +0, 105000, 115200, 7152d9e35748a7ec2e8da37f0b943325 +0, 108000, 115200, eb9e0e5cba76f0819da6256136ffd4e3 +0, 111000, 115200, c4e5ef875132c06a80f0afb3ee894684 +0, 114000, 115200, d2feb49297dd2f0a532479341d607e64 +0, 117000, 115200, d092d165608f405161fbf73a19df26ca +0, 120000, 115200, cb228940384c3021af42b0ab81c65d7a +0, 123000, 115200, 426decfbf29a025a7a5e376951c34b83 +0, 126000, 115200, 42c25e24bfd048bde0f9105d934cb81e +0, 129000, 115200, 4bf37f8ccb2c4f42fa64a52a4699883f +0, 132000, 115200, 5a00d85407910d4170d11511f03cc3a7 +0, 135000, 115200, 032072b8713a2cd7434b5be706a8667d +0, 138000, 115200, e729c561b318aa14d7dbf96299c4675d +0, 141000, 115200, e7e1d71c1c59bb759c89f15c6e8970f0 +0, 144000, 115200, 9c04011f4d92257a6dc112c5acad0f59 +0, 147000, 115200, ca7c7cbf52dd7af9a62212f3a9bd1f74 +0, 150000, 115200, 3cc9c4d3857d692e0dbfee682d63d32c +0, 153000, 115200, 1188fc9620cf0d23af21d8823c127b80 +0, 156000, 115200, c614690b8d4d3bea47f1b236ff32d1d8 +0, 159000, 115200, d6ccde3360e6a05b61013e85f96de9e9 +0, 162000, 115200, 7f11cacc42d14121aeab487975ec190b +0, 165000, 115200, cdd8b538ff107f88c5f0dc7128bc331e +0, 168000, 115200, f43a387e9bb2f4db387d3f44da16457b +0, 171000, 115200, b7ba01b86fce2252105f99848e2ac95c +0, 174000, 115200, 094200f775b6ced838d0c37e0d0b34e6 +0, 177000, 115200, b2d2fa96666b96b7cb624133cf404b09 +0, 180000, 115200, d935644161a2b06f0efc75dc6d0fcf46 +0, 183000, 115200, 2a3be6460f313d7fdd6f6f9c70092a50 +0, 186000, 115200, f8254b6469b807ce0e9a1ea4b98a59db +0, 189000, 115200, 43639a3293ec640b203e0c8a97e6f45e +0, 192000, 115200, 055762cccc279c8dd27450ec1d512d5f +0, 195000, 115200, a90dac910f3cdd216293bebc46b36501 +0, 198000, 115200, 3531ef2a4a59271f89ca0972b65d06aa +0, 201000, 115200, 1f87adde14795639105be714247d0bd0 +0, 204000, 115200, e991cdd7912266937ca6f0d59199645b +0, 207000, 115200, 5b98019db0fca644da5ee73e0160c7c5 +0, 210000, 115200, 6276f3907e4bb87885d21e11150d044d +0, 213000, 115200, 985785d7a788dcc07bd5fb72d3dc758e +0, 216000, 115200, 3379548a573d068d47d5f54aaf79c8a9 +0, 219000, 115200, a2b36848e7d19383cfabf8bdcabd241a +0, 222000, 115200, 0aeda76888a5a2426ae3b390e38aba52 +0, 225000, 115200, 2c652e7850ccc10cbc7a3266f1fb6c00 +0, 228000, 115200, 5dfc9e4dce69f1f644fad5b69c0b4008 +0, 231000, 115200, da775fc1469012a0c717ebe5dc940e26 +0, 234000, 115200, 6185a863f7d023ddb2b049e265aab1bb +0, 237000, 115200, 7a56397397191ab1b7c93a4bdc9b57c1 +0, 240000, 115200, 3e95a3f2c2660dc28ec64efef29615f0 +0, 243000, 115200, b9ba03bd7c09224174368a60af389b9c +0, 246000, 115200, bfd23a13e077843506a01e44adb27c04 +0, 249000, 115200, 9025dff58a57abcc25da69fd233e312a +0, 252000, 115200, ba4b91b0fe4d36f77b62ec3fe7b10a96 +0, 255000, 115200, 7955419ff2bc42b703dfc976576a5bd4 +0, 258000, 115200, 36d6a723ebb35c45128bfa8a7bba0d49 +0, 261000, 115200, 77503cc79e3cb0fc74745bac967fee1d +0, 264000, 115200, a05af40cb4fc009fe94be6dbf148b453 +0, 267000, 115200, 35bc39585679f7c07f1b196879719ce6 +0, 270000, 115200, 48831c2e2212134ab192a123e847c157 +0, 273000, 115200, c09c37f9fd929185452a8beb3c61b839 +0, 276000, 115200, c534a38d586f3cac998240a7013c636c +0, 279000, 115200, b598c6999442cf0c53ed6a19d1215eb8 +0, 282000, 115200, c639685c8f4af3d006df1833950943aa +0, 285000, 115200, 351e1c089ba5b9024de6e311c4a4afd3 +0, 288000, 115200, 67d8ea902179548d0b01544249b2411f +0, 291000, 115200, 3717ddf0edbb2020a5b974678d358d25 +0, 294000, 115200, 85f7c6861241e3f43fc63c397c8c3c37 +0, 297000, 115200, c5b23b4d3d141d8cfbc5354ca1cfd34d +0, 300000, 115200, c2e42fa6b11cdc3abcf3ee0c3f75a459 +0, 303000, 115200, 34df411aa928d5df3628644d9a38c768 +0, 306000, 115200, a768b448b6c894d9b927bc880249079a +0, 309000, 115200, a2e9ad0d0ad733b8ccacf0379b05f6f9 +0, 312000, 115200, 4b485e9496ab4d417b8cffaf8754f5cb +0, 315000, 115200, 47007fabfacd9e9c5a3997fb70d45895 +0, 318000, 115200, 4962433241c7509801b46bea70f38269 +0, 321000, 115200, 7b4593b45606650e78aec67722cfc2bf +0, 324000, 115200, 882bcbf7d2c12e93df2fbebc6ac19dd8 +0, 327000, 115200, a2998a9c648817236bfffdae454f9fa1 +0, 330000, 115200, 56775760fa99e9a9b7293ddc78a44ece +0, 333000, 115200, bb245d095424c28dd2ace22a5a511d6a +0, 336000, 115200, 598c54d2b207190ed549dec7390a4190 +0, 339000, 115200, c73f16b2709527fce3d725ade5aab2fc +0, 342000, 115200, 32dcad6eb17bee583884029fe18c07a7 +0, 345000, 115200, a1297c404a0d22e0e8e1e4ef67696606 +0, 348000, 115200, 2fef1ac7becf9b8c9f3ac2310f444e3b +0, 351000, 115200, 0f03614ed3daec6c37c5b564ad24f595 +0, 354000, 115200, 9b175a6353ec377da408b0cf03388081 +0, 357000, 115200, 37b991b4a216a4847d0768a3b878284a +0, 360000, 115200, faafcd544080a6a4f87a0d0a393ba37b +0, 363000, 115200, 43ede087f37c1b0392829bbc668242fc +0, 366000, 115200, b7ed1274016c4d1810d8999d495b7370 +0, 369000, 115200, 22af7bfc83c6e1f2eff2ae26e115b446 +0, 372000, 115200, 969b22455f3be057036ddd5a329b1de3 +0, 375000, 115200, 63c24b8a3d6c3a4c2fd47c48860abff9 +0, 378000, 115200, b407ddc89c538d7b6fb70e48493f872c +0, 381000, 115200, 5de69fb9e1cd425cd3931116803f5391 +0, 384000, 115200, 07fc7a5cb360edae97db999c2a8d2716 +0, 387000, 115200, 602a17c58cac811e6e71e33448931ce5 +0, 390000, 115200, 44087725484198c8e846d112583e574b +0, 393000, 115200, 0d81da0d23d196ff972894878bd17b73 +0, 396000, 115200, b3cd65f1bd2274895e54da99bb4c4f07 +0, 399000, 115200, ae8ca35672d8352af49f37f5174c8fbd +0, 402000, 115200, 9eea1ff900cf680e8208cd5d07a4d284 +0, 405000, 115200, 5a47f272dfda3fe61955875f761a71f2 +0, 408000, 115200, 544558333008db01451c886ac0b62c47 +0, 411000, 115200, 5f8e4f3b11d7f5a28ff5cd9f3a6853bb +0, 414000, 115200, e9bc3da7060457f2d52a5bf6fe3bb515 +0, 417000, 115200, 6aea6851a092260ae6594c6d9170ea8e +0, 420000, 115200, 38e7fa5bea809a984a5f810940ca0e49 +0, 423000, 115200, 9e8a23ac9067a1acf8472d7aa3b9811e +0, 426000, 115200, 6f25f5873afd5c341ca6b3eb284be809 +0, 429000, 115200, 40c3240e6cde94aae793a52cb46487da +0, 432000, 115200, b7f1f13842fbf0c6e085280eb89b956f +0, 435000, 115200, 1f059372d8bf4dadf78d8e215bbf9786 +0, 438000, 115200, 50c1d6b76930e765bff5ecbaaae686fe +0, 441000, 115200, 5bd8cb05ebc034192e08ca8ce18a7964 +0, 444000, 115200, ffc0c20b07e26857dc4f2c079a2ad675 +0, 447000, 115200, 5dafb6ac0953c254182dba124e213c07 +0, 450000, 115200, c774ed25712a38603fe2e224802768cb +0, 453000, 115200, de549cc803a6138d483be15b28ef2286 +0, 456000, 115200, c963d9bc79c1dd2a47f7f8424c56239e +0, 459000, 115200, 9df993e0bef1bedbce1a6b596f2c64f4 +0, 462000, 115200, 875792bde0f45358009b506840be68e1 +0, 465000, 115200, 7f8c57083d2df08db6287cb025260788 +0, 468000, 115200, 47eb13bc0942b5cafeea324fc5bf5cd5 +0, 471000, 115200, d89129c7528ff7372f23d1191c75e336 +0, 474000, 115200, bdd14e38b00075d8da485d1517dbbd65 +0, 477000, 115200, 0e8e21a50a5dd1ac6fc881ad38ec38bd +0, 480000, 115200, a0fce98c23a053b4073715c554b9dc44 +0, 483000, 115200, 18bda80360c72d04c60016682b1f6c8d +0, 486000, 115200, 306d7556c18dcf58c8183959d1c34c2a +0, 489000, 115200, 7ada9d23b96ef41322497d1077b00c4d +0, 492000, 115200, d7df0508be4bd0c3e83f346f0b9a1868 +0, 495000, 115200, 749725f425f6fd4a79269bca900d09ae +0, 498000, 115200, ed30973158a576e2919e2fcfd00987fc +0, 501000, 115200, 2486d8b742ccc50cf8683af7f4502aec +0, 504000, 115200, bdfb21e4236c904aeacd7b094fcffe98 +0, 507000, 115200, df2ef3e452731053ade82506c013164e +0, 510000, 115200, 4695bfd9aa8e5667572f8f2142c6e538 +0, 513000, 115200, 649f5315cff1d28f0183144bf4d4eea4 +0, 516000, 115200, 450e987b9d6075d32e21d030bc385833 +0, 519000, 115200, 7aec79b25dabfcc2eb2f32e7dbff85f2 +0, 522000, 115200, c9c2a96239ad556a2ee496d7c4c965c1 +0, 525000, 115200, 3a038e48aa1238b62d431823653bc45a +0, 528000, 115200, 6d5c8de6a281dbce68998b2c38063f33 +0, 531000, 115200, 045032f57d6a50ae148f4372f5083a62 +0, 534000, 115200, 5f39172951e083e712c3b1c528e61a4f +0, 537000, 115200, 5a49eea76b6a86e305fb207fc1479264 +0, 540000, 115200, 33ca5fb5f3e4ff3a24235da71c5730d5 +0, 543000, 115200, 81f231d20426c5cbd02a85a425f5d0b8 +0, 546000, 115200, 302d94aa9a8d3828cf74c8b2b7e7fdd5 +0, 549000, 115200, c56f4f0c32b0f2c409b64ed10216a40a +0, 552000, 115200, 9cf7f51e1527f11c38c395bac94849d9 +0, 555000, 115200, 0f17e427d14db658131eb0ccdc2a97ef +0, 558000, 115200, 2624dd6b8e4e95770f132d90aa6f6119 +0, 561000, 115200, 9ddabfd5f803014443c2a0686869c546 +0, 564000, 115200, 0170cb86a377d791d7cbee2af0836db7 +0, 567000, 115200, f43a7c63bcafb51ead65e2831610612c +0, 570000, 115200, e7000913b11bdeb74ba4eca110df8470 +0, 573000, 115200, a4208c5fcd101ceb5a976838ae9a811f +0, 576000, 115200, 8ddcb546ac632c967e879fb5101afa24 +0, 579000, 115200, 547007771194373dd246586744130f7c +0, 582000, 115200, 3608a46fee2731341ae9f71d3a80918a +0, 585000, 115200, 758692e173552eb3439a572c953dda0f +0, 588000, 115200, 481f456d6c6ac2e0325acba5eeabcd26 +0, 591000, 115200, c749a3ef8641d5ec4f25c611ffad1000 +0, 594000, 115200, 93f089f7f1e78b1a4185c0b0d99875fb +0, 597000, 115200, 1159712bb4dbaed38d2a7558335f4037 +0, 600000, 115200, e8dab85a977f525d4d9b448e4278a34b +0, 603000, 115200, 780055af1414e7693777a18428b20a07 +0, 606000, 115200, 59252515451fd96ca3f1194d5aadc3a7 +0, 609000, 115200, 0a977d6db761c149316417988657610a +0, 612000, 115200, ed81d3a10369c12543f9bb6822a249b6 +0, 615000, 115200, 341e844231f6b55ee3c1eb22ca1bac8e +0, 618000, 115200, d0a180c7d15e30a71e297fda0452c153 +0, 621000, 115200, 58d6f2522ecd8e5fea34cc9f10da2a88 +0, 624000, 115200, dc8f96811577f4fd3e6624abae42f449 +0, 627000, 115200, 3624a2e95f94a0a4413e464f4bf93dcd +0, 630000, 115200, cb0deeb5f2d570ca23e3be3ab9231fe9 +0, 633000, 115200, 5080848626a52e30eb0f64f234ca3e57 +0, 636000, 115200, a31c9fe4255318d86e7855f01588220f +0, 639000, 115200, 6c25fd8d1f0e898f6078decc4220d47d +0, 642000, 115200, 77e52da08ab57ba5784ce42872cc01cb +0, 645000, 115200, b4a87059745b3b862ef7431a9630f16a +0, 648000, 115200, 1dadc814514ef00f11010df21d8a9494 +0, 651000, 115200, 5c816a0bbc8ed8fca166aa454093cb59 +0, 654000, 115200, 10320c174423d1712d9ce812701bcaf9 +0, 657000, 115200, 279c9398657af129e072165f41e0fb8c +0, 660000, 115200, 49d88374bc4d965d3cee3274c7cd9906 +0, 663000, 115200, 48871e22f635f50569dea1bd5ca40d5c +0, 666000, 115200, 3b8396580f8fbd99daca4df13662f1fc +0, 669000, 115200, 569245e1bf3cb42aa95f765a8449980f +0, 672000, 115200, c5cab497d244447df0ab832dcc9c5968 +0, 675000, 115200, 0a98ca4f1d771c4bc0286b825d085955 +0, 678000, 115200, e4a55f175c3933f02ccf74ccf2961da2 +0, 681000, 115200, 462dca7f377d708e753ef0bbde19a090 +0, 684000, 115200, 6f1680f498b0ed6f89a834b5700cc48a +0, 687000, 115200, 996414e2e3a4bac5868ceeb25b84e6e4 +0, 690000, 115200, 6ecb4d4b857578d32f716c56dc7e6be9 +0, 693000, 115200, e05c8e33157e20c8e8f255e937d6b6cb +0, 696000, 115200, 6542744da147d16533e41dad287a54fc +0, 699000, 115200, bb4b6921d2855025fbcaff4c12299d02 +0, 702000, 115200, 6bc3e605759725012f7e44f1285b0899 +0, 705000, 115200, 0be37ecb7cec0cf8a0f9bbc3c590ba98 +0, 708000, 115200, 4f1103e5923ba8dea3e99c8b75eaed3c +0, 711000, 115200, 220a8fb0409112c4f4ee769880717fea +0, 714000, 115200, e4c612263cfbc0f41283fd1e88e2ff52 +0, 717000, 115200, ede2bc67ad87cd78191b742dd56419b5 +0, 720000, 115200, ded6a1d0690603aea233e4d624aa60a9 +0, 723000, 115200, 59c8b53e47ebdab696547a887163b272 +0, 726000, 115200, 985f8afbc6df2d64d601d2fdc93571d7 +0, 729000, 115200, e595f0aa7b6b62094f0ad84252105f55 +0, 732000, 115200, c2fe4382a1740bcfc2f4c3573c6c3176 +0, 735000, 115200, 880d8c906a8b39a61b68eb0ada857e5f +0, 738000, 115200, 9a3ca55d2d75e3c41a86aea2ec87ff76 +0, 741000, 115200, f800751663dbefa61c33c3ebbd5430b4 +0, 744000, 115200, d904333c0c76235c8ffdfc81dffddb46 +0, 747000, 115200, 6a633a9a7686a9a02bd252ec8bcff4fc +0, 750000, 115200, 930d06ecc252a911a60c2d9d4f2618e6 +0, 753000, 115200, bb146a4410c34bba74883d8ae478f47b +0, 756000, 115200, be8ab9fc95685ebec64ff1f8129afa35 +0, 759000, 115200, d1f871ea3ceb38bf2b6d00ebfc38187a +0, 762000, 115200, ba33366e050a5f5abbf8202e0afbb9e8 +0, 765000, 115200, f706356e12cf4082337bb8f7a5a10673 +0, 768000, 115200, 6e8200d3c1cccc0f810985ea2a2030f6 +0, 771000, 115200, caafdc1810556197df6f42336edcc07b +0, 774000, 115200, 5321ff525f5bb5063443a3dc43fc42af +0, 777000, 115200, c24bdd3b935f7ca6e9e105b1ae8504db diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-016 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-016 new file mode 100644 index 00000000..1a821455 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-016 @@ -0,0 +1,29 @@ +0, 0, 38016, 905a823da31f71f9c25ebb8dfc9ddd3c +0, 3000, 38016, 9a1b97859b2f774954dbf96f45a22a0a +0, 6000, 38016, f0f5651b32577549dc2e6e3050125229 +0, 9000, 38016, 9edf800d31dc653a23ed71d0f3fc32e4 +0, 12000, 38016, 78dd1fa96e63c177f2b90d702c92f48c +0, 15000, 38016, e1cec336383c4ea63ccaff8bfa5c8e24 +0, 18000, 38016, e8b5a454e178ab7ba9b83dfc10b4171e +0, 21000, 38016, 572dbaaf319f1681749135c49940c64e +0, 24000, 38016, b0e8313de033cc75a78532789bb6a3cb +0, 27000, 38016, ffc5581d83ff67b549d63c7de1a1e8cb +0, 30000, 38016, 8ae3fcd3d74947d434b7c5f9ee08bbbf +0, 33000, 38016, 3adff74d92ae0a463dddc6f89965f706 +0, 36000, 38016, f08355430fdf5bb16a91eef05f03186b +0, 39000, 38016, d477eb8150a1a94dd6af7f067e8c0429 +0, 42000, 38016, f860f225e27871a17060373b79007ec6 +0, 45000, 38016, 22a25c07ac5e7c67df793e0d3169386c +0, 48000, 38016, a96f9cef4efe74db0cce039c85c03c4d +0, 51000, 38016, ff9c93cbc364976044144ee631f89bd2 +0, 54000, 38016, 3a6b43090adb6c8b5188d544a08295a8 +0, 57000, 38016, 7f41a10ada80865d24585860065aa5e4 +0, 60000, 38016, 099847f606672fd065e6841000cafcb3 +0, 63000, 38016, fbf543c12ce48633e6d10717862c35a7 +0, 66000, 38016, 1b9956d8a6c45e39d219da33ff7c334a +0, 69000, 38016, 911eb8f478485c0f4eef1d03f53aa80b +0, 72000, 38016, b801570a437439ce12c5037df0235742 +0, 75000, 38016, 8d231805d741abe79670a0e9f13712ea +0, 78000, 38016, 87bfcc2c88c4471067c07fbcf635870d +0, 81000, 38016, d51b6999afde880bc77597063b58d28f +0, 84000, 38016, c69c07a34bfad3b5a95b19a84e991c13 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-017 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-017 new file mode 100644 index 00000000..c461420b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vp8-test-vector-017 @@ -0,0 +1,29 @@ +0, 0, 38016, 905a823da31f71f9c25ebb8dfc9ddd3c +0, 3000, 38016, f0f411dd067bff05d5d9c64e3f52a4b1 +0, 6000, 38016, c8696f8fa56b4adf18f3db0c384d968f +0, 9000, 38016, 5772aa26a95092b4a8a117e97d6dde49 +0, 12000, 38016, fc52254ea1cbcc2e7a5b126d8c44a023 +0, 15000, 38016, bf6208554657f568ad69d5c60f692fdb +0, 18000, 38016, 3a68eef642b250177592455f4aa925d9 +0, 21000, 38016, 98102b7bd56cbe456d86c93e8cdd48eb +0, 24000, 38016, 59d54b7d97600b2890c8abab2af9a7dc +0, 27000, 38016, ba4b4bb534ee2a00f418828b9723d996 +0, 30000, 38016, feb1115136fa96d5e9425ac18261de7c +0, 33000, 38016, ef7eb6dc656c2bd7447c7d8f650108c1 +0, 36000, 38016, 89ec385a0d34c8fd5b1334d8756c96b9 +0, 39000, 38016, 27bc439dd8e6d50c3c7a6e0b390e7418 +0, 42000, 38016, ec36c065d8b668fabb6b16ecc01eea0a +0, 45000, 38016, 5c94f9b441fc70f62856c835f9e9ad50 +0, 48000, 38016, 4b6c1bd876b00052b39e6ca91cad9c05 +0, 51000, 38016, 1099121afd681cf3218dffb9714a0fd7 +0, 54000, 38016, d0c1de888fab35f33c1148dc80494d20 +0, 57000, 38016, 745941ea768d06ea27c3fbca782e3591 +0, 60000, 38016, 09f85054f188da6f7260debf6b71bbb1 +0, 63000, 38016, 2bdd642a7551681f1ca9680a0d9183a8 +0, 66000, 38016, 054aba9db9790a0f1c79db491a6cac6d +0, 69000, 38016, fa4b52162f6da0c15100f4382d92d7e4 +0, 72000, 38016, 88c589535811dd394bd1723172329629 +0, 75000, 38016, c11cc1a30199d46db048120969dc4118 +0, 78000, 38016, c61207280f40620f8cd5e962f3aa160f +0, 81000, 38016, 8a721ecbad0b2f17aabb2d06e27c00aa +0, 84000, 38016, da32f1d272e065cd31415b23f86837cc diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vqa-cc b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vqa-cc new file mode 100644 index 00000000..5ad29167 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vqa-cc @@ -0,0 +1,78 @@ +1, 0, 22048, 0x0665d7f4 +0, 0, 192000, 0x00000000 +0, 6000, 192000, 0x00000000 +0, 12000, 192000, 0x00000000 +0, 18000, 192000, 0x00000000 +0, 24000, 192000, 0xcd900ccc +0, 30000, 192000, 0xfd496438 +0, 36000, 192000, 0x965f0bf3 +0, 42000, 192000, 0x378fca5f +1, 44996, 2940, 0x0f3c64cb +0, 48000, 192000, 0x5ccd8966 +1, 50996, 2940, 0xc90b9e78 +0, 54000, 192000, 0x859676f9 +1, 56996, 2940, 0x146246a3 +0, 60000, 192000, 0x820bfb1c +1, 62996, 2940, 0xd22c714e +0, 66000, 192000, 0x7570cc05 +1, 68996, 2940, 0xd86b681e +0, 72000, 192000, 0xf38bdb06 +1, 74996, 2940, 0x12ec8186 +0, 78000, 192000, 0x9b0cbb44 +1, 80996, 2940, 0x69aa85b6 +0, 84000, 192000, 0x0ed70665 +1, 86996, 2940, 0xb24d33b0 +0, 90000, 192000, 0xd16de7fc +1, 92996, 2940, 0x3f7b0f0d +0, 96000, 192000, 0x97afb484 +1, 98996, 2940, 0x64f10f7e +0, 102000, 192000, 0x012893f3 +1, 104996, 2940, 0xd6ea379a +0, 108000, 192000, 0x742a4b43 +1, 110996, 2940, 0x7c38e830 +0, 114000, 192000, 0x309dcd75 +1, 116996, 2940, 0xc28ff132 +0, 120000, 192000, 0xed7814ac +1, 122996, 2940, 0xe7b11629 +0, 126000, 192000, 0xdb7de3d7 +1, 128996, 2940, 0xeb86fdcb +0, 132000, 192000, 0xe18679a3 +1, 134996, 2940, 0x5508f586 +0, 138000, 192000, 0xb1f213f4 +1, 140996, 2940, 0xf4fa1f1b +0, 144000, 192000, 0x33c99b5c +1, 146996, 2940, 0x9e5ff976 +0, 150000, 192000, 0xf66c0c91 +1, 152996, 2940, 0xcfc4e08f +0, 156000, 192000, 0x929cdc73 +1, 158996, 2940, 0x74bde7ed +0, 162000, 192000, 0xa723fc3b +1, 164996, 2940, 0x3e4ae245 +0, 168000, 192000, 0xe6395ccc +1, 170996, 2940, 0x4c6a8e56 +0, 174000, 192000, 0x147fbf74 +1, 176996, 2940, 0xa09d86ab +0, 180000, 192000, 0x3ec62d28 +1, 182996, 2940, 0xc8531912 +0, 186000, 192000, 0x22104ffb +1, 188996, 2940, 0xa5f266aa +0, 192000, 192000, 0x91f25f58 +1, 194996, 2940, 0x587a4187 +0, 198000, 192000, 0xc91b0e4e +1, 200996, 2940, 0x14752d45 +0, 204000, 192000, 0x4683df56 +1, 206996, 2940, 0x558cde10 +0, 210000, 192000, 0x8ef8932a +1, 212996, 2940, 0x735fee38 +0, 216000, 192000, 0xce6c0ec0 +1, 218996, 2940, 0xac8bb6c8 +0, 222000, 192000, 0xcc10e2a0 +1, 224996, 2940, 0xa503c73b +1, 230996, 2940, 0x7cd588a3 +1, 236996, 2940, 0xa6974b04 +1, 242996, 2940, 0xbf448241 +1, 248996, 2940, 0x2a5c2759 +1, 254996, 2940, 0xd0de5ce0 +1, 260996, 2940, 0xc0486649 +1, 266996, 2940, 0x48b040af +1, 272996, 2940, 0x82a338a9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vqf-demux b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vqf-demux new file mode 100644 index 00000000..a06fff39 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/vqf-demux @@ -0,0 +1 @@ +48313c746da06b157711b13675f37312 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/w64 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/w64 new file mode 100644 index 00000000..461eadb4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/w64 @@ -0,0 +1 @@ +CRC=0xc1e71a5c diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/wc3movie-xan b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/wc3movie-xan new file mode 100644 index 00000000..8fd2282c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/wc3movie-xan @@ -0,0 +1,70 @@ +0, 0, 158400, 0x25aec781 +1, 0, 2940, 0x92cee2a6 +0, 6000, 158400, 0xda4dbf70 +1, 6000, 2940, 0x126902c3 +0, 12000, 158400, 0x2d8fc909 +1, 12000, 2940, 0x4977b9e6 +0, 18000, 158400, 0xea93c5ab +1, 18000, 2940, 0x5144d68c +0, 24000, 158400, 0xa1f5bf60 +1, 24000, 2940, 0x282ebf71 +0, 30000, 158400, 0x739ecfa9 +1, 30000, 2940, 0xc2e7c73c +0, 36000, 158400, 0xe9830c7e +1, 36000, 2940, 0x717d6fc5 +0, 42000, 158400, 0xd885665b +1, 42000, 2940, 0x78538428 +0, 48000, 158400, 0x3235f8ad +1, 48000, 2940, 0x94ffd1ad +0, 54000, 158400, 0xd8550cca +1, 54000, 2940, 0xad43de8b +0, 60000, 158400, 0x05e9e231 +1, 60000, 2940, 0x65e4b604 +0, 66000, 158400, 0xce9dd29b +1, 66000, 2940, 0xd6d6c30f +0, 72000, 158400, 0x857494a6 +1, 72000, 2940, 0x7b897e4e +0, 78000, 158400, 0x9cad464a +1, 78000, 2940, 0xf79546ad +0, 84000, 158400, 0x04c3177a +1, 84000, 2940, 0x658c904e +0, 90000, 158400, 0xa3d2399a +1, 90000, 2940, 0xb7b8cd8c +0, 96000, 158400, 0x12cdd418 +1, 96000, 2940, 0x2f2da7c5 +0, 102000, 158400, 0x5ef67c9e +1, 102000, 2940, 0x51938cf8 +0, 108000, 158400, 0xba7a7f11 +1, 108000, 2940, 0xdf61c87a +0, 114000, 158400, 0x084b60e7 +1, 114000, 2940, 0xf72a7069 +0, 120000, 158400, 0xef95a6a5 +1, 120000, 2940, 0x9af2a425 +0, 126000, 158400, 0x55f392f1 +1, 126000, 2940, 0x4c3f5ac7 +0, 132000, 158400, 0x63fca6bb +1, 132000, 2940, 0xfe4cb0b2 +0, 138000, 158400, 0x0f7e62fe +1, 138000, 2940, 0x732a35ed +0, 144000, 158400, 0xf35febc1 +1, 144000, 2940, 0x526b9e0f +0, 150000, 158400, 0x6bf6f219 +1, 150000, 2940, 0x4bd9d4e2 +0, 156000, 158400, 0xbdf13e77 +1, 156000, 2940, 0x84340827 +0, 162000, 158400, 0x88490e47 +1, 162000, 2940, 0xe54f7911 +0, 168000, 158400, 0xdb786540 +1, 168000, 2940, 0x0bbdef52 +0, 174000, 158400, 0x7335c045 +1, 174000, 2940, 0xc1aac5e1 +0, 180000, 158400, 0x6b78015a +1, 180000, 2940, 0x515ea512 +0, 186000, 158400, 0x9e9b6d16 +1, 186000, 2940, 0x9e7fdac1 +0, 192000, 158400, 0xe618e024 +1, 192000, 2940, 0xf1d4c9cc +0, 198000, 158400, 0x56cd60f7 +1, 198000, 2940, 0x1bc9b6ee +0, 204000, 158400, 0xf08e22fe +1, 204000, 2940, 0xff8ac114 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/westwood-aud b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/westwood-aud new file mode 100644 index 00000000..f8bec105 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/westwood-aud @@ -0,0 +1 @@ +5c2528488729035c17c21486797a2a23 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/wmv8-drm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/wmv8-drm new file mode 100644 index 00000000..4dc0f0e4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/wmv8-drm @@ -0,0 +1,162 @@ +0, 0, 84480, 0x7760a00b +0, 3750, 84480, 0xfe39a1db +0, 7500, 84480, 0xfe39a1db +0, 11250, 84480, 0xfe39a1db +0, 15000, 84480, 0xfe39a1db +0, 18750, 84480, 0xfe39a1db +0, 22500, 84480, 0xfe39a1db +0, 26250, 84480, 0xfe39a1db +0, 30000, 84480, 0xfe39a1db +0, 33750, 84480, 0xfe39a1db +0, 37500, 84480, 0xfe39a1db +0, 41250, 84480, 0xfe39a1db +0, 45000, 84480, 0xfe39a1db +0, 48750, 84480, 0xfe39a1db +0, 52500, 84480, 0xfe39a1db +0, 56250, 84480, 0xfe39a1db +0, 60000, 84480, 0xfe39a1db +0, 63750, 84480, 0xfe39a1db +0, 67500, 84480, 0xfe39a1db +0, 71250, 84480, 0xfe39a1db +0, 75000, 84480, 0xfe39a1db +0, 78750, 84480, 0xfe39a1db +0, 82500, 84480, 0xfe39a1db +0, 86250, 84480, 0xfe39a1db +0, 90000, 84480, 0xfe39a1db +0, 93750, 84480, 0xfe39a1db +0, 97500, 84480, 0xfe39a1db +0, 101250, 84480, 0xfe39a1db +0, 105000, 84480, 0xfe39a1db +0, 108750, 84480, 0xd71961b4 +0, 112500, 84480, 0xc80dedba +0, 116250, 84480, 0x34d8b538 +0, 120000, 84480, 0x1a86b8e5 +0, 123750, 84480, 0xabf7c25d +0, 127500, 84480, 0x912600ee +0, 131250, 84480, 0x7ee7c70b +0, 135000, 84480, 0xe212b0d1 +0, 138750, 84480, 0xd4fa6c16 +0, 142500, 84480, 0xd10fa126 +0, 146250, 84480, 0xda91d3aa +0, 150000, 84480, 0xd90be940 +0, 153750, 84480, 0x908a009b +0, 157500, 84480, 0xdd26d6e9 +0, 161250, 84480, 0xfeda8de9 +0, 165000, 84480, 0x96d66505 +0, 168750, 84480, 0xf43b4b1b +0, 172500, 84480, 0xd44122c2 +0, 176250, 84480, 0xc65da7a9 +0, 180000, 84480, 0xbf4178f2 +0, 183750, 84480, 0x96be846a +0, 187500, 84480, 0x73e6459e +0, 191250, 84480, 0x70086917 +0, 195000, 84480, 0x9b12571d +0, 198750, 84480, 0xe4ce7bce +0, 202500, 84480, 0x845672e5 +0, 206250, 84480, 0x1c17e189 +0, 210000, 84480, 0x12a877d0 +0, 213750, 84480, 0xca62e8ed +0, 217500, 84480, 0x87beb28f +0, 221250, 84480, 0x1ba915a4 +0, 225000, 84480, 0x159fc9c4 +0, 228750, 84480, 0xcec3e3ef +0, 232500, 84480, 0x96a42f48 +0, 236250, 84480, 0xcd17decf +0, 240000, 84480, 0x4cf95d6c +0, 243750, 84480, 0xa258400e +0, 247500, 84480, 0xb9c566d8 +0, 251250, 84480, 0xc39f6dab +0, 255000, 84480, 0xd08a0880 +0, 258750, 84480, 0x41e3a70f +0, 262500, 84480, 0x0ded83d9 +0, 266250, 84480, 0x74a915ea +0, 270000, 84480, 0x00c2c849 +0, 273750, 84480, 0x709a9b07 +0, 277500, 84480, 0xfb276daa +0, 281250, 84480, 0x89ca744b +0, 285000, 84480, 0x457ba569 +0, 288750, 84480, 0xc37c8d57 +0, 292500, 84480, 0x1890a97e +0, 296250, 84480, 0xe455b8d0 +0, 300000, 84480, 0x1f6bdbce +0, 303750, 84480, 0x9df90ed1 +0, 307500, 84480, 0xff80328c +0, 311250, 84480, 0x0e115940 +0, 315000, 84480, 0x09ddc11d +0, 318750, 84480, 0xeef241e9 +0, 322500, 84480, 0xbe3578b4 +0, 326250, 84480, 0x2a83f0f3 +0, 330000, 84480, 0xb41d01c2 +0, 333750, 84480, 0x630efd97 +0, 337500, 84480, 0xd592140d +0, 341250, 84480, 0x7110f627 +0, 345000, 84480, 0x2dbaa590 +0, 348750, 84480, 0x13d80be5 +0, 352500, 84480, 0xb8f3740d +0, 356250, 84480, 0xd9a6fcef +0, 360000, 84480, 0x56bfa4e3 +0, 363750, 84480, 0x49364550 +0, 367500, 84480, 0x0a2f1690 +0, 371250, 84480, 0xb87fccbf +0, 375000, 84480, 0xb2aa69f7 +0, 378750, 84480, 0x176bf378 +0, 382500, 84480, 0xe7a6de45 +0, 386250, 84480, 0x8e3900a6 +0, 390000, 84480, 0x24a72099 +0, 393750, 84480, 0x5394df95 +0, 397500, 84480, 0xd648c92e +0, 401250, 84480, 0xab95fb62 +0, 405000, 84480, 0xe3239cb0 +0, 408750, 84480, 0xb4f93467 +0, 412500, 84480, 0x94d0d01d +0, 416250, 84480, 0x6316a25e +0, 420000, 84480, 0x6316a25e +0, 423750, 84480, 0x6316a25e +0, 427500, 84480, 0x6316a25e +0, 431250, 84480, 0x6316a25e +0, 435000, 84480, 0x6316a25e +0, 438750, 84480, 0x6316a25e +0, 442500, 84480, 0xae1c8854 +0, 446250, 84480, 0x30fe68bf +0, 450000, 84480, 0xfd1435c8 +0, 453750, 84480, 0xddf57fab +0, 457500, 84480, 0xc3553a51 +0, 461250, 84480, 0xd9ce7ae8 +0, 465000, 84480, 0x671765cb +0, 468750, 84480, 0x78336eab +0, 472500, 84480, 0xb66b659c +0, 476250, 84480, 0x0e1f68bb +0, 480000, 84480, 0x8f4669dc +0, 483750, 84480, 0x60c47360 +0, 487500, 84480, 0x93037246 +0, 491250, 84480, 0xdebe620d +0, 495000, 84480, 0x7555161e +0, 498750, 84480, 0xcbaf4311 +0, 502500, 84480, 0x8e3783a0 +0, 506250, 84480, 0x3888008f +0, 510000, 84480, 0x8a4fa114 +0, 513750, 84480, 0xac0bf10b +0, 517500, 84480, 0xb485ff7f +0, 521250, 84480, 0xeaec2133 +0, 525000, 84480, 0x105827cd +0, 528750, 84480, 0x55ff4b2d +0, 532500, 84480, 0x78c64a49 +0, 536250, 84480, 0x3897731d +0, 540000, 84480, 0x9ca891aa +0, 543750, 84480, 0x24a6ab0a +0, 547500, 84480, 0x88fdc6fb +0, 551250, 84480, 0x05afea61 +0, 555000, 84480, 0xe703e2cf +0, 558750, 84480, 0x9eb0e64a +0, 562500, 84480, 0x92a7f0ab +0, 566250, 84480, 0xec2bfbfb +0, 570000, 84480, 0x7db600ad +0, 573750, 84480, 0x4abd6393 +0, 577500, 84480, 0x54ce06b5 +0, 581250, 84480, 0x7cb6f150 +0, 585000, 84480, 0x099d4aeb +0, 588750, 84480, 0x0bcfdc31 +0, 592500, 84480, 0xe4e72d1f +0, 596250, 84480, 0xbce22331 +0, 600000, 84480, 0x020545d7 +0, 603750, 84480, 0x71869e48 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/wmv8-drm-nodec b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/wmv8-drm-nodec new file mode 100644 index 00000000..69bd752e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/wmv8-drm-nodec @@ -0,0 +1,150 @@ +1, 0, 1088, 0x5cd379bb +0, 0, 282, 0x000d949a +1, 39150, 1088, 0x8dfa1368 +1, 66600, 1088, 0xc0d211be +1, 92070, 1088, 0x8238113a +0, 108720, 137, 0x903c415e +0, 112500, 942, 0xd5b7d2aa +0, 116190, 841, 0xaffd8ce6 +1, 117540, 1088, 0x9f8924b7 +0, 119970, 1164, 0x4ed84836 +0, 123750, 1492, 0x37f3e8aa +0, 127440, 1663, 0xc091392d +0, 131220, 1443, 0x6162c718 +0, 135000, 1721, 0x7bdb3dd0 +0, 138690, 1410, 0xde689881 +0, 142470, 1258, 0xb5b86920 +1, 143010, 1088, 0x767f317a +0, 146250, 2050, 0x99b6d7c7 +0, 149940, 1242, 0x9ba35009 +0, 153720, 1630, 0x17f10192 +0, 157500, 1747, 0xbbee59d7 +0, 161190, 1565, 0xb09b00d9 +0, 164970, 1573, 0xd2e62201 +1, 168480, 1088, 0x57000d38 +0, 168750, 1353, 0x2305a24d +0, 172440, 1425, 0xf41bbb46 +0, 176220, 1355, 0xfc08a762 +0, 180000, 1363, 0x98cda71d +0, 183690, 1547, 0x8742f11f +0, 187470, 1967, 0x43d61723 +0, 191250, 1378, 0xde22c753 +0, 194940, 961, 0x2418a4da +1, 197820, 1088, 0xad977261 +0, 198720, 968, 0x0d04ba51 +0, 202500, 1140, 0x737f3543 +0, 206190, 1119, 0x3c050388 +0, 209970, 1078, 0xeac8d981 +0, 213750, 1113, 0xebfa0314 +0, 217440, 1229, 0x95dc3cb5 +0, 221220, 1311, 0x8a6f5bda +0, 225000, 1270, 0x2e66540a +0, 228690, 1408, 0x5f489779 +0, 232470, 1359, 0x8bd085f5 +0, 236250, 1428, 0xef9ba480 +0, 239940, 1179, 0x5bb221a8 +0, 243720, 1108, 0x9a6019a8 +0, 247500, 1205, 0xccba4d22 +0, 251190, 1306, 0xde708c19 +0, 254970, 1724, 0xa70b521e +0, 258750, 1336, 0xdf3974b9 +0, 262440, 1259, 0x1f6b4307 +0, 266220, 1194, 0x635f5a43 +0, 270000, 1183, 0x1dd47115 +0, 273690, 1126, 0x5bac3cc8 +0, 277470, 1360, 0x1fe2d981 +0, 281250, 1261, 0x34288acb +0, 284940, 1250, 0x26bd72b3 +0, 288720, 1147, 0x02e81ba0 +0, 292500, 1368, 0xb8146962 +0, 296190, 1377, 0xf7b6ce65 +0, 299970, 1396, 0x88467dee +0, 303750, 1408, 0x5585c25c +0, 307440, 1551, 0x42002c8d +0, 311220, 1524, 0xbcb609e3 +1, 313380, 1088, 0xdce57471 +0, 315000, 1554, 0x3d740564 +0, 318690, 1467, 0xc349f2d7 +0, 322470, 1066, 0xb7401462 +0, 326250, 1502, 0x3ee602ed +0, 329940, 1148, 0xba463637 +0, 333720, 1351, 0x5e85ae79 +0, 337500, 1187, 0xed8d6055 +0, 341190, 1200, 0x64185be6 +0, 344970, 1175, 0x12ad3c1e +0, 348750, 1179, 0x7e034570 +0, 352440, 1136, 0x5c633c51 +1, 352620, 1088, 0xf3887977 +0, 356220, 1064, 0x5eb51d89 +0, 360000, 953, 0xe148bbdd +0, 363690, 989, 0x901ec306 +0, 367470, 1030, 0x680de26f +0, 371250, 1078, 0x86e0ee43 +0, 374940, 1232, 0x98546a86 +0, 378720, 1164, 0x93305074 +0, 382500, 1348, 0x27cfa91b +0, 386190, 1417, 0x2312d70e +0, 389970, 1285, 0x46ca4cca +1, 391770, 1088, 0x1d6c8ed2 +0, 393750, 1037, 0xcf09dd3d +0, 397440, 1005, 0xe780cf1f +0, 401220, 890, 0x8b1d8c1b +0, 405000, 1023, 0xd1dbd506 +0, 408690, 803, 0x935e775e +0, 412470, 1035, 0x6a220483 +0, 416250, 466, 0xd88bb237 +1, 431010, 1088, 0x09115bae +0, 442440, 945, 0x8f2eb1ec +0, 446220, 1190, 0x4c451c1b +0, 450000, 1811, 0x727c52cb +0, 453690, 1552, 0x73f82bff +0, 457470, 1544, 0xa7241ece +0, 461250, 1707, 0x3d1a6464 +0, 464940, 1103, 0x06b22710 +0, 468720, 1122, 0x656725b8 +1, 470160, 1088, 0x0c8b9372 +0, 472500, 1150, 0xf9674678 +0, 476190, 1438, 0x03fac426 +0, 479970, 1623, 0x7adb1321 +0, 483750, 1677, 0x0b9a3e62 +0, 487440, 1124, 0x769c0ea2 +0, 491220, 1221, 0xd942409f +0, 495000, 1698, 0xd7ca3fe3 +0, 498690, 1262, 0xb994692f +0, 502470, 2097, 0xf4eb663f +0, 506250, 1251, 0xfd4f633a +1, 509310, 1088, 0x75a82540 +0, 509940, 1633, 0xb7e1290e +0, 513720, 1739, 0xecd18c38 +0, 517500, 1132, 0xc83e1828 +0, 521190, 825, 0xdd02867c +0, 524970, 903, 0x349ba205 +0, 528750, 1013, 0x1366ec2a +0, 532440, 1340, 0xeaa2a231 +0, 536220, 1102, 0x82de2889 +0, 540000, 1834, 0x59b99b92 +1, 540720, 1088, 0x690312b0 +0, 543690, 1332, 0x0610813a +0, 547470, 1275, 0x5b0d7be7 +0, 551250, 1376, 0xd915b0fe +0, 554940, 1417, 0x8606b34a +0, 558720, 1360, 0x3bcd93d3 +0, 562500, 1330, 0xd0439c93 +0, 566190, 1562, 0xb2560a09 +1, 568080, 1088, 0x76d50ff3 +0, 569970, 1376, 0x4f9eb447 +0, 573750, 1405, 0x85d3b084 +0, 577440, 1344, 0xcdbda2ae +0, 581220, 1313, 0xe3067b35 +0, 585000, 1459, 0xf9d2c56f +0, 588690, 1275, 0xf5536d81 +0, 592470, 1209, 0x3b5b4ea5 +1, 593550, 1088, 0x8766276f +0, 596250, 1352, 0x7b199d28 +0, 599940, 1349, 0x02adaaf3 +0, 603720, 1464, 0x20d7cfd2 +0, 607500, 1377, 0x78e0b1f4 +0, 611190, 289, 0x1f2e9246 +1, 619020, 1088, 0x678f20fd +1, 644490, 1088, 0x718afa20 +1, 669960, 1088, 0x758f0939 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/wnv1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/wnv1 new file mode 100644 index 00000000..e7fd7ae0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/wnv1 @@ -0,0 +1,86 @@ +0, 0, 38400, 0x4c3fdc2f +0, 6000, 38400, 0x11c9d0cb +0, 12000, 38400, 0x6c37fd7f +0, 18000, 38400, 0x7e6c9b93 +0, 23999, 38400, 0xc9d4c5f7 +0, 29999, 38400, 0x5038088a +0, 35999, 38400, 0xa48411b6 +0, 41999, 38400, 0xb9b7e97b +0, 47999, 38400, 0xce37e037 +0, 53999, 38400, 0x5df528da +0, 59999, 38400, 0xe4e65876 +0, 65998, 38400, 0x5bf4a46e +0, 71998, 38400, 0xee478c2a +0, 77998, 38400, 0x51a555c2 +0, 83998, 38400, 0x30a4030a +0, 89998, 38400, 0xb13802d6 +0, 95998, 38400, 0x45ef5482 +0, 101997, 38400, 0x00aef51b +0, 107997, 38400, 0xe8a71d7e +0, 113997, 38400, 0x3d185142 +0, 119997, 38400, 0x221f59ea +0, 125997, 38400, 0x1ae13572 +0, 131997, 38400, 0xe498450e +0, 137997, 38400, 0xe744747a +0, 143996, 38400, 0x44ee3352 +0, 149996, 38400, 0x74187342 +0, 155996, 38400, 0xbee9656e +0, 161996, 38400, 0x645c8d1a +0, 167996, 38400, 0x443dde1e +0, 173996, 38400, 0x012106fd +0, 179996, 38400, 0x4bb86b82 +0, 185995, 38400, 0x152473ba +0, 191995, 38400, 0xa5214ea2 +0, 197995, 38400, 0x9e8c7046 +0, 203995, 38400, 0xdd95a9ba +0, 209995, 38400, 0x64c5f292 +0, 215995, 38400, 0xdd42a04a +0, 221994, 38400, 0x6069359e +0, 227994, 38400, 0x094bf60f +0, 233994, 38400, 0x584217be +0, 239994, 38400, 0x4c5ef453 +0, 245994, 38400, 0x7e83eeb7 +0, 251994, 38400, 0xaa57efb3 +0, 257994, 38400, 0x42b0a66f +0, 263993, 38400, 0x371fdcbf +0, 269993, 38400, 0xb8f1e1bf +0, 275993, 38400, 0x45c91fa6 +0, 281993, 38400, 0x7508338e +0, 287993, 38400, 0xb5dd91ab +0, 293993, 38400, 0x0204b38f +0, 299993, 38400, 0x8ae2da6f +0, 305992, 38400, 0x926ad59f +0, 311992, 38400, 0xf9c3234e +0, 317992, 38400, 0xabcb00f6 +0, 323992, 38400, 0x2d1de7bb +0, 329992, 38400, 0x332d39ce +0, 335992, 38400, 0xcd767286 +0, 341991, 38400, 0xf3d046ae +0, 347991, 38400, 0x7ccc8162 +0, 353991, 38400, 0x09f6997e +0, 359991, 38400, 0x5fcc6536 +0, 365991, 38400, 0x9959a3b6 +0, 371991, 38400, 0x63a5dcd2 +0, 377991, 38400, 0x66deae96 +0, 383990, 38400, 0x6feb0b1d +0, 389990, 38400, 0x2063c25e +0, 395990, 38400, 0x617f93de +0, 401990, 38400, 0x4251c806 +0, 407990, 38400, 0x702eb68e +0, 413990, 38400, 0xe80b8ea6 +0, 419990, 38400, 0xa51ec1b2 +0, 425989, 38400, 0x8aa8af8a +0, 431989, 38400, 0x9a260321 +0, 437989, 38400, 0x2c732c22 +0, 443989, 38400, 0x216ed6a2 +0, 449989, 38400, 0x5558326d +0, 455989, 38400, 0x0cae4cf5 +0, 461988, 38400, 0xf0e02f3d +0, 467988, 38400, 0xfddd061d +0, 473988, 38400, 0x4563e9d6 +0, 479988, 38400, 0xc8ac10d1 +0, 485988, 38400, 0x97f8c3fa +0, 491988, 38400, 0x86190eb1 +0, 497988, 38400, 0xc9022d65 +0, 503987, 38400, 0x345738d5 +0, 509987, 38400, 0x457ae80e diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ws_snd b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ws_snd new file mode 100644 index 00000000..4004e331 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/ws_snd @@ -0,0 +1 @@ +023317c7876aa5271f086f753d84561b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/xan-dpcm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/xan-dpcm new file mode 100644 index 00000000..cb56677d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/xan-dpcm @@ -0,0 +1 @@ +b6da857766896ab10bb900004f915053 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/yop b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/yop new file mode 100644 index 00000000..782fd471 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/yop @@ -0,0 +1,7 @@ +0, 0, 302760, 0x78939253 +0, 7500, 302760, 0x534f5253 +0, 15000, 302760, 0xe991aa82 +0, 22500, 302760, 0xc34b20bd +0, 30000, 302760, 0x461d29a1 +0, 37500, 302760, 0x45abca02 +0, 45000, 302760, 0xb05448b9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zlib b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zlib new file mode 100644 index 00000000..ba6221fc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zlib @@ -0,0 +1 @@ +0, 0, 253440, 0x94af61e5 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zmbv-15bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zmbv-15bit new file mode 100644 index 00000000..527c1e6b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zmbv-15bit @@ -0,0 +1,159 @@ +0, 0, 192000, 0xe1d317d6 +0, 14193, 192000, 0xe100109d +0, 28385, 192000, 0xecc69c65 +0, 42578, 192000, 0x68f06324 +0, 56770, 192000, 0x68f06324 +0, 70963, 192000, 0x68f06324 +0, 85155, 192000, 0x68f06324 +0, 99348, 192000, 0x68f06324 +0, 113540, 192000, 0x68f06324 +0, 127733, 192000, 0x68f06324 +0, 141925, 192000, 0x68f06324 +0, 156118, 192000, 0x68f06324 +0, 170310, 192000, 0x68f06324 +0, 184503, 192000, 0x68f06324 +0, 198695, 192000, 0x68f06324 +0, 212888, 192000, 0x68f06324 +0, 227080, 192000, 0x68f06324 +0, 241273, 192000, 0x4c03d2e3 +0, 255466, 192000, 0x4c03d2e3 +0, 269658, 192000, 0x4c03d2e3 +0, 283851, 192000, 0x4c03d2e3 +0, 298043, 192000, 0xb562cf68 +0, 312236, 192000, 0xb562cf68 +0, 326428, 192000, 0xb562cf68 +0, 340621, 192000, 0xb562cf68 +0, 354813, 192000, 0xb562cf68 +0, 369006, 192000, 0x0e5e03c7 +0, 383198, 192000, 0x0e5e03c7 +0, 397391, 192000, 0x0e5e03c7 +0, 411583, 192000, 0x0e5e03c7 +0, 425776, 192000, 0xeb2e0f67 +0, 439968, 192000, 0xeb2e0f67 +0, 454161, 192000, 0xeb2e0f67 +0, 468353, 192000, 0xeb2e0f67 +0, 482546, 192000, 0xeb2e0f67 +0, 496739, 192000, 0xdce603c7 +0, 510931, 192000, 0xdce603c7 +0, 525124, 192000, 0xdce603c7 +0, 539316, 192000, 0xdce603c7 +0, 553509, 192000, 0xa8e7db08 +0, 567701, 192000, 0xa8e7db08 +0, 581894, 192000, 0xa8e7db08 +0, 596086, 192000, 0xa8e7db08 +0, 610279, 192000, 0xa8e7db08 +0, 624471, 192000, 0x322a1b07 +0, 638664, 192000, 0x322a1b07 +0, 652856, 192000, 0x322a1b07 +0, 667049, 192000, 0x322a1b07 +0, 681241, 192000, 0x743206af +0, 695434, 192000, 0x743206af +0, 709627, 192000, 0x743206af +0, 723819, 192000, 0x743206af +0, 738012, 192000, 0x743206af +0, 752204, 192000, 0x50195ddf +0, 766397, 192000, 0x50195ddf +0, 780589, 192000, 0x50195ddf +0, 794782, 192000, 0x50195ddf +0, 808974, 192000, 0xd31620d7 +0, 823167, 192000, 0xd31620d7 +0, 837359, 192000, 0xd31620d7 +0, 851552, 192000, 0xd31620d7 +0, 865744, 192000, 0xd31620d7 +0, 879937, 192000, 0x3af023bf +0, 894129, 192000, 0x3af023bf +0, 908322, 192000, 0x3af023bf +0, 922514, 192000, 0x3af023bf +0, 936707, 192000, 0x561a124f +0, 950900, 192000, 0x561a124f +0, 965092, 192000, 0x561a124f +0, 979285, 192000, 0x561a124f +0, 993477, 192000, 0x561a124f +0, 1007670, 192000, 0x99210c7f +0, 1021862, 192000, 0x99210c7f +0, 1036055, 192000, 0x99210c7f +0, 1050247, 192000, 0x99210c7f +0, 1064440, 192000, 0xc77b03c7 +0, 1078632, 192000, 0xc77b03c7 +0, 1092825, 192000, 0xc77b03c7 +0, 1107017, 192000, 0xc77b03c7 +0, 1121210, 192000, 0xc77b03c7 +0, 1135402, 192000, 0x83ea7550 +0, 1149595, 192000, 0xec285270 +0, 1163787, 192000, 0x0e075558 +0, 1177980, 192000, 0x880c2108 +0, 1192173, 192000, 0x40c523f0 +0, 1206365, 192000, 0x01378f78 +0, 1220558, 192000, 0x42045558 +0, 1234750, 192000, 0xde8f3278 +0, 1248943, 192000, 0xa58c0110 +0, 1263135, 192000, 0x335ea9d1 +0, 1277328, 192000, 0x7e94bb41 +0, 1291520, 192000, 0x9cc5d569 +0, 1305713, 192000, 0xe942e109 +0, 1319905, 192000, 0x4cb83848 +0, 1334098, 192000, 0x6986fe19 +0, 1348290, 192000, 0xbb8c23f0 +0, 1362483, 192000, 0x296766c8 +0, 1376675, 192000, 0xb4230cb0 +0, 1390868, 192000, 0x2c2f1850 +0, 1405060, 192000, 0x93c70110 +0, 1419253, 192000, 0xb830a9d1 +0, 1433446, 192000, 0xbed48fa9 +0, 1447638, 192000, 0xc087bb41 +0, 1461831, 192000, 0x792de6d9 +0, 1476023, 192000, 0x1edaf849 +0, 1490216, 192000, 0x6564bb41 +0, 1504408, 192000, 0x9153d569 +0, 1518601, 192000, 0xe73ff561 +0, 1532793, 192000, 0xfa3be3f1 +0, 1546986, 192000, 0x8008fe19 +0, 1561178, 192000, 0xd2561b38 +0, 1575371, 192000, 0xae3c26d8 +0, 1589563, 192000, 0xb0114f88 +0, 1603756, 192000, 0x117e1e20 +0, 1617948, 192000, 0x482d1280 +0, 1632141, 192000, 0x425106e0 +0, 1646334, 192000, 0x0e6b0cb0 +0, 1660526, 192000, 0x95dc2ca8 +0, 1674719, 192000, 0x52097b20 +0, 1688911, 192000, 0x41a84f88 +0, 1703104, 192000, 0xb78d7268 +0, 1717296, 192000, 0x2cd366c8 +0, 1731489, 192000, 0xbf39e109 +0, 1745681, 192000, 0xecbaeca9 +0, 1759874, 192000, 0x3254eca9 +0, 1774066, 192000, 0x3fc903f8 +0, 1788259, 192000, 0x0bbc5e10 +0, 1802451, 192000, 0xe9103560 +0, 1816644, 192000, 0xbd5d2f90 +0, 1830836, 192000, 0x7ace2ca8 +0, 1845029, 192000, 0x7354c6e1 +0, 1859221, 192000, 0x72e0d569 +0, 1873414, 192000, 0xa4ade3f1 +0, 1887607, 192000, 0xf2f8cf99 +0, 1901799, 192000, 0x2b7ee6d9 +0, 1915992, 192000, 0x548d1b38 +0, 1930184, 192000, 0xa1551b38 +0, 1944377, 192000, 0xfb3e3560 +0, 1958569, 192000, 0x3aaaccb1 +0, 1972762, 192000, 0xa85ee109 +0, 1986954, 192000, 0xc1bff849 +0, 2001147, 192000, 0xa62bef91 +0, 2015339, 192000, 0xddf40cb0 +0, 2029532, 192000, 0x15bb3e18 +0, 2043724, 192000, 0x92fd5558 +0, 2057917, 192000, 0x2d365270 +0, 2072109, 192000, 0xb5f343e8 +0, 2086302, 192000, 0x93042108 +0, 2100494, 192000, 0x96d59830 +0, 2114687, 192000, 0x1f69ddf0 +0, 2128880, 192000, 0x8eb0124f +0, 2143072, 192000, 0xae727dd7 +0, 2157265, 192000, 0xb8a63aff +0, 2171457, 192000, 0xfae83de7 +0, 2185650, 192000, 0x2f034987 +0, 2199842, 192000, 0xa99e1537 +0, 2214035, 192000, 0x0ad70c7f +0, 2228227, 192000, 0x74b3e990 +0, 2242420, 192000, 0x1bf0d250 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zmbv-16bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zmbv-16bit new file mode 100644 index 00000000..ef37d44f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zmbv-16bit @@ -0,0 +1,159 @@ +0, 0, 192000, 0x11e62dbe +0, 14193, 192000, 0x31698b8f +0, 28385, 192000, 0x31698b8f +0, 42578, 192000, 0x31698b8f +0, 56770, 192000, 0x31698b8f +0, 70963, 192000, 0x31698b8f +0, 85155, 192000, 0x31698b8f +0, 99348, 192000, 0x31698b8f +0, 113540, 192000, 0x31698b8f +0, 127733, 192000, 0x31698b8f +0, 141925, 192000, 0x31698b8f +0, 156118, 192000, 0x31698b8f +0, 170310, 192000, 0x31698b8f +0, 184503, 192000, 0x4ca609ea +0, 198695, 192000, 0x4ca609ea +0, 212888, 192000, 0x4ca609ea +0, 227080, 192000, 0x4ca609ea +0, 241273, 192000, 0x33dd0a8b +0, 255466, 192000, 0x33dd0a8b +0, 269658, 192000, 0x33dd0a8b +0, 283851, 192000, 0x33dd0a8b +0, 298043, 192000, 0x33dd0a8b +0, 312236, 192000, 0x08e2420f +0, 326428, 192000, 0x08e2420f +0, 340621, 192000, 0x08e2420f +0, 354813, 192000, 0x08e2420f +0, 369006, 192000, 0x7b7b50ab +0, 383198, 192000, 0x7b7b50ab +0, 397391, 192000, 0x7b7b50ab +0, 411583, 192000, 0x7b7b50ab +0, 425776, 192000, 0x7b7b50ab +0, 439968, 192000, 0x128744fb +0, 454161, 192000, 0x128744fb +0, 468353, 192000, 0x128744fb +0, 482546, 192000, 0x128744fb +0, 496739, 192000, 0x8643163b +0, 510931, 192000, 0x8643163b +0, 525124, 192000, 0x8643163b +0, 539316, 192000, 0x8643163b +0, 553509, 192000, 0x8643163b +0, 567701, 192000, 0x4f7c596f +0, 581894, 192000, 0x4f7c596f +0, 596086, 192000, 0x4f7c596f +0, 610279, 192000, 0x4f7c596f +0, 624471, 192000, 0xa275420f +0, 638664, 192000, 0xa275420f +0, 652856, 192000, 0xa275420f +0, 667049, 192000, 0xa275420f +0, 681241, 192000, 0xa275420f +0, 695434, 192000, 0x2e4796cb +0, 709627, 192000, 0x2e4796cb +0, 723819, 192000, 0x2e4796cb +0, 738012, 192000, 0x2e4796cb +0, 752204, 192000, 0xebd45683 +0, 766397, 192000, 0xebd45683 +0, 780589, 192000, 0xebd45683 +0, 794782, 192000, 0xebd45683 +0, 808974, 192000, 0xebd45683 +0, 823167, 192000, 0x0bf6596f +0, 837359, 192000, 0x0bf6596f +0, 851552, 192000, 0x0bf6596f +0, 865744, 192000, 0x0bf6596f +0, 879937, 192000, 0xb7af47e7 +0, 894129, 192000, 0xb7af47e7 +0, 908322, 192000, 0xb7af47e7 +0, 922514, 192000, 0xb7af47e7 +0, 936707, 192000, 0xb7af47e7 +0, 950900, 192000, 0x8bc344fb +0, 965092, 192000, 0x8bc344fb +0, 979285, 192000, 0x8bc344fb +0, 993477, 192000, 0x8bc344fb +0, 1007670, 192000, 0x8bc344fb +0, 1021862, 192000, 0x02a23f23 +0, 1036055, 192000, 0x02a23f23 +0, 1050247, 192000, 0x02a23f23 +0, 1064440, 192000, 0x02a23f23 +0, 1078632, 192000, 0x17be3087 +0, 1092825, 192000, 0x52c7b2d4 +0, 1107017, 192000, 0xa05e9888 +0, 1121210, 192000, 0x4d6a6cb4 +0, 1135402, 192000, 0x3e2189ec +0, 1149595, 192000, 0xfbe3ca34 +0, 1163787, 192000, 0xa9cd8fc4 +0, 1177980, 192000, 0x986e6cb4 +0, 1192173, 192000, 0x42373b08 +0, 1206365, 192000, 0xab96e351 +0, 1220558, 192000, 0x28ccf4d9 +0, 1234750, 192000, 0xc19e0f34 +0, 1248943, 192000, 0xd8da1ae4 +0, 1263135, 192000, 0xd015728c +0, 1277328, 192000, 0x550623a8 +0, 1291520, 192000, 0x3c5c5268 +0, 1305713, 192000, 0x3eae8128 +0, 1319905, 192000, 0x3c51381c +0, 1334098, 192000, 0x745046b8 +0, 1348290, 192000, 0xa8bd43cc +0, 1362483, 192000, 0xde8fe351 +0, 1376675, 192000, 0x3d5cc905 +0, 1390868, 192000, 0xcf8df4d9 +0, 1405060, 192000, 0x698b20bc +0, 1419253, 192000, 0x159d3244 +0, 1433446, 192000, 0xba1af4d9 +0, 1447638, 192000, 0x033a0f34 +0, 1461831, 192000, 0x72612f58 +0, 1476023, 192000, 0x11e11dd0 +0, 1490216, 192000, 0x4fc04f7c +0, 1504408, 192000, 0x37779888 +0, 1518601, 192000, 0xabfc5e18 +0, 1532793, 192000, 0x0ad97e3c +0, 1546986, 192000, 0xddf492b0 +0, 1561178, 192000, 0x198b23a8 +0, 1575371, 192000, 0x6b491220 +0, 1589563, 192000, 0x632417f8 +0, 1603756, 192000, 0x0dc5381c +0, 1617948, 192000, 0x6d548700 +0, 1632141, 192000, 0xae0c5b2c +0, 1646334, 192000, 0x23427e3c +0, 1660526, 192000, 0x5def728c +0, 1674719, 192000, 0xec831ae4 +0, 1688911, 192000, 0x00000000 +0, 1703104, 192000, 0x00000000 +0, 1717296, 192000, 0x00000000 +0, 1731489, 192000, 0x00000000 +0, 1745681, 192000, 0x00000000 +0, 1759874, 192000, 0x00000000 +0, 1774066, 192000, 0x00000000 +0, 1788259, 192000, 0x00000000 +0, 1802451, 192000, 0x00000000 +0, 1816644, 192000, 0xd6050414 +0, 1830836, 192000, 0xf9f90594 +0, 1845029, 192000, 0xa6220704 +0, 1859221, 192000, 0x54570858 +0, 1873414, 192000, 0xd81109ac +0, 1887607, 192000, 0xc0540afc +0, 1901799, 192000, 0x83ee0c20 +0, 1915992, 192000, 0x2a810d3c +0, 1930184, 192000, 0xb3a71844 +0, 1944377, 192000, 0xd4ff1c7c +0, 1958569, 192000, 0x92b21fdc +0, 1972762, 192000, 0x03912364 +0, 1986954, 192000, 0x65c9262c +0, 2001147, 192000, 0xf2e5290c +0, 2015339, 192000, 0xc8cc2b4c +0, 2029532, 192000, 0x272a2f1c +0, 2043724, 192000, 0xa672313c +0, 2057917, 192000, 0xab01331c +0, 2072109, 192000, 0x92643458 +0, 2086302, 192000, 0x9a943548 +0, 2100494, 192000, 0x3eb735ac +0, 2114687, 192000, 0x3eb735ac +0, 2128880, 192000, 0x3eb735ac +0, 2143072, 192000, 0x3eb735ac +0, 2157265, 192000, 0x3eb735ac +0, 2171457, 192000, 0x3eb735ac +0, 2185650, 192000, 0x3eb735ac +0, 2199842, 192000, 0x3eb735ac +0, 2214035, 192000, 0x3eb735ac +0, 2228227, 192000, 0x3eb735ac +0, 2242420, 192000, 0x3eb735ac diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zmbv-32bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zmbv-32bit new file mode 100644 index 00000000..4b961cc3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zmbv-32bit @@ -0,0 +1,159 @@ +0, 0, 192000, 0x3ac10e8e +0, 14193, 192000, 0xb772ee57 +0, 28385, 192000, 0x9b6e648a +0, 42578, 192000, 0x3d9c33e3 +0, 56770, 192000, 0x006db76d +0, 70963, 192000, 0x006db76d +0, 85155, 192000, 0x006db76d +0, 99348, 192000, 0x006db76d +0, 113540, 192000, 0x006db76d +0, 127733, 192000, 0x006db76d +0, 141925, 192000, 0x006db76d +0, 156118, 192000, 0x006db76d +0, 170310, 192000, 0x006db76d +0, 184503, 192000, 0x006db76d +0, 198695, 192000, 0x006db76d +0, 212888, 192000, 0x7b9b28fb +0, 227080, 192000, 0x7b9b28fb +0, 241273, 192000, 0x7b9b28fb +0, 255466, 192000, 0x7b9b28fb +0, 269658, 192000, 0x7b9b28fb +0, 283851, 192000, 0x7b9b28fb +0, 298043, 192000, 0x67be3519 +0, 312236, 192000, 0x67be3519 +0, 326428, 192000, 0x67be3519 +0, 340621, 192000, 0x67be3519 +0, 354813, 192000, 0x67be3519 +0, 369006, 192000, 0x2ece70dd +0, 383198, 192000, 0x2ece70dd +0, 397391, 192000, 0x2ece70dd +0, 411583, 192000, 0x2ece70dd +0, 425776, 192000, 0x2ece70dd +0, 439968, 192000, 0x2ece70dd +0, 454161, 192000, 0xd3a382cb +0, 468353, 192000, 0xd3a382cb +0, 482546, 192000, 0xd3a382cb +0, 496739, 192000, 0xd3a382cb +0, 510931, 192000, 0xd3a382cb +0, 525124, 192000, 0xd3a382cb +0, 539316, 192000, 0x2d3d7fce +0, 553509, 192000, 0x2d3d7fce +0, 567701, 192000, 0x2d3d7fce +0, 581894, 192000, 0x2d3d7fce +0, 596086, 192000, 0x2d3d7fce +0, 610279, 192000, 0x36fd52fb +0, 624471, 192000, 0x36fd52fb +0, 638664, 192000, 0x36fd52fb +0, 652856, 192000, 0x36fd52fb +0, 667049, 192000, 0x36fd52fb +0, 681241, 192000, 0x36fd52fb +0, 695434, 192000, 0xa38e9ab3 +0, 709627, 192000, 0x57095eef +0, 723819, 192000, 0x5c4f4d01 +0, 738012, 192000, 0xac20321c +0, 752204, 192000, 0x7e370e40 +0, 766397, 192000, 0xe9d92925 +0, 780589, 192000, 0xfef4d26d +0, 794782, 192000, 0x77a4ab94 +0, 808974, 192000, 0x802fb18e +0, 823167, 192000, 0xce968db2 +0, 837359, 192000, 0x21e6ab94 +0, 851552, 192000, 0x309d45fa +0, 865744, 192000, 0x5d193709 +0, 879937, 192000, 0x72190d33 +0, 894129, 192000, 0xdaed162a +0, 908322, 192000, 0x2fcaf23f +0, 922514, 192000, 0x8986d45d +0, 936707, 192000, 0xcf7de34e +0, 950900, 192000, 0x22390d33 +0, 965092, 192000, 0x4b29132d +0, 979285, 192000, 0xbffe1f21 +0, 993477, 192000, 0xa4eee34e +0, 1007670, 192000, 0xe85ae64b +0, 1021862, 192000, 0xb7bef23f +0, 1036055, 192000, 0x05ab1927 +0, 1050247, 192000, 0x915f6cd3 +0, 1064440, 192000, 0x524d69d6 +0, 1078632, 192000, 0x62da78c7 +0, 1092825, 192000, 0xbf6f84bb +0, 1107017, 192000, 0xbe9f6cd3 +0, 1121210, 192000, 0x80d0132d +0, 1135402, 192000, 0x0789251b +0, 1149595, 192000, 0xba1a1f21 +0, 1163787, 192000, 0x542b42fd +0, 1177980, 192000, 0x0ff951ee +0, 1192173, 192000, 0x785048f7 +0, 1206365, 192000, 0x5a50251b +0, 1220558, 192000, 0xd5d73a06 +0, 1234750, 192000, 0x7a3a54eb +0, 1248943, 192000, 0x1e2b5de2 +0, 1263135, 192000, 0xeac542fd +0, 1277328, 192000, 0x897a1f21 +0, 1291520, 192000, 0x61602b15 +0, 1305713, 192000, 0xb12f221e +0, 1319905, 192000, 0x08541f21 +0, 1334098, 192000, 0xeebd251b +0, 1348290, 192000, 0xc1132e12 +0, 1362483, 192000, 0x99642818 +0, 1376675, 192000, 0x9b8e162a +0, 1390868, 192000, 0x21b81f21 +0, 1405060, 192000, 0x1abd1030 +0, 1419253, 192000, 0x0d613d03 +0, 1433446, 192000, 0xcb32132d +0, 1447638, 192000, 0xc680162a +0, 1461831, 192000, 0x8dea2818 +0, 1476023, 192000, 0x3c4e1927 +0, 1490216, 192000, 0xed733709 +0, 1504408, 192000, 0xf4051c24 +0, 1518601, 192000, 0xb8eb221e +0, 1532793, 192000, 0x1a412818 +0, 1546986, 192000, 0x6ee6162a +0, 1561178, 192000, 0xe1a248f7 +0, 1575371, 192000, 0xc2c2221e +0, 1589563, 192000, 0x7fdf1f21 +0, 1603756, 192000, 0x85bc251b +0, 1617948, 192000, 0xe77c251b +0, 1632141, 192000, 0x8789340c +0, 1646334, 192000, 0xb6014000 +0, 1660526, 192000, 0xaa9542fd +0, 1674719, 192000, 0x36ce54eb +0, 1688911, 192000, 0xd1324ef1 +0, 1703104, 192000, 0x0ade60df +0, 1717296, 192000, 0xfac56cd3 +0, 1731489, 192000, 0x00000000 +0, 1745681, 192000, 0x00000000 +0, 1759874, 192000, 0xc61c026a +0, 1774066, 192000, 0x60810842 +0, 1788259, 192000, 0x65081393 +0, 1802451, 192000, 0xc806209f +0, 1816644, 192000, 0x53aa32cb +0, 1830836, 192000, 0x176546ef +0, 1845029, 192000, 0x4e095d0e +0, 1859221, 192000, 0xf74b7774 +0, 1873414, 192000, 0x32809306 +0, 1887607, 192000, 0x5219ae81 +0, 1901799, 192000, 0x3badcc40 +0, 1915992, 192000, 0x1387ea5d +0, 1930184, 192000, 0xe0c606f0 +0, 1944377, 192000, 0x106f2197 +0, 1958569, 192000, 0xfe2139cf +0, 1972762, 192000, 0x907d4f0a +0, 1986954, 192000, 0x04415dad +0, 2001147, 192000, 0xe0b864b6 +0, 2015339, 192000, 0xcb2a64b8 +0, 2029532, 192000, 0xcb2a64b8 +0, 2043724, 192000, 0xcb2a64b8 +0, 2057917, 192000, 0xcb2a64b8 +0, 2072109, 192000, 0xcb2a64b8 +0, 2086302, 192000, 0xcb2a64b8 +0, 2100494, 192000, 0xcb2a64b8 +0, 2114687, 192000, 0xcb2a64b8 +0, 2128880, 192000, 0xcb2a64b8 +0, 2143072, 192000, 0xcb2a64b8 +0, 2157265, 192000, 0xcb2a64b8 +0, 2171457, 192000, 0xcb2a64b8 +0, 2185650, 192000, 0xcb2a64b8 +0, 2199842, 192000, 0xcb2a64b8 +0, 2214035, 192000, 0xcb2a64b8 +0, 2228227, 192000, 0xcb2a64b8 +0, 2242420, 192000, 0xcb2a64b8 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zmbv-8bit b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zmbv-8bit new file mode 100644 index 00000000..258147f9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/fate/zmbv-8bit @@ -0,0 +1,275 @@ +0, 0, 192000, 0x5234b617 +0, 1284, 192000, 0x5234b617 +0, 2568, 192000, 0x5234b617 +0, 3852, 192000, 0x5234b617 +0, 5137, 192000, 0x5234b617 +0, 6421, 192000, 0x5234b617 +0, 7705, 192000, 0x5234b617 +0, 8989, 192000, 0x5234b617 +0, 10273, 192000, 0x5234b617 +0, 11557, 192000, 0x5234b617 +0, 12841, 192000, 0x5234b617 +0, 14125, 192000, 0x5234b617 +0, 15410, 192000, 0x5234b617 +0, 16694, 192000, 0x5234b617 +0, 17978, 192000, 0x5234b617 +0, 19262, 192000, 0x5234b617 +0, 20546, 192000, 0x5234b617 +0, 21830, 192000, 0x5234b617 +0, 23114, 192000, 0x5234b617 +0, 24398, 192000, 0x5234b617 +0, 25683, 192000, 0x5234b617 +0, 26967, 192000, 0x5234b617 +0, 28251, 192000, 0x5234b617 +0, 29535, 192000, 0x5234b617 +0, 30819, 192000, 0x5234b617 +0, 32103, 192000, 0x5234b617 +0, 33387, 192000, 0x5234b617 +0, 34672, 192000, 0x5234b617 +0, 35956, 192000, 0x5234b617 +0, 37240, 192000, 0x5234b617 +0, 38524, 192000, 0x5234b617 +0, 39808, 192000, 0x5234b617 +0, 41092, 192000, 0x5234b617 +0, 42376, 192000, 0x5234b617 +0, 43660, 192000, 0x5234b617 +0, 44945, 192000, 0x5234b617 +0, 46229, 192000, 0x5234b617 +0, 47513, 192000, 0x5234b617 +0, 48797, 192000, 0x5234b617 +0, 50081, 192000, 0x5234b617 +0, 51365, 192000, 0x5234b617 +0, 52649, 192000, 0x5234b617 +0, 53934, 192000, 0x5234b617 +0, 55218, 192000, 0x5234b617 +0, 56502, 192000, 0x5234b617 +0, 57786, 192000, 0x5234b617 +0, 59070, 192000, 0x5234b617 +0, 60354, 192000, 0x5234b617 +0, 61638, 192000, 0x5234b617 +0, 62922, 192000, 0x5234b617 +0, 64207, 192000, 0x5234b617 +0, 65491, 192000, 0x5234b617 +0, 66775, 192000, 0x5234b617 +0, 68059, 192000, 0x5234b617 +0, 69343, 192000, 0x5234b617 +0, 70627, 192000, 0x5234b617 +0, 71911, 192000, 0x5234b617 +0, 73195, 192000, 0x5234b617 +0, 74480, 192000, 0x5234b617 +0, 75764, 192000, 0x5234b617 +0, 77048, 192000, 0x5234b617 +0, 78332, 192000, 0x5234b617 +0, 79616, 192000, 0x5234b617 +0, 80900, 192000, 0x5234b617 +0, 82184, 192000, 0x5234b617 +0, 83469, 192000, 0x5234b617 +0, 84753, 192000, 0x5234b617 +0, 86037, 192000, 0x5234b617 +0, 87321, 192000, 0x5234b617 +0, 88605, 192000, 0x5234b617 +0, 89889, 192000, 0x5234b617 +0, 91173, 192000, 0x5234b617 +0, 92457, 192000, 0x5234b617 +0, 93742, 192000, 0x5234b617 +0, 95026, 192000, 0x5234b617 +0, 96310, 192000, 0x5234b617 +0, 97594, 192000, 0x5234b617 +0, 98878, 192000, 0x5234b617 +0, 100162, 192000, 0x5234b617 +0, 101446, 192000, 0x5234b617 +0, 102730, 192000, 0x5234b617 +0, 104015, 192000, 0x5234b617 +0, 105299, 192000, 0x5234b617 +0, 106583, 192000, 0x5234b617 +0, 107867, 192000, 0x5234b617 +0, 109151, 192000, 0x5234b617 +0, 110435, 192000, 0x0c148693 +0, 111719, 192000, 0x973f438b +0, 113004, 192000, 0x602a279b +0, 114288, 192000, 0x739c7527 +0, 115572, 192000, 0x4ef4b477 +0, 116856, 192000, 0x8fffec23 +0, 118140, 192000, 0xe192c706 +0, 119424, 192000, 0xf38000e5 +0, 120708, 192000, 0x628b9051 +0, 121992, 192000, 0xd7c162c0 +0, 123277, 192000, 0xd4b85307 +0, 124561, 192000, 0x377cf8cf +0, 125845, 192000, 0xf1ffdff2 +0, 127129, 192000, 0x95a0ab01 +0, 128413, 192000, 0xeb69c7f0 +0, 129697, 192000, 0xfbd0af52 +0, 130981, 192000, 0x32da6d10 +0, 132266, 192000, 0xca8e7836 +0, 133550, 192000, 0x404cefe9 +0, 134834, 192000, 0x0433e9c8 +0, 136118, 192000, 0xd6e09ecf +0, 137402, 192000, 0xc9a822b5 +0, 138686, 192000, 0x032f2398 +0, 139970, 192000, 0x9e0305bf +0, 141254, 192000, 0x9d66c993 +0, 142539, 192000, 0xe126b022 +0, 143823, 192000, 0xb59d2829 +0, 145107, 192000, 0x967ad5b1 +0, 146391, 192000, 0xb76ad1dc +0, 147675, 192000, 0xc901e6e3 +0, 148959, 192000, 0xd22bc862 +0, 150243, 192000, 0xe7547295 +0, 151527, 192000, 0x179a8d78 +0, 152812, 192000, 0x87a4310f +0, 154096, 192000, 0x4e24d3b3 +0, 155380, 192000, 0xb1b8e58a +0, 156664, 192000, 0x0ae55330 +0, 157948, 192000, 0xdb3288ab +0, 159232, 192000, 0x31867a92 +0, 160516, 192000, 0x2a44a0a5 +0, 161801, 192000, 0x29c062f4 +0, 163085, 192000, 0xf4df3a2b +0, 164369, 192000, 0x8e424f86 +0, 165653, 192000, 0x25b901f9 +0, 166937, 192000, 0x77af6cad +0, 168221, 192000, 0x0b82d562 +0, 169505, 192000, 0x4322dc3e +0, 170789, 192000, 0x4322dc3e +0, 172074, 192000, 0x4322dc3e +0, 173358, 192000, 0x2c51f91e +0, 174642, 192000, 0x2c51f91e +0, 175926, 192000, 0x2c51f91e +0, 177210, 192000, 0x2c51f91e +0, 178494, 192000, 0x197128e5 +0, 179778, 192000, 0x197128e5 +0, 181062, 192000, 0x197128e5 +0, 182347, 192000, 0xb67867c5 +0, 183631, 192000, 0xb67867c5 +0, 184915, 192000, 0xb67867c5 +0, 186199, 192000, 0xb67867c5 +0, 187483, 192000, 0x62fcac19 +0, 188767, 192000, 0x62fcac19 +0, 190051, 192000, 0x62fcac19 +0, 191336, 192000, 0xe4f4f281 +0, 192620, 192000, 0xe4f4f281 +0, 193904, 192000, 0xe4f4f281 +0, 195188, 192000, 0xe4f4f281 +0, 196472, 192000, 0x060c3190 +0, 197756, 192000, 0x060c3190 +0, 199040, 192000, 0x060c3190 +0, 200324, 192000, 0xe5c05bb4 +0, 201609, 192000, 0xe5c05bb4 +0, 202893, 192000, 0xe5c05bb4 +0, 204177, 192000, 0xe5c05bb4 +0, 205461, 192000, 0xd4b187fc +0, 206745, 192000, 0xd4b187fc +0, 208029, 192000, 0xd4b187fc +0, 209313, 192000, 0x9a549a6c +0, 210597, 192000, 0x9a549a6c +0, 211882, 192000, 0x9a549a6c +0, 213166, 192000, 0x9a549a6c +0, 214450, 192000, 0xd491bd50 +0, 215734, 192000, 0xd491bd50 +0, 217018, 192000, 0xd491bd50 +0, 218302, 192000, 0xfdfad4a8 +0, 219586, 192000, 0xfdfad4a8 +0, 220871, 192000, 0xfdfad4a8 +0, 222155, 192000, 0xfdfad4a8 +0, 223439, 192000, 0x363ef77c +0, 224723, 192000, 0x363ef77c +0, 226007, 192000, 0x363ef77c +0, 227291, 192000, 0x80c016f7 +0, 228575, 192000, 0x80c016f7 +0, 229859, 192000, 0x80c016f7 +0, 231144, 192000, 0x80c016f7 +0, 232428, 192000, 0x65852e7f +0, 233712, 192000, 0x65852e7f +0, 234996, 192000, 0x65852e7f +0, 236280, 192000, 0xcb13542b +0, 237564, 192000, 0xcb13542b +0, 238848, 192000, 0xcb13542b +0, 240133, 192000, 0xcb13542b +0, 241417, 192000, 0xb7a5664f +0, 242701, 192000, 0xb7a5664f +0, 243985, 192000, 0xb7a5664f +0, 245269, 192000, 0x8a128fd7 +0, 246553, 192000, 0x8a128fd7 +0, 247837, 192000, 0x8a128fd7 +0, 249121, 192000, 0x8a128fd7 +0, 250406, 192000, 0x9674b39b +0, 251690, 192000, 0x9674b39b +0, 252974, 192000, 0x9674b39b +0, 254258, 192000, 0x2940e3b3 +0, 255542, 192000, 0x2940e3b3 +0, 256826, 192000, 0x2940e3b3 +0, 258110, 192000, 0x2940e3b3 +0, 259394, 192000, 0x0440e56b +0, 260679, 192000, 0x0440e56b +0, 261963, 192000, 0x0440e56b +0, 263247, 192000, 0xefa3d16b +0, 264531, 192000, 0xefa3d16b +0, 265815, 192000, 0xefa3d16b +0, 267099, 192000, 0xefa3d16b +0, 268383, 192000, 0x6569b257 +0, 269668, 192000, 0x6569b257 +0, 270952, 192000, 0x6569b257 +0, 272236, 192000, 0x089985d7 +0, 273520, 192000, 0x089985d7 +0, 274804, 192000, 0x089985d7 +0, 276088, 192000, 0x089985d7 +0, 277372, 192000, 0x87e160af +0, 278656, 192000, 0x87e160af +0, 279941, 192000, 0x87e160af +0, 281225, 192000, 0x117433bb +0, 282509, 192000, 0x117433bb +0, 283793, 192000, 0x117433bb +0, 285077, 192000, 0x117433bb +0, 286361, 192000, 0xd9e0f8bc +0, 287645, 192000, 0xd9e0f8bc +0, 288929, 192000, 0xd9e0f8bc +0, 290214, 192000, 0x653cac38 +0, 291498, 192000, 0x653cac38 +0, 292782, 192000, 0x653cac38 +0, 294066, 192000, 0x653cac38 +0, 295350, 192000, 0x9070526c +0, 296634, 192000, 0x9070526c +0, 297918, 192000, 0x9070526c +0, 299203, 192000, 0x15e6e9c9 +0, 300487, 192000, 0x15e6e9c9 +0, 301771, 192000, 0x15e6e9c9 +0, 303055, 192000, 0x15e6e9c9 +0, 304339, 192000, 0x610eab25 +0, 305623, 192000, 0x610eab25 +0, 306907, 192000, 0x610eab25 +0, 308191, 192000, 0xde2a829d +0, 309476, 192000, 0xde2a829d +0, 310760, 192000, 0xde2a829d +0, 312044, 192000, 0xde2a829d +0, 313328, 192000, 0x2014becd +0, 314612, 192000, 0x2014becd +0, 315896, 192000, 0x2014becd +0, 317180, 192000, 0x551e0f98 +0, 318465, 192000, 0x551e0f98 +0, 319749, 192000, 0x551e0f98 +0, 321033, 192000, 0x551e0f98 +0, 322317, 192000, 0x4aaa6bec +0, 323601, 192000, 0x4aaa6bec +0, 324885, 192000, 0x4aaa6bec +0, 326169, 192000, 0x4053d278 +0, 327453, 192000, 0x4053d278 +0, 328738, 192000, 0x4053d278 +0, 330022, 192000, 0x4053d278 +0, 331306, 192000, 0xa0e645db +0, 332590, 192000, 0xa0e645db +0, 333874, 192000, 0xa0e645db +0, 335158, 192000, 0x3f1fc327 +0, 336442, 192000, 0x3f1fc327 +0, 337726, 192000, 0x3f1fc327 +0, 339011, 192000, 0x3f1fc327 +0, 340295, 192000, 0xa4ca2a9a +0, 341579, 192000, 0xa4ca2a9a +0, 342863, 192000, 0xa4ca2a9a +0, 344147, 192000, 0xf1b2b22e +0, 345431, 192000, 0xf1b2b22e +0, 346715, 192000, 0xf1b2b22e +0, 348000, 192000, 0xf1b2b22e +0, 349284, 192000, 0xd08e49d1 +0, 350568, 192000, 0xd08e49d1 +0, 351852, 192000, 0xd08e49d1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/aiff b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/aiff new file mode 100644 index 00000000..e5d6fc37 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/aiff @@ -0,0 +1,3 @@ +379908755146d4ead062abe9c3b5c582 *./tests/data/lavf/lavf.aif +90166 ./tests/data/lavf/lavf.aif +./tests/data/lavf/lavf.aif CRC=0xf1ae5536 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/alaw b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/alaw new file mode 100644 index 00000000..65bcf990 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/alaw @@ -0,0 +1,3 @@ +8bce9c3758b0d38da2e0718b6ab57fb4 *./tests/data/lavf/lavf.al +45056 ./tests/data/lavf/lavf.al +./tests/data/lavf/lavf.al CRC=0x5e6d372b diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/asf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/asf new file mode 100644 index 00000000..533a3c35 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/asf @@ -0,0 +1,3 @@ +c544bb40c2f4c09d44318db5228ee499 *./tests/data/lavf/lavf.asf +333375 ./tests/data/lavf/lavf.asf +./tests/data/lavf/lavf.asf CRC=0x9f5ab3e6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/au b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/au new file mode 100644 index 00000000..15f2a4bd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/au @@ -0,0 +1,3 @@ +dbd11f783219485cae32024e47c19dfb *./tests/data/lavf/lavf.au +90136 ./tests/data/lavf/lavf.au +./tests/data/lavf/lavf.au CRC=0xf1ae5536 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/avi new file mode 100644 index 00000000..cf47755a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/avi @@ -0,0 +1,3 @@ +7e5e4db8c04f0acd16cff6b30e60d0e5 *./tests/data/lavf/lavf.avi +331032 ./tests/data/lavf/lavf.avi +./tests/data/lavf/lavf.avi CRC=0x2a83e6b0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/bmp b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/bmp new file mode 100644 index 00000000..8958855e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/bmp @@ -0,0 +1,3 @@ +71f4d64a6b3c71f43a4eff526f84841c *./tests/data/images/bmp/02.bmp +./tests/data/images/bmp/%02d.bmp CRC=0xe6c71946 +304182 ./tests/data/images/bmp/02.bmp diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/dv_fmt b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/dv_fmt new file mode 100644 index 00000000..7406dff5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/dv_fmt @@ -0,0 +1,3 @@ +522e5e5a46b99f8ad8aabdaf3d2f1869 *./tests/data/lavf/lavf.dv +3600000 ./tests/data/lavf/lavf.dv +./tests/data/lavf/lavf.dv CRC=0x02c0af30 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ffm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ffm new file mode 100644 index 00000000..b89af6e3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ffm @@ -0,0 +1,3 @@ +b6acf782a38d313153b68c4ca204fc90 *./tests/data/lavf/lavf.ffm +376832 ./tests/data/lavf/lavf.ffm +./tests/data/lavf/lavf.ffm CRC=0xf361ed74 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/flv_fmt b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/flv_fmt new file mode 100644 index 00000000..1d38b6fd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/flv_fmt @@ -0,0 +1,3 @@ +62c3177547fb5853a5116661802e1ae2 *./tests/data/lavf/lavf.flv +329541 ./tests/data/lavf/lavf.flv +./tests/data/lavf/lavf.flv CRC=0x881785d1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/gif b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/gif new file mode 100644 index 00000000..fa55d0e6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/gif @@ -0,0 +1,3 @@ +98968ceb210ab260a6a7af36767b94d3 *./tests/data/lavf/lavf.gif +2906382 ./tests/data/lavf/lavf.gif +./tests/data/lavf/lavf.gif CRC=0xe5605ff6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/gxf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/gxf new file mode 100644 index 00000000..4535d9a3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/gxf @@ -0,0 +1,3 @@ +346d38d330ab5cb0caa6b5537167bc0d *./tests/data/lavf/lavf.gxf +796392 ./tests/data/lavf/lavf.gxf +./tests/data/lavf/lavf.gxf CRC=0xad9e86eb diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/jpg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/jpg new file mode 100644 index 00000000..9e5be55f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/jpg @@ -0,0 +1,3 @@ +131878fee153a086d740543fbf2ab359 *./tests/data/images/jpg/02.jpg +./tests/data/images/jpg/%02d.jpg CRC=0x8b019f23 +28406 ./tests/data/images/jpg/02.jpg diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mkv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mkv new file mode 100644 index 00000000..05eb67dd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mkv @@ -0,0 +1,3 @@ +a36c2d9378b9870880556ced1cb89ecf *./tests/data/lavf/lavf.mkv + 320478 ./tests/data/lavf/lavf.mkv +./tests/data/lavf/lavf.mkv CRC=0x2a83e6b0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mmf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mmf new file mode 100644 index 00000000..756527c8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mmf @@ -0,0 +1,3 @@ +272b91d8fc31ed43b08246d182719751 *./tests/data/lavf/lavf.mmf +22609 ./tests/data/lavf/lavf.mmf +./tests/data/lavf/lavf.mmf CRC=0x03633476 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mov b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mov new file mode 100644 index 00000000..943c605d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mov @@ -0,0 +1,3 @@ +c145305a775eb2de43cdf94eb1ab5240 *./tests/data/lavf/lavf.mov +357669 ./tests/data/lavf/lavf.mov +./tests/data/lavf/lavf.mov CRC=0x2f6a9b26 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mpg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mpg new file mode 100644 index 00000000..13f95a0f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mpg @@ -0,0 +1,3 @@ +dd60652c2193670abffb8c2a123a820e *./tests/data/lavf/lavf.mpg +372736 ./tests/data/lavf/lavf.mpg +./tests/data/lavf/lavf.mpg CRC=0x2b39ed74 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mulaw b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mulaw new file mode 100644 index 00000000..c6fa0588 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mulaw @@ -0,0 +1,3 @@ +e64027a96ad5907ee281deff3286da0a *./tests/data/lavf/lavf.ul +45056 ./tests/data/lavf/lavf.ul +./tests/data/lavf/lavf.ul CRC=0xe028b50a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mxf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mxf new file mode 100644 index 00000000..ac556f5c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/mxf @@ -0,0 +1,6 @@ +785e38ddd2466046f30aa36399b8f8fa *./tests/data/lavf/lavf.mxf +525881 ./tests/data/lavf/lavf.mxf +./tests/data/lavf/lavf.mxf CRC=0xb6aa0849 +b3174e2db508564c1cce0b5e3c1bc1bd *./tests/data/lavf/lavf.mxf_d10 +5330989 ./tests/data/lavf/lavf.mxf_d10 +./tests/data/lavf/lavf.mxf_d10 CRC=0xc3f4f92e diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/nut b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/nut new file mode 100644 index 00000000..461b1858 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/nut @@ -0,0 +1,3 @@ +16b9d2cf8effb7dae316c6b9248a49b7 *./tests/data/lavf/lavf.nut +319888 ./tests/data/lavf/lavf.nut +./tests/data/lavf/lavf.nut CRC=0x2a83e6b0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ogg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ogg new file mode 100644 index 00000000..eb96fd92 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ogg @@ -0,0 +1,3 @@ +364714f1087f3c1320b60f4209191d23 *./tests/data/lavf/lavf.ogg +13820 ./tests/data/lavf/lavf.ogg +./tests/data/lavf/lavf.ogg CRC=0xf1ae5536 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pbmpipe b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pbmpipe new file mode 100644 index 00000000..d50ed716 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pbmpipe @@ -0,0 +1,3 @@ +8ced96f5b6b7362358199ae993b4ceb7 *./tests/data/lavf/pbmpipe.pbm +317075 ./tests/data/lavf/pbmpipe.pbm +./tests/data/lavf/pbmpipe.pbm CRC=0xfae0a1ba diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pcx b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pcx new file mode 100644 index 00000000..bdb2204c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pcx @@ -0,0 +1,3 @@ +2df1d747fba23d03b6ff9c91b8b465c9 *./tests/data/images/pcx/02.pcx +./tests/data/images/pcx/%02d.pcx CRC=0x6da01946 +364147 ./tests/data/images/pcx/02.pcx diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pgm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pgm new file mode 100644 index 00000000..4043f7a1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pgm @@ -0,0 +1,3 @@ +388f5c51a678ca6a52cc006095c12f08 *./tests/data/images/pgm/02.pgm +./tests/data/images/pgm/%02d.pgm CRC=0x418d2963 +101391 ./tests/data/images/pgm/02.pgm diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pgmpipe b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pgmpipe new file mode 100644 index 00000000..28ad60ea --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pgmpipe @@ -0,0 +1,3 @@ +04e66c8e9e064c8310bd657ee559bd70 *./tests/data/lavf/pgmpipe.pgm +2534775 ./tests/data/lavf/pgmpipe.pgm +./tests/data/lavf/pgmpipe.pgm CRC=0xadf48ba9 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pixfmt b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pixfmt new file mode 100644 index 00000000..d03abffa --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/pixfmt @@ -0,0 +1,38 @@ +5641dba168ff665af1cdb4a91e1afdd6 *./tests/data/pixfmt/yuv420p.yuv +304128 ./tests/data/pixfmt/yuv420p.yuv +ac68f9fdd9d55efd0306d9b004038761 *./tests/data/pixfmt/yuv422p.yuv +304128 ./tests/data/pixfmt/yuv422p.yuv +5641dba168ff665af1cdb4a91e1afdd6 *./tests/data/pixfmt/yuv444p.yuv +304128 ./tests/data/pixfmt/yuv444p.yuv +ac68f9fdd9d55efd0306d9b004038761 *./tests/data/pixfmt/yuyv422.yuv +304128 ./tests/data/pixfmt/yuyv422.yuv +507c7e9f0c97660385df977469ca9e6d *./tests/data/pixfmt/yuv410p.yuv +304128 ./tests/data/pixfmt/yuv410p.yuv +8594ea0b8d7c2c964525b0801b5351de *./tests/data/pixfmt/yuv411p.yuv +304128 ./tests/data/pixfmt/yuv411p.yuv +66673539adf8cda28e3b76068d3aae61 *./tests/data/pixfmt/yuvj420p.yuv +304128 ./tests/data/pixfmt/yuvj420p.yuv +572bf387dd1e3f073cbfd082e055ca81 *./tests/data/pixfmt/yuvj422p.yuv +304128 ./tests/data/pixfmt/yuvj422p.yuv +c10442da177c9f1d12be3c53be6fa12c *./tests/data/pixfmt/yuvj444p.yuv +304128 ./tests/data/pixfmt/yuvj444p.yuv +c6e0f9b5817f484b175c1ec4ffb4e9c9 *./tests/data/pixfmt/rgb24.yuv +304128 ./tests/data/pixfmt/rgb24.yuv +c6e0f9b5817f484b175c1ec4ffb4e9c9 *./tests/data/pixfmt/bgr24.yuv +304128 ./tests/data/pixfmt/bgr24.yuv +c6e0f9b5817f484b175c1ec4ffb4e9c9 *./tests/data/pixfmt/rgb32.yuv +304128 ./tests/data/pixfmt/rgb32.yuv +66d39d464bd89ded2a124897f0a75ade *./tests/data/pixfmt/rgb565.yuv +304128 ./tests/data/pixfmt/rgb565.yuv +c894c3bd8d2631ed1964500b90a0c350 *./tests/data/pixfmt/rgb555.yuv +304128 ./tests/data/pixfmt/rgb555.yuv +6be306b0cce5f8e6c271ea17fef9745b *./tests/data/pixfmt/gray.yuv +304128 ./tests/data/pixfmt/gray.yuv +31398104d2349dd48328a6862bc6711f *./tests/data/pixfmt/monow.yuv +304128 ./tests/data/pixfmt/monow.yuv +31398104d2349dd48328a6862bc6711f *./tests/data/pixfmt/monob.yuv +304128 ./tests/data/pixfmt/monob.yuv +00b85790df5740bab95e2559d81603a7 *./tests/data/pixfmt/yuv440p.yuv +304128 ./tests/data/pixfmt/yuv440p.yuv +4d8d402c45d913038d4b725396719111 *./tests/data/pixfmt/yuvj440p.yuv +304128 ./tests/data/pixfmt/yuvj440p.yuv diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/png b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/png new file mode 100644 index 00000000..4343adb3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/png @@ -0,0 +1,3 @@ +c162094e51dc1a3203de43e496086dfd *./tests/data/images/png/02.png +./tests/data/images/png/%02d.png CRC=0x6da01946 +248612 ./tests/data/images/png/02.png diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ppm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ppm new file mode 100644 index 00000000..97093aaa --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ppm @@ -0,0 +1,3 @@ +16d5dadf0b362fc8ba3cb676c5dde985 *./tests/data/images/ppm/02.ppm +./tests/data/images/ppm/%02d.ppm CRC=0x6da01946 +304143 ./tests/data/images/ppm/02.ppm diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ppmpipe b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ppmpipe new file mode 100644 index 00000000..b703e16e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ppmpipe @@ -0,0 +1,3 @@ +74f1f6651ad8f192a7b4c11c2b6c71e5 *./tests/data/lavf/ppmpipe.ppm +7603575 ./tests/data/lavf/ppmpipe.ppm +./tests/data/lavf/ppmpipe.ppm CRC=0x87b3c15f diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/rm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/rm new file mode 100644 index 00000000..c26dd0a2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/rm @@ -0,0 +1,2 @@ +b97899ef2812cd1c8851dea550e042e4 *./tests/data/lavf/lavf.rm +346706 ./tests/data/lavf/lavf.rm diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/sgi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/sgi new file mode 100644 index 00000000..a43c1f42 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/sgi @@ -0,0 +1,3 @@ +7054acafd275e51cec28d4518e213081 *./tests/data/images/sgi/02.sgi +./tests/data/images/sgi/%02d.sgi CRC=0x6da01946 +308151 ./tests/data/images/sgi/02.sgi diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/swf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/swf new file mode 100644 index 00000000..1e07793e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/swf @@ -0,0 +1,3 @@ +62c5aeb636fc82cf6ba6277d36e42cb5 *./tests/data/lavf/lavf.swf +329479 ./tests/data/lavf/lavf.swf +./tests/data/lavf/lavf.swf CRC=0x881785d1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/tga b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/tga new file mode 100644 index 00000000..7efaf978 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/tga @@ -0,0 +1,3 @@ +c0305c53e6d79d4ed9f35f04f671246c *./tests/data/images/tga/02.tga +./tests/data/images/tga/%02d.tga CRC=0xe6c71946 +304172 ./tests/data/images/tga/02.tga diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/tiff b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/tiff new file mode 100644 index 00000000..4b0b985f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/tiff @@ -0,0 +1,3 @@ +b3299346a8959553a437e486d8f3bf76 *./tests/data/images/tiff/02.tiff +./tests/data/images/tiff/%02d.tiff CRC=0x6da01946 +307131 ./tests/data/images/tiff/02.tiff diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ts b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ts new file mode 100644 index 00000000..e4bdb631 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/ts @@ -0,0 +1,3 @@ +e8d609b8a5b5854a4485718434b287f7 *./tests/data/lavf/lavf.ts +406644 ./tests/data/lavf/lavf.ts +./tests/data/lavf/lavf.ts CRC=0x133216c1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/voc b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/voc new file mode 100644 index 00000000..25e8b444 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/voc @@ -0,0 +1,3 @@ +b0bc287ce4e3eef7c1012610dd7ff6d0 *./tests/data/lavf/lavf.voc +32768 ./tests/data/lavf/lavf.voc +./tests/data/lavf/lavf.voc CRC=0xa2d77c12 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/voc_s16 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/voc_s16 new file mode 100644 index 00000000..425d9655 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/voc_s16 @@ -0,0 +1,3 @@ +b20728bf036d2e23508869acbad4e576 *./tests/data/lavf/lavf.s16.voc +163840 ./tests/data/lavf/lavf.s16.voc +./tests/data/lavf/lavf.s16.voc CRC=0xfa9b6c39 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/wav new file mode 100644 index 00000000..aa6f9437 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/wav @@ -0,0 +1,3 @@ +6a3bec31d92baf52161e25179ebba315 *./tests/data/lavf/lavf.wav +90156 ./tests/data/lavf/lavf.wav +./tests/data/lavf/lavf.wav CRC=0xf1ae5536 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/yuv4mpeg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/yuv4mpeg new file mode 100644 index 00000000..8c1566ea --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavf/yuv4mpeg @@ -0,0 +1,2 @@ +ec8178cb152f9cdbfd9cb724d977db2e *./tests/data/lavf/lavf.y4m +3801808 ./tests/data/lavf/lavf.y4m diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/crop b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/crop new file mode 100644 index 00000000..32041c21 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/crop @@ -0,0 +1 @@ +crop 3d163f156eaddf41d2be20736f973539 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/crop_scale b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/crop_scale new file mode 100644 index 00000000..82e53944 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/crop_scale @@ -0,0 +1 @@ +crop_scale 0a3d45d58b805b8c47416b9239535f94 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/crop_scale_vflip b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/crop_scale_vflip new file mode 100644 index 00000000..07c729af --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/crop_scale_vflip @@ -0,0 +1 @@ +crop_scale_vflip e88a4dfb960d0bb28ee875567bedde5d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/crop_vflip b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/crop_vflip new file mode 100644 index 00000000..a3f82002 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/crop_vflip @@ -0,0 +1 @@ +crop_vflip 628542e17b6900ee79b1429183ae01b0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/null b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/null new file mode 100644 index 00000000..3c3b7b74 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/null @@ -0,0 +1 @@ +null eba2f135a08829387e2f698ff72a2939 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixdesc_be b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixdesc_be new file mode 100644 index 00000000..03abcd58 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixdesc_be @@ -0,0 +1,42 @@ +abgr 037bf9df6a765520ad6d490066bf4b89 +argb c442a8261c2265a07212ef0f72e35f5a +bgr24 0d0cb38ab3fa0b2ec0865c14f78b217b +bgr4_byte 50d23cc82d9dcef2fd12adb81fb9b806 +bgr555be 49f01b1f1f0c84fd9e776dd34cc3c280 +bgr565be 257cf78afa35dc31e9696f139c916715 +bgr8 24bd566170343d06fec6fccfff5abc54 +bgra 76a18a5151242fa137133f604cd624d2 +gray db08f7f0751900347e6b8649e4164d21 +gray16be 7becf34ae825a3df3969bf4c6bfeb5e2 +gray16le 10bd87059b5c189f3caef2837f4f2b5c +monob 668ebe8b8103b9046b251b2fa8a1d88f +monow 9251497f3b0634f1165d12d5a289d943 +nv12 e0af357888584d36eec5aa0f673793ef +nv21 9a3297f3b34baa038b1f37cb202b512f +rgb24 b41eba9651e1b5fe386289b506188105 +rgb48be 460b6de89b156290a12d3941db8bd731 +rgb48le cd93cb34d15996987367dabda3a10128 +rgb4_byte c93ba89b74c504e7f5ae9d9ab1546c73 +rgb555be 912a62c5e53bfcbac2a0340e10973cf2 +rgb565be 9cadf742e05ddc23a3b5b270f89aad3c +rgb8 4a9d8e4f2f154e83a7e1735be6300700 +rgba 93a5b3712e6eb8c5b9a09ffc7b9fbc12 +uyvy422 adcf64516a19fce44df77082bdb16291 +yuv410p 2d9225153c83ee1132397d619d94d1b3 +yuv411p 8b298af3e43348ca1b11eb8a3252ac6c +yuv420p eba2f135a08829387e2f698ff72a2939 +yuv420p16be 16c009a235cd52b74791a895423152a3 +yuv420p16le 2d59c4f1d0314a5a957a7cfc4b6fabcc +yuv422p c9bba4529821d796a6ab09f6a5fd355a +yuv422p16be 5499502e1c29534a158a1fe60e889f60 +yuv422p16le e3d61fde6978591596bc36b914386623 +yuv440p 5a064afe2b453bb52cdb3f176b1aa1cf +yuv444p 0a98447b78fd476aa39686da6a74fa2e +yuv444p16be ea602a24b8e6969679265078bd8607b6 +yuv444p16le 1262a0dc57ee147967fc896d04206313 +yuva420p a29884f3f3dfe1e00b961bc17bef3d47 +yuvj420p 32eec78ba51857b16ce9b813a49b7189 +yuvj422p 0dfa0ed434f73be51428758c69e082cb +yuvj440p 9c3a093ff64a83ac4cf0b1e65390e236 +yuvj444p ede1e5882d5c5bba48ea33cf1209d231 +yuyv422 f2569f2b5069a0ee0cecae33de0455e3 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixdesc_le b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixdesc_le new file mode 100644 index 00000000..5832f89b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixdesc_le @@ -0,0 +1,42 @@ +abgr 037bf9df6a765520ad6d490066bf4b89 +argb c442a8261c2265a07212ef0f72e35f5a +bgr24 0d0cb38ab3fa0b2ec0865c14f78b217b +bgr4_byte 50d23cc82d9dcef2fd12adb81fb9b806 +bgr555le 378d6ac4223651a1adcbf94a3d0d807b +bgr565le 1dfdd03995c287e3c754b164bf26a355 +bgr8 24bd566170343d06fec6fccfff5abc54 +bgra 76a18a5151242fa137133f604cd624d2 +gray db08f7f0751900347e6b8649e4164d21 +gray16be 7becf34ae825a3df3969bf4c6bfeb5e2 +gray16le 10bd87059b5c189f3caef2837f4f2b5c +monob 668ebe8b8103b9046b251b2fa8a1d88f +monow 9251497f3b0634f1165d12d5a289d943 +nv12 e0af357888584d36eec5aa0f673793ef +nv21 9a3297f3b34baa038b1f37cb202b512f +rgb24 b41eba9651e1b5fe386289b506188105 +rgb48be 460b6de89b156290a12d3941db8bd731 +rgb48le cd93cb34d15996987367dabda3a10128 +rgb4_byte c93ba89b74c504e7f5ae9d9ab1546c73 +rgb555le a937a0fc764fb57dc1b3af87cba0273c +rgb565le d39aa298bb525e9be8860351c6f62dab +rgb8 4a9d8e4f2f154e83a7e1735be6300700 +rgba 93a5b3712e6eb8c5b9a09ffc7b9fbc12 +uyvy422 adcf64516a19fce44df77082bdb16291 +yuv410p 2d9225153c83ee1132397d619d94d1b3 +yuv411p 8b298af3e43348ca1b11eb8a3252ac6c +yuv420p eba2f135a08829387e2f698ff72a2939 +yuv420p16be 16c009a235cd52b74791a895423152a3 +yuv420p16le 2d59c4f1d0314a5a957a7cfc4b6fabcc +yuv422p c9bba4529821d796a6ab09f6a5fd355a +yuv422p16be 5499502e1c29534a158a1fe60e889f60 +yuv422p16le e3d61fde6978591596bc36b914386623 +yuv440p 5a064afe2b453bb52cdb3f176b1aa1cf +yuv444p 0a98447b78fd476aa39686da6a74fa2e +yuv444p16be ea602a24b8e6969679265078bd8607b6 +yuv444p16le 1262a0dc57ee147967fc896d04206313 +yuva420p a29884f3f3dfe1e00b961bc17bef3d47 +yuvj420p 32eec78ba51857b16ce9b813a49b7189 +yuvj422p 0dfa0ed434f73be51428758c69e082cb +yuvj440p 9c3a093ff64a83ac4cf0b1e65390e236 +yuvj444p ede1e5882d5c5bba48ea33cf1209d231 +yuyv422 f2569f2b5069a0ee0cecae33de0455e3 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_copy_le b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_copy_le new file mode 100644 index 00000000..5832f89b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_copy_le @@ -0,0 +1,42 @@ +abgr 037bf9df6a765520ad6d490066bf4b89 +argb c442a8261c2265a07212ef0f72e35f5a +bgr24 0d0cb38ab3fa0b2ec0865c14f78b217b +bgr4_byte 50d23cc82d9dcef2fd12adb81fb9b806 +bgr555le 378d6ac4223651a1adcbf94a3d0d807b +bgr565le 1dfdd03995c287e3c754b164bf26a355 +bgr8 24bd566170343d06fec6fccfff5abc54 +bgra 76a18a5151242fa137133f604cd624d2 +gray db08f7f0751900347e6b8649e4164d21 +gray16be 7becf34ae825a3df3969bf4c6bfeb5e2 +gray16le 10bd87059b5c189f3caef2837f4f2b5c +monob 668ebe8b8103b9046b251b2fa8a1d88f +monow 9251497f3b0634f1165d12d5a289d943 +nv12 e0af357888584d36eec5aa0f673793ef +nv21 9a3297f3b34baa038b1f37cb202b512f +rgb24 b41eba9651e1b5fe386289b506188105 +rgb48be 460b6de89b156290a12d3941db8bd731 +rgb48le cd93cb34d15996987367dabda3a10128 +rgb4_byte c93ba89b74c504e7f5ae9d9ab1546c73 +rgb555le a937a0fc764fb57dc1b3af87cba0273c +rgb565le d39aa298bb525e9be8860351c6f62dab +rgb8 4a9d8e4f2f154e83a7e1735be6300700 +rgba 93a5b3712e6eb8c5b9a09ffc7b9fbc12 +uyvy422 adcf64516a19fce44df77082bdb16291 +yuv410p 2d9225153c83ee1132397d619d94d1b3 +yuv411p 8b298af3e43348ca1b11eb8a3252ac6c +yuv420p eba2f135a08829387e2f698ff72a2939 +yuv420p16be 16c009a235cd52b74791a895423152a3 +yuv420p16le 2d59c4f1d0314a5a957a7cfc4b6fabcc +yuv422p c9bba4529821d796a6ab09f6a5fd355a +yuv422p16be 5499502e1c29534a158a1fe60e889f60 +yuv422p16le e3d61fde6978591596bc36b914386623 +yuv440p 5a064afe2b453bb52cdb3f176b1aa1cf +yuv444p 0a98447b78fd476aa39686da6a74fa2e +yuv444p16be ea602a24b8e6969679265078bd8607b6 +yuv444p16le 1262a0dc57ee147967fc896d04206313 +yuva420p a29884f3f3dfe1e00b961bc17bef3d47 +yuvj420p 32eec78ba51857b16ce9b813a49b7189 +yuvj422p 0dfa0ed434f73be51428758c69e082cb +yuvj440p 9c3a093ff64a83ac4cf0b1e65390e236 +yuvj444p ede1e5882d5c5bba48ea33cf1209d231 +yuyv422 f2569f2b5069a0ee0cecae33de0455e3 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_crop_le b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_crop_le new file mode 100644 index 00000000..3016a7ff --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_crop_le @@ -0,0 +1,36 @@ +abgr cd761690872843d1b7ab0c695393c751 +argb 2ec6ef18769bcd651c2e8904d5a3ee67 +bgr24 3450fd00cf1493d1ded75544d82ba3ec +bgr4_byte 2f6ac3cdd4676ab4e2982bdf0664945b +bgr555le d22442fc13b464f9ba455b08df4e981f +bgr565le 891664e5a54ae5968901347da92bc5e9 +bgr8 4b7159e05765bd4703180072d86423c8 +bgra 395c9f706fccda721471acaa5c96c16c +gray 8c4850e66562a587a292dc728a65ea4a +gray16be daa5a6b98fb4a280c57c57bff1a2ab5a +gray16le 84f5ea7259073edcb893113b42213c8e +rgb24 3b90ed64b687d3dc186c6ef521dc71a8 +rgb48be a808128041a1962deaa8620c7448feba +rgb48le ce92d02cc322608d5be377cb1940677b +rgb4_byte 6958029f73c6cdfed4f71020d816f027 +rgb555le eeb78f8ce6186fba55c941469e60ba67 +rgb565le 6a49700680be9a0d434411825a769556 +rgb8 88b0398c265d1ed7a837dc084fa0917c +rgba fd00b24c7597268c32759a84a1de2de4 +yuv410p a9f2eaa747bf988b7bebe4f442b9c67a +yuv411p 3334d3aef8dba238658090ac172375d1 +yuv420p bfea0188ddd4889787c403caae119cc7 +yuv420p16be 8365eff38b8c329aeb95fc605fa229bb +yuv420p16le 5e8dd38d973d5854abe1ad4efad20cc1 +yuv422p f2f930a91fe00d4252c4720b5ecd8961 +yuv422p16be 167e4338811a7d272925a4c6417d60da +yuv422p16le 3359395d5875d581fa1e975013d30114 +yuv440p 2472417d980e395ad6843cbb8b633b29 +yuv444p 1f151980486848c96bc5585ced99003e +yuv444p16be d69280c2856865d2ea94bd5292aac1c6 +yuv444p16le 33f43e030bedf9723be4f63c3e9fc80e +yuva420p 7536753dfbc7932560fb50c921369a0e +yuvj420p 21f891093006d42d7683b0e1d773a657 +yuvj422p 9a43d474c407590ad8f213880586b45e +yuvj440p 977351350450ebdbf7a9d20020c6b5a5 +yuvj444p 4a50ba26859dad91dcf7000de0d0efa1 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_hflip_le b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_hflip_le new file mode 100644 index 00000000..09976f28 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_hflip_le @@ -0,0 +1,36 @@ +abgr 49468c6c9ceee5d52b08b1270a909323 +argb 50ba9f16c6475530602f2983278b82d0 +bgr24 cc53d2011d097972db0d22756c3699e3 +bgr4_byte aac987e7d1a6a96477cfc0b48a4285de +bgr555le ccee08679bac84a1f960c6c9070c5538 +bgr565le 3703466e19e1b52e03a34fd244a8e8e4 +bgr8 50b505a889f0428242305acb642da107 +bgra 01ca21e7e6a8d1281b4553bde8e8a404 +gray 03efcb4ab52a24c0af0e03cfd26c9377 +gray16be 9bcbca979601ddc4869f846f08f3d1dd +gray16le c1b8965adcc7f847ee343149ff507073 +rgb24 754f1722fc738590cc407ac65749bfe8 +rgb48be 10743e1577dc3198dbbc7c0b3b8f429e +rgb48le dd945a44f39119221407bf7a04f1bc49 +rgb4_byte c8a3f995fcf3e0919239ea2c413ddc29 +rgb555le 8778ee0cf58ce9ad1d99a1eca9f95e87 +rgb565le 2cb690eb3fcb72da3771ad6a48931158 +rgb8 9e462b811b9b6173397b9cfc1f6b2f17 +rgba d3d0dc1ecef3ed72f26a2986d0efc204 +yuv410p acb543ebbbf63eefe533e6faffc006da +yuv411p c626cf6d191139b4ca7efc0155f957f1 +yuv420p 2d5c80f9ba2ddd85b2aeda3564cc7d64 +yuv420p16be 758b0c1e2113b15e7afde48da4e4d024 +yuv420p16le 480ccd951dcb806bc875d307e02e50a0 +yuv422p 6e728f4eb9eae287c224f396d84be6ea +yuv422p16be a05d43cd62b790087bd37083174557de +yuv422p16le 6954abebcbc62d81068d58d0c62bdd5b +yuv440p a99e2b57ed601f39852715c9d675d0d3 +yuv444p 947e47f7bb5fdccc659d19b7df2b6fc3 +yuv444p16be e5ef45bc3d2f5b0b2542d5151340c382 +yuv444p16le 70793e3d66d0c23a0cdedabe9c24c2a7 +yuva420p d83ec0c01498189f179ec574918185f1 +yuvj420p df3aaaec3bb157c3bde5f0365af30f4f +yuvj422p d113871528d510a192797af59df9c05c +yuvj440p e8f7ed76e57c892a1e9e27a3f29452db +yuvj444p 2c3ae369607608c6dcb0d830f00f971a diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_null_le b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_null_le new file mode 100644 index 00000000..5832f89b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_null_le @@ -0,0 +1,42 @@ +abgr 037bf9df6a765520ad6d490066bf4b89 +argb c442a8261c2265a07212ef0f72e35f5a +bgr24 0d0cb38ab3fa0b2ec0865c14f78b217b +bgr4_byte 50d23cc82d9dcef2fd12adb81fb9b806 +bgr555le 378d6ac4223651a1adcbf94a3d0d807b +bgr565le 1dfdd03995c287e3c754b164bf26a355 +bgr8 24bd566170343d06fec6fccfff5abc54 +bgra 76a18a5151242fa137133f604cd624d2 +gray db08f7f0751900347e6b8649e4164d21 +gray16be 7becf34ae825a3df3969bf4c6bfeb5e2 +gray16le 10bd87059b5c189f3caef2837f4f2b5c +monob 668ebe8b8103b9046b251b2fa8a1d88f +monow 9251497f3b0634f1165d12d5a289d943 +nv12 e0af357888584d36eec5aa0f673793ef +nv21 9a3297f3b34baa038b1f37cb202b512f +rgb24 b41eba9651e1b5fe386289b506188105 +rgb48be 460b6de89b156290a12d3941db8bd731 +rgb48le cd93cb34d15996987367dabda3a10128 +rgb4_byte c93ba89b74c504e7f5ae9d9ab1546c73 +rgb555le a937a0fc764fb57dc1b3af87cba0273c +rgb565le d39aa298bb525e9be8860351c6f62dab +rgb8 4a9d8e4f2f154e83a7e1735be6300700 +rgba 93a5b3712e6eb8c5b9a09ffc7b9fbc12 +uyvy422 adcf64516a19fce44df77082bdb16291 +yuv410p 2d9225153c83ee1132397d619d94d1b3 +yuv411p 8b298af3e43348ca1b11eb8a3252ac6c +yuv420p eba2f135a08829387e2f698ff72a2939 +yuv420p16be 16c009a235cd52b74791a895423152a3 +yuv420p16le 2d59c4f1d0314a5a957a7cfc4b6fabcc +yuv422p c9bba4529821d796a6ab09f6a5fd355a +yuv422p16be 5499502e1c29534a158a1fe60e889f60 +yuv422p16le e3d61fde6978591596bc36b914386623 +yuv440p 5a064afe2b453bb52cdb3f176b1aa1cf +yuv444p 0a98447b78fd476aa39686da6a74fa2e +yuv444p16be ea602a24b8e6969679265078bd8607b6 +yuv444p16le 1262a0dc57ee147967fc896d04206313 +yuva420p a29884f3f3dfe1e00b961bc17bef3d47 +yuvj420p 32eec78ba51857b16ce9b813a49b7189 +yuvj422p 0dfa0ed434f73be51428758c69e082cb +yuvj440p 9c3a093ff64a83ac4cf0b1e65390e236 +yuvj444p ede1e5882d5c5bba48ea33cf1209d231 +yuyv422 f2569f2b5069a0ee0cecae33de0455e3 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_pad_le b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_pad_le new file mode 100644 index 00000000..73a44f62 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_pad_le @@ -0,0 +1,17 @@ +abgr e8e5e350c856c051d502cd435a2aa0bd +argb a98e0a1213824ee4566d4891468bb614 +bgr24 ac7417cea8d6e799a31a3c9a39b8f202 +bgra 6113a09a023cb2b08e9cad78eb1eb37a +rgb24 65eed443acc66c4f02bab6df4ebed515 +rgba 74d4158ad0c626e9a7c6923b9ca73294 +yuv410p a5210eb6a9b10c3269899b935df9a2d6 +yuv411p a23380c9698e2d80c9fa8a8b6d4f6854 +yuv420p f8733600369adaea28aa445dbdf2ed4c +yuv422p 3e0d822c11c716e7636387b1bf27c5ff +yuv440p 225dd7fbc8cceb24c26b765187d43a9e +yuv444p 45484f0411d336ce94636da0395f4692 +yuva420p 919722724765dc3a716c38fa53b20580 +yuvj420p 4f20e2799966c21a9d9e0788b0956925 +yuvj422p e4d84b0683f77a76f1c17d976eff127c +yuvj440p 9ccc1f03d8d9a00dc4a5888bd77093ad +yuvj444p 7d202babcedf836e9ae9776163ee9425 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_scale_le b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_scale_le new file mode 100644 index 00000000..3ecfed71 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_scale_le @@ -0,0 +1,42 @@ +abgr d894cb97f6c80eb21bdbe8a4eea62d86 +argb 54346f2b2eef10919e0f247241df3b24 +bgr24 570f8d6b51a838aed022ef67535f6bdc +bgr4_byte ee1d35a7baf8e9016891929a2f565c0b +bgr555le 36b745067197f9ca8c1731cac51329c9 +bgr565le 3a514a298c6161a071ddf9963c06509d +bgr8 7f007fa6c153a16e808a9c51605a4016 +bgra a5e7040f9a80cccd65e5acf2ca09ace5 +gray d7786a7d9d99ac74230cc045cab5632c +gray16be af39ce3a497f6734b157c8b94544f537 +gray16le 7ac1b788bcc472010df7a97e762485e0 +monob 88c4c050758e64d120f50c7eff694381 +monow d31772ebaa877fc2a78565937f7f9673 +nv12 4676d59db43d657dc12841f6bc3ab452 +nv21 69c699510ff1fb777b118ebee1002f14 +rgb24 514692e28e8ff6860e415ce4fcf6eb8c +rgb48be 1894cd30dabcd3180518e4d5f09f25e7 +rgb48le 1354e6e27ce3c1d4d4989ee56030c94b +rgb4_byte d81ffd3add95842a618eec81024f0b5c +rgb555le a350ef1dc2c9688ed49e7ba018843795 +rgb565le 6f4bb711238baa762d73305213f8d035 +rgb8 091d0170b354ef0e97312b95feb5483f +rgba a3d362f222098a00e63867f612018659 +uyvy422 314bd486277111a95d9369b944fa0400 +yuv410p 7df8f6d69b56a8dcb6c7ee908e5018b5 +yuv411p 1143e7c5cc28fe0922b051b17733bc4c +yuv420p fdad2d8df8985e3d17e73c71f713cb14 +yuv420p16be 29a0265764530070f5cd3251cc01f66a +yuv420p16le 6f3a265b084a78baec229238d9f7945f +yuv422p 918e37701ee7377d16a8a6c119c56a40 +yuv422p16be ef3e865fc1d0c68977c735323c50af6e +yuv422p16le 428a9b96214c09cb5a983ce36d6961ff +yuv440p 461503fdb9b90451020aa3b25ddf041c +yuv444p 81b2eba962d12e8d64f003ac56f6faf2 +yuv444p16be 99a3738c70c8fbdc5a0e4ad4bf50648d +yuv444p16le 385d0cc5240d62da0871915be5d86f0a +yuva420p 8673a9131fb47de69788863f93a50eb7 +yuvj420p 30427bd6caf5bda93a173dbebe759e09 +yuvj422p fc8288f64fd149573f73cf8da05d8e6d +yuvj440p 26d0b4713a87ab9637a4062c22e6e70d +yuvj444p 894e6184d987a5ec4dc6f77bb75ef38c +yuyv422 169e19ac91b257bd84ace0fdf56559ad diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_vflip_le b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_vflip_le new file mode 100644 index 00000000..3b140a2c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/pixfmts_vflip_le @@ -0,0 +1,42 @@ +abgr 25e72e9dbd01ab00727c976d577f7be5 +argb 19869bf1a5ac0b6af4d8bbe2c104533c +bgr24 89108a4ba00201f79b75b9305c42352d +bgr4_byte 407fcf564ed764c38e1d748f700ab921 +bgr555le bd7b3ec4d684dfad075d89a606cb8b74 +bgr565le fdb617533e1e7ff512ea5b6b6233e738 +bgr8 c60f93fd152c6903391d1fe9decd3547 +bgra 7f9b799fb48544e49ce93e91d7f9fca8 +gray 30d9014a9d43b5f37e7aa64be3a3ecfc +gray16be 6b84b85d3326182fa1217e138249edc5 +gray16le 66bb8faa09dc149734aca3c768a6d4e1 +monob d0cf8732677a5360b6160133043590d8 +monow ff9869d067ecb94eb9d90c9750c31fea +nv12 046f00f598ce14d9854a3534a5c99114 +nv21 01ea369dd2d0d3ed7451dc5c8d61497f +rgb24 eaefabc168d0b14576bab45bc1e56e1e +rgb48be 4e0c384163ebab06a08e74637beb02bc +rgb48le a77bfeefcd96750cf0e1917a2e2bf1e7 +rgb4_byte 8c6ff02df0b06dd2d574836c3741b2a2 +rgb555le 4f8eaad29a17e0f8e9d8ab743e76b999 +rgb565le 73f247a3315dceaea3022ac7c197c5ef +rgb8 13a8d89ef78d8127297d899005456ff0 +rgba 1fc6e920a42ec812aaa3b2aa02f37987 +uyvy422 ffbd36720c77398d9a0d03ce2625928f +yuv410p 7bfb39d7afb49d6a6173e6b23ae321eb +yuv411p 4a90048cc3a65fac150e53289700efe1 +yuv420p 2e6d6062e8cad37fb3ab2c433b55f382 +yuv420p16be 539076782902664a8acf381bf4f713e8 +yuv420p16le 0f609e588e5a258644ef85170d70e030 +yuv422p d7f5cb44d9b0210d66d6a8762640ab34 +yuv422p16be 9bd8f8c961822b586fa4cf992be54acc +yuv422p16le 9c4a1239605c7952b736ac3130163f14 +yuv440p 876385e96165acf51271b20e5d85a416 +yuv444p 9c3c667d1613b72d15bc6d851c5eb8f7 +yuv444p16be 0f4afa4a4aacf4bb6b87641abde71ea9 +yuv444p16le 8f31557bc52adfe00ae8b40a9b8c23f8 +yuva420p c705d1cf061d8c6580ac690b55f92276 +yuvj420p 41fd02b204da0ab62452cd14b595e2e4 +yuvj422p 7f6ca9bc1812cde02036d7d29a7cce43 +yuvj440p 40591908cca457f51dee30a86c3e8ffd +yuvj444p 77e5e095881c52a04fd9f5abd1d7b5ac +yuyv422 e944ff7316cd03c42c091717ce74f602 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/scale200 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/scale200 new file mode 100644 index 00000000..17103a25 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/scale200 @@ -0,0 +1 @@ +scale200 aebdc1c3e08da2a925ba7212b1fadee0 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/scale500 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/scale500 new file mode 100644 index 00000000..93ba4f24 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/scale500 @@ -0,0 +1 @@ +scale500 ef865c51156e55ce1ce38c8f90a709e6 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/vflip b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/vflip new file mode 100644 index 00000000..66b87327 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/vflip @@ -0,0 +1 @@ +vflip 2e6d6062e8cad37fb3ab2c433b55f382 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/vflip_crop b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/vflip_crop new file mode 100644 index 00000000..6bb832f4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/vflip_crop @@ -0,0 +1 @@ +vflip_crop 72ee0d0dfc8af0cd94a466760313654d diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/vflip_vflip b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/vflip_vflip new file mode 100644 index 00000000..b719745d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/lavfi/vflip_vflip @@ -0,0 +1 @@ +vflip_vflip eba2f135a08829387e2f698ff72a2939 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/ac3_rm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/ac3_rm new file mode 100644 index 00000000..7b7d5b0b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/ac3_rm @@ -0,0 +1,35 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 +ret:-1 st:-1 flags:1 ts: 1.894167 +ret:-1 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 ts:-0.317000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret:-1 st:-1 flags:1 ts: 1.470835 +ret:-1 st: 0 flags:0 ts: 0.365000 +ret: 0 st: 0 flags:1 ts:-0.741000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret:-1 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:0 ts:-0.058000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 +ret:-1 st: 0 flags:1 ts: 2.836000 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret:-1 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 +ret:-1 st: 0 flags:1 ts: 2.413000 +ret:-1 st:-1 flags:0 ts: 1.306672 +ret:-1 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:0 ts:-0.905000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 +ret:-1 st: 0 flags:1 ts: 1.989000 +ret:-1 st:-1 flags:0 ts: 0.883340 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 +ret:-1 st: 0 flags:0 ts: 2.672000 +ret:-1 st: 0 flags:1 ts: 1.566000 +ret:-1 st:-1 flags:0 ts: 0.460008 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_ima_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_ima_wav new file mode 100644 index 00000000..b6517c54 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_ima_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.856009 pts: 1.856009 pos: 29756 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.831995 pts: 0.831995 pos: 13372 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.623991 pts: 2.623991 pos: 42044 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.408005 pts: 1.408005 pos: 22588 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.383991 pts: 0.383991 pos: 6204 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.176009 pts: 2.176009 pos: 34876 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.023991 pts: 1.023991 pos: 16444 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.816009 pts: 2.816009 pos: 45116 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.791995 pts: 1.791995 pos: 28732 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.576009 pts: 0.576009 pos: 9276 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.368005 pts: 2.368005 pos: 37948 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.343991 pts: 1.343991 pos: 21564 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.191995 pts: 0.191995 pos: 3132 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.983991 pts: 1.983991 pos: 31804 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.896009 pts: 0.896009 pos: 14396 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.688005 pts: 2.688005 pos: 43068 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.536009 pts: 1.536009 pos: 24636 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.511995 pts: 0.511995 pos: 8252 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 60 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_ms_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_ms_wav new file mode 100644 index 00000000..579be7f4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_ms_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.856009 pts: 1.856009 pos: 29786 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.831995 pts: 0.831995 pos: 13402 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.623991 pts: 2.623991 pos: 42074 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.408005 pts: 1.408005 pos: 22618 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.383991 pts: 0.383991 pos: 6234 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.176009 pts: 2.176009 pos: 34906 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.023991 pts: 1.023991 pos: 16474 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.816009 pts: 2.816009 pos: 45146 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.791995 pts: 1.791995 pos: 28762 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.576009 pts: 0.576009 pos: 9306 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.368005 pts: 2.368005 pos: 37978 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.343991 pts: 1.343991 pos: 21594 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.191995 pts: 0.191995 pos: 3162 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.983991 pts: 1.983991 pos: 31834 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.896009 pts: 0.896009 pos: 14426 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.688005 pts: 2.688005 pos: 43098 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.536009 pts: 1.536009 pos: 24666 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.511995 pts: 0.511995 pos: 8282 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 90 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_qt_aiff b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_qt_aiff new file mode 100644 index 00000000..b395fc98 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_qt_aiff @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894059 pts: 1.894059 pos: 88812 size: 68 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.789546 pts: 0.789546 pos: 37064 size: 68 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.577642 pts: 2.577642 pos: 120840 size: 68 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470249 pts: 1.470249 pos: 68956 size: 68 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365737 pts: 0.365737 pos: 17208 size: 68 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.153855 pts: 2.153855 pos: 100984 size: 68 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.046440 pts: 1.046440 pos: 49100 size: 68 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.834535 pts: 2.834535 pos: 132876 size: 68 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730045 pts: 1.730045 pos: 81128 size: 68 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624082 pts: 0.624082 pos: 29312 size: 68 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.412200 pts: 2.412200 pos: 113088 size: 68 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.307687 pts: 1.307687 pos: 61340 size: 68 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200295 pts: 0.200295 pos: 9456 size: 68 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.988390 pts: 1.988390 pos: 93232 size: 68 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883900 pts: 0.883900 pos: 41484 size: 68 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.671995 pts: 2.671995 pos: 125260 size: 68 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.564580 pts: 1.564580 pos: 73376 size: 68 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460091 pts: 0.460091 pos: 21628 size: 68 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 72 size: 68 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_swf_flv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_swf_flv new file mode 100644 index 00000000..2f909132 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_swf_flv @@ -0,0 +1,49 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 208 size: 2053 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 208 size: 2053 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.858000 pts: 1.858000 pos: 82968 size: 2053 +ret: 0 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 dts: 0.789000 pts: 0.789000 pos: 35381 size: 2053 +ret:-1 st: 0 flags:1 ts:-0.317000 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.601000 pts: 2.601000 pos: 116072 size: 2053 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 64347 size: 2053 +ret: 0 st: 0 flags:0 ts: 0.365000 +ret: 0 st: 0 flags:1 dts: 0.372000 pts: 0.372000 pos: 16760 size: 2053 +ret:-1 st: 0 flags:1 ts:-0.741000 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.183000 pts: 2.183000 pos: 97451 size: 2053 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.022000 pts: 1.022000 pos: 45726 size: 2053 +ret: 0 st: 0 flags:0 ts:-0.058000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 208 size: 2053 +ret: 0 st: 0 flags:1 ts: 2.836000 +ret: 0 st: 0 flags:1 dts: 2.833000 pts: 2.833000 pos: 126417 size: 2053 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.765000 pts: 1.765000 pos: 78830 size: 2053 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.604000 pts: 0.604000 pos: 27105 size: 2053 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 208 size: 2053 +ret: 0 st: 0 flags:1 ts: 2.413000 +ret: 0 st: 0 flags:1 dts: 2.368000 pts: 2.368000 pos: 105727 size: 2053 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.347000 pts: 1.347000 pos: 60209 size: 2053 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.186000 pts: 0.186000 pos: 8484 size: 2053 +ret: 0 st: 0 flags:0 ts:-0.905000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 208 size: 2053 +ret: 0 st: 0 flags:1 ts: 1.989000 +ret: 0 st: 0 flags:1 dts: 1.950000 pts: 1.950000 pos: 87106 size: 2053 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.929000 pts: 0.929000 pos: 41588 size: 2053 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:0 ts: 2.672000 +ret: 0 st: 0 flags:1 dts: 2.694000 pts: 2.694000 pos: 120210 size: 2053 +ret: 0 st: 0 flags:1 ts: 1.566000 +ret: 0 st: 0 flags:1 dts: 1.533000 pts: 1.533000 pos: 68485 size: 2053 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.464000 pts: 0.464000 pos: 20898 size: 2053 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_yam_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_yam_wav new file mode 100644 index 00000000..c3264701 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/adpcm_yam_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.856009 pts: 1.856009 pos: 29752 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.831995 pts: 0.831995 pos: 13368 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.623991 pts: 2.623991 pos: 42040 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.408005 pts: 1.408005 pos: 22584 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.383991 pts: 0.383991 pos: 6200 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.176009 pts: 2.176009 pos: 34872 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.023991 pts: 1.023991 pos: 16440 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.816009 pts: 2.816009 pos: 45112 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.791995 pts: 1.791995 pos: 28728 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.576009 pts: 0.576009 pos: 9272 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.368005 pts: 2.368005 pos: 37944 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.343991 pts: 1.343991 pos: 21560 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.191995 pts: 0.191995 pos: 3128 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.983991 pts: 1.983991 pos: 31800 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.896009 pts: 0.896009 pos: 14392 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.688005 pts: 2.688005 pos: 43064 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.536009 pts: 1.536009 pos: 24632 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.511995 pts: 0.511995 pos: 8248 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/alac_m4a b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/alac_m4a new file mode 100644 index 00000000..892cfb59 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/alac_m4a @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 40 size: 3240 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 40 size: 3240 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.857596 pts: 1.857596 pos: 73731 size: 4965 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.835918 pts: 0.835918 pos: 29072 size: 3198 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 40 size: 3240 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.600635 pts: 2.600635 pos: 137669 size: 12847 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.393197 pts: 1.393197 pos: 50219 size: 4418 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos: 12962 size: 3213 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 40 size: 3240 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.229116 pts: 2.229116 pos: 101031 size: 7900 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.021678 pts: 1.021678 pos: 35362 size: 3035 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 40 size: 3240 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.786395 pts: 2.786395 pos: 163300 size: 12769 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.764717 pts: 1.764717 pos: 68756 size: 4975 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.557279 pts: 0.557279 pos: 19365 size: 3238 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 40 size: 3240 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.321995 pts: 2.321995 pos: 108931 size: 7890 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.393197 pts: 1.393197 pos: 50219 size: 4418 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos: 6478 size: 3249 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 40 size: 3240 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.950476 pts: 1.950476 pos: 78696 size: 6518 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.928798 pts: 0.928798 pos: 32270 size: 3092 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 40 size: 3240 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.693515 pts: 2.693515 pos: 150516 size: 12784 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.486077 pts: 1.486077 pos: 54637 size: 4558 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.464399 pts: 0.464399 pos: 16175 size: 3190 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 40 size: 3240 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/asv1_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/asv1_avi new file mode 100644 index 00000000..eb6abc21 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/asv1_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 14316 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 14316 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 776852 size: 18256 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 305364 size: 16180 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 595460 size: 17980 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 135528 size: 14868 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 404112 size: 16856 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 14316 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 813408 size: 18296 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: 704148 size: 18140 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: 241776 size: 15736 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 14316 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 813408 size: 18296 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: 524500 size: 17548 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 77032 size: 14496 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 14316 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 813408 size: 18296 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 337820 size: 16388 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 631596 size: 18188 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 180224 size: 15168 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/asv2_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/asv2_avi new file mode 100644 index 00000000..f7b7f698 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/asv2_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 13732 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 13732 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 736164 size: 17340 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 289720 size: 15300 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 564152 size: 17016 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 128576 size: 14052 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 383256 size: 15896 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 13732 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 770864 size: 17400 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: 667028 size: 17172 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: 229400 size: 14956 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 13732 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 770864 size: 17400 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: 496944 size: 16564 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 73188 size: 13664 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5668 size: 13732 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 770864 size: 17400 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 320456 size: 15592 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 598300 size: 17180 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171024 size: 14392 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dnxhd_1080i_mov b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dnxhd_1080i_mov new file mode 100644 index 00000000..6c41d679 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dnxhd_1080i_mov @@ -0,0 +1,44 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size:606208 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size:606208 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208 +ret:-1 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 ts:-0.320000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size:606208 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208 +ret:-1 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 ts:-0.760000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size:606208 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size:606208 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size:606208 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208 +ret:-1 st:-1 flags:0 ts: 1.306672 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size:606208 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208 +ret:-1 st:-1 flags:0 ts: 0.883340 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size:606208 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208 +ret:-1 st:-1 flags:0 ts: 0.460008 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size:606208 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dnxhd_720p_dnxhd b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dnxhd_720p_dnxhd new file mode 100644 index 00000000..b57f07dd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dnxhd_720p_dnxhd @@ -0,0 +1,40 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:458752 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:458752 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret:-1 st: 0 flags:0 ts: 0.788334 +ret:-1 st: 0 flags:1 ts:-0.317499 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret:-1 st: 0 flags:0 ts: 0.365002 +ret:-1 st: 0 flags:1 ts:-0.740831 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret: 0 st: 0 flags:0 ts:-0.058330 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:458752 +ret: 0 st: 0 flags:1 ts: 2.835837 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret: 0 st: 0 flags:0 ts:-0.481662 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:458752 +ret: 0 st: 0 flags:1 ts: 2.412505 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret:-1 st:-1 flags:0 ts: 1.306672 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret: 0 st: 0 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:458752 +ret: 0 st: 0 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret:-1 st:-1 flags:0 ts: 0.883340 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671674 +ret: 0 st: 0 flags:1 ts: 1.565841 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret:-1 st:-1 flags:0 ts: 0.460008 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dnxhd_720p_rd_dnxhd b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dnxhd_720p_rd_dnxhd new file mode 100644 index 00000000..b57f07dd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dnxhd_720p_rd_dnxhd @@ -0,0 +1,40 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:458752 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:458752 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret:-1 st: 0 flags:0 ts: 0.788334 +ret:-1 st: 0 flags:1 ts:-0.317499 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret:-1 st: 0 flags:0 ts: 0.365002 +ret:-1 st: 0 flags:1 ts:-0.740831 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret: 0 st: 0 flags:0 ts:-0.058330 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:458752 +ret: 0 st: 0 flags:1 ts: 2.835837 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret: 0 st: 0 flags:0 ts:-0.481662 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:458752 +ret: 0 st: 0 flags:1 ts: 2.412505 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret:-1 st:-1 flags:0 ts: 1.306672 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret: 0 st: 0 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:458752 +ret: 0 st: 0 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret:-1 st:-1 flags:0 ts: 0.883340 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671674 +ret: 0 st: 0 flags:1 ts: 1.565841 +ret: 0 st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752 +ret:-1 st:-1 flags:0 ts: 0.460008 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dv411_dv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dv411_dv new file mode 100644 index 00000000..baaeefb2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dv411_dv @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts:-0.320000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts:-0.760000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dv50_dv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dv50_dv new file mode 100644 index 00000000..1f07e5b7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dv50_dv @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: -1 size:288000 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: -1 size:288000 +ret: 0 st: 0 flags:1 ts:-0.320000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:288000 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: -1 size:288000 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: -1 size:288000 +ret: 0 st: 0 flags:1 ts:-0.760000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:288000 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: -1 size:288000 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:288000 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: -1 size:288000 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: -1 size:288000 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:288000 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: -1 size:288000 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: -1 size:288000 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:288000 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: -1 size:288000 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000 +ret: 0 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:288000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: -1 size:288000 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: -1 size:288000 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:288000 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dv_dv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dv_dv new file mode 100644 index 00000000..baaeefb2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/dv_dv @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts:-0.320000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts:-0.760000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/error_mpeg4_adv_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/error_mpeg4_adv_avi new file mode 100644 index 00000000..3c6fa21e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/error_mpeg4_adv_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9564 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9564 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113142 size: 12795 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 71660 size: 11680 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113142 size: 12795 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 36782 size: 10310 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 71660 size: 11680 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9564 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 159370 size: 13895 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 159370 size: 13895 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 36782 size: 10310 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9564 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 159370 size: 13895 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113142 size: 12795 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9564 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9564 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 159370 size: 13895 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 71660 size: 11680 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113142 size: 12795 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 36782 size: 10310 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/ffv1_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/ffv1_avi new file mode 100644 index 00000000..04edb8dd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/ffv1_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 70200 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 70200 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2485810 size: 74128 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1622716 size: 71128 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2485810 size: 74128 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 796840 size: 67971 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1622716 size: 71128 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 70200 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3374440 size: 75606 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3374440 size: 75606 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 796840 size: 67971 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 70200 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3374440 size: 75606 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2485810 size: 74128 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 70200 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 70200 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3374440 size: 75606 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1622716 size: 71128 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2485810 size: 74128 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 796840 size: 67971 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/flac_flac b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/flac_flac new file mode 100644 index 00000000..ab31891f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/flac_flac @@ -0,0 +1,49 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 8256 size: 614 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 8256 size: 614 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos: 86742 size: 2191 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.809796 pts: 0.809796 pos: 27366 size: 615 +ret:-1 st: 0 flags:1 ts:-0.317506 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.586122 pts: 2.586122 pos: 145606 size: 2384 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos: 53388 size: 1851 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365714 pts: 0.365714 pos: 16890 size: 614 +ret:-1 st: 0 flags:1 ts:-0.740839 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.168163 pts: 2.168163 pos: 110531 size: 2143 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos: 32880 size: 579 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 8256 size: 614 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.821224 pts: 2.821224 pos: 167112 size: 2391 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.750204 pts: 1.750204 pos: 75788 size: 2191 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.600816 pts: 0.600816 pos: 22446 size: 616 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 8256 size: 614 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.403265 pts: 2.403265 pos: 129793 size: 2138 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.332245 pts: 1.332245 pos: 44812 size: 1609 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.182857 pts: 0.182857 pos: 12572 size: 628 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 8256 size: 614 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.985306 pts: 1.985306 pos: 95508 size: 2169 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.888163 pts: 0.888163 pos: 29211 size: 620 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.690612 pts: 2.690612 pos: 155154 size: 2394 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.541224 pts: 1.541224 pos: 59082 size: 1974 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.470204 pts: 0.470204 pos: 19353 size: 608 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/flashsv_flv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/flashsv_flv new file mode 100644 index 00000000..8bfb2fc6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/flashsv_flv @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size:240757 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size:240757 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:11605762 size:254053 +ret: 0 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:4820517 size:245503 +ret:-1 st: 0 flags:1 ts:-0.317000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:8811911 size:253041 +ret: 0 st: 0 flags:0 ts: 0.365000 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: 0.400000 pos:2387452 size:241101 +ret:-1 st: 0 flags:1 ts:-0.741000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:6302834 size:248927 +ret: 0 st: 0 flags:0 ts:-0.058000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size:240757 +ret: 0 st: 0 flags:1 ts: 2.836000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:12114712 size:254237 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.760000 pts: 1.760000 pos:10843576 size:253913 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.600000 pts: 0.600000 pos:3598805 size:243372 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size:240757 +ret: 0 st: 0 flags:1 ts: 2.413000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:12114712 size:254237 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:8053716 size:252195 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:1187821 size:238567 +ret: 0 st: 0 flags:0 ts:-0.905000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size:240757 +ret: 0 st: 0 flags:1 ts: 1.989000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:12114712 size:254237 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.920000 pts: 0.920000 pos:5559238 size:247341 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.672000 +ret: 0 st: 0 flags:1 ts: 1.566000 +ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:9572247 size:254219 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:2870253 size:242377 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/flv_flv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/flv_flv new file mode 100644 index 00000000..6952a4e3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/flv_flv @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 10380 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 10380 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83240 size: 12295 +ret: 0 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 52585 size: 11127 +ret:-1 st: 0 flags:1 ts:-0.317000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83240 size: 12295 +ret: 0 st: 0 flags:0 ts: 0.365000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 25960 size: 10089 +ret:-1 st: 0 flags:1 ts:-0.741000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 52585 size: 11127 +ret: 0 st: 0 flags:0 ts:-0.058000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 10380 +ret: 0 st: 0 flags:1 ts: 2.836000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 117158 size: 12730 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 117158 size: 12730 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 25960 size: 10089 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 10380 +ret: 0 st: 0 flags:1 ts: 2.413000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 117158 size: 12730 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83240 size: 12295 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 10380 +ret: 0 st: 0 flags:0 ts:-0.905000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 10380 +ret: 0 st: 0 flags:1 ts: 1.989000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 117158 size: 12730 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 52585 size: 11127 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.672000 +ret: 0 st: 0 flags:1 ts: 1.566000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83240 size: 12295 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 25960 size: 10089 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/g726_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/g726_wav new file mode 100644 index 00000000..b84c87c5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/g726_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894000 pts: 1.894000 pos: 7632 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788375 +ret: 0 st: 0 flags:1 dts: 0.788500 pts: 0.788500 pos: 3210 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317500 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.576750 pts: 2.576750 pos: 10363 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470750 pts: 1.470750 pos: 5939 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365000 +ret: 0 st: 0 flags:1 dts: 0.365000 pts: 0.365000 pos: 1516 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740875 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.153500 pts: 2.153500 pos: 8670 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047500 pts: 1.047500 pos: 4246 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058375 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835875 +ret: 0 st: 0 flags:1 dts: 2.835750 pts: 2.835750 pos: 11399 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 6976 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624000 pts: 0.624000 pos: 2552 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481625 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412500 +ret: 0 st: 0 flags:1 dts: 2.412500 pts: 2.412500 pos: 9706 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306750 pts: 1.306750 pos: 5283 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200750 pts: 0.200750 pos: 859 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.905000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989125 +ret: 0 st: 0 flags:1 dts: 1.989000 pts: 1.989000 pos: 8012 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883500 pts: 0.883500 pos: 3590 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671625 +ret: 0 st: 0 flags:1 dts: 2.671750 pts: 2.671750 pos: 10743 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.565875 +ret: 0 st: 0 flags:1 dts: 1.565750 pts: 1.565750 pos: 6319 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 1896 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/h261_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/h261_avi new file mode 100644 index 00000000..d31364f2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/h261_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9645 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9645 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126514 size: 11377 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 82072 size: 10322 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126514 size: 11377 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 44678 size: 9404 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 82072 size: 10322 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9645 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 175882 size: 11707 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 175882 size: 11707 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 44678 size: 9404 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9645 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 175882 size: 11707 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126514 size: 11377 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9645 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9645 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 175882 size: 11707 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 82072 size: 10322 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126514 size: 11377 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 44678 size: 9404 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/h263_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/h263_avi new file mode 100644 index 00000000..8b1795c2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/h263_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10381 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10381 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103714 size: 12296 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 66804 size: 11128 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103714 size: 12296 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 36450 size: 10090 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 66804 size: 11128 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10381 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 144558 size: 12731 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 144558 size: 12731 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 36450 size: 10090 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10381 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 144558 size: 12731 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103714 size: 12296 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10381 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10381 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 144558 size: 12731 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 66804 size: 11128 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103714 size: 12296 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 36450 size: 10090 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/h263p_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/h263p_avi new file mode 100644 index 00000000..51e6952e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/h263p_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 36208 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 36208 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569938 size: 45151 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 355988 size: 40907 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569938 size: 45151 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171054 size: 36515 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 355988 size: 40907 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 36208 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 804378 size: 46411 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 804378 size: 46411 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171054 size: 36515 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 36208 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 804378 size: 46411 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569938 size: 45151 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 36208 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 36208 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 804378 size: 46411 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 355988 size: 40907 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569938 size: 45151 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171054 size: 36515 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/huffyuv_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/huffyuv_avi new file mode 100644 index 00000000..8e3cbc1d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/huffyuv_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5736 size:129760 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5736 size:129760 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:6069184 size:128520 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:2579624 size:129192 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:4778240 size:129424 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:1160260 size:128504 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:3355296 size:129424 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5736 size:129760 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:6326136 size:128288 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:5554008 size:129016 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:2062504 size:129204 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5736 size:129760 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:6326136 size:128288 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:4260872 size:129280 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 646920 size:128204 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5736 size:129760 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:6326136 size:128288 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:2838080 size:129268 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:5037036 size:129284 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1546184 size:128860 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_bmp b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_bmp new file mode 100644 index 00000000..d60729b2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_bmp @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:304182 +ret:-EINVAL st:-1 flags:0 ts:-1.000000 +ret:-EINVAL st:-1 flags:1 ts: 1.894167 +ret:-EINVAL st: 0 flags:0 ts: 0.800000 +ret:-EINVAL st: 0 flags:1 ts:-0.320000 +ret:-EINVAL st:-1 flags:0 ts: 2.576668 +ret:-EINVAL st:-1 flags:1 ts: 1.470835 +ret:-EINVAL st: 0 flags:0 ts: 0.360000 +ret:-EINVAL st: 0 flags:1 ts:-0.760000 +ret:-EINVAL st:-1 flags:0 ts: 2.153336 +ret:-EINVAL st:-1 flags:1 ts: 1.047503 +ret:-EINVAL st: 0 flags:0 ts:-0.040000 +ret:-EINVAL st: 0 flags:1 ts: 2.840000 +ret:-EINVAL st:-1 flags:0 ts: 1.730004 +ret:-EINVAL st:-1 flags:1 ts: 0.624171 +ret:-EINVAL st: 0 flags:0 ts:-0.480000 +ret:-EINVAL st: 0 flags:1 ts: 2.400000 +ret:-EINVAL st:-1 flags:0 ts: 1.306672 +ret:-EINVAL st:-1 flags:1 ts: 0.200839 +ret:-EINVAL st: 0 flags:0 ts:-0.920000 +ret:-EINVAL st: 0 flags:1 ts: 2.000000 +ret:-EINVAL st:-1 flags:0 ts: 0.883340 +ret:-EINVAL st:-1 flags:1 ts:-0.222493 +ret:-EINVAL st: 0 flags:0 ts: 2.680000 +ret:-EINVAL st: 0 flags:1 ts: 1.560000 +ret:-EINVAL st:-1 flags:0 ts: 0.460008 +ret:-EINVAL st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_jpg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_jpg new file mode 100644 index 00000000..88964cad --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_jpg @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size: 28070 +ret:-EINVAL st:-1 flags:0 ts:-1.000000 +ret:-EINVAL st:-1 flags:1 ts: 1.894167 +ret:-EINVAL st: 0 flags:0 ts: 0.800000 +ret:-EINVAL st: 0 flags:1 ts:-0.320000 +ret:-EINVAL st:-1 flags:0 ts: 2.576668 +ret:-EINVAL st:-1 flags:1 ts: 1.470835 +ret:-EINVAL st: 0 flags:0 ts: 0.360000 +ret:-EINVAL st: 0 flags:1 ts:-0.760000 +ret:-EINVAL st:-1 flags:0 ts: 2.153336 +ret:-EINVAL st:-1 flags:1 ts: 1.047503 +ret:-EINVAL st: 0 flags:0 ts:-0.040000 +ret:-EINVAL st: 0 flags:1 ts: 2.840000 +ret:-EINVAL st:-1 flags:0 ts: 1.730004 +ret:-EINVAL st:-1 flags:1 ts: 0.624171 +ret:-EINVAL st: 0 flags:0 ts:-0.480000 +ret:-EINVAL st: 0 flags:1 ts: 2.400000 +ret:-EINVAL st:-1 flags:0 ts: 1.306672 +ret:-EINVAL st:-1 flags:1 ts: 0.200839 +ret:-EINVAL st: 0 flags:0 ts:-0.920000 +ret:-EINVAL st: 0 flags:1 ts: 2.000000 +ret:-EINVAL st:-1 flags:0 ts: 0.883340 +ret:-EINVAL st:-1 flags:1 ts:-0.222493 +ret:-EINVAL st: 0 flags:0 ts: 2.680000 +ret:-EINVAL st: 0 flags:1 ts: 1.560000 +ret:-EINVAL st:-1 flags:0 ts: 0.460008 +ret:-EINVAL st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_pcx b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_pcx new file mode 100644 index 00000000..418674f7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_pcx @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:364047 +ret:-EINVAL st:-1 flags:0 ts:-1.000000 +ret:-EINVAL st:-1 flags:1 ts: 1.894167 +ret:-EINVAL st: 0 flags:0 ts: 0.800000 +ret:-EINVAL st: 0 flags:1 ts:-0.320000 +ret:-EINVAL st:-1 flags:0 ts: 2.576668 +ret:-EINVAL st:-1 flags:1 ts: 1.470835 +ret:-EINVAL st: 0 flags:0 ts: 0.360000 +ret:-EINVAL st: 0 flags:1 ts:-0.760000 +ret:-EINVAL st:-1 flags:0 ts: 2.153336 +ret:-EINVAL st:-1 flags:1 ts: 1.047503 +ret:-EINVAL st: 0 flags:0 ts:-0.040000 +ret:-EINVAL st: 0 flags:1 ts: 2.840000 +ret:-EINVAL st:-1 flags:0 ts: 1.730004 +ret:-EINVAL st:-1 flags:1 ts: 0.624171 +ret:-EINVAL st: 0 flags:0 ts:-0.480000 +ret:-EINVAL st: 0 flags:1 ts: 2.400000 +ret:-EINVAL st:-1 flags:0 ts: 1.306672 +ret:-EINVAL st:-1 flags:1 ts: 0.200839 +ret:-EINVAL st: 0 flags:0 ts:-0.920000 +ret:-EINVAL st: 0 flags:1 ts: 2.000000 +ret:-EINVAL st:-1 flags:0 ts: 0.883340 +ret:-EINVAL st:-1 flags:1 ts:-0.222493 +ret:-EINVAL st: 0 flags:0 ts: 2.680000 +ret:-EINVAL st: 0 flags:1 ts: 1.560000 +ret:-EINVAL st:-1 flags:0 ts: 0.460008 +ret:-EINVAL st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_pgm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_pgm new file mode 100644 index 00000000..2836367b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_pgm @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:101391 +ret:-EINVAL st:-1 flags:0 ts:-1.000000 +ret:-EINVAL st:-1 flags:1 ts: 1.894167 +ret:-EINVAL st: 0 flags:0 ts: 0.800000 +ret:-EINVAL st: 0 flags:1 ts:-0.320000 +ret:-EINVAL st:-1 flags:0 ts: 2.576668 +ret:-EINVAL st:-1 flags:1 ts: 1.470835 +ret:-EINVAL st: 0 flags:0 ts: 0.360000 +ret:-EINVAL st: 0 flags:1 ts:-0.760000 +ret:-EINVAL st:-1 flags:0 ts: 2.153336 +ret:-EINVAL st:-1 flags:1 ts: 1.047503 +ret:-EINVAL st: 0 flags:0 ts:-0.040000 +ret:-EINVAL st: 0 flags:1 ts: 2.840000 +ret:-EINVAL st:-1 flags:0 ts: 1.730004 +ret:-EINVAL st:-1 flags:1 ts: 0.624171 +ret:-EINVAL st: 0 flags:0 ts:-0.480000 +ret:-EINVAL st: 0 flags:1 ts: 2.400000 +ret:-EINVAL st:-1 flags:0 ts: 1.306672 +ret:-EINVAL st:-1 flags:1 ts: 0.200839 +ret:-EINVAL st: 0 flags:0 ts:-0.920000 +ret:-EINVAL st: 0 flags:1 ts: 2.000000 +ret:-EINVAL st:-1 flags:0 ts: 0.883340 +ret:-EINVAL st:-1 flags:1 ts:-0.222493 +ret:-EINVAL st: 0 flags:0 ts: 2.680000 +ret:-EINVAL st: 0 flags:1 ts: 1.560000 +ret:-EINVAL st:-1 flags:0 ts: 0.460008 +ret:-EINVAL st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_ppm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_ppm new file mode 100644 index 00000000..6376b5ec --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_ppm @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:304143 +ret:-EINVAL st:-1 flags:0 ts:-1.000000 +ret:-EINVAL st:-1 flags:1 ts: 1.894167 +ret:-EINVAL st: 0 flags:0 ts: 0.800000 +ret:-EINVAL st: 0 flags:1 ts:-0.320000 +ret:-EINVAL st:-1 flags:0 ts: 2.576668 +ret:-EINVAL st:-1 flags:1 ts: 1.470835 +ret:-EINVAL st: 0 flags:0 ts: 0.360000 +ret:-EINVAL st: 0 flags:1 ts:-0.760000 +ret:-EINVAL st:-1 flags:0 ts: 2.153336 +ret:-EINVAL st:-1 flags:1 ts: 1.047503 +ret:-EINVAL st: 0 flags:0 ts:-0.040000 +ret:-EINVAL st: 0 flags:1 ts: 2.840000 +ret:-EINVAL st:-1 flags:0 ts: 1.730004 +ret:-EINVAL st:-1 flags:1 ts: 0.624171 +ret:-EINVAL st: 0 flags:0 ts:-0.480000 +ret:-EINVAL st: 0 flags:1 ts: 2.400000 +ret:-EINVAL st:-1 flags:0 ts: 1.306672 +ret:-EINVAL st:-1 flags:1 ts: 0.200839 +ret:-EINVAL st: 0 flags:0 ts:-0.920000 +ret:-EINVAL st: 0 flags:1 ts: 2.000000 +ret:-EINVAL st:-1 flags:0 ts: 0.883340 +ret:-EINVAL st:-1 flags:1 ts:-0.222493 +ret:-EINVAL st: 0 flags:0 ts: 2.680000 +ret:-EINVAL st: 0 flags:1 ts: 1.560000 +ret:-EINVAL st:-1 flags:0 ts: 0.460008 +ret:-EINVAL st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_sgi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_sgi new file mode 100644 index 00000000..b2f605ad --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_sgi @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:308336 +ret:-EINVAL st:-1 flags:0 ts:-1.000000 +ret:-EINVAL st:-1 flags:1 ts: 1.894167 +ret:-EINVAL st: 0 flags:0 ts: 0.800000 +ret:-EINVAL st: 0 flags:1 ts:-0.320000 +ret:-EINVAL st:-1 flags:0 ts: 2.576668 +ret:-EINVAL st:-1 flags:1 ts: 1.470835 +ret:-EINVAL st: 0 flags:0 ts: 0.360000 +ret:-EINVAL st: 0 flags:1 ts:-0.760000 +ret:-EINVAL st:-1 flags:0 ts: 2.153336 +ret:-EINVAL st:-1 flags:1 ts: 1.047503 +ret:-EINVAL st: 0 flags:0 ts:-0.040000 +ret:-EINVAL st: 0 flags:1 ts: 2.840000 +ret:-EINVAL st:-1 flags:0 ts: 1.730004 +ret:-EINVAL st:-1 flags:1 ts: 0.624171 +ret:-EINVAL st: 0 flags:0 ts:-0.480000 +ret:-EINVAL st: 0 flags:1 ts: 2.400000 +ret:-EINVAL st:-1 flags:0 ts: 1.306672 +ret:-EINVAL st:-1 flags:1 ts: 0.200839 +ret:-EINVAL st: 0 flags:0 ts:-0.920000 +ret:-EINVAL st: 0 flags:1 ts: 2.000000 +ret:-EINVAL st:-1 flags:0 ts: 0.883340 +ret:-EINVAL st:-1 flags:1 ts:-0.222493 +ret:-EINVAL st: 0 flags:0 ts: 2.680000 +ret:-EINVAL st: 0 flags:1 ts: 1.560000 +ret:-EINVAL st:-1 flags:0 ts: 0.460008 +ret:-EINVAL st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_tga b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_tga new file mode 100644 index 00000000..8f907536 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_tga @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:304172 +ret:-EINVAL st:-1 flags:0 ts:-1.000000 +ret:-EINVAL st:-1 flags:1 ts: 1.894167 +ret:-EINVAL st: 0 flags:0 ts: 0.800000 +ret:-EINVAL st: 0 flags:1 ts:-0.320000 +ret:-EINVAL st:-1 flags:0 ts: 2.576668 +ret:-EINVAL st:-1 flags:1 ts: 1.470835 +ret:-EINVAL st: 0 flags:0 ts: 0.360000 +ret:-EINVAL st: 0 flags:1 ts:-0.760000 +ret:-EINVAL st:-1 flags:0 ts: 2.153336 +ret:-EINVAL st:-1 flags:1 ts: 1.047503 +ret:-EINVAL st: 0 flags:0 ts:-0.040000 +ret:-EINVAL st: 0 flags:1 ts: 2.840000 +ret:-EINVAL st:-1 flags:0 ts: 1.730004 +ret:-EINVAL st:-1 flags:1 ts: 0.624171 +ret:-EINVAL st: 0 flags:0 ts:-0.480000 +ret:-EINVAL st: 0 flags:1 ts: 2.400000 +ret:-EINVAL st:-1 flags:0 ts: 1.306672 +ret:-EINVAL st:-1 flags:1 ts: 0.200839 +ret:-EINVAL st: 0 flags:0 ts:-0.920000 +ret:-EINVAL st: 0 flags:1 ts: 2.000000 +ret:-EINVAL st:-1 flags:0 ts: 0.883340 +ret:-EINVAL st:-1 flags:1 ts:-0.222493 +ret:-EINVAL st: 0 flags:0 ts: 2.680000 +ret:-EINVAL st: 0 flags:1 ts: 1.560000 +ret:-EINVAL st:-1 flags:0 ts: 0.460008 +ret:-EINVAL st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_tiff b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_tiff new file mode 100644 index 00000000..1b49f2f2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/image_tiff @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:307124 +ret:-EINVAL st:-1 flags:0 ts:-1.000000 +ret:-EINVAL st:-1 flags:1 ts: 1.894167 +ret:-EINVAL st: 0 flags:0 ts: 0.800000 +ret:-EINVAL st: 0 flags:1 ts:-0.320000 +ret:-EINVAL st:-1 flags:0 ts: 2.576668 +ret:-EINVAL st:-1 flags:1 ts: 1.470835 +ret:-EINVAL st: 0 flags:0 ts: 0.360000 +ret:-EINVAL st: 0 flags:1 ts:-0.760000 +ret:-EINVAL st:-1 flags:0 ts: 2.153336 +ret:-EINVAL st:-1 flags:1 ts: 1.047503 +ret:-EINVAL st: 0 flags:0 ts:-0.040000 +ret:-EINVAL st: 0 flags:1 ts: 2.840000 +ret:-EINVAL st:-1 flags:0 ts: 1.730004 +ret:-EINVAL st:-1 flags:1 ts: 0.624171 +ret:-EINVAL st: 0 flags:0 ts:-0.480000 +ret:-EINVAL st: 0 flags:1 ts: 2.400000 +ret:-EINVAL st:-1 flags:0 ts: 1.306672 +ret:-EINVAL st:-1 flags:1 ts: 0.200839 +ret:-EINVAL st: 0 flags:0 ts:-0.920000 +ret:-EINVAL st: 0 flags:1 ts: 2.000000 +ret:-EINVAL st:-1 flags:0 ts: 0.883340 +ret:-EINVAL st:-1 flags:1 ts:-0.222493 +ret:-EINVAL st: 0 flags:0 ts: 2.680000 +ret:-EINVAL st: 0 flags:1 ts: 1.560000 +ret:-EINVAL st:-1 flags:0 ts: 0.460008 +ret:-EINVAL st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/jpegls_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/jpegls_avi new file mode 100644 index 00000000..b95ec5a0 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/jpegls_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:164074 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:164074 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:7804130 size:176295 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:3172792 size:164643 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:6052986 size:174097 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:1402356 size:157283 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:4170260 size:168401 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:164074 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:8157028 size:176793 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:7101766 size:175326 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:2519272 size:162522 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:164074 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:8157028 size:176793 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:5360830 size:172183 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 779846 size:154579 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:164074 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:8157028 size:176793 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:3502840 size:166017 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:6401464 size:174815 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1876428 size:159659 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_aif b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_aif new file mode 100644 index 00000000..784b1448 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_aif @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret:-EOF +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 69586 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 1.470835 +ret:-EOF +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 32248 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 1.047503 +ret:-EOF +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 1.730004 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 55106 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 1.306672 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 17768 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 77964 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret:-EOF +ret: 0 st: 0 flags:1 ts: 1.565850 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 40626 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 54 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_al b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_al new file mode 100644 index 00000000..84661ece --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_al @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894150 pts: 1.894150 pos: 41766 size: 1024 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 17383 size: 1024 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 32432 size: 1024 +ret: 0 st: 0 flags:0 ts: 0.364989 +ret: 0 st: 0 flags:1 dts: 0.364989 pts: 0.364989 pos: 8048 size: 1024 +ret: 0 st: 0 flags:1 ts:-0.740816 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047483 pts: 1.047483 pos: 23097 size: 1024 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730023 pts: 1.730023 pos: 38147 size: 1024 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 13763 size: 1024 +ret: 0 st: 0 flags:0 ts:-0.481678 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st: 0 flags:1 ts: 2.412517 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 28812 size: 1024 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200816 pts: 0.200816 pos: 4428 size: 1024 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st: 0 flags:1 ts: 1.989161 +ret: 0 st: 0 flags:1 dts: 1.989161 pts: 1.989161 pos: 43861 size: 1024 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883356 pts: 0.883356 pos: 19478 size: 1024 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st: 0 flags:0 ts: 2.671655 +ret:-EOF +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 34527 size: 1024 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 10143 size: 1024 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_asf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_asf new file mode 100644 index 00000000..afaed99e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_asf @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 1 flags:1 dts: 3.544000 pts: 3.544000 pos: 147775 size: 209 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st: 0 flags:1 ts:-0.317000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st: 1 flags:0 ts: 2.577000 +ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208 +ret: 0 st: 1 flags:1 ts: 1.471000 +ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208 +ret: 0 st:-1 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st:-1 flags:1 ts:-0.740831 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st: 0 flags:0 ts: 2.153000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st: 0 flags:1 ts: 1.048000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st: 1 flags:0 ts:-0.058000 +ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208 +ret: 0 st: 1 flags:1 ts: 2.836000 +ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st: 0 flags:1 ts: 2.413000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st: 1 flags:0 ts: 1.307000 +ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208 +ret: 0 st: 1 flags:1 ts: 0.201000 +ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208 +ret: 0 st:-1 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st:-1 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st: 0 flags:0 ts: 0.883000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st: 0 flags:1 ts:-0.222000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st: 1 flags:0 ts: 2.672000 +ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208 +ret: 0 st: 1 flags:1 ts: 1.566000 +ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_au b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_au new file mode 100644 index 00000000..a2c57eb7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_au @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret:-EOF +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 69556 size: 2048 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 1.470835 +ret:-EOF +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 32218 size: 2048 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 1.047503 +ret:-EOF +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 1.730004 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 55076 size: 2048 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 1.306672 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 17738 size: 2048 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 77934 size: 2048 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret:-EOF +ret: 0 st: 0 flags:1 ts: 1.565850 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 40596 size: 2048 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 2048 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_avi new file mode 100644 index 00000000..964f0b8b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_avi @@ -0,0 +1,44 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 9908 size: 27867 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 9908 size: 27867 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301466 size: 27864 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301466 size: 27864 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st: 1 flags:0 ts: 2.586122 +ret: 0 st: 1 flags:1 ts: 1.462857 +ret: 0 st: 1 flags:1 dts: 1.018776 pts: 1.018776 pos: 329774 size: 209 +ret: 0 st:-1 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 156166 size: 27955 +ret:-1 st:-1 flags:1 ts:-0.740831 +ret:-1 st: 0 flags:0 ts: 2.160000 +ret: 0 st: 0 flags:1 ts: 1.040000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301466 size: 27864 +ret: 0 st: 1 flags:0 ts:-0.052245 +ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 37784 size: 208 +ret: 0 st: 1 flags:1 ts: 2.847347 +ret: 0 st: 1 flags:1 dts: 1.018776 pts: 1.018776 pos: 329774 size: 209 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 156166 size: 27955 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 9908 size: 27867 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301466 size: 27864 +ret:-1 st: 1 flags:0 ts: 1.306122 +ret: 0 st: 1 flags:1 ts: 0.208980 +ret: 0 st: 1 flags:1 dts: 0.208980 pts: 0.208980 pos: 92800 size: 209 +ret: 0 st:-1 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 9908 size: 27867 +ret: 0 st:-1 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301466 size: 27864 +ret: 0 st: 0 flags:0 ts: 0.880000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301466 size: 27864 +ret:-1 st: 0 flags:1 ts:-0.240000 +ret:-1 st: 1 flags:0 ts: 2.664490 +ret: 0 st: 1 flags:1 ts: 1.567347 +ret: 0 st: 1 flags:1 dts: 1.018776 pts: 1.018776 pos: 329774 size: 209 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 156166 size: 27955 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_dv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_dv new file mode 100644 index 00000000..3c49749a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_dv @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts:-0.320000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st: 1 flags:0 ts: 2.576667 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000 +ret: 0 st: 1 flags:1 ts: 1.470833 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts:-0.740831 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts: 2.160000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts: 1.040000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000 +ret: 0 st: 1 flags:0 ts:-0.058333 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st: 1 flags:1 ts: 2.835833 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000 +ret: 0 st: 1 flags:0 ts: 1.306667 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000 +ret: 0 st: 1 flags:1 ts: 0.200833 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000 +ret: 0 st: 0 flags:0 ts: 0.880000 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: -1 size:144000 +ret: 0 st: 0 flags:1 ts:-0.240000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 +ret: 0 st: 1 flags:0 ts: 2.671667 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000 +ret: 0 st: 1 flags:1 ts: 1.565833 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size:144000 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: -1 size:144000 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:144000 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_ffm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_ffm new file mode 100644 index 00000000..46cf764c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_ffm @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209 +ret: 0 st: 0 flags:0 ts: 0.788334 +ret: 0 st: 1 flags:1 dts: 0.783673 pts: 0.783673 pos: 315392 size: 209 +ret: 0 st: 0 flags:1 ts:-0.317499 +ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664 +ret: 0 st: 1 flags:0 ts: 2.576668 +ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209 +ret: 0 st: 1 flags:1 ts: 1.470835 +ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209 +ret: 0 st:-1 flags:0 ts: 0.365002 +ret: 0 st: 1 flags:1 dts: 0.339592 pts: 0.339592 pos: 155648 size: 209 +ret: 0 st:-1 flags:1 ts:-0.740831 +ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664 +ret: 0 st: 0 flags:0 ts: 2.153336 +ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209 +ret: 0 st: 0 flags:1 ts: 1.047503 +ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209 +ret: 0 st: 1 flags:0 ts:-0.058330 +ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664 +ret: 0 st: 1 flags:1 ts: 2.835837 +ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 1 flags:1 dts: 0.653061 pts: 0.653061 pos: 274432 size: 209 +ret: 0 st: 0 flags:0 ts:-0.481662 +ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664 +ret: 0 st: 0 flags:1 ts: 2.412505 +ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209 +ret: 0 st: 1 flags:0 ts: 1.306672 +ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209 +ret: 0 st: 1 flags:1 ts: 0.200839 +ret: 0 st: 1 flags:1 dts: 0.208980 pts: 0.208980 pos: 114688 size: 209 +ret: 0 st:-1 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664 +ret: 0 st:-1 flags:1 ts: 1.989173 +ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209 +ret: 0 st: 0 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:0 dts: 0.880000 pts: 0.920000 pos: 339968 size: 12307 +ret: 0 st: 0 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664 +ret: 0 st: 1 flags:0 ts: 2.671674 +ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209 +ret: 0 st: 1 flags:1 ts: 1.565841 +ret: 0 st: 1 flags:1 dts: 0.940408 pts: 0.940408 pos: 376832 size: 209 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 1 flags:1 dts: 0.444082 pts: 0.444082 pos: 204800 size: 209 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos: 8192 size: 24664 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_flv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_flv new file mode 100644 index 00000000..2e7a0bce --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_flv @@ -0,0 +1,44 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 31074 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 31074 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134 +ret: 0 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134 +ret:-1 st: 0 flags:1 ts:-0.317000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134 +ret: 0 st: 0 flags:0 ts: 0.365000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 149441 size: 31125 +ret:-1 st: 0 flags:1 ts:-0.741000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134 +ret: 0 st: 0 flags:0 ts:-0.058000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 31074 +ret: 0 st: 0 flags:1 ts: 2.836000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 149441 size: 31125 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 31074 +ret: 0 st: 0 flags:1 ts: 2.413000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134 +ret:-1 st:-1 flags:0 ts: 1.306672 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 31074 +ret: 0 st: 0 flags:0 ts:-0.905000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 199 size: 31074 +ret: 0 st: 0 flags:1 ts: 1.989000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.672000 +ret: 0 st: 0 flags:1 ts: 1.566000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 149441 size: 31125 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_gif b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_gif new file mode 100644 index 00000000..5da803da --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_gif @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:2906382 +ret:-EINVAL st:-1 flags:0 ts:-1.000000 +ret:-EINVAL st:-1 flags:1 ts: 1.894167 +ret:-EINVAL st: 0 flags:0 ts: 0.800000 +ret:-EINVAL st: 0 flags:1 ts:-0.320000 +ret:-EINVAL st:-1 flags:0 ts: 2.576668 +ret:-EINVAL st:-1 flags:1 ts: 1.470835 +ret:-EINVAL st: 0 flags:0 ts: 0.360000 +ret:-EINVAL st: 0 flags:1 ts:-0.760000 +ret:-EINVAL st:-1 flags:0 ts: 2.153336 +ret:-EINVAL st:-1 flags:1 ts: 1.047503 +ret:-EINVAL st: 0 flags:0 ts:-0.040000 +ret:-EINVAL st: 0 flags:1 ts: 2.840000 +ret:-EINVAL st:-1 flags:0 ts: 1.730004 +ret:-EINVAL st:-1 flags:1 ts: 0.624171 +ret:-EINVAL st: 0 flags:0 ts:-0.480000 +ret:-EINVAL st: 0 flags:1 ts: 2.400000 +ret:-EINVAL st:-1 flags:0 ts: 1.306672 +ret:-EINVAL st:-1 flags:1 ts: 0.200839 +ret:-EINVAL st: 0 flags:0 ts:-0.920000 +ret:-EINVAL st: 0 flags:1 ts: 2.000000 +ret:-EINVAL st:-1 flags:0 ts: 0.883340 +ret:-EINVAL st:-1 flags:1 ts:-0.222493 +ret:-EINVAL st: 0 flags:0 ts: 2.680000 +ret:-EINVAL st: 0 flags:1 ts: 1.560000 +ret:-EINVAL st:-1 flags:0 ts: 0.460008 +ret:-EINVAL st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_gxf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_gxf new file mode 100644 index 00000000..bc7ff3bc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_gxf @@ -0,0 +1,53 @@ +ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736 +ret: 0 st: 0 flags:0 ts: 0.780000 +ret: 0 st: 0 flags:0 dts: 0.800000 pts: NOPTS pos: 653328 size: 22148 +ret: 0 st: 0 flags:1 ts:-0.320000 +ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536 +ret: 0 st: 1 flags:0 ts: 2.580000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736 +ret: 0 st: 1 flags:1 ts: 1.480000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736 +ret: 0 st: 2 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:0 dts: 0.360000 pts: NOPTS pos: 302676 size: 25108 +ret: 0 st: 2 flags:1 ts:-0.740000 +ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736 +ret: 0 st: 0 flags:0 ts:-0.060000 +ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736 +ret: 0 st: 1 flags:0 ts: 1.740000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736 +ret: 0 st: 1 flags:1 ts: 0.620000 +ret: 0 st: 0 flags:0 dts: 0.640000 pts: NOPTS pos: 497156 size: 21596 +ret: 0 st: 2 flags:0 ts:-0.480000 +ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536 +ret: 0 st: 2 flags:1 ts: 2.420000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:0 dts: 0.200000 pts: NOPTS pos: 209504 size: 22968 +ret: 0 st: 0 flags:0 ts:-0.900000 +ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536 +ret: 0 st: 0 flags:1 ts: 1.980000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736 +ret: 0 st: 1 flags:0 ts: 0.880000 +ret: 0 st: 0 flags:0 dts: 0.880000 pts: NOPTS pos: 696044 size: 22484 +ret: 0 st: 1 flags:1 ts:-0.220000 +ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536 +ret: 0 st: 2 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736 +ret: 0 st: 2 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 741640 size: 54736 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 370660 size: 54628 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 5024 size: 65536 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mkv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mkv new file mode 100644 index 00000000..9f447b32 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mkv @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 513 size: 27837 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 513 size: 27837 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 291934 size: 27834 +ret: 0 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 291934 size: 27834 +ret: 0 st: 0 flags:1 ts:-0.317000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 513 size: 27837 +ret: 0 st: 1 flags:0 ts: 2.577000 +ret:-EOF +ret: 0 st: 1 flags:1 ts: 1.471000 +ret: 0 st: 1 flags:1 dts: 1.019000 pts: 1.019000 pos: 320207 size: 209 +ret: 0 st:-1 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146703 size: 27925 +ret: 0 st:-1 flags:1 ts:-0.740831 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 513 size: 27837 +ret: 0 st: 0 flags:0 ts: 2.153000 +ret:-EOF +ret: 0 st: 0 flags:1 ts: 1.048000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 291934 size: 27834 +ret: 0 st: 1 flags:0 ts:-0.058000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 513 size: 27837 +ret: 0 st: 1 flags:1 ts: 2.836000 +ret: 0 st: 1 flags:1 dts: 1.019000 pts: 1.019000 pos: 320207 size: 209 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146703 size: 27925 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 513 size: 27837 +ret: 0 st: 0 flags:1 ts: 2.413000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 291934 size: 27834 +ret: 0 st: 1 flags:0 ts: 1.307000 +ret:-EOF +ret: 0 st: 1 flags:1 ts: 0.201000 +ret: 0 st: 1 flags:1 dts: 0.183000 pts: 0.183000 pos: 72083 size: 209 +ret: 0 st:-1 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 513 size: 27837 +ret: 0 st:-1 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 291934 size: 27834 +ret: 0 st: 0 flags:0 ts: 0.883000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 291934 size: 27834 +ret: 0 st: 0 flags:1 ts:-0.222000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 513 size: 27837 +ret: 0 st: 1 flags:0 ts: 2.672000 +ret:-EOF +ret: 0 st: 1 flags:1 ts: 1.566000 +ret: 0 st: 1 flags:1 dts: 1.019000 pts: 1.019000 pos: 320207 size: 209 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146703 size: 27925 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 513 size: 27837 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mmf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mmf new file mode 100644 index 00000000..196d2632 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mmf @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size: 4096 +ret:-1 st:-1 flags:0 ts:-1.000000 +ret:-1 st:-1 flags:1 ts: 1.894167 +ret:-1 st: 0 flags:0 ts: 0.788345 +ret:-1 st: 0 flags:1 ts:-0.317506 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret:-1 st:-1 flags:1 ts: 1.470835 +ret:-1 st: 0 flags:0 ts: 0.365011 +ret:-1 st: 0 flags:1 ts:-0.740839 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret:-1 st:-1 flags:1 ts: 1.047503 +ret:-1 st: 0 flags:0 ts:-0.058322 +ret:-1 st: 0 flags:1 ts: 2.835828 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret:-1 st:-1 flags:1 ts: 0.624171 +ret:-1 st: 0 flags:0 ts:-0.481655 +ret:-1 st: 0 flags:1 ts: 2.412494 +ret:-1 st:-1 flags:0 ts: 1.306672 +ret:-1 st:-1 flags:1 ts: 0.200839 +ret:-1 st: 0 flags:0 ts:-0.904989 +ret:-1 st: 0 flags:1 ts: 1.989184 +ret:-1 st:-1 flags:0 ts: 0.883340 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671678 +ret:-1 st: 0 flags:1 ts: 1.565850 +ret:-1 st:-1 flags:0 ts: 0.460008 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mov b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mov new file mode 100644 index 00000000..0091915e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mov @@ -0,0 +1,48 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 325248 size: 1024 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834 +ret: 0 st: 0 flags:1 ts:-0.320000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837 +ret:-1 st: 1 flags:0 ts: 2.576667 +ret: 0 st: 1 flags:1 ts: 1.470839 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834 +ret: 0 st:-1 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 163526 size: 27925 +ret: 0 st:-1 flags:1 ts:-0.740831 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837 +ret:-1 st: 0 flags:0 ts: 2.160000 +ret: 0 st: 0 flags:1 ts: 1.040000 +ret: 0 st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 325248 size: 1024 +ret: 0 st: 1 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837 +ret: 0 st: 1 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 1 flags:1 dts: 0.464399 pts: 0.464399 pos: 162502 size: 1024 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 325248 size: 1024 +ret:-1 st: 1 flags:0 ts: 1.306667 +ret: 0 st: 1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837 +ret: 0 st:-1 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837 +ret: 0 st:-1 flags:1 ts: 1.989173 +ret: 0 st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 325248 size: 1024 +ret: 0 st: 0 flags:0 ts: 0.880000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834 +ret: 0 st: 0 flags:1 ts:-0.240000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837 +ret:-1 st: 1 flags:0 ts: 2.671678 +ret: 0 st: 1 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 163526 size: 27925 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 27837 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mpg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mpg new file mode 100644 index 00000000..dc511952 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mpg @@ -0,0 +1,53 @@ +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:0 dts: 1.880000 pts: 1.920000 pos: 327680 size: 12894 +ret: 0 st: 0 flags:0 ts: 0.788333 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st: 0 flags:1 ts:-0.317500 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st: 1 flags:0 ts: 2.576667 +ret: 0 st: 1 flags:1 dts: 2.018778 pts: 2.018778 pos: 370700 size: 235 +ret: 0 st: 1 flags:1 ts: 1.470833 +ret: 0 st: 1 flags:1 dts: 1.261222 pts: 1.261222 pos: 145408 size: 261 +ret: 0 st:-1 flags:0 ts: 0.365002 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st:-1 flags:1 ts:-0.740831 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st: 0 flags:0 ts: 2.153333 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.960000 pos: 339968 size: 681 +ret: 0 st: 0 flags:1 ts: 1.047500 +ret: 0 st: 0 flags:0 dts: 1.040000 pts: 1.080000 pos: 40960 size: 16073 +ret: 0 st: 1 flags:0 ts:-0.058333 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st: 1 flags:1 ts: 2.835833 +ret: 0 st: 1 flags:1 dts: 2.018778 pts: 2.018778 pos: 370700 size: 235 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:0 dts: 1.760000 pts: 1.800000 pos: 292864 size: 13170 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st: 0 flags:0 ts:-0.481667 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st: 0 flags:1 ts: 2.412500 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.960000 pos: 339968 size: 681 +ret: 0 st: 1 flags:0 ts: 1.306667 +ret: 0 st: 1 flags:1 dts: 1.522444 pts: 1.522444 pos: 342028 size: 314 +ret: 0 st: 1 flags:1 ts: 0.200844 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st:-1 flags:0 ts:-0.904994 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st:-1 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.960000 pos: 339968 size: 681 +ret: 0 st: 0 flags:0 ts: 0.883344 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st: 0 flags:1 ts:-0.222489 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st: 1 flags:0 ts: 2.671678 +ret: 0 st: 1 flags:1 dts: 2.018778 pts: 2.018778 pos: 370700 size: 235 +ret: 0 st: 1 flags:1 ts: 1.565844 +ret: 0 st: 1 flags:1 dts: 1.522444 pts: 1.522444 pos: 342028 size: 314 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 1 flags:1 dts: 1.000000 pts: 1.000000 pos: 2048 size: 208 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mxf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mxf new file mode 100644 index 00000000..4c1aecc6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mxf @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret:-1 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret:-1 +ret: 0 st: 0 flags:1 ts:-0.320000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801 +ret: 0 st: 1 flags:0 ts: 2.560000 +ret:-1 +ret: 0 st: 1 flags:1 ts: 1.480000 +ret:-1 +ret: 0 st:-1 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: NOPTS pos: 6144 size: 24801 +ret: 0 st:-1 flags:1 ts:-0.740831 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801 +ret: 0 st: 0 flags:0 ts: 2.160000 +ret:-1 +ret: 0 st: 0 flags:1 ts: 1.040000 +ret:-1 +ret: 0 st: 1 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801 +ret: 0 st: 1 flags:1 ts: 2.840000 +ret:-1 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret:-1 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret:-1 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret:-1 +ret: 0 st: 1 flags:0 ts: 1.320000 +ret:-1 +ret: 0 st: 1 flags:1 ts: 0.200000 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: NOPTS pos: 6144 size: 24801 +ret: 0 st:-1 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801 +ret: 0 st:-1 flags:1 ts: 1.989173 +ret:-1 +ret: 0 st: 0 flags:0 ts: 0.880000 +ret:-1 +ret: 0 st: 0 flags:1 ts:-0.240000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801 +ret: 0 st: 1 flags:0 ts: 2.680000 +ret:-1 +ret: 0 st: 1 flags:1 ts: 1.560000 +ret:-1 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 6144 size: 24801 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 6144 size: 24801 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mxf_d10 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mxf_d10 new file mode 100644 index 00000000..c05870f4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_mxf_d10 @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret:-1 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret:-1 +ret: 0 st: 0 flags:1 ts:-0.320000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000 +ret: 0 st: 1 flags:0 ts: 2.560000 +ret:-1 +ret: 0 st: 1 flags:1 ts: 1.480000 +ret:-1 +ret: 0 st:-1 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 6144 size:150000 +ret: 0 st:-1 flags:1 ts:-0.740831 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000 +ret: 0 st: 0 flags:0 ts: 2.160000 +ret:-1 +ret: 0 st: 0 flags:1 ts: 1.040000 +ret:-1 +ret: 0 st: 1 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000 +ret: 0 st: 1 flags:1 ts: 2.840000 +ret:-1 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret:-1 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret:-1 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret:-1 +ret: 0 st: 1 flags:0 ts: 1.320000 +ret:-1 +ret: 0 st: 1 flags:1 ts: 0.200000 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 6144 size:150000 +ret: 0 st:-1 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000 +ret: 0 st:-1 flags:1 ts: 1.989173 +ret:-1 +ret: 0 st: 0 flags:0 ts: 0.880000 +ret:-1 +ret: 0 st: 0 flags:1 ts:-0.240000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000 +ret: 0 st: 1 flags:0 ts: 2.680000 +ret:-1 +ret: 0 st: 1 flags:1 ts: 1.560000 +ret:-1 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 6144 size:150000 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 6144 size:150000 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_nut b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_nut new file mode 100644 index 00000000..fc3ef63f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_nut @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st: 0 flags:1 ts:-0.320000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837 +ret: 0 st: 1 flags:0 ts: 2.586122 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st: 1 flags:1 ts: 1.462857 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st:-1 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837 +ret: 0 st:-1 flags:1 ts:-0.740831 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837 +ret: 0 st: 0 flags:0 ts: 2.160000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st: 0 flags:1 ts: 1.040000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st: 1 flags:0 ts:-0.052245 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837 +ret: 0 st: 1 flags:1 ts: 2.847347 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st: 1 flags:0 ts: 1.306122 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st: 1 flags:1 ts: 0.208980 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837 +ret: 0 st:-1 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837 +ret: 0 st:-1 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st: 0 flags:0 ts: 0.880000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st: 0 flags:1 ts:-0.240000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837 +ret: 0 st: 1 flags:0 ts: 2.664490 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st: 1 flags:1 ts: 1.567347 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 279 size: 27837 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_ogg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_ogg new file mode 100644 index 00000000..c9be9c68 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_ogg @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 125 size: 1364 +ret:-1 st:-1 flags:0 ts:-1.000000 +ret:-1 st:-1 flags:1 ts: 1.894167 +ret:-1 st: 0 flags:0 ts: 0.788345 +ret:-1 st: 0 flags:1 ts:-0.317506 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret:-1 st:-1 flags:1 ts: 1.470835 +ret:-1 st: 0 flags:0 ts: 0.365011 +ret:-1 st: 0 flags:1 ts:-0.740839 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret:-1 st:-1 flags:1 ts: 1.047503 +ret:-1 st: 0 flags:0 ts:-0.058322 +ret:-1 st: 0 flags:1 ts: 2.835828 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret:-1 st:-1 flags:1 ts: 0.624171 +ret:-1 st: 0 flags:0 ts:-0.481655 +ret:-1 st: 0 flags:1 ts: 2.412494 +ret:-1 st:-1 flags:0 ts: 1.306672 +ret:-1 st:-1 flags:1 ts: 0.200839 +ret:-1 st: 0 flags:0 ts:-0.904989 +ret:-1 st: 0 flags:1 ts: 1.989184 +ret:-1 st:-1 flags:0 ts: 0.883340 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671678 +ret:-1 st: 0 flags:1 ts: 1.565850 +ret:-1 st:-1 flags:0 ts: 0.460008 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_rm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_rm new file mode 100644 index 00000000..188367bc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_rm @@ -0,0 +1,47 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143 +ret: 0 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143 +ret: 0 st: 0 flags:1 ts:-0.317000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082 +ret:-1 st: 1 flags:0 ts: 2.577000 +ret:-1 st: 1 flags:1 ts: 1.471000 +ret: 0 st:-1 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 158515 size: 31134 +ret: 0 st:-1 flags:1 ts:-0.740831 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082 +ret: 0 st: 0 flags:0 ts: 2.153000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143 +ret: 0 st: 0 flags:1 ts: 1.048000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143 +ret: 0 st: 1 flags:0 ts:-0.058000 +ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 31483 size: 278 +ret:-1 st: 1 flags:1 ts: 2.836000 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 158515 size: 31134 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082 +ret: 0 st: 0 flags:1 ts: 2.413000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143 +ret:-1 st: 1 flags:0 ts: 1.307000 +ret: 0 st: 1 flags:1 ts: 0.201000 +ret: 0 st: 1 flags:1 dts: 0.174000 pts: 0.174000 pos: 78969 size: 278 +ret: 0 st:-1 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082 +ret: 0 st:-1 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143 +ret: 0 st: 0 flags:0 ts: 0.883000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143 +ret: 0 st: 0 flags:1 ts:-0.222000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082 +ret:-1 st: 1 flags:0 ts: 2.672000 +ret:-1 st: 1 flags:1 ts: 1.566000 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 158515 size: 31134 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_swf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_swf new file mode 100644 index 00000000..52cd1e22 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_swf @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:0 dts: 0.000000 pts: 0.000000 pos: 55 size: 31074 +ret:-1 st:-1 flags:0 ts:-1.000000 +ret:-1 st:-1 flags:1 ts: 1.894167 +ret:-1 st: 0 flags:0 ts: 0.800000 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret:-1 st:-1 flags:1 ts: 1.470835 +ret:-1 st: 0 flags:0 ts: 0.360000 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret:-1 st:-1 flags:1 ts: 1.047503 +ret:-1 st: 0 flags:0 ts:-0.040000 +ret:-1 st: 0 flags:1 ts: 2.840000 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret:-1 st:-1 flags:1 ts: 0.624171 +ret:-1 st: 0 flags:0 ts:-0.480000 +ret:-1 st: 0 flags:1 ts: 2.400000 +ret:-1 st:-1 flags:0 ts: 1.306672 +ret:-1 st:-1 flags:1 ts: 0.200839 +ret:-1 st: 0 flags:0 ts:-0.920000 +ret:-1 st: 0 flags:1 ts: 2.000000 +ret:-1 st:-1 flags:0 ts: 0.883340 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret:-1 st: 0 flags:1 ts: 1.560000 +ret:-1 st:-1 flags:0 ts: 0.460008 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_ts b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_ts new file mode 100644 index 00000000..9ed59ef5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_ts @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 1.360000 pts: 1.400000 pos: 564 size: 24801 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:0 dts: 1.440000 pts: 1.480000 pos: 44932 size: 14502 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 1 flags:1 dts: 2.131433 pts: 2.131433 pos: 403636 size: 209 +ret: 0 st: 0 flags:0 ts: 0.788333 +ret: 0 st: 0 flags:0 dts: 1.520000 pts: 1.560000 pos: 74260 size: 13388 +ret: 0 st: 0 flags:1 ts:-0.317500 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: 1.400000 pos: 564 size: 24801 +ret: 0 st: 1 flags:0 ts: 2.576667 +ret: 0 st: 1 flags:1 dts: 2.131433 pts: 2.131433 pos: 403636 size: 209 +ret: 0 st: 1 flags:1 ts: 1.470833 +ret: 0 st: 0 flags:0 dts: 2.160000 pts: 2.200000 pos: 325240 size: 12679 +ret: 0 st:-1 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:0 dts: 1.440000 pts: 1.480000 pos: 44932 size: 14502 +ret: 0 st:-1 flags:1 ts:-0.740831 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: 1.400000 pos: 564 size: 24801 +ret: 0 st: 0 flags:0 ts: 2.153333 +ret: 0 st: 1 flags:1 dts: 2.131433 pts: 2.131433 pos: 403636 size: 209 +ret: 0 st: 0 flags:1 ts: 1.047500 +ret: 0 st: 0 flags:0 dts: 1.680000 pts: 1.720000 pos: 130096 size: 14133 +ret: 0 st: 1 flags:0 ts:-0.058333 +ret: 0 st: 0 flags:0 dts: 1.440000 pts: 1.480000 pos: 44932 size: 14502 +ret: 0 st: 1 flags:1 ts: 2.835833 +ret: 0 st: 1 flags:1 dts: 2.131433 pts: 2.131433 pos: 403636 size: 209 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 1 flags:1 dts: 2.131433 pts: 2.131433 pos: 403636 size: 209 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: 1.400000 pos: 564 size: 24801 +ret: 0 st: 0 flags:0 ts:-0.481667 +ret: 0 st: 0 flags:0 dts: 1.440000 pts: 1.480000 pos: 44932 size: 14502 +ret: 0 st: 0 flags:1 ts: 2.412500 +ret: 0 st: 1 flags:1 dts: 2.131433 pts: 2.131433 pos: 403636 size: 209 +ret: 0 st: 1 flags:0 ts: 1.306667 +ret: 0 st: 0 flags:0 dts: 2.080000 pts: 2.120000 pos: 294032 size: 13839 +ret: 0 st: 1 flags:1 ts: 0.200844 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: 1.400000 pos: 564 size: 24801 +ret: 0 st:-1 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:0 dts: 1.440000 pts: 1.480000 pos: 44932 size: 14502 +ret: 0 st:-1 flags:1 ts: 1.989173 +ret: 0 st: 1 flags:1 dts: 2.131433 pts: 2.131433 pos: 403636 size: 209 +ret: 0 st: 0 flags:0 ts: 0.883344 +ret: 0 st: 0 flags:0 dts: 1.600000 pts: 1.640000 pos: 102836 size: 12781 +ret: 0 st: 0 flags:1 ts:-0.222489 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: 1.400000 pos: 564 size: 24801 +ret: 0 st: 1 flags:0 ts: 2.671678 +ret: 0 st: 1 flags:1 dts: 2.131433 pts: 2.131433 pos: 403636 size: 209 +ret: 0 st: 1 flags:1 ts: 1.565844 +ret: 0 st: 0 flags:0 dts: 2.240000 pts: 2.280000 pos: 350996 size: 11307 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:0 dts: 1.440000 pts: 1.480000 pos: 44932 size: 14502 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: 1.400000 pos: 564 size: 24801 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_ul b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_ul new file mode 100644 index 00000000..84661ece --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_ul @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894150 pts: 1.894150 pos: 41766 size: 1024 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 17383 size: 1024 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 32432 size: 1024 +ret: 0 st: 0 flags:0 ts: 0.364989 +ret: 0 st: 0 flags:1 dts: 0.364989 pts: 0.364989 pos: 8048 size: 1024 +ret: 0 st: 0 flags:1 ts:-0.740816 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047483 pts: 1.047483 pos: 23097 size: 1024 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730023 pts: 1.730023 pos: 38147 size: 1024 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 13763 size: 1024 +ret: 0 st: 0 flags:0 ts:-0.481678 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st: 0 flags:1 ts: 2.412517 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 28812 size: 1024 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200816 pts: 0.200816 pos: 4428 size: 1024 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st: 0 flags:1 ts: 1.989161 +ret: 0 st: 0 flags:1 dts: 1.989161 pts: 1.989161 pos: 43861 size: 1024 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883356 pts: 0.883356 pos: 19478 size: 1024 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 +ret: 0 st: 0 flags:0 ts: 2.671655 +ret:-EOF +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 34527 size: 1024 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 10143 size: 1024 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 1024 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_voc b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_voc new file mode 100644 index 00000000..5670d1a9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_voc @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 32 size: 1024 +ret:-1 st:-1 flags:0 ts:-1.000000 +ret:-1 st:-1 flags:1 ts: 1.894167 +ret:-1 st: 0 flags:0 ts: 0.788333 +ret:-1 st: 0 flags:1 ts:-0.317500 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret:-1 st:-1 flags:1 ts: 1.470835 +ret:-1 st: 0 flags:0 ts: 0.365000 +ret:-1 st: 0 flags:1 ts:-0.740833 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret:-1 st:-1 flags:1 ts: 1.047503 +ret:-1 st: 0 flags:0 ts:-0.058333 +ret:-1 st: 0 flags:1 ts: 2.835833 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret:-1 st:-1 flags:1 ts: 0.624171 +ret:-1 st: 0 flags:0 ts:-0.481667 +ret:-1 st: 0 flags:1 ts: 2.412500 +ret:-1 st:-1 flags:0 ts: 1.306672 +ret:-1 st:-1 flags:1 ts: 0.200839 +ret:-1 st: 0 flags:0 ts:-0.904989 +ret:-1 st: 0 flags:1 ts: 1.989178 +ret:-1 st:-1 flags:0 ts: 0.883340 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671678 +ret:-1 st: 0 flags:1 ts: 1.565844 +ret:-1 st:-1 flags:0 ts: 0.460008 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_wav new file mode 100644 index 00000000..b411c3c7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret:-EOF +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 69576 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 1.470835 +ret:-EOF +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 32238 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 1.047503 +ret:-EOF +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 1.730004 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 55096 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 1.306672 +ret:-EOF +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 17758 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 77954 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret:-EOF +ret: 0 st: 0 flags:1 ts: 1.565850 +ret:-EOF +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 40616 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_y4m b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_y4m new file mode 100644 index 00000000..81c1de9a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/lavf_y4m @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 64 size:152064 +ret:-1 st:-1 flags:0 ts:-1.000000 +ret:-1 st:-1 flags:1 ts: 1.894167 +ret:-1 st: 0 flags:0 ts: 0.800000 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret:-1 st:-1 flags:1 ts: 1.470835 +ret:-1 st: 0 flags:0 ts: 0.360000 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret:-1 st:-1 flags:1 ts: 1.047503 +ret:-1 st: 0 flags:0 ts:-0.040000 +ret:-1 st: 0 flags:1 ts: 2.840000 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret:-1 st:-1 flags:1 ts: 0.624171 +ret:-1 st: 0 flags:0 ts:-0.480000 +ret:-1 st: 0 flags:1 ts: 2.400000 +ret:-1 st:-1 flags:0 ts: 1.306672 +ret:-1 st:-1 flags:1 ts: 0.200839 +ret:-1 st: 0 flags:0 ts:-0.920000 +ret:-1 st: 0 flags:1 ts: 2.000000 +ret:-1 st:-1 flags:0 ts: 0.883340 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret:-1 st: 0 flags:1 ts: 1.560000 +ret:-1 st:-1 flags:0 ts: 0.460008 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/ljpeg_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/ljpeg_avi new file mode 100644 index 00000000..76442fe5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/ljpeg_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 96069 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 96069 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:4481876 size: 94870 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:1902330 size: 95465 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:3527736 size: 95724 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 854956 size: 94635 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:2475578 size: 95649 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 96069 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:4671510 size: 94595 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:4101350 size: 95353 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:1520296 size: 95410 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 96069 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:4671510 size: 94595 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:3145126 size: 95587 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 477238 size: 94261 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 96069 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:4671510 size: 94595 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:2093314 size: 95528 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:3719138 size: 95615 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1139250 size: 95032 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mjpeg_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mjpeg_avi new file mode 100644 index 00000000..b0f975b7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mjpeg_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 12096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 12096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 627866 size: 14811 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 247500 size: 12959 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 480770 size: 14528 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 111012 size: 11927 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 326684 size: 13489 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 12096 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 657534 size: 14881 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: 568664 size: 14746 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: 196428 size: 12719 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 12096 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 657534 size: 14881 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: 423494 size: 14119 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 63872 size: 11714 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 12096 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 657534 size: 14881 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 273520 size: 13131 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 509938 size: 14597 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146970 size: 12168 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mp2_mp2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mp2_mp2 new file mode 100644 index 00000000..6166cb38 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mp2_mp2 @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.026122 pts: 0.026122 pos: 417 size: 418 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos: 30093 size: 418 +ret: 0 st: 0 flags:0 ts: 0.788334 +ret: 0 st: 0 flags:1 dts: 0.809796 pts: 0.809796 pos: 12956 size: 418 +ret: 0 st: 0 flags:1 ts:-0.317499 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.586122 pts: 2.586122 pos: 41377 size: 418 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos: 23405 size: 418 +ret: 0 st: 0 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.365714 pts: 0.365714 pos: 5851 size: 418 +ret: 0 st: 0 flags:1 ts:-0.740831 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.168163 pts: 2.168163 pos: 34690 size: 418 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos: 16718 size: 418 +ret: 0 st: 0 flags:0 ts:-0.058330 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417 +ret: 0 st: 0 flags:1 ts: 2.835837 +ret: 0 st: 0 flags:1 dts: 2.821224 pts: 2.821224 pos: 45139 size: 418 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.750204 pts: 1.750204 pos: 28003 size: 418 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.600816 pts: 0.600816 pos: 9613 size: 418 +ret: 0 st: 0 flags:0 ts:-0.481662 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417 +ret: 0 st: 0 flags:1 ts: 2.412505 +ret: 0 st: 0 flags:1 dts: 2.403265 pts: 2.403265 pos: 38452 size: 418 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.332245 pts: 1.332245 pos: 21315 size: 418 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.182857 pts: 0.182857 pos: 2925 size: 418 +ret: 0 st: 0 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417 +ret: 0 st: 0 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 1.985306 pts: 1.985306 pos: 31764 size: 418 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.888163 pts: 0.888163 pos: 14210 size: 418 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417 +ret: 0 st: 0 flags:0 ts: 2.671674 +ret: 0 st: 0 flags:1 dts: 2.690612 pts: 2.690612 pos: 43049 size: 418 +ret: 0 st: 0 flags:1 ts: 1.565841 +ret: 0 st: 0 flags:1 dts: 1.541224 pts: 1.541224 pos: 24659 size: 418 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.470204 pts: 0.470204 pos: 7523 size: 418 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 417 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg1_mpg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg1_mpg new file mode 100644 index 00000000..54f0b166 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg1_mpg @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 9779 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9779 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 124245 size: 11796 +ret: 0 st: 0 flags:0 ts: 0.788334 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 76694 size: 10792 +ret:-1 st: 0 flags:1 ts:-0.317499 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 124245 size: 11796 +ret: 0 st: 0 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 37721 size: 9873 +ret:-1 st: 0 flags:1 ts:-0.740831 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 76694 size: 10792 +ret: 0 st: 0 flags:0 ts:-0.058330 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9779 +ret: 0 st: 0 flags:1 ts: 2.835837 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 177089 size: 12057 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 177089 size: 12057 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 37721 size: 9873 +ret: 0 st: 0 flags:0 ts:-0.481662 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9779 +ret: 0 st: 0 flags:1 ts: 2.412505 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 177089 size: 12057 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 124245 size: 11796 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9779 +ret: 0 st: 0 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9779 +ret: 0 st: 0 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 177089 size: 12057 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 76694 size: 10792 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671674 +ret: 0 st: 0 flags:1 ts: 1.565841 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 124245 size: 11796 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 37721 size: 9873 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg1b_mpg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg1b_mpg new file mode 100644 index 00000000..4c839979 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg1b_mpg @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 11817 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 11817 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.800000 pts: NOPTS pos: 194420 size: 14837 +ret: 0 st: 0 flags:0 ts: 0.788334 +ret: 0 st: 0 flags:1 dts: 0.840000 pts: NOPTS pos: 80757 size: 13267 +ret:-1 st: 0 flags:1 ts:-0.317499 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: NOPTS pos: 133899 size: 14470 +ret: 0 st: 0 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.840000 pts: NOPTS pos: 80757 size: 13267 +ret:-1 st: 0 flags:1 ts:-0.740831 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.840000 pts: NOPTS pos: 80757 size: 13267 +ret: 0 st: 0 flags:0 ts:-0.058330 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 11817 +ret: 0 st: 0 flags:1 ts: 2.835837 +ret: 0 st: 0 flags:1 dts: 1.800000 pts: NOPTS pos: 194420 size: 14837 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.800000 pts: NOPTS pos: 194420 size: 14837 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: NOPTS pos: 34797 size: 12009 +ret: 0 st: 0 flags:0 ts:-0.481662 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 11817 +ret: 0 st: 0 flags:1 ts: 2.412505 +ret: 0 st: 0 flags:1 dts: 1.800000 pts: NOPTS pos: 194420 size: 14837 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: NOPTS pos: 133899 size: 14470 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 11817 +ret: 0 st: 0 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 11817 +ret: 0 st: 0 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 1.800000 pts: NOPTS pos: 194420 size: 14837 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: NOPTS pos: 133899 size: 14470 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671674 +ret: 0 st: 0 flags:1 ts: 1.565841 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: NOPTS pos: 133899 size: 14470 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.840000 pts: NOPTS pos: 80757 size: 13267 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2_422_mpg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2_422_mpg new file mode 100644 index 00000000..3b4e1e7d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2_422_mpg @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 17497 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 17497 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 325162 size: 19936 +ret: 0 st: 0 flags:0 ts: 0.788334 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 200736 size: 22575 +ret:-1 st: 0 flags:1 ts:-0.317499 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 265477 size: 21329 +ret: 0 st: 0 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 104454 size: 28984 +ret:-1 st: 0 flags:1 ts:-0.740831 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 200736 size: 22575 +ret: 0 st: 0 flags:0 ts:-0.058330 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 17497 +ret: 0 st: 0 flags:1 ts: 2.835837 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 325162 size: 19936 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 325162 size: 19936 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 104454 size: 28984 +ret: 0 st: 0 flags:0 ts:-0.481662 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 17497 +ret: 0 st: 0 flags:1 ts: 2.412505 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 325162 size: 19936 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 265477 size: 21329 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 17497 +ret: 0 st: 0 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 17497 +ret: 0 st: 0 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 325162 size: 19936 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 265477 size: 21329 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671674 +ret: 0 st: 0 flags:1 ts: 1.565841 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 265477 size: 21329 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 200736 size: 22575 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2_mpg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2_mpg new file mode 100644 index 00000000..b096f6fe --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2_mpg @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9911 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9911 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 127925 size: 11918 +ret: 0 st: 0 flags:0 ts: 0.788334 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 79103 size: 10909 +ret:-1 st: 0 flags:1 ts:-0.317499 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 127925 size: 11918 +ret: 0 st: 0 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 38992 size: 9985 +ret:-1 st: 0 flags:1 ts:-0.740831 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 79103 size: 10909 +ret: 0 st: 0 flags:0 ts:-0.058330 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9911 +ret: 0 st: 0 flags:1 ts: 2.835837 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 182138 size: 12183 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 182138 size: 12183 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 38992 size: 9985 +ret: 0 st: 0 flags:0 ts:-0.481662 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9911 +ret: 0 st: 0 flags:1 ts: 2.412505 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 182138 size: 12183 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 127925 size: 11918 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9911 +ret: 0 st: 0 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9911 +ret: 0 st: 0 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 182138 size: 12183 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 79103 size: 10909 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671674 +ret: 0 st: 0 flags:1 ts: 1.565841 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 127925 size: 11918 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 38992 size: 9985 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2i_mpg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2i_mpg new file mode 100644 index 00000000..0708cfd7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2i_mpg @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 132607 size: 11970 +ret: 0 st: 0 flags:0 ts: 0.788334 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 82152 size: 10965 +ret:-1 st: 0 flags:1 ts:-0.317499 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 132607 size: 11970 +ret: 0 st: 0 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 40546 size: 10045 +ret:-1 st: 0 flags:1 ts:-0.740831 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 82152 size: 10965 +ret: 0 st: 0 flags:0 ts:-0.058330 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961 +ret: 0 st: 0 flags:1 ts: 2.835837 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 188429 size: 12232 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 188429 size: 12232 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 40546 size: 10045 +ret: 0 st: 0 flags:0 ts:-0.481662 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961 +ret: 0 st: 0 flags:1 ts: 2.412505 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 188429 size: 12232 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 132607 size: 11970 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961 +ret: 0 st: 0 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961 +ret: 0 st: 0 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: NOPTS pos: 188429 size: 12232 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: NOPTS pos: 82152 size: 10965 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671674 +ret: 0 st: 0 flags:1 ts: 1.565841 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: NOPTS pos: 132607 size: 11970 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: NOPTS pos: 40546 size: 10045 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2ivlc_qprd_mpg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2ivlc_qprd_mpg new file mode 100644 index 00000000..330dc16a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2ivlc_qprd_mpg @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 16239 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 16239 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 227500 size: 12725 +ret: 0 st: 0 flags:0 ts: 0.788334 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 164167 size: 13921 +ret:-1 st: 0 flags:1 ts:-0.317499 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 196681 size: 13159 +ret: 0 st: 0 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 98748 size: 29165 +ret:-1 st: 0 flags:1 ts:-0.740831 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 164167 size: 13921 +ret: 0 st: 0 flags:0 ts:-0.058330 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 16239 +ret: 0 st: 0 flags:1 ts: 2.835837 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 227500 size: 12725 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 227500 size: 12725 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 98748 size: 29165 +ret: 0 st: 0 flags:0 ts:-0.481662 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 16239 +ret: 0 st: 0 flags:1 ts: 2.412505 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 227500 size: 12725 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 196681 size: 13159 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 16239 +ret: 0 st: 0 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 16239 +ret: 0 st: 0 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 227500 size: 12725 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 196681 size: 13159 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671674 +ret: 0 st: 0 flags:1 ts: 1.565841 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 196681 size: 13159 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 164167 size: 13921 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2reuse_mpg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2reuse_mpg new file mode 100644 index 00000000..c4ae3ea2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2reuse_mpg @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 20829 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 20829 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 337078 size: 26840 +ret: 0 st: 0 flags:0 ts: 0.788334 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 141401 size: 23537 +ret:-1 st: 0 flags:1 ts:-0.317499 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 232037 size: 26192 +ret: 0 st: 0 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 63793 size: 21295 +ret:-1 st: 0 flags:1 ts:-0.740831 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 141401 size: 23537 +ret: 0 st: 0 flags:0 ts:-0.058330 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 20829 +ret: 0 st: 0 flags:1 ts: 2.835837 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 337078 size: 26840 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 337078 size: 26840 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 63793 size: 21295 +ret: 0 st: 0 flags:0 ts:-0.481662 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 20829 +ret: 0 st: 0 flags:1 ts: 2.412505 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 337078 size: 26840 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 232037 size: 26192 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 20829 +ret: 0 st: 0 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 20829 +ret: 0 st: 0 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 337078 size: 26840 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 232037 size: 26192 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671674 +ret: 0 st: 0 flags:1 ts: 1.565841 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 232037 size: 26192 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 141401 size: 23537 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2thread_mpg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2thread_mpg new file mode 100644 index 00000000..24ee04f7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2thread_mpg @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 158225 size: 12232 +ret: 0 st: 0 flags:0 ts: 0.788334 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 67790 size: 10965 +ret:-1 st: 0 flags:1 ts:-0.317499 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 110330 size: 11970 +ret: 0 st: 0 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 30747 size: 10045 +ret:-1 st: 0 flags:1 ts:-0.740831 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 67790 size: 10965 +ret: 0 st: 0 flags:0 ts:-0.058330 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961 +ret: 0 st: 0 flags:1 ts: 2.835837 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 158225 size: 12232 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 158225 size: 12232 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 30747 size: 10045 +ret: 0 st: 0 flags:0 ts:-0.481662 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961 +ret: 0 st: 0 flags:1 ts: 2.412505 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 158225 size: 12232 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 110330 size: 11970 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961 +ret: 0 st: 0 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9961 +ret: 0 st: 0 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 158225 size: 12232 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 110330 size: 11970 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671674 +ret: 0 st: 0 flags:1 ts: 1.565841 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 110330 size: 11970 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 67790 size: 10965 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2threadivlc_mpg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2threadivlc_mpg new file mode 100644 index 00000000..c2f9895a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg2threadivlc_mpg @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9954 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9954 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 157678 size: 11930 +ret: 0 st: 0 flags:0 ts: 0.788334 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 67723 size: 10791 +ret:-1 st: 0 flags:1 ts:-0.317499 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 110080 size: 11697 +ret: 0 st: 0 flags:0 ts: 0.365002 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 30744 size: 9980 +ret:-1 st: 0 flags:1 ts:-0.740831 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 67723 size: 10791 +ret: 0 st: 0 flags:0 ts:-0.058330 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9954 +ret: 0 st: 0 flags:1 ts: 2.835837 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 157678 size: 11930 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 157678 size: 11930 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 30744 size: 9980 +ret: 0 st: 0 flags:0 ts:-0.481662 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9954 +ret: 0 st: 0 flags:1 ts: 2.412505 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 157678 size: 11930 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 110080 size: 11697 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9954 +ret: 0 st: 0 flags:0 ts:-0.904994 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 0 size: 9954 +ret: 0 st: 0 flags:1 ts: 1.989173 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 157678 size: 11930 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 110080 size: 11697 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671674 +ret: 0 st: 0 flags:1 ts: 1.565841 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 110080 size: 11697 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 67723 size: 10791 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_Q_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_Q_avi new file mode 100644 index 00000000..1bb15046 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_Q_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 11942 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 11942 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 141530 size: 15562 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 64116 size: 13382 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 100368 size: 15057 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 32818 size: 11813 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 64116 size: 13382 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 11942 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 141530 size: 15562 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 141530 size: 15562 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 32818 size: 11813 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 11942 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 141530 size: 15562 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 100368 size: 15057 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 11942 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 11942 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 141530 size: 15562 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 64116 size: 13382 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 100368 size: 15057 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 64116 size: 13382 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_adap_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_adap_avi new file mode 100644 index 00000000..8397b415 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_adap_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 6855 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 6855 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174456 size: 16883 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 98228 size: 17063 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 135598 size: 17525 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 59454 size: 17261 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 98228 size: 17063 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 6855 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174456 size: 16883 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174456 size: 16883 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 59454 size: 17261 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 6855 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174456 size: 16883 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 135598 size: 17525 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 6855 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 6855 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174456 size: 16883 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 98228 size: 17063 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 135598 size: 17525 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 98228 size: 17063 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_adv_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_adv_avi new file mode 100644 index 00000000..2e66b77e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_adv_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8653 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8653 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 91730 size: 11013 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 59504 size: 9815 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 91730 size: 11013 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 31944 size: 8753 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 59504 size: 9815 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8653 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 127624 size: 11279 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 127624 size: 11279 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 31944 size: 8753 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8653 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 127624 size: 11279 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 91730 size: 11013 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8653 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8653 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 127624 size: 11279 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 59504 size: 9815 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 91730 size: 11013 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 31944 size: 8753 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_nr_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_nr_avi new file mode 100644 index 00000000..c9af36fe --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_nr_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10673 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10673 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100640 size: 12464 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 65480 size: 11181 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100640 size: 12464 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 35312 size: 9987 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 65480 size: 11181 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10673 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139424 size: 12911 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139424 size: 12911 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 35312 size: 9987 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10673 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139424 size: 12911 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100640 size: 12464 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10673 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 10673 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139424 size: 12911 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 65480 size: 11181 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100640 size: 12464 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 35312 size: 9987 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_qprd_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_qprd_avi new file mode 100644 index 00000000..70374df5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_qprd_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14873 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14873 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 211032 size: 14638 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 150666 size: 14502 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 180782 size: 14371 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 93036 size: 29366 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 150666 size: 14502 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14873 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 211032 size: 14638 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 211032 size: 14638 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 93036 size: 29366 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14873 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 211032 size: 14638 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 180782 size: 14371 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14873 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14873 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 211032 size: 14638 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 150666 size: 14502 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 180782 size: 14371 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 150666 size: 14502 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_rc_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_rc_avi new file mode 100644 index 00000000..dc703d7e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_rc_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 15766 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 15766 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 207968 size: 13826 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 153812 size: 13382 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 180960 size: 13326 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 94594 size: 32807 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 153812 size: 13382 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 15766 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 207968 size: 13826 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 207968 size: 13826 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 94594 size: 32807 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 15766 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 207968 size: 13826 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 180960 size: 13326 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 15766 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 15766 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 207968 size: 13826 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 153812 size: 13382 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 180960 size: 13326 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 153812 size: 13382 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_thread_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_thread_avi new file mode 100644 index 00000000..8c978276 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/mpeg4_thread_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14874 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14874 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 228222 size: 16324 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 162162 size: 16475 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 195332 size: 16136 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 97844 size: 33332 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 162162 size: 16475 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14874 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 228222 size: 16324 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 228222 size: 16324 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 97844 size: 33332 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14874 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 228222 size: 16324 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 195332 size: 16136 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14874 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5660 size: 14874 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 228222 size: 16324 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 162162 size: 16475 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 195332 size: 16136 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 162162 size: 16475 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/msmpeg4_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/msmpeg4_avi new file mode 100644 index 00000000..fafd4421 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/msmpeg4_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8637 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8637 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 82520 size: 10783 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 53858 size: 9624 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 82520 size: 10783 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29400 size: 8502 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 53858 size: 9624 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8637 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 114276 size: 11180 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 114276 size: 11180 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29400 size: 8502 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8637 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 114276 size: 11180 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 82520 size: 10783 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8637 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8637 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 114276 size: 11180 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 53858 size: 9624 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 82520 size: 10783 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29400 size: 8502 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/msmpeg4v2_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/msmpeg4v2_avi new file mode 100644 index 00000000..566ade0f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/msmpeg4v2_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9003 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9003 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83882 size: 11165 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54790 size: 10010 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83882 size: 11165 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29782 size: 8869 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54790 size: 10010 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9003 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116112 size: 11578 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116112 size: 11578 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29782 size: 8869 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9003 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116112 size: 11578 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83882 size: 11165 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9003 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 9003 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116112 size: 11578 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54790 size: 10010 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83882 size: 11165 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29782 size: 8869 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/odivx_mp4 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/odivx_mp4 new file mode 100644 index 00000000..0600ed02 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/odivx_mp4 @@ -0,0 +1,50 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 75140 size: 10776 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 47228 size: 9634 +ret: 0 st: 0 flags:1 ts:-0.320000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 75140 size: 10776 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 23271 size: 8524 +ret: 0 st: 0 flags:1 ts:-0.760000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 47228 size: 9634 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 106167 size: 11182 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 106167 size: 11182 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 23271 size: 8524 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 106167 size: 11182 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 75140 size: 10776 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 106167 size: 11182 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 47228 size: 9634 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 75140 size: 10776 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 23271 size: 8524 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 8719 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pbmpipe_pbm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pbmpipe_pbm new file mode 100644 index 00000000..28589347 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pbmpipe_pbm @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:317075 +ret:-EINVAL st:-1 flags:0 ts:-1.000000 +ret:-EINVAL st:-1 flags:1 ts: 1.894167 +ret:-EINVAL st: 0 flags:0 ts: 0.800000 +ret:-EINVAL st: 0 flags:1 ts:-0.320000 +ret:-EINVAL st:-1 flags:0 ts: 2.576668 +ret:-EINVAL st:-1 flags:1 ts: 1.470835 +ret:-EINVAL st: 0 flags:0 ts: 0.360000 +ret:-EINVAL st: 0 flags:1 ts:-0.760000 +ret:-EINVAL st:-1 flags:0 ts: 2.153336 +ret:-EINVAL st:-1 flags:1 ts: 1.047503 +ret:-EINVAL st: 0 flags:0 ts:-0.040000 +ret:-EINVAL st: 0 flags:1 ts: 2.840000 +ret:-EINVAL st:-1 flags:0 ts: 1.730004 +ret:-EINVAL st:-1 flags:1 ts: 0.624171 +ret:-EINVAL st: 0 flags:0 ts:-0.480000 +ret:-EINVAL st: 0 flags:1 ts: 2.400000 +ret:-EINVAL st:-1 flags:0 ts: 1.306672 +ret:-EINVAL st:-1 flags:1 ts: 0.200839 +ret:-EINVAL st: 0 flags:0 ts:-0.920000 +ret:-EINVAL st: 0 flags:1 ts: 2.000000 +ret:-EINVAL st:-1 flags:0 ts: 0.883340 +ret:-EINVAL st:-1 flags:1 ts:-0.222493 +ret:-EINVAL st: 0 flags:0 ts: 2.680000 +ret:-EINVAL st: 0 flags:1 ts: 1.560000 +ret:-EINVAL st:-1 flags:0 ts: 0.460008 +ret:-EINVAL st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_alaw_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_alaw_wav new file mode 100644 index 00000000..06f50e76 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_alaw_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894127 pts: 1.894127 pos: 30362 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788367 pts: 0.788367 pos: 12670 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.576757 pts: 2.576757 pos: 41284 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470748 pts: 1.470748 pos: 23588 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365125 pts: 0.365125 pos: 5898 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.153379 pts: 2.153379 pos: 34510 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 16816 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.835760 pts: 2.835760 pos: 45428 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 27736 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624127 pts: 0.624127 pos: 10042 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.412381 pts: 2.412381 pos: 38654 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306757 pts: 1.306757 pos: 20964 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200748 pts: 0.200748 pos: 3268 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.989116 pts: 1.989116 pos: 31882 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883379 pts: 0.883379 pos: 14190 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.671746 pts: 2.671746 pos: 42804 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.565760 pts: 1.565760 pos: 25108 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 7416 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_f32be_au b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_f32be_au new file mode 100644 index 00000000..886356a1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_f32be_au @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 8192 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 8192 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 668288 size: 8192 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 278152 size: 8192 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 8192 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 909072 size: 8192 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 518936 size: 8192 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 128800 size: 8192 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 8192 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 759720 size: 8192 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 369584 size: 8192 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 8192 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos:1000504 size: 8192 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 610368 size: 8192 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 220232 size: 8192 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 8192 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 851152 size: 8192 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 461016 size: 8192 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 70880 size: 8192 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 8192 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 701808 size: 8192 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 311664 size: 8192 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 8192 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 942592 size: 8192 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 552456 size: 8192 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 162312 size: 8192 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 8192 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_f32le_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_f32le_wav new file mode 100644 index 00000000..335a8a07 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_f32le_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 668344 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 278208 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 909128 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 518992 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 128856 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 759776 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 369640 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos:1000560 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 610424 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 220288 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 851208 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 461072 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 70936 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 701864 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 311720 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 942648 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 552512 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 162368 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_f64be_au b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_f64be_au new file mode 100644 index 00000000..9be3b4ec --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_f64be_au @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 16384 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 16384 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos:1336552 size: 16384 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 556280 size: 16384 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 16384 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos:1818120 size: 16384 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos:1037848 size: 16384 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 257576 size: 16384 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 16384 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos:1519416 size: 16384 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 739144 size: 16384 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 16384 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos:2000984 size: 16384 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos:1220712 size: 16384 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 440440 size: 16384 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 16384 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos:1702280 size: 16384 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 922008 size: 16384 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 141736 size: 16384 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 16384 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos:1403592 size: 16384 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 623304 size: 16384 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 16384 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos:1885160 size: 16384 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos:1104888 size: 16384 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 324600 size: 16384 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 24 size: 16384 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_f64le_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_f64le_wav new file mode 100644 index 00000000..41eeda0c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_f64le_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos:1336608 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 556336 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos:1818176 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos:1037904 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 257632 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos:1519472 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 739200 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos:2001040 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos:1220768 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 440496 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos:1702336 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 922064 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 141792 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos:1403648 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 623360 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos:1885216 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos:1104944 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 324656 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 80 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_mulaw_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_mulaw_wav new file mode 100644 index 00000000..06f50e76 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_mulaw_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894127 pts: 1.894127 pos: 30362 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788367 pts: 0.788367 pos: 12670 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.576757 pts: 2.576757 pos: 41284 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470748 pts: 1.470748 pos: 23588 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365125 pts: 0.365125 pos: 5898 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.153379 pts: 2.153379 pos: 34510 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 16816 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.835760 pts: 2.835760 pos: 45428 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 27736 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624127 pts: 0.624127 pos: 10042 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.412381 pts: 2.412381 pos: 38654 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306757 pts: 1.306757 pos: 20964 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200748 pts: 0.200748 pos: 3268 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.989116 pts: 1.989116 pos: 31882 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883379 pts: 0.883379 pos: 14190 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.671746 pts: 2.671746 pos: 42804 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.565760 pts: 1.565760 pos: 25108 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 7416 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s16be_mkv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s16be_mkv new file mode 100644 index 00000000..8889c423 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s16be_mkv @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.881000 pts: 1.881000 pos: 332755 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 dts: 0.789000 pts: 0.789000 pos: 139914 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.577000 pts: 2.577000 pos: 455845 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.463000 pts: 1.463000 pos: 258901 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365000 +ret: 0 st: 0 flags:1 dts: 0.372000 pts: 0.372000 pos: 66060 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.741000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.159000 pts: 2.159000 pos: 381991 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.045000 pts: 1.045000 pos: 185047 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.836000 +ret: 0 st: 0 flags:1 dts: 2.833000 pts: 2.833000 pos: 500978 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.741000 pts: 1.741000 pos: 308137 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.604000 pts: 0.604000 pos: 107090 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.413000 +ret: 0 st: 0 flags:1 dts: 2.392000 pts: 2.392000 pos: 423021 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.324000 pts: 1.324000 pos: 234283 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.186000 pts: 0.186000 pos: 33236 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.905000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989000 +ret: 0 st: 0 flags:1 dts: 1.974000 pts: 1.974000 pos: 349167 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.906000 pts: 0.906000 pos: 160429 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.672000 +ret: 0 st: 0 flags:1 dts: 2.694000 pts: 2.694000 pos: 476360 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.566000 +ret: 0 st: 0 flags:1 dts: 1.556000 pts: 1.556000 pos: 275313 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.464000 pts: 0.464000 pos: 82472 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s16be_mov b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s16be_mov new file mode 100644 index 00000000..f6a6be45 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s16be_mov @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos: 331812 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.789478 pts: 0.789478 pos: 139300 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.577415 pts: 2.577415 pos: 454692 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos: 258084 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos: 65572 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.159456 pts: 2.159456 pos: 380964 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos: 184356 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.832834 pts: 2.832834 pos: 499748 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.741497 pts: 1.741497 pos: 307236 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.603719 pts: 0.603719 pos: 106532 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.391655 pts: 2.391655 pos: 421924 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.323537 pts: 1.323537 pos: 233508 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos: 32804 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.973696 pts: 1.973696 pos: 348196 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.905578 pts: 0.905578 pos: 159780 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.693515 pts: 2.693515 pos: 475172 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.555737 pts: 1.555737 pos: 274468 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.464399 pts: 0.464399 pos: 81956 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s16le_mkv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s16le_mkv new file mode 100644 index 00000000..8889c423 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s16le_mkv @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.881000 pts: 1.881000 pos: 332755 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 dts: 0.789000 pts: 0.789000 pos: 139914 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.577000 pts: 2.577000 pos: 455845 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.463000 pts: 1.463000 pos: 258901 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365000 +ret: 0 st: 0 flags:1 dts: 0.372000 pts: 0.372000 pos: 66060 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.741000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.159000 pts: 2.159000 pos: 381991 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.045000 pts: 1.045000 pos: 185047 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.836000 +ret: 0 st: 0 flags:1 dts: 2.833000 pts: 2.833000 pos: 500978 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.741000 pts: 1.741000 pos: 308137 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.604000 pts: 0.604000 pos: 107090 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.413000 +ret: 0 st: 0 flags:1 dts: 2.392000 pts: 2.392000 pos: 423021 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.324000 pts: 1.324000 pos: 234283 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.186000 pts: 0.186000 pos: 33236 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.905000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989000 +ret: 0 st: 0 flags:1 dts: 1.974000 pts: 1.974000 pos: 349167 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.906000 pts: 0.906000 pos: 160429 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.672000 +ret: 0 st: 0 flags:1 dts: 2.694000 pts: 2.694000 pos: 476360 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.566000 +ret: 0 st: 0 flags:1 dts: 1.556000 pts: 1.556000 pos: 275313 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.464000 pts: 0.464000 pos: 82472 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 412 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s16le_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s16le_wav new file mode 100644 index 00000000..41acc98d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s16le_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 334176 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 139108 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 454568 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 259500 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 64432 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 379892 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 184824 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos: 500284 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 305216 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 110148 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 425608 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 230540 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 35472 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 350936 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 155864 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 471328 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 276260 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 81188 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s24be_mov b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s24be_mov new file mode 100644 index 00000000..ef22082e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s24be_mov @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 6144 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 6144 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos: 497700 size: 6144 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.789478 pts: 0.789478 pos: 208932 size: 6144 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 6144 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.577415 pts: 2.577415 pos: 682020 size: 6144 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos: 387108 size: 6144 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos: 98340 size: 6144 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 6144 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.159456 pts: 2.159456 pos: 571428 size: 6144 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos: 276516 size: 6144 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 6144 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.832834 pts: 2.832834 pos: 749604 size: 6144 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.741497 pts: 1.741497 pos: 460836 size: 6144 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.603719 pts: 0.603719 pos: 159780 size: 6144 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 6144 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.391655 pts: 2.391655 pos: 632868 size: 6144 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.323537 pts: 1.323537 pos: 350244 size: 6144 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos: 49188 size: 6144 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 6144 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.973696 pts: 1.973696 pos: 522276 size: 6144 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.905578 pts: 0.905578 pos: 239652 size: 6144 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 6144 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.693515 pts: 2.693515 pos: 712740 size: 6144 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.555737 pts: 1.555737 pos: 411684 size: 6144 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.464399 pts: 0.464399 pos: 122916 size: 6144 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 6144 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s24daud_302 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s24daud_302 new file mode 100644 index 00000000..5c9b6d97 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s24daud_302 @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 4 size: 39816 +ret:-1 st:-1 flags:0 ts:-1.000000 +ret:-1 st:-1 flags:1 ts: 1.894167 +ret:-1 st: 0 flags:0 ts: 0.788333 +ret:-1 st: 0 flags:1 ts:-0.317500 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret:-1 st:-1 flags:1 ts: 1.470835 +ret:-1 st: 0 flags:0 ts: 0.365000 +ret:-1 st: 0 flags:1 ts:-0.740833 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret:-1 st:-1 flags:1 ts: 1.047503 +ret:-1 st: 0 flags:0 ts:-0.058333 +ret:-1 st: 0 flags:1 ts: 2.835833 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret:-1 st:-1 flags:1 ts: 0.624171 +ret:-1 st: 0 flags:0 ts:-0.481667 +ret:-1 st: 0 flags:1 ts: 2.412500 +ret:-1 st:-1 flags:0 ts: 1.306672 +ret:-1 st:-1 flags:1 ts: 0.200839 +ret:-1 st: 0 flags:0 ts:-0.904989 +ret:-1 st: 0 flags:1 ts: 1.989178 +ret:-1 st:-1 flags:0 ts: 0.883340 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.671678 +ret:-1 st: 0 flags:1 ts: 1.565844 +ret:-1 st:-1 flags:0 ts: 0.460008 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s24le_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s24le_wav new file mode 100644 index 00000000..c6a37f83 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s24le_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4092 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4092 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 501266 size: 4092 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 208664 size: 4092 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4092 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 681854 size: 4092 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 389252 size: 4092 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 96650 size: 4092 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4092 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 569840 size: 4092 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 277238 size: 4092 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4092 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos: 750428 size: 4092 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 457826 size: 4092 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 165224 size: 4092 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4092 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 638414 size: 4092 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 345812 size: 4092 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 53210 size: 4092 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4092 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 526406 size: 4092 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 233798 size: 4092 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4092 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 706994 size: 4092 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 414392 size: 4092 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 121784 size: 4092 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4092 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s32be_mov b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s32be_mov new file mode 100644 index 00000000..6aed7449 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s32be_mov @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 8192 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 8192 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos: 663588 size: 8192 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.789478 pts: 0.789478 pos: 278564 size: 8192 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 8192 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.577415 pts: 2.577415 pos: 909348 size: 8192 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos: 516132 size: 8192 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos: 131108 size: 8192 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 8192 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.159456 pts: 2.159456 pos: 761892 size: 8192 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos: 368676 size: 8192 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 8192 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.832834 pts: 2.832834 pos: 999460 size: 8192 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.741497 pts: 1.741497 pos: 614436 size: 8192 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.603719 pts: 0.603719 pos: 213028 size: 8192 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 8192 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.391655 pts: 2.391655 pos: 843812 size: 8192 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.323537 pts: 1.323537 pos: 466980 size: 8192 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos: 65572 size: 8192 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 8192 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.973696 pts: 1.973696 pos: 696356 size: 8192 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.905578 pts: 0.905578 pos: 319524 size: 8192 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 8192 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.693515 pts: 2.693515 pos: 950308 size: 8192 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.555737 pts: 1.555737 pos: 548900 size: 8192 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.464399 pts: 0.464399 pos: 163876 size: 8192 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 8192 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s32le_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s32le_wav new file mode 100644 index 00000000..df85b2d6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s32le_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 668332 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 278196 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 909116 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 518980 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 128844 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 759764 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 369628 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos:1000548 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 610412 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 220276 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 851196 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 461060 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 70924 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 701852 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 311708 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 942636 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 552500 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 162356 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 68 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s8_mov b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s8_mov new file mode 100644 index 00000000..b119e2e2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_s8_mov @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 2048 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 2048 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos: 165924 size: 2048 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.789478 pts: 0.789478 pos: 69668 size: 2048 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 2048 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.577415 pts: 2.577415 pos: 227364 size: 2048 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos: 129060 size: 2048 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos: 32804 size: 2048 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 2048 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.159456 pts: 2.159456 pos: 190500 size: 2048 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos: 92196 size: 2048 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 2048 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.832834 pts: 2.832834 pos: 249892 size: 2048 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.741497 pts: 1.741497 pos: 153636 size: 2048 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.603719 pts: 0.603719 pos: 53284 size: 2048 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 2048 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.391655 pts: 2.391655 pos: 210980 size: 2048 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.323537 pts: 1.323537 pos: 116772 size: 2048 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos: 16420 size: 2048 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 2048 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.973696 pts: 1.973696 pos: 174116 size: 2048 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.905578 pts: 0.905578 pos: 79908 size: 2048 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 2048 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.693515 pts: 2.693515 pos: 237604 size: 2048 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.555737 pts: 1.555737 pos: 137252 size: 2048 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.464399 pts: 0.464399 pos: 40996 size: 2048 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 2048 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_u8_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_u8_wav new file mode 100644 index 00000000..afa33519 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_u8_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 167110 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 69576 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 227306 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 129772 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 32238 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 189968 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 92434 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos: 250164 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 152630 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 55096 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 212826 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 115292 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 17758 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 175490 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 77954 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 235686 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 138152 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 40616 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 44 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_zork_wav b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_zork_wav new file mode 100644 index 00000000..06f50e76 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pcm_zork_wav @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.894127 pts: 1.894127 pos: 30362 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.788345 +ret: 0 st: 0 flags:1 dts: 0.788367 pts: 0.788367 pos: 12670 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.317506 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.576757 pts: 2.576757 pos: 41284 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.470748 pts: 1.470748 pos: 23588 size: 4096 +ret: 0 st: 0 flags:0 ts: 0.365011 +ret: 0 st: 0 flags:1 dts: 0.365125 pts: 0.365125 pos: 5898 size: 4096 +ret: 0 st: 0 flags:1 ts:-0.740839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 2.153379 pts: 2.153379 pos: 34510 size: 4096 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 16816 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.058322 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.835828 +ret: 0 st: 0 flags:1 dts: 2.835760 pts: 2.835760 pos: 45428 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 27736 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.624127 pts: 0.624127 pos: 10042 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.481655 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 2.412494 +ret: 0 st: 0 flags:1 dts: 2.412381 pts: 2.412381 pos: 38654 size: 4096 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.306757 pts: 1.306757 pos: 20964 size: 4096 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200748 pts: 0.200748 pos: 3268 size: 4096 +ret: 0 st: 0 flags:0 ts:-0.904989 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.989184 +ret: 0 st: 0 flags:1 dts: 1.989116 pts: 1.989116 pos: 31882 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.883379 pts: 0.883379 pos: 14190 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 +ret: 0 st: 0 flags:0 ts: 2.671678 +ret: 0 st: 0 flags:1 dts: 2.671746 pts: 2.671746 pos: 42804 size: 4096 +ret: 0 st: 0 flags:1 ts: 1.565850 +ret: 0 st: 0 flags:1 dts: 1.565760 pts: 1.565760 pos: 25108 size: 4096 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 7416 size: 4096 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 56 size: 4096 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pgmpipe_pgm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pgmpipe_pgm new file mode 100644 index 00000000..8ba51807 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/pgmpipe_pgm @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:2534775 +ret:-EINVAL st:-1 flags:0 ts:-1.000000 +ret:-EINVAL st:-1 flags:1 ts: 1.894167 +ret:-EINVAL st: 0 flags:0 ts: 0.800000 +ret:-EINVAL st: 0 flags:1 ts:-0.320000 +ret:-EINVAL st:-1 flags:0 ts: 2.576668 +ret:-EINVAL st:-1 flags:1 ts: 1.470835 +ret:-EINVAL st: 0 flags:0 ts: 0.360000 +ret:-EINVAL st: 0 flags:1 ts:-0.760000 +ret:-EINVAL st:-1 flags:0 ts: 2.153336 +ret:-EINVAL st:-1 flags:1 ts: 1.047503 +ret:-EINVAL st: 0 flags:0 ts:-0.040000 +ret:-EINVAL st: 0 flags:1 ts: 2.840000 +ret:-EINVAL st:-1 flags:0 ts: 1.730004 +ret:-EINVAL st:-1 flags:1 ts: 0.624171 +ret:-EINVAL st: 0 flags:0 ts:-0.480000 +ret:-EINVAL st: 0 flags:1 ts: 2.400000 +ret:-EINVAL st:-1 flags:0 ts: 1.306672 +ret:-EINVAL st:-1 flags:1 ts: 0.200839 +ret:-EINVAL st: 0 flags:0 ts:-0.920000 +ret:-EINVAL st: 0 flags:1 ts: 2.000000 +ret:-EINVAL st:-1 flags:0 ts: 0.883340 +ret:-EINVAL st:-1 flags:1 ts:-0.222493 +ret:-EINVAL st: 0 flags:0 ts: 2.680000 +ret:-EINVAL st: 0 flags:1 ts: 1.560000 +ret:-EINVAL st:-1 flags:0 ts: 0.460008 +ret:-EINVAL st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/ppmpipe_ppm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/ppmpipe_ppm new file mode 100644 index 00000000..46c535af --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/ppmpipe_ppm @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:7603575 +ret:-EINVAL st:-1 flags:0 ts:-1.000000 +ret:-EINVAL st:-1 flags:1 ts: 1.894167 +ret:-EINVAL st: 0 flags:0 ts: 0.800000 +ret:-EINVAL st: 0 flags:1 ts:-0.320000 +ret:-EINVAL st:-1 flags:0 ts: 2.576668 +ret:-EINVAL st:-1 flags:1 ts: 1.470835 +ret:-EINVAL st: 0 flags:0 ts: 0.360000 +ret:-EINVAL st: 0 flags:1 ts:-0.760000 +ret:-EINVAL st:-1 flags:0 ts: 2.153336 +ret:-EINVAL st:-1 flags:1 ts: 1.047503 +ret:-EINVAL st: 0 flags:0 ts:-0.040000 +ret:-EINVAL st: 0 flags:1 ts: 2.840000 +ret:-EINVAL st:-1 flags:0 ts: 1.730004 +ret:-EINVAL st:-1 flags:1 ts: 0.624171 +ret:-EINVAL st: 0 flags:0 ts:-0.480000 +ret:-EINVAL st: 0 flags:1 ts: 2.400000 +ret:-EINVAL st:-1 flags:0 ts: 1.306672 +ret:-EINVAL st:-1 flags:1 ts: 0.200839 +ret:-EINVAL st: 0 flags:0 ts:-0.920000 +ret:-EINVAL st: 0 flags:1 ts: 2.000000 +ret:-EINVAL st:-1 flags:0 ts: 0.883340 +ret:-EINVAL st:-1 flags:1 ts:-0.222493 +ret:-EINVAL st: 0 flags:0 ts: 2.680000 +ret:-EINVAL st: 0 flags:1 ts: 1.560000 +ret:-EINVAL st:-1 flags:0 ts: 0.460008 +ret:-EINVAL st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/rgb_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/rgb_avi new file mode 100644 index 00000000..888032b4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/rgb_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:304128 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:304128 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:14300052 size:304128 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:6088380 size:304128 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:11258692 size:304128 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:2742884 size:304128 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:7913196 size:304128 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:304128 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:14908324 size:304128 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:13083508 size:304128 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:4871836 size:304128 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:304128 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:14908324 size:304128 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:10042148 size:304128 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:1526340 size:304128 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:304128 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:14908324 size:304128 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:6696652 size:304128 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:11866964 size:304128 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:3655292 size:304128 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/roqav_roq b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/roqav_roq new file mode 100644 index 00000000..d003a374 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/roqav_roq @@ -0,0 +1,27 @@ +ret: 0 st: 0 flags:0 dts: 0.000000 pts: 0.000000 pos: 24 size: 26082 +ret:-1 st:-1 flags:0 ts:-1.000000 +ret:-1 st:-1 flags:1 ts: 1.894167 +ret:-1 st: 0 flags:0 ts: 0.800000 +ret:-1 st: 0 flags:1 ts:-0.333333 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret:-1 st:-1 flags:1 ts: 1.470835 +ret:-1 st: 0 flags:0 ts: 0.366667 +ret:-1 st: 0 flags:1 ts:-0.733333 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret:-1 st:-1 flags:1 ts: 1.047503 +ret:-1 st: 0 flags:0 ts:-0.066667 +ret:-1 st: 0 flags:1 ts: 2.833333 +ret:-1 st:-1 flags:0 ts: 1.730004 +ret:-1 st:-1 flags:1 ts: 0.624171 +ret:-1 st: 0 flags:0 ts:-0.466667 +ret:-1 st: 0 flags:1 ts: 2.400000 +ret:-1 st:-1 flags:0 ts: 1.306672 +ret:-1 st:-1 flags:1 ts: 0.200839 +ret:-1 st: 0 flags:0 ts:-0.900000 +ret:-1 st: 0 flags:1 ts: 2.000000 +ret:-1 st:-1 flags:0 ts: 0.883340 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.666667 +ret:-1 st: 0 flags:1 ts: 1.566667 +ret:-1 st:-1 flags:0 ts: 0.460008 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/rv10_rm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/rv10_rm new file mode 100644 index 00000000..123b03c1 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/rv10_rm @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 98608 size: 12303 +ret: 0 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 61592 size: 11135 +ret: 0 st: 0 flags:1 ts:-0.317000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 98608 size: 12303 +ret: 0 st: 0 flags:0 ts: 0.365000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 31132 size: 10097 +ret: 0 st: 0 flags:1 ts:-0.741000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 61592 size: 11135 +ret: 0 st: 0 flags:0 ts:-0.058000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388 +ret: 0 st: 0 flags:1 ts: 2.836000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 31132 size: 10097 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388 +ret: 0 st: 0 flags:1 ts: 2.413000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 98608 size: 12303 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388 +ret: 0 st: 0 flags:0 ts:-0.905000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388 +ret: 0 st: 0 flags:1 ts: 1.989000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 61592 size: 11135 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388 +ret: 0 st: 0 flags:0 ts: 2.672000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738 +ret: 0 st: 0 flags:1 ts: 1.566000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 98608 size: 12303 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 31132 size: 10097 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 10388 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/rv20_rm b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/rv20_rm new file mode 100644 index 00000000..f2b24e30 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/rv20_rm @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 98158 size: 11344 +ret: 0 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 61133 size: 10166 +ret: 0 st: 0 flags:1 ts:-0.317000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 98158 size: 11344 +ret: 0 st: 0 flags:0 ts: 0.365000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 30753 size: 9101 +ret: 0 st: 0 flags:1 ts:-0.741000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 61133 size: 10166 +ret: 0 st: 0 flags:0 ts:-0.058000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361 +ret: 0 st: 0 flags:1 ts: 2.836000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 30753 size: 9101 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361 +ret: 0 st: 0 flags:1 ts: 2.413000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 98158 size: 11344 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361 +ret: 0 st: 0 flags:0 ts:-0.905000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361 +ret: 0 st: 0 flags:1 ts: 1.989000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 61133 size: 10166 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361 +ret: 0 st: 0 flags:0 ts: 2.672000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803 +ret: 0 st: 0 flags:1 ts: 1.566000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 98158 size: 11344 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 30753 size: 9101 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 239 size: 9361 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/snow53_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/snow53_avi new file mode 100644 index 00000000..5eb0ba07 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/snow53_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 72476 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 72476 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:1902800 size: 78837 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1239102 size: 74994 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:1902800 size: 78837 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 605640 size: 71059 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1239102 size: 74994 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 72476 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:2585626 size: 79731 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:2585626 size: 79731 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 605640 size: 71059 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 72476 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:2585626 size: 79731 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:1902800 size: 78837 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 72476 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 72476 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:2585626 size: 79731 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1239102 size: 74994 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:1902800 size: 78837 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 605640 size: 71059 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/snow_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/snow_avi new file mode 100644 index 00000000..39f8ac85 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/snow_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 3035 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 3035 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39726 size: 3640 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 27446 size: 3494 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39726 size: 3640 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 16136 size: 3244 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 27446 size: 3494 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 3035 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52616 size: 3582 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52616 size: 3582 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 16136 size: 3244 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 3035 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52616 size: 3582 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39726 size: 3640 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 3035 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 3035 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52616 size: 3582 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 27446 size: 3494 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39726 size: 3640 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 16136 size: 3244 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/svq1_mov b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/svq1_mov new file mode 100644 index 00000000..17bb99e6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/svq1_mov @@ -0,0 +1,50 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552 +ret: 0 st: 0 flags:1 ts:-0.320000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157040 size: 21896 +ret: 0 st: 0 flags:1 ts:-0.760000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157040 size: 21896 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157040 size: 21896 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/wmav1_asf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/wmav1_asf new file mode 100644 index 00000000..a2892b63 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/wmav1_asf @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 3.286000 pts: 3.286000 pos: 3604 size: 743 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st: 0 flags:1 ts:-0.317000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st: 0 flags:0 ts: 0.365000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st: 0 flags:1 ts:-0.741000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st: 0 flags:0 ts:-0.058000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st: 0 flags:1 ts: 2.836000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st: 0 flags:1 ts: 2.413000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st: 0 flags:0 ts:-0.905000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st: 0 flags:1 ts: 1.989000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st: 0 flags:0 ts: 2.672000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st: 0 flags:1 ts: 1.566000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/wmav2_asf b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/wmav2_asf new file mode 100644 index 00000000..bd1b79e4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/wmav2_asf @@ -0,0 +1,53 @@ +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 3.286000 pts: 3.286000 pos: 3644 size: 743 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st: 0 flags:0 ts: 0.788000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st: 0 flags:1 ts:-0.317000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st: 0 flags:0 ts: 0.365000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st: 0 flags:1 ts:-0.741000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st:-1 flags:0 ts: 2.153336 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st: 0 flags:0 ts:-0.058000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st: 0 flags:1 ts: 2.836000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st: 0 flags:0 ts:-0.482000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st: 0 flags:1 ts: 2.413000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st: 0 flags:0 ts:-0.905000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st: 0 flags:1 ts: 1.989000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st:-1 flags:1 ts:-0.222493 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st: 0 flags:0 ts: 2.672000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st: 0 flags:1 ts: 1.566000 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 +ret: 0 st:-1 flags:1 ts:-0.645825 +ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/wmv1_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/wmv1_avi new file mode 100644 index 00000000..8739c962 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/wmv1_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8990 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8990 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83754 size: 11099 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54770 size: 9931 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83754 size: 11099 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29806 size: 8796 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54770 size: 9931 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8990 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 115824 size: 11487 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 115824 size: 11487 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29806 size: 8796 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8990 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 115824 size: 11487 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83754 size: 11099 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8990 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size: 8990 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 115824 size: 11487 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54770 size: 9931 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83754 size: 11099 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29806 size: 8796 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/wmv2_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/wmv2_avi new file mode 100644 index 00000000..ca01a39b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/wmv2_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5664 size: 8917 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5664 size: 8917 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83802 size: 11170 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54584 size: 9989 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83802 size: 11170 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29644 size: 8839 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54584 size: 9989 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5664 size: 8917 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116070 size: 11554 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116070 size: 11554 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29644 size: 8839 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5664 size: 8917 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116070 size: 11554 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83802 size: 11170 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5664 size: 8917 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5664 size: 8917 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116070 size: 11554 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54584 size: 9989 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83802 size: 11170 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29644 size: 8839 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/yuv_avi b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/yuv_avi new file mode 100644 index 00000000..49c514ef --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/seek/yuv_avi @@ -0,0 +1,46 @@ +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:152064 +ret: 0 st:-1 flags:0 ts:-1.000000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:152064 +ret: 0 st:-1 flags:1 ts: 1.894167 +ret: 0 st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:7153044 size:152064 +ret: 0 st: 0 flags:0 ts: 0.800000 +ret: 0 st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:3047100 size:152064 +ret:-1 st: 0 flags:1 ts:-0.320000 +ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:1 ts: 1.470835 +ret: 0 st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:5632324 size:152064 +ret: 0 st: 0 flags:0 ts: 0.360000 +ret: 0 st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:1374308 size:152064 +ret:-1 st: 0 flags:1 ts:-0.760000 +ret:-1 st:-1 flags:0 ts: 2.153336 +ret: 0 st:-1 flags:1 ts: 1.047503 +ret: 0 st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:3959532 size:152064 +ret: 0 st: 0 flags:0 ts:-0.040000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:152064 +ret: 0 st: 0 flags:1 ts: 2.840000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:7457188 size:152064 +ret: 0 st:-1 flags:0 ts: 1.730004 +ret: 0 st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:6544756 size:152064 +ret: 0 st:-1 flags:1 ts: 0.624171 +ret: 0 st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:2438812 size:152064 +ret: 0 st: 0 flags:0 ts:-0.480000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:152064 +ret: 0 st: 0 flags:1 ts: 2.400000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:7457188 size:152064 +ret: 0 st:-1 flags:0 ts: 1.306672 +ret: 0 st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:5024036 size:152064 +ret: 0 st:-1 flags:1 ts: 0.200839 +ret: 0 st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 766020 size:152064 +ret: 0 st: 0 flags:0 ts:-0.920000 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5660 size:152064 +ret: 0 st: 0 flags:1 ts: 2.000000 +ret: 0 st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:7457188 size:152064 +ret: 0 st:-1 flags:0 ts: 0.883340 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:3351244 size:152064 +ret:-1 st:-1 flags:1 ts:-0.222493 +ret:-1 st: 0 flags:0 ts: 2.680000 +ret: 0 st: 0 flags:1 ts: 1.560000 +ret: 0 st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:5936468 size:152064 +ret: 0 st:-1 flags:0 ts: 0.460008 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1830524 size:152064 +ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/asv1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/asv1 new file mode 100644 index 00000000..10c1b037 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/asv1 @@ -0,0 +1,4 @@ +b4ce4698764ef2328346badb7227ecbe *./tests/data/vsynth1/asv1.avi +1489656 ./tests/data/vsynth1/asv1.avi +2dfc5dfc2c1cbbc2543257cd3d2df6af *./tests/data/asv1.vsynth1.out.yuv +stddev: 20.00 PSNR: 22.11 MAXDIFF: 158 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/asv2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/asv2 new file mode 100644 index 00000000..14b0d1cd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/asv2 @@ -0,0 +1,4 @@ +dfba6eaf58e515e324c2b370bfcd9158 *./tests/data/vsynth1/asv2.avi +1456056 ./tests/data/vsynth1/asv2.avi +d451be09793cd0f35b6d91fc36e2571a *./tests/data/asv2.vsynth1.out.yuv +stddev: 18.82 PSNR: 22.63 MAXDIFF: 131 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dnxhd_1080i b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dnxhd_1080i new file mode 100644 index 00000000..654242c7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dnxhd_1080i @@ -0,0 +1,4 @@ +8a814d4056ca2810a8ed0bad3b70f358 *./tests/data/vsynth1/dnxhd-1080i.mov +3031875 ./tests/data/vsynth1/dnxhd-1080i.mov +0c651e840f860592f0d5b66030d9fa32 *./tests/data/dnxhd_1080i.vsynth1.out.yuv +stddev: 6.29 PSNR: 32.15 MAXDIFF: 64 bytes: 760320/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dnxhd_720p b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dnxhd_720p new file mode 100644 index 00000000..263843df --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dnxhd_720p @@ -0,0 +1,4 @@ +81f5be451dc18cf8a1d333c7885de60b *./tests/data/vsynth1/dnxhd-720p.dnxhd +2293760 ./tests/data/vsynth1/dnxhd-720p.dnxhd +94b21e5e68ccf9471eff74afd0ebe319 *./tests/data/dnxhd_720p.vsynth1.out.yuv +stddev: 6.32 PSNR: 32.11 MAXDIFF: 183 bytes: 760320/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dnxhd_720p_rd b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dnxhd_720p_rd new file mode 100644 index 00000000..e77c725a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dnxhd_720p_rd @@ -0,0 +1,4 @@ +1dc6e95925c4f3a230848ec17c02abed *./tests/data/vsynth1/dnxhd-720p-rd.dnxhd +2293760 ./tests/data/vsynth1/dnxhd-720p-rd.dnxhd +02972d2aec120ec1577ec9053d68ae0f *./tests/data/dnxhd_720p_rd.vsynth1.out.yuv +stddev: 6.26 PSNR: 32.19 MAXDIFF: 65 bytes: 760320/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dv new file mode 100644 index 00000000..cb0427c5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dv @@ -0,0 +1,8 @@ +27ade3031b17214cf81c19cbf70f37d7 *./tests/data/vsynth1/dv.dv +7200000 ./tests/data/vsynth1/dv.dv +02ac7cdeab91d4d5621e7ce96dddc498 *./tests/data/dv.vsynth1.out.yuv +stddev: 6.90 PSNR: 31.34 MAXDIFF: 76 bytes: 7603200/ 7603200 +bd67f2431db160d4bb6dcd791cea6efd *./tests/data/vsynth1/dv411.dv +7200000 ./tests/data/vsynth1/dv411.dv +b6640a3a572353f51284acb746eb00c4 *./tests/data/dv.vsynth1.out.yuv +stddev: 30.76 PSNR: 18.37 MAXDIFF: 205 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dv50 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dv50 new file mode 100644 index 00000000..9ae33852 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/dv50 @@ -0,0 +1,4 @@ +26dba84f0ea895b914ef5b333d8394ac *./tests/data/vsynth1/dv50.dv +14400000 ./tests/data/vsynth1/dv50.dv +a2ff093e93ffed10f730fa21df02fc50 *./tests/data/dv50.vsynth1.out.yuv +stddev: 1.72 PSNR: 43.38 MAXDIFF: 29 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/error b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/error new file mode 100644 index 00000000..c3543f9d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/error @@ -0,0 +1,4 @@ +7416dfd319f04044d4575dc9d1b406e1 *./tests/data/vsynth1/error-mpeg4-adv.avi +756836 ./tests/data/vsynth1/error-mpeg4-adv.avi +ef8bfcd6e0883daba95d0f32486ebe2d *./tests/data/error.vsynth1.out.yuv +stddev: 18.05 PSNR: 23.00 MAXDIFF: 245 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/ffv1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/ffv1 new file mode 100644 index 00000000..bf909153 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/ffv1 @@ -0,0 +1,4 @@ +67ddc7edde5cca49290245d881787890 *./tests/data/vsynth1/ffv1.avi +2655376 ./tests/data/vsynth1/ffv1.avi +c5ccac874dbf808e9088bc3107860042 *./tests/data/ffv1.vsynth1.out.yuv +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/flashsv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/flashsv new file mode 100644 index 00000000..7920193a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/flashsv @@ -0,0 +1,4 @@ +97894502b4cb57aca1105b6333f72dae *./tests/data/vsynth1/flashsv.flv +14681925 ./tests/data/vsynth1/flashsv.flv +947cb24ec45a453348ae6fe3fa278071 *./tests/data/flashsv.vsynth1.out.yuv +stddev: 2.85 PSNR: 39.03 MAXDIFF: 49 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/flv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/flv new file mode 100644 index 00000000..17f56560 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/flv @@ -0,0 +1,4 @@ +d6a80659cedee7698aefe9c4a8285fa4 *./tests/data/vsynth1/flv.flv +636269 ./tests/data/vsynth1/flv.flv +5ab46d8dd01dbb1d63df2a84858a4b05 *./tests/data/flv.vsynth1.out.yuv +stddev: 8.02 PSNR: 30.04 MAXDIFF: 105 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/h261 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/h261 new file mode 100644 index 00000000..36d04f17 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/h261 @@ -0,0 +1,4 @@ +d155470b713aeebacb85980b0d5f2ce3 *./tests/data/vsynth1/h261.avi +707588 ./tests/data/vsynth1/h261.avi +716e83cb51afb1246bfaa80967df48ea *./tests/data/h261.vsynth1.out.yuv +stddev: 9.11 PSNR: 28.93 MAXDIFF: 113 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/h263 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/h263 new file mode 100644 index 00000000..6351adc7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/h263 @@ -0,0 +1,4 @@ +fb4dc9b9eac2628c56cb82cf332e1f58 *./tests/data/vsynth1/h263.avi +659686 ./tests/data/vsynth1/h263.avi +1a1ba9a3a63ec1a1a9585fded0a7c954 *./tests/data/h263.vsynth1.out.yuv +stddev: 8.03 PSNR: 30.03 MAXDIFF: 103 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/h263p b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/h263p new file mode 100644 index 00000000..93df5497 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/h263p @@ -0,0 +1,4 @@ +bbcadeceba295e1dad148aea1e57c370 *./tests/data/vsynth1/h263p.avi +2328348 ./tests/data/vsynth1/h263p.avi +9554cda00c3487ab3ffda2c3ea22fa2f *./tests/data/h263p.vsynth1.out.yuv +stddev: 2.06 PSNR: 41.83 MAXDIFF: 20 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/huffyuv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/huffyuv new file mode 100644 index 00000000..fefc84a3 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/huffyuv @@ -0,0 +1,4 @@ +ace2536fa169d835d0fb332abde28d51 *./tests/data/vsynth1/huffyuv.avi +7933800 ./tests/data/vsynth1/huffyuv.avi +c5ccac874dbf808e9088bc3107860042 *./tests/data/huffyuv.vsynth1.out.yuv +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/jpegls b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/jpegls new file mode 100644 index 00000000..636f7fc5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/jpegls @@ -0,0 +1,4 @@ +519e26bb1ac0f3db8f90b36537f2f760 *./tests/data/vsynth1/jpegls.avi +9089812 ./tests/data/vsynth1/jpegls.avi +947cb24ec45a453348ae6fe3fa278071 *./tests/data/jpegls.vsynth1.out.yuv +stddev: 2.85 PSNR: 39.03 MAXDIFF: 49 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/ljpeg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/ljpeg new file mode 100644 index 00000000..01d59e71 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/ljpeg @@ -0,0 +1,4 @@ +9092f306f165b98ab0bb4f576f198ad5 *./tests/data/vsynth1/ljpeg.avi +6312936 ./tests/data/vsynth1/ljpeg.avi +c5ccac874dbf808e9088bc3107860042 *./tests/data/ljpeg.vsynth1.out.yuv +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mjpeg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mjpeg new file mode 100644 index 00000000..63a0ff03 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mjpeg @@ -0,0 +1,4 @@ +8bbf9513b1822945539f27a6eff3c7fa *./tests/data/vsynth1/mjpeg.avi +1516140 ./tests/data/vsynth1/mjpeg.avi +c6ae81b5b896e4d05ff584311aebdb18 *./tests/data/mjpeg.vsynth1.out.yuv +stddev: 7.87 PSNR: 30.21 MAXDIFF: 63 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg new file mode 100644 index 00000000..7ae92f10 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg @@ -0,0 +1,4 @@ +1428744c6d5835f27506e69be4f837f4 *./tests/data/vsynth1/mpeg1.mpg +712006 ./tests/data/vsynth1/mpeg1.mpg +58f0c332bf689117b57fa629a2bc0d2b *./tests/data/mpeg.vsynth1.out.yuv +stddev: 7.62 PSNR: 30.48 MAXDIFF: 84 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg1b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg1b new file mode 100644 index 00000000..897a0ce8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg1b @@ -0,0 +1,4 @@ +777639666b449ab0a7ef260511e40532 *./tests/data/vsynth1/mpeg1b.mpg +1030337 ./tests/data/vsynth1/mpeg1b.mpg +91a7fce732b34748e7bf753ebabe2483 *./tests/data/mpeg1b.vsynth1.out.yuv +stddev: 6.30 PSNR: 32.13 MAXDIFF: 75 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg2 new file mode 100644 index 00000000..e6d404dc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg2 @@ -0,0 +1,20 @@ +fbddea2368cd2028fc8db4dfd4682e94 *./tests/data/vsynth1/mpeg2.mpg +728044 ./tests/data/vsynth1/mpeg2.mpg +b41ca49c1a02e66ce64d262e2cdaec15 *./tests/data/mpeg2.vsynth1.out.yuv +stddev: 7.65 PSNR: 30.45 MAXDIFF: 84 bytes: 7603200/ 7603200 +8f6b20714918e6443e0c03716ed06f0d *./tests/data/vsynth1/mpeg2ivlc-qprd.mpg +783552 ./tests/data/vsynth1/mpeg2ivlc-qprd.mpg +98eb9da15f880978e7f2ee1e7ce476ef *./tests/data/mpeg2.vsynth1.out.yuv +stddev: 10.07 PSNR: 28.06 MAXDIFF: 165 bytes: 7603200/ 7603200 +af0cb75451aaa807beb5102707a98823 *./tests/data/vsynth1/mpeg2_422.mpg +728200 ./tests/data/vsynth1/mpeg2_422.mpg +29b518282493203e83b27a939795dc3a *./tests/data/mpeg2.vsynth1.out.yuv +stddev: 63.33 PSNR: 12.10 MAXDIFF: 242 bytes: 10137600/ 7603200 +4c067397b504d65532d7779cd36f3f88 *./tests/data/vsynth1/mpeg2.mpg +725668 ./tests/data/vsynth1/mpeg2.mpg +9f7b065f98d57cdecf90e6f7a2524eb5 *./tests/data/mpeg2.vsynth1.out.yuv +stddev: 7.65 PSNR: 30.45 MAXDIFF: 81 bytes: 7603200/ 7603200 +ec3f6713c88a2b41f6c369fd64341077 *./tests/data/vsynth1/mpeg2i.mpg +737473 ./tests/data/vsynth1/mpeg2i.mpg +97615390fdd69abfcbc7e02df863a7d2 *./tests/data/mpeg2.vsynth1.out.yuv +stddev: 7.67 PSNR: 30.43 MAXDIFF: 84 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg2thread b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg2thread new file mode 100644 index 00000000..470c2e91 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg2thread @@ -0,0 +1,12 @@ +ecd183706688bd977c9994c3d1b23d61 *./tests/data/vsynth1/mpeg2thread.mpg +801313 ./tests/data/vsynth1/mpeg2thread.mpg +d1658911ca83f5616c1d32abc40750de *./tests/data/mpeg2thread.vsynth1.out.yuv +stddev: 7.63 PSNR: 30.48 MAXDIFF: 110 bytes: 7603200/ 7603200 +23d600b026222253c2340e23300a4c02 *./tests/data/vsynth1/mpeg2threadivlc.mpg +791773 ./tests/data/vsynth1/mpeg2threadivlc.mpg +d1658911ca83f5616c1d32abc40750de *./tests/data/mpeg2thread.vsynth1.out.yuv +stddev: 7.63 PSNR: 30.48 MAXDIFF: 110 bytes: 7603200/ 7603200 +d119fe917dd81d1ff758b4ce684a8d9d *./tests/data/vsynth1/mpeg2reuse.mpg +2074636 ./tests/data/vsynth1/mpeg2reuse.mpg +92ced6afe8c02304943c400cce51a5f4 *./tests/data/mpeg2thread.vsynth1.out.yuv +stddev: 7.66 PSNR: 30.44 MAXDIFF: 111 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg4 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg4 new file mode 100644 index 00000000..76b39048 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg4 @@ -0,0 +1,4 @@ +fd83f2ef5887a62b4d755d7cb5f0ac59 *./tests/data/vsynth1/odivx.mp4 +540144 ./tests/data/vsynth1/odivx.mp4 +8828a375448dc5c2215163ba70656f89 *./tests/data/mpeg4.vsynth1.out.yuv +stddev: 7.97 PSNR: 30.10 MAXDIFF: 105 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg4adv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg4adv new file mode 100644 index 00000000..d6143102 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg4adv @@ -0,0 +1,16 @@ +7d8eb01fd68d83d62a98585757704d47 *./tests/data/vsynth1/mpeg4-adv.avi +589716 ./tests/data/vsynth1/mpeg4-adv.avi +f8b226876b1b2c0b98fd6928fd9adbd8 *./tests/data/mpeg4adv.vsynth1.out.yuv +stddev: 6.98 PSNR: 31.25 MAXDIFF: 84 bytes: 7603200/ 7603200 +d6b7e724a6ad66ab5e4c5a499218b40d *./tests/data/vsynth1/mpeg4-qprd.avi +710944 ./tests/data/vsynth1/mpeg4-qprd.avi +e65f4c7f343fe2bad1cac44b7da5f7c4 *./tests/data/mpeg4adv.vsynth1.out.yuv +stddev: 9.79 PSNR: 28.31 MAXDIFF: 176 bytes: 7603200/ 7603200 +2d870c0da9ab2231ab5fc06981e70399 *./tests/data/vsynth1/mpeg4-adap.avi +403456 ./tests/data/vsynth1/mpeg4-adap.avi +fa2049396479b5f170aa764fed5b2a31 *./tests/data/mpeg4adv.vsynth1.out.yuv +stddev: 14.05 PSNR: 25.17 MAXDIFF: 184 bytes: 7603200/ 7603200 +3bf17c3d04f52988386ce106a2a58976 *./tests/data/vsynth1/mpeg4-Q.avi +860678 ./tests/data/vsynth1/mpeg4-Q.avi +756928496245ecc701f79eebeec8e5e6 *./tests/data/mpeg4adv.vsynth1.out.yuv +stddev: 5.63 PSNR: 33.12 MAXDIFF: 70 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg4nr b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg4nr new file mode 100644 index 00000000..c8214903 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg4nr @@ -0,0 +1,4 @@ +c02f54157ba08ca12ad979c6308212ad *./tests/data/vsynth1/mpeg4-nr.avi +675638 ./tests/data/vsynth1/mpeg4-nr.avi +d2b89d5958fb7331f6c9e5b7ecaaa5b6 *./tests/data/mpeg4nr.vsynth1.out.yuv +stddev: 6.99 PSNR: 31.23 MAXDIFF: 86 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg4thread b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg4thread new file mode 100644 index 00000000..d04f4368 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/mpeg4thread @@ -0,0 +1,4 @@ +4f4ea04faad7212374919aa1ec7ff994 *./tests/data/vsynth1/mpeg4-thread.avi +774760 ./tests/data/vsynth1/mpeg4-thread.avi +64b96cddf5301990e118978b3a3bcd0d *./tests/data/mpeg4thread.vsynth1.out.yuv +stddev: 10.13 PSNR: 28.02 MAXDIFF: 183 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/msmpeg4 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/msmpeg4 new file mode 100644 index 00000000..d94d3f09 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/msmpeg4 @@ -0,0 +1,4 @@ +4b08952b0afceb17ee3db31b67f6b778 *./tests/data/vsynth1/msmpeg4.avi +624718 ./tests/data/vsynth1/msmpeg4.avi +5ca72c39e3fc5df8e62f223c869589f5 *./tests/data/msmpeg4.vsynth1.out.yuv +stddev: 7.98 PSNR: 30.09 MAXDIFF: 104 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/msmpeg4v2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/msmpeg4v2 new file mode 100644 index 00000000..dde152d8 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/msmpeg4v2 @@ -0,0 +1,4 @@ +88957e35efcc718bce0307627ad3298d *./tests/data/vsynth1/msmpeg4v2.avi +623788 ./tests/data/vsynth1/msmpeg4v2.avi +c6ff1041a0ef62c2a2e5ef519e5e94c4 *./tests/data/msmpeg4v2.vsynth1.out.yuv +stddev: 7.97 PSNR: 30.10 MAXDIFF: 105 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/qtrle b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/qtrle new file mode 100644 index 00000000..8aa578fc --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/qtrle @@ -0,0 +1,4 @@ +3f070779d7deb54626515ac7f7002e63 *./tests/data/vsynth1/qtrle.mov +387772 ./tests/data/vsynth1/qtrle.mov +a3c2610e2c069c3ad22ec03da83f774f *./tests/data/qtrle.vsynth1.out.yuv +stddev: 15.14 PSNR: 24.53 MAXDIFF: 174 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/rc b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/rc new file mode 100644 index 00000000..be509520 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/rc @@ -0,0 +1,4 @@ +1c6dadf75f60f4ba59a0fe0b6eaedf57 *./tests/data/vsynth1/mpeg4-rc.avi +830160 ./tests/data/vsynth1/mpeg4-rc.avi +4d95e340db9bc57a559162c039f3784e *./tests/data/rc.vsynth1.out.yuv +stddev: 10.24 PSNR: 27.92 MAXDIFF: 196 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/rgb b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/rgb new file mode 100644 index 00000000..10a0a133 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/rgb @@ -0,0 +1,4 @@ +05f0719cb52486d9a4beb9cfae3f2571 *./tests/data/vsynth1/rgb.avi +15213260 ./tests/data/vsynth1/rgb.avi +243325fb2cae1a9245efd49aff936327 *./tests/data/rgb.vsynth1.out.yuv +stddev: 3.42 PSNR: 37.43 MAXDIFF: 48 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/roq b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/roq new file mode 100644 index 00000000..42456e4e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/roq @@ -0,0 +1,4 @@ +cf8b7b0e539bab3169c234ca63d71dd8 *./tests/data/vsynth1/roqav.roq +101671 ./tests/data/vsynth1/roqav.roq +0ad983c291b1ed373645c5b12a108c61 *./tests/data/roq.vsynth1.out.yuv +stddev: 7.74 PSNR: 30.35 MAXDIFF: 89 bytes: 760320/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/rv10 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/rv10 new file mode 100644 index 00000000..9e0ceec2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/rv10 @@ -0,0 +1,4 @@ +4d7e82de72a83905cf84b8abc3e70b8f *./tests/data/vsynth1/rv10.rm +653905 ./tests/data/vsynth1/rv10.rm +1a1ba9a3a63ec1a1a9585fded0a7c954 *./tests/data/rv10.vsynth1.out.yuv +stddev: 8.03 PSNR: 30.03 MAXDIFF: 103 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/rv20 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/rv20 new file mode 100644 index 00000000..d3b8814f --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/rv20 @@ -0,0 +1,4 @@ +81868601e602eee5b6d80f5ece4aaa98 *./tests/data/vsynth1/rv20.rm +646016 ./tests/data/vsynth1/rv20.rm +b45fdb0201b06f7649f44050e262c54c *./tests/data/rv20.vsynth1.out.yuv +stddev: 8.26 PSNR: 29.79 MAXDIFF: 103 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/snow b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/snow new file mode 100644 index 00000000..ac347607 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/snow @@ -0,0 +1,4 @@ +d593b3c1a9729ce6dd1721f58fa93712 *./tests/data/vsynth1/snow.avi +136088 ./tests/data/vsynth1/snow.avi +91021b7d6d7908648fe78cc1975af8c4 *./tests/data/snow.vsynth1.out.yuv +stddev: 22.77 PSNR: 20.98 MAXDIFF: 172 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/snowll b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/snowll new file mode 100644 index 00000000..427e52de --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/snowll @@ -0,0 +1,4 @@ +6d29e8c06a645cdee45073c4f3d0004e *./tests/data/vsynth1/snow53.avi +3419980 ./tests/data/vsynth1/snow53.avi +c5ccac874dbf808e9088bc3107860042 *./tests/data/snowll.vsynth1.out.yuv +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/svq1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/svq1 new file mode 100644 index 00000000..8c647c78 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/svq1 @@ -0,0 +1,4 @@ +595fc4e38734521356b60e67b813f0fa *./tests/data/vsynth1/svq1.mov +1334367 ./tests/data/vsynth1/svq1.mov +9cc35c54b2c77d36bd7e308b393c1f81 *./tests/data/svq1.vsynth1.out.yuv +stddev: 9.58 PSNR: 28.50 MAXDIFF: 210 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/wmv1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/wmv1 new file mode 100644 index 00000000..8c32ea80 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/wmv1 @@ -0,0 +1,4 @@ +4f3461315776e5118866fa3819cff9b6 *./tests/data/vsynth1/wmv1.avi +626908 ./tests/data/vsynth1/wmv1.avi +5182edba5b5e0354b39ce4f3604b62da *./tests/data/wmv1.vsynth1.out.yuv +stddev: 7.97 PSNR: 30.09 MAXDIFF: 110 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/wmv2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/wmv2 new file mode 100644 index 00000000..8e1e88d6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/wmv2 @@ -0,0 +1,4 @@ +13efda9d3811345aadc0632fc9a9332b *./tests/data/vsynth1/wmv2.avi +659852 ./tests/data/vsynth1/wmv2.avi +5182edba5b5e0354b39ce4f3604b62da *./tests/data/wmv2.vsynth1.out.yuv +stddev: 7.97 PSNR: 30.09 MAXDIFF: 110 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/yuv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/yuv new file mode 100644 index 00000000..b98dda50 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth1/yuv @@ -0,0 +1,4 @@ +aa6b9e862aebcf8902a6d770e7729d59 *./tests/data/vsynth1/yuv.avi +7610060 ./tests/data/vsynth1/yuv.avi +c5ccac874dbf808e9088bc3107860042 *./tests/data/yuv.vsynth1.out.yuv +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/asv1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/asv1 new file mode 100644 index 00000000..1d0385c9 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/asv1 @@ -0,0 +1,4 @@ +4eb34d2de25f67a2706456e999338fe9 *./tests/data/vsynth2/asv1.avi +832512 ./tests/data/vsynth2/asv1.avi +c96ff7fd17c52f99ddb7922a4cb9168f *./tests/data/asv1.vsynth2.out.yuv +stddev: 10.47 PSNR: 27.73 MAXDIFF: 98 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/asv2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/asv2 new file mode 100644 index 00000000..21ce40aa --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/asv2 @@ -0,0 +1,4 @@ +9649a4b68fb1107bad13e8a7574cc72d *./tests/data/vsynth2/asv2.avi +789072 ./tests/data/vsynth2/asv2.avi +74a78015b64b2cf8cb9da2e44f508a69 *./tests/data/asv2.vsynth2.out.yuv +stddev: 10.28 PSNR: 27.89 MAXDIFF: 95 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dnxhd_1080i b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dnxhd_1080i new file mode 100644 index 00000000..3dc0ef5e --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dnxhd_1080i @@ -0,0 +1,4 @@ +c81c7cfb375f61b7ab9b60fa340fe52a *./tests/data/vsynth2/dnxhd-1080i.mov +3031875 ./tests/data/vsynth2/dnxhd-1080i.mov +3c559af629ae0a8fb1a9a0e4b4da7733 *./tests/data/dnxhd_1080i.vsynth2.out.yuv +stddev: 1.31 PSNR: 45.77 MAXDIFF: 23 bytes: 760320/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dnxhd_720p b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dnxhd_720p new file mode 100644 index 00000000..eab04c60 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dnxhd_720p @@ -0,0 +1,4 @@ +58e07cc6ae0a2d36787044d0e82708a6 *./tests/data/vsynth2/dnxhd-720p.dnxhd +2293760 ./tests/data/vsynth2/dnxhd-720p.dnxhd +ab601eaafef74d80d3d20b780dddd836 *./tests/data/dnxhd_720p.vsynth2.out.yuv +stddev: 1.36 PSNR: 45.45 MAXDIFF: 127 bytes: 760320/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dnxhd_720p_rd b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dnxhd_720p_rd new file mode 100644 index 00000000..2d5c4d55 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dnxhd_720p_rd @@ -0,0 +1,4 @@ +092ffb7b8cf3c11556bb05dbb8b476ac *./tests/data/vsynth2/dnxhd-720p-rd.dnxhd +2293760 ./tests/data/vsynth2/dnxhd-720p-rd.dnxhd +33547ca318acff9448cba719cb99296d *./tests/data/dnxhd_720p_rd.vsynth2.out.yuv +stddev: 1.32 PSNR: 45.66 MAXDIFF: 22 bytes: 760320/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dv new file mode 100644 index 00000000..676b209c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dv @@ -0,0 +1,8 @@ +bfa766f89bfeabc0ae1044f3954bed52 *./tests/data/vsynth2/dv.dv +7200000 ./tests/data/vsynth2/dv.dv +7ec62bd3350a6848364669e6e1e4b9cc *./tests/data/dv.vsynth2.out.yuv +stddev: 1.71 PSNR: 43.47 MAXDIFF: 33 bytes: 7603200/ 7603200 +00a9d8683ac6826af41bcf7223fb0389 *./tests/data/vsynth2/dv411.dv +7200000 ./tests/data/vsynth2/dv411.dv +7f9fa421028aabb11eaf4c6513a5a843 *./tests/data/dv.vsynth2.out.yuv +stddev: 10.09 PSNR: 28.05 MAXDIFF: 60 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dv50 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dv50 new file mode 100644 index 00000000..7e0083bf --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/dv50 @@ -0,0 +1,4 @@ +61e31c79e8949b25c849753a0785b0d7 *./tests/data/vsynth2/dv50.dv +14400000 ./tests/data/vsynth2/dv50.dv +af3f2dd5ab62c1a1d98b07d4aeb6852f *./tests/data/dv50.vsynth2.out.yuv +stddev: 0.82 PSNR: 49.82 MAXDIFF: 12 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/error b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/error new file mode 100644 index 00000000..4181b2d2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/error @@ -0,0 +1,4 @@ +90e65096aa9ebafa3fe3f44a5a47cdc4 *./tests/data/vsynth2/error-mpeg4-adv.avi +176588 ./tests/data/vsynth2/error-mpeg4-adv.avi +9fe1082179f80179439953c7397a46ef *./tests/data/error.vsynth2.out.yuv +stddev: 9.00 PSNR: 29.04 MAXDIFF: 168 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/ffv1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/ffv1 new file mode 100644 index 00000000..d251af55 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/ffv1 @@ -0,0 +1,4 @@ +d72b0960e162d4998b9acbabb07e99ab *./tests/data/vsynth2/ffv1.avi +3525804 ./tests/data/vsynth2/ffv1.avi +dde5895817ad9d219f79a52d0bdfb001 *./tests/data/ffv1.vsynth2.out.yuv +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/flashsv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/flashsv new file mode 100644 index 00000000..bfbb9e1c --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/flashsv @@ -0,0 +1,4 @@ +0667077971e0cb63b5f49c580006e90e *./tests/data/vsynth2/flashsv.flv +12368953 ./tests/data/vsynth2/flashsv.flv +592b3321994e26a990deb3a0a1415de9 *./tests/data/flashsv.vsynth2.out.yuv +stddev: 0.65 PSNR: 51.84 MAXDIFF: 14 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/flv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/flv new file mode 100644 index 00000000..716177fb --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/flv @@ -0,0 +1,4 @@ +2edc92093d36506bcc0a5c0e17e86113 *./tests/data/vsynth2/flv.flv +131360 ./tests/data/vsynth2/flv.flv +8999c8264fb0941561f64c4a736e9d88 *./tests/data/flv.vsynth2.out.yuv +stddev: 5.33 PSNR: 33.59 MAXDIFF: 80 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/h261 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/h261 new file mode 100644 index 00000000..07c29ab6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/h261 @@ -0,0 +1,4 @@ +dfd005d4c9030a0dc889c828a6408b9c *./tests/data/vsynth2/h261.avi +191086 ./tests/data/vsynth2/h261.avi +db7ceff174823b98834faa2320ca89ac *./tests/data/h261.vsynth2.out.yuv +stddev: 6.37 PSNR: 32.03 MAXDIFF: 77 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/h263 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/h263 new file mode 100644 index 00000000..7e3fd334 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/h263 @@ -0,0 +1,4 @@ +9a368687ab34c48079f11a202839a6bc *./tests/data/vsynth2/h263.avi +160106 ./tests/data/vsynth2/h263.avi +61213b91b359697ebcefb9e0a53ac54a *./tests/data/h263.vsynth2.out.yuv +stddev: 5.43 PSNR: 33.42 MAXDIFF: 77 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/h263p b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/h263p new file mode 100644 index 00000000..314726fd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/h263p @@ -0,0 +1,4 @@ +c7644d40e9f40bbd98e5a978f9f94bb4 *./tests/data/vsynth2/h263p.avi +868018 ./tests/data/vsynth2/h263p.avi +4b0ee791f280029dc03c528f76f195d4 *./tests/data/h263p.vsynth2.out.yuv +stddev: 1.91 PSNR: 42.50 MAXDIFF: 19 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/huffyuv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/huffyuv new file mode 100644 index 00000000..740862ab --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/huffyuv @@ -0,0 +1,4 @@ +56cd44907a48990e06bd065e189ff461 *./tests/data/vsynth2/huffyuv.avi +6455232 ./tests/data/vsynth2/huffyuv.avi +dde5895817ad9d219f79a52d0bdfb001 *./tests/data/huffyuv.vsynth2.out.yuv +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/jpegls b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/jpegls new file mode 100644 index 00000000..e7fa2df4 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/jpegls @@ -0,0 +1,4 @@ +4fc53937f048c900ae6d50fda9dba206 *./tests/data/vsynth2/jpegls.avi +8334630 ./tests/data/vsynth2/jpegls.avi +592b3321994e26a990deb3a0a1415de9 *./tests/data/jpegls.vsynth2.out.yuv +stddev: 0.65 PSNR: 51.84 MAXDIFF: 14 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/ljpeg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/ljpeg new file mode 100644 index 00000000..54c1d864 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/ljpeg @@ -0,0 +1,4 @@ +554a4a6a5a9058c588f8bf2de405bc70 *./tests/data/vsynth2/ljpeg.avi +4766914 ./tests/data/vsynth2/ljpeg.avi +dde5895817ad9d219f79a52d0bdfb001 *./tests/data/ljpeg.vsynth2.out.yuv +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mjpeg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mjpeg new file mode 100644 index 00000000..adee3280 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mjpeg @@ -0,0 +1,4 @@ +89df32b46c977fb4cb140ec6c489dd76 *./tests/data/vsynth2/mjpeg.avi +673224 ./tests/data/vsynth2/mjpeg.avi +a96a4e15ffcb13e44360df642d049496 *./tests/data/mjpeg.vsynth2.out.yuv +stddev: 4.32 PSNR: 35.40 MAXDIFF: 49 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg new file mode 100644 index 00000000..5a051c8a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg @@ -0,0 +1,4 @@ +73ca6f1deab02d1d67a0e8495c026a9e *./tests/data/vsynth2/mpeg1.mpg +192783 ./tests/data/vsynth2/mpeg1.mpg +56147e94b12f08df7213e610e177823d *./tests/data/mpeg.vsynth2.out.yuv +stddev: 4.95 PSNR: 34.22 MAXDIFF: 57 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg1b b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg1b new file mode 100644 index 00000000..f51aa3fd --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg1b @@ -0,0 +1,4 @@ +e026a2fef80c9679776d2b5c8be09338 *./tests/data/vsynth2/mpeg1b.mpg +225198 ./tests/data/vsynth2/mpeg1b.mpg +1150495f4bd487486ee53326c42d0bb8 *./tests/data/mpeg1b.vsynth2.out.yuv +stddev: 4.10 PSNR: 35.86 MAXDIFF: 59 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg2 new file mode 100644 index 00000000..a6ab3f6b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg2 @@ -0,0 +1,20 @@ +2d55ce623a7be4e8136f80266e487678 *./tests/data/vsynth2/mpeg2.mpg +198667 ./tests/data/vsynth2/mpeg2.mpg +b7cae8a1f751b821cddcbe4d5dbc518c *./tests/data/mpeg2.vsynth2.out.yuv +stddev: 4.96 PSNR: 34.20 MAXDIFF: 59 bytes: 7603200/ 7603200 +1ba5efeb53fab7b4b71edc96d86f6c91 *./tests/data/vsynth2/mpeg2ivlc-qprd.mpg +244694 ./tests/data/vsynth2/mpeg2ivlc-qprd.mpg +b26e21599dee48a174bdbc40b2817e55 *./tests/data/mpeg2.vsynth2.out.yuv +stddev: 4.15 PSNR: 35.76 MAXDIFF: 74 bytes: 7603200/ 7603200 +2c8e33c2d2efab86fc16a195f6877682 *./tests/data/vsynth2/mpeg2_422.mpg +356124 ./tests/data/vsynth2/mpeg2_422.mpg +de44597c6c470f3e7019b31245a3ff69 *./tests/data/mpeg2.vsynth2.out.yuv +stddev: 54.55 PSNR: 13.39 MAXDIFF: 201 bytes: 10137600/ 7603200 +f979bcca866e6e4cad5dc6cb06e56cfb *./tests/data/vsynth2/mpeg2.mpg +198041 ./tests/data/vsynth2/mpeg2.mpg +f6d9bf24ff8676a7f6076c05cd2c81a3 *./tests/data/mpeg2.vsynth2.out.yuv +stddev: 4.97 PSNR: 34.19 MAXDIFF: 58 bytes: 7603200/ 7603200 +f90197a8b6e62ae25f82625337f27240 *./tests/data/vsynth2/mpeg2i.mpg +204579 ./tests/data/vsynth2/mpeg2i.mpg +ea5057b60146c06d40449cdfc686bf13 *./tests/data/mpeg2.vsynth2.out.yuv +stddev: 4.98 PSNR: 34.18 MAXDIFF: 65 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg2thread b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg2thread new file mode 100644 index 00000000..3c9c0d01 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg2thread @@ -0,0 +1,12 @@ +889c754a42d7689b228853e1ece6d345 *./tests/data/vsynth2/mpeg2thread.mpg +179650 ./tests/data/vsynth2/mpeg2thread.mpg +8c6a7ed2eb73bd18fd2bb9829464100d *./tests/data/mpeg2thread.vsynth2.out.yuv +stddev: 4.72 PSNR: 34.65 MAXDIFF: 72 bytes: 7603200/ 7603200 +10b900e32809758857c596d56746e00e *./tests/data/vsynth2/mpeg2threadivlc.mpg +178801 ./tests/data/vsynth2/mpeg2threadivlc.mpg +8c6a7ed2eb73bd18fd2bb9829464100d *./tests/data/mpeg2thread.vsynth2.out.yuv +stddev: 4.72 PSNR: 34.65 MAXDIFF: 72 bytes: 7603200/ 7603200 +864d6bf2982a61e510003a518be65a2d *./tests/data/vsynth2/mpeg2reuse.mpg +383419 ./tests/data/vsynth2/mpeg2reuse.mpg +bb20fa080cfd2b0a687ea7376ff4f902 *./tests/data/mpeg2thread.vsynth2.out.yuv +stddev: 4.73 PSNR: 34.63 MAXDIFF: 72 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg4 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg4 new file mode 100644 index 00000000..9a6158c6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg4 @@ -0,0 +1,4 @@ +47de227982e77830a2db278214a08773 *./tests/data/vsynth2/odivx.mp4 +119797 ./tests/data/vsynth2/odivx.mp4 +90a3577850239083a9042bef33c50e85 *./tests/data/mpeg4.vsynth2.out.yuv +stddev: 5.34 PSNR: 33.57 MAXDIFF: 83 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg4adv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg4adv new file mode 100644 index 00000000..f8568c78 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg4adv @@ -0,0 +1,16 @@ +dee7be19486a76d96c88d18eefba8f86 *./tests/data/vsynth2/mpeg4-adv.avi +141546 ./tests/data/vsynth2/mpeg4-adv.avi +3f3a21e9db85a9c0f7022f557a5374c1 *./tests/data/mpeg4adv.vsynth2.out.yuv +stddev: 4.94 PSNR: 34.25 MAXDIFF: 69 bytes: 7603200/ 7603200 +fd5ab0f55dbc959316e32923e86290df *./tests/data/vsynth2/mpeg4-qprd.avi +231458 ./tests/data/vsynth2/mpeg4-qprd.avi +de8a883865e2dff7a51f66da6c48df48 *./tests/data/mpeg4adv.vsynth2.out.yuv +stddev: 3.71 PSNR: 36.72 MAXDIFF: 61 bytes: 7603200/ 7603200 +547e1849dcf910935ff6383ca49e5706 *./tests/data/vsynth2/mpeg4-adap.avi +198510 ./tests/data/vsynth2/mpeg4-adap.avi +4affb83f6adc94f31024b4f9e0168945 *./tests/data/mpeg4adv.vsynth2.out.yuv +stddev: 3.75 PSNR: 36.65 MAXDIFF: 71 bytes: 7603200/ 7603200 +7680d2e7d34399dfdfb8a49cf1e10239 *./tests/data/vsynth2/mpeg4-Q.avi +163688 ./tests/data/vsynth2/mpeg4-Q.avi +26dc7c78955fa678fbf150e236eb5627 *./tests/data/mpeg4adv.vsynth2.out.yuv +stddev: 3.97 PSNR: 36.14 MAXDIFF: 54 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg4nr b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg4nr new file mode 100644 index 00000000..ec36d27b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg4nr @@ -0,0 +1,4 @@ +c41187c99588fb7229ad330b2f80d28b *./tests/data/vsynth2/mpeg4-nr.avi +155044 ./tests/data/vsynth2/mpeg4-nr.avi +f7fc191308679f709405e62271f5c65f *./tests/data/mpeg4nr.vsynth2.out.yuv +stddev: 4.73 PSNR: 34.63 MAXDIFF: 64 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg4thread b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg4thread new file mode 100644 index 00000000..63f355ba --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/mpeg4thread @@ -0,0 +1,4 @@ +ba30d10ff70d46e7c5b7fa859ea1faa4 *./tests/data/vsynth2/mpeg4-thread.avi +250140 ./tests/data/vsynth2/mpeg4-thread.avi +5355deb8c7609a3f1ff2173aab1dee70 *./tests/data/mpeg4thread.vsynth2.out.yuv +stddev: 3.69 PSNR: 36.78 MAXDIFF: 65 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/msmpeg4 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/msmpeg4 new file mode 100644 index 00000000..76202737 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/msmpeg4 @@ -0,0 +1,4 @@ +26dee25a62a66daba4f38ac6bd8f4677 *./tests/data/vsynth2/msmpeg4.avi +127680 ./tests/data/vsynth2/msmpeg4.avi +0e1c6e25c71c6a8fa8e506e3d97ca4c9 *./tests/data/msmpeg4.vsynth2.out.yuv +stddev: 5.33 PSNR: 33.59 MAXDIFF: 78 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/msmpeg4v2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/msmpeg4v2 new file mode 100644 index 00000000..9fe913d6 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/msmpeg4v2 @@ -0,0 +1,4 @@ +c09815e40a9d260628e1ebad8b2b3774 *./tests/data/vsynth2/msmpeg4v2.avi +129918 ./tests/data/vsynth2/msmpeg4v2.avi +8920194f8bf8f9cdd6c65b3df9e1a292 *./tests/data/msmpeg4v2.vsynth2.out.yuv +stddev: 5.33 PSNR: 33.59 MAXDIFF: 80 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/qtrle b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/qtrle new file mode 100644 index 00000000..756ed693 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/qtrle @@ -0,0 +1,4 @@ +5346bba8e03e7de72b482efbcf712a2e *./tests/data/vsynth2/qtrle.mov +141533 ./tests/data/vsynth2/qtrle.mov +f967b290c7e6d015c0e78175db828249 *./tests/data/qtrle.vsynth2.out.yuv +stddev: 5.75 PSNR: 32.93 MAXDIFF: 92 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/rc b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/rc new file mode 100644 index 00000000..14d9a6ce --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/rc @@ -0,0 +1,4 @@ +c25ede9e268b834a09a63f5136cd1b95 *./tests/data/vsynth2/mpeg4-rc.avi +226332 ./tests/data/vsynth2/mpeg4-rc.avi +2b34e606af895b62a250de98749a19b0 *./tests/data/rc.vsynth2.out.yuv +stddev: 4.23 PSNR: 35.60 MAXDIFF: 85 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/rgb b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/rgb new file mode 100644 index 00000000..ea834708 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/rgb @@ -0,0 +1,4 @@ +f2e9c419023c743bf99aa5b2e55ad233 *./tests/data/vsynth2/rgb.avi +15213260 ./tests/data/vsynth2/rgb.avi +b2418e0e3a9a8619b31219cbcf24dc82 *./tests/data/rgb.vsynth2.out.yuv +stddev: 1.26 PSNR: 46.06 MAXDIFF: 13 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/roq b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/roq new file mode 100644 index 00000000..a9650dee --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/roq @@ -0,0 +1,4 @@ +b46f899b2363065c60f3782ba1f8b7bd *./tests/data/vsynth2/roqav.roq +92786 ./tests/data/vsynth2/roqav.roq +e69fca960dd0911e9b8d589c13e11dc1 *./tests/data/roq.vsynth2.out.yuv +stddev: 3.81 PSNR: 36.49 MAXDIFF: 54 bytes: 760320/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/rv10 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/rv10 new file mode 100644 index 00000000..75b92652 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/rv10 @@ -0,0 +1,4 @@ +b1467b0e8d8cad730e36d1e8ab49d573 *./tests/data/vsynth2/rv10.rm +154310 ./tests/data/vsynth2/rv10.rm +61213b91b359697ebcefb9e0a53ac54a *./tests/data/rv10.vsynth2.out.yuv +stddev: 5.43 PSNR: 33.42 MAXDIFF: 77 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/rv20 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/rv20 new file mode 100644 index 00000000..903881f2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/rv20 @@ -0,0 +1,4 @@ +96acb098850b9bf309f89e48b08fe96f *./tests/data/vsynth2/rv20.rm +153302 ./tests/data/vsynth2/rv20.rm +46f314e70d9bac2e7d82cfc230534977 *./tests/data/rv20.vsynth2.out.yuv +stddev: 5.48 PSNR: 33.35 MAXDIFF: 81 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/snow b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/snow new file mode 100644 index 00000000..922110bf --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/snow @@ -0,0 +1,4 @@ +af651d8ef0a66257ac8b2ef8b229f27b *./tests/data/vsynth2/snow.avi +57700 ./tests/data/vsynth2/snow.avi +8890189af71a0dd3447c4e8424c9a76b *./tests/data/snow.vsynth2.out.yuv +stddev: 10.47 PSNR: 27.72 MAXDIFF: 119 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/snowll b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/snowll new file mode 100644 index 00000000..0eb49451 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/snowll @@ -0,0 +1,4 @@ +a8fccf278bbb17d37a756ecf11672b09 *./tests/data/vsynth2/snow53.avi +2721758 ./tests/data/vsynth2/snow53.avi +dde5895817ad9d219f79a52d0bdfb001 *./tests/data/snowll.vsynth2.out.yuv +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/svq1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/svq1 new file mode 100644 index 00000000..7c54c74a --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/svq1 @@ -0,0 +1,4 @@ +7f9fbe4890bc1df67867bf03803dca48 *./tests/data/vsynth2/svq1.mov +766851 ./tests/data/vsynth2/svq1.mov +aa03471dac3f49455a33a2b19fda1098 *./tests/data/svq1.vsynth2.out.yuv +stddev: 3.23 PSNR: 37.93 MAXDIFF: 61 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/wmv1 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/wmv1 new file mode 100644 index 00000000..12c3f576 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/wmv1 @@ -0,0 +1,4 @@ +1011e26e7d351c96d7bbfe106d831b69 *./tests/data/vsynth2/wmv1.avi +129530 ./tests/data/vsynth2/wmv1.avi +81eee429b665254d19a06607463c0b5e *./tests/data/wmv1.vsynth2.out.yuv +stddev: 5.33 PSNR: 33.60 MAXDIFF: 77 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/wmv2 b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/wmv2 new file mode 100644 index 00000000..27fcd128 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/wmv2 @@ -0,0 +1,4 @@ +1f6598e9776ed00aebdc44cc8d48cb7c *./tests/data/vsynth2/wmv2.avi +129860 ./tests/data/vsynth2/wmv2.avi +81eee429b665254d19a06607463c0b5e *./tests/data/wmv2.vsynth2.out.yuv +stddev: 5.33 PSNR: 33.60 MAXDIFF: 77 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/yuv b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/yuv new file mode 100644 index 00000000..6593ce9b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/ref/vsynth2/yuv @@ -0,0 +1,4 @@ +30a400773ab26f2c83e469198b156f1d *./tests/data/vsynth2/yuv.avi +7610060 ./tests/data/vsynth2/yuv.avi +dde5895817ad9d219f79a52d0bdfb001 *./tests/data/yuv.vsynth2.out.yuv +stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/regression-funcs.sh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/regression-funcs.sh new file mode 100755 index 00000000..3ca3c9c7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tests/regression-funcs.sh @@ -0,0 +1,139 @@ +#!/bin/sh +# +# common regression functions for ffmpeg +# +# + +test="${1#regtest-}" +test_ref=$2 +raw_src_dir=$3 +target_exec=$4 +target_path=$5 + +datadir="./tests/data" +target_datadir="${target_path}/${datadir}" + +this="$test.$test_ref" +logdir="$datadir/regression/$test_ref" +logfile="$logdir/$test" +outfile="$datadir/$test_ref/" +errfile="$datadir/$this.err" + +# various files +ffmpeg="$target_exec ${target_path}/ffmpeg" +tiny_psnr="tests/tiny_psnr" +benchfile="$datadir/$this.bench" +bench="$datadir/$this.bench.tmp" +bench2="$datadir/$this.bench2.tmp" +raw_src="${target_path}/$raw_src_dir/%02d.pgm" +raw_dst="$datadir/$this.out.yuv" +raw_ref="$datadir/$test_ref.ref.yuv" +pcm_src="$target_datadir/asynth1.sw" +pcm_dst="$datadir/$this.out.wav" +pcm_ref="$datadir/$test_ref.ref.wav" +crcfile="$datadir/$this.crc" +target_crcfile="$target_datadir/$this.crc" + +cleanfiles="$raw_dst $pcm_dst $crcfile $bench $bench2" +trap 'rm -f -- $cleanfiles' EXIT + +mkdir -p "$datadir" +mkdir -p "$outfile" +mkdir -p "$logdir" + +(exec >&3) 2>/dev/null || exec 3>&2 + +[ "${V-0}" -gt 0 ] && echov=echov || echov=: +[ "${V-0}" -gt 1 ] || exec 2>$errfile + +echov(){ + echo "$@" >&3 +} + +. $(dirname $0)/md5.sh + +FFMPEG_OPTS="-v 0 -y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact" + +run_ffmpeg() +{ + $echov $ffmpeg $FFMPEG_OPTS $* + $ffmpeg $FFMPEG_OPTS $* +} + +do_ffmpeg() +{ + f="$1" + shift + set -- $* ${target_path}/$f + $echov $ffmpeg $FFMPEG_OPTS $* + $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench + do_md5sum $f >> $logfile + if [ $f = $raw_dst ] ; then + $tiny_psnr $f $raw_ref >> $logfile + elif [ $f = $pcm_dst ] ; then + $tiny_psnr $f $pcm_ref 2 >> $logfile + else + wc -c $f >> $logfile + fi + expr "$(cat $bench)" : '.*utime=\(.*s\)' > $bench2 + echo $(cat $bench2) $f >> $benchfile +} + +do_ffmpeg_nomd5() +{ + f="$1" + shift + set -- $* ${target_path}/$f + $echov $ffmpeg $FFMPEG_OPTS $* + $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench + if [ $f = $raw_dst ] ; then + $tiny_psnr $f $raw_ref >> $logfile + elif [ $f = $pcm_dst ] ; then + $tiny_psnr $f $pcm_ref 2 >> $logfile + else + wc -c $f >> $logfile + fi + expr "$(cat $bench)" : '.*utime=\(.*s\)' > $bench2 + echo $(cat $bench2) $f >> $benchfile +} + +do_ffmpeg_crc() +{ + f="$1" + shift + $echov $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile" + $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile" + echo "$f $(cat $crcfile)" >> $logfile +} + +do_ffmpeg_nocheck() +{ + f="$1" + shift + $echov $ffmpeg $FFMPEG_OPTS $* + $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench + expr "$(cat $bench)" : '.*utime=\(.*s\)' > $bench2 + echo $(cat $bench2) $f >> $benchfile +} + +do_video_decoding() +{ + do_ffmpeg $raw_dst $1 -i $target_path/$file -f rawvideo $2 +} + +do_video_encoding() +{ + file=${outfile}$1 + do_ffmpeg $file $2 -f image2 -vcodec pgmyuv -i $raw_src $3 +} + +do_audio_encoding() +{ + file=${outfile}$1 + do_ffmpeg $file -ab 128k -ac 2 -f s16le -i $pcm_src $3 +} + +do_audio_decoding() +{ + do_ffmpeg $pcm_dst -i $target_path/$file -sample_fmt s16 -f wav +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tools/graph2dot.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tools/graph2dot.c new file mode 100644 index 00000000..5e0da9a5 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tools/graph2dot.c @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2008-2010 Stefano Sabatini + * + * 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 + */ + +#include /* getopt */ + +#undef HAVE_AV_CONFIG_H +#include "libavutil/pixdesc.h" +#include "libavfilter/avfiltergraph.h" + +static void usage(void) +{ + printf("Convert a libavfilter graph to a dot file\n"); + printf("Usage: graph2dot [OPTIONS]\n"); + printf("\n" + "Options:\n" + "-i INFILE set INFILE as input file, stdin if omitted\n" + "-o OUTFILE set OUTFILE as output file, stdout if omitted\n" + "-h print this help\n"); +} + +struct line { + char data[256]; + struct line *next; +}; + +static void print_digraph(FILE *outfile, AVFilterGraph *graph) +{ + int i, j; + + fprintf(outfile, "digraph G {\n"); + fprintf(outfile, "node [shape=box]\n"); + fprintf(outfile, "rankdir=LR\n"); + + for (i = 0; i < graph->filter_count; i++) { + char filter_ctx_label[128]; + const AVFilterContext *filter_ctx = graph->filters[i]; + + snprintf(filter_ctx_label, sizeof(filter_ctx_label), "%s (%s)", + filter_ctx->name, + filter_ctx->filter->name); + + for (j = 0; j < filter_ctx->output_count; j++) { + AVFilterLink *link = filter_ctx->outputs[j]; + if (link) { + char dst_filter_ctx_label[128]; + const AVFilterContext *dst_filter_ctx = link->dst; + + snprintf(dst_filter_ctx_label, sizeof(dst_filter_ctx_label), "%s (%s)", + dst_filter_ctx->name, + dst_filter_ctx->filter->name); + + fprintf(outfile, "\"%s\" -> \"%s\"", filter_ctx_label, dst_filter_ctx_label); + fprintf(outfile, " [ label= \"fmt:%s w:%d h:%d tb:%d/%d\" ];\n", + link->type == AVMEDIA_TYPE_VIDEO ? av_pix_fmt_descriptors[link->format].name : + link->type == AVMEDIA_TYPE_AUDIO ? av_get_sample_fmt_name(link->format) : "unknown", + link->w, link->h, link->time_base.num, link->time_base.den); + } + } + } + fprintf(outfile, "}\n"); +} + +int main(int argc, char **argv) +{ + const char *outfilename = NULL; + const char *infilename = NULL; + FILE *outfile = NULL; + FILE *infile = NULL; + char *graph_string = NULL; + AVFilterGraph *graph = av_mallocz(sizeof(AVFilterGraph)); + char c; + + av_log_set_level(AV_LOG_DEBUG); + + while ((c = getopt(argc, argv, "hi:o:")) != -1) { + switch(c) { + case 'h': + usage(); + return 0; + case 'i': + infilename = optarg; + break; + case 'o': + outfilename = optarg; + break; + case '?': + return 1; + } + } + + if (!infilename || !strcmp(infilename, "-")) + infilename = "/dev/stdin"; + infile = fopen(infilename, "r"); + if (!infile) { + fprintf(stderr, "Impossible to open input file '%s': %s\n", infilename, strerror(errno)); + return 1; + } + + if (!outfilename || !strcmp(outfilename, "-")) + outfilename = "/dev/stdout"; + outfile = fopen(outfilename, "w"); + if (!outfile) { + fprintf(stderr, "Impossible to open output file '%s': %s\n", outfilename, strerror(errno)); + return 1; + } + + /* read from infile and put it in a buffer */ + { + unsigned int count = 0; + struct line *line, *last_line, *first_line; + char *p; + last_line = first_line = av_malloc(sizeof(struct line)); + + while (fgets(last_line->data, sizeof(last_line->data), infile)) { + struct line *new_line = av_malloc(sizeof(struct line)); + count += strlen(last_line->data); + last_line->next = new_line; + last_line = new_line; + } + last_line->next = NULL; + + graph_string = av_malloc(count + 1); + p = graph_string; + for (line = first_line; line->next; line = line->next) { + unsigned int l = strlen(line->data); + memcpy(p, line->data, l); + p += l; + } + *p = '\0'; + } + + avfilter_register_all(); + + if (avfilter_graph_parse(graph, graph_string, NULL, NULL, NULL) < 0) { + fprintf(stderr, "Impossible to parse the graph description\n"); + return 1; + } + + if (avfilter_graph_config(graph, NULL) < 0) + return 1; + + print_digraph(outfile, graph); + fflush(outfile); + + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tools/jauche_sortierer.sh b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tools/jauche_sortierer.sh new file mode 100755 index 00000000..1f84f1a2 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tools/jauche_sortierer.sh @@ -0,0 +1,21 @@ +#!/bin/sh +#GPL +#TODO +#add pixelformat/sampleformat into the path of the codecs + +FFP=../ffprobe +TMP=$(mktemp) || exit 1 +TARGET=$1 +shift + +for v do + BASE=$(basename $v) + echo $v | egrep -i '(public|private)' >/dev/null && echo Warning $v may be private + $FFP $v 2> $TMP + FORM=$((grep 'Input #0, ' -m1 $TMP || echo 'Input #0, unknown') | sed 's/Input #0, \([a-zA-Z0-9_]*\).*/\1/' ) + mkdir -p $TARGET/container/$FORM + ln -s $v $TARGET/container/$FORM/$BASE + eval $(grep 'Stream #0\.[^:]*: [a-zA-Z0-9][^:]*: [a-zA-Z0-9]' $TMP | sed 's#[^:]*: \([a-zA-Z0-9]*\)[^:]*: \([a-zA-Z0-9]*\).*#mkdir -p '$TARGET'/\1/\2 ; ln -s '$v' '$TARGET'/\1/\2/'$BASE' ; #') +done + +rm $TMP diff --git a/xbmc/cores/dvdplayer/Codecs/ffmpeg/tools/lavfi-showfiltfmts.c b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tools/lavfi-showfiltfmts.c new file mode 100644 index 00000000..19bb6f68 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/ffmpeg/tools/lavfi-showfiltfmts.c @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2009 Stefano Sabatini + * + * 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 + */ + +#include "libavformat/avformat.h" +#include "libavutil/pixdesc.h" +#include "libavfilter/avfilter.h" + +int main(int argc, char **argv) +{ + AVFilter *filter; + AVFilterContext *filter_ctx; + const char *filter_name; + const char *filter_args = NULL; + int i, j; + + av_log_set_level(AV_LOG_DEBUG); + + if (!argv[1]) { + fprintf(stderr, "Missing filter name as argument\n"); + return 1; + } + + filter_name = argv[1]; + if (argv[2]) + filter_args = argv[2]; + + avfilter_register_all(); + + /* get a corresponding filter and open it */ + if (!(filter = avfilter_get_by_name(filter_name))) { + fprintf(stderr, "Unrecognized filter with name '%s'\n", filter_name); + return 1; + } + + if (avfilter_open(&filter_ctx, filter, NULL) < 0) { + fprintf(stderr, "Inpossible to open filter with name '%s'\n", filter_name); + return 1; + } + if (avfilter_init_filter(filter_ctx, filter_args, NULL) < 0) { + fprintf(stderr, "Impossible to init filter '%s' with arguments '%s'\n", filter_name, filter_args); + return 1; + } + + /* create a link for each of the input pads */ + for (i = 0; i < filter_ctx->input_count; i++) { + AVFilterLink *link = av_mallocz(sizeof(AVFilterLink)); + link->type = filter_ctx->filter->inputs[i].type; + filter_ctx->inputs[i] = link; + } + for (i = 0; i < filter_ctx->output_count; i++) { + AVFilterLink *link = av_mallocz(sizeof(AVFilterLink)); + link->type = filter_ctx->filter->outputs[i].type; + filter_ctx->outputs[i] = link; + } + + if (filter->query_formats) + filter->query_formats(filter_ctx); + else + avfilter_default_query_formats(filter_ctx); + + /* print the supported formats in input */ + for (i = 0; i < filter_ctx->input_count; i++) { + AVFilterFormats *fmts = filter_ctx->inputs[i]->out_formats; + for (j = 0; j < fmts->format_count; j++) + printf("INPUT[%d] %s: %s\n", + i, filter_ctx->filter->inputs[i].name, + av_pix_fmt_descriptors[fmts->formats[j]].name); + } + + /* print the supported formats in output */ + for (i = 0; i < filter_ctx->output_count; i++) { + AVFilterFormats *fmts = filter_ctx->outputs[i]->in_formats; + for (j = 0; j < fmts->format_count; j++) + printf("OUTPUT[%d] %s: %s\n", + i, filter_ctx->filter->outputs[i].name, + av_pix_fmt_descriptors[fmts->formats[j]].name); + } + + avfilter_free(filter_ctx); + fflush(stdout); + return 0; +} diff --git a/xbmc/cores/dvdplayer/Codecs/libdvd/libdvd.pro b/xbmc/cores/dvdplayer/Codecs/libdvd/libdvd.pro new file mode 100644 index 00000000..3d9771c7 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/libdvd/libdvd.pro @@ -0,0 +1,16 @@ +include(../../../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +SOURCES += \ + + +HEADERS += \ + + +INCLUDEPATH += ../../../../../ diff --git a/xbmc/cores/dvdplayer/Codecs/libfaad2/compile b/xbmc/cores/dvdplayer/Codecs/libfaad2/compile new file mode 100755 index 00000000..c0096a7b --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/libfaad2/compile @@ -0,0 +1,143 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2009-10-06.20; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software +# Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/xbmc/cores/dvdplayer/Codecs/libfaad2/frontend/faad.man b/xbmc/cores/dvdplayer/Codecs/libfaad2/frontend/faad.man new file mode 100644 index 00000000..f5d49227 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/libfaad2/frontend/faad.man @@ -0,0 +1,85 @@ +.TH FAAD "1" "October 2006" "faad 2.5" "" +.SH NAME +faad \(em Process an Advanced Audio Codec stream + +.SH "SYNOPSIS" +.B faad +[options] [\-w | \-o | \-a ] input_filename + +.SH "DESCRIPTION" +This utility provides a command line interface to libfaad2. This program reads in MPEG\(hy4 AAC files, processes, and outputs them in either Microsoft WAV, MPEG\(hy4 AAC ADTS, or standard PCM formats. + +.SH "OPTIONS" +.TP +.BI \-a " " ", \-\^\-adtsout" " " +Sets the processing to output to the specified file in MPEG\(hy4 AAC ADTS format +.TP +.BI \-b " " ", \-\^\-bits" " " +Set the output (individual) sample format. The number takes one of the following values: +.RS +.RS +1: 16\(hybit PCM data (default). +.br +2: 24\(hybit PCM data. +.br +3: 32\(hybit PCM data. +.br +4: 32\(hybit floating\hy(point data. +.br +5: 64\(hybit floating\hy(point data. +.RE +.RE +.TP +.B \-d ", \-\^\-downmix" +Set the processing to downsample from 5.1 (surround sound and bass) channels to 2 channels (stereo). +.TP +.BI \-f " " ", \-\^\-format" " " +Set the output file format. The number takes one of the following values: +.RS +.RS +1: Microsoft WAV format (default). +.br +2: Raw PCM data. +.RE +.RE +.TP +.BI \-g +Set the processing to not perform gapless decoding. +.TP +.B \-h ", \-\^\-help" +Shows a usage summary. +.TP +.B \-i ", \-\^\-info" +Shows information about the about the input file. +.TP +.BI \-l " " ", \-\^\-objecttype" " " +Sets the MPEG\hy(4 profile and object type for the processing to use. The number takes one of the following values: +.RS +.RS +1: Main object type. +.br +2: Low Complexity (LC) object type (default). +.br +4: Long Term Prediction (LTP) object type. +.br +23: Low Delay (LD) object type. +.RE +.RE +.TP +.BI \-o " " ", \-\^\-outfile" " " +Sets the filename for processing output. +.TP +.B \-q ", \-\^\-quiet" +Quiet \- Suppresses status messages during processing. +.TP +.B \-t ", \-\^\-oldformat" +Sets the processing to use the old MPEG\(hy4 AAC ADTS format when outputting in said format. +.TP +.B \-w ", \-\^\-stdio" +Sets the processing output to be sent to the standard out. + +.SH "AUTHOR" +Matthew W. S. Bell + +.SH "SEE ALSO" +\fBfaac\fP(1) \ No newline at end of file diff --git a/xbmc/cores/dvdplayer/Codecs/libfaad2/plugins/QCD/QCDFAAD.sln b/xbmc/cores/dvdplayer/Codecs/libfaad2/plugins/QCD/QCDFAAD.sln new file mode 100644 index 00000000..56c2e40d --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/libfaad2/plugins/QCD/QCDFAAD.sln @@ -0,0 +1,29 @@ +ïŧŋ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QCDFAAD", "QCDFAAD.vcproj", "{71955EB0-4F77-462B-A844-2BA56E74B87E}" + ProjectSection(ProjectDependencies) = postProject + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114} = {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "..\..\libfaad\libfaad.vcproj", "{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {71955EB0-4F77-462B-A844-2BA56E74B87E}.Debug|Win32.ActiveCfg = Debug|Win32 + {71955EB0-4F77-462B-A844-2BA56E74B87E}.Debug|Win32.Build.0 = Debug|Win32 + {71955EB0-4F77-462B-A844-2BA56E74B87E}.Release|Win32.ActiveCfg = Release|Win32 + {71955EB0-4F77-462B-A844-2BA56E74B87E}.Release|Win32.Build.0 = Release|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.ActiveCfg = Debug|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.Build.0 = Debug|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.ActiveCfg = Release|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/xbmc/cores/dvdplayer/Codecs/libfaad2/plugins/QCD/QCDFAAD.vcproj b/xbmc/cores/dvdplayer/Codecs/libfaad2/plugins/QCD/QCDFAAD.vcproj new file mode 100644 index 00000000..6f700e44 --- /dev/null +++ b/xbmc/cores/dvdplayer/Codecs/libfaad2/plugins/QCD/QCDFAAD.vcproj @@ -0,0 +1,348 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/Audio.pro b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Audio.pro new file mode 100644 index 00000000..1b335208 --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Audio.pro @@ -0,0 +1,38 @@ +include(../../../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../../ ../../.. ../../../../.. ../../../../ ../../../../utils ../../../../linux ../../../../../guilib ../../Codecs ../../Codecs/ffmpeg +DEFINES += HAVE_MMX __STDC_CONSTANT_MACROS +SOURCES += \ + \ +DVDAudioCodecPcm.cpp \ +DVDAudioCodecFFmpeg.cpp \ +DVDAudioCodecLPcm.cpp \ +DVDAudioCodecPassthrough.cpp \ +DVDAudioCodecLiba52.cpp \ +DVDAudioCodecLibDts.cpp \ +DVDAudioCodecSMD.cpp \ +DVDAudioCodecLibMad.cpp \ +DVDAudioCodecLibFaad.cpp \ + + +HEADERS += \ + \ +DVDAudioCodecPcm.h \ +DVDAudioCodecFFmpeg.h \ +DVDAudioCodecLPcm.h \ +DVDAudioCodecPassthrough.h \ +DVDAudioCodecLiba52.h \ +DVDAudioCodecLibDts.h \ +DVDAudioCodecSMD.h \ +DVDAudioCodecLibMad.h \ +DVDAudioCodecLibFaad.h \ + + +INCLUDEPATH += ../../../../../ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecSMD.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecSMD.cpp new file mode 100644 index 00000000..5b8229bb --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecSMD.cpp @@ -0,0 +1,294 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +#include +#include "system.h" +#ifdef HAS_INTEL_SMD + +#include "DVDAudioCodecSMD.h" +#include "DVDCodecs/DVDCodecs.h" +#include "DVDStreamInfo.h" +#include "DVDPlayerAudio.h" +#include "GUISettings.h" +#include "AdvancedSettings.h" +#include "Settings.h" +#include "utils/log.h" +#include "IntelSMDGlobals.h" + +CDVDAudioCodecSMD::CDVDAudioCodecSMD(void) +{ + m_Codec = CODEC_ID_NONE; + + m_bHardwareDecode = false; + m_DTSHDDetection = 0; + m_bIsDTSHD = false; + m_bBitstreamDTSHD = false; + m_pStateDTS = NULL; + + m_frameBytes = 0; + m_iOutputSize = 0; + + m_sample_size = 0; + m_channel_count = 0; + m_sample_rate = 0; +} + +CDVDAudioCodecSMD::~CDVDAudioCodecSMD(void) +{ + Dispose(); +} + +bool CDVDAudioCodecSMD::IsPassthroughAudioCodec( int Codec ) +{ + bool bSupportsAC3Out = false; + bool bSupportsEAC3Out = false; + bool bSupportsDTSOut = false; + bool bSupportsDTSHDOut = false; + bool bSupportsTrueHDOut = false; + + if( g_guiSettings.GetInt("audiooutput.mode") == AUDIO_DIGITAL_HDMI || + g_guiSettings.GetInt("audiooutput.mode") == AUDIO_DIGITAL_SPDIF) + { + bSupportsAC3Out = g_guiSettings.GetBool("audiooutput.ac3passthrough"); + bSupportsDTSOut = g_guiSettings.GetBool("audiooutput.dtspassthrough"); + } + if( g_guiSettings.GetInt("audiooutput.mode") == AUDIO_DIGITAL_HDMI ) + { + bSupportsEAC3Out = g_guiSettings.GetBool("audiooutput.eac3passthrough"); + bSupportsTrueHDOut = g_guiSettings.GetBool("audiooutput.truehdpassthrough"); + bSupportsDTSHDOut = g_guiSettings.GetBool("audiooutput.dtshdpassthrough"); + } + + // On ISMD we support hardware downmix of EAC3 to AC3 + bSupportsEAC3Out = bSupportsAC3Out; + + // NOTE - DTS-HD is not a codec setting and is always detected after the first two frames + if ((Codec == CODEC_ID_AC3 && bSupportsAC3Out) + || (Codec == CODEC_ID_EAC3 && bSupportsEAC3Out) + || (Codec == CODEC_ID_DTS && bSupportsDTSOut) + || (Codec == CODEC_ID_TRUEHD && bSupportsTrueHDOut)) + { + + return true; + } + + return false; +} +bool CDVDAudioCodecSMD::IsHWDecodeAudioCodec( int Codec ) +{ + return g_IntelSMDGlobals.CheckCodecHWDecode( Codec ); +} + +bool CDVDAudioCodecSMD::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) +{ + bool bSupportsHWDecode = IsHWDecodeAudioCodec( hints.codec ); + bool bSupportsPassthrough = IsPassthroughAudioCodec( hints.codec ); + + // Detect DTS-HD streams; allow up to 3 regular DTS frames before we give up and treat as DTS only + if( hints.codec == CODEC_ID_DTS && g_guiSettings.GetInt("audiooutput.mode") == AUDIO_DIGITAL_HDMI) + { + m_DTSHDDetection = 3; + m_bBitstreamDTSHD = g_guiSettings.GetBool("audiooutput.dtshdpassthrough"); + + if (!m_dllDTS.Load()) + return false; + m_pStateDTS = m_dllDTS.dts_init(0); + if(m_pStateDTS == NULL) + return false; + } + + // Caller has requested bitstream only; if we don't support bitstream for this format + // exit now, otherwise we'll end up hardware decoding + if( hints.bitstream && !bSupportsPassthrough ) + { + return false; + } + + // Format isn't supported + if( !bSupportsPassthrough && !bSupportsHWDecode ) + { + return false; + } + + if( !bSupportsPassthrough ) + m_bHardwareDecode = true; + + // init stream info from hints until we can get these from SMD + m_sample_size = hints.bitspersample; + m_channel_count = hints.channels; + m_sample_rate = hints.samplerate; + m_Codec = hints.codec; + + CLog::Log(LOGINFO, "CDVDAudioCodecSMD::Open successful. codec %d bSupportsHWDecode %d bSupportsPassthrough %d\n", + hints.codec, bSupportsHWDecode, bSupportsPassthrough); + + return true; +} + +#define MAKE_DWORD(x) ((unsigned int)((x)[0] << 24) | ((x)[1] << 16) | ((x)[2] << 8) | ((x)[3])) +bool CDVDAudioCodecSMD::DetectDTSHD(BYTE* pData, int iSize) +{ + if( iSize < 4 ) return false; + + unsigned int syncword = MAKE_DWORD( &pData[0] ); + return ( 0x64582025 == syncword ); +} + +void CDVDAudioCodecSMD::Dispose() +{ + if( m_pStateDTS ) + { + m_dllDTS.dts_free(m_pStateDTS); + m_pStateDTS = NULL; + } +} + +int CDVDAudioCodecSMD::Decode(BYTE* pData, int iSize) +{ + int len = 0; + + //printf("CDVDAudioCodecSMD decode\n"); + + // Copy this frame over in all cases + memcpy(m_frameCache + m_frameBytes, pData, iSize); + m_frameBytes += iSize; + + if( CODEC_ID_DTS == m_Codec && !m_bIsDTSHD && m_DTSHDDetection > 0 && m_bBitstreamDTSHD) + { + int ignore1=0, ignore2=0, ignore3=0, flags=0; + int iFrameSize = m_dllDTS.dts_syncinfo(m_pStateDTS, pData, &flags, &ignore1, &ignore2, &ignore3); + + if( iFrameSize < iSize ) + m_bIsDTSHD = DetectDTSHD( pData + iFrameSize, iSize-iFrameSize ); + m_DTSHDDetection--; + + if( !m_bIsDTSHD ) + { + // Don't let audio initialize; do this by indicating we haven't yet decoded a frame + len = iSize; + m_iOutputSize = 0; + } + else + { + // We detected DTS-HD + // output all frames + m_iOutputSize = m_frameBytes; + len = iSize; + } + } + else + { + // Output the frame as-is + m_iOutputSize = m_frameBytes; + len = iSize; + } + + // make sure audio decoding started otherwise SMD will block + if(g_IntelSMDGlobals.GetAudioStartPts() != ISMD_NO_PTS) + GetStreamInfo(); + + return len; +} + +int CDVDAudioCodecSMD::GetData(BYTE** dst) +{ + int size; + if(m_iOutputSize) + { + *dst = m_frameCache; + size = m_iOutputSize; + + m_iOutputSize = 0; + m_frameBytes = 0; + return size; + } + else + return 0; +} + +void CDVDAudioCodecSMD::Reset() +{ +} + +int CDVDAudioCodecSMD::GetChannels() +{ + return m_channel_count; +} + +enum PCMChannels* CDVDAudioCodecSMD::GetChannelMap() +{ + // We always present stereo ch mapping + static enum PCMChannels map[2] = {PCM_FRONT_LEFT, PCM_FRONT_RIGHT }; + return map; +} + +int CDVDAudioCodecSMD::GetSampleRate() +{ + return m_sample_rate; +} + +int CDVDAudioCodecSMD::GetBitsPerSample() +{ + return m_sample_size; +} + +// See DVDPlayerAudio.h +unsigned char CDVDAudioCodecSMD::GetFlags() +{ + unsigned char flags = 0; + if( m_bHardwareDecode ) flags |= FFLAG_HWDECODE; + else flags |= FFLAG_PASSTHROUGH; + + if( CODEC_ID_TRUEHD == m_Codec || m_bIsDTSHD ) + flags |= FFLAG_HDFORMAT; + + return flags; +} + +void CDVDAudioCodecSMD::GetStreamInfo() +{ + ismd_result_t result; + ismd_audio_processor_t audio_processor; + ismd_dev_t audio_device; + ismd_audio_stream_info_t audio_info; + + audio_processor = g_IntelSMDGlobals.GetAudioProcessor(); + audio_device = g_IntelSMDGlobals.GetPrimaryAudioDevice(); + + if(audio_processor == -1 || audio_device == -1) + return; + + result = ismd_audio_input_get_stream_info( + audio_processor, audio_device, + &audio_info); + + if(result != ISMD_SUCCESS) + return; + + // make sure we got something meaningful + if(audio_info.sample_size != 0) + m_sample_size = audio_info.sample_size; + if(audio_info.channel_count != 0) + m_channel_count = audio_info.channel_count; + if(audio_info.sample_rate != 0) + m_sample_rate = audio_info.sample_rate; +} + +#endif // HAS_INTEL_SMD diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecSMD.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecSMD.h new file mode 100644 index 00000000..b4c9cb70 --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecSMD.h @@ -0,0 +1,76 @@ +#pragma once + +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +#include "DVDAudioCodec.h" +#include +#include +#ifdef HAS_DVD_LIBDTS_CODEC +#include "DllLibDts.h" +#endif + +class CDVDAudioCodecSMD : public CDVDAudioCodec +{ +public: + CDVDAudioCodecSMD(); + virtual ~CDVDAudioCodecSMD(); + + virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options); + virtual void Dispose(); + virtual int Decode(BYTE* pData, int iSize); + virtual int GetData(BYTE** dst); + virtual void Reset(); + virtual int GetChannels(); + virtual enum PCMChannels* GetChannelMap(); + virtual int GetSampleRate(); + virtual int GetBitsPerSample(); + virtual unsigned char GetFlags(); + virtual const char* GetName() { return "smd"; } + +private: + + static bool IsPassthroughAudioCodec( int Codec ); + static bool IsHWDecodeAudioCodec( int Codec ); + + static bool DetectDTSHD(BYTE* pData, int iSize); + +void GetStreamInfo(); + + int m_Codec; + + bool m_bHardwareDecode; + + int m_DTSHDDetection; + bool m_bIsDTSHD; + bool m_bBitstreamDTSHD; + + DllLibDts m_dllDTS; + dts_state_t* m_pStateDTS; + + BYTE m_frameCache[65536]; + int m_frameBytes; + + int m_iOutputSize; + + int m_sample_size; + int m_channel_count; + int m_sample_rate; +}; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.pro b/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.pro new file mode 100644 index 00000000..df6f5cc6 --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.pro @@ -0,0 +1,22 @@ +include(../../../../boxee.pri) + +TEMPLATE = lib +CONFIG += lib_bundle staticlib +CONFIG -= app_bundle +QT += core gui opengl + +MOC_DIR=build +OBJECTS_DIR=build +INCLUDEPATH += . ../ ../../ ../../../ ../../../.. ../../../linux ../../../../guilib ../Codecs ../Codecs/ffmpeg ../../ffmpeg +DEFINES += __STDC_CONSTANT_MACROS +SOURCES += \ +DVDCodecUtils.cpp \ +DVDFactoryCodec.cpp \ + + +HEADERS += \ +DVDCodecUtils.h \ +DVDFactoryCodec.h \ + + +INCLUDEPATH += ../../../../ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDOmxUtils.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDOmxUtils.cpp new file mode 100644 index 00000000..60ebd8de --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDOmxUtils.cpp @@ -0,0 +1,216 @@ +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ +#include "system.h" + +#ifdef HAS_OPENMAX + +#include "DVDOmxUtils.h" +#include "utils/log.h" + +#include +#include +#include + +static const char *pszOmxComponentsName[] = +{ + OMX_DECODER_COMPONENT_NAME_LIST +}; + +CSemaphore::CSemaphore(int sCountMax, int sCountInitial) +{ + m_pMutex = new CCriticalSection; + m_pEvent = new CEvent; + m_sCount = sCountInitial; + m_sCountMax = sCountMax; +} + +CSemaphore::~CSemaphore() +{ + delete m_pMutex; + delete m_pEvent; +} + +bool CSemaphore::Increment() +{ + EnterCriticalSection(m_pMutex); + m_sCount++; + if(m_sCount > m_sCountMax) { + m_sCount = m_sCountMax; + } else { + m_pEvent->Set(); + } + LeaveCriticalSection(m_pMutex); + + return true; +} + +bool CSemaphore::Decrement(int sTimeoutMs) +{ + while (1) { + EnterCriticalSection(m_pMutex); + if(m_sCount > 0) { + m_sCount--; + LeaveCriticalSection(m_pMutex); + break; + } + LeaveCriticalSection(m_pMutex); + + if(sTimeoutMs == 0) { + return false; + } else if(sTimeoutMs == -1) { + m_pEvent->Wait(); + } else { + bool bResult = m_pEvent->WaitMSec(sTimeoutMs); + if(!bResult) { + return false; + } + } + } + + return true; +} + +CQueue::CQueue(int sQueueSize, int sElemSize) +{ + m_sNextPut = 0; + m_sNextGet = 0; + m_sQueueSize = sQueueSize; + m_sItemSize = sElemSize; + m_sItems = 0; + m_pQueueData = new unsigned char [sQueueSize * sElemSize]; + m_pSemGet = new CSemaphore(sQueueSize, 0); + m_pSemPut = new CSemaphore(sQueueSize, sQueueSize); + m_pMutex = new CCriticalSection; + m_pGotElementEvent = new CEvent; +} + +CQueue::~CQueue() +{ + delete m_pSemGet; + delete m_pSemPut; + delete m_pMutex; + delete m_pGotElementEvent; + delete [] m_pQueueData; +} + +bool CQueue::Get(void *pElement, int sTimeoutMs) +{ + if(m_pSemGet->Decrement(sTimeoutMs)) { + EnterCriticalSection(m_pMutex); + m_sNextGet = (m_sNextGet + 1) % m_sQueueSize; + m_sItems--; + if(!m_sItems) { + m_pGotElementEvent->Reset(); + } + memcpy(pElement, m_pQueueData + (m_sNextGet * m_sItemSize), m_sItemSize); + LeaveCriticalSection(m_pMutex); + m_pSemPut->Increment(); + return true; + } + return false; +} + +bool CQueue::Put(void *pElement, int sTimeoutMs) +{ + if(m_pSemPut->Decrement(sTimeoutMs)) { + EnterCriticalSection(m_pMutex); + m_sNextPut = (m_sNextPut + 1) % m_sQueueSize; + memcpy(m_pQueueData + (m_sNextPut * m_sItemSize), pElement, m_sItemSize); + m_pSemGet->Increment(); + m_sItems++; + m_pGotElementEvent->Set(); + LeaveCriticalSection(m_pMutex); + return true; + } + return false; +} + +int CQueue::GetSize() +{ + EnterCriticalSection(m_pMutex); + int size = m_sItems; + LeaveCriticalSection(m_pMutex); + return size; +} + +bool CQueue::Peek(void *pElement, int *psElements) +{ + EnterCriticalSection(m_pMutex); + *psElements = m_sItems; + if(m_sItems) { + int sNextGet = (m_sNextGet + 1) % m_sQueueSize; + memcpy(pElement, m_pQueueData + (sNextGet * m_sItemSize), m_sItemSize); + } + LeaveCriticalSection(m_pMutex); + return true; +} + +bool CQueue::WaitForNotEmpty(int sTimeoutMs) +{ + if(!GetSize()) { + if(sTimeoutMs == -1) { + m_pGotElementEvent->Wait(); + } else { + bool bResult = m_pGotElementEvent->WaitMSec(sTimeoutMs); + if(!bResult) { + return false; + } + } + } + return true; +} + +int g_iOmxInitRefcount = 0; + +bool COmxUtils::OmxInit() +{ + if(!g_iOmxInitRefcount) { + OMX_ERRORTYPE err = OMX_Init(); + if(err != OMX_ErrorNone) { + CLog::Log(LOGDEBUG, "OMX_Init() failed = %X\n", err); + return false; + } + } + g_iOmxInitRefcount++; + return true; +} + +bool COmxUtils::OmxDeinit() +{ + if(g_iOmxInitRefcount == 1) { + OMX_ERRORTYPE err = OMX_Deinit(); + if(err != OMX_ErrorNone) { + CLog::Log(LOGDEBUG, "OMX_Deinit() failed = %X\n", err); + return false; + } + } + if(g_iOmxInitRefcount > 0) { + g_iOmxInitRefcount--; + } + return true; +} + +const char *COmxUtils::OmxGetComponentName(EOmxDecoderTypes eType) +{ + return pszOmxComponentsName[eType]; +} + +#endif diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDOmxUtils.h b/xbmc/cores/dvdplayer/DVDCodecs/DVDOmxUtils.h new file mode 100644 index 00000000..43474076 --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDOmxUtils.h @@ -0,0 +1,183 @@ +#pragma once + +/* + * Copyright (C) 2005-2008 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "utils/Event.h" +#include "utils/CriticalSection.h" + +class CSemaphore { +public: + CSemaphore(int sCountMax, int sCountInitial); + ~CSemaphore(); + bool Increment(); + bool Decrement(int sTimeoutMs = -1); + +private: + CCriticalSection *m_pMutex; + CEvent *m_pEvent; + int m_sCount; + int m_sCountMax; +}; + +class CQueue { +public: + CQueue(int sQueueSize, int sElemSize); + ~CQueue(); + bool Put(void *pElement, int sTimeoutMs); + bool Get(void *pElement, int sTimeoutMs); + int GetSize(); + bool Peek(void *pElement, int *psElements); + bool WaitForNotEmpty(int sTimeoutMs); +private: + int m_sNextGet; + int m_sNextPut; + unsigned char * m_pQueueData; + CSemaphore * m_pSemGet; + CSemaphore * m_pSemPut; + CCriticalSection * m_pMutex; + CEvent * m_pGotElementEvent; + int m_sItems; + int m_sItemSize; + int m_sQueueSize; +}; + +struct OMX_BUFFERHEADERTYPE; +struct OmxDecState; + +enum EOMXEvent { + eOMXEventStateChanged, + eOMXEventFlush, + eOMXEventPortEnable, + eOMXEventPortDisable, + eOMXEventEndOfStream, + eOMXEventPortSettingsChanged, + eOMXEventFirstFrameDisplayed, + eOMXEventUndefined +}; + +typedef void (*ON_OMX_DEC_EMPTY_BUFFER_DONE)(void *pClientThis, OMX_BUFFERHEADERTYPE *pBuffer); +typedef void (*ON_OMX_DEC_FILL_BUFFER_DONE)(void *pClientThis, OMX_BUFFERHEADERTYPE *pBuffer); +typedef void (*ON_OMX_EVENT_COMPLETION)(void *pClientThis, OmxDecState *pOmxDecState, EOMXEvent eOmxEvent, unsigned int uData1, unsigned int uData2); + +struct OmxCallBacks { + ON_OMX_DEC_EMPTY_BUFFER_DONE OnOmxDecEmptyBufferDone; + ON_OMX_DEC_FILL_BUFFER_DONE OnOmxDecFillBufferDone; + ON_OMX_EVENT_COMPLETION OnOmxEventCompletion; +}; + +struct OmxDecState { + OmxCallBacks *pCallBacks; + void *pClientThis; + void *pNvEvent; + CEvent *pStateDoneEvent; +}; + +enum EOmxDecoderTypes { + eAudioDecoderAAC, + eAudioDecoderADTS, + eAudioDecoderEAACP, + eAudioDecoderBSAC, + eAudioDecoderMP3, + eAudioDecoderWAV, + eAudioDecoderWMA, + eAudioDecoderWMAPRO, + eAudioDecoderWMALOSSLESS, + eAudioDecoderVORBIS, + eAudioDecoderAMR, + eAudioDecoderAMRWB, + eVideoDecoderMPEG4, + eVideoDecoderMPEG4Ext, + eVideoDecoderSorenson, + eVideoDecoderMPEG2, + eVideoDecoderVP6, + eVideoDecoderH264, + eVideoDecoderH264Ext, + eVideoDecoderVC1, + eAudioRenderer, + eVideoRendererVGA, + eVideoRendererHDMI, + eClockComponent +}; + +#if 0 +// Bellagio Codec names +#define OMX_DECODER_COMPONENT_NAME_LIST \ + "OMX.st.audio_decoder.aac", \ + "OMX.st.audio_decoder.adts", \ + "OMX.st.audio_decoder.eaacp", \ + "OMX.st.audio_decoder.bsac", \ + "OMX.st.audio_decoder.mp3", \ + "OMX.st.audio_decoder.wav", \ + "OMX.st.audio_decoder.wma", \ + "OMX.st.audio_decoder.wmapro", \ + "OMX.st.audio_decoder.wmalossless", \ + "OMX.st.audio_decoder.vorbis", \ + "OMX.st.audio_decoder.amr", \ + "OMX.st.audio_decoder.amrwb", \ + "OMX.st.video_decoder.mpeg4", \ + "OMX.st.video_decoder.mpeg4ext", \ + "OMX.st.video_decoder.sorenson", \ + "OMX.st.video_decoder.mpeg2", \ + "OMX.st.video_decoder.vp6", \ + "OMX.st.video_decoder.avc", \ + "OMX.st.video_decoder.avc", \ + "OMX.st.video_decoder.vc1" + "OMX.st.audio.render", \ + "OMX.st.std.iv_renderer.overlay.yuv420", \ + "OMX.st.render.hdmi.overlay.yuv420", \ + "OMX.st.clock.component" +#else +// NVIDIA Codecs names +#define OMX_DECODER_COMPONENT_NAME_LIST \ + "OMX.Nvidia.aac.decoder", \ + "OMX.Nvidia.adts.decoder", \ + "OMX.Nvidia.eaacp.decoder", \ + "OMX.Nvidia.bsac.decoder", \ + "OMX.Nvidia.mp3.decoder", \ + "OMX.Nvidia.wav.decoder", \ + "OMX.Nvidia.wma.decoder", \ + "OMX.Nvidia.wmapro.decoder", \ + "OMX.Nvidia.wmalossless.decoder", \ + "OMX.Nvidia.vorbis.decoder", \ + "OMX.Nvidia.amr.decoder", \ + "OMX.Nvidia.amrwb.decoder", \ + "OMX.Nvidia.mp4.decode", \ + "OMX.Nvidia.mp4ext.decode", \ + "OMX.Nvidia.sorenson.decode", \ + "OMX.Nvidia.mpeg2v.decode", \ + "OMX.Nvidia.vp6.decode", \ + "OMX.Nvidia.h264.decode", \ + "OMX.Nvidia.h264ext.decode", \ + "OMX.Nvidia.vc1.decode", \ + "OMX.Nvidia.audio.render", \ + "OMX.Nvidia.std.iv_renderer.overlay.yuv420", \ + "OMX.Nvidia.render.hdmi.overlay.yuv420", \ + "OMX.Nvidia.clock.component" +#endif + +class COmxUtils { +public: + bool OmxInit(); + bool OmxDeinit(); + const char *OmxGetComponentName(EOmxDecoderTypes eType); + +}; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecTX3G.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecTX3G.cpp new file mode 100755 index 00000000..3f0a7ee5 --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecTX3G.cpp @@ -0,0 +1,236 @@ +/* + * Copyright (C) 2011 Team XBMC + * http://www.xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#include "system.h" +#include "DVDOverlayCodecTX3G.h" +#include "DVDOverlayText.h" +#include "DVDStreamInfo.h" +#include "DVDCodecs/DVDCodecs.h" +#include "utils/log.h" + +// 3GPP/TX3G (aka MPEG-4 Timed Text) Subtitle support +// 3GPP -> 3rd Generation Partnership Program +// adapted from https://trac.handbrake.fr/browser/trunk/libhb/dectx3gsub.c; + +// NOTE: None of these macros check for buffer overflow +#define READ_U8() *pos; pos += 1; +#define READ_U16() (pos[0] << 8) | pos[1]; pos += 2; +#define READ_U32() (pos[0] << 24) | (pos[1] << 16) | (pos[2] << 8) | pos[3]; pos += 4; +#define READ_ARRAY(n) pos; pos += n; +#define SKIP_ARRAY(n) pos += n; + +#define FOURCC(str) ((((uint32_t) str[0]) << 24) | \ + (((uint32_t) str[1]) << 16) | \ + (((uint32_t) str[2]) << 8) | \ + (((uint32_t) str[3]) << 0)) + +typedef enum { + BOLD = 0x1, + ITALIC = 0x2, + UNDERLINE = 0x4 +} FaceStyleFlag; + +// NOTE: indices in terms of *character* (not: byte) positions +typedef struct { + uint16_t bgnChar; + uint16_t endChar; + uint16_t fontID; + uint8_t faceStyleFlags; // FaceStyleFlag + uint8_t fontSize; + uint32_t textColorRGBA; +} StyleRecord; + +CDVDOverlayCodecTX3G::CDVDOverlayCodecTX3G() : CDVDOverlayCodec("TX3G Subtitle Decoder") +{ + m_pOverlay = NULL; +} + +CDVDOverlayCodecTX3G::~CDVDOverlayCodecTX3G() +{ + if (m_pOverlay) + SAFE_RELEASE(m_pOverlay); +} + +bool CDVDOverlayCodecTX3G::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) +{ + if (hints.codec == CODEC_ID_MOV_TEXT) + return true; + return false; +} + +void CDVDOverlayCodecTX3G::Dispose() +{ + if (m_pOverlay) + SAFE_RELEASE(m_pOverlay); +} + +int CDVDOverlayCodecTX3G::Decode(BYTE* data, int size, double pts, double duration) +{ + if (m_pOverlay) + SAFE_RELEASE(m_pOverlay); + + m_pOverlay = new CDVDOverlayText(); + + // do not move this. READ_XXXX macros modify pos. + uint8_t *pos = data; + uint8_t *end = pos + size; + + // Parse the packet as a TX3G TextSample. + // Look for a single StyleBox ('styl') and + // read all contained StyleRecords. + // Ignore all other box types. + // NOTE: Buffer overflows on read are not checked. + // ALSO: READ_XXXX/SKIP_XXXX macros will modify pos. + uint16_t textLength = READ_U16(); + uint8_t *text = READ_ARRAY(textLength); + + int numStyleRecords = 0; + uint8_t *bgnStyle = (uint8_t*)calloc(textLength, 1); + uint8_t *endStyle = (uint8_t*)calloc(textLength, 1); + while (pos < end) + { + // Read TextSampleModifierBox + uint32_t size = READ_U32(); + if (size == 0) + size = pos - end; // extends to end of packet + if (size == 1) + { + CLog::Log(LOGDEBUG, "CDVDOverlayCodecTX3G: TextSampleModifierBox has unsupported large size" ); + break; + } + uint32_t type = READ_U32(); + if (type == FOURCC("uuid")) { + CLog::Log(LOGDEBUG, "CDVDOverlayCodecTX3G: TextSampleModifierBox has unsupported extended type" ); + break; + } + + if (type == FOURCC("styl")) + { + // Found a StyleBox. Parse the contained StyleRecords + if ( numStyleRecords != 0 ) + { + CLog::Log(LOGDEBUG, "CDVDOverlayCodecTX3G: found additional StyleBoxes on subtitle; skipping" ); + SKIP_ARRAY(size); + continue; + } + + numStyleRecords = READ_U16(); + for (int i = 0; i < numStyleRecords; i++) + { + StyleRecord curRecord; + curRecord.bgnChar = READ_U16(); + curRecord.endChar = READ_U16(); + curRecord.fontID = READ_U16(); + curRecord.faceStyleFlags = READ_U8(); + curRecord.fontSize = READ_U8(); + curRecord.textColorRGBA = READ_U32(); + + bgnStyle[curRecord.bgnChar] |= curRecord.faceStyleFlags; + endStyle[curRecord.endChar] |= curRecord.faceStyleFlags; + } + } + else + { + // Found some other kind of TextSampleModifierBox. Skip it. + SKIP_ARRAY(size); + } + } + + // Copy text to out and add HTML markup for the style records + int charIndex = 0; + CStdStringA strUTF8; + for (pos = text, end = text + textLength; pos < end; pos++) + { + if ((*pos & 0xC0) == 0x80) + { + // Is a non-first byte of a multi-byte UTF-8 character + strUTF8.append((const char*)pos, 1); + continue; // ...without incrementing 'charIndex' + } + + uint8_t bgnStyles = bgnStyle[charIndex]; + uint8_t endStyles = endStyle[charIndex]; + + // [B] or [/B] -> toggle bold on and off + // [I] or [/I] -> toggle italics on and off + // [COLOR ffab007f] or [/COLOR] -> toggle color on and off + // [CAPS